更新1:
嘿,即使我使用CDN,我也无法定义...能帮我cdnjs.cloudflare.com/ajax/libs/d3/5.7.0/d3.min.js console.log(d3.version);
我正在尝试运行具有机场动画的d3地图。因此,我下载了文件并运行了它,但是我看不到地图。你能告诉我问题是什么吗?
现在我看到一个错误
Uncaught TypeError: Cannot read property 'mercator' of undefined
https://github.com/thtruo/30-Days-of-D3/tree/master/Project%2010%20-%20Flight%20Animation
var projection = d3.geo.mercator()
.scale(110)
.translate([width / 2, height/ 2]);
var path = d3.geo.path()
.pointRadius(2)
.projection(projection);
var svg = d3.select(".wrapper")
.append("svg")
.attr("class", "main")
.attr("width", width)
.attr("height", height);
// Add background for ocean color
svg.append("rect")
.attr("class", "background")
.attr("width", width)
.attr("height", height);