d3selection选择集的理解

选择集里面只有group是可以直接接selection的方法

selection.fn

data=[
      [60,200],[200,200],[340,200]
    ]
    let g=this.svg.selectAll('.circle').data(data).join(enter=>{
      enter.append('circle')
             .attr('r',50)
                 .attr('cx',d=>d[0])
                 .attr('cy',d=>d[1])

    })
    g.attr('r',50)
                 .attr('cx',60)
                 .attr('cy',200)
    console.log(g);
_enter: [Array(3)]
_exit: [Array(1)]
_groups: [Array(3)]
_parents: [svg]

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理