04.07.2013 Views

Building Web Applications with SVG - Cdn.oreilly.com

Building Web Applications with SVG - Cdn.oreilly.com

Building Web Applications with SVG - Cdn.oreilly.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 1<br />

<strong>SVG</strong> Basics<br />

I decided that if I could paint that flower in a huge scale, you could not ignore its<br />

beauty.<br />

Georgia O’Keefe<br />

In this chapter:<br />

the What, Why, and Where of <strong>SVG</strong>. .........................1<br />

Getting Started: A Simple Overview .........................5<br />

thirteen examples that Show the Capabilities of <strong>SVG</strong> .........6<br />

Diving In: A Step-by-Step Approach to <strong>Building</strong><br />

a Simple <strong>SVG</strong> Document. ..................................21<br />

Scalable Vector Graphics (<strong>SVG</strong>) is a graphical standard maintained and endorsed by the World Wide<br />

<strong>Web</strong> Consortium (W3C), the same group that created and continues to maintain HTML, CSS, XML,<br />

and other technologies that constitute the World Wide <strong>Web</strong>.<br />

The What, Why, and Where of <strong>SVG</strong><br />

<strong>SVG</strong> is much more than its name suggests. It is true that <strong>SVG</strong> is a language that allows for the creation<br />

of two-dimensional vector elements, which are simply mathematical representations of graphical<br />

objects, and that these vectors are infinitely scalable and can be transformed <strong>with</strong>in the bounds of<br />

the 2D coordinate system. However, <strong>SVG</strong> is unique in that it is an open standard defined by the W3C<br />

(http://w3c.org/svg/), and like other W3C languages such as HTML and XML, it has its own Document<br />

Object Model (DOM) that brings <strong>with</strong> it many benefits, and it’s interoperable <strong>with</strong> other open standard<br />

languages such as JavaScript, CSS, and HTML.<br />

<strong>SVG</strong> has been in the works over the past decade and has matured a great deal during that time,<br />

<strong>with</strong> collaboration from interested parties around the world. The great appeal of <strong>SVG</strong> is that, like<br />

HTML, it’s easy to read and edit, while allowing for <strong>com</strong>plex interactivity and animations through<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!