- RealtimeChart composable with Canvas-based rendering - TieredBuffer: 3-tier ring buffer (5min full-rate, 10min @10Hz, 45min @1Hz) for 1h data support with ~5MB footprint - LodDecimator: MEAN / MIN_MAX / MIN_MAX(default) / LTTB render-time decimation - AxisRenderer: X/Y axis with INSIDE/BESIDE/HIDDEN label modes, T0-relative timestamps, scientific notation - SignalRenderer: clipRect-bounded path rendering with LoD - ChartTheme: Material3-compatible dynamic theming (light/dark) - package: dev.dtrentin.chart Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
26 lines
1 KiB
Kotlin
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.LTTB,
|
|
)
|