d3的各种关键字

join

实心选择集—可以接着添加dom—selection.append(dom)

this.svg.selectAll('.path').data([1,1,1]).join('path')

Ct {_groups: Array(1), _parents: Array(1)}
_groups: [Array(3)]
_parents: [svg]
__proto__: Object

空心选择集—不能接着添加dom

this.svg.selectAll('.path').data([1,1,1]).join(enter=>{})

Ct {_groups: Array(1), _parents: Array(1), _enter: Array(1), _exit: Array(1)}
_enter: [Array(3)]
_exit: [Array(0)]
_groups: [Array(3)]
_parents: [svg]
__proto__: Object

空心选择集变实心选择集

selection.enter()

评论

发表回复

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

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