Interface Scale
Represents a mapping of data values to some linear scale.
The function is assumed to be strictly monotonic increasing and continuous.
All finite values are permitted for both the data and the scale,
except as documented by the isPositiveDefinite() method.
The LINEAR and LOG instances are provided
as static members of this class; to produce other instances,
see the ScaleType class.
- Since:
- 12 Mar 2025
- Author:
- Mark Taylor
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondoubledataToScale(double d) Forward mapping.Returns an algebraic expression representing the mapping of a variable from data space to scale space.double[]Returns the array of parameter values that combined with the scale type fully specify this scale.Returns an object which can round scale values to a value that counts as a round number.Returns the type of this scale.Returns an object that can generate axis ticks for this scale.booleanisLinear()Indicates whether the scaling relation is linear.booleanIf this method returns true, then only data values that are strictly greater than zero can be mapped to the scale, and a data value of zero is mapped to a scale value of negative infinity.doublescaleToData(double s) Inverse mapping.
-
Field Details
-
LINEAR
-
LOG
-
TIME
-
-
Method Details
-
getScaleType
-
getParamValues
double[] getParamValues()Returns the array of parameter values that combined with the scale type fully specify this scale.- Returns:
- scale parameter values, same length as
getScaleType().getParams()
-
dataToScale
double dataToScale(double d) Forward mapping.- Parameters:
d- data value- Returns:
- scale value
-
scaleToData
double scaleToData(double s) Inverse mapping.- Parameters:
s- scale value- Returns:
- data value
-
isPositiveDefinite
boolean isPositiveDefinite()If this method returns true, then only data values that are strictly greater than zero can be mapped to the scale, and a data value of zero is mapped to a scale value of negative infinity. Otherwise, any finite data value and any finite scale value can be mapped to a finite value in the other domain.- Returns:
- true iff negative data values are excluded
-
isLinear
boolean isLinear()Indicates whether the scaling relation is linear.- Returns:
- true for uniformly linear scaling, false otherwise
-
getTicker
-
getScaleRounder
Rounder getScaleRounder()Returns an object which can round scale values to a value that counts as a round number.- Returns:
- rounder for the scale quantity
-
dataToScaleExpression
-