Panel to HoloViews (Javascript)

Interacting between Panel widgets and HoloViews objects using Javascript.

Pros:

  • No server necessary

  • Interactivity retained after saving to HTML

Cons:

  • File size may become large

References:

Float slider for glyph fill alpha

This same concept can be applied for any styling including, but not limited to, size, fill_color, fill_alpha, line_width, etc.

[1]:
import holoviews as hv
import panel as pn

hv.extension("bokeh")
pn.extension()

x = [0, 1, 2]
y = [3, 4, 5]

widget = pn.widgets.FloatSlider(value=1, step=0.01)
plot = hv.Points((x, y)).opts(size=10)

link = widget.jslink(plot, value='glyph.fill_alpha')

pn.Column(widget, plot)