I have a json object structured in the following way
{
"tweet":[
{"text": "hello world"},
{"text": "hello world"}
]
}
When I check the console output of "data" in my code below, it shows me an Object tweet: Array[131]
. However, when I look at the value of "dots" where I'm binding my data, it displays 0: Array[1]
. What could be causing this discrepancy?
d3.json("tweets.json", function(error, data){
if (error) return console.warn(error);
// Shows an `Object tweet: Array[131]`
console.log(data);
var dots = svg.selectAll("circle")
.data(data)
.enter()
.append("circle");
// Displays `0: Array[1]`
console.log(dots);
}