您知道为什么在d3中这样做会显示一个圆:
node.append("circle")但不是这个:
node.append(function () {
return document.createElement("circle");
})DOM结果完全相同,但在第二种情况下,循环不可见。
发布于 2015-06-29 01:36:55
元素是在错误的命名空间中创建的--您需要显式指定SVG名称空间才能工作,因为Javascript不会自动推断它:
return document.createElementNS(d3.ns.prefix.svg, "circle");https://stackoverflow.com/questions/31106356
复制相似问题