:py:mod:`alhambra.drawing`
==========================

.. py:module:: alhambra.drawing


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   alhambra.drawing.DrawingElement
   alhambra.drawing.XMLElement
   alhambra.drawing.Group
   alhambra.drawing.Rectangle
   alhambra.drawing.Text
   alhambra.drawing.Use
   alhambra.drawing.Drawing




Attributes
~~~~~~~~~~

.. autoapisummary::

   alhambra.drawing.Number


.. py:data:: Number
   :type: typing_extensions.TypeAlias

   

.. py:class:: DrawingElement


   Bases: :py:obj:`abc.ABC`

   Helper class that provides a standard way to create an ABC using
   inheritance.

   .. py:method:: to_xml() -> xml.etree.ElementTree.Element
      :abstractmethod:



.. py:class:: XMLElement(tag, attrib={}, **extra)


   Bases: :py:obj:`DrawingElement`, :py:obj:`xml.etree.ElementTree.Element`

   Helper class that provides a standard way to create an ABC using
   inheritance.

   .. py:method:: to_xml() -> xml.etree.ElementTree.Element



.. py:class:: Group


   Bases: :py:obj:`DrawingElement`

   Helper class that provides a standard way to create an ABC using
   inheritance.

   .. py:attribute:: elements
      :type: list[DrawingElement]

      

   .. py:attribute:: id
      :type: Optional[str]

      

   .. py:method:: to_xml() -> xml.etree.ElementTree.Element


   .. py:method:: append(v: DrawingElement) -> None



.. py:class:: Rectangle(x: Number = 0, y: Number = 0, width: Number = 1, height: Number = 1, /, **kwargs)


   Bases: :py:obj:`DrawingElement`

   Helper class that provides a standard way to create an ABC using
   inheritance.

   .. py:attribute:: _el
      :type: xml.etree.ElementTree.Element

      

   .. py:method:: to_xml()



.. py:class:: Text(text: str, size: Number = 10, x: Number = 0, y: Number = 0, /, **kwargs)


   Bases: :py:obj:`DrawingElement`

   Helper class that provides a standard way to create an ABC using
   inheritance.

   .. py:attribute:: _el
      :type: xml.etree.ElementTree.Element

      

   .. py:method:: to_xml()



.. py:class:: Use(id_or_link: str | Any, x: Number = 0, y: Number = 0, /, **kwargs)


   Bases: :py:obj:`DrawingElement`

   Helper class that provides a standard way to create an ABC using
   inheritance.

   .. py:attribute:: _el
      :type: xml.etree.ElementTree.Element

      

   .. py:method:: to_xml()



.. py:class:: Drawing


   Bases: :py:obj:`DrawingElement`

   Helper class that provides a standard way to create an ABC using
   inheritance.

   .. py:attribute:: width
      :type: int

      

   .. py:attribute:: height
      :type: int

      

   .. py:attribute:: defs
      :type: list[DrawingElement]

      

   .. py:attribute:: elements
      :type: list[DrawingElement]

      

   .. py:attribute:: viewBox
      :type: Optional[tuple[Number, Number, Number, Number]]

      

   .. py:attribute:: saveSvg

      

   .. py:method:: to_xml() -> xml.etree.ElementTree.Element


   .. py:method:: save_svg(filename: str)


   .. py:method:: to_et() -> xml.etree.ElementTree.ElementTree


   .. py:method:: to_string() -> str


   .. py:method:: to_bytes() -> bytes


   .. py:method:: _repr_svg_()


   .. py:method:: _repr_html_()



