jonaspardon / mermaid-php
Mermaid.js generator for php
Installs: 46 364
Dependents: 1
Suggesters: 0
Security: 0
Stars: 8
Watchers: 1
Forks: 2
Open Issues: 2
Requires
- php: ^8.1
- illuminate/contracts: ^9.0|^10.0|^11.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.8
- larastan/larastan: ^2.0.1
- nunomaduro/collision: ^6.0
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2025-03-27 14:46:43 UTC
README
Generate mermaid.js flowcharts with php.
Installation
You can install the package via composer:
composer require jonaspardon/mermaid-php
Usage
$graph = new Graph(new GraphDirection(GraphDirection::LEFT_TO_RIGHT)); $from = new Node( identifier: 'A', title: 'This package', shape: new NodeShape(NodeShape::ROUND_EDGES), style: new Style( backgroundColor: '#16a085', fontColor: '#ffffff', borderColor: '#333333', ), ); $to = new Node( identifier: 'B', title: 'Your application', shape: new NodeShape(NodeShape::HEXAGON), style: new Style( backgroundColor: '#55efc4', fontColor: '#000', borderColor: '#333333', ), ); $link = new Link($from, $to); $output = $graph->addNode($from) ->addNode($to) ->addLink($link) ->render();
flowchart LR; A("This package"); style A fill:#16a085,stroke:#333333,stroke-width:1px,color:#ffffff; B{{"Your application"}}; style B fill:#55efc4,stroke:#333333,stroke-width:1px,color:#000; A-->B;Loading
flowchart LR;
A("This package");
style A fill:#16a085,stroke:#333333,stroke-width:1px,color:#ffffff;
B{{"Your application"}};
style B fill:#55efc4,stroke:#333333,stroke-width:1px,color:#000;
A-->B;
Testing
composer test
Used by
- Laravel Event Visualizer - a Laravel package to visualize your application's events and handlers
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.