Ë
    {�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y)é    )Ú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       úZ/var/www/skyplay_api_hub/venv/lib/python3.12/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 ]=  }|| vsŒt        j                  dj                  dj                  t
        «      «      «      ‚ t        | j                  «      }g }t        |«      D ]1  }i }| D ]  }| j                  |   |   ||<   Œ |j                  |«       Œ3 |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*      s1  € õ 
Œj˜œRŸW™WŸ]™]×4Ñ4Ô5ä&ò 	ˆCØ˜"Š}Ü ×,Ñ,ð*ß*0©&°·±Ô;NÓ1OÓ*Póð ð	ô ˜"Ÿ(™(“mˆØˆÜ˜;Ó'ò 	$ˆEØˆIØò 5�Ø!#§¡¨¡°Ñ!4�	˜#’ð5à�L‰L˜Õ#ð		$ð ˆô �bœ$ÔÜ×$Ñ$ØMó
ð 	
ô
 ˆ2ƒw�!‚|Ü×$Ñ$ØMó
ð 	
ô �b˜‘eœTÔ"Ü×$Ñ$Ð%SÓTÐTØ€Ir   c                 óÈ  — |€g }|	€g }	|
€g }
t        t        | «      «      D ]E  }t        | |   d   | |   d   | |   d   ¬«      }d| |   v r| |   d   |d<   |j                  |«       ŒG t        «       }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sŒ|	j                  |«       Œ$ |r|	j	                  «        d}t        t        |«      «      D �]B  }||   d   }||   d= |}|r|	j                  |«      }||z
  ||   d<   ||z   ||   d<   |t        |«      k\  rd}||   ||   d<   ||   d   }||vrt        j                  |«      ||<   |||   d<   t        |«      ||   d<   |||   d<   t        ||   d   «      dkD  r7||   d   j                  ||   d   d   «       ||   d   j                  d«       t        ||   d   ||   d   ||   d   ||   d   «      \  }}||   dxx   |z  cc<   ||   dxx   |z  cc<   ||vr+t        j                  |«      ||<   |||   d   d<   |||   d<   ||   d   j                  ||   d   «       ||   d   j                  ||   d   «       ||   d   j                  |«       ||   d   j                  |«       d||   v rA||   d   j                  ||   d   «       ||   d   j                  ||   d   «       ||   d= n.||   d   j                  d«       ||   d   j                  d«       |dz  }�ŒE |}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«      }t        |«      D �cg c]  }||   ‘Œ	 }
}|
t        |«      D �cg c]  }||   ‘Œ	 c}z  }
t        j                  |
|¬5«      }|S c c}w c c}w )6z/
    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Úxaxis©Ú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_namesro   Úgroup_tasksÚshow_hover_fillÚshow_colorbarr   ÚtaskÚscatter_data_dictÚmarker_data_dictr7   Úscatter_data_templateÚmarker_data_templateÚtnÚcolor_indexÚgroupIDÚcolor_idÚxsÚysrB   rp   ÚkÚfigs                                  r   ÚganttrŽ   D   s�  € ð& €}ØˆØÐØˆ
Ø€|Øˆä”s˜5“zÓ"ò ˆÜØ�U‰|˜GÑ$Ø�U‰|˜HÑ%Ø�u‘˜fÑ%ô
ˆð
 ˜E %™LÑ(Ø"'¨¡,¨}Ñ"=ˆD�ÑØ�‰�TÕðô ›ÐÜ“vÐáØ‰	àˆ	ð ØØØØñÐð ØØØÜ˜R a°Ô3ØØñÐô ”s˜5“zÓ"ò "ˆØ�5‰\˜&Ñ!ˆñ ˜b¨
Ò2Ø×Ñ˜bÕ!ð"ñ Ø×ÑÔà€KÜ”s˜5“zÓ"ó >ˆØ�5‰\˜&Ñ!ˆØ�%‰L˜Ð ð ˆÙØ ×&Ñ& rÓ*ˆGØ$ yÑ0ˆˆe‰�TÑØ$ yÑ0ˆˆe‰�TÑð œ#˜f›+Ò%ØˆKØ$*¨;Ñ$7ˆˆe‰�[Ñ!Ø˜‘< Ñ,ˆàÐ,Ñ,Ü*.¯-©-Ð8MÓ*NÐ˜hÑ'à3;Ð˜(Ñ# KÑ0Ü.1°"«gÐ˜(Ñ# FÑ+Ø5=Ð˜(Ñ# MÑ2ô Ð  Ñ*¨3Ñ/Ó0°1Ò4à˜hÑ'¨Ñ,×3Ñ3Ø! (Ñ+¨CÑ0°Ñ4ôð ˜hÑ'¨Ñ,×3Ñ3°DÔ9ä#Ø�%‰L˜ÑØ�%‰L˜ÑØ�%‰L˜ÑØ�%‰L˜Ñó	
‰ˆˆBð 	˜(Ñ# CÓ(¨BÑ.Ó(Ø˜(Ñ# CÓ(¨BÑ.Ó(ð Ð+Ñ+Ü)-¯©Ð7KÓ)LÐ˜XÑ&Ø<DÐ˜XÑ& xÑ0°Ñ9Ø8@Ð˜XÑ& }Ñ5à˜Ñ" 3Ñ'×.Ñ.¨u°U©|¸DÑ/AÔBØ˜Ñ" 3Ñ'×.Ñ.¨u°U©|¸DÑ/AÔBØ˜Ñ" 3Ñ'×.Ñ.¨wÔ7Ø˜Ñ" 3Ñ'×.Ñ.¨wÔ7à˜E %™LÑ(Ø˜XÑ& vÑ.×5Ñ5°e¸E±lÀ=Ñ6QÔRØ˜XÑ& vÑ.×5Ñ5°e¸E±lÀ=Ñ6QÔRØ�e‘˜]Ñ+à˜XÑ& vÑ.×5Ñ5°dÔ;Ø˜XÑ& vÑ.×5Ñ5°dÔ;à�qÑŠð}>ð@ €JäØØØØØØÜØØÜœ%¤ J£Ó0Ó1Ø”s˜:“¨Ñ*Ð+ØØô
ô ØØÜÜä 1¨D°uÀzÔRÜ 1¨D°wÈÔTÜ 1¨D°wÈÔTÜ 1¨E¸ÈÔRÜ 1¨D°vÈ
ÔSÜ %Ô(ðó	ôð ô
ô €FôD +1Ð1BÓ*CÖD QÐ˜aÓ ÐD€DÐDØ¬&Ð1AÓ*BÖC QÐ˜aÓ ÒCÑC€Dô
 �)‰)˜ fÔ
-€CØ€Jùò EùÚCs   ÐQÐ0Qc                 ó¨  — |
€g }
|€g }|€g }d}t        t        | «      «      D ]E  }t        | |   d   | |   d   | |   d   ¬«      }d| |   v r| |   d   |d<   |
j                  |«       ŒG t        «       }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 ]$  }| |   |   |vsŒ|j                  | |   |   «       Œ& |j	                  «        t        | d   |   t        «      �rŸt        |«      dk  rt        j                  d«      ‚t        t        |
«      «      D ]"  }|
|   d	   }|r||vsŒ|j                  |«       Œ$ |r|j                  «        t        t        |
«      «      D �]É  }|
|   d	   }|
|   d	= |}|r|j                  |«      }||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kD  r7||   d   j                  ||   d   d   «       ||   d   j                  d«       t'        |
|   d   |
|   d   |
|   d   |
|   d   «      \  } }!||   dxx   | z  cc<   ||   dxx   |!z  cc<   ||vr+t!        j"                  |«      ||<   |||   d    d!<   |||   d<   ||   d   j                  |
|   d   «       ||   d   j                  |
|   d   «       ||   d   j                  |«       ||   d   j                  |«       d|
|   v rB||   d"   j                  |
|   d   «       ||   d"   j                  |
|   d   «       |
|   d= �Œœ||   d"   j                  d«       ||   d"   j                  d«       �ŒÌ |d#u rLt)        |j+                  «       «      d   }"||"   d    j-                  t        d|d   gd|d   ggd#d$d¬%«      «       t        | d   |   t$        «      �rzg }t        t        |
«      «      D ]$  }| |   |   |vsŒ|j                  | |   |   «       Œ& |j	                  «        t        |«      t        |«      k  rt        j                  d&«      ‚i }#d}$|D ]"  }%|$t        |«      dz
  kD  rd}$||$   |#|%<   |$dz  }$Œ$ t        t        |
«      «      D ]"  }|
|   d	   }|r||vsŒ|j                  |«       Œ$ |r|j                  «        t        t        |
«      «      D �]^  }|
|   d	   }|
|   d	= |}|r|j                  |«      }||z
  |
|   d<   ||z   |
|   d<   |#| |   |      |
|   d<   |
|   d   }||vrt!        j"                  |«      ||<   |||   d<   |||   d<   t%        | |   |   «      ||   d	<   t        j                  |t        j                  «      }t        ||   d   «      dkD  r7||   d   j                  ||   d   d   «       ||   d   j                  d«       t'        |
|   d   |
|   d   |
|   d   |
|   d   «      \  } }!||   dxx   | z  cc<   ||   dxx   |!z  cc<   ||vr+t!        j"                  |«      ||<   |||   d    d!<   |||   d<   ||   d   j                  |
|   d   «       ||   d   j                  |
|   d   «       ||   d   j                  |«       ||   d   j                  |«       d|
|   v rB||   d"   j                  |
|   d   «       ||   d"   j                  |
|   d   «       |
|   d= �Œ1||   d"   j                  d«       ||   d"   j                  d«       �Œa |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:¬;«      ¬<«      }&t/        |«      D �"cg c]  }"||"   ‘Œ	 }}"|t/        |«      D �"cg c]  }"||"   ‘Œ	 c}"z  }t1        j2                  ||&¬=«      }'|'S c c}"w c c}"w )>ú=
    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   rn   )r    r   r$   r"   Úsortr   r   r   r   rq   r   ÚclrsÚcolor_parserÚunlabel_rgbÚfind_intermediate_colorÚ	label_rgbrr   rs   rt   r   r#   ÚkeysÚupdateru   rv   rw   )(r(   rx   rg   Ú	index_colr€   ry   rz   r{   rh   ri   r|   r}   ro   r~   r   rB   r   r�   r‚   rƒ   r7   r„   r…   Ú
index_valsÚrowr†   rˆ   ÚlowcolorÚ	highcolorÚintermedÚintermed_colorr‰   rŠ   r‹   rŒ   Úindex_vals_dictÚc_indexr&   rp   r�   s(                                           r   Úgantt_colorscaler¨   ÿ   sd  € ð( €}ØˆØÐØˆ
Ø€|ØˆØ€Jä”s˜5“zÓ"ò ˆÜØ�U‰|˜GÑ$Ø�U‰|˜HÑ%Ø�u‘˜fÑ%ô
ˆð
 ˜E %™LÑ(Ø"'¨¡,¨}Ñ"=ˆD�ÑØ�‰�TÕðô ›Ðä“vÐáØ‰	àˆ	ð ØØØØØØñÐð ØØØÜ˜R a°Ô3ØØØñ	Ðð €JÜ”S˜“ZÓ ò 5ˆØ�‰:�iÑ ¨
Ò2Ø×Ñ˜e C™j¨Ñ3Õ4ð5ð ‡O�OÔô �%˜‘(˜9Ñ%¤vÕ.äˆv‹;˜Š?Ü×(Ñ(ð*óð ô œ3˜u›:Ó&ò 	&ˆEØ�u‘˜fÑ%ˆBñ  "¨JÒ"6Ø×!Ñ! "Õ%ð	&ñ Ø×ÑÔ äœ3˜u›:Ó&ó 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Ñ9¸(ÀIÈxÓXˆNÜ!×.Ñ.¨~¼t¿~¹~ÓNˆNØ(6ˆE�%‰L˜Ñ%Ø˜U‘| KÑ0ˆHàÐ0Ñ0Ü.2¯m©mÐ<QÓ.RÐ! (Ñ+à7?Ð˜hÑ'¨Ñ4Ü25°e¸E±lÀ9Ñ6MÓ2NÐ˜hÑ'¨Ñ/Ø9AÐ˜hÑ'¨Ñ6ô ×&Ñ& v¬t¯~©~Ó>ˆFô Ð$ XÑ.¨sÑ3Ó4°qÒ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Ð  Ñ*Ø@HÐ  Ñ*¨8Ñ4°WÑ=Ø<DÐ  Ñ*¨=Ñ9à˜XÑ& sÑ+×2Ñ2°5¸±<ÀÑ3EÔFØ˜XÑ& sÑ+×2Ñ2°5¸±<ÀÑ3EÔFØ˜XÑ& sÑ+×2Ñ2°7Ô;Ø˜XÑ& sÑ+×2Ñ2°7Ô;à  e¡Ñ,Ø  Ñ*¨6Ñ2×9Ñ9¸%À¹,À}Ñ:UÔVØ  Ñ*¨6Ñ2×9Ñ9¸%À¹,À}Ñ:UÔVØ˜%‘L Ò/à  Ñ*¨6Ñ2×9Ñ9¸$Ô?Ø  Ñ*¨6Ñ2×9Ñ9¸$Ö?ðID	@ðN ˜DÑ ÜÐ%×*Ñ*Ó,Ó-¨aÑ0ˆAØ˜QÑ Ñ)×0Ñ0ÜØ!" F¨1¡I °°F¸1±I°Ð?Ø"ØØô	ôô �%˜‘(˜9Ñ%¤sÕ+Øˆ
Üœ˜U›Ó$ò 	9ˆCØ�S‰z˜)Ñ$¨JÒ6Ø×!Ñ! %¨¡*¨YÑ"7Õ8ð	9ð 	�‰Ôäˆv‹;œ˜Z›Ò(Ü×(Ñ(ðóð ð ˆàˆØò 	ˆCØœ˜V› q™Ò(Ø�Ø#)¨'¡?ˆO˜CÑ Ø�q‰L‰Gð		ô œ3˜u›:Ó&ò 	&ˆEØ�u‘˜fÑ%ˆBñ  "¨JÒ"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Ü.2¯m©mÐ<QÓ.RÐ! (Ñ+à7?Ð˜hÑ'¨Ñ4Ø9AÐ˜hÑ'¨Ñ6Ü25°e¸E±lÀ9Ñ6MÓ2NÐ˜hÑ'¨Ñ/ô ×&Ñ& v¬t¯~©~Ó>ˆFô Ð$ XÑ.¨sÑ3Ó4°qÒ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Ð  Ñ*Ø@HÐ  Ñ*¨8Ñ4°WÑ=Ø<DÐ  Ñ*¨=Ñ9à˜XÑ& sÑ+×2Ñ2°5¸±<ÀÑ3EÔFØ˜XÑ& sÑ+×2Ñ2°5¸±<ÀÑ3EÔFØ˜XÑ& sÑ+×2Ñ2°7Ô;Ø˜XÑ& sÑ+×2Ñ2°7Ô;à  e¡Ñ,Ø  Ñ*¨6Ñ2×9Ñ9¸%À¹,À}Ñ:UÔVØ  Ñ*¨6Ñ2×9Ñ9¸%À¹,À}Ñ:UÔVØ˜%‘L Ò/à  Ñ*¨6Ñ2×9Ñ9¸$Ô?Ø  Ñ*¨6Ñ2×9Ñ9¸$Ö?ðy<	@ð| ˜DÑ ØˆJØ&ò @�Ø5?Ð! !Ñ$ \Ò2ð@ô ØØØØØØÜØØÜœ%¤ J£Ó0Ó1Ø”s˜:“¨Ñ*Ð+ØØô
ô ØØÜÜä 1¨D°uÀzÔRÜ 1¨D°wÈÔTÜ 1¨D°wÈÔTÜ 1¨E¸ÈÔRÜ 1¨D°vÈ
ÔSÜ %Ô(ðó	ôð ô
ô €FôD +1Ð1BÓ*CÖD QÐ˜aÓ ÐD€DÐDØ¬&Ð1AÓ*BÖC QÐ˜aÓ ÒCÑC€Dô
 �)‰)˜ fÔ
-€CØ€Jùò EùÚCs   äe
ä ec                 ó¤	  — |
€g }
|€g }|€g }d}t        t        | «      «      D ]E  }t        | |   d   | |   d   | |   d   ¬«      }d| |   v r| |   d   |d<   |
j                  |«       ŒG t        «       }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 ]$  }| |   |   |vsŒ|j                  | |   |   «       Œ& |j	                  «        |D ]  }||vsŒt        j                  d«      ‚ t        t        |
«      «      D ]"  }|
|   d	   }|r||vsŒ|j                  |«       Œ$ |r|j                  «        t        t        |
«      «      D �]#  }|
|   d	   }|
|   d	= |}|r|j                  |«      }||z
  |
