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.