Dagre is a JavaScript library that makes it easy to lay out directed graphs on the client-side.
For more details, including examples and configuration options, please see our wiki.
This project is not being actively developed or maintained.
dagre is licensed under the terms of the MIT License. See the LICENSE file for details.
- Include the dagre-webpack bower component. I've only used the bower-webpack-plugin to do this e.g.
new BowerPlugin({
modulesDirectories: ['..\..\bower_components'],
searchResolveModulesDirectories: false
}),
- (Optional) In your webpack.config, expose
dagre-webpack
asdagre
. This is a nicety that allows you to avoid callingrequire('dagre-webpack')
on each page that needs it.
new webpack.ProvidePlugin({
...
dagre: 'dagre-webpack'
...
});
- Instantiate your graph (assuming you completed step 1)
var g = new dagre.graphlib.Graph();
// Call g.SetEdge and g.SetNode and create your graph
dagre.layout(g);