org.jetbrains.kotlinx.ggdsl.letsplot.layers.density2DFilled.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
//public val DENSITY_2D_FILLED: LetsPlotGeom = LetsPlotGeom("density_2D_filled")
/*
=======
public val DENSITY_2D_FILLED: LetsPlotGeom = LetsPlotGeom("density_2D_filled")
>>>>>>> main
// todo stats
@PlotDslMarker
// todo move x/y?
<<<<<<< HEAD
class Density2DFilledContext(
parent: LayerCollectorContext,
=======
public class Density2DFilledContext(
override var data: MutableNamedData,
>>>>>>> main
kernel: Kernel?,
bandWidth: BandWidth?,
pointsSampled: Int?,
trim: Boolean?,
adjust: Double?,
fullScanMax: Int?,
) : LayerContext(parent) {
// todo internal
@PublishedApi
internal val _x: XAes get() = XAes(this)
@PublishedApi
internal val _y: YAes get() = YAes(this)
public val x: XDummyAes get() = XDummyAes(this)
public val y: YDummyAes get() = YDummyAes(this)
public object Statistics {
public val X: ContourStat.X = ContourStat.X
public val Y: ContourStat.Y = ContourStat.Y
public val LEVEL: ContourStat.Level = ContourStat.Level
public val GROUP: ContourStat.Group = ContourStat.Group
}
public val Stat: Statistics = Statistics
public val alpha: AlphaAes get() = AlphaAes(this)
public val fillColor: FillAes get() = FillAes(this)
public val borderLineWidth: SizeAes get() = SizeAes(this)
public val borderLineColor: ColorAes get() = ColorAes(this)
public val borderLineType: LineTypeAes get() = LineTypeAes(this)
// todo weight
// TODO params
@PublishedApi
internal val kernel: KernelAes get() = KernelAes(this)
@PublishedApi
internal val bw: BWAes get() = BWAes(this)
@PublishedApi
internal val pointsSampled: NumberAes get() = NumberAes(this)
@PublishedApi
internal val trim: TrimAes get() = TrimAes(this)
@PublishedApi
internal val adjust: AdjustAes get() = AdjustAes(this)
@PublishedApi
internal val fullScanMax: FullScanMaxAes get() = FullScanMaxAes(this)
init {
kernel?.let {
kernel(it)
}
bandWidth?.let {
bw(it)
}
pointsSampled?.let {
pointsSampled(it)
}
trim?.let {
trim(it)
}
adjust?.let {
adjust(it)
}
fullScanMax?.let {
fullScanMax(it)
}
}
public inline operator fun ScalablePositionalAes.invoke(
stat: ContourStat
): 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: ContourStat
): ScaledUnspecifiedDefaultNonPositionalMapping {
val mapping = ScaledUnspecifiedDefaultNonPositionalMapping(
this.name,
stat.toDataSource().scaled(),
typeOf()
)
context.bindingCollector.mappings[this.name] = mapping
return mapping
}
}
<<<<<<< HEAD
inline fun PlotContext.density2DFilled(
sourceX: ColumnPointer,
sourceY: ColumnPointer,
=======
public inline fun PlotContext.density2DFilled(
sourceX: DataSource,
sourceY: DataSource,
>>>>>>> main
kernel: Kernel? = null,
bandWidth: BandWidth? = null,
pointsSampled: Int? = null,
trim: Boolean? = null,
adjust: Double? = null,
fullScanMax: Int? = null,
block: Density2DFilledContext.() -> Unit
) {
layers.add(
Density2DFilledContext(data, kernel, bandWidth, pointsSampled, trim, adjust, fullScanMax)
.apply {
copyFrom(this@density2DFilled)
_x(sourceX)
_y(sourceY)
}
.apply(block)
.toLayer(DENSITY_2D_FILLED)
)
}
public inline fun PlotContext.density2DFilled(
sourceX: Iterable,
sourceY: Iterable,
kernel: Kernel? = null,
bandWidth: BandWidth? = null,
pointsSampled: Int? = null,
trim: Boolean? = null,
adjust: Double? = null,
fullScanMax: Int? = null,
block: Density2DFilledContext.() -> Unit
) {
layers.add(
Density2DFilledContext(data, kernel, bandWidth, pointsSampled, trim, adjust, fullScanMax)
.apply {
copyFrom(this@density2DFilled)
_x(sourceX)
_y(sourceY)
}
.apply(block)
.toLayer(DENSITY_2D_FILLED)
)
}
*/
© 2015 - 2025 Weber Informatics LLC | Privacy Policy