脚本SVG [英] Scripting SVG

查看:116
本文介绍了脚本SVG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我考虑显影类似于计算器一个网站,但答案也可由附图(示意图,在这种情况下)。我想有一个区域的问答形式,他们可以做出这样原理,无需特殊的插件等。

I'm considering developing a website similar to stackoverflow, but the answers may also consist of drawings (schematics, in this case). I want to have an area in the answer form where they can make this schematic without requiring special plugins, etc.

  1. 难道我们到SVG具有还是应该有临界点很快(1-2岁),使得设计一个网站,脚本运行SVG作为主要功能是合理的点(即,要求Firefox或其它SVG / AJAX兼容浏览器)?
  2. 什么是学习跨平台的SVG脚本(可能在JavaScript)的一些很好的资源?

- 亚当·戴维斯

推荐答案

不幸的是,我没有答案,但我有三分,项目你可以看看。

Unfortunately, I don't have an answer, but I do have three pointers to projects that you could look at.

首先是活泼内核通过丹·英格尔斯(是的,的的丹·英格尔斯)在Sun实验室。这是一个Smalltalk的虚拟世界中的JavaScript在SVG之上的实现。更多precisely,它是佳乐的Smalltalk的Morphic环GUI框架在JavaScript中使用SVG和(部分)佳乐的Smalltalk中的JavaScript。

The first is the Lively Kernel by Dan Ingalls (yes, the Dan Ingalls) at Sun Labs. It is an implementation of a Smalltalk Virtual World in JavaScript on top of SVG. More precisely, it is an implementation of the Morphic GUI framework from Squeak Smalltalk in JavaScript using SVG and a port of (parts of) Squeak Smalltalk in JavaScript.

或者,如果你不是一个Smalltalker和上面没有意义的你:这是一个操作系统,用JavaScript编写的JavaScript的跨preTER作为CPU,SVG的图形卡和浏览器作为计算机

Or, if you're not a Smalltalker and the above doesn't make sense to you: it's an Operating System, written in JavaScript with the JavaScript interpreter as the CPU, SVG as the graphics card and the browser as the computer.

这是一个关于极端,因为它得到,当它涉及到JavaScript和SVG。而且它只的完全的工作在Safari 3,部分在Firefox 3中,虽然有一个实验性的端口到Internet Explorer为好。

This is about as extreme as it gets, when it comes to JavaScript and SVG. And it only fully works in Safari 3 and partly in Firefox 3, although there is an experimental port to Internet Explorer as well.

第二个项目是处理可视化语言的JavaScript约翰Resig的 Processing.js 端口。它使用了<画布> 元素,而不是SVG $ P $的pcisely因为你提到的问题。这其中然而,只有在Firefox 3。

The second project is John Resig's Processing.js port of the Processing visualization language to JavaScript. It uses the <canvas> element instead of SVG precisely because of the problems that you mentioned. This one however, only works in Firefox 3.

第三个是实时三维由无用酱菜的JavaScript 。它使用的只有的的JavaScript,DOM和CSS的没有的SVG和&LT;画布&GT; 或Flash或什么的。 的是移植到几乎所有的浏览器,包括Internet Explorer 7和最多。这样做2D应该比这更容易。

The third one is Real-Time 3D in JavaScript by Useless Pickles. It uses only JavaScript, DOM and CSS and no SVG or <canvas> or Flash or whatever. And it is portable to almost any browser, including Internet Explorer 7 and up. Doing 2D should be even easier than this.

这三个项目之间,你应该能够找到一些灵感,并找一些人谁试图推动信封JavaScript和SVG或JavaScript和图形,并能告诉你什么可行,什么不可行。

Between those three projects you should be able to find some inspiration and also to find some people who tried to push the envelope with JavaScript and SVG or JavaScript and Graphics and can tell you what works and what doesn't.

结论:在做跨浏览器的SVG或跨浏览器的&LT;画布&GT; 是几乎是不可能的,但与疯狂的一点点,跨浏览器的图形的没有的SVG和&LT;画布&GT; 可以

Conclusion: doing cross-browser SVG or cross-browser <canvas> is nigh impossible, but with a little bit of craziness, cross-browser graphics without SVG or <canvas> is possible.

这篇关于脚本SVG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