-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding filter of summarized field grouped by latitude and longitude on a map causes table visualization error #30058
Comments
I looks like the problem is that (encountered while investigating #30057) |
The loops accounts for the index being out of bounds everywhere except the first line. The fix is rather simple: diff --git a/frontend/src/metabase/visualizations/components/LeafletGridHeatMap.jsx b/frontend/src/metabase/visualizations/components/LeafletGridHeatMap.jsx
index e2d57be15b..ccbc0eb679 100644
--- a/frontend/src/metabase/visualizations/components/LeafletGridHeatMap.jsx
+++ b/frontend/src/metabase/visualizations/components/LeafletGridHeatMap.jsx
@@ -66,8 +66,6 @@ export default class LeafletGridHeatMap extends LeafletMap {
const longitureValues = points.map(row => row[longitudeIndex]);
for (let i = 0; i < totalSquares; i++) {
- const [latitude, longiture, metric] = points[i];
-
if (i >= points.length) {
gridLayer.removeLayer(gridSquares[i]);
}
@@ -78,6 +76,8 @@ export default class LeafletGridHeatMap extends LeafletMap {
}
if (i < points.length) {
+ const [latitude, longiture, metric] = points[i];
+
gridSquares[i].setStyle({ color: colorScale(metric) });
const [latMin, latMax] = getValueRange( |
…tude on a map causes table visualization error (#31952) * Fix #30058 * Add missing setting key * Add a unit test attempt at #30058 * Mock store instead of using deprecated MetabaseSettings.set * Remove LeafletGridHeatMap unit tests * Add e2e test for #30058 * Fix typing * Don't allow undefined "map-tile-server-url" * Tag the test with repo and issue id
…tude on a map causes table visualization error (#31952) * Fix #30058 * Add missing setting key * Add a unit test attempt at #30058 * Mock store instead of using deprecated MetabaseSettings.set * Remove LeafletGridHeatMap unit tests * Add e2e test for #30058 * Fix typing * Don't allow undefined "map-tile-server-url" * Tag the test with repo and issue id
…tude on a map causes table visualization error (#31952) (#32033) * Fix #30058 * Add missing setting key * Add a unit test attempt at #30058 * Mock store instead of using deprecated MetabaseSettings.set * Remove LeafletGridHeatMap unit tests * Add e2e test for #30058 * Fix typing * Don't allow undefined "map-tile-server-url" * Tag the test with repo and issue id Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Describe the bug
Logs
To Reproduce
Steps to reproduce the behavior (if you can reproduce the bug using the Sample Database, we will find the issue faster):
Expected behavior
Information about your Metabase Installation:
You can get this information by going to Admin -> Troubleshooting, or simply post the JSON you see in that page.
Severity
The text was updated successfully, but these errors were encountered: