Interactive Widgets

Jupyter widgets enable interactive data visualization in the Jupyter notebooks.

icon to represent multiple notebooks

Notebook Widgets

Notebooks come alive when interactive widgets are used. Users can visualize and control changes in the data. Learning becomes an immersive, plus fun, experience. Researchers can easily see how changing inputs to a model impacts the results.

ipyleaflet Binder GitHub

A library for creating simple interactive maps with panning and zooming, ipyleaflet supports annotations such as polygons, markers, and more generally any geojson-encoded geographical data structure.


from ipyleaflet import Map

Map(center=[34.6252978589571, -77.34580993652344], zoom=10)


With conda:
conda install -c conda-forge ipyleaflet
With pip:
pip install ipyleaflet
jupyter nbextension enable --py --sys-prefix ipyleaflet

A Jupyter widget to interactively view molecular structures and trajectories.


import pytraj as pt
import nglview as nv

traj = pt.load('', top='sim.prmtop')
view = nv.show_pytraj(traj)
view.add_cartoon('protein', color_scheme='residueindex')
view.add_ball_and_stick('not protein', opacity=0.5)