gotcha

Author Topic: Inkscape doesn't show arrows of mermaid generated svg files  (Read 1943 times)

October 19, 2017, 01:41:06 AM
Read 1943 times

agusmba

  • Sr. Newbie

  • Offline
  • **

  • 2
The mermaid editor generates svg images that can be seen fine in a browser.

See https://mermaidjs.github.io/mermaid-live-editor/#/edit/c2VxdWVuY2VEaWFncmFtIAoKICAgIEEtPj5COiBTYW1wbGUgdGV4dAogICAgTm90ZSBvdmVyIEEsQjogQSBub3Rl for an example.

!mermaid_svg_in_browser.png
*mermaid_svg_in_browser.png
(3.54 kB . 383x257)
(viewed 483 times)


If I open the svg in inkscape, the arrowheads are missing, although they seem to be present in the svg code:

!mermaid_svg_in_inkscape.png
*mermaid_svg_in_inkscape.png
(5.28 kB . 378x263)
(viewed 455 times)


Is the svg using an unsupported feature in inkscape?

Thanks
  • 0.92
  • Windows 7

October 19, 2017, 03:13:05 AM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

Never heard of Mermaid editor.  As far as I can tell, the live part is where you enter code in a box and it produces, afaict, flowcharts and diagrams, and such?  That doesn't look like SVG code, in the box.  But I guess you click the button when you're finished, and it produces SVG code?

I found the Mermaid github account, but...  Oh, I see, it says the code that you input is javascript, and then it outputs SVG.

Can't seem to retrieve the SVG code, from the link you provided.  I click the download button, but nothing happens.  Is the SVG file that you attached the code created by mermaid?

I'm far from an expert in SVG/XML.  But my best guess is the arrowhead which was created in mermaid, does not exist in Inkscape (so it can't display).  Try opening a new blank document in Inkscape, draw a line and apply one of the stock arrowheads.  Then you can compare the codes.

I wonder if the quotes being present in the mermaid code might be part of the problem, since I don't see quotes in the Inkscape-made arrow.  But as I said, I'm far from an expert.

Someone else with more helpful information should be along before too long  :)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

October 19, 2017, 04:39:37 AM
Reply #2

agusmba

  • Sr. Newbie

  • Offline
  • **

  • 2
Thanks for answering!

That's strange, clicking the "Download SVG" button works for me, anyway the svg is the one I attached in the first post.
The arrowhead is in the svg code, there is something weird going on with the styles probably, where inkscape interprets things differently from a browser.

Thanks again!
  • 0.92
  • Windows 7

October 19, 2017, 05:00:29 AM
Reply #3

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Yes, the arrowhead is in the SVG code.  But it names an arrowhead that Inkscape does not have.  At least that's my best guess.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

October 19, 2017, 03:46:29 PM
Reply #4

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
The SVG code uses CSS classes AND also direct styling to assign the arrowheads to the lines. Somehow this appears to confuse Inkscape.

If you remove the corresponding style rules from the style tag in the SVG code, it looks as you expect it.

You may want to report a bug (CSS support is currently being worked on, so this may be fixed while they're at it already):
https://bugs.launchpad.net/inkscape