There are three parts of API reference for @antv/scale. Follow the links below to learn more.
Encodings that map abstract data to visual representation.
Map a continuous, quantitative domain to a continuous range.
- Linear - A basic continuous scale that preserve proportional differences for continuous data.
- Identity - A special case of linear scales where the domain and range are identical.
- Constant - A special case of linear scales which mapping input to a fixed output.
- Log - Similar to linear scales, except an logarithmic transform is applied to the input domain value before the output range value is computed.
- Pow - Similar to linear scales, except an exponential transform is applied to the input domain value before the output range value is computed.
- Sqrt - A special case of pow scales with exponent fixed to 0.5.
- Time - Similar to linear scales, but have a have a temporal domain.
Map a continuous, quantitative domain to a discrete range.
- Threshold - Divide continuous domain into slices based on specified cut values and map value in each slice to corresponding discrete values in the range.
- Quantize - Similar to threshold scales, but computed cut values based on size of each data.
- Quantile - Similar to threshold scales, but computed cut values based on quantile(ranking of each data).
Map a discrete domain to a discrete or continuous range.
- Ordinal - Map input value in discrete domain into corresponding discrete values in range.
- Band - A special case of ordinal scales where the range is continuous.
- Point - A special case of band scales with bandwidth fixed to zero.
Methods for computing representative values.
- D3 Ticks - D3 ticks in d3-array.
- R Pretty - An algorithm for positioning tick labels on axes in R language.
- Wilkinson Extended - An extension of Wilkinson's algorithm for positioning tick labels on axes.
Built-in interpolator factories for continuous scale.
- createInterpolateNumber - Returns a number interpolator.
- createInterpolateColor - Returns a color interpolator.
- createInterpolateValue - Returns a interpolator which can interpolate numbers and colors depending on input type.
Constants for tickInterval option used in time scale.
- DURATION_SECOND - The number of milliseconds for one second.
- DURATION_MINUTE - The number of milliseconds for one minute.
- DURATION_HOUR - The number of milliseconds for one hour.
- DURATION_DAY - The number of milliseconds for one day.
- DURATION_WEEK - The number of milliseconds for one week.
- DURATION_MONTH - The number of milliseconds for one month.
- DURATION_YEAR - The number of milliseconds for one year.