Svg Module
This module contains classes for generating SVG documents.
- class ViewBox(min_x: float, min_y: float, width: float, height: float)[source]
A view box.
- Parameters:
- class Svg(view_box: ViewBox, window: Tuple[float, float] | None = None, background_color: Color | None = None, version: float = 1.0, encoding: str = 'UTF-8', fills: List[Fill] | None = None, objects: List[Shape2D] | None = None)[source]
An SVG document.
Initialize the SVG document.
- Parameters:
view_box (ViewBox) – The view box of the SVG document.
window (ty.Optional[ty.Tuple[float, float]]) – The window of the SVG document.
background_color (ty.Optional[Color]) – The background color of the SVG document.
version (float) – The version of the SVG document.
encoding (str) – The encoding of the SVG document.
fills (ty.List[Fill]) – The fills of the SVG document.
objects (ty.List[Shape2D]) – The objects of the SVG document.
- header() str[source]
Return the header of the SVG document.
- Returns:
The header of the SVG document.
- Return type:
Return the footer of the SVG document.
- Returns:
The footer of the SVG document.
- Return type: