org.jetbrains.kotlinx.ggdsl.letsplot.layers.qq.kt Maven / Gradle / Ivy
/*
* Copyright 2020-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
package org.jetbrains.kotlinx.ggdsl.letsplot.layers
/* TODO
@PublishedApi
*/
//public val QQ: LetsPlotGeom = LetsPlotGeom("qq")
/*
@PlotDslMarker
// todo move x/y?
<<<<<<< HEAD
class QQContext(
parent: LayerCollectorContext,
=======
public class QQContext(
override var data: MutableNamedData,
>>>>>>> main
distribution: Distribution?,
) : LayerContext(parent) {
init {
distribution?.let {
distribution(it.name)
dParams(it.toList())
}
}
@PublishedApi
internal val _sample: SampleAes get() = SampleAes(this)
public val sample: SampleDummyAes get() = SampleDummyAes(this)
public val alpha: AlphaAes get() = AlphaAes(this)
public val fillColor: FillAes get() = FillAes(this)
public val color: ColorAes get() = ColorAes(this)
public val size: SizeAes get() = SizeAes(this)
public val symbol: ShapeAes get() = ShapeAes(this)
// todo weight
@PublishedApi
internal val distribution: DistributionAes get() = DistributionAes(this)
@PublishedApi
internal val dParams: DParamsAes get() = DParamsAes(this)
public object Statistics {
public val SAMPLE: QQStat.Sample = QQStat.Sample
public val THEORETICAL: QQStat.Theoretical = QQStat.Theoretical
}
public val Stat: Statistics = Statistics
public inline operator fun ScalablePositionalAes.invoke(
stat: QQStat
): ScaledUnspecifiedDefaultPositionalMapping {
val mapping = ScaledUnspecifiedDefaultPositionalMapping(
this.name,
stat.toDataSource().scaled(),
typeOf()
)
context.bindingCollector.mappings[this.name] = mapping
return mapping
}
public inline operator fun MappableNonPositionalAes.invoke(
stat: QQStat
): ScaledUnspecifiedDefaultNonPositionalMapping {
val mapping = ScaledUnspecifiedDefaultNonPositionalMapping(
this.name,
stat.toDataSource().scaled(),
typeOf()
)
context.bindingCollector.mappings[this.name] = mapping
return mapping
}
}
<<<<<<< HEAD
inline fun PlotContext.qq(
source: ColumnPointer,
=======
public inline fun PlotContext.qq(
source: DataSource,
>>>>>>> main
distribution: Distribution? = null,
block: QQContext.() -> Unit
) {
layers.add(
QQContext(data, distribution)
.apply {
copyFrom(this@qq)
_sample(source)
}
.apply(block)
.toLayer(QQ)
)
}
public inline fun PlotContext.qq(
source: Iterable,
distribution: Distribution? = null,
block: QQContext.() -> Unit
) {
layers.add(
QQContext(data, distribution)
.apply {
copyFrom(this@qq)
_sample(source)
}
.apply(block)
.toLayer(QQ)
)
}
*/
© 2015 - 2025 Weber Informatics LLC | Privacy Policy