-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
SVG Output from GraphViz cropped / Image Size Problem with pandoc-plot and Graphviz in SVG #40
Comments
Thanks Martin, we'll leave this issue up for a few weeks |
Hi Laurent, a quick update:
When I try to render the attached test document When I render the same figure from the attached file
the size data is correct. Directly from Graphviz:
From
Maybe you are passing additional parameter to the |
It could be that passing a DPI value for a vector output confuses Graphviz, see here. But this is just a wild guess. Scale or size directives when invoking the Edit: Some chance that it is indeed caused by passing a |
My best guess is that omitting
|
Okay, so I think I now know
You have to set the
or for an individual figure:
But it would ideal for |
Thank you Martin for your thorough investigation. I've pushed a fix which omits the |
Release 1.5.4 is now available via conda. Please give it a try at your earliest convenience |
I'll close this for now. but don't hesitate to reopen if the problem persists. |
Thanks - sorry for my late reply; I can confirm that this fixed the issue! |
Hi all,
in case others are facing a similar issue: When using SVG as the output format for GraphViz figures, the output in both HTML and LaTeX is often cropped. One can avoid this by either using PDF or PNG as target formats, but both are sub-optimal of course. Another alternative is using a wider
margin
parameter in the DOT code (but also not nice),Now, I think I found the core issue for this:
The resulting SVG markup contains
viewBox
values that are smaller than the actualwidth
andheight
attributes, like soIf you manually set them equal to the width and height, like so
viewBox="0.00 0.00 360.00 137.00"
the issue is resolved, but that will of course be lost the next time you update the graph source-code.
The core issue seems to be a rounding bug in GraphViz, as described here:
https://gitlab.com/graphviz/graphviz/-/issues/1855
Updating GraphViz to version 3.0.0 (available since about a week) might fix this; at least that is what they say in the referenced issue. I could not yet try this due to version conflicts.
But the issue seems to be unrelated to
pandoc-plot
.So no action needed; just in case others are facing the same issue and can benefit from my analysis.
The text was updated successfully, but these errors were encountered: