Access "Box select" and other events from plotly express #1818
Replies: 3 comments 1 reply
-
Hi, @aljosahafner! p = ui.plotly(go.Figure(go.Scatter(x=[1, 2, 3, 4], y=[1, 2, 3, 2.5])))
p.on('plotlySelected', lambda event: print(event)) but it seems like we can't register to Plotly events at the moment. We'll probably need to forward them in plotly.vue, but I'm unsure how to do that generically without specifying every single event individually. Anyway, I'll convert your question into a feature request. It would definitely be a valuable extension for the |
Beta Was this translation helpful? Give feedback.
-
@falkoschindler First of all, thanks a lot for replying and taking a look at the matter! There are two main pages from plotly documentation that are (sort of) describing this. Maybe this helps: What you posted above would be perfect, either registering it as an event or having the box selection points (x_i, y_i) extractable. I am trying to implement an auto-contrast feature similar to ImageJ, where you select a certain area from a 2D image and then click "auto" and the image colorbar is adjusted according to the min and max values within the box. |
Beta Was this translation helpful? Give feedback.
-
I'll close this feature request as resolved in PR #2231. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Hey,
First of all, I have been using nicegui for quite a while with really nice results. Thanks a lot for the great work you are doing here.
However, recently I have stumbled upon a problem for which I haven't been able to find a solution. Within my application I have a viewer of 2D arrays using plotly.express' imshow function (don't forget to use
binary_string=True
for large arrays!). Now I'd like to access the "box select" feature of plotly and use the selection in my application. I didn't find where in the dict, the selected points can be accessed.Could anyone help me?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions