persunraveltorch.draw.seizing
Utilities for specifying SVGs ‘width’ and ‘height’ attributes.
- class persunraveltorch.draw.seizing.Length(value, unit)[source]
Bases:
NamedTuple
- value: float
Alias for field number 0
- class persunraveltorch.draw.seizing.Seizing(*args, **kwargs)[source]
Bases:
Protocol
Callable to obtain ‘width’ and ‘height’ from parameters.
- __call__(*, aspect_ratio: float, viewbox: Viewbox, complete_dimensions: bool, **kwargs: Any) Sizes [source]
Computes ‘width’ and ‘height’ attributes from parameters.
- Parameters:
aspect_ratio (
float
)viewbox (
Viewbox
)complete_dimensions (
bool
) – Whether both attributes, ‘width’ and ‘height’ should be specified.**kwargs (
Any
) – Any descendent ofSeizing
needs this so the protocol can be extended in the future.
- Returns:
The resulting ‘width’ and/or ‘height’ attribute.
- Return type:
- class persunraveltorch.draw.seizing.SeizingByHeight(*, length: Length)[source]
Bases:
Seizing
Computes ‘width’ and ‘height’ attributes from a specified height.
- __call__(*, aspect_ratio: float, complete_dimensions: bool, **kwargs: Any) Sizes [source]
Computes ‘width’ and ‘height’ attributes from parameters.
- Parameters:
aspect_ratio (
float
)viewbox (
Viewbox
)complete_dimensions (
bool
) – Whether both attributes, ‘width’ and ‘height’ should be specified.**kwargs (
Any
) – Any descendent ofSeizing
needs this so the protocol can be extended in the future.
- Returns:
The resulting ‘width’ and/or ‘height’ attribute.
- Return type:
- class persunraveltorch.draw.seizing.SeizingByWidth(*, length: Length)[source]
Bases:
Seizing
Computes ‘width’ and ‘height’ attributes from a specified width.
- __call__(*, aspect_ratio: float, complete_dimensions: bool, **kwargs: Any) Sizes [source]
Computes ‘width’ and ‘height’ attributes from parameters.
- Parameters:
aspect_ratio (
float
)viewbox (
Viewbox
)complete_dimensions (
bool
) – Whether both attributes, ‘width’ and ‘height’ should be specified.**kwargs (
Any
) – Any descendent ofSeizing
needs this so the protocol can be extended in the future.
- Returns:
The resulting ‘width’ and/or ‘height’ attribute.
- Return type:
- class persunraveltorch.draw.seizing.Sizes(width: persunraveltorch.draw.seizing.sizes.Length | None = None, height: persunraveltorch.draw.seizing.sizes.Length | None = None)[source]
Bases:
object