Anywidget widgets¶
Notebook widgets (Jupyter, marimo) for building your own layout around a
CellierController. Each one reads and writes the controller's models
through its event bus. The convenience API's controls= models build these
for you; the same widgets for Qt are on the Qt page.
A widget for one appearance field (a toggle, a spin box, a colour) lists only
what it adds; what they all share (widget, close, subscription_specs,
visual_ids, field, control) is documented once, on
AnywidgetAppearanceField under Building blocks.
Dims¶
The canvas itself comes from build_canvas_widget, which pairs it with this panel.
cellier.gui.anywidget.AnywidgetDimsPanel ¶
Bases: AnyWidget
Renders per-axis slice sliders and an optional 2D/3D toggle button.
CellierController.connect_widget wires it the same way as the Qt
QtDimsControl.
The toggle button is included automatically when constructed with
axes_2d/axes_3d (see from_scene), e.g. omitted for a scene
with fewer than 3 axes.
Construct via from_scene, then wire with:
dims = AnywidgetDimsPanel.from_scene(scene, axis_values)
controller.connect_widget(dims, subscription_specs=dims.subscription_specs())
axis_values
class-attribute
instance-attribute
¶
Axis index (str) to that axis's serialised AxisValues.
discrete_index
class-attribute
instance-attribute
¶
Axis index (str) to the slider position of each discrete axis.
Derived here from slice_indices whenever it changes, so the rule for
which listed value a between-values position shows lives in Python
(nearest_value_index) rather than being
copied into dims_panel.js.
slider_axes
class-attribute
instance-attribute
¶
World axes that get a slider when not displayed; None means all.
Read from scene.slider_axes and kept current by
SliderAxesChangedEvent.
thickness
class-attribute
instance-attribute
¶
Axis index (str) to that axis's half-thickness, in world units.
One entry per axis that has a thickness box; 0 is a plane. The scene's thickness is the only thickness in the slicing path.
thickness_axes
class-attribute
instance-attribute
¶
World axes whose slider row gets a "±" half-thickness box.
throttle_ms
class-attribute
instance-attribute
¶
How often a slider drag reaches the bus, in ms.
Synced rather than hard-coded in the front end, so this panel and the
Qt QtDimsControl coalesce drags at the same rate by default.
from_scene
classmethod
¶
from_scene(scene: Scene, axis_values: Mapping[int, AxisValues]) -> AnywidgetDimsPanel
Build a dims panel from a live scene.
Includes the 2D/3D toggle when the scene declares both render modes
and has an axis to add to a 2D view. It starts from the scene's
displayed axes; the mode not shown yet gets a default. From 2D, the
3D set adds the last remaining "space" axis in world order (any
remaining axis when no space axis is left); from 3D, the 2D set is
the last two displayed axes in world order. The default is replaced
once the scene has shown that mode. A scene that
renders only one way -- each panel of an OrthoViewer -- gets no
toggle, because there is nothing to switch to.
close ¶
Unsubscribe from the bus and release the widget.
closed tells the controller to drop this widget's subscriptions;
the rest actually releases the widget. Both are needed:
ipywidgets holds every widget, and every widget's layout, in a
process-global table that only close() clears.
Image¶
cellier.gui.anywidget.visuals.AnywidgetImageControls ¶
Bases: VisualIdGroup, AnyWidget
Bidirectional image appearance control for the anywidget GUI.
One control per image visual (or per group of OrthoViewer panel
siblings). From the top:
- a shared section: visibility, blending and interpolation;
- a "Composite channels" switch, shown only when the visual has a channel axis;
- one page per mode: the single appearance's rows, or, when compositing, one group of rows per channel.
Each page shows the rows its values ask for (colormap, contrast, opacity, render mode, ...). A row that only means something for some render modes, or only in 3D, hides itself; n_displayed_dimensions and scene_ids keep the 3D rule current. A MaskedImage adds its surface and 2D band rows to the single page.
Build the starting state with cellier.gui.image_control_values, then
wire to the controller after construction:
values = image_control_values(visual, fields=["color_map", "clim"])
control = AnywidgetImageControls(visual.id, values, scene_ids=[scene.id])
controller.connect_widget(
control, subscription_specs=control.subscription_specs()
)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
The visual, or an |
required |
values
|
dict[str, Any]
|
The control's starting state: a dict of the visual's current
appearance values, page by page ( |
required |
title
|
str | None
|
The heading. Defaults to |
None
|
n_displayed_dimensions
|
int
|
How many dimensions the driven visuals' scenes display now, 2 or 3. Seeds the rows that are shown only in 3D. Default 3, which shows them. |
3
|
scene_ids
|
Sequence[UUID]
|
The scenes to follow: after construction the control takes
|
()
|
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
channels
class-attribute
instance-attribute
¶
Channel index (str) to that channel's values.
decimals
class-attribute
instance-attribute
¶
Decimal places for the contrast limits and the iso threshold.
threshold_modes
class-attribute
instance-attribute
¶
threshold_modes = traitlets.List(list(THRESHOLD_MODES)).tag(sync=True)
Render modes that show the threshold row (in 3D).
attenuation_modes
class-attribute
instance-attribute
¶
attenuation_modes = traitlets.List(list(ATTENUATION_MODES)).tag(sync=True)
Render modes that show the attenuation row (in 3D).
projection
class-attribute
instance-attribute
¶
How many dimensions the scene displays (2 or 3). Python to JS only.
masked
class-attribute
instance-attribute
¶
Whether the control drives a MaskedImage (its own row rule).
labels
class-attribute
instance-attribute
¶
Row label overrides, field to label (a MaskedImage's units).
threshold_range
class-attribute
instance-attribute
¶
Threshold slider bounds; empty uses clim_range.
thickness_range
class-attribute
instance-attribute
¶
A MaskedImage's thickness slider bounds, world units.
min_width_range
class-attribute
instance-attribute
¶
min_width_range = traitlets.List(list(MIN_WIDTH_RANGE)).tag(sync=True)
A MaskedImage's minimum band width bounds and step, pixels.
int_ranges
class-attribute
instance-attribute
¶
A MaskedImage's integer rows' bounds, field to [min, max].
choices
class-attribute
instance-attribute
¶
A MaskedImage's choice rows' options, field to list.
Any visual¶
cellier.gui.anywidget.visuals.AnywidgetVisibleToggle ¶
Bases: AnywidgetToggle
Show or hide the visual.
Mirrors QtVisibleToggle. visible exists on every appearance model,
so this control applies to every visual type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetOpacitySlider ¶
Bases: AnywidgetBoundedSlider
Master opacity multiplier.
Applies to every visual type -- opacity is on
BaseAppearance. It is also the only appearance field
carrying ge/le, which is why it is the only bounded
slider: the range is read off the model rather than picked.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetUniformColorPicker ¶
Bases: AnywidgetColorPicker
Uniform RGBA colour.
One class for mesh, points and lines: they spell the field
color alike, so the control is shared rather than
triplicated. Only used when the visual's color_mode is
"uniform"; per-vertex colours come from the data store.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetAABBWidget ¶
Bases: VisualIdGroup, AnyWidget
Bidirectional AABB parameter controls wired to the event bus.
Mirrors QtAABBWidget: an enabled checkbox, a line_width number
input, and a color swatch, sharing one UUID so a single subscription
covers all three fields.
Wire to the controller after construction:
aabb = AnywidgetAABBWidget(visual_id, initial_enabled=True, ...)
controller.connect_widget(aabb, subscription_specs=aabb.subscription_specs())
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual whose |
required |
initial_enabled
|
bool
|
Starting value for the enabled checkbox. Default |
False
|
initial_line_width
|
float
|
Starting value for the line_width input. Default |
2.0
|
initial_color
|
str
|
Starting CSS color string for the color swatch. Default |
'#ffffff'
|
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
DEFAULT_TITLE
class-attribute
instance-attribute
¶
Name shown when no title= is given.
The same title the built-in viewers pass when they build this widget.
title
class-attribute
instance-attribute
¶
title = traitlets.Unicode(DEFAULT_TITLE).tag(sync=True)
What this control calls itself, drawn by its own front end.
A control names itself rather than being named by whatever lays it out, which is what lets the dock stack controls and stop.
close ¶
Unsubscribe from the bus and release the widget.
closed tells the controller to drop this widget's subscriptions;
the rest actually releases the widget. Both are needed:
ipywidgets holds every widget, and every widget's layout, in a
process-global table that only close() clears.
Planes¶
The data these are built from comes from the toolkit-neutral helpers.
cellier.gui.anywidget.visuals.AnywidgetClippingPlanesControls ¶
Bases: VisualIdGroup, AnyWidget
A visual's clipping planes: one row per plane, and an add button.
Each row has an enabled checkbox, a flip button, a remove button, the
normal and a position slider along the normal. The normal has one
column per data axis: two buttons named after the axis as the store's
coordinate system gives it (+z and -z) that face the plane
along the axis, and under them the normal's entry on it. Values are in
the visual's data coordinates. Given gizmo_target, a row also has a "Gizmo"
toggle that puts a gizmo on its plane in the 3D canvas; one plane of a
canvas has it at a time.
The front end reports an action by setting edit to
{"action", "index", "value", "serial"}; the Python side applies it
and syncs rows back. A refused edit comes back as error with
rows unchanged. rows and error are written by the Python
side only; a value a host writes into them is put back. An update is sent only when the planes differ from
the ones held, so a host that delivers one edit twice sends one.
Wire to the controller after construction:
data = get_clipping_planes_data_from_visual(visual, store)
controls = AnywidgetClippingPlanesControls(visual.id, **data)
controller.connect_widget(
controls, subscription_specs=controls.subscription_specs()
)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
The visual, or a group of them (an |
required |
coordinate_system
|
UUID | str
|
The level-0 data coordinate system of the store they read (its id). |
required |
axis_names
|
Sequence[str]
|
The data axis names, in order. |
required |
bounds
|
Sequence[Sequence[float]]
|
|
required |
planes
|
Sequence[Mapping[str, Any]]
|
One row per plane of |
()
|
data_store_id
|
UUID | str | None
|
The store the visuals read. |
None
|
bounds_source
|
Callable[[], Sequence[Sequence[float]]] | None
|
Reads the store's current |
None
|
gizmo_target
|
ClippingPlaneGizmoTarget | None
|
Where a plane's gizmo is drawn (a |
None
|
gizmo_plane
|
ClippingPlaneGizmoTarget | None
|
Where a plane's gizmo is drawn (a |
None
|
gizmo_blocked
|
ClippingPlaneGizmoTarget | None
|
Where a plane's gizmo is drawn (a |
None
|
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
DEFAULT_TITLE
class-attribute
instance-attribute
¶
Name shown when no title= is given.
widget
property
¶
widget: AnywidgetClippingPlanesControls
An AnyWidget is itself the embeddable element.
cellier.gui.anywidget.visuals.AnywidgetRenderPlanesControls ¶
Bases: VisualIdGroup, AnyWidget
A visual's render planes: one row per plane, and an add button.
The planes a visual in the "plane" render mode draws its data on.
Each row is a "Clipping planes" row with the extents added: an enabled
checkbox, a flip button, a remove button, the normal (two buttons and an
entry per axis of the plane), a position slider along the normal, and
for each of the plane's two in-plane axes a minimum and a maximum, each
with an "unbounded" box. Values are in world units. Given
gizmo_target, a row also has a "Gizmo" toggle that puts the canvas's
gizmo on its plane; one plane of a canvas has it at a time, clipping
planes included.
An edit is sent as RenderPlanesUpdateEvent with the whole new
tuple, and only when the planes differ from the ones held. An edit the
model refuses is shown as an error and the rows keep their previous
values.
Wire to the controller after construction:
data = get_render_planes_data_from_visual(controller, visual.id)
controls = AnywidgetRenderPlanesControls(visual.id, **data)
controller.connect_widget(
controls, subscription_specs=controls.subscription_specs()
)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
The visual, or a group of them, edited together. |
required |
coordinate_system
|
UUID | str
|
The scene's world coordinate system (its id). |
required |
axis_ids
|
Sequence[str]
|
The world axes, in order: their ids and names. |
required |
axis_names
|
Sequence[str]
|
The world axes, in order: their ids and names. |
required |
planes
|
Sequence[Any]
|
The visual's current |
()
|
displayed_axes
|
Sequence[str] | None
|
What the scene and the visual's data are now, and a reader of it:
|
None
|
bounds
|
Sequence[str] | None
|
What the scene and the visual's data are now, and a reader of it:
|
None
|
state_source
|
Sequence[str] | None
|
What the scene and the visual's data are now, and a reader of it:
|
None
|
scene_id
|
Sequence[str] | None
|
What the scene and the visual's data are now, and a reader of it:
|
None
|
data_store_id
|
Sequence[str] | None
|
What the scene and the visual's data are now, and a reader of it:
|
None
|
gizmo_target
|
RenderPlaneGizmoTarget | None
|
Where a plane's gizmo is drawn (a |
None
|
gizmo_plane
|
RenderPlaneGizmoTarget | None
|
Where a plane's gizmo is drawn (a |
None
|
gizmo_blocked
|
RenderPlaneGizmoTarget | None
|
Where a plane's gizmo is drawn (a |
None
|
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
DEFAULT_TITLE
class-attribute
instance-attribute
¶
Name shown when no title= is given.
widget
property
¶
widget: AnywidgetRenderPlanesControls
An AnyWidget is itself the embeddable element.
Level of detail and loading¶
cellier.gui.anywidget.visuals.AnywidgetLevelOfDetailControls ¶
Bases: VisualIdGroup, AnyWidget
Settled bias slider and "coarsest while moving" checkbox.
Mirrors QtLevelOfDetailControls. The front end shows one checkbox,
bound to coarsest_while_moving_3d while n_displayed_dimensions is
3 and to coarsest_while_moving_2d otherwise. The bias is sent on a
settled change of the slider, not while it is dragged, because a
bias change reslices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
The visual the control drives, or a sequence driven in lock-step. |
required |
values
|
Mapping[str, Any] | None
|
The appearance's current values, keyed by field name:
|
None
|
n_displayed_dimensions
|
int
|
What the view displays now, 2 or 3. |
3
|
scene_ids
|
Sequence[UUID]
|
Scenes whose |
()
|
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
widget
property
¶
widget: AnywidgetLevelOfDetailControls
An AnyWidget is itself the embeddable element.
cellier.gui.anywidget.visuals.AnywidgetLoadingIndicator ¶
Bases: VisualIdGroup, AnyWidget
How far a multiscale visual's data has loaded.
Mirrors QtLoadingIndicator: a bar of target chunks resident over
needed, and a status line, under a heading titled title. Read-only:
it listens to ResliceProgressEvent and emits nothing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
The visual, or a group of them, shown summed. |
required |
initial
|
Mapping[UUID, LoadingProgress | None] | None
|
Their progress now, so an indicator built mid-load starts right. |
None
|
levels
|
bool
|
The visuals are meshes: the status line names levels ("Loading coarse level"), not chunk counts. |
False
|
cellier.gui.anywidget.visuals.AnywidgetLoadingConfigControls ¶
Bases: VisualIdGroup, AnyWidget
Every ProgressiveLoadingConfig field of a multiscale visual.
Mirrors QtLoadingConfigControls. The front end draws one row per
entry of fields from the values in config, and reports an edit
by setting edit; a refused edit comes back as error, with
config unchanged.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
The visual, or a group of them, edited together. |
required |
loading
|
Mapping[str, Any]
|
The current config, as |
required |
n_levels
|
int | None
|
The visual's level count, the most "Backstop level" offers. |
None
|
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
DEFAULT_TITLE
class-attribute
instance-attribute
¶
Name shown when no title= is given.
widget
property
¶
widget: AnywidgetLoadingConfigControls
An AnyWidget is itself the embeddable element.
cellier.gui.anywidget.visuals.AnywidgetLodConfigControls ¶
Bases: VisualIdGroup, AnyWidget
The level-of-detail settings of a multiscale mesh.
The notebook counterpart of cellier.gui.qt.visuals.QtLodConfigControls: one
row per GeometryLodConfig field. An edit the model refuses is shown
as an error and the row keeps its previous value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
The visual, or a group of them, edited together. |
required |
lod
|
Mapping[str, Any]
|
The current config, as |
required |
Labels¶
cellier.gui.anywidget.visuals.AnywidgetLabelsRenderModeCombo ¶
Bases: AnywidgetChoice
How label voxels are rendered in 3D.
Offers the five labels render modes: iso_categorical,
flat_categorical, smooth_iso, smooth_geometry and
plane. The in-memory and multiscale labels models both accept all
five. Distinct from the image render-mode control, whose modes differ.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetBackgroundLabelSpin ¶
Bases: AnywidgetIntSpin
Label id rendered as transparent.
The range spans the label dtype: stores are int32 and
nothing forbids a negative id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetSaltSpin ¶
Bases: AnywidgetIntSpin
Hash seed for the random label colormap.
The number itself is meaningless -- only the colouring it produces matters -- so this control carries a shuffle button that writes a random seed in range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetSmoothGeometryLevelSlider ¶
Bases: AnywidgetBoundedSlider
Where the smooth_geometry surface sits.
The share of the blended weight a label must carry. Lower grows every label, higher shrinks it; 0.5 puts flat sides on the voxel faces. No effect in the other render modes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically
|
None
|
Points¶
cellier.gui.anywidget.visuals.AnywidgetSizeSpin ¶
Bases: AnywidgetFloatSpin
Uniform point size, in size_space units.
The default range is in screen pixels. With size_space="world"
the useful range depends on the data extent, and value_range= is
the escape hatch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetSizeSpaceCombo ¶
Bases: AnywidgetChoice
Coordinate space point size is interpreted in.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
Lines¶
cellier.gui.anywidget.visuals.AnywidgetThicknessSpin ¶
Bases: AnywidgetFloatSpin
Line thickness, in thickness_space units.
Screen pixels by default; see *SizeSpin for the world
case.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetThicknessSpaceCombo ¶
Bases: AnywidgetChoice
Coordinate space line thickness is interpreted in.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
Meshes¶
cellier.gui.anywidget.visuals.AnywidgetMeshSectionControls ¶
Bases: VisualIdGroup, AnyWidget
How a mesh is drawn in a 2D view: every MeshSectionConfig field.
The notebook counterpart of cellier.gui.qt.visuals.QtMeshSectionControls: one
row per field. An edit the model refuses is shown as an error and the
row keeps its previous value. The control hides itself while none of
the scenes in displayed_dimensions displays two dimensions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
The mesh visual, or a group of them, edited together. |
required |
section
|
Mapping[str, Any]
|
The current config, as |
required |
displayed_dimensions
|
Mapping[UUID, int] | None
|
Scene id to how many dimensions it displays now (2 or 3, from
|
None
|
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
DEFAULT_TITLE
class-attribute
instance-attribute
¶
Name shown when no title= is given.
widget
property
¶
widget: AnywidgetMeshSectionControls
An AnyWidget is itself the embeddable element.
cellier.gui.anywidget.visuals.AnywidgetFlatShadingToggle ¶
Bases: AnywidgetToggle
Use face normals instead of smooth vertex normals. Phong meshes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetShininessSpin ¶
Bases: AnywidgetFloatSpin
Phong specular exponent. Phong meshes.
128 is the conventional practical ceiling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetSideCombo ¶
Bases: AnywidgetChoice
Which face windings are drawn.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetWireframeToggle ¶
Bases: AnywidgetToggle
Draw the mesh as edges only. Flat meshes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetWireframeThicknessSpin ¶
Bases: AnywidgetFloatSpin
Edge thickness of the mesh wireframe, in screen pixels.
Below 0.1 the wireframe is invisible; above roughly 20 it swamps the mesh.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
Graphs¶
cellier.gui.anywidget.visuals.AnywidgetNodeVisibleToggle ¶
Bases: AnywidgetToggle
Show the node sub-visual. Nests under visible.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetNodeColorPicker ¶
Bases: AnywidgetColorPicker
Uniform RGBA node colour.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetNodeSizeSpin ¶
Bases: AnywidgetFloatSpin
Uniform node size, in node_size_space units.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetNodeSizeSpaceCombo ¶
Bases: AnywidgetChoice
Coordinate space node size is interpreted in.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetEdgeVisibleToggle ¶
Bases: AnywidgetToggle
Show the edge sub-visual. Nests under visible.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetEdgeColorPicker ¶
Bases: AnywidgetColorPicker
Uniform RGBA edge colour.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetEdgeThicknessSpin ¶
Bases: AnywidgetFloatSpin
Edge thickness, in edge_thickness_space units.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetEdgeThicknessSpaceCombo ¶
Bases: AnywidgetChoice
Coordinate space edge thickness is interpreted in.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically |
None
|
cellier.gui.anywidget.visuals.AnywidgetTrailControls ¶
Bases: VisualIdGroup, AnyWidget
Trail-window controls for one or more data axes of a graph visual.
Mirrors QtTrailControls: per offered axis, whether it has a window,
how far the window reaches before and after the slice position, and
whether it fades.
The browser holds one windows dict keyed by the axis index as a
string. Python keeps the full TrailConfig per axis beside it, so the
fields the control does not show survive every edit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
The graph visual whose trail this widget controls. A sequence drives
every listed visual in lock-step, as on an |
required |
axes
|
Sequence[tuple[int, str]]
|
|
required |
trail
|
Mapping[int, TrailConfig]
|
The visual's current |
required |
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
DEFAULT_TITLE
class-attribute
instance-attribute
¶
Name shown when no title= is given.
The same title the built-in viewers pass when they build this widget.
offered_axes
property
¶
The data axes this widget offers, in display order.
window ¶
window(axis: int) -> TrailConfig
The window axis has, or last had before it was switched off.
Render settings¶
One panel per section of the canvas render config: ambient occlusion, outlines and temporal accumulation.
cellier.gui.anywidget.AnywidgetRenderConfigPanel ¶
Bases: AnyWidget
Base for a notebook panel driving one section of the render config.
Subclasses set section and pass the live config section to
super().__init__.
Wire to the controller after construction:
panel = AnywidgetAmbientOcclusionControls(
controller.render_config.ambient_occlusion
)
controller.connect_widget(panel, subscription_specs=panel.subscription_specs())
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
Any
|
The live config section this panel drives (for example
|
required |
title
|
str
|
Heading drawn above the panel. Empty (the default) draws none. |
''
|
slot_usage
|
Zero-argument callable returning |
None
|
|
**kwargs
|
Passed to |
{}
|
close ¶
Unsubscribe from the bus and release the widget.
closed tells the controller to drop this widget's
subscriptions; the rest actually releases the widget. Both are
needed: ipywidgets holds every widget, and every widget's
layout, in a process-global table that only close() clears.
cellier.gui.anywidget.AnywidgetAmbientOcclusionControls ¶
Bases: AnywidgetRenderConfigPanel
Ambient occlusion settings for the notebook GUI.
See cellier.gui.qt.QtAmbientOcclusionControls for what the radius
means and why it is derived from the scene by default.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
AmbientOcclusionConfig
|
The live |
required |
effective_radius
|
Callable[[], float | None] | None
|
Called to read the radius actually in use, in scene units. |
None
|
close ¶
Unsubscribe from the bus and release the widget.
closed tells the controller to drop this widget's
subscriptions; the rest actually releases the widget. Both are
needed: ipywidgets holds every widget, and every widget's
layout, in a process-global table that only close() clears.
cellier.gui.anywidget.AnywidgetOutlineControls ¶
Bases: AnywidgetRenderConfigPanel
Screen-space outline settings for the notebook GUI.
See cellier.gui.qt.QtOutlineControls for what the two
layers are and why the selection layer has no colour control.
close ¶
Unsubscribe from the bus and release the widget.
closed tells the controller to drop this widget's
subscriptions; the rest actually releases the widget. Both are
needed: ipywidgets holds every widget, and every widget's
layout, in a process-global table that only close() clears.
cellier.gui.anywidget.AnywidgetTemporalControls ¶
Bases: AnywidgetRenderConfigPanel
Temporal accumulation settings for the notebook GUI.
See cellier.gui.qt.QtTemporalControls for what the pass
does and why the convergence readout is worth its space.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
TemporalAccumulationConfig
|
The live |
required |
frame_count
|
Callable[[], int | None] | None
|
Called to read how many frames have accumulated on the
least-converged canvas. |
None
|
on_reset
|
Callable[[], None] | None
|
Called when the user asks to discard the accumulated history. An
action rather than a setting, so it does not travel on the bus.
|
None
|
close ¶
Unsubscribe from the bus and release the widget.
closed tells the controller to drop this widget's
subscriptions; the rest actually releases the widget. Both are
needed: ipywidgets holds every widget, and every widget's
layout, in a process-global table that only close() clears.
Dataset info¶
What it shows comes from dataset_info_from_path or a store's dataset_info().
cellier.gui.anywidget.AnywidgetDatasetInfo ¶
Bases: AnyWidget
Read-only display widget for dataset metadata.
Shows (label, value) rows as a table inside a collapsible
<details> block. A sectioned DatasetInfo passed to
from_info also draws nested blocks and matrix tables (a store's
affine, its per-level shapes), the same content QtDatasetInfo shows.
The rows cross to the front end as data and are written with
textContent, not as markup: a value carrying < or & -- a path,
a dtype, anything read off a store -- is displayed, never parsed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
Sequence[tuple[str, str]]
|
|
()
|
DEFAULT_TITLE
class-attribute
instance-attribute
¶
Name shown when no title= is given.
The same title the built-in viewers pass when they build this widget.
title
class-attribute
instance-attribute
¶
title = traitlets.Unicode(DEFAULT_TITLE).tag(sync=True)
What this control calls itself, drawn by its own front end.
A control names itself rather than being named by whatever lays it out, which is what lets the dock stack controls and stop.
rows
class-attribute
instance-attribute
¶
[[label, value], ...], the synced form of the rows argument.
sections
class-attribute
instance-attribute
¶
The synced form of a DatasetInfo's sections.
Empty for a widget built from plain rows, which the front end then
draws as a single flat table. When both are set, sections wins:
it is the richer description of the same data.
section_labels ¶
The sections drawn, in the order they are drawn.
The twin of cellier.gui.qt.QtDatasetInfo.section_labels, and
it exists for the same reason: one DatasetInfo must draw the same
way on both front ends, and nothing else makes that checkable.
An unlabelled section is named by its first row's label, matching what a reader actually sees at the top of the block.
from_info
classmethod
¶
from_info(info: DatasetInfo, *, title: str | None = None) -> AnywidgetDatasetInfo
Build from a sectioned DatasetInfo.
The anywidget twin of QtDatasetInfo.from_info; the two draw the
same sections in the same order.
from_store
classmethod
¶
from_store(store, *, title: str | None = None) -> AnywidgetDatasetInfo
Construct from any data store, by asking it to describe itself.
Containers¶
Layout containers that hold other widgets in a notebook output.
cellier.gui.anywidget.AnywidgetBox ¶
Bases: AnyWidget
A flexbox container that mounts child widget views via the manager.
Jupyter only: the children are mounted through the Jupyter widget
manager, which marimo does not have. On marimo use AnywidgetSlot,
or marimo's own mo.vstack / mo.hstack.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
children
|
list of ipywidgets.DOMWidget
|
The child widgets to mount, in order. |
required |
direction
|
'v' or 'h'
|
Stacking direction: |
required |
align
|
str
|
Cross-axis alignment applied as CSS |
required |
min_width
|
int
|
When set (> 0), the box grows to fill available space but never
narrower than this many pixels ( |
required |
gap
|
int
|
Spacing between children in pixels. Defaults to |
required |
padding
|
int
|
Inner padding in pixels, on all four sides. Defaults to |
required |
title
|
str
|
A heading drawn above the children, naming what the box holds. Empty
(the default) draws nothing. The anywidget counterpart of
|
required |
scroll
|
bool
|
Scroll the children vertically within the height of the row the box
sits in, instead of making that row as tall as the children. For a
side dock: the canvas column beside it sets the height, and a long
controls column scrolls rather than stretching the output (or the
sidecar) past the canvas. The box keeps its content width, and never
gets shorter than |
required |
scroll_min_height
|
int
|
The least height of a scrolling box, in pixels. Defaults to
|
required |
SCROLL_MIN_HEIGHT
class-attribute
instance-attribute
¶
The least height a scrolling box takes, in pixels.
Keeps a small canvas from squeezing a dock to a sliver; a shorter row grows to it.
close ¶
Close this box and every widget beneath it.
A container is the only thing holding the composed tree, so closing it
has to close the children too or the whole panel stays registered with
ipywidgets, which holds every widget in a process-global table
that only close() clears. children is cleared first so the
box does not keep them reachable afterwards.
Widget.close() no-ops once the comm is gone, so a child that is
also closed some other way (by the layout that displayed it, say) is
safe to reach twice.
cellier.gui.anywidget.AnywidgetSlot ¶
Bases: AnyWidget
A column whose children can be replaced after it is displayed.
AnywidgetBox mounts children through the Jupyter widget manager's
create_view, renders once, and does not exist on marimo. This mounts
them through anywidget's composition API (host.getWidget), which both
Jupyter and marimo implement, and remounts whenever children changes.
That is what lets a dock follow the viewer on either host.
Children must be anywidgets, and must not be AnywidgetBox instances:
a box nested in a slot on marimo would fall back to create_view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
children
|
list of anywidget.AnyWidget
|
The widgets to show, top to bottom. Assign a new list to replace them; the slot does not close the widgets it stops showing. |
required |
gap
|
int
|
Spacing between children in pixels. |
required |
title
|
str
|
A heading drawn above the children. Empty draws nothing. |
required |
Building blocks¶
The generic controls the widgets above are made from: each drives one appearance field of a type (boolean, choice, number, colour) on one or more visuals. Use them for a field that has no named widget.
cellier.gui.anywidget.visuals.AnywidgetAppearanceField ¶
Bases: AnyWidget
Bidirectional control for one appearance field on one or more visuals.
Mirrors QtAppearanceField: same constructor keyword, same
visual_id fan-out, same echo filtering, same outgoing event.
Wire to the controller after construction:
toggle = AnywidgetVisibleToggle(visual_id, initial_value=True)
controller.connect_widget(
toggle, subscription_specs=toggle.subscription_specs()
)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_id
|
UUID | Sequence[UUID]
|
UUID of the visual whose field this widget controls, or a sequence of UUIDs to drive as one group. |
required |
initial_value
|
Any
|
Starting value -- typically read off the visual's appearance model.
|
None
|
control
property
¶
control: AnywidgetAppearanceField
The bare input, under the name the Qt twin uses.
On Qt the control sits inside a labelled row, so widget and
control are different objects. Here the widget is the control --
the input lives in JavaScript -- so both return self. Providing
the name anyway is what lets a caller reach for the input without
asking which toolkit it has.
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
close ¶
Unsubscribe from the bus and release the widget.
closed tells the controller to drop this widget's subscriptions;
the rest actually releases the widget. Both are needed:
ipywidgets holds every widget, and every widget's layout, in a
process-global table that only close() clears.
cellier.gui.anywidget.visuals.AnywidgetToggle ¶
Bases: AnywidgetAppearanceField
Layer 2: a checkbox for a boolean appearance field.
control
property
¶
control: AnywidgetAppearanceField
The bare input, under the name the Qt twin uses.
On Qt the control sits inside a labelled row, so widget and
control are different objects. Here the widget is the control --
the input lives in JavaScript -- so both return self. Providing
the name anyway is what lets a caller reach for the input without
asking which toolkit it has.
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
close ¶
Unsubscribe from the bus and release the widget.
closed tells the controller to drop this widget's subscriptions;
the rest actually releases the widget. Both are needed:
ipywidgets holds every widget, and every widget's layout, in a
process-global table that only close() clears.
cellier.gui.anywidget.visuals.AnywidgetChoice ¶
Bases: AnywidgetAppearanceField
Layer 2: a select for a Literal field.
Each subclass writes its options out in _default_choices; a test
checks every list against its model's Literal so the two cannot
drift. choices= replaces the list for one widget.
control
property
¶
control: AnywidgetAppearanceField
The bare input, under the name the Qt twin uses.
On Qt the control sits inside a labelled row, so widget and
control are different objects. Here the widget is the control --
the input lives in JavaScript -- so both return self. Providing
the name anyway is what lets a caller reach for the input without
asking which toolkit it has.
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
close ¶
Unsubscribe from the bus and release the widget.
closed tells the controller to drop this widget's subscriptions;
the rest actually releases the widget. Both are needed:
ipywidgets holds every widget, and every widget's layout, in a
process-global table that only close() clears.
cellier.gui.anywidget.visuals.AnywidgetFloatSpin ¶
Bases: AnywidgetAppearanceField
Layer 2: a number input for an unbounded float field.
Mirrors QtFloatSpin, including that its range is a widget bound
someone picked rather than a model constraint, and is overridable.
control
property
¶
control: AnywidgetAppearanceField
The bare input, under the name the Qt twin uses.
On Qt the control sits inside a labelled row, so widget and
control are different objects. Here the widget is the control --
the input lives in JavaScript -- so both return self. Providing
the name anyway is what lets a caller reach for the input without
asking which toolkit it has.
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
close ¶
Unsubscribe from the bus and release the widget.
closed tells the controller to drop this widget's subscriptions;
the rest actually releases the widget. Both are needed:
ipywidgets holds every widget, and every widget's layout, in a
process-global table that only close() clears.
cellier.gui.anywidget.visuals.AnywidgetIntSpin ¶
Bases: AnywidgetAppearanceField
Layer 2: a number input for an integer field, optionally with shuffle.
shuffle is a synced bool rather than a separate control type, so the
one asset still serves every integer field: int_spin.js renders the
button only when the trait is set.
control
property
¶
control: AnywidgetAppearanceField
The bare input, under the name the Qt twin uses.
On Qt the control sits inside a labelled row, so widget and
control are different objects. Here the widget is the control --
the input lives in JavaScript -- so both return self. Providing
the name anyway is what lets a caller reach for the input without
asking which toolkit it has.
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
close ¶
Unsubscribe from the bus and release the widget.
closed tells the controller to drop this widget's subscriptions;
the rest actually releases the widget. Both are needed:
ipywidgets holds every widget, and every widget's layout, in a
process-global table that only close() clears.
cellier.gui.anywidget.visuals.AnywidgetBoundedSlider ¶
Bases: AnywidgetAppearanceField
Layer 2: a slider for a float field the model bounds.
Mirrors QtBoundedSlider. min/max are synced traits so the one
bounded_slider.js asset serves every field class of this type without
knowing any field's name.
Its one documented exception carries over too:
AnywidgetIsoThresholdSlider's range is a convention rather than a model
constraint.
control
property
¶
control: AnywidgetAppearanceField
The bare input, under the name the Qt twin uses.
On Qt the control sits inside a labelled row, so widget and
control are different objects. Here the widget is the control --
the input lives in JavaScript -- so both return self. Providing
the name anyway is what lets a caller reach for the input without
asking which toolkit it has.
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
close ¶
Unsubscribe from the bus and release the widget.
closed tells the controller to drop this widget's subscriptions;
the rest actually releases the widget. Both are needed:
ipywidgets holds every widget, and every widget's layout, in a
process-global table that only close() clears.
cellier.gui.anywidget.visuals.AnywidgetColorPicker ¶
Bases: AnywidgetAppearanceField
Layer 2: an RGB colour input plus a separate alpha slider.
Mirrors QtColorPicker. The trait is the full float RGBA the model
holds; the hex conversion the <input type=color> needs happens in the
JS, from that one trait, so the Python side never speaks hex.
control
property
¶
control: AnywidgetAppearanceField
The bare input, under the name the Qt twin uses.
On Qt the control sits inside a labelled row, so widget and
control are different objects. Here the widget is the control --
the input lives in JavaScript -- so both return self. Providing
the name anyway is what lets a caller reach for the input without
asking which toolkit it has.
visual_ids
property
¶
The visual ids this widget drives, always as a tuple.
close ¶
Unsubscribe from the bus and release the widget.
closed tells the controller to drop this widget's subscriptions;
the rest actually releases the widget. Both are needed:
ipywidgets holds every widget, and every widget's layout, in a
process-global table that only close() clears.