centroid method
Returns the projected planar centroid (typically in pixels) for the
specified GeoJSON object
.
path.centroid(california) // [82.08679434495191, 288.14204870673404]
This is handy for, say, labeling state or county boundaries, or displaying a symbol map. For example, a noncontiguous cartogram might scale each state around its centroid. This method observes any clipping performed by the transform; see GeoProjection.clipAngle and GeoProjection.clipExtent. This is the planar equivalent of geoCentroid.
Implementation
List<double> centroid(Map object) =>
planar.centroid(object, _transformStream);