Closed datavectors closed 4 years ago
Hi @datavectors , thanks for the issue :) I published atom-mermaid@v3.5.2 that support to export class diagram as svg. It seems works fine for me, can you try it?
Thank you for responding. I have now looked at /atom-mermaid/package.json and saw that it refers to 3.4.1
"_from": "https://www.atom.io/api/packages/atom-mermaid/versions/3.4.1/tarball", "_id": "atom-mermaid@3.4.1",
I uninstalled and reinstalled atom-mermaid 3.5.2 but the example class diagram still does not render correctly.
The first screenshot below shows the output of atom-mermaid preview (note that I do not apply ```mermaid header).
The second screenshot below shows the output of markdown-preview-enhanced (note that here I apply ```mermaid header)
The third screenshot below shows the preview of same markdown in atom-mermaid.
[P.S.] Latest atom-mermaid/styles/mermaid-variables.less still does not reference class diagrams
===================================================== Rendered by atom-mermaid (no ```mermaid header - is that correct syntax)
===================================================== Rendered by markdown-preview-enhanced (with ```mermaid header)
===================================================== Rendered by atom-mermaid (with ```mermaid header)
Thank you for responding. I tried with same your mermaid text, but can't reproduce the issue. it works fine for me. Hmm...
[P.S.] Latest atom-mermaid/styles/mermaid-variables.less still does not reference class diagrams
I guess there is no problem.
The only point I see is that you use extension .mmd and I use .md but other diagrams work so that cannot be an issue.
To try to debug this at my end, is it possible to insert console log directives into the package to see the expected output or errors in Developer Tools Console?
Further clues: (a) The class diagram does not render correctly in atom-markdown preview window. (b) The class diagram does render correctly in markdown-preview-enhanced preview window (c) The class diagram saves correctly as png file (d) The class diagram does not save correctly as svg file.
The output files are attached. Note that I had to change .svg extension to .txt since svg is not an accepted file type to upload. Change the extension back to *.svg to view in Inkscape. A screenshot of the incorrect svg image (from Inkscape) is attached.
Adding another clue ..
I tested the svg code in an xml editor and I noticed that the xml declaration is missing as top line.
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
I added this declaration line and I was able to view the svg in Brave browser. But not in Inkscape.
It is puzzling.
To try to debug this at my end, is it possible to insert console log directives into the package to see the expected output or errors in Developer Tools Console?
No, maybe you can't get some clue from console log. however there may be some clue from inspecting svg element on devtool.
Is the first attached file that screenshot of (c) ? If so, can you open svg file of (d) in Chrome browser?(without xml declaration)
By the way, do you have any user stylesheet on Atom?
I can open attached classes.md.txt in Chrome browser on my environment.
Since I can work around this issue and render the svg one way or another in browser(s) the only concern now is why it does not render in Inkscape. I hope eventually to edit the svg elements.
It seems a issue of mermaid-js (and livrsvg). Unfortunately atom-mermaid can't support too. sorry. https://github.com/mermaid-js/mermaid/issues/664
Thanks for identifying the root cause. I will use a workaround (browser display of svg) until issue fixed by mermaid. I will now close this issue.
I have Atom 1.48 in Ubuntu 18.04. I have two Atom packages relevant to mermaid .. markdown-preview-enhanced atom-mermaid
I like the atom-mermaid feature to export rendered diagram as svg. However it does not render class diagrams.
Markdown-preview-enhanced does render class diagrams, but does not export as svg.
I looked at atom-mermaid/styles/mermaid-variables.less There are ..
/ Flowchart variables / / Sequence Diagram variables / / Gantt chart variables /
but it stops there. No reference to class diagrams.
Can atom-mermaid be extended to render class diagrams in svg?