Skip to content

Group

A placed group of entities with its own definition.

readonly definition: ComponentDefinition

The group’s definition.


readonly entities: Entities

The entities inside the group, in group-local coordinates.


readonly entityId: number

Identifier that stays the same for the entity’s lifetime, including across undo and redo.

DrawingElement.entityId


hidden: boolean

The element’s own hidden flag; assign inside Model.operation. Hidden ancestors are not taken into account; use Model.isDrawingElementVisible for that.

DrawingElement.hidden


readonly isDeleted: boolean

Whether the entity was deleted, for example by an edit or by undo.

DrawingElement.isDeleted


readonly isValid: boolean

Whether the entity still exists in the model.

DrawingElement.isValid


readonly material: Material | null

The material applied to the whole group, or null.


name: string

Group name; assign inside Model.operation.


transformation: Transformation

Maps group-local coordinates into the parent context. Assigning replaces the placement; do so inside Model.operation.


readonly type: "Group"

The concrete class name, for narrowing unions such as AnyElement.

DrawingElement.type


visible: boolean

The inverse of hidden; assign inside Model.operation.

DrawingElement.visible

transform(transformation): void

Applies a transformation in the parent context, so the new placement is transformation.multiply(old). Call it inside Model.operation.

Transformation

void