PercentScale
Documentation / @elitechart/core / PercentScale
Defined in: math/scales.ts:172
Percent scale, expressed as % change from an anchor value.
scale(anchor) === range center
scale(anchor * (1 + p/100)) = range center + p * unitPx
Internally just a linear scale over percentage values; exposed as a named type for clarity at call sites.
Example
Implements
Constructors
Constructor
Defined in: math/scales.ts:178
Parameters
anchor
number
percentDomain
range
Returns
PercentScale
Properties
anchor
Defined in: math/scales.ts:175
domain
Defined in: math/scales.ts:173
Implementation of
range
Defined in: math/scales.ts:174
Implementation of
Methods
invert()
Defined in: math/scales.ts:193
Map a pixel back to the domain.
Parameters
px
number
Returns
number
Implementation of
scale()
Defined in: math/scales.ts:188
Map a domain value to a pixel position.
Parameters
value
number
Returns
number