Add particle animation for connection activity

This commit is contained in:
2025-03-07 23:55:55 +01:00
parent 083a25f302
commit 585404c549
3 changed files with 183 additions and 5 deletions

View File

@@ -98,21 +98,21 @@ export class TpFlowNodes extends zoom(panning(connections(LitElement))) {
this.connections = [];
// Create all nodes first
const nodes = flowData.nodes.map(nodeData => {
const nodes = flowData.nodes?.map(nodeData => {
const node = this.createNode(nodeData.type);
node.importData(nodeData);
return node;
});
// Set nodes and wait for render
this.nodes = nodes;
this.nodes = nodes || [];
await this.updateComplete;
// Wait for all nodes to be ready
await Promise.all(this.nodes.map(node => node.updateComplete));
// Only after nodes are ready, restore connections
this.connections = flowData.connections;
this.connections = flowData.connections || [];
// Restore canvas state
if (flowData.canvas) {