Temporal

class Temporal<DOMAIN>(accessor: Datum<DOMAIN>.() -> Instant, parentDimension: Temporal<DOMAIN>?, init: Temporal<DOMAIN>.() -> Unit) : ContinuousDimension<DOMAIN, Instant>

Temporal is a Dimension that is used to manage continuous time values (as LocalDateTime) It is build by giving an "accessor" lambda that returns a LocalDateTime object from a given Datum of a <DOMAIN>.

Use the Chart.temporal function to build a Temporal dimension.

Examples:

  • val dateDimension = temporal( { domain.date } )

Constructors

Temporal
Link copied to clipboard
common
fun <DOMAIN> Temporal(accessor: Datum<DOMAIN>.() -> Instant, parentDimension: Temporal<DOMAIN>? = null, init: Temporal<DOMAIN>.() -> Unit = {})

Functions

child
Link copied to clipboard
common
fun child(accessor: Datum<DOMAIN>.() -> Instant, init: Temporal<DOMAIN>.() -> Unit = {}): Temporal<DOMAIN>
Creates a child Dimension with the given accessor, use child dimensions to share axes with different properties.
invoke
Link copied to clipboard
common
operator fun invoke(datum: Datum<DOMAIN>): Instant
Calling Dimension(Datum) is the same as calling its accessor.

Properties

accessor
Link copied to clipboard
common
val accessor: Datum<DOMAIN>.() -> Instant
The "accessor" is the lambda used to transform a DOMAIN object into a VALUE.
formatter
Link copied to clipboard
common
open var formatter: Instant.() -> String?
The formatter for the VALUE this Dimension can generate.
isContinuous
Link copied to clipboard
common
val isContinuous: Boolean
Is this Dimension considered "continuous"?
isDiscrete
Link copied to clipboard
common
open override val isDiscrete: Boolean
Is this Dimension considered "discrete"?
name
Link copied to clipboard
common
var name: String?
The name of this Dimension, this name is used as the title of the Axis based on it.