Hi all, I’d like to propose adding anywidget support for notebook workflows (Jupyter/marimo), with an API like:
w = d3arg.to_anywidget()
w
Why
- Better notebook-native embedding than side-effect display(...) flows
- Works well in modern notebook apps (including marimo)
- Cleaner composition with other widget-based UIs
Proposal
- Add D3ARG.to_anywidget(...) that returns an anywidget.AnyWidget
- Reuse existing visualizer.js + visualizer.css rendering logic
- Use iframe srcdoc for isolation and compatibility
Notes from prototyping
- iframe/body sizing and overflow need small CSS guards to avoid duplicate-looking scrollbars
- anywidget implies Python >=3.8 compatibility (metadata should match)
Questions for maintainers
- Does this API shape (to_anywidget) look acceptable for upstream?
- Should anywidget be a hard dependency, or optional extra (e.g. [widgets])?
- Any preference on implementation style:
- wrapper around existing render pipeline (minimal change), or
- deeper renderer refactor for shared frontend entrypoints?
I have created a PR for this feature. Let me know what you think. #244

Hi all, I’d like to propose adding anywidget support for notebook workflows (Jupyter/marimo), with an API like:
w = d3arg.to_anywidget()
w
Why
Proposal
Notes from prototyping
Questions for maintainers
I have created a PR for this feature. Let me know what you think. #244