I would like to be able to save the visibility state (i.e. shown or hidden) associated with each trace so that when the plot needs to be redrawn (e.g. user navigates to another view in the app then comes back to one that uses plotly.js) the app can set visibility: 'legendonly'
on the traces that the user had previously hidden.
It looks like the plotly_restyle
event fires in this case, and I can see the update in the eventData
. Is that the recommended way to do this (or at least an appropriate place to put the related code)?