beangrow icon indicating copy to clipboard operation
beangrow copied to clipboard

SVG doesn't display

Open floatingheads opened this issue 4 years ago • 7 comments

For some reason the SVG files do not load in the browser via index.html for any of the group reports. I have tried Chrome, Edge, and Internet Explorer. I can open the SVG files individually in all 3 of those browsers with no issue, but they stubbornly don't want to load via the html. I'm on a Windows machine if that matters.

floatingheads avatar Apr 16 '21 11:04 floatingheads

@floatingheads i have exactly the same issue on Windows, did you find the solution?

gety9 avatar Sep 13 '21 15:09 gety9

@gety9 I didn't find a solution. I've just been looking at the tables without worrying about it. If I care enough about the graphs, then I can manually open them.

floatingheads avatar Sep 13 '21 19:09 floatingheads

Issue is caused by wrong image reference inside HTML file.

If html file is meant to be served by localhost (similar to what fava is doing) then it's correct, but since here we open local file (similar to bean bake) then we need change image reference in index.html:

from

<img src=out\groups\currency.XXXX\flows.svg style="width: 100%"/>
<img src=out\groups\currency.XXXX\cumvalue.svg style="width: 100%"/>

to simply

<img src=flows.svg style="width: 100%"/>
<img src=cumvalue.svg style="width: 100%"/>

gety9 avatar Sep 13 '21 20:09 gety9

@redstreet are you linux user?

If yes, could you please tell:

  • if svg files are displayed for you
  • what do you have after "<img src=" in generated index.html (lines 32 and 33)

?

gety9 avatar Sep 16 '21 08:09 gety9

@gety9 changing the img src as you suggested worked for me as well.

floatingheads avatar Sep 16 '21 12:09 floatingheads

Agree, this is definitely an issue that needs to be fixed in the code, as I believe the common use case is to simply open up the files locally. @blais would you agree?

Yes, I'm a Linux user and the src= line incorrectly includes a long base path instead of just the file like @gety9 shows above. PR would be appreciated.

redstreet avatar Sep 17 '21 00:09 redstreet

@redstreet @floatingheads @blais I created pull request #15 to fix this above, changing the img src path written by report.py in index.html. Hope it helps.

erpreciso avatar Nov 03 '21 20:11 erpreciso