Skip to main content

Abstract Class: ScaleBase

Defined in: src/mobjects/graphing/scale.ts:29

ScaleBase - base class for graphing scaling strategies.

Mirrors ManimCE's _ScaleBase. Subclasses override ScaleBase.function and ScaleBase.inverseFunction. Subclasses that set customLabels override ScaleBase.getCustomLabels.

Extended by​

Constructors​

Constructor​

new ScaleBase(customLabels): ScaleBase

Defined in: src/mobjects/graphing/scale.ts:33

Parameters​

customLabels​

boolean = false

Returns​

ScaleBase

Properties​

customLabels​

readonly customLabels: boolean

Defined in: src/mobjects/graphing/scale.ts:31

Whether the strategy produces custom labels on a NumberLine.

Methods​

function()​

abstract function(value): number

Defined in: src/mobjects/graphing/scale.ts:38

Scale a value. Must be implemented by a subclass.

Parameters​

value​

number

Returns​

number


getCustomLabels()​

getCustomLabels(_valRange, _options): MathTexImage[]

Defined in: src/mobjects/graphing/scale.ts:49

Custom labels for the given tick values.

Only strategies with customLabels === true implement this; the base implementation throws, matching ManimCE's NotImplementedError.

Parameters​

_valRange​

number[]

_options​

GetCustomLabelsOptions = {}

Returns​

MathTexImage[]


inverseFunction()​

abstract inverseFunction(value): number

Defined in: src/mobjects/graphing/scale.ts:41

Inverse of function. Must be implemented by a subclass.

Parameters​

value​

number

Returns​

number