
    -Ph4                     F   d dl Z h dZe                    eddh          Zh dZ e j        dd          Z e j        dd	          Z e j        d
d          Z	d Z
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZd Zd dZ	 d dZd Zd Zd Z	 d dZd Z	 d!dZd Zd"dZd"dZd ZdS )#    N>   geomappolarscenemapboxternaryxydomain>   r   r   r   r   	SubplotXYxaxisyaxisSubplotDomainxy
SubplotRefsubplot_typelayout_keystrace_kwargsc                  <    d t           D             } d| d<   d| d<   | S )Nc                     i | ]}|d S )r    ).0r   s     P/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/plotly/_subplots.py
<dictcomp>z0_get_initial_max_subplot_ids.<locals>.<dictcomp>$   s    QQQ<|QQQQ    r   r   r   )_single_subplot_types)max_subplot_idss    r   _get_initial_max_subplot_idsr!   #   s0    QQ;PQQQO OG OGr      Ftop-leftc           
        BCD ddl m} d|v }|                    d|
          }
|                    d|	          }	|r/t          d                    t          |                              t          | t                    r| dk    r>t          d                    t          |           t          |                               t          t                    rdk    r>t          d                    t                    t                                        |d	k    rd
}d
}nI|dk    rd
}d}n>t          d                    t          |          t          |                              d }|fdt          |           D             }nt          |t
          t          f          rb|r`t          d |D                       rGt          |          | k    r4t          fd|D                       rt          d |D                       s@t          d                    | t          |          t          |                              |D ]$}|D ]}|r|                    dd          rd|d<    %t          ddd
d
dddd          } |d||           d}|D ]R}|D ]M}|
|p|d         }|r=|d         dk    r1|d         r)t          d                    |d                             NS||du rg }nst          |t
          t          f          rt          d  |D                       s>t          d!                    t          |          t          |                              |rD|D ]}|r|                    dd          rd|d<    t          d"ddd#dd#$          } |d%||           g d&}d'}||vrB|} t          |                    d(|t          |           t          |           )                    ||vrB|} t          |                    d*|t          |           t          |           )                    d+ }!|rd,z  nd-z   |!d.d/d0           |d1| z  nd2| z   |!| d3d4d4           |	d5g| z  z  }|rd6}"n|rd7}"nd8}"|	|"d
z
  z  z
  z  gz  Dnt          |	t
          t          f          r[t          |	          k    rHt!          t#          |	                    }#g D|	D ]&}$D                    |"d
z
  z  z
  |$|#z  z             'n?t          d9                    t          |	          t          |	          :                    |
d8| d
z
  z  z
  | z  g| z  Cnt          |
t
          t          f          rt          |
          | k    rlt!          t#          |
                    }#g C|
D ]&}%C                    d8| d
z
  z  z
  |%|#z  z             '|dk     r|st          t'          C                    Cn?t          d;                    | t          |
          t          |
          <                    |rZt          |t
          t          f          s>t          d=                    t          |          t          |                              |rZt          |t
          t          f          s>t          d>                    t          |          t          |                              |                                }&t                    dd|         Bt          |           dd|         }'BCDfd?|'D             }(fd@t          |           D             })fdAt          |           D             }*g }+t+                      },t-          |          D ]\  }-}.t-          |.          D ]\  }/}|	|/|dB         z   d
z
  }0|-|dC         z   d
z
  }1|0k    rt/          dD          |1| k    rt/          dE          |(|-         |/         d         |dF         z   }2|(|-         |0         d         D|0         z   |dG         z
  }3|2|3g}4|dk    rD|(|-         |/         d
         |dH         z   }5|(|1         |/         d
         C|1         z   |dI         z
  }6nF|(|1         |/         d
         |dH         z   }5|(|-         |/         d
         Cd|-z
           z   |dI         z
  }6|5dk     r|5dJk    rd}5nt/          dK          |5d8k    r|5dLk     rd8}5nt/          dK          |6dk     r|6dJk    rd}6nt/          dM          |6d8k    r|6dLk     rd8}6nt/          dM          |5|6g}7|+                    |4           |+                    |7           |4|7g|)|-         |/<   |d         }8|d         }9t1          |&|8|9|4|7|,          }:|:|*|-         |/<   
!t3          |&|*|dN||           t3          |&|*|dO||           |r&dP t          t          |                    D             nd};|rt-          |          D ]\  }<}|dQ         d         d
z
  }-|dQ         d
         d
z
  }/d|-cxk    r| k     sn t/          dR          d|/cxk    rk     sn t/          dS          |(|-         |/         d         |dF         D|/         z  z   }2|dT         d#k    r|(|-         |/         d         D|/         z   }3n|2|dT         D|/         z  z   }3|2|3g}4|(|-         |/         d
         |dH         Cd|-z
           z  z   }5|dU         d#k    r!|(|-         |/         d
         Cd|-z
           z   }6n|5|dU         Cd|-z
           z  z   }6|5|6g}7|+                    |4           |+                    |7           |d         }8t1          |&|8d|4|7|,          }:|:|;|<<   t5          ||*||;|'          }=t7          ||+          }>|>|&dV<   |rg }?|dk    r8t                    D ]'}/|)d         |/         }@|@r|?                    |@           (n7t                    D ]'}/|)d         |/         }@|@r|?                    |@           (t7          ||?          }A|&dVxx         t          |A          z  cc<   |rhg }?t          |           D ]'}-|)|-         d         }@|@r|?                    |@           (t7          ||?dWX          }A|&dVxx         t          |A          z  cc<   |r7d|"fdYg}?t7          |g|?dZd[\          }A|&dVxx         t          |A          z  cc<   |r5dYdYg}?t7          |g|?d]d^\          }A|&dVxx         t          |A          z  cc<   |rt;          |=           ||                                }|                    |&           |*|j         d_<   |=|j         d`<   |S )aa+  
    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(...)
    r   N	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})typvalzl
The 'cols' argument to make_subplots must be an int greater than 0.
    Received value of type {typ}: {val}zbottom-leftr"   r#   z~
The 'start_cell` argument to make_subplots must be one of ['bottom-left', 'top-left']
    Received value of type {typ}: {val}c                       fd}|D ]Q}t          |t          t          f          r|D ]} |||           0t          |t                    r |||           Rd S )Nc                    | d S t          | t                    s?t          d                    t	          |           t          |                               | D ]R}||vrLt          d                    t          |          t          t          |                                        S|                                D ]\  }}|                     ||           d S )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)	
isinstancedict
ValueErrorformattypereprlistitems
setdefault)itemdefaultsr-   vr,   s       r   _checksz<make_subplots.<locals>._check_keys_and_fill.<locals>._checks  s   |dD))  + ,26!tDzztDzz ,2 , ,	    	 	H$$$( )/"1ggDT$x..=Q=Q )/ ) )	   % !(( & &11%%%%& &r   )r/   r5   tupler0   )r,   argr9   r;   arg_iarg_iis   `     r   _check_keys_and_fillz+make_subplots.<locals>._check_keys_and_fill  s    	& 	& 	& 	& 	&4  	) 	)E%$// )# . .FGFH----.E4(( )x(((	) 	)r   c                 B    g | ]}d  t                    D             S )c                     g | ]}i S r   r   r   cs     r   
<listcomp>z,make_subplots.<locals>.<listcomp>.<listcomp>  s    ***"***r   ranger   rcolss     r   rE   z!make_subplots.<locals>.<listcomp>  s.    @@@q**eDkk***@@@r   c              3   N   K   | ] }t          |t          t          f          V  !d S N)r/   r5   r<   r   rows     r   	<genexpr>z make_subplots.<locals>.<genexpr>  s0      @@3
3u..@@@@@@r   c              3   >   K   | ]}t          |          k    V  d S rL   len)r   rN   rJ   s     r   rO   z make_subplots.<locals>.<genexpr>  s.      22SCD 222222r   c              3   H   K   | ]}t          d  |D                       V  dS )c              3   H   K   | ]}|d u pt          |t                    V  d S rL   r/   r0   r   r:   s     r   rO   z*make_subplots.<locals>.<genexpr>.<genexpr>  s5      BBAI4At!4!4BBBBBBr   N)allrM   s     r   rO   z make_subplots.<locals>.<genexpr>  s9      TTsBBcBBBBBTTTTTTr   z
The 'specs' argument to make_subplots must be a 2D list of dictionaries with dimensions ({rows} x {cols}).
    Received value of type {typ}: {val})rowsrJ   r'   r(   is_3dr   r3   r	   F        )r3   secondary_ycolspanrowspanlrI   btspecsr[   z
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_typc              3   @   K   | ]}t          |t                    V  d S rL   rU   rV   s     r   rO   z make_subplots.<locals>.<genexpr>  s,      1V1V!*Q2E2E1V1V1V1V1V1Vr   zo
The 'insets' argument to make_subplots must be a list of dictionaries.
    Received value of type {typ}: {val})r"   r"   to_end)cellr3   r^   wr_   hinsets)NTFrX   columnsrW   zi
The {arg} argument to make_subplots must be one of: {valid_vals}
    Received value of type {typ}: {val}shared_xaxes)r=   
valid_valsr'   r(   shared_yaxesc           	          |dk     s|dk    rt          |d          | dk    rd S dt          | dz
            z  }||k    r't          d                    |||||                     d S )Nr   r"   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_spacingdimsize)r1   floatr2   )rr   spacingr,   ro   rp   rq   s         r   _check_hv_spacingz(make_subplots.<locals>._check_hv_spacing  s    Q;;'A++dddLMMMa<<FE'A+...[  OOUv)# +# PV P P	 	 	 ! r   g?g?
HorizontalrJ   ri   g      ?g333333?VerticalrX    gGz?g\(\?rn   z
The 'column_widths' argument to make_subplots must be a list of numbers of length {cols}.
    Received value of type {typ}: {val}rJ   r'   r(   z
The 'row_heights' argument to make_subplots must be a list of numbers of length {rows}.
    Received value of type {typ}: {val}rX   r'   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}c                 6    g | ]fd D             S )c                     g | ]<}t          d |                   |z  z   t          d                    z  z   f=S rL   )sum)r   rD   heightshorizontal_spacingrI   vertical_spacingwidthss     r   rE   z,make_subplots.<locals>.<listcomp>.<listcomp>  sg     	
 	
 	

  VBQBZ1'9#99WRaR[!!A(8$88	
 	
 	
r   r   )r   rI   col_seqr~   r   r   r   s    @r   rE   z!make_subplots.<locals>.<listcomp>  sc     	 	 	 	
 	
 	
 	
 	
 	
 	
 	

 	
 	
 	
	 	 	r   c                 B    g | ]}d  t                    D             S )c                     g | ]}d S rL   r   )r   _s     r   rE   z,make_subplots.<locals>.<listcomp>.<listcomp>  s    ///aT///r   rF   )r   r   rJ   s     r   rE   z!make_subplots.<locals>.<listcomp>  s.    EEEA//5;;///EEEr   c                 B    g | ]}d  t                    D             S )c                     g | ]}d S rL   r   rC   s     r   rE   z,make_subplots.<locals>.<listcomp>.<listcomp>  s    +++!+++r   rF   rH   s     r   rE   z!make_subplots.<locals>.<listcomp>  s.    AAA++uT{{+++AAAr   r\   r]   z8Some 'colspan' value is too large for this subplot grid.z8Some 'rowspan' value is too large for this subplot grid.r^   rI   r_   r`   g{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.r   r   c                     g | ]}d S rL   r   )r   insets     r   rE   z!make_subplots.<locals>.<listcomp>  s    7775$777r   re   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)rf   rg   annotationsright)
title_edge)r   r"   bottom   )r   offsetleft(   	_grid_ref	_grid_str)!plotly.graph_objs
graph_objspop	TypeErrorr2   r5   r/   intr1   r3   r4   rG   r<   rW   rR   r0   rs   r}   appendreversedLayoutr!   	enumerate	Exception_init_subplot_configure_shared_axes_build_grid_str _build_subplot_title_annotationsextendprintFigureupdate_layout__dict__)ErX   rJ   rj   rl   
start_cell
print_gridr   r   subplot_titlescolumn_widthsrow_heightsra   rh   column_titles
row_titlesx_titley_titlefigurekwargsgouse_legacy_row_heights_ordercol_dirrow_dirr@   rN   specspec_defaultshas_secondary_yr   inset_defaultsvalid_shared_valsshared_err_msgr(   ru   	max_widthcum_sumrf   rg   layoutrow_seqgriddomains_gridgrid_reflist_of_domainsr    rI   spec_rowrD   	c_spanned	r_spannedx_sx_ex_domainy_sy_ey_domainr   r[   subplot_refs
insets_refi_insetgrid_strplot_title_annotationsdomains_listdomain_paircolumn_title_annotationsr   r~   r   sE    `    ``                                                          @@@r   make_subplotsr   *   s    V	 #""""" $/&#8 **[+66KJJ~}==M 
DKKV 
 
 	
 dC   
DAII++16JJDJJ ,2 , ,
 
 	
 dC   
DAII++16JJDJJ ,2 , ,
 
 	
 ]""	z	!	!+ ,26$$$z*:*: ,2 , ,	
 
 	
") ") ")J }@@@@E$KK@@@54-((

 @@%@@@@@
 JJ$2222E22222 TTeTTTTT  + ,26$u++4;; ,2 , ,	
 
 	
  ' ' 	' 	'D  '$// '&V		' uacSCSV  M %777 O   	 	D"1"HT-5H V,,m1D,  F"6l   	  		 ~56D%=))	
.11V1Vv1V1V1V.V.V	
 ++16LLd6ll ,2 , ,
 
 	
  ? 	( 	(E (7D11 ( 'fdcX
 
 
 	Xv~>>> FEE+N ,,,!!",IIII	 "  
 
 	
 ,,,!!",IIII	 "  
 
 	
  & ! 	,!$t!$td.fiPPP %"Tz"Tzd,j&&III t+  			 			1TAX>>$FG$N	MD%=	1	1 
c-6H6HD6P6PM**++ 	Y 	YAMM9'9TAX'FF1w;WXXXX	Y + ,26tM22]8K8K ,2 , ,	
 
 	
 *dQh774?@4G	K$	/	/ 
C4D4D4L4LK(()) 	R 	RANNC"2dQh"??AKPQQQQQ;;;;8G,,--G+ ,26tK00d;6G6G ,2 , ,	
 
 	
  
Ze}EE 
++16''T--@-@ ,2 , ,
 
 	
  
*Z$?? 
++16$$$z*:*: ,2 , ,
 
 	
 YY[[F
 Dkk))G)$GDkk))G)$G	 	 	 	 	 	 	 	 	 	 	D FEEEtEEEL BAAAU4[[AAAHO244O !'' U* U*8 ** T	* T	*GAt| DO+a/IDO+a/I D  Q   D  Q  
 q'!*Q-$s)+Cq')$Q'&*;;d3iGCSzH {{1gajmd3i/9oa(+gi.@@49L9oa(+d3i71gajmgb1fo5S	ASyy ;;CC#N   Syy ::CC#N  
 Syy;;CC#N  
 Syy::CC#N  
 SzH""8,,,""8,,,"*H!5LOA  <L}-K(k8X L *HQKNNiT	*l 68UCwOOO68UCwOOO
 <BK77E#f++$6$67777tJ */'// )	/ )	/NGUfa 1$Afa 1$A MMMMTMMMM8   MMMMTMMMM8   q'!*Q-%*vay"88CSzX%%1gajmfQi/E#J22SzH q'!*Q-%*wrAv">>CSzX%%1gajmgb1fo5E#Ja88SzH""8,,,""8,,, =L(eXx L #/Jw uh
GLLH >  3F=  AQ;;4[[ 5 5*2.q1 5 ''4445
 4[[ 5 5*1oa0 5 ''444 $D<$
 $
  	}'?!@!@@ At 	1 	1A&q/"-K 1##K000 $D$
 $
 $
  	}'?!@!@@ AI/ $DI|$
 $
 $
  	}'?!@!@@ A' $DI|r$
 $
 $
  	}'?!@!@@  h ~
    $,FOK #+FOK Mr   c                     t          |          }t          |d                   }ddg                              |dk     rt          |dz
  dd          }nt          |          } fd}	|dk    s
dk    rd|du r`t          |          D ]N}
d }dk    }|D ]A}||         |
         s||         |
         d         }||         |
         } |	||||          }BOd S |d	k    s
dk    rd|du r`|D ][}d }dk    }t          |          D ]A}
||         |
         s||         |
         d         }||         |
         } |	||||          }B\d S |d
k    rd }t          |          D ]z}
t          |          D ]f\  }}||         |
         s||         |
         d         }||         |
         }dk    r|
dk    }n|dk    r|dk    n||dz
  k     } |	||||          }gyd S d S )Nr   r   r   r"   r)   c                     || S 
dk    r	|d         }n|d         }|j         dk    rQ|dk    rK| $|j        	         }|                    dd          } n%|j        	         }|         }| |_        |rd|_        | S )	Nr   r\   r]   r	   r"   axisrx   F)r   r   replacematchesshowticklabels)first_axis_idsubplot_refr   remove_labelspanfirst_axis_name	axis_nameaxis_to_matchr   layout_key_indx_or_ys           r   update_axis_matchesz3_configure_shared_axes.<locals>.update_axis_matches  s      S==	?DD	?D#t++		$"-"9."I / 7 7 C C'3NC	 &y 1(5% 938M0r   ri   TrX   rW   )rR   indexrG   r   )r   r   ra   r   sharedr   rX   rJ   	rows_iterr   rD   r   ok_to_remove_labelrI   r   r   rir   s   `  `             @r   r   r   z  s   x==Dx{D3Z%%f--N{{$(B++		$KK	      , v}}4t 
	 
	A M!'3  {1~ &qk!nQ/Qx{ 3 3!;6H! !
	 
	 
6		fmm$ 
	 
	A M!'34[[  {1~ &qk!nQ/Qx{ 3 3!;6H! !
	 
	 
5t 	 	A"9--  A{1~ &qk!nQ/Qx{S==)*Q&&3:Q;;aAqL& 3 3!;6H! ! 
	 	r   c           	         |t                      }|d         dz   }|d         dz   }d                    |dk    r|nd          }d                    |dk    r|nd          }||}
}	d                    |dk    r|nd          }d	                    |dk    r|nd          }||	d
}||
d
}|| |<   || |<   t          d||f||d          g}|rn|dz  }d	                    |dk    r|nd          }d                    |          }|                    t          d||f||d                     |
|dd}|| |<   ||d<   ||d<   t	          |          S )Nr   r"   r   zx{cnt}rx   )cntzy{cnt}z
xaxis{cnt}z
yaxis{cnt})r
   anchorr	   r   r   r   )r   
overlayingside)r!   r2   r   r   r<   )r   r[   r   r   r    x_cnty_cntx_labely_labelx_anchory_anchor
xaxis_name
yaxis_namex_axisy_axisr   secondary_yaxis_namesecondary_y_labelsecondary_y_axiss                      r   _init_subplot_xyr     s   688 G$q(EG$q(E oo5199%%"o==Goo5199%%"o==G !'hH $$%!))$DDJ$$%!))$DDJ H55F H55FF:F: 	#Z0#*W==	
 	
 	
L  8
+22		uur2RR$OOO66 	!')=>'.9JKK  	
 	
 	
 '/gwWW'7#$  %OG$OGr   c                     |t                      }||         dz   }d                    ||dk    r|nd          }t          ||d          }|| |<   |t          v rdn|}t	          ||f||i          }	|||<   |	fS )	Nr"   z{subplot_type}{cnt}rx   )r   r   r   )r
   subplotr   )r!   r2   r0   _subplot_prop_named_subplotr   )
r   r   r   r   r    r   labelr   	trace_keyr   s
             r   _init_subplot_singler    s     688 ,
'!
+C!((!cAggss2 )  E hX66777EF5M "%@@@		l  !xyRWFX  K
 %(OL!>r   c           	      j    t          dddt          |           t          |          di          }|fS )Nr
   r   r   r   )r   r<   )r   r   r   s      r   _init_subplot_domainr    sB    eHooE(OO L LM  K >r   c                     ddl m}  |            }| |j        v rc|                    d| ig          d         }d|v rdS d|v rd|v rdS d|v rdS d	|v rd	S d
|v r%t          D ]}	 ||_        |c S # t          $ r Y w xY wd S )Nr   )DataValidatorr3   r
   r   r   r	   r   r   r   )plotly.validatorsr  class_strs_mapvalidate_coercer   r   r1   )
trace_typer  trace_validatortracer`   s        r   _subplot_type_for_trace_typer  (  s    //////#mooO_333//&*1E0FGGJu8'U"2"24e^^57%0  $%EMHHH!   D 4s   "A--
A:9A:c                     | }|                                  } | t          v r| S t          |           } | /t          d                    t          |                              | S )NUnsupported subplot type: {})lower_subplot_typesr  r1   r2   r4   )r   orig_subplot_types     r   _validate_coerce_subplot_typer  B  sm    $%%''L ~%% 0==L7>>tDU?V?VWWXXXr   c                    t          |          }|t                      }t          d|d                   t          d|d                   g}t          d|d                   t          d|d                   g}|dk    rt	          | ||||          }nc|t
          v rt          | ||||          }nF|dk    rt          ||          }n/t          d	                    t          |                              |S )NrZ   r   rn   r"   r	   r
   r  )r  r!   maxminr   r   r  r  r1   r2   r4   )r   r   r[   r   r   r    r   s          r   r   r   T  s
    1>>L688
 C!%%s3'<'<=HC!%%s3'<'<=Ht'K8_
 
 
.	.	.+L(Ho
 
 
	!	!+Hh??7>>tL?Q?QRRSSSr   c                 4    d                     | |          }|S )Nz{x_or_y}{cnt})r   r   )r2   )r   rI   rD   r   r  s        r   _get_cartesian_labelr  s  s    ""&c"::ELr   topc                    |d d d         }|dd d         }g }g }|dk    rVd}d}	d}
|D ]'}|                     t          |          dz             (|D ]}|                     |d                    |}d}n6|dk    rVd}d}	d}
|D ]'}|                     t          |          dz             (|D ]}|                     |d                    | }d}n|dk    rUd	}d
}	d}
|D ]}|                     |d                    |D ]'}|                     t          |          dz             (d}|}n|d
k    rVd}d}	d}
|D ]}|                     |d                    |D ]'}|                     t          |          dz             (d}| }n#t          d                    |                    g }t	          t          |                     D ]}| |         r|t          |          k    r||         d||         d| |         dt          d          |	|
d	}|dk    r||d<   |dk    r||d<   |dk    r||d<   |                     |           |S )N   r"   r  r   centerr   g       @r   Z   r   middleiz Invalid annotation edge '{edge}')edgepaperF   )size)	r   xrefr   yreftext	showarrowfontxanchoryanchorxshiftyshift	textangle)r   r}   r1   r2   rG   rR   r0   )r   r   r   r   x_domy_domsubtitle_pos_xsubtitle_pos_y
text_angler)  r*  	x_domains	y_domainsr,  r+  plot_titlesr   annots                     r   r   r   y  s2    CCaC EADqD!ENNU
 	8 	8I!!#i..3"67777 	0 	0I!!)A,////	x		
 	8 	8I!!#i..3"67777 	0 	0I!!)A,////	w		
 	0 	0I!!)A,//// 	8 	8I!!#i..3"67777	v		
 	0 	0I!!)A,//// 	8 	8I!!#i..3"67777;BB
BSSTTTKs>**++ & &e$ 	&^1D1D(D(D $E*#E*&u-""""
 
E {{"(h{{"(hQ%/k"u%%%%r   c                   #$ t          |           }t          | d                   $d}d}d}d}	d}
d}d}d	}d
}d}d}d}d}$fdt          |          D             }d #t          #fdt          |          D                       t          |          z   t          |          z   }|fd}t          |           D ]7\  }}t          |          D ] \  }}||         |         }|*||         |         dk    r| ||          z   ||         |<   @|d         dk    r|	 #|||          z   }n| #|||          z   }|d         dk    rt          d|d         dz
            D ]}| ||          z   ||         ||z   <   |d         dk    r*| |||z             z   |z   ||         ||d         z   dz
  <   n_| |||z             z   |z   ||         ||d         z   dz
  <   n5d|t          |          z
  dz
  z  }|d         dk    r	|||z   z  }n|||z   z  }|d         dk    rt          |d                   D ]}t          d|d                   D ]}| ||          z   }|dk    r*||d         dz
  k     r|
|dd          z   }n||dd          z   }||d         dz
  k    r*||d         dz
  k     r|d d         |z   }n|d d         |z   }||||z            ||z   <   | ||          z   ||         |<   "9|d d d         D ]#}||                    ||                   dz   z  }$|r|dz  }t          |          D ]\  } }!|!d         d         dz
  }|!d         d         dz
  }||         |         }d                    ||          d         j                  }"|"                    dd          }"|||"z   |z   d z   |z    #|||          z   |z   dz   z  }|S )!Nr   z  z[ z ]u   ⎡ u   ⎢ u   ⎣ u    ⎤u    ⎟u    ⎦z       -z       :z    (empty) z&This is the format of your plot grid:
c                 B    g | ]}d  t                    D             S )c                     g | ]}d S )rx   r   rC   s     r   rE   z._build_grid_str.<locals>.<listcomp>.<listcomp>  s    %%%AR%%%r   rF   rH   s     r   rE   z#_build_grid_str.<locals>.<listcomp>  s.    ;;;!%%t%%%;;;r   c                     t          d |D                       }d                    |          }|                    dd          }d                    | dz   |dz   |          S )Nc                 &    h | ]}|j         D ]}|S r   )r   )r   refr-   s      r   	<setcomp>z9_build_grid_str.<locals>._get_cell_str.<locals>.<setcomp>  s'    QQQCQQAaQQQQr   ,r   rx   z({r},{c}) {ref}r"   )rI   rD   r<  )sortedjoinr   r2   )rI   rD   r   r   ref_strs        r   _get_cell_strz&_build_grid_str.<locals>._get_cell_str  sg    QQ<QQQRR((;'' //&"-- ''!a%1q5g'FFFr   c           
      x    g | ]6\  }}t          |          D ]!\  }}|t           |||                    "7S r   )r   rR   )r   rI   row_refrD   r<  rB  s        r   rE   z#_build_grid_str.<locals>.<listcomp>  sl       Aw'00  As	MM!Q,,--   r   c                 ,    d|t          |           z
  z  S )N rQ   )scell_lens     r   _padz_build_grid_str.<locals>._pad  s    hQ'((r   rx   r]   r"   r\   rF  r  r)   
z
With insets:
re   r>  r   z over )rR   rG   r  r   r@  r   r   )%ra   r   rh   r   r   rX   sps_stre_strs_tops_mids_bote_tope_mide_botcolspan_strrowspan_str	empty_strr   _tmprH  rI  rI   r   rD   r   r<  cell_strccpaddingrrrow_strr   r   subplot_labels_strrB  rJ   s%                                      @@r   r   r     sZ   u::DuQx==D 
BEEEEEEEEKKI8H <;;;uT{{;;;DG G G 	   "+H"5"5  	
 	
 e**	 e**		  " ) ) ) ) !'' 23 238 ** 1	3 1	3GAt1+a.C{71:##!*TT)__!<DGAJI"" ==As#;#;; ==As#;#;;I""4	?Q#677 F FB&1DD4E4E&EDGAFOO	?Q&&#dd;+>&?&??8DGAY/!344
 $dd;+>&?&??8DGAY/!344 CMM!9A!=>	?Q&&%/HH%/HI""Y00 7 7B#AtI77 7 7"-[0A0A"A77!DOa$777*/'!""+*=*/'!""+*=i1!444!DOa$777*1#2#,*>*1#2#,*>/6QVQV,,7  "DDNN2DGAJJc1	3h TTrT] , ,BGGDG$$t++  &&'// 	 	NGUfa 1$Afa 1$A1+a.C!$*W*=a*@*L!M!M "4!;!;FB!G!G$%  	
  -1c**+  	HH Or   c           	      2   |dk    rt          d          |dk    rt          d          	 ||dz
           |dz
           }n# t          $ r t          d          w xY w|s$t          d                    ||                    |r0t	          |          dk     rt          d	          |d         j        }n|d         j        }|D ]<}|| vr6t          d
                    | j        |d         j        ||                    =|                     |           d S )Nr   z<Row value is out of range. Note: the starting cell is (1, 1)z<Col value is out of range. Note: the starting cell is (1, 1)r"   zZThe (row, col) pair sent is out of range. Use Figure.print_grid to view the subplot grid. z5
No subplot specified at grid position ({row}, {col}))rN   colr  z
Subplot with type '{subplot_type}' at grid position ({row}, {col}) was not
created with the secondary_y spec property set to True. See the docstring
for the specs argument to plotly.subplots.make_subplots for more information.
zTrace type '{typ}' is not compatible with subplot type '{subplot_type}'
at grid position ({row}, {col})

See the docstring for the specs argument to plotly.subplots.make_subplots
for more information on subplot types)r'   r   rN   r`  )	r   
IndexErrorr1   r2   rR   r   r3   r   update)	r  r   r   rN   r`  r[   r   r   r-   s	            r   _set_trace_grid_referencerc  ^  s   
axxM
 
 	
 axxM
 
 	

a(q1 
 
 

 
 	

  
88>S 9? 9 9
 
 	
  4|q     $A3#A3  E>>)
 *0
!-a!=	 *0 * *     
LLs   A Ac           	      0   	 | j         }n# t          $ r t          d          w xY wt          |          }t          |d                   }t	          |t
                    r|dk     s||k     r?t          d                    |t          |          t          |                              t	          |t
                    r|dk     s||k     r?t          d                    |t          |          t          |                              | j         |dz
           |dz
           }|sd S |r#t          |          dk    r|d         j
        }nd S |d         j
        }t          |          dk    rt          di |d         j        d         S t          |          dk    r| j        |d                  S t          |          d	k    r3t          | j        |d                  | j        |d                  
          S t          d                    |                    )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.r   r"   zt
The row argument to get_subplot must be an integer where 1 <= row <= {rows}
    Received value of type {typ}: {val}rz   zt
The col argument to get_subplot must be an integer where 1 <= row <= {cols}
    Received value of type {typ}: {val}ry   r
   r  r   z/
Unexpected subplot type with layout_keys of {}r   )r   AttributeErrorr   rR   r/   r   r1   r2   r3   r4   r   r   r   r   r   )	figrN   r`  r[   r   rX   rJ   r   r   s	            r   _get_grid_subplotrg    sM   
= 
 
 
8
 
 	

 x==Dx{D c3 
377dSjj++16tCyyd3ii ,2 , ,
 
 	
 c3 
377dSjj++16tCyyd3ii ,2 , ,
 
 	
 =q)#'2L t 2|q  &q/5KK4"1o1
;1FF|A;HEFFF	[		Q		z+a.))	[		Q		*[^,CJ{1~4N
 
 
 	
 228&3 3
 
 	
s   
 $c                    d| v r+t          ddd| j        j        | j        j        di          S d| v r[d| v rW| j        rd| j        dd          z   nd}| j        rd| j        dd          z   nd}t          d||f| j        | j        d	          S d
| v rt          d
| j        fd
| j        i          S d| v rt          d| j        fd| j        i          S d| v ret          D ]]}	 | 	                    d          }|
                    |           t          || j        fd| j        i          c S # t          $ r Y Zw xY wd S )Nr
   r   r   r   r   r   r"   r	   r   r   r   r   )r   r
   r   r   r   r   r   r   r   _get_prop_validatorr
  r   r1   )r  r   r   r`   	validators        r   _get_subplot_ref_for_tracerk    s   5!"%,.u|~$N$NO
 
 
 	
 
E		g..27+JWu{122..7
27+JWu{122..7
#Z0#(;EE
 
 
 	

 
%+
 
 
 	

 
E		 !5;/
 
 
 	

 
e		, 
	 
	A	!55i@@	))!,,,!!"!& 0"+U]!;     
     4s   #AD..
D;:D;)r"   r"   FFr#   FNNNNNNNNNNNNrL   )r  r   )F)collectionsr   setunionr  r   
namedtupler   r   r   r!   r   r   r   r  r  r  r  r   r  r   r   rc  rg  rk  r   r   r   <module>rp     s      MMM 042BCC DCC  #K";0BCC	&&
CC#[#A 

   
	

%M M M M`K K K\6 6 6 6t ?C   8    4  & LP   >   ?@Y Y Y YxF F FR8 8 8 8v;
 ;
 ;
 ;
|* * * * *r   