Surface chart orientation resets on React()
waffleShirt opened this issue · comments
I'm wondering if it is possible to retain the viewport orientation for a Surface chart after calling React()? I make use of showing and hiding surfaces on a chart quite regularly, but having to manually reorient the chart to look at a particular location after hiding a surface and calling React() adds a lot of tedium.
I looked at the chart, its layout, the scene owned by the layout, and the camera owned by the scene, to see if there was some way of pulling out the values for the rotation, zoom, etc, but did not find anything that could be used.
If it's something that isn't currently possible, but could reasonably be implemented, let me know and I can look into creating a pull request.
Does setting UIRevision either on the layout or trace help by preserving user interaction on properties that haven't been updated in code?
Plotly.Blazor/Plotly.Blazor/Layout.cs
Line 632 in 1349c4a
Thanks @centreboard, that is exactly what I needed!
Upon creating the surface chart I set UiRevision = 1
on the Layout, and then following any React() call assigning the UiRevision to itself preserves the current view.