jQuery SVG vs. Raphael [英] jQuery SVG vs. Raphael

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

问题描述

我正在使用SVG和JavaScript / jQuery进行交互式界面,我正在尝试在 Raphael jQuery SVG 。我想知道

I'm working on an interactive interface using SVG and JavaScript/jQuery, and I'm trying to decide between Raphael and jQuery SVG. I'd like to know


  1. 这两者之间的权衡是什么

  2. 似乎是发展势头。

我不需要Raphael中的VML / IE支持,也不需要jQuery SVG的绘图功能。我主要对在SVG画布上创建,动画和操作单个项目的最优雅方式感兴趣。

I don't need the VML/IE support in Raphael, or the plotting abilities of jQuery SVG. I'm primarily interested in the most elegant way to create, animate, and manipulate individual items on an SVG canvas.

推荐答案

我最近我同时使用了Raphael和jQuery SVG - 这是我的想法:

I've recently used both Raphael and jQuery SVG - and here are my thoughts:

优点:一个很好的入门库,很容易用SVG快速做很多事情。写得好,记录完整。大量的例子和演示。非常可扩展的架构。非常适合动画。

Pros: a good starter library, easy to do a LOT of things with SVG quickly. Well written and documented. Lots of examples and Demos. Very extensible architecture. Great with animation.

缺点:是实际SVG标记的一个层,因此很难用SVG做更复杂的事情 - 例如分组(它支持集合,但不支持组)。不能很好地编辑现有元素。

Cons: is a layer over the actual SVG markup, makes it difficult to do more complex things with SVG - such as grouping (it supports Sets, but not groups). Doesn't do great w/ editing of already existing elements.

优点: 一个jquery插件,如果你已经在使用jQuery了。写得好,记录完整。大量的例子和演示。支持大多数SVG元素,允许轻松本地访问元素

Pros: a jquery plugin, if you're already using jQuery. Well written and documented. Lots of examples and demos. Supports most SVG elements, allows native access to elements easily

缺点:体系结构不像Raphael那样可扩展。有些事情可以更好地记录(比如配置SVG元素)。 w /编辑现有元素不是很好。依赖动画的SVG语义 - 这不是那么好。

Cons: architecture not as extensible as Raphael. Some things could be better documented (like configure of SVG element). Doesn't do great w/ editing of already existing elements. Relies on SVG semantics for animation - which is not that great.

SnapSVG是Raphael的继承者。它仅在支持SVG的浏览器中受支持,并且几乎支持SVG的所有功能。

SnapSVG is the successor of Raphael. It is supported only in the SVG enabled browsers and supports almost all the features of SVG.

如果拉斐尔是一个轻松的选择。如果你要做更复杂的事情,我选择使用jQuery SVG,因为我可以比使用Raphael更容易操作实际标记。如果你想要一个非jQuery解决方案,那么SnapSVG是个不错的选择。

If you're doing something quick and easy, Raphael is an easy choice. If you're going to do something more complex, I chose to use jQuery SVG because I can manipulate the actual markup significantly easier than with Raphael. And if you want a non-jQuery solution then SnapSVG is a good option.

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

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