
commonMain.data.Cluster.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chart-js Show documentation
Show all versions of chart-js Show documentation
A collection of drawing/charting utilities
package com.juul.krayon.chart.data
/** A non-empty [List]. A cluster is usually used to represent multiple nouns within a single state or category. */
public data class Cluster(
private val entries: List,
) : List by entries {
init {
require(entries.isNotEmpty()) { "A cluster must have at least 1 entry." }
}
}
public fun clusterOf(firstValue: T, vararg moreValues: T): Cluster =
Cluster(listOf(firstValue, *moreValues))
public fun Iterable.toCluster(): Cluster =
Cluster(toList())
© 2015 - 2025 Weber Informatics LLC | Privacy Policy