graphd3.jsforce-layoutjsnetworkx

JSNewtworkX stop layout


i'm using JSNetworkX for graph exploration and rendering.

JSNetworkX is using D3.js for graph render. However, as I work with large graph (json file about 5Mb), I would like to render this graph directly without any animations (so, in placing each node directly without force attraction).

I try to use D3.layout.force().stop() after rendering, but it's without effects. Because of that, I'm thinking that it has to be done in jsnx.draw, see my code below.

jsnx.draw(G, {
    element: 'body',
    d3: d3,
    layout_attr: {
        charge: -1500,
        linkDistance: 1,
        gravity: 1,
        friction: 0.4,
        alpha: -100
    },
});
force = d3.layout.force();

Solution

  • Unfortunately, you can't do that with the current version. Do you need a force layout at all or do you already have positions for each node? FWIW, if you really have a large graph, even a static layout would be slow, because you'd still have too many SVG elements. The next version will include a WebGL rendered for large graphs.

    So, we can't for the moment.