dagrejs / dagre-d3

A D3-based renderer for Dagre
MIT License
2.83k stars 588 forks source link

Render only, without layout-ing #363

Open Aconitin opened 5 years ago

Aconitin commented 5 years ago

Hey,

I have a very large graph that I am calculating the layout for and then rendering using dagre, with the usual:

render(d3.select("svg g"), g);

However: When I reload the page, I would like the rendering (the "showing up") of the graph to be a lot faster. I found out that calculating the layout is what takes most time, not the rendering itself, so now I would like to calculate the layout once, then serialize and safe the graph, and from then on just load the graph (with its layout) and render it., which should be a lot faster.

Since the above function call includes running the layout, I was wondering about whether this is supported, and how I could use this library to only render a pre-layouted graph.

All the best