
    e,x                        d dl Z d dlZd dlZd dlmZ ddlmZmZ ddl	m
Z
mZ h dZh dZh d	Zi d
ddgdddgdddgdddgdddgdddgdddgdddgdddgdddgdddgdddgdddgdddgdddgdddgdddgdgdgdgdgdgdgdgdgdgdgd gd!gd"Zh d#Zd$d%d&d'd(d)Z ej        d*          Zd+ Zd, Zd- Zd. Zd/ Zd0 Zd1 Zd2 Zd3 Zd4 Z	 	 	 	 	 	 d<d7Zd=d8Zd>d:Z d; Z!dS )?    N)colors   )isfinite	max_range   )color_intervalsprocess_cmap>   pietablesankeyparcats	parcoords>   geopolarscenemapboxternary>   r   r   r   barxaxisyaxisboxcandlestickcarpetcontourcontourcarpetheatmap	heatmapgl	histogramhistogram2dhistogram2dcontourohlc
pointcloudscatterscattercarpet	scatterglviolinr   r   r   r   r   )conemesh3d	scatter3d
streamtubesurface
choropleth
scattergeobarpolarscatterpolarscatterpolarglscatterternaryscattermapbox>   r   r   r
   arear!   splomr&   r   r#   r.   r   r)   r%   	waterfallr"   r-   r   r/   r   r$   r2   r0   r1   r    opacityheightsymbolmaxzoomminzoom)alphacell_heightmarkermax_zoommin_zoomz\D*(\d+)c                     t                               |           }|r#t          |                    d                    }nd}|S )aj  
    Extract the subplot number from a subplot value string.

    'x3' -> 3
    'polar2' -> 2
    'scene' -> 1
    'y' -> 1

    Note: the absence of a subplot number (e.g. 'y') is treated by plotly as
    a subplot number of 1

    Parameters
    ----------
    subplot_val: str
        Subplot string value (e.g. 'scene4')

    Returns
    -------
    int
       )_subplot_rematchintgroup)subplot_valrC   subplot_numbers      >lib/python3.11/site-packages/holoviews/plotting/plotly/util.py_get_subplot_numberrI   |   sC    * k**E U[[^^,,    c                 .    | dk    rd}n| dk    rd}n| }|S )a]  
    Get the subplot value prefix for a subplot type. For most subplot types
    this is equal to the subplot type string itself. For example, a
    `scatter3d.scene` value of `scene2` is used to associate the scatter3d
    trace with the `layout.scene2` subplot.

    However, the `xaxis`/`yaxis` subplot types are exceptions to this pattern.
    For example, a `scatter.xaxis` value of `x2` is used to associate the
    scatter trace with the `layout.xaxis2` subplot.

    Parameters
    ----------
    subplot_type: str
        Subplot string value (e.g. 'scene4')

    Returns
    -------
    str
    r   xr   y )subplot_typesubplot_val_prefixs     rH   _get_subplot_val_prefixrQ      s8    ( w 		 	  )rJ   c                 "    | t           v rd}n| }|S )a  
    Get the name of the trace property used to associate a trace with a
    particular subplot type.  For most subplot types this is equal to the
    subplot type string. For example, the `scatter3d.scene` property is used
    to associate a `scatter3d` trace with a particular `scene` subplot.

    However, for some subplot types the trace property is not named after the
    subplot type.  For example, the `scatterpolar.subplot` property is used
    to associate a `scatterpolar` trace with a particular `polar` subplot.


    Parameters
    ----------
    subplot_type: str
        Subplot string value (e.g. 'scene4')

    Returns
    -------
    str
    subplot)_subplot_prop_named_subplot)rO   subplot_prop_names     rH   _get_subplot_prop_namerV      s%    * 222%(rJ   c                    |                      di           }|                     dd          D ]}|                    dd          }t                              |g           }|D ]i}t          |          }t	          |          }|                    ||          }t          |          }	|	dk    r|t          |	          z   }
