Inkscape Community

Help Using Inkscape => Using Inkscape with Other Apps => Topic started by: agusmba on October 19, 2017, 01:41:06 AM

Title: Inkscape doesn't show arrows of mermaid generated svg files
Post by: agusmba on October 19, 2017, 01:41:06 AM
The mermaid editor generates svg images that can be seen fine in a browser.

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

! [ You are not allowed to view attachments ]

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

! [ You are not allowed to view attachments ]

Is the svg using an unsupported feature in inkscape?

Thanks
Title: Re: Inkscape doesn't show arrows of mermaid generated svg files
Post by: brynn on October 19, 2017, 03:13:05 AM
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  :)
Title: Re: Inkscape doesn't show arrows of mermaid generated svg files
Post by: agusmba on October 19, 2017, 04:39:37 AM
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!
Title: Re: Inkscape doesn't show arrows of mermaid generated svg files
Post by: brynn on October 19, 2017, 05:00:29 AM
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.
Title: Re: Inkscape doesn't show arrows of mermaid generated svg files
Post by: Moini on October 19, 2017, 03:46:29 PM
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