Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""
import os
import re
from svgutils import transform as _transform
CONFIG = {'svg.file_path': '.',
'figure.save_path' : '.',
'image.file_path': '.',
'text.position': (0, 0),
'text.size': 8,
'text.weight': 'normal',
'text.font': 'Verdana'}
class Element(_transform.FigureElement):
"""Base class for new SVG elements."""
def scale(self, factor):
"""Scale SVG element.
Parameters
----------
factor : float
The scaling factor.
Factor > 1 scales up, factor < 1 scales down.
"""
self.moveto(0, 0, factor)
return self
def find_id(self, element_id):
"""Find a single element with the given ID.
Parameters
----------
element_id : str
ID of the element to find
Returns
-------
found element
"""
element = _transform.FigureElement.find_id(self, element_id)
return Element(element.root)