fix: diagram context

This commit is contained in:
Maël Gangloff
2024-08-22 00:56:58 +02:00
parent 5ddd42eded
commit 7ece681d73
2 changed files with 21 additions and 9 deletions

View File

@@ -1,13 +1,12 @@
import dagre from "dagre";
const dagreGraph = new dagre.graphlib.Graph();
dagreGraph.setDefaultEdgeLabel(() => ({}));
const nodeWidth = 172;
const nodeHeight = 200;
import dagre from "dagre"
export const getLayoutedElements = (nodes: any, edges: any, direction = 'TB') => {
const dagreGraph = new dagre.graphlib.Graph()
dagreGraph.setDefaultEdgeLabel(() => ({}))
const nodeWidth = 172
const nodeHeight = 200
const isHorizontal = direction === 'LR';
dagreGraph.setGraph({rankdir: direction});