Skip to content

Quick Renders with view()

view() shows a LiteViewer inline in a notebook: just the structure, no sidebar or toolbar — a PyMOL-style render in one line.

from ase.build import molecule
from aseview import view

viewer = view(molecule("CH3CONH2"), style="cinematic", center=True, width=500, height=420)

Trajectories get a compact play button and frame slider:

viewer = view(trajectory, style="bubble", fps=24, hide_hydrogens=True, center=True)
viewer.save_html("trajectory.html")   # view() returns the viewer
Argument Description Default
style Rendering style (Styles) "cinematic"
fps Trajectory playback speed 30
hide_hydrogens Hide hydrogens and their bonds False
center Center each frame on its center of mass False
width, height Notebook frame size in pixels 500

Any other viewer setting also works, e.g. view_direction=[1, 1, 1] or show_bond=False.