D2 Widget
A Python widget that embeds the D2 diagram language directly into Jupyter and Marimo. It provides live, text-based diagramming with inline previews, so diagrams stay close to the surrounding analysis.
The workflow for creating diagrams in computational notebooks is often a broken experience. It forces a context switch to external tools, reducing a dynamic process of thought and exploration into a static one of importing and managing images. This interruption breaks the very interactive loop that makes notebooks a powerful environment for analysis and documentation.
This widget brings the diagramming process back into the notebook. It integrates the declarative diagram language
The implementation uses
Stack
While the problem is more important than the tools, the tech stack tells a story about the project's architecture and trade-offs. Here's what this project is built on:
Platforms & Runtimes
Frontend & Visualization
External Services
Development Tooling
Manages Python dependencies and virtual environments.
Lints and formats the Python codebase.
Packages the Python widget with integrated JavaScript assets.
Manages JavaScript dependencies and build artifacts.
Bundles the widget frontend for notebook integration.
Formats and lints the JavaScript/TypeScript code.