topojson/d3.js:Uncaught(承诺中)TypeError:无法读取未定义的属性“type”

topojson/d3.js:Uncaught(承诺中)TypeError:无法读取未定义的属性“type”,d3.js,topojson,D3.js,Topojson,我正试图从数据可视化认证中开发freeCodeCamp的第四个项目,choropleth地图。这是我写的: 常量本票=[d3.json'https://raw.githubusercontent.com/no-stack-dub-sack/testable-projects-fcc/master/src/data/choropleth_map/counties.json“,d3.json”https://raw.githubusercontent.com/no-stack-dub-sack/t

我正试图从数据可视化认证中开发freeCodeCamp的第四个项目,choropleth地图。这是我写的:

常量本票=[d3.json'https://raw.githubusercontent.com/no-stack-dub-sack/testable-projects-fcc/master/src/data/choropleth_map/counties.json“,d3.json”https://raw.githubusercontent.com/no-stack-dub-sack/testable-projects-fcc/master/src/data/choropleth_map/for_user_education.json']; promiss.allpromisses.thend=>{return processDatad}; 函数processDatadata{ 对于let i=0;i
topojson.feature(topology, object);
您只指定了要提取的对象:

 let counties = topojson.feature(data[0].objects.counties);
该错误可能源于缺少第二个参数:第二个参数的类型未定义,因为第二个参数未定义

使用这两个参数,您可以使用以下两个参数无误地提取特征:

let counties = topojson.feature(data[0], data[0].objects.counties);
常量本票=[d3.json'https://raw.githubusercontent.com/no-stack-dub-sack/testable-projects-fcc/master/src/data/choropleth_map/counties.json“,d3.json”https://raw.githubusercontent.com/no-stack-dub-sack/testable-projects-fcc/master/src/data/choropleth_map/for_user_education.json']; promiss.allpromisses.thend=>{return processDatad}; 函数processDatadata{ 对于let i=0;i