Skip to content

Documentation / @ripl/core / scalePoint

Function: scalePoint()

scalePoint<TDomain>(domain, range, options?): PointScale<TDomain>

Defined in: packages/core/src/scales/point.ts:32

Creates a point scale that maps discrete domain values to evenly spaced positions across the range (the categorical analogue of a continuous axis — points, not bands). With zero padding the first and last values sit exactly on the range endpoints. inverse returns the nearest domain value.

Type Parameters

Type ParameterDefault type
TDomainstring

Parameters

ParameterType
domainTDomain[]
rangenumber[]
options?PointScaleOptions

Returns

PointScale<TDomain>