Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export images from sunburst diagrams #4

Closed
nilsoberg opened this issue Mar 7, 2024 · 4 comments · Fixed by #5
Closed

Export images from sunburst diagrams #4

nilsoberg opened this issue Mar 7, 2024 · 4 comments · Fixed by #5
Assignees
Labels
enhancement New feature or request

Comments

@nilsoberg
Copy link
Contributor

Add support for downloading images in SVG and PNG format from the EFI sunburst diagrams. Results should match what is currently displayed to the fullest extent possible. See results page with sunburst example for an example.

@nilsoberg nilsoberg added the enhancement New feature or request label Mar 7, 2024
@1ndy
Copy link
Contributor

1ndy commented Mar 8, 2024

image
taxonomy(8)

Exporting as SVG and PNG is working, needs more testing to make sure it is stable; SVG seems ok but PNG sometimes produces blank images.

Testing so far has only been done by pasting my javascript functions into the console and calling an addDownloadLinks function manually; will need some integration testing once commits are made (js loading/ execution might happen in the wrong place in stepc.php).

@1ndy 1ndy linked a pull request Mar 8, 2024 that will close this issue
@1ndy
Copy link
Contributor

1ndy commented Mar 8, 2024

@nilsoberg I may need some help with integration testing this. I am not sure how to run a test version of the website.

@nilsoberg
Copy link
Contributor Author

nilsoberg commented Mar 12, 2024

We talked about building our own minified/packaged version of the sunburst code rather than including the minified version itself in the repo. There are two ways we can avoid this: one is to use the unpkg.com CDN system (e.g. <script src="//unpkg.com/sunburst-chart"></script>), or build it from source. I lean towards using unpkg.com with a specific version number that works for us, and this means we don't need to install npm and worry about including that in the PHP package process. (The repo https://github.com/vasturiano/sunburst-chart shows that as the usage in the examples.) What are your thoughts?

@1ndy
Copy link
Contributor

1ndy commented Mar 14, 2024

I'm not sure how either of these options are better than the current changes. Including the actual sunburst package with npm or a CDN does not give us anything we don't already have. The issue was that our version of the minified code does not correlate with the source code in our sunburst repository. (The minified code has a stylesheet that is critical for properly rendering the graphic, the source code in our sunburst repository does not.) I'm worried that there might be other inconsistencies in that repo, that's why the changes were made here (I didn't know we wanted export capabilities in other tools).

Are you proposing that we also submit a PR to the actual sunburst repo for image export? I'm not sure they would accept our changes given that they didn't seem interested in adding SVG export 2 years ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants