Class AxisTransformLambda

java.lang.Object
io.deephaven.plot.axistransformations.AxisTransformLambda
All Implemented Interfaces:
AxisTransform, Serializable

public class AxisTransformLambda extends Object implements 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 Details

    • AxisTransformLambda

      public AxisTransformLambda(DoubleUnaryOperator dataToAxis, DoubleUnaryOperator axisToData, DoublePredicate isVisible)
      Creates an AxisTransformLambda instance.
      Parameters:
      dataToAxis - transform from dataset space to axis space
      axisToData - transform from axis space to dataset space
      isVisible - function that determines if a particular data point should be displayed
    • AxisTransformLambda

      public AxisTransformLambda(DoubleUnaryOperator dataToAxis, DoubleUnaryOperator axisToData)
      Creates an AxisTransformLambda instance where all dataset values are visible in the plot.
      Parameters:
      dataToAxis - transform from dataset space to axis space
      axisToData - 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 interface AxisTransform
      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 interface AxisTransform
      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 interface AxisTransform
      Parameters:
      dataValue - data point
      Returns:
      whether dataValue is visible in the plot