Skip to main content
100%

Voronoï playground : interactive weighted Voronoï study III (multiple sites)

✓ Published0🌍 Public
KKcnarf
Last edited Dec 3, 2018
Created on Apr 28, 2017

An interactive study of weighted Voronoi diagrams, this d3.v4 visualization shows four draggable sites (two blue, two green) and their influence areas, or cells, within a rectangular clipping polygon. Sliders control the weight of each color group, and unit circles around sites indicate their relative weights. The diagram is computed via a parabolic power diagram algorithm, with convex hulls and 3D-to-2D dual-point mapping, then clipped using the Sutherland–Hodgman method via `d3.polygonClip`. Cell polygons render in SVG with transitions, while `d3.select` manages user interactions.

AI-generated description

This block experiments weighted Voronoï diagram (the 2D additive weighted power diagram variation) with many sites. This is a continuation of 2 and 1.

This is still a Work In Progress, as the code is not yet packaged/self-contained, and contains weird hacks. For a more up-to-date version of the code, please refer to the Weighted Voronoi Treemap in D3v4 block.

What are you seeing ?

  • there is 4 sites (two blue and two green), with their corresponding influence areas (i.e. cells)
  • if weights are big enough, circles around sites give a sense of the weight of each site

User interactions :

  • you can change the weight of a group of sites with the corresponding slider
  • you can drag and drop each site

Acknowledgments to :

  • <a href='https://d3js.org/'>D3.js</a> (v.4)
  • <a href='http://blockbuilder.org'>blockbuilder.org</a>
  • <a href='http://bl.ocks.org/mkedwards/'>mkedwards</a>'s block: <a href='http://bl.ocks.org/mkedwards/759e719eefe36cf9c8ab'>Treemap</a>
gpl-3.0 Licensed

Similar vizzes