Here is some code that I am working with:
var row = 4;
var col = 4;
var stack = d3.layout.stack();
var layers = stack( d3.range(row).map(function() {
return CmcLayer(col);
}));
function CmcLayer(col) {
var a = [1, 2, 3, 4];
return a.map(function(d, i) { return {x: i, y: d}; });
}
Ideally, I would like to pass in data in this format or something similar:
var a = [[1, 2, 3, 4],
[4, 3, 2, 1],
[1, 2, 3, 4],
[4, 3, 2, 1]];
What modifications are required to make it accept multiple rows?