d3 / d3-selection

Transform the DOM by selecting elements and joining to data.
https://d3js.org/d3-selection
ISC License
558 stars 294 forks source link

How to add passive listener into zoom event? #280

Closed MUTHUKUMAR73737 closed 3 years ago

MUTHUKUMAR73737 commented 3 years ago

image

I am getting above error when I drag inside the chart.

d3.select("svg") .call( d3.zoom() .scaleExtent([1, 10]) .translateExtent([[0, 0], [400, 215]]) .extent([[0, 0], [400, 215]]) .on("zoom", function (event) { // stuff here })

Relevant Analysis: https://developers.google.com/web/updates/2016/06/passive-event-listeners https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_on

From the above analysis, what I observed is we should turn off the passive event listener.

I would like to pass additional options like passive event listener in the d3js event handling.

I am using d3js version 6.3.1

Please help me to resolve this issue.

Fil commented 3 years ago

duplicate of https://github.com/d3/d3-zoom/issues/231