ó
    sñ:i6  ã                  ó,  • S SK Jr  S SKrS SKJrJr  S SKJrJrJ	r	  S SK
Jr  S SKJr  S SKJr  S SKJr  S S	KJr  S SKrS S
KJrJr  S SKJrJr  S SKJr  \(       a.  S SKJr  S SK J!r!  S SKJ"r"  S SK#J$r$  S SK%J&r&  S SK'J(r(J)r)  S SK*J+r+J,r,   " S S\5      r-g)é    )ÚannotationsN)ÚTYPE_CHECKINGÚAny)Ú
export_pngÚ
export_svgÚshow)Úget_screenshot_as_png)Úgridplot)ÚLabel)Ú
Category10)Úfigure)Úas_fill_typeÚas_line_type)Úfilled_to_bokehÚlines_to_bokeh)ÚRenderer)ÚOutputBackendType)ÚGridPlot)ÚPalette)Ú	ArrayLike)Ú	WebDriver)ÚFillTypeÚLineType)Ú
FillReturnÚ
LineReturnc                  óÀ  • \ rS rSr% SrS\S'   S\S'   S\S'   S	\S
'        S           SS jjrSS jrSS jr   S           SS jjr	     S                S!S jjr
    S"             S#S jjr  S$           S%S jjr S&SS.       S'S jjjrSS.S(S jjrS)S jrS*S+S jjr    S,               S-S jjrSrg).ÚBokehRendereré   aÖ  Utility renderer using Bokeh to render a grid of plots over the same (x, y) range.

Args:
    nrows (int, optional): Number of rows of plots, default ``1``.
    ncols (int, optional): Number of columns of plots, default ``1``.
    figsize (tuple(float, float), optional): Figure size in inches (assuming 100 dpi), default
        ``(9, 9)``.
    show_frame (bool, optional): Whether to show frame and axes ticks, default ``True``.
    want_svg (bool, optional): Whether output is required in SVG format or not, default
        ``False``.

Warning:
    :class:`~.BokehRenderer`, unlike :class:`~.MplRenderer`, needs to be told in advance if
    output to SVG format will be required later, otherwise it will assume PNG output.
