From d6fd8cf0cfc48b1d41d30554f888ccb757324567 Mon Sep 17 00:00:00 2001 From: David Kiania Date: Mon, 27 Apr 2026 17:25:58 +0300 Subject: [PATCH 1/3] fix(grafana): stop SI auto-scaling on km/hours stats; bound geomap to East Africa MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Grafana's lengthkm and h units auto-scale with SI prefixes — fleet km totals rendered as "Mm" (megametres) and drive-hour totals as days/weeks, which read as "millions" and "weeks" on the Daily Ops dashboard. Switched the affected panels (Fleet km today, Drive/Idle hours today, the per-vehicle roll-up table, the driver leaderboard, and the 7-day distance trend) to unit "none" with decimals: 1 so values stay in km/h with units carried by panel titles and column displayNames. Geomap view recentred to lat -2.0, lon 35.5, zoom 5 with minZoom 5 / maxZoom 12 so the Active Vehicles map opens on the East African Community region and cannot zoom out past it. Co-Authored-By: Claude Opus 4.7 --- .../daily_operations_dashboard.json | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/grafana/provisioning/dashboards-json/daily_operations_dashboard.json b/grafana/provisioning/dashboards-json/daily_operations_dashboard.json index d4a935b..364a7e0 100644 --- a/grafana/provisioning/dashboards-json/daily_operations_dashboard.json +++ b/grafana/provisioning/dashboards-json/daily_operations_dashboard.json @@ -111,7 +111,7 @@ }, "fieldConfig": { "defaults": { - "unit": "lengthkm", + "unit": "none", "decimals": 1, "color": { "mode": "fixed", "fixedColor": "blue" } } @@ -133,7 +133,7 @@ "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } }, "fieldConfig": { - "defaults": { "unit": "h", "decimals": 1, "color": { "mode": "fixed", "fixedColor": "green" } } + "defaults": { "unit": "none", "decimals": 1, "color": { "mode": "fixed", "fixedColor": "green" } } }, "targets": [ { "datasource": { "type": "postgres", "uid": "tracksolid_pg" }, @@ -154,7 +154,7 @@ }, "fieldConfig": { "defaults": { - "unit": "h", "decimals": 1, + "unit": "none", "decimals": 1, "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", @@ -256,7 +256,7 @@ } ], "tooltip": { "mode": "details" }, - "view": { "allLayers": true, "id": "coords", "lat": -1.5, "lon": 36.5, "zoom": 6 } + "view": { "allLayers": true, "id": "coords", "lat": -2.0, "lon": 35.5, "zoom": 5, "minZoom": 5, "maxZoom": 12 } }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic-by-name" } }, @@ -335,11 +335,11 @@ "defaults": { "custom": { "align": "auto", "filterable": true } }, "overrides": [ { "matcher": { "id": "byName", "options": "km_today" }, - "properties": [{ "id": "unit", "value": "lengthkm" }, { "id": "decimals", "value": 1 }] }, + "properties": [{ "id": "unit", "value": "none" }, { "id": "decimals", "value": 1 }, { "id": "displayName", "value": "km today" }] }, { "matcher": { "id": "byName", "options": "drive_hours" }, - "properties": [{ "id": "unit", "value": "h" }, { "id": "decimals", "value": 1 }] }, + "properties": [{ "id": "unit", "value": "none" }, { "id": "decimals", "value": 1 }, { "id": "displayName", "value": "Drive h" }] }, { "matcher": { "id": "byName", "options": "idle_hours" }, - "properties": [{ "id": "unit", "value": "h" }, { "id": "decimals", "value": 1 }] }, + "properties": [{ "id": "unit", "value": "none" }, { "id": "decimals", "value": 1 }, { "id": "displayName", "value": "Idle h" }] }, { "matcher": { "id": "byName", "options": "did_not_move" }, "properties": [ { "id": "custom.cellOptions", "value": { "type": "color-background" } }, @@ -378,7 +378,7 @@ "defaults": { "custom": { "align": "auto", "filterable": true } }, "overrides": [ { "matcher": { "id": "byName", "options": "km" }, - "properties": [{ "id": "unit", "value": "lengthkm" }, { "id": "decimals", "value": 0 }] }, + "properties": [{ "id": "unit", "value": "none" }, { "id": "decimals", "value": 0 }, { "id": "displayName", "value": "km" }] }, { "matcher": { "id": "byName", "options": "speeding_per_100km" }, "properties": [ { "id": "custom.cellOptions", "value": { "type": "color-background" } }, @@ -424,8 +424,9 @@ "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "fieldConfig": { "defaults": { - "unit": "lengthkm", - "custom": { "drawStyle": "bars", "fillOpacity": 60, "lineWidth": 1 } + "unit": "none", + "decimals": 1, + "custom": { "drawStyle": "bars", "fillOpacity": 60, "lineWidth": 1, "axisLabel": "km" } } }, "targets": [ From 03ceeb4d2daed3d443a9f8bb56f659d3e5c62acb Mon Sep 17 00:00:00 2001 From: David Kiania Date: Mon, 27 Apr 2026 18:31:01 +0300 Subject: [PATCH 2/3] fix(grafana): tighten Active Vehicles map to Kenya, Uganda and Tanzania Recentred geomap view from lat -2.0/lon 35.5/zoom 5 to lat -3.0/lon 34.5/ zoom 5.5 (Lake Victoria area, the geographic intersection of the three countries) and raised minZoom to 5.5 so the dashboard can't be panned out to show neighbouring countries. Co-Authored-By: Claude Opus 4.7 --- .../dashboards-json/daily_operations_dashboard.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grafana/provisioning/dashboards-json/daily_operations_dashboard.json b/grafana/provisioning/dashboards-json/daily_operations_dashboard.json index 364a7e0..68cf577 100644 --- a/grafana/provisioning/dashboards-json/daily_operations_dashboard.json +++ b/grafana/provisioning/dashboards-json/daily_operations_dashboard.json @@ -256,7 +256,7 @@ } ], "tooltip": { "mode": "details" }, - "view": { "allLayers": true, "id": "coords", "lat": -2.0, "lon": 35.5, "zoom": 5, "minZoom": 5, "maxZoom": 12 } + "view": { "allLayers": true, "id": "coords", "lat": -3.0, "lon": 34.5, "zoom": 5.5, "minZoom": 5.5, "maxZoom": 12 } }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic-by-name" } }, From dc6404a1148e2720d46014ddc7ff91f94113777c Mon Sep 17 00:00:00 2001 From: David Kiania Date: Mon, 27 Apr 2026 18:32:14 +0300 Subject: [PATCH 3/3] fix(grafana): raise geomap maxZoom from 12 to 22 for full-resolution drill-in Carto basemap tiles render up to ~19-20; OpenLayers caps at 28. 22 leaves no practical ceiling for street-level inspection while keeping the EAC- bounded minZoom in place. Co-Authored-By: Claude Opus 4.7 --- .../dashboards-json/daily_operations_dashboard.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grafana/provisioning/dashboards-json/daily_operations_dashboard.json b/grafana/provisioning/dashboards-json/daily_operations_dashboard.json index 68cf577..227dd3d 100644 --- a/grafana/provisioning/dashboards-json/daily_operations_dashboard.json +++ b/grafana/provisioning/dashboards-json/daily_operations_dashboard.json @@ -256,7 +256,7 @@ } ], "tooltip": { "mode": "details" }, - "view": { "allLayers": true, "id": "coords", "lat": -3.0, "lon": 34.5, "zoom": 5.5, "minZoom": 5.5, "maxZoom": 12 } + "view": { "allLayers": true, "id": "coords", "lat": -3.0, "lon": 34.5, "zoom": 5.5, "minZoom": 5.5, "maxZoom": 22 } }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic-by-name" } },