Skip to content

Commit

Permalink
fix: Moving a state node should not trigger a re-layout [PT-187321170]
Browse files Browse the repository at this point in the history
  • Loading branch information
dougmartin committed Apr 3, 2024
1 parent 1cd30c8 commit fd3161b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -546,11 +546,17 @@ export const Graph = (props: Props) => {
while (simulation.alpha() > simulation.alphaMin()) {
simulation.tick();
}

// pin the nodes so that dragging does not cause a force layout change
d3Graph.nodes
.forEach((d: any) => {
d.fx = d.x;
d.fy = d.y;
});
}

// calculate the edge positions
d3Graph.edges = calculateEdges(d3Graph.edges);
// d3Graph.nodes = calculateLoops(d3Graph);

const lineBackgroundClass = [
"edge-background",
Expand Down

0 comments on commit fd3161b

Please sign in to comment.