Now we're going to use JavaScript to make a request for some data.
Making an AJAX request
Writing the basic code
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...