- Clone this repository:
git clone lukasss93/saas-mermaid
- Install dependencies:
npm install
- Run the server:
npm start
docker run -p 8087:8087 lukasss93/saas-mermaid
Send a or request to http://localhost:8087/render
endpoint.
To send your chart text use:
To remove the background use:
background=transparent
query string parameter. Optional. Default iswhite
To change the format append .<format>
to the end of the url where <format>
is one of the following:
svg
png
jpg
Optional. Default is svg
The response will be a png, jpg, svg image.
You can use the X-Hash header to:
- check if the image is up to date
- get the image from the cache with route:
http://localhost:8087/cached/<X-Hash>
You can get the image width and height with the X-Width and X-Height headers.
http://localhost:8087/render?text=graph%20TD;A-->B;B-->C;C-->A
http://localhost:8087/render?text=graph%20TD;A-->B;B-->C;C-->A&background=false
http://localhost:8087/render.svg?text=graph%20TD;A-->B;B-->C;C-->A
http://localhost:8087/render.svg?text=graph%20TD;A-->B;B-->C;C-->A&background=false
http://localhost:8087/render.png?text=graph%20TD;A-->B;B-->C;C-->A
http://localhost:8087/render.png?text=graph%20TD;A-->B;B-->C;C-->A&background=false
http://localhost:8087/render.jpg?text=graph%20TD;A-->B;B-->C;C-->A
Font Awesome icons are not supported at the moment.
The chart text must be a valid Mermaid diagram.
More info here: https://mermaid-js.github.io/mermaid/
Please see the CHANGELOG.md for more information on what has changed recently.
Please see the LICENSE.md file for more information.