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

SVG Sankey diagram

Open Hd1004 opened this issue 3 years ago • 15 comments

Some of the Sankey diagram Svg files downloaded are incomplete. The whole diagram doesn't get downloaded on some files.

Hd1004 avatar May 10 '22 06:05 Hd1004

Could you provide screenshots of what's shown in AB and the files to compare?

marc-vdm avatar May 10 '22 06:05 marc-vdm

Screenshot (333) Screenshot (332) The downloaded SVG file only shows the first four steps of the diagram but you can see the whole diagram in the other file which is on AB

Hd1004 avatar May 10 '22 06:05 Hd1004

Could you share the full file here too? (Just drag/drop the file onto the comment box and it will upload automatically). Then I could have a look at the file in more detail, I'm not sure something went wrong with your file specifically or that there is an issue with AB.

marc-vdm avatar May 10 '22 06:05 marc-vdm

desrgerg This is the downloaded file. I hope it helps

Hd1004 avatar May 10 '22 06:05 Hd1004

Right, that's indeed broken.

@nabilahmed739 Could you have a look at the exporter? I''ll also look into behaviour, but I'm not sure I can fix this code alone

marc-vdm avatar May 10 '22 06:05 marc-vdm

@nabilahmed739 tried a bunch of random processes and cutoff/calc. depth settings but mostly got expected results. However, I'm getting a broken export when I use the (I think) same product as @Hd1004 (also note that the title with ref. flow is not present in their screenshot):

image I used: biogas production from grass | CH | ei38 For impact category I used IPCC2013 Climate change GWP100 The cutoff/calc. depth are in screenshot When I use the default cutoff/calc. depth the export is fine. Resulting SVG is: svg_export_test7

The SVG looks very similar to the red 'viewport' thing in the bottom left, but is not matching exactly. I now also notice that the viewport does not match with what is actually displayed, perhaps this could be the same issue?

marc-vdm avatar May 10 '22 07:05 marc-vdm

So, is it a bug or is something wrong with my version or the file?

Hd1004 avatar May 10 '22 07:05 Hd1004

This seems to be a bug on AB side. Though it must also be related to very specific circumstances. I tried 5 different processes and made different combinations for the cut-off and calculation depth but could not replicate your issue with those, but when I tried your process (biogas production from grass | CH) and a smaller cut-off/larger calculation depth, I was able to replicate it.

It seems you found a rare/specific bug that didn't find before. We'll try to fix it, but for now, perhaps try a different (higher) cut-off for your export, though of course, that's not an ideal solution in the long run. Another alternative is to make screenshots, but that's also not a permanent fix.

marc-vdm avatar May 10 '22 07:05 marc-vdm

Okay, so not getting the cropped svg file for "IPCC 2013 Climate change GWP 20a" But getting those issues with "IPCC 2013 Climate change GWP 100a" and "ILCD 2.0 2018 midpoint, climate change, climate change total"

Hd1004 avatar May 10 '22 07:05 Hd1004

And definitely an issue with "biogas production from grass | CH"

Hd1004 avatar May 10 '22 07:05 Hd1004

So, the problem is certainly with a smaller cut-off/larger calculation depth. Because I am getting that error for every file with such depth.

Hd1004 avatar May 10 '22 07:05 Hd1004

Well, interestingly enough, I'm now not getting the error with the same settings

Screenshot SVG

Perhaps try to re-start AB and see if the issue persists? This could also be caused by AB not properly resetting something after a re-calculation, thus breaking the exports, as it's now working for me after I restarted AB.

marc-vdm avatar May 10 '22 07:05 marc-vdm

@Hd1004 & @marc-vdm Apologies for the delayed response, there seems to be an issue with the exporter intermittently when the SVG is panned/zoomed. Have you tried "Reset Zoom" then "Download SVG"? This always worked for me. I'll try to reset the SVG before every export that way we dont have to press 2 buttons.

nabilahmed739 avatar Jun 05 '22 14:06 nabilahmed739

I am having the same issue. I had to scroll down a lot in the sankey diagram of the AB, such that the diagram is actually not visible anymore in the AB window. Only then, the exported SVG showed the entire diagram. Otherwise, it would only export the first third or so of the diagram.

My AB version is:

activity-browser-dev 2022.11.16

CHarpprecht avatar Jan 05 '23 14:01 CHarpprecht

Same issue here.

I opened the wrongly cropped svg file in inkscape, and it appeared that here, I could see the whole diagram - but it was outside the boundaries of the drawing. So I just extended the boundaries of the file in inkscape. So this seems to be a workaround #985

simb-sdu avatar Nov 07 '23 11:11 simb-sdu