Kotlin / kandy

Kotlin plotting library.
https://kotlin.github.io/kandy/
Apache License 2.0
579 stars 12 forks source link

Add `DataColumn` API for breaks in `Legend`/`Axis` #417

Open AndreiKingsley opened 1 month ago

AndreiKingsley commented 1 month ago

Add new breaks (an analogue for all existing function) with DatColumn argument for passing breaks for axis and legend:

fun breaks(breaks: DataColumn<DomainType>, format: String? = null)

https://github.com/Kotlin/kandy/blob/main/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/LetsPlotAxis.kt https://github.com/Kotlin/kandy/blob/main/kandy-lets-plot/src/main/kotlin/org/jetbrains/kotlinx/kandy/letsplot/scales/guide/model/LetsPlotLegend.kt A common case:

legends {
   breaks(column.distinct())
}
devcrocod commented 1 month ago

Please provide detailed instructions on how to complete this task

AndreiKingsley commented 1 month ago

Add breaks(DataColumn) function with the same logic.