Add arrows#

Adding 3D graphical vector arrows to NGLView interactive visualization widgets.

The function molsysmt.third_party.nglview.add_arrows() draws 3D vector arrows over an active NGLWidget view to represent spatial vectors, dipole moments, displacements, or forces.

Added in version 1.0.0.

Basic usage#

Let’s demonstrate how to use this function on an interactive NGLView view:

import molsysmt as msm

molsys = msm.convert(msm.systems['T4 lysozyme L99A']['181l.h5msm'], to_form='molsysmt.MolSys')
view = msm.convert(molsys, to_form='nglview.NGLWidget')
msm.third_party.nglview.add_arrows(view, origin='atom_index==0', end='atom_index==10', color='#E74C3C', radius='0.5 angstroms')

Evaluating the view object displays the interactive visualization:

view