sendPacket rendering optimizations

This commit is contained in:
2025-11-13 11:50:35 -06:00
parent d2292dcde7
commit e00ddf2b64
2 changed files with 75 additions and 18 deletions
+8 -1
View File
@@ -33,6 +33,7 @@ class CompleteNodeOnEdgeEngine {
this.speedMultiplier = 1;
this.timeAccumulator = 0;
this._movementInitialized = false;
this._isDragging = false;
// Keep linksByEdges up-to-date for dynamic graph changes
if (this.nodes && this.nodes.on) {
@@ -127,6 +128,7 @@ class CompleteNodeOnEdgeEngine {
});
this.network.on('dragging', (params) => {
this._isDragging = true;
if (params.edges.length <= 0) {
return;
}
@@ -139,6 +141,10 @@ class CompleteNodeOnEdgeEngine {
});
});
this.network.on('dragEnd', (params) => {
this._isDragging = false;
});
this.network.on('physicsMoving', (params) => {
this.edgesMoved = true;
// Only clear cache for edges that have moving dots
@@ -284,7 +290,8 @@ class CompleteNodeOnEdgeEngine {
});
// Request canvas redraw without forcing full network re-render
if (this.movingDots.size > 0) {
// Skip during dragging as vis-network handles redraws automatically
if (this.movingDots.size > 0 && !this._isDragging) {
this.network.canvas.body.emitter.emit("_requestRedraw");
}
}