【发布时间】:2015-03-30 04:20:39
【问题描述】:
编辑 > 修正:https://bugs.chromium.org/p/chromium/issues/detail?id=364866
作品
我通过 d3js 生成 svg 路径。 data() + mesh() 或 datum() + mesh() 工作。
svg.append("g").attr("id","border")
.attr("style", "fill: none; stroke:#646464;")
.selectAll("path")
.data([topojson.mesh(json, L0, function(a, b) { return a !== b; })])
.enter().append("path")
.attr("d", path);
或:
//inland borders lines
svg.append("g").attr("id","coast")
.attr("style", "fill: none; stroke:#646464;")
.append("path")
.datum(topojson.mesh(json, json.objects.admin_0, function(a,b){return a===b;}))
.attr("d", path);
休息
将 stroke-dasharray: 8,4 结果添加到:
将其更改为 stroke-dasharray: 6,3,3,3 结果为:
出现一些人工制品,一半的笔划丢失/不可见(与 Ind/Pakistan、Ind/Nepal、Ind/Myamar、Myamar/Cambodia 接壤)。如果我在海岸线生成中添加类似的stroke-dasharray,同样会出现蓝线。
编辑:好的。首先,我很困惑,因为 topojson.mesh() 总是返回一个 MultiLineString,而后者又会生成一个路径。但是为什么“dasharray:none”工作正常!??
任何想法?我认为这些 dasharray 使路径的一部分没有关闭。 (检查中)。
【问题讨论】:
-
好的:首先,我很紧张,因为 topojson.mesh() 返回一个 MultiLineString,它反过来生成一个路径。但是为什么
"dasharray:none"工作正常!?? -
您似乎在使用 Chrome。其他浏览器也会发生同样的事情吗?
-
@PaulLeBeau:在 FF 上运行良好。 24 小时,我与这个战斗。
-
你能提供一个最小的、功能齐全的测试用例来重现这个问题吗?
-
目前已修复:crbug.com/438390
标签: google-chrome svg d3.js chromium topojson