dmstr / yii2-mermaid-asset
Mermaid asset bundle for Yii 2.0 Framework
Installs: 50 674
Dependents: 0
Suggesters: 2
Security: 0
Stars: 1
Watchers: 5
Forks: 0
Open Issues: 0
pkg:composer/dmstr/yii2-mermaid-asset
Requires
- yiisoft/yii2: ^2.0
This package is auto-updated.
Last update: 2025-12-16 14:22:12 UTC
README
Mermaid asset bundle for Yii 2.0 Framework.
Installation
composer require dmstr/yii2-mermaid-asset
NPM Asset Installation
This package requires the mermaid npm package. The npm asset must be installed manually or via foxy.
Manual installation:
npm install mermaid@^11.0.0
Via foxy: The package.json in this package defines the required npm dependency and will be automatically installed when using foxy.
Configuration
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');
Usage
Register the asset bundle in your view:
\dmstr\web\MermaidAsset::register($this);
Then initialize mermaid in your JavaScript:
mermaid.initialize({startOnLoad: true});