lab-cosmo / chemiscope

An interactive structure/property explorer for materials and molecules
http://chemiscope.org
BSD 3-Clause "New" or "Revised" License
121 stars 29 forks source link

Missing unit cell option in chemiscope jupyterwidget viewer #269

Closed agoscinski closed 1 year ago

agoscinski commented 1 year ago

We have students in the iam course with the same chemiscope version 0.5.1 and ase 3.22.1 but for some students the unit cell option is not shown. It's a bit too time consuming to debug this line by line with a student. I would like to recreate the issue locally, but I don't have this issue and the versions I checked are the same. Do you know any other libraries we can check that can cause such a difference? Maybe python version? jupyterwidget?

Luthaf commented 1 year ago

The unit cell option is dynamically showed/hidden with CSS, depending whether the structure has a cell defined or not: see here, and related code:

https://github.com/lab-cosmo/chemiscope/blob/634136b3d09cc32c9b951d1eb76293b2a872ec9a/src/structure/viewer.ts#L197-L201

If you don't have the issue, I would check which web browser the students are using, there might be some subtlety we missed here, maybe related to the shadow DOM? You could also check that the chemiscope JSON does contain cell information, and that the HTML node is hidden by CSS despite of that (using the browser dev tools)

ceriottm commented 1 year ago

We checked that the structure has a cell, and the same notebook for almost all other students shows the unit cell option. We didn't check CSS though, we will try again when we see her next Monday. This might be a manifestation of something more profound that is browser-dependent.

cbenmahm commented 1 year ago

I also get the same issue on Safari (version 16.3). No unit cell option shows, even for the examples in chemiscope.org, but everything works as expected in Chrome. I join a screenshot of options of the structure viewer in Safari running the Zeolites example

Screenshot 2023-02-28 at 12 40 43
Luthaf commented 1 year ago

I can reproduce this on Safari! I'll see if I can find a workaround

ceriottm commented 1 year ago

Amazing we have an in-house example of this failure mode. Deployment might be tricky but we'll try.