UI

Source: ui.ts

Guided controls for an existing viewer, supplied by the optional 3Dmol.ui bundle.
Load that bundle after the core browser bundle and construct a StateManager
to attach controls. The manager is available as viewer.ui; its ui property
holds this control panel. Declarative embeds can instead request data-ui.


Constructor

new UI(): UI

Instance Methods

colorControls()

Shared color controls keep representation and surface choices consistent.

destroy(): void

Remove this panel and release its listeners, timers, and pending UI load.
Prefer StateManager#destroy when disposing the manager as well;
neither operation destroys the underlying viewer.

Returns

  • void

getTrajectorySettings(): TrajectorySettings

Return a snapshot of playback speed, loop state, playback state, and frame.

Returns

setControls(options: UIControlOptions): void

Enable each group of controls independently; omitted options stay unchanged.

Parameters

Returns

  • void

setOpen(open: boolean): void

Open or close the edit panel. It remains closed while edit controls are disabled.

Parameters

  • open (boolean)

Returns

  • void

setTrajectoryMinimized(minimized: boolean): void

Collapse playback to its upper-left button, preserving playback and position.

Parameters

  • minimized (boolean)

Returns

  • void

setTrajectorySettings( settings: Partial.<TrajectorySettings>, ): Promise.<void>

Apply supplied playback settings; omitted settings retain their values.
Await completion when changing the frame. Invalid frame or speed values reject.

Parameters

Returns

  • Promise.<void>

styleSettings()

Settings belong to one representation, including imported combined styles.