Ticket #1478 (new enhancement)

Opened 6 years ago

Last modified 5 months ago

Scale graphviz output proportional to page width

Reported by: joe_merchant@yahoo.com Assigned to: cboos
Priority: normal Component: GraphvizPlugin
Severity: normal Keywords: graphviz image scale
Cc: Trac Release: 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.

Attachments

thumbail.patch (3.1 kB) - added by jacqueswitte on 05/27/08 15:39:23.
graphviz-img-spec-r4543.diff (4.8 kB) - added by cboos on 10/20/08 18:46:09.
Add support for specifying the attributes of the <img> tag corresponding to the generated picture of the graph

Change History

05/27/08 15:39:23 changed by jacqueswitte

  • attachment thumbail.patch added.

05/27/08 15:42:20 changed by jacqueswitte

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

10/20/08 12:12:55 changed by cboos

  • owner changed from pkropf to cboos.
  • release changed from 0.10 to 0.11.

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

10/20/08 18:43:44 changed by cboos

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

10/20/08 18:46:09 changed by cboos

  • attachment graphviz-img-spec-r4543.diff added.

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

(follow-up: ↓ 5 ) 05/28/09 00:02:27 changed by cboos

  • release changed from 0.11 to 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.

(in reply to: ↑ 4 ) 12/21/12 13:46:59 changed by anonymous

Replying to cboos:

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


Add/Change #1478 (Scale graphviz output proportional to page width)




Change Properties
Action