The ViewBox mixin provides the ability to specify that a given set of graphics stretch to fit a particular container element.
The value of the viewBox attribute is a list of four numbers min-x, min-y, width and height, separated by whitespace and/or a comma, which specify a rectangle in user space which should be mapped to the bounds of the viewport established by the given element, taking into account attribute preserveAspectRatio.
Specify a rectangle in user space (no units allowed) which should be mapped to the bounds of the viewport established by the given element.
| Parameters: |
|
|---|
Stretch viewBox in x and y direction to fill viewport, does not preserve aspect ratio.
Set the preserveAspectRatio attribute.
| Parameters: |
|
|---|
| Scale methods | Description |
|---|---|
| 'meet' | preserve aspect ration and zoom to limits of viewBox |
| 'slice' | preserve aspect ration and viewBox touch viewport on all bounds, viewBox will extend beyond the bounds of the viewport |
The Transform mixin operates on the transform attribute. The value of the transform attribute is a <transform-list>, which is defined as a list of transform definitions, which are applied in the order provided. The individual transform definitions are separated by whitespace and/or a comma. All coordinates are user space coordinates.
Specifies a translation by tx and ty. If ty is not provided, it is assumed to be zero.
| Parameters: |
|
|---|
Specifies a rotation by angle degrees about a given point. If optional parameter center are not supplied, the rotate is about the origin of the current user coordinate system.
| Parameters: |
|
|---|
Specifies a skew transformation along the x-axis.
| Parameters: | angle (number) – skew-angle in degrees, no units allowed |
|---|
Specifies a skew transformation along the y-axis.
| Parameters: | angle (number) – skew-angle in degrees, no units allowed |
|---|
Specifies a scale operation by sx and sy. If sy is not provided, it is assumed to be equal to sx.
| Parameters: |
|
|---|
XLink mixin
Create a reference to element.
| Parameters: | element – if element is a string its the id name of the referenced element, if element is a BaseElement class the id SVG Attribute is used to create the reference. |
|---|
Set XLink attributes (for href use set_href()).
Set xlink:actuate and xlink:type by the index operator:
element['xlink:type'] = 'simple'
element['xlink:actuate'] = 'onLoad'
Helper methods to set presentation attributes.
Set SVG Properties fill, fill-rule and fill-opacity.
See also
Set SVG Properties stroke, stroke-width, stroke-opacity, stroke-linecap and stroke-miterlimit.
See also
Set SVG Properties stroke-dashoffset and stroke-dasharray.
Where dasharray specify the lengths of alternating dashes and gaps as <list> of <int> or <float> values or a <string> of comma and/or white space separated <lengths> or <percentages>. (e.g. as <list> dasharray=[1, 0.5] or as <string> dasharray=‘1 0.5’)
SVG Tiny 1.2
valid for SVG Elements: animation, audio, desc, image, metadata, title, video
Helper methods to set media group attributes.
Set SVG Properties viewport-fill and viewport-fill-opacity.
Helper methods to set marker attributes.
Set markers for line elements (line, polygon, polyline, path) to values specified by markers.