ó
    {ñ:i˜  ã                   óJ   • S r SSKJr  SSKJr  S rS rS	S jrS	S jr	S
S jr
g)z|
========================
Widget testing utilities
========================

See also :mod:`matplotlib.tests.test_widgets`.
é    )ÚmockNc                  óº   • [         R                  " SS5      u  pUR                  SS/SS/5        UR                  S5        U R                  R                  5         U$ )z"Create a plot and return its Axes.é   r   éÈ   g      ð?)ÚpltÚsubplotsÚplotÚ
set_aspectÚcanvasÚdraw)ÚfigÚaxs     Ú]/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/matplotlib/testing/widgets.pyÚget_axr      sI   € ä�lŠl˜1˜aÓ �G€CØ‡G�GˆQ�ˆH�q˜#�hÔØ‡M�M�#ÔØ‡J�J‡O�OÔØ€Ió    c                  ó   • g ©N© )ÚargsÚkwargss     r   Únoopr      s   € Ør   c                 ó2  • [         R                  " 5       nXl        U R                  R	                  X#4X#4/5      S   u  Ul        Ul        X#sUl        Ul        Xl	        U R                  SS9R                  Ul        XFl        XVl        SUl        SUl        U$ )aÅ  
Create a mock event that can stand in for `.Event` and its subclasses.

This event is intended to be used in tests where it can be passed into
event handling functions.

Parameters
----------
ax : `~matplotlib.axes.Axes`
    The Axes the event will be in.
xdata : float
    x coord of mouse in data coords.
ydata : float
    y coord of mouse in data coords.
button : None or `MouseButton` or {'up', 'down'}
    The mouse button pressed in this event (see also `.MouseEvent`).
key : None or str
    The key pressed when the mouse event triggered (see also `.KeyEvent`).
step : int
    Number of scroll steps (positive for 'up', negative for 'down').

Returns
-------
event
    A `.Event`\-like Mock instance.
r   T)ÚrootNÚCustom)r   ÚMockÚbuttonÚ	transDataÚ	transformÚxÚyÚxdataÚydataÚinaxesÚ
get_figurer   ÚkeyÚstepÚguiEventÚname)r   r   r!   r"   r%   r&   Úevents          r   Ú
mock_eventr*      s‘   € ô6 �IŠI‹K€EØ„LØ—|‘|×-Ñ-°¨~Ø05¨~ð/?ó @Ø@AñCÑ€E„GˆUŒWà$Ð€E„K�”Ø„LØ—=‘= d�=Ð+×2Ñ2€E„LØ„IØ„JØ€E„NØ€E„JØ€Lr   c                 óZ   • [        U R                  X#XEU5      n[        X5      nU" U5        g)a  
Trigger an event on the given tool.

Parameters
----------
tool : matplotlib.widgets.AxesWidget
etype : str
    The event to trigger.
xdata : float
    x coord of mouse in data coords.
ydata : float
    y coord of mouse in data coords.
button : None or `MouseButton` or {'up', 'down'}
    The mouse button pressed in this event (see also `.MouseEvent`).
key : None or str
    The key pressed when the mouse event triggered (see also `.KeyEvent`).
step : int
    Number of scroll steps (positive for 'up', negative for 'down').
N)r*   r   Úgetattr)	ÚtoolÚetyper   r!   r"   r%   r&   r)   Úfuncs	            r   Údo_eventr0   D   s)   € ô( �t—w‘w ¨u¸4Ó@€EÜ�4Ó€DÙˆ…Kr   c           	      óÔ   • Ub  [        U SUS   US   SUS9  [        U SUS   US   SS9  [        U SUS   US   SS9  [        U S	US   US   SS9  Ub  [        U S
US   US   SUS9  gg)aM  
Helper to simulate a mouse drag operation.

Parameters
----------
tool : `~matplotlib.widgets.Widget`
start : [float, float]
    Starting point in data coordinates.
end : [float, float]
    End point in data coordinates.
key : None or str
     An optional key that is pressed during the whole operation
     (see also `.KeyEvent`).
NÚon_key_pressr   r   )r!   r"   r   r%   Úpress)r!   r"   r   ÚonmoveÚreleaseÚon_key_release)r0   )r-   ÚstartÚendr%   s       r   Úclick_and_dragr9   ]   s˜   € ð �ä��~¨U°1©X¸UÀ1¹XØ˜sò	$ô ˆT�7 %¨¡(°%¸±(À1ÒEÜˆT�8 3 q¡6°°Q±ÀÒBÜˆT�9 C¨¡F°#°a±&ÀÒCØ
�ä�Ð'¨s°1©v¸SÀ¹VØ˜só	$ð r   )r   r   r   Nr   r   )Ú__doc__Úunittestr   Úmatplotlib.pyplotÚpyplotr   r   r   r*   r0   r9   r   r   r   Ú<module>r>      s,   ðñõ å òò	ô&ôRõ2$r   