删除固定类不会从预设中正确删除它们 [英] Removing fixed classes does not properly remove them from the presetation
本文介绍了删除固定类不会从预设中正确删除它们的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我现在可以删除固定的类。但是节点仍然固定。
I can remove the fixed classes now. But the nodes are still fixed in the view.
所以简单地删除类是不够的我相信。我没有在D3的文档中找到任何帮助。
So simply removing the class is not enough I believe. I didn't find any help in the docs of D3 as well.
推荐答案
你想回到强制布局?
因为你只是删除了类而不是实际的固定属性。
Its because you have only removed the class not the actual fixed property.
p>
Try this :
d3.selectAll(".node") //select your node here
.each(function(d){d.fixed = false;})
.classed("fixed", false);
force.start(); //-bring the force layout back
更新小提琴: http://jsfiddle.net/d2gjxy7n/11/
这篇关于删除固定类不会从预设中正确删除它们的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文