dagrejs / dagre-d3

A D3-based renderer for Dagre
MIT License
2.86k stars 592 forks source link

How to control the default distance between two nodes #271

Open Lily-Jian opened 7 years ago

Lily-Jian commented 7 years ago

There is no label on the edge of time, I feel the distance between them is too long, how to modify the default distance between two nodes, or the shortest distance?

shayan90 commented 7 years ago

Hey you can specify properties when you set your graph

g = new dagreD3.graphlib.Graph();
             g.setGraph({
                 nodesep: 25
             });

You can read more on the properties here: https://github.com/cpettitt/dagre/wiki#configuring-the-layout

Lily-Jian commented 7 years ago

First of all, thank you very much I want to set the node of a fixed width, if the inside of the text is overmuch,then word wrap.can you help me?