From 9bddd45e601477e8d577964965f713b4c83cf21c Mon Sep 17 00:00:00 2001 From: Lance Hawkins Date: Wed, 7 Oct 2026 17:44:33 +0000 Subject: [PATCH] Increase Dynamic Point Scaling --- .../plugins/geoset-map-chart/src/utils/pointSize.ts | 6 +++--- .../geoset-map-chart/test/utils/pointSize.test.ts | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/superset-frontend/plugins/geoset-map-chart/src/utils/pointSize.ts b/superset-frontend/plugins/geoset-map-chart/src/utils/pointSize.ts index cccfbef0a2..4e6428e204 100644 --- a/superset-frontend/plugins/geoset-map-chart/src/utils/pointSize.ts +++ b/superset-frontend/plugins/geoset-map-chart/src/utils/pointSize.ts @@ -1,9 +1,9 @@ /** * Scale dynamically sized points as the map zooms in so small values remain - * visible. The multiplier grows gradually above zoom 4 and is capped to keep - * large points from overwhelming the map. + * visible. Keep the configured size through zoom 4, then grow by 1 per zoom + * level up to an 8x cap. */ export const getDynamicPointZoomScale = (zoom: number): number => { if (!Number.isFinite(zoom)) return 1; - return Math.min(3.5, 1 + Math.max(0, zoom - 4) * 0.25); + return Math.min(8, 1 + Math.max(0, zoom - 4)); }; diff --git a/superset-frontend/plugins/geoset-map-chart/test/utils/pointSize.test.ts b/superset-frontend/plugins/geoset-map-chart/test/utils/pointSize.test.ts index 04e8987cb1..724ac4f1fa 100644 --- a/superset-frontend/plugins/geoset-map-chart/test/utils/pointSize.test.ts +++ b/superset-frontend/plugins/geoset-map-chart/test/utils/pointSize.test.ts @@ -7,13 +7,13 @@ describe('getDynamicPointZoomScale', () => { }); it('gradually increases point size above zoom 4', () => { - expect(getDynamicPointZoomScale(6)).toBe(1.5); - expect(getDynamicPointZoomScale(8)).toBe(2); + expect(getDynamicPointZoomScale(6)).toBe(3); + expect(getDynamicPointZoomScale(8)).toBe(5); }); - it('caps the multiplier at 3.5', () => { - expect(getDynamicPointZoomScale(24)).toBe(3.5); - expect(getDynamicPointZoomScale(30)).toBe(3.5); + it('caps the multiplier at 8', () => { + expect(getDynamicPointZoomScale(24)).toBe(8); + expect(getDynamicPointZoomScale(30)).toBe(8); }); it('falls back safely for an invalid zoom', () => {