Ë
    ´2Úi‡/  ã                   óÒ   — d dl Zd dlmZ d dlmZmZ d„ Z G d„ d«      Z	 G d„ de«      Z
 G d	„ d
«      Z G d„ dej                  «      Z G d„ d«      Z G d„ d«      Z G d„ d«      Zy)é    N)Úticker)ÚBboxÚ	Transformc                 óf  — g }| dd | dd z
  }t        d«      t        ddd«      fD �]  }| j                  |   \  }}|j                  |   \  }}|j                  |   \  }	}
|j                  |   \  }}|	||	kD  f|||k  ffD ]«  \  }}|j	                  g «       |dd |dd z  j                  «       \  }|D ]u  }||   |||   z
  ||   z  ||   z  z   }|
|cxk  r|k  sn Œ+||f|   }t        j                  t        j                  ||   ddd…   Ž «      }|d   j	                  ||f«       Œw Œ­ �Œ
 |S )aá  
    Find the points where a polyline crosses a bbox, and the crossing angles.

    Parameters
    ----------
    xys : (N, 2) array
        The polyline coordinates.
    bbox : `.Bbox`
        The bounding box.

    Returns
    -------
    list of ((float, float), float)
        Four separate lists of crossings, for the left, right, bottom, and top
        sides of the bbox, respectively.  For each list, the entries are the
        ``((x, y), ccw_angle_in_degrees)`` of the crossing, where an angle of 0
        means that the polyline is moving to the right at the crossing point.

        The entries are computed by linearly interpolating at each crossing
        between the nearest points on either side of the bbox edges.
    é   Néÿÿÿÿ)	ÚsliceÚTÚminÚmaxÚappendÚnonzeroÚnpÚdegreesÚarctan2)ÚxysÚbboxÚ	crossingsÚdxysÚslÚusÚvsÚdusÚdvsÚuminÚvminÚumaxÚvmaxÚu0ÚinsideÚidxsÚidxÚvÚcrossingÚthetas                       úZ/var/www/html/acx/venv/lib/python3.12/site-packages/mpl_toolkits/axisartist/grid_finder.pyÚ_find_line_box_crossingsr'      ss  € ð, €IØˆqˆrˆ7�S˜˜"�XÑ€DÜ�T‹{œE $¨¨bÓ1Ð2ó 8ˆØ—‘�r‘‰ˆˆBØ—6‘6˜"‘:‰ˆˆSØ—X‘X˜b‘\‰
ˆˆdØ—X‘X˜b‘\‰
ˆˆdØ  " t¡)Ð,¨t°R¸$±YÐ.?Ð@ò 		8‰JˆB�Ø×Ñ˜RÔ Ø˜C˜R�[ 6¨!¨" :Ñ-×6Ñ6Ó8‰EˆDØò 8�Ø�s‘G˜r B s¡G™|¨s°3©xÑ7¸#¸c¹(ÑBÑB�Ø˜qÔ( DÔ(ØØ ˜7 2™;�ÜŸ
™
¤2§:¡:¨t°C©y¹¸2¸©Ð#?Ó@�Ø˜"‘×$Ñ$ h°Ð%6Õ7ñ8ò		8ð8ð Ðó    c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)ÚExtremeFinderSimplezU
    A helper class to figure out the range of grid lines that need to be drawn.
    c                 ó    — || _         || _        y)zy
        Parameters
        ----------
        nx, ny : int
            The number of samples in each direction.
        N©ÚnxÚny)Úselfr-   r.   s      r&   Ú__init__zExtremeFinderSimple.__init__6   s   € ð ˆŒØˆ�r(   c                 ó¬  — t        j                  t        j                  ||| j                  «      t        j                  ||| j                  «      «      \  }} |t        j
                  |«      t        j
                  |«      «      \  }}	| j                  |j                  «       |j                  «       |	j                  «       |	j                  «       «      S )ai  
        Compute an approximation of the bounding box obtained by applying
        *transform_xy* to the box delimited by ``(x1, y1, x2, y2)``.

        The intended use is to have ``(x1, y1, x2, y2)`` in axes coordinates,
        and have *transform_xy* be the transform from axes coordinates to data
        coordinates; this method then returns the range of data coordinates
        that span the actual axes.

        The computation is done by sampling ``nx * ny`` equispaced points in
        the ``(x1, y1, x2, y2)`` box and finding the resulting points with
        extremal coordinates; then adding some padding to take into account the
        finite sampling.

        As each sampling step covers a relative range of *1/nx* or *1/ny*,
        the padding is computed by expanding the span covered by the extremal
        coordinates by these fractions.
        )	r   ÚmeshgridÚlinspacer-   r.   ÚravelÚ_add_padr   r   )
r/   Útransform_xyÚx1Úy1Úx2Úy2ÚxÚyÚxtÚyts
             r&   Ú__call__zExtremeFinderSimple.__call__@   s‹   € ô& �{‰{Ü�K‰K˜˜B §¡Ó(¬"¯+©+°b¸"¸d¿g¹gÓ*FóH‰ˆˆ1áœbŸh™h q›k¬2¯8©8°A«;Ó7‰ˆˆBØ�}‰}˜RŸV™V›X r§v¡v£x°·±³¸2¿6¹6»8ÓDÐDr(   c                 ón   — ||z
  | j                   z  }||z
  | j                  z  }||z
  ||z   ||z
  ||z   fS )z,Perform the padding mentioned in `__call__`.r,   )r/   Úx_minÚx_maxÚy_minÚy_maxÚdxÚdys          r&   r5   zExtremeFinderSimple._add_padX   sE   € à�e‰m˜tŸw™wÑ&ˆØ�e‰m˜tŸw™wÑ&ˆØ�r‰z˜5 2™: u¨r¡z°5¸2±:Ð=Ð=r(   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r0   r?   r5   © r(   r&   r*   r*   1   s   „ ñòòEó0>r(   r*   c                   ó6   ‡ — e Zd ZdZdxZZˆ fd„Zd„ Zd„ Zˆ xZ	S )Ú_User2DTransformz.A transform defined by two user-set functions.é   c                 ó>   •— t         ‰| �  «        || _        || _        y)zÞ
        Parameters
        ----------
        forward, backward : callable
            The forward and backward transforms, taking ``x`` and ``y`` as
            separate arguments and returning ``(tr_x, tr_y)``.
        N)Úsuperr0   Ú_forwardÚ	_backward)r/   ÚforwardÚbackwardÚ	__class__s      €r&   r0   z_User2DTransform.__init__d   s   ø€ ô 	‰ÑÔØˆŒØ!ˆ�r(   c                 ól   — t        j                   | j                  t        j                  |«      Ž «      S ©N)r   Ú	transposerQ   )r/   Úvaluess     r&   Útransform_non_affinez%_User2DTransform.transform_non_affiner   s%   € ä�|‰|˜M˜DŸM™M¬2¯<©<¸Ó+?Ð@ÓAÐAr(   c                 óN   —  t        | «      | j                  | j                  «      S rW   )ÚtyperR   rQ   ©r/   s    r&   Úinvertedz_User2DTransform.invertedv   s   € àŒt�D‹z˜$Ÿ.™.¨$¯-©-Ó8Ð8r(   )
rG   rH   rI   rJ   Ú
input_dimsÚoutput_dimsr0   rZ   r^   Ú__classcell__©rU   s   @r&   rM   rM   _   s    ø„ Ù8à Ð €J�ô"òBö9r(   rM   c                   óV   — e Zd ZdZ	 	 	 	 	 dd„Zd„ Zd„ Zd„ Zd„ Zd„ Z	eZ
d	„ Zd
„ Zd„ Zy)Ú
GridFinderzŸ
    Internal helper for `~.grid_helper_curvelinear.GridHelperCurveLinear`, with
    the same constructor parameters; should not be directly instantiated.
    Nc                 óè   — |€t        dd«      }|€
t        «       }|€
t        «       }|€
t        «       }|€
t        «       }|| _        || _        || _        || _        || _        | j                  |«       y )Né   )	r*   ÚMaxNLocatorÚFormatterPrettyPrintÚextreme_finderÚgrid_locator1Úgrid_locator2Útick_formatter1Útick_formatter2Úset_transform)r/   Ú	transformri   rj   rk   rl   rm   s          r&   r0   zGridFinder.__init__�   s‚   € ð Ð!Ü0°°RÓ8ˆNØÐ Ü'›MˆMØÐ Ü'›MˆMØÐ"Ü2Ó4ˆOØÐ"Ü2Ó4ˆOØ,ˆÔØ*ˆÔØ*ˆÔØ.ˆÔØ.ˆÔØ×Ñ˜9Õ%r(   c           
      óØ  — | j                  | j                  ||||«      }|\  }}}}	| j                  ||«      \  }
}}t        j                  |
«      }
| j                  ||	«      \  }}}t        j                  |«      }|
d| |z  }|d| |z  }| j                  ||||||	«      \  }}||z
  dz  }||z
  dz  }t        j                  ||z
  ||z
  ||z   ||z   «      }|||| j                  |||
