Vector graphics in Javascript?
Asked Answered
I

7

17

One of the advantages of Flash/Flex is that you can use vector graphics (SVG), which is nice. I did a bit of searching around and came across this Javascript vector graphics library. It's pretty simple stuff but it got me thinking: is there any possibility of using vector graphics files such as SVG with Javascript/HTML or it just can't be done or done reasonably?

Incur answered 4/1, 2009 at 0:20 Comment(1)
How does Flash allow to use SVG? The best you can do is to write an incomplete emulator of SVG using Flash. The best attempt so far is code.google.com/p/svgweb but it is not there yet too.Disoperation
L
6

I've used Raphaël Javascript Library and it worked quite well. Currently the library supports Firefox 3.0+, Safari 3.0+, Opera 9.5+ and Internet Explorer 6.0+.

Lenticular answered 4/1, 2009 at 0:25 Comment(0)
G
10

I know this is a pretty old question, but in case anyone comes across this question, the most impressive vector graphics I've seen in JavaScript is Paper.js.

Hope that helps.

Gluttony answered 7/7, 2011 at 1:40 Comment(1)
Unfortunately it doesn't work in IE8(only version of IE I tested it on), but it definitely had the most impressive demo I have ever seen!Couchman
L
6

I've used Raphaël Javascript Library and it worked quite well. Currently the library supports Firefox 3.0+, Safari 3.0+, Opera 9.5+ and Internet Explorer 6.0+.

Lenticular answered 4/1, 2009 at 0:25 Comment(0)
K
3

Give a look to Cake, Processing.js and jQuery SVG Integration Plugin.

Also check the Canvas element reference.

Krissie answered 4/1, 2009 at 0:30 Comment(0)
D
1

Take a look at dojox.gfx. I posted more wordy answer in Recommend javascript graphics tutorials going over available graphics options in browsers including 2D and 3D cases.

Disoperation answered 4/1, 2009 at 18:21 Comment(0)
T
1

Check out Google Closure. The vector graphics support is very well-done, IMO. If you've worked with Java2D before, this should seem very familiar.

Trotskyism answered 7/1, 2010 at 16:29 Comment(2)
does it work on browsers that do not support svg? do you just say goog.createGraphics and it decides whether to use Canvas, Svg or VML?Mart
@Evgeny, yes - it uses VML for IE with browser auto-detect.Trotskyism
E
1

Check out WebCode app from PixelCut. It generates JS, SVG, HTML from vector drawings. http://www.webcodeapp.com

Expound answered 22/4, 2013 at 10:49 Comment(0)
G
0

Just to add an additional answer. the creator of one of the popular vector js (Raphaël) joined Adobe and worked on this (http://snapsvg.io/) for several years.

although the last release is from 2017 its much more maintained and newer than other libraries mentioned here. hope this helps someone looking for svg vector graphics library in js.

if you are looking for a meteorjs build for snap you can get it here (https://atmospherejs.com/mirageglobe/snapsvgcdn) with

$ meteor add mirageglobe:snapsvgcdn
Guido answered 2/3, 2019 at 15:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.