Migrating to 1.0
aseview 1.0 replaces the 0.0.x viewer templates with a single viewer engine. Every viewer, the JavaScript module and the VS Code extension now run the same code, and every option is a validated viewer setting. This page lists what you may need to change when upgrading from 0.0.x.
Command-line options are unchanged, and the Python class names
(MolecularViewer, OverlayViewer, NormalViewer, FragSelector,
SurfaceViewer, LiteViewer, view) still import from aseview.
Settings are validated
Settings are checked when a viewer is created. An unknown name raises
TypeError with a suggestion, and an invalid value raises ValueError, so a
misspelled or retired name no longer passes silently.
Renamed settings
Settings can be written in snake_case (as below) or camelCase.
| 0.0.x | 1.0 |
|---|---|
view_mode / viewMode |
projection |
animation_speed / animationSpeed |
fps (frames per second) |
displacement_amplitude / displacementAmplitude |
amplitude |
initial_mode_index / initialModeIndex |
mode_index |
show_shading / showShading |
shading |
show_periodic_images, show_one_hop_bonded_atoms |
show_bonded_neighbors |
align_molecules / alignMolecules |
align_structures |
colormap (overlay) |
overlay_colormap |
element_color_overrides / elementColorOverrides |
element_colors |
periodicities=["+x", "±y"] |
cell_repeat={"a": [0, 1], "b": [1, 1]} |
Renamed values
Values are matched case-insensitively ("Orthographic" still works), but these
were renamed:
| Setting | 0.0.x | 1.0 |
|---|---|---|
color_by |
"atom", "molecule" |
"element", "structure" |
view_preset |
"top", "top-c", "side-a", "side-b" |
"c", "c", "a", "b" |
Removed settings
charge_colormap (charge colors are a fixed red–white–blue scale),
performance_mode, selection_mode, view_fit / fit_padding and
view_euler have no replacement. Use view_direction and view_up to set the
starting camera.
LiteViewer and view()
| 0.0.x | 1.0 |
|---|---|
styles= |
style= |
hide_hs= |
hide_hydrogens= |
centering= |
center= |
high_performance= |
removed |
bond_threshold, show_bond, view_direction and every other viewer setting
are still accepted. See LiteViewer.
PNG and GIF export
save_png() no longer takes background_color; set the background_color
setting on the viewer instead.
save_gif() now takes fps, step (keep every Nth frame) and max_frames.
The old frames, delay, sample_interval, transparent,
background_color and quality arguments are gone. See
Methods.
Python modules
aseview.wrapper is gone. Import from aseview itself; MolecularData is in
aseview.data and the viewers in aseview.viewers. The templates/,
themes/ and static/js/ package folders are removed.
JavaScript module
The script moved and is now one self-contained file:
| 0.0.x | 1.0 |
|---|---|
aseview/static/js/aseview.js |
aseview/viewer_assets/aseview-viewer.js |
The global is still ASEView, with one class per viewer
(new ASEView.MolecularViewer('#viewer', settings)). Settings are validated
here too, and view presets use the new names ('c' instead of 'top-c'). See
JavaScript Module.