org.jetbrains.kotlinx.kandy.echarts.scale.mapping.kt Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2020-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
package org.jetbrains.kotlinx.kandy.echarts.scale
import org.jetbrains.kotlinx.dataframe.DataColumn
import org.jetbrains.kotlinx.dataframe.columns.ColumnReference
import org.jetbrains.kotlinx.dataframe.impl.asList
import org.jetbrains.kotlinx.kandy.dsl.internal.BindingHandler
import org.jetbrains.kotlinx.kandy.dsl.internal.dataframe.addNonPositionalMapping
import org.jetbrains.kotlinx.kandy.dsl.internal.dataframe.addPositionalMapping
import org.jetbrains.kotlinx.kandy.ir.aes.Aes
import org.jetbrains.kotlinx.kandy.ir.bindings.NonPositionalMapping
import org.jetbrains.kotlinx.kandy.ir.bindings.PositionalMapping
import kotlin.reflect.KProperty
internal fun BindingHandler.posMapping(
aes: Aes, column: ColumnReference, params: EchartsPositionalMappingParametersContinuous.() -> Unit = {}
): PositionalMapping =
addPositionalMapping(aes, column.name(), EchartsPositionalMappingParametersContinuous().apply(params))
internal fun BindingHandler.posMapping(
aes: Aes, column: KProperty, params: EchartsPositionalMappingParametersContinuous.() -> Unit = {}
): PositionalMapping =
addPositionalMapping(aes, column.name, EchartsPositionalMappingParametersContinuous().apply(params))
internal fun BindingHandler.posMapping(
aes: Aes, values: Iterable,
name: String? = null, params: EchartsPositionalMappingParametersContinuous.() -> Unit = {}
): PositionalMapping =
addPositionalMapping(aes, values.asList(), name, EchartsPositionalMappingParametersContinuous().apply(params))
internal fun BindingHandler.posMapping(
aes: Aes, values: DataColumn, params: EchartsPositionalMappingParametersContinuous.() -> Unit = {}
): PositionalMapping =
addPositionalMapping(aes, values, EchartsPositionalMappingParametersContinuous().apply(params))
internal fun BindingHandler.posMapping(
aes: Aes, column: String,
parameters: EchartsPositionalMappingParametersContinuous<*>.() -> Unit = {}
): PositionalMapping<*> =
addPositionalMapping(aes, column, EchartsPositionalMappingParametersContinuous().apply(parameters))
internal fun BindingHandler.posFreeScale(
aes: Aes, params: EchartsPositionalMappingParametersContinuous.() -> Unit = {}
): Unit = addPositionalFreeScale(aes, EchartsPositionalMappingParametersContinuous().apply(params))
internal fun BindingHandler.nonPosMappingCont(
aes: Aes, column: ColumnReference, params: EchartsNonPositionalMappingParametersContinuous.() -> Unit = {}
): NonPositionalMapping = this.addNonPositionalMapping(
aes, column.name(), EchartsNonPositionalMappingParametersContinuous().apply(params)
)
internal fun BindingHandler.nonPosMappingCont(
aes: Aes, column: KProperty, params: EchartsNonPositionalMappingParametersContinuous.() -> Unit = {}
): NonPositionalMapping = this.addNonPositionalMapping(
aes, column.name, EchartsNonPositionalMappingParametersContinuous().apply(params)
)
internal fun BindingHandler.nonPosMappingCont(
aes: Aes, values: Iterable,
name: String? = null, params: EchartsNonPositionalMappingParametersContinuous.() -> Unit = {}
): NonPositionalMapping = this.addNonPositionalMapping(
aes, values.asList(), name, EchartsNonPositionalMappingParametersContinuous().apply(params)
)
internal fun BindingHandler.nonPosMappingCont(
aes: Aes, values: DataColumn, params: EchartsNonPositionalMappingParametersContinuous.() -> Unit
): NonPositionalMapping =
this.addNonPositionalMapping(aes, values, EchartsNonPositionalMappingParametersContinuous().apply(params))
internal fun BindingHandler.nonPosMappingCont(
aes: Aes, column: String, parameters: EchartsNonPositionalMappingParametersContinuous<*, D>.() -> Unit = {}
): NonPositionalMapping<*, D> =
addNonPositionalMapping(aes, column, EchartsNonPositionalMappingParametersContinuous().apply(parameters))
internal fun BindingHandler.nonPosMappingCat(
aes: Aes, column: ColumnReference, params: EchartsNonPositionalMappingParametersCategorical.() -> Unit = {}
): NonPositionalMapping = this.addNonPositionalMapping(
aes, column.name(), EchartsNonPositionalMappingParametersCategorical().apply(params)
)
internal fun BindingHandler.nonPosMappingCat(
aes: Aes, column: KProperty, params: EchartsNonPositionalMappingParametersCategorical.() -> Unit = {}
): NonPositionalMapping = this.addNonPositionalMapping(
aes, column.name, EchartsNonPositionalMappingParametersCategorical().apply(params)
)
internal fun BindingHandler.nonPosMappingCat(
aes: Aes, values: Iterable,
name: String? = null, params: EchartsNonPositionalMappingParametersCategorical.() -> Unit = {}
): NonPositionalMapping = this.addNonPositionalMapping(
aes, values.asList(), name, EchartsNonPositionalMappingParametersCategorical().apply(params)
)
internal fun BindingHandler.nonPosMappingCat(
aes: Aes, values: DataColumn, params: EchartsNonPositionalMappingParametersCategorical.() -> Unit
): NonPositionalMapping =
this.addNonPositionalMapping(aes, values, EchartsNonPositionalMappingParametersCategorical().apply(params))
internal fun BindingHandler.nonPosMappingCat(
aes: Aes, column: String, parameters: EchartsNonPositionalMappingParametersCategorical<*, D>.() -> Unit = {}
): NonPositionalMapping<*, D> =
addNonPositionalMapping(aes, column, EchartsNonPositionalMappingParametersCategorical().apply(parameters))