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

前端 未结 3 781
野趣味
野趣味 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();
    }
    

提交回复
热议问题