Skip to content

Documentation / @ripl/3d / Group3D

Class: Group3D<TEventMap> ​

Defined in: 3d/src/core/group.ts:62

A group whose transform composes into the model matrix of every Shape3D beneath it.

The plain 2D Group nests elements without a 3D transform, which is all a flat scene needs. This is the one to reach for when a subtree should orbit, tilt or scale as a unit — a solar system, an articulated arm, an exploded assembly. Groups nest, and each level composes onto the last.

The transform lives outside element state, because a group's own state is not parameterized. It therefore cannot be driven by renderer.transition; animate it from the render tick, or animate the children instead.

Example ​

ts
const arm = createGroup3D({ rotationY: Math.PI / 4 });

arm.add(createCube({ size: 1, x: 2 }));
scene.add(arm);

Extends ​

Type Parameters ​

Type ParameterDefault type
TEventMap extends ElementEventMapElementEventMap

Constructors ​

Constructor ​

new Group3D<TEventMap>(options?): Group3D<TEventMap>

Defined in: 3d/src/core/group.ts:169

Parameters ​

ParameterTypeDescription
options?Group3DOptions & GroupOptionsThe group's transform, plus anything a plain group accepts.

Returns ​

Group3D<TEventMap>

Overrides ​

Group.constructor

Properties ​

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
abstractpublicbooleanfalseWhen true, the element skips transform and drawing-state application during Element.render; used by containers such as Group.Group.abstractcore/src/core/element.ts:339
classListreadonlySet<string>undefinedSet of CSS-like class names used for querying and selection.Group.classListcore/src/core/element.ts:336
context?protectedContext<Element, Record<string, unknown>>undefined-Group.contextcore/src/core/element.ts:326
datapublicunknownundefinedArbitrary user data bound to the element, typically the datum backing a data-driven visual.Group.datacore/src/core/element.ts:348
idpublicstringundefinedUnique identifier for this element, defaulting to type:uniqueId when not supplied.Group.idcore/src/core/element.ts:330
interpolatorsprotectedElementInterpolators<TState>undefined-Group.interpolatorscore/src/core/element.ts:327
parent?publicGroup<TEventMap>undefinedThe parent Group this element is attached to, or undefined when detached.Group.parentcore/src/core/element.ts:345
pointerEventspublicElementPointerEvents'all'Controls which parts of the element respond to pointer hit testing. See ElementPointerEvents.Group.pointerEventscore/src/core/element.ts:342
stateprotectedTStateundefined-Group.statecore/src/core/element.ts:325
typereadonlystringundefinedThe element type name (e.g. circle, rect, group).Group.typecore/src/core/element.ts:333
defaultKeyreadonlytypeof defaultKeyundefinedThe key under which resources are retained when no explicit key is provided.Group.defaultKeycore/src/core/disposer.ts:11

Accessors ​

_boundsCacheable ​

Get Signature ​

get protected _boundsCacheable(): boolean

Defined in: core/src/core/group.ts:67

Group boxes compose from children, whose changes are invisible to the group's own state, they are never cached (see Element.getBoundingBox).

Returns ​

boolean

Inherited from ​

Group._boundsCacheable


$anyDirty ​

Get Signature ​

get $anyDirty(): boolean

Defined in: core/src/core/element.ts:361

Whether this element or any ancestor Group is dirty. Provided for subtree-level render skipping; the path cache uses Element.$dirty (own) because paths are authored in local space.

Returns ​

boolean

Inherited from ​

Group.$anyDirty


$dirty ​

Get Signature ​

get $dirty(): boolean

Defined in: core/src/core/element.ts:351

Whether an own state value has changed since the last render cycle. Drives per-element path-cache invalidation and is reset after each render cycle.

Returns ​

boolean

Inherited from ​

Group.$dirty


$events ​

Get Signature ​

get $events(): keyof TEventMap[]

Defined in: core/src/core/element.ts:371

The event types an element can emit. See EventBus.$events.

Returns ​

keyof TEventMap[]

Inherited from ​

Group.$events


$state ​

Get Signature ​

get $state(): Readonly<TState>

Defined in: core/src/core/element.ts:366

A shallow copy of the element's own set state values, without inherited or computed resolution. Intended for inspection and serialization (e.g. devtools); mutating the returned object has no effect on the element.

Returns ​

Readonly<TState>

Inherited from ​

Group.$state


$touched ​

Get Signature ​

get $touched(): boolean

Defined in: core/src/core/element.ts:356

Whether a state value was set since the last render cycle (the element was addressed), whether or not the value changed, so a real change also sets this. Reset after each render cycle.

Returns ​

boolean

Inherited from ​

Group.$touched


children ​

Get Signature ​

get children(): Element<Partial<BaseState>, ElementEventMap>[]

Defined in: core/src/core/group.ts:72

Returns a snapshot array of this group's direct child elements.

Returns ​

Element<Partial<BaseState>, ElementEventMap>[]

Present on container elements (e.g. Group): a snapshot of direct children.

Inherited from ​

Group.children


direction ​

Get Signature ​

get direction(): TState["direction"]

Defined in: core/src/core/element.ts:393

Text directionality used when rendering text, mirroring the canvas direction drawing-state property (inherit, ltr, or rtl).

Returns ​

TState["direction"]

Set Signature ​

set direction(value): void

Defined in: core/src/core/element.ts:397

Parameters ​
ParameterType
valueTState["direction"]
Returns ​

void

Inherited from ​

Group.direction


fill ​

Get Signature ​

get fill(): TState["fill"]

Defined in: core/src/core/element.ts:402

Fill style (color or gradient) painted inside the element, mirroring the canvas fillStyle drawing-state property.

Returns ​

TState["fill"]

Set Signature ​

set fill(value): void

Defined in: core/src/core/element.ts:406

Parameters ​
ParameterType
valueTState["fill"]
Returns ​

void

Inherited from ​

Group.fill


filter ​

Get Signature ​

get filter(): TState["filter"]

Defined in: core/src/core/element.ts:411

Filter effects applied to the element, mirroring the canvas filter drawing-state property.

Returns ​

TState["filter"]

Set Signature ​

set filter(value): void

Defined in: core/src/core/element.ts:415

Parameters ​
ParameterType
valueTState["filter"]
Returns ​

void

Inherited from ​

Group.filter


font ​

Get Signature ​

get font(): TState["font"]

Defined in: core/src/core/element.ts:420

Font used for text rendering, mirroring the canvas font drawing-state property.

Returns ​

TState["font"]

Set Signature ​

set font(value): void

Defined in: core/src/core/element.ts:424

Parameters ​
ParameterType
valueTState["font"]
Returns ​

void

Inherited from ​

Group.font


globalCompositeOperation ​

Get Signature ​

get globalCompositeOperation(): TState["globalCompositeOperation"]

Defined in: core/src/core/element.ts:438

Compositing/blend mode used to draw the element, mirroring the canvas globalCompositeOperation drawing-state property.

Returns ​

TState["globalCompositeOperation"]

Set Signature ​

set globalCompositeOperation(value): void

Defined in: core/src/core/element.ts:442

Parameters ​
ParameterType
valueTState["globalCompositeOperation"]
Returns ​

void

Inherited from ​

Group.globalCompositeOperation


lineCap ​

Get Signature ​

get lineCap(): TState["lineCap"]

Defined in: core/src/core/element.ts:447

Cap style drawn at the ends of stroked lines, mirroring the canvas lineCap drawing-state property (butt, round, or square).

Returns ​

TState["lineCap"]

Set Signature ​

set lineCap(value): void

Defined in: core/src/core/element.ts:451

Parameters ​
ParameterType
valueTState["lineCap"]
Returns ​

void

Inherited from ​

Group.lineCap


lineDash ​

Get Signature ​

get lineDash(): TState["lineDash"]

Defined in: core/src/core/element.ts:456

Dash pattern for stroked lines, mirroring the canvas line-dash array set via setLineDash.

Returns ​

TState["lineDash"]

Set Signature ​

set lineDash(value): void

Defined in: core/src/core/element.ts:460

Parameters ​
ParameterType
valueTState["lineDash"]
Returns ​

void

Inherited from ​

Group.lineDash


lineDashOffset ​

Get Signature ​

get lineDashOffset(): TState["lineDashOffset"]

Defined in: core/src/core/element.ts:465

Offset into the line-dash pattern, mirroring the canvas lineDashOffset drawing-state property.

Returns ​

TState["lineDashOffset"]

Set Signature ​

set lineDashOffset(value): void

Defined in: core/src/core/element.ts:469

Parameters ​
ParameterType
valueTState["lineDashOffset"]
Returns ​

void

Inherited from ​

Group.lineDashOffset


lineJoin ​

Get Signature ​

get lineJoin(): TState["lineJoin"]

Defined in: core/src/core/element.ts:474

Join style drawn where stroked segments meet, mirroring the canvas lineJoin drawing-state property (bevel, miter, or round).

Returns ​

TState["lineJoin"]

Set Signature ​

set lineJoin(value): void

Defined in: core/src/core/element.ts:478

Parameters ​
ParameterType
valueTState["lineJoin"]
Returns ​

void

Inherited from ​

Group.lineJoin


lineWidth ​

Get Signature ​

get lineWidth(): TState["lineWidth"]

Defined in: core/src/core/element.ts:483

Width of stroked lines in pixels, mirroring the canvas lineWidth drawing-state property.

Returns ​

TState["lineWidth"]

Set Signature ​

set lineWidth(value): void

Defined in: core/src/core/element.ts:487

Parameters ​
ParameterType
valueTState["lineWidth"]
Returns ​

void

Inherited from ​

Group.lineWidth


miterLimit ​

Get Signature ​

get miterLimit(): TState["miterLimit"]

Defined in: core/src/core/element.ts:492

Miter length limit for miter line joins, mirroring the canvas miterLimit drawing-state property.

Returns ​

TState["miterLimit"]

Set Signature ​

set miterLimit(value): void

Defined in: core/src/core/element.ts:496

Parameters ​
ParameterType
valueTState["miterLimit"]
Returns ​

void

Inherited from ​

Group.miterLimit


opacity ​

Get Signature ​

get opacity(): TState["opacity"]

Defined in: core/src/core/element.ts:429

Opacity of the element from 0 (transparent) to 1 (opaque), mapping to the canvas globalAlpha drawing-state property.

Returns ​

TState["opacity"]

Set Signature ​

set opacity(value): void

Defined in: core/src/core/element.ts:433

Parameters ​
ParameterType
valueTState["opacity"]
Returns ​

void

Inherited from ​

Group.opacity


rotation ​

Get Signature ​

get rotation(): TState["rotation"]

Defined in: core/src/core/element.ts:609

Rotation applied to the element during rendering, in radians or as a CSS-like angle string.

Returns ​

TState["rotation"]

Set Signature ​

set rotation(value): void

Defined in: core/src/core/element.ts:613

Parameters ​
ParameterType
valueTState["rotation"]
Returns ​

void

Inherited from ​

Group.rotation


rotationX ​

Get Signature ​

get rotationX(): number

Defined in: 3d/src/core/group.ts:99

The rotation around the X axis, in radians.

Returns ​

number

Set Signature ​

set rotationX(value): void

Defined in: 3d/src/core/group.ts:103

Parameters ​
ParameterType
valuenumber
Returns ​

void


rotationY ​

Get Signature ​

get rotationY(): number

Defined in: 3d/src/core/group.ts:109

The rotation around the Y axis, in radians.

Returns ​

number

Set Signature ​

set rotationY(value): void

Defined in: 3d/src/core/group.ts:113

Parameters ​
ParameterType
valuenumber
Returns ​

void


rotationZ ​

Get Signature ​

get rotationZ(): number

Defined in: 3d/src/core/group.ts:119

The rotation around the Z axis, in radians.

Returns ​

number

Set Signature ​

set rotationZ(value): void

Defined in: 3d/src/core/group.ts:123

Parameters ​
ParameterType
valuenumber
Returns ​

void


scale ​

Get Signature ​

get scale(): number

Defined in: 3d/src/core/group.ts:159

The uniform scale. Reads back the X scale; writing sets all three axes.

Returns ​

number

Set Signature ​

set scale(value): void

Defined in: 3d/src/core/group.ts:163

Parameters ​
ParameterType
valuenumber
Returns ​

void


scaleX ​

Get Signature ​

get scaleX(): number

Defined in: 3d/src/core/group.ts:129

The scale along the X axis.

Returns ​

number

Set Signature ​

set scaleX(value): void

Defined in: 3d/src/core/group.ts:133

Parameters ​
ParameterType
valuenumber
Returns ​

void


scaleY ​

Get Signature ​

get scaleY(): number

Defined in: 3d/src/core/group.ts:139

The scale along the Y axis.

Returns ​

number

Set Signature ​

set scaleY(value): void

Defined in: 3d/src/core/group.ts:143

