core/ShapeStore¶
Classes¶
ShapeStore¶
Defined in: core/ShapeStore.ts:77
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:238
Get shape count
Returns¶
number
Methods¶
subscribe()¶
Defined in: core/ShapeStore.ts:85
Subscribe to shape changes Returns unsubscribe function
Parameters¶
listener¶
Returns¶
() => void
notifyListeners()¶
Defined in: core/ShapeStore.ts:95
Notify all shape listeners of changes
Returns¶
void
add()¶
Defined in: core/ShapeStore.ts:110
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:122
Add multiple shapes in a batch (only notifies once)
Parameters¶
shapes¶
Shape[]
Returns¶
void
addPolyData()¶
Defined in: core/ShapeStore.ts:131
Add or update shape from server PolyData format
Parameters¶
data¶
nodeId?¶
string
Returns¶
void
addPolylineData()¶
Defined in: core/ShapeStore.ts:142
Add or update shape from server PolylineData format
Parameters¶
data¶
nodeId?¶
string
Returns¶
void
delete()¶
Defined in: core/ShapeStore.ts:153
Delete a shape by name
Parameters¶
name¶
string
Returns¶
boolean
get()¶
Defined in: core/ShapeStore.ts:165
Get a shape by name
Parameters¶
name¶
string
Returns¶
Shape | undefined
getAll()¶
Defined in: core/ShapeStore.ts:172
Get all shapes
Returns¶
Map\<string, Shape>
getByType()¶
Defined in: core/ShapeStore.ts:179
Get shapes by type
Type Parameters¶
T¶
T extends "polygon" | "polyline" | "circle" | "rectangle"
Parameters¶
type¶
T
Returns¶
Shape[]
getByNode()¶
Defined in: core/ShapeStore.ts:188
Get shapes for a specific node
Parameters¶
nodeId¶
string
Returns¶
Shape[]
clear()¶
Defined in: core/ShapeStore.ts:198
Clear all shapes Called when switching nodes or resetting simulation
Returns¶
void
clearForNode()¶
Defined in: core/ShapeStore.ts:207
Clear shapes for a specific node
Parameters¶
nodeId¶
string
Returns¶
void
setVisibility()¶
Defined in: core/ShapeStore.ts:227
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:25
Convert server PolyData ({name, lat[], lon[], color?}) to a client PolygonShape ({type, name, coordinates: {lat, lng}[], ...styling}).
Parameters¶
data¶
nodeId?¶
string
Returns¶
polylineDataToShape()¶
Defined in: core/ShapeStore.ts:52
Convert server PolylineData ({name, lat[], lon[], color?, width?}) to a client PolylineShape ({type, name, coordinates: {lat, lng}[], ...styling}).
Parameters¶
data¶
nodeId?¶
string