Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#560 closed defect (fixed)

URL issues with SVG rendered graphs

Reported by: Emmanuel Blot Owned by: Peter Kropf
Priority: normal Component: GraphvizPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.9

Description

SVG graphs are embedded within an XHTML page inside <object> tags. This seems to be the only recommended way IFAICT.

The trouble is that an object is considered as a sub-element in a browser, just like iframe.

This means that when a URL is added to a graph node and the user click on this node, the browser loads the linked page into the object placeholder, not in the main window as expected. In other words, the linked page appears as "nested" into the original web page where the graph was displayed. Back to the plain old "html frame" issue ;-(

The meaning of object is therefore really different that the <img> element as used for bitmap-based graphs.

I tried several solution to workaround this issue, and up to now the only working solution I've found is to use Javascript in URLs so that the content of the object parent window is loaded with the content of the URL, not the object "window".

In other word, graph URLs such as:

URL="http://project/wiki/WikiPage"

should be replaced with

URL="javascript:window.parent.location.href='http://project/wiki/WikiPage'"

in the generated dot file.

Attachments (0)

Change History (6)

comment:1 Changed 11 years ago by Peter Kropf

Yeah, this should be fixed but it'll take me a few days to figure out how to best get it done. (Unless you already have a patch ;-)

Should there be a config override option to control if this expansion is done? I'm not certain that I understand the implications on different platforms / browsers. Thoughts?

comment:2 Changed 11 years ago by Emmanuel Blot

You can have a look at svncchelpersscript/0.10/revtree/revtree/view.py line 202 to see how I've dealt with the SVG/PNG duality.

I don't think there's a need for a configuration option:

  • if the engine produces an SVG image, then the graphviz macro includes it as an object and the links should update the parent, not the image
  • if the engine produces a PNG image, then the graphviz macro includes it as an HTML image and the links should be kept unmodified

I did not try w/ the infamous IE browser, but the proposed solution works with Camino 1.0.2, Firefox 1.5.x, Opera 9.x, ...

comment:3 Changed 11 years ago by Peter Kropf

Sounds reasonable but I'd like to test against IE before I release it. I should be able to fix this over the next day or two...

comment:4 Changed 11 years ago by Peter Kropf

(In [1163]) Links for images that are in svg format are now defined with the javascript:window.parent.location.href= prefix. References #560.

comment:5 Changed 11 years ago by Peter Kropf

Resolution: fixed
Status: newclosed

I was able to test this on Linux under Firefox and on WinXP under Firefox and Internet Explorer w/ Adobe's SVG plugin. On all three browsers, the javascript:window.parent.location.href= prefix on the URLs work as expected.

comment:6 Changed 11 years ago by Peter Kropf

(In [1164]) Added release notes comments for ticket:560. References #560.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Peter Kropf.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.