Skip to content

Commit

Permalink
Merge pull request #35 from concord-consortium/187321170-stop-relayouts
Browse files Browse the repository at this point in the history
fix: Moving a state node should not trigger a re-layout [PT-187321170]
  • Loading branch information
dougmartin authored Apr 3, 2024
2 parents f2246c0 + fd3161b commit 3cb92bf
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 3cb92bf

Please sign in to comment.