d3 / d3-zoom

Pan and zoom SVG, HTML or Canvas using mouse or touch input.
https://d3js.org/d3-zoom
ISC License
505 stars 143 forks source link

D3 React Zoom #160

Closed Louis345 closed 5 years ago

Louis345 commented 5 years ago

Hello All,

I am currently struggling with an issue using React with D3. My goal is to create a static Y Axis on my bar chart that allows users to scroll on the X-axis while the Y-axis stays in place. I have seen several examples of this and they seem to all use this d3.event.transform.rescaleX. I am not seeing that method on d3 event. I am using the latest version of d3. What I am seeing is this: transform: Transform {k: 1, x: -76, y: -5}, but I do not see a rescaleX. Any help would be greatly appreciated and I have also created a StackOverflow post so I can at least award you some points for the help.

https://stackoverflow.com/questions/53161715/react-barchart-using-d3-scrollable-x-axis

I have also created a sandbox so you can better inspect my code.

https://codesandbox.io/s/k0pj5m8q93

mbostock commented 5 years ago

Please use Stack Overflow tag d3.js to ask for help. Stack Overflow provides a better collaborative forum: thousands of D3-related questions have been asked there, and some answers may be relevant to you.

When asking for help, please include a link to demonstrate the issue, preferably as an Observable notebook. It is often impossible to debug from code snippets alone. Isolate the issue and reduce your code as much as possible before asking for help. The less code you post, the easier it is for someone to debug, and the more likely you are to get a helpful response.

If you have a question about D3’s behavior and want to discuss it with other users, also consider the d3-js Google Group or joining the d3-js Slack.

Thank you! 🤗