How to get the (x,y) value of each point
zhouyangit opened this issue · 6 comments
hi~, How to get the (x,y) value of each point,When the mouse moves over the line .
Thanks!
This should do the job?
https://danchitnis.github.io/webgl-plot-examples/vanilla/cross.html
ok! Thanks!
Would it be possible to show points when the mouse moves over the line? The cross example only prints the relative mouse position.
Just like in this GIF:
Also it would be nice if there would be the possibility to always show the points on the line independently from the mouse, as again it is in the GIF above.
@Luca8991 Thanks for your suggestion. Yes, it is possible, but perhaps not as sleek as your attached image. I can make a basic WebGL tooltip to display the (x,y) when the mouse is over the line. In order for the tooltip to snap to the data points rather than following the plotted line, I need to think a bit more. Notice on dense data sets the individual data points are not visible.
@danchitnis let me know if you need some help (even though I don't have much experience with WebGL).
I find your library very helpful and would be happy if it can improveto become a more complete plot library. For this reason, I think also the grid & axis would be something that would be nice if implemented and made available through the API.
I will create a separate folder webgl-plot/utils
in which I put all the utility tools and separate them from the core. There are two immediate improvements on the axis:
- The axis example needs improvement, especially on the ticks, sub-ticks, and the dynamic display of them when the graph is moving
- Need to implement Cursors (or *Markers), locked in the x-axis or y-axis and draggable by mouse. This is similar to your attached gif and is often used in test and measurement equipment.
I would like to also - at some point - embed this in Jupyter notebooks. I would put a call out for that on the main Readme.