dagre-d3 icon indicating copy to clipboard operation
dagre-d3 copied to clipboard

Set individual nodesep

Open haexhub opened this issue 5 years ago • 0 comments

Hi, I would like to change the nodeseparation per node and not globally like this:

var g = new dagreD3.graphlib.Graph()
.setGraph({ rankdir: 'LR', edgesep: 10, ranksep: 60, nodesep: 10 })

I'm looking for something like this:

var g = new dagreD3.graphlib.Graph().setGraph({ )
g.nodes().forEach(label => {

    if (label == 'the answer') {
      let node = g.node(label)
      node.nodesep = 42
    }
  })

How can I do that? :)

haexhub avatar Jan 04 '20 12:01 haexhub