html5 – IE8中可用的D3替换(带有D3和svg的图形)

前端之家收集整理的这篇文章主要介绍了html5 – IE8中可用的D3替换(带有D3和svg的图形)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经开发了工作D3驱动图表,就所有其他浏览器而言,没有问题.

但最近在Internet Explorer 8中也需要支持它们.

但到目前为止,我无法在IE8中显示这个html.

这些是D3中使用的标签

<svg> <path> <g> <line> <circle> <rect>

在过去6个小时中,我已经浏览了很多材料和问题,包括

Display inline SVG in IE8”,自2012年10月起就有this answer

I have been looking into this too and a number of options came up.

  • 07002 – A browser plug-in that actually uses chrome underneath,meaning SVG just works. This is great if you’re able to deploy plugins to the browser,for a real commercial environment however this may not be possible.

  • 07003 – The aim is it bring SVG to all browsers. It looks like a fairly large project,one that’s had Google’s input. This doesn’t however work out of the Box with D3 though I don’t know much about the issues.

  • 07004 – You’ve mentioned this one,I found again it doesn’t work out of the Box. Check the project out on GitHub,there hasn’t been any commit activity in months and there’s some pull requests “first pass on trying to get support for .on() required for event binding”. If it doesn’t support events,is that an issue to you? I’d generally keep away from this one.

  • 07005 – Again another one you mentioned. I took the Sankey example from the D3 website and had to make a few changes to get it working. The main things I couldn’t get working (Drag Events,Groups – though can use an alternative). It took about a day of effort to get the example working in IE8 and I believe is in a useable state. The project on GitHub is also much more active,the developer is committing,pulling work in and is very active on discussions etc. This gets my vote.

也:

D3 IE8 Compatibility?

wikipedia.org/wiki/Scalable_Vector_Graphics

SVG Web Compatibility

但是使用客户端插件解决方案是不可接受的,到目前为止,我看不到在IE8中显示svg.
所以解决方案是找到一些其他方法来渲染向量图.
我认为别人有同样的问题

编辑:

无论哪种方式,在我之后遇到同样问题的人至少会有一些集中的材料,并且会意识到,在IE8上显示svg并没有简单/真实的解决方案,更好地花费时间从现有的代码重写/调整为非-svg版本

编辑:

经过一些测试,我会说它值得尝试通过R2D3的例子,看看它是否可能简化/执行IE8中的代码

Samples

编辑:

在分别测试不同元素的过程中,似乎出现了一些r2d3问题

最常见的是Invalid argumentObject doesn’t support this property or method

因为我不习惯为IE8开发,有一些有用的提示,我发现:

dump javascript vars

display objects

解决方法

不幸的是,大多数现在支持IE8的用户都受到客户限制而不是消费者的限制.

没有通知那些已经要求它的限制,向后兼容性和成本影响以及这个帖子的重要链接,在IE7 / 8中制作画布工作和使用JScharts变体的解决方案是最好的选择.

当然,这意味着不要使用D3,除非你想加倍你的工作负载=成本.只要记住每次都提到.

祝你好运

原文链接:https://www.f2er.com/html5/168732.html

猜你在找的HTML5相关文章