Structured data organizes information in recognizable patterns. Tabular data uses rows and columns: each row represents a record, while columns identify fields. It commonly appears in spreadsheets, database tables, and delimited files. section 3.1.3
Identify tabular data by its delimiter and loading method:
- CSV separates values with commas, TSV uses tabs, and DSV lets you specify another delimiter, such as a pipe or semicolon. section 3.1.3
- The first line usually contains column headers, and each following row contains one dataset entry. section 3.1.3
- D3 loads these formats with d3.csv(), d3.tsv(), and d3.dsv(), then transforms the data into an array of objects. section 3.1.3 section 3.6
- Wait for asynchronous loading to finish before manipulating values or building a visualization; use then() to access the complete dataset. section 3.6
One dataset, three delimiters
An employee dataset can be written as CSV with commas, TSV with tabs, or DSV with pipes. Each version can contain the same headers—id, name, and works_with_d3—and the same rows for Zoe, James, Alice, and Hubert. section 3.1.3
Table 3.1 Delimited data expressed in CSV, TSV, and DSV formats
|
CSV: Comma-Separated Values
|
TSV: Tab-Separated Values
|
DSV: Delimiter-Separated Values (with a pipe delimiter)
|
|---|---|---|
id,name,works_with_d3
|
id name works_with_d3
|
id|name|works_with_d3
|
|
1,Zoe,false
|
1 Zoe false
|
1|Zoe|false
|
|
2,James,true
|
2 James true
|
2|James|true
|
|
3,Alice,true
|
3 Alice true
|
3|Alice|true
|
|
4,Hubert,false
|
4 Hubert false
|
4|Hubert|false
|
Compare the same tabular dataset expressed in CSV, TSV, and pipe-delimited DSV form. section 3.1.3























