molsysviewer.MolSysView#
- class molsysviewer.MolSysView(*, debug_js=None)[source]#
Mol* viewer widget with a Python-facing API.
Provides structure loading, visibility control, shape management, and utilities to export static HTML views for documentation or sharing.
- Parameters:
debug_js (bool | None)
Methods
__init__(*[, debug_js])add(from_molecular_system, *[, selection, ...])Add atoms/structures from another system into this view and refresh the viewer (live).
append_structures(from_molecular_system, *)Append structures (frames) to the loaded system and refresh the viewer (live).
clear_decorations(*[, shapes, styles, labels])Clear decorative elements (shapes/styles/labels) without touching the loaded structure or camera.
get([element, selection, structure_indices, ...])Retrieve attribute values from the current molecular system (MolSysMT get).
get_camera_snapshot(*[, pretty])Return the last camera snapshot received from the frontend.
hide([selection, structure_indices, syntax])Hide atoms matching the given selection (MolSysMT syntax by default).
info([element, selection, syntax, mask, ...])isolate([selection, structure_indices, syntax])Show only the atoms in selection; hide everything else (reset if selection == 'all').
load(molecular_system[, selection, ...])Load a molecular system (MolSysMT-compatible) into the viewer.
new_layer(*[, tag, kind])Create a new layer (non-structural visual group).
new_region([selection, atom_indices, tag, ...])Create a new region (structural subset) with an optional representation.
remove(*[, selection, structure_indices, syntax])Remove atoms and/or structures from this view and refresh the viewer (live).
Reset the camera / view in the frontend.
Fully clear the viewer and reset internal state (requires a new load(...)).
select([selection, structure_indices, ...])Select indices from the current molecular system (MolSysMT selection language).
set(*[, element, selection, ...])Set attribute values on the loaded system and refresh the viewer (live).
set_camera_snapshot(snapshot, *[, duration_ms])Apply a previously saved camera snapshot.
set_controls_visible(visible, *[, autohide, ...])Show or hide the on-canvas controls (reset/full/bg/spin/swing + trajectory bar).
show([selection, structure_indices, syntax, ...])Show the widget (first call or if force=True) and optionally adjust visibility.
write_html(output_filename, *[, title, ...])Export this viewer widget to an HTML file.
zoom([selection, structure_indices, syntax, ...])Focus the camera on the geometric center of a selection of atoms.
Attributes
Logs received from the frontend when debug_js is enabled.
Public registry of layers (non-structural visuals).
Read-only handle to the loaded MolSysMT molecular system.
Public registry of regions (structural selections).
Return the indices of currently visible atoms.
Return the indices of currently visible structures.