From the course: D3.js Essential Training for Data Scientists

Introducing external data - D3.js Tutorial

From the course: D3.js Essential Training for Data Scientists

Start my 1-month free trial

Introducing external data

- [Instructor] Until now, we've created our own arrays for data, like here, var dataArray. But in reality, we wouldn't want to type out a whole dataset into JavaScript. What we would normally do is pull data in from a database or file. D3 is ready to help us with this, as it contains a number of data handlers that can make sense of different file formats. D3 has built-in handlers for XML, CSV, TSV, HTML, text files, and JSON. There's also a DSV data handler that can pass data with a delimiter you specify, such as a pipe, and you can write your own data handler too. Some of the data handlers are very similar, so we're going to group them together. CSV, TSV, and DSV are virtually identical, so we'll take a look at those together. Then we'll have a look at JSON and XML files. And finally, I'll introduce you to the methods you would need to get data from a URL or a database.

Contents