Accessing d3.js element attributes from the datum?

前端 未结 4 1236
鱼传尺愫
鱼传尺愫 2021-01-30 20:28

I\'m trying to access the cx & cy attributes of some specific svg circles which i have already drawn to the screen using d3.js\'s .data() function, can anyone help out? The

4条回答
  •  死守一世寂寞
    2021-01-30 21:18

    There is even simpler way: (providing index i is given)

    d3.selectAll("circle")[0][i].attributes.cx.value
    

    as it can be seen here.

提交回复
热议问题