我正在使用d3.queue加载3个csv,并希望在等待中获取函数调用内的对象。这甚至是可能的。
dmObj.loadAllData = function (url1,url2,url3) {
d3.queue(1)
.defer(d3.csv, url1)
.defer(d3.csv, url2)
.defer(d3.csv, url3)
.await(processus);
function processus(error,data1, data2, data3) {
if (error) throw error;
ref14data = data1;
townsCSV = data2;
learningProviders = data3;
//Create master table
combineLPwithTownData(learningProviders, townsCSV);
console.log('ref data ',learningProviders);
console.log('town',townsCSV);
combineREFwithLPdata(ref14data, learningProviders);
//Just consider "overall" assessments
ref14data = ref14data.filter(function (e) { return e.Profile === "Overall" })
console.log(ref14data);
我想访问ref14data outsite这个函数在我的图表或任何对象中使用它。