
    ch!                       % S SK Jr  S SKrS SKrS SKrS SKrS SKJrJrJ	r	J
r
  SSKJrJr  SSKJr  SSKJrJr  SSKJr  \(       a!  S SKr\R,                  S	:  a  S S
KJr  OS S
KJr  \\\4   rS\S'   \\\4   rS\S'   \
\\\\4   4   rS\S'   \	S\4   r S\S'   \\\\
\\\\4   4   4   \\\\\4   4   4   r!S\S'    " S S\\ \4   5      r" " S S5      r#        SS jr$      SS jr% " S S5      r&g)    )annotationsN)TYPE_CHECKINGAnyCallableUnion   )compile_with_vegafusionusing_vegafusion)spec_to_mimebundle)PluginEnablerPluginRegistry)validate_jsonschema)   
   )	TypeAliasr   MimeBundleDataTypeMimeBundleMetaDataTypeMimeBundleType.RendererTypeDefaultRendererReturnTypec                      \ rS rSrS\R
                  " S5      0r         S                   SS jjrSrg)	RendererRegistry)   notebookz
            To use the 'notebook' renderer, you must install the vega package
            and the associated Jupyter extension.
            See https://altair-viz.github.io/getting_started/installation.html
            for more information.
            Nc
           
         UUUUUUUUU	S.	nU
R                  UR                  5        VVs0 s H  u  pUc  M
  X_M     snn5        U R                  SU
S9$ s  snnf )a  
Set options for embeddings of Vega & Vega-Lite charts.

Options are fully documented at https://github.com/vega/vega-embed.
Similar to the `enable()` method, this can be used as either
a persistent global switch, or as a temporary local setting using
a context manager (i.e. a `with` statement).

Parameters
----------
defaultStyle : bool or string
    Specify a default stylesheet for embed actions.
renderer : string
    The renderer to use for the view. One of "canvas" (default) or "svg"
width : integer
    The view width in pixels
height : integer
    The view height in pixels
padding : integer
    The view padding in pixels
scaleFactor : number
    The number by which to multiply the width and height (default 1)
    of an exported PNG or SVG image.
actions : bool or dict
    Determines if action links ("Export as PNG/SVG", "View Source",
    "View Vega" (only for Vega-Lite), "Open in Vega Editor") are
    included with the embedded view. If the value is true, all action
    links will be shown and none if the value is false. This property
    can take a key-value mapping object that maps keys (export, source,
    compiled, editor) to boolean values for determining if
    each action link should be shown.
format_locale : str or dict
    d3-format locale name or dictionary. Defaults to "en-US" for United States English.
    See https://github.com/d3/d3-format/tree/main/locale for available names and example
    definitions.
time_format_locale : str or dict
    d3-time-format locale name or dictionary. Defaults to "en-US" for United States English.
    See https://github.com/d3/d3-time-format/tree/main/locale for available names and example
    definitions.
**kwargs :
    Additional options are passed directly to embed options.
)	defaultStylerendererwidthheightpaddingscaleFactoractionsformatLocaletimeFormatLocaleN)embed_options)updateitemsenable)selfr   r   r   r   r    r!   r"   format_localetime_format_localekwargsoptionskeyvals                 gC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\altair/utils/display.pyset_embed_options"RendererRegistry.set_embed_options5   sl    p ) &) 2
K
 	SHC3xsxST{{4v{66 Ts
   	A
A
 )	NNNNNNNNN)r   zbool | str | Noner   z
str | Noner   
int | Noner   r4   r    r4   r!   zfloat | Noner"   zbool | dict[str, bool] | Noner*   str | dict | Noner+   r5   returnr   )	__name__
__module____qualname____firstlineno__textwrapdedententrypoint_err_messagesr1   __static_attributes__r3       r0   r   r   )   s    HOO
	 +/# !"$(15+/04C7'C7 C7 	C7
 C7 C7 "C7 /C7 )C7 .C7 
C7 C7r?   r   c                  ^    \ rS rSr% SrSrS\S'   SrSSS jjrSS jr	 S     SS	 jjr
S
rg)Displayable   a1  
A base display class for VegaLite v1/v2.

This class takes a VegaLite v1/v2 spec and does the following:

1. Optionally validates the spec against a schema.
2. Uses the RendererPlugin to grab a renderer and call it when the
   IPython/Jupyter display method (_repr_mimebundle_) is called.

The spec passed to this class must be fully schema compliant and already
have the data portion of the spec fully processed and ready to serialize.
In practice, this means, the data portion of the spec should have been passed
through appropriate data model transformers.
NzRendererRegistry | None	renderers)altair c                <    Xl         X l        U R                  5         g N)specvalidate	_validate)r)   rH   rI   s      r0   __init__Displayable.__init__   s    	 r?   c                    [         R                  " U R                  6 nUc   e[        R                  " UR                  S5      5      n[        U R                  U5        g)z%Validate the spec against the schema.Nzutf-8)pkgutilget_dataschema_pathjsonloadsdecoder   rH   )r)   dataschema_dicts      r0   rJ   Displayable._validate   sM    !1!12&*jjW1E&FII	
r?   c                    U R                   b1  U R                   R                  5       nUc   eU" U R                  5      $ 0 $ )z6Return a MIME bundle for display in Jupyter frontends.)rC   getrH   )r)   includeexcluderenderer_funcs       r0   _repr_mimebundle_Displayable._repr_mimebundle_   s@     >>% NN..0M ,,, ++Ir?   )rH   rI   )F)rH   dict[str, Any]rI   boolr6   None)r6   r`   )NN)rY   r   rZ   r   r6   r   )r7   r8   r9   r:   __doc__rC   __annotations__rP   rK   rJ   r\   r>   r3   r?   r0   rA   rA      sJ     *.I&- K

 37		,/			 	r?   rA   c                    SSK JnJn  [        U [        5      (       d   e0 n0 n[        5       (       a  [        U 5      n X:X  a  UnXU'   X&S'   U(       a  X7U'   Xg4$ )z
A default renderer for Vega or VegaLite that works for modern frontends.

This renderer works with modern frontends (JupyterLab, nteract) that know
how to render the custom VegaLite MIME type listed above.
r   )VEGA_MIME_TYPEVEGALITE_MIME_TYPEz
text/plain)altair.vegalite.v5.displayrd   re   
isinstancedictr
   r	   )rH   	mime_typestr_reprr-   rd   re   bundlemetadatas           r0   default_renderer_baserm      si     NdD!!!!$&F*,H&t, *&I9#<%r?   c                     [        U 4SUS.UD6$ )zw
A renderer that returns a MIME type of application/json.

In JupyterLab/nteract this is rendered as a nice JSON tree.
zapplication/json)ri   rj   )rm   )rH   rj   r-   s      r0   json_renderer_basero      s&     !*XAH r?   c                  D    \ rS rSrSrSS	S jjr\S
S j5       rSS jrSr	g)HTMLRenderer   zDObject to render charts as HTML, with a unique output div each time.c                    Xl         X l        g rG   _output_divr,   )r)   
output_divr,   s      r0   rK   HTMLRenderer.__init__   s    %r?   c                r    U R                   R                  [        R                  " 5       R                  5      $ rG   )ru   formatuuiduuid4hex)r)   s    r0   rv   HTMLRenderer.output_div   s%    &&tzz|'7'788r?   c                    U R                   R                  5       nUR                  " S0 UDSU R                  0D6  [	        U4SS0UD6$ )Nrv   ry   htmlr3   )r,   copyr&   rv   r   )r)   rH   rl   r,   s       r0   __call__HTMLRenderer.__call__   sA    !!#==T__=!$@v@@@r?   rt   N)zaltair-viz-{})rv   strr6   r`   )r6   r   )rH   r^   r6   zdict[str, str])
r7   r8   r9   r:   ra   rK   propertyrv   r   r>   r3   r?   r0   rq   rq      s$    N 9 9Ar?   rq   )rH   r^   ri   r   rj   r   r6   r   )rH   r^   rj   r   r6   r   )'
__future__r   rQ   rN   r;   rz   typingr   r   r   r   _vegafusion_datar	   r
   
mimebundler   plugin_registryr   r   schemapir   sysversion_infor   typing_extensionsrh   r   r   rb   r   tupler   r   r   r   rA   rm   ro   rq   r3   r?   r0   <module>r      s_   "     6 6 G * : )
7"$/ !%S#X I .$(cN 	 2!02HHII	  #3#67i 7 (-eCc3h'(	()4T#s(^0C+DD( 9 
O7~lN&BC O7n+ +\
%(47>


$'

A Ar?   