Graphviz diagram
Example taken here β
About
Graphviz β is open-source graph visualization software. On one hand, it is a general diagramming tool, so it doesnβt have a DSL to directly express specific diagrams (letβs say a Hasse diagram or an ER diagram). On the other hand, if you donβt have a better solution, you can always bend Graphviz to create the desired diagram (though it can be tedious sometimes).
Installation
-
Install dependencies
-
Configure Astro. See note about Rehype Plugins for Code.
-
Optional install dependency for cache
-
Optional configure cache
-
Optional add pan and zoom for diagrams
Tips
Dark mode
Basic dark mode can be implemented with:
Plus, you can pass class
β to edges and nodes to implement advanced dark mode.
To remove background
To remove the background, use bgcolor="transparent"
.
Example
Compare it to similar example in Mermaid.
TODO
- Highlighting of nodes or edges
- Search/filter by labels
See for inspiration:
Alternatively, I can parse DOT language and use different renderers, for example:
- Parsers
- Renderers
- Graphviz JSON β to render coordinates
- vizdom β
- Apache ECharts β supports βhydrationβ of SVGs
- Others β