Parameters ​
ParameterType
valuenumber
Returns ​

void


scaleZ ​

Get Signature ​

get scaleZ(): number

Defined in: 3d/src/core/group.ts:149

The scale along the Z axis.

Returns ​

number

Set Signature ​

set scaleZ(value): void

Defined in: 3d/src/core/group.ts:153

Parameters ​
ParameterType
valuenumber
Returns ​

void


shadowBlur ​

Get Signature ​

get shadowBlur(): TState["shadowBlur"]

Defined in: core/src/core/element.ts:501

Blur radius applied to the element's shadow, mirroring the canvas shadowBlur drawing-state property.

Returns ​

TState["shadowBlur"]

Set Signature ​

set shadowBlur(value): void

Defined in: core/src/core/element.ts:505

Parameters ​
ParameterType
valueTState["shadowBlur"]
Returns ​

void

Inherited from ​

Group.shadowBlur


shadowColor ​

Get Signature ​

get shadowColor(): TState["shadowColor"]

Defined in: core/src/core/element.ts:510

Color of the element's shadow, mirroring the canvas shadowColor drawing-state property.

Returns ​

TState["shadowColor"]

Set Signature ​

set shadowColor(value): void

Defined in: core/src/core/element.ts:514

Parameters ​
ParameterType
valueTState["shadowColor"]
Returns ​

void

Inherited from ​

Group.shadowColor


shadowOffsetX ​

Get Signature ​

get shadowOffsetX(): TState["shadowOffsetX"]

Defined in: core/src/core/element.ts:519

Horizontal offset of the element's shadow, mirroring the canvas shadowOffsetX drawing-state property.

Returns ​

TState["shadowOffsetX"]

Set Signature ​

set shadowOffsetX(value): void

Defined in: core/src/core/element.ts:523

Parameters ​
ParameterType
valueTState["shadowOffsetX"]
Returns ​

void

Inherited from ​

Group.shadowOffsetX


shadowOffsetY ​

Get Signature ​

get shadowOffsetY(): TState["shadowOffsetY"]

Defined in: core/src/core/element.ts:528

Vertical offset of the element's shadow, mirroring the canvas shadowOffsetY drawing-state property.

Returns ​

TState["shadowOffsetY"]

Set Signature ​

set shadowOffsetY(value): void

Defined in: core/src/core/element.ts:532

Parameters ​
ParameterType
valueTState["shadowOffsetY"]
Returns ​

void

Inherited from ​

Group.shadowOffsetY


stroke ​

Get Signature ​

get stroke(): TState["stroke"]

Defined in: core/src/core/element.ts:537

Stroke style (color or gradient) painted along the element's outline, mirroring the canvas strokeStyle drawing-state property.

Returns ​

TState["stroke"]

Set Signature ​

set stroke(value): void

Defined in: core/src/core/element.ts:541

Parameters ​
ParameterType
valueTState["stroke"]
Returns ​

void

Inherited from ​

Group.stroke


textAlign ​

Get Signature ​

get textAlign(): TState["textAlign"]

Defined in: core/src/core/element.ts:546

Horizontal alignment of rendered text, mirroring the canvas textAlign drawing-state property.

Returns ​

TState["textAlign"]

Set Signature ​

set textAlign(value): void

Defined in: core/src/core/element.ts:550

Parameters ​
ParameterType
valueTState["textAlign"]
Returns ​

void

Inherited from ​

Group.textAlign


textBaseline ​

Get Signature ​

get textBaseline(): TState["textBaseline"]

Defined in: core/src/core/element.ts:555

Vertical baseline of rendered text, mirroring the canvas textBaseline drawing-state property.

Returns ​

TState["textBaseline"]

Set Signature ​

set textBaseline(value): void

Defined in: core/src/core/element.ts:559

Parameters ​
ParameterType
valueTState["textBaseline"]
Returns ​

void

Inherited from ​

Group.textBaseline


transformOriginX ​

Get Signature ​

get transformOriginX(): TState["transformOriginX"]

Defined in: core/src/core/element.ts:618

Horizontal origin about which transforms are applied, as a pixel value or percentage string.

Returns ​

TState["transformOriginX"]

Set Signature ​

set transformOriginX(value): void

Defined in: core/src/core/element.ts:622

Parameters ​
ParameterType
valueTState["transformOriginX"]
Returns ​

void

Inherited from ​

Group.transformOriginX


transformOriginY ​

Get Signature ​

get transformOriginY(): TState["transformOriginY"]

Defined in: core/src/core/element.ts:627

Vertical origin about which transforms are applied, as a pixel value or percentage string.

Returns ​

TState["transformOriginY"]

Set Signature ​

set transformOriginY(value): void

Defined in: core/src/core/element.ts:631

Parameters ​
ParameterType
valueTState["transformOriginY"]
Returns ​

void

Inherited from ​

Group.transformOriginY


transformScaleX ​

Get Signature ​

get transformScaleX(): TState["transformScaleX"]

Defined in: core/src/core/element.ts:591

Horizontal scale factor applied to the element during rendering (1 is unscaled).

Returns ​

TState["transformScaleX"]

Set Signature ​

set transformScaleX(value): void

Defined in: core/src/core/element.ts:595

Parameters ​
ParameterType
valueTState["transformScaleX"]
Returns ​

void

Inherited from ​

Group.transformScaleX


transformScaleY ​

Get Signature ​

get transformScaleY(): TState["transformScaleY"]

Defined in: core/src/core/element.ts:600

Vertical scale factor applied to the element during rendering (1 is unscaled).

Returns ​

TState["transformScaleY"]

Set Signature ​

set transformScaleY(value): void

Defined in: core/src/core/element.ts:604

Parameters ​
ParameterType
valueTState["transformScaleY"]
Returns ​

void

Inherited from ​

Group.transformScaleY


translateX ​

Get Signature ​

get translateX(): TState["translateX"]

Defined in: core/src/core/element.ts:573

Horizontal translation applied to the element during rendering, in pixels.

Returns ​

TState["translateX"]

Set Signature ​

set translateX(value): void

Defined in: core/src/core/element.ts:577

Parameters ​
ParameterType
valueTState["translateX"]
Returns ​

void

Inherited from ​

Group.translateX


translateY ​

Get Signature ​

get translateY(): TState["translateY"]

Defined in: core/src/core/element.ts:582

Vertical translation applied to the element during rendering, in pixels.

Returns ​

TState["translateY"]

Set Signature ​

set translateY(value): void

Defined in: core/src/core/element.ts:586

Parameters ​
ParameterType
valueTState["translateY"]
Returns ​

void

Inherited from ​

Group.translateY


x ​

Get Signature ​

get x(): number

Defined in: 3d/src/core/group.ts:69

The X position of the group's origin in world space.

Returns ​

number

Set Signature ​

set x(value): void

Defined in: 3d/src/core/group.ts:73

Parameters ​
ParameterType
valuenumber
Returns ​

void


y ​

Get Signature ​

get y(): number

Defined in: 3d/src/core/group.ts:79

The Y position of the group's origin in world space.

Returns ​

number

Set Signature ​

set y(value): void

Defined in: 3d/src/core/group.ts:83

Parameters ​
ParameterType
valuenumber
Returns ​

void


z ​

Get Signature ​

get z(): number

Defined in: 3d/src/core/group.ts:89

The Z position of the group's origin in world space.

Returns ​

number

Set Signature ​

set z(value): void

Defined in: 3d/src/core/group.ts:93

Parameters ​
ParameterType
valuenumber
Returns ​

void


zIndex ​

Get Signature ​

get zIndex(): number

Defined in: core/src/core/element.ts:564

Effective stacking order of the element, combining its own z-index with its parent Group's. Higher values render on top.

Returns ​

number

Set Signature ​

set zIndex(value): void

Defined in: core/src/core/element.ts:568

Parameters ​
ParameterType
valuenumber
Returns ​

void

Inherited from ​

Group.zIndex

Methods ​

$reset() ​

$reset(): void

Defined in: core/src/core/element.ts:1019

Resets this element's per-render-cycle change flags (Element.$dirty and Element.$touched). Called automatically at the end of each render cycle, by an element's own Element.render for leaves, and by the scene/renderer at each group pop and for the root. Consumers do not normally call this directly.

Returns ​

void

Inherited from ​

Group.$reset


add() ​

add(element): void

Defined in: core/src/core/group.ts:98

Adds one or more elements as children, re-parenting them if necessary.

Parameters ​

ParameterType
elementOneOrMore<Element<Partial<BaseState>, ElementEventMap>>

Returns ​

void

Inherited from ​

Group.add


clear() ​

clear(): void

Defined in: core/src/core/group.ts:134

