A comprehensive diagram rendering service supporting Mermaid, PlantUML, and Graphviz diagrams with interactive zoom/pan controls and PNG export
Project description
Diagram Renderer
A comprehensive diagram rendering service supporting Mermaid, PlantUML, and Graphviz diagrams with an interactive web interface:
- Streamlit Dashboard - Interactive web interface for diagram rendering
Features
- Automatic diagram type detection (Mermaid, PlantUML, Graphviz)
- Static Mermaid.js assets (version controlled)
- VizJS for Graphviz/DOT rendering
- PlantUML to DOT conversion and rendering
- Multiple themes for Mermaid diagrams
- Interactive Streamlit dashboard
Installation
uv install
Usage
Examples
The examples/ directory contains two demonstration applications:
Streamlit Dashboard - Interactive web interface:
uv sync --extra dashboard
uv run --extra dashboard python -m streamlit run examples/dashboard.py
Command Line Interface - Batch processing and automation:
# Render diagram from file
uv run python examples/cli.py render diagram.mmd
# Quick inline rendering
uv run python examples/cli.py quick "graph TD; A-->B"
# Show examples and help
uv run python examples/cli.py examples
uv run python examples/cli.py --help
Supported Diagram Types
Mermaid
- Flowcharts, Sequence diagrams, Class diagrams
- State diagrams, ER diagrams, User journey
- Gantt charts, Pie charts, and more
PlantUML
- UML diagrams (Class, Sequence, Use Case, Activity)
- Network diagrams, Mind maps
- Gantt charts, Work breakdown structure
Graphviz
- DOT language diagrams
- Directed and undirected graphs
- Network diagrams, organizational charts
Configuration
Mermaid Themes
default- Default themebase- Base themedark- Dark themeforest- Forest themeneutral- Neutral theme
Development
The main components are:
diagram/- Core diagram rendering logic and renderersst_diagram.py- Streamlit diagram component wrapperexamples/cli.py- Command-line interface and dashboard launcherexamples/dashboard.py- Streamlit web interfacediagram/renderers/static/js/- Static JavaScript assets (Mermaid.js, VizJS)
Examples
Mermaid Flowchart
flowchart TD
A[Start] --> B{Decision}
B -->|Yes| C[Process A]
B -->|No| D[Process B]
C --> E[End]
D --> E
PlantUML Class Diagram
@startuml
class Animal {
+String name
+int age
+makeSound()
}
class Dog {
+String breed
+bark()
}
Animal <|-- Dog
@enduml
Graphviz DOT Diagram
digraph G {
A -> B;
B -> C;
C -> A;
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file diagram_renderer-0.1.0.tar.gz.
File metadata
- Download URL: diagram_renderer-0.1.0.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69ce8d03e1b0ab3ab56ee76627bdf45705f666c102eda60c8e5ea6a6c5cbabaf
|
|
| MD5 |
894c2af2add5adc538620bba28799773
|
|
| BLAKE2b-256 |
d55f98779309fa3d7235346923216ec519e551a8124a722f98e9ce03c5798091
|
File details
Details for the file diagram_renderer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: diagram_renderer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64b8a5f8dbf2c5f67e99178bf6b9b3c2a1a9cb8bde6e35f5f718c95f7f6b6940
|
|
| MD5 |
1b21992d5524ae3ea8b3305d4a780d82
|
|
| BLAKE2b-256 |
bc4c1cdb8012dbb33bd8fb5b8e04c225216dac3c9b84ddda77415a0eb756f8ad
|