【发布时间】:2014-08-28 11:46:27
【问题描述】:
我知道 D3 不支持 IE8,但我希望找到可以工作的东西。
我正在尝试使用 R2D3 https://github.com/mhemesath/r2d3,但我正在创建的地图仍未渲染。在页面头部加载 r2d2 后,我有:
projection = d3.geo.albersUsa()
.scale(700)
.translate([1000*0.3, 400*0.4])
path = d3.geo.path()
mapData = topojson.features(mapJSON, mapJSON.objects.states)
d3.select('svg')
.append('path')
.attr('class', 'states')
.datum(mapData)
.attr('d', path.projection(projection))
这在 chrome 中可以很好地呈现,但在 ie8 中它不起作用。
使用 r2d3 渲染
<svg width="675" height="290">
<path class="states" __data__='[object object]' d="
</svg>
所以看起来path.projection(projection) 的回调实际上并没有被执行或没有返回任何东西。从而制动 html。
此外,我的印象是 r2d3 在 ie8 中会降级为非 svg 元素。
谁有在 ie8 中渲染 d3 地图的经验?
我见过Making d3.js compatible with IE8/IE9、https://github.com/mbostock/d3/issues/619 等等。
【问题讨论】:
-
我建议为 IE8 显示地图图像,而不是交互式可视化。
标签: d3.js internet-explorer-8 raphael