Skip to content
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

Support dpi graph attribute #23

Closed
GoogleCodeExporter opened this issue Feb 12, 2016 · 5 comments
Closed

Support dpi graph attribute #23

GoogleCodeExporter opened this issue Feb 12, 2016 · 5 comments

Comments

@GoogleCodeExporter
Copy link

Units in xdot output are measured in PostScript points, which are always 72 
dpi. Graphviz produces 
PNG and other bitmapped output at 96 dpi by default. Canviz is supposed to 
replace using PNGs in 
web pages, and I wanted developers to have as seamless a transition as 
possible, so there's this 
curious variable "this.systemScale = 4/3" which should more properly be written 
"this.systemScale = 
96/72" to convert 72-dpi points to 96-dpi pixels so that Canviz output matches 
the size of PNG 
output.

But the graph could specify a different dpi. PNG output respects this setting 
(rendering a larger 
graph for larger dpi values) so we should do the same in Canviz.

Original issue reported on code.google.com by ryandesi...@gmail.com on 19 Oct 2008 at 6:48

@GoogleCodeExporter
Copy link
Author

Here's a sample graph with a nonstandard dpi setting.

Original comment by ryandesi...@gmail.com on 19 Oct 2008 at 6:50

Attachments:

@GoogleCodeExporter
Copy link
Author

Partial fix committed in r129 which takes care of the size (setting this.dpi to 
the value in the graph and setting 
this.systemScale to this.dpi / 72). But the line thickness is not right. I need 
to analyze the PNG output at absurdly 
high dpi values to see what the line thickness should be.

Original comment by ryandesi...@gmail.com on 19 Oct 2008 at 7:02

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

I rendered a graph at 720 dpi and the lines were exactly 10 pixels wide. So I 
must conclude that the line width 
should be this.dpi / 72. Which means I was wrong with r29 and should revert it.

Original comment by ryandesi...@gmail.com on 19 Oct 2008 at 7:24

@GoogleCodeExporter
Copy link
Author

Reverted r29 in r130. This fixes the line width but there's still something 
funny going on with the arrow in 
800dpi.gv -- the edge going into the arrow isn't centered in the Canviz 
rendering where it is in the PNG 
rendering.

Original comment by ryandesi...@gmail.com on 19 Oct 2008 at 7:44

@GoogleCodeExporter
Copy link
Author

I'm going to call this fixed. Canviz does support the dpi attribute. It's 
unfortunate that the arrows look a little 
funny at high dpi, but I think it's just the effect of rounding. xdot expresses 
coordinates in integer points. Drawn 
at the default 96 dpi, this amounts to a fraction of a pixel of difference. But 
when scaled up to such a high dpi, 
the rounding becomes noticeable. Canviz can't fix this; the way to fix it would 
be to have Graphviz express 
coordinates in xdot format in floating-point points instead of integer points.

Original comment by ryandesi...@gmail.com on 1 Nov 2008 at 8:19

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant