DiscreteLinearAxisModel

Interface implemented by LinearAxisModels that use integers.

Inheritors

Properties

Link copied to clipboard

Specifies the minimum physical spacing for major ticks, in Dp units. Must be greater than 0.

Link copied to clipboard
abstract val range: ClosedRange<T>

The minimum to maximum values allowed to be represented on this Axis. Zoom and scroll modifications may not exceed this range.

Link copied to clipboard

The currently viewable range on the axis.

Functions

Link copied to clipboard
abstract fun computeOffset(point: T): Float

Computes the linear offset of the provided point along this axis relative to its min value. For a linear axis this is offset = (point-min)/(max-min). Values less than 0 or greater than 1 mean the point is before or beyond the range of the axis, respectively. Nonlinear, e.g. log, axes can be implemented with appropriate transformations in this function.

Link copied to clipboard
abstract fun computeTickValues(axisLength: Dp): TickValues<T>

Computes major and minor tick values based on the minimum tick spacing and the overall axisLength.

Link copied to clipboard
open fun pan(amount: Float): Boolean

Asks the AxisState to compute new ranges and tick values after panning, if the axis supports panning.

Link copied to clipboard
abstract fun setViewRange(newRange: ClosedRange<Double>)

Sets the currently viewable range on the axis. This is a more direct alternative to using pan and zoom to set the range of currently viewable values on an axis. The start and end must be within the allowed range of the axis. If they exceed either limit they will be clamped to the range.

Link copied to clipboard
open fun zoom(zoomFactor: Float, pivot: Float)

Asks the AxisState to compute new ranges and tick values after zooming, if the axis supports zooming.