O'Reilly logo

Learning Raphaël JS Vector Graphics by Damian Dawber

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Basic Drawing with Raphaël

Raphaël supports three fundamental types of graphics elements: shapes, images, and text. Shapes can be predefined shapes such as a rectangle, circle, or ellipse or they can be a combination of lines, curves, and paths. Vector graphics are by their very definition the sum of such shapes, and throughout the next two chapters we will create a number of interesting drawings based on them. Images are either bitmap images (such as .png or .jpeg) or existing SVG images, and can be manipulated by Raphaël in many of the ways that shapes can be.

Shapes and text can be painted, that is, filled and stroked (given an outline). Fills can be either a single color or a linear or radial gradient. Strokes can only be filled ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required