Class 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.

Inheritance
GlobalAutoScaler
Implements
Namespace: MOSAIC.Visualization.Heatmap
Assembly: MOSAIC.dll
Syntax
public sealed class GlobalAutoScaler : IHeatmapScaler

Constructors

GlobalAutoScaler(double, double, double, bool)

Declaration
public GlobalAutoScaler(double expandAlpha = 0.6, double contractAlpha = 0.08, double minSpan = 1E-09, bool resetOnReconfigure = true)
Parameters
Type Name Description
double expandAlpha

Weight when range expands (0..1). Higher = faster tracking.

double contractAlpha

Weight when range contracts (0..1). Lower = steadier baseline.

double minSpan

Minimum span to avoid numeric collapse.

bool resetOnReconfigure

If true, resets range on Configure(). If false, preserves range across grid changes.

Fields

_contractA

Declaration
private readonly double _contractA
Field Value
Type Description
double

_expandA

Declaration
private readonly double _expandA
Field Value
Type Description
double

_gMax

Declaration
private double _gMax
Field Value
Type Description
double

_gMin

Declaration
private double _gMin
Field Value
Type Description
double

_minSpan

Declaration
private readonly double _minSpan
Field Value
Type Description
double

_resetOnReconfigure

Declaration
private readonly bool _resetOnReconfigure
Field Value
Type Description
bool

Methods

Configure(int)

Called whenever the grid size changes (length = rows*cols). Implementations must handle any cell count gracefully — never throw.

Declaration
public void Configure(int cellCount)
Parameters
Type Name Description
int cellCount

FormatValue(double)

Declaration
private static string FormatValue(double v)
Parameters
Type Name Description
double v
Returns
Type Description
string

MapFrame(ReadOnlySpan<double>, WeightedPoint[], int[]?, Func<double, double>?, out LegendInfo)

Map an input frame to weights in LiveChartsCore.Defaults.WeightedPoint.Weight.

Declaration
public void MapFrame(ReadOnlySpan<double> frame, WeightedPoint[] points, int[]? indexMap, Func<double, double>? valueTransform, out LegendInfo legend)
Parameters
Type Name Description
ReadOnlySpan<double> frame
WeightedPoint[] points
int[] indexMap
Func<double, double> valueTransform
LegendInfo legend

Implements

IHeatmapScaler

Search documentation

Start typing to search the documentation.