n|}
|
|vri ||
<   jdS )a  
    Make sure a layout subplot property is initialized for every subplot that
    is referenced by a trace in the figure.

    For example, if a figure contains a `scatterpolar` trace with the `subplot`
    property set to `polar3`, this function will make sure the figure's layout
    has a `polar3` property, and will initialize it to an empty dict if it
    does not

    Note: This function mutates the input figure dict

    Parameters
    ----------
    fig: dict
        A plotly figure dict
    layoutdataNtyper#   rA   )
setdefaultget_trace_to_subplotrV   rQ   rI   str)figrX   trace
trace_typesubplot_typesrO   rU   rP   rF   rG   layout_prop_names              rH   _normalize_subplot_idsrd      s    $ ^^Hb))F&& . .YYvy11
)--j"==) 	. 	.L 6| D D!8!F!F))$57IJJK 1==N!!#/#n2E2E#E  #/ v--+-'(	.. .rJ   c                 
   d t           D             }d|d<   d|d<   |                     dg           D ]}|                    dd          }t                              |g           }|D ]^}t          |          }t	          |          }|                    ||          }t          |          }	t          ||         |	          ||<   _|                     di           }
d	D ]}|
                    |g           D ]}|                    d
d          }|dk    r(t          |          }t          |d         |          |d<   |                    dd          }|dk    r(t          |          }t          |d         |          |d<   |S )aj  
    Given an input figure, return a dict containing the max subplot number
    for each subplot type in the figure

    Parameters
    ----------
    fig: dict
        A plotly figure dict

    Returns
    -------
    dict
        A dict from subplot type strings to integers indicating the largest
        subplot number in the figure of that subplot type
    c                     i | ]}|d S )r   rN   ).0rO   s     rH   
<dictcomp>z(_get_max_subplot_ids.<locals>.<dictcomp>
  s*     ; ; ;' $Q ; ; ;rJ   r   r   r   rY   rZ   r#   rX   annotationsshapesimagesxrefrL   paperyrefrM   )_subplot_typesr\   r]   rV   rQ   rI   max)r_   max_subplot_idsr`   ra   rb   rO   rU   rP   rF   rG   rX   layout_propobjrm   xref_numberro   yref_numbers                    rH   _get_max_subplot_idsrw      s    ; ;+9; ; ;O OG OG $$ ? ?YYvy11
)--j"==) 
	? 
	?L 6| D D!8!F!F))$57IJJK 1==N,/-~-? -?OL))
	? WWXr""F: 
V 
V::k2.. 		V 		VC7763''Dw1$77+.w/G+U+U(7763''Dw1$77+.w/G+U+U(		V rJ   c                    |                      dd          D ]}|                     dd          }t                               |g           }|D ]}t          |          }t          |          }|                     ||          }t	          |          }	|	|                     |d          z   }
|
dk    r|t          |
          z   ||<   z|||<   |                     di           }i }|D ]}||         }|dk     rt          |                                          D ]U}|	                    |          r>t	          |          }	|	|z   }|t          |          z   }|
                    |          ||<   V|                    |           |                     dd          }|                     d	d          }t          |                                          D ]}|	                    d          rR||         }|                     d
d          }t	          |          |z   }|dk    rdt          |          z   |d
<   cd|d
<   i|	                    d	          rQ||         }|                     d
d          }t	          |          |z   }|dk    rdt          |          z   |d
<   d|d
<   t          |                                          D ]}|dd         dk    r||         }|                     dd          }|rd|d         dk    rt	          |          |z   }n |d         dk    rt	          |          |z   }no|dk    rt          |          nd}|d         |z   |d<   dD ]}|                     |g           D ]}|rC|                     dd          }|dk    r't	          |          }dt          ||z             z   |d<   |rC|                     dd          }|dk    r't	          |          }dt          ||z             z   |d<   dS )aO  
    Apply offsets to the subplot id numbers in a figure.

    Note: This function mutates the input figure dict

    Note: This function assumes that the normalize_subplot_ids function has
    already been run on the figure, so that all layout subplot properties in
    use are explicitly present in the figure's layout.

    Parameters
    ----------
    fig: dict
        A plotly figure dict
    offsets: dict
        A dict from subplot types to the offset to be applied for each subplot
        type.  This dict matches the form of the dict returned by
        get_max_subplot_ids
    rY   NrZ   r#   r   rA   rX   r   r   anchorrM   rL      axismatches ri   rm   rn   ro   )r\   r]   rV   rQ   rI   r^   r[   listkeys
startswithpopupdate) r_   offsetsr`   ra   rb   rO   rU   rP   rF   rG   offset_subplot_numberrX   new_subplotsoffsetrs   new_subplot_numbernew_layout_propx_offsety_offsetr   ry   anchor_numberr   r{   matches_valmatches_numbersuffixrt   rm   ru   ro   rv   s                                    rH   _offset_subplot_idsr   0  s   ( && > >YYvy11
)--j"==) 	> 	>L 6| D D "9!F!F))$57IJJK0==N #W[[q%A%AA " %q((*S1F-G-GG '(( ,>'((	>$ ^^Hb))FL 
H 
H&A::.. 	H 	HK%%l33 H!4[!A!A%3f%<"".5G1H1H"H06

;0G0G_-	H MM, {{7A&&H{{7A&&HFKKMM** & &!!'** 	&;'EYYx--F/77(BMq  "%M(:(:":h"%h##G,, 	&;'EYYx--F/77(BMq  "%M(:(:":h"%h FKKMM** : :qsv%%+&D((9d33K 
:q>S((%8%E%E%PNN ^s**%8%E%E%PNN0>0B0B^,,,"-a.6"9Y ; D D::k2.. 	D 	DC Dwwvs++7??"5d";";K"%K(,B(C(C"CCK Dwwvs++7??"5d";";K"%K(,B(C(C"CCK	DD DrJ   c                    |                      dg           }|                      di           }fdfdfd}|D ],}|                    dd          }	|	t          v r ||           -|D ]2}
t          D ](}|
                    |          r |||
                    )3|D ]}
|
                    d          r/||
         }|                    d	d
dg          } |          |d	<   F|
                    d          r.||
         }|                    d	d
dg          } |          |d	<   |                    dg           }|                    dd          }|rm|                    di           }|                    dd          }d}t          |||z
  z  z             |d<   |                    |ddddddd|d	           ||d<   |                    dg           D ]t}|                    dd          dk    r|                    dd          z  z   |d<   |                    dd          dk    r|                    dd          z  z   |d<   u|                    dg           D ]}|                    dd          dk    r>|                    d d!          z  z   |d <   |                    d"d#          z  z   |d"<   |                    dd          dk    r>|                    d$d!          z  z   |d$<   |                    d%d#          z  z   |d%<   |                    d&g           D ]}|                    dd          dk    r;|                    dd          z  z   |d<   |                    d'd
          z  |d'<   |                    dd          dk    r;|                    dd          z  z   |d<   |                    d(d
          z  |d(<   dS ))a  
    Scale a figure and translate it to sub-region of the original
    figure canvas.

    Note: If the input figure has a title, this title is converted into an
    annotation and scaled along with the rest of the figure.

    Note: This function mutates the input fig dict

    Note: This function assumes that the normalize_subplot_ids function has
    already been run on the figure, so that all layout subplot properties in
    use are explicitly present in the figure's layout.

    Parameters
    ----------
    fig: dict
        A plotly figure dict
    scale_x: float
        Factor by which to scale the figure in the x-direction. This will
        typically be a value < 1.  E.g. a value of 0.5 will cause the
        resulting figure to be half as wide as the original.
    scale_y: float
        Factor by which to scale the figure in the y-direction. This will
        typically be a value < 1
    translate_x: float
        Factor by which to translate the scaled figure in the x-direction in
        normalized coordinates.
    translate_y: float
        Factor by which to translate the scaled figure in the x-direction in
        normalized coordinates.
    rY   rX   c                 t    t          | d         z  z   d          t          | d         z  z   d          gS Nr   rA   min)rL   scale_xtranslate_xs    rH   scale_translate_xz+_scale_translate.<locals>.scale_translate_x  A    AaD7N[0!44AaD7N[0!446 	6rJ   c                 t    t          | d         z  z   d          t          | d         z  z   d          gS r   r   )rM   scale_ytranslate_ys    rH   scale_translate_yz+_scale_translate.<locals>.scale_translate_y  r   rJ   c                     |                      di           }|                    dddg          }|                    dddg          } |          |d<    |          |d<   d S )NdomainrL   r   rA   rM   )r[   r\   )rt   r   rL   rM   r   r   s       rH   perform_scale_translatez1_scale_translate.<locals>.perform_scale_translate  sp    "--JJsQF##JJsQF##''**s''**srJ   rZ   r#   r   r   r   rA   r   rj   titleN	titlefontsize      Frn   g      ?g)\(?centerbottom)	text	showarrowrm   ro   rL   rM   xanchoryanchorfontrm   rL   ro   rM   rk   x0g      ?x1g      ?y0y1rl   sizexsizey)r[   r\   _domain_trace_typesrp   r   r   roundappend)r_   r   r   r   r   rY   rX   r   r`   ra   proprO   r   x_domainr   y_domainrj   r   r   title_fontsizemin_fontsizert   r   r   s    ````                 @@rH   _scale_translater     s   @ >>&"%%D^^Hb))F6 6 6 6 6 66 6 6 6 6 6+ + + + + +  + +YYvy11
,,,##E***  6 6* 	6 	6L|,, 6''t555	6  : :??7## 	:4LEyyAq622H//99E(OO__W%% 	:4LEyyAq622H//99E(O **]B//KJJw%%E ,JJ{B//	"vr22!,#1L#@G"K#L M M	& 	

 

 
	 
	 
	 !,} zz-,, A A7764  G++wwsC((72[@CH7764  G++wwsC((72[@CH zz(B'' D D7764  G++d++g5CCId++g5CCI7764  G++d++g5CCId++g5CCI zz(B'' 9 97764  G++wwsC((72[@CH777A..8CL7764  G++wwsC((72[@CH777A..8CL9 9rJ   c                    |                      dg           }|                    t          j        |                    dg                                |                      di           }t          ||                    di                      dS )ae  
    Merge a sub-figure into a parent figure

    Note: This function mutates the input fig dict, but it does not mutate
    the subfig dict

    Parameters
    ----------
    fig: dict
        The plotly figure dict into which the sub figure will be merged
    subfig: dict
        The plotly figure dict that will be copied and then merged into `fig`
    rY   rX   N)r[   extendcopydeepcopyr\   merge_layout)r_   subfigrY   rX   s       rH   merge_figurer     sz      >>&"%%DKKfjj4455666 ^^Hb))FHb1122222rJ   c                    |                                 D ]\  }}t          |t                    r|| v rt          | |         |           5t          |t                    rS|                     |d          r=t          | |         d         t                    r| |                             |           |dk    r|dk    r|                     dd          r|t          j        |          | |<   dS )a:  
    Merge layout objects recursively

    Note: This function mutates the input obj dict, but it does not mutate
    the subobj dict

    Parameters
    ----------
    obj: dict
        dict into which the sub-figure dict will be merged
    subobj: dict
        dict that sill be copied and merged into `obj`
    Nr   stylezwhite-bg)	items
isinstancedictr   r~   r\   r   r   r   )rt   subobjr   vals       rH   r   r   6  s     \\^^ + +	cc4   	+TS[[TC((((d## 	+ggdD!!	+T1t,,	+
 IS!!!!W__
!2!2swww7M7M!2 _c**CI#+ +rJ   c                 |  
 t          t          |                     }t          |           dz
  |z  }||z   
|||z   z  }
fd| D             }g }t          t          |                     D ]O}||z  t          |d|                   z   }t	          d|||         z             }	|                    ||	f           P|S )a  
    Compute normalized domain tuples for a list of widths and a subplot
    spacing value

    Parameters
    ----------
    widths: list of float
        List of the desired widths of each subplot. The length of this list
        is also the specification of the number of desired subplots
    spacing: float
        Spacing between subplots in normalized coordinates

    Returns
    -------
    list of tuple of float
    rA   c                     g | ]}|z  S rN   rN   )rg   wtotal_widths     rH   
<listcomp>z,_compute_subplot_domains.<locals>.<listcomp>o  s    999QK999rJ   N)floatsumlenranger   r   )widthsspacing
widths_sumtotal_spacingrelative_spacingrelative_widthsdomainscdomain_startdomain_stopr   s             @rH   _compute_subplot_domainsr   X  s    $ s6{{##J[[1_/M},K*}"<=9999&999OG3v;; 4 4++c/"1"2E.F.FF!\OA,>>??k23333NrJ   2   Fc                 	  &' d | D             }d | d         D             }t          |          }	t          |          }
d}t          |	          D ]R}t          |
          D ]@}| |         |         }|s||                    di                               dd          z  }AS|rdnd	}t          |	          D ]}t          |
          D ]}| |         |         }|s|                    d
i                               d|          }|rt          |||                   ||<   |                    d
i                               d|          }|rt          |||                   ||<   |r,||
dz
  |z  z
  }|t	          |          z  &&fd|D             }nd&|r,||	dz
  |z  z
  }|t	          |          z  ''fd|D             }nd't          ||          }t          ||          }g i d}t          t          | |                    D ]\  }\  }}t          t          ||                    D ]\  }\  }}|rt          j	        |          }t          |           t          |          }|r5||d<   |dk    r*|                    d
i                               dd           |r5||d<   |dk    r*|                    d
i                               dd           t          ||           |rTd|
z  }d|	z  }|
dk    rd|
z  nd}|	dk    rd|	z  nd}||z
  } ||z
  }!t          || |!||z  |dz  z   ||z  |dz  z              n|d
                             d|          'z  }"|d
                             d|          &z  }#|d         |d         z
  |#||         z  z  }|d         |d         z
  |"||         z  z  }t          ||||d         |d                    t          ||           |rddi|d<   |r||d
         d<   n/|rd|d
         d<   n!t	          |          ||	dz
  z  z   |d
         d<   |r||d
         d<   n/|rd|d
         d<   n!t	          |          ||
dz
  z  z   |d
         d<   |r:|d
                                         D ]\  }$}%|$                    d          rd|%d<    |r:|d
                                         D ]\  }$}%|$                    d          rd|%d<    |S )a  
    Construct a figure from a 2D grid of sub-figures

    Parameters
    ----------
    figures_grid: list of list of (dict or None)
        2D list of plotly figure dicts that will be combined in a grid to
        produce the resulting figure.  None values maybe used to leave empty
        grid cells
    row_spacing: float (default 50)
        Vertical spacing between rows in the grid in pixels
    column_spacing: float (default 50)
        Horizontal spacing between columns in the grid in pixels
        coordinates
    share_xaxis: bool (default False)
        Share x-axis between sub-figures in the same column. Also link all x-axes in the
        figure. This will only work if each sub-figure has a single x-axis
    share_yaxis: bool (default False)
        Share y-axis between sub-figures in the same row. Also link all y-axes in the
        figure. This will only work if each subfigure has a single y-axis
    width: int (default None)
        Final figure width. If not specified, width is the sum of the max width of
        the figures in each column
    height: int (default None)
        Final figure width. If not specified, height is the sum of the max height of
        the figures in each row

    Returns
    -------
    dict
        A plotly figure dict
    c                     g | ]}d S rN   rg   _s     rH   r   zfigure_grid.<locals>.<listcomp>  s    ,,,!2,,,rJ   c                     g | ]}d S r   rN   r   s     rH   r   zfigure_grid.<locals>.<listcomp>  s    111AR111rJ   r   Tconfig
