Skip to content

Function: linearExtremes() ​

ts
function linearExtremes(values, padPx?, options?): AxisExtremes;

Experimental

Autorange extremes of linear coordinates (plan E3.2), for traces whose calc already linearized their data: the minimum and maximum with the px padding each needs (e.g. marker radius). With per-point padding only non-dominated points are kept, which stays small in practice, so autorange cost does not grow with the data. Non-finite values are skipped. (Core's scales also provide a data-space findExtremes(scale, values, opts) with Plotly's full option set.)

Parameters ​

ParameterTypeDefault valueDescription
valuesArrayLike<number>undefinedLinear coordinates.
padPxnumber | ArrayLike<number>0Padding for every point, or one value per point.
options{ padded?: boolean; }{}-
options.padded?booleanundefinedAlso leave Plotly's 5%-of-length padding (markers, text).

Returns ​

AxisExtremes

Released under the MIT License.