Mermaid asset bundle for Yii 2.0 Framework.
composer require dmstr/yii2-mermaid-assetThis package requires the mermaid npm package. The npm asset must be installed manually or via foxy.
Manual installation:
npm install mermaid@^11.0.0Via foxy: The package.json in this package defines the required npm dependency and will be automatically installed when using foxy.
The asset bundle expects mermaid to be available at @npm/mermaid/dist/. Make sure the @npm alias points to your node_modules directory:
Yii::setAlias('@npm', '@app/node_modules');Register the asset bundle in your view:
\dmstr\web\MermaidAsset::register($this);Then initialize mermaid in your JavaScript:
mermaid.initialize({startOnLoad: true});