|«      | j                  ||||«      dœ}i x}|d   d<   dD ]#  }|d   d   |   }| j                  |||«      ||<   Œ% i x}|d   d<   dD ]#  }|d   d   |   }| j                  |||«      ||<   Œ% |S )	z˜
        lon_values, lat_values : list of grid values. if integer is given,
                           rough number of grids in each direction.
        Ng»½×Ùß|Û=)ÚextremesÚ	lon_linesÚ	lat_linesÚlonÚlatrt   Útick_labels©ÚleftÚbottomÚrightÚtopÚtick_levelsru   )ri   Úinv_transform_xyrj   r   Úasarrayrk   Ú_get_raw_grid_linesr   Úfrom_extentsÚ_clip_grid_lines_and_find_ticksrl   rm   )r/   r7   r8   r9   r:   rq   Úlon_minÚlon_maxÚlat_minÚlat_maxÚlon_levsÚlon_nÚ
lon_factorÚlat_levsÚlat_nÚ
lat_factorÚ
lon_valuesÚ
lat_valuesrr   rs   ÚddxÚddyÚbbÚ	grid_infoÚ
tck_labelsÚ	directionÚlevss                              r&   Úget_grid_infozGridFinder.get_grid_info™   sû  € ð ×&Ñ& t×'<Ñ'<¸bÀ"ÀbÈ"ÓMˆð
 .6Ñ*ˆ�˜' 7Ø&*×&8Ñ&8¸À'Ó&JÑ#ˆ�%˜Ü—:‘:˜hÓ'ˆØ&*×&8Ñ&8¸À'Ó&JÑ#ˆ�%˜Ü—:‘:˜hÓ'ˆà˜f˜uÐ%¨
Ñ2ˆ
Ø˜f˜uÐ%¨
Ñ2ˆ
à#×7Ñ7¸
Ø8BØ8?ÀØ8?Àó JÑˆ	�9ð
 �"‰u�f‰nˆØ�"‰u�f‰nˆÜ×Ñ˜r #™v r¨#¡v¨r°#©v°r¸#±vÓ>ˆð !Ø"Ø"Ø×7Ñ7Ø˜: x°ó5à×7Ñ7Ø˜: x°ó5ñ
ˆ	ð 8:Ð9ˆ
�Y˜uÑ% mÑ4Ø;ò 	-ˆIØ˜UÑ# MÑ2°9Ñ=ˆDØ$(×$8Ñ$8Ø˜: tó%-ˆJ�yÒ!ð	-ð
 8:Ð9ˆ
