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

There is a newer version: 0.4.0-dev-15
Show newest version
/*
* 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.multiplot

import org.jetbrains.kotlinx.ggdsl.ir.Plot
import org.jetbrains.kotlinx.ggdsl.letsplot.multiplot.model.PlotBunch

public class PlotBunchBuffer {
    @PublishedApi
    internal val items: MutableList = mutableListOf()

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy