Class AxisTransformLambda
java.lang.Object
io.deephaven.plot.axistransformations.AxisTransformLambda
- All Implemented Interfaces:
AxisTransform
,Serializable
Transformations from dataset space to axis space and back.
Axis space refers to how data is displayed in the chart. For example, if the transform from dataset space to axis
space was defined as x^0.5, the dataset values 1, 4, and 9 would be plotted as 1, 2, and 3,] creating a square root
axis scale.
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates an AxisTransformLambda instance where all dataset values are visible in the plot and the dataset to axis space transform and its inverse are the identity function.AxisTransformLambda
(DoubleUnaryOperator dataToAxis, DoubleUnaryOperator axisToData) Creates an AxisTransformLambda instance where all dataset values are visible in the plot.AxisTransformLambda
(DoubleUnaryOperator dataToAxis, DoubleUnaryOperator axisToData, DoublePredicate isVisible) Creates an AxisTransformLambda instance. -
Method Summary
Modifier and TypeMethodDescriptiondouble
inverseTransform
(double axisValue) Transforms a point in Axis space to dataset space.boolean
isVisible
(double dataValue) Gets whether a data point is visible in the plot.double
transform
(double dataValue) Transforms a data point to Axis space.
-
Constructor Details
-
AxisTransformLambda
public AxisTransformLambda(DoubleUnaryOperator dataToAxis, DoubleUnaryOperator axisToData, DoublePredicate isVisible) Creates an AxisTransformLambda instance.- Parameters:
dataToAxis
- transform from dataset space to axis spaceaxisToData
- transform from axis space to dataset spaceisVisible
- function that determines if a particular data point should be displayed
-
AxisTransformLambda
Creates an AxisTransformLambda instance where all dataset values are visible in the plot.- Parameters:
dataToAxis
- transform from dataset space to axis spaceaxisToData
- transform from axis space to dataset space
-
AxisTransformLambda
public AxisTransformLambda()Creates an AxisTransformLambda instance where all dataset values are visible in the plot and the dataset to axis space transform and its inverse are the identity function.
-
-
Method Details
-
transform
public double transform(double dataValue) Description copied from interface:AxisTransform
Transforms a data point to Axis space.- Specified by:
transform
in interfaceAxisTransform
- Parameters:
dataValue
- data point- Returns:
- corresponding value in Axis space
-
inverseTransform
public double inverseTransform(double axisValue) Description copied from interface:AxisTransform
Transforms a point in Axis space to dataset space.- Specified by:
inverseTransform
in interfaceAxisTransform
- Parameters:
axisValue
- Axis space data point- Returns:
- corresponding value in dataset space
-
isVisible
public boolean isVisible(double dataValue) Description copied from interface:AxisTransform
Gets whether a data point is visible in the plot.- Specified by:
isVisible
in interfaceAxisTransform
- Parameters:
dataValue
- data point- Returns:
- whether
dataValue
is visible in the plot
-