Skip to Content
Mastering SVG
book

Mastering SVG

by Rob Larsen
September 2018
Beginner to intermediate
312 pages
7h 22m
English
Packt Publishing
Content preview from Mastering SVG

translate

The translate transform moves the SVG element by the specified x and y coordinates. A translation changes the origin of the element's coordinate system.

The y coordinate is an optional argument and is assumed to be equivalent to the x argument if it's not provided.

The following sample shows three equivalent circles. The first circle is not transformed in any way. The second is transformed with a single argument (10), which moves it by 10 on the x axis and 10 on the y axis. The third is translated by "75" pixels on the x plane and 0 pixels on the y plane. The underlying element has equivalent metrics in each case but they display differently.

Why not just move the elements, you might ask. For one thing, this is useful in dynamic ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Modern SVG

Modern SVG

Amelia Bellamy-Royds, Kurt Cagle
Using SVG with CSS3 and HTML5

Using SVG with CSS3 and HTML5

Amelia Bellamy-Royds, Kurt Cagle, Dudley Storey
SVG Text Layout

SVG Text Layout

Amelia Bellamy-Royds, Kurt Cagle

Publisher Resources

ISBN: 9781788626743Supplemental Content