block by Fil cf2c19710832bc77804e4ca3ca18ab8b

Elliptic / scaled Polylabel with D3

Full Screen

Testing @mourner’s polylabel with D3.

Orange dot = centroid ; white dot = normal polylabel; green dot = elliptic polylabel.

In this variant from Polylabel with D3 we set different scales for x and y, so as to find the “largest ellipse” to accomodate “horizontal” text labels (the ellipse ratio would match the text bbox ratio).

Built with blockbuilder.org, base map by @mbostock.

index.html

polylabel.js