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

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Parsing JSON

Parsing JSON - D3.js Tutorial

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

Start my 1-month free trial

Parsing JSON

- [Instructor] Now we're going to look at how to gt JSON data into our D3. JSON stands for Javascript Object Notation. It's a way to store and exchange data. It's a bit like XML, but people find it lighter, faster, and easier to use. JSON is not peculiar to D3, but because it's Javascript-based, they work very well together. And this is what JSON looks like. If you don't have access to these files, you can copy what's on your screen now. Bear in mind that all of the JSON data comes within a square bracket to the top and the bottom, meaning that it's an array. And then within that array, we have curly brackets or objects. So here we have a top level entity which doesn't have any parents. Below that we have two children, A, which is at level two, and B, which is at level two. And then each of those children have some children, one or two. The children are also contained within an array, and each child takes exactly the same format as the parents. So now go to DataHandlers, and we're…

Contents