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

Suggestion: Save As Svg/Png #5

Open
clairernovotny opened this issue Aug 4, 2016 · 9 comments
Open

Suggestion: Save As Svg/Png #5

clairernovotny opened this issue Aug 4, 2016 · 9 comments

Comments

@clairernovotny
Copy link

Would be really awesome to be able to export a diagram from the preview window as either an SVG or PNG. Both are supported by Mermaid directly.

One request -- possibly a different stylesheet to use for this as I wouldn't want the export to use the dark theme I use in Code.

@vstirbu
Copy link
Collaborator

vstirbu commented Sep 4, 2016

This would be nice although the end result is not really usable till the missing arrow heads issue (#2) is fixed.

@vstirbu
Copy link
Collaborator

vstirbu commented Sep 14, 2016

Export to SVG and PNG is a feature of mermaid cli that requires PhantomJS. I found this dependency quite invasive.

I would be interested in alternatives before moving forward.

@g3o2
Copy link

g3o2 commented Nov 26, 2016

Hmmm, how do you currently draw the diagrams in vscode ? in svg ?

@vstirbu
Copy link
Collaborator

vstirbu commented Nov 26, 2016

They are rendered as SVG.

@g3o2
Copy link

g3o2 commented Nov 26, 2016

So there is certainly a way to expose the svg code, isn't there ?

Converting svg to png is indeed better left to specialised tools or packages. SVG Viewer is one such package in vscode. There are many other ways. However, being able to export the svg as such would be useful.

@vstirbu
Copy link
Collaborator

vstirbu commented Nov 26, 2016

This plugin renders the mermaid diagram using a vscode component that is meant for previewing HTML that is not too heavy. There is no default channel back from the preview diagram to the plugin code, so getting the svg in the plugin, although doable, requires a bit of work.

@joeto0
Copy link

joeto0 commented Nov 4, 2017

Any plans to implement this feature?

@vstirbu vstirbu pinned this issue Apr 11, 2019
@vstirbu vstirbu unpinned this issue Apr 14, 2021
@doodoori2
Copy link

hmm... is there anyone can explain how to expose it with SVG code?
I can't find any menu for export. 😮

@lmathews19
Copy link

jebbs' PlantUML extension has a nifty implementation of export diagram - it supports export to png, svg, pdf.

Export Diagrams

  • At cursor, in current file, in whole workspace, in workspace selected.
  • Concurrent export.
  • Generate URLs.
  • Multi-Page Diagram support.
  • From local or server.
  • Image map (cmapx) support.

They also seem to have a dependency on JRE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants