superstar54 / weas-widget

A widget to visualize and edit atomic structures in Jupyter Notebook
https://weas-widget.readthedocs.io/en/latest/index.html
MIT License
19 stars 3 forks source link

add download_image and export_image #13

Closed superstar54 closed 6 months ago

superstar54 commented 6 months ago

Download image

viewer.download_image("filename.png")

Export the image to the cell and display

For the moment, one needs first call the javascript to export the image, and then wait for the imageData to be sent back to Python, thus one needs to run the steps in two separate cells:

viewer.export_image()
viewer.display_image()