§
    ‹hþhÈ‡  ã                   óà   — d dl mZ d dlZd dlmZmZ d dlmZ d dl	m
Z
 d dlmZ  ej        d¦  «        Zg d¢Zd„ Zd„ Z	 	 	 	 	 	 dd„Z	 	 	 	 	 dd„Z	 	 	 	 	 dd„Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„ZdS )é    )ÚNumberN)Ú
exceptionsÚoptional_imports)ÚutilsÚpandas)ÚTaskÚStartÚFinishc                 ó   — | ||| g||||gfS )zÛ
    Returns the corner points of a scatter rectangle

    :param x0: x-start
    :param y0: y-lower
    :param x1: x-end
    :param y1: y-upper
    :return: ([x], [y]), tuple of lists containing the x and y values
    © )Úx0Úy0Úx1Úy1s       úS/var/www/histauto/venv/lib/python3.11/site-packages/plotly/figure_factory/_gantt.pyÚ_get_corner_pointsr      s!   € ð ��R˜Ð˜r 2 r¨2Ð.Ð/Ð/ó    c                 ó¬  — t           rÍt          | t           j        j        j        ¦  «        r©t
          D ]E}|| vr?t          j        d                     d 	                    t
          ¦  «        ¦  «        ¦  «        ‚ŒFt          | j        ¦  «        }g }t          |¦  «        D ]4}i }| D ]}| j        |         |         ||<   Œ|                     |¦  «         Œ5|S t          | t          ¦  «        st          j        d¦  «        ‚t          | ¦  «        dk    rt          j        d¦  «        ‚t          | d         t           ¦  «        st          j        d¦  «        ‚| S )z2
    Validates the inputted dataframe or list
    zBThe columns in your dataframe must include the following keys: {0}z, z<You must input either a dataframe or a list of dictionaries.r   z<Your list is empty. It must contain at least one dictionary.z)Your list must only include dictionaries.)ÚpdÚ
isinstanceÚcoreÚframeÚ	DataFrameÚREQUIRED_GANTT_KEYSr   ÚPlotlyErrorÚformatÚjoinÚlenÚindexÚrangeÚilocÚappendÚlistÚdict)ÚdfÚkeyÚnum_of_rowsÚchartr   Ú	task_dicts         r   Úvalidate_ganttr*      si  € õ 
ð �j˜�RœWœ]Ô4Ñ5Ô5ð å&ð 	ð 	ˆCØ˜"ˆ}ˆ}Ý Ô,ð*ß*0ª&°·²Õ;NÑ1OÔ1OÑ*PÔ*Pñô ð ð õ ˜"œ(‘m”mˆØˆÝ˜;Ñ'Ô'ð 	$ð 	$ˆEØˆIØð 5ð 5�Ø!#¤¨¤°Ô!4�	˜#‘�Ø�LŠL˜Ñ#Ô#Ð#Ð#àˆõ �b�$ÑÔð 
ÝÔ$ØJñ
ô 
ð 	
õ
 ˆ2�w„w�!‚|€|ÝÔ$ØJñ
ô 
ð 	
õ �b˜”e�TÑ"Ô"ð RÝÔ$Ð%PÑQÔQÐQØ€Ir   FTc                 ó´  ‡‡— |€g }|	€g }	|
€g }
t          t          | ¦  «        ¦  «        D ]h}t          | |         d         | |         d         | |         d         ¬¦  «        }d| |         v r| |         d         |d<   |                     |¦  «         Œit          ¦   «         Št          ¦   «         Š|rd}nd	}g g d
d|dœ}g g dg t          ddd¬¦  «        dddœ}t          t          |¦  «        ¦  «        D ]+}||         d         }|r||	vr|	                     |¦  «         Œ,|r|	                     ¦   «          d}t          t          |¦  «        ¦  «        D �]8}||         d         }||         d= |}|r|	                     |¦  «        }||z
  ||         d<   ||z   ||         d<   |t          |¦  «        k    rd}||         ||         d<   ||         d         }|‰vrt          j        |¦  «        ‰|<   |‰|         d<   t          |¦  «        ‰|         d<   |‰|         d<   t          ‰|         d         ¦  «        dk    rT‰|         d                              ‰|         d         d         ¦  «         ‰|         d                              d¦  «         t          ||         d         ||         d         ||         d         ||         d         ¦  «        \  }}‰|         dxx         |z  cc<   ‰|         dxx         |z  cc<   |‰vr3t          j        |¦  «        ‰|<   |‰|         d         d<   |‰|         d<   ‰|         d                              ||         d         ¦  «         ‰|         d                              ||         d         ¦  «         ‰|         d                              |¦  «         ‰|         d                              |¦  «         d||         v rd‰|         d                              ||         d         ¦  «         ‰|         d                              ||         d         ¦  «         ||         d= nB‰|         d                              d¦  «         ‰|         d                              d¦  «         |dz  }�Œ:|}t          ||||g d t          ||	t          t          t          |	¦  «        ¦  «        ¦  «        dt          |	¦  «        dz   gdd¬!¦  «        t          |dt          t          t          d"d#d$d%¬&¦  «        t          dd'd(d%¬&¦  «        t          d)d*d(d%¬&¦  «        t          dd+d,d-¬&¦  «        t          dd.d,d%¬&¦  «        t          d/¬0¦  «        g¦  «        ¬1¦  «        d2¬3¦  «        ¬4¦  «        }ˆfd5„t          ‰¦  «        D ¦   «         }
|
ˆfd6„t          ‰¦  «        D ¦   «         z  }
t          j        |
|¬7¦  «        }|S )8z/
    Refer to create_gantt() for docstring
    Nr	   r
   r   ©r   r   ÚnameÚDescriptionÚdescriptionr-   ÚskipÚnoneÚtoself)ÚxÚyÚmodeÚfillÚ	hoverinfoÚmarkersÚ é   r   ©ÚcolorÚsizeÚopacityF©r3   r4   r5   ÚtextÚmarkerr-   Ú
showlegendr   r   Ú	fillcolorÚlegendgroupr3   éÿÿÿÿr4   r   r   rA   r<   r@   Úclosest©ÚshowgridÚticktextÚtickvalsr    Ú	autorangeÚzerolineé   Ú1wÚdayÚbackward©ÚcountÚlabelÚstepÚstepmodeÚ1mÚmonthé   Ú6mÚYTDÚyearÚtodateÚ1yÚall©rT   ©ÚbuttonsÚdate©rH   rL   ÚrangeselectorÚtype©ÚtitlerB   ÚheightÚwidthÚshapesÚ	hovermodeÚyaxisÚxaxisc                 ó    •— g | ]
}‰|         ‘ŒS r   r   ©Ú.0ÚkÚscatter_data_dicts     €r   ú
<listcomp>zgantt.<locals>.<listcomp>õ   ó   ø€ ÐDÐDÐD QÐ˜aÔ ÐDÐDÐDr   c                 ó    •— g | ]
}‰|         ‘ŒS r   r   ©rp   rq   Úmarker_data_dicts     €r   rs   zgantt.<locals>.<listcomp>ö   ó   ø€ ÐCÐCÐC QÐ˜aÔ ÐCÐCÐCr   ©ÚdataÚlayout)r    r   r$   r"   Úreverser   ÚcopyÚdeepcopyÚstrr   r#   ÚsortedÚgoÚFigure)r(   Úcolorsrg   Ú	bar_widthÚ
showgrid_xÚ
showgrid_yrh   ri   ÚtasksÚ
task_namesrz   Úgroup_tasksÚshow_hover_fillÚshow_colorbarr   Útaskr7   Úscatter_data_templateÚmarker_data_templateÚtnÚcolor_indexÚgroupIDÚcolor_idÚxsÚysrB   r{   Úfigrw   rr   s                               @@r   Úganttr–   D   sÊ  øø€ ð& €}ØˆØÐØˆ
Ø€|Øˆå•s˜5‘z”zÑ"Ô"ð ð ˆÝØ�UŒ|˜GÔ$Ø�UŒ|˜HÔ%Ø�u”˜fÔ%ð
ñ 
ô 
ˆð
 ˜E %œLÐ(Ð(Ø"'¨¤,¨}Ô"=ˆD�ÑØ�Š�TÑÔÐÐõ ™œÐÝ‘v”vÐàð Øˆ	ˆ	àˆ	ð ØØØØðð Ðð ØØØÝ˜R a°Ð3Ñ3Ô3ØØðð Ðõ •s˜5‘z”zÑ"Ô"ð "ð "ˆØ�5Œ\˜&Ô!ˆð ð 	"˜b¨
Ð2Ð2Ø×Ò˜bÑ!Ô!Ð!øð ð Ø×ÒÑÔÐà€KÝ•s˜5‘z”zÑ"Ô"ð >ñ >ˆØ�5Œ\˜&Ô!ˆØ�%ŒL˜Ð ð ˆØð 	+Ø ×&Ò& rÑ*Ô*ˆGØ$ yÑ0ˆˆeŒ�TÑØ$ yÑ0ˆˆeŒ�TÑð �#˜f™+œ+Ò%Ð%ØˆKØ$*¨;Ô$7ˆˆeŒ�[Ñ!Ø˜”< Ô,ˆàÐ,Ð,Ð,Ý*.¬-Ð8MÑ*NÔ*NÐ˜hÑ'à3;Ð˜(Ô# KÑ0Ý.1°"©g¬gÐ˜(Ô# FÑ+Ø5=Ð˜(Ô# MÑ2õ Ð  Ô*¨3Ô/Ñ0Ô0°1Ò4Ð4à˜hÔ'¨Ô,×3Ò3Ø! (Ô+¨CÔ0°Ô4ñô ð ð ˜hÔ'¨Ô,×3Ò3°DÑ9Ô9Ð9å#Ø�%ŒL˜ÔØ�%ŒL˜ÔØ�%ŒL˜ÔØ�%ŒL˜Ôñ	
ô 
‰ˆˆBð 	˜(Ô# CÐ(Ð(Ô(¨BÑ.Ð(Ð(Ñ(Ø˜(Ô# CÐ(Ð(Ô(¨BÑ.Ð(Ð(Ñ(ð Ð+Ð+Ð+Ý)-¬Ð7KÑ)LÔ)LÐ˜XÑ&Ø<DÐ˜XÔ& xÔ0°Ñ9Ø8@Ð˜XÔ& }Ñ5à˜Ô" 3Ô'×.Ò.¨u°U¬|¸DÔ/AÑBÔBÐBØ˜Ô" 3Ô'×.Ò.¨u°U¬|¸DÔ/AÑBÔBÐBØ˜Ô" 3Ô'×.Ò.¨wÑ7Ô7Ð7Ø˜Ô" 3Ô'×.Ò.¨wÑ7Ô7Ð7à˜E %œLÐ(Ð(Ø˜XÔ& vÔ.×5Ò5°e¸E´lÀ=Ô6QÑRÔRÐRØ˜XÔ& vÔ.×5Ò5°e¸E´lÀ=Ô6QÑRÔRÐRØ�e”˜]Ð+Ð+à˜XÔ& vÔ.×5Ò5°dÑ;Ô;Ð;Ø˜XÔ& vÔ.×5Ò5°dÑ;Ô;Ð;à�qÑˆ‰à€JåØØØØØØÝØØÝ�%¥ J¡¤Ñ0Ô0Ñ1Ô1Ø•s˜:‘”¨Ñ*Ð+ØØð
ñ 
ô 
õ ØØÝÝå 1¨D°uÀzÐRÑRÔRÝ 1¨D°wÈÐTÑTÔTÝ 1¨D°wÈÐTÑTÔTÝ 1¨E¸ÈÐRÑRÔRÝ 1¨D°vÈ
ÐSÑSÔSÝ %Ð(Ñ(Ô(ðñ	ô 	ðñ ô ð ð
ñ 
ô 
ð ñ  ô  €FðD EÐDÐDÐD­&Ð1BÑ*CÔ*CÐDÑDÔD€DØÐCÐCÐCÐC­&Ð1AÑ*BÔ*BÐCÑCÔCÑC€Dõ
 Œ)˜ fÐ
-Ñ
-Ô
-€CØ€Jr   c                 óž  ‡&‡'— |
€g }
|€g }|€g }d}t          t          | ¦  «        ¦  «        D ]h}t          | |         d         | |         d         | |         d         ¬¦  «        }d| |         v r| |         d         |d<   |
                     |¦  «         Œit          ¦   «         Š't          ¦   «         Š&|rd	}nd
}g g ddd|ddœ}g g dg t          ddd¬¦  «        ddddœ}g }t          t          |
¦  «        ¦  «        D ]3}| |         |         |vr!|                     | |         |         ¦  «         Œ4|                     ¦   «          t          | d         |         t          ¦  «        �rËt          |¦  «        dk     rt          j        d¦  «        ‚t          t          |
¦  «        ¦  «        D ]+}|
|         d	         }|r||vr|                     |¦  «         Œ,|r| 	                    ¦   «          t          t          |
¦  «        ¦  «        D �]¹}|
|         d	         }|
|         d	= |}|r| 
                    |¦  «        }||z
  |
|         d<   ||z   |
|         d<   t          j        |t          j        ¦  «        }|d         }|d         }| |         |         dz  }t          j        |||¦  «        }t          j        |t          j        ¦  «        }||
|         d<   |
|         d         }|‰'vrt!          j        |¦  «        ‰'|<   |‰'|         d<   t%          | |         |         ¦  «        ‰'|         d	<   |‰'|         d<   t          j        |t          j        ¦  «        }t          ‰'|         d         ¦  «        dk    rT‰'|         d                              ‰'|         d         d         ¦  «         ‰'|         d                              d¦  «         t'          |
|         d         |
|         d         |
|         d         |
|         d         ¦  «        \  }}‰'|         dxx         |z  cc<   ‰'|         dxx         |z  cc<   |‰&vr3t!          j        |¦  «        ‰&|<   |‰&|         d          d!<   |‰&|         d<   ‰&|         d                              |
|         d         ¦  «         ‰&|         d                              |
|         d         ¦  «         ‰&|         d                              |¦  «         ‰&|         d                              |¦  «         d|
|         v re‰&|         d"                              |
|         d         ¦  «         ‰&|         d"                              |
|         d         ¦  «         |
|         d= �Œw‰&|         d"                              d¦  «         ‰&|         d"                              d¦  «         �Œ»|d#u rkt)          ‰&                     ¦   «         ¦  «        d         } ‰&|          d                               t          d|d         gd|d         ggd#d$d¬%¦  «        ¦  «         t          | d         |         t$          ¦  «        �r³g }t          t          |
¦  «        ¦  «        D ]3}| |         |         |vr!|                     | |         |         ¦  «         Œ4|                     ¦   «          t          |¦  «        t          |¦  «        k     rt          j        d&¦  «        ‚i }!d}"|D ]*}#|"t          |¦  «        dz
  k    rd}"||"         |!|#<   |"dz  }"Œ+t          t          |
¦  «        ¦  «        D ]+}|
|         d	         }|r||vr|                     |¦  «         Œ,|r| 	                    ¦   «          t          t          |
¦  «        ¦  «        D �]V}|
|         d	         }|
|         d	= |}|r| 
                    |¦  «        }||z
  |
|         d<   ||z   |
|         d<   |!| |         |                  |
|         d<   |
|         d         }|‰'vrt!          j        |¦  «        ‰'|<   |‰'|         d<   |‰'|         d<   t%          | |         |         ¦  «        ‰'|         d	<   t          j        |t          j        ¦  «        }t          ‰'|         d         ¦  «        dk    rT‰'|         d                              ‰'|         d         d         ¦  «         ‰'|         d                              d¦  «         t'          |
|         d         |
|         d         |
|         d         |
|         d         ¦  «        \  }}‰'|         dxx         |z  cc<   ‰'|         dxx         |z  cc<   |‰&vr3t!          j        |¦  «        ‰&|<   |‰&|         d          d!<   |‰&|         d<   ‰&|         d                              |
|         d         ¦  «         ‰&|         d                              |
|         d         ¦  «         ‰&|         d                              |¦  «         ‰&|         d                              |¦  «         d|
|         v re‰&|         d"                              |
|         d         ¦  «         ‰&|         d"                              |
|         d         ¦  «         |
|         d= �Œ‰&|         d"                              d¦  «         ‰&|         d"                              d¦  «         �ŒX|d#u rd#}‰'D ]} |‰'|          d'<   Œt          ||||	g d(t          ||t)          t          t          |¦  «        ¦  «        ¦  «        dt          |¦  «        dz   gdd¬)¦  «        t          |dt          t)          t          d*d+d,d-¬.¦  «        t          dd/d0d-¬.¦  «        t          d1d2d0d-¬.¦  «        t          dd3d4d5¬.¦  «        t          dd6d4d-¬.¦  «        t          d7¬8¦  «        g¦  «        ¬9¦  «        d:¬;¦  «        ¬<¦  «        }$ˆ'fd=„t/          ‰'¦  «        D ¦   «         }|ˆ&fd>„t/          ‰&¦  «        D ¦   «         z  }t1          j        ||$¬?¦  «        }%|%S )@ú=
    Refer to FigureFactory.create_gantt() for docstring
    NFr	   r
   r   r,   r.   r/   r-   r0   r1   r2   r9   )r3   r4   r5   r6   rB   r7   rD   r8   r:   r   r;   )r3   r4   r5   r@   rA   r-   rB   rD   é   z®You must use at least 2 colors in 'colors' if you are using a colorscale. However only the first two colors given will be used for the lower and upper bounds on the colormap.r   r   g      Y@rC   rD   r3   rE   r4   r   r   rA   r<   r@   Téd   )Ú
