Skip to main content
100%

Voronoï playground: Voronoï treemap (study 3)

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

This example shows a hierarchical Voronoï treemap, where nested data is partitioned into a circular diagram using weighted Voronoï cells. The visualization displays either the weighted Voronoï cells, the cell weights as circles, or both, with an option to toggle site visibility. It uses the d3-voronoi-map plugin to recursively compute one-level Voronoï maps for each hierarchy level, clipping polygons for child nodes as they are generated. The code builds on d3.hierarchy and d3.scaleOrdinal with the d3.schemeSet1 color palette, rendering the result as SVG.

AI-generated description

This block experiments how to produce a hierarchical Voronoï treemap based on hierarchical/nested data (cf. d3.hierarchy). It uses the d3-voronoi-map plugin which compute one-level Voronoï maps.

Notes :

  • the algorithm, initiated with the root node and the clipping polygon, is as follow:
  • if node as children, compute the one-level Voronoï map of the clipping polygon and the children's data, thanks to the d3-voronoi-map
  • repeat for each child with children and child-related computed polygon
  • this is a layered algorithm: the Voronoï map of a particular node must be computed/stabilized before computing nested Voronoï maps of nested data; this approach ensures that clipping polygons remain the same when computing nested Voronoï maps; otherwise, the algorithm should handle sites that may become out of clipping polygons

User interactions :

  • you can choose to draw the Weighted Voronoï Diagram (default), the weights (visualized as circles), or both.
  • you can hide/show sites.

Acknowledgments to :

gpl-3.0 Licensed

Similar vizzes