steppedPath

Chart
stable

Generate a staircase SVG path string through an array of [x, y] points. Each step moves horizontally to the next x then vertically to the next y, producing the discrete-state "event log" look.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

points
required
Array<TPathPoint>
Ordered array of [x, y] tuples. Returns an empty string when the array is empty.

API

Return value

The value returned by this util.

An SVG path data string using M and L commands that forms a horizontal-then-vertical staircase.

Usage

Examples

Ready-to-paste usage snippets.

Draw a stepped chart line

typescript