nglviewer / nglview

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

Question about updating values for radii in hyperball representation for crystal supercell. #895

Closed zorankiki closed 4 years ago

zorankiki commented 4 years ago

Hi guys! I am trying to use ngl to embed representation of crystal supercell: lifepo4_supercell.pdb.zip view_structure.html.zip

and trying to figure out how to set different radii for LI, FE, P and O instead of covalent or Van der Waals radii. I have tried to define new constants for radii to override radius constants somenthing like this: const CovalentRadii = { 'LI': 1, 'O':3, 'Fe':2, 'P':2} but this did not work, also I have use something like this: const radiusData = {} comp.structure.eachAtom(ap => { radiusData[ap.index] = 1. }); comp.addRepresentation("hyperball", {scale:.3, radiusType:"covalent", radiusData:radiusData}); this should set all radii to 1. but nothing happend.

Please can somebody give me some clue how to do that or maybe some examples and documentation to learn how to update and change parameters like for example radii of atoms or colors.

hainm commented 4 years ago

hi @zorankiki: please post your question in NGL repo where there are many experts. This is for nglview that uses NGL in jupyter notebook.

https://github.com/arose/ngl

zorankiki commented 4 years ago

hi @zorankiki: please post your question in NGL repo where there are many experts. This is for nglview that uses NGL in jupyter notebook.

https://github.com/arose/ngl

@hainm thank you a lot. I will post there my issue. Cheers!