1
嘿即时通讯使用这种d3 tree.D3树 - 接近同一母公司的所有儿童
有没有一种可能,关闭所有其他子节点,当我一个节点上单击具有相同的父。我想应该是这样的,但我不知道对其进行修改:
// Transition exiting ndoes to the parent's new position.
var nodeExit = node.exit().transition()
.duration(duration)
.attr("transform", function(d) { return "translate(" + source.y + "," + source.x + ")"; })
.remove();
nodeExit.select("circle")
.attr("r", 1e-6);
nodeExit.select("text")
.style("fill-opacity", 1e-6);
因此,举例来说,如果你看一下在working example:
Topic_2被点击和它的孩子(子主题4 ,副主题5,二级主题6)所示
我点击TOPIC_1 - TOPIC_1的儿童开放
Topic_2 S的儿童大厅关闭