core/ShapeStore¶
Classes¶
ShapeStore¶
Defined in: core/ShapeStore.ts:93
ShapeStore - name-indexed storage for simulation shapes (polygons, polylines) with change notification. The StateManager facade delegates here. Shapes belong to the simulation, so they are cleared on node switches and resets rather than persisted like user preferences.
Constructors¶
Constructor¶
Returns¶
Accessors¶
size¶
Get Signature¶
Defined in: core/ShapeStore.ts:254
Get shape count
Returns¶
number
Methods¶
subscribe()¶
Defined in: core/ShapeStore.ts:101
Subscribe to shape changes Returns unsubscribe function
Parameters¶
listener¶
Returns¶
() => void
notifyListeners()¶
Defined in: core/ShapeStore.ts:111
Notify all shape listeners of changes
Returns¶
void
add()¶
Defined in: core/ShapeStore.ts:126
Add or update a shape
Parameters¶
shape¶
notify?¶
boolean = true
If false, don't notify listeners (for batch updates)
Returns¶
void
addBatch()¶
Defined in: core/ShapeStore.ts:138
Add multiple shapes in a batch (only notifies once)
Parameters¶
shapes¶
Shape[]
Returns¶
void
addPolyData()¶
Defined in: core/ShapeStore.ts:147
Add or update shape from server PolyData format
Parameters¶
data¶
nodeId?¶
string
Returns¶
void
addPolylineData()¶
Defined in: core/ShapeStore.ts:158
Add or update shape from server PolylineData format
Parameters¶
data¶
nodeId?¶
string
Returns¶
void
delete()¶
Defined in: core/ShapeStore.ts:169
Delete a shape by name
Parameters¶
name¶
string
Returns¶
boolean
get()¶
Defined in: core/ShapeStore.ts:181
Get a shape by name
Parameters¶
name¶
string
Returns¶
Shape | undefined
getAll()¶
Defined in: core/ShapeStore.ts:188
Get all shapes
Returns¶
Map\<string, Shape>
getByType()¶
Defined in: core/ShapeStore.ts:195
Get shapes by type
Type Parameters¶
T¶
T extends "polygon" | "polyline" | "circle" | "rectangle"
Parameters¶
type¶
T
Returns¶
Shape[]
getByNode()¶
Defined in: core/ShapeStore.ts:204
Get shapes for a specific node
Parameters¶
nodeId¶
string
Returns¶
Shape[]
clear()¶
Defined in: core/ShapeStore.ts:214
Clear all shapes Called when switching nodes or resetting simulation
Returns¶
void
clearForNode()¶
Defined in: core/ShapeStore.ts:223
Clear shapes for a specific node
Parameters¶
nodeId¶
string
Returns¶
void
setVisibility()¶
Defined in: core/ShapeStore.ts:243
Update shape visibility
Parameters¶
name¶
string
visible¶
boolean
Returns¶
void
Type Aliases¶
ShapeChangeListener¶
Defined in: core/ShapeStore.ts:5
Parameters¶
shapes¶
Map\<string, Shape>
Returns¶
void
Functions¶
polyDataToShape()¶
Defined in: core/ShapeStore.ts:11
Convert server PolyData ({name, lat[], lon[], color?, fill?}) to a client PolygonShape ({type, name, coordinates: {lat, lng}[], ...styling}).
Parameters¶
data¶
nodeId?¶
string
Returns¶
polylineDataToShape()¶
Defined in: core/ShapeStore.ts:54
Convert server PolylineData ({name, lat[], lon[], color?, width?}) to a client PolylineShape ({type, name, coordinates: {lat, lng}[], ...styling}).
Parameters¶
data¶
nodeId?¶
string