-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
render to png from the cli does not display the marker-end arrow heads #181
Comments
Computing the display size seems to cause the svg rendering to complete bofore saving the image. Referencing issue mermaid-js#181 mermaid-js#181
well at this point I have it rendering properly by resizing the viewport |
I tested your pull request and this last example renders with arrows for me. Is this still an issue? |
I notice that this fix causes problems for the sequence diagrams. The lines actor lines go below the bottom actors. And I also notice that the arrow problem seems to be affecting the signals in the sequence diagram as well. Is this a syncronisation issue? I could make a callback form mermaid that is called after rendering are completed. |
Thanks for checking on this. To your first question, yes it is working after these changes. I hadn't tried sequence diagrams but I will do that today. |
That sounds great! I appreciate your effort! |
I think the sequence diagrams don't need the 1.5 scale factor because they render the correct size without it. I will see if I can find out why that is happening. Also, I am not up to speed on mermaid itself so I'm not sure if there are some other config options that should be used. |
I don't think a callback would help since I tried even waiting 10 seconds before rendering the png and had the same resulcs. I believe the issue with this is that there is no event or guarantee that the UI will be repainted before you render the png image. If there is such a way to force repaint it might help and resizing the viewport seems to do that. |
I draw the lines first to get them drawn in the bottom layer. At that time I do not know the height of the diagram so they are drawn quite tall. Then I instead I use the viewpoint to "crop" the rest. Perhaps one could save is ids of the actors and later go back and adjust the height of the lines after rendering. |
That looks great! I'm excited to try out the sequence diagrams now. |
Hi, With the file test having:
rendering as: after issuing:
Any ideas? Thanks in advance |
I've tested even with latest commit: 3ec7c6d. Seq diagram is rendered well but not the flowchart. |
@sebelk same question, no arrow, osx 10.10, mermaid 0.5.1 |
I ran into a similar problem, when used in Chrome 45, Mac OS X 10.11, mermaid 0.5.3 (the latest version currently in bower), no arrow is rendered, for both mermaid.css and mermaid.forest.css. I found the svg has path like below:
But it works if I manually modify the SVG path to be (I removed the marker-end url prefix and left only anchor):
Any idea? Thanks. |
Interesting. I have not seen that in my tests. In what context are you running this? The url that you remove, does that not match the page? I added the http://myhost/mypage to the marker end to enable the arrow heads for sites using a base tag. Are you using a base tag or can you think of anything else that would help me to reproduce this? I could alway add a config option to enable/disable the link to the marked but would prefer to understand the root cause. |
I used mermaid in one of our web application, and I used requirejs to load mermaid, and this web application does not use HTML base tag. I tried to remove the prefix in marker-end url because I saw the marker-end usage in this page (http://knsv.github.io/mermaid/sequenceDiagram.html) and the usage there does not have the http url path prefix in it. I don't know what could be the cause yet, but in the same browser (Chrome 45 in Mac OS X 10.11), I can see the arrow in this page http://knsv.github.io/mermaid, where the marker-end has this http url path prefix in it. And I can use Firefox 41.0.1 to reproduce this issue in the same web application, and it will work once I remove the marker-end prefix from the SVG path using the Chrome/Firefox developer tools. As you can see in the screenshot, the first arrow is the one rendered, and the second one is the one I removed the marker-end prefix manually using developer tools. |
After some investigation, I think I can reproduce this issue easily now. You can try this "http://knsv.github.io/mermaid/?q=test". The arrows in the page will not be shown for my Chrome 45, and the cause is the additional query parameter at the end of the URL, and in my case, I use mermaid in a web page having query parameter in the URL too. Compared to the originally reported issue, this could be a separated issue because the original issue uses it in CLI which may not have such a query parameter problem. |
Yes lets do that. A seperate issue would make it easier to keep track of.
|
#225 was filed. |
Great, thanks!
|
Try the new CLI: https://github.com/mermaidjs/mermaid.cli |
…yarn/develop/eslint-plugin-tailwindcss-1.9.1 Bump eslint-plugin-tailwindcss from 1.8.0 to 1.9.1
When running the cli to save a diagram as a png the marker-end arrow heads do not show. Using the following example diagram from the site:
posting a pull request for a solution to this one shortly
The text was updated successfully, but these errors were encountered: