holoviz / holoviews

With Holoviews, your data visualizes itself.
https://holoviews.org
BSD 3-Clause "New" or "Revised" License
2.71k stars 404 forks source link

Restoring option state on DynamicMaps #813

Open jlstevens opened 8 years ago

jlstevens commented 8 years ago

This issue is in two parts, one requiring an easy fix and a second part that is more involved.

  1. When an exception occurs, the display hooks attempt to restore the option state using StoreOptions.state(element, state=optstate). When a DynamicMap is involved, this fails with StopIteration. This exception should be caught and silenced as StopIteration indicates there are no elements to traverse and therefore nothing to restore state on.
  2. Actually restoring the option state on DynamicMaps properly. DynamicMap requires special handling as the option state is held on the container and dynamically propagated to the elements as they are generated. StoreOptions.state therefore needs to be DynamicMap aware to handle this restoration properly.
jlstevens commented 8 years ago

The above PR (#848) addresses part 1. though not in the way I thought it would. Catching StopIteration wouldn't be a good solution as it would mean that the style restoration would stop as soon as it encountered a DynamicMap.

Part 2. above will need to be addressed in a separate PR.

philippjfr commented 7 years ago

Will you tackle this for 1.7? Otherwise please postpone to 1.8.

jlstevens commented 7 years ago

That depends on when 1.7 is ready: as soon as we have proper integration with Bokeh events, I feel we should release. This particular issue shouldn't block 1.7 but I would like to tackle it before then if I have time.

philippjfr commented 7 years ago

Doesn't seem likely this will happen, and there's higher priority issues.

philippjfr commented 4 years ago

@jlstevens Is this still needed? I don't quite remember if this is specific to the magics or not.