Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using mermaid.js from node.js without headless web browser? #3886

Closed
ds2345 opened this issue Dec 3, 2022 · 2 comments
Closed

using mermaid.js from node.js without headless web browser? #3886

ds2345 opened this issue Dec 3, 2022 · 2 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@ds2345
Copy link

ds2345 commented Dec 3, 2022

Proposal

is there a way to render mermaid.js diagrams to svg from node.js (server) app
without starting "headless" web browser via mermaid cli as it was suggested in some comments?

if not, what would be required to add or change in the system to enable such rendering?

thank you

Example

No response

Screenshots

No response

@ds2345 ds2345 added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Dec 3, 2022
@aloisklink
Copy link
Member

aloisklink commented Dec 7, 2022

It's not currently possible unfortunately, since Mermaid relies on the browser's layout engine to correctly size/place items. As far as I'm aware, this isn't possible with jsdom (what most people use for server-side rendering).

It might be possible with the svgdom library, though, but nobody has yet tried it out.

Contributions are welcome though (although please add any comments to issue #3650)!

This is a pretty heavily requested feature, so it would be amazing if we could get proper server-side rendering working.

Duplicate of #3650 Edit: Looks like GitHub needs to have a separate comment for it to automatically add "duplicate of ..." text.

@aloisklink aloisklink closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2022
@aloisklink
Copy link
Member

Duplicate of #3650

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants