Skip to content

Documentation / @ripl/core / Scene

Class: Scene<TContext>

Defined in: packages/core/src/core/scene.ts:74

The top-level group bound to a rendering context, maintaining a hoisted flat instruction stream for O(n) rendering.

Extends

Type Parameters

Type ParameterDefault type
TContext extends ContextContext

Constructors

Constructor

new Scene<TContext>(target, options?): Scene<TContext>

Defined in: packages/core/src/core/scene.ts:108

Parameters

ParameterType
targetstring | Context<Element, Record<string, unknown>> | HTMLElement
options?SceneOptions

Returns

Scene<TContext>

Overrides

Group.constructor

Properties

PropertyModifierTypeDefault valueDescriptionOverridesInherited fromDefined in
abstractpublicbooleanfalseWhen true, the element skips transform and drawing-state application during Element.render; used by containers such as Group.-Group.abstractpackages/core/src/core/element.ts:423
classListreadonlySet<string>undefinedSet of CSS-like class names used for querying and selection.-Group.classListpackages/core/src/core/element.ts:420
contextpublicTContextundefinedThe rendering Context this scene draws to.Group.context-packages/core/src/core/scene.ts:77
datapublicunknownundefinedArbitrary user data bound to the element, typically the datum backing a data-driven visual.-Group.datapackages/core/src/core/element.ts:429
idpublicstringundefinedUnique identifier for this element, defaulting to type:uniqueId when not supplied.-Group.idpackages/core/src/core/element.ts:416
parent?publicGroup<ElementEventMap>undefinedThe parent Group this element is attached to, or undefined when detached.-Group.parentpackages/core/src/core/element.ts:427
pointerEventspublicElementPointerEvents'all'Controls which parts of the element respond to pointer hit testing. See ElementPointerEvents.-Group.pointerEventspackages/core/src/core/element.ts:425
stateprotectedTStateundefined--Group.statepackages/core/src/core/element.ts:412
typereadonlystringundefinedThe element type name (e.g. circle, rect, group).-Group.typepackages/core/src/core/element.ts:418
defaultKeyreadonlytypeof defaultKeyundefinedThe key under which resources are retained when no explicit key is provided.-Group.defaultKeypackages/core/src/core/disposer.ts:11

Accessors

buffer

Get Signature

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

Defined in: packages/core/src/core/scene.ts:92

The flat list of renderable leaf descendants in paint order — the draw targets of Scene.instructions.

Returns

Element<Partial<BaseState>, ElementEventMap>[]


children

Get Signature

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

Defined in: packages/core/src/core/group.ts:58

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: packages/core/src/core/element.ts:434

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: packages/core/src/core/element.ts:438

Parameters
ParameterType
valueTState["direction"]
Returns

void

Inherited from

Group.direction


fill

Get Signature

get fill(): TState["fill"]

Defined in: packages/core/src/core/element.ts:443

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

Returns

TState["fill"]

Set Signature

set fill(value): void

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

Parameters
ParameterType
valueTState["fill"]
Returns

void

Inherited from

Group.fill


filter

Get Signature

get filter(): TState["filter"]

Defined in: packages/core/src/core/element.ts:452

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

Returns

TState["filter"]

Set Signature

set filter(value): void

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

Parameters
ParameterType
valueTState["filter"]
Returns

void

Inherited from

Group.filter


font

Get Signature

get font(): TState["font"]

Defined in: packages/core/src/core/element.ts:461

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

Returns

TState["font"]

Set Signature

set font(value): void

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

Parameters
ParameterType
valueTState["font"]
Returns

void

Inherited from

Group.font


globalCompositeOperation

Get Signature

get globalCompositeOperation(): TState["globalCompositeOperation"]

Defined in: packages/core/src/core/element.ts:479

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: packages/core/src/core/element.ts:483

Parameters
ParameterType
valueTState["globalCompositeOperation"]
Returns

void

Inherited from

Group.globalCompositeOperation


height

Get Signature

get height(): number

