How To Structure Your SVG Code — The <g>, <title> And <desc> Elements

What’s the best way to organize your SVG code? If all you want to draw is a line or simple shape there’s not much to organize, but what about SVGs with multiple shapes and lines that combine to form a more complex whole?

Continue reading

How To Prevent Your SVG Graphics From Deforming With preserveAspectRatio

For the last few weeks we’ve been looking at SVG coordinate systems, the SVG canvas, the viewport through which we can see a part of the canvas, and the viewBox that lets us map a region of the canvas into the viewport.

Continue reading

Move And Scale SVG Graphics With The viewBox Attribute

The SVG canvas and the SVG viewport, through which you see the canvas operate on independent coordinate systems. The systems are aligned by default, but you can change the default to move and scale the canvas.

Continue reading

The SVG Canvas, Coordinate System, And Viewport

When you see SVG images on the screen you’re viewing only part of the canvas on which they’re drawn and you view the canvas through the SVG viewport. Canvas and viewport are both independent and connected and their relationship can be confusing and lead to unexpected results at times. That is until you understand the relationship and how to control the connection.

Continue reading

SVG Basics—Creating Paths With Curve Commands

Last week I began a discussion about paths, mainly focusing on the different line commands you can use to draw lines and shapes. Today I want to continue the path discussion and talk about the different curve commands at your disposal.

Continue reading