Skip to content

Class: SceneLighting ​

Experimental

The lights of one live scene (see the module comment).

Constructors ​

Constructor ​

ts
new SceneLighting(host): SceneLighting;

Experimental

Parameters ​

ParameterType
hostSceneLightingHost

Returns ​

SceneLighting

Accessors ​

rig ​

Get Signature ​

ts
get rig():
  | LightRig
  | null;

Experimental

The rig, once created (the default rig when the scene sets no lighting).

Returns ​

| LightRig | null


spec ​

Get Signature ​

ts
get spec():
  | LightingSpec
  | null;

Experimental

The scene's lighting as a render spec, or null when unset (Plotly's per-trace lights).

Returns ​

| LightingSpec | null

Methods ​

dispose() ​

ts
dispose(): void;

Experimental

Free the rig (a later sync or use creates a new one).

Returns ​

void


restore() ​

ts
restore(): void;

Experimental

The WebGL context was lost and restored: draw the rig's environment map again.

Returns ​

void


sync() ​

ts
sync(
   full,
   aspect,
   renderer,
   invalidate?
): void;

Experimental

Take the scene's defaulted container (fullLayout.sceneN), the axis box's aspect ratio, the renderer and a redraw request (environment images load asynchronously).

Parameters ​

ParameterType
fullReadonly<Record<string, unknown>>
aspectreadonly [number, number, number]
rendererWebGLRenderer | null | undefined
invalidate?() => void

Returns ​

void


use() ​

ts
use(mesh): () => void;

Experimental

Light mesh with the scene's rig (now and whenever it changes). Returns the function that stops it (call it when the mesh is disposed).

Parameters ​

ParameterType
meshLightRigUser

Returns ​

() => void

Released under the MIT License.