top | item 36851767

(no title)

aloisklink | 2 years ago

I'm one of the maintainers of the mermaid-cli project, and unfortunately, no.

Mermaid needs a browser's layout engine to run properly [1], but I haven't yet seen a library that will help us without puppeteer.

And yep, NPM (or another Node.JS package manager) is still needed for installation. I was working on trying to bundle all of mermaid-cli's dependencies (aka Node.JS, puppeteer) into one massive single-file exe last weekend, but it's seems we're blocked by missing features in other packages [2].

If anyone has any ideas on how to implement these things easily, feel free to help-out :) I'm also not a big fan of puppeteer, so I'd love to see a way to go without it.

[1]: https://github.com/mermaid-js/mermaid/issues/3650

[2]: https://github.com/mermaid-js/mermaid-cli/issues/467#issueco...

discuss

order

andrewshadura|2 years ago

Why is it so difficult to do the layout yourself and generate SVG directly?

ygra|2 years ago

My guess would be that text layout and measuring is something that's very easy to offload to the browser, yet, if you want to do this without, you're pulling in a whole lot of other dependencies (text rendering is quite complex) that you maybe cannot reasonably call from JS.