Removes all children from this group.

Returns ​

void

Inherited from ​

Group.clear


clone() ​

clone(): Element<Partial<BaseState>, ElementEventMap>

Defined in: core/src/core/element.ts:762

Creates a shallow clone of this element with the same id, classes, and state.

Returns ​

Element<Partial<BaseState>, ElementEventMap>

Inherited from ​

Group.clone


closest() ​

closest<TElement>(selector): TElement | undefined

Defined in: core/src/core/element.ts:776

Returns the closest ancestor (including this element) matching the CSS-like selector, or undefined.

Type Parameters ​

Type ParameterDefault type
TElement extends Element<Partial<BaseState>, ElementEventMap>Element<Partial<BaseState>, ElementEventMap>

Parameters ​

ParameterType
selectorstring

Returns ​

TElement | undefined

Inherited from ​

Group.closest


destroy() ​

destroy(): void

Defined in: core/src/core/group.ts:189

Detaches all children (clearing their parent), then destroys this group.

Returns ​

void

Inherited from ​

Group.destroy


dispose() ​

protected dispose(key?): void

Defined in: core/src/core/disposer.ts:25

Disposes all resources under the given key, or all resources if no key is provided.

Parameters ​

ParameterType
key?PropertyKey

Returns ​

void

Inherited from ​

Group.dispose


emit() ​

Call Signature ​

emit<TEvent>(event): TEvent

Defined in: core/src/core/event-bus.ts:185

Emits an event, invoking all matching handlers and bubbling to the parent if applicable. Handlers for the event's own type run first, then EVENT_WILDCARD subscriptions.

Type Parameters ​
Type ParameterDefault type
TEvent extends Event<undefined>Event<undefined>
Parameters ​
ParameterType
eventTEvent
Returns ​

TEvent

Inherited from ​

Group.emit

Call Signature ​

emit<TEvent>(type, data): Event<TEventMap[TEvent]>

Defined in: core/src/core/event-bus.ts:186

Emits an event, invoking all matching handlers and bubbling to the parent if applicable. Handlers for the event's own type run first, then EVENT_WILDCARD subscriptions.

Type Parameters ​
Type Parameter
TEvent extends string | number | symbol
Parameters ​
ParameterType
typeTEvent
dataTEventMap[TEvent]
Returns ​

Event<TEventMap[TEvent]>

Inherited from ​

Group.emit


getBoundingBox() ​

getBoundingBox(local?): Box

Defined in: core/src/core/group.ts:179

Returns this element's bounding box: the on-screen (world) box by default, or the raw local box when local is true. The world box applies this element's own and every ancestor group's transform (mirroring the DOM's getBoundingClientRect); a rotated element yields a conservative axis-aligned box.

Parameters ​

ParameterTypeDefault valueDescription
localbooleanfalsewhen true, returns the untransformed authored geometry instead of the world box.

Returns ​

Box

Inherited from ​

Group.getBoundingBox


getComputedValue() ​

getComputedValue<TKey>(key): Partial<BaseState>[TKey]

Defined in: core/src/core/element.ts:723

Resolves a state value against the parent chain (own value, else the nearest ancestor's), the effective value an element renders with. Used where the resolved value is needed without a live context, such as computing a transition's start value.

Type Parameters ​

Type Parameter
TKey extends keyof BaseState

Parameters ​

ParameterTypeDescription
keyTKeyThe state property to resolve.

Returns ​

Partial<BaseState>[TKey]

The element's own value for key, or the nearest ancestor's when unset, else undefined.

Inherited from ​

Group.getComputedValue


getElementById() ​

getElementById<TElement>(id): TElement | undefined

Defined in: core/src/core/group.ts:163

Finds a descendant element by its unique id, or undefined if none match.

Type Parameters ​

Type ParameterDefault type
TElement extends Element<Partial<BaseState>, ElementEventMap>Element<Partial<BaseState>, ElementEventMap>

Parameters ​

ParameterType
idstring

Returns ​

TElement | undefined

Inherited from ​

Group.getElementById


getElementsByClass() ​

getElementsByClass<TElement>(classes): TElement[]

Defined in: core/src/core/group.ts:174

Returns all descendant elements that have all of the given CSS class names.

Type Parameters ​

Type ParameterDefault type
TElement extends Element<Partial<BaseState>, ElementEventMap>Element<Partial<BaseState>, ElementEventMap>

Parameters ​

ParameterType
classesOneOrMore<string>

Returns ​

TElement[]

Inherited from ​

Group.getElementsByClass


getElementsByType() ​

getElementsByType<TElement>(types): TElement[]

Defined in: core/src/core/group.ts:168

Returns all descendant elements whose type matches one of the given type names.

Type Parameters ​

Type ParameterDefault type
TElement extends Element<Partial<BaseState>, ElementEventMap>Element<Partial<BaseState>, ElementEventMap>

Parameters ​

ParameterType
typesOneOrMore<string>

Returns ​

TElement[]

Inherited from ​

Group.getElementsByType


getGroupMatrix3D() ​

getGroupMatrix3D(): Matrix4

Defined in: 3d/src/core/group.ts:197

The group's own transform, which descendants compose into their model matrices.

A shape discovers this structurally while walking its ancestors, so a plain 2D group in the chain simply does not answer and contributes nothing.

Returns ​

Matrix4


getStateValue() ​

protected getStateValue<TKey>(key): Partial<BaseState>[TKey]

Defined in: core/src/core/element.ts:686

Reads this element's own state value (no inheritance). Inherited paint now cascades through the render tree: a group applies its paint at its boundary (Context.pushGroup) and descendants pick it up from the context's copied state, so property getters return own values only, mirroring how the browser resolves computed style at paint time. Use Element.getComputedValue when the effective (inheritance-resolved) value is required outside a render pass (e.g. animation start values).

Type Parameters ​

Type Parameter
TKey extends keyof BaseState

Parameters ​

ParameterType
keyTKey

Returns ​

Partial<BaseState>[TKey]

Inherited from ​

Group.getStateValue


getWorldTransform() ​

getWorldTransform(): Matrix | null

Defined in: core/src/core/element.ts:805

The element's world transform (own and every ancestor's transform composed root-first), or null when the composition is the identity. Cached against the parent chain's state versions, so static scenes skip the matrix rebuild; any state change (or reparent) along the chain recomputes. A chain node whose transform origin resolves against an uncacheable box (a group with a string origin) bypasses the cache entirely.

Returns ​

Matrix | null

Inherited from ​

Group.getWorldTransform


graph() ​

graph(includeGroups?): Element<Partial<BaseState>, ElementEventMap>[]

Defined in: core/src/core/group.ts:139

Returns a flattened array of all descendant elements, optionally including intermediate groups.

Parameters ​

ParameterType
includeGroups?boolean

Returns ​

Element<Partial<BaseState>, ElementEventMap>[]

Inherited from ​

Group.graph


has() ​

has(type): boolean

Defined in: core/src/core/event-bus.ts:123

Returns whether there are any listeners registered for the given event type. Wildcard subscriptions (EVENT_WILDCARD) are not listeners for any concrete type, so a bus observed only through the wildcard still reports false here.

Parameters ​

ParameterType
typekeyof TEventMap

Returns ​

boolean

Inherited from ​

Group.has


interpolate() ​

interpolate(newState, interpolators?): Interpolator<void>

Defined in: core/src/core/element.ts:945

Creates an interpolator that transitions from the current state towards the target state, supporting keyframes and custom interpolator overrides.

Parameters ​

ParameterType
newStatePartial<ElementInterpolationState<TState>>
interpolatorsElementInterpolators<TState>

Returns ​

Interpolator<void>

Inherited from ​

Group.interpolate


intersectsWith() ​

intersectsWith(x, y, options?): boolean

Defined in: core/src/core/element.ts:940

Tests whether a point intersects this element's bounding box. Override for custom hit testing.

Parameters ​

