D3 has lots of different methods for making AJAX requests to files of different data types:
d3.json('path').then(function(data){
//do something with the json data here
});
d3.csv('path').then(function(data){
//do something with the csv data here
});
d3.tsv('path').then(function(data){
//do something with the tsv data here
});
d3.xml('path').then(function(data){
//do something with the xml data here
});
d3.html('path').then(function(data){
//do something with the html data here
});
d3.text('path').then(function(data){
//do something with the text data here
});
Since our data is in JSON format, we'll use the first kind of call. Add the following to the end of app.js:
d3.json('data.json').then(function(data){ console ...