nglviewer / nglview

Jupyter widget to interactively view molecular structures and trajectories
http://nglviewer.org/nglview/latest/
Other
788 stars 132 forks source link

Protein not showing as ribbons #1108

Closed ONISniperOne closed 2 weeks ago

ONISniperOne commented 2 months ago

How come nglview isn't showing my protein as ribbons?

create NGL viewer

view = nv.show_pytraj(traj)

Change representations

view.add_cartoon(selection="protein") view

image

  1. How do I turn off the atoms for the protein and show only ribbon?
  2. How do I change the height of the ipywidget
hainm commented 1 month ago
  1. How do I turn off the atoms for the protein and show only ribbon?

can you try

view.clear()
view.add_cartoon(...)
  1. How do I change the height of the ipywidget

may be view._set_size(...) https://github.com/nglviewer/nglview/blob/12a75bc6f0cea8fbc0f75ffc68117d010ce96cc9/nglview/widget.py#L568