You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[feat][grafana-react] add value mappings, defaults system, and type improvements
__Changes__
*Types*
- Add color type improvements (FixedColorMode, ContinuousColorMode, PaletteColorMode, ColorSeriesBy)
- Add OverrideConfig as discriminated union based on color mode
- Add value mapping types (ValueMappingValue, Range, Regex, Special)
- Add FieldConfigProps shared interface for common field configuration
- Add TableDataLink and enhanced TableColumnOverride types
- Add BasePanelProps.extend and marginLeft props
- Add PanelDefaults and ExtendedPanelDefaults types
*Components*
- Add Container component for nested grid layouts within rows
- Add Defaults component for scoped panel defaults
- Add defaults prop to Dashboard component
- Refactor Stat, Gauge, BarGauge, Table, Timeseries to use FieldConfigProps
- Add min/max props to Stat for sparkline Y-axis
*Renderer*
- Implement value mappings support (normalizeValueMappings)
- Implement defaults stack with per-panel-type overrides
- Implement Container layout algorithm
- Implement extend prop deep-merge for escape hatch
- Add deepMerge utility
*CLI*
- Add --defaults flag to load panel defaults from JSON file
*Tests*
- Add comprehensive tests for value mappings
- Add tests for defaults system
- Add tests for Container layout
- Add tests for deepMerge utility
__Why__
- Value mappings allow transforming values to text/colors (e.g., 0 → "Offline")
- Defaults system reduces boilerplate when many panels share configuration
- FieldConfigProps consolidates duplicated props across panel types
- Container enables complex nested layouts within rows
- Discriminated union for OverrideConfig provides better type safety
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments