*L iHddlZhdZejeddhZhdZej ddZej dd Zej d d Z d Z dd Z dZ ddZ ddZdZdZdZ ddZdZ ddZdZddZddZdZy)N>geomappolarscenemapboxternaryxydomain>rrrr SubplotXYxaxisyaxis SubplotDomainxy SubplotRef subplot_type layout_keys trace_kwargscLtDcic]}|d}}d|d<d|d<|Scc}w)Nrr r)_single_subplot_types)rmax_subplot_idss V/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/plotly/_subplots.py_get_initial_max_subplot_idsr#s9;PQ<|QQOQ OG OG Rs !c |ddlm}d|v}|jd| } |jd| } |r#tdj t |t |tr|dkr.tdj t|t|t trdkr.tdj tt|d k(rd }d }n8|d k(rd }d }n.td j t|t|d}| 2t|Dcgc]}tDcgc]}ic}} }}nt | t tfrH| rFtd| Dr4t| |k(r&tfd| Drtd| Ds0tdj |t| t| | D]$}|D]}|s|jddsd|d<&tddd d dddd}|d| |d}| D]C}|D]<}| |xs|d}|s|ddk7s|ds tdj |dE| | durg} nVt | t tfrtd| Ds.td j t| t| | r=| D]}|s|jddsd|d<td!ddd"dd"#}|d$| |gd%} d&}!|| vr2|}"t|!j d'| t|"t|"(|| vr2|}"t|!j d)| t|"t|"(d*}#| |rd+z }nd,z }|#|d-d.d/| |d0|z }nd1|z }|#||d2d3d3| d4g|zz}|rd5}$n|rd6}$nd7}$| |$|d z zz z gz}%nt | t tfrLt| k(r>t!t#| }&g}%| D]"}'|%j%|$|d z zz |'|&z z$n/td8j t| t| 9| d7||d z zz |z g|z}(nt | t tfrgt| |k(rYt!t#| }&g}(| D]"})|(j%d7||d z zz |)|&z z$|dkrF|sDt t'|(}(n/td:j |t| t| ;| rDt | t tfs.tdzd z }4||d?zd z }5|4k\r t/d@|5|k\r t/dA|-||d|dBz}6|-||4d|%|4z|dCz }7|6|7g}8|dkDr)|-||d |dDz}9|-|5|d |(|5z|dEz }:n+|-|5|d |dDz}9|-||d |(d |z z|dEz }:|9dkr|9dFkDrd}9n t/dG|9d7kDr|9dHkrd7}9n t/dG|:dkr|:dFkDrd}:n t/dI|:d7kDr|:dHkrd7}:n t/dI|9|:g};|1j%|8|1j%|;|8|;g|/||<|d}<|d}=t1|*|<|=|8|;|2}>|>|0||<yt3|*|0| dJ||dt3|*|0| dK||dt5dL| D}?|?rt3|*|0| dK||dM| r"tt| Dcgc]}dc}nd}@| r:t-| D]+\}A}|dNdd z }|dNd d z }d|cxkr|kst/dOt/dOd|cxkrkst/dPt/dP|-||d|dB|%|zz}6|dQd"k(r|-||d|%|z}7n|6|dQ|%|zz}7|6|7g}8|-||d |dD|(d |z zz}9|dRd"k(r|-||d |(d |z z}:n|9|dR|(d |z zz}:|9|:g};|1j%|8|1j%|;|d}|>@A<.t7| |0| @|,}Bt9||1}C|C|*dS<| rg}D|dkDr-tD]}|/d |}E|EsDj;E n,tD]}|/d|}E|EsDj;E t9| D}F|*dSxxt|Fz cc<|rRg}Dt|D]}|/|d }E|EsDj;E t9|DdTU}F|*dSxxt|Fz cc<|r,d|$fdVg}Dt9|g|DdWdXY}F|*dSxxt|Fz cc<|r*dVdVg}Dt9|g|DdZd[Y}F|*dSxxt|Fz cc<|r t=B||j?}|jA|*|0|jBd\<B|jBd]<|Scc}wcc}}wcc}wcc}}wcc}.wcc}.wcc}wcc}}wcc}w)^a+ Return an instance of plotly.graph_objs.Figure with predefined subplots configured in 'layout'. Parameters ---------- rows: int (default 1) Number of rows in the subplot grid. Must be greater than zero. cols: int (default 1) Number of columns in the subplot grid. Must be greater than zero. shared_xaxes: boolean or str (default False) Assign shared (linked) x-axes for 2D cartesian subplots - True or 'columns': Share axes among subplots in the same column - 'rows': Share axes among subplots in the same row - 'all': Share axes across all subplots in the grid. shared_yaxes: boolean or str (default False) Assign shared (linked) y-axes for 2D cartesian subplots - 'columns': Share axes among subplots in the same column - True or 'rows': Share axes among subplots in the same row - 'all': Share axes across all subplots in the grid. start_cell: 'bottom-left' or 'top-left' (default 'top-left') Choose the starting cell in the subplot grid used to set the domains_grid of the subplots. - 'top-left': Subplots are numbered with (1, 1) in the top left corner - 'bottom-left': Subplots are numbererd with (1, 1) in the bottom left corner print_grid: boolean (default True): If True, prints a string representation of the plot grid. Grid may also be printed using the `Figure.print_grid()` method on the resulting figure. horizontal_spacing: float (default 0.2 / cols) Space between subplot columns in normalized plot coordinates. Must be a float between 0 and 1. Applies to all columns (use 'specs' subplot-dependents spacing) vertical_spacing: float (default 0.3 / rows) Space between subplot rows in normalized plot coordinates. Must be a float between 0 and 1. Applies to all rows (use 'specs' subplot-dependents spacing) subplot_titles: list of str or None (default None) Title of each subplot as a list in row-major ordering. Empty strings ("") can be included in the list if no subplot title is desired in that space so that the titles are properly indexed. specs: list of lists of dict or None (default None) Per subplot specifications of subplot type, row/column spanning, and spacing. ex1: specs=[[{}, {}], [{'colspan': 2}, None]] ex2: specs=[[{'rowspan': 2}, {}], [None, {}]] - Indices of the outer list correspond to subplot grid rows starting from the top, if start_cell='top-left', or bottom, if start_cell='bottom-left'. The number of rows in 'specs' must be equal to 'rows'. - Indices of the inner lists correspond to subplot grid columns starting from the left. The number of columns in 'specs' must be equal to 'cols'. - Each item in the 'specs' list corresponds to one subplot in a subplot grid. (N.B. The subplot grid has exactly 'rows' times 'cols' cells.) - Use None for a blank a subplot cell (or to move past a col/row span). - Note that specs[0][0] has the specs of the 'start_cell' subplot. - Each item in 'specs' is a dictionary. The available keys are: * type (string, default 'xy'): Subplot type. One of - 'xy': 2D Cartesian subplot type for scatter, bar, etc. - 'scene': 3D Cartesian subplot for scatter3d, cone, etc. - 'polar': Polar subplot for scatterpolar, barpolar, etc. - 'ternary': Ternary subplot for scatterternary - 'map': Map subplot for scattermap, choroplethmap and densitymap - 'mapbox': Mapbox subplot for scattermapbox, choroplethmapbox and densitymapbox - 'domain': Subplot type for traces that are individually positioned. pie, parcoords, parcats, etc. - trace type: A trace type which will be used to determine the appropriate subplot type for that trace * secondary_y (bool, default False): If True, create a secondary y-axis positioned on the right side of the subplot. Only valid if type='xy'. * colspan (int, default 1): number of subplot columns for this subplot to span. * rowspan (int, default 1): number of subplot rows for this subplot to span. * l (float, default 0.0): padding left of cell * r (float, default 0.0): padding right of cell * t (float, default 0.0): padding right of cell * b (float, default 0.0): padding bottom of cell - Note: Use 'horizontal_spacing' and 'vertical_spacing' to adjust the spacing in between the subplots. insets: list of dict or None (default None): Inset specifications. Insets are subplots that overlay grid subplots - Each item in 'insets' is a dictionary. The available keys are: * cell (tuple, default=(1,1)): (row, col) index of the subplot cell to overlay inset axes onto. * type (string, default 'xy'): Subplot type * l (float, default=0.0): padding left of inset in fraction of cell width * w (float or 'to_end', default='to_end') inset width in fraction of cell width ('to_end': to cell right edge) * b (float, default=0.0): padding bottom of inset in fraction of cell height * h (float or 'to_end', default='to_end') inset height in fraction of cell height ('to_end': to cell top edge) column_widths: list of numbers or None (default None) list of length `cols` of the relative widths of each column of subplots. Values are normalized internally and used to distribute overall width of the figure (excluding padding) among the columns. For backward compatibility, may also be specified using the `column_width` keyword argument. row_heights: list of numbers or None (default None) list of length `rows` of the relative heights of each row of subplots. If start_cell='top-left' then row heights are applied top to bottom. Otherwise, if start_cell='bottom-left' then row heights are applied bottom to top. For backward compatibility, may also be specified using the `row_width` kwarg. If specified as `row_width`, then the width values are applied from bottom to top regardless of the value of start_cell. This matches the legacy behavior of the `row_width` argument. column_titles: list of str or None (default None) list of length `cols` of titles to place above the top subplot in each column. row_titles: list of str or None (default None) list of length `rows` of titles to place on the right side of each row of subplots. If start_cell='top-left' then row titles are applied top to bottom. Otherwise, if start_cell='bottom-left' then row titles are applied bottom to top. x_title: str or None (default None) Title to place below the bottom row of subplots, centered horizontally y_title: str or None (default None) Title to place to the left of the left column of subplots, centered vertically figure: go.Figure or None (default None) If None, a new go.Figure instance will be created and its axes will be populated with those corresponding to the requested subplot geometry and this new figure will be returned. If a go.Figure instance, the axes will be added to the layout of this figure and this figure will be returned. If the figure already contains axes, they will be overwritten. Examples -------- Example 1: >>> # Stack two subplots vertically, and add a scatter trace to each >>> from plotly.subplots import make_subplots >>> import plotly.graph_objects as go >>> fig = make_subplots(rows=2) This is the format of your plot grid: [ (1,1) xaxis1,yaxis1 ] [ (2,1) xaxis2,yaxis2 ] >>> fig.add_scatter(y=[2, 1, 3], row=1, col=1) # doctest: +ELLIPSIS Figure(...) >>> fig.add_scatter(y=[1, 3, 2], row=2, col=1) # doctest: +ELLIPSIS Figure(...) or see Figure.append_trace Example 2: >>> # Stack a scatter plot >>> fig = make_subplots(rows=2, shared_xaxes=True) This is the format of your plot grid: [ (1,1) xaxis1,yaxis1 ] [ (2,1) xaxis2,yaxis2 ] >>> fig.add_scatter(y=[2, 1, 3], row=1, col=1) # doctest: +ELLIPSIS Figure(...) >>> fig.add_scatter(y=[1, 3, 2], row=2, col=1) # doctest: +ELLIPSIS Figure(...) Example 3: >>> # irregular subplot layout (more examples below under 'specs') >>> fig = make_subplots(rows=2, cols=2, ... specs=[[{}, {}], ... [{'colspan': 2}, None]]) This is the format of your plot grid: [ (1,1) xaxis1,yaxis1 ] [ (1,2) xaxis2,yaxis2 ] [ (2,1) xaxis3,yaxis3 - ] >>> fig.add_trace(go.Scatter(x=[1,2,3], y=[2,1,2]), row=1, col=1) # doctest: +ELLIPSIS Figure(...) >>> fig.add_trace(go.Scatter(x=[1,2,3], y=[2,1,2]), row=1, col=2) # doctest: +ELLIPSIS Figure(...) >>> fig.add_trace(go.Scatter(x=[1,2,3], y=[2,1,2]), row=2, col=1) # doctest: +ELLIPSIS Figure(...) Example 4: >>> # insets >>> fig = make_subplots(insets=[{'cell': (1,1), 'l': 0.7, 'b': 0.3}]) This is the format of your plot grid: [ (1,1) xaxis1,yaxis1 ] With insets: [ xaxis2,yaxis2 ] over [ (1,1) xaxis1,yaxis1 ] >>> fig.add_scatter(x=[1,2,3], y=[2,1,1]) # doctest: +ELLIPSIS Figure(...) >>> fig.add_scatter(x=[1,2,3], y=[2,1,2], xaxis='x2', yaxis='y2') # doctest: +ELLIPSIS Figure(...) Example 5: >>> # include subplot titles >>> fig = make_subplots(rows=2, subplot_titles=('Plot 1','Plot 2')) This is the format of your plot grid: [ (1,1) x1,y1 ] [ (2,1) x2,y2 ] >>> fig.add_scatter(x=[1,2,3], y=[2,1,2], row=1, col=1) # doctest: +ELLIPSIS Figure(...) >>> fig.add_bar(x=[1,2,3], y=[2,1,2], row=2, col=1) # doctest: +ELLIPSIS Figure(...) Example 6: Subplot with mixed subplot types >>> fig = make_subplots(rows=2, cols=2, ... specs=[[{'type': 'xy'}, {'type': 'polar'}], ... [{'type': 'scene'}, {'type': 'ternary'}]]) >>> fig.add_traces( ... [go.Scatter(y=[2, 3, 1]), ... go.Scatterpolar(r=[1, 3, 2], theta=[0, 45, 90]), ... go.Scatter3d(x=[1, 2, 1], y=[2, 3, 1], z=[0, 3, 5]), ... go.Scatterternary(a=[0.1, 0.2, 0.1], ... b=[0.2, 0.3, 0.1], ... c=[0.7, 0.5, 0.8])], ... rows=[1, 1, 2, 2], ... cols=[1, 2, 1, 2]) # doctest: +ELLIPSIS Figure(...) rN row_width column_widthz6make_subplots() got unexpected keyword argument(s): {}zl The 'rows' argument to make_subplots must be an int greater than 0. Received value of type {typ}: {val})typvalzl The 'cols' argument to make_subplots must be an int greater than 0. Received value of type {typ}: {val}z bottom-lefttop-leftz~ The 'start_cell` argument to make_subplots must be one of ['bottom-left', 'top-left'] Received value of type {typ}: {val}cfd}|D]C}t|ttfr|D] }||| *t|ts;|||Ey)Nc d|yt|ts/tdjt |t ||D]>}||vstdjt |t t ||jD]\}}|j||y)Nzy Elements of the '{name}' argument to make_subplots must be dictionaries or None. Received value of type {typ}: {val})namer r!zx Invalid key specified in an element of the '{name}' argument to make_subplots: {k} Valid keys include: {valid_keys})kr' valid_keys) isinstancedict ValueErrorformattypereprlistitems setdefault)itemdefaultsr(vr's r_checksz._check_keys_and_fill.._checkss|dD) +,26!tDztDz,2,  H$$()/"1gDT$x.=Q)/)  !( &11% &)r*r0tupler+)r'argr4r6arg_iarg_iis` r_check_keys_and_fillz+make_subplots.._check_keys_and_fillsT &4 )E%$/#.FFH-.E4(x( )r7c3HK|]}t|ttfywN)r*r0r8.0rows r z make_subplots..s@3 3u .@ "c3:K|]}t|k(ywr>len)r@rAcolss rrBz make_subplots..s2SCD 2sc3@K|]}td|Dyw)c3HK|]}|duxst|tywr>r*r+r@r5s rrBz*make_subplots...s#BAI4At!44BrCN)allr?s rrBz make_subplots..sTsBcBBTsz The 'specs' argument to make_subplots must be a 2D list of dictionaries with dimensions ({rows} x {cols}). Received value of type {typ}: {val})rowsrGr r!is_3drr.r F)r. secondary_ycolspanrowspanlrbtspecsrPz The 'secondary_y' spec property is not supported for subplot of type '{s_typ}' 'secondary_y' is only supported for subplots of type 'xy' )s_typc3<K|]}t|tywr>rJrKs rrBz make_subplots..s1V!*Q2E1Vszo The 'insets' argument to make_subplots must be a list of dictionaries. Received value of type {typ}: {val})r"r"to_end)cellr.rSwrUhinsets)NTFrMcolumnsrLzi The {arg} argument to make_subplots must be one of: {valid_vals} Received value of type {typ}: {val} shared_xaxes)r9 valid_valsr r! shared_yaxesc |dks|dkDrt|d|dkrydt|dz z }||kDrtdj|||||y)Nrr"z! spacing must be between 0 and 1.?z{name} spacing cannot be greater than (1 / ({dimvarname} - 1)) = {max_spacing:f}. The resulting plot would have {dimsize} {dimname} ({dimvarname}={dimsize}).) dimvarnamer'dimname max_spacingdimsize)r,floatr-)rhspacingr'rerfrgs r_check_hv_spacingz(make_subplots.._check_hv_spacing s{ Q;'A+dLM M a< E'A+.. [ OOUv)# +# PVP   !r7g?g? HorizontalrGr_g?g333333?VerticalrMgGz?g\(\?rdz The 'column_widths' argument to make_subplots must be a list of numbers of length {cols}. Received value of type {typ}: {val}rGr r!z The 'row_heights' argument to make_subplots must be a list of numbers of length {rows}. Received value of type {typ}: {val}rMr r!zl The column_titles argument to make_subplots must be a list or tuple Received value of type {typ}: {val}zi The row_titles argument to make_subplots must be a list or tuple Received value of type {typ}: {val}rQrRz8Some 'colspan' value is too large for this subplot grid.z8Some 'rowspan' value is too large for this subplot grid.rSrTrUrVg{GzzaA combination of the 'b' values, heights, and number of subplots too large for this subplot grid.g)\(?zaA combination of the 't' values, heights, and number of subplots too large for this subplot grid.rrc38K|]}|D] }||d yw)NrP)r@spec_rowspecs rrBz make_subplots..s8     ]sTr[zHSome 'cell' row value is out of range. Note: the starting cell is (1, 1)zHSome 'cell' col value is out of range. Note: the starting cell is (1, 1)r\r] annotationsright) title_edge)rr"bottom)rwoffsetleft( _grid_ref _grid_str)"plotly.graph_objs graph_objspop TypeErrorr-r0r*intr,r.r/ranger8rLrFr+risumappendreversedLayoutr enumerate Exception _init_subplot_configure_shared_axesany_build_grid_str _build_subplot_title_annotationsextendprintFigure update_layout__dict__)GrMrGr`rb start_cell print_gridhorizontal_spacingvertical_spacingsubplot_titles column_widths row_heightsrWr^ column_titles row_titlesx_titley_titlefigurekwargsgouse_legacy_row_heights_ordercol_dirrow_dirr<rTcrArt spec_defaultshas_secondary_yinsetinset_defaultsvalid_shared_valsshared_err_msgr!rk max_widthwidthscum_sumr\heightsr]layoutcol_seqrow_seqgrid_ domains_gridgrid_reflist_of_domainsrrs c_spanned r_spannedx_sx_ex_domainy_sy_ey_domainrrP subplot_refsany_secondary_y insets_refi_insetgrid_strplot_title_annotations domains_list domain_paircolumn_title_annotationssG ` r make_subplotsr*sV #$/ **[+6KJJ~}=M  D K KV     dC DAI ++16d4jd4j6+Q   dC DAI ++16d4jd4j6+Q  ]" z ! +,26$$z*:,2,   ")J }49$K@qeDk*"*@@54-(  @%@ @ J$  2E2 2 TeT T +,26$u+4;,2,   ' 'D$/&V  '' uacSCSVM%7O  D"1"HT-5HV ,m1D  FfF   ~56D%=)c1Vv1V.V ++16d6lV 6+U   (E7D1 'f  (dcX  Xv~>F+N,,  ! !",II "   ,,  ! !",II "   &! !$t !$t d. fiP  %"Tz "Tz d,j&&It+   1TAX>>$FG$N MD%= 1c-6HD6PM*+ YA MM9'9TAX'FF1w;W X Y +,26tM2]8K,2,   *dQh774?@4G K$ /C 4D4LK() RA NNC"2dQh"??AKP Q R Q;;8G,-G +,26tK0d;6G,2,   Z e}E ++16'T--@,2,  *Z$? ++16$$z*:,2,  YY[F Dk)G)$GDk)G)$G    VBQZ1'9#99WRa[!A(8$88   D :?tEA5;/aT/ELE6;4[AuT{+!+AHAO24O!'U* 8 *T *GAt|DO+a/IDO+a/ID ND N q'!*Q-$s)+Cq')$Q'&*;;d3iGCSzH{1gajmd3i/9oa(+gi.@@49L9oa(+d3i71gajmgb1fo5S ASy;C#NSy:C#N Sy;C#N Sy:C#N SzH  " "8 ,  " "8 ,"*H!5LOA  >CSzX%1gajmgb1fo5E#Ja88SzH  " "8 ,  " "8 , =L( eXxL#/Jw S) /Zuh GLH>3F= Q;4[ 5*2.q1  '' 4 5 4[ 5*1oa0  '' 4 5 $D <$   }'?!@@ t 1A&q/"-K##K0 1 $D  $   }'?!@@I/ $D I|$   }'?!@@' $D I|r$   }'?!@@ h~  $,FOOK #+FOOK MY+@h  0E,A^8sf0n n n< n/n 4n n) n$ $n)9n3 n. n3! n9nn$n).n3ct|}t|d}ddgj|dkrt|dz dd} n t|} |rt|dz dd} d} n t|} d} fd} |dk(s dk(rV|durR| D]L} d}dk(}| D]>}||| s | t||| k\r!||| | }||| }| ||||}@Ny|d k(s dk(rV|durR| D]L}d}dk(}| D]>} ||| s | t||| k\r!||| | }||| }| ||||}@Ny|d k(rd}t| D]o\}}| D]e} ||| s | t||| k\r!||| | }||| }dk(r|r| |dz kn| dkD}n|dkDr|dkDn||dz k}| ||||}gqyy) Nrrrr"r$c||S dk(r|d}n|d}|jdk(rN|dk(rI|#|j }|jdd}|S|j }|}||_|rd|_|S) NrrQrRr r"axisrnF)rrreplacematchesshowticklabels) first_axis_id subplot_refrt remove_labelspanfirst_axis_name axis_name axis_to_matchrlayout_key_indx_or_ys rupdate_axis_matchesz3_configure_shared_axes..update_axis_matchess   S= ?D ?D  # #t + $"-"9"9."I / 7 7 C  (33NC &y 1 (5 %38M0r7r_TrMrL)rFindexrr)rrrWrsharedrrPrMrG rows_iter cols_iter axis_indexrrrok_to_remove_labelrTrrtrirs` ` @rrr}s x=D x{ D3Z%%f-N{$(B+ $K $(B+  $K  ,v}4 A M!'3  {1~Xa[^!44&qk!nZ8 Qx{ 3!;6H!    6 fm$ A M!'3  {1~Xa[^!44&qk!nZ8 Qx{ 3!;6H!    5 y) EB {1~Xa[^!44&qk!nZ8 Qx{S=9DTAX!a%&3:Q;aAqL& 3!;6H!    r7c B| t}|ddz}|ddz}dj|dkDr|nd}dj|dkDr|nd}||} } dj|dkDr|nd} d j|dkDr|nd} || d } || d }| || <||| <td | | f||d  g}|r]|dz }d j|dkDr|nd}dj|}|jtd | |f||d  | |dd}|||<||d<||d<t |S)Nr r"rzx{cnt}rn)cntzy{cnt}z xaxis{cnt}z yaxis{cnt})r anchorr r rrv)r overlayingside)rr-rrr8)rrPrrrx_cnty_cntx_labely_labelx_anchory_anchor xaxis_name yaxis_namex_axisy_axisrsecondary_yaxis_namesecondary_y_labelsecondary_y_axiss r_init_subplot_xyrs68 G $q (E G $q (Eoo519%"o=Goo519%"o=G!'hH$$%!)$DJ$$%!)$DJ H 5F H 5FF:F: #Z0#*W= L  +22 ur2R$OOO6  !')=>'.9JK  '/gwW'7#$ %OG$OG  r7c| t}||dz}dj||dkDr|nd}t||d}|||<|tvrdn|}t ||f||i} |||<| fS) Nr"z{subplot_type}{cnt}rn)rrr)r subplotr)rr-r+_subplot_prop_named_subplotr) rrrrrrlabelr trace_keyrs r_init_subplot_singlers68 , '! +C ! ( (!cAgs2 ) E hX6 7EF5M"%@@ l!xyRWFXK %(OL! >r7c Rtdddt|t|di}|fS)Nr rrrr)rr8)rrrs r_init_subplot_domainr/s1eHoE(O LMK >r7cddlm}|jdd}|}||jvrI|j d|igd}d|vryd|vrd|vry d |vry d |vry d |vrt D] } ||_|cSy#t$rYwxYw) Nr)ValidatorCacherndatar.r r rr rrr)plotly.validator_cacher get_validatorclass_strs_mapvalidate_coercerrr,) trace_typer DataValidatortrace_validatortracerVs r_subplot_type_for_trace_typer:s5"00VA?c|}|j}|tvr|St|}|#tdj t ||S)NUnsupported subplot type: {})lower_subplot_typesrr,r-r/)rorig_subplot_types r_validate_coerce_subplot_typerVs[$%%'L~%0 =L7>>tDU?VWXXr7crt|}| t}td|dtd|dg}td|dtd|dg}|dk(rt |||||}|S|t vrt |||||}|S|dk(rt||}|Stdjt|)NrOrrdr"r r r ) rrmaxminrrrrr,r-r/)rrrPrrrrs rrrhs1>L68 C!%s3 '<=HC!%s3 '<=Ht' K8_   . .+ L(Ho    !+Hh?  7>>tL?QRSSr7c,dj||}|S)Nz {x_or_y}{cnt})rr)r-)rrTrrrs r_get_cartesian_labelrs  " "&c " :E Lr7c |ddd}|ddd}g}g}|dk(rKd}d} d} |D]} |jt| dz !|D]} |j| d|} d}n |dk(rKd}d} d} |D]} |jt| dz !|D]} |j| d| } d}n|dk(rJd }d } d } |D]} |j| d|D]} |jt| dz !d} |}nk|d k(rKd }d} d } |D]} |j| d|D]} |jt| dz !d} | }ntd j|g}t t |D]d}||r|t |k\r||d||d||dt d| | d }|dk7r||d<| dk7r| |d<|dk7r||d<|j|f|S)Nr"toprcenterrxg@rvZr{middleiz Invalid annotation edge '{edge}')edgepaperF)size) rxrefryreftext showarrowfontxanchoryanchorxshiftyshift textangle)rrr,r-rrFr+)rrrwrzx_domy_domsubtitle_pos_xsubtitle_pos_y text_angler#r$ x_domains y_domainsr&r% plot_titlesrannots rrrs CaC E ADqD !ENNU  8I  ! !#i.3"6 7 8 0I  ! !)A, / 0 x   8I  ! !#i.3"6 7 8 0I  ! !)A, / 0 w   0I  ! !)A, / 0 8I  ! !#i.3"6 7 8 v   0I  ! !)A, / 0 8I  ! !#i.3"6 7 8;BB BSTTKs>*+&e$^1D(D $E*#E*&u-"" "" E{"(h{"(hQ%/k"   u %3&4 r7ct|}t|d}d}d}d} d} d} d} d} d }d }d }d }d }d}t|Dcgc]}t|Dcgc]}dc}}}}d}tt|Dcgc]-\}}t|D]\}}|rt||||/c}}}}t|zt| z}|fd}t|D]\}}t|D]\}}|||}||||dk(r|||z|||<.|ddkDr| ||||z}n |||||z}|ddkDrutd|ddz D]}|||z||||z<|ddkDr!|||| zz| z||||dzdz <nN|||| zz| z||||dzdz <n-d|t|z dz z} |ddkDr || | zz }n|| | zz }|ddkDrt|dD]w}td|dD]c}!|||z}"|dk(r|!|ddz kr | |"ddz}"n| |"ddz}"||ddz k(r|!|ddz kr |"dd|z}"n|"dd|z}"|"|||!z||z<ey|||z|||<|dddD]}||j ||dzz }|r|dz }t|D]x\}#}$|$dddz }|$dddz }|||}dj ||#dj }%|%j dd}%|||%z| zdz|z||||z| zdzz }z|Scc}wcc}}wcc}}}}w)Nrz z[ z ]u⎡ u⎢ u⎣ u ⎤u ⎟u ⎦z -z :z (empty) z&This is the format of your plot grid: rnct|Dchc]}|jD]}|c}}}dj|}|jdd}dj |dz|dz|Scc}}w)N,rrnz({r},{c}) {ref}r")rTrref)sortedrjoinrr-)rTrrr4r(rref_strs r _get_cell_strz&_build_grid_str.._get_cell_strsm<QCQAaQaQR ((;'//&"- ''!a%1q5g'FF RsA* c$d|t|z zS)N rE)scell_lens r_padz_build_grid_str.._padshQ'((r7rRr"rQr:rr$ z With insets: r[r3rz over )rFrrrr6rr)&rWrr^rrrMrGsps_stre_strs_tops_mids_bote_tope_mide_bot colspan_str rowspan_str empty_strrrTr_tmpr8row_refr4r<r=rsrtcell_strccpaddingrrrow_strrrsubplot_labels_strs& rrrs u:D uQx=D B E E E E E E E EKKI8H05T{ ;!t %AR % ;D ;G #,H"5  Aw'0 AsM!Q,- -   e*  e*  ")!'23 8 *1 3GAt1+a.C{71:#!*T)_!&??8DGAY/!34 $d;+>&??8DGAY/!34CM!9A!=> ?Q&%/H%/HI"Y07B#AtI77"-[0A"A7!DOa$77*/'!"+*=*/'!"+*=i1!44!DOa$77*1#2,*>*1#2,*>/6QV QV,77""DN2DGAJc1 323jTrT],BGGDG$t++,&&'/ NGUf a 1$Af a 1$A1+a.C!$*W*=a*@*L*L!M "4!;!;FB!G  $%   1c* +   H ( O[ & ; sM M M=2M Mc |dkr td|dkr td ||dz |dz }|stdj|||r)t |dkr td |dj }n|dj }|D];}||vstd j|j |dj|| |j|y#t$r tdwxYw) Nrz3C8P   | q  $A33 #A33  E>) *0 !-a!=!= *0*  " LLW      s CC/c t |j}t|}t|d}t |t r |dks||kr/t dj|t|t|t |t r |dks||kr/t dj|t|t||j|dz |dz }|sy|rt|dkDr|dj}ny|dj}t|dk(rtd i|djdSt|dk(r|j|dSt|d k(r-t|j|d|j|d St d j|#t$r tdwxYw) NzIn order to reference traces by row and column, you must first use plotly.tools.make_subplots to create the figure with a subplot grid.rr"zt The row argument to get_subplot must be an integer where 1 <= row <= {rows} Received value of type {typ}: {val}rpzt The col argument to get_subplot must be an integer where 1 <= row <= {cols} Received value of type {typ}: {val}ror rr z/ Unexpected subplot type with layout_keys of {}rr)r}AttributeErrorrrFr*rr,r-r.r/rrrrr ) figrArUrPrrMrGrrs r_get_grid_subplotr\s == x=D x{ D c3 37dSj ++16tCyd3i,2,   c3 37dSj ++16tCyd3i,2,  ==q)#'2L  | q &q/55K"1o11  ;1F|A;;HEFF [ Q zz+a.)) [ Q **[^,CJJ{1~4N   228&2E  g   8   s F""F7cd|vr;tddd|jj|jjdiSd|vrkd|vrg|jrd|jddznd}|j rd|j ddznd}td||f|j|j d Sd |vr%td |j fd |j iSd |vr%td |jfd |jiSd |vrTtD]K} |jd }|j|t||jfd |jicSy#t$rYZwxYw) Nr rrrrr rr"r r rrr) rr rrr rrrr_get_prop_validatorrrr,)rrrrV validators r_get_subplot_ref_for_tracer`s5!"%,,..u||~~$NO  E g.27++Wu{{12.7 27++Wu{{12.7 #Z0#(;;E  % +  E  !5;;/  e , A !55i@ ))!,!!"!& 0"+U]]!;    sAE E&%E&)r"r"FFr#FNNNNNNNNNNNNr>)rr)F) collectionsrsetunionr r namedtupler rrrrrrrrrrrrrrrXr\r`rrr7rresM042BCD #K " ";0B C & && C #[ # #A       %P fZz6t?C88&LP>?@YxFR2j9 x*r7