Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#13631 closed enhancement (fixed)

Option for SVG output

Reported by: ralph.phd@… 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:1 Changed 5 years ago by Ryan J Ollos

I haven't checked, but assuming Graphviz will generate an SVG, it looks like you could:

  • add svg to [mastertickets] acceptable_formats
  • append ?format=svg to the URL that generates the image

If that works, we can add an option to change the default format.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:2 Changed 5 years ago by anonymous

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 Ryan J Ollos

Status: newaccepted

comment:4 Changed 5 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 17716:

TracMasterTickets 4.0.4dev: Allow image format to be specified

The first entry in [mastertickets] acceptable_formats
will be used by default. The PNG format will be used if the
list is empty. The new default value for acceptable_formats
is svg,png,cmapx, so SVG will be the default format
if acceptable_formats is not specified in the
[mastertickets] section of trac.ini.

Fixes #13631.

comment:5 Changed 5 years ago by Ryan J Ollos

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 ralph.phd@…

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 Ryan J Ollos

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 ralph.phd@…

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.

comment:9 Changed 5 years ago by Ryan J Ollos

In 17729:

TracMasterTicket 4.0.4: Tag release

Refs #13631.

comment:10 Changed 5 years ago by Ryan J Ollos

Thanks for testing! Released pypi:TracMasterTickets/4.0.4.

comment:11 Changed 5 years ago by Ryan J Ollos

In 17730:

TracMasterTickets 4.0.5dev: Bump version after release

Refs #13631.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.