�Y˜uÑ% mÑ4Ø;ò 	-ˆIØ˜UÑ# MÑ2°9Ñ=ˆDØ$(×$8Ñ$8Ø˜: tó%-ˆJ�yÒ!ð	-ð
 Ðr(   c           
      óF  — t        j                  ||d«      }t        j                  ||d«      }|D �	cg c](  }	| j                  t        j                  ||	«      |«      ‘Œ* }
}	|D �cg c](  }| j                  |t        j                  ||«      «      ‘Œ* }}|
|fS c c}	w c c}w )Néd   )r   r3   r6   Ú	full_like)r/   rŒ   r�   r‚   rƒ   r„   r…   Úlons_iÚlats_irt   rr   ru   rs   s                r&   r   zGridFinder._get_raw_grid_linesÎ   s­   € ô —‘˜W g¨sÓ3ˆÜ—‘˜W g¨sÓ3ˆð !+ö,Øð ×&Ñ&¤r§|¡|°F¸CÓ'@À&ÕIð ,ˆ	ð ,ð !+ö,Øð ×&Ñ& v¬r¯|©|¸FÀCÓ/HÕIð ,ˆ	ð ,ð ˜)Ð#Ð#ùò,ùò,s   ³-BÁ&-Bc           	      ó²  — g g t        g g g g ¬«      t        g g g g ¬«      g dœ}|d   }|d   }t        |||«      D ]š  \  \  }}	}
}t        t        j                  ||	g«      |«      }|d   j                  |
«       |d   j                  ||	fg«       t        |g d¢«      D ]4  \  }}|D ]*  }||   j                  |«       ||   j                  |«       Œ, Œ6 Œœ |S )Nrw   )rY   Úlevelsr|   Ú	tick_locsÚlinesr|   r�   rœ   rž   )rx   rz   ry   r{   )ÚdictÚzipr'   r   Úcolumn_stackr   )r/   rž   rY   r”   r�   ÚgiÚ
tck_levelsÚtck_locsÚlxÚlyr#   ÚlevÚtcksÚtckr“   Úts                   r&   r�   z*GridFinder._clip_grid_lines_and_find_ticksÜ   s  € àØÜ R°¸"À"ÔEÜ 2¨b¸ÀÔCØñ
ˆð ˜Ñ&ˆ
Ø�k‘?ˆÜ # E¨6°4Ó 8ò 		2Ñ‰HˆR��a˜Ü+¬B¯O©O¸RÀ¸HÓ,EÀrÓJˆDØˆx‰L×Ñ Ô"Øˆw‰K×Ñ  R ˜zÔ*ä"% dÚ&Hó#Jò 2‘��Yàò 2�AØ˜yÑ)×0Ñ0°Ô5Ø˜YÑ'×.Ñ.¨qÕ1ñ2ñ2ð		2ð ˆ	r(   c                 ó²   — t        |t        «      r|| _        y t        |«      dk(  r't	        t        t        |«      «      rt        |Ž | _        y t        d«      ‚)NrN   zF'aux_trans' must be either a Transform instance or a pair of callables)	Ú
isinstancer   Ú_aux_transformÚlenÚallÚmapÚcallablerM   Ú	TypeError)r/   Ú	aux_transs     r&   rn   zGridFinder.set_transformô   sM   € Ü�i¤Ô+Ø"+ˆDÕÜ�‹^˜qÒ ¤S¬¬X°yÓ)AÔ%BÜ"2°IÐ">ˆDÕäð >ó ?ð ?r(   c                 ó   — | j                   S rW   )r­   r]   s    r&   Úget_transformzGridFinder.get_transformý   s   € Ø×"Ñ"Ð"r(   c                 óv   — | j                   j                  t        j                  ||g«      «      j                  S rW   )r­   ro   r   r¡   r
   ©r/   r;   r<   s      r&   r6   zGridFinder.transform_xy  s,   € Ø×"Ñ"×,Ñ,¬R¯_©_¸aÀ¸VÓ-DÓE×GÑGÐGr(   c                 ó’   — | j                   j                  «       j                  t        j                  ||g«      «      j
                  S rW   )r­   r^   ro   r   r¡   r
   r·   s      r&   r}   zGridFinder.inv_transform_xy  s9   € Ø×"Ñ"×+Ñ+Ó-×7Ñ7Ü�O‰O˜Q ˜FÓ#ó%ß%&¡Qð	'r(   c                 ór   — |j                  «       D ]$  \  }}|dv rt        | ||«       Œt        d|›�«      ‚ y )N)ri   rj   rk   rl   rm   zUnknown update property )ÚitemsÚsetattrÚ
ValueError)r/   ÚkwargsÚkr#   s       r&   ÚupdatezGridFinder.update	  sK   € Ø—L‘L“Nò 	C‰DˆAˆqØð (ñ (ô
 ˜˜a Õ#ä Ð#;¸A¸5Ð!AÓBÐBñ	Cr(   )NNNNN)rG   rH   rI   rJ   r0   r•   r   r�   rn   rµ   Úupdate_transformr6   r}   r¿   rK   r(   r&   rd   rd   {   sP   „ ñð !%Ø#Ø#Ø!%Ø!%ó&ò03òj$òò0?ò#ð %ÐòHò'ó	Cr(   rd   c                   ó4   ‡ — e Zd Z	 	 	 	 	 dˆ fd„	Zˆ fd„Zˆ xZS )rg   c                 óN   •— t         ‰| �  |||||¬«       | j                  «        y )N)ÚstepsÚintegerÚ	symmetricÚprune)rP   r0   Úcreate_dummy_axis)r/   ÚnbinsrÃ   ÚtrimrÄ   rÅ   rÆ   rU   s          €r&   r0   zMaxNLocator.__init__  s.   ø€ ô 	‰Ñ˜ e°WØ#,°Eð 	ô 	;à×ÑÕ r(   c                 óf   •— t         ‰| �  ||«      }t        j                  |«      t	        |«      dfS ©Nr   )rP   Útick_valuesr   Úarrayr®   )r/   Úv1Úv2ÚlocsrU   s       €r&   r?   zMaxNLocator.__call__   s-   ø€ Ü‰wÑ" 2 rÓ*ˆÜ�x‰x˜‹~œs 4›y¨!Ð+Ð+r(   )é
   NTFFN©rG   rH   rI   r0   r?   ra   rb   s   @r&   rg   rg     s!   ø„ Ø'+ØØØ Øõ	!÷,ð ,r(   rg   c                   ó   — e Zd Zd„ Zd„ Zy)ÚFixedLocatorc                 ó   — || _         y rW   )Ú_locs)r/   rÐ   s     r&   r0   zFixedLocator.__init__&  s	   € Øˆ�
r(   c                 óÀ   — t        ||g«      \  }}t        j                  | j                  D �cg c]  }||cxk  r|k  sŒn n|‘Œ c}«      }|t	        |«      dfS c c}w rË   )Úsortedr   rÍ   rÖ   r®   )r/   rÎ   rÏ   ÚlrÐ   s        r&   r?   zFixedLocator.__call__)  sR   € Ü˜˜R˜Ó!‰ˆˆBÜ�x‰x D§J¡JÖ@˜q°"¸´-¸R¶-šÒ@ÓAˆØ”S˜“Y Ð!Ð!ùò As
   ®A¿AN©rG   rH   rI   r0   r?   rK   r(   r&   rÔ   rÔ   %  s   „ òó"r(   rÔ   c                   ó   — e Zd Zdd„Zd„ Zy)rh   c                 óp   — t        j                  |d¬«      | _        | j                  j                  «        y )NF)ÚuseMathTextÚ	useOffset)ÚmtickerÚScalarFormatterÚ_fmtrÇ   )r/   rÝ   s     r&   r0   zFormatterPrettyPrint.__init__2  s)   € Ü×+Ñ+Ø#¨uô6ˆŒ	à�	‰	×#Ñ#Õ%r(   c                 ó8   — | j                   j                  |«      S rW   )rá   Úformat_ticks)r/   r“   ÚfactorrY   s       r&   r?   zFormatterPrettyPrint.__call__7  s   € Ø�y‰y×%Ñ% fÓ-Ð-r(   N)TrÚ   rK   r(   r&   rh   rh   1  s   „ ó&ó
.r(   rh   c                   ó&   ‡ — e Zd Zdˆ fd„	Zd„ Zˆ xZS )ÚDictFormatterc                 ó>   •— t         ‰| �  «        || _        || _        y)zq
        format_dict : dictionary for format strings to be used.
        formatter : fall-back formatter
        N)rP   r0   Ú_format_dictÚ_fallback_formatter)r/   Úformat_dictÚ	formatterrU   s      €r&   r0   zDictFormatter.__init__<  s    ø€ ô
 	‰ÑÔØ'ˆÔØ#,ˆÕ r(   c                 óÞ   — | j                   r| j                  |||«      }ndgt        |«      z  }t        ||«      D ��cg c]!  \  }}| j                  j	                  ||«      ‘Œ# c}}S c c}}w )zG
        factor is ignored if value is found in the dictionary
        Ú )ré   r®   r    rè   Úget)r/   r“   rä   rY   Úfallback_stringsr¾   r#   s          r&   r?   zDictFormatter.__call__E  sw   € ð ×#Ò#Ø#×7Ñ7Ø˜6 6ó +Ñð !#˜t¤c¨&£kÑ1Ðä Ð(8Ó9÷;Ù�A�qð ×!Ñ!×%Ñ% a¨Õ+ó ;ð 	;ùó ;s   ¿&A)rW   rÒ   rb   s   @r&   ræ   ræ   ;  s   ø„ õ-ö
;r(   ræ   )Únumpyr   Ú
matplotlibr   rß   Úmatplotlib.transformsr   r   r'   r*   rM   rd   rg   rÔ   rh   ræ   rK   r(   r&   ú<module>ró      sj   ðÛ å (ß 1ò'÷T+>ñ +>ô\9�yô 9÷8WCñ WCôt,�'×%Ñ%ô ,÷ "ñ "÷.ñ .÷;ò ;r(   