block by jeremycflin 7689045f940e258712ae4d34c4f0af3c

Map with Voronio Polygons for Tooltip

Full Screen

This is in answer to the Stack Overflow question Show info when hovering over voronoi polygons (in D3.js). In this example the title attribute has been used for the ‘tooltip’ but there are better alternatives around. This example uses an accessor function to specify the x and y for the Voronoi polygons and created an object locCities to store the descriptive variables, although the conversion of co-ordinates using the projection function could have been done in the accessor function and the orginal data used i.e. the cities variable. Also, note that an old version of d3 has been used due to some change in the Albers Usa projection.

forked from phil-pedruco‘s block: Map with Voronio Polygons for Tooltip