Skip to content

Commit

Permalink
Fix name change issue
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 11, 2024
1 parent e7beb49 commit 74ee0b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
16 changes: 11 additions & 5 deletions examples/reference/panes/HoloViews.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"import holoviews as hv\n",
"import panel as pn\n",
"\n",
"hv.extension(\"bokeh\")\n",
"pn.extension('plotly') # We add 'plotly' to be able to use the 'plotly' plot backend"
"hv.extension(\"bokeh\", \"plotly\")"
]
},
{
Expand Down Expand Up @@ -278,8 +277,13 @@
"outputs": [],
"source": [
"plot = df.hvplot.scatter(x=\"group\", y=\"value\", height=300, responsive=True, title=\"Try changing the backend\")\n",
"\n",
"plot_pane = pn.pane.HoloViews(plot, backend='bokeh', sizing_mode=\"stretch_width\", height=300)\n",
"widget = pn.widgets.RadioButtonGroup.from_param(plot_pane.param.backend, button_type=\"primary\", button_style=\"outline\")\n",
"\n",
"widget = pn.widgets.RadioButtonGroup.from_param(\n",
" plot_pane.param.backend, button_type=\"primary\", button_style=\"outline\"\n",
")\n",
"\n",
"pn.Column(widget, plot_pane)"
]
},
Expand Down Expand Up @@ -416,7 +420,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Lets try to change the name of the `FloatSlider`."
"Lets try to modify the `FloatSlider` before we render it:"
]
},
{
Expand All @@ -426,7 +430,9 @@
"outputs": [],
"source": [
"float_slider = hv_panel[1][0]\n",
"float_slider.name=\"Frequency (updated)\"\n",
"\n",
"float_slider.styles = {'border': '2px solid red', 'padding': '10px', 'border-radius': '5px'}\n",
"\n",
"float_slider"
]
},
Expand Down
1 change: 1 addition & 0 deletions panel/pane/holoviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ def widgets_from_dimensions(cls, object, widget_types=None, widgets_type='indivi
**widget_kwargs)
widget = widget_type(**widget_kwargs)
if widget is not None:
widget.param.name.constant = True
widgets.append(widget)
if widgets_type == 'scrubber':
widgets = [Player(length=nframes, width=550)]
Expand Down

0 comments on commit 74ee0b6

Please sign in to comment.