Modify

Opened 7 years ago

Last modified 17 months ago

#1478 new enhancement

Scale graphviz output proportional to page width

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

thumbail.patch (3.1 KB) - added by jacqueswitte 6 years ago.
graphviz-img-spec-r4543.diff (4.8 KB) - added by cboos 6 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 (8)

Changed 6 years ago by jacqueswitte

comment:1 Changed 6 years ago 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

comment:2 Changed 6 years ago by cboos

  • Owner changed from pkropf to cboos
  • Trac Release changed from 0.10 to 0.11

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

comment:3 Changed 6 years ago 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

Changed 6 years ago by cboos

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

comment:4 follow-up: Changed 5 years ago by cboos

  • Trac 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.

comment:5 in reply to: ↑ 4 Changed 22 months 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 17 months 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.

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.