Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

on hover highlight border

Blue Mouse9174073846c9
diff --git a/web/app/pages/Project/View/components/InteractiveMap.tsx b/web/app/pages/Project/View/components/InteractiveMap.tsx
index b0faebe34..121d99ffc 100644
--- a/web/app/pages/Project/View/components/InteractiveMap.tsx
+++ b/web/app/pages/Project/View/components/InteractiveMap.tsx
@@ -154,14 +154,18 @@ const InteractiveMapCore = ({ data, regionData, onClickCountry, total }: Interac
color = 'rgba(180, 180, 180, 0.3)'
}
+ const isHovered = hoveredId === featureId
+
return {
- color: mapView === 'regions' ? '#666666' : '#ffffff',
- weight: mapView === 'regions' ? 0.8 : 0.5,
+ color: isHovered ? '#60a5fa' : mapView === 'regions' ? '#666666' : '#ffffff',
+ weight: isHovered ? 1.5 : mapView === 'regions' ? 0.8 : 0.5,
fill: true,
fillColor: color,
- fillOpacity: hoveredId === featureId ? 0.9 : metricValue > 0 ? 0.7 : 0.3,
+ // Keep fill opacity stable; highlight via stroke on hover instead
+ fillOpacity: metricValue > 0 ? 0.7 : 0.3,
opacity: 1,
smoothFactor: 0.1,
+ className: 'transition-all duration-200 ease-out',
}
},
[mapView, colorScale, hoveredId, findDataForFeature],
@@ -275,7 +279,15 @@ const InteractiveMapCore = ({ data, regionData, onClickCountry, total }: Interac
<MapEventHandler />
{countriesGeoData && mapView === 'countries' ? (
- <GeoJSON data={countriesGeoData} style={handleStyle} onEachFeature={handleEachFeature} />
+ <GeoJSON
+ data={countriesGeoData}
+ style={handleStyle}
+ onEachFeature={handleEachFeature}
+ pathOptions={{
+ interactive: true,
+ bubblingMouseEvents: false,
+ }}
+ />
) : null}
{filteredRegionsGeoData && mapView === 'regions' ? (