d3 / d3-zoom

Pan and zoom SVG, HTML or Canvas using mouse or touch input.

Home Page:https://d3js.org/d3-zoom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

documentation for zoom.on does not provide sufficient information to understand its use

christopherreay opened this issue · comments

The documentation seems to be assuming knowledge of many ideas.

I have read it, and dispatcher.on, and I have looked at the source code of the d3-zoom zoom.js

There is no information describing what actually needs to be done to listen to zoom events. There is a lot of information about zoom events, but it seems to be talking around the point and assuming that someone already knows some undetermined, implicit information

Registering a listener zoom().on("zoom", event => console.log(event) prints "undefined" into the console for every event. It appears that there are possibly events like "mousewheel.zoom" or something... But there is no documentation about this.

There is no example of a working event listener, which might help.

Hang on, maybe I am somehow mixing the documentation for d3fc-zoom and d3-zoom, and it is their documentation that is odd.

The documentation also has lots of links to examples.