File tree 1 file changed +5
-7
lines changed
web/client/src/library/components/graph
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 '
2
2
import { MarkerType } from 'reactflow'
3
3
import { isArrayNotEmpty } from '../../../utils'
4
4
@@ -48,9 +48,7 @@ interface GraphOptions {
48
48
algorithm ?: string
49
49
}
50
50
51
- const elk = new ELK ( {
52
- workerUrl : '/node_modules/elkjs/lib/elk-worker.min.js' ,
53
- } )
51
+ const elk = new ELK ( )
54
52
55
53
const ALGORITHM_LAYERED = 'layered'
56
54
@@ -87,7 +85,7 @@ export async function getNodesAndEdges({
87
85
const layout = await elk . layout ( graph )
88
86
const nodes : GraphNode [ ] = [ ]
89
87
90
- layout . children ?. forEach ( ( node , idx : number ) => {
88
+ layout . children ?. forEach ( node => {
91
89
const output = nodesMap [ node . id ]
92
90
93
91
if ( output == null ) return
@@ -101,8 +99,8 @@ export async function getNodesAndEdges({
101
99
}
102
100
103
101
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 ,
106
104
}
107
105
108
106
nodes . push ( output )
You can’t perform that action at this time.
0 commit comments