SVG
ViewPort and ViewBox
- View port: Size in outside units of the image.
- Controlled with
widthandheightattributes of thesvgelement.
- Controlled with
-
View box: the window of the world seen for the view port
- Controlled with the
viewBoxattribute of thesvgelement. "anchor-x anchor-y width height"- It can also be set in
symbol,marker,patternandview
- Controlled with the
-
preserveAspectRatioxAncorYAnchor strategy|noneAnchorcan beMin,Max,Mid, defaultMidfor both axis (xMidYMid)strategycan beslice(css cover) omeet(css fit)nonescales both axis to fit the viewport
svgcan be nested, they are sub viewports- on nested
svgwe can also setxandyto position it. - also
x,y,widthandheightcan be animatable.
- on nested
viewtags are alternative view boxes focusable by#id