LongLinearAxisModel

class LongLinearAxisModel(val range: LongRange, zoomRangeLimit: Long = ((range.last - range.first) * ZoomRangeLimitDefault).coerceAtLeast(1.0).toLong(), minimumMajorTickIncrement: Long = ( (range.last - range.first) * MinimumMajorTickIncrementDefault ).toLong(), val minimumMajorTickSpacing: Dp = 50.dp, minorTickCount: Int = 4, allowZooming: Boolean = true, allowPanning: Boolean = true) : ILinearAxisModel<Long>

An AxisModel that uses Long values and is linear.

Parameters

range

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

zoomRangeLimit

Specifies the minimum allowed range after zooming. Must be greater than 0 and less than or equal to the difference between the start and end of range.

minimumMajorTickIncrement

The minimum value between adjacent major ticks. Must be less than or equal to the extent of the range.

minimumMajorTickSpacing

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

minorTickCount

The number of minor ticks per major tick interval.

allowZooming

If the axis should allow zooming

allowPanning

If the axis should allow panning.

Constructors

Link copied to clipboard
constructor(range: LongRange, zoomRangeLimit: Long = ((range.last - range.first) * ZoomRangeLimitDefault).coerceAtLeast(1.0).toLong(), minimumMajorTickIncrement: Long = ( (range.last - range.first) * MinimumMajorTickIncrementDefault ).toLong(), minimumMajorTickSpacing: Dp = 50.dp, minorTickCount: Int = 4, allowZooming: Boolean = true, allowPanning: Boolean = true)

Properties

Link copied to clipboard
open override val minimumMajorTickSpacing: Dp
Link copied to clipboard
open override val range: LongRange

Functions

Link copied to clipboard
open override fun computeOffset(point: Long): 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
open override fun computeTickValues(axisLength: Dp): TickValues<Long>

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

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun pan(amount: Float)

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

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

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