Skip to content

Support live data, list and HTML widget viewers in webR Interactive - #2008

Open
renkun-ken wants to merge 6 commits into
codex/interactive-lsp-follows-sessionfrom
codex/webr-interactive-rich-viewers
Open

renkun-ken wants to merge 6 commits into
codex/interactive-lsp-follows-sessionfrom
codex/webr-interactive-rich-viewers

Conversation

@renkun-ken

Copy link
Copy Markdown
Member

Summary

Bring the native R Interactive data and list previews to webR. Both View(mtcars) and a bare mtcars produce an inline table with row names, sorting, paging and a full Data viewer. Nested lists can be expanded or opened in the List viewer, including opening a data frame held inside a list. Each live action is scoped to a retained object in its originating session.

A visible HTML widget such as ggplotly(p) now renders its HTML and JavaScript dependencies in the notebook. The desktop agent retains the bundle as an ordinary protected HTML asset. The browser frontend renders the widget in an isolated iframe. Widget, table and console messages keep their evaluation order, including before an input prompt. Static graphics continue to use PNG.

The two hosts share the table/list helpers from the bundled sess source. The extension includes a small, reproducible copy of the pinned jsonlite Wasm namespace, so opening a viewer does not require a package download or change the user's library paths.

Verification

  • Ran View(mtcars), View(lst), and the bare table/list expressions in a fresh desktop agent. Verified row names, sorted pages, the final row, nested list data and opening the nested data frame in a separate viewer.
  • Ran the 1977 Gapminder pipeline with ggplot2, plotly and gapminder. In a desktop notebook the chart rendered 142 points in five traces. Hover displayed point data and Zoom in changed the axis range.
  • Exercised table paging, list expansion, opening viewer panels and genuine Plotly controls in Chromium running VS Code for the Web. The public vscode.dev development test also returned the expected output bundles; full UI interaction was verified in Microsoft's locally hosted browser workbench.
  • Added regressions for sandboxed asset handling, size limits, ordering with an input prompt, and existing native viewer behavior.

Stacked on #2007. Related to #2003.

This branch has not been deployed

No deployments
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.

1 participant