echarts_components.js 519 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853
  1. import {
  2. AxisBuilder_default,
  3. AxisView_default,
  4. BrushController_default,
  5. LineDraw_default,
  6. RoamController_default,
  7. SymbolDraw_default,
  8. VisualMapping_default,
  9. applyKeyframeAnimation,
  10. applyLeaveTransition,
  11. applyUpdateTransition,
  12. axisModelCreator,
  13. collect,
  14. convertFromEC4CompatibleStyle,
  15. getAxisInfo,
  16. install,
  17. install2,
  18. install3,
  19. install4,
  20. isCoordinateSystemType,
  21. isEC4CompatibleStyle,
  22. isTransitionAll,
  23. layout,
  24. makeKey,
  25. makeLinearBrushOtherExtent,
  26. makeRectIsTargetByCursor,
  27. makeRectPanelClipPath,
  28. rectCoordAxisBuildSplitArea,
  29. rectCoordAxisHandleRemove,
  30. sliderMove,
  31. stopPreviousKeyframeAnimationAndRestore,
  32. updateLeaveTo
  33. } from "./chunk-43FE5UYX.js";
  34. import {
  35. AxisModelCommonMixin,
  36. Axis_default,
  37. Circle_default,
  38. Component_default,
  39. Component_default2,
  40. DataDiffer_default,
  41. DataFormatMixin,
  42. Group_default,
  43. Interval_default,
  44. LOCATION_PARAMS,
  45. Line_default,
  46. LinearGradient_default,
  47. MULTIPLE_REFERRING,
  48. Model_default,
  49. Ordinal_default,
  50. Polygon_default,
  51. Polyline_default,
  52. Ring_default,
  53. SERIES_LAYOUT_BY_COLUMN,
  54. SINGLE_REFERRING,
  55. SOURCE_FORMAT_ARRAY_ROWS,
  56. SOURCE_FORMAT_OBJECT_ROWS,
  57. Sector_default,
  58. SeriesData_default,
  59. SortOrderComparator,
  60. SourceManager,
  61. Time_default,
  62. TooltipMarkupStyleCreator,
  63. __extends,
  64. addEventListener,
  65. applyTransform,
  66. asc,
  67. box,
  68. buildTooltipMarkup,
  69. clear,
  70. compressBatches,
  71. contain,
  72. convertOptionIdName,
  73. convertToColorString,
  74. copyLayoutParams,
  75. createFilterComparator,
  76. createIcon,
  77. createOrUpdate,
  78. createOrUpdatePatternFromDecal,
  79. createScaleByModel,
  80. createSymbol,
  81. createTextStyle,
  82. createTooltipMarkup,
  83. defaultEmphasis,
  84. deprecateLog,
  85. disableTransformOptionMerge,
  86. enableHoverEmphasis,
  87. ensureScaleRawExtentInfo,
  88. enterBlur,
  89. enterEmphasis,
  90. findEventDispatcher,
  91. format,
  92. formatTpl,
  93. formatTplSimple,
  94. getAxisRawValue,
  95. getDataDimensionsOnAxis,
  96. getDataItemValue,
  97. getDecalFromPalette,
  98. getECData,
  99. getItemVisualFromData,
  100. getLabelStatesModels,
  101. getLayoutParams,
  102. getLayoutRect,
  103. getLocaleModel,
  104. getPaddingFromTooltipModel,
  105. getPixelPrecision,
  106. getPrecision,
  107. getRawValueParser,
  108. getShapeClass,
  109. getStackedDimension,
  110. getTooltipRenderMode,
  111. getTransform,
  112. getUID,
  113. getVisualFromData,
  114. graphic_exports,
  115. groupTransition,
  116. inheritDefaultOption,
  117. isDimensionStacked,
  118. isNameSpecified,
  119. leaveBlur,
  120. leaveEmphasis,
  121. linePolygonIntersect,
  122. linearMap,
  123. makeInner,
  124. makeInternalComponentId,
  125. makePrintable,
  126. mappingToExists,
  127. mergeLayoutParam,
  128. mergePath,
  129. niceScaleExtent,
  130. normalizeCssArray,
  131. normalizeEvent,
  132. normalizeSymbolOffset,
  133. normalizeSymbolSize,
  134. normalizeToArray,
  135. normalizeTooltipFormatResult,
  136. parseDataValue,
  137. parseDate,
  138. parseFinder,
  139. parsePercent as parsePercent2,
  140. positionElement,
  141. preParseFinder,
  142. queryDataIndex,
  143. queryReferringComponents,
  144. reformIntervals,
  145. registerAction,
  146. registerInternalOptionCreator,
  147. setAsHighDownDispatcher,
  148. setItemVisualFromData,
  149. setLabelStyle,
  150. setStatesStylesFromModel,
  151. setTooltipConfig,
  152. sizeCalculable,
  153. stop,
  154. symbolBuildProxies,
  155. throwError,
  156. toCamelCase,
  157. toggleHoverEmphasis,
  158. transformDirection,
  159. transformLocalCoord,
  160. unionAxisExtentFromData,
  161. updateProps,
  162. use,
  163. warn,
  164. windowOpen
  165. } from "./chunk-4Z63X5VE.js";
  166. import {
  167. BoundingRect_default,
  168. Displayable_default,
  169. Image_default,
  170. Point_default,
  171. Rect_default,
  172. Text_default,
  173. assert,
  174. bind,
  175. clone,
  176. create,
  177. createHashMap,
  178. curry,
  179. defaults,
  180. each,
  181. env_default,
  182. extend,
  183. filter,
  184. getBoundingRect,
  185. hasOwn,
  186. indexOf,
  187. isArray,
  188. isArrayLike,
  189. isDom,
  190. isFunction,
  191. isNumber,
  192. isObject,
  193. isRegExp,
  194. isString,
  195. keys,
  196. logError,
  197. map,
  198. merge,
  199. mergeAll,
  200. mixin,
  201. modifyAlpha,
  202. noop,
  203. parse,
  204. parsePercent,
  205. retrieve,
  206. retrieve2,
  207. rotate,
  208. stringify,
  209. translate,
  210. trim
  211. } from "./chunk-NFL6MJ5K.js";
  212. import {
  213. init_define_APP_INFO
  214. } from "./chunk-XY75H3MP.js";
  215. // dep:echarts_components
  216. init_define_APP_INFO();
  217. // node_modules/echarts/components.js
  218. init_define_APP_INFO();
  219. // node_modules/echarts/lib/export/components.js
  220. init_define_APP_INFO();
  221. // node_modules/echarts/lib/component/grid/install.js
  222. init_define_APP_INFO();
  223. // node_modules/echarts/lib/component/axisPointer/install.js
  224. init_define_APP_INFO();
  225. // node_modules/echarts/lib/component/axisPointer/CartesianAxisPointer.js
  226. init_define_APP_INFO();
  227. // node_modules/echarts/lib/component/axisPointer/BaseAxisPointer.js
  228. init_define_APP_INFO();
  229. var inner = makeInner();
  230. var clone2 = clone;
  231. var bind2 = bind;
  232. var BaseAxisPointer = function() {
  233. function BaseAxisPointer2() {
  234. this._dragging = false;
  235. this.animationThreshold = 15;
  236. }
  237. BaseAxisPointer2.prototype.render = function(axisModel, axisPointerModel, api, forceRender) {
  238. var value = axisPointerModel.get("value");
  239. var status = axisPointerModel.get("status");
  240. this._axisModel = axisModel;
  241. this._axisPointerModel = axisPointerModel;
  242. this._api = api;
  243. if (!forceRender && this._lastValue === value && this._lastStatus === status) {
  244. return;
  245. }
  246. this._lastValue = value;
  247. this._lastStatus = status;
  248. var group = this._group;
  249. var handle = this._handle;
  250. if (!status || status === "hide") {
  251. group && group.hide();
  252. handle && handle.hide();
  253. return;
  254. }
  255. group && group.show();
  256. handle && handle.show();
  257. var elOption = {};
  258. this.makeElOption(elOption, value, axisModel, axisPointerModel, api);
  259. var graphicKey = elOption.graphicKey;
  260. if (graphicKey !== this._lastGraphicKey) {
  261. this.clear(api);
  262. }
  263. this._lastGraphicKey = graphicKey;
  264. var moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel);
  265. if (!group) {
  266. group = this._group = new Group_default();
  267. this.createPointerEl(group, elOption, axisModel, axisPointerModel);
  268. this.createLabelEl(group, elOption, axisModel, axisPointerModel);
  269. api.getZr().add(group);
  270. } else {
  271. var doUpdateProps = curry(updateProps2, axisPointerModel, moveAnimation);
  272. this.updatePointerEl(group, elOption, doUpdateProps);
  273. this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);
  274. }
  275. updateMandatoryProps(group, axisPointerModel, true);
  276. this._renderHandle(value);
  277. };
  278. BaseAxisPointer2.prototype.remove = function(api) {
  279. this.clear(api);
  280. };
  281. BaseAxisPointer2.prototype.dispose = function(api) {
  282. this.clear(api);
  283. };
  284. BaseAxisPointer2.prototype.determineAnimation = function(axisModel, axisPointerModel) {
  285. var animation = axisPointerModel.get("animation");
  286. var axis = axisModel.axis;
  287. var isCategoryAxis = axis.type === "category";
  288. var useSnap = axisPointerModel.get("snap");
  289. if (!useSnap && !isCategoryAxis) {
  290. return false;
  291. }
  292. if (animation === "auto" || animation == null) {
  293. var animationThreshold = this.animationThreshold;
  294. if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {
  295. return true;
  296. }
  297. if (useSnap) {
  298. var seriesDataCount = getAxisInfo(axisModel).seriesDataCount;
  299. var axisExtent = axis.getExtent();
  300. return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;
  301. }
  302. return false;
  303. }
  304. return animation === true;
  305. };
  306. BaseAxisPointer2.prototype.makeElOption = function(elOption, value, axisModel, axisPointerModel, api) {
  307. };
  308. BaseAxisPointer2.prototype.createPointerEl = function(group, elOption, axisModel, axisPointerModel) {
  309. var pointerOption = elOption.pointer;
  310. if (pointerOption) {
  311. var pointerEl = inner(group).pointerEl = new graphic_exports[pointerOption.type](clone2(elOption.pointer));
  312. group.add(pointerEl);
  313. }
  314. };
  315. BaseAxisPointer2.prototype.createLabelEl = function(group, elOption, axisModel, axisPointerModel) {
  316. if (elOption.label) {
  317. var labelEl = inner(group).labelEl = new Text_default(clone2(elOption.label));
  318. group.add(labelEl);
  319. updateLabelShowHide(labelEl, axisPointerModel);
  320. }
  321. };
  322. BaseAxisPointer2.prototype.updatePointerEl = function(group, elOption, updateProps3) {
  323. var pointerEl = inner(group).pointerEl;
  324. if (pointerEl && elOption.pointer) {
  325. pointerEl.setStyle(elOption.pointer.style);
  326. updateProps3(pointerEl, {
  327. shape: elOption.pointer.shape
  328. });
  329. }
  330. };
  331. BaseAxisPointer2.prototype.updateLabelEl = function(group, elOption, updateProps3, axisPointerModel) {
  332. var labelEl = inner(group).labelEl;
  333. if (labelEl) {
  334. labelEl.setStyle(elOption.label.style);
  335. updateProps3(labelEl, {
  336. x: elOption.label.x,
  337. y: elOption.label.y
  338. });
  339. updateLabelShowHide(labelEl, axisPointerModel);
  340. }
  341. };
  342. BaseAxisPointer2.prototype._renderHandle = function(value) {
  343. if (this._dragging || !this.updateHandleTransform) {
  344. return;
  345. }
  346. var axisPointerModel = this._axisPointerModel;
  347. var zr = this._api.getZr();
  348. var handle = this._handle;
  349. var handleModel = axisPointerModel.getModel("handle");
  350. var status = axisPointerModel.get("status");
  351. if (!handleModel.get("show") || !status || status === "hide") {
  352. handle && zr.remove(handle);
  353. this._handle = null;
  354. return;
  355. }
  356. var isInit;
  357. if (!this._handle) {
  358. isInit = true;
  359. handle = this._handle = createIcon(handleModel.get("icon"), {
  360. cursor: "move",
  361. draggable: true,
  362. onmousemove: function(e) {
  363. stop(e.event);
  364. },
  365. onmousedown: bind2(this._onHandleDragMove, this, 0, 0),
  366. drift: bind2(this._onHandleDragMove, this),
  367. ondragend: bind2(this._onHandleDragEnd, this)
  368. });
  369. zr.add(handle);
  370. }
  371. updateMandatoryProps(handle, axisPointerModel, false);
  372. handle.setStyle(handleModel.getItemStyle(null, ["color", "borderColor", "borderWidth", "opacity", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"]));
  373. var handleSize = handleModel.get("size");
  374. if (!isArray(handleSize)) {
  375. handleSize = [handleSize, handleSize];
  376. }
  377. handle.scaleX = handleSize[0] / 2;
  378. handle.scaleY = handleSize[1] / 2;
  379. createOrUpdate(this, "_doDispatchAxisPointer", handleModel.get("throttle") || 0, "fixRate");
  380. this._moveHandleToValue(value, isInit);
  381. };
  382. BaseAxisPointer2.prototype._moveHandleToValue = function(value, isInit) {
  383. updateProps2(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));
  384. };
  385. BaseAxisPointer2.prototype._onHandleDragMove = function(dx, dy) {
  386. var handle = this._handle;
  387. if (!handle) {
  388. return;
  389. }
  390. this._dragging = true;
  391. var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);
  392. this._payloadInfo = trans;
  393. handle.stopAnimation();
  394. handle.attr(getHandleTransProps(trans));
  395. inner(handle).lastProp = null;
  396. this._doDispatchAxisPointer();
  397. };
  398. BaseAxisPointer2.prototype._doDispatchAxisPointer = function() {
  399. var handle = this._handle;
  400. if (!handle) {
  401. return;
  402. }
  403. var payloadInfo = this._payloadInfo;
  404. var axisModel = this._axisModel;
  405. this._api.dispatchAction({
  406. type: "updateAxisPointer",
  407. x: payloadInfo.cursorPoint[0],
  408. y: payloadInfo.cursorPoint[1],
  409. tooltipOption: payloadInfo.tooltipOption,
  410. axesInfo: [{
  411. axisDim: axisModel.axis.dim,
  412. axisIndex: axisModel.componentIndex
  413. }]
  414. });
  415. };
  416. BaseAxisPointer2.prototype._onHandleDragEnd = function() {
  417. this._dragging = false;
  418. var handle = this._handle;
  419. if (!handle) {
  420. return;
  421. }
  422. var value = this._axisPointerModel.get("value");
  423. this._moveHandleToValue(value);
  424. this._api.dispatchAction({
  425. type: "hideTip"
  426. });
  427. };
  428. BaseAxisPointer2.prototype.clear = function(api) {
  429. this._lastValue = null;
  430. this._lastStatus = null;
  431. var zr = api.getZr();
  432. var group = this._group;
  433. var handle = this._handle;
  434. if (zr && group) {
  435. this._lastGraphicKey = null;
  436. group && zr.remove(group);
  437. handle && zr.remove(handle);
  438. this._group = null;
  439. this._handle = null;
  440. this._payloadInfo = null;
  441. }
  442. clear(this, "_doDispatchAxisPointer");
  443. };
  444. BaseAxisPointer2.prototype.doClear = function() {
  445. };
  446. BaseAxisPointer2.prototype.buildLabel = function(xy, wh, xDimIndex) {
  447. xDimIndex = xDimIndex || 0;
  448. return {
  449. x: xy[xDimIndex],
  450. y: xy[1 - xDimIndex],
  451. width: wh[xDimIndex],
  452. height: wh[1 - xDimIndex]
  453. };
  454. };
  455. return BaseAxisPointer2;
  456. }();
  457. function updateProps2(animationModel, moveAnimation, el, props) {
  458. if (!propsEqual(inner(el).lastProp, props)) {
  459. inner(el).lastProp = props;
  460. moveAnimation ? updateProps(el, props, animationModel) : (el.stopAnimation(), el.attr(props));
  461. }
  462. }
  463. function propsEqual(lastProps, newProps) {
  464. if (isObject(lastProps) && isObject(newProps)) {
  465. var equals_1 = true;
  466. each(newProps, function(item, key) {
  467. equals_1 = equals_1 && propsEqual(lastProps[key], item);
  468. });
  469. return !!equals_1;
  470. } else {
  471. return lastProps === newProps;
  472. }
  473. }
  474. function updateLabelShowHide(labelEl, axisPointerModel) {
  475. labelEl[axisPointerModel.get(["label", "show"]) ? "show" : "hide"]();
  476. }
  477. function getHandleTransProps(trans) {
  478. return {
  479. x: trans.x || 0,
  480. y: trans.y || 0,
  481. rotation: trans.rotation || 0
  482. };
  483. }
  484. function updateMandatoryProps(group, axisPointerModel, silent) {
  485. var z = axisPointerModel.get("z");
  486. var zlevel = axisPointerModel.get("zlevel");
  487. group && group.traverse(function(el) {
  488. if (el.type !== "group") {
  489. z != null && (el.z = z);
  490. zlevel != null && (el.zlevel = zlevel);
  491. el.silent = silent;
  492. }
  493. });
  494. }
  495. var BaseAxisPointer_default = BaseAxisPointer;
  496. // node_modules/echarts/lib/component/axisPointer/viewHelper.js
  497. init_define_APP_INFO();
  498. function buildElStyle(axisPointerModel) {
  499. var axisPointerType = axisPointerModel.get("type");
  500. var styleModel = axisPointerModel.getModel(axisPointerType + "Style");
  501. var style;
  502. if (axisPointerType === "line") {
  503. style = styleModel.getLineStyle();
  504. style.fill = null;
  505. } else if (axisPointerType === "shadow") {
  506. style = styleModel.getAreaStyle();
  507. style.stroke = null;
  508. }
  509. return style;
  510. }
  511. function buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) {
  512. var value = axisPointerModel.get("value");
  513. var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get("seriesDataIndices"), {
  514. precision: axisPointerModel.get(["label", "precision"]),
  515. formatter: axisPointerModel.get(["label", "formatter"])
  516. });
  517. var labelModel = axisPointerModel.getModel("label");
  518. var paddings = normalizeCssArray(labelModel.get("padding") || 0);
  519. var font = labelModel.getFont();
  520. var textRect = getBoundingRect(text, font);
  521. var position = labelPos.position;
  522. var width = textRect.width + paddings[1] + paddings[3];
  523. var height = textRect.height + paddings[0] + paddings[2];
  524. var align = labelPos.align;
  525. align === "right" && (position[0] -= width);
  526. align === "center" && (position[0] -= width / 2);
  527. var verticalAlign = labelPos.verticalAlign;
  528. verticalAlign === "bottom" && (position[1] -= height);
  529. verticalAlign === "middle" && (position[1] -= height / 2);
  530. confineInContainer(position, width, height, api);
  531. var bgColor = labelModel.get("backgroundColor");
  532. if (!bgColor || bgColor === "auto") {
  533. bgColor = axisModel.get(["axisLine", "lineStyle", "color"]);
  534. }
  535. elOption.label = {
  536. x: position[0],
  537. y: position[1],
  538. style: createTextStyle(labelModel, {
  539. text,
  540. font,
  541. fill: labelModel.getTextColor(),
  542. padding: paddings,
  543. backgroundColor: bgColor
  544. }),
  545. z2: 10
  546. };
  547. }
  548. function confineInContainer(position, width, height, api) {
  549. var viewWidth = api.getWidth();
  550. var viewHeight = api.getHeight();
  551. position[0] = Math.min(position[0] + width, viewWidth) - width;
  552. position[1] = Math.min(position[1] + height, viewHeight) - height;
  553. position[0] = Math.max(position[0], 0);
  554. position[1] = Math.max(position[1], 0);
  555. }
  556. function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {
  557. value = axis.scale.parse(value);
  558. var text = axis.scale.getLabel({
  559. value
  560. }, {
  561. precision: opt.precision
  562. });
  563. var formatter = opt.formatter;
  564. if (formatter) {
  565. var params_1 = {
  566. value: getAxisRawValue(axis, {
  567. value
  568. }),
  569. axisDimension: axis.dim,
  570. axisIndex: axis.index,
  571. seriesData: []
  572. };
  573. each(seriesDataIndices, function(idxItem) {
  574. var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);
  575. var dataIndex = idxItem.dataIndexInside;
  576. var dataParams = series && series.getDataParams(dataIndex);
  577. dataParams && params_1.seriesData.push(dataParams);
  578. });
  579. if (isString(formatter)) {
  580. text = formatter.replace("{value}", text);
  581. } else if (isFunction(formatter)) {
  582. text = formatter(params_1);
  583. }
  584. }
  585. return text;
  586. }
  587. function getTransformedPosition(axis, value, layoutInfo) {
  588. var transform = create();
  589. rotate(transform, transform, layoutInfo.rotation);
  590. translate(transform, transform, layoutInfo.position);
  591. return applyTransform([axis.dataToCoord(value), (layoutInfo.labelOffset || 0) + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)], transform);
  592. }
  593. function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api) {
  594. var textLayout = AxisBuilder_default.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection);
  595. layoutInfo.labelMargin = axisPointerModel.get(["label", "margin"]);
  596. buildLabelElOption(elOption, axisModel, axisPointerModel, api, {
  597. position: getTransformedPosition(axisModel.axis, value, layoutInfo),
  598. align: textLayout.textAlign,
  599. verticalAlign: textLayout.textVerticalAlign
  600. });
  601. }
  602. function makeLineShape(p1, p2, xDimIndex) {
  603. xDimIndex = xDimIndex || 0;
  604. return {
  605. x1: p1[xDimIndex],
  606. y1: p1[1 - xDimIndex],
  607. x2: p2[xDimIndex],
  608. y2: p2[1 - xDimIndex]
  609. };
  610. }
  611. function makeRectShape(xy, wh, xDimIndex) {
  612. xDimIndex = xDimIndex || 0;
  613. return {
  614. x: xy[xDimIndex],
  615. y: xy[1 - xDimIndex],
  616. width: wh[xDimIndex],
  617. height: wh[1 - xDimIndex]
  618. };
  619. }
  620. function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) {
  621. return {
  622. cx,
  623. cy,
  624. r0,
  625. r,
  626. startAngle,
  627. endAngle,
  628. clockwise: true
  629. };
  630. }
  631. // node_modules/echarts/lib/component/axisPointer/CartesianAxisPointer.js
  632. var CartesianAxisPointer = function(_super) {
  633. __extends(CartesianAxisPointer2, _super);
  634. function CartesianAxisPointer2() {
  635. return _super !== null && _super.apply(this, arguments) || this;
  636. }
  637. CartesianAxisPointer2.prototype.makeElOption = function(elOption, value, axisModel, axisPointerModel, api) {
  638. var axis = axisModel.axis;
  639. var grid = axis.grid;
  640. var axisPointerType = axisPointerModel.get("type");
  641. var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();
  642. var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));
  643. if (axisPointerType && axisPointerType !== "none") {
  644. var elStyle = buildElStyle(axisPointerModel);
  645. var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);
  646. pointerOption.style = elStyle;
  647. elOption.graphicKey = pointerOption.type;
  648. elOption.pointer = pointerOption;
  649. }
  650. var layoutInfo = layout(grid.model, axisModel);
  651. buildCartesianSingleLabelElOption(
  652. value,
  653. elOption,
  654. layoutInfo,
  655. axisModel,
  656. axisPointerModel,
  657. api
  658. );
  659. };
  660. CartesianAxisPointer2.prototype.getHandleTransform = function(value, axisModel, axisPointerModel) {
  661. var layoutInfo = layout(axisModel.axis.grid.model, axisModel, {
  662. labelInside: false
  663. });
  664. layoutInfo.labelMargin = axisPointerModel.get(["handle", "margin"]);
  665. var pos = getTransformedPosition(axisModel.axis, value, layoutInfo);
  666. return {
  667. x: pos[0],
  668. y: pos[1],
  669. rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)
  670. };
  671. };
  672. CartesianAxisPointer2.prototype.updateHandleTransform = function(transform, delta, axisModel, axisPointerModel) {
  673. var axis = axisModel.axis;
  674. var grid = axis.grid;
  675. var axisExtent = axis.getGlobalExtent(true);
  676. var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();
  677. var dimIndex = axis.dim === "x" ? 0 : 1;
  678. var currPosition = [transform.x, transform.y];
  679. currPosition[dimIndex] += delta[dimIndex];
  680. currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);
  681. currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);
  682. var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;
  683. var cursorPoint = [cursorOtherValue, cursorOtherValue];
  684. cursorPoint[dimIndex] = currPosition[dimIndex];
  685. var tooltipOptions = [{
  686. verticalAlign: "middle"
  687. }, {
  688. align: "center"
  689. }];
  690. return {
  691. x: currPosition[0],
  692. y: currPosition[1],
  693. rotation: transform.rotation,
  694. cursorPoint,
  695. tooltipOption: tooltipOptions[dimIndex]
  696. };
  697. };
  698. return CartesianAxisPointer2;
  699. }(BaseAxisPointer_default);
  700. function getCartesian(grid, axis) {
  701. var opt = {};
  702. opt[axis.dim + "AxisIndex"] = axis.index;
  703. return grid.getCartesian(opt);
  704. }
  705. var pointerShapeBuilder = {
  706. line: function(axis, pixelValue, otherExtent) {
  707. var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));
  708. return {
  709. type: "Line",
  710. subPixelOptimize: true,
  711. shape: targetShape
  712. };
  713. },
  714. shadow: function(axis, pixelValue, otherExtent) {
  715. var bandWidth = Math.max(1, axis.getBandWidth());
  716. var span = otherExtent[1] - otherExtent[0];
  717. return {
  718. type: "Rect",
  719. shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))
  720. };
  721. }
  722. };
  723. function getAxisDimIndex(axis) {
  724. return axis.dim === "x" ? 0 : 1;
  725. }
  726. var CartesianAxisPointer_default = CartesianAxisPointer;
  727. // node_modules/echarts/lib/component/axisPointer/AxisPointerModel.js
  728. init_define_APP_INFO();
  729. var AxisPointerModel = function(_super) {
  730. __extends(AxisPointerModel2, _super);
  731. function AxisPointerModel2() {
  732. var _this = _super !== null && _super.apply(this, arguments) || this;
  733. _this.type = AxisPointerModel2.type;
  734. return _this;
  735. }
  736. AxisPointerModel2.type = "axisPointer";
  737. AxisPointerModel2.defaultOption = {
  738. show: "auto",
  739. z: 50,
  740. type: "line",
  741. snap: false,
  742. triggerTooltip: true,
  743. value: null,
  744. status: null,
  745. link: [],
  746. animation: null,
  747. animationDurationUpdate: 200,
  748. lineStyle: {
  749. color: "#B9BEC9",
  750. width: 1,
  751. type: "dashed"
  752. },
  753. shadowStyle: {
  754. color: "rgba(210,219,238,0.2)"
  755. },
  756. label: {
  757. show: true,
  758. formatter: null,
  759. precision: "auto",
  760. margin: 3,
  761. color: "#fff",
  762. padding: [5, 7, 5, 7],
  763. backgroundColor: "auto",
  764. borderColor: null,
  765. borderWidth: 0,
  766. borderRadius: 3
  767. },
  768. handle: {
  769. show: false,
  770. 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",
  771. size: 45,
  772. margin: 50,
  773. color: "#333",
  774. shadowBlur: 3,
  775. shadowColor: "#aaa",
  776. shadowOffsetX: 0,
  777. shadowOffsetY: 2,
  778. throttle: 40
  779. }
  780. };
  781. return AxisPointerModel2;
  782. }(Component_default);
  783. var AxisPointerModel_default = AxisPointerModel;
  784. // node_modules/echarts/lib/component/axisPointer/AxisPointerView.js
  785. init_define_APP_INFO();
  786. // node_modules/echarts/lib/component/axisPointer/globalListener.js
  787. init_define_APP_INFO();
  788. var inner2 = makeInner();
  789. var each2 = each;
  790. function register(key, api, handler) {
  791. if (env_default.node) {
  792. return;
  793. }
  794. var zr = api.getZr();
  795. inner2(zr).records || (inner2(zr).records = {});
  796. initGlobalListeners(zr, api);
  797. var record = inner2(zr).records[key] || (inner2(zr).records[key] = {});
  798. record.handler = handler;
  799. }
  800. function initGlobalListeners(zr, api) {
  801. if (inner2(zr).initialized) {
  802. return;
  803. }
  804. inner2(zr).initialized = true;
  805. useHandler("click", curry(doEnter, "click"));
  806. useHandler("mousemove", curry(doEnter, "mousemove"));
  807. useHandler("globalout", onLeave);
  808. function useHandler(eventType, cb) {
  809. zr.on(eventType, function(e) {
  810. var dis = makeDispatchAction(api);
  811. each2(inner2(zr).records, function(record) {
  812. record && cb(record, e, dis.dispatchAction);
  813. });
  814. dispatchTooltipFinally(dis.pendings, api);
  815. });
  816. }
  817. }
  818. function dispatchTooltipFinally(pendings, api) {
  819. var showLen = pendings.showTip.length;
  820. var hideLen = pendings.hideTip.length;
  821. var actuallyPayload;
  822. if (showLen) {
  823. actuallyPayload = pendings.showTip[showLen - 1];
  824. } else if (hideLen) {
  825. actuallyPayload = pendings.hideTip[hideLen - 1];
  826. }
  827. if (actuallyPayload) {
  828. actuallyPayload.dispatchAction = null;
  829. api.dispatchAction(actuallyPayload);
  830. }
  831. }
  832. function onLeave(record, e, dispatchAction3) {
  833. record.handler("leave", null, dispatchAction3);
  834. }
  835. function doEnter(currTrigger, record, e, dispatchAction3) {
  836. record.handler(currTrigger, e, dispatchAction3);
  837. }
  838. function makeDispatchAction(api) {
  839. var pendings = {
  840. showTip: [],
  841. hideTip: []
  842. };
  843. var dispatchAction3 = function(payload) {
  844. var pendingList = pendings[payload.type];
  845. if (pendingList) {
  846. pendingList.push(payload);
  847. } else {
  848. payload.dispatchAction = dispatchAction3;
  849. api.dispatchAction(payload);
  850. }
  851. };
  852. return {
  853. dispatchAction: dispatchAction3,
  854. pendings
  855. };
  856. }
  857. function unregister(key, api) {
  858. if (env_default.node) {
  859. return;
  860. }
  861. var zr = api.getZr();
  862. var record = (inner2(zr).records || {})[key];
  863. if (record) {
  864. inner2(zr).records[key] = null;
  865. }
  866. }
  867. // node_modules/echarts/lib/component/axisPointer/AxisPointerView.js
  868. var AxisPointerView = function(_super) {
  869. __extends(AxisPointerView2, _super);
  870. function AxisPointerView2() {
  871. var _this = _super !== null && _super.apply(this, arguments) || this;
  872. _this.type = AxisPointerView2.type;
  873. return _this;
  874. }
  875. AxisPointerView2.prototype.render = function(globalAxisPointerModel, ecModel, api) {
  876. var globalTooltipModel = ecModel.getComponent("tooltip");
  877. var triggerOn = globalAxisPointerModel.get("triggerOn") || globalTooltipModel && globalTooltipModel.get("triggerOn") || "mousemove|click";
  878. register("axisPointer", api, function(currTrigger, e, dispatchAction3) {
  879. if (triggerOn !== "none" && (currTrigger === "leave" || triggerOn.indexOf(currTrigger) >= 0)) {
  880. dispatchAction3({
  881. type: "updateAxisPointer",
  882. currTrigger,
  883. x: e && e.offsetX,
  884. y: e && e.offsetY
  885. });
  886. }
  887. });
  888. };
  889. AxisPointerView2.prototype.remove = function(ecModel, api) {
  890. unregister("axisPointer", api);
  891. };
  892. AxisPointerView2.prototype.dispose = function(ecModel, api) {
  893. unregister("axisPointer", api);
  894. };
  895. AxisPointerView2.type = "axisPointer";
  896. return AxisPointerView2;
  897. }(Component_default2);
  898. var AxisPointerView_default = AxisPointerView;
  899. // node_modules/echarts/lib/component/axisPointer/axisTrigger.js
  900. init_define_APP_INFO();
  901. // node_modules/echarts/lib/component/axisPointer/findPointFromSeries.js
  902. init_define_APP_INFO();
  903. function findPointFromSeries(finder, ecModel) {
  904. var point = [];
  905. var seriesIndex = finder.seriesIndex;
  906. var seriesModel;
  907. if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {
  908. return {
  909. point: []
  910. };
  911. }
  912. var data = seriesModel.getData();
  913. var dataIndex = queryDataIndex(data, finder);
  914. if (dataIndex == null || dataIndex < 0 || isArray(dataIndex)) {
  915. return {
  916. point: []
  917. };
  918. }
  919. var el = data.getItemGraphicEl(dataIndex);
  920. var coordSys = seriesModel.coordinateSystem;
  921. if (seriesModel.getTooltipPosition) {
  922. point = seriesModel.getTooltipPosition(dataIndex) || [];
  923. } else if (coordSys && coordSys.dataToPoint) {
  924. if (finder.isStacked) {
  925. var baseAxis = coordSys.getBaseAxis();
  926. var valueAxis = coordSys.getOtherAxis(baseAxis);
  927. var valueAxisDim = valueAxis.dim;
  928. var baseAxisDim = baseAxis.dim;
  929. var baseDataOffset = valueAxisDim === "x" || valueAxisDim === "radius" ? 1 : 0;
  930. var baseDim = data.mapDimension(baseAxisDim);
  931. var stackedData = [];
  932. stackedData[baseDataOffset] = data.get(baseDim, dataIndex);
  933. stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo("stackResultDimension"), dataIndex);
  934. point = coordSys.dataToPoint(stackedData) || [];
  935. } else {
  936. point = coordSys.dataToPoint(data.getValues(map(coordSys.dimensions, function(dim) {
  937. return data.mapDimension(dim);
  938. }), dataIndex)) || [];
  939. }
  940. } else if (el) {
  941. var rect = el.getBoundingRect().clone();
  942. rect.applyTransform(el.transform);
  943. point = [rect.x + rect.width / 2, rect.y + rect.height / 2];
  944. }
  945. return {
  946. point,
  947. el
  948. };
  949. }
  950. // node_modules/echarts/lib/component/axisPointer/axisTrigger.js
  951. var inner3 = makeInner();
  952. function axisTrigger(payload, ecModel, api) {
  953. var currTrigger = payload.currTrigger;
  954. var point = [payload.x, payload.y];
  955. var finder = payload;
  956. var dispatchAction3 = payload.dispatchAction || bind(api.dispatchAction, api);
  957. var coordSysAxesInfo = ecModel.getComponent("axisPointer").coordSysAxesInfo;
  958. if (!coordSysAxesInfo) {
  959. return;
  960. }
  961. if (illegalPoint(point)) {
  962. point = findPointFromSeries({
  963. seriesIndex: finder.seriesIndex,
  964. dataIndex: finder.dataIndex
  965. }, ecModel).point;
  966. }
  967. var isIllegalPoint = illegalPoint(point);
  968. var inputAxesInfo = finder.axesInfo;
  969. var axesInfo = coordSysAxesInfo.axesInfo;
  970. var shouldHide = currTrigger === "leave" || illegalPoint(point);
  971. var outputPayload = {};
  972. var showValueMap = {};
  973. var dataByCoordSys = {
  974. list: [],
  975. map: {}
  976. };
  977. var updaters = {
  978. showPointer: curry(showPointer, showValueMap),
  979. showTooltip: curry(showTooltip, dataByCoordSys)
  980. };
  981. each(coordSysAxesInfo.coordSysMap, function(coordSys, coordSysKey) {
  982. var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);
  983. each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function(axisInfo, key) {
  984. var axis = axisInfo.axis;
  985. var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo);
  986. if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {
  987. var val = inputAxisInfo && inputAxisInfo.value;
  988. if (val == null && !isIllegalPoint) {
  989. val = axis.pointToData(point);
  990. }
  991. val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);
  992. }
  993. });
  994. });
  995. var linkTriggers = {};
  996. each(axesInfo, function(tarAxisInfo, tarKey) {
  997. var linkGroup = tarAxisInfo.linkGroup;
  998. if (linkGroup && !showValueMap[tarKey]) {
  999. each(linkGroup.axesInfo, function(srcAxisInfo, srcKey) {
  1000. var srcValItem = showValueMap[srcKey];
  1001. if (srcAxisInfo !== tarAxisInfo && srcValItem) {
  1002. var val = srcValItem.value;
  1003. linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));
  1004. linkTriggers[tarAxisInfo.key] = val;
  1005. }
  1006. });
  1007. }
  1008. });
  1009. each(linkTriggers, function(val, tarKey) {
  1010. processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);
  1011. });
  1012. updateModelActually(showValueMap, axesInfo, outputPayload);
  1013. dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction3);
  1014. dispatchHighDownActually(axesInfo, dispatchAction3, api);
  1015. return outputPayload;
  1016. }
  1017. function processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {
  1018. var axis = axisInfo.axis;
  1019. if (axis.scale.isBlank() || !axis.containData(newValue)) {
  1020. return;
  1021. }
  1022. if (!axisInfo.involveSeries) {
  1023. updaters.showPointer(axisInfo, newValue);
  1024. return;
  1025. }
  1026. var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);
  1027. var payloadBatch = payloadInfo.payloadBatch;
  1028. var snapToValue = payloadInfo.snapToValue;
  1029. if (payloadBatch[0] && outputFinder.seriesIndex == null) {
  1030. extend(outputFinder, payloadBatch[0]);
  1031. }
  1032. if (!noSnap && axisInfo.snap) {
  1033. if (axis.containData(snapToValue) && snapToValue != null) {
  1034. newValue = snapToValue;
  1035. }
  1036. }
  1037. updaters.showPointer(axisInfo, newValue, payloadBatch);
  1038. updaters.showTooltip(axisInfo, payloadInfo, snapToValue);
  1039. }
  1040. function buildPayloadsBySeries(value, axisInfo) {
  1041. var axis = axisInfo.axis;
  1042. var dim = axis.dim;
  1043. var snapToValue = value;
  1044. var payloadBatch = [];
  1045. var minDist = Number.MAX_VALUE;
  1046. var minDiff = -1;
  1047. each(axisInfo.seriesModels, function(series, idx) {
  1048. var dataDim = series.getData().mapDimensionsAll(dim);
  1049. var seriesNestestValue;
  1050. var dataIndices;
  1051. if (series.getAxisTooltipData) {
  1052. var result = series.getAxisTooltipData(dataDim, value, axis);
  1053. dataIndices = result.dataIndices;
  1054. seriesNestestValue = result.nestestValue;
  1055. } else {
  1056. dataIndices = series.getData().indicesOfNearest(
  1057. dataDim[0],
  1058. value,
  1059. axis.type === "category" ? 0.5 : null
  1060. );
  1061. if (!dataIndices.length) {
  1062. return;
  1063. }
  1064. seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);
  1065. }
  1066. if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {
  1067. return;
  1068. }
  1069. var diff = value - seriesNestestValue;
  1070. var dist = Math.abs(diff);
  1071. if (dist <= minDist) {
  1072. if (dist < minDist || diff >= 0 && minDiff < 0) {
  1073. minDist = dist;
  1074. minDiff = diff;
  1075. snapToValue = seriesNestestValue;
  1076. payloadBatch.length = 0;
  1077. }
  1078. each(dataIndices, function(dataIndex) {
  1079. payloadBatch.push({
  1080. seriesIndex: series.seriesIndex,
  1081. dataIndexInside: dataIndex,
  1082. dataIndex: series.getData().getRawIndex(dataIndex)
  1083. });
  1084. });
  1085. }
  1086. });
  1087. return {
  1088. payloadBatch,
  1089. snapToValue
  1090. };
  1091. }
  1092. function showPointer(showValueMap, axisInfo, value, payloadBatch) {
  1093. showValueMap[axisInfo.key] = {
  1094. value,
  1095. payloadBatch
  1096. };
  1097. }
  1098. function showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {
  1099. var payloadBatch = payloadInfo.payloadBatch;
  1100. var axis = axisInfo.axis;
  1101. var axisModel = axis.model;
  1102. var axisPointerModel = axisInfo.axisPointerModel;
  1103. if (!axisInfo.triggerTooltip || !payloadBatch.length) {
  1104. return;
  1105. }
  1106. var coordSysModel = axisInfo.coordSys.model;
  1107. var coordSysKey = makeKey(coordSysModel);
  1108. var coordSysItem = dataByCoordSys.map[coordSysKey];
  1109. if (!coordSysItem) {
  1110. coordSysItem = dataByCoordSys.map[coordSysKey] = {
  1111. coordSysId: coordSysModel.id,
  1112. coordSysIndex: coordSysModel.componentIndex,
  1113. coordSysType: coordSysModel.type,
  1114. coordSysMainType: coordSysModel.mainType,
  1115. dataByAxis: []
  1116. };
  1117. dataByCoordSys.list.push(coordSysItem);
  1118. }
  1119. coordSysItem.dataByAxis.push({
  1120. axisDim: axis.dim,
  1121. axisIndex: axisModel.componentIndex,
  1122. axisType: axisModel.type,
  1123. axisId: axisModel.id,
  1124. value,
  1125. valueLabelOpt: {
  1126. precision: axisPointerModel.get(["label", "precision"]),
  1127. formatter: axisPointerModel.get(["label", "formatter"])
  1128. },
  1129. seriesDataIndices: payloadBatch.slice()
  1130. });
  1131. }
  1132. function updateModelActually(showValueMap, axesInfo, outputPayload) {
  1133. var outputAxesInfo = outputPayload.axesInfo = [];
  1134. each(axesInfo, function(axisInfo, key) {
  1135. var option = axisInfo.axisPointerModel.option;
  1136. var valItem = showValueMap[key];
  1137. if (valItem) {
  1138. !axisInfo.useHandle && (option.status = "show");
  1139. option.value = valItem.value;
  1140. option.seriesDataIndices = (valItem.payloadBatch || []).slice();
  1141. } else {
  1142. !axisInfo.useHandle && (option.status = "hide");
  1143. }
  1144. option.status === "show" && outputAxesInfo.push({
  1145. axisDim: axisInfo.axis.dim,
  1146. axisIndex: axisInfo.axis.model.componentIndex,
  1147. value: option.value
  1148. });
  1149. });
  1150. }
  1151. function dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction3) {
  1152. if (illegalPoint(point) || !dataByCoordSys.list.length) {
  1153. dispatchAction3({
  1154. type: "hideTip"
  1155. });
  1156. return;
  1157. }
  1158. var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};
  1159. dispatchAction3({
  1160. type: "showTip",
  1161. escapeConnect: true,
  1162. x: point[0],
  1163. y: point[1],
  1164. tooltipOption: payload.tooltipOption,
  1165. position: payload.position,
  1166. dataIndexInside: sampleItem.dataIndexInside,
  1167. dataIndex: sampleItem.dataIndex,
  1168. seriesIndex: sampleItem.seriesIndex,
  1169. dataByCoordSys: dataByCoordSys.list
  1170. });
  1171. }
  1172. function dispatchHighDownActually(axesInfo, dispatchAction3, api) {
  1173. var zr = api.getZr();
  1174. var highDownKey = "axisPointerLastHighlights";
  1175. var lastHighlights = inner3(zr)[highDownKey] || {};
  1176. var newHighlights = inner3(zr)[highDownKey] = {};
  1177. each(axesInfo, function(axisInfo, key) {
  1178. var option = axisInfo.axisPointerModel.option;
  1179. option.status === "show" && each(option.seriesDataIndices, function(batchItem) {
  1180. var key2 = batchItem.seriesIndex + " | " + batchItem.dataIndex;
  1181. newHighlights[key2] = batchItem;
  1182. });
  1183. });
  1184. var toHighlight = [];
  1185. var toDownplay = [];
  1186. each(lastHighlights, function(batchItem, key) {
  1187. !newHighlights[key] && toDownplay.push(batchItem);
  1188. });
  1189. each(newHighlights, function(batchItem, key) {
  1190. !lastHighlights[key] && toHighlight.push(batchItem);
  1191. });
  1192. toDownplay.length && api.dispatchAction({
  1193. type: "downplay",
  1194. escapeConnect: true,
  1195. notBlur: true,
  1196. batch: toDownplay
  1197. });
  1198. toHighlight.length && api.dispatchAction({
  1199. type: "highlight",
  1200. escapeConnect: true,
  1201. notBlur: true,
  1202. batch: toHighlight
  1203. });
  1204. }
  1205. function findInputAxisInfo(inputAxesInfo, axisInfo) {
  1206. for (var i = 0; i < (inputAxesInfo || []).length; i++) {
  1207. var inputAxisInfo = inputAxesInfo[i];
  1208. if (axisInfo.axis.dim === inputAxisInfo.axisDim && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {
  1209. return inputAxisInfo;
  1210. }
  1211. }
  1212. }
  1213. function makeMapperParam(axisInfo) {
  1214. var axisModel = axisInfo.axis.model;
  1215. var item = {};
  1216. var dim = item.axisDim = axisInfo.axis.dim;
  1217. item.axisIndex = item[dim + "AxisIndex"] = axisModel.componentIndex;
  1218. item.axisName = item[dim + "AxisName"] = axisModel.name;
  1219. item.axisId = item[dim + "AxisId"] = axisModel.id;
  1220. return item;
  1221. }
  1222. function illegalPoint(point) {
  1223. return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);
  1224. }
  1225. // node_modules/echarts/lib/component/axisPointer/install.js
  1226. function install5(registers) {
  1227. AxisView_default.registerAxisPointerClass("CartesianAxisPointer", CartesianAxisPointer_default);
  1228. registers.registerComponentModel(AxisPointerModel_default);
  1229. registers.registerComponentView(AxisPointerView_default);
  1230. registers.registerPreprocessor(function(option) {
  1231. if (option) {
  1232. (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {});
  1233. var link = option.axisPointer.link;
  1234. if (link && !isArray(link)) {
  1235. option.axisPointer.link = [link];
  1236. }
  1237. }
  1238. });
  1239. registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function(ecModel, api) {
  1240. ecModel.getComponent("axisPointer").coordSysAxesInfo = collect(ecModel, api);
  1241. });
  1242. registers.registerAction({
  1243. type: "updateAxisPointer",
  1244. event: "updateAxisPointer",
  1245. update: ":updateAxisPointer"
  1246. }, axisTrigger);
  1247. }
  1248. // node_modules/echarts/lib/component/grid/install.js
  1249. function install6(registers) {
  1250. use(install);
  1251. use(install5);
  1252. }
  1253. // node_modules/echarts/lib/component/polar/install.js
  1254. init_define_APP_INFO();
  1255. // node_modules/echarts/lib/component/axisPointer/PolarAxisPointer.js
  1256. init_define_APP_INFO();
  1257. var PolarAxisPointer = function(_super) {
  1258. __extends(PolarAxisPointer2, _super);
  1259. function PolarAxisPointer2() {
  1260. return _super !== null && _super.apply(this, arguments) || this;
  1261. }
  1262. PolarAxisPointer2.prototype.makeElOption = function(elOption, value, axisModel, axisPointerModel, api) {
  1263. var axis = axisModel.axis;
  1264. if (axis.dim === "angle") {
  1265. this.animationThreshold = Math.PI / 18;
  1266. }
  1267. var polar = axis.polar;
  1268. var otherAxis = polar.getOtherAxis(axis);
  1269. var otherExtent = otherAxis.getExtent();
  1270. var coordValue = axis.dataToCoord(value);
  1271. var axisPointerType = axisPointerModel.get("type");
  1272. if (axisPointerType && axisPointerType !== "none") {
  1273. var elStyle = buildElStyle(axisPointerModel);
  1274. var pointerOption = pointerShapeBuilder2[axisPointerType](axis, polar, coordValue, otherExtent);
  1275. pointerOption.style = elStyle;
  1276. elOption.graphicKey = pointerOption.type;
  1277. elOption.pointer = pointerOption;
  1278. }
  1279. var labelMargin = axisPointerModel.get(["label", "margin"]);
  1280. var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin);
  1281. buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos);
  1282. };
  1283. return PolarAxisPointer2;
  1284. }(BaseAxisPointer_default);
  1285. function getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) {
  1286. var axis = axisModel.axis;
  1287. var coord = axis.dataToCoord(value);
  1288. var axisAngle = polar.getAngleAxis().getExtent()[0];
  1289. axisAngle = axisAngle / 180 * Math.PI;
  1290. var radiusExtent = polar.getRadiusAxis().getExtent();
  1291. var position;
  1292. var align;
  1293. var verticalAlign;
  1294. if (axis.dim === "radius") {
  1295. var transform = create();
  1296. rotate(transform, transform, axisAngle);
  1297. translate(transform, transform, [polar.cx, polar.cy]);
  1298. position = applyTransform([coord, -labelMargin], transform);
  1299. var labelRotation = axisModel.getModel("axisLabel").get("rotate") || 0;
  1300. var labelLayout = AxisBuilder_default.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1);
  1301. align = labelLayout.textAlign;
  1302. verticalAlign = labelLayout.textVerticalAlign;
  1303. } else {
  1304. var r = radiusExtent[1];
  1305. position = polar.coordToPoint([r + labelMargin, coord]);
  1306. var cx = polar.cx;
  1307. var cy = polar.cy;
  1308. align = Math.abs(position[0] - cx) / r < 0.3 ? "center" : position[0] > cx ? "left" : "right";
  1309. verticalAlign = Math.abs(position[1] - cy) / r < 0.3 ? "middle" : position[1] > cy ? "top" : "bottom";
  1310. }
  1311. return {
  1312. position,
  1313. align,
  1314. verticalAlign
  1315. };
  1316. }
  1317. var pointerShapeBuilder2 = {
  1318. line: function(axis, polar, coordValue, otherExtent) {
  1319. return axis.dim === "angle" ? {
  1320. type: "Line",
  1321. shape: makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue]))
  1322. } : {
  1323. type: "Circle",
  1324. shape: {
  1325. cx: polar.cx,
  1326. cy: polar.cy,
  1327. r: coordValue
  1328. }
  1329. };
  1330. },
  1331. shadow: function(axis, polar, coordValue, otherExtent) {
  1332. var bandWidth = Math.max(1, axis.getBandWidth());
  1333. var radian = Math.PI / 180;
  1334. return axis.dim === "angle" ? {
  1335. type: "Sector",
  1336. shape: makeSectorShape(
  1337. polar.cx,
  1338. polar.cy,
  1339. otherExtent[0],
  1340. otherExtent[1],
  1341. (-coordValue - bandWidth / 2) * radian,
  1342. (-coordValue + bandWidth / 2) * radian
  1343. )
  1344. } : {
  1345. type: "Sector",
  1346. shape: makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2)
  1347. };
  1348. }
  1349. };
  1350. var PolarAxisPointer_default = PolarAxisPointer;
  1351. // node_modules/echarts/lib/coord/polar/PolarModel.js
  1352. init_define_APP_INFO();
  1353. var PolarModel = function(_super) {
  1354. __extends(PolarModel2, _super);
  1355. function PolarModel2() {
  1356. var _this = _super !== null && _super.apply(this, arguments) || this;
  1357. _this.type = PolarModel2.type;
  1358. return _this;
  1359. }
  1360. PolarModel2.prototype.findAxisModel = function(axisType) {
  1361. var foundAxisModel;
  1362. var ecModel = this.ecModel;
  1363. ecModel.eachComponent(axisType, function(axisModel) {
  1364. if (axisModel.getCoordSysModel() === this) {
  1365. foundAxisModel = axisModel;
  1366. }
  1367. }, this);
  1368. return foundAxisModel;
  1369. };
  1370. PolarModel2.type = "polar";
  1371. PolarModel2.dependencies = ["radiusAxis", "angleAxis"];
  1372. PolarModel2.defaultOption = {
  1373. z: 0,
  1374. center: ["50%", "50%"],
  1375. radius: "80%"
  1376. };
  1377. return PolarModel2;
  1378. }(Component_default);
  1379. var PolarModel_default = PolarModel;
  1380. // node_modules/echarts/lib/coord/polar/AxisModel.js
  1381. init_define_APP_INFO();
  1382. var PolarAxisModel = function(_super) {
  1383. __extends(PolarAxisModel2, _super);
  1384. function PolarAxisModel2() {
  1385. return _super !== null && _super.apply(this, arguments) || this;
  1386. }
  1387. PolarAxisModel2.prototype.getCoordSysModel = function() {
  1388. return this.getReferringComponents("polar", SINGLE_REFERRING).models[0];
  1389. };
  1390. PolarAxisModel2.type = "polarAxis";
  1391. return PolarAxisModel2;
  1392. }(Component_default);
  1393. mixin(PolarAxisModel, AxisModelCommonMixin);
  1394. var AngleAxisModel = function(_super) {
  1395. __extends(AngleAxisModel2, _super);
  1396. function AngleAxisModel2() {
  1397. var _this = _super !== null && _super.apply(this, arguments) || this;
  1398. _this.type = AngleAxisModel2.type;
  1399. return _this;
  1400. }
  1401. AngleAxisModel2.type = "angleAxis";
  1402. return AngleAxisModel2;
  1403. }(PolarAxisModel);
  1404. var RadiusAxisModel = function(_super) {
  1405. __extends(RadiusAxisModel2, _super);
  1406. function RadiusAxisModel2() {
  1407. var _this = _super !== null && _super.apply(this, arguments) || this;
  1408. _this.type = RadiusAxisModel2.type;
  1409. return _this;
  1410. }
  1411. RadiusAxisModel2.type = "radiusAxis";
  1412. return RadiusAxisModel2;
  1413. }(PolarAxisModel);
  1414. // node_modules/echarts/lib/coord/polar/polarCreator.js
  1415. init_define_APP_INFO();
  1416. // node_modules/echarts/lib/coord/polar/Polar.js
  1417. init_define_APP_INFO();
  1418. // node_modules/echarts/lib/coord/polar/RadiusAxis.js
  1419. init_define_APP_INFO();
  1420. var RadiusAxis = function(_super) {
  1421. __extends(RadiusAxis2, _super);
  1422. function RadiusAxis2(scale, radiusExtent) {
  1423. return _super.call(this, "radius", scale, radiusExtent) || this;
  1424. }
  1425. RadiusAxis2.prototype.pointToData = function(point, clamp) {
  1426. return this.polar.pointToData(point, clamp)[this.dim === "radius" ? 0 : 1];
  1427. };
  1428. return RadiusAxis2;
  1429. }(Axis_default);
  1430. RadiusAxis.prototype.dataToRadius = Axis_default.prototype.dataToCoord;
  1431. RadiusAxis.prototype.radiusToData = Axis_default.prototype.coordToData;
  1432. var RadiusAxis_default = RadiusAxis;
  1433. // node_modules/echarts/lib/coord/polar/AngleAxis.js
  1434. init_define_APP_INFO();
  1435. var inner4 = makeInner();
  1436. var AngleAxis = function(_super) {
  1437. __extends(AngleAxis2, _super);
  1438. function AngleAxis2(scale, angleExtent) {
  1439. return _super.call(this, "angle", scale, angleExtent || [0, 360]) || this;
  1440. }
  1441. AngleAxis2.prototype.pointToData = function(point, clamp) {
  1442. return this.polar.pointToData(point, clamp)[this.dim === "radius" ? 0 : 1];
  1443. };
  1444. AngleAxis2.prototype.calculateCategoryInterval = function() {
  1445. var axis = this;
  1446. var labelModel = axis.getLabelModel();
  1447. var ordinalScale = axis.scale;
  1448. var ordinalExtent = ordinalScale.getExtent();
  1449. var tickCount = ordinalScale.count();
  1450. if (ordinalExtent[1] - ordinalExtent[0] < 1) {
  1451. return 0;
  1452. }
  1453. var tickValue = ordinalExtent[0];
  1454. var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);
  1455. var unitH = Math.abs(unitSpan);
  1456. var rect = getBoundingRect(tickValue == null ? "" : tickValue + "", labelModel.getFont(), "center", "top");
  1457. var maxH = Math.max(rect.height, 7);
  1458. var dh = maxH / unitH;
  1459. isNaN(dh) && (dh = Infinity);
  1460. var interval = Math.max(0, Math.floor(dh));
  1461. var cache = inner4(axis.model);
  1462. var lastAutoInterval = cache.lastAutoInterval;
  1463. var lastTickCount = cache.lastTickCount;
  1464. if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 && lastAutoInterval > interval) {
  1465. interval = lastAutoInterval;
  1466. } else {
  1467. cache.lastTickCount = tickCount;
  1468. cache.lastAutoInterval = interval;
  1469. }
  1470. return interval;
  1471. };
  1472. return AngleAxis2;
  1473. }(Axis_default);
  1474. AngleAxis.prototype.dataToAngle = Axis_default.prototype.dataToCoord;
  1475. AngleAxis.prototype.angleToData = Axis_default.prototype.coordToData;
  1476. var AngleAxis_default = AngleAxis;
  1477. // node_modules/echarts/lib/coord/polar/Polar.js
  1478. var polarDimensions = ["radius", "angle"];
  1479. var Polar = function() {
  1480. function Polar2(name) {
  1481. this.dimensions = polarDimensions;
  1482. this.type = "polar";
  1483. this.cx = 0;
  1484. this.cy = 0;
  1485. this._radiusAxis = new RadiusAxis_default();
  1486. this._angleAxis = new AngleAxis_default();
  1487. this.axisPointerEnabled = true;
  1488. this.name = name || "";
  1489. this._radiusAxis.polar = this._angleAxis.polar = this;
  1490. }
  1491. Polar2.prototype.containPoint = function(point) {
  1492. var coord = this.pointToCoord(point);
  1493. return this._radiusAxis.contain(coord[0]) && this._angleAxis.contain(coord[1]);
  1494. };
  1495. Polar2.prototype.containData = function(data) {
  1496. return this._radiusAxis.containData(data[0]) && this._angleAxis.containData(data[1]);
  1497. };
  1498. Polar2.prototype.getAxis = function(dim) {
  1499. var key = "_" + dim + "Axis";
  1500. return this[key];
  1501. };
  1502. Polar2.prototype.getAxes = function() {
  1503. return [this._radiusAxis, this._angleAxis];
  1504. };
  1505. Polar2.prototype.getAxesByScale = function(scaleType) {
  1506. var axes = [];
  1507. var angleAxis = this._angleAxis;
  1508. var radiusAxis = this._radiusAxis;
  1509. angleAxis.scale.type === scaleType && axes.push(angleAxis);
  1510. radiusAxis.scale.type === scaleType && axes.push(radiusAxis);
  1511. return axes;
  1512. };
  1513. Polar2.prototype.getAngleAxis = function() {
  1514. return this._angleAxis;
  1515. };
  1516. Polar2.prototype.getRadiusAxis = function() {
  1517. return this._radiusAxis;
  1518. };
  1519. Polar2.prototype.getOtherAxis = function(axis) {
  1520. var angleAxis = this._angleAxis;
  1521. return axis === angleAxis ? this._radiusAxis : angleAxis;
  1522. };
  1523. Polar2.prototype.getBaseAxis = function() {
  1524. return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAngleAxis();
  1525. };
  1526. Polar2.prototype.getTooltipAxes = function(dim) {
  1527. var baseAxis = dim != null && dim !== "auto" ? this.getAxis(dim) : this.getBaseAxis();
  1528. return {
  1529. baseAxes: [baseAxis],
  1530. otherAxes: [this.getOtherAxis(baseAxis)]
  1531. };
  1532. };
  1533. Polar2.prototype.dataToPoint = function(data, clamp) {
  1534. return this.coordToPoint([this._radiusAxis.dataToRadius(data[0], clamp), this._angleAxis.dataToAngle(data[1], clamp)]);
  1535. };
  1536. Polar2.prototype.pointToData = function(point, clamp) {
  1537. var coord = this.pointToCoord(point);
  1538. return [this._radiusAxis.radiusToData(coord[0], clamp), this._angleAxis.angleToData(coord[1], clamp)];
  1539. };
  1540. Polar2.prototype.pointToCoord = function(point) {
  1541. var dx = point[0] - this.cx;
  1542. var dy = point[1] - this.cy;
  1543. var angleAxis = this.getAngleAxis();
  1544. var extent = angleAxis.getExtent();
  1545. var minAngle = Math.min(extent[0], extent[1]);
  1546. var maxAngle = Math.max(extent[0], extent[1]);
  1547. angleAxis.inverse ? minAngle = maxAngle - 360 : maxAngle = minAngle + 360;
  1548. var radius = Math.sqrt(dx * dx + dy * dy);
  1549. dx /= radius;
  1550. dy /= radius;
  1551. var radian = Math.atan2(-dy, dx) / Math.PI * 180;
  1552. var dir = radian < minAngle ? 1 : -1;
  1553. while (radian < minAngle || radian > maxAngle) {
  1554. radian += dir * 360;
  1555. }
  1556. return [radius, radian];
  1557. };
  1558. Polar2.prototype.coordToPoint = function(coord) {
  1559. var radius = coord[0];
  1560. var radian = coord[1] / 180 * Math.PI;
  1561. var x = Math.cos(radian) * radius + this.cx;
  1562. var y = -Math.sin(radian) * radius + this.cy;
  1563. return [x, y];
  1564. };
  1565. Polar2.prototype.getArea = function() {
  1566. var angleAxis = this.getAngleAxis();
  1567. var radiusAxis = this.getRadiusAxis();
  1568. var radiusExtent = radiusAxis.getExtent().slice();
  1569. radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();
  1570. var angleExtent = angleAxis.getExtent();
  1571. var RADIAN = Math.PI / 180;
  1572. return {
  1573. cx: this.cx,
  1574. cy: this.cy,
  1575. r0: radiusExtent[0],
  1576. r: radiusExtent[1],
  1577. startAngle: -angleExtent[0] * RADIAN,
  1578. endAngle: -angleExtent[1] * RADIAN,
  1579. clockwise: angleAxis.inverse,
  1580. contain: function(x, y) {
  1581. var dx = x - this.cx;
  1582. var dy = y - this.cy;
  1583. var d2 = dx * dx + dy * dy - 1e-4;
  1584. var r = this.r;
  1585. var r0 = this.r0;
  1586. return d2 <= r * r && d2 >= r0 * r0;
  1587. }
  1588. };
  1589. };
  1590. Polar2.prototype.convertToPixel = function(ecModel, finder, value) {
  1591. var coordSys = getCoordSys(finder);
  1592. return coordSys === this ? this.dataToPoint(value) : null;
  1593. };
  1594. Polar2.prototype.convertFromPixel = function(ecModel, finder, pixel) {
  1595. var coordSys = getCoordSys(finder);
  1596. return coordSys === this ? this.pointToData(pixel) : null;
  1597. };
  1598. return Polar2;
  1599. }();
  1600. function getCoordSys(finder) {
  1601. var seriesModel = finder.seriesModel;
  1602. var polarModel = finder.polarModel;
  1603. return polarModel && polarModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;
  1604. }
  1605. var Polar_default = Polar;
  1606. // node_modules/echarts/lib/coord/polar/polarCreator.js
  1607. function resizePolar(polar, polarModel, api) {
  1608. var center = polarModel.get("center");
  1609. var width = api.getWidth();
  1610. var height = api.getHeight();
  1611. polar.cx = parsePercent2(center[0], width);
  1612. polar.cy = parsePercent2(center[1], height);
  1613. var radiusAxis = polar.getRadiusAxis();
  1614. var size = Math.min(width, height) / 2;
  1615. var radius = polarModel.get("radius");
  1616. if (radius == null) {
  1617. radius = [0, "100%"];
  1618. } else if (!isArray(radius)) {
  1619. radius = [0, radius];
  1620. }
  1621. var parsedRadius = [parsePercent2(radius[0], size), parsePercent2(radius[1], size)];
  1622. radiusAxis.inverse ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0]) : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]);
  1623. }
  1624. function updatePolarScale(ecModel, api) {
  1625. var polar = this;
  1626. var angleAxis = polar.getAngleAxis();
  1627. var radiusAxis = polar.getRadiusAxis();
  1628. angleAxis.scale.setExtent(Infinity, -Infinity);
  1629. radiusAxis.scale.setExtent(Infinity, -Infinity);
  1630. ecModel.eachSeries(function(seriesModel) {
  1631. if (seriesModel.coordinateSystem === polar) {
  1632. var data_1 = seriesModel.getData();
  1633. each(getDataDimensionsOnAxis(data_1, "radius"), function(dim) {
  1634. radiusAxis.scale.unionExtentFromData(data_1, dim);
  1635. });
  1636. each(getDataDimensionsOnAxis(data_1, "angle"), function(dim) {
  1637. angleAxis.scale.unionExtentFromData(data_1, dim);
  1638. });
  1639. }
  1640. });
  1641. niceScaleExtent(angleAxis.scale, angleAxis.model);
  1642. niceScaleExtent(radiusAxis.scale, radiusAxis.model);
  1643. if (angleAxis.type === "category" && !angleAxis.onBand) {
  1644. var extent = angleAxis.getExtent();
  1645. var diff = 360 / angleAxis.scale.count();
  1646. angleAxis.inverse ? extent[1] += diff : extent[1] -= diff;
  1647. angleAxis.setExtent(extent[0], extent[1]);
  1648. }
  1649. }
  1650. function isAngleAxisModel(axisModel) {
  1651. return axisModel.mainType === "angleAxis";
  1652. }
  1653. function setAxis(axis, axisModel) {
  1654. axis.type = axisModel.get("type");
  1655. axis.scale = createScaleByModel(axisModel);
  1656. axis.onBand = axisModel.get("boundaryGap") && axis.type === "category";
  1657. axis.inverse = axisModel.get("inverse");
  1658. if (isAngleAxisModel(axisModel)) {
  1659. axis.inverse = axis.inverse !== axisModel.get("clockwise");
  1660. var startAngle = axisModel.get("startAngle");
  1661. axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));
  1662. }
  1663. axisModel.axis = axis;
  1664. axis.model = axisModel;
  1665. }
  1666. var polarCreator = {
  1667. dimensions: polarDimensions,
  1668. create: function(ecModel, api) {
  1669. var polarList = [];
  1670. ecModel.eachComponent("polar", function(polarModel, idx) {
  1671. var polar = new Polar_default(idx + "");
  1672. polar.update = updatePolarScale;
  1673. var radiusAxis = polar.getRadiusAxis();
  1674. var angleAxis = polar.getAngleAxis();
  1675. var radiusAxisModel = polarModel.findAxisModel("radiusAxis");
  1676. var angleAxisModel = polarModel.findAxisModel("angleAxis");
  1677. setAxis(radiusAxis, radiusAxisModel);
  1678. setAxis(angleAxis, angleAxisModel);
  1679. resizePolar(polar, polarModel, api);
  1680. polarList.push(polar);
  1681. polarModel.coordinateSystem = polar;
  1682. polar.model = polarModel;
  1683. });
  1684. ecModel.eachSeries(function(seriesModel) {
  1685. if (seriesModel.get("coordinateSystem") === "polar") {
  1686. var polarModel = seriesModel.getReferringComponents("polar", SINGLE_REFERRING).models[0];
  1687. if (true) {
  1688. if (!polarModel) {
  1689. throw new Error('Polar "' + retrieve(seriesModel.get("polarIndex"), seriesModel.get("polarId"), 0) + '" not found');
  1690. }
  1691. }
  1692. seriesModel.coordinateSystem = polarModel.coordinateSystem;
  1693. }
  1694. });
  1695. return polarList;
  1696. }
  1697. };
  1698. var polarCreator_default = polarCreator;
  1699. // node_modules/echarts/lib/component/axis/AngleAxisView.js
  1700. init_define_APP_INFO();
  1701. var elementList = ["axisLine", "axisLabel", "axisTick", "minorTick", "splitLine", "minorSplitLine", "splitArea"];
  1702. function getAxisLineShape(polar, rExtent, angle) {
  1703. rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());
  1704. var start = polar.coordToPoint([rExtent[0], angle]);
  1705. var end = polar.coordToPoint([rExtent[1], angle]);
  1706. return {
  1707. x1: start[0],
  1708. y1: start[1],
  1709. x2: end[0],
  1710. y2: end[1]
  1711. };
  1712. }
  1713. function getRadiusIdx(polar) {
  1714. var radiusAxis = polar.getRadiusAxis();
  1715. return radiusAxis.inverse ? 0 : 1;
  1716. }
  1717. function fixAngleOverlap(list) {
  1718. var firstItem = list[0];
  1719. var lastItem = list[list.length - 1];
  1720. if (firstItem && lastItem && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) {
  1721. list.pop();
  1722. }
  1723. }
  1724. var AngleAxisView = function(_super) {
  1725. __extends(AngleAxisView2, _super);
  1726. function AngleAxisView2() {
  1727. var _this = _super !== null && _super.apply(this, arguments) || this;
  1728. _this.type = AngleAxisView2.type;
  1729. _this.axisPointerClass = "PolarAxisPointer";
  1730. return _this;
  1731. }
  1732. AngleAxisView2.prototype.render = function(angleAxisModel, ecModel) {
  1733. this.group.removeAll();
  1734. if (!angleAxisModel.get("show")) {
  1735. return;
  1736. }
  1737. var angleAxis = angleAxisModel.axis;
  1738. var polar = angleAxis.polar;
  1739. var radiusExtent = polar.getRadiusAxis().getExtent();
  1740. var ticksAngles = angleAxis.getTicksCoords();
  1741. var minorTickAngles = angleAxis.getMinorTicksCoords();
  1742. var labels = map(angleAxis.getViewLabels(), function(labelItem) {
  1743. labelItem = clone(labelItem);
  1744. var scale = angleAxis.scale;
  1745. var tickValue = scale.type === "ordinal" ? scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;
  1746. labelItem.coord = angleAxis.dataToCoord(tickValue);
  1747. return labelItem;
  1748. });
  1749. fixAngleOverlap(labels);
  1750. fixAngleOverlap(ticksAngles);
  1751. each(elementList, function(name) {
  1752. if (angleAxisModel.get([name, "show"]) && (!angleAxis.scale.isBlank() || name === "axisLine")) {
  1753. angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels);
  1754. }
  1755. }, this);
  1756. };
  1757. AngleAxisView2.type = "angleAxis";
  1758. return AngleAxisView2;
  1759. }(AxisView_default);
  1760. var angelAxisElementsBuilders = {
  1761. axisLine: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
  1762. var lineStyleModel = angleAxisModel.getModel(["axisLine", "lineStyle"]);
  1763. var rId = getRadiusIdx(polar);
  1764. var r0Id = rId ? 0 : 1;
  1765. var shape;
  1766. if (radiusExtent[r0Id] === 0) {
  1767. shape = new Circle_default({
  1768. shape: {
  1769. cx: polar.cx,
  1770. cy: polar.cy,
  1771. r: radiusExtent[rId]
  1772. },
  1773. style: lineStyleModel.getLineStyle(),
  1774. z2: 1,
  1775. silent: true
  1776. });
  1777. } else {
  1778. shape = new Ring_default({
  1779. shape: {
  1780. cx: polar.cx,
  1781. cy: polar.cy,
  1782. r: radiusExtent[rId],
  1783. r0: radiusExtent[r0Id]
  1784. },
  1785. style: lineStyleModel.getLineStyle(),
  1786. z2: 1,
  1787. silent: true
  1788. });
  1789. }
  1790. shape.style.fill = null;
  1791. group.add(shape);
  1792. },
  1793. axisTick: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
  1794. var tickModel = angleAxisModel.getModel("axisTick");
  1795. var tickLen = (tickModel.get("inside") ? -1 : 1) * tickModel.get("length");
  1796. var radius = radiusExtent[getRadiusIdx(polar)];
  1797. var lines = map(ticksAngles, function(tickAngleItem) {
  1798. return new Line_default({
  1799. shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord)
  1800. });
  1801. });
  1802. group.add(mergePath(lines, {
  1803. style: defaults(tickModel.getModel("lineStyle").getLineStyle(), {
  1804. stroke: angleAxisModel.get(["axisLine", "lineStyle", "color"])
  1805. })
  1806. }));
  1807. },
  1808. minorTick: function(group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) {
  1809. if (!minorTickAngles.length) {
  1810. return;
  1811. }
  1812. var tickModel = angleAxisModel.getModel("axisTick");
  1813. var minorTickModel = angleAxisModel.getModel("minorTick");
  1814. var tickLen = (tickModel.get("inside") ? -1 : 1) * minorTickModel.get("length");
  1815. var radius = radiusExtent[getRadiusIdx(polar)];
  1816. var lines = [];
  1817. for (var i = 0; i < minorTickAngles.length; i++) {
  1818. for (var k = 0; k < minorTickAngles[i].length; k++) {
  1819. lines.push(new Line_default({
  1820. shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord)
  1821. }));
  1822. }
  1823. }
  1824. group.add(mergePath(lines, {
  1825. style: defaults(minorTickModel.getModel("lineStyle").getLineStyle(), defaults(tickModel.getLineStyle(), {
  1826. stroke: angleAxisModel.get(["axisLine", "lineStyle", "color"])
  1827. }))
  1828. }));
  1829. },
  1830. axisLabel: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) {
  1831. var rawCategoryData = angleAxisModel.getCategories(true);
  1832. var commonLabelModel = angleAxisModel.getModel("axisLabel");
  1833. var labelMargin = commonLabelModel.get("margin");
  1834. var triggerEvent = angleAxisModel.get("triggerEvent");
  1835. each(labels, function(labelItem, idx) {
  1836. var labelModel = commonLabelModel;
  1837. var tickValue = labelItem.tickValue;
  1838. var r = radiusExtent[getRadiusIdx(polar)];
  1839. var p = polar.coordToPoint([r + labelMargin, labelItem.coord]);
  1840. var cx = polar.cx;
  1841. var cy = polar.cy;
  1842. var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3 ? "center" : p[0] > cx ? "left" : "right";
  1843. var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3 ? "middle" : p[1] > cy ? "top" : "bottom";
  1844. if (rawCategoryData && rawCategoryData[tickValue]) {
  1845. var rawCategoryItem = rawCategoryData[tickValue];
  1846. if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {
  1847. labelModel = new Model_default(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel);
  1848. }
  1849. }
  1850. var textEl = new Text_default({
  1851. silent: AxisBuilder_default.isLabelSilent(angleAxisModel),
  1852. style: createTextStyle(labelModel, {
  1853. x: p[0],
  1854. y: p[1],
  1855. fill: labelModel.getTextColor() || angleAxisModel.get(["axisLine", "lineStyle", "color"]),
  1856. text: labelItem.formattedLabel,
  1857. align: labelTextAlign,
  1858. verticalAlign: labelTextVerticalAlign
  1859. })
  1860. });
  1861. group.add(textEl);
  1862. if (triggerEvent) {
  1863. var eventData = AxisBuilder_default.makeAxisEventDataBase(angleAxisModel);
  1864. eventData.targetType = "axisLabel";
  1865. eventData.value = labelItem.rawLabel;
  1866. getECData(textEl).eventData = eventData;
  1867. }
  1868. }, this);
  1869. },
  1870. splitLine: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
  1871. var splitLineModel = angleAxisModel.getModel("splitLine");
  1872. var lineStyleModel = splitLineModel.getModel("lineStyle");
  1873. var lineColors = lineStyleModel.get("color");
  1874. var lineCount = 0;
  1875. lineColors = lineColors instanceof Array ? lineColors : [lineColors];
  1876. var splitLines = [];
  1877. for (var i = 0; i < ticksAngles.length; i++) {
  1878. var colorIndex = lineCount++ % lineColors.length;
  1879. splitLines[colorIndex] = splitLines[colorIndex] || [];
  1880. splitLines[colorIndex].push(new Line_default({
  1881. shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord)
  1882. }));
  1883. }
  1884. for (var i = 0; i < splitLines.length; i++) {
  1885. group.add(mergePath(splitLines[i], {
  1886. style: defaults({
  1887. stroke: lineColors[i % lineColors.length]
  1888. }, lineStyleModel.getLineStyle()),
  1889. silent: true,
  1890. z: angleAxisModel.get("z")
  1891. }));
  1892. }
  1893. },
  1894. minorSplitLine: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
  1895. if (!minorTickAngles.length) {
  1896. return;
  1897. }
  1898. var minorSplitLineModel = angleAxisModel.getModel("minorSplitLine");
  1899. var lineStyleModel = minorSplitLineModel.getModel("lineStyle");
  1900. var lines = [];
  1901. for (var i = 0; i < minorTickAngles.length; i++) {
  1902. for (var k = 0; k < minorTickAngles[i].length; k++) {
  1903. lines.push(new Line_default({
  1904. shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord)
  1905. }));
  1906. }
  1907. }
  1908. group.add(mergePath(lines, {
  1909. style: lineStyleModel.getLineStyle(),
  1910. silent: true,
  1911. z: angleAxisModel.get("z")
  1912. }));
  1913. },
  1914. splitArea: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
  1915. if (!ticksAngles.length) {
  1916. return;
  1917. }
  1918. var splitAreaModel = angleAxisModel.getModel("splitArea");
  1919. var areaStyleModel = splitAreaModel.getModel("areaStyle");
  1920. var areaColors = areaStyleModel.get("color");
  1921. var lineCount = 0;
  1922. areaColors = areaColors instanceof Array ? areaColors : [areaColors];
  1923. var splitAreas = [];
  1924. var RADIAN = Math.PI / 180;
  1925. var prevAngle = -ticksAngles[0].coord * RADIAN;
  1926. var r0 = Math.min(radiusExtent[0], radiusExtent[1]);
  1927. var r1 = Math.max(radiusExtent[0], radiusExtent[1]);
  1928. var clockwise = angleAxisModel.get("clockwise");
  1929. for (var i = 1, len = ticksAngles.length; i <= len; i++) {
  1930. var coord = i === len ? ticksAngles[0].coord : ticksAngles[i].coord;
  1931. var colorIndex = lineCount++ % areaColors.length;
  1932. splitAreas[colorIndex] = splitAreas[colorIndex] || [];
  1933. splitAreas[colorIndex].push(new Sector_default({
  1934. shape: {
  1935. cx: polar.cx,
  1936. cy: polar.cy,
  1937. r0,
  1938. r: r1,
  1939. startAngle: prevAngle,
  1940. endAngle: -coord * RADIAN,
  1941. clockwise
  1942. },
  1943. silent: true
  1944. }));
  1945. prevAngle = -coord * RADIAN;
  1946. }
  1947. for (var i = 0; i < splitAreas.length; i++) {
  1948. group.add(mergePath(splitAreas[i], {
  1949. style: defaults({
  1950. fill: areaColors[i % areaColors.length]
  1951. }, areaStyleModel.getAreaStyle()),
  1952. silent: true
  1953. }));
  1954. }
  1955. }
  1956. };
  1957. var AngleAxisView_default = AngleAxisView;
  1958. // node_modules/echarts/lib/component/axis/RadiusAxisView.js
  1959. init_define_APP_INFO();
  1960. var axisBuilderAttrs = ["axisLine", "axisTickLabel", "axisName"];
  1961. var selfBuilderAttrs = ["splitLine", "splitArea", "minorSplitLine"];
  1962. var RadiusAxisView = function(_super) {
  1963. __extends(RadiusAxisView2, _super);
  1964. function RadiusAxisView2() {
  1965. var _this = _super !== null && _super.apply(this, arguments) || this;
  1966. _this.type = RadiusAxisView2.type;
  1967. _this.axisPointerClass = "PolarAxisPointer";
  1968. return _this;
  1969. }
  1970. RadiusAxisView2.prototype.render = function(radiusAxisModel, ecModel) {
  1971. this.group.removeAll();
  1972. if (!radiusAxisModel.get("show")) {
  1973. return;
  1974. }
  1975. var oldAxisGroup = this._axisGroup;
  1976. var newAxisGroup = this._axisGroup = new Group_default();
  1977. this.group.add(newAxisGroup);
  1978. var radiusAxis = radiusAxisModel.axis;
  1979. var polar = radiusAxis.polar;
  1980. var angleAxis = polar.getAngleAxis();
  1981. var ticksCoords = radiusAxis.getTicksCoords();
  1982. var minorTicksCoords = radiusAxis.getMinorTicksCoords();
  1983. var axisAngle = angleAxis.getExtent()[0];
  1984. var radiusExtent = radiusAxis.getExtent();
  1985. var layout4 = layoutAxis(polar, radiusAxisModel, axisAngle);
  1986. var axisBuilder = new AxisBuilder_default(radiusAxisModel, layout4);
  1987. each(axisBuilderAttrs, axisBuilder.add, axisBuilder);
  1988. newAxisGroup.add(axisBuilder.getGroup());
  1989. groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel);
  1990. each(selfBuilderAttrs, function(name) {
  1991. if (radiusAxisModel.get([name, "show"]) && !radiusAxis.scale.isBlank()) {
  1992. axisElementBuilders[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);
  1993. }
  1994. }, this);
  1995. };
  1996. RadiusAxisView2.type = "radiusAxis";
  1997. return RadiusAxisView2;
  1998. }(AxisView_default);
  1999. var axisElementBuilders = {
  2000. splitLine: function(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {
  2001. var splitLineModel = radiusAxisModel.getModel("splitLine");
  2002. var lineStyleModel = splitLineModel.getModel("lineStyle");
  2003. var lineColors = lineStyleModel.get("color");
  2004. var lineCount = 0;
  2005. lineColors = lineColors instanceof Array ? lineColors : [lineColors];
  2006. var splitLines = [];
  2007. for (var i = 0; i < ticksCoords.length; i++) {
  2008. var colorIndex = lineCount++ % lineColors.length;
  2009. splitLines[colorIndex] = splitLines[colorIndex] || [];
  2010. splitLines[colorIndex].push(new Circle_default({
  2011. shape: {
  2012. cx: polar.cx,
  2013. cy: polar.cy,
  2014. r: Math.max(ticksCoords[i].coord, 0)
  2015. }
  2016. }));
  2017. }
  2018. for (var i = 0; i < splitLines.length; i++) {
  2019. group.add(mergePath(splitLines[i], {
  2020. style: defaults({
  2021. stroke: lineColors[i % lineColors.length],
  2022. fill: null
  2023. }, lineStyleModel.getLineStyle()),
  2024. silent: true
  2025. }));
  2026. }
  2027. },
  2028. minorSplitLine: function(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {
  2029. if (!minorTicksCoords.length) {
  2030. return;
  2031. }
  2032. var minorSplitLineModel = radiusAxisModel.getModel("minorSplitLine");
  2033. var lineStyleModel = minorSplitLineModel.getModel("lineStyle");
  2034. var lines = [];
  2035. for (var i = 0; i < minorTicksCoords.length; i++) {
  2036. for (var k = 0; k < minorTicksCoords[i].length; k++) {
  2037. lines.push(new Circle_default({
  2038. shape: {
  2039. cx: polar.cx,
  2040. cy: polar.cy,
  2041. r: minorTicksCoords[i][k].coord
  2042. }
  2043. }));
  2044. }
  2045. }
  2046. group.add(mergePath(lines, {
  2047. style: defaults({
  2048. fill: null
  2049. }, lineStyleModel.getLineStyle()),
  2050. silent: true
  2051. }));
  2052. },
  2053. splitArea: function(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {
  2054. if (!ticksCoords.length) {
  2055. return;
  2056. }
  2057. var splitAreaModel = radiusAxisModel.getModel("splitArea");
  2058. var areaStyleModel = splitAreaModel.getModel("areaStyle");
  2059. var areaColors = areaStyleModel.get("color");
  2060. var lineCount = 0;
  2061. areaColors = areaColors instanceof Array ? areaColors : [areaColors];
  2062. var splitAreas = [];
  2063. var prevRadius = ticksCoords[0].coord;
  2064. for (var i = 1; i < ticksCoords.length; i++) {
  2065. var colorIndex = lineCount++ % areaColors.length;
  2066. splitAreas[colorIndex] = splitAreas[colorIndex] || [];
  2067. splitAreas[colorIndex].push(new Sector_default({
  2068. shape: {
  2069. cx: polar.cx,
  2070. cy: polar.cy,
  2071. r0: prevRadius,
  2072. r: ticksCoords[i].coord,
  2073. startAngle: 0,
  2074. endAngle: Math.PI * 2
  2075. },
  2076. silent: true
  2077. }));
  2078. prevRadius = ticksCoords[i].coord;
  2079. }
  2080. for (var i = 0; i < splitAreas.length; i++) {
  2081. group.add(mergePath(splitAreas[i], {
  2082. style: defaults({
  2083. fill: areaColors[i % areaColors.length]
  2084. }, areaStyleModel.getAreaStyle()),
  2085. silent: true
  2086. }));
  2087. }
  2088. }
  2089. };
  2090. function layoutAxis(polar, radiusAxisModel, axisAngle) {
  2091. return {
  2092. position: [polar.cx, polar.cy],
  2093. rotation: axisAngle / 180 * Math.PI,
  2094. labelDirection: -1,
  2095. tickDirection: -1,
  2096. nameDirection: 1,
  2097. labelRotate: radiusAxisModel.getModel("axisLabel").get("rotate"),
  2098. z2: 1
  2099. };
  2100. }
  2101. var RadiusAxisView_default = RadiusAxisView;
  2102. // node_modules/echarts/lib/layout/barPolar.js
  2103. init_define_APP_INFO();
  2104. function getSeriesStackId(seriesModel) {
  2105. return seriesModel.get("stack") || "__ec_stack_" + seriesModel.seriesIndex;
  2106. }
  2107. function getAxisKey(polar, axis) {
  2108. return axis.dim + polar.model.componentIndex;
  2109. }
  2110. function barLayoutPolar(seriesType, ecModel, api) {
  2111. var lastStackCoords = {};
  2112. var barWidthAndOffset = calRadialBar(filter(ecModel.getSeriesByType(seriesType), function(seriesModel) {
  2113. return !ecModel.isSeriesFiltered(seriesModel) && seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === "polar";
  2114. }));
  2115. ecModel.eachSeriesByType(seriesType, function(seriesModel) {
  2116. if (seriesModel.coordinateSystem.type !== "polar") {
  2117. return;
  2118. }
  2119. var data = seriesModel.getData();
  2120. var polar = seriesModel.coordinateSystem;
  2121. var baseAxis = polar.getBaseAxis();
  2122. var axisKey = getAxisKey(polar, baseAxis);
  2123. var stackId = getSeriesStackId(seriesModel);
  2124. var columnLayoutInfo = barWidthAndOffset[axisKey][stackId];
  2125. var columnOffset = columnLayoutInfo.offset;
  2126. var columnWidth = columnLayoutInfo.width;
  2127. var valueAxis = polar.getOtherAxis(baseAxis);
  2128. var cx = seriesModel.coordinateSystem.cx;
  2129. var cy = seriesModel.coordinateSystem.cy;
  2130. var barMinHeight = seriesModel.get("barMinHeight") || 0;
  2131. var barMinAngle = seriesModel.get("barMinAngle") || 0;
  2132. lastStackCoords[stackId] = lastStackCoords[stackId] || [];
  2133. var valueDim = data.mapDimension(valueAxis.dim);
  2134. var baseDim = data.mapDimension(baseAxis.dim);
  2135. var stacked = isDimensionStacked(
  2136. data,
  2137. valueDim
  2138. );
  2139. var clampLayout = baseAxis.dim !== "radius" || !seriesModel.get("roundCap", true);
  2140. var valueAxisStart = valueAxis.dataToCoord(0);
  2141. for (var idx = 0, len = data.count(); idx < len; idx++) {
  2142. var value = data.get(valueDim, idx);
  2143. var baseValue = data.get(baseDim, idx);
  2144. var sign = value >= 0 ? "p" : "n";
  2145. var baseCoord = valueAxisStart;
  2146. if (stacked) {
  2147. if (!lastStackCoords[stackId][baseValue]) {
  2148. lastStackCoords[stackId][baseValue] = {
  2149. p: valueAxisStart,
  2150. n: valueAxisStart
  2151. };
  2152. }
  2153. baseCoord = lastStackCoords[stackId][baseValue][sign];
  2154. }
  2155. var r0 = void 0;
  2156. var r = void 0;
  2157. var startAngle = void 0;
  2158. var endAngle = void 0;
  2159. if (valueAxis.dim === "radius") {
  2160. var radiusSpan = valueAxis.dataToCoord(value) - valueAxisStart;
  2161. var angle = baseAxis.dataToCoord(baseValue);
  2162. if (Math.abs(radiusSpan) < barMinHeight) {
  2163. radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight;
  2164. }
  2165. r0 = baseCoord;
  2166. r = baseCoord + radiusSpan;
  2167. startAngle = angle - columnOffset;
  2168. endAngle = startAngle - columnWidth;
  2169. stacked && (lastStackCoords[stackId][baseValue][sign] = r);
  2170. } else {
  2171. var angleSpan = valueAxis.dataToCoord(value, clampLayout) - valueAxisStart;
  2172. var radius = baseAxis.dataToCoord(baseValue);
  2173. if (Math.abs(angleSpan) < barMinAngle) {
  2174. angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle;
  2175. }
  2176. r0 = radius + columnOffset;
  2177. r = r0 + columnWidth;
  2178. startAngle = baseCoord;
  2179. endAngle = baseCoord + angleSpan;
  2180. stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle);
  2181. }
  2182. data.setItemLayout(idx, {
  2183. cx,
  2184. cy,
  2185. r0,
  2186. r,
  2187. startAngle: -startAngle * Math.PI / 180,
  2188. endAngle: -endAngle * Math.PI / 180,
  2189. clockwise: startAngle >= endAngle
  2190. });
  2191. }
  2192. });
  2193. }
  2194. function calRadialBar(barSeries) {
  2195. var columnsMap = {};
  2196. each(barSeries, function(seriesModel, idx) {
  2197. var data = seriesModel.getData();
  2198. var polar = seriesModel.coordinateSystem;
  2199. var baseAxis = polar.getBaseAxis();
  2200. var axisKey = getAxisKey(polar, baseAxis);
  2201. var axisExtent = baseAxis.getExtent();
  2202. var bandWidth = baseAxis.type === "category" ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();
  2203. var columnsOnAxis = columnsMap[axisKey] || {
  2204. bandWidth,
  2205. remainedWidth: bandWidth,
  2206. autoWidthCount: 0,
  2207. categoryGap: "20%",
  2208. gap: "30%",
  2209. stacks: {}
  2210. };
  2211. var stacks = columnsOnAxis.stacks;
  2212. columnsMap[axisKey] = columnsOnAxis;
  2213. var stackId = getSeriesStackId(seriesModel);
  2214. if (!stacks[stackId]) {
  2215. columnsOnAxis.autoWidthCount++;
  2216. }
  2217. stacks[stackId] = stacks[stackId] || {
  2218. width: 0,
  2219. maxWidth: 0
  2220. };
  2221. var barWidth = parsePercent2(seriesModel.get("barWidth"), bandWidth);
  2222. var barMaxWidth = parsePercent2(seriesModel.get("barMaxWidth"), bandWidth);
  2223. var barGap = seriesModel.get("barGap");
  2224. var barCategoryGap = seriesModel.get("barCategoryGap");
  2225. if (barWidth && !stacks[stackId].width) {
  2226. barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);
  2227. stacks[stackId].width = barWidth;
  2228. columnsOnAxis.remainedWidth -= barWidth;
  2229. }
  2230. barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);
  2231. barGap != null && (columnsOnAxis.gap = barGap);
  2232. barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);
  2233. });
  2234. var result = {};
  2235. each(columnsMap, function(columnsOnAxis, coordSysName) {
  2236. result[coordSysName] = {};
  2237. var stacks = columnsOnAxis.stacks;
  2238. var bandWidth = columnsOnAxis.bandWidth;
  2239. var categoryGap = parsePercent2(columnsOnAxis.categoryGap, bandWidth);
  2240. var barGapPercent = parsePercent2(columnsOnAxis.gap, 1);
  2241. var remainedWidth = columnsOnAxis.remainedWidth;
  2242. var autoWidthCount = columnsOnAxis.autoWidthCount;
  2243. var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);
  2244. autoWidth = Math.max(autoWidth, 0);
  2245. each(stacks, function(column, stack) {
  2246. var maxWidth = column.maxWidth;
  2247. if (maxWidth && maxWidth < autoWidth) {
  2248. maxWidth = Math.min(maxWidth, remainedWidth);
  2249. if (column.width) {
  2250. maxWidth = Math.min(maxWidth, column.width);
  2251. }
  2252. remainedWidth -= maxWidth;
  2253. column.width = maxWidth;
  2254. autoWidthCount--;
  2255. }
  2256. });
  2257. autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);
  2258. autoWidth = Math.max(autoWidth, 0);
  2259. var widthSum = 0;
  2260. var lastColumn;
  2261. each(stacks, function(column, idx) {
  2262. if (!column.width) {
  2263. column.width = autoWidth;
  2264. }
  2265. lastColumn = column;
  2266. widthSum += column.width * (1 + barGapPercent);
  2267. });
  2268. if (lastColumn) {
  2269. widthSum -= lastColumn.width * barGapPercent;
  2270. }
  2271. var offset = -widthSum / 2;
  2272. each(stacks, function(column, stackId) {
  2273. result[coordSysName][stackId] = result[coordSysName][stackId] || {
  2274. offset,
  2275. width: column.width
  2276. };
  2277. offset += column.width * (1 + barGapPercent);
  2278. });
  2279. });
  2280. return result;
  2281. }
  2282. var barPolar_default = barLayoutPolar;
  2283. // node_modules/echarts/lib/component/polar/install.js
  2284. var angleAxisExtraOption = {
  2285. startAngle: 90,
  2286. clockwise: true,
  2287. splitNumber: 12,
  2288. axisLabel: {
  2289. rotate: 0
  2290. }
  2291. };
  2292. var radiusAxisExtraOption = {
  2293. splitNumber: 5
  2294. };
  2295. var PolarView = function(_super) {
  2296. __extends(PolarView2, _super);
  2297. function PolarView2() {
  2298. var _this = _super !== null && _super.apply(this, arguments) || this;
  2299. _this.type = PolarView2.type;
  2300. return _this;
  2301. }
  2302. PolarView2.type = "polar";
  2303. return PolarView2;
  2304. }(Component_default2);
  2305. function install7(registers) {
  2306. use(install5);
  2307. AxisView_default.registerAxisPointerClass("PolarAxisPointer", PolarAxisPointer_default);
  2308. registers.registerCoordinateSystem("polar", polarCreator_default);
  2309. registers.registerComponentModel(PolarModel_default);
  2310. registers.registerComponentView(PolarView);
  2311. axisModelCreator(registers, "angle", AngleAxisModel, angleAxisExtraOption);
  2312. axisModelCreator(registers, "radius", RadiusAxisModel, radiusAxisExtraOption);
  2313. registers.registerComponentView(AngleAxisView_default);
  2314. registers.registerComponentView(RadiusAxisView_default);
  2315. registers.registerLayout(curry(barPolar_default, "bar"));
  2316. }
  2317. // node_modules/echarts/lib/component/singleAxis/install.js
  2318. init_define_APP_INFO();
  2319. // node_modules/echarts/lib/component/axis/SingleAxisView.js
  2320. init_define_APP_INFO();
  2321. // node_modules/echarts/lib/coord/single/singleAxisHelper.js
  2322. init_define_APP_INFO();
  2323. function layout2(axisModel, opt) {
  2324. opt = opt || {};
  2325. var single = axisModel.coordinateSystem;
  2326. var axis = axisModel.axis;
  2327. var layout4 = {};
  2328. var axisPosition = axis.position;
  2329. var orient = axis.orient;
  2330. var rect = single.getRect();
  2331. var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];
  2332. var positionMap = {
  2333. horizontal: {
  2334. top: rectBound[2],
  2335. bottom: rectBound[3]
  2336. },
  2337. vertical: {
  2338. left: rectBound[0],
  2339. right: rectBound[1]
  2340. }
  2341. };
  2342. layout4.position = [orient === "vertical" ? positionMap.vertical[axisPosition] : rectBound[0], orient === "horizontal" ? positionMap.horizontal[axisPosition] : rectBound[3]];
  2343. var r = {
  2344. horizontal: 0,
  2345. vertical: 1
  2346. };
  2347. layout4.rotation = Math.PI / 2 * r[orient];
  2348. var directionMap = {
  2349. top: -1,
  2350. bottom: 1,
  2351. right: 1,
  2352. left: -1
  2353. };
  2354. layout4.labelDirection = layout4.tickDirection = layout4.nameDirection = directionMap[axisPosition];
  2355. if (axisModel.get(["axisTick", "inside"])) {
  2356. layout4.tickDirection = -layout4.tickDirection;
  2357. }
  2358. if (retrieve(opt.labelInside, axisModel.get(["axisLabel", "inside"]))) {
  2359. layout4.labelDirection = -layout4.labelDirection;
  2360. }
  2361. var labelRotation = opt.rotate;
  2362. labelRotation == null && (labelRotation = axisModel.get(["axisLabel", "rotate"]));
  2363. layout4.labelRotation = axisPosition === "top" ? -labelRotation : labelRotation;
  2364. layout4.z2 = 1;
  2365. return layout4;
  2366. }
  2367. // node_modules/echarts/lib/component/axis/SingleAxisView.js
  2368. var axisBuilderAttrs2 = ["axisLine", "axisTickLabel", "axisName"];
  2369. var selfBuilderAttrs2 = ["splitArea", "splitLine"];
  2370. var SingleAxisView = function(_super) {
  2371. __extends(SingleAxisView2, _super);
  2372. function SingleAxisView2() {
  2373. var _this = _super !== null && _super.apply(this, arguments) || this;
  2374. _this.type = SingleAxisView2.type;
  2375. _this.axisPointerClass = "SingleAxisPointer";
  2376. return _this;
  2377. }
  2378. SingleAxisView2.prototype.render = function(axisModel, ecModel, api, payload) {
  2379. var group = this.group;
  2380. group.removeAll();
  2381. var oldAxisGroup = this._axisGroup;
  2382. this._axisGroup = new Group_default();
  2383. var layout4 = layout2(axisModel);
  2384. var axisBuilder = new AxisBuilder_default(axisModel, layout4);
  2385. each(axisBuilderAttrs2, axisBuilder.add, axisBuilder);
  2386. group.add(this._axisGroup);
  2387. group.add(axisBuilder.getGroup());
  2388. each(selfBuilderAttrs2, function(name) {
  2389. if (axisModel.get([name, "show"])) {
  2390. axisElementBuilders2[name](this, this.group, this._axisGroup, axisModel);
  2391. }
  2392. }, this);
  2393. groupTransition(oldAxisGroup, this._axisGroup, axisModel);
  2394. _super.prototype.render.call(this, axisModel, ecModel, api, payload);
  2395. };
  2396. SingleAxisView2.prototype.remove = function() {
  2397. rectCoordAxisHandleRemove(this);
  2398. };
  2399. SingleAxisView2.type = "singleAxis";
  2400. return SingleAxisView2;
  2401. }(AxisView_default);
  2402. var axisElementBuilders2 = {
  2403. splitLine: function(axisView, group, axisGroup, axisModel) {
  2404. var axis = axisModel.axis;
  2405. if (axis.scale.isBlank()) {
  2406. return;
  2407. }
  2408. var splitLineModel = axisModel.getModel("splitLine");
  2409. var lineStyleModel = splitLineModel.getModel("lineStyle");
  2410. var lineColors = lineStyleModel.get("color");
  2411. lineColors = lineColors instanceof Array ? lineColors : [lineColors];
  2412. var gridRect = axisModel.coordinateSystem.getRect();
  2413. var isHorizontal = axis.isHorizontal();
  2414. var splitLines = [];
  2415. var lineCount = 0;
  2416. var ticksCoords = axis.getTicksCoords({
  2417. tickModel: splitLineModel
  2418. });
  2419. var p1 = [];
  2420. var p2 = [];
  2421. for (var i = 0; i < ticksCoords.length; ++i) {
  2422. var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);
  2423. if (isHorizontal) {
  2424. p1[0] = tickCoord;
  2425. p1[1] = gridRect.y;
  2426. p2[0] = tickCoord;
  2427. p2[1] = gridRect.y + gridRect.height;
  2428. } else {
  2429. p1[0] = gridRect.x;
  2430. p1[1] = tickCoord;
  2431. p2[0] = gridRect.x + gridRect.width;
  2432. p2[1] = tickCoord;
  2433. }
  2434. var colorIndex = lineCount++ % lineColors.length;
  2435. splitLines[colorIndex] = splitLines[colorIndex] || [];
  2436. splitLines[colorIndex].push(new Line_default({
  2437. subPixelOptimize: true,
  2438. shape: {
  2439. x1: p1[0],
  2440. y1: p1[1],
  2441. x2: p2[0],
  2442. y2: p2[1]
  2443. },
  2444. silent: true
  2445. }));
  2446. }
  2447. var lineStyle = lineStyleModel.getLineStyle(["color"]);
  2448. for (var i = 0; i < splitLines.length; ++i) {
  2449. group.add(mergePath(splitLines[i], {
  2450. style: defaults({
  2451. stroke: lineColors[i % lineColors.length]
  2452. }, lineStyle),
  2453. silent: true
  2454. }));
  2455. }
  2456. },
  2457. splitArea: function(axisView, group, axisGroup, axisModel) {
  2458. rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel);
  2459. }
  2460. };
  2461. var SingleAxisView_default = SingleAxisView;
  2462. // node_modules/echarts/lib/coord/single/AxisModel.js
  2463. init_define_APP_INFO();
  2464. var SingleAxisModel = function(_super) {
  2465. __extends(SingleAxisModel2, _super);
  2466. function SingleAxisModel2() {
  2467. var _this = _super !== null && _super.apply(this, arguments) || this;
  2468. _this.type = SingleAxisModel2.type;
  2469. return _this;
  2470. }
  2471. SingleAxisModel2.prototype.getCoordSysModel = function() {
  2472. return this;
  2473. };
  2474. SingleAxisModel2.type = "singleAxis";
  2475. SingleAxisModel2.layoutMode = "box";
  2476. SingleAxisModel2.defaultOption = {
  2477. left: "5%",
  2478. top: "5%",
  2479. right: "5%",
  2480. bottom: "5%",
  2481. type: "value",
  2482. position: "bottom",
  2483. orient: "horizontal",
  2484. axisLine: {
  2485. show: true,
  2486. lineStyle: {
  2487. width: 1,
  2488. type: "solid"
  2489. }
  2490. },
  2491. tooltip: {
  2492. show: true
  2493. },
  2494. axisTick: {
  2495. show: true,
  2496. length: 6,
  2497. lineStyle: {
  2498. width: 1
  2499. }
  2500. },
  2501. axisLabel: {
  2502. show: true,
  2503. interval: "auto"
  2504. },
  2505. splitLine: {
  2506. show: true,
  2507. lineStyle: {
  2508. type: "dashed",
  2509. opacity: 0.2
  2510. }
  2511. }
  2512. };
  2513. return SingleAxisModel2;
  2514. }(Component_default);
  2515. mixin(SingleAxisModel, AxisModelCommonMixin.prototype);
  2516. var AxisModel_default = SingleAxisModel;
  2517. // node_modules/echarts/lib/coord/single/singleCreator.js
  2518. init_define_APP_INFO();
  2519. // node_modules/echarts/lib/coord/single/Single.js
  2520. init_define_APP_INFO();
  2521. // node_modules/echarts/lib/coord/single/SingleAxis.js
  2522. init_define_APP_INFO();
  2523. var SingleAxis = function(_super) {
  2524. __extends(SingleAxis2, _super);
  2525. function SingleAxis2(dim, scale, coordExtent, axisType, position) {
  2526. var _this = _super.call(this, dim, scale, coordExtent) || this;
  2527. _this.type = axisType || "value";
  2528. _this.position = position || "bottom";
  2529. return _this;
  2530. }
  2531. SingleAxis2.prototype.isHorizontal = function() {
  2532. var position = this.position;
  2533. return position === "top" || position === "bottom";
  2534. };
  2535. SingleAxis2.prototype.pointToData = function(point, clamp) {
  2536. return this.coordinateSystem.pointToData(point)[0];
  2537. };
  2538. return SingleAxis2;
  2539. }(Axis_default);
  2540. var SingleAxis_default = SingleAxis;
  2541. // node_modules/echarts/lib/coord/single/Single.js
  2542. var singleDimensions = ["single"];
  2543. var Single = function() {
  2544. function Single2(axisModel, ecModel, api) {
  2545. this.type = "single";
  2546. this.dimension = "single";
  2547. this.dimensions = singleDimensions;
  2548. this.axisPointerEnabled = true;
  2549. this.model = axisModel;
  2550. this._init(axisModel, ecModel, api);
  2551. }
  2552. Single2.prototype._init = function(axisModel, ecModel, api) {
  2553. var dim = this.dimension;
  2554. var axis = new SingleAxis_default(dim, createScaleByModel(axisModel), [0, 0], axisModel.get("type"), axisModel.get("position"));
  2555. var isCategory = axis.type === "category";
  2556. axis.onBand = isCategory && axisModel.get("boundaryGap");
  2557. axis.inverse = axisModel.get("inverse");
  2558. axis.orient = axisModel.get("orient");
  2559. axisModel.axis = axis;
  2560. axis.model = axisModel;
  2561. axis.coordinateSystem = this;
  2562. this._axis = axis;
  2563. };
  2564. Single2.prototype.update = function(ecModel, api) {
  2565. ecModel.eachSeries(function(seriesModel) {
  2566. if (seriesModel.coordinateSystem === this) {
  2567. var data_1 = seriesModel.getData();
  2568. each(data_1.mapDimensionsAll(this.dimension), function(dim) {
  2569. this._axis.scale.unionExtentFromData(data_1, dim);
  2570. }, this);
  2571. niceScaleExtent(this._axis.scale, this._axis.model);
  2572. }
  2573. }, this);
  2574. };
  2575. Single2.prototype.resize = function(axisModel, api) {
  2576. this._rect = getLayoutRect({
  2577. left: axisModel.get("left"),
  2578. top: axisModel.get("top"),
  2579. right: axisModel.get("right"),
  2580. bottom: axisModel.get("bottom"),
  2581. width: axisModel.get("width"),
  2582. height: axisModel.get("height")
  2583. }, {
  2584. width: api.getWidth(),
  2585. height: api.getHeight()
  2586. });
  2587. this._adjustAxis();
  2588. };
  2589. Single2.prototype.getRect = function() {
  2590. return this._rect;
  2591. };
  2592. Single2.prototype._adjustAxis = function() {
  2593. var rect = this._rect;
  2594. var axis = this._axis;
  2595. var isHorizontal = axis.isHorizontal();
  2596. var extent = isHorizontal ? [0, rect.width] : [0, rect.height];
  2597. var idx = axis.reverse ? 1 : 0;
  2598. axis.setExtent(extent[idx], extent[1 - idx]);
  2599. this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);
  2600. };
  2601. Single2.prototype._updateAxisTransform = function(axis, coordBase) {
  2602. var axisExtent = axis.getExtent();
  2603. var extentSum = axisExtent[0] + axisExtent[1];
  2604. var isHorizontal = axis.isHorizontal();
  2605. axis.toGlobalCoord = isHorizontal ? function(coord) {
  2606. return coord + coordBase;
  2607. } : function(coord) {
  2608. return extentSum - coord + coordBase;
  2609. };
  2610. axis.toLocalCoord = isHorizontal ? function(coord) {
  2611. return coord - coordBase;
  2612. } : function(coord) {
  2613. return extentSum - coord + coordBase;
  2614. };
  2615. };
  2616. Single2.prototype.getAxis = function() {
  2617. return this._axis;
  2618. };
  2619. Single2.prototype.getBaseAxis = function() {
  2620. return this._axis;
  2621. };
  2622. Single2.prototype.getAxes = function() {
  2623. return [this._axis];
  2624. };
  2625. Single2.prototype.getTooltipAxes = function() {
  2626. return {
  2627. baseAxes: [this.getAxis()],
  2628. otherAxes: []
  2629. };
  2630. };
  2631. Single2.prototype.containPoint = function(point) {
  2632. var rect = this.getRect();
  2633. var axis = this.getAxis();
  2634. var orient = axis.orient;
  2635. if (orient === "horizontal") {
  2636. return axis.contain(axis.toLocalCoord(point[0])) && point[1] >= rect.y && point[1] <= rect.y + rect.height;
  2637. } else {
  2638. return axis.contain(axis.toLocalCoord(point[1])) && point[0] >= rect.y && point[0] <= rect.y + rect.height;
  2639. }
  2640. };
  2641. Single2.prototype.pointToData = function(point) {
  2642. var axis = this.getAxis();
  2643. return [axis.coordToData(axis.toLocalCoord(point[axis.orient === "horizontal" ? 0 : 1]))];
  2644. };
  2645. Single2.prototype.dataToPoint = function(val) {
  2646. var axis = this.getAxis();
  2647. var rect = this.getRect();
  2648. var pt = [];
  2649. var idx = axis.orient === "horizontal" ? 0 : 1;
  2650. if (val instanceof Array) {
  2651. val = val[0];
  2652. }
  2653. pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));
  2654. pt[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2;
  2655. return pt;
  2656. };
  2657. Single2.prototype.convertToPixel = function(ecModel, finder, value) {
  2658. var coordSys = getCoordSys2(finder);
  2659. return coordSys === this ? this.dataToPoint(value) : null;
  2660. };
  2661. Single2.prototype.convertFromPixel = function(ecModel, finder, pixel) {
  2662. var coordSys = getCoordSys2(finder);
  2663. return coordSys === this ? this.pointToData(pixel) : null;
  2664. };
  2665. return Single2;
  2666. }();
  2667. function getCoordSys2(finder) {
  2668. var seriesModel = finder.seriesModel;
  2669. var singleModel = finder.singleAxisModel;
  2670. return singleModel && singleModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;
  2671. }
  2672. var Single_default = Single;
  2673. // node_modules/echarts/lib/coord/single/singleCreator.js
  2674. function create2(ecModel, api) {
  2675. var singles = [];
  2676. ecModel.eachComponent("singleAxis", function(axisModel, idx) {
  2677. var single = new Single_default(axisModel, ecModel, api);
  2678. single.name = "single_" + idx;
  2679. single.resize(axisModel, api);
  2680. axisModel.coordinateSystem = single;
  2681. singles.push(single);
  2682. });
  2683. ecModel.eachSeries(function(seriesModel) {
  2684. if (seriesModel.get("coordinateSystem") === "singleAxis") {
  2685. var singleAxisModel = seriesModel.getReferringComponents("singleAxis", SINGLE_REFERRING).models[0];
  2686. seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;
  2687. }
  2688. });
  2689. return singles;
  2690. }
  2691. var singleCreator = {
  2692. create: create2,
  2693. dimensions: singleDimensions
  2694. };
  2695. var singleCreator_default = singleCreator;
  2696. // node_modules/echarts/lib/component/axisPointer/SingleAxisPointer.js
  2697. init_define_APP_INFO();
  2698. var XY = ["x", "y"];
  2699. var WH = ["width", "height"];
  2700. var SingleAxisPointer = function(_super) {
  2701. __extends(SingleAxisPointer2, _super);
  2702. function SingleAxisPointer2() {
  2703. return _super !== null && _super.apply(this, arguments) || this;
  2704. }
  2705. SingleAxisPointer2.prototype.makeElOption = function(elOption, value, axisModel, axisPointerModel, api) {
  2706. var axis = axisModel.axis;
  2707. var coordSys = axis.coordinateSystem;
  2708. var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis));
  2709. var pixelValue = coordSys.dataToPoint(value)[0];
  2710. var axisPointerType = axisPointerModel.get("type");
  2711. if (axisPointerType && axisPointerType !== "none") {
  2712. var elStyle = buildElStyle(axisPointerModel);
  2713. var pointerOption = pointerShapeBuilder3[axisPointerType](axis, pixelValue, otherExtent);
  2714. pointerOption.style = elStyle;
  2715. elOption.graphicKey = pointerOption.type;
  2716. elOption.pointer = pointerOption;
  2717. }
  2718. var layoutInfo = layout2(axisModel);
  2719. buildCartesianSingleLabelElOption(
  2720. value,
  2721. elOption,
  2722. layoutInfo,
  2723. axisModel,
  2724. axisPointerModel,
  2725. api
  2726. );
  2727. };
  2728. SingleAxisPointer2.prototype.getHandleTransform = function(value, axisModel, axisPointerModel) {
  2729. var layoutInfo = layout2(axisModel, {
  2730. labelInside: false
  2731. });
  2732. layoutInfo.labelMargin = axisPointerModel.get(["handle", "margin"]);
  2733. var position = getTransformedPosition(axisModel.axis, value, layoutInfo);
  2734. return {
  2735. x: position[0],
  2736. y: position[1],
  2737. rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)
  2738. };
  2739. };
  2740. SingleAxisPointer2.prototype.updateHandleTransform = function(transform, delta, axisModel, axisPointerModel) {
  2741. var axis = axisModel.axis;
  2742. var coordSys = axis.coordinateSystem;
  2743. var dimIndex = getPointDimIndex(axis);
  2744. var axisExtent = getGlobalExtent(coordSys, dimIndex);
  2745. var currPosition = [transform.x, transform.y];
  2746. currPosition[dimIndex] += delta[dimIndex];
  2747. currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);
  2748. currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);
  2749. var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex);
  2750. var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;
  2751. var cursorPoint = [cursorOtherValue, cursorOtherValue];
  2752. cursorPoint[dimIndex] = currPosition[dimIndex];
  2753. return {
  2754. x: currPosition[0],
  2755. y: currPosition[1],
  2756. rotation: transform.rotation,
  2757. cursorPoint,
  2758. tooltipOption: {
  2759. verticalAlign: "middle"
  2760. }
  2761. };
  2762. };
  2763. return SingleAxisPointer2;
  2764. }(BaseAxisPointer_default);
  2765. var pointerShapeBuilder3 = {
  2766. line: function(axis, pixelValue, otherExtent) {
  2767. var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis));
  2768. return {
  2769. type: "Line",
  2770. subPixelOptimize: true,
  2771. shape: targetShape
  2772. };
  2773. },
  2774. shadow: function(axis, pixelValue, otherExtent) {
  2775. var bandWidth = axis.getBandWidth();
  2776. var span = otherExtent[1] - otherExtent[0];
  2777. return {
  2778. type: "Rect",
  2779. shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis))
  2780. };
  2781. }
  2782. };
  2783. function getPointDimIndex(axis) {
  2784. return axis.isHorizontal() ? 0 : 1;
  2785. }
  2786. function getGlobalExtent(coordSys, dimIndex) {
  2787. var rect = coordSys.getRect();
  2788. return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]];
  2789. }
  2790. var SingleAxisPointer_default = SingleAxisPointer;
  2791. // node_modules/echarts/lib/component/singleAxis/install.js
  2792. var SingleView = function(_super) {
  2793. __extends(SingleView2, _super);
  2794. function SingleView2() {
  2795. var _this = _super !== null && _super.apply(this, arguments) || this;
  2796. _this.type = SingleView2.type;
  2797. return _this;
  2798. }
  2799. SingleView2.type = "single";
  2800. return SingleView2;
  2801. }(Component_default2);
  2802. function install8(registers) {
  2803. use(install5);
  2804. AxisView_default.registerAxisPointerClass("SingleAxisPointer", SingleAxisPointer_default);
  2805. registers.registerComponentView(SingleView);
  2806. registers.registerComponentView(SingleAxisView_default);
  2807. registers.registerComponentModel(AxisModel_default);
  2808. axisModelCreator(registers, "single", AxisModel_default, AxisModel_default.defaultOption);
  2809. registers.registerCoordinateSystem("single", singleCreator_default);
  2810. }
  2811. // node_modules/echarts/lib/component/calendar/install.js
  2812. init_define_APP_INFO();
  2813. // node_modules/echarts/lib/coord/calendar/CalendarModel.js
  2814. init_define_APP_INFO();
  2815. var CalendarModel = function(_super) {
  2816. __extends(CalendarModel2, _super);
  2817. function CalendarModel2() {
  2818. var _this = _super !== null && _super.apply(this, arguments) || this;
  2819. _this.type = CalendarModel2.type;
  2820. return _this;
  2821. }
  2822. CalendarModel2.prototype.init = function(option, parentModel, ecModel) {
  2823. var inputPositionParams = getLayoutParams(option);
  2824. _super.prototype.init.apply(this, arguments);
  2825. mergeAndNormalizeLayoutParams(option, inputPositionParams);
  2826. };
  2827. CalendarModel2.prototype.mergeOption = function(option) {
  2828. _super.prototype.mergeOption.apply(this, arguments);
  2829. mergeAndNormalizeLayoutParams(this.option, option);
  2830. };
  2831. CalendarModel2.prototype.getCellSize = function() {
  2832. return this.option.cellSize;
  2833. };
  2834. CalendarModel2.type = "calendar";
  2835. CalendarModel2.defaultOption = {
  2836. z: 2,
  2837. left: 80,
  2838. top: 60,
  2839. cellSize: 20,
  2840. orient: "horizontal",
  2841. splitLine: {
  2842. show: true,
  2843. lineStyle: {
  2844. color: "#000",
  2845. width: 1,
  2846. type: "solid"
  2847. }
  2848. },
  2849. itemStyle: {
  2850. color: "#fff",
  2851. borderWidth: 1,
  2852. borderColor: "#ccc"
  2853. },
  2854. dayLabel: {
  2855. show: true,
  2856. firstDay: 0,
  2857. position: "start",
  2858. margin: "50%",
  2859. color: "#000"
  2860. },
  2861. monthLabel: {
  2862. show: true,
  2863. position: "start",
  2864. margin: 5,
  2865. align: "center",
  2866. formatter: null,
  2867. color: "#000"
  2868. },
  2869. yearLabel: {
  2870. show: true,
  2871. position: null,
  2872. margin: 30,
  2873. formatter: null,
  2874. color: "#ccc",
  2875. fontFamily: "sans-serif",
  2876. fontWeight: "bolder",
  2877. fontSize: 20
  2878. }
  2879. };
  2880. return CalendarModel2;
  2881. }(Component_default);
  2882. function mergeAndNormalizeLayoutParams(target, raw) {
  2883. var cellSize = target.cellSize;
  2884. var cellSizeArr;
  2885. if (!isArray(cellSize)) {
  2886. cellSizeArr = target.cellSize = [cellSize, cellSize];
  2887. } else {
  2888. cellSizeArr = cellSize;
  2889. }
  2890. if (cellSizeArr.length === 1) {
  2891. cellSizeArr[1] = cellSizeArr[0];
  2892. }
  2893. var ignoreSize = map([0, 1], function(hvIdx) {
  2894. if (sizeCalculable(raw, hvIdx)) {
  2895. cellSizeArr[hvIdx] = "auto";
  2896. }
  2897. return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== "auto";
  2898. });
  2899. mergeLayoutParam(target, raw, {
  2900. type: "box",
  2901. ignoreSize
  2902. });
  2903. }
  2904. var CalendarModel_default = CalendarModel;
  2905. // node_modules/echarts/lib/component/calendar/CalendarView.js
  2906. init_define_APP_INFO();
  2907. var CalendarView = function(_super) {
  2908. __extends(CalendarView2, _super);
  2909. function CalendarView2() {
  2910. var _this = _super !== null && _super.apply(this, arguments) || this;
  2911. _this.type = CalendarView2.type;
  2912. return _this;
  2913. }
  2914. CalendarView2.prototype.render = function(calendarModel, ecModel, api) {
  2915. var group = this.group;
  2916. group.removeAll();
  2917. var coordSys = calendarModel.coordinateSystem;
  2918. var rangeData = coordSys.getRangeInfo();
  2919. var orient = coordSys.getOrient();
  2920. var localeModel = ecModel.getLocaleModel();
  2921. this._renderDayRect(calendarModel, rangeData, group);
  2922. this._renderLines(calendarModel, rangeData, orient, group);
  2923. this._renderYearText(calendarModel, rangeData, orient, group);
  2924. this._renderMonthText(calendarModel, localeModel, orient, group);
  2925. this._renderWeekText(calendarModel, localeModel, rangeData, orient, group);
  2926. };
  2927. CalendarView2.prototype._renderDayRect = function(calendarModel, rangeData, group) {
  2928. var coordSys = calendarModel.coordinateSystem;
  2929. var itemRectStyleModel = calendarModel.getModel("itemStyle").getItemStyle();
  2930. var sw = coordSys.getCellWidth();
  2931. var sh = coordSys.getCellHeight();
  2932. for (var i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time) {
  2933. var point = coordSys.dataToRect([i], false).tl;
  2934. var rect = new Rect_default({
  2935. shape: {
  2936. x: point[0],
  2937. y: point[1],
  2938. width: sw,
  2939. height: sh
  2940. },
  2941. cursor: "default",
  2942. style: itemRectStyleModel
  2943. });
  2944. group.add(rect);
  2945. }
  2946. };
  2947. CalendarView2.prototype._renderLines = function(calendarModel, rangeData, orient, group) {
  2948. var self = this;
  2949. var coordSys = calendarModel.coordinateSystem;
  2950. var lineStyleModel = calendarModel.getModel(["splitLine", "lineStyle"]).getLineStyle();
  2951. var show = calendarModel.get(["splitLine", "show"]);
  2952. var lineWidth = lineStyleModel.lineWidth;
  2953. this._tlpoints = [];
  2954. this._blpoints = [];
  2955. this._firstDayOfMonth = [];
  2956. this._firstDayPoints = [];
  2957. var firstDay = rangeData.start;
  2958. for (var i = 0; firstDay.time <= rangeData.end.time; i++) {
  2959. addPoints(firstDay.formatedDate);
  2960. if (i === 0) {
  2961. firstDay = coordSys.getDateInfo(rangeData.start.y + "-" + rangeData.start.m);
  2962. }
  2963. var date = firstDay.date;
  2964. date.setMonth(date.getMonth() + 1);
  2965. firstDay = coordSys.getDateInfo(date);
  2966. }
  2967. addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate);
  2968. function addPoints(date2) {
  2969. self._firstDayOfMonth.push(coordSys.getDateInfo(date2));
  2970. self._firstDayPoints.push(coordSys.dataToRect([date2], false).tl);
  2971. var points = self._getLinePointsOfOneWeek(calendarModel, date2, orient);
  2972. self._tlpoints.push(points[0]);
  2973. self._blpoints.push(points[points.length - 1]);
  2974. show && self._drawSplitline(points, lineStyleModel, group);
  2975. }
  2976. show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group);
  2977. show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group);
  2978. };
  2979. CalendarView2.prototype._getEdgesPoints = function(points, lineWidth, orient) {
  2980. var rs = [points[0].slice(), points[points.length - 1].slice()];
  2981. var idx = orient === "horizontal" ? 0 : 1;
  2982. rs[0][idx] = rs[0][idx] - lineWidth / 2;
  2983. rs[1][idx] = rs[1][idx] + lineWidth / 2;
  2984. return rs;
  2985. };
  2986. CalendarView2.prototype._drawSplitline = function(points, lineStyle, group) {
  2987. var poyline = new Polyline_default({
  2988. z2: 20,
  2989. shape: {
  2990. points
  2991. },
  2992. style: lineStyle
  2993. });
  2994. group.add(poyline);
  2995. };
  2996. CalendarView2.prototype._getLinePointsOfOneWeek = function(calendarModel, date, orient) {
  2997. var coordSys = calendarModel.coordinateSystem;
  2998. var parsedDate = coordSys.getDateInfo(date);
  2999. var points = [];
  3000. for (var i = 0; i < 7; i++) {
  3001. var tmpD = coordSys.getNextNDay(parsedDate.time, i);
  3002. var point = coordSys.dataToRect([tmpD.time], false);
  3003. points[2 * tmpD.day] = point.tl;
  3004. points[2 * tmpD.day + 1] = point[orient === "horizontal" ? "bl" : "tr"];
  3005. }
  3006. return points;
  3007. };
  3008. CalendarView2.prototype._formatterLabel = function(formatter, params) {
  3009. if (isString(formatter) && formatter) {
  3010. return formatTplSimple(formatter, params);
  3011. }
  3012. if (isFunction(formatter)) {
  3013. return formatter(params);
  3014. }
  3015. return params.nameMap;
  3016. };
  3017. CalendarView2.prototype._yearTextPositionControl = function(textEl, point, orient, position, margin) {
  3018. var x = point[0];
  3019. var y = point[1];
  3020. var aligns = ["center", "bottom"];
  3021. if (position === "bottom") {
  3022. y += margin;
  3023. aligns = ["center", "top"];
  3024. } else if (position === "left") {
  3025. x -= margin;
  3026. } else if (position === "right") {
  3027. x += margin;
  3028. aligns = ["center", "top"];
  3029. } else {
  3030. y -= margin;
  3031. }
  3032. var rotate2 = 0;
  3033. if (position === "left" || position === "right") {
  3034. rotate2 = Math.PI / 2;
  3035. }
  3036. return {
  3037. rotation: rotate2,
  3038. x,
  3039. y,
  3040. style: {
  3041. align: aligns[0],
  3042. verticalAlign: aligns[1]
  3043. }
  3044. };
  3045. };
  3046. CalendarView2.prototype._renderYearText = function(calendarModel, rangeData, orient, group) {
  3047. var yearLabel = calendarModel.getModel("yearLabel");
  3048. if (!yearLabel.get("show")) {
  3049. return;
  3050. }
  3051. var margin = yearLabel.get("margin");
  3052. var pos = yearLabel.get("position");
  3053. if (!pos) {
  3054. pos = orient !== "horizontal" ? "top" : "left";
  3055. }
  3056. var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]];
  3057. var xc = (points[0][0] + points[1][0]) / 2;
  3058. var yc = (points[0][1] + points[1][1]) / 2;
  3059. var idx = orient === "horizontal" ? 0 : 1;
  3060. var posPoints = {
  3061. top: [xc, points[idx][1]],
  3062. bottom: [xc, points[1 - idx][1]],
  3063. left: [points[1 - idx][0], yc],
  3064. right: [points[idx][0], yc]
  3065. };
  3066. var name = rangeData.start.y;
  3067. if (+rangeData.end.y > +rangeData.start.y) {
  3068. name = name + "-" + rangeData.end.y;
  3069. }
  3070. var formatter = yearLabel.get("formatter");
  3071. var params = {
  3072. start: rangeData.start.y,
  3073. end: rangeData.end.y,
  3074. nameMap: name
  3075. };
  3076. var content = this._formatterLabel(formatter, params);
  3077. var yearText = new Text_default({
  3078. z2: 30,
  3079. style: createTextStyle(yearLabel, {
  3080. text: content
  3081. })
  3082. });
  3083. yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));
  3084. group.add(yearText);
  3085. };
  3086. CalendarView2.prototype._monthTextPositionControl = function(point, isCenter, orient, position, margin) {
  3087. var align = "left";
  3088. var vAlign = "top";
  3089. var x = point[0];
  3090. var y = point[1];
  3091. if (orient === "horizontal") {
  3092. y = y + margin;
  3093. if (isCenter) {
  3094. align = "center";
  3095. }
  3096. if (position === "start") {
  3097. vAlign = "bottom";
  3098. }
  3099. } else {
  3100. x = x + margin;
  3101. if (isCenter) {
  3102. vAlign = "middle";
  3103. }
  3104. if (position === "start") {
  3105. align = "right";
  3106. }
  3107. }
  3108. return {
  3109. x,
  3110. y,
  3111. align,
  3112. verticalAlign: vAlign
  3113. };
  3114. };
  3115. CalendarView2.prototype._renderMonthText = function(calendarModel, localeModel, orient, group) {
  3116. var monthLabel = calendarModel.getModel("monthLabel");
  3117. if (!monthLabel.get("show")) {
  3118. return;
  3119. }
  3120. var nameMap = monthLabel.get("nameMap");
  3121. var margin = monthLabel.get("margin");
  3122. var pos = monthLabel.get("position");
  3123. var align = monthLabel.get("align");
  3124. var termPoints = [this._tlpoints, this._blpoints];
  3125. if (!nameMap || isString(nameMap)) {
  3126. if (nameMap) {
  3127. localeModel = getLocaleModel(nameMap) || localeModel;
  3128. }
  3129. nameMap = localeModel.get(["time", "monthAbbr"]) || [];
  3130. }
  3131. var idx = pos === "start" ? 0 : 1;
  3132. var axis = orient === "horizontal" ? 0 : 1;
  3133. margin = pos === "start" ? -margin : margin;
  3134. var isCenter = align === "center";
  3135. for (var i = 0; i < termPoints[idx].length - 1; i++) {
  3136. var tmp = termPoints[idx][i].slice();
  3137. var firstDay = this._firstDayOfMonth[i];
  3138. if (isCenter) {
  3139. var firstDayPoints = this._firstDayPoints[i];
  3140. tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2;
  3141. }
  3142. var formatter = monthLabel.get("formatter");
  3143. var name_1 = nameMap[+firstDay.m - 1];
  3144. var params = {
  3145. yyyy: firstDay.y,
  3146. yy: (firstDay.y + "").slice(2),
  3147. MM: firstDay.m,
  3148. M: +firstDay.m,
  3149. nameMap: name_1
  3150. };
  3151. var content = this._formatterLabel(formatter, params);
  3152. var monthText = new Text_default({
  3153. z2: 30,
  3154. style: extend(createTextStyle(monthLabel, {
  3155. text: content
  3156. }), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin))
  3157. });
  3158. group.add(monthText);
  3159. }
  3160. };
  3161. CalendarView2.prototype._weekTextPositionControl = function(point, orient, position, margin, cellSize) {
  3162. var align = "center";
  3163. var vAlign = "middle";
  3164. var x = point[0];
  3165. var y = point[1];
  3166. var isStart = position === "start";
  3167. if (orient === "horizontal") {
  3168. x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2;
  3169. align = isStart ? "right" : "left";
  3170. } else {
  3171. y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2;
  3172. vAlign = isStart ? "bottom" : "top";
  3173. }
  3174. return {
  3175. x,
  3176. y,
  3177. align,
  3178. verticalAlign: vAlign
  3179. };
  3180. };
  3181. CalendarView2.prototype._renderWeekText = function(calendarModel, localeModel, rangeData, orient, group) {
  3182. var dayLabel = calendarModel.getModel("dayLabel");
  3183. if (!dayLabel.get("show")) {
  3184. return;
  3185. }
  3186. var coordSys = calendarModel.coordinateSystem;
  3187. var pos = dayLabel.get("position");
  3188. var nameMap = dayLabel.get("nameMap");
  3189. var margin = dayLabel.get("margin");
  3190. var firstDayOfWeek = coordSys.getFirstDayOfWeek();
  3191. if (!nameMap || isString(nameMap)) {
  3192. if (nameMap) {
  3193. localeModel = getLocaleModel(nameMap) || localeModel;
  3194. }
  3195. var dayOfWeekShort = localeModel.get(["time", "dayOfWeekShort"]);
  3196. nameMap = dayOfWeekShort || map(localeModel.get(["time", "dayOfWeekAbbr"]), function(val) {
  3197. return val[0];
  3198. });
  3199. }
  3200. var start = coordSys.getNextNDay(rangeData.end.time, 7 - rangeData.lweek).time;
  3201. var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()];
  3202. margin = parsePercent2(margin, Math.min(cellSize[1], cellSize[0]));
  3203. if (pos === "start") {
  3204. start = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time;
  3205. margin = -margin;
  3206. }
  3207. for (var i = 0; i < 7; i++) {
  3208. var tmpD = coordSys.getNextNDay(start, i);
  3209. var point = coordSys.dataToRect([tmpD.time], false).center;
  3210. var day = i;
  3211. day = Math.abs((i + firstDayOfWeek) % 7);
  3212. var weekText = new Text_default({
  3213. z2: 30,
  3214. style: extend(createTextStyle(dayLabel, {
  3215. text: nameMap[day]
  3216. }), this._weekTextPositionControl(point, orient, pos, margin, cellSize))
  3217. });
  3218. group.add(weekText);
  3219. }
  3220. };
  3221. CalendarView2.type = "calendar";
  3222. return CalendarView2;
  3223. }(Component_default2);
  3224. var CalendarView_default = CalendarView;
  3225. // node_modules/echarts/lib/coord/calendar/Calendar.js
  3226. init_define_APP_INFO();
  3227. var PROXIMATE_ONE_DAY = 864e5;
  3228. var Calendar = function() {
  3229. function Calendar2(calendarModel, ecModel, api) {
  3230. this.type = "calendar";
  3231. this.dimensions = Calendar2.dimensions;
  3232. this.getDimensionsInfo = Calendar2.getDimensionsInfo;
  3233. this._model = calendarModel;
  3234. }
  3235. Calendar2.getDimensionsInfo = function() {
  3236. return [{
  3237. name: "time",
  3238. type: "time"
  3239. }, "value"];
  3240. };
  3241. Calendar2.prototype.getRangeInfo = function() {
  3242. return this._rangeInfo;
  3243. };
  3244. Calendar2.prototype.getModel = function() {
  3245. return this._model;
  3246. };
  3247. Calendar2.prototype.getRect = function() {
  3248. return this._rect;
  3249. };
  3250. Calendar2.prototype.getCellWidth = function() {
  3251. return this._sw;
  3252. };
  3253. Calendar2.prototype.getCellHeight = function() {
  3254. return this._sh;
  3255. };
  3256. Calendar2.prototype.getOrient = function() {
  3257. return this._orient;
  3258. };
  3259. Calendar2.prototype.getFirstDayOfWeek = function() {
  3260. return this._firstDayOfWeek;
  3261. };
  3262. Calendar2.prototype.getDateInfo = function(date) {
  3263. date = parseDate(date);
  3264. var y = date.getFullYear();
  3265. var m = date.getMonth() + 1;
  3266. var mStr = m < 10 ? "0" + m : "" + m;
  3267. var d = date.getDate();
  3268. var dStr = d < 10 ? "0" + d : "" + d;
  3269. var day = date.getDay();
  3270. day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7);
  3271. return {
  3272. y: y + "",
  3273. m: mStr,
  3274. d: dStr,
  3275. day,
  3276. time: date.getTime(),
  3277. formatedDate: y + "-" + mStr + "-" + dStr,
  3278. date
  3279. };
  3280. };
  3281. Calendar2.prototype.getNextNDay = function(date, n) {
  3282. n = n || 0;
  3283. if (n === 0) {
  3284. return this.getDateInfo(date);
  3285. }
  3286. date = new Date(this.getDateInfo(date).time);
  3287. date.setDate(date.getDate() + n);
  3288. return this.getDateInfo(date);
  3289. };
  3290. Calendar2.prototype.update = function(ecModel, api) {
  3291. this._firstDayOfWeek = +this._model.getModel("dayLabel").get("firstDay");
  3292. this._orient = this._model.get("orient");
  3293. this._lineWidth = this._model.getModel("itemStyle").getItemStyle().lineWidth || 0;
  3294. this._rangeInfo = this._getRangeInfo(this._initRangeOption());
  3295. var weeks = this._rangeInfo.weeks || 1;
  3296. var whNames = ["width", "height"];
  3297. var cellSize = this._model.getCellSize().slice();
  3298. var layoutParams = this._model.getBoxLayoutParams();
  3299. var cellNumbers = this._orient === "horizontal" ? [weeks, 7] : [7, weeks];
  3300. each([0, 1], function(idx) {
  3301. if (cellSizeSpecified(cellSize, idx)) {
  3302. layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx];
  3303. }
  3304. });
  3305. var whGlobal = {
  3306. width: api.getWidth(),
  3307. height: api.getHeight()
  3308. };
  3309. var calendarRect = this._rect = getLayoutRect(layoutParams, whGlobal);
  3310. each([0, 1], function(idx) {
  3311. if (!cellSizeSpecified(cellSize, idx)) {
  3312. cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx];
  3313. }
  3314. });
  3315. function cellSizeSpecified(cellSize2, idx) {
  3316. return cellSize2[idx] != null && cellSize2[idx] !== "auto";
  3317. }
  3318. this._sw = cellSize[0];
  3319. this._sh = cellSize[1];
  3320. };
  3321. Calendar2.prototype.dataToPoint = function(data, clamp) {
  3322. isArray(data) && (data = data[0]);
  3323. clamp == null && (clamp = true);
  3324. var dayInfo = this.getDateInfo(data);
  3325. var range = this._rangeInfo;
  3326. var date = dayInfo.formatedDate;
  3327. if (clamp && !(dayInfo.time >= range.start.time && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY)) {
  3328. return [NaN, NaN];
  3329. }
  3330. var week = dayInfo.day;
  3331. var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek;
  3332. if (this._orient === "vertical") {
  3333. return [this._rect.x + week * this._sw + this._sw / 2, this._rect.y + nthWeek * this._sh + this._sh / 2];
  3334. }
  3335. return [this._rect.x + nthWeek * this._sw + this._sw / 2, this._rect.y + week * this._sh + this._sh / 2];
  3336. };
  3337. Calendar2.prototype.pointToData = function(point) {
  3338. var date = this.pointToDate(point);
  3339. return date && date.time;
  3340. };
  3341. Calendar2.prototype.dataToRect = function(data, clamp) {
  3342. var point = this.dataToPoint(data, clamp);
  3343. return {
  3344. contentShape: {
  3345. x: point[0] - (this._sw - this._lineWidth) / 2,
  3346. y: point[1] - (this._sh - this._lineWidth) / 2,
  3347. width: this._sw - this._lineWidth,
  3348. height: this._sh - this._lineWidth
  3349. },
  3350. center: point,
  3351. tl: [point[0] - this._sw / 2, point[1] - this._sh / 2],
  3352. tr: [point[0] + this._sw / 2, point[1] - this._sh / 2],
  3353. br: [point[0] + this._sw / 2, point[1] + this._sh / 2],
  3354. bl: [point[0] - this._sw / 2, point[1] + this._sh / 2]
  3355. };
  3356. };
  3357. Calendar2.prototype.pointToDate = function(point) {
  3358. var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1;
  3359. var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1;
  3360. var range = this._rangeInfo.range;
  3361. if (this._orient === "vertical") {
  3362. return this._getDateByWeeksAndDay(nthY, nthX - 1, range);
  3363. }
  3364. return this._getDateByWeeksAndDay(nthX, nthY - 1, range);
  3365. };
  3366. Calendar2.prototype.convertToPixel = function(ecModel, finder, value) {
  3367. var coordSys = getCoordSys3(finder);
  3368. return coordSys === this ? coordSys.dataToPoint(value) : null;
  3369. };
  3370. Calendar2.prototype.convertFromPixel = function(ecModel, finder, pixel) {
  3371. var coordSys = getCoordSys3(finder);
  3372. return coordSys === this ? coordSys.pointToData(pixel) : null;
  3373. };
  3374. Calendar2.prototype.containPoint = function(point) {
  3375. console.warn("Not implemented.");
  3376. return false;
  3377. };
  3378. Calendar2.prototype._initRangeOption = function() {
  3379. var range = this._model.get("range");
  3380. var normalizedRange;
  3381. if (isArray(range) && range.length === 1) {
  3382. range = range[0];
  3383. }
  3384. if (!isArray(range)) {
  3385. var rangeStr = range.toString();
  3386. if (/^\d{4}$/.test(rangeStr)) {
  3387. normalizedRange = [rangeStr + "-01-01", rangeStr + "-12-31"];
  3388. }
  3389. if (/^\d{4}[\/|-]\d{1,2}$/.test(rangeStr)) {
  3390. var start = this.getDateInfo(rangeStr);
  3391. var firstDay = start.date;
  3392. firstDay.setMonth(firstDay.getMonth() + 1);
  3393. var end = this.getNextNDay(firstDay, -1);
  3394. normalizedRange = [start.formatedDate, end.formatedDate];
  3395. }
  3396. if (/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(rangeStr)) {
  3397. normalizedRange = [rangeStr, rangeStr];
  3398. }
  3399. } else {
  3400. normalizedRange = range;
  3401. }
  3402. if (!normalizedRange) {
  3403. if (true) {
  3404. logError("Invalid date range.");
  3405. }
  3406. return range;
  3407. }
  3408. var tmp = this._getRangeInfo(normalizedRange);
  3409. if (tmp.start.time > tmp.end.time) {
  3410. normalizedRange.reverse();
  3411. }
  3412. return normalizedRange;
  3413. };
  3414. Calendar2.prototype._getRangeInfo = function(range) {
  3415. var parsedRange = [this.getDateInfo(range[0]), this.getDateInfo(range[1])];
  3416. var reversed;
  3417. if (parsedRange[0].time > parsedRange[1].time) {
  3418. reversed = true;
  3419. parsedRange.reverse();
  3420. }
  3421. var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY) - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1;
  3422. var date = new Date(parsedRange[0].time);
  3423. var startDateNum = date.getDate();
  3424. var endDateNum = parsedRange[1].date.getDate();
  3425. date.setDate(startDateNum + allDay - 1);
  3426. var dateNum = date.getDate();
  3427. if (dateNum !== endDateNum) {
  3428. var sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1;
  3429. while ((dateNum = date.getDate()) !== endDateNum && (date.getTime() - parsedRange[1].time) * sign > 0) {
  3430. allDay -= sign;
  3431. date.setDate(dateNum - sign);
  3432. }
  3433. }
  3434. var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7);
  3435. var nthWeek = reversed ? -weeks + 1 : weeks - 1;
  3436. reversed && parsedRange.reverse();
  3437. return {
  3438. range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate],
  3439. start: parsedRange[0],
  3440. end: parsedRange[1],
  3441. allDay,
  3442. weeks,
  3443. nthWeek,
  3444. fweek: parsedRange[0].day,
  3445. lweek: parsedRange[1].day
  3446. };
  3447. };
  3448. Calendar2.prototype._getDateByWeeksAndDay = function(nthWeek, day, range) {
  3449. var rangeInfo = this._getRangeInfo(range);
  3450. if (nthWeek > rangeInfo.weeks || nthWeek === 0 && day < rangeInfo.fweek || nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) {
  3451. return null;
  3452. }
  3453. var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day;
  3454. var date = new Date(rangeInfo.start.time);
  3455. date.setDate(+rangeInfo.start.d + nthDay);
  3456. return this.getDateInfo(date);
  3457. };
  3458. Calendar2.create = function(ecModel, api) {
  3459. var calendarList = [];
  3460. ecModel.eachComponent("calendar", function(calendarModel) {
  3461. var calendar = new Calendar2(calendarModel, ecModel, api);
  3462. calendarList.push(calendar);
  3463. calendarModel.coordinateSystem = calendar;
  3464. });
  3465. ecModel.eachSeries(function(calendarSeries) {
  3466. if (calendarSeries.get("coordinateSystem") === "calendar") {
  3467. calendarSeries.coordinateSystem = calendarList[calendarSeries.get("calendarIndex") || 0];
  3468. }
  3469. });
  3470. return calendarList;
  3471. };
  3472. Calendar2.dimensions = ["time", "value"];
  3473. return Calendar2;
  3474. }();
  3475. function getCoordSys3(finder) {
  3476. var calendarModel = finder.calendarModel;
  3477. var seriesModel = finder.seriesModel;
  3478. var coordSys = calendarModel ? calendarModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem : null;
  3479. return coordSys;
  3480. }
  3481. var Calendar_default = Calendar;
  3482. // node_modules/echarts/lib/component/calendar/install.js
  3483. function install9(registers) {
  3484. registers.registerComponentModel(CalendarModel_default);
  3485. registers.registerComponentView(CalendarView_default);
  3486. registers.registerCoordinateSystem("calendar", Calendar_default);
  3487. }
  3488. // node_modules/echarts/lib/component/graphic/install.js
  3489. init_define_APP_INFO();
  3490. // node_modules/echarts/lib/component/graphic/GraphicModel.js
  3491. init_define_APP_INFO();
  3492. function setKeyInfoToNewElOption(resultItem, newElOption) {
  3493. var existElOption = resultItem.existing;
  3494. newElOption.id = resultItem.keyInfo.id;
  3495. !newElOption.type && existElOption && (newElOption.type = existElOption.type);
  3496. if (newElOption.parentId == null) {
  3497. var newElParentOption = newElOption.parentOption;
  3498. if (newElParentOption) {
  3499. newElOption.parentId = newElParentOption.id;
  3500. } else if (existElOption) {
  3501. newElOption.parentId = existElOption.parentId;
  3502. }
  3503. }
  3504. newElOption.parentOption = null;
  3505. }
  3506. function isSetLoc(obj, props) {
  3507. var isSet;
  3508. each(props, function(prop) {
  3509. obj[prop] != null && obj[prop] !== "auto" && (isSet = true);
  3510. });
  3511. return isSet;
  3512. }
  3513. function mergeNewElOptionToExist(existList, index, newElOption) {
  3514. var newElOptCopy = extend({}, newElOption);
  3515. var existElOption = existList[index];
  3516. var $action = newElOption.$action || "merge";
  3517. if ($action === "merge") {
  3518. if (existElOption) {
  3519. if (true) {
  3520. var newType = newElOption.type;
  3521. assert(!newType || existElOption.type === newType, 'Please set $action: "replace" to change `type`');
  3522. }
  3523. merge(existElOption, newElOptCopy, true);
  3524. mergeLayoutParam(existElOption, newElOptCopy, {
  3525. ignoreSize: true
  3526. });
  3527. copyLayoutParams(newElOption, existElOption);
  3528. copyTransitionInfo(newElOption, existElOption);
  3529. copyTransitionInfo(newElOption, existElOption, "shape");
  3530. copyTransitionInfo(newElOption, existElOption, "style");
  3531. copyTransitionInfo(newElOption, existElOption, "extra");
  3532. newElOption.clipPath = existElOption.clipPath;
  3533. } else {
  3534. existList[index] = newElOptCopy;
  3535. }
  3536. } else if ($action === "replace") {
  3537. existList[index] = newElOptCopy;
  3538. } else if ($action === "remove") {
  3539. existElOption && (existList[index] = null);
  3540. }
  3541. }
  3542. var TRANSITION_PROPS_TO_COPY = ["transition", "enterFrom", "leaveTo"];
  3543. var ROOT_TRANSITION_PROPS_TO_COPY = TRANSITION_PROPS_TO_COPY.concat(["enterAnimation", "updateAnimation", "leaveAnimation"]);
  3544. function copyTransitionInfo(target, source, targetProp) {
  3545. if (targetProp) {
  3546. if (!target[targetProp] && source[targetProp]) {
  3547. target[targetProp] = {};
  3548. }
  3549. target = target[targetProp];
  3550. source = source[targetProp];
  3551. }
  3552. if (!target || !source) {
  3553. return;
  3554. }
  3555. var props = targetProp ? TRANSITION_PROPS_TO_COPY : ROOT_TRANSITION_PROPS_TO_COPY;
  3556. for (var i = 0; i < props.length; i++) {
  3557. var prop = props[i];
  3558. if (target[prop] == null && source[prop] != null) {
  3559. target[prop] = source[prop];
  3560. }
  3561. }
  3562. }
  3563. function setLayoutInfoToExist(existItem, newElOption) {
  3564. if (!existItem) {
  3565. return;
  3566. }
  3567. existItem.hv = newElOption.hv = [
  3568. isSetLoc(newElOption, ["left", "right"]),
  3569. isSetLoc(newElOption, ["top", "bottom"])
  3570. ];
  3571. if (existItem.type === "group") {
  3572. var existingGroupOpt = existItem;
  3573. var newGroupOpt = newElOption;
  3574. existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0);
  3575. existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0);
  3576. }
  3577. }
  3578. var GraphicComponentModel = function(_super) {
  3579. __extends(GraphicComponentModel2, _super);
  3580. function GraphicComponentModel2() {
  3581. var _this = _super !== null && _super.apply(this, arguments) || this;
  3582. _this.type = GraphicComponentModel2.type;
  3583. _this.preventAutoZ = true;
  3584. return _this;
  3585. }
  3586. GraphicComponentModel2.prototype.mergeOption = function(option, ecModel) {
  3587. var elements = this.option.elements;
  3588. this.option.elements = null;
  3589. _super.prototype.mergeOption.call(this, option, ecModel);
  3590. this.option.elements = elements;
  3591. };
  3592. GraphicComponentModel2.prototype.optionUpdated = function(newOption, isInit) {
  3593. var thisOption = this.option;
  3594. var newList = (isInit ? thisOption : newOption).elements;
  3595. var existList = thisOption.elements = isInit ? [] : thisOption.elements;
  3596. var flattenedList = [];
  3597. this._flatten(newList, flattenedList, null);
  3598. var mappingResult = mappingToExists(existList, flattenedList, "normalMerge");
  3599. var elOptionsToUpdate = this._elOptionsToUpdate = [];
  3600. each(mappingResult, function(resultItem, index) {
  3601. var newElOption = resultItem.newOption;
  3602. if (true) {
  3603. assert(isObject(newElOption) || resultItem.existing, "Empty graphic option definition");
  3604. }
  3605. if (!newElOption) {
  3606. return;
  3607. }
  3608. elOptionsToUpdate.push(newElOption);
  3609. setKeyInfoToNewElOption(resultItem, newElOption);
  3610. mergeNewElOptionToExist(existList, index, newElOption);
  3611. setLayoutInfoToExist(existList[index], newElOption);
  3612. }, this);
  3613. thisOption.elements = filter(existList, function(item) {
  3614. item && delete item.$action;
  3615. return item != null;
  3616. });
  3617. };
  3618. GraphicComponentModel2.prototype._flatten = function(optionList, result, parentOption) {
  3619. each(optionList, function(option) {
  3620. if (!option) {
  3621. return;
  3622. }
  3623. if (parentOption) {
  3624. option.parentOption = parentOption;
  3625. }
  3626. result.push(option);
  3627. var children = option.children;
  3628. if (children && children.length) {
  3629. this._flatten(children, result, option);
  3630. }
  3631. delete option.children;
  3632. }, this);
  3633. };
  3634. GraphicComponentModel2.prototype.useElOptionsToUpdate = function() {
  3635. var els = this._elOptionsToUpdate;
  3636. this._elOptionsToUpdate = null;
  3637. return els;
  3638. };
  3639. GraphicComponentModel2.type = "graphic";
  3640. GraphicComponentModel2.defaultOption = {
  3641. elements: []
  3642. };
  3643. return GraphicComponentModel2;
  3644. }(Component_default);
  3645. // node_modules/echarts/lib/component/graphic/GraphicView.js
  3646. init_define_APP_INFO();
  3647. var nonShapeGraphicElements = {
  3648. path: null,
  3649. compoundPath: null,
  3650. group: Group_default,
  3651. image: Image_default,
  3652. text: Text_default
  3653. };
  3654. var inner5 = makeInner();
  3655. var GraphicComponentView = function(_super) {
  3656. __extends(GraphicComponentView2, _super);
  3657. function GraphicComponentView2() {
  3658. var _this = _super !== null && _super.apply(this, arguments) || this;
  3659. _this.type = GraphicComponentView2.type;
  3660. return _this;
  3661. }
  3662. GraphicComponentView2.prototype.init = function() {
  3663. this._elMap = createHashMap();
  3664. };
  3665. GraphicComponentView2.prototype.render = function(graphicModel, ecModel, api) {
  3666. if (graphicModel !== this._lastGraphicModel) {
  3667. this._clear();
  3668. }
  3669. this._lastGraphicModel = graphicModel;
  3670. this._updateElements(graphicModel);
  3671. this._relocate(graphicModel, api);
  3672. };
  3673. GraphicComponentView2.prototype._updateElements = function(graphicModel) {
  3674. var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();
  3675. if (!elOptionsToUpdate) {
  3676. return;
  3677. }
  3678. var elMap = this._elMap;
  3679. var rootGroup = this.group;
  3680. var globalZ = graphicModel.get("z");
  3681. var globalZLevel = graphicModel.get("zlevel");
  3682. each(elOptionsToUpdate, function(elOption) {
  3683. var id = convertOptionIdName(elOption.id, null);
  3684. var elExisting = id != null ? elMap.get(id) : null;
  3685. var parentId = convertOptionIdName(elOption.parentId, null);
  3686. var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup;
  3687. var elType = elOption.type;
  3688. var elOptionStyle = elOption.style;
  3689. if (elType === "text" && elOptionStyle) {
  3690. if (elOption.hv && elOption.hv[1]) {
  3691. elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = elOptionStyle.verticalAlign = elOptionStyle.align = null;
  3692. }
  3693. }
  3694. var textContentOption = elOption.textContent;
  3695. var textConfig = elOption.textConfig;
  3696. if (elOptionStyle && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) {
  3697. var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true);
  3698. if (!textConfig && convertResult.textConfig) {
  3699. textConfig = elOption.textConfig = convertResult.textConfig;
  3700. }
  3701. if (!textContentOption && convertResult.textContent) {
  3702. textContentOption = convertResult.textContent;
  3703. }
  3704. }
  3705. var elOptionCleaned = getCleanedElOption(elOption);
  3706. if (true) {
  3707. elExisting && assert(targetElParent === elExisting.parent, "Changing parent is not supported.");
  3708. }
  3709. var $action = elOption.$action || "merge";
  3710. var isMerge = $action === "merge";
  3711. var isReplace = $action === "replace";
  3712. if (isMerge) {
  3713. var isInit = !elExisting;
  3714. var el_1 = elExisting;
  3715. if (isInit) {
  3716. el_1 = createEl(id, targetElParent, elOption.type, elMap);
  3717. } else {
  3718. el_1 && (inner5(el_1).isNew = false);
  3719. stopPreviousKeyframeAnimationAndRestore(el_1);
  3720. }
  3721. if (el_1) {
  3722. applyUpdateTransition(el_1, elOptionCleaned, graphicModel, {
  3723. isInit
  3724. });
  3725. updateCommonAttrs(el_1, elOption, globalZ, globalZLevel);
  3726. }
  3727. } else if (isReplace) {
  3728. removeEl(elExisting, elOption, elMap, graphicModel);
  3729. var el_2 = createEl(id, targetElParent, elOption.type, elMap);
  3730. if (el_2) {
  3731. applyUpdateTransition(el_2, elOptionCleaned, graphicModel, {
  3732. isInit: true
  3733. });
  3734. updateCommonAttrs(el_2, elOption, globalZ, globalZLevel);
  3735. }
  3736. } else if ($action === "remove") {
  3737. updateLeaveTo(elExisting, elOption);
  3738. removeEl(elExisting, elOption, elMap, graphicModel);
  3739. }
  3740. var el = elMap.get(id);
  3741. if (el && textContentOption) {
  3742. if (isMerge) {
  3743. var textContentExisting = el.getTextContent();
  3744. textContentExisting ? textContentExisting.attr(textContentOption) : el.setTextContent(new Text_default(textContentOption));
  3745. } else if (isReplace) {
  3746. el.setTextContent(new Text_default(textContentOption));
  3747. }
  3748. }
  3749. if (el) {
  3750. var clipPathOption = elOption.clipPath;
  3751. if (clipPathOption) {
  3752. var clipPathType = clipPathOption.type;
  3753. var clipPath = void 0;
  3754. var isInit = false;
  3755. if (isMerge) {
  3756. var oldClipPath = el.getClipPath();
  3757. isInit = !oldClipPath || inner5(oldClipPath).type !== clipPathType;
  3758. clipPath = isInit ? newEl(clipPathType) : oldClipPath;
  3759. } else if (isReplace) {
  3760. isInit = true;
  3761. clipPath = newEl(clipPathType);
  3762. }
  3763. el.setClipPath(clipPath);
  3764. applyUpdateTransition(clipPath, clipPathOption, graphicModel, {
  3765. isInit
  3766. });
  3767. applyKeyframeAnimation(clipPath, clipPathOption.keyframeAnimation, graphicModel);
  3768. }
  3769. var elInner = inner5(el);
  3770. el.setTextConfig(textConfig);
  3771. elInner.option = elOption;
  3772. setEventData(el, graphicModel, elOption);
  3773. setTooltipConfig({
  3774. el,
  3775. componentModel: graphicModel,
  3776. itemName: el.name,
  3777. itemTooltipOption: elOption.tooltip
  3778. });
  3779. applyKeyframeAnimation(el, elOption.keyframeAnimation, graphicModel);
  3780. }
  3781. });
  3782. };
  3783. GraphicComponentView2.prototype._relocate = function(graphicModel, api) {
  3784. var elOptions = graphicModel.option.elements;
  3785. var rootGroup = this.group;
  3786. var elMap = this._elMap;
  3787. var apiWidth = api.getWidth();
  3788. var apiHeight = api.getHeight();
  3789. var xy = ["x", "y"];
  3790. for (var i = 0; i < elOptions.length; i++) {
  3791. var elOption = elOptions[i];
  3792. var id = convertOptionIdName(elOption.id, null);
  3793. var el = id != null ? elMap.get(id) : null;
  3794. if (!el || !el.isGroup) {
  3795. continue;
  3796. }
  3797. var parentEl = el.parent;
  3798. var isParentRoot = parentEl === rootGroup;
  3799. var elInner = inner5(el);
  3800. var parentElInner = inner5(parentEl);
  3801. elInner.width = parsePercent2(elInner.option.width, isParentRoot ? apiWidth : parentElInner.width) || 0;
  3802. elInner.height = parsePercent2(elInner.option.height, isParentRoot ? apiHeight : parentElInner.height) || 0;
  3803. }
  3804. for (var i = elOptions.length - 1; i >= 0; i--) {
  3805. var elOption = elOptions[i];
  3806. var id = convertOptionIdName(elOption.id, null);
  3807. var el = id != null ? elMap.get(id) : null;
  3808. if (!el) {
  3809. continue;
  3810. }
  3811. var parentEl = el.parent;
  3812. var parentElInner = inner5(parentEl);
  3813. var containerInfo = parentEl === rootGroup ? {
  3814. width: apiWidth,
  3815. height: apiHeight
  3816. } : {
  3817. width: parentElInner.width,
  3818. height: parentElInner.height
  3819. };
  3820. var layoutPos = {};
  3821. var layouted = positionElement(el, elOption, containerInfo, null, {
  3822. hv: elOption.hv,
  3823. boundingMode: elOption.bounding
  3824. }, layoutPos);
  3825. if (!inner5(el).isNew && layouted) {
  3826. var transition = elOption.transition;
  3827. var animatePos = {};
  3828. for (var k = 0; k < xy.length; k++) {
  3829. var key = xy[k];
  3830. var val = layoutPos[key];
  3831. if (transition && (isTransitionAll(transition) || indexOf(transition, key) >= 0)) {
  3832. animatePos[key] = val;
  3833. } else {
  3834. el[key] = val;
  3835. }
  3836. }
  3837. updateProps(el, animatePos, graphicModel, 0);
  3838. } else {
  3839. el.attr(layoutPos);
  3840. }
  3841. }
  3842. };
  3843. GraphicComponentView2.prototype._clear = function() {
  3844. var _this = this;
  3845. var elMap = this._elMap;
  3846. elMap.each(function(el) {
  3847. removeEl(el, inner5(el).option, elMap, _this._lastGraphicModel);
  3848. });
  3849. this._elMap = createHashMap();
  3850. };
  3851. GraphicComponentView2.prototype.dispose = function() {
  3852. this._clear();
  3853. };
  3854. GraphicComponentView2.type = "graphic";
  3855. return GraphicComponentView2;
  3856. }(Component_default2);
  3857. function newEl(graphicType) {
  3858. if (true) {
  3859. assert(graphicType, "graphic type MUST be set");
  3860. }
  3861. var Clz = hasOwn(nonShapeGraphicElements, graphicType) ? nonShapeGraphicElements[graphicType] : getShapeClass(graphicType);
  3862. if (true) {
  3863. assert(Clz, "graphic type " + graphicType + " can not be found");
  3864. }
  3865. var el = new Clz({});
  3866. inner5(el).type = graphicType;
  3867. return el;
  3868. }
  3869. function createEl(id, targetElParent, graphicType, elMap) {
  3870. var el = newEl(graphicType);
  3871. targetElParent.add(el);
  3872. elMap.set(id, el);
  3873. inner5(el).id = id;
  3874. inner5(el).isNew = true;
  3875. return el;
  3876. }
  3877. function removeEl(elExisting, elOption, elMap, graphicModel) {
  3878. var existElParent = elExisting && elExisting.parent;
  3879. if (existElParent) {
  3880. elExisting.type === "group" && elExisting.traverse(function(el) {
  3881. removeEl(el, elOption, elMap, graphicModel);
  3882. });
  3883. applyLeaveTransition(elExisting, elOption, graphicModel);
  3884. elMap.removeKey(inner5(elExisting).id);
  3885. }
  3886. }
  3887. function updateCommonAttrs(el, elOption, defaultZ, defaultZlevel) {
  3888. if (!el.isGroup) {
  3889. each([
  3890. ["cursor", Displayable_default.prototype.cursor],
  3891. ["zlevel", defaultZlevel || 0],
  3892. ["z", defaultZ || 0],
  3893. ["z2", 0]
  3894. ], function(item) {
  3895. var prop = item[0];
  3896. if (hasOwn(elOption, prop)) {
  3897. el[prop] = retrieve2(elOption[prop], item[1]);
  3898. } else if (el[prop] == null) {
  3899. el[prop] = item[1];
  3900. }
  3901. });
  3902. }
  3903. each(keys(elOption), function(key) {
  3904. if (key.indexOf("on") === 0) {
  3905. var val = elOption[key];
  3906. el[key] = isFunction(val) ? val : null;
  3907. }
  3908. });
  3909. if (hasOwn(elOption, "draggable")) {
  3910. el.draggable = elOption.draggable;
  3911. }
  3912. elOption.name != null && (el.name = elOption.name);
  3913. elOption.id != null && (el.id = elOption.id);
  3914. }
  3915. function getCleanedElOption(elOption) {
  3916. elOption = extend({}, elOption);
  3917. each(["id", "parentId", "$action", "hv", "bounding", "textContent", "clipPath"].concat(LOCATION_PARAMS), function(name) {
  3918. delete elOption[name];
  3919. });
  3920. return elOption;
  3921. }
  3922. function setEventData(el, graphicModel, elOption) {
  3923. var eventData = getECData(el).eventData;
  3924. if (!el.silent && !el.ignore && !eventData) {
  3925. eventData = getECData(el).eventData = {
  3926. componentType: "graphic",
  3927. componentIndex: graphicModel.componentIndex,
  3928. name: el.name
  3929. };
  3930. }
  3931. if (eventData) {
  3932. eventData.info = elOption.info;
  3933. }
  3934. }
  3935. // node_modules/echarts/lib/component/graphic/install.js
  3936. function install10(registers) {
  3937. registers.registerComponentModel(GraphicComponentModel);
  3938. registers.registerComponentView(GraphicComponentView);
  3939. registers.registerPreprocessor(function(option) {
  3940. var graphicOption = option.graphic;
  3941. if (isArray(graphicOption)) {
  3942. if (!graphicOption[0] || !graphicOption[0].elements) {
  3943. option.graphic = [{
  3944. elements: graphicOption
  3945. }];
  3946. } else {
  3947. option.graphic = [option.graphic[0]];
  3948. }
  3949. } else if (graphicOption && !graphicOption.elements) {
  3950. option.graphic = [{
  3951. elements: [graphicOption]
  3952. }];
  3953. }
  3954. });
  3955. }
  3956. // node_modules/echarts/lib/component/toolbox/install.js
  3957. init_define_APP_INFO();
  3958. // node_modules/echarts/lib/component/dataZoom/installDataZoomSelect.js
  3959. init_define_APP_INFO();
  3960. // node_modules/echarts/lib/component/dataZoom/SelectZoomModel.js
  3961. init_define_APP_INFO();
  3962. // node_modules/echarts/lib/component/dataZoom/DataZoomModel.js
  3963. init_define_APP_INFO();
  3964. // node_modules/echarts/lib/component/dataZoom/helper.js
  3965. init_define_APP_INFO();
  3966. var DATA_ZOOM_AXIS_DIMENSIONS = ["x", "y", "radius", "angle", "single"];
  3967. var SERIES_COORDS = ["cartesian2d", "polar", "singleAxis"];
  3968. function isCoordSupported(seriesModel) {
  3969. var coordType = seriesModel.get("coordinateSystem");
  3970. return indexOf(SERIES_COORDS, coordType) >= 0;
  3971. }
  3972. function getAxisMainType(axisDim) {
  3973. if (true) {
  3974. assert(axisDim);
  3975. }
  3976. return axisDim + "Axis";
  3977. }
  3978. function findEffectedDataZooms(ecModel, payload) {
  3979. var axisRecords = createHashMap();
  3980. var effectedModels = [];
  3981. var effectedModelMap = createHashMap();
  3982. ecModel.eachComponent({
  3983. mainType: "dataZoom",
  3984. query: payload
  3985. }, function(dataZoomModel) {
  3986. if (!effectedModelMap.get(dataZoomModel.uid)) {
  3987. addToEffected(dataZoomModel);
  3988. }
  3989. });
  3990. var foundNewLink;
  3991. do {
  3992. foundNewLink = false;
  3993. ecModel.eachComponent("dataZoom", processSingle);
  3994. } while (foundNewLink);
  3995. function processSingle(dataZoomModel) {
  3996. if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) {
  3997. addToEffected(dataZoomModel);
  3998. foundNewLink = true;
  3999. }
  4000. }
  4001. function addToEffected(dataZoom) {
  4002. effectedModelMap.set(dataZoom.uid, true);
  4003. effectedModels.push(dataZoom);
  4004. markAxisControlled(dataZoom);
  4005. }
  4006. function isLinked(dataZoomModel) {
  4007. var isLink = false;
  4008. dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
  4009. var axisIdxArr = axisRecords.get(axisDim);
  4010. if (axisIdxArr && axisIdxArr[axisIndex]) {
  4011. isLink = true;
  4012. }
  4013. });
  4014. return isLink;
  4015. }
  4016. function markAxisControlled(dataZoomModel) {
  4017. dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
  4018. (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true;
  4019. });
  4020. }
  4021. return effectedModels;
  4022. }
  4023. function collectReferCoordSysModelInfo(dataZoomModel) {
  4024. var ecModel = dataZoomModel.ecModel;
  4025. var coordSysInfoWrap = {
  4026. infoList: [],
  4027. infoMap: createHashMap()
  4028. };
  4029. dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
  4030. var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);
  4031. if (!axisModel) {
  4032. return;
  4033. }
  4034. var coordSysModel = axisModel.getCoordSysModel();
  4035. if (!coordSysModel) {
  4036. return;
  4037. }
  4038. var coordSysUid = coordSysModel.uid;
  4039. var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid);
  4040. if (!coordSysInfo) {
  4041. coordSysInfo = {
  4042. model: coordSysModel,
  4043. axisModels: []
  4044. };
  4045. coordSysInfoWrap.infoList.push(coordSysInfo);
  4046. coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo);
  4047. }
  4048. coordSysInfo.axisModels.push(axisModel);
  4049. });
  4050. return coordSysInfoWrap;
  4051. }
  4052. // node_modules/echarts/lib/component/dataZoom/DataZoomModel.js
  4053. var DataZoomAxisInfo = function() {
  4054. function DataZoomAxisInfo2() {
  4055. this.indexList = [];
  4056. this.indexMap = [];
  4057. }
  4058. DataZoomAxisInfo2.prototype.add = function(axisCmptIdx) {
  4059. if (!this.indexMap[axisCmptIdx]) {
  4060. this.indexList.push(axisCmptIdx);
  4061. this.indexMap[axisCmptIdx] = true;
  4062. }
  4063. };
  4064. return DataZoomAxisInfo2;
  4065. }();
  4066. var DataZoomModel = function(_super) {
  4067. __extends(DataZoomModel2, _super);
  4068. function DataZoomModel2() {
  4069. var _this = _super !== null && _super.apply(this, arguments) || this;
  4070. _this.type = DataZoomModel2.type;
  4071. _this._autoThrottle = true;
  4072. _this._noTarget = true;
  4073. _this._rangePropMode = ["percent", "percent"];
  4074. return _this;
  4075. }
  4076. DataZoomModel2.prototype.init = function(option, parentModel, ecModel) {
  4077. var inputRawOption = retrieveRawOption(option);
  4078. this.settledOption = inputRawOption;
  4079. this.mergeDefaultAndTheme(option, ecModel);
  4080. this._doInit(inputRawOption);
  4081. };
  4082. DataZoomModel2.prototype.mergeOption = function(newOption) {
  4083. var inputRawOption = retrieveRawOption(newOption);
  4084. merge(this.option, newOption, true);
  4085. merge(this.settledOption, inputRawOption, true);
  4086. this._doInit(inputRawOption);
  4087. };
  4088. DataZoomModel2.prototype._doInit = function(inputRawOption) {
  4089. var thisOption = this.option;
  4090. this._setDefaultThrottle(inputRawOption);
  4091. this._updateRangeUse(inputRawOption);
  4092. var settledOption = this.settledOption;
  4093. each([["start", "startValue"], ["end", "endValue"]], function(names, index) {
  4094. if (this._rangePropMode[index] === "value") {
  4095. thisOption[names[0]] = settledOption[names[0]] = null;
  4096. }
  4097. }, this);
  4098. this._resetTarget();
  4099. };
  4100. DataZoomModel2.prototype._resetTarget = function() {
  4101. var optionOrient = this.get("orient", true);
  4102. var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap();
  4103. var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap);
  4104. if (hasAxisSpecified) {
  4105. this._orient = optionOrient || this._makeAutoOrientByTargetAxis();
  4106. } else {
  4107. this._orient = optionOrient || "horizontal";
  4108. this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient);
  4109. }
  4110. this._noTarget = true;
  4111. targetAxisIndexMap.each(function(axisInfo) {
  4112. if (axisInfo.indexList.length) {
  4113. this._noTarget = false;
  4114. }
  4115. }, this);
  4116. };
  4117. DataZoomModel2.prototype._fillSpecifiedTargetAxis = function(targetAxisIndexMap) {
  4118. var hasAxisSpecified = false;
  4119. each(DATA_ZOOM_AXIS_DIMENSIONS, function(axisDim) {
  4120. var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING);
  4121. if (!refering.specified) {
  4122. return;
  4123. }
  4124. hasAxisSpecified = true;
  4125. var axisInfo = new DataZoomAxisInfo();
  4126. each(refering.models, function(axisModel) {
  4127. axisInfo.add(axisModel.componentIndex);
  4128. });
  4129. targetAxisIndexMap.set(axisDim, axisInfo);
  4130. }, this);
  4131. return hasAxisSpecified;
  4132. };
  4133. DataZoomModel2.prototype._fillAutoTargetAxisByOrient = function(targetAxisIndexMap, orient) {
  4134. var ecModel = this.ecModel;
  4135. var needAuto = true;
  4136. if (needAuto) {
  4137. var axisDim = orient === "vertical" ? "y" : "x";
  4138. var axisModels = ecModel.findComponents({
  4139. mainType: axisDim + "Axis"
  4140. });
  4141. setParallelAxis(axisModels, axisDim);
  4142. }
  4143. if (needAuto) {
  4144. var axisModels = ecModel.findComponents({
  4145. mainType: "singleAxis",
  4146. filter: function(axisModel) {
  4147. return axisModel.get("orient", true) === orient;
  4148. }
  4149. });
  4150. setParallelAxis(axisModels, "single");
  4151. }
  4152. function setParallelAxis(axisModels2, axisDim2) {
  4153. var axisModel = axisModels2[0];
  4154. if (!axisModel) {
  4155. return;
  4156. }
  4157. var axisInfo = new DataZoomAxisInfo();
  4158. axisInfo.add(axisModel.componentIndex);
  4159. targetAxisIndexMap.set(axisDim2, axisInfo);
  4160. needAuto = false;
  4161. if (axisDim2 === "x" || axisDim2 === "y") {
  4162. var gridModel_1 = axisModel.getReferringComponents("grid", SINGLE_REFERRING).models[0];
  4163. gridModel_1 && each(axisModels2, function(axModel) {
  4164. if (axisModel.componentIndex !== axModel.componentIndex && gridModel_1 === axModel.getReferringComponents("grid", SINGLE_REFERRING).models[0]) {
  4165. axisInfo.add(axModel.componentIndex);
  4166. }
  4167. });
  4168. }
  4169. }
  4170. if (needAuto) {
  4171. each(DATA_ZOOM_AXIS_DIMENSIONS, function(axisDim2) {
  4172. if (!needAuto) {
  4173. return;
  4174. }
  4175. var axisModels2 = ecModel.findComponents({
  4176. mainType: getAxisMainType(axisDim2),
  4177. filter: function(axisModel) {
  4178. return axisModel.get("type", true) === "category";
  4179. }
  4180. });
  4181. if (axisModels2[0]) {
  4182. var axisInfo = new DataZoomAxisInfo();
  4183. axisInfo.add(axisModels2[0].componentIndex);
  4184. targetAxisIndexMap.set(axisDim2, axisInfo);
  4185. needAuto = false;
  4186. }
  4187. }, this);
  4188. }
  4189. };
  4190. DataZoomModel2.prototype._makeAutoOrientByTargetAxis = function() {
  4191. var dim;
  4192. this.eachTargetAxis(function(axisDim) {
  4193. !dim && (dim = axisDim);
  4194. }, this);
  4195. return dim === "y" ? "vertical" : "horizontal";
  4196. };
  4197. DataZoomModel2.prototype._setDefaultThrottle = function(inputRawOption) {
  4198. if (inputRawOption.hasOwnProperty("throttle")) {
  4199. this._autoThrottle = false;
  4200. }
  4201. if (this._autoThrottle) {
  4202. var globalOption = this.ecModel.option;
  4203. this.option.throttle = globalOption.animation && globalOption.animationDurationUpdate > 0 ? 100 : 20;
  4204. }
  4205. };
  4206. DataZoomModel2.prototype._updateRangeUse = function(inputRawOption) {
  4207. var rangePropMode = this._rangePropMode;
  4208. var rangeModeInOption = this.get("rangeMode");
  4209. each([["start", "startValue"], ["end", "endValue"]], function(names, index) {
  4210. var percentSpecified = inputRawOption[names[0]] != null;
  4211. var valueSpecified = inputRawOption[names[1]] != null;
  4212. if (percentSpecified && !valueSpecified) {
  4213. rangePropMode[index] = "percent";
  4214. } else if (!percentSpecified && valueSpecified) {
  4215. rangePropMode[index] = "value";
  4216. } else if (rangeModeInOption) {
  4217. rangePropMode[index] = rangeModeInOption[index];
  4218. } else if (percentSpecified) {
  4219. rangePropMode[index] = "percent";
  4220. }
  4221. });
  4222. };
  4223. DataZoomModel2.prototype.noTarget = function() {
  4224. return this._noTarget;
  4225. };
  4226. DataZoomModel2.prototype.getFirstTargetAxisModel = function() {
  4227. var firstAxisModel;
  4228. this.eachTargetAxis(function(axisDim, axisIndex) {
  4229. if (firstAxisModel == null) {
  4230. firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);
  4231. }
  4232. }, this);
  4233. return firstAxisModel;
  4234. };
  4235. DataZoomModel2.prototype.eachTargetAxis = function(callback, context) {
  4236. this._targetAxisInfoMap.each(function(axisInfo, axisDim) {
  4237. each(axisInfo.indexList, function(axisIndex) {
  4238. callback.call(context, axisDim, axisIndex);
  4239. });
  4240. });
  4241. };
  4242. DataZoomModel2.prototype.getAxisProxy = function(axisDim, axisIndex) {
  4243. var axisModel = this.getAxisModel(axisDim, axisIndex);
  4244. if (axisModel) {
  4245. return axisModel.__dzAxisProxy;
  4246. }
  4247. };
  4248. DataZoomModel2.prototype.getAxisModel = function(axisDim, axisIndex) {
  4249. if (true) {
  4250. assert(axisDim && axisIndex != null);
  4251. }
  4252. var axisInfo = this._targetAxisInfoMap.get(axisDim);
  4253. if (axisInfo && axisInfo.indexMap[axisIndex]) {
  4254. return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);
  4255. }
  4256. };
  4257. DataZoomModel2.prototype.setRawRange = function(opt) {
  4258. var thisOption = this.option;
  4259. var settledOption = this.settledOption;
  4260. each([["start", "startValue"], ["end", "endValue"]], function(names) {
  4261. if (opt[names[0]] != null || opt[names[1]] != null) {
  4262. thisOption[names[0]] = settledOption[names[0]] = opt[names[0]];
  4263. thisOption[names[1]] = settledOption[names[1]] = opt[names[1]];
  4264. }
  4265. }, this);
  4266. this._updateRangeUse(opt);
  4267. };
  4268. DataZoomModel2.prototype.setCalculatedRange = function(opt) {
  4269. var option = this.option;
  4270. each(["start", "startValue", "end", "endValue"], function(name) {
  4271. option[name] = opt[name];
  4272. });
  4273. };
  4274. DataZoomModel2.prototype.getPercentRange = function() {
  4275. var axisProxy = this.findRepresentativeAxisProxy();
  4276. if (axisProxy) {
  4277. return axisProxy.getDataPercentWindow();
  4278. }
  4279. };
  4280. DataZoomModel2.prototype.getValueRange = function(axisDim, axisIndex) {
  4281. if (axisDim == null && axisIndex == null) {
  4282. var axisProxy = this.findRepresentativeAxisProxy();
  4283. if (axisProxy) {
  4284. return axisProxy.getDataValueWindow();
  4285. }
  4286. } else {
  4287. return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow();
  4288. }
  4289. };
  4290. DataZoomModel2.prototype.findRepresentativeAxisProxy = function(axisModel) {
  4291. if (axisModel) {
  4292. return axisModel.__dzAxisProxy;
  4293. }
  4294. var firstProxy;
  4295. var axisDimList = this._targetAxisInfoMap.keys();
  4296. for (var i = 0; i < axisDimList.length; i++) {
  4297. var axisDim = axisDimList[i];
  4298. var axisInfo = this._targetAxisInfoMap.get(axisDim);
  4299. for (var j = 0; j < axisInfo.indexList.length; j++) {
  4300. var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]);
  4301. if (proxy.hostedBy(this)) {
  4302. return proxy;
  4303. }
  4304. if (!firstProxy) {
  4305. firstProxy = proxy;
  4306. }
  4307. }
  4308. }
  4309. return firstProxy;
  4310. };
  4311. DataZoomModel2.prototype.getRangePropMode = function() {
  4312. return this._rangePropMode.slice();
  4313. };
  4314. DataZoomModel2.prototype.getOrient = function() {
  4315. if (true) {
  4316. assert(this._orient);
  4317. }
  4318. return this._orient;
  4319. };
  4320. DataZoomModel2.type = "dataZoom";
  4321. DataZoomModel2.dependencies = ["xAxis", "yAxis", "radiusAxis", "angleAxis", "singleAxis", "series", "toolbox"];
  4322. DataZoomModel2.defaultOption = {
  4323. z: 4,
  4324. filterMode: "filter",
  4325. start: 0,
  4326. end: 100
  4327. };
  4328. return DataZoomModel2;
  4329. }(Component_default);
  4330. function retrieveRawOption(option) {
  4331. var ret = {};
  4332. each(["start", "end", "startValue", "endValue", "throttle"], function(name) {
  4333. option.hasOwnProperty(name) && (ret[name] = option[name]);
  4334. });
  4335. return ret;
  4336. }
  4337. var DataZoomModel_default = DataZoomModel;
  4338. // node_modules/echarts/lib/component/dataZoom/SelectZoomModel.js
  4339. var SelectDataZoomModel = function(_super) {
  4340. __extends(SelectDataZoomModel2, _super);
  4341. function SelectDataZoomModel2() {
  4342. var _this = _super !== null && _super.apply(this, arguments) || this;
  4343. _this.type = SelectDataZoomModel2.type;
  4344. return _this;
  4345. }
  4346. SelectDataZoomModel2.type = "dataZoom.select";
  4347. return SelectDataZoomModel2;
  4348. }(DataZoomModel_default);
  4349. var SelectZoomModel_default = SelectDataZoomModel;
  4350. // node_modules/echarts/lib/component/dataZoom/SelectZoomView.js
  4351. init_define_APP_INFO();
  4352. // node_modules/echarts/lib/component/dataZoom/DataZoomView.js
  4353. init_define_APP_INFO();
  4354. var DataZoomView = function(_super) {
  4355. __extends(DataZoomView2, _super);
  4356. function DataZoomView2() {
  4357. var _this = _super !== null && _super.apply(this, arguments) || this;
  4358. _this.type = DataZoomView2.type;
  4359. return _this;
  4360. }
  4361. DataZoomView2.prototype.render = function(dataZoomModel, ecModel, api, payload) {
  4362. this.dataZoomModel = dataZoomModel;
  4363. this.ecModel = ecModel;
  4364. this.api = api;
  4365. };
  4366. DataZoomView2.type = "dataZoom";
  4367. return DataZoomView2;
  4368. }(Component_default2);
  4369. var DataZoomView_default = DataZoomView;
  4370. // node_modules/echarts/lib/component/dataZoom/SelectZoomView.js
  4371. var SelectDataZoomView = function(_super) {
  4372. __extends(SelectDataZoomView2, _super);
  4373. function SelectDataZoomView2() {
  4374. var _this = _super !== null && _super.apply(this, arguments) || this;
  4375. _this.type = SelectDataZoomView2.type;
  4376. return _this;
  4377. }
  4378. SelectDataZoomView2.type = "dataZoom.select";
  4379. return SelectDataZoomView2;
  4380. }(DataZoomView_default);
  4381. var SelectZoomView_default = SelectDataZoomView;
  4382. // node_modules/echarts/lib/component/dataZoom/installCommon.js
  4383. init_define_APP_INFO();
  4384. // node_modules/echarts/lib/component/dataZoom/dataZoomProcessor.js
  4385. init_define_APP_INFO();
  4386. // node_modules/echarts/lib/component/dataZoom/AxisProxy.js
  4387. init_define_APP_INFO();
  4388. var each3 = each;
  4389. var asc2 = asc;
  4390. var AxisProxy = function() {
  4391. function AxisProxy2(dimName, axisIndex, dataZoomModel, ecModel) {
  4392. this._dimName = dimName;
  4393. this._axisIndex = axisIndex;
  4394. this.ecModel = ecModel;
  4395. this._dataZoomModel = dataZoomModel;
  4396. }
  4397. AxisProxy2.prototype.hostedBy = function(dataZoomModel) {
  4398. return this._dataZoomModel === dataZoomModel;
  4399. };
  4400. AxisProxy2.prototype.getDataValueWindow = function() {
  4401. return this._valueWindow.slice();
  4402. };
  4403. AxisProxy2.prototype.getDataPercentWindow = function() {
  4404. return this._percentWindow.slice();
  4405. };
  4406. AxisProxy2.prototype.getTargetSeriesModels = function() {
  4407. var seriesModels = [];
  4408. this.ecModel.eachSeries(function(seriesModel) {
  4409. if (isCoordSupported(seriesModel)) {
  4410. var axisMainType = getAxisMainType(this._dimName);
  4411. var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0];
  4412. if (axisModel && this._axisIndex === axisModel.componentIndex) {
  4413. seriesModels.push(seriesModel);
  4414. }
  4415. }
  4416. }, this);
  4417. return seriesModels;
  4418. };
  4419. AxisProxy2.prototype.getAxisModel = function() {
  4420. return this.ecModel.getComponent(this._dimName + "Axis", this._axisIndex);
  4421. };
  4422. AxisProxy2.prototype.getMinMaxSpan = function() {
  4423. return clone(this._minMaxSpan);
  4424. };
  4425. AxisProxy2.prototype.calculateDataWindow = function(opt) {
  4426. var dataExtent = this._dataExtent;
  4427. var axisModel = this.getAxisModel();
  4428. var scale = axisModel.axis.scale;
  4429. var rangePropMode = this._dataZoomModel.getRangePropMode();
  4430. var percentExtent = [0, 100];
  4431. var percentWindow = [];
  4432. var valueWindow = [];
  4433. var hasPropModeValue;
  4434. each3(["start", "end"], function(prop, idx) {
  4435. var boundPercent = opt[prop];
  4436. var boundValue = opt[prop + "Value"];
  4437. if (rangePropMode[idx] === "percent") {
  4438. boundPercent == null && (boundPercent = percentExtent[idx]);
  4439. boundValue = scale.parse(linearMap(boundPercent, percentExtent, dataExtent));
  4440. } else {
  4441. hasPropModeValue = true;
  4442. boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue);
  4443. boundPercent = linearMap(boundValue, dataExtent, percentExtent);
  4444. }
  4445. valueWindow[idx] = boundValue;
  4446. percentWindow[idx] = boundPercent;
  4447. });
  4448. asc2(valueWindow);
  4449. asc2(percentWindow);
  4450. var spans = this._minMaxSpan;
  4451. hasPropModeValue ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false) : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);
  4452. function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) {
  4453. var suffix = toValue ? "Span" : "ValueSpan";
  4454. sliderMove(0, fromWindow, fromExtent, "all", spans["min" + suffix], spans["max" + suffix]);
  4455. for (var i = 0; i < 2; i++) {
  4456. toWindow[i] = linearMap(fromWindow[i], fromExtent, toExtent, true);
  4457. toValue && (toWindow[i] = scale.parse(toWindow[i]));
  4458. }
  4459. }
  4460. return {
  4461. valueWindow,
  4462. percentWindow
  4463. };
  4464. };
  4465. AxisProxy2.prototype.reset = function(dataZoomModel) {
  4466. if (dataZoomModel !== this._dataZoomModel) {
  4467. return;
  4468. }
  4469. var targetSeries = this.getTargetSeriesModels();
  4470. this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries);
  4471. this._updateMinMaxSpan();
  4472. var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);
  4473. this._valueWindow = dataWindow.valueWindow;
  4474. this._percentWindow = dataWindow.percentWindow;
  4475. this._setAxisModel();
  4476. };
  4477. AxisProxy2.prototype.filterData = function(dataZoomModel, api) {
  4478. if (dataZoomModel !== this._dataZoomModel) {
  4479. return;
  4480. }
  4481. var axisDim = this._dimName;
  4482. var seriesModels = this.getTargetSeriesModels();
  4483. var filterMode = dataZoomModel.get("filterMode");
  4484. var valueWindow = this._valueWindow;
  4485. if (filterMode === "none") {
  4486. return;
  4487. }
  4488. each3(seriesModels, function(seriesModel) {
  4489. var seriesData = seriesModel.getData();
  4490. var dataDims = seriesData.mapDimensionsAll(axisDim);
  4491. if (!dataDims.length) {
  4492. return;
  4493. }
  4494. if (filterMode === "weakFilter") {
  4495. var store_1 = seriesData.getStore();
  4496. var dataDimIndices_1 = map(dataDims, function(dim) {
  4497. return seriesData.getDimensionIndex(dim);
  4498. }, seriesData);
  4499. seriesData.filterSelf(function(dataIndex) {
  4500. var leftOut;
  4501. var rightOut;
  4502. var hasValue;
  4503. for (var i = 0; i < dataDims.length; i++) {
  4504. var value = store_1.get(dataDimIndices_1[i], dataIndex);
  4505. var thisHasValue = !isNaN(value);
  4506. var thisLeftOut = value < valueWindow[0];
  4507. var thisRightOut = value > valueWindow[1];
  4508. if (thisHasValue && !thisLeftOut && !thisRightOut) {
  4509. return true;
  4510. }
  4511. thisHasValue && (hasValue = true);
  4512. thisLeftOut && (leftOut = true);
  4513. thisRightOut && (rightOut = true);
  4514. }
  4515. return hasValue && leftOut && rightOut;
  4516. });
  4517. } else {
  4518. each3(dataDims, function(dim) {
  4519. if (filterMode === "empty") {
  4520. seriesModel.setData(seriesData = seriesData.map(dim, function(value) {
  4521. return !isInWindow(value) ? NaN : value;
  4522. }));
  4523. } else {
  4524. var range = {};
  4525. range[dim] = valueWindow;
  4526. seriesData.selectRange(range);
  4527. }
  4528. });
  4529. }
  4530. each3(dataDims, function(dim) {
  4531. seriesData.setApproximateExtent(valueWindow, dim);
  4532. });
  4533. });
  4534. function isInWindow(value) {
  4535. return value >= valueWindow[0] && value <= valueWindow[1];
  4536. }
  4537. };
  4538. AxisProxy2.prototype._updateMinMaxSpan = function() {
  4539. var minMaxSpan = this._minMaxSpan = {};
  4540. var dataZoomModel = this._dataZoomModel;
  4541. var dataExtent = this._dataExtent;
  4542. each3(["min", "max"], function(minMax) {
  4543. var percentSpan = dataZoomModel.get(minMax + "Span");
  4544. var valueSpan = dataZoomModel.get(minMax + "ValueSpan");
  4545. valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan));
  4546. if (valueSpan != null) {
  4547. percentSpan = linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);
  4548. } else if (percentSpan != null) {
  4549. valueSpan = linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0];
  4550. }
  4551. minMaxSpan[minMax + "Span"] = percentSpan;
  4552. minMaxSpan[minMax + "ValueSpan"] = valueSpan;
  4553. }, this);
  4554. };
  4555. AxisProxy2.prototype._setAxisModel = function() {
  4556. var axisModel = this.getAxisModel();
  4557. var percentWindow = this._percentWindow;
  4558. var valueWindow = this._valueWindow;
  4559. if (!percentWindow) {
  4560. return;
  4561. }
  4562. var precision = getPixelPrecision(valueWindow, [0, 500]);
  4563. precision = Math.min(precision, 20);
  4564. var rawExtentInfo = axisModel.axis.scale.rawExtentInfo;
  4565. if (percentWindow[0] !== 0) {
  4566. rawExtentInfo.setDeterminedMinMax("min", +valueWindow[0].toFixed(precision));
  4567. }
  4568. if (percentWindow[1] !== 100) {
  4569. rawExtentInfo.setDeterminedMinMax("max", +valueWindow[1].toFixed(precision));
  4570. }
  4571. rawExtentInfo.freeze();
  4572. };
  4573. return AxisProxy2;
  4574. }();
  4575. function calculateDataExtent(axisProxy, axisDim, seriesModels) {
  4576. var dataExtent = [Infinity, -Infinity];
  4577. each3(seriesModels, function(seriesModel) {
  4578. unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim);
  4579. });
  4580. var axisModel = axisProxy.getAxisModel();
  4581. var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate();
  4582. return [rawExtentResult.min, rawExtentResult.max];
  4583. }
  4584. var AxisProxy_default = AxisProxy;
  4585. // node_modules/echarts/lib/component/dataZoom/dataZoomProcessor.js
  4586. var dataZoomProcessor = {
  4587. getTargetSeries: function(ecModel) {
  4588. function eachAxisModel(cb) {
  4589. ecModel.eachComponent("dataZoom", function(dataZoomModel) {
  4590. dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
  4591. var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);
  4592. cb(axisDim, axisIndex, axisModel, dataZoomModel);
  4593. });
  4594. });
  4595. }
  4596. eachAxisModel(function(axisDim, axisIndex, axisModel, dataZoomModel) {
  4597. axisModel.__dzAxisProxy = null;
  4598. });
  4599. var proxyList = [];
  4600. eachAxisModel(function(axisDim, axisIndex, axisModel, dataZoomModel) {
  4601. if (!axisModel.__dzAxisProxy) {
  4602. axisModel.__dzAxisProxy = new AxisProxy_default(axisDim, axisIndex, dataZoomModel, ecModel);
  4603. proxyList.push(axisModel.__dzAxisProxy);
  4604. }
  4605. });
  4606. var seriesModelMap = createHashMap();
  4607. each(proxyList, function(axisProxy) {
  4608. each(axisProxy.getTargetSeriesModels(), function(seriesModel) {
  4609. seriesModelMap.set(seriesModel.uid, seriesModel);
  4610. });
  4611. });
  4612. return seriesModelMap;
  4613. },
  4614. overallReset: function(ecModel, api) {
  4615. ecModel.eachComponent("dataZoom", function(dataZoomModel) {
  4616. dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
  4617. dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel);
  4618. });
  4619. dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
  4620. dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api);
  4621. });
  4622. });
  4623. ecModel.eachComponent("dataZoom", function(dataZoomModel) {
  4624. var axisProxy = dataZoomModel.findRepresentativeAxisProxy();
  4625. if (axisProxy) {
  4626. var percentRange = axisProxy.getDataPercentWindow();
  4627. var valueRange = axisProxy.getDataValueWindow();
  4628. dataZoomModel.setCalculatedRange({
  4629. start: percentRange[0],
  4630. end: percentRange[1],
  4631. startValue: valueRange[0],
  4632. endValue: valueRange[1]
  4633. });
  4634. }
  4635. });
  4636. }
  4637. };
  4638. var dataZoomProcessor_default = dataZoomProcessor;
  4639. // node_modules/echarts/lib/component/dataZoom/dataZoomAction.js
  4640. init_define_APP_INFO();
  4641. function installDataZoomAction(registers) {
  4642. registers.registerAction("dataZoom", function(payload, ecModel) {
  4643. var effectedModels = findEffectedDataZooms(ecModel, payload);
  4644. each(effectedModels, function(dataZoomModel) {
  4645. dataZoomModel.setRawRange({
  4646. start: payload.start,
  4647. end: payload.end,
  4648. startValue: payload.startValue,
  4649. endValue: payload.endValue
  4650. });
  4651. });
  4652. });
  4653. }
  4654. // node_modules/echarts/lib/component/dataZoom/installCommon.js
  4655. var installed = false;
  4656. function installCommon(registers) {
  4657. if (installed) {
  4658. return;
  4659. }
  4660. installed = true;
  4661. registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, dataZoomProcessor_default);
  4662. installDataZoomAction(registers);
  4663. registers.registerSubTypeDefaulter("dataZoom", function() {
  4664. return "slider";
  4665. });
  4666. }
  4667. // node_modules/echarts/lib/component/dataZoom/installDataZoomSelect.js
  4668. function install11(registers) {
  4669. registers.registerComponentModel(SelectZoomModel_default);
  4670. registers.registerComponentView(SelectZoomView_default);
  4671. installCommon(registers);
  4672. }
  4673. // node_modules/echarts/lib/component/toolbox/ToolboxModel.js
  4674. init_define_APP_INFO();
  4675. // node_modules/echarts/lib/component/toolbox/featureManager.js
  4676. init_define_APP_INFO();
  4677. var ToolboxFeature = function() {
  4678. function ToolboxFeature2() {
  4679. }
  4680. return ToolboxFeature2;
  4681. }();
  4682. var features = {};
  4683. function registerFeature(name, ctor) {
  4684. features[name] = ctor;
  4685. }
  4686. function getFeature(name) {
  4687. return features[name];
  4688. }
  4689. // node_modules/echarts/lib/component/toolbox/ToolboxModel.js
  4690. var ToolboxModel = function(_super) {
  4691. __extends(ToolboxModel2, _super);
  4692. function ToolboxModel2() {
  4693. var _this = _super !== null && _super.apply(this, arguments) || this;
  4694. _this.type = ToolboxModel2.type;
  4695. return _this;
  4696. }
  4697. ToolboxModel2.prototype.optionUpdated = function() {
  4698. _super.prototype.optionUpdated.apply(this, arguments);
  4699. var ecModel = this.ecModel;
  4700. each(this.option.feature, function(featureOpt, featureName) {
  4701. var Feature = getFeature(featureName);
  4702. if (Feature) {
  4703. if (Feature.getDefaultOption) {
  4704. Feature.defaultOption = Feature.getDefaultOption(ecModel);
  4705. }
  4706. merge(featureOpt, Feature.defaultOption);
  4707. }
  4708. });
  4709. };
  4710. ToolboxModel2.type = "toolbox";
  4711. ToolboxModel2.layoutMode = {
  4712. type: "box",
  4713. ignoreSize: true
  4714. };
  4715. ToolboxModel2.defaultOption = {
  4716. show: true,
  4717. z: 6,
  4718. orient: "horizontal",
  4719. left: "right",
  4720. top: "top",
  4721. backgroundColor: "transparent",
  4722. borderColor: "#ccc",
  4723. borderRadius: 0,
  4724. borderWidth: 0,
  4725. padding: 5,
  4726. itemSize: 15,
  4727. itemGap: 8,
  4728. showTitle: true,
  4729. iconStyle: {
  4730. borderColor: "#666",
  4731. color: "none"
  4732. },
  4733. emphasis: {
  4734. iconStyle: {
  4735. borderColor: "#3E98C5"
  4736. }
  4737. },
  4738. tooltip: {
  4739. show: false,
  4740. position: "bottom"
  4741. }
  4742. };
  4743. return ToolboxModel2;
  4744. }(Component_default);
  4745. var ToolboxModel_default = ToolboxModel;
  4746. // node_modules/echarts/lib/component/toolbox/ToolboxView.js
  4747. init_define_APP_INFO();
  4748. // node_modules/echarts/lib/component/helper/listComponent.js
  4749. init_define_APP_INFO();
  4750. function layout3(group, componentModel, api) {
  4751. var boxLayoutParams = componentModel.getBoxLayoutParams();
  4752. var padding = componentModel.get("padding");
  4753. var viewportSize = {
  4754. width: api.getWidth(),
  4755. height: api.getHeight()
  4756. };
  4757. var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);
  4758. box(componentModel.get("orient"), group, componentModel.get("itemGap"), rect.width, rect.height);
  4759. positionElement(group, boxLayoutParams, viewportSize, padding);
  4760. }
  4761. function makeBackground(rect, componentModel) {
  4762. var padding = normalizeCssArray(componentModel.get("padding"));
  4763. var style = componentModel.getItemStyle(["color", "opacity"]);
  4764. style.fill = componentModel.get("backgroundColor");
  4765. rect = new Rect_default({
  4766. shape: {
  4767. x: rect.x - padding[3],
  4768. y: rect.y - padding[0],
  4769. width: rect.width + padding[1] + padding[3],
  4770. height: rect.height + padding[0] + padding[2],
  4771. r: componentModel.get("borderRadius")
  4772. },
  4773. style,
  4774. silent: true,
  4775. z2: -1
  4776. });
  4777. return rect;
  4778. }
  4779. // node_modules/echarts/lib/component/toolbox/ToolboxView.js
  4780. var ToolboxView = function(_super) {
  4781. __extends(ToolboxView2, _super);
  4782. function ToolboxView2() {
  4783. return _super !== null && _super.apply(this, arguments) || this;
  4784. }
  4785. ToolboxView2.prototype.render = function(toolboxModel, ecModel, api, payload) {
  4786. var group = this.group;
  4787. group.removeAll();
  4788. if (!toolboxModel.get("show")) {
  4789. return;
  4790. }
  4791. var itemSize = +toolboxModel.get("itemSize");
  4792. var isVertical = toolboxModel.get("orient") === "vertical";
  4793. var featureOpts = toolboxModel.get("feature") || {};
  4794. var features2 = this._features || (this._features = {});
  4795. var featureNames = [];
  4796. each(featureOpts, function(opt, name) {
  4797. featureNames.push(name);
  4798. });
  4799. new DataDiffer_default(this._featureNames || [], featureNames).add(processFeature).update(processFeature).remove(curry(processFeature, null)).execute();
  4800. this._featureNames = featureNames;
  4801. function processFeature(newIndex, oldIndex) {
  4802. var featureName = featureNames[newIndex];
  4803. var oldName = featureNames[oldIndex];
  4804. var featureOpt = featureOpts[featureName];
  4805. var featureModel = new Model_default(featureOpt, toolboxModel, toolboxModel.ecModel);
  4806. var feature;
  4807. if (payload && payload.newTitle != null && payload.featureName === featureName) {
  4808. featureOpt.title = payload.newTitle;
  4809. }
  4810. if (featureName && !oldName) {
  4811. if (isUserFeatureName(featureName)) {
  4812. feature = {
  4813. onclick: featureModel.option.onclick,
  4814. featureName
  4815. };
  4816. } else {
  4817. var Feature = getFeature(featureName);
  4818. if (!Feature) {
  4819. return;
  4820. }
  4821. feature = new Feature();
  4822. }
  4823. features2[featureName] = feature;
  4824. } else {
  4825. feature = features2[oldName];
  4826. if (!feature) {
  4827. return;
  4828. }
  4829. }
  4830. feature.uid = getUID("toolbox-feature");
  4831. feature.model = featureModel;
  4832. feature.ecModel = ecModel;
  4833. feature.api = api;
  4834. var isToolboxFeature = feature instanceof ToolboxFeature;
  4835. if (!featureName && oldName) {
  4836. isToolboxFeature && feature.dispose && feature.dispose(ecModel, api);
  4837. return;
  4838. }
  4839. if (!featureModel.get("show") || isToolboxFeature && feature.unusable) {
  4840. isToolboxFeature && feature.remove && feature.remove(ecModel, api);
  4841. return;
  4842. }
  4843. createIconPaths(featureModel, feature, featureName);
  4844. featureModel.setIconStatus = function(iconName, status) {
  4845. var option = this.option;
  4846. var iconPaths = this.iconPaths;
  4847. option.iconStatus = option.iconStatus || {};
  4848. option.iconStatus[iconName] = status;
  4849. if (iconPaths[iconName]) {
  4850. (status === "emphasis" ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]);
  4851. }
  4852. };
  4853. if (feature instanceof ToolboxFeature) {
  4854. if (feature.render) {
  4855. feature.render(featureModel, ecModel, api, payload);
  4856. }
  4857. }
  4858. }
  4859. function createIconPaths(featureModel, feature, featureName) {
  4860. var iconStyleModel = featureModel.getModel("iconStyle");
  4861. var iconStyleEmphasisModel = featureModel.getModel(["emphasis", "iconStyle"]);
  4862. var icons = feature instanceof ToolboxFeature && feature.getIcons ? feature.getIcons() : featureModel.get("icon");
  4863. var titles = featureModel.get("title") || {};
  4864. var iconsMap;
  4865. var titlesMap;
  4866. if (isString(icons)) {
  4867. iconsMap = {};
  4868. iconsMap[featureName] = icons;
  4869. } else {
  4870. iconsMap = icons;
  4871. }
  4872. if (isString(titles)) {
  4873. titlesMap = {};
  4874. titlesMap[featureName] = titles;
  4875. } else {
  4876. titlesMap = titles;
  4877. }
  4878. var iconPaths = featureModel.iconPaths = {};
  4879. each(iconsMap, function(iconStr, iconName) {
  4880. var path = createIcon(iconStr, {}, {
  4881. x: -itemSize / 2,
  4882. y: -itemSize / 2,
  4883. width: itemSize,
  4884. height: itemSize
  4885. });
  4886. path.setStyle(iconStyleModel.getItemStyle());
  4887. var pathEmphasisState = path.ensureState("emphasis");
  4888. pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle();
  4889. var textContent = new Text_default({
  4890. style: {
  4891. text: titlesMap[iconName],
  4892. align: iconStyleEmphasisModel.get("textAlign"),
  4893. borderRadius: iconStyleEmphasisModel.get("textBorderRadius"),
  4894. padding: iconStyleEmphasisModel.get("textPadding"),
  4895. fill: null
  4896. },
  4897. ignore: true
  4898. });
  4899. path.setTextContent(textContent);
  4900. setTooltipConfig({
  4901. el: path,
  4902. componentModel: toolboxModel,
  4903. itemName: iconName,
  4904. formatterParamsExtra: {
  4905. title: titlesMap[iconName]
  4906. }
  4907. });
  4908. path.__title = titlesMap[iconName];
  4909. path.on("mouseover", function() {
  4910. var hoverStyle = iconStyleEmphasisModel.getItemStyle();
  4911. var defaultTextPosition = isVertical ? toolboxModel.get("right") == null && toolboxModel.get("left") !== "right" ? "right" : "left" : toolboxModel.get("bottom") == null && toolboxModel.get("top") !== "bottom" ? "bottom" : "top";
  4912. textContent.setStyle({
  4913. fill: iconStyleEmphasisModel.get("textFill") || hoverStyle.fill || hoverStyle.stroke || "#000",
  4914. backgroundColor: iconStyleEmphasisModel.get("textBackgroundColor")
  4915. });
  4916. path.setTextConfig({
  4917. position: iconStyleEmphasisModel.get("textPosition") || defaultTextPosition
  4918. });
  4919. textContent.ignore = !toolboxModel.get("showTitle");
  4920. api.enterEmphasis(this);
  4921. }).on("mouseout", function() {
  4922. if (featureModel.get(["iconStatus", iconName]) !== "emphasis") {
  4923. api.leaveEmphasis(this);
  4924. }
  4925. textContent.hide();
  4926. });
  4927. (featureModel.get(["iconStatus", iconName]) === "emphasis" ? enterEmphasis : leaveEmphasis)(path);
  4928. group.add(path);
  4929. path.on("click", bind(feature.onclick, feature, ecModel, api, iconName));
  4930. iconPaths[iconName] = path;
  4931. });
  4932. }
  4933. layout3(group, toolboxModel, api);
  4934. group.add(makeBackground(group.getBoundingRect(), toolboxModel));
  4935. isVertical || group.eachChild(function(icon) {
  4936. var titleText = icon.__title;
  4937. var emphasisState = icon.ensureState("emphasis");
  4938. var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {});
  4939. var textContent = icon.getTextContent();
  4940. var emphasisTextState = textContent && textContent.ensureState("emphasis");
  4941. if (emphasisTextState && !isFunction(emphasisTextState) && titleText) {
  4942. var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {});
  4943. var rect = getBoundingRect(titleText, Text_default.makeFont(emphasisTextStyle));
  4944. var offsetX = icon.x + group.x;
  4945. var offsetY = icon.y + group.y + itemSize;
  4946. var needPutOnTop = false;
  4947. if (offsetY + rect.height > api.getHeight()) {
  4948. emphasisTextConfig.position = "top";
  4949. needPutOnTop = true;
  4950. }
  4951. var topOffset = needPutOnTop ? -5 - rect.height : itemSize + 10;
  4952. if (offsetX + rect.width / 2 > api.getWidth()) {
  4953. emphasisTextConfig.position = ["100%", topOffset];
  4954. emphasisTextStyle.align = "right";
  4955. } else if (offsetX - rect.width / 2 < 0) {
  4956. emphasisTextConfig.position = [0, topOffset];
  4957. emphasisTextStyle.align = "left";
  4958. }
  4959. }
  4960. });
  4961. };
  4962. ToolboxView2.prototype.updateView = function(toolboxModel, ecModel, api, payload) {
  4963. each(this._features, function(feature) {
  4964. feature instanceof ToolboxFeature && feature.updateView && feature.updateView(feature.model, ecModel, api, payload);
  4965. });
  4966. };
  4967. ToolboxView2.prototype.remove = function(ecModel, api) {
  4968. each(this._features, function(feature) {
  4969. feature instanceof ToolboxFeature && feature.remove && feature.remove(ecModel, api);
  4970. });
  4971. this.group.removeAll();
  4972. };
  4973. ToolboxView2.prototype.dispose = function(ecModel, api) {
  4974. each(this._features, function(feature) {
  4975. feature instanceof ToolboxFeature && feature.dispose && feature.dispose(ecModel, api);
  4976. });
  4977. };
  4978. ToolboxView2.type = "toolbox";
  4979. return ToolboxView2;
  4980. }(Component_default2);
  4981. function isUserFeatureName(featureName) {
  4982. return featureName.indexOf("my") === 0;
  4983. }
  4984. var ToolboxView_default = ToolboxView;
  4985. // node_modules/echarts/lib/component/toolbox/feature/SaveAsImage.js
  4986. init_define_APP_INFO();
  4987. var SaveAsImage = function(_super) {
  4988. __extends(SaveAsImage2, _super);
  4989. function SaveAsImage2() {
  4990. return _super !== null && _super.apply(this, arguments) || this;
  4991. }
  4992. SaveAsImage2.prototype.onclick = function(ecModel, api) {
  4993. var model = this.model;
  4994. var title = model.get("name") || ecModel.get("title.0.text") || "echarts";
  4995. var isSvg = api.getZr().painter.getType() === "svg";
  4996. var type = isSvg ? "svg" : model.get("type", true) || "png";
  4997. var url = api.getConnectedDataURL({
  4998. type,
  4999. backgroundColor: model.get("backgroundColor", true) || ecModel.get("backgroundColor") || "#fff",
  5000. connectedBackgroundColor: model.get("connectedBackgroundColor"),
  5001. excludeComponents: model.get("excludeComponents"),
  5002. pixelRatio: model.get("pixelRatio")
  5003. });
  5004. var browser = env_default.browser;
  5005. if (isFunction(MouseEvent) && (browser.newEdge || !browser.ie && !browser.edge)) {
  5006. var $a = document.createElement("a");
  5007. $a.download = title + "." + type;
  5008. $a.target = "_blank";
  5009. $a.href = url;
  5010. var evt = new MouseEvent("click", {
  5011. view: document.defaultView,
  5012. bubbles: true,
  5013. cancelable: false
  5014. });
  5015. $a.dispatchEvent(evt);
  5016. } else {
  5017. if (window.navigator.msSaveOrOpenBlob || isSvg) {
  5018. var parts = url.split(",");
  5019. var base64Encoded = parts[0].indexOf("base64") > -1;
  5020. var bstr = isSvg ? decodeURIComponent(parts[1]) : parts[1];
  5021. base64Encoded && (bstr = window.atob(bstr));
  5022. var filename = title + "." + type;
  5023. if (window.navigator.msSaveOrOpenBlob) {
  5024. var n = bstr.length;
  5025. var u8arr = new Uint8Array(n);
  5026. while (n--) {
  5027. u8arr[n] = bstr.charCodeAt(n);
  5028. }
  5029. var blob = new Blob([u8arr]);
  5030. window.navigator.msSaveOrOpenBlob(blob, filename);
  5031. } else {
  5032. var frame = document.createElement("iframe");
  5033. document.body.appendChild(frame);
  5034. var cw = frame.contentWindow;
  5035. var doc = cw.document;
  5036. doc.open("image/svg+xml", "replace");
  5037. doc.write(bstr);
  5038. doc.close();
  5039. cw.focus();
  5040. doc.execCommand("SaveAs", true, filename);
  5041. document.body.removeChild(frame);
  5042. }
  5043. } else {
  5044. var lang = model.get("lang");
  5045. var html = '<body style="margin:0;"><img src="' + url + '" style="max-width:100%;" title="' + (lang && lang[0] || "") + '" /></body>';
  5046. var tab = window.open();
  5047. tab.document.write(html);
  5048. tab.document.title = title;
  5049. }
  5050. }
  5051. };
  5052. SaveAsImage2.getDefaultOption = function(ecModel) {
  5053. var defaultOption2 = {
  5054. show: true,
  5055. 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",
  5056. title: ecModel.getLocaleModel().get(["toolbox", "saveAsImage", "title"]),
  5057. type: "png",
  5058. connectedBackgroundColor: "#fff",
  5059. name: "",
  5060. excludeComponents: ["toolbox"],
  5061. lang: ecModel.getLocaleModel().get(["toolbox", "saveAsImage", "lang"])
  5062. };
  5063. return defaultOption2;
  5064. };
  5065. return SaveAsImage2;
  5066. }(ToolboxFeature);
  5067. var SaveAsImage_default = SaveAsImage;
  5068. // node_modules/echarts/lib/component/toolbox/feature/MagicType.js
  5069. init_define_APP_INFO();
  5070. var INNER_STACK_KEYWORD = "__ec_magicType_stack__";
  5071. var radioTypes = [["line", "bar"], ["stack"]];
  5072. var MagicType = function(_super) {
  5073. __extends(MagicType2, _super);
  5074. function MagicType2() {
  5075. return _super !== null && _super.apply(this, arguments) || this;
  5076. }
  5077. MagicType2.prototype.getIcons = function() {
  5078. var model = this.model;
  5079. var availableIcons = model.get("icon");
  5080. var icons = {};
  5081. each(model.get("type"), function(type) {
  5082. if (availableIcons[type]) {
  5083. icons[type] = availableIcons[type];
  5084. }
  5085. });
  5086. return icons;
  5087. };
  5088. MagicType2.getDefaultOption = function(ecModel) {
  5089. var defaultOption2 = {
  5090. show: true,
  5091. type: [],
  5092. icon: {
  5093. line: "M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",
  5094. bar: "M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",
  5095. 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"
  5096. },
  5097. title: ecModel.getLocaleModel().get(["toolbox", "magicType", "title"]),
  5098. option: {},
  5099. seriesIndex: {}
  5100. };
  5101. return defaultOption2;
  5102. };
  5103. MagicType2.prototype.onclick = function(ecModel, api, type) {
  5104. var model = this.model;
  5105. var seriesIndex = model.get(["seriesIndex", type]);
  5106. if (!seriesOptGenreator[type]) {
  5107. return;
  5108. }
  5109. var newOption = {
  5110. series: []
  5111. };
  5112. var generateNewSeriesTypes = function(seriesModel) {
  5113. var seriesType = seriesModel.subType;
  5114. var seriesId = seriesModel.id;
  5115. var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model);
  5116. if (newSeriesOpt) {
  5117. defaults(newSeriesOpt, seriesModel.option);
  5118. newOption.series.push(newSeriesOpt);
  5119. }
  5120. var coordSys = seriesModel.coordinateSystem;
  5121. if (coordSys && coordSys.type === "cartesian2d" && (type === "line" || type === "bar")) {
  5122. var categoryAxis = coordSys.getAxesByScale("ordinal")[0];
  5123. if (categoryAxis) {
  5124. var axisDim = categoryAxis.dim;
  5125. var axisType = axisDim + "Axis";
  5126. var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];
  5127. var axisIndex = axisModel.componentIndex;
  5128. newOption[axisType] = newOption[axisType] || [];
  5129. for (var i = 0; i <= axisIndex; i++) {
  5130. newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {};
  5131. }
  5132. newOption[axisType][axisIndex].boundaryGap = type === "bar";
  5133. }
  5134. }
  5135. };
  5136. each(radioTypes, function(radio) {
  5137. if (indexOf(radio, type) >= 0) {
  5138. each(radio, function(item) {
  5139. model.setIconStatus(item, "normal");
  5140. });
  5141. }
  5142. });
  5143. model.setIconStatus(type, "emphasis");
  5144. ecModel.eachComponent({
  5145. mainType: "series",
  5146. query: seriesIndex == null ? null : {
  5147. seriesIndex
  5148. }
  5149. }, generateNewSeriesTypes);
  5150. var newTitle;
  5151. var currentType = type;
  5152. if (type === "stack") {
  5153. newTitle = merge({
  5154. stack: model.option.title.tiled,
  5155. tiled: model.option.title.stack
  5156. }, model.option.title);
  5157. if (model.get(["iconStatus", type]) !== "emphasis") {
  5158. currentType = "tiled";
  5159. }
  5160. }
  5161. api.dispatchAction({
  5162. type: "changeMagicType",
  5163. currentType,
  5164. newOption,
  5165. newTitle,
  5166. featureName: "magicType"
  5167. });
  5168. };
  5169. return MagicType2;
  5170. }(ToolboxFeature);
  5171. var seriesOptGenreator = {
  5172. "line": function(seriesType, seriesId, seriesModel, model) {
  5173. if (seriesType === "bar") {
  5174. return merge({
  5175. id: seriesId,
  5176. type: "line",
  5177. data: seriesModel.get("data"),
  5178. stack: seriesModel.get("stack"),
  5179. markPoint: seriesModel.get("markPoint"),
  5180. markLine: seriesModel.get("markLine")
  5181. }, model.get(["option", "line"]) || {}, true);
  5182. }
  5183. },
  5184. "bar": function(seriesType, seriesId, seriesModel, model) {
  5185. if (seriesType === "line") {
  5186. return merge({
  5187. id: seriesId,
  5188. type: "bar",
  5189. data: seriesModel.get("data"),
  5190. stack: seriesModel.get("stack"),
  5191. markPoint: seriesModel.get("markPoint"),
  5192. markLine: seriesModel.get("markLine")
  5193. }, model.get(["option", "bar"]) || {}, true);
  5194. }
  5195. },
  5196. "stack": function(seriesType, seriesId, seriesModel, model) {
  5197. var isStack = seriesModel.get("stack") === INNER_STACK_KEYWORD;
  5198. if (seriesType === "line" || seriesType === "bar") {
  5199. model.setIconStatus("stack", isStack ? "normal" : "emphasis");
  5200. return merge({
  5201. id: seriesId,
  5202. stack: isStack ? "" : INNER_STACK_KEYWORD
  5203. }, model.get(["option", "stack"]) || {}, true);
  5204. }
  5205. }
  5206. };
  5207. registerAction({
  5208. type: "changeMagicType",
  5209. event: "magicTypeChanged",
  5210. update: "prepareAndUpdate"
  5211. }, function(payload, ecModel) {
  5212. ecModel.mergeOption(payload.newOption);
  5213. });
  5214. var MagicType_default = MagicType;
  5215. // node_modules/echarts/lib/component/toolbox/feature/DataView.js
  5216. init_define_APP_INFO();
  5217. var BLOCK_SPLITER = new Array(60).join("-");
  5218. var ITEM_SPLITER = " ";
  5219. function groupSeries(ecModel) {
  5220. var seriesGroupByCategoryAxis = {};
  5221. var otherSeries = [];
  5222. var meta = [];
  5223. ecModel.eachRawSeries(function(seriesModel) {
  5224. var coordSys = seriesModel.coordinateSystem;
  5225. if (coordSys && (coordSys.type === "cartesian2d" || coordSys.type === "polar")) {
  5226. var baseAxis = coordSys.getBaseAxis();
  5227. if (baseAxis.type === "category") {
  5228. var key = baseAxis.dim + "_" + baseAxis.index;
  5229. if (!seriesGroupByCategoryAxis[key]) {
  5230. seriesGroupByCategoryAxis[key] = {
  5231. categoryAxis: baseAxis,
  5232. valueAxis: coordSys.getOtherAxis(baseAxis),
  5233. series: []
  5234. };
  5235. meta.push({
  5236. axisDim: baseAxis.dim,
  5237. axisIndex: baseAxis.index
  5238. });
  5239. }
  5240. seriesGroupByCategoryAxis[key].series.push(seriesModel);
  5241. } else {
  5242. otherSeries.push(seriesModel);
  5243. }
  5244. } else {
  5245. otherSeries.push(seriesModel);
  5246. }
  5247. });
  5248. return {
  5249. seriesGroupByCategoryAxis,
  5250. other: otherSeries,
  5251. meta
  5252. };
  5253. }
  5254. function assembleSeriesWithCategoryAxis(groups) {
  5255. var tables = [];
  5256. each(groups, function(group, key) {
  5257. var categoryAxis = group.categoryAxis;
  5258. var valueAxis = group.valueAxis;
  5259. var valueAxisDim = valueAxis.dim;
  5260. var headers = [" "].concat(map(group.series, function(series) {
  5261. return series.name;
  5262. }));
  5263. var columns = [categoryAxis.model.getCategories()];
  5264. each(group.series, function(series) {
  5265. var rawData = series.getRawData();
  5266. columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function(val) {
  5267. return val;
  5268. }));
  5269. });
  5270. var lines = [headers.join(ITEM_SPLITER)];
  5271. for (var i = 0; i < columns[0].length; i++) {
  5272. var items = [];
  5273. for (var j = 0; j < columns.length; j++) {
  5274. items.push(columns[j][i]);
  5275. }
  5276. lines.push(items.join(ITEM_SPLITER));
  5277. }
  5278. tables.push(lines.join("\n"));
  5279. });
  5280. return tables.join("\n\n" + BLOCK_SPLITER + "\n\n");
  5281. }
  5282. function assembleOtherSeries(series) {
  5283. return map(series, function(series2) {
  5284. var data = series2.getRawData();
  5285. var lines = [series2.name];
  5286. var vals = [];
  5287. data.each(data.dimensions, function() {
  5288. var argLen = arguments.length;
  5289. var dataIndex = arguments[argLen - 1];
  5290. var name = data.getName(dataIndex);
  5291. for (var i = 0; i < argLen - 1; i++) {
  5292. vals[i] = arguments[i];
  5293. }
  5294. lines.push((name ? name + ITEM_SPLITER : "") + vals.join(ITEM_SPLITER));
  5295. });
  5296. return lines.join("\n");
  5297. }).join("\n\n" + BLOCK_SPLITER + "\n\n");
  5298. }
  5299. function getContentFromModel(ecModel) {
  5300. var result = groupSeries(ecModel);
  5301. return {
  5302. value: filter([assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis), assembleOtherSeries(result.other)], function(str) {
  5303. return !!str.replace(/[\n\t\s]/g, "");
  5304. }).join("\n\n" + BLOCK_SPLITER + "\n\n"),
  5305. meta: result.meta
  5306. };
  5307. }
  5308. function trim2(str) {
  5309. return str.replace(/^\s\s*/, "").replace(/\s\s*$/, "");
  5310. }
  5311. function isTSVFormat(block) {
  5312. var firstLine = block.slice(0, block.indexOf("\n"));
  5313. if (firstLine.indexOf(ITEM_SPLITER) >= 0) {
  5314. return true;
  5315. }
  5316. }
  5317. var itemSplitRegex = new RegExp("[" + ITEM_SPLITER + "]+", "g");
  5318. function parseTSVContents(tsv) {
  5319. var tsvLines = tsv.split(/\n+/g);
  5320. var headers = trim2(tsvLines.shift()).split(itemSplitRegex);
  5321. var categories = [];
  5322. var series = map(headers, function(header) {
  5323. return {
  5324. name: header,
  5325. data: []
  5326. };
  5327. });
  5328. for (var i = 0; i < tsvLines.length; i++) {
  5329. var items = trim2(tsvLines[i]).split(itemSplitRegex);
  5330. categories.push(items.shift());
  5331. for (var j = 0; j < items.length; j++) {
  5332. series[j] && (series[j].data[i] = items[j]);
  5333. }
  5334. }
  5335. return {
  5336. series,
  5337. categories
  5338. };
  5339. }
  5340. function parseListContents(str) {
  5341. var lines = str.split(/\n+/g);
  5342. var seriesName = trim2(lines.shift());
  5343. var data = [];
  5344. for (var i = 0; i < lines.length; i++) {
  5345. var line = trim2(lines[i]);
  5346. if (!line) {
  5347. continue;
  5348. }
  5349. var items = line.split(itemSplitRegex);
  5350. var name_1 = "";
  5351. var value = void 0;
  5352. var hasName = false;
  5353. if (isNaN(items[0])) {
  5354. hasName = true;
  5355. name_1 = items[0];
  5356. items = items.slice(1);
  5357. data[i] = {
  5358. name: name_1,
  5359. value: []
  5360. };
  5361. value = data[i].value;
  5362. } else {
  5363. value = data[i] = [];
  5364. }
  5365. for (var j = 0; j < items.length; j++) {
  5366. value.push(+items[j]);
  5367. }
  5368. if (value.length === 1) {
  5369. hasName ? data[i].value = value[0] : data[i] = value[0];
  5370. }
  5371. }
  5372. return {
  5373. name: seriesName,
  5374. data
  5375. };
  5376. }
  5377. function parseContents(str, blockMetaList) {
  5378. var blocks = str.split(new RegExp("\n*" + BLOCK_SPLITER + "\n*", "g"));
  5379. var newOption = {
  5380. series: []
  5381. };
  5382. each(blocks, function(block, idx) {
  5383. if (isTSVFormat(block)) {
  5384. var result = parseTSVContents(block);
  5385. var blockMeta = blockMetaList[idx];
  5386. var axisKey = blockMeta.axisDim + "Axis";
  5387. if (blockMeta) {
  5388. newOption[axisKey] = newOption[axisKey] || [];
  5389. newOption[axisKey][blockMeta.axisIndex] = {
  5390. data: result.categories
  5391. };
  5392. newOption.series = newOption.series.concat(result.series);
  5393. }
  5394. } else {
  5395. var result = parseListContents(block);
  5396. newOption.series.push(result);
  5397. }
  5398. });
  5399. return newOption;
  5400. }
  5401. var DataView = function(_super) {
  5402. __extends(DataView2, _super);
  5403. function DataView2() {
  5404. return _super !== null && _super.apply(this, arguments) || this;
  5405. }
  5406. DataView2.prototype.onclick = function(ecModel, api) {
  5407. setTimeout(function() {
  5408. api.dispatchAction({
  5409. type: "hideTip"
  5410. });
  5411. });
  5412. var container = api.getDom();
  5413. var model = this.model;
  5414. if (this._dom) {
  5415. container.removeChild(this._dom);
  5416. }
  5417. var root = document.createElement("div");
  5418. root.style.cssText = "position:absolute;top:0;bottom:0;left:0;right:0;padding:5px";
  5419. root.style.backgroundColor = model.get("backgroundColor") || "#fff";
  5420. var header = document.createElement("h4");
  5421. var lang = model.get("lang") || [];
  5422. header.innerHTML = lang[0] || model.get("title");
  5423. header.style.cssText = "margin:10px 20px";
  5424. header.style.color = model.get("textColor");
  5425. var viewMain = document.createElement("div");
  5426. var textarea = document.createElement("textarea");
  5427. viewMain.style.cssText = "overflow:auto";
  5428. var optionToContent = model.get("optionToContent");
  5429. var contentToOption = model.get("contentToOption");
  5430. var result = getContentFromModel(ecModel);
  5431. if (isFunction(optionToContent)) {
  5432. var htmlOrDom = optionToContent(api.getOption());
  5433. if (isString(htmlOrDom)) {
  5434. viewMain.innerHTML = htmlOrDom;
  5435. } else if (isDom(htmlOrDom)) {
  5436. viewMain.appendChild(htmlOrDom);
  5437. }
  5438. } else {
  5439. textarea.readOnly = model.get("readOnly");
  5440. var style = textarea.style;
  5441. style.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";
  5442. style.color = model.get("textColor");
  5443. style.borderColor = model.get("textareaBorderColor");
  5444. style.backgroundColor = model.get("textareaColor");
  5445. textarea.value = result.value;
  5446. viewMain.appendChild(textarea);
  5447. }
  5448. var blockMetaList = result.meta;
  5449. var buttonContainer = document.createElement("div");
  5450. buttonContainer.style.cssText = "position:absolute;bottom:5px;left:0;right:0";
  5451. var buttonStyle = "float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px";
  5452. var closeButton = document.createElement("div");
  5453. var refreshButton = document.createElement("div");
  5454. buttonStyle += ";background-color:" + model.get("buttonColor");
  5455. buttonStyle += ";color:" + model.get("buttonTextColor");
  5456. var self = this;
  5457. function close() {
  5458. container.removeChild(root);
  5459. self._dom = null;
  5460. }
  5461. addEventListener(closeButton, "click", close);
  5462. addEventListener(refreshButton, "click", function() {
  5463. if (contentToOption == null && optionToContent != null || contentToOption != null && optionToContent == null) {
  5464. if (true) {
  5465. warn("It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.");
  5466. }
  5467. close();
  5468. return;
  5469. }
  5470. var newOption;
  5471. try {
  5472. if (isFunction(contentToOption)) {
  5473. newOption = contentToOption(viewMain, api.getOption());
  5474. } else {
  5475. newOption = parseContents(textarea.value, blockMetaList);
  5476. }
  5477. } catch (e) {
  5478. close();
  5479. throw new Error("Data view format error " + e);
  5480. }
  5481. if (newOption) {
  5482. api.dispatchAction({
  5483. type: "changeDataView",
  5484. newOption
  5485. });
  5486. }
  5487. close();
  5488. });
  5489. closeButton.innerHTML = lang[1];
  5490. refreshButton.innerHTML = lang[2];
  5491. refreshButton.style.cssText = closeButton.style.cssText = buttonStyle;
  5492. !model.get("readOnly") && buttonContainer.appendChild(refreshButton);
  5493. buttonContainer.appendChild(closeButton);
  5494. root.appendChild(header);
  5495. root.appendChild(viewMain);
  5496. root.appendChild(buttonContainer);
  5497. viewMain.style.height = container.clientHeight - 80 + "px";
  5498. container.appendChild(root);
  5499. this._dom = root;
  5500. };
  5501. DataView2.prototype.remove = function(ecModel, api) {
  5502. this._dom && api.getDom().removeChild(this._dom);
  5503. };
  5504. DataView2.prototype.dispose = function(ecModel, api) {
  5505. this.remove(ecModel, api);
  5506. };
  5507. DataView2.getDefaultOption = function(ecModel) {
  5508. var defaultOption2 = {
  5509. show: true,
  5510. readOnly: false,
  5511. optionToContent: null,
  5512. contentToOption: null,
  5513. 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",
  5514. title: ecModel.getLocaleModel().get(["toolbox", "dataView", "title"]),
  5515. lang: ecModel.getLocaleModel().get(["toolbox", "dataView", "lang"]),
  5516. backgroundColor: "#fff",
  5517. textColor: "#000",
  5518. textareaColor: "#fff",
  5519. textareaBorderColor: "#333",
  5520. buttonColor: "#c23531",
  5521. buttonTextColor: "#fff"
  5522. };
  5523. return defaultOption2;
  5524. };
  5525. return DataView2;
  5526. }(ToolboxFeature);
  5527. function tryMergeDataOption(newData, originalData) {
  5528. return map(newData, function(newVal, idx) {
  5529. var original = originalData && originalData[idx];
  5530. if (isObject(original) && !isArray(original)) {
  5531. var newValIsObject = isObject(newVal) && !isArray(newVal);
  5532. if (!newValIsObject) {
  5533. newVal = {
  5534. value: newVal
  5535. };
  5536. }
  5537. var shouldDeleteName = original.name != null && newVal.name == null;
  5538. newVal = defaults(newVal, original);
  5539. shouldDeleteName && delete newVal.name;
  5540. return newVal;
  5541. } else {
  5542. return newVal;
  5543. }
  5544. });
  5545. }
  5546. registerAction({
  5547. type: "changeDataView",
  5548. event: "dataViewChanged",
  5549. update: "prepareAndUpdate"
  5550. }, function(payload, ecModel) {
  5551. var newSeriesOptList = [];
  5552. each(payload.newOption.series, function(seriesOpt) {
  5553. var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];
  5554. if (!seriesModel) {
  5555. newSeriesOptList.push(extend({
  5556. type: "scatter"
  5557. }, seriesOpt));
  5558. } else {
  5559. var originalData = seriesModel.get("data");
  5560. newSeriesOptList.push({
  5561. name: seriesOpt.name,
  5562. data: tryMergeDataOption(seriesOpt.data, originalData)
  5563. });
  5564. }
  5565. });
  5566. ecModel.mergeOption(defaults({
  5567. series: newSeriesOptList
  5568. }, payload.newOption));
  5569. });
  5570. var DataView_default = DataView;
  5571. // node_modules/echarts/lib/component/toolbox/feature/Restore.js
  5572. init_define_APP_INFO();
  5573. // node_modules/echarts/lib/component/dataZoom/history.js
  5574. init_define_APP_INFO();
  5575. var each4 = each;
  5576. var inner6 = makeInner();
  5577. function push(ecModel, newSnapshot) {
  5578. var storedSnapshots = getStoreSnapshots(ecModel);
  5579. each4(newSnapshot, function(batchItem, dataZoomId) {
  5580. var i = storedSnapshots.length - 1;
  5581. for (; i >= 0; i--) {
  5582. var snapshot = storedSnapshots[i];
  5583. if (snapshot[dataZoomId]) {
  5584. break;
  5585. }
  5586. }
  5587. if (i < 0) {
  5588. var dataZoomModel = ecModel.queryComponents({
  5589. mainType: "dataZoom",
  5590. subType: "select",
  5591. id: dataZoomId
  5592. })[0];
  5593. if (dataZoomModel) {
  5594. var percentRange = dataZoomModel.getPercentRange();
  5595. storedSnapshots[0][dataZoomId] = {
  5596. dataZoomId,
  5597. start: percentRange[0],
  5598. end: percentRange[1]
  5599. };
  5600. }
  5601. }
  5602. });
  5603. storedSnapshots.push(newSnapshot);
  5604. }
  5605. function pop(ecModel) {
  5606. var storedSnapshots = getStoreSnapshots(ecModel);
  5607. var head = storedSnapshots[storedSnapshots.length - 1];
  5608. storedSnapshots.length > 1 && storedSnapshots.pop();
  5609. var snapshot = {};
  5610. each4(head, function(batchItem, dataZoomId) {
  5611. for (var i = storedSnapshots.length - 1; i >= 0; i--) {
  5612. batchItem = storedSnapshots[i][dataZoomId];
  5613. if (batchItem) {
  5614. snapshot[dataZoomId] = batchItem;
  5615. break;
  5616. }
  5617. }
  5618. });
  5619. return snapshot;
  5620. }
  5621. function clear2(ecModel) {
  5622. inner6(ecModel).snapshots = null;
  5623. }
  5624. function count(ecModel) {
  5625. return getStoreSnapshots(ecModel).length;
  5626. }
  5627. function getStoreSnapshots(ecModel) {
  5628. var store = inner6(ecModel);
  5629. if (!store.snapshots) {
  5630. store.snapshots = [{}];
  5631. }
  5632. return store.snapshots;
  5633. }
  5634. // node_modules/echarts/lib/component/toolbox/feature/Restore.js
  5635. var RestoreOption = function(_super) {
  5636. __extends(RestoreOption2, _super);
  5637. function RestoreOption2() {
  5638. return _super !== null && _super.apply(this, arguments) || this;
  5639. }
  5640. RestoreOption2.prototype.onclick = function(ecModel, api) {
  5641. clear2(ecModel);
  5642. api.dispatchAction({
  5643. type: "restore",
  5644. from: this.uid
  5645. });
  5646. };
  5647. RestoreOption2.getDefaultOption = function(ecModel) {
  5648. var defaultOption2 = {
  5649. show: true,
  5650. 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",
  5651. title: ecModel.getLocaleModel().get(["toolbox", "restore", "title"])
  5652. };
  5653. return defaultOption2;
  5654. };
  5655. return RestoreOption2;
  5656. }(ToolboxFeature);
  5657. registerAction({
  5658. type: "restore",
  5659. event: "restore",
  5660. update: "prepareAndUpdate"
  5661. }, function(payload, ecModel) {
  5662. ecModel.resetOption("recreate");
  5663. });
  5664. var Restore_default = RestoreOption;
  5665. // node_modules/echarts/lib/component/toolbox/feature/DataZoom.js
  5666. init_define_APP_INFO();
  5667. // node_modules/echarts/lib/component/helper/BrushTargetManager.js
  5668. init_define_APP_INFO();
  5669. var INCLUDE_FINDER_MAIN_TYPES = ["grid", "xAxis", "yAxis", "geo", "graph", "polar", "radiusAxis", "angleAxis", "bmap"];
  5670. var BrushTargetManager = function() {
  5671. function BrushTargetManager2(finder, ecModel, opt) {
  5672. var _this = this;
  5673. this._targetInfoList = [];
  5674. var foundCpts = parseFinder2(ecModel, finder);
  5675. each(targetInfoBuilders, function(builder, type) {
  5676. if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {
  5677. builder(foundCpts, _this._targetInfoList);
  5678. }
  5679. });
  5680. }
  5681. BrushTargetManager2.prototype.setOutputRanges = function(areas, ecModel) {
  5682. this.matchOutputRanges(areas, ecModel, function(area, coordRange, coordSys) {
  5683. (area.coordRanges || (area.coordRanges = [])).push(coordRange);
  5684. if (!area.coordRange) {
  5685. area.coordRange = coordRange;
  5686. var result = coordConvert[area.brushType](0, coordSys, coordRange);
  5687. area.__rangeOffset = {
  5688. offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),
  5689. xyMinMax: result.xyMinMax
  5690. };
  5691. }
  5692. });
  5693. return areas;
  5694. };
  5695. BrushTargetManager2.prototype.matchOutputRanges = function(areas, ecModel, cb) {
  5696. each(areas, function(area) {
  5697. var targetInfo = this.findTargetInfo(area, ecModel);
  5698. if (targetInfo && targetInfo !== true) {
  5699. each(targetInfo.coordSyses, function(coordSys) {
  5700. var result = coordConvert[area.brushType](1, coordSys, area.range, true);
  5701. cb(area, result.values, coordSys, ecModel);
  5702. });
  5703. }
  5704. }, this);
  5705. };
  5706. BrushTargetManager2.prototype.setInputRanges = function(areas, ecModel) {
  5707. each(areas, function(area) {
  5708. var targetInfo = this.findTargetInfo(area, ecModel);
  5709. if (true) {
  5710. assert(!targetInfo || targetInfo === true || area.coordRange, "coordRange must be specified when coord index specified.");
  5711. assert(!targetInfo || targetInfo !== true || area.range, "range must be specified in global brush.");
  5712. }
  5713. area.range = area.range || [];
  5714. if (targetInfo && targetInfo !== true) {
  5715. area.panelId = targetInfo.panelId;
  5716. var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);
  5717. var rangeOffset = area.__rangeOffset;
  5718. area.range = rangeOffset ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax)) : result.values;
  5719. }
  5720. }, this);
  5721. };
  5722. BrushTargetManager2.prototype.makePanelOpts = function(api, getDefaultBrushType) {
  5723. return map(this._targetInfoList, function(targetInfo) {
  5724. var rect = targetInfo.getPanelRect();
  5725. return {
  5726. panelId: targetInfo.panelId,
  5727. defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null,
  5728. clipPath: makeRectPanelClipPath(rect),
  5729. isTargetByCursor: makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),
  5730. getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect)
  5731. };
  5732. });
  5733. };
  5734. BrushTargetManager2.prototype.controlSeries = function(area, seriesModel, ecModel) {
  5735. var targetInfo = this.findTargetInfo(area, ecModel);
  5736. return targetInfo === true || targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0;
  5737. };
  5738. BrushTargetManager2.prototype.findTargetInfo = function(area, ecModel) {
  5739. var targetInfoList = this._targetInfoList;
  5740. var foundCpts = parseFinder2(ecModel, area);
  5741. for (var i = 0; i < targetInfoList.length; i++) {
  5742. var targetInfo = targetInfoList[i];
  5743. var areaPanelId = area.panelId;
  5744. if (areaPanelId) {
  5745. if (targetInfo.panelId === areaPanelId) {
  5746. return targetInfo;
  5747. }
  5748. } else {
  5749. for (var j = 0; j < targetInfoMatchers.length; j++) {
  5750. if (targetInfoMatchers[j](foundCpts, targetInfo)) {
  5751. return targetInfo;
  5752. }
  5753. }
  5754. }
  5755. }
  5756. return true;
  5757. };
  5758. return BrushTargetManager2;
  5759. }();
  5760. function formatMinMax(minMax) {
  5761. minMax[0] > minMax[1] && minMax.reverse();
  5762. return minMax;
  5763. }
  5764. function parseFinder2(ecModel, finder) {
  5765. return parseFinder(ecModel, finder, {
  5766. includeMainTypes: INCLUDE_FINDER_MAIN_TYPES
  5767. });
  5768. }
  5769. var targetInfoBuilders = {
  5770. grid: function(foundCpts, targetInfoList) {
  5771. var xAxisModels = foundCpts.xAxisModels;
  5772. var yAxisModels = foundCpts.yAxisModels;
  5773. var gridModels = foundCpts.gridModels;
  5774. var gridModelMap = createHashMap();
  5775. var xAxesHas = {};
  5776. var yAxesHas = {};
  5777. if (!xAxisModels && !yAxisModels && !gridModels) {
  5778. return;
  5779. }
  5780. each(xAxisModels, function(axisModel) {
  5781. var gridModel = axisModel.axis.grid.model;
  5782. gridModelMap.set(gridModel.id, gridModel);
  5783. xAxesHas[gridModel.id] = true;
  5784. });
  5785. each(yAxisModels, function(axisModel) {
  5786. var gridModel = axisModel.axis.grid.model;
  5787. gridModelMap.set(gridModel.id, gridModel);
  5788. yAxesHas[gridModel.id] = true;
  5789. });
  5790. each(gridModels, function(gridModel) {
  5791. gridModelMap.set(gridModel.id, gridModel);
  5792. xAxesHas[gridModel.id] = true;
  5793. yAxesHas[gridModel.id] = true;
  5794. });
  5795. gridModelMap.each(function(gridModel) {
  5796. var grid = gridModel.coordinateSystem;
  5797. var cartesians = [];
  5798. each(grid.getCartesians(), function(cartesian, index) {
  5799. if (indexOf(xAxisModels, cartesian.getAxis("x").model) >= 0 || indexOf(yAxisModels, cartesian.getAxis("y").model) >= 0) {
  5800. cartesians.push(cartesian);
  5801. }
  5802. });
  5803. targetInfoList.push({
  5804. panelId: "grid--" + gridModel.id,
  5805. gridModel,
  5806. coordSysModel: gridModel,
  5807. coordSys: cartesians[0],
  5808. coordSyses: cartesians,
  5809. getPanelRect: panelRectBuilders.grid,
  5810. xAxisDeclared: xAxesHas[gridModel.id],
  5811. yAxisDeclared: yAxesHas[gridModel.id]
  5812. });
  5813. });
  5814. },
  5815. geo: function(foundCpts, targetInfoList) {
  5816. each(foundCpts.geoModels, function(geoModel) {
  5817. var coordSys = geoModel.coordinateSystem;
  5818. targetInfoList.push({
  5819. panelId: "geo--" + geoModel.id,
  5820. geoModel,
  5821. coordSysModel: geoModel,
  5822. coordSys,
  5823. coordSyses: [coordSys],
  5824. getPanelRect: panelRectBuilders.geo
  5825. });
  5826. });
  5827. }
  5828. };
  5829. var targetInfoMatchers = [
  5830. function(foundCpts, targetInfo) {
  5831. var xAxisModel = foundCpts.xAxisModel;
  5832. var yAxisModel = foundCpts.yAxisModel;
  5833. var gridModel = foundCpts.gridModel;
  5834. !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);
  5835. !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);
  5836. return gridModel && gridModel === targetInfo.gridModel;
  5837. },
  5838. function(foundCpts, targetInfo) {
  5839. var geoModel = foundCpts.geoModel;
  5840. return geoModel && geoModel === targetInfo.geoModel;
  5841. }
  5842. ];
  5843. var panelRectBuilders = {
  5844. grid: function() {
  5845. return this.coordSys.master.getRect().clone();
  5846. },
  5847. geo: function() {
  5848. var coordSys = this.coordSys;
  5849. var rect = coordSys.getBoundingRect().clone();
  5850. rect.applyTransform(getTransform(coordSys));
  5851. return rect;
  5852. }
  5853. };
  5854. var coordConvert = {
  5855. lineX: curry(axisConvert, 0),
  5856. lineY: curry(axisConvert, 1),
  5857. rect: function(to, coordSys, rangeOrCoordRange, clamp) {
  5858. var xminymin = to ? coordSys.pointToData([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp);
  5859. var xmaxymax = to ? coordSys.pointToData([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp);
  5860. var values = [formatMinMax([xminymin[0], xmaxymax[0]]), formatMinMax([xminymin[1], xmaxymax[1]])];
  5861. return {
  5862. values,
  5863. xyMinMax: values
  5864. };
  5865. },
  5866. polygon: function(to, coordSys, rangeOrCoordRange, clamp) {
  5867. var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];
  5868. var values = map(rangeOrCoordRange, function(item) {
  5869. var p = to ? coordSys.pointToData(item, clamp) : coordSys.dataToPoint(item, clamp);
  5870. xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);
  5871. xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);
  5872. xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);
  5873. xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);
  5874. return p;
  5875. });
  5876. return {
  5877. values,
  5878. xyMinMax
  5879. };
  5880. }
  5881. };
  5882. function axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {
  5883. if (true) {
  5884. assert(coordSys.type === "cartesian2d", "lineX/lineY brush is available only in cartesian2d.");
  5885. }
  5886. var axis = coordSys.getAxis(["x", "y"][axisNameIndex]);
  5887. var values = formatMinMax(map([0, 1], function(i) {
  5888. return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]), true) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));
  5889. }));
  5890. var xyMinMax = [];
  5891. xyMinMax[axisNameIndex] = values;
  5892. xyMinMax[1 - axisNameIndex] = [NaN, NaN];
  5893. return {
  5894. values,
  5895. xyMinMax
  5896. };
  5897. }
  5898. var diffProcessor = {
  5899. lineX: curry(axisDiffProcessor, 0),
  5900. lineY: curry(axisDiffProcessor, 1),
  5901. rect: function(values, refer, scales) {
  5902. return [[values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]], [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]];
  5903. },
  5904. polygon: function(values, refer, scales) {
  5905. return map(values, function(item, idx) {
  5906. return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];
  5907. });
  5908. }
  5909. };
  5910. function axisDiffProcessor(axisNameIndex, values, refer, scales) {
  5911. return [values[0] - scales[axisNameIndex] * refer[0], values[1] - scales[axisNameIndex] * refer[1]];
  5912. }
  5913. function getScales(xyMinMaxCurr, xyMinMaxOrigin) {
  5914. var sizeCurr = getSize(xyMinMaxCurr);
  5915. var sizeOrigin = getSize(xyMinMaxOrigin);
  5916. var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];
  5917. isNaN(scales[0]) && (scales[0] = 1);
  5918. isNaN(scales[1]) && (scales[1] = 1);
  5919. return scales;
  5920. }
  5921. function getSize(xyMinMax) {
  5922. return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN];
  5923. }
  5924. var BrushTargetManager_default = BrushTargetManager;
  5925. // node_modules/echarts/lib/component/toolbox/feature/DataZoom.js
  5926. var each5 = each;
  5927. var DATA_ZOOM_ID_BASE = makeInternalComponentId("toolbox-dataZoom_");
  5928. var DataZoomFeature = function(_super) {
  5929. __extends(DataZoomFeature2, _super);
  5930. function DataZoomFeature2() {
  5931. return _super !== null && _super.apply(this, arguments) || this;
  5932. }
  5933. DataZoomFeature2.prototype.render = function(featureModel, ecModel, api, payload) {
  5934. if (!this._brushController) {
  5935. this._brushController = new BrushController_default(api.getZr());
  5936. this._brushController.on("brush", bind(this._onBrush, this)).mount();
  5937. }
  5938. updateZoomBtnStatus(featureModel, ecModel, this, payload, api);
  5939. updateBackBtnStatus(featureModel, ecModel);
  5940. };
  5941. DataZoomFeature2.prototype.onclick = function(ecModel, api, type) {
  5942. handlers[type].call(this);
  5943. };
  5944. DataZoomFeature2.prototype.remove = function(ecModel, api) {
  5945. this._brushController && this._brushController.unmount();
  5946. };
  5947. DataZoomFeature2.prototype.dispose = function(ecModel, api) {
  5948. this._brushController && this._brushController.dispose();
  5949. };
  5950. DataZoomFeature2.prototype._onBrush = function(eventParam) {
  5951. var areas = eventParam.areas;
  5952. if (!eventParam.isEnd || !areas.length) {
  5953. return;
  5954. }
  5955. var snapshot = {};
  5956. var ecModel = this.ecModel;
  5957. this._brushController.updateCovers([]);
  5958. var brushTargetManager = new BrushTargetManager_default(makeAxisFinder(this.model), ecModel, {
  5959. include: ["grid"]
  5960. });
  5961. brushTargetManager.matchOutputRanges(areas, ecModel, function(area, coordRange, coordSys) {
  5962. if (coordSys.type !== "cartesian2d") {
  5963. return;
  5964. }
  5965. var brushType = area.brushType;
  5966. if (brushType === "rect") {
  5967. setBatch("x", coordSys, coordRange[0]);
  5968. setBatch("y", coordSys, coordRange[1]);
  5969. } else {
  5970. setBatch({
  5971. lineX: "x",
  5972. lineY: "y"
  5973. }[brushType], coordSys, coordRange);
  5974. }
  5975. });
  5976. push(ecModel, snapshot);
  5977. this._dispatchZoomAction(snapshot);
  5978. function setBatch(dimName, coordSys, minMax) {
  5979. var axis = coordSys.getAxis(dimName);
  5980. var axisModel = axis.model;
  5981. var dataZoomModel = findDataZoom(dimName, axisModel, ecModel);
  5982. var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();
  5983. if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {
  5984. minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan);
  5985. }
  5986. dataZoomModel && (snapshot[dataZoomModel.id] = {
  5987. dataZoomId: dataZoomModel.id,
  5988. startValue: minMax[0],
  5989. endValue: minMax[1]
  5990. });
  5991. }
  5992. function findDataZoom(dimName, axisModel, ecModel2) {
  5993. var found;
  5994. ecModel2.eachComponent({
  5995. mainType: "dataZoom",
  5996. subType: "select"
  5997. }, function(dzModel) {
  5998. var has3 = dzModel.getAxisModel(dimName, axisModel.componentIndex);
  5999. has3 && (found = dzModel);
  6000. });
  6001. return found;
  6002. }
  6003. };
  6004. ;
  6005. DataZoomFeature2.prototype._dispatchZoomAction = function(snapshot) {
  6006. var batch = [];
  6007. each5(snapshot, function(batchItem, dataZoomId) {
  6008. batch.push(clone(batchItem));
  6009. });
  6010. batch.length && this.api.dispatchAction({
  6011. type: "dataZoom",
  6012. from: this.uid,
  6013. batch
  6014. });
  6015. };
  6016. DataZoomFeature2.getDefaultOption = function(ecModel) {
  6017. var defaultOption2 = {
  6018. show: true,
  6019. filterMode: "filter",
  6020. icon: {
  6021. zoom: "M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",
  6022. back: "M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"
  6023. },
  6024. title: ecModel.getLocaleModel().get(["toolbox", "dataZoom", "title"]),
  6025. brushStyle: {
  6026. borderWidth: 0,
  6027. color: "rgba(210,219,238,0.2)"
  6028. }
  6029. };
  6030. return defaultOption2;
  6031. };
  6032. return DataZoomFeature2;
  6033. }(ToolboxFeature);
  6034. var handlers = {
  6035. zoom: function() {
  6036. var nextActive = !this._isZoomActive;
  6037. this.api.dispatchAction({
  6038. type: "takeGlobalCursor",
  6039. key: "dataZoomSelect",
  6040. dataZoomSelectActive: nextActive
  6041. });
  6042. },
  6043. back: function() {
  6044. this._dispatchZoomAction(pop(this.ecModel));
  6045. }
  6046. };
  6047. function makeAxisFinder(dzFeatureModel) {
  6048. var setting = {
  6049. xAxisIndex: dzFeatureModel.get("xAxisIndex", true),
  6050. yAxisIndex: dzFeatureModel.get("yAxisIndex", true),
  6051. xAxisId: dzFeatureModel.get("xAxisId", true),
  6052. yAxisId: dzFeatureModel.get("yAxisId", true)
  6053. };
  6054. if (setting.xAxisIndex == null && setting.xAxisId == null) {
  6055. setting.xAxisIndex = "all";
  6056. }
  6057. if (setting.yAxisIndex == null && setting.yAxisId == null) {
  6058. setting.yAxisIndex = "all";
  6059. }
  6060. return setting;
  6061. }
  6062. function updateBackBtnStatus(featureModel, ecModel) {
  6063. featureModel.setIconStatus("back", count(ecModel) > 1 ? "emphasis" : "normal");
  6064. }
  6065. function updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {
  6066. var zoomActive = view._isZoomActive;
  6067. if (payload && payload.type === "takeGlobalCursor") {
  6068. zoomActive = payload.key === "dataZoomSelect" ? payload.dataZoomSelectActive : false;
  6069. }
  6070. view._isZoomActive = zoomActive;
  6071. featureModel.setIconStatus("zoom", zoomActive ? "emphasis" : "normal");
  6072. var brushTargetManager = new BrushTargetManager_default(makeAxisFinder(featureModel), ecModel, {
  6073. include: ["grid"]
  6074. });
  6075. var panels = brushTargetManager.makePanelOpts(api, function(targetInfo) {
  6076. return targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared ? "lineX" : !targetInfo.xAxisDeclared && targetInfo.yAxisDeclared ? "lineY" : "rect";
  6077. });
  6078. view._brushController.setPanels(panels).enableBrush(zoomActive && panels.length ? {
  6079. brushType: "auto",
  6080. brushStyle: featureModel.getModel("brushStyle").getItemStyle()
  6081. } : false);
  6082. }
  6083. registerInternalOptionCreator("dataZoom", function(ecModel) {
  6084. var toolboxModel = ecModel.getComponent("toolbox", 0);
  6085. var featureDataZoomPath = ["feature", "dataZoom"];
  6086. if (!toolboxModel || toolboxModel.get(featureDataZoomPath) == null) {
  6087. return;
  6088. }
  6089. var dzFeatureModel = toolboxModel.getModel(featureDataZoomPath);
  6090. var dzOptions = [];
  6091. var finder = makeAxisFinder(dzFeatureModel);
  6092. var finderResult = parseFinder(ecModel, finder);
  6093. each5(finderResult.xAxisModels, function(axisModel) {
  6094. return buildInternalOptions(axisModel, "xAxis", "xAxisIndex");
  6095. });
  6096. each5(finderResult.yAxisModels, function(axisModel) {
  6097. return buildInternalOptions(axisModel, "yAxis", "yAxisIndex");
  6098. });
  6099. function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) {
  6100. var axisIndex = axisModel.componentIndex;
  6101. var newOpt = {
  6102. type: "select",
  6103. $fromToolbox: true,
  6104. filterMode: dzFeatureModel.get("filterMode", true) || "filter",
  6105. id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex
  6106. };
  6107. newOpt[axisIndexPropName] = axisIndex;
  6108. dzOptions.push(newOpt);
  6109. }
  6110. return dzOptions;
  6111. });
  6112. var DataZoom_default = DataZoomFeature;
  6113. // node_modules/echarts/lib/component/toolbox/install.js
  6114. function install12(registers) {
  6115. registers.registerComponentModel(ToolboxModel_default);
  6116. registers.registerComponentView(ToolboxView_default);
  6117. registerFeature("saveAsImage", SaveAsImage_default);
  6118. registerFeature("magicType", MagicType_default);
  6119. registerFeature("dataView", DataView_default);
  6120. registerFeature("dataZoom", DataZoom_default);
  6121. registerFeature("restore", Restore_default);
  6122. use(install11);
  6123. }
  6124. // node_modules/echarts/lib/component/tooltip/install.js
  6125. init_define_APP_INFO();
  6126. // node_modules/echarts/lib/component/tooltip/TooltipModel.js
  6127. init_define_APP_INFO();
  6128. var TooltipModel = function(_super) {
  6129. __extends(TooltipModel2, _super);
  6130. function TooltipModel2() {
  6131. var _this = _super !== null && _super.apply(this, arguments) || this;
  6132. _this.type = TooltipModel2.type;
  6133. return _this;
  6134. }
  6135. TooltipModel2.type = "tooltip";
  6136. TooltipModel2.dependencies = ["axisPointer"];
  6137. TooltipModel2.defaultOption = {
  6138. z: 60,
  6139. show: true,
  6140. showContent: true,
  6141. trigger: "item",
  6142. triggerOn: "mousemove|click",
  6143. alwaysShowContent: false,
  6144. displayMode: "single",
  6145. renderMode: "auto",
  6146. confine: null,
  6147. showDelay: 0,
  6148. hideDelay: 100,
  6149. transitionDuration: 0.4,
  6150. enterable: false,
  6151. backgroundColor: "#fff",
  6152. shadowBlur: 10,
  6153. shadowColor: "rgba(0, 0, 0, .2)",
  6154. shadowOffsetX: 1,
  6155. shadowOffsetY: 2,
  6156. borderRadius: 4,
  6157. borderWidth: 1,
  6158. padding: null,
  6159. extraCssText: "",
  6160. axisPointer: {
  6161. type: "line",
  6162. axis: "auto",
  6163. animation: "auto",
  6164. animationDurationUpdate: 200,
  6165. animationEasingUpdate: "exponentialOut",
  6166. crossStyle: {
  6167. color: "#999",
  6168. width: 1,
  6169. type: "dashed",
  6170. textStyle: {}
  6171. }
  6172. },
  6173. textStyle: {
  6174. color: "#666",
  6175. fontSize: 14
  6176. }
  6177. };
  6178. return TooltipModel2;
  6179. }(Component_default);
  6180. var TooltipModel_default = TooltipModel;
  6181. // node_modules/echarts/lib/component/tooltip/TooltipView.js
  6182. init_define_APP_INFO();
  6183. // node_modules/echarts/lib/component/tooltip/TooltipHTMLContent.js
  6184. init_define_APP_INFO();
  6185. // node_modules/echarts/lib/component/tooltip/helper.js
  6186. init_define_APP_INFO();
  6187. function shouldTooltipConfine(tooltipModel) {
  6188. var confineOption = tooltipModel.get("confine");
  6189. return confineOption != null ? !!confineOption : tooltipModel.get("renderMode") === "richText";
  6190. }
  6191. function testStyle(styleProps) {
  6192. if (!env_default.domSupported) {
  6193. return;
  6194. }
  6195. var style = document.documentElement.style;
  6196. for (var i = 0, len = styleProps.length; i < len; i++) {
  6197. if (styleProps[i] in style) {
  6198. return styleProps[i];
  6199. }
  6200. }
  6201. }
  6202. var TRANSFORM_VENDOR = testStyle(["transform", "webkitTransform", "OTransform", "MozTransform", "msTransform"]);
  6203. var TRANSITION_VENDOR = testStyle(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]);
  6204. function toCSSVendorPrefix(styleVendor, styleProp) {
  6205. if (!styleVendor) {
  6206. return styleProp;
  6207. }
  6208. styleProp = toCamelCase(styleProp, true);
  6209. var idx = styleVendor.indexOf(styleProp);
  6210. styleVendor = idx === -1 ? styleProp : "-" + styleVendor.slice(0, idx) + "-" + styleProp;
  6211. return styleVendor.toLowerCase();
  6212. }
  6213. function getComputedStyle(el, style) {
  6214. var stl = el.currentStyle || document.defaultView && document.defaultView.getComputedStyle(el);
  6215. return stl ? style ? stl[style] : stl : null;
  6216. }
  6217. // node_modules/echarts/lib/component/tooltip/TooltipHTMLContent.js
  6218. var CSS_TRANSITION_VENDOR = toCSSVendorPrefix(TRANSITION_VENDOR, "transition");
  6219. var CSS_TRANSFORM_VENDOR = toCSSVendorPrefix(TRANSFORM_VENDOR, "transform");
  6220. var gCssText = "position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;" + (env_default.transform3dSupported ? "will-change:transform;" : "");
  6221. function mirrorPos(pos) {
  6222. pos = pos === "left" ? "right" : pos === "right" ? "left" : pos === "top" ? "bottom" : "top";
  6223. return pos;
  6224. }
  6225. function assembleArrow(tooltipModel, borderColor, arrowPosition) {
  6226. if (!isString(arrowPosition) || arrowPosition === "inside") {
  6227. return "";
  6228. }
  6229. var backgroundColor = tooltipModel.get("backgroundColor");
  6230. var borderWidth = tooltipModel.get("borderWidth");
  6231. borderColor = convertToColorString(borderColor);
  6232. var arrowPos = mirrorPos(arrowPosition);
  6233. var arrowSize = Math.max(Math.round(borderWidth) * 1.5, 6);
  6234. var positionStyle = "";
  6235. var transformStyle = CSS_TRANSFORM_VENDOR + ":";
  6236. var rotateDeg;
  6237. if (indexOf(["left", "right"], arrowPos) > -1) {
  6238. positionStyle += "top:50%";
  6239. transformStyle += "translateY(-50%) rotate(" + (rotateDeg = arrowPos === "left" ? -225 : -45) + "deg)";
  6240. } else {
  6241. positionStyle += "left:50%";
  6242. transformStyle += "translateX(-50%) rotate(" + (rotateDeg = arrowPos === "top" ? 225 : 45) + "deg)";
  6243. }
  6244. var rotateRadian = rotateDeg * Math.PI / 180;
  6245. var arrowWH = arrowSize + borderWidth;
  6246. var rotatedWH = arrowWH * Math.abs(Math.cos(rotateRadian)) + arrowWH * Math.abs(Math.sin(rotateRadian));
  6247. var arrowOffset = Math.round(((rotatedWH - Math.SQRT2 * borderWidth) / 2 + Math.SQRT2 * borderWidth - (rotatedWH - arrowWH) / 2) * 100) / 100;
  6248. positionStyle += ";" + arrowPos + ":-" + arrowOffset + "px";
  6249. var borderStyle = borderColor + " solid " + borderWidth + "px;";
  6250. var styleCss = ["position:absolute;width:" + arrowSize + "px;height:" + arrowSize + "px;", positionStyle + ";" + transformStyle + ";", "border-bottom:" + borderStyle, "border-right:" + borderStyle, "background-color:" + backgroundColor + ";"];
  6251. return '<div style="' + styleCss.join("") + '"></div>';
  6252. }
  6253. function assembleTransition(duration, onlyFade) {
  6254. var transitionCurve = "cubic-bezier(0.23,1,0.32,1)";
  6255. var transitionOption = " " + duration / 2 + "s " + transitionCurve;
  6256. var transitionText = "opacity" + transitionOption + ",visibility" + transitionOption;
  6257. if (!onlyFade) {
  6258. transitionOption = " " + duration + "s " + transitionCurve;
  6259. transitionText += env_default.transformSupported ? "," + CSS_TRANSFORM_VENDOR + transitionOption : ",left" + transitionOption + ",top" + transitionOption;
  6260. }
  6261. return CSS_TRANSITION_VENDOR + ":" + transitionText;
  6262. }
  6263. function assembleTransform(x, y, toString) {
  6264. var x0 = x.toFixed(0) + "px";
  6265. var y0 = y.toFixed(0) + "px";
  6266. if (!env_default.transformSupported) {
  6267. return toString ? "top:" + y0 + ";left:" + x0 + ";" : [["top", y0], ["left", x0]];
  6268. }
  6269. var is3d = env_default.transform3dSupported;
  6270. var translate2 = "translate" + (is3d ? "3d" : "") + "(" + x0 + "," + y0 + (is3d ? ",0" : "") + ")";
  6271. return toString ? "top:0;left:0;" + CSS_TRANSFORM_VENDOR + ":" + translate2 + ";" : [["top", 0], ["left", 0], [TRANSFORM_VENDOR, translate2]];
  6272. }
  6273. function assembleFont(textStyleModel) {
  6274. var cssText = [];
  6275. var fontSize = textStyleModel.get("fontSize");
  6276. var color = textStyleModel.getTextColor();
  6277. color && cssText.push("color:" + color);
  6278. cssText.push("font:" + textStyleModel.getFont());
  6279. fontSize && cssText.push("line-height:" + Math.round(fontSize * 3 / 2) + "px");
  6280. var shadowColor = textStyleModel.get("textShadowColor");
  6281. var shadowBlur = textStyleModel.get("textShadowBlur") || 0;
  6282. var shadowOffsetX = textStyleModel.get("textShadowOffsetX") || 0;
  6283. var shadowOffsetY = textStyleModel.get("textShadowOffsetY") || 0;
  6284. shadowColor && shadowBlur && cssText.push("text-shadow:" + shadowOffsetX + "px " + shadowOffsetY + "px " + shadowBlur + "px " + shadowColor);
  6285. each(["decoration", "align"], function(name) {
  6286. var val = textStyleModel.get(name);
  6287. val && cssText.push("text-" + name + ":" + val);
  6288. });
  6289. return cssText.join(";");
  6290. }
  6291. function assembleCssText(tooltipModel, enableTransition, onlyFade) {
  6292. var cssText = [];
  6293. var transitionDuration = tooltipModel.get("transitionDuration");
  6294. var backgroundColor = tooltipModel.get("backgroundColor");
  6295. var shadowBlur = tooltipModel.get("shadowBlur");
  6296. var shadowColor = tooltipModel.get("shadowColor");
  6297. var shadowOffsetX = tooltipModel.get("shadowOffsetX");
  6298. var shadowOffsetY = tooltipModel.get("shadowOffsetY");
  6299. var textStyleModel = tooltipModel.getModel("textStyle");
  6300. var padding = getPaddingFromTooltipModel(tooltipModel, "html");
  6301. var boxShadow = shadowOffsetX + "px " + shadowOffsetY + "px " + shadowBlur + "px " + shadowColor;
  6302. cssText.push("box-shadow:" + boxShadow);
  6303. enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade));
  6304. if (backgroundColor) {
  6305. cssText.push("background-color:" + backgroundColor);
  6306. }
  6307. each(["width", "color", "radius"], function(name) {
  6308. var borderName = "border-" + name;
  6309. var camelCase = toCamelCase(borderName);
  6310. var val = tooltipModel.get(camelCase);
  6311. val != null && cssText.push(borderName + ":" + val + (name === "color" ? "" : "px"));
  6312. });
  6313. cssText.push(assembleFont(textStyleModel));
  6314. if (padding != null) {
  6315. cssText.push("padding:" + normalizeCssArray(padding).join("px ") + "px");
  6316. }
  6317. return cssText.join(";") + ";";
  6318. }
  6319. function makeStyleCoord(out, zr, appendToBody, zrX, zrY) {
  6320. var zrPainter = zr && zr.painter;
  6321. if (appendToBody) {
  6322. var zrViewportRoot = zrPainter && zrPainter.getViewportRoot();
  6323. if (zrViewportRoot) {
  6324. transformLocalCoord(out, zrViewportRoot, document.body, zrX, zrY);
  6325. }
  6326. } else {
  6327. out[0] = zrX;
  6328. out[1] = zrY;
  6329. var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset();
  6330. if (viewportRootOffset) {
  6331. out[0] += viewportRootOffset.offsetLeft;
  6332. out[1] += viewportRootOffset.offsetTop;
  6333. }
  6334. }
  6335. out[2] = out[0] / zr.getWidth();
  6336. out[3] = out[1] / zr.getHeight();
  6337. }
  6338. var TooltipHTMLContent = function() {
  6339. function TooltipHTMLContent2(container, api, opt) {
  6340. this._show = false;
  6341. this._styleCoord = [0, 0, 0, 0];
  6342. this._enterable = true;
  6343. this._firstShow = true;
  6344. this._longHide = true;
  6345. if (env_default.wxa) {
  6346. return null;
  6347. }
  6348. var el = document.createElement("div");
  6349. el.domBelongToZr = true;
  6350. this.el = el;
  6351. var zr = this._zr = api.getZr();
  6352. var appendToBody = this._appendToBody = opt && opt.appendToBody;
  6353. makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2);
  6354. if (appendToBody) {
  6355. document.body.appendChild(el);
  6356. } else {
  6357. container.appendChild(el);
  6358. }
  6359. this._container = container;
  6360. var self = this;
  6361. el.onmouseenter = function() {
  6362. if (self._enterable) {
  6363. clearTimeout(self._hideTimeout);
  6364. self._show = true;
  6365. }
  6366. self._inContent = true;
  6367. };
  6368. el.onmousemove = function(e) {
  6369. e = e || window.event;
  6370. if (!self._enterable) {
  6371. var handler = zr.handler;
  6372. var zrViewportRoot = zr.painter.getViewportRoot();
  6373. normalizeEvent(zrViewportRoot, e, true);
  6374. handler.dispatch("mousemove", e);
  6375. }
  6376. };
  6377. el.onmouseleave = function() {
  6378. self._inContent = false;
  6379. if (self._enterable) {
  6380. if (self._show) {
  6381. self.hideLater(self._hideDelay);
  6382. }
  6383. }
  6384. };
  6385. }
  6386. TooltipHTMLContent2.prototype.update = function(tooltipModel) {
  6387. var container = this._container;
  6388. var position = getComputedStyle(container, "position");
  6389. var domStyle = container.style;
  6390. if (domStyle.position !== "absolute" && position !== "absolute") {
  6391. domStyle.position = "relative";
  6392. }
  6393. var alwaysShowContent = tooltipModel.get("alwaysShowContent");
  6394. alwaysShowContent && this._moveIfResized();
  6395. this.el.className = tooltipModel.get("className") || "";
  6396. };
  6397. TooltipHTMLContent2.prototype.show = function(tooltipModel, nearPointColor) {
  6398. clearTimeout(this._hideTimeout);
  6399. clearTimeout(this._longHideTimeout);
  6400. var el = this.el;
  6401. var style = el.style;
  6402. var styleCoord = this._styleCoord;
  6403. if (!el.innerHTML) {
  6404. style.display = "none";
  6405. } else {
  6406. style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide) + assembleTransform(styleCoord[0], styleCoord[1], true) + ("border-color:" + convertToColorString(nearPointColor) + ";") + (tooltipModel.get("extraCssText") || "") + (";pointer-events:" + (this._enterable ? "auto" : "none"));
  6407. }
  6408. this._show = true;
  6409. this._firstShow = false;
  6410. this._longHide = false;
  6411. };
  6412. TooltipHTMLContent2.prototype.setContent = function(content, markers, tooltipModel, borderColor, arrowPosition) {
  6413. var el = this.el;
  6414. if (content == null) {
  6415. el.innerHTML = "";
  6416. return;
  6417. }
  6418. var arrow = "";
  6419. if (isString(arrowPosition) && tooltipModel.get("trigger") === "item" && !shouldTooltipConfine(tooltipModel)) {
  6420. arrow = assembleArrow(tooltipModel, borderColor, arrowPosition);
  6421. }
  6422. if (isString(content)) {
  6423. el.innerHTML = content + arrow;
  6424. } else if (content) {
  6425. el.innerHTML = "";
  6426. if (!isArray(content)) {
  6427. content = [content];
  6428. }
  6429. for (var i = 0; i < content.length; i++) {
  6430. if (isDom(content[i]) && content[i].parentNode !== el) {
  6431. el.appendChild(content[i]);
  6432. }
  6433. }
  6434. if (arrow && el.childNodes.length) {
  6435. var arrowEl = document.createElement("div");
  6436. arrowEl.innerHTML = arrow;
  6437. el.appendChild(arrowEl);
  6438. }
  6439. }
  6440. };
  6441. TooltipHTMLContent2.prototype.setEnterable = function(enterable) {
  6442. this._enterable = enterable;
  6443. };
  6444. TooltipHTMLContent2.prototype.getSize = function() {
  6445. var el = this.el;
  6446. return [el.offsetWidth, el.offsetHeight];
  6447. };
  6448. TooltipHTMLContent2.prototype.moveTo = function(zrX, zrY) {
  6449. var styleCoord = this._styleCoord;
  6450. makeStyleCoord(styleCoord, this._zr, this._appendToBody, zrX, zrY);
  6451. if (styleCoord[0] != null && styleCoord[1] != null) {
  6452. var style_1 = this.el.style;
  6453. var transforms = assembleTransform(styleCoord[0], styleCoord[1]);
  6454. each(transforms, function(transform) {
  6455. style_1[transform[0]] = transform[1];
  6456. });
  6457. }
  6458. };
  6459. TooltipHTMLContent2.prototype._moveIfResized = function() {
  6460. var ratioX = this._styleCoord[2];
  6461. var ratioY = this._styleCoord[3];
  6462. this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());
  6463. };
  6464. TooltipHTMLContent2.prototype.hide = function() {
  6465. var _this = this;
  6466. var style = this.el.style;
  6467. style.visibility = "hidden";
  6468. style.opacity = "0";
  6469. env_default.transform3dSupported && (style.willChange = "");
  6470. this._show = false;
  6471. this._longHideTimeout = setTimeout(function() {
  6472. return _this._longHide = true;
  6473. }, 500);
  6474. };
  6475. TooltipHTMLContent2.prototype.hideLater = function(time) {
  6476. if (this._show && !(this._inContent && this._enterable)) {
  6477. if (time) {
  6478. this._hideDelay = time;
  6479. this._show = false;
  6480. this._hideTimeout = setTimeout(bind(this.hide, this), time);
  6481. } else {
  6482. this.hide();
  6483. }
  6484. }
  6485. };
  6486. TooltipHTMLContent2.prototype.isShow = function() {
  6487. return this._show;
  6488. };
  6489. TooltipHTMLContent2.prototype.dispose = function() {
  6490. this.el.parentNode.removeChild(this.el);
  6491. };
  6492. return TooltipHTMLContent2;
  6493. }();
  6494. var TooltipHTMLContent_default = TooltipHTMLContent;
  6495. // node_modules/echarts/lib/component/tooltip/TooltipRichContent.js
  6496. init_define_APP_INFO();
  6497. var TooltipRichContent = function() {
  6498. function TooltipRichContent2(api) {
  6499. this._show = false;
  6500. this._styleCoord = [0, 0, 0, 0];
  6501. this._enterable = true;
  6502. this._zr = api.getZr();
  6503. makeStyleCoord2(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2);
  6504. }
  6505. TooltipRichContent2.prototype.update = function(tooltipModel) {
  6506. var alwaysShowContent = tooltipModel.get("alwaysShowContent");
  6507. alwaysShowContent && this._moveIfResized();
  6508. };
  6509. TooltipRichContent2.prototype.show = function() {
  6510. if (this._hideTimeout) {
  6511. clearTimeout(this._hideTimeout);
  6512. }
  6513. this.el.show();
  6514. this._show = true;
  6515. };
  6516. TooltipRichContent2.prototype.setContent = function(content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) {
  6517. var _this = this;
  6518. if (isObject(content)) {
  6519. throwError(true ? "Passing DOM nodes as content is not supported in richText tooltip!" : "");
  6520. }
  6521. if (this.el) {
  6522. this._zr.remove(this.el);
  6523. }
  6524. var textStyleModel = tooltipModel.getModel("textStyle");
  6525. this.el = new Text_default({
  6526. style: {
  6527. rich: markupStyleCreator.richTextStyles,
  6528. text: content,
  6529. lineHeight: 22,
  6530. borderWidth: 1,
  6531. borderColor,
  6532. textShadowColor: textStyleModel.get("textShadowColor"),
  6533. fill: tooltipModel.get(["textStyle", "color"]),
  6534. padding: getPaddingFromTooltipModel(tooltipModel, "richText"),
  6535. verticalAlign: "top",
  6536. align: "left"
  6537. },
  6538. z: tooltipModel.get("z")
  6539. });
  6540. each(["backgroundColor", "borderRadius", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"], function(propName) {
  6541. _this.el.style[propName] = tooltipModel.get(propName);
  6542. });
  6543. each(["textShadowBlur", "textShadowOffsetX", "textShadowOffsetY"], function(propName) {
  6544. _this.el.style[propName] = textStyleModel.get(propName) || 0;
  6545. });
  6546. this._zr.add(this.el);
  6547. var self = this;
  6548. this.el.on("mouseover", function() {
  6549. if (self._enterable) {
  6550. clearTimeout(self._hideTimeout);
  6551. self._show = true;
  6552. }
  6553. self._inContent = true;
  6554. });
  6555. this.el.on("mouseout", function() {
  6556. if (self._enterable) {
  6557. if (self._show) {
  6558. self.hideLater(self._hideDelay);
  6559. }
  6560. }
  6561. self._inContent = false;
  6562. });
  6563. };
  6564. TooltipRichContent2.prototype.setEnterable = function(enterable) {
  6565. this._enterable = enterable;
  6566. };
  6567. TooltipRichContent2.prototype.getSize = function() {
  6568. var el = this.el;
  6569. var bounding = this.el.getBoundingRect();
  6570. var shadowOuterSize = calcShadowOuterSize(el.style);
  6571. return [bounding.width + shadowOuterSize.left + shadowOuterSize.right, bounding.height + shadowOuterSize.top + shadowOuterSize.bottom];
  6572. };
  6573. TooltipRichContent2.prototype.moveTo = function(x, y) {
  6574. var el = this.el;
  6575. if (el) {
  6576. var styleCoord = this._styleCoord;
  6577. makeStyleCoord2(styleCoord, this._zr, x, y);
  6578. x = styleCoord[0];
  6579. y = styleCoord[1];
  6580. var style = el.style;
  6581. var borderWidth = mathMaxWith0(style.borderWidth || 0);
  6582. var shadowOuterSize = calcShadowOuterSize(style);
  6583. el.x = x + borderWidth + shadowOuterSize.left;
  6584. el.y = y + borderWidth + shadowOuterSize.top;
  6585. el.markRedraw();
  6586. }
  6587. };
  6588. TooltipRichContent2.prototype._moveIfResized = function() {
  6589. var ratioX = this._styleCoord[2];
  6590. var ratioY = this._styleCoord[3];
  6591. this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());
  6592. };
  6593. TooltipRichContent2.prototype.hide = function() {
  6594. if (this.el) {
  6595. this.el.hide();
  6596. }
  6597. this._show = false;
  6598. };
  6599. TooltipRichContent2.prototype.hideLater = function(time) {
  6600. if (this._show && !(this._inContent && this._enterable)) {
  6601. if (time) {
  6602. this._hideDelay = time;
  6603. this._show = false;
  6604. this._hideTimeout = setTimeout(bind(this.hide, this), time);
  6605. } else {
  6606. this.hide();
  6607. }
  6608. }
  6609. };
  6610. TooltipRichContent2.prototype.isShow = function() {
  6611. return this._show;
  6612. };
  6613. TooltipRichContent2.prototype.dispose = function() {
  6614. this._zr.remove(this.el);
  6615. };
  6616. return TooltipRichContent2;
  6617. }();
  6618. function mathMaxWith0(val) {
  6619. return Math.max(0, val);
  6620. }
  6621. function calcShadowOuterSize(style) {
  6622. var shadowBlur = mathMaxWith0(style.shadowBlur || 0);
  6623. var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0);
  6624. var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0);
  6625. return {
  6626. left: mathMaxWith0(shadowBlur - shadowOffsetX),
  6627. right: mathMaxWith0(shadowBlur + shadowOffsetX),
  6628. top: mathMaxWith0(shadowBlur - shadowOffsetY),
  6629. bottom: mathMaxWith0(shadowBlur + shadowOffsetY)
  6630. };
  6631. }
  6632. function makeStyleCoord2(out, zr, zrX, zrY) {
  6633. out[0] = zrX;
  6634. out[1] = zrY;
  6635. out[2] = out[0] / zr.getWidth();
  6636. out[3] = out[1] / zr.getHeight();
  6637. }
  6638. var TooltipRichContent_default = TooltipRichContent;
  6639. // node_modules/echarts/lib/component/tooltip/TooltipView.js
  6640. var proxyRect = new Rect_default({
  6641. shape: {
  6642. x: -1,
  6643. y: -1,
  6644. width: 2,
  6645. height: 2
  6646. }
  6647. });
  6648. var TooltipView = function(_super) {
  6649. __extends(TooltipView2, _super);
  6650. function TooltipView2() {
  6651. var _this = _super !== null && _super.apply(this, arguments) || this;
  6652. _this.type = TooltipView2.type;
  6653. return _this;
  6654. }
  6655. TooltipView2.prototype.init = function(ecModel, api) {
  6656. if (env_default.node || !api.getDom()) {
  6657. return;
  6658. }
  6659. var tooltipModel = ecModel.getComponent("tooltip");
  6660. var renderMode = this._renderMode = getTooltipRenderMode(tooltipModel.get("renderMode"));
  6661. this._tooltipContent = renderMode === "richText" ? new TooltipRichContent_default(api) : new TooltipHTMLContent_default(api.getDom(), api, {
  6662. appendToBody: tooltipModel.get("appendToBody", true)
  6663. });
  6664. };
  6665. TooltipView2.prototype.render = function(tooltipModel, ecModel, api) {
  6666. if (env_default.node || !api.getDom()) {
  6667. return;
  6668. }
  6669. this.group.removeAll();
  6670. this._tooltipModel = tooltipModel;
  6671. this._ecModel = ecModel;
  6672. this._api = api;
  6673. this._alwaysShowContent = tooltipModel.get("alwaysShowContent");
  6674. var tooltipContent = this._tooltipContent;
  6675. tooltipContent.update(tooltipModel);
  6676. tooltipContent.setEnterable(tooltipModel.get("enterable"));
  6677. this._initGlobalListener();
  6678. this._keepShow();
  6679. if (this._renderMode !== "richText" && tooltipModel.get("transitionDuration")) {
  6680. createOrUpdate(this, "_updatePosition", 50, "fixRate");
  6681. } else {
  6682. clear(this, "_updatePosition");
  6683. }
  6684. };
  6685. TooltipView2.prototype._initGlobalListener = function() {
  6686. var tooltipModel = this._tooltipModel;
  6687. var triggerOn = tooltipModel.get("triggerOn");
  6688. register("itemTooltip", this._api, bind(function(currTrigger, e, dispatchAction3) {
  6689. if (triggerOn !== "none") {
  6690. if (triggerOn.indexOf(currTrigger) >= 0) {
  6691. this._tryShow(e, dispatchAction3);
  6692. } else if (currTrigger === "leave") {
  6693. this._hide(dispatchAction3);
  6694. }
  6695. }
  6696. }, this));
  6697. };
  6698. TooltipView2.prototype._keepShow = function() {
  6699. var tooltipModel = this._tooltipModel;
  6700. var ecModel = this._ecModel;
  6701. var api = this._api;
  6702. var triggerOn = tooltipModel.get("triggerOn");
  6703. if (this._lastX != null && this._lastY != null && triggerOn !== "none" && triggerOn !== "click") {
  6704. var self_1 = this;
  6705. clearTimeout(this._refreshUpdateTimeout);
  6706. this._refreshUpdateTimeout = setTimeout(function() {
  6707. !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, {
  6708. x: self_1._lastX,
  6709. y: self_1._lastY,
  6710. dataByCoordSys: self_1._lastDataByCoordSys
  6711. });
  6712. });
  6713. }
  6714. };
  6715. TooltipView2.prototype.manuallyShowTip = function(tooltipModel, ecModel, api, payload) {
  6716. if (payload.from === this.uid || env_default.node || !api.getDom()) {
  6717. return;
  6718. }
  6719. var dispatchAction3 = makeDispatchAction2(payload, api);
  6720. this._ticket = "";
  6721. var dataByCoordSys = payload.dataByCoordSys;
  6722. var cmptRef = findComponentReference(payload, ecModel, api);
  6723. if (cmptRef) {
  6724. var rect = cmptRef.el.getBoundingRect().clone();
  6725. rect.applyTransform(cmptRef.el.transform);
  6726. this._tryShow({
  6727. offsetX: rect.x + rect.width / 2,
  6728. offsetY: rect.y + rect.height / 2,
  6729. target: cmptRef.el,
  6730. position: payload.position,
  6731. positionDefault: "bottom"
  6732. }, dispatchAction3);
  6733. } else if (payload.tooltip && payload.x != null && payload.y != null) {
  6734. var el = proxyRect;
  6735. el.x = payload.x;
  6736. el.y = payload.y;
  6737. el.update();
  6738. getECData(el).tooltipConfig = {
  6739. name: null,
  6740. option: payload.tooltip
  6741. };
  6742. this._tryShow({
  6743. offsetX: payload.x,
  6744. offsetY: payload.y,
  6745. target: el
  6746. }, dispatchAction3);
  6747. } else if (dataByCoordSys) {
  6748. this._tryShow({
  6749. offsetX: payload.x,
  6750. offsetY: payload.y,
  6751. position: payload.position,
  6752. dataByCoordSys,
  6753. tooltipOption: payload.tooltipOption
  6754. }, dispatchAction3);
  6755. } else if (payload.seriesIndex != null) {
  6756. if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) {
  6757. return;
  6758. }
  6759. var pointInfo = findPointFromSeries(payload, ecModel);
  6760. var cx = pointInfo.point[0];
  6761. var cy = pointInfo.point[1];
  6762. if (cx != null && cy != null) {
  6763. this._tryShow({
  6764. offsetX: cx,
  6765. offsetY: cy,
  6766. target: pointInfo.el,
  6767. position: payload.position,
  6768. positionDefault: "bottom"
  6769. }, dispatchAction3);
  6770. }
  6771. } else if (payload.x != null && payload.y != null) {
  6772. api.dispatchAction({
  6773. type: "updateAxisPointer",
  6774. x: payload.x,
  6775. y: payload.y
  6776. });
  6777. this._tryShow({
  6778. offsetX: payload.x,
  6779. offsetY: payload.y,
  6780. position: payload.position,
  6781. target: api.getZr().findHover(payload.x, payload.y).target
  6782. }, dispatchAction3);
  6783. }
  6784. };
  6785. TooltipView2.prototype.manuallyHideTip = function(tooltipModel, ecModel, api, payload) {
  6786. var tooltipContent = this._tooltipContent;
  6787. if (!this._alwaysShowContent && this._tooltipModel) {
  6788. tooltipContent.hideLater(this._tooltipModel.get("hideDelay"));
  6789. }
  6790. this._lastX = this._lastY = this._lastDataByCoordSys = null;
  6791. if (payload.from !== this.uid) {
  6792. this._hide(makeDispatchAction2(payload, api));
  6793. }
  6794. };
  6795. TooltipView2.prototype._manuallyAxisShowTip = function(tooltipModel, ecModel, api, payload) {
  6796. var seriesIndex = payload.seriesIndex;
  6797. var dataIndex = payload.dataIndex;
  6798. var coordSysAxesInfo = ecModel.getComponent("axisPointer").coordSysAxesInfo;
  6799. if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {
  6800. return;
  6801. }
  6802. var seriesModel = ecModel.getSeriesByIndex(seriesIndex);
  6803. if (!seriesModel) {
  6804. return;
  6805. }
  6806. var data = seriesModel.getData();
  6807. var tooltipCascadedModel = buildTooltipModel([data.getItemModel(dataIndex), seriesModel, (seriesModel.coordinateSystem || {}).model], this._tooltipModel);
  6808. if (tooltipCascadedModel.get("trigger") !== "axis") {
  6809. return;
  6810. }
  6811. api.dispatchAction({
  6812. type: "updateAxisPointer",
  6813. seriesIndex,
  6814. dataIndex,
  6815. position: payload.position
  6816. });
  6817. return true;
  6818. };
  6819. TooltipView2.prototype._tryShow = function(e, dispatchAction3) {
  6820. var el = e.target;
  6821. var tooltipModel = this._tooltipModel;
  6822. if (!tooltipModel) {
  6823. return;
  6824. }
  6825. this._lastX = e.offsetX;
  6826. this._lastY = e.offsetY;
  6827. var dataByCoordSys = e.dataByCoordSys;
  6828. if (dataByCoordSys && dataByCoordSys.length) {
  6829. this._showAxisTooltip(dataByCoordSys, e);
  6830. } else if (el) {
  6831. this._lastDataByCoordSys = null;
  6832. var seriesDispatcher_1;
  6833. var cmptDispatcher_1;
  6834. findEventDispatcher(el, function(target) {
  6835. if (getECData(target).dataIndex != null) {
  6836. seriesDispatcher_1 = target;
  6837. return true;
  6838. }
  6839. if (getECData(target).tooltipConfig != null) {
  6840. cmptDispatcher_1 = target;
  6841. return true;
  6842. }
  6843. }, true);
  6844. if (seriesDispatcher_1) {
  6845. this._showSeriesItemTooltip(e, seriesDispatcher_1, dispatchAction3);
  6846. } else if (cmptDispatcher_1) {
  6847. this._showComponentItemTooltip(e, cmptDispatcher_1, dispatchAction3);
  6848. } else {
  6849. this._hide(dispatchAction3);
  6850. }
  6851. } else {
  6852. this._lastDataByCoordSys = null;
  6853. this._hide(dispatchAction3);
  6854. }
  6855. };
  6856. TooltipView2.prototype._showOrMove = function(tooltipModel, cb) {
  6857. var delay = tooltipModel.get("showDelay");
  6858. cb = bind(cb, this);
  6859. clearTimeout(this._showTimout);
  6860. delay > 0 ? this._showTimout = setTimeout(cb, delay) : cb();
  6861. };
  6862. TooltipView2.prototype._showAxisTooltip = function(dataByCoordSys, e) {
  6863. var ecModel = this._ecModel;
  6864. var globalTooltipModel = this._tooltipModel;
  6865. var point = [e.offsetX, e.offsetY];
  6866. var singleTooltipModel = buildTooltipModel([e.tooltipOption], globalTooltipModel);
  6867. var renderMode = this._renderMode;
  6868. var cbParamsList = [];
  6869. var articleMarkup = createTooltipMarkup("section", {
  6870. blocks: [],
  6871. noHeader: true
  6872. });
  6873. var markupTextArrLegacy = [];
  6874. var markupStyleCreator = new TooltipMarkupStyleCreator();
  6875. each(dataByCoordSys, function(itemCoordSys) {
  6876. each(itemCoordSys.dataByAxis, function(axisItem) {
  6877. var axisModel = ecModel.getComponent(axisItem.axisDim + "Axis", axisItem.axisIndex);
  6878. var axisValue = axisItem.value;
  6879. if (!axisModel || axisValue == null) {
  6880. return;
  6881. }
  6882. var axisValueLabel = getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt);
  6883. var axisSectionMarkup = createTooltipMarkup("section", {
  6884. header: axisValueLabel,
  6885. noHeader: !trim(axisValueLabel),
  6886. sortBlocks: true,
  6887. blocks: []
  6888. });
  6889. articleMarkup.blocks.push(axisSectionMarkup);
  6890. each(axisItem.seriesDataIndices, function(idxItem) {
  6891. var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);
  6892. var dataIndex = idxItem.dataIndexInside;
  6893. var cbParams = series.getDataParams(dataIndex);
  6894. if (cbParams.dataIndex < 0) {
  6895. return;
  6896. }
  6897. cbParams.axisDim = axisItem.axisDim;
  6898. cbParams.axisIndex = axisItem.axisIndex;
  6899. cbParams.axisType = axisItem.axisType;
  6900. cbParams.axisId = axisItem.axisId;
  6901. cbParams.axisValue = getAxisRawValue(axisModel.axis, {
  6902. value: axisValue
  6903. });
  6904. cbParams.axisValueLabel = axisValueLabel;
  6905. cbParams.marker = markupStyleCreator.makeTooltipMarker("item", convertToColorString(cbParams.color), renderMode);
  6906. var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null));
  6907. var frag = seriesTooltipResult.frag;
  6908. if (frag) {
  6909. var valueFormatter = buildTooltipModel([series], globalTooltipModel).get("valueFormatter");
  6910. axisSectionMarkup.blocks.push(valueFormatter ? extend({
  6911. valueFormatter
  6912. }, frag) : frag);
  6913. }
  6914. if (seriesTooltipResult.text) {
  6915. markupTextArrLegacy.push(seriesTooltipResult.text);
  6916. }
  6917. cbParamsList.push(cbParams);
  6918. });
  6919. });
  6920. });
  6921. articleMarkup.blocks.reverse();
  6922. markupTextArrLegacy.reverse();
  6923. var positionExpr = e.position;
  6924. var orderMode = singleTooltipModel.get("order");
  6925. var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get("useUTC"), singleTooltipModel.get("textStyle"));
  6926. builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText);
  6927. var blockBreak = renderMode === "richText" ? "\n\n" : "<br/>";
  6928. var allMarkupText = markupTextArrLegacy.join(blockBreak);
  6929. this._showOrMove(singleTooltipModel, function() {
  6930. if (this._updateContentNotChangedOnAxis(dataByCoordSys, cbParamsList)) {
  6931. this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList);
  6932. } else {
  6933. this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + "", point[0], point[1], positionExpr, null, markupStyleCreator);
  6934. }
  6935. });
  6936. };
  6937. TooltipView2.prototype._showSeriesItemTooltip = function(e, dispatcher, dispatchAction3) {
  6938. var ecModel = this._ecModel;
  6939. var ecData = getECData(dispatcher);
  6940. var seriesIndex = ecData.seriesIndex;
  6941. var seriesModel = ecModel.getSeriesByIndex(seriesIndex);
  6942. var dataModel = ecData.dataModel || seriesModel;
  6943. var dataIndex = ecData.dataIndex;
  6944. var dataType = ecData.dataType;
  6945. var data = dataModel.getData(dataType);
  6946. var renderMode = this._renderMode;
  6947. var positionDefault = e.positionDefault;
  6948. var tooltipModel = buildTooltipModel([data.getItemModel(dataIndex), dataModel, seriesModel && (seriesModel.coordinateSystem || {}).model], this._tooltipModel, positionDefault ? {
  6949. position: positionDefault
  6950. } : null);
  6951. var tooltipTrigger = tooltipModel.get("trigger");
  6952. if (tooltipTrigger != null && tooltipTrigger !== "item") {
  6953. return;
  6954. }
  6955. var params = dataModel.getDataParams(dataIndex, dataType);
  6956. var markupStyleCreator = new TooltipMarkupStyleCreator();
  6957. params.marker = markupStyleCreator.makeTooltipMarker("item", convertToColorString(params.color), renderMode);
  6958. var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType));
  6959. var orderMode = tooltipModel.get("order");
  6960. var valueFormatter = tooltipModel.get("valueFormatter");
  6961. var frag = seriesTooltipResult.frag;
  6962. var markupText = frag ? buildTooltipMarkup(valueFormatter ? extend({
  6963. valueFormatter
  6964. }, frag) : frag, markupStyleCreator, renderMode, orderMode, ecModel.get("useUTC"), tooltipModel.get("textStyle")) : seriesTooltipResult.text;
  6965. var asyncTicket = "item_" + dataModel.name + "_" + dataIndex;
  6966. this._showOrMove(tooltipModel, function() {
  6967. this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator);
  6968. });
  6969. dispatchAction3({
  6970. type: "showTip",
  6971. dataIndexInside: dataIndex,
  6972. dataIndex: data.getRawIndex(dataIndex),
  6973. seriesIndex,
  6974. from: this.uid
  6975. });
  6976. };
  6977. TooltipView2.prototype._showComponentItemTooltip = function(e, el, dispatchAction3) {
  6978. var ecData = getECData(el);
  6979. var tooltipConfig = ecData.tooltipConfig;
  6980. var tooltipOpt = tooltipConfig.option || {};
  6981. if (isString(tooltipOpt)) {
  6982. var content = tooltipOpt;
  6983. tooltipOpt = {
  6984. content,
  6985. formatter: content
  6986. };
  6987. }
  6988. var tooltipModelCascade = [tooltipOpt];
  6989. var cmpt = this._ecModel.getComponent(ecData.componentMainType, ecData.componentIndex);
  6990. if (cmpt) {
  6991. tooltipModelCascade.push(cmpt);
  6992. }
  6993. tooltipModelCascade.push({
  6994. formatter: tooltipOpt.content
  6995. });
  6996. var positionDefault = e.positionDefault;
  6997. var subTooltipModel = buildTooltipModel(tooltipModelCascade, this._tooltipModel, positionDefault ? {
  6998. position: positionDefault
  6999. } : null);
  7000. var defaultHtml = subTooltipModel.get("content");
  7001. var asyncTicket = Math.random() + "";
  7002. var markupStyleCreator = new TooltipMarkupStyleCreator();
  7003. this._showOrMove(subTooltipModel, function() {
  7004. var formatterParams = clone(subTooltipModel.get("formatterParams") || {});
  7005. this._showTooltipContent(subTooltipModel, defaultHtml, formatterParams, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator);
  7006. });
  7007. dispatchAction3({
  7008. type: "showTip",
  7009. from: this.uid
  7010. });
  7011. };
  7012. TooltipView2.prototype._showTooltipContent = function(tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) {
  7013. this._ticket = "";
  7014. if (!tooltipModel.get("showContent") || !tooltipModel.get("show")) {
  7015. return;
  7016. }
  7017. var tooltipContent = this._tooltipContent;
  7018. tooltipContent.setEnterable(tooltipModel.get("enterable"));
  7019. var formatter = tooltipModel.get("formatter");
  7020. positionExpr = positionExpr || tooltipModel.get("position");
  7021. var html = defaultHtml;
  7022. var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get("trigger"), tooltipModel.get("borderColor"));
  7023. var nearPointColor = nearPoint.color;
  7024. if (formatter) {
  7025. if (isString(formatter)) {
  7026. var useUTC = tooltipModel.ecModel.get("useUTC");
  7027. var params0 = isArray(params) ? params[0] : params;
  7028. var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf("time") >= 0;
  7029. html = formatter;
  7030. if (isTimeAxis) {
  7031. html = format(params0.axisValue, html, useUTC);
  7032. }
  7033. html = formatTpl(html, params, true);
  7034. } else if (isFunction(formatter)) {
  7035. var callback = bind(function(cbTicket, html2) {
  7036. if (cbTicket === this._ticket) {
  7037. tooltipContent.setContent(html2, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);
  7038. this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);
  7039. }
  7040. }, this);
  7041. this._ticket = asyncTicket;
  7042. html = formatter(params, asyncTicket, callback);
  7043. } else {
  7044. html = formatter;
  7045. }
  7046. }
  7047. tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);
  7048. tooltipContent.show(tooltipModel, nearPointColor);
  7049. this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);
  7050. };
  7051. TooltipView2.prototype._getNearestPoint = function(point, tooltipDataParams, trigger, borderColor) {
  7052. if (trigger === "axis" || isArray(tooltipDataParams)) {
  7053. return {
  7054. color: borderColor || (this._renderMode === "html" ? "#fff" : "none")
  7055. };
  7056. }
  7057. if (!isArray(tooltipDataParams)) {
  7058. return {
  7059. color: borderColor || tooltipDataParams.color || tooltipDataParams.borderColor
  7060. };
  7061. }
  7062. };
  7063. TooltipView2.prototype._updatePosition = function(tooltipModel, positionExpr, x, y, content, params, el) {
  7064. var viewWidth = this._api.getWidth();
  7065. var viewHeight = this._api.getHeight();
  7066. positionExpr = positionExpr || tooltipModel.get("position");
  7067. var contentSize = content.getSize();
  7068. var align = tooltipModel.get("align");
  7069. var vAlign = tooltipModel.get("verticalAlign");
  7070. var rect = el && el.getBoundingRect().clone();
  7071. el && rect.applyTransform(el.transform);
  7072. if (isFunction(positionExpr)) {
  7073. positionExpr = positionExpr([x, y], params, content.el, rect, {
  7074. viewSize: [viewWidth, viewHeight],
  7075. contentSize: contentSize.slice()
  7076. });
  7077. }
  7078. if (isArray(positionExpr)) {
  7079. x = parsePercent2(positionExpr[0], viewWidth);
  7080. y = parsePercent2(positionExpr[1], viewHeight);
  7081. } else if (isObject(positionExpr)) {
  7082. var boxLayoutPosition = positionExpr;
  7083. boxLayoutPosition.width = contentSize[0];
  7084. boxLayoutPosition.height = contentSize[1];
  7085. var layoutRect = getLayoutRect(boxLayoutPosition, {
  7086. width: viewWidth,
  7087. height: viewHeight
  7088. });
  7089. x = layoutRect.x;
  7090. y = layoutRect.y;
  7091. align = null;
  7092. vAlign = null;
  7093. } else if (isString(positionExpr) && el) {
  7094. var pos = calcTooltipPosition(positionExpr, rect, contentSize, tooltipModel.get("borderWidth"));
  7095. x = pos[0];
  7096. y = pos[1];
  7097. } else {
  7098. var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20);
  7099. x = pos[0];
  7100. y = pos[1];
  7101. }
  7102. align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === "right" ? contentSize[0] : 0);
  7103. vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === "bottom" ? contentSize[1] : 0);
  7104. if (shouldTooltipConfine(tooltipModel)) {
  7105. var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight);
  7106. x = pos[0];
  7107. y = pos[1];
  7108. }
  7109. content.moveTo(x, y);
  7110. };
  7111. TooltipView2.prototype._updateContentNotChangedOnAxis = function(dataByCoordSys, cbParamsList) {
  7112. var lastCoordSys = this._lastDataByCoordSys;
  7113. var lastCbParamsList = this._cbParamsList;
  7114. var contentNotChanged = !!lastCoordSys && lastCoordSys.length === dataByCoordSys.length;
  7115. contentNotChanged && each(lastCoordSys, function(lastItemCoordSys, indexCoordSys) {
  7116. var lastDataByAxis = lastItemCoordSys.dataByAxis || [];
  7117. var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {};
  7118. var thisDataByAxis = thisItemCoordSys.dataByAxis || [];
  7119. contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length;
  7120. contentNotChanged && each(lastDataByAxis, function(lastItem, indexAxis) {
  7121. var thisItem = thisDataByAxis[indexAxis] || {};
  7122. var lastIndices = lastItem.seriesDataIndices || [];
  7123. var newIndices = thisItem.seriesDataIndices || [];
  7124. contentNotChanged = contentNotChanged && lastItem.value === thisItem.value && lastItem.axisType === thisItem.axisType && lastItem.axisId === thisItem.axisId && lastIndices.length === newIndices.length;
  7125. contentNotChanged && each(lastIndices, function(lastIdxItem, j) {
  7126. var newIdxItem = newIndices[j];
  7127. contentNotChanged = contentNotChanged && lastIdxItem.seriesIndex === newIdxItem.seriesIndex && lastIdxItem.dataIndex === newIdxItem.dataIndex;
  7128. });
  7129. lastCbParamsList && each(lastItem.seriesDataIndices, function(idxItem) {
  7130. var seriesIdx = idxItem.seriesIndex;
  7131. var cbParams = cbParamsList[seriesIdx];
  7132. var lastCbParams = lastCbParamsList[seriesIdx];
  7133. if (cbParams && lastCbParams && lastCbParams.data !== cbParams.data) {
  7134. contentNotChanged = false;
  7135. }
  7136. });
  7137. });
  7138. });
  7139. this._lastDataByCoordSys = dataByCoordSys;
  7140. this._cbParamsList = cbParamsList;
  7141. return !!contentNotChanged;
  7142. };
  7143. TooltipView2.prototype._hide = function(dispatchAction3) {
  7144. this._lastDataByCoordSys = null;
  7145. dispatchAction3({
  7146. type: "hideTip",
  7147. from: this.uid
  7148. });
  7149. };
  7150. TooltipView2.prototype.dispose = function(ecModel, api) {
  7151. if (env_default.node || !api.getDom()) {
  7152. return;
  7153. }
  7154. clear(this, "_updatePosition");
  7155. this._tooltipContent.dispose();
  7156. unregister("itemTooltip", api);
  7157. };
  7158. TooltipView2.type = "tooltip";
  7159. return TooltipView2;
  7160. }(Component_default2);
  7161. function buildTooltipModel(modelCascade, globalTooltipModel, defaultTooltipOption) {
  7162. var ecModel = globalTooltipModel.ecModel;
  7163. var resultModel;
  7164. if (defaultTooltipOption) {
  7165. resultModel = new Model_default(defaultTooltipOption, ecModel, ecModel);
  7166. resultModel = new Model_default(globalTooltipModel.option, resultModel, ecModel);
  7167. } else {
  7168. resultModel = globalTooltipModel;
  7169. }
  7170. for (var i = modelCascade.length - 1; i >= 0; i--) {
  7171. var tooltipOpt = modelCascade[i];
  7172. if (tooltipOpt) {
  7173. if (tooltipOpt instanceof Model_default) {
  7174. tooltipOpt = tooltipOpt.get("tooltip", true);
  7175. }
  7176. if (isString(tooltipOpt)) {
  7177. tooltipOpt = {
  7178. formatter: tooltipOpt
  7179. };
  7180. }
  7181. if (tooltipOpt) {
  7182. resultModel = new Model_default(tooltipOpt, resultModel, ecModel);
  7183. }
  7184. }
  7185. }
  7186. return resultModel;
  7187. }
  7188. function makeDispatchAction2(payload, api) {
  7189. return payload.dispatchAction || bind(api.dispatchAction, api);
  7190. }
  7191. function refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) {
  7192. var size = content.getSize();
  7193. var width = size[0];
  7194. var height = size[1];
  7195. if (gapH != null) {
  7196. if (x + width + gapH + 2 > viewWidth) {
  7197. x -= width + gapH;
  7198. } else {
  7199. x += gapH;
  7200. }
  7201. }
  7202. if (gapV != null) {
  7203. if (y + height + gapV > viewHeight) {
  7204. y -= height + gapV;
  7205. } else {
  7206. y += gapV;
  7207. }
  7208. }
  7209. return [x, y];
  7210. }
  7211. function confineTooltipPosition(x, y, content, viewWidth, viewHeight) {
  7212. var size = content.getSize();
  7213. var width = size[0];
  7214. var height = size[1];
  7215. x = Math.min(x + width, viewWidth) - width;
  7216. y = Math.min(y + height, viewHeight) - height;
  7217. x = Math.max(x, 0);
  7218. y = Math.max(y, 0);
  7219. return [x, y];
  7220. }
  7221. function calcTooltipPosition(position, rect, contentSize, borderWidth) {
  7222. var domWidth = contentSize[0];
  7223. var domHeight = contentSize[1];
  7224. var offset = Math.ceil(Math.SQRT2 * borderWidth) + 8;
  7225. var x = 0;
  7226. var y = 0;
  7227. var rectWidth = rect.width;
  7228. var rectHeight = rect.height;
  7229. switch (position) {
  7230. case "inside":
  7231. x = rect.x + rectWidth / 2 - domWidth / 2;
  7232. y = rect.y + rectHeight / 2 - domHeight / 2;
  7233. break;
  7234. case "top":
  7235. x = rect.x + rectWidth / 2 - domWidth / 2;
  7236. y = rect.y - domHeight - offset;
  7237. break;
  7238. case "bottom":
  7239. x = rect.x + rectWidth / 2 - domWidth / 2;
  7240. y = rect.y + rectHeight + offset;
  7241. break;
  7242. case "left":
  7243. x = rect.x - domWidth - offset;
  7244. y = rect.y + rectHeight / 2 - domHeight / 2;
  7245. break;
  7246. case "right":
  7247. x = rect.x + rectWidth + offset;
  7248. y = rect.y + rectHeight / 2 - domHeight / 2;
  7249. }
  7250. return [x, y];
  7251. }
  7252. function isCenterAlign(align) {
  7253. return align === "center" || align === "middle";
  7254. }
  7255. function findComponentReference(payload, ecModel, api) {
  7256. var queryOptionMap = preParseFinder(payload).queryOptionMap;
  7257. var componentMainType = queryOptionMap.keys()[0];
  7258. if (!componentMainType || componentMainType === "series") {
  7259. return;
  7260. }
  7261. var queryResult = queryReferringComponents(ecModel, componentMainType, queryOptionMap.get(componentMainType), {
  7262. useDefault: false,
  7263. enableAll: false,
  7264. enableNone: false
  7265. });
  7266. var model = queryResult.models[0];
  7267. if (!model) {
  7268. return;
  7269. }
  7270. var view = api.getViewOfComponentModel(model);
  7271. var el;
  7272. view.group.traverse(function(subEl) {
  7273. var tooltipConfig = getECData(subEl).tooltipConfig;
  7274. if (tooltipConfig && tooltipConfig.name === payload.name) {
  7275. el = subEl;
  7276. return true;
  7277. }
  7278. });
  7279. if (el) {
  7280. return {
  7281. componentMainType,
  7282. componentIndex: model.componentIndex,
  7283. el
  7284. };
  7285. }
  7286. }
  7287. var TooltipView_default = TooltipView;
  7288. // node_modules/echarts/lib/component/tooltip/install.js
  7289. function install13(registers) {
  7290. use(install5);
  7291. registers.registerComponentModel(TooltipModel_default);
  7292. registers.registerComponentView(TooltipView_default);
  7293. registers.registerAction({
  7294. type: "showTip",
  7295. event: "showTip",
  7296. update: "tooltip:manuallyShowTip"
  7297. }, noop);
  7298. registers.registerAction({
  7299. type: "hideTip",
  7300. event: "hideTip",
  7301. update: "tooltip:manuallyHideTip"
  7302. }, noop);
  7303. }
  7304. // node_modules/echarts/lib/component/brush/install.js
  7305. init_define_APP_INFO();
  7306. // node_modules/echarts/lib/component/brush/preprocessor.js
  7307. init_define_APP_INFO();
  7308. var DEFAULT_TOOLBOX_BTNS = ["rect", "polygon", "keep", "clear"];
  7309. function brushPreprocessor(option, isNew) {
  7310. var brushComponents = normalizeToArray(option ? option.brush : []);
  7311. if (!brushComponents.length) {
  7312. return;
  7313. }
  7314. var brushComponentSpecifiedBtns = [];
  7315. each(brushComponents, function(brushOpt) {
  7316. var tbs = brushOpt.hasOwnProperty("toolbox") ? brushOpt.toolbox : [];
  7317. if (tbs instanceof Array) {
  7318. brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs);
  7319. }
  7320. });
  7321. var toolbox = option && option.toolbox;
  7322. if (isArray(toolbox)) {
  7323. toolbox = toolbox[0];
  7324. }
  7325. if (!toolbox) {
  7326. toolbox = {
  7327. feature: {}
  7328. };
  7329. option.toolbox = [toolbox];
  7330. }
  7331. var toolboxFeature = toolbox.feature || (toolbox.feature = {});
  7332. var toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {});
  7333. var brushTypes = toolboxBrush.type || (toolboxBrush.type = []);
  7334. brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns);
  7335. removeDuplicate(brushTypes);
  7336. if (isNew && !brushTypes.length) {
  7337. brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS);
  7338. }
  7339. }
  7340. function removeDuplicate(arr) {
  7341. var map2 = {};
  7342. each(arr, function(val) {
  7343. map2[val] = 1;
  7344. });
  7345. arr.length = 0;
  7346. each(map2, function(flag, val) {
  7347. arr.push(val);
  7348. });
  7349. }
  7350. // node_modules/echarts/lib/component/brush/BrushView.js
  7351. init_define_APP_INFO();
  7352. // node_modules/echarts/lib/component/brush/visualEncoding.js
  7353. init_define_APP_INFO();
  7354. // node_modules/echarts/lib/visual/visualSolution.js
  7355. init_define_APP_INFO();
  7356. var each6 = each;
  7357. function hasKeys(obj) {
  7358. if (obj) {
  7359. for (var name_1 in obj) {
  7360. if (obj.hasOwnProperty(name_1)) {
  7361. return true;
  7362. }
  7363. }
  7364. }
  7365. }
  7366. function createVisualMappings(option, stateList, supplementVisualOption) {
  7367. var visualMappings = {};
  7368. each6(stateList, function(state) {
  7369. var mappings = visualMappings[state] = createMappings();
  7370. each6(option[state], function(visualData, visualType) {
  7371. if (!VisualMapping_default.isValidType(visualType)) {
  7372. return;
  7373. }
  7374. var mappingOption = {
  7375. type: visualType,
  7376. visual: visualData
  7377. };
  7378. supplementVisualOption && supplementVisualOption(mappingOption, state);
  7379. mappings[visualType] = new VisualMapping_default(mappingOption);
  7380. if (visualType === "opacity") {
  7381. mappingOption = clone(mappingOption);
  7382. mappingOption.type = "colorAlpha";
  7383. mappings.__hidden.__alphaForOpacity = new VisualMapping_default(mappingOption);
  7384. }
  7385. });
  7386. });
  7387. return visualMappings;
  7388. function createMappings() {
  7389. var Creater = function() {
  7390. };
  7391. Creater.prototype.__hidden = Creater.prototype;
  7392. var obj = new Creater();
  7393. return obj;
  7394. }
  7395. }
  7396. function replaceVisualOption(thisOption, newOption, keys2) {
  7397. var has3;
  7398. each(keys2, function(key) {
  7399. if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {
  7400. has3 = true;
  7401. }
  7402. });
  7403. has3 && each(keys2, function(key) {
  7404. if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {
  7405. thisOption[key] = clone(newOption[key]);
  7406. } else {
  7407. delete thisOption[key];
  7408. }
  7409. });
  7410. }
  7411. function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) {
  7412. var visualTypesMap = {};
  7413. each(stateList, function(state) {
  7414. var visualTypes = VisualMapping_default.prepareVisualTypes(visualMappings[state]);
  7415. visualTypesMap[state] = visualTypes;
  7416. });
  7417. var dataIndex;
  7418. function getVisual(key) {
  7419. return getItemVisualFromData(data, dataIndex, key);
  7420. }
  7421. function setVisual(key, value) {
  7422. setItemVisualFromData(data, dataIndex, key, value);
  7423. }
  7424. if (dimension == null) {
  7425. data.each(eachItem);
  7426. } else {
  7427. data.each([dimension], eachItem);
  7428. }
  7429. function eachItem(valueOrIndex, index) {
  7430. dataIndex = dimension == null ? valueOrIndex : index;
  7431. var rawDataItem = data.getRawDataItem(dataIndex);
  7432. if (rawDataItem && rawDataItem.visualMap === false) {
  7433. return;
  7434. }
  7435. var valueState = getValueState.call(scope, valueOrIndex);
  7436. var mappings = visualMappings[valueState];
  7437. var visualTypes = visualTypesMap[valueState];
  7438. for (var i = 0, len = visualTypes.length; i < len; i++) {
  7439. var type = visualTypes[i];
  7440. mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual);
  7441. }
  7442. }
  7443. }
  7444. function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) {
  7445. var visualTypesMap = {};
  7446. each(stateList, function(state) {
  7447. var visualTypes = VisualMapping_default.prepareVisualTypes(visualMappings[state]);
  7448. visualTypesMap[state] = visualTypes;
  7449. });
  7450. return {
  7451. progress: function progress(params, data) {
  7452. var dimIndex;
  7453. if (dim != null) {
  7454. dimIndex = data.getDimensionIndex(dim);
  7455. }
  7456. function getVisual(key) {
  7457. return getItemVisualFromData(data, dataIndex, key);
  7458. }
  7459. function setVisual(key, value2) {
  7460. setItemVisualFromData(data, dataIndex, key, value2);
  7461. }
  7462. var dataIndex;
  7463. var store = data.getStore();
  7464. while ((dataIndex = params.next()) != null) {
  7465. var rawDataItem = data.getRawDataItem(dataIndex);
  7466. if (rawDataItem && rawDataItem.visualMap === false) {
  7467. continue;
  7468. }
  7469. var value = dim != null ? store.get(dimIndex, dataIndex) : dataIndex;
  7470. var valueState = getValueState(value);
  7471. var mappings = visualMappings[valueState];
  7472. var visualTypes = visualTypesMap[valueState];
  7473. for (var i = 0, len = visualTypes.length; i < len; i++) {
  7474. var type = visualTypes[i];
  7475. mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual);
  7476. }
  7477. }
  7478. }
  7479. };
  7480. }
  7481. // node_modules/echarts/lib/component/brush/selector.js
  7482. init_define_APP_INFO();
  7483. function makeBrushCommonSelectorForSeries(area) {
  7484. var brushType = area.brushType;
  7485. var selectors = {
  7486. point: function(itemLayout) {
  7487. return selector[brushType].point(itemLayout, selectors, area);
  7488. },
  7489. rect: function(itemLayout) {
  7490. return selector[brushType].rect(itemLayout, selectors, area);
  7491. }
  7492. };
  7493. return selectors;
  7494. }
  7495. var selector = {
  7496. lineX: getLineSelectors(0),
  7497. lineY: getLineSelectors(1),
  7498. rect: {
  7499. point: function(itemLayout, selectors, area) {
  7500. return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);
  7501. },
  7502. rect: function(itemLayout, selectors, area) {
  7503. return itemLayout && area.boundingRect.intersect(itemLayout);
  7504. }
  7505. },
  7506. polygon: {
  7507. point: function(itemLayout, selectors, area) {
  7508. return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]) && contain(area.range, itemLayout[0], itemLayout[1]);
  7509. },
  7510. rect: function(itemLayout, selectors, area) {
  7511. var points = area.range;
  7512. if (!itemLayout || points.length <= 1) {
  7513. return false;
  7514. }
  7515. var x = itemLayout.x;
  7516. var y = itemLayout.y;
  7517. var width = itemLayout.width;
  7518. var height = itemLayout.height;
  7519. var p = points[0];
  7520. if (contain(points, x, y) || contain(points, x + width, y) || contain(points, x, y + height) || contain(points, x + width, y + height) || BoundingRect_default.create(itemLayout).contain(p[0], p[1]) || linePolygonIntersect(x, y, x + width, y, points) || linePolygonIntersect(x, y, x, y + height, points) || linePolygonIntersect(x + width, y, x + width, y + height, points) || linePolygonIntersect(x, y + height, x + width, y + height, points)) {
  7521. return true;
  7522. }
  7523. }
  7524. }
  7525. };
  7526. function getLineSelectors(xyIndex) {
  7527. var xy = ["x", "y"];
  7528. var wh = ["width", "height"];
  7529. return {
  7530. point: function(itemLayout, selectors, area) {
  7531. if (itemLayout) {
  7532. var range = area.range;
  7533. var p = itemLayout[xyIndex];
  7534. return inLineRange(p, range);
  7535. }
  7536. },
  7537. rect: function(itemLayout, selectors, area) {
  7538. if (itemLayout) {
  7539. var range = area.range;
  7540. var layoutRange = [itemLayout[xy[xyIndex]], itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]];
  7541. layoutRange[1] < layoutRange[0] && layoutRange.reverse();
  7542. return inLineRange(layoutRange[0], range) || inLineRange(layoutRange[1], range) || inLineRange(range[0], layoutRange) || inLineRange(range[1], layoutRange);
  7543. }
  7544. }
  7545. };
  7546. }
  7547. function inLineRange(p, range) {
  7548. return range[0] <= p && p <= range[1];
  7549. }
  7550. // node_modules/echarts/lib/component/brush/visualEncoding.js
  7551. var STATE_LIST = ["inBrush", "outOfBrush"];
  7552. var DISPATCH_METHOD = "__ecBrushSelect";
  7553. var DISPATCH_FLAG = "__ecInBrushSelectEvent";
  7554. function layoutCovers(ecModel) {
  7555. ecModel.eachComponent({
  7556. mainType: "brush"
  7557. }, function(brushModel) {
  7558. var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager_default(brushModel.option, ecModel);
  7559. brushTargetManager.setInputRanges(brushModel.areas, ecModel);
  7560. });
  7561. }
  7562. function brushVisual(ecModel, api, payload) {
  7563. var brushSelected = [];
  7564. var throttleType;
  7565. var throttleDelay;
  7566. ecModel.eachComponent({
  7567. mainType: "brush"
  7568. }, function(brushModel) {
  7569. payload && payload.type === "takeGlobalCursor" && brushModel.setBrushOption(payload.key === "brush" ? payload.brushOption : {
  7570. brushType: false
  7571. });
  7572. });
  7573. layoutCovers(ecModel);
  7574. ecModel.eachComponent({
  7575. mainType: "brush"
  7576. }, function(brushModel, brushIndex) {
  7577. var thisBrushSelected = {
  7578. brushId: brushModel.id,
  7579. brushIndex,
  7580. brushName: brushModel.name,
  7581. areas: clone(brushModel.areas),
  7582. selected: []
  7583. };
  7584. brushSelected.push(thisBrushSelected);
  7585. var brushOption = brushModel.option;
  7586. var brushLink = brushOption.brushLink;
  7587. var linkedSeriesMap = [];
  7588. var selectedDataIndexForLink = [];
  7589. var rangeInfoBySeries = [];
  7590. var hasBrushExists = false;
  7591. if (!brushIndex) {
  7592. throttleType = brushOption.throttleType;
  7593. throttleDelay = brushOption.throttleDelay;
  7594. }
  7595. var areas = map(brushModel.areas, function(area) {
  7596. var builder = boundingRectBuilders[area.brushType];
  7597. var selectableArea = defaults({
  7598. boundingRect: builder ? builder(area) : void 0
  7599. }, area);
  7600. selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea);
  7601. return selectableArea;
  7602. });
  7603. var visualMappings = createVisualMappings(brushModel.option, STATE_LIST, function(mappingOption) {
  7604. mappingOption.mappingMethod = "fixed";
  7605. });
  7606. isArray(brushLink) && each(brushLink, function(seriesIndex) {
  7607. linkedSeriesMap[seriesIndex] = 1;
  7608. });
  7609. function linkOthers(seriesIndex) {
  7610. return brushLink === "all" || !!linkedSeriesMap[seriesIndex];
  7611. }
  7612. function brushed(rangeInfoList) {
  7613. return !!rangeInfoList.length;
  7614. }
  7615. ecModel.eachSeries(function(seriesModel, seriesIndex) {
  7616. var rangeInfoList = rangeInfoBySeries[seriesIndex] = [];
  7617. seriesModel.subType === "parallel" ? stepAParallel(seriesModel, seriesIndex) : stepAOthers(seriesModel, seriesIndex, rangeInfoList);
  7618. });
  7619. function stepAParallel(seriesModel, seriesIndex) {
  7620. var coordSys = seriesModel.coordinateSystem;
  7621. hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed();
  7622. linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function(activeState, dataIndex) {
  7623. activeState === "active" && (selectedDataIndexForLink[dataIndex] = 1);
  7624. });
  7625. }
  7626. function stepAOthers(seriesModel, seriesIndex, rangeInfoList) {
  7627. if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) {
  7628. return;
  7629. }
  7630. each(areas, function(area) {
  7631. if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) {
  7632. rangeInfoList.push(area);
  7633. }
  7634. hasBrushExists = hasBrushExists || brushed(rangeInfoList);
  7635. });
  7636. if (linkOthers(seriesIndex) && brushed(rangeInfoList)) {
  7637. var data_1 = seriesModel.getData();
  7638. data_1.each(function(dataIndex) {
  7639. if (checkInRange(seriesModel, rangeInfoList, data_1, dataIndex)) {
  7640. selectedDataIndexForLink[dataIndex] = 1;
  7641. }
  7642. });
  7643. }
  7644. }
  7645. ecModel.eachSeries(function(seriesModel, seriesIndex) {
  7646. var seriesBrushSelected = {
  7647. seriesId: seriesModel.id,
  7648. seriesIndex,
  7649. seriesName: seriesModel.name,
  7650. dataIndex: []
  7651. };
  7652. thisBrushSelected.selected.push(seriesBrushSelected);
  7653. var rangeInfoList = rangeInfoBySeries[seriesIndex];
  7654. var data = seriesModel.getData();
  7655. var getValueState = linkOthers(seriesIndex) ? function(dataIndex) {
  7656. return selectedDataIndexForLink[dataIndex] ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), "inBrush") : "outOfBrush";
  7657. } : function(dataIndex) {
  7658. return checkInRange(seriesModel, rangeInfoList, data, dataIndex) ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), "inBrush") : "outOfBrush";
  7659. };
  7660. (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) && applyVisual(STATE_LIST, visualMappings, data, getValueState);
  7661. });
  7662. });
  7663. dispatchAction(api, throttleType, throttleDelay, brushSelected, payload);
  7664. }
  7665. function dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) {
  7666. if (!payload) {
  7667. return;
  7668. }
  7669. var zr = api.getZr();
  7670. if (zr[DISPATCH_FLAG]) {
  7671. return;
  7672. }
  7673. if (!zr[DISPATCH_METHOD]) {
  7674. zr[DISPATCH_METHOD] = doDispatch;
  7675. }
  7676. var fn = createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType);
  7677. fn(api, brushSelected);
  7678. }
  7679. function doDispatch(api, brushSelected) {
  7680. if (!api.isDisposed()) {
  7681. var zr = api.getZr();
  7682. zr[DISPATCH_FLAG] = true;
  7683. api.dispatchAction({
  7684. type: "brushSelect",
  7685. batch: brushSelected
  7686. });
  7687. zr[DISPATCH_FLAG] = false;
  7688. }
  7689. }
  7690. function checkInRange(seriesModel, rangeInfoList, data, dataIndex) {
  7691. for (var i = 0, len = rangeInfoList.length; i < len; i++) {
  7692. var area = rangeInfoList[i];
  7693. if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) {
  7694. return true;
  7695. }
  7696. }
  7697. }
  7698. function brushModelNotControll(brushModel, seriesIndex) {
  7699. var seriesIndices = brushModel.option.seriesIndex;
  7700. return seriesIndices != null && seriesIndices !== "all" && (isArray(seriesIndices) ? indexOf(seriesIndices, seriesIndex) < 0 : seriesIndex !== seriesIndices);
  7701. }
  7702. var boundingRectBuilders = {
  7703. rect: function(area) {
  7704. return getBoundingRectFromMinMax(area.range);
  7705. },
  7706. polygon: function(area) {
  7707. var minMax;
  7708. var range = area.range;
  7709. for (var i = 0, len = range.length; i < len; i++) {
  7710. minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]];
  7711. var rg = range[i];
  7712. rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]);
  7713. rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]);
  7714. rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]);
  7715. rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]);
  7716. }
  7717. return minMax && getBoundingRectFromMinMax(minMax);
  7718. }
  7719. };
  7720. function getBoundingRectFromMinMax(minMax) {
  7721. return new BoundingRect_default(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]);
  7722. }
  7723. // node_modules/echarts/lib/component/brush/BrushView.js
  7724. var BrushView = function(_super) {
  7725. __extends(BrushView2, _super);
  7726. function BrushView2() {
  7727. var _this = _super !== null && _super.apply(this, arguments) || this;
  7728. _this.type = BrushView2.type;
  7729. return _this;
  7730. }
  7731. BrushView2.prototype.init = function(ecModel, api) {
  7732. this.ecModel = ecModel;
  7733. this.api = api;
  7734. this.model;
  7735. (this._brushController = new BrushController_default(api.getZr())).on("brush", bind(this._onBrush, this)).mount();
  7736. };
  7737. BrushView2.prototype.render = function(brushModel, ecModel, api, payload) {
  7738. this.model = brushModel;
  7739. this._updateController(brushModel, ecModel, api, payload);
  7740. };
  7741. BrushView2.prototype.updateTransform = function(brushModel, ecModel, api, payload) {
  7742. layoutCovers(ecModel);
  7743. this._updateController(brushModel, ecModel, api, payload);
  7744. };
  7745. BrushView2.prototype.updateVisual = function(brushModel, ecModel, api, payload) {
  7746. this.updateTransform(brushModel, ecModel, api, payload);
  7747. };
  7748. BrushView2.prototype.updateView = function(brushModel, ecModel, api, payload) {
  7749. this._updateController(brushModel, ecModel, api, payload);
  7750. };
  7751. BrushView2.prototype._updateController = function(brushModel, ecModel, api, payload) {
  7752. (!payload || payload.$from !== brushModel.id) && this._brushController.setPanels(brushModel.brushTargetManager.makePanelOpts(api)).enableBrush(brushModel.brushOption).updateCovers(brushModel.areas.slice());
  7753. };
  7754. BrushView2.prototype.dispose = function() {
  7755. this._brushController.dispose();
  7756. };
  7757. BrushView2.prototype._onBrush = function(eventParam) {
  7758. var modelId = this.model.id;
  7759. var areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel);
  7760. (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({
  7761. type: "brush",
  7762. brushId: modelId,
  7763. areas: clone(areas),
  7764. $from: modelId
  7765. });
  7766. eventParam.isEnd && this.api.dispatchAction({
  7767. type: "brushEnd",
  7768. brushId: modelId,
  7769. areas: clone(areas),
  7770. $from: modelId
  7771. });
  7772. };
  7773. BrushView2.type = "brush";
  7774. return BrushView2;
  7775. }(Component_default2);
  7776. var BrushView_default = BrushView;
  7777. // node_modules/echarts/lib/component/brush/BrushModel.js
  7778. init_define_APP_INFO();
  7779. var DEFAULT_OUT_OF_BRUSH_COLOR = "#ddd";
  7780. var BrushModel = function(_super) {
  7781. __extends(BrushModel2, _super);
  7782. function BrushModel2() {
  7783. var _this = _super !== null && _super.apply(this, arguments) || this;
  7784. _this.type = BrushModel2.type;
  7785. _this.areas = [];
  7786. _this.brushOption = {};
  7787. return _this;
  7788. }
  7789. BrushModel2.prototype.optionUpdated = function(newOption, isInit) {
  7790. var thisOption = this.option;
  7791. !isInit && replaceVisualOption(thisOption, newOption, ["inBrush", "outOfBrush"]);
  7792. var inBrush = thisOption.inBrush = thisOption.inBrush || {};
  7793. thisOption.outOfBrush = thisOption.outOfBrush || {
  7794. color: DEFAULT_OUT_OF_BRUSH_COLOR
  7795. };
  7796. if (!inBrush.hasOwnProperty("liftZ")) {
  7797. inBrush.liftZ = 5;
  7798. }
  7799. };
  7800. BrushModel2.prototype.setAreas = function(areas) {
  7801. if (true) {
  7802. assert(isArray(areas));
  7803. each(areas, function(area) {
  7804. assert(area.brushType, "Illegal areas");
  7805. });
  7806. }
  7807. if (!areas) {
  7808. return;
  7809. }
  7810. this.areas = map(areas, function(area) {
  7811. return generateBrushOption(this.option, area);
  7812. }, this);
  7813. };
  7814. BrushModel2.prototype.setBrushOption = function(brushOption) {
  7815. this.brushOption = generateBrushOption(this.option, brushOption);
  7816. this.brushType = this.brushOption.brushType;
  7817. };
  7818. BrushModel2.type = "brush";
  7819. BrushModel2.dependencies = ["geo", "grid", "xAxis", "yAxis", "parallel", "series"];
  7820. BrushModel2.defaultOption = {
  7821. seriesIndex: "all",
  7822. brushType: "rect",
  7823. brushMode: "single",
  7824. transformable: true,
  7825. brushStyle: {
  7826. borderWidth: 1,
  7827. color: "rgba(210,219,238,0.3)",
  7828. borderColor: "#D2DBEE"
  7829. },
  7830. throttleType: "fixRate",
  7831. throttleDelay: 0,
  7832. removeOnClick: true,
  7833. z: 1e4
  7834. };
  7835. return BrushModel2;
  7836. }(Component_default);
  7837. function generateBrushOption(option, brushOption) {
  7838. return merge({
  7839. brushType: option.brushType,
  7840. brushMode: option.brushMode,
  7841. transformable: option.transformable,
  7842. brushStyle: new Model_default(option.brushStyle).getItemStyle(),
  7843. removeOnClick: option.removeOnClick,
  7844. z: option.z
  7845. }, brushOption, true);
  7846. }
  7847. var BrushModel_default = BrushModel;
  7848. // node_modules/echarts/lib/component/toolbox/feature/Brush.js
  7849. init_define_APP_INFO();
  7850. var ICON_TYPES = ["rect", "polygon", "lineX", "lineY", "keep", "clear"];
  7851. var BrushFeature = function(_super) {
  7852. __extends(BrushFeature2, _super);
  7853. function BrushFeature2() {
  7854. return _super !== null && _super.apply(this, arguments) || this;
  7855. }
  7856. BrushFeature2.prototype.render = function(featureModel, ecModel, api) {
  7857. var brushType;
  7858. var brushMode;
  7859. var isBrushed;
  7860. ecModel.eachComponent({
  7861. mainType: "brush"
  7862. }, function(brushModel) {
  7863. brushType = brushModel.brushType;
  7864. brushMode = brushModel.brushOption.brushMode || "single";
  7865. isBrushed = isBrushed || !!brushModel.areas.length;
  7866. });
  7867. this._brushType = brushType;
  7868. this._brushMode = brushMode;
  7869. each(featureModel.get("type", true), function(type) {
  7870. featureModel.setIconStatus(type, (type === "keep" ? brushMode === "multiple" : type === "clear" ? isBrushed : type === brushType) ? "emphasis" : "normal");
  7871. });
  7872. };
  7873. BrushFeature2.prototype.updateView = function(featureModel, ecModel, api) {
  7874. this.render(featureModel, ecModel, api);
  7875. };
  7876. BrushFeature2.prototype.getIcons = function() {
  7877. var model = this.model;
  7878. var availableIcons = model.get("icon", true);
  7879. var icons = {};
  7880. each(model.get("type", true), function(type) {
  7881. if (availableIcons[type]) {
  7882. icons[type] = availableIcons[type];
  7883. }
  7884. });
  7885. return icons;
  7886. };
  7887. ;
  7888. BrushFeature2.prototype.onclick = function(ecModel, api, type) {
  7889. var brushType = this._brushType;
  7890. var brushMode = this._brushMode;
  7891. if (type === "clear") {
  7892. api.dispatchAction({
  7893. type: "axisAreaSelect",
  7894. intervals: []
  7895. });
  7896. api.dispatchAction({
  7897. type: "brush",
  7898. command: "clear",
  7899. areas: []
  7900. });
  7901. } else {
  7902. api.dispatchAction({
  7903. type: "takeGlobalCursor",
  7904. key: "brush",
  7905. brushOption: {
  7906. brushType: type === "keep" ? brushType : brushType === type ? false : type,
  7907. brushMode: type === "keep" ? brushMode === "multiple" ? "single" : "multiple" : brushMode
  7908. }
  7909. });
  7910. }
  7911. };
  7912. ;
  7913. BrushFeature2.getDefaultOption = function(ecModel) {
  7914. var defaultOption2 = {
  7915. show: true,
  7916. type: ICON_TYPES.slice(),
  7917. icon: {
  7918. 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",
  7919. 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",
  7920. 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",
  7921. 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",
  7922. 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",
  7923. 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"
  7924. },
  7925. title: ecModel.getLocaleModel().get(["toolbox", "brush", "title"])
  7926. };
  7927. return defaultOption2;
  7928. };
  7929. return BrushFeature2;
  7930. }(ToolboxFeature);
  7931. var Brush_default = BrushFeature;
  7932. // node_modules/echarts/lib/component/brush/install.js
  7933. function install14(registers) {
  7934. registers.registerComponentView(BrushView_default);
  7935. registers.registerComponentModel(BrushModel_default);
  7936. registers.registerPreprocessor(brushPreprocessor);
  7937. registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, brushVisual);
  7938. registers.registerAction({
  7939. type: "brush",
  7940. event: "brush",
  7941. update: "updateVisual"
  7942. }, function(payload, ecModel) {
  7943. ecModel.eachComponent({
  7944. mainType: "brush",
  7945. query: payload
  7946. }, function(brushModel) {
  7947. brushModel.setAreas(payload.areas);
  7948. });
  7949. });
  7950. registers.registerAction({
  7951. type: "brushSelect",
  7952. event: "brushSelected",
  7953. update: "none"
  7954. }, noop);
  7955. registers.registerAction({
  7956. type: "brushEnd",
  7957. event: "brushEnd",
  7958. update: "none"
  7959. }, noop);
  7960. registerFeature("brush", Brush_default);
  7961. }
  7962. // node_modules/echarts/lib/component/title/install.js
  7963. init_define_APP_INFO();
  7964. var TitleModel = function(_super) {
  7965. __extends(TitleModel2, _super);
  7966. function TitleModel2() {
  7967. var _this = _super !== null && _super.apply(this, arguments) || this;
  7968. _this.type = TitleModel2.type;
  7969. _this.layoutMode = {
  7970. type: "box",
  7971. ignoreSize: true
  7972. };
  7973. return _this;
  7974. }
  7975. TitleModel2.type = "title";
  7976. TitleModel2.defaultOption = {
  7977. z: 6,
  7978. show: true,
  7979. text: "",
  7980. target: "blank",
  7981. subtext: "",
  7982. subtarget: "blank",
  7983. left: 0,
  7984. top: 0,
  7985. backgroundColor: "rgba(0,0,0,0)",
  7986. borderColor: "#ccc",
  7987. borderWidth: 0,
  7988. padding: 5,
  7989. itemGap: 10,
  7990. textStyle: {
  7991. fontSize: 18,
  7992. fontWeight: "bold",
  7993. color: "#464646"
  7994. },
  7995. subtextStyle: {
  7996. fontSize: 12,
  7997. color: "#6E7079"
  7998. }
  7999. };
  8000. return TitleModel2;
  8001. }(Component_default);
  8002. var TitleView = function(_super) {
  8003. __extends(TitleView2, _super);
  8004. function TitleView2() {
  8005. var _this = _super !== null && _super.apply(this, arguments) || this;
  8006. _this.type = TitleView2.type;
  8007. return _this;
  8008. }
  8009. TitleView2.prototype.render = function(titleModel, ecModel, api) {
  8010. this.group.removeAll();
  8011. if (!titleModel.get("show")) {
  8012. return;
  8013. }
  8014. var group = this.group;
  8015. var textStyleModel = titleModel.getModel("textStyle");
  8016. var subtextStyleModel = titleModel.getModel("subtextStyle");
  8017. var textAlign = titleModel.get("textAlign");
  8018. var textVerticalAlign = retrieve2(titleModel.get("textBaseline"), titleModel.get("textVerticalAlign"));
  8019. var textEl = new Text_default({
  8020. style: createTextStyle(textStyleModel, {
  8021. text: titleModel.get("text"),
  8022. fill: textStyleModel.getTextColor()
  8023. }, {
  8024. disableBox: true
  8025. }),
  8026. z2: 10
  8027. });
  8028. var textRect = textEl.getBoundingRect();
  8029. var subText = titleModel.get("subtext");
  8030. var subTextEl = new Text_default({
  8031. style: createTextStyle(subtextStyleModel, {
  8032. text: subText,
  8033. fill: subtextStyleModel.getTextColor(),
  8034. y: textRect.height + titleModel.get("itemGap"),
  8035. verticalAlign: "top"
  8036. }, {
  8037. disableBox: true
  8038. }),
  8039. z2: 10
  8040. });
  8041. var link = titleModel.get("link");
  8042. var sublink = titleModel.get("sublink");
  8043. var triggerEvent = titleModel.get("triggerEvent", true);
  8044. textEl.silent = !link && !triggerEvent;
  8045. subTextEl.silent = !sublink && !triggerEvent;
  8046. if (link) {
  8047. textEl.on("click", function() {
  8048. windowOpen(link, "_" + titleModel.get("target"));
  8049. });
  8050. }
  8051. if (sublink) {
  8052. subTextEl.on("click", function() {
  8053. windowOpen(sublink, "_" + titleModel.get("subtarget"));
  8054. });
  8055. }
  8056. getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent ? {
  8057. componentType: "title",
  8058. componentIndex: titleModel.componentIndex
  8059. } : null;
  8060. group.add(textEl);
  8061. subText && group.add(subTextEl);
  8062. var groupRect = group.getBoundingRect();
  8063. var layoutOption = titleModel.getBoxLayoutParams();
  8064. layoutOption.width = groupRect.width;
  8065. layoutOption.height = groupRect.height;
  8066. var layoutRect = getLayoutRect(layoutOption, {
  8067. width: api.getWidth(),
  8068. height: api.getHeight()
  8069. }, titleModel.get("padding"));
  8070. if (!textAlign) {
  8071. textAlign = titleModel.get("left") || titleModel.get("right");
  8072. if (textAlign === "middle") {
  8073. textAlign = "center";
  8074. }
  8075. if (textAlign === "right") {
  8076. layoutRect.x += layoutRect.width;
  8077. } else if (textAlign === "center") {
  8078. layoutRect.x += layoutRect.width / 2;
  8079. }
  8080. }
  8081. if (!textVerticalAlign) {
  8082. textVerticalAlign = titleModel.get("top") || titleModel.get("bottom");
  8083. if (textVerticalAlign === "center") {
  8084. textVerticalAlign = "middle";
  8085. }
  8086. if (textVerticalAlign === "bottom") {
  8087. layoutRect.y += layoutRect.height;
  8088. } else if (textVerticalAlign === "middle") {
  8089. layoutRect.y += layoutRect.height / 2;
  8090. }
  8091. textVerticalAlign = textVerticalAlign || "top";
  8092. }
  8093. group.x = layoutRect.x;
  8094. group.y = layoutRect.y;
  8095. group.markRedraw();
  8096. var alignStyle = {
  8097. align: textAlign,
  8098. verticalAlign: textVerticalAlign
  8099. };
  8100. textEl.setStyle(alignStyle);
  8101. subTextEl.setStyle(alignStyle);
  8102. groupRect = group.getBoundingRect();
  8103. var padding = layoutRect.margin;
  8104. var style = titleModel.getItemStyle(["color", "opacity"]);
  8105. style.fill = titleModel.get("backgroundColor");
  8106. var rect = new Rect_default({
  8107. shape: {
  8108. x: groupRect.x - padding[3],
  8109. y: groupRect.y - padding[0],
  8110. width: groupRect.width + padding[1] + padding[3],
  8111. height: groupRect.height + padding[0] + padding[2],
  8112. r: titleModel.get("borderRadius")
  8113. },
  8114. style,
  8115. subPixelOptimize: true,
  8116. silent: true
  8117. });
  8118. group.add(rect);
  8119. };
  8120. TitleView2.type = "title";
  8121. return TitleView2;
  8122. }(Component_default2);
  8123. function install15(registers) {
  8124. registers.registerComponentModel(TitleModel);
  8125. registers.registerComponentView(TitleView);
  8126. }
  8127. // node_modules/echarts/lib/component/timeline/install.js
  8128. init_define_APP_INFO();
  8129. // node_modules/echarts/lib/component/timeline/SliderTimelineModel.js
  8130. init_define_APP_INFO();
  8131. // node_modules/echarts/lib/component/timeline/TimelineModel.js
  8132. init_define_APP_INFO();
  8133. var TimelineModel = function(_super) {
  8134. __extends(TimelineModel2, _super);
  8135. function TimelineModel2() {
  8136. var _this = _super !== null && _super.apply(this, arguments) || this;
  8137. _this.type = TimelineModel2.type;
  8138. _this.layoutMode = "box";
  8139. return _this;
  8140. }
  8141. TimelineModel2.prototype.init = function(option, parentModel, ecModel) {
  8142. this.mergeDefaultAndTheme(option, ecModel);
  8143. this._initData();
  8144. };
  8145. TimelineModel2.prototype.mergeOption = function(option) {
  8146. _super.prototype.mergeOption.apply(this, arguments);
  8147. this._initData();
  8148. };
  8149. TimelineModel2.prototype.setCurrentIndex = function(currentIndex) {
  8150. if (currentIndex == null) {
  8151. currentIndex = this.option.currentIndex;
  8152. }
  8153. var count2 = this._data.count();
  8154. if (this.option.loop) {
  8155. currentIndex = (currentIndex % count2 + count2) % count2;
  8156. } else {
  8157. currentIndex >= count2 && (currentIndex = count2 - 1);
  8158. currentIndex < 0 && (currentIndex = 0);
  8159. }
  8160. this.option.currentIndex = currentIndex;
  8161. };
  8162. TimelineModel2.prototype.getCurrentIndex = function() {
  8163. return this.option.currentIndex;
  8164. };
  8165. TimelineModel2.prototype.isIndexMax = function() {
  8166. return this.getCurrentIndex() >= this._data.count() - 1;
  8167. };
  8168. TimelineModel2.prototype.setPlayState = function(state) {
  8169. this.option.autoPlay = !!state;
  8170. };
  8171. TimelineModel2.prototype.getPlayState = function() {
  8172. return !!this.option.autoPlay;
  8173. };
  8174. TimelineModel2.prototype._initData = function() {
  8175. var thisOption = this.option;
  8176. var dataArr = thisOption.data || [];
  8177. var axisType = thisOption.axisType;
  8178. var names = this._names = [];
  8179. var processedDataArr;
  8180. if (axisType === "category") {
  8181. processedDataArr = [];
  8182. each(dataArr, function(item, index) {
  8183. var value = convertOptionIdName(getDataItemValue(item), "");
  8184. var newItem;
  8185. if (isObject(item)) {
  8186. newItem = clone(item);
  8187. newItem.value = index;
  8188. } else {
  8189. newItem = index;
  8190. }
  8191. processedDataArr.push(newItem);
  8192. names.push(value);
  8193. });
  8194. } else {
  8195. processedDataArr = dataArr;
  8196. }
  8197. var dimType = {
  8198. category: "ordinal",
  8199. time: "time",
  8200. value: "number"
  8201. }[axisType] || "number";
  8202. var data = this._data = new SeriesData_default([{
  8203. name: "value",
  8204. type: dimType
  8205. }], this);
  8206. data.initData(processedDataArr, names);
  8207. };
  8208. TimelineModel2.prototype.getData = function() {
  8209. return this._data;
  8210. };
  8211. TimelineModel2.prototype.getCategories = function() {
  8212. if (this.get("axisType") === "category") {
  8213. return this._names.slice();
  8214. }
  8215. };
  8216. TimelineModel2.type = "timeline";
  8217. TimelineModel2.defaultOption = {
  8218. z: 4,
  8219. show: true,
  8220. axisType: "time",
  8221. realtime: true,
  8222. left: "20%",
  8223. top: null,
  8224. right: "20%",
  8225. bottom: 0,
  8226. width: null,
  8227. height: 40,
  8228. padding: 5,
  8229. controlPosition: "left",
  8230. autoPlay: false,
  8231. rewind: false,
  8232. loop: true,
  8233. playInterval: 2e3,
  8234. currentIndex: 0,
  8235. itemStyle: {},
  8236. label: {
  8237. color: "#000"
  8238. },
  8239. data: []
  8240. };
  8241. return TimelineModel2;
  8242. }(Component_default);
  8243. var TimelineModel_default = TimelineModel;
  8244. // node_modules/echarts/lib/component/timeline/SliderTimelineModel.js
  8245. var SliderTimelineModel = function(_super) {
  8246. __extends(SliderTimelineModel2, _super);
  8247. function SliderTimelineModel2() {
  8248. var _this = _super !== null && _super.apply(this, arguments) || this;
  8249. _this.type = SliderTimelineModel2.type;
  8250. return _this;
  8251. }
  8252. SliderTimelineModel2.type = "timeline.slider";
  8253. SliderTimelineModel2.defaultOption = inheritDefaultOption(TimelineModel_default.defaultOption, {
  8254. backgroundColor: "rgba(0,0,0,0)",
  8255. borderColor: "#ccc",
  8256. borderWidth: 0,
  8257. orient: "horizontal",
  8258. inverse: false,
  8259. tooltip: {
  8260. trigger: "item"
  8261. },
  8262. symbol: "circle",
  8263. symbolSize: 12,
  8264. lineStyle: {
  8265. show: true,
  8266. width: 2,
  8267. color: "#DAE1F5"
  8268. },
  8269. label: {
  8270. position: "auto",
  8271. show: true,
  8272. interval: "auto",
  8273. rotate: 0,
  8274. color: "#A4B1D7"
  8275. },
  8276. itemStyle: {
  8277. color: "#A4B1D7",
  8278. borderWidth: 1
  8279. },
  8280. checkpointStyle: {
  8281. symbol: "circle",
  8282. symbolSize: 15,
  8283. color: "#316bf3",
  8284. borderColor: "#fff",
  8285. borderWidth: 2,
  8286. shadowBlur: 2,
  8287. shadowOffsetX: 1,
  8288. shadowOffsetY: 1,
  8289. shadowColor: "rgba(0, 0, 0, 0.3)",
  8290. animation: true,
  8291. animationDuration: 300,
  8292. animationEasing: "quinticInOut"
  8293. },
  8294. controlStyle: {
  8295. show: true,
  8296. showPlayBtn: true,
  8297. showPrevBtn: true,
  8298. showNextBtn: true,
  8299. itemSize: 24,
  8300. itemGap: 12,
  8301. position: "left",
  8302. 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",
  8303. 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",
  8304. 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",
  8305. 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",
  8306. prevBtnSize: 18,
  8307. nextBtnSize: 18,
  8308. color: "#A4B1D7",
  8309. borderColor: "#A4B1D7",
  8310. borderWidth: 1
  8311. },
  8312. emphasis: {
  8313. label: {
  8314. show: true,
  8315. color: "#6f778d"
  8316. },
  8317. itemStyle: {
  8318. color: "#316BF3"
  8319. },
  8320. controlStyle: {
  8321. color: "#316BF3",
  8322. borderColor: "#316BF3",
  8323. borderWidth: 2
  8324. }
  8325. },
  8326. progress: {
  8327. lineStyle: {
  8328. color: "#316BF3"
  8329. },
  8330. itemStyle: {
  8331. color: "#316BF3"
  8332. },
  8333. label: {
  8334. color: "#6f778d"
  8335. }
  8336. },
  8337. data: []
  8338. });
  8339. return SliderTimelineModel2;
  8340. }(TimelineModel_default);
  8341. mixin(SliderTimelineModel, DataFormatMixin.prototype);
  8342. var SliderTimelineModel_default = SliderTimelineModel;
  8343. // node_modules/echarts/lib/component/timeline/SliderTimelineView.js
  8344. init_define_APP_INFO();
  8345. // node_modules/echarts/lib/component/timeline/TimelineView.js
  8346. init_define_APP_INFO();
  8347. var TimelineView = function(_super) {
  8348. __extends(TimelineView2, _super);
  8349. function TimelineView2() {
  8350. var _this = _super !== null && _super.apply(this, arguments) || this;
  8351. _this.type = TimelineView2.type;
  8352. return _this;
  8353. }
  8354. TimelineView2.type = "timeline";
  8355. return TimelineView2;
  8356. }(Component_default2);
  8357. var TimelineView_default = TimelineView;
  8358. // node_modules/echarts/lib/component/timeline/TimelineAxis.js
  8359. init_define_APP_INFO();
  8360. var TimelineAxis = function(_super) {
  8361. __extends(TimelineAxis2, _super);
  8362. function TimelineAxis2(dim, scale, coordExtent, axisType) {
  8363. var _this = _super.call(this, dim, scale, coordExtent) || this;
  8364. _this.type = axisType || "value";
  8365. return _this;
  8366. }
  8367. TimelineAxis2.prototype.getLabelModel = function() {
  8368. return this.model.getModel("label");
  8369. };
  8370. TimelineAxis2.prototype.isHorizontal = function() {
  8371. return this.model.get("orient") === "horizontal";
  8372. };
  8373. return TimelineAxis2;
  8374. }(Axis_default);
  8375. var TimelineAxis_default = TimelineAxis;
  8376. // node_modules/echarts/lib/component/timeline/SliderTimelineView.js
  8377. var PI = Math.PI;
  8378. var labelDataIndexStore = makeInner();
  8379. var SliderTimelineView = function(_super) {
  8380. __extends(SliderTimelineView2, _super);
  8381. function SliderTimelineView2() {
  8382. var _this = _super !== null && _super.apply(this, arguments) || this;
  8383. _this.type = SliderTimelineView2.type;
  8384. return _this;
  8385. }
  8386. SliderTimelineView2.prototype.init = function(ecModel, api) {
  8387. this.api = api;
  8388. };
  8389. SliderTimelineView2.prototype.render = function(timelineModel, ecModel, api) {
  8390. this.model = timelineModel;
  8391. this.api = api;
  8392. this.ecModel = ecModel;
  8393. this.group.removeAll();
  8394. if (timelineModel.get("show", true)) {
  8395. var layoutInfo_1 = this._layout(timelineModel, api);
  8396. var mainGroup_1 = this._createGroup("_mainGroup");
  8397. var labelGroup = this._createGroup("_labelGroup");
  8398. var axis_1 = this._axis = this._createAxis(layoutInfo_1, timelineModel);
  8399. timelineModel.formatTooltip = function(dataIndex) {
  8400. var name = axis_1.scale.getLabel({
  8401. value: dataIndex
  8402. });
  8403. return createTooltipMarkup("nameValue", {
  8404. noName: true,
  8405. value: name
  8406. });
  8407. };
  8408. each(["AxisLine", "AxisTick", "Control", "CurrentPointer"], function(name) {
  8409. this["_render" + name](layoutInfo_1, mainGroup_1, axis_1, timelineModel);
  8410. }, this);
  8411. this._renderAxisLabel(layoutInfo_1, labelGroup, axis_1, timelineModel);
  8412. this._position(layoutInfo_1, timelineModel);
  8413. }
  8414. this._doPlayStop();
  8415. this._updateTicksStatus();
  8416. };
  8417. SliderTimelineView2.prototype.remove = function() {
  8418. this._clearTimer();
  8419. this.group.removeAll();
  8420. };
  8421. SliderTimelineView2.prototype.dispose = function() {
  8422. this._clearTimer();
  8423. };
  8424. SliderTimelineView2.prototype._layout = function(timelineModel, api) {
  8425. var labelPosOpt = timelineModel.get(["label", "position"]);
  8426. var orient = timelineModel.get("orient");
  8427. var viewRect = getViewRect(timelineModel, api);
  8428. var parsedLabelPos;
  8429. if (labelPosOpt == null || labelPosOpt === "auto") {
  8430. parsedLabelPos = orient === "horizontal" ? viewRect.y + viewRect.height / 2 < api.getHeight() / 2 ? "-" : "+" : viewRect.x + viewRect.width / 2 < api.getWidth() / 2 ? "+" : "-";
  8431. } else if (isString(labelPosOpt)) {
  8432. parsedLabelPos = {
  8433. horizontal: {
  8434. top: "-",
  8435. bottom: "+"
  8436. },
  8437. vertical: {
  8438. left: "-",
  8439. right: "+"
  8440. }
  8441. }[orient][labelPosOpt];
  8442. } else {
  8443. parsedLabelPos = labelPosOpt;
  8444. }
  8445. var labelAlignMap = {
  8446. horizontal: "center",
  8447. vertical: parsedLabelPos >= 0 || parsedLabelPos === "+" ? "left" : "right"
  8448. };
  8449. var labelBaselineMap = {
  8450. horizontal: parsedLabelPos >= 0 || parsedLabelPos === "+" ? "top" : "bottom",
  8451. vertical: "middle"
  8452. };
  8453. var rotationMap = {
  8454. horizontal: 0,
  8455. vertical: PI / 2
  8456. };
  8457. var mainLength = orient === "vertical" ? viewRect.height : viewRect.width;
  8458. var controlModel = timelineModel.getModel("controlStyle");
  8459. var showControl = controlModel.get("show", true);
  8460. var controlSize = showControl ? controlModel.get("itemSize") : 0;
  8461. var controlGap = showControl ? controlModel.get("itemGap") : 0;
  8462. var sizePlusGap = controlSize + controlGap;
  8463. var labelRotation = timelineModel.get(["label", "rotate"]) || 0;
  8464. labelRotation = labelRotation * PI / 180;
  8465. var playPosition;
  8466. var prevBtnPosition;
  8467. var nextBtnPosition;
  8468. var controlPosition = controlModel.get("position", true);
  8469. var showPlayBtn = showControl && controlModel.get("showPlayBtn", true);
  8470. var showPrevBtn = showControl && controlModel.get("showPrevBtn", true);
  8471. var showNextBtn = showControl && controlModel.get("showNextBtn", true);
  8472. var xLeft = 0;
  8473. var xRight = mainLength;
  8474. if (controlPosition === "left" || controlPosition === "bottom") {
  8475. showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap);
  8476. showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap);
  8477. showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);
  8478. } else {
  8479. showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);
  8480. showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap);
  8481. showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);
  8482. }
  8483. var axisExtent = [xLeft, xRight];
  8484. if (timelineModel.get("inverse")) {
  8485. axisExtent.reverse();
  8486. }
  8487. return {
  8488. viewRect,
  8489. mainLength,
  8490. orient,
  8491. rotation: rotationMap[orient],
  8492. labelRotation,
  8493. labelPosOpt: parsedLabelPos,
  8494. labelAlign: timelineModel.get(["label", "align"]) || labelAlignMap[orient],
  8495. labelBaseline: timelineModel.get(["label", "verticalAlign"]) || timelineModel.get(["label", "baseline"]) || labelBaselineMap[orient],
  8496. playPosition,
  8497. prevBtnPosition,
  8498. nextBtnPosition,
  8499. axisExtent,
  8500. controlSize,
  8501. controlGap
  8502. };
  8503. };
  8504. SliderTimelineView2.prototype._position = function(layoutInfo, timelineModel) {
  8505. var mainGroup = this._mainGroup;
  8506. var labelGroup = this._labelGroup;
  8507. var viewRect = layoutInfo.viewRect;
  8508. if (layoutInfo.orient === "vertical") {
  8509. var m = create();
  8510. var rotateOriginX = viewRect.x;
  8511. var rotateOriginY = viewRect.y + viewRect.height;
  8512. translate(m, m, [-rotateOriginX, -rotateOriginY]);
  8513. rotate(m, m, -PI / 2);
  8514. translate(m, m, [rotateOriginX, rotateOriginY]);
  8515. viewRect = viewRect.clone();
  8516. viewRect.applyTransform(m);
  8517. }
  8518. var viewBound = getBound(viewRect);
  8519. var mainBound = getBound(mainGroup.getBoundingRect());
  8520. var labelBound = getBound(labelGroup.getBoundingRect());
  8521. var mainPosition = [mainGroup.x, mainGroup.y];
  8522. var labelsPosition = [labelGroup.x, labelGroup.y];
  8523. labelsPosition[0] = mainPosition[0] = viewBound[0][0];
  8524. var labelPosOpt = layoutInfo.labelPosOpt;
  8525. if (labelPosOpt == null || isString(labelPosOpt)) {
  8526. var mainBoundIdx = labelPosOpt === "+" ? 0 : 1;
  8527. toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);
  8528. toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx);
  8529. } else {
  8530. var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1;
  8531. toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);
  8532. labelsPosition[1] = mainPosition[1] + labelPosOpt;
  8533. }
  8534. mainGroup.setPosition(mainPosition);
  8535. labelGroup.setPosition(labelsPosition);
  8536. mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation;
  8537. setOrigin(mainGroup);
  8538. setOrigin(labelGroup);
  8539. function setOrigin(targetGroup) {
  8540. targetGroup.originX = viewBound[0][0] - targetGroup.x;
  8541. targetGroup.originY = viewBound[1][0] - targetGroup.y;
  8542. }
  8543. function getBound(rect) {
  8544. return [[rect.x, rect.x + rect.width], [rect.y, rect.y + rect.height]];
  8545. }
  8546. function toBound(fromPos, from, to, dimIdx, boundIdx) {
  8547. fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx];
  8548. }
  8549. };
  8550. SliderTimelineView2.prototype._createAxis = function(layoutInfo, timelineModel) {
  8551. var data = timelineModel.getData();
  8552. var axisType = timelineModel.get("axisType");
  8553. var scale = createScaleByModel2(timelineModel, axisType);
  8554. scale.getTicks = function() {
  8555. return data.mapArray(["value"], function(value) {
  8556. return {
  8557. value
  8558. };
  8559. });
  8560. };
  8561. var dataExtent = data.getDataExtent("value");
  8562. scale.setExtent(dataExtent[0], dataExtent[1]);
  8563. scale.calcNiceTicks();
  8564. var axis = new TimelineAxis_default("value", scale, layoutInfo.axisExtent, axisType);
  8565. axis.model = timelineModel;
  8566. return axis;
  8567. };
  8568. SliderTimelineView2.prototype._createGroup = function(key) {
  8569. var newGroup = this[key] = new Group_default();
  8570. this.group.add(newGroup);
  8571. return newGroup;
  8572. };
  8573. SliderTimelineView2.prototype._renderAxisLine = function(layoutInfo, group, axis, timelineModel) {
  8574. var axisExtent = axis.getExtent();
  8575. if (!timelineModel.get(["lineStyle", "show"])) {
  8576. return;
  8577. }
  8578. var line = new Line_default({
  8579. shape: {
  8580. x1: axisExtent[0],
  8581. y1: 0,
  8582. x2: axisExtent[1],
  8583. y2: 0
  8584. },
  8585. style: extend({
  8586. lineCap: "round"
  8587. }, timelineModel.getModel("lineStyle").getLineStyle()),
  8588. silent: true,
  8589. z2: 1
  8590. });
  8591. group.add(line);
  8592. var progressLine = this._progressLine = new Line_default({
  8593. shape: {
  8594. x1: axisExtent[0],
  8595. x2: this._currentPointer ? this._currentPointer.x : axisExtent[0],
  8596. y1: 0,
  8597. y2: 0
  8598. },
  8599. style: defaults({
  8600. lineCap: "round",
  8601. lineWidth: line.style.lineWidth
  8602. }, timelineModel.getModel(["progress", "lineStyle"]).getLineStyle()),
  8603. silent: true,
  8604. z2: 1
  8605. });
  8606. group.add(progressLine);
  8607. };
  8608. SliderTimelineView2.prototype._renderAxisTick = function(layoutInfo, group, axis, timelineModel) {
  8609. var _this = this;
  8610. var data = timelineModel.getData();
  8611. var ticks = axis.scale.getTicks();
  8612. this._tickSymbols = [];
  8613. each(ticks, function(tick) {
  8614. var tickCoord = axis.dataToCoord(tick.value);
  8615. var itemModel = data.getItemModel(tick.value);
  8616. var itemStyleModel = itemModel.getModel("itemStyle");
  8617. var hoverStyleModel = itemModel.getModel(["emphasis", "itemStyle"]);
  8618. var progressStyleModel = itemModel.getModel(["progress", "itemStyle"]);
  8619. var symbolOpt = {
  8620. x: tickCoord,
  8621. y: 0,
  8622. onclick: bind(_this._changeTimeline, _this, tick.value)
  8623. };
  8624. var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt);
  8625. el.ensureState("emphasis").style = hoverStyleModel.getItemStyle();
  8626. el.ensureState("progress").style = progressStyleModel.getItemStyle();
  8627. enableHoverEmphasis(el);
  8628. var ecData = getECData(el);
  8629. if (itemModel.get("tooltip")) {
  8630. ecData.dataIndex = tick.value;
  8631. ecData.dataModel = timelineModel;
  8632. } else {
  8633. ecData.dataIndex = ecData.dataModel = null;
  8634. }
  8635. _this._tickSymbols.push(el);
  8636. });
  8637. };
  8638. SliderTimelineView2.prototype._renderAxisLabel = function(layoutInfo, group, axis, timelineModel) {
  8639. var _this = this;
  8640. var labelModel = axis.getLabelModel();
  8641. if (!labelModel.get("show")) {
  8642. return;
  8643. }
  8644. var data = timelineModel.getData();
  8645. var labels = axis.getViewLabels();
  8646. this._tickLabels = [];
  8647. each(labels, function(labelItem) {
  8648. var dataIndex = labelItem.tickValue;
  8649. var itemModel = data.getItemModel(dataIndex);
  8650. var normalLabelModel = itemModel.getModel("label");
  8651. var hoverLabelModel = itemModel.getModel(["emphasis", "label"]);
  8652. var progressLabelModel = itemModel.getModel(["progress", "label"]);
  8653. var tickCoord = axis.dataToCoord(labelItem.tickValue);
  8654. var textEl = new Text_default({
  8655. x: tickCoord,
  8656. y: 0,
  8657. rotation: layoutInfo.labelRotation - layoutInfo.rotation,
  8658. onclick: bind(_this._changeTimeline, _this, dataIndex),
  8659. silent: false,
  8660. style: createTextStyle(normalLabelModel, {
  8661. text: labelItem.formattedLabel,
  8662. align: layoutInfo.labelAlign,
  8663. verticalAlign: layoutInfo.labelBaseline
  8664. })
  8665. });
  8666. textEl.ensureState("emphasis").style = createTextStyle(hoverLabelModel);
  8667. textEl.ensureState("progress").style = createTextStyle(progressLabelModel);
  8668. group.add(textEl);
  8669. enableHoverEmphasis(textEl);
  8670. labelDataIndexStore(textEl).dataIndex = dataIndex;
  8671. _this._tickLabels.push(textEl);
  8672. });
  8673. };
  8674. SliderTimelineView2.prototype._renderControl = function(layoutInfo, group, axis, timelineModel) {
  8675. var controlSize = layoutInfo.controlSize;
  8676. var rotation = layoutInfo.rotation;
  8677. var itemStyle = timelineModel.getModel("controlStyle").getItemStyle();
  8678. var hoverStyle = timelineModel.getModel(["emphasis", "controlStyle"]).getItemStyle();
  8679. var playState = timelineModel.getPlayState();
  8680. var inverse = timelineModel.get("inverse", true);
  8681. makeBtn(layoutInfo.nextBtnPosition, "next", bind(this._changeTimeline, this, inverse ? "-" : "+"));
  8682. makeBtn(layoutInfo.prevBtnPosition, "prev", bind(this._changeTimeline, this, inverse ? "+" : "-"));
  8683. makeBtn(layoutInfo.playPosition, playState ? "stop" : "play", bind(this._handlePlayClick, this, !playState), true);
  8684. function makeBtn(position, iconName, onclick, willRotate) {
  8685. if (!position) {
  8686. return;
  8687. }
  8688. var iconSize = parsePercent(retrieve2(timelineModel.get(["controlStyle", iconName + "BtnSize"]), controlSize), controlSize);
  8689. var rect = [0, -iconSize / 2, iconSize, iconSize];
  8690. var btn = makeControlIcon(timelineModel, iconName + "Icon", rect, {
  8691. x: position[0],
  8692. y: position[1],
  8693. originX: controlSize / 2,
  8694. originY: 0,
  8695. rotation: willRotate ? -rotation : 0,
  8696. rectHover: true,
  8697. style: itemStyle,
  8698. onclick
  8699. });
  8700. btn.ensureState("emphasis").style = hoverStyle;
  8701. group.add(btn);
  8702. enableHoverEmphasis(btn);
  8703. }
  8704. };
  8705. SliderTimelineView2.prototype._renderCurrentPointer = function(layoutInfo, group, axis, timelineModel) {
  8706. var data = timelineModel.getData();
  8707. var currentIndex = timelineModel.getCurrentIndex();
  8708. var pointerModel = data.getItemModel(currentIndex).getModel("checkpointStyle");
  8709. var me = this;
  8710. var callback = {
  8711. onCreate: function(pointer) {
  8712. pointer.draggable = true;
  8713. pointer.drift = bind(me._handlePointerDrag, me);
  8714. pointer.ondragend = bind(me._handlePointerDragend, me);
  8715. pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel, true);
  8716. },
  8717. onUpdate: function(pointer) {
  8718. pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel);
  8719. }
  8720. };
  8721. this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback);
  8722. };
  8723. SliderTimelineView2.prototype._handlePlayClick = function(nextState) {
  8724. this._clearTimer();
  8725. this.api.dispatchAction({
  8726. type: "timelinePlayChange",
  8727. playState: nextState,
  8728. from: this.uid
  8729. });
  8730. };
  8731. SliderTimelineView2.prototype._handlePointerDrag = function(dx, dy, e) {
  8732. this._clearTimer();
  8733. this._pointerChangeTimeline([e.offsetX, e.offsetY]);
  8734. };
  8735. SliderTimelineView2.prototype._handlePointerDragend = function(e) {
  8736. this._pointerChangeTimeline([e.offsetX, e.offsetY], true);
  8737. };
  8738. SliderTimelineView2.prototype._pointerChangeTimeline = function(mousePos, trigger) {
  8739. var toCoord = this._toAxisCoord(mousePos)[0];
  8740. var axis = this._axis;
  8741. var axisExtent = asc(axis.getExtent().slice());
  8742. toCoord > axisExtent[1] && (toCoord = axisExtent[1]);
  8743. toCoord < axisExtent[0] && (toCoord = axisExtent[0]);
  8744. this._currentPointer.x = toCoord;
  8745. this._currentPointer.markRedraw();
  8746. this._progressLine.shape.x2 = toCoord;
  8747. this._progressLine.dirty();
  8748. var targetDataIndex = this._findNearestTick(toCoord);
  8749. var timelineModel = this.model;
  8750. if (trigger || targetDataIndex !== timelineModel.getCurrentIndex() && timelineModel.get("realtime")) {
  8751. this._changeTimeline(targetDataIndex);
  8752. }
  8753. };
  8754. SliderTimelineView2.prototype._doPlayStop = function() {
  8755. var _this = this;
  8756. this._clearTimer();
  8757. if (this.model.getPlayState()) {
  8758. this._timer = setTimeout(function() {
  8759. var timelineModel = _this.model;
  8760. _this._changeTimeline(timelineModel.getCurrentIndex() + (timelineModel.get("rewind", true) ? -1 : 1));
  8761. }, this.model.get("playInterval"));
  8762. }
  8763. };
  8764. SliderTimelineView2.prototype._toAxisCoord = function(vertex) {
  8765. var trans = this._mainGroup.getLocalTransform();
  8766. return applyTransform(vertex, trans, true);
  8767. };
  8768. SliderTimelineView2.prototype._findNearestTick = function(axisCoord) {
  8769. var data = this.model.getData();
  8770. var dist = Infinity;
  8771. var targetDataIndex;
  8772. var axis = this._axis;
  8773. data.each(["value"], function(value, dataIndex) {
  8774. var coord = axis.dataToCoord(value);
  8775. var d = Math.abs(coord - axisCoord);
  8776. if (d < dist) {
  8777. dist = d;
  8778. targetDataIndex = dataIndex;
  8779. }
  8780. });
  8781. return targetDataIndex;
  8782. };
  8783. SliderTimelineView2.prototype._clearTimer = function() {
  8784. if (this._timer) {
  8785. clearTimeout(this._timer);
  8786. this._timer = null;
  8787. }
  8788. };
  8789. SliderTimelineView2.prototype._changeTimeline = function(nextIndex) {
  8790. var currentIndex = this.model.getCurrentIndex();
  8791. if (nextIndex === "+") {
  8792. nextIndex = currentIndex + 1;
  8793. } else if (nextIndex === "-") {
  8794. nextIndex = currentIndex - 1;
  8795. }
  8796. this.api.dispatchAction({
  8797. type: "timelineChange",
  8798. currentIndex: nextIndex,
  8799. from: this.uid
  8800. });
  8801. };
  8802. SliderTimelineView2.prototype._updateTicksStatus = function() {
  8803. var currentIndex = this.model.getCurrentIndex();
  8804. var tickSymbols = this._tickSymbols;
  8805. var tickLabels = this._tickLabels;
  8806. if (tickSymbols) {
  8807. for (var i = 0; i < tickSymbols.length; i++) {
  8808. tickSymbols && tickSymbols[i] && tickSymbols[i].toggleState("progress", i < currentIndex);
  8809. }
  8810. }
  8811. if (tickLabels) {
  8812. for (var i = 0; i < tickLabels.length; i++) {
  8813. tickLabels && tickLabels[i] && tickLabels[i].toggleState("progress", labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex);
  8814. }
  8815. }
  8816. };
  8817. SliderTimelineView2.type = "timeline.slider";
  8818. return SliderTimelineView2;
  8819. }(TimelineView_default);
  8820. function createScaleByModel2(model, axisType) {
  8821. axisType = axisType || model.get("type");
  8822. if (axisType) {
  8823. switch (axisType) {
  8824. case "category":
  8825. return new Ordinal_default({
  8826. ordinalMeta: model.getCategories(),
  8827. extent: [Infinity, -Infinity]
  8828. });
  8829. case "time":
  8830. return new Time_default({
  8831. locale: model.ecModel.getLocaleModel(),
  8832. useUTC: model.ecModel.get("useUTC")
  8833. });
  8834. default:
  8835. return new Interval_default();
  8836. }
  8837. }
  8838. }
  8839. function getViewRect(model, api) {
  8840. return getLayoutRect(model.getBoxLayoutParams(), {
  8841. width: api.getWidth(),
  8842. height: api.getHeight()
  8843. }, model.get("padding"));
  8844. }
  8845. function makeControlIcon(timelineModel, objPath, rect, opts) {
  8846. var style = opts.style;
  8847. var icon = createIcon(timelineModel.get(["controlStyle", objPath]), opts || {}, new BoundingRect_default(rect[0], rect[1], rect[2], rect[3]));
  8848. if (style) {
  8849. icon.setStyle(style);
  8850. }
  8851. return icon;
  8852. }
  8853. function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {
  8854. var color = itemStyleModel.get("color");
  8855. if (!symbol) {
  8856. var symbolType = hostModel.get("symbol");
  8857. symbol = createSymbol(symbolType, -1, -1, 2, 2, color);
  8858. symbol.setStyle("strokeNoScale", true);
  8859. group.add(symbol);
  8860. callback && callback.onCreate(symbol);
  8861. } else {
  8862. symbol.setColor(color);
  8863. group.add(symbol);
  8864. callback && callback.onUpdate(symbol);
  8865. }
  8866. var itemStyle = itemStyleModel.getItemStyle(["color"]);
  8867. symbol.setStyle(itemStyle);
  8868. opt = merge({
  8869. rectHover: true,
  8870. z2: 100
  8871. }, opt, true);
  8872. var symbolSize = normalizeSymbolSize(hostModel.get("symbolSize"));
  8873. opt.scaleX = symbolSize[0] / 2;
  8874. opt.scaleY = symbolSize[1] / 2;
  8875. var symbolOffset = normalizeSymbolOffset(hostModel.get("symbolOffset"), symbolSize);
  8876. if (symbolOffset) {
  8877. opt.x = (opt.x || 0) + symbolOffset[0];
  8878. opt.y = (opt.y || 0) + symbolOffset[1];
  8879. }
  8880. var symbolRotate = hostModel.get("symbolRotate");
  8881. opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;
  8882. symbol.attr(opt);
  8883. symbol.updateTransform();
  8884. return symbol;
  8885. }
  8886. function pointerMoveTo(pointer, progressLine, dataIndex, axis, timelineModel, noAnimation) {
  8887. if (pointer.dragging) {
  8888. return;
  8889. }
  8890. var pointerModel = timelineModel.getModel("checkpointStyle");
  8891. var toCoord = axis.dataToCoord(timelineModel.getData().get("value", dataIndex));
  8892. if (noAnimation || !pointerModel.get("animation", true)) {
  8893. pointer.attr({
  8894. x: toCoord,
  8895. y: 0
  8896. });
  8897. progressLine && progressLine.attr({
  8898. shape: {
  8899. x2: toCoord
  8900. }
  8901. });
  8902. } else {
  8903. var animationCfg = {
  8904. duration: pointerModel.get("animationDuration", true),
  8905. easing: pointerModel.get("animationEasing", true)
  8906. };
  8907. pointer.stopAnimation(null, true);
  8908. pointer.animateTo({
  8909. x: toCoord,
  8910. y: 0
  8911. }, animationCfg);
  8912. progressLine && progressLine.animateTo({
  8913. shape: {
  8914. x2: toCoord
  8915. }
  8916. }, animationCfg);
  8917. }
  8918. }
  8919. var SliderTimelineView_default = SliderTimelineView;
  8920. // node_modules/echarts/lib/component/timeline/timelineAction.js
  8921. init_define_APP_INFO();
  8922. function installTimelineAction(registers) {
  8923. registers.registerAction({
  8924. type: "timelineChange",
  8925. event: "timelineChanged",
  8926. update: "prepareAndUpdate"
  8927. }, function(payload, ecModel, api) {
  8928. var timelineModel = ecModel.getComponent("timeline");
  8929. if (timelineModel && payload.currentIndex != null) {
  8930. timelineModel.setCurrentIndex(payload.currentIndex);
  8931. if (!timelineModel.get("loop", true) && timelineModel.isIndexMax() && timelineModel.getPlayState()) {
  8932. timelineModel.setPlayState(false);
  8933. api.dispatchAction({
  8934. type: "timelinePlayChange",
  8935. playState: false,
  8936. from: payload.from
  8937. });
  8938. }
  8939. }
  8940. ecModel.resetOption("timeline", {
  8941. replaceMerge: timelineModel.get("replaceMerge", true)
  8942. });
  8943. return defaults({
  8944. currentIndex: timelineModel.option.currentIndex
  8945. }, payload);
  8946. });
  8947. registers.registerAction({
  8948. type: "timelinePlayChange",
  8949. event: "timelinePlayChanged",
  8950. update: "update"
  8951. }, function(payload, ecModel) {
  8952. var timelineModel = ecModel.getComponent("timeline");
  8953. if (timelineModel && payload.playState != null) {
  8954. timelineModel.setPlayState(payload.playState);
  8955. }
  8956. });
  8957. }
  8958. // node_modules/echarts/lib/component/timeline/preprocessor.js
  8959. init_define_APP_INFO();
  8960. function timelinePreprocessor(option) {
  8961. var timelineOpt = option && option.timeline;
  8962. if (!isArray(timelineOpt)) {
  8963. timelineOpt = timelineOpt ? [timelineOpt] : [];
  8964. }
  8965. each(timelineOpt, function(opt) {
  8966. if (!opt) {
  8967. return;
  8968. }
  8969. compatibleEC2(opt);
  8970. });
  8971. }
  8972. function compatibleEC2(opt) {
  8973. var type = opt.type;
  8974. var ec2Types = {
  8975. "number": "value",
  8976. "time": "time"
  8977. };
  8978. if (ec2Types[type]) {
  8979. opt.axisType = ec2Types[type];
  8980. delete opt.type;
  8981. }
  8982. transferItem(opt);
  8983. if (has(opt, "controlPosition")) {
  8984. var controlStyle = opt.controlStyle || (opt.controlStyle = {});
  8985. if (!has(controlStyle, "position")) {
  8986. controlStyle.position = opt.controlPosition;
  8987. }
  8988. if (controlStyle.position === "none" && !has(controlStyle, "show")) {
  8989. controlStyle.show = false;
  8990. delete controlStyle.position;
  8991. }
  8992. delete opt.controlPosition;
  8993. }
  8994. each(opt.data || [], function(dataItem) {
  8995. if (isObject(dataItem) && !isArray(dataItem)) {
  8996. if (!has(dataItem, "value") && has(dataItem, "name")) {
  8997. dataItem.value = dataItem.name;
  8998. }
  8999. transferItem(dataItem);
  9000. }
  9001. });
  9002. }
  9003. function transferItem(opt) {
  9004. var itemStyle = opt.itemStyle || (opt.itemStyle = {});
  9005. var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {});
  9006. var label = opt.label || opt.label || {};
  9007. var labelNormal = label.normal || (label.normal = {});
  9008. var excludeLabelAttr = {
  9009. normal: 1,
  9010. emphasis: 1
  9011. };
  9012. each(label, function(value, name) {
  9013. if (!excludeLabelAttr[name] && !has(labelNormal, name)) {
  9014. labelNormal[name] = value;
  9015. }
  9016. });
  9017. if (itemStyleEmphasis.label && !has(label, "emphasis")) {
  9018. label.emphasis = itemStyleEmphasis.label;
  9019. delete itemStyleEmphasis.label;
  9020. }
  9021. }
  9022. function has(obj, attr) {
  9023. return obj.hasOwnProperty(attr);
  9024. }
  9025. // node_modules/echarts/lib/component/timeline/install.js
  9026. function install16(registers) {
  9027. registers.registerComponentModel(SliderTimelineModel_default);
  9028. registers.registerComponentView(SliderTimelineView_default);
  9029. registers.registerSubTypeDefaulter("timeline", function() {
  9030. return "slider";
  9031. });
  9032. installTimelineAction(registers);
  9033. registers.registerPreprocessor(timelinePreprocessor);
  9034. }
  9035. // node_modules/echarts/lib/component/marker/installMarkPoint.js
  9036. init_define_APP_INFO();
  9037. // node_modules/echarts/lib/component/marker/checkMarkerInSeries.js
  9038. init_define_APP_INFO();
  9039. function checkMarkerInSeries(seriesOpts, markerType) {
  9040. if (!seriesOpts) {
  9041. return false;
  9042. }
  9043. var seriesOptArr = isArray(seriesOpts) ? seriesOpts : [seriesOpts];
  9044. for (var idx = 0; idx < seriesOptArr.length; idx++) {
  9045. if (seriesOptArr[idx] && seriesOptArr[idx][markerType]) {
  9046. return true;
  9047. }
  9048. }
  9049. return false;
  9050. }
  9051. // node_modules/echarts/lib/component/marker/MarkPointModel.js
  9052. init_define_APP_INFO();
  9053. // node_modules/echarts/lib/component/marker/MarkerModel.js
  9054. init_define_APP_INFO();
  9055. function fillLabel(opt) {
  9056. defaultEmphasis(opt, "label", ["show"]);
  9057. }
  9058. var inner7 = makeInner();
  9059. var MarkerModel = function(_super) {
  9060. __extends(MarkerModel2, _super);
  9061. function MarkerModel2() {
  9062. var _this = _super !== null && _super.apply(this, arguments) || this;
  9063. _this.type = MarkerModel2.type;
  9064. _this.createdBySelf = false;
  9065. return _this;
  9066. }
  9067. MarkerModel2.prototype.init = function(option, parentModel, ecModel) {
  9068. if (true) {
  9069. if (this.type === "marker") {
  9070. throw new Error("Marker component is abstract component. Use markLine, markPoint, markArea instead.");
  9071. }
  9072. }
  9073. this.mergeDefaultAndTheme(option, ecModel);
  9074. this._mergeOption(option, ecModel, false, true);
  9075. };
  9076. MarkerModel2.prototype.isAnimationEnabled = function() {
  9077. if (env_default.node) {
  9078. return false;
  9079. }
  9080. var hostSeries = this.__hostSeries;
  9081. return this.getShallow("animation") && hostSeries && hostSeries.isAnimationEnabled();
  9082. };
  9083. MarkerModel2.prototype.mergeOption = function(newOpt, ecModel) {
  9084. this._mergeOption(newOpt, ecModel, false, false);
  9085. };
  9086. MarkerModel2.prototype._mergeOption = function(newOpt, ecModel, createdBySelf, isInit) {
  9087. var componentType = this.mainType;
  9088. if (!createdBySelf) {
  9089. ecModel.eachSeries(function(seriesModel) {
  9090. var markerOpt = seriesModel.get(this.mainType, true);
  9091. var markerModel = inner7(seriesModel)[componentType];
  9092. if (!markerOpt || !markerOpt.data) {
  9093. inner7(seriesModel)[componentType] = null;
  9094. return;
  9095. }
  9096. if (!markerModel) {
  9097. if (isInit) {
  9098. fillLabel(markerOpt);
  9099. }
  9100. each(markerOpt.data, function(item) {
  9101. if (item instanceof Array) {
  9102. fillLabel(item[0]);
  9103. fillLabel(item[1]);
  9104. } else {
  9105. fillLabel(item);
  9106. }
  9107. });
  9108. markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel);
  9109. extend(markerModel, {
  9110. mainType: this.mainType,
  9111. seriesIndex: seriesModel.seriesIndex,
  9112. name: seriesModel.name,
  9113. createdBySelf: true
  9114. });
  9115. markerModel.__hostSeries = seriesModel;
  9116. } else {
  9117. markerModel._mergeOption(markerOpt, ecModel, true);
  9118. }
  9119. inner7(seriesModel)[componentType] = markerModel;
  9120. }, this);
  9121. }
  9122. };
  9123. MarkerModel2.prototype.formatTooltip = function(dataIndex, multipleSeries, dataType) {
  9124. var data = this.getData();
  9125. var value = this.getRawValue(dataIndex);
  9126. var itemName = data.getName(dataIndex);
  9127. return createTooltipMarkup("section", {
  9128. header: this.name,
  9129. blocks: [createTooltipMarkup("nameValue", {
  9130. name: itemName,
  9131. value,
  9132. noName: !itemName,
  9133. noValue: value == null
  9134. })]
  9135. });
  9136. };
  9137. MarkerModel2.prototype.getData = function() {
  9138. return this._data;
  9139. };
  9140. MarkerModel2.prototype.setData = function(data) {
  9141. this._data = data;
  9142. };
  9143. MarkerModel2.getMarkerModelFromSeries = function(seriesModel, componentType) {
  9144. return inner7(seriesModel)[componentType];
  9145. };
  9146. MarkerModel2.type = "marker";
  9147. MarkerModel2.dependencies = ["series", "grid", "polar", "geo"];
  9148. return MarkerModel2;
  9149. }(Component_default);
  9150. mixin(MarkerModel, DataFormatMixin.prototype);
  9151. var MarkerModel_default = MarkerModel;
  9152. // node_modules/echarts/lib/component/marker/MarkPointModel.js
  9153. var MarkPointModel = function(_super) {
  9154. __extends(MarkPointModel2, _super);
  9155. function MarkPointModel2() {
  9156. var _this = _super !== null && _super.apply(this, arguments) || this;
  9157. _this.type = MarkPointModel2.type;
  9158. return _this;
  9159. }
  9160. MarkPointModel2.prototype.createMarkerModelFromSeries = function(markerOpt, masterMarkerModel, ecModel) {
  9161. return new MarkPointModel2(markerOpt, masterMarkerModel, ecModel);
  9162. };
  9163. MarkPointModel2.type = "markPoint";
  9164. MarkPointModel2.defaultOption = {
  9165. z: 5,
  9166. symbol: "pin",
  9167. symbolSize: 50,
  9168. tooltip: {
  9169. trigger: "item"
  9170. },
  9171. label: {
  9172. show: true,
  9173. position: "inside"
  9174. },
  9175. itemStyle: {
  9176. borderWidth: 2
  9177. },
  9178. emphasis: {
  9179. label: {
  9180. show: true
  9181. }
  9182. }
  9183. };
  9184. return MarkPointModel2;
  9185. }(MarkerModel_default);
  9186. var MarkPointModel_default = MarkPointModel;
  9187. // node_modules/echarts/lib/component/marker/MarkPointView.js
  9188. init_define_APP_INFO();
  9189. // node_modules/echarts/lib/component/marker/markerHelper.js
  9190. init_define_APP_INFO();
  9191. function hasXOrY(item) {
  9192. return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y)));
  9193. }
  9194. function hasXAndY(item) {
  9195. return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y));
  9196. }
  9197. function markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) {
  9198. var coordArr = [];
  9199. var stacked = isDimensionStacked(
  9200. data,
  9201. targetDataDim
  9202. );
  9203. var calcDataDim = stacked ? data.getCalculationInfo("stackResultDimension") : targetDataDim;
  9204. var value = numCalculate(data, calcDataDim, markerType);
  9205. var dataIndex = data.indicesOfNearest(calcDataDim, value)[0];
  9206. coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);
  9207. coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);
  9208. var coordArrValue = data.get(targetDataDim, dataIndex);
  9209. var precision = getPrecision(data.get(targetDataDim, dataIndex));
  9210. precision = Math.min(precision, 20);
  9211. if (precision >= 0) {
  9212. coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);
  9213. }
  9214. return [coordArr, coordArrValue];
  9215. }
  9216. var markerTypeCalculator = {
  9217. min: curry(markerTypeCalculatorWithExtent, "min"),
  9218. max: curry(markerTypeCalculatorWithExtent, "max"),
  9219. average: curry(markerTypeCalculatorWithExtent, "average"),
  9220. median: curry(markerTypeCalculatorWithExtent, "median")
  9221. };
  9222. function dataTransform(seriesModel, item) {
  9223. var data = seriesModel.getData();
  9224. var coordSys = seriesModel.coordinateSystem;
  9225. if (item && !hasXAndY(item) && !isArray(item.coord) && coordSys) {
  9226. var dims = coordSys.dimensions;
  9227. var axisInfo = getAxisInfo2(item, data, coordSys, seriesModel);
  9228. item = clone(item);
  9229. if (item.type && markerTypeCalculator[item.type] && axisInfo.baseAxis && axisInfo.valueAxis) {
  9230. var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);
  9231. var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);
  9232. var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);
  9233. item.coord = coordInfo[0];
  9234. item.value = coordInfo[1];
  9235. } else {
  9236. var coord = [item.xAxis != null ? item.xAxis : item.radiusAxis, item.yAxis != null ? item.yAxis : item.angleAxis];
  9237. for (var i = 0; i < 2; i++) {
  9238. if (markerTypeCalculator[coord[i]]) {
  9239. coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]);
  9240. }
  9241. }
  9242. item.coord = coord;
  9243. }
  9244. }
  9245. return item;
  9246. }
  9247. function getAxisInfo2(item, data, coordSys, seriesModel) {
  9248. var ret = {};
  9249. if (item.valueIndex != null || item.valueDim != null) {
  9250. ret.valueDataDim = item.valueIndex != null ? data.getDimension(item.valueIndex) : item.valueDim;
  9251. ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim));
  9252. ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);
  9253. ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);
  9254. } else {
  9255. ret.baseAxis = seriesModel.getBaseAxis();
  9256. ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);
  9257. ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);
  9258. ret.valueDataDim = data.mapDimension(ret.valueAxis.dim);
  9259. }
  9260. return ret;
  9261. }
  9262. function dataDimToCoordDim(seriesModel, dataDim) {
  9263. var dimItem = seriesModel.getData().getDimensionInfo(dataDim);
  9264. return dimItem && dimItem.coordDim;
  9265. }
  9266. function dataFilter(coordSys, item) {
  9267. return coordSys && coordSys.containData && item.coord && !hasXOrY(item) ? coordSys.containData(item.coord) : true;
  9268. }
  9269. function zoneFilter(coordSys, item1, item2) {
  9270. return coordSys && coordSys.containZone && item1.coord && item2.coord && !hasXOrY(item1) && !hasXOrY(item2) ? coordSys.containZone(item1.coord, item2.coord) : true;
  9271. }
  9272. function createMarkerDimValueGetter(inCoordSys, dims) {
  9273. return inCoordSys ? function(item, dimName, dataIndex, dimIndex) {
  9274. var rawVal = dimIndex < 2 ? item.coord && item.coord[dimIndex] : item.value;
  9275. return parseDataValue(rawVal, dims[dimIndex]);
  9276. } : function(item, dimName, dataIndex, dimIndex) {
  9277. return parseDataValue(item.value, dims[dimIndex]);
  9278. };
  9279. }
  9280. function numCalculate(data, valueDataDim, type) {
  9281. if (type === "average") {
  9282. var sum_1 = 0;
  9283. var count_1 = 0;
  9284. data.each(valueDataDim, function(val, idx) {
  9285. if (!isNaN(val)) {
  9286. sum_1 += val;
  9287. count_1++;
  9288. }
  9289. });
  9290. return sum_1 / count_1;
  9291. } else if (type === "median") {
  9292. return data.getMedian(valueDataDim);
  9293. } else {
  9294. return data.getDataExtent(valueDataDim)[type === "max" ? 1 : 0];
  9295. }
  9296. }
  9297. // node_modules/echarts/lib/component/marker/MarkerView.js
  9298. init_define_APP_INFO();
  9299. var inner8 = makeInner();
  9300. var MarkerView = function(_super) {
  9301. __extends(MarkerView2, _super);
  9302. function MarkerView2() {
  9303. var _this = _super !== null && _super.apply(this, arguments) || this;
  9304. _this.type = MarkerView2.type;
  9305. return _this;
  9306. }
  9307. MarkerView2.prototype.init = function() {
  9308. this.markerGroupMap = createHashMap();
  9309. };
  9310. MarkerView2.prototype.render = function(markerModel, ecModel, api) {
  9311. var _this = this;
  9312. var markerGroupMap = this.markerGroupMap;
  9313. markerGroupMap.each(function(item) {
  9314. inner8(item).keep = false;
  9315. });
  9316. ecModel.eachSeries(function(seriesModel) {
  9317. var markerModel2 = MarkerModel_default.getMarkerModelFromSeries(seriesModel, _this.type);
  9318. markerModel2 && _this.renderSeries(seriesModel, markerModel2, ecModel, api);
  9319. });
  9320. markerGroupMap.each(function(item) {
  9321. !inner8(item).keep && _this.group.remove(item.group);
  9322. });
  9323. };
  9324. MarkerView2.prototype.markKeep = function(drawGroup) {
  9325. inner8(drawGroup).keep = true;
  9326. };
  9327. MarkerView2.prototype.toggleBlurSeries = function(seriesModelList, isBlur) {
  9328. var _this = this;
  9329. each(seriesModelList, function(seriesModel) {
  9330. var markerModel = MarkerModel_default.getMarkerModelFromSeries(seriesModel, _this.type);
  9331. if (markerModel) {
  9332. var data = markerModel.getData();
  9333. data.eachItemGraphicEl(function(el) {
  9334. if (el) {
  9335. isBlur ? enterBlur(el) : leaveBlur(el);
  9336. }
  9337. });
  9338. }
  9339. });
  9340. };
  9341. MarkerView2.type = "marker";
  9342. return MarkerView2;
  9343. }(Component_default2);
  9344. var MarkerView_default = MarkerView;
  9345. // node_modules/echarts/lib/component/marker/MarkPointView.js
  9346. function updateMarkerLayout(mpData, seriesModel, api) {
  9347. var coordSys = seriesModel.coordinateSystem;
  9348. mpData.each(function(idx) {
  9349. var itemModel = mpData.getItemModel(idx);
  9350. var point;
  9351. var xPx = parsePercent2(itemModel.get("x"), api.getWidth());
  9352. var yPx = parsePercent2(itemModel.get("y"), api.getHeight());
  9353. if (!isNaN(xPx) && !isNaN(yPx)) {
  9354. point = [xPx, yPx];
  9355. } else if (seriesModel.getMarkerPosition) {
  9356. point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx));
  9357. } else if (coordSys) {
  9358. var x = mpData.get(coordSys.dimensions[0], idx);
  9359. var y = mpData.get(coordSys.dimensions[1], idx);
  9360. point = coordSys.dataToPoint([x, y]);
  9361. }
  9362. if (!isNaN(xPx)) {
  9363. point[0] = xPx;
  9364. }
  9365. if (!isNaN(yPx)) {
  9366. point[1] = yPx;
  9367. }
  9368. mpData.setItemLayout(idx, point);
  9369. });
  9370. }
  9371. var MarkPointView = function(_super) {
  9372. __extends(MarkPointView2, _super);
  9373. function MarkPointView2() {
  9374. var _this = _super !== null && _super.apply(this, arguments) || this;
  9375. _this.type = MarkPointView2.type;
  9376. return _this;
  9377. }
  9378. MarkPointView2.prototype.updateTransform = function(markPointModel, ecModel, api) {
  9379. ecModel.eachSeries(function(seriesModel) {
  9380. var mpModel = MarkerModel_default.getMarkerModelFromSeries(seriesModel, "markPoint");
  9381. if (mpModel) {
  9382. updateMarkerLayout(mpModel.getData(), seriesModel, api);
  9383. this.markerGroupMap.get(seriesModel.id).updateLayout();
  9384. }
  9385. }, this);
  9386. };
  9387. MarkPointView2.prototype.renderSeries = function(seriesModel, mpModel, ecModel, api) {
  9388. var coordSys = seriesModel.coordinateSystem;
  9389. var seriesId = seriesModel.id;
  9390. var seriesData = seriesModel.getData();
  9391. var symbolDrawMap = this.markerGroupMap;
  9392. var symbolDraw = symbolDrawMap.get(seriesId) || symbolDrawMap.set(seriesId, new SymbolDraw_default());
  9393. var mpData = createData(coordSys, seriesModel, mpModel);
  9394. mpModel.setData(mpData);
  9395. updateMarkerLayout(mpModel.getData(), seriesModel, api);
  9396. mpData.each(function(idx) {
  9397. var itemModel = mpData.getItemModel(idx);
  9398. var symbol = itemModel.getShallow("symbol");
  9399. var symbolSize = itemModel.getShallow("symbolSize");
  9400. var symbolRotate = itemModel.getShallow("symbolRotate");
  9401. var symbolOffset = itemModel.getShallow("symbolOffset");
  9402. var symbolKeepAspect = itemModel.getShallow("symbolKeepAspect");
  9403. if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate) || isFunction(symbolOffset)) {
  9404. var rawIdx = mpModel.getRawValue(idx);
  9405. var dataParams = mpModel.getDataParams(idx);
  9406. if (isFunction(symbol)) {
  9407. symbol = symbol(rawIdx, dataParams);
  9408. }
  9409. if (isFunction(symbolSize)) {
  9410. symbolSize = symbolSize(rawIdx, dataParams);
  9411. }
  9412. if (isFunction(symbolRotate)) {
  9413. symbolRotate = symbolRotate(rawIdx, dataParams);
  9414. }
  9415. if (isFunction(symbolOffset)) {
  9416. symbolOffset = symbolOffset(rawIdx, dataParams);
  9417. }
  9418. }
  9419. var style = itemModel.getModel("itemStyle").getItemStyle();
  9420. var color = getVisualFromData(seriesData, "color");
  9421. if (!style.fill) {
  9422. style.fill = color;
  9423. }
  9424. mpData.setItemVisual(idx, {
  9425. symbol,
  9426. symbolSize,
  9427. symbolRotate,
  9428. symbolOffset,
  9429. symbolKeepAspect,
  9430. style
  9431. });
  9432. });
  9433. symbolDraw.updateData(mpData);
  9434. this.group.add(symbolDraw.group);
  9435. mpData.eachItemGraphicEl(function(el) {
  9436. el.traverse(function(child) {
  9437. getECData(child).dataModel = mpModel;
  9438. });
  9439. });
  9440. this.markKeep(symbolDraw);
  9441. symbolDraw.group.silent = mpModel.get("silent") || seriesModel.get("silent");
  9442. };
  9443. MarkPointView2.type = "markPoint";
  9444. return MarkPointView2;
  9445. }(MarkerView_default);
  9446. function createData(coordSys, seriesModel, mpModel) {
  9447. var coordDimsInfos;
  9448. if (coordSys) {
  9449. coordDimsInfos = map(coordSys && coordSys.dimensions, function(coordDim) {
  9450. var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};
  9451. return extend(extend({}, info), {
  9452. name: coordDim,
  9453. ordinalMeta: null
  9454. });
  9455. });
  9456. } else {
  9457. coordDimsInfos = [{
  9458. name: "value",
  9459. type: "float"
  9460. }];
  9461. }
  9462. var mpData = new SeriesData_default(coordDimsInfos, mpModel);
  9463. var dataOpt = map(mpModel.get("data"), curry(dataTransform, seriesModel));
  9464. if (coordSys) {
  9465. dataOpt = filter(dataOpt, curry(dataFilter, coordSys));
  9466. }
  9467. var dimValueGetter = createMarkerDimValueGetter(!!coordSys, coordDimsInfos);
  9468. mpData.initData(dataOpt, null, dimValueGetter);
  9469. return mpData;
  9470. }
  9471. var MarkPointView_default = MarkPointView;
  9472. // node_modules/echarts/lib/component/marker/installMarkPoint.js
  9473. function install17(registers) {
  9474. registers.registerComponentModel(MarkPointModel_default);
  9475. registers.registerComponentView(MarkPointView_default);
  9476. registers.registerPreprocessor(function(opt) {
  9477. if (checkMarkerInSeries(opt.series, "markPoint")) {
  9478. opt.markPoint = opt.markPoint || {};
  9479. }
  9480. });
  9481. }
  9482. // node_modules/echarts/lib/component/marker/installMarkLine.js
  9483. init_define_APP_INFO();
  9484. // node_modules/echarts/lib/component/marker/MarkLineModel.js
  9485. init_define_APP_INFO();
  9486. var MarkLineModel = function(_super) {
  9487. __extends(MarkLineModel2, _super);
  9488. function MarkLineModel2() {
  9489. var _this = _super !== null && _super.apply(this, arguments) || this;
  9490. _this.type = MarkLineModel2.type;
  9491. return _this;
  9492. }
  9493. MarkLineModel2.prototype.createMarkerModelFromSeries = function(markerOpt, masterMarkerModel, ecModel) {
  9494. return new MarkLineModel2(markerOpt, masterMarkerModel, ecModel);
  9495. };
  9496. MarkLineModel2.type = "markLine";
  9497. MarkLineModel2.defaultOption = {
  9498. z: 5,
  9499. symbol: ["circle", "arrow"],
  9500. symbolSize: [8, 16],
  9501. symbolOffset: 0,
  9502. precision: 2,
  9503. tooltip: {
  9504. trigger: "item"
  9505. },
  9506. label: {
  9507. show: true,
  9508. position: "end",
  9509. distance: 5
  9510. },
  9511. lineStyle: {
  9512. type: "dashed"
  9513. },
  9514. emphasis: {
  9515. label: {
  9516. show: true
  9517. },
  9518. lineStyle: {
  9519. width: 3
  9520. }
  9521. },
  9522. animationEasing: "linear"
  9523. };
  9524. return MarkLineModel2;
  9525. }(MarkerModel_default);
  9526. var MarkLineModel_default = MarkLineModel;
  9527. // node_modules/echarts/lib/component/marker/MarkLineView.js
  9528. init_define_APP_INFO();
  9529. var inner9 = makeInner();
  9530. var markLineTransform = function(seriesModel, coordSys, mlModel, item) {
  9531. var data = seriesModel.getData();
  9532. var itemArray;
  9533. if (!isArray(item)) {
  9534. var mlType = item.type;
  9535. if (mlType === "min" || mlType === "max" || mlType === "average" || mlType === "median" || item.xAxis != null || item.yAxis != null) {
  9536. var valueAxis = void 0;
  9537. var value = void 0;
  9538. if (item.yAxis != null || item.xAxis != null) {
  9539. valueAxis = coordSys.getAxis(item.yAxis != null ? "y" : "x");
  9540. value = retrieve(item.yAxis, item.xAxis);
  9541. } else {
  9542. var axisInfo = getAxisInfo2(item, data, coordSys, seriesModel);
  9543. valueAxis = axisInfo.valueAxis;
  9544. var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);
  9545. value = numCalculate(data, valueDataDim, mlType);
  9546. }
  9547. var valueIndex = valueAxis.dim === "x" ? 0 : 1;
  9548. var baseIndex = 1 - valueIndex;
  9549. var mlFrom = clone(item);
  9550. var mlTo = {
  9551. coord: []
  9552. };
  9553. mlFrom.type = null;
  9554. mlFrom.coord = [];
  9555. mlFrom.coord[baseIndex] = -Infinity;
  9556. mlTo.coord[baseIndex] = Infinity;
  9557. var precision = mlModel.get("precision");
  9558. if (precision >= 0 && isNumber(value)) {
  9559. value = +value.toFixed(Math.min(precision, 20));
  9560. }
  9561. mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;
  9562. itemArray = [mlFrom, mlTo, {
  9563. type: mlType,
  9564. valueIndex: item.valueIndex,
  9565. value
  9566. }];
  9567. } else {
  9568. if (true) {
  9569. logError("Invalid markLine data.");
  9570. }
  9571. itemArray = [];
  9572. }
  9573. } else {
  9574. itemArray = item;
  9575. }
  9576. var normalizedItem = [dataTransform(seriesModel, itemArray[0]), dataTransform(seriesModel, itemArray[1]), extend({}, itemArray[2])];
  9577. normalizedItem[2].type = normalizedItem[2].type || null;
  9578. merge(normalizedItem[2], normalizedItem[0]);
  9579. merge(normalizedItem[2], normalizedItem[1]);
  9580. return normalizedItem;
  9581. };
  9582. function isInifinity(val) {
  9583. return !isNaN(val) && !isFinite(val);
  9584. }
  9585. function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {
  9586. var otherDimIndex = 1 - dimIndex;
  9587. var dimName = coordSys.dimensions[dimIndex];
  9588. return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);
  9589. }
  9590. function markLineFilter(coordSys, item) {
  9591. if (coordSys.type === "cartesian2d") {
  9592. var fromCoord = item[0].coord;
  9593. var toCoord = item[1].coord;
  9594. if (fromCoord && toCoord && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) {
  9595. return true;
  9596. }
  9597. }
  9598. return dataFilter(coordSys, item[0]) && dataFilter(coordSys, item[1]);
  9599. }
  9600. function updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) {
  9601. var coordSys = seriesModel.coordinateSystem;
  9602. var itemModel = data.getItemModel(idx);
  9603. var point;
  9604. var xPx = parsePercent2(itemModel.get("x"), api.getWidth());
  9605. var yPx = parsePercent2(itemModel.get("y"), api.getHeight());
  9606. if (!isNaN(xPx) && !isNaN(yPx)) {
  9607. point = [xPx, yPx];
  9608. } else {
  9609. if (seriesModel.getMarkerPosition) {
  9610. point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx));
  9611. } else {
  9612. var dims = coordSys.dimensions;
  9613. var x = data.get(dims[0], idx);
  9614. var y = data.get(dims[1], idx);
  9615. point = coordSys.dataToPoint([x, y]);
  9616. }
  9617. if (isCoordinateSystemType(coordSys, "cartesian2d")) {
  9618. var xAxis = coordSys.getAxis("x");
  9619. var yAxis = coordSys.getAxis("y");
  9620. var dims = coordSys.dimensions;
  9621. if (isInifinity(data.get(dims[0], idx))) {
  9622. point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);
  9623. } else if (isInifinity(data.get(dims[1], idx))) {
  9624. point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);
  9625. }
  9626. }
  9627. if (!isNaN(xPx)) {
  9628. point[0] = xPx;
  9629. }
  9630. if (!isNaN(yPx)) {
  9631. point[1] = yPx;
  9632. }
  9633. }
  9634. data.setItemLayout(idx, point);
  9635. }
  9636. var MarkLineView = function(_super) {
  9637. __extends(MarkLineView2, _super);
  9638. function MarkLineView2() {
  9639. var _this = _super !== null && _super.apply(this, arguments) || this;
  9640. _this.type = MarkLineView2.type;
  9641. return _this;
  9642. }
  9643. MarkLineView2.prototype.updateTransform = function(markLineModel, ecModel, api) {
  9644. ecModel.eachSeries(function(seriesModel) {
  9645. var mlModel = MarkerModel_default.getMarkerModelFromSeries(seriesModel, "markLine");
  9646. if (mlModel) {
  9647. var mlData_1 = mlModel.getData();
  9648. var fromData_1 = inner9(mlModel).from;
  9649. var toData_1 = inner9(mlModel).to;
  9650. fromData_1.each(function(idx) {
  9651. updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api);
  9652. updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api);
  9653. });
  9654. mlData_1.each(function(idx) {
  9655. mlData_1.setItemLayout(idx, [fromData_1.getItemLayout(idx), toData_1.getItemLayout(idx)]);
  9656. });
  9657. this.markerGroupMap.get(seriesModel.id).updateLayout();
  9658. }
  9659. }, this);
  9660. };
  9661. MarkLineView2.prototype.renderSeries = function(seriesModel, mlModel, ecModel, api) {
  9662. var coordSys = seriesModel.coordinateSystem;
  9663. var seriesId = seriesModel.id;
  9664. var seriesData = seriesModel.getData();
  9665. var lineDrawMap = this.markerGroupMap;
  9666. var lineDraw = lineDrawMap.get(seriesId) || lineDrawMap.set(seriesId, new LineDraw_default());
  9667. this.group.add(lineDraw.group);
  9668. var mlData = createList(coordSys, seriesModel, mlModel);
  9669. var fromData = mlData.from;
  9670. var toData = mlData.to;
  9671. var lineData = mlData.line;
  9672. inner9(mlModel).from = fromData;
  9673. inner9(mlModel).to = toData;
  9674. mlModel.setData(lineData);
  9675. var symbolType = mlModel.get("symbol");
  9676. var symbolSize = mlModel.get("symbolSize");
  9677. var symbolRotate = mlModel.get("symbolRotate");
  9678. var symbolOffset = mlModel.get("symbolOffset");
  9679. if (!isArray(symbolType)) {
  9680. symbolType = [symbolType, symbolType];
  9681. }
  9682. if (!isArray(symbolSize)) {
  9683. symbolSize = [symbolSize, symbolSize];
  9684. }
  9685. if (!isArray(symbolRotate)) {
  9686. symbolRotate = [symbolRotate, symbolRotate];
  9687. }
  9688. if (!isArray(symbolOffset)) {
  9689. symbolOffset = [symbolOffset, symbolOffset];
  9690. }
  9691. mlData.from.each(function(idx) {
  9692. updateDataVisualAndLayout(fromData, idx, true);
  9693. updateDataVisualAndLayout(toData, idx, false);
  9694. });
  9695. lineData.each(function(idx) {
  9696. var lineStyle = lineData.getItemModel(idx).getModel("lineStyle").getLineStyle();
  9697. lineData.setItemLayout(idx, [fromData.getItemLayout(idx), toData.getItemLayout(idx)]);
  9698. if (lineStyle.stroke == null) {
  9699. lineStyle.stroke = fromData.getItemVisual(idx, "style").fill;
  9700. }
  9701. lineData.setItemVisual(idx, {
  9702. fromSymbolKeepAspect: fromData.getItemVisual(idx, "symbolKeepAspect"),
  9703. fromSymbolOffset: fromData.getItemVisual(idx, "symbolOffset"),
  9704. fromSymbolRotate: fromData.getItemVisual(idx, "symbolRotate"),
  9705. fromSymbolSize: fromData.getItemVisual(idx, "symbolSize"),
  9706. fromSymbol: fromData.getItemVisual(idx, "symbol"),
  9707. toSymbolKeepAspect: toData.getItemVisual(idx, "symbolKeepAspect"),
  9708. toSymbolOffset: toData.getItemVisual(idx, "symbolOffset"),
  9709. toSymbolRotate: toData.getItemVisual(idx, "symbolRotate"),
  9710. toSymbolSize: toData.getItemVisual(idx, "symbolSize"),
  9711. toSymbol: toData.getItemVisual(idx, "symbol"),
  9712. style: lineStyle
  9713. });
  9714. });
  9715. lineDraw.updateData(lineData);
  9716. mlData.line.eachItemGraphicEl(function(el) {
  9717. getECData(el).dataModel = mlModel;
  9718. el.traverse(function(child) {
  9719. getECData(child).dataModel = mlModel;
  9720. });
  9721. });
  9722. function updateDataVisualAndLayout(data, idx, isFrom) {
  9723. var itemModel = data.getItemModel(idx);
  9724. updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api);
  9725. var style = itemModel.getModel("itemStyle").getItemStyle();
  9726. if (style.fill == null) {
  9727. style.fill = getVisualFromData(seriesData, "color");
  9728. }
  9729. data.setItemVisual(idx, {
  9730. symbolKeepAspect: itemModel.get("symbolKeepAspect"),
  9731. symbolOffset: retrieve2(itemModel.get("symbolOffset", true), symbolOffset[isFrom ? 0 : 1]),
  9732. symbolRotate: retrieve2(itemModel.get("symbolRotate", true), symbolRotate[isFrom ? 0 : 1]),
  9733. symbolSize: retrieve2(itemModel.get("symbolSize"), symbolSize[isFrom ? 0 : 1]),
  9734. symbol: retrieve2(itemModel.get("symbol", true), symbolType[isFrom ? 0 : 1]),
  9735. style
  9736. });
  9737. }
  9738. this.markKeep(lineDraw);
  9739. lineDraw.group.silent = mlModel.get("silent") || seriesModel.get("silent");
  9740. };
  9741. MarkLineView2.type = "markLine";
  9742. return MarkLineView2;
  9743. }(MarkerView_default);
  9744. function createList(coordSys, seriesModel, mlModel) {
  9745. var coordDimsInfos;
  9746. if (coordSys) {
  9747. coordDimsInfos = map(coordSys && coordSys.dimensions, function(coordDim) {
  9748. var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};
  9749. return extend(extend({}, info), {
  9750. name: coordDim,
  9751. ordinalMeta: null
  9752. });
  9753. });
  9754. } else {
  9755. coordDimsInfos = [{
  9756. name: "value",
  9757. type: "float"
  9758. }];
  9759. }
  9760. var fromData = new SeriesData_default(coordDimsInfos, mlModel);
  9761. var toData = new SeriesData_default(coordDimsInfos, mlModel);
  9762. var lineData = new SeriesData_default([], mlModel);
  9763. var optData = map(mlModel.get("data"), curry(markLineTransform, seriesModel, coordSys, mlModel));
  9764. if (coordSys) {
  9765. optData = filter(optData, curry(markLineFilter, coordSys));
  9766. }
  9767. var dimValueGetter = createMarkerDimValueGetter(!!coordSys, coordDimsInfos);
  9768. fromData.initData(map(optData, function(item) {
  9769. return item[0];
  9770. }), null, dimValueGetter);
  9771. toData.initData(map(optData, function(item) {
  9772. return item[1];
  9773. }), null, dimValueGetter);
  9774. lineData.initData(map(optData, function(item) {
  9775. return item[2];
  9776. }));
  9777. lineData.hasItemOption = true;
  9778. return {
  9779. from: fromData,
  9780. to: toData,
  9781. line: lineData
  9782. };
  9783. }
  9784. var MarkLineView_default = MarkLineView;
  9785. // node_modules/echarts/lib/component/marker/installMarkLine.js
  9786. function install18(registers) {
  9787. registers.registerComponentModel(MarkLineModel_default);
  9788. registers.registerComponentView(MarkLineView_default);
  9789. registers.registerPreprocessor(function(opt) {
  9790. if (checkMarkerInSeries(opt.series, "markLine")) {
  9791. opt.markLine = opt.markLine || {};
  9792. }
  9793. });
  9794. }
  9795. // node_modules/echarts/lib/component/marker/installMarkArea.js
  9796. init_define_APP_INFO();
  9797. // node_modules/echarts/lib/component/marker/MarkAreaModel.js
  9798. init_define_APP_INFO();
  9799. var MarkAreaModel = function(_super) {
  9800. __extends(MarkAreaModel2, _super);
  9801. function MarkAreaModel2() {
  9802. var _this = _super !== null && _super.apply(this, arguments) || this;
  9803. _this.type = MarkAreaModel2.type;
  9804. return _this;
  9805. }
  9806. MarkAreaModel2.prototype.createMarkerModelFromSeries = function(markerOpt, masterMarkerModel, ecModel) {
  9807. return new MarkAreaModel2(markerOpt, masterMarkerModel, ecModel);
  9808. };
  9809. MarkAreaModel2.type = "markArea";
  9810. MarkAreaModel2.defaultOption = {
  9811. z: 1,
  9812. tooltip: {
  9813. trigger: "item"
  9814. },
  9815. animation: false,
  9816. label: {
  9817. show: true,
  9818. position: "top"
  9819. },
  9820. itemStyle: {
  9821. borderWidth: 0
  9822. },
  9823. emphasis: {
  9824. label: {
  9825. show: true,
  9826. position: "top"
  9827. }
  9828. }
  9829. };
  9830. return MarkAreaModel2;
  9831. }(MarkerModel_default);
  9832. var MarkAreaModel_default = MarkAreaModel;
  9833. // node_modules/echarts/lib/component/marker/MarkAreaView.js
  9834. init_define_APP_INFO();
  9835. var inner10 = makeInner();
  9836. var markAreaTransform = function(seriesModel, coordSys, maModel, item) {
  9837. var lt = dataTransform(seriesModel, item[0]);
  9838. var rb = dataTransform(seriesModel, item[1]);
  9839. var ltCoord = lt.coord;
  9840. var rbCoord = rb.coord;
  9841. ltCoord[0] = retrieve(ltCoord[0], -Infinity);
  9842. ltCoord[1] = retrieve(ltCoord[1], -Infinity);
  9843. rbCoord[0] = retrieve(rbCoord[0], Infinity);
  9844. rbCoord[1] = retrieve(rbCoord[1], Infinity);
  9845. var result = mergeAll([{}, lt, rb]);
  9846. result.coord = [lt.coord, rb.coord];
  9847. result.x0 = lt.x;
  9848. result.y0 = lt.y;
  9849. result.x1 = rb.x;
  9850. result.y1 = rb.y;
  9851. return result;
  9852. };
  9853. function isInifinity2(val) {
  9854. return !isNaN(val) && !isFinite(val);
  9855. }
  9856. function ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {
  9857. var otherDimIndex = 1 - dimIndex;
  9858. return isInifinity2(fromCoord[otherDimIndex]) && isInifinity2(toCoord[otherDimIndex]);
  9859. }
  9860. function markAreaFilter(coordSys, item) {
  9861. var fromCoord = item.coord[0];
  9862. var toCoord = item.coord[1];
  9863. var item0 = {
  9864. coord: fromCoord,
  9865. x: item.x0,
  9866. y: item.y0
  9867. };
  9868. var item1 = {
  9869. coord: toCoord,
  9870. x: item.x1,
  9871. y: item.y1
  9872. };
  9873. if (isCoordinateSystemType(coordSys, "cartesian2d")) {
  9874. if (fromCoord && toCoord && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord, coordSys))) {
  9875. return true;
  9876. }
  9877. return zoneFilter(coordSys, item0, item1);
  9878. }
  9879. return dataFilter(coordSys, item0) || dataFilter(coordSys, item1);
  9880. }
  9881. function getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) {
  9882. var coordSys = seriesModel.coordinateSystem;
  9883. var itemModel = data.getItemModel(idx);
  9884. var point;
  9885. var xPx = parsePercent2(itemModel.get(dims[0]), api.getWidth());
  9886. var yPx = parsePercent2(itemModel.get(dims[1]), api.getHeight());
  9887. if (!isNaN(xPx) && !isNaN(yPx)) {
  9888. point = [xPx, yPx];
  9889. } else {
  9890. if (seriesModel.getMarkerPosition) {
  9891. point = seriesModel.getMarkerPosition(data.getValues(dims, idx));
  9892. } else {
  9893. var x = data.get(dims[0], idx);
  9894. var y = data.get(dims[1], idx);
  9895. var pt = [x, y];
  9896. coordSys.clampData && coordSys.clampData(pt, pt);
  9897. point = coordSys.dataToPoint(pt, true);
  9898. }
  9899. if (isCoordinateSystemType(coordSys, "cartesian2d")) {
  9900. var xAxis = coordSys.getAxis("x");
  9901. var yAxis = coordSys.getAxis("y");
  9902. var x = data.get(dims[0], idx);
  9903. var y = data.get(dims[1], idx);
  9904. if (isInifinity2(x)) {
  9905. point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === "x0" ? 0 : 1]);
  9906. } else if (isInifinity2(y)) {
  9907. point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === "y0" ? 0 : 1]);
  9908. }
  9909. }
  9910. if (!isNaN(xPx)) {
  9911. point[0] = xPx;
  9912. }
  9913. if (!isNaN(yPx)) {
  9914. point[1] = yPx;
  9915. }
  9916. }
  9917. return point;
  9918. }
  9919. var dimPermutations = [["x0", "y0"], ["x1", "y0"], ["x1", "y1"], ["x0", "y1"]];
  9920. var MarkAreaView = function(_super) {
  9921. __extends(MarkAreaView2, _super);
  9922. function MarkAreaView2() {
  9923. var _this = _super !== null && _super.apply(this, arguments) || this;
  9924. _this.type = MarkAreaView2.type;
  9925. return _this;
  9926. }
  9927. MarkAreaView2.prototype.updateTransform = function(markAreaModel, ecModel, api) {
  9928. ecModel.eachSeries(function(seriesModel) {
  9929. var maModel = MarkerModel_default.getMarkerModelFromSeries(seriesModel, "markArea");
  9930. if (maModel) {
  9931. var areaData_1 = maModel.getData();
  9932. areaData_1.each(function(idx) {
  9933. var points = map(dimPermutations, function(dim) {
  9934. return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api);
  9935. });
  9936. areaData_1.setItemLayout(idx, points);
  9937. var el = areaData_1.getItemGraphicEl(idx);
  9938. el.setShape("points", points);
  9939. });
  9940. }
  9941. }, this);
  9942. };
  9943. MarkAreaView2.prototype.renderSeries = function(seriesModel, maModel, ecModel, api) {
  9944. var coordSys = seriesModel.coordinateSystem;
  9945. var seriesId = seriesModel.id;
  9946. var seriesData = seriesModel.getData();
  9947. var areaGroupMap = this.markerGroupMap;
  9948. var polygonGroup = areaGroupMap.get(seriesId) || areaGroupMap.set(seriesId, {
  9949. group: new Group_default()
  9950. });
  9951. this.group.add(polygonGroup.group);
  9952. this.markKeep(polygonGroup);
  9953. var areaData = createList2(coordSys, seriesModel, maModel);
  9954. maModel.setData(areaData);
  9955. areaData.each(function(idx) {
  9956. var points = map(dimPermutations, function(dim) {
  9957. return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);
  9958. });
  9959. var xAxisScale = coordSys.getAxis("x").scale;
  9960. var yAxisScale = coordSys.getAxis("y").scale;
  9961. var xAxisExtent = xAxisScale.getExtent();
  9962. var yAxisExtent = yAxisScale.getExtent();
  9963. var xPointExtent = [xAxisScale.parse(areaData.get("x0", idx)), xAxisScale.parse(areaData.get("x1", idx))];
  9964. var yPointExtent = [yAxisScale.parse(areaData.get("y0", idx)), yAxisScale.parse(areaData.get("y1", idx))];
  9965. asc(xPointExtent);
  9966. asc(yPointExtent);
  9967. var overlapped = !(xAxisExtent[0] > xPointExtent[1] || xAxisExtent[1] < xPointExtent[0] || yAxisExtent[0] > yPointExtent[1] || yAxisExtent[1] < yPointExtent[0]);
  9968. var allClipped = !overlapped;
  9969. areaData.setItemLayout(idx, {
  9970. points,
  9971. allClipped
  9972. });
  9973. var style = areaData.getItemModel(idx).getModel("itemStyle").getItemStyle();
  9974. var color = getVisualFromData(seriesData, "color");
  9975. if (!style.fill) {
  9976. style.fill = color;
  9977. if (isString(style.fill)) {
  9978. style.fill = modifyAlpha(style.fill, 0.4);
  9979. }
  9980. }
  9981. if (!style.stroke) {
  9982. style.stroke = color;
  9983. }
  9984. areaData.setItemVisual(idx, "style", style);
  9985. });
  9986. areaData.diff(inner10(polygonGroup).data).add(function(idx) {
  9987. var layout4 = areaData.getItemLayout(idx);
  9988. if (!layout4.allClipped) {
  9989. var polygon = new Polygon_default({
  9990. shape: {
  9991. points: layout4.points
  9992. }
  9993. });
  9994. areaData.setItemGraphicEl(idx, polygon);
  9995. polygonGroup.group.add(polygon);
  9996. }
  9997. }).update(function(newIdx, oldIdx) {
  9998. var polygon = inner10(polygonGroup).data.getItemGraphicEl(oldIdx);
  9999. var layout4 = areaData.getItemLayout(newIdx);
  10000. if (!layout4.allClipped) {
  10001. if (polygon) {
  10002. updateProps(polygon, {
  10003. shape: {
  10004. points: layout4.points
  10005. }
  10006. }, maModel, newIdx);
  10007. } else {
  10008. polygon = new Polygon_default({
  10009. shape: {
  10010. points: layout4.points
  10011. }
  10012. });
  10013. }
  10014. areaData.setItemGraphicEl(newIdx, polygon);
  10015. polygonGroup.group.add(polygon);
  10016. } else if (polygon) {
  10017. polygonGroup.group.remove(polygon);
  10018. }
  10019. }).remove(function(idx) {
  10020. var polygon = inner10(polygonGroup).data.getItemGraphicEl(idx);
  10021. polygonGroup.group.remove(polygon);
  10022. }).execute();
  10023. areaData.eachItemGraphicEl(function(polygon, idx) {
  10024. var itemModel = areaData.getItemModel(idx);
  10025. var style = areaData.getItemVisual(idx, "style");
  10026. polygon.useStyle(areaData.getItemVisual(idx, "style"));
  10027. setLabelStyle(polygon, getLabelStatesModels(itemModel), {
  10028. labelFetcher: maModel,
  10029. labelDataIndex: idx,
  10030. defaultText: areaData.getName(idx) || "",
  10031. inheritColor: isString(style.fill) ? modifyAlpha(style.fill, 1) : "#000"
  10032. });
  10033. setStatesStylesFromModel(polygon, itemModel);
  10034. toggleHoverEmphasis(polygon, null, null, itemModel.get(["emphasis", "disabled"]));
  10035. getECData(polygon).dataModel = maModel;
  10036. });
  10037. inner10(polygonGroup).data = areaData;
  10038. polygonGroup.group.silent = maModel.get("silent") || seriesModel.get("silent");
  10039. };
  10040. MarkAreaView2.type = "markArea";
  10041. return MarkAreaView2;
  10042. }(MarkerView_default);
  10043. function createList2(coordSys, seriesModel, maModel) {
  10044. var areaData;
  10045. var dataDims;
  10046. var dims = ["x0", "y0", "x1", "y1"];
  10047. if (coordSys) {
  10048. var coordDimsInfos_1 = map(coordSys && coordSys.dimensions, function(coordDim) {
  10049. var data = seriesModel.getData();
  10050. var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {};
  10051. return extend(extend({}, info), {
  10052. name: coordDim,
  10053. ordinalMeta: null
  10054. });
  10055. });
  10056. dataDims = map(dims, function(dim, idx) {
  10057. return {
  10058. name: dim,
  10059. type: coordDimsInfos_1[idx % 2].type
  10060. };
  10061. });
  10062. areaData = new SeriesData_default(dataDims, maModel);
  10063. } else {
  10064. dataDims = [{
  10065. name: "value",
  10066. type: "float"
  10067. }];
  10068. areaData = new SeriesData_default(dataDims, maModel);
  10069. }
  10070. var optData = map(maModel.get("data"), curry(markAreaTransform, seriesModel, coordSys, maModel));
  10071. if (coordSys) {
  10072. optData = filter(optData, curry(markAreaFilter, coordSys));
  10073. }
  10074. var dimValueGetter = coordSys ? function(item, dimName, dataIndex, dimIndex) {
  10075. var rawVal = item.coord[Math.floor(dimIndex / 2)][dimIndex % 2];
  10076. return parseDataValue(rawVal, dataDims[dimIndex]);
  10077. } : function(item, dimName, dataIndex, dimIndex) {
  10078. return parseDataValue(item.value, dataDims[dimIndex]);
  10079. };
  10080. areaData.initData(optData, null, dimValueGetter);
  10081. areaData.hasItemOption = true;
  10082. return areaData;
  10083. }
  10084. var MarkAreaView_default = MarkAreaView;
  10085. // node_modules/echarts/lib/component/marker/installMarkArea.js
  10086. function install19(registers) {
  10087. registers.registerComponentModel(MarkAreaModel_default);
  10088. registers.registerComponentView(MarkAreaView_default);
  10089. registers.registerPreprocessor(function(opt) {
  10090. if (checkMarkerInSeries(opt.series, "markArea")) {
  10091. opt.markArea = opt.markArea || {};
  10092. }
  10093. });
  10094. }
  10095. // node_modules/echarts/lib/component/legend/install.js
  10096. init_define_APP_INFO();
  10097. // node_modules/echarts/lib/component/legend/installLegendPlain.js
  10098. init_define_APP_INFO();
  10099. // node_modules/echarts/lib/component/legend/LegendModel.js
  10100. init_define_APP_INFO();
  10101. var getDefaultSelectorOptions = function(ecModel, type) {
  10102. if (type === "all") {
  10103. return {
  10104. type: "all",
  10105. title: ecModel.getLocaleModel().get(["legend", "selector", "all"])
  10106. };
  10107. } else if (type === "inverse") {
  10108. return {
  10109. type: "inverse",
  10110. title: ecModel.getLocaleModel().get(["legend", "selector", "inverse"])
  10111. };
  10112. }
  10113. };
  10114. var LegendModel = function(_super) {
  10115. __extends(LegendModel2, _super);
  10116. function LegendModel2() {
  10117. var _this = _super !== null && _super.apply(this, arguments) || this;
  10118. _this.type = LegendModel2.type;
  10119. _this.layoutMode = {
  10120. type: "box",
  10121. ignoreSize: true
  10122. };
  10123. return _this;
  10124. }
  10125. LegendModel2.prototype.init = function(option, parentModel, ecModel) {
  10126. this.mergeDefaultAndTheme(option, ecModel);
  10127. option.selected = option.selected || {};
  10128. this._updateSelector(option);
  10129. };
  10130. LegendModel2.prototype.mergeOption = function(option, ecModel) {
  10131. _super.prototype.mergeOption.call(this, option, ecModel);
  10132. this._updateSelector(option);
  10133. };
  10134. LegendModel2.prototype._updateSelector = function(option) {
  10135. var selector2 = option.selector;
  10136. var ecModel = this.ecModel;
  10137. if (selector2 === true) {
  10138. selector2 = option.selector = ["all", "inverse"];
  10139. }
  10140. if (isArray(selector2)) {
  10141. each(selector2, function(item, index) {
  10142. isString(item) && (item = {
  10143. type: item
  10144. });
  10145. selector2[index] = merge(item, getDefaultSelectorOptions(ecModel, item.type));
  10146. });
  10147. }
  10148. };
  10149. LegendModel2.prototype.optionUpdated = function() {
  10150. this._updateData(this.ecModel);
  10151. var legendData = this._data;
  10152. if (legendData[0] && this.get("selectedMode") === "single") {
  10153. var hasSelected = false;
  10154. for (var i = 0; i < legendData.length; i++) {
  10155. var name_1 = legendData[i].get("name");
  10156. if (this.isSelected(name_1)) {
  10157. this.select(name_1);
  10158. hasSelected = true;
  10159. break;
  10160. }
  10161. }
  10162. !hasSelected && this.select(legendData[0].get("name"));
  10163. }
  10164. };
  10165. LegendModel2.prototype._updateData = function(ecModel) {
  10166. var potentialData = [];
  10167. var availableNames = [];
  10168. ecModel.eachRawSeries(function(seriesModel) {
  10169. var seriesName = seriesModel.name;
  10170. availableNames.push(seriesName);
  10171. var isPotential;
  10172. if (seriesModel.legendVisualProvider) {
  10173. var provider = seriesModel.legendVisualProvider;
  10174. var names = provider.getAllNames();
  10175. if (!ecModel.isSeriesFiltered(seriesModel)) {
  10176. availableNames = availableNames.concat(names);
  10177. }
  10178. if (names.length) {
  10179. potentialData = potentialData.concat(names);
  10180. } else {
  10181. isPotential = true;
  10182. }
  10183. } else {
  10184. isPotential = true;
  10185. }
  10186. if (isPotential && isNameSpecified(seriesModel)) {
  10187. potentialData.push(seriesModel.name);
  10188. }
  10189. });
  10190. this._availableNames = availableNames;
  10191. var rawData = this.get("data") || potentialData;
  10192. var legendData = map(rawData, function(dataItem) {
  10193. if (isString(dataItem) || isNumber(dataItem)) {
  10194. dataItem = {
  10195. name: dataItem
  10196. };
  10197. }
  10198. return new Model_default(dataItem, this, this.ecModel);
  10199. }, this);
  10200. this._data = legendData;
  10201. };
  10202. LegendModel2.prototype.getData = function() {
  10203. return this._data;
  10204. };
  10205. LegendModel2.prototype.select = function(name) {
  10206. var selected = this.option.selected;
  10207. var selectedMode = this.get("selectedMode");
  10208. if (selectedMode === "single") {
  10209. var data = this._data;
  10210. each(data, function(dataItem) {
  10211. selected[dataItem.get("name")] = false;
  10212. });
  10213. }
  10214. selected[name] = true;
  10215. };
  10216. LegendModel2.prototype.unSelect = function(name) {
  10217. if (this.get("selectedMode") !== "single") {
  10218. this.option.selected[name] = false;
  10219. }
  10220. };
  10221. LegendModel2.prototype.toggleSelected = function(name) {
  10222. var selected = this.option.selected;
  10223. if (!selected.hasOwnProperty(name)) {
  10224. selected[name] = true;
  10225. }
  10226. this[selected[name] ? "unSelect" : "select"](name);
  10227. };
  10228. LegendModel2.prototype.allSelect = function() {
  10229. var data = this._data;
  10230. var selected = this.option.selected;
  10231. each(data, function(dataItem) {
  10232. selected[dataItem.get("name", true)] = true;
  10233. });
  10234. };
  10235. LegendModel2.prototype.inverseSelect = function() {
  10236. var data = this._data;
  10237. var selected = this.option.selected;
  10238. each(data, function(dataItem) {
  10239. var name = dataItem.get("name", true);
  10240. if (!selected.hasOwnProperty(name)) {
  10241. selected[name] = true;
  10242. }
  10243. selected[name] = !selected[name];
  10244. });
  10245. };
  10246. LegendModel2.prototype.isSelected = function(name) {
  10247. var selected = this.option.selected;
  10248. return !(selected.hasOwnProperty(name) && !selected[name]) && indexOf(this._availableNames, name) >= 0;
  10249. };
  10250. LegendModel2.prototype.getOrient = function() {
  10251. return this.get("orient") === "vertical" ? {
  10252. index: 1,
  10253. name: "vertical"
  10254. } : {
  10255. index: 0,
  10256. name: "horizontal"
  10257. };
  10258. };
  10259. LegendModel2.type = "legend.plain";
  10260. LegendModel2.dependencies = ["series"];
  10261. LegendModel2.defaultOption = {
  10262. z: 4,
  10263. show: true,
  10264. orient: "horizontal",
  10265. left: "center",
  10266. top: 0,
  10267. align: "auto",
  10268. backgroundColor: "rgba(0,0,0,0)",
  10269. borderColor: "#ccc",
  10270. borderRadius: 0,
  10271. borderWidth: 0,
  10272. padding: 5,
  10273. itemGap: 10,
  10274. itemWidth: 25,
  10275. itemHeight: 14,
  10276. symbolRotate: "inherit",
  10277. symbolKeepAspect: true,
  10278. inactiveColor: "#ccc",
  10279. inactiveBorderColor: "#ccc",
  10280. inactiveBorderWidth: "auto",
  10281. itemStyle: {
  10282. color: "inherit",
  10283. opacity: "inherit",
  10284. borderColor: "inherit",
  10285. borderWidth: "auto",
  10286. borderCap: "inherit",
  10287. borderJoin: "inherit",
  10288. borderDashOffset: "inherit",
  10289. borderMiterLimit: "inherit"
  10290. },
  10291. lineStyle: {
  10292. width: "auto",
  10293. color: "inherit",
  10294. inactiveColor: "#ccc",
  10295. inactiveWidth: 2,
  10296. opacity: "inherit",
  10297. type: "inherit",
  10298. cap: "inherit",
  10299. join: "inherit",
  10300. dashOffset: "inherit",
  10301. miterLimit: "inherit"
  10302. },
  10303. textStyle: {
  10304. color: "#333"
  10305. },
  10306. selectedMode: true,
  10307. selector: false,
  10308. selectorLabel: {
  10309. show: true,
  10310. borderRadius: 10,
  10311. padding: [3, 5, 3, 5],
  10312. fontSize: 12,
  10313. fontFamily: "sans-serif",
  10314. color: "#666",
  10315. borderWidth: 1,
  10316. borderColor: "#666"
  10317. },
  10318. emphasis: {
  10319. selectorLabel: {
  10320. show: true,
  10321. color: "#eee",
  10322. backgroundColor: "#666"
  10323. }
  10324. },
  10325. selectorPosition: "auto",
  10326. selectorItemGap: 7,
  10327. selectorButtonGap: 10,
  10328. tooltip: {
  10329. show: false
  10330. }
  10331. };
  10332. return LegendModel2;
  10333. }(Component_default);
  10334. var LegendModel_default = LegendModel;
  10335. // node_modules/echarts/lib/component/legend/LegendView.js
  10336. init_define_APP_INFO();
  10337. var curry2 = curry;
  10338. var each7 = each;
  10339. var Group = Group_default;
  10340. var LegendView = function(_super) {
  10341. __extends(LegendView2, _super);
  10342. function LegendView2() {
  10343. var _this = _super !== null && _super.apply(this, arguments) || this;
  10344. _this.type = LegendView2.type;
  10345. _this.newlineDisabled = false;
  10346. return _this;
  10347. }
  10348. LegendView2.prototype.init = function() {
  10349. this.group.add(this._contentGroup = new Group());
  10350. this.group.add(this._selectorGroup = new Group());
  10351. this._isFirstRender = true;
  10352. };
  10353. LegendView2.prototype.getContentGroup = function() {
  10354. return this._contentGroup;
  10355. };
  10356. LegendView2.prototype.getSelectorGroup = function() {
  10357. return this._selectorGroup;
  10358. };
  10359. LegendView2.prototype.render = function(legendModel, ecModel, api) {
  10360. var isFirstRender = this._isFirstRender;
  10361. this._isFirstRender = false;
  10362. this.resetInner();
  10363. if (!legendModel.get("show", true)) {
  10364. return;
  10365. }
  10366. var itemAlign = legendModel.get("align");
  10367. var orient = legendModel.get("orient");
  10368. if (!itemAlign || itemAlign === "auto") {
  10369. itemAlign = legendModel.get("left") === "right" && orient === "vertical" ? "right" : "left";
  10370. }
  10371. var selector2 = legendModel.get("selector", true);
  10372. var selectorPosition = legendModel.get("selectorPosition", true);
  10373. if (selector2 && (!selectorPosition || selectorPosition === "auto")) {
  10374. selectorPosition = orient === "horizontal" ? "end" : "start";
  10375. }
  10376. this.renderInner(itemAlign, legendModel, ecModel, api, selector2, orient, selectorPosition);
  10377. var positionInfo = legendModel.getBoxLayoutParams();
  10378. var viewportSize = {
  10379. width: api.getWidth(),
  10380. height: api.getHeight()
  10381. };
  10382. var padding = legendModel.get("padding");
  10383. var maxSize = getLayoutRect(positionInfo, viewportSize, padding);
  10384. var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector2, selectorPosition);
  10385. var layoutRect = getLayoutRect(defaults({
  10386. width: mainRect.width,
  10387. height: mainRect.height
  10388. }, positionInfo), viewportSize, padding);
  10389. this.group.x = layoutRect.x - mainRect.x;
  10390. this.group.y = layoutRect.y - mainRect.y;
  10391. this.group.markRedraw();
  10392. this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));
  10393. };
  10394. LegendView2.prototype.resetInner = function() {
  10395. this.getContentGroup().removeAll();
  10396. this._backgroundEl && this.group.remove(this._backgroundEl);
  10397. this.getSelectorGroup().removeAll();
  10398. };
  10399. LegendView2.prototype.renderInner = function(itemAlign, legendModel, ecModel, api, selector2, orient, selectorPosition) {
  10400. var contentGroup = this.getContentGroup();
  10401. var legendDrawnMap = createHashMap();
  10402. var selectMode = legendModel.get("selectedMode");
  10403. var excludeSeriesId = [];
  10404. ecModel.eachRawSeries(function(seriesModel) {
  10405. !seriesModel.get("legendHoverLink") && excludeSeriesId.push(seriesModel.id);
  10406. });
  10407. each7(legendModel.getData(), function(legendItemModel, dataIndex) {
  10408. var name = legendItemModel.get("name");
  10409. if (!this.newlineDisabled && (name === "" || name === "\n")) {
  10410. var g = new Group();
  10411. g.newline = true;
  10412. contentGroup.add(g);
  10413. return;
  10414. }
  10415. var seriesModel = ecModel.getSeriesByName(name)[0];
  10416. if (legendDrawnMap.get(name)) {
  10417. return;
  10418. }
  10419. if (seriesModel) {
  10420. var data = seriesModel.getData();
  10421. var lineVisualStyle = data.getVisual("legendLineStyle") || {};
  10422. var legendIcon = data.getVisual("legendIcon");
  10423. var style = data.getVisual("style");
  10424. var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, style, legendIcon, selectMode, api);
  10425. itemGroup.on("click", curry2(dispatchSelectAction, name, null, api, excludeSeriesId)).on("mouseover", curry2(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on("mouseout", curry2(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));
  10426. legendDrawnMap.set(name, true);
  10427. } else {
  10428. ecModel.eachRawSeries(function(seriesModel2) {
  10429. if (legendDrawnMap.get(name)) {
  10430. return;
  10431. }
  10432. if (seriesModel2.legendVisualProvider) {
  10433. var provider = seriesModel2.legendVisualProvider;
  10434. if (!provider.containName(name)) {
  10435. return;
  10436. }
  10437. var idx = provider.indexOfName(name);
  10438. var style2 = provider.getItemVisual(idx, "style");
  10439. var legendIcon2 = provider.getItemVisual(idx, "legendIcon");
  10440. var colorArr = parse(style2.fill);
  10441. if (colorArr && colorArr[3] === 0) {
  10442. colorArr[3] = 0.2;
  10443. style2 = extend(extend({}, style2), {
  10444. fill: stringify(colorArr, "rgba")
  10445. });
  10446. }
  10447. var itemGroup2 = this._createItem(seriesModel2, name, dataIndex, legendItemModel, legendModel, itemAlign, {}, style2, legendIcon2, selectMode, api);
  10448. itemGroup2.on("click", curry2(dispatchSelectAction, null, name, api, excludeSeriesId)).on("mouseover", curry2(dispatchHighlightAction, null, name, api, excludeSeriesId)).on("mouseout", curry2(dispatchDownplayAction, null, name, api, excludeSeriesId));
  10449. legendDrawnMap.set(name, true);
  10450. }
  10451. }, this);
  10452. }
  10453. if (true) {
  10454. if (!legendDrawnMap.get(name)) {
  10455. console.warn(name + " series not exists. Legend data should be same with series name or data name.");
  10456. }
  10457. }
  10458. }, this);
  10459. if (selector2) {
  10460. this._createSelector(selector2, legendModel, api, orient, selectorPosition);
  10461. }
  10462. };
  10463. LegendView2.prototype._createSelector = function(selector2, legendModel, api, orient, selectorPosition) {
  10464. var selectorGroup = this.getSelectorGroup();
  10465. each7(selector2, function createSelectorButton(selectorItem) {
  10466. var type = selectorItem.type;
  10467. var labelText = new Text_default({
  10468. style: {
  10469. x: 0,
  10470. y: 0,
  10471. align: "center",
  10472. verticalAlign: "middle"
  10473. },
  10474. onclick: function() {
  10475. api.dispatchAction({
  10476. type: type === "all" ? "legendAllSelect" : "legendInverseSelect"
  10477. });
  10478. }
  10479. });
  10480. selectorGroup.add(labelText);
  10481. var labelModel = legendModel.getModel("selectorLabel");
  10482. var emphasisLabelModel = legendModel.getModel(["emphasis", "selectorLabel"]);
  10483. setLabelStyle(labelText, {
  10484. normal: labelModel,
  10485. emphasis: emphasisLabelModel
  10486. }, {
  10487. defaultText: selectorItem.title
  10488. });
  10489. enableHoverEmphasis(labelText);
  10490. });
  10491. };
  10492. LegendView2.prototype._createItem = function(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, itemVisualStyle, legendIcon, selectMode, api) {
  10493. var drawType = seriesModel.visualDrawType;
  10494. var itemWidth = legendModel.get("itemWidth");
  10495. var itemHeight = legendModel.get("itemHeight");
  10496. var isSelected = legendModel.isSelected(name);
  10497. var iconRotate = legendItemModel.get("symbolRotate");
  10498. var symbolKeepAspect = legendItemModel.get("symbolKeepAspect");
  10499. var legendIconType = legendItemModel.get("icon");
  10500. legendIcon = legendIconType || legendIcon || "roundRect";
  10501. var style = getLegendStyle(legendIcon, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api);
  10502. var itemGroup = new Group();
  10503. var textStyleModel = legendItemModel.getModel("textStyle");
  10504. if (isFunction(seriesModel.getLegendIcon) && (!legendIconType || legendIconType === "inherit")) {
  10505. itemGroup.add(seriesModel.getLegendIcon({
  10506. itemWidth,
  10507. itemHeight,
  10508. icon: legendIcon,
  10509. iconRotate,
  10510. itemStyle: style.itemStyle,
  10511. lineStyle: style.lineStyle,
  10512. symbolKeepAspect
  10513. }));
  10514. } else {
  10515. var rotate2 = legendIconType === "inherit" && seriesModel.getData().getVisual("symbol") ? iconRotate === "inherit" ? seriesModel.getData().getVisual("symbolRotate") : iconRotate : 0;
  10516. itemGroup.add(getDefaultLegendIcon({
  10517. itemWidth,
  10518. itemHeight,
  10519. icon: legendIcon,
  10520. iconRotate: rotate2,
  10521. itemStyle: style.itemStyle,
  10522. lineStyle: style.lineStyle,
  10523. symbolKeepAspect
  10524. }));
  10525. }
  10526. var textX = itemAlign === "left" ? itemWidth + 5 : -5;
  10527. var textAlign = itemAlign;
  10528. var formatter = legendModel.get("formatter");
  10529. var content = name;
  10530. if (isString(formatter) && formatter) {
  10531. content = formatter.replace("{name}", name != null ? name : "");
  10532. } else if (isFunction(formatter)) {
  10533. content = formatter(name);
  10534. }
  10535. var inactiveColor = legendItemModel.get("inactiveColor");
  10536. itemGroup.add(new Text_default({
  10537. style: createTextStyle(textStyleModel, {
  10538. text: content,
  10539. x: textX,
  10540. y: itemHeight / 2,
  10541. fill: isSelected ? textStyleModel.getTextColor() : inactiveColor,
  10542. align: textAlign,
  10543. verticalAlign: "middle"
  10544. })
  10545. }));
  10546. var hitRect = new Rect_default({
  10547. shape: itemGroup.getBoundingRect(),
  10548. invisible: true
  10549. });
  10550. var tooltipModel = legendItemModel.getModel("tooltip");
  10551. if (tooltipModel.get("show")) {
  10552. setTooltipConfig({
  10553. el: hitRect,
  10554. componentModel: legendModel,
  10555. itemName: name,
  10556. itemTooltipOption: tooltipModel.option
  10557. });
  10558. }
  10559. itemGroup.add(hitRect);
  10560. itemGroup.eachChild(function(child) {
  10561. child.silent = true;
  10562. });
  10563. hitRect.silent = !selectMode;
  10564. this.getContentGroup().add(itemGroup);
  10565. enableHoverEmphasis(itemGroup);
  10566. itemGroup.__legendDataIndex = dataIndex;
  10567. return itemGroup;
  10568. };
  10569. LegendView2.prototype.layoutInner = function(legendModel, itemAlign, maxSize, isFirstRender, selector2, selectorPosition) {
  10570. var contentGroup = this.getContentGroup();
  10571. var selectorGroup = this.getSelectorGroup();
  10572. box(legendModel.get("orient"), contentGroup, legendModel.get("itemGap"), maxSize.width, maxSize.height);
  10573. var contentRect = contentGroup.getBoundingRect();
  10574. var contentPos = [-contentRect.x, -contentRect.y];
  10575. selectorGroup.markRedraw();
  10576. contentGroup.markRedraw();
  10577. if (selector2) {
  10578. box(
  10579. "horizontal",
  10580. selectorGroup,
  10581. legendModel.get("selectorItemGap", true)
  10582. );
  10583. var selectorRect = selectorGroup.getBoundingRect();
  10584. var selectorPos = [-selectorRect.x, -selectorRect.y];
  10585. var selectorButtonGap = legendModel.get("selectorButtonGap", true);
  10586. var orientIdx = legendModel.getOrient().index;
  10587. var wh = orientIdx === 0 ? "width" : "height";
  10588. var hw = orientIdx === 0 ? "height" : "width";
  10589. var yx = orientIdx === 0 ? "y" : "x";
  10590. if (selectorPosition === "end") {
  10591. selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;
  10592. } else {
  10593. contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;
  10594. }
  10595. selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;
  10596. selectorGroup.x = selectorPos[0];
  10597. selectorGroup.y = selectorPos[1];
  10598. contentGroup.x = contentPos[0];
  10599. contentGroup.y = contentPos[1];
  10600. var mainRect = {
  10601. x: 0,
  10602. y: 0
  10603. };
  10604. mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];
  10605. mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);
  10606. mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);
  10607. return mainRect;
  10608. } else {
  10609. contentGroup.x = contentPos[0];
  10610. contentGroup.y = contentPos[1];
  10611. return this.group.getBoundingRect();
  10612. }
  10613. };
  10614. LegendView2.prototype.remove = function() {
  10615. this.getContentGroup().removeAll();
  10616. this._isFirstRender = true;
  10617. };
  10618. LegendView2.type = "legend.plain";
  10619. return LegendView2;
  10620. }(Component_default2);
  10621. function getLegendStyle(iconType, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api) {
  10622. function handleCommonProps(style, visualStyle) {
  10623. if (style.lineWidth === "auto") {
  10624. style.lineWidth = visualStyle.lineWidth > 0 ? 2 : 0;
  10625. }
  10626. each7(style, function(propVal, propName) {
  10627. style[propName] === "inherit" && (style[propName] = visualStyle[propName]);
  10628. });
  10629. }
  10630. var itemStyleModel = legendItemModel.getModel("itemStyle");
  10631. var itemStyle = itemStyleModel.getItemStyle();
  10632. var iconBrushType = iconType.lastIndexOf("empty", 0) === 0 ? "fill" : "stroke";
  10633. var decalStyle = itemStyleModel.getShallow("decal");
  10634. itemStyle.decal = !decalStyle || decalStyle === "inherit" ? itemVisualStyle.decal : createOrUpdatePatternFromDecal(decalStyle, api);
  10635. if (itemStyle.fill === "inherit") {
  10636. itemStyle.fill = itemVisualStyle[drawType];
  10637. }
  10638. if (itemStyle.stroke === "inherit") {
  10639. itemStyle.stroke = itemVisualStyle[iconBrushType];
  10640. }
  10641. if (itemStyle.opacity === "inherit") {
  10642. itemStyle.opacity = (drawType === "fill" ? itemVisualStyle : lineVisualStyle).opacity;
  10643. }
  10644. handleCommonProps(itemStyle, itemVisualStyle);
  10645. var legendLineModel = legendItemModel.getModel("lineStyle");
  10646. var lineStyle = legendLineModel.getLineStyle();
  10647. handleCommonProps(lineStyle, lineVisualStyle);
  10648. itemStyle.fill === "auto" && (itemStyle.fill = itemVisualStyle.fill);
  10649. itemStyle.stroke === "auto" && (itemStyle.stroke = itemVisualStyle.fill);
  10650. lineStyle.stroke === "auto" && (lineStyle.stroke = itemVisualStyle.fill);
  10651. if (!isSelected) {
  10652. var borderWidth = legendItemModel.get("inactiveBorderWidth");
  10653. var visualHasBorder = itemStyle[iconBrushType];
  10654. itemStyle.lineWidth = borderWidth === "auto" ? itemVisualStyle.lineWidth > 0 && visualHasBorder ? 2 : 0 : itemStyle.lineWidth;
  10655. itemStyle.fill = legendItemModel.get("inactiveColor");
  10656. itemStyle.stroke = legendItemModel.get("inactiveBorderColor");
  10657. lineStyle.stroke = legendLineModel.get("inactiveColor");
  10658. lineStyle.lineWidth = legendLineModel.get("inactiveWidth");
  10659. }
  10660. return {
  10661. itemStyle,
  10662. lineStyle
  10663. };
  10664. }
  10665. function getDefaultLegendIcon(opt) {
  10666. var symboType = opt.icon || "roundRect";
  10667. var icon = createSymbol(symboType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill, opt.symbolKeepAspect);
  10668. icon.setStyle(opt.itemStyle);
  10669. icon.rotation = (opt.iconRotate || 0) * Math.PI / 180;
  10670. icon.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);
  10671. if (symboType.indexOf("empty") > -1) {
  10672. icon.style.stroke = icon.style.fill;
  10673. icon.style.fill = "#fff";
  10674. icon.style.lineWidth = 2;
  10675. }
  10676. return icon;
  10677. }
  10678. function dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {
  10679. dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);
  10680. api.dispatchAction({
  10681. type: "legendToggleSelect",
  10682. name: seriesName != null ? seriesName : dataName
  10683. });
  10684. dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);
  10685. }
  10686. function isUseHoverLayer(api) {
  10687. var list = api.getZr().storage.getDisplayList();
  10688. var emphasisState;
  10689. var i = 0;
  10690. var len = list.length;
  10691. while (i < len && !(emphasisState = list[i].states.emphasis)) {
  10692. i++;
  10693. }
  10694. return emphasisState && emphasisState.hoverLayer;
  10695. }
  10696. function dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {
  10697. if (!isUseHoverLayer(api)) {
  10698. api.dispatchAction({
  10699. type: "highlight",
  10700. seriesName,
  10701. name: dataName,
  10702. excludeSeriesId
  10703. });
  10704. }
  10705. }
  10706. function dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {
  10707. if (!isUseHoverLayer(api)) {
  10708. api.dispatchAction({
  10709. type: "downplay",
  10710. seriesName,
  10711. name: dataName,
  10712. excludeSeriesId
  10713. });
  10714. }
  10715. }
  10716. var LegendView_default = LegendView;
  10717. // node_modules/echarts/lib/component/legend/legendFilter.js
  10718. init_define_APP_INFO();
  10719. function legendFilter(ecModel) {
  10720. var legendModels = ecModel.findComponents({
  10721. mainType: "legend"
  10722. });
  10723. if (legendModels && legendModels.length) {
  10724. ecModel.filterSeries(function(series) {
  10725. for (var i = 0; i < legendModels.length; i++) {
  10726. if (!legendModels[i].isSelected(series.name)) {
  10727. return false;
  10728. }
  10729. }
  10730. return true;
  10731. });
  10732. }
  10733. }
  10734. // node_modules/echarts/lib/component/legend/legendAction.js
  10735. init_define_APP_INFO();
  10736. function legendSelectActionHandler(methodName, payload, ecModel) {
  10737. var selectedMap = {};
  10738. var isToggleSelect = methodName === "toggleSelected";
  10739. var isSelected;
  10740. ecModel.eachComponent("legend", function(legendModel) {
  10741. if (isToggleSelect && isSelected != null) {
  10742. legendModel[isSelected ? "select" : "unSelect"](payload.name);
  10743. } else if (methodName === "allSelect" || methodName === "inverseSelect") {
  10744. legendModel[methodName]();
  10745. } else {
  10746. legendModel[methodName](payload.name);
  10747. isSelected = legendModel.isSelected(payload.name);
  10748. }
  10749. var legendData = legendModel.getData();
  10750. each(legendData, function(model) {
  10751. var name = model.get("name");
  10752. if (name === "\n" || name === "") {
  10753. return;
  10754. }
  10755. var isItemSelected = legendModel.isSelected(name);
  10756. if (selectedMap.hasOwnProperty(name)) {
  10757. selectedMap[name] = selectedMap[name] && isItemSelected;
  10758. } else {
  10759. selectedMap[name] = isItemSelected;
  10760. }
  10761. });
  10762. });
  10763. return methodName === "allSelect" || methodName === "inverseSelect" ? {
  10764. selected: selectedMap
  10765. } : {
  10766. name: payload.name,
  10767. selected: selectedMap
  10768. };
  10769. }
  10770. function installLegendAction(registers) {
  10771. registers.registerAction("legendToggleSelect", "legendselectchanged", curry(legendSelectActionHandler, "toggleSelected"));
  10772. registers.registerAction("legendAllSelect", "legendselectall", curry(legendSelectActionHandler, "allSelect"));
  10773. registers.registerAction("legendInverseSelect", "legendinverseselect", curry(legendSelectActionHandler, "inverseSelect"));
  10774. registers.registerAction("legendSelect", "legendselected", curry(legendSelectActionHandler, "select"));
  10775. registers.registerAction("legendUnSelect", "legendunselected", curry(legendSelectActionHandler, "unSelect"));
  10776. }
  10777. // node_modules/echarts/lib/component/legend/installLegendPlain.js
  10778. function install20(registers) {
  10779. registers.registerComponentModel(LegendModel_default);
  10780. registers.registerComponentView(LegendView_default);
  10781. registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);
  10782. registers.registerSubTypeDefaulter("legend", function() {
  10783. return "plain";
  10784. });
  10785. installLegendAction(registers);
  10786. }
  10787. // node_modules/echarts/lib/component/legend/installLegendScroll.js
  10788. init_define_APP_INFO();
  10789. // node_modules/echarts/lib/component/legend/ScrollableLegendModel.js
  10790. init_define_APP_INFO();
  10791. var ScrollableLegendModel = function(_super) {
  10792. __extends(ScrollableLegendModel2, _super);
  10793. function ScrollableLegendModel2() {
  10794. var _this = _super !== null && _super.apply(this, arguments) || this;
  10795. _this.type = ScrollableLegendModel2.type;
  10796. return _this;
  10797. }
  10798. ScrollableLegendModel2.prototype.setScrollDataIndex = function(scrollDataIndex) {
  10799. this.option.scrollDataIndex = scrollDataIndex;
  10800. };
  10801. ScrollableLegendModel2.prototype.init = function(option, parentModel, ecModel) {
  10802. var inputPositionParams = getLayoutParams(option);
  10803. _super.prototype.init.call(this, option, parentModel, ecModel);
  10804. mergeAndNormalizeLayoutParams2(this, option, inputPositionParams);
  10805. };
  10806. ScrollableLegendModel2.prototype.mergeOption = function(option, ecModel) {
  10807. _super.prototype.mergeOption.call(this, option, ecModel);
  10808. mergeAndNormalizeLayoutParams2(this, this.option, option);
  10809. };
  10810. ScrollableLegendModel2.type = "legend.scroll";
  10811. ScrollableLegendModel2.defaultOption = inheritDefaultOption(LegendModel_default.defaultOption, {
  10812. scrollDataIndex: 0,
  10813. pageButtonItemGap: 5,
  10814. pageButtonGap: null,
  10815. pageButtonPosition: "end",
  10816. pageFormatter: "{current}/{total}",
  10817. pageIcons: {
  10818. horizontal: ["M0,0L12,-10L12,10z", "M0,0L-12,-10L-12,10z"],
  10819. vertical: ["M0,0L20,0L10,-20z", "M0,0L20,0L10,20z"]
  10820. },
  10821. pageIconColor: "#2f4554",
  10822. pageIconInactiveColor: "#aaa",
  10823. pageIconSize: 15,
  10824. pageTextStyle: {
  10825. color: "#333"
  10826. },
  10827. animationDurationUpdate: 800
  10828. });
  10829. return ScrollableLegendModel2;
  10830. }(LegendModel_default);
  10831. function mergeAndNormalizeLayoutParams2(legendModel, target, raw) {
  10832. var orient = legendModel.getOrient();
  10833. var ignoreSize = [1, 1];
  10834. ignoreSize[orient.index] = 0;
  10835. mergeLayoutParam(target, raw, {
  10836. type: "box",
  10837. ignoreSize: !!ignoreSize
  10838. });
  10839. }
  10840. var ScrollableLegendModel_default = ScrollableLegendModel;
  10841. // node_modules/echarts/lib/component/legend/ScrollableLegendView.js
  10842. init_define_APP_INFO();
  10843. var Group2 = Group_default;
  10844. var WH2 = ["width", "height"];
  10845. var XY2 = ["x", "y"];
  10846. var ScrollableLegendView = function(_super) {
  10847. __extends(ScrollableLegendView2, _super);
  10848. function ScrollableLegendView2() {
  10849. var _this = _super !== null && _super.apply(this, arguments) || this;
  10850. _this.type = ScrollableLegendView2.type;
  10851. _this.newlineDisabled = true;
  10852. _this._currentIndex = 0;
  10853. return _this;
  10854. }
  10855. ScrollableLegendView2.prototype.init = function() {
  10856. _super.prototype.init.call(this);
  10857. this.group.add(this._containerGroup = new Group2());
  10858. this._containerGroup.add(this.getContentGroup());
  10859. this.group.add(this._controllerGroup = new Group2());
  10860. };
  10861. ScrollableLegendView2.prototype.resetInner = function() {
  10862. _super.prototype.resetInner.call(this);
  10863. this._controllerGroup.removeAll();
  10864. this._containerGroup.removeClipPath();
  10865. this._containerGroup.__rectSize = null;
  10866. };
  10867. ScrollableLegendView2.prototype.renderInner = function(itemAlign, legendModel, ecModel, api, selector2, orient, selectorPosition) {
  10868. var self = this;
  10869. _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector2, orient, selectorPosition);
  10870. var controllerGroup = this._controllerGroup;
  10871. var pageIconSize = legendModel.get("pageIconSize", true);
  10872. var pageIconSizeArr = isArray(pageIconSize) ? pageIconSize : [pageIconSize, pageIconSize];
  10873. createPageButton("pagePrev", 0);
  10874. var pageTextStyleModel = legendModel.getModel("pageTextStyle");
  10875. controllerGroup.add(new Text_default({
  10876. name: "pageText",
  10877. style: {
  10878. text: "xx/xx",
  10879. fill: pageTextStyleModel.getTextColor(),
  10880. font: pageTextStyleModel.getFont(),
  10881. verticalAlign: "middle",
  10882. align: "center"
  10883. },
  10884. silent: true
  10885. }));
  10886. createPageButton("pageNext", 1);
  10887. function createPageButton(name, iconIdx) {
  10888. var pageDataIndexName = name + "DataIndex";
  10889. var icon = createIcon(legendModel.get("pageIcons", true)[legendModel.getOrient().name][iconIdx], {
  10890. onclick: bind(self._pageGo, self, pageDataIndexName, legendModel, api)
  10891. }, {
  10892. x: -pageIconSizeArr[0] / 2,
  10893. y: -pageIconSizeArr[1] / 2,
  10894. width: pageIconSizeArr[0],
  10895. height: pageIconSizeArr[1]
  10896. });
  10897. icon.name = name;
  10898. controllerGroup.add(icon);
  10899. }
  10900. };
  10901. ScrollableLegendView2.prototype.layoutInner = function(legendModel, itemAlign, maxSize, isFirstRender, selector2, selectorPosition) {
  10902. var selectorGroup = this.getSelectorGroup();
  10903. var orientIdx = legendModel.getOrient().index;
  10904. var wh = WH2[orientIdx];
  10905. var xy = XY2[orientIdx];
  10906. var hw = WH2[1 - orientIdx];
  10907. var yx = XY2[1 - orientIdx];
  10908. selector2 && box(
  10909. "horizontal",
  10910. selectorGroup,
  10911. legendModel.get("selectorItemGap", true)
  10912. );
  10913. var selectorButtonGap = legendModel.get("selectorButtonGap", true);
  10914. var selectorRect = selectorGroup.getBoundingRect();
  10915. var selectorPos = [-selectorRect.x, -selectorRect.y];
  10916. var processMaxSize = clone(maxSize);
  10917. selector2 && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap);
  10918. var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy);
  10919. if (selector2) {
  10920. if (selectorPosition === "end") {
  10921. selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap;
  10922. } else {
  10923. var offset = selectorRect[wh] + selectorButtonGap;
  10924. selectorPos[orientIdx] -= offset;
  10925. mainRect[xy] -= offset;
  10926. }
  10927. mainRect[wh] += selectorRect[wh] + selectorButtonGap;
  10928. selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2;
  10929. mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]);
  10930. mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]);
  10931. selectorGroup.x = selectorPos[0];
  10932. selectorGroup.y = selectorPos[1];
  10933. selectorGroup.markRedraw();
  10934. }
  10935. return mainRect;
  10936. };
  10937. ScrollableLegendView2.prototype._layoutContentAndController = function(legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) {
  10938. var contentGroup = this.getContentGroup();
  10939. var containerGroup = this._containerGroup;
  10940. var controllerGroup = this._controllerGroup;
  10941. box(legendModel.get("orient"), contentGroup, legendModel.get("itemGap"), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height);
  10942. box(
  10943. "horizontal",
  10944. controllerGroup,
  10945. legendModel.get("pageButtonItemGap", true)
  10946. );
  10947. var contentRect = contentGroup.getBoundingRect();
  10948. var controllerRect = controllerGroup.getBoundingRect();
  10949. var showController = this._showController = contentRect[wh] > maxSize[wh];
  10950. var contentPos = [-contentRect.x, -contentRect.y];
  10951. if (!isFirstRender) {
  10952. contentPos[orientIdx] = contentGroup[xy];
  10953. }
  10954. var containerPos = [0, 0];
  10955. var controllerPos = [-controllerRect.x, -controllerRect.y];
  10956. var pageButtonGap = retrieve2(legendModel.get("pageButtonGap", true), legendModel.get("itemGap", true));
  10957. if (showController) {
  10958. var pageButtonPosition = legendModel.get("pageButtonPosition", true);
  10959. if (pageButtonPosition === "end") {
  10960. controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];
  10961. } else {
  10962. containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;
  10963. }
  10964. }
  10965. controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2;
  10966. contentGroup.setPosition(contentPos);
  10967. containerGroup.setPosition(containerPos);
  10968. controllerGroup.setPosition(controllerPos);
  10969. var mainRect = {
  10970. x: 0,
  10971. y: 0
  10972. };
  10973. mainRect[wh] = showController ? maxSize[wh] : contentRect[wh];
  10974. mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]);
  10975. mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]);
  10976. containerGroup.__rectSize = maxSize[wh];
  10977. if (showController) {
  10978. var clipShape = {
  10979. x: 0,
  10980. y: 0
  10981. };
  10982. clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0);
  10983. clipShape[hw] = mainRect[hw];
  10984. containerGroup.setClipPath(new Rect_default({
  10985. shape: clipShape
  10986. }));
  10987. containerGroup.__rectSize = clipShape[wh];
  10988. } else {
  10989. controllerGroup.eachChild(function(child) {
  10990. child.attr({
  10991. invisible: true,
  10992. silent: true
  10993. });
  10994. });
  10995. }
  10996. var pageInfo = this._getPageInfo(legendModel);
  10997. pageInfo.pageIndex != null && updateProps(
  10998. contentGroup,
  10999. {
  11000. x: pageInfo.contentPosition[0],
  11001. y: pageInfo.contentPosition[1]
  11002. },
  11003. showController ? legendModel : null
  11004. );
  11005. this._updatePageInfoView(legendModel, pageInfo);
  11006. return mainRect;
  11007. };
  11008. ScrollableLegendView2.prototype._pageGo = function(to, legendModel, api) {
  11009. var scrollDataIndex = this._getPageInfo(legendModel)[to];
  11010. scrollDataIndex != null && api.dispatchAction({
  11011. type: "legendScroll",
  11012. scrollDataIndex,
  11013. legendId: legendModel.id
  11014. });
  11015. };
  11016. ScrollableLegendView2.prototype._updatePageInfoView = function(legendModel, pageInfo) {
  11017. var controllerGroup = this._controllerGroup;
  11018. each(["pagePrev", "pageNext"], function(name) {
  11019. var key = name + "DataIndex";
  11020. var canJump = pageInfo[key] != null;
  11021. var icon = controllerGroup.childOfName(name);
  11022. if (icon) {
  11023. icon.setStyle("fill", canJump ? legendModel.get("pageIconColor", true) : legendModel.get("pageIconInactiveColor", true));
  11024. icon.cursor = canJump ? "pointer" : "default";
  11025. }
  11026. });
  11027. var pageText = controllerGroup.childOfName("pageText");
  11028. var pageFormatter = legendModel.get("pageFormatter");
  11029. var pageIndex = pageInfo.pageIndex;
  11030. var current = pageIndex != null ? pageIndex + 1 : 0;
  11031. var total = pageInfo.pageCount;
  11032. pageText && pageFormatter && pageText.setStyle("text", isString(pageFormatter) ? pageFormatter.replace("{current}", current == null ? "" : current + "").replace("{total}", total == null ? "" : total + "") : pageFormatter({
  11033. current,
  11034. total
  11035. }));
  11036. };
  11037. ScrollableLegendView2.prototype._getPageInfo = function(legendModel) {
  11038. var scrollDataIndex = legendModel.get("scrollDataIndex", true);
  11039. var contentGroup = this.getContentGroup();
  11040. var containerRectSize = this._containerGroup.__rectSize;
  11041. var orientIdx = legendModel.getOrient().index;
  11042. var wh = WH2[orientIdx];
  11043. var xy = XY2[orientIdx];
  11044. var targetItemIndex = this._findTargetItemIndex(scrollDataIndex);
  11045. var children = contentGroup.children();
  11046. var targetItem = children[targetItemIndex];
  11047. var itemCount = children.length;
  11048. var pCount = !itemCount ? 0 : 1;
  11049. var result = {
  11050. contentPosition: [contentGroup.x, contentGroup.y],
  11051. pageCount: pCount,
  11052. pageIndex: pCount - 1,
  11053. pagePrevDataIndex: null,
  11054. pageNextDataIndex: null
  11055. };
  11056. if (!targetItem) {
  11057. return result;
  11058. }
  11059. var targetItemInfo = getItemInfo(targetItem);
  11060. result.contentPosition[orientIdx] = -targetItemInfo.s;
  11061. for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) {
  11062. currItemInfo = getItemInfo(children[i]);
  11063. if (!currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize || currItemInfo && !intersect(currItemInfo, winStartItemInfo.s)) {
  11064. if (winEndItemInfo.i > winStartItemInfo.i) {
  11065. winStartItemInfo = winEndItemInfo;
  11066. } else {
  11067. winStartItemInfo = currItemInfo;
  11068. }
  11069. if (winStartItemInfo) {
  11070. if (result.pageNextDataIndex == null) {
  11071. result.pageNextDataIndex = winStartItemInfo.i;
  11072. }
  11073. ++result.pageCount;
  11074. }
  11075. }
  11076. winEndItemInfo = currItemInfo;
  11077. }
  11078. for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) {
  11079. currItemInfo = getItemInfo(children[i]);
  11080. if ((!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s)) && winStartItemInfo.i < winEndItemInfo.i) {
  11081. winEndItemInfo = winStartItemInfo;
  11082. if (result.pagePrevDataIndex == null) {
  11083. result.pagePrevDataIndex = winStartItemInfo.i;
  11084. }
  11085. ++result.pageCount;
  11086. ++result.pageIndex;
  11087. }
  11088. winStartItemInfo = currItemInfo;
  11089. }
  11090. return result;
  11091. function getItemInfo(el) {
  11092. if (el) {
  11093. var itemRect = el.getBoundingRect();
  11094. var start = itemRect[xy] + el[xy];
  11095. return {
  11096. s: start,
  11097. e: start + itemRect[wh],
  11098. i: el.__legendDataIndex
  11099. };
  11100. }
  11101. }
  11102. function intersect(itemInfo, winStart) {
  11103. return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize;
  11104. }
  11105. };
  11106. ScrollableLegendView2.prototype._findTargetItemIndex = function(targetDataIndex) {
  11107. if (!this._showController) {
  11108. return 0;
  11109. }
  11110. var index;
  11111. var contentGroup = this.getContentGroup();
  11112. var defaultIndex;
  11113. contentGroup.eachChild(function(child, idx) {
  11114. var legendDataIdx = child.__legendDataIndex;
  11115. if (defaultIndex == null && legendDataIdx != null) {
  11116. defaultIndex = idx;
  11117. }
  11118. if (legendDataIdx === targetDataIndex) {
  11119. index = idx;
  11120. }
  11121. });
  11122. return index != null ? index : defaultIndex;
  11123. };
  11124. ScrollableLegendView2.type = "legend.scroll";
  11125. return ScrollableLegendView2;
  11126. }(LegendView_default);
  11127. var ScrollableLegendView_default = ScrollableLegendView;
  11128. // node_modules/echarts/lib/component/legend/scrollableLegendAction.js
  11129. init_define_APP_INFO();
  11130. function installScrollableLegendAction(registers) {
  11131. registers.registerAction("legendScroll", "legendscroll", function(payload, ecModel) {
  11132. var scrollDataIndex = payload.scrollDataIndex;
  11133. scrollDataIndex != null && ecModel.eachComponent({
  11134. mainType: "legend",
  11135. subType: "scroll",
  11136. query: payload
  11137. }, function(legendModel) {
  11138. legendModel.setScrollDataIndex(scrollDataIndex);
  11139. });
  11140. });
  11141. }
  11142. // node_modules/echarts/lib/component/legend/installLegendScroll.js
  11143. function install21(registers) {
  11144. use(install20);
  11145. registers.registerComponentModel(ScrollableLegendModel_default);
  11146. registers.registerComponentView(ScrollableLegendView_default);
  11147. installScrollableLegendAction(registers);
  11148. }
  11149. // node_modules/echarts/lib/component/legend/install.js
  11150. function install22(registers) {
  11151. use(install20);
  11152. use(install21);
  11153. }
  11154. // node_modules/echarts/lib/component/dataZoom/install.js
  11155. init_define_APP_INFO();
  11156. // node_modules/echarts/lib/component/dataZoom/installDataZoomInside.js
  11157. init_define_APP_INFO();
  11158. // node_modules/echarts/lib/component/dataZoom/InsideZoomModel.js
  11159. init_define_APP_INFO();
  11160. var InsideZoomModel = function(_super) {
  11161. __extends(InsideZoomModel2, _super);
  11162. function InsideZoomModel2() {
  11163. var _this = _super !== null && _super.apply(this, arguments) || this;
  11164. _this.type = InsideZoomModel2.type;
  11165. return _this;
  11166. }
  11167. InsideZoomModel2.type = "dataZoom.inside";
  11168. InsideZoomModel2.defaultOption = inheritDefaultOption(DataZoomModel_default.defaultOption, {
  11169. disabled: false,
  11170. zoomLock: false,
  11171. zoomOnMouseWheel: true,
  11172. moveOnMouseMove: true,
  11173. moveOnMouseWheel: false,
  11174. preventDefaultMouseMove: true
  11175. });
  11176. return InsideZoomModel2;
  11177. }(DataZoomModel_default);
  11178. var InsideZoomModel_default = InsideZoomModel;
  11179. // node_modules/echarts/lib/component/dataZoom/InsideZoomView.js
  11180. init_define_APP_INFO();
  11181. // node_modules/echarts/lib/component/dataZoom/roams.js
  11182. init_define_APP_INFO();
  11183. var inner11 = makeInner();
  11184. function setViewInfoToCoordSysRecord(api, dataZoomModel, getRange) {
  11185. inner11(api).coordSysRecordMap.each(function(coordSysRecord) {
  11186. var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);
  11187. if (dzInfo) {
  11188. dzInfo.getRange = getRange;
  11189. }
  11190. });
  11191. }
  11192. function disposeCoordSysRecordIfNeeded(api, dataZoomModel) {
  11193. var coordSysRecordMap = inner11(api).coordSysRecordMap;
  11194. var coordSysKeyArr = coordSysRecordMap.keys();
  11195. for (var i = 0; i < coordSysKeyArr.length; i++) {
  11196. var coordSysKey = coordSysKeyArr[i];
  11197. var coordSysRecord = coordSysRecordMap.get(coordSysKey);
  11198. var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;
  11199. if (dataZoomInfoMap) {
  11200. var dzUid = dataZoomModel.uid;
  11201. var dzInfo = dataZoomInfoMap.get(dzUid);
  11202. if (dzInfo) {
  11203. dataZoomInfoMap.removeKey(dzUid);
  11204. if (!dataZoomInfoMap.keys().length) {
  11205. disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);
  11206. }
  11207. }
  11208. }
  11209. }
  11210. }
  11211. function disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) {
  11212. if (coordSysRecord) {
  11213. coordSysRecordMap.removeKey(coordSysRecord.model.uid);
  11214. var controller = coordSysRecord.controller;
  11215. controller && controller.dispose();
  11216. }
  11217. }
  11218. function createCoordSysRecord(api, coordSysModel) {
  11219. var coordSysRecord = {
  11220. model: coordSysModel,
  11221. containsPoint: curry(containsPoint, coordSysModel),
  11222. dispatchAction: curry(dispatchAction2, api),
  11223. dataZoomInfoMap: null,
  11224. controller: null
  11225. };
  11226. var controller = coordSysRecord.controller = new RoamController_default(api.getZr());
  11227. each(["pan", "zoom", "scrollMove"], function(eventName) {
  11228. controller.on(eventName, function(event) {
  11229. var batch = [];
  11230. coordSysRecord.dataZoomInfoMap.each(function(dzInfo) {
  11231. if (!event.isAvailableBehavior(dzInfo.model.option)) {
  11232. return;
  11233. }
  11234. var method = (dzInfo.getRange || {})[eventName];
  11235. var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event);
  11236. !dzInfo.model.get("disabled", true) && range && batch.push({
  11237. dataZoomId: dzInfo.model.id,
  11238. start: range[0],
  11239. end: range[1]
  11240. });
  11241. });
  11242. batch.length && coordSysRecord.dispatchAction(batch);
  11243. });
  11244. });
  11245. return coordSysRecord;
  11246. }
  11247. function dispatchAction2(api, batch) {
  11248. if (!api.isDisposed()) {
  11249. api.dispatchAction({
  11250. type: "dataZoom",
  11251. animation: {
  11252. easing: "cubicOut",
  11253. duration: 100
  11254. },
  11255. batch
  11256. });
  11257. }
  11258. }
  11259. function containsPoint(coordSysModel, e, x, y) {
  11260. return coordSysModel.coordinateSystem.containPoint([x, y]);
  11261. }
  11262. function mergeControllerParams(dataZoomInfoMap) {
  11263. var controlType;
  11264. var prefix = "type_";
  11265. var typePriority = {
  11266. "type_true": 2,
  11267. "type_move": 1,
  11268. "type_false": 0,
  11269. "type_undefined": -1
  11270. };
  11271. var preventDefaultMouseMove = true;
  11272. dataZoomInfoMap.each(function(dataZoomInfo) {
  11273. var dataZoomModel = dataZoomInfo.model;
  11274. var oneType = dataZoomModel.get("disabled", true) ? false : dataZoomModel.get("zoomLock", true) ? "move" : true;
  11275. if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {
  11276. controlType = oneType;
  11277. }
  11278. preventDefaultMouseMove = preventDefaultMouseMove && dataZoomModel.get("preventDefaultMouseMove", true);
  11279. });
  11280. return {
  11281. controlType,
  11282. opt: {
  11283. zoomOnMouseWheel: true,
  11284. moveOnMouseMove: true,
  11285. moveOnMouseWheel: true,
  11286. preventDefaultMouseMove: !!preventDefaultMouseMove
  11287. }
  11288. };
  11289. }
  11290. function installDataZoomRoamProcessor(registers) {
  11291. registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, function(ecModel, api) {
  11292. var apiInner = inner11(api);
  11293. var coordSysRecordMap = apiInner.coordSysRecordMap || (apiInner.coordSysRecordMap = createHashMap());
  11294. coordSysRecordMap.each(function(coordSysRecord) {
  11295. coordSysRecord.dataZoomInfoMap = null;
  11296. });
  11297. ecModel.eachComponent({
  11298. mainType: "dataZoom",
  11299. subType: "inside"
  11300. }, function(dataZoomModel) {
  11301. var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel);
  11302. each(dzReferCoordSysWrap.infoList, function(dzCoordSysInfo) {
  11303. var coordSysUid = dzCoordSysInfo.model.uid;
  11304. var coordSysRecord = coordSysRecordMap.get(coordSysUid) || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model));
  11305. var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap || (coordSysRecord.dataZoomInfoMap = createHashMap());
  11306. dataZoomInfoMap.set(dataZoomModel.uid, {
  11307. dzReferCoordSysInfo: dzCoordSysInfo,
  11308. model: dataZoomModel,
  11309. getRange: null
  11310. });
  11311. });
  11312. });
  11313. coordSysRecordMap.each(function(coordSysRecord) {
  11314. var controller = coordSysRecord.controller;
  11315. var firstDzInfo;
  11316. var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;
  11317. if (dataZoomInfoMap) {
  11318. var firstDzKey = dataZoomInfoMap.keys()[0];
  11319. if (firstDzKey != null) {
  11320. firstDzInfo = dataZoomInfoMap.get(firstDzKey);
  11321. }
  11322. }
  11323. if (!firstDzInfo) {
  11324. disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);
  11325. return;
  11326. }
  11327. var controllerParams = mergeControllerParams(dataZoomInfoMap);
  11328. controller.enable(controllerParams.controlType, controllerParams.opt);
  11329. controller.setPointerChecker(coordSysRecord.containsPoint);
  11330. createOrUpdate(coordSysRecord, "dispatchAction", firstDzInfo.model.get("throttle", true), "fixRate");
  11331. });
  11332. });
  11333. }
  11334. // node_modules/echarts/lib/component/dataZoom/InsideZoomView.js
  11335. var InsideZoomView = function(_super) {
  11336. __extends(InsideZoomView2, _super);
  11337. function InsideZoomView2() {
  11338. var _this = _super !== null && _super.apply(this, arguments) || this;
  11339. _this.type = "dataZoom.inside";
  11340. return _this;
  11341. }
  11342. InsideZoomView2.prototype.render = function(dataZoomModel, ecModel, api) {
  11343. _super.prototype.render.apply(this, arguments);
  11344. if (dataZoomModel.noTarget()) {
  11345. this._clear();
  11346. return;
  11347. }
  11348. this.range = dataZoomModel.getPercentRange();
  11349. setViewInfoToCoordSysRecord(api, dataZoomModel, {
  11350. pan: bind(getRangeHandlers.pan, this),
  11351. zoom: bind(getRangeHandlers.zoom, this),
  11352. scrollMove: bind(getRangeHandlers.scrollMove, this)
  11353. });
  11354. };
  11355. InsideZoomView2.prototype.dispose = function() {
  11356. this._clear();
  11357. _super.prototype.dispose.apply(this, arguments);
  11358. };
  11359. InsideZoomView2.prototype._clear = function() {
  11360. disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);
  11361. this.range = null;
  11362. };
  11363. InsideZoomView2.type = "dataZoom.inside";
  11364. return InsideZoomView2;
  11365. }(DataZoomView_default);
  11366. var getRangeHandlers = {
  11367. zoom: function(coordSysInfo, coordSysMainType, controller, e) {
  11368. var lastRange = this.range;
  11369. var range = lastRange.slice();
  11370. var axisModel = coordSysInfo.axisModels[0];
  11371. if (!axisModel) {
  11372. return;
  11373. }
  11374. var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo);
  11375. var percentPoint = (directionInfo.signal > 0 ? directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel : directionInfo.pixel - directionInfo.pixelStart) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];
  11376. var scale = Math.max(1 / e.scale, 0);
  11377. range[0] = (range[0] - percentPoint) * scale + percentPoint;
  11378. range[1] = (range[1] - percentPoint) * scale + percentPoint;
  11379. var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();
  11380. sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);
  11381. this.range = range;
  11382. if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {
  11383. return range;
  11384. }
  11385. },
  11386. pan: makeMover(function(range, axisModel, coordSysInfo, coordSysMainType, controller, e) {
  11387. var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo);
  11388. return directionInfo.signal * (range[1] - range[0]) * directionInfo.pixel / directionInfo.pixelLength;
  11389. }),
  11390. scrollMove: makeMover(function(range, axisModel, coordSysInfo, coordSysMainType, controller, e) {
  11391. var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo);
  11392. return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;
  11393. })
  11394. };
  11395. function makeMover(getPercentDelta) {
  11396. return function(coordSysInfo, coordSysMainType, controller, e) {
  11397. var lastRange = this.range;
  11398. var range = lastRange.slice();
  11399. var axisModel = coordSysInfo.axisModels[0];
  11400. if (!axisModel) {
  11401. return;
  11402. }
  11403. var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e);
  11404. sliderMove(percentDelta, range, [0, 100], "all");
  11405. this.range = range;
  11406. if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {
  11407. return range;
  11408. }
  11409. };
  11410. }
  11411. var getDirectionInfo = {
  11412. grid: function(oldPoint, newPoint, axisModel, controller, coordSysInfo) {
  11413. var axis = axisModel.axis;
  11414. var ret = {};
  11415. var rect = coordSysInfo.model.coordinateSystem.getRect();
  11416. oldPoint = oldPoint || [0, 0];
  11417. if (axis.dim === "x") {
  11418. ret.pixel = newPoint[0] - oldPoint[0];
  11419. ret.pixelLength = rect.width;
  11420. ret.pixelStart = rect.x;
  11421. ret.signal = axis.inverse ? 1 : -1;
  11422. } else {
  11423. ret.pixel = newPoint[1] - oldPoint[1];
  11424. ret.pixelLength = rect.height;
  11425. ret.pixelStart = rect.y;
  11426. ret.signal = axis.inverse ? -1 : 1;
  11427. }
  11428. return ret;
  11429. },
  11430. polar: function(oldPoint, newPoint, axisModel, controller, coordSysInfo) {
  11431. var axis = axisModel.axis;
  11432. var ret = {};
  11433. var polar = coordSysInfo.model.coordinateSystem;
  11434. var radiusExtent = polar.getRadiusAxis().getExtent();
  11435. var angleExtent = polar.getAngleAxis().getExtent();
  11436. oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];
  11437. newPoint = polar.pointToCoord(newPoint);
  11438. if (axisModel.mainType === "radiusAxis") {
  11439. ret.pixel = newPoint[0] - oldPoint[0];
  11440. ret.pixelLength = radiusExtent[1] - radiusExtent[0];
  11441. ret.pixelStart = radiusExtent[0];
  11442. ret.signal = axis.inverse ? 1 : -1;
  11443. } else {
  11444. ret.pixel = newPoint[1] - oldPoint[1];
  11445. ret.pixelLength = angleExtent[1] - angleExtent[0];
  11446. ret.pixelStart = angleExtent[0];
  11447. ret.signal = axis.inverse ? -1 : 1;
  11448. }
  11449. return ret;
  11450. },
  11451. singleAxis: function(oldPoint, newPoint, axisModel, controller, coordSysInfo) {
  11452. var axis = axisModel.axis;
  11453. var rect = coordSysInfo.model.coordinateSystem.getRect();
  11454. var ret = {};
  11455. oldPoint = oldPoint || [0, 0];
  11456. if (axis.orient === "horizontal") {
  11457. ret.pixel = newPoint[0] - oldPoint[0];
  11458. ret.pixelLength = rect.width;
  11459. ret.pixelStart = rect.x;
  11460. ret.signal = axis.inverse ? 1 : -1;
  11461. } else {
  11462. ret.pixel = newPoint[1] - oldPoint[1];
  11463. ret.pixelLength = rect.height;
  11464. ret.pixelStart = rect.y;
  11465. ret.signal = axis.inverse ? -1 : 1;
  11466. }
  11467. return ret;
  11468. }
  11469. };
  11470. var InsideZoomView_default = InsideZoomView;
  11471. // node_modules/echarts/lib/component/dataZoom/installDataZoomInside.js
  11472. function install23(registers) {
  11473. installCommon(registers);
  11474. registers.registerComponentModel(InsideZoomModel_default);
  11475. registers.registerComponentView(InsideZoomView_default);
  11476. installDataZoomRoamProcessor(registers);
  11477. }
  11478. // node_modules/echarts/lib/component/dataZoom/installDataZoomSlider.js
  11479. init_define_APP_INFO();
  11480. // node_modules/echarts/lib/component/dataZoom/SliderZoomModel.js
  11481. init_define_APP_INFO();
  11482. var SliderZoomModel = function(_super) {
  11483. __extends(SliderZoomModel2, _super);
  11484. function SliderZoomModel2() {
  11485. var _this = _super !== null && _super.apply(this, arguments) || this;
  11486. _this.type = SliderZoomModel2.type;
  11487. return _this;
  11488. }
  11489. SliderZoomModel2.type = "dataZoom.slider";
  11490. SliderZoomModel2.layoutMode = "box";
  11491. SliderZoomModel2.defaultOption = inheritDefaultOption(DataZoomModel_default.defaultOption, {
  11492. show: true,
  11493. right: "ph",
  11494. top: "ph",
  11495. width: "ph",
  11496. height: "ph",
  11497. left: null,
  11498. bottom: null,
  11499. borderColor: "#d2dbee",
  11500. borderRadius: 3,
  11501. backgroundColor: "rgba(47,69,84,0)",
  11502. dataBackground: {
  11503. lineStyle: {
  11504. color: "#d2dbee",
  11505. width: 0.5
  11506. },
  11507. areaStyle: {
  11508. color: "#d2dbee",
  11509. opacity: 0.2
  11510. }
  11511. },
  11512. selectedDataBackground: {
  11513. lineStyle: {
  11514. color: "#8fb0f7",
  11515. width: 0.5
  11516. },
  11517. areaStyle: {
  11518. color: "#8fb0f7",
  11519. opacity: 0.2
  11520. }
  11521. },
  11522. fillerColor: "rgba(135,175,274,0.2)",
  11523. 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",
  11524. handleSize: "100%",
  11525. handleStyle: {
  11526. color: "#fff",
  11527. borderColor: "#ACB8D1"
  11528. },
  11529. moveHandleSize: 7,
  11530. 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",
  11531. moveHandleStyle: {
  11532. color: "#D2DBEE",
  11533. opacity: 0.7
  11534. },
  11535. showDetail: true,
  11536. showDataShadow: "auto",
  11537. realtime: true,
  11538. zoomLock: false,
  11539. textStyle: {
  11540. color: "#6E7079"
  11541. },
  11542. brushSelect: true,
  11543. brushStyle: {
  11544. color: "rgba(135,175,274,0.15)"
  11545. },
  11546. emphasis: {
  11547. handleStyle: {
  11548. borderColor: "#8FB0F7"
  11549. },
  11550. moveHandleStyle: {
  11551. color: "#8FB0F7"
  11552. }
  11553. }
  11554. });
  11555. return SliderZoomModel2;
  11556. }(DataZoomModel_default);
  11557. var SliderZoomModel_default = SliderZoomModel;
  11558. // node_modules/echarts/lib/component/dataZoom/SliderZoomView.js
  11559. init_define_APP_INFO();
  11560. var Rect = Rect_default;
  11561. var DEFAULT_LOCATION_EDGE_GAP = 7;
  11562. var DEFAULT_FRAME_BORDER_WIDTH = 1;
  11563. var DEFAULT_FILLER_SIZE = 30;
  11564. var DEFAULT_MOVE_HANDLE_SIZE = 7;
  11565. var HORIZONTAL = "horizontal";
  11566. var VERTICAL = "vertical";
  11567. var LABEL_GAP = 5;
  11568. var SHOW_DATA_SHADOW_SERIES_TYPE = ["line", "bar", "candlestick", "scatter"];
  11569. var REALTIME_ANIMATION_CONFIG = {
  11570. easing: "cubicOut",
  11571. duration: 100,
  11572. delay: 0
  11573. };
  11574. var SliderZoomView = function(_super) {
  11575. __extends(SliderZoomView2, _super);
  11576. function SliderZoomView2() {
  11577. var _this = _super !== null && _super.apply(this, arguments) || this;
  11578. _this.type = SliderZoomView2.type;
  11579. _this._displayables = {};
  11580. return _this;
  11581. }
  11582. SliderZoomView2.prototype.init = function(ecModel, api) {
  11583. this.api = api;
  11584. this._onBrush = bind(this._onBrush, this);
  11585. this._onBrushEnd = bind(this._onBrushEnd, this);
  11586. };
  11587. SliderZoomView2.prototype.render = function(dataZoomModel, ecModel, api, payload) {
  11588. _super.prototype.render.apply(this, arguments);
  11589. createOrUpdate(this, "_dispatchZoomAction", dataZoomModel.get("throttle"), "fixRate");
  11590. this._orient = dataZoomModel.getOrient();
  11591. if (dataZoomModel.get("show") === false) {
  11592. this.group.removeAll();
  11593. return;
  11594. }
  11595. if (dataZoomModel.noTarget()) {
  11596. this._clear();
  11597. this.group.removeAll();
  11598. return;
  11599. }
  11600. if (!payload || payload.type !== "dataZoom" || payload.from !== this.uid) {
  11601. this._buildView();
  11602. }
  11603. this._updateView();
  11604. };
  11605. SliderZoomView2.prototype.dispose = function() {
  11606. this._clear();
  11607. _super.prototype.dispose.apply(this, arguments);
  11608. };
  11609. SliderZoomView2.prototype._clear = function() {
  11610. clear(this, "_dispatchZoomAction");
  11611. var zr = this.api.getZr();
  11612. zr.off("mousemove", this._onBrush);
  11613. zr.off("mouseup", this._onBrushEnd);
  11614. };
  11615. SliderZoomView2.prototype._buildView = function() {
  11616. var thisGroup = this.group;
  11617. thisGroup.removeAll();
  11618. this._brushing = false;
  11619. this._displayables.brushRect = null;
  11620. this._resetLocation();
  11621. this._resetInterval();
  11622. var barGroup = this._displayables.sliderGroup = new Group_default();
  11623. this._renderBackground();
  11624. this._renderHandle();
  11625. this._renderDataShadow();
  11626. thisGroup.add(barGroup);
  11627. this._positionGroup();
  11628. };
  11629. SliderZoomView2.prototype._resetLocation = function() {
  11630. var dataZoomModel = this.dataZoomModel;
  11631. var api = this.api;
  11632. var showMoveHandle = dataZoomModel.get("brushSelect");
  11633. var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0;
  11634. var coordRect = this._findCoordRect();
  11635. var ecSize = {
  11636. width: api.getWidth(),
  11637. height: api.getHeight()
  11638. };
  11639. var positionInfo = this._orient === HORIZONTAL ? {
  11640. right: ecSize.width - coordRect.x - coordRect.width,
  11641. top: ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize,
  11642. width: coordRect.width,
  11643. height: DEFAULT_FILLER_SIZE
  11644. } : {
  11645. right: DEFAULT_LOCATION_EDGE_GAP,
  11646. top: coordRect.y,
  11647. width: DEFAULT_FILLER_SIZE,
  11648. height: coordRect.height
  11649. };
  11650. var layoutParams = getLayoutParams(dataZoomModel.option);
  11651. each(["right", "top", "width", "height"], function(name) {
  11652. if (layoutParams[name] === "ph") {
  11653. layoutParams[name] = positionInfo[name];
  11654. }
  11655. });
  11656. var layoutRect = getLayoutRect(layoutParams, ecSize);
  11657. this._location = {
  11658. x: layoutRect.x,
  11659. y: layoutRect.y
  11660. };
  11661. this._size = [layoutRect.width, layoutRect.height];
  11662. this._orient === VERTICAL && this._size.reverse();
  11663. };
  11664. SliderZoomView2.prototype._positionGroup = function() {
  11665. var thisGroup = this.group;
  11666. var location = this._location;
  11667. var orient = this._orient;
  11668. var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();
  11669. var inverse = targetAxisModel && targetAxisModel.get("inverse");
  11670. var sliderGroup = this._displayables.sliderGroup;
  11671. var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse;
  11672. sliderGroup.attr(orient === HORIZONTAL && !inverse ? {
  11673. scaleY: otherAxisInverse ? 1 : -1,
  11674. scaleX: 1
  11675. } : orient === HORIZONTAL && inverse ? {
  11676. scaleY: otherAxisInverse ? 1 : -1,
  11677. scaleX: -1
  11678. } : orient === VERTICAL && !inverse ? {
  11679. scaleY: otherAxisInverse ? -1 : 1,
  11680. scaleX: 1,
  11681. rotation: Math.PI / 2
  11682. } : {
  11683. scaleY: otherAxisInverse ? -1 : 1,
  11684. scaleX: -1,
  11685. rotation: Math.PI / 2
  11686. });
  11687. var rect = thisGroup.getBoundingRect([sliderGroup]);
  11688. thisGroup.x = location.x - rect.x;
  11689. thisGroup.y = location.y - rect.y;
  11690. thisGroup.markRedraw();
  11691. };
  11692. SliderZoomView2.prototype._getViewExtent = function() {
  11693. return [0, this._size[0]];
  11694. };
  11695. SliderZoomView2.prototype._renderBackground = function() {
  11696. var dataZoomModel = this.dataZoomModel;
  11697. var size = this._size;
  11698. var barGroup = this._displayables.sliderGroup;
  11699. var brushSelect = dataZoomModel.get("brushSelect");
  11700. barGroup.add(new Rect({
  11701. silent: true,
  11702. shape: {
  11703. x: 0,
  11704. y: 0,
  11705. width: size[0],
  11706. height: size[1]
  11707. },
  11708. style: {
  11709. fill: dataZoomModel.get("backgroundColor")
  11710. },
  11711. z2: -40
  11712. }));
  11713. var clickPanel = new Rect({
  11714. shape: {
  11715. x: 0,
  11716. y: 0,
  11717. width: size[0],
  11718. height: size[1]
  11719. },
  11720. style: {
  11721. fill: "transparent"
  11722. },
  11723. z2: 0,
  11724. onclick: bind(this._onClickPanel, this)
  11725. });
  11726. var zr = this.api.getZr();
  11727. if (brushSelect) {
  11728. clickPanel.on("mousedown", this._onBrushStart, this);
  11729. clickPanel.cursor = "crosshair";
  11730. zr.on("mousemove", this._onBrush);
  11731. zr.on("mouseup", this._onBrushEnd);
  11732. } else {
  11733. zr.off("mousemove", this._onBrush);
  11734. zr.off("mouseup", this._onBrushEnd);
  11735. }
  11736. barGroup.add(clickPanel);
  11737. };
  11738. SliderZoomView2.prototype._renderDataShadow = function() {
  11739. var info = this._dataShadowInfo = this._prepareDataShadowInfo();
  11740. this._displayables.dataShadowSegs = [];
  11741. if (!info) {
  11742. return;
  11743. }
  11744. var size = this._size;
  11745. var oldSize = this._shadowSize || [];
  11746. var seriesModel = info.series;
  11747. var data = seriesModel.getRawData();
  11748. var otherDim = seriesModel.getShadowDim ? seriesModel.getShadowDim() : info.otherDim;
  11749. if (otherDim == null) {
  11750. return;
  11751. }
  11752. var polygonPts = this._shadowPolygonPts;
  11753. var polylinePts = this._shadowPolylinePts;
  11754. if (data !== this._shadowData || otherDim !== this._shadowDim || size[0] !== oldSize[0] || size[1] !== oldSize[1]) {
  11755. var otherDataExtent_1 = data.getDataExtent(otherDim);
  11756. var otherOffset = (otherDataExtent_1[1] - otherDataExtent_1[0]) * 0.3;
  11757. otherDataExtent_1 = [otherDataExtent_1[0] - otherOffset, otherDataExtent_1[1] + otherOffset];
  11758. var otherShadowExtent_1 = [0, size[1]];
  11759. var thisShadowExtent = [0, size[0]];
  11760. var areaPoints_1 = [[size[0], 0], [0, 0]];
  11761. var linePoints_1 = [];
  11762. var step_1 = thisShadowExtent[1] / (data.count() - 1);
  11763. var thisCoord_1 = 0;
  11764. var stride_1 = Math.round(data.count() / size[0]);
  11765. var lastIsEmpty_1;
  11766. data.each([otherDim], function(value, index) {
  11767. if (stride_1 > 0 && index % stride_1) {
  11768. thisCoord_1 += step_1;
  11769. return;
  11770. }
  11771. var isEmpty = value == null || isNaN(value) || value === "";
  11772. var otherCoord = isEmpty ? 0 : linearMap(value, otherDataExtent_1, otherShadowExtent_1, true);
  11773. if (isEmpty && !lastIsEmpty_1 && index) {
  11774. areaPoints_1.push([areaPoints_1[areaPoints_1.length - 1][0], 0]);
  11775. linePoints_1.push([linePoints_1[linePoints_1.length - 1][0], 0]);
  11776. } else if (!isEmpty && lastIsEmpty_1) {
  11777. areaPoints_1.push([thisCoord_1, 0]);
  11778. linePoints_1.push([thisCoord_1, 0]);
  11779. }
  11780. areaPoints_1.push([thisCoord_1, otherCoord]);
  11781. linePoints_1.push([thisCoord_1, otherCoord]);
  11782. thisCoord_1 += step_1;
  11783. lastIsEmpty_1 = isEmpty;
  11784. });
  11785. polygonPts = this._shadowPolygonPts = areaPoints_1;
  11786. polylinePts = this._shadowPolylinePts = linePoints_1;
  11787. }
  11788. this._shadowData = data;
  11789. this._shadowDim = otherDim;
  11790. this._shadowSize = [size[0], size[1]];
  11791. var dataZoomModel = this.dataZoomModel;
  11792. function createDataShadowGroup(isSelectedArea) {
  11793. var model = dataZoomModel.getModel(isSelectedArea ? "selectedDataBackground" : "dataBackground");
  11794. var group2 = new Group_default();
  11795. var polygon = new Polygon_default({
  11796. shape: {
  11797. points: polygonPts
  11798. },
  11799. segmentIgnoreThreshold: 1,
  11800. style: model.getModel("areaStyle").getAreaStyle(),
  11801. silent: true,
  11802. z2: -20
  11803. });
  11804. var polyline = new Polyline_default({
  11805. shape: {
  11806. points: polylinePts
  11807. },
  11808. segmentIgnoreThreshold: 1,
  11809. style: model.getModel("lineStyle").getLineStyle(),
  11810. silent: true,
  11811. z2: -19
  11812. });
  11813. group2.add(polygon);
  11814. group2.add(polyline);
  11815. return group2;
  11816. }
  11817. for (var i = 0; i < 3; i++) {
  11818. var group = createDataShadowGroup(i === 1);
  11819. this._displayables.sliderGroup.add(group);
  11820. this._displayables.dataShadowSegs.push(group);
  11821. }
  11822. };
  11823. SliderZoomView2.prototype._prepareDataShadowInfo = function() {
  11824. var dataZoomModel = this.dataZoomModel;
  11825. var showDataShadow = dataZoomModel.get("showDataShadow");
  11826. if (showDataShadow === false) {
  11827. return;
  11828. }
  11829. var result;
  11830. var ecModel = this.ecModel;
  11831. dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
  11832. var seriesModels = dataZoomModel.getAxisProxy(axisDim, axisIndex).getTargetSeriesModels();
  11833. each(seriesModels, function(seriesModel) {
  11834. if (result) {
  11835. return;
  11836. }
  11837. if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get("type")) < 0) {
  11838. return;
  11839. }
  11840. var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis;
  11841. var otherDim = getOtherDim(axisDim);
  11842. var otherAxisInverse;
  11843. var coordSys = seriesModel.coordinateSystem;
  11844. if (otherDim != null && coordSys.getOtherAxis) {
  11845. otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse;
  11846. }
  11847. otherDim = seriesModel.getData().mapDimension(otherDim);
  11848. result = {
  11849. thisAxis,
  11850. series: seriesModel,
  11851. thisDim: axisDim,
  11852. otherDim,
  11853. otherAxisInverse
  11854. };
  11855. }, this);
  11856. }, this);
  11857. return result;
  11858. };
  11859. SliderZoomView2.prototype._renderHandle = function() {
  11860. var thisGroup = this.group;
  11861. var displayables = this._displayables;
  11862. var handles = displayables.handles = [null, null];
  11863. var handleLabels = displayables.handleLabels = [null, null];
  11864. var sliderGroup = this._displayables.sliderGroup;
  11865. var size = this._size;
  11866. var dataZoomModel = this.dataZoomModel;
  11867. var api = this.api;
  11868. var borderRadius = dataZoomModel.get("borderRadius") || 0;
  11869. var brushSelect = dataZoomModel.get("brushSelect");
  11870. var filler = displayables.filler = new Rect({
  11871. silent: brushSelect,
  11872. style: {
  11873. fill: dataZoomModel.get("fillerColor")
  11874. },
  11875. textConfig: {
  11876. position: "inside"
  11877. }
  11878. });
  11879. sliderGroup.add(filler);
  11880. sliderGroup.add(new Rect({
  11881. silent: true,
  11882. subPixelOptimize: true,
  11883. shape: {
  11884. x: 0,
  11885. y: 0,
  11886. width: size[0],
  11887. height: size[1],
  11888. r: borderRadius
  11889. },
  11890. style: {
  11891. stroke: dataZoomModel.get("dataBackgroundColor") || dataZoomModel.get("borderColor"),
  11892. lineWidth: DEFAULT_FRAME_BORDER_WIDTH,
  11893. fill: "rgba(0,0,0,0)"
  11894. }
  11895. }));
  11896. each([0, 1], function(handleIndex) {
  11897. var iconStr = dataZoomModel.get("handleIcon");
  11898. if (!symbolBuildProxies[iconStr] && iconStr.indexOf("path://") < 0 && iconStr.indexOf("image://") < 0) {
  11899. iconStr = "path://" + iconStr;
  11900. if (true) {
  11901. deprecateLog("handleIcon now needs 'path://' prefix when using a path string");
  11902. }
  11903. }
  11904. var path = createSymbol(iconStr, -1, 0, 2, 2, null, true);
  11905. path.attr({
  11906. cursor: getCursor(this._orient),
  11907. draggable: true,
  11908. drift: bind(this._onDragMove, this, handleIndex),
  11909. ondragend: bind(this._onDragEnd, this),
  11910. onmouseover: bind(this._showDataInfo, this, true),
  11911. onmouseout: bind(this._showDataInfo, this, false),
  11912. z2: 5
  11913. });
  11914. var bRect = path.getBoundingRect();
  11915. var handleSize = dataZoomModel.get("handleSize");
  11916. this._handleHeight = parsePercent2(handleSize, this._size[1]);
  11917. this._handleWidth = bRect.width / bRect.height * this._handleHeight;
  11918. path.setStyle(dataZoomModel.getModel("handleStyle").getItemStyle());
  11919. path.style.strokeNoScale = true;
  11920. path.rectHover = true;
  11921. path.ensureState("emphasis").style = dataZoomModel.getModel(["emphasis", "handleStyle"]).getItemStyle();
  11922. enableHoverEmphasis(path);
  11923. var handleColor = dataZoomModel.get("handleColor");
  11924. if (handleColor != null) {
  11925. path.style.fill = handleColor;
  11926. }
  11927. sliderGroup.add(handles[handleIndex] = path);
  11928. var textStyleModel = dataZoomModel.getModel("textStyle");
  11929. thisGroup.add(handleLabels[handleIndex] = new Text_default({
  11930. silent: true,
  11931. invisible: true,
  11932. style: createTextStyle(textStyleModel, {
  11933. x: 0,
  11934. y: 0,
  11935. text: "",
  11936. verticalAlign: "middle",
  11937. align: "center",
  11938. fill: textStyleModel.getTextColor(),
  11939. font: textStyleModel.getFont()
  11940. }),
  11941. z2: 10
  11942. }));
  11943. }, this);
  11944. var actualMoveZone = filler;
  11945. if (brushSelect) {
  11946. var moveHandleHeight = parsePercent2(dataZoomModel.get("moveHandleSize"), size[1]);
  11947. var moveHandle_1 = displayables.moveHandle = new Rect_default({
  11948. style: dataZoomModel.getModel("moveHandleStyle").getItemStyle(),
  11949. silent: true,
  11950. shape: {
  11951. r: [0, 0, 2, 2],
  11952. y: size[1] - 0.5,
  11953. height: moveHandleHeight
  11954. }
  11955. });
  11956. var iconSize = moveHandleHeight * 0.8;
  11957. var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get("moveHandleIcon"), -iconSize / 2, -iconSize / 2, iconSize, iconSize, "#fff", true);
  11958. moveHandleIcon.silent = true;
  11959. moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5;
  11960. moveHandle_1.ensureState("emphasis").style = dataZoomModel.getModel(["emphasis", "moveHandleStyle"]).getItemStyle();
  11961. var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10));
  11962. actualMoveZone = displayables.moveZone = new Rect_default({
  11963. invisible: true,
  11964. shape: {
  11965. y: size[1] - moveZoneExpandSize,
  11966. height: moveHandleHeight + moveZoneExpandSize
  11967. }
  11968. });
  11969. actualMoveZone.on("mouseover", function() {
  11970. api.enterEmphasis(moveHandle_1);
  11971. }).on("mouseout", function() {
  11972. api.leaveEmphasis(moveHandle_1);
  11973. });
  11974. sliderGroup.add(moveHandle_1);
  11975. sliderGroup.add(moveHandleIcon);
  11976. sliderGroup.add(actualMoveZone);
  11977. }
  11978. actualMoveZone.attr({
  11979. draggable: true,
  11980. cursor: getCursor(this._orient),
  11981. drift: bind(this._onDragMove, this, "all"),
  11982. ondragstart: bind(this._showDataInfo, this, true),
  11983. ondragend: bind(this._onDragEnd, this),
  11984. onmouseover: bind(this._showDataInfo, this, true),
  11985. onmouseout: bind(this._showDataInfo, this, false)
  11986. });
  11987. };
  11988. SliderZoomView2.prototype._resetInterval = function() {
  11989. var range = this._range = this.dataZoomModel.getPercentRange();
  11990. var viewExtent = this._getViewExtent();
  11991. this._handleEnds = [linearMap(range[0], [0, 100], viewExtent, true), linearMap(range[1], [0, 100], viewExtent, true)];
  11992. };
  11993. SliderZoomView2.prototype._updateInterval = function(handleIndex, delta) {
  11994. var dataZoomModel = this.dataZoomModel;
  11995. var handleEnds = this._handleEnds;
  11996. var viewExtend = this._getViewExtent();
  11997. var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();
  11998. var percentExtent = [0, 100];
  11999. sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get("zoomLock") ? "all" : handleIndex, minMaxSpan.minSpan != null ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null);
  12000. var lastRange = this._range;
  12001. var range = this._range = asc([linearMap(handleEnds[0], viewExtend, percentExtent, true), linearMap(handleEnds[1], viewExtend, percentExtent, true)]);
  12002. return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1];
  12003. };
  12004. SliderZoomView2.prototype._updateView = function(nonRealtime) {
  12005. var displaybles = this._displayables;
  12006. var handleEnds = this._handleEnds;
  12007. var handleInterval = asc(handleEnds.slice());
  12008. var size = this._size;
  12009. each([0, 1], function(handleIndex) {
  12010. var handle = displaybles.handles[handleIndex];
  12011. var handleHeight = this._handleHeight;
  12012. handle.attr({
  12013. scaleX: handleHeight / 2,
  12014. scaleY: handleHeight / 2,
  12015. x: handleEnds[handleIndex] + (handleIndex ? -1 : 1),
  12016. y: size[1] / 2 - handleHeight / 2
  12017. });
  12018. }, this);
  12019. displaybles.filler.setShape({
  12020. x: handleInterval[0],
  12021. y: 0,
  12022. width: handleInterval[1] - handleInterval[0],
  12023. height: size[1]
  12024. });
  12025. var viewExtent = {
  12026. x: handleInterval[0],
  12027. width: handleInterval[1] - handleInterval[0]
  12028. };
  12029. if (displaybles.moveHandle) {
  12030. displaybles.moveHandle.setShape(viewExtent);
  12031. displaybles.moveZone.setShape(viewExtent);
  12032. displaybles.moveZone.getBoundingRect();
  12033. displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr("x", viewExtent.x + viewExtent.width / 2);
  12034. }
  12035. var dataShadowSegs = displaybles.dataShadowSegs;
  12036. var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]];
  12037. for (var i = 0; i < dataShadowSegs.length; i++) {
  12038. var segGroup = dataShadowSegs[i];
  12039. var clipPath = segGroup.getClipPath();
  12040. if (!clipPath) {
  12041. clipPath = new Rect_default();
  12042. segGroup.setClipPath(clipPath);
  12043. }
  12044. clipPath.setShape({
  12045. x: segIntervals[i],
  12046. y: 0,
  12047. width: segIntervals[i + 1] - segIntervals[i],
  12048. height: size[1]
  12049. });
  12050. }
  12051. this._updateDataInfo(nonRealtime);
  12052. };
  12053. SliderZoomView2.prototype._updateDataInfo = function(nonRealtime) {
  12054. var dataZoomModel = this.dataZoomModel;
  12055. var displaybles = this._displayables;
  12056. var handleLabels = displaybles.handleLabels;
  12057. var orient = this._orient;
  12058. var labelTexts = ["", ""];
  12059. if (dataZoomModel.get("showDetail")) {
  12060. var axisProxy = dataZoomModel.findRepresentativeAxisProxy();
  12061. if (axisProxy) {
  12062. var axis = axisProxy.getAxisModel().axis;
  12063. var range = this._range;
  12064. var dataInterval = nonRealtime ? axisProxy.calculateDataWindow({
  12065. start: range[0],
  12066. end: range[1]
  12067. }).valueWindow : axisProxy.getDataValueWindow();
  12068. labelTexts = [this._formatLabel(dataInterval[0], axis), this._formatLabel(dataInterval[1], axis)];
  12069. }
  12070. }
  12071. var orderedHandleEnds = asc(this._handleEnds.slice());
  12072. setLabel.call(this, 0);
  12073. setLabel.call(this, 1);
  12074. function setLabel(handleIndex) {
  12075. var barTransform = getTransform(displaybles.handles[handleIndex].parent, this.group);
  12076. var direction = transformDirection(handleIndex === 0 ? "right" : "left", barTransform);
  12077. var offset = this._handleWidth / 2 + LABEL_GAP;
  12078. var textPoint = applyTransform([orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset), this._size[1] / 2], barTransform);
  12079. handleLabels[handleIndex].setStyle({
  12080. x: textPoint[0],
  12081. y: textPoint[1],
  12082. verticalAlign: orient === HORIZONTAL ? "middle" : direction,
  12083. align: orient === HORIZONTAL ? direction : "center",
  12084. text: labelTexts[handleIndex]
  12085. });
  12086. }
  12087. };
  12088. SliderZoomView2.prototype._formatLabel = function(value, axis) {
  12089. var dataZoomModel = this.dataZoomModel;
  12090. var labelFormatter = dataZoomModel.get("labelFormatter");
  12091. var labelPrecision = dataZoomModel.get("labelPrecision");
  12092. if (labelPrecision == null || labelPrecision === "auto") {
  12093. labelPrecision = axis.getPixelPrecision();
  12094. }
  12095. var valueStr = value == null || isNaN(value) ? "" : axis.type === "category" || axis.type === "time" ? axis.scale.getLabel({
  12096. value: Math.round(value)
  12097. }) : value.toFixed(Math.min(labelPrecision, 20));
  12098. return isFunction(labelFormatter) ? labelFormatter(value, valueStr) : isString(labelFormatter) ? labelFormatter.replace("{value}", valueStr) : valueStr;
  12099. };
  12100. SliderZoomView2.prototype._showDataInfo = function(showOrHide) {
  12101. showOrHide = this._dragging || showOrHide;
  12102. var displayables = this._displayables;
  12103. var handleLabels = displayables.handleLabels;
  12104. handleLabels[0].attr("invisible", !showOrHide);
  12105. handleLabels[1].attr("invisible", !showOrHide);
  12106. displayables.moveHandle && this.api[showOrHide ? "enterEmphasis" : "leaveEmphasis"](displayables.moveHandle, 1);
  12107. };
  12108. SliderZoomView2.prototype._onDragMove = function(handleIndex, dx, dy, event) {
  12109. this._dragging = true;
  12110. stop(event.event);
  12111. var barTransform = this._displayables.sliderGroup.getLocalTransform();
  12112. var vertex = applyTransform([dx, dy], barTransform, true);
  12113. var changed = this._updateInterval(handleIndex, vertex[0]);
  12114. var realtime = this.dataZoomModel.get("realtime");
  12115. this._updateView(!realtime);
  12116. changed && realtime && this._dispatchZoomAction(true);
  12117. };
  12118. SliderZoomView2.prototype._onDragEnd = function() {
  12119. this._dragging = false;
  12120. this._showDataInfo(false);
  12121. var realtime = this.dataZoomModel.get("realtime");
  12122. !realtime && this._dispatchZoomAction(false);
  12123. };
  12124. SliderZoomView2.prototype._onClickPanel = function(e) {
  12125. var size = this._size;
  12126. var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY);
  12127. if (localPoint[0] < 0 || localPoint[0] > size[0] || localPoint[1] < 0 || localPoint[1] > size[1]) {
  12128. return;
  12129. }
  12130. var handleEnds = this._handleEnds;
  12131. var center = (handleEnds[0] + handleEnds[1]) / 2;
  12132. var changed = this._updateInterval("all", localPoint[0] - center);
  12133. this._updateView();
  12134. changed && this._dispatchZoomAction(false);
  12135. };
  12136. SliderZoomView2.prototype._onBrushStart = function(e) {
  12137. var x = e.offsetX;
  12138. var y = e.offsetY;
  12139. this._brushStart = new Point_default(x, y);
  12140. this._brushing = true;
  12141. this._brushStartTime = +new Date();
  12142. };
  12143. SliderZoomView2.prototype._onBrushEnd = function(e) {
  12144. if (!this._brushing) {
  12145. return;
  12146. }
  12147. var brushRect = this._displayables.brushRect;
  12148. this._brushing = false;
  12149. if (!brushRect) {
  12150. return;
  12151. }
  12152. brushRect.attr("ignore", true);
  12153. var brushShape = brushRect.shape;
  12154. var brushEndTime = +new Date();
  12155. if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) {
  12156. return;
  12157. }
  12158. var viewExtend = this._getViewExtent();
  12159. var percentExtent = [0, 100];
  12160. this._range = asc([linearMap(brushShape.x, viewExtend, percentExtent, true), linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)]);
  12161. this._handleEnds = [brushShape.x, brushShape.x + brushShape.width];
  12162. this._updateView();
  12163. this._dispatchZoomAction(false);
  12164. };
  12165. SliderZoomView2.prototype._onBrush = function(e) {
  12166. if (this._brushing) {
  12167. stop(e.event);
  12168. this._updateBrushRect(e.offsetX, e.offsetY);
  12169. }
  12170. };
  12171. SliderZoomView2.prototype._updateBrushRect = function(mouseX, mouseY) {
  12172. var displayables = this._displayables;
  12173. var dataZoomModel = this.dataZoomModel;
  12174. var brushRect = displayables.brushRect;
  12175. if (!brushRect) {
  12176. brushRect = displayables.brushRect = new Rect({
  12177. silent: true,
  12178. style: dataZoomModel.getModel("brushStyle").getItemStyle()
  12179. });
  12180. displayables.sliderGroup.add(brushRect);
  12181. }
  12182. brushRect.attr("ignore", false);
  12183. var brushStart = this._brushStart;
  12184. var sliderGroup = this._displayables.sliderGroup;
  12185. var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY);
  12186. var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y);
  12187. var size = this._size;
  12188. endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0);
  12189. brushRect.setShape({
  12190. x: startPoint[0],
  12191. y: 0,
  12192. width: endPoint[0] - startPoint[0],
  12193. height: size[1]
  12194. });
  12195. };
  12196. SliderZoomView2.prototype._dispatchZoomAction = function(realtime) {
  12197. var range = this._range;
  12198. this.api.dispatchAction({
  12199. type: "dataZoom",
  12200. from: this.uid,
  12201. dataZoomId: this.dataZoomModel.id,
  12202. animation: realtime ? REALTIME_ANIMATION_CONFIG : null,
  12203. start: range[0],
  12204. end: range[1]
  12205. });
  12206. };
  12207. SliderZoomView2.prototype._findCoordRect = function() {
  12208. var rect;
  12209. var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList;
  12210. if (!rect && coordSysInfoList.length) {
  12211. var coordSys = coordSysInfoList[0].model.coordinateSystem;
  12212. rect = coordSys.getRect && coordSys.getRect();
  12213. }
  12214. if (!rect) {
  12215. var width = this.api.getWidth();
  12216. var height = this.api.getHeight();
  12217. rect = {
  12218. x: width * 0.2,
  12219. y: height * 0.2,
  12220. width: width * 0.6,
  12221. height: height * 0.6
  12222. };
  12223. }
  12224. return rect;
  12225. };
  12226. SliderZoomView2.type = "dataZoom.slider";
  12227. return SliderZoomView2;
  12228. }(DataZoomView_default);
  12229. function getOtherDim(thisDim) {
  12230. var map2 = {
  12231. x: "y",
  12232. y: "x",
  12233. radius: "angle",
  12234. angle: "radius"
  12235. };
  12236. return map2[thisDim];
  12237. }
  12238. function getCursor(orient) {
  12239. return orient === "vertical" ? "ns-resize" : "ew-resize";
  12240. }
  12241. var SliderZoomView_default = SliderZoomView;
  12242. // node_modules/echarts/lib/component/dataZoom/installDataZoomSlider.js
  12243. function install24(registers) {
  12244. registers.registerComponentModel(SliderZoomModel_default);
  12245. registers.registerComponentView(SliderZoomView_default);
  12246. installCommon(registers);
  12247. }
  12248. // node_modules/echarts/lib/component/dataZoom/install.js
  12249. function install25(registers) {
  12250. use(install23);
  12251. use(install24);
  12252. }
  12253. // node_modules/echarts/lib/component/visualMap/install.js
  12254. init_define_APP_INFO();
  12255. // node_modules/echarts/lib/component/visualMap/installVisualMapContinuous.js
  12256. init_define_APP_INFO();
  12257. // node_modules/echarts/lib/component/visualMap/ContinuousModel.js
  12258. init_define_APP_INFO();
  12259. // node_modules/echarts/lib/component/visualMap/VisualMapModel.js
  12260. init_define_APP_INFO();
  12261. // node_modules/echarts/lib/visual/visualDefault.js
  12262. init_define_APP_INFO();
  12263. var visualDefault = {
  12264. get: function(visualType, key, isCategory) {
  12265. var value = clone((defaultOption[visualType] || {})[key]);
  12266. return isCategory ? isArray(value) ? value[value.length - 1] : value : value;
  12267. }
  12268. };
  12269. var defaultOption = {
  12270. color: {
  12271. active: ["#006edd", "#e0ffff"],
  12272. inactive: ["rgba(0,0,0,0)"]
  12273. },
  12274. colorHue: {
  12275. active: [0, 360],
  12276. inactive: [0, 0]
  12277. },
  12278. colorSaturation: {
  12279. active: [0.3, 1],
  12280. inactive: [0, 0]
  12281. },
  12282. colorLightness: {
  12283. active: [0.9, 0.5],
  12284. inactive: [0, 0]
  12285. },
  12286. colorAlpha: {
  12287. active: [0.3, 1],
  12288. inactive: [0, 0]
  12289. },
  12290. opacity: {
  12291. active: [0.3, 1],
  12292. inactive: [0, 0]
  12293. },
  12294. symbol: {
  12295. active: ["circle", "roundRect", "diamond"],
  12296. inactive: ["none"]
  12297. },
  12298. symbolSize: {
  12299. active: [10, 50],
  12300. inactive: [0, 0]
  12301. }
  12302. };
  12303. var visualDefault_default = visualDefault;
  12304. // node_modules/echarts/lib/component/visualMap/VisualMapModel.js
  12305. var mapVisual = VisualMapping_default.mapVisual;
  12306. var eachVisual = VisualMapping_default.eachVisual;
  12307. var isArray2 = isArray;
  12308. var each8 = each;
  12309. var asc3 = asc;
  12310. var linearMap2 = linearMap;
  12311. var VisualMapModel = function(_super) {
  12312. __extends(VisualMapModel2, _super);
  12313. function VisualMapModel2() {
  12314. var _this = _super !== null && _super.apply(this, arguments) || this;
  12315. _this.type = VisualMapModel2.type;
  12316. _this.stateList = ["inRange", "outOfRange"];
  12317. _this.replacableOptionKeys = ["inRange", "outOfRange", "target", "controller", "color"];
  12318. _this.layoutMode = {
  12319. type: "box",
  12320. ignoreSize: true
  12321. };
  12322. _this.dataBound = [-Infinity, Infinity];
  12323. _this.targetVisuals = {};
  12324. _this.controllerVisuals = {};
  12325. return _this;
  12326. }
  12327. VisualMapModel2.prototype.init = function(option, parentModel, ecModel) {
  12328. this.mergeDefaultAndTheme(option, ecModel);
  12329. };
  12330. VisualMapModel2.prototype.optionUpdated = function(newOption, isInit) {
  12331. var thisOption = this.option;
  12332. !isInit && replaceVisualOption(thisOption, newOption, this.replacableOptionKeys);
  12333. this.textStyleModel = this.getModel("textStyle");
  12334. this.resetItemSize();
  12335. this.completeVisualOption();
  12336. };
  12337. VisualMapModel2.prototype.resetVisual = function(supplementVisualOption) {
  12338. var stateList = this.stateList;
  12339. supplementVisualOption = bind(supplementVisualOption, this);
  12340. this.controllerVisuals = createVisualMappings(this.option.controller, stateList, supplementVisualOption);
  12341. this.targetVisuals = createVisualMappings(this.option.target, stateList, supplementVisualOption);
  12342. };
  12343. VisualMapModel2.prototype.getItemSymbol = function() {
  12344. return null;
  12345. };
  12346. VisualMapModel2.prototype.getTargetSeriesIndices = function() {
  12347. var optionSeriesIndex = this.option.seriesIndex;
  12348. var seriesIndices = [];
  12349. if (optionSeriesIndex == null || optionSeriesIndex === "all") {
  12350. this.ecModel.eachSeries(function(seriesModel, index) {
  12351. seriesIndices.push(index);
  12352. });
  12353. } else {
  12354. seriesIndices = normalizeToArray(optionSeriesIndex);
  12355. }
  12356. return seriesIndices;
  12357. };
  12358. VisualMapModel2.prototype.eachTargetSeries = function(callback, context) {
  12359. each(this.getTargetSeriesIndices(), function(seriesIndex) {
  12360. var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex);
  12361. if (seriesModel) {
  12362. callback.call(context, seriesModel);
  12363. }
  12364. }, this);
  12365. };
  12366. VisualMapModel2.prototype.isTargetSeries = function(seriesModel) {
  12367. var is = false;
  12368. this.eachTargetSeries(function(model) {
  12369. model === seriesModel && (is = true);
  12370. });
  12371. return is;
  12372. };
  12373. VisualMapModel2.prototype.formatValueText = function(value, isCategory, edgeSymbols) {
  12374. var option = this.option;
  12375. var precision = option.precision;
  12376. var dataBound = this.dataBound;
  12377. var formatter = option.formatter;
  12378. var isMinMax;
  12379. edgeSymbols = edgeSymbols || ["<", ">"];
  12380. if (isArray(value)) {
  12381. value = value.slice();
  12382. isMinMax = true;
  12383. }
  12384. var textValue = isCategory ? value : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value);
  12385. if (isString(formatter)) {
  12386. return formatter.replace("{value}", isMinMax ? textValue[0] : textValue).replace("{value2}", isMinMax ? textValue[1] : textValue);
  12387. } else if (isFunction(formatter)) {
  12388. return isMinMax ? formatter(value[0], value[1]) : formatter(value);
  12389. }
  12390. if (isMinMax) {
  12391. if (value[0] === dataBound[0]) {
  12392. return edgeSymbols[0] + " " + textValue[1];
  12393. } else if (value[1] === dataBound[1]) {
  12394. return edgeSymbols[1] + " " + textValue[0];
  12395. } else {
  12396. return textValue[0] + " - " + textValue[1];
  12397. }
  12398. } else {
  12399. return textValue;
  12400. }
  12401. function toFixed(val) {
  12402. return val === dataBound[0] ? "min" : val === dataBound[1] ? "max" : (+val).toFixed(Math.min(precision, 20));
  12403. }
  12404. };
  12405. VisualMapModel2.prototype.resetExtent = function() {
  12406. var thisOption = this.option;
  12407. var extent = asc3([thisOption.min, thisOption.max]);
  12408. this._dataExtent = extent;
  12409. };
  12410. VisualMapModel2.prototype.getDataDimensionIndex = function(data) {
  12411. var optDim = this.option.dimension;
  12412. if (optDim != null) {
  12413. return data.getDimensionIndex(optDim);
  12414. }
  12415. var dimNames = data.dimensions;
  12416. for (var i = dimNames.length - 1; i >= 0; i--) {
  12417. var dimName = dimNames[i];
  12418. var dimInfo = data.getDimensionInfo(dimName);
  12419. if (!dimInfo.isCalculationCoord) {
  12420. return dimInfo.storeDimIndex;
  12421. }
  12422. }
  12423. };
  12424. VisualMapModel2.prototype.getExtent = function() {
  12425. return this._dataExtent.slice();
  12426. };
  12427. VisualMapModel2.prototype.completeVisualOption = function() {
  12428. var ecModel = this.ecModel;
  12429. var thisOption = this.option;
  12430. var base = {
  12431. inRange: thisOption.inRange,
  12432. outOfRange: thisOption.outOfRange
  12433. };
  12434. var target = thisOption.target || (thisOption.target = {});
  12435. var controller = thisOption.controller || (thisOption.controller = {});
  12436. merge(target, base);
  12437. merge(controller, base);
  12438. var isCategory = this.isCategory();
  12439. completeSingle.call(this, target);
  12440. completeSingle.call(this, controller);
  12441. completeInactive.call(this, target, "inRange", "outOfRange");
  12442. completeController.call(this, controller);
  12443. function completeSingle(base2) {
  12444. if (isArray2(thisOption.color) && !base2.inRange) {
  12445. base2.inRange = {
  12446. color: thisOption.color.slice().reverse()
  12447. };
  12448. }
  12449. base2.inRange = base2.inRange || {
  12450. color: ecModel.get("gradientColor")
  12451. };
  12452. }
  12453. function completeInactive(base2, stateExist, stateAbsent) {
  12454. var optExist = base2[stateExist];
  12455. var optAbsent = base2[stateAbsent];
  12456. if (optExist && !optAbsent) {
  12457. optAbsent = base2[stateAbsent] = {};
  12458. each8(optExist, function(visualData, visualType) {
  12459. if (!VisualMapping_default.isValidType(visualType)) {
  12460. return;
  12461. }
  12462. var defa = visualDefault_default.get(visualType, "inactive", isCategory);
  12463. if (defa != null) {
  12464. optAbsent[visualType] = defa;
  12465. if (visualType === "color" && !optAbsent.hasOwnProperty("opacity") && !optAbsent.hasOwnProperty("colorAlpha")) {
  12466. optAbsent.opacity = [0, 0];
  12467. }
  12468. }
  12469. });
  12470. }
  12471. }
  12472. function completeController(controller2) {
  12473. var symbolExists = (controller2.inRange || {}).symbol || (controller2.outOfRange || {}).symbol;
  12474. var symbolSizeExists = (controller2.inRange || {}).symbolSize || (controller2.outOfRange || {}).symbolSize;
  12475. var inactiveColor = this.get("inactiveColor");
  12476. var itemSymbol = this.getItemSymbol();
  12477. var defaultSymbol = itemSymbol || "roundRect";
  12478. each8(this.stateList, function(state) {
  12479. var itemSize = this.itemSize;
  12480. var visuals = controller2[state];
  12481. if (!visuals) {
  12482. visuals = controller2[state] = {
  12483. color: isCategory ? inactiveColor : [inactiveColor]
  12484. };
  12485. }
  12486. if (visuals.symbol == null) {
  12487. visuals.symbol = symbolExists && clone(symbolExists) || (isCategory ? defaultSymbol : [defaultSymbol]);
  12488. }
  12489. if (visuals.symbolSize == null) {
  12490. visuals.symbolSize = symbolSizeExists && clone(symbolSizeExists) || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);
  12491. }
  12492. visuals.symbol = mapVisual(visuals.symbol, function(symbol) {
  12493. return symbol === "none" ? defaultSymbol : symbol;
  12494. });
  12495. var symbolSize = visuals.symbolSize;
  12496. if (symbolSize != null) {
  12497. var max_1 = -Infinity;
  12498. eachVisual(symbolSize, function(value) {
  12499. value > max_1 && (max_1 = value);
  12500. });
  12501. visuals.symbolSize = mapVisual(symbolSize, function(value) {
  12502. return linearMap2(value, [0, max_1], [0, itemSize[0]], true);
  12503. });
  12504. }
  12505. }, this);
  12506. }
  12507. };
  12508. VisualMapModel2.prototype.resetItemSize = function() {
  12509. this.itemSize = [parseFloat(this.get("itemWidth")), parseFloat(this.get("itemHeight"))];
  12510. };
  12511. VisualMapModel2.prototype.isCategory = function() {
  12512. return !!this.option.categories;
  12513. };
  12514. VisualMapModel2.prototype.setSelected = function(selected) {
  12515. };
  12516. VisualMapModel2.prototype.getSelected = function() {
  12517. return null;
  12518. };
  12519. VisualMapModel2.prototype.getValueState = function(value) {
  12520. return null;
  12521. };
  12522. VisualMapModel2.prototype.getVisualMeta = function(getColorVisual2) {
  12523. return null;
  12524. };
  12525. VisualMapModel2.type = "visualMap";
  12526. VisualMapModel2.dependencies = ["series"];
  12527. VisualMapModel2.defaultOption = {
  12528. show: true,
  12529. z: 4,
  12530. seriesIndex: "all",
  12531. min: 0,
  12532. max: 200,
  12533. left: 0,
  12534. right: null,
  12535. top: null,
  12536. bottom: 0,
  12537. itemWidth: null,
  12538. itemHeight: null,
  12539. inverse: false,
  12540. orient: "vertical",
  12541. backgroundColor: "rgba(0,0,0,0)",
  12542. borderColor: "#ccc",
  12543. contentColor: "#5793f3",
  12544. inactiveColor: "#aaa",
  12545. borderWidth: 0,
  12546. padding: 5,
  12547. textGap: 10,
  12548. precision: 0,
  12549. textStyle: {
  12550. color: "#333"
  12551. }
  12552. };
  12553. return VisualMapModel2;
  12554. }(Component_default);
  12555. var VisualMapModel_default = VisualMapModel;
  12556. // node_modules/echarts/lib/component/visualMap/ContinuousModel.js
  12557. var DEFAULT_BAR_BOUND = [20, 140];
  12558. var ContinuousModel = function(_super) {
  12559. __extends(ContinuousModel2, _super);
  12560. function ContinuousModel2() {
  12561. var _this = _super !== null && _super.apply(this, arguments) || this;
  12562. _this.type = ContinuousModel2.type;
  12563. return _this;
  12564. }
  12565. ContinuousModel2.prototype.optionUpdated = function(newOption, isInit) {
  12566. _super.prototype.optionUpdated.apply(this, arguments);
  12567. this.resetExtent();
  12568. this.resetVisual(function(mappingOption) {
  12569. mappingOption.mappingMethod = "linear";
  12570. mappingOption.dataExtent = this.getExtent();
  12571. });
  12572. this._resetRange();
  12573. };
  12574. ContinuousModel2.prototype.resetItemSize = function() {
  12575. _super.prototype.resetItemSize.apply(this, arguments);
  12576. var itemSize = this.itemSize;
  12577. (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]);
  12578. (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]);
  12579. };
  12580. ContinuousModel2.prototype._resetRange = function() {
  12581. var dataExtent = this.getExtent();
  12582. var range = this.option.range;
  12583. if (!range || range.auto) {
  12584. dataExtent.auto = 1;
  12585. this.option.range = dataExtent;
  12586. } else if (isArray(range)) {
  12587. if (range[0] > range[1]) {
  12588. range.reverse();
  12589. }
  12590. range[0] = Math.max(range[0], dataExtent[0]);
  12591. range[1] = Math.min(range[1], dataExtent[1]);
  12592. }
  12593. };
  12594. ContinuousModel2.prototype.completeVisualOption = function() {
  12595. _super.prototype.completeVisualOption.apply(this, arguments);
  12596. each(this.stateList, function(state) {
  12597. var symbolSize = this.option.controller[state].symbolSize;
  12598. if (symbolSize && symbolSize[0] !== symbolSize[1]) {
  12599. symbolSize[0] = symbolSize[1] / 3;
  12600. }
  12601. }, this);
  12602. };
  12603. ContinuousModel2.prototype.setSelected = function(selected) {
  12604. this.option.range = selected.slice();
  12605. this._resetRange();
  12606. };
  12607. ContinuousModel2.prototype.getSelected = function() {
  12608. var dataExtent = this.getExtent();
  12609. var dataInterval = asc((this.get("range") || []).slice());
  12610. dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]);
  12611. dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]);
  12612. dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]);
  12613. dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]);
  12614. return dataInterval;
  12615. };
  12616. ContinuousModel2.prototype.getValueState = function(value) {
  12617. var range = this.option.range;
  12618. var dataExtent = this.getExtent();
  12619. return (range[0] <= dataExtent[0] || range[0] <= value) && (range[1] >= dataExtent[1] || value <= range[1]) ? "inRange" : "outOfRange";
  12620. };
  12621. ContinuousModel2.prototype.findTargetDataIndices = function(range) {
  12622. var result = [];
  12623. this.eachTargetSeries(function(seriesModel) {
  12624. var dataIndices = [];
  12625. var data = seriesModel.getData();
  12626. data.each(this.getDataDimensionIndex(data), function(value, dataIndex) {
  12627. range[0] <= value && value <= range[1] && dataIndices.push(dataIndex);
  12628. }, this);
  12629. result.push({
  12630. seriesId: seriesModel.id,
  12631. dataIndex: dataIndices
  12632. });
  12633. }, this);
  12634. return result;
  12635. };
  12636. ContinuousModel2.prototype.getVisualMeta = function(getColorVisual2) {
  12637. var oVals = getColorStopValues(this, "outOfRange", this.getExtent());
  12638. var iVals = getColorStopValues(this, "inRange", this.option.range.slice());
  12639. var stops = [];
  12640. function setStop(value, valueState) {
  12641. stops.push({
  12642. value,
  12643. color: getColorVisual2(value, valueState)
  12644. });
  12645. }
  12646. var iIdx = 0;
  12647. var oIdx = 0;
  12648. var iLen = iVals.length;
  12649. var oLen = oVals.length;
  12650. for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) {
  12651. if (oVals[oIdx] < iVals[iIdx]) {
  12652. setStop(oVals[oIdx], "outOfRange");
  12653. }
  12654. }
  12655. for (var first = 1; iIdx < iLen; iIdx++, first = 0) {
  12656. first && stops.length && setStop(iVals[iIdx], "outOfRange");
  12657. setStop(iVals[iIdx], "inRange");
  12658. }
  12659. for (var first = 1; oIdx < oLen; oIdx++) {
  12660. if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) {
  12661. if (first) {
  12662. stops.length && setStop(stops[stops.length - 1].value, "outOfRange");
  12663. first = 0;
  12664. }
  12665. setStop(oVals[oIdx], "outOfRange");
  12666. }
  12667. }
  12668. var stopsLen = stops.length;
  12669. return {
  12670. stops,
  12671. outerColors: [stopsLen ? stops[0].color : "transparent", stopsLen ? stops[stopsLen - 1].color : "transparent"]
  12672. };
  12673. };
  12674. ContinuousModel2.type = "visualMap.continuous";
  12675. ContinuousModel2.defaultOption = inheritDefaultOption(VisualMapModel_default.defaultOption, {
  12676. align: "auto",
  12677. calculable: false,
  12678. hoverLink: true,
  12679. realtime: true,
  12680. 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",
  12681. handleSize: "120%",
  12682. handleStyle: {
  12683. borderColor: "#fff",
  12684. borderWidth: 1
  12685. },
  12686. indicatorIcon: "circle",
  12687. indicatorSize: "50%",
  12688. indicatorStyle: {
  12689. borderColor: "#fff",
  12690. borderWidth: 2,
  12691. shadowBlur: 2,
  12692. shadowOffsetX: 1,
  12693. shadowOffsetY: 1,
  12694. shadowColor: "rgba(0,0,0,0.2)"
  12695. }
  12696. });
  12697. return ContinuousModel2;
  12698. }(VisualMapModel_default);
  12699. function getColorStopValues(visualMapModel, valueState, dataExtent) {
  12700. if (dataExtent[0] === dataExtent[1]) {
  12701. return dataExtent.slice();
  12702. }
  12703. var count2 = 200;
  12704. var step = (dataExtent[1] - dataExtent[0]) / count2;
  12705. var value = dataExtent[0];
  12706. var stopValues = [];
  12707. for (var i = 0; i <= count2 && value < dataExtent[1]; i++) {
  12708. stopValues.push(value);
  12709. value += step;
  12710. }
  12711. stopValues.push(dataExtent[1]);
  12712. return stopValues;
  12713. }
  12714. var ContinuousModel_default = ContinuousModel;
  12715. // node_modules/echarts/lib/component/visualMap/ContinuousView.js
  12716. init_define_APP_INFO();
  12717. // node_modules/echarts/lib/component/visualMap/VisualMapView.js
  12718. init_define_APP_INFO();
  12719. var VisualMapView = function(_super) {
  12720. __extends(VisualMapView2, _super);
  12721. function VisualMapView2() {
  12722. var _this = _super !== null && _super.apply(this, arguments) || this;
  12723. _this.type = VisualMapView2.type;
  12724. _this.autoPositionValues = {
  12725. left: 1,
  12726. right: 1,
  12727. top: 1,
  12728. bottom: 1
  12729. };
  12730. return _this;
  12731. }
  12732. VisualMapView2.prototype.init = function(ecModel, api) {
  12733. this.ecModel = ecModel;
  12734. this.api = api;
  12735. };
  12736. VisualMapView2.prototype.render = function(visualMapModel, ecModel, api, payload) {
  12737. this.visualMapModel = visualMapModel;
  12738. if (visualMapModel.get("show") === false) {
  12739. this.group.removeAll();
  12740. return;
  12741. }
  12742. this.doRender(visualMapModel, ecModel, api, payload);
  12743. };
  12744. VisualMapView2.prototype.renderBackground = function(group) {
  12745. var visualMapModel = this.visualMapModel;
  12746. var padding = normalizeCssArray(visualMapModel.get("padding") || 0);
  12747. var rect = group.getBoundingRect();
  12748. group.add(new Rect_default({
  12749. z2: -1,
  12750. silent: true,
  12751. shape: {
  12752. x: rect.x - padding[3],
  12753. y: rect.y - padding[0],
  12754. width: rect.width + padding[3] + padding[1],
  12755. height: rect.height + padding[0] + padding[2]
  12756. },
  12757. style: {
  12758. fill: visualMapModel.get("backgroundColor"),
  12759. stroke: visualMapModel.get("borderColor"),
  12760. lineWidth: visualMapModel.get("borderWidth")
  12761. }
  12762. }));
  12763. };
  12764. VisualMapView2.prototype.getControllerVisual = function(targetValue, visualCluster, opts) {
  12765. opts = opts || {};
  12766. var forceState = opts.forceState;
  12767. var visualMapModel = this.visualMapModel;
  12768. var visualObj = {};
  12769. if (visualCluster === "color") {
  12770. var defaultColor = visualMapModel.get("contentColor");
  12771. visualObj.color = defaultColor;
  12772. }
  12773. function getter(key) {
  12774. return visualObj[key];
  12775. }
  12776. function setter(key, value) {
  12777. visualObj[key] = value;
  12778. }
  12779. var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)];
  12780. var visualTypes = VisualMapping_default.prepareVisualTypes(mappings);
  12781. each(visualTypes, function(type) {
  12782. var visualMapping = mappings[type];
  12783. if (opts.convertOpacityToAlpha && type === "opacity") {
  12784. type = "colorAlpha";
  12785. visualMapping = mappings.__alphaForOpacity;
  12786. }
  12787. if (VisualMapping_default.dependsOn(type, visualCluster)) {
  12788. visualMapping && visualMapping.applyVisual(targetValue, getter, setter);
  12789. }
  12790. });
  12791. return visualObj[visualCluster];
  12792. };
  12793. VisualMapView2.prototype.positionGroup = function(group) {
  12794. var model = this.visualMapModel;
  12795. var api = this.api;
  12796. positionElement(group, model.getBoxLayoutParams(), {
  12797. width: api.getWidth(),
  12798. height: api.getHeight()
  12799. });
  12800. };
  12801. VisualMapView2.prototype.doRender = function(visualMapModel, ecModel, api, payload) {
  12802. };
  12803. VisualMapView2.type = "visualMap";
  12804. return VisualMapView2;
  12805. }(Component_default2);
  12806. var VisualMapView_default = VisualMapView;
  12807. // node_modules/echarts/lib/component/visualMap/helper.js
  12808. init_define_APP_INFO();
  12809. var paramsSet = [["left", "right", "width"], ["top", "bottom", "height"]];
  12810. function getItemAlign(visualMapModel, api, itemSize) {
  12811. var modelOption = visualMapModel.option;
  12812. var itemAlign = modelOption.align;
  12813. if (itemAlign != null && itemAlign !== "auto") {
  12814. return itemAlign;
  12815. }
  12816. var ecSize = {
  12817. width: api.getWidth(),
  12818. height: api.getHeight()
  12819. };
  12820. var realIndex = modelOption.orient === "horizontal" ? 1 : 0;
  12821. var reals = paramsSet[realIndex];
  12822. var fakeValue = [0, null, 10];
  12823. var layoutInput = {};
  12824. for (var i = 0; i < 3; i++) {
  12825. layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i];
  12826. layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]];
  12827. }
  12828. var rParam = [["x", "width", 3], ["y", "height", 0]][realIndex];
  12829. var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding);
  12830. return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 < ecSize[rParam[1]] * 0.5 ? 0 : 1];
  12831. }
  12832. function makeHighDownBatch(batch, visualMapModel) {
  12833. each(batch || [], function(batchItem) {
  12834. if (batchItem.dataIndex != null) {
  12835. batchItem.dataIndexInside = batchItem.dataIndex;
  12836. batchItem.dataIndex = null;
  12837. }
  12838. batchItem.highlightKey = "visualMap" + (visualMapModel ? visualMapModel.componentIndex : "");
  12839. });
  12840. return batch;
  12841. }
  12842. // node_modules/echarts/lib/component/visualMap/ContinuousView.js
  12843. var linearMap3 = linearMap;
  12844. var each9 = each;
  12845. var mathMin = Math.min;
  12846. var mathMax = Math.max;
  12847. var HOVER_LINK_SIZE = 12;
  12848. var HOVER_LINK_OUT = 6;
  12849. var ContinuousView = function(_super) {
  12850. __extends(ContinuousView2, _super);
  12851. function ContinuousView2() {
  12852. var _this = _super !== null && _super.apply(this, arguments) || this;
  12853. _this.type = ContinuousView2.type;
  12854. _this._shapes = {};
  12855. _this._dataInterval = [];
  12856. _this._handleEnds = [];
  12857. _this._hoverLinkDataIndices = [];
  12858. return _this;
  12859. }
  12860. ContinuousView2.prototype.doRender = function(visualMapModel, ecModel, api, payload) {
  12861. this._api = api;
  12862. if (!payload || payload.type !== "selectDataRange" || payload.from !== this.uid) {
  12863. this._buildView();
  12864. }
  12865. };
  12866. ContinuousView2.prototype._buildView = function() {
  12867. this.group.removeAll();
  12868. var visualMapModel = this.visualMapModel;
  12869. var thisGroup = this.group;
  12870. this._orient = visualMapModel.get("orient");
  12871. this._useHandle = visualMapModel.get("calculable");
  12872. this._resetInterval();
  12873. this._renderBar(thisGroup);
  12874. var dataRangeText = visualMapModel.get("text");
  12875. this._renderEndsText(thisGroup, dataRangeText, 0);
  12876. this._renderEndsText(thisGroup, dataRangeText, 1);
  12877. this._updateView(true);
  12878. this.renderBackground(thisGroup);
  12879. this._updateView();
  12880. this._enableHoverLinkToSeries();
  12881. this._enableHoverLinkFromSeries();
  12882. this.positionGroup(thisGroup);
  12883. };
  12884. ContinuousView2.prototype._renderEndsText = function(group, dataRangeText, endsIndex) {
  12885. if (!dataRangeText) {
  12886. return;
  12887. }
  12888. var text = dataRangeText[1 - endsIndex];
  12889. text = text != null ? text + "" : "";
  12890. var visualMapModel = this.visualMapModel;
  12891. var textGap = visualMapModel.get("textGap");
  12892. var itemSize = visualMapModel.itemSize;
  12893. var barGroup = this._shapes.mainGroup;
  12894. var position = this._applyTransform([itemSize[0] / 2, endsIndex === 0 ? -textGap : itemSize[1] + textGap], barGroup);
  12895. var align = this._applyTransform(endsIndex === 0 ? "bottom" : "top", barGroup);
  12896. var orient = this._orient;
  12897. var textStyleModel = this.visualMapModel.textStyleModel;
  12898. this.group.add(new Text_default({
  12899. style: createTextStyle(textStyleModel, {
  12900. x: position[0],
  12901. y: position[1],
  12902. verticalAlign: orient === "horizontal" ? "middle" : align,
  12903. align: orient === "horizontal" ? align : "center",
  12904. text
  12905. })
  12906. }));
  12907. };
  12908. ContinuousView2.prototype._renderBar = function(targetGroup) {
  12909. var visualMapModel = this.visualMapModel;
  12910. var shapes = this._shapes;
  12911. var itemSize = visualMapModel.itemSize;
  12912. var orient = this._orient;
  12913. var useHandle = this._useHandle;
  12914. var itemAlign = getItemAlign(visualMapModel, this.api, itemSize);
  12915. var mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign);
  12916. var gradientBarGroup = new Group_default();
  12917. mainGroup.add(gradientBarGroup);
  12918. gradientBarGroup.add(shapes.outOfRange = createPolygon());
  12919. gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor2(this._orient) : null, bind(this._dragHandle, this, "all", false), bind(this._dragHandle, this, "all", true)));
  12920. gradientBarGroup.setClipPath(new Rect_default({
  12921. shape: {
  12922. x: 0,
  12923. y: 0,
  12924. width: itemSize[0],
  12925. height: itemSize[1],
  12926. r: 3
  12927. }
  12928. }));
  12929. var textRect = visualMapModel.textStyleModel.getTextRect("\u56FD");
  12930. var textSize = mathMax(textRect.width, textRect.height);
  12931. if (useHandle) {
  12932. shapes.handleThumbs = [];
  12933. shapes.handleLabels = [];
  12934. shapes.handleLabelPoints = [];
  12935. this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient);
  12936. this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient);
  12937. }
  12938. this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient);
  12939. targetGroup.add(mainGroup);
  12940. };
  12941. ContinuousView2.prototype._createHandle = function(visualMapModel, mainGroup, handleIndex, itemSize, textSize, orient) {
  12942. var onDrift = bind(this._dragHandle, this, handleIndex, false);
  12943. var onDragEnd = bind(this._dragHandle, this, handleIndex, true);
  12944. var handleSize = parsePercent(visualMapModel.get("handleSize"), itemSize[0]);
  12945. var handleThumb = createSymbol(visualMapModel.get("handleIcon"), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true);
  12946. var cursor = getCursor2(this._orient);
  12947. handleThumb.attr({
  12948. cursor,
  12949. draggable: true,
  12950. drift: onDrift,
  12951. ondragend: onDragEnd,
  12952. onmousemove: function(e) {
  12953. stop(e.event);
  12954. }
  12955. });
  12956. handleThumb.x = itemSize[0] / 2;
  12957. handleThumb.useStyle(visualMapModel.getModel("handleStyle").getItemStyle());
  12958. handleThumb.setStyle({
  12959. strokeNoScale: true,
  12960. strokeFirst: true
  12961. });
  12962. handleThumb.style.lineWidth *= 2;
  12963. handleThumb.ensureState("emphasis").style = visualMapModel.getModel(["emphasis", "handleStyle"]).getItemStyle();
  12964. setAsHighDownDispatcher(handleThumb, true);
  12965. mainGroup.add(handleThumb);
  12966. var textStyleModel = this.visualMapModel.textStyleModel;
  12967. var handleLabel = new Text_default({
  12968. cursor,
  12969. draggable: true,
  12970. drift: onDrift,
  12971. onmousemove: function(e) {
  12972. stop(e.event);
  12973. },
  12974. ondragend: onDragEnd,
  12975. style: createTextStyle(textStyleModel, {
  12976. x: 0,
  12977. y: 0,
  12978. text: ""
  12979. })
  12980. });
  12981. handleLabel.ensureState("blur").style = {
  12982. opacity: 0.1
  12983. };
  12984. handleLabel.stateTransition = {
  12985. duration: 200
  12986. };
  12987. this.group.add(handleLabel);
  12988. var handleLabelPoint = [handleSize, 0];
  12989. var shapes = this._shapes;
  12990. shapes.handleThumbs[handleIndex] = handleThumb;
  12991. shapes.handleLabelPoints[handleIndex] = handleLabelPoint;
  12992. shapes.handleLabels[handleIndex] = handleLabel;
  12993. };
  12994. ContinuousView2.prototype._createIndicator = function(visualMapModel, mainGroup, itemSize, textSize, orient) {
  12995. var scale = parsePercent(visualMapModel.get("indicatorSize"), itemSize[0]);
  12996. var indicator = createSymbol(visualMapModel.get("indicatorIcon"), -scale / 2, -scale / 2, scale, scale, null, true);
  12997. indicator.attr({
  12998. cursor: "move",
  12999. invisible: true,
  13000. silent: true,
  13001. x: itemSize[0] / 2
  13002. });
  13003. var indicatorStyle = visualMapModel.getModel("indicatorStyle").getItemStyle();
  13004. if (indicator instanceof Image_default) {
  13005. var pathStyle = indicator.style;
  13006. indicator.useStyle(extend({
  13007. image: pathStyle.image,
  13008. x: pathStyle.x,
  13009. y: pathStyle.y,
  13010. width: pathStyle.width,
  13011. height: pathStyle.height
  13012. }, indicatorStyle));
  13013. } else {
  13014. indicator.useStyle(indicatorStyle);
  13015. }
  13016. mainGroup.add(indicator);
  13017. var textStyleModel = this.visualMapModel.textStyleModel;
  13018. var indicatorLabel = new Text_default({
  13019. silent: true,
  13020. invisible: true,
  13021. style: createTextStyle(textStyleModel, {
  13022. x: 0,
  13023. y: 0,
  13024. text: ""
  13025. })
  13026. });
  13027. this.group.add(indicatorLabel);
  13028. var indicatorLabelPoint = [(orient === "horizontal" ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2, 0];
  13029. var shapes = this._shapes;
  13030. shapes.indicator = indicator;
  13031. shapes.indicatorLabel = indicatorLabel;
  13032. shapes.indicatorLabelPoint = indicatorLabelPoint;
  13033. this._firstShowIndicator = true;
  13034. };
  13035. ContinuousView2.prototype._dragHandle = function(handleIndex, isEnd, dx, dy) {
  13036. if (!this._useHandle) {
  13037. return;
  13038. }
  13039. this._dragging = !isEnd;
  13040. if (!isEnd) {
  13041. var vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true);
  13042. this._updateInterval(handleIndex, vertex[1]);
  13043. this._hideIndicator();
  13044. this._updateView();
  13045. }
  13046. if (isEnd === !this.visualMapModel.get("realtime")) {
  13047. this.api.dispatchAction({
  13048. type: "selectDataRange",
  13049. from: this.uid,
  13050. visualMapId: this.visualMapModel.id,
  13051. selected: this._dataInterval.slice()
  13052. });
  13053. }
  13054. if (isEnd) {
  13055. !this._hovering && this._clearHoverLinkToSeries();
  13056. } else if (useHoverLinkOnHandle(this.visualMapModel)) {
  13057. this._doHoverLinkToSeries(this._handleEnds[handleIndex], false);
  13058. }
  13059. };
  13060. ContinuousView2.prototype._resetInterval = function() {
  13061. var visualMapModel = this.visualMapModel;
  13062. var dataInterval = this._dataInterval = visualMapModel.getSelected();
  13063. var dataExtent = visualMapModel.getExtent();
  13064. var sizeExtent = [0, visualMapModel.itemSize[1]];
  13065. this._handleEnds = [linearMap3(dataInterval[0], dataExtent, sizeExtent, true), linearMap3(dataInterval[1], dataExtent, sizeExtent, true)];
  13066. };
  13067. ContinuousView2.prototype._updateInterval = function(handleIndex, delta) {
  13068. delta = delta || 0;
  13069. var visualMapModel = this.visualMapModel;
  13070. var handleEnds = this._handleEnds;
  13071. var sizeExtent = [0, visualMapModel.itemSize[1]];
  13072. sliderMove(
  13073. delta,
  13074. handleEnds,
  13075. sizeExtent,
  13076. handleIndex,
  13077. 0
  13078. );
  13079. var dataExtent = visualMapModel.getExtent();
  13080. this._dataInterval = [linearMap3(handleEnds[0], sizeExtent, dataExtent, true), linearMap3(handleEnds[1], sizeExtent, dataExtent, true)];
  13081. };
  13082. ContinuousView2.prototype._updateView = function(forSketch) {
  13083. var visualMapModel = this.visualMapModel;
  13084. var dataExtent = visualMapModel.getExtent();
  13085. var shapes = this._shapes;
  13086. var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]];
  13087. var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds;
  13088. var visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, "inRange");
  13089. var visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, "outOfRange");
  13090. shapes.inRange.setStyle({
  13091. fill: visualInRange.barColor
  13092. }).setShape("points", visualInRange.barPoints);
  13093. shapes.outOfRange.setStyle({
  13094. fill: visualOutOfRange.barColor
  13095. }).setShape("points", visualOutOfRange.barPoints);
  13096. this._updateHandle(inRangeHandleEnds, visualInRange);
  13097. };
  13098. ContinuousView2.prototype._createBarVisual = function(dataInterval, dataExtent, handleEnds, forceState) {
  13099. var opts = {
  13100. forceState,
  13101. convertOpacityToAlpha: true
  13102. };
  13103. var colorStops = this._makeColorGradient(dataInterval, opts);
  13104. var symbolSizes = [this.getControllerVisual(dataInterval[0], "symbolSize", opts), this.getControllerVisual(dataInterval[1], "symbolSize", opts)];
  13105. var barPoints = this._createBarPoints(handleEnds, symbolSizes);
  13106. return {
  13107. barColor: new LinearGradient_default(0, 0, 0, 1, colorStops),
  13108. barPoints,
  13109. handlesColor: [colorStops[0].color, colorStops[colorStops.length - 1].color]
  13110. };
  13111. };
  13112. ContinuousView2.prototype._makeColorGradient = function(dataInterval, opts) {
  13113. var sampleNumber = 100;
  13114. var colorStops = [];
  13115. var step = (dataInterval[1] - dataInterval[0]) / sampleNumber;
  13116. colorStops.push({
  13117. color: this.getControllerVisual(dataInterval[0], "color", opts),
  13118. offset: 0
  13119. });
  13120. for (var i = 1; i < sampleNumber; i++) {
  13121. var currValue = dataInterval[0] + step * i;
  13122. if (currValue > dataInterval[1]) {
  13123. break;
  13124. }
  13125. colorStops.push({
  13126. color: this.getControllerVisual(currValue, "color", opts),
  13127. offset: i / sampleNumber
  13128. });
  13129. }
  13130. colorStops.push({
  13131. color: this.getControllerVisual(dataInterval[1], "color", opts),
  13132. offset: 1
  13133. });
  13134. return colorStops;
  13135. };
  13136. ContinuousView2.prototype._createBarPoints = function(handleEnds, symbolSizes) {
  13137. var itemSize = this.visualMapModel.itemSize;
  13138. return [[itemSize[0] - symbolSizes[0], handleEnds[0]], [itemSize[0], handleEnds[0]], [itemSize[0], handleEnds[1]], [itemSize[0] - symbolSizes[1], handleEnds[1]]];
  13139. };
  13140. ContinuousView2.prototype._createBarGroup = function(itemAlign) {
  13141. var orient = this._orient;
  13142. var inverse = this.visualMapModel.get("inverse");
  13143. return new Group_default(orient === "horizontal" && !inverse ? {
  13144. scaleX: itemAlign === "bottom" ? 1 : -1,
  13145. rotation: Math.PI / 2
  13146. } : orient === "horizontal" && inverse ? {
  13147. scaleX: itemAlign === "bottom" ? -1 : 1,
  13148. rotation: -Math.PI / 2
  13149. } : orient === "vertical" && !inverse ? {
  13150. scaleX: itemAlign === "left" ? 1 : -1,
  13151. scaleY: -1
  13152. } : {
  13153. scaleX: itemAlign === "left" ? 1 : -1
  13154. });
  13155. };
  13156. ContinuousView2.prototype._updateHandle = function(handleEnds, visualInRange) {
  13157. if (!this._useHandle) {
  13158. return;
  13159. }
  13160. var shapes = this._shapes;
  13161. var visualMapModel = this.visualMapModel;
  13162. var handleThumbs = shapes.handleThumbs;
  13163. var handleLabels = shapes.handleLabels;
  13164. var itemSize = visualMapModel.itemSize;
  13165. var dataExtent = visualMapModel.getExtent();
  13166. each9([0, 1], function(handleIndex) {
  13167. var handleThumb = handleThumbs[handleIndex];
  13168. handleThumb.setStyle("fill", visualInRange.handlesColor[handleIndex]);
  13169. handleThumb.y = handleEnds[handleIndex];
  13170. var val = linearMap3(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true);
  13171. var symbolSize = this.getControllerVisual(val, "symbolSize");
  13172. handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0];
  13173. handleThumb.x = itemSize[0] - symbolSize / 2;
  13174. var textPoint = applyTransform(shapes.handleLabelPoints[handleIndex], getTransform(handleThumb, this.group));
  13175. handleLabels[handleIndex].setStyle({
  13176. x: textPoint[0],
  13177. y: textPoint[1],
  13178. text: visualMapModel.formatValueText(this._dataInterval[handleIndex]),
  13179. verticalAlign: "middle",
  13180. align: this._orient === "vertical" ? this._applyTransform("left", shapes.mainGroup) : "center"
  13181. });
  13182. }, this);
  13183. };
  13184. ContinuousView2.prototype._showIndicator = function(cursorValue, textValue, rangeSymbol, halfHoverLinkSize) {
  13185. var visualMapModel = this.visualMapModel;
  13186. var dataExtent = visualMapModel.getExtent();
  13187. var itemSize = visualMapModel.itemSize;
  13188. var sizeExtent = [0, itemSize[1]];
  13189. var shapes = this._shapes;
  13190. var indicator = shapes.indicator;
  13191. if (!indicator) {
  13192. return;
  13193. }
  13194. indicator.attr("invisible", false);
  13195. var opts = {
  13196. convertOpacityToAlpha: true
  13197. };
  13198. var color = this.getControllerVisual(cursorValue, "color", opts);
  13199. var symbolSize = this.getControllerVisual(cursorValue, "symbolSize");
  13200. var y = linearMap3(cursorValue, dataExtent, sizeExtent, true);
  13201. var x = itemSize[0] - symbolSize / 2;
  13202. var oldIndicatorPos = {
  13203. x: indicator.x,
  13204. y: indicator.y
  13205. };
  13206. indicator.y = y;
  13207. indicator.x = x;
  13208. var textPoint = applyTransform(shapes.indicatorLabelPoint, getTransform(indicator, this.group));
  13209. var indicatorLabel = shapes.indicatorLabel;
  13210. indicatorLabel.attr("invisible", false);
  13211. var align = this._applyTransform("left", shapes.mainGroup);
  13212. var orient = this._orient;
  13213. var isHorizontal = orient === "horizontal";
  13214. indicatorLabel.setStyle({
  13215. text: (rangeSymbol ? rangeSymbol : "") + visualMapModel.formatValueText(textValue),
  13216. verticalAlign: isHorizontal ? align : "middle",
  13217. align: isHorizontal ? "center" : align
  13218. });
  13219. var indicatorNewProps = {
  13220. x,
  13221. y,
  13222. style: {
  13223. fill: color
  13224. }
  13225. };
  13226. var labelNewProps = {
  13227. style: {
  13228. x: textPoint[0],
  13229. y: textPoint[1]
  13230. }
  13231. };
  13232. if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {
  13233. var animationCfg = {
  13234. duration: 100,
  13235. easing: "cubicInOut",
  13236. additive: true
  13237. };
  13238. indicator.x = oldIndicatorPos.x;
  13239. indicator.y = oldIndicatorPos.y;
  13240. indicator.animateTo(indicatorNewProps, animationCfg);
  13241. indicatorLabel.animateTo(labelNewProps, animationCfg);
  13242. } else {
  13243. indicator.attr(indicatorNewProps);
  13244. indicatorLabel.attr(labelNewProps);
  13245. }
  13246. this._firstShowIndicator = false;
  13247. var handleLabels = this._shapes.handleLabels;
  13248. if (handleLabels) {
  13249. for (var i = 0; i < handleLabels.length; i++) {
  13250. this._api.enterBlur(handleLabels[i]);
  13251. }
  13252. }
  13253. };
  13254. ContinuousView2.prototype._enableHoverLinkToSeries = function() {
  13255. var self = this;
  13256. this._shapes.mainGroup.on("mousemove", function(e) {
  13257. self._hovering = true;
  13258. if (!self._dragging) {
  13259. var itemSize = self.visualMapModel.itemSize;
  13260. var pos = self._applyTransform([e.offsetX, e.offsetY], self._shapes.mainGroup, true, true);
  13261. pos[1] = mathMin(mathMax(0, pos[1]), itemSize[1]);
  13262. self._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize[0]);
  13263. }
  13264. }).on("mouseout", function() {
  13265. self._hovering = false;
  13266. !self._dragging && self._clearHoverLinkToSeries();
  13267. });
  13268. };
  13269. ContinuousView2.prototype._enableHoverLinkFromSeries = function() {
  13270. var zr = this.api.getZr();
  13271. if (this.visualMapModel.option.hoverLink) {
  13272. zr.on("mouseover", this._hoverLinkFromSeriesMouseOver, this);
  13273. zr.on("mouseout", this._hideIndicator, this);
  13274. } else {
  13275. this._clearHoverLinkFromSeries();
  13276. }
  13277. };
  13278. ContinuousView2.prototype._doHoverLinkToSeries = function(cursorPos, hoverOnBar) {
  13279. var visualMapModel = this.visualMapModel;
  13280. var itemSize = visualMapModel.itemSize;
  13281. if (!visualMapModel.option.hoverLink) {
  13282. return;
  13283. }
  13284. var sizeExtent = [0, itemSize[1]];
  13285. var dataExtent = visualMapModel.getExtent();
  13286. cursorPos = mathMin(mathMax(sizeExtent[0], cursorPos), sizeExtent[1]);
  13287. var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent);
  13288. var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize];
  13289. var cursorValue = linearMap3(cursorPos, sizeExtent, dataExtent, true);
  13290. var valueRange = [linearMap3(hoverRange[0], sizeExtent, dataExtent, true), linearMap3(hoverRange[1], sizeExtent, dataExtent, true)];
  13291. hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity);
  13292. hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity);
  13293. if (hoverOnBar) {
  13294. if (valueRange[0] === -Infinity) {
  13295. this._showIndicator(cursorValue, valueRange[1], "< ", halfHoverLinkSize);
  13296. } else if (valueRange[1] === Infinity) {
  13297. this._showIndicator(cursorValue, valueRange[0], "> ", halfHoverLinkSize);
  13298. } else {
  13299. this._showIndicator(cursorValue, cursorValue, "\u2248 ", halfHoverLinkSize);
  13300. }
  13301. }
  13302. var oldBatch = this._hoverLinkDataIndices;
  13303. var newBatch = [];
  13304. if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) {
  13305. newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange);
  13306. }
  13307. var resultBatches = compressBatches(oldBatch, newBatch);
  13308. this._dispatchHighDown("downplay", makeHighDownBatch(resultBatches[0], visualMapModel));
  13309. this._dispatchHighDown("highlight", makeHighDownBatch(resultBatches[1], visualMapModel));
  13310. };
  13311. ContinuousView2.prototype._hoverLinkFromSeriesMouseOver = function(e) {
  13312. var el = e.target;
  13313. var visualMapModel = this.visualMapModel;
  13314. if (!el || getECData(el).dataIndex == null) {
  13315. return;
  13316. }
  13317. var ecData = getECData(el);
  13318. var dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex);
  13319. if (!visualMapModel.isTargetSeries(dataModel)) {
  13320. return;
  13321. }
  13322. var data = dataModel.getData(ecData.dataType);
  13323. var value = data.getStore().get(visualMapModel.getDataDimensionIndex(data), ecData.dataIndex);
  13324. if (!isNaN(value)) {
  13325. this._showIndicator(value, value);
  13326. }
  13327. };
  13328. ContinuousView2.prototype._hideIndicator = function() {
  13329. var shapes = this._shapes;
  13330. shapes.indicator && shapes.indicator.attr("invisible", true);
  13331. shapes.indicatorLabel && shapes.indicatorLabel.attr("invisible", true);
  13332. var handleLabels = this._shapes.handleLabels;
  13333. if (handleLabels) {
  13334. for (var i = 0; i < handleLabels.length; i++) {
  13335. this._api.leaveBlur(handleLabels[i]);
  13336. }
  13337. }
  13338. };
  13339. ContinuousView2.prototype._clearHoverLinkToSeries = function() {
  13340. this._hideIndicator();
  13341. var indices = this._hoverLinkDataIndices;
  13342. this._dispatchHighDown("downplay", makeHighDownBatch(indices, this.visualMapModel));
  13343. indices.length = 0;
  13344. };
  13345. ContinuousView2.prototype._clearHoverLinkFromSeries = function() {
  13346. this._hideIndicator();
  13347. var zr = this.api.getZr();
  13348. zr.off("mouseover", this._hoverLinkFromSeriesMouseOver);
  13349. zr.off("mouseout", this._hideIndicator);
  13350. };
  13351. ContinuousView2.prototype._applyTransform = function(vertex, element, inverse, global) {
  13352. var transform = getTransform(element, global ? null : this.group);
  13353. return isArray(vertex) ? applyTransform(vertex, transform, inverse) : transformDirection(vertex, transform, inverse);
  13354. };
  13355. ContinuousView2.prototype._dispatchHighDown = function(type, batch) {
  13356. batch && batch.length && this.api.dispatchAction({
  13357. type,
  13358. batch
  13359. });
  13360. };
  13361. ContinuousView2.prototype.dispose = function() {
  13362. this._clearHoverLinkFromSeries();
  13363. this._clearHoverLinkToSeries();
  13364. };
  13365. ContinuousView2.prototype.remove = function() {
  13366. this._clearHoverLinkFromSeries();
  13367. this._clearHoverLinkToSeries();
  13368. };
  13369. ContinuousView2.type = "visualMap.continuous";
  13370. return ContinuousView2;
  13371. }(VisualMapView_default);
  13372. function createPolygon(points, cursor, onDrift, onDragEnd) {
  13373. return new Polygon_default({
  13374. shape: {
  13375. points
  13376. },
  13377. draggable: !!onDrift,
  13378. cursor,
  13379. drift: onDrift,
  13380. onmousemove: function(e) {
  13381. stop(e.event);
  13382. },
  13383. ondragend: onDragEnd
  13384. });
  13385. }
  13386. function getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) {
  13387. var halfHoverLinkSize = HOVER_LINK_SIZE / 2;
  13388. var hoverLinkDataSize = visualMapModel.get("hoverLinkDataSize");
  13389. if (hoverLinkDataSize) {
  13390. halfHoverLinkSize = linearMap3(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2;
  13391. }
  13392. return halfHoverLinkSize;
  13393. }
  13394. function useHoverLinkOnHandle(visualMapModel) {
  13395. var hoverLinkOnHandle = visualMapModel.get("hoverLinkOnHandle");
  13396. return !!(hoverLinkOnHandle == null ? visualMapModel.get("realtime") : hoverLinkOnHandle);
  13397. }
  13398. function getCursor2(orient) {
  13399. return orient === "vertical" ? "ns-resize" : "ew-resize";
  13400. }
  13401. var ContinuousView_default = ContinuousView;
  13402. // node_modules/echarts/lib/component/visualMap/installCommon.js
  13403. init_define_APP_INFO();
  13404. // node_modules/echarts/lib/component/visualMap/visualMapAction.js
  13405. init_define_APP_INFO();
  13406. var visualMapActionInfo = {
  13407. type: "selectDataRange",
  13408. event: "dataRangeSelected",
  13409. update: "update"
  13410. };
  13411. var visualMapActionHander = function(payload, ecModel) {
  13412. ecModel.eachComponent({
  13413. mainType: "visualMap",
  13414. query: payload
  13415. }, function(model) {
  13416. model.setSelected(payload.selected);
  13417. });
  13418. };
  13419. // node_modules/echarts/lib/component/visualMap/visualEncoding.js
  13420. init_define_APP_INFO();
  13421. var visualMapEncodingHandlers = [
  13422. {
  13423. createOnAllSeries: true,
  13424. reset: function(seriesModel, ecModel) {
  13425. var resetDefines = [];
  13426. ecModel.eachComponent("visualMap", function(visualMapModel) {
  13427. var pipelineContext = seriesModel.pipelineContext;
  13428. if (!visualMapModel.isTargetSeries(seriesModel) || pipelineContext && pipelineContext.large) {
  13429. return;
  13430. }
  13431. resetDefines.push(incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimensionIndex(seriesModel.getData())));
  13432. });
  13433. return resetDefines;
  13434. }
  13435. },
  13436. {
  13437. createOnAllSeries: true,
  13438. reset: function(seriesModel, ecModel) {
  13439. var data = seriesModel.getData();
  13440. var visualMetaList = [];
  13441. ecModel.eachComponent("visualMap", function(visualMapModel) {
  13442. if (visualMapModel.isTargetSeries(seriesModel)) {
  13443. var visualMeta = visualMapModel.getVisualMeta(bind(getColorVisual, null, seriesModel, visualMapModel)) || {
  13444. stops: [],
  13445. outerColors: []
  13446. };
  13447. var dimIdx = visualMapModel.getDataDimensionIndex(data);
  13448. if (dimIdx >= 0) {
  13449. visualMeta.dimension = dimIdx;
  13450. visualMetaList.push(visualMeta);
  13451. }
  13452. }
  13453. });
  13454. seriesModel.getData().setVisual("visualMeta", visualMetaList);
  13455. }
  13456. }
  13457. ];
  13458. function getColorVisual(seriesModel, visualMapModel, value, valueState) {
  13459. var mappings = visualMapModel.targetVisuals[valueState];
  13460. var visualTypes = VisualMapping_default.prepareVisualTypes(mappings);
  13461. var resultVisual = {
  13462. color: getVisualFromData(seriesModel.getData(), "color")
  13463. };
  13464. for (var i = 0, len = visualTypes.length; i < len; i++) {
  13465. var type = visualTypes[i];
  13466. var mapping = mappings[type === "opacity" ? "__alphaForOpacity" : type];
  13467. mapping && mapping.applyVisual(value, getVisual, setVisual);
  13468. }
  13469. return resultVisual.color;
  13470. function getVisual(key) {
  13471. return resultVisual[key];
  13472. }
  13473. function setVisual(key, value2) {
  13474. resultVisual[key] = value2;
  13475. }
  13476. }
  13477. // node_modules/echarts/lib/component/visualMap/preprocessor.js
  13478. init_define_APP_INFO();
  13479. var each10 = each;
  13480. function visualMapPreprocessor(option) {
  13481. var visualMap = option && option.visualMap;
  13482. if (!isArray(visualMap)) {
  13483. visualMap = visualMap ? [visualMap] : [];
  13484. }
  13485. each10(visualMap, function(opt) {
  13486. if (!opt) {
  13487. return;
  13488. }
  13489. if (has2(opt, "splitList") && !has2(opt, "pieces")) {
  13490. opt.pieces = opt.splitList;
  13491. delete opt.splitList;
  13492. }
  13493. var pieces = opt.pieces;
  13494. if (pieces && isArray(pieces)) {
  13495. each10(pieces, function(piece) {
  13496. if (isObject(piece)) {
  13497. if (has2(piece, "start") && !has2(piece, "min")) {
  13498. piece.min = piece.start;
  13499. }
  13500. if (has2(piece, "end") && !has2(piece, "max")) {
  13501. piece.max = piece.end;
  13502. }
  13503. }
  13504. });
  13505. }
  13506. });
  13507. }
  13508. function has2(obj, name) {
  13509. return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);
  13510. }
  13511. // node_modules/echarts/lib/component/visualMap/installCommon.js
  13512. var installed2 = false;
  13513. function installCommon2(registers) {
  13514. if (installed2) {
  13515. return;
  13516. }
  13517. installed2 = true;
  13518. registers.registerSubTypeDefaulter("visualMap", function(option) {
  13519. return !option.categories && (!(option.pieces ? option.pieces.length > 0 : option.splitNumber > 0) || option.calculable) ? "continuous" : "piecewise";
  13520. });
  13521. registers.registerAction(visualMapActionInfo, visualMapActionHander);
  13522. each(visualMapEncodingHandlers, function(handler) {
  13523. registers.registerVisual(registers.PRIORITY.VISUAL.COMPONENT, handler);
  13524. });
  13525. registers.registerPreprocessor(visualMapPreprocessor);
  13526. }
  13527. // node_modules/echarts/lib/component/visualMap/installVisualMapContinuous.js
  13528. function install26(registers) {
  13529. registers.registerComponentModel(ContinuousModel_default);
  13530. registers.registerComponentView(ContinuousView_default);
  13531. installCommon2(registers);
  13532. }
  13533. // node_modules/echarts/lib/component/visualMap/installVisualMapPiecewise.js
  13534. init_define_APP_INFO();
  13535. // node_modules/echarts/lib/component/visualMap/PiecewiseModel.js
  13536. init_define_APP_INFO();
  13537. var PiecewiseModel = function(_super) {
  13538. __extends(PiecewiseModel2, _super);
  13539. function PiecewiseModel2() {
  13540. var _this = _super !== null && _super.apply(this, arguments) || this;
  13541. _this.type = PiecewiseModel2.type;
  13542. _this._pieceList = [];
  13543. return _this;
  13544. }
  13545. PiecewiseModel2.prototype.optionUpdated = function(newOption, isInit) {
  13546. _super.prototype.optionUpdated.apply(this, arguments);
  13547. this.resetExtent();
  13548. var mode = this._mode = this._determineMode();
  13549. this._pieceList = [];
  13550. resetMethods[this._mode].call(this, this._pieceList);
  13551. this._resetSelected(newOption, isInit);
  13552. var categories = this.option.categories;
  13553. this.resetVisual(function(mappingOption, state) {
  13554. if (mode === "categories") {
  13555. mappingOption.mappingMethod = "category";
  13556. mappingOption.categories = clone(categories);
  13557. } else {
  13558. mappingOption.dataExtent = this.getExtent();
  13559. mappingOption.mappingMethod = "piecewise";
  13560. mappingOption.pieceList = map(this._pieceList, function(piece) {
  13561. piece = clone(piece);
  13562. if (state !== "inRange") {
  13563. piece.visual = null;
  13564. }
  13565. return piece;
  13566. });
  13567. }
  13568. });
  13569. };
  13570. PiecewiseModel2.prototype.completeVisualOption = function() {
  13571. var option = this.option;
  13572. var visualTypesInPieces = {};
  13573. var visualTypes = VisualMapping_default.listVisualTypes();
  13574. var isCategory = this.isCategory();
  13575. each(option.pieces, function(piece) {
  13576. each(visualTypes, function(visualType) {
  13577. if (piece.hasOwnProperty(visualType)) {
  13578. visualTypesInPieces[visualType] = 1;
  13579. }
  13580. });
  13581. });
  13582. each(visualTypesInPieces, function(v, visualType) {
  13583. var exists = false;
  13584. each(this.stateList, function(state) {
  13585. exists = exists || has3(option, state, visualType) || has3(option.target, state, visualType);
  13586. }, this);
  13587. !exists && each(this.stateList, function(state) {
  13588. (option[state] || (option[state] = {}))[visualType] = visualDefault_default.get(visualType, state === "inRange" ? "active" : "inactive", isCategory);
  13589. });
  13590. }, this);
  13591. function has3(obj, state, visualType) {
  13592. return obj && obj[state] && obj[state].hasOwnProperty(visualType);
  13593. }
  13594. _super.prototype.completeVisualOption.apply(this, arguments);
  13595. };
  13596. PiecewiseModel2.prototype._resetSelected = function(newOption, isInit) {
  13597. var thisOption = this.option;
  13598. var pieceList = this._pieceList;
  13599. var selected = (isInit ? thisOption : newOption).selected || {};
  13600. thisOption.selected = selected;
  13601. each(pieceList, function(piece, index) {
  13602. var key = this.getSelectedMapKey(piece);
  13603. if (!selected.hasOwnProperty(key)) {
  13604. selected[key] = true;
  13605. }
  13606. }, this);
  13607. if (thisOption.selectedMode === "single") {
  13608. var hasSel_1 = false;
  13609. each(pieceList, function(piece, index) {
  13610. var key = this.getSelectedMapKey(piece);
  13611. if (selected[key]) {
  13612. hasSel_1 ? selected[key] = false : hasSel_1 = true;
  13613. }
  13614. }, this);
  13615. }
  13616. };
  13617. PiecewiseModel2.prototype.getItemSymbol = function() {
  13618. return this.get("itemSymbol");
  13619. };
  13620. PiecewiseModel2.prototype.getSelectedMapKey = function(piece) {
  13621. return this._mode === "categories" ? piece.value + "" : piece.index + "";
  13622. };
  13623. PiecewiseModel2.prototype.getPieceList = function() {
  13624. return this._pieceList;
  13625. };
  13626. PiecewiseModel2.prototype._determineMode = function() {
  13627. var option = this.option;
  13628. return option.pieces && option.pieces.length > 0 ? "pieces" : this.option.categories ? "categories" : "splitNumber";
  13629. };
  13630. PiecewiseModel2.prototype.setSelected = function(selected) {
  13631. this.option.selected = clone(selected);
  13632. };
  13633. PiecewiseModel2.prototype.getValueState = function(value) {
  13634. var index = VisualMapping_default.findPieceIndex(value, this._pieceList);
  13635. return index != null ? this.option.selected[this.getSelectedMapKey(this._pieceList[index])] ? "inRange" : "outOfRange" : "outOfRange";
  13636. };
  13637. PiecewiseModel2.prototype.findTargetDataIndices = function(pieceIndex) {
  13638. var result = [];
  13639. var pieceList = this._pieceList;
  13640. this.eachTargetSeries(function(seriesModel) {
  13641. var dataIndices = [];
  13642. var data = seriesModel.getData();
  13643. data.each(this.getDataDimensionIndex(data), function(value, dataIndex) {
  13644. var pIdx = VisualMapping_default.findPieceIndex(value, pieceList);
  13645. pIdx === pieceIndex && dataIndices.push(dataIndex);
  13646. }, this);
  13647. result.push({
  13648. seriesId: seriesModel.id,
  13649. dataIndex: dataIndices
  13650. });
  13651. }, this);
  13652. return result;
  13653. };
  13654. PiecewiseModel2.prototype.getRepresentValue = function(piece) {
  13655. var representValue;
  13656. if (this.isCategory()) {
  13657. representValue = piece.value;
  13658. } else {
  13659. if (piece.value != null) {
  13660. representValue = piece.value;
  13661. } else {
  13662. var pieceInterval = piece.interval || [];
  13663. representValue = pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity ? 0 : (pieceInterval[0] + pieceInterval[1]) / 2;
  13664. }
  13665. }
  13666. return representValue;
  13667. };
  13668. PiecewiseModel2.prototype.getVisualMeta = function(getColorVisual2) {
  13669. if (this.isCategory()) {
  13670. return;
  13671. }
  13672. var stops = [];
  13673. var outerColors = ["", ""];
  13674. var visualMapModel = this;
  13675. function setStop(interval, valueState) {
  13676. var representValue = visualMapModel.getRepresentValue({
  13677. interval
  13678. });
  13679. if (!valueState) {
  13680. valueState = visualMapModel.getValueState(representValue);
  13681. }
  13682. var color = getColorVisual2(representValue, valueState);
  13683. if (interval[0] === -Infinity) {
  13684. outerColors[0] = color;
  13685. } else if (interval[1] === Infinity) {
  13686. outerColors[1] = color;
  13687. } else {
  13688. stops.push({
  13689. value: interval[0],
  13690. color
  13691. }, {
  13692. value: interval[1],
  13693. color
  13694. });
  13695. }
  13696. }
  13697. var pieceList = this._pieceList.slice();
  13698. if (!pieceList.length) {
  13699. pieceList.push({
  13700. interval: [-Infinity, Infinity]
  13701. });
  13702. } else {
  13703. var edge = pieceList[0].interval[0];
  13704. edge !== -Infinity && pieceList.unshift({
  13705. interval: [-Infinity, edge]
  13706. });
  13707. edge = pieceList[pieceList.length - 1].interval[1];
  13708. edge !== Infinity && pieceList.push({
  13709. interval: [edge, Infinity]
  13710. });
  13711. }
  13712. var curr = -Infinity;
  13713. each(pieceList, function(piece) {
  13714. var interval = piece.interval;
  13715. if (interval) {
  13716. interval[0] > curr && setStop([curr, interval[0]], "outOfRange");
  13717. setStop(interval.slice());
  13718. curr = interval[1];
  13719. }
  13720. }, this);
  13721. return {
  13722. stops,
  13723. outerColors
  13724. };
  13725. };
  13726. PiecewiseModel2.type = "visualMap.piecewise";
  13727. PiecewiseModel2.defaultOption = inheritDefaultOption(VisualMapModel_default.defaultOption, {
  13728. selected: null,
  13729. minOpen: false,
  13730. maxOpen: false,
  13731. align: "auto",
  13732. itemWidth: 20,
  13733. itemHeight: 14,
  13734. itemSymbol: "roundRect",
  13735. pieces: null,
  13736. categories: null,
  13737. splitNumber: 5,
  13738. selectedMode: "multiple",
  13739. itemGap: 10,
  13740. hoverLink: true
  13741. });
  13742. return PiecewiseModel2;
  13743. }(VisualMapModel_default);
  13744. var resetMethods = {
  13745. splitNumber: function(outPieceList) {
  13746. var thisOption = this.option;
  13747. var precision = Math.min(thisOption.precision, 20);
  13748. var dataExtent = this.getExtent();
  13749. var splitNumber = thisOption.splitNumber;
  13750. splitNumber = Math.max(parseInt(splitNumber, 10), 1);
  13751. thisOption.splitNumber = splitNumber;
  13752. var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber;
  13753. while (+splitStep.toFixed(precision) !== splitStep && precision < 5) {
  13754. precision++;
  13755. }
  13756. thisOption.precision = precision;
  13757. splitStep = +splitStep.toFixed(precision);
  13758. if (thisOption.minOpen) {
  13759. outPieceList.push({
  13760. interval: [-Infinity, dataExtent[0]],
  13761. close: [0, 0]
  13762. });
  13763. }
  13764. for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) {
  13765. var max = index === splitNumber - 1 ? dataExtent[1] : curr + splitStep;
  13766. outPieceList.push({
  13767. interval: [curr, max],
  13768. close: [1, 1]
  13769. });
  13770. }
  13771. if (thisOption.maxOpen) {
  13772. outPieceList.push({
  13773. interval: [dataExtent[1], Infinity],
  13774. close: [0, 0]
  13775. });
  13776. }
  13777. reformIntervals(outPieceList);
  13778. each(outPieceList, function(piece, index2) {
  13779. piece.index = index2;
  13780. piece.text = this.formatValueText(piece.interval);
  13781. }, this);
  13782. },
  13783. categories: function(outPieceList) {
  13784. var thisOption = this.option;
  13785. each(thisOption.categories, function(cate) {
  13786. outPieceList.push({
  13787. text: this.formatValueText(cate, true),
  13788. value: cate
  13789. });
  13790. }, this);
  13791. normalizeReverse(thisOption, outPieceList);
  13792. },
  13793. pieces: function(outPieceList) {
  13794. var thisOption = this.option;
  13795. each(thisOption.pieces, function(pieceListItem, index) {
  13796. if (!isObject(pieceListItem)) {
  13797. pieceListItem = {
  13798. value: pieceListItem
  13799. };
  13800. }
  13801. var item = {
  13802. text: "",
  13803. index
  13804. };
  13805. if (pieceListItem.label != null) {
  13806. item.text = pieceListItem.label;
  13807. }
  13808. if (pieceListItem.hasOwnProperty("value")) {
  13809. var value = item.value = pieceListItem.value;
  13810. item.interval = [value, value];
  13811. item.close = [1, 1];
  13812. } else {
  13813. var interval = item.interval = [];
  13814. var close_1 = item.close = [0, 0];
  13815. var closeList = [1, 0, 1];
  13816. var infinityList = [-Infinity, Infinity];
  13817. var useMinMax = [];
  13818. for (var lg = 0; lg < 2; lg++) {
  13819. var names = [["gte", "gt", "min"], ["lte", "lt", "max"]][lg];
  13820. for (var i = 0; i < 3 && interval[lg] == null; i++) {
  13821. interval[lg] = pieceListItem[names[i]];
  13822. close_1[lg] = closeList[i];
  13823. useMinMax[lg] = i === 2;
  13824. }
  13825. interval[lg] == null && (interval[lg] = infinityList[lg]);
  13826. }
  13827. useMinMax[0] && interval[1] === Infinity && (close_1[0] = 0);
  13828. useMinMax[1] && interval[0] === -Infinity && (close_1[1] = 0);
  13829. if (true) {
  13830. if (interval[0] > interval[1]) {
  13831. console.warn("Piece " + index + "is illegal: " + interval + " lower bound should not greater then uppper bound.");
  13832. }
  13833. }
  13834. if (interval[0] === interval[1] && close_1[0] && close_1[1]) {
  13835. item.value = interval[0];
  13836. }
  13837. }
  13838. item.visual = VisualMapping_default.retrieveVisuals(pieceListItem);
  13839. outPieceList.push(item);
  13840. }, this);
  13841. normalizeReverse(thisOption, outPieceList);
  13842. reformIntervals(outPieceList);
  13843. each(outPieceList, function(piece) {
  13844. var close = piece.close;
  13845. var edgeSymbols = [["<", "\u2264"][close[1]], [">", "\u2265"][close[0]]];
  13846. piece.text = piece.text || this.formatValueText(piece.value != null ? piece.value : piece.interval, false, edgeSymbols);
  13847. }, this);
  13848. }
  13849. };
  13850. function normalizeReverse(thisOption, pieceList) {
  13851. var inverse = thisOption.inverse;
  13852. if (thisOption.orient === "vertical" ? !inverse : inverse) {
  13853. pieceList.reverse();
  13854. }
  13855. }
  13856. var PiecewiseModel_default = PiecewiseModel;
  13857. // node_modules/echarts/lib/component/visualMap/PiecewiseView.js
  13858. init_define_APP_INFO();
  13859. var PiecewiseVisualMapView = function(_super) {
  13860. __extends(PiecewiseVisualMapView2, _super);
  13861. function PiecewiseVisualMapView2() {
  13862. var _this = _super !== null && _super.apply(this, arguments) || this;
  13863. _this.type = PiecewiseVisualMapView2.type;
  13864. return _this;
  13865. }
  13866. PiecewiseVisualMapView2.prototype.doRender = function() {
  13867. var thisGroup = this.group;
  13868. thisGroup.removeAll();
  13869. var visualMapModel = this.visualMapModel;
  13870. var textGap = visualMapModel.get("textGap");
  13871. var textStyleModel = visualMapModel.textStyleModel;
  13872. var textFont = textStyleModel.getFont();
  13873. var textFill = textStyleModel.getTextColor();
  13874. var itemAlign = this._getItemAlign();
  13875. var itemSize = visualMapModel.itemSize;
  13876. var viewData = this._getViewData();
  13877. var endsText = viewData.endsText;
  13878. var showLabel = retrieve(visualMapModel.get("showLabel", true), !endsText);
  13879. endsText && this._renderEndsText(thisGroup, endsText[0], itemSize, showLabel, itemAlign);
  13880. each(viewData.viewPieceList, function(item) {
  13881. var piece = item.piece;
  13882. var itemGroup = new Group_default();
  13883. itemGroup.onclick = bind(this._onItemClick, this, piece);
  13884. this._enableHoverLink(itemGroup, item.indexInModelPieceList);
  13885. var representValue = visualMapModel.getRepresentValue(piece);
  13886. this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]]);
  13887. if (showLabel) {
  13888. var visualState = this.visualMapModel.getValueState(representValue);
  13889. itemGroup.add(new Text_default({
  13890. style: {
  13891. x: itemAlign === "right" ? -textGap : itemSize[0] + textGap,
  13892. y: itemSize[1] / 2,
  13893. text: piece.text,
  13894. verticalAlign: "middle",
  13895. align: itemAlign,
  13896. font: textFont,
  13897. fill: textFill,
  13898. opacity: visualState === "outOfRange" ? 0.5 : 1
  13899. }
  13900. }));
  13901. }
  13902. thisGroup.add(itemGroup);
  13903. }, this);
  13904. endsText && this._renderEndsText(thisGroup, endsText[1], itemSize, showLabel, itemAlign);
  13905. box(visualMapModel.get("orient"), thisGroup, visualMapModel.get("itemGap"));
  13906. this.renderBackground(thisGroup);
  13907. this.positionGroup(thisGroup);
  13908. };
  13909. PiecewiseVisualMapView2.prototype._enableHoverLink = function(itemGroup, pieceIndex) {
  13910. var _this = this;
  13911. itemGroup.on("mouseover", function() {
  13912. return onHoverLink("highlight");
  13913. }).on("mouseout", function() {
  13914. return onHoverLink("downplay");
  13915. });
  13916. var onHoverLink = function(method) {
  13917. var visualMapModel = _this.visualMapModel;
  13918. visualMapModel.option.hoverLink && _this.api.dispatchAction({
  13919. type: method,
  13920. batch: makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel)
  13921. });
  13922. };
  13923. };
  13924. PiecewiseVisualMapView2.prototype._getItemAlign = function() {
  13925. var visualMapModel = this.visualMapModel;
  13926. var modelOption = visualMapModel.option;
  13927. if (modelOption.orient === "vertical") {
  13928. return getItemAlign(visualMapModel, this.api, visualMapModel.itemSize);
  13929. } else {
  13930. var align = modelOption.align;
  13931. if (!align || align === "auto") {
  13932. align = "left";
  13933. }
  13934. return align;
  13935. }
  13936. };
  13937. PiecewiseVisualMapView2.prototype._renderEndsText = function(group, text, itemSize, showLabel, itemAlign) {
  13938. if (!text) {
  13939. return;
  13940. }
  13941. var itemGroup = new Group_default();
  13942. var textStyleModel = this.visualMapModel.textStyleModel;
  13943. itemGroup.add(new Text_default({
  13944. style: createTextStyle(textStyleModel, {
  13945. x: showLabel ? itemAlign === "right" ? itemSize[0] : 0 : itemSize[0] / 2,
  13946. y: itemSize[1] / 2,
  13947. verticalAlign: "middle",
  13948. align: showLabel ? itemAlign : "center",
  13949. text
  13950. })
  13951. }));
  13952. group.add(itemGroup);
  13953. };
  13954. PiecewiseVisualMapView2.prototype._getViewData = function() {
  13955. var visualMapModel = this.visualMapModel;
  13956. var viewPieceList = map(visualMapModel.getPieceList(), function(piece, index) {
  13957. return {
  13958. piece,
  13959. indexInModelPieceList: index
  13960. };
  13961. });
  13962. var endsText = visualMapModel.get("text");
  13963. var orient = visualMapModel.get("orient");
  13964. var inverse = visualMapModel.get("inverse");
  13965. if (orient === "horizontal" ? inverse : !inverse) {
  13966. viewPieceList.reverse();
  13967. } else if (endsText) {
  13968. endsText = endsText.slice().reverse();
  13969. }
  13970. return {
  13971. viewPieceList,
  13972. endsText
  13973. };
  13974. };
  13975. PiecewiseVisualMapView2.prototype._createItemSymbol = function(group, representValue, shapeParam) {
  13976. group.add(createSymbol(
  13977. this.getControllerVisual(representValue, "symbol"),
  13978. shapeParam[0],
  13979. shapeParam[1],
  13980. shapeParam[2],
  13981. shapeParam[3],
  13982. this.getControllerVisual(representValue, "color")
  13983. ));
  13984. };
  13985. PiecewiseVisualMapView2.prototype._onItemClick = function(piece) {
  13986. var visualMapModel = this.visualMapModel;
  13987. var option = visualMapModel.option;
  13988. var selectedMode = option.selectedMode;
  13989. if (!selectedMode) {
  13990. return;
  13991. }
  13992. var selected = clone(option.selected);
  13993. var newKey = visualMapModel.getSelectedMapKey(piece);
  13994. if (selectedMode === "single" || selectedMode === true) {
  13995. selected[newKey] = true;
  13996. each(selected, function(o, key) {
  13997. selected[key] = key === newKey;
  13998. });
  13999. } else {
  14000. selected[newKey] = !selected[newKey];
  14001. }
  14002. this.api.dispatchAction({
  14003. type: "selectDataRange",
  14004. from: this.uid,
  14005. visualMapId: this.visualMapModel.id,
  14006. selected
  14007. });
  14008. };
  14009. PiecewiseVisualMapView2.type = "visualMap.piecewise";
  14010. return PiecewiseVisualMapView2;
  14011. }(VisualMapView_default);
  14012. var PiecewiseView_default = PiecewiseVisualMapView;
  14013. // node_modules/echarts/lib/component/visualMap/installVisualMapPiecewise.js
  14014. function install27(registers) {
  14015. registers.registerComponentModel(PiecewiseModel_default);
  14016. registers.registerComponentView(PiecewiseView_default);
  14017. installCommon2(registers);
  14018. }
  14019. // node_modules/echarts/lib/component/visualMap/install.js
  14020. function install28(registers) {
  14021. use(install26);
  14022. use(install27);
  14023. }
  14024. // node_modules/echarts/lib/component/aria/install.js
  14025. init_define_APP_INFO();
  14026. // node_modules/echarts/lib/visual/aria.js
  14027. init_define_APP_INFO();
  14028. var DEFAULT_OPTION = {
  14029. label: {
  14030. enabled: true
  14031. },
  14032. decal: {
  14033. show: false
  14034. }
  14035. };
  14036. var inner12 = makeInner();
  14037. var decalPaletteScope = {};
  14038. function ariaVisual(ecModel, api) {
  14039. var ariaModel = ecModel.getModel("aria");
  14040. if (!ariaModel.get("enabled")) {
  14041. return;
  14042. }
  14043. var defaultOption2 = clone(DEFAULT_OPTION);
  14044. merge(defaultOption2.label, ecModel.getLocaleModel().get("aria"), false);
  14045. merge(ariaModel.option, defaultOption2, false);
  14046. setDecal();
  14047. setLabel();
  14048. function setDecal() {
  14049. var decalModel = ariaModel.getModel("decal");
  14050. var useDecal = decalModel.get("show");
  14051. if (useDecal) {
  14052. var paletteScopeGroupByType_1 = createHashMap();
  14053. ecModel.eachSeries(function(seriesModel) {
  14054. if (seriesModel.isColorBySeries()) {
  14055. return;
  14056. }
  14057. var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);
  14058. if (!decalScope) {
  14059. decalScope = {};
  14060. paletteScopeGroupByType_1.set(seriesModel.type, decalScope);
  14061. }
  14062. inner12(seriesModel).scope = decalScope;
  14063. });
  14064. ecModel.eachRawSeries(function(seriesModel) {
  14065. if (ecModel.isSeriesFiltered(seriesModel)) {
  14066. return;
  14067. }
  14068. if (isFunction(seriesModel.enableAriaDecal)) {
  14069. seriesModel.enableAriaDecal();
  14070. return;
  14071. }
  14072. var data = seriesModel.getData();
  14073. if (!seriesModel.isColorBySeries()) {
  14074. var dataAll_1 = seriesModel.getRawData();
  14075. var idxMap_1 = {};
  14076. var decalScope_1 = inner12(seriesModel).scope;
  14077. data.each(function(idx) {
  14078. var rawIdx = data.getRawIndex(idx);
  14079. idxMap_1[rawIdx] = idx;
  14080. });
  14081. var dataCount_1 = dataAll_1.count();
  14082. dataAll_1.each(function(rawIdx) {
  14083. var idx = idxMap_1[rawIdx];
  14084. var name = dataAll_1.getName(rawIdx) || rawIdx + "";
  14085. var paletteDecal2 = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);
  14086. var specifiedDecal2 = data.getItemVisual(idx, "decal");
  14087. data.setItemVisual(idx, "decal", mergeDecal(specifiedDecal2, paletteDecal2));
  14088. });
  14089. } else {
  14090. var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());
  14091. var specifiedDecal = data.getVisual("decal");
  14092. data.setVisual("decal", mergeDecal(specifiedDecal, paletteDecal));
  14093. }
  14094. function mergeDecal(specifiedDecal2, paletteDecal2) {
  14095. var resultDecal = specifiedDecal2 ? extend(extend({}, paletteDecal2), specifiedDecal2) : paletteDecal2;
  14096. resultDecal.dirty = true;
  14097. return resultDecal;
  14098. }
  14099. });
  14100. }
  14101. }
  14102. function setLabel() {
  14103. var labelLocale = ecModel.getLocaleModel().get("aria");
  14104. var labelModel = ariaModel.getModel("label");
  14105. labelModel.option = defaults(labelModel.option, labelLocale);
  14106. if (!labelModel.get("enabled")) {
  14107. return;
  14108. }
  14109. var dom = api.getZr().dom;
  14110. if (labelModel.get("description")) {
  14111. dom.setAttribute("aria-label", labelModel.get("description"));
  14112. return;
  14113. }
  14114. var seriesCnt = ecModel.getSeriesCount();
  14115. var maxDataCnt = labelModel.get(["data", "maxCount"]) || 10;
  14116. var maxSeriesCnt = labelModel.get(["series", "maxCount"]) || 10;
  14117. var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);
  14118. var ariaLabel;
  14119. if (seriesCnt < 1) {
  14120. return;
  14121. } else {
  14122. var title = getTitle();
  14123. if (title) {
  14124. var withTitle = labelModel.get(["general", "withTitle"]);
  14125. ariaLabel = replace(withTitle, {
  14126. title
  14127. });
  14128. } else {
  14129. ariaLabel = labelModel.get(["general", "withoutTitle"]);
  14130. }
  14131. var seriesLabels_1 = [];
  14132. var prefix = seriesCnt > 1 ? labelModel.get(["series", "multiple", "prefix"]) : labelModel.get(["series", "single", "prefix"]);
  14133. ariaLabel += replace(prefix, {
  14134. seriesCount: seriesCnt
  14135. });
  14136. ecModel.eachSeries(function(seriesModel, idx) {
  14137. if (idx < displaySeriesCnt) {
  14138. var seriesLabel = void 0;
  14139. var seriesName = seriesModel.get("name");
  14140. var withName = seriesName ? "withName" : "withoutName";
  14141. seriesLabel = seriesCnt > 1 ? labelModel.get(["series", "multiple", withName]) : labelModel.get(["series", "single", withName]);
  14142. seriesLabel = replace(seriesLabel, {
  14143. seriesId: seriesModel.seriesIndex,
  14144. seriesName: seriesModel.get("name"),
  14145. seriesType: getSeriesTypeName(seriesModel.subType)
  14146. });
  14147. var data = seriesModel.getData();
  14148. if (data.count() > maxDataCnt) {
  14149. var partialLabel = labelModel.get(["data", "partialData"]);
  14150. seriesLabel += replace(partialLabel, {
  14151. displayCnt: maxDataCnt
  14152. });
  14153. } else {
  14154. seriesLabel += labelModel.get(["data", "allData"]);
  14155. }
  14156. var middleSeparator_1 = labelModel.get(["data", "separator", "middle"]);
  14157. var endSeparator_1 = labelModel.get(["data", "separator", "end"]);
  14158. var dataLabels = [];
  14159. for (var i = 0; i < data.count(); i++) {
  14160. if (i < maxDataCnt) {
  14161. var name_1 = data.getName(i);
  14162. var value = data.getValues(i);
  14163. var dataLabel = labelModel.get(["data", name_1 ? "withName" : "withoutName"]);
  14164. dataLabels.push(replace(dataLabel, {
  14165. name: name_1,
  14166. value: value.join(middleSeparator_1)
  14167. }));
  14168. }
  14169. }
  14170. seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;
  14171. seriesLabels_1.push(seriesLabel);
  14172. }
  14173. });
  14174. var separatorModel = labelModel.getModel(["series", "multiple", "separator"]);
  14175. var middleSeparator = separatorModel.get("middle");
  14176. var endSeparator = separatorModel.get("end");
  14177. ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;
  14178. dom.setAttribute("aria-label", ariaLabel);
  14179. }
  14180. }
  14181. function replace(str, keyValues) {
  14182. if (!isString(str)) {
  14183. return str;
  14184. }
  14185. var result = str;
  14186. each(keyValues, function(value, key) {
  14187. result = result.replace(new RegExp("\\{\\s*" + key + "\\s*\\}", "g"), value);
  14188. });
  14189. return result;
  14190. }
  14191. function getTitle() {
  14192. var title = ecModel.get("title");
  14193. if (title && title.length) {
  14194. title = title[0];
  14195. }
  14196. return title && title.text;
  14197. }
  14198. function getSeriesTypeName(type) {
  14199. return ecModel.getLocaleModel().get(["series", "typeNames"])[type] || "\u81EA\u5B9A\u4E49\u56FE";
  14200. }
  14201. }
  14202. // node_modules/echarts/lib/component/aria/preprocessor.js
  14203. init_define_APP_INFO();
  14204. function ariaPreprocessor(option) {
  14205. if (!option || !option.aria) {
  14206. return;
  14207. }
  14208. var aria = option.aria;
  14209. if (aria.show != null) {
  14210. aria.enabled = aria.show;
  14211. }
  14212. aria.label = aria.label || {};
  14213. each(["description", "general", "series", "data"], function(name) {
  14214. if (aria[name] != null) {
  14215. aria.label[name] = aria[name];
  14216. }
  14217. });
  14218. }
  14219. // node_modules/echarts/lib/component/aria/install.js
  14220. function install29(registers) {
  14221. registers.registerPreprocessor(ariaPreprocessor);
  14222. registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual);
  14223. }
  14224. // node_modules/echarts/lib/component/transform/install.js
  14225. init_define_APP_INFO();
  14226. // node_modules/echarts/lib/component/transform/filterTransform.js
  14227. init_define_APP_INFO();
  14228. // node_modules/echarts/lib/util/conditionalExpression.js
  14229. init_define_APP_INFO();
  14230. var RELATIONAL_EXPRESSION_OP_ALIAS_MAP = {
  14231. value: "eq",
  14232. "<": "lt",
  14233. "<=": "lte",
  14234. ">": "gt",
  14235. ">=": "gte",
  14236. "=": "eq",
  14237. "!=": "ne",
  14238. "<>": "ne"
  14239. };
  14240. var RegExpEvaluator = function() {
  14241. function RegExpEvaluator2(rVal) {
  14242. var condValue = this._condVal = isString(rVal) ? new RegExp(rVal) : isRegExp(rVal) ? rVal : null;
  14243. if (condValue == null) {
  14244. var errMsg = "";
  14245. if (true) {
  14246. errMsg = makePrintable("Illegal regexp", rVal, "in");
  14247. }
  14248. throwError(errMsg);
  14249. }
  14250. }
  14251. RegExpEvaluator2.prototype.evaluate = function(lVal) {
  14252. var type = typeof lVal;
  14253. return isString(type) ? this._condVal.test(lVal) : isNumber(type) ? this._condVal.test(lVal + "") : false;
  14254. };
  14255. return RegExpEvaluator2;
  14256. }();
  14257. var ConstConditionInternal = function() {
  14258. function ConstConditionInternal2() {
  14259. }
  14260. ConstConditionInternal2.prototype.evaluate = function() {
  14261. return this.value;
  14262. };
  14263. return ConstConditionInternal2;
  14264. }();
  14265. var AndConditionInternal = function() {
  14266. function AndConditionInternal2() {
  14267. }
  14268. AndConditionInternal2.prototype.evaluate = function() {
  14269. var children = this.children;
  14270. for (var i = 0; i < children.length; i++) {
  14271. if (!children[i].evaluate()) {
  14272. return false;
  14273. }
  14274. }
  14275. return true;
  14276. };
  14277. return AndConditionInternal2;
  14278. }();
  14279. var OrConditionInternal = function() {
  14280. function OrConditionInternal2() {
  14281. }
  14282. OrConditionInternal2.prototype.evaluate = function() {
  14283. var children = this.children;
  14284. for (var i = 0; i < children.length; i++) {
  14285. if (children[i].evaluate()) {
  14286. return true;
  14287. }
  14288. }
  14289. return false;
  14290. };
  14291. return OrConditionInternal2;
  14292. }();
  14293. var NotConditionInternal = function() {
  14294. function NotConditionInternal2() {
  14295. }
  14296. NotConditionInternal2.prototype.evaluate = function() {
  14297. return !this.child.evaluate();
  14298. };
  14299. return NotConditionInternal2;
  14300. }();
  14301. var RelationalConditionInternal = function() {
  14302. function RelationalConditionInternal2() {
  14303. }
  14304. RelationalConditionInternal2.prototype.evaluate = function() {
  14305. var needParse = !!this.valueParser;
  14306. var getValue = this.getValue;
  14307. var tarValRaw = getValue(this.valueGetterParam);
  14308. var tarValParsed = needParse ? this.valueParser(tarValRaw) : null;
  14309. for (var i = 0; i < this.subCondList.length; i++) {
  14310. if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) {
  14311. return false;
  14312. }
  14313. }
  14314. return true;
  14315. };
  14316. return RelationalConditionInternal2;
  14317. }();
  14318. function parseOption(exprOption, getters) {
  14319. if (exprOption === true || exprOption === false) {
  14320. var cond = new ConstConditionInternal();
  14321. cond.value = exprOption;
  14322. return cond;
  14323. }
  14324. var errMsg = "";
  14325. if (!isObjectNotArray(exprOption)) {
  14326. if (true) {
  14327. errMsg = makePrintable("Illegal config. Expect a plain object but actually", exprOption);
  14328. }
  14329. throwError(errMsg);
  14330. }
  14331. if (exprOption.and) {
  14332. return parseAndOrOption("and", exprOption, getters);
  14333. } else if (exprOption.or) {
  14334. return parseAndOrOption("or", exprOption, getters);
  14335. } else if (exprOption.not) {
  14336. return parseNotOption(exprOption, getters);
  14337. }
  14338. return parseRelationalOption(exprOption, getters);
  14339. }
  14340. function parseAndOrOption(op, exprOption, getters) {
  14341. var subOptionArr = exprOption[op];
  14342. var errMsg = "";
  14343. if (true) {
  14344. errMsg = makePrintable('"and"/"or" condition should only be `' + op + ": [...]` and must not be empty array.", "Illegal condition:", exprOption);
  14345. }
  14346. if (!isArray(subOptionArr)) {
  14347. throwError(errMsg);
  14348. }
  14349. if (!subOptionArr.length) {
  14350. throwError(errMsg);
  14351. }
  14352. var cond = op === "and" ? new AndConditionInternal() : new OrConditionInternal();
  14353. cond.children = map(subOptionArr, function(subOption) {
  14354. return parseOption(subOption, getters);
  14355. });
  14356. if (!cond.children.length) {
  14357. throwError(errMsg);
  14358. }
  14359. return cond;
  14360. }
  14361. function parseNotOption(exprOption, getters) {
  14362. var subOption = exprOption.not;
  14363. var errMsg = "";
  14364. if (true) {
  14365. errMsg = makePrintable('"not" condition should only be `not: {}`.', "Illegal condition:", exprOption);
  14366. }
  14367. if (!isObjectNotArray(subOption)) {
  14368. throwError(errMsg);
  14369. }
  14370. var cond = new NotConditionInternal();
  14371. cond.child = parseOption(subOption, getters);
  14372. if (!cond.child) {
  14373. throwError(errMsg);
  14374. }
  14375. return cond;
  14376. }
  14377. function parseRelationalOption(exprOption, getters) {
  14378. var errMsg = "";
  14379. var valueGetterParam = getters.prepareGetValue(exprOption);
  14380. var subCondList = [];
  14381. var exprKeys = keys(exprOption);
  14382. var parserName = exprOption.parser;
  14383. var valueParser = parserName ? getRawValueParser(parserName) : null;
  14384. for (var i = 0; i < exprKeys.length; i++) {
  14385. var keyRaw = exprKeys[i];
  14386. if (keyRaw === "parser" || getters.valueGetterAttrMap.get(keyRaw)) {
  14387. continue;
  14388. }
  14389. var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw;
  14390. var condValueRaw = exprOption[keyRaw];
  14391. var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw;
  14392. var evaluator = createFilterComparator(op, condValueParsed) || op === "reg" && new RegExpEvaluator(condValueParsed);
  14393. if (!evaluator) {
  14394. if (true) {
  14395. errMsg = makePrintable('Illegal relational operation: "' + keyRaw + '" in condition:', exprOption);
  14396. }
  14397. throwError(errMsg);
  14398. }
  14399. subCondList.push(evaluator);
  14400. }
  14401. if (!subCondList.length) {
  14402. if (true) {
  14403. errMsg = makePrintable("Relational condition must have at least one operator.", "Illegal condition:", exprOption);
  14404. }
  14405. throwError(errMsg);
  14406. }
  14407. var cond = new RelationalConditionInternal();
  14408. cond.valueGetterParam = valueGetterParam;
  14409. cond.valueParser = valueParser;
  14410. cond.getValue = getters.getValue;
  14411. cond.subCondList = subCondList;
  14412. return cond;
  14413. }
  14414. function isObjectNotArray(val) {
  14415. return isObject(val) && !isArrayLike(val);
  14416. }
  14417. var ConditionalExpressionParsed = function() {
  14418. function ConditionalExpressionParsed2(exprOption, getters) {
  14419. this._cond = parseOption(exprOption, getters);
  14420. }
  14421. ConditionalExpressionParsed2.prototype.evaluate = function() {
  14422. return this._cond.evaluate();
  14423. };
  14424. return ConditionalExpressionParsed2;
  14425. }();
  14426. function parseConditionalExpression(exprOption, getters) {
  14427. return new ConditionalExpressionParsed(exprOption, getters);
  14428. }
  14429. // node_modules/echarts/lib/component/transform/filterTransform.js
  14430. var filterTransform = {
  14431. type: "echarts:filter",
  14432. transform: function(params) {
  14433. var upstream = params.upstream;
  14434. var rawItem;
  14435. var condition = parseConditionalExpression(params.config, {
  14436. valueGetterAttrMap: createHashMap({
  14437. dimension: true
  14438. }),
  14439. prepareGetValue: function(exprOption) {
  14440. var errMsg = "";
  14441. var dimLoose = exprOption.dimension;
  14442. if (!hasOwn(exprOption, "dimension")) {
  14443. if (true) {
  14444. errMsg = makePrintable('Relation condition must has prop "dimension" specified.', "Illegal condition:", exprOption);
  14445. }
  14446. throwError(errMsg);
  14447. }
  14448. var dimInfo = upstream.getDimensionInfo(dimLoose);
  14449. if (!dimInfo) {
  14450. if (true) {
  14451. errMsg = makePrintable("Can not find dimension info via: " + dimLoose + ".\n", "Existing dimensions: ", upstream.cloneAllDimensionInfo(), ".\n", "Illegal condition:", exprOption, ".\n");
  14452. }
  14453. throwError(errMsg);
  14454. }
  14455. return {
  14456. dimIdx: dimInfo.index
  14457. };
  14458. },
  14459. getValue: function(param) {
  14460. return upstream.retrieveValueFromItem(rawItem, param.dimIdx);
  14461. }
  14462. });
  14463. var resultData = [];
  14464. for (var i = 0, len = upstream.count(); i < len; i++) {
  14465. rawItem = upstream.getRawDataItem(i);
  14466. if (condition.evaluate()) {
  14467. resultData.push(rawItem);
  14468. }
  14469. }
  14470. return {
  14471. data: resultData
  14472. };
  14473. }
  14474. };
  14475. // node_modules/echarts/lib/component/transform/sortTransform.js
  14476. init_define_APP_INFO();
  14477. var sampleLog = "";
  14478. if (true) {
  14479. sampleLog = ["Valid config is like:", '{ dimension: "age", order: "asc" }', 'or [{ dimension: "age", order: "asc"], { dimension: "date", order: "desc" }]'].join(" ");
  14480. }
  14481. var sortTransform = {
  14482. type: "echarts:sort",
  14483. transform: function(params) {
  14484. var upstream = params.upstream;
  14485. var config = params.config;
  14486. var errMsg = "";
  14487. var orderExprList = normalizeToArray(config);
  14488. if (!orderExprList.length) {
  14489. if (true) {
  14490. errMsg = "Empty `config` in sort transform.";
  14491. }
  14492. throwError(errMsg);
  14493. }
  14494. var orderDefList = [];
  14495. each(orderExprList, function(orderExpr) {
  14496. var dimLoose = orderExpr.dimension;
  14497. var order = orderExpr.order;
  14498. var parserName = orderExpr.parser;
  14499. var incomparable = orderExpr.incomparable;
  14500. if (dimLoose == null) {
  14501. if (true) {
  14502. errMsg = 'Sort transform config must has "dimension" specified.' + sampleLog;
  14503. }
  14504. throwError(errMsg);
  14505. }
  14506. if (order !== "asc" && order !== "desc") {
  14507. if (true) {
  14508. errMsg = 'Sort transform config must has "order" specified.' + sampleLog;
  14509. }
  14510. throwError(errMsg);
  14511. }
  14512. if (incomparable && incomparable !== "min" && incomparable !== "max") {
  14513. var errMsg_1 = "";
  14514. if (true) {
  14515. errMsg_1 = 'incomparable must be "min" or "max" rather than "' + incomparable + '".';
  14516. }
  14517. throwError(errMsg_1);
  14518. }
  14519. if (order !== "asc" && order !== "desc") {
  14520. var errMsg_2 = "";
  14521. if (true) {
  14522. errMsg_2 = 'order must be "asc" or "desc" rather than "' + order + '".';
  14523. }
  14524. throwError(errMsg_2);
  14525. }
  14526. var dimInfo = upstream.getDimensionInfo(dimLoose);
  14527. if (!dimInfo) {
  14528. if (true) {
  14529. errMsg = makePrintable("Can not find dimension info via: " + dimLoose + ".\n", "Existing dimensions: ", upstream.cloneAllDimensionInfo(), ".\n", "Illegal config:", orderExpr, ".\n");
  14530. }
  14531. throwError(errMsg);
  14532. }
  14533. var parser = parserName ? getRawValueParser(parserName) : null;
  14534. if (parserName && !parser) {
  14535. if (true) {
  14536. errMsg = makePrintable("Invalid parser name " + parserName + ".\n", "Illegal config:", orderExpr, ".\n");
  14537. }
  14538. throwError(errMsg);
  14539. }
  14540. orderDefList.push({
  14541. dimIdx: dimInfo.index,
  14542. parser,
  14543. comparator: new SortOrderComparator(order, incomparable)
  14544. });
  14545. });
  14546. var sourceFormat = upstream.sourceFormat;
  14547. if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {
  14548. if (true) {
  14549. errMsg = 'sourceFormat "' + sourceFormat + '" is not supported yet';
  14550. }
  14551. throwError(errMsg);
  14552. }
  14553. var resultData = [];
  14554. for (var i = 0, len = upstream.count(); i < len; i++) {
  14555. resultData.push(upstream.getRawDataItem(i));
  14556. }
  14557. resultData.sort(function(item0, item1) {
  14558. for (var i2 = 0; i2 < orderDefList.length; i2++) {
  14559. var orderDef = orderDefList[i2];
  14560. var val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx);
  14561. var val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx);
  14562. if (orderDef.parser) {
  14563. val0 = orderDef.parser(val0);
  14564. val1 = orderDef.parser(val1);
  14565. }
  14566. var result = orderDef.comparator.evaluate(val0, val1);
  14567. if (result !== 0) {
  14568. return result;
  14569. }
  14570. }
  14571. return 0;
  14572. });
  14573. return {
  14574. data: resultData
  14575. };
  14576. }
  14577. };
  14578. // node_modules/echarts/lib/component/transform/install.js
  14579. function install30(registers) {
  14580. registers.registerTransform(filterTransform);
  14581. registers.registerTransform(sortTransform);
  14582. }
  14583. // node_modules/echarts/lib/component/dataset/install.js
  14584. init_define_APP_INFO();
  14585. var DatasetModel = function(_super) {
  14586. __extends(DatasetModel2, _super);
  14587. function DatasetModel2() {
  14588. var _this = _super !== null && _super.apply(this, arguments) || this;
  14589. _this.type = "dataset";
  14590. return _this;
  14591. }
  14592. DatasetModel2.prototype.init = function(option, parentModel, ecModel) {
  14593. _super.prototype.init.call(this, option, parentModel, ecModel);
  14594. this._sourceManager = new SourceManager(this);
  14595. disableTransformOptionMerge(this);
  14596. };
  14597. DatasetModel2.prototype.mergeOption = function(newOption, ecModel) {
  14598. _super.prototype.mergeOption.call(this, newOption, ecModel);
  14599. disableTransformOptionMerge(this);
  14600. };
  14601. DatasetModel2.prototype.optionUpdated = function() {
  14602. this._sourceManager.dirty();
  14603. };
  14604. DatasetModel2.prototype.getSourceManager = function() {
  14605. return this._sourceManager;
  14606. };
  14607. DatasetModel2.type = "dataset";
  14608. DatasetModel2.defaultOption = {
  14609. seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN
  14610. };
  14611. return DatasetModel2;
  14612. }(Component_default);
  14613. var DatasetView = function(_super) {
  14614. __extends(DatasetView2, _super);
  14615. function DatasetView2() {
  14616. var _this = _super !== null && _super.apply(this, arguments) || this;
  14617. _this.type = "dataset";
  14618. return _this;
  14619. }
  14620. DatasetView2.type = "dataset";
  14621. return DatasetView2;
  14622. }(Component_default2);
  14623. function install31(registers) {
  14624. registers.registerComponentModel(DatasetModel);
  14625. registers.registerComponentView(DatasetView);
  14626. }
  14627. export {
  14628. install29 as AriaComponent,
  14629. install5 as AxisPointerComponent,
  14630. install14 as BrushComponent,
  14631. install9 as CalendarComponent,
  14632. install25 as DataZoomComponent,
  14633. install23 as DataZoomInsideComponent,
  14634. install24 as DataZoomSliderComponent,
  14635. install31 as DatasetComponent,
  14636. install3 as GeoComponent,
  14637. install10 as GraphicComponent,
  14638. install6 as GridComponent,
  14639. install as GridSimpleComponent,
  14640. install22 as LegendComponent,
  14641. install20 as LegendPlainComponent,
  14642. install21 as LegendScrollComponent,
  14643. install19 as MarkAreaComponent,
  14644. install18 as MarkLineComponent,
  14645. install17 as MarkPointComponent,
  14646. install4 as ParallelComponent,
  14647. install7 as PolarComponent,
  14648. install2 as RadarComponent,
  14649. install8 as SingleAxisComponent,
  14650. install16 as TimelineComponent,
  14651. install15 as TitleComponent,
  14652. install12 as ToolboxComponent,
  14653. install13 as TooltipComponent,
  14654. install30 as TransformComponent,
  14655. install28 as VisualMapComponent,
  14656. install26 as VisualMapContinuousComponent,
  14657. install27 as VisualMapPiecewiseComponent
  14658. };
  14659. //# sourceMappingURL=echarts_components.js.map