Ë
    {�hÐP  ã                   ó$  — d Z ddlZddlZddlZd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd>d„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z d„ Z!d d!d"d#d d!d$œZ"d%d&d'd(d)d*d+d,d-d.d/œ
Z#d"d0d1d2d3d4d5d6d7d8d8d9œZ$d:d;d<d=œZ%y)?zG
Tools

A module for converting from mpl language to plotly language.

é    Nc                 óB  — g }||d   | d   k(  fz  }||d   | d   k(  fz  }|d   dk(  r2|d   |d   z
  }| d   | d   z
  }|||z
  dk  fz  }||d   | d   k(  fz  }n9|d   dk(  r1|d	   |d   z
  }| d	   | d   z
  }|||z
  dk  fz  }||d   | d   k(  fz  }t        |«      ry
y)zÍCheck if two bars belong in the same collection (bar chart).

    Positional arguments:
    old_bar -- a previously sorted bar dictionary.
    new_bar -- a new bar dictionary that needs to be sorted.

    ÚorientationÚ	facecolorÚvÚx1Úx0g�íµ ÷Æ°>Úy0ÚhÚy1TF)Úall)Úold_barÚnew_barÚtestsÚ	new_widthÚ	old_widthÚ
new_heightÚ
old_heights          úZ/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/plotly/matplotlylib/mpltools.pyÚcheck_bar_matchr      s  € ð €EØ	ˆg�mÑ$¨°Ñ(>Ñ>Ð@Ñ@€EØ	ˆg�kÑ" g¨kÑ&:Ñ:Ð<Ñ<€EØˆ}Ñ Ò$Ø˜D‘M G¨D¡MÑ1ˆ	Ø˜D‘M G¨D¡MÑ1ˆ	Ø�)˜iÑ'¨(Ñ2Ð4Ñ4ˆØ�'˜$‘- 7¨4¡=Ñ0Ð2Ñ2‰Ø	�Ñ	 3Ò	&Ø˜T‘] W¨T¡]Ñ2ˆ
Ø˜T‘] W¨T¡]Ñ2ˆ
Ø�*˜zÑ)¨HÑ4Ð6Ñ6ˆØ�'˜$‘- 7¨4¡=Ñ0Ð2Ñ2ˆÜ
ˆ5„zØàó    c                 ó  — | j                  «       j                  «       }|j                  «       j                  «       }|d   d   |d   d   k  ry|d   d   |d   d   k  ry|d   d   |d   d   kD  ry|d   d   |d   d   kD  ryy)Nr   Fé   é   T)Úget_window_extentÚcorners)Ú	inner_objÚ	outer_objÚinner_cornersÚouter_cornerss       r   Úcheck_cornersr    (   s¯   € Ø×/Ñ/Ó1×9Ñ9Ó;€MØ×/Ñ/Ó1×9Ñ9Ó;€MØ�QÑ˜Ñ˜]¨1Ñ-¨aÑ0Ò0ØØ	�qÑ	˜!Ñ	˜}¨QÑ/°Ñ2Ò	2ØØ	�qÑ	˜!Ñ	˜}¨QÑ/°Ñ2Ò	2ØØ	�qÑ	˜!Ñ	˜}¨QÑ/°Ñ2Ò	2Øàr   c                 ó.  — | t         v r	t         |    S | j                  d«      }t        |«      dk  ryt        j                  t        |d   «      d«      rydj                  |D �cg c]  }|dz   ‘Œ	 c}«      }|dk(  rd}|S |d	k(  rd
}|S |dk(  rd}|S c c}w )z@Convert mpl line symbol to plotly line symbol and return symbol.ú,é   Úsolidr   ç        Úpxz7.4px,3.2pxÚdashedz12.8px,3.2px,2.0px,3.2pxÚdashdotz2.0px,3.3pxÚdotted)ÚDASH_MAPÚsplitÚlenÚmathÚiscloseÚfloatÚjoin)Úmpl_dashÚ
dash_arrayÚxÚdashpxs       r   Úconvert_dashr5   7   s³   € à”8ÑÜ˜Ñ!Ð!à—^‘^ CÓ(ˆ
äˆz‹?˜QÒØô �<‰<œ˜j¨™mÓ,¨cÔ2Øð —‘¨ZÖ8¨˜1˜t›8Ò8Ó9ˆð �]Ò"ØˆFð
 ˆð	 Ð1Ò1ØˆFð ˆð �}Ò$ØˆFØˆùò 9s   Á$Bc                 óL   — | d   }t        | d   «      }|t        v r	t        |   S y )Nr   r   )ÚtupleÚPATH_MAP)ÚpathÚvertsÚcodes      r   Úconvert_pathr<   U   s-   € Ø�‰G€EÜ��a‘‹>€DØŒxÑÜ˜‰~Ðàr   c                 óŠ   — t        | t        «      r"t        «       }| D ]  }|t        |«      gz  }Œ |S | t        v r	t        |    S y)z=Convert mpl marker symbol to plotly symbol and return symbol.Úcircle)Ú
isinstanceÚlistÚconvert_symbolÚ
SYMBOL_MAP)Ú
mpl_symbolÚsymbolÚss      r   rA   rA   ^   sO   € ä�*œdÔ#Ü“ˆØò 	*ˆAØ”~ aÓ(Ð)Ñ)‰Fð	*àˆØ	”zÑ	!Ü˜*Ñ%Ð%àr   c           	      ó„   ‡ ‡— ‰ j                  d«      Š t        ‰ «      Št        ˆˆ fd„t        d‰‰dz  «      D «       «      S )zã
    Change a hex color to an rgb tuple

    :param (str|unicode) value: The hex string we want to convert.
    :return: (int, int, int) The red, green, blue int-tuple.

    Example:

        '#FFFFFF' --> (255, 255, 255)

    ú#c              3   óH   •K  — | ]  }t        ‰||‰d z  z    d«      –— Œ y­w)r   é   N)Úint)Ú.0ÚiÚlvÚvalues     €€r   ú	<genexpr>zhex_to_rgb.<locals>.<genexpr>y   s'   øè ø€ ÒP°Q”�U˜1˜q 2¨¡7™{Ð+¨R×0ÑPùs   ƒ"r   r   )Úlstripr,   r7   Úrange)rN   rM   s   `@r   Ú
hex_to_rgbrR   k   s:   ù€ ð �L‰L˜Ó€EÜ	ˆU‹€BÜÔP¼%ÀÀ2ÀrÈQÁwÓ:OÔPÓPÐPr   c                 ór   — | €yt        | «      }|€dj                  |«      S ||fz   }dj                  |«      S )a  
    Merge hex color with an alpha (opacity) to get an rgba tuple.

    :param (str|unicode) color: A hex color string.
    :param (float|int) opacity: A value [0, 1] for the 'a' in 'rgba'.
    :return: (int, int, int, float) The rgba color and alpha tuple.

    Nzrgb {}zrgba {})rR   Úformat)ÚcolorÚopacityÚrgb_tupÚrgba_tups       r   Úmerge_color_and_opacityrY   |   sG   € ð €}Øä˜Ó€GØ€Ø�‰˜wÓ'Ð'à˜'˜Ñ#€HØ×Ñ˜HÓ%Ð%r   c                 ó&   — | t         v r	t         |    S y)a  Convert mpl vertical alignment word to equivalent HTML word.

    Text alignment specifiers from mpl differ very slightly from those used
    in HTML. See the VA_MAP for more details.

    Positional arguments:
    mpl_va -- vertical mpl text alignment spec.

    N)ÚVA_MAP)Úmpl_vas    r   Ú
convert_var]   �   s   € ð ”ÑÜ�f‰~Ðàr   c                 óx   — | d   | d   | d   z   g}|d   |d   z
  }|d   |d   z
  |z  }|d   |d   z
  |z  }||gS )aH  Map x dimension of current plot to plotly's domain space.

    The bbox used to locate an axes object in mpl differs from the
    method used to locate axes in plotly. The mpl version locates each
    axes in the figure so that axes in a single-plot figure might have
    the bounds, [0.125, 0.125, 0.775, 0.775] (x0, y0, width, height),
    in mpl's figure coordinates. However, the axes all share one space in
    plotly such that the domain will always be [0, 0, 1, 1]
    (x0, y0, x1, y1). To convert between the two, the mpl figure bounds
    need to be mapped to a [0, 1] domain for x and y. The margins set
    upon opening a new figure will appropriately match the mpl margins.

    Optionally, setting margins=0 and simply copying the domains from
    mpl to plotly would place axes appropriately. However,
    this would throw off axis and title labeling.

    Positional arguments:
    mpl_plot_bounds -- the (x0, y0, width, height) params for current ax **
    mpl_max_x_bounds -- overall (x0, x1) bounds for all axes **

    ** these are all specified in mpl figure coordinates

    r   r#   r   © )Úmpl_plot_boundsÚmpl_max_x_boundsÚ	mpl_x_domÚplotting_widthr   r   s         r   Úconvert_x_domainrd       sr   € ð0 ! Ñ# _°QÑ%7¸/È!Ñ:LÑ%LÐM€IØ% aÑ(Ð+;¸AÑ+>Ñ>€NØ
�A‰,Ð)¨!Ñ,Ñ
,°Ñ	>€BØ
�A‰,Ð)¨!Ñ,Ñ
,°Ñ	>€BØ�ˆ8€Or   c                 óx   — | d   | d   | d   z   g}|d   |d   z
  }|d   |d   z
  |z  }|d   |d   z
  |z  }||gS )aH  Map y dimension of current plot to plotly's domain space.

    The bbox used to locate an axes object in mpl differs from the
    method used to locate axes in plotly. The mpl version locates each
    axes in the figure so that axes in a single-plot figure might have
    the bounds, [0.125, 0.125, 0.775, 0.775] (x0, y0, width, height),
    in mpl's figure coordinates. However, the axes all share one space in
    plotly such that the domain will always be [0, 0, 1, 1]
    (x0, y0, x1, y1). To convert between the two, the mpl figure bounds
    need to be mapped to a [0, 1] domain for x and y. The margins set
    upon opening a new figure will appropriately match the mpl margins.

    Optionally, setting margins=0 and simply copying the domains from
    mpl to plotly would place axes appropriately. However,
    this would throw off axis and title labeling.

    Positional arguments:
    mpl_plot_bounds -- the (x0, y0, width, height) params for current ax **
    mpl_max_y_bounds -- overall (y0, y1) bounds for all axes **

    ** these are all specified in mpl figure coordinates

    r   r   r   r_   )r`   Úmpl_max_y_boundsÚ	mpl_y_domÚplotting_heightr	   r   s         r   Úconvert_y_domainri   ¿   sr   € ð0 ! Ñ# _°QÑ%7¸/È!Ñ:LÑ%LÐM€IØ& qÑ)Ð,<¸QÑ,?Ñ?€OØ
�A‰,Ð)¨!Ñ,Ñ
,°Ñ	?€BØ
�A‰,Ð)¨!Ñ,Ñ
,°Ñ	?€BØ�ˆ8€Or   c                 óž   — | |d   d   z
  }|d   |d   d   |d   d   z   z
  }||d   d   z
  }|d   |d   d   |d   d   z   z
  }||z  ||z  fS )að  Convert mpl display coordinates to plotly paper coordinates.

    Plotly references object positions with an (x, y) coordinate pair in either
    'data' or 'paper' coordinates which reference actual data in a plot or
    the entire plotly axes space where the bottom-left of the bottom-left
    plot has the location (x, y) = (0, 0) and the top-right of the top-right
    plot has the location (x, y) = (1, 1). Display coordinates in mpl reference
    objects with an (x, y) pair in pixel coordinates, where the bottom-left
    corner is at the location (x, y) = (0, 0) and the top-right corner is at
    the location (x, y) = (figwidth*dpi, figheight*dpi). Here, figwidth and
    figheight are in inches and dpi are the dots per inch resolution.

    ÚmarginÚlÚwidthÚrÚbÚheightÚtr_   )r3   ÚyÚlayoutÚnum_xÚden_xÚnum_yÚden_ys          r   Údisplay_to_paperrx   Þ   sŽ   € ð ��xÑ  Ñ%Ñ%€EØ�7‰O˜v hÑ/°Ñ4°v¸hÑ7GÈÑ7LÑLÑM€EØ��xÑ  Ñ%Ñ%€EØ�8Ñ  xÑ 0°Ñ 5¸¸xÑ8HÈÑ8MÑ MÑN€EØ�5‰=˜% %™-Ð'Ð'r   c                 óœ  — g g g g f\  }}}}| j                  «       D ]x  }|j                  «       j                  }|j                  |d   «       |j                  |d   |d   z   «       |j                  |d   «       |j                  |d   |d   z   «       Œz t	        |«      t	        |«      t        |«      t        |«      f\  }}}}||f||ffS )as  Return the entire axes space for figure.

    An axes object in mpl is specified by its relation to the figure where
    (0,0) corresponds to the bottom-left part of the figure and (1,1)
    corresponds to the top-right. Margins exist in matplotlib because axes
    objects normally don't go to the edges of the figure.

    In plotly, the axes area (where all subplots go) is always specified with
    the domain [0,1] for both x and y. This function finds the smallest box,
    specified by two points, that all of the mpl axes objects fit into. This
    box is then used to map mpl axes domains to plotly axes domains.

    r   r#   r   r   )Úget_axesÚget_positionÚboundsÚappendÚminÚmax)ÚfigÚx_minÚx_maxÚy_minÚy_maxÚaxes_objr|   s          r   Úget_axes_boundsr†   ó   sÑ   € ð "$ R¨¨R Ñ€Eˆ5�%˜Ø—L‘L“Nò ,ˆØ×&Ñ&Ó(×/Ñ/ˆØ�‰�V˜A‘YÔØ�‰�V˜A‘Y ¨¡Ñ*Ô+Ø�‰�V˜A‘YÔØ�‰�V˜A‘Y ¨¡Ñ*Õ+ð,ô "% U£¬S°«Z¼¸U»ÄSÈÃZÐ!OÑ€Eˆ5�%˜Ø�5ˆ>˜E 5˜>Ð)Ð)r   c                 ó"   — | r|ry| r|sy| s|ryy)NÚticksFr_   )Ú
main_spineÚmirror_spines     r   Úget_axis_mirrorr‹     s   € Ù‘lØÙ	™LØÙ™LØàr   c           	      ó   — t        | «      t        |«      k(  rlt        | «      dkD  r]| dd  }|d d }t        ||«      D ��cg c]
  \  }}||z
  ‘Œ }}}|d   }t        |D �	cg c]  }	t        ||	z
  «      |k  ‘Œ c}	«      }
|
r|S y y y c c}}w c c}	w )Nr   éÿÿÿÿr   )r,   Úzipr   Úabs)Ú
bar_startsÚbar_endsÚtolÚsides1Úsides2Ús2Ús1ÚgapsÚgap0ÚgapÚuniforms              r   Úget_bar_gapr›     sž   € Ü
ˆ:ƒœ#˜h›-Ò'¬C°
«O¸aÒ,?Ø˜A˜B�ˆØ˜#˜2�ˆÜ&)¨&°&Ó&9×:™F˜B ��R“Ð:ˆÑ:Ø�A‰wˆÜ¸Ö=°”s˜4 #™:“¨Ó,Ò=Ó>ˆÙØˆKð ð -@Ð'ùó ;ùâ=s   ¿BÁBc           
      ó"  — t        «       }| D ]E  }|t        t        |d   dz  «      t        |d   dz  «      t        |d   dz  «      |d   ¬«      gz  }ŒG t        «       }|D ]  }| dj                  di |¤Žgz  }Œ t	        |«      dk(  r|d   S |S )	Nr   éÿ   r   r#   r   )rn   Úgro   Úazrgba({r},{g},{b},{a})r_   )r@   ÚdictrJ   rT   r,   )Ú
color_listÚclean_color_listÚcÚplotly_colorsÚrgbas        r   Úconvert_rgba_arrayr¦   "  s¶   € Ü“vÐØò 
ˆØÜ”C˜˜!™˜s™
“O¤s¨1¨Q©4°#©:£¼#¸aÀ¹dÀS¹j»/ÈQÈqÉTÔRð
ñ 	
Ñð
ô “F€MØ ò BˆØÐ8Ð1×8Ñ8Ñ@¸4Ñ@ÐAÑA‰ðBä
ˆ=Ó˜QÒØ˜QÑÐàÐr   c                 ól   — t        «       }| D ]  }|t        |«      gz  }Œ t        |«      dk(  r|d   S |S ©Nr   r   )r@   r<   r,   )Ú
path_arrayÚsymbolsr9   s      r   Úconvert_path_arrayr«   1  sE   € Ü‹f€GØò (ˆØ”L Ó&Ð'Ñ'‰ð(ä
ˆ7ƒ|�qÒØ�q‰zÐàˆr   c                 ó,   — t        | «      dk(  r| d   S | S r¨   )r,   )Úwidth_arrays    r   Úconvert_linewidth_arrayr®   ;  s   € Ü
ˆ;Ó˜1ÒØ˜1‰~ÐàÐr   c                 óz   — | D �cg c]  }t        j                  |«      ‘Œ }}t        |«      dk(  r|d   S |S c c}w r¨   )r-   Úsqrtr,   )Ú
size_arrayrE   Úsizes      r   Úconvert_size_arrayr³   B  s;   € Ø",Ö-˜QŒD�I‰I�a�LÐ-€DÐ-Ü
ˆ4ƒy�A‚~Ø�A‰wˆàˆùò	 .s   …8c                 óÎ   — t        d t        | d   d   «      t        | d   «      t        | d   d   «      t	        | d   j                  «       «      t        | d   d   «      ¬«      }|S )NÚstylesr   ÚpathsÚ	linewidthÚmplobjÚ	edgecolor)Úalphar   ÚmarkerÚ	edgewidthÚ
markersizer¹   )r    r¦   r«   r®   r³   Ú	get_sizes)ÚpropsÚmarkerstyles     r   Úget_markerstyle_from_collectionrÁ   J  sk   € ÜØÜ$ U¨8¡_°[Ñ%AÓBÜ! %¨¡.Ó1Ü)¨%°©/¸+Ñ*FÓGä% e¨H¡o×&?Ñ&?Ó&AÓBÜ$ U¨8¡_°[Ñ%AÓBô€Kð Ðr   c                 óN   — t        | d   d   | d   d   | d   d   | d   d   «      S )z.Find minimum x value from four (x,y) vertices.r   r   r#   r   ©r~   ©Údatas    r   Úget_rect_xminrÆ   W  ó3   € äˆt�A‰w�q‰z˜4 ™7 1™: t¨A¡w¨q¡z°4¸±7¸1±:Ó>Ð>r   c                 óN   — t        | d   d   | d   d   | d   d   | d   d   «      S )z.Find maximum x value from four (x,y) vertices.r   r   r#   r   ©r   rÄ   s    r   Úget_rect_xmaxrÊ   \  rÇ   r   c                 óN   — t        | d   d   | d   d   | d   d   | d   d   «      S )z.Find minimum y value from four (x,y) vertices.r   r   r#   r   rÃ   rÄ   s    r   Úget_rect_yminrÌ   a  rÇ   r   c                 óN   — t        | d   d   | d   d   | d   d   | d   d   «      S )z.Find maximum y value from four (x,y) vertices.r   r   r#   r   rÉ   rÄ   s    r   Úget_rect_ymaxrÎ   f  rÇ   r   c                 ó(  — | j                   |   }| j                  «       }|j                  xs d}t        |t        «      r|dk(  rd}n|dk(  rd}|\  }}|dk(  r|dk(  rd}nd	}|j                  «       sy	|j                  d
   sy	|s|ry	|r|ry|s|syy	)z8Return some spine parameters for the spine, `spine_key`.)Úoutwardr%   Úcenter)Úaxesg      à?Úzero)rÅ   r   rÐ   r   TFr�   )ÚspinesÚget_frame_onÚ	_positionr?   ÚstrÚget_visibleÚ
_edgecolor)ÚaxÚ	spine_keyÚspineÚax_frame_onÚpositionÚposition_typeÚamountÚspine_frame_likes           r   Úget_spine_visiblerâ   k  s±   € à�I‰I�iÑ €EØ—/‘/Ó#€KØ�‰Ò2Ð"2€HÜ�(œCÔ Ø�xÒØ$‰HØ˜ÒØ"ˆHØ$Ñ€M�6Ø˜	Ò! f°¢kØÑà ÐØ×ÑÔØØ×Ñ˜bÒ!ØÙÑ-ØÙ	Ñ)ØÙÑ!1Øàr   c                 ó$   — | D ]  }|d   |v sŒ y y)zCA test to decide whether a path is a bar from a vertical bar chart.r¸   TFr_   )Úbar_containersr¿   Ú	containers      r   Úis_barræ   ˆ  s'   € ð $ò ˆ	Ø�‰?˜iÒ'Ùðð r   c                  óÌ   — | d   t        | d   «      t        | d   «      t        | d   «      t        | d   «      | d   d   | d   d   | d   d   | d   d   | d   d   | d   d	   d
œS )aÚ  Make an intermediate bar dictionary.

    This creates a bar dictionary which aids in the comparison of new bars to
    old bars from other bar chart (patch) collections. This is not the
    dictionary that needs to get passed to plotly as a data dictionary. That
    happens in PlotlyRenderer in that class's draw_bar method. In other
    words, this dictionary describes a SINGLE bar, whereas, plotly will
    require a set of bars to be passed in a data dictionary.

    r¸   rÅ   Ústylerº   r¹   r   r¼   Ú	dasharrayÚzorder)Úbarr   r	   r   r   rº   r¹   r   r¼   ré   rê   )rÆ   rÌ   rÊ   rÎ   )r¿   s    r   Úmake_barrì   ’  s�   € ð �X‰Ü˜E &™MÓ*Ü˜E &™MÓ*Ü˜E &™MÓ*Ü˜E &™MÓ*Ø�w‘ Ñ(Ø˜7‘^ KÑ0Ø˜7‘^ KÑ0Ø˜7‘^ KÑ0Ø˜7‘^ KÑ0Ø˜‘. Ñ*ñð r   c           	      ó¾  — t        «       }|dk(  r| j                  «       }n |dk(  r| j                  «       }n
t        «       S |d   |   d   }|dk(  rÏ	 |d   |   d   }|d   }t        dt	        |«      dz
  «      D �	cg c]  }	t        ||	   ||	dz
     z
  d	«      ‘Œ }
}	t        t        dt	        |
«      dz
  «      D �	cg c]  }	|
|	   |
|	dz
     k(  ‘Œ c}	«      r|d   |d   z
  }n*t        j                  d
j                  |«      «       t        ‚	 ||d<   ||d<   d|d<   �n|dk(  �r	 |d   |   d   d   |d<   |d   |   d   d   |d   |   d   d   z
  |d<   d|d<   |j                  «       j                  }|dk(  r~|dk(  r:t        j                  |d   d   «      t        j                  |d   d   «      g|d<   n{|dk(  rvt        j                  |d   d   «      t        j                  |d   d   «      g|d<   n<t        dd¬«      }t        j                  dj                  |«      «       n
t        «       S |j!                  «       j"                  j$                  }|dk(  rRd|v rNd|d<   	 t'        |d   |«      |d<   |j+                  dd«       |j+                  dd«       t'        |d   |«      |d<   |dk(  rd|d<   |S c c}	w c c}	w # t        t        f$ r |d   |   d   |d<   Y Œ°w xY w# t        t        f$ r t        |d   |   d   ¬«      }Y �Œ´w xY w# t(        $ r Y Œ¥w xY w# |j+                  dd«       |j+                  dd«       t'        |d   |«      |d<   w xY w)zçPrepare axis obj belonging to axes obj.

    positional arguments:
    ax - the mpl axes instance
    index - the index of the axis in `props`
    ax_type - 'x' or 'y' (for now)
    props - an mplexporter poperties dictionary

    r3   rr   rÒ   ÚscaleÚlinearÚ
tickvaluesr   r   é   zF'linear' {0}-axis tick spacing not even, ignoring mpl tick formatting.Útick0ÚdtickNÚtickmodeÚnticksÚlog)rõ   é
   ÚxlimrQ   Úylim)rQ   Útypez3Converted non-base10 {0}-axis log scale to 'linear'ÚDateFormatterÚdaterú   ÚLogFormatterMathtextÚeÚexponentformat)r    Ú	get_xaxisÚ	get_yaxisrQ   r,   Úroundr   ÚwarningsÚwarnrT   Ú	TypeErrorÚ
IndexErrorÚget_transformÚbaser-   Úlog10Úget_major_formatterÚ	__class__Ú__name__Úmpl_dates_to_datestringsÚKeyErrorÚpop)rÚ   ÚindexÚax_typer¿   Ú	axis_dictÚaxisrî   rð   rò   rL   Údticksró   r  Ú	formatters                 r   Ú
prep_ticksr  ¬  sÐ  € ô “€IØ�#‚~Ø�|‰|‹~‰Ø	�CŠØ�|‰|‹~‰ä‹vˆà�&‰M˜%Ñ  Ñ)€EØ�Òð	)Ø˜v™ uÑ-¨lÑ;ˆJØ˜q‘MˆEô ˜q¤# j£/°AÑ"5Ó6öàô �j ‘m j°°Q±Ñ&7Ñ7¸Õ<ðˆFð ô ¼¸aÄÀVÃÈqÁÓ8QÖR°1�F˜1‘I ¨¨A©¡Ó.ÒRÔSØ" 1™¨
°1©Ñ5‘ä—‘ð4ß4:±F¸7³Oôô  �ð ð "'ˆI�gÑØ!&ˆI�gÑØ$(ˆI�jÓ!Ø	�%‹ð	DØ!& v¡¨uÑ!5°lÑ!CÀAÑ!FˆI�gÑà�f‘˜eÑ$ \Ñ2°1Ñ5Ø˜‘- Ñ& |Ñ4°QÑ7ñ8ð �gÑð %)ˆI�jÑ!ð ×!Ñ!Ó#×(Ñ(ˆØ�2Š:Ø˜#Š~ä—J‘J˜u V™}¨QÑ/Ó0Ü—J‘J˜u V™}¨QÑ/Ó0ð&�	˜'Ò"ð ˜C’ä—J‘J˜u V™}¨QÑ/Ó0Ü—J‘J˜u V™}¨QÑ/Ó0ð&�	˜'Ò"ô
  4¨hÔ7ˆIÜ�M‰MØH×OÑOÐPWÓXõô ‹vˆà×(Ñ(Ó*×4Ñ4×=Ñ=€IØ�#‚~˜/¨YÑ6Ø"ˆ	�&Ñð	TÜ!9¸)ÀGÑ:LÈiÓ!XˆI�gÑð �M‰M˜' 4Ô(Ø�M‰M˜* dÔ+Ü!9¸%À¹-ÈÓ!SˆI�gÑàÐ*Ò*Ø&)ˆ	Ð"Ñ#ØÐùò}ùò Søô œIÐ&ò 	AØ"'¨¡-°Ñ"6°xÑ"@ˆI�hÓð	Aûô œIÐ&ò 	DÜ E¨&¡M°%Ñ$8¸Ñ$BÔC‹Ið	Dûô6 ò 	Ùð	ûð �M‰M˜' 4Ô(Ø�M‰M˜* dÔ+Ü!9¸%À¹-ÈÓ!SˆI�gÒúsf   Á*K Á<J=Â!K Â<KÃ=K Ä'6K* É)L Ê=
K ËK'Ë&K'Ë*$LÌLÌ	L!ÌL$ Ì L!Ì!L$ Ì$8Mc                 óê  — t        |d   d   d   t        |d   «      |d   d   d   d   t        |d   |«      |d   d   d   t        |d   d   d	   ¬
«      ¬«      }|j                  t	        | dd|«      «       t        |d   d   d   t        |d   «      |d   d   d   d   t        |d   |«      |d   d   d   t        |d   d   d	   ¬
«      ¬«      }|j                  t	        | dd|«      «       ||fS )NrÒ   r   rî   rø   ÚgridÚgridOnr|   rÞ   Úfontsize)r²   )rú   rQ   ÚshowgridÚdomainÚsideÚtickfontr3   r   rù   rr   )r    r@   rd   Úupdater  ri   )rÚ   r¿   Úx_boundsÚy_boundsÚxaxisÚyaxiss         r   Úprep_xy_axisr$    s"  € ÜØ�6‰]˜1Ñ˜gÑ&Ü�5˜‘=Ó!Ø�v‘˜qÑ! &Ñ)¨(Ñ3Ü  h¡°Ó:Ø�6‰]˜1Ñ˜jÑ)Ü˜5 ™=¨Ñ+¨JÑ7Ô8ô€Eð 
‡L�L”˜B  3¨Ó.Ô/ÜØ�6‰]˜1Ñ˜gÑ&Ü�5˜‘=Ó!Ø�v‘˜qÑ! &Ñ)¨(Ñ3Ü  h¡°Ó:Ø�6‰]˜1Ñ˜jÑ)Ü˜5 ™=¨Ñ+¨JÑ7Ô8ô€Eð 
‡L�L”˜B  3¨Ó.Ô/Ø�%ˆ<Ðr   c                 óÔ  — | }|dk(  rW	 t         j                  j                  | D �cg c]  }|dz  dz  dz  ‘Œ c}«      } t         j                  j                  | «      } n 	 t         j                  j                  | «      } | D �cg c]B  }dj	                  |j                  «       j                  d«      d   j                  d«      «      ‘ŒD }}|S c c}w #  |cY S xY w#  |cY S xY wc c}w )zÔConvert matplotlib dates to iso-formatted-like time strings.

    Plotly's accepted format: "YYYY-MM-DD HH:MM:SS" (e.g., 2001-01-01 00:00:00)

    Info on mpl dates: http://matplotlib.org/api/dates_api.html

    ÚTimeSeries_DateFormatteré   é<   ú ú+r   ÚT)Ú
matplotlibÚdatesÚ	epoch2numÚnum2dater0   Ú	isoformatr+   )r-  Úmpl_formatterÚ_datesrü   Útime_stingss        r   r  r    së   € ð €Fð Ð2Ò2ð	Ü×$Ñ$×.Ñ.ÐPUÖ/VÈ°°r±	¸B±ÀÓ0CÒ/VÓWˆEÜ×$Ñ$×-Ñ-¨eÓ4‰Eð	Ü×$Ñ$×-Ñ-¨eÓ4ˆEð
 INöØ@Dˆ�‰�—‘Ó!×'Ñ'¨Ó,¨QÑ/×5Ñ5°cÓ:Õ;ð€Kð ð Ðùò# 0Wøð	ØŠMûð	ØŠMüòs.   ‰C ¦C¸&C Á C ÂAC%ÃC ÃCÃC"r$   Údashr>   r(   )z10,0z6,6z2,2z4,4,2,4Únonez7.4,3.2ÚoÚ*Ú8r
   ÚpÚ1rE   r*  ú^ú|)
)
ÚMÚCr>  r>  r>  r>  r>  r>  r>  ÚZ)r=  ÚLr@  r@  r@  r@  r@  r@  r@  r@  r?  )	r=  r@  r@  r@  r@  r@  r@  r@  r?  )r=  r@  r@  r@  r@  r@  r?  )r=  r@  r@  r@  r@  r?  )r=  r@  r=  r@  r=  r@  )r=  r@  r@  r@  r?  )r=  r@  r=  r@  )r=  r@  r@  r?  )r=  r@  ztriangle-downztriangle-upztriangle-leftztriangle-rightÚsquareÚcrossr3   ÚstarÚdiamond)r6  r   r;  ú<ú>rE   r*  r3   r7  ÚDÚdÚmiddleÚbottomÚtop)rÑ   ÚbaselinerK  )g»½×Ùß|Û=)&Ú__doc__r-   r  Úmatplotlib.datesr,  r   r    r5   r<   rA   rR   rY   r]   rd   ri   rx   r†   r‹   r›   r¦   r«   r®   r³   rÁ   rÆ   rÊ   rÌ   rÎ   râ   ræ   rì   r  r$  r  r*   r8   rB   r[   r_   r   r   ú<module>rO     s$  ðñó ã Û òò6òò<ò
òQò"&ò(ò ò>ò>(ò**ò2óòòòòò
ò?ò
?ò
?ò
?ò
ò:òò4Vòrò,ðH ØØØØØñ€ð 9<Ø=@Ø36Ø),Ø$'Ø$'Ø"ØØØñ€ð 
Ø	Ø	Ø	Ø	Ø	Ø	Ø	Ø	Ø	Ø	ñ€
ð ¨(¸5Ñ	A�r   