Collapsible/hierarchical AND force-directed graph in d3.js

前端 未结 3 774
野趣味
野趣味 2021-02-04 07:19

There are numerous examples of force-directed graphs (i.e. nodes and links) and collapsible trees (i.e. parent-child nodes) but I cant find an example of the combination of thes

相关标签:
3条回答
  • 2021-02-04 07:26

    i try to merge both examples here my fiddle

    // Toggle children on click.
    function click(d) {
    if (d.children) {
        d._children = d.children;
        d.children = null;
    } else {
        d.children = d._children;
        d._children = null;
    }
    update();
    }
    
    0 讨论(0)
  • 2021-02-04 07:39

    Here is a nice example that exhibits both properties http://bl.ocks.org/mbostock/1093130

    0 讨论(0)
  • 2021-02-04 07:44

    I'm also interested in this. I have found two examples, that I'd like to combine.

    http://bl.ocks.org/mbostock/1062288 http://graus.nu/d3/

    0 讨论(0)
提交回复
热议问题