module documentation

Undocumented

Function fragment_to_element Convert an SVG fragment to an SVG element.
Function fragment_to_image Convert an SVG fragment to a raster image.
Function sanitize_element Remove unsafe stuff from an SVG element.
Function _sanitize Undocumented
Function _sanitize_atts Undocumented
Constant _ALLOWED_ATTRIBUTES Undocumented
Constant _ALLOWED_TAGS Undocumented
Constant _SVG_TAG_ATTS Undocumented
def fragment_to_element(fragment: list[gws.IXmlElement], atts: dict = None) -> gws.IXmlElement: (source)

Convert an SVG fragment to an SVG element.

def fragment_to_image(fragment: list[gws.IXmlElement], size: gws.Size, mime=gws.lib.mime.PNG) -> gws.lib.image.Image: (source)

Convert an SVG fragment to a raster image.

def sanitize_element(el: gws.IXmlElement) -> t.Optional[gws.IXmlElement]: (source)

Remove unsafe stuff from an SVG element.

def _sanitize(el: gws.IXmlElement) -> t.Optional[gws.IXmlElement]: (source)

Undocumented

def _sanitize_atts(atts: dict) -> dict: (source)

Undocumented

_ALLOWED_ATTRIBUTES: set[str] = (source)

Undocumented

Value
set(['alignment-baseline',
     'baseline-shift',
     'clip',
     'clip-path',
     'clip-rule',
     'color',
     'color-interpolation',
...
_ALLOWED_TAGS: set[str] = (source)

Undocumented

Value
set(['circle',
     'clippath',
     'defs',
     'ellipse',
     'g',
     'hatch',
     'hatchpath',
...
_SVG_TAG_ATTS: dict[str, str] = (source)

Undocumented

Value
{'xmlns': 'http://www.w3.org/2000/svg'}