[D3] Load and Inspect Data with D3 v4

Source: Internet
Author: User

You probably use a framework or standalone library to the load data into your apps, and if that's overkill for your needs ? What if you ' re just putting together a quick demo? This lesson demonstrates D3 's APIs for loading data on it own, as well as some helpful methods for inspecting your data a nd preparing it for use with D3.

function LoadData () {D3.json ('Data/data.json', function (data) {varextent =d3.extent (data, function (d) {returnd.age}); //get the value rangeConsole.log ("#Extent", extent); varMin =d3.min (data, function (d) {returnd.age}); Console.log ("#Min", Min); varMax =D3.max (data, function (d) {returnd.age}); Console.log ("#Max", Max); varAges = D3.Set(data, function (d) {returnd.age}); //get unique value out of dataConsole.log ("#Ages", Ages.values ()); varScale =d3.scalelinear (). Domain (extent). Range ([0, -]); Console.log (Scale ( at))    })}

[D3] Load and Inspect Data with D3 v4

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.