zlist[figure]Ú_figuresr   Ú_layoutr   Ú_paletteÚboolÚ	_want_svgc                óæ  • XPl         [        S   U l        S[        R                  " U[
        S9-  nX-  n/ U l        U R                   (       a  SOSn[        U5       Hj  n	[        US9n
SU
R                  l
        SU
R                  l
        U R                  R                  U
5        U(       a  MR  S U
l        SU
R                  l
        Ml     [        U R                  US US   U-  US	   U-  S
9U l        g )Né
   éd   )ÚdtypeÚsvgÚcanvas)Úoutput_backendFr   é   )ÚncolsÚtoolbar_locationÚwidthÚheight)r#   r   r!   ÚnpÚasarrayÚintr   Úranger   ÚxgridÚvisibleÚygridÚappendÚoutline_line_colorÚaxisr
   r    )ÚselfÚnrowsr,   ÚfigsizeÚ
show_frameÚwant_svgÚ
total_sizeÚnfiguresÚbackendÚ_Úfigs              Ú`/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/contourpy/util/bokeh_renderer.pyÚ__init__ÚBokehRenderer.__init__2   sÐ   € ð "ŒÜ" 2™ˆŒàœŸš G´3Ñ7Ñ7ˆ
à‘;ˆØˆŒØ.2¯n¯n¡UÀ(ˆÜ�x–ˆAÜ¨Ñ0ˆCØ %ˆC�I‰IÔØ %ˆC�I‰IÔØ�M‰M× Ñ  Ô%ß�:Ø)-�Ô&Ø#(�—‘Ö ñ !ô  Ø�M‰M ¸Ø˜Q‘- 5Ñ(°¸A±À%Ñ1GñIˆ�ó    c                ó|   • [        U[        5      (       a&  US   S:X  a  [        USS  5      nU R                  U   nU$ )Nr   ÚCr+   )Ú
isinstanceÚstrr2   r!   )r:   ÚcolorÚindexs      rD   Ú_convert_colorÚBokehRenderer._convert_colorO   s;   € Ü�eœS×!Ñ! e¨A¡h°#£oÜ˜˜a˜b˜	“NˆEØ—M‘M %Ñ(ˆEØˆrG   c                óN   • [        U[        5      (       a  U R                  U   nU$ )N)rJ   r2   r   )r:   Úaxs     rD   Ú_get_figureÚBokehRenderer._get_figureU   s"   € Ü�bœ#×ÑØ—‘˜rÑ"ˆBØˆ	rG   c                óÀ   • [        U5      nU R                  U5      nU R                  U5      n[        X5      u  px[	        U5      S:”  a  UR                  U/U/XESS9  gg)a¶  Plot filled contours on a single plot.

Args:
    filled (sequence of arrays): Filled contour data as returned by
        :meth:`~.ContourGenerator.filled`.
    fill_type (FillType or str): Type of :meth:`~.ContourGenerator.filled` data as returned
        by :attr:`~.ContourGenerator.fill_type`, or a string equivalent.
    ax (int or Bokeh Figure, optional): Which plot to use, default ``0``.
    color (str, optional): Color to plot with. May be a string color or the letter ``"C"``
        followed by an integer in the range ``"C0"`` to ``"C9"`` to use a color from the
        ``Category10`` palette. Default ``"C0"``.
    alpha (float, optional): Opacity to plot with, default ``0.7``.
r   )ÚxsÚysrL   Ú
fill_alphaÚ
line_widthN)r   rR   rN   r   ÚlenÚmulti_polygons)	r:   ÚfilledÚ	fill_typerQ   rL   ÚalpharC   rU   rV   s	            rD   r[   ÚBokehRenderer.filledZ   sf   € ô* ! Ó+ˆ	Ø×Ñ˜rÓ"ˆØ×#Ñ# EÓ*ˆÜ  Ó3‰ˆÜˆr‹7�Q‹;Ø×Ñ 2 $¨B¨4°uÐ[\ÐÒ]ð rG   Nc                ó&  • U R                  U5      nU R                  X5      u  p[        U5      [        UR                  5      -   n	[        U5      [        UR                  5      -   n
XES.nUR                  " Xš40 UD6  US:”  GaØ  SUSS2SS24   USS2SS24   -   USS2SS24   -   USS2SS24   -   -  R                  5       nSUSS2SS24   USS2SS24   -   USS2SS24   -   USS2SS24   -   -  R                  5       nUR                  " [        [        R                  " USS2SS24   R                  5       XÁSS2SS24   R                  5       4SS95      [        [        R                  " USS2SS24   R                  5       XÒSS2SS24   R                  5       4SS95      40 UD6  UR                  " [        [        R                  " USS2SS24   R                  5       XÁSS2SS24   R                  5       4SS95      [        [        R                  " USS2SS24   R                  5       XÒSS2SS24   R                  5       4SS95      40 UD6  Ub2  UR                  UR                  5       UR                  5       USUSS	S
9  gg)a•  Plot quad grid lines on a single plot.

Args:
    x (array-like of shape (ny, nx) or (nx,)): The x-coordinates of the grid points.
    y (array-like of shape (ny, nx) or (ny,)): The y-coordinates of the grid points.
    ax (int or Bokeh Figure, optional): Which plot to use, default ``0``.
    color (str, optional): Color to plot grid lines, default ``"black"``.
    alpha (float, optional): Opacity to plot lines with, default ``0.1``.
    point_color (str, optional): Color to plot grid points or ``None`` if grid points
        should not be plotted, default ``None``.
    quad_as_tri_alpha (float, optional): Opacity to plot ``quad_as_tri`` grid, default
        ``0``.

Colors may be a string color or the letter ``"C"`` followed by an integer in the range
``"C0"`` to ``"C9"`` to use a color from the ``Category10`` palette.

Warning:
    ``quad_as_tri_alpha > 0`` plots all quads as though they are unmasked.
)Ú
line_colorr]   r   g      Ð?Néÿÿÿÿr+   )r9   Úcircleé   )ÚxÚyÚ
fill_colorr`   r]   ÚmarkerÚsize)	rR   Ú_grid_as_2dÚlistÚTÚ
multi_lineÚravelr0   ÚstackÚscatter)r:   rd   re   rQ   rL   r]   Úpoint_colorÚquad_as_tri_alpharC   rU   rV   ÚkwargsÚxmidÚymids                 rD   ÚgridÚBokehRenderer.gridv   s¨  € ð: ×Ñ˜rÓ"ˆØ×Ñ Ó%‰ˆÜ�!‹W”t˜AŸC™C“yÑ ˆÜ�!‹W”t˜AŸC™C“yÑ ˆØ %Ñ6ˆØ�Š�rÑ( Ò(Ø˜qÔ à˜!˜C˜R˜C  " ˜H™+¨¨!©"¨c¨r¨c¨'©
Ñ2°Q°s¸°s¸A¹B°w±ZÑ?À!ÀAÁBÈÉÀFÁ)ÑKÑL×SÑSÓUˆDØ˜!˜C˜R˜C  " ˜H™+¨¨!©"¨c¨r¨c¨'©
Ñ2°Q°s¸°s¸A¹B°w±ZÑ?À!ÀAÁBÈÉÀFÁ)ÑKÑL×SÑSÓUˆDØ�NŠNÜ”R—X’X˜q  "  c r c ™{×0Ñ0Ó2°D¸A¹BÀÁ¸F¹)¿/¹/Ó:KÐLÐSTÑUÓVÜ”R—X’X˜q  "  c r c ™{×0Ñ0Ó2°D¸A¹BÀÁ¸F¹)¿/¹/Ó:KÐLÐSTÑUÓVñð òð �NŠNÜ”R—X’X˜q  "  a¡b ™z×/Ñ/Ó1°4¸1¹2¸sÀ¸s¸7¹×9IÑ9IÓ9KÐLÐSTÑUÓVÜ”R—X’X˜q  "  a¡b ™z×/Ñ/Ó1°4¸1¹2¸sÀ¸s¸7¹×9IÑ9IÓ9KÐLÐSTÑUÓVñð òð Ñ"Ø�K‰KØ—'‘'“)˜qŸw™w›y°UÀtÐSXØ að ò )ð #rG   c                ó¬   • [        U5      nU R                  U5      nU R                  U5      n[        X5      u  p‰Ub  U	c   eUR	                  X‰XEUS9  gg)a?  Plot contour lines on a single plot.

Args:
    lines (sequence of arrays): Contour line data as returned by
        :meth:`~.ContourGenerator.lines`.
    line_type (LineType or str): Type of :meth:`~.ContourGenerator.lines` data as returned
        by :attr:`~.ContourGenerator.line_type`, or a string equivalent.
    ax (int or Bokeh Figure, optional): Which plot to use, default ``0``.
    color (str, optional): Color to plot lines. May be a string color or the letter ``"C"``
        followed by an integer in the range ``"C0"`` to ``"C9"`` to use a color from the
        ``Category10`` palette. Default ``"C0"``.
    alpha (float, optional): Opacity to plot lines with, default ``1.0``.
    linewidth (float, optional): Width of lines, default ``1``.

Note:
    Assumes all lines are open line strips not closed line loops.
N)r`   Ú
line_alpharX   )r   rR   rN   r   Úline)
r:   ÚlinesÚ	line_typerQ   rL   r]   Ú	linewidthrC   rU   rV   s
             rD   rz   ÚBokehRenderer.linesª   s`   € ô4 ! Ó+ˆ	Ø×Ñ˜rÓ"ˆØ×#Ñ# EÓ*ˆÜ Ó1‰ˆØ‰>Ø‘>Ð!�>Ø�H‰H�R¨ÈIˆHÒVð rG   c                ó  • [         R                  R                  U5      nU[         R                  R                  L a  gU R	                  U5      nU R                  U5      nU R                  X5      u  pUR                  X   X&   USSS9  g)a£  Plot masked out grid points as circles on a single plot.

Args:
    x (array-like of shape (ny, nx) or (nx,)): The x-coordinates of the grid points.
    y (array-like of shape (ny, nx) or (ny,)): The y-coordinates of the grid points.
    z (masked array of shape (ny, nx): z-values.
    ax (int or Bokeh Figure, optional): Which plot to use, default ``0``.
    color (str, optional): Circle color, default ``"black"``.
Nrb   r%   )rf   rg   rh   )r0   ÚmaÚgetmaskÚnomaskrR   rN   ri   ro   )r:   rd   re   ÚzrQ   rL   ÚmaskrC   s           rD   rƒ   ÚBokehRenderer.maskÌ   su   € ô" �u‰u�}‰}˜QÓˆØ”2—5‘5—<‘<ÒØØ×Ñ˜rÓ"ˆØ×#Ñ# EÓ*ˆØ×Ñ Ó%‰ˆØ�‰�A‘G˜Q™W°¸xÈbˆÒQrG   )Ú	webdriverc               óÈ   • U(       a!  U R                    H  nSUl        SUl        M     U R                  (       a  [	        U R
                  XS9  g[        U R
                  XS9  g)a•  Save plots to SVG or PNG file.

