a
    ëÝEb\  ã                   @   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 rNd|d< d|d< d| |d< d	 td
j| ¡ ƒ¡}| 	t | ƒ› d|› d�¡ t
| ƒ ¡ D ]P\}}t|tƒržt | ƒ|jv rž| 	dt | ƒ› dt |ƒ› d|› d�¡ ˆ||ƒ qžd 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© úZ/home/ja/django-apps/lartica_env/lib/python3.9/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)Z	transformÚdestr   r   r$   r!   r%   Úgraphviz_dump_transform   s    


þr1   )	Ú__doc__Úior   Úpathlibr   r+   Zmatplotlib.transformsr   r1   r$   r$   r$   r%   Ú<module>   s
   