dagrejs / dagre-d3

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

Rendering on SVG in memory causes node positions to be reset #368

Closed knguyen4221 closed 5 years ago

knguyen4221 commented 5 years ago

I'm trying to render a graph on an html that has been created in memory. I would run layout and have the node positions generated, but after I render the graph, the node positions are reset to multiples of 50.

Here's the jsfiddle for the repro:

https://jsfiddle.net/6j42u5xw/8/

knguyen4221 commented 5 years ago

I guess it's just a limitation of the DOM object just not being there in the first place. Just worked around it by creating a non-visible DOM container for the svg.