o
    h\                     @   sB   d Z ddlmZ ddlmZ ddlZddlmZ ddddZdS )	z
Internal debugging utilities, that are not expected to be used in the rest of
the codebase.

WARNING: Code in this module may change without prior notice!
    )StringIO)PathN)TransformNode)	highlightc                   s~    du r| g t   fddt }|d | | |d tjddt|jdd d	|g| d
dd dS )a  
    Generate a graphical representation of the transform tree for *transform*
    using the :program:`dot` program (which this function depends on).  The
    output format (png, dot, etc.) is determined from the suffix of *dest*.

    Parameters
    ----------
    transform : `~matplotlib.transform.Transform`
        The represented transform.
    dest : str
        Output filename.  The extension must be one of the formats supported
        by :program:`dot`, e.g. png, svg, dot, ...
        (see https://www.graphviz.org/doc/info/output.html).
    highlight : list of `~matplotlib.transform.Transform` or None
        The transforms in the tree to be drawn in bold.
        If *None*, *transform* is highlighted.
    Nc              
      s   t | v rd S t |  i }t| j}| jrd| d}|  v r'd|d< d|d< d| |d< d	td
j| }|	t |  d| d t
|  D ](\}}t|trwt | |jv rw|	dt |  dt | d| d || qOd S )N[]boldstyleboxshapez"%s"label z{0[0]}={0[1]}z [z];
"z" -> "z
" [label="z", fontsize=10];
)idaddtype__name___invalidjoinmapformatitemswritevars
isinstancer   _parents)rootbufpropsr   keyvalr   recurseseen n/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/matplotlib/_internal_utils.pyr"   &   s*   


z(graphviz_dump_transform.<locals>.recursezdigraph G {
z}
dotz-T   z-ozutf-8T)inputcheck)	setr   r   
subprocessrunr   suffixgetvalueencode)	transformdestr   r   r$   r!   r%   graphviz_dump_transform   s   



r2   )	__doc__ior   pathlibr   r+   matplotlib.transformsr   r2   r$   r$   r$   r%   <module>   s    