How to use restyle in trame-plotly #230
Unanswered
cardinalgeo
asked this question in
Q&A
Replies: 1 comment
-
Sorry, I'm not well versed in plotly but if you fully understand what needs to happen and where (which I could not fully grasp from your discussion), trame give you the infrastructure to make method call from-js-to-python, from-python-to-js, and sync-state-across-js-py. So you should have all the tools you need. It might be worth at some point to revisit the JS side of trame-plotly to get the latest version of plotly, expose everything that is available on the JS side and provide a vue library that can be used in both vue 2 and vue 3. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey folks!
First of all, apologies — this is perhaps best suited for the trame-plotly repo, but as it doesn't have a discussions section and this didn't deserve opening an issue, I thought I'd post in the regular trame repo discussions section.
I'd like to re-color points in a scatter plot upon clicking them, as is demonstrated in the official Plotly example here using a
click
event andrestyle
with Plotly.js. I understand how theclick
events can be used with Trame (e.g., as exemplified in the Trame example here but for a selection rather than a click). But it's unclear howrestyle
, which is framed here as an event just like aclick
, is triggered. Ultimately, I'd need to pass information torestyle
in order to "restyle" the plot — how would I go about doing that? Furthermore, in the example in the first link above, I'm passing information from theclick
event torestyle
— how can I link those two together withtrame-plotly
?Finally, I suspect that understanding this may in turn aid in understanding how to use the
relayout
event, which might permit resizing the plot without regenerating the entire figure — something that I think would resolve the issue documented here.Beta Was this translation helpful? Give feedback.
All reactions