PHPackages                             jonaspardon/mermaid-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jonaspardon/mermaid-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jonaspardon/mermaid-php
=======================

Mermaid.js generator for php

v1.0.1(2y ago)850.4k↑250%3[1 PRs](https://github.com/JonasPardon/mermaid-php/pulls)1MITPHPPHP ^8.1CI passing

Since May 12Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/JonasPardon/mermaid-php)[ Packagist](https://packagist.org/packages/jonaspardon/mermaid-php)[ Docs](https://github.com/jonaspardon/mermaid-php)[ RSS](/packages/jonaspardon-mermaid-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (13)Versions (6)Used By (1)

Mermaid.js generator for php
============================

[](#mermaidjs-generator-for-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/46d7b5742df590e58f6197de2cc19f2636fc6ebaf6bf7730172a620b53878814/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f6e6173706172646f6e2f6d65726d6169642d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jonaspardon/mermaid-php)[![GitHub Tests Action Status](https://camo.githubusercontent.com/80f09e70efb7b3487b38ab55bba3c583671258b200011cbd27956efb9b2f1098/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6a6f6e6173706172646f6e2f6d65726d6169642d7068702f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/jonaspardon/mermaid-php/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/248f5a834f488e24423808bca4450fcc352ec8e6ee29f6f95aeae3d2fa20b6ca/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6a6f6e6173706172646f6e2f6d65726d6169642d7068702f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/jonaspardon/mermaid-php/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/c5bdd7dc10cbe854bf040b5122c4868d3558e8dd658f81c07c02c7e4561bcaf4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f6e6173706172646f6e2f6d65726d6169642d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jonaspardon/mermaid-php)

Generate mermaid.js flowcharts with php.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require jonaspardon/mermaid-php
```

Usage
-----

[](#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
-------

[](#testing)

```
composer test
```

Used by
-------

[](#used-by)

- [Laravel Event Visualizer](https://github.com/JonasPardon/laravel-event-visualizer) - a Laravel package to visualize your application's events and handlers

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Jonas Pardon](https://github.com/JonasPardon)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance59

Moderate activity, may be stable

Popularity33

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 55% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~232 days

Total

4

Last Release

770d ago

Major Versions

v0.2.0-alpha → v1.0.02023-06-20

PHP version history (2 changes)v0.1.0-alphaPHP ^8.0

v0.2.0-alphaPHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/a9c9246ec4ca57b46a685c7e0bb2ab852827e2b204685982d4f77342e46bdaaf?d=identicon)[JonasPardon](/maintainers/JonasPardon)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (22 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (12 commits)")[![JonasPardon](https://avatars.githubusercontent.com/u/10206461?v=4)](https://github.com/JonasPardon "JonasPardon (4 commits)")[![pieterclaerhout](https://avatars.githubusercontent.com/u/74731?v=4)](https://github.com/pieterclaerhout "pieterclaerhout (2 commits)")

---

Tags

flowchartsmermaidmermaidjsphplaravelJonasPardonmermaid-php

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/jonaspardon-mermaid-php/health.svg)

```
[![Health](https://phpackages.com/badges/jonaspardon-mermaid-php/health.svg)](https://phpackages.com/packages/jonaspardon-mermaid-php)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
