Modify

Opened 18 years ago

Last modified 7 years ago

#1478 new enhancement

Scale graphviz output proportional to page width

Reported by: joe_merchant@… Owned by: Christian Boos
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 (2)

thumbail.patch (3.1 KB) - added by jacques witte 17 years ago.
graphviz-img-spec-r4543.diff (4.8 KB) - added by Christian Boos 16 years ago.
Add support for specifying the attributes of the <img> tag corresponding to the generated picture of the graph

Download all attachments as: .zip

Change History (10)

Changed 17 years ago by jacques witte

Attachment: thumbail.patch added

comment:1 Changed 17 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 16 years ago by Christian Boos

Owner: changed from Peter Kropf to Christian Boos
Trac Release: 0.100.11

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

comment:3 Changed 16 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 16 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 Changed 16 years ago by Christian Boos

Trac Release: 0.110.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 12 years ago 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

comment:6 Changed 12 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.

comment:7 Changed 7 years ago by mangocats

Did this ever make it into Trac 1.0? I thought I remembered doing it in older versions of graphviz/trac but in my current 1.0 installs I can't make any of the above scaling commands work.

comment:8 Changed 7 years ago by Jonathan Laufersweiler

It strikes me that since the MacroChainMacro works with the GraphViz plugin, you might be able to use the former to pipe the latter's output into the image macro, and get your scaling from there.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Christian Boos.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.