Open MarcSkovMadsen opened 11 months ago
The problem here is that an IPywidget with a value
traitlet is itself a valid reference and would be resolved. What is needed is finer grained control at the param level as to what kind of references should be allowed.
@ahuang11 I don't know if something you could address, but I know the Pangeo community would love to have lonboard be dynamic and performant in Panel!
From https://github.com/developmentseed/lonboard/issues/262#issuecomment-1826859977
When you select a new colormap, alpha, anything... the map element fully reloads... that's pretty bad. In particular, that seems really bad because all the map data will be re-parsed and re-rendered from scratch (and maybe even re-downloaded?). lonboard's architecture assumes that you have a stateful jupyter widget on the JS side, and so changing a colormap or the alpha should not create a new map.
That seems like incorrect usage of Panel and lonboard more than an issue with either library. I'm out for the next few days but can try to build a new example.
Reactive updates like we support for Panel cannot be supported in ipywidgets unless we somehow upstream support for that, so writing callback based code is the only approach that will work.
@philippjfr a new example from a GURU would be great! 😸
Just read the original request here again, even if we did support the original request that wouldn't result in efficient updates so I almost think we shouldn't support dynamic references so folks don't attempt this approach and then complain that Panel is inefficient.
I would like to demonstrate that Panel works with AnyWidget and now lonboard. I would like to show the integration via
pn.bind
.But it seems I cannot use a bound function with
pn.pane.IpyWidgets
because theobject
ofpn.pane.IpyWidget
hasallow_refs=False
. Other panes have this setting toTrue
. Why not IpyWidgets?`Works - but not dynamic
Does not work
If I change line 41 to a bound function it does not work.