KMPCharts/chart-realtime/src/commonMain/kotlin/dev/dtrentin/chart/model/ChartConfig.kt
dtrentin 554b67e630 refactor(buffer): MIN_MAX tier binning, remove MEAN lod mode
- TieredBuffer: replace MEAN binning with MIN_MAX (min+max per bin).
  Mathematically composable: MIN(bin_mins)=global_MIN, MAX(bin_maxes)=global_MAX.
  Eliminates tier-boundary visual artifacts. TIER1/TIER2 capacity doubled (2 samples/bin).
- LodMode: remove MEAN. Only MIN_MAX and LTTB remain.
  MEAN introduced values never present in raw signal — disinformation for sensor data.
- ChartConfig: default lodMode changed to MIN_MAX.
- Version: 0.4.1-SNAPSHOT → 0.5.0-SNAPSHOT

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 08:57:58 +02:00

26 lines
1 KiB
Kotlin

package dev.dtrentin.chart.model
/**
* Top-level chart configuration.
*
* @param xWindowSeconds visible X range in seconds. Data older than (latestTs - xWindowSeconds) is not rendered.
* @param yRange Y axis range strategy.
* @param t0 Origin of X axis (seconds = 0).
* @param targetFps Render rate cap. null = display refresh rate via withFrameNanos. Range: 1..displayMax.
* @param maxBufferSeconds Max history kept per signal. Caller is responsible for memory implications.
* @param theme Visual theme (colors, stroke widths).
*/
data class ChartConfig(
val xWindowSeconds: Float = 10f,
val yRange: YRange = YRange.Auto(),
val t0: T0 = T0.FirstSample,
val targetFps: Int? = null,
val maxBufferSeconds: Float = 60f,
val theme: ChartTheme = ChartTheme(),
val showGrid: Boolean = true,
val xLabelMode: AxisLabelMode = AxisLabelMode.INSIDE,
val yLabelMode: AxisLabelMode = AxisLabelMode.INSIDE,
val yLabelDecimals: Int = 2,
val xLabelDecimals: Int = 1,
val lodMode: LodMode = LodMode.MIN_MAX,
)