LCA-ActivityBrowser / activity-browser

GUI for brightway2
GNU Lesser General Public License v3.0
149 stars 57 forks source link

Exporting Sankey as an svg #985

Open Zoophobus opened 1 year ago

Zoophobus commented 1 year ago

This can be separated into two distinct issues:

  1. The svg file type is not supported in the microsoft office suite. Choosing an alternative library that supports exports (including svg exports) to MS office will be advantageous for most users .

  2. When exporting the page dimensions appear to be fixed to the initial sankey page view. Although the entire sankey diagram is exported it appears that the actual dimensions provided do not extend to cover the entire model, hence only a portion being viewable in several programs. MicrosoftTeams-image

For number 2 either the dimensions for the exported figure should cover the entire sankey diagram, or the dimensions should be set to cover the area of the diagram viewed by the user (requested by the OP).

marc-vdm commented 1 year ago
  1. The svg file type is not supported in the microsoft office suite. Choosing an alternative library that supports exports to MS office will be advantageous for most users.

Adding more options is great but I do think it'd be good to keep svg as an option though, it is the preferred format for journals/online as it's vector based, AB is still primarily used by academia. This is also the reason we have the other figures have svg optons for exports.

Zoophobus commented 1 year ago

Eeek, sorry I should have been more specific, svg is probably the best option. There has been several users now though that have had difficulty in reading the files

marc-vdm commented 1 year ago

Or I should have read the issue better haha. No worries.

Zoophobus commented 1 year ago

@marc-vdm #784 is definitely related, however I'm not sure if these are equivalent. The prescribed fixes do not work in the cases that were found here, so I'm inclined to believe that they shouldn't be merged. Having stated that, though, fixing these issues here should also fix the issues in #784

tsgfan07 commented 2 months ago

on issue 2: to keep the user zoom on exporting the sankey, a fix may be to just comment out / remove the following lines in navigator.js , d3.select("#downloadSVGtButtonqPWKOg2").on("click", function() {:

    // panCanvasElem.removeAttribute("width")
    // panCanvasElem.removeAttribute("height")
    // panCanvasElem.removeAttribute("transform")

If that functionality is desired, one could consider renaming the button to something like "export current as svg"