This block is a Work In Progress, which tries to implements a Voronoï map (i.e., one-level treemap) based on the algorithm presented in Computing Voronoi Treemaps - Faster, Simpler, and Resolution-independent. Because this algorithm requires the computation of weighted Voronoï, this block uses the d3-weighted-voronoi plugin.
Without going into details (cf. the scientific paper), at each iteration :
- the weighted voronoi diagram is computed based on each weighted sites
- then, each site is re-position at the center of its influence area
- then, another weighted voronoi diagram is computed based on each weighted relocated sites
- then, each site is re-weighted in order to fit its expected influence area
The algorithm stops when each site is no longer moved or re-weighted (more exactly, when each site is moved or is re-weighted below a certain treshold), or if a certain number of iterations is reached.
Notes :
- only one level, no nested hierarchy
- as stated in the scientifc paper, the algorithm reaches a stable state at approximatively 15%-20% of error (sum of differences between computed areas and expected areas is about 15%-20% of the total available area)
- experiments show that near-zero weights are difficult to handle, causing flickering
User interactions :
- you can choose to draw the Weighted Voronoï Diagram (default) or the weights (visualized as circles).
- you can hide/show sites
- you can choose among different rendering (greyscale, radial rainbow, or conical rainbow (default, having hard-&-fun time to implement it because canvas don’t provides conical gradient)).
Acknowledgments to :