Skip to main content

Abstract Class: UppKonvaShape

Defined in: upp-konva-shape.ts:33

Live shape; each subclass fixes kind. Instances live in UppKonvaArea.shapes (same references on canvas and model). doDestroy completes onSelected$, onUpdated$, and onRemoved$.

Extended by​

Implements​

  • UppKonvaDestroy

Properties​

custom?​

optional custom?: unknown

Defined in: upp-konva-shape.ts:136

Opaque bag on wire (optional).


data​

data: Record<string, unknown>

Defined in: upp-konva-shape.ts:119

JSON data fields per shape kind (chairs, door variant, bar stools, etc.). Hydrated from the row DTO (UppKonvaShapeSource.data); cm geometry syncs with the canvas in edit mode.


height​

height: number

Defined in: upp-konva-shape.ts:111

Height in cm (plan contract).


id​

readonly id: string

Defined in: upp-konva-shape.ts:102


kind​

abstract readonly kind: UppKonvaShapeKind

Defined in: upp-konva-shape.ts:79


label​

label: string

Defined in: upp-konva-shape.ts:124

Primary label on the canvas (empty = no text). After in-place edits use syncLabelsToStage or notifyPresentationDirty on the area.


mode?​

optional mode?: string

Defined in: upp-konva-shape.ts:134

Per-shape mode on wire (optional).


onRemoved$​

readonly onRemoved$: Observable<void>

Defined in: upp-konva-shape.ts:100

Fires once when the shape is removed via UppKonvaArea.removeShapes / UppKonvaShape.remove, synchronously before parentArea is cleared and before doDestroy. Does not fire when the instance is torn down because source was replaced (hydration / adapter redraw).


onSelected$​

readonly onSelected$: Observable<UppKonvaShapeEventPayload>

Defined in: upp-konva-shape.ts:88

Fires when the user selects the shape on the canvas while the model is in VIEW. Subscribe from the app.


onUpdated$​

readonly onUpdated$: Observable<UppKonvaShapeEventPayload>

Defined in: upp-konva-shape.ts:93

Fires when the shape is edited in place in EDIT. Does not imply a structural area.shapes change or onModelChanged.


rotation​

rotation: number

Defined in: upp-konva-shape.ts:113

Rotation in degrees (plan contract).


sublabel​

sublabel: string

Defined in: upp-konva-shape.ts:129

Optional subtitle (typically smaller than label). See syncLabelsToStage.


width​

width: number

Defined in: upp-konva-shape.ts:109

Width in cm (plan contract).


x​

x: number

Defined in: upp-konva-shape.ts:105

X position in cm (plan contract).


y​

y: number

Defined in: upp-konva-shape.ts:107

Y position in cm (plan contract).


zIndex?​

optional zIndex?: number

Defined in: upp-konva-shape.ts:132

Z order in document / wire (optional).

Accessors​

attention​

Get Signature​

get attention(): boolean

Defined in: upp-konva-shape.ts:148

English comment normalized. Compatibility: assigning true is equivalent to setHighlight('WARNING', true); false to clearHighlight. Not part of the persisted DTO UppKonvaShapeSource.

Returns​

boolean

Set Signature​

set attention(enabled): void

Defined in: upp-konva-shape.ts:155

Parameters​
enabled​

boolean

Returns​

void


highlight​

Get Signature​

get highlight(): { animated: boolean; tone: UppKonvaAttention; } | null

Defined in: upp-konva-shape.ts:165

Highlight state with tone and pulse; null if no highlight is active (applies only to TABLE on canvas).

Returns​

{ animated: boolean; tone: UppKonvaAttention; } | null


parentArea​

Get Signature​

get parentArea(): UppKonvaArea | null

Defined in: upp-konva-shape.ts:139

Owning area for this row in shapes, or null when not wired or after doDestroy.

Returns​

UppKonvaArea | null

Methods​

clearHighlight()​

clearHighlight(): void

Defined in: upp-konva-shape.ts:186

Clears the highlight state (same as setHighlight reset).

Returns​

void


doDestroy()​

doDestroy(): void

Defined in: upp-konva-shape.ts:63

Completes shape observables; idempotent.

Returns​

void

Implementation of​

UppKonvaDestroy.doDestroy


remove()​

remove(): boolean

Defined in: upp-konva-shape.ts:235

Removes this shape from the area and destroys it.

Returns​

boolean

false without an owning area or when already destroyed.


setHighlight()​

setHighlight(tone, animated): void

Defined in: upp-konva-shape.ts:178

Enables highlight only if the row is a table; does nothing for other types.

Parameters​

tone​

UppKonvaAttention

— SUCCESS, WARNING or DANGER (floor-plan theme palette). English comment normalized.

animated​

boolean

Returns​

void


setSublabel()​

setSublabel(text): void

Defined in: upp-konva-shape.ts:194

Assigns the secondary badge text and syncs it with the wired stage.

Parameters​

text​

string

Returns​

void


syncLabelsToStage()​

syncLabelsToStage(): void

Defined in: upp-konva-shape.ts:222

After mutating label / sublabel in place, updates the scene node and canvas badge.

Returns​

void


syncPresentationToStage()​

syncPresentationToStage(): void

Defined in: upp-konva-shape.ts:208

After mutating data in place (visual variant, chairs, stools, …), applies presentation on the canvas without changing global geometry. Requires a wired area and stage. Repaint is coalesced on the wired area (package-internal). For x/y/dimensions use area.notifyPresentationDirty() or area.source = ….

Returns​

void