简体   繁体   English

带处理与纯Javascript的HTML5画布

[英]HTML5 canvas with Processing vs. Pure Javascript

I have some data visualization animations I want to do in a webapp I have and am considering different alternatives I have. 我有一些我想在webapp中做的数据可视化动画,我正在考虑我有不同的选择。 It will basically just be moving around text strings in a pretty way. 它基本上只是以漂亮的方式移动文本字符串。

I am using the Mootools framework and the Mootools FX library basically have the stuff i want, but I want to manipulate around 100 text strings, which means each string would need a separate FX object (I think). 我使用Mootools框架和Mootools FX库基本上有我想要的东西,但我想操纵大约100个文本字符串,这意味着每个字符串将需要一个单独的FX对象(我认为)。

The alternative to doing this is coding the entire thing in Processing and use Processing.js to render it to an HTML5 canvas. 执行此操作的替代方法是在Processing中编写整个内容,并使用Processing.js将其呈现为HTML5画布。

Which of these things go easiest on the browser (I don't want the site to be client-side heavy)? 浏览器中哪些内容最简单(我不希望网站在客户端很重)? Are there any other ways that might be even better? 还有其他方法可能更好吗?

Or use client-side SVG. 或者使用客户端SVG。 It should have no problems displaying and manipulating 100 text strings, and is supported in much the same browsers as Canvas is (and IE supports VML, which provides similar functionality). 它应该没有显示和操作100个文本字符串的问题,并且在与Canvas相同的浏览器中得到支持(并且IE支持VML,它提供类似的功能)。

@austin, Apache Batik is a server-side SVG renderer. @austin,Apache Batik是一个服务器端SVG渲染器。

I would not adopt for support of the canvas element at this time since only the newest version of most browsers support it. 我现在不会采用canvas元素的支持,因为只有最新版本的大多数浏览器都支持它。 I would wait until support is common, which could take a little while. 我会等到支持很普遍,这可能需要一段时间。 Keep in mind HTML5 is not a standard yet, and is still subject to change. 请记住,HTML5尚未成为标准,仍有待更改。

You might want to research SVG and see if there is a server side SVG parser where the output could be converted to PNG. 您可能想要研究SVG并查看是否存在服务器端SVG解析器,其中输出可以转换为PNG。

顺便说一句,处理只是Java,因此你应该能够在其中编写并在applet中显示它。

为什么不动作3,此时闪存播放器的渗透率要高于支持html 5。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM