All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.kotlinx.ggdsl.letsplot.multiplot.plotBunch.kt Maven / Gradle / Ivy

package org.jetbrains.kotlinx.ggdsl.letsplot.multiplot

import org.jetbrains.kotlinx.ggdsl.ir.Plot

data class PlotBunch(
    val items: List
) {
    class Item(
        val plot: Plot,
        val x: Int,
        val y: Int,
        val width: Int?,
        val height: Int?
    )
}

class PlotBunchBuffer {
    val items: MutableList = mutableListOf()

    fun add(plot: Plot, x: Int, y: Int, width: Int?, height: Int? = null) {
        items.add(PlotBunch.Item(plot, x, y, width, height))
    }
}

fun plotBunch(block: PlotBunchBuffer.() -> Unit): PlotBunch {
    return PlotBunch(PlotBunchBuffer().apply(block).items)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy