Open trafficonese opened 5 years ago
You raise a great point with this example and I don't think there currently is a great way adapt 'plotly_click' to accumulate data by holding shift. I will point out though that event_data()
is designed to work both with and without highlight_key()
, so it tries to not be too opinionated about what you want to do with it.
I think there may be cases where, even if someone happens to be holding shift, you don't want 'plotly_click' to accumulate, so it seems safer to just expose another input event, say 'plotly_shift_click', that fires the accumulated data. I'll take a stab at an implementation in #1392
And come to think of it, 'plotly_hover' suffers from the same problem.
When using the SHIFT-key on a
plotly_click
event, it returns only the last clicked key, whereas using SHIFT onplotly_selected
stores all selected keys.Is it possible to adapt the
event_data("plotly_click")
to be consistent with the highlighting and return all clicked/highlighted elements?Or can I deactivate SHIFT for click-events alltogether and leave it activated for selection-events?
Shiny-App: