Namespace MOSAIC.Visualization.Heatmap

Classes

GlobalAutoScaler

Global auto-range scaler with hysteresis (expand fast, contract slow). Ideal when the signal range is unknown or drifting. Handles grid resize gracefully — optionally preserves or resets range.

GlobalFixedScaler

Global fixed-range scaler. Maps [min..max] → [0..1] for all cells uniformly. Ideal for known signal ranges (e.g., ±1V, 0..100%). Handles grid resize with no issues.

HeatMapMonitor

Real-time heatmap visualization backed by LiveCharts LiveChartsCore.SkiaSharpView.HeatSeries<TModel>. Renders a rows × columns color grid where each cell's color encodes a scalar value mapped through a pluggable IHeatmapScaler.

Data flow: Call EnqueueFrame(ReadOnlySpan<double>) or EnqueueFrame(Vector<double>) from any thread. The newest frame is handed off via a lock-free LatestFrameSlot; the internal VisualizationTimer tick reads it on the UI thread at 60 fps, maps values through the active scaler, and nudges LiveCharts to repaint.

Grid layout: Defaults to 8 × 16 (128 cells). Call ConfigureGrid(int, int, int[]?) to change layout. When an incoming frame has a different length to the current grid, the grid auto-reconfigures to a single-row 1 × N layout on the next UI tick.

Scaling: Set via UseGlobalAuto(double, double, double), UseGlobalFixed(double, double), UsePerSensorFixedForAll(double, double, double), UsePerSensorFixed(double[], double[], double), or UsePerSensorAdaptiveRms(double, double, double). Default after construction is no scaler — call UseGlobalAuto(double, double, double) (or another mode) before feeding data, or use BlockVisualization which calls UseGlobalAuto() automatically.

Colormap: Set via extension methods in HeatmapColormaps (e.g., hm.UseViridis()). Default is a 4-stop Viridis approximation.

Colorbar: ColorbarBitmap, ColorbarMinLabel, ColorbarMaxLabel, and ColorbarCaption are updated each flush and bound by HeatMapView to the legend sidebar.

Lifecycle: VisualizationPanel (or HeatMapView directly) calls Pause() and Resume(). Do not call these yourself when using BlockVisualization.

HeatMapView

Hosts a LiveCharts heatmap (Cartesian chart) with a colorbar legend, bound to a HeatMapMonitor. The shared attach/detach, theme, and rebuild lifecycle lives in MonitorViewBase<TMonitor>; this class supplies the chart surface, the colorbar bindings, and an optional height drag-track.

HeatmapColormaps

Extension methods providing pre-built colormaps for HeatMapMonitor.

Sequential (low-to-high): Viridis, Inferno, Plasma, Magma, Turbo, Hot, Greyscale Diverging (negative-zero-positive): BlueWhiteRed, CoolWarm, PurpleWhiteGreen

Usage: heatmap.UseViridis(); heatmap.UseBlueWhiteRed(); heatmap.UseGreyscale();

HeatmapSettingsFlyout

Self-contained flyout content for heatmap settings (scaling mode + colormap). Created by VisualizationPanel and attached to a gear button next to the heatmap toggle.

PerSensorAdaptiveRmsScaler

Per-sensor adaptive RMS scaler with peak-hold decay. Zero-centered mapping: [-scale .. +scale] → [0..1]. Each cell tracks its own RMS envelope and auto-scales independently. Handles grid resize by re-allocating state (new cells start fresh).

PerSensorFixedScaler

Per-sensor fixed ranges; each cell maps its own [min,max] to [0..1]. Handles grid resize gracefully:

  • If new count matches arrays → use them directly.
  • If new count differs → broadcasts overall [globalMin, globalMax] to all cells. This means you never crash on channel count changes, just get a less specific scaling.

Structs

LegendInfo

Legend text returned by a scaler for the colorbar.

Interfaces

IHeatmapScaler

Maps raw values to color weights (0..1) for a heatmap frame and provides legend text.

Enums

ColorScaleMode

Top-level color scaling mode: one range for all cells, or a separate range per cell.

HeatmapScalingMode

Scaling modes exposed to the user.

PerSensorScaling

Per-sensor scaling strategy: adaptive RMS envelope, or caller-supplied fixed ranges.

Search documentation

Start typing to search the documentation.