Opened 10 years ago

Closed 10 years ago

# URL issues with SVG rendered graphs

Reported by: Owned by: eblot pkropf normal GraphvizPlugin normal 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.

### comment:1 Changed 10 years ago by pkropf

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 10 years ago by eblot

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 10 years ago by pkropf

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 10 years ago by pkropf

(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 10 years ago by pkropf

• Resolution set to fixed
• Status changed from new to closed

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.