首页 > 其他分享 >D3删除节点

D3删除节点

时间:2023-02-09 17:33:58浏览次数:33  
标签:function return 删除 D3 节点 null id select fill

function deleteNode(d){

    var deletelinks = links.select(function(x) {
        return x['source'].id==d.id||x['target'].id==d.id?this:null;
    })

    deletelinks.remove();

    var deletenode = nodes.select(function(x){
        return x.id==d.id?this:null;
    })

    deletenode.remove();

}

function highlightNode(current, currentD){
    currentD.highlightFlag = true;
    current.select(".circles1").transition()                
        .attr("r", function(d){return get_circle_r(d)})
        .attr("fill", function(d){return get_circle_fill(d)});
}

 

标签:function,return,删除,D3,节点,null,id,select,fill
From: https://www.cnblogs.com/carriexu/p/17106392.html

相关文章