Skip to content

Commit

Permalink
Merge pull request #601 from kbss-cvut/fix/node-creation-layout
Browse files Browse the repository at this point in the history
Improved auto-layout of nodes and fixed weird behavior of links
  • Loading branch information
LaChope authored Sep 24, 2024
2 parents 9470ccb + 705e928 commit 084f633
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/editor/faultTree/canvas/EditorCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,13 @@ const EditorCanvas = ({
joint.layout.DirectedGraph.layout(graph.getSubgraph(autoLayoutElements), {
dagre: dagre,
graphlib: graphlib,
setVertices: true,
setLinkVertices: false, // Avoid weird behavior of links (described in https://github.com/kbss-cvut/fta-fmea-ui/issues/527)
rankDir: "TB", // Direction top-to-bottom
nodeSep: 50, // Horizontal separation between nodes
rankSep: 100, // Vertical separation between ranks
marginX: 20,
marginY: 20,
preserveNodeGeometry: true,
});
// Manual Layout
manualLayoutElements.forEach((el) => {
Expand Down

0 comments on commit 084f633

Please sign in to comment.