|   d<   ||z   |
|   d<   || |   |      |
|   d<   |
|   d   }||vrt        j                  |«      ||<   |||   d<   |||   d<   t        ||   d   «      dkD  r7||   d   j                  ||   d   d   «       ||   d   j                  d«       t        |
|   d   |
|   d   |
|   d   |
|   d   «      \  }}||   dxx   |z  cc<   ||   dxx   |z  cc<   ||vr+t        j                  |«      ||<   |||   d   d<   |||   d<   ||   d   j                  |
|   d   «       ||   d   j                  |
|   d   «       ||   d   j                  |«       ||   d   j                  |«       d|
|   v rB||   d    j                  |
|   d   «       ||   d    j                  |
|   d   «       |
|   d= �Œö||   d    j                  d«       ||   d    j                  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«      } t        |«      D �!cg c]  }!||!   ‘Œ	 }}!|t        |«      D �!cg c]  }!||!   ‘Œ	 c}!z  }t        j                   || ¬7«      }"|"S c c}!w c c}!w )8r�   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   rn   )r    r   r$   r"   r—   r   r   rq   r   rr   rs   r   rt   r#   ru   rv   rw   )#r(   rx   rg   rŸ   r€   ry   rz   r{   rh   ri   r|   r}   ro   r~   r   rB   r   r�   r‚   rƒ   r7   r„   r…   r    r¡   r&   r†   rˆ   r‰   rŠ   r‹   Úindex_valuerp   rŒ   r�   s#                                      r   Ú
gantt_dictr«   U  s$  € ð* €}ØˆØÐØˆ
Ø€|ØˆØ€Jä”s˜5“zÓ"ò ˆÜØ�U‰|˜GÑ$Ø�U‰|˜HÑ%Ø�u‘˜fÑ%ô
ˆð
 ˜E %™LÑ(Ø"'¨¡,¨}Ñ"=ˆD�ÑØ�‰�TÕðô ›Ðä“vÐáØ‰	àˆ	ð ØØØØØñÐð ØØØÜ˜R a°Ô3ØØñÐð €JÜ”S˜“ZÓ ò 5ˆØ�‰:�iÑ ¨
Ò2Ø×Ñ˜e C™j¨Ñ3Õ4ð5ð ‡O�OÔð ò ˆØ�fÒÜ×(Ñ(ðCóð ðô ”s˜5“zÓ"ò "ˆØ�5‰\˜&Ñ!ˆñ ˜b¨
Ò2Ø×Ñ˜bÕ!ð"ñ Ø×ÑÔä”s˜5“zÓ"ó 8<ˆØ�5‰\˜&Ñ!ˆØ�%‰L˜Ð ð ˆÙØ ×&Ñ& rÓ*ˆGØ$ yÑ0ˆˆe‰�TÑØ$ yÑ0ˆˆe‰�TÑà$*¨5°©<¸	Ñ+BÑ$Cˆˆe‰�[Ñ!Ø˜‘< Ñ,ˆàÐ,Ñ,Ü*.¯-©-Ð8MÓ*NÐ˜hÑ'à5=Ð˜(Ñ# MÑ2Ø3;Ð˜(Ñ# KÑ0ô Ð  Ñ*¨3Ñ/Ó0°1Ò4à˜hÑ'¨Ñ,×3Ñ3Ø! (Ñ+¨CÑ0°Ñ4ôð ˜hÑ'¨Ñ,×3Ñ3°DÔ9ä#Ø�%‰L˜ÑØ�%‰L˜ÑØ�%‰L˜ÑØ�%‰L˜Ñó	
‰ˆˆBð 	˜(Ñ# CÓ(¨BÑ.Ó(Ø˜(Ñ# CÓ(¨BÑ.Ó(ð Ð+Ñ+Ü)-¯©Ð7KÓ)LÐ˜XÑ&Ø<DÐ˜XÑ& xÑ0°Ñ9Ø8@Ð˜XÑ& }Ñ5à˜Ñ" 3Ñ'×.Ñ.¨u°U©|¸DÑ/AÔBØ˜Ñ" 3Ñ'×.Ñ.¨u°U©|¸DÑ/AÔBØ˜Ñ" 3Ñ'×.Ñ.¨wÔ7Ø˜Ñ" 3Ñ'×.Ñ.¨wÔ7à˜E %™LÑ(Ø˜XÑ& vÑ.×5Ñ5°e¸E±lÀ=Ñ6QÔRØ˜XÑ& vÑ.×5Ñ5°e¸E±lÀ=Ñ6QÔRØ�e‘˜]Ò+à˜XÑ& vÑ.×5Ñ5°dÔ;Ø˜XÑ& vÑ.×5Ñ5°dÖ;ðq8<ðt ˜ÑØˆ
à!ò JˆÜ9<¸[Ó9IÐ˜& Ñ-Ñ.¨vÒ6ðJô ØØØØØØÜØØÜœ%¤ J£Ó0Ó1Ø”s˜:“¨Ñ*Ð+ØØô
ô ØØÜÜä 1¨D°uÀzÔRÜ 1¨D°wÈÔTÜ 1¨D°wÈÔTÜ 1¨E¸ÈÔRÜ 1¨D°vÈ
ÔSÜ %Ô(ðó	ôð ô
ô €FôD +1Ð1BÓ*CÖD QÐ˜aÓ ÐD€DÐDØ¬&Ð1AÓ*BÖC QÐ˜aÓ ÒCÑC€Dô
 �)‰)˜ fÔ
-€CØ€Jùò EùÚCs   ÒSÒSc                 ón  — t        | «      }|rN||d   vrt        j                  d«      ‚g }|D ]  }|j                  ||   «       Œ t	        j
                  |«       t        |t        «      rt        j                  |d«      }nt        j                  |d«      }|du r|j                  «        |s@t        |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}   ro   r~   r   r€   )r|   r}   ro   r~   r   )r*   r   r   r"   r   Úvalidate_indexr   r$   r˜   Úvalidate_colors_dictÚvalidate_colorsrq   rŽ   r¨   r«   )r%   rx   rŸ   r€   Úreverse_colorsrg   ry   rz   r{   rh   ri   r|   r}   ro   r~   r   r(   Ú
index_listÚ
dictionaryr�   s                       r   Úcreate_ganttr´   !  s˜  € ôb ˜2Ó€EáØ˜E !™HÑ$Ü×(Ñ(ð.óð ð ˆ
Øò 	5ˆJØ×Ñ˜j¨Ñ3Õ4ð	5ä×Ñ˜ZÔ(ô �&œ$ÔÜ×*Ñ*¨6°5Ó9‰ä×%Ñ% f¨eÓ4ˆà˜ÑØ�‰ÔáÜ�fœdÔ#Ü×(Ñ(ðIóð ô
 ØØØØØØØØØØØØ#Ø+Ø'ô
ˆð  ˆ
ä˜&¤$Ô'Ü"ØØØØØØØØØØØØØØ'Ø /ôˆCð" ˆJäØØØØØØØØØØØØØØ'Ø /ôˆCð" ˆJr   )NNNFTT)NNNFT)NNFFzGantt Chartgš™™™™™É?FFiX  NNNNFT)Únumbersr   rr   Úplotlyr   r   Úplotly.colorsrx   r˜   Úplotly.figure_factoryr   Úplotly.graph_objectsÚgraph_objectsrv   Ú
get_moduler   r   r   r*   rŽ   r¨   r«   r´   r   r   r   ú<module>r¼      s»   ðÝ ã ç /Ý Ý 'Ý !à Ð× Ñ  Ó*€â1Ð ò0ò$ð` ØØ	ØØØóxðL ØØ	ØØóSðB ØØ	ØØóIð\ ØØØØ
ØØØØØ
Ø
ØØ	ØØô!ir   