What Is SVG Viewbox-Viewport Mapping

Q

What is SVG Viewbox-Viewport mapping?

✍: FYIcenter.com

A

Viewbox-Viewport mapping refers to the process of mapping a point from the Object Coordinate System to a point in the Canvas Coordinate System.

The Viewbox-Viewport mapping is defined with a given area in the Object Coordinate System called Viewbox, and a given area in the Canvas Coordinate System called Viewport. Viewbox-Viewport mapping is a 2-dimensional linear transformation that will convert the Viewbox to the Viewport linearly.

If the Viewbox-Viewport mapping is defined without respecting the aspect ratio, the x-coordinate and y-coordinate will be mapped independently.

The following diagram shows you how the Viewbox-Viewport mapping works.

Illustration of Viewbox-Viewport Mapping
Illustration of Viewbox-Viewport Mapping

 

Define SVG Viewbox-Viewport Mapping

What Are SVG Coordinate Systems

SVG Coordinates, Size and Viewport

⇑⇑ SVG (Scalable Vector Graphics)

2023-08-17, 274🔥, 0💬