[Feature] Single click anywhere in a Graph
Is there currently an API that registers a single click on a Graph and sends coordinate information back to the server?
I would like to implement a feature where I can single click anywhere in a Graph and add a vertical line that spans from y=0 to whatever max(y) is.
I would appreciate any pointers towards useful resources.
If there is no such feature I would also be willing to contribute it to dash-core-components if there is interest.
Also see: https://community.plotly.com/t/mouse-click-position-anywhere-on-plot-canvas/10870 https://community.plotly.com/t/get-mouses-position-on-click/4145
This would need to be added to plotly.js first - and has come up many times over there. We'd love to have this feature, it just hasn't yet risen to the top. If you're eager to dig one level deeper @sleighsoft we'd love to help the PR through :) See eg https://github.com/plotly/plotly.js/issues/2696
Thank you @alexcjohnson for pointing me in the right direction. I will definitely give it a shot
Is there a way how I can make dash-core-components use a local installation of plotly.js? So that I can make changes to plotly.js and test them in dash-core-components and or in my own custom ploltly Python app?
Point assets_folder of the dash app to the folder the plotly.js bundle was generated in, and dcc will use that.
Thank you @alexcjohnson
If you are familiar with the JavaScript part of plotly, would you mind taking a look into the issue you referenced where I requested/hoped for some more help/guidance. I would greatly appreciate it:)
Hello, @sleighsoft , do you have a working issue for this problem ? I'm looking for the same feature on Dash graph. Thanks
I do have working code. Just not the time to fully test it unfortunately. No guarantees on an eta too currently
Is it possible to share it please ?
@sleighsoft , can you share it please ? Thanks.
I do have working code. Just not the time to fully test it unfortunately. No guarantees on an eta too currently
There is this work by me. However, it has been pending for a while now. https://github.com/plotly/plotly.js/pull/5443
I may find some time over the weekend to make progress on it, but no promises
There is this work by me. However, it has been pending for a while now. plotly/plotly.js#5443
I may find some time over the weekend to make progress on it, but no promises
Thanks a lot sleighsoft. I have been looking for this for a while and an adaptation of your implementation seems to work for me.
What did you adapt @flaviofusero ?
Sorry, bad wording from my side. I didn't change anything in your logic, I just adapted your code to whatever I needed in my project.