You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a number of plots that I am trying to synchronize and draw a highlighted point on in response to a users search. This works fine except when they are in tabs. Plotly proxy can't add a trace to graph that is not yet drawn, and in Shiny there isn't a good way to trigger an event after the plot is drawn. Subsequently I have added a manual add_trace check to see if a search has found a point that needs to be highlighted. However, when I add a trace directly to the figure. The traces are added in different orders, I gather the legend is added after both traces are defined. It appears that a continuous legend gets added as a trace, after all traces are drawn. So in a different order than when invokeProxy.
So in scenario one when a plot has been drawn and I add a trace the new trace has an index of 2, however if I draw the plot then add it within the same render function the legend has an index of 2.
It's really difficult to generate a reproducible example here, as I have done a number of tests, and things are pretty confusing. For example, if I add a name variable. name= ~SERIAL_NUM then for some reason each point gets it's own trace index. However, this obliterates the hover text for some reason.
I have a number of plots that I am trying to synchronize and draw a highlighted point on in response to a users search. This works fine except when they are in tabs. Plotly proxy can't add a trace to graph that is not yet drawn, and in Shiny there isn't a good way to trigger an event after the plot is drawn. Subsequently I have added a manual add_trace check to see if a search has found a point that needs to be highlighted. However, when I add a trace directly to the figure. The traces are added in different orders, I gather the legend is added after both traces are defined. It appears that a continuous legend gets added as a trace, after all traces are drawn. So in a different order than when invokeProxy.
So in scenario one when a plot has been drawn and I add a trace the new trace has an index of 2, however if I draw the plot then add it within the same render function the legend has an index of 2.
It's really difficult to generate a reproducible example here, as I have done a number of tests, and things are pretty confusing. For example, if I add a name variable. name= ~SERIAL_NUM then for some reason each point gets it's own trace index. However, this obliterates the hover text for some reason.
The text was updated successfully, but these errors were encountered: