d3.js - d3 selectAll and accesing item with index gives different result -



d3.js - d3 selectAll and accesing item with index gives different result -

when selectall , expand returned array shows 1 result below

prevchart.selectall(".line")

result in console shows

[array[1]0: pathlength: 1parentnode: g__proto__: array[0]

but when prevchart.selectall(".line")[0] retun matching dom element below <path class="line" d="m20,46.753246753246756l152,37.40259740259741l284,28.051948051948052l416,9.350649350649356l548,0l680,18.701298701298704"></path>

if notice selectall homecoming different result javascript object , using index in array returns dom element.

i have attached image create more clear

why behaving this.

what need javascript object on can other operations.

the question not clear me think of import topic.

a selection array of groups a grouping array of nodes. of nodes may null , may place holder objects __data__ fellow member (if it's come in selection), rest dom elements have __data__ fellow member added. fellow member reference grouping parent node added on each group. the array of groups has behaviour added selection prototype both dimensions inherit total array behaviour built in array prototype. other members added required, store info , callbacks transitions example, selections still 2-d arrays.

edit: think trying do...

var linecharts = prevchart.selectall(".linechart") .attr("transform", function(d, i) { homecoming "translate(" + margin.left + "," + (currentyaxisheight * i) + ")" })

d3.js

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -