Closed Nate-Wessel closed 1 year ago
Not really—you'd have to implement a compatible interface with D3's selection and the many properties we use: https://github.com/d3/d3-zoom/blob/main/src/zoom.js#L72
(We also use d3-selection's pointer method.)
Got it. Thanks for the quick reply!
The docs on the zoom function say that
I'm interested in that "typically" part. I'm using this in React, and I already have a reference to the element I want to listen for zoom events on. It seems largely redundant to have to wrap this element in a
select
before calling the zoom function. This is the only place I'm explicitly depending ond3-selection
since all my other DOM manipulation is handled by React. Is there another way?A tiny bit of sample code:
Is it possible to refactor this to remove the
d3-selection
dependency?