allen-cell-animated / volume-viewer

https://allen-cell-animated.github.io/volume-viewer/
Other
92 stars 7 forks source link

Tweakpane fixes #203

Closed frasercl closed 6 months ago

frasercl commented 6 months ago

Review time: really little (5-10min)

Resolves #143 and resolves #156: use tweakpane more responsibly.

How tweakpane is used currently:

How tweakpane is used after this PR:

I believe the original strategy of rebuilding the tweakpane on data loads was to anticipate when objects were replaced and rebind everything to new objects. But that seems to be pretty rare - it should currently just happen on switching to an entirely new volume (though other, deeper objects we could bind controls to in the future, e.g. Channel or MeshVolume, may be recreated more frequently and cause confusion). Hopefully a user who knows to open the tweakpane can deal with reopening it when a desync occurs. I'd still be grateful for a bit of extra testing here though. In particular, @toloudis I'm seeing different and better numbers in the heap profiler with this change versus the current state, but I'd be interested in a bit of verification since you did the tests that prompted #143 in the first place.