I’m trying to clone an Vertex-object in mxgraph, to edit the coordinates without changing the original Vertex, but I get the Error “Uncaught TypeError: terminal.insertEdge is not a function” in the console and none of the vertices, from that point on, render.
I tried different Cloning Methodes like:
<code>vertexClone = structuredClone(vertex);
vertexClone = JSON.parse(JSON.stringify(vertex));
vertexClone = Object.assign({}, vertex);
vertexClone = { ...vertex};
</code>
<code>vertexClone = structuredClone(vertex);
vertexClone = JSON.parse(JSON.stringify(vertex));
vertexClone = Object.assign({}, vertex);
vertexClone = { ...vertex};
</code>
vertexClone = structuredClone(vertex);
vertexClone = JSON.parse(JSON.stringify(vertex));
vertexClone = Object.assign({}, vertex);
vertexClone = { ...vertex};
But when further using the VertexCloneObject, I get the TypeError in my console.
New contributor
HallPl is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.