Skip to content

Support Panel and hvPlot widgets - #253

Merged
cpsievert merged 6 commits into
feat/bokeh-extension-assetsfrom
bokeh-extensions
Oct 20, 2026
Merged

cpsievert merged 6 commits into
feat/bokeh-extension-assetsfrom
bokeh-extensions

Conversation

@cpsievert

@cpsievert cpsievert commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Panel widgets and layouts, plus HoloViews/hvPlot objects, can render directly in Shiny with @render_panel, @render_hvplot, or @render_widget. Core and Express apps load the required Bokeh and extension assets automatically through #255 and #256.

Closes #82 and #87. Stacked on #256 (which stacks on #255).

Panel creates the Bokeh root through pn.panel(...).get_root(). Its model stylesheets use the locally served Panel distribution, including later theme changes and styles inside shadow DOM. Panel-specific bundling also supplies ES modules and required exports for components such as Perspective. Roots are released when the owning widget closes or construction fails, while live owners retain them. Because jupyter_bokeh's BokehModel.close() is not idempotent (a second call raises KeyError, and __del__ closes as well), Bokeh widgets get a close-once guard in this PR.

This approach overlaps #250: it preserves the render_hvplot API and uses Panel for HoloViews coercion. #250 remains open for that review decision.

Validation: make check passes (144 unit tests); the full Chromium suite passes (50 tests). Covers Tabulator data/sorting/rerenders with the Holoviz CDN blocked, Perspective rendering/data, hvPlot, later assets, Core/Express, mounted apps, and Panel root lifetimes. Served JavaScript rebuilt from source.

Panel widget values are not exposed as Shiny inputs. ReactiveESM components have not been validated.

@cpsievert
cpsievert marked this pull request as ready for review October 16, 2026 18:51
@cpsievert
cpsievert changed the base branch from main to feat/widget-lifetimes-03-browser October 16, 2026 21:26
@cpsievert cpsievert changed the title Support bokeh extensions, panel widgets, and hvPlot Support Panel and hvPlot widgets Oct 16, 2026
@cpsievert
cpsievert changed the base branch from feat/widget-lifetimes-03-browser to feat/bokeh-extension-assets October 16, 2026 21:58
@cpsievert
cpsievert added this pull request to stack #265 October 19, 2026 23:33
@cpsievert
cpsievert removed this pull request from stack #265 October 19, 2026 23:38
@cpsievert
cpsievert added this pull request to stack #266 October 19, 2026 23:41
Resolve conflicts between the _bokeh.py consolidation/head_content
refactor and Panel support:

- Panel's bundling path moves into _bokeh.py's bokeh_extension_urls()
  (now returns module info alongside js/css urls).
- ES module assets no longer ride the dependency channel via
  MessageDependency's shinywidgets_module_exports dict. Instead,
  bokeh_extension_assets() returns them as plain data, _shinywidgets
  forwards them on the comm-open message, and the client import()s them
  (assigning default exports to globals) before model construction.
  This keeps imports awaited without a custom HTMLDependency subclass.
- guard_widget_close() moves to _bokeh.py with the other bokeh-specific
  widget logic.
@cpsievert
cpsievert merged commit 4aefc9a into main Oct 20, 2026
5 checks passed
@cpsievert cpsievert mentioned this pull request Oct 20, 2026
cpsievert added a commit that referenced this pull request Oct 20, 2026
Main's #253 added holoviews/hvPlot support via panel (render_hvplot).
This merge keeps that panel-based implementation (hvplot already hard-depends
on panel, and neither path preserves DynamicMap streams), and renames
render_hvplot -> render_holoviews for discoverability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support panel widgets

1 participant