-
Notifications
You must be signed in to change notification settings - Fork 229
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
[bug] SVG Table borders are exeeded. #175
Comments
Thank you for reporting this unexpected SVG output, @norator42 . I'm really sorry for you not receiving any feed-back about this issue for more than a year. That is not intentional, but is probably because the contributors to this project are only able to spend their spare time working with this, and there might be long periods without anyone reading new issues. Then some issues might slip through without any answer when trying to catch up after a low-activity period. I cannot seem to reproduce your issue using Ubuntu 18.04.4 LTS and WSL1 in Windows 10, Pyhon 3.7.5, and WireViz v0.2, v0.3.2, or the current v0.4-dev. The older verison 0.1 cannot have been used because your input contains the connector attribute Can this issue depend on the program rendering the SVG output? I have tried Microsoft Edge Version 97.0.1072.55 (Official build) (64-bit) and Google Chrome Version 97.0.4692.99 (Official Build) (64-bit) in Windows 10. Another factor that might affect the result is the currently installed fonts. Can someone else try to reproduce this issue in different environments than what I have access to? To avoid such problems, we encourage everyone to supply enough information to reproduce the reported state when creating an issue. |
I am also experiencing this problem using:
I am not experiencing the problem using:
Rendered on:
I've confirmed that my browsers are actually using arial and not the liberation-serif ubuntu default. Interesting discovery! Its the svg files, not the browser. The files generated on my 18.04 machine look fine on all my machines, but the ones made on 22.04 exceed borders everywhere. This issue is not resulting from inside wireviz, I can reproduce it by directly calling dot on the gv file to export the svg and png. The problem goes away if I force dot to render the svg using cairo (this is what happens when pngs are generated), unfortunately this results in large file sizes because each glyph is embedded as a path in the svg and the text is not searchable. On both systems verbose output from dot confirms that they are using the same path to the same font ttf file. It seems like the newer graphviz (specifically its native svg driver) has a different idea of what arial looks like than the rest of the system (smaller kerning), as such the text boxes it draws are too small for the larger kerning when the font is rendered by the browser. The older version of graphviz correctly estimates the text dimensions so everything lines up. I think further investigation will have to take place over on graphviz's gitlab repo. In the meantime my workaround for the issue is to modify |
Thank you very much, @JeremyRuhland for the detailed documentation about your experiments and their results. I agree that the root cause seems to be inside some graphviz component for SVG output. Interestingly, your suggested work-around seems to be somewhat similar to one of the optional features I argued for some time ago in #189 (comment) and the owner didn't reject the idea, just wanted to finish the basic new features first. No surprise then, that I support your suggested work-around as an optional feature. Edit: An alternative work-around that will keep the HTML file standalone, is to embed the PNG file in the |
|
@ask6483 - thank's for confirming this issue. Are you able to include here, one or two SVG image files that demonstrates this problem (together with their YAML source and how they were produced)? |
I suggest adding a few placeholders for usage in HTML templates (a new feature added in v0.4) that can help as a work-around when experiencing SVG problems like this:
Then any user can make a custom template using an image tag ( Please suggest better names for my suggested placeholders, and maybe other placeholder variations that might help. |
@kvid sorry for late reply but I lost the track until yesterday notification, here are the files test_files.zip. It looks like the issue is more visible in html/pdf render than in svg file itself: |
@ask6483 - Thank's for the test files. I agree that the issue is greater when rendering your PDF (in Okular v23.08.1 and in Brave v1.65) than when rendering your SVG and HTML (both in Brave v1.65). How did you render your files? And how did you generate the PDF files? |
This will e.g. enable users to replace SVG diagram with PNG, that is needed as a work-around when the SVG output from Graphviz is not looking good. #175 (comment)
This will e.g. enable users to replace the SVG diagram with PNG, that is needed as a work-around when the SVG output from Graphviz is not looking good. Suggested as work-around for Graphviz bug in #175 (comment)
This will enable users to replace the SVG diagram with an embedded PNG, that is an improved work-around when the SVG output from Graphviz is not looking good. Suggested as work-around for Graphviz bug in #175 (comment)
This will e.g. enable users to replace the SVG diagram with PNG, that is needed as a work-around when the SVG output from Graphviz is not looking good. Suggested as work-around for Graphviz bug in #175 (comment)
This will enable users to replace the SVG diagram with an embedded PNG, that is an improved work-around when the SVG output from Graphviz is not looking good. Suggested as work-around for Graphviz bug in #175 (comment)
This will e.g. enable users to replace the SVG diagram with PNG, that is needed as a work-around when the SVG output from Graphviz is not looking good. Suggested as work-around for Graphviz bug in #175 (comment)
This will enable users to replace the SVG diagram with an embedded PNG, that is an improved work-around when the SVG output from Graphviz is not looking good. Suggested as work-around for Graphviz bug in #175 (comment)
This will e.g. enable users to replace the SVG diagram with PNG, that is needed as a work-around when the SVG output from Graphviz is not looking good. Suggested as work-around for Graphviz bug in #175 (comment)
This will enable users to replace the SVG diagram with an embedded PNG, that is an improved work-around when the SVG output from Graphviz is not looking good. Suggested as work-around for Graphviz bug in #175 (comment)
If a field is too long, the table border is exceeded. This error happens only in SVG output, not in PNG output. My temporary solution is to convert the GV file directly into a PDF with: "dot -Tpdf example.gv -o example.pdf" to create a correct vector graphic. Is it possible to fix the SVG output? I think this is a graphviz error - so can you add a direct PDF output for propper vectorized graphics?
With code:
The text was updated successfully, but these errors were encountered: