我正在尝试转换CSV文件
Year,Make,Model,Length
1997,Ford,E350,2.34
2000,Mercury,Cougar,2.38
得到结果
[
{"Year": "1997", "Make": "Ford", "Model": "E350", "Length": "2.34"},
{"Year": "2000", "Make": "Mercury", "Model": "Cougar", "Length": "2.38"}
]
我正在查看mbostock的网站: https://github.com/mbostock/d3/wiki/CSV
var dataset = []
d3.csv(link, function(data) {
dataset = data;
});
我们可以从异步函数中获取全局变量吗?