liveBook · Manning

Data type

As explained in D3.js in Action, Third Edition

A data type is a classification describing the kind of values represented by data and the operations or interpretations appropriate for them.

A data type identifies what values mean and helps determine how they can be manipulated or represented in a visualization. D3 projects commonly encounter nominal and ordinal data alongside CSV and JSON dataset formats. section 3.0 section 3.1

Loading tabular data can change numeric values into strings, so convert values before measuring them or using them to size and position chart elements. D3’s d3.autoType detects common dates and numbers, but ambiguous values still require checking. section 4.1

Typed weekly temperatures

Load the weekly temperature dataset with d3.csv("../data/weekly_temperature.csv", d3.autoType), inspect the resulting array, and pass it to drawLineChart(data). Dates become JavaScript dates and temperatures become numbers, ready for chart construction.

How D3.js in Action, Third Edition covers it

How deep it goes
Explains nominal and ordinal categories, string-to-number conversion, and automatic typing, but stops short of comprehensive data cleaning.
Examples
Uses nominal and ordinal data, CSV and JSON files, and a weekly temperature dataset containing dates and temperatures.
What you can do after
Apply it via D3 by converting loaded values, inspecting inferred types, and supplying correctly typed data to a chart.
How it connects
Connects data types with dataset formats, data binding, scales, JavaScript types, and asynchronous data loading.

Also explained in

Compare how 18 books explain data type →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of D3.js in Action, Third Edition. The section links point to the parts of the book it draws on.