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

Shape does not appear in even-numbered displays #1003

Closed
hainm opened this issue Nov 4, 2021 · 0 comments · Fixed by #1025
Closed

Shape does not appear in even-numbered displays #1003

hainm opened this issue Nov 4, 2021 · 0 comments · Fixed by #1025
Labels

Comments

@hainm
Copy link
Collaborator

hainm commented Nov 4, 2021

From @lan496

Shape does not appear in even-numbered displays

When I add a shape to NGLWidget, it appears at first. However, it sometimes does not appear in code blocks (see the below screenshot). Is it expected behavior?

Apologies in advance if this is an already-answered question in previous Q&As.

Screenshot

nglview_question

Code

import nglview
from ase import Atoms
print(nglview.__version__)
positions=[(0, 0, 0), (4, 0, 0)]
co = Atoms('H2', positions)
view = nglview.show_ase(co)
view.shape.add_cylinder(positions[0], positions[1], [1, 0, 0], 0.1)
print(view._ngl_component_names)
view  # first

print(view._ngl_component_names)
view  # second: cylinder disapears

print(view._ngl_component_names)
view  # third: cylinder shows again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant