activity-browser icon indicating copy to clipboard operation
activity-browser copied to clipboard

fix svg arrowhead urls (path end-markers)

Open BenPortner opened this issue 1 year ago • 1 comments

The edges in exported SVG sankey diagrams do currently not show arrowheads:

Unbenannt

The error occurs because the marker-end attribute of the path references a HTML file, which is located in the install directory of the activity-browser. This file cannot be accessed from the browser due to security restrictions:

<path xmlns="http://www.w3.org/2000/svg" class="path" d="..." marker-end="url(file:///C:/Users/user/programs/miniconda/envs/ab_new/lib/site-packages/activity_browser/static/sankey_navigator.html#arrowhead224)" style="fill: none;"/>
Security Error: Content at file:///C:/some.svg may not load data from file:///C:/Users/user/programs/miniconda/envs/ab_new/lib/site-packages/activity_browser/static/sankey_navigator.html.

This PR fixes the issue by making sure that the attribute references the arrow definitions within the svg file:

<path xmlns="http://www.w3.org/2000/svg" class="path" d="..." marker-end="url(#arrowhead224)" style="fill: none;"/>

Unbenannt

BenPortner avatar Sep 02 '22 13:09 BenPortner

Coverage Status

Coverage increased (+0.08%) to 54.405% when pulling f2882f9a3a7bd5d47aaa82899e22989f74ddb627 on BenPortner:fix-svg-arrowheads into da47eac9cd8104f9d3697cbb36e4f73184e63777 on LCA-ActivityBrowser:master.

coveralls avatar Sep 02 '22 13:09 coveralls

thanks @BenPortner !

bsteubing avatar Sep 08 '22 15:09 bsteubing