#13631 closed enhancement (fixed)
Option for SVG output
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | normal | Component: | MasterTicketsPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.4 |
Description
The included DepGraph tool is critical and heavily used by my team, but can get unwieldy as the project grows in size. As I understand it, it uses the GraphViz library and is set to generate a static PNG image, which is then overlayed with an imap html element to add the click-through functionality.
The library also supports output as an SVG, which could be combined with jQuery to provide interactive features, e.g. collapse / expand branches in real time.
Could you at an option in trac.ini to switch output to SVG? With that, I could start experimenting with jQuery and share the results (assuming I get it to work).
Thanks!
Attachments (0)
Change History (11)
comment:2 Changed 5 years ago by
That almost worked: I made the change in trac.ini as suggested and used the added parameter in the URL. It returned the raw xml/svg page, rendered in the browser as code. However, saving that output as a "depgraph,svg" file and opening it again in the browser did render the graph as expected - even the hyperlinks remained intact which is great.
The file contains just the depgraph image (no other page elements), so I'm guessing it's bypassing the page template engine? Would be great if you can add a setting to make it the default as you said, so it shows within the page template. Thanks!
comment:3 Changed 5 years ago by
Status: | new → accepted |
---|
comment:5 Changed 5 years ago by
Please report back if it's working well for you.
Once confirmed, I'll publish new version to PyPI.
comment:6 Changed 5 years ago by
Great news - thank you for getting this implemented! I will test this weekend and let you know how it goes.
comment:7 Changed 5 years ago by
Thanks for the fast reply. I was happy to get a reply since it took 7 months for me to get around to this! :)
comment:8 Changed 5 years ago by
I had a chance to try this today. Steps taken:
# pip install TracMasterTickets --upgrade Installing collected packages: TracMasterTickets Found existing installation: TracMasterTickets 4.0.2 Uninstalling TracMasterTickets-4.0.2: Successfully uninstalled TracMasterTickets-4.0.2 Successfully installed TracMasterTickets-4.0.3 # yum install svn # pip install svn+https://trac-hacks.org/svn/masterticketsplugin/trunk/ Successfully installed TracMasterTickets-4.0.4.dev0
in trac.ini
[mastertickets] acceptable_formats = svg,png,cmapx
- restart apache server
- confirmed Depgraph renders in SVG!
Works great :). Many thanks for getting this done - I will start playing with some ideas to make Depgraph interactive via jQuery (info popup, context menu, etc.) and share results when I have something.
I haven't checked, but assuming Graphviz will generate an SVG, it looks like you could:
svg
to[mastertickets]
acceptable_formats
?format=svg
to the URL that generates the imageIf that works, we can add an option to change the default format.