Defined in: packages/core/src/core/scene.ts:104

The pixel height of the scene's rendering context.

Returns

number


instructions

Get Signature

get instructions(): RenderInstruction[]

Defined in: packages/core/src/core/scene.ts:87

The flat, group-aware render instruction stream in paint order (stacking-context z-ordering), driving the Renderer and Scene.render. Each entry is a push/draw/pop RenderInstruction; groups are bracketed by push/pop so their transform and any group-scoped clip apply to the leaves drawn between them.

Returns

RenderInstruction[]


lineCap

Get Signature

get lineCap(): TState["lineCap"]

Defined in: packages/core/src/core/element.ts:488

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: packages/core/src/core/element.ts:492

Parameters
ParameterType
valueTState["lineCap"]
Returns

void

Inherited from

Group.lineCap


lineDash

Get Signature

get lineDash(): TState["lineDash"]

Defined in: packages/core/src/core/element.ts:497

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: packages/core/src/core/element.ts:501

Parameters
ParameterType
valueTState["lineDash"]
Returns

void

Inherited from

Group.lineDash


lineDashOffset

Get Signature

get lineDashOffset(): TState["lineDashOffset"]

Defined in: packages/core/src/core/element.ts:506

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

Returns

TState["lineDashOffset"]

Set Signature

set lineDashOffset(value): void

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

Parameters
ParameterType
valueTState["lineDashOffset"]
Returns

void

Inherited from

Group.lineDashOffset


lineJoin

Get Signature

get lineJoin(): TState["lineJoin"]

Defined in: packages/core/src/core/element.ts:515

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: packages/core/src/core/element.ts:519

Parameters
ParameterType
valueTState["lineJoin"]
Returns

void

Inherited from

Group.lineJoin


lineWidth

Get Signature

get lineWidth(): TState["lineWidth"]

Defined in: packages/core/src/core/element.ts:524

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

Returns

TState["lineWidth"]

Set Signature

set lineWidth(value): void

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

Parameters
ParameterType
valueTState["lineWidth"]
Returns

void

Inherited from

Group.lineWidth


miterLimit

Get Signature

get miterLimit(): TState["miterLimit"]

Defined in: packages/core/src/core/element.ts:533

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: packages/core/src/core/element.ts:537

Parameters
ParameterType
valueTState["miterLimit"]
Returns

void

Inherited from

Group.miterLimit


opacity

Get Signature

get opacity(): TState["opacity"]

Defined in: packages/core/src/core/element.ts:470

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: packages/core/src/core/element.ts:474

Parameters
ParameterType
valueTState["opacity"]
Returns

void

Inherited from

Group.opacity


rotation

Get Signature

get rotation(): TState["rotation"]

Defined in: packages/core/src/core/element.ts:650

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: packages/core/src/core/element.ts:654

Parameters
ParameterType
valueTState["rotation"]
Returns

void

Inherited from

Group.rotation


shadowBlur

Get Signature

get shadowBlur(): TState["shadowBlur"]

Defined in: packages/core/src/core/element.ts:542

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: packages/core/src/core/element.ts:546

Parameters
ParameterType
valueTState["shadowBlur"]
Returns

void

Inherited from

Group.shadowBlur


shadowColor

Get Signature

get shadowColor(): TState["shadowColor"]

Defined in: packages/core/src/core/element.ts:551

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

Returns

TState["shadowColor"]

Set Signature

set shadowColor(value): void

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

Parameters
ParameterType
valueTState["shadowColor"]
Returns

void

Inherited from

Group.shadowColor


shadowOffsetX

Get Signature

get shadowOffsetX(): TState["shadowOffsetX"]

Defined in: packages/core/src/core/element.ts:560

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: packages/core/src/core/element.ts:564

Parameters
ParameterType
valueTState["shadowOffsetX"]
Returns

void

Inherited from

Group.shadowOffsetX


shadowOffsetY

Get Signature

get shadowOffsetY(): TState["shadowOffsetY"]

