A Python package for generating mermaid diagrams in InstaUI.
Project description
instaui-mermaid
English| 简体中文
📖 Introduction
instaui-mermaid is a Python package for generating mermaid diagrams in InstaUI. It is a part of the InstaUI project, which is a Python-based UI library for rapidly building user interfaces.
🚀Installation
pip install instaui-mermaid instaui[web]
uv add instaui-mermaid instaui[web]
📚Usage
from instaui_mermaid import Mermaid
from instaui import ui
@ui.page("/")
def index():
graph = r"""
graph TD
a --> b
"""
# ui
Mermaid(graph)
ui.server(debug=True).run()
Dynamic graph:
from instaui_mermaid import Mermaid
from instaui import ui, html
@ui.page("/")
def index():
themes = ["default", "neutral", "dark", "forest", "base"]
theme = ui.state(themes[0])
graph = ui.str_format(
r"""
---
config:
theme: {theme}
---
graph TD
a --> b
""",
theme=theme,
)
# ui
html.select.from_list(themes, value = theme)
Mermaid(graph)
ui.server(debug=True).run()
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
instaui_mermaid-0.2.0.tar.gz
(795.3 kB
view details)
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 instaui_mermaid-0.2.0.tar.gz.
File metadata
- Download URL: instaui_mermaid-0.2.0.tar.gz
- Upload date:
- Size: 795.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b647079771609aaf8e24b7b67a6b954614546b7fd6f25e824d067a1694384b87
|
|
| MD5 |
af1c600b0dd6e51f2b46eff9eb66226d
|
|
| BLAKE2b-256 |
d60aac684b807a0579ee7c913e82f7c8202f9e895836c4ada4e34b7bbb1606fd
|
File details
Details for the file instaui_mermaid-0.2.0-py3-none-any.whl.
File metadata
- Download URL: instaui_mermaid-0.2.0-py3-none-any.whl
- Upload date:
- Size: 832.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bb411316d4d767db5a2fd064d859958f51d5a5501a6142410076a6f84ffec13
|
|
| MD5 |
9d0fa42a2d7c78393d44106aaee7eae7
|
|
| BLAKE2b-256 |
26201f6a8a739566536ed4332d652e5c9c63db498a45aea4dddc01c404f1c2f9
|