Opened 10 years ago

Scale graphviz output proportional to page width

Reported by: Owned by: joe_merchant@… Christian Boos normal GraphvizPlugin normal graphviz image scale 0.12

Description

Before installing the graphviz plugin, we commonly screen captured graphviz output and put it into trac pages as an image-macro scaled to a percentage of the page width e.g., [[Image(Graph.png,40%)]]

It would be really cool to be able to do this type of scaling with the graphviz plugin output, especially for large graphs that are too big for most monitors.

comment:1 Changed 9 years ago by jacques witte

I propose a thumbail.patch that work with PIL python library (must install it)

To activate thumbail you have to set max_width_screen_size in px:

[graphviz]
max_width_screen_size = 600


comment:2 Changed 8 years ago by Christian Boos

Owner: changed from Peter Kropf to Christian Boos 0.10 → 0.11

Would be interesting to be able to simply specify the scaling in the generated <img>.

comment:3 Changed 8 years ago by Christian Boos

Ideally one should be able to specify extra arguments to the WikiProcessors, as one can do with the builtin div processor in 0.11. So this would become:

{{{
#!graphviz width="80%"
digraph G {
...
}
}}}


This will eventually become possible in some future iteration of Trac. For now, we have no choice but to put this information into the "content".

To clearly differentiate this extra information from the graphviz data, we can specify this information in a pseudo <img> tag, on the first line:

{{{
#!graphviz
<img width="80%" />

digraph G {
...
}
}}}


Notes:

• scaling of otherwise good looking .png graphs looks ugly in IExplorer7 and Opera9.60. Nice results with Firefox and Chrome.
• being able to specify the size for the SVG output is also an improvement from the previous situation, where the size was "auto-corrected" by the GraphvizPlugin. This auto-correction didn't work well for me, so you may want to always add <img width="100%" /> when using the graphviz/svg processor

Changed 8 years ago by Christian Boos

Add support for specifying the attributes of the <img> tag corresponding to the generated picture of the graph

comment:4 follow-up:  5 Changed 8 years ago by Christian Boos

Trac Release: 0.11 → 0.12

Well, I think I'll rather wait for the #!graphviz width="80%" syntax to be implemented in 0.12, otherwise I'll end up having to support both ways in the plugin.

comment:5 in reply to:  4 Changed 4 years ago by anonymous

Well, I think I'll rather wait for the #!graphviz width="80%" syntax to be implemented in 0.12, otherwise I'll end up having to support both ways in the plugin.

Are there any updates on this? I'm on tract 0.12.2 and neither syntax appears to be working?

Thx, Alex

comment:6 Changed 4 years ago by anonymous

+1 - I too would like this functionality.

Being able to specify size of the output image in any manner would be appreciated.

Modify Ticket

Action
as new The owner will remain Christian Boos.