首页 > 其他 > 详细

d3 .each()

时间:2018-11-12 13:45:32      阅读:304      评论:0      收藏:0      [点我收藏+]

 

    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()

原文:https://www.cnblogs.com/xuanmanstein/p/9945962.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!