Voronoi

Nearest-site regions of a set of points: the plot is split into one region per site, each region being every spot that is closer to its site than to any other site (a catchment or service area: which store, depot, sensor or office is nearest). Regions come from a Delaunay triangulation and its Voronoi cells (d3-delaunay, with delaunator and robust-predicates), clipped to the sites' extent plus a margin, with nice axis ticks in the data's own units. Each region is filled with a light colour by group (a legend names every group, never colour alone) or with one light fill and a visible outline when there are no groups; the site is a dot, and its label sits under the dot when the region is wide enough for it (otherwise the label is hidden; the full label is in the region's tooltip and in the table). Static SVG, no script, scaled to its container. The hidden table lists every site with x, y, group, value and its share of the area. The aria label gives the number of sites, the number of groups and the site with the largest region. Motion-ready: each region reads --p through a --k so a motion_timeline track on p fades the regions in one after another; the standalone render is the finished picture.

Surfaces
webgoogle-apps-script-webmcp-appsandroid
Degraded on
SurfaceNote
pdfPrints the finished picture; no motion
Live preview
Which depot is nearest? 12 delivery depots by operator
North (km)
0
2
4
6
8
10
12
0
2
4
6
8
10
12
14
Harbour
Old Town
Station
Market
Airport
University
Docks East
Ring Road
Park
Retail Park
Hospital
Canal
East (km)
NorthlineParceloSwiftly
Each region is the part of the area that is nearer to its site than to any other (straight-line distance in the x and y units). In a narrow container some names are hidden; the table lists every site and its share of the area.
SitexyGroupValueShare of the area
Harbour2.13.4Northline18 min12.9%
Old Town4.65.2Northline12.5 min5.7%
Station6.84.1Parcelo9 min5.3%
Market5.27.9Parcelo14 min6.4%
Airport10.48.8Swiftly22.25 min11.1%
University8.19.6Swiftly11 min7.9%
Docks East11.52.6Parcelo20 min11.6%
Ring Road8.96.3Northline8 min6.4%
Park1.48.2Swiftly16 min8.3%
Retail Park12.36Northline13 min7.8%
Hospital3.510.9Parcelo10 min7.5%
Canal7.11.7Swiftly15 min9.0%
Fields
FieldTypeRequired
titlestring (optional, max 80).optional
sitesarray (required, 3 to 200) of {x, y (numbers, required), label (optional, max 24), group (optional, max 20), value (optional number)}. A site whose position equals an earlier site's is merged into the first, with a note. An entry that is not an object with finite numeric x and y (or beyond 1e12) is left out and counted in a note; entries beyond the first 200 are noted and not used; fewer than 3 sites at different positions gets a note instead of the chart. A label or group that is a number is shown as that number; a list, object or boolean is no text (the site is called "Site 1", "Site 2" ... by its place in the list, and has no group). value is shown in the table and in the region's tooltip only, never drawn.optional
x_labelstring (optional, max 30). Under the plot.optional
y_labelstring (optional, max 30). Above the plot.optional
unitstring (optional, max 12). Appended to the values in the table and the tooltips.optional
versioninteger (optional, default 1). The voronoi contract the payload was written for. Only version 1 exists; a higher whole number is drawn as version 1 with a note.optional
Example payload
{
  "type": "voronoi"
}
ARD catalog entry
{
  "identifier": "urn:air:a2uicatalog.ai:atom:voronoi",
  "displayName": "Voronoi",
  "type": "application/vnd.a2ui.atom+json",
  "url": "https://a2uicatalog.ai/atoms/voronoi",
  "capabilities": [
    "web",
    "google-apps-script-web",
    "mcp-apps",
    "android"
  ],
  "description": "Nearest-site regions of a set of points: the plot is split into one region per site, each region being every spot that is closer to its site than to any other site (a catchment or service area: which store, depot, sensor or office is nearest). Regions come from a Delaunay triangulation and its Voronoi cells (d3-delaunay, with delaunator and robust-predicates), clipped to the sites' extent plus a margin, with nice axis ticks in the data's own units. Each region is filled with a light colour by group (a legend names every group, never colour alone) or with one light fill and a visible outline when there are no groups; the site is a dot, and its label sits under the dot when the region is wide enough for it (otherwise the label is hidden; the full label is in the region's tooltip and in the table). Static SVG, no script, scaled to its container. The hidden table lists every site with x, y, group, value and its share of the area. The aria label gives the number of sites, the number of groups and the site with the largest region. Motion-ready: each region reads --p through a --k so a motion_timeline track on p fades the regions in one after another; the standalone render is the finished picture.",
  "representativeQueries": [
    "show a voronoi: nearest-site regions of a set of points (catchments, service areas)",
    "nearest-site regions of a set of points: the plot is split into one region per site, each region bei",
    "render a voronoi"
  ]
}
← Full ARD catalog
Deploy your own Google Apps Script renderer

The renderer is an open-source Google Apps Script web app. Deploy your own instance in 4 commands — you own the URL, no dependency on the demo endpoint.

git clone https://github.com/a2uicatalog/a2ui
cd a2ui/apps-script-surface/gas-wired-renderer
clasp push && clasp deploy
Full deploy guide →