You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not an expert with javascript. Below is how I did it.
expected output: .svg or .png file that I can show on the response as full path.
Please help. thanks.
You can use the mermaid.cli to create the image serverside, then serve it.
If you don't want to use the cli, look at how it uses a headless browser (puppeteer) to generate the files.
I'm not an expert with javascript. Below is how I did it.
expected output: .svg or .png file that I can show on the response as full path.
Please help. thanks.
const express = require('express');
const mermaidAPI = require('mermaid');
app.get('/chart', (req, res) => {
mermaidAPI.initialize({
startOnLoad: true
})
const graphDefinition = 'graph TB\na-->b'
const cb = function(svgGraph) {
console.log(svgGraph)
}
mermaidAPI.render('id1',graphDefinition,cb)
})
The text was updated successfully, but these errors were encountered: