File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
web/client/src/library/components/graph Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 1- import ELK from 'elkjs/lib/elk-api '
1+ import ELK from 'elkjs/lib/elk.bundled.js '
22import { MarkerType } from 'reactflow'
33import { isArrayNotEmpty } from '../../../utils'
44
@@ -48,9 +48,7 @@ interface GraphOptions {
4848 algorithm ?: string
4949}
5050
51- const elk = new ELK ( {
52- workerUrl : '/node_modules/elkjs/lib/elk-worker.min.js' ,
53- } )
51+ const elk = new ELK ( )
5452
5553const ALGORITHM_LAYERED = 'layered'
5654
@@ -87,7 +85,7 @@ export async function getNodesAndEdges({
8785 const layout = await elk . layout ( graph )
8886 const nodes : GraphNode [ ] = [ ]
8987
90- layout . children ?. forEach ( ( node , idx : number ) => {
88+ layout . children ?. forEach ( node => {
9189 const output = nodesMap [ node . id ]
9290
9391 if ( output == null ) return
@@ -101,8 +99,8 @@ export async function getNodesAndEdges({
10199 }
102100
103101 output . position = {
104- x : node . x == null ? 0 : - node . x ,
105- y : node . y == null ? 0 : - node . y ,
102+ x : node . x == null ? 0 : - node . x * 2 ,
103+ y : node . y == null ? 0 : - node . y * 1.5 ,
106104 }
107105
108106 nodes . push ( output )
You can’t perform that action at this time.
0 commit comments