PitchKit
API Reference@pitchkit/coreFunctions

stepPath()

function stepPath(points): string;

Defined in: packages/core/src/race/step-path.ts:20

An SVG path through points as a step function, holding each value until the next point's x and then jumping.

This is what d3 calls curveStepAfter, Recharts stepAfter and Observable Plot step-after, and it is the only correct interpolation for a running total: anything that slopes between points draws xG accruing during minutes when no shot was taken. There is deliberately no curve option for that reason.

Returns geometry as a d string, the same contract as arcPathData — core owns the maths, @pitchkit/react owns the element.

Zero-length segments are skipped, so two events in the same minute emit one V rather than an H0 V, and the full-time anchor (which shares the last real point's y) contributes only its H.

Parameters

ParameterType
pointsreadonly Point[]

Returns

string

On this page