arc.centroid()

arc.centroid(arguments…)

Computes the midpoint [x, y] of the center line of the arc that would be generated by the given arguments. The arguments are arbitrary; they are simply propagated to the arc generator’s accessor functions along with the this object. To be consistent with the generated arc, the accessors must be deterministic, i.e., return the same value given the same arguments. The midpoint is defined as (startAngle + endAngle) / 2 and (innerRadius + outerRadius) / 2. For example:

Circular Sector CentroidsAnnular Sector Centroids

Note that this is not the geometric center of the arc, which may be outside the arc; this method is merely a convenience for positioning labels.

doc_D3_Js
2016-11-24 10:25:13
Comments
Leave a Comment

Please login to continue.