https://github.com/dantleech/php-diagram
https://github.com/dantleech/php-diagram
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/dantleech/php-diagram
- Owner: dantleech
- License: mit
- Created: 2020-09-02T21:16:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-03T23:22:21.000Z (almost 6 years ago)
- Last Synced: 2025-01-30T15:44:25.707Z (over 1 year ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PHP Diagrams
============
[](https://travis-ci.org/dantleech/php-diagrams)
Library to generate flow chart diagrams from a [Mermaid
DSL](https://mermaid-js.github.io/mermaid/#/flowchart) inspired DSL.
Disclaimer
----------
This is a quick proof of concept.
Usage
-----
Given `example/mermaid.mm`:
```
graph TD
A[Christmas] -->|Get money| B[Go shopping]
B --> C{Let me think}
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[Car]
```
Run:
```bash
$ diagram generate example/mermaid.mm out.png
```
To generate:

Supported Markup
----------------
All graphs must start with `graph TD` (`TD` is the orientation, but only one
orientation is supported)
Standard nodes
```
foobar --> barfoo
```
Rectangle with text
```
foobar[This is Foobar] --> barfoo
```
Rhombus with text
```
foobar{This is Foobar} --> barfoo
```
Label for edge:
```
foobar{This is Foobar} -->|and it goes to| barfoo[Barfoo]
```