X3DControls

Reusable browser controls for native X3DOM scenes and primitives.

Build scenes and geometry with McUtils.Plots.X3DInterface, then place this toolbar in a ReadoutHTML. Applications need no DOM scripting or HTML authoring. Targets may be native objects or explicit DOM ids. Native primitive targets resolve property aliases and their actual nodes through the native API.

The initial control values must match the initial scene attributes. For a bare X3D object in a static ReadoutScene, set scene.opts[‘id’] = scene.id; X3D.id otherwise identifies the outer wrapper created by to_widget(). Both direct X3D nodes and to_widget() wrappers are supported by reset_view().

 

__init__(self, *controls, id=None): 

 

@classmethod
switch(cls, targets, labels, *, value=0, label='Conformer', id=None): 

A select box that updates only the supplied Switch.whichChoice nodes.

 

@classmethod
slider(cls, targets, property, *, value=0, min=0, max=1, step=0.01, label=None, id=None): 

Control a scalar numeric X3D property over a configurable range.

Native objects resolve both the property alias and its owning node. Explicit DOM ids use property as the attribute name. Values are assigned directly, without property-specific transformations or formatting.

 

@classmethod
reset_view(cls, targets, *, label='Reset views', id=None): 

Reset each target X3DOM runtime once, for direct nodes or wrappers.

 

to_widget(self): 

The existing McUtils HTML element consumed by ReadoutHTML.

 

to_jhtml(self): 

 

tostring(self, **opts): 

Feedback

Examples

Templates

Documentation