Skip to main content
cngx-src documentation

buildCurvePath

Functioncommon/chart/path

projects/common/chart/path/curve.ts

Description#

Build the SVG d attribute for a sequence of points.

Signature#

buildCurvePath(points, curve: CngxCurve)

Parameters#

@parampoints

Pixel-coordinate points to connect.

@paramcurveCngxCurve

Interpolation strategy. 'linear' joins points with straight L commands; 'monotone' uses cubic Béziers with the monotone-X tangent rule (Fritsch-Carlson) so the curve never overshoots between data points.

Returns#

string

The full path data starting with M. Returns '' when the input is empty; M x y when the input has one point.