react-vis icon indicating copy to clipboard operation
react-vis copied to clipboard

Y axis zoom

Open jonnydodad opened this issue 8 years ago • 4 comments

hi, I have successfully added zoom along the x-axis( using this https://uber.github.io/react-vis/examples/charts/zoomable-chart )but i want to zoom along the y-axis as well. any suggestions on how to do that? thank you

jonnydodad avatar Apr 04 '18 23:04 jonnydodad

Hey Jonny - this is certainly possible, but not with the current implementation. It would require more code to accomplish. Did you copy the highlight.js file into your codebase to use it, or did you import it some other way?

Regardless - there's some TODO's in the file that show some areas that require work to add y-axis zoom.

Ideally this would be part of the core code and not an example, but I haven't been able to migrate this yet.

akindr avatar Apr 05 '18 13:04 akindr

I have some old code laying around where I modified the existing example.

Clicking on the x or y axis results in a zoom along the selected axis. Clicking inside the graph results in a zoom on both axis at the same time. The code is available here: https://codesandbox.io/s/3ql7o7lyr6.

Be careful for bugs, this was some of the first work I did in Javascript and react...

thdhondt avatar May 03 '18 21:05 thdhondt

I extended the highlight example to zoom X and Y and fixed the offset. Take a look : #858

Domino987 avatar Jul 05 '18 13:07 Domino987

The new highlight component addresses this!

mcnuttandrew avatar Sep 07 '18 15:09 mcnuttandrew