ParameterTypeDescription
xnumberX coordinate in logical space (CSS pixels relative to the context's top-left), the same space pointer event payloads report.
ynumberY coordinate in logical space (CSS pixels relative to the context's top-left).
options?Partial<ElementIntersectionOptions>Hit-testing options, such as whether the test originates from a pointer event.

Returns ​

boolean

Whether the point lies within the element.

Inherited from ​

Group.intersectsWith


matches() ​

matches(selector): boolean

Defined in: core/src/core/element.ts:771

Tests whether this element matches the CSS-like selector.

Parameters ​

ParameterType
selectorstring

Returns ​

boolean

Inherited from ​

Group.matches


off() ​

off<TEvent>(type, handler): void

Defined in: core/src/core/event-bus.ts:144

Removes a previously registered handler for the given event type.

Type Parameters ​

Type Parameter
TEvent extends string | number | symbol

Parameters ​

ParameterType
typeTEvent
handlerEventHandler<TEventMap[TEvent]>

Returns ​

void

Inherited from ​

Group.off


on() ​

on<TEvent>(event, handler, options?): Disposable

Defined in: core/src/core/element.ts:744

Subscribes a handler to an element event, returning a disposable subscription.

Overrides EventBus.on to additionally invalidate the Context's tracked-element cache for interaction events, keeping hit testing accurate as listeners are added and removed.

Type Parameters ​

Type Parameter
TEvent extends string | number | symbol

Parameters ​

ParameterTypeDescription
eventTEventThe event name to listen for.
handlerEventHandler<TEventMap[TEvent]>Callback invoked when the event is emitted.
options?EventSubscriptionOptionsOptional subscription options (e.g. self-only filtering).

Returns ​

Disposable

A disposable used to remove the subscription.

Inherited from ​

Group.on


once() ​

once<TEvent>(type, handler, options?): Disposable

Defined in: core/src/core/event-bus.ts:159

Subscribes a handler that is automatically removed after it fires once.

Type Parameters ​

Type Parameter
TEvent extends string | number | symbol

Parameters ​

ParameterType
typeTEvent
handlerEventHandler<TEventMap[TEvent]>
options?EventSubscriptionOptions

Returns ​

Disposable

Inherited from ​

Group.once


query() ​

query<TElement>(selector): TElement | undefined

Defined in: core/src/core/group.ts:153

Returns the first descendant matching the CSS-like selector, or undefined.

Type Parameters ​

Type ParameterDefault type
TElement extends Element<Partial<BaseState>, ElementEventMap>Element<Partial<BaseState>, ElementEventMap>

Parameters ​

ParameterType
selectorstring

Returns ​

TElement | undefined

Inherited from ​

Group.query


queryAll() ​

queryAll<TElement>(selector): TElement[]

Defined in: core/src/core/group.ts:158

Returns all descendants matching the CSS-like selector.

Type Parameters ​

Type ParameterDefault type
TElement extends Element<Partial<BaseState>, ElementEventMap>Element<Partial<BaseState>, ElementEventMap>

Parameters ​

ParameterType
selectorstring

Returns ​

TElement[]

Inherited from ​

Group.queryAll


remove() ​

remove(element): void

Defined in: core/src/core/group.ts:118

Removes one or more child elements from this group.

Parameters ​

ParameterType
elementOneOrMore<Element<Partial<BaseState>, ElementEventMap>>

Returns ​

void

Inherited from ​

Group.remove


render() ​

render(context): void

Defined in: core/src/core/group.ts:195

Renders all child elements in ascending z-index order within this group's boundary.

Parameters ​

ParameterType
contextContext

Returns ​

void

Inherited from ​

Group.render


retain() ​

protected retain(value, key?): void

Defined in: core/src/core/disposer.ts:14

Registers a disposable resource under an optional key for later cleanup.

Parameters ​

ParameterTypeDefault value
valueDisposableundefined
keyPropertyKeyDisposer.defaultKey

Returns ​

void

Inherited from ​

Group.retain


set() ​

set(elements): void

Defined in: core/src/core/group.ts:92

Replaces all children with the given elements, detaching the previous children.

Parameters ​

ParameterType
elementsElement<Partial<BaseState>, ElementEventMap>[]

Returns ​

void

Inherited from ​

Group.set


setStateValue() ​

protected setStateValue<TKey>(key, value): void

Defined in: core/src/core/element.ts:698

Sets a state value, marking the element Element.$touched. When the value differs from the current one it is written, the element is marked Element.$dirty, and an updated event is emitted; setting a primitive value equal to the current one is a no-op beyond $touched (no write, no $dirty, no event). Reference-equal objects and arrays always take the full path, since in-place mutation makes them indistinguishable from a changed value.

Type Parameters ​

Type Parameter
TKey extends keyof BaseState

Parameters ​

ParameterType
keyTKey
valuePartial<BaseState>[TKey]

Returns ​

void

Inherited from ​

Group.setStateValue


updateSceneGraph() ​

updateSceneGraph(): void

Defined in: core/src/core/group.ts:87

Emits a graph event to notify the scene that the element tree has changed.

Returns ​

void

Inherited from ​

Group.updateSceneGraph