Skip to content

Documentation / @ripl/charts / resolveSegmentLabelLayout

Function: resolveSegmentLabelLayout()

resolveSegmentLabelLayout(geometry, labels, text, minAngle?): SegmentLabelLayout

Defined in: charts/src/core/labels.ts:287

Resolves a segment's label into a ready-to-render layout (inside centroid or outside leader line), honouring visibility, an optional minimum-angle clutter guard, and position/font/colour options. Shared by the pie and polar-area charts so their label behaviour is identical.

The connector always has ≥2 points (a degenerate line at the anchor when hidden or inside) so Polyline.getBoundingBox stays safe and renders nothing for non-outside labels.

Parameters

ParameterTypeDefault value
geometryRadialLabelInputundefined
labelsChartSegmentLabelsOptionsundefined
textstringundefined
minAnglenumber0

Returns

SegmentLabelLayout