-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some folks are using right-click on data points in their apps #2101
Comments
It's already on the production (right-click detection using Config option looks fine for us, however I don't fully understand the purpose of #2087 . Am I missing something important here? |
@Melmoth-the-Wanderer we'll make sure you don't get stuck! Can you show a code snippet of how your custom contextmenu works? Then we can see if that works for @AlexVvx's use case and/or figure out if we can't make something cleaner and easier for everyone. |
The problem was, that right click worked well on legend zone, but not on chart zone. Drag layer placed on top level, in order to catch context menu event we have to listen on the top, e.g. document level, and guess target of the click. |
Please take a look at pr #2105 |
I cannot share the exact code with you but I'll prepare some demo of simplified use case in couple of days. |
@AlexVvx thanks for the PR and apologies for the delay in discussing it. Your solution looks promising, but I think what we need at this point is a clear set of tests covering all the situations people can encounter with right clicks, and how they are expected to behave. Otherwise whatever we do is going to bother somebody and we'll be back here again. Seems to me the most flexible (though not necessarily the easiest to use) is maybe:
|
I found #145 (comment) |
@alexcjohnson, sounds good, thank you. I wonder what will happen if we'll trigger plotly_click on right click, if handlers ready for it, they might not check whether it is right or left click. This event may cause left click action on right click. On previous version there were no event on right click. |
Currently we're capturing Despite of that, @alexcjohnson's propositions are great and I really like the idea of
We're also capturing click event (standard one) when user clicks away from data points (we than calculate when the click occurs on the graph related to traces), but it would be great to have plotly event data (with empty points list) available.
There is already an event called
Would be nice to have a possibility to determine which element has been clicked (was it x or y axis?) - is it even possible? I can imagine that e.axis could be passed alongside with mouse event (same as in case of points) when we click the axis. Use case: with multiple y axes we can build a contextmenu with actions for specific axis. (eg. to move axis right or left, create subplot for this axis etc). |
That's not true: https://codepen.io/etpinard/pen/EbxxLo?editors=0010 |
This would make a lot of users happy, but I would hold back on this until we can bring support for off-point |
I agree with all of these 👍 |
Thinking about this some more, I'd say @AlexVvx 's #2105 is probably just what we need for the Any objections? |
If it works for @AlexVvx that's a great start. I'd love a 👍 /👎 from @Melmoth-the-Wanderer Are there any other specific conditions folks depend on that we could add a test for, so we're not back here again next release? How many of the propositions in #2101 (comment) have we tested, and do they all behave as proposed? |
👍 |
PR #2241 should fix this issue. |
... and PR #2087 broke that 💣
See https://community.plot.ly/t/plotly-click-event-stopped-firing-after-update-on-right-click/6353 and https://community.plot.ly/t/annotation-right-click/6352.
What should we do?
plotly_click
on right-clicks?The text was updated successfully, but these errors were encountered: