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

Adding a download image button for different formats #1056

Conversation

AndresOrtegaGuerrero
Copy link
Member

@AndresOrtegaGuerrero AndresOrtegaGuerrero commented Jan 5, 2025

Here we include a button for downloading the image in different formats

image

Copy link

codecov bot commented Jan 5, 2025

Codecov Report

Attention: Patch coverage is 55.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 67.83%. Comparing base (531339d) to head (1174f0e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/aiidalab_qe/common/bands_pdos/model.py 35.71% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1056      +/-   ##
==========================================
- Coverage   67.89%   67.83%   -0.06%     
==========================================
  Files         112      112              
  Lines        6593     6613      +20     
==========================================
+ Hits         4476     4486      +10     
- Misses       2117     2127      +10     
Flag Coverage Δ
python-3.11 67.83% <55.00%> (-0.06%) ⬇️
python-3.9 67.85% <55.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@edan-bainglass edan-bainglass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall straightforward. Before I approve, can you please respond to my comments?

src/aiidalab_qe/common/bands_pdos/bandpdoswidget.py Outdated Show resolved Hide resolved
src/aiidalab_qe/common/bands_pdos/model.py Show resolved Hide resolved
@edan-bainglass edan-bainglass self-requested a review January 6, 2025 11:55
Copy link
Member

@edan-bainglass edan-bainglass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @AndresOrtegaGuerrero. You can proceed. If possible, could you maybe comment on Plotly's image download API? The plot comes with built-in PNG download. I'm wondering if the modebar could be modified (in a future PR) to include custom buttons for other common formats (likely still using JS).

@AndresOrtegaGuerrero
Copy link
Member Author

I used https://plotly.com/python-api-reference/plotly.io.html?highlight=io#module-plotly.io , i dont know if the other option can be modified.

@AndresOrtegaGuerrero AndresOrtegaGuerrero merged commit 1df8f54 into aiidalab:main Jan 6, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants