Skip to content

Commit

Permalink
fix some crossing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rashidakanchwala committed Oct 15, 2024
1 parent aa2e9e0 commit 941193a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/graph/layout.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HALF_PI, snap, angle, groupByRow } from './common';
import { HALF_PI, snap, angle, compare, groupByRow } from './common';
import { solveLoose, solveStrict } from './solver';
import {
rowConstraint,
Expand Down Expand Up @@ -245,6 +245,8 @@ const createSeparationConstraints = (rows, constants) => {
// For each row of nodes
for (let i = 0; i < rows.length; i += 1) {
const rowNodes = rows[i];

rowNodes.sort((a, b) => compare(a.x, b.x, a.id, b.id));

// Update constraints for the sorted row node order
for (let j = 0; j < rowNodes.length-1; j += 1) {
Expand Down

0 comments on commit 941193a

Please sign in to comment.