vidartf / unray

Jupyter Widgets for volume rendering of functions on unstructured tetrahedral meshes.
BSD 3-Clause "New" or "Revised" License
14 stars 4 forks source link

Wire up data change events #22

Closed martinal closed 6 years ago

martinal commented 7 years ago

Currently all examples just recreate every plot from scratch and most data changes are not listened to. Needs fixing.

martinal commented 6 years ago

@vidartf pythreejs will call syncToThreeObj on a BlackboxModel on a direct change event, but not catch child changes. It looks like the setupListeners function does approximately what unray PlotObject will need to do for its own nested properties, could you make it possible to hook into that mechanism by specifying a list of blackbox properties somehow? Or can I just add to one of those lists? All this event configuration looks a bit delicate.

martinal commented 6 years ago

Fixed by @vidartf.

Plots still recreate more internal state than strictly necessary, but fixing that is only an optimization and somewhat messy to get right.