Files
grafana/apps/dashboard/pkg/migration/testdata/dev-dashboards-output/panel-heatmap/heatmap-legacy.v42.json
T
Ivan Ortega Alba a72e02f88a Fix dashboard migration discrepancies between backend and frontend implementations (use toEqual) (#110268)
**Highlights**

* **Single-version migrations**: add `targetVersion` to migrator & model, separate outputs, enforce exact version.
* **Datasource fixes**: include `apiVersion` in tests, empty-string → `{}`, preserve `{}` refs, drop unwanted defaults.
* **Panel defaults & nesting**: only top-level panels get defaults; preserve empty `transformations` context-aware; filter repeated panels.

* **Migration parity**

  * V16: collapsed rows, grid height parsing (`px`).
  * V17: omit `maxPerRow` when `minSpan=1`.
  * V19–V20: cleanup defaults (`targetBlank`, style).
  * V23–V24: template vars + table panel consistency.
  * V28: full singlestat/stat parity, mappings & color.
  * V30–V36: threshold logic, empty refs, nested targets.
* **Save-model cleanup**: replicate frontend defaults/filtering, drop null IDs, metadata, unused props.
* **Testing**: unified suites, dev dashboards (v42), full unit coverage for major migrations.

Co-authored-by: Ivan Ortega [ivanortegaalba@gmail.com](mailto:ivanortegaalba@gmail.com)
Co-authored-by: Dominik Prokop [dominik.prokop@grafana.com](mailto:dominik.prokop@grafana.com)
2025-09-24 12:20:25 +02:00

386 lines
8.1 KiB
JSON

{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations \u0026 Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": 1330,
"links": [],
"liveNow": false,
"panels": [
{
"cards": {
"cardRound": 50
},
"color": {
"cardColor": "#1F60C4",
"colorScale": "sqrt",
"colorScheme": "interpolateOranges",
"exponent": 0.5,
"mode": "opacity"
},
"dataFormat": "tsbuckets",
"datasource": {
"type": "grafana-testdata-datasource"
},
"gridPos": {
"h": 11,
"w": 7,
"x": 0,
"y": 0
},
"heatmap": {},
"hideZeroBuckets": false,
"highlightCards": true,
"id": 4,
"legend": {
"show": true
},
"reverseYBuckets": false,
"targets": [
{
"datasource": {
"type": "grafana-testdata-datasource"
},
"refId": "A",
"scenarioId": "exponential_heatmap_bucket_data"
}
],
"title": "Exponential bucket data (round)",
"tooltip": {
"show": true,
"showHistogram": false
},
"type": "heatmap",
"xAxis": {
"show": true
},
"yAxis": {
"decimals": 1,
"format": "kwatt",
"logBase": 1,
"show": true,
"width": "100"
},
"yBucketBound": "auto"
},
{
"cards": {},
"color": {
"cardColor": "#b4ff00",
"colorScale": "sqrt",
"colorScheme": "interpolateViridis",
"exponent": 0.5,
"mode": "spectrum"
},
"dataFormat": "timeseries",
"datasource": {
"type": "grafana-testdata-datasource"
},
"gridPos": {
"h": 11,
"w": 9,
"x": 7,
"y": 0
},
"heatmap": {},
"hideZeroBuckets": false,
"highlightCards": true,
"id": 2,
"legend": {
"show": true
},
"reverseYBuckets": false,
"targets": [
{
"datasource": {
"type": "grafana-testdata-datasource"
},
"max": 70,
"min": 10,
"noise": 2,
"refId": "A",
"scenarioId": "random_walk",
"spread": 15,
"startValue": 10
}
],
"title": "Calculated with legend and decimals",
"tooltip": {
"show": true,
"showHistogram": true
},
"tooltipDecimals": 4,
"type": "heatmap",
"xAxis": {
"show": true
},
"yAxis": {
"decimals": 2,
"format": "areaM2",
"logBase": 1,
"show": true
},
"yBucketBound": "auto"
},
{
"cards": {},
"color": {
"cardColor": "#b4ff00",
"colorScale": "sqrt",
"colorScheme": "interpolateBuGn",
"exponent": 0.5,
"mode": "spectrum"
},
"dataFormat": "timeseries",
"datasource": {
"type": "grafana-testdata-datasource"
},
"gridPos": {
"h": 11,
"w": 8,
"x": 16,
"y": 0
},
"heatmap": {},
"hideZeroBuckets": true,
"highlightCards": true,
"id": 8,
"legend": {
"show": true
},
"reverseYBuckets": false,
"targets": [
{
"datasource": {
"type": "grafana-testdata-datasource"
},
"refId": "A",
"scenarioId": "exponential_heatmap_bucket_data"
}
],
"title": "log (base2) with split 2",
"tooltip": {
"show": true,
"showHistogram": true
},
"type": "heatmap",
"xAxis": {
"show": true
},
"xBucketNumber": 10,
"yAxis": {
"format": "short",
"logBase": 2,
"show": true,
"splitFactor": 2
},
"yBucketBound": "auto"
},
{
"cards": {},
"color": {
"cardColor": "#1F60C4",
"colorScale": "sqrt",
"colorScheme": "interpolateOranges",
"exponent": 0.5,
"mode": "opacity"
},
"dataFormat": "tsbuckets",
"datasource": {
"type": "grafana-testdata-datasource"
},
"gridPos": {
"h": 11,
"w": 7,
"x": 0,
"y": 11
},
"heatmap": {},
"hideZeroBuckets": false,
"highlightCards": true,
"id": 5,
"legend": {
"show": true
},
"reverseYBuckets": true,
"targets": [
{
"datasource": {
"type": "grafana-testdata-datasource"
},
"refId": "A",
"scenarioId": "exponential_heatmap_bucket_data"
}
],
"title": "Reverse axis with explicit width ",
"tooltip": {
"show": true,
"showHistogram": false
},
"type": "heatmap",
"xAxis": {
"show": true
},
"yAxis": {
"decimals": 1,
"format": "kwatt",
"logBase": 1,
"show": true,
"width": "100"
},
"yBucketBound": "auto"
},
{
"cards": {},
"color": {
"cardColor": "#b4ff00",
"colorScale": "sqrt",
"colorScheme": "interpolateViridis",
"exponent": 0.5,
"mode": "spectrum"
},
"dataFormat": "timeseries",
"datasource": {
"type": "datasource",
"uid": "-- Dashboard --"
},
"gridPos": {
"h": 11,
"w": 9,
"x": 7,
"y": 11
},
"heatmap": {},
"hideZeroBuckets": false,
"highlightCards": true,
"id": 6,
"legend": {
"show": true
},
"reverseYBuckets": false,
"targets": [
{
"datasource": {
"type": "datasource",
"uid": "-- Dashboard --"
},
"panelId": 2,
"refId": "A"
}
],
"title": "Min/max clamped (20-50)",
"tooltip": {
"show": true,
"showHistogram": true
},
"tooltipDecimals": 4,
"type": "heatmap",
"xAxis": {
"show": true
},
"yAxis": {
"decimals": 2,
"format": "areaM2",
"logBase": 1,
"max": "50",
"min": "20",
"show": true
},
"yBucketBound": "auto"
},
{
"cards": {},
"color": {
"cardColor": "#b4ff00",
"colorScale": "sqrt",
"colorScheme": "interpolateBuGn",
"exponent": 0.5,
"mode": "spectrum"
},
"dataFormat": "timeseries",
"datasource": {
"type": "grafana-testdata-datasource"
},
"gridPos": {
"h": 11,
"w": 8,
"x": 16,
"y": 11
},
"heatmap": {},
"hideZeroBuckets": true,
"highlightCards": true,
"id": 9,
"legend": {
"show": true
},
"reverseYBuckets": false,
"targets": [
{
"datasource": {
"type": "grafana-testdata-datasource"
},
"refId": "A",
"scenarioId": "exponential_heatmap_bucket_data"
}
],
"title": "log (base 10) with split 5",
"tooltip": {
"show": true,
"showHistogram": true
},
"type": "heatmap",
"xAxis": {
"show": true
},
"xBucketNumber": 10,
"yAxis": {
"format": "short",
"logBase": 10,
"show": true,
"splitFactor": 5
},
"yBucketBound": "auto"
}
],
"refresh": "",
"schemaVersion": 42,
"tags": [
"gdev",
"panel-tests",
"graph-ng"
],
"templating": {
"list": []
},
"time": {
"from": "2022-06-21T18:58:10.279Z",
"to": "2022-06-21T19:06:05.142Z"
},
"timepicker": {},
"timezone": "",
"title": "Legacy heatmap",
"uid": "YoacZIq7z",
"weekStart": ""
}