vitepress-plugin-viz
v1.0.0
Published
Add Graphviz support for VitePress using @viz-js/viz
Maintainers
Readme
vitepress-plugin-viz
Add Graphviz support for VitePress using @viz-js/viz.
Features
- 📊 Graphviz Support: Create diagrams using DOT language.
- ⚡️ WebAssembly Powered: Fast rendering using the latest viz.js implementation.
- 🛠 Zero Config: Automatic component registration and easy setup.
- 📦 Lightweight: Minimal dependencies, just works.
Install
# npm
npm i vitepress-plugin-viz @viz-js/viz -D
# pnpm
pnpm add -D vitepress-plugin-viz @viz-js/viz
# yarn
yarn add -D vitepress-plugin-viz @viz-js/vizSetup
Add the wrapper in your VitePress config:
// .vitepress/config.ts
import { defineConfig } from 'vitepress'
import { withViz } from 'vitepress-plugin-viz'
export default withViz(defineConfig({
// your existing vitepress config...
}))Usage
Use the viz language block in your markdown files:
```viz
digraph G {
a -> b [label="a to b"];
b -> c [label="another label"];
}
```This will be rendered as an SVG diagram.
Configuration
You can pass options to the plugin via vizPlugin in your VitePress config:
export default withViz(defineConfig({
// ...
vizPlugin: {
// Add custom class to the container div
class: "my-custom-viz-class",
},
}))License
MIT © 2026-present Elecmonkey
Acknowledgments
- vitepress-plugin-mermaid - This plugin references its implementation ideas and architecture.
- emersonbottero - Author of vitepress-plugin-mermaid
