Discrete

class Discrete<DOMAIN, VALUE>(accessor: Datum<DOMAIN>.() -> VALUE, init: Discrete<DOMAIN, VALUE>.() -> Unit) : DiscreteDimension<DOMAIN, VALUE>

Discrete is a Dimension that is used to manage discrete values. It is build by giving an "accessor" lambda that returns a discrete <VALUE> object from a given Datum of a <DOMAIN>.

Use the Chart.discrete function to build a Discrete dimension.

Examples:

  • val fruitsDimension = discrete( { domain.fruitName } )

  • val weatherDimension = discrete( { domain.weatherType } )

  • val students = discrete( { domain } )

  • val indexDimension = discrete( { indexInData } )

Constructors

Discrete
Link copied to clipboard
common
fun <DOMAIN, VALUE> Discrete(accessor: Datum<DOMAIN>.() -> VALUE, init: Discrete<DOMAIN, VALUE>.() -> Unit = {})

Functions

invoke
Link copied to clipboard
common
operator fun invoke(datum: Datum<DOMAIN>): VALUE
Calling Dimension(Datum) is the same as calling its accessor.

Properties

accessor
Link copied to clipboard
common
val accessor: Datum<DOMAIN>.() -> VALUE
The "accessor" is the lambda used to transform a DOMAIN object into a VALUE.
formatter
Link copied to clipboard
common
open var formatter: VALUE.() -> 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.