echarts-a77f8af6.js 1.2 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135
  1. import{i as t,r as e,m as n,a as i,b as o,c as r,e as a,d as s,f as l,g as u,h as c,j as d,k as h,l as p,n as f,P as g,o as y,p as m,q as v,s as x,t as _,Z as b,u as S,v as w,w as M,x as I,y as D,z as T,A as C,B as A,T as L,C as k,D as P,E as N,F as O,G as R,S as E,R as V,H as z,I as B,J as G,L as F,K as W,M as H,N as Y,O as U,Q as Z,U as X,V as j,W as q,X as K,Y as J,_ as $,$ as Q,a0 as tt,a1 as et,a2 as nt,a3 as it,a4 as ot,a5 as rt,a6 as at,a7 as st,a8 as lt,a9 as ut,aa as ct,ab as dt,ac as ht,ad as pt,ae as ft,af as gt,ag as yt,ah as mt,ai as vt,aj as xt,ak as _t,al as bt,am as St,an as wt,ao as Mt,ap as It,aq as Dt,ar as Tt,as as Ct,at as At,au as Lt,av as kt,aw as Pt,ax as Nt,ay as Ot,az as Rt,aA as Et,aB as Vt,aC as zt,aD as Bt,aE as Gt,aF as Ft,aG as Wt,aH as Ht,aI as Yt,aJ as Ut,aK as Zt,aL as Xt,aM as jt,aN as qt,aO as Kt,aP as Jt,aQ as $t,aR as Qt,aS as te,aT as ee,aU as ne,aV as ie,aW as oe,aX as re,aY as ae,aZ as se,a_ as le,a$ as ue,b0 as ce,b1 as de,b2 as he,b3 as pe,b4 as fe,b5 as ge,b6 as ye,b7 as me,b8 as ve,b9 as xe,ba as _e,bb as be,bc as Se,bd as we,be as Me,bf as Ie,bg as De,bh as Te,bi as Ce,bj as Ae,bk as Le,bl as ke,bm as Pe,bn as Ne,bo as Oe,bp as Re,bq as Ee,br as Ve,bs as ze,bt as Be,bu as Ge,bv as Fe,bw as We,bx as He}from"./zrender-ee9f2f6d.js";
  2. /*! *****************************************************************************
  3. Copyright (c) Microsoft Corporation.
  4. Permission to use, copy, modify, and/or distribute this software for any
  5. purpose with or without fee is hereby granted.
  6. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  7. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  8. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  9. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  10. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  11. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  12. PERFORMANCE OF THIS SOFTWARE.
  13. ***************************************************************************** */
  14. /* global Reflect, Promise */var Ye=function(t,e){return Ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Ye(t,e)};function Ue(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ye(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Ze=1e-4;
  15. // Although chrome already enlarge this number to 100 for `toFixed`, but
  16. // we sill follow the spec for compatibility.
  17. /**
  18. * Linear mapping a value from domain to range
  19. * @param val
  20. * @param domain Domain extent domain[0] can be bigger than domain[1]
  21. * @param range Range extent range[0] can be bigger than range[1]
  22. * @param clamp Default to be false
  23. */
  24. function Xe(t,e,n,i){var o=e[0],r=e[1],a=n[0],s=n[1],l=r-o,u=s-a;if(0===l)return 0===u?a:(a+s)/2;
  25. // Avoid accuracy problem in edge, such as
  26. // 146.39 - 62.83 === 83.55999999999999.
  27. // See echarts/test/ut/spec/util/number.js#linearMap#accuracyError
  28. // It is a little verbose for efficiency considering this method
  29. // is a hotspot.
  30. if(i)if(l>0){if(t<=o)return a;if(t>=r)return s}else{if(t>=o)return a;if(t<=r)return s}else{if(t===o)return a;if(t===r)return s}return(t-o)/l*u+a}
  31. /**
  32. * Convert a percent string to absolute number.
  33. * Returns NaN if percent is not a valid string or number
  34. */function je(e,n){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return t(e)?(i=e,i.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(e)/100*n:parseFloat(e):null==e?NaN:+e;var i}function qe(t,e,n){return null==e&&(e=10),
  35. // Avoid range error
  36. e=Math.min(Math.max(0,e),20),
  37. // PENDING: 1.005.toFixed(2) is '1.00' rather than '1.01'
  38. t=(+t).toFixed(e),n?t:+t}
  39. /**
  40. * Inplacd asc sort arr.
  41. * The input arr will be modified.
  42. */function Ke(t){return t.sort((function(t,e){return t-e})),t}
  43. /**
  44. * Get precision.
  45. */function Je(t){if(t=+t,isNaN(t))return 0;
  46. // It is much faster than methods converting number to string as follows
  47. // let tmp = val.toString();
  48. // return tmp.length - 1 - tmp.indexOf('.');
  49. // especially when precision is low
  50. // Notice:
  51. // (1) If the loop count is over about 20, it is slower than `getPrecisionSafe`.
  52. // (see https://jsbench.me/2vkpcekkvw/1)
  53. // (2) If the val is less than for example 1e-15, the result may be incorrect.
  54. // (see test/ut/spec/util/number.test.ts `getPrecision_equal_random`)
  55. if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Math.round(t*e)/e===t)return n;return $e(t)}
  56. /**
  57. * Get precision with slow but safe method
  58. */function $e(t){
  59. // toLowerCase for: '3.4E-12'
  60. var e=t.toString().toLowerCase(),n=e.indexOf("e"),i=n>0?+e.slice(n+1):0,o=n>0?n:e.length,r=e.indexOf("."),a=r<0?0:o-1-r;
  61. // Consider scientific notation: '3.4e-12' '3.4e+12'
  62. return Math.max(0,a-i)}
  63. /**
  64. * Minimal dicernible data precisioin according to a single pixel.
  65. */function Qe(t,e){var n=Math.log,i=Math.LN10,o=Math.floor(n(t[1]-t[0])/i),r=Math.round(n(Math.abs(e[1]-e[0]))/i),a=Math.min(Math.max(-o+r,0),20);return isFinite(a)?a:20}
  66. /**
  67. * Get a data of given precision, assuring the sum of percentages
  68. * in valueList is 1.
  69. * The largest remainder method is used.
  70. * https://en.wikipedia.org/wiki/Largest_remainder_method
  71. *
  72. * @param valueList a list of all data
  73. * @param idx index of the data to be processed in valueList
  74. * @param precision integer number showing digits of precision
  75. * @return percent ranging from 0 to 100
  76. */
  77. /**
  78. * Get a data of given precision, assuring the sum of percentages
  79. * in valueList is 1.
  80. * The largest remainder method is used.
  81. * https://en.wikipedia.org/wiki/Largest_remainder_method
  82. *
  83. * @param valueList a list of all data
  84. * @param precision integer number showing digits of precision
  85. * @return {Array<number>}
  86. */
  87. function tn(t,i){var o=e(t,(function(t,e){return t+(isNaN(e)?0:e)}),0);if(0===o)return[];
  88. // Has remainding votes.
  89. for(var r=Math.pow(10,i),a=n(t,(function(t){return(isNaN(t)?0:t)/o*r*100})),s=100*r,l=n(a,(function(t){
  90. // Assign automatic seats.
  91. return Math.floor(t)})),u=e(l,(function(t,e){return t+e}),0),c=n(a,(function(t,e){return t-l[e]}));u<s;){for(
  92. // Find next largest remainder.
  93. var d=Number.NEGATIVE_INFINITY,h=null,p=0,f=c.length;p<f;++p)c[p]>d&&(d=c[p],h=p);
  94. // Add a vote to max remainder.
  95. ++l[h],c[h]=0,++u}return n(l,(function(t){return t/r}))}
  96. /**
  97. * Solve the floating point adding problem like 0.1 + 0.2 === 0.30000000000000004
  98. * See <http://0.30000000000000004.com/>
  99. */function en(t,e){var n=Math.max(Je(t),Je(e)),i=t+e;
  100. // const multiplier = Math.pow(10, maxPrecision);
  101. // return (Math.round(val0 * multiplier) + Math.round(val1 * multiplier)) / multiplier;
  102. // // PENDING: support more?
  103. return n>20?i:qe(i,n)}
  104. // Number.MAX_SAFE_INTEGER, ie do not support.
  105. var nn=9007199254740991;
  106. /**
  107. * To 0 - 2 * PI, considering negative radian.
  108. */function on(t){var e=2*Math.PI;return(t%e+e)%e}
  109. /**
  110. * @param {type} radian
  111. * @return {boolean}
  112. */function rn(t){return t>-1e-4&&t<Ze}
  113. // eslint-disable-next-line
  114. var an=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;// jshint ignore:line
  115. /**
  116. * @param value valid type: number | string | Date, otherwise return `new Date(NaN)`
  117. * These values can be accepted:
  118. * + An instance of Date, represent a time in its own time zone.
  119. * + Or string in a subset of ISO 8601, only including:
  120. * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06',
  121. * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123',
  122. * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00',
  123. * all of which will be treated as local time if time zone is not specified
  124. * (see <https://momentjs.com/>).
  125. * + Or other string format, including (all of which will be treated as local time):
  126. * '2012', '2012-3-1', '2012/3/1', '2012/03/01',
  127. * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123'
  128. * + a timestamp, which represent a time in UTC.
  129. * @return date Never be null/undefined. If invalid, return `new Date(NaN)`.
  130. */function sn(e){if(e instanceof Date)return e;if(t(e)){
  131. // Different browsers parse date in different way, so we parse it manually.
  132. // Some other issues:
  133. // new Date('1970-01-01') is UTC,
  134. // new Date('1970/01/01') and new Date('1970-1-01') is local.
  135. // See issue #3623
  136. var n=an.exec(e);if(!n)
  137. // return Invalid Date.
  138. return new Date(NaN);
  139. // Use local time when no timezone offset is specified.
  140. if(n[8]){var i=+n[4]||0;return"Z"!==n[8].toUpperCase()&&(i-=+n[8].slice(0,3)),new Date(Date.UTC(+n[1],+(n[2]||1)-1,+n[3]||1,i,+(n[5]||0),+n[6]||0,n[7]?+n[7].substring(0,3):0))}
  141. // match[n] can only be string or undefined.
  142. // But take care of '12' + 1 => '121'.
  143. return new Date(+n[1],+(n[2]||1)-1,+n[3]||1,+n[4]||0,+(n[5]||0),+n[6]||0,n[7]?+n[7].substring(0,3):0)}return null==e?new Date(NaN):new Date(Math.round(e))}
  144. /**
  145. * Quantity of a number. e.g. 0.1, 1, 10, 100
  146. *
  147. * @param val
  148. * @return
  149. */function ln(t){return Math.pow(10,un(t))}
  150. /**
  151. * Exponent of the quantity of a number
  152. * e.g., 1234 equals to 1.234*10^3, so quantityExponent(1234) is 3
  153. *
  154. * @param val non-negative value
  155. * @return
  156. */function un(t){if(0===t)return 0;var e=Math.floor(Math.log(t)/Math.LN10);
  157. /**
  158. * exp is expected to be the rounded-down result of the base-10 log of val.
  159. * But due to the precision loss with Math.log(val), we need to restore it
  160. * using 10^exp to make sure we can get val back from exp. #11249
  161. */return t/Math.pow(10,e)>=10&&e++,e}
  162. /**
  163. * find a “nice” number approximately equal to x. Round the number if round = true,
  164. * take ceiling if round = false. The primary observation is that the “nicest”
  165. * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.
  166. *
  167. * See "Nice Numbers for Graph Labels" of Graphic Gems.
  168. *
  169. * @param val Non-negative value.
  170. * @param round
  171. * @return Niced number
  172. */function cn(t,e){var n=un(t),i=Math.pow(10,n),o=t/i;
  173. // Fix 3 * 0.1 === 0.30000000000000004 issue (see IEEE 754).
  174. // 20 is the uppper bound of toFixed.
  175. return t=(e?o<1.5?1:o<2.5?2:o<4?3:o<7?5:10:o<1?1:o<2?2:o<3?3:o<5?5:10)*i,n>=-20?+t.toFixed(n<0?-n:0):t}
  176. /**
  177. * This code was copied from "d3.js"
  178. * <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/arrays/quantile.js>.
  179. * See the license statement at the head of this file.
  180. * @param ascArr
  181. */function dn(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),o=+t[i-1],r=n-i;return r?o+r*(t[i]-o):o}
  182. /**
  183. * Order intervals asc, and split them when overlap.
  184. * expect(numberUtil.reformIntervals([
  185. * {interval: [18, 62], close: [1, 1]},
  186. * {interval: [-Infinity, -70], close: [0, 0]},
  187. * {interval: [-70, -26], close: [1, 1]},
  188. * {interval: [-26, 18], close: [1, 1]},
  189. * {interval: [62, 150], close: [1, 1]},
  190. * {interval: [106, 150], close: [1, 1]},
  191. * {interval: [150, Infinity], close: [0, 0]}
  192. * ])).toEqual([
  193. * {interval: [-Infinity, -70], close: [0, 0]},
  194. * {interval: [-70, -26], close: [1, 1]},
  195. * {interval: [-26, 18], close: [0, 1]},
  196. * {interval: [18, 62], close: [0, 1]},
  197. * {interval: [62, 150], close: [0, 1]},
  198. * {interval: [150, Infinity], close: [0, 0]}
  199. * ]);
  200. * @param list, where `close` mean open or close
  201. * of the interval, and Infinity can be used.
  202. * @return The origin list, which has been reformed.
  203. */function hn(t){t.sort((function(t,e){return s(t,e,0)?-1:1}));for(var e=-Infinity,n=1,i=0;i<t.length;){for(var o=t[i].interval,r=t[i].close,a=0;a<2;a++)o[a]<=e&&(o[a]=e,r[a]=a?1:1-n),e=o[a],n=r[a];o[0]===o[1]&&r[0]*r[1]!=1?t.splice(i,1):i++}return t;function s(t,e,n){return t.interval[n]<e.interval[n]||t.interval[n]===e.interval[n]&&(t.close[n]-e.close[n]==(n?-1:1)||!n&&s(t,e,1))}}
  204. /**
  205. * [Numeric is defined as]:
  206. * `parseFloat(val) == val`
  207. * For example:
  208. * numeric:
  209. * typeof number except NaN, '-123', '123', '2e3', '-2e3', '011', 'Infinity', Infinity,
  210. * and they rounded by white-spaces or line-terminal like ' -123 \n ' (see es spec)
  211. * not-numeric:
  212. * null, undefined, [], {}, true, false, 'NaN', NaN, '123ab',
  213. * empty string, string with only white-spaces or line-terminal (see es spec),
  214. * 0x12, '0x12', '-0x12', 012, '012', '-012',
  215. * non-string, ...
  216. *
  217. * @test See full test cases in `test/ut/spec/util/number.js`.
  218. * @return Must be a typeof number. If not numeric, return NaN.
  219. */function pn(e){var n=parseFloat(e);return n==e&&(0!==n||!t(e)||e.indexOf("x")<=0)?n:NaN}
  220. /**
  221. * Definition of "numeric": see `numericToNumber`.
  222. */function fn(t){return!isNaN(pn(t))}
  223. /**
  224. * Use random base to prevent users hard code depending on
  225. * this auto generated marker id.
  226. * @return An positive integer.
  227. */function gn(){return Math.round(9*Math.random())}
  228. /**
  229. * Get the greatest common divisor.
  230. *
  231. * @param {number} a one number
  232. * @param {number} b the other number
  233. */function yn(t,e){return 0===e?t:yn(e,t%e)}
  234. /**
  235. * Get the least common multiple.
  236. *
  237. * @param {number} a one number
  238. * @param {number} b the other number
  239. */function mn(t,e){return null==t?e:null==e?t:t*e/yn(t,e)}"undefined"!=typeof console&&console.warn&&console.log;
  240. /**
  241. * @throws Error
  242. */
  243. function vn(t){throw new Error(t)}function xn(t,e,n){return(e-t)*n+t}
  244. /**
  245. * Make the name displayable. But we should
  246. * make sure it is not duplicated with user
  247. * specified name, so use '\0';
  248. */var _n="series\0",bn="\0_ec_\0";
  249. /**
  250. * If value is not array, then translate it to array.
  251. * @param {*} value
  252. * @return {Array} [value] or value
  253. */
  254. function Sn(t){return t instanceof Array?t:null==t?[]:[t]}
  255. /**
  256. * Sync default option between normal and emphasis like `position` and `show`
  257. * In case some one will write code like
  258. * label: {
  259. * show: false,
  260. * position: 'outside',
  261. * fontSize: 18
  262. * },
  263. * emphasis: {
  264. * label: { show: true }
  265. * }
  266. */function wn(t,e,n){
  267. // Caution: performance sensitive.
  268. if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};
  269. // Default emphasis option from normal
  270. for(var i=0,o=n.length;i<o;i++){var r=n[i];!t.emphasis[e].hasOwnProperty(r)&&t[e].hasOwnProperty(r)&&(t.emphasis[e][r]=t[e][r])}}}var Mn=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];
  271. // modelUtil.LABEL_OPTIONS = modelUtil.TEXT_STYLE_OPTIONS.concat([
  272. // 'position', 'offset', 'rotate', 'origin', 'show', 'distance', 'formatter',
  273. // 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',
  274. // // FIXME: deprecated, check and remove it.
  275. // 'textStyle'
  276. // ]);
  277. /**
  278. * The method does not ensure performance.
  279. * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]
  280. * This helper method retrieves value from data.
  281. */function In(t){return!o(t)||i(t)||t instanceof Date?t:t.value}
  282. /**
  283. * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]
  284. * This helper method determine if dataItem has extra option besides value
  285. */function Dn(t){return o(t)&&!(t instanceof Array);
  286. // // markLine data can be array
  287. // && !(dataItem[0] && isObject(dataItem[0]) && !(dataItem[0] instanceof Array));
  288. }
  289. /**
  290. * Mapping to existings for merge.
  291. *
  292. * Mode "normalMege":
  293. * The mapping result (merge result) will keep the order of the existing
  294. * component, rather than the order of new option. Because we should ensure
  295. * some specified index reference (like xAxisIndex) keep work.
  296. * And in most cases, "merge option" is used to update partial option but not
  297. * be expected to change the order.
  298. *
  299. * Mode "replaceMege":
  300. * (1) Only the id mapped components will be merged.
  301. * (2) Other existing components (except internal components) will be removed.
  302. * (3) Other new options will be used to create new component.
  303. * (4) The index of the existing components will not be modified.
  304. * That means their might be "hole" after the removal.
  305. * The new components are created first at those available index.
  306. *
  307. * Mode "replaceAll":
  308. * This mode try to support that reproduce an echarts instance from another
  309. * echarts instance (via `getOption`) in some simple cases.
  310. * In this scenario, the `result` index are exactly the consistent with the `newCmptOptions`,
  311. * which ensures the component index referring (like `xAxisIndex: ?`) corrent. That is,
  312. * the "hole" in `newCmptOptions` will also be kept.
  313. * On the contrary, other modes try best to eliminate holes.
  314. * PENDING: This is an experimental mode yet.
  315. *
  316. * @return See the comment of <MappingResult>.
  317. */function Tn(t,e,n){var i="normalMerge"===n,l="replaceMerge"===n,u="replaceAll"===n;t=t||[],e=(e||[]).slice();var c=r();
  318. // Validate id and name on user input option.
  319. a(e,(function(t,n){o(t)||(e[n]=null)}));var d,h,p=function(t,e,n){var i=[];if("replaceAll"===n)return i;
  320. // Do not use native `map` to in case that the array `existings`
  321. // contains elided items, which will be omitted.
  322. for(var o=0;o<t.length;o++){var r=t[o];
  323. // Because of replaceMerge, `existing` may be null/undefined.
  324. r&&null!=r.id&&e.set(r.id,o),
  325. // For non-internal-componnets:
  326. // Mode "normalMerge": all existings kept.
  327. // Mode "replaceMerge": all existing removed unless mapped by id.
  328. // For internal-components:
  329. // go with "replaceMerge" approach in both mode.
  330. i.push({existing:"replaceMerge"===n||Pn(r)?null:r,newOption:null,keyInfo:null,brandNew:null})}return i}(t,c,n);
  331. // The array `result` MUST NOT contain elided items, otherwise the
  332. // forEach will omit those items and result in incorrect result.
  333. return(i||l)&&function(t,e,n,i){
  334. // Mapping by id if specified.
  335. a(i,(function(o,r){if(o&&null!=o.id){var a=An(o.id),l=n.get(a);if(null!=l){var u=t[l];s(!u.newOption,'Duplicated option on id "'+a+'".'),u.newOption=o,
  336. // In both mode, if id matched, new option will be merged to
  337. // the existings rather than creating new component model.
  338. u.existing=e[l],i[r]=null}}}))}(p,t,c,e),i&&function(t,e){
  339. // Mapping by name if specified.
  340. a(e,(function(n,i){if(n&&null!=n.name)for(var o=0;o<t.length;o++){var r=t[o].existing;if(!t[o].newOption&&r&&(null==r.id||null==n.id)&&!Pn(n)&&!Pn(r)&&Cn("name",r,n))return t[o].newOption=n,void(e[i]=null)}}))}(p,e),i||l?function(t,e,n){a(e,(function(e){if(e){for(
  341. // Find the first place that not mapped by id and not internal component (consider the "hole").
  342. var i,o=0;
  343. // Be `!resultItem` only when `nextIdx >= result.length`.
  344. (i=t[o])&&(i.newOption||Pn(i.existing)||
  345. // In mode "replaceMerge", here no not-mapped-non-internal-existing.
  346. i.existing&&null!=e.id&&!Cn("id",e,i.existing));)o++;i?(i.newOption=e,i.brandNew=n):t.push({newOption:e,brandNew:n,existing:null,keyInfo:null}),o++}}))}(p,e,l):u&&function(t,e){a(e,(function(e){
  347. // The feature "reproduce" requires "hole" will also reproduced
  348. // in case that component index referring are broken.
  349. t.push({newOption:e,brandNew:!0,existing:null,keyInfo:null})}))}
  350. /**
  351. * Make id and name for mapping result (result of mappingToExists)
  352. * into `keyInfo` field.
  353. */(p,e),d=p,h=r(),a(d,(function(t){var e=t.existing;e&&h.set(e.id,t)})),a(d,(function(t){var e=t.newOption;
  354. // Force ensure id not duplicated.
  355. s(!e||null==e.id||!h.get(e.id)||h.get(e.id)===t,"id duplicates: "+(e&&e.id)),e&&null!=e.id&&h.set(e.id,t),!t.keyInfo&&(t.keyInfo={})})),
  356. // Make name and id.
  357. a(d,(function(t,e){var n=t.existing,i=t.newOption,r=t.keyInfo;if(o(i)){if(
  358. // Name can be overwritten. Consider case: axis.name = '20km'.
  359. // But id generated by name will not be changed, which affect
  360. // only in that case: setOption with 'not merge mode' and view
  361. // instance will be recreated, which can be accepted.
  362. r.name=null!=i.name?An(i.name):n?n.name:_n+e,n)r.id=An(n.id);else if(null!=i.id)r.id=An(i.id);else{
  363. // Consider this situatoin:
  364. // optionA: [{name: 'a'}, {name: 'a'}, {..}]
  365. // optionB [{..}, {name: 'a'}, {name: 'a'}]
  366. // Series with the same name between optionA and optionB
  367. // should be mapped.
  368. var a=0;do{r.id="\0"+r.name+"\0"+a++}while(h.get(r.id))}h.set(r.id,t)}})),p}function Cn(t,e,n){var i=Ln(e[t],null),o=Ln(n[t],null);
  369. // See `MappingExistingItem`. `id` and `name` trade string equals to number.
  370. return null!=i&&null!=o&&i===o}
  371. /**
  372. * @return return null if not exist.
  373. */function An(t){return Ln(t,"")}function Ln(e,n){return null==e?n:t(e)?e:l(e)||u(e)?e+"":n}function kn(t){var e=t.name;
  374. // Is specified when `indexOf` get -1 or > 0.
  375. return!(!e||!e.indexOf(_n))}
  376. /**
  377. * @public
  378. * @param {Object} cmptOption
  379. * @return {boolean}
  380. */function Pn(t){return t&&null!=t.id&&0===An(t.id).indexOf(bn)}
  381. /**
  382. * @param payload Contains dataIndex (means rawIndex) / dataIndexInside / name
  383. * each of which can be Array or primary type.
  384. * @return dataIndex If not found, return undefined/null.
  385. */
  386. function Nn(t,e){return null!=e.dataIndexInside?e.dataIndexInside:null!=e.dataIndex?i(e.dataIndex)?n(e.dataIndex,(function(e){return t.indexOfRawIndex(e)})):t.indexOfRawIndex(e.dataIndex):null!=e.name?i(e.name)?n(e.name,(function(e){return t.indexOfName(e)})):t.indexOfName(e.name):void 0}
  387. /**
  388. * Enable property storage to any host object.
  389. * Notice: Serialization is not supported.
  390. *
  391. * For example:
  392. * let inner = zrUitl.makeInner();
  393. *
  394. * function some1(hostObj) {
  395. * inner(hostObj).someProperty = 1212;
  396. * ...
  397. * }
  398. * function some2() {
  399. * let fields = inner(this);
  400. * fields.someProperty1 = 1212;
  401. * fields.someProperty2 = 'xx';
  402. * ...
  403. * }
  404. *
  405. * @return {Function}
  406. */function On(){var t="__ec_inner_"+Rn++;return function(e){return e[t]||(e[t]={})}}var Rn=gn();
  407. /**
  408. * The same behavior as `component.getReferringComponents`.
  409. */function En(t,e,n){var i=Vn(e,n),o=i.mainTypeSpecified,r=i.queryOptionMap,a=i.others,s=n?n.defaultMainType:null;return!o&&s&&r.set(s,{}),r.each((function(e,i){var o=Gn(t,i,e,{useDefault:s===i,enableAll:!n||null==n.enableAll||n.enableAll,enableNone:!n||null==n.enableNone||n.enableNone});a[i+"Models"]=o.models,a[i+"Model"]=o.models[0]})),a}function Vn(e,n){var i;if(t(e)){var o={};o[e+"Index"]=0,i=o}else i=e;var s=r(),l={},u=!1;return a(i,(function(t,e){
  410. // Exclude 'dataIndex' and other illgal keys.
  411. if("dataIndex"!==e&&"dataIndexInside"!==e){var i=e.match(/^(\w+)(Index|Id|Name)$/)||[],o=i[1],r=(i[2]||"").toLowerCase();if(o&&r&&!(n&&n.includeMainTypes&&c(n.includeMainTypes,o)<0))u=u||!!o,(s.get(o)||s.set(o,{}))[r]=t}else l[e]=t})),{mainTypeSpecified:u,queryOptionMap:s,others:l}}var zn={useDefault:!0,enableAll:!1,enableNone:!1},Bn={useDefault:!1,enableAll:!0,enableNone:!0};function Gn(t,e,n,i){i=i||zn;var o=n.index,r=n.id,a=n.name,l={models:null,specified:null!=o||null!=r||null!=a};if(!l.specified){
  412. // Use the first as default if `useDefault`.
  413. var u=void 0;return l.models=i.useDefault&&(u=t.getComponent(e))?[u]:[],l}return"none"===o||!1===o?(s(i.enableNone,'`"none"` or `false` is not a valid value on index option.'),l.models=[],l):(
  414. // `queryComponents` will return all components if
  415. // both all of index/id/name are null/undefined.
  416. "all"===o&&(s(i.enableAll,'`"all"` is not a valid value on index option.'),o=r=a=null),l.models=t.queryComponents({mainType:e,index:o,id:r,name:a}),l)}function Fn(t,e,n){t.setAttribute?t.setAttribute(e,n):t[e]=n}
  417. /**
  418. * Group a list by key.
  419. */
  420. function Wn(t,e){var n=r(),i=[];return a(t,(function(t){var o=e(t);(n.get(o)||(i.push(o),n.set(o,[]))).push(t)})),{keys:i,buckets:n}}
  421. /**
  422. * Interpolate raw values of a series with percent
  423. *
  424. * @param data data
  425. * @param labelModel label model of the text element
  426. * @param sourceValue start value. May be null/undefined when init.
  427. * @param targetValue end value
  428. * @param percent 0~1 percentage; 0 uses start value while 1 uses end value
  429. * @return interpolated values
  430. * If `sourceValue` and `targetValue` are `number`, return `number`.
  431. * If `sourceValue` and `targetValue` are `string`, return `string`.
  432. * If `sourceValue` and `targetValue` are `(string | number)[]`, return `(string | number)[]`.
  433. * Other cases do not supported.
  434. */function Hn(e,n,i,o,r){var a=null==n||"auto"===n;if(null==o)return o;if(l(o))return qe(y=xn(i||0,o,r),a?Math.max(Je(i||0),Je(o)):n);if(t(o))return r<1?i:o;for(var s=[],u=i,c=o,d=Math.max(u?u.length:0,c.length),h=0;h<d;++h){var p=e.getDimensionInfo(h);
  435. // Don't interpolate ordinal dims
  436. if(p&&"ordinal"===p.type)
  437. // In init, there is no `sourceValue`, but should better not to get undefined result.
  438. s[h]=(r<1&&u?u:c)[h];else{var f=u&&u[h]?u[h]:0,g=c[h],y=xn(f,g,r);s[h]=qe(y,a?Math.max(Je(f),Je(g)):n)}}return s}var Yn="___EC__COMPONENT__CONTAINER___",Un="___EC__EXTENDED_CLASS___";
  439. /**
  440. * Notice, parseClassType('') should returns {main: '', sub: ''}
  441. * @public
  442. */
  443. function Zn(t){var e={main:"",sub:""};if(t){var n=t.split(".");e.main=n[0]||"",e.sub=n[1]||""}return e}
  444. /**
  445. * @public
  446. */
  447. /**
  448. * Implements `ExtendableConstructor` for `rootClz`.
  449. *
  450. * @usage
  451. * ```ts
  452. * class Xxx {}
  453. * type XxxConstructor = typeof Xxx & ExtendableConstructor
  454. * enableClassExtend(Xxx as XxxConstructor);
  455. * ```
  456. */
  457. function Xn(t,e){t.$constructor=t,// FIXME: not necessary?
  458. t.extend=function(t){var e,n,i=this;return f(n=i)&&/^class\s/.test(Function.prototype.toString.call(n))?e=/** @class */function(t){function e(){return t.apply(this,arguments)||this}return Ue(e,t),e}(i):(
  459. // For backward compat, we both support ts class inheritance and this
  460. // "extend" approach.
  461. // The constructor should keep the same behavior as ts class inheritance:
  462. // If this constructor/$constructor is not declared, auto invoke the super
  463. // constructor.
  464. // If this constructor/$constructor is declared, it is responsible for
  465. // calling the super constructor.
  466. e=function(){(t.$constructor||i).apply(this,arguments)},h(e,this)),p(e.prototype,t),e[Un]=!0,e.extend=this.extend,e.superCall=Kn,e.superApply=Jn,e.superClass=i,e}}
  467. /**
  468. * A work around to both support ts extend and this extend mechanism.
  469. * on sub-class.
  470. * @usage
  471. * ```ts
  472. * class Component { ... }
  473. * classUtil.enableClassExtend(Component);
  474. * classUtil.enableClassManagement(Component, {registerWhenExtend: true});
  475. *
  476. * class Series extends Component { ... }
  477. * // Without calling `markExtend`, `registerWhenExtend` will not work.
  478. * Component.markExtend(Series);
  479. * ```
  480. */
  481. function jn(t,e){t.extend=e.extend}
  482. // A random offset.
  483. var qn=Math.round(10*Math.random());
  484. /**
  485. * Implements `CheckableConstructor` for `target`.
  486. * Can not use instanceof, consider different scope by
  487. * cross domain or es module import in ec extensions.
  488. * Mount a method "isInstance()" to Clz.
  489. *
  490. * @usage
  491. * ```ts
  492. * class Xxx {}
  493. * type XxxConstructor = typeof Xxx & CheckableConstructor;
  494. * enableClassCheck(Xxx as XxxConstructor)
  495. * ```
  496. */
  497. // superCall should have class info, which can not be fetched from 'this'.
  498. // Consider this case:
  499. // class A has method f,
  500. // class B inherits class A, overrides method f, f call superApply('f'),
  501. // class C inherits class B, does not override method f,
  502. // then when method of class C is called, dead loop occurred.
  503. function Kn(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return this.superClass.prototype[e].apply(t,n)}function Jn(t,e,n){return this.superClass.prototype[e].apply(t,n)}
  504. /**
  505. * Implements `ClassManager` for `target`
  506. *
  507. * @usage
  508. * ```ts
  509. * class Xxx {}
  510. * type XxxConstructor = typeof Xxx & ClassManager
  511. * enableClassManagement(Xxx as XxxConstructor);
  512. * ```
  513. */function $n(t){
  514. /**
  515. * Component model classes
  516. * key: componentType,
  517. * value:
  518. * componentClass, when componentType is 'a'
  519. * or Object.<subKey, componentClass>, when componentType is 'a.b'
  520. */
  521. var e={};t.registerClass=function(t){
  522. // `type` should not be a "instance member".
  523. // If using TS class, should better declared as `static type = 'series.pie'`.
  524. // otherwise users have to mount `type` on prototype manually.
  525. // For backward compat and enable instance visit type via `this.type`,
  526. // we still support fetch `type` from prototype.
  527. var n,i=t.type||t.prototype.type;if(i){s(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(n=i),'componentType "'+n+'" illegal'),
  528. // If only static type declared, we assign it to prototype mandatorily.
  529. t.prototype.type=i;var o=Zn(i);if(o.sub){if(o.sub!==Yn){var r=function(t){var n=e[t.main];n&&n[Yn]||((n=e[t.main]={})[Yn]=!0);return n}(o);r[o.sub]=t}}else e[o.main]=t}return t},t.getClass=function(t,n,i){var o=e[t];if(o&&o[Yn]&&(o=n?o[n]:null),i&&!o)throw new Error(n?"Component "+t+"."+(n||"")+" is used but not imported.":t+".type should be specified.");return o},t.getClassesByMainType=function(t){var n=Zn(t),i=[],o=e[n.main];return o&&o[Yn]?a(o,(function(t,e){e!==Yn&&i.push(t)})):i.push(o),i},t.hasClass=function(t){
  530. // Just consider componentType.main.
  531. var n=Zn(t);return!!e[n.main]},
  532. /**
  533. * @return Like ['aa', 'bb'], but can not be ['aa.xx']
  534. */
  535. t.getAllClassMainTypes=function(){var t=[];return a(e,(function(e,n){t.push(n)})),t},
  536. /**
  537. * If a main type is container and has sub types
  538. */
  539. t.hasSubTypes=function(t){var n=Zn(t),i=e[n.main];return i&&i[Yn]}}
  540. // /**
  541. // * @param {string|Array.<string>} properties
  542. // */
  543. // export function setReadOnly(obj, properties) {
  544. // FIXME It seems broken in IE8 simulation of IE11
  545. // if (!zrUtil.isArray(properties)) {
  546. // properties = properties != null ? [properties] : [];
  547. // }
  548. // zrUtil.each(properties, function (prop) {
  549. // let value = obj[prop];
  550. // Object.defineProperty
  551. // && Object.defineProperty(obj, prop, {
  552. // value: value, writable: false
  553. // });
  554. // zrUtil.isArray(obj[prop])
  555. // && Object.freeze
  556. // && Object.freeze(obj[prop]);
  557. // });
  558. // }
  559. function Qn(t,e){
  560. // Normalize
  561. for(var n=0;n<t.length;n++)t[n][1]||(t[n][1]=t[n][0]);return e=e||!1,function(n,i,o){for(var r={},a=0;a<t.length;a++){var s=t[a][1];if(!(i&&c(i,s)>=0||o&&c(o,s)<0)){var l=n.getShallow(s,e);null!=l&&(r[t[a][0]]=l)}}
  562. // TODO Text or image?
  563. return r}}var ti=Qn([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),ei=/** @class */function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return ti(this,t,e)},t}(),ni=On(),ii=function(t,e,n,i){if(i){var o=ni(i);
  564. // Add data index and series index for indexing the data by element
  565. // Useful in tooltip
  566. o.dataIndex=n,o.dataType=e,o.seriesIndex=t,o.ssrType="chart",
  567. // TODO: not store dataIndex on children.
  568. "group"===i.type&&i.traverse((function(i){var o=ni(i);o.seriesIndex=t,o.dataIndex=n,o.dataType=e,o.ssrType="chart"}))}},oi=1,ri={},ai=On(),si=On(),li=["emphasis","blur","select"],ui=["normal","emphasis","blur","select"],ci=10,di="highlight",hi="downplay",pi="select",fi="unselect",gi="toggleSelect";function yi(t){return null!=t&&"none"!==t}function mi(t,e,n){t.onHoverStateChange&&(t.hoverState||0)!==n&&t.onHoverStateChange(e),t.hoverState=n}function vi(t){
  569. // Only mark the flag.
  570. // States will be applied in the echarts.ts in next frame.
  571. mi(t,"emphasis",2)}function xi(t){
  572. // Only mark the flag.
  573. // States will be applied in the echarts.ts in next frame.
  574. 2===t.hoverState&&mi(t,"normal",0)}function _i(t){mi(t,"blur",1)}function bi(t){1===t.hoverState&&mi(t,"normal",0)}function Si(t){t.selected=!0}function wi(t){t.selected=!1}function Mi(t,e,n){e(t,n)}function Ii(t,e,n){Mi(t,e,n),t.isGroup&&t.traverse((function(t){Mi(t,e,n)}))}function Di(t,e){switch(e){case"emphasis":t.hoverState=2;break;case"normal":t.hoverState=0;break;case"blur":t.hoverState=1;break;case"select":t.selected=!0}}function Ti(t,e){var n=this.states[t];if(this.style){if("emphasis"===t)return function(t,e,n,i){var o=n&&c(n,"select")>=0,r=!1;if(t instanceof g){var a=ai(t),s=o&&a.selectFill||a.normalFill,l=o&&a.selectStroke||a.normalStroke;if(yi(s)||yi(l)){var u=(i=i||{}).style||{};
  575. // inherit case
  576. "inherit"===u.fill?(r=!0,i=p({},i),(u=p({},u)).fill=s):!yi(u.fill)&&yi(s)?(r=!0,
  577. // Not modify the original value.
  578. i=p({},i),
  579. // Already being applied 'emphasis'. DON'T lift color multiple times.
  580. (u=p({},u)).fill=y(s)):!yi(u.stroke)&&yi(l)&&(r||(i=p({},i),u=p({},u)),u.stroke=y(l)),i.style=u}}if(i&&null==i.z2){r||(i=p({},i));var d=t.z2EmphasisLift;i.z2=t.z2+(null!=d?d:ci)}return i}(this,0,e,n);if("blur"===t)return function(t,e,n){var i=c(t.currentStates,e)>=0,o=t.style.opacity,r=i?null:function(t,e,n,i){for(var o=t.style,r={},a=0;a<e.length;a++){var s=e[a],l=o[s];r[s]=null==l?i&&i[s]:l}for(a=0;a<t.animators.length;a++){var u=t.animators[a];u.__fromStateTransition&&u.__fromStateTransition.indexOf(n)<0&&"style"===u.targetName&&u.saveTo(r,e)}return r}(t,["opacity"],e,{opacity:1}),a=(n=n||{}).style||{};return null==a.opacity&&(
  581. // clone state
  582. n=p({},n),a=p({
  583. // Already being applied 'emphasis'. DON'T mul opacity multiple times.
  584. opacity:i?o:.1*r.opacity},a),n.style=a),n}(this,t,n);if("select"===t)return function(t,e,n){
  585. // const hasSelect = indexOf(el.currentStates, stateName) >= 0;
  586. if(n&&null==n.z2){n=p({},n);var i=t.z2SelectLift;n.z2=t.z2+(null!=i?i:9)}return n}(this,0,n)}return n}
  587. /**
  588. * Set hover style (namely "emphasis style") of element.
  589. * @param el Should not be `zrender/graphic/Group`.
  590. * @param focus 'self' | 'selfInSeries' | 'series'
  591. */function Ci(t){t.stateProxy=Ti;var e=t.getTextContent(),n=t.getTextGuideLine();e&&(e.stateProxy=Ti),n&&(n.stateProxy=Ti)}function Ai(t,e){!Vi(t,e)&&!t.__highByOuter&&Ii(t,vi)}function Li(t,e){!Vi(t,e)&&!t.__highByOuter&&Ii(t,xi)}function ki(t,e){t.__highByOuter|=1<<(e||0),Ii(t,vi)}function Pi(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&Ii(t,xi)}function Ni(t){Ii(t,_i)}function Oi(t){Ii(t,bi)}function Ri(t){Ii(t,Si)}function Ei(t){Ii(t,wi)}function Vi(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function zi(t){var e=t.getModel(),n=[],i=[];e.eachComponent((function(e,o){var r=si(o),a="series"===e,s=a?t.getViewOfSeriesModel(o):t.getViewOfComponentModel(o);!a&&i.push(s),r.isBlured&&(
  592. // Leave blur anyway
  593. s.group.traverse((function(t){bi(t)})),a&&n.push(o)),r.isBlured=!1})),a(i,(function(t){t&&t.toggleBlurSeries&&t.toggleBlurSeries(n,!1,e)}))}function Bi(t,e,n,i){var r=i.getModel();function a(t,e){for(var n=0;n<e.length;n++){var i=t.getItemGraphicEl(e[n]);i&&Oi(i)}}if(n=n||"coordinateSystem",null!=t&&e&&"none"!==e){var s=r.getSeriesByIndex(t),l=s.coordinateSystem;l&&l.master&&(l=l.master);var u=[];r.eachSeries((function(t){var r=s===t,c=t.coordinateSystem;// If there is no coordinate system. use sameSeries instead.
  594. if(c&&c.master&&(c=c.master),!(
  595. // Not blur other series if blurScope series
  596. "series"===n&&!r||"coordinateSystem"===n&&!(c&&l?c===l:r)||"series"===e&&r)){if(i.getViewOfSeriesModel(t).group.traverse((function(t){
  597. // For the elements that have been triggered by other components,
  598. // and are still required to be highlighted,
  599. // because the current is directly forced to blur the element,
  600. // it will cause the focus self to be unable to highlight, so skip the blur of this element.
  601. t.__highByOuter&&r&&"self"===e||_i(t)})),m(e))a(t.getData(),e);else if(o(e))for(var d=v(e),h=0;h<d.length;h++)a(t.getData(d[h]),e[d[h]]);u.push(t),si(t).isBlured=!0}})),r.eachComponent((function(t,e){if("series"!==t){var n=i.getViewOfComponentModel(e);n&&n.toggleBlurSeries&&n.toggleBlurSeries(u,!0,r)}}))}}function Gi(t,e,n){if(null!=t&&null!=e){var i=n.getModel().getComponent(t,e);if(i){si(i).isBlured=!0;var o=n.getViewOfComponentModel(i);o&&o.focusBlurEnabled&&o.group.traverse((function(t){_i(t)}))}}}function Fi(t,e,n,i){var o={focusSelf:!1,dispatchers:null};if(null==t||"series"===t||null==e||null==n)return o;var r=i.getModel().getComponent(t,e);if(!r)return o;var a=i.getViewOfComponentModel(r);if(!a||!a.findHighDownDispatchers)return o;for(var s,l=a.findHighDownDispatchers(n),u=0
  602. // At presnet, the component (like Geo) only blur inside itself.
  603. // So we do not use `blurScope` in component.
  604. ;u<l.length;u++)if("self"===ni(l[u]).focus){s=!0;break}return{focusSelf:s,dispatchers:l}}function Wi(t){var e=t.getAllData();a(e,(function(e){var n=e.data,i=e.type;n.eachItemGraphicEl((function(e,n){t.isSelected(n,i)?Ri(e):Ei(e)}))}))}function Hi(t){var e=[];return t.eachSeries((function(t){var n=t.getAllData();a(n,(function(n){n.data;var i=n.type,o=t.getSelectedDataIndices();if(o.length>0){var r={dataIndex:o,seriesIndex:t.seriesIndex};null!=i&&(r.dataType=i),e.push(r)}}))})),e}
  605. /**
  606. * Enable the function that mouseover will trigger the emphasis state.
  607. *
  608. * NOTE:
  609. * This function should be used on the element with dataIndex, seriesIndex.
  610. *
  611. */function Yi(t,e,n){Ki(t,!0),Ii(t,Ci),Zi(t,e,n)}function Ui(t,e,n,i){i?function(t){Ki(t,!1)}(t):Yi(t,e,n)}function Zi(t,e,n){var i=ni(t);null!=e?(
  612. // TODO dataIndex may be set after this function. This check is not useful.
  613. // if (ecData.dataIndex == null) {
  614. // if (__DEV__) {
  615. // console.warn('focus can only been set on element with dataIndex');
  616. // }
  617. // }
  618. // else {
  619. i.focus=e,i.blurScope=n):i.focus&&(i.focus=null)}var Xi=["emphasis","blur","select"],ji={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};
  620. /**
  621. * Set emphasis/blur/selected states of element.
  622. */
  623. function qi(t,e,n,
  624. // default itemStyle
  625. i){n=n||"itemStyle";for(var o=0;o<Xi.length;o++){var r=Xi[o],a=e.getModel([r,n]);
  626. // Let it throw error if getterType is not found.
  627. t.ensureState(r).style=i?i(a):a[ji[n]]()}}
  628. /**
  629. *
  630. * Set element as highlight / downplay dispatcher.
  631. * It will be checked when element received mouseover event or from highlight action.
  632. * It's in change of all highlight/downplay behavior of it's children.
  633. *
  634. * @param el
  635. * @param el.highDownSilentOnTouch
  636. * In touch device, mouseover event will be trigger on touchstart event
  637. * (see module:zrender/dom/HandlerProxy). By this mechanism, we can
  638. * conveniently use hoverStyle when tap on touch screen without additional
  639. * code for compatibility.
  640. * But if the chart/component has select feature, which usually also use
  641. * hoverStyle, there might be conflict between 'select-highlight' and
  642. * 'hover-highlight' especially when roam is enabled (see geo for example).
  643. * In this case, `highDownSilentOnTouch` should be used to disable
  644. * hover-highlight on touch device.
  645. * @param asDispatcher If `false`, do not set as "highDownDispatcher".
  646. */function Ki(t,e){var n=!1===e,i=t;
  647. // Make `highDownSilentOnTouch` and `onStateChange` only work after
  648. // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly.
  649. t.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=t.highDownSilentOnTouch),
  650. // Simple optimize, since this method might be
  651. // called for each elements of a group in some cases.
  652. n&&!i.__highDownDispatcher||(
  653. // Emphasis, normal can be triggered manually by API or other components like hover link.
  654. // el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent);
  655. // Also keep previous record.
  656. i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!n)}function Ji(t){return!(!t||!t.__highDownDispatcher)}
  657. /**
  658. * Enable component highlight/downplay features:
  659. * + hover link (within the same name)
  660. * + focus blur in component
  661. */function $i(t){var e=t.type;return e===pi||e===fi||e===gi}function Qi(t){var e=t.type;return e===di||e===hi}
  662. // Stored properties for further transition.
  663. var to=On();
  664. /**
  665. * Return null if animation is disabled.
  666. */function eo(t,e,n,
  667. // Extra opts can override the option in animatable model.
  668. i,
  669. // TODO It's only for pictorial bar now.
  670. o){var r;
  671. // Check if there is global animation configuration from dataZoom/resize can override the config in option.
  672. // If animation is enabled. Will use this animation config in payload.
  673. // If animation is disabled. Just ignore it.
  674. if(e&&e.ecModel){var a=e.ecModel.getUpdatePayload();r=a&&a.animation}var s="update"===t;if(e&&e.isAnimationEnabled()){var l=void 0,u=void 0,c=void 0;return i?(l=x(i.duration,200),u=x(i.easing,"cubicOut"),c=0):(l=e.getShallow(s?"animationDurationUpdate":"animationDuration"),u=e.getShallow(s?"animationEasingUpdate":"animationEasing"),c=e.getShallow(s?"animationDelayUpdate":"animationDelay")),
  675. // animation from payload has highest priority.
  676. r&&(null!=r.duration&&(l=r.duration),null!=r.easing&&(u=r.easing),null!=r.delay&&(c=r.delay)),f(c)&&(c=c(n,o)),f(l)&&(l=l(n)),{duration:l||0,delay:c,easing:u}}return null}function no(t,e,n,i,r,a,s){var l,u=!1;f(r)?(s=a,a=r,r=null):o(r)&&(a=r.cb,s=r.during,u=r.isFrom,l=r.removeOpt,r=r.dataIndex);var c="leave"===t;c||
  677. // Must stop the remove animation.
  678. e.stopAnimation("leave");var d=eo(t,i,r,c?l||{}:null,i&&i.getAnimationDelayParams?i.getAnimationDelayParams(e,r):null);if(d&&d.duration>0){var h={duration:d.duration,delay:d.delay||0,easing:d.easing,done:a,force:!!a||!!s,
  679. // Set to final state in update/init animation.
  680. // So the post processing based on the path shape can be done correctly.
  681. setToFinal:!c,scope:t,during:s};u?e.animateFrom(n,h):e.animateTo(n,h)}else e.stopAnimation(),
  682. // If `isFrom`, the props is the "from" props.
  683. !u&&e.attr(n),
  684. // Call during at least once.
  685. s&&s(1),a&&a()}
  686. /**
  687. * Update graphic element properties with or without animation according to the
  688. * configuration in series.
  689. *
  690. * Caution: this method will stop previous animation.
  691. * So do not use this method to one element twice before
  692. * animation starts, unless you know what you are doing.
  693. * @example
  694. * graphic.updateProps(el, {
  695. * position: [100, 100]
  696. * }, seriesModel, dataIndex, function () { console.log('Animation done!'); });
  697. * // Or
  698. * graphic.updateProps(el, {
  699. * position: [100, 100]
  700. * }, seriesModel, function () { console.log('Animation done!'); });
  701. */function io(t,e,
  702. // TODO: TYPE AnimatableModel
  703. n,i,o,r){no("update",t,e,n,i,o,r)}
  704. /**
  705. * Init graphic element properties with or without animation according to the
  706. * configuration in series.
  707. *
  708. * Caution: this method will stop previous animation.
  709. * So do not use this method to one element twice before
  710. * animation starts, unless you know what you are doing.
  711. */function oo(t,e,n,i,o,r){no("enter",t,e,n,i,o,r)}
  712. /**
  713. * If element is removed.
  714. * It can determine if element is having remove animation.
  715. */function ro(t){if(!t.__zr)return!0;for(var e=0;e<t.animators.length;e++){if("leave"===t.animators[e].scope)return!0}return!1}
  716. /**
  717. * Remove graphic element
  718. */function ao(t,e,n,i,o,r){
  719. // Don't do remove animation twice.
  720. ro(t)||no("leave",t,e,n,i,o,r)}function so(t,e,n,i){t.removeTextContent(),t.removeTextGuideLine(),ao(t,{style:{opacity:0}},e,n,i)}function lo(t,e,n){function i(){t.parent&&t.parent.remove(t)}
  721. // Hide label and labelLine first
  722. // TODO Also use fade out animation?
  723. t.isGroup?t.traverse((function(t){t.isGroup||
  724. // Can invoke doRemove multiple times.
  725. so(t,e,n,i)})):so(t,e,n,i)}
  726. /**
  727. * Save old style for style transition in universalTransition module.
  728. * It's used when element will be reused in each render.
  729. * For chart like map, heatmap, which will always create new element.
  730. * We don't need to save this because universalTransition can get old style from the old element
  731. */function uo(t){to(t).oldStyle=t.style}var co=Math.max,ho=Math.min,po={};
  732. /**
  733. * Extend shape with parameters
  734. */
  735. function fo(t){return g.extend(t)}var go=D;
  736. /**
  737. * Extend path
  738. */function yo(t,e){return go(t,e)}
  739. /**
  740. * Register a user defined shape.
  741. * The shape class can be fetched by `getShapeClass`
  742. * This method will overwrite the registered shapes, including
  743. * the registered built-in shapes, if using the same `name`.
  744. * The shape can be used in `custom series` and
  745. * `graphic component` by declaring `{type: name}`.
  746. *
  747. * @param name
  748. * @param ShapeClass Can be generated by `extendShape`.
  749. */function mo(t,e){po[t]=e}
  750. /**
  751. * Find shape class registered by `registerShape`. Usually used in
  752. * fetching user defined shape.
  753. *
  754. * [Caution]:
  755. * (1) This method **MUST NOT be used inside echarts !!!**, unless it is prepared
  756. * to use user registered shapes.
  757. * Because the built-in shape (see `getBuiltInShape`) will be registered by
  758. * `registerShape` by default. That enables users to get both built-in
  759. * shapes as well as the shapes belonging to themsleves. But users can overwrite
  760. * the built-in shapes by using names like 'circle', 'rect' via calling
  761. * `registerShape`. So the echarts inner featrues should not fetch shapes from here
  762. * in case that it is overwritten by users, except that some features, like
  763. * `custom series`, `graphic component`, do it deliberately.
  764. *
  765. * (2) In the features like `custom series`, `graphic component`, the user input
  766. * `{tpye: 'xxx'}` does not only specify shapes but also specify other graphic
  767. * elements like `'group'`, `'text'`, `'image'` or event `'path'`. Those names
  768. * are reserved names, that is, if some user registers a shape named `'image'`,
  769. * the shape will not be used. If we intending to add some more reserved names
  770. * in feature, that might bring break changes (disable some existing user shape
  771. * names). But that case probably rarely happens. So we don't make more mechanism
  772. * to resolve this issue here.
  773. *
  774. * @param name
  775. * @return The shape class. If not found, return nothing.
  776. */function vo(t){if(po.hasOwnProperty(t))return po[t]}
  777. /**
  778. * Create a path element from path data string
  779. * @param pathData
  780. * @param opts
  781. * @param rect
  782. * @param layout 'center' or 'cover' default to be cover
  783. */function xo(t,e,n,i){var o=_(t,e);return n&&("center"===i&&(n=bo(n,o.getBoundingRect())),wo(o,n)),o}
  784. /**
  785. * Create a image element from image url
  786. * @param imageUrl image url
  787. * @param opts options
  788. * @param rect constrain rect
  789. * @param layout 'center' or 'cover'. Default to be 'cover'
  790. */function _o(t,e,n){var i=new b({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(t){if("center"===n){var o={width:t.width,height:t.height};i.setStyle(bo(e,o))}}});return i}
  791. /**
  792. * Get position of centered element in bounding box.
  793. *
  794. * @param rect element local bounding box
  795. * @param boundingRect constraint bounding box
  796. * @return element position containing x, y, width, and height
  797. */function bo(t,e){
  798. // Set rect to center, keep width / height ratio.
  799. var n,i=e.width/e.height,o=t.height*i;return n=o<=t.width?t.height:(o=t.width)/i,{x:t.x+t.width/2-o/2,y:t.y+t.height/2-n/2,width:o,height:n}}var So=S;
  800. /**
  801. * Resize a path to fit the rect
  802. * @param path
  803. * @param rect
  804. */function wo(t,e){if(t.applyTransform){var n=t.getBoundingRect().calculateTransform(e);t.applyTransform(n)}}
  805. /**
  806. * Sub pixel optimize line for canvas
  807. */function Mo(t,e){return T(t,t,{lineWidth:e}),t}
  808. /**
  809. * Sub pixel optimize rect for canvas
  810. */
  811. /**
  812. * Sub pixel optimize for canvas
  813. *
  814. * @param position Coordinate, such as x, y
  815. * @param lineWidth Should be nonnegative integer.
  816. * @param positiveOrNegative Default false (negative).
  817. * @return Optimized position.
  818. */
  819. var Io=A;
  820. /**
  821. * Get transform matrix of target (param target),
  822. * in coordinate of its ancestor (param ancestor)
  823. *
  824. * @param target
  825. * @param [ancestor]
  826. */function Do(t,e){for(var n=w([]);t&&t!==e;)M(n,t.getLocalTransform(),n),t=t.parent;return n}
  827. /**
  828. * Apply transform to an vertex.
  829. * @param target [x, y]
  830. * @param transform Can be:
  831. * + Transform matrix: like [1, 0, 0, 1, 0, 0]
  832. * + {position, rotation, scale}, the same as `zrender/Transformable`.
  833. * @param invert Whether use invert matrix.
  834. * @return [x, y]
  835. */function To(t,e,n){return e&&!m(e)&&(e=L.getLocalTransform(e)),n&&(e=k([],e)),P([],t,e)}
  836. /**
  837. * @param direction 'left' 'right' 'top' 'bottom'
  838. * @param transform Transform matrix: like [1, 0, 0, 1, 0, 0]
  839. * @param invert Whether use invert matrix.
  840. * @return Transformed direction. 'left' 'right' 'top' 'bottom'
  841. */function Co(t,e,n){
  842. // Pick a base, ensure that transform result will not be (0, 0).
  843. var i=0===e[4]||0===e[5]||0===e[0]?1:Math.abs(2*e[4]/e[0]),o=0===e[4]||0===e[5]||0===e[2]?1:Math.abs(2*e[4]/e[2]),r=["left"===t?-i:"right"===t?i:0,"top"===t?-o:"bottom"===t?o:0];return r=To(r,e,n),Math.abs(r[0])>Math.abs(r[1])?r[0]>0?"right":"left":r[1]>0?"bottom":"top"}function Ao(t){return!t.isGroup}
  844. /**
  845. * Apply group transition animation from g1 to g2.
  846. * If no animatableModel, no animation.
  847. */
  848. function Lo(t,e,n){if(t&&e){var i,o=(i={},t.traverse((function(t){Ao(t)&&t.anid&&(i[t.anid]=t)})),i);e.traverse((function(t){if(Ao(t)&&t.anid){var e=o[t.anid];if(e){var i=r(t);t.attr(r(e)),io(t,i,n,ni(t).dataIndex)}}}))}function r(t){var e={x:t.x,y:t.y,rotation:t.rotation};return function(t){return null!=t.shape}(t)&&(e.shape=p({},t.shape)),e}}function ko(t,e){
  849. // FIXME: This way might be incorrect when graphic clipped by a corner
  850. // and when element has a border.
  851. return n(t,(function(t){var n=t[0];n=co(n,e.x),n=ho(n,e.x+e.width);var i=t[1];return i=co(i,e.y),[n,i=ho(i,e.y+e.height)]}))}
  852. /**
  853. * Return a new clipped rect. If rect size are negative, return undefined.
  854. */function Po(t,e){var n=co(t.x,e.x),i=ho(t.x+t.width,e.x+e.width),o=co(t.y,e.y),r=ho(t.y+t.height,e.y+e.height);
  855. // If the total rect is cliped, nothing, including the border,
  856. // should be painted. So return undefined.
  857. if(i>=n&&r>=o)return{x:n,y:o,width:i-n,height:r-o}}function No(t,
  858. // Support 'image://' or 'path://' or direct svg path.
  859. e,n){var i=p({rectHover:!0},e),o=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(o.image=t.slice(8),I(o,n),new b(i)):xo(t.replace("path://",""),i,n,"center")}
  860. /**
  861. * Return `true` if the given line (line `a`) and the given polygon
  862. * are intersect.
  863. * Note that we do not count colinear as intersect here because no
  864. * requirement for that. We could do that if required in future.
  865. */function Oo(t,e,n,i,o){for(var r=0,a=o[o.length-1];r<o.length;r++){var s=o[r];if(Ro(t,e,n,i,s[0],s[1],a[0],a[1]))return!0;a=s}}
  866. /**
  867. * Return `true` if the given two lines (line `a` and line `b`)
  868. * are intersect.
  869. * Note that we do not count colinear as intersect here because no
  870. * requirement for that. We could do that if required in future.
  871. */function Ro(t,e,n,i,o,r,a,s){
  872. // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`.
  873. var l,u=n-t,c=i-e,d=a-o,h=s-r,p=Eo(d,h,u,c);if((l=p)<=1e-6&&l>=-1e-6)return!1;
  874. // `vec_m` and `vec_n` are intersect iff
  875. // existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`,
  876. // such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)`
  877. // and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`.
  878. var f=t-o,g=e-r,y=Eo(f,g,u,c)/p;if(y<0||y>1)return!1;var m=Eo(f,g,d,h)/p;return!(m<0||m>1)}
  879. /**
  880. * Cross product of 2-dimension vector.
  881. */function Eo(t,e,n,i){return t*i-n*e}function Vo(e){var n=e.itemTooltipOption,i=e.componentModel,o=e.itemName,r=t(n)?{formatter:n}:n,s=i.mainType,l=i.componentIndex,u={componentType:s,name:o,$vars:["name"]};u[s+"Index"]=l;var c=e.formatterParamsExtra;c&&a(v(c),(function(t){N(u,t)||(u[t]=c[t],u.$vars.push(t))}));var d=ni(e.el);d.componentMainType=s,d.componentIndex=l,d.tooltipConfig={name:o,option:I({content:o,encodeHTMLContent:!0,formatterParams:u},r)}}function zo(t,e){var n;
  882. // TODO
  883. // Polyfill for fixing zrender group traverse don't visit it's root issue.
  884. t.isGroup&&(n=e(t)),n||t.traverse(e)}function Bo(t,e){if(t)if(i(t))for(var n=0;n<t.length;n++)zo(t[n],e);else zo(t,e)}
  885. // Register built-in shapes. These shapes might be overwritten
  886. // by users, although we do not recommend that.
  887. mo("circle",O),mo("ellipse",R),mo("sector",E),mo("ring",V),mo("polygon",z),mo("polyline",B),mo("rect",G),mo("line",F),mo("bezierCurve",W),mo("arc",H);const Go=Object.freeze(Object.defineProperty({__proto__:null,Arc:H,BezierCurve:W,BoundingRect:Y,Circle:O,CompoundPath:U,Ellipse:R,Group:Z,Image:b,IncrementalDisplayable:X,Line:F,LinearGradient:j,OrientedBoundingRect:q,Path:g,Point:K,Polygon:z,Polyline:B,RadialGradient:J,Rect:G,Ring:V,Sector:E,Text:$,applyTransform:To,clipPointsByRect:ko,clipRectByRect:Po,createIcon:No,extendPath:yo,extendShape:fo,getShapeClass:vo,getTransform:Do,groupTransition:Lo,initProps:oo,isElementRemoved:ro,lineLineIntersect:Ro,linePolygonIntersect:Oo,makeImage:_o,makePath:xo,mergePath:So,registerShape:mo,removeElement:ao,removeElementWithFadeOut:lo,resizePath:wo,setTooltipConfig:Vo,subPixelOptimize:Io,subPixelOptimizeLine:Mo,subPixelOptimizeRect:function(t){return C(t.shape,t.shape,t.style),t},transformDirection:Co,traverseElements:Bo,updateProps:io},Symbol.toStringTag,{value:"Module"}));var Fo={};function Wo(t,e){for(var n=0;n<li.length;n++){var i=li[n],o=e[i],r=t.ensureState(i);r.style=r.style||{},r.style.text=o}var a=t.currentStates.slice();t.clearStates(!0),t.setStyle({text:e.normal}),t.useStates(a,!0)}function Ho(t,e,n){var i,o=t.labelFetcher,r=t.labelDataIndex,a=t.labelDimIndex,s=e.normal;o&&(i=o.getFormattedLabel(r,"normal",null,a,s&&s.get("formatter"),null!=n?{interpolatedValue:n}:null)),null==i&&(i=f(t.defaultText)?t.defaultText(r,t,n):t.defaultText);for(var l={normal:i},u=0;u<li.length;u++){var c=li[u],d=e[c];l[c]=x(o?o.getFormattedLabel(r,c,null,a,d&&d.get("formatter")):null,i)}return l}function Yo(t,e,n,i){n=n||Fo;for(var o=t instanceof $,r=!1,a=0;a<ui.length;a++){if((h=e[ui[a]])&&h.getShallow("show")){r=!0;break}}var s=o?t:t.getTextContent();if(r){o||(
  888. // Reuse the previous
  889. s||(s=new $,t.setTextContent(s)),
  890. // Use same state proxy
  891. t.stateProxy&&(s.stateProxy=t.stateProxy));var l=Ho(n,e),u=e.normal,c=!!u.getShallow("show"),d=Zo(u,i&&i.normal,n,!1,!o);d.text=l.normal,o||
  892. // Always create new
  893. t.setTextConfig(Xo(u,n,!1));for(a=0;a<li.length;a++){var h,p=li[a];if(h=e[p]){var f=s.ensureState(p),g=!!x(h.getShallow("show"),c);if(g!==c&&(f.ignore=!g),f.style=Zo(h,i&&i[p],n,!0,!o),f.style.text=l[p],!o)t.ensureState(p).textConfig=Xo(h,n,!0)}}
  894. // PENDING: if there is many requirements that emphasis position
  895. // need to be different from normal position, we might consider
  896. // auto silent is those cases.
  897. s.silent=!!u.getShallow("silent"),
  898. // Keep x and y
  899. null!=s.style.x&&(d.x=s.style.x),null!=s.style.y&&(d.y=s.style.y),s.ignore=!c,
  900. // Always create new style.
  901. s.useStyle(d),s.dirty(),n.enableTextSetter&&(Qo(s).setLabelText=function(t){var i=Ho(n,e,t);Wo(s,i)})}else s&&(
  902. // Not display rich text.
  903. s.ignore=!0);t.dirty()}function Uo(t,e){e=e||"label";for(var n={normal:t.getModel(e)},i=0;i<li.length;i++){var o=li[i];n[o]=t.getModel([o,e])}return n}
  904. /**
  905. * Set basic textStyle properties.
  906. */function Zo(t,e,
  907. // Fixed style in the code. Can't be set by model.
  908. n,i,o){var r={};
  909. // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);
  910. /**
  911. * The uniform entry of set text style, that is, retrieve style definitions
  912. * from `model` and set to `textStyle` object.
  913. *
  914. * Never in merge mode, but in overwrite mode, that is, all of the text style
  915. * properties will be set. (Consider the states of normal and emphasis and
  916. * default value can be adopted, merge would make the logic too complicated
  917. * to manage.)
  918. */
  919. return function(t,e,n,i,o){
  920. // Consider there will be abnormal when merge hover style to normal style if given default value.
  921. n=n||Fo;var r,a=e.ecModel,s=a&&a.option.textStyle,l=
  922. // Consider case:
  923. // {
  924. // data: [{
  925. // value: 12,
  926. // label: {
  927. // rich: {
  928. // // no 'a' here but using parent 'a'.
  929. // }
  930. // }
  931. // }],
  932. // rich: {
  933. // a: { ... }
  934. // }
  935. // }
  936. // TODO TextStyleModel
  937. function(t){
  938. // Use object to remove duplicated names.
  939. var e;for(;t&&t!==t.ecModel;){var n=(t.option||Fo).rich;if(n){e=e||{};for(var i=v(n),o=0;o<i.length;o++){e[i[o]]=1}}t=t.parentModel}return e}(e);if(l)for(var u in r={},l)if(l.hasOwnProperty(u)){
  940. // Cascade is supported in rich.
  941. var c=e.getModel(["rich",u]);
  942. // In rich, never `disableBox`.
  943. // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`,
  944. // the default color `'blue'` will not be adopted if no color declared in `rich`.
  945. // That might confuses users. So probably we should put `textStyleModel` as the
  946. // root ancestor of the `richTextStyle`. But that would be a break change.
  947. Jo(r[u]={},c,s,n,i,o,!1,!0)}r&&(t.rich=r);var d=e.get("overflow");d&&(t.overflow=d);var h=e.get("minMargin");null!=h&&(t.margin=h);Jo(t,e,s,n,i,o,!0,!1)}(r,t,n,i,o),e&&p(r,e),r}function Xo(t,e,n){e=e||{};var i,o={},r=t.getShallow("rotate"),a=x(t.getShallow("distance"),n?null:5),s=t.getShallow("offset");
  948. // 'outside' is not a valid zr textPostion value, but used
  949. // in bar series, and magric type should be considered.
  950. return"outside"===(i=t.getShallow("position")||(n?null:"inside"))&&(i=e.defaultOutsidePosition||"top"),null!=i&&(o.position=i),null!=s&&(o.offset=s),null!=r&&(r*=Math.PI/180,o.rotation=r),null!=a&&(o.distance=a),
  951. // fill and auto is determined by the color of path fill if it's not specified by developers.
  952. o.outsideFill="inherit"===t.get("color")?e.inheritColor||null:"auto",o}var jo=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],qo=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],Ko=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function Jo(t,e,n,i,o,r,a,s){
  953. // In merge mode, default value should not be given.
  954. n=!o&&n||Fo;var l=i&&i.inheritColor,u=e.getShallow("color"),c=e.getShallow("textBorderColor"),d=x(e.getShallow("opacity"),n.opacity);"inherit"!==u&&"auto"!==u||(u=l||null),"inherit"!==c&&"auto"!==c||(c=l||null),r||(
  955. // Only use default global textStyle.color if text is individual.
  956. // Otherwise it will use the strategy of attached text color because text may be on a path.
  957. u=u||n.color,c=c||n.textBorderColor),null!=u&&(t.fill=u),null!=c&&(t.stroke=c);var h=x(e.getShallow("textBorderWidth"),n.textBorderWidth);null!=h&&(t.lineWidth=h);var p=x(e.getShallow("textBorderType"),n.textBorderType);null!=p&&(t.lineDash=p);var f=x(e.getShallow("textBorderDashOffset"),n.textBorderDashOffset);null!=f&&(t.lineDashOffset=f),o||null!=d||s||(d=i&&i.defaultOpacity),null!=d&&(t.opacity=d),
  958. // TODO
  959. o||r||
  960. // Set default finally.
  961. null==t.fill&&i.inheritColor&&(t.fill=i.inheritColor);
  962. // Do not use `getFont` here, because merge should be supported, where
  963. // part of these properties may be changed in emphasis style, and the
  964. // others should remain their original value got from normal style.
  965. for(var g=0;g<jo.length;g++){var y=jo[g];null!=(v=x(e.getShallow(y),n[y]))&&(t[y]=v)}for(g=0;g<qo.length;g++){y=qo[g];null!=(v=e.getShallow(y))&&(t[y]=v)}if(null==t.verticalAlign){var m=e.getShallow("baseline");null!=m&&(t.verticalAlign=m)}if(!a||!i.disableBox){for(g=0;g<Ko.length;g++){var v;y=Ko[g];null!=(v=e.getShallow(y))&&(t[y]=v)}var _=e.getShallow("borderType");null!=_&&(t.borderDash=_),"auto"!==t.backgroundColor&&"inherit"!==t.backgroundColor||!l||(t.backgroundColor=l),"auto"!==t.borderColor&&"inherit"!==t.borderColor||!l||(t.borderColor=l)}}function $o(t,e){var n=e&&e.getModel("textStyle");return Q([
  966. // FIXME in node-canvas fontWeight is before fontStyle
  967. t.fontStyle||n&&n.getShallow("fontStyle")||"",t.fontWeight||n&&n.getShallow("fontWeight")||"",(t.fontSize||n&&n.getShallow("fontSize")||12)+"px",t.fontFamily||n&&n.getShallow("fontFamily")||"sans-serif"].join(" "))}var Qo=On();function tr(t,e,n,i){if(t){var o=Qo(t);o.prevValue=o.value,o.value=n;var r=e.normal;o.valueAnimation=r.get("valueAnimation"),o.valueAnimation&&(o.precision=r.get("precision"),o.defaultInterpolatedText=i,o.statesModels=e)}}function er(t,e,n,i,o){var r=Qo(t);if(r.valueAnimation&&r.prevValue!==r.value){var a=r.defaultInterpolatedText,s=x(r.interpolatedValue,r.prevValue),l=r.value;
  968. // Consider the case that being animating, do not use the `obj.value`,
  969. // Otherwise it will jump to the `obj.value` when this new animation started.
  970. t.percent=0,(null==r.prevValue?oo:io)(t,{
  971. // percent is used to prevent animation from being aborted #15916
  972. percent:1},i,e,null,(function(i){var u=Hn(n,r.precision,s,l,i);r.interpolatedValue=1===i?null:u;var c=Ho({labelDataIndex:e,labelFetcher:o,defaultText:a?a(u):u+""},r.statesModels,u);Wo(t,c)}))}}var nr=["textStyle","color"],ir=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],or=new $,rr=/** @class */function(){function t(){}
  973. /**
  974. * Get color property or get color from option.textStyle.color
  975. */
  976. // TODO Callback
  977. return t.prototype.getTextColor=function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(nr):null)},
  978. /**
  979. * Create font string from fontStyle, fontWeight, fontSize, fontFamily
  980. * @return {string}
  981. */
  982. t.prototype.getFont=function(){return $o({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(t){for(var e={text:t,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n<ir.length;n++)e[ir[n]]=this.getShallow(ir[n]);return or.useStyle(e),or.update(),or.getBoundingRect()},t}();const ar=rr;var sr,lr,ur=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],cr=Qn(ur),dr=/** @class */function(){function t(){}return t.prototype.getLineStyle=function(t){return cr(this,t)},t}(),hr=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],pr=Qn(hr),fr=/** @class */function(){function t(){}return t.prototype.getItemStyle=function(t,e){return pr(this,t,e)},t}(),gr=/** @class */function(){function t(t,e,n){this.parentModel=e,this.ecModel=n,this.option=t}return t.prototype.init=function(t,e,n){},
  983. /**
  984. * Merge the input option to me.
  985. */
  986. t.prototype.mergeOption=function(t,e){tt(this.option,t,!0)},
  987. // `path` can be 'a.b.c', so the return value type have to be `ModelOption`
  988. // TODO: TYPE strict key check?
  989. // get(path: string | string[], ignoreParent?: boolean): ModelOption;
  990. t.prototype.get=function(t,e){return null==t?this.option:this._doGet(this.parsePath(t),!e&&this.parentModel)},t.prototype.getShallow=function(t,e){var n=this.option,i=null==n?n:n[t];if(null==i&&!e){var o=this.parentModel;o&&(
  991. // FIXME:TS do not know how to make it works
  992. i=o.getShallow(t))}return i},
  993. // `path` can be 'a.b.c', so the return value type have to be `Model<ModelOption>`
  994. // getModel(path: string | string[], parentModel?: Model): Model;
  995. // TODO 'a.b.c' is deprecated
  996. t.prototype.getModel=function(e,n){var i=null!=e,o=i?this.parsePath(e):null;return new t(i?this._doGet(o):this.option,n=n||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(o)),this.ecModel)},
  997. /**
  998. * If model has option
  999. */
  1000. t.prototype.isEmpty=function(){return null==this.option},t.prototype.restoreData=function(){},
  1001. // Pending
  1002. t.prototype.clone=function(){return new(0,this.constructor)(et(this.option))},
  1003. // setReadOnly(properties): void {
  1004. // clazzUtil.setReadOnly(this, properties);
  1005. // }
  1006. // If path is null/undefined, return null/undefined.
  1007. t.prototype.parsePath=function(t){return"string"==typeof t?t.split("."):t},
  1008. // Resolve path for parent. Perhaps useful when parent use a different property.
  1009. // Default to be a identity resolver.
  1010. // Can be modified to a different resolver.
  1011. t.prototype.resolveParentPath=function(t){return t},
  1012. // FIXME:TS check whether put this method here
  1013. t.prototype.isAnimationEnabled=function(){if(!d.node&&this.option){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},t.prototype._doGet=function(t,e){var n=this.option;if(!t)return n;for(var i=0;i<t.length&&(!t[i]||null!=(
  1014. // obj could be number/string/... (like 0)
  1015. n=n&&"object"==typeof n?n[t[i]]:null));i++);return null==n&&e&&(n=e._doGet(this.resolveParentPath(t),e.parentModel)),n},t}();
  1016. // Enable Model.extend.
  1017. Xn(gr),sr=gr,lr=["__\0is_clz",qn++].join("_"),sr.prototype[lr]=!0,sr.isInstance=function(t){return!(!t||!t[lr])},nt(gr,dr),nt(gr,fr),nt(gr,ei),nt(gr,ar);const yr=gr;
  1018. // A random offset
  1019. var mr=Math.round(10*Math.random());
  1020. /**
  1021. * @public
  1022. * @param {string} type
  1023. * @return {string}
  1024. */function vr(t){
  1025. // Considering the case of crossing js context,
  1026. // use Math.random to make id as unique as possible.
  1027. return[t||"",mr++].join("_")}
  1028. /**
  1029. * Implements `SubTypeDefaulterManager` for `target`.
  1030. */function xr(t,e){
  1031. // See also `model/Component.ts#getDefaultOption`
  1032. return tt(tt({},t,!0),e,!0)}
  1033. /*
  1034. * Licensed to the Apache Software Foundation (ASF) under one
  1035. * or more contributor license agreements. See the NOTICE file
  1036. * distributed with this work for additional information
  1037. * regarding copyright ownership. The ASF licenses this file
  1038. * to you under the Apache License, Version 2.0 (the
  1039. * "License"); you may not use this file except in compliance
  1040. * with the License. You may obtain a copy of the License at
  1041. *
  1042. * http://www.apache.org/licenses/LICENSE-2.0
  1043. *
  1044. * Unless required by applicable law or agreed to in writing,
  1045. * software distributed under the License is distributed on an
  1046. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  1047. * KIND, either express or implied. See the License for the
  1048. * specific language governing permissions and limitations
  1049. * under the License.
  1050. */
  1051. /**
  1052. * AUTO-GENERATED FILE. DO NOT MODIFY.
  1053. */
  1054. /*
  1055. * Licensed to the Apache Software Foundation (ASF) under one
  1056. * or more contributor license agreements. See the NOTICE file
  1057. * distributed with this work for additional information
  1058. * regarding copyright ownership. The ASF licenses this file
  1059. * to you under the Apache License, Version 2.0 (the
  1060. * "License"); you may not use this file except in compliance
  1061. * with the License. You may obtain a copy of the License at
  1062. *
  1063. * http://www.apache.org/licenses/LICENSE-2.0
  1064. *
  1065. * Unless required by applicable law or agreed to in writing,
  1066. * software distributed under the License is distributed on an
  1067. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  1068. * KIND, either express or implied. See the License for the
  1069. * specific language governing permissions and limitations
  1070. * under the License.
  1071. */
  1072. /**
  1073. * Language: English.
  1074. */var _r="ZH",br="EN",Sr=br,wr={},Mr={},Ir=d.domSupported&&/* eslint-disable-next-line */(document.documentElement.lang||navigator.language||navigator.browserLanguage||Sr).toUpperCase().indexOf(_r)>-1?_r:Sr;function Dr(t,e){t=t.toUpperCase(),Mr[t]=new yr(e),wr[t]=e}
  1075. // export function getLocale(locale: string) {
  1076. // return localeStorage[locale];
  1077. // }
  1078. function Tr(t){return Mr[t]}
  1079. // Default locale
  1080. Dr(br,{time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}}),Dr(_r,{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var Cr=1e3,Ar=6e4,Lr=36e5,kr=864e5,Pr=31536e6,Nr={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},Or="{yyyy}-{MM}-{dd}",Rr={year:"{yyyy}",month:"{yyyy}-{MM}",day:Or,hour:Or+" "+Nr.hour,minute:Or+" "+Nr.minute,second:Or+" "+Nr.second,millisecond:Nr.none},Er=["year","month","day","hour","minute","second","millisecond"],Vr=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function zr(t,e){return"0000".substr(0,e-(t+="").length)+t}function Br(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:
  1081. // year, minutes, second, milliseconds
  1082. return t}}function Gr(t){return t===Br(t)}function Fr(
  1083. // Note: The result based on `isUTC` are totally different, which can not be just simply
  1084. // substituted by the result without `isUTC`. So we make the param `isUTC` mandatory.
  1085. t,e,n,i){var o=sn(t),r=o[Yr(n)](),a=o[Ur(n)]()+1,s=Math.floor((a-1)/3)+1,l=o[Zr(n)](),u=o["get"+(n?"UTC":"")+"Day"](),c=o[Xr(n)](),d=(c-1)%12+1,h=o[jr(n)](),p=o[qr(n)](),f=o[Kr(n)](),g=c>=12?"pm":"am",y=g.toUpperCase(),m=(i instanceof yr?i:Tr(i||Ir)||Mr[Sr]).getModel("time"),v=m.get("month"),x=m.get("monthAbbr"),_=m.get("dayOfWeek"),b=m.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,g+"").replace(/{A}/g,y+"").replace(/{yyyy}/g,r+"").replace(/{yy}/g,zr(r%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,v[a-1]).replace(/{MMM}/g,x[a-1]).replace(/{MM}/g,zr(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,zr(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,_[u]).replace(/{ee}/g,b[u]).replace(/{e}/g,u+"").replace(/{HH}/g,zr(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,zr(d+"",2)).replace(/{h}/g,d+"").replace(/{mm}/g,zr(h,2)).replace(/{m}/g,h+"").replace(/{ss}/g,zr(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,zr(f,3)).replace(/{S}/g,f+"")}function Wr(t,e){var n=sn(t),i=n[Ur(e)]()+1,o=n[Zr(e)](),r=n[Xr(e)](),a=n[jr(e)](),s=n[qr(e)](),l=0===n[Kr(e)](),u=l&&0===s,c=u&&0===a,d=c&&0===r,h=d&&1===o;return h&&1===i?"year":h?"month":d?"day":c?"hour":u?"minute":l?"second":"millisecond"}function Hr(t,e,n){var i=l(t)?sn(t):t;switch(e=e||Wr(t,n)){case"year":return i[Yr(n)]();case"half-year":return i[Ur(n)]()>=6?1:0;case"quarter":return Math.floor((i[Ur(n)]()+1)/4);case"month":return i[Ur(n)]();case"day":return i[Zr(n)]();case"half-day":return i[Xr(n)]()/24;case"hour":return i[Xr(n)]();case"minute":return i[jr(n)]();case"second":return i[qr(n)]();case"millisecond":return i[Kr(n)]()}}function Yr(t){return t?"getUTCFullYear":"getFullYear"}function Ur(t){return t?"getUTCMonth":"getMonth"}function Zr(t){return t?"getUTCDate":"getDate"}function Xr(t){return t?"getUTCHours":"getHours"}function jr(t){return t?"getUTCMinutes":"getMinutes"}function qr(t){return t?"getUTCSeconds":"getSeconds"}function Kr(t){return t?"getUTCMilliseconds":"getMilliseconds"}function Jr(t){return t?"setUTCFullYear":"setFullYear"}function $r(t){return t?"setUTCMonth":"setMonth"}function Qr(t){return t?"setUTCDate":"setDate"}function ta(t){return t?"setUTCHours":"setHours"}function ea(t){return t?"setUTCMinutes":"setMinutes"}function na(t){return t?"setUTCSeconds":"setSeconds"}function ia(t){return t?"setUTCMilliseconds":"setMilliseconds"}
  1086. /**
  1087. * Add a comma each three digit.
  1088. */
  1089. function oa(e){if(!fn(e))return t(e)?e:"-";var n=(e+"").split(".");return n[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(n.length>1?"."+n[1]:"")}function ra(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()})),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var aa=it;
  1090. /**
  1091. * Make value user readable for tooltip and label.
  1092. * "User readable":
  1093. * Try to not print programmer-specific text like NaN, Infinity, null, undefined.
  1094. * Avoid to display an empty string, which users can not recognize there is
  1095. * a value and it might look like a bug.
  1096. */function sa(t,e,n){function i(t){return t&&Q(t)?t:"-"}function o(t){return!(null==t||isNaN(t)||!isFinite(t))}var r="time"===e,a=t instanceof Date;if(r||a){var s=r?sn(t):t;if(!isNaN(+s))return Fr(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);
  1097. // In other cases, continue to try to display the value in the following code.
  1098. if(a)return"-"}if("ordinal"===e)return u(t)?i(t):l(t)&&o(t)?t+"":"-";
  1099. // By default.
  1100. var c=pn(t);return o(c)?oa(c):u(t)?i(t):"boolean"==typeof t?t+"":"-"}var la=["a","b","c","d","e","f","g"],ua=function(t,e){return"{"+t+(null==e?"":e)+"}"};
  1101. /**
  1102. * Template formatter
  1103. * @param {Array.<Object>|Object} paramsList
  1104. */
  1105. function ca(t,e,n){i(e)||(e=[e]);var o=e.length;if(!o)return"";for(var r=e[0].$vars||[],a=0;a<r.length;a++){var s=la[a];t=t.replace(ua(s),ua(s,0))}for(var l=0;l<o;l++)for(var u=0;u<r.length;u++){var c=e[l][r[u]];t=t.replace(ua(la[u],l),n?ot(c):c)}return t}
  1106. /**
  1107. * simple Template formatter
  1108. */function da(e,n){var i=t(e)?{color:e,extraCssText:n}:e||{},o=i.color,r=i.type;n=i.extraCssText;var a=i.renderMode||"html";return o?"html"===a?"subItem"===r?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+ot(o)+";"+(n||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+ot(o)+";"+(n||"")+'"></span>':{renderMode:a,content:"{"+(i.markerId||"markerX")+"|} ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:o}:{width:10,height:10,borderRadius:5,backgroundColor:o}}:""}
  1109. /**
  1110. * @deprecated Use `time/format` instead.
  1111. * ISO Date format
  1112. * @param {string} tpl
  1113. * @param {number} value
  1114. * @param {boolean} [isUTC=false] Default in local time.
  1115. * see `module:echarts/scale/Time`
  1116. * and `module:echarts/util/number#parseDate`.
  1117. * @inner
  1118. */
  1119. /**
  1120. * @return Never be null/undefined.
  1121. */
  1122. function ha(e,n){return n=n||"transparent",t(e)?e:o(e)&&e.colorStops&&(e.colorStops[0]||{}).color||n}
  1123. /**
  1124. * open new tab
  1125. * @param link url
  1126. * @param target blank or self
  1127. */function pa(t,e){
  1128. /* global window */
  1129. if("_blank"===e||"blank"===e){var n=window.open();n.opener=null,n.location.href=t}else window.open(t,e)}var fa=a,ga=["left","right","top","bottom","width","height"],ya=[["width","left","right"],["height","top","bottom"]];
  1130. /**
  1131. * @public
  1132. */function ma(t,e,n,i,o){var r=0,a=0;null==i&&(i=Infinity),null==o&&(o=Infinity);var s=0;e.eachChild((function(l,u){var c,d,h=l.getBoundingRect(),p=e.childAt(u+1),f=p&&p.getBoundingRect();if("horizontal"===t){var g=h.width+(f?-f.x+h.x:0);
  1133. // Wrap when width exceeds maxWidth or meet a `newline` group
  1134. // FIXME compare before adding gap?
  1135. (c=r+g)>i||l.newline?(r=0,c=g,a+=s+n,s=h.height):
  1136. // FIXME: consider rect.y is not `0`?
  1137. s=Math.max(s,h.height)}else{var y=h.height+(f?-f.y+h.y:0);
  1138. // Wrap when width exceeds maxHeight or meet a `newline` group
  1139. (d=a+y)>o||l.newline?(r+=s+n,a=0,d=y,s=h.width):s=Math.max(s,h.width)}l.newline||(l.x=r,l.y=a,l.markRedraw(),"horizontal"===t?r=c+n:a=d+n)}))}
  1140. /**
  1141. * VBox or HBox layouting
  1142. * @param {string} orient
  1143. * @param {module:zrender/graphic/Group} group
  1144. * @param {number} gap
  1145. * @param {number} [width=Infinity]
  1146. * @param {number} [height=Infinity]
  1147. */var va=ma;
  1148. /**
  1149. * VBox layouting
  1150. * @param {module:zrender/graphic/Group} group
  1151. * @param {number} gap
  1152. * @param {number} [width=Infinity]
  1153. * @param {number} [height=Infinity]
  1154. */
  1155. /**
  1156. * Parse position info.
  1157. */
  1158. function xa(t,e,n){n=aa(n||0);var i=e.width,o=e.height,r=je(t.left,i),a=je(t.top,o),s=je(t.right,i),l=je(t.bottom,o),u=je(t.width,i),c=je(t.height,o),d=n[2]+n[0],h=n[1]+n[3],p=t.aspect;
  1159. // Align left and top
  1160. switch(
  1161. // If width is not specified, calculate width from left and right
  1162. isNaN(u)&&(u=i-s-h-r),isNaN(c)&&(c=o-l-d-a),null!=p&&(
  1163. // If width and height are not given
  1164. // 1. Graph should not exceeds the container
  1165. // 2. Aspect must be keeped
  1166. // 3. Graph should take the space as more as possible
  1167. // FIXME
  1168. // Margin is not considered, because there is no case that both
  1169. // using margin and aspect so far.
  1170. isNaN(u)&&isNaN(c)&&(p>i/o?u=.8*i:c=.8*o),
  1171. // Calculate width or height with given aspect
  1172. isNaN(u)&&(u=p*c),isNaN(c)&&(c=u/p)),
  1173. // If left is not specified, calculate left from right and width
  1174. isNaN(r)&&(r=i-s-u-h),isNaN(a)&&(a=o-l-c-d),t.left||t.right){case"center":r=i/2-u/2-n[3];break;case"right":r=i-u-h}switch(t.top||t.bottom){case"middle":case"center":a=o/2-c/2-n[0];break;case"bottom":a=o-c-d}
  1175. // If something is wrong and left, top, width, height are calculated as NaN
  1176. r=r||0,a=a||0,isNaN(u)&&(
  1177. // Width may be NaN if only one value is given except width
  1178. u=i-h-r-(s||0)),isNaN(c)&&(
  1179. // Height may be NaN if only one value is given except height
  1180. c=o-d-a-(l||0));var f=new Y(r+n[3],a+n[0],u,c);return f.margin=n,f}
  1181. /**
  1182. * Position a zr element in viewport
  1183. * Group position is specified by either
  1184. * {left, top}, {right, bottom}
  1185. * If all properties exists, right and bottom will be igonred.
  1186. *
  1187. * Logic:
  1188. * 1. Scale (against origin point in parent coord)
  1189. * 2. Rotate (against origin point in parent coord)
  1190. * 3. Translate (with el.position by this method)
  1191. * So this method only fixes the last step 'Translate', which does not affect
  1192. * scaling and rotating.
  1193. *
  1194. * If be called repeatedly with the same input el, the same result will be gotten.
  1195. *
  1196. * Return true if the layout happened.
  1197. *
  1198. * @param el Should have `getBoundingRect` method.
  1199. * @param positionInfo
  1200. * @param positionInfo.left
  1201. * @param positionInfo.top
  1202. * @param positionInfo.right
  1203. * @param positionInfo.bottom
  1204. * @param positionInfo.width Only for opt.boundingModel: 'raw'
  1205. * @param positionInfo.height Only for opt.boundingModel: 'raw'
  1206. * @param containerRect
  1207. * @param margin
  1208. * @param opt
  1209. * @param opt.hv Only horizontal or only vertical. Default to be [1, 1]
  1210. * @param opt.boundingMode
  1211. * Specify how to calculate boundingRect when locating.
  1212. * 'all': Position the boundingRect that is transformed and uioned
  1213. * both itself and its descendants.
  1214. * This mode simplies confine the elements in the bounding
  1215. * of their container (e.g., using 'right: 0').
  1216. * 'raw': Position the boundingRect that is not transformed and only itself.
  1217. * This mode is useful when you want a element can overflow its
  1218. * container. (Consider a rotated circle needs to be located in a corner.)
  1219. * In this mode positionInfo.width/height can only be number.
  1220. */function _a(t,e,n,i,o,r){var a,s=!o||!o.hv||o.hv[0],l=!o||!o.hv||o.hv[1],u=o&&o.boundingMode||"all";if((r=r||t).x=t.x,r.y=t.y,!s&&!l)return!1;if("raw"===u)a="group"===t.type?new Y(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(a=t.getBoundingRect(),t.needLocalTransform()){var c=t.getLocalTransform();
  1221. // Notice: raw rect may be inner object of el,
  1222. // which should not be modified.
  1223. (a=a.clone()).applyTransform(c)}
  1224. // The real width and height can not be specified but calculated by the given el.
  1225. var d=xa(I({width:a.width,height:a.height},e),n,i),h=s?d.x-a.x:0,p=l?d.y-a.y:0;
  1226. // Because 'tranlate' is the last step in transform
  1227. // (see zrender/core/Transformable#getLocalTransform),
  1228. // we can just only modify el.position to get final result.
  1229. return"raw"===u?(r.x=h,r.y=p):(r.x+=h,r.y+=p),r===t&&t.markRedraw(),!0}
  1230. /**
  1231. * @param option Contains some of the properties in HV_NAMES.
  1232. * @param hvIdx 0: horizontal; 1: vertical.
  1233. */function ba(t){var e=t.layoutMode||t.constructor.layoutMode;return o(e)?e:e?{type:e}:null}
  1234. /**
  1235. * Consider Case:
  1236. * When default option has {left: 0, width: 100}, and we set {right: 0}
  1237. * through setOption or media query, using normal zrUtil.merge will cause
  1238. * {right: 0} does not take effect.
  1239. *
  1240. * @example
  1241. * ComponentModel.extend({
  1242. * init: function () {
  1243. * ...
  1244. * let inputPositionParams = layout.getLayoutParams(option);
  1245. * this.mergeOption(inputPositionParams);
  1246. * },
  1247. * mergeOption: function (newOption) {
  1248. * newOption && zrUtil.merge(thisOption, newOption, true);
  1249. * layout.mergeLayoutParam(thisOption, newOption);
  1250. * }
  1251. * });
  1252. *
  1253. * @param targetOption
  1254. * @param newOption
  1255. * @param opt
  1256. */function Sa(t,e,n){var o=n&&n.ignoreSize;!i(o)&&(o=[o,o]);var r=s(ya[0],0),a=s(ya[1],1);function s(n,i){var r={},a=0,s={},c=0;if(fa(n,(function(e){s[e]=t[e]})),fa(n,(function(t){
  1257. // Consider case: newOption.width is null, which is
  1258. // set by user for removing width setting.
  1259. l(e,t)&&(r[t]=s[t]=e[t]),u(r,t)&&a++,u(s,t)&&c++})),o[i])
  1260. // Only one of left/right is premitted to exist.
  1261. return u(e,n[1])?s[n[2]]=null:u(e,n[2])&&(s[n[1]]=null),s;
  1262. // Case: newOption: {width: ..., right: ...},
  1263. // or targetOption: {right: ...} and newOption: {width: ...},
  1264. // There is no conflict when merged only has params count
  1265. // little than enoughParamNumber.
  1266. if(2!==c&&a){if(a>=2)return r;
  1267. // Chose another param from targetOption by priority.
  1268. for(var d=0;d<n.length;d++){var h=n[d];if(!l(r,h)&&l(t,h)){r[h]=t[h];break}}return r}return s}function l(t,e){return t.hasOwnProperty(e)}function u(t,e){return null!=t[e]&&"auto"!==t[e]}function c(t,e,n){fa(t,(function(t){e[t]=n[t]}))}c(ya[0],t,r),c(ya[1],t,a)}
  1269. /**
  1270. * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.
  1271. */function wa(t){return Ma({},t)}
  1272. /**
  1273. * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.
  1274. * @param {Object} source
  1275. * @return {Object} Result contains those props.
  1276. */function Ma(t,e){return e&&t&&fa(ga,(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}rt(ma,"vertical"),
  1277. /**
  1278. * HBox layouting
  1279. * @param {module:zrender/graphic/Group} group
  1280. * @param {number} gap
  1281. * @param {number} [width=Infinity]
  1282. * @param {number} [height=Infinity]
  1283. */
  1284. rt(ma,"horizontal");var Ia=On(),Da=/** @class */function(t){function e(e,n,i){var o=t.call(this,e,n,i)||this;return o.uid=vr("ec_cpt_model"),o}return Ue(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},e.prototype.mergeDefaultAndTheme=function(t,e){var n=ba(this),i=n?wa(t):{},o=e.getTheme();tt(t,o.get(this.mainType)),tt(t,this.getDefaultOption()),n&&Sa(t,i,n)},e.prototype.mergeOption=function(t,e){tt(this.option,t,!0);var n=ba(this);n&&Sa(this.option,t,n)},
  1285. /**
  1286. * Called immediately after `init` or `mergeOption` of this instance called.
  1287. */
  1288. e.prototype.optionUpdated=function(t,e){},
  1289. /**
  1290. * [How to declare defaultOption]:
  1291. *
  1292. * (A) If using class declaration in typescript (since echarts 5):
  1293. * ```ts
  1294. * import {ComponentOption} from '../model/option.js';
  1295. * export interface XxxOption extends ComponentOption {
  1296. * aaa: number
  1297. * }
  1298. * export class XxxModel extends Component {
  1299. * static type = 'xxx';
  1300. * static defaultOption: XxxOption = {
  1301. * aaa: 123
  1302. * }
  1303. * }
  1304. * Component.registerClass(XxxModel);
  1305. * ```
  1306. * ```ts
  1307. * import {inheritDefaultOption} from '../util/component.js';
  1308. * import {XxxModel, XxxOption} from './XxxModel.js';
  1309. * export interface XxxSubOption extends XxxOption {
  1310. * bbb: number
  1311. * }
  1312. * class XxxSubModel extends XxxModel {
  1313. * static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, {
  1314. * bbb: 456
  1315. * })
  1316. * fn() {
  1317. * let opt = this.getDefaultOption();
  1318. * // opt is {aaa: 123, bbb: 456}
  1319. * }
  1320. * }
  1321. * ```
  1322. *
  1323. * (B) If using class extend (previous approach in echarts 3 & 4):
  1324. * ```js
  1325. * let XxxComponent = Component.extend({
  1326. * defaultOption: {
  1327. * xx: 123
  1328. * }
  1329. * })
  1330. * ```
  1331. * ```js
  1332. * let XxxSubComponent = XxxComponent.extend({
  1333. * defaultOption: {
  1334. * yy: 456
  1335. * },
  1336. * fn: function () {
  1337. * let opt = this.getDefaultOption();
  1338. * // opt is {xx: 123, yy: 456}
  1339. * }
  1340. * })
  1341. * ```
  1342. */
  1343. e.prototype.getDefaultOption=function(){var t=this.constructor;
  1344. // If using class declaration, it is different to travel super class
  1345. // in legacy env and auto merge defaultOption. So if using class
  1346. // declaration, defaultOption should be merged manually.
  1347. if(!function(t){return!(!t||!t[Un])}(t))
  1348. // When using ts class, defaultOption must be declared as static.
  1349. return t.defaultOption;
  1350. // FIXME: remove this approach?
  1351. var e=Ia(this);if(!e.defaultOption){for(var n=[],i=t;i;){var o=i.prototype.defaultOption;o&&n.push(o),i=i.superClass}for(var r={},a=n.length-1;a>=0;a--)r=tt(r,n[a],!0);e.defaultOption=r}return e.defaultOption},
  1352. /**
  1353. * Notice: always force to input param `useDefault` in case that forget to consider it.
  1354. * The same behavior as `modelUtil.parseFinder`.
  1355. *
  1356. * @param useDefault In many cases like series refer axis and axis refer grid,
  1357. * If axis index / axis id not specified, use the first target as default.
  1358. * In other cases like dataZoom refer axis, if not specified, measn no refer.
  1359. */
  1360. e.prototype.getReferringComponents=function(t,e){var n=t+"Index",i=t+"Id";return Gn(this.ecModel,t,{index:this.get(n,!0),id:this.get(i,!0)},e)},e.prototype.getBoxLayoutParams=function(){
  1361. // Consider itself having box layout configs.
  1362. var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},
  1363. /**
  1364. * Get key for zlevel.
  1365. * If developers don't configure zlevel. We will assign zlevel to series based on the key.
  1366. * For example, lines with trail effect and progressive series will in an individual zlevel.
  1367. */
  1368. e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(yr);jn(Da,yr),$n(Da),function(t){var e={};t.registerSubTypeDefaulter=function(t,n){var i=Zn(t);e[i.main]=n},t.determineSubType=function(n,i){var o=i.type;if(!o){var r=Zn(n).main;t.hasSubTypes(n)&&e[r]&&(o=e[r](i))}return o}}
  1369. /**
  1370. * Implements `TopologicalTravelable<any>` for `entity`.
  1371. *
  1372. * Topological travel on Activity Network (Activity On Vertices).
  1373. * Dependencies is defined in Model.prototype.dependencies, like ['xAxis', 'yAxis'].
  1374. * If 'xAxis' or 'yAxis' is absent in componentTypeList, just ignore it in topology.
  1375. * If there is circular dependencey, Error will be thrown.
  1376. */(Da),function(t,e){function n(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}
  1377. /**
  1378. * @param targetNameList Target Component type list.
  1379. * Can be ['aa', 'bb', 'aa.xx']
  1380. * @param fullNameList By which we can build dependency graph.
  1381. * @param callback Params: componentType, dependencies.
  1382. * @param context Scope of callback.
  1383. */
  1384. t.topologicalTravel=function(t,i,o,r){if(t.length){var s=function(t){var i={},o=[];return a(t,(function(r){var s=n(i,r),l=function(t,e){var n=[];return a(t,(function(t){c(e,t)>=0&&n.push(t)})),n}(s.originalDeps=e(r),t);s.entryCount=l.length,0===s.entryCount&&o.push(r),a(l,(function(t){c(s.predecessor,t)<0&&s.predecessor.push(t);var e=n(i,t);c(e.successor,t)<0&&e.successor.push(r)}))})),{graph:i,noEntryList:o}}(i),l=s.graph,u=s.noEntryList,d={};for(a(t,(function(t){d[t]=!0}));u.length;){var h=u.pop(),p=l[h],f=!!d[h];f&&(o.call(r,h,p.originalDeps.slice()),delete d[h]),a(p.successor,f?y:g)}a(d,(function(){throw new Error("")}))}function g(t){l[t].entryCount--,0===l[t].entryCount&&u.push(t)}
  1385. // Consider this case: legend depends on series, and we call
  1386. // chart.setOption({series: [...]}), where only series is in option.
  1387. // If we do not have 'removeEdgeAndAdd', legendModel.mergeOption will
  1388. // not be called, but only sereis.mergeOption is called. Thus legend
  1389. // have no chance to update its local record about series (like which
  1390. // name of series is available in legend).
  1391. function y(t){d[t]=!0,g(t)}}}(Da,(function(t){var e=[];
  1392. // Hack dataset for convenience.
  1393. a(Da.getClassesByMainType(t),(function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])})),
  1394. // Ensure main type.
  1395. e=n(e,(function(t){return Zn(t).main})),"dataset"!==t&&c(e,"dataset")<=0&&e.unshift("dataset");return e}));const Ta=Da;
  1396. /*
  1397. * Licensed to the Apache Software Foundation (ASF) under one
  1398. * or more contributor license agreements. See the NOTICE file
  1399. * distributed with this work for additional information
  1400. * regarding copyright ownership. The ASF licenses this file
  1401. * to you under the Apache License, Version 2.0 (the
  1402. * "License"); you may not use this file except in compliance
  1403. * with the License. You may obtain a copy of the License at
  1404. *
  1405. * http://www.apache.org/licenses/LICENSE-2.0
  1406. *
  1407. * Unless required by applicable law or agreed to in writing,
  1408. * software distributed under the License is distributed on an
  1409. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  1410. * KIND, either express or implied. See the License for the
  1411. * specific language governing permissions and limitations
  1412. * under the License.
  1413. */
  1414. /**
  1415. * AUTO-GENERATED FILE. DO NOT MODIFY.
  1416. */
  1417. /*
  1418. * Licensed to the Apache Software Foundation (ASF) under one
  1419. * or more contributor license agreements. See the NOTICE file
  1420. * distributed with this work for additional information
  1421. * regarding copyright ownership. The ASF licenses this file
  1422. * to you under the Apache License, Version 2.0 (the
  1423. * "License"); you may not use this file except in compliance
  1424. * with the License. You may obtain a copy of the License at
  1425. *
  1426. * http://www.apache.org/licenses/LICENSE-2.0
  1427. *
  1428. * Unless required by applicable law or agreed to in writing,
  1429. * software distributed under the License is distributed on an
  1430. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  1431. * KIND, either express or implied. See the License for the
  1432. * specific language governing permissions and limitations
  1433. * under the License.
  1434. */var Ca="";
  1435. // Navigator not exists in node
  1436. "undefined"!=typeof navigator&&(
  1437. /* global navigator */
  1438. Ca=navigator.platform||"");var Aa="rgba(0, 0, 0, 0.2)";const La={darkMode:"auto",
  1439. // backgroundColor: 'rgba(0,0,0,0)',
  1440. colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Aa,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Aa,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Aa,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Aa,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Aa,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Aa,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},
  1441. // If xAxis and yAxis declared, grid is created by default.
  1442. // grid: {},
  1443. textStyle:{
  1444. // color: '#000',
  1445. // decoration: 'none',
  1446. // PENDING
  1447. fontFamily:Ca.match(/^Win/)?"Microsoft YaHei":"sans-serif",
  1448. // fontFamily: 'Arial, Verdana, sans-serif',
  1449. fontSize:12,fontStyle:"normal",fontWeight:"normal"},
  1450. // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/
  1451. // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
  1452. // Default is source-over
  1453. blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,
  1454. // Configuration for progressive/incremental rendering
  1455. progressiveThreshold:3e3,progressive:400,
  1456. // Threshold of if use single hover layer to optimize.
  1457. // It is recommended that `hoverLayerThreshold` is equivalent to or less than
  1458. // `progressiveThreshold`, otherwise hover will cause restart of progressive,
  1459. // which is unexpected.
  1460. // see example <echarts/test/heatmap-large.html>.
  1461. hoverLayerThreshold:3e3,
  1462. // See: module:echarts/scale/Time
  1463. useUTC:!1};var ka=r(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Pa="original",Na="arrayRows",Oa="objectRows",Ra="keyedColumns",Ea="typedArray",Va="unknown",za="column",Ba="row",Ga=1,Fa=2,Wa=3,Ha=On();
  1464. /**
  1465. * [The strategy of the arrengment of data dimensions for dataset]:
  1466. * "value way": all axes are non-category axes. So series one by one take
  1467. * several (the number is coordSysDims.length) dimensions from dataset.
  1468. * The result of data arrengment of data dimensions like:
  1469. * | ser0_x | ser0_y | ser1_x | ser1_y | ser2_x | ser2_y |
  1470. * "category way": at least one axis is category axis. So the the first data
  1471. * dimension is always mapped to the first category axis and shared by
  1472. * all of the series. The other data dimensions are taken by series like
  1473. * "value way" does.
  1474. * The result of data arrengment of data dimensions like:
  1475. * | ser_shared_x | ser0_y | ser1_y | ser2_y |
  1476. *
  1477. * @return encode Never be `null/undefined`.
  1478. */
  1479. function Ya(t,e,n){var i={},r=Za(e);
  1480. // Currently only make default when using dataset, util more reqirements occur.
  1481. if(!r||!t)return i;var s,l,u=[],c=[],d=e.ecModel,h=Ha(d).datasetMap,p=r.uid+"_"+n.seriesLayoutBy;t=t.slice(),a(t,(function(e,n){var r=o(e)?e:t[n]={name:e};"ordinal"===r.type&&null==s&&(s=n,l=y(r)),i[r.name]=[]}));var f=h.get(p)||h.set(p,{categoryWayDim:l,valueWayDim:0});
  1482. // TODO
  1483. // Auto detect first time axis and do arrangement.
  1484. function g(t,e,n){for(var i=0;i<n;i++)t.push(e+i)}function y(t){var e=t.dimsDef;return e?e.length:1}return a(t,(function(t,e){var n=t.name,o=y(t);
  1485. // In value way.
  1486. if(null==s){var r=f.valueWayDim;g(i[n],r,o),g(c,r,o),f.valueWayDim+=o}
  1487. // In category way, the first category axis.
  1488. else if(s===e)g(i[n],0,o),g(u,0,o);else{r=f.categoryWayDim;g(i[n],r,o),g(c,r,o),f.categoryWayDim+=o}})),u.length&&(i.itemName=u),c.length&&(i.seriesName=c),i}
  1489. /**
  1490. * Work for data like [{name: ..., value: ...}, ...].
  1491. *
  1492. * @return encode Never be `null/undefined`.
  1493. */function Ua(t,e,n){var i={};
  1494. // Currently only make default when using dataset, util more reqirements occur.
  1495. if(!Za(t))return i;var r,s=e.sourceFormat,l=e.dimensionsDefine;s!==Oa&&s!==Ra||a(l,(function(t,e){"name"===(o(t)?t.name:t)&&(r=e)}));var u=function(){
  1496. // 5 is an experience value.
  1497. for(var t={},i={},o=[],a=0,u=Math.min(5,n);a<u;a++){var c=ja(e.data,s,e.seriesLayoutBy,l,e.startIndex,a);o.push(c);var d=c===Wa;
  1498. // [Strategy of idxRes0]: find the first BE_ORDINAL.Not as the value dim,
  1499. // and then find a name dim with the priority:
  1500. // "BE_ORDINAL.Might|BE_ORDINAL.Must" > "other dim" > "the value dim itself".
  1501. if(d&&null==t.v&&a!==r&&(t.v=a),(null==t.n||t.n===t.v||!d&&o[t.n]===Wa)&&(t.n=a),h(t)&&o[t.n]!==Wa)return t;
  1502. // [Strategy of idxRes1]: if idxRes0 not satisfied (that is, no BE_ORDINAL.Not),
  1503. // find the first BE_ORDINAL.Might as the value dim,
  1504. // and then find a name dim with the priority:
  1505. // "other dim" > "the value dim itself".
  1506. // That is for backward compat: number-like (e.g., `'3'`, `'55'`) can be
  1507. // treated as number.
  1508. d||(c===Fa&&null==i.v&&a!==r&&(i.v=a),null!=i.n&&i.n!==i.v||(i.n=a))}function h(t){return null!=t.v&&null!=t.n}return h(t)?t:h(i)?i:null}();if(u){i.value=[u.v];
  1509. // `potentialNameDimIndex` has highest priority.
  1510. var c=null!=r?r:u.n;
  1511. // By default, label uses itemName in charts.
  1512. // So we don't set encodeLabel here.
  1513. i.itemName=[c],i.seriesName=[c]}return i}
  1514. /**
  1515. * @return If return null/undefined, indicate that should not use datasetModel.
  1516. */function Za(t){if(!t.get("data",!0))return Gn(t.ecModel,"dataset",{index:t.get("datasetIndex",!0),id:t.get("datasetId",!0)},zn).models[0]}
  1517. /**
  1518. * @return Always return an array event empty.
  1519. */
  1520. /**
  1521. * The rule should not be complex, otherwise user might not
  1522. * be able to known where the data is wrong.
  1523. * The code is ugly, but how to make it neat?
  1524. */
  1525. function Xa(t,e){return ja(t.data,t.sourceFormat,t.seriesLayoutBy,t.dimensionsDefine,t.startIndex,e)}
  1526. // dimIndex may be overflow source data.
  1527. // return {BE_ORDINAL}
  1528. function ja(e,n,r,a,s,l){var u,c,d;
  1529. // Experience value.
  1530. if(at(e))return Wa;
  1531. // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine
  1532. // always exists in source.
  1533. if(a){var h=a[l];o(h)?(c=h.name,d=h.type):t(h)&&(c=h)}if(null!=d)return"ordinal"===d?Ga:Wa;if(n===Na){var p=e;if(r===Ba){for(var f=p[l],g=0;g<(f||[]).length&&g<5;g++)if(null!=(u=b(f[s+g])))return u}else for(g=0;g<p.length&&g<5;g++){var y=p[s+g];if(y&&null!=(u=b(y[l])))return u}}else if(n===Oa){var m=e;if(!c)return Wa;for(g=0;g<m.length&&g<5;g++){if((x=m[g])&&null!=(u=b(x[c])))return u}}else if(n===Ra){if(!c)return Wa;if(!(f=e[c])||at(f))return Wa;for(g=0;g<f.length&&g<5;g++)if(null!=(u=b(f[g])))return u}else if(n===Pa){var v=e;for(g=0;g<v.length&&g<5;g++){var x,_=In(x=v[g]);if(!i(_))return Wa;if(null!=(u=b(_[l])))return u}}function b(e){var n=t(e);
  1534. // Consider usage convenience, '1', '2' will be treated as "number".
  1535. // `Number('')` (or any whitespace) is `0`.
  1536. return null!=e&&Number.isFinite(Number(e))&&""!==e?n?Fa:Wa:n&&"-"!==e?Ga:void 0}return Wa}var qa=r();var Ka,Ja,$a,Qa=On(),ts=On(),es=/** @class */function(){function t(){}return t.prototype.getColorFromPalette=function(t,e,n){var i=Sn(this.get("color",!0)),o=this.get("colorLayer",!0);return is(this,Qa,i,o,t,e,n)},t.prototype.clearColorPalette=function(){!function(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}
  1537. // -----------------------
  1538. // Internal method names:
  1539. // -----------------------
  1540. (this,Qa)},t}();function ns(t,e,n,i){var o=Sn(t.get(["aria","decal","decals"]));return is(t,ts,o,null,e,n,i)}
  1541. /**
  1542. * @param name MUST NOT be null/undefined. Otherwise call this function
  1543. * twise with the same parameters will get different result.
  1544. * @param scope default this.
  1545. * @return Can be null/undefined
  1546. */
  1547. function is(t,e,n,i,o,r,a){var s=e(r=r||t),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};
  1548. // Use `hasOwnProperty` to avoid conflict with Object.prototype.
  1549. if(u.hasOwnProperty(o))return u[o];var c=null!=a&&i?function(t,e){
  1550. // TODO palettes must be in order
  1551. for(var n=t.length,i=0;i<n;i++)if(t[i].length>e)return t[i];return t[n-1]}(i,a):n;
  1552. // In case can't find in layered color palette.
  1553. if((c=c||n)&&c.length){var d=c[l];return o&&(u[o]=d),s.paletteIdx=(l+1)%c.length,d}}var os="\0_ec_inner",rs=/** @class */function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Ue(n,e),n.prototype.init=function(t,e,n,i,o,r){i=i||{},this.option=null,// Mark as not initialized.
  1554. this._theme=new yr(i),this._locale=new yr(o),this._optionManager=r},n.prototype.setOption=function(t,e,n){var i=ls(e);this._optionManager.setOption(t,n,i),this._resetOption(null,i)},
  1555. /**
  1556. * @param type null/undefined: reset all.
  1557. * 'recreate': force recreate all.
  1558. * 'timeline': only reset timeline option
  1559. * 'media': only reset media query option
  1560. * @return Whether option changed.
  1561. */
  1562. n.prototype.resetOption=function(t,e){return this._resetOption(t,ls(e))},n.prototype._resetOption=function(t,e){var n=!1,i=this._optionManager;if(!t||"recreate"===t){var o=i.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(o,e)):$a(this,o),n=!0}
  1563. // By design, if `setOption(option2)` at the second time, and `option2` is a `ECUnitOption`,
  1564. // it should better not have the same props with `MediaUnit['option']`.
  1565. // Because either `option2` or `MediaUnit['option']` will be always merged to "current option"
  1566. // rather than original "baseOption". If they both override a prop, the result might be
  1567. // unexpected when media state changed after `setOption` called.
  1568. // If we really need to modify a props in each `MediaUnit['option']`, use the full version
  1569. // (`{baseOption, media}`) in `setOption`.
  1570. // For `timeline`, the case is the same.
  1571. if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var r=i.getTimelineOption(this);r&&(n=!0,this._mergeOption(r,e))}if(!t||"recreate"===t||"media"===t){var s=i.getMediaOption(this);s.length&&a(s,(function(t){n=!0,this._mergeOption(t,e)}),this)}return n},n.prototype.mergeOption=function(t){this._mergeOption(t,null)},n.prototype._mergeOption=function(t,e){var n=this.option,i=this._componentsMap,s=this._componentsCount,l=[],u=r(),c=e&&e.replaceMergeMainTypeMap;
  1572. // `datasetMap` is used to make default encode.
  1573. Ha(this).datasetMap=r(),
  1574. // If no component class, merge directly.
  1575. // For example: color, animaiton options, etc.
  1576. a(t,(function(t,e){null!=t&&(Ta.hasClass(e)?e&&(l.push(e),u.set(e,!0)):
  1577. // globalSettingTask.dirty();
  1578. n[e]=null==n[e]?et(t):tt(n[e],t,!0))})),c&&
  1579. // If there is a mainType `xxx` in `replaceMerge` but not declared in option,
  1580. // we trade it as it is declared in option as `{xxx: []}`. Because:
  1581. // (1) for normal merge, `{xxx: null/undefined}` are the same meaning as `{xxx: []}`.
  1582. // (2) some preprocessor may convert some of `{xxx: null/undefined}` to `{xxx: []}`.
  1583. c.each((function(t,e){Ta.hasClass(e)&&!u.get(e)&&(l.push(e),u.set(e,!0))})),Ta.topologicalTravel(l,Ta.getAllClassMainTypes(),(function(e){var r=function(t,e,n){var i=qa.get(e);if(!i)return n;var o=i(t);return o?n.concat(o):n}(this,e,Sn(t[e])),l=i.get(e),u=
  1584. // `!oldCmptList` means init. See the comment in `mappingToExists`
  1585. l?c&&c.get(e)?"replaceMerge":"normalMerge":"replaceAll",d=Tn(l,r,u);
  1586. // Set mainType and complete subType.
  1587. (function(t,e,n){
  1588. // Set mainType and complete subType.
  1589. a(t,(function(t){var i=t.newOption;o(i)&&(t.keyInfo.mainType=e,t.keyInfo.subType=function(t,e,n,i){
  1590. // tooltip, markline, markpoint may always has no subType
  1591. return e.type?e.type:n?n.subType:i.determineSubType(t,e)}
  1592. /**
  1593. * A helper for removing duplicate items between batchA and batchB,
  1594. * and in themselves, and categorize by series.
  1595. *
  1596. * @param batchA Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]
  1597. * @param batchB Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]
  1598. * @return result: [resultBatchA, resultBatchB]
  1599. */(e,i,t.existing,n))}))})(d,e,Ta),
  1600. // Empty it before the travel, in order to prevent `this._componentsMap`
  1601. // from being used in the `init`/`mergeOption`/`optionUpdated` of some
  1602. // components, which is probably incorrect logic.
  1603. n[e]=null,i.set(e,null),s.set(e,0);var h,f=[],g=[],y=0;
  1604. // Backup series for filtering.
  1605. a(d,(function(t,n){var i=t.existing,o=t.newOption;if(o){var r="series"===e,a=Ta.getClass(e,t.keyInfo.subType,!r);if(!a)return;
  1606. // TODO Before multiple tooltips get supported, we do this check to avoid unexpected exception.
  1607. if("tooltip"===e){if(h)return;h=!0}if(i&&i.constructor===a)i.name=t.keyInfo.name,
  1608. // componentModel.settingTask && componentModel.settingTask.dirty();
  1609. i.mergeOption(o,this),i.optionUpdated(o,!1);else{
  1610. // PENDING Global as parent ?
  1611. var s=p({componentIndex:n},t.keyInfo);i=new a(o,this,this,s),
  1612. // Assign `keyInfo`
  1613. p(i,s),t.brandNew&&(i.__requireNewView=!0),i.init(o,this,this),
  1614. // Call optionUpdated after init.
  1615. // newCmptOption has been used as componentModel.option
  1616. // and may be merged with theme and default, so pass null
  1617. // to avoid confusion.
  1618. i.optionUpdated(null,!0)}}else i&&(
  1619. // Consider where is no new option and should be merged using {},
  1620. // see removeEdgeAndAdd in topologicalTravel and
  1621. // ComponentModel.getAllClassMainTypes.
  1622. i.mergeOption({},this),i.optionUpdated({},!1));
  1623. // If no both `resultItem.exist` and `resultItem.option`,
  1624. // either it is in `replaceMerge` and not matched by any id,
  1625. // or it has been removed in previous `replaceMerge` and left a "hole" in this component index.
  1626. i?(f.push(i.option),g.push(i),y++):(
  1627. // Always do assign to avoid elided item in array.
  1628. f.push(void 0),g.push(void 0))}),this),n[e]=f,i.set(e,g),s.set(e,y),"series"===e&&Ka(this)}
  1629. // If no series declared, ensure `_seriesIndices` initialized.
  1630. ),this),this._seriesIndices||Ka(this)},
  1631. /**
  1632. * Get option for output (cloned option and inner info removed)
  1633. */
  1634. n.prototype.getOption=function(){var t=et(this.option);return a(t,(function(e,n){if(Ta.hasClass(n)){for(var i=Sn(e),o=i.length,r=!1,a=o-1
  1635. // Inner cmpts need to be removed.
  1636. // Inner cmpts might not be at last since ec5.0, but still
  1637. // compatible for users: if inner cmpt at last, splice the returned array.
  1638. ;a>=0;a--)
  1639. // Remove options with inner id.
  1640. i[a]&&!Pn(i[a])?r=!0:(i[a]=null,!r&&o--);i.length=o,t[n]=i}})),delete t[os],t},n.prototype.getTheme=function(){return this._theme},n.prototype.getLocaleModel=function(){return this._locale},n.prototype.setUpdatePayload=function(t){this._payload=t},n.prototype.getUpdatePayload=function(){return this._payload},
  1641. /**
  1642. * @param idx If not specified, return the first one.
  1643. */
  1644. n.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var i=n[e||0];if(i)return i;if(null==e)for(var o=0;o<n.length;o++)if(n[o])return n[o]}},
  1645. /**
  1646. * @return Never be null/undefined.
  1647. */
  1648. n.prototype.queryComponents=function(t){var e=t.mainType;if(!e)return[];var n,i=t.index,o=t.id,r=t.name,s=this._componentsMap.get(e);return s&&s.length?(null!=i?(n=[],a(Sn(i),(function(t){s[t]&&n.push(s[t])}))):n=null!=o?as("id",o,s):null!=r?as("name",r,s):st(s,(function(t){return!!t})),ss(n,t)):[]},
  1649. /**
  1650. * The interface is different from queryComponents,
  1651. * which is convenient for inner usage.
  1652. *
  1653. * @usage
  1654. * let result = findComponents(
  1655. * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}
  1656. * );
  1657. * let result = findComponents(
  1658. * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}
  1659. * );
  1660. * let result = findComponents(
  1661. * {mainType: 'series',
  1662. * filter: function (model, index) {...}}
  1663. * );
  1664. * // result like [component0, componnet1, ...]
  1665. */
  1666. n.prototype.findComponents=function(t){var e,n,i,o,r,a=t.query,s=t.mainType,l=(n=s+"Index",i=s+"Id",o=s+"Name",!(e=a)||null==e[n]&&null==e[i]&&null==e[o]?null:{mainType:s,
  1667. // subType will be filtered finally.
  1668. index:e[n],id:e[i],name:e[o]}),u=l?this.queryComponents(l):st(this._componentsMap.get(s),(function(t){return!!t}));return r=ss(u,t),t.filter?st(r,t.filter):r},n.prototype.eachComponent=function(e,n,i){var r=this._componentsMap;if(f(e)){var a=n,s=e;r.each((function(t,e){for(var n=0;t&&n<t.length;n++){var i=t[n];i&&s.call(a,e,i,i.componentIndex)}}))}else for(var l=t(e)?r.get(e):o(e)?this.findComponents(e):null,u=0;l&&u<l.length;u++){var c=l[u];c&&n.call(i,c,c.componentIndex)}},
  1669. /**
  1670. * Get series list before filtered by name.
  1671. */
  1672. n.prototype.getSeriesByName=function(t){var e=Ln(t,null);return st(this._componentsMap.get("series"),(function(t){return!!t&&null!=e&&t.name===e}))},
  1673. /**
  1674. * Get series list before filtered by index.
  1675. */
  1676. n.prototype.getSeriesByIndex=function(t){return this._componentsMap.get("series")[t]},
  1677. /**
  1678. * Get series list before filtered by type.
  1679. * FIXME: rename to getRawSeriesByType?
  1680. */
  1681. n.prototype.getSeriesByType=function(t){return st(this._componentsMap.get("series"),(function(e){return!!e&&e.subType===t}))},
  1682. /**
  1683. * Get all series before filtered.
  1684. */
  1685. n.prototype.getSeries=function(){return st(this._componentsMap.get("series"),(function(t){return!!t}))},
  1686. /**
  1687. * Count series before filtered.
  1688. */
  1689. n.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},
  1690. /**
  1691. * After filtering, series may be different
  1692. * from raw series.
  1693. */
  1694. n.prototype.eachSeries=function(t,e){Ja(this),a(this._seriesIndices,(function(n){var i=this._componentsMap.get("series")[n];t.call(e,i,n)}),this)},
  1695. /**
  1696. * Iterate raw series before filtered.
  1697. *
  1698. * @param {Function} cb
  1699. * @param {*} context
  1700. */
  1701. n.prototype.eachRawSeries=function(t,e){a(this._componentsMap.get("series"),(function(n){n&&t.call(e,n,n.componentIndex)}))},
  1702. /**
  1703. * After filtering, series may be different.
  1704. * from raw series.
  1705. */
  1706. n.prototype.eachSeriesByType=function(t,e,n){Ja(this),a(this._seriesIndices,(function(i){var o=this._componentsMap.get("series")[i];o.subType===t&&e.call(n,o,i)}),this)},
  1707. /**
  1708. * Iterate raw series before filtered of given type.
  1709. */
  1710. n.prototype.eachRawSeriesByType=function(t,e,n){return a(this.getSeriesByType(t),e,n)},n.prototype.isSeriesFiltered=function(t){return Ja(this),null==this._seriesIndicesMap.get(t.componentIndex)},n.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},n.prototype.filterSeries=function(t,e){Ja(this);var n=[];a(this._seriesIndices,(function(i){var o=this._componentsMap.get("series")[i];t.call(e,o,i)&&n.push(i)}),this),this._seriesIndices=n,this._seriesIndicesMap=r(n)},n.prototype.restoreData=function(t){Ka(this);var e=this._componentsMap,n=[];e.each((function(t,e){Ta.hasClass(e)&&n.push(e)})),Ta.topologicalTravel(n,Ta.getAllClassMainTypes(),(function(n){a(e.get(n),(function(e){!e||"series"===n&&function(t,e){if(e){var n=e.seriesIndex,i=e.seriesId,o=e.seriesName;return null!=n&&t.componentIndex!==n||null!=i&&t.id!==i||null!=o&&t.name!==o}}(e,t)||e.restoreData()}))}))},n.internalField=(Ka=function(t){var e=t._seriesIndices=[];a(t._componentsMap.get("series"),(function(t){
  1711. // series may have been removed by `replaceMerge`.
  1712. t&&e.push(t.componentIndex)})),t._seriesIndicesMap=r(e)},Ja=function(t){},void($a=function(t,e){
  1713. // Using OPTION_INNER_KEY to mark that this option cannot be used outside,
  1714. // i.e. `chart.setOption(chart.getModel().option);` is forbidden.
  1715. t.option={},t.option[os]=1,
  1716. // Init with series: [], in case of calling findSeries method
  1717. // before series initialized.
  1718. t._componentsMap=r({series:[]}),t._componentsCount=r();
  1719. // If user spefied `option.aria`, aria will be enable. This detection should be
  1720. // performed before theme and globalDefault merge.
  1721. var n=e.aria;o(n)&&null==n.enabled&&(n.enabled=!0),function(t,e){
  1722. // PENDING
  1723. // NOT use `colorLayer` in theme if option has `color`
  1724. var n=t.color&&!t.colorLayer;a(e,(function(e,i){"colorLayer"===i&&n||Ta.hasClass(i)||("object"==typeof e?t[i]=t[i]?tt(t[i],e,!1):et(e):null==t[i]&&(t[i]=e));
  1725. // If it is component model mainType, the model handles that merge later.
  1726. // otherwise, merge them here.
  1727. }))}(e,t._theme.option),
  1728. // TODO Needs clone when merging to the unexisted property
  1729. tt(e,La,!1),t._mergeOption(e,null)})),n}(yr);function as(t,e,n){
  1730. // Here is a break from echarts4: string and number are
  1731. // treated as equal.
  1732. if(i(e)){var o=r();return a(e,(function(t){null!=t&&(null!=Ln(t,null)&&o.set(t,!0))})),st(n,(function(e){return e&&o.get(e[t])}))}var s=Ln(e,null);return st(n,(function(e){return e&&null!=s&&e[t]===s}))}function ss(t,e){
  1733. // Using hasOwnProperty for restrict. Consider
  1734. // subType is undefined in user payload.
  1735. return e.hasOwnProperty("subType")?st(t,(function(t){return t&&t.subType===e.subType})):t}function ls(t){var e=r();return t&&a(Sn(t.replaceMerge),(function(t){e.set(t,!0)})),{replaceMergeMainTypeMap:e}}nt(rs,es);const us=rs;var cs=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL",
  1736. // 'getModel',
  1737. "getOption",
  1738. // 'getViewOfComponentModel',
  1739. // 'getViewOfSeriesModel',
  1740. "getId","updateLabelLayout"];const ds=function(t){a(cs,(function(e){this[e]=lt(t[e],t)}),this)};var hs={},ps=/** @class */function(){function t(){this._coordinateSystems=[]}return t.prototype.create=function(t,e){var n=[];a(hs,(function(i,o){var r=i.create(t,e);n=n.concat(r||[])})),this._coordinateSystems=n},t.prototype.update=function(t,e){a(this._coordinateSystems,(function(n){n.update&&n.update(t,e)}))},t.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},t.register=function(t,e){hs[t]=e},t.get=function(t){return hs[t]},t}();const fs=ps;var gs=/^(min|max)?(.+)$/,ys=/** @class */function(){
  1741. // timeline.notMerge is not supported in ec3. Firstly there is rearly
  1742. // case that notMerge is needed. Secondly supporting 'notMerge' requires
  1743. // rawOption cloned and backuped when timeline changed, which does no
  1744. // good to performance. What's more, that both timeline and setOption
  1745. // method supply 'notMerge' brings complex and some problems.
  1746. // Consider this case:
  1747. // (step1) chart.setOption({timeline: {notMerge: false}, ...}, false);
  1748. // (step2) chart.setOption({timeline: {notMerge: true}, ...}, false);
  1749. function t(t){this._timelineOptions=[],this._mediaList=[],
  1750. /**
  1751. * -1, means default.
  1752. * empty means no media.
  1753. */
  1754. this._currentMediaIndices=[],this._api=t}return t.prototype.setOption=function(t,e,n){t&&(
  1755. // That set dat primitive is dangerous if user reuse the data when setOption again.
  1756. a(Sn(t.series),(function(t){t&&t.data&&at(t.data)&&ut(t.data)})),a(Sn(t.dataset),(function(t){t&&t.source&&at(t.source)&&ut(t.source)}))),
  1757. // Caution: some series modify option data, if do not clone,
  1758. // it should ensure that the repeat modify correctly
  1759. // (create a new object when modify itself).
  1760. t=et(t);
  1761. // FIXME
  1762. // If some property is set in timeline options or media option but
  1763. // not set in baseOption, a warning should be given.
  1764. var o=this._optionBackup,r=
  1765. /**
  1766. * [RAW_OPTION_PATTERNS]
  1767. * (Note: "series: []" represents all other props in `ECUnitOption`)
  1768. *
  1769. * (1) No prop "baseOption" declared:
  1770. * Root option is used as "baseOption" (except prop "options" and "media").
  1771. * ```js
  1772. * option = {
  1773. * series: [],
  1774. * timeline: {},
  1775. * options: [],
  1776. * };
  1777. * option = {
  1778. * series: [],
  1779. * media: {},
  1780. * };
  1781. * option = {
  1782. * series: [],
  1783. * timeline: {},
  1784. * options: [],
  1785. * media: {},
  1786. * }
  1787. * ```
  1788. *
  1789. * (2) Prop "baseOption" declared:
  1790. * If "baseOption" declared, `ECUnitOption` props can only be declared
  1791. * inside "baseOption" except prop "timeline" (compat ec2).
  1792. * ```js
  1793. * option = {
  1794. * baseOption: {
  1795. * timeline: {},
  1796. * series: [],
  1797. * },
  1798. * options: []
  1799. * };
  1800. * option = {
  1801. * baseOption: {
  1802. * series: [],
  1803. * },
  1804. * media: []
  1805. * };
  1806. * option = {
  1807. * baseOption: {
  1808. * timeline: {},
  1809. * series: [],
  1810. * },
  1811. * options: []
  1812. * media: []
  1813. * };
  1814. * option = {
  1815. * // ec3 compat ec2: allow (only) `timeline` declared
  1816. * // outside baseOption. Keep this setting for compat.
  1817. * timeline: {},
  1818. * baseOption: {
  1819. * series: [],
  1820. * },
  1821. * options: [],
  1822. * media: []
  1823. * };
  1824. * ```
  1825. */
  1826. function(
  1827. // `rawOption` May be modified
  1828. t,e,n){var o,r,s=[],l=t.baseOption,u=t.timeline,c=t.options,d=t.media,h=!!t.media,p=!!(c||u||l&&l.timeline);l?
  1829. // For merge option.
  1830. (r=l).timeline||(r.timeline=u):((p||h)&&(t.options=t.media=null),r=t);h&&i(d)&&a(d,(function(t){t&&t.option&&(t.query?s.push(t):o||(
  1831. // Use the first media default.
  1832. o=t))}));function f(t){a(e,(function(e){e(t,n)}))}return f(r),a(c,(function(t){return f(t)})),a(s,(function(t){return f(t.option)})),{baseOption:r,timelineOptions:c||[],mediaDefault:o,mediaList:s}}
  1833. /**
  1834. * @see <http://www.w3.org/TR/css3-mediaqueries/#media1>
  1835. * Support: width, height, aspectRatio
  1836. * Can use max or min as prefix.
  1837. */(t,e,!o);this._newBaseOption=r.baseOption,
  1838. // For setOption at second time (using merge mode);
  1839. o?(
  1840. // FIXME
  1841. // the restore merge solution is essentially incorrect.
  1842. // the mapping can not be 100% consistent with ecModel, which probably brings
  1843. // potential bug!
  1844. // The first merge is delayed, because in most cases, users do not call `setOption` twice.
  1845. // let fakeCmptsMap = this._fakeCmptsMap;
  1846. // if (!fakeCmptsMap) {
  1847. // fakeCmptsMap = this._fakeCmptsMap = createHashMap();
  1848. // mergeToBackupOption(fakeCmptsMap, null, optionBackup.baseOption, null);
  1849. // }
  1850. // mergeToBackupOption(
  1851. // fakeCmptsMap, optionBackup.baseOption, newParsedOption.baseOption, opt
  1852. // );
  1853. // For simplicity, timeline options and media options do not support merge,
  1854. // that is, if you `setOption` twice and both has timeline options, the latter
  1855. // timeline options will not be merged to the former, but just substitute them.
  1856. r.timelineOptions.length&&(o.timelineOptions=r.timelineOptions),r.mediaList.length&&(o.mediaList=r.mediaList),r.mediaDefault&&(o.mediaDefault=r.mediaDefault)):this._optionBackup=r},t.prototype.mountOption=function(t){var e=this._optionBackup;return this._timelineOptions=e.timelineOptions,this._mediaList=e.mediaList,this._mediaDefault=e.mediaDefault,this._currentMediaIndices=[],et(t?e.baseOption:this._newBaseOption)},t.prototype.getTimelineOption=function(t){var e,n=this._timelineOptions;if(n.length){
  1857. // getTimelineOption can only be called after ecModel inited,
  1858. // so we can get currentIndex from timelineModel.
  1859. var i=t.getComponent("timeline");i&&(e=et(
  1860. // FIXME:TS as TimelineModel or quivlant interface
  1861. n[i.getCurrentIndex()]))}return e},t.prototype.getMediaOption=function(t){var e,i,o=this._api.getWidth(),r=this._api.getHeight(),a=this._mediaList,s=this._mediaDefault,l=[],u=[];
  1862. // No media defined.
  1863. if(!a.length&&!s)return u;
  1864. // Multi media may be applied, the latter defined media has higher priority.
  1865. for(var c=0,d=a.length;c<d;c++)ms(a[c].query,o,r)&&l.push(c);
  1866. // FIXME
  1867. // Whether mediaDefault should force users to provide? Otherwise
  1868. // the change by media query can not be recorvered.
  1869. return!l.length&&s&&(l=[-1]),l.length&&(e=l,i=this._currentMediaIndices,e.join(",")!==i.join(","))&&(u=n(l,(function(t){return et(-1===t?s.option:a[t].option)}))),
  1870. // Otherwise return nothing.
  1871. this._currentMediaIndices=l,u},t}();
  1872. // Key: mainType
  1873. // type FakeComponentsMap = HashMap<(MappingExistingItem & { subType: string })[]>;
  1874. /**
  1875. * TERM EXPLANATIONS:
  1876. * See `ECOption` and `ECUnitOption` in `src/util/types.ts`.
  1877. */function ms(t,e,n){var i={width:e,height:n,aspectratio:e/n},o=!0;return a(t,(function(t,e){var n=e.match(gs);if(n&&n[1]&&n[2]){var r=n[1],a=n[2].toLowerCase();(function(t,e,n){return"min"===n?t>=e:"max"===n?t<=e:t===e})(i[a],t,r)||(o=!1)}})),o}
  1878. /**
  1879. * Consider case:
  1880. * `chart.setOption(opt1);`
  1881. * Then user do some interaction like dataZoom, dataView changing.
  1882. * `chart.setOption(opt2);`
  1883. * Then user press 'reset button' in toolbox.
  1884. *
  1885. * After doing that all of the interaction effects should be reset, the
  1886. * chart should be the same as the result of invoke
  1887. * `chart.setOption(opt1); chart.setOption(opt2);`.
  1888. *
  1889. * Although it is not able ensure that
  1890. * `chart.setOption(opt1); chart.setOption(opt2);` is equivalents to
  1891. * `chart.setOption(merge(opt1, opt2));` exactly,
  1892. * this might be the only simple way to implement that feature.
  1893. *
  1894. * MEMO: We've considered some other approaches:
  1895. * 1. Each model handles its self restoration but not uniform treatment.
  1896. * (Too complex in logic and error-prone)
  1897. * 2. Use a shadow ecModel. (Performance expensive)
  1898. *
  1899. * FIXME: A possible solution:
  1900. * Add a extra level of model for each component model. The inheritance chain would be:
  1901. * ecModel <- componentModel <- componentActionModel <- dataItemModel
  1902. * And all of the actions can only modify the `componentActionModel` rather than
  1903. * `componentModel`. `setOption` will only modify the `ecModel` and `componentModel`.
  1904. * When "resotre" action triggered, model from `componentActionModel` will be discarded
  1905. * instead of recreating the "ecModel" from the "_optionBackup".
  1906. */
  1907. // function mergeToBackupOption(
  1908. // fakeCmptsMap: FakeComponentsMap,
  1909. // // `tarOption` Can be null/undefined, means init
  1910. // tarOption: ECUnitOption,
  1911. // newOption: ECUnitOption,
  1912. // // Can be null/undefined
  1913. // opt: InnerSetOptionOpts
  1914. // ): void {
  1915. // newOption = newOption || {} as ECUnitOption;
  1916. // const notInit = !!tarOption;
  1917. // each(newOption, function (newOptsInMainType, mainType) {
  1918. // if (newOptsInMainType == null) {
  1919. // return;
  1920. // }
  1921. // if (!ComponentModel.hasClass(mainType)) {
  1922. // if (tarOption) {
  1923. // tarOption[mainType] = merge(tarOption[mainType], newOptsInMainType, true);
  1924. // }
  1925. // }
  1926. // else {
  1927. // const oldTarOptsInMainType = notInit ? normalizeToArray(tarOption[mainType]) : null;
  1928. // const oldFakeCmptsInMainType = fakeCmptsMap.get(mainType) || [];
  1929. // const resultTarOptsInMainType = notInit ? (tarOption[mainType] = [] as ComponentOption[]) : null;
  1930. // const resultFakeCmptsInMainType = fakeCmptsMap.set(mainType, []);
  1931. // const mappingResult = mappingToExists(
  1932. // oldFakeCmptsInMainType,
  1933. // normalizeToArray(newOptsInMainType),
  1934. // (opt && opt.replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge' : 'normalMerge'
  1935. // );
  1936. // setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel as ComponentModelConstructor);
  1937. // each(mappingResult, function (resultItem, index) {
  1938. // // The same logic as `Global.ts#_mergeOption`.
  1939. // let fakeCmpt = resultItem.existing;
  1940. // const newOption = resultItem.newOption;
  1941. // const keyInfo = resultItem.keyInfo;
  1942. // let fakeCmptOpt;
  1943. // if (!newOption) {
  1944. // fakeCmptOpt = oldTarOptsInMainType[index];
  1945. // }
  1946. // else {
  1947. // if (fakeCmpt && fakeCmpt.subType === keyInfo.subType) {
  1948. // fakeCmpt.name = keyInfo.name;
  1949. // if (notInit) {
  1950. // fakeCmptOpt = merge(oldTarOptsInMainType[index], newOption, true);
  1951. // }
  1952. // }
  1953. // else {
  1954. // fakeCmpt = extend({}, keyInfo);
  1955. // if (notInit) {
  1956. // fakeCmptOpt = clone(newOption);
  1957. // }
  1958. // }
  1959. // }
  1960. // if (fakeCmpt) {
  1961. // notInit && resultTarOptsInMainType.push(fakeCmptOpt);
  1962. // resultFakeCmptsInMainType.push(fakeCmpt);
  1963. // }
  1964. // else {
  1965. // notInit && resultTarOptsInMainType.push(void 0);
  1966. // resultFakeCmptsInMainType.push(void 0);
  1967. // }
  1968. // });
  1969. // }
  1970. // });
  1971. // }
  1972. const vs=ys;var xs=a,_s=o,bs=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Ss(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=bs.length;n<i;n++){var o=bs[n],r=e.normal,a=e.emphasis;r&&r[o]&&(t[o]=t[o]||{},t[o].normal?tt(t[o].normal,r[o]):t[o].normal=r[o],r[o]=null),a&&a[o]&&(t[o]=t[o]||{},t[o].emphasis?tt(t[o].emphasis,a[o]):t[o].emphasis=a[o],a[o]=null)}}function ws(t,e,n){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var i=t[e].normal,o=t[e].emphasis;i&&(
  1973. // Timeline controlStyle has other properties besides normal and emphasis
  1974. n?(t[e].normal=t[e].emphasis=null,I(t[e],i)):t[e]=i),o&&(t.emphasis=t.emphasis||{},t.emphasis[e]=o,
  1975. // Also compat the case user mix the style and focus together in ec3 style
  1976. // for example: { itemStyle: { normal: {}, emphasis: {focus, shadowBlur} } }
  1977. o.focus&&(t.emphasis.focus=o.focus),o.blurScope&&(t.emphasis.blurScope=o.blurScope))}}function Ms(t){ws(t,"itemStyle"),ws(t,"lineStyle"),ws(t,"areaStyle"),ws(t,"label"),ws(t,"labelLine"),
  1978. // treemap
  1979. ws(t,"upperLabel"),
  1980. // graph
  1981. ws(t,"edgeLabel")}function Is(t,e){
  1982. // Check whether is not object (string\null\undefined ...)
  1983. var n=_s(t)&&t[e],i=_s(n)&&n.textStyle;if(i)for(var o=0,r=Mn.length;o<r;o++){var a=Mn[o];i.hasOwnProperty(a)&&(n[a]=i[a])}}function Ds(t){t&&(Ms(t),Is(t,"label"),t.emphasis&&Is(t.emphasis,"label"))}function Ts(t){return i(t)?t:t?[t]:[]}function Cs(t){return(i(t)?t[0]:t)||{}}function As(t,e){xs(Ts(t.series),(function(t){_s(t)&&function(t){if(_s(t)){Ss(t),Ms(t),Is(t,"label"),
  1984. // treemap
  1985. Is(t,"upperLabel"),
  1986. // graph
  1987. Is(t,"edgeLabel"),t.emphasis&&(Is(t.emphasis,"label"),
  1988. // treemap
  1989. Is(t.emphasis,"upperLabel"),
  1990. // graph
  1991. Is(t.emphasis,"edgeLabel"));var e=t.markPoint;e&&(Ss(e),Ds(e));var n=t.markLine;n&&(Ss(n),Ds(n));var o=t.markArea;o&&Ds(o);var r=t.data;
  1992. // Break with ec3: if `setOption` again, there may be no `type` in option,
  1993. // then the backward compat based on option type will not be performed.
  1994. if("graph"===t.type){r=r||t.nodes;var s=t.links||t.edges;if(s&&!at(s))for(var l=0;l<s.length;l++)Ds(s[l]);a(t.categories,(function(t){Ms(t)}))}if(r&&!at(r))for(l=0;l<r.length;l++)Ds(r[l]);
  1995. // mark point data
  1996. if((e=t.markPoint)&&e.data){var u=e.data;for(l=0;l<u.length;l++)Ds(u[l])}
  1997. // mark line data
  1998. if((n=t.markLine)&&n.data){var c=n.data;for(l=0;l<c.length;l++)i(c[l])?(Ds(c[l][0]),Ds(c[l][1])):Ds(c[l])}
  1999. // Series
  2000. "gauge"===t.type?(Is(t,"axisLabel"),Is(t,"title"),Is(t,"detail")):"treemap"===t.type?(ws(t.breadcrumb,"itemStyle"),a(t.levels,(function(t){Ms(t)}))):"tree"===t.type&&Ms(t.leaves);
  2001. // sunburst starts from ec4, so it does not need to compat levels.
  2002. }}(t)}));var n=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&n.push("valueAxis","categoryAxis","logAxis","timeAxis"),xs(n,(function(e){xs(Ts(t[e]),(function(t){t&&(Is(t,"axisLabel"),Is(t.axisPointer,"label"))}))})),xs(Ts(t.parallel),(function(t){var e=t&&t.parallelAxisDefault;Is(e,"axisLabel"),Is(e&&e.axisPointer,"label")})),xs(Ts(t.calendar),(function(t){ws(t,"itemStyle"),Is(t,"dayLabel"),Is(t,"monthLabel"),Is(t,"yearLabel")})),
  2003. // radar.name.textStyle
  2004. xs(Ts(t.radar),(function(t){Is(t,"name"),
  2005. // Use axisName instead of name because component has name property
  2006. t.name&&null==t.axisName&&(t.axisName=t.name,delete t.name),null!=t.nameGap&&null==t.axisNameGap&&(t.axisNameGap=t.nameGap,delete t.nameGap)})),xs(Ts(t.geo),(function(t){_s(t)&&(Ds(t),xs(Ts(t.regions),(function(t){Ds(t)})))})),xs(Ts(t.timeline),(function(t){Ds(t),ws(t,"label"),ws(t,"itemStyle"),ws(t,"controlStyle",!0);var e=t.data;i(e)&&a(e,(function(t){o(t)&&(ws(t,"label"),ws(t,"itemStyle"))}))})),xs(Ts(t.toolbox),(function(t){ws(t,"iconStyle"),xs(t.feature,(function(t){ws(t,"iconStyle")}))})),Is(Cs(t.axisPointer),"label"),Is(Cs(t.tooltip).axisPointer,"label")}function Ls(t){t&&a(ks,(function(e){e[0]in t&&!(e[1]in t)&&(t[e[1]]=t[e[0]])}))}var ks=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],Ps=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],Ns=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function Os(t){var e=t&&t.itemStyle;if(e)for(var n=0;n<Ns.length;n++){var i=Ns[n][1],o=Ns[n][0];null!=e[i]&&(e[o]=e[i])}}function Rs(t){t&&"edge"===t.alignTo&&null!=t.margin&&null==t.edgeDistance&&(t.edgeDistance=t.margin)}function Es(t){t&&t.downplay&&!t.blur&&(t.blur=t.downplay)}function Vs(t,e){if(t)for(var n=0;n<t.length;n++)e(t[n]),t[n]&&Vs(t[n].children,e)}function zs(t,e){As(t,e),
  2007. // Make sure series array for model initialization.
  2008. t.series=Sn(t.series),a(t.series,(function(t){if(o(t)){var e=t.type;if("line"===e)null!=t.clipOverflow&&(t.clip=t.clipOverflow);else if("pie"===e||"gauge"===e){if(null!=t.clockWise&&(t.clockwise=t.clockWise),Rs(t.label),(r=t.data)&&!at(r))for(var n=0;n<r.length;n++)Rs(r[n]);null!=t.hoverOffset&&(t.emphasis=t.emphasis||{},(t.emphasis.scaleSize=null)&&(t.emphasis.scaleSize=t.hoverOffset))}else if("gauge"===e){var i=function(t,e){for(var n=e.split(","),i=t,o=0;o<n.length&&null!=(i=i&&i[n[o]]);o++);return i}(t,"pointer.color");null!=i&&function(t,e,n,i){for(var o,r=e.split(","),a=t,s=0;s<r.length-1;s++)null==a[o=r[s]]&&(a[o]={}),a=a[o];(i||null==a[r[s]])&&(a[r[s]]=n)}(t,"itemStyle.color",i)}else if("bar"===e){var r;if(Os(t),Os(t.backgroundStyle),Os(t.emphasis),(r=t.data)&&!at(r))for(n=0;n<r.length;n++)"object"==typeof r[n]&&(Os(r[n]),Os(r[n]&&r[n].emphasis))}else if("sunburst"===e){var a=t.highlightPolicy;a&&(t.emphasis=t.emphasis||{},t.emphasis.focus||(t.emphasis.focus=a)),Es(t),Vs(t.data,Es)}else"graph"===e||"sankey"===e?function(t){t&&null!=t.focusNodeAdjacency&&(t.emphasis=t.emphasis||{},null==t.emphasis.focus&&(t.emphasis.focus="adjacency"))}(t):"map"===e&&(t.mapType&&!t.map&&(t.map=t.mapType),t.mapLocation&&I(t,t.mapLocation));null!=t.hoverAnimation&&(t.emphasis=t.emphasis||{},t.emphasis&&null==t.emphasis.scale&&(t.emphasis.scale=t.hoverAnimation)),Ls(t)}})),
  2009. // dataRange has changed to visualMap
  2010. t.dataRange&&(t.visualMap=t.dataRange),a(Ps,(function(e){var n=t[e];n&&(i(n)||(n=[n]),a(n,(function(t){Ls(t)})))}))}
  2011. // (1) [Caution]: the logic is correct based on the premises:
  2012. // data processing stage is blocked in stream.
  2013. // See <module:echarts/stream/Scheduler#performDataProcessorTasks>
  2014. // (2) Only register once when import repeatedly.
  2015. // Should be executed after series is filtered and before stack calculation.
  2016. function Bs(t){a(t,(function(e,n){var i=[],o=[NaN,NaN],r=[e.stackResultDimension,e.stackedOverDimension],a=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";
  2017. // Should not write on raw data, because stack series model list changes
  2018. // depending on legend selection.
  2019. a.modify(r,(function(r,u,c){var d,h,p=a.get(e.stackedDimension,c);
  2020. // Consider `connectNulls` of line area, if value is NaN, stackedOver
  2021. // should also be NaN, to draw a appropriate belt area.
  2022. if(isNaN(p))return o;s?h=a.getRawIndex(c):d=a.get(e.stackedByDimension,c);
  2023. // If stackOver is NaN, chart view will render point on value start.
  2024. for(var f=NaN,g=n-1;g>=0;g--){var y=t[g];
  2025. // Has been optimized by inverted indices on `stackedByDimension`.
  2026. if(s||(h=y.data.rawIndexOf(y.stackedByDimension,d)),h>=0){var m=y.data.getByRawIndex(y.stackResultDimension,h);
  2027. // Considering positive stack, negative stack and empty data
  2028. if("all"===l||"positive"===l&&m>0||"negative"===l&&m<0||"samesign"===l&&p>=0&&m>0||"samesign"===l&&p<=0&&m<0){
  2029. // The sum has to be very small to be affected by the
  2030. // floating arithmetic problem. An incorrect result will probably
  2031. // cause axis min/max to be filtered incorrectly.
  2032. p=en(p,m),f=m;break}}}return i[0]=p,i[1]=f,i}))}))}
  2033. // @inner
  2034. var Gs,Fs,Ws,Hs,Ys,Us=function(t){this.data=t.data||(t.sourceFormat===Ra?{}:[]),this.sourceFormat=t.sourceFormat||Va,
  2035. // Visit config
  2036. this.seriesLayoutBy=t.seriesLayoutBy||za,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var e=this.dimensionsDefine=t.dimensionsDefine;if(e)for(var n=0;n<e.length;n++){var i=e[n];null==i.type&&Xa(this,n)===Ga&&(i.type="ordinal")}};function Zs(t){return t instanceof Us}
  2037. /**
  2038. * Create a source from option.
  2039. * NOTE: Created source is immutable. Don't change any properties in it.
  2040. */function Xs(e,n,
  2041. // can be null. If not provided, auto detect it from `sourceData`.
  2042. o){o=o||qs(e);var r=n.seriesLayoutBy,s=
  2043. /**
  2044. * Determine the source definitions from data standalone dimensions definitions
  2045. * are not specified.
  2046. */
  2047. function(e,n,o,r,
  2048. // standalone raw dimensions definition, like:
  2049. // {
  2050. // dimensions: ['aa', 'bb', { name: 'cc', type: 'time' }]
  2051. // }
  2052. // in `dataset` or `series`
  2053. s){var u,c;
  2054. // PENDING: Could data be null/undefined here?
  2055. // currently, if `dataset.source` not specified, error thrown.
  2056. // if `series.data` not specified, nothing rendered without error thrown.
  2057. // Should test these cases.
  2058. if(!e)return{dimensionsDefine:Ks(s),startIndex:c,dimensionsDetectedCount:u};if(n===Na){var d=e;
  2059. // Rule: Most of the first line are string: it is header.
  2060. // Caution: consider a line with 5 string and 1 number,
  2061. // it still can not be sure it is a head, because the
  2062. // 5 string may be 5 values of category columns.
  2063. "auto"===r||null==r?Js((function(e){
  2064. // '-' is regarded as null/undefined.
  2065. null!=e&&"-"!==e&&(t(e)?null==c&&(c=1):c=0);
  2066. // 10 is an experience number, avoid long loop.
  2067. }),o,d,10):c=l(r)?r:r?1:0,s||1!==c||(s=[],Js((function(t,e){s[e]=null!=t?t+"":""}),o,d,Infinity)),u=s?s.length:o===Ba?d.length:d[0]?d[0].length:null}else if(n===Oa)s||(s=function(t){var e,n=0;for(;n<t.length&&!(e=t[n++]););// jshint ignore: line
  2068. if(e)return v(e)}
  2069. // Consider dimensions defined like ['A', 'price', 'B', 'price', 'C', 'price'],
  2070. // which is reasonable. But dimension name is duplicated.
  2071. // Returns undefined or an array contains only object without null/undefined or string.
  2072. (e));else if(n===Ra)s||(s=[],a(e,(function(t,e){s.push(e)})));else if(n===Pa){var h=In(e[0]);u=i(h)&&h.length||1}return{startIndex:c,dimensionsDefine:Ks(s),dimensionsDetectedCount:u}}(e,o,r,n.sourceHeader,n.dimensions);return new Us({data:e,sourceFormat:o,seriesLayoutBy:r,dimensionsDefine:s.dimensionsDefine,startIndex:s.startIndex,dimensionsDetectedCount:s.dimensionsDetectedCount,metaRawOption:et(n)})}
  2073. /**
  2074. * Wrap original series data for some compatibility cases.
  2075. */function js(t){return new Us({data:t,sourceFormat:at(t)?Ea:Pa})}
  2076. /**
  2077. * Clone source but excludes source data.
  2078. */
  2079. /**
  2080. * Note: An empty array will be detected as `SOURCE_FORMAT_ARRAY_ROWS`.
  2081. */
  2082. function qs(t){var e=Va;if(at(t))e=Ea;else if(i(t)){
  2083. // FIXME Whether tolerate null in top level array?
  2084. 0===t.length&&(e=Na);for(var n=0,r=t.length;n<r;n++){var a=t[n];if(null!=a){if(i(a)||at(a)){e=Na;break}if(o(a)){e=Oa;break}}}}else if(o(t))for(var s in t)if(N(t,s)&&m(t[s])){e=Ra;break}return e}function Ks(t){if(t){var e=r();return n(t,(function(t,n){
  2085. // Other fields will be discarded.
  2086. var i={name:(t=o(t)?t:{name:t}).name,displayName:t.displayName,type:t.type};
  2087. // User can set null in dimensions.
  2088. // We don't auto specify name, otherwise a given name may
  2089. // cause it to be referred unexpectedly.
  2090. if(null==i.name)return i;
  2091. // Also consider number form like 2012.
  2092. i.name+="",
  2093. // User may also specify displayName.
  2094. // displayName will always exists except user not
  2095. // specified or dim name is not specified or detected.
  2096. // (A auto generated dim name will not be used as
  2097. // displayName).
  2098. null==i.displayName&&(i.displayName=i.name);var r=e.get(i.name);return r?i.name+="-"+r.count++:e.set(i.name,{count:1}),i}))}}function Js(t,e,n,i){if(e===Ba)for(var o=0;o<n.length&&o<i;o++)t(n[o]?n[o][0]:null,o);else{var r=n[0]||[];for(o=0;o<r.length&&o<i;o++)t(r[o],o)}}function $s(t){var e=t.sourceFormat;return e===Oa||e===Ra}
  2099. /*
  2100. * Licensed to the Apache Software Foundation (ASF) under one
  2101. * or more contributor license agreements. See the NOTICE file
  2102. * distributed with this work for additional information
  2103. * regarding copyright ownership. The ASF licenses this file
  2104. * to you under the Apache License, Version 2.0 (the
  2105. * "License"); you may not use this file except in compliance
  2106. * with the License. You may obtain a copy of the License at
  2107. *
  2108. * http://www.apache.org/licenses/LICENSE-2.0
  2109. *
  2110. * Unless required by applicable law or agreed to in writing,
  2111. * software distributed under the License is distributed on an
  2112. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  2113. * KIND, either express or implied. See the License for the
  2114. * specific language governing permissions and limitations
  2115. * under the License.
  2116. */
  2117. /**
  2118. * AUTO-GENERATED FILE. DO NOT MODIFY.
  2119. */
  2120. /*
  2121. * Licensed to the Apache Software Foundation (ASF) under one
  2122. * or more contributor license agreements. See the NOTICE file
  2123. * distributed with this work for additional information
  2124. * regarding copyright ownership. The ASF licenses this file
  2125. * to you under the Apache License, Version 2.0 (the
  2126. * "License"); you may not use this file except in compliance
  2127. * with the License. You may obtain a copy of the License at
  2128. *
  2129. * http://www.apache.org/licenses/LICENSE-2.0
  2130. *
  2131. * Unless required by applicable law or agreed to in writing,
  2132. * software distributed under the License is distributed on an
  2133. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  2134. * KIND, either express or implied. See the License for the
  2135. * specific language governing permissions and limitations
  2136. * under the License.
  2137. */
  2138. /**
  2139. * If normal array used, mutable chunk size is supported.
  2140. * If typed array used, chunk size must be fixed.
  2141. */
  2142. var Qs=/** @class */function(){function t(t,e){
  2143. // let source: Source;
  2144. var n=Zs(t)?t:js(t);
  2145. // declare source is Source;
  2146. this._source=n;var i=this._data=n.data;
  2147. // Typed array. TODO IE10+?
  2148. n.sourceFormat===Ea&&(this._offset=0,this._dimSize=e,this._data=i),Ys(this,i,n)}return t.prototype.getSource=function(){return this._source},t.prototype.count=function(){return 0},t.prototype.getItem=function(t,e){},t.prototype.appendData=function(t){},t.prototype.clean=function(){},t.protoInitialize=function(){
  2149. // PENDING: To avoid potential incompat (e.g., prototype
  2150. // is visited somewhere), still init them on prototype.
  2151. var e=t.prototype;e.pure=!1,e.persistent=!0}(),t.internalField=function(){var t;Ys=function(t,o,r){var a=r.sourceFormat,s=r.seriesLayoutBy,l=r.startIndex,u=r.dimensionsDefine,c=Hs[ul(a,s)];if(p(t,c),a===Ea)t.getItem=e,t.count=i,t.fillStorage=n;else{var d=nl(a,s);t.getItem=lt(d,null,o,l,u);var h=rl(a,s);t.count=lt(h,null,o,l,u)}};var e=function(t,e){t-=this._offset,e=e||[];for(var n=this._data,i=this._dimSize,o=i*t,r=0;r<i;r++)e[r]=n[o+r];return e},n=function(t,e,n,i){for(var o=this._data,r=this._dimSize,a=0;a<r;a++){for(var s=i[a],l=null==s[0]?Infinity:s[0],u=null==s[1]?-Infinity:s[1],c=e-t,d=n[a],h=0;h<c;h++){
  2152. // appendData with TypedArray will always do replace in provider.
  2153. var p=o[h*r+a];d[t+h]=p,p<l&&(l=p),p>u&&(u=p)}s[0]=l,s[1]=u}},i=function(){return this._data?this._data.length/this._dimSize:0};function o(t){for(var e=0;e<t.length;e++)this._data.push(t[e])}(t={})[Na+"_"+za]={pure:!0,appendData:o},t[Na+"_"+Ba]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[Oa]={pure:!0,appendData:o},t[Ra]={pure:!0,appendData:function(t){var e=this._data;a(t,(function(t,n){for(var i=e[n]||(e[n]=[]),o=0;o<(t||[]).length;o++)i.push(t[o])}))}},t[Pa]={appendData:o},t[Ea]={persistent:!1,pure:!0,appendData:function(t){this._data=t},
  2154. // Clean self if data is already used.
  2155. clean:function(){
  2156. // PENDING
  2157. this._offset+=this.count(),this._data=null}},Hs=t}(),t}(),tl=function(t,e,n,i){return t[i]},el=((Gs={})[Na+"_"+za]=function(t,e,n,i){return t[i+e]},Gs[Na+"_"+Ba]=function(t,e,n,i,o){i+=e;for(var r=o||[],a=t,s=0;s<a.length;s++){var l=a[s];r[s]=l?l[i]:null}return r},Gs[Oa]=tl,Gs[Ra]=function(t,e,n,i,o){for(var r=o||[],a=0;a<n.length;a++){var s=t[n[a].name];r[a]=s?s[i]:null}return r},Gs[Pa]=tl,Gs);function nl(t,e){return el[ul(t,e)]}var il=function(t,e,n){return t.length},ol=((Fs={})[Na+"_"+za]=function(t,e,n){return Math.max(0,t.length-e)},Fs[Na+"_"+Ba]=function(t,e,n){var i=t[0];return i?Math.max(0,i.length-e):0},Fs[Oa]=il,Fs[Ra]=function(t,e,n){var i=t[n[0].name];return i?i.length:0},Fs[Pa]=il,Fs);function rl(t,e){return ol[ul(t,e)]}var al=function(t,e,n){return t[e]},sl=((Ws={})[Na]=al,Ws[Oa]=function(t,e,n){return t[n]},Ws[Ra]=al,Ws[Pa]=function(t,e,n){
  2158. // FIXME: In some case (markpoint in geo (geo-map.html)),
  2159. // dataItem is {coord: [...]}
  2160. var i=In(t);return i instanceof Array?i[e]:i},Ws[Ea]=al,Ws);function ll(t){return sl[t]}function ul(t,e){return t===Na?t+"_"+e:t}
  2161. // ??? FIXME can these logic be more neat: getRawValue, getRawDataItem,
  2162. // Consider persistent.
  2163. // Caution: why use raw value to display on label or tooltip?
  2164. // A reason is to avoid format. For example time value we do not know
  2165. // how to format is expected. More over, if stack is used, calculated
  2166. // value may be 0.91000000001, which have brings trouble to display.
  2167. // TODO: consider how to treat null/undefined/NaN when display?
  2168. function cl(t,e,
  2169. // If dimIndex is null/undefined, return OptionDataItem.
  2170. // Otherwise, return OptionDataValue.
  2171. n){if(t){
  2172. // Consider data may be not persistent.
  2173. var i=t.getRawDataItem(e);if(null!=i){var o=t.getStore(),r=o.getSource().sourceFormat;if(null!=n){var a=t.getDimensionIndex(n),s=o.getDimensionProperty(a);return ll(r)(i,a,s)}var l=i;return r===Pa&&(l=In(i)),l}}}var dl=/\{@(.+?)\}/g,hl=/** @class */function(){function e(){}
  2174. /**
  2175. * Get params for formatter
  2176. */return e.prototype.getDataParams=function(t,e){var n=this.getData(e),i=this.getRawValue(t,e),o=n.getRawIndex(t),r=n.getName(t),a=n.getRawDataItem(t),s=n.getItemVisual(t,"style"),l=s&&s[n.getItemVisual(t,"drawType")||"fill"],u=s&&s.stroke,c=this.mainType,d="series"===c,h=n.userOutput&&n.userOutput.get();return{componentType:c,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:d?this.subType:null,seriesIndex:this.seriesIndex,seriesId:d?this.id:null,seriesName:d?this.name:null,name:r,dataIndex:o,data:a,dataType:e,value:i,color:l,borderColor:u,dimensionNames:h?h.fullDimensions:null,encode:h?h.encode:null,
  2177. // Param name list for mapping `a`, `b`, `c`, `d`, `e`
  2178. $vars:["seriesName","name","value"]}},
  2179. /**
  2180. * Format label
  2181. * @param dataIndex
  2182. * @param status 'normal' by default
  2183. * @param dataType
  2184. * @param labelDimIndex Only used in some chart that
  2185. * use formatter in different dimensions, like radar.
  2186. * @param formatter Formatter given outside.
  2187. * @return return null/undefined if no formatter
  2188. */
  2189. e.prototype.getFormattedLabel=function(e,n,o,r,a,s){n=n||"normal";var l=this.getData(o),u=this.getDataParams(e,o);(s&&(u.value=s.interpolatedValue),null!=r&&i(u.value)&&(u.value=u.value[r]),a)||(
  2190. // @ts-ignore
  2191. a=l.getItemModel(e).get("normal"===n?["label","formatter"]:[n,"label","formatter"]));return f(a)?(u.status=n,u.dimensionIndex=r,a(u)):t(a)?ca(a,u).replace(dl,(function(t,n){var o=n.length,r=n;"["===r.charAt(0)&&"]"===r.charAt(o-1)&&(r=+r.slice(1,o-1));var a=cl(l,e,r);if(s&&i(s.interpolatedValue)){var u=l.getDimensionIndex(r);u>=0&&(a=s.interpolatedValue[u])}return null!=a?a+"":""})):void 0},
  2192. /**
  2193. * Get raw value in option
  2194. */
  2195. e.prototype.getRawValue=function(t,e){return cl(this.getData(e),t)},
  2196. /**
  2197. * Should be implemented.
  2198. * @param {number} dataIndex
  2199. * @param {boolean} [multipleSeries=false]
  2200. * @param {string} [dataType]
  2201. */
  2202. e.prototype.formatTooltip=function(t,e,n){},e}();
  2203. // PENDING: previously we accept this type when calling `formatTooltip`,
  2204. // but guess little chance has been used outside. Do we need to backward
  2205. // compat it?
  2206. // type TooltipFormatResultLegacyObject = {
  2207. // // `html` means the markup language text, either in 'html' or 'richText'.
  2208. // // The name `html` is not appropriate because in 'richText' it is not a HTML
  2209. // // string. But still support it for backward compatibility.
  2210. // html: string;
  2211. // markers: Dictionary<ColorString>;
  2212. // };
  2213. /**
  2214. * For backward compat, normalize the return from `formatTooltip`.
  2215. */
  2216. function pl(t){var e,n;
  2217. // let markers: Dictionary<ColorString>;
  2218. return o(t)?t.type&&(n=t):e=t,{text:e,
  2219. // markers: markers || markersExisting,
  2220. frag:n}}
  2221. /**
  2222. * @param {Object} define
  2223. * @return See the return of `createTask`.
  2224. */function fl(t){return new gl(t)}var gl=/** @class */function(){function t(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}
  2225. /**
  2226. * @param step Specified step.
  2227. * @param skip Skip customer perform call.
  2228. * @param modBy Sampling window size.
  2229. * @param modDataCount Sampling count.
  2230. * @return whether unfinished.
  2231. */return t.prototype.perform=function(t){var e,n=this._upstream,o=t&&t.skip;
  2232. // TODO some refactor.
  2233. // Pull data. Must pull data each time, because context.data
  2234. // may be updated by Series.setData.
  2235. if(this._dirty&&n){var r=this.context;r.data=r.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!o&&(e=this._plan(this.context));
  2236. // Support sharding by mod, which changes the render sequence and makes the rendered graphic
  2237. // elements uniformed distributed when progress, especially when moving or zooming.
  2238. var a,s=d(this._modBy),l=this._modDataCount||0,u=d(t&&t.modBy),c=t&&t.modDataCount||0;function d(t){// jshint ignore:line
  2239. return!(t>=1)&&(t=1),t}s===u&&l===c||(e="reset"),(this._dirty||"reset"===e)&&(this._dirty=!1,a=this._doReset(o)),this._modBy=u,this._modDataCount=c;var h=t&&t.step;
  2240. // Note: Stubs, that its host overall task let it has progress, has progress.
  2241. // If no progress, pass index from upstream to downstream each time plan called.
  2242. if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):Infinity,this._progress){var p=this._dueIndex,f=Math.min(null!=h?this._dueIndex+h:Infinity,this._dueEnd);if(!o&&(a||p<f)){var g=this._progress;if(i(g))for(var y=0;y<g.length;y++)this._doProgress(g[y],p,f,u,c);else this._doProgress(g,p,f,u,c)}this._dueIndex=f;
  2243. // If no `outputDueEnd`, assume that output data and
  2244. // input data is the same, so use `dueIndex` as `outputDueEnd`.
  2245. var m=null!=this._settedOutputEnd?this._settedOutputEnd:f;this._outputDueEnd=m}else
  2246. // (1) Some overall task has no progress.
  2247. // (2) Stubs, that its host overall task do not let it has progress, has no progress.
  2248. // This should always be performed so it can be passed to downstream.
  2249. this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()},t.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},t.prototype._doProgress=function(t,e,n,i,o){yl.reset(e,n,i,o),this._callingProgress=t,this._callingProgress({start:e,end:n,count:n-e,next:yl.next},this.context)},t.prototype._doReset=function(t){var e,n;this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null,!t&&this._reset&&((e=this._reset(this.context))&&e.progress&&(n=e.forceFirstProgress,e=e.progress),
  2250. // To simplify no progress checking, array must has item.
  2251. i(e)&&!e.length&&(e=null)),this._progress=e,this._modBy=this._modDataCount=null;var o=this._downstream;return o&&o.dirty(),n},t.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},
  2252. /**
  2253. * @param downTask The downstream task.
  2254. * @return The downstream task.
  2255. */
  2256. t.prototype.pipe=function(t){
  2257. // If already downstream, do not dirty downTask.
  2258. (this._downstream!==t||this._dirty)&&(this._downstream=t,t._upstream=this,t.dirty())},t.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},t.prototype.getUpstream=function(){return this._upstream},t.prototype.getDownstream=function(){return this._downstream},t.prototype.setOutputEnd=function(t){
  2259. // This only happens in dataTask, dataZoom, map, currently.
  2260. // where dataZoom do not set end each time, but only set
  2261. // when reset. So we should record the set end, in case
  2262. // that the stub of dataZoom perform again and earse the
  2263. // set end by upstream.
  2264. this._outputDueEnd=this._settedOutputEnd=t},t}(),yl=function(){var t,e,n,i,o,r={reset:function(l,u,c,d){e=l,t=u,n=c,i=d,o=Math.ceil(i/n),r.next=n>1&&i>0?s:a}};return r;function a(){return e<t?e++:null}function s(){var r=e%o*n+Math.ceil(e/o),a=e>=t?null:r<i?r:e;return e++,a}}();
  2265. // -----------------------------------------------------------------------------
  2266. // For stream debug (Should be commented out after used!)
  2267. // @usage: printTask(this, 'begin');
  2268. // @usage: printTask(this, null, {someExtraProp});
  2269. // @usage: Use `__idxInPipeline` as conditional breakpiont.
  2270. // window.printTask = function (task: any, prefix: string, extra: { [key: string]: unknown }): void {
  2271. // window.ecTaskUID == null && (window.ecTaskUID = 0);
  2272. // task.uidDebug == null && (task.uidDebug = `task_${window.ecTaskUID++}`);
  2273. // task.agent && task.agent.uidDebug == null && (task.agent.uidDebug = `task_${window.ecTaskUID++}`);
  2274. // let props = [];
  2275. // if (task.__pipeline) {
  2276. // let val = `${task.__idxInPipeline}/${task.__pipeline.tail.__idxInPipeline} ${task.agent ? '(stub)' : ''}`;
  2277. // props.push({text: '__idxInPipeline/total', value: val});
  2278. // } else {
  2279. // let stubCount = 0;
  2280. // task.agentStubMap.each(() => stubCount++);
  2281. // props.push({text: 'idx', value: `overall (stubs: ${stubCount})`});
  2282. // }
  2283. // props.push({text: 'uid', value: task.uidDebug});
  2284. // if (task.__pipeline) {
  2285. // props.push({text: 'pipelineId', value: task.__pipeline.id});
  2286. // task.agent && props.push(
  2287. // {text: 'stubFor', value: task.agent.uidDebug}
  2288. // );
  2289. // }
  2290. // props.push(
  2291. // {text: 'dirty', value: task._dirty},
  2292. // {text: 'dueIndex', value: task._dueIndex},
  2293. // {text: 'dueEnd', value: task._dueEnd},
  2294. // {text: 'outputDueEnd', value: task._outputDueEnd}
  2295. // );
  2296. // if (extra) {
  2297. // Object.keys(extra).forEach(key => {
  2298. // props.push({text: key, value: extra[key]});
  2299. // });
  2300. // }
  2301. // let args = ['color: blue'];
  2302. // let msg = `%c[${prefix || 'T'}] %c` + props.map(item => (
  2303. // args.push('color: green', 'color: red'),
  2304. // `${item.text}: %c${item.value}`
  2305. // )).join('%c, ');
  2306. // console.log.apply(console, [msg].concat(args));
  2307. // // console.log(this);
  2308. // };
  2309. // window.printPipeline = function (task: any, prefix: string) {
  2310. // const pipeline = task.__pipeline;
  2311. // let currTask = pipeline.head;
  2312. // while (currTask) {
  2313. // window.printTask(currTask, prefix);
  2314. // currTask = currTask._downstream;
  2315. // }
  2316. // };
  2317. // window.showChain = function (chainHeadTask) {
  2318. // var chain = [];
  2319. // var task = chainHeadTask;
  2320. // while (task) {
  2321. // chain.push({
  2322. // task: task,
  2323. // up: task._upstream,
  2324. // down: task._downstream,
  2325. // idxInPipeline: task.__idxInPipeline
  2326. // });
  2327. // task = task._downstream;
  2328. // }
  2329. // return chain;
  2330. // };
  2331. // window.findTaskInChain = function (task, chainHeadTask) {
  2332. // let chain = window.showChain(chainHeadTask);
  2333. // let result = [];
  2334. // for (let i = 0; i < chain.length; i++) {
  2335. // let chainItem = chain[i];
  2336. // if (chainItem.task === task) {
  2337. // result.push(i);
  2338. // }
  2339. // }
  2340. // return result;
  2341. // };
  2342. // window.printChainAEachInChainB = function (chainHeadTaskA, chainHeadTaskB) {
  2343. // let chainA = window.showChain(chainHeadTaskA);
  2344. // for (let i = 0; i < chainA.length; i++) {
  2345. // console.log('chainAIdx:', i, 'inChainB:', window.findTaskInChain(chainA[i].task, chainHeadTaskB));
  2346. // }
  2347. // };
  2348. /**
  2349. * Convert raw the value in to inner value in List.
  2350. *
  2351. * [Performance sensitive]
  2352. *
  2353. * [Caution]: this is the key logic of user value parser.
  2354. * For backward compatibility, do not modify it until you have to!
  2355. */
  2356. function ml(t,
  2357. // For high performance, do not omit the second param.
  2358. e){
  2359. // Performance sensitive.
  2360. var n=e&&e.type;return"ordinal"===n?t:("time"!==n||l(t)||null==t||"-"===t||(t=+sn(t)),null==t||""===t?NaN:Number(t))}var vl=r({number:function(t){
  2361. // Do not use `numericToNumber` here. We have `numericToNumber` by default.
  2362. // Here the number parser can have loose rule:
  2363. // enable to cut suffix: "120px" => 120, "14%" => 14.
  2364. return parseFloat(t)},time:function(t){
  2365. // return timestamp.
  2366. return+sn(t)},trim:function(e){return t(e)?Q(e):e}});function xl(t){return vl.get(t)}var _l={lt:function(t,e){return t<e},lte:function(t,e){return t<=e},gt:function(t,e){return t>e},gte:function(t,e){return t>=e}},bl=/** @class */function(){function t(t,e){if(!l(e)){vn("")}this._opFn=_l[t],this._rvalFloat=pn(e)}
  2367. // Performance sensitive.
  2368. return t.prototype.evaluate=function(t){
  2369. // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.
  2370. return l(t)?this._opFn(t,this._rvalFloat):this._opFn(pn(t),this._rvalFloat)},t}(),Sl=/** @class */function(){
  2371. /**
  2372. * @param order by default: 'asc'
  2373. * @param incomparable by default: Always on the tail.
  2374. * That is, if 'asc' => 'max', if 'desc' => 'min'
  2375. * See the definition of "incomparable" in [SORT_COMPARISON_RULE].
  2376. */
  2377. function e(t,e){var n="desc"===t;this._resultLT=n?1:-1,null==e&&(e=n?"min":"max"),this._incomparable="min"===e?-Infinity:Infinity}
  2378. // See [SORT_COMPARISON_RULE].
  2379. // Performance sensitive.
  2380. return e.prototype.evaluate=function(e,n){
  2381. // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.
  2382. var i=l(e)?e:pn(e),o=l(n)?n:pn(n),r=isNaN(i),a=isNaN(o);if(r&&(i=this._incomparable),a&&(o=this._incomparable),r&&a){var s=t(e),u=t(n);s&&(i=u?e:0),u&&(o=s?n:0)}return i<o?this._resultLT:i>o?-this._resultLT:0},e}(),wl=/** @class */function(){function t(t,e){this._rval=e,this._isEQ=t,this._rvalTypeof=typeof e,this._rvalFloat=pn(e)}
  2383. // Performance sensitive.
  2384. return t.prototype.evaluate=function(t){var e=t===this._rval;if(!e){var n=typeof t;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(e=pn(t)===this._rvalFloat)}return this._isEQ?e:!e},t}();
  2385. /**
  2386. * [FILTER_COMPARISON_RULE]
  2387. * `lt`|`lte`|`gt`|`gte`:
  2388. * + rval must be a number. And lval will be converted to number (`numericToNumber`) to compare.
  2389. * `eq`:
  2390. * + If same type, compare with `===`.
  2391. * + If there is one number, convert to number (`numericToNumber`) to compare.
  2392. * + Else return `false`.
  2393. * `ne`:
  2394. * + Not `eq`.
  2395. *
  2396. *
  2397. * [SORT_COMPARISON_RULE]
  2398. * All the values are grouped into three categories:
  2399. * + "numeric" (number and numeric string)
  2400. * + "non-numeric-string" (string that excluding numeric string)
  2401. * + "others"
  2402. * "numeric" vs "numeric": values are ordered by number order.
  2403. * "non-numeric-string" vs "non-numeric-string": values are ordered by ES spec (#sec-abstract-relational-comparison).
  2404. * "others" vs "others": do not change order (always return 0).
  2405. * "numeric" vs "non-numeric-string": "non-numeric-string" is treated as "incomparable".
  2406. * "number" vs "others": "others" is treated as "incomparable".
  2407. * "non-numeric-string" vs "others": "others" is treated as "incomparable".
  2408. * "incomparable" will be seen as -Infinity or Infinity (depends on the settings).
  2409. * MEMO:
  2410. * Non-numeric string sort makes sense when we need to put the items with the same tag together.
  2411. * But if we support string sort, we still need to avoid the misleading like `'2' > '12'`,
  2412. * So we treat "numeric-string" sorted by number order rather than string comparison.
  2413. *
  2414. *
  2415. * [CHECK_LIST_OF_THE_RULE_DESIGN]
  2416. * + Do not support string comparison until required. And also need to
  2417. * avoid the misleading of "2" > "12".
  2418. * + Should avoid the misleading case:
  2419. * `" 22 " gte "22"` is `true` but `" 22 " eq "22"` is `false`.
  2420. * + JS bad case should be avoided: null <= 0, [] <= 0, ' ' <= 0, ...
  2421. * + Only "numeric" can be converted to comparable number, otherwise converted to NaN.
  2422. * See `util/number.ts#numericToNumber`.
  2423. *
  2424. * @return If `op` is not `RelationalOperator`, return null;
  2425. */
  2426. function Ml(t,e){return"eq"===t||"ne"===t?new wl("eq"===t,e):N(_l,t)?new bl(t,e):null}
  2427. /**
  2428. * TODO: disable writable.
  2429. * This structure will be exposed to users.
  2430. */var Il=/** @class */function(){function t(){}return t.prototype.getRawData=function(){
  2431. // Only built-in transform available.
  2432. throw new Error("not supported")},t.prototype.getRawDataItem=function(t){
  2433. // Only built-in transform available.
  2434. throw new Error("not supported")},t.prototype.cloneRawData=function(){},
  2435. /**
  2436. * @return If dimension not found, return null/undefined.
  2437. */
  2438. t.prototype.getDimensionInfo=function(t){},
  2439. /**
  2440. * dimensions defined if and only if either:
  2441. * (a) dataset.dimensions are declared.
  2442. * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`).
  2443. * If dimensions are defined, `dimensionInfoAll` is corresponding to
  2444. * the defined dimensions.
  2445. * Otherwise, `dimensionInfoAll` is determined by data columns.
  2446. * @return Always return an array (even empty array).
  2447. */
  2448. t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},
  2449. /**
  2450. * Only support by dimension index.
  2451. * No need to support by dimension name in transform function,
  2452. * because transform function is not case-specific, no need to use name literally.
  2453. */
  2454. t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return ml(t,e)},t}();function Dl(t){if(!Pl(t.sourceFormat)){vn("")}return t.data}function Tl(t){var e=t.sourceFormat,n=t.data;if(!Pl(e)){vn("")}if(e===Na){for(var i=[],o=0,r=n.length;o<r;o++)
  2455. // Not strictly clone for performance
  2456. i.push(n[o].slice());return i}if(e===Oa){for(i=[],o=0,r=n.length;o<r;o++)
  2457. // Not strictly clone for performance
  2458. i.push(p({},n[o]));return i}}function Cl(t,e,n){if(null!=n)
  2459. // Keep the same logic as `List::getDimension` did.
  2460. return l(n)||!isNaN(n)&&!N(e,n)?t[n]:N(e,n)?e[n]:void 0}function Al(t){return et(t)}var Ll=r();function kl(t,e,i,
  2461. // If `pipeIndex` is null/undefined, no piped transform.
  2462. r){e.length||vn(""),o(t)||vn("");var s=t.type,l=Ll.get(s);l||vn("");
  2463. // Prepare source
  2464. var u=n(e,(function(t){return function(t,e){var n=new Il,i=t.data,o=n.sourceFormat=t.sourceFormat,r=t.startIndex;t.seriesLayoutBy!==za&&vn("");
  2465. // [MEMO]
  2466. // Create a new dimensions structure for exposing.
  2467. // Do not expose all dimension info to users directly.
  2468. // Because the dimension is probably auto detected from data and not might reliable.
  2469. // Should not lead the transformers to think that is reliable and return it.
  2470. // See [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.
  2471. var s=[],l={},u=t.dimensionsDefine;if(u)a(u,(function(t,e){var n=t.name,i={index:e,name:n,displayName:t.displayName};s.push(i),
  2472. // Users probably do not specify dimension name. For simplicity, data transform
  2473. // does not generate dimension name.
  2474. null!=n&&(N(l,n)&&vn(""),l[n]=i)}));else for(var c=0;c<t.dimensionsDetectedCount;c++)
  2475. // Do not generete name or anything others. The consequence process in
  2476. // `transform` or `series` probably have there own name generation strategry.
  2477. s.push({index:c});
  2478. // Implement public methods:
  2479. var d=nl(o,za);e.__isBuiltIn&&(n.getRawDataItem=function(t){return d(i,r,s,t)},n.getRawData=lt(Dl,null,t)),n.cloneRawData=lt(Tl,null,t);var h=rl(o,za);n.count=lt(h,null,i,r,s);var p=ll(o);n.retrieveValue=function(t,e){var n=d(i,r,s,t);return f(n,e)};var f=n.retrieveValueFromItem=function(t,e){if(null!=t){var n=s[e];
  2480. // When `dimIndex` is `null`, `rawValueGetter` return the whole item.
  2481. return n?p(t,e,n.name):void 0}};return n.getDimensionInfo=lt(Cl,null,s,l),n.cloneAllDimensionInfo=lt(Al,null,s),n}(t,l)})),c=Sn(l.transform({upstream:u[0],upstreamList:u,config:et(t.config)}));return n(c,(function(t,n){var i;o(t)||vn(""),t.data||vn(""),Pl(qs(t.data))||vn("");var r=e[0];
  2482. /**
  2483. * Intuitively, the end users known the content of the original `dataset.source`,
  2484. * calucating the transform result in mind.
  2485. * Suppose the original `dataset.source` is:
  2486. * ```js
  2487. * [
  2488. * ['product', '2012', '2013', '2014', '2015'],
  2489. * ['AAA', 41.1, 30.4, 65.1, 53.3],
  2490. * ['BBB', 86.5, 92.1, 85.7, 83.1],
  2491. * ['CCC', 24.1, 67.2, 79.5, 86.4]
  2492. * ]
  2493. * ```
  2494. * The dimension info have to be detected from the source data.
  2495. * Some of the transformers (like filter, sort) will follow the dimension info
  2496. * of upstream, while others use new dimensions (like aggregate).
  2497. * Transformer can output a field `dimensions` to define the its own output dimensions.
  2498. * We also allow transformers to ignore the output `dimensions` field, and
  2499. * inherit the upstream dimensions definition. It can reduce the burden of handling
  2500. * dimensions in transformers.
  2501. *
  2502. * See also [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.
  2503. */if(r&&0===n&&!t.dimensions){var a=r.startIndex;
  2504. // We copy the header of upstream to the result, because:
  2505. // (1) The returned data always does not contain header line and can not be used
  2506. // as dimension-detection. In this case we can not use "detected dimensions" of
  2507. // upstream directly, because it might be detected based on different `seriesLayoutBy`.
  2508. // (2) We should support that the series read the upstream source in `seriesLayoutBy: 'row'`.
  2509. // So the original detected header should be add to the result, otherwise they can not be read.
  2510. a&&(t.data=r.data.slice(0,a).concat(t.data)),i={seriesLayoutBy:za,sourceHeader:a,dimensions:r.metaRawOption.dimensions}}else i={seriesLayoutBy:za,sourceHeader:0,dimensions:t.dimensions};return Xs(t.data,i,null)}))}function Pl(t){return t===Na||t===Oa}var Nl,Ol="undefined",Rl=typeof Uint32Array===Ol?Array:Uint32Array,El=typeof Uint16Array===Ol?Array:Uint16Array,Vl=typeof Int32Array===Ol?Array:Int32Array,zl=typeof Float64Array===Ol?Array:Float64Array,Bl={float:zl,int:Vl,
  2511. // Ordinal data type can be string or int
  2512. ordinal:Array,number:Array,time:zl};
  2513. /* global Float64Array, Int32Array, Uint32Array, Uint16Array */
  2514. // Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is
  2515. // different from the Ctor of typed array.
  2516. function Gl(t){
  2517. // The possible max value in this._indicies is always this._rawCount despite of filtering.
  2518. return t>65535?Rl:El}function Fl(t,e,n,i,o){var r=Bl[n||"float"];if(o){var a=t[e],s=a&&a.length;if(s!==i){
  2519. // The cost of the copy is probably inconsiderable
  2520. // within the initial chunkSize.
  2521. for(var l=new r(i),u=0;u<s;u++)l[u]=a[u];t[e]=l}}else t[e]=new r(i)}
  2522. /**
  2523. * Basically, DataStore API keep immutable.
  2524. */var Wl=/** @class */function(){function t(){this._chunks=[],
  2525. // It will not be calculated until needed.
  2526. this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=r()}
  2527. /**
  2528. * Initialize from data
  2529. */return t.prototype.initData=function(t,e,i){this._provider=t,
  2530. // Clear
  2531. this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var o=t.getSource(),r=this.defaultDimValueGetter=Nl[o.sourceFormat];
  2532. // Default dim value getter
  2533. this._dimValueGetter=i||r,
  2534. // Reset raw extent.
  2535. this._rawExtent=[],$s(o),this._dimensions=n(e,(function(t){return{
  2536. // Only pick these two props. Not leak other properties like orderMeta.
  2537. type:t.type,property:t.property}})),this._initDataFromProvider(0,t.count())},t.prototype.getProvider=function(){return this._provider},
  2538. /**
  2539. * Caution: even when a `source` instance owned by a series, the created data store
  2540. * may still be shared by different sereis (the source hash does not use all `source`
  2541. * props, see `sourceManager`). In this case, the `source` props that are not used in
  2542. * hash (like `source.dimensionDefine`) probably only belongs to a certain series and
  2543. * thus should not be fetch here.
  2544. */
  2545. t.prototype.getSource=function(){return this._provider.getSource()},
  2546. /**
  2547. * @caution Only used in dataStack.
  2548. */
  2549. t.prototype.ensureCalculationDimension=function(t,e){var n=this._calcDimNameToIdx,i=this._dimensions,o=n.get(t);if(null!=o){if(i[o].type===e)return o}else o=i.length;return i[o]={type:e},n.set(t,o),this._chunks[o]=new Bl[e||"float"](this._rawCount),this._rawExtent[o]=[Infinity,-Infinity],o},t.prototype.collectOrdinalMeta=function(t,e){var n=this._chunks[t],i=this._dimensions[t],o=this._rawExtent,r=i.ordinalOffset||0,a=n.length;0===r&&(
  2550. // We need to reset the rawExtent if collect is from start.
  2551. // Because this dimension may be guessed as number and calcuating a wrong extent.
  2552. o[t]=[Infinity,-Infinity]);
  2553. // Parse from previous data offset. len may be changed after appendData
  2554. for(var s=o[t],l=r;l<a;l++){var u=n[l]=e.parseAndCollect(n[l]);isNaN(u)||(s[0]=Math.min(u,s[0]),s[1]=Math.max(u,s[1]))}i.ordinalMeta=e,i.ordinalOffset=a,i.type="ordinal"},t.prototype.getOrdinalMeta=function(t){return this._dimensions[t].ordinalMeta},t.prototype.getDimensionProperty=function(t){var e=this._dimensions[t];return e&&e.property},
  2555. /**
  2556. * Caution: Can be only called on raw data (before `this._indices` created).
  2557. */
  2558. t.prototype.appendData=function(t){var e=this._provider,n=this.count();e.appendData(t);var i=e.count();return e.persistent||(i+=n),n<i&&this._initDataFromProvider(n,i,!0),[n,i]},t.prototype.appendValues=function(t,e){for(var n=this._chunks,i=this._dimensions,o=i.length,r=this._rawExtent,a=this.count(),s=a+Math.max(t.length,e||0),l=0;l<o;l++){Fl(n,l,(p=i[l]).type,s,!0)}for(var u=[],c=a;c<s;c++)
  2559. // Store the data by dimensions
  2560. for(var d=c-a,h=0;h<o;h++){var p=i[h],f=Nl.arrayRows.call(this,t[d]||u,p.property,d,h);n[h][c]=f;var g=r[h];f<g[0]&&(g[0]=f),f>g[1]&&(g[1]=f)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,i){for(var o=this._provider,r=this._chunks,a=this._dimensions,s=a.length,l=this._rawExtent,u=n(a,(function(t){return t.property})),c=0;c<s;c++){var d=a[c];l[c]||(l[c]=[Infinity,-Infinity]),Fl(r,c,d.type,e,i)}if(o.fillStorage)o.fillStorage(t,e,r,l);else for(var h=[],p=t;p<e;p++){
  2561. // NOTICE: Try not to write things into dataItem
  2562. h=o.getItem(p,h);
  2563. // Each data item is value
  2564. // [1, 2]
  2565. // 2
  2566. // Bar chart, line chart which uses category axis
  2567. // only gives the 'y' value. 'x' value is the indices of category
  2568. // Use a tempValue to normalize the value to be a (x, y) value
  2569. // Store the data by dimensions
  2570. for(var f=0;f<s;f++){var g=r[f],y=this._dimValueGetter(h,u[f],p,f);
  2571. // PENDING NULL is empty or zero
  2572. g[p]=y;var m=l[f];y<m[0]&&(m[0]=y),y>m[1]&&(m[1]=y)}}!o.persistent&&o.clean&&
  2573. // Clean unused data if data source is typed array.
  2574. o.clean(),this._rawCount=this._count=e,
  2575. // Reset data extent
  2576. this._extent=[]},t.prototype.count=function(){return this._count},
  2577. /**
  2578. * Get value. Return NaN if idx is out of range.
  2579. */
  2580. t.prototype.get=function(t,e){if(!(e>=0&&e<this._count))return NaN;var n=this._chunks[t];return n?n[this.getRawIndex(e)]:NaN},t.prototype.getValues=function(t,e){var n=[],i=[];if(null==e){e=t,
  2581. // TODO get all from store?
  2582. t=[];
  2583. // All dimensions
  2584. for(var o=0;o<this._dimensions.length;o++)i.push(o)}else i=t;o=0;for(var r=i.length;o<r;o++)n.push(this.get(i[o],e));return n},
  2585. /**
  2586. * @param dim concrete dim
  2587. */
  2588. t.prototype.getByRawIndex=function(t,e){if(!(e>=0&&e<this._rawCount))return NaN;var n=this._chunks[t];return n?n[e]:NaN},
  2589. /**
  2590. * Get sum of data in one dimension
  2591. */
  2592. t.prototype.getSum=function(t){var e=0;if(this._chunks[t])for(var n=0,i=this.count();n<i;n++){var o=this.get(t,n);isNaN(o)||(e+=o)}return e},
  2593. /**
  2594. * Get median of data in one dimension
  2595. */
  2596. t.prototype.getMedian=function(t){var e=[];
  2597. // map all data of one dimension
  2598. this.each([t],(function(t){isNaN(t)||e.push(t)}));
  2599. // TODO
  2600. // Use quick select?
  2601. var n=e.sort((function(t,e){return t-e})),i=this.count();
  2602. // calculate median
  2603. return 0===i?0:i%2==1?n[(i-1)/2]:(n[i/2]+n[i/2-1])/2},
  2604. /**
  2605. * Retrieve the index with given raw data index.
  2606. */
  2607. t.prototype.indexOfRawIndex=function(t){if(t>=this._rawCount||t<0)return-1;if(!this._indices)return t;
  2608. // Indices are ascending
  2609. var e=this._indices,n=e[t];
  2610. // If rawIndex === dataIndex
  2611. if(null!=n&&n<this._count&&n===t)return t;for(var i=0,o=this._count-1;i<=o;){var r=(i+o)/2|0;if(e[r]<t)i=r+1;else{if(!(e[r]>t))return r;o=r-1}}return-1},
  2612. /**
  2613. * Retrieve the index of nearest value.
  2614. * @param dim
  2615. * @param value
  2616. * @param [maxDistance=Infinity]
  2617. * @return If and only if multiple indices have
  2618. * the same value, they are put to the result.
  2619. */
  2620. t.prototype.indicesOfNearest=function(t,e,n){var i=this._chunks[t],o=[];if(!i)return o;null==n&&(n=Infinity);
  2621. // Check the test case of `test/ut/spec/data/SeriesData.js`.
  2622. for(var r=Infinity,a=-1,s=0,l=0,u=this.count();l<u;l++){var c=e-i[this.getRawIndex(l)],d=Math.abs(c);d<=n&&(
  2623. // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`,
  2624. // we'd better not push both of them to `nearestIndices`, otherwise it is easy to
  2625. // get more than one item in `nearestIndices` (more specifically, in `tooltip`).
  2626. // So we choose the one that `diff >= 0` in this case.
  2627. // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them
  2628. // should be push to `nearestIndices`.
  2629. (d<r||d===r&&c>=0&&a<0)&&(r=d,a=c,s=0),c===a&&(o[s++]=l))}return o.length=s,o},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=e.constructor,i=this._count;
  2630. // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`.
  2631. if(n===Array){t=new n(i);for(var o=0;o<i;o++)t[o]=e[o]}else t=new n(e.buffer,0,i)}else{t=new(n=Gl(this._rawCount))(this.count());for(o=0;o<t.length;o++)t[o]=o}return t},
  2632. /**
  2633. * Data filter.
  2634. */
  2635. t.prototype.filter=function(t,e){if(!this._count)return this;for(var n=this.clone(),i=n.count(),o=new(Gl(n._rawCount))(i),r=[],a=t.length,s=0,l=t[0],u=n._chunks,c=0;c<i;c++){var d=void 0,h=n.getRawIndex(c);
  2636. // Simple optimization
  2637. if(0===a)d=e(c);else if(1===a){d=e(u[l][h],c)}else{for(var p=0;p<a;p++)r[p]=u[t[p]][h];r[p]=c,d=e.apply(null,r)}d&&(o[s++]=h)}
  2638. // Set indices after filtered.
  2639. return s<i&&(n._indices=o),n._count=s,
  2640. // Reset data extent
  2641. n._extent=[],n._updateGetRawIdx(),n},
  2642. /**
  2643. * Select data in range. (For optimization of filter)
  2644. * (Manually inline code, support 5 million data filtering in data zoom.)
  2645. */
  2646. t.prototype.selectRange=function(t){var e=this.clone(),n=e._count;if(!n)return this;var i=v(t),o=i.length;if(!o)return this;var r=e.count(),a=new(Gl(e._rawCount))(r),s=0,l=i[0],u=t[l][0],c=t[l][1],d=e._chunks,h=!1;if(!e._indices){
  2647. // Extreme optimization for common case. About 2x faster in chrome.
  2648. var p=0;if(1===o){for(var f=d[i[0]],g=0;g<n;g++){
  2649. // NaN will not be filtered. Consider the case, in line chart, empty
  2650. // value indicates the line should be broken. But for the case like
  2651. // scatter plot, a data item with empty value will not be rendered,
  2652. // but the axis extent may be effected if some other dim of the data
  2653. // item has value. Fortunately it is not a significant negative effect.
  2654. ((_=f[g])>=u&&_<=c||isNaN(_))&&(a[s++]=p),p++}h=!0}else if(2===o){f=d[i[0]];var y=d[i[1]],m=t[i[1]][0],x=t[i[1]][1];for(g=0;g<n;g++){var _=f[g],b=y[g];
  2655. // Do not filter NaN, see comment above.
  2656. (_>=u&&_<=c||isNaN(_))&&(b>=m&&b<=x||isNaN(b))&&(a[s++]=p),p++}h=!0}}if(!h)if(1===o)for(g=0;g<r;g++){var S=e.getRawIndex(g);
  2657. // Do not filter NaN, see comment above.
  2658. ((_=d[i[0]][S])>=u&&_<=c||isNaN(_))&&(a[s++]=S)}else for(g=0;g<r;g++){for(var w=!0,M=(S=e.getRawIndex(g),0);M<o;M++){var I=i[M];
  2659. // Do not filter NaN, see comment above.
  2660. ((_=d[I][S])<t[I][0]||_>t[I][1])&&(w=!1)}w&&(a[s++]=e.getRawIndex(g))}
  2661. // Set indices after filtered.
  2662. return s<r&&(e._indices=a),e._count=s,
  2663. // Reset data extent
  2664. e._extent=[],e._updateGetRawIdx(),e},
  2665. // /**
  2666. // * Data mapping to a plain array
  2667. // */
  2668. // mapArray(dims: DimensionIndex[], cb: MapArrayCb): any[] {
  2669. // const result: any[] = [];
  2670. // this.each(dims, function () {
  2671. // result.push(cb && (cb as MapArrayCb).apply(null, arguments));
  2672. // });
  2673. // return result;
  2674. // }
  2675. /**
  2676. * Data mapping to a new List with given dimensions
  2677. */
  2678. t.prototype.map=function(t,e){
  2679. // TODO only clone picked chunks.
  2680. var n=this.clone(t);return this._updateDims(n,t,e),n},
  2681. /**
  2682. * @caution Danger!! Only used in dataStack.
  2683. */
  2684. t.prototype.modify=function(t,e){this._updateDims(this,t,e)},t.prototype._updateDims=function(t,e,n){for(var i=t._chunks,o=[],r=e.length,a=t.count(),s=[],l=t._rawExtent,u=0;u<e.length;u++)l[e[u]]=[Infinity,-Infinity];for(var c=0;c<a;c++){for(var d=t.getRawIndex(c),h=0;h<r;h++)s[h]=i[e[h]][d];s[r]=c;var p=n&&n.apply(null,s);if(null!=p){
  2685. // a number or string (in oridinal dimension)?
  2686. "object"!=typeof p&&(o[0]=p,p=o);for(u=0;u<p.length;u++){var f=e[u],g=p[u],y=l[f],m=i[f];m&&(m[d]=g),g<y[0]&&(y[0]=g),g>y[1]&&(y[1]=g)}}}},
  2687. /**
  2688. * Large data down sampling using largest-triangle-three-buckets
  2689. * @param {string} valueDimension
  2690. * @param {number} targetCount
  2691. */
  2692. t.prototype.lttbDownSample=function(t,e){var n,i,o,r=this.clone([t],!0),a=r._chunks[t],s=this.count(),l=0,u=Math.floor(1/e),c=this.getRawIndex(0),d=new(Gl(this._rawCount))(Math.min(2*(Math.ceil(s/u)+2),s));
  2693. // First frame use the first data.
  2694. d[l++]=c;for(var h=1;h<s-1;h+=u){for(var p=Math.min(h+u,s-1),f=Math.min(h+2*u,s),g=(f+p)/2,y=0,m=p;m<f;m++){var v=a[I=this.getRawIndex(m)];isNaN(v)||(y+=v)}y/=f-p;var x=h,_=Math.min(h+u,s),b=h-1,S=a[c];n=-1,o=x;var w=-1,M=0;
  2695. // Find a point from current frame that construct a triangle with largest area with previous selected point
  2696. // And the average of next frame.
  2697. for(m=x;m<_;m++){var I;v=a[I=this.getRawIndex(m)];isNaN(v)?(M++,w<0&&(w=I)):(
  2698. // Calculate triangle area over three buckets
  2699. i=Math.abs((b-g)*(v-S)-(b-m)*(y-S)))>n&&(n=i,o=I)}M>0&&M<_-x&&(
  2700. // Append first NaN point in every bucket.
  2701. // It is necessary to ensure the correct order of indices.
  2702. d[l++]=Math.min(w,o),o=Math.max(w,o)),d[l++]=o,c=o}
  2703. // First frame use the last data.
  2704. return d[l++]=this.getRawIndex(s-1),r._count=l,r._indices=d,r.getRawIndex=this._getRawIdx,r},
  2705. /**
  2706. * Large data down sampling using min-max
  2707. * @param {string} valueDimension
  2708. * @param {number} rate
  2709. */
  2710. t.prototype.minmaxDownSample=function(t,e){for(var n=this.clone([t],!0),i=n._chunks,o=Math.floor(1/e),r=i[t],a=this.count(),s=new(Gl(this._rawCount))(2*Math.ceil(a/o)),l=0,u=0;u<a;u+=o){var c=u,d=r[this.getRawIndex(c)],h=u,p=r[this.getRawIndex(h)],f=o;
  2711. // Handle final smaller frame
  2712. u+o>a&&(f=a-u);
  2713. // Determine min and max within the current frame
  2714. for(var g=0;g<f;g++){var y=r[this.getRawIndex(u+g)];y<d&&(d=y,c=u+g),y>p&&(p=y,h=u+g)}var m=this.getRawIndex(c),v=this.getRawIndex(h);
  2715. // Set the order of the min and max values, based on their ordering in the frame
  2716. c<h?(s[l++]=m,s[l++]=v):(s[l++]=v,s[l++]=m)}return n._count=l,n._indices=s,n._updateGetRawIdx(),n},
  2717. /**
  2718. * Large data down sampling on given dimension
  2719. * @param sampleIndex Sample index for name and id
  2720. */
  2721. t.prototype.downSample=function(t,e,n,i){for(var o=this.clone([t],!0),r=o._chunks,a=[],s=Math.floor(1/e),l=r[t],u=this.count(),c=o._rawExtent[t]=[Infinity,-Infinity],d=new(Gl(this._rawCount))(Math.ceil(u/s)),h=0,p=0;p<u;p+=s){
  2722. // Last frame
  2723. s>u-p&&(s=u-p,a.length=s);for(var f=0;f<s;f++){var g=this.getRawIndex(p+f);a[f]=l[g]}var y=n(a),m=this.getRawIndex(Math.min(p+i(a,y)||0,u-1));
  2724. // Only write value on the filtered data
  2725. l[m]=y,y<c[0]&&(c[0]=y),y>c[1]&&(c[1]=y),d[h++]=m}return o._count=h,o._indices=d,o._updateGetRawIdx(),o},
  2726. /**
  2727. * Data iteration
  2728. * @param ctx default this
  2729. * @example
  2730. * list.each('x', function (x, idx) {});
  2731. * list.each(['x', 'y'], function (x, y, idx) {});
  2732. * list.each(function (idx) {})
  2733. */
  2734. t.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,o=0,r=this.count();o<r;o++){var a=this.getRawIndex(o);
  2735. // Simple optimization
  2736. switch(n){case 0:e(o);break;case 1:e(i[t[0]][a],o);break;case 2:e(i[t[0]][a],i[t[1]][a],o);break;default:for(var s=0,l=[];s<n;s++)l[s]=i[t[s]][a];
  2737. // Index
  2738. l[s]=o,e.apply(null,l)}}},
  2739. /**
  2740. * Get extent of data in one dimension
  2741. */
  2742. t.prototype.getDataExtent=function(t){
  2743. // Make sure use concrete dim as cache name.
  2744. var e=this._chunks[t],n=[Infinity,-Infinity];if(!e)return n;
  2745. // Make more strict checkings to ensure hitting cache.
  2746. var i,o=this.count();
  2747. // Consider the most cases when using data zoom, `getDataExtent`
  2748. // happened before filtering. We cache raw extent, which is not
  2749. // necessary to be cleared and recalculated when restore data.
  2750. if(!this._indices)return this._rawExtent[t].slice();if(i=this._extent[t])return i.slice();for(var r=(i=n)[0],a=i[1],s=0;s<o;s++){var l=e[this.getRawIndex(s)];l<r&&(r=l),l>a&&(a=l)}return i=[r,a],this._extent[t]=i,i},
  2751. /**
  2752. * Get raw data item
  2753. */
  2754. t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var n=[],i=this._chunks,o=0;o<i.length;o++)n.push(i[o][e]);return n},
  2755. /**
  2756. * Clone shallow.
  2757. *
  2758. * @param clonedDims Determine which dims to clone. Will share the data if not specified.
  2759. */
  2760. t.prototype.clone=function(n,i){var o,r,a=new t,s=this._chunks,l=n&&e(n,(function(t,e){return t[e]=!0,t}),{});if(l)for(var u=0;u<s.length;u++)
  2761. // Not clone if dim is not picked.
  2762. a._chunks[u]=l[u]?(o=s[u],r=void 0,(r=o.constructor)===Array?o.slice():new r(o)):s[u];else a._chunks=s;return this._copyCommonProps(a),i||(a._indices=this._cloneIndices()),a._updateGetRawIdx(),a},t.prototype._copyCommonProps=function(t){t._count=this._count,t._rawCount=this._rawCount,t._provider=this._provider,t._dimensions=this._dimensions,t._extent=et(this._extent),t._rawExtent=et(this._rawExtent)},t.prototype._cloneIndices=function(){if(this._indices){var t=this._indices.constructor,e=void 0;if(t===Array){var n=this._indices.length;e=new t(n);for(var i=0;i<n;i++)e[i]=this._indices[i]}else e=new t(this._indices);return e}return null},t.prototype._getRawIdxIdentity=function(t){return t},t.prototype._getRawIdx=function(t){return t<this._count&&t>=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,n,i){return ml(t[i],this._dimensions[i])}Nl={arrayRows:t,objectRows:function(t,e,n,i){return ml(t[e],this._dimensions[i])},keyedColumns:t,original:function(t,e,n,i){
  2763. // Performance sensitive, do not use modelUtil.getDataItemValue.
  2764. // If dataItem is an plain object with no value field, the let `value`
  2765. // will be assigned with the object, but it will be tread correctly
  2766. // in the `convertValue`.
  2767. var o=t&&(null==t.value?t:t.value);return ml(o instanceof Array?o[i]:o,this._dimensions[i])},typedArray:function(t,e,n,i){return t[i]}}}(),t}();const Hl=Wl;
  2768. /**
  2769. * [REQUIREMENT_MEMO]:
  2770. * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option.
  2771. * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and
  2772. * `root-dataset`. Them on `series` has higher priority.
  2773. * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might
  2774. * confuse users: whether those props indicate how to visit the upstream source or visit
  2775. * the transform result source, and some transforms has nothing to do with these props,
  2776. * and some transforms might have multiple upstream.
  2777. * (3) Transforms should specify `metaRawOption` in each output, just like they can be
  2778. * declared in `root-dataset`.
  2779. * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms.
  2780. * That is for reducing complexity in transforms.
  2781. * PENDING: Whether to provide transposition transform?
  2782. *
  2783. * [IMPLEMENTAION_MEMO]:
  2784. * "sourceVisitConfig" are calculated from `metaRawOption` and `data`.
  2785. * They will not be calculated until `source` is about to be visited (to prevent from
  2786. * duplicate calcuation). `source` is visited only in series and input to transforms.
  2787. *
  2788. * [DIMENSION_INHERIT_RULE]:
  2789. * By default the dimensions are inherited from ancestors, unless a transform return
  2790. * a new dimensions definition.
  2791. * Consider the case:
  2792. * ```js
  2793. * dataset: [{
  2794. * source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...]
  2795. * }, {
  2796. * transform: { type: 'filter', ... }
  2797. * }]
  2798. * dataset: [{
  2799. * dimension: ['Product', 'Sales', 'Prise'],
  2800. * source: [ ['Cookies', 321, 44.21], ...]
  2801. * }, {
  2802. * transform: { type: 'filter', ... }
  2803. * }]
  2804. * ```
  2805. * The two types of option should have the same behavior after transform.
  2806. *
  2807. *
  2808. * [SCENARIO]:
  2809. * (1) Provide source data directly:
  2810. * ```js
  2811. * series: {
  2812. * encode: {...},
  2813. * dimensions: [...]
  2814. * seriesLayoutBy: 'row',
  2815. * data: [[...]]
  2816. * }
  2817. * ```
  2818. * (2) Series refer to dataset.
  2819. * ```js
  2820. * series: [{
  2821. * encode: {...}
  2822. * // Ignore datasetIndex means `datasetIndex: 0`
  2823. * // and the dimensions defination in dataset is used
  2824. * }, {
  2825. * encode: {...},
  2826. * seriesLayoutBy: 'column',
  2827. * datasetIndex: 1
  2828. * }]
  2829. * ```
  2830. * (3) dataset transform
  2831. * ```js
  2832. * dataset: [{
  2833. * source: [...]
  2834. * }, {
  2835. * source: [...]
  2836. * }, {
  2837. * // By default from 0.
  2838. * transform: { type: 'filter', config: {...} }
  2839. * }, {
  2840. * // Piped.
  2841. * transform: [
  2842. * { type: 'filter', config: {...} },
  2843. * { type: 'sort', config: {...} }
  2844. * ]
  2845. * }, {
  2846. * id: 'regressionData',
  2847. * fromDatasetIndex: 1,
  2848. * // Third-party transform
  2849. * transform: { type: 'ecStat:regression', config: {...} }
  2850. * }, {
  2851. * // retrieve the extra result.
  2852. * id: 'regressionFormula',
  2853. * fromDatasetId: 'regressionData',
  2854. * fromTransformResult: 1
  2855. * }]
  2856. * ```
  2857. */var Yl=/** @class */function(){function t(t){
  2858. // Cached source. Do not repeat calculating if not dirty.
  2859. this._sourceList=[],this._storeList=[],
  2860. // version sign of each upstream source manager.
  2861. this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}
  2862. /**
  2863. * Mark dirty.
  2864. */return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},
  2865. /**
  2866. * For detecting whether the upstream source is dirty, so that
  2867. * the local cached source (in `_sourceList`) should be discarded.
  2868. */
  2869. t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},
  2870. /**
  2871. * Always return a source instance. Otherwise throw error.
  2872. */
  2873. t.prototype.prepareSource=function(){
  2874. // For the case that call `setOption` multiple time but no data changed,
  2875. // cache the result source to prevent from repeating transform.
  2876. this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,n=this._sourceHost,i=this._getUpstreamSourceManagers(),o=!!i.length;if(Zl(n)){var r=n,a=void 0,s=void 0,l=void 0;
  2877. // Has upstream dataset
  2878. if(o){var u=i[0];u.prepareSource(),a=(l=u.getSource()).data,s=l.sourceFormat,e=[u._getVersionSign()]}
  2879. // Series data is from own.
  2880. else a=r.get("data",!0),s=at(a)?Ea:Pa,e=[];
  2881. // See [REQUIREMENT_MEMO], merge settings on series and parent dataset if it is root.
  2882. var c=this._getSourceMetaRawOption()||{},d=l&&l.metaRawOption||{},h=x(c.seriesLayoutBy,d.seriesLayoutBy)||null,p=x(c.sourceHeader,d.sourceHeader),f=x(c.dimensions,d.dimensions);t=h!==d.seriesLayoutBy||!!p!=!!d.sourceHeader||f?[Xs(a,{seriesLayoutBy:h,sourceHeader:p,dimensions:f},s)]:[]}else{var g=n;
  2883. // Has upstream dataset.
  2884. if(o){var y=this._applyTransform(i);t=y.sourceList,e=y.upstreamSignList}
  2885. // Is root dataset.
  2886. else{t=[Xs(g.get("source",!0),this._getSourceMetaRawOption(),null)],e=[]}}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,i=n.get("transform",!0),o=n.get("fromTransformResult",!0);if(null!=o){1!==t.length&&Xl("")}var r,s=[],l=[];return a(t,(function(t){t.prepareSource();var e=t.getSource(o||0);null==o||e||Xl(""),s.push(e),l.push(t._getVersionSign())})),i?e=function(t,e){var n=Sn(t),i=n.length;i||vn("");for(var o=0,r=i;o<r;o++)e=kl(n[o],e),
  2887. // piped transform only support single input, except the fist one.
  2888. // piped transform only support single output, except the last one.
  2889. o!==r-1&&(e.length=Math.max(e.length,1));return e}(i,s,n.componentIndex):null!=o&&(e=[(r=s[0],new Us({data:r.data,sourceFormat:r.sourceFormat,seriesLayoutBy:r.seriesLayoutBy,dimensionsDefine:et(r.dimensionsDefine),startIndex:r.startIndex,dimensionsDetectedCount:r.dimensionsDetectedCount}))]),{sourceList:e,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;
  2890. // All sourceList is from the some upstream.
  2891. for(var t=this._getUpstreamSourceManagers(),e=0;e<t.length;e++){var n=t[e];if(
  2892. // Consider the case that there is ancestor diry, call it recursively.
  2893. // The performance is probably not an issue because usually the chain is not long.
  2894. n._isDirty()||this._upstreamSignList[e]!==n._getVersionSign())return!0}},
  2895. /**
  2896. * @param sourceIndex By default 0, means "main source".
  2897. * In most cases there is only one source.
  2898. */
  2899. t.prototype.getSource=function(t){t=t||0;var e=this._sourceList[t];if(!e){
  2900. // Series may share source instance with dataset.
  2901. var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(t)}return e},
  2902. /**
  2903. *
  2904. * Get a data store which can be shared across series.
  2905. * Only available for series.
  2906. *
  2907. * @param seriesDimRequest Dimensions that are generated in series.
  2908. * Should have been sorted by `storeDimIndex` asc.
  2909. */
  2910. t.prototype.getSharedDataStore=function(t){var e=t.makeStoreSchema();return this._innerGetDataStore(e.dimensions,t.source,e.hash)},t.prototype._innerGetDataStore=function(t,e,n){
  2911. // TODO Can use other sourceIndex?
  2912. var i=this._storeList,o=i[0];o||(o=i[0]={});var r=o[n];if(!r){var a=this._getUpstreamSourceManagers()[0];Zl(this._sourceHost)&&a?r=a._innerGetDataStore(t,e,n):
  2913. // Always create store from source of series.
  2914. (r=new Hl).initData(new Qs(e,t.length),t),o[n]=r}return r},
  2915. /**
  2916. * PENDING: Is it fast enough?
  2917. * If no upstream, return empty array.
  2918. */
  2919. t.prototype._getUpstreamSourceManagers=function(){
  2920. // Always get the relationship from the raw option.
  2921. // Do not cache the link of the dependency graph, so that
  2922. // there is no need to update them when change happens.
  2923. var t=this._sourceHost;if(Zl(t)){var e=Za(t);return e?[e.getSourceManager()]:[]}return n(function(t){
  2924. // Only these attributes declared, we by default reference to `datasetIndex: 0`.
  2925. // Otherwise, no reference.
  2926. return t.get("transform",!0)||t.get("fromTransformResult",!0)?Gn(t.ecModel,"dataset",{index:t.get("fromDatasetIndex",!0),id:t.get("fromDatasetId",!0)},zn).models:[]}(t),(function(t){return t.getSourceManager()}))},t.prototype._getSourceMetaRawOption=function(){var t,e,n,i=this._sourceHost;if(Zl(i))t=i.get("seriesLayoutBy",!0),e=i.get("sourceHeader",!0),n=i.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var o=i;t=o.get("seriesLayoutBy",!0),e=o.get("sourceHeader",!0),n=o.get("dimensions",!0)}return{seriesLayoutBy:t,sourceHeader:e,dimensions:n}},t}();
  2927. // Call this method after `super.init` and `super.mergeOption` to
  2928. // disable the transform merge, but do not disable transform clone from rawOption.
  2929. function Ul(t){t.option.transform&&ut(t.option.transform)}function Zl(t){
  2930. // Avoid circular dependency with Series.ts
  2931. return"series"===t.mainType}function Xl(t){throw new Error(t)}function jl(t){var e=t.lineHeight;return null==e?"line-height:1":"line-height:"+ot(e+"")+"px"}
  2932. // TODO: more textStyle option
  2933. function ql(t,e){var n=t.color||"#6e7079",i=t.fontSize||12,o=t.fontWeight||"400",r=t.color||"#464646",a=t.fontSize||14,s=t.fontWeight||"900";return"html"===e?{
  2934. // eslint-disable-next-line max-len
  2935. nameStyle:"font-size:"+ot(i+"")+"px;color:"+ot(n)+";font-weight:"+ot(o+""),
  2936. // eslint-disable-next-line max-len
  2937. valueStyle:"font-size:"+ot(a+"")+"px;color:"+ot(r)+";font-weight:"+ot(s+"")}:{nameStyle:{fontSize:i,fill:n,fontWeight:o},valueStyle:{fontSize:a,fill:r,fontWeight:s}}}
  2938. // See `TooltipMarkupLayoutIntent['innerGapLevel']`.
  2939. // (value from UI design)
  2940. var Kl=[0,10,20,30],Jl=["","\n","\n\n","\n\n\n"];
  2941. // eslint-disable-next-line max-len
  2942. function $l(t,e){return e.type=t,e}function Ql(t){return"section"===t.type}function tu(t){return Ql(t)?nu:iu}function eu(t){if(Ql(t)){var e=0,n=t.blocks.length,i=n>1||n>0&&!t.noHeader;return a(t.blocks,(function(t){var n=eu(t);
  2943. // If the some of the sub-blocks have some gaps (like 10px) inside, this block
  2944. // should use a larger gap (like 20px) to distinguish those sub-blocks.
  2945. n>=e&&(e=n+ +(i&&(
  2946. // 0 always can not be readable gap level.
  2947. !n||Ql(t)&&!t.noHeader)))})),e}return 0}function nu(t,e,n,o){var r,l=e.noHeader,u=(r=eu(e),{html:Kl[r],richText:Jl[r]}),c=[],d=e.blocks||[];s(!d||i(d)),d=d||[];var h=t.orderMode;if(e.sortBlocks&&h){d=d.slice();var f={valueAsc:"asc",valueDesc:"desc"};if(N(f,h)){var g=new Sl(f[h],null);d.sort((function(t,e){return g.evaluate(t.sortParam,e.sortParam)}))}
  2948. // FIXME 'seriesDesc' necessary?
  2949. else"seriesDesc"===h&&d.reverse()}a(d,(function(n,i){var r=e.valueFormatter,a=tu(n)(
  2950. // Inherit valueFormatter
  2951. r?p(p({},t),{valueFormatter:r}):t,n,i>0?u.html:0,o);null!=a&&c.push(a)}));var y="richText"===t.renderMode?c.join(u.richText):ru(o,c.join(""),l?n:u.html);if(l)return y;var m=sa(e.header,"ordinal",t.useUTC),v=ql(o,t.renderMode).nameStyle,x=jl(o);return"richText"===t.renderMode?au(t,m,v)+u.richText+y:ru(o,'<div style="'+v+";"+x+';">'+ot(m)+"</div>"+y,n)}function iu(t,e,o,r){var a=t.renderMode,s=e.noName,l=e.noValue,u=!e.markerType,c=e.name,d=t.useUTC,h=e.valueFormatter||t.valueFormatter||function(t){return t=i(t)?t:[t],n(t,(function(t,e){return sa(t,i(g)?g[e]:g,d)}))};if(!s||!l){var p=u?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",a),f=s?"":sa(c,"ordinal",d),g=e.valueType,y=l?[]:h(e.value,e.dataIndex),m=!u||!s,v=!u&&s,x=ql(r,a),_=x.nameStyle,b=x.valueStyle;return"richText"===a?(u?"":p)+(s?"":au(t,f,_))+(l?"":function(t,e,n,o,r){var a=[r],s=o?10:20;
  2952. // Value has commas inside, so use ' ' as delimiter for multiple values.
  2953. return n&&a.push({padding:[0,0,0,s],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(i(e)?e.join(" "):e,a)}(t,y,m,v,b)):ru(r,(u?"":p)+(s?"":function(t,e,n){return'<span style="'+n+";"+(e?"margin-left:2px":"")+'">'+ot(t)+"</span>"}(f,!u,_))+(l?"":function(t,e,o,r){
  2954. // Do not too close to marker, considering there are multiple values separated by spaces.
  2955. var a=o?"10px":"20px",s=e?"float:right;margin-left:"+a:"";return t=i(t)?t:[t],'<span style="'+s+";"+r+'">'+n(t,(function(t){return ot(t)})).join("&nbsp;&nbsp;")+"</span>"}(y,m,v,b)),o)}}
  2956. /**
  2957. * @return markupText. null/undefined means no content.
  2958. */function ou(t,e,n,i,o,r){if(t)return tu(t)({useUTC:o,renderMode:n,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter},t,0,r)}function ru(t,e,n){return'<div style="'+("margin: "+n+"px 0 0")+";"+jl(t)+';">'+e+'<div style="clear:both"></div></div>'}function au(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function su(t,e){return ha(t.getData().getItemVisual(e,"style")[t.visualDrawType])}function lu(t,e){var n=t.get("padding");return null!=n?n:"richText"===e?[8,10]:10}
  2959. /**
  2960. * The major feature is generate styles for `renderMode: 'richText'`.
  2961. * But it also serves `renderMode: 'html'` to provide
  2962. * "renderMode-independent" API.
  2963. */var uu=/** @class */function(){function e(){this.richTextStyles={},
  2964. // Notice that "generate a style name" usually happens repeatedly when mouse is moving and
  2965. // a tooltip is displayed. So we put the `_nextStyleNameId` as a member of each creator
  2966. // rather than static shared by all creators (which will cause it increase to fast).
  2967. this._nextStyleNameId=gn()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,n,i){var o="richText"===i?this._generateStyleName():null,r=da({color:n,type:e,renderMode:i,markerId:o});return t(r)?r:(this.richTextStyles[o]=r.style,r.content)},
  2968. /**
  2969. * @usage
  2970. * ```ts
  2971. * const styledText = markupStyleCreator.wrapRichTextStyle([
  2972. * // The styles will be auto merged.
  2973. * {
  2974. * fontSize: 12,
  2975. * color: 'blue'
  2976. * },
  2977. * {
  2978. * padding: 20
  2979. * }
  2980. * ]);
  2981. * ```
  2982. */
  2983. e.prototype.wrapRichTextStyle=function(t,e){var n={};i(e)?a(e,(function(t){return p(n,t)})):p(n,e);var o=this._generateStyleName();return this.richTextStyles[o]=n,"{"+o+"|"+t+"}"},e}();function cu(t){var n,o,r,s,l=t.series,u=t.dataIndex,c=t.multipleSeries,d=l.getData(),h=d.mapDimensionsAll("defaultedTooltip"),p=h.length,f=l.getRawValue(u),g=i(f),y=su(l,u);if(p>1||g&&!p){var m=function(t,n,i,o,r){
  2984. // check: category-no-encode-has-axis-data in dataset.html
  2985. var s=n.getData(),l=e(t,(function(t,e,n){var i=s.getDimensionInfo(n);return t||i&&!1!==i.tooltip&&null!=i.displayName}),!1),u=[],c=[],d=[];function h(t,e){var n=s.getDimensionInfo(e);
  2986. // If `dimInfo.tooltip` is not set, show tooltip.
  2987. n&&!1!==n.otherDims.tooltip&&(l?d.push($l("nameValue",{markerType:"subItem",markerColor:r,name:n.displayName,value:t,valueType:n.type})):(u.push(t),c.push(n.type)))}return o.length?a(o,(function(t){h(cl(s,i,t),t)})):a(t,h),{inlineValues:u,inlineValueTypes:c,blocks:d}}(f,l,u,h,y);n=m.inlineValues,o=m.inlineValueTypes,r=m.blocks,
  2988. // Only support tooltip sort by the first inline value. It's enough in most cases.
  2989. s=m.inlineValues[0]}else if(p){var v=d.getDimensionInfo(h[0]);s=n=cl(d,u,h[0]),o=v.type}else s=n=g?f[0]:f;
  2990. // Do not show generated series name. It might not be readable.
  2991. var x=kn(l),_=x&&l.name||"",b=d.getName(u),S=c?_:b;return $l("section",{header:_,
  2992. // When series name is not specified, do not show a header line with only '-'.
  2993. // This case always happens in tooltip.trigger: 'item'.
  2994. noHeader:c||!x,sortParam:s,blocks:[$l("nameValue",{markerType:"item",markerColor:y,
  2995. // Do not mix display seriesName and itemName in one tooltip,
  2996. // which might confuses users.
  2997. name:S,
  2998. // name dimension might be auto assigned, where the name might
  2999. // be not readable. So we check trim here.
  3000. noName:!Q(S),value:n,valueType:o,dataIndex:u})].concat(r||[])})}var du=On();function hu(t,e){return t.getName(e)||t.getId(e)}var pu="__universalTransitionEnabled",fu=/** @class */function(t){function e(){
  3001. // [Caution]: Because this class or desecendants can be used as `XXX.extend(subProto)`,
  3002. // the class members must not be initialized in constructor or declaration place.
  3003. // Otherwise there is bad case:
  3004. // class A {xxx = 1;}
  3005. // enableClassExtend(A);
  3006. // class B extends A {}
  3007. // var C = B.extend({xxx: 5});
  3008. // var c = new C();
  3009. // console.log(c.xxx); // expect 5 but always 1.
  3010. var e=null!==t&&t.apply(this,arguments)||this;
  3011. // ---------------------------------------
  3012. // Props about data selection
  3013. // ---------------------------------------
  3014. return e._selectedDataIndicesMap={},e}return Ue(e,t),e.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=fl({count:yu,reset:mu}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),(du(this).sourceManager=new Yl(this)).prepareSource();var i=this.getInitialData(t,n);xu(i,this),this.dataTask.context.data=i,du(this).dataBeforeProcessed=i,
  3015. // If we reverse the order (make data firstly, and then make
  3016. // dataBeforeProcessed by cloneShallow), cloneShallow will
  3017. // cause data.graph.data !== data when using
  3018. // module:echarts/data/Graph or module:echarts/data/Tree.
  3019. // See module:echarts/data/helper/linkSeriesData
  3020. // Theoretically, it is unreasonable to call `seriesModel.getData()` in the model
  3021. // init or merge stage, because the data can be restored. So we do not `restoreData`
  3022. // and `setData` here, which forbids calling `seriesModel.getData()` in this stage.
  3023. // Call `seriesModel.getRawData()` instead.
  3024. // this.restoreData();
  3025. gu(this),this._initSelectedMapFromData(i)},
  3026. /**
  3027. * Util for merge default and theme to option
  3028. */
  3029. e.prototype.mergeDefaultAndTheme=function(t,e){var n=ba(this),i=n?wa(t):{},o=this.subType;Ta.hasClass(o)&&(o+="Series"),tt(t,e.getTheme().get(this.subType)),tt(t,this.getDefaultOption()),
  3030. // Default label emphasis `show`
  3031. wn(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&Sa(t,i,n)},e.prototype.mergeOption=function(t,e){
  3032. // this.settingTask.dirty();
  3033. t=tt(this.option,t,!0),this.fillDataTextStyle(t.data);var n=ba(this);n&&Sa(this.option,t,n);var i=du(this).sourceManager;i.dirty(),i.prepareSource();var o=this.getInitialData(t,e);xu(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,du(this).dataBeforeProcessed=o,gu(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(t){
  3034. // Default data label emphasis `show`
  3035. // FIXME Tree structure data ?
  3036. // FIXME Performance ?
  3037. if(t&&!at(t))for(var e=["show"],n=0;n<t.length;n++)t[n]&&t[n].label&&wn(t[n],"label",e)},
  3038. /**
  3039. * Init a data structure from data related option in series
  3040. * Must be overridden.
  3041. */
  3042. e.prototype.getInitialData=function(t,e){},
  3043. /**
  3044. * Append data to list
  3045. */
  3046. e.prototype.appendData=function(t){this.getRawData().appendData(t.data)},
  3047. /**
  3048. * Consider some method like `filter`, `map` need make new data,
  3049. * We should make sure that `seriesModel.getData()` get correct
  3050. * data in the stream procedure. So we fetch data from upstream
  3051. * each time `task.perform` called.
  3052. */
  3053. e.prototype.getData=function(t){var e=bu(this);if(e){var n=e.context.data;return null!=t&&n.getLinkedData?n.getLinkedData(t):n}
  3054. // When series is not alive (that may happen when click toolbox
  3055. // restore or setOption with not merge mode), series data may
  3056. // be still need to judge animation or something when graphic
  3057. // elements want to know whether fade out.
  3058. return du(this).data},e.prototype.getAllData=function(){var t=this.getData();return t&&t.getLinkedDataAll?t.getLinkedDataAll():[{data:t}]},e.prototype.setData=function(t){var e=bu(this);if(e){var n=e.context;
  3059. // Consider case: filter, data sample.
  3060. // FIXME:TS never used, so comment it
  3061. // if (context.data !== data && task.modifyOutputEnd) {
  3062. // task.setOutputEnd(data.count());
  3063. // }
  3064. n.outputData=t,
  3065. // Caution: setData should update context.data,
  3066. // Because getData may be called multiply in a
  3067. // single stage and expect to get the data just
  3068. // set. (For example, AxisProxy, x y both call
  3069. // getData and setDate sequentially).
  3070. // So the context.data should be fetched from
  3071. // upstream each time when a stage starts to be
  3072. // performed.
  3073. e!==this.dataTask&&(n.data=t)}du(this).data=t},e.prototype.getEncode=function(){var t=this.get("encode",!0);if(t)return r(t)},e.prototype.getSourceManager=function(){return du(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},
  3074. /**
  3075. * Get data before processed
  3076. */
  3077. e.prototype.getRawData=function(){return du(this).dataBeforeProcessed},e.prototype.getColorBy=function(){return this.get("colorBy")||"series"},e.prototype.isColorBySeries=function(){return"series"===this.getColorBy()},
  3078. /**
  3079. * Get base axis if has coordinate system and has axis.
  3080. * By default use coordSys.getBaseAxis();
  3081. * Can be overridden for some chart.
  3082. * @return {type} description
  3083. */
  3084. e.prototype.getBaseAxis=function(){var t=this.coordinateSystem;
  3085. // @ts-ignore
  3086. return t&&t.getBaseAxis&&t.getBaseAxis()},
  3087. /**
  3088. * Default tooltip formatter
  3089. *
  3090. * @param dataIndex
  3091. * @param multipleSeries
  3092. * @param dataType
  3093. * @param renderMode valid values: 'html'(by default) and 'richText'.
  3094. * 'html' is used for rendering tooltip in extra DOM form, and the result
  3095. * string is used as DOM HTML content.
  3096. * 'richText' is used for rendering tooltip in rich text form, for those where
  3097. * DOM operation is not supported.
  3098. * @return formatted tooltip with `html` and `markers`
  3099. * Notice: The override method can also return string
  3100. */
  3101. e.prototype.formatTooltip=function(t,e,n){return cu({series:this,dataIndex:t,multipleSeries:e})},e.prototype.isAnimationEnabled=function(){var t=this.ecModel;
  3102. // Disable animation if using echarts in node but not give ssr flag.
  3103. // In ssr mode, renderToString will generate svg with css animation.
  3104. if(d.node&&(!t||!t.ssr))return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),!!e},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel,o=es.prototype.getColorFromPalette.call(this,t,e,n);
  3105. // PENDING
  3106. return o||(o=i.getColorFromPalette(t,e,n)),o},
  3107. /**
  3108. * Use `data.mapDimensionsAll(coordDim)` instead.
  3109. * @deprecated
  3110. */
  3111. e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},
  3112. /**
  3113. * Get progressive rendering count each step
  3114. */
  3115. e.prototype.getProgressive=function(){return this.get("progressive")},
  3116. /**
  3117. * Get progressive rendering count each step
  3118. */
  3119. e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},
  3120. // PENGING If selectedMode is null ?
  3121. e.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},e.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,o=this.getData(e);if("series"===i||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var r=0;r<t.length;r++){var a=hu(o,t[r]);n[a]=!1,this._selectedDataIndicesMap[a]=-1}}},e.prototype.toggleSelect=function(t,e){for(var n=[],i=0;i<t.length;i++)n[0]=t[i],this.isSelected(t[i],e)?this.unselect(n,e):this.select(n,e)},e.prototype.getSelectedDataIndices=function(){if("all"===this.option.selectedMap)return[].slice.call(this.getData().getIndices());for(var t=this._selectedDataIndicesMap,e=v(t),n=[],i=0;i<e.length;i++){var o=t[e[i]];o>=0&&n.push(o)}return n},e.prototype.isSelected=function(t,e){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(e);return("all"===n||n[hu(i,t)])&&!i.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[pu])return!0;var t=this.option.universalTransition;
  3122. // Quick reject
  3123. return!!t&&(!0===t||t&&t.enabled)},e.prototype._innerSelect=function(t,e){var n,i,r=this.option,a=r.selectedMode,s=e.length;if(a&&s)if("series"===a)r.selectedMap="all";else if("multiple"===a){o(r.selectedMap)||(r.selectedMap={});for(var l=r.selectedMap,u=0;u<s;u++){var c=e[u];
  3124. // TODO different types of data share same object.
  3125. l[h=hu(t,c)]=!0,this._selectedDataIndicesMap[h]=t.getRawIndex(c)}}else if("single"===a||!0===a){var d=e[s-1],h=hu(t,d);r.selectedMap=((n={})[h]=!0,n),this._selectedDataIndicesMap=((i={})[h]=t.getRawIndex(d),i)}},e.prototype._initSelectedMapFromData=function(t){
  3126. // Ignore select info in data if selectedMap exists.
  3127. // NOTE It's only for legacy usage. edge data is not supported.
  3128. if(!this.option.selectedMap){var e=[];t.hasItemOption&&t.each((function(n){var i=t.getRawDataItem(n);i&&i.selected&&e.push(n)})),e.length>0&&this._innerSelect(t,e)}},
  3129. // /**
  3130. // * @see {module:echarts/stream/Scheduler}
  3131. // */
  3132. // abstract pipeTask: null
  3133. e.registerClass=function(t){return Ta.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",
  3134. // Make sure the values can be accessed!
  3135. t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(Ta);
  3136. /**
  3137. * MUST be called after `prepareSource` called
  3138. * Here we need to make auto series, especially for auto legend. But we
  3139. * do not modify series.name in option to avoid side effects.
  3140. */
  3141. function gu(t){
  3142. // User specified name has higher priority, otherwise it may cause
  3143. // series can not be queried unexpectedly.
  3144. var e=t.name;kn(t)||(t.name=function(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),i=[];return a(n,(function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)})),i.join(" ")}(t)||e)}function yu(t){return t.model.getRawData().count()}function mu(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),vu}function vu(t,e){
  3145. // Avoid repeat cloneShallow when data just created in reset.
  3146. e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}
  3147. // TODO refactor
  3148. function xu(t,e){a(ct(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),(function(n){t.wrapMethod(n,rt(_u,e))}))}function _u(t,e){var n=bu(t);return n&&
  3149. // Consider case: filter, selectRange
  3150. n.setOutputEnd((e||this).count()),e}function bu(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){
  3151. // When pipline finished, the currrentTask keep the last
  3152. // task (renderTask).
  3153. var i=n.currentTask;if(i){var o=i.agentStubMap;o&&(i=o.get(t.uid))}return i}}nt(fu,hl),nt(fu,es),jn(fu,Ta);const Su=fu;var wu=/** @class */function(){function t(){this.group=new Z,this.uid=vr("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){
  3154. // Do nothing;
  3155. },t.prototype.updateLayout=function(t,e,n,i){
  3156. // Do nothing;
  3157. },t.prototype.updateVisual=function(t,e,n,i){
  3158. // Do nothing;
  3159. },
  3160. /**
  3161. * Hook for toggle blur target series.
  3162. * Can be used in marker for blur or leave blur the markers
  3163. */
  3164. t.prototype.toggleBlurSeries=function(t,e,n){
  3165. // Do nothing;
  3166. },
  3167. /**
  3168. * Traverse the new rendered elements.
  3169. *
  3170. * It will traverse the new added element in progressive rendering.
  3171. * And traverse all in normal rendering.
  3172. */
  3173. t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();Xn(wu),$n(wu);const Mu=wu;
  3174. /**
  3175. * @return {string} If large mode changed, return string 'reset';
  3176. */function Iu(){var t=On();return function(e){var n=t(e),i=e.pipelineContext,o=!!n.large,r=!!n.progressiveRender,a=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(o===a&&r===s)&&"reset"}}var Du=On(),Tu=Iu(),Cu=/** @class */function(){function t(){this.group=new Z,this.uid=vr("viewChart"),this.renderTask=fl({plan:ku,reset:Pu}),this.renderTask.context={view:this}}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},
  3177. /**
  3178. * Highlight series or specified data item.
  3179. */
  3180. t.prototype.highlight=function(t,e,n,i){var o=t.getData(i&&i.dataType);o&&Lu(o,i,"emphasis")},
  3181. /**
  3182. * Downplay series or specified data item.
  3183. */
  3184. t.prototype.downplay=function(t,e,n,i){var o=t.getData(i&&i.dataType);o&&Lu(o,i,"normal")},
  3185. /**
  3186. * Remove self.
  3187. */
  3188. t.prototype.remove=function(t,e){this.group.removeAll()},
  3189. /**
  3190. * Dispose self.
  3191. */
  3192. t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){this.render(t,e,n,i)},
  3193. // FIXME never used?
  3194. t.prototype.updateLayout=function(t,e,n,i){this.render(t,e,n,i)},
  3195. // FIXME never used?
  3196. t.prototype.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},
  3197. /**
  3198. * Traverse the new rendered elements.
  3199. *
  3200. * It will traverse the new added element in progressive rendering.
  3201. * And traverse all in normal rendering.
  3202. */
  3203. t.prototype.eachRendered=function(t){Bo(this.group,t)},t.markUpdateMethod=function(t,e){Du(t).updateMethod=e},t.protoInitialize=void(t.prototype.type="chart"),t}();
  3204. /**
  3205. * Set state of single element
  3206. */
  3207. function Au(t,e,n){t&&Ji(t)&&("emphasis"===e?ki:Pi)(t,n)}function Lu(t,e,n){var i=Nn(t,e),o=e&&null!=e.highlightKey?
  3208. /**
  3209. * Support highlight/downplay record on each elements.
  3210. * For the case: hover highlight/downplay (legend, visualMap, ...) and
  3211. * user triggered highlight/downplay should not conflict.
  3212. * Only all of the highlightDigit cleared, return to normal.
  3213. * @param {string} highlightKey
  3214. * @return {number} highlightDigit
  3215. */
  3216. function(t){var e=ri[t];return null==e&&oi<=32&&(e=ri[t]=oi++),e}(e.highlightKey):null;null!=i?a(Sn(i),(function(e){Au(t.getItemGraphicEl(e),n,o)})):t.eachItemGraphicEl((function(t){Au(t,n,o)}))}function ku(t){return Tu(t.model)}function Pu(t){var e=t.model,n=t.ecModel,i=t.api,o=t.payload,r=e.pipelineContext.progressiveRender,a=t.view,s=o&&Du(o).updateMethod,l=r?"incrementalPrepareRender":s&&a[s]?s:"render";return"render"!==l&&a[l](e,n,i,o),Nu[l]}Xn(Cu),$n(Cu);var Nu={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{
  3217. // Put view.render in `progress` to support appendData. But in this case
  3218. // view.render should not be called in reset, otherwise it will be called
  3219. // twise. Use `forceFirstProgress` to make sure that view.render is called
  3220. // in any cases.
  3221. forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};const Ou=Cu;
  3222. /*
  3223. * Licensed to the Apache Software Foundation (ASF) under one
  3224. * or more contributor license agreements. See the NOTICE file
  3225. * distributed with this work for additional information
  3226. * regarding copyright ownership. The ASF licenses this file
  3227. * to you under the Apache License, Version 2.0 (the
  3228. * "License"); you may not use this file except in compliance
  3229. * with the License. You may obtain a copy of the License at
  3230. *
  3231. * http://www.apache.org/licenses/LICENSE-2.0
  3232. *
  3233. * Unless required by applicable law or agreed to in writing,
  3234. * software distributed under the License is distributed on an
  3235. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  3236. * KIND, either express or implied. See the License for the
  3237. * specific language governing permissions and limitations
  3238. * under the License.
  3239. */
  3240. /**
  3241. * AUTO-GENERATED FILE. DO NOT MODIFY.
  3242. */
  3243. /*
  3244. * Licensed to the Apache Software Foundation (ASF) under one
  3245. * or more contributor license agreements. See the NOTICE file
  3246. * distributed with this work for additional information
  3247. * regarding copyright ownership. The ASF licenses this file
  3248. * to you under the Apache License, Version 2.0 (the
  3249. * "License"); you may not use this file except in compliance
  3250. * with the License. You may obtain a copy of the License at
  3251. *
  3252. * http://www.apache.org/licenses/LICENSE-2.0
  3253. *
  3254. * Unless required by applicable law or agreed to in writing,
  3255. * software distributed under the License is distributed on an
  3256. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  3257. * KIND, either express or implied. See the License for the
  3258. * specific language governing permissions and limitations
  3259. * under the License.
  3260. */var Ru="\0__throttleOriginMethod",Eu="\0__throttleRate",Vu="\0__throttleType";
  3261. /**
  3262. * @public
  3263. * @param {(Function)} fn
  3264. * @param {number} [delay=0] Unit: ms.
  3265. * @param {boolean} [debounce=false]
  3266. * true: If call interval less than `delay`, only the last call works.
  3267. * false: If call interval less than `delay, call works on fixed rate.
  3268. * @return {(Function)} throttled fn.
  3269. */
  3270. function zu(t,e,n){var i,o,r,a,s,l=0,u=0,c=null;function d(){u=(new Date).getTime(),c=null,t.apply(r,a||[])}e=e||0;var h=function(){for(var t=[],h=0;h<arguments.length;h++)t[h]=arguments[h];i=(new Date).getTime(),r=this,a=t;var p=s||e,f=s||n;s=null,o=i-(f?l:u)-p,clearTimeout(c),
  3271. // Here we should make sure that: the `exec` SHOULD NOT be called later
  3272. // than a new call of `cb`, that is, preserving the command order. Consider
  3273. // calculating "scale rate" when roaming as an example. When a call of `cb`
  3274. // happens, either the `exec` is called dierectly, or the call is delayed.
  3275. // But the delayed call should never be later than next call of `cb`. Under
  3276. // this assurance, we can simply update view state each time `dispatchAction`
  3277. // triggered by user roaming, but not need to add extra code to avoid the
  3278. // state being "rolled-back".
  3279. f?c=setTimeout(d,p):o>=0?d():c=setTimeout(d,-o),l=i};
  3280. /**
  3281. * Clear throttle.
  3282. * @public
  3283. */return h.clear=function(){c&&(clearTimeout(c),c=null)},
  3284. /**
  3285. * Enable debounce once.
  3286. */
  3287. h.debounceNextCall=function(t){s=t},h}
  3288. /**
  3289. * Create throttle method or update throttle rate.
  3290. *
  3291. * @example
  3292. * ComponentView.prototype.render = function () {
  3293. * ...
  3294. * throttle.createOrUpdate(
  3295. * this,
  3296. * '_dispatchAction',
  3297. * this.model.get('throttle'),
  3298. * 'fixRate'
  3299. * );
  3300. * };
  3301. * ComponentView.prototype.remove = function () {
  3302. * throttle.clear(this, '_dispatchAction');
  3303. * };
  3304. * ComponentView.prototype.dispose = function () {
  3305. * throttle.clear(this, '_dispatchAction');
  3306. * };
  3307. *
  3308. */function Bu(t,e,n,i){var o=t[e];if(o){var r=o[Ru]||o,a=o[Vu];if(o[Eu]!==n||a!==i){if(null==n||!i)return t[e]=r;(o=t[e]=zu(r,n,"debounce"===i))[Ru]=r,o[Vu]=i,o[Eu]=n}return o}}
  3309. /**
  3310. * Clear throttle. Example see throttle.createOrUpdate.
  3311. */function Gu(t,e){var n=t[e];n&&n[Ru]&&(
  3312. // Clear throttle
  3313. n.clear&&n.clear(),t[e]=n[Ru])}var Fu=On(),Wu={itemStyle:Qn(hr,!0),lineStyle:Qn(ur,!0)},Hu={lineStyle:"stroke",itemStyle:"fill"};function Yu(t,e){var n=t.visualStyleMapper||Wu[e];return n||Wu.itemStyle}function Uu(t,e){
  3314. // return defaultColorKey[stylePath] ||
  3315. var n=t.visualDrawType||Hu[e];return n||"fill"}var Zu={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",o=t.getModel(i),r=Yu(t,i)(o),a=o.getShallow("decal");a&&(n.setVisual("decal",a),a.dirty=!0);
  3316. // TODO
  3317. var s=Uu(t,i),l=r[s],u=f(l)?l:null,c="auto"===r.fill||"auto"===r.stroke;
  3318. // Get from color palette by default.
  3319. if(!r[s]||u||c){
  3320. // Note: If some series has color specified (e.g., by itemStyle.color), we DO NOT
  3321. // make it effect palette. Because some scenarios users need to make some series
  3322. // transparent or as background, which should better not effect the palette.
  3323. var d=t.getColorFromPalette(
  3324. // TODO series count changed.
  3325. t.name,null,e.getSeriesCount());r[s]||(r[s]=d,n.setVisual("colorFromPalette",!0)),r.fill="auto"===r.fill||f(r.fill)?d:r.fill,r.stroke="auto"===r.stroke||f(r.stroke)?d:r.stroke}
  3326. // Only visible series has each data be visual encoded
  3327. if(n.setVisual("style",r),n.setVisual("drawType",s),!e.isSeriesFiltered(t)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(e,n){var i=t.getDataParams(n),o=p({},r);o[s]=u(i),e.setItemVisual(n,"style",o)}}}},Xu=new yr,ju={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData&&!e.isSeriesFiltered(t)){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",o=Yu(t,i),r=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(t,e){
  3328. // Not use getItemModel for performance considuration
  3329. var n=t.getRawDataItem(e);if(n&&n[i]){Xu.option=n[i];var a=o(Xu),s=t.ensureUniqueItemVisual(e,"style");p(s,a),Xu.option.decal&&(t.setItemVisual(e,"decal",Xu.option.decal),Xu.option.decal.dirty=!0),r in a&&t.setItemVisual(e,"colorFromPalette",!1)}}:null}}}},qu={performRawSeries:!0,overallReset:function(t){
  3330. // Each type of series uses one scope.
  3331. // Pie and funnel are using different scopes.
  3332. var e=r();t.eachSeries((function(t){var n=t.getColorBy();if(!t.isColorBySeries()){var i=t.type+"-"+n,o=e.get(i);o||(o={},e.set(i,o)),Fu(t).scope=o}})),t.eachSeries((function(e){if(!e.isColorBySeries()&&!t.isSeriesFiltered(e)){var n=e.getRawData(),i={},o=e.getData(),r=Fu(e).scope,a=e.visualStyleAccessPath||"itemStyle",s=Uu(e,a);o.each((function(t){var e=o.getRawIndex(t);i[e]=t})),
  3333. // Iterate on data before filtered. To make sure color from palette can be
  3334. // Consistent when toggling legend.
  3335. n.each((function(t){var a=i[t];
  3336. // Get color from palette for each data only when the color is inherited from series color, which is
  3337. // also picked from color palette. So following situation is not in the case:
  3338. // 1. series.itemStyle.color is set
  3339. // 2. color is encoded by visualMap
  3340. if(o.getItemVisual(a,"colorFromPalette")){var l=o.ensureUniqueItemVisual(a,"style"),u=n.getName(t)||t+"",c=n.count();l[s]=e.getColorFromPalette(u,r,c)}}))}}))}},Ku=Math.PI;var Ju=/** @class */function(){function t(t,e,n,i){
  3341. // key: handlerUID
  3342. this._stageTaskMap=r(),this.ecInstance=t,this.api=e,
  3343. // Fix current processors in case that in some rear cases that
  3344. // processors might be registered after echarts instance created.
  3345. // Register processors incrementally for a echarts instance is
  3346. // not supported by this stream architecture.
  3347. n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return t.prototype.restoreData=function(t,e){
  3348. // TODO: Only restore needed series and components, but not all components.
  3349. // Currently `restoreData` of all of the series and component will be called.
  3350. // But some independent components like `title`, `legend`, `graphic`, `toolbox`,
  3351. // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`,
  3352. // and some components like coordinate system, axes, dataZoom, visualMap only
  3353. // need their target series refresh.
  3354. // (1) If we are implementing this feature some day, we should consider these cases:
  3355. // if a data processor depends on a component (e.g., dataZoomProcessor depends
  3356. // on the settings of `dataZoom`), it should be re-performed if the component
  3357. // is modified by `setOption`.
  3358. // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`,
  3359. // it should be re-performed when the result array of `getTargetSeries` changed.
  3360. // We use `dependencies` to cover these issues.
  3361. // (3) How to update target series when coordinate system related components modified.
  3362. // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty,
  3363. // and this case all of the tasks will be set as dirty.
  3364. t.restoreData(e),
  3365. // Theoretically an overall task not only depends on each of its target series, but also
  3366. // depends on all of the series.
  3367. // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks
  3368. // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure
  3369. // that the overall task is set as dirty and to be performed, otherwise it probably cause
  3370. // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it
  3371. // probably cause state chaos (consider `dataZoomProcessor`).
  3372. this._stageTaskMap.each((function(t){var e=t.overallTask;e&&e.dirty()}))},
  3373. // If seriesModel provided, incremental threshold is check by series data.
  3374. t.prototype.getPerformArgs=function(t,e){
  3375. // For overall task
  3376. if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,o=!e&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex?n.step:null,r=i&&i.modDataCount;return{step:o,modBy:null!=r?Math.ceil(r/o):null,modDataCount:r}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},
  3377. /**
  3378. * Current, progressive rendering starts from visual and layout.
  3379. * Always detect render mode in the same stage, avoiding that incorrect
  3380. * detection caused by data filtering.
  3381. * Caution:
  3382. * `updateStreamModes` use `seriesModel.getData()`.
  3383. */
  3384. t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),o=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,r=t.get("large")&&i>=t.get("largeThreshold"),a="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:a,large:r}},t.prototype.restorePipelines=function(t){var e=this,n=e._pipelineMap=r();t.eachSeries((function(t){var i=t.getProgressive(),o=t.uid;n.set(o,{id:o,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),e._pipe(t,t.dataTask)}))},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;a(this._allHandlers,(function(i){var o=t.get(i.uid)||t.set(i.uid,{});s(!(i.reset&&i.overallReset),""),i.reset&&this._createSeriesStageTask(i,o,e,n),i.overallReset&&this._createOverallStageTask(i,o,e,n)}),this)},t.prototype.prepareView=function(t,e,n,i){var o=t.renderTask,r=o.context;r.model=e,r.ecModel=n,r.api=i,o.__block=!t.incrementalPrepareRender,this._pipe(e,o)},t.prototype.performDataProcessorTasks=function(t,e){
  3385. // If we do not use `block` here, it should be considered when to update modes.
  3386. this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,i){i=i||{};var o=!1,r=this;function s(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}a(t,(function(t,a){if(!i.visualType||i.visualType===t.visualType){var l=r._stageTaskMap.get(t.uid),u=l.seriesTaskMap,c=l.overallTask;if(c){var d,h=c.agentStubMap;h.each((function(t){s(i,t)&&(t.dirty(),d=!0)})),d&&c.dirty(),r.updatePayload(c,n);var p=r.getPerformArgs(c,i.block);
  3387. // Execute stubs firstly, which may set the overall task dirty,
  3388. // then execute the overall task. And stub will call seriesModel.setData,
  3389. // which ensures that in the overallTask seriesModel.getData() will not
  3390. // return incorrect data.
  3391. h.each((function(t){t.perform(p)})),c.perform(p)&&(o=!0)}else u&&u.each((function(a,l){s(i,a)&&a.dirty();var u=r.getPerformArgs(a,i.block);
  3392. // FIXME
  3393. // if intending to declare `performRawSeries` in handlers, only
  3394. // stream-independent (specifically, data item independent) operations can be
  3395. // performed. Because if a series is filtered, most of the tasks will not
  3396. // be performed. A stream-dependent operation probably cause wrong biz logic.
  3397. // Perhaps we should not provide a separate callback for this case instead
  3398. // of providing the config `performRawSeries`. The stream-dependent operations
  3399. // and stream-independent operations should better not be mixed.
  3400. u.skip=!t.performRawSeries&&e.isSeriesFiltered(a.context.model),r.updatePayload(a,n),a.perform(u)&&(o=!0)}))}})),this.unfinished=o||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries((function(t){
  3401. // Progress to the end for dataInit and dataRestore.
  3402. e=t.dataTask.perform()||e})),this.unfinished=e||this.unfinished},t.prototype.plan=function(){
  3403. // Travel pipelines, check block.
  3404. this._pipelineMap.each((function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)}))},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,i){var o=this,a=e.seriesTaskMap,s=e.seriesTaskMap=r(),l=t.seriesType,u=t.getTargetSeries;function c(e){var r=e.uid,l=s.set(r,a&&a.get(r)||fl({plan:nc,reset:ic,count:ac}));
  3405. // Init tasks for each seriesModel only once.
  3406. // Reuse original task instance.
  3407. l.context={model:e,ecModel:n,api:i,
  3408. // PENDING: `useClearVisual` not used?
  3409. useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:o},o._pipe(e,l)}
  3410. // If a stageHandler should cover all series, `createOnAllSeries` should be declared mandatorily,
  3411. // to avoid some typo or abuse. Otherwise if an extension do not specify a `seriesType`,
  3412. // it works but it may cause other irrelevant charts blocked.
  3413. t.createOnAllSeries?n.eachRawSeries(c):l?n.eachRawSeriesByType(l,c):u&&u(n,i).each(c)},t.prototype._createOverallStageTask=function(t,e,n,i){var o=this,l=e.overallTask=e.overallTask||fl({reset:$u});l.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:o};var u=l.agentStubMap,c=l.agentStubMap=r(),d=t.seriesType,h=t.getTargetSeries,p=!0,f=!1;
  3414. // The count of stages are totally about only several dozen, so
  3415. // do not need to reuse the map.
  3416. function g(t){var e=t.uid,n=c.set(e,u&&u.get(e)||(
  3417. // When the result of `getTargetSeries` changed, the overallTask
  3418. // should be set as dirty and re-performed.
  3419. f=!0,fl({reset:Qu,onDirty:ec})));n.context={model:t,overallProgress:p},n.agent=l,n.__block=p,o._pipe(t,n)}s(!t.createOnAllSeries,""),d?n.eachRawSeriesByType(d,g):h?h(n,i).each(g):(p=!1,a(n.getSeries(),g)),f&&l.dirty()},t.prototype._pipe=function(t,e){var n=t.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=e),i.tail&&i.tail.pipe(e),i.tail=e,e.__idxInPipeline=i.count++,e.__pipeline=i},t.wrapStageHandler=function(t,e){return f(t)&&(t={overallReset:t,seriesType:sc(t)}),t.uid=vr("stageHandler"),e&&(t.visualType=e),t},t}();function $u(t){t.overallReset(t.ecModel,t.api,t.payload)}function Qu(t){return t.overallProgress&&tc}function tc(){this.agent.dirty(),this.getDownstream().dirty()}function ec(){this.agent&&this.agent.dirty()}function nc(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function ic(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=Sn(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?n(e,(function(t,e){return rc(e)})):oc}var oc=rc(0);function rc(t){return function(e,n){var i=n.data,o=n.resetDefines[t];if(o&&o.dataEach)for(var r=e.start;r<e.end;r++)o.dataEach(i,r);else o&&o.progress&&o.progress(e,i)}}function ac(t){return t.data.count()}
  3420. /**
  3421. * Only some legacy stage handlers (usually in echarts extensions) are pure function.
  3422. * To ensure that they can work normally, they should work in block mode, that is,
  3423. * they should not be started util the previous tasks finished. So they cause the
  3424. * progressive rendering disabled. We try to detect the series type, to narrow down
  3425. * the block range to only the series type they concern, but not all series.
  3426. */function sc(t){lc=null;try{
  3427. // Assume there is no async when calling `eachSeriesByType`.
  3428. t(uc,cc)}catch(e){}return lc}var lc,uc={},cc={};function dc(t,e){
  3429. /* eslint-disable */
  3430. for(var n in e.prototype)
  3431. // Do not use hasOwnProperty
  3432. t[n]=dt;
  3433. /* eslint-enable */}dc(uc,us),dc(cc,ds),uc.eachSeriesByType=uc.eachRawSeriesByType=function(t){lc=t},uc.eachComponent=function(t){"series"===t.mainType&&t.subType&&(lc=t.subType)};const hc=Ju;
  3434. /*
  3435. * Licensed to the Apache Software Foundation (ASF) under one
  3436. * or more contributor license agreements. See the NOTICE file
  3437. * distributed with this work for additional information
  3438. * regarding copyright ownership. The ASF licenses this file
  3439. * to you under the Apache License, Version 2.0 (the
  3440. * "License"); you may not use this file except in compliance
  3441. * with the License. You may obtain a copy of the License at
  3442. *
  3443. * http://www.apache.org/licenses/LICENSE-2.0
  3444. *
  3445. * Unless required by applicable law or agreed to in writing,
  3446. * software distributed under the License is distributed on an
  3447. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  3448. * KIND, either express or implied. See the License for the
  3449. * specific language governing permissions and limitations
  3450. * under the License.
  3451. */
  3452. /**
  3453. * AUTO-GENERATED FILE. DO NOT MODIFY.
  3454. */
  3455. /*
  3456. * Licensed to the Apache Software Foundation (ASF) under one
  3457. * or more contributor license agreements. See the NOTICE file
  3458. * distributed with this work for additional information
  3459. * regarding copyright ownership. The ASF licenses this file
  3460. * to you under the Apache License, Version 2.0 (the
  3461. * "License"); you may not use this file except in compliance
  3462. * with the License. You may obtain a copy of the License at
  3463. *
  3464. * http://www.apache.org/licenses/LICENSE-2.0
  3465. *
  3466. * Unless required by applicable law or agreed to in writing,
  3467. * software distributed under the License is distributed on an
  3468. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  3469. * KIND, either express or implied. See the License for the
  3470. * specific language governing permissions and limitations
  3471. * under the License.
  3472. */var pc=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"];const fc={color:pc,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],pc]};
  3473. /*
  3474. * Licensed to the Apache Software Foundation (ASF) under one
  3475. * or more contributor license agreements. See the NOTICE file
  3476. * distributed with this work for additional information
  3477. * regarding copyright ownership. The ASF licenses this file
  3478. * to you under the Apache License, Version 2.0 (the
  3479. * "License"); you may not use this file except in compliance
  3480. * with the License. You may obtain a copy of the License at
  3481. *
  3482. * http://www.apache.org/licenses/LICENSE-2.0
  3483. *
  3484. * Unless required by applicable law or agreed to in writing,
  3485. * software distributed under the License is distributed on an
  3486. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  3487. * KIND, either express or implied. See the License for the
  3488. * specific language governing permissions and limitations
  3489. * under the License.
  3490. */
  3491. /**
  3492. * AUTO-GENERATED FILE. DO NOT MODIFY.
  3493. */
  3494. /*
  3495. * Licensed to the Apache Software Foundation (ASF) under one
  3496. * or more contributor license agreements. See the NOTICE file
  3497. * distributed with this work for additional information
  3498. * regarding copyright ownership. The ASF licenses this file
  3499. * to you under the Apache License, Version 2.0 (the
  3500. * "License"); you may not use this file except in compliance
  3501. * with the License. You may obtain a copy of the License at
  3502. *
  3503. * http://www.apache.org/licenses/LICENSE-2.0
  3504. *
  3505. * Unless required by applicable law or agreed to in writing,
  3506. * software distributed under the License is distributed on an
  3507. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  3508. * KIND, either express or implied. See the License for the
  3509. * specific language governing permissions and limitations
  3510. * under the License.
  3511. */var gc="#B9B8CE",yc="#100C2A",mc=function(){return{axisLine:{lineStyle:{color:gc}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},vc=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],xc={darkMode:!0,color:vc,backgroundColor:yc,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{
  3512. // TODO Contrast of label backgorundColor
  3513. color:"#fff"}},legend:{textStyle:{color:gc},pageTextStyle:{color:gc}},textStyle:{color:gc},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:gc}},dataZoom:{borderColor:"#71708A",textStyle:{color:gc},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:gc}},timeline:{lineStyle:{color:gc},label:{color:gc},controlStyle:{color:gc,borderColor:gc}},calendar:{itemStyle:{color:yc},dayLabel:{color:gc},monthLabel:{color:gc},yearLabel:{color:gc}},timeAxis:mc(),logAxis:mc(),valueAxis:mc(),categoryAxis:mc(),line:{symbol:"circle"},graph:{color:vc},gauge:{title:{color:gc},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:gc},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};xc.categoryAxis.splitLine.show=!1;const _c=xc;
  3514. /**
  3515. * Usage of query:
  3516. * `chart.on('click', query, handler);`
  3517. * The `query` can be:
  3518. * + The component type query string, only `mainType` or `mainType.subType`,
  3519. * like: 'xAxis', 'series', 'xAxis.category' or 'series.line'.
  3520. * + The component query object, like:
  3521. * `{seriesIndex: 2}`, `{seriesName: 'xx'}`, `{seriesId: 'some'}`,
  3522. * `{xAxisIndex: 2}`, `{xAxisName: 'xx'}`, `{xAxisId: 'some'}`.
  3523. * + The data query object, like:
  3524. * `{dataIndex: 123}`, `{dataType: 'link'}`, `{name: 'some'}`.
  3525. * + The other query object (cmponent customized query), like:
  3526. * `{element: 'some'}` (only available in custom series).
  3527. *
  3528. * Caveat: If a prop in the `query` object is `null/undefined`, it is the
  3529. * same as there is no such prop in the `query` object.
  3530. */var bc=/** @class */function(){function e(){}return e.prototype.normalizeQuery=function(e){var n={},i={},o={};
  3531. // `query` is `mainType` or `mainType.subType` of component.
  3532. if(t(e)){var r=Zn(e);
  3533. // `.main` and `.sub` may be ''.
  3534. n.mainType=r.main||null,n.subType=r.sub||null}
  3535. // `query` is an object, convert to {mainType, index, name, id}.
  3536. else{
  3537. // `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved,
  3538. // can not be used in `compomentModel.filterForExposedEvent`.
  3539. var s=["Index","Name","Id"],l={name:1,dataIndex:1,dataType:1};a(e,(function(t,e){for(var r=!1,a=0;a<s.length;a++){var u=s[a],c=e.lastIndexOf(u);if(c>0&&c===e.length-u.length){var d=e.slice(0,c);
  3540. // Consider `dataIndex`.
  3541. "data"!==d&&(n.mainType=d,n[u.toLowerCase()]=t,r=!0)}}l.hasOwnProperty(e)&&(i[e]=t,r=!0),r||(o[e]=t)}))}return{cptQuery:n,dataQuery:i,otherQuery:o}},e.prototype.filter=function(t,e){
  3542. // They should be assigned before each trigger call.
  3543. var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,o=n.packedEvent,r=n.model,a=n.view;
  3544. // For event like 'globalout'.
  3545. if(!r||!a)return!0;var s=e.cptQuery,l=e.dataQuery;return u(s,r,"mainType")&&u(s,r,"subType")&&u(s,r,"index","componentIndex")&&u(s,r,"name")&&u(s,r,"id")&&u(l,o,"name")&&u(l,o,"dataIndex")&&u(l,o,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(t,e.otherQuery,i,o));function u(t,e,n,i){return null==t[n]||e[i||n]===t[n]}},e.prototype.afterTrigger=function(){
  3546. // Make sure the eventInfo won't be used in next trigger.
  3547. this.eventInfo=null},e}(),Sc=["symbol","symbolSize","symbolRotate","symbolOffset"],wc=Sc.concat(["symbolKeepAspect"]),Mc={createOnAllSeries:!0,
  3548. // For legend.
  3549. performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var i={},o={},r=!1,a=0;a<Sc.length;a++){var s=Sc[a],l=t.get(s);f(l)?(r=!0,o[s]=l):i[s]=l}
  3550. // Only visible series has each data be visual encoded
  3551. if(i.symbol=i.symbol||t.defaultSymbol,n.setVisual(p({legendIcon:t.legendIcon||i.symbol,symbolKeepAspect:t.get("symbolKeepAspect")},i)),!e.isSeriesFiltered(t)){var u=v(o);return{dataEach:r?function(e,n){for(var i=t.getRawValue(n),r=t.getDataParams(n),a=0;a<u.length;a++){var s=u[a];e.setItemVisual(n,s,o[s](i,r))}}:null}}}}},Ic={createOnAllSeries:!0,
  3552. // For legend.
  3553. performRawSeries:!0,reset:function(t,e){if(t.hasSymbolVisual&&!e.isSeriesFiltered(t))return{dataEach:t.getData().hasItemOption?function(t,e){for(var n=t.getItemModel(e),i=0;i<wc.length;i++){var o=wc[i],r=n.getShallow(o,!0);null!=r&&t.setItemVisual(e,o,r)}}:null};
  3554. // Only visible series has each data be visual encoded
  3555. }};
  3556. /*
  3557. * Licensed to the Apache Software Foundation (ASF) under one
  3558. * or more contributor license agreements. See the NOTICE file
  3559. * distributed with this work for additional information
  3560. * regarding copyright ownership. The ASF licenses this file
  3561. * to you under the Apache License, Version 2.0 (the
  3562. * "License"); you may not use this file except in compliance
  3563. * with the License. You may obtain a copy of the License at
  3564. *
  3565. * http://www.apache.org/licenses/LICENSE-2.0
  3566. *
  3567. * Unless required by applicable law or agreed to in writing,
  3568. * software distributed under the License is distributed on an
  3569. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  3570. * KIND, either express or implied. See the License for the
  3571. * specific language governing permissions and limitations
  3572. * under the License.
  3573. */
  3574. /**
  3575. * AUTO-GENERATED FILE. DO NOT MODIFY.
  3576. */
  3577. /*
  3578. * Licensed to the Apache Software Foundation (ASF) under one
  3579. * or more contributor license agreements. See the NOTICE file
  3580. * distributed with this work for additional information
  3581. * regarding copyright ownership. The ASF licenses this file
  3582. * to you under the Apache License, Version 2.0 (the
  3583. * "License"); you may not use this file except in compliance
  3584. * with the License. You may obtain a copy of the License at
  3585. *
  3586. * http://www.apache.org/licenses/LICENSE-2.0
  3587. *
  3588. * Unless required by applicable law or agreed to in writing,
  3589. * software distributed under the License is distributed on an
  3590. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  3591. * KIND, either express or implied. See the License for the
  3592. * specific language governing permissions and limitations
  3593. * under the License.
  3594. */
  3595. function Dc(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n)}}function Tc(t,e){switch(e){case"color":return t.getVisual("style")[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}function Cc(t,e,n,i){switch(n){case"color":t.ensureUniqueItemVisual(e,"style")[t.getVisual("drawType")]=i,
  3596. // Mark the color has been changed, not from palette anymore
  3597. t.setItemVisual(e,"colorFromPalette",!1);break;case"opacity":t.ensureUniqueItemVisual(e,"style").opacity=i;break;case"symbol":case"symbolSize":case"liftZ":t.setItemVisual(e,n,i)}}
  3598. // Legacy data selection action.
  3599. // Includes: pieSelect, pieUnSelect, pieToggleSelect, mapSelect, mapUnSelect, mapToggleSelect
  3600. function Ac(t,e){function n(e,n){var i=[];return e.eachComponent({mainType:"series",subType:t,query:n},(function(t){i.push(t.seriesIndex)})),i}a([[t+"ToggleSelect","toggleSelect"],[t+"Select","select"],[t+"UnSelect","unselect"]],(function(t){e(t[0],(function(e,i,o){e=p({},e),o.dispatchAction(p(e,{type:t[1],seriesIndex:n(i,e)}))}))}))}function Lc(e,n,o,r,a){var s=e+n;o.isSilent(s)||r.eachComponent({mainType:"series",subType:"pie"},(function(e){for(var n=e.seriesIndex,r=e.option.selectedMap,l=a.selected,u=0;u<l.length;u++)if(l[u].seriesIndex===n){var c=e.getData(),d=Nn(c,a.fromActionPayload);o.trigger(s,{type:s,seriesId:e.id,name:i(d)?c.getName(d[0]):c.getName(d),selected:t(r)?r:p({},r)})}}))}
  3601. /*
  3602. * Licensed to the Apache Software Foundation (ASF) under one
  3603. * or more contributor license agreements. See the NOTICE file
  3604. * distributed with this work for additional information
  3605. * regarding copyright ownership. The ASF licenses this file
  3606. * to you under the Apache License, Version 2.0 (the
  3607. * "License"); you may not use this file except in compliance
  3608. * with the License. You may obtain a copy of the License at
  3609. *
  3610. * http://www.apache.org/licenses/LICENSE-2.0
  3611. *
  3612. * Unless required by applicable law or agreed to in writing,
  3613. * software distributed under the License is distributed on an
  3614. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  3615. * KIND, either express or implied. See the License for the
  3616. * specific language governing permissions and limitations
  3617. * under the License.
  3618. */
  3619. /**
  3620. * AUTO-GENERATED FILE. DO NOT MODIFY.
  3621. */
  3622. /*
  3623. * Licensed to the Apache Software Foundation (ASF) under one
  3624. * or more contributor license agreements. See the NOTICE file
  3625. * distributed with this work for additional information
  3626. * regarding copyright ownership. The ASF licenses this file
  3627. * to you under the Apache License, Version 2.0 (the
  3628. * "License"); you may not use this file except in compliance
  3629. * with the License. You may obtain a copy of the License at
  3630. *
  3631. * http://www.apache.org/licenses/LICENSE-2.0
  3632. *
  3633. * Unless required by applicable law or agreed to in writing,
  3634. * software distributed under the License is distributed on an
  3635. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  3636. * KIND, either express or implied. See the License for the
  3637. * specific language governing permissions and limitations
  3638. * under the License.
  3639. */
  3640. function kc(t,e,n){for(var i;t&&(!e(t)||(i=t,!n));)t=t.__hostTarget||t.parent;return i}
  3641. /**
  3642. * Triangle shape
  3643. * @inner
  3644. */var Pc=g.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var n=e.cx,i=e.cy,o=e.width/2,r=e.height/2;t.moveTo(n,i-r),t.lineTo(n+o,i+r),t.lineTo(n-o,i+r),t.closePath()}}),Nc=g.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var n=e.cx,i=e.cy,o=e.width/2,r=e.height/2;t.moveTo(n,i-r),t.lineTo(n+o,i),t.lineTo(n,i+r),t.lineTo(n-o,i),t.closePath()}}),Oc=g.extend({type:"pin",shape:{
  3645. // x, y on the cusp
  3646. x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.x,i=e.y,o=e.width/5*3,r=Math.max(o,e.height),a=o/2,s=a*a/(r-a),l=i-r+a+s,u=Math.asin(s/a),c=Math.cos(u)*a,d=Math.sin(u),h=Math.cos(u),p=.6*a,f=.7*a;t.moveTo(n-c,l+s),t.arc(n,l,a,Math.PI-u,2*Math.PI+u),t.bezierCurveTo(n+c-d*p,l+s+h*p,n,i-f,n,i),t.bezierCurveTo(n,i-f,n-c+d*p,l+s+h*p,n-c,l+s),t.closePath()}}),Rc=g.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.height,i=e.width,o=e.x,r=e.y,a=i/3*2;t.moveTo(o,r),t.lineTo(o+a,r+n),t.lineTo(o,r+n/4*3),t.lineTo(o-a,r+n),t.lineTo(o,r),t.closePath()}}),Ec={line:function(t,e,n,i,o){o.x1=t,o.y1=e+i/2,o.x2=t+n,o.y2=e+i/2},rect:function(t,e,n,i,o){o.x=t,o.y=e,o.width=n,o.height=i},roundRect:function(t,e,n,i,o){o.x=t,o.y=e,o.width=n,o.height=i,o.r=Math.min(n,i)/4},square:function(t,e,n,i,o){var r=Math.min(n,i);o.x=t,o.y=e,o.width=r,o.height=r},circle:function(t,e,n,i,o){
  3647. // Put circle in the center of square
  3648. o.cx=t+n/2,o.cy=e+i/2,o.r=Math.min(n,i)/2},diamond:function(t,e,n,i,o){o.cx=t+n/2,o.cy=e+i/2,o.width=n,o.height=i},pin:function(t,e,n,i,o){o.x=t+n/2,o.y=e+i/2,o.width=n,o.height=i},arrow:function(t,e,n,i,o){o.x=t+n/2,o.y=e+i/2,o.width=n,o.height=i},triangle:function(t,e,n,i,o){o.cx=t+n/2,o.cy=e+i/2,o.width=n,o.height=i}},Vc={};
  3649. /**
  3650. * Diamond shape
  3651. * @inner
  3652. */a({line:F,rect:G,roundRect:G,square:G,circle:O,diamond:Nc,pin:Oc,arrow:Rc,triangle:Pc},(function(t,e){Vc[e]=new t}));var zc=g.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,n){var i=ht(t,e,n),o=this.shape;return o&&"pin"===o.symbolType&&"inside"===e.position&&(i.y=n.y+.4*n.height),i},buildPath:function(t,e,n){var i=e.symbolType;if("none"!==i){var o=Vc[i];o||(o=Vc[
  3653. // Default rect
  3654. i="rect"]),Ec[i](e.x,e.y,e.width,e.height,o.shape),o.buildPath(t,o.shape,n)}}});
  3655. // Provide setColor helper method to avoid determine if set the fill or stroke outside
  3656. function Bc(t,e){if("image"!==this.type){var n=this.style;this.__isEmptyBrush?(n.stroke=t,n.fill=e||"#fff",
  3657. // TODO Same width with lineStyle in LineView
  3658. n.lineWidth=2):"line"===this.shape.symbolType?n.stroke=t:n.fill=t,this.markRedraw()}}
  3659. /**
  3660. * Create a symbol element with given symbol configuration: shape, x, y, width, height, color
  3661. */function Gc(t,e,n,i,o,r,
  3662. // whether to keep the ratio of w/h,
  3663. a){
  3664. // TODO Support image object, DynamicImage.
  3665. var s,l=0===t.indexOf("empty");return l&&(t=t.substr(5,1).toLowerCase()+t.substr(6)),(s=0===t.indexOf("image://")?_o(t.slice(8),new Y(e,n,i,o),a?"center":"cover"):0===t.indexOf("path://")?xo(t.slice(7),{},new Y(e,n,i,o),a?"center":"cover"):new zc({shape:{symbolType:t,x:e,y:n,width:i,height:o}})).__isEmptyBrush=l,
  3666. // TODO Should deprecate setColor
  3667. s.setColor=Bc,r&&s.setColor(r),s}function Fc(t){return i(t)||(t=[+t,+t]),[t[0]||0,t[1]||0]}function Wc(t,e){if(null!=t)return i(t)||(t=[t,t]),[je(t[0],e[0])||0,je(x(t[1],t[0]),e[1])||0]}var Hc=new pt,Yc=new ft(100),Uc=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];
  3668. /**
  3669. * Create or update pattern image from decal options
  3670. *
  3671. * @param {InnerDecalObject | 'none'} decalObject decal options, 'none' if no decal
  3672. * @return {Pattern} pattern with generated image, null if no decal
  3673. */
  3674. function Zc(e,o){if("none"===e)return null;var r=o.getDevicePixelRatio(),a=o.getZr(),s="svg"===a.painter.type;e.dirty&&Hc.delete(e);var u=Hc.get(e);if(u)return u;var c=I(e,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});"none"===c.backgroundColor&&(c.backgroundColor=null);var d={repeat:"repeat"};return function(e){for(var o,u=[r],d=!0,h=0;h<Uc.length;++h){var p=c[Uc[h]];if(null!=p&&!i(p)&&!t(p)&&!l(p)&&"boolean"!=typeof p){d=!1;break}u.push(p)}if(d){o=u.join(",")+(s?"-svg":"");var f=Yc.get(o);f&&(s?e.svgElement=f:e.image=f)}var g,y=jc(c.dashArrayX),m=
  3675. /**
  3676. * Convert dash input into dashArray
  3677. *
  3678. * @param {DecalDashArrayY} dash dash input
  3679. * @return {number[]} normolized dash array
  3680. */
  3681. function(t){if(!t||"object"==typeof t&&0===t.length)return[0,0];if(l(t)){var e=Math.ceil(t);return[e,e]}var i=n(t,(function(t){return Math.ceil(t)}));return t.length%2?i.concat(i):i}
  3682. /**
  3683. * Get block length of each line. A block is the length of dash line and space.
  3684. * For example, a line with [4, 1] has a dash line of 4 and a space of 1 after
  3685. * that, so the block length of this line is 5.
  3686. *
  3687. * @param {number[][]} dash dash array of X or Y
  3688. * @return {number[]} block length of each line
  3689. */(c.dashArrayY),v=Xc(c.symbol),x=(M=y,n(M,(function(t){return qc(t)}))),_=qc(m),b=!s&&gt.createCanvas(),S=s&&{tag:"g",attrs:{},key:"dcl",children:[]},w=
  3690. /**
  3691. * Get minimum length that can make a repeatable pattern.
  3692. *
  3693. * @return {Object} pattern width and height
  3694. */
  3695. function(){for(
  3696. /**
  3697. * For example, if dash is [[3, 2], [2, 1]] for X, it looks like
  3698. * |--- --- --- --- --- ...
  3699. * |-- -- -- -- -- -- -- -- ...
  3700. * |--- --- --- --- --- ...
  3701. * |-- -- -- -- -- -- -- -- ...
  3702. * So the minimum length of X is 15,
  3703. * which is the least common multiple of `3 + 2` and `2 + 1`
  3704. * |--- --- --- |--- --- ...
  3705. * |-- -- -- -- -- |-- -- -- ...
  3706. */
  3707. var t=1,e=0,n=x.length;e<n;++e)t=mn(t,x[e]);var i=1;for(e=0,n=v.length;e<n;++e)i=mn(i,v[e].length);t*=i;var o=_*x.length*v.length;return{width:Math.max(1,Math.min(t,c.maxTileWidth)),height:Math.max(1,Math.min(o,c.maxTileHeight))}}();var M;b&&(b.width=w.width*r,b.height=w.height*r,g=b.getContext("2d"));(function(){g&&(g.clearRect(0,0,b.width,b.height),c.backgroundColor&&(g.fillStyle=c.backgroundColor,g.fillRect(0,0,b.width,b.height)));for(var t=0,e=0;e<m.length;++e)t+=m[e];if(t<=0)
  3708. // dashArrayY is 0, draw nothing
  3709. return;var n=-_,i=0,o=0,l=0;for(;n<w.height;){if(i%2==0){for(var u=o/2%v.length,d=0,h=0,p=0;d<2*w.width;){var f=0;for(e=0;e<y[l].length;++e)f+=y[l][e];if(f<=0)
  3710. // Skip empty line
  3711. break;
  3712. // E.g., [15, 5, 20, 5] draws only for 15 and 20
  3713. if(h%2==0){var x=.5*(1-c.symbolSize),M=d+y[l][h]*x,I=n+m[i]*x,D=y[l][h]*c.symbolSize,T=m[i]*c.symbolSize,C=p/2%v[u].length;A(M,I,D,T,v[u][C])}d+=y[l][h],++p,++h===y[l].length&&(h=0)}++l===y.length&&(l=0)}n+=m[i],++o,++i===m.length&&(i=0)}function A(t,e,n,i,o){var l=s?1:r,u=Gc(o,t*l,e*l,n*l,i*l,c.color,c.symbolKeepAspect);if(s){var d=a.painter.renderOneToVNode(u);d&&S.children.push(d)}else
  3714. // Paint to canvas for all other renderers.
  3715. yt(g,u)}})(),d&&Yc.put(o,b||S);e.image=b,e.svgElement=S,e.svgWidth=w.width,e.svgHeight=w.height}(d),d.rotation=c.rotation,d.scaleX=d.scaleY=s?1:1/r,Hc.set(e,d),e.dirty=!1,d}
  3716. /**
  3717. * Convert symbol array into normalized array
  3718. *
  3719. * @param {string | (string | string[])[]} symbol symbol input
  3720. * @return {string[][]} normolized symbol array
  3721. */function Xc(e){if(!e||0===e.length)return[["rect"]];if(t(e))return[[e]];for(var n=!0,i=0;i<e.length;++i)if(!t(e[i])){n=!1;break}if(n)return Xc([e]);var o=[];for(i=0;i<e.length;++i)t(e[i])?o.push([e[i]]):o.push(e[i]);return o}
  3722. /**
  3723. * Convert dash input into dashArray
  3724. *
  3725. * @param {DecalDashArrayX} dash dash input
  3726. * @return {number[][]} normolized dash array
  3727. */function jc(t){if(!t||0===t.length)return[[0,0]];if(l(t))return[[r=Math.ceil(t),r]];
  3728. /**
  3729. * [20, 5] should be normalized into [[20, 5]],
  3730. * while [20, [5, 10]] should be normalized into [[20, 20], [5, 10]]
  3731. */for(var e=!0,i=0;i<t.length;++i)if(!l(t[i])){e=!1;break}if(e)return jc([t]);var o=[];for(i=0;i<t.length;++i)if(l(t[i])){var r=Math.ceil(t[i]);o.push([r,r])}else{(r=n(t[i],(function(t){return Math.ceil(t)}))).length%2==1?
  3732. // [4, 2, 1] means |---- - -- |---- - -- |
  3733. // so normalize it to be [4, 2, 1, 4, 2, 1]
  3734. o.push(r.concat(r)):o.push(r)}return o}function qc(t){for(var e=0,n=0;n<t.length;++n)e+=t[n];return t.length%2==1?2*e:e}const Kc=new mt;
  3735. // Implementation of exported APIs. For example registerMap, getMap.
  3736. // The implementations will be registered when installing the component.
  3737. // Avoid these code being bundled to the core module.
  3738. var Jc={};
  3739. // TODO Type
  3740. function $c(t){return Jc[t]}var Qc=2e3,td=4500,ed={PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:Qc,CHART:3e3,POST_CHART_LAYOUT:4600,COMPONENT:4e3,BRUSH:5e3,CHART_ITEM:td,ARIA:6e3,DECAL:7e3}},nd="__flagInMainProcess",id="__pendingUpdate",od="__needsUpdateStatus",rd=/^[a-zA-Z0-9_]+$/,ad="__connectUpdateStatus";function sd(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!this.isDisposed())return ud(this,t,e);this.id}}function ld(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return ud(this,t,e)}}function ud(t,e,n){
  3741. // `args[0]` is event name. Event name is all lowercase.
  3742. return n[0]=n[0]&&n[0].toLowerCase(),mt.prototype[e].apply(t,n)}var cd,dd,hd,pd,fd,gd,yd,md,vd,xd,_d,bd,Sd,wd,Md,Id,Dd,Td,Cd=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e}(mt),Ad=Cd.prototype;Ad.on=ld("on"),Ad.off=ld("off");var Ld=/** @class */function(e){function s(n,
  3743. // Theme name or themeOption.
  3744. i,o){var a=e.call(this,new bc)||this;a._chartsViews=[],a._chartsMap={},a._componentsViews=[],a._componentsMap={},
  3745. // Can't dispatch action during rendering procedure
  3746. a._pendingActions=[],o=o||{},
  3747. // Get theme by name
  3748. t(i)&&(i=zd[i]),a._dom=n;o.ssr&&bt((function(t){var e=ni(t),n=e.dataIndex;if(null!=n){var i=r();return i.set("series_index",e.seriesIndex),i.set("data_index",n),e.ssrType&&i.set("ssr_type",e.ssrType),i}}));var s=a._zr=vt(n,{renderer:o.renderer||"canvas",devicePixelRatio:o.devicePixelRatio,width:o.width,height:o.height,ssr:o.ssr,useDirtyRect:x(o.useDirtyRect,!1),useCoarsePointer:x(o.useCoarsePointer,"auto"),pointerSize:o.pointerSize});a._ssr=o.ssr,
  3749. // Expect 60 fps.
  3750. a._throttledZrFlush=zu(lt(s.flush,s),17),(i=et(i))&&zs(i,!0),a._theme=i,a._locale=function(e){if(t(e)){var n=wr[e.toUpperCase()]||{};return e===_r||e===br?et(n):tt(et(n),et(wr[Sr]),!1)}return tt(et(e),et(wr[Sr]),!1)}(o.locale||Ir),a._coordSysMgr=new fs;var l=a._api=Md(a);
  3751. // Sort on demand
  3752. function u(t,e){return t.__prio-e.__prio}return xt(Vd,u),xt(Rd,u),a._scheduler=new hc(a,l,Rd,Vd),a._messageCenter=new Cd,
  3753. // Init mouse events
  3754. a._initEvents(),
  3755. // In case some people write `window.onresize = chart.resize`
  3756. a.resize=lt(a.resize,a),s.animation.on("frame",a._onframe,a),xd(s,a),_d(s,a),
  3757. // ECharts instance can be used as value.
  3758. ut(a),a}return Ue(s,e),s.prototype._onframe=function(){if(!this._disposed){Td(this);var t=this._scheduler;
  3759. // Lazy update
  3760. if(this[id]){var e=this[id].silent;this[nd]=!0;try{cd(this),pd.update.call(this,null,this[id].updateParams)}catch(a){throw this[nd]=!1,this[id]=null,a}
  3761. // At present, in each frame, zrender performs:
  3762. // (1) animation step forward.
  3763. // (2) trigger('frame') (where this `_onframe` is called)
  3764. // (3) zrender flush (render).
  3765. // If we do nothing here, since we use `setToFinal: true`, the step (3) above
  3766. // will render the final state of the elements before the real animation started.
  3767. this._zr.flush(),this[nd]=!1,this[id]=null,md.call(this,e),vd.call(this,e)}
  3768. // Avoid do both lazy update and progress in one frame.
  3769. else if(t.unfinished){
  3770. // Stream progress.
  3771. var n=1,i=this._model,o=this._api;t.unfinished=!1;do{var r=+new Date;t.performSeriesTasks(i),
  3772. // Currently dataProcessorFuncs do not check threshold.
  3773. t.performDataProcessorTasks(i),gd(this,i),
  3774. // Do not update coordinate system here. Because that coord system update in
  3775. // each frame is not a good user experience. So we follow the rule that
  3776. // the extent of the coordinate system is determined in the first frame (the
  3777. // frame is executed immediately after task reset.
  3778. // this._coordSysMgr.update(ecModel, api);
  3779. // console.log('--- ec frame visual ---', remainTime);
  3780. t.performVisualTasks(i),wd(this,this._model,o,"remain",{}),n-=+new Date-r}while(n>0&&t.unfinished);
  3781. // Call flush explicitly for trigger finished event.
  3782. t.unfinished||this._zr.flush();
  3783. // Else, zr flushing be ensue within the same frame,
  3784. // because zr flushing is after onframe event.
  3785. }}},s.prototype.getDom=function(){return this._dom},s.prototype.getId=function(){return this.id},s.prototype.getZr=function(){return this._zr},s.prototype.isSSR=function(){return this._ssr},
  3786. /* eslint-disable-next-line */
  3787. s.prototype.setOption=function(t,e,n){if(!this[nd])if(this._disposed)this.id;else{var i,r,a;if(o(e)&&(n=e.lazyUpdate,i=e.silent,r=e.replaceMerge,a=e.transition,e=e.notMerge),this[nd]=!0,!this._model||e){var s=new vs(this._api),l=this._theme,u=this._model=new us;u.scheduler=this._scheduler,u.ssr=this._ssr,u.init(null,null,null,l,this._locale,s)}this._model.setOption(t,{replaceMerge:r},Ed);var c={seriesTransition:a,optionChanged:!0};if(n)this[id]={silent:i,updateParams:c},this[nd]=!1,
  3788. // `setOption(option, {lazyMode: true})` may be called when zrender has been slept.
  3789. // It should wake it up to make sure zrender start to render at the next frame.
  3790. this.getZr().wakeUp();else{try{cd(this),pd.update.call(this,null,c)}catch(d){throw this[id]=null,this[nd]=!1,d}
  3791. // Ensure zr refresh sychronously, and then pixel in canvas can be
  3792. // fetched after `setOption`.
  3793. this._ssr||
  3794. // not use flush when using ssr mode.
  3795. this._zr.flush(),this[id]=null,this[nd]=!1,md.call(this,i),vd.call(this,i)}}},
  3796. /**
  3797. * @deprecated
  3798. */
  3799. s.prototype.setTheme=function(){},
  3800. // We don't want developers to use getModel directly.
  3801. s.prototype.getModel=function(){return this._model},s.prototype.getOption=function(){return this._model&&this._model.getOption()},s.prototype.getWidth=function(){return this._zr.getWidth()},s.prototype.getHeight=function(){return this._zr.getHeight()},s.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr
  3802. /* eslint-disable-next-line */||d.hasGlobalWindow&&window.devicePixelRatio||1},
  3803. /**
  3804. * Get canvas which has all thing rendered
  3805. * @deprecated Use renderToCanvas instead.
  3806. */
  3807. s.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},s.prototype.renderToCanvas=function(t){return t=t||{},this._zr.painter.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},s.prototype.renderToSVGString=function(t){return t=t||{},this._zr.painter.renderToString({useViewBox:t.useViewBox})},
  3808. /**
  3809. * Get svg data url
  3810. */
  3811. s.prototype.getSvgDataURL=function(){if(d.svgSupported){var t=this._zr,e=t.storage.getDisplayList();
  3812. // Stop animations
  3813. return a(e,(function(t){t.stopAnimation(null,!0)})),t.painter.toDataURL()}},s.prototype.getDataURL=function(t){if(!this._disposed){var e=(t=t||{}).excludeComponents,n=this._model,i=[],o=this;a(e,(function(t){n.eachComponent({mainType:t},(function(t){var e=o._componentsMap[t.__viewId];e.group.ignore||(i.push(e),e.group.ignore=!0)}))}));var r="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return a(i,(function(t){t.group.ignore=!1})),r}this.id},s.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,n=this.group,i=Math.min,o=Math.max,r=Infinity;if(Fd[n]){var s=r,l=r,u=-Infinity,c=-Infinity,d=[],h=t&&t.pixelRatio||this.getDevicePixelRatio();a(Gd,(function(r,a){if(r.group===n){var h=e?r.getZr().painter.getSvgDom().innerHTML:r.renderToCanvas(et(t)),p=r.getDom().getBoundingClientRect();s=i(p.left,s),l=i(p.top,l),u=o(p.right,u),c=o(p.bottom,c),d.push({dom:h,left:p.left,top:p.top})}}));var p=(u*=h)-(s*=h),f=(c*=h)-(l*=h),g=gt.createCanvas(),y=vt(g,{renderer:e?"svg":"canvas"});if(y.resize({width:p,height:f}),e){var m="";return a(d,(function(t){var e=t.left-s,n=t.top-l;m+='<g transform="translate('+e+","+n+')">'+t.dom+"</g>"})),y.painter.getSvgRoot().innerHTML=m,t.connectedBackgroundColor&&y.painter.setBackgroundColor(t.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}
  3814. // Background between the charts
  3815. return t.connectedBackgroundColor&&y.add(new G({shape:{x:0,y:0,width:p,height:f},style:{fill:t.connectedBackgroundColor}})),a(d,(function(t){var e=new b({style:{x:t.left*h-s,y:t.top*h-l,image:t.dom}});y.add(e)})),y.refreshImmediately(),g.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}this.id},s.prototype.convertToPixel=function(t,e){return fd(this,"convertToPixel",t,e)},s.prototype.convertFromPixel=function(t,e){return fd(this,"convertFromPixel",t,e)},
  3816. /**
  3817. * Is the specified coordinate systems or components contain the given pixel point.
  3818. * @param {Array|number} value
  3819. * @return {boolean} result
  3820. */
  3821. s.prototype.containPixel=function(t,e){if(!this._disposed){var n,i=En(this._model,t);return a(i,(function(t,i){i.indexOf("Models")>=0&&a(t,(function(t){var o=t.coordinateSystem;if(o&&o.containPoint)n=n||!!o.containPoint(e);else if("seriesModels"===i){var r=this._chartsMap[t.__viewId];r&&r.containPoint&&(n=n||r.containPoint(e,t))}}),this)}),this),!!n}this.id},
  3822. /**
  3823. * Get visual from series or data.
  3824. * @param finder
  3825. * If string, e.g., 'series', means {seriesIndex: 0}.
  3826. * If Object, could contain some of these properties below:
  3827. * {
  3828. * seriesIndex / seriesId / seriesName,
  3829. * dataIndex / dataIndexInside
  3830. * }
  3831. * If dataIndex is not specified, series visual will be fetched,
  3832. * but not data item visual.
  3833. * If all of seriesIndex, seriesId, seriesName are not specified,
  3834. * visual will be fetched from first series.
  3835. * @param visualType 'color', 'symbol', 'symbolSize'
  3836. */
  3837. s.prototype.getVisual=function(t,e){var n=En(this._model,t,{defaultMainType:"series"}),i=n.seriesModel.getData(),o=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?i.indexOfRawIndex(n.dataIndex):null;return null!=o?Dc(i,o,e):Tc(i,e)},
  3838. /**
  3839. * Get view of corresponding component model
  3840. */
  3841. s.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},
  3842. /**
  3843. * Get view of corresponding series model
  3844. */
  3845. s.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},s.prototype._initEvents=function(){var t,e,n,i=this;a(Pd,(function(t){var e=function(e){var n,o=i.getModel(),r=e.target;
  3846. // Contract: if params prepared in mouse event,
  3847. // these properties must be specified:
  3848. // {
  3849. // componentType: string (component main type)
  3850. // componentIndex: number
  3851. // }
  3852. // Otherwise event query can not work.
  3853. if(
  3854. // no e.target when 'globalout'.
  3855. "globalout"===t?n={}:r&&kc(r,(function(t){var e=ni(t);if(e&&null!=e.dataIndex){var i=e.dataModel||o.getSeriesByIndex(e.seriesIndex);return n=i&&i.getDataParams(e.dataIndex,e.dataType,r)||{},!0}
  3856. // If element has custom eventData of components
  3857. if(e.eventData)return n=p({},e.eventData),!0}),!0),n){var a=n.componentType,s=n.componentIndex;
  3858. // Special handling for historic reason: when trigger by
  3859. // markLine/markPoint/markArea, the componentType is
  3860. // 'markLine'/'markPoint'/'markArea', but we should better
  3861. // enable them to be queried by seriesIndex, since their
  3862. // option is set in each series.
  3863. "markLine"!==a&&"markPoint"!==a&&"markArea"!==a||(a="series",s=n.seriesIndex);var l=a&&null!=s&&o.getComponent(a,s),u=l&&i["series"===l.mainType?"_chartsMap":"_componentsMap"][l.__viewId];n.event=e,n.type=t,i._$eventProcessor.eventInfo={targetEl:r,packedEvent:n,model:l,view:u},i.trigger(t,n)}};
  3864. // Consider that some component (like tooltip, brush, ...)
  3865. // register zr event handler, but user event handler might
  3866. // do anything, such as call `setOption` or `dispatchAction`,
  3867. // which probably update any of the content and probably
  3868. // cause problem if it is called previous other inner handlers.
  3869. e.zrEventfulCallAtLast=!0,i._zr.on(t,e,i)})),a(Od,(function(t,e){i._messageCenter.on(e,(function(t){this.trigger(e,t)}),i)})),
  3870. // Extra events
  3871. // TODO register?
  3872. a(["selectchanged"],(function(t){i._messageCenter.on(t,(function(e){this.trigger(t,e)}),i)})),t=this._messageCenter,e=this,n=this._api,t.on("selectchanged",(function(t){var i=n.getModel();t.isFromClick?(Lc("map","selectchanged",e,i,t),Lc("pie","selectchanged",e,i,t)):"select"===t.fromAction?(Lc("map","selected",e,i,t),Lc("pie","selected",e,i,t)):"unselect"===t.fromAction&&(Lc("map","unselected",e,i,t),Lc("pie","unselected",e,i,t))}))},s.prototype.isDisposed=function(){return this._disposed},s.prototype.clear=function(){this._disposed?this.id:this.setOption({series:[]},!0)},s.prototype.dispose=function(){if(this._disposed)this.id;else{this._disposed=!0,this.getDom()&&Fn(this.getDom(),Yd,"");var t=this,e=t._api,n=t._model;a(t._componentsViews,(function(t){t.dispose(n,e)})),a(t._chartsViews,(function(t){t.dispose(n,e)})),
  3873. // Dispose after all views disposed
  3874. t._zr.dispose(),
  3875. // Set properties to null.
  3876. // To reduce the memory cost in case the top code still holds this instance unexpectedly.
  3877. t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete Gd[t.id]}},
  3878. /**
  3879. * Resize the chart
  3880. */
  3881. s.prototype.resize=function(t){if(!this[nd])if(this._disposed)this.id;else{this._zr.resize(t);var e=this._model;
  3882. // Resize loading effect
  3883. if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;
  3884. // There is some real cases that:
  3885. // chart.setOption(option, { lazyUpdate: true });
  3886. // chart.resize();
  3887. this[id]&&(null==i&&(i=this[id].silent),n=!0,this[id]=null),this[nd]=!0;try{n&&cd(this),pd.update.call(this,{type:"resize",animation:p({
  3888. // Disable animation
  3889. duration:0},t&&t.animation)})}catch(o){throw this[nd]=!1,o}this[nd]=!1,md.call(this,i),vd.call(this,i)}}},s.prototype.showLoading=function(t,e){if(this._disposed)this.id;else if(o(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),Bd[t]){var n=Bd[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}},
  3890. /**
  3891. * Hide loading effect
  3892. */
  3893. s.prototype.hideLoading=function(){this._disposed?this.id:(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},s.prototype.makeActionFromEvent=function(t){var e=p({},t);return e.type=Od[t.type],e},
  3894. /**
  3895. * @param opt If pass boolean, means opt.silent
  3896. * @param opt.silent Default `false`. Whether trigger events.
  3897. * @param opt.flush Default `undefined`.
  3898. * true: Flush immediately, and then pixel in canvas can be fetched
  3899. * immediately. Caution: it might affect performance.
  3900. * false: Not flush.
  3901. * undefined: Auto decide whether perform flush.
  3902. */
  3903. s.prototype.dispatchAction=function(t,e){if(this._disposed)this.id;else if(o(e)||(e={silent:!!e}),Nd[t.type]&&this._model)
  3904. // May dispatchAction in rendering procedure
  3905. if(this[nd])this._pendingActions.push(t);else{var n=e.silent;yd.call(this,t,n);var i=e.flush;i?this._zr.flush():!1!==i&&d.browser.weChat&&
  3906. // In WeChat embedded browser, `requestAnimationFrame` and `setInterval`
  3907. // hang when sliding page (on touch event), which cause that zr does not
  3908. // refresh until user interaction finished, which is not expected.
  3909. // But `dispatchAction` may be called too frequently when pan on touch
  3910. // screen, which impacts performance if do not throttle them.
  3911. this._throttledZrFlush(),md.call(this,n),vd.call(this,n)}
  3912. // Avoid dispatch action before setOption. Especially in `connect`.
  3913. },s.prototype.updateLabelLayout=function(){Kc.trigger("series:layoutlabels",this._model,this._api,{
  3914. // Not adding series labels.
  3915. // TODO
  3916. updatedSeries:[]})},s.prototype.appendData=function(t){if(this._disposed)this.id;else{var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),
  3917. // Note: `appendData` does not support that update extent of coordinate
  3918. // system, util some scenario require that. In the expected usage of
  3919. // `appendData`, the initial extent of coordinate system should better
  3920. // be fixed by axis `min`/`max` setting or initial data, otherwise if
  3921. // the extent changed while `appendData`, the location of the painted
  3922. // graphic elements have to be changed, which make the usage of
  3923. // `appendData` meaningless.
  3924. this._scheduler.unfinished=!0,this.getZr().wakeUp()}},
  3925. // A work around for no `internal` modifier in ts yet but
  3926. // need to strictly hide private methods to JS users.
  3927. s.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries((function(t){t.clearColorPalette()}))}
  3928. // Allocate zlevels for series and components
  3929. function e(t){
  3930. // Keep other states.
  3931. for(var e=[],n=t.currentStates,i=0;i<n.length;i++){var o=n[i];"emphasis"!==o&&"blur"!==o&&"select"!==o&&e.push(o)}
  3932. // Only use states when it's exists.
  3933. t.selected&&t.states.select&&e.push("select"),2===t.hoverState&&t.states.emphasis?e.push("emphasis"):1===t.hoverState&&t.states.blur&&e.push("blur"),t.useStates(e)}function o(t,e){if(!t.preventAutoZ){var n=t.get("z")||0,i=t.get("zlevel")||0;
  3934. // Set z and zlevel
  3935. e.eachRendered((function(t){
  3936. // Don't traverse the children because it has been traversed in _updateZ.
  3937. return s(t,n,i,-Infinity),!0}))}}function s(t,e,n,i){
  3938. // Group may also have textContent
  3939. var o=t.getTextContent(),r=t.getTextGuideLine();if(t.isGroup)for(
  3940. // set z & zlevel of children elements of Group
  3941. var a=t.childrenRef(),l=0;l<a.length;l++)i=Math.max(s(a[l],e,n,i),i);else
  3942. // not Group
  3943. t.z=e,t.zlevel=n,i=Math.max(t.z2,i);
  3944. // always set z and zlevel if label/labelLine exists
  3945. if(o&&(o.z=e,o.zlevel=n,
  3946. // lift z2 of text content
  3947. // TODO if el.emphasis.z2 is spcefied, what about textContent.
  3948. isFinite(i)&&(o.z2=i+2)),r){var u=t.textGuideLineConfig;r.z=e,r.zlevel=n,isFinite(i)&&(r.z2=i+(u&&u.showAbove?1:-1))}return i}
  3949. // Clear states without animation.
  3950. // TODO States on component.
  3951. function l(t,e){e.eachRendered((function(t){
  3952. // Not applied on removed elements, it may still in fading.
  3953. if(!ro(t)){var e=t.getTextContent(),n=t.getTextGuideLine();t.stateTransition&&(t.stateTransition=null),e&&e.stateTransition&&(e.stateTransition=null),n&&n.stateTransition&&(n.stateTransition=null),
  3954. // TODO If el is incremental.
  3955. t.hasState()?(t.prevStates=t.currentStates,t.clearStates()):t.prevStates&&(t.prevStates=null)}}))}function u(t,n){var i=t.getModel("stateAnimation"),o=t.isAnimationEnabled(),r=i.get("duration"),a=r>0?{duration:r,delay:i.get("delay"),easing:i.get("easing")}:null;n.eachRendered((function(t){if(t.states&&t.states.emphasis){
  3956. // Not applied on removed elements, it may still in fading.
  3957. if(ro(t))return;
  3958. // Only updated on changed element. In case element is incremental and don't want to rerender.
  3959. // TODO, a more proper way?
  3960. if(t instanceof g&&function(t){var e=ai(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var n=t.states.select||{};e.selectFill=n.style&&n.style.fill||null,e.selectStroke=n.style&&n.style.stroke||null}(t),t.__dirty){var n=t.prevStates;
  3961. // Restore states without animation
  3962. n&&t.useStates(n)}
  3963. // Update state transition and enable animation again.
  3964. if(o){t.stateTransition=a;var i=t.getTextContent(),r=t.getTextGuideLine();
  3965. // TODO Is it necessary to animate label?
  3966. i&&(i.stateTransition=a),r&&(r.stateTransition=a)}
  3967. // Use highlighted and selected flag to toggle states.
  3968. t.__dirty&&e(t)}}))}cd=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),dd(t,!0),dd(t,!1),e.plan()},
  3969. /**
  3970. * Prepare view instances of charts and components
  3971. */
  3972. dd=function(t,e){for(var n=t._model,i=t._scheduler,o=e?t._componentsViews:t._chartsViews,r=e?t._componentsMap:t._chartsMap,a=t._zr,s=t._api,l=0;l<o.length;l++)o[l].__alive=!1;function u(t){
  3973. // By default view will be reused if possible for the case that `setOption` with "notMerge"
  3974. // mode and need to enable transition animation. (Usually, when they have the same id, or
  3975. // especially no id but have the same type & name & index. See the `model.id` generation
  3976. // rule in `makeIdAndName` and `viewId` generation rule here).
  3977. // But in `replaceMerge` mode, this feature should be able to disabled when it is clear that
  3978. // the new model has nothing to do with the old model.
  3979. var l=t.__requireNewView;
  3980. // This command should not work twice.
  3981. t.__requireNewView=!1;
  3982. // Consider: id same and type changed.
  3983. var u="_ec_"+t.id+"_"+t.type,c=!l&&r[u];if(!c){var d=Zn(t.type);(c=new(e?Mu.getClass(d.main,d.sub):
  3984. // FIXME:TS
  3985. // (ChartView as ChartViewConstructor).getClass('series', classType.sub)
  3986. // For backward compat, still support a chart type declared as only subType
  3987. // like "liquidfill", but recommend "series.liquidfill"
  3988. // But need a base class to make a type series.
  3989. Ou.getClass(d.sub))).init(n,s),r[u]=c,o.push(c),a.add(c.group)}t.__viewId=c.__id=u,c.__alive=!0,c.__model=t,c.group.__ecComponentInfo={mainType:t.mainType,index:t.componentIndex},!e&&i.prepareView(c,t,n,s)}e?n.eachComponent((function(t,e){"series"!==t&&u(e)})):n.eachSeries(u);for(l=0;l<o.length;){var c=o[l];c.__alive?l++:(!e&&c.renderTask.dispose(),a.remove(c.group),c.dispose(n,s),o.splice(l,1),r[c.__id]===c&&delete r[c.__id],c.__id=c.group.__ecComponentInfo=null)}},hd=function(t,e,n,o,s){var l=t._model;
  3990. // broadcast
  3991. if(l.setUpdatePayload(n),o){var u={};u[o+"Id"]=n[o+"Id"],u[o+"Index"]=n[o+"Index"],u[o+"Name"]=n[o+"Name"];var c={mainType:o,query:u};s&&(c.subType=s);// subType may be '' by parseClassType;
  3992. var d,h=n.excludeSeriesId;null!=h&&(d=r(),a(Sn(h),(function(t){var e=Ln(t,null);null!=e&&d.set(e,!0)}))),
  3993. // If dispatchAction before setOption, do nothing.
  3994. l&&l.eachComponent(c,(function(e){if(!(d&&null!=d.get(e.id)))if(Qi(n))if(e instanceof Su)n.type!==di||n.notBlur||e.get(["emphasis","disabled"])||function(t,e,n){var o=t.seriesIndex,r=t.getData(e.dataType);if(r){var a=Nn(r,e);
  3995. // Pick the first one if there is multiple/none exists.
  3996. a=(i(a)?a[0]:a)||0;var s=r.getItemGraphicEl(a);if(!s)
  3997. // If data on dataIndex is NaN.
  3998. for(var l=r.count(),u=0;!s&&u<l;)s=r.getItemGraphicEl(u++);if(s){var c=ni(s);Bi(o,c.focus,c.blurScope,n)}else{
  3999. // If there is no element put on the data. Try getting it from raw option
  4000. // TODO Should put it on seriesModel?
  4001. var d=t.get(["emphasis","focus"]),h=t.get(["emphasis","blurScope"]);null!=d&&Bi(o,d,h,n)}}}(e,n,t._api);else{var o=Fi(e.mainType,e.componentIndex,n.name,t._api),r=o.focusSelf,s=o.dispatchers;n.type===di&&r&&!n.notBlur&&Gi(e.mainType,e.componentIndex,t._api),
  4002. // PENDING:
  4003. // Whether to put this "enter emphasis" code in `ComponentView`,
  4004. // which will be the same as `ChartView` but might be not necessary
  4005. // and will be far from this logic.
  4006. s&&a(s,(function(t){n.type===di?ki(t):Pi(t)}))}else $i(n)&&e instanceof Su&&(!function(t,e){if($i(e)){var n=e.dataType,o=Nn(t.getData(n),e);i(o)||(o=[o]),t[e.type===gi?"toggleSelect":e.type===pi?"select":"unselect"](o,n)}}(e,n,t._api),Wi(e),Dd(t))}),t),l&&l.eachComponent(c,(function(e){d&&null!=d.get(e.id)||p(t["series"===o?"_chartsMap":"_componentsMap"][e.__viewId])}),t)}else
  4007. // FIXME
  4008. // Chart will not be update directly here, except set dirty.
  4009. // But there is no such scenario now.
  4010. a([].concat(t._componentsViews).concat(t._chartsViews),p);function p(i){i&&i.__alive&&i[e]&&i[e](i.__model,l,t._api,n)}},pd={prepareAndUpdate:function(t){cd(this),pd.update.call(this,t,{
  4011. // Needs to mark option changed if newOption is given.
  4012. // It's from MagicType.
  4013. // TODO If use a separate flag optionChanged in payload?
  4014. optionChanged:null!=t.newOption})},update:function(e,n){var i=this._model,o=this._api,r=this._zr,a=this._coordSysMgr,s=this._scheduler;
  4015. // update before setOption
  4016. if(i){i.setUpdatePayload(e),s.restoreData(i,e),s.performSeriesTasks(i),
  4017. // TODO
  4018. // Save total ecModel here for undo/redo (after restoring data and before processing data).
  4019. // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call.
  4020. // Create new coordinate system each update
  4021. // In LineView may save the old coordinate system and use it to get the original point.
  4022. a.create(i,o),s.performDataProcessorTasks(i,e),
  4023. // Current stream render is not supported in data process. So we can update
  4024. // stream modes after data processing, where the filtered data is used to
  4025. // determine whether to use progressive rendering.
  4026. gd(this,i),
  4027. // We update stream modes before coordinate system updated, then the modes info
  4028. // can be fetched when coord sys updating (consider the barGrid extent fix). But
  4029. // the drawback is the full coord info can not be fetched. Fortunately this full
  4030. // coord is not required in stream mode updater currently.
  4031. a.update(i,o),t(i),s.performVisualTasks(i,e),bd(this,i,o,e,n);
  4032. // Set background
  4033. var l=i.get("backgroundColor")||"transparent",u=i.get("darkMode");r.setBackgroundColor(l),
  4034. // Force set dark mode.
  4035. null!=u&&"auto"!==u&&r.setDarkMode(u),Kc.trigger("afterupdate",i,o)}},updateTransform:function(e){var n=this,i=this._model,o=this._api;
  4036. // update before setOption
  4037. if(i){i.setUpdatePayload(e);
  4038. // ChartView.markUpdateMethod(payload, 'updateTransform');
  4039. var a=[];i.eachComponent((function(t,r){if("series"!==t){var s=n.getViewOfComponentModel(r);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(r,i,o,e);l&&l.update&&a.push(s)}else a.push(s)}}));var s=r();i.eachSeries((function(t){var r=n._chartsMap[t.__viewId];if(r.updateTransform){var a=r.updateTransform(t,i,o,e);a&&a.update&&s.set(t.uid,1)}else s.set(t.uid,1)})),t(i),
  4040. // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.
  4041. // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true);
  4042. this._scheduler.performVisualTasks(i,e,{setDirty:!0,dirtyMap:s}),
  4043. // Currently, not call render of components. Geo render cost a lot.
  4044. // renderComponents(ecIns, ecModel, api, payload, componentDirtyList);
  4045. wd(this,i,o,e,{},s),Kc.trigger("afterupdate",i,o)}},updateView:function(e){var n=this._model;
  4046. // update before setOption
  4047. n&&(n.setUpdatePayload(e),Ou.markUpdateMethod(e,"updateView"),t(n),
  4048. // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.
  4049. this._scheduler.performVisualTasks(n,e,{setDirty:!0}),bd(this,n,this._api,e,{}),Kc.trigger("afterupdate",n,this._api))},updateVisual:function(e){
  4050. // updateMethods.update.call(this, payload);
  4051. var n=this,i=this._model;
  4052. // update before setOption
  4053. i&&(i.setUpdatePayload(e),
  4054. // clear all visual
  4055. i.eachSeries((function(t){t.getData().clearAllVisual()})),
  4056. // Perform visual
  4057. Ou.markUpdateMethod(e,"updateVisual"),t(i),
  4058. // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.
  4059. this._scheduler.performVisualTasks(i,e,{visualType:"visual",setDirty:!0}),i.eachComponent((function(t,o){if("series"!==t){var r=n.getViewOfComponentModel(o);r&&r.__alive&&r.updateVisual(o,i,n._api,e)}})),i.eachSeries((function(t){n._chartsMap[t.__viewId].updateVisual(t,i,n._api,e)})),Kc.trigger("afterupdate",i,this._api))},updateLayout:function(t){pd.update.call(this,t)}},fd=function(t,e,n,i){if(t._disposed)t.id;else for(var o,r=t._model,a=t._coordSysMgr.getCoordinateSystems(),s=En(r,n),l=0;l<a.length;l++){var u=a[l];if(u[e]&&null!=(o=u[e](r,s,i)))return o}},gd=function(t,e){var n=t._chartsMap,i=t._scheduler;e.eachSeries((function(t){i.updateStreamModes(t,n[t.__viewId])}))},yd=function(t,e){var i=this,o=this.getModel(),r=t.type,s=t.escapeConnect,l=Nd[r],u=l.actionInfo,c=(u.update||"update").split(":"),d=c.pop(),h=null!=c[0]&&Zn(c[0]);this[nd]=!0;var f=[t],g=!1;
  4060. // Batch action
  4061. t.batch&&(g=!0,f=n(t.batch,(function(e){return(e=I(p({},e),t)).batch=null,e})));var y,m=[],v=$i(t),x=Qi(t);if(
  4062. // Only leave blur once if there are multiple batches.
  4063. x&&zi(this._api),a(f,(function(e){
  4064. // light update does not perform data process, layout and visual.
  4065. if(
  4066. // Action can specify the event by return it.
  4067. // Convert type to eventType
  4068. (
  4069. // Emit event outside
  4070. y=(y=l.action(e,i._model,i._api))||p({},e)).type=u.event||y.type,m.push(y),x){var n=Vn(t),o=n.queryOptionMap,r=n.mainTypeSpecified?o.keys()[0]:"series";hd(i,d,e,r),Dd(i)}else v?(
  4071. // At present `dispatchAction({ type: 'select', ... })` is not supported on components.
  4072. // geo still use 'geoselect'.
  4073. hd(i,d,e,"series"),Dd(i)):h&&hd(i,d,e,h.main,h.sub)})),"none"!==d&&!x&&!v&&!h)try{
  4074. // Still dirty
  4075. this[id]?(cd(this),pd.update.call(this,t),this[id]=null):pd[d].call(this,t)}catch(S){throw this[nd]=!1,S}
  4076. // Follow the rule of action batch
  4077. if(y=g?{type:u.event||r,escapeConnect:s,batch:m}:m[0],this[nd]=!1,!e){var _=this._messageCenter;
  4078. // Extra triggered 'selectchanged' event
  4079. if(_.trigger(y.type,y),v){var b={type:"selectchanged",escapeConnect:s,selected:Hi(o),isFromClick:t.isFromClick||!1,fromAction:t.type,fromActionPayload:t};_.trigger(b.type,b)}}},md=function(t){for(var e=this._pendingActions;e.length;){var n=e.shift();yd.call(this,n,t)}},vd=function(t){!t&&this.trigger("updated")},
  4080. /**
  4081. * Event `rendered` is triggered when zr
  4082. * rendered. It is useful for realtime
  4083. * snapshot (reflect animation).
  4084. *
  4085. * Event `finished` is triggered when:
  4086. * (1) zrender rendering finished.
  4087. * (2) initial animation finished.
  4088. * (3) progressive rendering finished.
  4089. * (4) no pending action.
  4090. * (5) no delayed setOption needs to be processed.
  4091. */
  4092. xd=function(t,e){t.on("rendered",(function(n){e.trigger("rendered",n),
  4093. // The `finished` event should not be triggered repeatedly,
  4094. // so it should only be triggered when rendering indeed happens
  4095. // in zrender. (Consider the case that dipatchAction is keep
  4096. // triggering when mouse move).
  4097. // Although zr is dirty if initial animation is not finished
  4098. // and this checking is called on frame, we also check
  4099. // animation finished for robustness.
  4100. !t.animation.isFinished()||e[id]||e._scheduler.unfinished||e._pendingActions.length||e.trigger("finished")}))},_d=function(t,e){t.on("mouseover",(function(t){var n=kc(t.target,Ji);n&&(!function(t,e,n){var i=ni(t),o=Fi(i.componentMainType,i.componentIndex,i.componentHighDownName,n),r=o.dispatchers,s=o.focusSelf;
  4101. // If `findHighDownDispatchers` is supported on the component,
  4102. // highlight/downplay elements with the same name.
  4103. r?(s&&Gi(i.componentMainType,i.componentIndex,n),a(r,(function(t){return Ai(t,e)}))):(
  4104. // Try blur all in the related series. Then emphasis the hoverred.
  4105. // TODO. progressive mode.
  4106. Bi(i.seriesIndex,i.focus,i.blurScope,n),"self"===i.focus&&Gi(i.componentMainType,i.componentIndex,n),
  4107. // Other than series, component that not support `findHighDownDispatcher` will
  4108. // also use it. But in this case, highlight/downplay are only supported in
  4109. // mouse hover but not in dispatchAction.
  4110. Ai(t,e))}(n,t,e._api),Dd(e))})).on("mouseout",(function(t){var n=kc(t.target,Ji);n&&(!function(t,e,n){zi(n);var i=ni(t),o=Fi(i.componentMainType,i.componentIndex,i.componentHighDownName,n).dispatchers;o?a(o,(function(t){return Li(t,e)})):Li(t,e)}(n,t,e._api),Dd(e))})).on("click",(function(t){var n=kc(t.target,(function(t){return null!=ni(t).dataIndex}),!0);if(n){var i=n.selected?"unselect":"select",o=ni(n);e._api.dispatchAction({type:i,dataType:o.dataType,dataIndexInside:o.dataIndex,seriesIndex:o.seriesIndex,isFromClick:!0})}}))},bd=function(t,e,n,i,o){!function(t){var e=[],n=[],i=!1;if(t.eachComponent((function(t,o){var r=o.get("zlevel")||0,a=o.get("z")||0,s=o.getZLevelKey();i=i||!!s,("series"===t?n:e).push({zlevel:r,z:a,idx:o.componentIndex,type:t,key:s})})),i){
  4111. // Series after component
  4112. var o,r,s=e.concat(n);xt(s,(function(t,e){return t.zlevel===e.zlevel?t.z-e.z:t.zlevel-e.zlevel})),a(s,(function(e){var n=t.getComponent(e.type,e.idx),i=e.zlevel,a=e.key;null!=o&&(i=Math.max(o,i)),a?(i===o&&a!==r&&i++,r=a):r&&(i===o&&i++,r=""),o=i,n.setZLevel(i)}))}}(e),Sd(t,e,n,i,o),a(t._chartsViews,(function(t){t.__alive=!1})),wd(t,e,n,i,o),
  4113. // Remove groups of unrendered charts
  4114. a(t._chartsViews,(function(t){t.__alive||t.remove(e,n)}))},Sd=function(t,e,n,i,r,s){a(s||t._componentsViews,(function(t){var r=t.__model;l(r,t),t.render(r,e,n,i),o(r,t),u(r,t)}))},
  4115. /**
  4116. * Render each chart and component
  4117. */
  4118. wd=function(t,e,n,i,r,a){
  4119. // Render all charts
  4120. var s=t._scheduler;r=p(r||{},{updatedSeries:e.getSeries()}),
  4121. // TODO progressive?
  4122. Kc.trigger("series:beforeupdate",e,n,r);var c=!1;e.eachSeries((function(e){var n=t._chartsMap[e.__viewId];n.__alive=!0;var o=n.renderTask;s.updatePayload(o,i),
  4123. // TODO states on marker.
  4124. l(e,n),a&&a.get(e.uid)&&o.dirty(),o.perform(s.getPerformArgs(o))&&(c=!0),n.group.silent=!!e.get("silent"),
  4125. // Should not call markRedraw on group, because it will disable zrender
  4126. // incremental render (always render from the __startIndex each frame)
  4127. // chartView.group.markRedraw();
  4128. /**
  4129. * Update chart and blend.
  4130. */
  4131. function(t,e){var n=t.get("blendMode")||null;e.eachRendered((function(t){
  4132. // FIXME marker and other components
  4133. t.isGroup||(
  4134. // DON'T mark the element dirty. In case element is incremental and don't want to rerender.
  4135. t.style.blend=n)}))}(e,n),Wi(e)})),s.unfinished=c||s.unfinished,Kc.trigger("series:layoutlabels",e,n,r),
  4136. // transition after label is layouted.
  4137. Kc.trigger("series:transition",e,n,r),e.eachSeries((function(e){var n=t._chartsMap[e.__viewId];
  4138. // Update Z after labels updated. Before applying states.
  4139. o(e,n),
  4140. // NOTE: Update states after label is updated.
  4141. // label should be in normal status when layouting.
  4142. u(e,n)})),
  4143. // If use hover layer
  4144. function(t,e){var n=t._zr,i=n.storage,o=0;i.traverse((function(t){t.isGroup||o++})),o>e.get("hoverLayerThreshold")&&!d.node&&!d.worker&&e.eachSeries((function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.eachRendered((function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)}))}}))}(t,e),Kc.trigger("series:afterupdate",e,n,r)},Dd=function(t){t[od]=!0,
  4145. // Wake up zrender if it's sleep. Let it update states in the next frame.
  4146. t.getZr().wakeUp()},Td=function(t){t[od]&&(t.getZr().storage.traverse((function(t){
  4147. // Not applied on removed elements, it may still in fading.
  4148. ro(t)||e(t)})),t[od]=!1)},Md=function(t){return new(/** @class */function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Ue(n,e),n.prototype.getCoordinateSystems=function(){return t._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(e){for(;e;){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}},n.prototype.enterEmphasis=function(e,n){ki(e,n),Dd(t)},n.prototype.leaveEmphasis=function(e,n){Pi(e,n),Dd(t)},n.prototype.enterBlur=function(e){Ni(e),Dd(t)},n.prototype.leaveBlur=function(e){Oi(e),Dd(t)},n.prototype.enterSelect=function(e){Ri(e),Dd(t)},n.prototype.leaveSelect=function(e){Ei(e),Dd(t)},n.prototype.getModel=function(){return t.getModel()},n.prototype.getViewOfComponentModel=function(e){return t.getViewOfComponentModel(e)},n.prototype.getViewOfSeriesModel=function(e){return t.getViewOfSeriesModel(e)},n}(ds))(t)},Id=function(t){function e(t,e){for(var n=0;n<t.length;n++){t[n][ad]=e}}a(Od,(function(n,i){t._messageCenter.on(i,(function(n){if(Fd[t.group]&&0!==t[ad]){if(n&&n.escapeConnect)return;var i=t.makeActionFromEvent(n),o=[];a(Gd,(function(e){e!==t&&e.group===t.group&&o.push(e)})),e(o,0),a(o,(function(t){1!==t[ad]&&t.dispatchAction(i)})),e(o,2)}}))}))}}(),s}(mt),kd=Ld.prototype;kd.on=sd("on"),kd.off=sd("off"),
  4149. /**
  4150. * @deprecated
  4151. */
  4152. // @ts-ignore
  4153. kd.one=function(t,e,n){var i=this;
  4154. // @ts-ignore
  4155. this.on.call(this,t,(function n(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];e&&e.apply&&e.apply(this,o),
  4156. // @ts-ignore
  4157. i.off(t,n)}),n)};var Pd=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];var Nd={},Od={},Rd=[],Ed=[],Vd=[],zd={},Bd={},Gd={},Fd={},Wd=+new Date-0,Hd=+new Date-0,Yd="_echarts_instance_";
  4158. /**
  4159. * Map eventType to actionType
  4160. */
  4161. /**
  4162. * @param opts.devicePixelRatio Use window.devicePixelRatio by default
  4163. * @param opts.renderer Can choose 'canvas' or 'svg' to render the chart.
  4164. * @param opts.width Use clientWidth of the input `dom` by default.
  4165. * Can be 'auto' (the same as null/undefined)
  4166. * @param opts.height Use clientHeight of the input `dom` by default.
  4167. * Can be 'auto' (the same as null/undefined)
  4168. * @param opts.locale Specify the locale.
  4169. * @param opts.useDirtyRect Enable dirty rectangle rendering or not.
  4170. */
  4171. function Ud(t,e,n){var i=!(n&&n.ssr);if(i){var o=jd(t);if(o)return o}var r=new Ld(t,e,n);return r.id="ec_"+Wd++,Gd[r.id]=r,i&&Fn(t,Yd,r.id),Id(r),Kc.trigger("afterinit",r),r}
  4172. /**
  4173. * @usage
  4174. * (A)
  4175. * ```js
  4176. * let chart1 = echarts.init(dom1);
  4177. * let chart2 = echarts.init(dom2);
  4178. * chart1.group = 'xxx';
  4179. * chart2.group = 'xxx';
  4180. * echarts.connect('xxx');
  4181. * ```
  4182. * (B)
  4183. * ```js
  4184. * let chart1 = echarts.init(dom1);
  4185. * let chart2 = echarts.init(dom2);
  4186. * echarts.connect('xxx', [chart1, chart2]);
  4187. * ```
  4188. */function Zd(t){Fd[t]=!1}
  4189. /**
  4190. * Alias and backward compatibility
  4191. * @deprecated
  4192. */var Xd=Zd;
  4193. /**
  4194. * Dispose a chart instance
  4195. */function jd(t){return Gd[function(t,e){return t.getAttribute?t.getAttribute(e):t[e]}(t,Yd)]}
  4196. /**
  4197. * Register theme
  4198. */
  4199. function qd(t,e){zd[t]=e}
  4200. /**
  4201. * Register option preprocessor
  4202. */function Kd(t){c(Ed,t)<0&&Ed.push(t)}function Jd(t,e){ah(Rd,t,e,2e3)}
  4203. /**
  4204. * Register postIniter
  4205. * @param {Function} postInitFunc
  4206. */function $d(t){th("afterinit",t)}
  4207. /**
  4208. * Register postUpdater
  4209. * @param {Function} postUpdateFunc
  4210. */function Qd(t){th("afterupdate",t)}function th(t,e){Kc.on(t,e)}function eh(t,e,n){f(e)&&(n=e,e="");var i=o(t)?t.type:[t,t={event:e}][0];
  4211. // Event name is all lowercase
  4212. t.event=(t.event||i).toLowerCase(),e=t.event,Od[e]||(
  4213. // Validate action type and event name.
  4214. s(rd.test(i)&&rd.test(e)),Nd[i]||(Nd[i]={action:n,actionInfo:t}),Od[e]=i)}function nh(t,e){fs.register(t,e)}
  4215. /**
  4216. * Get dimensions of specified coordinate system.
  4217. * @param {string} type
  4218. * @return {Array.<string|Object>}
  4219. */function ih(t,e){ah(Vd,t,e,1e3,"layout")}function oh(t,e){ah(Vd,t,e,3e3,"visual")}var rh=[];function ah(t,e,n,i,r){
  4220. // Already registered
  4221. if((f(e)||o(e))&&(n=e,e=i),!(c(rh,n)>=0)){rh.push(n);var a=hc.wrapStageHandler(n,r);a.__prio=e,a.__raw=n,t.push(a)}}function sh(t,e){Bd[t]=e}
  4222. /**
  4223. * ZRender need a canvas context to do measureText.
  4224. * But in node environment canvas may be created by node-canvas.
  4225. * So we need to specify how to create a canvas instead of using document.createElement('canvas')
  4226. *
  4227. *
  4228. * @deprecated use setPlatformAPI({ createCanvas }) instead.
  4229. *
  4230. * @example
  4231. * let Canvas = require('canvas');
  4232. * let echarts = require('echarts');
  4233. * echarts.setCanvasCreator(function () {
  4234. * // Small size is enough.
  4235. * return new Canvas(32, 32);
  4236. * });
  4237. */
  4238. /**
  4239. * The parameters and usage: see `geoSourceManager.registerMap`.
  4240. * Compatible with previous `echarts.registerMap`.
  4241. */
  4242. function lh(t,e,n){var i=$c("registerMap");i&&i(t,e,n)}var uh=function(t){var e=(t=et(t)).type;e||vn("");var n=e.split(":");2!==n.length&&vn("");
  4243. // Namespace 'echarts:xxx' is official namespace, where the transforms should
  4244. // be called directly via 'xxx' rather than 'echarts:xxx'.
  4245. var i=!1;"echarts"===n[0]&&(e=n[1],i=!0),t.__isBuiltIn=i,Ll.set(e,t)};
  4246. /**
  4247. * Globa dispatchAction to a specified chart instance.
  4248. */
  4249. // export function dispatchAction(payload: { chartId: string } & Payload, opt?: Parameters<ECharts['dispatchAction']>[1]) {
  4250. // if (!payload || !payload.chartId) {
  4251. // // Must have chartId to find chart
  4252. // return;
  4253. // }
  4254. // const chart = instances[payload.chartId];
  4255. // if (chart) {
  4256. // chart.dispatchAction(payload, opt);
  4257. // }
  4258. // }
  4259. // Builtin global visual
  4260. oh(Qc,Zu),oh(td,ju),oh(td,qu),oh(Qc,Mc),oh(td,Ic),oh(7e3,(function(t,e){t.eachRawSeries((function(n){if(!t.isSeriesFiltered(n)){var i=n.getData();i.hasItemVisual()&&i.each((function(t){var n=i.getItemVisual(t,"decal");n&&(i.ensureUniqueItemVisual(t,"style").decal=Zc(n,e))}));var o=i.getVisual("decal");if(o)i.getVisual("style").decal=Zc(o,e)}}))})),Kd(zs),Jd(900,(function(t){var e=r();t.eachSeries((function(t){var n=t.get("stack");
  4261. // Compatible: when `stack` is set as '', do not stack.
  4262. if(n){var i=e.get(n)||e.set(n,[]),o=t.getData(),r={
  4263. // Used for calculate axis extent automatically.
  4264. // TODO: Type getCalculationInfo return more specific type?
  4265. stackResultDimension:o.getCalculationInfo("stackResultDimension"),stackedOverDimension:o.getCalculationInfo("stackedOverDimension"),stackedDimension:o.getCalculationInfo("stackedDimension"),stackedByDimension:o.getCalculationInfo("stackedByDimension"),isStackedByIndex:o.getCalculationInfo("isStackedByIndex"),data:o,seriesModel:t};
  4266. // If stacked on axis that do not support data stack.
  4267. if(!r.stackedDimension||!r.isStackedByIndex&&!r.stackedByDimension)return;i.length&&o.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(r)}})),e.each(Bs)})),sh("default",(
  4268. /**
  4269. * @param {module:echarts/ExtensionAPI} api
  4270. * @param {Object} [opts]
  4271. * @param {string} [opts.text]
  4272. * @param {string} [opts.color]
  4273. * @param {string} [opts.textColor]
  4274. * @return {module:zrender/Element}
  4275. */
  4276. function(t,e){I(e=e||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Z,i=new G({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(i);var o,r=new $({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new G({style:{fill:"none"},textContent:r,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(a),e.showSpinner&&((o=new H({shape:{startAngle:-Ku/2,endAngle:-Ku/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*Ku/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:3*Ku/2}).delay(300).start("circularInOut"),n.add(o)),
  4277. // Inject resize
  4278. n.resize=function(){var n=r.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),u=t.getHeight()/2;e.showSpinner&&o.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n})),
  4279. // Default actions
  4280. eh({type:di,event:di,update:di},dt),eh({type:hi,event:hi,update:hi},dt),eh({type:pi,event:pi,update:pi},dt),eh({type:fi,event:fi,update:fi},dt),eh({type:gi,event:gi,update:gi},dt),
  4281. // Default theme
  4282. qd("light",fc),qd("dark",_c);
  4283. // For backward compatibility, where the namespace `dataTool` will
  4284. // be mounted on `echarts` is the extension `dataTool` is imported.
  4285. var ch=[],dh={registerPreprocessor:Kd,registerProcessor:Jd,registerPostInit:$d,registerPostUpdate:Qd,registerUpdateLifecycle:th,registerAction:eh,registerCoordinateSystem:nh,registerLayout:ih,registerVisual:oh,registerTransform:uh,registerLoading:sh,registerMap:lh,registerImpl:function(t,e){Jc[t]=e},PRIORITY:ed,ComponentModel:Ta,ComponentView:Mu,SeriesModel:Su,ChartView:Ou,
  4286. // TODO Use ComponentModel and SeriesModel instead of Constructor
  4287. registerComponentModel:function(t){Ta.registerClass(t)},registerComponentView:function(t){Mu.registerClass(t)},registerSeriesModel:function(t){Su.registerClass(t)},registerChartView:function(t){Ou.registerClass(t)},registerSubTypeDefaulter:function(t,e){Ta.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){St(t,e)}};function hh(t){i(t)?
  4288. // use([ChartLine, ChartBar]);
  4289. a(t,(function(t){hh(t)})):c(ch,t)>=0||(ch.push(t),f(t)&&(t={install:t}),t.install(dh))}
  4290. /*
  4291. * Licensed to the Apache Software Foundation (ASF) under one
  4292. * or more contributor license agreements. See the NOTICE file
  4293. * distributed with this work for additional information
  4294. * regarding copyright ownership. The ASF licenses this file
  4295. * to you under the Apache License, Version 2.0 (the
  4296. * "License"); you may not use this file except in compliance
  4297. * with the License. You may obtain a copy of the License at
  4298. *
  4299. * http://www.apache.org/licenses/LICENSE-2.0
  4300. *
  4301. * Unless required by applicable law or agreed to in writing,
  4302. * software distributed under the License is distributed on an
  4303. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  4304. * KIND, either express or implied. See the License for the
  4305. * specific language governing permissions and limitations
  4306. * under the License.
  4307. */
  4308. /**
  4309. * AUTO-GENERATED FILE. DO NOT MODIFY.
  4310. */
  4311. /*
  4312. * Licensed to the Apache Software Foundation (ASF) under one
  4313. * or more contributor license agreements. See the NOTICE file
  4314. * distributed with this work for additional information
  4315. * regarding copyright ownership. The ASF licenses this file
  4316. * to you under the Apache License, Version 2.0 (the
  4317. * "License"); you may not use this file except in compliance
  4318. * with the License. You may obtain a copy of the License at
  4319. *
  4320. * http://www.apache.org/licenses/LICENSE-2.0
  4321. *
  4322. * Unless required by applicable law or agreed to in writing,
  4323. * software distributed under the License is distributed on an
  4324. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  4325. * KIND, either express or implied. See the License for the
  4326. * specific language governing permissions and limitations
  4327. * under the License.
  4328. */function ph(t){return null==t?0:t.length||1}function fh(t){return t}var gh=/** @class */function(){
  4329. /**
  4330. * @param context Can be visited by this.context in callback.
  4331. */
  4332. function t(t,e,n,i,o,
  4333. // By default: 'oneToOne'.
  4334. r){this._old=t,this._new=e,this._oldKeyGetter=n||fh,this._newKeyGetter=i||fh,
  4335. // Visible in callback via `this.context`;
  4336. this.context=o,this._diffModeMultiple="multiple"===r}
  4337. /**
  4338. * Callback function when add a data
  4339. */return t.prototype.add=function(t){return this._add=t,this},
  4340. /**
  4341. * Callback function when update a data
  4342. */
  4343. t.prototype.update=function(t){return this._update=t,this},
  4344. /**
  4345. * Callback function when update a data and only work in `cbMode: 'byKey'`.
  4346. */
  4347. t.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},
  4348. /**
  4349. * Callback function when update a data and only work in `cbMode: 'byKey'`.
  4350. */
  4351. t.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},
  4352. /**
  4353. * Callback function when update a data and only work in `cbMode: 'byKey'`.
  4354. */
  4355. t.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},
  4356. /**
  4357. * Callback function when remove a data
  4358. */
  4359. t.prototype.remove=function(t){return this._remove=t,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var t=this._old,e=this._new,n={},i=new Array(t.length),o=new Array(e.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(e,n,o,"_newKeyGetter");for(var r=0;r<t.length;r++){var a=i[r],s=n[a],l=ph(s);
  4360. // idx can never be empty array here. see 'set null' logic below.
  4361. if(l>1){
  4362. // Consider there is duplicate key (for example, use dataItem.name as key).
  4363. // We should make sure every item in newArr and oldArr can be visited.
  4364. var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,r)}else 1===l?(n[a]=null,this._update&&this._update(s,r)):this._remove&&this._remove(r)}this._performRestAdd(o,n)},
  4365. /**
  4366. * For example, consider the case:
  4367. * oldData: [o0, o1, o2, o3, o4, o5, o6, o7],
  4368. * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8],
  4369. * Where:
  4370. * o0, o1, n0 has key 'a' (many to one)
  4371. * o5, n4, n5, n6 has key 'b' (one to many)
  4372. * o2, n1 has key 'c' (one to one)
  4373. * n2, n3 has key 'd' (add)
  4374. * o3, o4 has key 'e' (remove)
  4375. * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove)
  4376. * Then:
  4377. * (The order of the following directives are not ensured.)
  4378. * this._updateManyToOne(n0, [o0, o1]);
  4379. * this._updateOneToMany([n4, n5, n6], o5);
  4380. * this._update(n1, o2);
  4381. * this._remove(o3);
  4382. * this._remove(o4);
  4383. * this._remove(o6);
  4384. * this._remove(o7);
  4385. * this._add(n2);
  4386. * this._add(n3);
  4387. * this._add(n7);
  4388. * this._add(n8);
  4389. */
  4390. t.prototype._executeMultiple=function(){var t=this._old,e=this._new,n={},i={},o=[],r=[];this._initIndexMap(t,n,o,"_oldKeyGetter"),this._initIndexMap(e,i,r,"_newKeyGetter");for(var a=0;a<o.length;a++){var s=o[a],l=n[s],u=i[s],c=ph(l),d=ph(u);if(c>1&&1===d)this._updateManyToOne&&this._updateManyToOne(u,l),i[s]=null;else if(1===c&&d>1)this._updateOneToMany&&this._updateOneToMany(u,l),i[s]=null;else if(1===c&&1===d)this._update&&this._update(u,l),i[s]=null;else if(c>1&&d>1)this._updateManyToMany&&this._updateManyToMany(u,l),i[s]=null;else if(c>1)for(var h=0;h<c;h++)this._remove&&this._remove(l[h]);else this._remove&&this._remove(l)}this._performRestAdd(r,i)},t.prototype._performRestAdd=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],o=e[i],r=ph(o);if(r>1)for(var a=0;a<r;a++)this._add&&this._add(o[a]);else 1===r&&this._add&&this._add(o);
  4391. // Support both `newDataKeyArr` are duplication removed or not removed.
  4392. e[i]=null}},t.prototype._initIndexMap=function(t,
  4393. // Can be null.
  4394. e,
  4395. // In 'byKey', the output `keyArr` is duplication removed.
  4396. // In 'byIndex', the output `keyArr` is not duplication removed and
  4397. // its indices are accurately corresponding to `arr`.
  4398. n,i){for(var o=this._diffModeMultiple,r=0;r<t.length;r++){
  4399. // Add prefix to avoid conflict with Object.prototype.
  4400. var a="_ec_"+this[i](t[r],r);if(o||(n[r]=a),e){var s=e[a],l=ph(s);0===l?(
  4401. // Simple optimize: in most cases, one index has one key,
  4402. // do not need array.
  4403. e[a]=r,o&&n.push(a)):1===l?e[a]=[s,r]:s.push(r)}}},t}();const yh=gh;var mh=/** @class */function(){function t(t,e){this._encode=t,this._schema=e}return t.prototype.get=function(){return{
  4404. // Do not generate full dimension name until fist used.
  4405. fullDimensions:this._getFullDimensionNames(),encode:this._encode}},
  4406. /**
  4407. * Get all data store dimension names.
  4408. * Theoretically a series data store is defined both by series and used dataset (if any).
  4409. * If some dimensions are omitted for performance reason in `this.dimensions`,
  4410. * the dimension name may not be auto-generated if user does not specify a dimension name.
  4411. * In this case, the dimension name is `null`/`undefined`.
  4412. */
  4413. t.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},t}();function vh(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}
  4414. // FIXME:TS should be type `AxisType`
  4415. function xh(t){return"category"===t?"ordinal":"time"===t?"time":"float"}const _h=
  4416. /**
  4417. * @param opt All of the fields will be shallow copied.
  4418. */
  4419. function(t){
  4420. /**
  4421. * The format of `otherDims` is:
  4422. * ```js
  4423. * {
  4424. * tooltip?: number
  4425. * label?: number
  4426. * itemName?: number
  4427. * seriesName?: number
  4428. * }
  4429. * ```
  4430. *
  4431. * A `series.encode` can specified these fields:
  4432. * ```js
  4433. * encode: {
  4434. * // "3, 1, 5" is the index of data dimension.
  4435. * tooltip: [3, 1, 5],
  4436. * label: [0, 3],
  4437. * ...
  4438. * }
  4439. * ```
  4440. * `otherDims` is the parse result of the `series.encode` above, like:
  4441. * ```js
  4442. * // Suppose the index of this data dimension is `3`.
  4443. * this.otherDims = {
  4444. * // `3` is at the index `0` of the `encode.tooltip`
  4445. * tooltip: 0,
  4446. * // `3` is at the index `1` of the `encode.label`
  4447. * label: 1
  4448. * };
  4449. * ```
  4450. *
  4451. * This prop should never be `null`/`undefined` after initialized.
  4452. */
  4453. this.otherDims={},null!=t&&p(this,t)};var bh=On(),Sh={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},wh=/** @class */function(){function t(t){this.dimensions=t.dimensions,this._dimOmitted=t.dimensionOmitted,this.source=t.source,this._fullDimCount=t.fullDimensionCount,this._updateDimOmitted(t.dimensionOmitted)}return t.prototype.isDimensionOmitted=function(){return this._dimOmitted},t.prototype._updateDimOmitted=function(t){this._dimOmitted=t,t&&(this._dimNameMap||(this._dimNameMap=Dh(this.source)))},
  4454. /**
  4455. * @caution Can only be used when `dimensionOmitted: true`.
  4456. *
  4457. * Get index by user defined dimension name (i.e., not internal generate name).
  4458. * That is, get index from `dimensionsDefine`.
  4459. * If no `dimensionsDefine`, or no name get, return -1.
  4460. */
  4461. t.prototype.getSourceDimensionIndex=function(t){return x(this._dimNameMap.get(t),-1)},
  4462. /**
  4463. * @caution Can only be used when `dimensionOmitted: true`.
  4464. *
  4465. * Notice: may return `null`/`undefined` if user not specify dimension names.
  4466. */
  4467. t.prototype.getSourceDimension=function(t){var e=this.source.dimensionsDefine;if(e)return e[t]},t.prototype.makeStoreSchema=function(){for(var t=this._fullDimCount,e=$s(this.source),n=!Th(t),i="",o=[],r=0,a=0;r<t;r++){var s=void 0,l=void 0,u=void 0,c=this.dimensions[a];
  4468. // The list has been sorted by `storeDimIndex` asc.
  4469. if(c&&c.storeDimIndex===r)s=e?c.name:null,l=c.type,u=c.ordinalMeta,a++;else{var d=this.getSourceDimension(r);d&&(s=e?d.name:null,l=d.type)}o.push({property:s,type:l,ordinalMeta:u}),
  4470. // If retrieving data by index,
  4471. // use <index, type, ordinalMeta> to determine whether data can be shared.
  4472. // (Because in this case there might be no dimension name defined in dataset, but indices always exists).
  4473. // (Indices are always 0, 1, 2, ..., so we can ignore them to shorten the hash).
  4474. // Otherwise if retrieving data by property name (like `data: [{aa: 123, bb: 765}, ...]`),
  4475. // use <property, type, ordinalMeta> in hash.
  4476. !e||null==s||c&&c.isCalculationCoord||(i+=n?s.replace(/\`/g,"`1").replace(/\$/g,"`2"):s),i+="$",i+=Sh[l]||"f",u&&(i+=u.uid),i+="$"}
  4477. // Source from endpoint(usually series) will be read differently
  4478. // when seriesLayoutBy or startIndex(which is affected by sourceHeader) are different.
  4479. // So we use this three props as key.
  4480. var h=this.source;return{dimensions:o,hash:[h.seriesLayoutBy,h.startIndex,i].join("$$")}},t.prototype.makeOutputDimensionNames=function(){for(var t=[],e=0,n=0;e<this._fullDimCount;e++){var i=void 0,o=this.dimensions[n];
  4481. // The list has been sorted by `storeDimIndex` asc.
  4482. if(o&&o.storeDimIndex===e)o.isCalculationCoord||(i=o.name),n++;else{var r=this.getSourceDimension(e);r&&(i=r.name)}t.push(i)}return t},t.prototype.appendCalculationDimension=function(t){this.dimensions.push(t),t.isCalculationCoord=!0,this._fullDimCount++,
  4483. // If append dimension on a data store, consider the store
  4484. // might be shared by different series, series dimensions not
  4485. // really map to store dimensions.
  4486. this._updateDimOmitted(!0)},t}();function Mh(t){return t instanceof wh}function Ih(t){for(var e=r(),n=0;n<(t||[]).length;n++){var i=t[n],a=o(i)?i.name:i;null!=a&&null==e.get(a)&&e.set(a,n)}return e}function Dh(t){var e=bh(t);return e.dimNameMap||(e.dimNameMap=Ih(t.dimensionsDefine))}function Th(t){return t>30}var Ch,Ah,Lh,kh,Ph,Nh,Oh,Rh=o,Eh=n,Vh="undefined"==typeof Int32Array?Array:Int32Array,zh=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],Bh=["_approximateExtent"],Gh=/** @class */function(){
  4487. /**
  4488. * @param dimensionsInput.dimensions
  4489. * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].
  4490. * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius
  4491. */
  4492. function e(e,n){var i;this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],
  4493. // Models of data option is stored sparse for optimizing memory cost
  4494. // Never used yet (not used yet).
  4495. // private _optionModels: Model[] = [];
  4496. // Global visual properties after visual coding
  4497. this._visual={},
  4498. // Global layout properties.
  4499. this._layout={},
  4500. // Item visual properties after visual coding
  4501. this._itemVisuals=[],
  4502. // Item layout properties after layout
  4503. this._itemLayouts=[],
  4504. // Graphic elements
  4505. this._graphicEls=[],
  4506. // key: dim, value: extent
  4507. this._approximateExtent={},this._calculationInfo={},
  4508. // Having detected that there is data item is non primitive type
  4509. // (in type `OptionDataItemObject`).
  4510. // Like `data: [ { value: xx, itemStyle: {...} }, ...]`
  4511. // At present it only happen in `SOURCE_FORMAT_ORIGINAL`.
  4512. this.hasItemOption=!1,
  4513. // Methods that create a new list based on this list should be listed here.
  4514. // Notice that those method should `RETURN` the new list.
  4515. this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],
  4516. // Methods that change indices of this list should be listed here.
  4517. this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var o=!1;Mh(e)?(i=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(o=!0,i=e),i=i||["x","y"];for(var s={},l=[],u={},c=!1,d={},h=0;h<i.length;h++){
  4518. // Use the original dimensions[i], where other flag props may exists.
  4519. var p=i[h],f=t(p)?new _h({name:p}):p instanceof _h?p:new _h(p),g=f.name;f.type=f.type||"float",f.coordDim||(f.coordDim=g,f.coordDimIndex=0);var y=f.otherDims=f.otherDims||{};l.push(g),s[g]=f,null!=d[g]&&(c=!0),f.createInvertedIndices&&(u[g]=[]),0===y.itemName&&(this._nameDimIdx=h),0===y.itemId&&(this._idDimIdx=h),o&&(f.storeDimIndex=h)}if(this.dimensions=l,this._dimInfos=s,this._initGetDimensionInfo(c),this.hostModel=n,this._invertedIndicesMap=u,this._dimOmitted){var m=this._dimIdxToName=r();a(l,(function(t){m.set(s[t].storeDimIndex,t)}))}}
  4520. /**
  4521. *
  4522. * Get concrete dimension name by dimension name or dimension index.
  4523. * If input a dimension name, do not validate whether the dimension name exits.
  4524. *
  4525. * @caution
  4526. * @param dim Must make sure the dimension is `SeriesDimensionLoose`.
  4527. * Because only those dimensions will have auto-generated dimension names if not
  4528. * have a user-specified name, and other dimensions will get a return of null/undefined.
  4529. *
  4530. * @notice Because of this reason, should better use `getDimensionIndex` instead, for examples:
  4531. * ```js
  4532. * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx);
  4533. * ```
  4534. *
  4535. * @return Concrete dim name.
  4536. */return e.prototype.getDimension=function(t){var e=this._recognizeDimIndex(t);if(null==e)return t;if(e=t,!this._dimOmitted)return this.dimensions[e];
  4537. // Retrieve from series dimension definition because it probably contains
  4538. // generated dimension name (like 'x', 'y').
  4539. var n=this._dimIdxToName.get(e);if(null!=n)return n;var i=this._schema.getSourceDimension(e);return i?i.name:void 0},
  4540. /**
  4541. * Get dimension index in data store. Return -1 if not found.
  4542. * Can be used to index value from getRawValue.
  4543. */
  4544. e.prototype.getDimensionIndex=function(t){var e=this._recognizeDimIndex(t);if(null!=e)return e;if(null==t)return-1;var n=this._getDimInfo(t);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(t):-1},
  4545. /**
  4546. * The meanings of the input parameter `dim`:
  4547. *
  4548. * + If dim is a number (e.g., `1`), it means the index of the dimension.
  4549. * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.
  4550. * + If dim is a number-like string (e.g., `"1"`):
  4551. * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`,
  4552. * it means that concrete name.
  4553. * + If not, it will be converted to a number, which means the index of the dimension.
  4554. * (why? because of the backward compatibility. We have been tolerating number-like string in
  4555. * dimension setting, although now it seems that it is not a good idea.)
  4556. * For example, `visualMap[i].dimension: "1"` is the same meaning as `visualMap[i].dimension: 1`,
  4557. * if no dimension name is defined as `"1"`.
  4558. * + If dim is a not-number-like string, it means the concrete dim name.
  4559. * For example, it can be be default name `"x"`, `"y"`, `"z"`, `"lng"`, `"lat"`, `"angle"`, `"radius"`,
  4560. * or customized in `dimensions` property of option like `"age"`.
  4561. *
  4562. * @return recognized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`).
  4563. */
  4564. e.prototype._recognizeDimIndex=function(t){if(l(t)||null!=t&&!isNaN(t)&&!this._getDimInfo(t)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(t)<0))return+t},e.prototype._getStoreDimIndex=function(t){return this.getDimensionIndex(t)},
  4565. /**
  4566. * Get type and calculation info of particular dimension
  4567. * @param dim
  4568. * Dimension can be concrete names like x, y, z, lng, lat, angle, radius
  4569. * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'
  4570. */
  4571. e.prototype.getDimensionInfo=function(t){
  4572. // Do not clone, because there may be categories in dimInfo.
  4573. return this._getDimInfo(this.getDimension(t))},e.prototype._initGetDimensionInfo=function(t){var e=this._dimInfos;this._getDimInfo=t?function(t){return e.hasOwnProperty(t)?e[t]:void 0}:function(t){return e[t]}},
  4574. /**
  4575. * concrete dimension name list on coord.
  4576. */
  4577. e.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},e.prototype.mapDimension=function(t,e){var n=this._dimSummary;if(null==e)return n.encodeFirstDimNotExtra[t];var i=n.encode[t];return i?i[e]:null},e.prototype.mapDimensionsAll=function(t){return(this._dimSummary.encode[t]||[]).slice()},e.prototype.getStore=function(){return this._store},
  4578. /**
  4579. * Initialize from data
  4580. * @param data source or data or data store.
  4581. * @param nameList The name of a datum is used on data diff and
  4582. * default label/tooltip.
  4583. * A name can be specified in encode.itemName,
  4584. * or dataItem.name (only for series option data),
  4585. * or provided in nameList from outside.
  4586. */
  4587. e.prototype.initData=function(t,e,i){var o,s=this;if(t instanceof Hl&&(o=t),!o){var l=this.dimensions,u=Zs(t)||m(t)?new Qs(t,l.length):t;o=new Hl;var c=Eh(l,(function(t){return{type:s._dimInfos[t].type,property:t}}));o.initData(u,c,i)}this._store=o,
  4588. // Reset
  4589. this._nameList=(e||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,o.count()),
  4590. // Cache summary info for fast visit. See "dimensionHelper".
  4591. // Needs to be initialized after store is prepared.
  4592. this._dimSummary=function(t,e){var i={},o=i.encode={},s=r(),l=[],u=[],c={};a(t.dimensions,(function(e){var n,i=t.getDimensionInfo(e),r=i.coordDim;if(r){var a=i.coordDimIndex;vh(o,r)[a]=e,i.isExtraCoord||(s.set(r,1),
  4593. // Use the last coord dim (and label friendly) as default label,
  4594. // because when dataset is used, it is hard to guess which dimension
  4595. // can be value dimension. If both show x, y on label is not look good,
  4596. // and conventionally y axis is focused more.
  4597. "ordinal"!==(n=i.type)&&"time"!==n&&(l[0]=e),
  4598. // User output encode do not contain generated coords.
  4599. // And it only has index. User can use index to retrieve value from the raw item array.
  4600. vh(c,r)[a]=t.getDimensionIndex(i.name)),i.defaultTooltip&&u.push(e)}ka.each((function(t,e){var n=vh(o,e),r=i.otherDims[e];null!=r&&!1!==r&&(n[r]=i.name)}))}));var d=[],h={};s.each((function(t,e){var n=o[e];h[e]=n[0],
  4601. // Not necessary to remove duplicate, because a data
  4602. // dim canot on more than one coordDim.
  4603. d=d.concat(n)})),i.dataDimsOnCoord=d,i.dataDimIndicesOnCoord=n(d,(function(e){return t.getDimensionInfo(e).storeDimIndex})),i.encodeFirstDimNotExtra=h;var p=o.label;
  4604. // FIXME `encode.label` is not recommended, because formatter cannot be set
  4605. // in this way. Use label.formatter instead. Maybe remove this approach someday.
  4606. p&&p.length&&(l=p.slice());var f=o.tooltip;return f&&f.length?u=f.slice():u.length||(u=l.slice()),o.defaultedLabel=l,o.defaultedTooltip=u,i.userOutput=new mh(c,e),i}(this,this._schema),this.userOutput=this._dimSummary.userOutput},
  4607. /**
  4608. * Caution: Can be only called on raw data (before `this._indices` created).
  4609. */
  4610. e.prototype.appendData=function(t){var e=this._store.appendData(t);this._doInit(e[0],e[1])},
  4611. /**
  4612. * Caution: Can be only called on raw data (before `this._indices` created).
  4613. * This method does not modify `rawData` (`dataProvider`), but only
  4614. * add values to store.
  4615. *
  4616. * The final count will be increased by `Math.max(values.length, names.length)`.
  4617. *
  4618. * @param values That is the SourceType: 'arrayRows', like
  4619. * [
  4620. * [12, 33, 44],
  4621. * [NaN, 43, 1],
  4622. * ['-', 'asdf', 0]
  4623. * ]
  4624. * Each item is exactly corresponding to a dimension.
  4625. */
  4626. e.prototype.appendValues=function(t,e){var n=this._store.appendValues(t,e&&e.length),i=n.start,o=n.end,r=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),e)for(var a=i;a<o;a++){var s=a-i;this._nameList[a]=e[s],r&&Oh(this,a)}},e.prototype._updateOrdinalMeta=function(){for(var t=this._store,e=this.dimensions,n=0;n<e.length;n++){var i=this._dimInfos[e[n]];i.ordinalMeta&&t.collectOrdinalMeta(i.storeDimIndex,i.ordinalMeta)}},e.prototype._shouldMakeIdFromName=function(){var t=this._store.getProvider();return null==this._idDimIdx&&t.getSource().sourceFormat!==Ea&&!t.fillStorage},e.prototype._doInit=function(t,e){if(!(t>=e)){var n=this._store.getProvider();this._updateOrdinalMeta();var i=this._nameList,o=this._idList;
  4627. // Each data item is value
  4628. // [1, 2]
  4629. // 2
  4630. // Bar chart, line chart which uses category axis
  4631. // only gives the 'y' value. 'x' value is the indices of category
  4632. // Use a tempValue to normalize the value to be a (x, y) value
  4633. // If dataItem is {name: ...} or {id: ...}, it has highest priority.
  4634. // This kind of ids and names are always stored `_nameList` and `_idList`.
  4635. if(n.getSource().sourceFormat===Pa&&!n.pure)for(var r=[],a=t;a<e;a++){
  4636. // NOTICE: Try not to write things into dataItem
  4637. var s=n.getItem(a,r);if(!this.hasItemOption&&Dn(s)&&(this.hasItemOption=!0),s){var l=s.name;null==i[a]&&null!=l&&(i[a]=Ln(l,null));var u=s.id;null==o[a]&&null!=u&&(o[a]=Ln(u,null))}}if(this._shouldMakeIdFromName())for(a=t;a<e;a++)Oh(this,a);Ch(this)}},
  4638. /**
  4639. * PENDING: In fact currently this function is only used to short-circuit
  4640. * the calling of `scale.unionExtentFromData` when data have been filtered by modules
  4641. * like "dataZoom". `scale.unionExtentFromData` is used to calculate data extent for series on
  4642. * an axis, but if a "axis related data filter module" is used, the extent of the axis have
  4643. * been fixed and no need to calling `scale.unionExtentFromData` actually.
  4644. * But if we add "custom data filter" in future, which is not "axis related", this method may
  4645. * be still needed.
  4646. *
  4647. * Optimize for the scenario that data is filtered by a given extent.
  4648. * Consider that if data amount is more than hundreds of thousand,
  4649. * extent calculation will cost more than 10ms and the cache will
  4650. * be erased because of the filtering.
  4651. */
  4652. e.prototype.getApproximateExtent=function(t){return this._approximateExtent[t]||this._store.getDataExtent(this._getStoreDimIndex(t))},
  4653. /**
  4654. * Calculate extent on a filtered data might be time consuming.
  4655. * Approximate extent is only used for: calculate extent of filtered data outside.
  4656. */
  4657. e.prototype.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},e.prototype.getCalculationInfo=function(t){return this._calculationInfo[t]},e.prototype.setCalculationInfo=function(t,e){Rh(t)?p(this._calculationInfo,t):this._calculationInfo[t]=e},
  4658. /**
  4659. * @return Never be null/undefined. `number` will be converted to string. Because:
  4660. * In most cases, name is used in display, where returning a string is more convenient.
  4661. * In other cases, name is used in query (see `indexOfName`), where we can keep the
  4662. * rule that name `2` equals to name `'2'`.
  4663. */
  4664. e.prototype.getName=function(t){var e=this.getRawIndex(t),n=this._nameList[e];return null==n&&null!=this._nameDimIdx&&(n=Lh(this,this._nameDimIdx,e)),null==n&&(n=""),n},e.prototype._getCategory=function(t,e){var n=this._store.get(t,e),i=this._store.getOrdinalMeta(t);return i?i.categories[n]:n},
  4665. /**
  4666. * @return Never null/undefined. `number` will be converted to string. Because:
  4667. * In all cases having encountered at present, id is used in making diff comparison, which
  4668. * are usually based on hash map. We can keep the rule that the internal id are always string
  4669. * (treat `2` is the same as `'2'`) to make the related logic simple.
  4670. */
  4671. e.prototype.getId=function(t){return Ah(this,this.getRawIndex(t))},e.prototype.count=function(){return this._store.count()},
  4672. /**
  4673. * Get value. Return NaN if idx is out of range.
  4674. *
  4675. * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead.
  4676. */
  4677. e.prototype.get=function(t,e){var n=this._store,i=this._dimInfos[t];if(i)return n.get(i.storeDimIndex,e)},
  4678. /**
  4679. * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead.
  4680. */
  4681. e.prototype.getByRawIndex=function(t,e){var n=this._store,i=this._dimInfos[t];if(i)return n.getByRawIndex(i.storeDimIndex,e)},e.prototype.getIndices=function(){return this._store.getIndices()},e.prototype.getDataExtent=function(t){return this._store.getDataExtent(this._getStoreDimIndex(t))},e.prototype.getSum=function(t){return this._store.getSum(this._getStoreDimIndex(t))},e.prototype.getMedian=function(t){return this._store.getMedian(this._getStoreDimIndex(t))},e.prototype.getValues=function(t,e){var n=this,o=this._store;return i(t)?o.getValues(Eh(t,(function(t){return n._getStoreDimIndex(t)})),e):o.getValues(t)},
  4682. /**
  4683. * If value is NaN. Including '-'
  4684. * Only check the coord dimensions.
  4685. */
  4686. e.prototype.hasValue=function(t){for(var e=this._dimSummary.dataDimIndicesOnCoord,n=0,i=e.length;n<i;n++)
  4687. // Ordinal type originally can be string or number.
  4688. // But when an ordinal type is used on coord, it can
  4689. // not be string but only number. So we can also use isNaN.
  4690. if(isNaN(this._store.get(e[n],t)))return!1;return!0},
  4691. /**
  4692. * Retrieve the index with given name
  4693. */
  4694. e.prototype.indexOfName=function(t){for(var e=0,n=this._store.count();e<n;e++)if(this.getName(e)===t)return e;return-1},e.prototype.getRawIndex=function(t){return this._store.getRawIndex(t)},e.prototype.indexOfRawIndex=function(t){return this._store.indexOfRawIndex(t)},
  4695. /**
  4696. * Only support the dimension which inverted index created.
  4697. * Do not support other cases until required.
  4698. * @param dim concrete dim
  4699. * @param value ordinal index
  4700. * @return rawIndex
  4701. */
  4702. e.prototype.rawIndexOf=function(t,e){var n=t&&this._invertedIndicesMap[t],i=n&&n[e];return null==i||isNaN(i)?-1:i},
  4703. /**
  4704. * Retrieve the index of nearest value
  4705. * @param dim
  4706. * @param value
  4707. * @param [maxDistance=Infinity]
  4708. * @return If and only if multiple indices has
  4709. * the same value, they are put to the result.
  4710. */
  4711. e.prototype.indicesOfNearest=function(t,e,n){return this._store.indicesOfNearest(this._getStoreDimIndex(t),e,n)},e.prototype.each=function(t,e,n){f(t)&&(n=e,e=t,t=[]);
  4712. // ctxCompat just for compat echarts3
  4713. var i=n||this,o=Eh(kh(t),this._getStoreDimIndex,this);this._store.each(o,i?lt(e,i):e)},e.prototype.filterSelf=function(t,e,n){f(t)&&(n=e,e=t,t=[]);
  4714. // ctxCompat just for compat echarts3
  4715. var i=n||this,o=Eh(kh(t),this._getStoreDimIndex,this);return this._store=this._store.filter(o,i?lt(e,i):e),this},
  4716. /**
  4717. * Select data in range. (For optimization of filter)
  4718. * (Manually inline code, support 5 million data filtering in data zoom.)
  4719. */
  4720. e.prototype.selectRange=function(t){var e=this,n={},i=v(t);return a(i,(function(i){var o=e._getStoreDimIndex(i);n[o]=t[i]})),this._store=this._store.selectRange(n),this},
  4721. /* eslint-enable max-len */
  4722. e.prototype.mapArray=function(t,e,n){f(t)&&(n=e,e=t,t=[]),
  4723. // ctxCompat just for compat echarts3
  4724. n=n||this;var i=[];return this.each(t,(function(){i.push(e&&e.apply(this,arguments))}),n),i},e.prototype.map=function(t,e,n,i){
  4725. // ctxCompat just for compat echarts3
  4726. var o=n||i||this,r=Eh(kh(t),this._getStoreDimIndex,this),a=Nh(this);return a._store=this._store.map(r,o?lt(e,o):e),a},e.prototype.modify=function(t,e,n,i){
  4727. // ctxCompat just for compat echarts3
  4728. var o=n||i||this,r=Eh(kh(t),this._getStoreDimIndex,this);
  4729. // If do shallow clone here, if there are too many stacked series,
  4730. // it still cost lots of memory, because `_store.dimensions` are not shared.
  4731. // We should consider there probably be shallow clone happen in each series
  4732. // in consequent filter/map.
  4733. this._store.modify(r,o?lt(e,o):e)},
  4734. /**
  4735. * Large data down sampling on given dimension
  4736. * @param sampleIndex Sample index for name and id
  4737. */
  4738. e.prototype.downSample=function(t,e,n,i){var o=Nh(this);return o._store=this._store.downSample(this._getStoreDimIndex(t),e,n,i),o},
  4739. /**
  4740. * Large data down sampling using min-max
  4741. * @param {string} valueDimension
  4742. * @param {number} rate
  4743. */
  4744. e.prototype.minmaxDownSample=function(t,e){var n=Nh(this);return n._store=this._store.minmaxDownSample(this._getStoreDimIndex(t),e),n},
  4745. /**
  4746. * Large data down sampling using largest-triangle-three-buckets
  4747. * @param {string} valueDimension
  4748. * @param {number} targetCount
  4749. */
  4750. e.prototype.lttbDownSample=function(t,e){var n=Nh(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(t),e),n},e.prototype.getRawDataItem=function(t){return this._store.getRawDataItem(t)},
  4751. /**
  4752. * Get model of one data item.
  4753. */
  4754. // TODO: Type of data item
  4755. e.prototype.getItemModel=function(t){var e=this.hostModel,n=this.getRawDataItem(t);return new yr(n,e,e&&e.ecModel)},
  4756. /**
  4757. * Create a data differ
  4758. */
  4759. e.prototype.diff=function(t){var e=this;return new yh(t?t.getStore().getIndices():[],this.getStore().getIndices(),(function(e){return Ah(t,e)}),(function(t){return Ah(e,t)}))},
  4760. /**
  4761. * Get visual property.
  4762. */
  4763. e.prototype.getVisual=function(t){var e=this._visual;return e&&e[t]},e.prototype.setVisual=function(t,e){this._visual=this._visual||{},Rh(t)?p(this._visual,t):this._visual[t]=e},
  4764. /**
  4765. * Get visual property of single data item
  4766. */
  4767. // eslint-disable-next-line
  4768. e.prototype.getItemVisual=function(t,e){var n=this._itemVisuals[t],i=n&&n[e];return null==i?this.getVisual(e):i},
  4769. /**
  4770. * If exists visual property of single data item
  4771. */
  4772. e.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},
  4773. /**
  4774. * Make sure itemVisual property is unique
  4775. */
  4776. // TODO: use key to save visual to reduce memory.
  4777. e.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,o=n[t];o||(o=n[t]={});var r=o[e];return null==r&&(r=this.getVisual(e),
  4778. // TODO Performance?
  4779. i(r)?r=r.slice():Rh(r)&&(r=p({},r)),o[e]=r),r},
  4780. // eslint-disable-next-line
  4781. e.prototype.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,Rh(e)?p(i,e):i[e]=n},
  4782. /**
  4783. * Clear itemVisuals and list visual.
  4784. */
  4785. e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(t,e){Rh(t)?p(this._layout,t):this._layout[t]=e},
  4786. /**
  4787. * Get layout property.
  4788. */
  4789. e.prototype.getLayout=function(t){return this._layout[t]},
  4790. /**
  4791. * Get layout of single data item
  4792. */
  4793. e.prototype.getItemLayout=function(t){return this._itemLayouts[t]},
  4794. /**
  4795. * Set layout of single data item
  4796. */
  4797. e.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?p(this._itemLayouts[t]||{},e):e},
  4798. /**
  4799. * Clear all layout of single data item
  4800. */
  4801. e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},
  4802. /**
  4803. * Set graphic element relative to data. It can be set as null
  4804. */
  4805. e.prototype.setItemGraphicEl=function(t,e){var n=this.hostModel&&this.hostModel.seriesIndex;ii(n,this.dataType,t,e),this._graphicEls[t]=e},e.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},e.prototype.eachItemGraphicEl=function(t,e){a(this._graphicEls,(function(n,i){n&&t&&t.call(e,n,i)}))},
  4806. /**
  4807. * Shallow clone a new list except visual and layout properties, and graph elements.
  4808. * New list only change the indices.
  4809. */
  4810. e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:Eh(this.dimensions,this._getDimInfo,this),this.hostModel)),Ph(t,this),t._store=this._store,t},
  4811. /**
  4812. * Wrap some method to add more feature
  4813. */
  4814. e.prototype.wrapMethod=function(t,e){var n=this[t];f(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(wt(arguments)))})},
  4815. // ----------------------------------------------------------
  4816. // A work around for internal method visiting private member.
  4817. // ----------------------------------------------------------
  4818. e.internalField=(Ch=function(t){var e=t._invertedIndicesMap;a(e,(function(n,i){var o=t._dimInfos[i],r=o.ordinalMeta,a=t._store;
  4819. // Currently, only dimensions that has ordinalMeta can create inverted indices.
  4820. if(r){n=e[i]=new Vh(r.categories.length);
  4821. // The default value of TypedArray is 0. To avoid miss
  4822. // mapping to 0, we should set it as INDEX_NOT_FOUND.
  4823. for(var s=0;s<n.length;s++)n[s]=-1;for(s=0;s<a.count();s++)
  4824. // Only support the case that all values are distinct.
  4825. n[a.get(o.storeDimIndex,s)]=s}}))},Lh=function(t,e,n){return Ln(t._getCategory(e,n),null)},
  4826. /**
  4827. * @see the comment of `List['getId']`.
  4828. */
  4829. Ah=function(t,e){var n=t._idList[e];return null==n&&null!=t._idDimIdx&&(n=Lh(t,t._idDimIdx,e)),null==n&&(n="e\0\0"+e),n},kh=function(t){return i(t)||(t=null!=t?[t]:[]),t},
  4830. /**
  4831. * Data in excludeDimensions is copied, otherwise transferred.
  4832. */
  4833. Nh=function(t){var n=new e(t._schema?t._schema:Eh(t.dimensions,t._getDimInfo,t),t.hostModel);
  4834. // FIXME If needs stackedOn, value may already been stacked
  4835. return Ph(n,t),n},Ph=function(t,e){a(zh.concat(e.__wrappedMethods||[]),(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t.__wrappedMethods=e.__wrappedMethods,a(Bh,(function(n){t[n]=et(e[n])})),t._calculationInfo=p({},e._calculationInfo)},void(Oh=function(t,e){var n=t._nameList,i=t._idList,o=t._nameDimIdx,r=t._idDimIdx,a=n[e],s=i[e];if(null==a&&null!=o&&(n[e]=a=Lh(t,o,e)),null==s&&null!=r&&(i[e]=s=Lh(t,r,e)),null==s&&null!=a){var l=t._nameRepeatCount,u=l[a]=(l[a]||0)+1;s=a,u>1&&(s+="__ec__"+u),i[e]=s}})),e}();const Fh=Gh;
  4836. /**
  4837. * For outside usage compat (like echarts-gl are using it).
  4838. */function Wh(t,e){return Hh(t,e).dimensions}
  4839. /**
  4840. * This method builds the relationship between:
  4841. * + "what the coord sys or series requires (see `coordDimensions`)",
  4842. * + "what the user defines (in `encode` and `dimensions`, see `opt.dimensionsDefine` and `opt.encodeDefine`)"
  4843. * + "what the data source provids (see `source`)".
  4844. *
  4845. * Some guess strategy will be adapted if user does not define something.
  4846. * If no 'value' dimension specified, the first no-named dimension will be
  4847. * named as 'value'.
  4848. *
  4849. * @return The results are always sorted by `storeDimIndex` asc.
  4850. */function Hh(
  4851. // TODO: TYPE completeDimensions type
  4852. e,n){Zs(e)||(e=js(e));var i=(n=n||{}).coordDimensions||[],s=n.dimensionsDefine||e.dimensionsDefine||[],l=r(),u=[],c=
  4853. // ??? TODO
  4854. // Originally detect dimCount by data[0]. Should we
  4855. // optimize it to only by sysDims and dimensions and encode.
  4856. // So only necessary dims will be initialized.
  4857. // But
  4858. // (1) custom series should be considered. where other dims
  4859. // may be visited.
  4860. // (2) sometimes user need to calculate bubble size or use visualMap
  4861. // on other dimensions besides coordSys needed.
  4862. // So, dims that is not used by system, should be shared in data store?
  4863. function(t,e,n,i){
  4864. // Note that the result dimCount should not small than columns count
  4865. // of data, otherwise `dataDimNameMap` checking will be incorrect.
  4866. var r=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,i||0);return a(e,(function(t){var e;o(t)&&(e=t.dimsDef)&&(r=Math.max(r,e.length))})),r}(e,i,s,n.dimensionsCount),d=n.canOmitUnusedDimensions&&Th(c),h=s===e.dimensionsDefine,f=h?Dh(e):Ih(s),g=n.encodeDefine;!g&&n.encodeDefaulter&&(g=n.encodeDefaulter(e,c));for(var y=r(g),m=new Vl(c),v=0;v<m.length;v++)m[v]=-1;function x(t){var e=m[t];if(e<0){var n=s[t],i=o(n)?n:{name:n},r=new _h,a=i.name;null!=a&&null!=f.get(a)&&(
  4867. // Only if `series.dimensions` is defined in option
  4868. // displayName, will be set, and dimension will be displayed vertically in
  4869. // tooltip by default.
  4870. r.name=r.displayName=a),null!=i.type&&(r.type=i.type),null!=i.displayName&&(r.displayName=i.displayName);var l=u.length;return m[t]=l,r.storeDimIndex=t,u.push(r),r}return u[e]}if(!d)for(v=0;v<c;v++)x(v);
  4871. // Set `coordDim` and `coordDimIndex` by `encodeDefMap` and normalize `encodeDefMap`.
  4872. y.each((function(e,n){var i=Sn(e).slice();
  4873. // Note: It is allowed that `dataDims.length` is `0`, e.g., options is
  4874. // `{encode: {x: -1, y: 1}}`. Should not filter anything in
  4875. // this case.
  4876. if(1===i.length&&!t(i[0])&&i[0]<0)y.set(n,!1);else{var o=y.set(n,[]);a(i,(function(e,i){
  4877. // The input resultDimIdx can be dim name or index.
  4878. var r=t(e)?f.get(e):e;null!=r&&r<c&&(o[i]=r,b(x(r),n,i))}))}}));
  4879. // Apply templates and default order from `sysDims`.
  4880. var _=0;function b(t,e,n){null!=ka.get(e)?t.otherDims[e]=n:(t.coordDim=e,t.coordDimIndex=n,l.set(e,!0))}
  4881. // Make sure the first extra dim is 'value'.
  4882. a(i,(function(e){var n,i,r,s;if(t(e))n=e,s={};else{n=(s=e).name;var l=s.ordinalMeta;s.ordinalMeta=null,(s=p({},s)).ordinalMeta=l,
  4883. // `coordDimIndex` should not be set directly.
  4884. i=s.dimsDef,r=s.otherDims,s.name=s.coordDim=s.coordDimIndex=s.dimsDef=s.otherDims=null}var u=y.get(n);
  4885. // negative resultDimIdx means no need to mapping.
  4886. if(!1!==u){
  4887. // dimensions provides default dim sequences.
  4888. if(!(u=Sn(u)).length)for(var d=0;d<(i&&i.length||1);d++){for(;_<c&&null!=x(_).coordDim;)_++;_<c&&u.push(_++)}
  4889. // Apply templates.
  4890. a(u,(function(t,e){var a=x(t);
  4891. // Coordinate system has a higher priority on dim type than source.
  4892. if(h&&null!=s.type&&(a.type=s.type),b(I(a,s),n,e),null==a.name&&i){var l=i[e];!o(l)&&(l={name:l}),a.name=a.displayName=l.name,a.defaultTooltip=l.defaultTooltip}
  4893. // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}}
  4894. r&&I(a.otherDims,r)}))}}));var S=n.generateCoord,w=n.generateCoordCount,M=null!=w;w=S?w||1:0;var D=S||"value";function T(t){null==t.name&&(
  4895. // Duplication will be removed in the next step.
  4896. t.name=t.coordDim)}
  4897. // Set dim `name` and other `coordDim` and other props.
  4898. if(d)a(u,(function(t){
  4899. // PENDING: guessOrdinal or let user specify type: 'ordinal' manually?
  4900. T(t)})),
  4901. // Sort dimensions: there are some rule that use the last dim as label,
  4902. // and for some latter travel process easier.
  4903. u.sort((function(t,e){return t.storeDimIndex-e.storeDimIndex}));else for(var C=0;C<c;C++){var A=x(C);null==A.coordDim&&(
  4904. // TODO no need to generate coordDim for isExtraCoord?
  4905. A.coordDim=Yh(D,l,M),A.coordDimIndex=0,
  4906. // Series specified generateCoord is using out.
  4907. (!S||w<=0)&&(A.isExtraCoord=!0),w--),T(A),null!=A.type||Xa(e,C)!==Ga&&(!A.isExtraCoord||null==A.otherDims.itemName&&null==A.otherDims.seriesName)||(A.type="ordinal")}return function(t){for(var e=r(),n=0;n<t.length;n++){var i=t[n],o=i.name,a=e.get(o)||0;a>0&&(
  4908. // Starts from 0.
  4909. i.name=o+(a-1)),a++,e.set(o,a)}}(u),new wh({source:e,dimensions:u,fullDimensionCount:c,dimensionOmitted:d})}function Yh(t,e,n){if(n||e.hasKey(t)){for(var i=0;e.hasKey(t+i);)i++;t+=i}return e.set(t,!0),t}
  4910. /**
  4911. * @class
  4912. * For example:
  4913. * {
  4914. * coordSysName: 'cartesian2d',
  4915. * coordSysDims: ['x', 'y', ...],
  4916. * axisMap: HashMap({
  4917. * x: xAxisModel,
  4918. * y: yAxisModel
  4919. * }),
  4920. * categoryAxisMap: HashMap({
  4921. * x: xAxisModel,
  4922. * y: undefined
  4923. * }),
  4924. * // The index of the first category axis in `coordSysDims`.
  4925. * // `null/undefined` means no category axis exists.
  4926. * firstCategoryDimIndex: 1,
  4927. * // To replace user specified encode.
  4928. * }
  4929. */var Uh=function(t){this.coordSysDims=[],this.axisMap=r(),this.categoryAxisMap=r(),this.coordSysName=t};var Zh={cartesian2d:function(t,e,n,i){var o=t.getReferringComponents("xAxis",zn).models[0],r=t.getReferringComponents("yAxis",zn).models[0];e.coordSysDims=["x","y"],n.set("x",o),n.set("y",r),Xh(o)&&(i.set("x",o),e.firstCategoryDimIndex=0),Xh(r)&&(i.set("y",r),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,n,i){var o=t.getReferringComponents("singleAxis",zn).models[0];e.coordSysDims=["single"],n.set("single",o),Xh(o)&&(i.set("single",o),e.firstCategoryDimIndex=0)},polar:function(t,e,n,i){var o=t.getReferringComponents("polar",zn).models[0],r=o.findAxisModel("radiusAxis"),a=o.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],n.set("radius",r),n.set("angle",a),Xh(r)&&(i.set("radius",r),e.firstCategoryDimIndex=0),Xh(a)&&(i.set("angle",a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,n,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,i){var o=t.ecModel,r=o.getComponent("parallel",t.get("parallelIndex")),s=e.coordSysDims=r.dimensions.slice();a(r.parallelAxisIndex,(function(t,r){var a=o.getComponent("parallelAxis",t),l=s[r];n.set(l,a),Xh(a)&&(i.set(l,a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=r))}))}};function Xh(t){return"category"===t.get("type")}
  4930. /**
  4931. * Note that it is too complicated to support 3d stack by value
  4932. * (have to create two-dimension inverted index), so in 3d case
  4933. * we just support that stacked by index.
  4934. *
  4935. * @param seriesModel
  4936. * @param dimensionsInput The same as the input of <module:echarts/data/SeriesData>.
  4937. * The input will be modified.
  4938. * @param opt
  4939. * @param opt.stackedCoordDimension Specify a coord dimension if needed.
  4940. * @param opt.byIndex=false
  4941. * @return calculationInfo
  4942. * {
  4943. * stackedDimension: string
  4944. * stackedByDimension: string
  4945. * isStackedByIndex: boolean
  4946. * stackedOverDimension: string
  4947. * stackResultDimension: string
  4948. * }
  4949. */function jh(e,n,i){var o,r,s,l=(i=i||{}).byIndex,u=i.stackedCoordDimension;!function(t){return!Mh(t.schema)}(n)?(r=n.schema,o=r.dimensions,s=n.store):o=n;
  4950. // Compatibal: when `stack` is set as '', do not stack.
  4951. var c,d,h,p,f=!(!e||!e.get("stack"));
  4952. // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`.
  4953. // That put stack logic in List is for using conveniently in echarts extensions, but it
  4954. // might not be a good way.
  4955. if(a(o,(function(e,n){t(e)&&(o[n]=e={name:e}),f&&!e.isExtraCoord&&(
  4956. // Find the first ordinal dimension as the stackedByDimInfo.
  4957. l||c||!e.ordinalMeta||(c=e),
  4958. // Find the first stackable dimension as the stackedDimInfo.
  4959. d||"ordinal"===e.type||"time"===e.type||u&&u!==e.coordDim||(d=e))})),!d||l||c||(
  4960. // Compatible with previous design, value axis (time axis) only stack by index.
  4961. // It may make sense if the user provides elaborately constructed data.
  4962. l=!0),d){
  4963. // Use a weird name that not duplicated with other names.
  4964. // Also need to use seriesModel.id as postfix because different
  4965. // series may share same data store. The stack dimension needs to be distinguished.
  4966. h="__\0ecstackresult_"+e.id,p="__\0ecstackedover_"+e.id,
  4967. // Create inverted index to fast query index by value.
  4968. c&&(c.createInvertedIndices=!0);var g=d.coordDim,y=d.type,m=0;a(o,(function(t){t.coordDim===g&&m++}));var v={name:h,coordDim:g,coordDimIndex:m,type:y,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:o.length},x={name:p,
  4969. // This dimension contains stack base (generally, 0), so do not set it as
  4970. // `stackedDimCoordDim` to avoid extent calculation, consider log scale.
  4971. coordDim:p,coordDimIndex:m+1,type:y,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:o.length+1};r?(s&&(v.storeDimIndex=s.ensureCalculationDimension(p,y),x.storeDimIndex=s.ensureCalculationDimension(h,y)),r.appendCalculationDimension(v),r.appendCalculationDimension(x)):(o.push(v),o.push(x))}return{stackedDimension:d&&d.name,stackedByDimension:c&&c.name,isStackedByIndex:l,stackedOverDimension:p,stackResultDimension:h}}function qh(t,e){
  4972. // Each single series only maps to one pair of axis. So we do not need to
  4973. // check stackByDim, whatever stacked by a dimension or stacked by index.
  4974. return!!e&&e===t.getCalculationInfo("stackedDimension")}function Kh(t,e){return qh(t,e)?t.getCalculationInfo("stackResultDimension"):e}
  4975. /**
  4976. * Caution: there are side effects to `sourceManager` in this method.
  4977. * Should better only be called in `Series['getInitialData']`.
  4978. */
  4979. function Jh(t,e,o){o=o||{};var r,s=e.getSourceManager(),l=!1;t?(l=!0,r=js(t)):
  4980. // Is series.data. not dataset.
  4981. l=(r=s.getSource()).sourceFormat===Pa;var u=function(t){var e=t.get("coordinateSystem"),n=new Uh(e),i=Zh[e];if(i)return i(t,n,n.axisMap,n.categoryAxisMap),n}(e),c=function(t,e){var i,o=t.get("coordinateSystem"),r=fs.get(o);return e&&e.coordSysDims&&(i=n(e.coordSysDims,(function(t){var n={name:t},i=e.axisMap.get(t);if(i){var o=i.get("type");n.type=xh(o)}return n}))),i||(
  4982. // Get dimensions from registered coordinate system
  4983. i=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]),i}(e,u),d=o.useEncodeDefaulter,h=f(d)?d:d?rt(Ya,c,e):null,p=Hh(r,{coordDimensions:c,generateCoord:o.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:h,canOmitUnusedDimensions:!l}),g=function(t,e,n){var i,o;return n&&a(t,(function(t,r){var a=t.coordDim,s=n.categoryAxisMap.get(a);s&&(null==i&&(i=r),t.ordinalMeta=s.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(o=!0)})),o||null==i||(t[i].otherDims.itemName=0),i}(p.dimensions,o.createInvertedIndices,u),y=l?null:s.getSharedDataStore(p),m=jh(e,{schema:p,store:y}),v=new Fh(p,e);v.setCalculationInfo(m);var x=null!=g&&function(t){if(t.sourceFormat===Pa){var e=function(t){var e=0;for(;e<t.length&&null==t[e];)e++;return t[e]}(t.data||[]);return!i(In(e))}}(r)?function(t,e,n,i){
  4984. // Use dataIndex as ordinal value in categoryAxis
  4985. return i===g?n:this.defaultDimValueGetter(t,e,n,i)}:null;return v.hasItemOption=!1,v.initData(
  4986. // Try to reuse the data store in sourceManager if using dataset.
  4987. l?r:y,null,x),v}var $h=/** @class */function(){function t(t){this._setting=t||{},this._extent=[Infinity,-Infinity]}return t.prototype.getSetting=function(t){return this._setting[t]},
  4988. /**
  4989. * Set extent from data
  4990. */
  4991. t.prototype.unionExtent=function(t){var e=this._extent;t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1])},
  4992. /**
  4993. * Set extent from data
  4994. */
  4995. t.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},
  4996. /**
  4997. * Get extent
  4998. *
  4999. * Extent is always in increase order.
  5000. */
  5001. t.prototype.getExtent=function(){return this._extent.slice()},
  5002. /**
  5003. * Set extent
  5004. */
  5005. t.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},
  5006. /**
  5007. * If value is in extent range
  5008. */
  5009. t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},
  5010. /**
  5011. * When axis extent depends on data and no data exists,
  5012. * axis ticks should not be drawn, which is named 'blank'.
  5013. */
  5014. t.prototype.isBlank=function(){return this._isBlank},
  5015. /**
  5016. * When axis extent depends on data and no data exists,
  5017. * axis ticks should not be drawn, which is named 'blank'.
  5018. */
  5019. t.prototype.setBlank=function(t){this._isBlank=t},t}();$n($h);const Qh=$h;var tp=0,ep=/** @class */function(){function e(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++tp}return e.createByAxisModel=function(t){var i=t.option,o=i.data,r=o&&n(o,np);return new e({categories:r,needCollect:!r,
  5020. // deduplication is default in axis.
  5021. deduplication:!1!==i.dedplication})},e.prototype.getOrdinal=function(t){
  5022. // @ts-ignore
  5023. return this._getOrCreateMap().get(t)},
  5024. /**
  5025. * @return The ordinal. If not found, return NaN.
  5026. */
  5027. e.prototype.parseAndCollect=function(e){var n,i=this._needCollect;
  5028. // The value of category dim can be the index of the given category set.
  5029. // This feature is only supported when !needCollect, because we should
  5030. // consider a common case: a value is 2017, which is a number but is
  5031. // expected to be tread as a category. This case usually happen in dataset,
  5032. // where it happent to be no need of the index feature.
  5033. if(!t(e)&&!i)return e;
  5034. // Optimize for the scenario:
  5035. // category is ['2012-01-01', '2012-01-02', ...], where the input
  5036. // data has been ensured not duplicate and is large data.
  5037. // Notice, if a dataset dimension provide categroies, usually echarts
  5038. // should remove duplication except user tell echarts dont do that
  5039. // (set axis.deduplication = false), because echarts do not know whether
  5040. // the values in the category dimension has duplication (consider the
  5041. // parallel-aqi example)
  5042. if(i&&!this._deduplication)return n=this.categories.length,this.categories[n]=e,n;var o=this._getOrCreateMap();
  5043. // @ts-ignore
  5044. return null==(n=o.get(e))&&(i?(n=this.categories.length,this.categories[n]=e,
  5045. // @ts-ignore
  5046. o.set(e,n)):n=NaN),n},
  5047. // Consider big data, do not create map until needed.
  5048. e.prototype._getOrCreateMap=function(){return this._map||(this._map=r(this.categories))},e}();function np(t){return o(t)&&null!=t.value?t.value:t+""}const ip=ep;function op(t){return"interval"===t.type||"log"===t.type}
  5049. /**
  5050. * @param extent Both extent[0] and extent[1] should be valid number.
  5051. * Should be extent[0] < extent[1].
  5052. * @param splitNumber splitNumber should be >= 1.
  5053. */function rp(t,e,n,i){var o={},r=t[1]-t[0],a=o.interval=cn(r/e,!0);null!=n&&a<n&&(a=o.interval=n),null!=i&&a>i&&(a=o.interval=i);
  5054. // Tow more digital for tick.
  5055. var s=o.intervalPrecision=sp(a);
  5056. // Niced extent inside original extent
  5057. // In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent.
  5058. return function(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),lp(t,0,e),lp(t,1,e),t[0]>t[1]&&(t[0]=t[1])}(o.niceTickExtent=[qe(Math.ceil(t[0]/a)*a,s),qe(Math.floor(t[1]/a)*a,s)],t),o}function ap(t){var e=Math.pow(10,un(t)),n=t/e;
  5059. // Increase interval
  5060. return n?2===n?n=3:3===n?n=5:
  5061. // f is 1 or 5
  5062. n*=2:n=1,qe(n*e)}
  5063. /**
  5064. * @return interval precision
  5065. */function sp(t){
  5066. // Tow more digital for tick.
  5067. return Je(t)+2}function lp(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function up(t,e){return t>=e[0]&&t<=e[1]}function cp(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function dp(t,e){return t*(e[1]-e[0])+e[0]}var hp=/** @class */function(e){function r(t){var r=e.call(this,t)||this;r.type="ordinal";var a=r.getSetting("ordinalMeta");
  5068. // Caution: Should not use instanceof, consider ec-extensions using
  5069. // import approach to get OrdinalMeta class.
  5070. return a||(a=new ip({})),i(a)&&(a=new ip({categories:n(a,(function(t){return o(t)?t.value:t}))})),r._ordinalMeta=a,r._extent=r.getSetting("extent")||[0,a.categories.length-1],r}return Ue(r,e),r.prototype.parse=function(e){
  5071. // Caution: Math.round(null) will return `0` rather than `NaN`
  5072. return null==e?NaN:t(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},r.prototype.contain=function(t){return up(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},
  5073. /**
  5074. * Normalize given rank or name to linear [0, 1]
  5075. * @param val raw ordinal number.
  5076. * @return normalized value in [0, 1].
  5077. */
  5078. r.prototype.normalize=function(t){return cp(t=this._getTickNumber(this.parse(t)),this._extent)},
  5079. /**
  5080. * @param val normalized value in [0, 1].
  5081. * @return raw ordinal number.
  5082. */
  5083. r.prototype.scale=function(t){return t=Math.round(dp(t,this._extent)),this.getRawOrdinalNumber(t)},r.prototype.getTicks=function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push({value:n}),n++;return t},r.prototype.getMinorTicks=function(t){},
  5084. /**
  5085. * @see `Ordinal['_ordinalNumbersByTick']`
  5086. */
  5087. r.prototype.setSortInfo=function(t){if(null!=t){for(var e=t.ordinalNumbers,n=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],o=0,r=this._ordinalMeta.categories.length,a=Math.min(r,e.length);o<a;++o){var s=e[o];n[o]=s,i[s]=o}
  5088. // Handle that `series.data` only covers part of the `axis.category.data`.
  5089. for(var l=0;o<r;++o){for(;null!=i[l];)l++;n.push(l),i[l]=o}}else this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null},r.prototype._getTickNumber=function(t){var e=this._ticksByOrdinalNumber;
  5090. // also support ordinal out of range of `ordinalMeta.categories.length`,
  5091. // where ordinal numbers are used as tick value directly.
  5092. return e&&t>=0&&t<e.length?e[t]:t},
  5093. /**
  5094. * @usage
  5095. * ```js
  5096. * const ordinalNumber = ordinalScale.getRawOrdinalNumber(tickVal);
  5097. *
  5098. * // case0
  5099. * const rawOrdinalValue = axisModel.getCategories()[ordinalNumber];
  5100. * // case1
  5101. * const rawOrdinalValue = this._ordinalMeta.categories[ordinalNumber];
  5102. * // case2
  5103. * const coord = axis.dataToCoord(ordinalNumber);
  5104. * ```
  5105. *
  5106. * @param {OrdinalNumber} tickNumber index of display
  5107. */
  5108. r.prototype.getRawOrdinalNumber=function(t){var e=this._ordinalNumbersByTick;
  5109. // tickNumber may be out of range, e.g., when axis max is larger than `ordinalMeta.categories.length`.,
  5110. // where ordinal numbers are used as tick value directly.
  5111. return e&&t>=0&&t<e.length?e[t]:t},
  5112. /**
  5113. * Get item on tick
  5114. */
  5115. r.prototype.getLabel=function(t){if(!this.isBlank()){var e=this.getRawOrdinalNumber(t.value),n=this._ordinalMeta.categories[e];
  5116. // Note that if no data, ordinalMeta.categories is an empty array.
  5117. // Return empty if it's not exist.
  5118. return null==n?"":n+""}},r.prototype.count=function(){return this._extent[1]-this._extent[0]+1},r.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},
  5119. /**
  5120. * @override
  5121. * If value is in extent range
  5122. */
  5123. r.prototype.isInExtentRange=function(t){return t=this._getTickNumber(t),this._extent[0]<=t&&this._extent[1]>=t},r.prototype.getOrdinalMeta=function(){return this._ordinalMeta},r.prototype.calcNiceTicks=function(){},r.prototype.calcNiceExtent=function(){},r.type="ordinal",r}(Qh);Qh.registerClass(hp);const pp=hp;var fp=qe,gp=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",
  5124. // Step is calculated in adjustExtent.
  5125. e._interval=0,e._intervalPrecision=2,e}return Ue(e,t),e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return up(t,this._extent)},e.prototype.normalize=function(t){return cp(t,this._extent)},e.prototype.scale=function(t){return dp(t,this._extent)},e.prototype.setExtent=function(t,e){var n=this._extent;
  5126. // start,end may be a Number like '25',so...
  5127. isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},e.prototype.unionExtent=function(t){var e=this._extent;t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1]),
  5128. // unionExtent may called by it's sub classes
  5129. this.setExtent(e[0],e[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,
  5130. // Dropped auto calculated niceExtent and use user-set extent.
  5131. // We assume user wants to set both interval, min, max to get a better result.
  5132. this._niceExtent=this._extent.slice(),this._intervalPrecision=sp(t)},
  5133. /**
  5134. * @param expandToNicedExtent Whether expand the ticks to niced extent.
  5135. */
  5136. e.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,o=this._intervalPrecision,r=[];
  5137. // If interval is 0, return [];
  5138. if(!e)return r;
  5139. // Consider this case: using dataZoom toolbox, zoom and zoom.
  5140. n[0]<i[0]&&(t?r.push({value:fp(i[0]-e,o)}):r.push({value:n[0]}));for(var a=i[0];a<=i[1]&&(r.push({value:a}),(
  5141. // Avoid rounding error
  5142. a=fp(a+e,o))!==r[r.length-1].value);)if(r.length>1e4)return[];
  5143. // Consider this case: the last item of ticks is smaller
  5144. // than niceTickExtent[1] and niceTickExtent[1] === extent[1].
  5145. var s=r.length?r[r.length-1].value:i[1];return n[1]>s&&(t?r.push({value:fp(s+e,o)}):r.push({value:n[1]})),r},e.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),o=1;o<e.length;o++){for(var r=e[o],a=e[o-1],s=0,l=[],u=(r.value-a.value)/t;s<t-1;){var c=fp(a.value+(s+1)*u);
  5146. // For the first and last interval. The count may be less than splitNumber.
  5147. c>i[0]&&c<i[1]&&l.push(c),s++}n.push(l)}return n},
  5148. /**
  5149. * @param opt.precision If 'auto', use nice presision.
  5150. * @param opt.pad returns 1.50 but not 1.5 if precision is 2.
  5151. */
  5152. e.prototype.getLabel=function(t,e){if(null==t)return"";var n=e&&e.precision;return null==n?n=Je(t.value)||0:"auto"===n&&(
  5153. // Should be more precise then tick.
  5154. n=this._intervalPrecision),oa(fp(t.value,n,!0))},
  5155. /**
  5156. * @param splitNumber By default `5`.
  5157. */
  5158. e.prototype.calcNiceTicks=function(t,e,n){t=t||5;var i=this._extent,o=i[1]-i[0];if(isFinite(o)){
  5159. // User may set axis min 0 and data are all negative
  5160. // FIXME If it needs to reverse ?
  5161. o<0&&(o=-o,i.reverse());var r=rp(i,t,e,n);this._intervalPrecision=r.intervalPrecision,this._interval=r.interval,this._niceExtent=r.niceTickExtent}},e.prototype.calcNiceExtent=function(t){var e=this._extent;
  5162. // If extent start and end are same, expand them
  5163. if(e[0]===e[1])if(0!==e[0]){
  5164. // Expand extent
  5165. // Note that extents can be both negative. See #13154
  5166. var n=Math.abs(e[0]);
  5167. // In the fowllowing case
  5168. // Axis has been fixed max 100
  5169. // Plus data are all 100 and axis extent are [100, 100].
  5170. // Extend to the both side will cause expanded max is larger than fixed max.
  5171. // So only expand to the smaller side.
  5172. t.fixMax||(e[1]+=n/2),e[0]-=n/2}else e[1]=1;var i=e[1]-e[0];
  5173. // If there are no data and extent are [Infinity, -Infinity]
  5174. isFinite(i)||(e[0]=0,e[1]=1),this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval);
  5175. // let extent = this._extent;
  5176. var o=this._interval;t.fixMin||(e[0]=fp(Math.floor(e[0]/o)*o)),t.fixMax||(e[1]=fp(Math.ceil(e[1]/o)*o))},e.prototype.setNiceExtent=function(t,e){this._niceExtent=[t,e]},e.type="interval",e}(Qh);Qh.registerClass(gp);const yp=gp;
  5177. /* global Float32Array */var mp="undefined"!=typeof Float32Array,vp=mp?Float32Array:Array;function xp(t){return i(t)?mp?new Float32Array(t):t:new vp(t);
  5178. // Else is number
  5179. }var _p="__ec_stack_";function bp(t){return t.get("stack")||_p+t.seriesIndex}function Sp(t){return t.dim+t.index}
  5180. /**
  5181. * @return {Object} {width, offset, offsetCenter} If axis.type is not 'category', return undefined.
  5182. */function wp(t,e){var n=[];return e.eachSeriesByType(t,(function(t){
  5183. // Check series coordinate, do layout for cartesian2d only
  5184. Cp(t)&&n.push(t)})),n}
  5185. /**
  5186. * Map from (baseAxis.dim + '_' + baseAxis.index) to min gap of two adjacent
  5187. * values.
  5188. * This works for time axes, value axes, and log axes.
  5189. * For a single time axis, return value is in the form like
  5190. * {'x_0': [1000000]}.
  5191. * The value of 1000000 is in milliseconds.
  5192. */function Mp(t){var e=function(t){
  5193. /**
  5194. * Map from axis.index to values.
  5195. * For a single time axis, axisValues is in the form like
  5196. * {'x_0': [1495555200000, 1495641600000, 1495728000000]}.
  5197. * Items in axisValues[x], e.g. 1495555200000, are time values of all
  5198. * series.
  5199. */
  5200. var e={};a(t,(function(t){var n=t.coordinateSystem.getBaseAxis();if("time"===n.type||"value"===n.type)for(var i=t.getData(),o=n.dim+"_"+n.index,r=i.getDimensionIndex(i.mapDimension(n.dim)),a=i.getStore(),s=0,l=a.count();s<l;++s){var u=a.get(r,s);e[o]?
  5201. // No value in previous series
  5202. e[o].push(u):
  5203. // No previous data for the axis
  5204. e[o]=[u];
  5205. // Ignore duplicated time values in the same axis
  5206. }}));var n={};for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];if(o){
  5207. // Sort axis values into ascending order to calculate gaps
  5208. o.sort((function(t,e){return t-e}));for(var r=null,s=1;s<o.length;++s){var l=o[s]-o[s-1];l>0&&(
  5209. // Ignore 0 delta because they are of the same axis value
  5210. r=null===r?l:Math.min(r,l))}
  5211. // Set to null if only have one data
  5212. n[i]=r}}return n}(t),n=[];return a(t,(function(t){var i,o=t.coordinateSystem.getBaseAxis(),r=o.getExtent();if("category"===o.type)i=o.getBandWidth();else if("value"===o.type||"time"===o.type){var a=o.dim+"_"+o.index,s=e[a],l=Math.abs(r[1]-r[0]),u=o.scale.getExtent(),c=Math.abs(u[1]-u[0]);i=s?l/c*s:l}else{var d=t.getData();i=Math.abs(r[1]-r[0])/d.count()}var h=je(t.get("barWidth"),i),p=je(t.get("barMaxWidth"),i),f=je(
  5213. // barMinWidth by default is 0.5 / 1 in cartesian. Because in value axis,
  5214. // the auto-calculated bar width might be less than 0.5 / 1.
  5215. t.get("barMinWidth")||(Ap(t)?.5:1),i),g=t.get("barGap"),y=t.get("barCategoryGap");n.push({bandWidth:i,barWidth:h,barMaxWidth:p,barMinWidth:f,barGap:g,barCategoryGap:y,axisKey:Sp(o),stackId:bp(t)})})),Ip(n)}function Ip(t){
  5216. // Columns info on each category axis. Key is cartesian name
  5217. var e={};a(t,(function(t,n){var i=t.axisKey,o=t.bandWidth,r=e[i]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},a=r.stacks;e[i]=r;var s=t.stackId;a[s]||r.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};
  5218. // Caution: In a single coordinate system, these barGrid attributes
  5219. // will be shared by series. Consider that they have default values,
  5220. // only the attributes set on the last series will work.
  5221. // Do not change this fact unless there will be a break change.
  5222. var l=t.barWidth;l&&!a[s].width&&(
  5223. // See #6312, do not restrict width.
  5224. a[s].width=l,l=Math.min(r.remainedWidth,l),r.remainedWidth-=l);var u=t.barMaxWidth;u&&(a[s].maxWidth=u);var c=t.barMinWidth;c&&(a[s].minWidth=c);var d=t.barGap;null!=d&&(r.gap=d);var h=t.barCategoryGap;null!=h&&(r.categoryGap=h)}));var n={};return a(e,(function(t,e){n[e]={};var i=t.stacks,o=t.bandWidth,r=t.categoryGap;if(null==r){var s=v(i).length;
  5225. // More columns in one group
  5226. // the spaces between group is smaller. Or the column will be too thin.
  5227. r=Math.max(35-4*s,15)+"%"}var l=je(r,o),u=je(t.gap,1),c=t.remainedWidth,d=t.autoWidthCount,h=(c-l)/(d+(d-1)*u);h=Math.max(h,0),
  5228. // Find if any auto calculated bar exceeded maxBarWidth
  5229. a(i,(function(t){var e=t.maxWidth,n=t.minWidth;if(t.width){
  5230. // `barMinWidth/barMaxWidth` has higher priority than `barWidth`, as
  5231. // CSS does. Because barWidth can be a percent value, where
  5232. // `barMaxWidth` can be used to restrict the final width.
  5233. i=t.width;e&&(i=Math.min(i,e)),
  5234. // `minWidth` has higher priority, as described above
  5235. n&&(i=Math.max(i,n)),t.width=i,c-=i+u*i,d--}else{var i=h;e&&e<i&&(i=Math.min(e,c)),
  5236. // `minWidth` has higher priority. `minWidth` decide that whether the
  5237. // bar is able to be visible. So `minWidth` should not be restricted
  5238. // by `maxWidth` or `remainedWidth` (which is from `bandWidth`). In
  5239. // the extreme cases for `value` axis, bars are allowed to overlap
  5240. // with each other if `minWidth` specified.
  5241. n&&n>i&&(i=n),i!==h&&(t.width=i,c-=i+u*i,d--)}})),
  5242. // Recalculate width again
  5243. h=(c-l)/(d+(d-1)*u),h=Math.max(h,0);var p,f=0;a(i,(function(t,e){t.width||(t.width=h),p=t,f+=t.width*(1+u)})),p&&(f-=p.width*u);var g=-f/2;a(i,(function(t,i){n[e][i]=n[e][i]||{bandWidth:o,offset:g,width:t.width},g+=t.width*(1+u)}))})),n}function Dp(t,e){var n=wp(t,e),i=Mp(n);a(n,(function(t){var e=t.getData(),n=t.coordinateSystem.getBaseAxis(),o=bp(t),r=i[Sp(n)][o],a=r.offset,s=r.width;e.setLayout({bandWidth:r.bandWidth,offset:a,size:s})}))}
  5244. // TODO: Do not support stack in large mode yet.
  5245. function Tp(t){return{seriesType:t,plan:Iu(),reset:function(t){if(Cp(t)){var e=t.getData(),n=t.coordinateSystem,i=n.getBaseAxis(),o=n.getOtherAxis(i),r=e.getDimensionIndex(e.mapDimension(o.dim)),a=e.getDimensionIndex(e.mapDimension(i.dim)),s=t.get("showBackground",!0),l=e.mapDimension(o.dim),u=e.getCalculationInfo("stackResultDimension"),c=qh(e,l)&&!!e.getCalculationInfo("stackedOnSeries"),d=o.isHorizontal(),h=
  5246. // See cases in `test/bar-start.html` and `#7412`, `#8747`.
  5247. function(t,e){var n=e.model.get("startValue");n||(n=0);return e.toGlobalCoord(e.dataToCoord("log"===e.type?n>0?n:1:n))}
  5248. // FIXME 公用?
  5249. (0,o),p=Ap(t),f=t.get("barMinHeight")||0,g=u&&e.getDimensionIndex(u),y=e.getLayout("size"),m=e.getLayout("offset");return{progress:function(t,e){for(var i,o=t.count,l=p&&xp(3*o),u=p&&s&&xp(3*o),v=p&&xp(o),x=n.master.getRect(),_=d?x.width:x.height,b=e.getStore(),S=0;null!=(i=t.next());){var w=b.get(c?g:r,i),M=b.get(a,i),I=h,D=void 0;
  5250. // Because of the barMinHeight, we can not use the value in
  5251. // stackResultDimension directly.
  5252. c&&(D=+w-b.get(r,i));var T=void 0,C=void 0,A=void 0,L=void 0;if(d){var k=n.dataToPoint([w,M]);if(c)I=n.dataToPoint([D,M])[0];T=I,C=k[1]+m,A=k[0]-I,L=y,Math.abs(A)<f&&(A=(A<0?-1:1)*f)}else{k=n.dataToPoint([M,w]);if(c)I=n.dataToPoint([M,D])[1];T=k[0]+m,C=I,A=y,L=k[1]-I,Math.abs(L)<f&&(
  5253. // Include zero to has a positive bar
  5254. L=(L<=0?-1:1)*f)}p?(l[S]=T,l[S+1]=C,l[S+2]=d?A:L,u&&(u[S]=d?x.x:T,u[S+1]=d?C:x.y,u[S+2]=_),v[i]=i):e.setItemLayout(i,{x:T,y:C,width:A,height:L}),S+=3}p&&e.setLayout({largePoints:l,largeDataIndices:v,largeBackgroundPoints:u,valueAxisHorizontal:d})}}}}}}function Cp(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type}function Ap(t){return t.pipelineContext&&t.pipelineContext.large}var Lp=/** @class */function(e){function o(t){var n=e.call(this,t)||this;return n.type="time",n}
  5255. /**
  5256. * Get label is mainly for other components like dataZoom, tooltip.
  5257. */return Ue(o,e),o.prototype.getLabel=function(t){var e=this.getSetting("useUTC");return Fr(t.value,Rr[function(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:
  5258. // Also for day, hour, minute, second
  5259. return"second"}}(Br(this._minLevelUnit))]||Rr.second,e,this.getSetting("locale"))},o.prototype.getFormattedLabel=function(e,n,o){var r=this.getSetting("useUTC");return function(e,n,o,r,a){var s=null;if(t(o))
  5260. // Single formatter for all units at all levels
  5261. s=o;else if(f(o))
  5262. // Callback formatter
  5263. s=o(e.value,n,{level:e.level});else{var l=p({},Nr);if(e.level>0)for(var u=0;u<Er.length;++u)l[Er[u]]="{primary|"+l[Er[u]]+"}";var c=o?!1===o.inherit?o:I(o,l):l,d=Wr(e.value,a);if(c[d])s=c[d];else if(c.inherit){for(u=Vr.indexOf(d)-1;u>=0;--u)if(c[d]){s=c[d];break}s=s||l.none}if(i(s)){var h=null==e.level?0:e.level>=0?e.level:s.length+e.level;s=s[h=Math.min(h,s.length-1)]}}return Fr(new Date(e.value),s,a,r)}(e,n,o,this.getSetting("locale"),r)},
  5264. /**
  5265. * @override
  5266. */
  5267. o.prototype.getTicks=function(){var t=this._interval,e=this._extent,i=[];
  5268. // If interval is 0, return [];
  5269. if(!t)return i;i.push({value:e[0],level:0});var o=this.getSetting("useUTC"),r=function(t,e,i,o){var r=1e4,a=Vr,s=0;function l(t,e,n,i,r,a,s){
  5270. // if (isDate) {
  5271. // d -= 1; // Starts with 0; PENDING
  5272. // }
  5273. for(var l=new Date(e),u=e,c=l[i]();u<n&&u<=o[1];)s.push({value:u}),c+=t,l[r](c),u=l.getTime();
  5274. // This extra tick is for calcuating ticks of next level. Will not been added to the final result
  5275. s.push({value:u,notAdd:!0})}function u(t,n,r){var a=[],s=!n.length;if(!function(t,e,n,i){var o=sn(e),r=sn(n),a=function(t){return Hr(o,t,i)===Hr(r,t,i)},s=function(){return a("year")},l=function(){return s()&&a("month")},u=function(){return l()&&a("day")},c=function(){return u()&&a("hour")},d=function(){return c()&&a("minute")},h=function(){return d()&&a("second")},p=function(){return h()&&a("millisecond")};switch(t){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return d();case"second":return h();case"millisecond":return p()}}
  5276. // const primaryUnitGetters = {
  5277. // year: fullYearGetterName(),
  5278. // month: monthGetterName(),
  5279. // day: dateGetterName(),
  5280. // hour: hoursGetterName(),
  5281. // minute: minutesGetterName(),
  5282. // second: secondsGetterName(),
  5283. // millisecond: millisecondsGetterName()
  5284. // };
  5285. // const primaryUnitUTCGetters = {
  5286. // year: fullYearGetterName(true),
  5287. // month: monthGetterName(true),
  5288. // day: dateGetterName(true),
  5289. // hour: hoursGetterName(true),
  5290. // minute: minutesGetterName(true),
  5291. // second: secondsGetterName(true),
  5292. // millisecond: millisecondsGetterName(true)
  5293. // };
  5294. // function moveTick(date: Date, unitName: TimeUnit, step: number, isUTC: boolean) {
  5295. // step = step || 1;
  5296. // switch (getPrimaryTimeUnit(unitName)) {
  5297. // case 'year':
  5298. // date[fullYearSetterName(isUTC)](date[fullYearGetterName(isUTC)]() + step);
  5299. // break;
  5300. // case 'month':
  5301. // date[monthSetterName(isUTC)](date[monthGetterName(isUTC)]() + step);
  5302. // break;
  5303. // case 'day':
  5304. // date[dateSetterName(isUTC)](date[dateGetterName(isUTC)]() + step);
  5305. // break;
  5306. // case 'hour':
  5307. // date[hoursSetterName(isUTC)](date[hoursGetterName(isUTC)]() + step);
  5308. // break;
  5309. // case 'minute':
  5310. // date[minutesSetterName(isUTC)](date[minutesGetterName(isUTC)]() + step);
  5311. // break;
  5312. // case 'second':
  5313. // date[secondsSetterName(isUTC)](date[secondsGetterName(isUTC)]() + step);
  5314. // break;
  5315. // case 'millisecond':
  5316. // date[millisecondsSetterName(isUTC)](date[millisecondsGetterName(isUTC)]() + step);
  5317. // break;
  5318. // }
  5319. // return date.getTime();
  5320. // }
  5321. // const DATE_INTERVALS = [[8, 7.5], [4, 3.5], [2, 1.5]];
  5322. // const MONTH_INTERVALS = [[6, 5.5], [3, 2.5], [2, 1.5]];
  5323. // const MINUTES_SECONDS_INTERVALS = [[30, 30], [20, 20], [15, 15], [10, 10], [5, 5], [2, 2]];
  5324. (Br(t),o[0],o[1],i)){s&&(n=[{
  5325. // TODO Optimize. Not include so may ticks.
  5326. value:Vp(new Date(o[0]),t,i)},{value:o[1]}]);for(var u=0;u<n.length-1;u++){var c=n[u].value,d=n[u+1].value;if(c!==d){var h=void 0,p=void 0,f=void 0,g=!1;switch(t){case"year":h=Math.max(1,Math.round(e/kr/365)),p=Yr(i),f=Jr(i);break;case"half-year":case"quarter":case"month":h=Np(e),p=Ur(i),f=$r(i);break;case"week":// PENDING If week is added. Ignore day.
  5327. case"half-week":case"day":h=Pp(e),// Use 32 days and let interval been 16
  5328. p=Zr(i),f=Qr(i),g=!0;break;case"half-day":case"quarter-day":case"hour":h=Op(e),p=Xr(i),f=ta(i);break;case"minute":h=Rp(e,!0),p=jr(i),f=ea(i);break;case"second":h=Rp(e,!1),p=qr(i),f=na(i);break;case"millisecond":h=Ep(e),p=Kr(i),f=ia(i)}l(h,c,d,p,f,g,a),"year"===t&&r.length>1&&0===u&&
  5329. // Add nearest years to the left extent.
  5330. r.unshift({value:r[0].value-h})}}for(u=0;u<a.length;u++)r.push(a[u]);
  5331. // newAddedTicks.length && console.log(unitName, newAddedTicks);
  5332. return a}}for(var c=[],d=[],h=0,p=0,f=0;f<a.length&&s++<r;++f){var g=Br(a[f]);if(Gr(a[f]))if(u(a[f],c[c.length-1]||[],d),g!==(a[f+1]?Br(a[f+1]):null)){if(d.length){p=h,
  5333. // Remove the duplicate so the tick count can be precisely.
  5334. d.sort((function(t,e){return t.value-e.value}));for(var y=[],m=0;m<d.length;++m){var v=d[m].value;0!==m&&d[m-1].value===v||(y.push(d[m]),v>=o[0]&&v<=o[1]&&h++)}var x=(o[1]-o[0])/e;
  5335. // Added too much in this level and not too less in last level
  5336. if(h>1.5*x&&p>x/1.5)break;
  5337. // Only treat primary time unit as one level.
  5338. if(c.push(y),h>x||t===a[f])break}
  5339. // Reset if next unitName is primary
  5340. d=[]}}var _=st(n(c,(function(t){return st(t,(function(t){return t.value>=o[0]&&t.value<=o[1]&&!t.notAdd}))})),(function(t){return t.length>0})),b=[],S=_.length-1;for(f=0;f<_.length;++f)for(var w=_[f],M=0;M<w.length;++M)b.push({value:w[M].value,level:S-f});b.sort((function(t,e){return t.value-e.value}));
  5341. // Remove duplicates
  5342. var I=[];for(f=0;f<b.length;++f)0!==f&&b[f].value===b[f-1].value||I.push(b[f]);return I}(this._minLevelUnit,this._approxInterval,o,e);return(i=i.concat(r)).push({value:e[1],level:0}),i},o.prototype.calcNiceExtent=function(t){var e=this._extent;
  5343. // If extent start and end are same, expand them
  5344. // If there are no data and extent are [Infinity, -Infinity]
  5345. if(e[0]===e[1]&&(
  5346. // Expand extent
  5347. e[0]-=kr,e[1]+=kr),-Infinity===e[1]&&Infinity===e[0]){var n=new Date;e[1]=+new Date(n.getFullYear(),n.getMonth(),n.getDate()),e[0]=e[1]-kr}this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval)},o.prototype.calcNiceTicks=function(t,e,n){t=t||10;var i=this._extent,o=i[1]-i[0];this._approxInterval=o/t,null!=e&&this._approxInterval<e&&(this._approxInterval=e),null!=n&&this._approxInterval>n&&(this._approxInterval=n);var r=kp.length,a=Math.min(function(t,e,n,i){for(;n<i;){var o=n+i>>>1;t[o][1]<e?n=o+1:i=o}return n}(kp,this._approxInterval,0,r),r-1);
  5348. // Interval that can be used to calculate ticks
  5349. this._interval=kp[a][1],
  5350. // Min level used when picking ticks from top down.
  5351. // We check one more level to avoid the ticks are to sparse in some case.
  5352. this._minLevelUnit=kp[Math.max(a-1,0)][0]},o.prototype.parse=function(t){
  5353. // val might be float.
  5354. return l(t)?t:+sn(t)},o.prototype.contain=function(t){return up(this.parse(t),this._extent)},o.prototype.normalize=function(t){return cp(this.parse(t),this._extent)},o.prototype.scale=function(t){return dp(t,this._extent)},o.type="time",o}(yp),kp=[
  5355. // Format interval
  5356. ["second",Cr],["minute",Ar],["hour",Lr],["quarter-day",216e5],["half-day",432e5],["day",10368e4],["half-week",3024e5],["week",6048e5],["month",26784e5],["quarter",8208e6],["half-year",Pr/2],["year",Pr]];function Pp(t,e){return(t/=kr)>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function Np(t){return(t/=2592e6)>6?6:t>3?3:t>2?2:1}function Op(t){return(t/=Lr)>12?12:t>6?6:t>3.5?4:t>2?2:1}function Rp(t,e){return(t/=e?Ar:Cr)>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function Ep(t){return cn(t,!0)}function Vp(t,e,n){var i=new Date(t);switch(Br(e)){case"year":case"month":i[$r(n)](0);case"day":i[Qr(n)](1);case"hour":i[ta(n)](0);case"minute":i[ea(n)](0);case"second":i[na(n)](0),i[ia(n)](0)}return i.getTime()}Qh.registerClass(Lp);const zp=Lp;var Bp=Qh.prototype,Gp=yp.prototype,Fp=qe,Wp=Math.floor,Hp=Math.ceil,Yp=Math.pow,Up=Math.log,Zp=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e.base=10,e._originalScale=new yp,
  5357. // FIXME:TS actually used by `IntervalScale`
  5358. e._interval=0,e}
  5359. /**
  5360. * @param Whether expand the ticks to niced extent.
  5361. */return Ue(e,t),e.prototype.getTicks=function(t){var e=this._originalScale,i=this._extent,o=e.getExtent(),r=Gp.getTicks.call(this,t);return n(r,(function(t){var e=t.value,n=qe(Yp(this.base,e));
  5362. // Fix #4158
  5363. return n=e===i[0]&&this._fixMin?jp(n,o[0]):n,{value:n=e===i[1]&&this._fixMax?jp(n,o[1]):n}}),this)},e.prototype.setExtent=function(t,e){var n=Up(this.base);
  5364. // log(-Infinity) is NaN, so safe guard here
  5365. t=Up(Math.max(0,t))/n,e=Up(Math.max(0,e))/n,Gp.setExtent.call(this,t,e)},
  5366. /**
  5367. * @return {number} end
  5368. */
  5369. e.prototype.getExtent=function(){var t=this.base,e=Bp.getExtent.call(this);e[0]=Yp(t,e[0]),e[1]=Yp(t,e[1]);
  5370. // Fix #4158
  5371. var n=this._originalScale.getExtent();return this._fixMin&&(e[0]=jp(e[0],n[0])),this._fixMax&&(e[1]=jp(e[1],n[1])),e},e.prototype.unionExtent=function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=Up(t[0])/Up(e),t[1]=Up(t[1])/Up(e),Bp.unionExtent.call(this,t)},e.prototype.unionExtentFromData=function(t,e){
  5372. // TODO
  5373. // filter value that <= 0
  5374. this.unionExtent(t.getApproximateExtent(e))},
  5375. /**
  5376. * Update interval and extent of intervals for nice ticks
  5377. * @param approxTickNum default 10 Given approx tick number
  5378. */
  5379. e.prototype.calcNiceTicks=function(t){t=t||10;var e=this._extent,n=e[1]-e[0];if(!(Infinity===n||n<=0)){var i=ln(n);
  5380. // Interval should be integer
  5381. for(
  5382. // Filter ticks to get closer to the desired count.
  5383. t/n*i<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var o=[qe(Hp(e[0]/i)*i),qe(Wp(e[1]/i)*i)];this._interval=i,this._niceExtent=o}},e.prototype.calcNiceExtent=function(t){Gp.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return up(t=Up(t)/Up(this.base),this._extent)},e.prototype.normalize=function(t){return cp(t=Up(t)/Up(this.base),this._extent)},e.prototype.scale=function(t){return t=dp(t,this._extent),Yp(this.base,t)},e.type="log",e}(Qh),Xp=Zp.prototype;
  5384. // FIXME:TS refactor: not good to call it directly with `this`?
  5385. function jp(t,e){return Fp(t,Je(e))}Xp.getMinorTicks=Gp.getMinorTicks,Xp.getLabel=Gp.getLabel,Qh.registerClass(Zp);const qp=Zp;var Kp=/** @class */function(){function t(t,e,
  5386. // Usually: data extent from all series on this axis.
  5387. n){this._prepareParams(t,e,n)}
  5388. /**
  5389. * Parameters depending on outside (like model, user callback)
  5390. * are prepared and fixed here.
  5391. */return t.prototype._prepareParams=function(t,e,
  5392. // Usually: data extent from all series on this axis.
  5393. n){n[1]<n[0]&&(n=[NaN,NaN]),this._dataMin=n[0],this._dataMax=n[1];var o=this._isOrdinal="ordinal"===t.type;this._needCrossZero="interval"===t.type&&e.getNeedCrossZero&&e.getNeedCrossZero();var r=e.get("min",!0);null==r&&(r=e.get("startValue",!0));var a=this._modelMinRaw=r;f(a)?
  5394. // This callback always provides users the full data extent (before data is filtered).
  5395. this._modelMinNum=tf(t,a({min:n[0],max:n[1]})):"dataMin"!==a&&(this._modelMinNum=tf(t,a));var s=this._modelMaxRaw=e.get("max",!0);if(f(s)?
  5396. // This callback always provides users the full data extent (before data is filtered).
  5397. this._modelMaxNum=tf(t,s({min:n[0],max:n[1]})):"dataMax"!==s&&(this._modelMaxNum=tf(t,s)),o)
  5398. // FIXME: there is a flaw here: if there is no "block" data processor like `dataZoom`,
  5399. // and progressive rendering is using, here the category result might just only contain
  5400. // the processed chunk rather than the entire result.
  5401. this._axisDataLen=e.getCategories().length;else{var l=e.get("boundaryGap"),u=i(l)?l:[l||0,l||0];"boolean"==typeof u[0]||"boolean"==typeof u[1]?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[Mt(u[0],1),Mt(u[1],1)]}},
  5402. /**
  5403. * Calculate extent by prepared parameters.
  5404. * This method has no external dependency and can be called duplicatedly,
  5405. * getting the same result.
  5406. * If parameters changed, should call this method to recalcuate.
  5407. */
  5408. t.prototype.calculate=function(){
  5409. // Notice: When min/max is not set (that is, when there are null/undefined,
  5410. // which is the most common case), these cases should be ensured:
  5411. // (1) For 'ordinal', show all axis.data.
  5412. // (2) For others:
  5413. // + `boundaryGap` is applied (if min/max set, boundaryGap is
  5414. // disabled).
  5415. // + If `needCrossZero`, min/max should be zero, otherwise, min/max should
  5416. // be the result that originalExtent enlarged by boundaryGap.
  5417. // (3) If no data, it should be ensured that `scale.setBlank` is set.
  5418. var t=this._isOrdinal,e=this._dataMin,n=this._dataMax,i=this._axisDataLen,o=this._boundaryGapInner,r=t?null:n-e||Math.abs(e),a="dataMin"===this._modelMinRaw?e:this._modelMinNum,s="dataMax"===this._modelMaxRaw?n:this._modelMaxNum,l=null!=a,u=null!=s;null==a&&(a=t?i?0:NaN:e-o[0]*r),null==s&&(s=t?i?i-1:NaN:n+o[1]*r),(null==a||!isFinite(a))&&(a=NaN),(null==s||!isFinite(s))&&(s=NaN);var c=It(a)||It(s)||t&&!i;
  5419. // If data extent modified, need to recalculated to ensure cross zero.
  5420. this._needCrossZero&&(
  5421. // Axis is over zero and min is not set
  5422. a>0&&s>0&&!l&&(a=0),
  5423. // Axis is under zero and max is not set
  5424. a<0&&s<0&&!u&&(s=0));var d=this._determinedMin,h=this._determinedMax;
  5425. // Ensure min/max be finite number or NaN here. (not to be null/undefined)
  5426. // `NaN` means min/max axis is blank.
  5427. return null!=d&&(a=d,l=!0),null!=h&&(s=h,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:c}},t.prototype.modifyDataMinMax=function(t,e){this[$p[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){this[Jp[t]]=e},t.prototype.freeze=function(){
  5428. // @ts-ignore
  5429. this.frozen=!0},t}(),Jp={min:"_determinedMin",max:"_determinedMax"},$p={min:"_dataMin",max:"_dataMax"};
  5430. /**
  5431. * Get scale min max and related info only depends on model settings.
  5432. * This method can be called after coordinate system created.
  5433. * For example, in data processing stage.
  5434. *
  5435. * Scale extent info probably be required multiple times during a workflow.
  5436. * For example:
  5437. * (1) `dataZoom` depends it to get the axis extent in "100%" state.
  5438. * (2) `processor/extentCalculator` depends it to make sure whether axis extent is specified.
  5439. * (3) `coordSys.update` use it to finally decide the scale extent.
  5440. * But the callback of `min`/`max` should not be called multiple times.
  5441. * The code below should not be implemented repeatedly either.
  5442. * So we cache the result in the scale instance, which will be recreated at the beginning
  5443. * of the workflow (because `scale` instance will be recreated each round of the workflow).
  5444. */
  5445. function Qp(t,e,
  5446. // Usually: data extent from all series on this axis.
  5447. n){
  5448. // Do not permit to recreate.
  5449. var i=t.rawExtentInfo;return i||(i=new Kp(t,e,n),
  5450. // @ts-ignore
  5451. t.rawExtentInfo=i,i)}function tf(t,e){return null==e?null:It(e)?NaN:t.parse(e)}
  5452. /**
  5453. * Get axis scale extent before niced.
  5454. * Item of returned array can only be number (including Infinity and NaN).
  5455. *
  5456. * Caution:
  5457. * Precondition of calling this method:
  5458. * The scale extent has been initialized using series data extent via
  5459. * `scale.setExtent` or `scale.unionExtentFromData`;
  5460. */function ef(t,e){var n=t.type,i=Qp(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var o=i.min,r=i.max,s=e.ecModel;if(s&&"time"/* || scaleType === 'interval' */===n){var l=wp("bar",s),u=!1;if(a(l,(function(t){u=u||t.getBaseAxis()===e.axis})),u){
  5461. // Calculate placement of bars on axis. TODO should be decoupled
  5462. // with barLayout
  5463. var c=Mp(l),d=function(t,e,n,
  5464. // Only support cartesian coord yet.
  5465. i){
  5466. // Get Axis Length
  5467. var o=n.axis.getExtent(),r=Math.abs(o[1]-o[0]),s=function(t,e,n){if(t&&e){var i=t[Sp(e)];return null!=i&&null!=n?i[bp(n)]:i}}(i,n.axis);if(void 0===s)return{min:t,max:e};var l=Infinity;a(s,(function(t){l=Math.min(t.offset,l)}));var u=-Infinity;a(s,(function(t){u=Math.max(t.offset+t.width,u)})),l=Math.abs(l),u=Math.abs(u);var c=l+u,d=e-t,h=d/(1-(l+u)/r)-d;
  5468. // Calculate required buffer based on old range and overflow
  5469. return e+=h*(u/c),t-=h*(l/c),{min:t,max:e}}
  5470. // Precondition of calling this method:
  5471. // The scale extent has been initialized using series data extent via
  5472. // `scale.setExtent` or `scale.unionExtentFromData`;
  5473. (o,r,e,c);
  5474. // Adjust axis min and max to account for overflow
  5475. o=d.min,r=d.max}}return{extent:[o,r],
  5476. // "fix" means "fixed", the value should not be
  5477. // changed in the subsequent steps.
  5478. fixMin:i.minFixed,fixMax:i.maxFixed}}function nf(t,e){var n=e,i=ef(t,n),o=i.extent,r=n.get("splitNumber");t instanceof qp&&(t.base=n.get("logBase"));var a=t.type,s=n.get("interval"),l="interval"===a||"time"===a;t.setExtent(o[0],o[1]),t.calcNiceExtent({splitNumber:r,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),
  5479. // If some one specified the min, max. And the default calculated interval
  5480. // is not good enough. He can specify the interval. It is often appeared
  5481. // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard
  5482. // to be 60.
  5483. // FIXME
  5484. null!=s&&t.setInterval&&t.setInterval(s)}
  5485. /**
  5486. * @param axisType Default retrieve from model.type
  5487. */function of(t,e){if(e=e||t.get("type"))switch(e){
  5488. // Buildin scale
  5489. case"category":return new pp({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[Infinity,-Infinity]});case"time":return new zp({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:
  5490. // case 'value'/'interval', 'log', or others.
  5491. return new(Qh.getClass(e)||yp)}}
  5492. /**
  5493. * Check if the axis cross 0
  5494. */
  5495. /**
  5496. * @param axis
  5497. * @return Label formatter function.
  5498. * param: {number} tickValue,
  5499. * param: {number} idx, the index in all ticks.
  5500. * If category axis, this param is not required.
  5501. * return: {string} label string.
  5502. */
  5503. function rf(e){var n,i,o=e.getLabelModel().get("formatter"),r="category"===e.type?e.scale.getExtent()[0]:null;return"time"===e.scale.type?(i=o,function(t,n){return e.scale.getFormattedLabel(t,n,i)}):t(o)?function(t){return function(n){
  5504. // For category axis, get raw value; for numeric axis,
  5505. // get formatted label like '1,333,444'.
  5506. var i=e.scale.getLabel(n);return t.replace("{value}",null!=i?i:"")}}(o):f(o)?(n=o,function(t,i){
  5507. // The original intention of `idx` is "the index of the tick in all ticks".
  5508. // But the previous implementation of category axis do not consider the
  5509. // `axisLabel.interval`, which cause that, for example, the `interval` is
  5510. // `1`, then the ticks "name5", "name7", "name9" are displayed, where the
  5511. // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep
  5512. // the definition here for back compatibility.
  5513. return null!=r&&(i=t.value-r),n(af(e,t),i,null!=t.level?{level:t.level}:null)}):function(t){return e.scale.getLabel(t)}}function af(t,e){
  5514. // In category axis with data zoom, tick is not the original
  5515. // index of axis.data. So tick should not be exposed to user
  5516. // in category axis.
  5517. return"category"===t.type?t.scale.getLabel(e):e.value}
  5518. /**
  5519. * @param axis
  5520. * @return Be null/undefined if no labels.
  5521. */function sf(t,e){var n=e*Math.PI/180,i=t.width,o=t.height,r=i*Math.abs(Math.cos(n))+Math.abs(o*Math.sin(n)),a=i*Math.abs(Math.sin(n))+Math.abs(o*Math.cos(n));return new Y(t.x,t.y,r,a)}
  5522. /**
  5523. * @param model axisLabelModel or axisTickModel
  5524. * @return {number|String} Can be null|'auto'|number|function
  5525. */function lf(t){var e=t.get("interval");return null==e?"auto":e}
  5526. /**
  5527. * Set `categoryInterval` as 0 implicitly indicates that
  5528. * show all labels regardless of overlap.
  5529. * @param {Object} axis axisModel.axis
  5530. */function uf(t){return"category"===t.type&&0===lf(t.getLabelModel())}function cf(t,e){
  5531. // Remove duplicated dat dimensions caused by `getStackedDimension`.
  5532. var n={};
  5533. // Currently `mapDimensionsAll` will contain stack result dimension ('__\0ecstackresult').
  5534. // PENDING: is it reasonable? Do we need to remove the original dim from "coord dim" since
  5535. // there has been stacked result dim?
  5536. return a(t.mapDimensionsAll(e),(function(e){
  5537. // For example, the extent of the original dimension
  5538. // is [0.1, 0.5], the extent of the `stackResultDimension`
  5539. // is [7, 9], the final extent should NOT include [0.1, 0.5],
  5540. // because there is no graphic corresponding to [0.1, 0.5].
  5541. // See the case in `test/area-stack.html` `main1`, where area line
  5542. // stack needs `yAxis` not start from 0.
  5543. n[Kh(t,e)]=!0})),v(n)}
  5544. /*
  5545. * Licensed to the Apache Software Foundation (ASF) under one
  5546. * or more contributor license agreements. See the NOTICE file
  5547. * distributed with this work for additional information
  5548. * regarding copyright ownership. The ASF licenses this file
  5549. * to you under the Apache License, Version 2.0 (the
  5550. * "License"); you may not use this file except in compliance
  5551. * with the License. You may obtain a copy of the License at
  5552. *
  5553. * http://www.apache.org/licenses/LICENSE-2.0
  5554. *
  5555. * Unless required by applicable law or agreed to in writing,
  5556. * software distributed under the License is distributed on an
  5557. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  5558. * KIND, either express or implied. See the License for the
  5559. * specific language governing permissions and limitations
  5560. * under the License.
  5561. */
  5562. /**
  5563. * AUTO-GENERATED FILE. DO NOT MODIFY.
  5564. */
  5565. /*
  5566. * Licensed to the Apache Software Foundation (ASF) under one
  5567. * or more contributor license agreements. See the NOTICE file
  5568. * distributed with this work for additional information
  5569. * regarding copyright ownership. The ASF licenses this file
  5570. * to you under the Apache License, Version 2.0 (the
  5571. * "License"); you may not use this file except in compliance
  5572. * with the License. You may obtain a copy of the License at
  5573. *
  5574. * http://www.apache.org/licenses/LICENSE-2.0
  5575. *
  5576. * Unless required by applicable law or agreed to in writing,
  5577. * software distributed under the License is distributed on an
  5578. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  5579. * KIND, either express or implied. See the License for the
  5580. * specific language governing permissions and limitations
  5581. * under the License.
  5582. */
  5583. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  5584. var df=/** @class */function(){function t(){}return t.prototype.getNeedCrossZero=function(){return!this.option.scale},
  5585. /**
  5586. * Should be implemented by each axis model if necessary.
  5587. * @return coordinate system model
  5588. */
  5589. t.prototype.getCoordSysModel=function(){},t}();
  5590. /**
  5591. * Create a multi dimension List structure from seriesModel.
  5592. */var hf={isDimensionStacked:qh,enableDataStack:jh,getStackedDimension:Kh};
  5593. /**
  5594. * Create scale
  5595. * @param {Array.<number>} dataExtent
  5596. * @param {Object|module:echarts/Model} option If `optoin.type`
  5597. * is secified, it can only be `'value'` currently.
  5598. */function pf(t,e){return Zo(t,null,null,"normal"!==(e=e||{}).state)}const ff=Object.freeze(Object.defineProperty({__proto__:null,createDimensions:Wh,createList:function(t){return Jh(null,t)},createScale:function(t,e){var n=e;e instanceof yr||(n=new yr(e));var i=of(n);return i.setExtent(t[0],t[1]),nf(i,n),i}
  5599. /**
  5600. * Mixin common methods to axis model,
  5601. *
  5602. * Include methods
  5603. * `getFormattedLabels() => Array.<string>`
  5604. * `getCategories() => Array.<string>`
  5605. * `getMin(origin: boolean) => number`
  5606. * `getMax(origin: boolean) => number`
  5607. * `getNeedCrossZero() => boolean`
  5608. */,createSymbol:Gc,createTextStyle:pf,dataStack:hf,enableHoverEmphasis:Yi,getECData:ni,getLayoutRect:xa,mixinAxisModelCommonMethods:function(t){nt(t,df)}},Symbol.toStringTag,{value:"Module"}));var gf=[];function yf(t,e){for(var n=0;n<t.length;n++)P(t[n],t[n],e)}function mf(t,e,n,i){for(var o=0;o<t.length;o++){var r=t[o];i&&(
  5609. // projection may return null point.
  5610. r=i.project(r)),r&&isFinite(r[0])&&isFinite(r[1])&&(Tt(e,e,r),Ct(n,n,r))}}var vf=/** @class */function(){function t(t){this.name=t}return t.prototype.setCenter=function(t){this._center=t},
  5611. /**
  5612. * Get center point in data unit. That is,
  5613. * for GeoJSONRegion, the unit is lat/lng,
  5614. * for GeoSVGRegion, the unit is SVG local coord.
  5615. */
  5616. t.prototype.getCenter=function(){var t=this._center;return t||(
  5617. // In most cases there are no need to calculate this center.
  5618. // So calculate only when called.
  5619. t=this._center=this.calcCenter()),t},t}(),xf=function(t,e){this.type="polygon",this.exterior=t,this.interiors=e},_f=function(t){this.type="linestring",this.points=t},bf=/** @class */function(t){function e(e,n,i){var o=t.call(this,e)||this;return o.type="geoJSON",o.geometries=n,o._center=i&&[i[0],i[1]],o}return Ue(e,t),e.prototype.calcCenter=function(){for(var t,e=this.geometries,n=0,i=0;i<e.length;i++){var o=e[i],r=o.exterior,a=r&&r.length;a>n&&(t=o,n=a)}if(t)return function(t){
  5620. // Polygon should been closed.
  5621. for(var e=0,n=0,i=0,o=t.length,r=t[o-1][0],a=t[o-1][1],s=0;s<o;s++){var l=t[s][0],u=t[s][1],c=r*u-l*a;e+=c,n+=(r+l)*c,i+=(a+u)*c,r=l,a=u}return e?[n/e/3,i/e/3,e]:[t[0][0]||0,t[0][1]||0]}(t.exterior);
  5622. // from bounding rect by default.
  5623. var s=this.getBoundingRect();return[s.x+s.width/2,s.y+s.height/2]},e.prototype.getBoundingRect=function(t){var e=this._rect;
  5624. // Always recalculate if using projection.
  5625. if(e&&!t)return e;var n=[Infinity,Infinity],i=[-Infinity,-Infinity],o=this.geometries;return a(o,(function(e){"polygon"===e.type?
  5626. // Doesn't consider hole
  5627. mf(e.exterior,n,i,t):a(e.points,(function(e){mf(e,n,i,t)}))})),
  5628. // Normalie invalid bounding.
  5629. isFinite(n[0])&&isFinite(n[1])&&isFinite(i[0])&&isFinite(i[1])||(n[0]=n[1]=i[0]=i[1]=0),e=new Y(n[0],n[1],i[0]-n[0],i[1]-n[1]),t||(this._rect=e),e},e.prototype.contain=function(t){var e=this.getBoundingRect(),n=this.geometries;if(!e.contain(t[0],t[1]))return!1;t:for(var i=0,o=n.length;i<o;i++){var r=n[i];
  5630. // Only support polygon.
  5631. if("polygon"===r.type){var a=r.exterior,s=r.interiors;if(Dt(a,t[0],t[1])){
  5632. // Not in the region if point is in the hole.
  5633. for(var l=0;l<(s?s.length:0);l++)if(Dt(s[l],t[0],t[1]))continue t;return!0}}}return!1},
  5634. /**
  5635. * Transform the raw coords to target bounding.
  5636. * @param x
  5637. * @param y
  5638. * @param width
  5639. * @param height
  5640. */
  5641. e.prototype.transformTo=function(t,e,n,i){var o=this.getBoundingRect(),r=o.width/o.height;n?i||(i=n/r):n=r*i;for(var s=new Y(t,e,n,i),l=o.calculateTransform(s),u=this.geometries,c=0;c<u.length;c++){var d=u[c];"polygon"===d.type?(yf(d.exterior,l),a(d.interiors,(function(t){yf(t,l)}))):a(d.points,(function(t){yf(t,l)}))}(o=this._rect).copy(s),
  5642. // Update center
  5643. this._center=[o.x+o.width/2,o.y+o.height/2]},e.prototype.cloneShallow=function(t){null==t&&(t=this.name);var n=new e(t,this.geometries,this._center);// Simply avoid to be called.
  5644. return n._rect=this._rect,n.transformTo=null,n},e}(vf),Sf=/** @class */function(t){function e(e,n){var i=t.call(this,e)||this;return i.type="geoSVG",i._elOnlyForCalculate=n,i}return Ue(e,t),e.prototype.calcCenter=function(){for(var t=this._elOnlyForCalculate,e=t.getBoundingRect(),n=[e.x+e.width/2,e.y+e.height/2],i=w(gf),o=t;o&&!o.isGeoSVGGraphicRoot;)M(i,o.getLocalTransform(),i),o=o.parent;return k(i,i),P(n,n,i),n},e}(vf);function wf(t,e,n){for(var i=0;i<t.length;i++)t[i]=Mf(t[i],e[i],n)}function Mf(t,e,n){for(var i=[],o=e[0],r=e[1],a=0;a<t.length;a+=2){var s=t.charCodeAt(a)-64,l=t.charCodeAt(a+1)-64;
  5645. // ZigZag decoding
  5646. s=s>>1^-(1&s),l=l>>1^-(1&l),o=
  5647. // Delta deocding
  5648. s+=o,r=l+=r,
  5649. // Dequantize
  5650. i.push([s/n,l/n])}return i}function If(t,e){return t=function(t){if(!t.UTF8Encoding)return t;var e=t,n=e.UTF8Scale;null==n&&(n=1024);var i=e.features;return a(i,(function(t){var e=t.geometry,i=e.encodeOffsets,o=e.coordinates;
  5651. // Geometry may be appeded manually in the script after json loaded.
  5652. // In this case this geometry is usually not encoded.
  5653. if(i)switch(e.type){case"LineString":e.coordinates=Mf(o,i,n);break;case"Polygon":case"MultiLineString":wf(o,i,n);break;case"MultiPolygon":a(o,(function(t,e){return wf(t,i[e],n)}))}})),
  5654. // Has been decoded
  5655. e.UTF8Encoding=!1,e}(t),n(st(t.features,(function(t){
  5656. // Output of mapshaper may have geometry null
  5657. return t.geometry&&t.properties&&t.geometry.coordinates.length>0})),(function(t){var n=t.properties,i=t.geometry,o=[];switch(i.type){case"Polygon":var r=i.coordinates;
  5658. // According to the GeoJSON specification.
  5659. // First must be exterior, and the rest are all interior(holes).
  5660. o.push(new xf(r[0],r.slice(1)));break;case"MultiPolygon":a(i.coordinates,(function(t){t[0]&&o.push(new xf(t[0],t.slice(1)))}));break;case"LineString":o.push(new _f([i.coordinates]));break;case"MultiLineString":o.push(new _f(i.coordinates))}var s=new bf(n[e||"name"],o,n.cp);return s.properties=n,s}))}const Df=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:nn,asc:Ke,getPercentWithPrecision:function(t,e,n){return t[e]&&tn(t,n)[e]||0},getPixelPrecision:Qe,getPrecision:Je,getPrecisionSafe:$e,isNumeric:fn,isRadianAroundZero:rn,linearMap:Xe,nice:cn,numericToNumber:pn,parseDate:sn,quantile:dn,quantity:ln,quantityExponent:un,reformIntervals:hn,remRadian:on,round:qe},Symbol.toStringTag,{value:"Module"})),Tf=Object.freeze(Object.defineProperty({__proto__:null,format:Fr,parse:sn},Symbol.toStringTag,{value:"Module"})),Cf=Object.freeze(Object.defineProperty({__proto__:null,Arc:H,BezierCurve:W,BoundingRect:Y,Circle:O,CompoundPath:U,Ellipse:R,Group:Z,Image:b,IncrementalDisplayable:X,Line:F,LinearGradient:j,Polygon:z,Polyline:B,RadialGradient:J,Rect:G,Ring:V,Sector:E,Text:$,clipPointsByRect:ko,clipRectByRect:Po,createIcon:No,extendPath:yo,extendShape:fo,getShapeClass:vo,getTransform:Do,initProps:oo,makeImage:_o,makePath:xo,mergePath:So,registerShape:mo,resizePath:wo,updateProps:io},Symbol.toStringTag,{value:"Module"})),Af=Object.freeze(Object.defineProperty({__proto__:null,addCommas:oa,capitalFirst:
  5661. /**
  5662. * Capital first
  5663. * @param {string} str
  5664. * @return {string}
  5665. */
  5666. function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},encodeHTML:ot,formatTime:function(t,e,n){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var i=sn(e),o=n?"getUTC":"get",r=i[o+"FullYear"](),a=i[o+"Month"]()+1,s=i[o+"Date"](),l=i[o+"Hours"](),u=i[o+"Minutes"](),c=i[o+"Seconds"](),d=i[o+"Milliseconds"]();return t=t.replace("MM",zr(a,2)).replace("M",a).replace("yyyy",r).replace("yy",zr(r%100+"",2)).replace("dd",zr(s,2)).replace("d",s).replace("hh",zr(l,2)).replace("h",l).replace("mm",zr(u,2)).replace("m",u).replace("ss",zr(c,2)).replace("s",c).replace("SSS",zr(d,3))},formatTpl:ca,getTextRect:function(t,e,n,i,o,r,a,s){return new $({style:{text:t,font:e,align:n,verticalAlign:i,padding:o,rich:r,overflow:a?"truncate":null,lineHeight:s}}).getBoundingRect()},getTooltipMarker:da,normalizeCssArray:aa,toCamelCase:ra,truncateText:At},Symbol.toStringTag,{value:"Module"})),Lf=Object.freeze(Object.defineProperty({__proto__:null,bind:lt,clone:et,curry:rt,defaults:I,each:a,extend:p,filter:st,indexOf:c,inherits:h,isArray:i,isFunction:f,isObject:o,isString:t,map:n,merge:tt,reduce:e},Symbol.toStringTag,{value:"Module"}));var kf=On();function Pf(t,e){var i=n(e,(function(e){return t.scale.parse(e)}));return"time"===t.type&&i.length>0&&(
  5667. // Time axis needs duplicate first/last tick (see TimeScale.getTicks())
  5668. // The first and last tick/label don't get drawn
  5669. i.sort(),i.unshift(i[0]),i.push(i[i.length-1])),i}function Nf(t){var e=t.getLabelModel().get("customValues");if(e){var i=rf(t),o=t.scale.getExtent(),r=Pf(t,e),a=st(r,(function(t){return t>=o[0]&&t<=o[1]}));return{labels:n(a,(function(e){var n={value:e};return{formattedLabel:i(n),rawLabel:t.scale.getLabel(n),tickValue:e}}))}}
  5670. // Only ordinal scale support tick interval
  5671. return"category"===t.type?function(t){var e=t.getLabelModel(),n=Rf(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}(t):function(t){var e=t.scale.getTicks(),i=rf(t);return{labels:n(e,(function(e,n){return{level:e.level,formattedLabel:i(e,n),rawLabel:t.scale.getLabel(e),tickValue:e.value}}))}}(t)}
  5672. /**
  5673. * @param {module:echats/coord/Axis} axis
  5674. * @param {module:echarts/model/Model} tickModel For example, can be axisTick, splitLine, splitArea.
  5675. * @return {Object} {
  5676. * ticks: Array.<number>
  5677. * tickCategoryInterval: number
  5678. * }
  5679. */function Of(t,e){var i=t.getTickModel().get("customValues");if(i){var o=t.scale.getExtent(),r=Pf(t,i);return{ticks:st(r,(function(t){return t>=o[0]&&t<=o[1]}))}}
  5680. // Only ordinal scale support tick interval
  5681. return"category"===t.type?function(t,e){var i,o,r=Ef(t,"ticks"),a=lf(e),s=Vf(r,a);if(s)return s;
  5682. // Optimize for the case that large category data and no label displayed,
  5683. // we should not return all ticks.
  5684. e.get("show")&&!t.scale.isBlank()||(i=[]);if(f(a))i=Gf(t,a,!0);else if("auto"===a){var l=Rf(t,t.getLabelModel());o=l.labelCategoryInterval,i=n(l.labels,(function(t){return t.tickValue}))}else i=Bf(t,o=a,!0);
  5685. // Cache to avoid calling interval function repeatedly.
  5686. return zf(r,a,{ticks:i,tickCategoryInterval:o})}(t,e):{ticks:n(t.scale.getTicks(),(function(t){return t.value}))}}function Rf(t,e){var n,i,o=Ef(t,"labels"),r=lf(e),a=Vf(o,r);return a||(f(r)?n=Gf(t,r):(i="auto"===r?function(t){var e=kf(t).autoInterval;return null!=e?e:kf(t).autoInterval=t.calculateCategoryInterval()}
  5687. /**
  5688. * Calculate interval for category axis ticks and labels.
  5689. * To get precise result, at least one of `getRotate` and `isHorizontal`
  5690. * should be implemented in axis.
  5691. */(t):r,n=Bf(t,i)),zf(o,r,{labels:n,labelCategoryInterval:i}))}function Ef(t,e){
  5692. // Because key can be a function, and cache size always is small, we use array cache.
  5693. return kf(t)[e]||(kf(t)[e]=[])}function Vf(t,e){for(var n=0;n<t.length;n++)if(t[n].key===e)return t[n].value}function zf(t,e,n){return t.push({key:e,value:n}),n}function Bf(t,e,n){var i=rf(t),o=t.scale,r=o.getExtent(),a=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=r[0],c=o.count();
  5694. // Calculate start tick based on zero if possible to keep label consistent
  5695. // while zooming and moving while interval > 0. Otherwise the selection
  5696. // of displayable ticks and symbols probably keep changing.
  5697. // 3 is empirical value.
  5698. 0!==u&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));
  5699. // (1) Only add min max label here but leave overlap checking
  5700. // to render stage, which also ensure the returned list
  5701. // suitable for splitLine and splitArea rendering.
  5702. // (2) Scales except category always contain min max label so
  5703. // do not need to perform this process.
  5704. var d=uf(t),h=a.get("showMinLabel")||d,p=a.get("showMaxLabel")||d;h&&u!==r[0]&&g(r[0]);
  5705. // Optimize: avoid generating large array by `ordinalScale.getTicks()`.
  5706. for(var f=u;f<=r[1];f+=l)g(f);function g(t){var e={value:t};s.push(n?t:{formattedLabel:i(e),rawLabel:o.getLabel(e),tickValue:t})}return p&&f-l!==r[1]&&g(r[1]),s}function Gf(t,e,n){var i=t.scale,o=rf(t),r=[];return a(i.getTicks(),(function(t){var a=i.getLabel(t),s=t.value;e(t.value,a)&&r.push(n?s:{formattedLabel:o(t),rawLabel:a,tickValue:s})})),r}var Ff=[0,1],Wf=/** @class */function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}
  5707. /**
  5708. * If axis extent contain given coord
  5709. */return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&t<=i},
  5710. /**
  5711. * If axis extent contain given data
  5712. */
  5713. t.prototype.containData=function(t){return this.scale.contain(t)},
  5714. /**
  5715. * Get coord extent.
  5716. */
  5717. t.prototype.getExtent=function(){return this._extent.slice()},
  5718. /**
  5719. * Get precision used for formatting
  5720. */
  5721. t.prototype.getPixelPrecision=function(t){return Qe(t||this.scale.getExtent(),this._extent)},
  5722. /**
  5723. * Set coord extent
  5724. */
  5725. t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},
  5726. /**
  5727. * Convert data to coord. Data is the rank if it has an ordinal scale
  5728. */
  5729. t.prototype.dataToCoord=function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(t),this.onBand&&"ordinal"===i.type&&Hf(n=n.slice(),i.count()),Xe(t,Ff,n,e)},
  5730. /**
  5731. * Convert coord to data. Data is the rank if it has an ordinal scale
  5732. */
  5733. t.prototype.coordToData=function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&Hf(n=n.slice(),i.count());var o=Xe(t,n,Ff,e);return this.scale.scale(o)},
  5734. /**
  5735. * Convert pixel point to data in axis
  5736. */
  5737. t.prototype.pointToData=function(t,e){},
  5738. /**
  5739. * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,
  5740. * `axis.getTicksCoords` considers `onBand`, which is used by
  5741. * `boundaryGap:true` of category axis and splitLine and splitArea.
  5742. * @param opt.tickModel default: axis.model.getModel('axisTick')
  5743. * @param opt.clamp If `true`, the first and the last
  5744. * tick must be at the axis end points. Otherwise, clip ticks
  5745. * that outside the axis extent.
  5746. */
  5747. t.prototype.getTicksCoords=function(t){var e=(t=t||{}).tickModel||this.getTickModel(),i=Of(this,e).ticks,o=n(i,(function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}}),this);
  5748. // If axis has labels [1, 2, 3, 4]. Bands on the axis are
  5749. // |---1---|---2---|---3---|---4---|.
  5750. // So the displayed ticks and splitLine/splitArea should between
  5751. // each data item, otherwise cause misleading (e.g., split tow bars
  5752. // of a single data item when there are two bar series).
  5753. // Also consider if tickCategoryInterval > 0 and onBand, ticks and
  5754. // splitLine/spliteArea should layout appropriately corresponding
  5755. // to displayed labels. (So we should not use `getBandWidth` in this
  5756. // case).
  5757. return function(t,e,n,i){var o=e.length;if(!t.onBand||n||!o)return;var r,s,l=t.getExtent();if(1===o)e[0].coord=l[0],r=e[1]={coord:l[1],tickValue:e[0].tickValue};else{var u=e[o-1].tickValue-e[0].tickValue,c=(e[o-1].coord-e[0].coord)/u;a(e,(function(t){t.coord-=c/2}));var d=t.scale.getExtent();s=1+d[1]-e[o-1].tickValue,r={coord:e[o-1].coord+c*s,tickValue:d[1]+1},e.push(r)}var h=l[0]>l[1];
  5758. // Handling clamp.
  5759. p(e[0].coord,l[0])&&(i?e[0].coord=l[0]:e.shift());i&&p(l[0],e[0].coord)&&e.unshift({coord:l[0]});p(l[1],r.coord)&&(i?r.coord=l[1]:e.pop());i&&p(r.coord,l[1])&&e.push({coord:l[1]});function p(t,e){
  5760. // Avoid rounding error cause calculated tick coord different with extent.
  5761. // It may cause an extra unnecessary tick added.
  5762. return t=qe(t),e=qe(e),h?t>e:t<e}}(this,o,e.get("alignWithLabel"),t.clamp),o},t.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)
  5763. // Category axis doesn't support minor ticks
  5764. return[];var t=this.model.getModel("minorTick").get("splitNumber");
  5765. // Protection.
  5766. t>0&&t<100||(t=5);var e=this.scale.getMinorTicks(t);return n(e,(function(t){return n(t,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this)}),this)},t.prototype.getViewLabels=function(){return Nf(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},
  5767. /**
  5768. * Notice here we only get the default tick model. For splitLine
  5769. * or splitArea, we should pass the splitLineModel or splitAreaModel
  5770. * manually when calling `getTicksCoords`.
  5771. * In GL, this method may be overridden to:
  5772. * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`
  5773. */
  5774. t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},
  5775. /**
  5776. * Get width of band
  5777. */
  5778. t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);
  5779. // Fix #2728, avoid NaN when only one data.
  5780. 0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},
  5781. /**
  5782. * Only be called in category axis.
  5783. * Can be overridden, consider other axes like in 3D.
  5784. * @return Auto interval for cateogry axis tick and label
  5785. */
  5786. t.prototype.calculateCategoryInterval=function(){return function(t){var e=function(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}(t),n=rf(t),i=(e.axisRotate-e.labelRotate)/180*Math.PI,o=t.scale,r=o.getExtent(),a=o.count();if(r[1]-r[0]<1)return 0;var s=1;
  5787. // Simple optimization. Empirical value: tick count should less than 40.
  5788. a>40&&(s=Math.max(1,Math.floor(a/40)));
  5789. // Caution: Performance sensitive for large category data.
  5790. // Consider dataZoom, we should make appropriate step to avoid O(n) loop.
  5791. for(var l=r[0],u=t.dataToCoord(l+1)-t.dataToCoord(l),c=Math.abs(u*Math.cos(i)),d=Math.abs(u*Math.sin(i)),h=0,p=0;l<=r[1];l+=s){var f,g,y=Lt(n({value:l}),e.font,"center","top");
  5792. // Magic number
  5793. f=1.3*y.width,g=1.3*y.height,
  5794. // Min size, void long loop.
  5795. h=Math.max(h,f,7),p=Math.max(p,g,7)}var m=h/c,v=p/d;
  5796. // 0/0 is NaN, 1/0 is Infinity.
  5797. isNaN(m)&&(m=Infinity),isNaN(v)&&(v=Infinity);var x=Math.max(0,Math.floor(Math.min(m,v))),_=kf(t.model),b=t.getExtent(),S=_.lastAutoInterval,w=_.lastTickCount;
  5798. // Use cache to keep interval stable while moving zoom window,
  5799. // otherwise the calculated interval might jitter when the zoom
  5800. // window size is close to the interval-changing size.
  5801. // For example, if all of the axis labels are `a, b, c, d, e, f, g`.
  5802. // The jitter will cause that sometimes the displayed labels are
  5803. // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).
  5804. return null!=S&&null!=w&&Math.abs(S-x)<=1&&Math.abs(w-a)<=1&&S>x&&_.axisExtent0===b[0]&&_.axisExtent1===b[1]?x=S:(_.lastTickCount=a,_.lastAutoInterval=x,_.axisExtent0=b[0],_.axisExtent1=b[1]),x}(this)},t}();
  5805. /**
  5806. * Base class of Axis.
  5807. */function Hf(t,e){var n=(t[1]-t[0])/e/2;t[0]+=n,t[1]-=n}const Yf=Wf;
  5808. // --------------------- Deprecated Extension Methods ---------------------
  5809. // Should use `ComponentModel.extend` or `class XXXX extend ComponentModel` to create class.
  5810. // Then use `registerComponentModel` in `install` parameter when `use` this extension. For example:
  5811. // class Bar3DModel extends ComponentModel {}
  5812. // export function install(registers) { registers.registerComponentModel(Bar3DModel); }
  5813. // echarts.use(install);
  5814. function Uf(t){var e=Su.extend(t);return Su.registerClass(e),e}function Zf(t){var e=Ou.extend(t);return Ou.registerClass(e),e}var Xf=2*Math.PI,jf=kt.CMD,qf=["top","right","bottom","left"];function Kf(t,e,n,i,o){var r=n.width,a=n.height;switch(t){case"top":i.set(n.x+r/2,n.y-e),o.set(0,-1);break;case"bottom":i.set(n.x+r/2,n.y+a+e),o.set(0,1);break;case"left":i.set(n.x-e,n.y+a/2),o.set(-1,0);break;case"right":i.set(n.x+r+e,n.y+a/2),o.set(1,0)}}function Jf(t,e,n,i,o,r,a,s,l){a-=t,s-=e;var u=Math.sqrt(a*a+s*s),c=(a/=u)*n+t,d=(s/=u)*n+e;if(Math.abs(i-o)%Xf<1e-4)
  5815. // Is a circle
  5816. return l[0]=c,l[1]=d,u-n;if(r){var h=i;i=Et(o),o=Et(h)}else i=Et(i),o=Et(o);i>o&&(o+=Xf);var p=Math.atan2(s,a);if(p<0&&(p+=Xf),p>=i&&p<=o||p+Xf>=i&&p+Xf<=o)
  5817. // Project point is on the arc.
  5818. return l[0]=c,l[1]=d,u-n;var f=n*Math.cos(i)+t,g=n*Math.sin(i)+e,y=n*Math.cos(o)+t,m=n*Math.sin(o)+e,v=(f-a)*(f-a)+(g-s)*(g-s),x=(y-a)*(y-a)+(m-s)*(m-s);return v<x?(l[0]=f,l[1]=g,Math.sqrt(v)):(l[0]=y,l[1]=m,Math.sqrt(x))}function $f(t,e,n,i,o,r,a,s){var l=o-t,u=r-e,c=n-t,d=i-e,h=Math.sqrt(c*c+d*d),p=(l*(c/=h)+u*(d/=h))/h;s&&(p=Math.min(Math.max(p,0),1)),p*=h;var f=a[0]=t+p*c,g=a[1]=e+p*d;return Math.sqrt((f-o)*(f-o)+(g-r)*(g-r))}function Qf(t,e,n,i,o,r,a){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i);var s=t+n,l=e+i,u=a[0]=Math.min(Math.max(o,t),s),c=a[1]=Math.min(Math.max(r,e),l);return Math.sqrt((u-o)*(u-o)+(c-r)*(c-r))}var tg=[];function eg(t,e,n){var i=Qf(e.x,e.y,e.width,e.height,t.x,t.y,tg);return n.set(tg[0],tg[1]),i}
  5819. /**
  5820. * Calculate min distance corresponding point.
  5821. * This method won't evaluate if point is in the path.
  5822. */function ng(t,e,n){for(var i,o,r=0,a=0,s=0,l=0,u=Infinity,c=e.data,d=t.x,h=t.y,p=0;p<c.length;){var f=c[p++];1===p&&(s=r=c[p],l=a=c[p+1]);var g=u;switch(f){case jf.M:r=
  5823. // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点
  5824. // 在 closePath 的时候使用
  5825. s=c[p++],a=l=c[p++];break;case jf.L:g=$f(r,a,c[p],c[p+1],d,h,tg,!0),r=c[p++],a=c[p++];break;case jf.C:g=Rt(r,a,c[p++],c[p++],c[p++],c[p++],c[p],c[p+1],d,h,tg),r=c[p++],a=c[p++];break;case jf.Q:g=Ot(r,a,c[p++],c[p++],c[p],c[p+1],d,h,tg),r=c[p++],a=c[p++];break;case jf.A:
  5826. // TODO Arc 判断的开销比较大
  5827. var y=c[p++],m=c[p++],v=c[p++],x=c[p++],_=c[p++],b=c[p++];
  5828. // TODO Arc 旋转
  5829. p+=1;var S=!!(1-c[p++]);i=Math.cos(_)*v+y,o=Math.sin(_)*x+m,
  5830. // 不是直接使用 arc 命令
  5831. p<=1&&(
  5832. // 第一个命令起点还未定义
  5833. s=i,l=o),g=Jf(y,m,x,_,_+b,S,(d-y)*x/v+y,h,tg),r=Math.cos(_+b)*v+y,a=Math.sin(_+b)*x+m;break;case jf.R:g=Qf(s=r=c[p++],l=a=c[p++],c[p++],c[p++],d,h,tg);break;case jf.Z:g=$f(r,a,s,l,d,h,tg,!0),r=s,a=l}g<u&&(u=g,n.set(tg[0],tg[1]))}return u}
  5834. // Temporal variable for intermediate usage.
  5835. var ig=new K,og=new K,rg=new K,ag=new K,sg=new K;
  5836. /**
  5837. * Calculate a proper guide line based on the label position and graphic element definition
  5838. * @param label
  5839. * @param labelRect
  5840. * @param target
  5841. * @param targetRect
  5842. */
  5843. function lg(t,e){if(t){var n=t.getTextGuideLine(),i=t.getTextContent();
  5844. // Needs to create text guide in each charts.
  5845. if(i&&n){var o=t.textGuideLineConfig||{},r=[[0,0],[0,0],[0,0]],a=o.candidates||qf,s=i.getBoundingRect().clone();s.applyTransform(i.getComputedTransform());var l=Infinity,u=o.anchor,c=t.getComputedTransform(),d=c&&k([],c),h=e.get("length2")||0;u&&rg.copy(u);for(var p=0;p<a.length;p++){Kf(a[p],0,s,ig,ag),K.scaleAndAdd(og,ig,ag,h),
  5846. // Transform to target coord space.
  5847. og.transform(d);
  5848. // Note: getBoundingRect will ensure the `path` being created.
  5849. var f=t.getBoundingRect(),y=u?u.distance(og):t instanceof g?ng(og,t.path,rg):eg(og,f,rg);
  5850. // TODO pt2 is in the path
  5851. y<l&&(l=y,
  5852. // Transform back to global space.
  5853. og.transform(c),rg.transform(c),rg.toArray(r[0]),og.toArray(r[1]),ig.toArray(r[2]))}dg(r,e.get("minTurnAngle")),n.setShape({points:r})}}}
  5854. // Temporal variable for the limitTurnAngle function
  5855. var ug=[],cg=new K;
  5856. /**
  5857. * Reduce the line segment attached to the label to limit the turn angle between two segments.
  5858. * @param linePoints
  5859. * @param minTurnAngle Radian of minimum turn angle. 0 - 180
  5860. */
  5861. function dg(t,e){if(e<=180&&e>0){e=e/180*Math.PI,
  5862. // The line points can be
  5863. // /pt1----pt2 (label)
  5864. // /
  5865. // pt0/
  5866. ig.fromArray(t[0]),og.fromArray(t[1]),rg.fromArray(t[2]),K.sub(ag,ig,og),K.sub(sg,rg,og);var n=ag.len(),i=sg.len();if(!(n<.001||i<.001)){ag.scale(1/n),sg.scale(1/i);var o=ag.dot(sg);if(Math.cos(e)<o){
  5867. // Smaller than minTurnAngle
  5868. // Calculate project point of pt0 on pt1-pt2
  5869. var r=$f(og.x,og.y,rg.x,rg.y,ig.x,ig.y,ug,!1);cg.fromArray(ug),
  5870. // Calculate new projected length with limited minTurnAngle and get the new connect point
  5871. cg.scaleAndAdd(sg,r/Math.tan(Math.PI-e));
  5872. // Limit the new calculated connect point between pt1 and pt2.
  5873. var a=rg.x!==og.x?(cg.x-og.x)/(rg.x-og.x):(cg.y-og.y)/(rg.y-og.y);if(isNaN(a))return;a<0?K.copy(cg,og):a>1&&K.copy(cg,rg),cg.toArray(t[1])}}}}
  5874. /**
  5875. * Limit the angle of line and the surface
  5876. * @param maxSurfaceAngle Radian of minimum turn angle. 0 - 180. 0 is same direction to normal. 180 is opposite
  5877. */function hg(t,e,n){if(n<=180&&n>0){n=n/180*Math.PI,ig.fromArray(t[0]),og.fromArray(t[1]),rg.fromArray(t[2]),K.sub(ag,og,ig),K.sub(sg,rg,og);var i=ag.len(),o=sg.len();if(!(i<.001||o<.001))if(ag.scale(1/i),sg.scale(1/o),ag.dot(e)<Math.cos(n)){
  5878. // Calculate project point of pt0 on pt1-pt2
  5879. var r=$f(og.x,og.y,rg.x,rg.y,ig.x,ig.y,ug,!1);cg.fromArray(ug);var a=Math.PI/2,s=a+Math.acos(sg.dot(e))-n;if(s>=a)
  5880. // parallel
  5881. K.copy(cg,rg);else{
  5882. // Calculate new projected length with limited minTurnAngle and get the new connect point
  5883. cg.scaleAndAdd(sg,r/Math.tan(Math.PI/2-s));
  5884. // Limit the new calculated connect point between pt1 and pt2.
  5885. var l=rg.x!==og.x?(cg.x-og.x)/(rg.x-og.x):(cg.y-og.y)/(rg.y-og.y);if(isNaN(l))return;l<0?K.copy(cg,og):l>1&&K.copy(cg,rg)}cg.toArray(t[1])}}}function pg(t,e,n,i){var o="normal"===n,r=o?t:t.ensureState(n);
  5886. // Make sure display.
  5887. r.ignore=e;
  5888. // Set smooth
  5889. var a=i.get("smooth");a&&!0===a&&(a=.3),r.shape=r.shape||{},a>0&&(r.shape.smooth=a);var s=i.getModel("lineStyle").getLineStyle();o?t.useStyle(s):r.style=s}function fg(t,e){var n=e.smooth,i=e.points;if(i)if(t.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var o=Pt(i[0],i[1]),r=Pt(i[1],i[2]);if(!o||!r)return t.lineTo(i[1][0],i[1][1]),void t.lineTo(i[2][0],i[2][1]);var a=Math.min(o,r)*n,s=Nt([],i[1],i[0],a/o),l=Nt([],i[1],i[2],a/r),u=Nt([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var c=1;c<i.length;c++)t.lineTo(i[c][0],i[c][1])}
  5890. /**
  5891. * Create a label line if necessary and set it's style.
  5892. */function gg(t,e,n){var i=t.getTextGuideLine(),o=t.getTextContent();if(o){for(var r=e.normal,a=r.get("show"),s=o.ignore,l=0;l<ui.length;l++){var u=ui[l],c=e[u],d="normal"===u;if(c){var h=c.get("show");if((d?s:x(o.states[u]&&o.states[u].ignore,s))||!x(h,a)){var p=d?i:i&&i.states[u];p&&(p.ignore=!0),i&&pg(i,!0,u,c);continue}
  5893. // Create labelLine if not exists
  5894. i||(i=new B,t.setTextGuideLine(i),
  5895. // Reset state of normal because it's new created.
  5896. // NOTE: NORMAL should always been the first!
  5897. d||!s&&a||pg(i,!0,"normal",e.normal),
  5898. // Use same state proxy.
  5899. t.stateProxy&&(i.stateProxy=t.stateProxy)),pg(i,!1,u,c)}}if(i){I(i.style,n),
  5900. // Not fill.
  5901. i.style.fill=null;var f=r.get("showAbove");(t.textGuideLineConfig=t.textGuideLineConfig||{}).showAbove=f||!1,
  5902. // Custom the buildPath.
  5903. i.buildPath=fg}}else
  5904. // Not show label line if there is no label.
  5905. i&&t.removeTextGuideLine()}function yg(t,e){e=e||"labelLine";for(var n={normal:t.getModel(e)},i=0;i<li.length;i++){var o=li[i];n[o]=t.getModel([o,e])}return n}function mg(t){for(var e=[],n=0;n<t.length;n++){var i=t[n];if(!i.defaultAttr.ignore){var o=i.label,r=o.getComputedTransform(),a=o.getBoundingRect(),s=!r||r[1]<1e-5&&r[2]<1e-5,l=o.style.margin||0,u=a.clone();u.applyTransform(r),u.x-=l/2,u.y-=l/2,u.width+=l,u.height+=l;var c=s?new q(a,r):null;e.push({label:o,labelLine:i.labelLine,rect:u,localRect:a,obb:c,priority:i.priority,defaultAttr:i.defaultAttr,layoutOption:i.computedLayoutOption,axisAligned:s,transform:r})}}return e}function vg(t,e,n,i,o,r){var a=t.length;if(!(a<2)){t.sort((function(t,n){return t.rect[e]-n.rect[e]}));for(var s,l=0,u=!1,c=0,d=0;d<a;d++){var h=t[d],p=h.rect;(s=p[e]-l)<0&&(
  5906. // shiftForward(i, len, -delta);
  5907. p[e]-=s,h.label[e]-=s,u=!0),c+=Math.max(-s,0),l=p[e]+p[n]}c>0&&r&&
  5908. // Shift back to make the distribution more equally.
  5909. _(-c/a,0,a);
  5910. // TODO bleedMargin?
  5911. var f,g,y=t[0],m=t[a-1];return v(),
  5912. // If ends exceed two bounds, squeeze at most 80%, then take the gap of two bounds.
  5913. f<0&&b(-f,.8),g<0&&b(g,.8),v(),x(f,g,1),x(g,f,-1),
  5914. // Handle bailout when there is not enough space.
  5915. v(),f<0&&S(-f),g<0&&S(g),u}function v(){f=y.rect[e]-i,g=o-m.rect[e]-m.rect[n]}function x(t,e,n){if(t<0){
  5916. // Move from other gap if can.
  5917. var i=Math.min(e,-t);if(i>0){_(i*n,0,a);var o=i+t;o<0&&b(-o*n,1)}else b(-t*n,1)}}function _(n,i,o){0!==n&&(u=!0);for(var r=i;r<o;r++){var a=t[r];a.rect[e]+=n,a.label[e]+=n}}
  5918. // Squeeze gaps if the labels exceed margin.
  5919. function b(i,o){for(var r=[],s=0,l=1;l<a;l++){var u=t[l-1].rect,c=Math.max(t[l].rect[e]-u[e]-u[n],0);r.push(c),s+=c}if(s){var d=Math.min(Math.abs(i)/s,o);if(i>0)for(l=0;l<a-1;l++){
  5920. // Forward
  5921. _(r[l]*d,0,l+1)}else
  5922. // Backward
  5923. for(l=a-1;l>0;l--){_(-(r[l-1]*d),l,a)}}}
  5924. /**
  5925. * Squeeze to allow overlap if there is no more space available.
  5926. * Let other overlapping strategy like hideOverlap do the job instead of keep exceeding the bounds.
  5927. */function S(t){var e=t<0?-1:1;t=Math.abs(t);for(var n=Math.ceil(t/(a-1)),i=0;i<a-1;i++)if(e>0?
  5928. // Forward
  5929. _(n,0,i+1):
  5930. // Backward
  5931. _(-n,a-i-1,a),(t-=n)<=0)return}}
  5932. /**
  5933. * Adjust labels on x direction to avoid overlap.
  5934. */
  5935. /**
  5936. * Adjust labels on y direction to avoid overlap.
  5937. */
  5938. function xg(t,e,n,
  5939. // If average the shifts on all labels and add them to 0
  5940. i){return vg(t,"y","height",e,n,i)}function _g(t){var e=[];
  5941. // TODO, render overflow visible first, put in the displayedLabels.
  5942. t.sort((function(t,e){return e.priority-t.priority}));var n=new Y(0,0,0,0);function i(t){if(!t.ignore){
  5943. // Show on emphasis.
  5944. var e=t.ensureState("emphasis");null==e.ignore&&(e.ignore=!1)}t.ignore=!0}for(var o=0;o<t.length;o++){var r=t[o],a=r.axisAligned,s=r.localRect,l=r.transform,u=r.label,c=r.labelLine;n.copy(r.rect),
  5945. // Add a threshold because layout may be aligned precisely.
  5946. n.width-=.1,n.height-=.1,n.x+=.05,n.y+=.05;for(var d=r.obb,h=!1,p=0;p<e.length;p++){var f=e[p];
  5947. // Fast rejection.
  5948. if(n.intersect(f.rect)){if(a&&f.axisAligned){
  5949. // Is overlapped
  5950. h=!0;break}if(f.obb||(
  5951. // If self is not axis aligned. But other is.
  5952. f.obb=new q(f.localRect,f.transform)),d||(
  5953. // If self is axis aligned. But other is not.
  5954. d=new q(s,l)),d.intersect(f.obb)){h=!0;break}}}
  5955. // TODO Callback to determine if this overlap should be handled?
  5956. h?(i(u),c&&i(c)):(u.attr("ignore",r.defaultAttr.ignore),c&&c.attr("ignore",r.defaultAttr.labelGuideIgnore),e.push(r))}}function bg(t){if(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n].slice());return e}}function Sg(t,e){var n=t.label,i=e&&e.getTextGuideLine();return{dataIndex:t.dataIndex,dataType:t.dataType,seriesIndex:t.seriesModel.seriesIndex,text:t.label.style.text,rect:t.hostRect,labelRect:t.rect,
  5957. // x: labelAttr.x,
  5958. // y: labelAttr.y,
  5959. align:n.style.align,verticalAlign:n.style.verticalAlign,labelLinePoints:bg(i&&i.shape.points)}}var wg=["align","verticalAlign","width","height","fontSize"],Mg=new L,Ig=On(),Dg=On();function Tg(t,e,n){for(var i=0;i<n.length;i++){var o=n[i];null!=e[o]&&(t[o]=e[o])}}var Cg=["x","y","rotation"],Ag=/** @class */function(){function t(){this._labelList=[],this._chartViewList=[]}return t.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},
  5960. /**
  5961. * Add label to manager
  5962. */
  5963. t.prototype._addLabel=function(t,e,n,i,o){var r=i.style,a=i.__hostTarget.textConfig||{},s=i.getComputedTransform(),l=i.getBoundingRect().plain();Y.applyTransform(l,l,s),s?Mg.setLocalTransform(s):(
  5964. // Identity transform.
  5965. Mg.x=Mg.y=Mg.rotation=Mg.originX=Mg.originY=0,Mg.scaleX=Mg.scaleY=1),Mg.rotation=Et(Mg.rotation);var u,c=i.__hostTarget;if(c){u=c.getBoundingRect().plain();var d=c.getComputedTransform();Y.applyTransform(u,u,d)}var h=u&&c.getTextGuideLine();this._labelList.push({label:i,labelLine:h,seriesModel:n,dataIndex:t,dataType:e,layoutOption:o,computedLayoutOption:null,rect:l,hostRect:u,
  5966. // Label with lower priority will be hidden when overlapped
  5967. // Use rect size as default priority
  5968. priority:u?u.width*u.height:0,
  5969. // Save default label attributes.
  5970. // For restore if developers want get back to default value in callback.
  5971. defaultAttr:{ignore:i.ignore,labelGuideIgnore:h&&h.ignore,x:Mg.x,y:Mg.y,scaleX:Mg.scaleX,scaleY:Mg.scaleY,rotation:Mg.rotation,style:{x:r.x,y:r.y,align:r.align,verticalAlign:r.verticalAlign,width:r.width,height:r.height,fontSize:r.fontSize},cursor:i.cursor,attachedPos:a.position,attachedRot:a.rotation}})},t.prototype.addLabelsOfSeries=function(t){var e=this;this._chartViewList.push(t);var n=t.__model,i=n.get("labelLayout");
  5972. /**
  5973. * Ignore layouting if it's not specified anything.
  5974. */
  5975. (f(i)||v(i).length)&&t.group.traverse((function(t){if(t.ignore)return!0;// Stop traverse descendants.
  5976. // Only support label being hosted on graphic elements.
  5977. var o=t.getTextContent(),r=ni(t);
  5978. // Can only attach the text on the element with dataIndex
  5979. o&&!o.disableLabelLayout&&e._addLabel(r.dataIndex,r.dataType,n,o,i)}))},t.prototype.updateLayoutConfig=function(t){var e=t.getWidth(),n=t.getHeight();function i(t,e){return function(){lg(t,e)}}for(var o=0;o<this._labelList.length;o++){var r=this._labelList[o],a=r.label,s=a.__hostTarget,l=r.defaultAttr,u=void 0;u=(
  5980. // TODO A global layout option?
  5981. u=f(r.layoutOption)?r.layoutOption(Sg(r,s)):r.layoutOption)||{},r.computedLayoutOption=u;var c=Math.PI/180;
  5982. // TODO hostEl should always exists.
  5983. // Or label should not have parent because the x, y is all in global space.
  5984. s&&s.setTextConfig({
  5985. // Force to set local false.
  5986. local:!1,
  5987. // Ignore position and rotation config on the host el if x or y is changed.
  5988. position:null!=u.x||null!=u.y?null:l.attachedPos,
  5989. // Ignore rotation config on the host el if rotation is changed.
  5990. rotation:null!=u.rotate?u.rotate*c:l.attachedRot,offset:[u.dx||0,u.dy||0]});var d=!1;if(null!=u.x?(
  5991. // TODO width of chart view.
  5992. a.x=je(u.x,e),a.setStyle("x",0),// Ignore movement in style. TODO: origin.
  5993. d=!0):(a.x=l.x,a.setStyle("x",l.style.x)),null!=u.y?(
  5994. // TODO height of chart view.
  5995. a.y=je(u.y,n),a.setStyle("y",0),// Ignore movement in style.
  5996. d=!0):(a.y=l.y,a.setStyle("y",l.style.y)),u.labelLinePoints){var h=s.getTextGuideLine();h&&(h.setShape({points:u.labelLinePoints}),
  5997. // Not update
  5998. d=!1)}Ig(a).needsUpdateLabelLine=d,a.rotation=null!=u.rotate?u.rotate*c:l.rotation,a.scaleX=l.scaleX,a.scaleY=l.scaleY;for(var p=0;p<wg.length;p++){var g=wg[p];a.setStyle(g,null!=u[g]?u[g]:l.style[g])}if(u.draggable){if(a.draggable=!0,a.cursor="move",s){var y=r.seriesModel;if(null!=r.dataIndex)y=r.seriesModel.getData(r.dataType).getItemModel(r.dataIndex);a.on("drag",i(s,y.getModel("labelLine")))}}else
  5999. // TODO Other drag functions?
  6000. a.off("drag"),a.cursor=l.cursor}},t.prototype.layout=function(t){var
  6001. // If average the shifts on all labels and add them to 0
  6002. // TODO: Not sure if should enable it.
  6003. // Pros: The angle of lines will distribute more equally
  6004. // Cons: In some layout. It may not what user wanted. like in pie. the label of last sector is usually changed unexpectedly.
  6005. e,n=t.getWidth(),i=t.getHeight(),o=mg(this._labelList),r=st(o,(function(t){return"shiftX"===t.layoutOption.moveOverlap})),a=st(o,(function(t){return"shiftY"===t.layoutOption.moveOverlap}));vg(r,"x","width",0,n,e),xg(a,0,i),_g(st(o,(function(t){return t.layoutOption.hideOverlap})))},
  6006. /**
  6007. * Process all labels. Not only labels with layoutOption.
  6008. */
  6009. t.prototype.processLabelsOverall=function(){var t=this;a(this._chartViewList,(function(e){var n=e.__model,i=e.ignoreLabelLineUpdate,o=n.isAnimationEnabled();e.group.traverse((function(e){if(e.ignore&&!e.forceLabelAnimation)return!0;// Stop traverse descendants.
  6010. var r=!i,a=e.getTextContent();!r&&a&&(r=Ig(a).needsUpdateLabelLine),r&&t._updateLabelLine(e,n),o&&t._animateLabels(e,n)}))}))},t.prototype._updateLabelLine=function(t,e){
  6011. // Only support label being hosted on graphic elements.
  6012. var n=t.getTextContent(),i=ni(t),o=i.dataIndex;
  6013. // Update label line style.
  6014. // Only support labelLine on the labels represent data.
  6015. if(n&&null!=o){var r=e.getData(i.dataType),a=r.getItemModel(o),s={},l=r.getItemVisual(o,"style");if(l){var u=r.getVisual("drawType");
  6016. // Default to be same with main color
  6017. s.stroke=l[u]}var c=a.getModel("labelLine");gg(t,yg(a),s),lg(t,c)}},t.prototype._animateLabels=function(t,e){var n=t.getTextContent(),i=t.getTextGuideLine();
  6018. // Animate
  6019. if(n&&(t.forceLabelAnimation||!n.ignore&&!n.invisible&&!t.disableLabelAnimation&&!ro(t))){var o=(f=Ig(n)).oldLayout,r=ni(t),a=r.dataIndex,s={x:n.x,y:n.y,rotation:n.rotation},l=e.getData(r.dataType);if(o){n.attr(o);
  6020. // Make sure the animation from is in the right status.
  6021. var u=t.prevStates;u&&(c(u,"select")>=0&&n.attr(f.oldLayoutSelect),c(u,"emphasis")>=0&&n.attr(f.oldLayoutEmphasis)),io(n,s,e,a)}else
  6022. // Disable fade in animation if value animation is enabled.
  6023. if(n.attr(s),!Qo(n).valueAnimation){var d=x(n.style.opacity,1);
  6024. // Fade in animation
  6025. n.style.opacity=0,oo(n,{style:{opacity:d}},e,a)}if(f.oldLayout=s,n.states.select){var h=f.oldLayoutSelect={};Tg(h,s,Cg),Tg(h,n.states.select,Cg)}if(n.states.emphasis){var p=f.oldLayoutEmphasis={};Tg(p,s,Cg),Tg(p,n.states.emphasis,Cg)}er(n,a,l,e,e)}if(i&&!i.ignore&&!i.invisible){o=(f=Dg(i)).oldLayout;var f,g={points:i.shape.points};o?(i.attr({shape:o}),io(i,{shape:g},e)):(i.setShape(g),i.style.strokePercent=0,oo(i,{style:{strokePercent:1}},e)),f.oldLayout=g}},t}();const Lg=Ag;var kg=On();function Pg(t){t.registerUpdateLifecycle("series:beforeupdate",(function(t,e,n){
  6026. // TODO api provide an namespace that can save stuff per instance
  6027. var i=kg(e).labelManager;i||(i=kg(e).labelManager=new Lg),i.clearLabels()})),t.registerUpdateLifecycle("series:layoutlabels",(function(t,e,n){var i=kg(e).labelManager;n.updatedSeries.forEach((function(t){i.addLabelsOfSeries(e.getViewOfSeriesModel(t))})),i.updateLayoutConfig(e),i.layout(e),i.processLabelsOverall()}))}function Ng(t){t.registerPainter("canvas",zt)}const Og=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return Ue(e,t),e.prototype.getInitialData=function(t){return Jh(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(t){var e=new Z,n=Gc("line",0,t.itemHeight/2,t.itemWidth,0,t.lineStyle.stroke,!1);e.add(n),n.setStyle(t.lineStyle);var i=this.getData().getVisual("symbol"),o=this.getData().getVisual("symbolRotate"),r="none"===i?"circle":i,a=.8*t.itemHeight,s=Gc(r,(t.itemWidth-a)/2,(t.itemHeight-a)/2,a,a,t.itemStyle.fill);e.add(s),s.setStyle(t.itemStyle);var l="inherit"===t.iconRotate?o:t.iconRotate||0;return s.rotation=l*Math.PI/180,s.setOrigin([t.itemWidth/2,t.itemHeight/2]),r.indexOf("empty")>-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),e},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={
  6028. // zlevel: 0,
  6029. z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},
  6030. // itemStyle: {
  6031. // },
  6032. endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},
  6033. // areaStyle: {
  6034. // origin of areaStyle. Valid values:
  6035. // `'auto'/null/undefined`: from axisLine to data
  6036. // `'start'`: from min to data
  6037. // `'end'`: from data to max
  6038. // origin: 'auto'
  6039. // },
  6040. // false, 'start', 'end', 'middle'
  6041. step:!1,
  6042. // Disabled if step is true
  6043. smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,
  6044. // `false`: follow the label interval strategy.
  6045. // `true`: show all symbols.
  6046. // `'auto'`: If possible, show all symbols, otherwise
  6047. // follow the label interval strategy.
  6048. showAllSymbol:"auto",
  6049. // Whether to connect break point.
  6050. connectNulls:!1,
  6051. // Sampling for large data. Can be: 'average', 'max', 'min', 'sum', 'lttb'.
  6052. sampling:"none",animationEasing:"linear",
  6053. // Disable progressive
  6054. progressive:0,hoverLayerThreshold:Infinity,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(Su);
  6055. /**
  6056. * @return label string. Not null/undefined
  6057. */function Rg(t,e){var n=t.mapDimensionsAll("defaultedLabel"),i=n.length;
  6058. // Simple optimization (in lots of cases, label dims length is 1)
  6059. if(1===i){var o=cl(t,e,n[0]);return null!=o?o+"":null}if(i){for(var r=[],a=0;a<n.length;a++)r.push(cl(t,e,n[a]));return r.join(" ")}}function Eg(t,e){var n=t.mapDimensionsAll("defaultedLabel");if(!i(e))return e+"";for(var o=[],r=0;r<n.length;r++){var a=t.getDimensionIndex(n[r]);a>=0&&o.push(e[a])}return o.join(" ")}var Vg=/** @class */function(t){function e(e,n,i,o){var r=t.call(this)||this;return r.updateData(e,n,i,o),r}return Ue(e,t),e.prototype._createSymbol=function(t,e,n,i,o){
  6060. // Remove paths created before
  6061. this.removeAll();
  6062. // let symbolPath = createSymbol(
  6063. // symbolType, -0.5, -0.5, 1, 1, color
  6064. // );
  6065. // If width/height are set too small (e.g., set to 1) on ios10
  6066. // and macOS Sierra, a circle stroke become a rect, no matter what
  6067. // the scale is set. So we set width/height as 2. See #4150.
  6068. var r=Gc(t,-1,-1,2,2,null,o);r.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),
  6069. // Rewrite drift method
  6070. r.drift=zg,this._symbolType=t,this.add(r)},
  6071. /**
  6072. * Stop animation
  6073. * @param {boolean} toLastFrame
  6074. */
  6075. e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},
  6076. /**
  6077. * FIXME:
  6078. * Caution: This method breaks the encapsulation of this module,
  6079. * but it indeed brings convenience. So do not use the method
  6080. * unless you detailedly know all the implements of `Symbol`,
  6081. * especially animation.
  6082. *
  6083. * Get symbol path element.
  6084. */
  6085. e.prototype.getSymbolPath=function(){return this.childAt(0)},
  6086. /**
  6087. * Highlight symbol
  6088. */
  6089. e.prototype.highlight=function(){ki(this.childAt(0))},
  6090. /**
  6091. * Downplay symbol
  6092. */
  6093. e.prototype.downplay=function(){Pi(this.childAt(0))},
  6094. /**
  6095. * @param {number} zlevel
  6096. * @param {number} z
  6097. */
  6098. e.prototype.setZ=function(t,e){var n=this.childAt(0);n.zlevel=t,n.z=e},e.prototype.setDraggable=function(t,e){var n=this.childAt(0);n.draggable=t,n.cursor=!e&&t?"move":n.cursor},
  6099. /**
  6100. * Update symbol properties
  6101. */
  6102. e.prototype.updateData=function(t,n,i,o){this.silent=!1;var r=t.getItemVisual(n,"symbol")||"circle",a=t.hostModel,s=e.getSymbolSize(t,n),l=r!==this._symbolType,u=o&&o.disableAnimation;if(l){var c=t.getItemVisual(n,"symbolKeepAspect");this._createSymbol(r,t,n,s,c)}else{(h=this.childAt(0)).silent=!1;var d={scaleX:s[0]/2,scaleY:s[1]/2};u?h.attr(d):io(h,d,a,n),uo(h)}if(this._updateCommon(t,n,s,i,o),l){var h=this.childAt(0);if(!u){d={scaleX:this._sizeX,scaleY:this._sizeY,style:{
  6103. // Always fadeIn. Because it has fadeOut animation when symbol is removed..
  6104. opacity:h.style.opacity}};h.scaleX=h.scaleY=0,h.style.opacity=0,oo(h,d,a,n)}}u&&
  6105. // Must stop leave transition manually if don't call initProps or updateProps.
  6106. this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,e,n,i,o){var r,a,s,l,u,c,d,h,f,g=this.childAt(0),y=t.hostModel;if(i&&(r=i.emphasisItemStyle,a=i.blurItemStyle,s=i.selectItemStyle,l=i.focus,u=i.blurScope,d=i.labelStatesModels,h=i.hoverScale,f=i.cursorStyle,c=i.emphasisDisabled),!i||t.hasItemOption){var m=i&&i.itemModel?i.itemModel:t.getItemModel(e),v=m.getModel("emphasis");r=v.getModel("itemStyle").getItemStyle(),s=m.getModel(["select","itemStyle"]).getItemStyle(),a=m.getModel(["blur","itemStyle"]).getItemStyle(),l=v.get("focus"),u=v.get("blurScope"),c=v.get("disabled"),d=Uo(m),h=v.getShallow("scale"),f=m.getShallow("cursor")}var x=t.getItemVisual(e,"symbolRotate");g.attr("rotation",(x||0)*Math.PI/180||0);var _=Wc(t.getItemVisual(e,"symbolOffset"),n);_&&(g.x=_[0],g.y=_[1]),f&&g.attr("cursor",f);var S=t.getItemVisual(e,"style"),w=S.fill;if(g instanceof b){var M=g.style;g.useStyle(p({
  6107. // TODO other properties like x, y ?
  6108. image:M.image,x:M.x,y:M.y,width:M.width,height:M.height},S))}else g.__isEmptyBrush?
  6109. // fill and stroke will be swapped if it's empty.
  6110. // So we cloned a new style to avoid it affecting the original style in visual storage.
  6111. // TODO Better implementation. No empty logic!
  6112. g.useStyle(p({},S)):g.useStyle(S),
  6113. // Disable decal because symbol scale will been applied on the decal.
  6114. g.style.decal=null,g.setColor(w,o&&o.symbolInnerColor),g.style.strokeNoScale=!0;var I=t.getItemVisual(e,"liftZ"),D=this._z2;null!=I?null==D&&(this._z2=g.z2,g.z2+=I):null!=D&&(g.z2=D,this._z2=null);var T=o&&o.useNameLabel;Yo(g,d,{labelFetcher:y,labelDataIndex:e,defaultText:
  6115. // Do not execute util needed.
  6116. function(e){return T?t.getName(e):Rg(t,e)},inheritColor:w,defaultOpacity:S.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var C=g.ensureState("emphasis");C.style=r,g.ensureState("select").style=s,g.ensureState("blur").style=a;
  6117. // null / undefined / true means to use default strategy.
  6118. // 0 / false / negative number / NaN / Infinity means no scale.
  6119. var A=null==h||!0===h?Math.max(1.1,3/this._sizeY):isFinite(h)&&h>0?+h:1;
  6120. // always set scale to allow resetting
  6121. C.scaleX=this._sizeX*A,C.scaleY=this._sizeY*A,this.setSymbolScale(1),Ui(this,l,u,c)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,e,n){var i=this.childAt(0),o=ni(this).dataIndex,r=n&&n.animation;
  6122. // Not show text when animating
  6123. if(
  6124. // Avoid mistaken hover when fading out
  6125. this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&ao(a,{style:{opacity:0}},e,{dataIndex:o,removeOpt:r,cb:function(){i.removeTextContent()}})}else i.removeTextContent();ao(i,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:o,cb:t,removeOpt:r})},e.getSymbolSize=function(t,e){return Fc(t.getItemVisual(e,"symbolSize"))},e}(Z);function zg(t,e){this.parent.drift(t,e)}const Bg=Vg;function Gg(t,e,n,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i.isIgnore&&i.isIgnore(n))&&!(i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&"none"!==t.getItemVisual(n,"symbol")}function Fg(t){return null==t||o(t)||(t={isIgnore:t}),t||{}}function Wg(t){var e=t.hostModel,n=e.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:Uo(e),cursorStyle:e.get("cursor")}}var Hg=/** @class */function(){function t(t){this.group=new Z,this._SymbolCtor=t||Bg}
  6126. /**
  6127. * Update symbols draw by new data
  6128. */return t.prototype.updateData=function(t,e){
  6129. // Remove progressive els.
  6130. this._progressiveEls=null,e=Fg(e);var n=this.group,i=t.hostModel,o=this._data,r=this._SymbolCtor,a=e.disableAnimation,s=Wg(t),l={disableAnimation:a},u=e.getSymbolPoint||function(e){return t.getItemLayout(e)};
  6131. // There is no oldLineData only when first rendering or switching from
  6132. // stream mode to normal mode, where previous elements should be removed.
  6133. o||n.removeAll(),t.diff(o).add((function(i){var o=u(i);if(Gg(t,o,i,e)){var a=new r(t,i,s,l);a.setPosition(o),t.setItemGraphicEl(i,a),n.add(a)}})).update((function(c,d){var h=o.getItemGraphicEl(d),p=u(c);if(Gg(t,p,c,e)){var f=t.getItemVisual(c,"symbol")||"circle",g=h&&h.getSymbolType&&h.getSymbolType();if(!h||g&&g!==f)n.remove(h),(h=new r(t,c,s,l)).setPosition(p);else{h.updateData(t,c,s,l);var y={x:p[0],y:p[1]};a?h.attr(y):io(h,y,i)}
  6134. // Add back
  6135. n.add(h),t.setItemGraphicEl(c,h)}else n.remove(h)})).remove((function(t){var e=o.getItemGraphicEl(t);e&&e.fadeOut((function(){n.remove(e)}),i)})).execute(),this._getSymbolPoint=u,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&
  6136. // Not use animation
  6137. e.eachItemGraphicEl((function(e,n){var i=t._getSymbolPoint(n);e.setPosition(i),e.markRedraw()}))},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=Wg(t),this._data=null,this.group.removeAll()},
  6138. /**
  6139. * Update symbols draw by new data
  6140. */
  6141. t.prototype.incrementalUpdate=function(t,e,n){function i(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}
  6142. // Clear
  6143. this._progressiveEls=[],n=Fg(n);for(var o=t.start;o<t.end;o++){var r=e.getItemLayout(o);if(Gg(e,r,o,n)){var a=new this._SymbolCtor(e,o,this._seriesScope);a.traverse(i),a.setPosition(r),this.group.add(a),e.setItemGraphicEl(o,a),this._progressiveEls.push(a)}}},t.prototype.eachRendered=function(t){Bo(this._progressiveEls||this.group,t)},t.prototype.remove=function(t){var e=this.group,n=this._data;
  6144. // Incremental model do not have this._data.
  6145. n&&t?n.eachItemGraphicEl((function(t){t.fadeOut((function(){e.remove(t)}),n.hostModel)})):e.removeAll()},t}();const Yg=Hg;function Ug(t,e,i){var o=t.getBaseAxis(),r=t.getOtherAxis(o),a=function(t,e){var n=0,i=t.scale.getExtent();"start"===e?n=i[0]:"end"===e?n=i[1]:l(e)&&!isNaN(e)?n=e:
  6146. // Both positive
  6147. i[0]>0?n=i[0]:i[1]<0&&(n=i[1]);return n}(r,i),s=o.dim,u=r.dim,c=e.mapDimension(u),d=e.mapDimension(s),h="x"===u||"radius"===u?1:0,p=n(t.dimensions,(function(t){return e.mapDimension(t)})),f=!1,g=e.getCalculationInfo("stackResultDimension");return qh(e,p[0]/* , dims[1] */)&&(
  6148. // jshint ignore:line
  6149. f=!0,p[0]=g),qh(e,p[1]/* , dims[0] */)&&(
  6150. // jshint ignore:line
  6151. f=!0,p[1]=g),{dataDimsForPoint:p,valueStart:a,valueAxisDim:u,baseAxisDim:s,stacked:!!f,valueDim:c,baseDim:d,baseDataOffset:h,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function Zg(t,e,n,i){var o=NaN;t.stacked&&(o=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(o)&&(o=t.valueStart);var r=t.baseDataOffset,a=[];return a[r]=n.get(t.baseDim,i),a[1-r]=o,e.dataToPoint(a)}var Xg=Math.min,jg=Math.max;function qg(t,e){return isNaN(t)||isNaN(e)}
  6152. /**
  6153. * Draw smoothed line in non-monotone, in may cause undesired curve in extreme
  6154. * situations. This should be used when points are non-monotone neither in x or
  6155. * y dimension.
  6156. */function Kg(t,e,n,i,o,r,a,s,l){for(var u,c,d,h,p,f,g=n,y=0;y<i;y++){var m=e[2*g],v=e[2*g+1];if(g>=o||g<0)break;if(qg(m,v)){if(l){g+=r;continue}break}if(g===n)t[r>0?"moveTo":"lineTo"](m,v),d=m,h=v;else{var x=m-u,_=v-c;
  6157. // Ignore tiny segment.
  6158. if(x*x+_*_<.5){g+=r;continue}if(a>0){
  6159. // Ignore duplicate point
  6160. for(var b=g+r,S=e[2*b],w=e[2*b+1];S===m&&w===v&&y<i;)y++,g+=r,S=e[2*(b+=r)],w=e[2*b+1],x=(m=e[2*g])-u,_=(v=e[2*g+1])-c;var M=y+1;if(l)
  6161. // Find next point not null
  6162. for(;qg(S,w)&&M<i;)M++,S=e[2*(b+=r)],w=e[2*b+1];var I=.5,D=0,T=0,C=void 0,A=void 0;
  6163. // Is last point
  6164. if(M>=i||qg(S,w))p=m,f=v;else{D=S-u,T=w-c;var L=m-u,k=S-m,P=v-c,N=w-v,O=void 0,R=void 0;if("x"===s){var E=D>0?1:-1;p=m-E*(O=Math.abs(L))*a,f=v,C=m+E*(R=Math.abs(k))*a,A=v}else if("y"===s){var V=T>0?1:-1;p=m,f=v-V*(O=Math.abs(P))*a,C=m,A=v+V*(R=Math.abs(N))*a}else O=Math.sqrt(L*L+P*P),p=m-D*a*(1-(
  6165. // Use ratio of seg length
  6166. I=(R=Math.sqrt(k*k+N*N))/(R+O))),f=v-T*a*(1-I),A=v+T*a*I,
  6167. // Smooth constraint between point and next point.
  6168. // Avoid exceeding extreme after smoothing.
  6169. C=Xg(
  6170. // cp0 of next segment
  6171. C=m+D*a*I,jg(S,m)),A=Xg(A,jg(w,v)),C=jg(C,Xg(S,m)),f=v-(T=(A=jg(A,Xg(w,v)))-v)*O/R,
  6172. // Smooth constraint between point and prev point.
  6173. // Avoid exceeding extreme after smoothing.
  6174. p=Xg(p=m-(
  6175. // Reclaculate cp1 based on the adjusted cp0 of next seg.
  6176. D=C-m)*O/R,jg(u,m)),f=Xg(f,jg(c,v)),C=m+(
  6177. // Adjust next cp0 again.
  6178. D=m-(p=jg(p,Xg(u,m))))*R/O,A=v+(T=v-(f=jg(f,Xg(c,v))))*R/O}t.bezierCurveTo(d,h,p,f,m,v),d=C,h=A}else t.lineTo(m,v)}u=m,c=v,g+=r}return y}var Jg=function(){this.smooth=0,this.smoothConstraint=!0},$g=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polyline",n}return Ue(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Jg},e.prototype.buildPath=function(t,e){var n=e.points,i=0,o=n.length/2;
  6179. // const result = getBoundingBox(points, shape.smoothConstraint);
  6180. if(e.connectNulls){
  6181. // Must remove first and last null values avoid draw error in polygon
  6182. for(;o>0&&qg(n[2*o-2],n[2*o-1]);o--);for(;i<o&&qg(n[2*i],n[2*i+1]);i++);}for(;i<o;)i+=Kg(t,n,i,o,o,1,e.smooth,e.smoothMonotone,e.connectNulls)+1},e.prototype.getPointOn=function(t,e){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n,i,o=this.path.data,r=kt.CMD,a="x"===e,s=[],l=0;l<o.length;){var u=void 0,c=void 0,d=void 0,h=void 0,p=void 0,f=void 0,g=void 0;switch(o[l++]){case r.M:n=o[l++],i=o[l++];break;case r.L:if(u=o[l++],c=o[l++],(g=a?(t-n)/(u-n):(t-i)/(c-i))<=1&&g>=0){var y=a?(c-i)*g+i:(u-n)*g+n;return a?[t,y]:[y,t]}n=u,i=c;break;case r.C:u=o[l++],c=o[l++],d=o[l++],h=o[l++],p=o[l++],f=o[l++];var m=a?Bt(n,u,d,p,t,s):Bt(i,c,h,f,t,s);if(m>0)for(var v=0;v<m;v++){var x=s[v];if(x<=1&&x>=0){y=a?Gt(i,c,h,f,x):Gt(n,u,d,p,x);return a?[t,y]:[y,t]}}n=p,i=f}}},e}(g),Qg=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e}(Jg),ty=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polygon",n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new Qg},e.prototype.buildPath=function(t,e){var n=e.points,i=e.stackedOnPoints,o=0,r=n.length/2,a=e.smoothMonotone;if(e.connectNulls){
  6183. // Must remove first and last null values avoid draw error in polygon
  6184. for(;r>0&&qg(n[2*r-2],n[2*r-1]);r--);for(;o<r&&qg(n[2*o],n[2*o+1]);o++);}for(;o<r;){var s=Kg(t,n,o,r,r,1,e.smooth,a,e.connectNulls);Kg(t,i,o+s-1,s,r,-1,e.stackedOnSmooth,a,e.connectNulls),o+=s+1,t.closePath()}},e}(g);function ey(t,e,n,i,o){var r=t.getArea(),a=r.x,s=r.y,l=r.width,u=r.height,c=n.get(["lineStyle","width"])||0;
  6185. // Expand the clip path a bit to avoid the border is clipped and looks thinner
  6186. a-=c/2,s-=c/2,l+=c,u+=c,
  6187. // fix: https://github.com/apache/incubator-echarts/issues/11369
  6188. l=Math.ceil(l),a!==Math.floor(a)&&(a=Math.floor(a),
  6189. // if no extra 1px on `width`, it will still be clipped since `x` is floored
  6190. l++);var d=new G({shape:{x:a,y:s,width:l,height:u}});if(e){var h=t.getBaseAxis(),p=h.isHorizontal(),g=h.inverse;p?(g&&(d.shape.x+=l),d.shape.width=0):(g||(d.shape.y+=u),d.shape.height=0);var y=f(o)?function(t){o(t,d)}:null;oo(d,{shape:{width:l,height:u,x:a,y:s}},n,null,i,y)}return d}function ny(t,e,n){var i=t.getArea(),o=qe(i.r0,1),r=qe(i.r,1),a=new E({shape:{cx:qe(t.cx,1),cy:qe(t.cy,1),r0:o,r:r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}});
  6191. // Avoid float number rounding error for symbol on the edge of axis extent.
  6192. e&&("angle"===t.getBaseAxis().dim?a.shape.endAngle=i.startAngle:a.shape.r=o,oo(a,{shape:{endAngle:i.endAngle,r:r}},n));return a}function iy(t,e,n,i,o){return t?"polar"===t.type?ny(t,e,n):"cartesian2d"===t.type?ey(t,e,n,i,o):null:null}
  6193. /*
  6194. * Licensed to the Apache Software Foundation (ASF) under one
  6195. * or more contributor license agreements. See the NOTICE file
  6196. * distributed with this work for additional information
  6197. * regarding copyright ownership. The ASF licenses this file
  6198. * to you under the Apache License, Version 2.0 (the
  6199. * "License"); you may not use this file except in compliance
  6200. * with the License. You may obtain a copy of the License at
  6201. *
  6202. * http://www.apache.org/licenses/LICENSE-2.0
  6203. *
  6204. * Unless required by applicable law or agreed to in writing,
  6205. * software distributed under the License is distributed on an
  6206. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  6207. * KIND, either express or implied. See the License for the
  6208. * specific language governing permissions and limitations
  6209. * under the License.
  6210. */
  6211. /**
  6212. * AUTO-GENERATED FILE. DO NOT MODIFY.
  6213. */
  6214. /*
  6215. * Licensed to the Apache Software Foundation (ASF) under one
  6216. * or more contributor license agreements. See the NOTICE file
  6217. * distributed with this work for additional information
  6218. * regarding copyright ownership. The ASF licenses this file
  6219. * to you under the Apache License, Version 2.0 (the
  6220. * "License"); you may not use this file except in compliance
  6221. * with the License. You may obtain a copy of the License at
  6222. *
  6223. * http://www.apache.org/licenses/LICENSE-2.0
  6224. *
  6225. * Unless required by applicable law or agreed to in writing,
  6226. * software distributed under the License is distributed on an
  6227. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  6228. * KIND, either express or implied. See the License for the
  6229. * specific language governing permissions and limitations
  6230. * under the License.
  6231. */function oy(t,e){return t.type===e}function ry(t,e){if(t.length===e.length){for(var n=0;n<t.length;n++)if(t[n]!==e[n])return;return!0}}function ay(t){for(var e=Infinity,n=Infinity,i=-Infinity,o=-Infinity,r=0;r<t.length;){var a=t[r++],s=t[r++];isNaN(a)||(e=Math.min(a,e),i=Math.max(a,i)),isNaN(s)||(n=Math.min(s,n),o=Math.max(s,o))}return[[e,n],[i,o]]}function sy(t,e){var n=ay(t),i=n[0],o=n[1],r=ay(e),a=r[0],s=r[1];
  6232. // Get a max value from each corner of two boundings.
  6233. return Math.max(Math.abs(i[0]-a[0]),Math.abs(i[1]-a[1]),Math.abs(o[0]-s[0]),Math.abs(o[1]-s[1]))}function ly(t){return l(t)?t:t?.5:0}
  6234. /**
  6235. * Filter the null data and extend data for step considering `stepTurnAt`
  6236. *
  6237. * @param points data to convert, that may containing null
  6238. * @param basePoints base data to reference, used only for areaStyle points
  6239. * @param coordSys coordinate system
  6240. * @param stepTurnAt 'start' | 'end' | 'middle' | true
  6241. * @param connectNulls whether to connect nulls
  6242. * @returns converted point positions
  6243. */
  6244. function uy(t,e,n,i,o){var r=n.getBaseAxis(),a="x"===r.dim||"radius"===r.dim?0:1,s=[],l=0,u=[],c=[],d=[],h=[];if(o){for(l=0;l<t.length;l+=2){
  6245. /**
  6246. * For areaStyle of stepped lines, `stackedOnPoints` should be
  6247. * filtered the same as `points` so that the base axis values
  6248. * should stay the same as the lines above. See #20021
  6249. */
  6250. var p=e||t;isNaN(p[l])||isNaN(p[l+1])||h.push(t[l],t[l+1])}t=h}for(l=0;l<t.length-2;l+=2)switch(d[0]=t[l+2],d[1]=t[l+3],c[0]=t[l],c[1]=t[l+1],s.push(c[0],c[1]),i){case"end":u[a]=d[a],u[1-a]=c[1-a],s.push(u[0],u[1]);break;case"middle":var f=(c[a]+d[a])/2,g=[];u[a]=g[a]=f,u[1-a]=c[1-a],g[1-a]=d[1-a],s.push(u[0],u[1]),s.push(g[0],g[1]);break;default:
  6251. // default is start
  6252. u[a]=c[a],u[1-a]=d[1-a],s.push(u[0],u[1])}
  6253. // Last points
  6254. return s.push(t[l++],t[l++]),s}
  6255. /**
  6256. * Clip color stops to edge. Avoid creating too large gradients.
  6257. * Which may lead to blurry when GPU acceleration is enabled. See #15680
  6258. *
  6259. * The stops has been sorted from small to large.
  6260. */function cy(t,e,i){var o=t.getVisual("visualMeta");if(o&&o.length&&t.count()&&"cartesian2d"===e.type){for(var r,s,l=o.length-1;l>=0;l--){var u=t.getDimensionInfo(o[l].dimension);
  6261. // Can only be x or y
  6262. if("x"===(r=u&&u.coordDim)||"y"===r){s=o[l];break}}if(s){
  6263. // If the area to be rendered is bigger than area defined by LinearGradient,
  6264. // the canvas spec prescribes that the color of the first stop and the last
  6265. // stop should be used. But if two stops are added at offset 0, in effect
  6266. // browsers use the color of the second stop to render area outside
  6267. // LinearGradient. So we can only infinitesimally extend area defined in
  6268. // LinearGradient to render `outerColors`.
  6269. var c=e.getAxis(r),d=n(s.stops,(function(t){
  6270. // offset will be calculated later.
  6271. return{coord:c.toGlobalCoord(c.dataToCoord(t.value)),color:t.color}})),h=d.length,p=s.outerColors.slice();
  6272. // dataToCoord mapping may not be linear, but must be monotonic.
  6273. h&&d[0].coord>d[h-1].coord&&(d.reverse(),p.reverse());var f=function(t,e){var n,i,o=[],r=t.length;function a(t,e,n){var i=t.coord,o=(n-i)/(e.coord-i);return{coord:n,color:Ft(o,[t.color,e.color])}}for(var s=0;s<r;s++){var l=t[s],u=l.coord;if(u<0)n=l;else{if(u>e){i?o.push(a(i,l,e)):n&&
  6274. // If there are two stops and coord range is between these two stops
  6275. o.push(a(n,l,0),a(n,l,e));
  6276. // All following stop will be out of range. So just ignore them.
  6277. break}n&&(o.push(a(n,l,0)),
  6278. // Reset
  6279. n=null),o.push(l),i=l}}return o}(d,"x"===r?i.getWidth():i.getHeight()),g=f.length;if(!g&&h)
  6280. // All stops are out of range. All will be the same color.
  6281. return d[0].coord<0?p[1]?p[1]:d[h-1].color:p[0]?p[0]:d[0].color;var y=f[0].coord-10,m=f[g-1].coord+10,v=m-y;// Arbitrary value: 10px
  6282. if(v<.001)return"transparent";a(f,(function(t){t.offset=(t.coord-y)/v})),f.push({
  6283. // NOTE: inRangeStopLen may still be 0 if stoplen is zero.
  6284. offset:g?f[g-1].offset:.5,color:p[1]||"transparent"}),f.unshift({offset:g?f[0].offset:.5,color:p[0]||"transparent"});var x=new j(0,0,0,0,f,!0);return x[r]=y,x[r+"2"]=m,x}}}function dy(t,e,n){var i=t.get("showAllSymbol"),o="auto"===i;if(!i||o){var r=n.getAxesByScale("ordinal")[0];if(r&&(!o||!function(t,e){
  6285. // In most cases, line is monotonous on category axis, and the label size
  6286. // is close with each other. So we check the symbol size and some of the
  6287. // label size alone with the category axis to estimate whether all symbol
  6288. // can be shown without overlap.
  6289. var n=t.getExtent(),i=Math.abs(n[1]-n[0])/t.scale.count();isNaN(i)&&(i=0);for(// 0/0 is NaN.
  6290. // Sampling some points, max 5.
  6291. var o=e.count(),r=Math.max(1,Math.round(o/5)),a=0;a<o;a+=r)if(1.5*Bg.getSymbolSize(e,a)[t.isHorizontal()?1:0]>i)return!1;return!0}(r,e)))
  6292. // Note that category label interval strategy might bring some weird effect
  6293. // in some scenario: users may wonder why some of the symbols are not
  6294. // displayed. So we show all symbols as possible as we can.
  6295. {
  6296. // Otherwise follow the label interval strategy on category axis.
  6297. var s=e.mapDimension(r.dim),l={};return a(r.getViewLabels(),(function(t){var e=r.scale.getRawOrdinalNumber(t.tickValue);l[e]=1})),function(t){return!l.hasOwnProperty(e.get(s,t))}}}}function hy(t,e){return[t[2*e],t[2*e+1]]}function py(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e<li.length;e++)if(t.get([li[e],"endLabel","show"]))return!0;return!1}function fy(t,e,n,i){if(oy(e,"cartesian2d")){var o=i.getModel("endLabel"),r=o.get("valueAnimation"),a=i.getData(),s={lastFrameIndex:0},l=py(i)?function(n,i){t._endLabelOnDuring(n,i,a,s,r,o,e)}:null,u=e.getBaseAxis().isHorizontal(),c=ey(e,n,i,(function(){var e=t._endLabel;e&&n&&null!=s.originalX&&e.attr({x:s.originalX,y:s.originalY})}),l);
  6298. // Expand clip shape to avoid clipping when line value exceeds axis
  6299. if(!i.get("clip",!0)){var d=c.shape,h=Math.max(d.width,d.height);u?(d.y-=h,d.height+=2*h):(d.x-=h,d.width+=2*h)}
  6300. // Set to the final frame. To make sure label layout is right.
  6301. return l&&l(1,c),c}return ny(e,n,i)}var gy=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.init=function(){var t=new Z,e=new Yg;this.group.add(e.group),this._symbolDraw=e,this._lineGroup=t,this._changePolyState=lt(this._changePolyState,this)},e.prototype.render=function(t,e,n){var i=t.coordinateSystem,o=this.group,r=t.getData(),a=t.getModel("lineStyle"),s=t.getModel("areaStyle"),l=r.getLayout("points")||[],u="polar"===i.type,c=this._coordSys,d=this._symbolDraw,h=this._polyline,p=this._polygon,f=this._lineGroup,g=!e.ssr&&t.get("animation"),y=!s.isEmpty(),m=s.get("origin"),v=Ug(i,r,m),x=y&&function(t,e,n){if(!n.valueDim)return[];for(var i=e.count(),o=xp(2*i),r=0;r<i;r++){var a=Zg(n,t,e,r);o[2*r]=a[0],o[2*r+1]=a[1]}return o}(i,r,v),_=t.get("showSymbol"),b=t.get("connectNulls"),S=_&&!u&&dy(t,r,i),w=this._data;w&&w.eachItemGraphicEl((function(t,e){t.__temp&&(o.remove(t),w.setItemGraphicEl(e,null))})),
  6302. // Remove previous created symbols if showSymbol changed to false
  6303. _||d.remove(),o.add(f);
  6304. // FIXME step not support polar
  6305. var M,D=!u&&t.get("step");i&&i.getArea&&t.get("clip",!0)&&(
  6306. // Avoid float number rounding error for symbol on the edge of axis extent.
  6307. // See #7913 and `test/dataZoom-clip.html`.
  6308. null!=(M=i.getArea()).width?(M.x-=.1,M.y-=.1,M.width+=.2,M.height+=.2):M.r0&&(M.r0-=.5,M.r+=.5)),this._clipShapeForSymbol=M;var T=cy(r,i,n)||r.getVisual("style")[r.getVisual("drawType")];
  6309. // Initialization animation or coordinate system changed
  6310. if(h&&c.type===i.type&&D===this._step){y&&!p?
  6311. // If areaStyle is added
  6312. p=this._newPolygon(l,x):p&&!y&&(
  6313. // If areaStyle is removed
  6314. f.remove(p),p=this._polygon=null),
  6315. // NOTE: Must update _endLabel before setClipPath.
  6316. u||this._initOrUpdateEndLabel(t,i,ha(T));
  6317. // Update clipPath
  6318. var C=f.getClipPath();if(C)oo(C,{shape:fy(this,i,!1,t).shape},t);else f.setClipPath(fy(this,i,!0,t));
  6319. // Always update, or it is wrong in the case turning on legend
  6320. // because points are not changed.
  6321. _&&d.updateData(r,{isIgnore:S,clipShape:M,disableAnimation:!0,getSymbolPoint:function(t){return[l[2*t],l[2*t+1]]}}),
  6322. // In the case data zoom triggered refreshing frequently
  6323. // Data may not change if line has a category axis. So it should animate nothing.
  6324. ry(this._stackedOnPoints,x)&&ry(this._points,l)||(g?this._doUpdateAnimation(r,x,i,n,D,m,b):(
  6325. // Not do it in update with animation
  6326. D&&(x&&(x=uy(x,l,i,D,b)),
  6327. // TODO If stacked series is not step
  6328. l=uy(l,null,i,D,b)),h.setShape({points:l}),p&&p.setShape({points:l,stackedOnPoints:x})))}else _&&d.updateData(r,{isIgnore:S,clipShape:M,disableAnimation:!0,getSymbolPoint:function(t){return[l[2*t],l[2*t+1]]}}),g&&this._initSymbolLabelAnimation(r,i,M),D&&(x&&(x=uy(x,l,i,D,b)),
  6329. // TODO If stacked series is not step
  6330. l=uy(l,null,i,D,b)),h=this._newPolyline(l),y?p=this._newPolygon(l,x):p&&(f.remove(p),p=this._polygon=null),
  6331. // NOTE: Must update _endLabel before setClipPath.
  6332. u||this._initOrUpdateEndLabel(t,i,ha(T)),f.setClipPath(fy(this,i,!0,t));var A=t.getModel("emphasis"),L=A.get("focus"),k=A.get("blurScope"),P=A.get("disabled");(h.useStyle(I(
  6333. // Use color in lineStyle first
  6334. a.getLineStyle(),{fill:"none",stroke:T,lineJoin:"bevel"})),qi(h,t,"lineStyle"),h.style.lineWidth>0&&"bolder"===t.get(["emphasis","lineStyle","width"]))&&(h.getState("emphasis").style.lineWidth=+h.style.lineWidth+1);
  6335. // Needs seriesIndex for focus
  6336. ni(h).seriesIndex=t.seriesIndex,Ui(h,L,k,P);var N=ly(t.get("smooth")),O=t.get("smoothMonotone");if(h.setShape({smooth:N,smoothMonotone:O,connectNulls:b}),p){var R=r.getCalculationInfo("stackedOnSeries"),E=0;p.useStyle(I(s.getAreaStyle(),{fill:T,opacity:.7,lineJoin:"bevel",decal:r.getVisual("style").decal})),R&&(E=ly(R.get("smooth"))),p.setShape({smooth:N,stackedOnSmooth:E,smoothMonotone:O,connectNulls:b}),qi(p,t,"areaStyle"),
  6337. // Needs seriesIndex for focus
  6338. ni(p).seriesIndex=t.seriesIndex,Ui(p,L,k,P)}var V=this._changePolyState;r.eachItemGraphicEl((function(t){
  6339. // Switch polyline / polygon state if element changed its state.
  6340. t&&(t.onHoverStateChange=V)})),this._polyline.onHoverStateChange=V,this._data=r,
  6341. // Save the coordinate system for transition animation when data changed
  6342. this._coordSys=i,this._stackedOnPoints=x,this._points=l,this._step=D,this._valueOrigin=m,t.get("triggerLineEvent")&&(this.packEventData(t,h),p&&this.packEventData(t,p))},e.prototype.packEventData=function(t,e){ni(e).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,e,n,i){var o=t.getData(),r=Nn(o,i);if(this._changePolyState("emphasis"),!(r instanceof Array)&&null!=r&&r>=0){var a=o.getLayout("points"),s=o.getItemGraphicEl(r);if(!s){
  6343. // Create a temporary symbol if it is not exists
  6344. var l=a[2*r],u=a[2*r+1];if(isNaN(l)||isNaN(u))
  6345. // Null data
  6346. return;
  6347. // fix #11360: shouldn't draw symbol outside clipShapeForSymbol
  6348. if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;var c=t.get("zlevel")||0,d=t.get("z")||0;(s=new Bg(o,r)).x=l,s.y=u,s.setZ(c,d);
  6349. // ensure label text of the temporary symbol is in front of line and area polygon
  6350. var h=s.getSymbolPath().getTextContent();h&&(h.zlevel=c,h.z=d,h.z2=this._polyline.z2+1),s.__temp=!0,o.setItemGraphicEl(r,s),
  6351. // Stop scale animation
  6352. s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else
  6353. // Highlight whole series
  6354. Ou.prototype.highlight.call(this,t,e,n,i)},e.prototype.downplay=function(t,e,n,i){var o=t.getData(),r=Nn(o,i);if(this._changePolyState("normal"),null!=r&&r>=0){var a=o.getItemGraphicEl(r);a&&(a.__temp?(o.setItemGraphicEl(r,null),this.group.remove(a)):a.downplay())}else
  6355. // FIXME
  6356. // can not downplay completely.
  6357. // Downplay whole series
  6358. Ou.prototype.downplay.call(this,t,e,n,i)},e.prototype._changePolyState=function(t){var e=this._polygon;Di(this._polyline,t),e&&Di(e,t)},e.prototype._newPolyline=function(t){var e=this._polyline;
  6359. // Remove previous created polyline
  6360. return e&&this._lineGroup.remove(e),e=new $g({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(e),this._polyline=e,e},e.prototype._newPolygon=function(t,e){var n=this._polygon;
  6361. // Remove previous created polygon
  6362. return n&&this._lineGroup.remove(n),n=new ty({shape:{points:t,stackedOnPoints:e},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(t,e,n){var i,o,r=e.getBaseAxis(),a=r.inverse;"cartesian2d"===e.type?(i=r.isHorizontal(),o=!1):"polar"===e.type&&(i="angle"===r.dim,o=!0);var s=t.hostModel,l=s.get("animationDuration");f(l)&&(l=l(null));var u=s.get("animationDelay")||0,c=f(u)?u(null):u;t.eachItemGraphicEl((function(t,r){var s=t;if(s){var d=[t.x,t.y],h=void 0,p=void 0,g=void 0;if(n)if(o){var y=n,m=e.pointToCoord(d);i?(h=y.startAngle,p=y.endAngle,g=-m[1]/180*Math.PI):(h=y.r0,p=y.r,g=m[0])}else{var v=n;i?(h=v.x,p=v.x+v.width,g=t.x):(h=v.y+v.height,p=v.y,g=t.y)}var x=p===h?0:(g-h)/(p-h);a&&(x=1-x);var _=f(u)?u(r):l*x+c,b=s.getSymbolPath(),S=b.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:_}),S&&S.animateFrom({style:{opacity:0}},{duration:300,delay:_}),b.disableLabelAnimation=!0}}))},e.prototype._initOrUpdateEndLabel=function(t,e,n){var i=t.getModel("endLabel");if(py(t)){var o=t.getData(),r=this._polyline,a=o.getLayout("points");if(!a)return r.removeTextContent(),void(this._endLabel=null);var s=this._endLabel;s||((s=this._endLabel=new $({z2:200})).ignoreClip=!0,r.setTextContent(this._endLabel),r.disableLabelAnimation=!0);
  6363. // Find last non-NaN data to display data
  6364. var l=function(t){for(var e,n,i=t.length/2;i>0&&(e=t[2*i-2],n=t[2*i-1],isNaN(e)||isNaN(n));i--);return i-1}(a);l>=0&&(Yo(r,Uo(t,"endLabel"),{inheritColor:n,labelFetcher:t,labelDataIndex:l,defaultText:function(t,e,n){return null!=n?Eg(o,n):Rg(o,t)},enableTextSetter:!0},function(t,e){var n=e.getBaseAxis(),i=n.isHorizontal(),o=n.inverse,r=i?o?"right":"left":"center",a=i?"middle":o?"top":"bottom";return{normal:{align:t.get("align")||r,verticalAlign:t.get("verticalAlign")||a}}}(i,e)),r.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,e,n,i,o,r,a){var s=this._endLabel,l=this._polyline;if(s){
  6365. // NOTE: Don't remove percent < 1. percent === 1 means the first frame during render.
  6366. // The label is not prepared at this time.
  6367. t<1&&null==i.originalX&&(i.originalX=s.x,i.originalY=s.y);var u=n.getLayout("points"),c=n.hostModel,d=c.get("connectNulls"),h=r.get("precision"),p=r.get("distance")||0,f=a.getBaseAxis(),g=f.isHorizontal(),y=f.inverse,m=e.shape,v=y?g?m.x:m.y+m.height:g?m.x+m.width:m.y,x=(g?p:0)*(y?-1:1),_=(g?0:-p)*(y?-1:1),b=g?"x":"y",S=function(t,e,n){for(var i,o,r=t.length/2,a="x"===n?0:1,s=0,l=-1,u=0;u<r;u++)if(o=t[2*u+a],!isNaN(o)&&!isNaN(t[2*u+1-a]))if(0!==u){if(i<=e&&o>=e||i>=e&&o<=e){l=u;break}s=u,i=o}else i=o;return{range:[s,l],t:(e-i)/(o-i)}}(u,v,b),w=S.range,M=w[1]-w[0],I=void 0;if(M>=1){
  6368. // diff > 1 && connectNulls, which is on the null data.
  6369. if(M>1&&!d){var D=hy(u,w[0]);s.attr({x:D[0]+x,y:D[1]+_}),o&&(I=c.getRawValue(w[0]))}else{(D=l.getPointOn(v,b))&&s.attr({x:D[0]+x,y:D[1]+_});var T=c.getRawValue(w[0]),C=c.getRawValue(w[1]);o&&(I=Hn(n,h,T,C,S.t))}i.lastFrameIndex=w[0]}else{
  6370. // If diff <= 0, which is the range is not found(Include NaN)
  6371. // Choose the first point or last point.
  6372. var A=1===t||i.lastFrameIndex>0?w[0]:0;D=hy(u,A);o&&(I=c.getRawValue(A)),s.attr({x:D[0]+x,y:D[1]+_})}if(o){var L=Qo(s);"function"==typeof L.setLabelText&&L.setLabelText(I)}}},
  6373. /**
  6374. * @private
  6375. */
  6376. // FIXME Two value axis
  6377. e.prototype._doUpdateAnimation=function(t,e,n,i,o,r,a){var s=this._polyline,l=this._polygon,u=t.hostModel,c=function(t,e,n,i,o,r,a){for(var s=function(t,e){var n=[];return e.diff(t).add((function(t){n.push({cmd:"+",idx:t})})).update((function(t,e){n.push({cmd:"=",idx:e,idx1:t})})).remove((function(t){n.push({cmd:"-",idx:t})})).execute(),n}(t,e),l=[],u=[],c=[],d=[],h=[],p=[],f=[],g=Ug(o,e,a),y=t.getLayout("points")||[],m=e.getLayout("points")||[],v=0
  6378. // let newIdList = newData.mapArray(newData.getId);
  6379. // let oldIdList = oldData.mapArray(oldData.getId);
  6380. // convertToIntId(newIdList, oldIdList);
  6381. // // FIXME One data ?
  6382. // diff = arrayDiff(oldIdList, newIdList);
  6383. ;v<s.length;v++){var x=s[v],_=!0,b=void 0,S=void 0;
  6384. // FIXME, animation is not so perfect when dataZoom window moves fast
  6385. // Which is in case remvoing or add more than one data in the tail or head
  6386. switch(x.cmd){case"=":b=2*x.idx,S=2*x.idx1;var w=y[b],M=y[b+1],I=m[S],D=m[S+1];
  6387. // If previous data is NaN, use next point directly
  6388. (isNaN(w)||isNaN(M))&&(w=I,M=D),l.push(w,M),u.push(I,D),c.push(n[b],n[b+1]),d.push(i[S],i[S+1]),f.push(e.getRawIndex(x.idx1));break;case"+":var T=x.idx,C=g.dataDimsForPoint,A=o.dataToPoint([e.get(C[0],T),e.get(C[1],T)]);S=2*T,l.push(A[0],A[1]),u.push(m[S],m[S+1]);var L=Zg(g,o,e,T);c.push(L[0],L[1]),d.push(i[S],i[S+1]),f.push(e.getRawIndex(T));break;case"-":_=!1}
  6389. // Original indices
  6390. _&&(h.push(x),p.push(p.length))}
  6391. // Diff result may be crossed if all items are changed
  6392. // Sort by data index
  6393. p.sort((function(t,e){return f[t]-f[e]}));var k=l.length,P=xp(k),N=xp(k),O=xp(k),R=xp(k),E=[];for(v=0;v<p.length;v++){var V=p[v],z=2*v,B=2*V;P[z]=l[B],P[z+1]=l[B+1],N[z]=u[B],N[z+1]=u[B+1],O[z]=c[B],O[z+1]=c[B+1],R[z]=d[B],R[z+1]=d[B+1],E[v]=h[V]}return{current:P,next:N,stackedOnCurrent:O,stackedOnNext:R,status:E}}(this._data,t,this._stackedOnPoints,e,this._coordSys,0,this._valueOrigin),d=c.current,h=c.stackedOnCurrent,p=c.next,f=c.stackedOnNext;
  6394. // Don't apply animation if diff is large.
  6395. // For better result and avoid memory explosion problems like
  6396. // https://github.com/apache/incubator-echarts/issues/12229
  6397. if(o&&(
  6398. // TODO If stacked series is not step
  6399. h=uy(c.stackedOnCurrent,c.current,n,o,a),d=uy(c.current,null,n,o,a),f=uy(c.stackedOnNext,c.next,n,o,a),p=uy(c.next,null,n,o,a)),sy(d,p)>3e3||l&&sy(h,f)>3e3)return s.stopAnimation(),s.setShape({points:p}),void(l&&(l.stopAnimation(),l.setShape({points:p,stackedOnPoints:f})));s.shape.__points=c.current,s.shape.points=d;var g={shape:{points:p}};
  6400. // Also animate the original points.
  6401. // If points reference is changed when turning into step line.
  6402. c.current!==d&&(g.shape.__points=c.next),
  6403. // Stop previous animation.
  6404. s.stopAnimation(),io(s,g,u),l&&(l.setShape({
  6405. // Reuse the points with polyline.
  6406. points:d,stackedOnPoints:h}),l.stopAnimation(),io(l,{shape:{stackedOnPoints:f}},u),
  6407. // If use attr directly in updateProps.
  6408. s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var y=[],m=c.status,v=0;v<m.length;v++){if("="===m[v].cmd){var x=t.getItemGraphicEl(m[v].idx1);x&&y.push({el:x,ptIdx:v})}}s.animators&&s.animators.length&&s.animators[0].during((function(){l&&l.dirtyShape();for(var t=s.shape.__points,e=0;e<y.length;e++){var n=y[e].el,i=2*y[e].ptIdx;n.x=t[i],n.y=t[i+1],n.markRedraw()}}))},e.prototype.remove=function(t){var e=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),
  6409. // Remove temporary created elements when highlighting
  6410. n&&n.eachItemGraphicEl((function(t,i){t.__temp&&(e.remove(t),n.setItemGraphicEl(i,null))})),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},e.type="line",e}(Ou);const yy=gy;function my(t,e){return{seriesType:t,plan:Iu(),reset:function(t){var i=t.getData(),o=t.coordinateSystem,r=t.pipelineContext,a=e||r.large;if(o){var s=n(o.dimensions,(function(t){return i.mapDimension(t)})).slice(0,2),l=s.length,u=i.getCalculationInfo("stackResultDimension");qh(i,s[0])&&(s[0]=u),qh(i,s[1])&&(s[1]=u);var c=i.getStore(),d=i.getDimensionIndex(s[0]),h=i.getDimensionIndex(s[1]);return l&&{progress:function(t,e){for(var n=t.end-t.start,i=a&&xp(n*l),r=[],s=[],u=t.start,p=0;u<t.end;u++){var f=void 0;if(1===l){var g=c.get(d,u);
  6411. // NOTE: Make sure the second parameter is null to use default strategy.
  6412. f=o.dataToPoint(g,null,s)}else r[0]=c.get(d,u),r[1]=c.get(h,u),
  6413. // Let coordinate system to handle the NaN data.
  6414. f=o.dataToPoint(r,null,s);a?(i[p++]=f[0],i[p++]=f[1]):e.setItemLayout(u,f.slice())}a&&e.setLayout("points",i)}}}}}}var vy={average:function(t){for(var e=0,n=0,i=0;i<t.length;i++)isNaN(t[i])||(e+=t[i],n++);
  6415. // Return NaN if count is 0
  6416. return 0===n?NaN:e/n},sum:function(t){for(var e=0,n=0;n<t.length;n++)
  6417. // Ignore NaN
  6418. e+=t[n]||0;return e},max:function(t){for(var e=-Infinity,n=0;n<t.length;n++)t[n]>e&&(e=t[n]);
  6419. // NaN will cause illegal axis extent.
  6420. return isFinite(e)?e:NaN},min:function(t){for(var e=Infinity,n=0;n<t.length;n++)t[n]<e&&(e=t[n]);
  6421. // NaN will cause illegal axis extent.
  6422. return isFinite(e)?e:NaN},
  6423. // TODO
  6424. // Median
  6425. nearest:function(t){return t[0]}},xy=function(t){return Math.round(t.length/2)};function _y(e){return{seriesType:e,
  6426. // FIXME:TS never used, so comment it
  6427. // modifyOutputEnd: true,
  6428. reset:function(e,n,i){var o=e.getData(),r=e.get("sampling"),a=e.coordinateSystem,s=o.count();
  6429. // Only cartesian2d support down sampling. Disable it when there is few data.
  6430. if(s>10&&"cartesian2d"===a.type&&r){var l=a.getBaseAxis(),u=a.getOtherAxis(l),c=l.getExtent(),d=i.getDevicePixelRatio(),h=Math.abs(c[1]-c[0])*(d||1),p=Math.round(s/h);if(isFinite(p)&&p>1){"lttb"===r?e.setData(o.lttbDownSample(o.mapDimension(u.dim),1/p)):"minmax"===r&&e.setData(o.minmaxDownSample(o.mapDimension(u.dim),1/p));var g=void 0;t(r)?g=vy[r]:f(r)&&(g=r),g&&
  6431. // Only support sample the first dim mapped from value axis.
  6432. e.setData(o.downSample(o.mapDimension(u.dim),1/p,g,xy))}}}}}var by=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.getInitialData=function(t,e){return Jh(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,e,n){var i=this.coordinateSystem;if(i&&i.clampData){
  6433. // PENDING if clamp ?
  6434. var o=i.clampData(t),r=i.dataToPoint(o);if(n)a(i.getAxes(),(function(t,n){
  6435. // If axis type is category, use tick coords instead
  6436. if("category"===t.type&&null!=e){var i=t.getTicksCoords(),a=t.getTickModel().get("alignWithLabel"),s=o[n],l="x1"===e[n]||"y1"===e[n];
  6437. // The only contains one tick, tickCoords is
  6438. // like [{coord: 0, tickValue: 0}, {coord: 0}]
  6439. // to the length should always be larger than 1
  6440. if(l&&!a&&(s+=1),i.length<2)return;if(2===i.length)
  6441. // The left value and right value of the axis are
  6442. // the same. coord is 0 in both items. Use the max
  6443. // value of the axis as the coord
  6444. return void(r[n]=t.toGlobalCoord(t.getExtent()[l?1:0]));for(var u=void 0,c=void 0,d=1,h=0;h<i.length;h++){var p=i[h].coord,f=h===i.length-1?i[h-1].tickValue+d:i[h].tickValue;
  6445. // The last item of tickCoords doesn't contain
  6446. // tickValue
  6447. if(f===s){c=p;break}if(f<s)u=p;else if(null!=u&&f>s){c=(p+u)/2;break}1===h&&(
  6448. // Here we assume the step of category axes is
  6449. // the same
  6450. d=f-i[0].tickValue)}null==c&&(u?u&&(
  6451. // targetTickId is larger than all tick ids in the
  6452. // visible area, use the rightmost tick coord
  6453. c=i[i.length-1].coord):
  6454. // targetTickId is smaller than all tick ids in the
  6455. // visible area, use the leftmost tick coord
  6456. c=i[0].coord),r[n]=t.toGlobalCoord(c)}}));else{var s=this.getData(),l=s.getLayout("offset"),u=s.getLayout("size"),c=i.getBaseAxis().isHorizontal()?0:1;r[c]+=l+u/2}return r}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={
  6457. // zlevel: 0,
  6458. z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,
  6459. // stack: null
  6460. // Cartesian coordinate system
  6461. // xAxisIndex: 0,
  6462. // yAxisIndex: 0,
  6463. barMinHeight:0,barMinAngle:0,
  6464. // cursor: null,
  6465. large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(Su);Su.registerClass(by);const Sy=by;const wy=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.getInitialData=function(){return Jh(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},
  6466. /**
  6467. * @override
  6468. */
  6469. e.prototype.getProgressive=function(){
  6470. // Do not support progressive in normal mode.
  6471. return!!this.get("large")&&this.get("progressive")},
  6472. /**
  6473. * @override
  6474. */
  6475. e.prototype.getProgressiveThreshold=function(){
  6476. // Do not support progressive in normal mode.
  6477. var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return e>t&&(t=e),t},e.prototype.brushSelector=function(t,e,n){return n.rect(e.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=xr(Sy.defaultOption,{
  6478. // If clipped
  6479. // Only available on cartesian2d
  6480. clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(Sy);
  6481. /**
  6482. * Sausage: similar to sector, but have half circle on both sides
  6483. */var My=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},Iy=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="sausage",n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new My},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,o=Math.max(e.r0||0,0),r=Math.max(e.r,0),a=.5*(r-o),s=o+a,l=e.startAngle,u=e.endAngle,c=e.clockwise,d=2*Math.PI,h=c?u-l<d:l-u<d;h||(
  6484. // Normalize angles
  6485. l=u-(c?d:-d));var p=Math.cos(l),f=Math.sin(l),g=Math.cos(u),y=Math.sin(u);h?(t.moveTo(p*o+n,f*o+i),t.arc(p*s+n,f*s+i,a,-Math.PI+l,l,!c)):t.moveTo(p*r+n,f*r+i),t.arc(n,i,r,l,u,!c),t.arc(g*s+n,y*s+i,a,u-2*Math.PI,u-Math.PI,!c),0!==o&&t.arc(n,i,o,u,l,c)},e}(g);const Dy=Iy;function Ty(t,e,n){return e*Math.sin(t)*(n?-1:1)}function Cy(t,e,n){return e*Math.cos(t)*(n?1:-1)}function Ay(t,e,o){var r=t.get("borderRadius");if(null==r)return o?{cornerRadius:0}:null;i(r)||(r=[r,r,r,r]);var a=Math.abs(e.r||0-e.r0||0);return{cornerRadius:n(r,(function(t){return Mt(t,a)}))}}var Ly=Math.max,ky=Math.min;var Py=/** @class */function(t){function e(){var n=t.call(this)||this;return n.type=e.type,n._isFirstFrame=!0,n}return Ue(e,t),e.prototype.render=function(t,e,n,i){this._model=t,this._removeOnRenderedListener(n),this._updateDrawMode(t);var o=t.get("coordinateSystem");"cartesian2d"!==o&&"polar"!==o||(
  6486. // Clear previously rendered progressive elements.
  6487. this._progressiveEls=null,this._isLargeDraw?this._renderLarge(t,e,n):this._renderNormal(t,e,n,i))},e.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),
  6488. // incremental also need to clip, otherwise might be overlow.
  6489. // But must not set clip in each frame, otherwise all of the children will be marked redraw.
  6490. this._updateLargeClip(t)},e.prototype.incrementalRender=function(t,e){
  6491. // Reset
  6492. this._progressiveEls=[],
  6493. // Do not support progressive in normal mode.
  6494. this._incrementalRenderLarge(t,e)},e.prototype.eachRendered=function(t){Bo(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t,e,n,i){var o,r=this.group,a=t.getData(),s=this._data,l=t.coordinateSystem,u=l.getBaseAxis();"cartesian2d"===l.type?o=u.isHorizontal():"polar"===l.type&&(o="angle"===u.dim);var c=t.isAnimationEnabled()?t:null,d=function(t,e){var n=t.get("realtimeSort",!0),i=e.getBaseAxis();if(n&&"category"===i.type&&"cartesian2d"===e.type)return{baseAxis:i,otherAxis:e.getOtherAxis(i)}}(t,l);d&&this._enableRealtimeSort(d,a,n);var h=t.get("clip",!0)||d,p=function(t,e){var n=t.getArea&&t.getArea();if(oy(t,"cartesian2d")){var i=t.getBaseAxis();
  6495. // When boundaryGap is false or using time axis. bar may exceed the grid.
  6496. // We should not clip this part.
  6497. // See test/bar2.html
  6498. if("category"!==i.type||!i.onBand){var o=e.getLayout("bandWidth");i.isHorizontal()?(n.x-=o,n.width+=2*o):(n.y-=o,n.height+=2*o)}}return n}(l,a);
  6499. // If there is clipPath created in large mode. Remove it.
  6500. r.removeClipPath();
  6501. // We don't use clipPath in normal mode because we needs a perfect animation
  6502. // And don't want the label are clipped.
  6503. var f=t.get("roundCap",!0),g=t.get("showBackground",!0),y=t.getModel("backgroundStyle"),m=y.get("borderRadius")||0,v=[],x=this._backgroundEls,_=i&&i.isInitSort,b=i&&"changeAxisOrder"===i.type;function S(t){var e=Gy[l.type](a,t),n=function(t,e,n){var i="polar"===t.type?E:G;return new i({shape:Xy(e,n,t),silent:!0,z2:0})}(l,o,e);return n.useStyle(y.getItemStyle()),
  6504. // Only cartesian2d support borderRadius.
  6505. "cartesian2d"===l.type?n.setShape("r",m):n.setShape("cornerRadius",m),v[t]=n,n}a.diff(s).add((function(e){var n=a.getItemModel(e),i=Gy[l.type](a,e,n);
  6506. // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in "axisProxy".
  6507. if(g&&S(e),a.hasValue(e)&&By[l.type](i)){var s=!1;h&&(
  6508. // Clip will modify the layout params.
  6509. // And return a boolean to determine if the shape are fully clipped.
  6510. s=Ny[l.type](p,i));var y=Oy[l.type](t,a,e,i,o,c,u.model,!1,f);d&&(
  6511. /**
  6512. * Force label animation because even if the element is
  6513. * ignored because it's clipped, it may not be clipped after
  6514. * changing order. Then, if not using forceLabelAnimation,
  6515. * the label animation was never started, in which case,
  6516. * the label will be the final value and doesn't have label
  6517. * animation.
  6518. */
  6519. y.forceLabelAnimation=!0),Wy(y,a,e,n,i,t,o,"polar"===l.type),_?y.attr({shape:i}):d?Ry(d,c,y,i,e,o,!1,!1):oo(y,{shape:i},t,e),a.setItemGraphicEl(e,y),r.add(y),y.ignore=s}})).update((function(e,n){var i=a.getItemModel(e),w=Gy[l.type](a,e,i);if(g){var M=void 0;0===x.length?M=S(n):((M=x[n]).useStyle(y.getItemStyle()),
  6520. // Only cartesian2d support borderRadius.
  6521. "cartesian2d"===l.type?M.setShape("r",m):M.setShape("cornerRadius",m),v[e]=M);var I=Gy[l.type](a,e);io(M,{shape:Xy(o,I,l)},c,e)}var D=s.getItemGraphicEl(n);if(a.hasValue(e)&&By[l.type](w)){var T=!1;if(h&&(T=Ny[l.type](p,w))&&r.remove(D),D?uo(D):D=Oy[l.type](t,a,e,w,o,c,u.model,!!D,f),d&&(D.forceLabelAnimation=!0),b){var C=D.getTextContent();if(C){var A=Qo(C);null!=A.prevValue&&(
  6522. /**
  6523. * Set preValue to be value so that no new label
  6524. * should be started, otherwise, it will take a full
  6525. * `animationDurationUpdate` time to finish the
  6526. * animation, which is not expected.
  6527. */
  6528. A.prevValue=A.value)}}
  6529. // Not change anything if only order changed.
  6530. // Especially not change label.
  6531. else Wy(D,a,e,i,w,t,o,"polar"===l.type);_?D.attr({shape:w}):d?Ry(d,c,D,w,e,o,!0,b):io(D,{shape:w},t,e,null),a.setItemGraphicEl(e,D),D.ignore=T,r.add(D)}else r.remove(D)})).remove((function(e){var n=s.getItemGraphicEl(e);n&&lo(n,t,e)})).execute();var w=this._backgroundGroup||(this._backgroundGroup=new Z);w.removeAll();for(var M=0;M<v.length;++M)w.add(v[M]);r.add(w),this._backgroundEls=v,this._data=a},e.prototype._renderLarge=function(t,e,n){this._clear(),Uy(t,this.group),this._updateLargeClip(t)},e.prototype._incrementalRenderLarge=function(t,e){this._removeBackground(),Uy(e,this.group,this._progressiveEls,!0)},e.prototype._updateLargeClip=function(t){
  6532. // Use clipPath in large mode.
  6533. var e=t.get("clip",!0)&&iy(t.coordinateSystem,!1,t),n=this.group;e?n.setClipPath(e):n.removeClipPath()},e.prototype._enableRealtimeSort=function(t,e,n){var i=this;
  6534. // If no data in the first frame, wait for data to initSort
  6535. if(e.count()){var o=t.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(e,t,n),this._isFirstFrame=!1;else{var r=function(t){var n=e.getItemGraphicEl(t),i=n&&n.shape;return i&&
  6536. // The result should be consistent with the initial sort by data value.
  6537. // Do not support the case that both positive and negative exist.
  6538. Math.abs(o.isHorizontal()?i.height:i.width)||0};this._onRendered=function(){i._updateSortWithinSameData(e,r,o,n)},n.getZr().on("rendered",this._onRendered)}}},e.prototype._dataSort=function(t,e,i){var o=[];return t.each(t.mapDimension(e.dim),(function(t,e){var n=i(e);n=null==n?NaN:n,o.push({dataIndex:e,mappedValue:n,ordinalNumber:t})})),o.sort((function(t,e){
  6539. // If NaN, it will be treated as min val.
  6540. return e.mappedValue-t.mappedValue})),{ordinalNumbers:n(o,(function(t){return t.ordinalNumber}))}},e.prototype._isOrderChangedWithinSameData=function(t,e,n){for(var i=n.scale,o=t.mapDimension(n.dim),r=Number.MAX_VALUE,a=0,s=i.getOrdinalMeta().categories.length;a<s;++a){var l=t.rawIndexOf(o,i.getRawOrdinalNumber(a)),u=l<0?Number.MIN_VALUE:e(t.indexOfRawIndex(l));if(u>r)return!0;r=u}return!1},
  6541. /*
  6542. * Consider the case when A and B changed order, whose representing
  6543. * bars are both out of sight, we don't wish to trigger reorder action
  6544. * as long as the order in the view doesn't change.
  6545. */
  6546. e.prototype._isOrderDifferentInView=function(t,e){for(var n=e.scale,i=n.getExtent(),o=Math.max(0,i[0]),r=Math.min(i[1],n.getOrdinalMeta().categories.length-1);o<=r;++o)if(t.ordinalNumbers[o]!==n.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(t,e,n,i){if(this._isOrderChangedWithinSameData(t,e,n)){var o=this._dataSort(t,n,e);this._isOrderDifferentInView(o,n)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(t,e,n){var i=e.baseAxis,o=this._dataSort(t,i,(function(n){return t.get(t.mapDimension(e.otherAxis.dim),n)}));n.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:o})},e.prototype.remove=function(t,e){this._clear(this._model),this._removeOnRenderedListener(e)},e.prototype.dispose=function(t,e){this._removeOnRenderedListener(e)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var e=this.group,n=this._data;t&&t.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl((function(e){lo(e,t,ni(e).dataIndex)}))):e.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(Ou),Ny={cartesian2d:function(t,e){var n=e.width<0?-1:1,i=e.height<0?-1:1;
  6547. // Needs positive width and height
  6548. n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height);var o=t.x+t.width,r=t.y+t.height,a=Ly(e.x,t.x),s=ky(e.x+e.width,o),l=Ly(e.y,t.y),u=ky(e.y+e.height,r),c=s<a,d=u<l;
  6549. // When xClipped or yClipped, the element will be marked as `ignore`.
  6550. // But we should also place the element at the edge of the coord sys bounding rect.
  6551. // Because if data changed and the bar shows again, its transition animation
  6552. // will begin at this place.
  6553. return e.x=c&&a>o?s:a,e.y=d&&l>r?u:l,e.width=c?0:s-a,e.height=d?0:u-l,
  6554. // Reverse back
  6555. n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height),c||d},polar:function(t,e){var n=e.r0<=e.r?1:-1;
  6556. // Make sure r is larger than r0
  6557. if(n<0){var i=e.r;e.r=e.r0,e.r0=i}var o=ky(e.r,t.r),r=Ly(e.r0,t.r0);e.r=o,e.r0=r;var a=o-r<0;
  6558. // Reverse back
  6559. if(n<0){i=e.r;e.r=e.r0,e.r0=i}return a}},Oy={cartesian2d:function(t,e,n,i,o,r,a,s,l){var u=new G({shape:p({},i),z2:1});(u.__dataIndex=n,u.name="item",r)&&(u.shape[o?"height":"width"]=0);return u},polar:function(t,e,n,i,o,r,a,s,l){var u=!o&&l?Dy:E,c=new u({shape:i,z2:1});c.name="item";var d,h,p=Fy(o);
  6560. // Animation
  6561. if(c.calculateTextPosition=(d=p,h=({isRoundCap:u===Dy}||{}).isRoundCap,function(t,e,n){var i=e.position;if(!i||i instanceof Array)return ht(t,e,n);var o=d(i),r=null!=e.distance?e.distance:5,a=this.shape,s=a.cx,l=a.cy,u=a.r,c=a.r0,p=(u+c)/2,f=a.startAngle,g=a.endAngle,y=(f+g)/2,m=h?Math.abs(u-c)/2:0,v=Math.cos,x=Math.sin,_=s+u*v(f),b=l+u*x(f),S="left",w="top";switch(o){case"startArc":_=s+(c-r)*v(y),b=l+(c-r)*x(y),S="center",w="top";break;case"insideStartArc":_=s+(c+r)*v(y),b=l+(c+r)*x(y),S="center",w="bottom";break;case"startAngle":_=s+p*v(f)+Ty(f,r+m,!1),b=l+p*x(f)+Cy(f,r+m,!1),S="right",w="middle";break;case"insideStartAngle":_=s+p*v(f)+Ty(f,-r+m,!1),b=l+p*x(f)+Cy(f,-r+m,!1),S="left",w="middle";break;case"middle":_=s+p*v(y),b=l+p*x(y),S="center",w="middle";break;case"endArc":_=s+(u+r)*v(y),b=l+(u+r)*x(y),S="center",w="bottom";break;case"insideEndArc":_=s+(u-r)*v(y),b=l+(u-r)*x(y),S="center",w="top";break;case"endAngle":_=s+p*v(g)+Ty(g,r+m,!0),b=l+p*x(g)+Cy(g,r+m,!0),S="left",w="middle";break;case"insideEndAngle":_=s+p*v(g)+Ty(g,-r+m,!0),b=l+p*x(g)+Cy(g,-r+m,!0),S="right",w="middle";break;default:return ht(t,e,n)}return(t=t||{}).x=_,t.y=b,t.align=S,t.verticalAlign=w,t}),r){var f=o?"r":"endAngle",g={};c.shape[f]=o?i.r0:i.startAngle,g[f]=i[f],(s?io:oo)(c,{shape:g},r)}return c}};function Ry(t,e,n,i,o,r,a,s){var l,u;r?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||
  6562. // Keep the original growth animation if only axis order changed.
  6563. // Not start a new animation.
  6564. (a?io:oo)(n,{shape:l},e,o,null),(a?io:oo)(n,{shape:u},e?t.baseAxis.model:null,o)}function Ey(t,e){for(var n=0;n<e.length;n++)if(!isFinite(t[e[n]]))return!0;return!1}var Vy=["x","y","width","height"],zy=["cx","cy","r","startAngle","endAngle"],By={cartesian2d:function(t){return!Ey(t,Vy)},polar:function(t){return!Ey(t,zy)}},Gy={
  6565. // itemModel is only used to get borderWidth, which is not needed
  6566. // when calculating bar background layout.
  6567. cartesian2d:function(t,e,n){var i=t.getItemLayout(e),o=n?
  6568. // In case width or height are too small.
  6569. function(t,e){
  6570. // Has no border.
  6571. var n=t.get(["itemStyle","borderColor"]);if(!n||"none"===n)return 0;var i=t.get(["itemStyle","borderWidth"])||0,o=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),r=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);
  6572. // width or height may be NaN for empty data
  6573. return Math.min(i,o,r)}(n,i):0,r=i.width>0?1:-1,a=i.height>0?1:-1;return{x:i.x+r*o/2,y:i.y+a*o/2,width:i.width-r*o,height:i.height-a*o}},polar:function(t,e,n){var i=t.getItemLayout(e);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function Fy(t){return function(t){var e=t?"Arc":"Angle";return function(t){switch(t){case"start":case"insideStart":case"end":case"insideEnd":return t+e;default:return t}}}(t)}function Wy(t,e,n,o,r,s,u,c){var d=e.getItemVisual(n,"style");if(c){if(!s.get("roundCap")){var h=t.shape,f=Ay(o.getModel("itemStyle"),h,!0);p(h,f),t.setShape(h)}}else{var g=o.get(["itemStyle","borderRadius"])||0;t.setShape("r",g)}t.useStyle(d);var y=o.getShallow("cursor");y&&t.attr("cursor",y);var m=c?u?r.r>=r.r0?"endArc":"startArc":r.endAngle>=r.startAngle?"endAngle":"startAngle":u?r.height>=0?"bottom":"top":r.width>=0?"right":"left",v=Uo(o);Yo(t,v,{labelFetcher:s,labelDataIndex:n,defaultText:Rg(s.getData(),n),inheritColor:d.fill,defaultOpacity:d.opacity,defaultOutsidePosition:m});var x=t.getTextContent();if(c&&x){var _=o.get(["label","position"]);t.textConfig.inside="middle"===_||null,function(t,e,n,o){if(l(o))
  6574. // user-set rotation
  6575. t.setTextConfig({rotation:o});else if(i(e))
  6576. // user-set position, use 0 as auto rotation
  6577. t.setTextConfig({rotation:0});else{var r,a=t.shape,s=a.clockwise?a.startAngle:a.endAngle,u=a.clockwise?a.endAngle:a.startAngle,c=(s+u)/2,d=n(e);switch(d){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":r=c;break;case"startAngle":case"insideStartAngle":r=s;break;case"endAngle":case"insideEndAngle":r=u;break;default:return void t.setTextConfig({rotation:0})}var h=1.5*Math.PI-r;
  6578. /**
  6579. * TODO: labels with rotate > Math.PI / 2 should be rotate another
  6580. * half round flipped to increase readability. However, only middle
  6581. * position supports this for now, because in other positions, the
  6582. * anchor point is not at the center of the text, so the positions
  6583. * after rotating is not as expected.
  6584. */"middle"===d&&h>Math.PI/2&&h<1.5*Math.PI&&(h-=Math.PI),t.setTextConfig({rotation:h})}}(t,"outside"===_?m:_,Fy(u),o.get(["label","rotate"]))}tr(x,v,s.getRawValue(n),(function(t){return Eg(e,t)}));var b=o.getModel(["emphasis"]);Ui(t,b.get("focus"),b.get("blurScope"),b.get("disabled")),qi(t,o),function(t){return null!=t.startAngle&&null!=t.endAngle&&t.startAngle===t.endAngle}(r)&&(t.style.fill="none",t.style.stroke="none",a(t.states,(function(t){t.style&&(t.style.fill=t.style.stroke="none")})))}var Hy=function(){},Yy=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="largeBar",n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new Hy},e.prototype.buildPath=function(t,e){for(
  6585. // Drawing lines is more efficient than drawing
  6586. // a whole line or drawing rects.
  6587. var n=e.points,i=this.baseDimIdx,o=1-this.baseDimIdx,r=[],a=[],s=this.barWidth,l=0;l<n.length;l+=3)a[i]=s,a[o]=n[l+2],r[i]=n[l+i],r[o]=n[l+o],t.rect(r[0],r[1],a[0],a[1])},e}(g);function Uy(t,e,n,i){
  6588. // TODO support polar
  6589. var o=t.getData(),r=o.getLayout("valueAxisHorizontal")?1:0,a=o.getLayout("largeDataIndices"),s=o.getLayout("size"),l=t.getModel("backgroundStyle"),u=o.getLayout("largeBackgroundPoints");if(u){var c=new Yy({shape:{points:u},incremental:!!i,silent:!0,z2:0});c.baseDimIdx=r,c.largeDataIndices=a,c.barWidth=s,c.useStyle(l.getItemStyle()),e.add(c),n&&n.push(c)}var d=new Yy({shape:{points:o.getLayout("largePoints")},incremental:!!i,ignoreCoarsePointer:!0,z2:1});d.baseDimIdx=r,d.largeDataIndices=a,d.barWidth=s,e.add(d),d.useStyle(o.getVisual("style")),
  6590. // Stroke is rendered first to avoid overlapping with fill
  6591. d.style.stroke=null,
  6592. // Enable tooltip and user mouse/touch event handlers.
  6593. ni(d).seriesIndex=t.seriesIndex,t.get("silent")||(d.on("mousedown",Zy),d.on("mousemove",Zy)),n&&n.push(d)}
  6594. // Use throttle to avoid frequently traverse to find dataIndex.
  6595. var Zy=zu((function(t){var e=function(t,e,n){for(var i=t.baseDimIdx,o=1-i,r=t.shape.points,a=t.largeDataIndices,s=[],l=[],u=t.barWidth,c=0,d=r.length/3;c<d;c++){var h=3*c;if(l[i]=u,l[o]=r[h+2],s[i]=r[h+i],s[o]=r[h+o],l[o]<0&&(s[o]+=l[o],l[o]=-l[o]),e>=s[0]&&e<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return a[c]}return-1}(this,t.offsetX,t.offsetY);ni(this).dataIndex=e>=0?e:null}),30,!1);function Xy(t,e,n){if(oy(n,"cartesian2d")){var i=e,o=n.getArea();return{x:t?i.x:o.x,y:t?o.y:i.y,width:t?i.width:o.width,height:t?o.height:i.height}}var r=e;return{cx:(o=n.getArea()).cx,cy:o.cy,r0:t?o.r0:r.r0,r:t?o.r:r.r,startAngle:t?r.startAngle:0,endAngle:t?r.endAngle:2*Math.PI}}const jy=Py;var qy=2*Math.PI,Ky=Math.PI/180;function Jy(t,e){return xa(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function $y(t,e){var n=Jy(t,e),o=t.get("center"),r=t.get("radius");
  6596. // center can be string or number when coordinateSystem is specified
  6597. i(r)||(r=[0,r]);var a,s,l=je(n.width,e.getWidth()),u=je(n.height,e.getHeight()),c=Math.min(l,u),d=je(r[0],c/2),h=je(r[1],c/2),p=t.coordinateSystem;if(p){
  6598. // percentage is not allowed when coordinate system is specified
  6599. var f=p.dataToPoint(o);a=f[0]||0,s=f[1]||0}else i(o)||(o=[o,o]),a=je(o[0],l)+n.x,s=je(o[1],u)+n.y;return{cx:a,cy:s,r0:d,r:h}}function Qy(t,e,n){e.eachSeriesByType(t,(function(t){var e=t.getData(),i=e.mapDimension("value"),o=Jy(t,n),r=$y(t,n),a=r.cx,s=r.cy,l=r.r,u=r.r0,c=-t.get("startAngle")*Ky,d=t.get("endAngle"),h=t.get("padAngle")*Ky;d="auto"===d?c-qy:-d*Ky;var p=t.get("minAngle")*Ky+h,f=0;e.each(i,(function(t){!isNaN(t)&&f++}));var g=e.getSum(i),y=Math.PI/(g||f)*2,m=t.get("clockwise"),v=t.get("roseType"),x=t.get("stillShowZeroSum"),_=e.getDataExtent(i);
  6600. // Sum may be 0
  6601. _[0]=0;var b=m?1:-1,S=[c,d],w=b*h/2;Wt(S,!m),c=S[0],d=S[1];var M=tm(t);M.startAngle=c,M.endAngle=d,M.clockwise=m;var I=Math.abs(d-c),D=I,T=0,C=c;
  6602. // In the case some sector angle is smaller than minAngle
  6603. // Some sector is constrained by minAngle and padAngle
  6604. // Rest sectors needs recalculate angle
  6605. if(e.setLayout({viewRect:o,r:l}),e.each(i,(function(t,n){var i;if(isNaN(t))e.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:m,cx:a,cy:s,r0:u,r:v?NaN:l});else{(
  6606. // FIXME 兼容 2.0 但是 roseType 是 area 的时候才是这样?
  6607. i="area"!==v?0===g&&x?y:t*y:I/f)<p?(i=p,D-=p):T+=t;var o=C+b*i,r=0,c=0;
  6608. // calculate display angle
  6609. h>i?c=r=C+b*i/2:(r=C+w,c=o-w),e.setItemLayout(n,{angle:i,startAngle:r,endAngle:c,clockwise:m,cx:a,cy:s,r0:u,r:v?Xe(t,_,[u,l]):l}),C=o}})),D<qy&&f)
  6610. // Average the angle if rest angle is not enough after all angles is
  6611. // Constrained by minAngle and padAngle
  6612. if(D<=.001){var A=I/f;e.each(i,(function(t,n){if(!isNaN(t)){var i=e.getItemLayout(n);i.angle=A;var o=0,r=0;A<h?r=o=c+b*(n+.5)*A:(o=c+b*n*A+w,r=c+b*(n+1)*A-w),i.startAngle=o,i.endAngle=r}}))}else y=D/T,C=c,e.each(i,(function(t,n){if(!isNaN(t)){var i=e.getItemLayout(n),o=i.angle===p?p:t*y,r=0,a=0;o<h?a=r=C+b*o/2:(r=C+w,a=C+b*o-w),i.startAngle=r,i.endAngle=a,C+=b*o}}))}))}var tm=On();
  6613. /*
  6614. * Licensed to the Apache Software Foundation (ASF) under one
  6615. * or more contributor license agreements. See the NOTICE file
  6616. * distributed with this work for additional information
  6617. * regarding copyright ownership. The ASF licenses this file
  6618. * to you under the Apache License, Version 2.0 (the
  6619. * "License"); you may not use this file except in compliance
  6620. * with the License. You may obtain a copy of the License at
  6621. *
  6622. * http://www.apache.org/licenses/LICENSE-2.0
  6623. *
  6624. * Unless required by applicable law or agreed to in writing,
  6625. * software distributed under the License is distributed on an
  6626. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  6627. * KIND, either express or implied. See the License for the
  6628. * specific language governing permissions and limitations
  6629. * under the License.
  6630. */
  6631. /**
  6632. * AUTO-GENERATED FILE. DO NOT MODIFY.
  6633. */
  6634. /*
  6635. * Licensed to the Apache Software Foundation (ASF) under one
  6636. * or more contributor license agreements. See the NOTICE file
  6637. * distributed with this work for additional information
  6638. * regarding copyright ownership. The ASF licenses this file
  6639. * to you under the Apache License, Version 2.0 (the
  6640. * "License"); you may not use this file except in compliance
  6641. * with the License. You may obtain a copy of the License at
  6642. *
  6643. * http://www.apache.org/licenses/LICENSE-2.0
  6644. *
  6645. * Unless required by applicable law or agreed to in writing,
  6646. * software distributed under the License is distributed on an
  6647. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  6648. * KIND, either express or implied. See the License for the
  6649. * specific language governing permissions and limitations
  6650. * under the License.
  6651. */function em(t){return{seriesType:t,reset:function(t,e){var n=e.findComponents({mainType:"legend"});if(n&&n.length){var i=t.getData();i.filterSelf((function(t){
  6652. // If in any legend component the status is not selected.
  6653. for(var e=i.getName(t),o=0;o<n.length;o++)
  6654. // @ts-ignore FIXME: LegendModel
  6655. if(!n[o].isSelected(e))return!1;return!0}))}}}}var nm=Math.PI/180;function im(t,e,n,i,o,r,a,s,l,u){if(!(t.length<2)){for(var c=t.length,d=0;d<c;d++)if("outer"===t[d].position&&"labelLine"===t[d].labelAlignTo){var h=t[d].label.x-u;t[d].linePoints[1][0]+=h,t[d].label.x=u}xg(t,l,l+a)&&
  6656. // Adjust X based on the shifted y. Make tight labels aligned on an ellipse curve.
  6657. function(t){for(
  6658. // Extremes of
  6659. var r={list:[],maxY:0},a={list:[],maxY:0},s=0;s<t.length;s++)if("none"===t[s].labelAlignTo){var l=t[s],u=l.label.y>n?a:r,c=Math.abs(l.label.y-n);if(c>=u.maxY){var d=l.label.x-e-l.len2*o,h=i+l.len,f=Math.abs(d)<h?Math.sqrt(c*c/(1-d*d/h/h)):h;
  6660. // horizontal r is always same with original r because x is not changed.
  6661. u.rB=f,u.maxY=c}u.list.push(l)}p(r),p(a)}(t)}function p(t){for(var r=t.rB,a=r*r,s=0;s<t.list.length;s++){var l=t.list[s],u=Math.abs(l.label.y-n),c=i+l.len,d=c*c,h=Math.sqrt(Math.abs((1-u*u/a)*d)),p=e+(h+l.len2)*o,f=p-l.label.x;
  6662. // text x is changed, so need to recalculate width.
  6663. om(l,l.targetTextWidth-f*o,!0),l.label.x=p}}}
  6664. /**
  6665. * Set max width of each label, and then wrap each label to the max width.
  6666. *
  6667. * @param layout label layout
  6668. * @param availableWidth max width for the label to display
  6669. * @param forceRecalculate recaculate the text layout even if the current width
  6670. * is smaller than `availableWidth`. This is useful when the text was previously
  6671. * wrapped by calling `constrainTextWidth` but now `availableWidth` changed, in
  6672. * which case, previous wrapping should be redo.
  6673. */
  6674. function om(t,e,n){if(void 0===n&&(n=!1),null==t.labelStyleWidth){var i=t.label,o=i.style,r=t.rect,a=o.backgroundColor,s=o.padding,l=s?s[1]+s[3]:0,u=o.overflow,c=r.width+(a?0:l);if(e<c||n){var d=r.height;if(u&&u.match("break")){
  6675. // Temporarily set background to be null to calculate
  6676. // the bounding box without background.
  6677. i.setStyle("backgroundColor",null),
  6678. // Set constraining width
  6679. i.setStyle("width",e-l);
  6680. // This is the real bounding box of the text without padding.
  6681. var h=i.getBoundingRect();i.setStyle("width",Math.ceil(h.width)),i.setStyle("backgroundColor",a)}else{var p=e-l,f=e<c?p:
  6682. // Current available width is enough, but the text may have
  6683. // already been wrapped with a smaller available width.
  6684. n?p>t.unconstrainedWidth?null:p:null;i.setStyle("width",f)}var g=i.getBoundingRect();r.width=g.width;var y=(i.style.margin||0)+2.1;r.height=g.height+y,r.y-=(r.height-d)/2}}}function rm(t){
  6685. // Not change x for center label
  6686. return"center"===t.position}function am(t){var e,n,i=t.getData(),o=[],r=!1,s=(t.get("minShowLabelAngle")||0)*nm,u=i.getLayout("viewRect"),c=i.getLayout("r"),d=u.width,h=u.x,p=u.y,f=u.height;function g(t){t.ignore=!0}i.each((function(t){var u=i.getItemGraphicEl(t),p=u.shape,f=u.getTextContent(),y=u.getTextGuideLine(),m=i.getItemModel(t),v=m.getModel("label"),x=v.get("position")||m.get(["emphasis","label","position"]),_=v.get("distanceToLabelLine"),b=v.get("alignTo"),S=je(v.get("edgeDistance"),d),w=v.get("bleedMargin"),M=m.getModel("labelLine"),I=M.get("length");I=je(I,d);var D=M.get("length2");if(D=je(D,d),Math.abs(p.endAngle-p.startAngle)<s)return a(f.states,g),f.ignore=!0,void(y&&(a(y.states,g),y.ignore=!0));if(function(t){if(!t.ignore)return!0;for(var e in t.states)if(!1===t.states[e].ignore)return!0;return!1}(f)){var T,C,A,L,k=(p.startAngle+p.endAngle)/2,P=Math.cos(k),N=Math.sin(k);e=p.cx,n=p.cy;var O="inside"===x||"inner"===x;if("center"===x)T=p.cx,C=p.cy,L="center";else{var R=(O?(p.r+p.r0)/2*P:p.r*P)+e,E=(O?(p.r+p.r0)/2*N:p.r*N)+n;if(T=R+3*P,C=E+3*N,!O){
  6687. // For roseType
  6688. var V=R+P*(I+c-p.r),z=E+N*(I+c-p.r),B=V+(P<0?-1:1)*D;
  6689. // Adjust textX because text align of edge is opposite
  6690. T="edge"===b?P<0?h+S:h+d-S:B+(P<0?-_:_),C=z,A=[[R,E],[V,z],[B,z]]}L=O?"center":"edge"===b?P>0?"right":"left":P>0?"left":"right"}var G=Math.PI,F=0,W=v.get("rotate");if(l(W))F=W*(G/180);else if("center"===x)F=0;else if("radial"===W||!0===W){F=P<0?-k+G:-k}else if("tangential"===W&&"outside"!==x&&"outer"!==x){var H=Math.atan2(P,N);H<0&&(H=2*G+H),N>0&&(H=G+H),F=H-G}
  6691. // Not sectorShape the inside label
  6692. if(r=!!F,f.x=T,f.y=C,f.rotation=F,f.setStyle({verticalAlign:"middle"}),O){f.setStyle({align:L});var Y=f.states.select;Y&&(Y.x+=f.x,Y.y+=f.y)}else{var U=f.getBoundingRect().clone();U.applyTransform(f.getComputedTransform());
  6693. // Text has a default 1px stroke. Exclude this.
  6694. var Z=(f.style.margin||0)+2.1;U.y-=Z/2,U.height+=Z,o.push({label:f,labelLine:y,position:x,len:I,len2:D,minTurnAngle:M.get("minTurnAngle"),maxSurfaceAngle:M.get("maxSurfaceAngle"),surfaceNormal:new K(P,N),linePoints:A,textAlign:L,labelDistance:_,labelAlignTo:b,edgeDistance:S,bleedMargin:w,rect:U,unconstrainedWidth:U.width,labelStyleWidth:f.style.width})}u.setTextConfig({inside:O})}})),!r&&t.get("avoidLabelOverlap")&&function(t,e,n,i,o,r,a,s){for(var l=[],u=[],c=Number.MAX_VALUE,d=-Number.MAX_VALUE,h=0;h<t.length;h++){var p=t[h].label;rm(t[h])||(p.x<e?(c=Math.min(c,p.x),l.push(t[h])):(d=Math.max(d,p.x),u.push(t[h])))}for(h=0;h<t.length;h++)if(!rm(y=t[h])&&y.linePoints){if(null!=y.labelStyleWidth)continue;p=y.label;var f=y.linePoints,g=void 0;g="edge"===y.labelAlignTo?p.x<e?f[2][0]-y.labelDistance-a-y.edgeDistance:a+o-y.edgeDistance-f[2][0]-y.labelDistance:"labelLine"===y.labelAlignTo?p.x<e?c-a-y.bleedMargin:a+o-d-y.bleedMargin:p.x<e?p.x-a-y.bleedMargin:a+o-p.x-y.bleedMargin,y.targetTextWidth=g,om(y,g)}for(im(u,e,n,i,1,0,r,0,s,d),im(l,e,n,i,-1,0,r,0,s,c),h=0;h<t.length;h++){var y;if(!rm(y=t[h])&&y.linePoints){p=y.label,f=y.linePoints;var m="edge"===y.labelAlignTo,v=p.style.padding,x=v?v[1]+v[3]:0,_=p.style.backgroundColor?0:x,b=y.rect.width+_,S=f[1][0]-f[2][0];m?p.x<e?f[2][0]=a+y.edgeDistance+b+y.labelDistance:f[2][0]=a+o-y.edgeDistance-b-y.labelDistance:(p.x<e?f[2][0]=p.x+y.labelDistance:f[2][0]=p.x-y.labelDistance,f[1][0]=f[2][0]+S),f[1][1]=f[2][1]=p.y}}}(o,e,n,c,d,f,h,p);for(var y=0;y<o.length;y++){var m=o[y],v=m.label,x=m.labelLine,_=isNaN(v.x)||isNaN(v.y);if(v){v.setStyle({align:m.textAlign}),_&&(a(v.states,g),v.ignore=!0);var b=v.states.select;b&&(b.x+=v.x,b.y+=v.y)}if(x){var S=m.linePoints;_||!S?(a(x.states,g),x.ignore=!0):(dg(S,m.minTurnAngle),hg(S,m.surfaceNormal,m.maxSurfaceAngle),x.setShape({points:S}),
  6695. // Set the anchor to the midpoint of sector
  6696. v.__hostTarget.textGuideLineConfig={anchor:new K(S[0][0],S[0][1])})}}}
  6697. /**
  6698. * Piece of pie including Sector, Label, LabelLine
  6699. */var sm=/** @class */function(t){function e(e,n,i){var o=t.call(this)||this;o.z2=2;var r=new $;return o.setTextContent(r),o.updateData(e,n,i,!0),o}return Ue(e,t),e.prototype.updateData=function(t,e,n,i){var o=this,r=t.hostModel,a=t.getItemModel(e),s=a.getModel("emphasis"),l=t.getItemLayout(e),u=p(Ay(a.getModel("itemStyle"),l,!0),l);
  6700. // Ignore NaN data.
  6701. if(isNaN(u.startAngle))
  6702. // Use NaN shape to avoid drawing shape.
  6703. o.setShape(u);else{if(i){o.setShape(u);var c=r.getShallow("animationType");r.ecModel.ssr?(
  6704. // Use scale animation in SSR mode(opacity?)
  6705. // Because CSS SVG animation doesn't support very customized shape animation.
  6706. oo(o,{scaleX:0,scaleY:0},r,{dataIndex:e,isFrom:!0}),o.originX=u.cx,o.originY=u.cy):"scale"===c?(o.shape.r=l.r0,oo(o,{shape:{r:l.r}},r,e)):null!=n?(o.setShape({startAngle:n,endAngle:n}),oo(o,{shape:{startAngle:l.startAngle,endAngle:l.endAngle}},r,e)):(o.shape.endAngle=l.startAngle,io(o,{shape:{endAngle:l.endAngle}},r,e))}else uo(o),
  6707. // Transition animation from the old shape
  6708. io(o,{shape:u},r,e);o.useStyle(t.getItemVisual(e,"style")),qi(o,a);var d=(l.startAngle+l.endAngle)/2,h=r.get("selectedOffset"),f=Math.cos(d)*h,g=Math.sin(d)*h,y=a.getShallow("cursor");y&&o.attr("cursor",y),this._updateLabel(r,t,e),o.ensureState("emphasis").shape=p({r:l.r+(s.get("scale")&&s.get("scaleSize")||0)},Ay(s.getModel("itemStyle"),l)),p(o.ensureState("select"),{x:f,y:g,shape:Ay(a.getModel(["select","itemStyle"]),l)}),p(o.ensureState("blur"),{shape:Ay(a.getModel(["blur","itemStyle"]),l)});var m=o.getTextGuideLine(),v=o.getTextContent();m&&p(m.ensureState("select"),{x:f,y:g}),
  6709. // TODO: needs dx, dy in zrender?
  6710. p(v.ensureState("select"),{x:f,y:g}),Ui(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))}},e.prototype._updateLabel=function(t,e,n){var i=this,o=e.getItemModel(n),r=o.getModel("labelLine"),a=e.getItemVisual(n,"style"),s=a&&a.fill,l=a&&a.opacity;Yo(i,Uo(o),{labelFetcher:e.hostModel,labelDataIndex:n,inheritColor:s,defaultOpacity:l,defaultText:t.getFormattedLabel(n,"normal")||e.getName(n)});var u=i.getTextContent();
  6711. // Set textConfig on sector.
  6712. i.setTextConfig({
  6713. // reset position, rotation
  6714. position:null,rotation:null}),
  6715. // Make sure update style on labelText after setLabelStyle.
  6716. // Because setLabelStyle will replace a new style on it.
  6717. u.attr({z2:10});var c=t.get(["label","position"]);if("outside"!==c&&"outer"!==c)i.removeTextGuideLine();else{var d=this.getTextGuideLine();d||(d=new B,this.setTextGuideLine(d)),
  6718. // Default use item visual color
  6719. gg(this,yg(o),{stroke:s,opacity:Ht(r.get(["lineStyle","opacity"]),l,1)})}},e}(E);
  6720. // Pie view
  6721. const lm=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ignoreLabelLineUpdate=!0,e}return Ue(e,t),e.prototype.render=function(t,e,n,i){var o,r=t.getData(),a=this._data,s=this.group;
  6722. // First render
  6723. if(!a&&r.count()>0){for(var l=r.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u<r.count();++u)l=r.getItemLayout(u);l&&(o=l.startAngle)}
  6724. // remove empty-circle if it exists
  6725. // when all data are filtered, show lightgray empty circle
  6726. if(this._emptyCircleSector&&s.remove(this._emptyCircleSector),0===r.count()&&t.get("showEmptyCircle")){var c=tm(t),d=new E({shape:p($y(t,n),c)});d.useStyle(t.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=d,s.add(d)}r.diff(a).add((function(t){var e=new sm(r,t,o);r.setItemGraphicEl(t,e),s.add(e)})).update((function(t,e){var n=a.getItemGraphicEl(e);n.updateData(r,t,o),n.off("click"),s.add(n),r.setItemGraphicEl(t,n)})).remove((function(e){lo(a.getItemGraphicEl(e),t,e)})).execute(),am(t),
  6727. // Always use initial animation.
  6728. "expansion"!==t.get("animationTypeUpdate")&&(this._data=r)},e.prototype.dispose=function(){},e.prototype.containPoint=function(t,e){var n=e.getData().getItemLayout(0);if(n){var i=t[0]-n.cx,o=t[1]-n.cy,r=Math.sqrt(i*i+o*o);return r<=n.r&&r>=n.r0}},e.type="pie",e}(Ou);
  6729. /**
  6730. * [Usage]:
  6731. * (1)
  6732. * createListSimply(seriesModel, ['value']);
  6733. * (2)
  6734. * createListSimply(seriesModel, {
  6735. * coordDimensions: ['value'],
  6736. * dimensionsCount: 5
  6737. * });
  6738. */function um(t,e,n){e=i(e)&&{coordDimensions:e}||p({encodeDefine:t.getEncode()},e);var o=t.getSource(),r=Hh(o,e).dimensions,a=new Fh(r,t);return a.initData(o,n),a}
  6739. /*
  6740. * Licensed to the Apache Software Foundation (ASF) under one
  6741. * or more contributor license agreements. See the NOTICE file
  6742. * distributed with this work for additional information
  6743. * regarding copyright ownership. The ASF licenses this file
  6744. * to you under the Apache License, Version 2.0 (the
  6745. * "License"); you may not use this file except in compliance
  6746. * with the License. You may obtain a copy of the License at
  6747. *
  6748. * http://www.apache.org/licenses/LICENSE-2.0
  6749. *
  6750. * Unless required by applicable law or agreed to in writing,
  6751. * software distributed under the License is distributed on an
  6752. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  6753. * KIND, either express or implied. See the License for the
  6754. * specific language governing permissions and limitations
  6755. * under the License.
  6756. */
  6757. /**
  6758. * AUTO-GENERATED FILE. DO NOT MODIFY.
  6759. */
  6760. /*
  6761. * Licensed to the Apache Software Foundation (ASF) under one
  6762. * or more contributor license agreements. See the NOTICE file
  6763. * distributed with this work for additional information
  6764. * regarding copyright ownership. The ASF licenses this file
  6765. * to you under the Apache License, Version 2.0 (the
  6766. * "License"); you may not use this file except in compliance
  6767. * with the License. You may obtain a copy of the License at
  6768. *
  6769. * http://www.apache.org/licenses/LICENSE-2.0
  6770. *
  6771. * Unless required by applicable law or agreed to in writing,
  6772. * software distributed under the License is distributed on an
  6773. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  6774. * KIND, either express or implied. See the License for the
  6775. * specific language governing permissions and limitations
  6776. * under the License.
  6777. */
  6778. /**
  6779. * LegendVisualProvider is an bridge that pick encoded color from data and
  6780. * provide to the legend component.
  6781. */var cm=/** @class */function(){function t(
  6782. // Function to get data after filtered. It stores all the encoding info
  6783. t,
  6784. // Function to get raw data before filtered.
  6785. e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();
  6786. // We find the name from the raw data. In case it's filtered by the legend component.
  6787. // Normally, the name can be found in rawData, but can't be found in filtered data will display as gray.
  6788. return t.mapArray(t.getName)},t.prototype.containName=function(t){return this._getRawData().indexOfName(t)>=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}();const dm=cm;var hm=On();const pm=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}
  6789. /**
  6790. * @overwrite
  6791. */return Ue(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),
  6792. // Enable legend selection for each data item
  6793. // Use a function instead of direct access because data reference may changed
  6794. this.legendVisualProvider=new dm(lt(this.getData,this),lt(this.getRawData,this)),this._defaultLabelLine(e)},
  6795. /**
  6796. * @overwrite
  6797. */
  6798. e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},
  6799. /**
  6800. * @overwrite
  6801. */
  6802. e.prototype.getInitialData=function(){return um(this,{coordDimensions:["value"],encodeDefaulter:rt(Ua,this)})},
  6803. /**
  6804. * @overwrite
  6805. */
  6806. e.prototype.getDataParams=function(e){var n=this.getData(),i=hm(n),o=i.seats;
  6807. // update seats when data is changed
  6808. if(!o){var r=[];n.each(n.mapDimension("value"),(function(t){r.push(t)})),o=i.seats=tn(r,n.hostModel.get("percentPrecision"))}var a=t.prototype.getDataParams.call(this,e);
  6809. // seats may be empty when sum is 0
  6810. return a.percent=o[e]||0,a.$vars.push("percent"),a},e.prototype._defaultLabelLine=function(t){
  6811. // Extend labelLine emphasis
  6812. wn(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;
  6813. // Not show label line if `label.normal.show = false`
  6814. e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={
  6815. // zlevel: 0,
  6816. z:2,legendHoverLink:!0,colorBy:"data",
  6817. // 默认全局居中
  6818. center:["50%","50%"],radius:[0,"75%"],
  6819. // 默认顺时针
  6820. clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,
  6821. // 最小角度改为0
  6822. minAngle:0,
  6823. // If the angle of a sector less than `minShowLabelAngle`,
  6824. // the label will not be displayed.
  6825. minShowLabelAngle:0,
  6826. // 选中时扇区偏移量
  6827. selectedOffset:10,
  6828. // 选择模式,默认关闭,可选single,multiple
  6829. // selectedMode: false,
  6830. // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积)
  6831. // roseType: null,
  6832. percentPrecision:2,
  6833. // If still show when all data zero.
  6834. stillShowZeroSum:!0,
  6835. // cursor: null,
  6836. left:0,top:0,right:0,bottom:0,width:null,height:null,label:{
  6837. // color: 'inherit',
  6838. // If rotate around circle
  6839. rotate:0,show:!0,overflow:"truncate",
  6840. // 'outer', 'inside', 'center'
  6841. position:"outer",
  6842. // 'none', 'labelLine', 'edge'. Works only when position is 'outer'
  6843. alignTo:"none",
  6844. // Closest distance between label and chart edge.
  6845. // Works only position is 'outer' and alignTo is 'edge'.
  6846. edgeDistance:"25%",
  6847. // Works only position is 'outer' and alignTo is not 'edge'.
  6848. bleedMargin:10,
  6849. // Distance between text and label line.
  6850. distanceToLabelLine:5},
  6851. // Enabled when label.normal.position is 'outer'
  6852. labelLine:{show:!0,
  6853. // 引导线两段中的第一段长度
  6854. length:15,
  6855. // 引导线两段中的第二段长度
  6856. length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{
  6857. // color: 各异,
  6858. width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{
  6859. // Hide the overlapped label.
  6860. hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},
  6861. // If use strategy to avoid label overlapping
  6862. avoidLabelOverlap:!0,
  6863. // Animation type. Valid values: expansion, scale
  6864. animationType:"expansion",animationDuration:1e3,
  6865. // Animation type when update. Valid values: transition, expansion
  6866. animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(Su);const fm=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return Ue(e,t),e.prototype.getInitialData=function(t,e){return Jh(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},e.prototype.getZLevelKey=function(){
  6867. // Each progressive series has individual key.
  6868. return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",
  6869. // zlevel: 0,
  6870. z:2,legendHoverLink:!0,symbolSize:10,
  6871. // symbolRotate: null, // 图形旋转控制
  6872. large:!1,
  6873. // Available when large is true
  6874. largeThreshold:2e3,
  6875. // cursor: null,
  6876. itemStyle:{opacity:.8},emphasis:{scale:!0},
  6877. // If clip the overflow graphics
  6878. // Works on cartesian / polar series
  6879. clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(Su);var gm=function(){},ym=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new gm},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,e){var n,i=e.points,o=e.size,r=this.symbolProxy,a=r.shape,s=t.getContext?t.getContext():t,l=s&&o[0]<4,u=this.softClipShape;
  6880. // Do draw in afterBrush.
  6881. if(l)this._ctx=s;else{for(this._ctx=null,n=this._off;n<i.length;){var c=i[n++],d=i[n++];isNaN(c)||isNaN(d)||(u&&!u.contain(c,d)||(a.x=c-o[0]/2,a.y=d-o[1]/2,a.width=o[0],a.height=o[1],r.buildPath(t,a,!0)))}this.incremental&&(this._off=n,this.notClear=!0)}},e.prototype.afterBrush=function(){var t,e=this.shape,n=e.points,i=e.size,o=this._ctx,r=this.softClipShape;if(o){
  6882. // PENDING If style or other canvas status changed?
  6883. for(t=this._off;t<n.length;){var a=n[t++],s=n[t++];isNaN(a)||isNaN(s)||(r&&!r.contain(a,s)||
  6884. // fillRect is faster than building a rect path and draw.
  6885. // And it support light globalCompositeOperation.
  6886. o.fillRect(a-i[0]/2,s-i[1]/2,i[0],i[1]))}this.incremental&&(this._off=t,this.notClear=!0)}},e.prototype.findDataIndex=function(t,e){
  6887. // Not consider transform
  6888. // Treat each element as a rect
  6889. // top down traverse
  6890. for(
  6891. // TODO ???
  6892. // Consider transform
  6893. var n=this.shape,i=n.points,o=n.size,r=Math.max(o[0],4),a=Math.max(o[1],4),s=i.length/2-1;s>=0;s--){var l=2*s,u=i[l]-r/2,c=i[l+1]-a/2;if(t>=u&&e>=c&&t<=u+r&&e<=c+a)return s}return-1},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect();return t=n[0],e=n[1],i.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},e.prototype.getBoundingRect=function(){
  6894. // Ignore stroke for large symbol draw.
  6895. var t=this._rect;if(!t){for(var e=this.shape,n=e.points,i=e.size,o=i[0],r=i[1],a=Infinity,s=Infinity,l=-Infinity,u=-Infinity,c=0;c<n.length;){var d=n[c++],h=n[c++];a=Math.min(d,a),l=Math.max(d,l),s=Math.min(h,s),u=Math.max(h,u)}t=this._rect=new Y(a-o/2,s-r/2,l-a+o,u-s+r)}return t},e}(g),mm=/** @class */function(){function t(){this.group=new Z}
  6896. /**
  6897. * Update symbols draw by new data
  6898. */return t.prototype.updateData=function(t,e){this._clear();var n=this._create();n.setShape({points:t.getLayout("points")}),this._setCommon(n,t,e)},t.prototype.updateLayout=function(t){var e=t.getLayout("points");this.group.eachChild((function(t){if(null!=t.startIndex){var n=2*(t.endIndex-t.startIndex),i=4*t.startIndex*2;e=new Float32Array(e.buffer,i,n)}t.setShape("points",e),
  6899. // Reset draw cursor.
  6900. t.reset()}))},t.prototype.incrementalPrepareUpdate=function(t){this._clear()},t.prototype.incrementalUpdate=function(t,e,n){var i=this._newAdded[0],o=e.getLayout("points"),r=i&&i.shape.points;
  6901. // Merging the exists. Each element has 1e4 points.
  6902. // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization)
  6903. if(r&&r.length<2e4){var a=r.length,s=new Float32Array(a+o.length);
  6904. // Concat two array
  6905. s.set(r),s.set(o,a),
  6906. // Update endIndex
  6907. i.endIndex=t.end,i.setShape({points:s})}else{
  6908. // Clear
  6909. this._newAdded=[];var l=this._create();l.startIndex=t.start,l.endIndex=t.end,l.incremental=!0,l.setShape({points:o}),this._setCommon(l,e,n)}},t.prototype.eachRendered=function(t){this._newAdded[0]&&t(this._newAdded[0])},t.prototype._create=function(){var t=new ym({cursor:"default"});return t.ignoreCoarsePointer=!0,this.group.add(t),this._newAdded.push(t),t},t.prototype._setCommon=function(t,e,n){var i=e.hostModel;n=n||{};var o=e.getVisual("symbolSize");t.setShape("size",o instanceof Array?o:[o,o]),t.softClipShape=n.clipShape||null,
  6910. // Create symbolProxy to build path for each data
  6911. t.symbolProxy=Gc(e.getVisual("symbol"),0,0,0,0),
  6912. // Use symbolProxy setColor method
  6913. t.setColor=t.symbolProxy.setColor;var r=t.shape.size[0]<4;t.useStyle(
  6914. // Draw shadow when doing fillRect is extremely slow.
  6915. i.getModel("itemStyle").getItemStyle(r?["color","shadowBlur","shadowColor"]:["color"]));var a=e.getVisual("style"),s=a&&a.fill;s&&t.setColor(s);var l=ni(t);
  6916. // Enable tooltip
  6917. // PENDING May have performance issue when path is extremely large
  6918. l.seriesIndex=i.seriesIndex,t.on("mousemove",(function(e){l.dataIndex=null;var n=t.hoverDataIdx;n>=0&&(
  6919. // Provide dataIndex for tooltip
  6920. l.dataIndex=n+(t.startIndex||0))}))},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();const vm=mm;const xm=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).updateData(i,{
  6921. // TODO
  6922. // If this parameter should be a shape or a bounding volume
  6923. // shape will be more general.
  6924. // But bounding volume like bounding rect will be much faster in the contain calculation
  6925. clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).incrementalPrepareUpdate(i),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},e.prototype.updateTransform=function(t,e,n){var i=t.getData();
  6926. // Must mark group dirty and make sure the incremental layer will be cleared
  6927. // PENDING
  6928. if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var o=my("").reset(t,e,n);o.progress&&o.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){if(t.get("clip",!0)){var e=t.coordinateSystem;
  6929. // PENDING make `0.1` configurable, for example, `clipTolerance`?
  6930. return e&&e.getArea&&e.getArea(.1)}},e.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,i=e.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new vm:new Yg,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(Ou);const _m=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,
  6931. // zlevel: 0,
  6932. z:0,left:"10%",top:60,right:"10%",bottom:70,
  6933. // If grid size contain label
  6934. containLabel:!1,
  6935. // width: {totalWidth} - left - right,
  6936. // height: {totalHeight} - top - bottom,
  6937. backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Ta);var bm=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",zn).models[0]},e.type="cartesian2dAxis",e}(Ta);nt(bm,df);var Sm={show:!0,
  6938. // zlevel: 0,
  6939. z:0,
  6940. // Inverse the axis.
  6941. inverse:!1,
  6942. // Axis name displayed.
  6943. name:"",
  6944. // 'start' | 'middle' | 'end'
  6945. nameLocation:"end",
  6946. // By degree. By default auto rotate by nameLocation.
  6947. nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},
  6948. // Use global text style by default.
  6949. nameTextStyle:{},
  6950. // The gap between axisName and axisLine.
  6951. nameGap:15,
  6952. // Default `false` to support tooltip.
  6953. silent:!1,
  6954. // Default `false` to avoid legacy user event listener fail.
  6955. triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},
  6956. // The arrow at both ends the the axis.
  6957. symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,
  6958. // Whether axisTick is inside the grid or outside the grid.
  6959. inside:!1,
  6960. // The length of axisTick.
  6961. length:5,lineStyle:{width:1}},axisLabel:{show:!0,
  6962. // Whether axisLabel is inside the grid or outside the grid.
  6963. inside:!1,rotate:0,
  6964. // true | false | null/undefined (auto)
  6965. showMinLabel:null,
  6966. // true | false | null/undefined (auto)
  6967. showMaxLabel:null,margin:8,
  6968. // formatter: null,
  6969. fontSize:12},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},wm=tt({
  6970. // The gap at both ends of the axis. For categoryAxis, boolean.
  6971. boundaryGap:!0,
  6972. // Set false to faster category collection.
  6973. deduplication:null,
  6974. // splitArea: {
  6975. // show: false
  6976. // },
  6977. splitLine:{show:!1},axisTick:{
  6978. // If tick is align with label when boundaryGap is true
  6979. alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},Sm),Mm=tt({boundaryGap:[0,0],axisLine:{
  6980. // Not shown when other axis is categoryAxis in cartesian
  6981. show:"auto"},axisTick:{
  6982. // Not shown when other axis is categoryAxis in cartesian
  6983. show:"auto"},
  6984. // TODO
  6985. // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]
  6986. splitNumber:5,minorTick:{
  6987. // Minor tick, not available for cateogry axis.
  6988. show:!1,
  6989. // Split number of minor ticks. The value should be in range of (0, 100)
  6990. splitNumber:5,
  6991. // Length of minor tick
  6992. length:3,
  6993. // Line style
  6994. lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},Sm);const Im={category:wm,value:Mm,time:tt({splitNumber:6,axisLabel:{
  6995. // To eliminate labels that are not nice
  6996. showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},Mm),log:I({logBase:10},Mm)};
  6997. /*
  6998. * Licensed to the Apache Software Foundation (ASF) under one
  6999. * or more contributor license agreements. See the NOTICE file
  7000. * distributed with this work for additional information
  7001. * regarding copyright ownership. The ASF licenses this file
  7002. * to you under the Apache License, Version 2.0 (the
  7003. * "License"); you may not use this file except in compliance
  7004. * with the License. You may obtain a copy of the License at
  7005. *
  7006. * http://www.apache.org/licenses/LICENSE-2.0
  7007. *
  7008. * Unless required by applicable law or agreed to in writing,
  7009. * software distributed under the License is distributed on an
  7010. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  7011. * KIND, either express or implied. See the License for the
  7012. * specific language governing permissions and limitations
  7013. * under the License.
  7014. */
  7015. /**
  7016. * AUTO-GENERATED FILE. DO NOT MODIFY.
  7017. */
  7018. /*
  7019. * Licensed to the Apache Software Foundation (ASF) under one
  7020. * or more contributor license agreements. See the NOTICE file
  7021. * distributed with this work for additional information
  7022. * regarding copyright ownership. The ASF licenses this file
  7023. * to you under the Apache License, Version 2.0 (the
  7024. * "License"); you may not use this file except in compliance
  7025. * with the License. You may obtain a copy of the License at
  7026. *
  7027. * http://www.apache.org/licenses/LICENSE-2.0
  7028. *
  7029. * Unless required by applicable law or agreed to in writing,
  7030. * software distributed under the License is distributed on an
  7031. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  7032. * KIND, either express or implied. See the License for the
  7033. * specific language governing permissions and limitations
  7034. * under the License.
  7035. */var Dm={value:1,category:1,time:1,log:1};
  7036. /**
  7037. * Generate sub axis model class
  7038. * @param axisName 'x' 'y' 'radius' 'angle' 'parallel' ...
  7039. */function Tm(t,e,n,i){a(Dm,(function(o,r){var a=tt(tt({},Im[r],!0),i,!0),s=/** @class */function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e+"Axis."+r,n}return Ue(n,t),n.prototype.mergeDefaultAndTheme=function(t,e){var n=ba(this),i=n?wa(t):{},o=e.getTheme();tt(t,o.get(r+"Axis")),tt(t,this.getDefaultOption()),t.type=Cm(t),n&&Sa(t,i,n)},n.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=ip.createByAxisModel(this))},
  7040. /**
  7041. * Should not be called before all of 'getInitailData' finished.
  7042. * Because categories are collected during initializing data.
  7043. */
  7044. n.prototype.getCategories=function(t){var e=this.option;
  7045. // FIXME
  7046. // warning if called before all of 'getInitailData' finished.
  7047. if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.type=e+"Axis."+r,n.defaultOption=a,n}(n);t.registerComponentModel(s)})),t.registerSubTypeDefaulter(e+"Axis",Cm)}function Cm(t){
  7048. // Default axis with data is category axis
  7049. return t.type||(t.data?"category":"value")}var Am=/** @class */function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return n(this._dimList,(function(t){return this._axes[t]}),this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),st(this.getAxes(),(function(e){return e.scale.type===t}))},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}();var Lm=["x","y"];function km(t){return"interval"===t.type||"time"===t.type}var Pm=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=Lm,e}
  7050. /**
  7051. * Calculate an affine transform matrix if two axes are time or value.
  7052. * It's mainly for accelartion on the large time series data.
  7053. */return Ue(e,t),e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(km(t)&&km(e)){var n=t.getExtent(),i=e.getExtent(),o=this.dataToPoint([n[0],i[0]]),r=this.dataToPoint([n[1],i[1]]),a=n[1]-n[0],s=i[1]-i[0];if(a&&s){
  7054. // Accelerate data to point calculation on the special large time series data.
  7055. var l=(r[0]-o[0])/a,u=(r[1]-o[1])/s,c=o[0]-n[0]*l,d=o[1]-i[0]*u,h=this._transform=[l,0,0,u,c,d];this._invTransform=k([],h)}}},
  7056. /**
  7057. * Base axis will be used on stacking.
  7058. */
  7059. e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,e){var n=this.dataToPoint(t),i=this.dataToPoint(e),o=this.getArea(),r=new Y(n[0],n[1],i[0]-n[0],i[1]-n[1]);return o.intersect(r)},e.prototype.dataToPoint=function(t,e,n){n=n||[];var i=t[0],o=t[1];
  7060. // Fast path
  7061. if(this._transform&&null!=i&&isFinite(i)&&null!=o&&isFinite(o))return P(n,t,this._transform);var r=this.getAxis("x"),a=this.getAxis("y");return n[0]=r.toGlobalCoord(r.dataToCoord(i,e)),n[1]=a.toGlobalCoord(a.dataToCoord(o,e)),n},e.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,o=n.getExtent(),r=i.getExtent(),a=n.parse(t[0]),s=i.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(o[0],o[1]),a),Math.max(o[0],o[1])),e[1]=Math.min(Math.max(Math.min(r[0],r[1]),s),Math.max(r[0],r[1])),e},e.prototype.pointToData=function(t,e){var n=[];if(this._invTransform)return P(n,t,this._invTransform);var i=this.getAxis("x"),o=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(t[0]),e),n[1]=o.coordToData(o.toLocalCoord(t[1]),e),n},e.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},
  7062. /**
  7063. * Get rect area of cartesian.
  7064. * Area will have a contain function to determine if a point is in the coordinate system.
  7065. */
  7066. e.prototype.getArea=function(t){t=t||0;var e=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),i=Math.min(e[0],e[1])-t,o=Math.min(n[0],n[1])-t,r=Math.max(e[0],e[1])-i+t,a=Math.max(n[0],n[1])-o+t;return new Y(i,o,r,a)},e}(Am),Nm=/** @class */function(t){function e(e,n,i,o,r){var a=t.call(this,e,n,i)||this;
  7067. /**
  7068. * Index of axis, can be used as key
  7069. * Injected outside.
  7070. */return a.index=0,a.type=o||"value",a.position=r||"bottom",a}return Ue(e,t),e.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},
  7071. /**
  7072. * Each item cooresponds to this.getExtent(), which
  7073. * means globalExtent[0] may greater than globalExtent[1],
  7074. * unless `asc` is input.
  7075. *
  7076. * @param {boolean} [asc]
  7077. * @return {Array.<number>}
  7078. */
  7079. e.prototype.getGlobalExtent=function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},e.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},
  7080. /**
  7081. * Set ordinalSortInfo
  7082. * @param info new OrdinalSortInfo
  7083. */
  7084. e.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(Yf);const Om=Nm;
  7085. /**
  7086. * Can only be called after coordinate system creation stage.
  7087. * (Can be called before coordinate system update stage).
  7088. */function Rm(t,e,n){n=n||{};var i=t.coordinateSystem,o=e.axis,r={},a=o.getAxesOnZeroOf()[0],s=o.position,l=a?"onZero":s,u=o.dim,c=i.getRect(),d=[c.x,c.x+c.width,c.y,c.y+c.height],h={left:0,right:1,top:0,bottom:1,onZero:2},p=e.get("offset")||0,f="x"===u?[d[2]-p,d[3]+p]:[d[0]-p,d[1]+p];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));f[h.onZero]=Math.max(Math.min(g,f[1]),f[0])}
  7089. // Axis position
  7090. r.position=["y"===u?f[h[l]]:d[0],"x"===u?f[h[l]]:d[3]],
  7091. // Axis rotation
  7092. r.rotation=Math.PI/2*("x"===u?0:1);r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],r.labelOffset=a?f[h[s]]-f[h.onZero]:0,e.get(["axisTick","inside"])&&(r.tickDirection=-r.tickDirection),Yt(n.labelInside,e.get(["axisLabel","inside"]))&&(r.labelDirection=-r.labelDirection);
  7093. // Special label rotation
  7094. var y=e.get(["axisLabel","rotate"]);return r.labelRotate="top"===l?-y:y,
  7095. // Over splitLine and splitArea
  7096. r.z2=1,r}function Em(t){return"cartesian2d"===t.get("coordinateSystem")}function Vm(t){var e={xAxisModel:null,yAxisModel:null};return a(e,(function(n,i){var o=i.replace(/Model$/,""),r=t.getReferringComponents(o,zn).models[0];e[i]=r})),e}var zm=Math.log;function Bm(t,e,n){var i=yp.prototype,o=i.getTicks.call(n),r=i.getTicks.call(n,!0),a=o.length-1,s=i.getInterval.call(n),l=ef(t,e),u=l.extent,c=l.fixMin,d=l.fixMax;
  7097. // NOTE: There is a precondition for log scale here:
  7098. // In log scale we store _interval and _extent of exponent value.
  7099. // So if we use the method of InternalScale to set/get these data.
  7100. // It process the exponent value, which is linear and what we want here.
  7101. if("log"===t.type){var h=zm(t.base);u=[zm(u[0])/h,zm(u[1])/h]}t.setExtent(u[0],u[1]),t.calcNiceExtent({splitNumber:a,fixMin:c,fixMax:d});var p=i.getExtent.call(t);
  7102. // Need to update the rawExtent.
  7103. // Because value in rawExtent may be not parsed. e.g. 'dataMin', 'dataMax'
  7104. c&&(u[0]=p[0]),d&&(u[1]=p[1]);var f=i.getInterval.call(t),g=u[0],y=u[1];if(c&&d)
  7105. // User set min, max, divide to get new interval
  7106. f=(y-g)/a;else if(c)
  7107. // User set min, expand extent on the other side
  7108. for(y=u[0]+f*a;y<u[1]&&isFinite(y)&&isFinite(u[1]);)f=ap(f),y=u[0]+f*a;else if(d)for(
  7109. // User set max, expand extent on the other side
  7110. g=u[1]-f*a;g>u[0]&&isFinite(g)&&isFinite(u[0]);)f=ap(f),g=u[1]-f*a;else{t.getTicks().length-1>a&&(f=ap(f));var m=f*a;
  7111. // Not change the result that crossing zero.
  7112. (g=qe((y=Math.ceil(u[1]/f)*f)-m))<0&&u[0]>=0?(g=0,y=qe(m)):y>0&&u[1]<=0&&(y=0,g=-qe(m))}
  7113. // Adjust min, max based on the extent of alignTo. When min or max is set in alignTo scale
  7114. var v=(o[0].value-r[0].value)/s,x=(o[a].value-r[a].value)/s;
  7115. // NOTE: Must in setExtent -> setInterval -> setNiceExtent order.
  7116. i.setExtent.call(t,g+f*v,y+f*x),i.setInterval.call(t,f),(v||x)&&i.setNiceExtent.call(t,g+f,y-f)}var Gm=/** @class */function(){function t(t,e,n){
  7117. // FIXME:TS where used (different from registered type 'cartesian2d')?
  7118. this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=Lm,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){var n=this._axesMap;function i(t){var e,n=v(t),i=n.length;
  7119. // Axis is added in order of axisIndex.
  7120. if(i){
  7121. // Process once and calculate the ticks for those don't use alignTicks.
  7122. for(var o=[],r=i-1;r>=0;r--){var s=t[+n[r]],l=s.model,u=s.scale;// Convert to number.
  7123. // Only value and log axis without interval support alignTicks.
  7124. op(u)&&l.get("alignTicks")&&null==l.get("interval")?o.push(s):(nf(u,l),op(u)&&(
  7125. // Can only align to interval or log axis.
  7126. e=s))}
  7127. // All axes has set alignTicks. Pick the first one.
  7128. // PENDING. Should we find the axis that both set interval, min, max and align to this one?
  7129. o.length&&(e||nf((e=o.pop()).scale,e.model),a(o,(function(t){Bm(t.scale,t.model,e.scale)})))}}this._updateScale(t,this.model),i(n.x),i(n.y);
  7130. // Key: axisDim_axisIndex, value: boolean, whether onZero target.
  7131. var o={};a(n.x,(function(t){Wm(n,"y",t,o)})),a(n.y,(function(t){Wm(n,"x",t,o)})),
  7132. // Resize again if containLabel is enabled
  7133. // FIXME It may cause getting wrong grid size in data processing stage
  7134. this.resize(this.model,e)},
  7135. /**
  7136. * Resize the grid
  7137. */
  7138. t.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),o=!n&&t.get("containLabel"),r=xa(i,{width:e.getWidth(),height:e.getHeight()});this._rect=r;var s=this._axesList;function l(){a(s,(function(t){var e=t.isHorizontal(),n=e?[0,r.width]:[0,r.height],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),function(t,e){var n=t.getExtent(),i=n[0]+n[1];
  7139. // Fast transform
  7140. t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return i-t+e}}(t,e?r.x:r.y)}))}l(),
  7141. // Minus label size
  7142. o&&(a(s,(function(t){if(!t.model.get(["axisLabel","inside"])){var e=function(t){var e=t.model,n=t.scale;if(e.get(["axisLabel","show"])&&!n.isBlank()){var i,o,r=n.getExtent();
  7143. // Optimize for large category data, avoid call `getTicks()`.
  7144. o=n instanceof pp?n.count():(i=n.getTicks()).length;var a,s=t.getLabelModel(),l=rf(t),u=1;
  7145. // Simple optimization for large amount of labels
  7146. o>40&&(u=Math.ceil(o/40));for(var c=0;c<o;c+=u){var d=l(i?i[c]:{value:r[0]+c},c),h=sf(s.getTextRect(d),s.get("rotate")||0);a?a.union(h):a=h}return a}}(t);if(e){var n=t.isHorizontal()?"height":"width",i=t.model.get(["axisLabel","margin"]);r[n]-=e[n]+i,"top"===t.position?r.y+=e.height+i:"left"===t.position&&(r.x+=e.width+i)}}})),l()),a(this._coordsList,(function(t){
  7147. // Calculate affine matrix to accelerate the data to point transform.
  7148. // If all the axes scales are time or value.
  7149. t.calcAffineTransform()}))},t.prototype.getAxis=function(t,e){var n=this._axesMap[t];if(null!=n)return n[e||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}o(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,r=this._coordsList;i<r.length;i++)if(r[i].getAxis("x").index===t||r[i].getAxis("y").index===e)return r[i]},t.prototype.getCartesians=function(){return this._coordsList.slice()},
  7150. /**
  7151. * @implements
  7152. */
  7153. t.prototype.convertToPixel=function(t,e,n){var i=this._findConvertTarget(e);return i.cartesian?i.cartesian.dataToPoint(n):i.axis?i.axis.toGlobalCoord(i.axis.dataToCoord(n)):null},
  7154. /**
  7155. * @implements
  7156. */
  7157. t.prototype.convertFromPixel=function(t,e,n){var i=this._findConvertTarget(e);return i.cartesian?i.cartesian.pointToData(n):i.axis?i.axis.coordToData(i.axis.toLocalCoord(n)):null},t.prototype._findConvertTarget=function(t){var e,n,i=t.seriesModel,o=t.xAxisModel||i&&i.getReferringComponents("xAxis",zn).models[0],r=t.yAxisModel||i&&i.getReferringComponents("yAxis",zn).models[0],a=t.gridModel,s=this._coordsList;if(i)e=i.coordinateSystem,c(s,e)<0&&(e=null);else if(o&&r)e=this.getCartesian(o.componentIndex,r.componentIndex);else if(o)n=this.getAxis("x",o.componentIndex);else if(r)n=this.getAxis("y",r.componentIndex);else if(a){a.coordinateSystem===this&&(e=this._coordsList[0])}return{cartesian:e,axis:n}},
  7158. /**
  7159. * @implements
  7160. */
  7161. t.prototype.containPoint=function(t){var e=this._coordsList[0];if(e)return e.containPoint(t)},
  7162. /**
  7163. * Initialize cartesian coordinate systems
  7164. */
  7165. t.prototype._initCartesian=function(t,e,n){var i=this,o=this,r={left:!1,right:!1,top:!1,bottom:!1},s={x:{},y:{}},l={x:0,y:0};if(
  7166. // Create axis
  7167. e.eachComponent("xAxis",u("x"),this),e.eachComponent("yAxis",u("y"),this),!l.x||!l.y)
  7168. // Roll back when there no either x or y axis
  7169. return this._axesMap={},void(this._axesList=[]);function u(e){return function(n,i){if(Fm(n,t)){var a=n.get("position");"x"===e?
  7170. // Fix position
  7171. "top"!==a&&"bottom"!==a&&(
  7172. // Default bottom of X
  7173. a=r.bottom?"top":"bottom"):
  7174. // Fix position
  7175. "left"!==a&&"right"!==a&&(
  7176. // Default left of Y
  7177. a=r.left?"right":"left"),r[a]=!0;var u=new Om(e,of(n),[0,0],n.get("type"),a),c="category"===u.type;u.onBand=c&&n.get("boundaryGap"),u.inverse=n.get("inverse"),
  7178. // Inject axis into axisModel
  7179. n.axis=u,
  7180. // Inject axisModel into axis
  7181. u.model=n,
  7182. // Inject grid info axis
  7183. u.grid=o,
  7184. // Index of axis, can be used as key
  7185. u.index=i,o._axesList.push(u),s[e][i]=u,l[e]++}}}this._axesMap=s,
  7186. // Create cartesian2d
  7187. a(s.x,(function(e,n){a(s.y,(function(o,r){var a="x"+n+"y"+r,s=new Pm(a);s.master=i,s.model=t,i._coordsMap[a]=s,i._coordsList.push(s),s.addAxis(e),s.addAxis(o)}))}))},
  7188. /**
  7189. * Update cartesian properties from series.
  7190. */
  7191. t.prototype._updateScale=function(t,e){function n(t,e){a(cf(t,e.dim),(function(n){e.scale.unionExtentFromData(t,n)}))}
  7192. // Reset scale
  7193. a(this._axesList,(function(t){if(t.scale.setExtent(Infinity,-Infinity),"category"===t.type){var e=t.model.get("categorySortInfo");t.scale.setSortInfo(e)}})),t.eachSeries((function(t){if(Em(t)){var i=Vm(t),o=i.xAxisModel,r=i.yAxisModel;if(!Fm(o,e)||!Fm(r,e))return;var a=this.getCartesian(o.componentIndex,r.componentIndex),s=t.getData(),l=a.getAxis("x"),u=a.getAxis("y");n(s,l),n(s,u)}}),this)},
  7194. /**
  7195. * @param dim 'x' or 'y' or 'auto' or null/undefined
  7196. */
  7197. t.prototype.getTooltipAxes=function(t){var e=[],n=[];return a(this.getCartesians(),(function(i){var o=null!=t&&"auto"!==t?i.getAxis(t):i.getBaseAxis(),r=i.getOtherAxis(o);c(e,o)<0&&e.push(o),c(n,r)<0&&n.push(r)})),{baseAxes:e,otherAxes:n}},t.create=function(e,n){var i=[];return e.eachComponent("grid",(function(o,r){var a=new t(o,e,n);a.name="grid_"+r,
  7198. // dataSampling requires axis extent, so resize
  7199. // should be performed in create stage.
  7200. a.resize(o,n,!0),o.coordinateSystem=a,i.push(a)})),
  7201. // Inject the coordinateSystems into seriesModel
  7202. e.eachSeries((function(t){if(Em(t)){var e=Vm(t),n=e.xAxisModel,i=e.yAxisModel,o=n.getCoordSysModel().coordinateSystem;t.coordinateSystem=o.getCartesian(n.componentIndex,i.componentIndex)}})),i},
  7203. // For deciding which dimensions to use when creating list data
  7204. t.dimensions=Lm,t}();
  7205. /**
  7206. * Check if the axis is used in the specified grid.
  7207. */function Fm(t,e){return t.getCoordSysModel()===e}function Wm(t,e,n,
  7208. // Key: see `getOnZeroRecordKey`
  7209. i){n.getAxesOnZeroOf=function(){
  7210. // TODO: onZero of multiple axes.
  7211. return o?[o]:[]};
  7212. // onZero can not be enabled in these two situations:
  7213. // 1. When any other axis is a category axis.
  7214. // 2. When no axis is cross 0 point.
  7215. var o,r=t[e],a=n.model,s=a.get(["axisLine","onZero"]),l=a.get(["axisLine","onZeroAxisIndex"]);if(s){
  7216. // If target axis is specified.
  7217. if(null!=l)Hm(r[l])&&(o=r[l]);else
  7218. // Find the first available other axis.
  7219. for(var u in r)if(r.hasOwnProperty(u)&&Hm(r[u])&&!i[c(r[u])]){o=r[u];break}o&&(i[c(o)]=!0)}function c(t){return t.dim+"_"+t.index}}function Hm(t){return t&&"category"!==t.type&&"time"!==t.type&&function(t){var e=t.scale.getExtent(),n=e[0],i=e[1];return!(n>0&&i>0||n<0&&i<0)}(t)}const Ym=Gm;var Um=Math.PI,Zm=/** @class */function(){function t(t,e){this.group=new Z,this.opt=e,this.axisModel=t,
  7220. // Default value
  7221. I(e,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});
  7222. // FIXME Not use a separate text group?
  7223. var n=new Z({x:e.position[0],y:e.position[1],rotation:e.rotation});
  7224. // this.group.add(transformGroup);
  7225. // this._transformGroup = transformGroup;
  7226. n.updateTransform(),this._transformGroup=n}return t.prototype.hasBuilder=function(t){return!!Xm[t]},t.prototype.add=function(t){Xm[t](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(t,e,n){var i,o,r=on(e-t);return rn(r)?(
  7227. // Label is parallel with axis line.
  7228. o=n>0?"top":"bottom",i="center"):rn(r-Um)?(
  7229. // Label is inverse parallel with axis line.
  7230. o=n>0?"bottom":"top",i="center"):(o="middle",i=r>0&&r<Um?n>0?"right":"left":n>0?"left":"right"),{rotation:r,textAlign:i,textVerticalAlign:o}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),Xm={axisLine:function(e,n,i,o){var r=n.get(["axisLine","show"]);if("auto"===r&&e.handleAutoShown&&(r=e.handleAutoShown("axisLine")),r){var s=n.axis.getExtent(),u=o.transform,c=[s[0],0],d=[s[1],0],h=c[0]>d[0];u&&(P(c,c,u),P(d,d,u));var f=p({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),g=new F({shape:{x1:c[0],y1:c[1],x2:d[0],y2:d[1]},style:f,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1});Mo(g.shape,g.style.lineWidth),g.anid="line",i.add(g);var y=n.get(["axisLine","symbol"]);if(null!=y){var m=n.get(["axisLine","symbolSize"]);t(y)&&(
  7231. // Use the same arrow for start and end point
  7232. y=[y,y]),(t(m)||l(m))&&(
  7233. // Use the same size for width and height
  7234. m=[m,m]);var v=Wc(n.get(["axisLine","symbolOffset"])||0,m),x=m[0],_=m[1];a([{rotate:e.rotation+Math.PI/2,offset:v[0],r:0},{rotate:e.rotation-Math.PI/2,offset:v[1],r:Math.sqrt((c[0]-d[0])*(c[0]-d[0])+(c[1]-d[1])*(c[1]-d[1]))}],(function(t,n){if("none"!==y[n]&&null!=y[n]){var o=Gc(y[n],-x/2,-_/2,x,_,f.stroke,!0),r=t.r+t.offset,a=h?d:c;
  7235. // Calculate arrow position with offset
  7236. o.attr({rotation:t.rotate,x:a[0]+r*Math.cos(e.rotation),y:a[1]-r*Math.sin(e.rotation),silent:!0,z2:11}),i.add(o)}}))}}},axisTickLabel:function(t,e,i,r){var s=function(t,e,n,i){var o=n.axis,r=n.getModel("axisTick"),a=r.get("show");"auto"===a&&i.handleAutoShown&&(a=i.handleAutoShown("axisTick"));if(!a||o.scale.isBlank())return;for(var s=r.getModel("lineStyle"),l=i.tickDirection*r.get("length"),u=Jm(o.getTicksCoords(),e.transform,l,I(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;c<u.length;c++)t.add(u[c]);return u}(i,r,e,t),l=function(t,e,n,i){var r=n.axis,s=Yt(i.axisLabelShow,n.get(["axisLabel","show"]));if(!s||r.scale.isBlank())return;var l=n.getModel("axisLabel"),u=l.get("margin"),c=r.getViewLabels(),d=(Yt(i.labelRotate,l.get("rotate"))||0)*Um/180,h=Zm.innerTextLayout(i.rotation,d,i.labelDirection),p=n.getCategories&&n.getCategories(!0),g=[],y=Zm.isLabelSilent(n),m=n.get("triggerEvent");return a(c,(function(a,s){var d="ordinal"===r.scale.type?r.scale.getRawOrdinalNumber(a.tickValue):a.tickValue,v=a.formattedLabel,_=a.rawLabel,b=l;if(p&&p[d]){var S=p[d];o(S)&&S.textStyle&&(b=new yr(S.textStyle,l,n.ecModel))}var w=b.getTextColor()||n.get(["axisLine","lineStyle","color"]),M=r.dataToCoord(d),I=b.getShallow("align",!0)||h.textAlign,D=x(b.getShallow("alignMinLabel",!0),I),T=x(b.getShallow("alignMaxLabel",!0),I),C=b.getShallow("verticalAlign",!0)||b.getShallow("baseline",!0)||h.textVerticalAlign,A=x(b.getShallow("verticalAlignMinLabel",!0),C),L=x(b.getShallow("verticalAlignMaxLabel",!0),C),k=new $({x:M,y:i.labelOffset+i.labelDirection*u,rotation:h.rotation,silent:y,z2:10+(a.level||0),style:Zo(b,{text:v,align:0===s?D:s===c.length-1?T:I,verticalAlign:0===s?A:s===c.length-1?L:C,fill:f(w)?w(
  7237. // (1) In category axis with data zoom, tick is not the original
  7238. // index of axis.data. So tick should not be exposed to user
  7239. // in category axis.
  7240. // (2) Compatible with previous version, which always use formatted label as
  7241. // input. But in interval scale the formatted label is like '223,445', which
  7242. // maked user replace ','. So we modify it to return original val but remain
  7243. // it as 'string' to avoid error in replacing.
  7244. "category"===r.type?_:"value"===r.type?d+"":d,s):w})});
  7245. // Pack data for mouse event
  7246. if(k.anid="label_"+d,Vo({el:k,componentModel:n,itemName:v,formatterParamsExtra:{isTruncated:function(){return k.isTruncated},value:_,tickIndex:s}}),m){var P=Zm.makeAxisEventDataBase(n);P.targetType="axisLabel",P.value=_,P.tickIndex=s,"category"===r.type&&(P.dataIndex=d),ni(k).eventData=P}
  7247. // FIXME
  7248. e.add(k),k.updateTransform(),g.push(k),t.add(k),k.decomposeTransform()})),g}(i,r,e,t);
  7249. // This bit fixes the label overlap issue for the time chart.
  7250. // See https://github.com/apache/echarts/issues/14266 for more.
  7251. (function(t,e,n){if(uf(t.axis))return;
  7252. // If min or max are user set, we need to check
  7253. // If the tick on min(max) are overlap on their neighbour tick
  7254. // If they are overlapped, we need to hide the min(max) tick label
  7255. var i=t.get(["axisLabel","showMinLabel"]),o=t.get(["axisLabel","showMaxLabel"]);
  7256. // FIXME
  7257. // Have not consider onBand yet, where tick els is more than label els.
  7258. e=e||[],n=n||[];var r=e[0],a=e[1],s=e[e.length-1],l=e[e.length-2],u=n[0],c=n[1],d=n[n.length-1],h=n[n.length-2];!1===i?(jm(r),jm(u)):qm(r,a)&&(i?(jm(a),jm(c)):(jm(r),jm(u)));!1===o?(jm(s),jm(d)):qm(l,s)&&(o?(jm(l),jm(h)):(jm(s),jm(d)))}(e,l,s),function(t,e,n,i){var o=n.axis,r=n.getModel("minorTick");if(!r.get("show")||o.scale.isBlank())return;var a=o.getMinorTicksCoords();if(!a.length)return;for(var s=r.getModel("lineStyle"),l=i*r.get("length"),u=I(s.getLineStyle(),I(n.getModel("axisTick").getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])})),c=0;c<a.length;c++)for(var d=Jm(a[c],e.transform,l,u,"minorticks_"+c),h=0;h<d.length;h++)t.add(d[h])}(i,r,e,t.tickDirection),e.get(["axisLabel","hideOverlap"]))&&_g(mg(n(l,(function(t){return{label:t,priority:t.z2,defaultAttr:{ignore:t.ignore}}}))))},axisName:function(t,e,n,i){var o=Yt(t.axisName,e.get("name"));if(o){var r,a,s=e.get("nameLocation"),l=t.nameDirection,u=e.getModel("nameTextStyle"),c=e.get("nameGap")||0,d=e.axis.getExtent(),h=d[0]>d[1]?-1:1,p=["start"===s?d[0]-h*c:"end"===s?d[1]+h*c:(d[0]+d[1])/2,
  7259. // Reuse labelOffset.
  7260. Km(s)?t.labelOffset+l*c:0],f=e.get("nameRotate");null!=f&&(f=f*Um/180),Km(s)?r=Zm.innerTextLayout(t.rotation,null!=f?f:t.rotation,
  7261. // Adapt to axis.
  7262. l):(r=function(t,e,n,i){var o,r,a=on(n-t),s=i[0]>i[1],l="start"===e&&!s||"start"!==e&&s;rn(a-Um/2)?(r=l?"bottom":"top",o="center"):rn(a-1.5*Um)?(r=l?"top":"bottom",o="center"):(r="middle",o=a<1.5*Um&&a>Um/2?l?"left":"right":l?"right":"left");return{rotation:a,textAlign:o,textVerticalAlign:r}}(t.rotation,s,f||0,d),null!=(a=t.axisNameAvailableWidth)&&(a=Math.abs(a/Math.sin(r.rotation)),!isFinite(a)&&(a=null)));var g=u.getFont(),y=e.get("nameTruncate",!0)||{},m=y.ellipsis,v=Yt(t.nameTruncateMaxWidth,y.maxWidth,a),x=new $({x:p[0],y:p[1],rotation:r.rotation,silent:Zm.isLabelSilent(e),style:Zo(u,{text:o,font:g,overflow:"truncate",width:v,ellipsis:m,fill:u.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:u.get("align")||r.textAlign,verticalAlign:u.get("verticalAlign")||r.textVerticalAlign}),z2:1});if(Vo({el:x,componentModel:e,itemName:o}),x.__fullText=o,
  7263. // Id for animation
  7264. x.anid="name",e.get("triggerEvent")){var _=Zm.makeAxisEventDataBase(e);_.targetType="axisName",_.name=o,ni(x).eventData=_}
  7265. // FIXME
  7266. i.add(x),x.updateTransform(),n.add(x),x.decomposeTransform()}}};
  7267. /**
  7268. * A final axis is translated and rotated from a "standard axis".
  7269. * So opt.position and opt.rotation is required.
  7270. *
  7271. * A standard axis is and axis from [0, 0] to [0, axisExtent[1]],
  7272. * for example: (0, 0) ------------> (0, 50)
  7273. *
  7274. * nameDirection or tickDirection or labelDirection is 1 means tick
  7275. * or label is below the standard axis, whereas is -1 means above
  7276. * the standard axis. labelOffset means offset between label and axis,
  7277. * which is useful when 'onZero', where axisLabel is in the grid and
  7278. * label in outside grid.
  7279. *
  7280. * Tips: like always,
  7281. * positive rotation represents anticlockwise, and negative rotation
  7282. * represents clockwise.
  7283. * The direction of position coordinate is the same as the direction
  7284. * of screen coordinate.
  7285. *
  7286. * Do not need to consider axis 'inverse', which is auto processed by
  7287. * axis extent.
  7288. */function jm(t){t&&(t.ignore=!0)}function qm(t,e){
  7289. // current and next has the same rotation.
  7290. var n=t&&t.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(n&&i){
  7291. // When checking intersect of two rotated labels, we use mRotationBack
  7292. // to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`.
  7293. var o=w([]);return Ut(o,o,-t.rotation),n.applyTransform(M([],o,t.getLocalTransform())),i.applyTransform(M([],o,e.getLocalTransform())),n.intersect(i)}}function Km(t){return"middle"===t||"center"===t}function Jm(t,e,n,i,o){for(var r=[],a=[],s=[],l=0;l<t.length;l++){var u=t[l].coord;a[0]=u,a[1]=0,s[0]=u,s[1]=n,e&&(P(a,a,e),P(s,s,e));
  7294. // Tick line, Not use group transform to have better line draw
  7295. var c=new F({shape:{x1:a[0],y1:a[1],x2:s[0],y2:s[1]},style:i,z2:2,autoBatch:!0,silent:!0});Mo(c.shape,c.style.lineWidth),c.anid=o+"_"+t[l].tickValue,r.push(c)}return r}const $m=Zm;
  7296. // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.
  7297. // allAxesInfo should be updated when setOption performed.
  7298. function Qm(t,e){var n={
  7299. /**
  7300. * key: makeKey(axis.model)
  7301. * value: {
  7302. * axis,
  7303. * coordSys,
  7304. * axisPointerModel,
  7305. * triggerTooltip,
  7306. * triggerEmphasis,
  7307. * involveSeries,
  7308. * snap,
  7309. * seriesModels,
  7310. * seriesDataCount
  7311. * }
  7312. */
  7313. axesInfo:{},seriesInvolved:!1,
  7314. /**
  7315. * key: makeKey(coordSys.model)
  7316. * value: Object: key makeKey(axis.model), value: axisInfo
  7317. */
  7318. coordSysAxesInfo:{},coordSysMap:{}};return function(t,e,n){var i=e.getComponent("tooltip"),o=e.getComponent("axisPointer"),r=o.get("link",!0)||[],s=[];
  7319. // Collect axes info.
  7320. a(n.getCoordinateSystems(),(function(n){
  7321. // Some coordinate system do not support axes, like geo.
  7322. if(n.axisPointerEnabled){var l=iv(n.model),u=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=n;
  7323. // Set tooltip (like 'cross') is a convenient way to show axisPointer
  7324. // for user. So we enable setting tooltip on coordSys model.
  7325. var c=n.model.getModel("tooltip",i);
  7326. // If axis tooltip used, choose tooltip axis for each coordSys.
  7327. // Notice this case: coordSys is `grid` but not `cartesian2D` here.
  7328. if(a(n.getAxes(),rt(f,!1,null)),n.getTooltipAxes&&i&&c.get("show")){
  7329. // Compatible with previous logic. But series.tooltip.trigger: 'axis'
  7330. // or series.data[n].tooltip.trigger: 'axis' are not support any more.
  7331. var d="axis"===c.get("trigger"),h="cross"===c.get(["axisPointer","type"]),p=n.getTooltipAxes(c.get(["axisPointer","axis"]));(d||h)&&a(p.baseAxes,rt(f,!h||"cross",d)),h&&a(p.otherAxes,rt(f,"cross",!1))}
  7332. // fromTooltip: true | false | 'cross'
  7333. // triggerTooltip: true | false | null
  7334. }function f(i,l,d){var h=d.model.getModel("axisPointer",o),p=h.get("show");if(p&&("auto"!==p||i||nv(h))){null==l&&(l=h.get("triggerTooltip")),h=i?function(t,e,n,i,o,r){var s=e.getModel("axisPointer"),l={};
  7335. // Compatible with previous behavior, tooltip axis does not show label by default.
  7336. // Only these properties can be overridden from tooltip to axisPointer.
  7337. a(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],(function(t){l[t]=et(s.get(t))})),
  7338. // category axis do not auto snap, otherwise some tick that do not
  7339. // has value can not be hovered. value/time/log axis default snap if
  7340. // triggered from tooltip and trigger tooltip.
  7341. l.snap="category"!==t.type&&!!r,"cross"===s.get("type")&&(l.type="line");var u=l.label||(l.label={});
  7342. // Follow the convention, do not show label when triggered by tooltip by default.
  7343. if(null==u.show&&(u.show=!1),"cross"===o){
  7344. // When 'cross', both axes show labels.
  7345. var c=s.get(["label","show"]);
  7346. // If triggerTooltip, this is a base axis, which should better not use cross style
  7347. // (cross style is dashed by default)
  7348. if(u.show=null==c||c,!r){var d=l.lineStyle=s.get("crossStyle");d&&I(u,d.textStyle)}}return t.model.getModel("axisPointer",new yr(l,n,i))}(d,c,o,e,i,l):h;var f=h.get("snap"),g=h.get("triggerEmphasis"),y=iv(d.model),m=l||f||"category"===d.type,v=t.axesInfo[y]={key:y,axis:d,coordSys:n,axisPointerModel:h,triggerTooltip:l,triggerEmphasis:g,involveSeries:m,snap:f,useHandle:nv(h),seriesModels:[],linkGroup:null};u[y]=v,t.seriesInvolved=t.seriesInvolved||m;var x=
  7349. /**
  7350. * For example:
  7351. * {
  7352. * axisPointer: {
  7353. * links: [{
  7354. * xAxisIndex: [2, 4],
  7355. * yAxisIndex: 'all'
  7356. * }, {
  7357. * xAxisId: ['a5', 'a7'],
  7358. * xAxisName: 'xxx'
  7359. * }]
  7360. * }
  7361. * }
  7362. */
  7363. function(t,e){for(var n=e.model,i=e.dim,o=0;o<t.length;o++){var r=t[o]||{};if(tv(r[i+"AxisId"],n.id)||tv(r[i+"AxisIndex"],n.componentIndex)||tv(r[i+"AxisName"],n.name))return o}}(r,d);if(null!=x){var _=s[x]||(s[x]={axesInfo:{}});_.axesInfo[y]=v,_.mapper=r[x].mapper,v.linkGroup=_}}}}))}(n,t,e),
  7364. // Check seriesInvolved for performance, in case too many series in some chart.
  7365. n.seriesInvolved&&function(t,e){
  7366. // Prepare data for axis trigger
  7367. e.eachSeries((function(e){
  7368. // Notice this case: this coordSys is `cartesian2D` but not `grid`.
  7369. var n=e.coordinateSystem,i=e.get(["tooltip","trigger"],!0),o=e.get(["tooltip","show"],!0);n&&"none"!==i&&!1!==i&&"item"!==i&&!1!==o&&!1!==e.get(["axisPointer","show"],!0)&&a(t.coordSysAxesInfo[iv(n.model)],(function(t){var i=t.axis;n.getAxis(i.dim)===i&&(t.seriesModels.push(e),null==t.seriesDataCount&&(t.seriesDataCount=0),t.seriesDataCount+=e.getData().count())}))}))}(n,t),n}function tv(t,e){return"all"===t||i(t)&&c(t,e)>=0||t===e}function ev(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[iv(t)]}function nv(t){return!!t.get(["handle","show"])}
  7370. /**
  7371. * @param {module:echarts/model/Model} model
  7372. * @return {string} unique key
  7373. */function iv(t){return t.type+"||"+t.id}var ov={},rv=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}
  7374. /**
  7375. * @override
  7376. */return Ue(e,t),e.prototype.render=function(e,n,i,o){
  7377. // FIXME
  7378. // This process should proformed after coordinate systems updated
  7379. // (axis scale updated), and should be performed each time update.
  7380. // So put it here temporarily, although it is not appropriate to
  7381. // put a model-writing procedure in `view`.
  7382. this.axisPointerClass&&function(t){var e=ev(t);if(e){var n=e.axisPointerModel,i=e.axis.scale,o=n.option,r=n.get("status"),a=n.get("value");
  7383. // Parse init value for category and time axis.
  7384. null!=a&&(a=i.parse(a));var s=nv(n);
  7385. // If `handle` used, `axisPointer` will always be displayed, so value
  7386. // and status should be initialized.
  7387. null==r&&(o.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(
  7388. // Pick a value on axis when initializing.
  7389. null==a||a>l[1])&&(
  7390. // Make handle displayed on the end of the axis when init, which looks better.
  7391. a=l[1]),a<l[0]&&(a=l[0]),o.value=a,s&&(o.status=e.axis.scale.isBlank()?"hide":"show")}}(e),t.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(e,i,!0)},
  7392. /**
  7393. * Action handler.
  7394. */
  7395. e.prototype.updateAxisPointer=function(t,e,n,i){this._doUpdateAxisPointerClass(t,n,!1)},
  7396. /**
  7397. * @override
  7398. */
  7399. e.prototype.remove=function(t,e){var n=this._axisPointer;n&&n.remove(e)},
  7400. /**
  7401. * @override
  7402. */
  7403. e.prototype.dispose=function(e,n){this._disposeAxisPointer(n),t.prototype.dispose.apply(this,arguments)},e.prototype._doUpdateAxisPointerClass=function(t,n,i){var o=e.getAxisPointerClass(this.axisPointerClass);if(o){var r=function(t){var e=ev(t);return e&&e.axisPointerModel}(t);r?(this._axisPointer||(this._axisPointer=new o)).render(t,r,n,i):this._disposeAxisPointer(n)}},e.prototype._disposeAxisPointer=function(t){this._axisPointer&&this._axisPointer.dispose(t),this._axisPointer=null},e.registerAxisPointerClass=function(t,e){ov[t]=e},e.getAxisPointerClass=function(t){return t&&ov[t]},e.type="axis",e}(Mu);
  7404. /**
  7405. * Base class of AxisView.
  7406. */const av=rv;var sv=On();function lv(t,e,n,o){var a=n.axis;if(!a.scale.isBlank()){
  7407. // TODO: TYPE
  7408. var s=n.getModel("splitArea"),l=s.getModel("areaStyle"),u=l.get("color"),c=o.coordinateSystem.getRect(),d=a.getTicksCoords({tickModel:s,clamp:!0});if(d.length){
  7409. // For Making appropriate splitArea animation, the color and anid
  7410. // should be corresponding to previous one if possible.
  7411. var h=u.length,p=sv(t).splitAreaColors,f=r(),g=0;if(p)for(var y=0;y<d.length;y++){var m=p.get(d[y].tickValue);if(null!=m){g=(m+(h-1)*y)%h;break}}var v=a.toGlobalCoord(d[0].coord),x=l.getAreaStyle();u=i(u)?u:[u];for(y=1;y<d.length;y++){var _=a.toGlobalCoord(d[y].coord),b=void 0,S=void 0,w=void 0,M=void 0;a.isHorizontal()?(b=v,S=c.y,w=_-b,M=c.height,v=b+w):(b=c.x,S=v,w=c.width,v=S+(M=_-S));var D=d[y-1].tickValue;null!=D&&f.set(D,g),e.add(new G({anid:null!=D?"area_"+D:null,shape:{x:b,y:S,width:w,height:M},style:I({fill:u[g]},x),autoBatch:!0,silent:!0})),g=(g+1)%h}sv(t).splitAreaColors=f}}}function uv(t){sv(t).splitAreaColors=null}var cv=["axisLine","axisTickLabel","axisName"],dv=["splitArea","splitLine","minorSplitLine"],hv=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="CartesianAxisPointer",n}
  7412. /**
  7413. * @override
  7414. */return Ue(e,t),e.prototype.render=function(e,n,i,o){this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new Z,this.group.add(this._axisGroup),e.get("show")){var s=e.getCoordSysModel(),l=Rm(s,e),u=new $m(e,p({handleAutoShown:function(t){for(var n=s.coordinateSystem.getCartesians(),i=0;i<n.length;i++)if(op(n[i].getOtherAxis(e.axis).scale))
  7415. // Still show axis tick or axisLine if other axis is value / log
  7416. return!0;
  7417. // Not show axisTick or axisLine if other axis is category / time
  7418. return!1}},l));a(cv,u.add,u),this._axisGroup.add(u.getGroup()),a(dv,(function(t){e.get([t,"show"])&&pv[t](this,this._axisGroup,e,s)}),this),o&&"changeAxisOrder"===o.type&&o.isInitSort||Lo(r,this._axisGroup,e),t.prototype.render.call(this,e,n,i,o)}},e.prototype.remove=function(){uv(this)},e.type="cartesianAxis",e}(av),pv={splitLine:function(t,e,n,o){var r=n.axis;if(!r.scale.isBlank()){var a=n.getModel("splitLine"),s=a.getModel("lineStyle"),l=s.get("color"),u=!1!==a.get("showMinLine"),c=!1!==a.get("showMaxLine");l=i(l)?l:[l];for(var d=o.coordinateSystem.getRect(),h=r.isHorizontal(),p=0,f=r.getTicksCoords({tickModel:a}),g=[],y=[],m=s.getLineStyle(),v=0;v<f.length;v++){var x=r.toGlobalCoord(f[v].coord);if((0!==v||u)&&(v!==f.length-1||c)){var _=f[v].tickValue;h?(g[0]=x,g[1]=d.y,y[0]=x,y[1]=d.y+d.height):(g[0]=d.x,g[1]=x,y[0]=d.x+d.width,y[1]=x);var b=p++%l.length,S=new F({anid:null!=_?"line_"+_:null,autoBatch:!0,shape:{x1:g[0],y1:g[1],x2:y[0],y2:y[1]},style:I({stroke:l[b]},m),silent:!0});Mo(S.shape,m.lineWidth),e.add(S)}}}},minorSplitLine:function(t,e,n,i){var o=n.axis,r=n.getModel("minorSplitLine").getModel("lineStyle"),a=i.coordinateSystem.getRect(),s=o.isHorizontal(),l=o.getMinorTicksCoords();if(l.length)for(var u=[],c=[],d=r.getLineStyle(),h=0;h<l.length;h++)for(var p=0;p<l[h].length;p++){var f=o.toGlobalCoord(l[h][p].coord);s?(u[0]=f,u[1]=a.y,c[0]=f,c[1]=a.y+a.height):(u[0]=a.x,u[1]=f,c[0]=a.x+a.width,c[1]=f);var g=new F({anid:"minor_line_"+l[h][p].tickValue,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:c[0],y2:c[1]},style:d,silent:!0});Mo(g.shape,d.lineWidth),e.add(g)}},splitArea:function(t,e,n,i){lv(t,e,n,i)}},fv=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="xAxis",e}(hv),gv=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=fv.type,e}return Ue(e,t),e.type="yAxis",e}(hv),yv=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="grid",e}return Ue(e,t),e.prototype.render=function(t,e){this.group.removeAll(),t.get("show")&&this.group.add(new G({shape:t.coordinateSystem.getRect(),style:I({fill:t.get("backgroundColor")},t.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e}(Mu),mv={
  7419. // gridIndex: 0,
  7420. // gridId: '',
  7421. offset:0};function vv(t){t.registerComponentView(yv),t.registerComponentModel(_m),t.registerCoordinateSystem("cartesian2d",Ym),Tm(t,"x",bm,mv),Tm(t,"y",bm,mv),t.registerComponentView(fv),t.registerComponentView(gv),t.registerPreprocessor((function(t){
  7422. // Only create grid when need
  7423. t.xAxis&&t.yAxis&&!t.grid&&(t.grid={})}))}function xv(t){t.eachSeriesByType("radar",(function(t){var e=t.getData(),n=[],i=t.coordinateSystem;if(i){var o=i.getIndicatorAxes();a(o,(function(t,r){e.each(e.mapDimension(o[r].dim),(function(t,e){n[e]=n[e]||[];var o=i.dataToPoint(t,r);n[e][r]=_v(o)?o:bv(i)}))})),
  7424. // Close polygon
  7425. e.each((function(t){
  7426. // TODO
  7427. // Is it appropriate to connect to the next data when some data is missing?
  7428. // Or, should trade it like `connectNull` in line chart?
  7429. var o=Zt(n[t],(function(t){return _v(t)}))||bv(i);
  7430. // Copy the first actual point to the end of the array
  7431. n[t].push(o.slice()),e.setItemLayout(t,n[t])}))}}))}function _v(t){return!isNaN(t[0])&&!isNaN(t[1])}function bv(t){
  7432. // It is error-prone to input [NaN, NaN] into polygon, polygon.
  7433. // (probably cause problem when refreshing or animating)
  7434. return[t.cx,t.cy]}function Sv(t){var e=t.polar;if(e){i(e)||(e=[e]);var n=[];a(e,(function(e,o){e.indicator?(e.type&&!e.shape&&(e.shape=e.type),t.radar=t.radar||[],i(t.radar)||(t.radar=[t.radar]),t.radar.push(e)):n.push(e)})),t.polar=n}a(t.series,(function(t){t&&"radar"===t.type&&t.polarIndex&&(t.radarIndex=t.polarIndex)}))}var wv=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,i){var o=t.coordinateSystem,r=this.group,s=t.getData(),l=this._data;function u(t,e){var n=t.getItemVisual(e,"symbol")||"circle";if("none"!==n){var i=Fc(t.getItemVisual(e,"symbolSize")),o=Gc(n,-1,-1,2,2),r=t.getItemVisual(e,"symbolRotate")||0;return o.attr({style:{strokeNoScale:!0},z2:100,scaleX:i[0]/2,scaleY:i[1]/2,rotation:r*Math.PI/180||0}),o}}function c(e,n,i,o,r,a){
  7435. // Simply rerender all
  7436. i.removeAll();for(var s=0;s<n.length-1;s++){var l=u(o,r);l&&(l.__dimIdx=s,e[s]?(l.setPosition(e[s]),Go[a?"initProps":"updateProps"](l,{x:n[s][0],y:n[s][1]},t,r)):l.setPosition(n[s]),i.add(l))}}function d(t){return n(t,(function(t){return[o.cx,o.cy]}))}s.diff(l).add((function(e){var n=s.getItemLayout(e);if(n){var i=new z,o=new B,r={shape:{points:n}};i.shape.points=d(n),o.shape.points=d(n),oo(i,r,t,e),oo(o,r,t,e);var a=new Z,l=new Z;a.add(o),a.add(i),a.add(l),c(o.shape.points,n,l,s,e,!0),s.setItemGraphicEl(e,a)}})).update((function(e,n){var i=l.getItemGraphicEl(n),o=i.childAt(0),r=i.childAt(1),a=i.childAt(2),u={shape:{points:s.getItemLayout(e)}};u.shape.points&&(c(o.shape.points,u.shape.points,a,s,e,!1),uo(r),uo(o),io(o,u,t),io(r,u,t),s.setItemGraphicEl(e,i))})).remove((function(t){r.remove(l.getItemGraphicEl(t))})).execute(),s.eachItemGraphicEl((function(t,e){var n=s.getItemModel(e),i=t.childAt(0),o=t.childAt(1),l=t.childAt(2),u=s.getItemVisual(e,"style"),c=u.fill;r.add(t),i.useStyle(I(n.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:c})),qi(i,n,"lineStyle"),qi(o,n,"areaStyle");var d=n.getModel("areaStyle"),h=d.isEmpty()&&d.parentModel.isEmpty();o.ignore=h,a(["emphasis","select","blur"],(function(t){var e=n.getModel([t,"areaStyle"]),i=e.isEmpty()&&e.parentModel.isEmpty();
  7437. // Won't be ignore if normal state is not ignore.
  7438. o.ensureState(t).ignore=i&&h})),o.useStyle(I(d.getAreaStyle(),{fill:c,opacity:.7,decal:u.decal}));var f=n.getModel("emphasis"),g=f.getModel("itemStyle").getItemStyle();l.eachChild((function(t){if(t instanceof b){var i=t.style;t.useStyle(p({
  7439. // TODO other properties like x, y ?
  7440. image:i.image,x:i.x,y:i.y,width:i.width,height:i.height},u))}else t.useStyle(u),t.setColor(c),t.style.strokeNoScale=!0;t.ensureState("emphasis").style=et(g);var o=s.getStore().get(s.getDimensionIndex(t.__dimIdx),e);(null==o||isNaN(o))&&(o=""),Yo(t,Uo(n),{labelFetcher:s.hostModel,labelDataIndex:e,labelDimIndex:t.__dimIdx,defaultText:o,inheritColor:c,defaultOpacity:u.opacity})})),Ui(t,f.get("focus"),f.get("blurScope"),f.get("disabled"))})),this._data=s},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.type="radar",e}(Ou);const Mv=wv;var Iv=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}
  7441. // Overwrite
  7442. return Ue(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),
  7443. // Enable legend selection for each data item
  7444. // Use a function instead of direct access because data reference may changed
  7445. this.legendVisualProvider=new dm(lt(this.getData,this),lt(this.getRawData,this))},e.prototype.getInitialData=function(t,e){return um(this,{generateCoord:"indicator_",generateCoordCount:Infinity})},e.prototype.formatTooltip=function(t,e,i){var o=this.getData(),r=this.coordinateSystem.getIndicatorAxes(),a=this.getData().getName(t),s=""===a?this.name:a,l=su(this,t);return $l("section",{header:s,sortBlocks:!0,blocks:n(r,(function(e){var n=o.get(o.mapDimension(e.dim),t);return $l("nameValue",{markerType:"subItem",markerColor:l,name:e.name,value:n,sortParam:n})}))})},e.prototype.getTooltipPosition=function(t){if(null!=t)for(var e=this.getData(),i=this.coordinateSystem,o=e.getValues(n(i.dimensions,(function(t){return e.mapDimension(t)})),t),r=0,a=o.length;r<a;r++)if(!isNaN(o[r])){var s=i.getIndicatorAxes();return i.coordToPoint(s[r].dataToCoord(o[r]),r)}},e.type="series.radar",e.dependencies=["radar"],e.defaultOption={
  7446. // zlevel: 0,
  7447. z:2,colorBy:"data",coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid",join:"round"},label:{position:"top"},
  7448. // areaStyle: {
  7449. // },
  7450. // itemStyle: {}
  7451. symbolSize:8},e}(Su);const Dv=Iv;var Tv=Im.value;function Cv(t,e){return I({show:e},t)}var Av=/** @class */function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.type,t}return Ue(i,e),i.prototype.optionUpdated=function(){var e=this.get("boundaryGap"),i=this.get("splitNumber"),o=this.get("scale"),r=this.get("axisLine"),a=this.get("axisTick"),s=this.get("axisLabel"),l=this.get("axisName"),u=this.get(["axisName","show"]),c=this.get(["axisName","formatter"]),d=this.get("axisNameGap"),h=this.get("triggerEvent"),p=n(this.get("indicator")||[],(function(n){
  7452. // PENDING
  7453. null!=n.max&&n.max>0&&!n.min?n.min=0:null!=n.min&&n.min<0&&!n.max&&(n.max=0);var p=l;null!=n.color&&(p=I({color:n.color},l));
  7454. // Use same configuration
  7455. var g=tt(et(n),{boundaryGap:e,splitNumber:i,scale:o,axisLine:r,axisTick:a,
  7456. // axisType: axisType,
  7457. axisLabel:s,
  7458. // Compatible with 2 and use text
  7459. name:n.text,showName:u,nameLocation:"end",nameGap:d,
  7460. // min: 0,
  7461. nameTextStyle:p,triggerEvent:h},!1);if(t(c)){var y=g.name;g.name=c.replace("{value}",null!=y?y:"")}else f(c)&&(g.name=c(g.name,g));var m=new yr(g,null,this.ecModel);return nt(m,df.prototype),
  7462. // For triggerEvent.
  7463. m.mainType="radar",m.componentIndex=this.componentIndex,m}),this);this._indicatorModels=p},i.prototype.getIndicatorModels=function(){return this._indicatorModels},i.type="radar",i.defaultOption={
  7464. // zlevel: 0,
  7465. z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,
  7466. // Polygon or circle
  7467. shape:"polygon",axisLine:tt({lineStyle:{color:"#bbb"}},Tv.axisLine),axisLabel:Cv(Tv.axisLabel,!1),axisTick:Cv(Tv.axisTick,!1),
  7468. // axisType: 'value',
  7469. splitLine:Cv(Tv.splitLine,!0),splitArea:Cv(Tv.splitArea,!0),
  7470. // {text, min, max}
  7471. indicator:[]},i}(Ta);const Lv=Av;var kv=["axisLine","axisTickLabel","axisName"],Pv=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){this.group.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var e=t.coordinateSystem,i=e.getIndicatorAxes(),o=n(i,(function(t){var n=t.model.get("showName")?t.name:"";// hide name
  7472. return new $m(t.model,{axisName:n,position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}));a(o,(function(t){a(kv,t.add,t),this.group.add(t.getGroup())}),this)},e.prototype._buildSplitLineAndArea=function(t){var e=t.coordinateSystem,o=e.getIndicatorAxes();if(o.length){var r=t.get("shape"),s=t.getModel("splitLine"),l=t.getModel("splitArea"),u=s.getModel("lineStyle"),c=l.getModel("areaStyle"),d=s.get("show"),h=l.get("show"),p=u.get("color"),f=c.get("color"),g=i(p)?p:[p],y=i(f)?f:[f],m=[],v=[];if("circle"===r)for(var x=o[0].getTicksCoords(),_=e.cx,b=e.cy,S=0;S<x.length;S++){if(d)m[k(m,g,S)].push(new O({shape:{cx:_,cy:b,r:x[S].coord}}));if(h&&S<x.length-1)v[k(v,y,S)].push(new V({shape:{cx:_,cy:b,r0:x[S].coord,r:x[S+1].coord}}))}else{var w,M=n(o,(function(t,i){var o=t.getTicksCoords();return w=null==w?o.length-1:Math.min(o.length-1,w),n(o,(function(t){return e.coordToPoint(t.coord,i)}))})),D=[];for(S=0;S<=w;S++){for(var T=[],C=0;C<o.length;C++)T.push(M[C][S]);
  7473. // Close
  7474. if(T[0]&&T.push(T[0].slice()),d)m[k(m,g,S)].push(new B({shape:{points:T}}));if(h&&D)v[k(v,y,S-1)].push(new z({shape:{points:T.concat(D)}}));D=T.slice().reverse()}}var A=u.getLineStyle(),L=c.getAreaStyle();
  7475. // Add splitArea before splitLine
  7476. a(v,(function(t,e){this.group.add(So(t,{style:I({stroke:"none",fill:y[e%y.length]},L),silent:!0}))}),this),a(m,(function(t,e){this.group.add(So(t,{style:I({fill:"none",stroke:g[e%g.length]},A),silent:!0}))}),this)}function k(t,e,n){var i=n%e.length;return t[i]=t[i]||[],i}},e.type="radar",e}(Mu);const Nv=Pv;var Ov=/** @class */function(t){function e(e,n,i){var o=t.call(this,e,n,i)||this;return o.type="value",o.angle=0,o.name="",o}return Ue(e,t),e}(Yf);const Rv=Ov;var Ev=/** @class */function(){function e(t,e,i){
  7477. /**
  7478. *
  7479. * Radar dimensions
  7480. */
  7481. this.dimensions=[],this._model=t,this._indicatorAxes=n(t.getIndicatorModels(),(function(t,e){var n="indicator_"+e,i=new Rv(n,new yp);return i.name=t.get("name"),
  7482. // Inject model and axis
  7483. i.model=t,t.axis=i,this.dimensions.push(n),i}),this),this.resize(t,i)}return e.prototype.getIndicatorAxes=function(){return this._indicatorAxes},e.prototype.dataToPoint=function(t,e){var n=this._indicatorAxes[e];return this.coordToPoint(n.dataToCoord(t),e)},
  7484. // TODO: API should be coordToPoint([coord, indicatorIndex])
  7485. e.prototype.coordToPoint=function(t,e){var n=this._indicatorAxes[e].angle;return[this.cx+t*Math.cos(n),this.cy-t*Math.sin(n)]},e.prototype.pointToData=function(t){var e=t[0]-this.cx,n=t[1]-this.cy,i=Math.sqrt(e*e+n*n);e/=i,n/=i;for(var o,r=Math.atan2(-n,e),a=Infinity,s=-1,l=0
  7486. // Find the closest angle
  7487. // FIXME index can calculated directly
  7488. ;l<this._indicatorAxes.length;l++){var u=this._indicatorAxes[l],c=Math.abs(r-u.angle);c<a&&(o=u,s=l,a=c)}return[s,+(o&&o.coordToData(i))]},e.prototype.resize=function(e,n){var i=e.get("center"),o=n.getWidth(),r=n.getHeight(),s=Math.min(o,r)/2;this.cx=je(i[0],o),this.cy=je(i[1],r),this.startAngle=e.get("startAngle")*Math.PI/180;
  7489. // radius may be single value like `20`, `'80%'`, or array like `[10, '80%']`
  7490. var u=e.get("radius");(t(u)||l(u))&&(u=[0,u]),this.r0=je(u[0],s),this.r=je(u[1],s),a(this._indicatorAxes,(function(t,e){t.setExtent(this.r0,this.r);var n=this.startAngle+e*Math.PI*2/this._indicatorAxes.length;
  7491. // Normalize to [-PI, PI]
  7492. n=Math.atan2(Math.sin(n),Math.cos(n)),t.angle=n}),this)},e.prototype.update=function(t,e){var n=this._indicatorAxes,i=this._model;a(n,(function(t){t.scale.setExtent(Infinity,-Infinity)})),t.eachSeriesByType("radar",(function(e,o){if("radar"===e.get("coordinateSystem")&&t.getComponent("radar",e.get("radarIndex"))===i){var r=e.getData();a(n,(function(t){t.scale.unionExtentFromData(r,r.mapDimension(t.dim))}))}}),this);var o=i.get("splitNumber"),r=new yp;r.setExtent(0,o),r.setInterval(1),
  7493. // Force all the axis fixing the maxSplitNumber.
  7494. a(n,(function(t,e){Bm(t.scale,t.model,r)}))},e.prototype.convertToPixel=function(t,e,n){return null},e.prototype.convertFromPixel=function(t,e,n){return null},e.prototype.containPoint=function(t){return!1},e.create=function(t,n){var i=[];return t.eachComponent("radar",(function(o){var r=new e(o,t,n);i.push(r),o.coordinateSystem=r})),t.eachSeriesByType("radar",(function(t){"radar"===t.get("coordinateSystem")&&(
  7495. // Inject coordinate system
  7496. // @ts-ignore
  7497. t.coordinateSystem=i[t.get("radarIndex")||0])})),i},
  7498. /**
  7499. * Radar dimensions is based on the data
  7500. */
  7501. e.dimensions=[],e}();const Vv=Ev;function zv(t){t.registerCoordinateSystem("radar",Vv),t.registerComponentModel(Lv),t.registerComponentView(Nv),t.registerVisual({seriesType:"radar",reset:function(t){var e=t.getData();
  7502. // itemVisual symbol is for selected data
  7503. e.each((function(t){e.setItemVisual(t,"legendIcon","roundRect")})),
  7504. // visual is for unselected data
  7505. e.setVisual("legendIcon","roundRect")}})}var Bv="\0_ec_interaction_mutex";function Gv(t,e){return!!Fv(t)[e]}function Fv(t){return t[Bv]||(t[Bv]={})}
  7506. /**
  7507. * payload: {
  7508. * type: 'takeGlobalCursor',
  7509. * key: 'dataZoomSelect', or 'brush', or ...,
  7510. * If no userKey, release global cursor.
  7511. * }
  7512. */
  7513. // TODO: SELF REGISTERED.
  7514. function Wv(t,e,n,i,o){t.pointerChecker&&t.pointerChecker(i,o.originX,o.originY)&&(
  7515. // When mouse is out of roamController rect,
  7516. // default befavoius should not be be disabled, otherwise
  7517. // page sliding is disabled, contrary to expectation.
  7518. jt(i.event),Hv(t,e,n,i,o))}function Hv(t,e,n,i,o){
  7519. // Also provide behavior checker for event listener, for some case that
  7520. // multiple components share one listener.
  7521. o.isAvailableBehavior=lt(Yv,null,n,i),
  7522. // TODO should not have type issue.
  7523. t.trigger(e,o)}
  7524. // settings: {
  7525. // zoomOnMouseWheel
  7526. // moveOnMouseMove
  7527. // moveOnMouseWheel
  7528. // }
  7529. // The value can be: true / false / 'shift' / 'ctrl' / 'alt'.
  7530. function Yv(e,n,i){var o=i[e];return!e||o&&(!t(o)||n.event[o+"Key"])}eh({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},dt);const Uv=/** @class */function(t){function e(e){var n=t.call(this)||this;n._zr=e;
  7531. // Avoid two roamController bind the same handler
  7532. var i=lt(n._mousedownHandler,n),o=lt(n._mousemoveHandler,n),r=lt(n._mouseupHandler,n),a=lt(n._mousewheelHandler,n),s=lt(n._pinchHandler,n);
  7533. /**
  7534. * Notice: only enable needed types. For example, if 'zoom'
  7535. * is not needed, 'zoom' should not be enabled, otherwise
  7536. * default mousewheel behaviour (scroll page) will be disabled.
  7537. */
  7538. return n.enable=function(t,n){
  7539. // Disable previous first
  7540. this.disable(),this._opt=I(et(n)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,
  7541. // By default, wheel do not trigger move.
  7542. moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(e.on("mousedown",i),e.on("mousemove",o),e.on("mouseup",r)),!0!==t&&"scale"!==t&&"zoom"!==t||(e.on("mousewheel",a),e.on("pinch",s))},n.disable=function(){e.off("mousedown",i),e.off("mousemove",o),e.off("mouseup",r),e.off("mousewheel",a),e.off("pinch",s)},n}return Ue(e,t),e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(t){this.pointerChecker=t},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(t){if(!Xt(t)){for(var e=t.target;e;){if(e.draggable)return;
  7543. // check if host is draggable
  7544. e=e.__hostTarget||e.parent}var n=t.offsetX,i=t.offsetY;
  7545. // Only check on mosedown, but not mousemove.
  7546. // Mouse can be out of target when mouse moving.
  7547. this.pointerChecker&&this.pointerChecker(t,n,i)&&(this._x=n,this._y=i,this._dragging=!0)}},e.prototype._mousemoveHandler=function(t){if(this._dragging&&Yv("moveOnMouseMove",t,this._opt)&&"pinch"!==t.gestureEvent&&!Gv(this._zr,"globalPan")){var e=t.offsetX,n=t.offsetY,i=this._x,o=this._y,r=e-i,a=n-o;this._x=e,this._y=n,this._opt.preventDefaultMouseMove&&jt(t.event),Hv(this,"pan","moveOnMouseMove",t,{dx:r,dy:a,oldX:i,oldY:o,newX:e,newY:n,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(t){Xt(t)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(t){var e=Yv("zoomOnMouseWheel",t,this._opt),n=Yv("moveOnMouseWheel",t,this._opt),i=t.wheelDelta,o=Math.abs(i),r=t.offsetX,a=t.offsetY;
  7548. // wheelDelta maybe -0 in chrome mac.
  7549. if(0!==i&&(e||n)){
  7550. // If both `shouldZoom` and `shouldMove` is true, trigger
  7551. // their event both, and the final behavior is determined
  7552. // by event listener themselves.
  7553. if(e){
  7554. // Convenience:
  7555. // Mac and VM Windows on Mac: scroll up: zoom out.
  7556. // Windows: scroll up: zoom in.
  7557. // FIXME: Should do more test in different environment.
  7558. // wheelDelta is too complicated in difference nvironment
  7559. // (https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel),
  7560. // although it has been normallized by zrender.
  7561. // wheelDelta of mouse wheel is bigger than touch pad.
  7562. var s=o>3?1.4:o>1?1.2:1.1;Wv(this,"zoom","zoomOnMouseWheel",t,{scale:i>0?s:1/s,originX:r,originY:a,isAvailableBehavior:null})}if(n){
  7563. // FIXME: Should do more test in different environment.
  7564. var l=Math.abs(i);
  7565. // wheelDelta of mouse wheel is bigger than touch pad.
  7566. Wv(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:r,originY:a,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){Gv(this._zr,"globalPan")||Wv(this,"zoom",null,t,{scale:t.pinchScale>1?1.1:1/1.1,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})},e}(mt);
  7567. /*
  7568. * Licensed to the Apache Software Foundation (ASF) under one
  7569. * or more contributor license agreements. See the NOTICE file
  7570. * distributed with this work for additional information
  7571. * regarding copyright ownership. The ASF licenses this file
  7572. * to you under the Apache License, Version 2.0 (the
  7573. * "License"); you may not use this file except in compliance
  7574. * with the License. You may obtain a copy of the License at
  7575. *
  7576. * http://www.apache.org/licenses/LICENSE-2.0
  7577. *
  7578. * Unless required by applicable law or agreed to in writing,
  7579. * software distributed under the License is distributed on an
  7580. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  7581. * KIND, either express or implied. See the License for the
  7582. * specific language governing permissions and limitations
  7583. * under the License.
  7584. */
  7585. /**
  7586. * AUTO-GENERATED FILE. DO NOT MODIFY.
  7587. */
  7588. /*
  7589. * Licensed to the Apache Software Foundation (ASF) under one
  7590. * or more contributor license agreements. See the NOTICE file
  7591. * distributed with this work for additional information
  7592. * regarding copyright ownership. The ASF licenses this file
  7593. * to you under the Apache License, Version 2.0 (the
  7594. * "License"); you may not use this file except in compliance
  7595. * with the License. You may obtain a copy of the License at
  7596. *
  7597. * http://www.apache.org/licenses/LICENSE-2.0
  7598. *
  7599. * Unless required by applicable law or agreed to in writing,
  7600. * software distributed under the License is distributed on an
  7601. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  7602. * KIND, either express or implied. See the License for the
  7603. * specific language governing permissions and limitations
  7604. * under the License.
  7605. */
  7606. /**
  7607. * For geo and graph.
  7608. */function Zv(t,e,n){var i=t.target;i.x+=e,i.y+=n,i.dirty()}
  7609. /**
  7610. * For geo and graph.
  7611. */function Xv(t,e,n,i){var o=t.target,r=t.zoomLimit,a=t.zoom=t.zoom||1;if(a*=e,r){var s=r.min||0,l=r.max||Infinity;a=Math.max(Math.min(l,a),s)}var u=a/t.zoom;t.zoom=a,
  7612. // Keep the mouse center when scaling
  7613. o.x-=(n-o.x)*(u-1),o.y-=(i-o.y)*(u-1),o.scaleX*=u,o.scaleY*=u,o.dirty()}
  7614. /*
  7615. * Licensed to the Apache Software Foundation (ASF) under one
  7616. * or more contributor license agreements. See the NOTICE file
  7617. * distributed with this work for additional information
  7618. * regarding copyright ownership. The ASF licenses this file
  7619. * to you under the Apache License, Version 2.0 (the
  7620. * "License"); you may not use this file except in compliance
  7621. * with the License. You may obtain a copy of the License at
  7622. *
  7623. * http://www.apache.org/licenses/LICENSE-2.0
  7624. *
  7625. * Unless required by applicable law or agreed to in writing,
  7626. * software distributed under the License is distributed on an
  7627. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  7628. * KIND, either express or implied. See the License for the
  7629. * specific language governing permissions and limitations
  7630. * under the License.
  7631. */
  7632. /**
  7633. * AUTO-GENERATED FILE. DO NOT MODIFY.
  7634. */
  7635. /*
  7636. * Licensed to the Apache Software Foundation (ASF) under one
  7637. * or more contributor license agreements. See the NOTICE file
  7638. * distributed with this work for additional information
  7639. * regarding copyright ownership. The ASF licenses this file
  7640. * to you under the Apache License, Version 2.0 (the
  7641. * "License"); you may not use this file except in compliance
  7642. * with the License. You may obtain a copy of the License at
  7643. *
  7644. * http://www.apache.org/licenses/LICENSE-2.0
  7645. *
  7646. * Unless required by applicable law or agreed to in writing,
  7647. * software distributed under the License is distributed on an
  7648. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  7649. * KIND, either express or implied. See the License for the
  7650. * specific language governing permissions and limitations
  7651. * under the License.
  7652. */var jv={axisPointer:1,tooltip:1,brush:1};
  7653. /**
  7654. * Avoid that: mouse click on a elements that is over geo or graph,
  7655. * but roam is triggered.
  7656. */function qv(t,e,n){var i=e.getComponentByElement(t.topTarget),o=i&&i.coordinateSystem;
  7657. // If model is axisModel, it works only if it is injected with coordinateSystem.
  7658. return i&&i!==n&&!jv.hasOwnProperty(i.mainType)&&o&&o.model!==n}
  7659. /**
  7660. * "region available" means that: enable users to set attribute `name="xxx"` on those tags
  7661. * to make it be a region.
  7662. * 1. region styles and its label styles can be defined in echarts opton:
  7663. * ```js
  7664. * geo: {
  7665. * regions: [{
  7666. * name: 'xxx',
  7667. * itemStyle: { ... },
  7668. * label: { ... }
  7669. * }, {
  7670. * ...
  7671. * },
  7672. * ...]
  7673. * };
  7674. * ```
  7675. * 2. name can be duplicated in different SVG tag. All of the tags with the same name share
  7676. * a region option. For exampel if there are two <path> representing two lung lobes. They have
  7677. * no common parents but both of them need to display label "lung" inside.
  7678. */var Kv=r(["rect","circle","line","ellipse","polygon","polyline","path",
  7679. // <text> <tspan> are also enabled because some SVG might paint text itself,
  7680. // but still need to trigger events or tooltip.
  7681. "text","tspan",
  7682. // <g> is also enabled because this case: if multiple tags share one name
  7683. // and need label displayed, every tags will display the name, which is not
  7684. // expected. So we can put them into a <g name="xxx">. Thereby only one label
  7685. // displayed and located based on the bounding rect of the <g>.
  7686. "g"]),Jv=/** @class */function(){function t(t,e){this.type="geoSVG",
  7687. // All used graphics. key: hostKey, value: root
  7688. this._usedGraphicMap=r(),
  7689. // All unused graphics.
  7690. this._freedGraphics=[],this._mapName=t,
  7691. // Only perform parse to XML object here, which might be time
  7692. // consiming for large SVG.
  7693. // Although convert XML to zrender element is also time consiming,
  7694. // if we do it here, the clone of zrender elements has to be
  7695. // required. So we do it once for each geo instance, util real
  7696. // performance issues call for optimizing it.
  7697. this._parsedXML=qt(e)}return t.prototype.load=function(){
  7698. // In the "load" stage, graphic need to be built to
  7699. // get boundingRect for geo coordinate system.
  7700. var t=this._firstGraphic;
  7701. // Create the return data structure only when first graphic created.
  7702. // Because they will be used in geo coordinate system update stage,
  7703. // and `regions` will be mounted at `geo` coordinate system,
  7704. // in which there is no "view" info, so that it should better not to
  7705. // make references to graphic elements.
  7706. if(!t){t=this._firstGraphic=this._buildGraphic(this._parsedXML),this._freedGraphics.push(t),this._boundingRect=this._firstGraphic.boundingRect.clone();
  7707. // PENDING: `nameMap` will not be supported until some real requirement come.
  7708. // if (nameMap) {
  7709. // named = applyNameMap(named, nameMap);
  7710. // }
  7711. var e=function(t){var e=[],n=r();
  7712. // Create resions only for the first graphic.
  7713. return a(t,(function(t){
  7714. // Region has feature to calculate center for tooltip or other features.
  7715. // If there is a <g name="xxx">, the center should be the center of the
  7716. // bounding rect of the g.
  7717. if(null==t.namedFrom){var i=new Sf(t.name,t.el);
  7718. // PENDING: if `nameMap` supported, this region can not be mounted on
  7719. // `this`, but can only be created each time `load()` called.
  7720. e.push(i),
  7721. // PENDING: if multiple tag named with the same name, only one will be
  7722. // found by `_regionsMap`. `_regionsMap` is used to find a coordinate
  7723. // by name. We use `region.getCenter()` as the coordinate.
  7724. n.set(t.name,i)}})),{regions:e,regionsMap:n}}
  7725. // PENDING: `nameMap` will not be supported until some real requirement come.
  7726. // /**
  7727. // * Use the alias in geoNameMap.
  7728. // * The input `named` must not be modified.
  7729. // */
  7730. // function applyNameMap(
  7731. // named: GeoSVGGraphicRecord['named'],
  7732. // nameMap: NameMap
  7733. // ): GeoSVGGraphicRecord['named'] {
  7734. // const result = [] as GeoSVGGraphicRecord['named'];
  7735. // for (let i = 0; i < named.length; i++) {
  7736. // let regionGraphic = named[i];
  7737. // const name = regionGraphic.name;
  7738. // if (nameMap && nameMap.hasOwnProperty(name)) {
  7739. // regionGraphic = extend({}, regionGraphic);
  7740. // regionGraphic.name = name;
  7741. // }
  7742. // result.push(regionGraphic);
  7743. // }
  7744. // return result;
  7745. // }
  7746. (t.named),n=e.regions,i=e.regionsMap;this._regions=n,this._regionsMap=i}return{boundingRect:this._boundingRect,regions:this._regions,regionsMap:this._regionsMap}},t.prototype._buildGraphic=function(t){var e,n;try{n=(e=t&&Kt(t,{ignoreViewBox:!0,ignoreRootClip:!0})||{}).root,s(null!=n)}catch(m){throw new Error("Invalid svg format\n"+m.message)}
  7747. // Note: we keep the covenant that the root has no transform. So always add an extra root.
  7748. var i=new Z;i.add(n),i.isGeoSVGGraphicRoot=!0;
  7749. // [THE_RULE_OF_VIEWPORT_AND_VIEWBOX]
  7750. // Consider: `<svg width="..." height="..." viewBox="...">`
  7751. // - the `width/height` we call it `svgWidth/svgHeight` for short.
  7752. // - `(0, 0, svgWidth, svgHeight)` defines the viewport of the SVG, or say,
  7753. // "viewport boundingRect", or `boundingRect` for short.
  7754. // - `viewBox` defines the transform from the real content ot the viewport.
  7755. // `viewBox` has the same unit as the content of SVG.
  7756. // If `viewBox` exists, a transform is defined, so the unit of `svgWidth/svgHeight` become
  7757. // different from the content of SVG. Otherwise, they are the same.
  7758. // If both `svgWidth/svgHeight/viewBox` are specified in a SVG file, the transform rule will be:
  7759. // 0. `boundingRect` is `(0, 0, svgWidth, svgHeight)`. Set it to Geo['_rect'] (View['_rect']).
  7760. // 1. Make a transform from `viewBox` to `boundingRect`.
  7761. // Note: only support `preserveAspectRatio 'xMidYMid'` here. That is, this transform will preserve
  7762. // the aspect ratio.
  7763. // 2. Make a transform from boundingRect to Geo['_viewRect'] (View['_viewRect'])
  7764. // (`Geo`/`View` will do this job).
  7765. // Note: this transform might not preserve aspect radio, which depending on how users specify
  7766. // viewRect in echarts option (e.g., `geo.left/top/width/height` will not preserve aspect ratio,
  7767. // but `geo.layoutCenter/layoutSize` will preserve aspect ratio).
  7768. // If `svgWidth/svgHeight` not specified, we use `viewBox` as the `boundingRect` to make the SVG
  7769. // layout look good.
  7770. // If neither `svgWidth/svgHeight` nor `viewBox` are not specified, we calculate the boundingRect
  7771. // of the SVG content and use them to make SVG layout look good.
  7772. var o=e.width,r=e.height,l=e.viewBoxRect,u=this._boundingRect;if(!u){var c=void 0,d=void 0,h=void 0,p=void 0;
  7773. // If both viewBox and svgWidth/svgHeight not specified,
  7774. // we have to determine how to layout those element to make them look good.
  7775. if(null!=o?(c=0,h=o):l&&(c=l.x,h=l.width),null!=r?(d=0,p=r):l&&(d=l.y,p=l.height),null==c||null==d){var f=n.getBoundingRect();null==c&&(c=f.x,h=f.width),null==d&&(d=f.y,p=f.height)}u=this._boundingRect=new Y(c,d,h,p)}if(l){var g=Jt(l,u);
  7776. // Only support `preserveAspectRatio 'xMidYMid'`
  7777. n.scaleX=n.scaleY=g.scale,n.x=g.x,n.y=g.y}
  7778. // SVG needs to clip based on `viewBox`. And some SVG files really rely on this feature.
  7779. // They do not strictly confine all of the content inside a display rect, but deliberately
  7780. // use a `viewBox` to define a displayable rect.
  7781. // PENDING:
  7782. // The drawback of the `setClipPath` here is: the region label (genereted by echarts) near the
  7783. // edge might also be clipped, because region labels are put as `textContent` of the SVG path.
  7784. i.setClipPath(new G({shape:u.plain()}));var y=[];return a(e.named,(function(t){var e;null!=Kv.get(t.svgNodeTagLower)&&(y.push(t),
  7785. // Only named element has silent: false, other elements should
  7786. // act as background and has no user interaction.
  7787. (e=t.el).silent=!1,
  7788. // text|tspan will be converted to group.
  7789. e.isGroup&&e.traverse((function(t){t.silent=!1})))})),{root:i,boundingRect:u,named:y}},
  7790. /**
  7791. * Consider:
  7792. * (1) One graphic element can not be shared by different `geoView` running simultaneously.
  7793. * Notice, also need to consider multiple echarts instances share a `mapRecord`.
  7794. * (2) Converting SVG to graphic elements is time consuming.
  7795. * (3) In the current architecture, `load` should be called frequently to get boundingRect,
  7796. * and it is called without view info.
  7797. * So we maintain graphic elements in this module, and enables `view` to use/return these
  7798. * graphics from/to the pool with it's uid.
  7799. */
  7800. t.prototype.useGraphic=function(t/* , nameMap: NameMap */){var e=this._usedGraphicMap,n=e.get(t);return n||(n=this._freedGraphics.pop()||this._buildGraphic(this._parsedXML),e.set(t,n),n)},t.prototype.freeGraphic=function(t){var e=this._usedGraphicMap,n=e.get(t);n&&(e.removeKey(t),this._freedGraphics.push(n))},t}();for(var $v=[126,25],Qv="南海诸岛",tx=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],ex=0;ex<tx.length;ex++)for(var nx=0;nx<tx[ex].length;nx++)tx[ex][nx][0]/=10.5,tx[ex][nx][1]/=-14,tx[ex][nx][0]+=$v[0],tx[ex][nx][1]+=$v[1];
  7801. /*
  7802. * Licensed to the Apache Software Foundation (ASF) under one
  7803. * or more contributor license agreements. See the NOTICE file
  7804. * distributed with this work for additional information
  7805. * regarding copyright ownership. The ASF licenses this file
  7806. * to you under the Apache License, Version 2.0 (the
  7807. * "License"); you may not use this file except in compliance
  7808. * with the License. You may obtain a copy of the License at
  7809. *
  7810. * http://www.apache.org/licenses/LICENSE-2.0
  7811. *
  7812. * Unless required by applicable law or agreed to in writing,
  7813. * software distributed under the License is distributed on an
  7814. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  7815. * KIND, either express or implied. See the License for the
  7816. * specific language governing permissions and limitations
  7817. * under the License.
  7818. */
  7819. /**
  7820. * AUTO-GENERATED FILE. DO NOT MODIFY.
  7821. */
  7822. /*
  7823. * Licensed to the Apache Software Foundation (ASF) under one
  7824. * or more contributor license agreements. See the NOTICE file
  7825. * distributed with this work for additional information
  7826. * regarding copyright ownership. The ASF licenses this file
  7827. * to you under the Apache License, Version 2.0 (the
  7828. * "License"); you may not use this file except in compliance
  7829. * with the License. You may obtain a copy of the License at
  7830. *
  7831. * http://www.apache.org/licenses/LICENSE-2.0
  7832. *
  7833. * Unless required by applicable law or agreed to in writing,
  7834. * software distributed under the License is distributed on an
  7835. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  7836. * KIND, either express or implied. See the License for the
  7837. * specific language governing permissions and limitations
  7838. * under the License.
  7839. */
  7840. var ix={"南海诸岛":[32,80],
  7841. // 全国
  7842. "广东":[0,-10],"香港":[10,5],"澳门":[-10,10],
  7843. // '北京': [-10, 0],
  7844. "天津":[5,5]};
  7845. /*
  7846. * Licensed to the Apache Software Foundation (ASF) under one
  7847. * or more contributor license agreements. See the NOTICE file
  7848. * distributed with this work for additional information
  7849. * regarding copyright ownership. The ASF licenses this file
  7850. * to you under the Apache License, Version 2.0 (the
  7851. * "License"); you may not use this file except in compliance
  7852. * with the License. You may obtain a copy of the License at
  7853. *
  7854. * http://www.apache.org/licenses/LICENSE-2.0
  7855. *
  7856. * Unless required by applicable law or agreed to in writing,
  7857. * software distributed under the License is distributed on an
  7858. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  7859. * KIND, either express or implied. See the License for the
  7860. * specific language governing permissions and limitations
  7861. * under the License.
  7862. */
  7863. /**
  7864. * AUTO-GENERATED FILE. DO NOT MODIFY.
  7865. */
  7866. /*
  7867. * Licensed to the Apache Software Foundation (ASF) under one
  7868. * or more contributor license agreements. See the NOTICE file
  7869. * distributed with this work for additional information
  7870. * regarding copyright ownership. The ASF licenses this file
  7871. * to you under the Apache License, Version 2.0 (the
  7872. * "License"); you may not use this file except in compliance
  7873. * with the License. You may obtain a copy of the License at
  7874. *
  7875. * http://www.apache.org/licenses/LICENSE-2.0
  7876. *
  7877. * Unless required by applicable law or agreed to in writing,
  7878. * software distributed under the License is distributed on an
  7879. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  7880. * KIND, either express or implied. See the License for the
  7881. * specific language governing permissions and limitations
  7882. * under the License.
  7883. */
  7884. // Fix for 钓鱼岛
  7885. // let Region = require('../Region');
  7886. // let zrUtil = require('zrender/lib/core/util');
  7887. // let geoCoord = [126, 25];
  7888. var ox=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];var rx=/** @class */function(){function e(e,n,i){var o;this.type="geoJSON",this._parsedMap=r(),this._mapName=e,this._specialAreas=i,
  7889. // PENDING: delay the parse to the first usage to rapid up the FMP?
  7890. this._geoJSON=t(o=n)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(o):new Function("return ("+o+");")():o}
  7891. /**
  7892. * @param nameMap can be null/undefined
  7893. * @param nameProperty can be null/undefined
  7894. */return e.prototype.load=function(t,e){e=e||"name";var n=this._parsedMap.get(e);if(!n){var i=this._parseToRegions(e);n=this._parsedMap.set(e,{regions:i,boundingRect:ax(i)})}var o=r(),s=[];return a(n.regions,(function(e){var n=e.name;
  7895. // Try use the alias in geoNameMap
  7896. t&&N(t,n)&&(e=e.cloneShallow(n=t[n])),s.push(e),o.set(n,e)})),{regions:s,boundingRect:n.boundingRect||new Y(0,0,0,0),regionsMap:o}},e.prototype._parseToRegions=function(t){var e,i=this._mapName,o=this._geoJSON;
  7897. // https://jsperf.com/try-catch-performance-overhead
  7898. try{e=o?If(o,t):[]}catch(r){throw new Error("Invalid geoJson format\n"+r.message)}return function(t,e){if("china"===t){for(var i=0;i<e.length;i++)
  7899. // Already exists.
  7900. if(e[i].name===Qv)return;e.push(new bf(Qv,n(tx,(function(t){return{type:"polygon",exterior:t}})),$v))}}(i,e),a(e,(function(t){var e=t.name;!function(t,e){if("china"===t){var n=ix[e.name];if(n){var i=e.getCenter();i[0]+=n[0]/10.5,i[1]+=-n[1]/14,e.setCenter(i)}}}(i,t),function(t,e){"china"===t&&"台湾"===e.name&&e.geometries.push({type:"polygon",exterior:ox[0]})}(i,t);
  7901. // Some area like Alaska in USA map needs to be tansformed
  7902. // to look better
  7903. var n=this._specialAreas&&this._specialAreas[e];n&&t.transformTo(n.left,n.top,n.width,n.height)}),this),e},
  7904. /**
  7905. * Only for exporting to users.
  7906. * **MUST NOT** used internally.
  7907. */
  7908. e.prototype.getMapForUser=function(){return{
  7909. // For backward compatibility, use geoJson
  7910. // PENDING: it has been returning them without clone.
  7911. // do we need to avoid outsite modification?
  7912. geoJson:this._geoJSON,geoJSON:this._geoJSON,specialAreas:this._specialAreas}},e}();function ax(t){for(var e,n=0;n<t.length;n++){var i=t[n].getBoundingRect();(e=e||i.clone()).union(i)}return e}var sx=r();const lx=function(t,e,n){if(e.svg){var i=new Jv(t,e.svg);sx.set(t,i)}else{
  7913. // Recommend:
  7914. // echarts.registerMap('eu', { geoJSON: xxx, specialAreas: xxx });
  7915. // Backward compatibility:
  7916. // echarts.registerMap('eu', geoJSON, specialAreas);
  7917. // echarts.registerMap('eu', { geoJson: xxx, specialAreas: xxx });
  7918. var o=e.geoJson||e.geoJSON;o&&!e.features?n=e.specialAreas:o=e;i=new rx(t,o,n);sx.set(t,i)}},ux=function(t){return sx.get(t)},cx=function(t){var e=sx.get(t);
  7919. // Do not support return SVG until some real requirement come.
  7920. return e&&"geoJSON"===e.type&&e.getMapForUser()},dx=function(t,e,n){var i=sx.get(t);if(i)return i.load(e,n)};
  7921. /**
  7922. * Only these tags enable use `itemStyle` if they are named in SVG.
  7923. * Other tags like <text> <tspan> <image> might not suitable for `itemStyle`.
  7924. * They will not be considered to be styled until some requirements come.
  7925. */var hx=["rect","circle","line","ellipse","polygon","polyline","path"],px=r(hx),fx=r(hx.concat(["g"])),gx=r(hx.concat(["g"])),yx=On();function mx(t){var e=t.getItemStyle(),n=t.get("areaColor");
  7926. // If user want the color not to be changed when hover,
  7927. // they should both set areaColor and color to be null.
  7928. return null!=n&&(e.fill=n),e}
  7929. // Only stroke can be used for line.
  7930. // Using fill in style if stroke not exits.
  7931. // TODO Not sure yet. Perhaps a separate `lineStyle`?
  7932. function vx(t){var e=t.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var xx=/** @class */function(){function t(t){var e=new Z;this.uid=vr("ec_map_draw"),this._controller=new Uv(t.getZr()),this._controllerHost={target:e},this.group=e,e.add(this._regionsGroup=new Z),e.add(this._svgGroup=new Z)}return t.prototype.draw=function(t,e,n,i,o){var r="geo"===t.mainType,a=t.getData&&t.getData();
  7933. // Map series has data. GEO model that controlled by map series
  7934. // will be assigned with map data. Other GEO model has no data.
  7935. r&&e.eachComponent({mainType:"series",subType:"map"},(function(e){a||e.getHostGeoModel()!==t||(a=e.getData())}));var s=t.coordinateSystem,l=this._regionsGroup,u=this.group,c=s.getTransformInfo(),d=c.raw,h=c.roam;!l.childAt(0)||o?(u.x=h.x,u.y=h.y,u.scaleX=h.scaleX,u.scaleY=h.scaleY,u.dirty()):io(u,h,t);var p=a&&a.getVisual("visualMeta")&&a.getVisual("visualMeta").length>0,f={api:n,geo:s,mapOrGeoModel:t,data:a,isVisualEncodedByVisualMap:p,isGeo:r,transformInfoRaw:d};"geoJSON"===s.resourceType?this._buildGeoJSON(f):"geoSVG"===s.resourceType&&this._buildSVG(f),this._updateController(t,e,n),this._updateMapSelectHandler(t,l,n,i)},t.prototype._buildGeoJSON=function(t){var e=this._regionsGroupByName=r(),n=r(),i=this._regionsGroup,o=t.transformInfoRaw,s=t.mapOrGeoModel,l=t.data,u=t.geo.projection,c=u&&u.stream;function d(t,e){return e&&(
  7936. // projection may return null point.
  7937. t=e(t)),t&&[t[0]*o.scaleX+o.x,t[1]*o.scaleY+o.y]}function h(t){for(var e=[],n=!c&&u&&u.project,i=0
  7938. // If projectionStream is provided. Use it instead of single point project.
  7939. ;i<t.length;++i){var o=d(t[i],n);o&&e.push(o)}return e}function p(t){return{shape:{points:h(t)}}}i.removeAll(),
  7940. // Only when the resource is GeoJSON, there is `geo.regions`.
  7941. a(t.geo.regions,(function(o){var r=o.name,h=e.get(r),f=n.get(r)||{},g=f.dataIdx,y=f.regionModel;
  7942. // Consider in GeoJson properties.name may be duplicated, for example,
  7943. // there is multiple region named "United Kindom" or "France" (so many
  7944. // colonies). And it is not appropriate to merge them in geo, which
  7945. // will make them share the same label and bring trouble in label
  7946. // location calculation.
  7947. if(!h){h=e.set(r,new Z),i.add(h),g=l?l.indexOfName(r):null;var m=(y=t.isGeo?s.getRegionModel(r):l?l.getItemModel(g):null).get("silent",!0);null!=m&&(h.silent=m),n.set(r,{dataIdx:g,regionModel:y})}var v=[],x=[];a(o.geometries,(function(t){
  7948. // Polygon and MultiPolygon
  7949. if("polygon"===t.type){var e=[t.exterior].concat(t.interiors||[]);c&&(e=Ix(e,c)),a(e,(function(t){v.push(new z(p(t)))}))}
  7950. // LineString and MultiLineString
  7951. else{var n=t.points;c&&(n=Ix(n,c,!0)),a(n,(function(t){x.push(new B(p(t)))}))}}));var _=d(o.getCenter(),u&&u.project);function b(e,n){if(e.length){var i=new U({culling:!0,segmentIgnoreThreshold:1,shape:{paths:e}});h.add(i),_x(t,i,g,y),bx(t,i,r,y,s,g,_),n&&(vx(i),a(i.states,vx))}}b(v),b(x,!0)})),
  7952. // Ensure children have been added to `regionGroup` before calling them.
  7953. e.each((function(e,i){var o=n.get(i),r=o.dataIdx,a=o.regionModel;Sx(t,e,i,a,s,r),wx(t,e,i,a,s),Mx(t,e,i,a,s)}),this)},t.prototype._buildSVG=function(t){var e=t.geo.map,n=t.transformInfoRaw;this._svgGroup.x=n.x,this._svgGroup.y=n.y,this._svgGroup.scaleX=n.scaleX,this._svgGroup.scaleY=n.scaleY,this._svgResourceChanged(e)&&(this._freeSVG(),this._useSVG(e));var i=this._svgDispatcherMap=r(),o=!1;a(this._svgGraphicRecord.named,(function(e){
  7954. // Note that we also allow different elements have the same name.
  7955. // For example, a glyph of a city and the label of the city have
  7956. // the same name and their tooltip info can be defined in a single
  7957. // region option.
  7958. var n=e.name,r=t.mapOrGeoModel,a=t.data,s=e.svgNodeTagLower,l=e.el,u=a?a.indexOfName(n):null,c=r.getRegionModel(n);null!=px.get(s)&&l instanceof $t&&_x(t,l,u,c),l instanceof $t&&(l.culling=!0);var d=c.get("silent",!0);
  7959. // If self named:
  7960. (null!=d&&(l.silent=d),
  7961. // We do not know how the SVG like so we'd better not to change z2.
  7962. // Otherwise it might bring some unexpected result. For example,
  7963. // an area hovered that make some inner city can not be clicked.
  7964. l.z2EmphasisLift=0,e.namedFrom)||(
  7965. // label should batter to be displayed based on the center of <g>
  7966. // if it is named rather than displayed on each child.
  7967. null!=gx.get(s)&&bx(t,l,n,c,r,u,null),Sx(t,l,n,c,r,u),wx(t,l,n,c,r),null!=fx.get(s)&&("self"===Mx(t,l,n,c,r)&&(o=!0),(i.get(n)||i.set(n,[])).push(l)))}),this),this._enableBlurEntireSVG(o,t)},t.prototype._enableBlurEntireSVG=function(t,e){
  7968. // It's a little complicated to support blurring the entire geoSVG in series-map.
  7969. // So do not support it until some requirements come.
  7970. // At present, in series-map, only regions can be blurred.
  7971. if(t&&e.isGeo){var n=e.mapOrGeoModel.getModel(["blur","itemStyle"]).getItemStyle().opacity;
  7972. // Only support `opacity` here. Because not sure that other props are suitable for
  7973. // all of the elements generated by SVG (especially for Text/TSpan/Image/... ).
  7974. this._svgGraphicRecord.root.traverse((function(t){if(!t.isGroup){
  7975. // PENDING: clear those settings to SVG elements when `_freeSVG`.
  7976. // (Currently it happen not to be needed.)
  7977. Ci(t);var e=t.ensureState("blur").style||{};
  7978. // Do not overwrite the region style that already set from region option.
  7979. null==e.opacity&&null!=n&&(e.opacity=n),
  7980. // If `ensureState('blur').style = {}`, there will be default opacity.
  7981. // Enable `stateTransition` (animation).
  7982. t.ensureState("emphasis")}}))}},t.prototype.remove=function(){this._regionsGroup.removeAll(),this._regionsGroupByName=null,this._svgGroup.removeAll(),this._freeSVG(),this._controller.dispose(),this._controllerHost=null},t.prototype.findHighDownDispatchers=function(t,e){if(null==t)return[];var n=e.coordinateSystem;if("geoJSON"===n.resourceType){var i=this._regionsGroupByName;if(i){var o=i.get(t);return o?[o]:[]}}else if("geoSVG"===n.resourceType)return this._svgDispatcherMap&&this._svgDispatcherMap.get(t)||[]},t.prototype._svgResourceChanged=function(t){return this._svgMapName!==t},t.prototype._useSVG=function(t){var e=ux(t);if(e&&"geoSVG"===e.type){var n=e.useGraphic(this.uid);this._svgGroup.add(n.root),this._svgGraphicRecord=n,this._svgMapName=t}},t.prototype._freeSVG=function(){var t=this._svgMapName;if(null!=t){var e=ux(t);e&&"geoSVG"===e.type&&e.freeGraphic(this.uid),this._svgGraphicRecord=null,this._svgDispatcherMap=null,this._svgGroup.removeAll(),this._svgMapName=null}},t.prototype._updateController=function(t,e,n){var i=t.coordinateSystem,o=this._controller,r=this._controllerHost;
  7983. // @ts-ignore FIXME:TS
  7984. r.zoomLimit=t.get("scaleLimit"),r.zoom=i.getZoom(),
  7985. // roamType is will be set default true if it is null
  7986. // @ts-ignore FIXME:TS
  7987. o.enable(t.get("roam")||!1);var a=t.mainType;function s(){var e={type:"geoRoam",componentType:a};return e[a+"Id"]=t.id,e}o.off("pan").on("pan",(function(t){this._mouseDownFlag=!1,Zv(r,t.dx,t.dy),n.dispatchAction(p(s(),{dx:t.dx,dy:t.dy,animation:{duration:0}}))}),this),o.off("zoom").on("zoom",(function(t){this._mouseDownFlag=!1,Xv(r,t.scale,t.originX,t.originY),n.dispatchAction(p(s(),{totalZoom:r.zoom,zoom:t.scale,originX:t.originX,originY:t.originY,animation:{duration:0}}))}),this),o.setPointerChecker((function(e,o,r){return i.containPoint([o,r])&&!qv(e,n,t)}))},
  7988. /**
  7989. * FIXME: this is a temporarily workaround.
  7990. * When `geoRoam` the elements need to be reset in `MapView['render']`, because the props like
  7991. * `ignore` might have been modified by `LabelManager`, and `LabelManager#addLabelsOfSeries`
  7992. * will subsequently cache `defaultAttr` like `ignore`. If do not do this reset, the modified
  7993. * props will have no chance to be restored.
  7994. * Note: This reset should be after `clearStates` in `renderSeries` because `useStates` in
  7995. * `renderSeries` will cache the modified `ignore` to `el._normalState`.
  7996. * TODO:
  7997. * Use clone/immutable in `LabelManager`?
  7998. */
  7999. t.prototype.resetForLabelLayout=function(){this.group.traverse((function(t){var e=t.getTextContent();e&&(e.ignore=yx(e).ignore)}))},t.prototype._updateMapSelectHandler=function(t,e,n,i){var o=this;e.off("mousedown"),e.off("click"),
  8000. // @ts-ignore FIXME:TS resolve type conflict
  8001. t.get("selectedMode")&&(e.on("mousedown",(function(){o._mouseDownFlag=!0})),e.on("click",(function(t){o._mouseDownFlag&&(o._mouseDownFlag=!1)})))},t}();function _x(t,e,n,i){
  8002. // All of the path are using `itemStyle`, because
  8003. // (1) Some SVG also use fill on polyline (The different between
  8004. // polyline and polygon is "open" or "close" but not fill or not).
  8005. // (2) For the common props like opacity, if some use itemStyle
  8006. // and some use `lineStyle`, it might confuse users.
  8007. // (3) Most SVG use <path>, where can not detect whether to draw a "line"
  8008. // or a filled shape, so use `itemStyle` for <path>.
  8009. var o=i.getModel("itemStyle"),r=i.getModel(["emphasis","itemStyle"]),a=i.getModel(["blur","itemStyle"]),s=i.getModel(["select","itemStyle"]),l=mx(o),u=mx(r),c=mx(s),d=mx(a),h=t.data;if(h){
  8010. // Only visual color of each item will be used. It can be encoded by visualMap
  8011. // But visual color of series is used in symbol drawing
  8012. // Visual color for each series is for the symbol draw
  8013. var p=h.getItemVisual(n,"style"),f=h.getItemVisual(n,"decal");t.isVisualEncodedByVisualMap&&p.fill&&(l.fill=p.fill),f&&(l.decal=Zc(f,t.api))}
  8014. // SVG text, tspan and image can be named but not supporeted
  8015. // to be styled by region option yet.
  8016. e.setStyle(l),e.style.strokeNoScale=!0,e.ensureState("emphasis").style=u,e.ensureState("select").style=c,e.ensureState("blur").style=d,
  8017. // Enable blur
  8018. Ci(e)}function bx(t,e,n,i,o,
  8019. // Exist only if `viewBuildCtx.data` exists.
  8020. r,
  8021. // If labelXY not provided, use `textConfig.position: 'inside'`
  8022. a){var s=t.data,l=t.isGeo,u=s&&isNaN(s.get(s.mapDimension("value"),r)),c=s&&s.getItemLayout(r);
  8023. // In the following cases label will be drawn
  8024. // 1. In map series and data value is NaN
  8025. // 2. In geo component
  8026. // 3. Region has no series legendIcon, which will be add a showLabel flag in mapSymbolLayout
  8027. if(l||u||c&&c.showLabel){var d=l?n:r,h=void 0;
  8028. // Consider dataIdx not found.
  8029. (!s||r>=0)&&(h=o);var p=a?{normal:{align:"center",verticalAlign:"middle"}}:null;
  8030. // Caveat: must be called after `setDefaultStateProxy(el);` called.
  8031. // because textContent will be assign with `el.stateProxy` inside.
  8032. Yo(e,Uo(i),{labelFetcher:h,labelDataIndex:d,defaultText:n},p);var f=e.getTextContent();if(f&&(yx(f).ignore=f.ignore,e.textConfig&&a)){
  8033. // Compute a relative offset based on the el bounding rect.
  8034. var g=e.getBoundingRect().clone();
  8035. // Need to make sure the percent position base on the same rect in normal and
  8036. // emphasis state. Otherwise if using boundingRect of el, but the emphasis state
  8037. // has borderWidth (even 0.5px), the text position will be changed obviously
  8038. // if the position is very big like ['1234%', '1345%'].
  8039. e.textConfig.layoutRect=g,e.textConfig.position=[(a[0]-g.x)/g.width*100+"%",(a[1]-g.y)/g.height*100+"%"]}
  8040. // PENDING:
  8041. // If labelLayout is enabled (test/label-layout.html), el.dataIndex should be specified.
  8042. // But el.dataIndex is also used to determine whether user event should be triggered,
  8043. // where el.seriesIndex or el.dataModel must be specified. At present for a single el
  8044. // there is not case that "only label layout enabled but user event disabled", so here
  8045. // we depends `resetEventTriggerForRegion` to do the job of setting `el.dataIndex`.
  8046. e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function Sx(t,e,n,i,o,
  8047. // Exist only if `viewBuildCtx.data` exists.
  8048. r){
  8049. // setItemGraphicEl, setHoverStyle after all polygons and labels
  8050. // are added to the regionGroup
  8051. t.data?
  8052. // FIXME: when series-map use a SVG map, and there are duplicated name specified
  8053. // on different SVG elements, after `data.setItemGraphicEl(...)`:
  8054. // (1) all of them will be mounted with `dataIndex`, `seriesIndex`, so that tooltip
  8055. // can be triggered only mouse hover. That's correct.
  8056. // (2) only the last element will be kept in `data`, so that if trigger tooltip
  8057. // by `dispatchAction`, only the last one can be found and triggered. That might be
  8058. // not correct. We will fix it in future if anyone demanding that.
  8059. t.data.setItemGraphicEl(r,e):
  8060. // Package custom mouse event for geo component
  8061. ni(e).eventData={componentType:"geo",componentIndex:o.componentIndex,geoIndex:o.componentIndex,name:n,region:i&&i.option||{}}}function wx(t,e,n,i,o){t.data||Vo({el:e,componentModel:o,itemName:n,
  8062. // @ts-ignore FIXME:TS fix the "compatible with each other"?
  8063. itemTooltipOption:i.get("tooltip")})}function Mx(t,e,n,i,o){
  8064. // @ts-ignore FIXME:TS fix the "compatible with each other"?
  8065. e.highDownSilentOnTouch=!!o.get("selectedMode");
  8066. // @ts-ignore FIXME:TS fix the "compatible with each other"?
  8067. var r=i.getModel("emphasis"),a=r.get("focus");return Ui(e,a,r.get("blurScope"),r.get("disabled")),t.isGeo&&function(t,e,n){var i=ni(t);i.componentMainType=e.mainType,i.componentIndex=e.componentIndex,i.componentHighDownName=n}(e,o,n),a}function Ix(t,
  8068. // Polygons include exterior and interiors. Or polylines.
  8069. e,n){var i,o=[];function r(){i=[]}function s(){i.length&&(o.push(i),i=[])}var l=e({polygonStart:r,polygonEnd:s,lineStart:r,lineEnd:s,point:function(t,e){
  8070. // May have NaN values from stream.
  8071. isFinite(t)&&isFinite(e)&&i.push([t,e])},sphere:function(){}});return!n&&l.polygonStart(),a(t,(function(t){l.lineStart();for(var e=0;e<t.length;e++)l.point(t[e][0],t[e][1]);l.lineEnd()})),!n&&l.polygonEnd(),o}const Dx=xx;
  8072. // @ts-ignore FIXME:TS fix the "compatible with each other"?
  8073. var Tx=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n,i){
  8074. // Not render if it is an toggleSelect action from self
  8075. if(!i||"mapToggleSelect"!==i.type||i.from!==this.uid){var o=this.group;if(o.removeAll(),!t.getHostGeoModel()){
  8076. // Not update map if it is an roam action from self
  8077. if(this._mapDraw&&i&&"geoRoam"===i.type&&this._mapDraw.resetForLabelLayout(),i&&"geoRoam"===i.type&&"series"===i.componentType&&i.seriesId===t.id)(r=this._mapDraw)&&o.add(r.group);else if(t.needsDrawMap){var r=this._mapDraw||new Dx(n);o.add(r.group),r.draw(t,e,n,this,i),this._mapDraw=r}else
  8078. // Remove drawn map
  8079. this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&e.getComponent("legend")&&this._renderSymbols(t,e,n)}}},e.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},e.prototype._renderSymbols=function(t,e,n){var i=t.originalData,o=this.group;i.each(i.mapDimension("value"),(function(e,n){if(!isNaN(e)){var r=i.getItemLayout(n);if(r&&r.point){var a=r.point,s=r.offset,l=new O({style:{
  8080. // Because the special of map draw.
  8081. // Which needs statistic of multiple series and draw on one map.
  8082. // And each series also need a symbol with legend color
  8083. // Layout and visual are put one the different data
  8084. // TODO
  8085. fill:t.getData().getVisual("style").fill},shape:{cx:a[0]+9*s,cy:a[1],r:3},silent:!0,
  8086. // Do not overlap the first series, on which labels are displayed.
  8087. z2:8+(s?0:11)});
  8088. // Only the series that has the first value on the same region is in charge of rendering the label.
  8089. // But consider the case:
  8090. // series: [
  8091. // {id: 'X', type: 'map', map: 'm', {data: [{name: 'A', value: 11}, {name: 'B', {value: 22}]},
  8092. // {id: 'Y', type: 'map', map: 'm', {data: [{name: 'A', value: 21}, {name: 'C', {value: 33}]}
  8093. // ]
  8094. // The offset `0` of item `A` is at series `X`, but of item `C` is at series `Y`.
  8095. // For backward compatibility, we follow the rule that render label `A` by the
  8096. // settings on series `X` but render label `C` by the settings on series `Y`.
  8097. if(!s){var u=t.mainSeries.getData(),c=i.getName(n),d=u.indexOfName(c),h=i.getItemModel(n),p=h.getModel("label"),f=u.getItemGraphicEl(d);
  8098. // `getFormattedLabel` needs to use `getData` inside. Here
  8099. // `mapModel.getData()` is shallow cloned from `mainSeries.getData()`.
  8100. // FIXME
  8101. // If this is not the `mainSeries`, the item model (like label formatter)
  8102. // set on original data item will never get. But it has been working
  8103. // like that from the beginning, and this scenario is rarely encountered.
  8104. // So it won't be fixed until we have to.
  8105. Yo(l,Uo(h),{labelFetcher:{getFormattedLabel:function(e,n){return t.getFormattedLabel(d,n)}},defaultText:c}),l.disableLabelAnimation=!0,p.get("position")||l.setTextConfig({position:"bottom"}),f.onHoverStateChange=function(t){Di(l,t)}}o.add(l)}}}))},e.type="map",e}(Ou);const Cx=Tx;var Ax=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,
  8106. // Only first map series of same mapType will drawMap.
  8107. n.needsDrawMap=!1,
  8108. // Group of all map series with same mapType
  8109. n.seriesGroup=[],n.getTooltipPosition=function(t){if(null!=t){var e=this.getData().getName(t),n=this.coordinateSystem,i=n.getRegion(e);return i&&n.dataToPoint(i.getCenter())}},n}return Ue(e,t),e.prototype.getInitialData=function(t){for(var e=um(this,{coordDimensions:["value"],encodeDefaulter:rt(Ua,this)}),n=r(),i=[],o=0,s=e.count();o<s;o++){var l=e.getName(o);n.set(l,o)}var u=dx(this.getMapType(),this.option.nameMap,this.option.nameProperty);return a(u.regions,(function(t){var o,r=t.name,a=n.get(r),s=t.properties&&t.properties.echartsStyle;null==a?(o={name:r},i.push(o)):o=e.getRawDataItem(a),s&&tt(o,s)})),
  8110. // Complete data with missing regions. The consequent processes (like visual
  8111. // map and render) can not be performed without a "full data". For example,
  8112. // find `dataIndex` by name.
  8113. e.appendData(i),e},
  8114. /**
  8115. * If no host geo model, return null, which means using a
  8116. * inner exclusive geo model.
  8117. */
  8118. e.prototype.getHostGeoModel=function(){var t=this.option.geoIndex;return null!=t?this.ecModel.getComponent("geo",t):null},e.prototype.getMapType=function(){return(this.getHostGeoModel()||this).option.map},
  8119. // _fillOption(option, mapName) {
  8120. // Shallow clone
  8121. // option = zrUtil.extend({}, option);
  8122. // option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap);
  8123. // return option;
  8124. // }
  8125. e.prototype.getRawValue=function(t){
  8126. // Use value stored in data instead because it is calculated from multiple series
  8127. // FIXME Provide all value of multiple series ?
  8128. var e=this.getData();return e.get(e.mapDimension("value"),t)},
  8129. /**
  8130. * Get model of region
  8131. */
  8132. e.prototype.getRegionModel=function(t){var e=this.getData();return e.getItemModel(e.indexOfName(t))},
  8133. /**
  8134. * Map tooltip formatter
  8135. */
  8136. e.prototype.formatTooltip=function(t,e,n){for(
  8137. // FIXME orignalData and data is a bit confusing
  8138. var i=this.getData(),o=this.getRawValue(t),r=i.getName(t),a=this.seriesGroup,s=[],l=0;l<a.length;l++){var u=a[l].originalData.indexOfName(r),c=i.mapDimension("value");isNaN(a[l].originalData.get(c,u))||s.push(a[l].name)}return $l("section",{header:s.join(", "),noHeader:!s.length,blocks:[$l("nameValue",{name:r,value:o})]})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.getLegendIcon=function(t){var e=t.icon||"roundRect",n=Gc(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill);return n.setStyle(t.itemStyle),
  8139. // Map do not use itemStyle.borderWidth as border width
  8140. n.style.stroke="none",
  8141. // No rotation because no series visual symbol for map
  8142. e.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={
  8143. // 一级层叠
  8144. // zlevel: 0,
  8145. // 二级层叠
  8146. z:2,coordinateSystem:"geo",
  8147. // map should be explicitly specified since ec3.
  8148. map:"",
  8149. // If `geoIndex` is not specified, a exclusive geo will be
  8150. // created. Otherwise use the specified geo component, and
  8151. // `map` and `mapType` are ignored.
  8152. // geoIndex: 0,
  8153. // 'center' | 'left' | 'right' | 'x%' | {number}
  8154. left:"center",
  8155. // 'center' | 'top' | 'bottom' | 'x%' | {number}
  8156. top:"center",
  8157. // right
  8158. // bottom
  8159. // width:
  8160. // height
  8161. // Aspect is width / height. Inited to be geoJson bbox aspect
  8162. // This parameter is used for scale this aspect
  8163. // Default value:
  8164. // for geoSVG source: 1,
  8165. // for geoJSON source: 0.75.
  8166. aspectScale:null,
  8167. // Layout with center and size
  8168. // If you want to put map in a fixed size box with right aspect ratio
  8169. // This two properties may be more convenient.
  8170. // layoutCenter: [50%, 50%]
  8171. // layoutSize: 100
  8172. showLegendSymbol:!0,
  8173. // Define left-top, right-bottom coords to control view
  8174. // For example, [ [180, 90], [-180, -90] ],
  8175. // higher priority than center and zoom
  8176. boundingCoords:null,
  8177. // Default on center of map
  8178. center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},
  8179. // scaleLimit: null,
  8180. itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(Su);const Lx=Ax;
  8181. // FIXME 公用?
  8182. function kx(t){var e={};t.eachSeriesByType("map",(function(t){var n=t.getHostGeoModel(),i=n?"o"+n.id:"i"+t.getMapType();(e[i]=e[i]||[]).push(t)})),a(e,(function(t,e){for(var i,o,r,s=(i=n(t,(function(t){return t.getData()})),o=t[0].get("mapValueCalculation"),r={},a(i,(function(t){t.each(t.mapDimension("value"),(function(e,n){
  8183. // Add prefix to avoid conflict with Object.prototype.
  8184. var i="ec-"+t.getName(n);r[i]=r[i]||[],isNaN(e)||r[i].push(e)}))})),i[0].map(i[0].mapDimension("value"),(function(t,e){for(var n="ec-"+i[0].getName(e),a=0,s=Infinity,l=-Infinity,u=r[n].length,c=0;c<u;c++)s=Math.min(s,r[n][c]),l=Math.max(l,r[n][c]),a+=r[n][c];return 0===u?NaN:"min"===o?s:"max"===o?l:"average"===o?a/u:a}))),l=0;l<t.length;l++)t[l].originalData=t[l].getData();
  8185. // FIXME Put where?
  8186. for(l=0;l<t.length;l++)t[l].seriesGroup=t,t[l].needsDrawMap=0===l&&!t[l].getHostGeoModel(),t[l].setData(s.cloneShallow()),t[l].mainSeries=t[0]}))}function Px(t){var e={};t.eachSeriesByType("map",(function(n){var i=n.getMapType();if(!n.getHostGeoModel()&&!e[i]){var o={};a(n.seriesGroup,(function(e){var n=e.coordinateSystem,i=e.originalData;e.get("showLegendSymbol")&&t.getComponent("legend")&&i.each(i.mapDimension("value"),(function(t,e){var r=i.getName(e),a=n.getRegion(r);
  8187. // If input series.data is [11, 22, '-'/null/undefined, 44],
  8188. // it will be filled with NaN: [11, 22, NaN, 44] and NaN will
  8189. // not be drawn. So here must validate if value is NaN.
  8190. if(a&&!isNaN(t)){var s=o[r]||0,l=n.dataToPoint(a.getCenter());o[r]=s+1,i.setItemLayout(e,{point:l,offset:s})}}))}));
  8191. // Show label of those region not has legendIcon (which is offset 0)
  8192. var r=n.getData();r.each((function(t){var e=r.getName(t),n=r.getItemLayout(t)||{};n.showLabel=!o[e],r.setItemLayout(t,n)})),e[i]=!0}}))}var Nx=P,Ox=/** @class */function(t){function e(e){var n=t.call(this)||this;return n.type="view",n.dimensions=["x","y"],
  8193. /**
  8194. * Represents the transform brought by roam/zoom.
  8195. * If `View['_viewRect']` applies roam transform,
  8196. * we can get the final displayed rect.
  8197. */
  8198. n._roamTransformable=new L,
  8199. /**
  8200. * Represents the transform from `View['_rect']` to `View['_viewRect']`.
  8201. */
  8202. n._rawTransformable=new L,n.name=e,n}return Ue(e,t),e.prototype.setBoundingRect=function(t,e,n,i){return this._rect=new Y(t,e,n,i),this._rect},
  8203. /**
  8204. * @return {module:zrender/core/BoundingRect}
  8205. */
  8206. e.prototype.getBoundingRect=function(){return this._rect},e.prototype.setViewRect=function(t,e,n,i){this._transformTo(t,e,n,i),this._viewRect=new Y(t,e,n,i)},
  8207. /**
  8208. * Transformed to particular position and size
  8209. */
  8210. e.prototype._transformTo=function(t,e,n,i){var o=this.getBoundingRect(),r=this._rawTransformable;r.transform=o.calculateTransform(new Y(t,e,n,i));var a=r.parent;r.parent=null,r.decomposeTransform(),r.parent=a,this._updateTransform()},
  8211. /**
  8212. * Set center of view
  8213. */
  8214. e.prototype.setCenter=function(t,e){t&&(this._center=[je(t[0],e.getWidth()),je(t[1],e.getHeight())],this._updateCenterAndZoom())},e.prototype.setZoom=function(t){t=t||1;var e=this.zoomLimit;e&&(null!=e.max&&(t=Math.min(e.max,t)),null!=e.min&&(t=Math.max(e.min,t))),this._zoom=t,this._updateCenterAndZoom()},
  8215. /**
  8216. * Get default center without roam
  8217. */
  8218. e.prototype.getDefaultCenter=function(){
  8219. // Rect before any transform
  8220. var t=this.getBoundingRect();return[t.x+t.width/2,t.y+t.height/2]},e.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},e.prototype.getZoom=function(){return this._zoom||1},e.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},
  8221. /**
  8222. * Remove roam
  8223. */
  8224. e.prototype._updateCenterAndZoom=function(){
  8225. // Must update after view transform updated
  8226. var t=this._rawTransformable.getLocalTransform(),e=this._roamTransformable,n=this.getDefaultCenter(),i=this.getCenter(),o=this.getZoom();i=P([],i,t),n=P([],n,t),e.originX=i[0],e.originY=i[1],e.x=n[0]-i[0],e.y=n[1]-i[1],e.scaleX=e.scaleY=o,this._updateTransform()},
  8227. /**
  8228. * Update transform props on `this` based on the current
  8229. * `this._roamTransformable` and `this._rawTransformable`.
  8230. */
  8231. e.prototype._updateTransform=function(){var t=this._roamTransformable,e=this._rawTransformable;e.parent=t,t.updateTransform(),e.updateTransform(),Qt(this.transform||(this.transform=[]),e.transform||te()),this._rawTransform=e.getLocalTransform(),this.invTransform=this.invTransform||[],k(this.invTransform,this.transform),this.decomposeTransform()},e.prototype.getTransformInfo=function(){var t=this._rawTransformable,e=this._roamTransformable,n=new L;return n.transform=e.transform,n.decomposeTransform(),{roam:{x:n.x,y:n.y,scaleX:n.scaleX,scaleY:n.scaleY},raw:{x:t.x,y:t.y,scaleX:t.scaleX,scaleY:t.scaleY}}},e.prototype.getViewRect=function(){return this._viewRect},
  8232. /**
  8233. * Get view rect after roam transform
  8234. */
  8235. e.prototype.getViewRectAfterRoam=function(){var t=this.getBoundingRect().clone();return t.applyTransform(this.transform),t},
  8236. /**
  8237. * Convert a single (lon, lat) data item to (x, y) point.
  8238. */
  8239. e.prototype.dataToPoint=function(t,e,n){var i=e?this._rawTransform:this.transform;return n=n||[],i?Nx(n,t,i):ee(n,t)},
  8240. /**
  8241. * Convert a (x, y) point to (lon, lat) data
  8242. */
  8243. e.prototype.pointToData=function(t){var e=this.invTransform;return e?Nx([],t,e):[t[0],t[1]]},e.prototype.convertToPixel=function(t,e,n){var i=Rx(e);return i===this?i.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,e,n){var i=Rx(e);return i===this?i.pointToData(n):null},
  8244. /**
  8245. * @implements
  8246. */
  8247. e.prototype.containPoint=function(t){return this.getViewRectAfterRoam().contain(t[0],t[1])},e.dimensions=["x","y"],e}(L);function Rx(t){var e=t.seriesModel;return e?e.coordinateSystem:null;// e.g., graph.
  8248. }const Ex=Ox;var Vx={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},zx=["lng","lat"],Bx=/** @class */function(e){function n(t,n,i){var o=e.call(this,t)||this;o.dimensions=zx,o.type="geo",
  8249. // Only store specified name coord via `addGeoCoord`.
  8250. o._nameCoordMap=r(),o.map=n;var a=i.projection,s=dx(n,i.nameMap,i.nameProperty),l=ux(n);o.resourceType=l?l.type:null;var u,c=o.regions=s.regions,d=Vx[l.type];if(o._regionsMap=s.regionsMap,o.regions=s.regions,o.projection=a,a)
  8251. // Can't reuse the raw bounding rect
  8252. for(var h=0;h<c.length;h++){var p=c[h].getBoundingRect(a);(u=u||p.clone()).union(p)}else u=s.boundingRect;return o.setBoundingRect(u.x,u.y,u.width,u.height),
  8253. // aspectScale and invertLongitute actually is the parameters default raw projection.
  8254. // So we ignore them if projection is given.
  8255. // Ignore default aspect scale if projection exits.
  8256. o.aspectScale=a?1:x(i.aspectScale,d.aspectScale),
  8257. // Not invert longitude if projection exits.
  8258. o._invertLongitute=!a&&d.invertLongitute,o}return Ue(n,e),n.prototype._transformTo=function(t,e,n,i){var o=this.getBoundingRect(),r=this._invertLongitute;o=o.clone(),r&&(
  8259. // Longitude is inverted.
  8260. o.y=-o.y-o.height);var a=this._rawTransformable;a.transform=o.calculateTransform(new Y(t,e,n,i));var s=a.parent;a.parent=null,a.decomposeTransform(),a.parent=s,r&&(a.scaleY=-a.scaleY),this._updateTransform()},n.prototype.getRegion=function(t){return this._regionsMap.get(t)},n.prototype.getRegionByCoord=function(t){for(var e=this.regions,n=0;n<e.length;n++){var i=e[n];if("geoJSON"===i.type&&i.contain(t))return e[n]}},
  8261. /**
  8262. * Add geoCoord for indexing by name
  8263. */
  8264. n.prototype.addGeoCoord=function(t,e){this._nameCoordMap.set(t,e)},
  8265. /**
  8266. * Get geoCoord by name
  8267. */
  8268. n.prototype.getGeoCoord=function(t){var e=this._regionsMap.get(t);
  8269. // Calculate center only on demand.
  8270. return this._nameCoordMap.get(t)||e&&e.getCenter()},n.prototype.dataToPoint=function(e,n,i){if(t(e)&&(
  8271. // Map area name to geoCoord
  8272. e=this.getGeoCoord(e)),e){var o=this.projection;return o&&(
  8273. // projection may return null point.
  8274. e=o.project(e)),e&&this.projectedToPoint(e,n,i)}},n.prototype.pointToData=function(t){var e=this.projection;return e&&(
  8275. // projection may return null point.
  8276. t=e.unproject(t)),t&&this.pointToProjected(t)},
  8277. /**
  8278. * Point to projected data. Same with pointToData when projection is used.
  8279. */
  8280. n.prototype.pointToProjected=function(t){return e.prototype.pointToData.call(this,t)},n.prototype.projectedToPoint=function(t,n,i){return e.prototype.dataToPoint.call(this,t,n,i)},n.prototype.convertToPixel=function(t,e,n){var i=Gx(e);return i===this?i.dataToPoint(n):null},n.prototype.convertFromPixel=function(t,e,n){var i=Gx(e);return i===this?i.pointToData(n):null},n}(Ex);function Gx(t){var e=t.geoModel,n=t.seriesModel;return e?e.coordinateSystem:n?n.coordinateSystem||(n.getReferringComponents("geo",zn).models[0]||{}).coordinateSystem:null}nt(Bx,Ex);const Fx=Bx;
  8281. /**
  8282. * Resize method bound to the geo
  8283. */function Wx(t,e){var n=t.get("boundingCoords");if(null!=n){var i=n[0],o=n[1];if(isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])){
  8284. // Sample around the lng/lat rect and use projection to calculate actual bounding rect.
  8285. var r=this.projection;if(r){var a=i[0],s=i[1],l=o[0],u=o[1];i=[Infinity,Infinity],o=[-Infinity,-Infinity];
  8286. // TODO better way?
  8287. var c=function(t,e,n,a){for(var s=n-t,l=a-e,u=0;u<=100;u++){var c=u/100,d=r.project([t+s*c,e+l*c]);Tt(i,i,d),Ct(o,o,d)}};
  8288. // Top
  8289. c(a,s,l,s),
  8290. // Right
  8291. c(l,s,l,u),
  8292. // Bottom
  8293. c(l,u,a,u),
  8294. // Left
  8295. c(a,u,l,s)}this.setBoundingRect(i[0],i[1],o[0]-i[0],o[1]-i[1])}else;}var d,h,p,f=this.getBoundingRect(),g=t.get("layoutCenter"),y=t.get("layoutSize"),m=e.getWidth(),v=e.getHeight(),x=f.width/f.height*this.aspectScale,_=!1;if(g&&y&&(d=[je(g[0],m),je(g[1],v)],h=je(y,Math.min(m,v)),isNaN(d[0])||isNaN(d[1])||isNaN(h)||(_=!0)),_)p={},x>1?(
  8296. // Width is same with size
  8297. p.width=h,p.height=h/x):(p.height=h,p.width=h*x),p.y=d[1]-p.height/2,p.x=d[0]-p.width/2;else{
  8298. // Use left/top/width/height
  8299. var b=t.getBoxLayoutParams();b.aspect=x,p=xa(b,{width:m,height:v})}this.setViewRect(p.x,p.y,p.width,p.height),this.setCenter(t.get("center"),e),this.setZoom(t.get("zoom"))}
  8300. // Back compat for ECharts2, where the coord map is set on map series:
  8301. // {type: 'map', geoCoord: {'cityA': [116.46,39.92], 'cityA': [119.12,24.61]}},
  8302. var Hx=/** @class */function(){function t(){
  8303. // For deciding which dimensions to use when creating list data
  8304. this.dimensions=zx}return t.prototype.create=function(t,e){var i=[];function o(t){return{nameProperty:t.get("nameProperty"),aspectScale:t.get("aspectScale"),projection:t.get("projection")}}
  8305. // FIXME Create each time may be slow
  8306. t.eachComponent("geo",(function(t,n){var r=t.get("map"),a=new Fx(r+n,r,p({nameMap:t.get("nameMap")},o(t)));a.zoomLimit=t.get("scaleLimit"),i.push(a),
  8307. // setGeoCoords(geo, geoModel);
  8308. t.coordinateSystem=a,a.model=t,
  8309. // Inject resize method
  8310. a.resize=Wx,a.resize(t,e)})),t.eachSeries((function(t){if("geo"===t.get("coordinateSystem")){var e=t.get("geoIndex")||0;t.coordinateSystem=i[e]}}));
  8311. // If has map series
  8312. var r={};return t.eachSeriesByType("map",(function(t){if(!t.getHostGeoModel()){var e=t.getMapType();r[e]=r[e]||[],r[e].push(t)}})),a(r,(function(t,r){var s=n(t,(function(t){return t.get("nameMap")})),l=new Fx(r,r,p({nameMap:ne(s)},o(t[0])));l.zoomLimit=Yt.apply(null,n(t,(function(t){return t.get("scaleLimit")}))),i.push(l),
  8313. // Inject resize method
  8314. l.resize=Wx,l.resize(t[0],e),a(t,(function(t){t.coordinateSystem=l,function(t,e){a(e.get("geoCoord"),(function(e,n){t.addGeoCoord(n,e)}))}(l,t)}))})),i},
  8315. /**
  8316. * Fill given regions array
  8317. */
  8318. t.prototype.getFilledRegions=function(t,e,n,i){for(
  8319. // Not use the original
  8320. var o=(t||[]).slice(),s=r(),l=0;l<o.length;l++)s.set(o[l].name,o[l]);var u=dx(e,n,i);return a(u.regions,(function(t){var e=t.name,n=s.get(e),i=t.properties&&t.properties.echartsStyle;n||(n={name:e},o.push(n)),i&&tt(n,i)})),o},t}();const Yx=new Hx;var Ux=/** @class */function(n){function i(){var t=null!==n&&n.apply(this,arguments)||this;return t.type=i.type,t}return Ue(i,n),i.prototype.init=function(t,e,n){var i=ux(t.map);if(i&&"geoJSON"===i.type){var o=t.itemStyle=t.itemStyle||{};"color"in o||(o.color="#eee")}this.mergeDefaultAndTheme(t,n),
  8321. // Default label emphasis `show`
  8322. wn(t,"label",["show"])},i.prototype.optionUpdated=function(){var t=this,n=this.option;n.regions=Yx.getFilledRegions(n.regions,n.map,n.nameMap,n.nameProperty);var i={};this._optionModelMap=e(n.regions||[],(function(e,n){var o=n.name;return o&&(e.set(o,new yr(n,t,t.ecModel)),n.selected&&(i[o]=!0)),e}),r()),n.selectedMap||(n.selectedMap=i)},
  8323. /**
  8324. * Get model of region.
  8325. */
  8326. i.prototype.getRegionModel=function(t){return this._optionModelMap.get(t)||new yr(null,this,this.ecModel)},
  8327. /**
  8328. * Format label
  8329. * @param name Region name
  8330. */
  8331. i.prototype.getFormattedLabel=function(e,n){var i=this.getRegionModel(e),o="normal"===n?i.get(["label","formatter"]):i.get(["emphasis","label","formatter"]),r={name:e};return f(o)?(r.status=n,o(r)):t(o)?o.replace("{a}",null!=e?e:""):void 0},i.prototype.setZoom=function(t){this.option.zoom=t},i.prototype.setCenter=function(t){this.option.center=t},
  8332. // PENGING If selectedMode is null ?
  8333. i.prototype.select=function(t){var e=this.option,n=e.selectedMode;n&&("multiple"!==n&&(e.selectedMap=null),(e.selectedMap||(e.selectedMap={}))[t]=!0)},i.prototype.unSelect=function(t){var e=this.option.selectedMap;e&&(e[t]=!1)},i.prototype.toggleSelected=function(t){this[this.isSelected(t)?"unSelect":"select"](t)},i.prototype.isSelected=function(t){var e=this.option.selectedMap;return!(!e||!e[t])},i.type="geo",i.layoutMode="box",i.defaultOption={
  8334. // zlevel: 0,
  8335. z:0,show:!0,left:"center",top:"center",
  8336. // Default value:
  8337. // for geoSVG source: 1,
  8338. // for geoJSON source: 0.75.
  8339. aspectScale:null,
  8340. // /// Layout with center and size
  8341. // If you want to put map in a fixed size box with right aspect ratio
  8342. // This two properties may be more convenient
  8343. // layoutCenter: [50%, 50%]
  8344. // layoutSize: 100
  8345. silent:!1,
  8346. // Map type
  8347. map:"",
  8348. // Define left-top, right-bottom coords to control view
  8349. // For example, [ [180, 90], [-180, -90] ]
  8350. boundingCoords:null,
  8351. // Default on center of map
  8352. center:null,zoom:1,scaleLimit:null,
  8353. // selectedMode: false
  8354. label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},i}(Ta);const Zx=Ux;
  8355. /*
  8356. * Licensed to the Apache Software Foundation (ASF) under one
  8357. * or more contributor license agreements. See the NOTICE file
  8358. * distributed with this work for additional information
  8359. * regarding copyright ownership. The ASF licenses this file
  8360. * to you under the Apache License, Version 2.0 (the
  8361. * "License"); you may not use this file except in compliance
  8362. * with the License. You may obtain a copy of the License at
  8363. *
  8364. * http://www.apache.org/licenses/LICENSE-2.0
  8365. *
  8366. * Unless required by applicable law or agreed to in writing,
  8367. * software distributed under the License is distributed on an
  8368. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  8369. * KIND, either express or implied. See the License for the
  8370. * specific language governing permissions and limitations
  8371. * under the License.
  8372. */
  8373. /**
  8374. * AUTO-GENERATED FILE. DO NOT MODIFY.
  8375. */
  8376. /*
  8377. * Licensed to the Apache Software Foundation (ASF) under one
  8378. * or more contributor license agreements. See the NOTICE file
  8379. * distributed with this work for additional information
  8380. * regarding copyright ownership. The ASF licenses this file
  8381. * to you under the Apache License, Version 2.0 (the
  8382. * "License"); you may not use this file except in compliance
  8383. * with the License. You may obtain a copy of the License at
  8384. *
  8385. * http://www.apache.org/licenses/LICENSE-2.0
  8386. *
  8387. * Unless required by applicable law or agreed to in writing,
  8388. * software distributed under the License is distributed on an
  8389. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  8390. * KIND, either express or implied. See the License for the
  8391. * specific language governing permissions and limitations
  8392. * under the License.
  8393. */function Xx(t,e){
  8394. // Use projected coord as center because it's linear.
  8395. return t.pointToProjected?t.pointToProjected(e):t.pointToData(e)}function jx(t,e,n,i){var o=t.getZoom(),r=t.getCenter(),a=e.zoom,s=t.projectedToPoint?t.projectedToPoint(r):t.dataToPoint(r);if(null!=e.dx&&null!=e.dy&&(s[0]-=e.dx,s[1]-=e.dy,t.setCenter(Xx(t,s),i)),null!=a){if(n){var l=n.min||0,u=n.max||Infinity;a=Math.max(Math.min(o*a,u),l)/o}
  8396. // Zoom on given point(originX, originY)
  8397. t.scaleX*=a,t.scaleY*=a;var c=(e.originX-t.x)*(a-1),d=(e.originY-t.y)*(a-1);t.x-=c,t.y-=d,t.updateTransform(),
  8398. // Get the new center
  8399. t.setCenter(Xx(t,s),i),t.setZoom(a*o)}return{center:t.getCenter(),zoom:t.getZoom()}}const qx=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.focusBlurEnabled=!0,n}return Ue(e,t),e.prototype.init=function(t,e){this._api=e},e.prototype.render=function(t,e,n,i){if(this._model=t,!t.get("show"))return this._mapDraw&&this._mapDraw.remove(),void(this._mapDraw=null);this._mapDraw||(this._mapDraw=new Dx(n));var o=this._mapDraw;o.draw(t,e,n,this,i),o.group.on("click",this._handleRegionClick,this),o.group.silent=t.get("silent"),this.group.add(o.group),this.updateSelectStatus(t,e,n)},e.prototype._handleRegionClick=function(t){var e;kc(t.target,(function(t){return null!=(e=ni(t).eventData)}),!0),e&&this._api.dispatchAction({type:"geoToggleSelect",geoId:this._model.id,name:e.name})},e.prototype.updateSelectStatus=function(t,e,n){var i=this;this._mapDraw.group.traverse((function(t){var e=ni(t).eventData;if(e)
  8400. // No need to traverse children.
  8401. return i._model.isSelected(e.name)?n.enterSelect(t):n.leaveSelect(t),!0}))},e.prototype.findHighDownDispatchers=function(t){return this._mapDraw&&this._mapDraw.findHighDownDispatchers(t,this._model)},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove()},e.type="geo",e}(Mu);function Kx(t,e,n){lx(t,e,n)}function Jx(t){function e(e,n){n.update="geo:updateSelectStatus",t.registerAction(n,(function(t,n){var i={},o=[];return n.eachComponent({mainType:"geo",query:t},(function(n){n[e](t.name);var r=n.coordinateSystem;a(r.regions,(function(t){i[t.name]=n.isSelected(t.name)||!1}));
  8402. // Notice: there might be duplicated name in different regions.
  8403. var s=[];a(i,(function(t,e){i[e]&&s.push(e)})),o.push({geoIndex:n.componentIndex,
  8404. // Use singular, the same naming convention as the event `selectchanged`.
  8405. name:s})})),{selected:i,allSelected:o,name:t.name}}))}t.registerCoordinateSystem("geo",Yx),t.registerComponentModel(Zx),t.registerComponentView(qx),t.registerImpl("registerMap",Kx),t.registerImpl("getMap",(function(t){return cx(t)})),e("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),e("select",{type:"geoSelect",event:"geoselected"}),e("unSelect",{type:"geoUnSelect",event:"geounselected"}),
  8406. /**
  8407. * @payload
  8408. * @property {string} [componentType=series]
  8409. * @property {number} [dx]
  8410. * @property {number} [dy]
  8411. * @property {number} [zoom]
  8412. * @property {number} [originX]
  8413. * @property {number} [originY]
  8414. */
  8415. t.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},(function(t,e,n){var i=t.componentType||"series";e.eachComponent({mainType:i,query:t},(function(e){var o=e.coordinateSystem;if("geo"===o.type){var r=jx(o,t,e.get("scaleLimit"),n);e.setCenter&&e.setCenter(r.center),e.setZoom&&e.setZoom(r.zoom),
  8416. // All map series with same `map` use the same geo coordinate system
  8417. // So the center and zoom must be in sync. Include the series not selected by legend
  8418. "series"===i&&a(e.seriesGroup,(function(t){t.setCenter(r.center),t.setZoom(r.zoom)}))}}))}))}
  8419. /**
  8420. * The implementation of this function was originally copied from "d3.js"
  8421. * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
  8422. * with some modifications made for this program.
  8423. * See the license statement at the head of this file.
  8424. *
  8425. * Computes a preliminary x coordinate for node. Before that, this function is
  8426. * applied recursively to the children of node, as well as the function
  8427. * apportion(). After spacing out the children by calling executeShifts(), the
  8428. * node is placed to the midpoint of its outermost children.
  8429. */
  8430. function $x(t,e){var n=t.isExpand?t.children:[],i=t.parentNode.children,o=t.hierNode.i?i[t.hierNode.i-1]:null;if(n.length){!
  8431. /**
  8432. * All other shifts, applied to the smaller subtrees between w- and w+, are
  8433. * performed by this function.
  8434. *
  8435. * The implementation of this function was originally copied from "d3.js"
  8436. * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
  8437. * with some modifications made for this program.
  8438. * See the license statement at the head of this file.
  8439. */
  8440. function(t){var e=t.children,n=e.length,i=0,o=0;for(;--n>=0;){var r=e[n];r.hierNode.prelim+=i,r.hierNode.modifier+=i,o+=r.hierNode.change,i+=r.hierNode.shift+o}}
  8441. /**
  8442. * The implementation of this function was originally copied from "d3.js"
  8443. * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
  8444. * with some modifications made for this program.
  8445. * See the license statement at the head of this file.
  8446. *
  8447. * The core of the algorithm. Here, a new subtree is combined with the
  8448. * previous subtrees. Threads are used to traverse the inside and outside
  8449. * contours of the left and right subtree up to the highest common level.
  8450. * Whenever two nodes of the inside contours conflict, we compute the left
  8451. * one of the greatest uncommon ancestors using the function nextAncestor()
  8452. * and call moveSubtree() to shift the subtree and prepare the shifts of
  8453. * smaller subtrees. Finally, we add a new thread (if necessary).
  8454. */(t);var r=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;o?(t.hierNode.prelim=o.hierNode.prelim+e(t,o),t.hierNode.modifier=t.hierNode.prelim-r):t.hierNode.prelim=r}else o&&(t.hierNode.prelim=o.hierNode.prelim+e(t,o));t.parentNode.hierNode.defaultAncestor=function(t,e,n,i){if(e){for(var o=t,r=t,a=r.parentNode.children[0],s=e,l=o.hierNode.modifier,u=r.hierNode.modifier,c=a.hierNode.modifier,d=s.hierNode.modifier;s=n_(s),r=i_(r),s&&r;){o=n_(o),a=i_(a),o.hierNode.ancestor=t;var h=s.hierNode.prelim+d-r.hierNode.prelim-u+i(s,r);h>0&&(r_(o_(s,t,n),t,h),u+=h,l+=h),d+=s.hierNode.modifier,u+=r.hierNode.modifier,l+=o.hierNode.modifier,c+=a.hierNode.modifier}s&&!n_(o)&&(o.hierNode.thread=s,o.hierNode.modifier+=d-l),r&&!i_(a)&&(a.hierNode.thread=r,a.hierNode.modifier+=u-c,n=t)}return n}
  8455. /**
  8456. * This function is used to traverse the right contour of a subtree.
  8457. * It returns the rightmost child of node or the thread of node. The function
  8458. * returns null if and only if node is on the highest depth of its subtree.
  8459. */(t,o,t.parentNode.hierNode.defaultAncestor||i[0],e)}
  8460. /**
  8461. * The implementation of this function was originally copied from "d3.js"
  8462. * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
  8463. * with some modifications made for this program.
  8464. * See the license statement at the head of this file.
  8465. *
  8466. * Computes all real x-coordinates by summing up the modifiers recursively.
  8467. */function Qx(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function t_(t){return arguments.length?t:a_}
  8468. /**
  8469. * Transform the common coordinate to radial coordinate.
  8470. */function e_(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}
  8471. /**
  8472. * Get the layout position of the whole view.
  8473. */function n_(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}
  8474. /**
  8475. * This function is used to traverse the left contour of a subtree (or a subforest).
  8476. * It returns the leftmost child of node or the thread of node. The function
  8477. * returns null if and only if node is on the highest depth of its subtree.
  8478. */function i_(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}
  8479. /**
  8480. * If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor.
  8481. * Otherwise, returns the specified ancestor.
  8482. */function o_(t,e,n){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:n}
  8483. /**
  8484. * The implementation of this function was originally copied from "d3.js"
  8485. * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
  8486. * with some modifications made for this program.
  8487. * See the license statement at the head of this file.
  8488. *
  8489. * Shifts the current subtree rooted at wr.
  8490. * This is done by increasing prelim(w+) and modifier(w+) by shift.
  8491. */function r_(t,e,n){var i=n/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=i,e.hierNode.shift+=n,e.hierNode.modifier+=n,e.hierNode.prelim+=n,t.hierNode.change+=i}
  8492. /**
  8493. * The implementation of this function was originally copied from "d3.js"
  8494. * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
  8495. * with some modifications made for this program.
  8496. * See the license statement at the head of this file.
  8497. */function a_(t,e){return t.parentNode===e.parentNode?1:2}var s_=function(){this.parentPoint=[],this.childPoints=[]},l_=/** @class */function(t){function e(e){return t.call(this,e)||this}return Ue(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new s_},e.prototype.buildPath=function(t,e){var n=e.childPoints,i=n.length,o=e.parentPoint,r=n[0],a=n[i-1];if(1===i)return t.moveTo(o[0],o[1]),void t.lineTo(r[0],r[1]);var s=e.orient,l="TB"===s||"BT"===s?0:1,u=1-l,c=je(e.forkPosition,1),d=[];d[l]=o[l],d[u]=o[u]+(a[u]-o[u])*c,t.moveTo(o[0],o[1]),t.lineTo(d[0],d[1]),t.moveTo(r[0],r[1]),d[l]=r[l],t.lineTo(d[0],d[1]),d[l]=a[l],t.lineTo(d[0],d[1]),t.lineTo(a[0],a[1]);for(var h=1;h<i-1;h++){var p=n[h];t.moveTo(p[0],p[1]),d[l]=p[l],t.lineTo(d[0],d[1])}},e}(g),u_=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._mainGroup=new Z,n}return Ue(e,t),e.prototype.init=function(t,e){this._controller=new Uv(e.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},e.prototype.render=function(t,e,n){var i=t.getData(),o=t.layoutInfo,r=this._mainGroup;"radial"===t.get("layout")?(r.x=o.x+o.width/2,r.y=o.y+o.height/2):(r.x=o.x,r.y=o.y),this._updateViewCoordSys(t,n),this._updateController(t,e,n);var a=this._data;i.diff(a).add((function(e){c_(i,e)&&
  8498. // Create node and edge
  8499. d_(i,e,null,r,t)})).update((function(e,n){var o=a.getItemGraphicEl(n);c_(i,e)?
  8500. // Update node and edge
  8501. d_(i,e,o,r,t):o&&f_(a,n,o,r,t)})).remove((function(e){var n=a.getItemGraphicEl(e);
  8502. // When remove a collapsed node of subtree, since the collapsed
  8503. // node haven't been initialized with a symbol element,
  8504. // you can't found it's symbol element through index.
  8505. // so if we want to remove the symbol element we should insure
  8506. // that the symbol element is not null.
  8507. n&&f_(a,e,n,r,t)})).execute(),this._nodeScaleRatio=t.get("nodeScaleRatio"),this._updateNodeAndLinkScale(t),!0===t.get("expandAndCollapse")&&i.eachItemGraphicEl((function(e,i){e.off("click").on("click",(function(){n.dispatchAction({type:"treeExpandAndCollapse",seriesId:t.id,dataIndex:i})}))})),this._data=i},e.prototype._updateViewCoordSys=function(t,e){var n=t.getData(),i=[];n.each((function(t){var e=n.getItemLayout(t);!e||isNaN(e.x)||isNaN(e.y)||i.push([+e.x,+e.y])}));var o=[],r=[];ie(i,o,r);
  8508. // If don't Store min max when collapse the root node after roam,
  8509. // the root node will disappear.
  8510. var a=this._min,s=this._max;
  8511. // If width or height is 0
  8512. r[0]-o[0]==0&&(o[0]=a?a[0]:o[0]-1,r[0]=s?s[0]:r[0]+1),r[1]-o[1]==0&&(o[1]=a?a[1]:o[1]-1,r[1]=s?s[1]:r[1]+1);var l=t.coordinateSystem=new Ex;l.zoomLimit=t.get("scaleLimit"),l.setBoundingRect(o[0],o[1],r[0]-o[0],r[1]-o[1]),l.setCenter(t.get("center"),e),l.setZoom(t.get("zoom")),
  8513. // Here we use viewCoordSys just for computing the 'position' and 'scale' of the group
  8514. this.group.attr({x:l.x,y:l.y,scaleX:l.scaleX,scaleY:l.scaleY}),this._min=o,this._max=r},e.prototype._updateController=function(t,e,n){var i=this,o=this._controller,r=this._controllerHost,a=this.group;o.setPointerChecker((function(e,i,o){var r=a.getBoundingRect();return r.applyTransform(a.transform),r.contain(i,o)&&!qv(e,n,t)})),o.enable(t.get("roam")),r.zoomLimit=t.get("scaleLimit"),r.zoom=t.coordinateSystem.getZoom(),o.off("pan").off("zoom").on("pan",(function(e){Zv(r,e.dx,e.dy),n.dispatchAction({seriesId:t.id,type:"treeRoam",dx:e.dx,dy:e.dy})})).on("zoom",(function(e){Xv(r,e.scale,e.originX,e.originY),n.dispatchAction({seriesId:t.id,type:"treeRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),i._updateNodeAndLinkScale(t),
  8515. // Only update label layout on zoom
  8516. n.updateLabelLayout()}))},e.prototype._updateNodeAndLinkScale=function(t){var e=t.getData(),n=this._getNodeGlobalScale(t);e.eachItemGraphicEl((function(t,e){t.setSymbolScale(n)}))},e.prototype._getNodeGlobalScale=function(t){var e=t.coordinateSystem;if("view"!==e.type)return 1;var n=this._nodeScaleRatio,i=e.scaleX||1;return((e.getZoom()-1)*n+1)/i},e.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype.remove=function(){this._mainGroup.removeAll(),this._data=null},e.type="tree",e}(Ou);function c_(t,e){var n=t.getItemLayout(e);return n&&!isNaN(n.x)&&!isNaN(n.y)}function d_(t,e,n,i,o){var r=!n,a=t.tree.getNodeByDataIndex(e),s=a.getModel(),l=a.getVisual("style").fill,u=!1===a.isExpand&&0!==a.children.length?l:"#fff",c=t.tree.root,d=a.parentNode===c?a:a.parentNode||a,h=t.getItemGraphicEl(d.dataIndex),p=d.getLayout(),f=h?{x:h.__oldX,y:h.__oldY,rawX:h.__radialOldRawX,rawY:h.__radialOldRawY}:p,g=a.getLayout();r?((n=new Bg(t,e,null,{symbolInnerColor:u,useNameLabel:!0})).x=f.x,n.y=f.y):n.updateData(t,e,null,{symbolInnerColor:u,useNameLabel:!0}),n.__radialOldRawX=n.__radialRawX,n.__radialOldRawY=n.__radialRawY,n.__radialRawX=g.rawX,n.__radialRawY=g.rawY,i.add(n),t.setItemGraphicEl(e,n),n.__oldX=n.x,n.__oldY=n.y,io(n,{x:g.x,y:g.y},o);var y=n.getSymbolPath();if("radial"===o.get("layout")){var m=c.children[0],v=m.getLayout(),x=m.children.length,_=void 0,b=void 0;if(g.x===v.x&&!0===a.isExpand&&m.children.length){var S={x:(m.children[0].getLayout().x+m.children[x-1].getLayout().x)/2,y:(m.children[0].getLayout().y+m.children[x-1].getLayout().y)/2};(_=Math.atan2(S.y-v.y,S.x-v.x))<0&&(_=2*Math.PI+_),(b=S.x<v.x)&&(_-=Math.PI)}else(_=Math.atan2(g.y-v.y,g.x-v.x))<0&&(_=2*Math.PI+_),0===a.children.length||0!==a.children.length&&!1===a.isExpand?(b=g.x<v.x)&&(_-=Math.PI):(b=g.x>v.x)||(_-=Math.PI);var w=b?"left":"right",M=s.getModel("label"),D=M.get("rotate"),T=D*(Math.PI/180),C=y.getTextContent();C&&(y.setTextConfig({position:M.get("position")||w,rotation:null==D?-_:T,origin:"center"}),C.setStyle("verticalAlign","middle"))}
  8517. // Handle status
  8518. var A=s.get(["emphasis","focus"]),L="relative"===A?ct(a.getAncestorsIndices(),a.getDescendantIndices()):"ancestor"===A?a.getAncestorsIndices():"descendant"===A?a.getDescendantIndices():null;L&&(
  8519. // Modify the focus to data indices.
  8520. ni(n).focus=L),function(t,e,n,i,o,r,a,s){var l=e.getModel(),u=t.get("edgeShape"),c=t.get("layout"),d=t.getOrient(),h=t.get(["lineStyle","curveness"]),p=t.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=i.__edge;
  8521. // curve edge from node -> parent
  8522. // polyline edge from node -> children
  8523. if("curve"===u)e.parentNode&&e.parentNode!==n&&(g||(g=i.__edge=new W({shape:g_(c,d,h,o,o)})),io(g,{shape:g_(c,d,h,r,a)},t));else if("polyline"===u&&"orthogonal"===c&&e!==n&&e.children&&0!==e.children.length&&!0===e.isExpand){for(var y=e.children,m=[],v=0;v<y.length;v++){var x=y[v].getLayout();m.push([x.x,x.y])}g||(g=i.__edge=new l_({shape:{parentPoint:[a.x,a.y],childPoints:[[a.x,a.y]],orient:d,forkPosition:p}})),io(g,{shape:{parentPoint:[a.x,a.y],childPoints:m}},t)}
  8524. // show all edge when edgeShape is 'curve', filter node `isExpand` is false when edgeShape is 'polyline'
  8525. g&&("polyline"!==u||e.isExpand)&&(g.useStyle(I({strokeNoScale:!0,fill:null},f)),qi(g,l,"lineStyle"),Ci(g),s.add(g))}(o,a,c,n,f,p,g,i),n.__edge&&(n.onHoverStateChange=function(e){if("blur"!==e){
  8526. // NOTE: Ensure the parent elements will been blurred firstly.
  8527. // According to the return of getAncestorsIndices and getDescendantIndices
  8528. // TODO: A bit tricky.
  8529. var i=a.parentNode&&t.getItemGraphicEl(a.parentNode.dataIndex);i&&1===i.hoverState||Di(n.__edge,e)}})}function h_(t,e,n,i,o){var r=p_(e.tree.root,t),a=r.source,s=r.sourceLayout,l=e.getItemGraphicEl(t.dataIndex);if(l){var u=e.getItemGraphicEl(a.dataIndex).__edge,c=l.__edge||(!1===a.isExpand||1===a.children.length?u:void 0),d=i.get("edgeShape"),h=i.get("layout"),p=i.get("orient"),f=i.get(["lineStyle","curveness"]);c&&("curve"===d?ao(c,{shape:g_(h,p,f,s,s),style:{opacity:0}},i,{cb:function(){n.remove(c)},removeOpt:o}):"polyline"===d&&"orthogonal"===i.get("layout")&&ao(c,{shape:{parentPoint:[s.x,s.y],childPoints:[[s.x,s.y]]},style:{opacity:0}},i,{cb:function(){n.remove(c)},removeOpt:o}))}}function p_(t,e){for(var n,i=e.parentNode===t?e:e.parentNode||e;null==(n=i.getLayout());)i=i.parentNode===t?i:i.parentNode||i;return{source:i,sourceLayout:n}}function f_(t,e,n,i,o){var r=t.tree.getNodeByDataIndex(e),a=p_(t.tree.root,r).sourceLayout,s={duration:o.get("animationDurationUpdate"),easing:o.get("animationEasingUpdate")};ao(n,{x:a.x+1,y:a.y+1},o,{cb:function(){i.remove(n),t.setItemGraphicEl(e,null)},removeOpt:s}),n.fadeOut(null,t.hostModel,{fadeLabel:!0,animation:s}),
  8530. // remove edge as parent node
  8531. r.children.forEach((function(e){h_(e,t,i,o,s)})),
  8532. // remove edge as child node
  8533. h_(r,t,i,o,s)}function g_(t,e,n,i,o){var r,a,s,l,u,c,d,h;if("radial"===t){u=i.rawX,d=i.rawY,c=o.rawX,h=o.rawY;var p=e_(u,d),f=e_(u,d+(h-d)*n),g=e_(c,h+(d-h)*n),y=e_(c,h);return{x1:p.x||0,y1:p.y||0,x2:y.x||0,y2:y.y||0,cpx1:f.x||0,cpy1:f.y||0,cpx2:g.x||0,cpy2:g.y||0}}return u=i.x,d=i.y,c=o.x,h=o.y,"LR"!==e&&"RL"!==e||(r=u+(c-u)*n,a=d,s=c+(u-c)*n,l=h),"TB"!==e&&"BT"!==e||(r=u,a=d+(h-d)*n,s=c,l=h+(d-h)*n),{x1:u,y1:d,x2:c,y2:h,cpx1:r,cpy1:a,cpx2:s,cpy2:l}}const y_=u_;var m_=On();function v_(t){var e=t.mainData,n=t.datas;n||(n={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,M_(e,n,t),
  8534. // Porxy data original methods.
  8535. a(n,(function(n){a(e.TRANSFERABLE_METHODS,(function(e){n.wrapMethod(e,rt(x_,t))}))})),
  8536. // Beyond transfer, additional features should be added to `cloneShallow`.
  8537. e.wrapMethod("cloneShallow",rt(b_,t)),
  8538. // Only mainData trigger change, because struct.update may trigger
  8539. // another changable methods, which may bring about dead lock.
  8540. a(e.CHANGABLE_METHODS,(function(n){e.wrapMethod(n,rt(__,t))})),
  8541. // Make sure datas contains mainData.
  8542. s(n[e.dataType]===e)}function x_(t,e){if(m_(i=this).mainData===i){
  8543. // Transfer datas to new main data.
  8544. var n=p({},m_(this).datas);n[this.dataType]=e,M_(e,n,t)}else
  8545. // Modify the reference in main data to point newData.
  8546. I_(e,this.dataType,m_(this).mainData,t);var i;return e}function __(t,e){return t.struct&&t.struct.update(),e}function b_(t,e){
  8547. // cloneShallow, which brings about some fragilities, may be inappropriate
  8548. // to be exposed as an API. So for implementation simplicity we can make
  8549. // the restriction that cloneShallow of not-mainData should not be invoked
  8550. // outside, but only be invoked here.
  8551. return a(m_(e).datas,(function(n,i){n!==e&&I_(n.cloneShallow(),i,e,t)})),e}
  8552. /**
  8553. * Supplement method to List.
  8554. *
  8555. * @public
  8556. * @param [dataType] If not specified, return mainData.
  8557. */function S_(t){var e=m_(this).mainData;return null==t||null==e?e:m_(e).datas[t]}
  8558. /**
  8559. * Get list of all linked data
  8560. */function w_(){var t=m_(this).mainData;return null==t?[{data:t}]:n(v(m_(t).datas),(function(e){return{type:e,data:m_(t).datas[e]}}))}function M_(t,e,n){m_(t).datas={},a(e,(function(e,i){I_(e,i,t,n)}))}function I_(t,e,n,i){m_(n).datas[e]=t,m_(t).mainData=n,t.dataType=e,i.struct&&(t[i.structAttr]=i.struct,i.struct[i.datasAttr[e]]=t),
  8561. // Supplement method.
  8562. t.getLinkedData=S_,t.getLinkedDataAll=w_}var D_=/** @class */function(){function e(t,e){this.depth=0,this.height=0,
  8563. /**
  8564. * Reference to list item.
  8565. * Do not persistent dataIndex outside,
  8566. * besause it may be changed by list.
  8567. * If dataIndex -1,
  8568. * this node is logical deleted (filtered) in list.
  8569. */
  8570. this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=t||"",this.hostTree=e}
  8571. /**
  8572. * The node is removed.
  8573. */return e.prototype.isRemoved=function(){return this.dataIndex<0},e.prototype.eachNode=function(e,n,i){f(e)&&(i=n,n=e,e=null),t(e=e||{})&&(e={order:e});var o,r=e.order||"preorder",a=this[e.attr||"children"];"preorder"===r&&(o=n.call(i,this));for(var s=0;!o&&s<a.length;s++)a[s].eachNode(e,n,i);"postorder"===r&&n.call(i,this)},
  8574. /**
  8575. * Update depth and height of this subtree.
  8576. */
  8577. e.prototype.updateDepthAndHeight=function(t){var e=0;this.depth=t;for(var n=0;n<this.children.length;n++){var i=this.children[n];i.updateDepthAndHeight(t+1),i.height>e&&(e=i.height)}this.height=e+1},e.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var e=0,n=this.children,i=n.length;e<i;e++){var o=n[e].getNodeById(t);if(o)return o}},e.prototype.contains=function(t){if(t===this)return!0;for(var e=0,n=this.children,i=n.length;e<i;e++){var o=n[e].contains(t);if(o)return o}},
  8578. /**
  8579. * @param includeSelf Default false.
  8580. * @return order: [root, child, grandchild, ...]
  8581. */
  8582. e.prototype.getAncestors=function(t){for(var e=[],n=t?this:this.parentNode;n;)e.push(n),n=n.parentNode;return e.reverse(),e},e.prototype.getAncestorsIndices=function(){for(var t=[],e=this;e;)t.push(e.dataIndex),e=e.parentNode;return t.reverse(),t},e.prototype.getDescendantIndices=function(){var t=[];return this.eachNode((function(e){t.push(e.dataIndex)})),t},e.prototype.getValue=function(t){var e=this.hostTree.data;return e.getStore().get(e.getDimensionIndex(t||"value"),this.dataIndex)},e.prototype.setLayout=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},
  8583. /**
  8584. * @return {Object} layout
  8585. */
  8586. e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},
  8587. // @depcrecated
  8588. // getModel<T = unknown, S extends keyof T = keyof T>(path: S): Model<T[S]>
  8589. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  8590. e.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(t)},
  8591. // TODO: TYPE More specific model
  8592. e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},
  8593. /**
  8594. * Get item visual
  8595. * FIXME: make return type better
  8596. */
  8597. e.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},
  8598. /**
  8599. * index in parent's children
  8600. */
  8601. e.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,e=0;e<t.length;++e)if(t[e]===this)return e;return-1}return-1},
  8602. /**
  8603. * if this is an ancestor of another node
  8604. *
  8605. * @param node another node
  8606. * @return if is ancestor
  8607. */
  8608. e.prototype.isAncestorOf=function(t){for(var e=t.parentNode;e;){if(e===this)return!0;e=e.parentNode}return!1},
  8609. /**
  8610. * if this is an descendant of another node
  8611. *
  8612. * @param node another node
  8613. * @return if is descendant
  8614. */
  8615. e.prototype.isDescendantOf=function(t){return t!==this&&t.isAncestorOf(this)},e}(),T_=/** @class */function(){function t(t){this.type="tree",this._nodes=[],this.hostModel=t}return t.prototype.eachNode=function(t,e,n){this.root.eachNode(t,e,n)},t.prototype.getNodeByDataIndex=function(t){var e=this.data.getRawIndex(t);return this._nodes[e]},t.prototype.getNodeById=function(t){return this.root.getNodeById(t)},
  8616. /**
  8617. * Update item available by list,
  8618. * when list has been performed options like 'filterSelf' or 'map'.
  8619. */
  8620. t.prototype.update=function(){for(var t=this.data,e=this._nodes,n=0,i=e.length;n<i;n++)e[n].dataIndex=-1;for(n=0,i=t.count();n<i;n++)e[t.getRawIndex(n)].dataIndex=n},
  8621. /**
  8622. * Clear all layouts
  8623. */
  8624. t.prototype.clearLayouts=function(){this.data.clearItemLayouts()},
  8625. /**
  8626. * data node format:
  8627. * {
  8628. * name: ...
  8629. * value: ...
  8630. * children: [
  8631. * {
  8632. * name: ...
  8633. * value: ...
  8634. * children: ...
  8635. * },
  8636. * ...
  8637. * ]
  8638. * }
  8639. */
  8640. t.createTree=function(e,n,o){var r=new t(n),a=[],s=1;!function t(e,n){var o=e.value;s=Math.max(s,i(o)?o.length:1),a.push(e);var l=new D_(Ln(e.name,""),r);n?
  8641. /**
  8642. * It is needed to consider the mess of 'list', 'hostModel' when creating a TreeNote,
  8643. * so this function is not ready and not necessary to be public.
  8644. */
  8645. function(t,e){var n=e.children;if(t.parentNode===e)return;n.push(t),t.parentNode=e}(l,n):r.root=l,r._nodes.push(l);var u=e.children;if(u)for(var c=0;c<u.length;c++)t(u[c],l)}(e),r.root.updateDepthAndHeight(0);var l=Hh(a,{coordDimensions:["value"],dimensionsCount:s}).dimensions,u=new Fh(l,n);return u.initData(a),o&&o(u),v_({mainData:u,struct:r,structAttr:"tree"}),r.update(),r},t}();const C_=T_;function A_(e,n,i){if(e&&c(n,e.type)>=0){var o=i.getData().tree.root,r=e.targetNode;if(t(r)&&(r=o.getNodeById(r)),r&&o.contains(r))return{node:r};var a=e.targetNodeId;if(null!=a&&(r=o.getNodeById(a)))return{node:r}}}
  8646. // Not includes the given node at the last item.
  8647. function L_(t){for(var e=[];t;)(t=t.parentNode)&&e.push(t);return e.reverse()}function k_(t,e){var n=L_(t);return c(n,e)>=0}
  8648. // From root to the input node (the input node will be included).
  8649. function P_(t,e){for(var n=[];t;){var i=t.dataIndex;n.push({name:t.name,dataIndex:i,value:e.getRawValue(i)}),t=t.parentNode}return n.reverse(),n}var N_=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasSymbolVisual=!0,
  8650. // Do it self.
  8651. e.ignoreStyleOnData=!0,e}
  8652. /**
  8653. * Init a tree data structure from data in option series
  8654. */return Ue(e,t),e.prototype.getInitialData=function(t){
  8655. // create a virtual root
  8656. var e={name:t.name,children:t.data},n=t.leaves||{},i=new yr(n,this,this.ecModel),o=C_.createTree(e,this,(function(t){t.wrapMethod("getItemModel",(function(t,e){var n=o.getNodeByDataIndex(e);return n&&n.children.length&&n.isExpand||(t.parentModel=i),t}))}));var r=0;o.eachNode("preorder",(function(t){t.depth>r&&(r=t.depth)}));var a=t.expandAndCollapse&&t.initialTreeDepth>=0?t.initialTreeDepth:r;return o.root.eachNode("preorder",(function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);
  8657. // Add item.collapsed != null, because users can collapse node original in the series.data.
  8658. t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=a})),o.data},
  8659. /**
  8660. * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'.
  8661. * @returns {string} orient
  8662. */
  8663. e.prototype.getOrient=function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,e,n){for(var i=this.getData().tree,o=i.root.children[0],r=i.getNodeByDataIndex(t),a=r.getValue(),s=r.name;r&&r!==o;)s=r.parentNode.name+"."+s,r=r.parentNode;return $l("nameValue",{name:s,value:a,noValue:isNaN(a)||null==a})},
  8664. // Add tree path to tooltip param
  8665. e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=P_(i,this),n.collapsed=!i.isExpand,n},e.type="series.tree",
  8666. // can support the position parameters 'left', 'top','right','bottom', 'width',
  8667. // 'height' in the setOption() with 'merge' mode normal.
  8668. e.layoutMode="box",e.defaultOption={
  8669. // zlevel: 0,
  8670. z:2,coordinateSystem:"view",
  8671. // the position of the whole view
  8672. left:"12%",top:"12%",right:"12%",bottom:"12%",
  8673. // the layout of the tree, two value can be selected, 'orthogonal' or 'radial'
  8674. layout:"orthogonal",
  8675. // value can be 'polyline'
  8676. edgeShape:"curve",edgeForkPosition:"50%",
  8677. // true | false | 'move' | 'scale', see module:component/helper/RoamController.
  8678. roam:!1,
  8679. // Symbol size scale ratio in roam
  8680. nodeScaleRatio:.4,
  8681. // Default on center of graph
  8682. center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",
  8683. // borderColor: '#c23531',
  8684. borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(Su);const O_=N_;
  8685. /*
  8686. * Licensed to the Apache Software Foundation (ASF) under one
  8687. * or more contributor license agreements. See the NOTICE file
  8688. * distributed with this work for additional information
  8689. * regarding copyright ownership. The ASF licenses this file
  8690. * to you under the Apache License, Version 2.0 (the
  8691. * "License"); you may not use this file except in compliance
  8692. * with the License. You may obtain a copy of the License at
  8693. *
  8694. * http://www.apache.org/licenses/LICENSE-2.0
  8695. *
  8696. * Unless required by applicable law or agreed to in writing,
  8697. * software distributed under the License is distributed on an
  8698. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  8699. * KIND, either express or implied. See the License for the
  8700. * specific language governing permissions and limitations
  8701. * under the License.
  8702. */
  8703. /**
  8704. * AUTO-GENERATED FILE. DO NOT MODIFY.
  8705. */
  8706. /*
  8707. * Licensed to the Apache Software Foundation (ASF) under one
  8708. * or more contributor license agreements. See the NOTICE file
  8709. * distributed with this work for additional information
  8710. * regarding copyright ownership. The ASF licenses this file
  8711. * to you under the Apache License, Version 2.0 (the
  8712. * "License"); you may not use this file except in compliance
  8713. * with the License. You may obtain a copy of the License at
  8714. *
  8715. * http://www.apache.org/licenses/LICENSE-2.0
  8716. *
  8717. * Unless required by applicable law or agreed to in writing,
  8718. * software distributed under the License is distributed on an
  8719. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  8720. * KIND, either express or implied. See the License for the
  8721. * specific language governing permissions and limitations
  8722. * under the License.
  8723. */
  8724. /**
  8725. * Traverse the tree from bottom to top and do something
  8726. */
  8727. /**
  8728. * Traverse the tree from top to bottom and do something
  8729. */
  8730. function R_(t,e){for(var n,i=[t];n=i.pop();)if(
  8731. // jshint ignore:line
  8732. e(n),n.isExpand){var o=n.children;if(o.length)for(var r=o.length-1;r>=0;r--)i.push(o[r])}}function E_(t,e){t.eachSeriesByType("tree",(function(t){!function(t,e){var n=function(t,e){return xa(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e);t.layoutInfo=n;var i=t.get("layout"),o=0,r=0,a=null;"radial"===i?(o=2*Math.PI,r=Math.min(n.height,n.width)/2,a=t_((function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth}))):(o=n.width,r=n.height,a=t_());var s=t.getData().tree.root,l=s.children[0];if(l){!
  8733. /**
  8734. * Initialize all computational message for following algorithm.
  8735. */
  8736. function(t){var e=t;e.hierNode={defaultAncestor:null,ancestor:e,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var n,i,o=[e];n=o.pop();)if(
  8737. // jshint ignore:line
  8738. i=n.children,n.isExpand&&i.length)for(var r=i.length-1;r>=0;r--){var a=i[r];a.hierNode={defaultAncestor:null,ancestor:a,prelim:0,modifier:0,change:0,shift:0,i:r,thread:null},o.push(a)}}(s),function(t,e,n){for(var i,o=[t],r=[];i=o.pop();)if(
  8739. // jshint ignore:line
  8740. r.push(i),i.isExpand){var a=i.children;if(a.length)for(var s=0;s<a.length;s++)o.push(a[s])}for(;i=r.pop();)
  8741. // jshint ignore:line
  8742. e(i,n)}(l,$x,a),s.hierNode.modifier=-l.hierNode.prelim,R_(l,Qx);var u=l,c=l,d=l;R_(l,(function(t){var e=t.getLayout().x;e<u.getLayout().x&&(u=t),e>c.getLayout().x&&(c=t),t.depth>d.depth&&(d=t)}));var h=u===c?1:a(u,c)/2,p=h-u.getLayout().x,f=0,g=0,y=0,m=0;if("radial"===i)f=o/(c.getLayout().x+h+p),
  8743. // here we use (node.depth - 1), bucause the real root's depth is 1
  8744. g=r/(d.depth-1||1),R_(l,(function(t){y=(t.getLayout().x+p)*f,m=(t.depth-1)*g;var e=e_(y,m);t.setLayout({x:e.x,y:e.y,rawX:y,rawY:m},!0)}));else{var v=t.getOrient();"RL"===v||"LR"===v?(g=r/(c.getLayout().x+h+p),f=o/(d.depth-1||1),R_(l,(function(t){m=(t.getLayout().x+p)*g,y="LR"===v?(t.depth-1)*f:o-(t.depth-1)*f,t.setLayout({x:y,y:m},!0)}))):"TB"!==v&&"BT"!==v||(f=o/(c.getLayout().x+h+p),g=r/(d.depth-1||1),R_(l,(function(t){y=(t.getLayout().x+p)*f,m="TB"===v?(t.depth-1)*g:r-(t.depth-1)*g,t.setLayout({x:y,y:m},!0)})))}}}(t,e)}))}function V_(t){t.eachSeriesByType("tree",(function(t){var e=t.getData();e.tree.eachNode((function(t){var n=t.getModel().getModel("itemStyle").getItemStyle(),i=e.ensureUniqueItemVisual(t.dataIndex,"style");
  8745. // TODO Optimize
  8746. p(i,n)}))}))}var z_=["treemapZoomToNode","treemapRender","treemapMove"];function B_(t){var e=t.getData().tree,n={};e.eachNode((function(e){for(
  8747. // Use decal of level 1 node
  8748. var i=e;i&&i.depth>1;)i=i.parentNode;var o=ns(t.ecModel,i.name||i.dataIndex+"",n);e.setVisual("decal",o)}))}
  8749. /**
  8750. * @param {Object} dataNode
  8751. */
  8752. function G_(t){
  8753. // Postorder travel tree.
  8754. // If value of none-leaf node is not set,
  8755. // calculate it by suming up the value of all children.
  8756. var e=0;a(t.children,(function(t){G_(t);var n=t.value;i(n)&&(n=n[0]),e+=n}));var n=t.value;i(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),
  8757. // Value should not less than 0.
  8758. n<0&&(n=0),i(t.value)?t.value[0]=n:t.value=n}
  8759. /**
  8760. * set default to level configuration
  8761. */const F_=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.preventUsingHoverLayer=!0,n}
  8762. /**
  8763. * @override
  8764. */return Ue(e,t),e.prototype.getInitialData=function(t,e){
  8765. // Create a virtual root.
  8766. var i={name:t.name,children:t.data};G_(i);var o=t.levels||[],r=this.designatedVisualItemStyle={},s=new yr({itemStyle:r},this,e);
  8767. // Used in "visual priority" in `treemapVisual.js`.
  8768. // This way is a little tricky, must satisfy the precondition:
  8769. // 1. There is no `treeNode.getModel('itemStyle.xxx')` used.
  8770. // 2. The `Model.prototype.getModel()` will not use any clone-like way.
  8771. o=t.levels=function(t,e){var n,i,o=Sn(e.get("color")),r=Sn(e.get(["aria","decal","decals"]));if(!o)return;t=t||[],a(t,(function(t){var e=new yr(t),o=e.get("color"),r=e.get("decal");(e.get(["itemStyle","color"])||o&&"none"!==o)&&(n=!0),(e.get(["itemStyle","decal"])||r&&"none"!==r)&&(i=!0)}));var s=t[0]||(t[0]={});n||(s.color=o.slice());!i&&r&&(s.decal=r.slice());return t}(o,e);var l=n(o||[],(function(t){return new yr(t,s,e)}),this),u=C_.createTree(i,this,(function(t){t.wrapMethod("getItemModel",(function(t,e){var n=u.getNodeByDataIndex(e),i=n?l[n.depth]:null;
  8772. // If no levelModel, we also need `designatedVisualModel`.
  8773. return t.parentModel=i||s,t}))}));
  8774. // Make sure always a new tree is created when setOption,
  8775. // in TreemapView, we check whether oldTree === newTree
  8776. // to choose mappings approach among old shapes and new shapes.
  8777. return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},
  8778. /**
  8779. * @override
  8780. * @param {number} dataIndex
  8781. * @param {boolean} [mutipleSeries=false]
  8782. */
  8783. e.prototype.formatTooltip=function(t,e,n){var i=this.getData(),o=this.getRawValue(t);return $l("nameValue",{name:i.getName(t),value:o})},
  8784. /**
  8785. * Add tree path to tooltip param
  8786. *
  8787. * @override
  8788. * @param {number} dataIndex
  8789. * @return {Object}
  8790. */
  8791. e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=P_(i,this),
  8792. // compatitable the previous code.
  8793. n.treePathInfo=n.treeAncestors,n},
  8794. /**
  8795. * @public
  8796. * @param {Object} layoutInfo {
  8797. * x: containerGroup x
  8798. * y: containerGroup y
  8799. * width: containerGroup width
  8800. * height: containerGroup height
  8801. * }
  8802. */
  8803. e.prototype.setLayoutInfo=function(t){
  8804. /**
  8805. * @readOnly
  8806. * @type {Object}
  8807. */
  8808. this.layoutInfo=this.layoutInfo||{},p(this.layoutInfo,t)},
  8809. /**
  8810. * @param {string} id
  8811. * @return {number} index
  8812. */
  8813. e.prototype.mapIdToIndex=function(t){
  8814. // A feature is implemented:
  8815. // index is monotone increasing with the sequence of
  8816. // input id at the first time.
  8817. // This feature can make sure that each data item and its
  8818. // mapped color have the same index between data list and
  8819. // color list at the beginning, which is useful for user
  8820. // to adjust data-color mapping.
  8821. /**
  8822. * @private
  8823. * @type {Object}
  8824. */
  8825. var e=this._idIndexMap;e||(e=this._idIndexMap=r(),
  8826. /**
  8827. * @private
  8828. * @type {number}
  8829. */
  8830. this._idIndexMapCount=0);var n=e.get(t);return null==n&&e.set(t,n=this._idIndexMapCount++),n},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){B_(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={
  8831. // Disable progressive rendering
  8832. progressive:0,
  8833. // size: ['80%', '80%'], // deprecated, compatible with ec2.
  8834. left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",
  8835. // to align specialized icon. ▷▶❒❐▼✚
  8836. zoomToNodeRatio:.1024,scaleLimit:null,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",
  8837. // right
  8838. // bottom
  8839. emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,
  8840. // Do not use textDistance, for ellipsis rect just the same as treemap node rect.
  8841. distance:0,padding:5,position:"inside",
  8842. // formatter: null,
  8843. color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,
  8844. // formatter: null,
  8845. // color: '#fff',
  8846. overflow:"truncate",
  8847. // align: null,
  8848. verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],
  8849. // level[n].color (if necessary).
  8850. // + Specify color list of each level. level[0].color would be global
  8851. // color list if not specified. (see method `setDefault`).
  8852. // + But set as a empty array to forbid fetch color from global palette
  8853. // when using nodeModel.get('color'), otherwise nodes on deep level
  8854. // will always has color palette set and are not able to inherit color
  8855. // from parent node.
  8856. // + TreemapSeries.color can not be set as 'none', otherwise effect
  8857. // legend color fetching (see seriesColor.js).
  8858. colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,
  8859. // be rendered. Only works when sort is 'asc' or 'desc'.
  8860. childrenVisibleMin:null,
  8861. // grandchildren will not show.
  8862. // Why grandchildren? If not grandchildren but children,
  8863. // some siblings show children and some not,
  8864. // the appearance may be mess and not consistent,
  8865. levels:[]},e}(Su);var W_=/** @class */function(){function t(t){this.group=new Z,t.add(this.group)}return t.prototype.render=function(t,e,n,i){var o=t.getModel("breadcrumb"),r=this.group;if(r.removeAll(),o.get("show")&&n){var a=o.getModel("itemStyle"),s=o.getModel("emphasis"),l=a.getModel("textStyle"),u=s.getModel(["itemStyle","textStyle"]),c={pos:{left:o.get("left"),right:o.get("right"),top:o.get("top"),bottom:o.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:o.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,c,l),this._renderContent(t,c,a,s,l,u,i),_a(r,c.pos,c.box)}},
  8866. /**
  8867. * Prepare render list and total width
  8868. * @private
  8869. */
  8870. t.prototype._prepare=function(t,e,n){for(var i=t;i;i=i.parentNode){var o=Ln(i.getModel().get("name"),""),r=n.getTextRect(o),a=Math.max(r.width+16,e.emptyItemWidth);e.totalWidth+=a+8,e.renderList.push({node:i,text:o,width:a})}},
  8871. /**
  8872. * @private
  8873. */
  8874. t.prototype._renderContent=function(t,e,n,i,o,r,a){for(
  8875. // Start rendering.
  8876. var s,l,u,c,d,h,p,f,g,y=0,m=e.emptyItemWidth,v=t.get(["breadcrumb","height"]),x=(s=e.pos,l=e.box,c=l.width,d=l.height,h=je(s.left,c),p=je(s.top,d),f=je(s.right,c),g=je(s.bottom,d),(isNaN(h)||isNaN(parseFloat(s.left)))&&(h=0),(isNaN(f)||isNaN(parseFloat(s.right)))&&(f=c),(isNaN(p)||isNaN(parseFloat(s.top)))&&(p=0),(isNaN(g)||isNaN(parseFloat(s.bottom)))&&(g=d),u=aa(u||0),{width:Math.max(f-h-u[1]-u[3],0),height:Math.max(g-p-u[0]-u[2],0)}),_=e.totalWidth,b=e.renderList,S=i.getModel("itemStyle").getItemStyle(),w=b.length-1;w>=0;w--){var M=b[w],D=M.node,T=M.width,C=M.text;
  8877. // Hdie text and shorten width if necessary.
  8878. _>x.width&&(_-=T-m,T=m,C=null);var A=new z({shape:{points:H_(y,0,T,v,w===b.length-1,0===w)},style:I(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new $({style:Zo(o,{text:C})}),textConfig:{position:"inside"},z2:1e5,onclick:rt(a,D)});A.disableLabelAnimation=!0,A.getTextContent().ensureState("emphasis").style=Zo(r,{text:C}),A.ensureState("emphasis").style=S,Ui(A,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(A),Y_(A,t,D),y+=T+8}},t.prototype.remove=function(){this.group.removeAll()},t}();function H_(t,e,n,i,o,r){var a=[[o?t:t-5,e],[t+n,e],[t+n,e+i],[o?t:t-5,e+i]];return!r&&a.splice(2,0,[t+n+5,e+i/2]),!o&&a.push([t,e+i/2]),a}
  8879. // Package custom mouse event.
  8880. function Y_(t,e,n){ni(t).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&P_(n,e)}}const U_=W_;
  8881. /*
  8882. * Licensed to the Apache Software Foundation (ASF) under one
  8883. * or more contributor license agreements. See the NOTICE file
  8884. * distributed with this work for additional information
  8885. * regarding copyright ownership. The ASF licenses this file
  8886. * to you under the Apache License, Version 2.0 (the
  8887. * "License"); you may not use this file except in compliance
  8888. * with the License. You may obtain a copy of the License at
  8889. *
  8890. * http://www.apache.org/licenses/LICENSE-2.0
  8891. *
  8892. * Unless required by applicable law or agreed to in writing,
  8893. * software distributed under the License is distributed on an
  8894. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  8895. * KIND, either express or implied. See the License for the
  8896. * specific language governing permissions and limitations
  8897. * under the License.
  8898. */
  8899. /**
  8900. * AUTO-GENERATED FILE. DO NOT MODIFY.
  8901. */
  8902. /*
  8903. * Licensed to the Apache Software Foundation (ASF) under one
  8904. * or more contributor license agreements. See the NOTICE file
  8905. * distributed with this work for additional information
  8906. * regarding copyright ownership. The ASF licenses this file
  8907. * to you under the Apache License, Version 2.0 (the
  8908. * "License"); you may not use this file except in compliance
  8909. * with the License. You may obtain a copy of the License at
  8910. *
  8911. * http://www.apache.org/licenses/LICENSE-2.0
  8912. *
  8913. * Unless required by applicable law or agreed to in writing,
  8914. * software distributed under the License is distributed on an
  8915. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  8916. * KIND, either express or implied. See the License for the
  8917. * specific language governing permissions and limitations
  8918. * under the License.
  8919. */
  8920. /**
  8921. * Animate multiple elements with a single done-callback.
  8922. *
  8923. * @example
  8924. * animation
  8925. * .createWrap()
  8926. * .add(el1, {x: 10, y: 10})
  8927. * .add(el2, {shape: {width: 500}, style: {fill: 'red'}}, 400)
  8928. * .done(function () { // done })
  8929. * .start('cubicOut');
  8930. */var Z_=/** @class */function(){function t(){this._storage=[],this._elExistsMap={}}
  8931. /**
  8932. * Caution: a el can only be added once, otherwise 'done'
  8933. * might not be called. This method checks this (by el.id),
  8934. * suppresses adding and returns false when existing el found.
  8935. *
  8936. * @return Whether adding succeeded.
  8937. */return t.prototype.add=function(t,e,n,i,o){return!this._elExistsMap[t.id]&&(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:e,duration:n,delay:i,easing:o}),!0)},
  8938. /**
  8939. * Only execute when animation done/aborted.
  8940. */
  8941. t.prototype.finished=function(t){return this._finishedCallback=t,this},
  8942. /**
  8943. * Will stop exist animation firstly.
  8944. */
  8945. t.prototype.start=function(){for(var t=this,e=this._storage.length,n=function(){--e<=0&&(
  8946. // Guard.
  8947. t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},i=0,o=this._storage.length;i<o;i++){var r=this._storage[i];r.el.animateTo(r.target,{duration:r.duration,delay:r.delay,easing:r.easing,setToFinal:!0,done:n,aborted:n})}return this},t}();var X_=Z,j_=G,q_="label",K_="upperLabel",J_=Qn([["fill","color"],
  8948. // `borderColor` and `borderWidth` has been occupied,
  8949. // so use `stroke` to indicate the stroke of the rect.
  8950. ["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),$_=function(t){
  8951. // Normal style props should include emphasis style props.
  8952. var e=J_(t);
  8953. // Clear styles set by emphasis.
  8954. return e.stroke=e.fill=e.lineWidth=null,e},Q_=On(),tb=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._state="ready",n._storage={nodeGroup:[],background:[],content:[]},n}
  8955. /**
  8956. * @override
  8957. */return Ue(e,t),e.prototype.render=function(t,e,n,i){var o=e.findComponents({mainType:"series",subType:"treemap",query:i});if(!(c(o,t)<0)){this.seriesModel=t,this.api=n,this.ecModel=e;var r=A_(i,["treemapZoomToNode","treemapRootToNode"],t),a=i&&i.type,s=t.layoutInfo,l=!this._oldTree,u=this._storage,d="treemapRootToNode"===a&&r&&u?{rootNodeGroup:u.nodeGroup[r.node.getRawIndex()],direction:i.direction}:null,h=this._giveContainerGroup(s),p=t.get("animation"),f=this._doRender(h,t,d);!p||l||a&&"treemapZoomToNode"!==a&&"treemapRootToNode"!==a?f.renderFinally():this._doAnimation(h,f,t,d),this._resetController(n),this._renderBreadcrumb(t,n,r)}},e.prototype._giveContainerGroup=function(t){var e=this._containerGroup;return e||(
  8958. // FIXME
  8959. // 加一层containerGroup是为了clip,但是现在clip功能并没有实现。
  8960. e=this._containerGroup=new X_,this._initEvents(e),this.group.add(e)),e.x=t.x,e.y=t.y,e},e.prototype._doRender=function(t,e,n){var i=e.getData().tree,o=this._oldTree,r={nodeGroup:[],background:[],content:[]},s={nodeGroup:[],background:[],content:[]},l=this._storage,u=[];function c(t,i,o,a){
  8961. /**
  8962. * @inner
  8963. * @return Return undefined means do not travel further.
  8964. */
  8965. return function(t,e,n,i,o,r,a,s,l,u){
  8966. // Whether under viewRoot.
  8967. if(!a)
  8968. // Deleting nodes will be performed finally. This method just find
  8969. // element from old storage, or create new element, set them to new
  8970. // storage, and set styles.
  8971. return;
  8972. // -------------------------------------------------------------------
  8973. // Start of closure variables available in "Procedures in renderNode".
  8974. var c=a.getLayout(),d=t.getData(),h=a.getModel();if(
  8975. // Only for enabling highlight/downplay. Clear firstly.
  8976. // Because some node will not be rendered.
  8977. d.setItemGraphicEl(a.dataIndex,null),!c||!c.isInView)return;var f=c.width,g=c.height,y=c.borderWidth,m=c.invisible,v=a.getRawIndex(),x=s&&s.getRawIndex(),_=a.viewChildren,b=c.upperHeight,S=_&&_.length,w=h.getModel("itemStyle"),M=h.getModel(["emphasis","itemStyle"]),I=h.getModel(["blur","itemStyle"]),D=h.getModel(["select","itemStyle"]),T=w.get("borderRadius")||0,C=W("nodeGroup",X_);if(!C)return;if(l.add(C),
  8978. // x,y are not set when el is above view root.
  8979. C.x=c.x||0,C.y=c.y||0,C.markRedraw(),Q_(C).nodeWidth=f,Q_(C).nodeHeight=g,c.isAboveViewRoot)return C;
  8980. // Background
  8981. var A=W("background",j_,u,20);A&&V(C,A,S&&c.upperLabelHeight);var L=h.getModel("emphasis"),k=L.get("focus"),P=L.get("blurScope"),N=L.get("disabled"),O="ancestor"===k?a.getAncestorsIndices():"descendant"===k?a.getDescendantIndices():k;
  8982. // No children, render content.
  8983. if(S)
  8984. // Because of the implementation about "traverse" in graphic hover style, we
  8985. // can not set hover listener on the "group" of non-leaf node. Otherwise the
  8986. // hover event from the descendents will be listenered.
  8987. Ji(C)&&Ki(C,!1),A&&(Ki(A,!N),
  8988. // Only for enabling highlight/downplay.
  8989. d.setItemGraphicEl(a.dataIndex,A),Zi(A,O,P));else{var R=W("content",j_,u,30);R&&z(C,R),A.disableMorphing=!0,A&&Ji(A)&&Ki(A,!1),Ki(C,!N),
  8990. // Only for enabling highlight/downplay.
  8991. d.setItemGraphicEl(a.dataIndex,C);var E=h.getShallow("cursor");E&&R.attr("cursor",E),Zi(C,O,P)}return C;
  8992. // ----------------------------
  8993. // | Procedures in renderNode |
  8994. // ----------------------------
  8995. function V(e,n,i){var o=ni(n);
  8996. // For tooltip.
  8997. if(o.dataIndex=a.dataIndex,o.seriesIndex=t.seriesIndex,n.setShape({x:0,y:0,width:f,height:g,r:T}),m)
  8998. // If invisible, do not set visual, otherwise the element will
  8999. // change immediately before animation. We think it is OK to
  9000. // remain its origin color when moving out of the view window.
  9001. B(n);else{n.invisible=!1;var r=a.getVisual("style"),s=r.stroke,l=$_(w);l.fill=s;var u=J_(M);u.fill=M.get("borderColor");var c=J_(I);c.fill=I.get("borderColor");var d=J_(D);if(d.fill=D.get("borderColor"),i){var h=f-2*y;G(
  9002. // PENDING: convert ZRColor to ColorString for text.
  9003. n,s,r.opacity,{x:y,y:0,width:h,height:b})}
  9004. // For old bg.
  9005. else n.removeTextContent();n.setStyle(l),n.ensureState("emphasis").style=u,n.ensureState("blur").style=c,n.ensureState("select").style=d,Ci(n)}e.add(n)}function z(e,n){var i=ni(n);
  9006. // For tooltip.
  9007. i.dataIndex=a.dataIndex,i.seriesIndex=t.seriesIndex;var o=Math.max(f-2*y,0),r=Math.max(g-2*y,0);if(n.culling=!0,n.setShape({x:y,y:y,width:o,height:r,r:T}),m)
  9008. // If invisible, do not set visual, otherwise the element will
  9009. // change immediately before animation. We think it is OK to
  9010. // remain its origin color when moving out of the view window.
  9011. B(n);else{n.invisible=!1;var s=a.getVisual("style"),l=s.fill,u=$_(w);u.fill=l,u.decal=s.decal;var c=J_(M),d=J_(I),h=J_(D);
  9012. // PENDING: convert ZRColor to ColorString for text.
  9013. G(n,l,s.opacity,null),n.setStyle(u),n.ensureState("emphasis").style=c,n.ensureState("blur").style=d,n.ensureState("select").style=h,Ci(n)}e.add(n)}function B(t){
  9014. // Delay invisible setting utill animation finished,
  9015. // avoid element vanish suddenly before animation.
  9016. !t.invisible&&r.push(t)}function G(e,n,i,
  9017. // Can be null/undefined
  9018. o){var r=h.getModel(o?K_:q_),s=Ln(h.get("name"),null),l=r.getShallow("show");Yo(e,Uo(h,o?K_:q_),{defaultText:l?s:null,inheritColor:n,defaultOpacity:i,labelFetcher:t,labelDataIndex:a.dataIndex});var u=e.getTextContent();if(u){var d=u.style,p=it(d.padding||0);o&&(e.setTextConfig({layoutRect:o}),u.disableLabelLayout=!0),u.beforeUpdate=function(){var t=Math.max((o?o.width:e.shape.width)-p[1]-p[3],0),n=Math.max((o?o.height:e.shape.height)-p[0]-p[2],0);d.width===t&&d.height===n||u.setStyle({width:t,height:n})},d.truncateMinChar=2,d.lineOverflow="truncate",F(d,o,c);var f=u.getState("emphasis");F(f?f.style:null,o,c)}}function F(e,n,i){var o=e?e.text:null;if(!n&&i.isLeafRoot&&null!=o){var r=t.get("drillDownIcon",!0);e.text=r?r+" "+o:o}}function W(t,i,r,a){var s=null!=x&&n[t][x],l=o[t];
  9019. // Set to thisStorage
  9020. return s?(
  9021. // Remove from oldStorage
  9022. n[t][x]=null,H(l,s)):m||((s=new i)instanceof $t&&(s.z2=
  9023. // We cannot set all background with the same z, because the behaviour of
  9024. // drill down and roll up differ background creation sequence from tree
  9025. // hierarchy sequence, which cause lower background elements to overlap
  9026. // upper ones. So we calculate z based on depth.
  9027. // Moreover, we try to shrink down z interval to [0, 1] to avoid that
  9028. // treemap with large z overlaps other components.
  9029. function(t,e){return 100*t+e}(r,a)),Y(l,s)),e[t][v]=s}function H(t,e){var n=t[v]={};e instanceof X_?(n.oldX=e.x,n.oldY=e.y):n.oldShape=p({},e.shape)}
  9030. // If a element is new, we need to find the animation start point carefully,
  9031. // otherwise it will looks strange when 'zoomToNode'.
  9032. function Y(t,e){var n=t[v]={},r=a.parentNode,s=e instanceof Z;if(r&&(!i||"drillDown"===i.direction)){var l=0,u=0,c=o.background[r.getRawIndex()];!i&&c&&c.oldShape&&(l=c.oldShape.width,u=c.oldShape.height),
  9033. // When no parent old shape found, its parent is new too,
  9034. // so we can just use {x:0, y:0}.
  9035. s?(n.oldX=0,n.oldY=u):n.oldShape={x:l,y:u,width:0,height:0}}
  9036. // Fade in, user can be aware that these nodes are new.
  9037. n.fadein=!s}}(e,s,l,n,r,u,t,i,o,a)}
  9038. // Notice: When thisTree and oldTree are the same tree (see list.cloneShallow),
  9039. // the oldTree is actually losted, so we cannot find all of the old graphic
  9040. // elements from tree. So we use this strategy: make element storage, move
  9041. // from old storage to new storage, clear old storage.
  9042. !function t(e,n,i,o,r){
  9043. // When 'render' is triggered by action,
  9044. // 'this' and 'old' may be the same tree,
  9045. // we use rawIndex in that case.
  9046. o?(n=e,a(e,(function(t,e){!t.isRemoved()&&l(e,e)}))):new yh(n,e,s,s).add(l).update(l).remove(rt(l,null)).execute();function s(t){
  9047. // Identify by name or raw index.
  9048. return t.getId()}function l(a,s){var l=null!=a?e[a]:null,u=null!=s?n[s]:null,d=c(l,u,i,r);d&&t(l&&l.viewChildren||[],u&&u.viewChildren||[],d,o,r+1)}}(i.root?[i.root]:[],o&&o.root?[o.root]:[],t,i===o||!o,0);
  9049. // Process all removing.
  9050. var d=function(t){var e={nodeGroup:[],background:[],content:[]};return t&&a(t,(function(t,n){var i=e[n];a(t,(function(t){t&&(i.push(t),Q_(t).willDelete=!0)}))})),e}(l);if(this._oldTree=i,this._storage=s,this._controllerHost){var h=this.seriesModel.layoutInfo,f=i.root.getLayout();f.width===h.width&&f.height===h.height&&(this._controllerHost.zoom=1)}return{lastsForAnimation:r,willDeleteEls:d,renderFinally:function(){a(d,(function(t){a(t,(function(t){t.parent&&t.parent.remove(t)}))})),a(u,(function(t){t.invisible=!0,
  9051. // Setting invisible is for optimizing, so no need to set dirty,
  9052. // just mark as invisible.
  9053. t.dirty()}))}}},e.prototype._doAnimation=function(t,e,n,i){var o=n.get("animationDurationUpdate"),r=n.get("animationEasing"),s=(f(o)?0:o)||0,l=(f(r)?null:r)||"cubicOut",u=new Z_;
  9054. // Make delete animations.
  9055. a(e.willDeleteEls,(function(t,e){a(t,(function(t,n){if(!t.invisible){var o,r=t.parent,a=Q_(r);// Always has parent, and parent is nodeGroup.
  9056. if(i&&"drillDown"===i.direction)o=r===i.rootNodeGroup?{shape:{x:0,y:0,width:a.nodeWidth,height:a.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var c=0,d=0;a.willDelete||(
  9057. // Let node animate to right-bottom corner, cooperating with fadeout,
  9058. // which is appropriate for user understanding.
  9059. // Divided by 2 for reRoot rolling up effect.
  9060. c=a.nodeWidth/2,d=a.nodeHeight/2),o="nodeGroup"===e?{x:c,y:d,style:{opacity:0}}:{shape:{x:c,y:d,width:0,height:0},style:{opacity:0}}}
  9061. // TODO: do not support delay until necessary.
  9062. o&&u.add(t,o,s,0,l)}}))})),
  9063. // Make other animations
  9064. a(this._storage,(function(t,n){a(t,(function(t,i){var o=e.lastsForAnimation[n][i],r={};o&&(t instanceof Z?null!=o.oldX&&(r.x=t.x,r.y=t.y,t.x=o.oldX,t.y=o.oldY):(o.oldShape&&(r.shape=p({},t.shape),t.setShape(o.oldShape)),o.fadein?(t.setStyle("opacity",0),r.style={opacity:1}):1!==t.style.opacity&&(r.style={opacity:1})),u.add(t,r,s,0,l))}))}),this),this._state="animating",u.finished(lt((function(){this._state="ready",e.renderFinally()}),this)).start()},e.prototype._resetController=function(t){var e=this._controller,n=this._controllerHost;n||(this._controllerHost={target:this.group},n=this._controllerHost),
  9065. // Init controller.
  9066. e||((e=this._controller=new Uv(t.getZr())).enable(this.seriesModel.get("roam")),n.zoomLimit=this.seriesModel.get("scaleLimit"),n.zoom=this.seriesModel.get("zoom"),e.on("pan",lt(this._onPan,this)),e.on("zoom",lt(this._onZoom,this)));var i=new Y(0,0,t.getWidth(),t.getHeight());e.setPointerChecker((function(t,e,n){return i.contain(e,n)}))},e.prototype._clearController=function(){var t=this._controller;this._controllerHost=null,t&&(t.dispose(),t=null)},e.prototype._onPan=function(t){if("animating"!==this._state&&(Math.abs(t.dx)>3||Math.abs(t.dy)>3)){
  9067. // These param must not be cached.
  9068. var e=this.seriesModel.getData().tree.root;if(!e)return;var n=e.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+t.dx,y:n.y+t.dy,width:n.width,height:n.height}})}},e.prototype._onZoom=function(t){var e=t.originX,n=t.originY,i=t.scale;if("animating"!==this._state){
  9069. // These param must not be cached.
  9070. var o=this.seriesModel.getData().tree.root;if(!o)return;var r=o.getLayout();if(!r)return;var a,s=new Y(r.x,r.y,r.width,r.height),l=this._controllerHost;
  9071. // scaleLimit
  9072. a=l.zoomLimit;var u=l.zoom=l.zoom||1;if(u*=i,a){var c=a.min||0,d=a.max||Infinity;u=Math.max(Math.min(d,u),c)}var h=u/l.zoom;l.zoom=u;var p=this.seriesModel.layoutInfo;
  9073. // Transform mouse coord from global to containerGroup.
  9074. e-=p.x,n-=p.y;
  9075. // Scale root bounding rect.
  9076. var f=te();oe(f,f,[-e,-n]),re(f,f,[h,h]),oe(f,f,[e,n]),s.applyTransform(f),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:s.x,y:s.y,width:s.width,height:s.height}})}},e.prototype._initEvents=function(t){var e=this;t.on("click",(function(t){if("ready"===e._state){var n=e.seriesModel.get("nodeClick",!0);if(n){var i=e.findTarget(t.offsetX,t.offsetY);if(i){var o=i.node;if(o.getLayout().isLeafRoot)e._rootToNode(i);else if("zoomToNode"===n)e._zoomToNode(i);else if("link"===n){var r=o.hostTree.data.getItemModel(o.dataIndex),a=r.get("link",!0),s=r.get("target",!0)||"blank";a&&pa(a,s)}}}}}),this)},e.prototype._renderBreadcrumb=function(t,e,n){var i=this;n||(n=null!=t.get("leafDepth",!0)?{node:t.getViewRoot()}:this.findTarget(e.getWidth()/2,e.getHeight()/2))||(n={node:t.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new U_(this.group))).render(t,e,n.node,(function(e){"animating"!==i._state&&(k_(t.getViewRoot(),e)?i._rootToNode({node:e}):i._zoomToNode({node:e}))}))},
  9077. /**
  9078. * @override
  9079. */
  9080. e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},
  9081. /**
  9082. * @public
  9083. * @param {number} x Global coord x.
  9084. * @param {number} y Global coord y.
  9085. * @return {Object} info If not found, return undefined;
  9086. * @return {number} info.node Target node.
  9087. * @return {number} info.offsetX x refer to target node.
  9088. * @return {number} info.offsetY y refer to target node.
  9089. */
  9090. e.prototype.findTarget=function(t,e){var n;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(i){var o=this._storage.background[i.getRawIndex()];
  9091. // If invisible, there might be no element.
  9092. if(o){var r=o.transformCoordToLocal(t,e),a=o.shape;
  9093. // For performance consideration, don't use 'getBoundingRect'.
  9094. if(!(a.x<=r[0]&&r[0]<=a.x+a.width&&a.y<=r[1]&&r[1]<=a.y+a.height))return!1;// Suppress visit subtree.
  9095. n={node:i,offsetX:r[0],offsetY:r[1]}}}),this),n},e.type="treemap",e}(Ou);const eb=tb;var nb=a,ib=o,ob=-1,rb=/** @class */function(){function e(t){var n=t.mappingMethod,r=t.type,l=this.option=et(t);this.type=r,this.mappingMethod=n,this._normalizeData=gb[n];var u=e.visualHandlers[r];this.applyVisual=u.applyVisual,this.getColorMapper=u.getColorMapper,this._normalizedToVisual=u._normalizedToVisual[n],"piecewise"===n?(ab(l),function(t){var e=t.pieceList;t.hasSpecialVisual=!1,a(e,(function(e,n){e.originIndex=n,
  9096. // piece.visual is "result visual value" but not
  9097. // a visual range, so it does not need to be normalized.
  9098. null!=e.visual&&(t.hasSpecialVisual=!0)}))}(l)):"category"===n?l.categories?function(t){
  9099. // Hash categories.
  9100. var e=t.categories,n=t.categoryMap={},r=t.visual;
  9101. // Process visual map input.
  9102. if(nb(e,(function(t,e){n[t]=e})),!i(r)){var a=[];o(r)?nb(r,(function(t,e){var i=n[e];a[null!=i?i:ob]=t})):
  9103. // Is primary type, represents default visual.
  9104. a[-1]=r,r=fb(t,a)}
  9105. // Remove categories that has no visual,
  9106. // then we can mapping them to CATEGORY_DEFAULT_VISUAL_INDEX.
  9107. for(var s=e.length-1;s>=0;s--)null==r[s]&&(delete n[e[s]],e.pop())}(l):ab(l,!0):(
  9108. // mappingMethod === 'linear' or 'fixed'
  9109. s("linear"!==n||l.dataExtent),ab(l))}return e.prototype.mapValueToVisual=function(t){var e=this._normalizeData(t);return this._normalizedToVisual(e,t)},e.prototype.getNormalizer=function(){return lt(this._normalizeData,this)},
  9110. /**
  9111. * List available visual types.
  9112. *
  9113. * @public
  9114. * @return {Array.<string>}
  9115. */
  9116. e.listVisualTypes=function(){return v(e.visualHandlers)},
  9117. // /**
  9118. // * @public
  9119. // */
  9120. // static addVisualHandler(name, handler) {
  9121. // visualHandlers[name] = handler;
  9122. // }
  9123. /**
  9124. * @public
  9125. */
  9126. e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},
  9127. /**
  9128. * Convenient method.
  9129. * Visual can be Object or Array or primary type.
  9130. */
  9131. e.eachVisual=function(t,e,n){o(t)?a(t,e,n):e.call(n,t)},e.mapVisual=function(t,n,r){var a,s=i(t)?[]:o(t)?{}:(a=!0,null);return e.eachVisual(t,(function(t,e){var i=n.call(r,t,e);a?s=i:s[e]=i})),s},
  9132. /**
  9133. * Retrieve visual properties from given object.
  9134. */
  9135. e.retrieveVisuals=function(t){var n,i={};return t&&nb(e.visualHandlers,(function(e,o){t.hasOwnProperty(o)&&(i[o]=t[o],n=!0)})),n?i:null},
  9136. /**
  9137. * Give order to visual types, considering colorSaturation, colorAlpha depends on color.
  9138. *
  9139. * @public
  9140. * @param {(Object|Array)} visualTypes If Object, like: {color: ..., colorSaturation: ...}
  9141. * IF Array, like: ['color', 'symbol', 'colorSaturation']
  9142. * @return {Array.<string>} Sorted visual types.
  9143. */
  9144. e.prepareVisualTypes=function(t){if(i(t))t=t.slice();else{if(!ib(t))return[];var e=[];nb(t,(function(t,n){e.push(n)})),t=e}return t.sort((function(t,e){
  9145. // color should be front of colorSaturation, colorAlpha, ...
  9146. // symbol and symbolSize do not matter.
  9147. return"color"===e&&"color"!==t&&0===t.indexOf("color")?1:-1})),t},
  9148. /**
  9149. * 'color', 'colorSaturation', 'colorAlpha', ... are depends on 'color'.
  9150. * Other visuals are only depends on themself.
  9151. */
  9152. e.dependsOn=function(t,e){return"color"===e?!(!t||0!==t.indexOf(e)):t===e},
  9153. /**
  9154. * @param value
  9155. * @param pieceList [{value: ..., interval: [min, max]}, ...]
  9156. * Always from small to big.
  9157. * @param findClosestWhenOutside Default to be false
  9158. * @return index
  9159. */
  9160. e.findPieceIndex=function(e,n,i){
  9161. // value has the higher priority.
  9162. for(var o,r=Infinity,a=0,s=n.length;a<s;a++){var l=n[a].value;if(null!=l){if(l===e||t(l)&&l===e+"")return a;i&&h(l,a)}}for(a=0,s=n.length;a<s;a++){var u=n[a],c=u.interval,d=u.close;if(c){if(-Infinity===c[0]){if(yb(d[1],e,c[1]))return a}else if(Infinity===c[1]){if(yb(d[0],c[0],e))return a}else if(yb(d[0],c[0],e)&&yb(d[1],e,c[1]))return a;i&&h(c[0],a),i&&h(c[1],a)}}if(i)return Infinity===e?n.length-1:-Infinity===e?0:o;function h(t,n){var i=Math.abs(t-e);i<r&&(r=i,o=n)}},e.visualHandlers={color:{applyVisual:ub("color"),getColorMapper:function(){var t=this.option;return lt("category"===t.mappingMethod?function(t,e){return!e&&(t=this._normalizeData(t)),cb.call(this,t)}:function(e,n,i){
  9163. // If output rgb array
  9164. // which will be much faster and useful in pixel manipulation
  9165. var o=!!i;return!n&&(e=this._normalizeData(e)),i=ae(e,t.parsedVisual,i),o?i:se(i,"rgba")},this)},_normalizedToVisual:{linear:function(t){return se(ae(t,this.option.parsedVisual),"rgba")},category:cb,piecewise:function(t,e){var n=pb.call(this,e);return null==n&&(n=se(ae(t,this.option.parsedVisual),"rgba")),n},fixed:db}},colorHue:sb((function(t,e){return ue(t,e)})),colorSaturation:sb((function(t,e){return ue(t,null,e)})),colorLightness:sb((function(t,e){return ue(t,null,null,e)})),colorAlpha:sb((function(t,e){return ce(t,e)})),decal:{applyVisual:ub("decal"),_normalizedToVisual:{linear:null,category:cb,piecewise:null,fixed:null}},opacity:{applyVisual:ub("opacity"),_normalizedToVisual:hb([0,1])},liftZ:{applyVisual:ub("liftZ"),_normalizedToVisual:{linear:db,category:db,piecewise:db,fixed:db}},symbol:{applyVisual:function(t,e,n){n("symbol",this.mapValueToVisual(t))},_normalizedToVisual:{linear:lb,category:cb,piecewise:function(t,e){var n=pb.call(this,e);return null==n&&(n=lb.call(this,t)),n},fixed:db}},symbolSize:{applyVisual:ub("symbolSize"),_normalizedToVisual:hb([0,1])}},e}();function ab(t,e){var n=t.visual,i=[];o(n)?nb(n,(function(t){i.push(t)})):null!=n&&i.push(n);e||1!==i.length||{color:1,symbol:1}.hasOwnProperty(t.type)||(
  9166. // Do not care visualArr.length === 0, which is illegal.
  9167. i[1]=i[0]),fb(t,i)}function sb(t){return{applyVisual:function(e,n,i){
  9168. // Only used in HSL
  9169. var o=this.mapValueToVisual(e);
  9170. // Must not be array value
  9171. i("color",t(n("color"),o))},_normalizedToVisual:hb([0,1])}}function lb(t){var e=this.option.visual;return e[Math.round(Xe(t,[0,1],[0,e.length-1],!0))]||{};// TODO {}?
  9172. }function ub(t){return function(e,n,i){i(t,this.mapValueToVisual(e))}}function cb(t){var e=this.option.visual;return e[this.option.loop&&t!==ob?t%e.length:t]}function db(){
  9173. // visual will be convert to array.
  9174. return this.option.visual[0]}
  9175. /**
  9176. * Create mapped to numeric visual
  9177. */function hb(t){return{linear:function(e){return Xe(e,t,this.option.visual,!0)},category:cb,piecewise:function(e,n){var i=pb.call(this,n);return null==i&&(i=Xe(e,t,this.option.visual,!0)),i},fixed:db}}function pb(t){var e=this.option,n=e.pieceList;if(e.hasSpecialVisual){var i=n[rb.findPieceIndex(t,n)];if(i&&i.visual)return i.visual[this.type]}}function fb(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=n(e,(function(t){var e=le(t);return e||[0,0,0,1]}))),e}
  9178. /**
  9179. * Normalizers by mapping methods.
  9180. */var gb={linear:function(t){return Xe(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,n=rb.findPieceIndex(t,e,!0);if(null!=n)return Xe(n,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;// ordinal value
  9181. return null==e?ob:e},fixed:dt};function yb(t,e,n){return t?e<=n:e<n}const mb=rb;var vb=On();const xb={seriesType:"treemap",reset:function(t){var e=t.getData().tree.root;e.isRemoved()||_b(e,
  9182. // Visual should calculate from tree root but not view root.
  9183. {},t.getViewRoot().getAncestors(),t)}};function _b(t,e,n,i){var o=t.getModel(),r=t.getLayout(),s=t.hostTree.data;
  9184. // Optimize
  9185. if(r&&!r.invisible&&r.isInView){var l,u=o.getModel("itemStyle"),c=function(t,e,n){var i=p({},e),o=n.designatedVisualItemStyle;return a(["color","colorAlpha","colorSaturation"],(function(n){
  9186. // Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel
  9187. o[n]=e[n];var r=t.get(n);o[n]=null,null!=r&&(i[n]=r)})),i}(u,e,i),d=s.ensureUniqueItemVisual(t.dataIndex,"style"),h=u.get("borderColor"),f=u.get("borderColorSaturation");null!=f&&(h=function(t,e){return null!=e?ue(e,null,null,t):null}(f,
  9188. // For performance, do not always execute 'calculateColor'.
  9189. l=bb(c))),d.stroke=h;var g=t.viewChildren;if(g&&g.length){var y=function(t,e,n,i,o,r){if(!r||!r.length)return;var a=wb(e,"color")||null!=o.color&&"none"!==o.color&&(wb(e,"colorAlpha")||wb(e,"colorSaturation"));if(!a)return;var s=e.get("visualMin"),l=e.get("visualMax"),u=n.dataExtent.slice();null!=s&&s<u[0]&&(u[0]=s),null!=l&&l>u[1]&&(u[1]=l);var c=e.get("colorMappingBy"),d={type:a.name,dataExtent:u,visual:a.range};"color"!==d.type||"index"!==c&&"id"!==c?d.mappingMethod="linear":(d.mappingMethod="category",d.loop=!0);var h=new mb(d);return vb(h).drColorMappingBy=c,h}
  9190. // Notice: If we don't have the attribute 'colorRange', but only use
  9191. // attribute 'color' to represent both concepts of 'colorRange' and 'color',
  9192. // (It means 'colorRange' when 'color' is Array, means 'color' when not array),
  9193. // this problem will be encountered:
  9194. // If a level-1 node doesn't have children, and its siblings have children,
  9195. // and colorRange is set on level-1, then the node cannot be colored.
  9196. // So we separate 'colorRange' and 'color' to different attributes.
  9197. (0,o,r,0,c,g);
  9198. // Designate visual to children.
  9199. a(g,(function(t,e){
  9200. // If higher than viewRoot, only ancestors of viewRoot is needed to visit.
  9201. if(t.depth>=n.length||t===n[t.depth]){var r=function(t,e,n,i,o,r){var a=p({},e);if(o){
  9202. // Only support color, colorAlpha, colorSaturation.
  9203. var s=o.type,l="color"===s&&vb(o).drColorMappingBy,u="index"===l?i:"id"===l?r.mapIdToIndex(n.getId()):n.getValue(t.get("visualDimension"));a[s]=o.mapValueToVisual(u)}return a}(o,c,t,e,y,i);_b(t,r,n,i)}}))}else l=bb(c),
  9204. // Apply visual to this node.
  9205. d.fill=l}}function bb(t){var e=Sb(t,"color");if(e){var n=Sb(t,"colorAlpha"),i=Sb(t,"colorSaturation");return i&&(e=ue(e,null,null,i)),n&&(e=ce(e,n)),e}}function Sb(t,e){var n=t[e];if(null!=n&&"none"!==n)return n}function wb(t,e){
  9206. // 'colorRange', 'colorARange', 'colorSRange'.
  9207. // If not exists on this node, fetch from levels and series.
  9208. var n=t.get(e);return i(n)&&n.length?{name:e,range:n}:null}var Mb=Math.max,Ib=Math.min,Db=Yt,Tb=a,Cb=["itemStyle","borderWidth"],Ab=["itemStyle","gapWidth"],Lb=["upperLabel","show"],kb=["upperLabel","height"];
  9209. /**
  9210. * @public
  9211. */
  9212. const Pb={seriesType:"treemap",reset:function(t,e,n,i){
  9213. // Layout result in each node:
  9214. // {x, y, width, height, area, borderWidth}
  9215. var o=n.getWidth(),r=n.getHeight(),a=t.option,s=xa(t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),l=a.size||[],u=je(Db(s.width,l[0]),o),c=je(Db(s.height,l[1]),r),d=i&&i.type,h=A_(i,["treemapZoomToNode","treemapRootToNode"],t),f="treemapRender"===d||"treemapMove"===d?i.rootRect:null,g=t.getViewRoot(),y=L_(g);if("treemapMove"!==d){var m="treemapZoomToNode"===d?
  9216. // Return [containerWidth, containerHeight] as default.
  9217. function(t,e,n,i,o){
  9218. // If targetInfo.node exists, we zoom to the node,
  9219. // so estimate whole width and height by target node.
  9220. var r,a=(e||{}).node,s=[i,o];if(!a||a===n)return s;var l=i*o,u=l*t.option.zoomToNodeRatio;for(;r=a.parentNode;){for(
  9221. // jshint ignore:line
  9222. var c=0,d=r.children,h=0,p=d.length;h<p;h++)c+=d[h].getValue();var f=a.getValue();if(0===f)return s;u*=c/f;
  9223. // Considering border, suppose aspect ratio is 1.
  9224. var g=r.getModel(),y=g.get(Cb);(u+=4*y*y+(3*y+Math.max(y,Vb(g)))*Math.pow(u,.5))>nn&&(u=nn),a=r}u<l&&(u=l);var m=Math.pow(u/l,.5);return[i*m,o*m]}
  9225. // Root position based on coord of containerGroup
  9226. (t,h,g,u,c):f?[f.width,f.height]:[u,c],v=a.sort;v&&"asc"!==v&&"desc"!==v&&(
  9227. // Default to be desc order.
  9228. v="desc");var x={squareRatio:a.squareRatio,sort:v,leafDepth:a.leafDepth};
  9229. // layout should be cleared because using updateView but not update.
  9230. g.hostTree.clearLayouts();
  9231. // TODO
  9232. // optimize: if out of view clip, do not layout.
  9233. // But take care that if do not render node out of view clip,
  9234. // how to calculate start po
  9235. var _={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};g.setLayout(_),Nb(g,x,!1,0),
  9236. // Supplement layout.
  9237. _=g.getLayout(),Tb(y,(function(t,e){var n=(y[e+1]||g).getValue();t.setLayout(p({dataExtent:[n,n],borderWidth:0,upperHeight:0},_))}))}var b=t.getData().tree.root;b.setLayout(function(t,e,n){if(e)return{x:e.x,y:e.y};var i={x:0,y:0};if(!n)return i;
  9238. // If targetInfo is fetched by 'retrieveTargetInfo',
  9239. // old tree and new tree are the same tree,
  9240. // so the node still exists and we can visit it.
  9241. var o=n.node,r=o.getLayout();if(!r)return i;
  9242. // Transform coord from local to container.
  9243. var a=[r.width/2,r.height/2],s=o;for(;s;){var l=s.getLayout();a[0]+=l.x,a[1]+=l.y,s=s.parentNode}return{x:t.width/2-a[0],y:t.height/2-a[1]}}
  9244. // Mark nodes visible for prunning when visual coding and rendering.
  9245. // Prunning depends on layout and root position, so we have to do it after layout.
  9246. (s,f,h),!0),t.setLayoutInfo(s),
  9247. // FIXME
  9248. // 现在没有clip功能,暂时取ec高宽。
  9249. Eb(b,
  9250. // Transform to base element coordinate system.
  9251. new Y(-s.x,-s.y,o,r),y,g,0)}};
  9252. /**
  9253. * Layout treemap with squarify algorithm.
  9254. * The original presentation of this algorithm
  9255. * was made by Mark Bruls, Kees Huizing, and Jarke J. van Wijk
  9256. * <https://graphics.ethz.ch/teaching/scivis_common/Literature/squarifiedTreeMaps.pdf>.
  9257. * The implementation of this algorithm was originally copied from "d3.js"
  9258. * <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/layout/treemap.js>
  9259. * with some modifications made for this program.
  9260. * See the license statement at the head of this file.
  9261. *
  9262. * @protected
  9263. * @param {module:echarts/data/Tree~TreeNode} node
  9264. * @param {Object} options
  9265. * @param {string} options.sort 'asc' or 'desc'
  9266. * @param {number} options.squareRatio
  9267. * @param {boolean} hideChildren
  9268. * @param {number} depth
  9269. */function Nb(t,e,n,i){var o,r;if(!t.isRemoved()){var a=t.getLayout();o=a.width,r=a.height;
  9270. // Considering border and gap
  9271. var s=t.getModel(),l=s.get(Cb),u=s.get(Ab)/2,c=Vb(s),d=Math.max(l,c),h=l-u,p=d-u;t.setLayout({borderWidth:l,upperHeight:d,upperLabelHeight:c},!0);var f=(o=Mb(o-2*h,0))*(r=Mb(r-h-p,0)),g=
  9272. /**
  9273. * Set area to each child, and calculate data extent for visual coding.
  9274. */
  9275. function(t,e,n,i,o,r){var a=t.children||[],s=i.sort;"asc"!==s&&"desc"!==s&&(s=null);var l=null!=i.leafDepth&&i.leafDepth<=r;
  9276. // leafDepth has higher priority.
  9277. if(o&&!l)return t.viewChildren=[];
  9278. // Sort children, order by desc.
  9279. a=st(a,(function(t){return!t.isRemoved()})),
  9280. /**
  9281. * Sort
  9282. */
  9283. function(t,e){e&&t.sort((function(t,n){var i="asc"===e?t.getValue()-n.getValue():n.getValue()-t.getValue();return 0===i?"asc"===e?t.dataIndex-n.dataIndex:n.dataIndex-t.dataIndex:i}))}
  9284. /**
  9285. * Statistic
  9286. */(a,s);var u=function(t,e,n){for(
  9287. // Calculate sum.
  9288. var i=0,o=0,r=e.length;o<r;o++)i+=e[o].getValue();
  9289. // Statistic data extent for latter visual coding.
  9290. // Notice: data extent should be calculate based on raw children
  9291. // but not filtered view children, otherwise visual mapping will not
  9292. // be stable when zoom (where children is filtered by visibleMin).
  9293. var a,s=t.get("visualDimension");
  9294. // The same as area dimension.
  9295. e&&e.length?"value"===s&&n?(a=[e[e.length-1].getValue(),e[0].getValue()],"asc"===n&&a.reverse()):(a=[Infinity,-Infinity],Tb(e,(function(t){var e=t.getValue(s);e<a[0]&&(a[0]=e),e>a[1]&&(a[1]=e)}))):a=[NaN,NaN];return{sum:i,dataExtent:a}}
  9296. /**
  9297. * Computes the score for the specified row,
  9298. * as the worst aspect ratio.
  9299. */(e,a,s);if(0===u.sum)return t.viewChildren=[];if(u.sum=
  9300. /**
  9301. * Consider 'visibleMin'. Modify viewChildren and get new sum.
  9302. */
  9303. function(t,e,n,i,o){
  9304. // visibleMin is not supported yet when no option.sort.
  9305. if(!i)return n;
  9306. // Always travel from little value to big value.
  9307. for(var r=t.get("visibleMin"),a=o.length,s=a,l=a-1;l>=0;l--){var u=o["asc"===i?a-l-1:l].getValue();u/n*e<r&&(s=l,n-=u)}return"asc"===i?o.splice(0,a-s):o.splice(s,a-s),n}(e,n,u.sum,s,a),0===u.sum)return t.viewChildren=[];
  9308. // Set area to each child.
  9309. for(var c=0,d=a.length;c<d;c++){var h=a[c].getValue()/u.sum*n;
  9310. // Do not use setLayout({...}, true), because it is needed to clear last layout.
  9311. a[c].setLayout({area:h})}l&&(a.length&&t.setLayout({isLeafRoot:!0},!0),a.length=0);return t.viewChildren=a,t.setLayout({dataExtent:u.dataExtent},!0),a}(t,s,f,e,n,i);if(g.length){var y={x:h,y:p,width:o,height:r},m=Ib(o,r),v=Infinity,x=[];x.area=0;for(var _=0,b=g.length;_<b;){var S=g[_];x.push(S),x.area+=S.getLayout().area;var w=Ob(x,m,e.squareRatio);
  9312. // continue with this orientation
  9313. w<=v?(_++,v=w):(x.area-=x.pop().getLayout().area,Rb(x,m,y,u,!1),m=Ib(y.width,y.height),x.length=x.area=0,v=Infinity)}if(x.length&&Rb(x,m,y,u,!0),!n){var M=s.get("childrenVisibleMin");null!=M&&f<M&&(n=!0)}for(_=0,b=g.length;_<b;_++)Nb(g[_],e,n,i+1)}}}function Ob(t,e,n){for(var i=0,o=Infinity,r=0,a=void 0,s=t.length;r<s;r++)(a=t[r].getLayout().area)&&(a<o&&(o=a),a>i&&(i=a));var l=t.area*t.area,u=e*e*n;return l?Mb(u*i/l,l/(u*o)):Infinity}
  9314. /**
  9315. * Positions the specified row of nodes. Modifies `rect`.
  9316. */function Rb(t,e,n,i,o){
  9317. // When rowFixedLength === rect.width,
  9318. // it is horizontal subdivision,
  9319. // rowFixedLength is the width of the subdivision,
  9320. // rowOtherLength is the height of the subdivision,
  9321. // and nodes will be positioned from left to right.
  9322. // wh[idx0WhenH] means: when horizontal,
  9323. // wh[idx0WhenH] => wh[0] => 'width'.
  9324. // xy[idx1WhenH] => xy[1] => 'y'.
  9325. var r=e===n.width?0:1,a=1-r,s=["x","y"],l=["width","height"],u=n[s[r]],c=e?t.area/e:0;(o||c>n[l[a]])&&(c=n[l[a]]);for(var d=0,h=t.length;d<h;d++){var p=t[d],f={},g=c?p.getLayout().area/c:0,y=f[l[a]]=Mb(c-2*i,0),m=n[s[r]]+n[l[r]]-u,v=d===h-1||m<g?m:g,x=f[l[r]]=Mb(v-2*i,0);f[s[a]]=n[s[a]]+Ib(i,y/2),f[s[r]]=u+Ib(i,x/2),u+=v,p.setLayout(f,!0)}n[s[a]]+=c,n[l[a]]-=c}function Eb(t,e,n,i,o){var r=t.getLayout(),a=n[o],s=a&&a===t;if(!(a&&!s||o===n.length&&t!==i)){t.setLayout({
  9326. // isInView means: viewRoot sub tree + viewAbovePath
  9327. isInView:!0,
  9328. // invisible only means: outside view clip so that the node can not
  9329. // see but still layout for animation preparation but not render.
  9330. invisible:!s&&!e.intersect(r),isAboveViewRoot:s},!0);
  9331. // Transform to child coordinate.
  9332. var l=new Y(e.x-r.x,e.y-r.y,e.width,e.height);Tb(t.viewChildren||[],(function(t){Eb(t,l,n,i,o+1)}))}}function Vb(t){return t.get(Lb)?t.get(kb):0}function zb(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.eachSeriesByType("graph",(function(t){var n=t.getCategoriesData(),i=t.getGraph().data,o=n.mapArray(n.getName);i.filterSelf((function(t){var n=i.getItemModel(t).getShallow("category");if(null!=n){l(n)&&(n=o[n]);
  9333. // If in any legend component the status is not selected.
  9334. for(var r=0;r<e.length;r++)if(!e[r].isSelected(n))return!1}return!0}))}))}function Bb(e){var n={};e.eachSeriesByType("graph",(function(e){var i=e.getCategoriesData(),o=e.getData(),r={};i.each((function(t){var o=i.getName(t);
  9335. // Add prefix to avoid conflict with Object.prototype.
  9336. r["ec-"+o]=t;var a=i.getItemModel(t),s=a.getModel("itemStyle").getItemStyle();s.fill||(
  9337. // Get color from palette.
  9338. s.fill=e.getColorFromPalette(o,n)),i.setItemVisual(t,"style",s);for(var l=["symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++){var c=a.getShallow(l[u],!0);null!=c&&i.setItemVisual(t,l[u],c)}})),
  9339. // Assign category color to visual
  9340. i.count()&&o.each((function(e){var n=o.getItemModel(e).getShallow("category");if(null!=n){t(n)&&(n=r["ec-"+n]);var a=i.getItemVisual(n,"style"),s=o.ensureUniqueItemVisual(e,"style");p(s,a);for(var l=["symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++)o.setItemVisual(e,l[u],i.getItemVisual(n,l[u]))}}))}))}function Gb(t){return t instanceof Array||(t=[t,t]),t}function Fb(t){t.eachSeriesByType("graph",(function(t){var e=t.getGraph(),n=t.getEdgeData(),i=Gb(t.get("edgeSymbol")),o=Gb(t.get("edgeSymbolSize"));
  9341. // const colorQuery = ['lineStyle', 'color'] as const;
  9342. // const opacityQuery = ['lineStyle', 'opacity'] as const;
  9343. n.setVisual("fromSymbol",i&&i[0]),n.setVisual("toSymbol",i&&i[1]),n.setVisual("fromSymbolSize",o&&o[0]),n.setVisual("toSymbolSize",o&&o[1]),n.setVisual("style",t.getModel("lineStyle").getLineStyle()),n.each((function(t){var i=n.getItemModel(t),o=e.getEdgeByIndex(t),r=Gb(i.getShallow("symbol",!0)),a=Gb(i.getShallow("symbolSize",!0)),s=i.getModel("lineStyle").getLineStyle(),l=n.ensureUniqueItemVisual(t,"style");switch(p(l,s),l.stroke){case"source":var u=o.node1.getVisual("style");l.stroke=u&&u.fill;break;case"target":u=o.node2.getVisual("style");l.stroke=u&&u.fill}r[0]&&o.setVisual("fromSymbol",r[0]),r[1]&&o.setVisual("toSymbol",r[1]),a[0]&&o.setVisual("fromSymbolSize",a[0]),a[1]&&o.setVisual("toSymbolSize",a[1])}))}))}var Wb="--\x3e",Hb=function(t){return t.get("autoCurveness")||null},Yb=function(t,e){var n=Hb(t),o=20,r=[];
  9344. // handler the function set
  9345. if(l(n))o=n;else if(i(n))return void(t.__curvenessList=n);
  9346. // append length
  9347. e>o&&(o=e);
  9348. // make sure the length is even
  9349. var a=o%2?o+2:o+3;r=[];for(var s=0;s<a;s++)r.push((s%2?s+1:s)/10*(s%2?-1:1));t.__curvenessList=r},Ub=function(t,e,n){var i=[t.id,t.dataIndex].join("."),o=[e.id,e.dataIndex].join(".");return[n.uid,i,o].join(Wb)},Zb=function(t){var e=t.split(Wb);return[e[0],e[2],e[1]].join(Wb)},Xb=function(t,e){var n=e.__edgeMap;return n[t]?n[t].length:0};
  9350. /**
  9351. * params handler
  9352. * @param {module:echarts/model/SeriesModel} seriesModel
  9353. * @returns {*}
  9354. */
  9355. /**
  9356. * get curvature for edge
  9357. * @param edge
  9358. * @param {module:echarts/model/SeriesModel} seriesModel
  9359. * @param index
  9360. */
  9361. function jb(t,e,n,o){var r=Hb(e),a=i(r);if(!r)return null;var s=function(t,e){var n=Ub(t.node1,t.node2,e);return e.__edgeMap[n]}(t,e);if(!s)return null;for(var l=-1,u=0;u<s.length;u++)if(s[u]===n){l=u;break}
  9362. // if totalLen is Longer createCurveness
  9363. var c=function(t,e){return Xb(Ub(t.node1,t.node2,e),e)+Xb(Ub(t.node2,t.node1,e),e)}(t,e);Yb(e,c),t.lineStyle=t.lineStyle||{};
  9364. // if is opposite edge, must set curvenss to opposite number
  9365. var d=Ub(t.node1,t.node2,e),h=e.__curvenessList,p=a||c%2?0:1;if(s.isForward)return h[p+l];
  9366. // the opposite edge show outside
  9367. var f=Zb(d),g=Xb(f,e),y=h[l+g+p];
  9368. // isNeedReverse, simple, force type need reverse the curveness in the junction of the forword and the opposite
  9369. return o?
  9370. // set as array may make the parity handle with the len of opposite
  9371. a?r&&0===r[0]?(g+p)%2?y:-y:((g%2?0:1)+p)%2?y:-y:(g+p)%2?y:-y:h[l+g+p]}function qb(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var n=t.getGraph();n.eachNode((function(t){var e=t.getModel();t.setLayout([+e.get("x"),+e.get("y")])})),Kb(n,t)}}function Kb(t,e){t.eachEdge((function(t,n){var i=Ht(t.getModel().get(["lineStyle","curveness"]),-jb(t,e,n,!0),0),o=de(t.node1.getLayout()),r=de(t.node2.getLayout()),a=[o,r];+i&&a.push([(o[0]+r[0])/2-(o[1]-r[1])*i,(o[1]+r[1])/2-(r[0]-o[0])*i]),t.setLayout(a)}))}function Jb(t,e){t.eachSeriesByType("graph",(function(t){var e=t.get("layout"),n=t.coordinateSystem;if(n&&"view"!==n.type){var i=t.getData(),o=[];a(n.dimensions,(function(t){o=o.concat(i.mapDimensionsAll(t))}));for(var r=0;r<i.count();r++){for(var s=[],l=!1,u=0;u<o.length;u++){var c=i.get(o[u],r);isNaN(c)||(l=!0),s.push(c)}l?i.setItemLayout(r,n.dataToPoint(s)):
  9372. // Also {Array.<number>}, not undefined to avoid if...else... statement
  9373. i.setItemLayout(r,[NaN,NaN])}Kb(i.graph,t)}else e&&"none"!==e||qb(t)}))}
  9374. /*
  9375. * Licensed to the Apache Software Foundation (ASF) under one
  9376. * or more contributor license agreements. See the NOTICE file
  9377. * distributed with this work for additional information
  9378. * regarding copyright ownership. The ASF licenses this file
  9379. * to you under the Apache License, Version 2.0 (the
  9380. * "License"); you may not use this file except in compliance
  9381. * with the License. You may obtain a copy of the License at
  9382. *
  9383. * http://www.apache.org/licenses/LICENSE-2.0
  9384. *
  9385. * Unless required by applicable law or agreed to in writing,
  9386. * software distributed under the License is distributed on an
  9387. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  9388. * KIND, either express or implied. See the License for the
  9389. * specific language governing permissions and limitations
  9390. * under the License.
  9391. */
  9392. /**
  9393. * AUTO-GENERATED FILE. DO NOT MODIFY.
  9394. */
  9395. /*
  9396. * Licensed to the Apache Software Foundation (ASF) under one
  9397. * or more contributor license agreements. See the NOTICE file
  9398. * distributed with this work for additional information
  9399. * regarding copyright ownership. The ASF licenses this file
  9400. * to you under the Apache License, Version 2.0 (the
  9401. * "License"); you may not use this file except in compliance
  9402. * with the License. You may obtain a copy of the License at
  9403. *
  9404. * http://www.apache.org/licenses/LICENSE-2.0
  9405. *
  9406. * Unless required by applicable law or agreed to in writing,
  9407. * software distributed under the License is distributed on an
  9408. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  9409. * KIND, either express or implied. See the License for the
  9410. * specific language governing permissions and limitations
  9411. * under the License.
  9412. */function $b(t){var e=t.coordinateSystem;if("view"!==e.type)return 1;var n=t.option.nodeScaleRatio,i=e.scaleX;return((e.getZoom()-1)*n+1)/i}function Qb(t){var e=t.getVisual("symbolSize");return e instanceof Array&&(e=(e[0]+e[1])/2),+e}var tS=Math.PI,eS=[];
  9413. /**
  9414. * `basedOn` can be:
  9415. * 'value':
  9416. * This layout is not accurate and have same bad case. For example,
  9417. * if the min value is very smaller than the max value, the nodes
  9418. * with the min value probably overlap even though there is enough
  9419. * space to layout them. So we only use this approach in the as the
  9420. * init layout of the force layout.
  9421. * FIXME
  9422. * Probably we do not need this method any more but use
  9423. * `basedOn: 'symbolSize'` in force layout if
  9424. * delay its init operations to GraphView.
  9425. * 'symbolSize':
  9426. * This approach work only if all of the symbol size calculated.
  9427. * That is, the progressive rendering is not applied to graph.
  9428. * FIXME
  9429. * If progressive rendering is applied to graph some day,
  9430. * probably we have to use `basedOn: 'value'`.
  9431. */
  9432. function nS(t,e,n,i){var o=t.coordinateSystem;if(!o||"view"===o.type){var r=o.getBoundingRect(),a=t.getData(),s=a.graph,l=r.width/2+r.x,u=r.height/2+r.y,c=Math.min(r.width,r.height)/2,d=a.count();if(a.setLayout({cx:l,cy:u}),d){if(n){var h=o.pointToData(i),p=h[0],f=h[1],g=[p-l,f-u];he(g,g),pe(g,g,c),n.setLayout([l+g[0],u+g[1]],!0),oS(n,t.get(["circular","rotateLabel"]),l,u)}iS[e](t,s,a,c,l,u,d),s.eachEdge((function(e,n){var i,o=Ht(e.getModel().get(["lineStyle","curveness"]),jb(e,t,n),0),r=de(e.node1.getLayout()),a=de(e.node2.getLayout()),s=(r[0]+a[0])/2,c=(r[1]+a[1])/2;+o&&(i=[l*(o*=3)+s*(1-o),u*o+c*(1-o)]),e.setLayout([r,a,i])}))}}}var iS={value:function(t,e,n,i,o,r,a){var s=0,l=n.getSum("value"),u=2*Math.PI/(l||a);e.eachNode((function(t){var e=t.getValue("value"),n=u*(l?e:1)/2;s+=n,t.setLayout([i*Math.cos(s)+o,i*Math.sin(s)+r]),s+=n}))},symbolSize:function(t,e,n,i,o,r,a){var s=0;eS.length=a;var l=$b(t);e.eachNode((function(t){var e=Qb(t);
  9433. // Normally this case will not happen, but we still add
  9434. // some the defensive code (2px is an arbitrary value).
  9435. isNaN(e)&&(e=2),e<0&&(e=0),e*=l;var n=Math.asin(e/2/i);
  9436. // when `symbolSize / 2` is bigger than `r`.
  9437. isNaN(n)&&(n=tS/2),eS[t.dataIndex]=n,s+=2*n}));var u=(2*tS-s)/a/2,c=0;e.eachNode((function(t){var e=u+eS[t.dataIndex];c+=e,
  9438. // init circular layout for
  9439. // 1. layout undefined node
  9440. // 2. not fixed node
  9441. (!t.getLayout()||!t.getLayout().fixed)&&t.setLayout([i*Math.cos(c)+o,i*Math.sin(c)+r]),c+=e}))}};function oS(t,e,n,i){var o=t.getGraphicEl();
  9442. // need to check if el exists. '-' value may not create node element.
  9443. if(o){var r=t.getModel().get(["label","rotate"])||0,a=o.getSymbolPath();if(e){var s=t.getLayout(),l=Math.atan2(s[1]-i,s[0]-n);l<0&&(l=2*Math.PI+l);var u=s[0]<n;u&&(l-=Math.PI);var c=u?"left":"right";a.setTextConfig({rotation:-l,position:c,origin:"center"});var d=a.ensureState("emphasis");p(d.textConfig||(d.textConfig={}),{position:c})}else a.setTextConfig({rotation:r*=Math.PI/180})}}function rS(t){t.eachSeriesByType("graph",(function(t){"circular"===t.get("layout")&&nS(t,"symbolSize")}))}var aS=ve;
  9444. // function adjacentNode(n, e) {
  9445. // return e.n1 === n ? e.n2 : e.n1;
  9446. // }
  9447. function sS(t){t.eachSeriesByType("graph",(function(t){var e=t.coordinateSystem;if(!e||"view"===e.type)if("force"===t.get("layout")){var n=t.preservedPoints||{},o=t.getGraph(),r=o.data,a=o.edgeData,s=t.getModel("force"),l=s.get("initLayout");t.preservedPoints?r.each((function(t){var e=r.getId(t);r.setItemLayout(t,n[e]||[NaN,NaN])})):l&&"none"!==l?"circular"===l&&nS(t,"value"):qb(t);var u=r.getDataExtent("value"),c=a.getDataExtent("value"),d=s.get("repulsion"),h=s.get("edgeLength"),p=i(d)?d:[d,d],f=i(h)?h:[h,h];
  9448. // Larger value has smaller length
  9449. f=[f[1],f[0]];var g=r.mapArray("value",(function(t,e){var n=r.getItemLayout(e),i=Xe(t,u,p);return isNaN(i)&&(i=(p[0]+p[1])/2),{w:i,rep:i,fixed:r.getItemModel(e).get("fixed"),p:!n||isNaN(n[0])||isNaN(n[1])?null:n}})),y=a.mapArray("value",(function(e,n){var i=o.getEdgeByIndex(n),r=Xe(e,c,f);isNaN(r)&&(r=(f[0]+f[1])/2);var a=i.getModel(),s=Ht(i.getModel().get(["lineStyle","curveness"]),-jb(i,t,n,!0),0);return{n1:g[i.node1.dataIndex],n2:g[i.node2.dataIndex],d:r,curveness:s,ignoreForceLayout:a.get("ignoreForceLayout")}})),m=e.getBoundingRect(),v=function(t,e,n){
  9450. // for (let i = 0; i < edges.length; i++) {
  9451. // let e = edges[i];
  9452. // let n1 = e.n1;
  9453. // let n2 = e.n2;
  9454. // n1.edges = n1.edges || [];
  9455. // n2.edges = n2.edges || [];
  9456. // n1.edges.push(e);
  9457. // n2.edges.push(e);
  9458. // }
  9459. // Init position
  9460. for(var i=t,o=e,r=n.rect,a=r.width,s=r.height,l=[r.x+a/2,r.y+s/2],u=null==n.gravity?.1:n.gravity,c=0;c<i.length;c++){var d=i[c];d.p||(d.p=fe(a*(Math.random()-.5)+l[0],s*(Math.random()-.5)+l[1])),d.pp=de(d.p),d.edges=null}
  9461. // Formula in 'Graph Drawing by Force-directed Placement'
  9462. // let k = scale * Math.sqrt(width * height / nodes.length);
  9463. // let k2 = k * k;
  9464. var h,p,f=null==n.friction?.6:n.friction,g=f;return{warmUp:function(){g=.8*f},setFixed:function(t){i[t].fixed=!0},setUnfixed:function(t){i[t].fixed=!1},
  9465. /**
  9466. * Before step hook
  9467. */
  9468. beforeStep:function(t){h=t},
  9469. /**
  9470. * After step hook
  9471. */
  9472. afterStep:function(t){p=t},
  9473. /**
  9474. * Some formulas were originally copied from "d3.js"
  9475. * https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js
  9476. * with some modifications made for this project.
  9477. * See the license statement at the head of this file.
  9478. */
  9479. step:function(t){h&&h(i,o);for(var e=[],n=i.length,r=0;r<o.length;r++){var a=o[r];if(!a.ignoreForceLayout){var s=a.n1,c=a.n2;ge(e,c.p,s.p);var d=ye(e)-a.d,f=c.w/(s.w+c.w);isNaN(f)&&(f=0),he(e,e),!s.fixed&&aS(s.p,s.p,e,f*d*g),!c.fixed&&aS(c.p,c.p,e,-(1-f)*d*g)}}
  9480. // Gravity
  9481. for(r=0;r<n;r++)(x=i[r]).fixed||(ge(e,l,x.p),
  9482. // let d = vec2.len(v12);
  9483. // vec2.scale(v12, v12, 1 / d);
  9484. // let gravityFactor = gravity;
  9485. aS(x.p,x.p,e,u*g));
  9486. // Repulsive
  9487. // PENDING
  9488. for(r=0;r<n;r++){s=i[r];for(var y=r+1;y<n;y++){c=i[y],ge(e,c.p,s.p),0===(d=ye(e))&&(
  9489. // Random repulse
  9490. me(e,Math.random()-.5,Math.random()-.5),d=1);var m=(s.rep+c.rep)/d/d;!s.fixed&&aS(s.pp,s.pp,e,m),!c.fixed&&aS(c.pp,c.pp,e,-m)}}var v=[];for(r=0;r<n;r++){var x;(x=i[r]).fixed||(ge(v,x.p,x.pp),aS(x.p,x.p,v,g),ee(x.pp,x.p))}var _=(g*=.992)<.01;p&&p(i,o,_),t&&t(_)}}}(g,y,{rect:m,gravity:s.get("gravity"),friction:s.get("friction")});v.beforeStep((function(t,e){for(var n=0,i=t.length;n<i;n++)t[n].fixed&&
  9491. // Write back to layout instance
  9492. ee(t[n].p,o.getNodeByIndex(n).getLayout())})),v.afterStep((function(t,e,i){for(var a=0,s=t.length;a<s;a++)t[a].fixed||o.getNodeByIndex(a).setLayout(t[a].p),n[r.getId(a)]=t[a].p;for(a=0,s=e.length;a<s;a++){var l=e[a],u=o.getEdgeByIndex(a),c=l.n1.p,d=l.n2.p,h=u.getLayout();(h=h?h.slice():[])[0]=h[0]||[],h[1]=h[1]||[],ee(h[0],c),ee(h[1],d),+l.curveness&&(h[2]=[(c[0]+d[0])/2-(c[1]-d[1])*l.curveness,(c[1]+d[1])/2-(d[0]-c[0])*l.curveness]),u.setLayout(h)}})),t.forceLayout=v,t.preservedPoints=n,
  9493. // Step to get the layout
  9494. v.step()}else
  9495. // Remove prev injected forceLayout instance
  9496. t.forceLayout=null}))}function lS(t,e){var n=[];return t.eachSeriesByType("graph",(function(t){var i=t.get("coordinateSystem");if(!i||"view"===i){var o=t.getData(),r=o.mapArray((function(t){var e=o.getItemModel(t);return[+e.get("x"),+e.get("y")]})),a=[],s=[];ie(r,a,s),
  9497. // If width or height is 0
  9498. s[0]-a[0]==0&&(s[0]+=1,a[0]-=1),s[1]-a[1]==0&&(s[1]+=1,a[1]-=1);var l=(s[0]-a[0])/(s[1]-a[1]),u=function(t,e,n){return xa(p(t.getBoxLayoutParams(),{aspect:n}),{width:e.getWidth(),height:e.getHeight()})}(t,e,l);
  9499. // FIXME If get view rect after data processed?
  9500. // Position may be NaN, use view rect instead
  9501. isNaN(l)&&(a=[u.x,u.y],s=[u.x+u.width,u.y+u.height]);var c=s[0]-a[0],d=s[1]-a[1],h=u.width,f=u.height,g=t.coordinateSystem=new Ex;g.zoomLimit=t.get("scaleLimit"),g.setBoundingRect(a[0],a[1],c,d),g.setViewRect(u.x,u.y,h,f),
  9502. // Update roam info
  9503. g.setCenter(t.get("center"),e),g.setZoom(t.get("zoom")),n.push(g)}})),n}var uS=F.prototype,cS=W.prototype,dS=function(){
  9504. // Start point
  9505. this.x1=0,this.y1=0,
  9506. // End point
  9507. this.x2=0,this.y2=0,this.percent=1};function hS(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}
  9508. /** @class */!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Ue(e,t)}(dS);const pS=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-line",n}return Ue(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new dS},e.prototype.buildPath=function(t,e){hS(e)?uS.buildPath.call(this,t,e):cS.buildPath.call(this,t,e)},e.prototype.pointAt=function(t){return hS(this.shape)?uS.pointAt.call(this,t):cS.pointAt.call(this,t)},e.prototype.tangentAt=function(t){var e=this.shape,n=hS(e)?[e.x2-e.x1,e.y2-e.y1]:cS.tangentAt.call(this,t);return he(n,n)},e}(g);var fS=["fromSymbol","toSymbol"];function gS(t){return"_"+t+"Type"}function yS(t,e,n){var i=e.getItemVisual(n,t);if(!i||"none"===i)return i;var o=e.getItemVisual(n,t+"Size"),r=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Fc(o);return i+l+Wc(a||0,l)+(r||"")+(s||"")}
  9509. /**
  9510. * @inner
  9511. */function mS(t,e,n){var i=e.getItemVisual(n,t);if(i&&"none"!==i){var o=e.getItemVisual(n,t+"Size"),r=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Fc(o),u=Wc(a||0,l),c=Gc(i,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return c.__specifiedRotation=null==r||isNaN(r)?void 0:+r*Math.PI/180||0,c.name=t,c}}function vS(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;var n=e[2];n?(t.cpx1=n[0],t.cpy1=n[1]):(t.cpx1=NaN,t.cpy1=NaN)}var xS=/** @class */function(t){function e(e,n,i){var o=t.call(this)||this;return o._createLine(e,n,i),o}return Ue(e,t),e.prototype._createLine=function(t,e,n){var i=t.hostModel,o=function(t){var e=new pS({name:"line",subPixelOptimize:!0});return vS(e.shape,t),e}(t.getItemLayout(e));o.shape.percent=0,oo(o,{shape:{percent:1}},i,e),this.add(o),a(fS,(function(n){var i=mS(n,t,e);
  9512. // symbols must added after line to make sure
  9513. // it will be updated after line#update.
  9514. // Or symbol position and rotation update in line#beforeUpdate will be one frame slow
  9515. this.add(i),this[gS(n)]=yS(n,t,e)}),this),this._updateCommonStl(t,e,n)},
  9516. // TODO More strict on the List type in parameters?
  9517. e.prototype.updateData=function(t,e,n){var i=t.hostModel,o=this.childOfName("line"),r=t.getItemLayout(e),s={shape:{}};vS(s.shape,r),io(o,s,i,e),a(fS,(function(n){var i=yS(n,t,e),o=gS(n);
  9518. // Symbol changed
  9519. if(this[o]!==i){this.remove(this.childOfName(n));var r=mS(n,t,e);this.add(r)}this[o]=i}),this),this._updateCommonStl(t,e,n)},e.prototype.getLinePath=function(){return this.childAt(0)},e.prototype._updateCommonStl=function(t,e,n){var o=t.hostModel,r=this.childOfName("line"),s=n&&n.emphasisLineStyle,l=n&&n.blurLineStyle,u=n&&n.selectLineStyle,c=n&&n.labelStatesModels,d=n&&n.emphasisDisabled,h=n&&n.focus,p=n&&n.blurScope;
  9520. // Optimization for large dataset
  9521. if(!n||t.hasItemOption){var f=t.getItemModel(e),g=f.getModel("emphasis");s=g.getModel("lineStyle").getLineStyle(),l=f.getModel(["blur","lineStyle"]).getLineStyle(),u=f.getModel(["select","lineStyle"]).getLineStyle(),d=g.get("disabled"),h=g.get("focus"),p=g.get("blurScope"),c=Uo(f)}var y=t.getItemVisual(e,"style"),m=y.stroke;r.useStyle(y),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=s,r.ensureState("blur").style=l,r.ensureState("select").style=u,
  9522. // Update symbol
  9523. a(fS,(function(t){var e=this.childOfName(t);if(e){
  9524. // Share opacity and color with line.
  9525. e.setColor(m),e.style.opacity=y.opacity;for(var n=0;n<li.length;n++){var i=li[n],o=r.getState(i);if(o){var a=o.style||{},s=e.ensureState(i),l=s.style||(s.style={});null!=a.stroke&&(l[e.__isEmptyBrush?"stroke":"fill"]=a.stroke),null!=a.opacity&&(l.opacity=a.opacity)}}e.markRedraw()}}),this);var v=o.getRawValue(e);Yo(this,c,{labelDataIndex:e,labelFetcher:{getFormattedLabel:function(e,n){return o.getFormattedLabel(e,n,t.dataType)}},inheritColor:m||"#000",defaultOpacity:y.opacity,defaultText:(null==v?t.getName(e):isFinite(v)?qe(v):v)+""});var x=this.getTextContent();
  9526. // Always set `textStyle` even if `normalStyle.text` is null, because default
  9527. // values have to be set on `normalStyle`.
  9528. if(x){var _=c.normal;x.__align=x.style.align,x.__verticalAlign=x.style.verticalAlign,
  9529. // 'start', 'middle', 'end'
  9530. x.__position=_.get("position")||"middle";var b=_.get("distance");i(b)||(b=[b,b]),x.__labelDistance=b}this.setTextConfig({position:null,local:!0,inside:!1}),Ui(this,h,p,d)},e.prototype.highlight=function(){ki(this)},e.prototype.downplay=function(){Pi(this)},e.prototype.updateLayout=function(t,e){this.setLinePoints(t.getItemLayout(e))},e.prototype.setLinePoints=function(t){var e=this.childOfName("line");vS(e.shape,t),e.dirty()},e.prototype.beforeUpdate=function(){var t=this,e=t.childOfName("fromSymbol"),n=t.childOfName("toSymbol"),i=t.getTextContent();
  9531. // Quick reject
  9532. if(e||n||i&&!i.ignore){for(var o=1,r=this.parent;r;)r.scaleX&&(o/=r.scaleX),r=r.parent;var a=t.childOfName("line");
  9533. // If line not changed
  9534. // FIXME Parent scale changed
  9535. if(this.__dirty||a.__dirty){var s=a.shape.percent,l=a.pointAt(0),u=a.pointAt(s),c=ge([],u,l);if(he(c,c),e&&(e.setPosition(l),w(e,0),e.scaleX=e.scaleY=o*s,e.markRedraw()),n&&(n.setPosition(u),w(n,1),n.scaleX=n.scaleY=o*s,n.markRedraw()),i&&!i.ignore){i.x=i.y=0,i.originX=i.originY=0;var d=void 0,h=void 0,p=i.__labelDistance,f=p[0]*o,g=p[1]*o,y=s/2,m=a.tangentAt(y),v=[m[1],-m[0]],x=a.pointAt(y);v[1]>0&&(v[0]=-v[0],v[1]=-v[1]);var _=m[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var b=-Math.atan2(m[1],m[0]);u[0]<l[0]&&(b=Math.PI+b),i.rotation=b}var S=void 0;switch(i.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":S=-g,h="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":S=g,h="top";break;default:S=0,h="middle"}switch(i.__position){case"end":i.x=c[0]*f+u[0],i.y=c[1]*g+u[1],d=c[0]>.8?"left":c[0]<-.8?"right":"center",h=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":i.x=-c[0]*f+l[0],i.y=-c[1]*g+l[1],d=c[0]>.8?"right":c[0]<-.8?"left":"center",h=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=f*_+l[0],i.y=l[1]+S,d=m[0]<0?"right":"left",i.originX=-f*_,i.originY=-S;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=x[0],i.y=x[1]+S,d="center",i.originY=-S;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-f*_+u[0],i.y=u[1]+S,d=m[0]>=0?"right":"left",i.originX=f*_,i.originY=-S}i.scaleX=i.scaleY=o,i.setStyle({
  9536. // Use the user specified text align and baseline first
  9537. verticalAlign:i.__verticalAlign||h,align:i.__align||d})}}}function w(t,e){
  9538. // Fix #12388
  9539. // when symbol is set to be 'arrow' in markLine,
  9540. // symbolRotate value will be ignored, and compulsively use tangent angle.
  9541. // rotate by default if symbol rotation is not specified
  9542. var n=t.__specifiedRotation;if(null==n){var i=a.tangentAt(e);t.attr("rotation",(1===e?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else t.attr("rotation",n)}},e}(Z);const _S=xS;function bS(t){var e=t.hostModel,n=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:Uo(e)}}function SS(t){return isNaN(t[0])||isNaN(t[1])}function wS(t){return t&&!SS(t[0])&&!SS(t[1])}const MS=/** @class */function(){function t(t){this.group=new Z,this._LineCtor=t||_S}return t.prototype.updateData=function(t){var e=this;
  9543. // Remove progressive els.
  9544. this._progressiveEls=null;var n=this,i=n.group,o=n._lineData;n._lineData=t,
  9545. // There is no oldLineData only when first rendering or switching from
  9546. // stream mode to normal mode, where previous elements should be removed.
  9547. o||i.removeAll();var r=bS(t);t.diff(o).add((function(n){e._doAdd(t,n,r)})).update((function(n,i){e._doUpdate(o,t,i,n,r)})).remove((function(t){i.remove(o.getItemGraphicEl(t))})).execute()},t.prototype.updateLayout=function(){var t=this._lineData;
  9548. // Do not support update layout in incremental mode.
  9549. t&&t.eachItemGraphicEl((function(e,n){e.updateLayout(t,n)}),this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=bS(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function n(t){t.isGroup||function(t){return t.animators&&t.animators.length>0}(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=t.start;i<t.end;i++){if(wS(e.getItemLayout(i))){var o=new this._LineCtor(e,i,this._seriesScope);o.traverse(n),this.group.add(o),e.setItemGraphicEl(i,o),this._progressiveEls.push(o)}}},t.prototype.remove=function(){this.group.removeAll()},t.prototype.eachRendered=function(t){Bo(this._progressiveEls||this.group,t)},t.prototype._doAdd=function(t,e,n){if(wS(t.getItemLayout(e))){var i=new this._LineCtor(t,e,n);t.setItemGraphicEl(e,i),this.group.add(i)}},t.prototype._doUpdate=function(t,e,n,i,o){var r=t.getItemGraphicEl(n);wS(e.getItemLayout(i))?(r?r.updateData(e,i,o):r=new this._LineCtor(e,i,o),e.setItemGraphicEl(i,r),this.group.add(r)):this.group.remove(r)},t}();var IS=[],DS=[],TS=[],CS=_e,AS=be,LS=Math.abs;function kS(t,e,n){for(var i,o=t[0],r=t[1],a=t[2],s=Infinity,l=n*n,u=.1,c=.1;c<=.9;c+=.1){IS[0]=CS(o[0],r[0],a[0],c),IS[1]=CS(o[1],r[1],a[1],c),(p=LS(AS(IS,e)-l))<s&&(s=p,i=c)}
  9550. // Assume the segment is monotone,Find root through Bisection method
  9551. // At most 32 iteration
  9552. for(var d=0;d<32;d++){
  9553. // let prev = t - interval;
  9554. var h=i+u;
  9555. // v1[0] = quadraticAt(p0[0], p1[0], p2[0], prev);
  9556. // v1[1] = quadraticAt(p0[1], p1[1], p2[1], prev);
  9557. DS[0]=CS(o[0],r[0],a[0],i),DS[1]=CS(o[1],r[1],a[1],i),TS[0]=CS(o[0],r[0],a[0],h),TS[1]=CS(o[1],r[1],a[1],h);var p=AS(DS,e)-l;if(LS(p)<.01)break;
  9558. // let prevDiff = v2DistSquare(v1, center) - radiusSquare;
  9559. var f=AS(TS,e)-l;u/=2,p<0?f>=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}
  9560. // Adjust edge to avoid
  9561. function PS(t,e){var n=[],i=xe,o=[[],[],[]],r=[[],[]],a=[];e/=2,t.eachEdge((function(t,s){var l=t.getLayout(),u=t.getVisual("fromSymbol"),c=t.getVisual("toSymbol");l.__original||(l.__original=[de(l[0]),de(l[1])],l[2]&&l.__original.push(de(l[2])));var d=l.__original;
  9562. // Quadratic curve
  9563. if(null!=l[2]){if(ee(o[0],d[0]),ee(o[1],d[2]),ee(o[2],d[1]),u&&"none"!==u){var h=Qb(t.node1),p=kS(o,d[0],h*e);
  9564. // Subdivide and get the second
  9565. i(o[0][0],o[1][0],o[2][0],p,n),o[0][0]=n[3],o[1][0]=n[4],i(o[0][1],o[1][1],o[2][1],p,n),o[0][1]=n[3],o[1][1]=n[4]}if(c&&"none"!==c){h=Qb(t.node2),p=kS(o,d[1],h*e);
  9566. // Subdivide and get the first
  9567. i(o[0][0],o[1][0],o[2][0],p,n),o[1][0]=n[1],o[2][0]=n[2],i(o[0][1],o[1][1],o[2][1],p,n),o[1][1]=n[1],o[2][1]=n[2]}
  9568. // Copy back to layout
  9569. ee(l[0],o[0]),ee(l[1],o[2]),ee(l[2],o[1])}
  9570. // Line
  9571. else{if(ee(r[0],d[0]),ee(r[1],d[1]),ge(a,r[1],r[0]),he(a,a),u&&"none"!==u){h=Qb(t.node1);ve(r[0],r[0],a,h*e)}if(c&&"none"!==c){h=Qb(t.node2);ve(r[1],r[1],a,-h*e)}ee(l[0],r[0]),ee(l[1],r[1])}}))}function NS(t){return"view"===t.type}var OS=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(t,e){var n=new Yg,i=new MS,o=this.group;this._controller=new Uv(e.getZr()),this._controllerHost={target:o},o.add(n.group),o.add(i.group),this._symbolDraw=n,this._lineDraw=i,this._firstRender=!0},e.prototype.render=function(t,e,n){var i=this,o=t.coordinateSystem;this._model=t;var r=this._symbolDraw,a=this._lineDraw,s=this.group;if(NS(o)){var l={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?s.attr(l):io(s,l,t)}
  9572. // Fix edge contact point with node
  9573. PS(t.getGraph(),$b(t));var u=t.getData();r.updateData(u);var c=t.getEdgeData();
  9574. // TODO: TYPE
  9575. a.updateData(c),this._updateNodeAndLinkScale(),this._updateController(t,e,n),clearTimeout(this._layoutTimeout);var d=t.forceLayout,h=t.get(["force","layoutAnimation"]);d&&this._startForceLayoutIteration(d,h);var p=t.get("layout");u.graph.eachNode((function(e){var n=e.dataIndex,o=e.getGraphicEl(),r=e.getModel();if(o){
  9576. // Update draggable
  9577. o.off("drag").off("dragend");var a=r.get("draggable");a&&o.on("drag",(function(r){switch(p){case"force":d.warmUp(),!i._layouting&&i._startForceLayoutIteration(d,h),d.setFixed(n),
  9578. // Write position back to layout
  9579. u.setItemLayout(n,[o.x,o.y]);break;case"circular":u.setItemLayout(n,[o.x,o.y]),
  9580. // mark node fixed
  9581. e.setLayout({fixed:!0},!0),
  9582. // recalculate circular layout
  9583. nS(t,"symbolSize",e,[r.offsetX,r.offsetY]),i.updateLayout(t);break;default:u.setItemLayout(n,[o.x,o.y]),
  9584. // update edge
  9585. Kb(t.getGraph(),t),i.updateLayout(t)}})).on("dragend",(function(){d&&d.setUnfixed(n)})),o.setDraggable(a,!!r.get("cursor")),"adjacency"===r.get(["emphasis","focus"])&&(ni(o).focus=e.getAdjacentDataIndices())}})),u.graph.eachEdge((function(t){var e=t.getGraphicEl(),n=t.getModel().get(["emphasis","focus"]);e&&"adjacency"===n&&(ni(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})}));var f="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),g=u.getLayout("cx"),y=u.getLayout("cy");u.graph.eachNode((function(t){oS(t,f,g,y)})),this._firstRender=!1},e.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,e){var n=this;!function i(){t.step((function(t){n.updateLayout(n._model),(n._layouting=!t)&&(e?n._layoutTimeout=setTimeout(i,16):i())}))}()},e.prototype._updateController=function(t,e,n){var i=this,o=this._controller,r=this._controllerHost,a=this.group;o.setPointerChecker((function(e,i,o){var r=a.getBoundingRect();return r.applyTransform(a.transform),r.contain(i,o)&&!qv(e,n,t)})),NS(t.coordinateSystem)?(o.enable(t.get("roam")),r.zoomLimit=t.get("scaleLimit"),r.zoom=t.coordinateSystem.getZoom(),o.off("pan").off("zoom").on("pan",(function(e){Zv(r,e.dx,e.dy),n.dispatchAction({seriesId:t.id,type:"graphRoam",dx:e.dx,dy:e.dy})})).on("zoom",(function(e){Xv(r,e.scale,e.originX,e.originY),n.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),i._updateNodeAndLinkScale(),PS(t.getGraph(),$b(t)),i._lineDraw.updateLayout(),
  9586. // Only update label layout on zoom
  9587. n.updateLabelLayout()}))):o.disable()},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,e=t.getData(),n=$b(t);e.eachItemGraphicEl((function(t,e){t&&t.setSymbolScale(n)}))},e.prototype.updateLayout=function(t){PS(t.getGraph(),$b(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(Ou);const RS=OS;
  9588. // id may be function name of Object, add a prefix to avoid this problem.
  9589. function ES(t){return"_EC_"+t}var VS=/** @class */function(){function t(t){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},
  9590. /**
  9591. * @type {Object.<string, module:echarts/data/Graph.Edge>}
  9592. * @private
  9593. */
  9594. this._edgesMap={},this._directed=t||!1}
  9595. /**
  9596. * If is directed graph
  9597. */return t.prototype.isDirected=function(){return this._directed},
  9598. /**
  9599. * Add a new node
  9600. */
  9601. t.prototype.addNode=function(t,e){t=null==t?""+e:""+t;var n=this._nodesMap;if(!n[ES(t)]){var i=new zS(t,e);return i.hostGraph=this,this.nodes.push(i),n[ES(t)]=i,i}},
  9602. /**
  9603. * Get node by data index
  9604. */
  9605. t.prototype.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},
  9606. /**
  9607. * Get node by id
  9608. */
  9609. t.prototype.getNodeById=function(t){return this._nodesMap[ES(t)]},
  9610. /**
  9611. * Add a new edge
  9612. */
  9613. t.prototype.addEdge=function(t,e,n){var i=this._nodesMap,o=this._edgesMap;if(
  9614. // PENDING
  9615. l(t)&&(t=this.nodes[t]),l(e)&&(e=this.nodes[e]),t instanceof zS||(t=i[ES(t)]),e instanceof zS||(e=i[ES(e)]),t&&e){var r=t.id+"-"+e.id,a=new BS(t,e,n);return a.hostGraph=this,this._directed&&(t.outEdges.push(a),e.inEdges.push(a)),t.edges.push(a),t!==e&&e.edges.push(a),this.edges.push(a),o[r]=a,a}},
  9616. /**
  9617. * Get edge by data index
  9618. */
  9619. t.prototype.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},
  9620. /**
  9621. * Get edge by two linked nodes
  9622. */
  9623. t.prototype.getEdge=function(t,e){t instanceof zS&&(t=t.id),e instanceof zS&&(e=e.id);var n=this._edgesMap;return this._directed?n[t+"-"+e]:n[t+"-"+e]||n[e+"-"+t]},
  9624. /**
  9625. * Iterate all nodes
  9626. */
  9627. t.prototype.eachNode=function(t,e){for(var n=this.nodes,i=n.length,o=0;o<i;o++)n[o].dataIndex>=0&&t.call(e,n[o],o)},
  9628. /**
  9629. * Iterate all edges
  9630. */
  9631. t.prototype.eachEdge=function(t,e){for(var n=this.edges,i=n.length,o=0;o<i;o++)n[o].dataIndex>=0&&n[o].node1.dataIndex>=0&&n[o].node2.dataIndex>=0&&t.call(e,n[o],o)},
  9632. /**
  9633. * Breadth first traverse
  9634. * Return true to stop traversing
  9635. */
  9636. t.prototype.breadthFirstTraverse=function(t,e,n,i){if(e instanceof zS||(e=this._nodesMap[ES(e)]),e){for(var o="out"===n?"outEdges":"in"===n?"inEdges":"edges",r=0;r<this.nodes.length;r++)this.nodes[r].__visited=!1;if(!t.call(i,e,null))for(var a=[e];a.length;){var s=a.shift(),l=s[o];for(r=0;r<l.length;r++){var u=l[r],c=u.node1===s?u.node2:u.node1;if(!c.__visited){if(t.call(i,c,s))
  9637. // Stop traversing
  9638. return;a.push(c),c.__visited=!0}}}}},
  9639. // TODO
  9640. // depthFirstTraverse(
  9641. // cb, startNode, direction, context
  9642. // ) {
  9643. // };
  9644. // Filter update
  9645. t.prototype.update=function(){for(var t=this.data,e=this.edgeData,n=this.nodes,i=this.edges,o=0,r=n.length;o<r;o++)n[o].dataIndex=-1;for(o=0,r=t.count();o<r;o++)n[t.getRawIndex(o)].dataIndex=o;e.filterSelf((function(t){var n=i[e.getRawIndex(t)];return n.node1.dataIndex>=0&&n.node2.dataIndex>=0}));
  9646. // Update edge
  9647. for(o=0,r=i.length;o<r;o++)i[o].dataIndex=-1;for(o=0,r=e.count();o<r;o++)i[e.getRawIndex(o)].dataIndex=o},
  9648. /**
  9649. * @return {module:echarts/data/Graph}
  9650. */
  9651. t.prototype.clone=function(){for(var e=new t(this._directed),n=this.nodes,i=this.edges,o=0;o<n.length;o++)e.addNode(n[o].id,n[o].dataIndex);for(o=0;o<i.length;o++){var r=i[o];e.addEdge(r.node1.id,r.node2.id,r.dataIndex)}return e},t}(),zS=/** @class */function(){function t(t,e){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=null==t?"":t,this.dataIndex=null==e?-1:e}
  9652. /**
  9653. * @return {number}
  9654. */return t.prototype.degree=function(){return this.edges.length},
  9655. /**
  9656. * @return {number}
  9657. */
  9658. t.prototype.inDegree=function(){return this.inEdges.length},
  9659. /**
  9660. * @return {number}
  9661. */
  9662. t.prototype.outDegree=function(){return this.outEdges.length},t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){for(var t={edge:[],node:[]},e=0;e<this.edges.length;e++){var n=this.edges[e];n.dataIndex<0||(t.edge.push(n.dataIndex),t.node.push(n.node1.dataIndex,n.node2.dataIndex))}return t},t.prototype.getTrajectoryDataIndices=function(){for(var t=r(),e=r(),n=0;n<this.edges.length;n++){var i=this.edges[n];if(!(i.dataIndex<0)){t.set(i.dataIndex,!0);for(var o=[i.node1],a=[i.node2],s=0;s<o.length;){var l=o[s];s++,e.set(l.dataIndex,!0);for(var u=0;u<l.inEdges.length;u++)t.set(l.inEdges[u].dataIndex,!0),o.push(l.inEdges[u].node1)}for(s=0;s<a.length;){var c=a[s];s++,e.set(c.dataIndex,!0);for(u=0;u<c.outEdges.length;u++)t.set(c.outEdges[u].dataIndex,!0),a.push(c.outEdges[u].node2)}}}return{edge:t.keys(),node:e.keys()}},t}(),BS=/** @class */function(){function t(t,e,n){this.dataIndex=-1,this.node1=t,this.node2=e,this.dataIndex=null==n?-1:n}
  9663. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  9664. return t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},t.prototype.getTrajectoryDataIndices=function(){var t=r(),e=r();t.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],o=0;o<n.length;){var a=n[o];o++,e.set(a.dataIndex,!0);for(var s=0;s<a.inEdges.length;s++)t.set(a.inEdges[s].dataIndex,!0),n.push(a.inEdges[s].node1)}for(o=0;o<i.length;){var l=i[o];o++,e.set(l.dataIndex,!0);for(s=0;s<l.outEdges.length;s++)t.set(l.outEdges[s].dataIndex,!0),i.push(l.outEdges[s].node2)}return{edge:t.keys(),node:e.keys()}},t}();function GS(t,e){return{
  9665. /**
  9666. * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'.
  9667. */
  9668. getValue:function(n){var i=this[t][e];return i.getStore().get(i.getDimensionIndex(n||"value"),this.dataIndex)},
  9669. // TODO: TYPE stricter type.
  9670. setVisual:function(n,i){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}nt(zS,GS("hostGraph","data")),nt(BS,GS("hostGraph","edgeData"));const FS=VS;function WS(t,e,n,i,o){for(
  9671. // ??? TODO
  9672. // support dataset?
  9673. var r=new FS(i),a=0;a<t.length;a++)r.addNode(Yt(
  9674. // Id, name, dataIndex
  9675. t[a].id,t[a].name,a),a);var s=[],l=[],u=0;for(a=0;a<e.length;a++){var d=e[a],h=d.source,p=d.target;
  9676. // addEdge may fail when source or target not exists
  9677. r.addEdge(h,p,u)&&(l.push(d),s.push(Yt(Ln(d.id,null),h+" > "+p)),u++)}var f,g=n.get("coordinateSystem");if("cartesian2d"===g||"polar"===g)f=Jh(t,n);else{var y=fs.get(g),m=y&&y.dimensions||[];
  9678. // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs
  9679. // `value` dimension, but graph need `value` dimension. It's better to
  9680. // uniform this behavior.
  9681. c(m,"value")<0&&m.concat(["value"]);var v=Hh(t,{coordDimensions:m,encodeDefine:n.getEncode()}).dimensions;(f=new Fh(v,n)).initData(t)}var x=new Fh(["value"],n);return x.initData(l,s),o&&o(f,x),v_({mainData:f,struct:r,structAttr:"graph",datas:{node:f,edge:x},datasAttr:{node:"data",edge:"edgeData"}}),
  9682. // Update dataIndex of nodes and edges because invalid edge may be removed
  9683. r.update(),r}var HS=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return Ue(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}
  9684. // Provide data for legend select
  9685. this.legendVisualProvider=new dm(i,i),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),wn(e,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,e){var n,i=t.edges||t.links||[],o=t.data||t.nodes||[],r=this;if(o&&i){Hb(
  9686. // auto curveness
  9687. n=this)&&(n.__curvenessList=[],n.__edgeMap={},
  9688. // calc the array of curveness List
  9689. Yb(n));var s=WS(o,i,this,!0,(function(t,e){
  9690. // Overwrite nodeData.getItemModel to
  9691. t.wrapMethod("getItemModel",(function(t){var e=r._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t}));
  9692. // TODO Inherit resolveParentPath by default in Model#getModel?
  9693. var n=yr.prototype.getModel;function i(t,e){var i=n.call(this,t,e);return i.resolveParentPath=o,i}function o(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}e.wrapMethod("getItemModel",(function(t){return t.resolveParentPath=o,t.getModel=i,t}))}));return a(s.edges,(function(t){!
  9694. /**
  9695. * set edgeMap with key
  9696. * @param {number|string|module:echarts/data/Graph.Node} n1
  9697. * @param {number|string|module:echarts/data/Graph.Node} n2
  9698. * @param {module:echarts/model/SeriesModel} seriesModel
  9699. * @param {number} index
  9700. */
  9701. function(t,e,n,i){if(Hb(n)){var o=Ub(t,e,n),r=n.__edgeMap,a=r[Zb(o)];
  9702. // set direction
  9703. r[o]&&!a?r[o].isForward=!0:a&&r[o]&&(a.isForward=!0,r[o].isForward=!1),r[o]=r[o]||[],r[o].push(i)}}(t.node1,t.node2,this,t.dataIndex)}),this),s.data}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,e,n){if("edge"===n){var i=this.getData(),o=this.getDataParams(t,n),r=i.graph.getEdgeByIndex(t),a=i.getName(r.node1.dataIndex),s=i.getName(r.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),$l("nameValue",{name:l.join(" > "),value:o.value,noValue:null==o.value})}
  9704. // dataType === 'node' or empty
  9705. return cu({series:this,dataIndex:t,multipleSeries:e})},e.prototype._updateCategoriesData=function(){var t=n(this.option.categories||[],(function(t){
  9706. // Data must has value
  9707. return null!=t.value?t:p({value:0},t)})),e=new Fh(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray((function(t){return e.getItemModel(t)}))},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={
  9708. // zlevel: 0,
  9709. z:2,coordinateSystem:"view",
  9710. // Default option for all coordinate systems
  9711. // xAxisIndex: 0,
  9712. // yAxisIndex: 0,
  9713. // polarIndex: 0,
  9714. // geoIndex: 0,
  9715. legendHoverLink:!0,layout:null,
  9716. // Configuration of circular layout
  9717. circular:{rotateLabel:!1},
  9718. // Configuration of force directed layout
  9719. force:{initLayout:null,
  9720. // Node repulsion. Can be an array to represent range.
  9721. repulsion:[0,50],gravity:.1,
  9722. // Initial friction
  9723. friction:.6,
  9724. // Edge length. Can be an array to represent range.
  9725. edgeLength:30,layoutAnimation:!0},left:"center",top:"center",
  9726. // right: null,
  9727. // bottom: null,
  9728. // width: '80%',
  9729. // height: '80%',
  9730. symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,
  9731. // Default on center of graph
  9732. center:null,zoom:1,
  9733. // Symbol size scale ratio in roam
  9734. nodeScaleRatio:.6,
  9735. // cursor: null,
  9736. // categories: [],
  9737. // data: []
  9738. // Or
  9739. // nodes: []
  9740. // links: []
  9741. // Or
  9742. // edges: []
  9743. label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(Su);const YS=HS;var US={type:"graphRoam",event:"graphRoam",update:"none"};var ZS=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0};const XS=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="pointer",n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new ZS},e.prototype.buildPath=function(t,e){var n=Math.cos,i=Math.sin,o=e.r,r=e.width,a=e.angle,s=e.x-n(a)*r*(r>=o/3?1:2),l=e.y-i(a)*r*(r>=o/3?1:2);a=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+n(a)*r,e.y+i(a)*r),t.lineTo(e.x+n(e.angle)*o,e.y+i(e.angle)*o),t.lineTo(e.x-n(a)*r,e.y-i(a)*r),t.lineTo(s,l)},e}(g);function jS(e,n){var i=null==e?"":e+"";return n&&(t(n)?i=n.replace("{value}",i):f(n)&&(i=n(e))),i}var qS=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){this.group.removeAll();var i=t.get(["axisLine","lineStyle","color"]),o=function(t,e){var n=t.get("center"),i=e.getWidth(),o=e.getHeight(),r=Math.min(i,o);return{cx:je(n[0],e.getWidth()),cy:je(n[1],e.getHeight()),r:je(t.get("radius"),r/2)}}(t,n);this._renderMain(t,e,n,i,o),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,e,n,i,o){var r=this.group,s=t.get("clockwise"),l=-t.get("startAngle")/180*Math.PI,u=-t.get("endAngle")/180*Math.PI,c=t.getModel("axisLine"),d=c.get("roundCap")?Dy:E,h=c.get("show"),p=c.getModel("lineStyle"),f=p.get("width"),g=[l,u];Wt(g,!s);for(var y=(u=g[1])-(l=g[0]),m=l,v=[],x=0;h&&x<i.length;x++){
  9744. // Clamp
  9745. var _=new d({shape:{startAngle:m,endAngle:u=l+y*Math.min(Math.max(i[x][0],0),1),cx:o.cx,cy:o.cy,clockwise:s,r0:o.r-f,r:o.r},silent:!0});_.setStyle({fill:i[x][1]}),_.setStyle(p.getLineStyle(
  9746. // Because we use sector to simulate arc
  9747. // so the properties for stroking are useless
  9748. ["color","width"])),v.push(_),m=u}v.reverse(),a(v,(function(t){return r.add(t)}));var b=function(t){
  9749. // Less than 0
  9750. if(t<=0)return i[0][1];var e;for(e=0;e<i.length;e++)if(i[e][0]>=t&&(0===e?0:i[e-1][0])<t)return i[e][1];
  9751. // More than 1
  9752. return i[e-1][1]};this._renderTicks(t,e,n,b,o,l,u,s,f),this._renderTitleAndDetail(t,e,n,b,o),this._renderAnchor(t,o),this._renderPointer(t,e,n,b,o,l,u,s,f)},e.prototype._renderTicks=function(t,e,n,i,o,r,a,s,u){for(var c,d,h=this.group,p=o.cx,f=o.cy,g=o.r,y=+t.get("min"),m=+t.get("max"),v=t.getModel("splitLine"),x=t.getModel("axisTick"),_=t.getModel("axisLabel"),b=t.get("splitNumber"),S=x.get("splitNumber"),w=je(v.get("length"),g),M=je(x.get("length"),g),I=r,D=(a-r)/b,T=D/S,C=v.getModel("lineStyle").getLineStyle(),A=x.getModel("lineStyle").getLineStyle(),L=v.get("distance"),k=0;k<=b;k++){
  9753. // Split line
  9754. if(c=Math.cos(I),d=Math.sin(I),v.get("show")){var P=new F({shape:{x1:c*(g-(N=L?L+u:u))+p,y1:d*(g-N)+f,x2:c*(g-w-N)+p,y2:d*(g-w-N)+f},style:C,silent:!0});"auto"===C.stroke&&P.setStyle({stroke:i(k/b)}),h.add(P)}
  9755. // Label
  9756. if(_.get("show")){var N=_.get("distance")+L,O=jS(qe(k/b*(m-y)+y),_.get("formatter")),R=i(k/b),E=c*(g-w-N)+p,V=d*(g-w-N)+f,z=_.get("rotate"),B=0;"radial"===z?(B=-I+2*Math.PI)>Math.PI/2&&(B+=Math.PI):"tangential"===z?B=-I-Math.PI/2:l(z)&&(B=z*Math.PI/180),0===B?h.add(new $({style:Zo(_,{text:O,x:E,y:V,verticalAlign:d<-.8?"top":d>.8?"bottom":"middle",align:c<-.4?"left":c>.4?"right":"center"},{inheritColor:R}),silent:!0})):h.add(new $({style:Zo(_,{text:O,x:E,y:V,verticalAlign:"middle",align:"center"},{inheritColor:R}),silent:!0,originX:E,originY:V,rotation:B}))}
  9757. // Axis tick
  9758. if(x.get("show")&&k!==b){N=(N=x.get("distance"))?N+u:u;for(var G=0;G<=S;G++){c=Math.cos(I),d=Math.sin(I);var W=new F({shape:{x1:c*(g-N)+p,y1:d*(g-N)+f,x2:c*(g-M-N)+p,y2:d*(g-M-N)+f},silent:!0,style:A});"auto"===A.stroke&&W.setStyle({stroke:i((k+G/S)/b)}),h.add(W),I+=T}I-=T}else I+=D}},e.prototype._renderPointer=function(t,e,n,i,o,r,a,s,l){var u=this.group,c=this._data,d=this._progressEls,h=[],f=t.get(["pointer","show"]),g=t.getModel("progress"),y=g.get("show"),m=t.getData(),v=m.mapDimension("value"),x=+t.get("min"),_=+t.get("max"),S=[x,_],w=[r,a];function M(e,n){var i,r=m.getItemModel(e).getModel("pointer"),a=je(r.get("width"),o.r),s=je(r.get("length"),o.r),l=t.get(["pointer","icon"]),u=r.get("offsetCenter"),c=je(u[0],o.r),d=je(u[1],o.r),h=r.get("keepAspect");
  9759. // not exist icon type will be set 'rect'
  9760. return(i=l?Gc(l,c-a/2,d-s,a,s,null,h):new XS({shape:{angle:-Math.PI/2,width:a,r:s,x:c,y:d}})).rotation=-(n+Math.PI/2),i.x=o.cx,i.y=o.cy,i}function I(t,e){var n=g.get("roundCap")?Dy:E,i=g.get("overlap"),a=i?g.get("width"):l/m.count(),u=i?o.r-a:o.r-(t+1)*a,c=i?o.r:o.r-t*a,d=new n({shape:{startAngle:r,endAngle:e,cx:o.cx,cy:o.cy,clockwise:s,r0:u,r:c}});return i&&(d.z2=Xe(m.get(v,t),[x,_],[100,0],!0)),d}(y||f)&&(m.diff(c).add((function(e){var n=m.get(v,e);if(f){var i=M(e,r);
  9761. // TODO hide pointer on NaN value?
  9762. oo(i,{rotation:-((isNaN(+n)?w[0]:Xe(n,S,w,!0))+Math.PI/2)},t),u.add(i),m.setItemGraphicEl(e,i)}if(y){var o=I(e,r),a=g.get("clip");oo(o,{shape:{endAngle:Xe(n,S,w,a)}},t),u.add(o),
  9763. // Add data index and series index for indexing the data by element
  9764. // Useful in tooltip
  9765. ii(t.seriesIndex,m.dataType,e,o),h[e]=o}})).update((function(e,n){var i=m.get(v,e);if(f){var o=c.getItemGraphicEl(n),a=o?o.rotation:r,s=M(e,a);s.rotation=a,io(s,{rotation:-((isNaN(+i)?w[0]:Xe(i,S,w,!0))+Math.PI/2)},t),u.add(s),m.setItemGraphicEl(e,s)}if(y){var l=d[n],p=I(e,l?l.shape.endAngle:r),x=g.get("clip");io(p,{shape:{endAngle:Xe(i,S,w,x)}},t),u.add(p),
  9766. // Add data index and series index for indexing the data by element
  9767. // Useful in tooltip
  9768. ii(t.seriesIndex,m.dataType,e,p),h[e]=p}})).execute(),m.each((function(t){var e=m.getItemModel(t),n=e.getModel("emphasis"),o=n.get("focus"),r=n.get("blurScope"),a=n.get("disabled");if(f){var s=m.getItemGraphicEl(t),l=m.getItemVisual(t,"style"),u=l.fill;if(s instanceof b){var c=s.style;s.useStyle(p({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},l))}else s.useStyle(l),"pointer"!==s.type&&s.setColor(u);s.setStyle(e.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===s.style.fill&&s.setStyle("fill",i(Xe(m.get(v,t),S,[0,1],!0))),s.z2EmphasisLift=0,qi(s,e),Ui(s,o,r,a)}if(y){var d=h[t];d.useStyle(m.getItemVisual(t,"style")),d.setStyle(e.getModel(["progress","itemStyle"]).getItemStyle()),d.z2EmphasisLift=0,qi(d,e),Ui(d,o,r,a)}})),this._progressEls=h)},e.prototype._renderAnchor=function(t,e){var n=t.getModel("anchor");if(n.get("show")){var i=n.get("size"),o=n.get("icon"),r=n.get("offsetCenter"),a=n.get("keepAspect"),s=Gc(o,e.cx-i/2+je(r[0],e.r),e.cy-i/2+je(r[1],e.r),i,i,null,a);s.z2=n.get("showAbove")?1:0,s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},e.prototype._renderTitleAndDetail=function(t,e,n,i,o){var r=this,a=t.getData(),s=a.mapDimension("value"),l=+t.get("min"),u=+t.get("max"),c=new Z,d=[],h=[],p=t.isAnimationEnabled(),f=t.get(["pointer","showAbove"]);a.diff(this._data).add((function(t){d[t]=new $({silent:!0}),h[t]=new $({silent:!0})})).update((function(t,e){d[t]=r._titleEls[e],h[t]=r._detailEls[e]})).execute(),a.each((function(e){var n=a.getItemModel(e),r=a.get(s,e),g=new Z,y=i(Xe(r,[l,u],[0,1],!0)),m=n.getModel("title");if(m.get("show")){var v=m.get("offsetCenter"),x=o.cx+je(v[0],o.r),_=o.cy+je(v[1],o.r);(C=d[e]).attr({z2:f?0:2,style:Zo(m,{x:x,y:_,text:a.getName(e),align:"center",verticalAlign:"middle"},{inheritColor:y})}),g.add(C)}var b=n.getModel("detail");if(b.get("show")){var S=b.get("offsetCenter"),w=o.cx+je(S[0],o.r),M=o.cy+je(S[1],o.r),I=je(b.get("width"),o.r),D=je(b.get("height"),o.r),T=t.get(["progress","show"])?a.getItemVisual(e,"style").fill:y,C=h[e],A=b.get("formatter");C.attr({z2:f?0:2,style:Zo(b,{x:w,y:M,text:jS(r,A),width:isNaN(I)?null:I,height:isNaN(D)?null:D,align:"center",verticalAlign:"middle"},{inheritColor:T})}),tr(C,{normal:b},r,(function(t){return jS(t,A)})),p&&er(C,e,a,t,{getFormattedLabel:function(t,e,n,i,o,a){return jS(a?a.interpolatedValue:r,A)}}),g.add(C)}c.add(g)})),this.group.add(c),this._titleEls=d,this._detailEls=h},e.type="gauge",e}(Ou);const KS=qS;const JS=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="itemStyle",n}return Ue(e,t),e.prototype.getInitialData=function(t,e){return um(this,["value"])},e.type="series.gauge",e.defaultOption={
  9769. // zlevel: 0,
  9770. z:2,colorBy:"data",
  9771. // 默认全局居中
  9772. center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,
  9773. // 最小值
  9774. min:0,
  9775. // 最大值
  9776. max:100,
  9777. // 分割段数,默认为10
  9778. splitNumber:10,
  9779. // 坐标轴线
  9780. axisLine:{
  9781. // 默认显示,属性show控制显示与否
  9782. show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},
  9783. // 坐标轴线
  9784. progress:{
  9785. // 默认显示,属性show控制显示与否
  9786. show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},
  9787. // 分隔线
  9788. splitLine:{
  9789. // 默认显示,属性show控制显示与否
  9790. show:!0,
  9791. // 属性length控制线长
  9792. length:10,distance:10,
  9793. // 属性lineStyle(详见lineStyle)控制线条样式
  9794. lineStyle:{color:"#63677A",width:3,type:"solid"}},
  9795. // 坐标轴小标记
  9796. axisTick:{
  9797. // 属性show控制显示与否,默认不显示
  9798. show:!0,
  9799. // 每份split细分多少段
  9800. splitNumber:5,
  9801. // 属性length控制线长
  9802. length:6,distance:10,
  9803. // 属性lineStyle控制线条样式
  9804. lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,
  9805. // formatter: null,
  9806. color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,
  9807. // x, y,单位px
  9808. offsetCenter:[0,"20%"],
  9809. // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  9810. color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],
  9811. // x, y,单位px
  9812. offsetCenter:[0,"40%"],
  9813. // formatter: null,
  9814. // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  9815. color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(Su);var $S=["itemStyle","opacity"],QS=/** @class */function(t){function e(e,n){var i=t.call(this)||this,o=i,r=new B,a=new $;return o.setTextContent(a),i.setTextGuideLine(r),i.updateData(e,n,!0),i}return Ue(e,t),e.prototype.updateData=function(t,e,n){var i=this,o=t.hostModel,r=t.getItemModel(e),a=t.getItemLayout(e),s=r.getModel("emphasis"),l=r.get($S);l=null==l?1:l,n||uo(i),
  9816. // Update common style
  9817. i.useStyle(t.getItemVisual(e,"style")),i.style.lineJoin="round",n?(i.setShape({points:a.points}),i.style.opacity=0,oo(i,{style:{opacity:l}},o,e)):io(i,{style:{opacity:l},shape:{points:a.points}},o,e),qi(i,r),this._updateLabel(t,e),Ui(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},e.prototype._updateLabel=function(t,e){var n=this,i=this.getTextGuideLine(),o=n.getTextContent(),r=t.hostModel,a=t.getItemModel(e),s=t.getItemLayout(e).label,l=t.getItemVisual(e,"style"),u=l.fill;Yo(
  9818. // position will not be used in setLabelStyle
  9819. o,Uo(a),{labelFetcher:t.hostModel,labelDataIndex:e,defaultOpacity:l.opacity,defaultText:t.getName(e)},{normal:{align:s.textAlign,verticalAlign:s.verticalAlign}}),n.setTextConfig({local:!0,inside:!!s.inside,insideStroke:u,
  9820. // insideFill: 'auto',
  9821. outsideFill:u});var c=s.linePoints;i.setShape({points:c}),n.textGuideLineConfig={anchor:c?new K(c[0][0],c[0][1]):null},
  9822. // Make sure update style on labelText after setLabelStyle.
  9823. // Because setLabelStyle will replace a new style on it.
  9824. io(o,{style:{x:s.x,y:s.y}},r,e),o.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),gg(n,yg(a),{
  9825. // Default use item visual color
  9826. stroke:u})},e}(z);
  9827. /**
  9828. * Piece of pie including Sector, Label, LabelLine
  9829. */const tw=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.ignoreLabelLineUpdate=!0,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),o=this._data,r=this.group;i.diff(o).add((function(t){var e=new QS(i,t);i.setItemGraphicEl(t,e),r.add(e)})).update((function(t,e){var n=o.getItemGraphicEl(e);n.updateData(i,t),r.add(n),i.setItemGraphicEl(t,n)})).remove((function(e){lo(o.getItemGraphicEl(e),t,e)})).execute(),this._data=i},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(Ou);var ew=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),
  9830. // Enable legend selection for each data item
  9831. // Use a function instead of direct access because data reference may changed
  9832. this.legendVisualProvider=new dm(lt(this.getData,this),lt(this.getRawData,this)),
  9833. // Extend labelLine emphasis
  9834. this._defaultLabelLine(e)},e.prototype.getInitialData=function(t,e){return um(this,{coordDimensions:["value"],encodeDefaulter:rt(Ua,this)})},e.prototype._defaultLabelLine=function(t){
  9835. // Extend labelLine emphasis
  9836. wn(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;
  9837. // Not show label line if `label.normal.show = false`
  9838. e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},
  9839. // Overwrite
  9840. e.prototype.getDataParams=function(e){var n=this.getData(),i=t.prototype.getDataParams.call(this,e),o=n.mapDimension("value"),r=n.getSum(o);
  9841. // Percent is 0 if sum is 0
  9842. return i.percent=r?+(n.get(o,e)/r*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series.funnel",e.defaultOption={
  9843. // zlevel: 0, // 一级层叠
  9844. z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,
  9845. // width: {totalWidth} - left - right,
  9846. // height: {totalHeight} - top - bottom,
  9847. // 默认取数据最小最大值
  9848. // min: 0,
  9849. // max: 100,
  9850. minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{
  9851. // color: 各异,
  9852. width:1}},itemStyle:{
  9853. // color: 各异,
  9854. borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(Su);const nw=ew;function iw(t,e){t.eachSeriesByType("funnel",(function(t){var n=t.getData(),i=n.mapDimension("value"),o=t.get("sort"),r=function(t,e){return xa(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e),a=t.get("orient"),s=r.width,l=r.height,u=function(t,e){for(var n=t.mapDimension("value"),i=t.mapArray(n,(function(t){return t})),o=[],r="ascending"===e,a=0,s=t.count();a<s;a++)o[a]=a;
  9855. // Add custom sortable function & none sortable opetion by "options.sort"
  9856. return f(e)?o.sort(e):"none"!==e&&o.sort((function(t,e){return r?i[t]-i[e]:i[e]-i[t]})),o}(n,o),c=r.x,d=r.y,h="horizontal"===a?[je(t.get("minSize"),l),je(t.get("maxSize"),l)]:[je(t.get("minSize"),s),je(t.get("maxSize"),s)],p=n.getDataExtent(i),g=t.get("min"),y=t.get("max");null==g&&(g=Math.min(p[0],0)),null==y&&(y=p[1]);var m=t.get("funnelAlign"),v=t.get("gap"),x=(("horizontal"===a?s:l)-v*(n.count()-1))/n.count(),_=function(t,e){
  9857. // End point index is data.count() and we assign it 0
  9858. if("horizontal"===a){var o=Xe(n.get(i,t)||0,[g,y],h,!0),r=void 0;switch(m){case"top":r=d;break;case"center":r=d+(l-o)/2;break;case"bottom":r=d+(l-o)}return[[e,r],[e,r+o]]}var u,p=Xe(n.get(i,t)||0,[g,y],h,!0);switch(m){case"left":u=c;break;case"center":u=c+(s-p)/2;break;case"right":u=c+s-p}return[[u,e],[u+p,e]]};"ascending"===o&&(
  9859. // From bottom to top
  9860. x=-x,v=-v,"horizontal"===a?c+=s:d+=l,u=u.reverse());for(var b=0;b<u.length;b++){var S=u[b],w=u[b+1],M=n.getItemModel(S);if("horizontal"===a){var I=M.get(["itemStyle","width"]);null==I?I=x:(I=je(I,s),"ascending"===o&&(I=-I));var D=_(S,c),T=_(w,c+I);c+=I+v,n.setItemLayout(S,{points:D.concat(T.slice().reverse())})}else{var C=M.get(["itemStyle","height"]);null==C?C=x:(C=je(C,l),"ascending"===o&&(C=-C));D=_(S,d),T=_(w,d+C);d+=C+v,n.setItemLayout(S,{points:D.concat(T.slice().reverse())})}}!function(t){var e=t.hostModel.get("orient");t.each((function(n){var i,o,r,a,s=t.getItemModel(n),l=s.getModel("label").get("position"),u=s.getModel("labelLine"),c=t.getItemLayout(n),d=c.points,h="inner"===l||"inside"===l||"center"===l||"insideLeft"===l||"insideRight"===l;if(h)"insideLeft"===l?(o=(d[0][0]+d[3][0])/2+5,r=(d[0][1]+d[3][1])/2,i="left"):"insideRight"===l?(o=(d[1][0]+d[2][0])/2-5,r=(d[1][1]+d[2][1])/2,i="right"):(o=(d[0][0]+d[1][0]+d[2][0]+d[3][0])/4,r=(d[0][1]+d[1][1]+d[2][1]+d[3][1])/4,i="center"),a=[[o,r],[o,r]];else{var p=void 0,f=void 0,g=void 0,y=void 0,m=u.get("length");"left"===l?(
  9861. // Left side
  9862. p=(d[3][0]+d[0][0])/2,f=(d[3][1]+d[0][1])/2,o=(g=p-m)-5,i="right"):"right"===l?(
  9863. // Right side
  9864. p=(d[1][0]+d[2][0])/2,f=(d[1][1]+d[2][1])/2,o=(g=p+m)+5,i="left"):"top"===l?(
  9865. // Top side
  9866. p=(d[3][0]+d[0][0])/2,r=(y=(f=(d[3][1]+d[0][1])/2)-m)-5,i="center"):"bottom"===l?(
  9867. // Bottom side
  9868. p=(d[1][0]+d[2][0])/2,r=(y=(f=(d[1][1]+d[2][1])/2)+m)+5,i="center"):"rightTop"===l?(
  9869. // RightTop side
  9870. p="horizontal"===e?d[3][0]:d[1][0],f="horizontal"===e?d[3][1]:d[1][1],"horizontal"===e?(r=(y=f-m)-5,i="center"):(o=(g=p+m)+5,i="top")):"rightBottom"===l?(
  9871. // RightBottom side
  9872. p=d[2][0],f=d[2][1],"horizontal"===e?(r=(y=f+m)+5,i="center"):(o=(g=p+m)+5,i="bottom")):"leftTop"===l?(
  9873. // LeftTop side
  9874. p=d[0][0],f="horizontal"===e?d[0][1]:d[1][1],"horizontal"===e?(r=(y=f-m)-5,i="center"):(o=(g=p-m)-5,i="right")):"leftBottom"===l?(
  9875. // LeftBottom side
  9876. p="horizontal"===e?d[1][0]:d[3][0],f="horizontal"===e?d[1][1]:d[2][1],"horizontal"===e?(r=(y=f+m)+5,i="center"):(o=(g=p-m)-5,i="right")):(
  9877. // Right side or Bottom side
  9878. p=(d[1][0]+d[2][0])/2,f=(d[1][1]+d[2][1])/2,"horizontal"===e?(r=(y=f+m)+5,i="center"):(o=(g=p+m)+5,i="left")),"horizontal"===e?o=g=p:r=y=f,a=[[p,f],[g,y]]}c.label={linePoints:a,x:o,y:r,verticalAlign:"middle",textAlign:i,inside:h}}))}(n)}))}var ow=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._dataGroup=new Z,n._initialized=!1,n}return Ue(e,t),e.prototype.init=function(){this.group.add(this._dataGroup)},
  9879. /**
  9880. * @override
  9881. */
  9882. e.prototype.render=function(t,e,n,i){
  9883. // Clear previously rendered progressive elements.
  9884. this._progressiveEls=null;var o=this._dataGroup,r=t.getData(),a=this._data,s=t.coordinateSystem,l=s.dimensions,u=sw(t);
  9885. // First create
  9886. if(r.diff(a).add((function(t){lw(aw(r,o,t,l,s),r,t,u)})).update((function(e,n){var i=a.getItemGraphicEl(n),o=rw(r,e,l,s);r.setItemGraphicEl(e,i),io(i,{shape:{points:o}},t,e),uo(i),lw(i,r,e,u)})).remove((function(t){var e=a.getItemGraphicEl(t);o.remove(e)})).execute(),!this._initialized){this._initialized=!0;var c=function(t,e,n){var i=t.model,o=t.getRect(),r=new G({shape:{x:o.x,y:o.y,width:o.width,height:o.height}}),a="horizontal"===i.get("layout")?"width":"height";return r.setShape(a,0),oo(r,{shape:{width:o.width,height:o.height}},e,n),r}(s,t,(function(){
  9887. // Callback will be invoked immediately if there is no animation
  9888. setTimeout((function(){o.removeClipPath()}))}));o.setClipPath(c)}this._data=r},e.prototype.incrementalPrepareRender=function(t,e,n){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},e.prototype.incrementalRender=function(t,e,n){for(var i=e.getData(),o=e.coordinateSystem,r=o.dimensions,a=sw(e),s=this._progressiveEls=[],l=t.start;l<t.end;l++){var u=aw(i,this._dataGroup,l,r,o);u.incremental=!0,lw(u,i,l,a),s.push(u)}},e.prototype.remove=function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null},e.type="parallel",e}(Ou);function rw(t,e,n,i){for(var o,r=[],a=0;a<n.length;a++){var s=n[a],l=t.get(t.mapDimension(s),e);o=l,("category"===i.getAxis(s).type?null==o:null==o||isNaN(o))||r.push(i.dataToPoint(l,s))}return r}function aw(t,e,n,i,o){var r=rw(t,n,i,o),a=new B({shape:{points:r},
  9889. // silent: true,
  9890. z2:10});return e.add(a),t.setItemGraphicEl(n,a),a}function sw(t){var e=t.get("smooth",!0);return!0===e&&(e=.3),e=pn(e),It(e)&&(e=0),{smooth:e}}function lw(t,e,n,i){t.useStyle(e.getItemVisual(n,"style")),t.style.fill=null,t.setShape("smooth",i.smooth);var o=e.getItemModel(n),r=o.getModel("emphasis");qi(t,o,"lineStyle"),Ui(t,r.get("focus"),r.get("blurScope"),r.get("disabled"))}
  9891. // function simpleDiff(oldData, newData, dimensions) {
  9892. // let oldLen;
  9893. // if (!oldData
  9894. // || !oldData.__plProgressive
  9895. // || (oldLen = oldData.count()) !== newData.count()
  9896. // ) {
  9897. // return true;
  9898. // }
  9899. // let dimLen = dimensions.length;
  9900. // for (let i = 0; i < oldLen; i++) {
  9901. // for (let j = 0; j < dimLen; j++) {
  9902. // if (oldData.get(dimensions[j], i) !== newData.get(dimensions[j], i)) {
  9903. // return true;
  9904. // }
  9905. // }
  9906. // }
  9907. // return false;
  9908. // }
  9909. // FIXME put in common util?
  9910. const uw=ow;function cw(t){
  9911. // The mapping of parallelAxis dimension to data dimension can
  9912. // be specified in parallelAxis.option.dim. For example, if
  9913. // parallelAxis.option.dim is 'dim3', it mapping to the third
  9914. // dimension of data. But `data.encode` has higher priority.
  9915. // Moreover, parallelModel.dimension should not be regarded as data
  9916. // dimensions. Consider dimensions = ['dim4', 'dim2', 'dim6'];
  9917. var e=t.ecModel.getComponent("parallel",t.get("parallelIndex"));if(e){var n={};return a(e.dimensions,(function(t){var e=+t.replace("dim","");n[t]=e})),n}}const dw=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return Ue(e,t),e.prototype.getInitialData=function(t,e){return Jh(null,this,{useEncodeDefaulter:lt(cw,null,this)})},
  9918. /**
  9919. * User can get data raw indices on 'axisAreaSelected' event received.
  9920. *
  9921. * @return Raw indices
  9922. */
  9923. e.prototype.getRawIndicesByActiveState=function(t){var e=this.coordinateSystem,n=this.getData(),i=[];return e.eachActiveState(n,(function(e,o){t===e&&i.push(n.getRawIndex(o))})),i},e.type="series.parallel",e.dependencies=["parallel"],e.defaultOption={
  9924. // zlevel: 0,
  9925. z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"},e}(Su);
  9926. /*
  9927. * Licensed to the Apache Software Foundation (ASF) under one
  9928. * or more contributor license agreements. See the NOTICE file
  9929. * distributed with this work for additional information
  9930. * regarding copyright ownership. The ASF licenses this file
  9931. * to you under the Apache License, Version 2.0 (the
  9932. * "License"); you may not use this file except in compliance
  9933. * with the License. You may obtain a copy of the License at
  9934. *
  9935. * http://www.apache.org/licenses/LICENSE-2.0
  9936. *
  9937. * Unless required by applicable law or agreed to in writing,
  9938. * software distributed under the License is distributed on an
  9939. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  9940. * KIND, either express or implied. See the License for the
  9941. * specific language governing permissions and limitations
  9942. * under the License.
  9943. */
  9944. /**
  9945. * AUTO-GENERATED FILE. DO NOT MODIFY.
  9946. */
  9947. /*
  9948. * Licensed to the Apache Software Foundation (ASF) under one
  9949. * or more contributor license agreements. See the NOTICE file
  9950. * distributed with this work for additional information
  9951. * regarding copyright ownership. The ASF licenses this file
  9952. * to you under the Apache License, Version 2.0 (the
  9953. * "License"); you may not use this file except in compliance
  9954. * with the License. You may obtain a copy of the License at
  9955. *
  9956. * http://www.apache.org/licenses/LICENSE-2.0
  9957. *
  9958. * Unless required by applicable law or agreed to in writing,
  9959. * software distributed under the License is distributed on an
  9960. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  9961. * KIND, either express or implied. See the License for the
  9962. * specific language governing permissions and limitations
  9963. * under the License.
  9964. */var hw=["lineStyle","opacity"];const pw={seriesType:"parallel",reset:function(t,e){var n=t.coordinateSystem,i={normal:t.get(["lineStyle","opacity"]),active:t.get("activeOpacity"),inactive:t.get("inactiveOpacity")};return{progress:function(t,e){n.eachActiveState(e,(function(t,n){var o=i[t];if("normal"===t&&e.hasItemOption){var r=e.getItemModel(n).get(hw,!0);null!=r&&(o=r)}e.ensureUniqueItemVisual(n,"style").opacity=o}),t.start,t.end)}}}};function fw(t){!
  9965. /**
  9966. * Create a parallel coordinate if not exists.
  9967. * @inner
  9968. */
  9969. function(t){if(t.parallel)return;var e=!1;a(t.series,(function(t){t&&"parallel"===t.type&&(e=!0)})),e&&(t.parallel=[{}])}
  9970. /**
  9971. * Merge aixs definition from parallel option (if exists) to axis option.
  9972. * @inner
  9973. */(t),function(t){var e=Sn(t.parallelAxis);a(e,(function(e){if(o(e)){var n=e.parallelIndex||0,i=Sn(t.parallel)[n];i&&i.parallelAxisDefault&&tt(e,i.parallelAxisDefault,!1)}}))}(t)}var gw=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){this._model=t,this._api=n,this._handlers||(this._handlers={},a(yw,(function(t,e){n.getZr().on(e,this._handlers[e]=lt(t,this))}),this)),Bu(this,"_throttledDispatchExpand",t.get("axisExpandRate"),"fixRate")},e.prototype.dispose=function(t,e){Gu(this,"_throttledDispatchExpand"),a(this._handlers,(function(t,n){e.getZr().off(n,t)})),this._handlers=null},
  9974. /**
  9975. * @internal
  9976. * @param {Object} [opt] If null, cancel the last action triggering for debounce.
  9977. */
  9978. e.prototype._throttledDispatchExpand=function(t){this._dispatchExpand(t)},
  9979. /**
  9980. * @internal
  9981. */
  9982. e.prototype._dispatchExpand=function(t){t&&this._api.dispatchAction(p({type:"parallelAxisExpand"},t))},e.type="parallel",e}(Mu),yw={mousedown:function(t){mw(this,"click")&&(this._mouseDownPoint=[t.offsetX,t.offsetY])},mouseup:function(t){var e=this._mouseDownPoint;if(mw(this,"click")&&e){var n=[t.offsetX,t.offsetY];if(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2)>5)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==i.behavior&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){
  9983. // Should do nothing when brushing.
  9984. if(!this._mouseDownPoint&&mw(this,"mousemove")){var e=this._model,n=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),i=n.behavior;"jump"===i&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===i?null:{axisExpandWindow:n.axisExpandWindow,
  9985. // Jumping uses animation, and sliding suppresses animation.
  9986. animation:"jump"===i?null:{duration:0}})}}};// > 4
  9987. function mw(t,e){var n=t._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===e}const vw=gw;const xw=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(){t.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var e=this.option;t&&tt(e,t,!0),this._initDimensions()},
  9988. /**
  9989. * Whether series or axis is in this coordinate system.
  9990. */
  9991. e.prototype.contains=function(t,e){var n=t.get("parallelIndex");return null!=n&&e.getComponent("parallel",n)===this},e.prototype.setAxisExpand=function(t){a(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(e){t.hasOwnProperty(e)&&(
  9992. // @ts-ignore FIXME: why "never" inferred in this.option[name]?
  9993. this.option[e]=t[e])}),this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],e=this.parallelAxisIndex=[],n=st(this.ecModel.queryComponents({mainType:"parallelAxis"}),(function(t){
  9994. // Can not use this.contains here, because
  9995. // initialization has not been completed yet.
  9996. return(t.get("parallelIndex")||0)===this.componentIndex}),this);a(n,(function(n){t.push("dim"+n.get("dim")),e.push(n.componentIndex)}))},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={
  9997. // zlevel: 0,
  9998. z:0,left:80,top:60,right:80,bottom:60,
  9999. // width: {totalWidth} - left - right,
  10000. // height: {totalHeight} - top - bottom,
  10001. layout:"horizontal",
  10002. // FIXME
  10003. // naming?
  10004. axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,
  10005. // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full.
  10006. // Do not doc to user until necessary.
  10007. axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(Ta);var _w=/** @class */function(t){function e(e,n,i,o,r){var a=t.call(this,e,n,i)||this;return a.type=o||"value",a.axisIndex=r,a}return Ue(e,t),e.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},e}(Yf);const bw=_w;
  10008. /*
  10009. * Licensed to the Apache Software Foundation (ASF) under one
  10010. * or more contributor license agreements. See the NOTICE file
  10011. * distributed with this work for additional information
  10012. * regarding copyright ownership. The ASF licenses this file
  10013. * to you under the Apache License, Version 2.0 (the
  10014. * "License"); you may not use this file except in compliance
  10015. * with the License. You may obtain a copy of the License at
  10016. *
  10017. * http://www.apache.org/licenses/LICENSE-2.0
  10018. *
  10019. * Unless required by applicable law or agreed to in writing,
  10020. * software distributed under the License is distributed on an
  10021. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  10022. * KIND, either express or implied. See the License for the
  10023. * specific language governing permissions and limitations
  10024. * under the License.
  10025. */
  10026. /**
  10027. * AUTO-GENERATED FILE. DO NOT MODIFY.
  10028. */
  10029. /*
  10030. * Licensed to the Apache Software Foundation (ASF) under one
  10031. * or more contributor license agreements. See the NOTICE file
  10032. * distributed with this work for additional information
  10033. * regarding copyright ownership. The ASF licenses this file
  10034. * to you under the Apache License, Version 2.0 (the
  10035. * "License"); you may not use this file except in compliance
  10036. * with the License. You may obtain a copy of the License at
  10037. *
  10038. * http://www.apache.org/licenses/LICENSE-2.0
  10039. *
  10040. * Unless required by applicable law or agreed to in writing,
  10041. * software distributed under the License is distributed on an
  10042. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  10043. * KIND, either express or implied. See the License for the
  10044. * specific language governing permissions and limitations
  10045. * under the License.
  10046. */
  10047. /**
  10048. * Calculate slider move result.
  10049. * Usage:
  10050. * (1) If both handle0 and handle1 are needed to be moved, set minSpan the same as
  10051. * maxSpan and the same as `Math.abs(handleEnd[1] - handleEnds[0])`.
  10052. * (2) If handle0 is forbidden to cross handle1, set minSpan as `0`.
  10053. *
  10054. * @param delta Move length.
  10055. * @param handleEnds handleEnds[0] can be bigger then handleEnds[1].
  10056. * handleEnds will be modified in this method.
  10057. * @param extent handleEnds is restricted by extent.
  10058. * extent[0] should less or equals than extent[1].
  10059. * @param handleIndex Can be 'all', means that both move the two handleEnds.
  10060. * @param minSpan The range of dataZoom can not be smaller than that.
  10061. * If not set, handle0 and cross handle1. If set as a non-negative
  10062. * number (including `0`), handles will push each other when reaching
  10063. * the minSpan.
  10064. * @param maxSpan The range of dataZoom can not be larger than that.
  10065. * @return The input handleEnds.
  10066. */function Sw(t,e,n,i,o,r){t=t||0;var a=n[1]-n[0];
  10067. // Notice maxSpan and minSpan can be null/undefined.
  10068. if(null!=o&&(o=Mw(o,[0,a])),null!=r&&(r=Math.max(r,null!=o?o:0)),"all"===i){var s=Math.abs(e[1]-e[0]);s=Mw(s,[0,a]),o=r=Mw(s,[o,r]),i=0}e[0]=Mw(e[0],n),e[1]=Mw(e[1],n);var l=ww(e,i);e[i]+=t;
  10069. // Restrict in extent.
  10070. var u,c=o||0,d=n.slice();return l.sign<0?d[0]+=c:d[1]-=c,e[i]=Mw(e[i],d),u=ww(e,i),null!=o&&(u.sign!==l.sign||u.span<o)&&(
  10071. // If minSpan exists, 'cross' is forbidden.
  10072. e[1-i]=e[i]+l.sign*o),
  10073. // Shrink span.
  10074. u=ww(e,i),null!=r&&u.span>r&&(e[1-i]=e[i]+u.sign*r),e}function ww(t,e){var n=t[e]-t[1-e];
  10075. // If `handleEnds[0] === handleEnds[1]`, always believe that handleEnd[0]
  10076. // is at left of handleEnds[1] for non-cross case.
  10077. return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function Mw(t,e){return Math.min(null!=e[1]?e[1]:Infinity,Math.max(null!=e[0]?e[0]:-Infinity,t))}var Iw=a,Dw=Math.min,Tw=Math.max,Cw=Math.floor,Aw=Math.ceil,Lw=qe,kw=Math.PI,Pw=/** @class */function(){function t(t,e,n){this.type="parallel",
  10078. /**
  10079. * key: dimension
  10080. */
  10081. this._axesMap=r(),
  10082. /**
  10083. * key: dimension
  10084. * value: {position: [], rotation, }
  10085. */
  10086. this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,e,n)}return t.prototype._init=function(t,e,n){var i=t.dimensions,o=t.parallelAxisIndex;Iw(i,(function(t,n){var i=o[n],r=e.getComponent("parallelAxis",i),a=this._axesMap.set(t,new bw(t,of(r),[0,0],r.get("type"),i)),s="category"===a.type;a.onBand=s&&r.get("boundaryGap"),a.inverse=r.get("inverse"),
  10087. // Injection
  10088. r.axis=a,a.model=r,a.coordinateSystem=r.coordinateSystem=this}),this)},
  10089. /**
  10090. * Update axis scale after data processed
  10091. */
  10092. t.prototype.update=function(t,e){this._updateAxesFromSeries(this._model,t)},t.prototype.containPoint=function(t){var e=this._makeLayoutInfo(),n=e.axisBase,i=e.layoutBase,o=e.pixelDimIndex,r=t[1-o],a=t[o];return r>=n&&r<=n+e.axisLength&&a>=i&&a<=i+e.layoutLength},t.prototype.getModel=function(){return this._model},
  10093. /**
  10094. * Update properties from series
  10095. */
  10096. t.prototype._updateAxesFromSeries=function(t,e){e.eachSeries((function(n){if(t.contains(n,e)){var i=n.getData();Iw(this.dimensions,(function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(i,i.mapDimension(t)),nf(e.scale,e.model)}),this)}}),this)},
  10097. /**
  10098. * Resize the parallel coordinate system.
  10099. */
  10100. t.prototype.resize=function(t,e){this._rect=xa(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},t.prototype.getRect=function(){return this._rect},t.prototype._makeLayoutInfo=function(){var t,e=this._model,n=this._rect,i=["x","y"],o=["width","height"],r=e.get("layout"),a="horizontal"===r?0:1,s=n[o[a]],l=[0,s],u=this.dimensions.length,c=Nw(e.get("axisExpandWidth"),l),d=Nw(e.get("axisExpandCount")||0,[0,u]),h=e.get("axisExpandable")&&u>3&&u>d&&d>1&&c>0&&s>0,p=e.get("axisExpandWindow");p?(t=Nw(p[1]-p[0],l),p[1]=p[0]+t):(t=Nw(c*(d-1),l),(p=[c*(e.get("axisExpandCenter")||Cw(u/2))-t/2])[1]=p[0]+t);var f=(s-t)/(u-d);
  10101. // Avoid axisCollapseWidth is too small.
  10102. f<3&&(f=0);
  10103. // Find the first and last indices > ewin[0] and < ewin[1].
  10104. var g=[Cw(Lw(p[0]/c,1))+1,Aw(Lw(p[1]/c,1))-1],y=f/c*p[0];
  10105. // Pos in ec coordinates.
  10106. return{layout:r,pixelDimIndex:a,layoutBase:n[i[a]],layoutLength:s,axisBase:n[i[1-a]],axisLength:n[o[1-a]],axisExpandable:h,axisExpandWidth:c,axisCollapseWidth:f,axisExpandWindow:p,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:y}},t.prototype._layoutAxes=function(){var t=this._rect,e=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),o=i.layout;e.each((function(t){var e=[0,i.axisLength],n=t.inverse?1:0;t.setExtent(e[n],e[1-n])})),Iw(n,(function(e,n){var r=(i.axisExpandable?Rw:Ow)(n,i),a={horizontal:{x:r.position,y:i.axisLength},vertical:{x:0,y:r.position}},s={horizontal:kw/2,vertical:0},l=[a[o].x+t.x,a[o].y+t.y],u=s[o],c=te();Ut(c,c,u),oe(c,c,l),
  10107. // TODO
  10108. // tick layout info
  10109. // TODO
  10110. // update dimensions info based on axis order.
  10111. this._axesLayout[e]={position:l,rotation:u,transform:c,axisNameAvailableWidth:r.axisNameAvailableWidth,axisLabelShow:r.axisLabelShow,nameTruncateMaxWidth:r.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},
  10112. /**
  10113. * Get axis by dim.
  10114. */
  10115. t.prototype.getAxis=function(t){return this._axesMap.get(t)},
  10116. /**
  10117. * Convert a dim value of a single item of series data to Point.
  10118. */
  10119. t.prototype.dataToPoint=function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},
  10120. /**
  10121. * Travel data for one time, get activeState of each data item.
  10122. * @param start the start dataIndex that travel from.
  10123. * @param end the next dataIndex of the last dataIndex will be travel.
  10124. */
  10125. t.prototype.eachActiveState=function(t,e,n,i){null==n&&(n=0),null==i&&(i=t.count());var o=this._axesMap,r=this.dimensions,s=[],l=[];a(r,(function(e){s.push(t.mapDimension(e)),l.push(o.get(e).model)}));for(var u=this.hasAxisBrushed(),c=n;c<i;c++){var d=void 0;if(u){d="active";for(var h=t.getValues(s,c),p=0,f=r.length;p<f;p++){if("inactive"===l[p].getActiveState(h[p])){d="inactive";break}}}else d="normal";e(d,c)}},
  10126. /**
  10127. * Whether has any activeSet.
  10128. */
  10129. t.prototype.hasAxisBrushed=function(){for(var t=this.dimensions,e=this._axesMap,n=!1,i=0,o=t.length;i<o;i++)"normal"!==e.get(t[i]).model.getActiveState()&&(n=!0);return n},
  10130. /**
  10131. * Convert coords of each axis to Point.
  10132. * Return point. For example: [10, 20]
  10133. */
  10134. t.prototype.axisCoordToPoint=function(t,e){return To([t,0],this._axesLayout[e].transform)},
  10135. /**
  10136. * Get axis layout.
  10137. */
  10138. t.prototype.getAxisLayout=function(t){return et(this._axesLayout[t])},
  10139. /**
  10140. * @return {Object} {axisExpandWindow, delta, behavior: 'jump' | 'slide' | 'none'}.
  10141. */
  10142. t.prototype.getSlidedAxisExpandWindow=function(t){var e=this._makeLayoutInfo(),n=e.pixelDimIndex,i=e.axisExpandWindow.slice(),o=i[1]-i[0],r=[0,e.axisExpandWidth*(e.axisCount-1)];
  10143. // Out of the area of coordinate system.
  10144. if(!this.containPoint(t))return{behavior:"none",axisExpandWindow:i};
  10145. // Convert the point from global to expand coordinates.
  10146. var a,s=t[n]-e.layoutBase-e.axisExpandWindow0Pos,l="slide",u=e.axisCollapseWidth,c=this._model.get("axisExpandSlideTriggerArea"),d=null!=c[0];
  10147. // For dragging operation convenience, the window should not be
  10148. // slided when mouse is the center area of the window.
  10149. if(u)d&&u&&s<o*c[0]?(l="jump",a=s-o*c[2]):d&&u&&s>o*(1-c[0])?(l="jump",a=s-o*(1-c[2])):(a=s-o*c[1])>=0&&(a=s-o*(1-c[1]))<=0&&(a=0),(a*=e.axisExpandWidth/u)?Sw(a,i,r,"all"):l="none";else{var h=i[1]-i[0];(i=[Tw(0,r[1]*s/h-h/2)])[1]=Dw(r[1],i[0]+h),i[0]=i[1]-h}return{axisExpandWindow:i,behavior:l}},t}();function Nw(t,e){return Dw(Tw(t,e[0]),e[1])}function Ow(t,e){var n=e.layoutLength/(e.axisCount-1);return{position:n*t,axisNameAvailableWidth:n,axisLabelShow:!0}}function Rw(t,e){var n,i,o=e.layoutLength,r=e.axisExpandWidth,a=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,u=s,c=!1;return t<l[0]?(n=t*s,i=s):t<=l[1]?(n=e.axisExpandWindow0Pos+t*r-e.axisExpandWindow[0],u=r,c=!0):(n=o-(a-1-t)*s,i=s),{position:n,axisNameAvailableWidth:u,axisLabelShow:c,nameTruncateMaxWidth:i}}const Ew=Pw;const Vw={create:function(t,e){var n=[];return t.eachComponent("parallel",(function(i,o){var r=new Ew(i,t,e);r.name="parallel_"+o,r.resize(i,e),i.coordinateSystem=r,r.model=i,n.push(r)})),
  10150. // Inject the coordinateSystems into seriesModel
  10151. t.eachSeries((function(t){if("parallel"===t.get("coordinateSystem")){var e=t.getReferringComponents("parallel",zn).models[0];t.coordinateSystem=e.coordinateSystem}})),n}};var zw=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,
  10152. /**
  10153. * @readOnly
  10154. */
  10155. n.activeIntervals=[],n}return Ue(e,t),e.prototype.getAreaSelectStyle=function(){return Qn([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},
  10156. /**
  10157. * The code of this feature is put on AxisModel but not ParallelAxis,
  10158. * because axisModel can be alive after echarts updating but instance of
  10159. * ParallelAxis having been disposed. this._activeInterval should be kept
  10160. * when action dispatched (i.e. legend click).
  10161. *
  10162. * @param intervals `interval.length === 0` means set all active.
  10163. */
  10164. e.prototype.setActiveIntervals=function(t){var e=this.activeIntervals=et(t);
  10165. // Normalize
  10166. if(e)for(var n=e.length-1;n>=0;n--)Ke(e[n])},
  10167. /**
  10168. * @param value When only attempting detect whether 'no activeIntervals set',
  10169. * `value` is not needed to be input.
  10170. */
  10171. e.prototype.getActiveState=function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(+t))return"inactive";
  10172. // Simple optimization
  10173. if(1===e.length){var n=e[0];if(n[0]<=t&&t<=n[1])return"active"}else for(var i=0,o=e.length;i<o;i++)if(e[i][0]<=t&&t<=e[i][1])return"active";return"inactive"},e}(Ta);nt(zw,df);const Bw=zw;var Gw=!0,Fw=Math.min,Ww=Math.max,Hw=Math.pow,Yw="globalPan",Uw={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},Zw={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},Xw={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},jw=0,qw=/** @class */function(t){function e(e){var n=t.call(this)||this;
  10174. /**
  10175. * @internal
  10176. */return n._track=[],
  10177. /**
  10178. * @internal
  10179. */
  10180. n._covers=[],n._handlers={},n._zr=e,n.group=new Z,n._uid="brushController_"+jw++,a(SM,(function(t,e){this._handlers[e]=lt(t,this)}),n),n}
  10181. /**
  10182. * If set to `false`, select disabled.
  10183. */return Ue(e,t),e.prototype.enableBrush=function(t){return this._brushType&&this._doDisableBrush(),t.brushType&&this._doEnableBrush(t),this},e.prototype._doEnableBrush=function(t){var e=this._zr;
  10184. // Consider roam, which takes globalPan too.
  10185. this._enableGlobalPan||function(t,e,n){Fv(t)[e]=n}(e,Yw,this._uid),a(this._handlers,(function(t,n){e.on(n,t)})),this._brushType=t.brushType,this._brushOption=tt(et(Xw),t,!0)},e.prototype._doDisableBrush=function(){var t=this._zr;!function(t,e,n){var i=Fv(t);i[e]===n&&(i[e]=null)}(t,Yw,this._uid),a(this._handlers,(function(e,n){t.off(n,e)})),this._brushType=this._brushOption=null},
  10186. /**
  10187. * @param panelOpts If not pass, it is global brush.
  10188. */
  10189. e.prototype.setPanels=function(t){if(t&&t.length){var e=this._panels={};a(t,(function(t){e[t.panelId]=et(t)}))}else this._panels=null;return this},e.prototype.mount=function(t){t=t||{},this._enableGlobalPan=t.enableGlobalPan;var e=this.group;return this._zr.add(e),e.attr({x:t.x||0,y:t.y||0,rotation:t.rotation||0,scaleX:t.scaleX||1,scaleY:t.scaleY||1}),this._transform=e.getLocalTransform(),this},
  10190. // eachCover(cb, context): void {
  10191. // each(this._covers, cb, context);
  10192. // }
  10193. /**
  10194. * Update covers.
  10195. * @param coverConfigList
  10196. * If coverConfigList is null/undefined, all covers removed.
  10197. */
  10198. e.prototype.updateCovers=function(t){t=n(t,(function(t){return tt(et(Xw),t,!0)}));var e=this._covers,i=this._covers=[],o=this,r=this._creatingCover;return new yh(e,t,(function(t,e){return a(t.__brushOption,e)}),a).add(s).update(s).remove((function(t){e[t]!==r&&o.group.remove(e[t])})).execute(),this;function a(t,e){return(null!=t.id?t.id:"\0-brush-index-"+e)+"-"+t.brushType}function s(n,a){var s=t[n];
  10199. // Consider setOption in event listener of brushSelect,
  10200. // where updating cover when creating should be forbidden.
  10201. if(null!=a&&e[a]===r)i[n]=e[a];else{var l=i[n]=null!=a?(e[a].__brushOption=s,e[a]):Jw(o,Kw(o,s));tM(o,l)}}},e.prototype.unmount=function(){return this.enableBrush(!1),
  10202. // container may 'removeAll' outside.
  10203. oM(this),this._zr.remove(this.group),this},e.prototype.dispose=function(){this.unmount(),this.off()},e}(mt);function Kw(t,e){var n=MM[e.brushType].createCover(t,e);return n.__brushOption=e,Qw(n,e),t.group.add(n),n}function Jw(t,e){var n=eM(e);return n.endCreating&&(n.endCreating(t,e),Qw(e,e.__brushOption)),e}function $w(t,e){var n=e.__brushOption;eM(e).updateCoverShape(t,e,n.range,n)}function Qw(t,e){var n=e.z;null==n&&(n=1e4),t.traverse((function(t){t.z=n,t.z2=n}))}function tM(t,e){eM(e).updateCommon(t,e),$w(t,e)}function eM(t){return MM[t.__brushOption.brushType]}
  10204. // return target panel or `true` (means global panel)
  10205. function nM(t,e,n){var i,o=t._panels;if(!o)return Gw;// Global panel
  10206. var r=t._transform;return a(o,(function(t){t.isTargetByCursor(e,n,r)&&(i=t)})),i}
  10207. // Return a panel or true
  10208. function iM(t,e){var n=t._panels;if(!n)return Gw;// Global panel
  10209. var i=e.__brushOption.panelId;
  10210. // User may give cover without coord sys info,
  10211. // which is then treated as global panel.
  10212. return null!=i?n[i]:Gw}function oM(t){var e=t._covers,n=e.length;return a(e,(function(e){t.group.remove(e)}),t),e.length=0,!!n}function rM(t,e){var i=n(t._covers,(function(t){var e=t.__brushOption,n=et(e.range);return{brushType:e.brushType,panelId:e.panelId,range:n}}));t.trigger("brush",{areas:i,isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function aM(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function sM(t,e,n,i){var o=new Z;return o.add(new G({name:"main",style:dM(n),silent:!0,draggable:!0,cursor:"move",drift:rt(fM,t,e,o,["n","s","w","e"]),ondragend:rt(rM,e,{isEnd:!0})})),a(i,(function(n){o.add(new G({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:rt(fM,t,e,o,n),ondragend:rt(rM,e,{isEnd:!0})}))})),o}function lM(t,e,n,i){var o=i.brushStyle.lineWidth||0,r=Ww(o,6),a=n[0][0],s=n[1][0],l=a-o/2,u=s-o/2,c=n[0][1],d=n[1][1],h=c-r+o/2,p=d-r+o/2,f=c-a,g=d-s,y=f+o,m=g+o;cM(t,e,"main",a,s,f,g),i.transformable&&(cM(t,e,"w",l,u,r,m),cM(t,e,"e",h,u,r,m),cM(t,e,"n",l,u,y,r),cM(t,e,"s",l,p,y,r),cM(t,e,"nw",l,u,r,r),cM(t,e,"ne",h,u,r,r),cM(t,e,"sw",l,p,r,r),cM(t,e,"se",h,p,r,r))}function uM(t,e){var n=e.__brushOption,i=n.transformable,o=e.childAt(0);o.useStyle(dM(n)),o.attr({silent:!i,cursor:i?"move":"default"}),a([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],(function(n){var o=e.childOfName(n.join("")),r=1===n.length?pM(t,n[0]):function(t,e){var n=[pM(t,e[0]),pM(t,e[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}(t,n);o&&o.attr({silent:!i,invisible:!i,cursor:i?Zw[r]+"-resize":null})}))}function cM(t,e,n,i,o,r,a){var s=e.childOfName(n);s&&s.setShape(function(t){var e=Fw(t[0][0],t[1][0]),n=Fw(t[0][1],t[1][1]),i=Ww(t[0][0],t[1][0]),o=Ww(t[0][1],t[1][1]);return{x:e,y:n,width:i-e,height:o-n}}(mM(t,e,[[i,o],[i+r,o+a]])))}function dM(t){return I({strokeNoScale:!0},t.brushStyle)}function hM(t,e,n,i){var o=[Fw(t,n),Fw(e,i)],r=[Ww(t,n),Ww(e,i)];return[[o[0],r[0]],[o[1],r[1]]]}function pM(t,e){var n=Co({w:"left",e:"right",n:"top",s:"bottom"}[e],function(t){return Do(t.group)}(t));return{left:"w",right:"e",top:"n",bottom:"s"}[n]}function fM(t,e,n,i,o,r){var s=n.__brushOption,l=t.toRectRange(s.range),u=yM(e,o,r);a(i,(function(t){var e=Uw[t];l[e[0]][e[1]]+=u[e[0]]})),s.range=t.fromRectRange(hM(l[0][0],l[1][0],l[0][1],l[1][1])),tM(e,n),rM(e,{isEnd:!1})}function gM(t,e,n,i){var o=e.__brushOption.range,r=yM(t,n,i);a(o,(function(t){t[0]+=r[0],t[1]+=r[1]})),tM(t,e),rM(t,{isEnd:!1})}function yM(t,e,n){var i=t.group,o=i.transformCoordToLocal(e,n),r=i.transformCoordToLocal(0,0);return[o[0]-r[0],o[1]-r[1]]}function mM(t,e,n){var i=iM(t,e);return i&&i!==Gw?i.clipPath(n,t._transform):et(n)}function vM(t){var e=t.event;e.preventDefault&&e.preventDefault()}function xM(t,e,n){return t.childOfName("main").contain(e,n)}function _M(t,e,n,i){var o,r=t._creatingCover,a=t._creatingPanel,s=t._brushOption;if(t._track.push(n.slice()),function(t){var e=t._track;if(!e.length)return!1;var n=e[e.length-1],i=e[0],o=n[0]-i[0],r=n[1]-i[1];return Hw(o*o+r*r,.5)>6}(t)||r){if(a&&!r){"single"===s.brushMode&&oM(t);var l=et(s);l.brushType=bM(l.brushType,a),l.panelId=a===Gw?null:a.panelId,r=t._creatingCover=Kw(t,l),t._covers.push(r)}if(r){var u=MM[bM(t._brushType,a)];r.__brushOption.range=u.getCreatingRange(mM(t,r,t._track)),i&&(Jw(t,r),u.updateCommon(t,r)),$w(t,r),o={isEnd:i}}}else i&&"single"===s.brushMode&&s.removeOnClick&&nM(t,e,n)&&oM(t)&&(o={isEnd:i,removeOnClick:!0});return o}function bM(t,e){return"auto"===t?e.defaultBrushType:t}var SM={mousedown:function(t){if(this._dragging)
  10213. // In case some browser do not support globalOut,
  10214. // and release mouse out side the browser.
  10215. wM(this,t);else if(!t.target||!t.target.draggable){vM(t);var e=this.group.transformCoordToLocal(t.offsetX,t.offsetY);this._creatingCover=null,(this._creatingPanel=nM(this,t,e))&&(this._dragging=!0,this._track=[e.slice()])}},mousemove:function(t){var e=t.offsetX,n=t.offsetY,i=this.group.transformCoordToLocal(e,n);if(function(t,e,n){if(
  10216. // Check active
  10217. t._brushType&&!function(t,e,n){var i=t._zr;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}
  10218. /**
  10219. * key: brushType
  10220. */(t,e.offsetX,e.offsetY)){var i=t._zr,o=t._covers,r=nM(t,e,n);
  10221. // Check whether in covers.
  10222. if(!t._dragging)for(var a=0;a<o.length;a++){var s=o[a].__brushOption;if(r&&(r===Gw||s.panelId===r.panelId)&&MM[s.brushType].contain(o[a],n[0],n[1]))
  10223. // Use cursor style set on cover.
  10224. return}r&&i.setCursorStyle("crosshair")}}(this,t,i),this._dragging){vM(t);var o=_M(this,t,i,!1);o&&rM(this,o)}},mouseup:function(t){wM(this,t)}};function wM(t,e){if(t._dragging){vM(e);var n=e.offsetX,i=e.offsetY,o=t.group.transformCoordToLocal(n,i),r=_M(t,e,o,!0);t._dragging=!1,t._track=[],t._creatingCover=null,
  10225. // trigger event should be at final, after procedure will be nested.
  10226. r&&rM(t,r)}}var MM={lineX:IM(0),lineY:IM(1),rect:{createCover:function(t,e){function n(t){return t}return sM({toRectRange:n,fromRectRange:n},t,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(t){var e=aM(t);return hM(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,n,i){lM(t,e,n,i)},updateCommon:uM,contain:xM},polygon:{createCover:function(t,e){var n=new Z;
  10227. // Do not use graphic.Polygon because graphic.Polyline do not close the
  10228. // border of the shape when drawing, which is a better experience for user.
  10229. return n.add(new B({name:"main",style:dM(e),silent:!0})),n},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),
  10230. // Use graphic.Polygon close the shape.
  10231. e.add(new z({name:"main",draggable:!0,drift:rt(gM,t,e),ondragend:rt(rM,t,{isEnd:!0})}))},updateCoverShape:function(t,e,n,i){e.childAt(0).setShape({points:mM(t,e,n)})},updateCommon:uM,contain:xM}};function IM(t){return{createCover:function(e,n){return sM({toRectRange:function(e){var n=[e,[0,100]];return t&&n.reverse(),n},fromRectRange:function(e){return e[t]}},e,n,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var n=aM(e);return[Fw(n[0][t],n[1][t]),Ww(n[0][t],n[1][t])]},updateCoverShape:function(e,n,i,o){var r,a=iM(e,n);
  10232. // If brushWidth not specified, fit the panel.
  10233. if(a!==Gw&&a.getLinearBrushOtherExtent)r=a.getLinearBrushOtherExtent(t);else{var s=e._zr;r=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[i,r];t&&l.reverse(),lM(e,n,l,o)},updateCommon:uM,contain:xM}}const DM=qw;function TM(t){return t=LM(t),function(e){return ko(e,t)}}function CM(t,e){return t=LM(t),function(n){var i=null!=e?e:n,o=i?t.width:t.height,r=i?t.x:t.y;return[r,r+(o||0)]}}function AM(t,e,n){var i=LM(t);return function(t,o){return i.contain(o[0],o[1])&&!qv(t,e,n)}}
  10234. // Consider width/height is negative.
  10235. function LM(t){return Y.create(t)}var kM=["axisLine","axisTickLabel","axisName"];const PM=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(e,n){t.prototype.init.apply(this,arguments),(this._brushController=new DM(n.getZr())).on("brush",lt(this._onBrush,this))},e.prototype.render=function(t,e,n,i){if(!function(t,e,n){return n&&"axisAreaSelect"===n.type&&e.findComponents({mainType:"parallelAxis",query:n})[0]===t}(t,e,i)){this.axisModel=t,this.api=n,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Z,this.group.add(this._axisGroup),t.get("show")){var r=function(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}(t,e),s=r.coordinateSystem,l=t.getAreaSelectStyle(),u=l.width,c=t.axis.dim,d=s.getAxisLayout(c),h=p({strokeContainThreshold:u},d),f=new $m(t,h);a(kM,f.add,f),this._axisGroup.add(f.getGroup()),this._refreshBrushController(h,l,t,r,u,n),Lo(o,this._axisGroup,t)}}},
  10236. // /**
  10237. // * @override
  10238. // */
  10239. // updateVisual(axisModel, ecModel, api, payload) {
  10240. // this._brushController && this._brushController
  10241. // .updateCovers(getCoverInfoList(axisModel));
  10242. // }
  10243. e.prototype._refreshBrushController=function(t,e,i,o,r,a){
  10244. // After filtering, axis may change, select area needs to be update.
  10245. var s=i.axis.getExtent(),l=s[1]-s[0],u=Math.min(30,.1*Math.abs(l)),c=Y.create({x:s[0],y:-r/2,width:l,height:r});c.x-=u,c.width+=2*u,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:TM(c),isTargetByCursor:AM(c,a,o),getLinearBrushOtherExtent:CM(c,0)}]).enableBrush({brushType:"lineX",brushStyle:e,removeOnClick:!0}).updateCovers(function(t){var e=t.axis;return n(t.activeIntervals,(function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}}))}(i))},e.prototype._onBrush=function(t){var e=t.areas,i=this.axisModel,o=i.axis,r=n(e,(function(t){return[o.coordToData(t.range[0],!0),o.coordToData(t.range[1],!0)]}));
  10246. // Do not cache these object, because the mey be changed.
  10247. // If realtime is true, action is not dispatched on drag end, because
  10248. // the drag end emits the same params with the last drag move event,
  10249. // and may have some delay when using touch pad.
  10250. (!i.option.realtime===t.isEnd||t.removeOnClick)&&
  10251. // jshint ignore:line
  10252. this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:r})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(Mu);
  10253. /*
  10254. * Licensed to the Apache Software Foundation (ASF) under one
  10255. * or more contributor license agreements. See the NOTICE file
  10256. * distributed with this work for additional information
  10257. * regarding copyright ownership. The ASF licenses this file
  10258. * to you under the Apache License, Version 2.0 (the
  10259. * "License"); you may not use this file except in compliance
  10260. * with the License. You may obtain a copy of the License at
  10261. *
  10262. * http://www.apache.org/licenses/LICENSE-2.0
  10263. *
  10264. * Unless required by applicable law or agreed to in writing,
  10265. * software distributed under the License is distributed on an
  10266. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  10267. * KIND, either express or implied. See the License for the
  10268. * specific language governing permissions and limitations
  10269. * under the License.
  10270. */
  10271. /**
  10272. * AUTO-GENERATED FILE. DO NOT MODIFY.
  10273. */
  10274. /*
  10275. * Licensed to the Apache Software Foundation (ASF) under one
  10276. * or more contributor license agreements. See the NOTICE file
  10277. * distributed with this work for additional information
  10278. * regarding copyright ownership. The ASF licenses this file
  10279. * to you under the Apache License, Version 2.0 (the
  10280. * "License"); you may not use this file except in compliance
  10281. * with the License. You may obtain a copy of the License at
  10282. *
  10283. * http://www.apache.org/licenses/LICENSE-2.0
  10284. *
  10285. * Unless required by applicable law or agreed to in writing,
  10286. * software distributed under the License is distributed on an
  10287. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  10288. * KIND, either express or implied. See the License for the
  10289. * specific language governing permissions and limitations
  10290. * under the License.
  10291. */var NM={type:"axisAreaSelect",event:"axisAreaSelected"};var OM={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function RM(t){t.registerComponentView(vw),t.registerComponentModel(xw),t.registerCoordinateSystem("parallel",Vw),t.registerPreprocessor(fw),t.registerComponentModel(Bw),t.registerComponentView(PM),Tm(t,"parallel",Bw,OM),function(t){t.registerAction(NM,(function(t,e){e.eachComponent({mainType:"parallelAxis",query:t},(function(e){e.axis.model.setActiveIntervals(t.intervals)}))})),
  10292. /**
  10293. * @payload
  10294. */
  10295. t.registerAction("parallelAxisExpand",(function(t,e){e.eachComponent({mainType:"parallel",query:t},(function(e){e.setAxisExpand(t)}))}))}(t)}var EM=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0},VM=/** @class */function(t){function e(e){return t.call(this,e)||this}return Ue(e,t),e.prototype.getDefaultShape=function(){return new EM},e.prototype.buildPath=function(t,e){var n=e.extent;t.moveTo(e.x1,e.y1),t.bezierCurveTo(e.cpx1,e.cpy1,e.cpx2,e.cpy2,e.x2,e.y2),"vertical"===e.orient?(t.lineTo(e.x2+n,e.y2),t.bezierCurveTo(e.cpx2+n,e.cpy2,e.cpx1+n,e.cpy1,e.x1+n,e.y1)):(t.lineTo(e.x2,e.y2+n),t.bezierCurveTo(e.cpx2,e.cpy2+n,e.cpx1,e.cpy1+n,e.x1,e.y1+n)),t.closePath()},e.prototype.highlight=function(){ki(this)},e.prototype.downplay=function(){Pi(this)},e}(g),zM=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._focusAdjacencyDisabled=!1,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=this,o=t.getGraph(),r=this.group,a=t.layoutInfo,s=a.width,l=a.height,u=t.getData(),c=t.getData("edge"),d=t.get("orient");this._model=t,r.removeAll(),r.x=a.x,r.y=a.y,
  10296. // generate a bezire Curve for each edge
  10297. o.eachEdge((function(e){var n=new VM,i=ni(n);i.dataIndex=e.dataIndex,i.seriesIndex=t.seriesIndex,i.dataType="edge";var o,a,u,h,p,f,g,y,m=e.getModel(),v=m.getModel("lineStyle"),x=v.get("curveness"),_=e.node1.getLayout(),b=e.node1.getModel(),S=b.get("localX"),w=b.get("localY"),M=e.node2.getLayout(),I=e.node2.getModel(),D=I.get("localX"),T=I.get("localY"),C=e.getLayout();n.shape.extent=Math.max(1,C.dy),n.shape.orient=d,"vertical"===d?(o=(null!=S?S*s:_.x)+C.sy,a=(null!=w?w*l:_.y)+_.dy,u=(null!=D?D*s:M.x)+C.ty,p=o,f=a*(1-x)+(h=null!=T?T*l:M.y)*x,g=u,y=a*x+h*(1-x)):(o=(null!=S?S*s:_.x)+_.dx,a=(null!=w?w*l:_.y)+C.sy,p=o*(1-x)+(u=null!=D?D*s:M.x)*x,f=a,g=o*x+u*(1-x),y=h=(null!=T?T*l:M.y)+C.ty),n.setShape({x1:o,y1:a,x2:u,y2:h,cpx1:p,cpy1:f,cpx2:g,cpy2:y}),n.useStyle(v.getItemStyle()),
  10298. // Special color, use source node color or target node color
  10299. BM(n.style,d,e);var A=""+m.get("value"),L=Uo(m,"edgeLabel");Yo(n,L,{labelFetcher:{getFormattedLabel:function(e,n,i,o,r,a){return t.getFormattedLabel(e,n,"edge",o,
  10300. // ensure edgeLabel formatter is provided
  10301. // to prevent the inheritance from `label.formatter` of the series
  10302. Ht(r,L.normal&&L.normal.get("formatter"),A),a)}},labelDataIndex:e.dataIndex,defaultText:A}),n.setTextConfig({position:"inside"});var k=m.getModel("emphasis");qi(n,m,"lineStyle",(function(t){var n=t.getItemStyle();return BM(n,d,e),n})),r.add(n),c.setItemGraphicEl(e.dataIndex,n);var P=k.get("focus");Ui(n,"adjacency"===P?e.getAdjacentDataIndices():"trajectory"===P?e.getTrajectoryDataIndices():P,k.get("blurScope"),k.get("disabled"))})),
  10303. // Generate a rect for each node
  10304. o.eachNode((function(e){var n=e.getLayout(),i=e.getModel(),o=i.get("localX"),a=i.get("localY"),c=i.getModel("emphasis"),d=i.get(["itemStyle","borderRadius"])||0,h=new G({shape:{x:null!=o?o*s:n.x,y:null!=a?a*l:n.y,width:n.dx,height:n.dy,r:d},style:i.getModel("itemStyle").getItemStyle(),z2:10});Yo(h,Uo(i),{labelFetcher:{getFormattedLabel:function(e,n){return t.getFormattedLabel(e,n,"node")}},labelDataIndex:e.dataIndex,defaultText:e.id}),h.disableLabelAnimation=!0,h.setStyle("fill",e.getVisual("color")),h.setStyle("decal",e.getVisual("style").decal),qi(h,i),r.add(h),u.setItemGraphicEl(e.dataIndex,h),ni(h).dataType="node";var p=c.get("focus");Ui(h,"adjacency"===p?e.getAdjacentDataIndices():"trajectory"===p?e.getTrajectoryDataIndices():p,c.get("blurScope"),c.get("disabled"))})),u.eachItemGraphicEl((function(e,o){u.getItemModel(o).get("draggable")&&(e.drift=function(e,r){i._focusAdjacencyDisabled=!0,this.shape.x+=e,this.shape.y+=r,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:u.getRawIndex(o),localX:this.shape.x/s,localY:this.shape.y/l})},e.ondragend=function(){i._focusAdjacencyDisabled=!1},e.draggable=!0,e.cursor="move")})),!this._data&&t.isAnimationEnabled()&&r.setClipPath(
  10305. // Add animation to the view
  10306. function(t,e,n){var i=new G({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return oo(i,{shape:{width:t.width+20}},e,n),i}(r.getBoundingRect(),t,(function(){r.removeClipPath()}))),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(Ou);
  10307. /**
  10308. * Special color, use source node color or target node color
  10309. * @param curveProps curve's style to parse
  10310. * @param orient direction
  10311. * @param edge current curve data
  10312. */
  10313. function BM(e,n,i){switch(e.fill){case"source":e.fill=i.node1.getVisual("color"),e.decal=i.node1.getVisual("style").decal;break;case"target":e.fill=i.node2.getVisual("color"),e.decal=i.node2.getVisual("style").decal;break;case"gradient":var o=i.node1.getVisual("color"),r=i.node2.getVisual("color");t(o)&&t(r)&&(e.fill=new j(0,0,+("horizontal"===n),+("vertical"===n),[{color:o,offset:0},{color:r,offset:1}]))}}const GM=zM;var FM=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}
  10314. /**
  10315. * Init a graph data structure from data in option series
  10316. */return Ue(e,t),e.prototype.getInitialData=function(t,e){var n=t.edges||t.links||[],i=t.data||t.nodes||[],o=t.levels||[];this.levelModels=[];for(var r=this.levelModels,a=0;a<o.length;a++)null!=o[a].depth&&o[a].depth>=0&&(r[o[a].depth]=new yr(o[a],this,e));var s=WS(i,n,this,!0,(function(t,e){t.wrapMethod("getItemModel",(function(t,e){var n=t.parentModel,i=n.getData().getItemLayout(e);if(i){var o=i.depth,r=n.levelModels[o];r&&(t.parentModel=r)}return t})),e.wrapMethod("getItemModel",(function(t,e){var n=t.parentModel,i=n.getGraph().getEdgeByIndex(e).node1.getLayout();if(i){var o=i.depth,r=n.levelModels[o];r&&(t.parentModel=r)}return t}))}));return s.data},e.prototype.setNodePosition=function(t,e){var n=(this.option.data||this.option.nodes)[t];n.localX=e[0],n.localY=e[1]},
  10317. /**
  10318. * Return the graphic data structure
  10319. *
  10320. * @return graphic data structure
  10321. */
  10322. e.prototype.getGraph=function(){return this.getData().graph},
  10323. /**
  10324. * Get edge data of graphic data structure
  10325. *
  10326. * @return data structure of list
  10327. */
  10328. e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,e,n){function i(t){return isNaN(t)||null==t}
  10329. // dataType === 'node' or empty do not show tooltip by default
  10330. if("edge"===n){var o=this.getDataParams(t,n),r=o.data,a=o.value;return $l("nameValue",{name:r.source+" -- "+r.target,value:a,noValue:i(a)})}
  10331. // dataType === 'node'
  10332. var s=this.getGraph().getNodeByIndex(t).getLayout().value,l=this.getDataParams(t,n).data.name;return $l("nameValue",{name:null!=l?l+"":null,value:s,noValue:i(s)})},e.prototype.optionUpdated=function(){},
  10333. // Override Series.getDataParams()
  10334. e.prototype.getDataParams=function(e,n){var i=t.prototype.getDataParams.call(this,e,n);if(null==i.value&&"node"===n){var o=this.getGraph().getNodeByIndex(e).getLayout().value;i.value=o}return i},e.type="series.sankey",e.defaultOption={
  10335. // zlevel: 0,
  10336. z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(Su);const WM=FM;function HM(t,e){t.eachSeriesByType("sankey",(function(t){var n=t.get("nodeWidth"),i=t.get("nodeGap"),o=
  10337. /**
  10338. * Get the layout position of the whole view
  10339. */
  10340. function(t,e){return xa(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e);t.layoutInfo=o;var r=o.width,s=o.height,l=t.getGraph(),u=l.nodes,c=l.edges;!
  10341. /**
  10342. * Compute the value of each node by summing the associated edge's value
  10343. */
  10344. function(t){a(t,(function(t){var e=QM(t.outEdges,$M),n=QM(t.inEdges,$M),i=t.getValue()||0,o=Math.max(e,n,i);t.setLayout({value:o},!0)}))}
  10345. /**
  10346. * Compute the x-position for each node.
  10347. *
  10348. * Here we use Kahn algorithm to detect cycle when we traverse
  10349. * the node to computer the initial x position.
  10350. */(u),function(t,e,n,i,o,r,s,l,u){(function(t,e,n,i,o,r,s){
  10351. // let kx = 0;
  10352. for(
  10353. // Used to mark whether the edge is deleted. if it is deleted,
  10354. // the value is 0, otherwise it is 1.
  10355. var l=[],u=[],c=[],d=[],h=0,p=0
  10356. // Storage each node's indegree.
  10357. ;p<e.length;p++)l[p]=1;for(p=0;p<t.length;p++)u[p]=t[p].inEdges.length,0===u[p]&&c.push(t[p]);var f=-1;
  10358. // Traversing nodes using topological sorting to calculate the
  10359. // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical')
  10360. // position of the nodes.
  10361. for(;c.length;){for(var g=0;g<c.length;g++){var y=c[g],m=y.hostGraph.data.getRawDataItem(y.dataIndex),v=null!=m.depth&&m.depth>=0;v&&m.depth>f&&(f=m.depth),y.setLayout({depth:v?m.depth:h},!0),"vertical"===r?y.setLayout({dy:n},!0):y.setLayout({dx:n},!0);for(var x=0;x<y.outEdges.length;x++){var _=y.outEdges[x];l[e.indexOf(_)]=0;var b=_.node2;0==--u[t.indexOf(b)]&&d.indexOf(b)<0&&d.push(b)}}++h,c=d,d=[]}for(p=0;p<l.length;p++)if(1===l[p])throw new Error("Sankey is a DAG, the original data has cycle!");var S=f>h-1?f:h-1;s&&"left"!==s&&function(t,e,n,i){if("right"===e){for(var o=[],r=t,s=0;r.length;){for(var l=0;l<r.length;l++){var u=r[l];u.setLayout({skNodeHeight:s},!0);for(var c=0;c<u.inEdges.length;c++){var d=u.inEdges[c];o.indexOf(d.node1)<0&&o.push(d.node1)}}r=o,o=[],++s}a(t,(function(t){YM(t)||t.setLayout({depth:Math.max(0,i-t.getLayout().skNodeHeight)},!0)}))}else"justify"===e&&
  10362. /**
  10363. * All the node without outEgdes are assigned maximum x-position and
  10364. * be aligned in the last column.
  10365. *
  10366. * @param nodes. node of sankey view.
  10367. * @param maxDepth. use to assign to node without outEdges as x-position.
  10368. */
  10369. function(t,e){a(t,(function(t){YM(t)||t.outEdges.length||t.setLayout({depth:e},!0)}))}
  10370. /**
  10371. * Scale node x-position to the width
  10372. *
  10373. * @param nodes node of sankey view
  10374. * @param kx multiple used to scale nodes
  10375. */(t,i)}(t,s,0,S);var w="vertical"===r?(o-n)/S:(i-n)/S;!function(t,e,n){a(t,(function(t){var i=t.getLayout().depth*e;"vertical"===n?t.setLayout({y:i},!0):t.setLayout({x:i},!0)}))}
  10376. /**
  10377. * Using Gauss-Seidel iterations method to compute the node depth(y-position)
  10378. *
  10379. * @param nodes node of sankey view
  10380. * @param edges edge of sankey view
  10381. * @param height the whole height of the area to draw the view
  10382. * @param nodeGap the vertical distance between two nodes
  10383. * in the same column.
  10384. * @param iterations the number of iterations for the algorithm
  10385. */(t,w,r)})(t,e,n,o,r,l,u),function(t,e,n,i,o,r,s){var l=function(t,e){var n=[],i="vertical"===e?"y":"x",o=Wn(t,(function(t){return t.getLayout()[i]}));return o.keys.sort((function(t,e){return t-e})),a(o.keys,(function(t){n.push(o.buckets.get(t))})),n}
  10386. /**
  10387. * Compute the original y-position for each node
  10388. */(t,s);(function(t,e,n,i,o,r){var s=Infinity;a(t,(function(t){var e=t.length,l=0;a(t,(function(t){l+=t.getLayout().value}));var u="vertical"===r?(i-(e-1)*o)/l:(n-(e-1)*o)/l;u<s&&(s=u)})),a(t,(function(t){a(t,(function(t,e){var n=t.getLayout().value*s;"vertical"===r?(t.setLayout({x:e},!0),t.setLayout({dx:n},!0)):(t.setLayout({y:e},!0),t.setLayout({dy:n},!0))}))})),a(e,(function(t){var e=+t.getValue()*s;t.setLayout({dy:e},!0)}))}
  10389. /**
  10390. * Resolve the collision of initialized depth (y-position)
  10391. */)(l,e,n,i,o,s),UM(l,o,n,i,s);for(var u=1;r>0;r--)
  10392. // 0.99 is a experience parameter, ensure that each iterations of
  10393. // changes as small as possible.
  10394. ZM(l,u*=.99,s),UM(l,o,n,i,s),tI(l,u,s),UM(l,o,n,i,s)}(t,e,r,o,i,s,l),
  10395. /**
  10396. * Compute the depth(y-position) of each edge
  10397. */
  10398. function(t,e){var n="vertical"===e?"x":"y";a(t,(function(t){t.outEdges.sort((function(t,e){return t.node2.getLayout()[n]-e.node2.getLayout()[n]})),t.inEdges.sort((function(t,e){return t.node1.getLayout()[n]-e.node1.getLayout()[n]}))})),a(t,(function(t){var e=0,n=0;a(t.outEdges,(function(t){t.setLayout({sy:e},!0),e+=t.getLayout().dy})),a(t.inEdges,(function(t){t.setLayout({ty:n},!0),n+=t.getLayout().dy}))}))}(t,l)}(u,c,n,i,r,s,0!==st(u,(function(t){return 0===t.getLayout().value})).length?0:t.get("layoutIterations"),t.get("orient"),t.get("nodeAlign"))}))}function YM(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return null!=e.depth&&e.depth>=0}function UM(t,e,n,i,o){var r="vertical"===o?"x":"y";a(t,(function(t){var a,s,l;t.sort((function(t,e){return t.getLayout()[r]-e.getLayout()[r]}));for(var u=0,c=t.length,d="vertical"===o?"dx":"dy",h=0;h<c;h++)(l=u-(s=t[h]).getLayout()[r])>0&&(a=s.getLayout()[r]+l,"vertical"===o?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[r]+s.getLayout()[d]+e;if((
  10399. // If the bottommost node goes outside the bounds, push it back up
  10400. l=u-e-("vertical"===o?i:n))>0){a=s.getLayout()[r]-l,"vertical"===o?s.setLayout({x:a},!0):s.setLayout({y:a},!0),u=a;for(h=c-2;h>=0;--h)(l=(s=t[h]).getLayout()[r]+s.getLayout()[d]+e-u)>0&&(a=s.getLayout()[r]-l,"vertical"===o?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[r]}}))}
  10401. /**
  10402. * Change the y-position of the nodes, except most the right side nodes
  10403. * @param nodesByBreadth
  10404. * @param alpha parameter used to adjust the nodes y-position
  10405. */function ZM(t,e,n){a(t.slice().reverse(),(function(t){a(t,(function(t){if(t.outEdges.length){var i=QM(t.outEdges,XM,n)/QM(t.outEdges,$M);if(isNaN(i)){var o=t.outEdges.length;i=o?QM(t.outEdges,jM,n)/o:0}if("vertical"===n){var r=t.getLayout().x+(i-JM(t,n))*e;t.setLayout({x:r},!0)}else{var a=t.getLayout().y+(i-JM(t,n))*e;t.setLayout({y:a},!0)}}}))}))}function XM(t,e){return JM(t.node2,e)*t.getValue()}function jM(t,e){return JM(t.node2,e)}function qM(t,e){return JM(t.node1,e)*t.getValue()}function KM(t,e){return JM(t.node1,e)}function JM(t,e){return"vertical"===e?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function $M(t){return t.getValue()}function QM(t,e,n){for(var i=0,o=t.length,r=-1;++r<o;){var a=+e(t[r],n);isNaN(a)||(i+=a)}return i}
  10406. /**
  10407. * Change the y-position of the nodes, except most the left side nodes
  10408. */function tI(t,e,n){a(t,(function(t){a(t,(function(t){if(t.inEdges.length){var i=QM(t.inEdges,qM,n)/QM(t.inEdges,$M);if(isNaN(i)){var o=t.inEdges.length;i=o?QM(t.inEdges,KM,n)/o:0}if("vertical"===n){var r=t.getLayout().x+(i-JM(t,n))*e;t.setLayout({x:r},!0)}else{var a=t.getLayout().y+(i-JM(t,n))*e;t.setLayout({y:a},!0)}}}))}))}function eI(t){t.eachSeriesByType("sankey",(function(t){var e=t.getGraph(),n=e.nodes,i=e.edges;if(n.length){var o=Infinity,r=-Infinity;a(n,(function(t){var e=t.getLayout().value;e<o&&(o=e),e>r&&(r=e)})),a(n,(function(e){var n=new mb({type:"color",mappingMethod:"linear",dataExtent:[o,r],visual:t.get("color")}).mapValueToVisual(e.getLayout().value),i=e.getModel().get(["itemStyle","color"]);null!=i?(e.setVisual("color",i),e.setVisual("style",{fill:i})):(e.setVisual("color",n),e.setVisual("style",{fill:n}))}))}i.length&&a(i,(function(t){var e=t.getModel().get("lineStyle");t.setVisual("style",e)}))}))}var nI=/** @class */function(){function t(){}
  10409. /**
  10410. * @private
  10411. */return t.prototype._hasEncodeRule=function(t){var e=this.getEncode();return e&&null!=e.get(t)},
  10412. /**
  10413. * @override
  10414. */
  10415. t.prototype.getInitialData=function(t,e){
  10416. // When both types of xAxis and yAxis are 'value', layout is
  10417. // needed to be specified by user. Otherwise, layout can be
  10418. // judged by which axis is category.
  10419. var n,o,r=e.getComponent("xAxis",this.get("xAxisIndex")),s=e.getComponent("yAxis",this.get("yAxisIndex")),l=r.get("type"),u=s.get("type");
  10420. // FIXME
  10421. // Consider time axis.
  10422. "category"===l?(t.layout="horizontal",n=r.getOrdinalMeta(),o=!this._hasEncodeRule("x")):"category"===u?(t.layout="vertical",n=s.getOrdinalMeta(),o=!this._hasEncodeRule("y")):t.layout=t.layout||"horizontal";var c=["x","y"],d="horizontal"===t.layout?0:1,h=this._baseAxisDim=c[d],f=c[1-d],g=[r,s],y=g[d].get("type"),m=g[1-d].get("type"),v=t.data;
  10423. // Clone a new data for next setOption({}) usage.
  10424. // Avoid modifying current data will affect further update.
  10425. if(v&&o){var x=[];a(v,(function(t,e){var n;i(t)?(n=t.slice(),
  10426. // Modify current using data.
  10427. t.unshift(e)):i(t.value)?((n=p({},t)).value=n.value.slice(),
  10428. // Modify current using data.
  10429. t.value.unshift(e)):n=t,x.push(n)})),t.data=x}var _=this.defaultValueDimensions,b=[{name:h,type:xh(y),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:f,type:xh(m),dimsDef:_.slice()}];return um(this,{coordDimensions:b,dimensionsCount:_.length+1,encodeDefaulter:rt(Ya,b,this)})},
  10430. /**
  10431. * If horizontal, base axis is x, otherwise y.
  10432. * @override
  10433. */
  10434. t.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},t}(),iI=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,
  10435. // TODO
  10436. // box width represents group size, so dimension should have 'size'.
  10437. /**
  10438. * @see <https://en.wikipedia.org/wiki/Box_plot>
  10439. * The meanings of 'min' and 'max' depend on user,
  10440. * and echarts do not need to know it.
  10441. * @readOnly
  10442. */
  10443. n.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],n.visualDrawType="stroke",n}return Ue(e,t),e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={
  10444. // zlevel: 0,
  10445. z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(Su);nt(iI,nI,!0);const oI=iI;var rI=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),o=this.group,r=this._data;
  10446. // There is no old data only when first rendering or switching from
  10447. // stream mode to normal mode, where previous elements should be removed.
  10448. this._data||o.removeAll();var a="horizontal"===t.get("layout")?1:0;i.diff(r).add((function(t){if(i.hasValue(t)){var e=lI(i.getItemLayout(t),i,t,a,!0);i.setItemGraphicEl(t,e),o.add(e)}})).update((function(t,e){var n=r.getItemGraphicEl(e);
  10449. // Empty data
  10450. if(i.hasValue(t)){var s=i.getItemLayout(t);n?(uo(n),uI(s,n,i,t)):n=lI(s,i,t,a),o.add(n),i.setItemGraphicEl(t,n)}else o.remove(n)})).remove((function(t){var e=r.getItemGraphicEl(t);e&&o.remove(e)})).execute(),this._data=i},e.prototype.remove=function(t){var e=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl((function(t){t&&e.remove(t)}))},e.type="boxplot",e}(Ou),aI=function(){},sI=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="boxplotBoxPath",n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new aI},e.prototype.buildPath=function(t,e){var n=e.points,i=0;for(t.moveTo(n[i][0],n[i][1]),i++;i<4;i++)t.lineTo(n[i][0],n[i][1]);for(t.closePath();i<n.length;i++)t.moveTo(n[i][0],n[i][1]),i++,t.lineTo(n[i][0],n[i][1])},e}(g);function lI(t,e,n,i,o){var r=t.ends,a=new sI({shape:{points:o?cI(r,i,t):r}});return uI(t,a,e,n,o),a}function uI(t,e,n,i,o){var r=n.hostModel;(0,Go[o?"initProps":"updateProps"])(e,{shape:{points:t.ends}},r,i),e.useStyle(n.getItemVisual(i,"style")),e.style.strokeNoScale=!0,e.z2=100;var a=n.getItemModel(i),s=a.getModel("emphasis");qi(e,a),Ui(e,s.get("focus"),s.get("blurScope"),s.get("disabled"))}function cI(t,e,i){return n(t,(function(t){return(t=t.slice())[e]=i.initBaseline,t}))}const dI=rI;var hI=a;function pI(t){var e=
  10451. /**
  10452. * Group series by axis.
  10453. */
  10454. function(t){var e=[],n=[];return t.eachSeriesByType("boxplot",(function(t){var i=t.getBaseAxis(),o=c(n,i);o<0&&(o=n.length,n[o]=i,e[o]={axis:i,seriesModels:[]}),e[o].seriesModels.push(t)})),e}
  10455. /**
  10456. * Calculate offset and box width for each series.
  10457. */(t);hI(e,(function(t){var e=t.seriesModels;e.length&&(!function(t){var e,n=t.axis,o=t.seriesModels,r=o.length,a=t.boxWidthList=[],s=t.boxOffsetList=[],l=[];if("category"===n.type)e=n.getBandWidth();else{var u=0;hI(o,(function(t){u=Math.max(u,t.getData().count())}));var c=n.getExtent();e=Math.abs(c[1]-c[0])/u}hI(o,(function(t){var n=t.get("boxWidth");i(n)||(n=[n,n]),l.push([je(n[0],e)||0,je(n[1],e)||0])}));var d=.8*e-2,h=d/r*.3,p=(d-h*(r-1))/r,f=p/2-d/2;hI(o,(function(t,e){s.push(f),f+=h+p,a.push(Math.min(Math.max(p,l[e][0]),l[e][1]))}))}
  10458. /**
  10459. * Calculate points location for each series.
  10460. */(t),hI(e,(function(e,n){!function(t,e,n){var i=t.coordinateSystem,o=t.getData(),r=n/2,a="horizontal"===t.get("layout")?0:1,s=1-a,l=["x","y"],u=o.mapDimension(l[a]),c=o.mapDimensionsAll(l[s]);if(null==u||c.length<5)return;for(var d=0;d<o.count();d++){var h=o.get(u,d),p=x(h,c[2],d),f=x(h,c[0],d),g=x(h,c[1],d),y=x(h,c[3],d),m=x(h,c[4],d),v=[];_(v,g,!1),_(v,y,!0),v.push(f,g,m,y),b(v,f),b(v,m),b(v,p),o.setItemLayout(d,{initBaseline:p[s],ends:v})}function x(t,n,r){var l,u=o.get(n,r),c=[];return c[a]=t,c[s]=u,isNaN(t)||isNaN(u)?l=[NaN,NaN]:(l=i.dataToPoint(c))[a]+=e,l}function _(t,e,n){var i=e.slice(),o=e.slice();i[a]+=r,o[a]-=r,n?t.push(i,o):t.push(o,i)}function b(t,e){var n=e.slice(),i=e.slice();n[a]-=r,i[a]+=r,t.push(n,i)}}
  10461. /**
  10462. * See:
  10463. * <https://en.wikipedia.org/wiki/Box_plot#cite_note-frigge_hoaglin_iglewicz-2>
  10464. * <http://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/boxplot.stats.html>
  10465. *
  10466. * Helper method for preparing data.
  10467. *
  10468. * @param rawData like
  10469. * [
  10470. * [12,232,443], (raw data set for the first box)
  10471. * [3843,5545,1232], (raw data set for the second box)
  10472. * ...
  10473. * ]
  10474. * @param opt.boundIQR=1.5 Data less than min bound is outlier.
  10475. * default 1.5, means Q1 - 1.5 * (Q3 - Q1).
  10476. * If 'none'/0 passed, min bound will not be used.
  10477. */(e,t.boxOffsetList[n],t.boxWidthList[n])})))}))}var fI={type:"echarts:boxplot",transform:function(e){var n=e.upstream;if(n.sourceFormat!==Na){vn("")}var i=function(e,n){for(var i=[],o=[],r=(n=n||{}).boundIQR,a="none"===r||0===r,s=0;s<e.length;s++){var l=Ke(e[s].slice()),u=dn(l,.25),c=dn(l,.5),d=dn(l,.75),h=l[0],p=l[l.length-1],g=(null==r?1.5:r)*(d-u),y=a?h:Math.max(h,u-g),m=a?p:Math.min(p,d+g),v=n.itemNameFormatter,x=f(v)?v({value:s}):t(v)?v.replace("{value}",s+""):s+"";i.push([x,y,u,c,d,m]);for(var _=0;_<l.length;_++){var b=l[_];if(b<y||b>m){var S=[x,b];o.push(S)}}}return{boxData:i,outliers:o}}(n.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};var gI=["itemStyle","borderColor"],yI=["itemStyle","borderColor0"],mI=["itemStyle","borderColorDoji"],vI=["itemStyle","color"],xI=["itemStyle","color0"];function _I(t,e){return e.get(t>0?vI:xI)}function bI(t,e){return e.get(0===t?mI:t>0?gI:yI)}const SI={seriesType:"candlestick",plan:Iu(),
  10478. // For legend.
  10479. performRawSeries:!0,reset:function(t,e){
  10480. // Only visible series has each data be visual encoded
  10481. if(!e.isSeriesFiltered(t))return!t.pipelineContext.large&&{progress:function(t,e){for(var n;null!=(n=t.next());){var i=e.getItemModel(n),o=e.getItemLayout(n).sign,r=i.getItemStyle();r.fill=_I(o,i),r.stroke=bI(o,i)||r.fill;var a=e.ensureUniqueItemVisual(n,"style");p(a,r)}}}}};var wI=["color","borderColor"],MI=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){
  10482. // If there is clipPath created in large mode. Remove it.
  10483. this.group.removeClipPath(),
  10484. // Clear previously rendered progressive elements.
  10485. this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,e,n){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,e,n,i){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,e):this._incrementalRenderNormal(t,e)},e.prototype.eachRendered=function(t){Bo(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t){var e=t.getData(),n=this._data,i=this.group,o=e.getLayout("isSimpleBox"),r=t.get("clip",!0),a=t.coordinateSystem,s=a.getArea&&a.getArea();
  10486. // There is no old data only when first rendering or switching from
  10487. // stream mode to normal mode, where previous elements should be removed.
  10488. this._data||i.removeAll(),e.diff(n).add((function(n){if(e.hasValue(n)){var a=e.getItemLayout(n);if(r&&CI(s,a))return;var l=TI(a,n,!0);oo(l,{shape:{points:a.ends}},t,n),AI(l,e,n,o),i.add(l),e.setItemGraphicEl(n,l)}})).update((function(a,l){var u=n.getItemGraphicEl(l);
  10489. // Empty data
  10490. if(e.hasValue(a)){var c=e.getItemLayout(a);r&&CI(s,c)?i.remove(u):(u?(io(u,{shape:{points:c.ends}},t,a),uo(u)):u=TI(c),AI(u,e,a,o),i.add(u),e.setItemGraphicEl(a,u))}else i.remove(u)})).remove((function(t){var e=n.getItemGraphicEl(t);e&&i.remove(e)})).execute(),this._data=e},e.prototype._renderLarge=function(t){this._clear(),NI(t,this.group);var e=t.get("clip",!0)?iy(t.coordinateSystem,!1,t):null;e?this.group.setClipPath(e):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,e){for(var n,i=e.getData(),o=i.getLayout("isSimpleBox");null!=(n=t.next());){var r=TI(i.getItemLayout(n));AI(r,i,n,o),r.incremental=!0,this.group.add(r),this._progressiveEls.push(r)}},e.prototype._incrementalRenderLarge=function(t,e){NI(e,this.group,this._progressiveEls,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(Ou),II=function(){},DI=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="normalCandlestickBox",n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new II},e.prototype.buildPath=function(t,e){var n=e.points;this.__simpleBox?(t.moveTo(n[4][0],n[4][1]),t.lineTo(n[6][0],n[6][1])):(t.moveTo(n[0][0],n[0][1]),t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]),t.lineTo(n[3][0],n[3][1]),t.closePath(),t.moveTo(n[4][0],n[4][1]),t.lineTo(n[5][0],n[5][1]),t.moveTo(n[6][0],n[6][1]),t.lineTo(n[7][0],n[7][1]))},e}(g);function TI(t,e,n){var i=t.ends;return new DI({shape:{points:n?LI(i,t):i},z2:100})}function CI(t,e){for(var n=!0,i=0;i<e.ends.length;i++)
  10491. // If any point are in the region.
  10492. if(t.contain(e.ends[i][0],e.ends[i][1])){n=!1;break}return n}function AI(t,e,n,i){var o=e.getItemModel(n);t.useStyle(e.getItemVisual(n,"style")),t.style.strokeNoScale=!0,t.__simpleBox=i,qi(t,o);var r=e.getItemLayout(n).sign;a(t.states,(function(t,e){var n=o.getModel(e),i=_I(r,n),a=bI(r,n)||i,s=t.style||(t.style={});i&&(s.fill=i),a&&(s.stroke=a)}));var s=o.getModel("emphasis");Ui(t,s.get("focus"),s.get("blurScope"),s.get("disabled"))}function LI(t,e){return n(t,(function(t){return(t=t.slice())[1]=e.initBaseline,t}))}var kI=function(){},PI=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="largeCandlestickBox",n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new kI},e.prototype.buildPath=function(t,e){for(
  10493. // Drawing lines is more efficient than drawing
  10494. // a whole line or drawing rects.
  10495. var n=e.points,i=0;i<n.length;)if(this.__sign===n[i++]){var o=n[i++];t.moveTo(o,n[i++]),t.lineTo(o,n[i++])}else i+=3},e}(g);function NI(t,e,n,i){var o=t.getData().getLayout("largePoints"),r=new PI({shape:{points:o},__sign:1,ignoreCoarsePointer:!0});e.add(r);var a=new PI({shape:{points:o},__sign:-1,ignoreCoarsePointer:!0});e.add(a);var s=new PI({shape:{points:o},__sign:0,ignoreCoarsePointer:!0});e.add(s),OI(1,r,t),OI(-1,a,t),OI(0,s,t),i&&(r.incremental=!0,a.incremental=!0),n&&n.push(r,a)}function OI(t,e,n,i){
  10496. // TODO put in visual?
  10497. var o=bI(t,n)||_I(t,n),r=n.getModel("itemStyle").getItemStyle(wI);
  10498. // Color must be excluded.
  10499. // Because symbol provide setColor individually to set fill and stroke
  10500. e.useStyle(r),e.style.fill=null,e.style.stroke=o}const RI=MI;var EI=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],n}
  10501. /**
  10502. * Get dimension for shadow in dataZoom
  10503. * @return dimension name
  10504. */return Ue(e,t),e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(t,e,n){var i=e.getItemLayout(t);return i&&n.rect(i.brushRect)},e.type="series.candlestick",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={
  10505. // zlevel: 0,
  10506. z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,
  10507. // xAxisIndex: 0,
  10508. // yAxisIndex: 0,
  10509. layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,
  10510. // borderColor: '#d24040',
  10511. // borderColor0: '#398f4f',
  10512. borderWidth:1},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(Su);nt(EI,nI,!0);const VI=EI;function zI(t){t&&i(t.series)&&
  10513. // Translate 'k' to 'candlestick'.
  10514. a(t.series,(function(t){o(t)&&"k"===t.type&&(t.type="candlestick")}))}var BI={seriesType:"candlestick",plan:Iu(),reset:function(t){var e=t.coordinateSystem,i=t.getData(),o=function(t,e){var n,i=t.getBaseAxis(),o="category"===i.type?i.getBandWidth():(n=i.getExtent(),Math.abs(n[1]-n[0])/e.count()),r=je(x(t.get("barMaxWidth"),o),o),a=je(x(t.get("barMinWidth"),1),o),s=t.get("barWidth");return null!=s?je(s,o):Math.max(Math.min(o/2,r),a)}(t,i),r=["x","y"],a=i.getDimensionIndex(i.mapDimension(r[0])),s=n(i.mapDimensionsAll(r[1]),i.getDimensionIndex,i),l=s[0],u=s[1],c=s[2],d=s[3];if(i.setLayout({candleWidth:o,
  10515. // The value is experimented visually.
  10516. isSimpleBox:o<=1.3}),!(a<0||s.length<4))return{progress:t.pipelineContext.large?function(n,i){
  10517. // Structure: [sign, x, yhigh, ylow, sign, x, yhigh, ylow, ...]
  10518. var o,r,s=xp(4*n.count),h=0,p=[],f=[],g=i.getStore(),y=!!t.get(["itemStyle","borderColorDoji"]);for(;null!=(r=n.next());){var m=g.get(a,r),v=g.get(l,r),x=g.get(u,r),_=g.get(c,r),b=g.get(d,r);isNaN(m)||isNaN(_)||isNaN(b)?(s[h++]=NaN,h+=3):(s[h++]=GI(g,r,v,x,u,y),p[0]=m,p[1]=_,o=e.dataToPoint(p,null,f),s[h++]=o?o[0]:NaN,s[h++]=o?o[1]:NaN,p[1]=b,o=e.dataToPoint(p,null,f),s[h++]=o?o[1]:NaN)}i.setLayout("largePoints",s)}:function(t,n){var i,r=n.getStore();for(;null!=(i=t.next());){var s=r.get(a,i),h=r.get(l,i),p=r.get(u,i),f=r.get(c,i),g=r.get(d,i),y=Math.min(h,p),m=Math.max(h,p),v=M(y,s),x=M(m,s),_=M(f,s),b=M(g,s),S=[];I(S,x,0),I(S,v,1),S.push(T(b),T(x),T(_),T(v));var w=!!n.getItemModel(i).get(["itemStyle","borderColorDoji"]);n.setItemLayout(i,{sign:GI(r,i,h,p,u,w),initBaseline:h>p?x[1]:v[1],ends:S,brushRect:D(f,g,s)})}function M(t,n){var i=[];return i[0]=n,i[1]=t,isNaN(n)||isNaN(t)?[NaN,NaN]:e.dataToPoint(i)}function I(t,e,n){var i=e.slice(),r=e.slice();i[0]=Io(i[0]+o/2,1,!1),r[0]=Io(r[0]-o/2,1,!0),n?t.push(i,r):t.push(r,i)}function D(t,e,n){var i=M(t,n),r=M(e,n);return i[0]-=o/2,r[0]-=o/2,{x:i[0],y:i[1],width:o,height:r[1]-i[1]}}function T(t){return t[0]=Io(t[0],1),t}}}}};
  10519. /**
  10520. * Get the sign of a single data.
  10521. *
  10522. * @returns 0 for doji with hasDojiColor: true,
  10523. * 1 for positive,
  10524. * -1 for negative.
  10525. */function GI(t,e,n,i,o,r){return n>i?-1:n<i?1:r?0:e>0?t.get(o,e-1)<=i?1:-1:1}const FI=BI;function WI(t,e){var n=e.rippleEffectColor||e.color;t.eachChild((function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?n:null,fill:"fill"===e.brushType?n:null}})}))}var HI=/** @class */function(t){function e(e,n){var i=t.call(this)||this,o=new Bg(e,n),r=new Z;return i.add(o),i.add(r),i.updateData(e,n),i}return Ue(e,t),e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var e=t.symbolType,n=t.color,i=t.rippleNumber,o=this.childAt(1),r=0;r<i;r++){
  10526. // If width/height are set too small (e.g., set to 1) on ios10
  10527. // and macOS Sierra, a circle stroke become a rect, no matter what
  10528. // the scale is set. So we set width/height as 2. See #4136.
  10529. var a=Gc(e,-1,-1,2,2,n);a.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scaleX:.5,scaleY:.5});var s=-r/i*t.period+t.effectOffset;a.animate("",!0).when(t.period,{scaleX:t.rippleScale/2,scaleY:t.rippleScale/2}).delay(s).start(),a.animateStyle(!0).when(t.period,{opacity:0}).delay(s).start(),o.add(a)}WI(o,t)},
  10530. /**
  10531. * Update effect symbol
  10532. */
  10533. e.prototype.updateEffectAnimation=function(t){for(var e=this._effectCfg,n=this.childAt(1),i=["symbolType","period","rippleScale","rippleNumber"],o=0;o<i.length;o++){var r=i[o];if(e[r]!==t[r])return this.stopEffectAnimation(),void this.startEffectAnimation(t)}WI(n,t)},
  10534. /**
  10535. * Highlight symbol
  10536. */
  10537. e.prototype.highlight=function(){ki(this)},
  10538. /**
  10539. * Downplay symbol
  10540. */
  10541. e.prototype.downplay=function(){Pi(this)},e.prototype.getSymbolType=function(){var t=this.childAt(0);return t&&t.getSymbolType()},
  10542. /**
  10543. * Update symbol properties
  10544. */
  10545. e.prototype.updateData=function(t,e){var n=this,i=t.hostModel;this.childAt(0).updateData(t,e);var o=this.childAt(1),r=t.getItemModel(e),a=t.getItemVisual(e,"symbol"),s=Fc(t.getItemVisual(e,"symbolSize")),l=t.getItemVisual(e,"style"),u=l&&l.fill,c=r.getModel("emphasis");o.setScale(s),o.traverse((function(t){t.setStyle("fill",u)}));var d=Wc(t.getItemVisual(e,"symbolOffset"),s);d&&(o.x=d[0],o.y=d[1]);var h=t.getItemVisual(e,"symbolRotate");o.rotation=(h||0)*Math.PI/180||0;var p={};p.showEffectOn=i.get("showEffectOn"),p.rippleScale=r.get(["rippleEffect","scale"]),p.brushType=r.get(["rippleEffect","brushType"]),p.period=1e3*r.get(["rippleEffect","period"]),p.effectOffset=e/t.count(),p.z=i.getShallow("z")||0,p.zlevel=i.getShallow("zlevel")||0,p.symbolType=a,p.color=u,p.rippleEffectColor=r.get(["rippleEffect","color"]),p.rippleNumber=r.get(["rippleEffect","number"]),"render"===p.showEffectOn?(this._effectCfg?this.updateEffectAnimation(p):this.startEffectAnimation(p),this._effectCfg=p):(
  10546. // Not keep old effect config
  10547. this._effectCfg=null,this.stopEffectAnimation(),this.onHoverStateChange=function(t){"emphasis"===t?"render"!==p.showEffectOn&&n.startEffectAnimation(p):"normal"===t&&"render"!==p.showEffectOn&&n.stopEffectAnimation()}),this._effectCfg=p,Ui(this,c.get("focus"),c.get("blurScope"),c.get("disabled"))},e.prototype.fadeOut=function(t){t&&t()},e}(Z);const YI=HI;const UI=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(){this._symbolDraw=new Yg(YI)},e.prototype.render=function(t,e,n){var i=t.getData(),o=this._symbolDraw;o.updateData(i,{clipShape:this._getClipShape(t)}),this.group.add(o.group)},e.prototype._getClipShape=function(t){var e=t.coordinateSystem,n=e&&e.getArea&&e.getArea();return t.get("clip",!0)?n:null},e.prototype.updateTransform=function(t,e,n){var i=t.getData();this.group.dirty();var o=my("").reset(t,e,n);o.progress&&o.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout()},e.prototype._updateGroupTransform=function(t){var e=t.coordinateSystem;e&&e.getRoamTransform&&(this.group.transform=Se(e.getRoamTransform()),this.group.decomposeTransform())},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0)},e.type="effectScatter",e}(Ou);const ZI=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return Ue(e,t),e.prototype.getInitialData=function(t,e){return Jh(null,this,{useEncodeDefaulter:!0})},e.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},e.type="series.effectScatter",e.dependencies=["grid","polar"],e.defaultOption={coordinateSystem:"cartesian2d",
  10548. // zlevel: 0,
  10549. z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,
  10550. // When to show the effect, option: 'render'|'emphasis'
  10551. showEffectOn:"render",clip:!0,
  10552. // Ripple effect config
  10553. rippleEffect:{period:4,
  10554. // Scale of ripple
  10555. scale:2.5,
  10556. // Brush type can be fill or stroke
  10557. brushType:"fill",
  10558. // Ripple number
  10559. number:3},universalTransition:{divideShape:"clone"},
  10560. // Cartesian coordinate system
  10561. // xAxisIndex: 0,
  10562. // yAxisIndex: 0,
  10563. // Polar coordinate system
  10564. // polarIndex: 0,
  10565. // Geo coordinate system
  10566. // geoIndex: 0,
  10567. // symbol: null, // 图形类型
  10568. symbolSize:10},e}(Su);var XI=/** @class */function(t){function e(e,n,i){var o=t.call(this)||this;return o.add(o.createLine(e,n,i)),o._updateEffectSymbol(e,n),o}return Ue(e,t),e.prototype.createLine=function(t,e,n){return new _S(t,e,n)},e.prototype._updateEffectSymbol=function(t,e){var n=t.getItemModel(e).getModel("effect"),o=n.get("symbolSize"),r=n.get("symbol");i(o)||(o=[o,o]);var a=t.getItemVisual(e,"style"),s=n.get("color")||a&&a.stroke,l=this.childAt(1);this._symbolType!==r&&(
  10569. // Remove previous
  10570. this.remove(l),(l=Gc(r,-.5,-.5,1,1,s)).z2=100,l.culling=!0,this.add(l)),
  10571. // Symbol may be removed if loop is false
  10572. l&&(
  10573. // Shadow color is same with color in default
  10574. l.setStyle("shadowColor",s),l.setStyle(n.getItemStyle(["color"])),l.scaleX=o[0],l.scaleY=o[1],l.setColor(s),this._symbolType=r,this._symbolScale=o,this._updateEffectAnimation(t,n,e))},e.prototype._updateEffectAnimation=function(t,e,n){var i=this.childAt(1);if(i){var o=t.getItemLayout(n),r=1e3*e.get("period"),a=e.get("loop"),s=e.get("roundTrip"),l=e.get("constantSpeed"),u=Yt(e.get("delay"),(function(e){return e/t.count()*r/3}));if(
  10575. // Ignore when updating
  10576. i.ignore=!0,this._updateAnimationPoints(i,o),l>0&&(r=this._getLineLength(i)/l*1e3),r!==this._period||a!==this._loop||s!==this._roundTrip){i.stopAnimation();var c=void 0;c=f(u)?u(n):u,i.__t>0&&(c=-r*i.__t),this._animateSymbol(i,r,c,a,s)}this._period=r,this._loop=a,this._roundTrip=s}},e.prototype._animateSymbol=function(t,e,n,i,o){if(e>0){t.__t=0;var r=this,a=t.animate("",i).when(o?2*e:e,{__t:o?2:1}).delay(n).during((function(){r._updateSymbolPosition(t)}));i||a.done((function(){r.remove(t)})),a.start()}},e.prototype._getLineLength=function(t){
  10577. // Not so accurate
  10578. return Pt(t.__p1,t.__cp1)+Pt(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},e.prototype.updateData=function(t,e,n){this.childAt(0).updateData(t,e,n),this._updateEffectSymbol(t,e)},e.prototype._updateSymbolPosition=function(t){var e=t.__p1,n=t.__p2,i=t.__cp1,o=t.__t<1?t.__t:2-t.__t,r=[t.x,t.y],a=r.slice(),s=_e,l=we;r[0]=s(e[0],i[0],n[0],o),r[1]=s(e[1],i[1],n[1],o);
  10579. // Tangent
  10580. var u=t.__t<1?l(e[0],i[0],n[0],o):l(n[0],i[0],e[0],1-o),c=t.__t<1?l(e[1],i[1],n[1],o):l(n[1],i[1],e[1],1-o);t.rotation=-Math.atan2(c,u)-Math.PI/2,
  10581. // enable continuity trail for 'line', 'rect', 'roundRect' symbolType
  10582. "line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==t.__lastT&&t.__lastT<t.__t?(t.scaleY=1.05*Pt(a,r),
  10583. // make sure the last segment render within endPoint
  10584. 1===o&&(r[0]=a[0]+(r[0]-a[0])/2,r[1]=a[1]+(r[1]-a[1])/2)):1===t.__lastT?
  10585. // After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly.
  10586. t.scaleY=2*Pt(e,r):t.scaleY=this._symbolScale[1]),t.__lastT=t.__t,t.ignore=!1,t.x=r[0],t.y=r[1]},e.prototype.updateLayout=function(t,e){this.childAt(0).updateLayout(t,e);var n=t.getItemModel(e).getModel("effect");this._updateEffectAnimation(t,n,e)},e}(Z);const jI=XI;var qI=/** @class */function(t){function e(e,n,i){var o=t.call(this)||this;return o._createPolyline(e,n,i),o}return Ue(e,t),e.prototype._createPolyline=function(t,e,n){
  10587. // let seriesModel = lineData.hostModel;
  10588. var i=t.getItemLayout(e),o=new B({shape:{points:i}});this.add(o),this._updateCommonStl(t,e,n)},e.prototype.updateData=function(t,e,n){var i=t.hostModel;io(this.childAt(0),{shape:{points:t.getItemLayout(e)}},i,e),this._updateCommonStl(t,e,n)},e.prototype._updateCommonStl=function(t,e,n){var i=this.childAt(0),o=t.getItemModel(e),r=n&&n.emphasisLineStyle,a=n&&n.focus,s=n&&n.blurScope,l=n&&n.emphasisDisabled;if(!n||t.hasItemOption){var u=o.getModel("emphasis");r=u.getModel("lineStyle").getLineStyle(),l=u.get("disabled"),a=u.get("focus"),s=u.get("blurScope")}i.useStyle(t.getItemVisual(e,"style")),i.style.fill=null,i.style.strokeNoScale=!0,i.ensureState("emphasis").style=r,Ui(this,a,s,l)},e.prototype.updateLayout=function(t,e){this.childAt(0).setShape("points",t.getItemLayout(e))},e}(Z);const KI=qI;var JI=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._lastFrame=0,e._lastFramePercent=0,e}
  10589. // Override
  10590. return Ue(e,t),e.prototype.createLine=function(t,e,n){return new KI(t,e,n)},
  10591. // Override
  10592. e.prototype._updateAnimationPoints=function(t,e){this._points=e;for(var n=[0],i=0,o=1;o<e.length;o++){var r=e[o-1],a=e[o];i+=Pt(r,a),n.push(i)}if(0!==i){for(o=0;o<n.length;o++)n[o]/=i;this._offsets=n,this._length=i}else this._length=0},
  10593. // Override
  10594. e.prototype._getLineLength=function(){return this._length},
  10595. // Override
  10596. e.prototype._updateSymbolPosition=function(t){var e=t.__t<1?t.__t:2-t.__t,n=this._points,i=this._offsets,o=n.length;if(i){var r,a=this._lastFrame;if(e<this._lastFramePercent){for(r=Math.min(a+1,o-1);r>=0&&!(i[r]<=e);r--);
  10597. // PENDING really need to do this ?
  10598. r=Math.min(r,o-2)}else{for(r=a;r<o&&!(i[r]>e);r++);r=Math.min(r-1,o-2)}var s=(e-i[r])/(i[r+1]-i[r]),l=n[r],u=n[r+1];t.x=l[0]*(1-s)+s*u[0],t.y=l[1]*(1-s)+s*u[1];var c=t.__t<1?u[0]-l[0]:l[0]-u[0],d=t.__t<1?u[1]-l[1]:l[1]-u[1];t.rotation=-Math.atan2(d,c)-Math.PI/2,this._lastFrame=r,this._lastFramePercent=e,t.ignore=!1}},e}(jI);const $I=JI;var QI=function(){this.polyline=!1,this.curveness=0,this.segs=[]},tD=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return Ue(e,t),e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new QI},e.prototype.buildPath=function(t,e){var n,i=e.segs,o=e.curveness;if(e.polyline)for(n=this._off;n<i.length;){var r=i[n++];if(r>0){t.moveTo(i[n++],i[n++]);for(var a=1;a<r;a++)t.lineTo(i[n++],i[n++])}}else for(n=this._off;n<i.length;){var s=i[n++],l=i[n++],u=i[n++],c=i[n++];if(t.moveTo(s,l),o>0){var d=(s+u)/2-(l-c)*o,h=(l+c)/2-(u-s)*o;t.quadraticCurveTo(d,h,u,c)}else t.lineTo(u,c)}this.incremental&&(this._off=n,this.notClear=!0)},e.prototype.findDataIndex=function(t,e){var n=this.shape,i=n.segs,o=n.curveness,r=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s<i.length;){var l=i[s++];if(l>0)for(var u=i[s++],c=i[s++],d=1;d<l;d++){var h=i[s++],p=i[s++];if(Me(u,c,h,p,r,t,e))return a}a++}else for(a=0,s=0;s<i.length;){u=i[s++],c=i[s++],h=i[s++],p=i[s++];if(o>0){if(Ie(u,c,(u+h)/2-(c-p)*o,(c+p)/2-(h-u)*o,h,p,r,t,e))return a}else if(Me(u,c,h,p,r,t,e))return a;a++}return-1},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect();return t=n[0],e=n[1],i.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},e.prototype.getBoundingRect=function(){
  10599. // Ignore stroke for large symbol draw.
  10600. var t=this._rect;if(!t){for(var e=this.shape.segs,n=Infinity,i=Infinity,o=-Infinity,r=-Infinity,a=0;a<e.length;){var s=e[a++],l=e[a++];n=Math.min(s,n),o=Math.max(s,o),i=Math.min(l,i),r=Math.max(l,r)}t=this._rect=new Y(n,i,o,r)}return t},e}(g);const eD=/** @class */function(){function t(){this.group=new Z}
  10601. /**
  10602. * Update symbols draw by new data
  10603. */return t.prototype.updateData=function(t){this._clear();var e=this._create();e.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(e,t)},
  10604. /**
  10605. * @override
  10606. */
  10607. t.prototype.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clear()},
  10608. /**
  10609. * @override
  10610. */
  10611. t.prototype.incrementalUpdate=function(t,e){var n=this._newAdded[0],i=e.getLayout("linesPoints"),o=n&&n.shape.segs;
  10612. // Merging the exists. Each element has 1e4 points.
  10613. // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization)
  10614. if(o&&o.length<2e4){var r=o.length,a=new Float32Array(r+i.length);
  10615. // Concat two array
  10616. a.set(o),a.set(i,r),n.setShape({segs:a})}else{
  10617. // Clear
  10618. this._newAdded=[];var s=this._create();s.incremental=!0,s.setShape({segs:i}),this._setCommon(s,e),s.__startIndex=t.start}},
  10619. /**
  10620. * @override
  10621. */
  10622. t.prototype.remove=function(){this._clear()},t.prototype.eachRendered=function(t){this._newAdded[0]&&t(this._newAdded[0])},t.prototype._create=function(){var t=new tD({cursor:"default",ignoreCoarsePointer:!0});return this._newAdded.push(t),this.group.add(t),t},t.prototype._setCommon=function(t,e,n){var i=e.hostModel;t.setShape({polyline:i.get("polyline"),curveness:i.get(["lineStyle","curveness"])}),t.useStyle(i.getModel("lineStyle").getLineStyle()),t.style.strokeNoScale=!0;var o=e.getVisual("style");o&&o.stroke&&t.setStyle("stroke",o.stroke),t.setStyle("fill",null);var r=ni(t);
  10623. // Enable tooltip
  10624. // PENDING May have performance issue when path is extremely large
  10625. r.seriesIndex=i.seriesIndex,t.on("mousemove",(function(e){r.dataIndex=null;var n=t.hoverDataIdx;n>0&&(
  10626. // Provide dataIndex for tooltip
  10627. r.dataIndex=n+t.__startIndex)}))},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();var nD={seriesType:"lines",plan:Iu(),reset:function(t){var e=t.coordinateSystem;if(e){var n=t.get("polyline"),i=t.pipelineContext.large;return{progress:function(o,r){var a=[];if(i){var s=void 0,l=o.end-o.start;if(n){for(var u=0,c=o.start;c<o.end;c++)u+=t.getLineCoordsCount(c);s=new Float32Array(l+2*u)}else s=new Float32Array(4*l);var d=0,h=[];for(c=o.start;c<o.end;c++){var p=t.getLineCoords(c,a);n&&(s[d++]=p);for(var f=0;f<p;f++)h=e.dataToPoint(a[f],!1,h),s[d++]=h[0],s[d++]=h[1]}r.setLayout("linesPoints",s)}else for(c=o.start;c<o.end;c++){var g=r.getItemModel(c),y=(p=t.getLineCoords(c,a),[]);if(n)for(var m=0;m<p;m++)y.push(e.dataToPoint(a[m]));else{y[0]=e.dataToPoint(a[0]),y[1]=e.dataToPoint(a[1]);var v=g.get(["lineStyle","curveness"]);+v&&(y[2]=[(y[0][0]+y[1][0])/2-(y[0][1]-y[1][1])*v,(y[0][1]+y[1][1])/2-(y[1][0]-y[0][0])*v])}r.setItemLayout(c,y)}}}}}};const iD=nD;const oD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),o=this._updateLineDraw(i,t),r=t.get("zlevel"),a=t.get(["effect","trailLength"]),s=n.getZr(),l="svg"===s.painter.getType();l||s.painter.getLayer(r).clear(!0),
  10628. // Config layer with motion blur
  10629. null==this._lastZlevel||l||s.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(t)&&a>0&&(l||s.configLayer(r,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})),o.updateData(i);var u=t.get("clip",!0)&&iy(t.coordinateSystem,!1,t);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=r,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateLineDraw(i,t).incrementalPrepareUpdate(i),this._clearLayer(n),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._lineDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,e,n){var i=t.getData(),o=t.pipelineContext;if(!this._finished||o.large||o.progressiveRender)
  10630. // TODO Don't have to do update in large mode. Only do it when there are millions of data.
  10631. return{update:!0};
  10632. // TODO Use same logic with ScatterView.
  10633. // Manually update layout
  10634. var r=iD.reset(t,e,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),
  10635. // Not in large mode
  10636. this._lineDraw.updateLayout(),this._clearLayer(n)},e.prototype._updateLineDraw=function(t,e){var n=this._lineDraw,i=this._showEffect(e),o=!!e.get("polyline"),r=e.pipelineContext.large;return n&&i===this._hasEffet&&o===this._isPolyline&&r===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=r?new eD:new MS(o?i?$I:KI:i?jI:_S),this._hasEffet=i,this._isPolyline=o,this._isLargeDraw=r),this.group.add(n.group),n},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){
  10637. // Not use motion when dragging or zooming
  10638. var e=t.getZr();"svg"===e.painter.getType()||null==this._lastZlevel||e.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,
  10639. // Clear motion when lineDraw is removed
  10640. this._clearLayer(e)},e.prototype.dispose=function(t,e){this.remove(t,e)},e.type="lines",e}(Ou);var rD="undefined"==typeof Uint32Array?Array:Uint32Array,aD="undefined"==typeof Float64Array?Array:Float64Array;function sD(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=n(e,(function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),ne([e,t[0],t[1]])})))}var lD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return Ue(e,t),e.prototype.init=function(e){
  10641. // The input data may be null/undefined.
  10642. e.data=e.data||[],
  10643. // Not using preprocessor because mergeOption may not have series.type
  10644. sD(e);var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(e){if(sD(e),e.data){
  10645. // Only update when have option data to merge.
  10646. var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=ct(this._flatCoords,e.flatCoords),this._flatCoordsOffset=ct(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var e=this.getData().getItemModel(t);return e.option instanceof Array?e.option:e.getShallow("coords")},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],i=this._flatCoordsOffset[2*t+1],o=0;o<i;o++)e[o]=e[o]||[],e[o][0]=this._flatCoords[n+2*o],e[o][1]=this._flatCoords[n+2*o+1];return i}var r=this._getCoordsFromItemModel(t);for(o=0;o<r.length;o++)e[o]=e[o]||[],e[o][0]=r[o][0],e[o][1]=r[o][1];return r.length},e.prototype._processFlatCoordsArray=function(t){var e=0;
  10647. // Stored as a typed array. In format
  10648. // Points Count(2) | x | y | x | y | Points Count(3) | x | y | x | y | x | y |
  10649. if(this._flatCoords&&(e=this._flatCoords.length),l(t[0])){for(var n=t.length,i=new rD(n),o=new aD(n),r=0,a=0,s=0,u=0
  10650. // Store offset and len of each segment
  10651. ;u<n;){s++;var c=t[u++];
  10652. // Offset
  10653. i[a++]=r+e,
  10654. // Len
  10655. i[a++]=c;for(var d=0;d<c;d++){var h=t[u++],p=t[u++];o[r++]=h,o[r++]=p}}return{flatCoordsOffset:new Uint32Array(i.buffer,0,a),flatCoords:o,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:t.length}},e.prototype.getInitialData=function(t,e){var n=new Fh(["value"],this);return n.hasItemOption=!1,n.initData(t.data,[],(function(t,e,i,o){
  10656. // dataItem is simply coords
  10657. if(t instanceof Array)return NaN;n.hasItemOption=!0;var r=t.value;return null!=r?r instanceof Array?r[o]:r:void 0})),n},e.prototype.formatTooltip=function(t,e,n){var i=this.getData().getItemModel(t),o=i.get("name");if(o)return o;var r=i.get("fromName"),a=i.get("toName"),s=[];return null!=r&&s.push(r),null!=a&&s.push(a),$l("nameValue",{name:s.join(" > ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),e=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&e>0?e+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",
  10658. // zlevel: 0,
  10659. z:2,legendHoverLink:!0,
  10660. // Cartesian coordinate system
  10661. xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],
  10662. // Geo coordinate system
  10663. geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,
  10664. // Available when large is true
  10665. largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(Su);const uD=lD;
  10666. /*
  10667. * Licensed to the Apache Software Foundation (ASF) under one
  10668. * or more contributor license agreements. See the NOTICE file
  10669. * distributed with this work for additional information
  10670. * regarding copyright ownership. The ASF licenses this file
  10671. * to you under the Apache License, Version 2.0 (the
  10672. * "License"); you may not use this file except in compliance
  10673. * with the License. You may obtain a copy of the License at
  10674. *
  10675. * http://www.apache.org/licenses/LICENSE-2.0
  10676. *
  10677. * Unless required by applicable law or agreed to in writing,
  10678. * software distributed under the License is distributed on an
  10679. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  10680. * KIND, either express or implied. See the License for the
  10681. * specific language governing permissions and limitations
  10682. * under the License.
  10683. */
  10684. /**
  10685. * AUTO-GENERATED FILE. DO NOT MODIFY.
  10686. */
  10687. /*
  10688. * Licensed to the Apache Software Foundation (ASF) under one
  10689. * or more contributor license agreements. See the NOTICE file
  10690. * distributed with this work for additional information
  10691. * regarding copyright ownership. The ASF licenses this file
  10692. * to you under the Apache License, Version 2.0 (the
  10693. * "License"); you may not use this file except in compliance
  10694. * with the License. You may obtain a copy of the License at
  10695. *
  10696. * http://www.apache.org/licenses/LICENSE-2.0
  10697. *
  10698. * Unless required by applicable law or agreed to in writing,
  10699. * software distributed under the License is distributed on an
  10700. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  10701. * KIND, either express or implied. See the License for the
  10702. * specific language governing permissions and limitations
  10703. * under the License.
  10704. */function cD(t){return t instanceof Array||(t=[t,t]),t}const dD={seriesType:"lines",reset:function(t){var e=cD(t.get("symbol")),n=cD(t.get("symbolSize")),i=t.getData();return i.setVisual("fromSymbol",e&&e[0]),i.setVisual("toSymbol",e&&e[1]),i.setVisual("fromSymbolSize",n&&n[0]),i.setVisual("toSymbolSize",n&&n[1]),{dataEach:i.hasItemOption?function(t,e){var n=t.getItemModel(e),i=cD(n.getShallow("symbol",!0)),o=cD(n.getShallow("symbolSize",!0));i[0]&&t.setItemVisual(e,"fromSymbol",i[0]),i[1]&&t.setItemVisual(e,"toSymbol",i[1]),o[0]&&t.setItemVisual(e,"fromSymbolSize",o[0]),o[1]&&t.setItemVisual(e,"toSymbolSize",o[1])}:null}}};var hD=/** @class */function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=gt.createCanvas();this.canvas=t}
  10705. /**
  10706. * Renders Heatmap and returns the rendered canvas
  10707. * @param data array of data, each has x, y, value
  10708. * @param width canvas width
  10709. * @param height canvas height
  10710. */return t.prototype.update=function(t,e,n,i,o,r){var a=this._getBrush(),s=this._getGradient(o,"inRange"),l=this._getGradient(o,"outOfRange"),u=this.pointSize+this.blurSize,c=this.canvas,d=c.getContext("2d"),h=t.length;c.width=e,c.height=n;for(var p=0;p<h;++p){var f=t[p],g=f[0],y=f[1],m=i(f[2]);
  10711. // draw with the circle brush with alpha
  10712. d.globalAlpha=m,d.drawImage(a,g-u,y-u)}if(!c.width||!c.height)
  10713. // Avoid "Uncaught DOMException: Failed to execute 'getImageData' on
  10714. // 'CanvasRenderingContext2D': The source height is 0."
  10715. return c;
  10716. // colorize the canvas using alpha value and set with gradient
  10717. for(var v=d.getImageData(0,0,c.width,c.height),x=v.data,_=0,b=x.length,S=this.minOpacity,w=this.maxOpacity-S;_<b;){m=x[_+3]/256;var M=4*Math.floor(255*m);
  10718. // Simple optimize to ignore the empty data
  10719. if(m>0){var I=r(m)?s:l;
  10720. // Any alpha > 0 will be mapped to [minOpacity, maxOpacity]
  10721. m>0&&(m=m*w+S),x[_++]=I[M],x[_++]=I[M+1],x[_++]=I[M+2],x[_++]=I[M+3]*m*256}else _+=4}return d.putImageData(v,0,0),c},
  10722. /**
  10723. * get canvas of a black circle brush used for canvas to draw later
  10724. */
  10725. t.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=gt.createCanvas()),e=this.pointSize+this.blurSize,n=2*e;
  10726. // set brush size
  10727. t.width=n,t.height=n;var i=t.getContext("2d");return i.clearRect(0,0,n,n),
  10728. // in order to render shadow without the distinct circle,
  10729. // draw the distinct circle in an invisible place,
  10730. // and use shadowOffset to draw shadow in the center of the canvas
  10731. i.shadowOffsetX=n,i.shadowBlur=this.blurSize,
  10732. // draw the shadow in black, and use alpha and shadow blur to generate
  10733. // color in color map
  10734. i.shadowColor="#000",
  10735. // draw circle in the left to the canvas
  10736. i.beginPath(),i.arc(-e,e,this.pointSize,0,2*Math.PI,!0),i.closePath(),i.fill(),t},
  10737. /**
  10738. * get gradient color map
  10739. * @private
  10740. */
  10741. t.prototype._getGradient=function(t,e){for(var n=this._gradientPixels,i=n[e]||(n[e]=new Uint8ClampedArray(1024)),o=[0,0,0,0],r=0,a=0;a<256;a++)t[e](a/255,!0,o),i[r++]=o[0],i[r++]=o[1],i[r++]=o[2],i[r++]=o[3];return i},t}();const pD=hD;function fD(t){var e=t.dimensions;
  10742. // Not use coordSys.type === 'geo' because coordSys maybe extended
  10743. return"lng"===e[0]&&"lat"===e[1]}var gD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i;e.eachComponent("visualMap",(function(e){e.eachTargetSeries((function(n){n===t&&(i=e)}))})),
  10744. // Clear previously rendered progressive elements.
  10745. this._progressiveEls=null,this.group.removeAll();var o=t.coordinateSystem;"cartesian2d"===o.type||"calendar"===o.type?this._renderOnCartesianAndCalendar(t,n,0,t.getData().count()):fD(o)&&this._renderOnGeo(o,t,i,n)},e.prototype.incrementalPrepareRender=function(t,e,n){this.group.removeAll()},e.prototype.incrementalRender=function(t,e,n,i){var o=e.coordinateSystem;o&&(
  10746. // geo does not support incremental rendering?
  10747. fD(o)?this.render(e,n,i):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(e,i,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){Bo(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,e,n,i,o){var r,a,s,l,u=t.coordinateSystem,c=oy(u,"cartesian2d");if(c){var d=u.getAxis("x"),h=u.getAxis("y");
  10748. // add 0.5px to avoid the gaps
  10749. r=d.getBandWidth()+.5,a=h.getBandWidth()+.5,s=d.scale.getExtent(),l=h.scale.getExtent()}for(var p=this.group,f=t.getData(),g=t.getModel(["emphasis","itemStyle"]).getItemStyle(),y=t.getModel(["blur","itemStyle"]).getItemStyle(),m=t.getModel(["select","itemStyle"]).getItemStyle(),v=t.get(["itemStyle","borderRadius"]),x=Uo(t),_=t.getModel("emphasis"),b=_.get("focus"),S=_.get("blurScope"),w=_.get("disabled"),M=c?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],I=n;I<i;I++){var D=void 0,T=f.getItemVisual(I,"style");if(c){var C=f.get(M[0],I),A=f.get(M[1],I);
  10750. // Ignore empty data and out of extent data
  10751. if(isNaN(f.get(M[2],I))||isNaN(C)||isNaN(A)||C<s[0]||C>s[1]||A<l[0]||A>l[1])continue;var L=u.dataToPoint([C,A]);D=new G({shape:{x:L[0]-r/2,y:L[1]-a/2,width:r,height:a},style:T})}else{
  10752. // Ignore empty data
  10753. if(isNaN(f.get(M[1],I)))continue;D=new G({z2:1,shape:u.dataToRect([f.get(M[0],I)]).contentShape,style:T})}
  10754. // Optimization for large dataset
  10755. if(f.hasItemOption){var k=f.getItemModel(I),P=k.getModel("emphasis");g=P.getModel("itemStyle").getItemStyle(),y=k.getModel(["blur","itemStyle"]).getItemStyle(),m=k.getModel(["select","itemStyle"]).getItemStyle(),
  10756. // Each item value struct in the data would be firstly
  10757. // {
  10758. // itemStyle: { borderRadius: [30, 30] },
  10759. // value: [2022, 02, 22]
  10760. // }
  10761. v=k.get(["itemStyle","borderRadius"]),b=P.get("focus"),S=P.get("blurScope"),w=P.get("disabled"),x=Uo(k)}D.shape.r=v;var N=t.getRawValue(I),O="-";N&&null!=N[2]&&(O=N[2]+""),Yo(D,x,{labelFetcher:t,labelDataIndex:I,defaultOpacity:T.opacity,defaultText:O}),D.ensureState("emphasis").style=g,D.ensureState("blur").style=y,D.ensureState("select").style=m,Ui(D,b,S,w),D.incremental=o,
  10762. // PENDING
  10763. o&&(
  10764. // Rect must use hover layer if it's incremental.
  10765. D.states.emphasis.hoverLayer=!0),p.add(D),f.setItemGraphicEl(I,D),this._progressiveEls&&this._progressiveEls.push(D)}},e.prototype._renderOnGeo=function(t,e,i,o){var r=i.targetVisuals.inRange,a=i.targetVisuals.outOfRange,s=e.getData(),l=this._hmLayer||this._hmLayer||new pD;l.blurSize=e.get("blurSize"),l.pointSize=e.get("pointSize"),l.minOpacity=e.get("minOpacity"),l.maxOpacity=e.get("maxOpacity");var u=t.getViewRect().clone(),c=t.getRoamTransform();u.applyTransform(c);
  10766. // Clamp on viewport
  10767. var d=Math.max(u.x,0),h=Math.max(u.y,0),p=Math.min(u.width+u.x,o.getWidth()),f=Math.min(u.height+u.y,o.getHeight()),g=p-d,y=f-h,m=[s.mapDimension("lng"),s.mapDimension("lat"),s.mapDimension("value")],v=s.mapArray(m,(function(e,n,i){var o=t.dataToPoint([e,n]);return o[0]-=d,o[1]-=h,o.push(i),o})),x=i.getExtent(),_="visualMap.continuous"===i.type?function(t,e){var n=t[1]-t[0];return e=[(e[0]-t[0])/n,(e[1]-t[0])/n],function(t){return t>=e[0]&&t<=e[1]}}(x,i.option.range):function(t,e,i){var o=t[1]-t[0],r=(e=n(e,(function(e){return{interval:[(e.interval[0]-t[0])/o,(e.interval[1]-t[0])/o]}}))).length,a=0;return function(t){var n;
  10768. // Try to find in the location of the last found
  10769. for(n=a;n<r;n++)if((o=e[n].interval)[0]<=t&&t<=o[1]){a=n;break}if(n===r)
  10770. // Not found, back interation
  10771. for(n=a-1;n>=0;n--){var o;if((o=e[n].interval)[0]<=t&&t<=o[1]){a=n;break}}return n>=0&&n<r&&i[n]}}(x,i.getPieceList(),i.option.selected);l.update(v,g,y,r.color.getNormalizer(),{inRange:r.color.getColorMapper(),outOfRange:a.color.getColorMapper()},_);var S=new b({style:{width:g,height:y,x:d,y:h,image:l.canvas},silent:!0});this.group.add(S)},e.type="heatmap",e}(Ou);const yD=gD;const mD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.getInitialData=function(t,e){return Jh(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=fs.get(this.get("coordinateSystem"));if(t&&t.dimensions)return"lng"===t.dimensions[0]&&"lat"===t.dimensions[1]},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",
  10772. // zlevel: 0,
  10773. z:2,
  10774. // Cartesian coordinate system
  10775. // xAxisIndex: 0,
  10776. // yAxisIndex: 0,
  10777. // Geo coordinate system
  10778. geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}(Su);var vD=["itemStyle","borderWidth"],xD=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],_D=new O;
  10779. // index: +isHorizontal
  10780. // Set or calculate default value about symbol, and calculate layout info.
  10781. function bD(t,e,n,o){var r=t.getItemLayout(e),a=n.get("symbolRepeat"),s=n.get("symbolClip"),l=n.get("symbolPosition")||"start",u=(n.get("symbolRotate")||0)*Math.PI/180||0,c=n.get("symbolPatternSize")||2,d=n.isAnimationEnabled(),h={dataIndex:e,layout:r,itemModel:n,symbolType:t.getItemVisual(e,"symbol")||"circle",style:t.getItemVisual(e,"style"),symbolClip:s,symbolRepeat:a,symbolRepeatDirection:n.get("symbolRepeatDirection"),symbolPatternSize:c,rotation:u,animationModel:d?n:null,hoverScale:d&&n.get(["emphasis","scale"]),z2:n.getShallow("z",!0)||0};!
  10782. // bar length can be negative.
  10783. function(t,e,n,o,r){var a,s=o.valueDim,l=t.get("symbolBoundingData"),u=o.coordSys.getOtherAxis(o.coordSys.getBaseAxis()),c=u.toGlobalCoord(u.dataToCoord(0)),d=1-+(n[s.wh]<=0);if(i(l)){var h=[SD(u,l[0])-c,SD(u,l[1])-c];h[1]<h[0]&&h.reverse(),a=h[d]}else a=null!=l?SD(u,l)-c:e?o.coordSysExtent[s.index][d]-c:n[s.wh];r.boundingLength=a,e&&(r.repeatCutLength=n[s.wh]);
  10784. // if 'pxSign' means sign of pixel, it can't be zero, or symbolScale will be zero
  10785. // and when borderWidth be settled, the actual linewidth will be NaN
  10786. var p="x"===s.xy,f=u.inverse;r.pxSign=p&&!f||!p&&f?a>=0?1:-1:a>0?1:-1}(n,a,r,o,h),
  10787. // Support ['100%', '100%']
  10788. function(t,e,n,o,r,a,s,l,u,c){var d,h=u.valueDim,p=u.categoryDim,f=Math.abs(n[p.wh]),g=t.getItemVisual(e,"symbolSize");d=i(g)?g.slice():null==g?["100%","100%"]:[g,g];
  10789. // Note: percentage symbolSize (like '100%') do not consider lineWidth, because it is
  10790. // to complicated to calculate real percent value if considering scaled lineWidth.
  10791. // So the actual size will bigger than layout size if lineWidth is bigger than zero,
  10792. // which can be tolerated in pictorial chart.
  10793. d[p.index]=je(d[p.index],f),d[h.index]=je(d[h.index],o?f:Math.abs(a)),c.symbolSize=d;
  10794. // If x or y is less than zero, show reversed shape.
  10795. var y=c.symbolScale=[d[0]/l,d[1]/l];
  10796. // Follow convention, 'right' and 'top' is the normal scale.
  10797. y[h.index]*=(u.isHorizontal?-1:1)*s}(t,e,r,a,0,h.boundingLength,h.pxSign,c,o,h),function(t,e,n,i,o){
  10798. // In symbols are drawn with scale, so do not need to care about the case that width
  10799. // or height are too small. But symbol use strokeNoScale, where acture lineWidth should
  10800. // be calculated.
  10801. var r=t.get(vD)||0;r&&(_D.attr({scaleX:e[0],scaleY:e[1],rotation:n}),_D.updateTransform(),r/=_D.getLineScale(),r*=e[i.valueDim.index]);o.valueLineWidth=r||0}(n,h.symbolScale,u,o,h);var f=h.symbolSize,g=Wc(n.get("symbolOffset"),f);return function(t,e,n,i,o,r,a,s,l,u,c,d){var h=c.categoryDim,f=c.valueDim,g=d.pxSign,y=Math.max(e[f.index]+s,0),m=y;
  10802. // Note: rotation will not effect the layout of symbols, because user may
  10803. // want symbols to rotate on its center, which should not be translated
  10804. // when rotating.
  10805. if(i){var v=Math.abs(l),x=Yt(t.get("symbolMargin"),"15%")+"",_=!1;x.lastIndexOf("!")===x.length-1&&(_=!0,x=x.slice(0,x.length-1));var b=je(x,e[f.index]),S=Math.max(y+2*b,0),w=_?0:2*b,M=fn(i),I=M?i:VD((v+w)/S);S=y+2*(b=(v-I*y)/2/(_?I:Math.max(I-1,1))),w=_?0:2*b,
  10806. // Update repeatTimes when not all symbol will be shown.
  10807. M||"fixed"===i||(I=u?VD((Math.abs(u)+w)/S):0),m=I*S-w,d.repeatTimes=I,d.symbolMargin=b}var D=g*(m/2),T=d.pathPosition=[];// 'center'
  10808. T[h.index]=n[h.wh]/2,T[f.index]="start"===a?D:"end"===a?l-D:l/2,r&&(T[0]+=r[0],T[1]+=r[1]);var C=d.bundlePosition=[];C[h.index]=n[h.xy],C[f.index]=n[f.xy];var A=d.barRectShape=p({},n);A[f.wh]=g*Math.max(Math.abs(n[f.wh]),Math.abs(T[f.index]+D)),A[h.wh]=n[h.wh];var L=d.clipShape={};
  10809. // Consider that symbol may be overflow layout rect.
  10810. L[h.xy]=-n[h.xy],L[h.wh]=c.ecSize[h.wh],L[f.xy]=0,L[f.wh]=n[f.wh]}(n,f,r,a,0,g,l,h.valueLineWidth,h.boundingLength,h.repeatCutLength,o,h),h}function SD(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function wD(t){var e=t.symbolPatternSize,n=Gc(
  10811. // Consider texture img, make a big size.
  10812. t.symbolType,-e/2,-e/2,e,e);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function MD(t,e,n,i){var o=t.__pictorialBundle,r=n.symbolSize,a=n.valueLineWidth,s=n.pathPosition,l=e.valueDim,u=n.repeatTimes||0,c=0,d=r[e.valueDim.index]+a+2*n.symbolMargin;for(OD(t,(function(t){t.__pictorialAnimationIndex=c,t.__pictorialRepeatTimes=u,c<u?RD(t,null,f(c),n,i):RD(t,null,{scaleX:0,scaleY:0},n,i,(function(){o.remove(t)})),
  10813. // updateHoverAnimation(path, symbolMeta);
  10814. c++}));c<u;c++){var h=wD(n);h.__pictorialAnimationIndex=c,h.__pictorialRepeatTimes=u,o.add(h);var p=f(c);RD(h,{x:p.x,y:p.y,scaleX:0,scaleY:0},{scaleX:p.scaleX,scaleY:p.scaleY,rotation:p.rotation},n,i)}function f(t){var e=s.slice(),i=n.pxSign,o=t;
  10815. // (start && pxSign > 0) || (end && pxSign < 0): i = repeatTimes - index
  10816. // Otherwise: i = index;
  10817. return("start"===n.symbolRepeatDirection?i>0:i<0)&&(o=u-1-t),e[l.index]=d*(o-u/2+.5)+s[l.index],{x:e[0],y:e[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function ID(t,e,n,i){var o=t.__pictorialBundle,r=t.__pictorialMainPath;r?RD(r,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,i):(r=t.__pictorialMainPath=wD(n),o.add(r),RD(r,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,i))}
  10818. // bar rect is used for label.
  10819. function DD(t,e,n){var i=p({},e.barRectShape),o=t.__pictorialBarRect;o?RD(o,null,{shape:i},e,n):((o=t.__pictorialBarRect=new G({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}})).disableMorphing=!0,t.add(o))}function TD(t,e,n,i){
  10820. // If not clip, symbol will be remove and rebuilt.
  10821. if(n.symbolClip){var o=t.__pictorialClipPath,r=p({},n.clipShape),a=e.valueDim,s=n.animationModel,l=n.dataIndex;if(o)io(o,{shape:r},s,l);else{r[a.wh]=0,o=new G({shape:r}),t.__pictorialBundle.setClipPath(o),t.__pictorialClipPath=o;var u={};u[a.wh]=n.clipShape[a.wh],Go[i?"updateProps":"initProps"](o,{shape:u},s,l)}}}function CD(t,e){var n=t.getItemModel(e);return n.getAnimationDelayParams=AD,n.isAnimationEnabled=LD,n}function AD(t){
  10822. // The order is the same as the z-order, see `symbolRepeatDiretion`.
  10823. return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function LD(){
  10824. // `animation` prop can be set on itemModel in pictorial bar chart.
  10825. return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function kD(t,e,n,i){
  10826. // bar is the main element for each data.
  10827. var o=new Z,r=new Z;
  10828. // bundle is used for location and clip.
  10829. return o.add(r),o.__pictorialBundle=r,r.x=n.bundlePosition[0],r.y=n.bundlePosition[1],n.symbolRepeat?MD(o,e,n):ID(o,0,n),DD(o,n,i),TD(o,e,n,i),o.__pictorialShapeStr=ND(t,n),o.__pictorialSymbolMeta=n,o}function PD(t,e,n,i){
  10830. // Not show text when animating
  10831. var o=i.__pictorialBarRect;o&&o.removeTextContent();var r=[];OD(i,(function(t){r.push(t)})),i.__pictorialMainPath&&r.push(i.__pictorialMainPath),
  10832. // I do not find proper remove animation for clip yet.
  10833. i.__pictorialClipPath&&(n=null),a(r,(function(t){ao(t,{scaleX:0,scaleY:0},n,e,(function(){i.parent&&i.parent.remove(i)}))})),t.setItemGraphicEl(e,null)}function ND(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function OD(t,e,n){
  10834. // Do not use Group#eachChild, because it do not support remove.
  10835. a(t.__pictorialBundle.children(),(function(i){i!==t.__pictorialBarRect&&e.call(n,i)}))}function RD(t,e,n,i,o,r){e&&t.attr(e),
  10836. // when symbolCip used, only clip path has init animation, otherwise it would be weird effect.
  10837. i.symbolClip&&!o?n&&t.attr(n):n&&Go[o?"updateProps":"initProps"](t,n,i.animationModel,i.dataIndex,r)}function ED(t,e,n){var i=n.dataIndex,o=n.itemModel,r=o.getModel("emphasis"),a=r.getModel("itemStyle").getItemStyle(),s=o.getModel(["blur","itemStyle"]).getItemStyle(),l=o.getModel(["select","itemStyle"]).getItemStyle(),u=o.getShallow("cursor"),c=r.get("focus"),d=r.get("blurScope"),h=r.get("scale");OD(t,(function(t){if(t instanceof b){var e=t.style;t.useStyle(p({
  10838. // TODO other properties like dx, dy ?
  10839. image:e.image,x:e.x,y:e.y,width:e.width,height:e.height},n.style))}else t.useStyle(n.style);var i=t.ensureState("emphasis");i.style=a,h&&(
  10840. // NOTE: Must after scale is set after updateAttr
  10841. i.scaleX=1.1*t.scaleX,i.scaleY=1.1*t.scaleY),t.ensureState("blur").style=s,t.ensureState("select").style=l,u&&(t.cursor=u),t.z2=n.z2}));var f=e.valueDim.posDesc[+(n.boundingLength>0)],g=t.__pictorialBarRect;g.ignoreClip=!0,Yo(g,Uo(o),{labelFetcher:e.seriesModel,labelDataIndex:i,defaultText:Rg(e.seriesModel.getData(),i),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:f}),Ui(t,c,d,r.get("disabled"))}function VD(t){var e=Math.round(t);
  10842. // Escapse accurate error
  10843. return Math.abs(t-e)<1e-4?e:Math.ceil(t)}const zD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=this.group,o=t.getData(),r=this._data,a=t.coordinateSystem,s=a.getBaseAxis().isHorizontal(),l=a.master.getRect(),u={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:t,coordSys:a,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:s,valueDim:xD[+s],categoryDim:xD[1-+s]};o.diff(r).add((function(t){if(o.hasValue(t)){var e=CD(o,t),n=bD(o,t,e,u),r=kD(o,u,n);o.setItemGraphicEl(t,r),i.add(r),ED(r,u,n)}})).update((function(t,e){var n=r.getItemGraphicEl(e);if(o.hasValue(t)){var a=CD(o,t),s=bD(o,t,a,u),l=ND(o,s);n&&l!==n.__pictorialShapeStr&&(i.remove(n),o.setItemGraphicEl(t,null),n=null),n?function(t,e,n){var i=n.animationModel,o=n.dataIndex,r=t.__pictorialBundle;io(r,{x:n.bundlePosition[0],y:n.bundlePosition[1]},i,o),n.symbolRepeat?MD(t,e,n,!0):ID(t,e,n,!0);DD(t,n,!0),TD(t,e,n,!0)}(n,u,s):n=kD(o,u,s,!0),o.setItemGraphicEl(t,n),n.__pictorialSymbolMeta=s,
  10844. // Add back
  10845. i.add(n),ED(n,u,s)}else i.remove(n)})).remove((function(t){var e=r.getItemGraphicEl(t);e&&PD(r,t,e.__pictorialSymbolMeta.animationModel,e)})).execute();
  10846. // Do clipping
  10847. var c=t.get("clip",!0)?iy(t.coordinateSystem,!1,t):null;return c?i.setClipPath(c):i.removeClipPath(),this._data=o,this.group},e.prototype.remove=function(t,e){var n=this.group,i=this._data;t.get("animation")?i&&i.eachItemGraphicEl((function(e){PD(i,ni(e).dataIndex,t,e)})):n.removeAll()},e.type="pictorialBar",e}(Ou);const BD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n.defaultSymbol="roundRect",n}return Ue(e,t),e.prototype.getInitialData=function(e){
  10848. // Disable stack.
  10849. return e.stack=null,t.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=xr(Sy.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",
  10850. // Pictorial bar do not clip by default because in many cases
  10851. // xAxis and yAxis are not displayed and it's expected not to clip
  10852. clip:!1,
  10853. // z can be set in data item, which is z2 actually.
  10854. // Disable progressive
  10855. progressive:0,emphasis:{
  10856. // By default pictorialBar do not hover scale. Hover scale is not suitable
  10857. // for the case that both has foreground and background.
  10858. scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(Sy);var GD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._layers=[],n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),o=this,r=this.group,a=t.getLayerSeries(),s=i.getLayout("layoutInfo"),l=s.rect,u=s.boundaryGap;function c(t){return t.name}r.x=0,r.y=l.y+u[0];var d=new yh(this._layersSeries||[],a,c,c),h=[];function p(e,n,s){var l=o._layers;if("remove"!==e){for(var u,c,d=[],p=[],f=a[n].indices,g=0;g<f.length;g++){var y=i.getItemLayout(f[g]),m=y.x,v=y.y0,x=y.y;d.push(m,v),p.push(m,v+x),u=i.getItemVisual(f[g],"style")}var _=i.getItemLayout(f[0]),b=t.getModel("label").get("margin"),S=t.getModel("emphasis");if("add"===e){var w=h[n]=new Z;c=new ty({shape:{points:d,stackedOnPoints:p,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),w.add(c),r.add(w),t.isAnimationEnabled()&&c.setClipPath(
  10859. // add animation to the view
  10860. function(t,e,n){var i=new G({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return oo(i,{shape:{x:t.x-50,width:t.width+100,height:t.height+20}},e,n),i}(c.getBoundingRect(),t,(function(){c.removeClipPath()})))}else{w=l[s];c=w.childAt(0),r.add(w),h[n]=w,io(c,{shape:{points:d,stackedOnPoints:p}},t),uo(c)}Yo(c,Uo(t),{labelDataIndex:f[g-1],defaultText:i.getName(f[g-1]),inheritColor:u.fill},{normal:{verticalAlign:"middle"}}),c.setTextConfig({position:null,local:!0});var M=c.getTextContent();
  10861. // TODO More label position options.
  10862. M&&(M.x=_.x-b,M.y=_.y0+_.y/2),c.useStyle(u),i.setItemGraphicEl(n,c),qi(c,t),Ui(c,S.get("focus"),S.get("blurScope"),S.get("disabled"))}else r.remove(l[n])}d.add(lt(p,this,"add")).update(lt(p,this,"update")).remove(lt(p,this,"remove")).execute(),this._layersSeries=a,this._layers=h},e.type="themeRiver",e}(Ou);const FD=GD;var WD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}
  10863. /**
  10864. * @override
  10865. */return Ue(e,t),e.prototype.init=function(e){
  10866. // eslint-disable-next-line
  10867. t.prototype.init.apply(this,arguments),
  10868. // Put this function here is for the sake of consistency of code style.
  10869. // Enable legend selection for each data item
  10870. // Use a function instead of direct access because data reference may changed
  10871. this.legendVisualProvider=new dm(lt(this.getData,this),lt(this.getRawData,this))},
  10872. /**
  10873. * If there is no value of a certain point in the time for some event,set it value to 0.
  10874. *
  10875. * @param {Array} data initial data in the option
  10876. * @return {Array}
  10877. */
  10878. e.prototype.fixData=function(t){var e=t.length,n={},i=Wn(t,(function(t){return n.hasOwnProperty(t[0]+"")||(n[t[0]+""]=-1),t[2]})),o=[];
  10879. /**
  10880. * Make sure every layer data get the same keys.
  10881. * The value index tells which layer has visited.
  10882. * {
  10883. * 2014/01/01: -1
  10884. * }
  10885. */i.buckets.each((function(t,e){o.push({name:e,dataList:t})}));for(var r=o.length,a=0;a<r;++a){for(var s=o[a].name,l=0;l<o[a].dataList.length;++l){var u=o[a].dataList[l][0]+"";n[u]=a}for(var u in n)n.hasOwnProperty(u)&&n[u]!==a&&(n[u]=a,t[e]=[u,0,s],e++)}return t},
  10886. /**
  10887. * @override
  10888. * @param option the initial option that user gave
  10889. * @param ecModel the model object for themeRiver option
  10890. */
  10891. e.prototype.getInitialData=function(t,e){for(var n=this.getReferringComponents("singleAxis",zn).models[0].get("type"),i=st(t.data,(function(t){return void 0!==t[2]})),o=this.fixData(i||[]),a=[],s=this.nameMap=r(),l=0,u=0;u<o.length;++u)a.push(o[u][2]),s.get(o[u][2])||(s.set(o[u][2],l),l++);var c=Hh(o,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:xh(n)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}).dimensions,d=new Fh(c,this);return d.initData(o),d},
  10892. /**
  10893. * The raw data is divided into multiple layers and each layer
  10894. * has same name.
  10895. */
  10896. e.prototype.getLayerSeries=function(){for(var t=this.getData(),e=t.count(),n=[],i=0;i<e;++i)n[i]=i;var o=t.mapDimension("single"),r=Wn(n,(function(e){return t.get("name",e)})),a=[];
  10897. // data group by name
  10898. return r.buckets.each((function(e,n){e.sort((function(e,n){return t.get(o,e)-t.get(o,n)})),a.push({name:n,indices:e})})),a},
  10899. /**
  10900. * Get data indices for show tooltip content
  10901. */
  10902. e.prototype.getAxisTooltipData=function(t,e,n){i(t)||(t=t?[t]:[]);for(var o,r=this.getData(),a=this.getLayerSeries(),s=[],l=a.length,u=0;u<l;++u){for(var c=Number.MAX_VALUE,d=-1,h=a[u].indices.length,p=0;p<h;++p){var f=r.get(t[0],a[u].indices[p]),g=Math.abs(f-e);g<=c&&(o=f,c=g,d=a[u].indices[p])}s.push(d)}return{dataIndices:s,nestestValue:o}},e.prototype.formatTooltip=function(t,e,n){var i=this.getData();return $l("nameValue",{name:i.getName(t),value:i.get(i.mapDimension("value"),t)})},e.type="series.themeRiver",e.dependencies=["singleAxis"],e.defaultOption={
  10903. // zlevel: 0,
  10904. z:2,colorBy:"data",coordinateSystem:"singleAxis",
  10905. // gap in axis's orthogonal orientation
  10906. boundaryGap:["10%","10%"],
  10907. // legendHoverLink: true,
  10908. singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",fontSize:11},emphasis:{label:{show:!0}}},e}(Su);const HD=WD;function YD(t,e){t.eachSeriesByType("themeRiver",(function(t){var e=t.getData(),n=t.coordinateSystem,i={},o=n.getRect();i.rect=o;var r=t.get("boundaryGap"),a=n.getAxis();(i.boundaryGap=r,"horizontal"===a.orient)?(r[0]=je(r[0],o.height),r[1]=je(r[1],o.height),UD(e,t,o.height-r[0]-r[1])):(r[0]=je(r[0],o.width),r[1]=je(r[1],o.width),UD(e,t,o.width-r[0]-r[1]));e.setLayout("layoutInfo",i)}))}
  10909. /**
  10910. * The layout information about themeriver
  10911. *
  10912. * @param data data in the series
  10913. * @param seriesModel the model object of themeRiver series
  10914. * @param height value used to compute every series height
  10915. */function UD(t,e,i){if(t.count())for(var o,r=e.coordinateSystem,a=e.getLayerSeries(),s=t.mapDimension("single"),l=t.mapDimension("value"),u=n(a,(function(e){return n(e.indices,(function(e){var n=r.dataToPoint(t.get(s,e));return n[1]=t.get(l,e),n}))})),c=
  10916. /**
  10917. * Compute the baseLine of the rawdata
  10918. * Inspired by Lee Byron's paper Stacked Graphs - Geometry & Aesthetics
  10919. *
  10920. * @param data the points in each layer
  10921. */
  10922. function(t){for(var e=t.length,n=t[0].length,i=[],o=[],r=0,a=0;a<n;++a){for(var s=0,l=0;l<e;++l)s+=t[l][a][1];s>r&&(r=s),i.push(s)}for(var u=0;u<n;++u)o[u]=(r-i[u])/2;r=0;for(var c=0;c<n;++c){var d=i[c]+o[c];d>r&&(r=d)}return{y0:o,max:r}}(u),d=c.y0,h=i/c.max,p=a.length,f=a[0].indices.length,g=0
  10923. // the data in each layer are organized into a series.
  10924. ;g<f;++g){o=d[g]*h,t.setItemLayout(a[0].indices[g],{layerIndex:0,x:u[0][g][0],y0:o,y:u[0][g][1]*h});for(var y=1;y<p;++y)o+=u[y-1][g][1]*h,t.setItemLayout(a[y].indices[g],{layerIndex:y,x:u[y][g][0],y0:o,y:u[y][g][1]*h})}}var ZD=/** @class */function(t){function e(e,n,i,o){var r=t.call(this)||this;r.z2=2,r.textConfig={inside:!0},ni(r).seriesIndex=n.seriesIndex;var a=new $({z2:4,silent:e.getModel().get(["label","silent"])});return r.setTextContent(a),r.updateData(!0,e,n,i,o),r}return Ue(e,t),e.prototype.updateData=function(t,e,
  10925. // state: 'emphasis' | 'normal' | 'highlight' | 'downplay',
  10926. n,i,o){this.node=e,e.piece=this,n=n||this._seriesModel,i=i||this._ecModel;var r=this;ni(r).dataIndex=e.dataIndex;var s=e.getModel(),l=s.getModel("emphasis"),u=e.getLayout(),c=p({},u);c.label=null;var d=e.getVisual("style");d.lineJoin="bevel";var h=e.getVisual("decal");h&&(d.decal=Zc(h,o));var f=Ay(s.getModel("itemStyle"),c,!0);p(c,f),a(li,(function(t){var e=r.ensureState(t),n=s.getModel([t,"itemStyle"]);e.style=n.getItemStyle();
  10927. // border radius
  10928. var i=Ay(n,c);i&&(e.shape=i)})),t?(r.setShape(c),r.shape.r=u.r0,oo(r,{shape:{r:u.r}},n,e.dataIndex)):(
  10929. // Disable animation for gradient since no interpolation method
  10930. // is supported for gradient
  10931. io(r,{shape:c},n),uo(r)),r.useStyle(d),this._updateLabel(n);var g=s.getShallow("cursor");g&&r.attr("cursor",g),this._seriesModel=n||this._seriesModel,this._ecModel=i||this._ecModel;var y=l.get("focus");Ui(this,"relative"===y?ct(e.getAncestorsIndices(),e.getDescendantIndices()):"ancestor"===y?e.getAncestorsIndices():"descendant"===y?e.getDescendantIndices():y,l.get("blurScope"),l.get("disabled"))},e.prototype._updateLabel=function(t){var e=this,n=this.node.getModel(),i=n.getModel("label"),o=this.node.getLayout(),r=o.endAngle-o.startAngle,s=(o.startAngle+o.endAngle)/2,u=Math.cos(s),c=Math.sin(s),d=this,h=d.getTextContent(),p=this.node.dataIndex,f=i.get("minAngle")/180*Math.PI,g=i.get("show")&&!(null!=f&&Math.abs(r)<f);function y(t,e){var n=t.get(e);return null==n?i.get(e):n}h.ignore=!g,
  10932. // TODO use setLabelStyle
  10933. a(ui,(function(i){var a="normal"===i?n.getModel("label"):n.getModel([i,"label"]),f="normal"===i,g=f?h:h.ensureState(i),m=t.getFormattedLabel(p,i);f&&(m=m||e.node.name),g.style=Zo(a,{},null,"normal"!==i,!0),m&&(g.style.text=m);
  10934. // Not displaying text when angle is too small
  10935. var v=a.get("show");null==v||f||(g.ignore=!v);var x,_=y(a,"position"),b=f?d:d.states[i],S=b.style.fill;b.textConfig={outsideFill:"inherit"===a.get("color")?S:null,inside:"outside"!==_};var w=y(a,"distance")||0,M=y(a,"align"),I=y(a,"rotate"),D=.5*Math.PI,T=1.5*Math.PI,C=Et("tangential"===I?Math.PI/2-s:s),A=C>D&&!rn(C-D)&&C<T;"outside"===_?(x=o.r+w,M=A?"right":"left"):M&&"center"!==M?"left"===M?(x=o.r0+w,M=A?"right":"left"):"right"===M&&(x=o.r-w,M=A?"left":"right"):(
  10936. // Put label in the center if it's a circle
  10937. x=r===2*Math.PI&&0===o.r0?0:(o.r+o.r0)/2,M="center"),g.style.align=M,g.style.verticalAlign=y(a,"verticalAlign")||"middle",g.x=x*u+o.cx,g.y=x*c+o.cy;var L=0;"radial"===I?L=Et(-s)+(A?Math.PI:0):"tangential"===I?L=Et(Math.PI/2-s)+(A?Math.PI:0):l(I)&&(L=I*Math.PI/180),g.rotation=Et(L)})),h.dirtyStyle()},e}(E);const XD=ZD;var jD="sunburstRootToNode",qD="sunburstHighlight";var KD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n,
  10938. // @ts-ignore
  10939. i){var o=this;this.seriesModel=t,this.api=n,this.ecModel=e;var r=t.getData(),a=r.tree.root,s=t.getViewRoot(),l=this.group,u=t.get("renderLabelForZeroData"),c=[];s.eachNode((function(t){c.push(t)}));var d=this._oldChildren||[];!function(i,o){if(0===i.length&&0===o.length)return;function s(t){return t.getId()}function c(s,c){!function(i,o){u||!i||i.getValue()||(
  10940. // Not render data with value 0
  10941. i=null);if(i!==a&&o!==a)if(o&&o.piece)i?(
  10942. // Update
  10943. o.piece.updateData(!1,i,t,e,n),
  10944. // For tooltip
  10945. r.setItemGraphicEl(i.dataIndex,o.piece)):
  10946. // Remove
  10947. function(t){if(!t)return;t.piece&&(l.remove(t.piece),t.piece=null)}(o);else if(i){
  10948. // Add
  10949. var s=new XD(i,t,e,n);l.add(s),
  10950. // For tooltip
  10951. r.setItemGraphicEl(i.dataIndex,s)}}(null==s?null:i[s],null==c?null:o[c])}new yh(o,i,s,s).add(c).update(c).remove(rt(c,null)).execute()}(c,d),function(i,r){r.depth>0?(
  10952. // Render
  10953. o.virtualPiece?
  10954. // Update
  10955. o.virtualPiece.updateData(!1,i,t,e,n):(
  10956. // Add
  10957. o.virtualPiece=new XD(i,t,e,n),l.add(o.virtualPiece)),
  10958. // TODO event scope
  10959. r.piece.off("click"),o.virtualPiece.on("click",(function(t){o._rootToNode(r.parentNode)}))):o.virtualPiece&&(
  10960. // Remove
  10961. l.remove(o.virtualPiece),o.virtualPiece=null)}(a,s),this._initEvents(),this._oldChildren=c},
  10962. /**
  10963. * @private
  10964. */
  10965. e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",(function(e){var n=!1;t.seriesModel.getViewRoot().eachNode((function(i){if(!n&&i.piece&&i.piece===e.target){var o=i.getModel().get("nodeClick");if("rootToNode"===o)t._rootToNode(i);else if("link"===o){var r=i.getModel(),a=r.get("link");if(a)pa(a,r.get("target",!0)||"_blank")}n=!0}}))}))},
  10966. /**
  10967. * @private
  10968. */
  10969. e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:jD,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},
  10970. /**
  10971. * @implement
  10972. */
  10973. e.prototype.containPoint=function(t,e){var n=e.getData().getItemLayout(0);if(n){var i=t[0]-n.cx,o=t[1]-n.cy,r=Math.sqrt(i*i+o*o);return r<=n.r&&r>=n.r0}},e.type="sunburst",e}(Ou);const JD=KD;function $D(t){
  10974. // Postorder travel tree.
  10975. // If value of none-leaf node is not set,
  10976. // calculate it by suming up the value of all children.
  10977. var e=0;a(t.children,(function(t){$D(t);var n=t.value;
  10978. // TODO First value of array must be a number
  10979. i(n)&&(n=n[0]),e+=n}));var n=t.value;i(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),
  10980. // Value should not less than 0.
  10981. n<0&&(n=0),i(t.value)?t.value[0]=n:t.value=n}const QD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.ignoreStyleOnData=!0,n}return Ue(e,t),e.prototype.getInitialData=function(t,e){
  10982. // Create a virtual root.
  10983. var i={name:t.name,children:t.data};$D(i);var o=this._levelModels=n(t.levels||[],(function(t){return new yr(t,this,e)}),this),r=C_.createTree(i,this,(function(t){t.wrapMethod("getItemModel",(function(t,e){var n=r.getNodeByDataIndex(e),i=o[n.depth];return i&&(t.parentModel=i),t}))}));
  10984. // Make sure always a new tree is created when setOption,
  10985. // in TreemapView, we check whether oldTree === newTree
  10986. // to choose mappings approach among old shapes and new shapes.
  10987. return r.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},
  10988. /*
  10989. * @override
  10990. */
  10991. e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treePathInfo=P_(i,this),n},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){B_(this)},e.type="series.sunburst",e.defaultOption={
  10992. // zlevel: 0,
  10993. z:2,
  10994. // 默认全局居中
  10995. center:["50%","50%"],radius:[0,"75%"],
  10996. // 默认顺时针
  10997. clockwise:!0,startAngle:90,
  10998. // 最小角度改为0
  10999. minAngle:0,
  11000. // If still show when all data zero.
  11001. stillShowZeroSum:!0,
  11002. // 'rootToNode', 'link', or false
  11003. nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{
  11004. // could be: 'radial', 'tangential', or 'none'
  11005. rotate:"radial",show:!0,opacity:1,
  11006. // 'left' is for inner side of inside, and 'right' is for outer
  11007. // side for inside
  11008. align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},
  11009. // Animation type can be expansion, scale.
  11010. animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],
  11011. /**
  11012. * Sort order.
  11013. *
  11014. * Valid values: 'desc', 'asc', null, or callback function.
  11015. * 'desc' and 'asc' for descend and ascendant order;
  11016. * null for not sorting;
  11017. * example of callback function:
  11018. * function(nodeA, nodeB) {
  11019. * return nodeA.getValue() - nodeB.getValue();
  11020. * }
  11021. */
  11022. sort:"desc"},e}(Su);
  11023. // let PI2 = Math.PI * 2;
  11024. var tT=Math.PI/180;function eT(t,e,n){e.eachSeriesByType(t,(function(t){var e=t.get("center"),o=t.get("radius");i(o)||(o=[0,o]),i(e)||(e=[e,e]);var r=n.getWidth(),s=n.getHeight(),l=Math.min(r,s),u=je(e[0],r),c=je(e[1],s),d=je(o[0],l/2),h=je(o[1],l/2),p=-t.get("startAngle")*tT,f=t.get("minAngle")*tT,g=t.getData().tree.root,y=t.getViewRoot(),m=y.depth,v=t.get("sort");null!=v&&nT(y,v);var x=0;a(y.children,(function(t){!isNaN(t.getValue())&&x++}));var _=y.getValue(),b=Math.PI/(_||x)*2,S=y.depth>0,w=y.height-(S?-1:1),M=(h-d)/(w||1),I=t.get("clockwise"),D=t.get("stillShowZeroSum"),T=I?1:-1,C=function(e,n){if(e){var i=n;
  11025. // Render self
  11026. if(e!==g){
  11027. // Tree node is virtual, so it doesn't need to be drawn
  11028. var o=e.getValue(),r=0===_&&D?b:o*b;r<f&&(r=f),
  11029. // else {
  11030. // valueSumLargerThanMinAngle += value;
  11031. // }
  11032. i=n+T*r;var s=e.depth-m-(S?-1:1),h=d+M*s,p=d+M*(s+1),y=t.getLevelModel(e);if(y){var v=y.get("r0",!0),x=y.get("r",!0),w=y.get("radius",!0);null!=w&&(v=w[0],x=w[1]),null!=v&&(h=je(v,l/2)),null!=x&&(p=je(x,l/2))}e.setLayout({angle:r,startAngle:n,endAngle:i,clockwise:I,cx:u,cy:c,r0:h,r:p})}
  11033. // Render children
  11034. if(e.children&&e.children.length){
  11035. // currentAngle = startAngle;
  11036. var A=0;a(e.children,(function(t){A+=C(t,n+A)}))}return i-n}};
  11037. // Sum may be 0
  11038. // Virtual root node for roll up
  11039. if(S){var A=d,L=d+M,k=2*Math.PI;g.setLayout({angle:k,startAngle:p,endAngle:p+k,clockwise:I,cx:u,cy:c,r0:A,r:L})}C(y,p)}))}
  11040. /**
  11041. * Init node children by order and update visual
  11042. */function nT(t,e){var i=t.children||[];t.children=
  11043. /**
  11044. * Sort children nodes
  11045. *
  11046. * @param {TreeNode[]} children children of node to be sorted
  11047. * @param {string | function | null} sort sort method
  11048. * See SunburstSeries.js for details.
  11049. */
  11050. function(t,e){if(f(e)){var i=n(t,(function(t,e){var n=t.getValue();return{params:{depth:t.depth,height:t.height,dataIndex:t.dataIndex,getValue:function(){return n}},index:e}}));return i.sort((function(t,n){return e(t.params,n.params)})),n(i,(function(e){return t[e.index]}))}var o="asc"===e;return t.sort((function(t,e){var n=(t.getValue()-e.getValue())*(o?1:-1);return 0===n?(t.dataIndex-e.dataIndex)*(o?-1:1):n}))}(i,e),
  11051. // Init children recursively
  11052. i.length&&a(t.children,(function(t){nT(t,e)}))}function iT(e){var n={};
  11053. // Default color strategy
  11054. e.eachSeriesByType("sunburst",(function(e){var i=e.getData(),o=i.tree;o.eachNode((function(r){var a=r.getModel().getModel("itemStyle").getItemStyle();a.fill||(a.fill=function(e,i,o){for(
  11055. // Choose color from palette based on the first level.
  11056. var r=e;r&&r.depth>1;)r=r.parentNode;var a=i.getColorFromPalette(r.name||r.dataIndex+"",n);return e.depth>1&&t(a)&&(
  11057. // Lighter on the deeper level.
  11058. a=De(a,(e.depth-1)/(o-1)*.5)),a}(r,e,o.root.height));var s=i.ensureUniqueItemVisual(r.dataIndex,"style");p(s,a)}))}))}
  11059. // Also compat with ec4, where
  11060. // `visual('color') visual('borderColor')` is supported.
  11061. var oT={color:"fill",borderColor:"stroke"},rT={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},aT=On();const sT=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,e){return Jh(null,this)},e.prototype.getDataParams=function(e,n,i){var o=t.prototype.getDataParams.call(this,e,n);return i&&(o.info=aT(i).info),o},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",
  11062. // zlevel: 0,
  11063. z:2,legendHoverLink:!0,
  11064. // Custom series will not clip by default.
  11065. // Some case will use custom series to draw label
  11066. // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight
  11067. clip:!1},e}(Su);function lT(t,e){
  11068. // dataItem is necessary in log axis.
  11069. return e=e||[0,0],n(["x","y"],(function(n,i){var o=this.getAxis(n),r=e[i],a=t[i]/2;return"category"===o.type?o.getBandWidth():Math.abs(o.dataToCoord(r-a)-o.dataToCoord(r+a))}),this)}function uT(t,e){return e=e||[0,0],n([0,1],(function(n){var i=e[n],o=t[n]/2,r=[],a=[];return r[n]=i-o,a[n]=i+o,r[1-n]=a[1-n]=e[1-n],Math.abs(this.dataToPoint(r)[n]-this.dataToPoint(a)[n])}),this)}function cT(t,e){
  11070. // dataItem is necessary in log axis.
  11071. var n=this.getAxis(),i=e instanceof Array?e[0]:e,o=(t instanceof Array?t[0]:t)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-o)-n.dataToCoord(i+o))}
  11072. // import AngleAxis from './AngleAxis.js';
  11073. function dT(t,e){
  11074. // dataItem is necessary in log axis.
  11075. return e=e||[0,0],n(["Radius","Angle"],(function(n,i){var o=this["get"+n+"Axis"](),r=e[i],a=t[i]/2,s="category"===o.type?o.getBandWidth():Math.abs(o.dataToCoord(r-a)-o.dataToCoord(r+a));
  11076. // TODO: TYPE Check Angle Axis
  11077. return"Angle"===n&&(s=s*Math.PI/180),s}),this)}
  11078. /**
  11079. * Whether need to call `convertEC4CompatibleStyle`.
  11080. */
  11081. function hT(t,e,n,i){
  11082. // Since echarts5, `RectText` is separated from its host element and style.text
  11083. // does not exist any more. The compat work brings some extra burden on performance.
  11084. // So we provide:
  11085. // `legacy: true` force make compat.
  11086. // `legacy: false`, force do not compat.
  11087. // `legacy` not set: auto detect whether legacy.
  11088. // But in this case we do not compat (difficult to detect and rare case):
  11089. // Becuse custom series and graphic component support "merge", users may firstly
  11090. // only set `textStrokeWidth` style or secondly only set `text`.
  11091. return t&&(t.legacy||!1!==t.legacy&&!n&&!i&&"tspan"!==e&&("text"===e||N(t,"text")))}
  11092. /**
  11093. * `EC4CompatibleStyle` is style that might be in echarts4 format or echarts5 format.
  11094. * @param hostStyle The properties might be modified.
  11095. * @return If be text el, `textContentStyle` and `textConfig` will not be returned.
  11096. * Otherwise a `textContentStyle` and `textConfig` will be created, whose props area
  11097. * retried from the `hostStyle`.
  11098. */function pT(t,e,n){var i,o,r,s=t;if("text"===e)r=s;else{r={},N(s,"text")&&(r.text=s.text),N(s,"rich")&&(r.rich=s.rich),N(s,"textFill")&&(r.fill=s.textFill),N(s,"textStroke")&&(r.stroke=s.textStroke),N(s,"fontFamily")&&(r.fontFamily=s.fontFamily),N(s,"fontSize")&&(r.fontSize=s.fontSize),N(s,"fontStyle")&&(r.fontStyle=s.fontStyle),N(s,"fontWeight")&&(r.fontWeight=s.fontWeight),o={type:"text",style:r,
  11099. // ec4 does not support rectText trigger.
  11100. // And when text position is different in normal and emphasis
  11101. // => hover text trigger emphasis;
  11102. // => text position changed, leave mouse pointer immediately;
  11103. // That might cause incorrect state.
  11104. silent:!0},i={};var l=N(s,"textPosition");n?i.position=l?s.textPosition:"inside":l&&(i.position=s.textPosition),N(s,"textPosition")&&(i.position=s.textPosition),N(s,"textOffset")&&(i.offset=s.textOffset),N(s,"textRotation")&&(i.rotation=s.textRotation),N(s,"textDistance")&&(i.distance=s.textDistance)}return fT(r,t),a(r.rich,(function(t){fT(t,t)})),{textConfig:i,textContent:o}}
  11105. /**
  11106. * The result will be set to `out`.
  11107. */function fT(t,e){e&&(
  11108. // (1) For simplicity, make textXXX properties (deprecated since ec5) has
  11109. // higher priority. For example, consider in ec4 `borderColor: 5, textBorderColor: 10`
  11110. // on a rect means `borderColor: 4` on the rect and `borderColor: 10` on an attached
  11111. // richText in ec5.
  11112. // (2) `out === richItem` if and only if `out` is text el or rich item.
  11113. // So we can overwrite existing props in `out` since textXXX has higher priority.
  11114. e.font=e.textFont||e.font,N(e,"textStrokeWidth")&&(t.lineWidth=e.textStrokeWidth),N(e,"textAlign")&&(t.align=e.textAlign),N(e,"textVerticalAlign")&&(t.verticalAlign=e.textVerticalAlign),N(e,"textLineHeight")&&(t.lineHeight=e.textLineHeight),N(e,"textWidth")&&(t.width=e.textWidth),N(e,"textHeight")&&(t.height=e.textHeight),N(e,"textBackgroundColor")&&(t.backgroundColor=e.textBackgroundColor),N(e,"textPadding")&&(t.padding=e.textPadding),N(e,"textBorderColor")&&(t.borderColor=e.textBorderColor),N(e,"textBorderWidth")&&(t.borderWidth=e.textBorderWidth),N(e,"textBorderRadius")&&(t.borderRadius=e.textBorderRadius),N(e,"textBoxShadowColor")&&(t.shadowColor=e.textBoxShadowColor),N(e,"textBoxShadowBlur")&&(t.shadowBlur=e.textBoxShadowBlur),N(e,"textBoxShadowOffsetX")&&(t.shadowOffsetX=e.textBoxShadowOffsetX),N(e,"textBoxShadowOffsetY")&&(t.shadowOffsetY=e.textBoxShadowOffsetY))}
  11115. /**
  11116. * Convert to pure echarts4 format style.
  11117. * `itemStyle` will be modified, added with ec4 style properties from
  11118. * `textStyle` and `textConfig`.
  11119. *
  11120. * [Caveat]: For simplicity, `insideRollback` in ec4 does not compat, where
  11121. * `styleEmphasis: {textFill: 'red'}` will remove the normal auto added stroke.
  11122. */function gT(t,e,n){var i=t;
  11123. // See `custom.ts`, a trick to set extra `textPosition` firstly.
  11124. i.textPosition=i.textPosition||n.position||"inside",null!=n.offset&&(i.textOffset=n.offset),null!=n.rotation&&(i.textRotation=n.rotation),null!=n.distance&&(i.textDistance=n.distance);var o=i.textPosition.indexOf("inside")>=0,r=t.fill||"#000";yT(i,e);var s=null==i.textFill;return o?s&&(i.textFill=n.insideFill||"#fff",!i.textStroke&&n.insideStroke&&(i.textStroke=n.insideStroke),!i.textStroke&&(i.textStroke=r),null==i.textStrokeWidth&&(i.textStrokeWidth=2)):(s&&(i.textFill=t.fill||n.outsideFill||"#000"),!i.textStroke&&n.outsideStroke&&(i.textStroke=n.outsideStroke)),i.text=e.text,i.rich=e.rich,a(e.rich,(function(t){yT(t,t)})),i}function yT(t,e){e&&(N(e,"fill")&&(t.textFill=e.fill),N(e,"stroke")&&(t.textStroke=e.fill),N(e,"lineWidth")&&(t.textStrokeWidth=e.lineWidth),N(e,"font")&&(t.font=e.font),N(e,"fontStyle")&&(t.fontStyle=e.fontStyle),N(e,"fontWeight")&&(t.fontWeight=e.fontWeight),N(e,"fontSize")&&(t.fontSize=e.fontSize),N(e,"fontFamily")&&(t.fontFamily=e.fontFamily),N(e,"align")&&(t.textAlign=e.align),N(e,"verticalAlign")&&(t.textVerticalAlign=e.verticalAlign),N(e,"lineHeight")&&(t.textLineHeight=e.lineHeight),N(e,"width")&&(t.textWidth=e.width),N(e,"height")&&(t.textHeight=e.height),N(e,"backgroundColor")&&(t.textBackgroundColor=e.backgroundColor),N(e,"padding")&&(t.textPadding=e.padding),N(e,"borderColor")&&(t.textBorderColor=e.borderColor),N(e,"borderWidth")&&(t.textBorderWidth=e.borderWidth),N(e,"borderRadius")&&(t.textBorderRadius=e.borderRadius),N(e,"shadowColor")&&(t.textBoxShadowColor=e.shadowColor),N(e,"shadowBlur")&&(t.textBoxShadowBlur=e.shadowBlur),N(e,"shadowOffsetX")&&(t.textBoxShadowOffsetX=e.shadowOffsetX),N(e,"shadowOffsetY")&&(t.textBoxShadowOffsetY=e.shadowOffsetY),N(e,"textShadowColor")&&(t.textShadowColor=e.textShadowColor),N(e,"textShadowBlur")&&(t.textShadowBlur=e.textShadowBlur),N(e,"textShadowOffsetX")&&(t.textShadowOffsetX=e.textShadowOffsetX),N(e,"textShadowOffsetY")&&(t.textShadowOffsetY=e.textShadowOffsetY))}var mT={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},vT=v(mT);e(Te,(function(t,e){return t[e]=1,t}),{}),Te.join(", ");
  11125. // '' means root
  11126. var xT=["","style","shape","extra"],_T=On();function bT(t,e,n,i,o){var r=t+"Animation",a=eo(t,i,o)||{},s=_T(e).userDuring;
  11127. // Only set when duration is > 0 and it's need to be animated.
  11128. return a.duration>0&&(
  11129. // For simplicity, if during not specified, the previous during will not work any more.
  11130. a.during=s?lt(CT,{el:e,userDuring:s}):null,a.setToFinal=!0,a.scope=t),p(a,n[r]),a}function ST(t,e,n,i){var o=(i=i||{}).dataIndex,r=i.isInit,s=i.clearStyle,l=n.isAnimationEnabled(),u=_T(t),d=e.style;u.userDuring=e.during;var h={},f={};if(function(t,e,n){for(var i=0;i<vT.length;i++){var o=vT[i],r=mT[o],a=e[o];a&&(n[r[0]]=a[0],n[r[1]]=a[1])}for(i=0;i<Te.length;i++){var s=Te[i];null!=e[s]&&(n[s]=e[s])}}(0,e,f),LT("shape",e,f),LT("extra",e,f),!r&&l&&(function(t,e,n){for(var i=e.transition,o=IT(i)?Te:Sn(i||[]),r=0;r<o.length;r++){var a=o[r];if("style"!==a&&"shape"!==a&&"extra"!==a){var s=t[a];
  11131. // Do not clone, animator will perform that clone.
  11132. n[a]=s}}}(t,e,h),AT("shape",t,e,h),AT("extra",t,e,h),function(t,e,n,i){if(!n)return;var o,r=t.style;if(r){var a=n.transition,s=e.transition;if(a&&!IT(a)){var l=Sn(a);!o&&(o=i.style={});for(var u=0;u<l.length;u++){var d=r[g=l[u]];
  11133. // Do not clone, see `checkNonStyleTansitionRefer`.
  11134. o[g]=d}}else if(t.getAnimationStyleProps&&(IT(s)||IT(a)||c(s,"style")>=0)){var h=t.getAnimationStyleProps(),p=h?h.style:null;if(p){!o&&(o=i.style={});var f=v(n);for(u=0;u<f.length;u++){var g;if(p[g=f[u]]){d=r[g];o[g]=d}}}}}}(t,e,d,h)),f.style=d,function(t,
  11135. // Can be null/undefined
  11136. e,n){var i=e.style;if(!t.isGroup&&i){if(n){t.useStyle({});for(
  11137. // When style object changed, how to trade the existing animation?
  11138. // It is probably complicated and not needed to cover all the cases.
  11139. // But still need consider the case:
  11140. // (1) When using init animation on `style.opacity`, and before the animation
  11141. // ended users triggers an update by mousewhel. At that time the init
  11142. // animation should better be continued rather than terminated.
  11143. // So after `useStyle` called, we should change the animation target manually
  11144. // to continue the effect of the init animation.
  11145. // (2) PENDING: If the previous animation targeted at a `val1`, and currently we need
  11146. // to update the value to `val2` and no animation declared, should be terminate
  11147. // the previous animation or just modify the target of the animation?
  11148. // Therotically That will happen not only on `style` but also on `shape` and
  11149. // `transfrom` props. But we haven't handle this case at present yet.
  11150. // (3) PENDING: Is it proper to visit `animators` and `targetName`?
  11151. var o=t.animators,r=0;r<o.length;r++){var a=o[r];
  11152. // targetName is the "topKey".
  11153. "style"===a.targetName&&a.changeTarget(t.style)}}t.setStyle(i)}e&&(
  11154. // Not set style here.
  11155. e.style=null,
  11156. // Set el to the final state firstly.
  11157. e&&t.attr(e),e.style=i)}(t,f,s),function(t,e){
  11158. // Merge by default.
  11159. N(e,"silent")&&(t.silent=e.silent),N(e,"ignore")&&(t.ignore=e.ignore),t instanceof $t&&N(e,"invisible")&&(t.invisible=e.invisible);t instanceof g&&N(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}
  11160. // Use it to avoid it be exposed to user.
  11161. (t,e),l)if(r){var y={};a(xT,(function(t){var n=t?e[t]:e;n&&n.enterFrom&&(t&&(y[t]=y[t]||{}),p(t?y[t]:y,n.enterFrom))}));var m=bT("enter",t,e,n,o);m.duration>0&&t.animateFrom(y,m)}else!function(t,e,n,i,
  11162. // Can be null/undefined
  11163. o){if(o){var r=bT("update",t,e,i,n);r.duration>0&&t.animateFrom(o,r)}}(t,e,o||0,n,h);
  11164. // Store leave to be used in leave transition.
  11165. wT(t,e),d?t.dirty():t.markRedraw()}function wT(t,e){for(
  11166. // Try merge to previous set leaveTo
  11167. var n=_T(t).leaveToProps,i=0;i<xT.length;i++){var o=xT[i],r=o?e[o]:e;r&&r.leaveTo&&(n||(n=_T(t).leaveToProps={}),o&&(n[o]=n[o]||{}),p(o?n[o]:n,r.leaveTo))}}function MT(t,e,n,i){if(t){var o=t.parent,r=_T(t).leaveToProps;if(r){
  11168. // TODO TODO use leave after leaveAnimation in series is introduced
  11169. // TODO Data index?
  11170. var a=bT("update",t,e,n,0);a.done=function(){o.remove(t),i&&i()},t.animateTo(r,a)}else o.remove(t),i&&i()}}function IT(t){return"all"===t}var DT={},TT={
  11171. // Usually other props do not need to be changed in animation during.
  11172. setTransform:function(t,e){return DT.el[t]=e,this},getTransform:function(t){return DT.el[t]},setShape:function(t,e){var n=DT.el;return(n.shape||(n.shape={}))[t]=e,n.dirtyShape&&n.dirtyShape(),this},getShape:function(t){var e=DT.el.shape;if(e)return e[t]},setStyle:function(t,e){var n=DT.el,i=n.style;return i&&(i[t]=e,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(t){var e=DT.el.style;if(e)return e[t]},setExtra:function(t,e){return(DT.el.extra||(DT.el.extra={}))[t]=e,this},getExtra:function(t){var e=DT.el.extra;if(e)return e[t]}};function CT(){
  11173. // Do not provide "percent" until some requirements come.
  11174. // Because consider thies case:
  11175. // enterFrom: {x: 100, y: 30}, transition: 'x'.
  11176. // And enter duration is different from update duration.
  11177. // Thus it might be confused about the meaning of "percent" in during callback.
  11178. var t=this,e=t.el;if(e){
  11179. // If el is remove from zr by reason like legend, during still need to called,
  11180. // because el will be added back to zr and the prop value should not be incorrect.
  11181. var n=_T(e).userDuring,i=t.userDuring;
  11182. // Ensured a during is only called once in each animation frame.
  11183. // If a during is called multiple times in one frame, maybe some users' calculation logic
  11184. // might be wrong (not sure whether this usage exists).
  11185. // The case of a during might be called twice can be: by default there is a animator for
  11186. // 'x', 'y' when init. Before the init animation finished, call `setOption` to start
  11187. // another animators for 'style'/'shape'/'extra'.
  11188. n===i?(DT.el=e,
  11189. // Give no `this` to user in "during" calling.
  11190. i(TT)):
  11191. // release
  11192. t.el=t.userDuring=null}}function AT(t,e,n,i){var o=n[t];if(o){var r,a=e[t];if(a){var s=n.transition,l=o.transition;if(l)if(!r&&(r=i[t]={}),IT(l))p(r,a);else for(var u=Sn(l),d=0;d<u.length;d++){var h=a[g=u[d]];r[g]=h}else if(IT(s)||c(s,t)>=0){!r&&(r=i[t]={});var f=v(a);for(d=0;d<f.length;d++){var g;h=a[g=f[d]];kT(o[g],h)&&(r[g]=h)}}}}}function LT(t,e,n){var i=e[t];if(i)for(var o=n[t]={},r=v(i),a=0;a<r.length;a++){var s=r[a];
  11193. // To avoid share one object with different element, and
  11194. // to avoid user modify the object inexpectedly, have to clone.
  11195. o[s]=Ce(i[s])}}function kT(t,e){
  11196. // The same as `checkNonStyleTansitionRefer`.
  11197. return m(t)?t!==e:null!=t&&isFinite(t)}var PT=On(),NT=["percent","easing","shape","style","extra"];
  11198. /**
  11199. * Stop previous keyframe animation and restore the attributes.
  11200. * Avoid new keyframe animation starts with wrong internal state when the percent: 0 is not set.
  11201. */
  11202. function OT(t){
  11203. // Stop previous keyframe animation.
  11204. t.stopAnimation("keyframe"),
  11205. // Restore
  11206. t.attr(PT(t))}function RT(t,e,n){if(n.isAnimationEnabled()&&e)if(i(e))a(e,(function(e){RT(t,e,n)}));else{var o=e.keyframes,r=e.duration;if(n&&null==r){
  11207. // Default to use duration of config.
  11208. // NOTE: animation config from payload will be ignored because they are mainly for transitions.
  11209. var s=eo("enter",n,0);r=s&&s.duration}if(o&&r){var l=PT(t);a(xT,(function(n){var i;
  11210. // Sort keyframes by percent.
  11211. n&&!t[n]||(o.sort((function(t,e){return t.percent-e.percent})),a(o,(function(o){
  11212. // Stop current animation.
  11213. var s=t.animators,u=n?o[n]:o;if(u){var d=v(u);if(n||(
  11214. // PENDING performance?
  11215. d=st(d,(function(t){return c(NT,t)<0}))),d.length){i||((i=t.animate(n,e.loop,!0)).scope="keyframe");for(var h=0;h<s.length;h++)
  11216. // Stop all other animation that is not keyframe.
  11217. s[h]!==i&&s[h].targetName===i.targetName&&s[h].stopTracks(d);n&&(l[n]=l[n]||{});var p=n?l[n]:l;a(d,(function(e){
  11218. // Save original value.
  11219. p[e]=((n?t[n]:t)||{})[e]})),i.whenWithKeys(r*o.percent,u,d,o.easing)}}})),i&&i.delay(e.delay||0).duration(r).start(e.easing))}))}}}var ET="emphasis",VT="normal",zT="blur",BT="select",GT=[VT,ET,zT,BT],FT={normal:["itemStyle"],emphasis:[ET,"itemStyle"],blur:[zT,"itemStyle"],select:[BT,"itemStyle"]},WT={normal:["label"],emphasis:[ET,"label"],blur:[zT,"label"],select:[BT,"label"]},HT=["x","y"],YT={normal:{},emphasis:{},blur:{},select:{}},UT={cartesian2d:function(t){var e=t.master.getRect();return{coordSys:{
  11220. // The name exposed to user is always 'cartesian2d' but not 'grid'.
  11221. type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){
  11222. // do not provide "out" param
  11223. return t.dataToPoint(e)},size:lt(lT,t)}}},geo:function(t){var e=t.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:t.getZoom()},api:{coord:function(e){
  11224. // do not provide "out" and noRoam param,
  11225. // Compatible with this usage:
  11226. // echarts.util.map(item.points, api.coord)
  11227. return t.dataToPoint(e)},size:lt(uT,t)}}},single:function(t){var e=t.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){
  11228. // do not provide "out" param
  11229. return t.dataToPoint(e)},size:lt(cT,t)}}},polar:function(t){var e=t.getRadiusAxis(),n=t.getAngleAxis(),i=e.getExtent();return i[0]>i[1]&&i.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:i[1],r0:i[0]},api:{coord:function(i){var o=e.dataToRadius(i[0]),r=n.dataToAngle(i[1]),a=t.coordToPoint([o,r]);return a.push(o,r*Math.PI/180),a},size:lt(dT,t)}}}
  11230. /*
  11231. * Licensed to the Apache Software Foundation (ASF) under one
  11232. * or more contributor license agreements. See the NOTICE file
  11233. * distributed with this work for additional information
  11234. * regarding copyright ownership. The ASF licenses this file
  11235. * to you under the Apache License, Version 2.0 (the
  11236. * "License"); you may not use this file except in compliance
  11237. * with the License. You may obtain a copy of the License at
  11238. *
  11239. * http://www.apache.org/licenses/LICENSE-2.0
  11240. *
  11241. * Unless required by applicable law or agreed to in writing,
  11242. * software distributed under the License is distributed on an
  11243. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  11244. * KIND, either express or implied. See the License for the
  11245. * specific language governing permissions and limitations
  11246. * under the License.
  11247. */
  11248. /**
  11249. * AUTO-GENERATED FILE. DO NOT MODIFY.
  11250. */
  11251. /*
  11252. * Licensed to the Apache Software Foundation (ASF) under one
  11253. * or more contributor license agreements. See the NOTICE file
  11254. * distributed with this work for additional information
  11255. * regarding copyright ownership. The ASF licenses this file
  11256. * to you under the Apache License, Version 2.0 (the
  11257. * "License"); you may not use this file except in compliance
  11258. * with the License. You may obtain a copy of the License at
  11259. *
  11260. * http://www.apache.org/licenses/LICENSE-2.0
  11261. *
  11262. * Unless required by applicable law or agreed to in writing,
  11263. * software distributed under the License is distributed on an
  11264. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  11265. * KIND, either express or implied. See the License for the
  11266. * specific language governing permissions and limitations
  11267. * under the License.
  11268. */,calendar:function(t){var e=t.getRect(),n=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(e,n){return t.dataToPoint(e,n)}}}}};function ZT(t){return t instanceof g}function XT(t){return t instanceof $t}const jT=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n,i){
  11269. // Clear previously rendered progressive elements.
  11270. this._progressiveEls=null;var o=this._data,r=t.getData(),a=this.group,s=QT(t,r,e,n);o||
  11271. // Previous render is incremental render or first render.
  11272. // Needs remove the incremental rendered elements.
  11273. a.removeAll(),r.diff(o).add((function(e){eC(n,null,e,s(e,i),t,a,r)})).remove((function(e){var n=o.getItemGraphicEl(e);n&&MT(n,aT(n).option,t)})).update((function(e,l){var u=o.getItemGraphicEl(l);eC(n,u,e,s(e,i),t,a,r)})).execute();
  11274. // Do clipping
  11275. var l=t.get("clip",!0)?iy(t.coordinateSystem,!1,t):null;l?a.setClipPath(l):a.removeClipPath(),this._data=r},e.prototype.incrementalPrepareRender=function(t,e,n){this.group.removeAll(),this._data=null},e.prototype.incrementalRender=function(t,e,n,i,o){var r=e.getData(),a=QT(e,r,n,i),s=this._progressiveEls=[];function l(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}for(var u=t.start;u<t.end;u++){var c=eC(null,null,u,a(u,o),e,this.group,r);c&&(c.traverse(l),s.push(c))}},e.prototype.eachRendered=function(t){Bo(this._progressiveEls||this.group,t)},e.prototype.filterForExposedEvent=function(t,e,n,i){var o=e.element;if(null==o||n.name===o)return!0;
  11276. // Enable to give a name on a group made by `renderItem`, and listen
  11277. // events that are triggered by its descendents.
  11278. for(;(n=n.__hostTarget||n.parent)&&n!==this.group;)if(n.name===o)return!0;return!1},e.type="custom",e}(Ou);function qT(t){var e,n=t.type;
  11279. // Those graphic elements are not shapes. They should not be
  11280. // overwritten by users, so do them first.
  11281. if("path"===n){var i=t.shape,o=null!=i.width&&null!=i.height?{x:i.x||0,y:i.y||0,width:i.width,height:i.height}:null,r=dC(i);
  11282. // Using pathRect brings convenience to users sacle svg path.
  11283. // Path is also used for icon, so layout 'center' by default.
  11284. e=xo(r,null,o,i.layout||"center"),aT(e).customPathData=r}else if("image"===n)e=new b({}),aT(e).customImagePath=t.style.image;else if("text"===n)e=new $({});
  11285. // customInnerStore(el).customText = (elOption.style as TextStyleProps).text;
  11286. else if("group"===n)e=new Z;else{if("compoundPath"===n)throw new Error('"compoundPath" is not supported yet.');var a=vo(n);if(!a){vn("")}e=new a}return aT(e).customGraphicType=n,e.name=t.name,
  11287. // Compat ec4: the default z2 lift is 1. If changing the number,
  11288. // some cases probably be broken: hierarchy layout along z, like circle packing,
  11289. // where emphasis only intending to modify color/border rather than lift z2.
  11290. e.z2EmphasisLift=1,e.z2SelectLift=1,e}function KT(
  11291. // Can be null/undefined
  11292. t,e,n,i,o,r,a){
  11293. // Stop and restore before update any other attributes.
  11294. OT(e);var s=o&&o.normal.cfg;s&&
  11295. // PENDING: whether use user object directly rather than clone?
  11296. // TODO:5.0 textConfig transition animation?
  11297. e.setTextConfig(s),
  11298. // Default transition ['x', 'y']
  11299. i&&null==i.transition&&(i.transition=HT);
  11300. // Do some normalization on style.
  11301. var l=i&&i.style;if(l){if("text"===e.type){var u=l;
  11302. // Compatible with ec4: if `textFill` or `textStroke` exists use them.
  11303. N(u,"textFill")&&(u.fill=u.textFill),N(u,"textStroke")&&(u.stroke=u.textStroke)}var c=void 0,d=ZT(e)?l.decal:null;t&&d&&(d.dirty=!0,c=Zc(d,t)),
  11304. // Always overwrite in case user specify this prop.
  11305. l.__decalPattern=c}XT(e)&&(l&&(c=l.__decalPattern)&&(l.decal=c));ST(e,i,r,{dataIndex:n,isInit:a,clearStyle:!0}),RT(e,i.keyframeAnimation,r)}function JT(t,e,n,i,o){var r=e.isGroup?null:e,a=o&&o[t].cfg;
  11306. // PENDING:5.0 support customize scale change and transition animation?
  11307. if(r){
  11308. // By default support auto lift color when hover whether `emphasis` specified.
  11309. var s=r.ensureState(t);if(!1===i){var l=r.getState(t);l&&(l.style=null)}else
  11310. // style is needed to enable default emphasis.
  11311. s.style=i||null;
  11312. // If `elOption.styleEmphasis` or `elOption.emphasis.style` is `false`,
  11313. // remove hover style.
  11314. // If `elOption.textConfig` or `elOption.emphasis.textConfig` is null/undefined, it does not
  11315. // make sense. So for simplicity, we do not ditinguish `hasOwnProperty` and null/undefined.
  11316. a&&(s.textConfig=a),Ci(r)}}function $T(t,e,n){var i=n===VT,o=i?e:rC(e,n),r=o?o.z2:null;null!=r&&((i?t:t.ensureState(n)).z2=r||0)}function QT(e,n,i,o){var r=e.get("renderItem"),a=e.coordinateSystem,s={};a&&(
  11317. // `coordSys.prepareCustoms` is used for external coord sys like bmap.
  11318. s=a.prepareCustoms?a.prepareCustoms(a):UT[a.type](a));for(var l,u,c=I({getWidth:o.getWidth,getHeight:o.getHeight,getZr:o.getZr,getDevicePixelRatio:o.getDevicePixelRatio,value:
  11319. /**
  11320. * @public
  11321. * @param dim by default 0.
  11322. * @param dataIndexInside by default `currDataIndexInside`.
  11323. */
  11324. function(t,e){return null==e&&(e=l),n.getStore().get(n.getDimensionIndex(t||0),e)}
  11325. /**
  11326. * @public
  11327. * @param dim by default 0.
  11328. * @param dataIndexInside by default `currDataIndexInside`.
  11329. */,style:
  11330. /**
  11331. * @deprecated The original intention of `api.style` is enable to set itemStyle
  11332. * like other series. But it is not necessary and not easy to give a strict definition
  11333. * of what it returns. And since echarts5 it needs to be make compat work. So
  11334. * deprecates it since echarts5.
  11335. *
  11336. * By default, `visual` is applied to style (to support visualMap).
  11337. * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`,
  11338. * it can be implemented as:
  11339. * `api.style({stroke: api.visual('color'), fill: null})`;
  11340. *
  11341. * [Compat]: since ec5, RectText has been separated from its hosts el.
  11342. * so `api.style()` will only return the style from `itemStyle` but not handle `label`
  11343. * any more. But `series.label` config is never published in doc.
  11344. * We still compat it in `api.style()`. But not encourage to use it and will still not
  11345. * to pulish it to doc.
  11346. * @public
  11347. * @param dataIndexInside by default `currDataIndexInside`.
  11348. */
  11349. function(i,o){null==o&&(o=l);var r=n.getItemVisual(o,"style"),a=r&&r.fill,s=r&&r.opacity,u=_(o,VT).getItemStyle();null!=a&&(u.fill=a),null!=s&&(u.opacity=s);var c={inheritColor:t(a)?a:"#000"},d=b(o,VT),h=Zo(d,null,c,!1,!0);h.text=d.getShallow("show")?x(e.getFormattedLabel(o,VT),Rg(n,o)):null;var p=Xo(d,c,!1);return w(i,u),u=gT(u,h,p),i&&S(u,i),u.legacy=!0,u}
  11350. /**
  11351. * @deprecated The reason see `api.style()`
  11352. * @public
  11353. * @param dataIndexInside by default `currDataIndexInside`.
  11354. */,ordinalRawValue:function(t,e){null==e&&(e=l),t=t||0;var i=n.getDimensionInfo(t);if(!i){var o=n.getDimensionIndex(t);return o>=0?n.getStore().get(o,e):void 0}var r=n.get(i.name,e),a=i&&i.ordinalMeta;return a?a.categories[r]:r},styleEmphasis:function(t,i){null==i&&(i=l);var o=_(i,ET).getItemStyle(),r=b(i,ET),a=Zo(r,null,null,!0,!0);a.text=r.getShallow("show")?Ht(e.getFormattedLabel(i,ET),e.getFormattedLabel(i,VT),Rg(n,i)):null;var s=Xo(r,null,!0);return w(t,o),o=gT(o,a,s),t&&S(o,t),o.legacy=!0,o},visual:
  11355. /**
  11356. * @public
  11357. * @param dataIndexInside by default `currDataIndexInside`.
  11358. */
  11359. function(t,e){if(null==e&&(e=l),N(oT,t)){var i=n.getItemVisual(e,"style");return i?i[oT[t]]:null}
  11360. // Only support these visuals. Other visual might be inner tricky
  11361. // for performance (like `style`), do not expose to users.
  11362. if(N(rT,t))return n.getItemVisual(e,t)}
  11363. /**
  11364. * @public
  11365. * @return If not support, return undefined.
  11366. */,barLayout:function(t){if("cartesian2d"===a.type){var e=a.getBaseAxis();return function(t){var e=[],n=t.axis,i="axis0";if("category"===n.type){for(var o=n.getBandWidth(),r=0;r<t.count;r++)e.push(I({bandWidth:o,axisKey:i,stackId:_p+r},t));var a=Ip(e),s=[];for(r=0;r<t.count;r++){var l=a[i][_p+r];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}}(I({axis:e},t))}}
  11367. /**
  11368. * @public
  11369. */,currentSeriesIndices:function(){return i.getCurrentSeriesIndices()}
  11370. /**
  11371. * @public
  11372. * @return font string
  11373. */,font:function(t){return $o(t,i)}},s.api||{}),d={
  11374. // The life cycle of context: current round of rendering.
  11375. // The global life cycle is probably not necessary, because
  11376. // user can store global status by themselves.
  11377. context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:s.coordSys,dataInsideLength:n.count(),encode:tC(e.getData())},h={},p={},f={},g={},y=0;y<GT.length;y++){var m=GT[y];f[m]=e.getModel(FT[m]),g[m]=e.getModel(WT[m])}function v(t){return t===l?u||(u=n.getItemModel(t)):n.getItemModel(t)}function _(t,e){return n.hasItemOption?t===l?h[e]||(h[e]=v(t).getModel(FT[e])):v(t).getModel(FT[e]):f[e]}function b(t,e){return n.hasItemOption?t===l?p[e]||(p[e]=v(t).getModel(WT[e])):v(t).getModel(WT[e]):g[e]}return function(t,e){return l=t,u=null,h={},p={},r&&r(I({dataIndexInside:t,dataIndex:n.getRawIndex(t),
  11378. // Can be used for optimization when zoom or roam.
  11379. actionType:e?e.type:null},d),c)};function S(t,e){for(var n in e)N(e,n)&&(t[n]=e[n])}function w(t,e){
  11380. // A trick to retrieve those props firstly, which are used to
  11381. // apply auto inside fill/stroke in `convertToEC4StyleForCustomSerise`.
  11382. // (It's not reasonable but only for a degree of compat)
  11383. t&&(t.textFill&&(e.textFill=t.textFill),t.textPosition&&(e.textPosition=t.textPosition))}}function tC(t){var e={};return a(t.dimensions,(function(n){var i=t.getDimensionInfo(n);if(!i.isExtraCoord){var o=i.coordDim;(e[o]=e[o]||[])[i.coordDimIndex]=t.getDimensionIndex(n)}})),e}function eC(t,e,n,i,o,r,a){
  11384. // [Rule]
  11385. // If `renderItem` returns `null`/`undefined`/`false`, remove the previous el if existing.
  11386. // (It seems that violate the "merge" principle, but most of users probably intuitively
  11387. // regard "return;" as "show nothing element whatever", so make a exception to meet the
  11388. // most cases.)
  11389. // The rule or "merge" see [STRATEGY_MERGE].
  11390. // If `elOption` is `null`/`undefined`/`false` (when `renderItem` returns nothing).
  11391. if(i){var s=nC(t,e,n,i,o,r);return s&&a.setItemGraphicEl(n,s),s&&Ui(s,i.focus,i.blurScope,i.emphasisDisabled),s}r.remove(e)}function nC(t,e,n,i,o,r){var a=-1,s=e;e&&iC(e,i,o)&&(
  11392. // Should keep at the original index, otherwise "merge by index" will be incorrect.
  11393. a=c(r.childrenRef(),e),e=null);var l,u,d=!e,h=e;h?
  11394. // FIMXE:NEXT unified clearState?
  11395. // If in some case the performance issue arised, consider
  11396. // do not clearState but update cached normal state directly.
  11397. h.clearStates():(h=qT(i),s&&(l=s,(u=h).copyTransform(l),XT(u)&&XT(l)&&(u.setStyle(l.style),u.z=l.z,u.z2=l.z2,u.zlevel=l.zlevel,u.invisible=l.invisible,u.ignore=l.ignore,ZT(u)&&ZT(l)&&u.setShape(l.shape)))),
  11398. // Need to set morph: false explictly to disable automatically morphing.
  11399. !1===i.morph?h.disableMorphing=!0:h.disableMorphing&&(h.disableMorphing=!1),YT.normal.cfg=YT.normal.conOpt=YT.emphasis.cfg=YT.emphasis.conOpt=YT.blur.cfg=YT.blur.conOpt=YT.select.cfg=YT.select.conOpt=null,YT.isLegacy=!1,function(t,e,n,i,o,r){
  11400. // Group does not support textContent temporarily until necessary.
  11401. if(t.isGroup)return;
  11402. // Normal must be called before emphasis, for `isLegacy` detection.
  11403. oC(n,null,r),oC(n,ET,r);
  11404. // If `elOption.textConfig` or `elOption.textContent` is null/undefined, it does not make sense.
  11405. // So for simplicity, if "elOption hasOwnProperty of them but be null/undefined", we do not
  11406. // trade them as set to null to el.
  11407. // Especially:
  11408. // `elOption.textContent: false` means remove textContent.
  11409. // `elOption.textContent.emphasis.style: false` means remove the style from emphasis state.
  11410. var a=r.normal.conOpt,s=r.emphasis.conOpt,l=r.blur.conOpt,u=r.select.conOpt;if(null!=a||null!=s||null!=u||null!=l){var c=t.getTextContent();if(!1===a)c&&t.removeTextContent();else{a=r.normal.conOpt=a||{type:"text"},c?
  11411. // If in some case the performance issue arised, consider
  11412. // do not clearState but update cached normal state directly.
  11413. c.clearStates():(c=qT(a),t.setTextContent(c)),KT(null,c,e,a,null,i,o);for(var d=a&&a.style,h=0;h<GT.length;h++){var p=GT[h];if(p!==VT){var f=r[p].conOpt;JT(p,c,0,aC(a,f,p),null)}}d?c.dirty():c.markRedraw()}}}(h,n,i,o,d,YT),function(t,e,n,i,o){
  11414. // Based on the "merge" principle, if no clipPath provided,
  11415. // do nothing. The exists clip will be totally removed only if
  11416. // `el.clipPath` is `false`. Otherwise it will be merged/replaced.
  11417. var r=n.clipPath;if(!1===r)t&&t.getClipPath()&&t.removeClipPath();else if(r){var a=t.getClipPath();a&&iC(a,r,i)&&(a=null),a||(a=qT(r),t.setClipPath(a)),KT(null,a,e,r,null,i,o)}
  11418. // If not define `clipPath` in option, do nothing unnecessary.
  11419. }(h,n,i,o,d),KT(t,h,n,i,YT,o,d),
  11420. // `elOption.info` enables user to mount some info on
  11421. // elements and use them in event handlers.
  11422. // Update them only when user specified, otherwise, remain.
  11423. N(i,"info")&&(aT(h).info=i.info);for(var p=0;p<GT.length;p++){var f=GT[p];if(f!==VT){var g=rC(i,f);JT(f,h,0,aC(i,g,f),YT)}}return function(t,e,n){
  11424. // Group not support textContent and not support z yet.
  11425. if(!t.isGroup){var i=t,o=n.currentZ,r=n.currentZLevel;
  11426. // Always erase.
  11427. i.z=o,i.zlevel=r;
  11428. // z2 must not be null/undefined, otherwise sort error may occur.
  11429. var a=e.z2;null!=a&&(i.z2=a||0);for(var s=0;s<GT.length;s++)$T(i,e,GT[s])}}(h,i,o),"group"===i.type&&
  11430. // Usage:
  11431. // (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates
  11432. // that the existing children will not be removed, and enables the feature
  11433. // that update some of the props of some of the children simply by construct
  11434. // the returned children of `renderItem` like:
  11435. // `var children = group.children = []; children[3] = {opacity: 0.5};`
  11436. // (2) If `elOption.$mergeChildren` is `'byName'`, add/update/remove children
  11437. // by child.name. But that might be lower performance.
  11438. // (3) If `elOption.$mergeChildren` is `false`, the existing children will be
  11439. // replaced totally.
  11440. // (4) If `!elOption.children`, following the "merge" principle, nothing will
  11441. // happen.
  11442. // (5) If `elOption.$mergeChildren` is not `false` neither `'byName'` and the
  11443. // `el` is a group, and if any of the new child is null, it means to remove
  11444. // the element at the same index, if exists. On the other hand, if the new
  11445. // child is and empty object `{}`, it means to keep the element not changed.
  11446. // For implementation simpleness, do not provide a direct way to remove single
  11447. // child (otherwise the total indices of the children array have to be modified).
  11448. // User can remove a single child by setting its `ignore` to `true`.
  11449. function(t,e,n,i,o){var r=i.children,a=r?r.length:0,s=i.$mergeChildren,l="byName"===s||i.diffChildrenByName,u=!1===s;
  11450. // For better performance on roam update, only enter if necessary.
  11451. if(!a&&!l&&!u)return;if(l)return c={api:t,oldChildren:e.children()||[],newChildren:r||[],dataIndex:n,seriesModel:o,group:e},void new yh(c.oldChildren,c.newChildren,lC,lC,c).add(uC).update(uC).remove(cC).execute();var c;u&&e.removeAll();for(
  11452. // Mapping children of a group simply by index, which
  11453. // might be better performance.
  11454. var d=0;d<a;d++){var h=r[d],p=e.childAt(d);h?(null==h.ignore&&(
  11455. // The old child is set to be ignored if null (see comments
  11456. // below). So we need to set ignore to be false back.
  11457. h.ignore=!1),nC(t,p,n,h,o,e)):
  11458. // If the new element option is null, it means to remove the old
  11459. // element. But we cannot really remove the element from the group
  11460. // directly, because the element order may not be stable when this
  11461. // element is added back. So we set the element to be ignored.
  11462. p.ignore=!0}for(var f=e.childCount()-1;f>=d;f--){var g=e.childAt(f);sC(e,g,o)}}(t,h,n,i,o),a>=0?r.replaceAt(h,a):r.add(h),h}
  11463. // `el` must not be null/undefined.
  11464. function iC(t,e,n){var i,o=aT(t),r=e.type,a=e.shape,s=e.style;
  11465. // Always create new if universal transition is enabled.
  11466. // Because we do transition after render. It needs to know what old element is. Replacement will loose it.
  11467. return n.isUniversalTransitionEnabled()||null!=r&&r!==o.customGraphicType||"path"===r&&((i=a)&&(N(i,"pathData")||N(i,"d")))&&dC(a)!==o.customPathData||"image"===r&&N(s,"image")&&s.image!==o.customImagePath}function oC(t,e,n){var i=e?rC(t,e):t,o=e?aC(t,i,ET):t.style,r=t.type,a=i?i.textConfig:null,s=t.textContent,l=s?e?rC(s,e):s:null;if(o&&(
  11468. // Because emphasis style has little info to detect legacy,
  11469. // if normal is legacy, emphasis is trade as legacy.
  11470. n.isLegacy||hT(o,r,!!a,!!l))){n.isLegacy=!0;var u=pT(o,r,!e);
  11471. // Explicitly specified `textConfig` and `textContent` has higher priority than
  11472. // the ones generated by legacy style. Otherwise if users use them and `api.style`
  11473. // at the same time, they not both work and hardly to known why.
  11474. !a&&u.textConfig&&(a=u.textConfig),!l&&u.textContent&&(l=u.textContent)}if(!e&&l){var c=l;
  11475. // `textContent: {type: 'text'}`, the "type" is easy to be missing. So we tolerate it.
  11476. !c.type&&(c.type="text")}var d=e?n[e]:n.normal;d.cfg=a,d.conOpt=l}function rC(t,e){return e?t?t[e]:null:t}function aC(t,e,n){var i=e&&e.style;return null==i&&n===ET&&t&&(i=t.styleEmphasis),i}function sC(t,e,n){
  11477. // Do not support leave elements that are not mentioned in the latest
  11478. // `renderItem` return. Otherwise users may not have a clear and simple
  11479. // concept that how to control all of the elements.
  11480. e&&MT(e,aT(t).option,n)}function lC(t,e){var n=t&&t.name;return null!=n?n:"e\0\0"+e}function uC(t,e){var n=this.context,i=null!=t?n.newChildren[t]:null,o=null!=e?n.oldChildren[e]:null;nC(n.api,o,n.dataIndex,i,n.seriesModel,n.group)}function cC(t){var e=this.context,n=e.oldChildren[t];n&&MT(n,aT(n).option,e.seriesModel)}
  11481. /**
  11482. * @return SVG Path data.
  11483. */function dC(t){
  11484. // "d" follows the SVG convention.
  11485. return t&&(t.pathData||t.d)}var hC=On(),pC=et,fC=lt,gC=/** @class */function(){function t(){this._dragging=!1,
  11486. /**
  11487. * In px, arbitrary value. Do not set too small,
  11488. * no animation is ok for most cases.
  11489. */
  11490. this.animationThreshold=15}
  11491. /**
  11492. * @implement
  11493. */return t.prototype.render=function(t,e,n,i){var o=e.get("value"),r=e.get("status");
  11494. // Optimize: `render` will be called repeatedly during mouse move.
  11495. // So it is power consuming if performing `render` each time,
  11496. // especially on mobile device.
  11497. if(
  11498. // Bind them to `this`, not in closure, otherwise they will not
  11499. // be replaced when user calling setOption in not merge mode.
  11500. this._axisModel=t,this._axisPointerModel=e,this._api=n,i||this._lastValue!==o||this._lastStatus!==r){this._lastValue=o,this._lastStatus=r;var a=this._group,s=this._handle;if(!r||"hide"===r)
  11501. // Do not clear here, for animation better.
  11502. return a&&a.hide(),void(s&&s.hide());a&&a.show(),s&&s.show();
  11503. // Otherwise status is 'show'
  11504. var l={};this.makeElOption(l,o,t,e,n);
  11505. // Enable change axis pointer type.
  11506. var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var c=this._moveAnimation=this.determineAnimation(t,e);if(a){var d=rt(yC,e,c);this.updatePointerEl(a,l,d),this.updateLabelEl(a,l,d,e)}else a=this._group=new Z,this.createPointerEl(a,l,t,e),this.createLabelEl(a,l,t,e),n.getZr().add(a);_C(a,e,!0),this._renderHandle(o)}},
  11507. /**
  11508. * @implement
  11509. */
  11510. t.prototype.remove=function(t){this.clear(t)},
  11511. /**
  11512. * @implement
  11513. */
  11514. t.prototype.dispose=function(t){this.clear(t)},
  11515. /**
  11516. * @protected
  11517. */
  11518. t.prototype.determineAnimation=function(t,e){var n=e.get("animation"),i=t.axis,o="category"===i.type,r=e.get("snap");
  11519. // Value axis without snap always do not snap.
  11520. if(!r&&!o)return!1;if("auto"===n||null==n){var a=this.animationThreshold;if(o&&i.getBandWidth()>a)return!0;
  11521. // It is important to auto animation when snap used. Consider if there is
  11522. // a dataZoom, animation will be disabled when too many points exist, while
  11523. // it will be enabled for better visual effect when little points exist.
  11524. if(r){var s=ev(t).seriesDataCount,l=i.getExtent();
  11525. // Approximate band width
  11526. return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},
  11527. /**
  11528. * add {pointer, label, graphicKey} to elOption
  11529. * @protected
  11530. */
  11531. t.prototype.makeElOption=function(t,e,n,i,o){
  11532. // Should be implemenented by sub-class.
  11533. },
  11534. /**
  11535. * @protected
  11536. */
  11537. t.prototype.createPointerEl=function(t,e,n,i){var o=e.pointer;if(o){var r=hC(t).pointerEl=new Go[o.type](pC(e.pointer));t.add(r)}},
  11538. /**
  11539. * @protected
  11540. */
  11541. t.prototype.createLabelEl=function(t,e,n,i){if(e.label){var o=hC(t).labelEl=new $(pC(e.label));t.add(o),vC(o,i)}},
  11542. /**
  11543. * @protected
  11544. */
  11545. t.prototype.updatePointerEl=function(t,e,n){var i=hC(t).pointerEl;i&&e.pointer&&(i.setStyle(e.pointer.style),n(i,{shape:e.pointer.shape}))},
  11546. /**
  11547. * @protected
  11548. */
  11549. t.prototype.updateLabelEl=function(t,e,n,i){var o=hC(t).labelEl;o&&(o.setStyle(e.label.style),n(o,{
  11550. // Consider text length change in vertical axis, animation should
  11551. // be used on shape, otherwise the effect will be weird.
  11552. // TODOTODO
  11553. // shape: elOption.label.shape,
  11554. x:e.label.x,y:e.label.y}),vC(o,i))},
  11555. /**
  11556. * @private
  11557. */
  11558. t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,o=this._api.getZr(),r=this._handle,a=n.getModel("handle"),s=n.get("status");if(!a.get("show")||!s||"hide"===s)return r&&o.remove(r),void(this._handle=null);this._handle||(e=!0,r=this._handle=No(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){
  11559. // For mobile device, prevent screen slider on the button.
  11560. jt(t.event)},onmousedown:fC(this._onHandleDragMove,this,0,0),drift:fC(this._onHandleDragMove,this),ondragend:fC(this._onHandleDragEnd,this)}),o.add(r)),_C(r,n,!1),
  11561. // update style
  11562. r.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));
  11563. // update position
  11564. var l=a.get("size");i(l)||(l=[l,l]),r.scaleX=l[0]/2,r.scaleY=l[1]/2,Bu(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){yC(this._axisPointerModel,!e&&this._moveAnimation,this._handle,xC(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;
  11565. // Persistent for throttle.
  11566. var i=this.updateHandleTransform(xC(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(xC(i)),hC(n).lastProp=null,this._doDispatchAxisPointer()}},
  11567. /**
  11568. * Throttled method.
  11569. */
  11570. t.prototype._doDispatchAxisPointer=function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");
  11571. // Consider snap or categroy axis, handle may be not consistent with
  11572. // axisPointer. So move handle to align the exact value position when
  11573. // drag ended.
  11574. this._moveHandleToValue(t),
  11575. // For the effect: tooltip will be shown when finger holding on handle
  11576. // button, and will be hidden after finger left handle button.
  11577. this._api.dispatchAction({type:"hideTip"})}},
  11578. /**
  11579. * @private
  11580. */
  11581. t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,i=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),i&&e.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),Gu(this,"_doDispatchAxisPointer")},
  11582. /**
  11583. * @protected
  11584. */
  11585. t.prototype.doClear=function(){
  11586. // Implemented by sub-class if necessary.
  11587. },t.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},t}();function yC(t,e,n,i){
  11588. // Animation optimize.
  11589. mC(hC(n).lastProp,i)||(hC(n).lastProp=i,e?io(n,i,t):(n.stopAnimation(),n.attr(i)))}function mC(t,e){if(o(t)&&o(e)){var n=!0;return a(e,(function(e,i){n=n&&mC(t[i],e)})),!!n}return t===e}function vC(t,e){t[e.get(["label","show"])?"show":"hide"]()}function xC(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function _C(t,e,n){var i=e.get("z"),o=e.get("zlevel");t&&t.traverse((function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=o&&(t.zlevel=o),t.silent=n)}))}const bC=gC;function SC(t){var e,n=t.get("type"),i=t.getModel(n+"Style");return"line"===n?(e=i.getLineStyle()).fill=null:"shadow"===n&&((e=i.getAreaStyle()).stroke=null),e}
  11590. /**
  11591. * @param {Function} labelPos {align, verticalAlign, position}
  11592. */function wC(t,e,n,i,o){var r=MC(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=aa(a.get("padding")||0),l=a.getFont(),u=Lt(r,l),c=o.position,d=u.width+s[1]+s[3],h=u.height+s[0]+s[2],p=o.align;"right"===p&&(c[0]-=d),"center"===p&&(c[0]-=d/2);var f=o.verticalAlign;"bottom"===f&&(c[1]-=h),"middle"===f&&(c[1]-=h/2),
  11593. // Not overflow ec container
  11594. // Do not overflow ec container
  11595. function(t,e,n,i){var o=i.getWidth(),r=i.getHeight();t[0]=Math.min(t[0]+e,o)-e,t[1]=Math.min(t[1]+n,r)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}(c,d,h,i);var g=a.get("backgroundColor");g&&"auto"!==g||(g=e.get(["axisLine","lineStyle","color"])),t.label={
  11596. // shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')},
  11597. x:c[0],y:c[1],style:Zo(a,{text:r,font:l,fill:a.getTextColor(),padding:s,backgroundColor:g}),
  11598. // Label should be over axisPointer.
  11599. z2:10}}function MC(e,n,i,o,r){e=n.scale.parse(e);var s=n.scale.getLabel({value:e},{
  11600. // If `precision` is set, width can be fixed (like '12.00500'), which
  11601. // helps to debounce when when moving label.
  11602. precision:r.precision}),l=r.formatter;if(l){var u={value:af(n,{value:e}),axisDimension:n.dim,axisIndex:n.index,seriesData:[]};a(o,(function(t){var e=i.getSeriesByIndex(t.seriesIndex),n=t.dataIndexInside,o=e&&e.getDataParams(n);o&&u.seriesData.push(o)})),t(l)?s=l.replace("{value}",s):f(l)&&(s=l(u))}return s}function IC(t,e,n){var i=te();return Ut(i,i,n.rotation),oe(i,i,n.position),To([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function DC(t,e,n,i,o,r){
  11603. // @ts-ignore
  11604. var a=$m.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=o.get(["label","margin"]),wC(e,i,o,r,{position:IC(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}function TC(t,e,n){return{x1:t[n=n||0],y1:t[1-n],x2:e[n],y2:e[1-n]}}function CC(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}}function AC(t,e,n,i,o,r){return{cx:t,cy:e,r0:n,r:i,startAngle:o,endAngle:r,clockwise:!0}}var LC=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}
  11605. /**
  11606. * @override
  11607. */return Ue(e,t),e.prototype.makeElOption=function(t,e,n,i,o){var r=n.axis,a=r.grid,s=i.get("type"),l=kC(a,r).getOtherAxis(r).getGlobalExtent(),u=r.toGlobalCoord(r.dataToCoord(e,!0));if(s&&"none"!==s){var c=SC(i),d=PC[s](r,u,l);d.style=c,t.graphicKey=d.type,t.pointer=d}DC(
  11608. // @ts-ignore
  11609. e,t,Rm(a.model,n),n,i,o)},
  11610. /**
  11611. * @override
  11612. */
  11613. e.prototype.getHandleTransform=function(t,e,n){var i=Rm(e.axis.grid.model,e,{labelInside:!1});
  11614. // @ts-ignore
  11615. i.labelMargin=n.get(["handle","margin"]);var o=IC(e.axis,t,i);return{x:o[0],y:o[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},
  11616. /**
  11617. * @override
  11618. */
  11619. e.prototype.updateHandleTransform=function(t,e,n,i){var o=n.axis,r=o.grid,a=o.getGlobalExtent(!0),s=kC(r,o).getOtherAxis(o).getGlobalExtent(),l="x"===o.dim?0:1,u=[t.x,t.y];u[l]+=e[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var c=(s[1]+s[0])/2,d=[c,c];d[l]=u[l];return{x:u[0],y:u[1],rotation:t.rotation,cursorPoint:d,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},e}(bC);function kC(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var PC={line:function(t,e,n){return{type:"Line",subPixelOptimize:!0,shape:TC([e,n[0]],[e,n[1]],NC(t))}},shadow:function(t,e,n){var i=Math.max(1,t.getBandWidth()),o=n[1]-n[0];return{type:"Rect",shape:CC([e-i/2,n[0]],[i,o],NC(t))}}};function NC(t){return"x"===t.dim?0:1}const OC=LC;const RC=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="axisPointer",e.defaultOption={
  11620. // 'auto' means that show when triggered by tooltip or handle.
  11621. show:"auto",
  11622. // zlevel: 0,
  11623. z:50,type:"line",
  11624. // axispointer triggered by tootip determine snap automatically,
  11625. // see `modelHelper`.
  11626. snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],
  11627. // Do not set 'auto' here, otherwise global animation: false
  11628. // will not effect at this axispointer.
  11629. animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,
  11630. // eslint-disable-next-line
  11631. icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,
  11632. // handle margin is from symbol center to axis, which is stable when circular move.
  11633. margin:50,
  11634. // color: '#1b8bbd'
  11635. // color: '#2f4554'
  11636. color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,
  11637. // For mobile performance
  11638. throttle:40}},e}(Ta);var EC=On(),VC=a;
  11639. /**
  11640. * @param {string} key
  11641. * @param {module:echarts/ExtensionAPI} api
  11642. * @param {Function} handler
  11643. * param: {string} currTrigger
  11644. * param: {Array.<number>} point
  11645. */
  11646. function zC(t,e,n){if(!d.node){var i=e.getZr();EC(i).records||(EC(i).records={}),function(t,e){if(EC(t).initialized)return;function n(n,i){t.on(n,(function(n){var o=function(t){var e={showTip:[],hideTip:[]},n=function(i){var o=e[i.type];o?o.push(i):(i.dispatchAction=n,t.dispatchAction(i))};
  11647. // FIXME
  11648. // better approach?
  11649. // 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip,
  11650. // which may be conflict, (axisPointer call showTip but tooltip call hideTip);
  11651. // So we have to add "final stage" to merge those dispatched actions.
  11652. return{dispatchAction:n,pendings:e}}(e);VC(EC(t).records,(function(t){t&&i(t,n,o.dispatchAction)})),function(t,e){var n,i=t.showTip.length,o=t.hideTip.length;i?n=t.showTip[i-1]:o&&(n=t.hideTip[o-1]);n&&(n.dispatchAction=null,e.dispatchAction(n))}(o.pendings,e)}))}EC(t).initialized=!0,n("click",rt(GC,"click")),n("mousemove",rt(GC,"mousemove")),
  11653. // useHandler('mouseout', onLeave);
  11654. n("globalout",BC)}(i,e),(EC(i).records[t]||(EC(i).records[t]={})).handler=n}}function BC(t,e,n){t.handler("leave",null,n)}function GC(t,e,n,i){e.handler(t,n,i)}function FC(t,e){if(!d.node){var n=e.getZr();(EC(n).records||{})[t]&&(EC(n).records[t]=null)}}var WC=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=e.getComponent("tooltip"),o=t.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";
  11655. // Register global listener in AxisPointerView to enable
  11656. // AxisPointerView to be independent to Tooltip.
  11657. zC("axisPointer",n,(function(t,e,n){
  11658. // If 'none', it is not controlled by mouse totally.
  11659. "none"!==o&&("leave"===t||o.indexOf(t)>=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})}))},e.prototype.remove=function(t,e){FC("axisPointer",e)},e.prototype.dispose=function(t,e){FC("axisPointer",e)},e.type="axisPointer",e}(Mu);const HC=WC;
  11660. /**
  11661. * @param finder contains {seriesIndex, dataIndex, dataIndexInside}
  11662. * @param ecModel
  11663. * @return {point: [x, y], el: ...} point Will not be null.
  11664. */function YC(t,e){var o,r=[],a=t.seriesIndex;if(null==a||!(o=e.getSeriesByIndex(a)))return{point:[]};var s=o.getData(),l=Nn(s,t);if(null==l||l<0||i(l))return{point:[]};var u=s.getItemGraphicEl(l),c=o.coordinateSystem;if(o.getTooltipPosition)r=o.getTooltipPosition(l)||[];else if(c&&c.dataToPoint)if(t.isStacked){var d=c.getBaseAxis(),h=c.getOtherAxis(d).dim,p=d.dim,f="x"===h||"radius"===h?1:0,g=s.mapDimension(p),y=[];y[f]=s.get(g,l),y[1-f]=s.get(s.getCalculationInfo("stackResultDimension"),l),r=c.dataToPoint(y)||[]}else r=c.dataToPoint(s.getValues(n(c.dimensions,(function(t){return s.mapDimension(t)})),l))||[];else if(u){
  11665. // Use graphic bounding rect
  11666. var m=u.getBoundingRect().clone();m.applyTransform(u.transform),r=[m.x+m.width/2,m.y+m.height/2]}return{point:r,el:u}}var UC=On();
  11667. /**
  11668. * Basic logic: check all axis, if they do not demand show/highlight,
  11669. * then hide/downplay them.
  11670. *
  11671. * @return content of event obj for echarts.connect.
  11672. */function ZC(t,e,n){var i=t.currTrigger,o=[t.x,t.y],r=t,s=t.dispatchAction||lt(n.dispatchAction,n),l=e.getComponent("axisPointer").coordSysAxesInfo;
  11673. // Pending
  11674. // See #6121. But we are not able to reproduce it yet.
  11675. if(l){JC(o)&&(
  11676. // Used in the default behavior of `connection`: use the sample seriesIndex
  11677. // and dataIndex. And also used in the tooltipView trigger.
  11678. o=YC({seriesIndex:r.seriesIndex,
  11679. // Do not use dataIndexInside from other ec instance.
  11680. // FIXME: auto detect it?
  11681. dataIndex:r.dataIndex},e).point);var u=JC(o),c=r.axesInfo,d=l.axesInfo,h="leave"===i||JC(o),p={},f={},g={list:[],map:{}},y={showPointer:rt(jC,f),showTooltip:rt(qC,g)};
  11682. // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).
  11683. // Notice: In this case, it is difficult to get the `point` (which is necessary to show
  11684. // tooltip, so if point is not given, we just use the point found by sample seriesIndex
  11685. // and dataIndex.
  11686. // Process for triggered axes.
  11687. a(l.coordSysMap,(function(t,e){
  11688. // If a point given, it must be contained by the coordinate system.
  11689. var n=u||t.containPoint(o);a(l.coordSysAxesInfo[e],(function(t,e){var i=t.axis,r=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(c,t);
  11690. // If no inputAxesInfo, no axis is restricted.
  11691. if(!h&&n&&(!c||r)){var a=r&&r.value;null!=a||u||(a=i.pointToData(o)),null!=a&&XC(t,a,y,!1,p)}}))}));
  11692. // Process for linked axes.
  11693. var m={};return a(d,(function(t,e){var n=t.linkGroup;
  11694. // If axis has been triggered in the previous stage, it should not be triggered by link.
  11695. n&&!f[e]&&a(n.axesInfo,(function(e,i){var o=f[i];
  11696. // If srcValItem exist, source axis is triggered, so link to target axis.
  11697. if(e!==t&&o){var r=o.value;n.mapper&&(r=t.axis.scale.parse(n.mapper(r,KC(e),KC(t)))),m[t.key]=r}}))})),a(m,(function(t,e){XC(d[e],t,y,!0,p)})),function(t,e,n){var i=n.axesInfo=[];
  11698. // Basic logic: If no 'show' required, 'hide' this axisPointer.
  11699. a(e,(function(e,n){var o=e.axisPointerModel.option,r=t[n];r?(!e.useHandle&&(o.status="show"),o.value=r.value,
  11700. // For label formatter param and highlight.
  11701. o.seriesDataIndices=(r.payloadBatch||[]).slice()):
  11702. // If hide, value still need to be set, consider
  11703. // click legend to toggle axis blank.
  11704. !e.useHandle&&(o.status="hide"),
  11705. // If status is 'hide', should be no info in payload.
  11706. "show"===o.status&&i.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:o.value})}))}(f,d,p),function(t,e,n,i){
  11707. // Basic logic: If no showTip required, hideTip will be dispatched.
  11708. if(JC(e)||!t.list.length)return void i({type:"hideTip"});
  11709. // In most case only one axis (or event one series is used). It is
  11710. // convenient to fetch payload.seriesIndex and payload.dataIndex
  11711. // directly. So put the first seriesIndex and dataIndex of the first
  11712. // axis on the payload.
  11713. var o=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:o.dataIndexInside,dataIndex:o.dataIndex,seriesIndex:o.seriesIndex,dataByCoordSys:t.list})}(g,o,t,s),function(t,e,n){
  11714. // FIXME
  11715. // highlight status modification should be a stage of main process?
  11716. // (Consider confilct (e.g., legend and axisPointer) and setOption)
  11717. var i=n.getZr(),o="axisPointerLastHighlights",r=UC(i)[o]||{},s=UC(i)[o]={};
  11718. // Update highlight/downplay status according to axisPointer model.
  11719. // Build hash map and remove duplicate incidentally.
  11720. a(t,(function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&t.triggerEmphasis&&a(n.seriesDataIndices,(function(t){var e=t.seriesIndex+" | "+t.dataIndex;s[e]=t}))}));
  11721. // Diff.
  11722. var l=[],u=[];a(r,(function(t,e){!s[e]&&u.push(t)})),a(s,(function(t,e){!r[e]&&l.push(t)})),u.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,
  11723. // Not blur others when highlight in axisPointer.
  11724. notBlur:!0,batch:u}),l.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,
  11725. // Not blur others when highlight in axisPointer.
  11726. notBlur:!0,batch:l})}(d,0,n),p}}function XC(t,e,n,i,o){var r=t.axis;if(!r.scale.isBlank()&&r.containData(e))if(t.involveSeries){
  11727. // Heavy calculation. So put it after axis.containData checking.
  11728. var s=function(t,e){var n=e.axis,i=n.dim,o=t,r=[],s=Number.MAX_VALUE,l=-1;return a(e.seriesModels,(function(e,u){var c,d,h=e.getData().mapDimensionsAll(i);if(e.getAxisTooltipData){var p=e.getAxisTooltipData(h,t,n);d=p.dataIndices,c=p.nestestValue}else{if(!(d=e.getData().indicesOfNearest(h[0],t,
  11729. // Add a threshold to avoid find the wrong dataIndex
  11730. // when data length is not same.
  11731. // false,
  11732. "category"===n.type?.5:null)).length)return;c=e.getData().get(h[0],d[0])}if(null!=c&&isFinite(c)){var f=t-c,g=Math.abs(f);
  11733. // Consider category case
  11734. g<=s&&((g<s||f>=0&&l<0)&&(s=g,l=f,o=c,r.length=0),a(d,(function(t){r.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})})))}})),{payloadBatch:r,snapToValue:o}}(e,t),l=s.payloadBatch,u=s.snapToValue;
  11735. // Fill content of event obj for echarts.connect.
  11736. // By default use the first involved series data as a sample to connect.
  11737. l[0]&&null==o.seriesIndex&&p(o,l[0]),
  11738. // If no linkSource input, this process is for collecting link
  11739. // target, where snap should not be accepted.
  11740. !i&&t.snap&&r.containData(u)&&null!=u&&(e=u),n.showPointer(t,e,l),
  11741. // Tooltip should always be snapToValue, otherwise there will be
  11742. // incorrect "axis value ~ series value" mapping displayed in tooltip.
  11743. n.showTooltip(t,s,u)}else n.showPointer(t,e)}function jC(t,e,n,i){t[e.key]={value:n,payloadBatch:i}}function qC(t,e,n,i){var o=n.payloadBatch,r=e.axis,a=r.model,s=e.axisPointerModel;
  11744. // If no data, do not create anything in dataByCoordSys,
  11745. // whose length will be used to judge whether dispatch action.
  11746. if(e.triggerTooltip&&o.length){var l=e.coordSys.model,u=iv(l),c=t.map[u];c||(c=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(c)),c.dataByAxis.push({axisDim:r.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,
  11747. // Caustion: viewHelper.getValueLabel is actually on "view stage", which
  11748. // depends that all models have been updated. So it should not be performed
  11749. // here. Considering axisPointerModel used here is volatile, which is hard
  11750. // to be retrieve in TooltipView, we prepare parameters here.
  11751. valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:o.slice()})}}function KC(t){var e=t.axis.model,n={},i=n.axisDim=t.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=e.componentIndex,n.axisName=n[i+"AxisName"]=e.name,n.axisId=n[i+"AxisId"]=e.id,n}function JC(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function $C(t){
  11752. // CartesianAxisPointer is not supposed to be required here. But consider
  11753. // echarts.simple.js and online build tooltip, which only require gridSimple,
  11754. // CartesianAxisPointer should be able to required somewhere.
  11755. av.registerAxisPointerClass("CartesianAxisPointer",OC),t.registerComponentModel(RC),t.registerComponentView(HC),t.registerPreprocessor((function(t){
  11756. // Always has a global axisPointerModel for default setting.
  11757. if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;
  11758. // Normalize to array to avoid object mergin. But if link
  11759. // is not set, remain null/undefined, otherwise it will
  11760. // override existent link setting.
  11761. e&&!i(e)&&(t.axisPointer.link=[e])}})),
  11762. // This process should proformed after coordinate systems created
  11763. // and series data processed. So put it on statistic processing stage.
  11764. t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,(function(t,e){
  11765. // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.
  11766. // allAxesInfo should be updated when setOption performed.
  11767. t.getComponent("axisPointer").coordSysAxesInfo=Qm(t,e)})),
  11768. // Broadcast to all views.
  11769. t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},ZC)}var QC=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}
  11770. /**
  11771. * @override
  11772. */return Ue(e,t),e.prototype.makeElOption=function(t,e,n,i,o){var r=n.axis;"angle"===r.dim&&(this.animationThreshold=Math.PI/18);var a=r.polar,s=a.getOtherAxis(r).getExtent(),l=r.dataToCoord(e),u=i.get("type");if(u&&"none"!==u){var c=SC(i),d=tA[u](r,a,l,s);d.style=c,t.graphicKey=d.type,t.pointer=d}var h=function(t,e,n,i,o){var r=e.axis,a=r.dataToCoord(t),s=i.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,c,d=i.getRadiusAxis().getExtent();if("radius"===r.dim){var h=te();Ut(h,h,s),oe(h,h,[i.cx,i.cy]),l=To([a,-o],h);var p=e.getModel("axisLabel").get("rotate")||0,f=$m.innerTextLayout(s,p*Math.PI/180,-1);
  11773. // @ts-ignore
  11774. u=f.textAlign,c=f.textVerticalAlign}else{
  11775. // angle axis
  11776. var g=d[1];l=i.coordToPoint([g+o,a]);var y=i.cx,m=i.cy;u=Math.abs(l[0]-y)/g<.3?"center":l[0]>y?"left":"right",c=Math.abs(l[1]-m)/g<.3?"middle":l[1]>m?"top":"bottom"}return{position:l,align:u,verticalAlign:c}}(e,n,0,a,i.get(["label","margin"]));wC(t,n,i,o,h)},e}(bC);var tA={line:function(t,e,n,i){return"angle"===t.dim?{type:"Line",shape:TC(e.coordToPoint([i[0],n]),e.coordToPoint([i[1],n]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:n}}},shadow:function(t,e,n,i){var o=Math.max(1,t.getBandWidth()),r=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:AC(e.cx,e.cy,i[0],i[1],
  11777. // In ECharts y is negative if angle is positive
  11778. (-n-o/2)*r,(o/2-n)*r)}:{type:"Sector",shape:AC(e.cx,e.cy,n-o/2,n+o/2,0,2*Math.PI)}}};const eA=QC;const nA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.findAxisModel=function(t){var e;return this.ecModel.eachComponent(t,(function(t){t.getCoordSysModel()===this&&(e=t)}),this),e},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={
  11779. // zlevel: 0,
  11780. z:0,center:["50%","50%"],radius:"80%"},e}(Ta);var iA=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",zn).models[0]},e.type="polarAxis",e}(Ta);nt(iA,df);var oA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="angleAxis",e}(iA),rA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="radiusAxis",e}(iA),aA=/** @class */function(t){function e(e,n){return t.call(this,"radius",e,n)||this}return Ue(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},e}(Yf);aA.prototype.dataToRadius=Yf.prototype.dataToCoord,aA.prototype.radiusToData=Yf.prototype.coordToData;const sA=aA;var lA=On(),uA=/** @class */function(t){function e(e,n){return t.call(this,"angle",e,n||[0,360])||this}return Ue(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},
  11781. /**
  11782. * Only be called in category axis.
  11783. * Angle axis uses text height to decide interval
  11784. *
  11785. * @override
  11786. * @return {number} Auto interval for cateogry axis tick and label
  11787. */
  11788. e.prototype.calculateCategoryInterval=function(){var t=this,e=t.getLabelModel(),n=t.scale,i=n.getExtent(),o=n.count();if(i[1]-i[0]<1)return 0;var r=i[0],a=t.dataToCoord(r+1)-t.dataToCoord(r),s=Math.abs(a),l=Lt(null==r?"":r+"",e.getFont(),"center","top"),u=Math.max(l.height,7)/s;
  11789. // 0/0 is NaN, 1/0 is Infinity.
  11790. isNaN(u)&&(u=Infinity);var c=Math.max(0,Math.floor(u)),d=lA(t.model),h=d.lastAutoInterval,p=d.lastTickCount;
  11791. // Use cache to keep interval stable while moving zoom window,
  11792. // otherwise the calculated interval might jitter when the zoom
  11793. // window size is close to the interval-changing size.
  11794. return null!=h&&null!=p&&Math.abs(h-c)<=1&&Math.abs(p-o)<=1&&h>c?c=h:(d.lastTickCount=o,d.lastAutoInterval=c),c},e}(Yf);uA.prototype.dataToAngle=Yf.prototype.dataToCoord,uA.prototype.angleToData=Yf.prototype.coordToData;const cA=uA;var dA=["radius","angle"],hA=/** @class */function(){function t(t){this.dimensions=dA,this.type="polar",
  11795. /**
  11796. * x of polar center
  11797. */
  11798. this.cx=0,
  11799. /**
  11800. * y of polar center
  11801. */
  11802. this.cy=0,this._radiusAxis=new sA,this._angleAxis=new cA,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}
  11803. /**
  11804. * If contain coord
  11805. */return t.prototype.containPoint=function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},
  11806. /**
  11807. * If contain data
  11808. */
  11809. t.prototype.containData=function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},t.prototype.getAxis=function(t){return this["_"+t+"Axis"]},t.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},
  11810. /**
  11811. * Get axes by type of scale
  11812. */
  11813. t.prototype.getAxesByScale=function(t){var e=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===t&&e.push(n),i.scale.type===t&&e.push(i),e},t.prototype.getAngleAxis=function(){return this._angleAxis},t.prototype.getRadiusAxis=function(){return this._radiusAxis},t.prototype.getOtherAxis=function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},
  11814. /**
  11815. * Base axis will be used on stacking.
  11816. *
  11817. */
  11818. t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},t.prototype.getTooltipAxes=function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},
  11819. /**
  11820. * Convert a single data item to (x, y) point.
  11821. * Parameter data is an array which the first element is radius and the second is angle
  11822. */
  11823. t.prototype.dataToPoint=function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},
  11824. /**
  11825. * Convert a (x, y) point to data
  11826. */
  11827. t.prototype.pointToData=function(t,e){var n=this.pointToCoord(t);return[this._radiusAxis.radiusToData(n[0],e),this._angleAxis.angleToData(n[1],e)]},
  11828. /**
  11829. * Convert a (x, y) point to (radius, angle) coord
  11830. */
  11831. t.prototype.pointToCoord=function(t){var e=t[0]-this.cx,n=t[1]-this.cy,i=this.getAngleAxis(),o=i.getExtent(),r=Math.min(o[0],o[1]),a=Math.max(o[0],o[1]);
  11832. // Fix fixed extent in polarCreator
  11833. // FIXME
  11834. i.inverse?r=a-360:a=r+360;var s=Math.sqrt(e*e+n*n);e/=s,n/=s;for(var l=Math.atan2(-n,e)/Math.PI*180,u=l<r?1:-1
  11835. // move to angleExtent
  11836. ;l<r||l>a;)l+=360*u;return[s,l]},
  11837. /**
  11838. * Convert a (radius, angle) coord to (x, y) point
  11839. */
  11840. t.prototype.coordToPoint=function(t){var e=t[0],n=t[1]/180*Math.PI;return[Math.cos(n)*e+this.cx,-Math.sin(n)*e+this.cy]},
  11841. /**
  11842. * Get ring area of cartesian.
  11843. * Area will have a contain function to determine if a point is in the coordinate system.
  11844. */
  11845. t.prototype.getArea=function(){var t=this.getAngleAxis(),e=this.getRadiusAxis().getExtent().slice();e[0]>e[1]&&e.reverse();var n=t.getExtent(),i=Math.PI/180,o=1e-4;return{cx:this.cx,cy:this.cy,r0:e[0],r:e[1],startAngle:-n[0]*i,endAngle:-n[1]*i,clockwise:t.inverse,contain:function(t,e){
  11846. // It's a ring shape.
  11847. // Start angle and end angle don't matter
  11848. var n=t-this.cx,i=e-this.cy,r=n*n+i*i,a=this.r,s=this.r0;
  11849. // minus a tiny value 1e-4 in double side to avoid being clipped unexpectedly
  11850. // r == r0 contain nothing
  11851. return a!==s&&r-o<=a*a&&r+o>=s*s}}},t.prototype.convertToPixel=function(t,e,n){return pA(e)===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){return pA(e)===this?this.pointToData(n):null},t}();function pA(t){var e=t.seriesModel,n=t.polarModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}const fA=hA;
  11852. /**
  11853. * Resize method bound to the polar
  11854. */
  11855. /**
  11856. * Update polar
  11857. */
  11858. function gA(t,e){var n=this,i=n.getAngleAxis(),o=n.getRadiusAxis();
  11859. // Fix extent of category angle axis
  11860. if(
  11861. // Reset scale
  11862. i.scale.setExtent(Infinity,-Infinity),o.scale.setExtent(Infinity,-Infinity),t.eachSeries((function(t){if(t.coordinateSystem===n){var e=t.getData();a(cf(e,"radius"),(function(t){o.scale.unionExtentFromData(e,t)})),a(cf(e,"angle"),(function(t){i.scale.unionExtentFromData(e,t)}))}})),nf(i.scale,i.model),nf(o.scale,o.model),"category"===i.type&&!i.onBand){var r=i.getExtent(),s=360/i.scale.count();i.inverse?r[1]+=s:r[1]-=s,i.setExtent(r[0],r[1])}}
  11863. /**
  11864. * Set common axis properties
  11865. */
  11866. function yA(t,e){var n;if(t.type=e.get("type"),t.scale=of(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),function(t){return"angleAxis"===t.mainType}(e)){t.inverse=t.inverse!==e.get("clockwise");var i=e.get("startAngle"),o=null!==(n=e.get("endAngle"))&&void 0!==n?n:i+(t.inverse?-360:360);t.setExtent(i,o)}
  11867. // Inject axis instance
  11868. e.axis=t,t.model=e}var mA={dimensions:dA,create:function(t,e){var n=[];return t.eachComponent("polar",(function(t,o){var r=new fA(o+"");
  11869. // Inject resize and update method
  11870. r.update=gA;var a=r.getRadiusAxis(),s=r.getAngleAxis(),l=t.findAxisModel("radiusAxis"),u=t.findAxisModel("angleAxis");yA(a,l),yA(s,u),function(t,e,n){var o=e.get("center"),r=n.getWidth(),a=n.getHeight();t.cx=je(o[0],r),t.cy=je(o[1],a);var s=t.getRadiusAxis(),l=Math.min(r,a)/2,u=e.get("radius");null==u?u=[0,"100%"]:i(u)||(
  11871. // r0 = 0
  11872. u=[0,u]);var c=[je(u[0],l),je(u[1],l)];s.inverse?s.setExtent(c[1],c[0]):s.setExtent(c[0],c[1])}(r,t,e),n.push(r),t.coordinateSystem=r,r.model=t})),
  11873. // Inject coordinateSystem to series
  11874. t.eachSeries((function(t){if("polar"===t.get("coordinateSystem")){var e=t.getReferringComponents("polar",zn).models[0];t.coordinateSystem=e.coordinateSystem}})),n}};const vA=mA;var xA=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function _A(t,e,n){e[1]>e[0]&&(e=e.slice().reverse());var i=t.coordToPoint([e[0],n]),o=t.coordToPoint([e[1],n]);return{x1:i[0],y1:i[1],x2:o[0],y2:o[1]}}function bA(t){return t.getRadiusAxis().inverse?0:1}
  11875. // Remove the last tick which will overlap the first tick
  11876. function SA(t){var e=t[0],n=t[t.length-1];e&&n&&Math.abs(Math.abs(e.coord-n.coord)-360)<1e-4&&t.pop()}var wA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="PolarAxisPointer",n}return Ue(e,t),e.prototype.render=function(t,e){if(this.group.removeAll(),t.get("show")){var i=t.axis,o=i.polar,r=o.getRadiusAxis().getExtent(),s=i.getTicksCoords(),l=i.getMinorTicksCoords(),u=n(i.getViewLabels(),(function(t){t=et(t);var e=i.scale,n="ordinal"===e.type?e.getRawOrdinalNumber(t.tickValue):t.tickValue;return t.coord=i.dataToCoord(n),t}));SA(u),SA(s),a(xA,(function(e){!t.get([e,"show"])||i.scale.isBlank()&&"axisLine"!==e||MA[e](this.group,t,o,s,l,r,u)}),this)}},e.type="angleAxis",e}(av),MA={axisLine:function(t,e,n,i,o,r){var a,s=e.getModel(["axisLine","lineStyle"]),l=n.getAngleAxis(),u=Math.PI/180,c=l.getExtent(),d=bA(n),h=d?0:1,p=360===Math.abs(c[1]-c[0])?"Circle":"Arc";(a=0===r[h]?new Go[p]({shape:{cx:n.cx,cy:n.cy,r:r[d],startAngle:-c[0]*u,endAngle:-c[1]*u,clockwise:l.inverse},style:s.getLineStyle(),z2:1,silent:!0}):new V({shape:{cx:n.cx,cy:n.cy,r:r[d],r0:r[h]},style:s.getLineStyle(),z2:1,silent:!0})).style.fill=null,t.add(a)},axisTick:function(t,e,i,o,r,a){var s=e.getModel("axisTick"),l=(s.get("inside")?-1:1)*s.get("length"),u=a[bA(i)],c=n(o,(function(t){return new F({shape:_A(i,[u,u+l],t.coord)})}));t.add(So(c,{style:I(s.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,n,i,o,r){if(o.length){for(var a=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(a.get("inside")?-1:1)*s.get("length"),u=r[bA(n)],c=[],d=0;d<o.length;d++)for(var h=0;h<o[d].length;h++)c.push(new F({shape:_A(n,[u,u+l],o[d][h].coord)}));t.add(So(c,{style:I(s.getModel("lineStyle").getLineStyle(),I(a.getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])}))}))}},axisLabel:function(t,e,n,i,r,s,l){var u=e.getCategories(!0),c=e.getModel("axisLabel"),d=c.get("margin"),h=e.get("triggerEvent");
  11877. // Use length of ticksAngles because it may remove the last tick to avoid overlapping
  11878. a(l,(function(i,r){var a=c,l=i.tickValue,p=s[bA(n)],f=n.coordToPoint([p+d,i.coord]),g=n.cx,y=n.cy,m=Math.abs(f[0]-g)/p<.3?"center":f[0]>g?"left":"right",v=Math.abs(f[1]-y)/p<.3?"middle":f[1]>y?"top":"bottom";if(u&&u[l]){var x=u[l];o(x)&&x.textStyle&&(a=new yr(x.textStyle,c,c.ecModel))}var _=new $({silent:$m.isLabelSilent(e),style:Zo(a,{x:f[0],y:f[1],fill:a.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:i.formattedLabel,align:m,verticalAlign:v})});
  11879. // Pack data for mouse event
  11880. if(t.add(_),h){var b=$m.makeAxisEventDataBase(e);b.targetType="axisLabel",b.value=i.rawLabel,ni(_).eventData=b}}),this)},splitLine:function(t,e,n,i,o,r){var a=e.getModel("splitLine").getModel("lineStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=0;c<i.length;c++){var d=l++%s.length;u[d]=u[d]||[],u[d].push(new F({shape:_A(n,r,i[c].coord)}))}
  11881. // Simple optimization
  11882. // Batching the lines if color are the same
  11883. for(c=0;c<u.length;c++)t.add(So(u[c],{style:I({stroke:s[c%s.length]},a.getLineStyle()),silent:!0,z:e.get("z")}))},minorSplitLine:function(t,e,n,i,o,r){if(o.length){for(var a=e.getModel("minorSplitLine").getModel("lineStyle"),s=[],l=0;l<o.length;l++)for(var u=0;u<o[l].length;u++)s.push(new F({shape:_A(n,r,o[l][u].coord)}));t.add(So(s,{style:a.getLineStyle(),silent:!0,z:e.get("z")}))}},splitArea:function(t,e,n,i,o,r){if(i.length){var a=e.getModel("splitArea").getModel("areaStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=Math.PI/180,d=-i[0].coord*c,h=Math.min(r[0],r[1]),p=Math.max(r[0],r[1]),f=e.get("clockwise"),g=1,y=i.length;g<=y;g++){var m=g===y?i[0].coord:i[g].coord,v=l++%s.length;u[v]=u[v]||[],u[v].push(new E({shape:{cx:n.cx,cy:n.cy,r0:h,r:p,startAngle:d,endAngle:-m*c,clockwise:f},silent:!0})),d=-m*c}
  11884. // Simple optimization
  11885. // Batching the lines if color are the same
  11886. for(g=0;g<u.length;g++)t.add(So(u[g],{style:I({fill:s[g%s.length]},a.getAreaStyle()),silent:!0}))}}};const IA=wA;var DA=["axisLine","axisTickLabel","axisName"],TA=["splitLine","splitArea","minorSplitLine"],CA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="PolarAxisPointer",n}return Ue(e,t),e.prototype.render=function(t,e){if(this.group.removeAll(),t.get("show")){var n=this._axisGroup,i=this._axisGroup=new Z;this.group.add(i);var o=t.axis,r=o.polar,s=r.getAngleAxis(),l=o.getTicksCoords(),u=o.getMinorTicksCoords(),c=s.getExtent()[0],d=o.getExtent(),h=
  11887. /**
  11888. * @inner
  11889. */
  11890. function(t,e,n){return{position:[t.cx,t.cy],rotation:n/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:e.getModel("axisLabel").get("rotate"),
  11891. // Over splitLine and splitArea
  11892. z2:1}}(r,t,c),p=new $m(t,h);a(DA,p.add,p),i.add(p.getGroup()),Lo(n,i,t),a(TA,(function(e){t.get([e,"show"])&&!o.scale.isBlank()&&AA[e](this.group,t,r,c,d,l,u)}),this)}},e.type="radiusAxis",e}(av),AA={splitLine:function(t,e,n,i,o,r){var a=e.getModel("splitLine").getModel("lineStyle"),s=a.get("color"),l=0,u=n.getAngleAxis(),c=Math.PI/180,d=u.getExtent(),h=360===Math.abs(d[1]-d[0])?"Circle":"Arc";s=s instanceof Array?s:[s];for(var p=[],f=0;f<r.length;f++){var g=l++%s.length;p[g]=p[g]||[],p[g].push(new Go[h]({shape:{cx:n.cx,cy:n.cy,
  11893. // ensure circle radius >= 0
  11894. r:Math.max(r[f].coord,0),startAngle:-d[0]*c,endAngle:-d[1]*c,clockwise:u.inverse}}))}
  11895. // Simple optimization
  11896. // Batching the lines if color are the same
  11897. for(f=0;f<p.length;f++)t.add(So(p[f],{style:I({stroke:s[f%s.length],fill:null},a.getLineStyle()),silent:!0}))},minorSplitLine:function(t,e,n,i,o,r,a){if(a.length){for(var s=e.getModel("minorSplitLine").getModel("lineStyle"),l=[],u=0;u<a.length;u++)for(var c=0;c<a[u].length;c++)l.push(new O({shape:{cx:n.cx,cy:n.cy,r:a[u][c].coord}}));t.add(So(l,{style:I({fill:null},s.getLineStyle()),silent:!0}))}},splitArea:function(t,e,n,i,o,r){if(r.length){var a=e.getModel("splitArea").getModel("areaStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=r[0].coord,d=1;d<r.length;d++){var h=l++%s.length;u[h]=u[h]||[],u[h].push(new E({shape:{cx:n.cx,cy:n.cy,r0:c,r:r[d].coord,startAngle:0,endAngle:2*Math.PI},silent:!0})),c=r[d].coord}
  11898. // Simple optimization
  11899. // Batching the lines if color are the same
  11900. for(d=0;d<u.length;d++)t.add(So(u[d],{style:I({fill:s[d%s.length]},a.getAreaStyle()),silent:!0}))}}};const LA=CA;function kA(t){return t.get("stack")||"__ec_stack_"+t.seriesIndex}function PA(t,e){return e.dim+t.model.componentIndex}function NA(t,e,n){var i={},o=
  11901. /**
  11902. * Calculate bar width and offset for radial bar charts
  11903. */
  11904. function(t){
  11905. // Columns info on each category axis. Key is polar name
  11906. var e={};a(t,(function(t,n){var i=t.getData(),o=t.coordinateSystem,r=o.getBaseAxis(),a=PA(o,r),s=r.getExtent(),l="category"===r.type?r.getBandWidth():Math.abs(s[1]-s[0])/i.count(),u=e[a]||{bandWidth:l,remainedWidth:l,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},c=u.stacks;e[a]=u;var d=kA(t);c[d]||u.autoWidthCount++,c[d]=c[d]||{width:0,maxWidth:0};var h=je(t.get("barWidth"),l),p=je(t.get("barMaxWidth"),l),f=t.get("barGap"),g=t.get("barCategoryGap");h&&!c[d].width&&(h=Math.min(u.remainedWidth,h),c[d].width=h,u.remainedWidth-=h),p&&(c[d].maxWidth=p),null!=f&&(u.gap=f),null!=g&&(u.categoryGap=g)}));var n={};return a(e,(function(t,e){n[e]={};var i=t.stacks,o=t.bandWidth,r=je(t.categoryGap,o),s=je(t.gap,1),l=t.remainedWidth,u=t.autoWidthCount,c=(l-r)/(u+(u-1)*s);c=Math.max(c,0),
  11907. // Find if any auto calculated bar exceeded maxBarWidth
  11908. a(i,(function(t,e){var n=t.maxWidth;n&&n<c&&(n=Math.min(n,l),t.width&&(n=Math.min(n,t.width)),l-=n,t.width=n,u--)})),
  11909. // Recalculate width again
  11910. c=(l-r)/(u+(u-1)*s),c=Math.max(c,0);var d,h=0;a(i,(function(t,e){t.width||(t.width=c),d=t,h+=t.width*(1+s)})),d&&(h-=d.width*s);var p=-h/2;a(i,(function(t,i){n[e][i]=n[e][i]||{offset:p,width:t.width},p+=t.width*(1+s)}))})),n}(st(e.getSeriesByType(t),(function(t){return!e.isSeriesFiltered(t)&&t.coordinateSystem&&"polar"===t.coordinateSystem.type})));e.eachSeriesByType(t,(function(t){
  11911. // Check series coordinate, do layout for polar only
  11912. if("polar"===t.coordinateSystem.type){var e=t.getData(),n=t.coordinateSystem,r=n.getBaseAxis(),a=PA(n,r),s=kA(t),l=o[a][s],u=l.offset,c=l.width,d=n.getOtherAxis(r),h=t.coordinateSystem.cx,p=t.coordinateSystem.cy,f=t.get("barMinHeight")||0,g=t.get("barMinAngle")||0;i[s]=i[s]||[];for(var y=e.mapDimension(d.dim),m=e.mapDimension(r.dim),v=qh(e,y/* , baseDim */),x="radius"!==r.dim||!t.get("roundCap",!0),_=d.model.get("startValue"),b=d.dataToCoord(_||0),S=0,w=e.count();S<w;S++){var M=e.get(y,S),I=e.get(m,S),D=M>=0?"p":"n",T=b;
  11913. // Because of the barMinHeight, we can not use the value in
  11914. // stackResultDimension directly.
  11915. // Only ordinal axis can be stacked.
  11916. v&&(i[s][I]||(i[s][I]={p:b,n:b}),
  11917. // Should also consider #4243
  11918. T=i[s][I][D]);var C=void 0,A=void 0,L=void 0,k=void 0;
  11919. // radial sector
  11920. if("radius"===d.dim){var P=d.dataToCoord(M)-b,N=r.dataToCoord(I);Math.abs(P)<f&&(P=(P<0?-1:1)*f),C=T,A=T+P,k=(L=N-u)-c,v&&(i[s][I][D]=A)}
  11921. // tangential sector
  11922. else{var O=d.dataToCoord(M,x)-b,R=r.dataToCoord(I);Math.abs(O)<g&&(O=(O<0?-1:1)*g),A=(C=R+u)+c,L=T,k=T+O,
  11923. // if the previous stack is at the end of the ring,
  11924. // add a round to differentiate it from origin
  11925. // let extent = angleAxis.getExtent();
  11926. // let stackCoord = angle;
  11927. // if (stackCoord === extent[0] && value > 0) {
  11928. // stackCoord = extent[1];
  11929. // }
  11930. // else if (stackCoord === extent[1] && value < 0) {
  11931. // stackCoord = extent[0];
  11932. // }
  11933. v&&(i[s][I][D]=k)}e.setItemLayout(S,{cx:h,cy:p,r0:C,r:A,
  11934. // Consider that positive angle is anti-clockwise,
  11935. // while positive radian of sector is clockwise
  11936. startAngle:-L*Math.PI/180,endAngle:-k*Math.PI/180,
  11937. /**
  11938. * Keep the same logic with bar in catesion: use end value to
  11939. * control direction. Notice that if clockwise is true (by
  11940. * default), the sector will always draw clockwisely, no matter
  11941. * whether endAngle is greater or less than startAngle.
  11942. */
  11943. clockwise:L>=k})}}}))}var OA={startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:0}},RA={splitNumber:5},EA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="polar",e}(Mu);function VA(t,e){e=e||{};var n=t.coordinateSystem,i=t.axis,o={},r=i.position,a=i.orient,s=n.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};o.position=["vertical"===a?u.vertical[r]:l[0],"horizontal"===a?u.horizontal[r]:l[3]];o.rotation=Math.PI/2*{horizontal:0,vertical:1}[a];o.labelDirection=o.tickDirection=o.nameDirection={top:-1,bottom:1,right:1,left:-1}[r],t.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),Yt(e.labelInside,t.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var c=e.rotate;return null==c&&(c=t.get(["axisLabel","rotate"])),o.labelRotation="top"===r?-c:c,o.z2=1,o}var zA=["axisLine","axisTickLabel","axisName"],BA=["splitArea","splitLine"],GA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="SingleAxisPointer",n}return Ue(e,t),e.prototype.render=function(e,n,i,o){var r=this.group;r.removeAll();var s=this._axisGroup;this._axisGroup=new Z;var l=VA(e),u=new $m(e,l);a(zA,u.add,u),r.add(this._axisGroup),r.add(u.getGroup()),a(BA,(function(t){e.get([t,"show"])&&FA[t](this,this.group,this._axisGroup,e)}),this),Lo(s,this._axisGroup,e),t.prototype.render.call(this,e,n,i,o)},e.prototype.remove=function(){uv(this)},e.type="singleAxis",e}(av),FA={splitLine:function(t,e,n,i){var o=i.axis;if(!o.scale.isBlank()){var r=i.getModel("splitLine"),a=r.getModel("lineStyle"),s=a.get("color");s=s instanceof Array?s:[s];for(var l=a.get("width"),u=i.coordinateSystem.getRect(),c=o.isHorizontal(),d=[],h=0,p=o.getTicksCoords({tickModel:r}),f=[],g=[],y=0;y<p.length;++y){var m=o.toGlobalCoord(p[y].coord);c?(f[0]=m,f[1]=u.y,g[0]=m,g[1]=u.y+u.height):(f[0]=u.x,f[1]=m,g[0]=u.x+u.width,g[1]=m);var v=new F({shape:{x1:f[0],y1:f[1],x2:g[0],y2:g[1]},silent:!0});Mo(v.shape,l);var x=h++%s.length;d[x]=d[x]||[],d[x].push(v)}var _=a.getLineStyle(["color"]);for(y=0;y<d.length;++y)e.add(So(d[y],{style:I({stroke:s[y%s.length]},_),silent:!0}))}},splitArea:function(t,e,n,i){lv(t,n,i,i)}};const WA=GA;var HA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.getCoordSysModel=function(){return this},e.type="singleAxis",e.layoutMode="box",e.defaultOption={left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:1,type:"solid"}},
  11944. // Single coordinate system and single axis is the,
  11945. // which is used as the parent tooltip model.
  11946. // same model, so we set default tooltip show as true.
  11947. tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:1}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}}},e}(Ta);nt(HA,df.prototype);const YA=HA;var UA=/** @class */function(t){function e(e,n,i,o,r){var a=t.call(this,e,n,i)||this;return a.type=o||"value",a.position=r||"bottom",a}
  11948. /**
  11949. * Judge the orient of the axis.
  11950. */return Ue(e,t),e.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},e.prototype.pointToData=function(t,e){return this.coordinateSystem.pointToData(t)[0]},e}(Yf);const ZA=UA;var XA=["single"],jA=/** @class */function(){function t(t,e,n){this.type="single",this.dimension="single",
  11951. /**
  11952. * Add it just for draw tooltip.
  11953. */
  11954. this.dimensions=XA,this.axisPointerEnabled=!0,this.model=t,this._init(t,e,n)}
  11955. /**
  11956. * Initialize single coordinate system.
  11957. */return t.prototype._init=function(t,e,n){var i=this.dimension,o=new ZA(i,of(t),[0,0],t.get("type"),t.get("position")),r="category"===o.type;o.onBand=r&&t.get("boundaryGap"),o.inverse=t.get("inverse"),o.orient=t.get("orient"),t.axis=o,o.model=t,o.coordinateSystem=this,this._axis=o},
  11958. /**
  11959. * Update axis scale after data processed
  11960. */
  11961. t.prototype.update=function(t,e){t.eachSeries((function(t){if(t.coordinateSystem===this){var e=t.getData();a(e.mapDimensionsAll(this.dimension),(function(t){this._axis.scale.unionExtentFromData(e,t)}),this),nf(this._axis.scale,this._axis.model)}}),this)},
  11962. /**
  11963. * Resize the single coordinate system.
  11964. */
  11965. t.prototype.resize=function(t,e){this._rect=xa({left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")},{width:e.getWidth(),height:e.getHeight()}),this._adjustAxis()},t.prototype.getRect=function(){return this._rect},t.prototype._adjustAxis=function(){var t=this._rect,e=this._axis,n=e.isHorizontal(),i=n?[0,t.width]:[0,t.height],o=e.inverse?1:0;e.setExtent(i[o],i[1-o]),this._updateAxisTransform(e,n?t.x:t.y)},t.prototype._updateAxisTransform=function(t,e){var n=t.getExtent(),i=n[0]+n[1],o=t.isHorizontal();t.toGlobalCoord=o?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord=o?function(t){return t-e}:function(t){return i-t+e}},
  11966. /**
  11967. * Get axis.
  11968. */
  11969. t.prototype.getAxis=function(){return this._axis},
  11970. /**
  11971. * Get axis, add it just for draw tooltip.
  11972. */
  11973. t.prototype.getBaseAxis=function(){return this._axis},t.prototype.getAxes=function(){return[this._axis]},t.prototype.getTooltipAxes=function(){return{baseAxes:[this.getAxis()],
  11974. // Empty otherAxes
  11975. otherAxes:[]}},
  11976. /**
  11977. * If contain point.
  11978. */
  11979. t.prototype.containPoint=function(t){var e=this.getRect(),n=this.getAxis();return"horizontal"===n.orient?n.contain(n.toLocalCoord(t[0]))&&t[1]>=e.y&&t[1]<=e.y+e.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},t.prototype.pointToData=function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},
  11980. /**
  11981. * Convert the series data to concrete point.
  11982. * Can be [val] | val
  11983. */
  11984. t.prototype.dataToPoint=function(t){var e=this.getAxis(),n=this.getRect(),i=[],o="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),i[o]=e.toGlobalCoord(e.dataToCoord(+t)),i[1-o]=0===o?n.y+n.height/2:n.x+n.width/2,i},t.prototype.convertToPixel=function(t,e,n){return qA(e)===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){return qA(e)===this?this.pointToData(n):null},t}();
  11985. /**
  11986. * Create a single coordinates system.
  11987. */function qA(t){var e=t.seriesModel,n=t.singleAxisModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}
  11988. /**
  11989. * Create single coordinate system and inject it into seriesModel.
  11990. */const KA={create:function(t,e){var n=[];return t.eachComponent("singleAxis",(function(i,o){var r=new jA(i,t,e);r.name="single_"+o,r.resize(i,e),i.coordinateSystem=r,n.push(r)})),t.eachSeries((function(t){if("singleAxis"===t.get("coordinateSystem")){var e=t.getReferringComponents("singleAxis",zn).models[0];t.coordinateSystem=e&&e.coordinateSystem}})),n},dimensions:XA};var JA=["x","y"],$A=["width","height"],QA=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}
  11991. /**
  11992. * @override
  11993. */return Ue(e,t),e.prototype.makeElOption=function(t,e,n,i,o){var r=n.axis,a=r.coordinateSystem,s=nL(a,1-eL(r)),l=a.dataToPoint(e)[0],u=i.get("type");if(u&&"none"!==u){var c=SC(i),d=tL[u](r,l,s);d.style=c,t.graphicKey=d.type,t.pointer=d}DC(
  11994. // @ts-ignore
  11995. e,t,VA(n),n,i,o)},
  11996. /**
  11997. * @override
  11998. */
  11999. e.prototype.getHandleTransform=function(t,e,n){var i=VA(e,{labelInside:!1});
  12000. // @ts-ignore
  12001. i.labelMargin=n.get(["handle","margin"]);var o=IC(e.axis,t,i);return{x:o[0],y:o[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},
  12002. /**
  12003. * @override
  12004. */
  12005. e.prototype.updateHandleTransform=function(t,e,n,i){var o=n.axis,r=o.coordinateSystem,a=eL(o),s=nL(r,a),l=[t.x,t.y];l[a]+=e[a],l[a]=Math.min(s[1],l[a]),l[a]=Math.max(s[0],l[a]);var u=nL(r,1-a),c=(u[1]+u[0])/2,d=[c,c];return d[a]=l[a],{x:l[0],y:l[1],rotation:t.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}},e}(bC),tL={line:function(t,e,n){return{type:"Line",subPixelOptimize:!0,shape:TC([e,n[0]],[e,n[1]],eL(t))}},shadow:function(t,e,n){var i=t.getBandWidth(),o=n[1]-n[0];return{type:"Rect",shape:CC([e-i/2,n[0]],[i,o],eL(t))}}};function eL(t){return t.isHorizontal()?0:1}function nL(t,e){var n=t.getRect();return[n[JA[e]],n[JA[e]]+n[$A[e]]]}const iL=QA;var oL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="single",e}(Mu);function rL(t,e){
  12006. // Normalize cellSize
  12007. var o,r=t.cellSize;1===(o=i(r)?r:t.cellSize=[r,r]).length&&(o[1]=o[0]);var a=n([0,1],(function(t){
  12008. // If user have set `width` or both `left` and `right`, cellSizeArr
  12009. // will be automatically set to 'auto', otherwise the default
  12010. // setting of cellSizeArr will make `width` setting not work.
  12011. return function(t,e){return null!=t[ya[e][0]]||null!=t[ya[e][1]]&&null!=t[ya[e][2]]}(e,t)&&(o[t]="auto"),null!=o[t]&&"auto"!==o[t]}));Sa(t,e,{type:"box",ignoreSize:a})}const aL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}
  12012. /**
  12013. * @override
  12014. */return Ue(e,t),e.prototype.init=function(e,n,i){var o=wa(e);t.prototype.init.apply(this,arguments),rL(e,o)},
  12015. /**
  12016. * @override
  12017. */
  12018. e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),rL(this.option,e)},e.prototype.getCellSize=function(){
  12019. // Has been normalized
  12020. return this.option.cellSize},e.type="calendar",e.defaultOption={
  12021. // zlevel: 0,
  12022. z:2,left:80,top:60,cellSize:20,
  12023. // horizontal vertical
  12024. orient:"horizontal",
  12025. // month separate line style
  12026. splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},
  12027. // rect style temporarily unused emphasis
  12028. itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},
  12029. // week text style
  12030. dayLabel:{show:!0,firstDay:0,
  12031. // start end
  12032. position:"start",margin:"50%",color:"#000"},
  12033. // month text style
  12034. monthLabel:{show:!0,
  12035. // start end
  12036. position:"start",margin:5,
  12037. // center or left
  12038. align:"center",formatter:null,color:"#000"},
  12039. // year text style
  12040. yearLabel:{show:!0,
  12041. // top bottom left right
  12042. position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(Ta);var sL=/** @class */function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.type,t}return Ue(i,e),i.prototype.render=function(t,e,n){var i=this.group;i.removeAll();var o=t.coordinateSystem,r=o.getRangeInfo(),a=o.getOrient(),s=e.getLocaleModel();
  12043. // range info
  12044. this._renderDayRect(t,r,i),
  12045. // _renderLines must be called prior to following function
  12046. this._renderLines(t,r,a,i),this._renderYearText(t,r,a,i),this._renderMonthText(t,s,a,i),this._renderWeekText(t,s,r,a,i)},
  12047. // render day rect
  12048. i.prototype._renderDayRect=function(t,e,n){for(var i=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),r=i.getCellWidth(),a=i.getCellHeight(),s=e.start.time;s<=e.end.time;s=i.getNextNDay(s,1).time){var l=i.dataToRect([s],!1).tl,u=new G({shape:{x:l[0],y:l[1],width:r,height:a},cursor:"default",style:o});
  12049. // every rect
  12050. n.add(u)}},
  12051. // render separate line
  12052. i.prototype._renderLines=function(t,e,n,i){var o=this,r=t.coordinateSystem,a=t.getModel(["splitLine","lineStyle"]).getLineStyle(),s=t.get(["splitLine","show"]),l=a.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=e.start,c=0;u.time<=e.end.time;c++){h(u.formatedDate),0===c&&(u=r.getDateInfo(e.start.y+"-"+e.start.m));var d=u.date;d.setMonth(d.getMonth()+1),u=r.getDateInfo(d)}function h(e){o._firstDayOfMonth.push(r.getDateInfo(e)),o._firstDayPoints.push(r.dataToRect([e],!1).tl);var l=o._getLinePointsOfOneWeek(t,e,n);o._tlpoints.push(l[0]),o._blpoints.push(l[l.length-1]),s&&o._drawSplitline(l,a,i)}
  12053. // render top/left line
  12054. h(r.getNextNDay(e.end.time,1).formatedDate),s&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,l,n),a,i),
  12055. // render bottom/right line
  12056. s&&this._drawSplitline(o._getEdgesPoints(o._blpoints,l,n),a,i)},
  12057. // get points at both ends
  12058. i.prototype._getEdgesPoints=function(t,e,n){var i=[t[0].slice(),t[t.length-1].slice()],o="horizontal"===n?0:1;
  12059. // both ends of the line are extend half lineWidth
  12060. return i[0][o]=i[0][o]-e/2,i[1][o]=i[1][o]+e/2,i},
  12061. // render split line
  12062. i.prototype._drawSplitline=function(t,e,n){var i=new B({z2:20,shape:{points:t},style:e});n.add(i)},
  12063. // render month line of one week points
  12064. i.prototype._getLinePointsOfOneWeek=function(t,e,n){for(var i=t.coordinateSystem,o=i.getDateInfo(e),r=[],a=0;a<7;a++){var s=i.getNextNDay(o.time,a),l=i.dataToRect([s.time],!1);r[2*s.day]=l.tl,r[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return r},i.prototype._formatterLabel=function(e,n){return t(e)&&e?(i=e,a(n,(function(t,e){i=i.replace("{"+e+"}",o?ot(t):t)})),i):f(e)?e(n):n.nameMap;var i,o},i.prototype._yearTextPositionControl=function(t,e,n,i,o){var r=e[0],a=e[1],s=["center","bottom"];"bottom"===i?(a+=o,s=["center","top"]):"left"===i?r-=o:"right"===i?(r+=o,s=["center","top"]):
  12065. // top
  12066. a-=o;var l=0;return"left"!==i&&"right"!==i||(l=Math.PI/2),{rotation:l,x:r,y:a,style:{align:s[0],verticalAlign:s[1]}}},
  12067. // render year
  12068. i.prototype._renderYearText=function(t,e,n,i){var o=t.getModel("yearLabel");if(o.get("show")){var r=o.get("margin"),a=o.get("position");a||(a="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,c="horizontal"===n?0:1,d={top:[l,s[c][1]],bottom:[l,s[1-c][1]],left:[s[1-c][0],u],right:[s[c][0],u]},h=e.start.y;+e.end.y>+e.start.y&&(h=h+"-"+e.end.y);var p=o.get("formatter"),f={start:e.start.y,end:e.end.y,nameMap:h},g=this._formatterLabel(p,f),y=new $({z2:30,style:Zo(o,{text:g}),silent:o.get("silent")});y.attr(this._yearTextPositionControl(y,d[a],n,a,r)),i.add(y)}},i.prototype._monthTextPositionControl=function(t,e,n,i,o){var r="left",a="top",s=t[0],l=t[1];return"horizontal"===n?(l+=o,e&&(r="center"),"start"===i&&(a="bottom")):(s+=o,e&&(a="middle"),"start"===i&&(r="right")),{x:s,y:l,align:r,verticalAlign:a}},
  12069. // render month and year text
  12070. i.prototype._renderMonthText=function(e,n,i,o){var r=e.getModel("monthLabel");if(r.get("show")){var a=r.get("nameMap"),s=r.get("margin"),l=r.get("position"),u=r.get("align"),c=[this._tlpoints,this._blpoints];a&&!t(a)||(a&&(
  12071. // case-sensitive
  12072. n=Tr(a)||n),
  12073. // PENDING
  12074. // for ZH locale, original form is `一月` but current form is `1月`
  12075. a=n.get(["time","monthAbbr"])||[]);var d="start"===l?0:1,h="horizontal"===i?0:1;s="start"===l?-s:s;for(var f="center"===u,g=r.get("silent"),y=0;y<c[d].length-1;y++){var m=c[d][y].slice(),v=this._firstDayOfMonth[y];if(f){var x=this._firstDayPoints[y];m[h]=(x[h]+c[0][y+1][h])/2}var _=r.get("formatter"),b=a[+v.m-1],S={yyyy:v.y,yy:(v.y+"").slice(2),MM:v.m,M:+v.m,nameMap:b},w=this._formatterLabel(_,S),M=new $({z2:30,style:p(Zo(r,{text:w}),this._monthTextPositionControl(m,f,i,l,s)),silent:g});o.add(M)}}},i.prototype._weekTextPositionControl=function(t,e,n,i,o){var r="center",a="middle",s=t[0],l=t[1],u="start"===n;return"horizontal"===e?(s=s+i+(u?1:-1)*o[0]/2,r=u?"right":"left"):(l=l+i+(u?1:-1)*o[1]/2,a=u?"bottom":"top"),{x:s,y:l,align:r,verticalAlign:a}},
  12076. // render weeks
  12077. i.prototype._renderWeekText=function(e,i,o,r,a){var s=e.getModel("dayLabel");if(s.get("show")){var l=e.coordinateSystem,u=s.get("position"),c=s.get("nameMap"),d=s.get("margin"),h=l.getFirstDayOfWeek();if(!c||t(c))c&&(
  12078. // case-sensitive
  12079. i=Tr(c)||i),c=i.get(["time","dayOfWeekShort"])||n(i.get(["time","dayOfWeekAbbr"]),(function(t){return t[0]}));
  12080. // Use the first letter of `dayOfWeekAbbr` if `dayOfWeekShort` doesn't exist in the locale file
  12081. var f=l.getNextNDay(o.end.time,7-o.lweek).time,g=[l.getCellWidth(),l.getCellHeight()];d=je(d,Math.min(g[1],g[0])),"start"===u&&(f=l.getNextNDay(o.start.time,-(7+o.fweek)).time,d=-d);for(var y=s.get("silent"),m=0;m<7;m++){var v,x=l.getNextNDay(f,m),_=l.dataToRect([x.time],!1).center;v=Math.abs((m+h)%7);var b=new $({z2:30,style:p(Zo(s,{text:c[v]}),this._weekTextPositionControl(_,r,u,d,g)),silent:y});a.add(b)}}},i.type="calendar",i}(Mu);const lL=sL;
  12082. // (24*60*60*1000)
  12083. var uL=864e5,cL=/** @class */function(){function t(e,n,i){this.type="calendar",this.dimensions=t.dimensions,
  12084. // Required in createListFromData
  12085. this.getDimensionsInfo=t.getDimensionsInfo,this._model=e}return t.getDimensionsInfo=function(){return[{name:"time",type:"time"},"value"]},t.prototype.getRangeInfo=function(){return this._rangeInfo},t.prototype.getModel=function(){return this._model},t.prototype.getRect=function(){return this._rect},t.prototype.getCellWidth=function(){return this._sw},t.prototype.getCellHeight=function(){return this._sh},t.prototype.getOrient=function(){return this._orient},
  12086. /**
  12087. * getFirstDayOfWeek
  12088. *
  12089. * @example
  12090. * 0 : start at Sunday
  12091. * 1 : start at Monday
  12092. *
  12093. * @return {number}
  12094. */
  12095. t.prototype.getFirstDayOfWeek=function(){return this._firstDayOfWeek},
  12096. /**
  12097. * get date info
  12098. * }
  12099. */
  12100. t.prototype.getDateInfo=function(t){var e=(t=sn(t)).getFullYear(),n=t.getMonth()+1,i=n<10?"0"+n:""+n,o=t.getDate(),r=o<10?"0"+o:""+o,a=t.getDay();return{y:e+"",m:i,d:r,day:a=Math.abs((a+7-this.getFirstDayOfWeek())%7),time:t.getTime(),formatedDate:e+"-"+i+"-"+r,date:t}},t.prototype.getNextNDay=function(t,e){return 0===(e=e||0)||(t=new Date(this.getDateInfo(t).time)).setDate(t.getDate()+e),this.getDateInfo(t)},t.prototype.update=function(t,e){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,i=["width","height"],o=this._model.getCellSize().slice(),r=this._model.getBoxLayoutParams(),s="horizontal"===this._orient?[n,7]:[7,n];a([0,1],(function(t){c(o,t)&&(r[i[t]]=o[t]*s[t])}));var l={width:e.getWidth(),height:e.getHeight()},u=this._rect=xa(r,l);function c(t,e){return null!=t[e]&&"auto"!==t[e]}
  12101. // Has been calculated out number.
  12102. a([0,1],(function(t){c(o,t)||(o[t]=u[i[t]]/s[t])})),this._sw=o[0],this._sh=o[1]},
  12103. /**
  12104. * Convert a time data(time, value) item to (x, y) point.
  12105. */
  12106. // TODO Clamp of calendar is not same with cartesian coordinate systems.
  12107. // It will return NaN if data exceeds.
  12108. t.prototype.dataToPoint=function(t,e){i(t)&&(t=t[0]),null==e&&(e=!0);var n=this.getDateInfo(t),o=this._rangeInfo,r=n.formatedDate;
  12109. // if not in range return [NaN, NaN]
  12110. if(e&&!(n.time>=o.start.time&&n.time<o.end.time+uL))return[NaN,NaN];var a=n.day,s=this._getRangeInfo([o.start.time,r]).nthWeek;return"vertical"===this._orient?[this._rect.x+a*this._sw+this._sw/2,this._rect.y+s*this._sh+this._sh/2]:[this._rect.x+s*this._sw+this._sw/2,this._rect.y+a*this._sh+this._sh/2]},
  12111. /**
  12112. * Convert a (x, y) point to time data
  12113. */
  12114. t.prototype.pointToData=function(t){var e=this.pointToDate(t);return e&&e.time},
  12115. /**
  12116. * Convert a time date item to (x, y) four point.
  12117. */
  12118. t.prototype.dataToRect=function(t,e){var n=this.dataToPoint(t,e);return{contentShape:{x:n[0]-(this._sw-this._lineWidth)/2,y:n[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:n,tl:[n[0]-this._sw/2,n[1]-this._sh/2],tr:[n[0]+this._sw/2,n[1]-this._sh/2],br:[n[0]+this._sw/2,n[1]+this._sh/2],bl:[n[0]-this._sw/2,n[1]+this._sh/2]}},
  12119. /**
  12120. * Convert a (x, y) point to time date
  12121. *
  12122. * @param {Array} point point
  12123. * @return {Object} date
  12124. */
  12125. t.prototype.pointToDate=function(t){var e=Math.floor((t[0]-this._rect.x)/this._sw)+1,n=Math.floor((t[1]-this._rect.y)/this._sh)+1,i=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(n,e-1,i):this._getDateByWeeksAndDay(e,n-1,i)},t.prototype.convertToPixel=function(t,e,n){var i=dL(e);return i===this?i.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){var i=dL(e);return i===this?i.pointToData(n):null},t.prototype.containPoint=function(t){return!1},
  12126. /**
  12127. * initRange
  12128. * Normalize to an [start, end] array
  12129. */
  12130. t.prototype._initRangeOption=function(){var t,e=this._model.get("range");if(
  12131. // Convert [1990] to 1990
  12132. i(e)&&1===e.length&&(e=e[0]),i(e))t=e;else{var n=e.toString();
  12133. // One year.
  12134. // One month
  12135. if(/^\d{4}$/.test(n)&&(t=[n+"-01-01",n+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(n)){var o=this.getDateInfo(n),r=o.date;r.setMonth(r.getMonth()+1);var a=this.getNextNDay(r,-1);t=[o.formatedDate,a.formatedDate]}
  12136. // One day
  12137. /^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(n)&&(t=[n,n])}if(!t)
  12138. // Not handling it.
  12139. return e;var s=this._getRangeInfo(t);return s.start.time>s.end.time&&t.reverse(),t},
  12140. /**
  12141. * range info
  12142. *
  12143. * @private
  12144. * @param {Array} range range ['2017-01-01', '2017-07-08']
  12145. * If range[0] > range[1], they will not be reversed.
  12146. * @return {Object} obj
  12147. */
  12148. t.prototype._getRangeInfo=function(t){var e,n=[this.getDateInfo(t[0]),this.getDateInfo(t[1])];n[0].time>n[1].time&&(e=!0,n.reverse());var i=Math.floor(n[1].time/uL)-Math.floor(n[0].time/uL)+1,o=new Date(n[0].time),r=o.getDate(),a=n[1].date.getDate();
  12149. // Consider case1 (#11677 #10430):
  12150. // Set the system timezone as "UK", set the range to `['2016-07-01', '2016-12-31']`
  12151. // Consider case2:
  12152. // Firstly set system timezone as "Time Zone: America/Toronto",
  12153. // ```
  12154. // let first = new Date(1478412000000 - 3600 * 1000 * 2.5);
  12155. // let second = new Date(1478412000000);
  12156. // let allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1;
  12157. // ```
  12158. // will get wrong result because of DST. So we should fix it.
  12159. o.setDate(r+i-1);
  12160. // The bias can not over a month, so just compare date.
  12161. var s=o.getDate();if(s!==a)for(var l=o.getTime()-n[1].time>0?1:-1;(s=o.getDate())!==a&&(o.getTime()-n[1].time)*l>0;)i-=l,o.setDate(s-l);var u=Math.floor((i+n[0].day+6)/7),c=e?1-u:u-1;return e&&n.reverse(),{range:[n[0].formatedDate,n[1].formatedDate],start:n[0],end:n[1],allDay:i,weeks:u,
  12162. // From 0.
  12163. nthWeek:c,fweek:n[0].day,lweek:n[1].day}},
  12164. /**
  12165. * get date by nthWeeks and week day in range
  12166. *
  12167. * @private
  12168. * @param {number} nthWeek the week
  12169. * @param {number} day the week day
  12170. * @param {Array} range [d1, d2]
  12171. * @return {Object}
  12172. */
  12173. t.prototype._getDateByWeeksAndDay=function(t,e,n){var i=this._getRangeInfo(n);if(t>i.weeks||0===t&&e<i.fweek||t===i.weeks&&e>i.lweek)return null;var o=7*(t-1)-i.fweek+e,r=new Date(i.start.time);return r.setDate(+i.start.d+o),this.getDateInfo(r)},t.create=function(e,n){var i=[];return e.eachComponent("calendar",(function(e){var n=new t(e);i.push(n),e.coordinateSystem=n})),e.eachSeries((function(t){"calendar"===t.get("coordinateSystem")&&(
  12174. // Inject coordinate system
  12175. t.coordinateSystem=i[t.get("calendarIndex")||0])})),i},t.dimensions=["time","value"],t}();function dL(t){var e=t.calendarModel,n=t.seriesModel;return e?e.coordinateSystem:n?n.coordinateSystem:null}const hL=cL;function pL(t,e){var n;return a(e,(function(e){null!=t[e]&&"auto"!==t[e]&&(n=!0)})),n}var fL=["transition","enterFrom","leaveTo"],gL=fL.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function yL(t,e,n){if(n&&(!t[n]&&e[n]&&(
  12176. // TODO avoid creating this empty object when there is no transition configuration.
  12177. t[n]={}),t=t[n],e=e[n]),t&&e)for(var i=n?fL:gL,o=0;o<i.length;o++){var r=i[o];null==t[r]&&null!=e[r]&&(t[r]=e[r])}}var mL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.preventAutoZ=!0,n}return Ue(e,t),e.prototype.mergeOption=function(e,n){
  12178. // Prevent default merge to elements
  12179. var i=this.option.elements;this.option.elements=null,t.prototype.mergeOption.call(this,e,n),this.option.elements=i},e.prototype.optionUpdated=function(t,e){var n=this.option,i=(e?n:t).elements,o=n.elements=e?[]:n.elements,r=[];this._flatten(i,r,null);var s=Tn(o,r,"normalMerge"),l=this._elOptionsToUpdate=[];
  12180. // Clear elOptionsToUpdate
  12181. a(s,(function(t,e){var n=t.newOption;n&&(l.push(n),function(t,e){var n=t.existing;
  12182. // Set id and type after id assigned.
  12183. // Set parent id if not specified
  12184. if(e.id=t.keyInfo.id,!e.type&&n&&(e.type=n.type),null==e.parentId){var i=e.parentOption;i?e.parentId=i.id:n&&(e.parentId=n.parentId)}
  12185. // Clear
  12186. e.parentOption=null}(t,n),function(t,e,n){
  12187. // Update existing options, for `getOption` feature.
  12188. var i=p({},n),o=t[e],r=n.$action||"merge";"merge"===r?o?(
  12189. // We can ensure that newElOptCopy and existElOption are not
  12190. // the same object, so `merge` will not change newElOptCopy.
  12191. tt(o,i,!0),
  12192. // Rigid body, use ignoreSize.
  12193. Sa(o,i,{ignoreSize:!0}),
  12194. // Will be used in render.
  12195. Ma(n,o),
  12196. // Copy transition info to new option so it can be used in the transition.
  12197. // DO IT AFTER merge
  12198. yL(n,o),yL(n,o,"shape"),yL(n,o,"style"),yL(n,o,"extra"),
  12199. // Copy clipPath
  12200. n.clipPath=o.clipPath):t[e]=i:"replace"===r?t[e]=i:"remove"===r&&
  12201. // null will be cleaned later.
  12202. o&&(t[e]=null)}(o,e,n),function(t,e){if(t&&(t.hv=e.hv=[
  12203. // Rigid body, don't care about `width`.
  12204. pL(e,["left","right"]),
  12205. // Rigid body, don't care about `height`.
  12206. pL(e,["top","bottom"])],"group"===t.type)){var n=t,i=e;null==n.width&&(n.width=i.width=0),null==n.height&&(n.height=i.height=0)}}(o[e],n))}),this),
  12207. // Clean
  12208. n.elements=st(o,(function(t){
  12209. // $action should be volatile, otherwise option gotten from
  12210. // `getOption` will contain unexpected $action.
  12211. return t&&delete t.$action,null!=t}))},
  12212. /**
  12213. * Convert
  12214. * [{
  12215. * type: 'group',
  12216. * id: 'xx',
  12217. * children: [{type: 'circle'}, {type: 'polygon'}]
  12218. * }]
  12219. * to
  12220. * [
  12221. * {type: 'group', id: 'xx'},
  12222. * {type: 'circle', parentId: 'xx'},
  12223. * {type: 'polygon', parentId: 'xx'}
  12224. * ]
  12225. */
  12226. e.prototype._flatten=function(t,e,n){a(t,(function(t){if(t){n&&(t.parentOption=n),e.push(t);var i=t.children;
  12227. // here we don't judge if option.type is `group`
  12228. // when new option doesn't provide `type`, it will cause that the children can't be updated.
  12229. i&&i.length&&this._flatten(i,e,t),
  12230. // Deleting for JSON output, and for not affecting group creation.
  12231. delete t.children}}),this)},
  12232. // FIXME
  12233. // Pass to view using payload? setOption has a payload?
  12234. e.prototype.useElOptionsToUpdate=function(){var t=this._elOptionsToUpdate;
  12235. // Clear to avoid render duplicately when zooming.
  12236. return this._elOptionsToUpdate=null,t},e.type="graphic",e.defaultOption={elements:[]},e}(Ta),vL={
  12237. // Reserved but not supported in graphic component.
  12238. path:null,compoundPath:null,
  12239. // Supported in graphic component.
  12240. group:Z,image:b,text:$},xL=On(),_L=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(){this._elMap=r()},e.prototype.render=function(t,e,n){
  12241. // Having leveraged between use cases and algorithm complexity, a very
  12242. // simple layout mechanism is used:
  12243. // The size(width/height) can be determined by itself or its parent (not
  12244. // implemented yet), but can not by its children. (Top-down travel)
  12245. // The location(x/y) can be determined by the bounding rect of itself
  12246. // (can including its descendants or not) and the size of its parent.
  12247. // (Bottom-up travel)
  12248. // When `chart.clear()` or `chart.setOption({...}, true)` with the same id,
  12249. // view will be reused.
  12250. t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t),this._relocate(t,n)},
  12251. /**
  12252. * Update graphic elements.
  12253. */
  12254. e.prototype._updateElements=function(t){var e=t.useElOptionsToUpdate();if(e){var n=this._elMap,i=this.group,o=t.get("z"),r=t.get("zlevel");
  12255. // Top-down tranverse to assign graphic settings to each elements.
  12256. a(e,(function(e){var s=Ln(e.id,null),l=null!=s?n.get(s):null,u=Ln(e.parentId,null),c=null!=u?n.get(u):i,d=e.type,h=e.style;"text"===d&&h&&e.hv&&e.hv[1]&&(h.textVerticalAlign=h.textBaseline=h.verticalAlign=h.align=null);var f=e.textContent,g=e.textConfig;if(h&&hT(h,d,!!g,!!f)){var y=pT(h,d,!0);!g&&y.textConfig&&(g=e.textConfig=y.textConfig),!f&&y.textContent&&(f=y.textContent)}
  12257. // Remove unnecessary props to avoid potential problems.
  12258. var m=
  12259. // Remove unnecessary props to avoid potential problems.
  12260. function(t){return t=p({},t),a(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(ga),(function(e){delete t[e]})),t}(e),v=e.$action||"merge",x="merge"===v,_="replace"===v;if(x){var b=l;(C=!l)?b=SL(s,c,e.type,n):(b&&(xL(b).isNew=!1),
  12261. // Stop and restore before update any other attributes.
  12262. OT(b)),b&&(ST(b,m,t,{isInit:C}),ML(b,e,o,r))}else if(_){wL(l,e,n,t);var S=SL(s,c,e.type,n);S&&(ST(S,m,t,{isInit:!0}),ML(S,e,o,r))}else"remove"===v&&(wT(l,e),wL(l,e,n,t));var w=n.get(s);if(w&&f)if(x){var M=w.getTextContent();M?M.attr(f):w.setTextContent(new $(f))}else _&&w.setTextContent(new $(f));if(w){var I=e.clipPath;if(I){var D=I.type,T=void 0,C=!1;if(x){var A=w.getClipPath();T=(C=!A||xL(A).type!==D)?bL(D):A}else _&&(C=!0,T=bL(D));w.setClipPath(T),ST(T,I,t,{isInit:C}),RT(T,I.keyframeAnimation,t)}var L=xL(w);w.setTextConfig(g),L.option=e,function(t,e,n){var i=ni(t).eventData;
  12263. // Simple optimize for large amount of elements that no need event.
  12264. t.silent||t.ignore||i||(i=ni(t).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:t.name});
  12265. // `elOption.info` enables user to mount some info on
  12266. // elements and use them in event handlers.
  12267. i&&(i.info=n.info)}(w,t,e),Vo({el:w,componentModel:t,itemName:w.name,itemTooltipOption:e.tooltip}),RT(w,e.keyframeAnimation,t)}}))}},
  12268. /**
  12269. * Locate graphic elements.
  12270. */
  12271. e.prototype._relocate=function(t,e){
  12272. // Top-down to calculate percentage width/height of group
  12273. for(var n=t.option.elements,i=this.group,o=this._elMap,r=e.getWidth(),a=e.getHeight(),s=["x","y"],l=0;l<n.length;l++){if((g=null!=(f=Ln((p=n[l]).id,null))?o.get(f):null)&&g.isGroup){var u=(y=g.parent)===i,d=xL(g),h=xL(y);d.width=je(d.option.width,u?r:h.width)||0,d.height=je(d.option.height,u?a:h.height)||0}}
  12274. // Bottom-up tranvese all elements (consider ec resize) to locate elements.
  12275. for(l=n.length-1;l>=0;l--){var p,f,g;if(g=null!=(f=Ln((p=n[l]).id,null))?o.get(f):null){var y=g.parent,m=(h=xL(y),{}),v=_a(g,p,y===i?{width:r,height:a}:{width:h.width,height:h.height},null,{hv:p.hv,boundingMode:p.bounding},m);if(!xL(g).isNew&&v){for(var x=p.transition,_={},b=0;b<s.length;b++){var S=s[b],w=m[S];x&&(IT(x)||c(x,S)>=0)?_[S]=w:g[S]=w}io(g,_,t,0)}else g.attr(m)}}},
  12276. /**
  12277. * Clear all elements.
  12278. */
  12279. e.prototype._clear=function(){var t=this,e=this._elMap;e.each((function(n){wL(n,xL(n).option,e,t._lastGraphicModel)})),this._elMap=r()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(Mu);function bL(t){var e=new(N(vL,t)?vL[t]:vo(t))({});return xL(e).type=t,e}function SL(t,e,n,i){var o=bL(n);return e.add(o),i.set(t,o),xL(o).id=t,xL(o).isNew=!0,o}function wL(t,e,n,i){t&&t.parent&&("group"===t.type&&t.traverse((function(t){wL(t,e,n,i)})),MT(t,e,i),n.removeKey(xL(t).id))}function ML(t,e,n,i){t.isGroup||a([["cursor",$t.prototype.cursor],
  12280. // We should not support configure z and zlevel in the element level.
  12281. // But seems we didn't limit it previously. So here still use it to avoid breaking.
  12282. ["zlevel",i||0],["z",n||0],
  12283. // z2 must not be null/undefined, otherwise sort error may occur.
  12284. ["z2",0]],(function(n){var i=n[0];N(e,i)?t[i]=x(e[i],n[1]):null==t[i]&&(t[i]=n[1])})),a(v(e),(function(n){
  12285. // Assign event handlers.
  12286. // PENDING: should enumerate all event names or use pattern matching?
  12287. if(0===n.indexOf("on")){var i=e[n];t[n]=f(i)?i:null}})),N(e,"draggable")&&(t.draggable=e.draggable),
  12288. // Other attributes
  12289. null!=e.name&&(t.name=e.name),null!=e.id&&(t.id=e.id)}var IL=["x","y","radius","angle","single"],DL=["cartesian2d","polar","singleAxis"];
  12290. // Supported coords.
  12291. // FIXME: polar has been broken (but rarely used).
  12292. function TL(t){return t+"Axis"}
  12293. /**
  12294. * If two dataZoomModels has the same axis controlled, we say that they are 'linked'.
  12295. * This function finds all linked dataZoomModels start from the given payload.
  12296. */function CL(t,e){
  12297. // Key: `DataZoomAxisDimension`
  12298. var n,i=r(),o=[],a=r();
  12299. // Find the dataZooms specified by payload.
  12300. t.eachComponent({mainType:"dataZoom",query:e},(function(t){a.get(t.uid)||l(t)}));do{n=!1,t.eachComponent("dataZoom",s)}while(n);function s(t){!a.get(t.uid)&&function(t){var e=!1;return t.eachTargetAxis((function(t,n){var o=i.get(t);o&&o[n]&&(e=!0)})),e}(t)&&(l(t),n=!0)}function l(t){a.set(t.uid,!0),o.push(t),t.eachTargetAxis((function(t,e){(i.get(t)||i.set(t,[]))[e]=!0}))}return o}
  12301. /**
  12302. * Find the first target coordinate system.
  12303. * Available after model built.
  12304. *
  12305. * @return Like {
  12306. * grid: [
  12307. * {model: coord0, axisModels: [axis1, axis3], coordIndex: 1},
  12308. * {model: coord1, axisModels: [axis0, axis2], coordIndex: 0},
  12309. * ...
  12310. * ], // cartesians must not be null/undefined.
  12311. * polar: [
  12312. * {model: coord0, axisModels: [axis4], coordIndex: 0},
  12313. * ...
  12314. * ], // polars must not be null/undefined.
  12315. * singleAxis: [
  12316. * {model: coord0, axisModels: [], coordIndex: 0}
  12317. * ]
  12318. * }
  12319. */function AL(t){var e=t.ecModel,n={infoList:[],infoMap:r()};return t.eachTargetAxis((function(t,i){var o=e.getComponent(TL(t),i);if(o){var r=o.getCoordSysModel();if(r){var a=r.uid,s=n.infoMap.get(a);s||(s={model:r,axisModels:[]},n.infoList.push(s),n.infoMap.set(a,s)),s.axisModels.push(o)}}})),n}var LL=/** @class */function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){
  12320. // Remove duplication.
  12321. this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}(),kL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._autoThrottle=!0,n._noTarget=!0,
  12322. /**
  12323. * It is `[rangeModeForMin, rangeModeForMax]`.
  12324. * The optional values for `rangeMode`:
  12325. * + `'value'` mode: the axis extent will always be determined by
  12326. * `dataZoom.startValue` and `dataZoom.endValue`, despite
  12327. * how data like and how `axis.min` and `axis.max` are.
  12328. * + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`,
  12329. * where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`,
  12330. * and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`.
  12331. * Axis extent will be determined by the result of the percent of `[dMin, dMax]`.
  12332. *
  12333. * For example, when users are using dynamic data (update data periodically via `setOption`),
  12334. * if in `'value`' mode, the window will be kept in a fixed value range despite how
  12335. * data are appended, while if in `'percent'` mode, whe window range will be changed alone with
  12336. * the appended data (suppose `axis.min` and `axis.max` are not specified).
  12337. */
  12338. n._rangePropMode=["percent","percent"],n}return Ue(e,t),e.prototype.init=function(t,e,n){var i=PL(t);
  12339. /**
  12340. * Suppose a "main process" start at the point that model prepared (that is,
  12341. * model initialized or merged or method called in `action`).
  12342. * We should keep the `main process` idempotent, that is, given a set of values
  12343. * on `option`, we get the same result.
  12344. *
  12345. * But sometimes, values on `option` will be updated for providing users
  12346. * a "final calculated value" (`dataZoomProcessor` will do that). Those value
  12347. * should not be the base/input of the `main process`.
  12348. *
  12349. * So in that case we should save and keep the input of the `main process`
  12350. * separately, called `settledOption`.
  12351. *
  12352. * For example, consider the case:
  12353. * (Step_1) brush zoom the grid by `toolbox.dataZoom`,
  12354. * where the original input `option.startValue`, `option.endValue` are earsed by
  12355. * calculated value.
  12356. * (Step)2) click the legend to hide and show a series,
  12357. * where the new range is calculated by the earsed `startValue` and `endValue`,
  12358. * which brings incorrect result.
  12359. */this.settledOption=i,this.mergeDefaultAndTheme(t,n),this._doInit(i)},e.prototype.mergeOption=function(t){var e=PL(t);
  12360. // FIX #2591
  12361. tt(this.option,t,!0),tt(this.settledOption,e,!0),this._doInit(e)},e.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;a([["start","startValue"],["end","endValue"]],(function(t,i){
  12362. // start/end has higher priority over startValue/endValue if they
  12363. // both set, but we should make chart.setOption({endValue: 1000})
  12364. // effective, rather than chart.setOption({endValue: 1000, end: null}).
  12365. "value"===this._rangePropMode[i]&&(e[t[0]]=n[t[0]]=null);
  12366. // Otherwise do nothing and use the merge result.
  12367. }),this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=r();this._fillSpecifiedTargetAxis(e)?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each((function(t){t.indexList.length&&(this._noTarget=!1)}),this)},e.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return a(IL,(function(n){var i=this.getReferringComponents(TL(n),Bn);
  12368. // When user set axisIndex as a empty array, we think that user specify axisIndex
  12369. // but do not want use auto mode. Because empty array may be encountered when
  12370. // some error occurred.
  12371. if(i.specified){e=!0;var o=new LL;a(i.models,(function(t){o.add(t.componentIndex)})),t.set(n,o)}}),this),e},e.prototype._fillAutoTargetAxisByOrient=function(t,e){var n=this.ecModel,i=!0;
  12372. // Find axis that parallel to dataZoom as default.
  12373. if(i){var o="vertical"===e?"y":"x";r(n.findComponents({mainType:o+"Axis"}),o)}
  12374. // Find axis that parallel to dataZoom as default.
  12375. i&&r(n.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}}),"single");function r(e,n){
  12376. // At least use the first parallel axis as the target axis.
  12377. var o=e[0];if(o){var r=new LL;
  12378. // Find parallel axes in the same grid.
  12379. if(r.add(o.componentIndex),t.set(n,r),i=!1,"x"===n||"y"===n){var s=o.getReferringComponents("grid",zn).models[0];s&&a(e,(function(t){o.componentIndex!==t.componentIndex&&s===t.getReferringComponents("grid",zn).models[0]&&r.add(t.componentIndex)}))}}}i&&
  12380. // If no parallel axis, find the first category axis as default. (Also consider polar).
  12381. a(IL,(function(e){if(i){var o=n.findComponents({mainType:TL(e),filter:function(t){return"category"===t.get("type",!0)}});if(o[0]){var r=new LL;r.add(o[0].componentIndex),t.set(e,r),i=!1}}}),this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;
  12382. // Find the first axis
  12383. return this.eachTargetAxis((function(e){!t&&(t=e)}),this),"y"===t?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(
  12384. // When first time user set throttle, auto throttle ends.
  12385. t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");a([["start","startValue"],["end","endValue"]],(function(i,o){var r=null!=t[i[0]],a=null!=t[i[1]];r&&!a?e[o]="percent":!r&&a?e[o]="value":n?e[o]=n[o]:r&&(
  12386. // percentSpecified && valueSpecified
  12387. e[o]="percent");
  12388. // else remain its original setting.
  12389. }))},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis((function(e,n){null==t&&(t=this.ecModel.getComponent(TL(e),n))}),this),t},
  12390. /**
  12391. * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel
  12392. */
  12393. e.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each((function(n,i){a(n.indexList,(function(n){t.call(e,i,n)}))}))},
  12394. /**
  12395. * @return If not found, return null/undefined.
  12396. */
  12397. e.prototype.getAxisProxy=function(t,e){var n=this.getAxisModel(t,e);if(n)return n.__dzAxisProxy},
  12398. /**
  12399. * @return If not found, return null/undefined.
  12400. */
  12401. e.prototype.getAxisModel=function(t,e){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[e])return this.ecModel.getComponent(TL(t),e)},
  12402. /**
  12403. * If not specified, set to undefined.
  12404. */
  12405. e.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;a([["start","startValue"],["end","endValue"]],(function(i){
  12406. // Consider the pair <start, startValue>:
  12407. // If one has value and the other one is `null/undefined`, we both set them
  12408. // to `settledOption`. This strategy enables the feature to clear the original
  12409. // value in `settledOption` to `null/undefined`.
  12410. // But if both of them are `null/undefined`, we do not set them to `settledOption`
  12411. // and keep `settledOption` with the original value. This strategy enables users to
  12412. // only set <end or endValue> but not set <start or startValue> when calling
  12413. // `dispatchAction`.
  12414. // The pair <end, endValue> is treated in the same way.
  12415. null==t[i[0]]&&null==t[i[1]]||(e[i[0]]=n[i[0]]=t[i[0]],e[i[1]]=n[i[1]]=t[i[1]])}),this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var e=this.option;a(["start","startValue","end","endValue"],(function(n){e[n]=t[n]}))},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},
  12416. /**
  12417. * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0);
  12418. *
  12419. * @return [startValue, endValue] value can only be '-' or finite number.
  12420. */
  12421. e.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},
  12422. /**
  12423. * @param axisModel If axisModel given, find axisProxy
  12424. * corresponding to the axisModel
  12425. */
  12426. e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;
  12427. // Find the first hosted axisProxy
  12428. for(var e,n=this._targetAxisInfoMap.keys(),i=0;i<n.length;i++)for(var o=n[i],r=this._targetAxisInfoMap.get(o),a=0;a<r.indexList.length;a++){var s=this.getAxisProxy(o,r.indexList[a]);if(s.hostedBy(this))return s;e||(e=s)}
  12429. // If no hosted proxy found, still need to return a proxy.
  12430. // This case always happens in toolbox dataZoom, where axes are all hosted by
  12431. // other dataZooms.
  12432. return e},e.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},e.prototype.getOrient=function(){return this._orient},e.type="dataZoom",e.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],e.defaultOption={
  12433. // zlevel: 0,
  12434. z:4,filterMode:"filter",start:0,end:100},e}(Ta);
  12435. /**
  12436. * Retrieve those raw params from option, which will be cached separately,
  12437. * because they will be overwritten by normalized/calculated values in the main
  12438. * process.
  12439. */
  12440. function PL(t){var e={};return a(["start","end","startValue","endValue","throttle"],(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})),e}const NL=kL;const OL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="dataZoom.select",e}(NL);const RL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n,i){this.dataZoomModel=t,this.ecModel=e,this.api=n},e.type="dataZoom",e}(Mu);const EL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="dataZoom.select",e}(RL);var VL=a,zL=Ke,BL=/** @class */function(){function t(t,e,n,i){this._dimName=t,this._axisIndex=e,this.ecModel=i,this._dataZoomModel=n}
  12441. /**
  12442. * Whether the axisProxy is hosted by dataZoomModel.
  12443. */return t.prototype.hostedBy=function(t){return this._dataZoomModel===t},
  12444. /**
  12445. * @return Value can only be NaN or finite value.
  12446. */
  12447. t.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},
  12448. /**
  12449. * @return {Array.<number>}
  12450. */
  12451. t.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},t.prototype.getTargetSeriesModels=function(){var t=[];return this.ecModel.eachSeries((function(e){if(function(t){var e=t.get("coordinateSystem");return c(DL,e)>=0}(e)){var n=TL(this._dimName),i=e.getReferringComponents(n,zn).models[0];i&&this._axisIndex===i.componentIndex&&t.push(e)}}),this),t},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return et(this._minMaxSpan)},
  12452. /**
  12453. * Only calculate by given range and this._dataExtent, do not change anything.
  12454. */
  12455. t.prototype.calculateDataWindow=function(t){var e,n=this._dataExtent,i=this.getAxisModel().axis.scale,o=this._dataZoomModel.getRangePropMode(),r=[0,100],a=[],s=[];VL(["start","end"],(function(l,u){var c=t[l],d=t[l+"Value"];
  12456. // Notice: dataZoom is based either on `percentProp` ('start', 'end') or
  12457. // on `valueProp` ('startValue', 'endValue'). (They are based on the data extent
  12458. // but not min/max of axis, which will be calculated by data window then).
  12459. // The former one is suitable for cases that a dataZoom component controls multiple
  12460. // axes with different unit or extent, and the latter one is suitable for accurate
  12461. // zoom by pixel (e.g., in dataZoomSelect).
  12462. // we use `getRangePropMode()` to mark which prop is used. `rangePropMode` is updated
  12463. // only when setOption or dispatchAction, otherwise it remains its original value.
  12464. // (Why not only record `percentProp` and always map to `valueProp`? Because
  12465. // the map `valueProp` -> `percentProp` -> `valueProp` probably not the original
  12466. // `valueProp`. consider two axes constrolled by one dataZoom. They have different
  12467. // data extent. All of values that are overflow the `dataExtent` will be calculated
  12468. // to percent '100%').
  12469. "percent"===o[u]?(null==c&&(c=r[u]),
  12470. // Use scale.parse to math round for category or time axis.
  12471. d=i.parse(Xe(c,r,n))):(e=!0,
  12472. // Calculating `percent` from `value` may be not accurate, because
  12473. // This calculation can not be inversed, because all of values that
  12474. // are overflow the `dataExtent` will be calculated to percent '100%'
  12475. c=Xe(d=null==d?n[u]:i.parse(d),n,r)),
  12476. // valueWindow[idx] = round(boundValue);
  12477. // percentWindow[idx] = round(boundPercent);
  12478. // fallback to extent start/end when parsed value or percent is invalid
  12479. s[u]=null==d||isNaN(d)?n[u]:d,a[u]=null==c||isNaN(c)?r[u]:c})),zL(s),zL(a);
  12480. // The windows from user calling of `dispatchAction` might be out of the extent,
  12481. // or do not obey the `min/maxSpan`, `min/maxValueSpan`. But we don't restrict window
  12482. // by `zoomLock` here, because we see `zoomLock` just as a interaction constraint,
  12483. // where API is able to initialize/modify the window size even though `zoomLock`
  12484. // specified.
  12485. var l=this._minMaxSpan;function u(t,e,n,o,r){var a=r?"Span":"ValueSpan";Sw(0,t,n,"all",l["min"+a],l["max"+a]);for(var s=0;s<2;s++)e[s]=Xe(t[s],n,o,!0),r&&(e[s]=i.parse(e[s]))}return e?u(s,a,n,r,!1):u(a,s,r,n,!0),{valueWindow:s,percentWindow:a}},
  12486. /**
  12487. * Notice: reset should not be called before series.restoreData() is called,
  12488. * so it is recommended to be called in "process stage" but not "model init
  12489. * stage".
  12490. */
  12491. t.prototype.reset=function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();
  12492. // Culculate data window and data extent, and record them.
  12493. this._dataExtent=function(t,e,n){var i=[Infinity,-Infinity];VL(n,(function(t){!function(t,e,n){e&&a(cf(e,n),(function(n){var i=e.getApproximateExtent(n);i[0]<t[0]&&(t[0]=i[0]),i[1]>t[1]&&(t[1]=i[1])}))}(i,t.getData(),e)}));
  12494. // It is important to get "consistent" extent when more then one axes is
  12495. // controlled by a `dataZoom`, otherwise those axes will not be synchronized
  12496. // when zooming. But it is difficult to know what is "consistent", considering
  12497. // axes have different type or even different meanings (For example, two
  12498. // time axes are used to compare data of the same date in different years).
  12499. // So basically dataZoom just obtains extent by series.data (in category axis
  12500. // extent can be obtained from axis.data).
  12501. // Nevertheless, user can set min/max/scale on axes to make extent of axes
  12502. // consistent.
  12503. var o=t.getAxisModel(),r=Qp(o.axis.scale,o,i).calculate();return[r.min,r.max]}(this,this._dimName,e),
  12504. // `calculateDataWindow` uses min/maxSpan.
  12505. this._updateMinMaxSpan();var n=this.calculateDataWindow(t.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,
  12506. // Update axis setting then.
  12507. this._setAxisModel()}},t.prototype.filterData=function(t,e){if(t===this._dataZoomModel){var i=this._dimName,o=this.getTargetSeriesModels(),r=t.get("filterMode"),a=this._valueWindow;"none"!==r&&
  12508. // FIXME
  12509. // Toolbox may has dataZoom injected. And if there are stacked bar chart
  12510. // with NaN data, NaN will be filtered and stack will be wrong.
  12511. // So we need to force the mode to be set empty.
  12512. // In fect, it is not a big deal that do not support filterMode-'filter'
  12513. // when using toolbox#dataZoom, utill tooltip#dataZoom support "single axis
  12514. // selection" some day, which might need "adapt to data extent on the
  12515. // otherAxis", which is disabled by filterMode-'empty'.
  12516. // But currently, stack has been fixed to based on value but not index,
  12517. // so this is not an issue any more.
  12518. // let otherAxisModel = this.getOtherAxisModel();
  12519. // if (dataZoomModel.get('$fromToolbox')
  12520. // && otherAxisModel
  12521. // && otherAxisModel.hasSeriesStacked
  12522. // ) {
  12523. // filterMode = 'empty';
  12524. // }
  12525. // TODO
  12526. // filterMode 'weakFilter' and 'empty' is not optimized for huge data yet.
  12527. VL(o,(function(t){var e=t.getData(),o=e.mapDimensionsAll(i);if(o.length){if("weakFilter"===r){var s=e.getStore(),l=n(o,(function(t){return e.getDimensionIndex(t)}),e);e.filterSelf((function(t){for(var e,n,i,r=0;r<o.length;r++){var u=s.get(l[r],t),c=!isNaN(u),d=u<a[0],h=u>a[1];if(c&&!d&&!h)return!0;c&&(i=!0),d&&(e=!0),h&&(n=!0)}
  12528. // If both left out and right out, do not filter.
  12529. return i&&e&&n}))}else VL(o,(function(n){if("empty"===r)t.setData(e=e.map(n,(function(t){return function(t){return t>=a[0]&&t<=a[1]}(t)?t:NaN})));else{var i={};i[n]=a,
  12530. // console.time('select');
  12531. e.selectRange(i)}}));VL(o,(function(t){e.setApproximateExtent(a,t)}))}}))}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._dataExtent;VL(["min","max"],(function(i){var o=e.get(i+"Span"),r=e.get(i+"ValueSpan");null!=r&&(r=this.getAxisModel().axis.scale.parse(r)),
  12532. // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan
  12533. null!=r?o=Xe(n[0]+r,n,[0,100],!0):null!=o&&(r=Xe(o,[0,100],n,!0)-n[0]),t[i+"Span"]=o,t[i+"ValueSpan"]=r}),this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,n=this._valueWindow;if(e){
  12534. // [0, 500]: arbitrary value, guess axis extent.
  12535. var i=Qe(n,[0,500]);i=Math.min(i,20);
  12536. // For value axis, if min/max/scale are not set, we just use the extent obtained
  12537. // by series data, which may be a little different from the extent calculated by
  12538. // `axisHelper.getScaleExtent`. But the different just affects the experience a
  12539. // little when zooming. So it will not be fixed until some users require it strongly.
  12540. var o=t.axis.scale.rawExtentInfo;0!==e[0]&&o.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==e[1]&&o.setDeterminedMinMax("max",+n[1].toFixed(i)),o.freeze()}},t}();const GL=BL;const FL={
  12541. // `dataZoomProcessor` will only be performed in needed series. Consider if
  12542. // there is a line series and a pie series, it is better not to update the
  12543. // line series if only pie series is needed to be updated.
  12544. getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(i,o){var r=t.getComponent(TL(i),o);e(i,o,r,n)}))}))}
  12545. // FIXME: it brings side-effect to `getTargetSeries`.
  12546. // Prepare axis proxies.
  12547. e((function(t,e,n,i){
  12548. // dispose all last axis proxy, in case that some axis are deleted.
  12549. n.__dzAxisProxy=null}));var n=[];e((function(e,i,o,r){
  12550. // Different dataZooms may constrol the same axis. In that case,
  12551. // an axisProxy serves both of them.
  12552. o.__dzAxisProxy||(
  12553. // Use the first dataZoomModel as the main model of axisProxy.
  12554. o.__dzAxisProxy=new GL(e,i,r,t),n.push(o.__dzAxisProxy))}));var i=r();return a(n,(function(t){a(t.getTargetSeriesModels(),(function(t){i.set(t.uid,t)}))})),i},
  12555. // Consider appendData, where filter should be performed. Because data process is
  12556. // in block mode currently, it is not need to worry about that the overallProgress
  12557. // execute every frame.
  12558. overallReset:function(t,e){t.eachComponent("dataZoom",(function(t){
  12559. // We calculate window and reset axis here but not in model
  12560. // init stage and not after action dispatch handler, because
  12561. // reset should be called after seriesData.restoreData.
  12562. t.eachTargetAxis((function(e,n){t.getAxisProxy(e,n).reset(t)})),
  12563. // Caution: data zoom filtering is order sensitive when using
  12564. // percent range and no min/max/scale set on axis.
  12565. // For example, we have dataZoom definition:
  12566. // [
  12567. // {xAxisIndex: 0, start: 30, end: 70},
  12568. // {yAxisIndex: 0, start: 20, end: 80}
  12569. // ]
  12570. // In this case, [20, 80] of y-dataZoom should be based on data
  12571. // that have filtered by x-dataZoom using range of [30, 70],
  12572. // but should not be based on full raw data. Thus sliding
  12573. // x-dataZoom will change both ranges of xAxis and yAxis,
  12574. // while sliding y-dataZoom will only change the range of yAxis.
  12575. // So we should filter x-axis after reset x-axis immediately,
  12576. // and then reset y-axis and filter y-axis.
  12577. t.eachTargetAxis((function(n,i){t.getAxisProxy(n,i).filterData(t,e)}))})),t.eachComponent("dataZoom",(function(t){
  12578. // Fullfill all of the range props so that user
  12579. // is able to get them from chart.getOption().
  12580. var e=t.findRepresentativeAxisProxy();if(e){var n=e.getDataPercentWindow(),i=e.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}}))}};var WL=!1;function HL(t){WL||(WL=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,FL),function(t){t.registerAction("dataZoom",(function(t,e){var n=CL(e,t);a(n,(function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})}))}))}(t),t.registerSubTypeDefaulter("dataZoom",(function(){
  12581. // Default 'slider' when no type specified.
  12582. return"slider"})))}function YL(t){t.registerComponentModel(OL),t.registerComponentView(EL),HL(t)}
  12583. /*
  12584. * Licensed to the Apache Software Foundation (ASF) under one
  12585. * or more contributor license agreements. See the NOTICE file
  12586. * distributed with this work for additional information
  12587. * regarding copyright ownership. The ASF licenses this file
  12588. * to you under the Apache License, Version 2.0 (the
  12589. * "License"); you may not use this file except in compliance
  12590. * with the License. You may obtain a copy of the License at
  12591. *
  12592. * http://www.apache.org/licenses/LICENSE-2.0
  12593. *
  12594. * Unless required by applicable law or agreed to in writing,
  12595. * software distributed under the License is distributed on an
  12596. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  12597. * KIND, either express or implied. See the License for the
  12598. * specific language governing permissions and limitations
  12599. * under the License.
  12600. */
  12601. /**
  12602. * AUTO-GENERATED FILE. DO NOT MODIFY.
  12603. */var UL=function(){},ZL={};function XL(t,e){ZL[t]=e}function jL(t){return ZL[t]}const qL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;a(this.option.feature,(function(t,n){var i=jL(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(e)),tt(t,i.defaultOption))}))},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,
  12604. // zlevel: 0,
  12605. orient:"horizontal",left:"right",top:"top",
  12606. // right
  12607. // bottom
  12608. backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},
  12609. // textStyle: {},
  12610. // feature
  12611. tooltip:{show:!1,position:"bottom"}},e}(Ta);
  12612. /**
  12613. * Layout list like component.
  12614. * It will box layout each items in group of component and then position the whole group in the viewport
  12615. * @param {module:zrender/group/Group} group
  12616. * @param {module:echarts/model/Component} componentModel
  12617. * @param {module:echarts/ExtensionAPI}
  12618. */function KL(t,e){var n=aa(e.get("padding")),i=e.getItemStyle(["color","opacity"]);
  12619. // FIXME
  12620. // `subPixelOptimizeRect` may bring some gap between edge of viewpart
  12621. // and background rect when setting like `left: 0`, `top: 0`.
  12622. // graphic.subPixelOptimizeRect(rect);
  12623. return i.fill=e.get("backgroundColor"),t=new G({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1})}var JL=/** @class */function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Ue(n,e),n.prototype.render=function(e,n,i,o){var r=this.group;if(r.removeAll(),e.get("show")){var s=+e.get("itemSize"),l="vertical"===e.get("orient"),u=e.get("feature")||{},c=this._features||(this._features={}),d=[];a(u,(function(t,e){d.push(e)})),new yh(this._featureNames||[],d).add(h).update(h).remove(rt(h,null)).execute(),
  12624. // Keep for diff.
  12625. this._featureNames=d,function(t,e,n){var i=e.getBoxLayoutParams(),o=e.get("padding"),r={width:n.getWidth(),height:n.getHeight()},a=xa(i,r,o);va(e.get("orient"),t,e.get("itemGap"),a.width,a.height),_a(t,i,r,o)}(r,e,i),
  12626. // Render background after group is layout
  12627. // FIXME
  12628. r.add(KL(r.getBoundingRect(),e)),
  12629. // Adjust icon title positions to avoid them out of screen
  12630. l||r.eachChild((function(t){var e=t.__title,n=t.ensureState("emphasis"),o=n.textConfig||(n.textConfig={}),a=t.getTextContent(),l=a&&a.ensureState("emphasis");
  12631. // const hoverStyle = icon.hoverStyle;
  12632. // TODO simplify code?
  12633. // May be background element
  12634. if(l&&!f(l)&&e){var u=l.style||(l.style={}),c=Lt(e,$.makeFont(u)),d=t.x+r.x,h=!1;t.y+r.y+s+c.height>i.getHeight()&&(o.position="top",h=!0);var p=h?-5-c.height:s+10;d+c.width/2>i.getWidth()?(o.position=["100%",p],u.align="right"):d-c.width/2<0&&(o.position=[0,p],u.align="left")}}))}function h(h,p){var f,g=d[h],y=d[p],m=u[g],v=new yr(m,e,e.ecModel);if(
  12635. // FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ?
  12636. o&&null!=o.newTitle&&o.featureName===g&&(m.title=o.newTitle),g&&!y){
  12637. // Create
  12638. if(function(t){return 0===t.indexOf("my")}(g))f={onclick:v.option.onclick,featureName:g};else{var x=jL(g);if(!x)return;f=new x}c[g]=f}else
  12639. // If feature does not exist.
  12640. if(!(f=c[y]))return;f.uid=vr("toolbox-feature"),f.model=v,f.ecModel=n,f.api=i;var _=f instanceof UL;g||!y?!v.get("show")||_&&f.unusable?_&&f.remove&&f.remove(n,i):(!function(o,u,c){var d,h,p=o.getModel("iconStyle"),f=o.getModel(["emphasis","iconStyle"]),g=u instanceof UL&&u.getIcons?u.getIcons():o.get("icon"),y=o.get("title")||{};t(g)?(d={})[c]=g:d=g;t(y)?(h={})[c]=y:h=y;var m=o.iconPaths={};a(d,(function(t,a){var c=No(t,{},{x:-s/2,y:-s/2,width:s,height:s});// TODO handling image
  12641. c.setStyle(p.getItemStyle()),c.ensureState("emphasis").style=f.getItemStyle();
  12642. // Text position calculation
  12643. // TODO: extract `textStyle` from `iconStyle` and use `createTextStyle`
  12644. var d=new $({style:{text:h[a],align:f.get("textAlign"),borderRadius:f.get("textBorderRadius"),padding:f.get("textPadding"),fill:null,font:$o({fontStyle:f.get("textFontStyle"),fontFamily:f.get("textFontFamily"),fontSize:f.get("textFontSize"),fontWeight:f.get("textFontWeight")},n)},ignore:!0});c.setTextContent(d),Vo({el:c,componentModel:e,itemName:a,formatterParamsExtra:{title:h[a]}}),c.__title=h[a],c.on("mouseover",(function(){
  12645. // Should not reuse above hoverStyle, which might be modified.
  12646. var t=f.getItemStyle(),n=l?null==e.get("right")&&"right"!==e.get("left")?"right":"left":null==e.get("bottom")&&"bottom"!==e.get("top")?"bottom":"top";d.setStyle({fill:f.get("textFill")||t.fill||t.stroke||"#000",backgroundColor:f.get("textBackgroundColor")}),c.setTextConfig({position:f.get("textPosition")||n}),d.ignore=!e.get("showTitle"),
  12647. // Use enterEmphasis and leaveEmphasis provide by ec.
  12648. // There are flags managed by the echarts.
  12649. i.enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==o.get(["iconStatus",a])&&i.leaveEmphasis(this),d.hide()})),("emphasis"===o.get(["iconStatus",a])?ki:Pi)(c),r.add(c),c.on("click",lt(u.onclick,u,n,i,a)),m[a]=c}))}(v,f,g),v.setIconStatus=function(t,e){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,i[t]&&("emphasis"===e?ki:Pi)(i[t])},f instanceof UL&&f.render&&f.render(v,n,i,o)):_&&f.dispose&&f.dispose(n,i)}},n.prototype.updateView=function(t,e,n,i){a(this._features,(function(t){t instanceof UL&&t.updateView&&t.updateView(t.model,e,n,i)}))},
  12650. // updateLayout(toolboxModel, ecModel, api, payload) {
  12651. // zrUtil.each(this._features, function (feature) {
  12652. // feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload);
  12653. // });
  12654. // },
  12655. n.prototype.remove=function(t,e){a(this._features,(function(n){n instanceof UL&&n.remove&&n.remove(t,e)})),this.group.removeAll()},n.prototype.dispose=function(t,e){a(this._features,(function(n){n instanceof UL&&n.dispose&&n.dispose(t,e)}))},n.type="toolbox",n}(Mu);const $L=JL;const QL=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",o="svg"===e.getZr().painter.getType(),r=o?"svg":n.get("type",!0)||"png",a=e.getConnectedDataURL({type:r,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=d.browser;
  12656. // Chrome, Firefox, New Edge
  12657. if("function"!=typeof MouseEvent||!s.newEdge&&(s.ie||s.edge))
  12658. // @ts-ignore
  12659. if(window.navigator.msSaveOrOpenBlob||o){var l=a.split(","),u=l[0].indexOf("base64")>-1,c=o?decodeURIComponent(l[1]):l[1];
  12660. // data:[<mime type>][;charset=<charset>][;base64],<encoded data>
  12661. // only `atob` when the data uri is encoded with base64
  12662. // otherwise, like `svg` data uri exported by zrender,
  12663. // there will be an error, for it's not encoded with base64.
  12664. // (just a url-encoded string through `encodeURIComponent`)
  12665. u&&(c=window.atob(c));var h=i+"."+r;
  12666. // @ts-ignore
  12667. if(window.navigator.msSaveOrOpenBlob){for(var p=c.length,f=new Uint8Array(p);p--;)f[p]=c.charCodeAt(p);var g=new Blob([f]);// @ts-ignore
  12668. window.navigator.msSaveOrOpenBlob(g,h)}else{var y=document.createElement("iframe");document.body.appendChild(y);var m=y.contentWindow,v=m.document;v.open("image/svg+xml","replace"),v.write(c),v.close(),m.focus(),v.execCommand("SaveAs",!0,h),document.body.removeChild(y)}}else{var x=n.get("lang"),_='<body style="margin:0;"><img src="'+a+'" style="max-width:100%;" title="'+(x&&x[0]||"")+'" /></body>',b=window.open();b.document.write(_),b.document.title=i}else{var S=document.createElement("a");S.download=i+"."+r,S.target="_blank",S.href=a;var w=new MouseEvent("click",{
  12669. // some micro front-end framework, window maybe is a Proxy
  12670. view:document.defaultView,bubbles:!0,cancelable:!1});S.dispatchEvent(w)}
  12671. // IE or old Edge
  12672. },e.getDefaultOption=function(t){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",
  12673. // Default use option.backgroundColor
  12674. // backgroundColor: '#fff',
  12675. connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],
  12676. // use current pixel ratio of device by default
  12677. // pixelRatio: 1,
  12678. lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},e}(UL);var tk="__ec_magicType_stack__",ek=[["line","bar"],["stack"]],nk=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return a(t.get("type"),(function(t){e[t]&&(n[t]=e[t])})),n},e.getDefaultOption=function(t){return{show:!0,type:[],
  12679. // Icon group
  12680. icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",
  12681. // eslint-disable-next-line
  12682. stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},
  12683. // `line`, `bar`, `stack`, `tiled`
  12684. title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},e.prototype.onclick=function(t,e,n){var i=this.model,o=i.get(["seriesIndex",n]);
  12685. // Not supported magicType
  12686. if(ik[n]){var r,s={series:[]};a(ek,(function(t){c(t,n)>=0&&a(t,(function(t){i.setIconStatus(t,"normal")}))})),i.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},(function(t){var e=t.subType,o=t.id,r=ik[n](e,o,t,i);r&&(
  12687. // PENDING If merge original option?
  12688. I(r,t.option),s.series.push(r));
  12689. // Modify boundaryGap
  12690. var a=t.coordinateSystem;if(a&&"cartesian2d"===a.type&&("line"===n||"bar"===n)){var l=a.getAxesByScale("ordinal")[0];if(l){var u=l.dim+"Axis",c=t.getReferringComponents(u,zn).models[0].componentIndex;s[u]=s[u]||[];for(var d=0;d<=c;d++)s[u][c]=s[u][c]||{};s[u][c].boundaryGap="bar"===n}}}));var l=n;
  12691. // Change title of stack
  12692. "stack"===n&&(
  12693. // use titles in model instead of ecModel
  12694. // as stack and tiled appears in pair, just flip them
  12695. // no need of checking stack state
  12696. r=tt({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(l="tiled")),e.dispatchAction({type:"changeMagicType",currentType:l,newOption:s,newTitle:r,featureName:"magicType"})}},e}(UL),ik={line:function(t,e,n,i){if("bar"===t)return tt({id:e,type:"line",
  12697. // Preserve data related option
  12698. data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return tt({id:e,type:"bar",
  12699. // Preserve data related option
  12700. data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){var o=n.get("stack")===tk;if("line"===t||"bar"===t)return i.setIconStatus("stack",o?"normal":"emphasis"),tt({id:e,stack:o?"":tk},i.get(["option","stack"])||{},!0)}};
  12701. // TODO: SELF REGISTERED.
  12702. eh({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(t,e){e.mergeOption(t.newOption)}));const ok=nk;
  12703. /* global document */var rk=new Array(60).join("-"),ak="\t";function sk(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}
  12704. /**
  12705. * If a block is tsv format
  12706. */var lk=new RegExp("[\t]+","g");
  12707. /**
  12708. * @param {string} tsv
  12709. * @return {Object}
  12710. */function uk(t,e){var i=t.split(new RegExp("\n*"+rk+"\n*","g")),o={series:[]};return a(i,(function(t,i){if(function(t){if(t.slice(0,t.indexOf("\n")).indexOf(ak)>=0)return!0}(t)){var r=function(t){for(var e=t.split(/\n+/g),i=sk(e.shift()).split(lk),o=[],r=n(i,(function(t){return{name:t,data:[]}})),a=0;a<e.length;a++){var s=sk(e[a]).split(lk);o.push(s.shift());for(var l=0;l<s.length;l++)r[l]&&(r[l].data[a]=s[l])}return{series:r,categories:o}}(t),a=e[i],s=a.axisDim+"Axis";a&&(o[s]=o[s]||[],o[s][a.axisIndex]={data:r.categories},o.series=o.series.concat(r.series))}else{r=function(t){for(var e=t.split(/\n+/g),n=sk(e.shift()),i=[],o=0;o<e.length;o++){
  12711. // if line is empty, ignore it.
  12712. // there is a case that a user forgot to delete `\n`.
  12713. var r=sk(e[o]);if(r){var a=r.split(lk),s="",l=void 0,u=!1;isNaN(a[0])?(
  12714. // First item is name
  12715. u=!0,s=a[0],a=a.slice(1),i[o]={name:s,value:[]},l=i[o].value):l=i[o]=[];for(var c=0;c<a.length;c++)l.push(+a[c]);1===l.length&&(u?i[o].value=l[0]:i[o]=l[0])}}return{name:n,data:i}}(t);o.series.push(r)}})),o}var ck=/** @class */function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),i.prototype.onclick=function(e,i){
  12716. // FIXME: better way?
  12717. setTimeout((function(){i.dispatchAction({type:"hideTip"})}));var o=i.getDom(),r=this.model;this._dom&&o.removeChild(this._dom);var s=document.createElement("div");
  12718. // use padding to avoid 5px whitespace
  12719. s.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",s.style.backgroundColor=r.get("backgroundColor")||"#fff";
  12720. // Create elements
  12721. var l=document.createElement("h4"),u=r.get("lang")||[];l.innerHTML=u[0]||r.get("title"),l.style.cssText="margin:10px 20px",l.style.color=r.get("textColor");var c=document.createElement("div"),d=document.createElement("textarea");c.style.cssText="overflow:auto";var h=r.get("optionToContent"),p=r.get("contentToOption"),g=function(t){var e,i,o,r=
  12722. /**
  12723. * Group series into two types
  12724. * 1. on category axis, like line, bar
  12725. * 2. others, like scatter, pie
  12726. */
  12727. function(t){var e={},n=[],i=[];return t.eachRawSeries((function(t){var o=t.coordinateSystem;if(!o||"cartesian2d"!==o.type&&"polar"!==o.type)n.push(t);else{
  12728. // TODO: TYPE Consider polar? Include polar may increase unecessary bundle size.
  12729. var r=o.getBaseAxis();if("category"===r.type){var a=r.dim+"_"+r.index;e[a]||(e[a]={categoryAxis:r,valueAxis:o.getOtherAxis(r),series:[]},i.push({axisDim:r.dim,axisIndex:r.index})),e[a].series.push(t)}else n.push(t)}})),{seriesGroupByCategoryAxis:e,other:n,meta:i}}
  12730. /**
  12731. * Assemble content of series on cateogory axis
  12732. * @inner
  12733. */(t);return{value:st([(i=r.seriesGroupByCategoryAxis,o=[],a(i,(function(t,e){var i=t.categoryAxis,r=t.valueAxis.dim,s=[" "].concat(n(t.series,(function(t){return t.name}))),l=[i.model.getCategories()];a(t.series,(function(t){var e=t.getRawData();l.push(t.getRawData().mapArray(e.mapDimension(r),(function(t){return t})))}));for(
  12734. // Assemble table content
  12735. var u=[s.join(ak)],c=0;c<l[0].length;c++){for(var d=[],h=0;h<l.length;h++)d.push(l[h][c]);u.push(d.join(ak))}o.push(u.join("\n"))})),o.join("\n\n"+rk+"\n\n")),(e=r.other,n(e,(function(t){var e=t.getRawData(),n=[t.name],i=[];return e.each(e.dimensions,(function(){for(var t=arguments.length,o=arguments[t-1],r=e.getName(o),a=0;a<t-1;a++)i[a]=arguments[a];n.push((r?r+ak:"")+i.join(ak))})),n.join("\n")})).join("\n\n"+rk+"\n\n"))],(function(t){return!!t.replace(/[\n\t\s]/g,"")})).join("\n\n"+rk+"\n\n"),meta:r.meta}}(e);if(f(h)){var y=h(i.getOption());t(y)?c.innerHTML=y:Ae(y)&&c.appendChild(y)}else{
  12736. // Use default textarea
  12737. d.readOnly=r.get("readOnly");var m=d.style;
  12738. // eslint-disable-next-line max-len
  12739. m.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",m.color=r.get("textColor"),m.borderColor=r.get("textareaBorderColor"),m.backgroundColor=r.get("textareaColor"),d.value=g.value,c.appendChild(d)}var v=g.meta,x=document.createElement("div");x.style.cssText="position:absolute;bottom:5px;left:0;right:0";
  12740. // eslint-disable-next-line max-len
  12741. var _="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",b=document.createElement("div"),S=document.createElement("div");_+=";background-color:"+r.get("buttonColor"),_+=";color:"+r.get("buttonTextColor");var w=this;function M(){o.removeChild(s),w._dom=null}Le(b,"click",M),Le(S,"click",(function(){if(null==p&&null!=h||null!=p&&null==h)M();else{var t;try{t=f(p)?p(c,i.getOption()):uk(d.value,v)}catch(e){throw M(),new Error("Data view format error "+e)}t&&i.dispatchAction({type:"changeDataView",newOption:t}),M()}})),b.innerHTML=u[1],S.innerHTML=u[2],S.style.cssText=b.style.cssText=_,!r.get("readOnly")&&x.appendChild(S),x.appendChild(b),s.appendChild(l),s.appendChild(c),s.appendChild(x),c.style.height=o.clientHeight-80+"px",o.appendChild(s),this._dom=s},i.prototype.remove=function(t,e){this._dom&&e.getDom().removeChild(this._dom)},i.prototype.dispose=function(t,e){this.remove(t,e)},i.getDefaultOption=function(t){return{show:!0,readOnly:!1,optionToContent:null,contentToOption:null,
  12742. // eslint-disable-next-line
  12743. icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:t.getLocaleModel().get(["toolbox","dataView","title"]),lang:t.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"}},i}(UL);
  12744. /**
  12745. * @inner
  12746. */function dk(t,e){return n(t,(function(t,n){var r=e&&e[n];if(o(r)&&!i(r)){o(t)&&!i(t)||(t={value:t});
  12747. // original data has name but new data has no name
  12748. var a=null!=r.name&&null==t.name;
  12749. // Original data has option
  12750. return t=I(t,r),a&&delete t.name,t}return t}))}
  12751. // TODO: SELF REGISTERED.
  12752. eh({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},(function(t,e){var n=[];a(t.newOption.series,(function(t){var i=e.getSeriesByName(t.name)[0];if(i){var o=i.get("data");n.push({name:t.name,data:dk(t.data,o)})}else
  12753. // New created series
  12754. // Geuss the series type
  12755. n.push(p({
  12756. // Default is scatter
  12757. type:"scatter"},t))})),e.mergeOption(I({series:n},t.newOption))}));const hk=ck;var pk=a,fk=On();
  12758. /**
  12759. * History length of each dataZoom may be different.
  12760. * this._history[0] is used to store origin range.
  12761. */
  12762. function gk(t){var e=fk(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var yk=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.onclick=function(t,e){!function(t){fk(t).snapshots=null}(t),e.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){return{show:!0,
  12763. // eslint-disable-next-line
  12764. icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:t.getLocaleModel().get(["toolbox","restore","title"])}},e}(UL);
  12765. // TODO: SELF REGISTERED.
  12766. eh({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(t,e){e.resetOption("recreate")}));const mk=yk;
  12767. // FIXME
  12768. // how to genarialize to more coordinate systems.
  12769. var vk=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],xk=/** @class */function(){
  12770. /**
  12771. * @param finder contains Index/Id/Name of xAxis/yAxis/geo/grid
  12772. * Each can be {number|Array.<number>}. like: {xAxisIndex: [3, 4]}
  12773. * @param opt.include include coordinate system types.
  12774. */
  12775. function t(t,e,n){var i=this;this._targetInfoList=[];var o=bk(e,t);a(Sk,(function(t,e){(!n||!n.include||c(n.include,e)>=0)&&t(o,i._targetInfoList)}))}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,(function(t,e,n){
  12776. // area.coordRange is the first of area.coordRanges
  12777. if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;
  12778. // In 'category' axis, coord to pixel is not reversible, so we can not
  12779. // rebuild range by coordRange accrately, which may bring trouble when
  12780. // brushing only one item. So we use __rangeOffset to rebuilding range
  12781. // by coordRange. And this it only used in brush component so it is no
  12782. // need to be adapted to coordRanges.
  12783. var i=Ik[t.brushType](0,n,e);t.__rangeOffset={offset:Tk[t.brushType](i.values,t.range,[1,1]),xyMinMax:i.xyMinMax}}})),t},t.prototype.matchOutputRanges=function(t,e,n){a(t,(function(t){var i=this.findTargetInfo(t,e);i&&!0!==i&&a(i.coordSyses,(function(i){var o=Ik[t.brushType](1,i,t.range,!0);n(t,o.values,i,e)}))}),this)},
  12784. /**
  12785. * the `areas` is `BrushModel.areas`.
  12786. * Called in layout stage.
  12787. * convert `area.coordRange` to global range and set panelId to `area.range`.
  12788. */
  12789. t.prototype.setInputRanges=function(t,e){a(t,(function(t){var n,i,o,r,a,s=this.findTargetInfo(t,e);
  12790. // convert coordRange to global range and set panelId.
  12791. if(t.range=t.range||[],s&&!0!==s){t.panelId=s.panelId;
  12792. // (1) area.range should always be calculate from coordRange but does
  12793. // not keep its original value, for the sake of the dataZoom scenario,
  12794. // where area.coordRange remains unchanged but area.range may be changed.
  12795. // (2) Only support converting one coordRange to pixel range in brush
  12796. // component. So do not consider `coordRanges`.
  12797. // (3) About __rangeOffset, see comment above.
  12798. var l=Ik[t.brushType](0,s.coordSys,t.coordRange),u=t.__rangeOffset;t.range=u?Tk[t.brushType](l.values,u.offset,(n=l.xyMinMax,i=u.xyMinMax,o=Ak(n),r=Ak(i),a=[o[0]/r[0],o[1]/r[1]],isNaN(a[0])&&(a[0]=1),isNaN(a[1])&&(a[1]=1),a)):l.values}}),this)},t.prototype.makePanelOpts=function(t,e){return n(this._targetInfoList,(function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:e?e(n):null,clipPath:TM(i),isTargetByCursor:AM(i,t,n.coordSysModel),getLinearBrushOtherExtent:CM(i)}}))},t.prototype.controlSeries=function(t,e,n){
  12799. // Check whether area is bound in coord, and series do not belong to that coord.
  12800. // If do not do this check, some brush (like lineX) will controll all axes.
  12801. var i=this.findTargetInfo(t,n);return!0===i||i&&c(i.coordSyses,e.coordinateSystem)>=0},
  12802. /**
  12803. * If return Object, a coord found.
  12804. * If return true, global found.
  12805. * Otherwise nothing found.
  12806. */
  12807. t.prototype.findTargetInfo=function(t,e){for(var n=this._targetInfoList,i=bk(e,t),o=0;o<n.length;o++){var r=n[o],a=t.panelId;if(a){if(r.panelId===a)return r}else for(var s=0;s<wk.length;s++)if(wk[s](i,r))return r}return!0},t}();function _k(t){return t[0]>t[1]&&t.reverse(),t}function bk(t,e){return En(t,e,{includeMainTypes:vk})}var Sk={grid:function(t,e){var n=t.xAxisModels,i=t.yAxisModels,o=t.gridModels,s=r(),l={},u={};(n||i||o)&&(a(n,(function(t){var e=t.axis.grid.model;s.set(e.id,e),l[e.id]=!0})),a(i,(function(t){var e=t.axis.grid.model;s.set(e.id,e),u[e.id]=!0})),a(o,(function(t){s.set(t.id,t),l[t.id]=!0,u[t.id]=!0})),s.each((function(t){var o=t.coordinateSystem,r=[];a(o.getCartesians(),(function(t,e){(c(n,t.getAxis("x").model)>=0||c(i,t.getAxis("y").model)>=0)&&r.push(t)})),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,
  12808. // Use the first one as the representitive coordSys.
  12809. coordSys:r[0],coordSyses:r,getPanelRect:Mk.grid,xAxisDeclared:l[t.id],yAxisDeclared:u[t.id]})})))},geo:function(t,e){a(t.geoModels,(function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:Mk.geo})}))}},wk=[
  12810. // grid
  12811. function(t,e){var n=t.xAxisModel,i=t.yAxisModel,o=t.gridModel;return!o&&n&&(o=n.axis.grid.model),!o&&i&&(o=i.axis.grid.model),o&&o===e.gridModel},
  12812. // geo
  12813. function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],Mk={grid:function(){
  12814. // grid is not Transformable.
  12815. return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();
  12816. // geo roam and zoom transform
  12817. return e.applyTransform(Do(t)),e}},Ik={lineX:rt(Dk,0),lineY:rt(Dk,1),rect:function(t,e,n,i){var o=t?e.pointToData([n[0][0],n[1][0]],i):e.dataToPoint([n[0][0],n[1][0]],i),r=t?e.pointToData([n[0][1],n[1][1]],i):e.dataToPoint([n[0][1],n[1][1]],i),a=[_k([o[0],r[0]]),_k([o[1],r[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,i,o){var r=[[Infinity,-Infinity],[Infinity,-Infinity]];return{values:n(i,(function(n){var i=t?e.pointToData(n,o):e.dataToPoint(n,o);return r[0][0]=Math.min(r[0][0],i[0]),r[1][0]=Math.min(r[1][0],i[1]),r[0][1]=Math.max(r[0][1],i[0]),r[1][1]=Math.max(r[1][1],i[1]),i})),xyMinMax:r}}};function Dk(t,e,i,o){var r=i.getAxis(["x","y"][t]),a=_k(n([0,1],(function(t){return e?r.coordToData(r.toLocalCoord(o[t]),!0):r.toGlobalCoord(r.dataToCoord(o[t]))}))),s=[];return s[t]=a,s[1-t]=[NaN,NaN],{values:a,xyMinMax:s}}var Tk={lineX:rt(Ck,0),lineY:rt(Ck,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,e,i){return n(t,(function(t,n){return[t[0]-i[0]*e[n][0],t[1]-i[1]*e[n][1]]}))}};function Ck(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}
  12818. // We have to process scale caused by dataZoom manually,
  12819. // although it might be not accurate.
  12820. // Return [0~1, 0~1]
  12821. function Ak(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}const Lk=xk;var kk,Pk,Nk=a,Ok=bn+"toolbox-dataZoom_",Rk=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.render=function(t,e,n,i){this._brushController||(this._brushController=new DM(n.getZr()),this._brushController.on("brush",lt(this._onBrush,this)).mount()),function(t,e,n,i,o){var r=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(r="dataZoomSelect"===i.key&&i.dataZoomSelectActive);n._isZoomActive=r,t.setIconStatus("zoom",r?"emphasis":"normal");var a=new Lk(Vk(t),e,{include:["grid"]}),s=a.makePanelOpts(o,(function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"}));n._brushController.setPanels(s).enableBrush(!(!r||!s.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,i,n),function(t,e){t.setIconStatus("back",function(t){return gk(t).length}(e)>1?"emphasis":"normal")}(t,e)},e.prototype.onclick=function(t,e,n){Ek[n].call(this)},e.prototype.remove=function(t,e){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var e=t.areas;if(t.isEnd&&e.length){var n={},i=this.ecModel;this._brushController.updateCovers([]),new Lk(Vk(this.model),i,{include:["grid"]}).matchOutputRanges(e,i,(function(t,e,n){if("cartesian2d"===n.type){var i=t.brushType;"rect"===i?(o("x",n,e[0]),o("y",n,e[1])):o({lineX:"x",lineY:"y"}[i],n,e)}})),
  12822. /**
  12823. * @param ecModel
  12824. * @param newSnapshot key is dataZoomId
  12825. */
  12826. function(t,e){var n=gk(t);
  12827. // If previous dataZoom can not be found,
  12828. // complete an range with current range.
  12829. pk(e,(function(e,i){for(var o=n.length-1;o>=0&&!n[o][i];o--);if(o<0){
  12830. // No origin range set, create one by current range.
  12831. var r=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(r){var a=r.getPercentRange();n[0][i]={dataZoomId:i,start:a[0],end:a[1]}}}})),n.push(e)}(i,n),this._dispatchZoomAction(n)}function o(t,e,o){var r=e.getAxis(t),a=r.model,s=function(t,e,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){n.getAxisModel(t,e.componentIndex)&&(i=n)})),i}(t,a,i),l=s.findRepresentativeAxisProxy(a).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(o=Sw(0,o.slice(),r.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(n[s.id]={dataZoomId:s.id,startValue:o[0],endValue:o[1]})}},e.prototype._dispatchZoomAction=function(t){var e=[];
  12832. // Convert from hash map to array.
  12833. Nk(t,(function(t,n){e.push(et(t))})),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},e.getDefaultOption=function(t){return{show:!0,filterMode:"filter",
  12834. // Icon group
  12835. icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},
  12836. // `zoom`, `back`
  12837. title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},e}(UL),Ek={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(function(t){var e=gk(t),n=e[e.length-1];e.length>1&&e.pop();
  12838. // Find top for all dataZoom.
  12839. var i={};return pk(n,(function(t,n){for(var o=e.length-1;o>=0;o--)if(t=e[o][n]){i[n]=t;break}})),i}(this.ecModel))}};function Vk(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};
  12840. // If both `xAxisIndex` `xAxisId` not set, it means 'all'.
  12841. // If both `yAxisIndex` `yAxisId` not set, it means 'all'.
  12842. // Some old cases set like this below to close yAxis control but leave xAxis control:
  12843. // `{ feature: { dataZoom: { yAxisIndex: false } }`.
  12844. return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}kk="dataZoom",Pk=function(t){var e=t.getComponent("toolbox",0),n=["feature","dataZoom"];if(e&&null!=e.get(n)){var i=e.getModel(n),o=[],r=En(t,Vk(i));return Nk(r.xAxisModels,(function(t){return a(t,"xAxis","xAxisIndex")})),Nk(r.yAxisModels,(function(t){return a(t,"yAxis","yAxisIndex")})),o}function a(t,e,n){var r=t.componentIndex,a={type:"select",$fromToolbox:!0,
  12845. // Default to be filter
  12846. filterMode:i.get("filterMode",!0)||"filter",
  12847. // Id for merge mapping.
  12848. id:Ok+e+r};a[n]=r,o.push(a)}},s(null==qa.get(kk)&&Pk),qa.set(kk,Pk);const zk=Rk;const Bk=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={
  12849. // zlevel: 0,
  12850. z:60,show:!0,
  12851. // tooltip main content
  12852. showContent:!0,
  12853. // 'trigger' only works on coordinate system.
  12854. // 'item' | 'axis' | 'none'
  12855. trigger:"item",
  12856. // 'click' | 'mousemove' | 'none'
  12857. triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",
  12858. // whether restraint content inside viewRect.
  12859. // If renderMode: 'richText', default true.
  12860. // If renderMode: 'html', defaut false (for backward compat).
  12861. confine:null,showDelay:0,hideDelay:100,
  12862. // Animation transition time, unit is second
  12863. transitionDuration:.4,enterable:!1,backgroundColor:"#fff",
  12864. // box shadow
  12865. shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,
  12866. // tooltip border radius, unit is px, default is 4
  12867. borderRadius:4,
  12868. // tooltip border width, unit is px, default is 0 (no border)
  12869. borderWidth:1,
  12870. // Tooltip inside padding, default is 5 for all direction
  12871. // Array is allowed to set up, right, bottom, left, same with css
  12872. // The default value: See `tooltip/tooltipMarkup.ts#getPaddingFromTooltipModel`.
  12873. padding:null,
  12874. // Extra css text
  12875. extraCssText:"",
  12876. // axis indicator, trigger by axis
  12877. axisPointer:{
  12878. // default is line
  12879. // legal values: 'line' | 'shadow' | 'cross'
  12880. type:"line",
  12881. // Valid when type is line, appoint tooltip line locate on which line. Optional
  12882. // legal values: 'x' | 'y' | 'angle' | 'radius' | 'auto'
  12883. // default is 'auto', chose the axis which type is category.
  12884. // for multiply y axis, cartesian coord chose x axis, polar chose angle axis
  12885. axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",
  12886. // TODO formatter
  12887. textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(Ta);
  12888. /* global document */function Gk(t){var e=t.get("confine");return null!=e?!!e:"richText"===t.get("renderMode")}function Fk(t){if(d.domSupported)for(var e=document.documentElement.style,n=0,i=t.length;n<i;n++)if(t[n]in e)return t[n]}var Wk=Fk(["transform","webkitTransform","OTransform","MozTransform","msTransform"]);function Hk(t,e){if(!t)return e;e=ra(e,!0);var n=t.indexOf(e);return(t=-1===n?e:"-"+t.slice(0,n)+"-"+e).toLowerCase()}
  12889. /* global document, window */
  12890. var Yk=Hk(Fk(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),Uk=Hk(Wk,"transform"),Zk="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(d.transform3dSupported?"will-change:transform;":"");function Xk(t,e,n){
  12891. // If using float on style, the final width of the dom might
  12892. // keep changing slightly while mouse move. So `toFixed(0)` them.
  12893. var i=t.toFixed(0)+"px",o=e.toFixed(0)+"px";
  12894. // not support transform, use `left` and `top` instead.
  12895. if(!d.transformSupported)return n?"top:"+o+";left:"+i+";":[["top",o],["left",i]];
  12896. // support transform
  12897. var r=d.transform3dSupported,a="translate"+(r?"3d":"")+"("+i+","+o+(r?",0":"")+")";return n?"top:0;left:0;"+Uk+":"+a+";":[["top",0],["left",0],[Wk,a]]}
  12898. /**
  12899. * @param {Object} textStyle
  12900. * @return {string}
  12901. * @inner
  12902. */function jk(t,e,n){var i=[],o=t.get("transitionDuration"),r=t.get("backgroundColor"),s=t.get("shadowBlur"),l=t.get("shadowColor"),u=t.get("shadowOffsetX"),c=t.get("shadowOffsetY"),h=t.getModel("textStyle"),p=lu(t,"html"),f=u+"px "+c+"px "+s+"px "+l;return i.push("box-shadow:"+f),
  12903. // Animation transition. Do not animate when transitionDuration is 0.
  12904. e&&o&&i.push(function(t,e){var n="cubic-bezier(0.23,1,0.32,1)",i=" "+t/2+"s "+n,o="opacity"+i+",visibility"+i;return e||(i=" "+t+"s "+n,o+=d.transformSupported?","+Uk+i:",left"+i+",top"+i),Yk+":"+o}(o,n)),r&&i.push("background-color:"+r),
  12905. // Border style
  12906. a(["width","color","radius"],(function(e){var n="border-"+e,o=ra(n),r=t.get(o);null!=r&&i.push(n+":"+r+("color"===e?"":"px"))})),
  12907. // Text style
  12908. i.push(function(t){var e=[],n=t.get("fontSize"),i=t.getTextColor();i&&e.push("color:"+i),e.push("font:"+t.getFont());
  12909. // @ts-ignore, leave it to the tooltip refactor.
  12910. var o=x(t.get("lineHeight"),Math.round(3*n/2));n&&e.push("line-height:"+o+"px");var r=t.get("textShadowColor"),s=t.get("textShadowBlur")||0,l=t.get("textShadowOffsetX")||0,u=t.get("textShadowOffsetY")||0;return r&&s&&e.push("text-shadow:"+l+"px "+u+"px "+s+"px "+r),a(["decoration","align"],(function(n){var i=t.get(n);i&&e.push("text-"+n+":"+i)})),e.join(";")}(h)),
  12911. // Padding
  12912. null!=p&&i.push("padding:"+aa(p).join("px ")+"px"),i.join(";")+";"}
  12913. // If not able to make, do not modify the input `out`.
  12914. function qk(t,e,n,i,o){var r=e&&e.painter;if(n){var a=r&&r.getViewportRoot();a&&
  12915. // Some APPs might use scale on body, so we support CSS transform here.
  12916. Pe(t,a,n,i,o)}else{t[0]=i,t[1]=o;
  12917. // xy should be based on canvas root. But tooltipContent is
  12918. // the sibling of canvas root. So padding of ec container
  12919. // should be considered here.
  12920. var s=r&&r.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var Kk=/** @class */function(){function e(e,n){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,d.wxa)return null;var i=document.createElement("div");
  12921. // TODO: TYPE
  12922. i.domBelongToZr=!0,this.el=i;var o=this._zr=e.getZr(),r=n.appendTo,a=r&&(t(r)?document.querySelector(r):Ae(r)?r:f(r)&&r(e.getDom()));qk(this._styleCoord,o,a,e.getWidth()/2,e.getHeight()/2),(a||e.getDom()).appendChild(i),this._api=e,this._container=a;
  12923. // FIXME
  12924. // Is it needed to trigger zr event manually if
  12925. // the browser do not support `pointer-events: none`.
  12926. var s=this;i.onmouseenter=function(){
  12927. // clear the timeout in hideLater and keep showing tooltip
  12928. s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},i.onmousemove=function(t){if(t=t||window.event,!s._enterable){
  12929. // `pointer-events: none` is set to tooltip content div
  12930. // if `enterable` is set as `false`, and `el.onmousemove`
  12931. // can not be triggered. But in browser that do not
  12932. // support `pointer-events`, we need to do this:
  12933. // Try trigger zrender event to avoid mouse
  12934. // in and out shape too frequently
  12935. var e=o.handler,n=o.painter.getViewportRoot();ke(n,t,!0),e.dispatch("mousemove",t)}},i.onmouseleave=function(){
  12936. // set `_inContent` to `false` before `hideLater`
  12937. s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}
  12938. /**
  12939. * Update when tooltip is rendered
  12940. */return e.prototype.update=function(t){
  12941. // FIXME
  12942. // Move this logic to ec main?
  12943. if(!this._container){var e=this._api.getDom(),n=(r="position",(a=(o=e).currentStyle||document.defaultView&&document.defaultView.getComputedStyle(o))?r?a[r]:a:null),i=e.style;"absolute"!==i.position&&"absolute"!==n&&(i.position="relative")}
  12944. // move tooltip if chart resized
  12945. var o,r,a,s=t.get("alwaysShowContent");s&&this._moveIfResized(),
  12946. // update alwaysShowContent
  12947. this._alwaysShowContent=s,
  12948. // update className
  12949. this.el.className=t.get("className")||""},e.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,o=this._styleCoord;n.innerHTML?i.cssText=Zk+jk(t,!this._firstShow,this._longHide)+Xk(o[0],o[1],!0)+"border-color:"+ha(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,n,o,r,a){var s=this.el;if(null!=e){var l="";if(t(a)&&"item"===o.get("trigger")&&!Gk(o)&&(l=function(e,n,i){if(!t(i)||"inside"===i)return"";var o=e.get("backgroundColor"),r=e.get("borderWidth");n=ha(n);var a,s,l="left"===(a=i)?"right":"right"===a?"left":"top"===a?"bottom":"top",u=Math.max(1.5*Math.round(r),6),d="",h=Uk+":";c(["left","right"],l)>-1?(d+="top:50%",h+="translateY(-50%) rotate("+(s="left"===l?-225:-45)+"deg)"):(d+="left:50%",h+="translateX(-50%) rotate("+(s="top"===l?225:45)+"deg)");var p=s*Math.PI/180,f=u+r,g=f*Math.abs(Math.cos(p))+f*Math.abs(Math.sin(p)),y=n+" solid "+r+"px;";return'<div style="'+["position:absolute;width:"+u+"px;height:"+u+"px;z-index:-1;",(d+=";"+l+":-"+Math.round(100*((g-Math.SQRT2*r)/2+Math.SQRT2*r-(g-f)/2))/100+"px")+";"+h+";","border-bottom:"+y,"border-right:"+y,"background-color:"+o+";"].join("")+'"></div>'}(o,r,a)),t(e))s.innerHTML=e+l;else if(e){
  12950. // Clear previous
  12951. s.innerHTML="",i(e)||(e=[e]);for(var u=0;u<e.length;u++)Ae(e[u])&&e[u].parentNode!==s&&s.appendChild(e[u]);
  12952. // no arrow if empty
  12953. if(l&&s.childNodes.length){
  12954. // no need to create a new parent element, but it's not supported by IE 10 and older.
  12955. // const arrowEl = document.createRange().createContextualFragment(arrow);
  12956. var d=document.createElement("div");d.innerHTML=l,s.appendChild(d)}}}else s.innerHTML=""},e.prototype.setEnterable=function(t){this._enterable=t},e.prototype.getSize=function(){var t=this.el;return t?[t.offsetWidth,t.offsetHeight]:[0,0]},e.prototype.moveTo=function(t,e){if(this.el){var n=this._styleCoord;if(qk(n,this._zr,this._container,t,e),null!=n[0]&&null!=n[1]){var i=this.el.style,o=Xk(n[0],n[1]);a(o,(function(t){i[t[0]]=t[1]}))}}},
  12957. /**
  12958. * when `alwaysShowContent` is true,
  12959. * move the tooltip after chart resized
  12960. */
  12961. e.prototype._moveIfResized=function(){
  12962. // The ratio of left to width
  12963. var t=this._styleCoord[2],e=this._styleCoord[3];
  12964. // The ratio of top to height
  12965. this.moveTo(t*this._zr.getWidth(),e*this._zr.getHeight())},e.prototype.hide=function(){var t=this,e=this.el.style;e.visibility="hidden",e.opacity="0",d.transform3dSupported&&(e.willChange=""),this._show=!1,this._longHideTimeout=setTimeout((function(){return t._longHide=!0}),500)},e.prototype.hideLater=function(t){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(t?(this._hideDelay=t,
  12966. // Set show false to avoid invoke hideLater multiple times
  12967. this._show=!1,this._hideTimeout=setTimeout(lt(this.hide,this),t)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var t=this.el.parentNode;t&&t.removeChild(this.el),this.el=this._container=null},e}();const Jk=Kk;var $k=/** @class */function(){function t(t){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=t.getZr(),eP(this._styleCoord,this._zr,t.getWidth()/2,t.getHeight()/2)}
  12968. /**
  12969. * Update when tooltip is rendered
  12970. */return t.prototype.update=function(t){var e=t.get("alwaysShowContent");e&&this._moveIfResized(),
  12971. // update alwaysShowContent
  12972. this._alwaysShowContent=e},t.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},
  12973. /**
  12974. * Set tooltip content
  12975. */
  12976. t.prototype.setContent=function(t,e,n,i,r){var s=this;o(t)&&vn(""),this.el&&this._zr.remove(this.el);var l=n.getModel("textStyle");this.el=new $({style:{rich:e.richTextStyles,text:t,lineHeight:22,borderWidth:1,borderColor:i,textShadowColor:l.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:lu(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),a(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],(function(t){s.el.style[t]=n.get(t)})),a(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],(function(t){s.el.style[t]=l.get(t)||0})),this._zr.add(this.el);var u=this;this.el.on("mouseover",(function(){
  12977. // clear the timeout in hideLater and keep showing tooltip
  12978. u._enterable&&(clearTimeout(u._hideTimeout),u._show=!0),u._inContent=!0})),this.el.on("mouseout",(function(){u._enterable&&u._show&&u.hideLater(u._hideDelay),u._inContent=!1}))},t.prototype.setEnterable=function(t){this._enterable=t},t.prototype.getSize=function(){var t=this.el,e=this.el.getBoundingRect(),n=tP(t.style);return[e.width+n.left+n.right,e.height+n.top+n.bottom]},t.prototype.moveTo=function(t,e){var n=this.el;if(n){var i=this._styleCoord;eP(i,this._zr,t,e),t=i[0],e=i[1];var o=n.style,r=Qk(o.borderWidth||0),a=tP(o);
  12979. // rich text x, y do not include border.
  12980. n.x=t+r+a.left,n.y=e+r+a.top,n.markRedraw()}},
  12981. /**
  12982. * when `alwaysShowContent` is true,
  12983. * move the tooltip after chart resized
  12984. */
  12985. t.prototype._moveIfResized=function(){
  12986. // The ratio of left to width
  12987. var t=this._styleCoord[2],e=this._styleCoord[3];
  12988. // The ratio of top to height
  12989. this.moveTo(t*this._zr.getWidth(),e*this._zr.getHeight())},t.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},t.prototype.hideLater=function(t){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(t?(this._hideDelay=t,
  12990. // Set show false to avoid invoke hideLater multiple times
  12991. this._show=!1,this._hideTimeout=setTimeout(lt(this.hide,this),t)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this._zr.remove(this.el)},t}();function Qk(t){return Math.max(0,t)}function tP(t){var e=Qk(t.shadowBlur||0),n=Qk(t.shadowOffsetX||0),i=Qk(t.shadowOffsetY||0);return{left:Qk(e-n),right:Qk(e+n),top:Qk(e-i),bottom:Qk(e+i)}}function eP(t,e,n,i){t[0]=n,t[1]=i,t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}const nP=$k;var iP=new G({shape:{x:-1,y:-1,width:2,height:2}}),oP=/** @class */function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=n.type,t}return Ue(n,e),n.prototype.init=function(t,e){if(!d.node&&e.getDom()){var n,i=t.getComponent("tooltip"),o=this._renderMode="auto"===(n=i.get("renderMode"))?d.domSupported?"html":"richText":n||"html";this._tooltipContent="richText"===o?new nP(e):new Jk(e,{appendTo:i.get("appendToBody",!0)?"body":i.get("appendTo",!0)})}},n.prototype.render=function(t,e,n){if(!d.node&&n.getDom()){
  12992. // Reset
  12993. this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=n;var i=this._tooltipContent;i.update(t),i.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow(),
  12994. // PENDING
  12995. // `mousemove` event will be triggered very frequently when the mouse moves fast,
  12996. // which causes that the `updatePosition` function was also called frequently.
  12997. // In Chrome with devtools open and Firefox, tooltip looks laggy and shakes. See #14695 #16101
  12998. // To avoid frequent triggering,
  12999. // consider throttling it in 50ms when transition is enabled
  13000. "richText"!==this._renderMode&&t.get("transitionDuration")?Bu(this,"_updatePosition",50,"fixRate"):Gu(this,"_updatePosition")}},n.prototype._initGlobalListener=function(){var t=this._tooltipModel.get("triggerOn");zC("itemTooltip",this._api,lt((function(e,n,i){
  13001. // If 'none', it is not controlled by mouse totally.
  13002. "none"!==t&&(t.indexOf(e)>=0?this._tryShow(n,i):"leave"===e&&this._hide(i))}),this))},n.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api,i=t.get("triggerOn");
  13003. // Try to keep the tooltip show when refreshing
  13004. if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){
  13005. // Show tip next tick after other charts are rendered
  13006. // In case highlight action has wrong result
  13007. // FIXME
  13008. !n.isDisposed()&&o.manuallyShowTip(t,e,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})}))}},
  13009. /**
  13010. * Show tip manually by
  13011. * dispatchAction({
  13012. * type: 'showTip',
  13013. * x: 10,
  13014. * y: 10
  13015. * });
  13016. * Or
  13017. * dispatchAction({
  13018. * type: 'showTip',
  13019. * seriesIndex: 0,
  13020. * dataIndex or dataIndexInside or name
  13021. * });
  13022. *
  13023. * TODO Batch
  13024. */
  13025. n.prototype.manuallyShowTip=function(t,e,n,i){if(i.from!==this.uid&&!d.node&&n.getDom()){var o=aP(i,n);
  13026. // Reset ticket
  13027. this._ticket="";
  13028. // When triggered from axisPointer.
  13029. var r=i.dataByCoordSys,a=
  13030. /**
  13031. * Find target component by payload like:
  13032. * ```js
  13033. * { legendId: 'some_id', name: 'xxx' }
  13034. * { toolboxIndex: 1, name: 'xxx' }
  13035. * { geoName: 'some_name', name: 'xxx' }
  13036. * ```
  13037. * PENDING: at present only
  13038. *
  13039. * If not found, return null/undefined.
  13040. */
  13041. function(t,e,n){var i=Vn(t).queryOptionMap,o=i.keys()[0];if(!o||"series"===o)return;var r=Gn(e,o,i.get(o),{useDefault:!1,enableAll:!1,enableNone:!1}),a=r.models[0];if(!a)return;var s,l=n.getViewOfComponentModel(a);if(l.group.traverse((function(e){var n=ni(e).tooltipConfig;if(n&&n.name===t.name)return s=e,!0;// stop
  13042. })),s)return{componentMainType:o,componentIndex:a.componentIndex,el:s}}(i,e,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:i.position,
  13043. // When manully trigger, the mouse is not on the el, so we'd better to
  13044. // position tooltip on the bottom of the el and display arrow is possible.
  13045. positionDefault:"bottom"},o)}else if(i.tooltip&&null!=i.x&&null!=i.y){var l=iP;l.x=i.x,l.y=i.y,l.update(),ni(l).tooltipConfig={name:null,option:i.tooltip},
  13046. // Manually show tooltip while view is not using zrender elements.
  13047. this._tryShow({offsetX:i.x,offsetY:i.y,target:l},o)}else if(r)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:r,tooltipOption:i.tooltipOption},o);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var u=YC(i,e),c=u.point[0],h=u.point[1];null!=c&&null!=h&&this._tryShow({offsetX:c,offsetY:h,target:u.el,position:i.position,
  13048. // When manully trigger, the mouse is not on the el, so we'd better to
  13049. // position tooltip on the bottom of the el and display arrow is possible.
  13050. positionDefault:"bottom"},o)}else null!=i.x&&null!=i.y&&(
  13051. // FIXME
  13052. // should wrap dispatchAction like `axisPointer/globalListener` ?
  13053. n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},o))}},n.prototype.manuallyHideTip=function(t,e,n,i){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(aP(i,n))},
  13054. // Be compatible with previous design, that is, when tooltip.type is 'axis' and
  13055. // dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer
  13056. // and tooltip.
  13057. n.prototype._manuallyAxisShowTip=function(t,e,n,i){var o=i.seriesIndex,r=i.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=o&&null!=r&&null!=a){var s=e.getSeriesByIndex(o);if(s)if("axis"===rP([s.getData().getItemModel(r),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:r,position:i.position}),!0}},n.prototype._tryShow=function(t,e){var n=t.target;if(this._tooltipModel){
  13058. // Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed
  13059. this._lastX=t.offsetX,this._lastY=t.offsetY;var i=t.dataByCoordSys;if(i&&i.length)this._showAxisTooltip(i,t);else if(n){var o,r;if("legend"===ni(n).ssrType)
  13060. // Don't trigger tooltip for legend tooltip item
  13061. return;this._lastDataByCoordSys=null,kc(n,(function(t){
  13062. // Always show item tooltip if mouse is on the element with dataIndex
  13063. return null!=ni(t).dataIndex?(o=t,!0):
  13064. // Tooltip provided directly. Like legend.
  13065. null!=ni(t).tooltipConfig?(r=t,!0):void 0}),!0),o?this._showSeriesItemTooltip(t,o,e):r?this._showComponentItemTooltip(t,r,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},n.prototype._showOrMove=function(t,e){
  13066. // showDelay is used in this case: tooltip.enterable is set
  13067. // as true. User intent to move mouse into tooltip and click
  13068. // something. `showDelay` makes it easier to enter the content
  13069. // but tooltip do not move immediately.
  13070. var n=t.get("showDelay");e=lt(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},n.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,i=this._tooltipModel,o=[e.offsetX,e.offsetY],r=rP([e.tooltipOption],i),s=this._renderMode,l=[],u=$l("section",{blocks:[],noHeader:!0}),c=[],d=new uu;a(t,(function(t){a(t.dataByAxis,(function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),o=t.value;if(e&&null!=o){var r=MC(o,e.axis,n,t.seriesDataIndices,t.valueLabelOpt),h=$l("section",{header:r,noHeader:!Q(r),sortBlocks:!0,blocks:[]});u.blocks.push(h),a(t.seriesDataIndices,(function(a){var u=n.getSeriesByIndex(a.seriesIndex),f=a.dataIndexInside,g=u.getDataParams(f);
  13071. // Can't find data.
  13072. if(!(g.dataIndex<0)){g.axisDim=t.axisDim,g.axisIndex=t.axisIndex,g.axisType=t.axisType,g.axisId=t.axisId,g.axisValue=af(e.axis,{value:o}),g.axisValueLabel=r,
  13073. // Pre-create marker style for makers. Users can assemble richText
  13074. // text in `formatter` callback and use those markers style.
  13075. g.marker=d.makeTooltipMarker("item",ha(g.color),s);var y=pl(u.formatTooltip(f,!0,null)),m=y.frag;if(m){var v=rP([u],i).get("valueFormatter");h.blocks.push(v?p({valueFormatter:v},m):m)}y.text&&c.push(y.text),l.push(g)}}))}}))})),
  13076. // In most cases, the second axis is displays upper on the first one.
  13077. // So we reverse it to look better.
  13078. u.blocks.reverse(),c.reverse();var h=e.position,f=r.get("order"),g=ou(u,d,s,f,n.get("useUTC"),r.get("textStyle"));g&&c.unshift(g);var y="richText"===s?"\n\n":"<br/>",m=c.join(y);this._showOrMove(r,(function(){this._updateContentNotChangedOnAxis(t,l)?this._updatePosition(r,h,o[0],o[1],this._tooltipContent,l):this._showTooltipContent(r,m,l,Math.random()+"",o[0],o[1],h,null,d)}))},n.prototype._showSeriesItemTooltip=function(t,e,n){var i=this._ecModel,o=ni(e),r=o.seriesIndex,a=i.getSeriesByIndex(r),s=o.dataModel||a,l=o.dataIndex,u=o.dataType,c=s.getData(u),d=this._renderMode,h=t.positionDefault,f=rP([c.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,h?{position:h}:null),g=f.get("trigger");if(null==g||"item"===g){var y=s.getDataParams(l,u),m=new uu;
  13079. // Pre-create marker style for makers. Users can assemble richText
  13080. // text in `formatter` callback and use those markers style.
  13081. y.marker=m.makeTooltipMarker("item",ha(y.color),d);var v=pl(s.formatTooltip(l,!1,u)),x=f.get("order"),_=f.get("valueFormatter"),b=v.frag,S=b?ou(_?p({valueFormatter:_},b):b,m,d,x,i.get("useUTC"),f.get("textStyle")):v.text,w="item_"+s.name+"_"+l;this._showOrMove(f,(function(){this._showTooltipContent(f,S,y,w,t.offsetX,t.offsetY,t.position,t.target,m)})),
  13082. // FIXME
  13083. // duplicated showtip if manuallyShowTip is called from dispatchAction.
  13084. n({type:"showTip",dataIndexInside:l,dataIndex:c.getRawIndex(l),seriesIndex:r,from:this.uid})}},n.prototype._showComponentItemTooltip=function(e,n,i){var o="html"===this._renderMode,r=ni(n),a=r.tooltipConfig.option||{},s=a.encodeHTMLContent;if(t(a)){a={content:a,
  13085. // Fixed formatter
  13086. formatter:a},
  13087. // when `tooltipConfig.option` is a string rather than an object,
  13088. // we can't know if the content needs to be encoded
  13089. // for the sake of security, encode it by default.
  13090. s=!0}s&&o&&a.content&&((
  13091. // clone might be unnecessary?
  13092. a=et(a)).content=ot(a.content));var l=[a],u=this._ecModel.getComponent(r.componentMainType,r.componentIndex);u&&l.push(u),
  13093. // In most cases, component tooltip formatter has different params with series tooltip formatter,
  13094. // so that they cannot share the same formatter. Since the global tooltip formatter is used for series
  13095. // by convention, we do not use it as the default formatter for component.
  13096. l.push({formatter:a.content});var c=e.positionDefault,d=rP(l,this._tooltipModel,c?{position:c}:null),h=d.get("content"),p=Math.random()+"",f=new uu;
  13097. // Do not check whether `trigger` is 'none' here, because `trigger`
  13098. // only works on coordinate system. In fact, we have not found case
  13099. // that requires setting `trigger` nothing on component yet.
  13100. this._showOrMove(d,(function(){
  13101. // Use formatterParams from element defined in component
  13102. // Avoid users modify it.
  13103. var t=et(d.get("formatterParams")||{});this._showTooltipContent(d,h,t,p,e.offsetX,e.offsetY,e.position,n,f)})),
  13104. // If not dispatch showTip, tip may be hide triggered by axis.
  13105. i({type:"showTip",from:this.uid})},n.prototype._showTooltipContent=function(
  13106. // Use Model<TooltipOption> insteadof TooltipModel because this model may be from series or other options.
  13107. // Instead of top level tooltip.
  13108. e,n,o,r,a,s,l,u,c){if(
  13109. // Reset ticket
  13110. this._ticket="",e.get("showContent")&&e.get("show")){var d=this._tooltipContent;d.setEnterable(e.get("enterable"));var h=e.get("formatter");l=l||e.get("position");var p=n,g=this._getNearestPoint([a,s],o,e.get("trigger"),e.get("borderColor")).color;if(h)if(t(h)){var y=e.ecModel.get("useUTC"),m=i(o)?o[0]:o;p=h,m&&m.axisType&&m.axisType.indexOf("time")>=0&&(p=Fr(m.axisValue,p,y)),p=ca(p,o,!0)}else if(f(h)){var v=lt((function(t,n){t===this._ticket&&(d.setContent(n,c,e,g,l),this._updatePosition(e,l,a,s,d,o,u))}),this);this._ticket=r,p=h(o,r,v)}else p=h;d.setContent(p,c,e,g,l),d.show(e,g),this._updatePosition(e,l,a,s,d,o,u)}},n.prototype._getNearestPoint=function(t,e,n,o){return"axis"===n||i(e)?{color:o||("html"===this._renderMode?"#fff":"none")}:i(e)?void 0:{color:o||e.color||e.borderColor}},n.prototype._updatePosition=function(e,n,r,
  13111. // Mouse x
  13112. a,
  13113. // Mouse y
  13114. s,l,u){var c=this._api.getWidth(),d=this._api.getHeight();n=n||e.get("position");var h=s.getSize(),p=e.get("align"),g=e.get("verticalAlign"),y=u&&u.getBoundingRect().clone();if(u&&y.applyTransform(u.transform),f(n)&&(
  13115. // Callback of position can be an array or a string specify the position
  13116. n=n([r,a],l,s.el,y,{viewSize:[c,d],contentSize:h.slice()})),i(n))r=je(n[0],c),a=je(n[1],d);else if(o(n)){var m=n;m.width=h[0],m.height=h[1];var v=xa(m,{width:c,height:d});r=v.x,a=v.y,p=null,
  13117. // When positionExpr is left/top/right/bottom,
  13118. // align and verticalAlign will not work.
  13119. g=null}
  13120. // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element
  13121. else if(t(n)&&u){var x=function(t,e,n,i){var o=n[0],r=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,c=e.height;switch(t){case"inside":s=e.x+u/2-o/2,l=e.y+c/2-r/2;break;case"top":s=e.x+u/2-o/2,l=e.y-r-a;break;case"bottom":s=e.x+u/2-o/2,l=e.y+c+a;break;case"left":s=e.x-o-a,l=e.y+c/2-r/2;break;case"right":s=e.x+u+a,l=e.y+c/2-r/2}return[s,l]}(n,y,h,e.get("borderWidth"));r=x[0],a=x[1]}else{x=function(t,e,n,i,o,r,a){var s=n.getSize(),l=s[0],u=s[1];null!=r&&(
  13122. // Add extra 2 pixels for this case:
  13123. // At present the "values" in default tooltip are using CSS `float: right`.
  13124. // When the right edge of the tooltip box is on the right side of the
  13125. // viewport, the `float` layout might push the "values" to the second line.
  13126. t+l+r+2>i?t-=l+r:t+=r);null!=a&&(e+u+a>o?e-=u+a:e+=a);return[t,e]}(r,a,s,c,d,p?null:20,g?null:20);r=x[0],a=x[1]}if(p&&(r-=sP(p)?h[0]/2:"right"===p?h[0]:0),g&&(a-=sP(g)?h[1]/2:"bottom"===g?h[1]:0),Gk(e)){x=function(t,e,n,i,o){var r=n.getSize(),a=r[0],s=r[1];return t=Math.min(t+a,i)-a,e=Math.min(e+s,o)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}(r,a,s,c,d);r=x[0],a=x[1]}s.moveTo(r,a)},
  13127. // FIXME
  13128. // Should we remove this but leave this to user?
  13129. n.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,i=this._cbParamsList,o=!!n&&n.length===t.length;return o&&a(n,(function(n,r){var s=n.dataByAxis||[],l=(t[r]||{}).dataByAxis||[];(o=o&&s.length===l.length)&&a(s,(function(t,n){var r=l[n]||{},s=t.seriesDataIndices||[],u=r.seriesDataIndices||[];(o=o&&t.value===r.value&&t.axisType===r.axisType&&t.axisId===r.axisId&&s.length===u.length)&&a(s,(function(t,e){var n=u[e];o=o&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})),
  13130. // check is cbParams data value changed
  13131. i&&a(t.seriesDataIndices,(function(t){var n=t.seriesIndex,r=e[n],a=i[n];r&&a&&a.data!==r.data&&(o=!1)}))}))})),this._lastDataByCoordSys=t,this._cbParamsList=e,!!o},n.prototype._hide=function(t){
  13132. // Do not directly hideLater here, because this behavior may be prevented
  13133. // in dispatchAction when showTip is dispatched.
  13134. // FIXME
  13135. // duplicated hideTip if manuallyHideTip is called from dispatchAction.
  13136. this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},n.prototype.dispose=function(t,e){!d.node&&e.getDom()&&(Gu(this,"_updatePosition"),this._tooltipContent.dispose(),FC("itemTooltip",e))},n.type="tooltip",n}(Mu);
  13137. /**
  13138. * From top to bottom. (the last one should be globalTooltipModel);
  13139. */
  13140. function rP(e,n,i){
  13141. // Last is always tooltip model.
  13142. var o,r=n.ecModel;i?(o=new yr(i,r,r),o=new yr(n.option,o,r)):o=n;for(var a=e.length-1;a>=0;a--){var s=e[a];s&&(s instanceof yr&&(s=s.get("tooltip",!0)),
  13143. // In each data item tooltip can be simply write:
  13144. // {
  13145. // value: 10,
  13146. // tooltip: 'Something you need to know'
  13147. // }
  13148. t(s)&&(s={formatter:s}),s&&(o=new yr(s,o,r)))}return o}function aP(t,e){return t.dispatchAction||lt(e.dispatchAction,e)}function sP(t){return"center"===t||"middle"===t}const lP=oP;var uP=["rect","polygon","keep","clear"];function cP(t,e){var n=Sn(t?t.brush:[]);if(n.length){var o=[];a(n,(function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(o=o.concat(e))}));var r=t&&t.toolbox;i(r)&&(r=r[0]),r||(r={feature:{}},t.toolbox=[r]);var s=r.feature||(r.feature={}),l=s.brush||(s.brush={}),u=l.type||(l.type=[]);u.push.apply(u,o),function(t){var e={};a(t,(function(t){e[t]=1})),t.length=0,a(e,(function(e,n){t.push(n)}))}(u),e&&!u.length&&u.push.apply(u,uP)}}var dP=a;function hP(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}function pP(t,e,n){var i={};return dP(e,(function(e){var o,r=i[e]=(
  13149. // Make sure hidden fields will not be visited by
  13150. // object iteration (with hasOwnProperty checking).
  13151. (o=function(){}).prototype.__hidden=o.prototype,new o);dP(t[e],(function(t,i){if(mb.isValidType(i)){var o={type:i,visual:t};n&&n(o,e),r[i]=new mb(o),
  13152. // Prepare a alpha for opacity, for some case that opacity
  13153. // is not supported, such as rendering using gradient color.
  13154. "opacity"===i&&((o=et(o)).type="colorAlpha",r.__hidden.__alphaForOpacity=new mb(o))}}))})),i}function fP(t,e,n){
  13155. // Visual attributes merge is not supported, otherwise it
  13156. // brings overcomplicated merge logic. See #2853. So if
  13157. // newOption has anyone of these keys, all of these keys
  13158. // will be reset. Otherwise, all keys remain.
  13159. var i;a(n,(function(t){e.hasOwnProperty(t)&&hP(e[t])&&(i=!0)})),i&&a(n,(function(n){e.hasOwnProperty(n)&&hP(e[n])?t[n]=et(e[n]):delete t[n]}))}
  13160. /**
  13161. * @param stateList
  13162. * @param visualMappings
  13163. * @param list
  13164. * @param getValueState param: valueOrIndex, return: state.
  13165. * @param scope Scope for getValueState
  13166. * @param dimension Concrete dimension, if used.
  13167. */
  13168. // ???! handle brush?
  13169. var gP={lineX:yP(0),lineY:yP(1),rect:{point:function(t,e,n){return t&&n.boundingRect.contain(t[0],t[1])},rect:function(t,e,n){return t&&n.boundingRect.intersect(t)}},polygon:{point:function(t,e,n){return t&&n.boundingRect.contain(t[0],t[1])&&Dt(n.range,t[0],t[1])},rect:function(t,e,n){var i=n.range;if(!t||i.length<=1)return!1;var o=t.x,r=t.y,a=t.width,s=t.height,l=i[0];return!!(Dt(i,o,r)||Dt(i,o+a,r)||Dt(i,o,r+s)||Dt(i,o+a,r+s)||Y.create(t).contain(l[0],l[1])||Oo(o,r,o+a,r,i)||Oo(o,r,o,r+s,i)||Oo(o+a,r,o+a,r+s,i)||Oo(o,r+s,o+a,r+s,i))||void 0}}};function yP(t){var e=["x","y"],n=["width","height"];return{point:function(e,n,i){if(e){var o=i.range;return mP(e[t],o)}},rect:function(i,o,r){if(i){var a=r.range,s=[i[e[t]],i[e[t]]+i[n[t]]];return s[1]<s[0]&&s.reverse(),mP(s[0],a)||mP(s[1],a)||mP(a[0],s)||mP(a[1],s)}}}}function mP(t,e){return e[0]<=t&&t<=e[1]}var vP=["inBrush","outOfBrush"],xP="__ecBrushSelect",_P="__ecInBrushSelectEvent";function bP(t){t.eachComponent({mainType:"brush"},(function(e){(e.brushTargetManager=new Lk(e.option,t)).setInputRanges(e.areas,t)}))}
  13170. /**
  13171. * Register the visual encoding if this modules required.
  13172. */function SP(t,e,o){var r,s,l=[];t.eachComponent({mainType:"brush"},(function(t){o&&"takeGlobalCursor"===o.type&&t.setBrushOption("brush"===o.key?o.brushOption:{brushType:!1})})),bP(t),t.eachComponent({mainType:"brush"},(function(e,o){var u={brushId:e.id,brushIndex:o,brushName:e.name,areas:et(e.areas),selected:[]};
  13173. // Every brush component exists in event params, convenient
  13174. // for user to find by index.
  13175. l.push(u);var d=e.option,h=d.brushLink,p=[],f=[],g=[],y=!1;o||(
  13176. // Only the first throttle setting works.
  13177. r=d.throttleType,s=d.throttleDelay);
  13178. // Add boundingRect and selectors to range.
  13179. var m=n(e.areas,(function(t){var e=IP[t.brushType],n=I({boundingRect:e?e(t):void 0},t);return n.selectors=function(t){var e=t.brushType,n={point:function(i){return gP[e].point(i,n,t)},rect:function(i){return gP[e].rect(i,n,t)}};
  13180. // Do not use function binding or curry for performance.
  13181. return n}(n),n})),v=pP(e.option,vP,(function(t){t.mappingMethod="fixed"}));function x(t){return"all"===h||!!p[t]}
  13182. // If no supported brush or no brush on the series,
  13183. // all visuals should be in original state.
  13184. function _(t){return!!t.length}
  13185. /**
  13186. * Logic for each series: (If the logic has to be modified one day, do it carefully!)
  13187. *
  13188. * ( brushed ┬ && ┬hasBrushExist ┬ && linkOthers ) => StepA: ┬record, ┬ StepB: ┬visualByRecord.
  13189. * !brushed┘ ├hasBrushExist ┤ └nothing,┘ ├visualByRecord.
  13190. * └!hasBrushExist┘ └nothing.
  13191. * ( !brushed && ┬hasBrushExist ┬ && linkOthers ) => StepA: nothing, StepB: ┬visualByRecord.
  13192. * └!hasBrushExist┘ └nothing.
  13193. * ( brushed ┬ && !linkOthers ) => StepA: nothing, StepB: ┬visualByCheck.
  13194. * !brushed┘ └nothing.
  13195. * ( !brushed && !linkOthers ) => StepA: nothing, StepB: nothing.
  13196. */
  13197. // Step A
  13198. i(h)&&a(h,(function(t){p[t]=1})),t.eachSeries((function(n,o){var r=g[o]=[];"parallel"===n.subType?function(t,e){var n=t.coordinateSystem;y=y||n.hasAxisBrushed(),x(e)&&n.eachActiveState(t.getData(),(function(t,e){"active"===t&&(f[e]=1)}))}(n,o):function(n,o,r){if(!n.brushSelector||function(t,e){var n=t.option.seriesIndex;return null!=n&&"all"!==n&&(i(n)?c(n,e)<0:e!==n)}(e,o))return;if(a(m,(function(i){e.brushTargetManager.controlSeries(i,n,t)&&r.push(i),y=y||_(r)})),x(o)&&_(r)){var s=n.getData();s.each((function(t){MP(n,r,s,t)&&(f[t]=1)}))}}
  13199. // Step B
  13200. (n,o,r)})),t.eachSeries((function(t,e){var n={seriesId:t.id,seriesIndex:e,seriesName:t.name,dataIndex:[]};
  13201. // Every series exists in event params, convenient
  13202. // for user to find series by seriesIndex.
  13203. u.selected.push(n);var i=g[e],o=t.getData(),r=x(e)?function(t){return f[t]?(n.dataIndex.push(o.getRawIndex(t)),"inBrush"):"outOfBrush"}:function(e){return MP(t,i,o,e)?(n.dataIndex.push(o.getRawIndex(e)),"inBrush"):"outOfBrush"};
  13204. // If no supported brush or no brush, all visuals are in original state.
  13205. (x(e)?y:_(i))&&function(t,e,n,i,o,r){var s,l={};function u(t){return Dc(n,s,t)}function c(t,e){Cc(n,s,t,e)}function d(t,a){s=null==r?t:a;var d=n.getRawDataItem(s);
  13206. // Consider performance
  13207. // @ts-ignore
  13208. if(!d||!1!==d.visualMap)for(var h=i.call(o,t),p=e[h],f=l[h],g=0,y=f.length;g<y;g++){var m=f[g];p[m]&&p[m].applyVisual(t,u,c)}}a(t,(function(t){var n=mb.prepareVisualTypes(e[t]);l[t]=n})),null==r?n.each(d):n.each([r],d)}
  13209. /**
  13210. * @param data
  13211. * @param stateList
  13212. * @param visualMappings <state, Object.<visualType, module:echarts/visual/VisualMapping>>
  13213. * @param getValueState param: valueOrIndex, return: state.
  13214. * @param dim dimension or dimension index.
  13215. */(vP,v,o,r)}))})),function(t,e,n,i,o){
  13216. // This event will not be triggered when `setOpion`, otherwise dead lock may
  13217. // triggered when do `setOption` in event listener, which we do not find
  13218. // satisfactory way to solve yet. Some considered resolutions:
  13219. // (a) Diff with prevoius selected data ant only trigger event when changed.
  13220. // But store previous data and diff precisely (i.e., not only by dataIndex, but
  13221. // also detect value changes in selected data) might bring complexity or fragility.
  13222. // (b) Use spectial param like `silent` to suppress event triggering.
  13223. // But such kind of volatile param may be weird in `setOption`.
  13224. if(!o)return;var r=t.getZr();if(r[_P])return;r[xP]||(r[xP]=wP);var a=Bu(r,xP,n,e);a(t,i)}(e,r,s,l,o)}function wP(t,e){if(!t.isDisposed()){var n=t.getZr();n[_P]=!0,t.dispatchAction({type:"brushSelect",batch:e}),n[_P]=!1}}function MP(t,e,n,i){for(var o=0,r=e.length;o<r;o++){var a=e[o];if(t.brushSelector(i,n,a.selectors,a))return!0}}var IP={rect:function(t){return DP(t.range)},polygon:function(t){for(var e,n=t.range,i=0,o=n.length;i<o;i++){e=e||[[Infinity,-Infinity],[Infinity,-Infinity]];var r=n[i];r[0]<e[0][0]&&(e[0][0]=r[0]),r[0]>e[0][1]&&(e[0][1]=r[0]),r[1]<e[1][0]&&(e[1][0]=r[1]),r[1]>e[1][1]&&(e[1][1]=r[1])}return e&&DP(e)}};function DP(t){return new Y(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}const TP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new DM(e.getZr())).on("brush",lt(this._onBrush,this)).mount()},e.prototype.render=function(t,e,n,i){this.model=t,this._updateController(t,e,n,i)},e.prototype.updateTransform=function(t,e,n,i){
  13225. // PENDING: `updateTransform` is a little tricky, whose layout need
  13226. // to be calculate mandatorily and other stages will not be performed.
  13227. // Take care the correctness of the logic. See #11754 .
  13228. bP(e),this._updateController(t,e,n,i)},e.prototype.updateVisual=function(t,e,n,i){this.updateTransform(t,e,n,i)},e.prototype.updateView=function(t,e,n,i){this._updateController(t,e,n,i)},e.prototype._updateController=function(t,e,n,i){
  13229. // Do not update controller when drawing.
  13230. (!i||i.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(n)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},
  13231. // updateLayout: updateController,
  13232. // updateVisual: updateController,
  13233. e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var e=this.model.id,n=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);
  13234. // Action is not dispatched on drag end, because the drag end
  13235. // emits the same params with the last drag move event, and
  13236. // may have some delay when using touch pad, which makes
  13237. // animation not smooth (when using debounce).
  13238. (!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:e,areas:et(n),$from:e}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:e,areas:et(n),$from:e})},e.type="brush",e}(Mu);function CP(t,e){return tt({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new yr(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}const AP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,
  13239. /**
  13240. * @readOnly
  13241. */
  13242. n.areas=[],
  13243. /**
  13244. * Current brush painting area settings.
  13245. * @readOnly
  13246. */
  13247. n.brushOption={},n}return Ue(e,t),e.prototype.optionUpdated=function(t,e){var n=this.option;!e&&fP(n,t,["inBrush","outOfBrush"]);var i=n.inBrush=n.inBrush||{};
  13248. // Always give default visual, consider setOption at the second time.
  13249. n.outOfBrush=n.outOfBrush||{color:"#ddd"},i.hasOwnProperty("liftZ")||(
  13250. // Bigger than the highlight z lift, otherwise it will
  13251. // be effected by the highlight z when brush.
  13252. i.liftZ=5)},
  13253. /**
  13254. * If `areas` is null/undefined, range state remain.
  13255. */
  13256. e.prototype.setAreas=function(t){
  13257. // If areas is null/undefined, range state remain.
  13258. // This helps user to dispatchAction({type: 'brush'}) with no areas
  13259. // set but just want to get the current brush select info from a `brush` event.
  13260. t&&(this.areas=n(t,(function(t){return CP(this.option,t)}),this))},
  13261. /**
  13262. * Set the current painting brush option.
  13263. */
  13264. e.prototype.setBrushOption=function(t){this.brushOption=CP(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(Ta);var LP=["rect","polygon","lineX","lineY","keep","clear"];const kP=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.render=function(t,e,n){var i,o,r;e.eachComponent({mainType:"brush"},(function(t){i=t.brushType,o=t.brushOption.brushMode||"single",r=r||!!t.areas.length})),this._brushType=i,this._brushMode=o,a(t.get("type",!0),(function(e){t.setIconStatus(e,("keep"===e?"multiple"===o:"clear"===e?r:e===i)?"emphasis":"normal")}))},e.prototype.updateView=function(t,e,n){this.render(t,e,n)},e.prototype.getIcons=function(){var t=this.model,e=t.get("icon",!0),n={};return a(t.get("type",!0),(function(t){e[t]&&(n[t]=e[t])})),n},e.prototype.onclick=function(t,e,n){var i=this._brushType,o=this._brushMode;"clear"===n?(
  13265. // Trigger parallel action firstly
  13266. e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",
  13267. // Clear all areas of all brush components.
  13268. areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?i:i!==n&&n,brushMode:"keep"===n?"multiple"===o?"single":"multiple":o}})},e.getDefaultOption=function(t){return{show:!0,type:LP.slice(),icon:{
  13269. /* eslint-disable */
  13270. rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},
  13271. // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear`
  13272. title:t.getLocaleModel().get(["toolbox","brush","title"])}},e}(UL);var PP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode={type:"box",ignoreSize:!0},n}return Ue(e,t),e.type="title",e.defaultOption={
  13273. // zlevel: 0,
  13274. z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(Ta),NP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var i=this.group,o=t.getModel("textStyle"),r=t.getModel("subtextStyle"),a=t.get("textAlign"),s=x(t.get("textBaseline"),t.get("textVerticalAlign")),l=new $({style:Zo(o,{text:t.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),c=t.get("subtext"),d=new $({style:Zo(r,{text:c,fill:r.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),h=t.get("link"),p=t.get("sublink"),f=t.get("triggerEvent",!0);l.silent=!h&&!f,d.silent=!p&&!f,h&&l.on("click",(function(){pa(h,"_"+t.get("target"))})),p&&d.on("click",(function(){pa(p,"_"+t.get("subtarget"))})),ni(l).eventData=ni(d).eventData=f?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(l),c&&i.add(d);
  13275. // If no subText, but add subTextEl, there will be an empty line.
  13276. var g=i.getBoundingRect(),y=t.getBoxLayoutParams();y.width=g.width,y.height=g.height;var m=xa(y,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));
  13277. // Adjust text align based on position
  13278. a||(
  13279. // Align left if title is on the left. center and right is same
  13280. // @ts-ignore
  13281. "middle"===(a=t.get("left")||t.get("right"))&&(a="center"),
  13282. // Adjust layout by text align
  13283. "right"===a?m.x+=m.width:"center"===a&&(m.x+=m.width/2)),s||(
  13284. // @ts-ignore
  13285. "center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?m.y+=m.height:"middle"===s&&(m.y+=m.height/2),s=s||"top"),i.x=m.x,i.y=m.y,i.markRedraw();var v={align:a,verticalAlign:s};l.setStyle(v),d.setStyle(v),
  13286. // Render background
  13287. // Get groupRect again because textAlign has been changed
  13288. g=i.getBoundingRect();var _=m.margin,b=t.getItemStyle(["color","opacity"]);b.fill=t.get("backgroundColor");var S=new G({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:t.get("borderRadius")},style:b,subPixelOptimize:!0,silent:!0});i.add(S)}},e.type="title",e}(Mu);
  13289. // View
  13290. var OP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode="box",n}
  13291. /**
  13292. * @override
  13293. */return Ue(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),this._initData()},
  13294. /**
  13295. * @override
  13296. */
  13297. e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(t>=e&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},
  13298. /**
  13299. * @return {number} currentIndex
  13300. */
  13301. e.prototype.getCurrentIndex=function(){return this.option.currentIndex},
  13302. /**
  13303. * @return {boolean}
  13304. */
  13305. e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},
  13306. /**
  13307. * @param {boolean} state true: play, false: stop
  13308. */
  13309. e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},
  13310. /**
  13311. * @return {boolean} true: play, false: stop
  13312. */
  13313. e.prototype.getPlayState=function(){return!!this.option.autoPlay},
  13314. /**
  13315. * @private
  13316. */
  13317. e.prototype._initData=function(){var t,e=this.option,n=e.data||[],i=e.axisType,r=this._names=[];"category"===i?(t=[],a(n,(function(e,n){var i,a=Ln(In(e),"");o(e)?(i=et(e)).value=n:i=n,t.push(i),r.push(a)}))):t=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number";(this._data=new Fh([{name:"value",type:s}],this)).initData(t,r)},e.prototype.getData=function(){return this._data},
  13318. /**
  13319. * @public
  13320. * @return {Array.<string>} categoreis
  13321. */
  13322. e.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},e.type="timeline",
  13323. /**
  13324. * @protected
  13325. */
  13326. e.defaultOption={
  13327. // zlevel: 0, // 一级层叠
  13328. z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(Ta);const RP=OP;var EP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="timeline.slider",
  13329. /**
  13330. * @protected
  13331. */
  13332. e.defaultOption=xr(RP.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",
  13333. // When using number, label position is not
  13334. // restricted by viewRect.
  13335. // positive: right/bottom, negative: left/top
  13336. show:!0,interval:"auto",rotate:0,
  13337. // formatter: null,
  13338. // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  13339. color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",
  13340. // borderColor: 'rgba(194,53,49, 0.5)',
  13341. animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",
  13342. // eslint-disable-next-line max-len
  13343. nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",
  13344. // eslint-disable-next-line max-len
  13345. prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,
  13346. // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  13347. color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(RP);nt(EP,hl.prototype);const VP=EP;const zP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="timeline",e}(Mu);
  13348. /**
  13349. * Extend axis 2d
  13350. */var BP=/** @class */function(t){function e(e,n,i,o){var r=t.call(this,e,n,i)||this;return r.type=o||"value",r}
  13351. /**
  13352. * @override
  13353. */return Ue(e,t),e.prototype.getLabelModel=function(){
  13354. // Force override
  13355. return this.model.getModel("label")},
  13356. /**
  13357. * @override
  13358. */
  13359. e.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},e}(Yf);const GP=BP;var FP=Math.PI,WP=On(),HP=/** @class */function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=n.type,t}return Ue(n,e),n.prototype.init=function(t,e){this.api=e},
  13360. /**
  13361. * @override
  13362. */
  13363. n.prototype.render=function(t,e,n){if(this.model=t,this.api=n,this.ecModel=e,this.group.removeAll(),t.get("show",!0)){var i=this._layout(t,n),o=this._createGroup("_mainGroup"),r=this._createGroup("_labelGroup"),s=this._axis=this._createAxis(i,t);t.formatTooltip=function(t){return $l("nameValue",{noName:!0,value:s.scale.getLabel({value:t})})},a(["AxisLine","AxisTick","Control","CurrentPointer"],(function(e){this["_render"+e](i,o,s,t)}),this),this._renderAxisLabel(i,r,s,t),this._position(i,t)}this._doPlayStop(),this._updateTicksStatus()},
  13364. /**
  13365. * @override
  13366. */
  13367. n.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},
  13368. /**
  13369. * @override
  13370. */
  13371. n.prototype.dispose=function(){this._clearTimer()},n.prototype._layout=function(e,n){var i,o,r,a,s=e.get(["label","position"]),l=e.get("orient"),u=function(t,e){return xa(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()},t.get("padding"))}(e,n),c={horizontal:"center",vertical:(
  13372. // Auto label offset.
  13373. i=null==s||"auto"===s?"horizontal"===l?u.y+u.height/2<n.getHeight()/2?"-":"+":u.x+u.width/2<n.getWidth()/2?"+":"-":t(s)?{horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[l][s]:s)>=0||"+"===i?"left":"right"},d={horizontal:i>=0||"+"===i?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:FP/2},p="vertical"===l?u.height:u.width,f=e.getModel("controlStyle"),g=f.get("show",!0),y=g?f.get("itemSize"):0,m=g?f.get("itemGap"):0,v=y+m,x=e.get(["label","rotate"])||0;x=x*FP/180;var _=f.get("position",!0),b=g&&f.get("showPlayBtn",!0),S=g&&f.get("showPrevBtn",!0),w=g&&f.get("showNextBtn",!0),M=0,I=p;
  13374. // position[0] means left, position[1] means middle.
  13375. "left"===_||"bottom"===_?(b&&(o=[0,0],M+=v),S&&(r=[M,0],M+=v),w&&(a=[I-y,0],I-=v)):(
  13376. // 'top' 'right'
  13377. b&&(o=[I-y,0],I-=v),S&&(r=[0,0],M+=v),w&&(a=[I-y,0],I-=v));var D=[M,I];return e.get("inverse")&&D.reverse(),{viewRect:u,mainLength:p,orient:l,rotation:h[l],labelRotation:x,labelPosOpt:i,labelAlign:e.get(["label","align"])||c[l],labelBaseline:e.get(["label","verticalAlign"])||e.get(["label","baseline"])||d[l],
  13378. // Based on mainGroup.
  13379. playPosition:o,prevBtnPosition:r,nextBtnPosition:a,axisExtent:D,controlSize:y,controlGap:m}},n.prototype._position=function(e,n){
  13380. // Position is be called finally, because bounding rect is needed for
  13381. // adapt content to fill viewRect (auto adapt offset).
  13382. // Timeline may be not all in the viewRect when 'offset' is specified
  13383. // as a number, because it is more appropriate that label aligns at
  13384. // 'offset' but not the other edge defined by viewRect.
  13385. var i=this._mainGroup,o=this._labelGroup,r=e.viewRect;if("vertical"===e.orient){
  13386. // transform to horizontal, inverse rotate by left-top point.
  13387. var a=te(),s=r.x,l=r.y+r.height;oe(a,a,[-s,-l]),Ut(a,a,-FP/2),oe(a,a,[s,l]),(r=r.clone()).applyTransform(a)}var u=m(r),c=m(i.getBoundingRect()),d=m(o.getBoundingRect()),h=[i.x,i.y],p=[o.x,o.y];p[0]=h[0]=u[0][0];var f,g=e.labelPosOpt;null==g||t(g)?(v(h,c,u,1,f="+"===g?0:1),v(p,d,u,1,1-f)):(v(h,c,u,1,f=g>=0?0:1),p[1]=h[1]+g);function y(t){t.originX=u[0][0]-t.x,t.originY=u[1][0]-t.y}function m(t){
  13388. // [[xmin, xmax], [ymin, ymax]]
  13389. return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function v(t,e,n,i,o){t[i]+=n[i][o]-e[i][o]}i.setPosition(h),o.setPosition(p),i.rotation=o.rotation=e.rotation,y(i),y(o)},n.prototype._createAxis=function(t,e){var n=e.getData(),i=e.get("axisType"),o=function(t,e){if(e=e||t.get("type"),e)switch(e){
  13390. // Buildin scale
  13391. case"category":return new pp({ordinalMeta:t.getCategories(),extent:[Infinity,-Infinity]});case"time":return new zp({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:
  13392. // default to be value
  13393. return new yp}}(e,i);
  13394. // Customize scale. The `tickValue` is `dataIndex`.
  13395. o.getTicks=function(){return n.mapArray(["value"],(function(t){return{value:t}}))};var r=n.getDataExtent("value");o.setExtent(r[0],r[1]),o.calcNiceTicks();var a=new GP("value",o,t.axisExtent,i);return a.model=e,a},n.prototype._createGroup=function(t){var e=this[t]=new Z;return this.group.add(e),e},n.prototype._renderAxisLine=function(t,e,n,i){var o=n.getExtent();if(i.get(["lineStyle","show"])){var r=new F({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:p({lineCap:"round"},i.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});e.add(r);var a=this._progressLine=new F({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:I({lineCap:"round",lineWidth:r.style.lineWidth},i.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});e.add(a)}},n.prototype._renderAxisTick=function(t,e,n,i){var o=this,r=i.getData(),s=n.scale.getTicks();this._tickSymbols=[],
  13396. // The value is dataIndex, see the customized scale.
  13397. a(s,(function(t){var a=n.dataToCoord(t.value),s=r.getItemModel(t.value),l=s.getModel("itemStyle"),u=s.getModel(["emphasis","itemStyle"]),c=s.getModel(["progress","itemStyle"]),d={x:a,y:0,onclick:lt(o._changeTimeline,o,t.value)},h=YP(s,l,e,d);h.ensureState("emphasis").style=u.getItemStyle(),h.ensureState("progress").style=c.getItemStyle(),Yi(h);var p=ni(h);s.get("tooltip")?(p.dataIndex=t.value,p.dataModel=i):p.dataIndex=p.dataModel=null,o._tickSymbols.push(h)}))},n.prototype._renderAxisLabel=function(t,e,n,i){var o=this;if(n.getLabelModel().get("show")){var r=i.getData(),s=n.getViewLabels();this._tickLabels=[],a(s,(function(i){
  13398. // The tickValue is dataIndex, see the customized scale.
  13399. var a=i.tickValue,s=r.getItemModel(a),l=s.getModel("label"),u=s.getModel(["emphasis","label"]),c=s.getModel(["progress","label"]),d=n.dataToCoord(i.tickValue),h=new $({x:d,y:0,rotation:t.labelRotation-t.rotation,onclick:lt(o._changeTimeline,o,a),silent:!1,style:Zo(l,{text:i.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});h.ensureState("emphasis").style=Zo(u),h.ensureState("progress").style=Zo(c),e.add(h),Yi(h),WP(h).dataIndex=a,o._tickLabels.push(h)}))}},n.prototype._renderControl=function(t,e,n,i){var o=t.controlSize,r=t.rotation,a=i.getModel("controlStyle").getItemStyle(),s=i.getModel(["emphasis","controlStyle"]).getItemStyle(),l=i.getPlayState(),u=i.get("inverse",!0);function c(t,n,l,u){if(t){var c=Mt(x(i.get(["controlStyle",n+"BtnSize"]),o),o),d=function(t,e,n,i){var o=i.style,r=No(t.get(["controlStyle",e]),i||{},new Y(n[0],n[1],n[2],n[3]));
  13400. // TODO createIcon won't use style in opt.
  13401. o&&r.setStyle(o);return r}
  13402. /**
  13403. * Create symbol or update symbol
  13404. * opt: basic position and event handlers
  13405. */(i,n+"Icon",[0,-c/2,c,c],{x:t[0],y:t[1],originX:o/2,originY:0,rotation:u?-r:0,rectHover:!0,style:a,onclick:l});d.ensureState("emphasis").style=s,e.add(d),Yi(d)}}c(t.nextBtnPosition,"next",lt(this._changeTimeline,this,u?"-":"+")),c(t.prevBtnPosition,"prev",lt(this._changeTimeline,this,u?"+":"-")),c(t.playPosition,l?"stop":"play",lt(this._handlePlayClick,this,!l),!0)},n.prototype._renderCurrentPointer=function(t,e,n,i){var o=i.getData(),r=i.getCurrentIndex(),a=o.getItemModel(r).getModel("checkpointStyle"),s=this,l={onCreate:function(t){t.draggable=!0,t.drift=lt(s._handlePointerDrag,s),t.ondragend=lt(s._handlePointerDragend,s),UP(t,s._progressLine,r,n,i,!0)},onUpdate:function(t){UP(t,s._progressLine,r,n,i)}};
  13406. // Reuse when exists, for animation and drag.
  13407. this._currentPointer=YP(a,a,this._mainGroup,{},this._currentPointer,l)},n.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},n.prototype._handlePointerDrag=function(t,e,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},n.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},n.prototype._pointerChangeTimeline=function(t,e){var n=this._toAxisCoord(t)[0],i=Ke(this._axis.getExtent().slice());n>i[1]&&(n=i[1]),n<i[0]&&(n=i[0]),this._currentPointer.x=n,this._currentPointer.markRedraw();var o=this._progressLine;o&&(o.shape.x2=n,o.dirty());var r=this._findNearestTick(n),a=this.model;(e||r!==a.getCurrentIndex()&&a.get("realtime"))&&this._changeTimeline(r)},n.prototype._doPlayStop=function(){var t=this;this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout((function(){
  13408. // Do not cache
  13409. var e=t.model;t._changeTimeline(e.getCurrentIndex()+(e.get("rewind",!0)?-1:1))}),this.model.get("playInterval")))},n.prototype._toAxisCoord=function(t){return To(t,this._mainGroup.getLocalTransform(),!0)},n.prototype._findNearestTick=function(t){var e,n=this.model.getData(),i=Infinity,o=this._axis;return n.each(["value"],(function(n,r){var a=o.dataToCoord(n),s=Math.abs(a-t);s<i&&(i=s,e=r)})),e},n.prototype._clearTimer=function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},n.prototype._changeTimeline=function(t){var e=this.model.getCurrentIndex();"+"===t?t=e+1:"-"===t&&(t=e-1),this.api.dispatchAction({type:"timelineChange",currentIndex:t,from:this.uid})},n.prototype._updateTicksStatus=function(){var t=this.model.getCurrentIndex(),e=this._tickSymbols,n=this._tickLabels;if(e)for(var i=0;i<e.length;i++)e&&e[i]&&e[i].toggleState("progress",i<t);if(n)for(i=0;i<n.length;i++)n&&n[i]&&n[i].toggleState("progress",WP(n[i]).dataIndex<=t)},n.type="timeline.slider",n}(zP);function YP(t,e,n,i,o,r){var a=e.get("color");o?(o.setColor(a),n.add(o),// Group may be new, also need to add.
  13410. r&&r.onUpdate(o)):((o=Gc(t.get("symbol"),-1,-1,2,2,a)).setStyle("strokeNoScale",!0),n.add(o),r&&r.onCreate(o));
  13411. // Style
  13412. var s=e.getItemStyle(["color"]);o.setStyle(s),
  13413. // Transform and events.
  13414. i=tt({rectHover:!0,z2:100},i,!0);var l=Fc(t.get("symbolSize"));i.scaleX=l[0]/2,i.scaleY=l[1]/2;var u=Wc(t.get("symbolOffset"),l);u&&(i.x=(i.x||0)+u[0],i.y=(i.y||0)+u[1]);var c=t.get("symbolRotate");return i.rotation=(c||0)*Math.PI/180||0,o.attr(i),
  13415. // FIXME
  13416. // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed,
  13417. // getBoundingRect will return wrong result.
  13418. // (This is supposed to be resolved in zrender, but it is a little difficult to
  13419. // leverage performance and auto updateTransform)
  13420. // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol.
  13421. o.updateTransform(),o}function UP(t,e,n,i,o,r){if(!t.dragging){var a=o.getModel("checkpointStyle"),s=i.dataToCoord(o.getData().get("value",n));if(r||!a.get("animation",!0))t.attr({x:s,y:0}),e&&e.attr({shape:{x2:s}});else{var l={duration:a.get("animationDuration",!0),easing:a.get("animationEasing",!0)};t.stopAnimation(null,!0),t.animateTo({x:s,y:0},l),e&&e.animateTo({shape:{x2:s}},l)}}}const ZP=HP;function XP(t){var e=t&&t.timeline;i(e)||(e=e?[e]:[]),a(e,(function(t){t&&function(t){var e=t.type,n={number:"value",time:"time"};
  13422. // Compatible with ec2
  13423. n[e]&&(t.axisType=n[e],delete t.type);if(jP(t),qP(t,"controlPosition")){var r=t.controlStyle||(t.controlStyle={});qP(r,"position")||(r.position=t.controlPosition),"none"!==r.position||qP(r,"show")||(r.show=!1,delete r.position),delete t.controlPosition}a(t.data||[],(function(t){o(t)&&!i(t)&&(!qP(t,"value")&&qP(t,"name")&&(
  13424. // In ec2, using name as value.
  13425. t.value=t.name),jP(t))}))}(t)}))}function jP(t){var e=t.itemStyle||(t.itemStyle={}),n=e.emphasis||(e.emphasis={}),i=t.label||t.label||{},o=i.normal||(i.normal={}),r={normal:1,emphasis:1};a(i,(function(t,e){r[e]||qP(o,e)||(o[e]=t)})),n.label&&!qP(i,"emphasis")&&(i.emphasis=n.label,delete n.label)}function qP(t,e){return t.hasOwnProperty(e)}function KP(t,e){if(!t)return!1;for(var n=i(t)?t:[t],o=0;o<n.length;o++)if(n[o]&&n[o][e])return!0;return!1}function JP(t){wn(t,"label",["show"])}
  13426. // { [componentType]: MarkerModel }
  13427. var $P=On(),QP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,
  13428. /**
  13429. * If marker model is created by self from series
  13430. */
  13431. n.createdBySelf=!1,n}
  13432. /**
  13433. * @overrite
  13434. */return Ue(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),this._mergeOption(t,n,!1,!0)},e.prototype.isAnimationEnabled=function(){if(d.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},
  13435. /**
  13436. * @overrite
  13437. */
  13438. e.prototype.mergeOption=function(t,e){this._mergeOption(t,e,!1,!1)},e.prototype._mergeOption=function(t,e,n,i){var o=this.mainType;n||e.eachSeries((function(t){
  13439. // mainType can be markPoint, markLine, markArea
  13440. var n=t.get(this.mainType,!0),r=$P(t)[o];n&&n.data?(r?r._mergeOption(n,e,!0):(i&&
  13441. // Default label emphasis `position` and `show`
  13442. JP(n),a(n.data,(function(t){
  13443. // FIXME Overwrite fillLabel method ?
  13444. t instanceof Array?(JP(t[0]),JP(t[1])):JP(t)})),r=this.createMarkerModelFromSeries(n,this,e),
  13445. // markerModel = new ImplementedMarkerModel(
  13446. // markerOpt, this, ecModel
  13447. // );
  13448. p(r,{mainType:this.mainType,
  13449. // Use the same series index and name
  13450. seriesIndex:t.seriesIndex,name:t.name,createdBySelf:!0}),r.__hostSeries=t),$P(t)[o]=r):$P(t)[o]=null}),this)},e.prototype.formatTooltip=function(t,e,n){var i=this.getData(),o=this.getRawValue(t),r=i.getName(t);return $l("section",{header:this.name,blocks:[$l("nameValue",{name:r,value:o,noName:!r,noValue:null==o})]})},e.prototype.getData=function(){return this._data},e.prototype.setData=function(t){this._data=t},e.prototype.getDataParams=function(t,e){var n=hl.prototype.getDataParams.call(this,t,e),i=this.__hostSeries;return i&&(n.seriesId=i.id,n.seriesName=i.name,n.seriesType=i.subType),n},e.getMarkerModelFromSeries=function(t,
  13451. // Support three types of markers. Strict check.
  13452. e){return $P(t)[e]},e.type="marker",e.dependencies=["series","grid","polar","geo"],e}(Ta);nt(QP,hl.prototype);const tN=QP;const eN=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markPoint",e.defaultOption={
  13453. // zlevel: 0,
  13454. z:5,symbol:"pin",symbolSize:50,
  13455. // symbolRotate: 0,
  13456. // symbolOffset: [0, 0]
  13457. tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},e}(tN);function nN(t){return!(isNaN(parseFloat(t.x))&&isNaN(parseFloat(t.y)))}function iN(t,e,n,i,o,r){var a=[],s=qh(e,i/* , otherDataDim */)?e.getCalculationInfo("stackResultDimension"):i,l=uN(e,s,t),u=e.indicesOfNearest(s,l)[0];a[o]=e.get(n,u),a[r]=e.get(s,u);var c=e.get(i,u),d=Je(e.get(i,u));
  13458. // Make it simple, do not visit all stacked value to count precision.
  13459. return(d=Math.min(d,20))>=0&&(a[r]=+a[r].toFixed(d)),[a,c]}
  13460. // TODO Specified percent
  13461. var oN={min:rt(iN,"min"),max:rt(iN,"max"),average:rt(iN,"average"),median:rt(iN,"median")};
  13462. /**
  13463. * Transform markPoint data item to format used in List by do the following
  13464. * 1. Calculate statistic like `max`, `min`, `average`
  13465. * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array
  13466. */function rN(t,e){if(e){var n=t.getData(),o=t.coordinateSystem,r=o&&o.dimensions;
  13467. // 1. If not specify the position with pixel directly
  13468. // 2. If `coord` is not a data array. Which uses `xAxis`,
  13469. // `yAxis` to specify the coord on each dimension
  13470. // parseFloat first because item.x and item.y can be percent string like '20%'
  13471. if(!function(t){return!isNaN(parseFloat(t.x))&&!isNaN(parseFloat(t.y))}(e)&&!i(e.coord)&&i(r)){var a=aN(e,n,o,t);
  13472. // Clone the option
  13473. // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value
  13474. if((e=et(e)).type&&oN[e.type]&&a.baseAxis&&a.valueAxis){var s=c(r,a.baseAxis.dim),l=c(r,a.valueAxis.dim),u=oN[e.type](n,a.baseDataDim,a.valueDataDim,s,l);e.coord=u[0],
  13475. // Force to use the value of calculated value.
  13476. // let item use the value without stack.
  13477. e.value=u[1]}else
  13478. // FIXME Only has one of xAxis and yAxis.
  13479. e.coord=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis]}
  13480. // x y is provided
  13481. if(null!=e.coord&&i(r))for(
  13482. // Each coord support max, min, average
  13483. var d=e.coord,h=0;h<2;h++)oN[d[h]]&&(d[h]=uN(n,n.mapDimension(r[h]),d[h]));else e.coord=[];return e}}function aN(t,e,n,i){var o={};return null!=t.valueIndex||null!=t.valueDim?(o.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,o.valueAxis=n.getAxis(function(t,e){var n=t.getData().getDimensionInfo(e);return n&&n.coordDim}
  13484. /**
  13485. * Filter data which is out of coordinateSystem range
  13486. * [dataFilter description]
  13487. */(i,o.valueDataDim)),o.baseAxis=n.getOtherAxis(o.valueAxis),o.baseDataDim=e.mapDimension(o.baseAxis.dim)):(o.baseAxis=i.getBaseAxis(),o.valueAxis=n.getOtherAxis(o.baseAxis),o.baseDataDim=e.mapDimension(o.baseAxis.dim),o.valueDataDim=e.mapDimension(o.valueAxis.dim)),o}function sN(
  13488. // Currently only polar and cartesian has containData.
  13489. t,e){
  13490. // Always return true if there is no coordSys
  13491. return!(t&&t.containData&&e.coord&&!nN(e))||t.containData(e.coord)}function lN(t,e){return t?function(t,n,i,o){return ml(o<2?t.coord&&t.coord[o]:t.value,e[o])}:function(t,n,i,o){return ml(t.value,e[o])}}function uN(t,e,n){if("average"===n){var i=0,o=0;return t.each(e,(function(t,e){isNaN(t)||(i+=t,o++)})),i/o}return"median"===n?t.getMedian(e):t.getDataExtent(e)["max"===n?1:0]}var cN=On();const dN=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(){this.markerGroupMap=r()},e.prototype.render=function(t,e,n){var i=this,o=this.markerGroupMap;o.each((function(t){cN(t).keep=!1})),e.eachSeries((function(t){var o=tN.getMarkerModelFromSeries(t,i.type);o&&i.renderSeries(t,o,e,n)})),o.each((function(t){!cN(t).keep&&i.group.remove(t.group)}))},e.prototype.markKeep=function(t){cN(t).keep=!0},e.prototype.toggleBlurSeries=function(t,e){var n=this;a(t,(function(t){var i=tN.getMarkerModelFromSeries(t,n.type);i&&i.getData().eachItemGraphicEl((function(t){t&&(e?Ni(t):Oi(t))}))}))},e.type="marker",e}(Mu);function hN(t,e,n){var i=e.coordinateSystem;t.each((function(o){var r,a=t.getItemModel(o),s=je(a.get("x"),n.getWidth()),l=je(a.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(e.getMarkerPosition)
  13492. // Use the getMarkerPosition
  13493. r=e.getMarkerPosition(t.getValues(t.dimensions,o));else if(i){var u=t.get(i.dimensions[0],o),c=t.get(i.dimensions[1],o);r=i.dataToPoint([u,c])}
  13494. // Use x, y if has any
  13495. }else r=[s,l];isNaN(s)||(r[0]=s),isNaN(l)||(r[1]=l),t.setItemLayout(o,r)}))}var pN=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=tN.getMarkerModelFromSeries(t,"markPoint");e&&(hN(e.getData(),t,n),this.markerGroupMap.get(t.id).updateLayout())}),this)},e.prototype.renderSeries=function(t,e,i,o){var r=t.coordinateSystem,a=t.id,s=t.getData(),l=this.markerGroupMap,u=l.get(a)||l.set(a,new Yg),c=function(t,e,i){var o;o=t?n(t&&t.dimensions,(function(t){var n=e.getData().getDimensionInfo(e.getData().mapDimension(t))||{};
  13496. // In map series data don't have lng and lat dimension. Fallback to same with coordSys
  13497. return p(p({},n),{name:t,
  13498. // DON'T use ordinalMeta to parse and collect ordinal.
  13499. ordinalMeta:null})})):[{name:"value",type:"float"}];var r=new Fh(o,i),a=n(i.get("data"),rt(rN,e));t&&(a=st(a,rt(sN,t)));var s=lN(!!t,o);return r.initData(a,null,s),r}(r,t,e);
  13500. // FIXME
  13501. e.setData(c),hN(e.getData(),t,o),c.each((function(t){var n=c.getItemModel(t),i=n.getShallow("symbol"),o=n.getShallow("symbolSize"),r=n.getShallow("symbolRotate"),a=n.getShallow("symbolOffset"),l=n.getShallow("symbolKeepAspect");
  13502. // TODO: refactor needed: single data item should not support callback function
  13503. if(f(i)||f(o)||f(r)||f(a)){var u=e.getRawValue(t),d=e.getDataParams(t);f(i)&&(i=i(u,d)),f(o)&&(
  13504. // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据?
  13505. o=o(u,d)),f(r)&&(r=r(u,d)),f(a)&&(a=a(u,d))}var h=n.getModel("itemStyle").getItemStyle(),p=Tc(s,"color");h.fill||(h.fill=p),c.setItemVisual(t,{symbol:i,symbolSize:o,symbolRotate:r,symbolOffset:a,symbolKeepAspect:l,style:h})})),
  13506. // TODO Text are wrong
  13507. u.updateData(c),this.group.add(u.group),
  13508. // Set host model for tooltip
  13509. // FIXME
  13510. c.eachItemGraphicEl((function(t){t.traverse((function(t){ni(t).dataModel=e}))})),this.markKeep(u),u.group.silent=e.get("silent")||t.get("silent")},e.type="markPoint",e}(dN);const fN=pN;const gN=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markLine",e.defaultOption={
  13511. // zlevel: 0,
  13512. z:5,symbol:["circle","arrow"],symbolSize:[8,16],
  13513. // symbolRotate: 0,
  13514. symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(tN);var yN=On(),mN=function(t,e,n,o){var r,a=t.getData();if(i(o))r=o;else{
  13515. // Special type markLine like 'min', 'max', 'average', 'median'
  13516. var s=o.type;if("min"===s||"max"===s||"average"===s||"median"===s||null!=o.xAxis||null!=o.yAxis){var u=void 0,c=void 0;if(null!=o.yAxis||null!=o.xAxis)u=e.getAxis(null!=o.yAxis?"y":"x"),c=Yt(o.yAxis,o.xAxis);else{var d=aN(o,a,e,t);u=d.valueAxis,c=uN(a,Kh(a,d.valueDataDim),s)}var h="x"===u.dim?0:1,f=1-h,g=et(o),y={coord:[]};g.type=null,g.coord=[],g.coord[f]=-Infinity,y.coord[f]=Infinity;var m=n.get("precision");m>=0&&l(c)&&(c=+c.toFixed(Math.min(m,20))),g.coord[h]=y.coord[h]=c,r=[g,y,{type:s,valueIndex:o.valueIndex,
  13517. // Force to use the value of calculated value.
  13518. value:c}]}else r=[]}var v=[rN(t,r[0]),rN(t,r[1]),p({},r[2])];
  13519. // Avoid line data type is extended by from(to) data type
  13520. return v[2].type=v[2].type||null,
  13521. // Merge from option and to option into line option
  13522. tt(v[2],v[0]),tt(v[2],v[1]),v};function vN(t){return!isNaN(t)&&!isFinite(t)}
  13523. // If a markLine has one dim
  13524. function xN(t,e,n,i){var o=1-t,r=i.dimensions[t];return vN(e[o])&&vN(n[o])&&e[t]===n[t]&&i.getAxis(r).containData(e[t])}function _N(t,e){if("cartesian2d"===t.type){var n=e[0].coord,i=e[1].coord;
  13525. // In case
  13526. // {
  13527. // markLine: {
  13528. // data: [{ yAxis: 2 }]
  13529. // }
  13530. // }
  13531. if(n&&i&&(xN(1,n,i,t)||xN(0,n,i,t)))return!0}return sN(t,e[0])&&sN(t,e[1])}function bN(t,e,n,i,o){var r,a=i.coordinateSystem,s=t.getItemModel(e),l=je(s.get("x"),o.getWidth()),u=je(s.get("y"),o.getHeight());if(isNaN(l)||isNaN(u)){
  13532. // Chart like bar may have there own marker positioning logic
  13533. if(i.getMarkerPosition)
  13534. // Use the getMarkerPosition
  13535. r=i.getMarkerPosition(t.getValues(t.dimensions,e));else{var c=a.dimensions,d=t.get(c[0],e),h=t.get(c[1],e);r=a.dataToPoint([d,h])}
  13536. // Expand line to the edge of grid if value on one axis is Inifnity
  13537. // In case
  13538. // markLine: {
  13539. // data: [{
  13540. // yAxis: 2
  13541. // // or
  13542. // type: 'average'
  13543. // }]
  13544. // }
  13545. if(oy(a,"cartesian2d")){
  13546. // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug
  13547. var p=a.getAxis("x"),f=a.getAxis("y");c=a.dimensions;vN(t.get(c[0],e))?r[0]=p.toGlobalCoord(p.getExtent()[n?0:1]):vN(t.get(c[1],e))&&(r[1]=f.toGlobalCoord(f.getExtent()[n?0:1]))}
  13548. // Use x, y if has any
  13549. isNaN(l)||(r[0]=l),isNaN(u)||(r[1]=u)}else r=[l,u];t.setItemLayout(e,r)}const SN=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=tN.getMarkerModelFromSeries(t,"markLine");if(e){var i=e.getData(),o=yN(e).from,r=yN(e).to;
  13550. // Update visual and layout of from symbol and to symbol
  13551. o.each((function(e){bN(o,e,!0,t,n),bN(r,e,!1,t,n)})),
  13552. // Update layout of line
  13553. i.each((function(t){i.setItemLayout(t,[o.getItemLayout(t),r.getItemLayout(t)])})),this.markerGroupMap.get(t.id).updateLayout()}}),this)},e.prototype.renderSeries=function(t,e,o,r){var a=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new MS);this.group.add(c.group);var d=function(t,e,i){var o;o=t?n(t&&t.dimensions,(function(t){var n=e.getData().getDimensionInfo(e.getData().mapDimension(t))||{};
  13554. // In map series data don't have lng and lat dimension. Fallback to same with coordSys
  13555. return p(p({},n),{name:t,
  13556. // DON'T use ordinalMeta to parse and collect ordinal.
  13557. ordinalMeta:null})})):[{name:"value",type:"float"}];var r=new Fh(o,i),a=new Fh(o,i),s=new Fh([],i),l=n(i.get("data"),rt(mN,e,t,i));t&&(l=st(l,rt(_N,t)));var u=lN(!!t,o);return r.initData(n(l,(function(t){return t[0]})),null,u),a.initData(n(l,(function(t){return t[1]})),null,u),s.initData(n(l,(function(t){return t[2]}))),s.hasItemOption=!0,{from:r,to:a,line:s}}(a,t,e),h=d.from,f=d.to,g=d.line;yN(e).from=h,yN(e).to=f,
  13558. // Line data for tooltip and formatter
  13559. e.setData(g);
  13560. // TODO
  13561. // Functionally, `symbolSize` & `symbolOffset` can also be 2D array now.
  13562. // But the related logic and type definition are not finished yet.
  13563. // Finish it if required
  13564. var y=e.get("symbol"),m=e.get("symbolSize"),v=e.get("symbolRotate"),_=e.get("symbolOffset");function b(e,n,i){var o=e.getItemModel(n);bN(e,n,i,t,r);var a=o.getModel("itemStyle").getItemStyle();null==a.fill&&(a.fill=Tc(l,"color")),e.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),
  13565. // `0` should be considered as a valid value, so use `retrieve2` instead of `||`
  13566. symbolOffset:x(o.get("symbolOffset",!0),_[i?0:1]),symbolRotate:x(o.get("symbolRotate",!0),v[i?0:1]),
  13567. // TODO: when 2d array is supported, it should ignore parent
  13568. symbolSize:x(o.get("symbolSize"),m[i?0:1]),symbol:x(o.get("symbol",!0),y[i?0:1]),style:a})}
  13569. // TODO: support callback function like markPoint
  13570. i(y)||(y=[y,y]),i(m)||(m=[m,m]),i(v)||(v=[v,v]),i(_)||(_=[_,_]),
  13571. // Update visual and layout of from symbol and to symbol
  13572. d.from.each((function(t){b(h,t,!0),b(f,t,!1)})),
  13573. // Update visual and layout of line
  13574. g.each((function(t){var e=g.getItemModel(t).getModel("lineStyle").getLineStyle();
  13575. // lineData.setItemVisual(idx, {
  13576. // color: lineColor || fromData.getItemVisual(idx, 'color')
  13577. // });
  13578. g.setItemLayout(t,[h.getItemLayout(t),f.getItemLayout(t)]),null==e.stroke&&(e.stroke=h.getItemVisual(t,"style").fill),g.setItemVisual(t,{fromSymbolKeepAspect:h.getItemVisual(t,"symbolKeepAspect"),fromSymbolOffset:h.getItemVisual(t,"symbolOffset"),fromSymbolRotate:h.getItemVisual(t,"symbolRotate"),fromSymbolSize:h.getItemVisual(t,"symbolSize"),fromSymbol:h.getItemVisual(t,"symbol"),toSymbolKeepAspect:f.getItemVisual(t,"symbolKeepAspect"),toSymbolOffset:f.getItemVisual(t,"symbolOffset"),toSymbolRotate:f.getItemVisual(t,"symbolRotate"),toSymbolSize:f.getItemVisual(t,"symbolSize"),toSymbol:f.getItemVisual(t,"symbol"),style:e})})),c.updateData(g),
  13579. // Set host model for tooltip
  13580. // FIXME
  13581. d.line.eachItemGraphicEl((function(t){ni(t).dataModel=e,t.traverse((function(t){ni(t).dataModel=e}))})),this.markKeep(c),c.group.silent=e.get("silent")||t.get("silent")},e.type="markLine",e}(dN);const wN=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markArea",e.defaultOption={
  13582. // zlevel: 0,
  13583. // PENDING
  13584. z:1,tooltip:{trigger:"item"},
  13585. // markArea should fixed on the coordinate system
  13586. animation:!1,label:{show:!0,position:"top"},itemStyle:{
  13587. // color and borderColor default to use color from series
  13588. // color: 'auto'
  13589. // borderColor: 'auto'
  13590. borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(tN);var MN=On(),IN=function(t,e,n,i){
  13591. // item may be null
  13592. var o=i[0],r=i[1];if(o&&r){var a=rN(t,o),s=rN(t,r),l=a.coord,u=s.coord;l[0]=Yt(l[0],-Infinity),l[1]=Yt(l[1],-Infinity),u[0]=Yt(u[0],Infinity),u[1]=Yt(u[1],Infinity);
  13593. // Merge option into one
  13594. var c=ne([{},a,s]);return c.coord=[a.coord,s.coord],c.x0=a.x,c.y0=a.y,c.x1=s.x,c.y1=s.y,c}};function DN(t){return!isNaN(t)&&!isFinite(t)}
  13595. // If a markArea has one dim
  13596. function TN(t,e,n,i){var o=1-t;return DN(e[o])&&DN(n[o])}function CN(t,e){var n=e.coord[0],i=e.coord[1],o={coord:n,x:e.x0,y:e.y0},r={coord:i,x:e.x1,y:e.y1};return oy(t,"cartesian2d")?
  13597. // In case
  13598. // {
  13599. // markArea: {
  13600. // data: [{ yAxis: 2 }]
  13601. // }
  13602. // }
  13603. !(!n||!i||!TN(1,n,i)&&!TN(0,n,i))||function(
  13604. // Currently only polar and cartesian has containData.
  13605. t,e,n){
  13606. // Always return true if there is no coordSys
  13607. return!(t&&t.containZone&&e.coord&&n.coord&&!nN(e)&&!nN(n))||t.containZone(e.coord,n.coord)}(t,o,r):sN(t,o)||sN(t,r)}
  13608. // dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0']
  13609. function AN(t,e,n,i,o){var r,a=i.coordinateSystem,s=t.getItemModel(e),l=je(s.get(n[0]),o.getWidth()),u=je(s.get(n[1]),o.getHeight());if(isNaN(l)||isNaN(u)){
  13610. // Chart like bar may have there own marker positioning logic
  13611. if(i.getMarkerPosition){
  13612. // Consider the case that user input the right-bottom point first
  13613. // Pick the larger x and y as 'x1' and 'y1'
  13614. var c=t.getValues(["x0","y0"],e),d=t.getValues(["x1","y1"],e),h=a.clampData(c),p=a.clampData(d),f=[];"x0"===n[0]?f[0]=h[0]>p[0]?d[0]:c[0]:f[0]=h[0]>p[0]?c[0]:d[0],"y0"===n[1]?f[1]=h[1]>p[1]?d[1]:c[1]:f[1]=h[1]>p[1]?c[1]:d[1],
  13615. // Use the getMarkerPosition
  13616. r=i.getMarkerPosition(f,n,!0)}else{var g=[v=t.get(n[0],e),x=t.get(n[1],e)];a.clampData&&a.clampData(g,g),r=a.dataToPoint(g,!0)}if(oy(a,"cartesian2d")){
  13617. // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug
  13618. var y=a.getAxis("x"),m=a.getAxis("y"),v=t.get(n[0],e),x=t.get(n[1],e);DN(v)?r[0]=y.toGlobalCoord(y.getExtent()["x0"===n[0]?0:1]):DN(x)&&(r[1]=m.toGlobalCoord(m.getExtent()["y0"===n[1]?0:1]))}
  13619. // Use x, y if has any
  13620. isNaN(l)||(r[0]=l),isNaN(u)||(r[1]=u)}else r=[l,u];return r}var LN=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],kN=/** @class */function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.type,t}return Ue(i,e),i.prototype.updateTransform=function(t,e,i){e.eachSeries((function(t){var e=tN.getMarkerModelFromSeries(t,"markArea");if(e){var o=e.getData();o.each((function(e){var r=n(LN,(function(n){return AN(o,e,n,t,i)}));
  13621. // Layout
  13622. o.setItemLayout(e,r),o.getItemGraphicEl(e).setShape("points",r)}))}}),this)},i.prototype.renderSeries=function(e,i,o,r){var a=e.coordinateSystem,s=e.id,l=e.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,{group:new Z});this.group.add(c.group),this.markKeep(c);var d=function(t,e,i){var o,r,a=["x0","y0","x1","y1"];if(t){var s=n(t&&t.dimensions,(function(t){var n=e.getData(),i=n.getDimensionInfo(n.mapDimension(t))||{};
  13623. // In map series data don't have lng and lat dimension. Fallback to same with coordSys
  13624. return p(p({},i),{name:t,
  13625. // DON'T use ordinalMeta to parse and collect ordinal.
  13626. ordinalMeta:null})}));r=n(a,(function(t,e){return{name:t,type:s[e%2].type}})),o=new Fh(r,i)}else o=new Fh(r=[{name:"value",type:"float"}],i);var l=n(i.get("data"),rt(IN,e,t,i));t&&(l=st(l,rt(CN,t)));var u=t?function(t,e,n,i){return ml(t.coord[Math.floor(i/2)][i%2],r[i])}:function(t,e,n,i){return ml(t.value,r[i])};return o.initData(l,null,u),o.hasItemOption=!0,o}(a,e,i);
  13627. // Line data for tooltip and formatter
  13628. i.setData(d),
  13629. // Update visual and layout of line
  13630. d.each((function(i){
  13631. // Layout
  13632. var o=n(LN,(function(t){return AN(d,i,t,e,r)})),s=a.getAxis("x").scale,u=a.getAxis("y").scale,c=s.getExtent(),h=u.getExtent(),p=[s.parse(d.get("x0",i)),s.parse(d.get("x1",i))],f=[u.parse(d.get("y0",i)),u.parse(d.get("y1",i))];Ke(p),Ke(f);var g=!!(c[0]>p[1]||c[1]<p[0]||h[0]>f[1]||h[1]<f[0]);
  13633. // If none of the area is inside coordSys, allClipped is set to be true
  13634. // in layout so that label will not be displayed. See #12591
  13635. d.setItemLayout(i,{points:o,allClipped:g});var y=d.getItemModel(i).getModel("itemStyle").getItemStyle(),m=Tc(l,"color");y.fill||(y.fill=m,t(y.fill)&&(y.fill=ce(y.fill,.4))),y.stroke||(y.stroke=m),
  13636. // Visual
  13637. d.setItemVisual(i,"style",y)})),d.diff(MN(c).data).add((function(t){var e=d.getItemLayout(t);if(!e.allClipped){var n=new z({shape:{points:e.points}});d.setItemGraphicEl(t,n),c.group.add(n)}})).update((function(t,e){var n=MN(c).data.getItemGraphicEl(e),o=d.getItemLayout(t);o.allClipped?n&&c.group.remove(n):(n?io(n,{shape:{points:o.points}},i,t):n=new z({shape:{points:o.points}}),d.setItemGraphicEl(t,n),c.group.add(n))})).remove((function(t){var e=MN(c).data.getItemGraphicEl(t);c.group.remove(e)})).execute(),d.eachItemGraphicEl((function(e,n){var o=d.getItemModel(n),r=d.getItemVisual(n,"style");e.useStyle(d.getItemVisual(n,"style")),Yo(e,Uo(o),{labelFetcher:i,labelDataIndex:n,defaultText:d.getName(n)||"",inheritColor:t(r.fill)?ce(r.fill,1):"#000"}),qi(e,o),Ui(e,null,null,o.get(["emphasis","disabled"])),ni(e).dataModel=i})),MN(c).data=d,c.group.silent=i.get("silent")||e.get("silent")},i.type="markArea",i}(dN);const PN=kN;var NN=/** @class */function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=o.type,t.layoutMode={type:"box",
  13638. // legend.width/height are maxWidth/maxHeight actually,
  13639. // whereas real width/height is calculated by its content.
  13640. // (Setting {left: 10, right: 10} does not make sense).
  13641. // So consider the case:
  13642. // `setOption({legend: {left: 10});`
  13643. // then `setOption({legend: {right: 10});`
  13644. // The previous `left` should be cleared by setting `ignoreSize`.
  13645. ignoreSize:!0},t}return Ue(o,e),o.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),t.selected=t.selected||{},this._updateSelector(t)},o.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},o.prototype._updateSelector=function(e){var n=e.selector,o=this.ecModel;!0===n&&(n=e.selector=["all","inverse"]),i(n)&&a(n,(function(e,i){t(e)&&(e={type:e}),n[i]=tt(e,function(t,e){return"all"===e?{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])}:"inverse"===e?{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(o,e.type))}))},o.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;
  13646. // If selectedMode is single, try to select one
  13647. if(t[0]&&"single"===this.get("selectedMode")){
  13648. // If has any selected in option.selected
  13649. for(var e=!1,n=0;n<t.length;n++){var i=t[n].get("name");if(this.isSelected(i)){
  13650. // Force to unselect others
  13651. this.select(i),e=!0;break}}
  13652. // Try select the first if selectedMode is single
  13653. !e&&this.select(t[0].get("name"))}},o.prototype._updateData=function(e){var i=[],o=[];e.eachRawSeries((function(t){var n,r=t.name;if(o.push(r),t.legendVisualProvider){var a=t.legendVisualProvider.getAllNames();e.isSeriesFiltered(t)||(o=o.concat(a)),a.length?i=i.concat(a):n=!0}else n=!0;n&&kn(t)&&i.push(t.name)})),
  13654. /**
  13655. * @type {Array.<string>}
  13656. * @private
  13657. */
  13658. this._availableNames=o;
  13659. // If legend.data is not specified in option, use availableNames as data,
  13660. // which is convenient for user preparing option.
  13661. var a=this.get("data")||i,s=r(),u=n(a,(function(e){
  13662. // Can be string or number
  13663. return(t(e)||l(e))&&(e={name:e}),s.get(e.name)?null:(s.set(e.name,!0),new yr(e,this,this.ecModel))}),this);
  13664. /**
  13665. * @type {Array.<module:echarts/model/Model>}
  13666. * @private
  13667. */
  13668. this._data=st(u,(function(t){return!!t}))},o.prototype.getData=function(){return this._data},o.prototype.select=function(t){var e=this.option.selected;if("single"===this.get("selectedMode")){var n=this._data;a(n,(function(t){e[t.get("name")]=!1}))}e[t]=!0},o.prototype.unSelect=function(t){"single"!==this.get("selectedMode")&&(this.option.selected[t]=!1)},o.prototype.toggleSelected=function(t){var e=this.option.selected;
  13669. // Default is true
  13670. e.hasOwnProperty(t)||(e[t]=!0),this[e[t]?"unSelect":"select"](t)},o.prototype.allSelect=function(){var t=this._data,e=this.option.selected;a(t,(function(t){e[t.get("name",!0)]=!0}))},o.prototype.inverseSelect=function(){var t=this._data,e=this.option.selected;a(t,(function(t){var n=t.get("name",!0);
  13671. // Initially, default value is true
  13672. e.hasOwnProperty(n)||(e[n]=!0),e[n]=!e[n]}))},o.prototype.isSelected=function(t){var e=this.option.selected;return!(e.hasOwnProperty(t)&&!e[t])&&c(this._availableNames,t)>=0},o.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},o.type="legend.plain",o.dependencies=["series"],o.defaultOption={
  13673. // zlevel: 0,
  13674. z:4,show:!0,orient:"horizontal",left:"center",
  13675. // right: 'center',
  13676. top:0,
  13677. // bottom: null,
  13678. align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},o}(Ta);const ON=NN;var RN=rt,EN=a,VN=Z,zN=/** @class */function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=n.type,t.newlineDisabled=!1,t}return Ue(n,e),n.prototype.init=function(){this.group.add(this._contentGroup=new VN),this.group.add(this._selectorGroup=new VN),this._isFirstRender=!0},
  13679. /**
  13680. * @protected
  13681. */
  13682. n.prototype.getContentGroup=function(){return this._contentGroup},
  13683. /**
  13684. * @protected
  13685. */
  13686. n.prototype.getSelectorGroup=function(){return this._selectorGroup},
  13687. /**
  13688. * @override
  13689. */
  13690. n.prototype.render=function(t,e,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var o=t.get("align"),r=t.get("orient");o&&"auto"!==o||(o="right"===t.get("left")&&"vertical"===r?"right":"left");
  13691. // selector has been normalized to an array in model
  13692. var a=t.get("selector",!0),s=t.get("selectorPosition",!0);!a||s&&"auto"!==s||(s="horizontal"===r?"end":"start"),this.renderInner(o,t,e,n,a,r,s);
  13693. // Perform layout.
  13694. var l=t.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},c=t.get("padding"),d=xa(l,u,c),h=this.layoutInner(t,o,d,i,a,s),p=xa(I({width:h.width,height:h.height},l),u,c);this.group.x=p.x-h.x,this.group.y=p.y-h.y,this.group.markRedraw(),
  13695. // Render background after group is layout.
  13696. this.group.add(this._backgroundEl=KL(h,t))}},n.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},n.prototype.renderInner=function(t,e,n,i,o,a,s){var l=this.getContentGroup(),u=r(),c=e.get("selectedMode"),d=[];n.eachRawSeries((function(t){!t.get("legendHoverLink")&&d.push(t.id)})),EN(e.getData(),(function(o,r){var a=o.get("name");
  13697. // Use empty string or \n as a newline string
  13698. if(!this.newlineDisabled&&(""===a||"\n"===a)){var s=new VN;
  13699. // @ts-ignore
  13700. return s.newline=!0,void l.add(s)}
  13701. // Representitive series.
  13702. var h=n.getSeriesByName(a)[0];if(!u.get(a))
  13703. // Legend to control series.
  13704. if(h){var f=h.getData(),g=f.getVisual("legendLineStyle")||{},y=f.getVisual("legendIcon"),m=f.getVisual("style"),v=this._createItem(h,a,r,o,e,t,g,m,y,c,i);v.on("click",RN(BN,a,null,i,d)).on("mouseover",RN(FN,h.name,null,i,d)).on("mouseout",RN(WN,h.name,null,i,d)),n.ssr&&v.eachChild((function(t){var e=ni(t);e.seriesIndex=h.seriesIndex,e.dataIndex=r,e.ssrType="legend"})),u.set(a,!0)}else
  13705. // Legend to control data. In pie and funnel.
  13706. n.eachRawSeries((function(s){
  13707. // In case multiple series has same data name
  13708. if(!u.get(a)&&s.legendVisualProvider){var l=s.legendVisualProvider;if(!l.containName(a))return;var h=l.indexOfName(a),f=l.getItemVisual(h,"style"),g=l.getItemVisual(h,"legendIcon"),y=le(f.fill);
  13709. // Color may be set to transparent in visualMap when data is out of range.
  13710. // Do not show nothing.
  13711. y&&0===y[3]&&(y[3]=.2,
  13712. // TODO color is set to 0, 0, 0, 0. Should show correct RGBA
  13713. f=p(p({},f),{fill:se(y,"rgba")}));var m=this._createItem(s,a,r,o,e,t,{},f,g,c,i);
  13714. // FIXME: consider different series has items with the same name.
  13715. m.on("click",RN(BN,null,a,i,d)).on("mouseover",RN(FN,null,a,i,d)).on("mouseout",RN(WN,null,a,i,d)),n.ssr&&m.eachChild((function(t){var e=ni(t);e.seriesIndex=s.seriesIndex,e.dataIndex=r,e.ssrType="legend"})),u.set(a,!0)}}),this)}),this),o&&this._createSelector(o,e,i,a,s)},n.prototype._createSelector=function(t,e,n,i,o){var r=this.getSelectorGroup();EN(t,(function(t){var i=t.type,o=new $({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect",legendId:e.id})}});r.add(o),Yo(o,{normal:e.getModel("selectorLabel"),emphasis:e.getModel(["emphasis","selectorLabel"])},{defaultText:t.title}),Yi(o)}))},n.prototype._createItem=function(e,n,i,o,r,a,s,l,u,c,d){var h=e.visualDrawType,p=r.get("itemWidth"),g=r.get("itemHeight"),y=r.isSelected(n),m=o.get("symbolRotate"),v=o.get("symbolKeepAspect"),x=o.get("icon"),_=function(t,e,n,i,o,r,a){
  13716. /**
  13717. * Use series style if is inherit;
  13718. * elsewise, use legend style
  13719. */
  13720. function s(t,e){
  13721. // If lineStyle.width is 'auto', it is set to be 2 if series has border
  13722. "auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),EN(t,(function(n,i){"inherit"===t[i]&&(t[i]=e[i])}))}
  13723. // itemStyle
  13724. var l=e.getModel("itemStyle"),u=l.getItemStyle(),c=0===t.lastIndexOf("empty",0)?"fill":"stroke",d=l.getShallow("decal");u.decal=d&&"inherit"!==d?Zc(d,a):i.decal,"inherit"===u.fill&&(
  13725. /**
  13726. * Series with visualDrawType as 'stroke' should have
  13727. * series stroke as legend fill
  13728. */
  13729. u.fill=i[o]);"inherit"===u.stroke&&(
  13730. /**
  13731. * icon type with "emptyXXX" should use fill color
  13732. * in visual style
  13733. */
  13734. u.stroke=i[c]);"inherit"===u.opacity&&(
  13735. /**
  13736. * Use lineStyle.opacity if drawType is stroke
  13737. */
  13738. u.opacity=("fill"===o?i:n).opacity);s(u,i);
  13739. // lineStyle
  13740. var h=e.getModel("lineStyle"),p=h.getLineStyle();if(s(p,n),
  13741. // Fix auto color to real color
  13742. "auto"===u.fill&&(u.fill=i.fill),"auto"===u.stroke&&(u.stroke=i.fill),"auto"===p.stroke&&(p.stroke=i.fill),!r){var f=e.get("inactiveBorderWidth"),g=u[c];
  13743. /**
  13744. * Since stroke is set to be inactiveBorderColor, it may occur that
  13745. * there is no border in series but border in legend, so we need to
  13746. * use border only when series has border if is set to be auto
  13747. */u.lineWidth="auto"===f?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),p.stroke=h.get("inactiveColor"),p.lineWidth=h.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}(u=x||u||"roundRect",o,s,l,h,y,d),b=new VN,S=o.getModel("textStyle");if(!f(e.getLegendIcon)||x&&"inherit"!==x){
  13748. // Use default legend icon policy for most series
  13749. var w="inherit"===x&&e.getData().getVisual("symbol")?"inherit"===m?e.getData().getVisual("symbolRotate"):m:0;// No rotation for no icon
  13750. b.add(function(t){var e=t.icon||"roundRect",n=Gc(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);n.setStyle(t.itemStyle),n.rotation=(t.iconRotate||0)*Math.PI/180,n.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2);return n}({itemWidth:p,itemHeight:g,icon:u,iconRotate:w,itemStyle:_.itemStyle,lineStyle:_.lineStyle,symbolKeepAspect:v}))}else
  13751. // Series has specific way to define legend icon
  13752. b.add(e.getLegendIcon({itemWidth:p,itemHeight:g,icon:u,iconRotate:m,itemStyle:_.itemStyle,lineStyle:_.lineStyle,symbolKeepAspect:v}));var M="left"===a?p+5:-5,I=a,D=r.get("formatter"),T=n;t(D)&&D?T=D.replace("{name}",null!=n?n:""):f(D)&&(T=D(n));var C=y?S.getTextColor():o.get("inactiveColor");b.add(new $({style:Zo(S,{text:T,x:M,y:g/2,fill:C,align:I,verticalAlign:"middle"},{inheritColor:C})}));
  13753. // Add a invisible rect to increase the area of mouse hover
  13754. var A=new G({shape:b.getBoundingRect(),style:{
  13755. // Cannot use 'invisible' because SVG SSR will miss the node
  13756. fill:"transparent"}}),L=o.getModel("tooltip");return L.get("show")&&Vo({el:A,componentModel:r,itemName:n,itemTooltipOption:L.option}),b.add(A),b.eachChild((function(t){t.silent=!0})),A.silent=!c,this.getContentGroup().add(b),Yi(b),
  13757. // @ts-ignore
  13758. b.__legendDataIndex=i,b},n.prototype.layoutInner=function(t,e,n,i,o,r){var a=this.getContentGroup(),s=this.getSelectorGroup();
  13759. // Place items in contentGroup.
  13760. va(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),o){
  13761. // Place buttons in selectorGroup
  13762. va(
  13763. // Buttons in selectorGroup always layout horizontally
  13764. "horizontal",s,t.get("selectorItemGap",!0));var c=s.getBoundingRect(),d=[-c.x,-c.y],h=t.get("selectorButtonGap",!0),p=t.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",y=0===p?"y":"x";"end"===r?d[p]+=l[f]+h:u[p]+=c[f]+h,
  13765. // Always align selector to content as 'middle'
  13766. d[1-p]+=l[g]/2-c[g]/2,s.x=d[0],s.y=d[1],a.x=u[0],a.y=u[1];var m={x:0,y:0};return m[f]=l[f]+h+c[f],m[g]=Math.max(l[g],c[g]),m[y]=Math.min(0,c[y]+d[1-p]),m}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},
  13767. /**
  13768. * @protected
  13769. */
  13770. n.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},n.type="legend.plain",n}(Mu);function BN(t,e,n,i){
  13771. // downplay before unselect
  13772. WN(t,e,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),
  13773. // highlight after select
  13774. // TODO highlight immediately may cause animation loss.
  13775. FN(t,e,n,i)}function GN(t){for(var e,n=t.getZr().storage.getDisplayList(),i=0,o=n.length;i<o&&!(e=n[i].states.emphasis);)i++;return e&&e.hoverLayer}function FN(t,e,n,i){
  13776. // If element hover will move to a hoverLayer.
  13777. GN(n)||n.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:i})}function WN(t,e,n,i){
  13778. // If element hover will move to a hoverLayer.
  13779. GN(n)||n.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:i})}const HN=zN;
  13780. /*
  13781. * Licensed to the Apache Software Foundation (ASF) under one
  13782. * or more contributor license agreements. See the NOTICE file
  13783. * distributed with this work for additional information
  13784. * regarding copyright ownership. The ASF licenses this file
  13785. * to you under the Apache License, Version 2.0 (the
  13786. * "License"); you may not use this file except in compliance
  13787. * with the License. You may obtain a copy of the License at
  13788. *
  13789. * http://www.apache.org/licenses/LICENSE-2.0
  13790. *
  13791. * Unless required by applicable law or agreed to in writing,
  13792. * software distributed under the License is distributed on an
  13793. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  13794. * KIND, either express or implied. See the License for the
  13795. * specific language governing permissions and limitations
  13796. * under the License.
  13797. */
  13798. /**
  13799. * AUTO-GENERATED FILE. DO NOT MODIFY.
  13800. */
  13801. /*
  13802. * Licensed to the Apache Software Foundation (ASF) under one
  13803. * or more contributor license agreements. See the NOTICE file
  13804. * distributed with this work for additional information
  13805. * regarding copyright ownership. The ASF licenses this file
  13806. * to you under the Apache License, Version 2.0 (the
  13807. * "License"); you may not use this file except in compliance
  13808. * with the License. You may obtain a copy of the License at
  13809. *
  13810. * http://www.apache.org/licenses/LICENSE-2.0
  13811. *
  13812. * Unless required by applicable law or agreed to in writing,
  13813. * software distributed under the License is distributed on an
  13814. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  13815. * KIND, either express or implied. See the License for the
  13816. * specific language governing permissions and limitations
  13817. * under the License.
  13818. */function YN(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries((function(t){
  13819. // If in any legend component the status is not selected.
  13820. // Because in legend series is assumed selected when it is not in the legend data.
  13821. for(var n=0;n<e.length;n++)if(!e[n].isSelected(t.name))return!1;return!0}))}function UN(t,e,n){var i="allSelect"===t||"inverseSelect"===t,o={},r=[];n.eachComponent({mainType:"legend",query:e},(function(n){i?n[t]():n[t](e.name),ZN(n,o),r.push(n.componentIndex)}));var s={};
  13822. // make selectedMap from all legend components
  13823. // Return the event explicitly
  13824. return n.eachComponent("legend",(function(t){a(o,(function(e,n){
  13825. // Force other legend has same selected status
  13826. // Or the first is toggled to true and other are toggled to false
  13827. // In the case one legend has some item unSelected in option. And if other legend
  13828. // doesn't has the item, they will assume it is selected.
  13829. t[e?"select":"unSelect"](n)})),ZN(t,s)})),i?{selected:s,
  13830. // return legendIndex array to tell the developers which legends are allSelect / inverseSelect
  13831. legendIndex:r}:{name:e.name,selected:s}}function ZN(t,e){var n=e||{};return a(t.getData(),(function(e){var i=e.get("name");
  13832. // Wrap element
  13833. if("\n"!==i&&""!==i){var o=t.isSelected(i);N(n,i)?
  13834. // Unselected if any legend is unselected
  13835. n[i]=n[i]&&o:n[i]=o}})),n}function XN(t){t.registerComponentModel(ON),t.registerComponentView(HN),t.registerProcessor(t.PRIORITY.PROCESSOR.SERIES_FILTER,YN),t.registerSubTypeDefaulter("legend",(function(){return"plain"})),function(t){
  13836. /**
  13837. * @event legendToggleSelect
  13838. * @type {Object}
  13839. * @property {string} type 'legendToggleSelect'
  13840. * @property {string} [from]
  13841. * @property {string} name Series name or data item name
  13842. */
  13843. t.registerAction("legendToggleSelect","legendselectchanged",rt(UN,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",rt(UN,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",rt(UN,"inverseSelect")),
  13844. /**
  13845. * @event legendSelect
  13846. * @type {Object}
  13847. * @property {string} type 'legendSelect'
  13848. * @property {string} name Series name or data item name
  13849. */
  13850. t.registerAction("legendSelect","legendselected",rt(UN,"select")),
  13851. /**
  13852. * @event legendUnSelect
  13853. * @type {Object}
  13854. * @property {string} type 'legendUnSelect'
  13855. * @property {string} name Series name or data item name
  13856. */
  13857. t.registerAction("legendUnSelect","legendunselected",rt(UN,"unSelect"))}(t)}
  13858. // Do not `ignoreSize` to enable setting {left: 10, right: 10}.
  13859. function jN(t,e,n){var i=[1,1];i[t.getOrient().index]=0,Sa(e,n,{type:"box",ignoreSize:!!i})}const qN=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}
  13860. /**
  13861. * @param {number} scrollDataIndex
  13862. */return Ue(e,t),e.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},e.prototype.init=function(e,n,i){var o=wa(e);t.prototype.init.call(this,e,n,i),jN(this,e,o)},
  13863. /**
  13864. * @override
  13865. */
  13866. e.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),jN(this,this.option,e)},e.type="legend.scroll",e.defaultOption=xr(ON.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),e}(ON);var KN=Z,JN=["width","height"],$N=["x","y"],QN=/** @class */function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=n.type,t.newlineDisabled=!0,t._currentIndex=0,t}return Ue(n,e),n.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new KN),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new KN)},
  13867. /**
  13868. * @override
  13869. */
  13870. n.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},
  13871. /**
  13872. * @override
  13873. */
  13874. n.prototype.renderInner=function(t,n,o,r,a,s,l){var u=this;
  13875. // Render content items.
  13876. e.prototype.renderInner.call(this,t,n,o,r,a,s,l);var c=this._controllerGroup,d=n.get("pageIconSize",!0),h=i(d)?d:[d,d];
  13877. // FIXME: support be 'auto' adapt to size number text length,
  13878. // e.g., '3/12345' should not overlap with the control arrow button.
  13879. f("pagePrev",0);var p=n.getModel("pageTextStyle");function f(t,e){var i=t+"DataIndex",o=No(n.get("pageIcons",!0)[n.getOrient().name][e],{
  13880. // Buttons will be created in each render, so we do not need
  13881. // to worry about avoiding using legendModel kept in scope.
  13882. onclick:lt(u._pageGo,u,i,n,r)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});o.name=t,c.add(o)}c.add(new $({name:"pageText",style:{
  13883. // Placeholder to calculate a proper layout.
  13884. text:"xx/xx",fill:p.getTextColor(),font:p.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),f("pageNext",1)},
  13885. /**
  13886. * @override
  13887. */
  13888. n.prototype.layoutInner=function(t,e,n,i,o,r){var a=this.getSelectorGroup(),s=t.getOrient().index,l=JN[s],u=$N[s],c=JN[1-s],d=$N[1-s];o&&va(
  13889. // Buttons in selectorGroup always layout horizontally
  13890. "horizontal",a,t.get("selectorItemGap",!0));var h=t.get("selectorButtonGap",!0),p=a.getBoundingRect(),f=[-p.x,-p.y],g=et(n);o&&(g[l]=n[l]-p[l]-h);var y=this._layoutContentAndController(t,i,g,s,l,c,d,u);if(o){if("end"===r)f[s]+=y[l]+h;else{var m=p[l]+h;f[s]-=m,y[u]-=m}y[l]+=p[l]+h,f[1-s]+=y[d]+y[c]/2-p[c]/2,y[c]=Math.max(y[c],p[c]),y[d]=Math.min(y[d],p[d]+f[1-s]),a.x=f[0],a.y=f[1],a.markRedraw()}return y},n.prototype._layoutContentAndController=function(t,e,n,i,o,r,a,s){var l=this.getContentGroup(),u=this._containerGroup,c=this._controllerGroup;
  13891. // Place items in contentGroup.
  13892. va(t.get("orient"),l,t.get("itemGap"),i?n.width:null,i?null:n.height),va(
  13893. // Buttons in controller are layout always horizontally.
  13894. "horizontal",c,t.get("pageButtonItemGap",!0));var d=l.getBoundingRect(),h=c.getBoundingRect(),p=this._showController=d[o]>n[o],f=[-d.x,-d.y];
  13895. // Remain contentPos when scroll animation perfroming.
  13896. // If first rendering, `contentGroup.position` is [0, 0], which
  13897. // does not make sense and may cause unexepcted animation if adopted.
  13898. e||(f[i]=l[s]);
  13899. // Layout container group based on 0.
  13900. var g=[0,0],y=[-h.x,-h.y],m=x(t.get("pageButtonGap",!0),t.get("itemGap",!0));
  13901. // Place containerGroup and controllerGroup and contentGroup.
  13902. p&&(
  13903. // controller is on the right / bottom.
  13904. "end"===t.get("pageButtonPosition",!0)?y[i]+=n[o]-h[o]:g[i]+=h[o]+m);
  13905. // Always align controller to content as 'middle'.
  13906. y[1-i]+=d[r]/2-h[r]/2,l.setPosition(f),u.setPosition(g),c.setPosition(y);
  13907. // Calculate `mainRect` and set `clipPath`.
  13908. // mainRect should not be calculated by `this.group.getBoundingRect()`
  13909. // for sake of the overflow.
  13910. var v={x:0,y:0};
  13911. // Consider content may be overflow (should be clipped).
  13912. if(v[o]=p?n[o]:d[o],v[r]=Math.max(d[r],h[r]),
  13913. // `containerRect[yx] + containerPos[1 - orientIdx]` is 0.
  13914. v[a]=Math.min(0,h[a]+y[1-i]),u.__rectSize=n[o],p){var _={x:0,y:0};_[o]=Math.max(n[o]-h[o]-m,0),_[r]=v[r],u.setClipPath(new G({shape:_})),
  13915. // Consider content may be larger than container, container rect
  13916. // can not be obtained from `containerGroup.getBoundingRect()`.
  13917. u.__rectSize=_[o]}else
  13918. // Do not remove or ignore controller. Keep them set as placeholders.
  13919. c.eachChild((function(t){t.attr({invisible:!0,silent:!0})}));
  13920. // Content translate animation.
  13921. var b=this._getPageInfo(t);return null!=b.pageIndex&&io(l,{x:b.contentPosition[0],y:b.contentPosition[1]},
  13922. // When switch from "show controller" to "not show controller", view should be
  13923. // updated immediately without animation, otherwise causes weird effect.
  13924. p?t:null),this._updatePageInfoView(t,b),v},n.prototype._pageGo=function(t,e,n){var i=this._getPageInfo(e)[t];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:e.id})},n.prototype._updatePageInfoView=function(e,n){var i=this._controllerGroup;a(["pagePrev","pageNext"],(function(t){var o=null!=n[t+"DataIndex"],r=i.childOfName(t);r&&(r.setStyle("fill",o?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),r.cursor=o?"pointer":"default")}));var o=i.childOfName("pageText"),r=e.get("pageFormatter"),s=n.pageIndex,l=null!=s?s+1:0,u=n.pageCount;o&&r&&o.setStyle("text",t(r)?r.replace("{current}",null==l?"":l+"").replace("{total}",null==u?"":u+""):r({current:l,total:u}))},
  13925. /**
  13926. * contentPosition: Array.<number>, null when data item not found.
  13927. * pageIndex: number, null when data item not found.
  13928. * pageCount: number, always be a number, can be 0.
  13929. * pagePrevDataIndex: number, null when no previous page.
  13930. * pageNextDataIndex: number, null when no next page.
  13931. * }
  13932. */
  13933. n.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,o=t.getOrient().index,r=JN[o],a=$N[o],s=this._findTargetItemIndex(e),l=n.children(),u=l[s],c=l.length,d=c?1:0,h={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return h;var p=v(u);h.contentPosition[o]=-p.s;
  13934. // Strategy:
  13935. // (1) Always align based on the left/top most item.
  13936. // (2) It is user-friendly that the last item shown in the
  13937. // current window is shown at the begining of next window.
  13938. // Otherwise if half of the last item is cut by the window,
  13939. // it will have no chance to display entirely.
  13940. // (3) Consider that item size probably be different, we
  13941. // have calculate pageIndex by size rather than item index,
  13942. // and we can not get page index directly by division.
  13943. // (4) The window is to narrow to contain more than
  13944. // one item, we should make sure that the page can be fliped.
  13945. for(var f=s+1,g=p,y=p,m=null;f<=c;++f)
  13946. // Half of the last item is out of the window.
  13947. (!(m=v(l[f]))&&y.e>g.s+i||m&&!x(m,g.s))&&(g=y.i>g.i?y:m)&&(null==h.pageNextDataIndex&&(h.pageNextDataIndex=g.i),++h.pageCount),y=m;for(f=s-1,g=p,y=p,m=null;f>=-1;--f)
  13948. // If the the end item does not intersect with the window started
  13949. // from the current item, a page can be settled.
  13950. (m=v(l[f]))&&x(y,m.s)||!(g.i<y.i)||(y=g,null==h.pagePrevDataIndex&&(h.pagePrevDataIndex=g.i),++h.pageCount,++h.pageIndex),g=m;return h;function v(t){if(t){var e=t.getBoundingRect(),n=e[a]+t[a];return{s:n,e:n+e[r],i:t.__legendDataIndex}}}function x(t,e){return t.e>=e&&t.s<=e+i}},n.prototype._findTargetItemIndex=function(t){return this._showController?(this.getContentGroup().eachChild((function(i,o){var r=i.__legendDataIndex;
  13951. // FIXME
  13952. // If the given targetDataIndex (from model) is illegal,
  13953. // we use defaultIndex. But the index on the legend model and
  13954. // action payload is still illegal. That case will not be
  13955. // changed until some scenario requires.
  13956. null==n&&null!=r&&(n=o),r===t&&(e=o)})),null!=e?e:n):0;var e,n},n.type="legend.scroll",n}(HN);const tO=QN;
  13957. /*
  13958. * Licensed to the Apache Software Foundation (ASF) under one
  13959. * or more contributor license agreements. See the NOTICE file
  13960. * distributed with this work for additional information
  13961. * regarding copyright ownership. The ASF licenses this file
  13962. * to you under the Apache License, Version 2.0 (the
  13963. * "License"); you may not use this file except in compliance
  13964. * with the License. You may obtain a copy of the License at
  13965. *
  13966. * http://www.apache.org/licenses/LICENSE-2.0
  13967. *
  13968. * Unless required by applicable law or agreed to in writing,
  13969. * software distributed under the License is distributed on an
  13970. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  13971. * KIND, either express or implied. See the License for the
  13972. * specific language governing permissions and limitations
  13973. * under the License.
  13974. */
  13975. /**
  13976. * AUTO-GENERATED FILE. DO NOT MODIFY.
  13977. */
  13978. /*
  13979. * Licensed to the Apache Software Foundation (ASF) under one
  13980. * or more contributor license agreements. See the NOTICE file
  13981. * distributed with this work for additional information
  13982. * regarding copyright ownership. The ASF licenses this file
  13983. * to you under the Apache License, Version 2.0 (the
  13984. * "License"); you may not use this file except in compliance
  13985. * with the License. You may obtain a copy of the License at
  13986. *
  13987. * http://www.apache.org/licenses/LICENSE-2.0
  13988. *
  13989. * Unless required by applicable law or agreed to in writing,
  13990. * software distributed under the License is distributed on an
  13991. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  13992. * KIND, either express or implied. See the License for the
  13993. * specific language governing permissions and limitations
  13994. * under the License.
  13995. */function eO(t){hh(XN),t.registerComponentModel(qN),t.registerComponentView(tO),function(t){
  13996. /**
  13997. * @event legendScroll
  13998. * @type {Object}
  13999. * @property {string} type 'legendScroll'
  14000. * @property {string} scrollDataIndex
  14001. */
  14002. t.registerAction("legendScroll","legendscroll",(function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},(function(t){t.setScrollDataIndex(n)}))}))}(t)}const nO=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="dataZoom.inside",e.defaultOption=xr(NL.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(NL);var iO=On();function oO(t,e){if(e){t.removeKey(e.model.uid);var n=e.controller;n&&n.dispose()}}
  14003. /**
  14004. * This action will be throttled.
  14005. */
  14006. function rO(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function aO(t,e,n,i){return t.coordinateSystem.containPoint([n,i])}
  14007. /**
  14008. * Merge roamController settings when multiple dataZooms share one roamController.
  14009. */function sO(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,(function(t,e){var n=iO(e),i=n.coordSysRecordMap||(n.coordSysRecordMap=r());i.each((function(t){
  14010. // `coordSysRecordMap` always exists (because it holds the `roam controller`, which should
  14011. // better not re-create each time), but clear `dataZoomInfoMap` each round of the workflow.
  14012. t.dataZoomInfoMap=null})),t.eachComponent({mainType:"dataZoom",subType:"inside"},(function(t){var n=AL(t);a(n.infoList,(function(n){var o=n.model.uid,s=i.get(o)||i.set(o,function(t,e){
  14013. // These init props will never change after record created.
  14014. var n={model:e,containsPoint:rt(aO,e),dispatchAction:rt(rO,t),dataZoomInfoMap:null,controller:null},i=n.controller=new Uv(t.getZr());
  14015. // Must not do anything depends on coordSysRecord outside the event handler here,
  14016. // because coordSysRecord not completed yet.
  14017. return a(["pan","zoom","scrollMove"],(function(t){i.on(t,(function(e){var i=[];n.dataZoomInfoMap.each((function(o){
  14018. // Check whether the behaviors (zoomOnMouseWheel, moveOnMouseMove,
  14019. // moveOnMouseWheel, ...) enabled.
  14020. if(e.isAvailableBehavior(o.model.option)){var r=(o.getRange||{})[t],a=r&&r(o.dzReferCoordSysInfo,n.model.mainType,n.controller,e);!o.model.get("disabled",!0)&&a&&i.push({dataZoomId:o.model.id,start:a[0],end:a[1]})}})),i.length&&n.dispatchAction(i)}))})),n}(e,n.model));
  14021. // Notice these props might be changed each time for a single dataZoomModel.
  14022. (s.dataZoomInfoMap||(s.dataZoomInfoMap=r())).set(t.uid,{dzReferCoordSysInfo:n,model:t,getRange:null})}))})),
  14023. // (1) Merge dataZoom settings for each coord sys and set to the roam controller.
  14024. // (2) Clear coord sys if not refered by any dataZoom.
  14025. i.each((function(t){var e,n=t.controller,o=t.dataZoomInfoMap;if(o){var r=o.keys()[0];null!=r&&(e=o.get(r))}if(e){var a=function(t){var e,n="type_",i={type_true:2,type_move:1,type_false:0,type_undefined:-1},o=!0;
  14026. // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated
  14027. // as string, it is probably revert to reserved word by compress tool. See #7411.
  14028. return t.each((function(t){var r=t.model,a=!r.get("disabled",!0)&&(!r.get("zoomLock",!0)||"move");i[n+a]>i[n+e]&&(e=a),
  14029. // Prevent default move event by default. If one false, do not prevent. Otherwise
  14030. // users may be confused why it does not work when multiple insideZooms exist.
  14031. o=o&&r.get("preventDefaultMouseMove",!0)})),{controlType:e,opt:{
  14032. // RoamController will enable all of these functionalities,
  14033. // and the final behavior is determined by its event listener
  14034. // provided by each inside zoom.
  14035. zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o}}}(o);n.enable(a.controlType,a.opt),n.setPointerChecker(t.containsPoint),Bu(t,"dispatchAction",e.model.get("throttle",!0),"fixRate")}else oO(i,t)}))}))}var lO=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataZoom.inside",e}return Ue(e,t),e.prototype.render=function(e,n,i){t.prototype.render.apply(this,arguments),e.noTarget()?this._clear():(
  14036. // Hence the `throttle` util ensures to preserve command order,
  14037. // here simply updating range all the time will not cause missing
  14038. // any of the the roam change.
  14039. this.range=e.getPercentRange(),
  14040. // Reset controllers.
  14041. function(t,e,n){iO(t).coordSysRecordMap.each((function(t){var i=t.dataZoomInfoMap.get(e.uid);i&&(i.getRange=n)}))}(i,e,{pan:lt(uO.pan,this),zoom:lt(uO.zoom,this),scrollMove:lt(uO.scrollMove,this)}))},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){!function(t,e){for(var n=iO(t).coordSysRecordMap,i=n.keys(),o=0;o<i.length;o++){var r=i[o],a=n.get(r),s=a.dataZoomInfoMap;if(s){var l=e.uid;s.get(l)&&(s.removeKey(l),s.keys().length||oO(n,a))}}}(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(RL),uO={zoom:function(t,e,n,i){var o=this.range,r=o.slice(),a=t.axisModels[0];if(a){var s=dO[e](null,[i.originX,i.originY],a,n,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(r[1]-r[0])+r[0],u=Math.max(1/i.scale,0);r[0]=(r[0]-l)*u+l,r[1]=(r[1]-l)*u+l;
  14042. // Restrict range.
  14043. var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return Sw(0,r,[0,100],0,c.minSpan,c.maxSpan),this.range=r,o[0]!==r[0]||o[1]!==r[1]?r:void 0}},pan:cO((function(t,e,n,i,o,r){var a=dO[i]([r.oldX,r.oldY],[r.newX,r.newY],e,o,n);return a.signal*(t[1]-t[0])*a.pixel/a.pixelLength})),scrollMove:cO((function(t,e,n,i,o,r){return dO[i]([0,0],[r.scrollDelta,r.scrollDelta],e,o,n).signal*(t[1]-t[0])*r.scrollDelta}))};function cO(t){return function(e,n,i,o){var r=this.range,a=r.slice(),s=e.axisModels[0];if(s)return Sw(t(a,s,e,n,i,o),a,[0,100],"all"),this.range=a,r[0]!==a[0]||r[1]!==a[1]?a:void 0}}var dO={grid:function(t,e,n,i,o){var r=n.axis,a={},s=o.model.coordinateSystem.getRect();return t=t||[0,0],"x"===r.dim?(a.pixel=e[0]-t[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=r.inverse?1:-1):(
  14044. // axis.dim === 'y'
  14045. a.pixel=e[1]-t[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=r.inverse?-1:1),a},polar:function(t,e,n,i,o){var r=n.axis,a={},s=o.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===n.mainType?(a.pixel=e[0]-t[0],
  14046. // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]);
  14047. // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]);
  14048. a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=r.inverse?1:-1):(
  14049. // 'angleAxis'
  14050. a.pixel=e[1]-t[1],
  14051. // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]);
  14052. // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]);
  14053. a.pixelLength=u[1]-u[0],a.pixelStart=u[0],a.signal=r.inverse?-1:1),a},singleAxis:function(t,e,n,i,o){var r=n.axis,a=o.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===r.orient?(s.pixel=e[0]-t[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=r.inverse?1:-1):(
  14054. // 'vertical'
  14055. s.pixel=e[1]-t[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=r.inverse?-1:1),s}};const hO=lO;function pO(t){HL(t),t.registerComponentModel(nO),t.registerComponentView(hO),sO(t)}const fO=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=xr(NL.defaultOption,{show:!0,
  14056. // deault value can only be drived in view stage.
  14057. right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",
  14058. // dataBackgroundColor: '#ddd',
  14059. dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},
  14060. // Color of selected window.
  14061. fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",
  14062. // Percent of the slider height
  14063. handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(NL);var gO=G,yO="horizontal",mO="vertical",vO=["line","bar","candlestick","scatter"],xO={easing:"cubicOut",duration:100,delay:0},_O=/** @class */function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=n.type,t._displayables={},t}return Ue(n,e),n.prototype.init=function(t,e){this.api=e,
  14064. // A unique handler for each dataZoom component
  14065. this._onBrush=lt(this._onBrush,this),this._onBrushEnd=lt(this._onBrushEnd,this)},n.prototype.render=function(t,n,i,o){if(e.prototype.render.apply(this,arguments),Bu(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1!==t.get("show")){if(t.noTarget())return this._clear(),void this.group.removeAll();
  14066. // Notice: this._resetInterval() should not be executed when payload.type
  14067. // is 'dataZoom', origin this._range should be maintained, otherwise 'pan'
  14068. // or 'zoom' info will be missed because of 'throttle' of this.dispatchAction,
  14069. o&&"dataZoom"===o.type&&o.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},n.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},n.prototype._clear=function(){Gu(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},n.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var e=this._displayables.sliderGroup=new Z;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},n.prototype._resetLocation=function(){var t=this.dataZoomModel,e=this.api,n=t.get("brushSelect")?7:0,i=this._findCoordRect(),o={width:e.getWidth(),height:e.getHeight()},r=this._orient===yO?{
  14070. // Why using 'right', because right should be used in vertical,
  14071. // and it is better to be consistent for dealing with position param merge.
  14072. right:o.width-i.x-i.width,top:o.height-30-7-n,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},s=wa(t.option);
  14073. // Replace the placeholder value.
  14074. a(["right","top","width","height"],(function(t){"ph"===s[t]&&(s[t]=r[t])}));var l=xa(s,o);this._location={x:l.x,y:l.y},this._size=[l.width,l.height],this._orient===mO&&this._size.reverse()},n.prototype._positionGroup=function(){var t=this.group,e=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),o=i&&i.get("inverse"),r=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;
  14075. // Transform barGroup.
  14076. r.attr(n!==yO||o?n===yO&&o?{scaleY:a?1:-1,scaleX:-1}:n!==mO||o?{scaleY:a?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:a?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:a?1:-1,scaleX:1});
  14077. // Position barGroup
  14078. var s=t.getBoundingRect([r]);t.x=e.x-s.x,t.y=e.y-s.y,t.markRedraw()},n.prototype._getViewExtent=function(){return[0,this._size[0]]},n.prototype._renderBackground=function(){var t=this.dataZoomModel,e=this._size,n=this._displayables.sliderGroup,i=t.get("brushSelect");n.add(new gO({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40}));
  14079. // Click panel, over shadow, below handles.
  14080. var o=new gO({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:lt(this._onClickPanel,this)}),r=this.api.getZr();i?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",r.on("mousemove",this._onBrush),r.on("mouseup",this._onBrushEnd)):(r.off("mousemove",this._onBrush),r.off("mouseup",this._onBrushEnd)),n.add(o)},n.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],t){var e=this._size,n=this._shadowSize||[],i=t.series,o=i.getRawData(),r=i.getShadowDim&&i.getShadowDim(),a=r&&o.getDimensionInfo(r)?i.getShadowDim():t.otherDim;if(null!=a){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;
  14081. // Not re-render if data doesn't change.
  14082. if(o!==this._shadowData||a!==this._shadowDim||e[0]!==n[0]||e[1]!==n[1]){var u=o.getDataExtent(a),c=.3*(u[1]-u[0]);
  14083. // Nice extent.
  14084. u=[u[0]-c,u[1]+c];var d,h=[0,e[1]],p=[0,e[0]],f=[[e[0],0],[0,0]],g=[],y=p[1]/(o.count()-1),m=0,v=Math.round(o.count()/e[0]);o.each([a],(function(t,e){if(v>0&&e%v)m+=y;else{
  14085. // FIXME
  14086. // Should consider axis.min/axis.max when drawing dataShadow.
  14087. // FIXME
  14088. // 应该使用统一的空判断?还是在list里进行空判断?
  14089. var n=null==t||isNaN(t)||""===t,i=n?0:Xe(t,u,h,!0);
  14090. // See #4235.
  14091. // Attempt to draw data shadow precisely when there are empty value.
  14092. n&&!d&&e?(f.push([f[f.length-1][0],0]),g.push([g[g.length-1][0],0])):!n&&d&&(f.push([m,0]),g.push([m,0])),f.push([m,i]),g.push([m,i]),m+=y,d=n}})),s=this._shadowPolygonPts=f,l=this._shadowPolylinePts=g}this._shadowData=o,this._shadowDim=a,this._shadowSize=[e[0],e[1]];
  14093. // let dataBackgroundModel = dataZoomModel.getModel('dataBackground');
  14094. for(var x=this.dataZoomModel,_=0;_<3;_++){var b=S(1===_);this._displayables.sliderGroup.add(b),this._displayables.dataShadowSegs.push(b)}}}function S(t){var e=x.getModel(t?"selectedDataBackground":"dataBackground"),n=new Z,i=new z({shape:{points:s},segmentIgnoreThreshold:1,style:e.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),o=new B({shape:{points:l},segmentIgnoreThreshold:1,style:e.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(i),n.add(o),n}},n.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){
  14095. // Find a representative series.
  14096. var n,i=this.ecModel;return t.eachTargetAxis((function(o,r){var s=t.getAxisProxy(o,r).getTargetSeriesModels();a(s,(function(t){if(!(n||!0!==e&&c(vO,t.get("type"))<0)){var a,s=i.getComponent(TL(o),r).axis,l=function(t){
  14097. // FIXME
  14098. // 这个逻辑和getOtherAxis里一致,但是写在这里是否不好
  14099. var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}(o),u=t.coordinateSystem;null!=l&&u.getOtherAxis&&(a=u.getOtherAxis(s).inverse),l=t.getData().mapDimension(l),n={thisAxis:s,series:t,thisDim:o,otherDim:l,otherAxisInverse:a}}}),this)}),this),n}},n.prototype._renderHandle=function(){var t=this.group,e=this._displayables,n=e.handles=[null,null],i=e.handleLabels=[null,null],o=this._displayables.sliderGroup,r=this._size,s=this.dataZoomModel,l=this.api,u=s.get("borderRadius")||0,c=s.get("brushSelect"),d=e.filler=new gO({silent:c,style:{fill:s.get("fillerColor")},textConfig:{position:"inside"}});o.add(d),
  14100. // Frame border.
  14101. o.add(new gO({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:r[0],height:r[1],r:u},style:{
  14102. // deprecated option
  14103. stroke:s.get("dataBackgroundColor")||s.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),
  14104. // Left and right handle to resize
  14105. a([0,1],(function(e){var r=s.get("handleIcon");!Vc[r]&&r.indexOf("path://")<0&&r.indexOf("image://")<0&&(
  14106. // Compatitable with the old icon parsers. Which can use a path string without path://
  14107. r="path://"+r);var a=Gc(r,-1,0,2,2,null,!0);a.attr({cursor:bO(this._orient),draggable:!0,drift:lt(this._onDragMove,this,e),ondragend:lt(this._onDragEnd,this),onmouseover:lt(this._showDataInfo,this,!0),onmouseout:lt(this._showDataInfo,this,!1),z2:5});var l=a.getBoundingRect(),u=s.get("handleSize");this._handleHeight=je(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,a.setStyle(s.getModel("handleStyle").getItemStyle()),a.style.strokeNoScale=!0,a.rectHover=!0,a.ensureState("emphasis").style=s.getModel(["emphasis","handleStyle"]).getItemStyle(),Yi(a);var c=s.get("handleColor");// deprecated option
  14108. // Compatitable with previous version
  14109. null!=c&&(a.style.fill=c),o.add(n[e]=a);var d=s.getModel("textStyle"),h=(s.get("handleLabel")||{}).show||!1;t.add(i[e]=new $({silent:!0,invisible:!h,style:Zo(d,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:d.getTextColor(),font:d.getFont()}),z2:10}))}),this);
  14110. // Handle to move. Only visible when brushSelect is set true.
  14111. var h=d;if(c){var p=je(s.get("moveHandleSize"),r[1]),f=e.moveHandle=new G({style:s.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:r[1]-.5,height:p}}),g=.8*p,y=e.moveHandleIcon=Gc(s.get("moveHandleIcon"),-g/2,-g/2,g,g,"#fff",!0);y.silent=!0,y.y=r[1]+p/2-.5,f.ensureState("emphasis").style=s.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(r[1]/2,Math.max(p,10));(h=e.moveZone=new G({invisible:!0,shape:{y:r[1]-m,height:p+m}})).on("mouseover",(function(){l.enterEmphasis(f)})).on("mouseout",(function(){l.leaveEmphasis(f)})),o.add(f),o.add(y),o.add(h)}h.attr({draggable:!0,cursor:bO(this._orient),drift:lt(this._onDragMove,this,"all"),ondragstart:lt(this._showDataInfo,this,!0),ondragend:lt(this._onDragEnd,this),onmouseover:lt(this._showDataInfo,this,!0),onmouseout:lt(this._showDataInfo,this,!1)})},n.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[Xe(t[0],[0,100],e,!0),Xe(t[1],[0,100],e,!0)]},n.prototype._updateInterval=function(t,e){var n=this.dataZoomModel,i=this._handleEnds,o=this._getViewExtent(),r=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];Sw(e,i,o,n.get("zoomLock")?"all":t,null!=r.minSpan?Xe(r.minSpan,a,o,!0):null,null!=r.maxSpan?Xe(r.maxSpan,a,o,!0):null);var s=this._range,l=this._range=Ke([Xe(i[0],o,a,!0),Xe(i[1],o,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},n.prototype._updateView=function(t){var e=this._displayables,n=this._handleEnds,i=Ke(n.slice()),o=this._size;a([0,1],(function(t){
  14112. // Handles
  14113. var i=e.handles[t],r=this._handleHeight;i.attr({scaleX:r/2,scaleY:r/2,
  14114. // This is a trick, by adding an extra tiny offset to let the default handle's end point align to the drag window.
  14115. // NOTE: It may affect some custom shapes a bit. But we prefer to have better result by default.
  14116. x:n[t]+(t?-1:1),y:o[1]/2-r/2})}),this),
  14117. // Filler
  14118. e.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:o[1]});var r={x:i[0],width:i[1]-i[0]};
  14119. // Move handle
  14120. e.moveHandle&&(e.moveHandle.setShape(r),e.moveZone.setShape(r),
  14121. // Force update path on the invisible object
  14122. e.moveZone.getBoundingRect(),e.moveHandleIcon&&e.moveHandleIcon.attr("x",r.x+r.width/2));
  14123. // update clip path of shadow.
  14124. for(var s=e.dataShadowSegs,l=[0,i[0],i[1],o[0]],u=0;u<s.length;u++){var c=s[u],d=c.getClipPath();d||(d=new G,c.setClipPath(d)),d.setShape({x:l[u],y:0,width:l[u+1]-l[u],height:o[1]})}this._updateDataInfo(t)},n.prototype._updateDataInfo=function(t){var e=this.dataZoomModel,n=this._displayables,i=n.handleLabels,o=this._orient,r=["",""];
  14125. // FIXME
  14126. // date型,支持formatter,autoformatter(ec2 date.getAutoFormatter)
  14127. if(e.get("showDetail")){var a=e.findRepresentativeAxisProxy();if(a){var s=a.getAxisModel().axis,l=this._range,u=t?a.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:a.getDataValueWindow();r=[this._formatLabel(u[0],s),this._formatLabel(u[1],s)]}}var c=Ke(this._handleEnds.slice());function d(t){
  14128. // Label
  14129. // Text should not transform by barGroup.
  14130. // Ignore handlers transform
  14131. var e=Do(n.handles[t].parent,this.group),a=Co(0===t?"right":"left",e),s=this._handleWidth/2+5,l=To([c[t]+(0===t?-s:s),this._size[1]/2],e);i[t].setStyle({x:l[0],y:l[1],verticalAlign:o===yO?"middle":a,align:o===yO?a:"center",text:r[t]})}d.call(this,0),d.call(this,1)},n.prototype._formatLabel=function(e,n){var i=this.dataZoomModel,o=i.get("labelFormatter"),r=i.get("labelPrecision");null!=r&&"auto"!==r||(r=n.getPixelPrecision());var a=null==e||isNaN(e)?"":"category"===n.type||"time"===n.type?n.scale.getLabel({value:Math.round(e)}):e.toFixed(Math.min(r,20));return f(o)?o(e,a):t(o)?o.replace("{value}",a):a},
  14132. /**
  14133. * @param isEmphasis true: show, false: hide
  14134. */
  14135. n.prototype._showDataInfo=function(t){var e=(this.dataZoomModel.get("handleLabel")||{}).show||!1,n=this.dataZoomModel.getModel(["emphasis","handleLabel"]).get("show")||!1,i=t||this._dragging?n:e,o=this._displayables,r=o.handleLabels;r[0].attr("invisible",!i),r[1].attr("invisible",!i),
  14136. // Highlight move handle
  14137. o.moveHandle&&this.api[i?"enterEmphasis":"leaveEmphasis"](o.moveHandle,1)},n.prototype._onDragMove=function(t,e,n,i){this._dragging=!0,
  14138. // For mobile device, prevent screen slider on the button.
  14139. jt(i.event);
  14140. // Transform dx, dy to bar coordination.
  14141. var o=To([e,n],this._displayables.sliderGroup.getLocalTransform(),!0),r=this._updateInterval(t,o[0]),a=this.dataZoomModel.get("realtime");this._updateView(!a),
  14142. // Avoid dispatch dataZoom repeatly but range not changed,
  14143. // which cause bad visual effect when progressive enabled.
  14144. r&&a&&this._dispatchZoomAction(!0)},n.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction(!1)},n.prototype._onClickPanel=function(t){var e=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(n[0]<0||n[0]>e[0]||n[1]<0||n[1]>e[1])){var i=this._handleEnds,o=(i[0]+i[1])/2,r=this._updateInterval("all",n[0]-o);this._updateView(),r&&this._dispatchZoomAction(!1)}},n.prototype._onBrushStart=function(t){var e=t.offsetX,n=t.offsetY;this._brushStart=new K(e,n),this._brushing=!0,this._brushStartTime=+new Date},n.prototype._onBrushEnd=function(t){if(this._brushing){var e=this._displayables.brushRect;if(this._brushing=!1,e){e.attr("ignore",!0);var n=e.shape;
  14145. // console.log(brushEndTime - this._brushStartTime);
  14146. if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var i=this._getViewExtent(),o=[0,100];this._range=Ke([Xe(n.x,i,o,!0),Xe(n.x+n.width,i,o,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},n.prototype._onBrush=function(t){this._brushing&&(
  14147. // For mobile device, prevent screen slider on the button.
  14148. jt(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},n.prototype._updateBrushRect=function(t,e){var n=this._displayables,i=this.dataZoomModel,o=n.brushRect;o||(o=n.brushRect=new gO({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(o)),o.attr("ignore",!1);var r=this._brushStart,a=this._displayables.sliderGroup,s=a.transformCoordToLocal(t,e),l=a.transformCoordToLocal(r.x,r.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),o.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},
  14149. /**
  14150. * This action will be throttled.
  14151. */
  14152. n.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?xO:null,start:e[0],end:e[1]})},n.prototype._findCoordRect=function(){
  14153. // Find the grid corresponding to the first axis referred by dataZoom.
  14154. var t,e=AL(this.dataZoomModel).infoList;if(!t&&e.length){var n=e[0].model.coordinateSystem;t=n.getRect&&n.getRect()}if(!t){var i=this.api.getWidth(),o=this.api.getHeight();t={x:.2*i,y:.2*o,width:.6*i,height:.6*o}}return t},n.type="dataZoom.slider",n}(RL);
  14155. // Constants
  14156. function bO(t){return"vertical"===t?"ns-resize":"ew-resize"}const SO=_O;function wO(t){t.registerComponentModel(fO),t.registerComponentView(SO),HL(t)}var MO={
  14157. /**
  14158. * @public
  14159. */
  14160. get:function(t,e,n){var o=et((IO[t]||{})[e]);return n&&i(o)?o[o.length-1]:o}},IO={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}};const DO=MO;var TO=mb.mapVisual,CO=mb.eachVisual,AO=i,LO=a,kO=Ke,PO=Xe,NO=/** @class */function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=n.type,t.stateList=["inRange","outOfRange"],t.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],t.layoutMode={type:"box",ignoreSize:!0},
  14161. /**
  14162. * [lowerBound, upperBound]
  14163. */
  14164. t.dataBound=[-Infinity,Infinity],t.targetVisuals={},t.controllerVisuals={},t}return Ue(n,e),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},
  14165. /**
  14166. * @protected
  14167. */
  14168. n.prototype.optionUpdated=function(t,e){var n=this.option;!e&&fP(n,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},
  14169. /**
  14170. * @protected
  14171. */
  14172. n.prototype.resetVisual=function(t){var e=this.stateList;t=lt(t,this),this.controllerVisuals=pP(this.option.controller,e,t),this.targetVisuals=pP(this.option.target,e,t)},
  14173. /**
  14174. * @public
  14175. */
  14176. n.prototype.getItemSymbol=function(){return null},
  14177. /**
  14178. * @protected
  14179. * @return {Array.<number>} An array of series indices.
  14180. */
  14181. n.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,e=[];return null==t||"all"===t?this.ecModel.eachSeries((function(t,n){e.push(n)})):e=Sn(t),e},
  14182. /**
  14183. * @public
  14184. */
  14185. n.prototype.eachTargetSeries=function(t,e){a(this.getTargetSeriesIndices(),(function(n){var i=this.ecModel.getSeriesByIndex(n);i&&t.call(e,i)}),this)},
  14186. /**
  14187. * @pubilc
  14188. */
  14189. n.prototype.isTargetSeries=function(t){var e=!1;return this.eachTargetSeries((function(n){n===t&&(e=!0)})),e},
  14190. /**
  14191. * @example
  14192. * this.formatValueText(someVal); // format single numeric value to text.
  14193. * this.formatValueText(someVal, true); // format single category value to text.
  14194. * this.formatValueText([min, max]); // format numeric min-max to text.
  14195. * this.formatValueText([this.dataBound[0], max]); // using data lower bound.
  14196. * this.formatValueText([min, this.dataBound[1]]); // using data upper bound.
  14197. *
  14198. * @param value Real value, or this.dataBound[0 or 1].
  14199. * @param isCategory Only available when value is number.
  14200. * @param edgeSymbols Open-close symbol when value is interval.
  14201. * @protected
  14202. */
  14203. n.prototype.formatValueText=function(e,n,o){var r,a=this.option,s=a.precision,l=this.dataBound,u=a.formatter;o=o||["<",">"],i(e)&&(e=e.slice(),r=!0);var c=n?e:r?[d(e[0]),d(e[1])]:d(e);return t(u)?u.replace("{value}",r?c[0]:c).replace("{value2}",r?c[1]:c):f(u)?r?u(e[0],e[1]):u(e):r?e[0]===l[0]?o[0]+" "+c[1]:e[1]===l[1]?o[1]+" "+c[0]:c[0]+" - "+c[1]:c;function d(t){return t===l[0]?"min":t===l[1]?"max":(+t).toFixed(Math.min(s,20))}},
  14204. /**
  14205. * @protected
  14206. */
  14207. n.prototype.resetExtent=function(){var t=this.option,e=kO([t.min,t.max]);
  14208. // Can not calculate data extent by data here.
  14209. // Because series and data may be modified in processing stage.
  14210. // So we do not support the feature "auto min/max".
  14211. this._dataExtent=e},
  14212. /**
  14213. * PENDING:
  14214. * delete this method if no outer usage.
  14215. *
  14216. * Return Concrete dimension. If null/undefined is returned, no dimension is used.
  14217. */
  14218. // getDataDimension(data: SeriesData) {
  14219. // const optDim = this.option.dimension;
  14220. // if (optDim != null) {
  14221. // return data.getDimension(optDim);
  14222. // }
  14223. // const dimNames = data.dimensions;
  14224. // for (let i = dimNames.length - 1; i >= 0; i--) {
  14225. // const dimName = dimNames[i];
  14226. // const dimInfo = data.getDimensionInfo(dimName);
  14227. // if (!dimInfo.isCalculationCoord) {
  14228. // return dimName;
  14229. // }
  14230. // }
  14231. // }
  14232. n.prototype.getDataDimensionIndex=function(t){var e=this.option.dimension;if(null!=e)return t.getDimensionIndex(e);for(var n=t.dimensions,i=n.length-1;i>=0;i--){var o=n[i],r=t.getDimensionInfo(o);if(!r.isCalculationCoord)return r.storeDimIndex}},n.prototype.getExtent=function(){return this._dataExtent.slice()},n.prototype.completeVisualOption=function(){var t=this.ecModel,e=this.option,n={inRange:e.inRange,outOfRange:e.outOfRange},i=e.target||(e.target={}),o=e.controller||(e.controller={});tt(i,n),// Do not override
  14233. tt(o,n);// Do not override
  14234. var r=this.isCategory();function a(n){
  14235. // Compatible with ec2 dataRange.color.
  14236. // The mapping order of dataRange.color is: [high value, ..., low value]
  14237. // whereas inRange.color and outOfRange.color is [low value, ..., high value]
  14238. // Notice: ec2 has no inverse.
  14239. AO(e.color)&&!n.inRange&&(n.inRange={color:e.color.slice().reverse()}),
  14240. // Compatible with previous logic, always give a default color, otherwise
  14241. // simple config with no inRange and outOfRange will not work.
  14242. // Originally we use visualMap.color as the default color, but setOption at
  14243. // the second time the default color will be erased. So we change to use
  14244. // constant DEFAULT_COLOR.
  14245. // If user do not want the default color, set inRange: {color: null}.
  14246. n.inRange=n.inRange||{color:t.get("gradientColor")}}a.call(this,i),a.call(this,o),function(t,e,n){var i=t[e],o=t[n];i&&!o&&(o=t[n]={},LO(i,(function(t,e){if(mb.isValidType(e)){var n=DO.get(e,"inactive",r);null!=n&&(o[e]=n,
  14247. // Compatibable with ec2:
  14248. // Only inactive color to rgba(0,0,0,0) can not
  14249. // make label transparent, so use opacity also.
  14250. "color"!==e||o.hasOwnProperty("opacity")||o.hasOwnProperty("colorAlpha")||(o.opacity=[0,0]))}})))}.call(this,i,"inRange","outOfRange"),
  14251. // completeInactive.call(this, target, 'outOfRange', 'inRange');
  14252. function(t){var e=(t.inRange||{}).symbol||(t.outOfRange||{}).symbol,n=(t.inRange||{}).symbolSize||(t.outOfRange||{}).symbolSize,i=this.get("inactiveColor"),o=this.getItemSymbol()||"roundRect";LO(this.stateList,(function(a){var s=this.itemSize,l=t[a];
  14253. // Set inactive color for controller if no other color
  14254. // attr (like colorAlpha) specified.
  14255. l||(l=t[a]={color:r?i:[i]}),
  14256. // Consistent symbol and symbolSize if not specified.
  14257. null==l.symbol&&(l.symbol=e&&et(e)||(r?o:[o])),null==l.symbolSize&&(l.symbolSize=n&&et(n)||(r?s[0]:[s[0],s[0]])),
  14258. // Filter none
  14259. l.symbol=TO(l.symbol,(function(t){return"none"===t?o:t}));
  14260. // Normalize symbolSize
  14261. var u=l.symbolSize;if(null!=u){var c=-Infinity;
  14262. // symbolSize can be object when categories defined.
  14263. CO(u,(function(t){t>c&&(c=t)})),l.symbolSize=TO(u,(function(t){return PO(t,[0,c],[0,s[0]],!0)}))}}),this)}.call(this,o)},n.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},n.prototype.isCategory=function(){return!!this.option.categories},
  14264. /**
  14265. * @public
  14266. * @abstract
  14267. */
  14268. n.prototype.setSelected=function(t){},n.prototype.getSelected=function(){return null},
  14269. /**
  14270. * @public
  14271. * @abstract
  14272. */
  14273. n.prototype.getValueState=function(t){return null},
  14274. /**
  14275. * FIXME
  14276. * Do not publish to thirt-part-dev temporarily
  14277. * util the interface is stable. (Should it return
  14278. * a function but not visual meta?)
  14279. *
  14280. * @pubilc
  14281. * @abstract
  14282. * @param getColorVisual
  14283. * params: value, valueState
  14284. * return: color
  14285. * @return {Object} visualMeta
  14286. * should includes {stops, outerColors}
  14287. * outerColor means [colorBeyondMinValue, colorBeyondMaxValue]
  14288. */
  14289. n.prototype.getVisualMeta=function(t){return null},n.type="visualMap",n.dependencies=["series"],n.defaultOption={show:!0,
  14290. // zlevel: 0,
  14291. z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,
  14292. // 接受数组分别设定上右下左边距,同css
  14293. textGap:10,precision:0,textStyle:{color:"#333"}},n}(Ta);const OO=NO;
  14294. // Constant
  14295. var RO=[20,140],EO=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}
  14296. /**
  14297. * @override
  14298. */return Ue(e,t),e.prototype.optionUpdated=function(e,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual((function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()})),this._resetRange()},
  14299. /**
  14300. * @protected
  14301. * @override
  14302. */
  14303. e.prototype.resetItemSize=function(){t.prototype.resetItemSize.apply(this,arguments);var e=this.itemSize;(null==e[0]||isNaN(e[0]))&&(e[0]=RO[0]),(null==e[1]||isNaN(e[1]))&&(e[1]=RO[1])},
  14304. /**
  14305. * @private
  14306. */
  14307. e.prototype._resetRange=function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(
  14308. // `range` should always be array (so we don't use other
  14309. // value like 'auto') for user-friend. (consider getOption).
  14310. t.auto=1,this.option.range=t):i(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},
  14311. /**
  14312. * @protected
  14313. * @override
  14314. */
  14315. e.prototype.completeVisualOption=function(){t.prototype.completeVisualOption.apply(this,arguments),a(this.stateList,(function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=e[1]/3)}),this)},
  14316. /**
  14317. * @override
  14318. */
  14319. e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},
  14320. /**
  14321. * @public
  14322. */
  14323. e.prototype.getSelected=function(){var t=this.getExtent(),e=Ke((this.get("range")||[]).slice());
  14324. // Clamp
  14325. return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]<t[0]&&(e[0]=t[0]),e[1]<t[0]&&(e[1]=t[0]),e},
  14326. /**
  14327. * @override
  14328. */
  14329. e.prototype.getValueState=function(t){var e=this.option.range,n=this.getExtent();
  14330. // When range[0] === dataExtent[0], any value larger than dataExtent[0] maps to 'inRange'.
  14331. // range[1] is processed likewise.
  14332. return(e[0]<=n[0]||e[0]<=t)&&(e[1]>=n[1]||t<=e[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var e=[];return this.eachTargetSeries((function(n){var i=[],o=n.getData();o.each(this.getDataDimensionIndex(o),(function(e,n){t[0]<=e&&e<=t[1]&&i.push(n)}),this),e.push({seriesId:n.id,dataIndex:i})}),this),e},
  14333. /**
  14334. * @implement
  14335. */
  14336. e.prototype.getVisualMeta=function(t){var e=VO(this,"outOfRange",this.getExtent()),n=VO(this,"inRange",this.option.range.slice()),i=[];function o(e,n){i.push({value:e,color:t(e,n)})}
  14337. // Format to: outOfRange -- inRange -- outOfRange.
  14338. for(var r=0,a=0,s=n.length,l=e.length;a<l&&(!n.length||e[a]<=n[0]);a++)
  14339. // If oVal[oIdx] === iVals[iIdx], oVal[oIdx] should be ignored.
  14340. e[a]<n[r]&&o(e[a],"outOfRange");for(var u=1;r<s;r++,u=0)
  14341. // If range is full, value beyond min, max will be clamped.
  14342. // make a singularity
  14343. u&&i.length&&o(n[r],"outOfRange"),o(n[r],"inRange");for(u=1;a<l;a++)(!n.length||n[n.length-1]<e[a])&&(
  14344. // make a singularity
  14345. u&&(i.length&&o(i[i.length-1].value,"outOfRange"),u=0),o(e[a],"outOfRange"));var c=i.length;return{stops:i,outerColors:[c?i[0].color:"transparent",c?i[c-1].color:"transparent"]}},e.type="visualMap.continuous",e.defaultOption=xr(OO.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),e}(OO);function VO(t,e,n){if(n[0]===n[1])return n.slice();
  14346. // When using colorHue mapping, it is not linear color any more.
  14347. // Moreover, canvas gradient seems not to be accurate linear.
  14348. // FIXME
  14349. // Should be arbitrary value 100? or based on pixel size?
  14350. for(var i=(n[1]-n[0])/200,o=n[0],r=[],a=0;a<=200&&o<n[1];a++)r.push(o),o+=i;return r.push(n[1]),r}const zO=EO;const BO=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.autoPositionValues={left:1,right:1,top:1,bottom:1},n}return Ue(e,t),e.prototype.init=function(t,e){this.ecModel=t,this.api=e},
  14351. /**
  14352. * @protected
  14353. */
  14354. e.prototype.render=function(t,e,n,i){this.visualMapModel=t,!1!==t.get("show")?this.doRender(t,e,n,i):this.group.removeAll()},
  14355. /**
  14356. * @protected
  14357. */
  14358. e.prototype.renderBackground=function(t){var e=this.visualMapModel,n=aa(e.get("padding")||0),i=t.getBoundingRect();t.add(new G({z2:-1,silent:!0,shape:{x:i.x-n[3],y:i.y-n[0],width:i.width+n[3]+n[1],height:i.height+n[0]+n[2]},style:{fill:e.get("backgroundColor"),stroke:e.get("borderColor"),lineWidth:e.get("borderWidth")}}))},
  14359. /**
  14360. * @protected
  14361. * @param targetValue can be Infinity or -Infinity
  14362. * @param visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize'
  14363. * @param opts
  14364. * @param opts.forceState Specify state, instead of using getValueState method.
  14365. * @param opts.convertOpacityToAlpha For color gradient in controller widget.
  14366. * @return {*} Visual value.
  14367. */
  14368. e.prototype.getControllerVisual=function(t,e,n){var i=(n=n||{}).forceState,o=this.visualMapModel,r={};
  14369. // Default values.
  14370. if("color"===e){var s=o.get("contentColor");r.color=s}function l(t){return r[t]}function u(t,e){r[t]=e}var c=o.controllerVisuals[i||o.getValueState(t)],d=mb.prepareVisualTypes(c);return a(d,(function(i){var o=c[i];n.convertOpacityToAlpha&&"opacity"===i&&(i="colorAlpha",o=c.__alphaForOpacity),mb.dependsOn(i,e)&&o&&o.applyVisual(t,l,u)})),r[e]},e.prototype.positionGroup=function(t){var e=this.visualMapModel,n=this.api;_a(t,e.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},e.prototype.doRender=function(t,e,n,i){},e.type="visualMap",e}(Mu);var GO=[["left","right","width"],["top","bottom","height"]];
  14371. /**
  14372. * @param visualMapModel
  14373. * @param api
  14374. * @param itemSize always [short, long]
  14375. * @return {string} 'left' or 'right' or 'top' or 'bottom'
  14376. */function FO(t,e,n){var i=t.option,o=i.align;if(null!=o&&"auto"!==o)return o;
  14377. // Auto decision align.
  14378. for(var r={width:e.getWidth(),height:e.getHeight()},a="horizontal"===i.orient?1:0,s=GO[a],l=[0,null,10],u={},c=0;c<3;c++)u[GO[1-a][c]]=l[c],u[s[c]]=2===c?n[0]:i[s[c]];var d=[["x","width",3],["y","height",0]][a],h=xa(u,r,i.padding);return s[(h.margin[d[2]]||0)+h[d[0]]+.5*h[d[1]]<.5*r[d[1]]?0:1]}
  14379. /**
  14380. * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and
  14381. * dataIndexInside means filtered index.
  14382. */
  14383. // TODO: TYPE more specified payload types.
  14384. function WO(t,e){return a(t||[],(function(t){null!=t.dataIndex&&(t.dataIndexInside=t.dataIndex,t.dataIndex=null),t.highlightKey="visualMap"+(e?e.componentIndex:"")})),t}var HO=Xe,YO=a,UO=Math.min,ZO=Math.max,XO=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._shapes={},n._dataInterval=[],n._handleEnds=[],n._hoverLinkDataIndices=[],n}return Ue(e,t),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this._hoverLinkFromSeriesMouseOver=lt(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=lt(this._hideIndicator,this)},e.prototype.doRender=function(t,e,n,i){i&&"selectDataRange"===i.type&&i.from===this.uid||this._buildView()},e.prototype._buildView=function(){this.group.removeAll();var t=this.visualMapModel,e=this.group;this._orient=t.get("orient"),this._useHandle=t.get("calculable"),this._resetInterval(),this._renderBar(e);var n=t.get("text");this._renderEndsText(e,n,0),this._renderEndsText(e,n,1),
  14385. // Do this for background size calculation.
  14386. this._updateView(!0),
  14387. // After updating view, inner shapes is built completely,
  14388. // and then background can be rendered.
  14389. this.renderBackground(e),
  14390. // Real update view
  14391. this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(e)},e.prototype._renderEndsText=function(t,e,n){if(e){
  14392. // Compatible with ec2, text[0] map to high value, text[1] map low value.
  14393. var i=e[1-n];i=null!=i?i+"":"";var o=this.visualMapModel,r=o.get("textGap"),a=o.itemSize,s=this._shapes.mainGroup,l=this._applyTransform([a[0]/2,0===n?-r:a[1]+r],s),u=this._applyTransform(0===n?"bottom":"top",s),c=this._orient,d=this.visualMapModel.textStyleModel;this.group.add(new $({style:Zo(d,{x:l[0],y:l[1],verticalAlign:"horizontal"===c?"middle":u,align:"horizontal"===c?u:"center",text:i})}))}},e.prototype._renderBar=function(t){var e=this.visualMapModel,n=this._shapes,i=e.itemSize,o=this._orient,r=this._useHandle,a=FO(e,this.api,i),s=n.mainGroup=this._createBarGroup(a),l=new Z;s.add(l),
  14394. // Bar
  14395. l.add(n.outOfRange=jO()),l.add(n.inRange=jO(null,r?KO(this._orient):null,lt(this._dragHandle,this,"all",!1),lt(this._dragHandle,this,"all",!0))),
  14396. // A border radius clip.
  14397. l.setClipPath(new G({shape:{x:0,y:0,width:i[0],height:i[1],r:3}}));var u=e.textStyleModel.getTextRect("国"),c=ZO(u.width,u.height);
  14398. // Handle
  14399. r&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(e,s,0,i,c,o),this._createHandle(e,s,1,i,c,o)),this._createIndicator(e,s,i,c,o),t.add(s)},e.prototype._createHandle=function(t,e,n,i,o,r){var a=lt(this._dragHandle,this,n,!1),s=lt(this._dragHandle,this,n,!0),l=Mt(t.get("handleSize"),i[0]),u=Gc(t.get("handleIcon"),-l/2,-l/2,l,l,null,!0),c=KO(this._orient);u.attr({cursor:c,draggable:!0,drift:a,ondragend:s,onmousemove:function(t){jt(t.event)}}),u.x=i[0]/2,u.useStyle(t.getModel("handleStyle").getItemStyle()),u.setStyle({strokeNoScale:!0,strokeFirst:!0}),u.style.lineWidth*=2,u.ensureState("emphasis").style=t.getModel(["emphasis","handleStyle"]).getItemStyle(),Ki(u,!0),e.add(u);
  14400. // Text is always horizontal layout but should not be effected by
  14401. // transform (orient/inverse). So label is built separately but not
  14402. // use zrender/graphic/helper/RectText, and is located based on view
  14403. // group (according to handleLabelPoint) but not barGroup.
  14404. var d=this.visualMapModel.textStyleModel,h=new $({cursor:c,draggable:!0,drift:a,onmousemove:function(t){
  14405. // For mobile device, prevent screen slider on the button.
  14406. jt(t.event)},ondragend:s,style:Zo(d,{x:0,y:0,text:""})});h.ensureState("blur").style={opacity:.1},h.stateTransition={duration:200},this.group.add(h);var p=[l,0],f=this._shapes;f.handleThumbs[n]=u,f.handleLabelPoints[n]=p,f.handleLabels[n]=h},e.prototype._createIndicator=function(t,e,n,i,o){var r=Mt(t.get("indicatorSize"),n[0]),a=Gc(t.get("indicatorIcon"),-r/2,-r/2,r,r,null,!0);a.attr({cursor:"move",invisible:!0,silent:!0,x:n[0]/2});var s=t.getModel("indicatorStyle").getItemStyle();if(a instanceof b){var l=a.style;a.useStyle(p({
  14407. // TODO other properties like x, y ?
  14408. image:l.image,x:l.x,y:l.y,width:l.width,height:l.height},s))}else a.useStyle(s);e.add(a);var u=this.visualMapModel.textStyleModel,c=new $({silent:!0,invisible:!0,style:Zo(u,{x:0,y:0,text:""})});this.group.add(c);var d=[("horizontal"===o?i/2:6)+n[0]/2,0],h=this._shapes;h.indicator=a,h.indicatorLabel=c,h.indicatorLabelPoint=d,this._firstShowIndicator=!0},e.prototype._dragHandle=function(t,e,
  14409. // dx is event from ondragend if isEnd is true. It's not used
  14410. n,i){if(this._useHandle){if(this._dragging=!e,!e){
  14411. // Transform dx, dy to bar coordination.
  14412. var o=this._applyTransform([n,i],this._shapes.mainGroup,!0);this._updateInterval(t,o[1]),this._hideIndicator(),
  14413. // Considering realtime, update view should be executed
  14414. // before dispatch action.
  14415. this._updateView()}
  14416. // dragEnd do not dispatch action when realtime.
  14417. e===!this.visualMapModel.get("realtime")&&
  14418. // jshint ignore:line
  14419. this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),e?!this._hovering&&this._clearHoverLinkToSeries():qO(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[t],!1)}},e.prototype._resetInterval=function(){var t=this.visualMapModel,e=this._dataInterval=t.getSelected(),n=t.getExtent(),i=[0,t.itemSize[1]];this._handleEnds=[HO(e[0],n,i,!0),HO(e[1],n,i,!0)]},
  14420. /**
  14421. * @private
  14422. * @param {(number|string)} handleIndex 0 or 1 or 'all'
  14423. * @param {number} dx
  14424. * @param {number} dy
  14425. */
  14426. e.prototype._updateInterval=function(t,e){e=e||0;var n=this.visualMapModel,i=this._handleEnds,o=[0,n.itemSize[1]];Sw(e,i,o,t,
  14427. // cross is forbidden
  14428. 0);var r=n.getExtent();
  14429. // Update data interval.
  14430. this._dataInterval=[HO(i[0],o,r,!0),HO(i[1],o,r,!0)]},e.prototype._updateView=function(t){var e=this.visualMapModel,n=e.getExtent(),i=this._shapes,o=[0,e.itemSize[1]],r=t?o:this._handleEnds,a=this._createBarVisual(this._dataInterval,n,r,"inRange"),s=this._createBarVisual(n,n,o,"outOfRange");i.inRange.setStyle({fill:a.barColor}).setShape("points",a.barPoints),i.outOfRange.setStyle({fill:s.barColor}).setShape("points",s.barPoints),this._updateHandle(r,a)},e.prototype._createBarVisual=function(t,e,n,i){var o={forceState:i,convertOpacityToAlpha:!0},r=this._makeColorGradient(t,o),a=[this.getControllerVisual(t[0],"symbolSize",o),this.getControllerVisual(t[1],"symbolSize",o)],s=this._createBarPoints(n,a);return{barColor:new j(0,0,0,1,r),barPoints:s,handlesColor:[r[0].color,r[r.length-1].color]}},e.prototype._makeColorGradient=function(t,e){
  14431. // Considering colorHue, which is not linear, so we have to sample
  14432. // to calculate gradient color stops, but not only calculate head
  14433. // and tail.
  14434. var n=[],i=(t[1]-t[0])/100;// Arbitrary value.
  14435. n.push({color:this.getControllerVisual(t[0],"color",e),offset:0});for(var o=1;o<100;o++){var r=t[0]+i*o;if(r>t[1])break;n.push({color:this.getControllerVisual(r,"color",e),offset:o/100})}return n.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),n},e.prototype._createBarPoints=function(t,e){var n=this.visualMapModel.itemSize;return[[n[0]-e[0],t[0]],[n[0],t[0]],[n[0],t[1]],[n[0]-e[1],t[1]]]},e.prototype._createBarGroup=function(t){var e=this._orient,n=this.visualMapModel.get("inverse");return new Z("horizontal"!==e||n?"horizontal"===e&&n?{scaleX:"bottom"===t?-1:1,rotation:-Math.PI/2}:"vertical"!==e||n?{scaleX:"left"===t?1:-1}:{scaleX:"left"===t?1:-1,scaleY:-1}:{scaleX:"bottom"===t?1:-1,rotation:Math.PI/2})},e.prototype._updateHandle=function(t,e){if(this._useHandle){var n=this._shapes,i=this.visualMapModel,o=n.handleThumbs,r=n.handleLabels,a=i.itemSize,s=i.getExtent(),l=this._applyTransform("left",n.mainGroup);YO([0,1],(function(u){var c=o[u];c.setStyle("fill",e.handlesColor[u]),c.y=t[u];var d=HO(t[u],[0,a[1]],s,!0),h=this.getControllerVisual(d,"symbolSize");c.scaleX=c.scaleY=h/a[0],c.x=a[0]-h/2;
  14436. // Update handle label position.
  14437. var p=To(n.handleLabelPoints[u],Do(c,this.group));if("horizontal"===this._orient){
  14438. // If visualMap controls symbol size, an additional offset needs to be added to labels to avoid collision at minimum size.
  14439. // Offset reaches value of 0 at "maximum" position, so maximum position is not altered at all.
  14440. var f="left"===l||"top"===l?(a[0]-h)/2:(a[0]-h)/-2;p[1]+=f}r[u].setStyle({x:p[0],y:p[1],text:i.formatValueText(this._dataInterval[u]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})}),this)}},e.prototype._showIndicator=function(t,e,n,i){var o=this.visualMapModel,r=o.getExtent(),a=o.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var c=this.getControllerVisual(t,"color",{convertOpacityToAlpha:!0}),d=this.getControllerVisual(t,"symbolSize"),h=HO(t,r,s,!0),p=a[0]-d/2,f={x:u.x,y:u.y};
  14441. // Update handle label position.
  14442. u.y=h,u.x=p;var g=To(l.indicatorLabelPoint,Do(u,this.group)),y=l.indicatorLabel;y.attr("invisible",!1);var m=this._applyTransform("left",l.mainGroup),v="horizontal"===this._orient;y.setStyle({text:(n||"")+o.formatValueText(e),verticalAlign:v?m:"middle",align:v?"center":m});var x={x:p,y:h,style:{fill:c}},_={style:{x:g[0],y:g[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var b={duration:100,easing:"cubicInOut",additive:!0};u.x=f.x,u.y=f.y,u.animateTo(x,b),y.animateTo(_,b)}else u.attr(x),y.attr(_);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var w=0;w<S.length;w++)
  14443. // Fade out handle labels.
  14444. // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.
  14445. this.api.enterBlur(S[w])}},e.prototype._enableHoverLinkToSeries=function(){var t=this;this._shapes.mainGroup.on("mousemove",(function(e){if(t._hovering=!0,!t._dragging){var n=t.visualMapModel.itemSize,i=t._applyTransform([e.offsetX,e.offsetY],t._shapes.mainGroup,!0,!0);
  14446. // For hover link show when hover handle, which might be
  14447. // below or upper than sizeExtent.
  14448. i[1]=UO(ZO(0,i[1]),n[1]),t._doHoverLinkToSeries(i[1],0<=i[0]&&i[0]<=n[0])}})).on("mouseout",(function(){
  14449. // When mouse is out of handle, hoverLink still need
  14450. // to be displayed when realtime is set as false.
  14451. t._hovering=!1,!t._dragging&&t._clearHoverLinkToSeries()}))},e.prototype._enableHoverLinkFromSeries=function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},e.prototype._doHoverLinkToSeries=function(t,e){var n=this.visualMapModel,i=n.itemSize;if(n.option.hoverLink){var o=[0,i[1]],r=n.getExtent();
  14452. // For hover link show when hover handle, which might be below or upper than sizeExtent.
  14453. t=UO(ZO(o[0],t),o[1]);var a=function(t,e,n){var i=6,o=t.get("hoverLinkDataSize");o&&(i=HO(o,e,n,!0)/2);return i}(n,r,o),s=[t-a,t+a],l=HO(t,o,r,!0),u=[HO(s[0],o,r,!0),HO(s[1],o,r,!0)];
  14454. // Consider data range is out of visualMap range, see test/visualMap-continuous.html,
  14455. // where china and india has very large population.
  14456. s[0]<o[0]&&(u[0]=-Infinity),s[1]>o[1]&&(u[1]=Infinity),
  14457. // Do not show indicator when mouse is over handle,
  14458. // otherwise labels overlap, especially when dragging.
  14459. e&&(-Infinity===u[0]?this._showIndicator(l,u[1],"< ",a):Infinity===u[1]?this._showIndicator(l,u[0],"> ",a):this._showIndicator(l,l,"≈ ",a));
  14460. // When realtime is set as false, handles, which are in barGroup,
  14461. // also trigger hoverLink, which help user to realize where they
  14462. // focus on when dragging. (see test/heatmap-large.html)
  14463. // When realtime is set as true, highlight will not show when hover
  14464. // handle, because the label on handle, which displays a exact value
  14465. // but not range, might mislead users.
  14466. var c=this._hoverLinkDataIndices,d=[];(e||qO(n))&&(d=this._hoverLinkDataIndices=n.findTargetDataIndices(u));var h=function(t,e){var n={},i={};return o(t||[],n),o(e||[],i,n),[r(n),r(i)];function o(t,e,n){for(var i=0,o=t.length;i<o;i++){var r=Ln(t[i].seriesId,null);if(null==r)return;for(var a=Sn(t[i].dataIndex),s=n&&n[r],l=0,u=a.length;l<u;l++){var c=a[l];s&&s[c]?s[c]=null:(e[r]||(e[r]={}))[c]=1}}}function r(t,e){var n=[];for(var i in t)if(t.hasOwnProperty(i)&&null!=t[i])if(e)n.push(+i);else{var o=r(t[i],!0);o.length&&n.push({seriesId:i,dataIndex:o})}return n}}(c,d);this._dispatchHighDown("downplay",WO(h[0],n)),this._dispatchHighDown("highlight",WO(h[1],n))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var e;if(kc(t.target,(function(t){var n=ni(t);if(null!=n.dataIndex)return e=n,!0}),!0),e){var n=this.ecModel.getSeriesByIndex(e.seriesIndex),i=this.visualMapModel;if(i.isTargetSeries(n)){var o=n.getData(e.dataType),r=o.getStore().get(i.getDataDimensionIndex(o),e.dataIndex);isNaN(r)||this._showIndicator(r,r)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var e=this._shapes.handleLabels;if(e)for(var n=0;n<e.length;n++)
  14467. // Fade out handle labels.
  14468. // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.
  14469. this.api.leaveBlur(e[n])},e.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var t=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",WO(t,this.visualMapModel)),t.length=0},e.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var t=this.api.getZr();t.off("mouseover",this._hoverLinkFromSeriesMouseOver),t.off("mouseout",this._hideIndicator)},e.prototype._applyTransform=function(t,e,n,o){var r=Do(e,o?null:this.group);return i(t)?To(t,r,n):Co(t,r,n)},
  14470. // TODO: TYPE more specified payload types.
  14471. e.prototype._dispatchHighDown=function(t,e){e&&e.length&&this.api.dispatchAction({type:t,batch:e})},
  14472. /**
  14473. * @override
  14474. */
  14475. e.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},e.type="visualMap.continuous",e}(BO);function jO(t,e,n,i){return new z({shape:{points:t},draggable:!!n,cursor:e,drift:n,onmousemove:function(t){
  14476. // For mobile device, prevent screen slider on the button.
  14477. jt(t.event)},ondragend:i})}function qO(t){var e=t.get("hoverLinkOnHandle");return!!(null==e?t.get("realtime"):e)}function KO(t){return"vertical"===t?"ns-resize":"ew-resize"}const JO=XO;
  14478. /*
  14479. * Licensed to the Apache Software Foundation (ASF) under one
  14480. * or more contributor license agreements. See the NOTICE file
  14481. * distributed with this work for additional information
  14482. * regarding copyright ownership. The ASF licenses this file
  14483. * to you under the Apache License, Version 2.0 (the
  14484. * "License"); you may not use this file except in compliance
  14485. * with the License. You may obtain a copy of the License at
  14486. *
  14487. * http://www.apache.org/licenses/LICENSE-2.0
  14488. *
  14489. * Unless required by applicable law or agreed to in writing,
  14490. * software distributed under the License is distributed on an
  14491. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14492. * KIND, either express or implied. See the License for the
  14493. * specific language governing permissions and limitations
  14494. * under the License.
  14495. */
  14496. /**
  14497. * AUTO-GENERATED FILE. DO NOT MODIFY.
  14498. */
  14499. /*
  14500. * Licensed to the Apache Software Foundation (ASF) under one
  14501. * or more contributor license agreements. See the NOTICE file
  14502. * distributed with this work for additional information
  14503. * regarding copyright ownership. The ASF licenses this file
  14504. * to you under the Apache License, Version 2.0 (the
  14505. * "License"); you may not use this file except in compliance
  14506. * with the License. You may obtain a copy of the License at
  14507. *
  14508. * http://www.apache.org/licenses/LICENSE-2.0
  14509. *
  14510. * Unless required by applicable law or agreed to in writing,
  14511. * software distributed under the License is distributed on an
  14512. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14513. * KIND, either express or implied. See the License for the
  14514. * specific language governing permissions and limitations
  14515. * under the License.
  14516. */var $O={type:"selectDataRange",event:"dataRangeSelected",
  14517. // FIXME use updateView appears wrong
  14518. update:"update"},QO=function(t,e){e.eachComponent({mainType:"visualMap",query:t},(function(e){e.setSelected(t.selected)}))},tR=[{createOnAllSeries:!0,reset:function(t,e){var n=[];return e.eachComponent("visualMap",(function(e){var i,o,r,s,l,u=t.pipelineContext;!e.isTargetSeries(t)||u&&u.large||n.push((i=e.stateList,o=e.targetVisuals,r=lt(e.getValueState,e),s=e.getDataDimensionIndex(t.getData()),l={},a(i,(function(t){var e=mb.prepareVisualTypes(o[t]);l[t]=e})),{progress:function(t,e){var n,i;function a(t){return Dc(e,i,t)}function u(t,n){Cc(e,i,t,n)}null!=s&&(n=e.getDimensionIndex(s));for(var c=e.getStore();null!=(i=t.next());){var d=e.getRawDataItem(i);
  14519. // Consider performance
  14520. // @ts-ignore
  14521. if(!d||!1!==d.visualMap)for(var h=null!=s?c.get(n,i):i,p=r(h),f=o[p],g=l[p],y=0,m=g.length;y<m;y++){var v=g[y];f[v]&&f[v].applyVisual(h,a,u)}}}}))})),n}},
  14522. // Only support color.
  14523. {createOnAllSeries:!0,reset:function(t,e){var n=t.getData(),i=[];e.eachComponent("visualMap",(function(e){if(e.isTargetSeries(t)){var o=e.getVisualMeta(lt(eR,null,t,e))||{stops:[],outerColors:[]},r=e.getDataDimensionIndex(n);r>=0&&(
  14524. // visualMeta.dimension should be dimension index, but not concrete dimension.
  14525. o.dimension=r,i.push(o))}})),
  14526. // console.log(JSON.stringify(visualMetaList.map(a => a.stops)));
  14527. t.getData().setVisual("visualMeta",i)}}];
  14528. // FIXME
  14529. // performance and export for heatmap?
  14530. // value can be Infinity or -Infinity
  14531. function eR(t,e,n,i){for(var o=e.targetVisuals[i],r=mb.prepareVisualTypes(o),a={color:Tc(t.getData(),"color")},s=0,l=r.length;s<l;s++){var u=r[s],c=o["opacity"===u?"__alphaForOpacity":u];c&&c.applyVisual(n,d,h)}return a.color;function d(t){return a[t]}function h(t,e){a[t]=e}}var nR=a;function iR(t){var e=t&&t.visualMap;i(e)||(e=e?[e]:[]),nR(e,(function(t){if(t){
  14532. // rename splitList to pieces
  14533. oR(t,"splitList")&&!oR(t,"pieces")&&(t.pieces=t.splitList,delete t.splitList);var e=t.pieces;e&&i(e)&&nR(e,(function(t){o(t)&&(oR(t,"start")&&!oR(t,"min")&&(t.min=t.start),oR(t,"end")&&!oR(t,"max")&&(t.max=t.end))}))}}))}function oR(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}var rR=!1;function aR(t){rR||(rR=!0,t.registerSubTypeDefaulter("visualMap",(function(t){
  14534. // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used.
  14535. return t.categories||(t.pieces?t.pieces.length>0:t.splitNumber>0)&&!t.calculable?"piecewise":"continuous"})),t.registerAction($O,QO),a(tR,(function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)})),t.registerPreprocessor(iR))}function sR(t){t.registerComponentModel(zO),t.registerComponentView(JO),aR(t)}var lR=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,
  14536. /**
  14537. * The order is always [low, ..., high].
  14538. * [{text: string, interval: Array.<number>}, ...]
  14539. */
  14540. n._pieceList=[],n}return Ue(e,t),e.prototype.optionUpdated=function(e,i){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var o=this._mode=this._determineMode();this._pieceList=[],uR[this._mode].call(this,this._pieceList),this._resetSelected(e,i);var r=this.option.categories;this.resetVisual((function(t,e){"categories"===o?(t.mappingMethod="category",t.categories=et(r)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=n(this._pieceList,(function(t){return t=et(t),"inRange"!==e&&(
  14541. // FIXME
  14542. // outOfRange do not support special visual in pieces.
  14543. t.visual=null),t})))}))},
  14544. /**
  14545. * @protected
  14546. * @override
  14547. */
  14548. e.prototype.completeVisualOption=function(){
  14549. // Consider this case:
  14550. // visualMap: {
  14551. // pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}]
  14552. // }
  14553. // where no inRange/outOfRange set but only pieces. So we should make
  14554. // default inRange/outOfRange for this case, otherwise visuals that only
  14555. // appear in `pieces` will not be taken into account in visual encoding.
  14556. var e=this.option,n={},i=mb.listVisualTypes(),o=this.isCategory();function r(t,e,n){return t&&t[e]&&t[e].hasOwnProperty(n)}a(e.pieces,(function(t){a(i,(function(e){t.hasOwnProperty(e)&&(n[e]=1)}))})),a(n,(function(t,n){var i=!1;a(this.stateList,(function(t){i=i||r(e,t,n)||r(e.target,t,n)}),this),!i&&a(this.stateList,(function(t){(e[t]||(e[t]={}))[n]=DO.get(n,"inRange"===t?"active":"inactive",o)}))}),this),t.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,e){var n=this.option,i=this._pieceList,o=(e?n:t).selected||{};if(n.selected=o,
  14557. // Consider 'not specified' means true.
  14558. a(i,(function(t,e){var n=this.getSelectedMapKey(t);o.hasOwnProperty(n)||(o[n]=!0)}),this),"single"===n.selectedMode){
  14559. // Ensure there is only one selected.
  14560. var r=!1;a(i,(function(t,e){var n=this.getSelectedMapKey(t);o[n]&&(r?o[n]=!1:r=!0)}),this)}
  14561. // thisOption.selectedMode === 'multiple', default: all selected.
  14562. },
  14563. /**
  14564. * @public
  14565. */
  14566. e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},
  14567. /**
  14568. * @public
  14569. */
  14570. e.prototype.getSelectedMapKey=function(t){return"categories"===this._mode?t.value+"":t.index+""},
  14571. /**
  14572. * @public
  14573. */
  14574. e.prototype.getPieceList=function(){return this._pieceList},
  14575. /**
  14576. * @return {string}
  14577. */
  14578. e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},
  14579. /**
  14580. * @override
  14581. */
  14582. e.prototype.setSelected=function(t){this.option.selected=et(t)},
  14583. /**
  14584. * @override
  14585. */
  14586. e.prototype.getValueState=function(t){var e=mb.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},
  14587. /**
  14588. * @public
  14589. * @param pieceIndex piece index in visualMapModel.getPieceList()
  14590. */
  14591. e.prototype.findTargetDataIndices=function(t){var e=[],n=this._pieceList;return this.eachTargetSeries((function(i){var o=[],r=i.getData();r.each(this.getDataDimensionIndex(r),(function(e,i){mb.findPieceIndex(e,n)===t&&o.push(i)}),this),e.push({seriesId:i.id,dataIndex:o})}),this),e},
  14592. /**
  14593. * @private
  14594. * @param piece piece.value or piece.interval is required.
  14595. * @return Can be Infinity or -Infinity
  14596. */
  14597. e.prototype.getRepresentValue=function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var n=t.interval||[];e=-Infinity===n[0]&&Infinity===n[1]?0:(n[0]+n[1])/2}return e},e.prototype.getVisualMeta=function(t){
  14598. // Do not support category. (category axis is ordinal, numerical)
  14599. if(!this.isCategory()){var e=[],n=["",""],i=this,o=this._pieceList.slice();if(o.length){var r=o[0].interval[0];-Infinity!==r&&o.unshift({interval:[-Infinity,r]}),Infinity!==(r=o[o.length-1].interval[1])&&o.push({interval:[r,Infinity]})}else o.push({interval:[-Infinity,Infinity]});var s=-Infinity;return a(o,(function(t){var e=t.interval;e&&(
  14600. // Fulfill gap.
  14601. e[0]>s&&l([s,e[0]],"outOfRange"),l(e.slice()),s=e[1])}),this),{stops:e,outerColors:n}}function l(o,r){var a=i.getRepresentValue({interval:o});// Not category
  14602. r||(r=i.getValueState(a));var s=t(a,r);-Infinity===o[0]?n[0]=s:Infinity===o[1]?n[1]=s:e.push({value:o[0],color:s},{value:o[1],color:s})}
  14603. // Suplement
  14604. },e.type="visualMap.piecewise",e.defaultOption=xr(OO.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(OO),uR={splitNumber:function(t){var e=this.option,n=Math.min(e.precision,20),i=this.getExtent(),o=e.splitNumber;o=Math.max(parseInt(o,10),1),e.splitNumber=o;
  14605. // Precision auto-adaption
  14606. for(var r=(i[1]-i[0])/o;+r.toFixed(n)!==r&&n<5;)n++;e.precision=n,r=+r.toFixed(n),e.minOpen&&t.push({interval:[-Infinity,i[0]],close:[0,0]});for(var s=0,l=i[0];s<o;l+=r,s++){var u=s===o-1?i[1]:l+r;t.push({interval:[l,u],close:[1,1]})}e.maxOpen&&t.push({interval:[i[1],Infinity],close:[0,0]}),hn(t),a(t,(function(t,e){t.index=e,t.text=this.formatValueText(t.interval)}),this)},categories:function(t){var e=this.option;a(e.categories,(function(e){
  14607. // FIXME category模式也使用pieceList,但在visualMapping中不是使用pieceList。
  14608. // 是否改一致。
  14609. t.push({text:this.formatValueText(e,!0),value:e})}),this),
  14610. // See "Order Rule".
  14611. cR(e,t)},pieces:function(t){var e=this.option;a(e.pieces,(function(e,n){o(e)||(e={value:e});var i={text:"",index:n};if(null!=e.label&&(i.text=e.label),e.hasOwnProperty("value")){var r=i.value=e.value;i.interval=[r,r],i.close=[1,1]}else{for(
  14612. // `min` `max` is legacy option.
  14613. // `lt` `gt` `lte` `gte` is recommended.
  14614. var a=i.interval=[],s=i.close=[0,0],l=[1,0,1],u=[-Infinity,Infinity],c=[],d=0;d<2;d++){for(var h=[["gte","gt","min"],["lte","lt","max"]][d],p=0;p<3&&null==a[d];p++)a[d]=e[h[p]],s[d]=l[p],c[d]=2===p;null==a[d]&&(a[d]=u[d])}c[0]&&Infinity===a[1]&&(s[0]=0),c[1]&&-Infinity===a[0]&&(s[1]=0),a[0]===a[1]&&s[0]&&s[1]&&(
  14615. // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}],
  14616. // we use value to lift the priority when min === max
  14617. i.value=a[0])}i.visual=mb.retrieveVisuals(e),t.push(i)}),this),
  14618. // See "Order Rule".
  14619. cR(e,t),
  14620. // Only pieces
  14621. hn(t),a(t,(function(t){var e=t.close,n=[["<","≤"][e[1]],[">","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,n)}),this)}};
  14622. /**
  14623. * Key is this._mode
  14624. * @type {Object}
  14625. * @this {module:echarts/component/viusalMap/PiecewiseMode}
  14626. */function cR(t,e){var n=t.inverse;("vertical"===t.orient?!n:n)&&e.reverse()}const dR=lR;const hR=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.doRender=function(){var t=this.group;t.removeAll();var e=this.visualMapModel,n=e.get("textGap"),i=e.textStyleModel,o=i.getFont(),r=i.getTextColor(),s=this._getItemAlign(),l=e.itemSize,u=this._getViewData(),c=u.endsText,d=Yt(e.get("showLabel",!0),!c),h=!e.get("selectedMode");c&&this._renderEndsText(t,c[0],l,d,s),a(u.viewPieceList,(function(i){var a=i.piece,u=new Z;u.onclick=lt(this._onItemClick,this,a),this._enableHoverLink(u,i.indexInModelPieceList);
  14627. // TODO Category
  14628. var c=e.getRepresentValue(a);if(this._createItemSymbol(u,c,[0,0,l[0],l[1]],h),d){var p=this.visualMapModel.getValueState(c);u.add(new $({style:{x:"right"===s?-n:l[0]+n,y:l[1]/2,text:a.text,verticalAlign:"middle",align:s,font:o,fill:r,opacity:"outOfRange"===p?.5:1},silent:h}))}t.add(u)}),this),c&&this._renderEndsText(t,c[1],l,d,s),va(e.get("orient"),t,e.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,e){var n=this;t.on("mouseover",(function(){return i("highlight")})).on("mouseout",(function(){return i("downplay")}));var i=function(t){var i=n.visualMapModel;
  14629. // TODO: TYPE More detailed action types
  14630. i.option.hoverLink&&n.api.dispatchAction({type:t,batch:WO(i.findTargetDataIndices(e),i)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return FO(t,this.api,t.itemSize);
  14631. // horizontal, most case left unless specifying right.
  14632. var n=e.align;return n&&"auto"!==n||(n="left"),n},e.prototype._renderEndsText=function(t,e,n,i,o){if(e){var r=new Z,a=this.visualMapModel.textStyleModel;r.add(new $({style:Zo(a,{x:i?"right"===o?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?o:"center",text:e})})),t.add(r)}},
  14633. /**
  14634. * @private
  14635. * @return {Object} {peiceList, endsText} The order is the same as screen pixel order.
  14636. */
  14637. e.prototype._getViewData=function(){var t=this.visualMapModel,e=n(t.getPieceList(),(function(t,e){return{piece:t,indexInModelPieceList:e}})),i=t.get("text"),o=t.get("orient"),r=t.get("inverse");
  14638. // Order of model pieceList is always [low, ..., high]
  14639. return("horizontal"===o?r:!r)?e.reverse():i&&(i=i.slice().reverse()),{viewPieceList:e,endsText:i}},e.prototype._createItemSymbol=function(t,e,n,i){var o=Gc(
  14640. // symbol will be string
  14641. this.getControllerVisual(e,"symbol"),n[0],n[1],n[2],n[3],
  14642. // color will be string
  14643. this.getControllerVisual(e,"color"));o.silent=i,t.add(o)},e.prototype._onItemClick=function(t){var e=this.visualMapModel,n=e.option,i=n.selectedMode;if(i){var o=et(n.selected),r=e.getSelectedMapKey(t);"single"===i||!0===i?(o[r]=!0,a(o,(function(t,e){o[e]=e===r}))):o[r]=!o[r],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},e.type="visualMap.piecewise",e}(BO);function pR(t){t.registerComponentModel(dR),t.registerComponentView(hR),aR(t)}var fR={label:{enabled:!0},decal:{show:!1}},gR=On(),yR={};function mR(e,n){var i=e.getModel("aria");
  14644. // See "area enabled" detection code in `GlobalModel.ts`.
  14645. if(i.get("enabled")){var o=et(fR);tt(o.label,e.getLocaleModel().get("aria"),!1),tt(i.option,o,!1),function(){if(i.getModel("decal").get("show")){
  14646. // Each type of series use one scope.
  14647. // Pie and funnel are using different scopes.
  14648. var t=r();e.eachSeries((function(e){if(!e.isColorBySeries()){var n=t.get(e.type);n||(n={},t.set(e.type,n)),gR(e).scope=n}})),e.eachRawSeries((function(t){if(!e.isSeriesFiltered(t))if(f(t.enableAriaDecal))
  14649. // Let series define how to use decal palette on data
  14650. t.enableAriaDecal();else{var n=t.getData();if(t.isColorBySeries()){var i=ns(t.ecModel,t.name,yR,e.getSeriesCount()),o=n.getVisual("decal");n.setVisual("decal",u(o,i))}else{var r=t.getRawData(),a={},s=gR(t).scope;n.each((function(t){var e=n.getRawIndex(t);a[e]=t}));var l=r.count();r.each((function(e){var i=a[e],o=r.getName(e)||e+"",c=ns(t.ecModel,o,s,l),d=n.getItemVisual(i,"decal");n.setItemVisual(i,"decal",u(d,c))}))}}function u(t,e){
  14651. // Merge decal from palette to decal from itemStyle.
  14652. // User do not need to specify all of the decal props.
  14653. var n=t?p(p({},e),t):e;return n.dirty=!0,n}}))}}(),function(){var t=n.getZr().dom;
  14654. // TODO: support for SSR
  14655. if(!t)return;var o=e.getLocaleModel().get("aria"),r=i.getModel("label");if(r.option=I(r.option,o),!r.get("enabled"))return;if(t.setAttribute("role","img"),r.get("description"))return void t.setAttribute("aria-label",r.get("description"));var a,l=e.getSeriesCount(),u=r.get(["data","maxCount"])||10,d=r.get(["series","maxCount"])||10,h=Math.min(l,d);if(l<1)
  14656. // No series, no aria label
  14657. return;var p=function(){var t=e.get("title");t&&t.length&&(t=t[0]);return t&&t.text}();a=p?s(r.get(["general","withTitle"]),{title:p}):r.get(["general","withoutTitle"]);var f=[];a+=s(l>1?r.get(["series","multiple","prefix"]):r.get(["series","single","prefix"]),{seriesCount:l}),e.eachSeries((function(t,n){if(n<h){var i=void 0,o=t.get("name")?"withName":"withoutName";i=s(i=l>1?r.get(["series","multiple",o]):r.get(["series","single",o]),{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:(b=t.subType,S=e.getLocaleModel().get(["series","typeNames"]),S[b]||S.chart)});var a=t.getData();if(a.count()>u)i+=s(r.get(["data","partialData"]),{displayCnt:u});else i+=r.get(["data","allData"]);for(var d=r.get(["data","separator","middle"]),p=r.get(["data","separator","end"]),g=r.get(["data","excludeDimensionId"]),y=[],m=0;m<a.count();m++)if(m<u){var v=a.getName(m),x=g?st(a.getValues(m),(function(t,e){return-1===c(g,e)})):a.getValues(m),_=r.get(["data",v?"withName":"withoutName"]);y.push(s(_,{name:v,value:x.join(d)}))}i+=y.join(d)+p,f.push(i)}var b,S}));var g=r.getModel(["series","multiple","separator"]),y=g.get("middle"),m=g.get("end");a+=f.join(y)+m,t.setAttribute("aria-label",a)}()}function s(e,n){if(!t(e))return e;var i=e;return a(n,(function(t,e){i=i.replace(new RegExp("\\{\\s*"+e+"\\s*\\}","g"),t)})),i}}function vR(t){if(t&&t.aria){var e=t.aria;
  14658. // aria.show is deprecated and should use aria.enabled instead
  14659. null!=e.show&&(e.enabled=e.show),e.label=e.label||{},
  14660. // move description, general, series, data to be under aria.label
  14661. a(["description","general","series","data"],(function(t){null!=e[t]&&(e.label[t]=e[t])}))}}var xR={value:"eq",
  14662. // PENDING: not good for literal semantic?
  14663. "<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},_R=/** @class */function(){function e(e){if(null==(this._condVal=t(e)?new RegExp(e):Ne(e)?e:null)){vn("")}}return e.prototype.evaluate=function(e){var n=typeof e;return t(n)?this._condVal.test(e):!!l(n)&&this._condVal.test(e+"")},e}(),bR=/** @class */function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),SR=/** @class */function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e<t.length;e++)if(!t[e].evaluate())return!1;return!0},t}(),wR=/** @class */function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e<t.length;e++)if(t[e].evaluate())return!0;return!1},t}(),MR=/** @class */function(){function t(){}return t.prototype.evaluate=function(){return!this.child.evaluate()},t}(),IR=/** @class */function(){function t(){}return t.prototype.evaluate=function(){
  14664. // Relational cond follow "and" logic internally.
  14665. for(var t=!!this.valueParser,e=(0,this.getValue)(this.valueGetterParam),n=t?this.valueParser(e):null,i=0
  14666. // Call getValue with no `this`.
  14667. ;i<this.subCondList.length;i++)if(!this.subCondList[i].evaluate(t?n:e))return!1;return!0},t}();
  14668. // type RelationalExpressionOpEvaluate = (tarVal: unknown, condVal: unknown) => boolean;
  14669. function DR(t,e){if(!0===t||!1===t){var n=new bR;return n.value=t,n}return CR(t)||vn(""),t.and?TR("and",t,e):t.or?TR("or",t,e):t.not?function(t,e){var n=t.not,i="";CR(n)||vn(i);var o=new MR;o.child=DR(n,e),o.child||vn(i);return o}(t,e):function(t,e){for(var n="",i=e.prepareGetValue(t),o=[],r=v(t),a=t.parser,s=a?xl(a):null,l=0;l<r.length;l++){var u=r[l];if("parser"!==u&&!e.valueGetterAttrMap.get(u)){var c=N(xR,u)?xR[u]:u,d=t[u],h=s?s(d):d,p=Ml(c,h)||"reg"===c&&new _R(h);p||vn(n),o.push(p)}}o.length||
  14670. // No relational operator always disabled in case of dangers result.
  14671. vn(n);var f=new IR;return f.valueGetterParam=i,f.valueParser=s,f.getValue=e.getValue,f.subCondList=o,f}(t,e)}function TR(t,e,o){var r=e[t];i(r)||vn(""),r.length||vn("");var a="and"===t?new SR:new wR;return a.children=n(r,(function(t){return DR(t,o)})),a.children.length||vn(""),a}function CR(t){return o(t)&&!m(t)}var AR=/** @class */function(){function t(t,e){this._cond=DR(t,e)}return t.prototype.evaluate=function(){return this._cond.evaluate()},t}();var LR={type:"echarts:filter",
  14672. // PENDING: enhance to filter by index rather than create new data
  14673. transform:function(t){for(
  14674. // [Caveat] Fail-Fast:
  14675. // Do not return the whole dataset unless user config indicates it explicitly.
  14676. // For example, if no condition is specified by mistake, returning an empty result
  14677. // is better than returning the entire raw source for the user to find the mistake.
  14678. var e,n,i,o=t.upstream,a=(n=t.config,i={valueGetterAttrMap:r({dimension:!0}),prepareGetValue:function(t){var e=t.dimension;N(t,"dimension")||vn("");var n=o.getDimensionInfo(e);return n||vn(""),{dimIdx:n.index}},getValue:function(t){return o.retrieveValueFromItem(e,t.dimIdx)}},new AR(n,i)),s=[],l=0,u=o.count();l<u;l++)e=o.getRawDataItem(l),a.evaluate()&&s.push(e);return{data:s}}},kR={type:"echarts:sort",transform:function(t){var e=t.upstream,n=t.config,i="",o=Sn(n);o.length||vn(i);var r=[];a(o,(function(t){var n=t.dimension,o=t.order,a=t.parser,s=t.incomparable;if(null==n&&vn(i),"asc"!==o&&"desc"!==o&&vn(i),s&&"min"!==s&&"max"!==s){vn("")}if("asc"!==o&&"desc"!==o){vn("")}var l=e.getDimensionInfo(n);l||vn(i);var u=a?xl(a):null;a&&!u&&vn(i),r.push({dimIdx:l.index,parser:u,comparator:new Sl(o,s)})}));
  14679. // TODO: support it?
  14680. var s=e.sourceFormat;s!==Na&&s!==Oa&&vn(i);
  14681. // Other upstream format are all array.
  14682. for(var l=[],u=0,c=e.count();u<c;u++)l.push(e.getRawDataItem(u));return l.sort((function(t,n){for(var i=0;i<r.length;i++){var o=r[i],a=e.retrieveValueFromItem(t,o.dimIdx),s=e.retrieveValueFromItem(n,o.dimIdx);o.parser&&(a=o.parser(a),s=o.parser(s));var l=o.comparator.evaluate(a,s);if(0!==l)return l}return 0})),{data:l}}};var PR=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataset",e}return Ue(e,t),e.prototype.init=function(e,n,i){t.prototype.init.call(this,e,n,i),this._sourceManager=new Yl(this),Ul(this)},e.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),Ul(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:za},e}(Ta),NR=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataset",e}return Ue(e,t),e.type="dataset",e}(Mu);function OR(t){t.registerComponentModel(PR),t.registerComponentView(NR)}function RR(t){return i(t[0])}function ER(t,e){for(var n=[],i=t.length,o=0;o<i;o++)n.push({one:t[o],many:[]});for(o=0;o<e.length;o++){var r=e[o].length,a=void 0;for(a=0;a<r;a++)n[a%i].many.push(e[o][a])}var s=0;
  14683. // If one has more paths than each one of many. average them.
  14684. for(o=i-1;o>=0;o--)if(!n[o].many.length){var l=n[s].many;if(l.length<=1){
  14685. // Not enough
  14686. // Start from the first one.
  14687. if(!s)return n;s=0}r=l.length;var u=Math.ceil(r/2);n[o].many=l.slice(u,r),n[s].many=l.slice(0,u),s++}return n}var VR={clone:function(t){for(var e=[],n=1-Math.pow(1-t.path.style.opacity,1/t.count),i=0
  14688. // Fitting the alpha
  14689. ;i<t.count;i++){var o=ze(t.path);o.setStyle("opacity",n),e.push(o)}return e},
  14690. // Use the default divider
  14691. split:null};function zR(t,e,n,i,o,r){if(t.length&&e.length){var a=eo("update",i,o);if(a&&a.duration>0){var s,l,u=i.getModel("universalTransition").get("delay"),c=Object.assign({
  14692. // Need to setToFinal so the further calculation based on the style can be correct.
  14693. // Like emphasis color.
  14694. setToFinal:!0},a);RR(t)&&(
  14695. // manyToOne
  14696. s=t,l=e),RR(e)&&(
  14697. // oneToMany
  14698. s=e,l=t);for(var d=s?s===t:t.length>e.length,h=s?ER(l,s):ER(d?e:t,[d?t:e]),p=0,f=0;f<h.length;f++)p+=h[f].many.length;var g=0;for(f=0;f<h.length;f++)y(h[f],d,g,p),g+=h[f].many.length}}function y(t,e,i,o,a){var s=t.many,l=t.one;if(1!==s.length||a)for(var d=I({dividePath:VR[n],individualDelay:u&&function(t,e,n,r){return u(t+i,o)}},c),h=e?Ee(s,l,d):Ve(l,s,d),p=h.fromIndividuals,f=h.toIndividuals,g=p.length,m=0;m<g;m++){_=u?I({delay:u(m,g)},c):c;r(p[m],f[m],e?s[m]:t.one,e?t.one:s[m],_)}else{
  14699. // Is one to one
  14700. var v=e?s[0]:l,x=e?l:s[0];if(Oe(v))
  14701. // Keep doing combine animation.
  14702. y({many:[v],one:x},!0,i,o,!0);else{var _=u?I({delay:u(i,o)},c):c;Re(v,x,_),r(v,x,v,x,_)}}}}function BR(t){if(!t)return[];if(i(t)){for(var e=[],n=0;n<t.length;n++)e.push(BR(t[n]));return e}var o=[];return t.traverse((function(t){t instanceof g&&!t.disableMorphing&&!t.invisible&&!t.ignore&&o.push(t)})),o}var GR=On();function FR(t,e,n,i){
  14703. // try to get groupId from encode
  14704. var o=function(t,e){for(var n=t.dimensions,i=0;i<n.length;i++){var o=t.getDimensionInfo(n[i]);if(o&&0===o.otherDims[e])return n[i]}}
  14705. // get value by dimension. (only get value of itemGroupId or childGroupId, so convert it to string)
  14706. (t,i?"itemChildGroupId":"itemGroupId");if(o){var r=function(t,e,n){var i=t.getDimensionInfo(n),o=i&&i.ordinalMeta;if(i){var r=t.get(i.name,e);return o&&o.categories[r]||r+""}}(t,e,o);return r}
  14707. // try to get groupId from raw data item
  14708. var a=t.getRawDataItem(e),s=i?"childGroupId":"groupId";return a&&a[s]?a[s]+"":
  14709. // fallback
  14710. i?void 0:n||t.getId(e)}
  14711. // flatten all data items from different serieses into one arrary
  14712. function WR(t){var e=[];return a(t,(function(t){var n=t.data,i=t.dataGroupId;if(!(n.count()>1e4))for(var o=n.getIndices(),r=0;r<o.length;r++)e.push({data:n,groupId:FR(n,r,i,!1),childGroupId:FR(n,r,i,!0),divide:t.divide,dataIndex:r})})),e}function HR(t,e,n){t.traverse((function(t){t instanceof g&&
  14713. // TODO use fade in animation for target element.
  14714. oo(t,{style:{opacity:0}},e,{dataIndex:n,isFrom:!0})}))}function YR(t){if(t.parent){
  14715. // Bake parent transform to element.
  14716. // So it can still have proper transform to transition after it's removed.
  14717. var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function UR(t){t.stopAnimation(),t.isGroup&&t.traverse((function(t){t.stopAnimation()}))}function ZR(t,e,n){var i=eo("update",n,e);i&&t.traverse((function(t){if(t instanceof $t){var e=function(t){return to(t).oldStyle}(t);e&&t.animateFrom({style:e},i)}}))}function XR(t,e,i){var o=WR(t),s=WR(e);function l(t,e,n,i,o){(n||t)&&e.animateFrom({style:n&&n!==t?p(p({},n.style),t.style):t.style},o)}var u=!1,c=0,d=r(),h=r();
  14718. /**
  14719. * With groupId and childGroupId, we can build parent-child relationships between dataItems.
  14720. * However, we should mind the parent-child "direction" between old and new options.
  14721. *
  14722. * For example, suppose we have two dataItems from two series.data:
  14723. *
  14724. * dataA: [ dataB: [
  14725. * { {
  14726. * value: 5, value: 3,
  14727. * groupId: 'creatures', groupId: 'animals',
  14728. * childGroupId: 'animals' childGroupId: 'dogs'
  14729. * }, },
  14730. * ... ...
  14731. * ] ]
  14732. *
  14733. * where dataA is belong to optionA and dataB is belong to optionB.
  14734. *
  14735. * When we `setOption(optionB)` from optionA, we choose childGroupId of dataItemA and groupId of
  14736. * dataItemB as keys so the two keys are matched (both are 'animals'), then universalTransition
  14737. * will work. This derection is "parent -> child".
  14738. *
  14739. * If we `setOption(optionA)` from optionB, we also choose groupId of dataItemB and childGroupId
  14740. * of dataItemA as keys and universalTransition will work. This derection is "child -> parent".
  14741. *
  14742. * If there is no childGroupId specified, which means no multiLevelDrillDown/Up is needed and no
  14743. * parent-child relationship exists. This direction is "none".
  14744. *
  14745. * So we need to know whether to use groupId or childGroupId as the key when we call the keyGetter
  14746. * functions. Thus, we need to decide the direction first.
  14747. *
  14748. * The rule is:
  14749. *
  14750. * if (all childGroupIds in oldDiffItems and all groupIds in newDiffItems have common value) {
  14751. * direction = 'parent -> child';
  14752. * } else if (all groupIds in oldDiffItems and all childGroupIds in newDiffItems have common value) {
  14753. * direction = 'child -> parent';
  14754. * } else {
  14755. * direction = 'none';
  14756. * }
  14757. */o.forEach((function(t){t.groupId&&d.set(t.groupId,!0),t.childGroupId&&h.set(t.childGroupId,!0)}));
  14758. // traverse newDiffItems and decide the direction according to the rule
  14759. for(var f=0;f<s.length;f++){var y=s[f].groupId;if(h.get(y)){c=1;break}var m=s[f].childGroupId;if(m&&d.get(m)){c=2;break}}function v(t,e){return function(n){var i=n.data,o=n.dataIndex;
  14760. // TODO if specified dim
  14761. return e?i.getId(o):t?1===c?n.childGroupId:n.groupId:2===c?n.childGroupId:n.groupId}}
  14762. // Use id if it's very likely to be an one to one animation
  14763. // It's more robust than groupId
  14764. // TODO Check if key dimension is specified.
  14765. var x=function(t,e){var n=t.length;if(n!==e.length)return!1;for(var i=0;i<n;i++){var o=t[i],r=e[i];if(o.data.getId(o.dataIndex)!==r.data.getId(r.dataIndex))return!1}return!0}(o,s),_={};if(!x)
  14766. // We may have different diff strategy with basicTransition if we use other dimension as key.
  14767. // If so, we can't simply check if oldEl is same with newEl. We need a map to check if oldEl is still being used in the new chart.
  14768. // We can't use the elements that already being morphed. Let it keep it's original basic transition.
  14769. for(f=0;f<s.length;f++){var b=s[f],S=b.data.getItemGraphicEl(b.dataIndex);S&&(_[S.id]=!0)}function w(t,e){var n=o[e],i=s[t],r=i.data.hostModel,a=n.data.getItemGraphicEl(n.dataIndex),c=i.data.getItemGraphicEl(i.dataIndex);
  14770. // Can't handle same elements.
  14771. a!==c?
  14772. // We can't use the elements that already being morphed
  14773. a&&_[a.id]||c&&(
  14774. // TODO: If keep animating the group in case
  14775. // some of the elements don't want to be morphed.
  14776. // TODO Label?
  14777. UR(c),a?(UR(a),
  14778. // If old element is doing leaving animation. stop it and remove it immediately.
  14779. YR(a),u=!0,zR(BR(a),BR(c),i.divide,r,t,l)):HR(c,r,t)):c&&ZR(c,i.dataIndex,r)}new yh(o,s,v(!0,x),v(!1,x),null,"multiple").update(w).updateManyToOne((function(t,e){var i=s[t],r=i.data,c=r.hostModel,d=r.getItemGraphicEl(i.dataIndex),h=st(n(e,(function(t){return o[t].data.getItemGraphicEl(o[t].dataIndex)})),(function(t){return t&&t!==d&&!_[t.id]}));d&&(UR(d),h.length?(
  14780. // If old element is doing leaving animation. stop it and remove it immediately.
  14781. a(h,(function(t){UR(t),YR(t)})),u=!0,zR(BR(h),BR(d),i.divide,c,t,l)):HR(d,c,i.dataIndex));
  14782. // else keep oldEl leaving animation.
  14783. })).updateOneToMany((function(t,e){var i=o[e],r=i.data.getItemGraphicEl(i.dataIndex);
  14784. // We can't use the elements that already being morphed
  14785. if(!r||!_[r.id]){var c=st(n(t,(function(t){return s[t].data.getItemGraphicEl(s[t].dataIndex)})),(function(t){return t&&t!==r})),d=s[t[0]].data.hostModel;c.length&&(a(c,(function(t){return UR(t)})),r?(UR(r),
  14786. // If old element is doing leaving animation. stop it and remove it immediately.
  14787. YR(r),u=!0,zR(BR(r),BR(c),i.divide,
  14788. // Use divide on old.
  14789. d,t[0],l)):a(c,(function(e){return HR(e,d,t[0])})));
  14790. // else keep oldEl leaving animation.
  14791. }})).updateManyToMany((function(t,e){
  14792. // If two data are same and both have groupId.
  14793. // Normally they should be diff by id.
  14794. new yh(e,t,(function(t){return o[t].data.getId(o[t].dataIndex)}),(function(t){return s[t].data.getId(s[t].dataIndex)})).update((function(n,i){
  14795. // Use the original index
  14796. w(t[n],e[i])})).execute()})).execute(),u&&a(e,(function(t){var e=t.data.hostModel,n=e&&i.getViewOfSeriesModel(e),o=eo("update",e,0);// use 0 index.
  14797. n&&e.isAnimationEnabled()&&o&&o.duration>0&&n.group.traverse((function(t){t instanceof g&&!t.animators.length&&
  14798. // We can't accept there still exists element that has no animation
  14799. // if universalTransition is enabled
  14800. t.animateFrom({style:{opacity:0}},o)}))}))}function jR(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function qR(t){return i(t)?t.sort().join(","):t}function KR(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function JR(t,e){for(var n=0;n<t.length;n++){if(null!=e.seriesIndex&&e.seriesIndex===t[n].seriesIndex||null!=e.seriesId&&e.seriesId===t[n].id)return n}}
  14801. // -----------------
  14802. // Render engines
  14803. // -----------------
  14804. // Render via Canvas.
  14805. // echarts.init(dom, null, { renderer: 'canvas' })
  14806. hh([Ng]),
  14807. // Render via SVG.
  14808. // echarts.init(dom, null, { renderer: 'svg' })
  14809. hh([function(t){t.registerPainter("svg",Vt)}]),
  14810. // ----------------
  14811. // Charts (series)
  14812. // ----------------
  14813. // All of the series types, for example:
  14814. // chart.setOption({
  14815. // series: [{
  14816. // type: 'line' // or 'bar', 'pie', ...
  14817. // }]
  14818. // });
  14819. hh([function(t){t.registerChartView(yy),t.registerSeriesModel(Og),t.registerLayout(my("line",!0)),t.registerVisual({seriesType:"line",reset:function(t){var e=t.getData(),n=t.getModel("lineStyle").getLineStyle();
  14820. // Visual coding for legend
  14821. n&&!n.stroke&&(
  14822. // Fill in visual should be palette color if
  14823. // has color callback
  14824. n.stroke=e.getVisual("style").fill),e.setVisual("legendLineStyle",n)}}),
  14825. // Down sample after filter
  14826. t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,_y("line"))},function(t){t.registerChartView(jy),t.registerSeriesModel(wy),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,rt(Dp,"bar")),
  14827. // Do layout after other overall layout, which can prepare some information.
  14828. t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Tp("bar")),
  14829. // Down sample after filter
  14830. t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,_y("bar")),
  14831. /**
  14832. * @payload
  14833. * @property {string} [componentType=series]
  14834. * @property {number} [dx]
  14835. * @property {number} [dy]
  14836. * @property {number} [zoom]
  14837. * @property {number} [originX]
  14838. * @property {number} [originY]
  14839. */
  14840. t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(t,e){var n=t.componentType||"series";e.eachComponent({mainType:n,query:t},(function(e){t.sortInfo&&e.axis.setCategorySortInfo(t.sortInfo)}))}))},function(t){t.registerChartView(lm),t.registerSeriesModel(pm),Ac("pie",t.registerAction),t.registerLayout(rt(Qy,"pie")),t.registerProcessor(em("pie")),t.registerProcessor(function(t){return{seriesType:t,reset:function(t,e){var n=t.getData();n.filterSelf((function(t){
  14841. // handle negative value condition
  14842. var e=n.mapDimension("value"),i=n.get(e,t);return!(l(i)&&!isNaN(i)&&i<0)}))}}}("pie"))},function(t){
  14843. // In case developer forget to include grid component
  14844. hh(vv),t.registerSeriesModel(fm),t.registerChartView(xm),t.registerLayout(my("scatter"))},function(t){hh(zv),t.registerChartView(Mv),t.registerSeriesModel(Dv),t.registerLayout(xv),t.registerProcessor(em("radar")),t.registerPreprocessor(Sv)},function(t){hh(Jx),t.registerChartView(Cx),t.registerSeriesModel(Lx),t.registerLayout(Px),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,kx),Ac("map",t.registerAction)},function(t){t.registerChartView(y_),t.registerSeriesModel(O_),t.registerLayout(E_),t.registerVisual(V_),function(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},(function(e){var n=t.dataIndex,i=e.getData().tree.getNodeByDataIndex(n);i.isExpand=!i.isExpand}))})),t.registerAction({type:"treeRoam",event:"treeRoam",
  14845. // Here we set 'none' instead of 'update', because roam action
  14846. // just need to update the transform matrix without having to recalculate
  14847. // the layout. So don't need to go through the whole update process, such
  14848. // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on.
  14849. update:"none"},(function(t,e,n){e.eachComponent({mainType:"series",subType:"tree",query:t},(function(e){var i=jx(e.coordinateSystem,t,void 0,n);e.setCenter&&e.setCenter(i.center),e.setZoom&&e.setZoom(i.zoom)}))}))}(t)},function(t){t.registerSeriesModel(F_),t.registerChartView(eb),t.registerVisual(xb),t.registerLayout(Pb),function(t){for(var e=0;e<z_.length;e++)t.registerAction({type:z_[e],update:"updateView"},dt);t.registerAction({type:"treemapRootToNode",update:"updateView"},(function(t,e){e.eachComponent({mainType:"series",subType:"treemap",query:t},(function(e,n){var i=A_(t,["treemapZoomToNode","treemapRootToNode"],e);if(i){var o=e.getViewRoot();o&&(t.direction=k_(o,i.node)?"rollUp":"drillDown"),e.resetViewRoot(i.node)}}))}))}(t)},function(t){t.registerChartView(RS),t.registerSeriesModel(YS),t.registerProcessor(zb),t.registerVisual(Bb),t.registerVisual(Fb),t.registerLayout(Jb),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,rS),t.registerLayout(sS),t.registerCoordinateSystem("graphView",{dimensions:Ex.dimensions,create:lS}),
  14850. // Register legacy focus actions
  14851. t.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},dt),t.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},dt),
  14852. // Register roam action.
  14853. t.registerAction(US,(function(t,e,n){e.eachComponent({mainType:"series",query:t},(function(e){var i=jx(e.coordinateSystem,t,void 0,n);e.setCenter&&e.setCenter(i.center),e.setZoom&&e.setZoom(i.zoom)}))}))},function(t){t.registerChartView(KS),t.registerSeriesModel(JS)},function(t){t.registerChartView(tw),t.registerSeriesModel(nw),t.registerLayout(iw),t.registerProcessor(em("funnel"))},function(t){hh(RM),t.registerChartView(uw),t.registerSeriesModel(dw),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,pw)},function(t){t.registerChartView(GM),t.registerSeriesModel(WM),t.registerLayout(HM),t.registerVisual(eI),t.registerAction({type:"dragNode",event:"dragnode",
  14854. // here can only use 'update' now, other value is not support in echarts.
  14855. update:"update"},(function(t,e){e.eachComponent({mainType:"series",subType:"sankey",query:t},(function(e){e.setNodePosition(t.dataIndex,[t.localX,t.localY])}))}))},function(t){t.registerSeriesModel(oI),t.registerChartView(dI),t.registerLayout(pI),t.registerTransform(fI)},function(t){t.registerChartView(RI),t.registerSeriesModel(VI),t.registerPreprocessor(zI),t.registerVisual(SI),t.registerLayout(FI)},function(t){t.registerChartView(UI),t.registerSeriesModel(ZI),t.registerLayout(my("effectScatter"))},function(t){t.registerChartView(oD),t.registerSeriesModel(uD),t.registerLayout(iD),t.registerVisual(dD)},function(t){t.registerChartView(yD),t.registerSeriesModel(mD)},function(t){t.registerChartView(zD),t.registerSeriesModel(BD),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,rt(Dp,"pictorialBar")),
  14856. // Do layout after other overall layout, which can prepare some information.
  14857. t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Tp("pictorialBar"))},function(t){t.registerChartView(FD),t.registerSeriesModel(HD),t.registerLayout(YD),t.registerProcessor(em("themeRiver"))},function(t){t.registerChartView(JD),t.registerSeriesModel(QD),t.registerLayout(rt(eT,"sunburst")),t.registerProcessor(rt(em,"sunburst")),t.registerVisual(iT),function(t){t.registerAction({type:jD,update:"updateView"},(function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},(function(e,n){var i=A_(t,[jD],e);if(i){var o=e.getViewRoot();o&&(t.direction=k_(o,i.node)?"rollUp":"drillDown"),e.resetViewRoot(i.node)}}))})),t.registerAction({type:qD,update:"none"},(function(t,e,n){
  14858. // Clone
  14859. t=p({},t),e.eachComponent({mainType:"series",subType:"sunburst",query:t},(function(e){var n=A_(t,[qD],e);n&&(t.dataIndex=n.node.dataIndex)}
  14860. // Fast forward action
  14861. )),n.dispatchAction(p(t,{type:"highlight"}))})),t.registerAction({type:"sunburstUnhighlight",update:"updateView"},(function(t,e,n){t=p({},t),n.dispatchAction(p(t,{type:"downplay"}))}))}(t)},function(t){t.registerChartView(jT),t.registerSeriesModel(sT)}]),
  14862. // -------------------
  14863. // Coordinate systems
  14864. // -------------------
  14865. // All of the axis modules have been included in the
  14866. // coordinate system module below, do not need to
  14867. // make extra import.
  14868. // `cartesian` coordinate system. For some historical
  14869. // reasons, it is named as grid, for example:
  14870. // chart.setOption({
  14871. // grid: {...},
  14872. // xAxis: {...},
  14873. // yAxis: {...},
  14874. // series: [{...}]
  14875. // });
  14876. hh((function(t){hh(vv),hh($C)})),
  14877. // `polar` coordinate system, for example:
  14878. // chart.setOption({
  14879. // polar: {...},
  14880. // radiusAxis: {...},
  14881. // angleAxis: {...},
  14882. // series: [{
  14883. // coordinateSystem: 'polar'
  14884. // }]
  14885. // });
  14886. hh((function(t){hh($C),av.registerAxisPointerClass("PolarAxisPointer",eA),t.registerCoordinateSystem("polar",vA),t.registerComponentModel(nA),t.registerComponentView(EA),
  14887. // Model and view for angleAxis and radiusAxis
  14888. Tm(t,"angle",oA,OA),Tm(t,"radius",rA,RA),t.registerComponentView(IA),t.registerComponentView(LA),t.registerLayout(rt(NA,"bar"))})),
  14889. // `geo` coordinate system, for example:
  14890. // chart.setOption({
  14891. // geo: {...},
  14892. // series: [{
  14893. // coordinateSystem: 'geo'
  14894. // }]
  14895. // });
  14896. hh(Jx),
  14897. // `singleAxis` coordinate system (notice, it is a coordinate system
  14898. // with only one axis, work for chart like theme river), for example:
  14899. // chart.setOption({
  14900. // singleAxis: {...}
  14901. // series: [{type: 'themeRiver', ...}]
  14902. // });
  14903. hh((function(t){hh($C),av.registerAxisPointerClass("SingleAxisPointer",iL),t.registerComponentView(oL),
  14904. // Axis
  14905. t.registerComponentView(WA),t.registerComponentModel(YA),Tm(t,"single",YA,YA.defaultOption),t.registerCoordinateSystem("single",KA)})),
  14906. // `parallel` coordinate system, only work for parallel series, for example:
  14907. // chart.setOption({
  14908. // parallel: {...},
  14909. // parallelAxis: [{...}, ...],
  14910. // series: [{
  14911. // type: 'parallel'
  14912. // }]
  14913. // });
  14914. hh(RM),
  14915. // `calendar` coordinate system. for example,
  14916. // chart.setOption({
  14917. // calendar: {...},
  14918. // series: [{
  14919. // coordinateSystem: 'calendar'
  14920. // }]
  14921. // );
  14922. hh((function(t){t.registerComponentModel(aL),t.registerComponentView(lL),t.registerCoordinateSystem("calendar",hL)})),
  14923. // ------------------
  14924. // Other components
  14925. // ------------------
  14926. // `graphic` component, for example:
  14927. // chart.setOption({
  14928. // graphic: {...}
  14929. // });
  14930. hh((function(t){t.registerComponentModel(mL),t.registerComponentView(_L),t.registerPreprocessor((function(t){var e=t.graphic;
  14931. // Convert
  14932. // {graphic: [{left: 10, type: 'circle'}, ...]}
  14933. // or
  14934. // {graphic: {left: 10, type: 'circle'}}
  14935. // to
  14936. // {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]}
  14937. i(e)?e[0]&&e[0].elements?
  14938. // Only one graphic instance can be instantiated. (We don't
  14939. // want that too many views are created in echarts._viewMap.)
  14940. t.graphic=[t.graphic[0]]:t.graphic=[{elements:e}]:e&&!e.elements&&(t.graphic=[{elements:[e]}])}))})),
  14941. // `toolbox` component, for example:
  14942. // chart.setOption({
  14943. // toolbox: {...}
  14944. // });
  14945. hh((function(t){t.registerComponentModel(qL),t.registerComponentView($L),XL("saveAsImage",QL),XL("magicType",ok),XL("dataView",hk),XL("dataZoom",zk),XL("restore",mk),hh(YL)})),
  14946. // `tooltip` component, for example:
  14947. // chart.setOption({
  14948. // tooltip: {...}
  14949. // });
  14950. hh((function(t){hh($C),t.registerComponentModel(Bk),t.registerComponentView(lP),
  14951. /**
  14952. * @action
  14953. * @property {string} type
  14954. * @property {number} seriesIndex
  14955. * @property {number} dataIndex
  14956. * @property {number} [x]
  14957. * @property {number} [y]
  14958. */
  14959. t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},dt),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},dt)})),
  14960. // `axisPointer` component, for example:
  14961. // chart.setOption({
  14962. // tooltip: {axisPointer: {...}, ...}
  14963. // });
  14964. // Or
  14965. // chart.setOption({
  14966. // axisPointer: {...}
  14967. // });
  14968. hh($C),
  14969. // `brush` component, for example:
  14970. // chart.setOption({
  14971. // brush: {...}
  14972. // });
  14973. // Or
  14974. // chart.setOption({
  14975. // tooltip: {feature: {brush: {...}}
  14976. // })
  14977. hh((function(t){t.registerComponentView(TP),t.registerComponentModel(AP),t.registerPreprocessor(cP),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,SP),t.registerAction({type:"brush",event:"brush",update:"updateVisual"},(function(t,e){e.eachComponent({mainType:"brush",query:t},(function(e){e.setAreas(t.areas)}))})),
  14978. /**
  14979. * payload: {
  14980. * brushComponents: [
  14981. * {
  14982. * brushId,
  14983. * brushIndex,
  14984. * brushName,
  14985. * series: [
  14986. * {
  14987. * seriesId,
  14988. * seriesIndex,
  14989. * seriesName,
  14990. * rawIndices: [21, 34, ...]
  14991. * },
  14992. * ...
  14993. * ]
  14994. * },
  14995. * ...
  14996. * ]
  14997. * }
  14998. */
  14999. t.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},dt),t.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},dt),XL("brush",kP)})),
  15000. // `title` component, for example:
  15001. // chart.setOption({
  15002. // title: {...}
  15003. // });
  15004. hh((function(t){t.registerComponentModel(PP),t.registerComponentView(NP)})),
  15005. // `timeline` component, for example:
  15006. // chart.setOption({
  15007. // timeline: {...}
  15008. // });
  15009. hh((function(t){t.registerComponentModel(VP),t.registerComponentView(ZP),t.registerSubTypeDefaulter("timeline",(function(){
  15010. // Only slider now.
  15011. return"slider"})),function(t){t.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},(function(t,e,n){var i=e.getComponent("timeline");return i&&null!=t.currentIndex&&(i.setCurrentIndex(t.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.getPlayState()&&(i.setPlayState(!1),
  15012. // The timeline has played to the end, trigger event
  15013. n.dispatchAction({type:"timelinePlayChange",playState:!1,from:t.from}))),
  15014. // Set normalized currentIndex to payload.
  15015. e.resetOption("timeline",{replaceMerge:i.get("replaceMerge",!0)}),I({currentIndex:i.option.currentIndex},t)})),t.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},(function(t,e){var n=e.getComponent("timeline");n&&null!=t.playState&&n.setPlayState(t.playState)}))}(t),t.registerPreprocessor(XP)})),
  15016. // `markPoint` component, for example:
  15017. // chart.setOption({
  15018. // series: [{markPoint: {...}}]
  15019. // });
  15020. hh((function(t){t.registerComponentModel(eN),t.registerComponentView(fN),t.registerPreprocessor((function(t){KP(t.series,"markPoint")&&(
  15021. // Make sure markPoint component is enabled
  15022. t.markPoint=t.markPoint||{})}))})),
  15023. // `markLine` component, for example:
  15024. // chart.setOption({
  15025. // series: [{markLine: {...}}]
  15026. // });
  15027. hh((function(t){t.registerComponentModel(gN),t.registerComponentView(SN),t.registerPreprocessor((function(t){KP(t.series,"markLine")&&(
  15028. // Make sure markLine component is enabled
  15029. t.markLine=t.markLine||{})}))})),
  15030. // `markArea` component, for example:
  15031. // chart.setOption({
  15032. // series: [{markArea: {...}}]
  15033. // });
  15034. hh((function(t){t.registerComponentModel(wN),t.registerComponentView(PN),t.registerPreprocessor((function(t){KP(t.series,"markArea")&&(
  15035. // Make sure markArea component is enabled
  15036. t.markArea=t.markArea||{})}))})),
  15037. // `legend` component not scrollable. for example:
  15038. // chart.setOption({
  15039. // legend: {...}
  15040. // });
  15041. hh((function(t){hh(XN),hh(eO)})),
  15042. // `dataZoom` component including both `dataZoomInside` and `dataZoomSlider`.
  15043. hh((function(t){hh(pO),hh(wO)})),
  15044. // `dataZoom` component providing drag, pinch, wheel behaviors
  15045. // inside coordinate system, for example:
  15046. // chart.setOption({
  15047. // dataZoom: {type: 'inside'}
  15048. // });
  15049. hh(pO),
  15050. // `dataZoom` component providing a slider bar, for example:
  15051. // chart.setOption({
  15052. // dataZoom: {type: 'slider'}
  15053. // });
  15054. hh(wO),
  15055. // `visualMap` component including both `visualMapContinuous` and `visualMapPiecewise`.
  15056. hh((function(t){hh(sR),hh(pR)})),
  15057. // `visualMap` component providing continuous bar, for example:
  15058. // chart.setOption({
  15059. // visualMap: {type: 'continuous'}
  15060. // });
  15061. hh(sR),
  15062. // `visualMap` component providing pieces bar, for example:
  15063. // chart.setOption({
  15064. // visualMap: {type: 'piecewise'}
  15065. // });
  15066. hh(pR),
  15067. // `aria` component providing aria, for example:
  15068. // chart.setOption({
  15069. // aria: {...}
  15070. // });
  15071. hh((function(t){t.registerPreprocessor(vR),t.registerVisual(t.PRIORITY.VISUAL.ARIA,mR)})),
  15072. // dataset transform
  15073. // chart.setOption({
  15074. // dataset: {
  15075. // transform: []
  15076. // }
  15077. // });
  15078. hh((function(t){t.registerTransform(LR),t.registerTransform(kR)})),hh(OR),
  15079. // universal transition
  15080. // chart.setOption({
  15081. // series: {
  15082. // universalTransition: { enabled: true }
  15083. // }
  15084. // })
  15085. hh((function(t){t.registerUpdateLifecycle("series:beforeupdate",(function(t,e,n){a(Sn(n.seriesTransition),(function(t){a(Sn(t.to),(function(t){for(var e=n.updatedSeries,i=0;i<e.length;i++)(null!=t.seriesIndex&&t.seriesIndex===e[i].seriesIndex||null!=t.seriesId&&t.seriesId===e[i].id)&&(e[i][pu]=!0)}))}))})),t.registerUpdateLifecycle("series:transition",(function(t,e,n){
  15086. // TODO api provide an namespace that can save stuff per instance
  15087. var o=GR(e);
  15088. // TODO multiple to multiple series.
  15089. if(o.oldSeries&&n.updatedSeries&&n.optionChanged){
  15090. // TODO transitionOpt was used in an old implementation and can be removed now
  15091. // Use give transition config if its' give;
  15092. var s=n.seriesTransition;if(s)a(Sn(s),(function(t){!function(t,e,n,i){var o=[],r=[];a(Sn(t.from),(function(t){var n=JR(e.oldSeries,t);n>=0&&o.push({dataGroupId:e.oldDataGroupIds[n],data:e.oldData[n],
  15093. // TODO can specify divideShape in transition.
  15094. divide:KR(e.oldData[n]),groupIdDim:t.dimension})})),a(Sn(t.to),(function(t){var i=JR(n.updatedSeries,t);if(i>=0){var o=n.updatedSeries[i].getData();r.push({dataGroupId:e.oldDataGroupIds[i],data:o,divide:KR(o),groupIdDim:t.dimension})}})),o.length>0&&r.length>0&&XR(o,r,i)}(t,o,n,e)}));else{
  15095. // Else guess from series based on transition series key.
  15096. var l=function(t,e){var n=r(),o=r(),s=r();return a(t.oldSeries,(function(e,n){var r=t.oldDataGroupIds[n],l=t.oldData[n],u=jR(e),c=qR(u);o.set(c,{dataGroupId:r,data:l}),i(u)&&
  15097. // Same key can't in different array seriesKey.
  15098. a(u,(function(t){s.set(t,{key:c,dataGroupId:r,data:l})}))})),a(e.updatedSeries,(function(t){if(t.isUniversalTransitionEnabled()&&t.isAnimationEnabled()){var e=t.get("dataGroupId"),r=t.getData(),l=jR(t),u=qR(l),c=o.get(u);
  15099. // string transition key is the best match.
  15100. if(c)
  15101. // TODO check if data is same?
  15102. n.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:KR(c.data),data:c.data}],newSeries:[{dataGroupId:e,divide:KR(r),data:r}]});else
  15103. // Transition from multiple series.
  15104. // e.g. 'female', 'male' -> ['female', 'male']
  15105. if(i(l)){var d=[];a(l,(function(t){var e=o.get(t);e.data&&d.push({dataGroupId:e.dataGroupId,divide:KR(e.data),data:e.data})})),d.length&&n.set(u,{oldSeries:d,newSeries:[{dataGroupId:e,data:r,divide:KR(r)}]})}else{
  15106. // Try transition to multiple series.
  15107. // e.g. ['female', 'male'] -> 'female', 'male'
  15108. var h=s.get(l);if(h){var p=n.get(h.key);p||(p={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:KR(h.data)}],newSeries:[]},n.set(h.key,p)),p.newSeries.push({dataGroupId:e,data:r,divide:KR(r)})}}}})),n}(o,n);a(l.keys(),(function(t){var n=l.get(t);XR(n.oldSeries,n.newSeries,e)}))}
  15109. // Reset
  15110. a(n.updatedSeries,(function(t){
  15111. // Reset;
  15112. t[pu]&&(t[pu]=!1)}))}
  15113. // Save all series of current update. Not only the updated one.
  15114. for(var u=t.getSeries(),c=o.oldSeries=[],d=o.oldDataGroupIds=[],h=o.oldData=[],p=0;p<u.length;p++){var f=u[p].getData();
  15115. // Only save the data that can have transition.
  15116. // Avoid large data costing too much extra memory
  15117. f.count()<1e4&&(c.push(u[p]),d.push(u[p].get("dataGroupId")),h.push(f))}}))})),
  15118. // label layout
  15119. // chart.setOption({
  15120. // series: {
  15121. // labelLayout: { hideOverlap: true }
  15122. // }
  15123. // })
  15124. hh(Pg);const $R=Object.freeze(Object.defineProperty({__proto__:null,Axis:Yf,ChartView:Ou,ComponentModel:Ta,ComponentView:Mu,List:Fh,Model:yr,PRIORITY:ed,SeriesModel:Su,color:Be,connect:function(t){
  15125. // Is array of charts
  15126. if(i(t)){var e=t;t=null,
  15127. // If any chart has group
  15128. a(e,(function(e){null!=e.group&&(t=e.group)})),t=t||"g_"+Hd++,a(e,(function(e){e.group=t}))}return Fd[t]=!0,t},dataTool:{},dependencies:{zrender:"5.6.1"},disConnect:Xd,disconnect:Zd,dispose:function(e){t(e)?e=Gd[e]:e instanceof Ld||(
  15129. // Try to treat as dom
  15130. e=jd(e)),e instanceof Ld&&!e.isDisposed()&&e.dispose()},env:d,extendChartView:Zf,extendComponentModel:function(t){var e=Ta.extend(t);return Ta.registerClass(e),e},extendComponentView:function(t){var e=Mu.extend(t);return Mu.registerClass(e),e},extendSeriesModel:Uf,format:Af,getCoordinateSystemDimensions:function(t){var e=fs.get(t);if(e)return e.getDimensionsInfo?e.getDimensionsInfo():e.dimensions.slice()},getInstanceByDom:jd,getInstanceById:function(t){return Gd[t]},getMap:function(t){var e=$c("getMap");return e&&e(t)},graphic:Cf,helper:ff,init:Ud,innerDrawElementOnCanvas:yt,matrix:Ge,number:Df,parseGeoJSON:If,parseGeoJson:If,registerAction:eh,registerCoordinateSystem:nh,registerLayout:ih,registerLoading:sh,registerLocale:Dr,registerMap:lh,registerPostInit:$d,registerPostUpdate:Qd,registerPreprocessor:Kd,registerProcessor:Jd,registerTheme:qd,registerTransform:uh,registerUpdateLifecycle:th,registerVisual:oh,setCanvasCreator:function(t){_t({createCanvas:t})},setPlatformAPI:_t,throttle:zu,time:Tf,use:hh,util:Lf,vector:Fe,version:"5.6.0",zrUtil:We,zrender:He},Symbol.toStringTag,{value:"Module"}));
  15131. // Default to have canvas renderer and dataset for compitatble reason.
  15132. hh([Ng,OR]),hh(Pg);export{Fh as S,fo as a,Zf as b,Wh as c,Yi as d,Uf as e,pf as f,Gc as g,$R as h,oo as i,Ud as j,xo as m,je as p,io as u};
  15133. //# sourceMappingURL=echarts-a77f8af6.js.map