dagrejs / dagre-d3

A D3-based renderer for Dagre

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Set individual nodesep

haexhub opened this issue · comments

commented

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? :)