gpt4 book ai didi

internet-explorer - Mike Bostock 如何在 "512 Paths to the White House"中获得不错的箭头?

转载 作者:行者123 更新时间:2023-12-04 07:50:29 24 4
gpt4 key购买 nike

当看 512 Paths to the White House您可以看到每个“路径”的箭头始终正确呈现,即使在 Internet Explorer 9 中也是如此。众所周知,IE(最多 11 个)has problems rendering markers .

我复制了原版SVG代码 1 到 1 从 the graphicfiddle ,并且它不起作用(在 IE9+10 中测试),箭头呈现为正方形。

<svg height="650" width="970">
<defs>
<marker orient="auto" viewBox="-.1 -5 10 10" id="g-arrowhead-rep"><path class="g-marker g-rep" d="M-.1,-4L3.9,0L-.1,4"></path></marker>
</defs>
<g>
<path style="stroke-width: 16.5px;" marker-end="url(#g-arrowhead-rep)" class="g-link g-dem" d="M416.75,0C416.75,60.5,148.43655105625137,60.5,148.43655105625137,121"></path>
</g>
</svg>

我在 Bostock 的代码中找不到任何提示(但也没仔细看)。他用什么黑魔法让它正确显示?

最佳答案

这是在应用于图表、箭头主体路径、标记对象和标记对象内的路径定义的多个级联类之间仔分割配填充和描边责任。

如果您使用无填充组包装器(主体中的笔画),但在标记路径定义本身中使用 fill=something 和 stroke=none,则标记可以在 IE10+ 中使用。例如

<svg height="650" width="970">
<defs>
<marker orient="auto" viewBox="-.1 -5 10 10" id="g-arrowhead-rep"><path d="M-.1,-4L3.9,0L-.1,4" stroke="none" fill="blue"></path></marker>

</defs>
<g transform="translate(60,85)" fill="none">
<path stroke="blue" stroke-width="16" marker-end="url(#g-arrowhead-rep)" d="M416.75,0C416.75,60.5,148.43655105625137,60.5,148.43655105625137,121"></path>
</g>
</svg>

关于internet-explorer - Mike Bostock 如何在 "512 Paths to the White House"中获得不错的箭头?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27267259/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com