*L iY&BdZdZdZdZdZd dZdZdZdZd Z y ) ctt|dk(r tdtt|t|z S)Nzx must have positive length)len ValueErrorfloatsumxs \/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/plotly/shapeannotation.py_meanr s0 1v{677 Q=3q6 !!c<tt|dddS)Nc |dSNts r z_argmin.. adr )keyrsorted enumeraters r _argminr s )A,N 3A 6q 99r c>tt|ddddS)Nc |dSrrrs r rz_argmax..rr T)rreverserrrs r _argmaxrs )A,ND A! DQ GGr c"t||||dS)zDefault annotation parametersF)xanchoryanchorr y showarrow)dict)r r!r r"s r _df_annor%s Ae LLr c8d|vsd|vs|jd|S)Ninsideoutside)add)poss r _add_inside_to_positionr+s! OyC/  Jr cd|d}|}t|jd}|r t|}||fS)Nz top right )setsplitr+)positionprepend_insidepos_strs r _prepare_positionr3s=G8>>#&'H*84 W r cv|d}|d}|d}|d}||g}||g}d} d} d} d} d } d }t|}t|}t|}t|}t |}t|}t|}t|}t|}t |}t |\}}|d k(r|t ddgk(rt| | |||S|t ddgk(rt| | |||S|t dgk(rt| | |||S|t d dgk(rt| | |||S|t d dgk(rt| | |||S|t d gk(rt| | |||S|t dgk(rt| |||S|t dgk(rt| |||S|d k(r|t ddgk(rt| | |||S|t ddgk(rt| | |||S|t dgk(rt| | ||S|t d dgk(rt| | |||S|t d dgk(rt| | |||S|t d gk(rt| | ||S|t dgk(rt| ||||S|t dgk(rt| ||||Std |d)Nx0x1y0y1righttopleftcenterbottommiddlevlinehlinezInvalid annotation position "") maxminr rrr3r.r%r) shape_type shape_argsr0r5r6r7r8XYRTLCBMaYiYeYaaYaiYaXiXeXaaXaiXr2s r annotation_params_for_linerX's! D B D B D B D B RA RAA AAAAA QB QB qB !*C !*C QB QB qB !*C !*C)(3HgW sE6?+ +Aq!C&"- - sE7+, ,Aq!C&"- - sE7| #Aq!C&"- - sHf-. .Aq!C&"- - sHg./ /Aq!C&"- - sH: &Aq!C&"- - sF8} $Aq"b) ) sG9~ %Aq"b) ) w  sE6?+ +Aq"af- - sE7+, ,Aq"af- - sE7| #Aq"b) ) sHf-. .Aq"af- - sHg./ /Aq"af- - sH: &Aq"b) ) sF8} $Aq"af- - sG9~ %Aq"af- - 7D EEr c |d}|d}|d}|d}t|d\}}|tgdk(r$tdd t||gt ||gS|tgd k(r$td d t ||gt ||gS|td d gk(r$td d t ||gt ||gS|tgdk(r$tddt||gt||gS|tgdk(r$td dt ||gt||gS|td dgk(r$td dt ||gt||gS|td dgk(r$tddt||gt ||gS|td d gk(r$td dt ||gt ||gS|td gk(r$td dt ||gt ||gS|tgdk(r2t|dk(rd nd|dk(rdnd t||gt ||gS|tgdk(r2t|dk(rdnd |dk(rdnd t ||gt ||gS|tdd gk(r$td dt ||gt ||gS|tgdk(r2t|dk(rd nd|dk(rd ndt||gt||gS|tgdk(r2t|dk(rdnd |dk(rd ndt ||gt||gS|tddgk(r$td d t ||gt||gS|tddgk(r$td dt||gt ||gS|tdd gk(r$tddt ||gt ||gSt d|)Nr5r6r7r8T)r1)r'r:r;r;r:)r'r:r9r9r'r<)r'r=r;r=)r'r=r9r>)r(r:r;vrecthrect)r(r:r9r()r(r=r;)r(r=r9zInvalid annotation position )r3r.r%rCrBr r)rDrEr0r5r6r7r8r2s r annotation_params_for_rectr\hs D B D B D B D B)(4HHg3011sB8}c2r(mDD3122RH sB8}EE3%())%Bx#r2h-HH3344#r2h-b"XGG34553Bx=#r2h-HH3(+,,(E2r(OS"b]KK3&)**#r2h-BxII3'*++3Bx=%R/JJ3z?"(E2r(OUB8_MM3122!W,G&"g-H5 RM RM   3233 G+F"g-H5 RM RM   3 5)**(E2r(OS"b]KK3455!W,G&7*E RM RM   3566 G+F7*E RM RM   3 8,--%Bx#r2h-HH3 6*++3Bx=%R/JJ3 7+,,#r2h-BxII B CCr c d t }tt fd|j}|t|dk(ry| t }|D]}|dk(r ||d}||||<d}d|jvr|d}|j drt |||} n|j dr t|||}  jD]}||vs|| | |||<|S)a8 annotation: a go.layout.Annotation object, a dict describing an annotation, or None shape_type: one of 'vline', 'hline', 'vrect', 'hrect' and determines how the x, y, xanchor, and yanchor values are set. shape_args: the parameters used to draw the shape, which are used to place the annotation kwargs: a dictionary that was the kwargs of a _process_multiple_axis_spanning_shapes spanning shapes call. Items in this dict whose keys start with 'annotation_' will be extracted and the keys with the 'annotation_' part stripped off will be used to assign properties of the new annotation. Property precedence: The annotation's x, y, xanchor, and yanchor properties are set based on the shape_type argument. Each property already specified in the annotation or through kwargs will be left as is (not replaced by the value computed using shape_type). Note that the xref and yref properties will in general get overwritten if the result of this function is passed to an add_annotation called with the row and col parameters specified. Returns an annotation populated with fields based on the annotation_position, annotation_ prefixed kwargs or the original annotation passed in to this function. annotation_c&|jS)N) startswith)kprefixs r rz0axis_spanning_shape_annotation..sALL,@r Nrannotation_positionlinerect)rlistfilterkeysr$endswithrXr\) annotationrDrEkwargs len_prefixannotation_keysrasubkrc shape_dictrbs @r axis_spanning_shape_annotationrps)2FVJ6"@&++-PQOc/2a7V % % % ~!!9 4 % -$%:;6"/  $7    V $/  $7 __ * Z Z]%:&qMJqM * r ct}t}|jD]$}|j|r ||||<||||<&||fS)z Returns two dictionaries, one containing all the items whose keys do not start with a prefix and another containing all the items whose keys do start with the prefix. Note that the prefix is not removed from the keys. )r$rhr`)drb no_prefix with_prefixras r split_dict_by_key_prefixrusZ I&K VVX  << qTKNQ4IaL  { ##r N)F) r rrr%r+r3rXr\rprurr r rvs>" :HM  >FB>DB=@ $r