3 ms·
Semi-related question: does mermaid-cli still bring along chromium to 'render' images?
by w4rh4wk5 5y ago
Semi-related question: does mermaid-cli still bring along chromium to 'render' images?
- donio 5y agoI just tried to install it and yes, it looks like mmdc still requires puppeteer and chromium. Which seems a bit ridiculous for a CLI tool.
- schemescape 5y agoYes, it uses browser APIs (e.g. SVGGraphicsElement.getBBox()) to measure text, compute transformations, etc. I had hoped to use Mermaid in a static site generator to create SVG diagrams at build time (to avoid requiring JavaScript), and this dependency was irritating enough that I abandoned Mermaid entirely and instead compiled Graphviz to WebAssembly (and honestly I prefer Graphviz's syntax, although it doesn't support nearly as many diagram types as Mermaid).
- w4rh4wk5 5y agoYeah, I was wanted to use the Git graph feature to create some nice diagrams. I expected the cli to work just like graphviz. Yet I was greeted by a stacktrace from Chromium since it did not work in WSL. The whole idea of depending on a full blown Chromium for your cli tool just to convert that mermaid description into an SVG or PNG seems bad to me. It was my personal turning point where I stopped using JavaScript based tools in my toolbox.