d3 / d3-dsv

A parser and formatter for delimiter-separated values, such as CSV and TSV.

Home Page:https://d3js.org/d3-dsv

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dsv.parse’s returned array should have a columns property.

mbostock opened this issue · comments

For example:

var data = csv.parse("a,b,c\n1,2,3\n");
data[0]; // {"a": 1, "b": 2, "c": 3}
data.columns; // ["a", "b", "c"]

Unlike Object.keys(data[0]), the columns field will be guaranteed to be in the same order as the source file. Related d3/d3#2653 d3/d3#858.