Skip to main content

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 theme
  • base - Base theme
  • dark - Dark theme
  • forest - Forest theme
  • neutral - Neutral theme

Development

The main components are:

  • diagram/ - Core diagram rendering logic and renderers
  • st_diagram.py - Streamlit diagram component wrapper
  • examples/cli.py - Command-line interface and dashboard launcher
  • examples/dashboard.py - Streamlit web interface
  • diagram/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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diagram_renderer-0.1.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diagram_renderer-0.1.0-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

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

Hashes for diagram_renderer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 69ce8d03e1b0ab3ab56ee76627bdf45705f666c102eda60c8e5ea6a6c5cbabaf
MD5 894c2af2add5adc538620bba28799773
BLAKE2b-256 d55f98779309fa3d7235346923216ec519e551a8124a722f98e9ce03c5798091

See more details on using hashes here.

File details

Details for the file diagram_renderer-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for diagram_renderer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64b8a5f8dbf2c5f67e99178bf6b9b3c2a1a9cb8bde6e35f5f718c95f7f6b6940
MD5 1b21992d5524ae3ea8b3305d4a780d82
BLAKE2b-256 bc4c1cdb8012dbb33bd8fb5b8e04c225216dac3c9b84ddda77415a0eb756f8ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page