zcreativelabs / react-simple-maps

Beautiful React SVG maps with d3-geo and topojson using a declarative api.
https://www.react-simple-maps.io/
MIT License
3.07k stars 424 forks source link

Projection choice causes performance loss #273

Closed filippoelgorni closed 1 year ago

filippoelgorni commented 2 years ago

Hello, I have used react-simple-maps in the past with great results and little pain.

This time I am adapting some older code to a newer version of a site, where a dynamic, zoomable choropleth map is present. It uses a geojson of ~4MB. It seems that whenever I add a projection to the ComposableMap component (I have tried geoTimes, geoMercator from d3-geo-projection) the performances of the map sensibly drop. Is this normal?

Consider that in the earlier code, where the projection was added in the Geography component rather than in ComposableMap, the performances seem to be fine.