Chapter 4. Paths

In This Chapter

  • About Paths

  • Conclusion

We've just created images using basic shape elements in SVG, but there are times when the basic shapes aren't enough. The <path> element allows for more complex shapes.

In fact, the <path> element is the most versatile of all the shape elements. It takes a series of xy coordinates and plots them, using the viewport. In a way, this resembles the <polyline> or <polygon> elements, but unlike <polygon> and <polyline>, the <path> element can create curved segments, as well as straight line segments, greatly increasing your drawing power.

Of course, it is much easier to use a drawing package that will export an image to SVG or to an SVG editor, such as Jasc WebDraw. These packages draw shapes similar ...

Get SVG for Web Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.