Props
Data
ReadonlyArray<{x: number, y: number}>
The coordinates of all the points in the curve, as an array of objects with x and y coordinates.
number | ReadonlyArray<{x: number, y: number}>
Baseline of the area:
- If a number: uses the corresponding axis value as a flat baseline
- If an array of coordinates: describes a custom baseline path
Interpolation
CurveType
default:"linear"
The interpolation type of curve. Can be:
'basis'- B-spline interpolation'basisClosed'- Closed B-spline'basisOpen'- Open B-spline'bumpX'- Bump curve with horizontal segments'bumpY'- Bump curve with vertical segments'bump'- Bump curve (uses layout to determine direction)'linear'- Piecewise linear segments'linearClosed'- Closed linear path'natural'- Natural cubic spline'monotoneX'- Cubic spline that preserves monotonicity in x'monotoneY'- Cubic spline that preserves monotonicity in y'monotone'- Monotone cubic spline (uses layout to determine direction)'step'- Step function'stepBefore'- Step function with vertical segment before horizontal'stepAfter'- Step function with vertical segment after horizontal- Custom function: a D3 curve factory function
'horizontal' | 'vertical'
This option affects the interpolation algorithm when the type prop is set to ‘monotone’ or ‘bump’.
It also specifies the type of baseline when the curve is closed.
boolean
default:"false"
Whether to connect the curve across null points.When
false, gaps appear in the curve where data points are null.
When true, the curve connects across null values.See examples:Appearance
string
CSS class name to apply to the curve element.
string | number
The pattern of dashes and gaps used to paint the line.Examples:
"5 5"- 5px dashes with 5px gaps"10 5 2 5"- More complex pattern10- Single number interpreted as “10 10”
string
A pre-computed SVG path string. If provided, this is used instead of computing the path from points.
Ref<SVGPathElement>
React ref to access the underlying SVG path element.
SVG properties
This component accepts all standard SVG path element properties including:fill- Fill colorstroke- Stroke colorstrokeWidth- Stroke widthopacity- Opacity valuestyle- Inline styles
Events
(e: React.MouseEvent<SVGPathElement>) => void
Event handler for click events on the curve.
(e: React.MouseEvent<SVGPathElement>) => void
Event handler for mouseenter events on the curve.
(e: React.MouseEvent<SVGPathElement>) => void
Event handler for mouseleave events on the curve.
(e: React.MouseEvent<SVGPathElement>) => void
Event handler for mousedown events on the curve.
(e: React.MouseEvent<SVGPathElement>) => void
Event handler for mouseup events on the curve.
(e: React.MouseEvent<SVGPathElement>) => void
Event handler for mousemove events on the curve.
(e: React.MouseEvent<SVGPathElement>) => void
Event handler for mouseover events on the curve.
(e: React.MouseEvent<SVGPathElement>) => void
Event handler for mouseout events on the curve.