d3 .each()
Posted xuanmanstein
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了d3 .each()相关的知识,希望对你有一定的参考价值。
d3.select("xxx") .each(function (d) { //this表示当前element 而 d表示绑定的数据 something(this); });
注意each里的this,这个文档里说得明白http://rajapradhan.com/blogs/d3-js-v4-essentials/d3-selections/
The each() method
The each() method invokes the specified function for each of the selected element.
The ‘this’ inside the function refers to the current element of the selection being iterated.
以上是关于d3 .each()的主要内容,如果未能解决你的问题,请参考以下文章