grafana / grafana

The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
https://grafana.com
GNU Affero General Public License v3.0
65.08k stars 12.15k forks source link

Dashboards: geomap heatmap "Fit to data" doesn't fit map view to data #84230

Open mdz-doordash opened 8 months ago

mdz-doordash commented 8 months ago

What happened?

I'm plotting a dataset of geohashes using the heatmap layer type. When Fit to data is selected, I get a map of the entire world with the heatmap displayed.

What did you expect to happen?

The map should be zoomed in on the area where data points are present

Did this work before?

No, but it does work as expected with the Markers layer type, so it doesn't seem to be a problem with my dataset.

Also reported by another user here in May 2023, so this behavior seems to have been present for some time.

How do we reproduce it?

  1. Create a geomap visualization with some sample data within a localized geographic area
  2. Under Map layers, dd a Heatmap layer
  3. Under Map view, select view Fit to data for the initial view
  4. Refresh the map

Is the bug inside a dashboard panel?

Key Value
Panel geomap @ 10.2.2
Grafana 10.2.2 (161e3cac5075540918e3a39004f2364ad104d5bb) // Open Source
Panel debug snapshot dashboard ```json { "panels": [ { "datasource": { "type": "grafana", "uid": "grafana" }, "description": "", "fieldConfig": { "defaults": { "custom": { "hideFrom": { "tooltip": false, "viz": false, "legend": false } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "color": { "mode": "thresholds" } }, "overrides": [] }, "gridPos": { "h": 13, "w": 15, "x": 0, "y": 0 }, "id": 2, "options": { "view": { "allLayers": false, "id": "fit", "lat": 40, "lon": -100, "zoom": 15, "lastOnly": false, "layer": "Layer 1" }, "controls": { "showZoom": true, "mouseWheelZoom": true, "showAttribution": true, "showScale": false, "showMeasure": false, "showDebug": false }, "tooltip": { "mode": "details" }, "basemap": { "config": {}, "name": "Layer 0", "type": "default" }, "layers": [ { "config": { "weight": { "fixed": 1, "min": 0, "max": 1 }, "blur": 15, "radius": 5 }, "filterData": { "id": "byRefId", "options": "A" }, "name": "Layer 1", "tooltip": true, "type": "heatmap" } ] }, "pluginVersion": "10.2.2", "targets": [ { "refId": "A", "datasource": { "type": "grafana", "uid": "grafana" }, "queryType": "snapshot", "snapshot": [ { "schema": { "refId": "A", "meta": { "typeVersion": [ 0, 0 ], "preferredVisualisationType": "table", "executedQueryString": "select\n location_geohash, count()\nfrom REDACTED" }, "name": "A", "fields": [ { "name": "location_geohash", "type": "string", "typeInfo": { "frame": "string" }, "config": {} }, { "name": "count()", "type": "number", "typeInfo": { "frame": "uint64" }, "config": {} } ] }, "data": { "values": [ [ "f84czwyg", "f8541m4s", "f8541xxu", "f84fpe0g", "f8540vmt", "f8540vkg", "f8541x9e", "f84fp759", "f8541tv8", "f84fnk1k", "f8541nj4", "f84fp940", "f84fpfgw", "f854058u", "f8541e0k", "f84fp4ff", "f8540uxv", "f84fp81u", "f8540se9", "f84fnjcv", "f84fp3r3", "f84fpfuc", "f8541q99", "f8541ttu", "f8541hu7", "f84fnpdz", "f84czu8p", "f8541qsf", "f84fp577", "f84fpe70", "f84fnshh", "f84fpc92", "f8540huj", "f84czwqd" ], [ 1, 1, 1, 3, 3, 3, 3, 3, 1, 1, 2, 1, 2, 1, 2, 11, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 1, 4, 1, 1 ] ] } } ] } ], "title": "Reproduced with embedded data", "type": "geomap" }, { "gridPos": { "h": 7, "w": 9, "x": 15, "y": 0 }, "id": 5, "options": { "content": "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Panelgeomap @ 10.2.2
QueriesA[grafana-clickhouse-datasource]
Data 1 frames, 2 fields, 2034 rows
Grafana10.2.2 (161e3cac5075540918e3a39004f2364ad104d5bb) // Open Source
", "mode": "html" }, "title": "Debug info", "type": "text" }, { "id": 6, "title": "Original Panel JSON", "type": "text", "gridPos": { "h": 13, "w": 9, "x": 15, "y": 7 }, "options": { "content": "{\n \"datasource\": {\n \"type\": \"grafana-clickhouse-datasource\",\n \"uid\": \"P9561D949CB0BBB8A\"\n },\n \"description\": \"\",\n \"fieldConfig\": {\n \"defaults\": {\n \"custom\": {\n \"hideFrom\": {\n \"tooltip\": false,\n \"viz\": false,\n \"legend\": false\n }\n },\n \"mappings\": [],\n \"thresholds\": {\n \"mode\": \"absolute\",\n \"steps\": [\n {\n \"color\": \"green\",\n \"value\": null\n },\n {\n \"color\": \"red\",\n \"value\": 80\n }\n ]\n },\n \"color\": {\n \"mode\": \"thresholds\"\n }\n },\n \"overrides\": []\n },\n \"gridPos\": {\n \"h\": 8,\n \"w\": 8,\n \"x\": 0,\n \"y\": 3\n },\n \"id\": 16,\n \"options\": {\n \"view\": {\n \"allLayers\": false,\n \"id\": \"fit\",\n \"lat\": 40,\n \"lon\": -100,\n \"zoom\": 15,\n \"lastOnly\": false,\n \"layer\": \"Layer 1\"\n },\n \"controls\": {\n \"showZoom\": true,\n \"mouseWheelZoom\": true,\n \"showAttribution\": true,\n \"showScale\": false,\n \"showMeasure\": false,\n \"showDebug\": false\n },\n \"tooltip\": {\n \"mode\": \"details\"\n },\n \"basemap\": {\n \"config\": {},\n \"name\": \"Layer 0\",\n \"type\": \"default\"\n },\n \"layers\": [\n {\n \"config\": {\n \"weight\": {\n \"fixed\": 1,\n \"min\": 0,\n \"max\": 1\n },\n \"blur\": 15,\n \"radius\": 5\n },\n \"filterData\": {\n \"id\": \"byRefId\",\n \"options\": \"A\"\n },\n \"name\": \"Layer 1\",\n \"tooltip\": true,\n \"type\": \"heatmap\"\n }\n ]\n },\n \"pluginVersion\": \"10.2.2\",\n \"targets\": [\n {\n \"datasource\": {\n \"type\": \"grafana-clickhouse-datasource\",\n \"uid\": \"P9561D949CB0BBB8A\"\n },\n \"editorType\": \"sql\",\n \"format\": 1,\n \"meta\": {\n \"builderOptions\": {\n \"columns\": [],\n \"database\": \"\",\n \"limit\": 1000,\n \"mode\": \"list\",\n \"queryType\": \"table\",\n \"table\": \"\"\n }\n },\n \"pluginVersion\": \"4.0.3\",\n \"queryType\": \"table\",\n \"rawSql\": \"select\\n location_geohash, count()\\nfrom REDACTED\",\n \"refId\": \"A\"\n }\n ],\n \"title\": \"Heatmap\",\n \"type\": \"geomap\"\n}", "mode": "code", "code": { "language": "json", "showLineNumbers": true, "showMiniMap": true } } }, { "id": 3, "title": "Data from panel above", "type": "table", "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "gridPos": { "h": 7, "w": 15, "x": 0, "y": 13 }, "options": { "showTypeIcons": true }, "targets": [ { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "panelId": 2, "withTransforms": true, "refId": "A" } ] } ], "schemaVersion": 37, "title": "Debug: Heatmap // 2024-03-11 13:10:06", "tags": [ "debug", "debug-geomap" ], "time": { "from": "2024-03-09T21:10:06.687Z", "to": "2024-03-11T20:10:06.687Z" } } ```

Environment (with versions)?

Grafana: 10.2.2 OS: MacOS Browser: Chrome 122.0.6261.112

Grafana platform?

None

Datasource(s)?

No response

robhamnett commented 4 months ago

This is happening with the markers layer in my data set. Worked fine previously. Broke with recent update. Fit to data no longer centers map view on specified layer, it now just zooms out to the farthest extent upon load/refresh.

Grafana 11.1.0

image

swiffer commented 3 months ago

it should have been fixed in 11.1.1 / 11.1.2 according to this backport - https://github.com/grafana/grafana/pull/89248

however it's still broken for me when making use of the route layer type

grafik

arter97 commented 3 months ago

it should have been fixed in 11.1.1 / 11.1.2 according to this backport - #89248

however it's still broken for me when making use of the route layer type

grafik

Can confirm this as well. (Deployed without Docker.)

Intenos commented 3 months ago

In 11.1.3 it works for me with the layer type "Markers". for "Heatmap" it is still broken.

N3v3R3nD commented 2 months ago

Is there any updates on this? Using route and also have this issue.

swiffer commented 2 months ago

See #89777 fix promised soon