Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vector graphics in Javascript?

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?

like image 856
cletus Avatar asked Jan 04 '09 00:01

cletus


People also ask

Can JavaScript do graphics?

Typical uses for graphics include banners, ads from sponsoring companies, and colored bullets to highlight important pieces of text. The JavaScript scripting language can be used to enhance the graphics you put on your Web pages. JavaScript can be used to dynamically control the graphic content of the page.

What is vector graphics in HTML?

Vector images are defined using algorithms — a vector image file contains shape and path definitions that the computer can use to work out what the image should look like when rendered on the screen. The SVG format allows us to create powerful vector graphics for use on the Web.

Which JavaScript language generates vector based graphics for use on the Web?

js, two. js (opens in new tab) is an open-source JavaScript library for two-dimensional drawing on the web. It is also able to target all three graphics options in modern browsers: SVG, Canvas and WebGL.

What is SVG in JavaScript?

SVG is a language for describing 2D graphics in XML. Canvas draws 2D graphics, on the fly (with a JavaScript). SVG is XML based, which means that every element is available within the SVG DOM. You can attach JavaScript event handlers for an element. In SVG, each drawn shape is remembered as an object.


1 Answers

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.

like image 183
Andy Avatar answered Nov 15 '22 13:11

Andy