http://mbostock.github.com/d3/ex/calendar.html
Also see:
https://github.com/mbostock/d3/wiki/CSV
Mike
Yes, d3.csv is a helper that uses d3.csv.parse internally to parse CSV
data loaded from a URL into an array of objects, and then it passes this
to a callback. So your example code wouldn't work because your callback
would be called with an array of objects, and calling d3.csv.parseRows
wouldn't work on this array.
If you want to parse into an array of arrays, then you should do:
d3.text(url, "text/csv", function(text) {
var rows = d3.csv.parseRows(text);
// Do stuff with rows here...
});
In fact, this boils down to replacing "d3.csv(...)" with "d3.text(...)"
(with "text/csv") in your example, so you were almost there. :)
Hope that helps,
--
Jason Davies, http://www.jasondavies.com/
d3.text("csvfile", "text/csv", f_csv);
function f_csv(csv)
{var rows = d3.csv.parseRows(csv);a_data = rows;}
var globalRows;
d3.csv('file.csv', function (err, rows) {
if (err) throw err;
globalRows = rows;
});
--
You received this message because you are subscribed to the Google Groups "d3-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.