根據這裏給出的解決方案:Creating a table linked to a csv fileD3創建表
我不明白,在這部分代碼會發生什麼:
var cells = rows.selectAll("td")
.data(function(row) {
return columns.map(function(column) {
return row[column];
});
})
我知道,數據()將在每個循環我的數組'行'中的元素,並且Array.prototype.map()將「創建一個新的數組,其結果是在此數組中的每個元素上調用一個提供的函數」。
在return columns.map(function(column)
,'列'究竟是什麼?
如果有人能夠一步一步解釋由兩個匿名函數形成的循環,我將不勝感激。