diff --git a/src/models/edge.ts b/src/models/edge.ts index d36c8af..0a3374b 100644 --- a/src/models/edge.ts +++ b/src/models/edge.ts @@ -218,15 +218,18 @@ abstract class Edge extends Subject im } getData(): E { - return structuredClone(this._data); + // no shallow/deep copy here due to the performance issues + return this._data; } getPosition(): IEdgePosition { - return structuredClone(this._position); + // no shallow/deep copy here due to the performance issues + return this._position; } getStyle(): IEdgeStyle { - return structuredClone(this._style); + // no shallow/deep copy here due to the performance issues + return this._style; } getState(): number { diff --git a/src/models/node.ts b/src/models/node.ts index af6b1f4..262c4a9 100644 --- a/src/models/node.ts +++ b/src/models/node.ts @@ -182,15 +182,18 @@ export class Node extends Subject impl } getData(): N { - return structuredClone(this._data); + // no shallow/deep copy here due to the performance issues + return this._data; } getPosition(): INodePosition { - return structuredClone(this._position); + // no shallow/deep copy here due to the performance issues + return this._position; } getStyle(): INodeStyle { - return structuredClone(this._style); + // no shallow/deep copy here due to the performance issues + return this._style; } getState(): number {