d3.js visualization on android 2.3

前端 未结 2 1138
抹茶落季
抹茶落季 2021-02-10 01:44

I know that the android browser for 2.3 does not support SVG, but I\'d like to know whether I could convert a d3.js SVG Visualization to a canvas using Canvg on clientside. Is t

2条回答
  •  生来不讨喜
    2021-02-10 02:09

    Android does support Canvas, so that's certainly a good option (as far as SVG support goes, you are right that Android 2.3 is not compatible).

    You can actually use canvas directly in d3; here is a comparison that Mike Bostock made showing the differences between using SVG and Canvas using a simple example:

    Canvas Swarm / SVG Swarm

    Keep in mind that you're not just limited to SVG or Canvas; for instance, www.nytimes.com/interactive has been seen using d3.js with HTML elements for visualizing (I'm suspecting for better cross-browser support).
    See: http://www.nytimes.com/interactive/2012/02/13/us/politics/2013-budget-proposal-graphic.html

提交回复
热议问题