Defined in: packages/core/src/core/element.ts:569

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: packages/core/src/core/element.ts:573

Parameters
ParameterType
valueTState["shadowOffsetY"]
Returns

void

Inherited from

Group.shadowOffsetY


stroke

Get Signature

get stroke(): TState["stroke"]

Defined in: packages/core/src/core/element.ts:578

Stroke style (colour 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: packages/core/src/core/element.ts:582

Parameters
ParameterType
valueTState["stroke"]
Returns

void

Inherited from

Group.stroke


textAlign

Get Signature

get textAlign(): TState["textAlign"]

Defined in: packages/core/src/core/element.ts:587

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

Returns

TState["textAlign"]

Set Signature

set textAlign(value): void

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

Parameters
ParameterType
valueTState["textAlign"]
Returns

void

Inherited from

Group.textAlign


textBaseline

Get Signature

get textBaseline(): TState["textBaseline"]

Defined in: packages/core/src/core/element.ts:596

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

Returns

TState["textBaseline"]

Set Signature

set textBaseline(value): void

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

Parameters
ParameterType
valueTState["textBaseline"]
Returns

void

Inherited from

Group.textBaseline


transformOriginX

Get Signature

get transformOriginX(): TState["transformOriginX"]

Defined in: packages/core/src/core/element.ts:659

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: packages/core/src/core/element.ts:663

Parameters
ParameterType
valueTState["transformOriginX"]
Returns

void

Inherited from

Group.transformOriginX


transformOriginY

Get Signature

get transformOriginY(): TState["transformOriginY"]

Defined in: packages/core/src/core/element.ts:668

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: packages/core/src/core/element.ts:672

Parameters
ParameterType
valueTState["transformOriginY"]
Returns

void

Inherited from

Group.transformOriginY


transformScaleX

Get Signature

get transformScaleX(): TState["transformScaleX"]

Defined in: packages/core/src/core/element.ts:632

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

Returns

TState["transformScaleX"]

Set Signature

set transformScaleX(value): void

Defined in: packages/core/src/core/element.ts:636

Parameters
ParameterType
valueTState["transformScaleX"]
Returns

void

Inherited from

Group.transformScaleX


transformScaleY

Get Signature

get transformScaleY(): TState["transformScaleY"]

Defined in: packages/core/src/core/element.ts:641

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

Returns

TState["transformScaleY"]

Set Signature

set transformScaleY(value): void

Defined in: packages/core/src/core/element.ts:645

Parameters
ParameterType
valueTState["transformScaleY"]
Returns

void

Inherited from

Group.transformScaleY


translateX

Get Signature

get translateX(): TState["translateX"]

Defined in: packages/core/src/core/element.ts:614

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

Returns

TState["translateX"]

Set Signature

set translateX(value): void

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

Parameters
ParameterType
valueTState["translateX"]
Returns

void

Inherited from

Group.translateX


translateY

Get Signature

get translateY(): TState["translateY"]

Defined in: packages/core/src/core/element.ts:623

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

Returns

TState["translateY"]

Set Signature

set translateY(value): void

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

Parameters
ParameterType
valueTState["translateY"]
Returns

void

Inherited from

Group.translateY


width

Get Signature

get width(): number

Defined in: packages/core/src/core/scene.ts:99

The pixel width of the scene's rendering context.

Returns

number


zIndex

Get Signature

get zIndex(): number

Defined in: packages/core/src/core/element.ts:605

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: packages/core/src/core/element.ts:609

Parameters
ParameterType
valuenumber
Returns

void

Inherited from

Group.zIndex

Methods

add()

add(element): void

Defined in: packages/core/src/core/group.ts:84

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: packages/core/src/core/group.ts:120

Removes all children from this group.

Returns

void

Inherited from

Group.clear


clone()

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

Defined in: packages/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: packages/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(includeContext?): void

Defined in: packages/core/src/core/scene.ts:207

Destroys the scene (and optionally the context), removing all children and cleaning up event subscriptions.

Parameters

ParameterTypeDefault value
includeContextbooleanfalse

Returns

void

Overrides

Group.destroy


dispose()

protected dispose(key?): void

Defined in: packages/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: packages/core/src/core/event-bus.ts:137

Emits an event, invoking all matching handlers and bubbling to the parent if applicable.

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<ElementEventMap[TEvent]>

Defined in: packages/core/src/core/event-bus.ts:138

Emits an event, invoking all matching handlers and bubbling to the parent if applicable.

Type Parameters
Type Parameter
TEvent extends keyof ElementEventMap
Parameters
ParameterType
typeTEvent
dataElementEventMap[TEvent]
Returns

Event<ElementEventMap[TEvent]>

Inherited from

Group.emit


getBoundingBox()

getBoundingBox(local?): Box

Defined in: packages/core/src/core/group.ts:170

Returns the composite bounding box enclosing all children: their on-screen (world) boxes by default, or their raw local boxes when local is true.

Parameters

ParameterTypeDefault valueDescription
localbooleanfalsewhen true, unions the children's untransformed local geometry instead of their world boxes.

Returns

Box

Inherited from

Group.getBoundingBox


getComputedStateValue()

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

Defined in: packages/core/src/core/element.ts:714

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

ParameterType
keyTKey

Returns

Partial<BaseState>[TKey]

Inherited from

Group.getComputedStateValue


getElementById()

getElementById<TElement>(id): TElement | undefined

Defined in: packages/core/src/core/group.ts:149

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: packages/core/src/core/group.ts:160

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: packages/core/src/core/group.ts:154

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


getStateValue()

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

Defined in: packages/core/src/core/element.ts:705

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.getComputedStateValue 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


graph()

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

Defined in: packages/core/src/core/group.ts:125

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: packages/core/src/core/event-bus.ts:94

Returns whether there are any listeners registered for the given event type.

Parameters

ParameterType
typekeyof ElementEventMap

Returns

boolean

Inherited from

Group.has


interpolate()

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

Defined in: packages/core/src/core/element.ts:810

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

Parameters

ParameterType
newStatePartial<ElementInterpolationState<TState>>
interpolatorsPartial<ElementInterpolators<TState>>

Returns

Interpolator<void>

Inherited from

Group.interpolate


intersectsWith()

intersectsWith(x, y, options?): boolean

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

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

Parameters

ParameterType
xnumber
ynumber
options?Partial<ElementIntersectionOptions>

Returns

boolean

Inherited from

Group.intersectsWith


matches()

matches(selector): boolean

Defined in: packages/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: packages/core/src/core/event-bus.ts:112

Removes a previously registered handler for the given event type.

Type Parameters

Type Parameter
TEvent extends keyof ElementEventMap

Parameters

ParameterType
typeTEvent
handlerEventHandler<ElementEventMap[TEvent]>

Returns

void

Inherited from

Group.off


on()

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

Defined in: packages/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 keyof ElementEventMap

Parameters

ParameterTypeDescription
eventTEventThe event name to listen for.
handlerEventHandler<ElementEventMap[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: packages/core/src/core/event-bus.ts:127

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

Type Parameters

Type Parameter
TEvent extends keyof ElementEventMap

Parameters

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

Returns

Disposable

Inherited from

Group.once


query()

query<TElement>(selector): TElement | undefined

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

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: packages/core/src/core/group.ts:144

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: packages/core/src/core/group.ts:104

Removes one or more child elements from this group.

Parameters

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

Returns

void

Inherited from

Group.remove


render()

render(): void

Defined in: packages/core/src/core/scene.ts:218

Clears the context and renders the entire instruction stream in paint order, honouring group boundaries.

Returns

void

Overrides

Group.render


retain()

protected retain(value, key?): void

Defined in: packages/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: packages/core/src/core/group.ts:78

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: packages/core/src/core/element.ts:725

Sets a state value and emits an updated event.

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: packages/core/src/core/group.ts:73

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

Returns

void

Inherited from

Group.updateSceneGraph