我正在尝试实现一个d3js六边形,使其显示图像,就像在d3js网站(https://d3js.org)上显示的一样。
为了进行测试,我复制了他们网站上使用的相同代码库,但不幸的是它没有显示图像,因此我正在努力找出原因。
我曾尝试用在线和本地计算机上的图片URL替换图片URL。
这是我正在测试的源代码的链接 https://pastebin.com/WJdNaezA
var hexbin = d3.hexbin()
.radius(radius);
if (!("ontouchstart" in document)) d3.select("#examples")
.on("mousemove", mousemoved);
var deep = d3.select("#examples-deep");
var canvas = deep.append("canvas")
.attr("height", height);
var context = canvas.node().getContext("2d");
var svg = deep.append("svg")
.attr("height", height);
var mesh = svg.append("path")
.attr("class", "example-mesh");
var anchor = svg.append("g")
.attr("class", "example-anchor")
.selectAll("a");
var graphic = deep.selectAll("svg,canvas");
我的预期结果是使它显示六边形中的图像