According to my code, it looks like key_square and key_line divisions should be sibling elements to key_row since I am appending them to the division "key", but they are descendants of key_row.
Could someone explain this to me?
Thank you,
<body>
<div id="timeseries">
</div>
<div id="key">
</div>
<script>
var key = d3.select("#key")
.selectAll("div")
.data(data)
.enter()
.append("div")
.attr("class","key_row")
.attr("id",function (d){ return d.line_id;})
//add square
key.append("div")
.attr("class", "key_square")
.style("background-color","#C8DAF8")
//d3.select("#key")
key.append("div")
.attr("class","key_id")
.attr("id","key_line")
.style("background-color","#E9F0FC")
.text(function (d) { return d.line_id;});