# D3js panzoom with big number of point how to improve?

**URL:** <https://talk.observablehq.com/t/d3js-panzoom-with-big-number-of-point-how-to-improve/4533>\
**Category:** Help\
**Created:** [January 26, 2021, 11:26am UTC](https://talk.observablehq.com/t/d3js-panzoom-with-big-number-of-point-how-to-improve/4533 "2021-01-26T11:26:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jipexu](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/jipexu/32/1312_2.png) [@jipexu](https://talk.observablehq.com/u/jipexu)\
**Post date:** [January 26, 2021, 11:26am UTC](https://talk.observablehq.com/t/d3js-panzoom-with-big-number-of-point-how-to-improve/4533/1 "2021-01-26T11:26:25Z")

</div>

Hi  
In this notebook [https://observablehq.com/@jipexu/shuanghedongqun](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 !

---

<div class="post-metadata">

**Author:** ![hellonearthis](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/hellonearthis/32/3935_2.png) [@hellonearthis](https://talk.observablehq.com/u/hellonearthis)\
**Post date:** [January 26, 2021, 9:58pm UTC](https://talk.observablehq.com/t/d3js-panzoom-with-big-number-of-point-how-to-improve/4533/2 "2021-01-26T21:58:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jipexu](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/jipexu/32/1312_2.png) [@jipexu](https://talk.observablehq.com/u/jipexu)\
**Post date:** [January 27, 2021, 8:58am UTC](https://talk.observablehq.com/t/d3js-panzoom-with-big-number-of-point-how-to-improve/4533/3 "2021-01-27T08:58:03Z")

</div>

@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 ?

> [@jipexu](#):
>
> topo\_sta\_p()
