User presets#
User presets let you define reusable styling rules for whole and regions.
Use user presets when you want a named “style recipe” you can reuse across notebooks.
How it works#
You define presets in a JSON or YAML file.
You load them with
molsysviewer.config.load_user_presets(...).You apply them with
preset="your-preset-name"inwholeorregions.
File format (conceptual)#
Each preset name maps to:
base: an optional built-in preset to start from (for exampleauto).options: optional preset-level options.rules: a list of rules that apply representations to selections or explicit atom indices.
This page is a placeholder for the full schema and examples.
Loading#
import molsysviewer as mv
mv.config.load_user_presets("presets.yaml")
Applying#
view.whole.set_representation(preset="my-style")