Args:
    filename (str): Filename to save to.
    transparent (bool, optional): Whether background should be transparent, default
        ``False``.
    webdriver (WebDriver, optional): Selenium WebDriver instance to use to create the image.

        .. versionadded:: 1.1.1

Warning:
    To output to SVG file, ``want_svg=True`` must have been passed to the constructor.
N)Úfilenamer…   )r   Úbackground_fill_colorÚborder_fill_colorr#   r   r    r   )r:   r‡   Útransparentr…   rC   s        rD   ÚsaveÚBokehRenderer.saveå   sJ   € ö( Ø—}”}�Ø,0�Ô)Ø(,�Ö%ñ %ð �>�>Ü�t—|‘|¨hÓLä�t—|‘|¨hÓLrG   c               ó|   • [        U R                  US9n[        R                  " 5       nUR	                  US5        U$ )zÕSave plots to an ``io.BytesIO`` buffer.

Args:
    webdriver (WebDriver, optional): Selenium WebDriver instance to use to create the image.

        .. versionadded:: 1.1.1

Return:
    BytesIO: PNG image buffer.
)ÚdriverÚpng)r	   r    ÚioÚBytesIOr‹   )r:   r…   ÚimageÚbuffers       rD   Úsave_to_bufferÚBokehRenderer.save_to_buffer  s2   € ô & d§l¡l¸9ÑEˆÜ—’“ˆØ�
‰
�6˜5Ô!ØˆrG   c                ó.   • [        U R                  5        g)z:Show plots in web browser, in usual Bokeh manner.
        N)r   r    )r:   s    rD   r   ÚBokehRenderer.show  s   € ô 	ˆT�\‰\ÕrG   c                óœ   • U R                  U5      nXl        SUR                  l        Ub!  U R                  U5      UR                  l        gg)a”  Set the title of a single plot.

Args:
    title (str): Title text.
    ax (int or Bokeh Figure, optional): Which plot to set the title of, default ``0``.
    color (str, optional): Color to set title. May be a string color or the letter ``"C"``
        followed by an integer in the range ``"C0"`` to ``"C9"`` to use a color from the
        ``Category10`` palette. Default ``None`` which is ``black``.
ÚcenterN)rR   ÚtitleÚalignrN   Ú
text_color)r:   rš   rQ   rL   rC   s        rD   rš   ÚBokehRenderer.title  sF   € ð ×Ñ˜rÓ"ˆØŒ	Ø"ˆ�	‰	ŒØÑØ#'×#6Ñ#6°uÓ#=ˆC�I‰IÕ ð rG   c                óà  • U R                  U5      nU R                  U5      nU R                  X5      u  p[        R                  " U5      nUR
                  u  pšUSSS.n[        U	5       HD  n[        U
5       H2  n[        SXU4   X,U4   X<U4   U  S.UD6nUR                  U5        M4     MF     U(       aµ  [        U	S-
  5       H¢  n[        U
S-
  5       H�  n[        R                  " XUS-   2XÝS-   24   5      n[        R                  " X,US-   2XÝS-   24   5      n[        R                  " X<US-   2XÝS-   24   5      nUR                  [        SUUUU  S.UD65        M�     M¤     gg)	a=  Show ``z`` values on a single plot.

Args:
    x (array-like of shape (ny, nx) or (nx,)): The x-coordinates of the grid points.
    y (array-like of shape (ny, nx) or (ny,)): The y-coordinates of the grid points.
    z (array-like of shape (ny, nx): z-values.
    ax (int or Bokeh Figure, optional): Which plot to use, default ``0``.
    color (str, optional): Color of added text. May be a string color or the letter ``"C"``
        followed by an integer in the range ``"C0"`` to ``"C9"`` to use a color from the
        ``Category10`` palette. Default ``"green"``.
    fmt (str, optional): Format to display z-values, default ``".1f"``.
    quad_as_tri (bool, optional): Whether to show z-values at the ``quad_as_tri`` centres
        of quads.

Warning:
    ``quad_as_tri=True`` shows z-values for all quads, even if masked.
r™   Úmiddle)rœ   Ú
text_alignÚtext_baseline)rd   re   Útextr+   é   N© )
rR   rN   ri   r0   r1   Úshaper3   r   Ú
add_layoutÚmean)r:   rd   re   r‚   rQ   rL   ÚfmtÚquad_as_trirC   ÚnyÚnxrr   ÚjÚiÚlabelÚxxÚyyÚzzs                     rD   Úz_valuesÚBokehRenderer.z_values(  sh  € ð6 ×Ñ˜rÓ"ˆØ×#Ñ# EÓ*ˆØ×Ñ Ó%‰ˆÜ�JŠJ�q‹MˆØ—‘‰ˆØ %°XÐPXÑYˆÜ�r–ˆAÜ˜2–Y�ÜÐV  Q $¡¨1°¨T©7¸AÀ¸d¹GÀSÀE¸?ÑVÈvÑV�Ø—‘˜uÖ%ó ñ ö Ü˜2˜a™4–[�Ü˜r !™tž�AÜŸš  Q q¡S 5¨!¨a©C¨% <¡Ó1�BÜŸš  Q q¡S 5¨!¨a©C¨% <¡Ó1�BÜŸš  Q q¡S 5¨!¨a©C¨% <¡Ó1�BØ—N‘N¤5Ð#R¨2°¸RÀÀ¸JÑ#RÈ6Ñ#RÖSó	 %ò !ð rG   )r   r    r!   r#   )r+   r+   )é	   r´   TF)r;   r2   r,   r2   r<   ztuple[float, float]r=   r"   r>   r"   ÚreturnÚNone)rL   rK   rµ   rK   )rQ   úfigure | intrµ   r   )r   ÚC0gffffffæ?)r[   r   r\   zFillType | strrQ   r·   rL   rK   r]   Úfloatrµ   r¶   )r   Úblackgš™™™™™¹?Nr   )rd   r   re   r   rQ   r·   rL   rK   r]   r¹   rp   ú
str | Nonerq   r¹   rµ   r¶   )r   r¸   g      ð?r+   )rz   r   r{   zLineType | strrQ   r·   rL   rK   r]   r¹   r|   r¹   rµ   r¶   )r   rº   )rd   r   re   r   r‚   z'ArrayLike | np.ma.MaskedArray[Any, Any]rQ   r·   rL   rK   rµ   r¶   )F)r‡   rK   rŠ   r"   r…   úWebDriver | Nonerµ   r¶   )r…   r¼   rµ   z
io.BytesIO)rµ   r¶   )r   N)rš   rK   rQ   r·   rL   r»   rµ   r¶   )r   Úgreenz.1fF)rd   r   re   r   r‚   r   rQ   r·   rL   rK   r¨   rK   r©   r"   rµ   r¶   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__rE   rN   rR   r[   ru   rz   rƒ   r‹   r”   r   rš   r²   Ú__static_attributes__r¤   rG   rD   r   r      s«  ‡ ñð ÓØÓØÓØƒOð ØØ'-ØØðIàðIð ðIð %ð	Ið
 ðIð ðIð 
õIô:ôð ØØð^àð^ð "ð^ð ð	^ð
 ð^ð ð^ð 
õ^ð@ ØØØ"&Ø#$ð2)àð2)ð ð2)ð ð	2)ð
 ð2)ð ð2)ð  ð2)ð !ð2)ð 
õ2)ðp ØØØð Wàð Wð "ð Wð ð	 Wð
 ð Wð ð Wð ð Wð 
õ WðN ØðRàðRð ðRð 3ð	Rð
 ðRð ðRð 
õRð8 "ðMð
 '+ñMàðMð ðMð
 $ðMð 
öMð< ?C÷ ô ö
>ð* ØØØ!ð+Tàð+Tð ð+Tð ð	+Tð
 ð+Tð ð+Tð ð+Tð ð+Tð 
÷+Tð +TrG   r   ).Ú
__future__r   r�   Útypingr   r   Úbokeh.ior   r   r   Úbokeh.io.exportr	   Úbokeh.layoutsr
   Úbokeh.models.annotations.labelsr   Úbokeh.palettesr   Úbokeh.plottingr   Únumpyr0   Úcontourpy.enum_utilr   r   Úcontourpy.util.bokeh_utilr   r   Úcontourpy.util.rendererr   Úbokeh.core.enumsr   Úbokeh.modelsr   r   Únumpy.typingr   Ú#selenium.webdriver.remote.webdriverr   Ú	contourpyr   r   Úcontourpy._contourpyr   r   r   r¤   rG   rD   Ú<module>r×      sW   ðÝ "ã 	ß %ç 1Ñ 1Ý 1Ý "Ý 1Ý %Ý !Û ç :ß EÝ ,æÝ2Ý%Ý&Ý&Ý=ç,ß;ôvT�Hõ vTrG   