(positions: Map<string, { x: number; y: number }>)
| 985 | // ─── Position Updates (called from simulation tick) ─────────────── |
| 986 | |
| 987 | updatePositions(positions: Map<string, { x: number; y: number }>): void { |
| 988 | for (const [id, pos] of positions) { |
| 989 | const node = this.nodes.get(id); |
| 990 | if (!node || !node.visible) continue; |
| 991 | node.x = pos.x; |
| 992 | node.y = pos.y; |
| 993 | // In 3D mode the ticker handles sprite positioning via projection each frame. |
| 994 | if (!this.mode3d) { |
| 995 | node.sprite.position.set(pos.x, pos.y); |
| 996 | if (node.label?.visible) { |
| 997 | const gap = this.labelGap(node); |
| 998 | node.label.position.set(pos.x + gap, pos.y); |
| 999 | } |
| 1000 | } |
| 1001 | } |
| 1002 | |
| 1003 | this.postPositionUpdate(); |
| 1004 | } |
| 1005 | |
| 1006 | /** |
| 1007 | * Update positions from a Float64Array buffer (indexed by node order from setData). |
no test coverage detected