responsiveFNi  rX   widthr7   rA   c                     g | ]}|z  S rN   rN   )rg   wicolumn_width_scales     rH   r   zfigure_grid.<locals>.<listcomp>  s    IIIR00IIIrJ   g      ?c                     g | ]}|z  S rN   rN   )rg   hirow_height_scales     rH   r   zfigure_grid.<locals>.<listcomp>  s    CCCr,,CCCrJ   )rY   rX   r   r   g?g       @autosizerL   r|   rM   )r   r   r\   rq   r   r   	enumeratezipr   r   rd   rw   r   r   r   r   r   r   )(figures_gridrow_spacingcolumn_spacingshare_xaxisshare_yaxisr   r7   row_heightscolumn_widthsnrowsncolsr   rr   fig_elementdefaultr   havailable_column_widthavailable_row_heightcolumn_domainsrow_domainsoutput_figurefig_row
row_domainr_   column_domainsubplot_offsetsr   r   pxpysxsy
fig_height	fig_widthr   r   r   r   s(                                         @@rH   figure_gridr  {  sN   R -,|,,,K11a111MEEJ5\\ Q Qu 	Q 	QA&q/!,K +//(B77;;L%PPPJJ		Q !)ddcG5\\ 8 8u 	8 	8A&q/!,K "--11'7CCA <#&q-*:#;#;a "--11(GDDA 8!$QA!7!7A	8  !!&%!)~)E!E3c-6H6HHIIII=III  %k(AA/#k2B2BBCCCC{CCC .m^LLN*;DDK2..M$-c,.L.L$M$M (1 (1  GZ'0Wn1M1M'N'N '	1 '	1#A#] &1mC((&s+++"6}"E"E A/0OG,Avv"--11'4@@@ A/0OG,Avv"--11'4@@@#C999  hG hG).#u++B).#u++B B B$S"b'!)BrE/719RPRU?SSSS!$X!2!28W!E!EHX!XJ #H 1 1'7 C CFX XI,Q/-2BByS`abScGcdG)!}z!}<kZ[nA\]G$Wg}Q/?A   ]C000O'	1R  7#/"6h  
,2h))	 
.2h
++ {eai88 	h)  
+0h((	 
.2h
++ M""^uqy%AA 	h(  %&x06688 	% 	%ID#w'' %!$I %&x06688 	% 	%ID#w'' %!$IrJ   c                    t          |t                    r|nd}t          |t                    r[t          |          dz
  }t          | t                    r4t          |           |k    r!t	          d|t          |           fz            	 t          | |          }n<# t          $ r/}t          j        	                    |           }|||cY d}~S d}~ww xY wt          |t                    rg }t          j        dd|dz             }t          |dz             D ]}	|	dk    r$|                    |d         ||	         f           ,|	|k    r$|                    |d         |d         f           V|                    ||	         ||	dz
           f           |                    ||	         ||	         f           |S t          |t                    rt          ||||f          \  }\  }}t          j        |          S )aH  Converts a cmap spec to a plotly colorscale

    Args:
        cmap: A recognized colormap by name or list of colors
        levels: A list or integer declaring the color-levels
        cmin: The lower bound of the color range
        cmax: The upper bound of the color range

    Returns:
        A valid plotly colorscale
    NrA   zwThe number of colors in the colormap must match the intervals defined in the color_levels, expected %d colors found %d.r   r   )clip)r   rD   r~   r   
ValueErrorr	   	Exceptionr   PLOTLY_SCALESr\   nplinspacer   r   r   make_colorscale)
cmaplevelscmincmaxncolorspalettee
colorscalescaleis
             rH   get_colorscaler   "  s4    #63//9ffTG&$ 5f++/dD!! 	5c$ii7&:&: J !(T34 5 5 5tW--   )--d33
G	 &# 0
Aq&(++vax 	: 	:AAvv!!58WQZ"89999f!!59gbk":;;;;!!58WQqS\":;;;!!58WQZ"89999	FD	!	! 0 /V4,!0 !0 !0$!'***s   B 
C&$C
CC_dimc                 D   i }|                      di                                           D ]t\  }}|dd         dk    ra|                     |d          }|                    |g            |                    dd          }||f}||                             |           u|                                D ]k\  }}	t          |	          dk     r|	d         \  }
}|	dd         D ]<\  }}|
|d	<   d
|v r.d
|v r*d t          |d
         |d
         g          D             |d
<   =ldS )a  
    Configure matching axes for a figure

    Note: This function mutates the input figure

    Parameters
    ----------
    fig: dict
        The figure dictionary to process.
    matching_prop: str
        The name of the axis property that should be used to determine that two axes
        should be matched together.  If the property is missing or None, axes will not
        be matched
    rX   rA   rz   r{   Nr}   r   r   r|   r   c                 4    g | ]}t          |          r|nd S )N)r   )rg   vs     rH   r   z5configure_matching_axes_from_dims.<locals>.<listcomp>x  s4     ( ( (34!.AA$( ( (rJ   )r\   r   r[   replacer   r   r   )r_   matching_propaxis_mapkr$  matching_valaxis_ref	axis_pairr   
axis_pairsmatches_referencelinked_axisr{   s                rH   !configure_matching_axes_from_dimsr/  P  sp   " H"%%++-- 
5 
51QqS6V5555Lb111 yy,,H "1I\")))444 ")) 
 
:z??Q)3A&;!!""~ 	 	GAt/DO$7k#9#9( (8A4=R]^eRfBg8h8h( ( (G$	
 
rJ   c                 x   t          |           }|D ]}| |         }|                    d          r|                     |           5t          |t                    rt          |           Zt          |t           t          f          r1|r/t          |d         t                    r|D ]}t          |           dS )z
    Remove all HoloViews internal properties (those with leading underscores) from the
    input figure.

    Note: This function mutates the input figure

    Parameters
    ----------
    fig: dict
        The figure dictionary to process.
    r   r   N)r~   r   r   r   r    clean_internal_figure_propertiestuple)r_   	fig_propsr   r   els        rH   r1  r1  }  s     S		I 5 5$i??3 	5GGDMMMMT"" 	5,S1111dE]++ 	5 	5
3q648P8P 	5 5 5044445 5rJ   )r   r   FFNN)NNN)r!  )"r   renumpyr  plotlyr   	core.utilr   r   utilr   r	   r   rp   rT   r]   legend_trace_typesSTYLE_ALIASEScompilerB   rI   rQ   rV   rd   rw   r   r   r   r   r   r  r   r/  r1  rN   rJ   rH   <module>r=     se    				           , , , , , , , , 0 0 0 0 0 0 0 0 IHH  @?? =<< )	Wg.) 
Wg.) Wg.	)
 Wg.) Wg.) Wg.) Wg.) Wg.) Wg.) Wg.) Wg.) Wg.) Wg.) Wg.)  Wg.!)" Wg.#)$ Wg.%)* IIIII '' !	 	 	 !k ZQ) ) ) X   : $ (#&&	) ) bj%%  :  :  8%. %. %.P3 3 3loD oD oDdy9 y9 y9x3 3 30+ + +D     H !!!d d d dN++ ++ ++ ++\* * * *Z5 5 5 5 5rJ   