ciena-blueplanet / dagre

Directed graph renderer for javascript
MIT License
36 stars 13 forks source link

Make layout be immutable #7

Open c-dante opened 8 years ago

c-dante commented 8 years ago

Layout is already copying the graph -- why not let it be immutable?

Just export each of the layout functions: buildLayoutGraph, runLayout, and updateInputGraph.

Also, you could just return the layoutGraph and let someone else merge it in if they want.

https://github.com/ciena-blueplanet/dagre/blob/master/src/layout.js#L416