API reference

API reference#

Complete reference for the widgets, tutorial datasets, HTML export, and data loading / I/O. Common display-chrome names and presets are documented in Viewer UI controls. Named tutorial datasets are documented in Tutorial Datasets. Package-level GIF and MP4 writers are documented in Movie Export. The same tables are surfaced in the developer-facing UI Guide. Widget pages have two halves:

  1. Reference - the constructor signature, every parameter, and every public method, generated directly from the source by static analysis (so it never drifts from the code).

  2. Interactive controls - the UI elements the widget exposes and the synced trait each one drives.

Doubles as a UI-test spec#

The Interactive controls tables are the contract an automated agent drives the widget against. Each row names a control, the trait it mutates, and what should be observed after acting on it. A driving agent reads the table, performs the action over CDP, and asserts the trait moved and the canvas repainted (non-zero, no console error, no NaN frame). When a control changes, update the table here in the same commit; the published page is the source of truth for both human readers and test agents.

At a glance#

Widget

Class

Offline export

Show1D

quantem.widget.show1d.Show1D

state JSON, CSV, PNG/PDF via Python, interactive HTML

Show2D

quantem.widget.show2d.Show2D

state JSON, PNG, interactive HTML (encoding="full" / encoding="uint8")

Show3D

quantem.widget.show3d.Show3D

state JSON, PNG, interactive HTML (encoding="full" / encoding="uint8")

Show3DSlices

quantem.widget.show3dslices.Show3DSlices

state JSON, PNG, interactive HTML (encoding="full" / encoding="uint8")

Show4DSTEM

quantem.widget.Show4DSTEM dispatcher

state JSON, PNG, interactive WebGPU HTML; large exports use a companion data directory

ShowEDS

quantem.widget.showeds.ShowEDS

state JSON, interactive HTML; large exact data use folder export, portable demos use downsampled HTML

ShowDiffraction

quantem.widget.showdiffraction.ShowDiffraction

state JSON, PNG, interactive HTML

ShowFolder

quantem.widget.showfolder.ShowFolder

selection JSON for selected microscopy files and folders

All widget-level HTML exports follow the HTML export protocol.