Skip to main content
Also has everything from ElementHandle. A draggable curve. Points use 0..1 for x; the first point is always pinned to the left edge and the last to the right edge.

Creation

number
required
Output range minimum used by Sample.
number
required
Output range maximum used by Sample.

SetXRange

Display range and units for the x axis. Affects Sample input mapping; doesn’t move points.

SetYSuffix

Units shown on the y axis.

SetHeight

How tall the editor is (minimum 40).

SetPoints

Replace all points. Values are clamped, sorted, and endpoints re-pinned.

AddPoint

Add a point. Returns its index, or nil if it couldn’t be added.

RemovePoint

Remove a point. The first and last can’t be removed.

MovePoint

Endpoints keep x at 0 / 1.

Reset

Reset to a preset. Defaults to "linear".

Sample

Get the curve’s y at a given x. x is in your SetXRange, output is in [min, max].

SampleNormalized

Same as Sample, but 0..1 for both input and output. GetValue returns the point array.

Example