ToolJovia
Math

Voronoi Diagram SVG Generator

Create a complete clipped nearest-site SVG from your integer points, with exact rational cell vertices, areas and source evidence.

✓ Browser-local processing
A selected file takes precedence over pasted source. No upload.

Loading tool…

How to use Voronoi Diagram SVG Generator

Draw which original site is nearest to each part of a rectangle. Supply a small point list and download all clipped Voronoi cells together as a local SVG. The accompanying JSON keeps every source record and exact rational geometry, including outside sites whose clipped regions are empty, a point or a segment. This is useful for a small original illustration or teaching model with a known coordinate scale.

  1. Choose a local UTF-8 CSV or paste exact label,x,y source. Give 1–40 distinct coordinate pairs and an explicit rectangle.
  2. Run the diagram. Review each source record, its clipped dimension and the exact area conservation check in the output. Outside sites remain listed.
  3. Download SVG for a rounded drawing or JSON for exact rational vertices, source records and shared-vertex ties. Inspect private labels and source before sharing either artifact.

Good to know

  • Coordinates and rectangle bounds are canonical ASCII integer strings from -10,000 through 10,000. No leading zeros, plus signs, -0, fractions, decimals or exponents. Rectangle minima must be less than maxima. Distinct site coordinates are required; duplicate literal labels are allowed and remain separate source records.
  • CSV headers are exactly label,x,y in that order. Labels use at most 40 UTF-16 units and a title at most 80, with well-formed Unicode and no outer whitespace, controls, bidi formatting or noncharacters. Quoted commas and quotes follow CSV syntax. Record numbers count data records, not physical lines. The original decoded CSV, including an initial BOM and line endings, is retained in JSON.
  • Each cell is the intersection of the rectangle and all closed nearest-Euclidean half-planes. Shared boundaries retain ties and contribute zero duplicated area. Empty, point-only and segment-only cells are reported explicitly. vertexTies describes tied ownership at reported vertices; entire tied edges follow the closed inequalities. This does not assign an arbitrary exclusive winner on a boundary.
  • All geometric predicates, intersections and areas use reduced BigInt fractions. SVG coordinates alone are rounded to at most 9 decimal places with a uniform Euclidean scale. Very small regions can be visually indistinguishable; crowded site numbers can overlap. The indexed legend preserves correspondence without relying only on color. Exact JSON is authoritative, not a pixel-perfect or overlap-free drawing claim.
  • Use at most 20,000 source UTF-16 units and 60,000 UTF-8 file bytes. Local file reading has a 5-second deadline. A dedicated same-origin module Worker has 10 seconds to prepare and 2 seconds to compute, with termination on success or refusal. Browsers without module Workers or grapheme segmentation refuse.
  • The whole request shares caps of 5,000,000 exact-arithmetic/reduction steps, 200,000 clipping/witness steps, 131,072 bits per intermediate rational numerator or denominator and 1,720 cell vertices. The complete SVG is at most 300,000 UTF-16 units and UTF-8 bytes; JSON is at most 1,000,000 of each. Unsupported input or any budget refusal returns no partial diagram.
  • This is a bounded plane-coordinate illustration, not a geographic projection, Earth-distance model, weighted diagram, obstacle planner, Delaunay generator or unbounded-ray export. It neither fetches URLs nor executes source markup or code. No upload, account, persistence, anonymization or full accessibility certification is provided. Native font, download and CSP checks are separate release gates.

Common questions

What happens when a site lies outside the rectangle?

Its nearest region may still enter the rectangle. Every original site remains in source order with its complete clipped geometry, even when the result has zero area or is empty. An outside marker is omitted from the drawing frame but remains in the legend and JSON.

Why are some values fractions and the SVG decimal?

A perpendicular bisector intersection can be rational even when every site is an integer. JSON preserves the exact reduced fraction. The SVG uses rounded coordinates that browsers can draw; its visual precision is not a substitute for the exact geometry.

Do two cells overlap on a shared boundary?

Yes. The closed nearest-distance definition retains every tied owner on an edge or vertex. Cell interiors partition the rectangle and their exact areas sum to the rectangle area. No random tie break or epsilon changes the geometry.

Keep going with related tools

All math →