Skip to content

Interface: BreakMap ​

Experimental

The compressed linear space of an axis with range breaks (see the module docs). Raw values are ms since the epoch (UTC) on date axes and plain numbers on linear axes.

Properties ​

PropertyModifierTypeDescription
hasDayOfWeekreadonlybooleanExperimental Any enabled 'day of week' break (Plotly _hasDayOfWeekBreaks).
keyreadonlystringExperimental Identity of the mapping: equal keys ⇒ same mapping (the runtime reuses scales by it).

Methods ​

breaksIn() ​

ts
breaksIn(lo, hi): object[];

Experimental

Merged, sorted breaks overlapping [lo, hi] in raw space, clipped to it (Plotly locateBreaks). Allocates; O(weeks in the interval) with pattern breaks, which are only enumerated between finite bounds.

Parameters ​

ParameterType
lonumber
hinumber

Returns ​

object[]


inBreak() ​

ts
inBreak(raw): boolean;

Experimental

Is raw inside a break (min ≤ raw < max)?

Parameters ​

ParameterType
rawnumber

Returns ​

boolean


moveOutside() ​

ts
moveOutside(raw): number;

Experimental

Plotly's moveOutsideBreak: raw itself when it is not in a break, else the end of the (merged) break containing it. Exact.

Parameters ​

ParameterType
rawnumber

Returns ​

number


toLinear() ​

ts
toLinear(raw): number;

Experimental

raw → linear (compressed); a raw value inside a break gives the break's linear point. Monotone non-decreasing; toLinear(0) === 0 (the anchor); exact for integer |raw| up to ±1e14. Non-finite values pass through.

Parameters ​

ParameterType
rawnumber

Returns ​

number


toRaw() ​

ts
toRaw(l, atStart?): number;

Experimental

linear → raw, outside breaks: a break's linear point maps to the break END (where Plotly moves ticks), or with atStart to the break START (the last raw value before it: what the upper end of a range shows). toLinear(toRaw(l)) === l (to float precision). Non-finite values pass through.

Parameters ​

ParameterType
lnumber
atStart?boolean

Returns ​

number

Released under the MIT License.