flowchart LR A["Sites\n[x,y]"] --> B["sort by x, y"] B --> C["recursiveSplit"] C --> D["walkMergeLine"] D --> E["polygonizeSite"] E --> F["toCell DTO\n+ SVG path"] style A fill:#4caf50 style B fill:#2196f3 style C fill:#ff9800 style D fill:#9c27b0 style E fill:#f44336 style F fill:#009688
flowchart TD A["metric.distance"] --> OK["β swappable"] B["bisector.up flag"] --> NO["β L1 only"] C["sort points by y (up)\nor x (down)"] --> NO D["first border crossed\n= min y-difference"] --> NO E["two strokes:\nup from corner, down from corner"] --> NO style OK fill:#4caf50 style NO fill:#f44336 style A fill:#2196f3 style B fill:#ff9800 style C fill:#ff9800 style D fill:#ff9800 style E fill:#ff9800
graph LR subgraph Delaunay D1["triangle"] --- D2["triangle"] end subgraph Voronoi V1["circumcenter"] --- V2["circumcenter"] end D1 -. "dual" .-> V1 D2 -. "dual" .-> V2 style D1 fill:#2196f3 style D2 fill:#2196f3 style V1 fill:#9c27b0 style V2 fill:#9c27b0
flowchart TD S["n sites, sorted by x"] --> L["recurse left"] S --> R["recurse right"] L --> M["merge"] R --> M M --> T["Delaunay triangulation"] T --> V["Voronoi cells"] style S fill:#4caf50 style L fill:#2196f3 style R fill:#2196f3 style M fill:#ff9800 style T fill:#9c27b0 style V fill:#009688
graph LR q0["q0\norig β dest"] --> q1["q1\nrot"] q1 --> q2["q2\ndest β orig"] q2 --> q3["q3\nrot (dual)"] q3 --> q0 style q0 fill:#4caf50 style q2 fill:#2196f3 style q1 fill:#ff9800 style q3 fill:#9c27b0
flowchart LR G["sample grid\npoints"] --> N["nearest site\n(Euclidean)"] G --> C["find containing\ncell polygon"] N --> A{"same site?"} C --> A A -->|yes| P["β pass"] A -->|no| F["β violation"] style G fill:#4caf50 style N fill:#2196f3 style C fill:#ff9800 style A fill:#9c27b0 style P fill:#009688 style F fill:#f44336
flowchart LR U["l2.html\n?points=N"] --> B1["generateL1Voronoi"] U --> B2["generateL2Voronoi"] B1 --> P1["L1 cells\n+ L1 Delaunay"] B2 --> P2["L2 cells\n+ L2 Delaunay"] style U fill:#4caf50 style B1 fill:#2196f3 style B2 fill:#ff9800 style P1 fill:#9c27b0 style P2 fill:#009688
graph LR A["L1\nLeeβWong"] --> B["metric seam\n(createL1Metric)"] B --> C["L2\nGuibasβStolfi"] C --> D["shared DTO\ntoCell"] D --> E["one demo,\nfour figures"] style A fill:#4caf50 style B fill:#2196f3 style C fill:#ff9800 style D fill:#9c27b0 style E fill:#009688