-
Notifications
You must be signed in to change notification settings - Fork 630
Open
Description
I'm attempting to pass in EdgeConfig to my Dagre graph during layout, but I found passing in { labelpos: 'c' | 'l' | 'r' }
does not change the output of the label position and always uses the default 'r'
configuration. Same can be said about other EdgeConfig properties, such as labeloffset
, minlen
, weight
. (also labeloffset
is misspelled as labeloffest
in EdgeConfig)
Here is how I'm layouting the dagre graph
import Dagre, { Edge, layout } from '@dagrejs/dagre'
const dagreGraph = new Dagre.graphlib.Graph({ multigraph: true, compound: true })
.setDefaultEdgeLabel(() => ({}))
.setDefaultNodeLabel(() => ({}))
dagreGraph.setGraph({
rankdir: graphOptions.rankdir,
ranksep: graphOptions.ranksep,
edgesep: graphOptions.edgesep,
nodesep: graphOptions.nodesep,
})
...
add nodes
...
add edges
...
dagreGraph.setEdge(
edge.source,
edge.target,
{ label: edge.displayLabel, width: labelWidth, height: labelHeight },
edgeId,
)
...
layout(dagreGraph, { labelpos: 'c', labeloffest: 1000, minlen: 1000, weight: 1000 })
Calling layout with and without EdgeConfig option returns the same coordinates for the Edge label
Metadata
Metadata
Assignees
Labels
No labels