Skip to main content
100%

polylabel.js

✓ Published0🌍 Public
LLuisSevillano
Last edited Oct 25, 2016
Created on Oct 25, 2016

A choropleth of US states renders state boundaries in gray and places each state's two-letter abbreviation at the point most distant from its borders. Using `polylabel.js`, the map calculates the pole of inaccessibility for each state's projected coordinates, ensuring labels sit inside irregular shapes like Washington's islands. Built with D3 v4, the visualization projects geographic data via `d3.geoPath` and `d3.geoAlbersUsa`, animated on SVG paths and text elements.

AI-generated description

Easy example using polylabel.js by Vladimir Agafonkin: A fast algorithm for finding the pole of inaccessibility of a polygon.
Must read this post.

Similar vizzes