colorscaleÚ	showscaleÚcmaxÚcminztError. The number of colors in 'colors' must be no less than the number of unique index values in your group column.rB   rF   rG   rM   rN   rO   rP   rQ   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   rb   rc   rf   c                 ó    •— g | ]
}‰|         ‘ŒS r   r   ro   s     €r   rs   z$gantt_colorscale.<locals>.<listcomp>K  rt   r   c                 ó    •— g | ]
}‰|         ‘ŒS r   r   rv   s     €r   rs   z$gantt_colorscale.<locals>.<listcomp>L  rx   r   ry   )r    r   r$   r"   Úsortr   r   r   r   r|   r   ÚclrsÚcolor_parserÚunlabel_rgbÚfind_intermediate_colorÚ	label_rgbr}   r~   r   r   r#   ÚkeysÚupdater€   r�   r‚   )(r(   rƒ   rg   Ú	index_colr‹   r„   r…   r†   rh   ri   r‡   rˆ   rz   r‰   rŠ   rB   r   rŒ   r7   r�   rŽ   Ú
index_valsÚrowr�   r‘   ÚlowcolorÚ	highcolorÚintermedÚintermed_colorr’   r“   r”   rq   Úindex_vals_dictÚc_indexr&   r{   r•   rw   rr   s(                                         @@r   Úgantt_colorscaler²   ÿ   s¦  øø€ ð( €}ØˆØÐØˆ
Ø€|ØˆØ€Jå•s˜5‘z”zÑ"Ô"ð ð ˆÝØ�UŒ|˜GÔ$Ø�UŒ|˜HÔ%Ø�u”˜fÔ%ð
ñ 
ô 
ˆð
 ˜E %œLÐ(Ð(Ø"'¨¤,¨}Ô"=ˆD�ÑØ�Š�TÑÔÐÐõ ™œÐå‘v”vÐàð Øˆ	ˆ	àˆ	ð ØØØØØØðð Ðð ØØØÝ˜R a°Ð3Ñ3Ô3ØØØð	ð 	Ðð €JÝ•S˜‘Z”ZÑ Ô ð 5ð 5ˆØ�Œ:�iÔ ¨
Ð2Ð2Ø×Ò˜e Cœj¨Ô3Ñ4Ô4Ð4øà‡O‚OÑÔÐõ �%˜”(˜9Ô%¥vÑ.Ô.ñ gåˆv‰;Œ;˜Š?ˆ?ÝÔ(ð*ñô ð õ �3˜u™:œ:Ñ&Ô&ð 	&ð 	&ˆEØ�u”˜fÔ%ˆBð ð & "¨JÐ"6Ð"6Ø×!Ò! "Ñ%Ô%Ð%øð ð 	!Ø×ÒÑ Ô Ð å�3˜u™:œ:Ñ&Ô&ð D	@ñ D	@ˆEØ�u”˜fÔ%ˆBØ�e”˜VÐ$ð ˆGØð /Ø$×*Ò*¨2Ñ.Ô.�Ø!(¨9Ñ!4ˆE�%ŒL˜ÑØ!(¨9Ñ!4ˆE�%ŒL˜Ñõ Ô& v­tÔ/?Ñ@Ô@ˆFØ˜a”yˆHØ˜qœ	ˆIà˜eœ YÔ/°5Ñ8ˆHÝ!Ô9¸(ÀIÈxÑXÔXˆNÝ!Ô.¨~½t¼~ÑNÔNˆNØ(6ˆE�%ŒL˜Ñ%Ø˜U”| KÔ0ˆHàÐ0Ð0Ð0Ý.2¬mÐ<QÑ.RÔ.RÐ! (Ñ+à7?Ð˜hÔ'¨Ñ4Ý25°e¸E´lÀ9Ô6MÑ2NÔ2NÐ˜hÔ'¨Ñ/Ø9AÐ˜hÔ'¨Ñ6õ Ô& v­t¬~Ñ>Ô>ˆFõ Ð$ XÔ.¨sÔ3Ñ4Ô4°qÒ8Ð8à! (Ô+¨CÔ0×7Ò7Ø% hÔ/°Ô4°RÔ8ñô ð ð " (Ô+¨CÔ0×7Ò7¸Ñ=Ô=Ð=å'Ø�e”˜TÔ"Ø�e”˜TÔ"Ø�e”˜TÔ"Ø�e”˜TÔ"ñ	ô ‰FˆB�ð ˜hÔ'¨Ð,Ð,Ô,°Ñ2Ð,Ð,Ñ,Ø˜hÔ'¨Ð,Ð,Ô,°Ñ2Ð,Ð,Ñ,ð Ð/Ð/Ð/Ý-1¬]Ð;OÑ-PÔ-PÐ  Ñ*Ø@HÐ  Ô*¨8Ô4°WÑ=Ø<DÐ  Ô*¨=Ñ9à˜XÔ& sÔ+×2Ò2°5¸´<ÀÔ3EÑFÔFÐFØ˜XÔ& sÔ+×2Ò2°5¸´<ÀÔ3EÑFÔFÐFØ˜XÔ& sÔ+×2Ò2°7Ñ;Ô;Ð;Ø˜XÔ& sÔ+×2Ò2°7Ñ;Ô;Ð;à  e¤Ð,Ð,Ø  Ô*¨6Ô2×9Ò9¸%À¼,À}Ô:UÑVÔVÐVØ  Ô*¨6Ô2×9Ò9¸%À¼,À}Ô:UÑVÔVÐVØ˜%”L Ð/Ñ/à  Ô*¨6Ô2×9Ò9¸$Ñ?Ô?Ð?Ø  Ô*¨6Ô2×9Ò9¸$Ñ?Ô?Ð?Ñ?ð ˜DÐ Ð ÝÐ%×*Ò*Ñ,Ô,Ñ-Ô-¨aÔ0ˆAØ˜QÔ Ô)×0Ò0ÝØ!" F¨1¤I °°F¸1´I°Ð?Ø"ØØð	ñ ô ñô ð õ �%˜”(˜9Ô%¥sÑ+Ô+ñ g@Øˆ
Ý�˜U™œÑ$Ô$ð 	9ð 	9ˆCØ�SŒz˜)Ô$¨JÐ6Ð6Ø×!Ò! %¨¤*¨YÔ"7Ñ8Ô8Ð8øà�ŠÑÔÐåˆv‰;Œ;�˜Z™œÒ(Ð(ÝÔ(ðñô ð ð ˆàˆØð 	ð 	ˆCØ�˜V™œ q™Ò(Ð(Ø�Ø#)¨'¤?ˆO˜CÑ Ø�q‰LˆGˆGõ �3˜u™:œ:Ñ&Ô&ð 	&ð 	&ˆEØ�u”˜fÔ%ˆBð ð & "¨JÐ"6Ð"6Ø×!Ò! "Ñ%Ô%Ð%øð ð 	!Ø×ÒÑ Ô Ð å�3˜u™:œ:Ñ&Ô&ð <	@ñ <	@ˆEØ�u”˜fÔ%ˆBØ�e”˜VÐ$ð ˆGØð /Ø$×*Ò*¨2Ñ.Ô.�Ø!(¨9Ñ!4ˆE�%ŒL˜ÑØ!(¨9Ñ!4ˆE�%ŒL˜Ñà(7¸¸e¼ÀYÔ8OÔ(PˆE�%ŒL˜Ñ%Ø˜U”| KÔ0ˆHàÐ0Ð0Ð0Ý.2¬mÐ<QÑ.RÔ.RÐ! (Ñ+à7?Ð˜hÔ'¨Ñ4Ø9AÐ˜hÔ'¨Ñ6Ý25°e¸E´lÀ9Ô6MÑ2NÔ2NÐ˜hÔ'¨Ñ/õ Ô& v­t¬~Ñ>Ô>ˆFõ Ð$ XÔ.¨sÔ3Ñ4Ô4°qÒ8Ð8à! (Ô+¨CÔ0×7Ò7Ø% hÔ/°Ô4°RÔ8ñô ð ð " (Ô+¨CÔ0×7Ò7¸Ñ=Ô=Ð=å'Ø�e”˜TÔ"Ø�e”˜TÔ"Ø�e”˜TÔ"Ø�e”˜TÔ"ñ	ô ‰FˆB�ð ˜hÔ'¨Ð,Ð,Ô,°Ñ2Ð,Ð,Ñ,Ø˜hÔ'¨Ð,Ð,Ô,°Ñ2Ð,Ð,Ñ,ð Ð/Ð/Ð/Ý-1¬]Ð;OÑ-PÔ-PÐ  Ñ*Ø@HÐ  Ô*¨8Ô4°WÑ=Ø<DÐ  Ô*¨=Ñ9à˜XÔ& sÔ+×2Ò2°5¸´<ÀÔ3EÑFÔFÐFØ˜XÔ& sÔ+×2Ò2°5¸´<ÀÔ3EÑFÔFÐFØ˜XÔ& sÔ+×2Ò2°7Ñ;Ô;Ð;Ø˜XÔ& sÔ+×2Ò2°7Ñ;Ô;Ð;à  e¤Ð,Ð,Ø  Ô*¨6Ô2×9Ò9¸%À¼,À}Ô:UÑVÔVÐVØ  Ô*¨6Ô2×9Ò9¸%À¼,À}Ô:UÑVÔVÐVØ˜%”L Ð/Ñ/à  Ô*¨6Ô2×9Ò9¸$Ñ?Ô?Ð?Ø  Ô*¨6Ô2×9Ò9¸$Ñ?Ô?Ð?Ñ?à˜DÐ Ð ØˆJØ&ð @ð @�Ø5?Ð! !Ô$ \Ñ2Ð2õ ØØØØØØÝØØÝ�%¥ J¡¤Ñ0Ô0Ñ1Ô1Ø•s˜:‘”¨Ñ*Ð+ØØð
ñ 
ô 
õ ØØÝÝå 1¨D°uÀzÐRÑRÔRÝ 1¨D°wÈÐTÑTÔTÝ 1¨D°wÈÐTÑTÔTÝ 1¨E¸ÈÐRÑRÔRÝ 1¨D°vÈ
ÐSÑSÔSÝ %Ð(Ñ(Ô(ðñ	ô 	ðñ ô ð ð
ñ 
ô 
ð ñ  ô  €FðD EÐDÐDÐD­&Ð1BÑ*CÔ*CÐDÑDÔD€DØÐCÐCÐCÐC­&Ð1AÑ*BÔ*BÐCÑCÔCÑC€Dõ
 Œ)˜ fÐ
-Ñ
-Ô
-€CØ€Jr   c                 óÀ  ‡ ‡!— |
€g }
|€g }|€g }d}t          t          | ¦  «        ¦  «        D ]h}t          | |         d         | |         d         | |         d         ¬¦  «        }d| |         v r| |         d         |d<   |
                     |¦  «         Œit          ¦   «         Š!t          ¦   «         Š |rd	}nd
}g g dd|ddœ}g g dg t          ddd¬¦  «        dddœ}g }t          t          |
¦  «        ¦  «        D ]3}| |         |         |vr!|                     | |         |         ¦  «         Œ4|                     ¦   «          |D ]}||vrt          j        d¦  «        ‚Œt          t          |
¦  «        ¦  «        D ]+}|
|         d	         }|r||vr|                     |¦  «         Œ,|r|                     ¦   «          t          t          |
¦  «        ¦  «        D �]}|
|         d	         }|
|         d	= |}|r|                     |¦  «        }||z
  |
|         d<   ||z   |
|         d<   || |         |                  |
|         d<   |
|         d         }|‰!vrt          j
        |¦  «        ‰!|<   |‰!|         d<   |‰!|         d<   t          ‰!|         d         ¦  «        dk    rT‰!|         d                              ‰!|         d         d         ¦  «         ‰!|         d                              d¦  «         t          |
|         d         |
|         d         |
|         d         |
|         d         ¦  «        \  }}‰!|         dxx         |z  cc<   ‰!|         dxx         |z  cc<   |‰ vr3t          j
        |¦  «        ‰ |<   |‰ |         d         d<   |‰ |         d<   ‰ |         d                              |
|         d         ¦  «         ‰ |         d                              |
|         d         ¦  «         ‰ |         d                              |¦  «         ‰ |         d                              |¦  «         d|
|         v re‰ |         d                               |
|         d         ¦  «         ‰ |         d                               |
|         d         ¦  «         |
|         d= �ŒÑ‰ |         d                               d¦  «         ‰ |         d                               d¦  «         �Œ|d!u rd!}|D ] }t          |¦  «        ‰!||                  d	<   Œ!t          ||||	g d"t          ||t          t          t          |¦  «        ¦  «        ¦  «        dt          |¦  «        dz   gdd¬#¦  «        t          |dt          t          t          d$d%d&d'¬(¦  «        t          dd)d*d'¬(¦  «        t          d+d,d*d'¬(¦  «        t          dd-d.d/¬(¦  «        t          dd0d.d'¬(¦  «        t          d1¬2¦  «        g¦  «        ¬3¦  «        d4¬5¦  «        ¬6¦  «        }ˆ!fd7„t          ‰!¦  «        D ¦   «         }|ˆ fd8„t          ‰ ¦  «        D ¦   «         z  }t          j        ||¬9¦  «        }|S ):r˜   NFr	   r
   r   r,   r.   r/   r-   r0   r1   r2   r9   )r3   r4   r5   r6   r7   rD   r8   r:   r   r;   r?   zdIf you are using colors as a dictionary, all of its keys must be all the values in the index column.r   r   rC   rD   r3   rE   r4   r   r   rA   r<   r@   TrF   rG   rM   rN   rO   rP   rQ   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   rb   rc   rf   c                 ó    •— g | ]
}‰|         ‘ŒS r   r   ro   s     €r   rs   zgantt_dict.<locals>.<listcomp>  rt   r   c                 ó    •— g | ]
}‰|         ‘ŒS r   r   rv   s     €r   rs   zgantt_dict.<locals>.<listcomp>  rx   r   ry   )r    r   r$   r"   r¡   r   r   r|   r   r}   r~   r   r   r#   r€   r�   r‚   )"r(   rƒ   rg   r©   r‹   r„   r…   r†   rh   ri   r‡   rˆ   rz   r‰   rŠ   rB   r   rŒ   r7   r�   rŽ   rª   r«   r&   r�   r‘   r’   r“   r”   Úindex_valuer{   r•   rw   rr   s"                                   @@r   Ú
gantt_dictr·   U  s}  øø€ ð* €}ØˆØÐØˆ
Ø€|ØˆØ€Jå•s˜5‘z”zÑ"Ô"ð ð ˆÝØ�UŒ|˜GÔ$Ø�UŒ|˜HÔ%Ø�u”˜fÔ%ð
ñ 
ô 
ˆð
 ˜E %œLÐ(Ð(Ø"'¨¤,¨}Ô"=ˆD�ÑØ�Š�TÑÔÐÐõ ™œÐå‘v”vÐàð Øˆ	ˆ	àˆ	ð ØØØØØðð Ðð ØØØÝ˜R a°Ð3Ñ3Ô3ØØðð Ðð €JÝ•S˜‘Z”ZÑ Ô ð 5ð 5ˆØ�Œ:�iÔ ¨
Ð2Ð2Ø×Ò˜e Cœj¨Ô3Ñ4Ô4Ð4øà‡O‚OÑÔÐð ð ð ˆØ�fÐÐÝÔ(ðCñô ð ð õ •s˜5‘z”zÑ"Ô"ð "ð "ˆØ�5Œ\˜&Ô!ˆð ð 	"˜b¨
Ð2Ð2Ø×Ò˜bÑ!Ô!Ð!øð ð Ø×ÒÑÔÐå•s˜5‘z”zÑ"Ô"ð 8<ñ 8<ˆØ�5Œ\˜&Ô!ˆØ�%ŒL˜Ð ð ˆØð 	+Ø ×&Ò& rÑ*Ô*ˆGØ$ yÑ0ˆˆeŒ�TÑØ$ yÑ0ˆˆeŒ�TÑà$*¨5°¬<¸	Ô+BÔ$CˆˆeŒ�[Ñ!Ø˜”< Ô,ˆàÐ,Ð,Ð,Ý*.¬-Ð8MÑ*NÔ*NÐ˜hÑ'à5=Ð˜(Ô# MÑ2Ø3;Ð˜(Ô# KÑ0õ Ð  Ô*¨3Ô/Ñ0Ô0°1Ò4Ð4à˜hÔ'¨Ô,×3Ò3Ø! (Ô+¨CÔ0°Ô4ñô ð ð ˜hÔ'¨Ô,×3Ò3°DÑ9Ô9Ð9å#Ø�%ŒL˜ÔØ�%ŒL˜ÔØ�%ŒL˜ÔØ�%ŒL˜Ôñ	
ô 
‰ˆˆBð 	˜(Ô# CÐ(Ð(Ô(¨BÑ.Ð(Ð(Ñ(Ø˜(Ô# CÐ(Ð(Ô(¨BÑ.Ð(Ð(Ñ(ð Ð+Ð+Ð+Ý)-¬Ð7KÑ)LÔ)LÐ˜XÑ&Ø<DÐ˜XÔ& xÔ0°Ñ9Ø8@Ð˜XÔ& }Ñ5à˜Ô" 3Ô'×.Ò.¨u°U¬|¸DÔ/AÑBÔBÐBØ˜Ô" 3Ô'×.Ò.¨u°U¬|¸DÔ/AÑBÔBÐBØ˜Ô" 3Ô'×.Ò.¨wÑ7Ô7Ð7Ø˜Ô" 3Ô'×.Ò.¨wÑ7Ô7Ð7à˜E %œLÐ(Ð(Ø˜XÔ& vÔ.×5Ò5°e¸E´lÀ=Ô6QÑRÔRÐRØ˜XÔ& vÔ.×5Ò5°e¸E´lÀ=Ô6QÑRÔRÐRØ�e”˜]Ð+Ñ+à˜XÔ& vÔ.×5Ò5°dÑ;Ô;Ð;Ø˜XÔ& vÔ.×5Ò5°dÑ;Ô;Ð;Ñ;à˜ÐÐØˆ
à!ð Jð JˆÝ9<¸[Ñ9IÔ9IÐ˜& Ô-Ô.¨vÑ6Ð6åØØØØØØÝØØÝ�%¥ J¡¤Ñ0Ô0Ñ1Ô1Ø•s˜:‘”¨Ñ*Ð+ØØð
ñ 
ô 
õ ØØÝÝå 1¨D°uÀzÐRÑRÔRÝ 1¨D°wÈÐTÑTÔTÝ 1¨D°wÈÐTÑTÔTÝ 1¨E¸ÈÐRÑRÔRÝ 1¨D°vÈ
ÐSÑSÔSÝ %Ð(Ñ(Ô(ðñ	ô 	ðñ ô ð ð
ñ 
ô 
ð ñ  ô  €FðD EÐDÐDÐD­&Ð1BÑ*CÔ*CÐDÑDÔD€DØÐCÐCÐCÐC­&Ð1AÑ*BÔ*BÐCÑCÔCÑC€Dõ
 Œ)˜ fÐ
-Ñ
-Ô
-€CØ€Jr   úGantt Chartçš™™™™™É?éX  c                 óº  — t          | ¦  «        }|rT||d         vrt          j        d¦  «        ‚g }|D ]}|                     ||         ¦  «         Œt	          j        |¦  «         t          |t          ¦  «        rt          j	        |d¦  «        }nt          j
        |d¦  «        }|du r|                     ¦   «          |sHt          |t          ¦  «        rt          j        d¦  «        ‚t          |||||||	|
ddd|||¬¦  «        }|S t          |t          ¦  «        s t          |||||||||	|
ddd||¬¦  «        }|S t          |||||||||	|
ddd||¬¦  «        }|S )	a¨  
    **deprecated**, use instead
    :func:`plotly.express.timeline`.

    Returns figure for a gantt chart

    :param (array|list) df: input data for gantt chart. Must be either a
        a dataframe or a list. If dataframe, the columns must include
        'Task', 'Start' and 'Finish'. Other columns can be included and
        used for indexing. If a list, its elements must be dictionaries
        with the same required column headers: 'Task', 'Start' and
        'Finish'.
    :param (str|list|dict|tuple) colors: either a plotly scale name, an
        rgb or hex color, a color tuple or a list of colors. An rgb color
        is of the form 'rgb(x, y, z)' where x, y, z belong to the interval
        [0, 255] and a color tuple is a tuple of the form (a, b, c) where
        a, b and c belong to [0, 1]. If colors is a list, it must
        contain the valid color types aforementioned as its members.
        If a dictionary, all values of the indexing column must be keys in
        colors.
    :param (str|float) index_col: the column header (if df is a data
        frame) that will function as the indexing column. If df is a list,
        index_col must be one of the keys in all the items of df.
    :param (bool) show_colorbar: determines if colorbar will be visible.
        Only applies if values in the index column are numeric.
    :param (bool) show_hover_fill: enables/disables the hovertext for the
        filled area of the chart.
    :param (bool) reverse_colors: reverses the order of selected colors
    :param (str) title: the title of the chart
    :param (float) bar_width: the width of the horizontal bars in the plot
    :param (bool) showgrid_x: show/hide the x-axis grid
    :param (bool) showgrid_y: show/hide the y-axis grid
    :param (float) height: the height of the chart
    :param (float) width: the width of the chart

    Example 1: Simple Gantt Chart

    >>> from plotly.figure_factory import create_gantt

    >>> # Make data for chart
    >>> df = [dict(Task="Job A", Start='2009-01-01', Finish='2009-02-30'),
    ...       dict(Task="Job B", Start='2009-03-05', Finish='2009-04-15'),
    ...       dict(Task="Job C", Start='2009-02-20', Finish='2009-05-30')]

    >>> # Create a figure
    >>> fig = create_gantt(df)
    >>> fig.show()


    Example 2: Index by Column with Numerical Entries

    >>> from plotly.figure_factory import create_gantt

    >>> # Make data for chart
    >>> df = [dict(Task="Job A", Start='2009-01-01',
    ...            Finish='2009-02-30', Complete=10),
    ...       dict(Task="Job B", Start='2009-03-05',
    ...            Finish='2009-04-15', Complete=60),
    ...       dict(Task="Job C", Start='2009-02-20',
    ...            Finish='2009-05-30', Complete=95)]

    >>> # Create a figure with Plotly colorscale
    >>> fig = create_gantt(df, colors='Blues', index_col='Complete',
    ...                    show_colorbar=True, bar_width=0.5,
    ...                    showgrid_x=True, showgrid_y=True)
    >>> fig.show()


    Example 3: Index by Column with String Entries

    >>> from plotly.figure_factory import create_gantt

    >>> # Make data for chart
    >>> df = [dict(Task="Job A", Start='2009-01-01',
    ...            Finish='2009-02-30', Resource='Apple'),
    ...       dict(Task="Job B", Start='2009-03-05',
    ...            Finish='2009-04-15', Resource='Grape'),
    ...       dict(Task="Job C", Start='2009-02-20',
    ...            Finish='2009-05-30', Resource='Banana')]

    >>> # Create a figure with Plotly colorscale
    >>> fig = create_gantt(df, colors=['rgb(200, 50, 25)', (1, 0, 1), '#6c4774'],
    ...                    index_col='Resource', reverse_colors=True,
    ...                    show_colorbar=True)
    >>> fig.show()


    Example 4: Use a dictionary for colors

    >>> from plotly.figure_factory import create_gantt
    >>> # Make data for chart
    >>> df = [dict(Task="Job A", Start='2009-01-01',
    ...            Finish='2009-02-30', Resource='Apple'),
    ...       dict(Task="Job B", Start='2009-03-05',
    ...            Finish='2009-04-15', Resource='Grape'),
    ...       dict(Task="Job C", Start='2009-02-20',
    ...            Finish='2009-05-30', Resource='Banana')]

    >>> # Make a dictionary of colors
    >>> colors = {'Apple': 'rgb(255, 0, 0)',
    ...           'Grape': 'rgb(170, 14, 200)',
    ...           'Banana': (1, 1, 0.2)}

    >>> # Create a figure with Plotly colorscale
    >>> fig = create_gantt(df, colors=colors, index_col='Resource',
    ...                    show_colorbar=True)

    >>> fig.show()

    Example 5: Use a pandas dataframe

    >>> from plotly.figure_factory import create_gantt
    >>> import pandas as pd

    >>> # Make data as a dataframe
    >>> df = pd.DataFrame([['Run', '2010-01-01', '2011-02-02', 10],
    ...                    ['Fast', '2011-01-01', '2012-06-05', 55],
    ...                    ['Eat', '2012-01-05', '2013-07-05', 94]],
    ...                   columns=['Task', 'Start', 'Finish', 'Complete'])

    >>> # Create a figure with Plotly colorscale
    >>> fig = create_gantt(df, colors='Blues', index_col='Complete',
    ...                    show_colorbar=True, bar_width=0.5,
    ...                    showgrid_x=True, showgrid_y=True)
    >>> fig.show()
    r   z·In order to use an indexing column and assign colors to the values of the index, you must choose an actual column name in the dataframe or key if a list of dictionaries is being used.ÚrgbTzŸError. You have set colors to a dictionary but have not picked an index. An index is required if you are assigning colors to particular values in a dictionary.N)r‡   rˆ   rz   r‰   rŠ   r‹   )r‡   rˆ   rz   r‰   rŠ   )r*   r   r   r"   r   Úvalidate_indexr   r$   r¢   Úvalidate_colors_dictÚvalidate_colorsr|   r–   r²   r·   )r%   rƒ   r©   r‹   Úreverse_colorsrg   r„   r…   r†   rh   ri   r‡   rˆ   rz   r‰   rŠ   r(   Ú
index_listÚ
dictionaryr•   s                       r   Úcreate_ganttrÃ   !  sù  € õb ˜2ÑÔ€Eàð )Ø˜E !œHÐ$Ð$ÝÔ(ð.ñô ð ð ˆ
Øð 	5ð 	5ˆJØ×Ò˜j¨Ô3Ñ4Ô4Ð4Ð4ÝÔ˜ZÑ(Ô(Ð(õ �&�$ÑÔð 5ÝÔ*¨6°5Ñ9Ô9ˆˆåÔ% f¨eÑ4Ô4ˆà˜ÐÐØ�ŠÑÔÐàð >Ý�f�dÑ#Ô#ð 	ÝÔ(ðIñô ð õ
 ØØØØØØØØØØØØ#Ø+Ø'ð
ñ 
ô 
ˆð  ˆ
å˜&¥$Ñ'Ô'ð %	Ý"ØØØØØØØØØØØØØØ'Ø /ðñ ô ˆCð" ˆJåØØØØØØØØØØØØØØ'Ø /ðñ ô ˆCð" ˆJr   )NNNFTT)NNNFT)NNFFr¸   r¹   FFrº   NNNNFT)Únumbersr   r}   Úplotlyr   r   Úplotly.colorsrƒ   r¢   Úplotly.figure_factoryr   Úplotly.graph_objectsÚgraph_objectsr�   Ú
get_moduler   r   r   r*   r–   r²   r·   rÃ   r   r   r   ú<module>rË      s€  ðØ Ð Ð Ð Ð Ð à €€€à /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ø Ð Ð Ð Ð Ð Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø !Ð !Ð !Ð !Ð !Ð !à ÐÔ  Ñ*Ô*€à1Ð1Ð1Ð ð0ð 0ð 0ð$ð $ð $ð` ØØ	ØØØðxð xð xð xðL ØØ	ØØðSð Sð Sð SðB ØØ	ØØðIð Ið Ið Ið\ ØØØØ
ØØØØØ
Ø
ØØ	ØØð!ið ið ið ið ið ir   