D3js panzoom with big number of point how to improve?

In this notebook https://observablehq.com/@jipexu/shuanghedongqun
Here is my problem …
from a geojson file with 32919 points
I can display all stations with the topo_sta_p() function (commented in the code : so to see the problem uncomment this function and comment the two other functions as this
// topo_serie(); topo_sta_p(); // topo_sta_0();
). The zoom work well ! but the pan of the zoom dont work. As soon as the “layer” receive a mousedown event the page “freeze” and pan dont work (and need to reload to escape of this situation). Is it a memory leak ? So the question is how optimize the code to allow a good pan of the zoom behavior with a such number of points ?

Posted here because i have not tested outside observable so i dont know if it will be the same in other context (i have to investigate this) ?.. Just know that the same type-size of file work well in openlayers… so is it the conversion to json? the observable context? simply to big ?

Thanks for reading and any advice !

I don’t get the freeze happening when I zoom into map and drag it around.
The dragging does get slower the more I zoom in though.

1 Like

@hellonearthis thank for your time! Too see the problem have you uncommented this fonction (and commented the 2 other function (topo_serie(); & topo_sta_0(); ) to have only this layer ?

1 Like