123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853 |
- import {
- AxisBuilder_default,
- AxisView_default,
- BrushController_default,
- LineDraw_default,
- RoamController_default,
- SymbolDraw_default,
- VisualMapping_default,
- applyKeyframeAnimation,
- applyLeaveTransition,
- applyUpdateTransition,
- axisModelCreator,
- collect,
- convertFromEC4CompatibleStyle,
- getAxisInfo,
- install,
- install2,
- install3,
- install4,
- isCoordinateSystemType,
- isEC4CompatibleStyle,
- isTransitionAll,
- layout,
- makeKey,
- makeLinearBrushOtherExtent,
- makeRectIsTargetByCursor,
- makeRectPanelClipPath,
- rectCoordAxisBuildSplitArea,
- rectCoordAxisHandleRemove,
- sliderMove,
- stopPreviousKeyframeAnimationAndRestore,
- updateLeaveTo
- } from "./chunk-43FE5UYX.js";
- import {
- AxisModelCommonMixin,
- Axis_default,
- Circle_default,
- Component_default,
- Component_default2,
- DataDiffer_default,
- DataFormatMixin,
- Group_default,
- Interval_default,
- LOCATION_PARAMS,
- Line_default,
- LinearGradient_default,
- MULTIPLE_REFERRING,
- Model_default,
- Ordinal_default,
- Polygon_default,
- Polyline_default,
- Ring_default,
- SERIES_LAYOUT_BY_COLUMN,
- SINGLE_REFERRING,
- SOURCE_FORMAT_ARRAY_ROWS,
- SOURCE_FORMAT_OBJECT_ROWS,
- Sector_default,
- SeriesData_default,
- SortOrderComparator,
- SourceManager,
- Time_default,
- TooltipMarkupStyleCreator,
- __extends,
- addEventListener,
- applyTransform,
- asc,
- box,
- buildTooltipMarkup,
- clear,
- compressBatches,
- contain,
- convertOptionIdName,
- convertToColorString,
- copyLayoutParams,
- createFilterComparator,
- createIcon,
- createOrUpdate,
- createOrUpdatePatternFromDecal,
- createScaleByModel,
- createSymbol,
- createTextStyle,
- createTooltipMarkup,
- defaultEmphasis,
- deprecateLog,
- disableTransformOptionMerge,
- enableHoverEmphasis,
- ensureScaleRawExtentInfo,
- enterBlur,
- enterEmphasis,
- findEventDispatcher,
- format,
- formatTpl,
- formatTplSimple,
- getAxisRawValue,
- getDataDimensionsOnAxis,
- getDataItemValue,
- getDecalFromPalette,
- getECData,
- getItemVisualFromData,
- getLabelStatesModels,
- getLayoutParams,
- getLayoutRect,
- getLocaleModel,
- getPaddingFromTooltipModel,
- getPixelPrecision,
- getPrecision,
- getRawValueParser,
- getShapeClass,
- getStackedDimension,
- getTooltipRenderMode,
- getTransform,
- getUID,
- getVisualFromData,
- graphic_exports,
- groupTransition,
- inheritDefaultOption,
- isDimensionStacked,
- isNameSpecified,
- leaveBlur,
- leaveEmphasis,
- linePolygonIntersect,
- linearMap,
- makeInner,
- makeInternalComponentId,
- makePrintable,
- mappingToExists,
- mergeLayoutParam,
- mergePath,
- niceScaleExtent,
- normalizeCssArray,
- normalizeEvent,
- normalizeSymbolOffset,
- normalizeSymbolSize,
- normalizeToArray,
- normalizeTooltipFormatResult,
- parseDataValue,
- parseDate,
- parseFinder,
- parsePercent as parsePercent2,
- positionElement,
- preParseFinder,
- queryDataIndex,
- queryReferringComponents,
- reformIntervals,
- registerAction,
- registerInternalOptionCreator,
- setAsHighDownDispatcher,
- setItemVisualFromData,
- setLabelStyle,
- setStatesStylesFromModel,
- setTooltipConfig,
- sizeCalculable,
- stop,
- symbolBuildProxies,
- throwError,
- toCamelCase,
- toggleHoverEmphasis,
- transformDirection,
- transformLocalCoord,
- unionAxisExtentFromData,
- updateProps,
- use,
- warn,
- windowOpen
- } from "./chunk-4Z63X5VE.js";
- import {
- BoundingRect_default,
- Displayable_default,
- Image_default,
- Point_default,
- Rect_default,
- Text_default,
- assert,
- bind,
- clone,
- create,
- createHashMap,
- curry,
- defaults,
- each,
- env_default,
- extend,
- filter,
- getBoundingRect,
- hasOwn,
- indexOf,
- isArray,
- isArrayLike,
- isDom,
- isFunction,
- isNumber,
- isObject,
- isRegExp,
- isString,
- keys,
- logError,
- map,
- merge,
- mergeAll,
- mixin,
- modifyAlpha,
- noop,
- parse,
- parsePercent,
- retrieve,
- retrieve2,
- rotate,
- stringify,
- translate,
- trim
- } from "./chunk-NFL6MJ5K.js";
- import {
- init_define_APP_INFO
- } from "./chunk-XY75H3MP.js";
- // dep:echarts_components
- init_define_APP_INFO();
- // node_modules/echarts/components.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/export/components.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/grid/install.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/axisPointer/install.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/axisPointer/CartesianAxisPointer.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/axisPointer/BaseAxisPointer.js
- init_define_APP_INFO();
- var inner = makeInner();
- var clone2 = clone;
- var bind2 = bind;
- var BaseAxisPointer = function() {
- function BaseAxisPointer2() {
- this._dragging = false;
- this.animationThreshold = 15;
- }
- BaseAxisPointer2.prototype.render = function(axisModel, axisPointerModel, api, forceRender) {
- var value = axisPointerModel.get("value");
- var status = axisPointerModel.get("status");
- this._axisModel = axisModel;
- this._axisPointerModel = axisPointerModel;
- this._api = api;
- if (!forceRender && this._lastValue === value && this._lastStatus === status) {
- return;
- }
- this._lastValue = value;
- this._lastStatus = status;
- var group = this._group;
- var handle = this._handle;
- if (!status || status === "hide") {
- group && group.hide();
- handle && handle.hide();
- return;
- }
- group && group.show();
- handle && handle.show();
- var elOption = {};
- this.makeElOption(elOption, value, axisModel, axisPointerModel, api);
- var graphicKey = elOption.graphicKey;
- if (graphicKey !== this._lastGraphicKey) {
- this.clear(api);
- }
- this._lastGraphicKey = graphicKey;
- var moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel);
- if (!group) {
- group = this._group = new Group_default();
- this.createPointerEl(group, elOption, axisModel, axisPointerModel);
- this.createLabelEl(group, elOption, axisModel, axisPointerModel);
- api.getZr().add(group);
- } else {
- var doUpdateProps = curry(updateProps2, axisPointerModel, moveAnimation);
- this.updatePointerEl(group, elOption, doUpdateProps);
- this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);
- }
- updateMandatoryProps(group, axisPointerModel, true);
- this._renderHandle(value);
- };
- BaseAxisPointer2.prototype.remove = function(api) {
- this.clear(api);
- };
- BaseAxisPointer2.prototype.dispose = function(api) {
- this.clear(api);
- };
- BaseAxisPointer2.prototype.determineAnimation = function(axisModel, axisPointerModel) {
- var animation = axisPointerModel.get("animation");
- var axis = axisModel.axis;
- var isCategoryAxis = axis.type === "category";
- var useSnap = axisPointerModel.get("snap");
- if (!useSnap && !isCategoryAxis) {
- return false;
- }
- if (animation === "auto" || animation == null) {
- var animationThreshold = this.animationThreshold;
- if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {
- return true;
- }
- if (useSnap) {
- var seriesDataCount = getAxisInfo(axisModel).seriesDataCount;
- var axisExtent = axis.getExtent();
- return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;
- }
- return false;
- }
- return animation === true;
- };
- BaseAxisPointer2.prototype.makeElOption = function(elOption, value, axisModel, axisPointerModel, api) {
- };
- BaseAxisPointer2.prototype.createPointerEl = function(group, elOption, axisModel, axisPointerModel) {
- var pointerOption = elOption.pointer;
- if (pointerOption) {
- var pointerEl = inner(group).pointerEl = new graphic_exports[pointerOption.type](clone2(elOption.pointer));
- group.add(pointerEl);
- }
- };
- BaseAxisPointer2.prototype.createLabelEl = function(group, elOption, axisModel, axisPointerModel) {
- if (elOption.label) {
- var labelEl = inner(group).labelEl = new Text_default(clone2(elOption.label));
- group.add(labelEl);
- updateLabelShowHide(labelEl, axisPointerModel);
- }
- };
- BaseAxisPointer2.prototype.updatePointerEl = function(group, elOption, updateProps3) {
- var pointerEl = inner(group).pointerEl;
- if (pointerEl && elOption.pointer) {
- pointerEl.setStyle(elOption.pointer.style);
- updateProps3(pointerEl, {
- shape: elOption.pointer.shape
- });
- }
- };
- BaseAxisPointer2.prototype.updateLabelEl = function(group, elOption, updateProps3, axisPointerModel) {
- var labelEl = inner(group).labelEl;
- if (labelEl) {
- labelEl.setStyle(elOption.label.style);
- updateProps3(labelEl, {
- x: elOption.label.x,
- y: elOption.label.y
- });
- updateLabelShowHide(labelEl, axisPointerModel);
- }
- };
- BaseAxisPointer2.prototype._renderHandle = function(value) {
- if (this._dragging || !this.updateHandleTransform) {
- return;
- }
- var axisPointerModel = this._axisPointerModel;
- var zr = this._api.getZr();
- var handle = this._handle;
- var handleModel = axisPointerModel.getModel("handle");
- var status = axisPointerModel.get("status");
- if (!handleModel.get("show") || !status || status === "hide") {
- handle && zr.remove(handle);
- this._handle = null;
- return;
- }
- var isInit;
- if (!this._handle) {
- isInit = true;
- handle = this._handle = createIcon(handleModel.get("icon"), {
- cursor: "move",
- draggable: true,
- onmousemove: function(e) {
- stop(e.event);
- },
- onmousedown: bind2(this._onHandleDragMove, this, 0, 0),
- drift: bind2(this._onHandleDragMove, this),
- ondragend: bind2(this._onHandleDragEnd, this)
- });
- zr.add(handle);
- }
- updateMandatoryProps(handle, axisPointerModel, false);
- handle.setStyle(handleModel.getItemStyle(null, ["color", "borderColor", "borderWidth", "opacity", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"]));
- var handleSize = handleModel.get("size");
- if (!isArray(handleSize)) {
- handleSize = [handleSize, handleSize];
- }
- handle.scaleX = handleSize[0] / 2;
- handle.scaleY = handleSize[1] / 2;
- createOrUpdate(this, "_doDispatchAxisPointer", handleModel.get("throttle") || 0, "fixRate");
- this._moveHandleToValue(value, isInit);
- };
- BaseAxisPointer2.prototype._moveHandleToValue = function(value, isInit) {
- updateProps2(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));
- };
- BaseAxisPointer2.prototype._onHandleDragMove = function(dx, dy) {
- var handle = this._handle;
- if (!handle) {
- return;
- }
- this._dragging = true;
- var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);
- this._payloadInfo = trans;
- handle.stopAnimation();
- handle.attr(getHandleTransProps(trans));
- inner(handle).lastProp = null;
- this._doDispatchAxisPointer();
- };
- BaseAxisPointer2.prototype._doDispatchAxisPointer = function() {
- var handle = this._handle;
- if (!handle) {
- return;
- }
- var payloadInfo = this._payloadInfo;
- var axisModel = this._axisModel;
- this._api.dispatchAction({
- type: "updateAxisPointer",
- x: payloadInfo.cursorPoint[0],
- y: payloadInfo.cursorPoint[1],
- tooltipOption: payloadInfo.tooltipOption,
- axesInfo: [{
- axisDim: axisModel.axis.dim,
- axisIndex: axisModel.componentIndex
- }]
- });
- };
- BaseAxisPointer2.prototype._onHandleDragEnd = function() {
- this._dragging = false;
- var handle = this._handle;
- if (!handle) {
- return;
- }
- var value = this._axisPointerModel.get("value");
- this._moveHandleToValue(value);
- this._api.dispatchAction({
- type: "hideTip"
- });
- };
- BaseAxisPointer2.prototype.clear = function(api) {
- this._lastValue = null;
- this._lastStatus = null;
- var zr = api.getZr();
- var group = this._group;
- var handle = this._handle;
- if (zr && group) {
- this._lastGraphicKey = null;
- group && zr.remove(group);
- handle && zr.remove(handle);
- this._group = null;
- this._handle = null;
- this._payloadInfo = null;
- }
- clear(this, "_doDispatchAxisPointer");
- };
- BaseAxisPointer2.prototype.doClear = function() {
- };
- BaseAxisPointer2.prototype.buildLabel = function(xy, wh, xDimIndex) {
- xDimIndex = xDimIndex || 0;
- return {
- x: xy[xDimIndex],
- y: xy[1 - xDimIndex],
- width: wh[xDimIndex],
- height: wh[1 - xDimIndex]
- };
- };
- return BaseAxisPointer2;
- }();
- function updateProps2(animationModel, moveAnimation, el, props) {
- if (!propsEqual(inner(el).lastProp, props)) {
- inner(el).lastProp = props;
- moveAnimation ? updateProps(el, props, animationModel) : (el.stopAnimation(), el.attr(props));
- }
- }
- function propsEqual(lastProps, newProps) {
- if (isObject(lastProps) && isObject(newProps)) {
- var equals_1 = true;
- each(newProps, function(item, key) {
- equals_1 = equals_1 && propsEqual(lastProps[key], item);
- });
- return !!equals_1;
- } else {
- return lastProps === newProps;
- }
- }
- function updateLabelShowHide(labelEl, axisPointerModel) {
- labelEl[axisPointerModel.get(["label", "show"]) ? "show" : "hide"]();
- }
- function getHandleTransProps(trans) {
- return {
- x: trans.x || 0,
- y: trans.y || 0,
- rotation: trans.rotation || 0
- };
- }
- function updateMandatoryProps(group, axisPointerModel, silent) {
- var z = axisPointerModel.get("z");
- var zlevel = axisPointerModel.get("zlevel");
- group && group.traverse(function(el) {
- if (el.type !== "group") {
- z != null && (el.z = z);
- zlevel != null && (el.zlevel = zlevel);
- el.silent = silent;
- }
- });
- }
- var BaseAxisPointer_default = BaseAxisPointer;
- // node_modules/echarts/lib/component/axisPointer/viewHelper.js
- init_define_APP_INFO();
- function buildElStyle(axisPointerModel) {
- var axisPointerType = axisPointerModel.get("type");
- var styleModel = axisPointerModel.getModel(axisPointerType + "Style");
- var style;
- if (axisPointerType === "line") {
- style = styleModel.getLineStyle();
- style.fill = null;
- } else if (axisPointerType === "shadow") {
- style = styleModel.getAreaStyle();
- style.stroke = null;
- }
- return style;
- }
- function buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) {
- var value = axisPointerModel.get("value");
- var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get("seriesDataIndices"), {
- precision: axisPointerModel.get(["label", "precision"]),
- formatter: axisPointerModel.get(["label", "formatter"])
- });
- var labelModel = axisPointerModel.getModel("label");
- var paddings = normalizeCssArray(labelModel.get("padding") || 0);
- var font = labelModel.getFont();
- var textRect = getBoundingRect(text, font);
- var position = labelPos.position;
- var width = textRect.width + paddings[1] + paddings[3];
- var height = textRect.height + paddings[0] + paddings[2];
- var align = labelPos.align;
- align === "right" && (position[0] -= width);
- align === "center" && (position[0] -= width / 2);
- var verticalAlign = labelPos.verticalAlign;
- verticalAlign === "bottom" && (position[1] -= height);
- verticalAlign === "middle" && (position[1] -= height / 2);
- confineInContainer(position, width, height, api);
- var bgColor = labelModel.get("backgroundColor");
- if (!bgColor || bgColor === "auto") {
- bgColor = axisModel.get(["axisLine", "lineStyle", "color"]);
- }
- elOption.label = {
- x: position[0],
- y: position[1],
- style: createTextStyle(labelModel, {
- text,
- font,
- fill: labelModel.getTextColor(),
- padding: paddings,
- backgroundColor: bgColor
- }),
- z2: 10
- };
- }
- function confineInContainer(position, width, height, api) {
- var viewWidth = api.getWidth();
- var viewHeight = api.getHeight();
- position[0] = Math.min(position[0] + width, viewWidth) - width;
- position[1] = Math.min(position[1] + height, viewHeight) - height;
- position[0] = Math.max(position[0], 0);
- position[1] = Math.max(position[1], 0);
- }
- function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {
- value = axis.scale.parse(value);
- var text = axis.scale.getLabel({
- value
- }, {
- precision: opt.precision
- });
- var formatter = opt.formatter;
- if (formatter) {
- var params_1 = {
- value: getAxisRawValue(axis, {
- value
- }),
- axisDimension: axis.dim,
- axisIndex: axis.index,
- seriesData: []
- };
- each(seriesDataIndices, function(idxItem) {
- var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);
- var dataIndex = idxItem.dataIndexInside;
- var dataParams = series && series.getDataParams(dataIndex);
- dataParams && params_1.seriesData.push(dataParams);
- });
- if (isString(formatter)) {
- text = formatter.replace("{value}", text);
- } else if (isFunction(formatter)) {
- text = formatter(params_1);
- }
- }
- return text;
- }
- function getTransformedPosition(axis, value, layoutInfo) {
- var transform = create();
- rotate(transform, transform, layoutInfo.rotation);
- translate(transform, transform, layoutInfo.position);
- return applyTransform([axis.dataToCoord(value), (layoutInfo.labelOffset || 0) + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)], transform);
- }
- function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api) {
- var textLayout = AxisBuilder_default.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection);
- layoutInfo.labelMargin = axisPointerModel.get(["label", "margin"]);
- buildLabelElOption(elOption, axisModel, axisPointerModel, api, {
- position: getTransformedPosition(axisModel.axis, value, layoutInfo),
- align: textLayout.textAlign,
- verticalAlign: textLayout.textVerticalAlign
- });
- }
- function makeLineShape(p1, p2, xDimIndex) {
- xDimIndex = xDimIndex || 0;
- return {
- x1: p1[xDimIndex],
- y1: p1[1 - xDimIndex],
- x2: p2[xDimIndex],
- y2: p2[1 - xDimIndex]
- };
- }
- function makeRectShape(xy, wh, xDimIndex) {
- xDimIndex = xDimIndex || 0;
- return {
- x: xy[xDimIndex],
- y: xy[1 - xDimIndex],
- width: wh[xDimIndex],
- height: wh[1 - xDimIndex]
- };
- }
- function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) {
- return {
- cx,
- cy,
- r0,
- r,
- startAngle,
- endAngle,
- clockwise: true
- };
- }
- // node_modules/echarts/lib/component/axisPointer/CartesianAxisPointer.js
- var CartesianAxisPointer = function(_super) {
- __extends(CartesianAxisPointer2, _super);
- function CartesianAxisPointer2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- CartesianAxisPointer2.prototype.makeElOption = function(elOption, value, axisModel, axisPointerModel, api) {
- var axis = axisModel.axis;
- var grid = axis.grid;
- var axisPointerType = axisPointerModel.get("type");
- var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();
- var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));
- if (axisPointerType && axisPointerType !== "none") {
- var elStyle = buildElStyle(axisPointerModel);
- var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);
- pointerOption.style = elStyle;
- elOption.graphicKey = pointerOption.type;
- elOption.pointer = pointerOption;
- }
- var layoutInfo = layout(grid.model, axisModel);
- buildCartesianSingleLabelElOption(
- value,
- elOption,
- layoutInfo,
- axisModel,
- axisPointerModel,
- api
- );
- };
- CartesianAxisPointer2.prototype.getHandleTransform = function(value, axisModel, axisPointerModel) {
- var layoutInfo = layout(axisModel.axis.grid.model, axisModel, {
- labelInside: false
- });
- layoutInfo.labelMargin = axisPointerModel.get(["handle", "margin"]);
- var pos = getTransformedPosition(axisModel.axis, value, layoutInfo);
- return {
- x: pos[0],
- y: pos[1],
- rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)
- };
- };
- CartesianAxisPointer2.prototype.updateHandleTransform = function(transform, delta, axisModel, axisPointerModel) {
- var axis = axisModel.axis;
- var grid = axis.grid;
- var axisExtent = axis.getGlobalExtent(true);
- var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();
- var dimIndex = axis.dim === "x" ? 0 : 1;
- var currPosition = [transform.x, transform.y];
- currPosition[dimIndex] += delta[dimIndex];
- currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);
- currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);
- var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;
- var cursorPoint = [cursorOtherValue, cursorOtherValue];
- cursorPoint[dimIndex] = currPosition[dimIndex];
- var tooltipOptions = [{
- verticalAlign: "middle"
- }, {
- align: "center"
- }];
- return {
- x: currPosition[0],
- y: currPosition[1],
- rotation: transform.rotation,
- cursorPoint,
- tooltipOption: tooltipOptions[dimIndex]
- };
- };
- return CartesianAxisPointer2;
- }(BaseAxisPointer_default);
- function getCartesian(grid, axis) {
- var opt = {};
- opt[axis.dim + "AxisIndex"] = axis.index;
- return grid.getCartesian(opt);
- }
- var pointerShapeBuilder = {
- line: function(axis, pixelValue, otherExtent) {
- var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));
- return {
- type: "Line",
- subPixelOptimize: true,
- shape: targetShape
- };
- },
- shadow: function(axis, pixelValue, otherExtent) {
- var bandWidth = Math.max(1, axis.getBandWidth());
- var span = otherExtent[1] - otherExtent[0];
- return {
- type: "Rect",
- shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))
- };
- }
- };
- function getAxisDimIndex(axis) {
- return axis.dim === "x" ? 0 : 1;
- }
- var CartesianAxisPointer_default = CartesianAxisPointer;
- // node_modules/echarts/lib/component/axisPointer/AxisPointerModel.js
- init_define_APP_INFO();
- var AxisPointerModel = function(_super) {
- __extends(AxisPointerModel2, _super);
- function AxisPointerModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = AxisPointerModel2.type;
- return _this;
- }
- AxisPointerModel2.type = "axisPointer";
- AxisPointerModel2.defaultOption = {
- show: "auto",
- z: 50,
- type: "line",
- snap: false,
- triggerTooltip: true,
- value: null,
- status: null,
- link: [],
- animation: null,
- animationDurationUpdate: 200,
- lineStyle: {
- color: "#B9BEC9",
- width: 1,
- type: "dashed"
- },
- shadowStyle: {
- color: "rgba(210,219,238,0.2)"
- },
- label: {
- show: true,
- formatter: null,
- precision: "auto",
- margin: 3,
- color: "#fff",
- padding: [5, 7, 5, 7],
- backgroundColor: "auto",
- borderColor: null,
- borderWidth: 0,
- borderRadius: 3
- },
- handle: {
- show: false,
- icon: "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",
- size: 45,
- margin: 50,
- color: "#333",
- shadowBlur: 3,
- shadowColor: "#aaa",
- shadowOffsetX: 0,
- shadowOffsetY: 2,
- throttle: 40
- }
- };
- return AxisPointerModel2;
- }(Component_default);
- var AxisPointerModel_default = AxisPointerModel;
- // node_modules/echarts/lib/component/axisPointer/AxisPointerView.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/axisPointer/globalListener.js
- init_define_APP_INFO();
- var inner2 = makeInner();
- var each2 = each;
- function register(key, api, handler) {
- if (env_default.node) {
- return;
- }
- var zr = api.getZr();
- inner2(zr).records || (inner2(zr).records = {});
- initGlobalListeners(zr, api);
- var record = inner2(zr).records[key] || (inner2(zr).records[key] = {});
- record.handler = handler;
- }
- function initGlobalListeners(zr, api) {
- if (inner2(zr).initialized) {
- return;
- }
- inner2(zr).initialized = true;
- useHandler("click", curry(doEnter, "click"));
- useHandler("mousemove", curry(doEnter, "mousemove"));
- useHandler("globalout", onLeave);
- function useHandler(eventType, cb) {
- zr.on(eventType, function(e) {
- var dis = makeDispatchAction(api);
- each2(inner2(zr).records, function(record) {
- record && cb(record, e, dis.dispatchAction);
- });
- dispatchTooltipFinally(dis.pendings, api);
- });
- }
- }
- function dispatchTooltipFinally(pendings, api) {
- var showLen = pendings.showTip.length;
- var hideLen = pendings.hideTip.length;
- var actuallyPayload;
- if (showLen) {
- actuallyPayload = pendings.showTip[showLen - 1];
- } else if (hideLen) {
- actuallyPayload = pendings.hideTip[hideLen - 1];
- }
- if (actuallyPayload) {
- actuallyPayload.dispatchAction = null;
- api.dispatchAction(actuallyPayload);
- }
- }
- function onLeave(record, e, dispatchAction3) {
- record.handler("leave", null, dispatchAction3);
- }
- function doEnter(currTrigger, record, e, dispatchAction3) {
- record.handler(currTrigger, e, dispatchAction3);
- }
- function makeDispatchAction(api) {
- var pendings = {
- showTip: [],
- hideTip: []
- };
- var dispatchAction3 = function(payload) {
- var pendingList = pendings[payload.type];
- if (pendingList) {
- pendingList.push(payload);
- } else {
- payload.dispatchAction = dispatchAction3;
- api.dispatchAction(payload);
- }
- };
- return {
- dispatchAction: dispatchAction3,
- pendings
- };
- }
- function unregister(key, api) {
- if (env_default.node) {
- return;
- }
- var zr = api.getZr();
- var record = (inner2(zr).records || {})[key];
- if (record) {
- inner2(zr).records[key] = null;
- }
- }
- // node_modules/echarts/lib/component/axisPointer/AxisPointerView.js
- var AxisPointerView = function(_super) {
- __extends(AxisPointerView2, _super);
- function AxisPointerView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = AxisPointerView2.type;
- return _this;
- }
- AxisPointerView2.prototype.render = function(globalAxisPointerModel, ecModel, api) {
- var globalTooltipModel = ecModel.getComponent("tooltip");
- var triggerOn = globalAxisPointerModel.get("triggerOn") || globalTooltipModel && globalTooltipModel.get("triggerOn") || "mousemove|click";
- register("axisPointer", api, function(currTrigger, e, dispatchAction3) {
- if (triggerOn !== "none" && (currTrigger === "leave" || triggerOn.indexOf(currTrigger) >= 0)) {
- dispatchAction3({
- type: "updateAxisPointer",
- currTrigger,
- x: e && e.offsetX,
- y: e && e.offsetY
- });
- }
- });
- };
- AxisPointerView2.prototype.remove = function(ecModel, api) {
- unregister("axisPointer", api);
- };
- AxisPointerView2.prototype.dispose = function(ecModel, api) {
- unregister("axisPointer", api);
- };
- AxisPointerView2.type = "axisPointer";
- return AxisPointerView2;
- }(Component_default2);
- var AxisPointerView_default = AxisPointerView;
- // node_modules/echarts/lib/component/axisPointer/axisTrigger.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/axisPointer/findPointFromSeries.js
- init_define_APP_INFO();
- function findPointFromSeries(finder, ecModel) {
- var point = [];
- var seriesIndex = finder.seriesIndex;
- var seriesModel;
- if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {
- return {
- point: []
- };
- }
- var data = seriesModel.getData();
- var dataIndex = queryDataIndex(data, finder);
- if (dataIndex == null || dataIndex < 0 || isArray(dataIndex)) {
- return {
- point: []
- };
- }
- var el = data.getItemGraphicEl(dataIndex);
- var coordSys = seriesModel.coordinateSystem;
- if (seriesModel.getTooltipPosition) {
- point = seriesModel.getTooltipPosition(dataIndex) || [];
- } else if (coordSys && coordSys.dataToPoint) {
- if (finder.isStacked) {
- var baseAxis = coordSys.getBaseAxis();
- var valueAxis = coordSys.getOtherAxis(baseAxis);
- var valueAxisDim = valueAxis.dim;
- var baseAxisDim = baseAxis.dim;
- var baseDataOffset = valueAxisDim === "x" || valueAxisDim === "radius" ? 1 : 0;
- var baseDim = data.mapDimension(baseAxisDim);
- var stackedData = [];
- stackedData[baseDataOffset] = data.get(baseDim, dataIndex);
- stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo("stackResultDimension"), dataIndex);
- point = coordSys.dataToPoint(stackedData) || [];
- } else {
- point = coordSys.dataToPoint(data.getValues(map(coordSys.dimensions, function(dim) {
- return data.mapDimension(dim);
- }), dataIndex)) || [];
- }
- } else if (el) {
- var rect = el.getBoundingRect().clone();
- rect.applyTransform(el.transform);
- point = [rect.x + rect.width / 2, rect.y + rect.height / 2];
- }
- return {
- point,
- el
- };
- }
- // node_modules/echarts/lib/component/axisPointer/axisTrigger.js
- var inner3 = makeInner();
- function axisTrigger(payload, ecModel, api) {
- var currTrigger = payload.currTrigger;
- var point = [payload.x, payload.y];
- var finder = payload;
- var dispatchAction3 = payload.dispatchAction || bind(api.dispatchAction, api);
- var coordSysAxesInfo = ecModel.getComponent("axisPointer").coordSysAxesInfo;
- if (!coordSysAxesInfo) {
- return;
- }
- if (illegalPoint(point)) {
- point = findPointFromSeries({
- seriesIndex: finder.seriesIndex,
- dataIndex: finder.dataIndex
- }, ecModel).point;
- }
- var isIllegalPoint = illegalPoint(point);
- var inputAxesInfo = finder.axesInfo;
- var axesInfo = coordSysAxesInfo.axesInfo;
- var shouldHide = currTrigger === "leave" || illegalPoint(point);
- var outputPayload = {};
- var showValueMap = {};
- var dataByCoordSys = {
- list: [],
- map: {}
- };
- var updaters = {
- showPointer: curry(showPointer, showValueMap),
- showTooltip: curry(showTooltip, dataByCoordSys)
- };
- each(coordSysAxesInfo.coordSysMap, function(coordSys, coordSysKey) {
- var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);
- each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function(axisInfo, key) {
- var axis = axisInfo.axis;
- var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo);
- if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {
- var val = inputAxisInfo && inputAxisInfo.value;
- if (val == null && !isIllegalPoint) {
- val = axis.pointToData(point);
- }
- val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);
- }
- });
- });
- var linkTriggers = {};
- each(axesInfo, function(tarAxisInfo, tarKey) {
- var linkGroup = tarAxisInfo.linkGroup;
- if (linkGroup && !showValueMap[tarKey]) {
- each(linkGroup.axesInfo, function(srcAxisInfo, srcKey) {
- var srcValItem = showValueMap[srcKey];
- if (srcAxisInfo !== tarAxisInfo && srcValItem) {
- var val = srcValItem.value;
- linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));
- linkTriggers[tarAxisInfo.key] = val;
- }
- });
- }
- });
- each(linkTriggers, function(val, tarKey) {
- processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);
- });
- updateModelActually(showValueMap, axesInfo, outputPayload);
- dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction3);
- dispatchHighDownActually(axesInfo, dispatchAction3, api);
- return outputPayload;
- }
- function processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {
- var axis = axisInfo.axis;
- if (axis.scale.isBlank() || !axis.containData(newValue)) {
- return;
- }
- if (!axisInfo.involveSeries) {
- updaters.showPointer(axisInfo, newValue);
- return;
- }
- var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);
- var payloadBatch = payloadInfo.payloadBatch;
- var snapToValue = payloadInfo.snapToValue;
- if (payloadBatch[0] && outputFinder.seriesIndex == null) {
- extend(outputFinder, payloadBatch[0]);
- }
- if (!noSnap && axisInfo.snap) {
- if (axis.containData(snapToValue) && snapToValue != null) {
- newValue = snapToValue;
- }
- }
- updaters.showPointer(axisInfo, newValue, payloadBatch);
- updaters.showTooltip(axisInfo, payloadInfo, snapToValue);
- }
- function buildPayloadsBySeries(value, axisInfo) {
- var axis = axisInfo.axis;
- var dim = axis.dim;
- var snapToValue = value;
- var payloadBatch = [];
- var minDist = Number.MAX_VALUE;
- var minDiff = -1;
- each(axisInfo.seriesModels, function(series, idx) {
- var dataDim = series.getData().mapDimensionsAll(dim);
- var seriesNestestValue;
- var dataIndices;
- if (series.getAxisTooltipData) {
- var result = series.getAxisTooltipData(dataDim, value, axis);
- dataIndices = result.dataIndices;
- seriesNestestValue = result.nestestValue;
- } else {
- dataIndices = series.getData().indicesOfNearest(
- dataDim[0],
- value,
- axis.type === "category" ? 0.5 : null
- );
- if (!dataIndices.length) {
- return;
- }
- seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);
- }
- if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {
- return;
- }
- var diff = value - seriesNestestValue;
- var dist = Math.abs(diff);
- if (dist <= minDist) {
- if (dist < minDist || diff >= 0 && minDiff < 0) {
- minDist = dist;
- minDiff = diff;
- snapToValue = seriesNestestValue;
- payloadBatch.length = 0;
- }
- each(dataIndices, function(dataIndex) {
- payloadBatch.push({
- seriesIndex: series.seriesIndex,
- dataIndexInside: dataIndex,
- dataIndex: series.getData().getRawIndex(dataIndex)
- });
- });
- }
- });
- return {
- payloadBatch,
- snapToValue
- };
- }
- function showPointer(showValueMap, axisInfo, value, payloadBatch) {
- showValueMap[axisInfo.key] = {
- value,
- payloadBatch
- };
- }
- function showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {
- var payloadBatch = payloadInfo.payloadBatch;
- var axis = axisInfo.axis;
- var axisModel = axis.model;
- var axisPointerModel = axisInfo.axisPointerModel;
- if (!axisInfo.triggerTooltip || !payloadBatch.length) {
- return;
- }
- var coordSysModel = axisInfo.coordSys.model;
- var coordSysKey = makeKey(coordSysModel);
- var coordSysItem = dataByCoordSys.map[coordSysKey];
- if (!coordSysItem) {
- coordSysItem = dataByCoordSys.map[coordSysKey] = {
- coordSysId: coordSysModel.id,
- coordSysIndex: coordSysModel.componentIndex,
- coordSysType: coordSysModel.type,
- coordSysMainType: coordSysModel.mainType,
- dataByAxis: []
- };
- dataByCoordSys.list.push(coordSysItem);
- }
- coordSysItem.dataByAxis.push({
- axisDim: axis.dim,
- axisIndex: axisModel.componentIndex,
- axisType: axisModel.type,
- axisId: axisModel.id,
- value,
- valueLabelOpt: {
- precision: axisPointerModel.get(["label", "precision"]),
- formatter: axisPointerModel.get(["label", "formatter"])
- },
- seriesDataIndices: payloadBatch.slice()
- });
- }
- function updateModelActually(showValueMap, axesInfo, outputPayload) {
- var outputAxesInfo = outputPayload.axesInfo = [];
- each(axesInfo, function(axisInfo, key) {
- var option = axisInfo.axisPointerModel.option;
- var valItem = showValueMap[key];
- if (valItem) {
- !axisInfo.useHandle && (option.status = "show");
- option.value = valItem.value;
- option.seriesDataIndices = (valItem.payloadBatch || []).slice();
- } else {
- !axisInfo.useHandle && (option.status = "hide");
- }
- option.status === "show" && outputAxesInfo.push({
- axisDim: axisInfo.axis.dim,
- axisIndex: axisInfo.axis.model.componentIndex,
- value: option.value
- });
- });
- }
- function dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction3) {
- if (illegalPoint(point) || !dataByCoordSys.list.length) {
- dispatchAction3({
- type: "hideTip"
- });
- return;
- }
- var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};
- dispatchAction3({
- type: "showTip",
- escapeConnect: true,
- x: point[0],
- y: point[1],
- tooltipOption: payload.tooltipOption,
- position: payload.position,
- dataIndexInside: sampleItem.dataIndexInside,
- dataIndex: sampleItem.dataIndex,
- seriesIndex: sampleItem.seriesIndex,
- dataByCoordSys: dataByCoordSys.list
- });
- }
- function dispatchHighDownActually(axesInfo, dispatchAction3, api) {
- var zr = api.getZr();
- var highDownKey = "axisPointerLastHighlights";
- var lastHighlights = inner3(zr)[highDownKey] || {};
- var newHighlights = inner3(zr)[highDownKey] = {};
- each(axesInfo, function(axisInfo, key) {
- var option = axisInfo.axisPointerModel.option;
- option.status === "show" && each(option.seriesDataIndices, function(batchItem) {
- var key2 = batchItem.seriesIndex + " | " + batchItem.dataIndex;
- newHighlights[key2] = batchItem;
- });
- });
- var toHighlight = [];
- var toDownplay = [];
- each(lastHighlights, function(batchItem, key) {
- !newHighlights[key] && toDownplay.push(batchItem);
- });
- each(newHighlights, function(batchItem, key) {
- !lastHighlights[key] && toHighlight.push(batchItem);
- });
- toDownplay.length && api.dispatchAction({
- type: "downplay",
- escapeConnect: true,
- notBlur: true,
- batch: toDownplay
- });
- toHighlight.length && api.dispatchAction({
- type: "highlight",
- escapeConnect: true,
- notBlur: true,
- batch: toHighlight
- });
- }
- function findInputAxisInfo(inputAxesInfo, axisInfo) {
- for (var i = 0; i < (inputAxesInfo || []).length; i++) {
- var inputAxisInfo = inputAxesInfo[i];
- if (axisInfo.axis.dim === inputAxisInfo.axisDim && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {
- return inputAxisInfo;
- }
- }
- }
- function makeMapperParam(axisInfo) {
- var axisModel = axisInfo.axis.model;
- var item = {};
- var dim = item.axisDim = axisInfo.axis.dim;
- item.axisIndex = item[dim + "AxisIndex"] = axisModel.componentIndex;
- item.axisName = item[dim + "AxisName"] = axisModel.name;
- item.axisId = item[dim + "AxisId"] = axisModel.id;
- return item;
- }
- function illegalPoint(point) {
- return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);
- }
- // node_modules/echarts/lib/component/axisPointer/install.js
- function install5(registers) {
- AxisView_default.registerAxisPointerClass("CartesianAxisPointer", CartesianAxisPointer_default);
- registers.registerComponentModel(AxisPointerModel_default);
- registers.registerComponentView(AxisPointerView_default);
- registers.registerPreprocessor(function(option) {
- if (option) {
- (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {});
- var link = option.axisPointer.link;
- if (link && !isArray(link)) {
- option.axisPointer.link = [link];
- }
- }
- });
- registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function(ecModel, api) {
- ecModel.getComponent("axisPointer").coordSysAxesInfo = collect(ecModel, api);
- });
- registers.registerAction({
- type: "updateAxisPointer",
- event: "updateAxisPointer",
- update: ":updateAxisPointer"
- }, axisTrigger);
- }
- // node_modules/echarts/lib/component/grid/install.js
- function install6(registers) {
- use(install);
- use(install5);
- }
- // node_modules/echarts/lib/component/polar/install.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/axisPointer/PolarAxisPointer.js
- init_define_APP_INFO();
- var PolarAxisPointer = function(_super) {
- __extends(PolarAxisPointer2, _super);
- function PolarAxisPointer2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- PolarAxisPointer2.prototype.makeElOption = function(elOption, value, axisModel, axisPointerModel, api) {
- var axis = axisModel.axis;
- if (axis.dim === "angle") {
- this.animationThreshold = Math.PI / 18;
- }
- var polar = axis.polar;
- var otherAxis = polar.getOtherAxis(axis);
- var otherExtent = otherAxis.getExtent();
- var coordValue = axis.dataToCoord(value);
- var axisPointerType = axisPointerModel.get("type");
- if (axisPointerType && axisPointerType !== "none") {
- var elStyle = buildElStyle(axisPointerModel);
- var pointerOption = pointerShapeBuilder2[axisPointerType](axis, polar, coordValue, otherExtent);
- pointerOption.style = elStyle;
- elOption.graphicKey = pointerOption.type;
- elOption.pointer = pointerOption;
- }
- var labelMargin = axisPointerModel.get(["label", "margin"]);
- var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin);
- buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos);
- };
- return PolarAxisPointer2;
- }(BaseAxisPointer_default);
- function getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) {
- var axis = axisModel.axis;
- var coord = axis.dataToCoord(value);
- var axisAngle = polar.getAngleAxis().getExtent()[0];
- axisAngle = axisAngle / 180 * Math.PI;
- var radiusExtent = polar.getRadiusAxis().getExtent();
- var position;
- var align;
- var verticalAlign;
- if (axis.dim === "radius") {
- var transform = create();
- rotate(transform, transform, axisAngle);
- translate(transform, transform, [polar.cx, polar.cy]);
- position = applyTransform([coord, -labelMargin], transform);
- var labelRotation = axisModel.getModel("axisLabel").get("rotate") || 0;
- var labelLayout = AxisBuilder_default.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1);
- align = labelLayout.textAlign;
- verticalAlign = labelLayout.textVerticalAlign;
- } else {
- var r = radiusExtent[1];
- position = polar.coordToPoint([r + labelMargin, coord]);
- var cx = polar.cx;
- var cy = polar.cy;
- align = Math.abs(position[0] - cx) / r < 0.3 ? "center" : position[0] > cx ? "left" : "right";
- verticalAlign = Math.abs(position[1] - cy) / r < 0.3 ? "middle" : position[1] > cy ? "top" : "bottom";
- }
- return {
- position,
- align,
- verticalAlign
- };
- }
- var pointerShapeBuilder2 = {
- line: function(axis, polar, coordValue, otherExtent) {
- return axis.dim === "angle" ? {
- type: "Line",
- shape: makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue]))
- } : {
- type: "Circle",
- shape: {
- cx: polar.cx,
- cy: polar.cy,
- r: coordValue
- }
- };
- },
- shadow: function(axis, polar, coordValue, otherExtent) {
- var bandWidth = Math.max(1, axis.getBandWidth());
- var radian = Math.PI / 180;
- return axis.dim === "angle" ? {
- type: "Sector",
- shape: makeSectorShape(
- polar.cx,
- polar.cy,
- otherExtent[0],
- otherExtent[1],
- (-coordValue - bandWidth / 2) * radian,
- (-coordValue + bandWidth / 2) * radian
- )
- } : {
- type: "Sector",
- shape: makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2)
- };
- }
- };
- var PolarAxisPointer_default = PolarAxisPointer;
- // node_modules/echarts/lib/coord/polar/PolarModel.js
- init_define_APP_INFO();
- var PolarModel = function(_super) {
- __extends(PolarModel2, _super);
- function PolarModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = PolarModel2.type;
- return _this;
- }
- PolarModel2.prototype.findAxisModel = function(axisType) {
- var foundAxisModel;
- var ecModel = this.ecModel;
- ecModel.eachComponent(axisType, function(axisModel) {
- if (axisModel.getCoordSysModel() === this) {
- foundAxisModel = axisModel;
- }
- }, this);
- return foundAxisModel;
- };
- PolarModel2.type = "polar";
- PolarModel2.dependencies = ["radiusAxis", "angleAxis"];
- PolarModel2.defaultOption = {
- z: 0,
- center: ["50%", "50%"],
- radius: "80%"
- };
- return PolarModel2;
- }(Component_default);
- var PolarModel_default = PolarModel;
- // node_modules/echarts/lib/coord/polar/AxisModel.js
- init_define_APP_INFO();
- var PolarAxisModel = function(_super) {
- __extends(PolarAxisModel2, _super);
- function PolarAxisModel2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- PolarAxisModel2.prototype.getCoordSysModel = function() {
- return this.getReferringComponents("polar", SINGLE_REFERRING).models[0];
- };
- PolarAxisModel2.type = "polarAxis";
- return PolarAxisModel2;
- }(Component_default);
- mixin(PolarAxisModel, AxisModelCommonMixin);
- var AngleAxisModel = function(_super) {
- __extends(AngleAxisModel2, _super);
- function AngleAxisModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = AngleAxisModel2.type;
- return _this;
- }
- AngleAxisModel2.type = "angleAxis";
- return AngleAxisModel2;
- }(PolarAxisModel);
- var RadiusAxisModel = function(_super) {
- __extends(RadiusAxisModel2, _super);
- function RadiusAxisModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = RadiusAxisModel2.type;
- return _this;
- }
- RadiusAxisModel2.type = "radiusAxis";
- return RadiusAxisModel2;
- }(PolarAxisModel);
- // node_modules/echarts/lib/coord/polar/polarCreator.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/coord/polar/Polar.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/coord/polar/RadiusAxis.js
- init_define_APP_INFO();
- var RadiusAxis = function(_super) {
- __extends(RadiusAxis2, _super);
- function RadiusAxis2(scale, radiusExtent) {
- return _super.call(this, "radius", scale, radiusExtent) || this;
- }
- RadiusAxis2.prototype.pointToData = function(point, clamp) {
- return this.polar.pointToData(point, clamp)[this.dim === "radius" ? 0 : 1];
- };
- return RadiusAxis2;
- }(Axis_default);
- RadiusAxis.prototype.dataToRadius = Axis_default.prototype.dataToCoord;
- RadiusAxis.prototype.radiusToData = Axis_default.prototype.coordToData;
- var RadiusAxis_default = RadiusAxis;
- // node_modules/echarts/lib/coord/polar/AngleAxis.js
- init_define_APP_INFO();
- var inner4 = makeInner();
- var AngleAxis = function(_super) {
- __extends(AngleAxis2, _super);
- function AngleAxis2(scale, angleExtent) {
- return _super.call(this, "angle", scale, angleExtent || [0, 360]) || this;
- }
- AngleAxis2.prototype.pointToData = function(point, clamp) {
- return this.polar.pointToData(point, clamp)[this.dim === "radius" ? 0 : 1];
- };
- AngleAxis2.prototype.calculateCategoryInterval = function() {
- var axis = this;
- var labelModel = axis.getLabelModel();
- var ordinalScale = axis.scale;
- var ordinalExtent = ordinalScale.getExtent();
- var tickCount = ordinalScale.count();
- if (ordinalExtent[1] - ordinalExtent[0] < 1) {
- return 0;
- }
- var tickValue = ordinalExtent[0];
- var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);
- var unitH = Math.abs(unitSpan);
- var rect = getBoundingRect(tickValue == null ? "" : tickValue + "", labelModel.getFont(), "center", "top");
- var maxH = Math.max(rect.height, 7);
- var dh = maxH / unitH;
- isNaN(dh) && (dh = Infinity);
- var interval = Math.max(0, Math.floor(dh));
- var cache = inner4(axis.model);
- var lastAutoInterval = cache.lastAutoInterval;
- var lastTickCount = cache.lastTickCount;
- if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 && lastAutoInterval > interval) {
- interval = lastAutoInterval;
- } else {
- cache.lastTickCount = tickCount;
- cache.lastAutoInterval = interval;
- }
- return interval;
- };
- return AngleAxis2;
- }(Axis_default);
- AngleAxis.prototype.dataToAngle = Axis_default.prototype.dataToCoord;
- AngleAxis.prototype.angleToData = Axis_default.prototype.coordToData;
- var AngleAxis_default = AngleAxis;
- // node_modules/echarts/lib/coord/polar/Polar.js
- var polarDimensions = ["radius", "angle"];
- var Polar = function() {
- function Polar2(name) {
- this.dimensions = polarDimensions;
- this.type = "polar";
- this.cx = 0;
- this.cy = 0;
- this._radiusAxis = new RadiusAxis_default();
- this._angleAxis = new AngleAxis_default();
- this.axisPointerEnabled = true;
- this.name = name || "";
- this._radiusAxis.polar = this._angleAxis.polar = this;
- }
- Polar2.prototype.containPoint = function(point) {
- var coord = this.pointToCoord(point);
- return this._radiusAxis.contain(coord[0]) && this._angleAxis.contain(coord[1]);
- };
- Polar2.prototype.containData = function(data) {
- return this._radiusAxis.containData(data[0]) && this._angleAxis.containData(data[1]);
- };
- Polar2.prototype.getAxis = function(dim) {
- var key = "_" + dim + "Axis";
- return this[key];
- };
- Polar2.prototype.getAxes = function() {
- return [this._radiusAxis, this._angleAxis];
- };
- Polar2.prototype.getAxesByScale = function(scaleType) {
- var axes = [];
- var angleAxis = this._angleAxis;
- var radiusAxis = this._radiusAxis;
- angleAxis.scale.type === scaleType && axes.push(angleAxis);
- radiusAxis.scale.type === scaleType && axes.push(radiusAxis);
- return axes;
- };
- Polar2.prototype.getAngleAxis = function() {
- return this._angleAxis;
- };
- Polar2.prototype.getRadiusAxis = function() {
- return this._radiusAxis;
- };
- Polar2.prototype.getOtherAxis = function(axis) {
- var angleAxis = this._angleAxis;
- return axis === angleAxis ? this._radiusAxis : angleAxis;
- };
- Polar2.prototype.getBaseAxis = function() {
- return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAngleAxis();
- };
- Polar2.prototype.getTooltipAxes = function(dim) {
- var baseAxis = dim != null && dim !== "auto" ? this.getAxis(dim) : this.getBaseAxis();
- return {
- baseAxes: [baseAxis],
- otherAxes: [this.getOtherAxis(baseAxis)]
- };
- };
- Polar2.prototype.dataToPoint = function(data, clamp) {
- return this.coordToPoint([this._radiusAxis.dataToRadius(data[0], clamp), this._angleAxis.dataToAngle(data[1], clamp)]);
- };
- Polar2.prototype.pointToData = function(point, clamp) {
- var coord = this.pointToCoord(point);
- return [this._radiusAxis.radiusToData(coord[0], clamp), this._angleAxis.angleToData(coord[1], clamp)];
- };
- Polar2.prototype.pointToCoord = function(point) {
- var dx = point[0] - this.cx;
- var dy = point[1] - this.cy;
- var angleAxis = this.getAngleAxis();
- var extent = angleAxis.getExtent();
- var minAngle = Math.min(extent[0], extent[1]);
- var maxAngle = Math.max(extent[0], extent[1]);
- angleAxis.inverse ? minAngle = maxAngle - 360 : maxAngle = minAngle + 360;
- var radius = Math.sqrt(dx * dx + dy * dy);
- dx /= radius;
- dy /= radius;
- var radian = Math.atan2(-dy, dx) / Math.PI * 180;
- var dir = radian < minAngle ? 1 : -1;
- while (radian < minAngle || radian > maxAngle) {
- radian += dir * 360;
- }
- return [radius, radian];
- };
- Polar2.prototype.coordToPoint = function(coord) {
- var radius = coord[0];
- var radian = coord[1] / 180 * Math.PI;
- var x = Math.cos(radian) * radius + this.cx;
- var y = -Math.sin(radian) * radius + this.cy;
- return [x, y];
- };
- Polar2.prototype.getArea = function() {
- var angleAxis = this.getAngleAxis();
- var radiusAxis = this.getRadiusAxis();
- var radiusExtent = radiusAxis.getExtent().slice();
- radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();
- var angleExtent = angleAxis.getExtent();
- var RADIAN = Math.PI / 180;
- return {
- cx: this.cx,
- cy: this.cy,
- r0: radiusExtent[0],
- r: radiusExtent[1],
- startAngle: -angleExtent[0] * RADIAN,
- endAngle: -angleExtent[1] * RADIAN,
- clockwise: angleAxis.inverse,
- contain: function(x, y) {
- var dx = x - this.cx;
- var dy = y - this.cy;
- var d2 = dx * dx + dy * dy - 1e-4;
- var r = this.r;
- var r0 = this.r0;
- return d2 <= r * r && d2 >= r0 * r0;
- }
- };
- };
- Polar2.prototype.convertToPixel = function(ecModel, finder, value) {
- var coordSys = getCoordSys(finder);
- return coordSys === this ? this.dataToPoint(value) : null;
- };
- Polar2.prototype.convertFromPixel = function(ecModel, finder, pixel) {
- var coordSys = getCoordSys(finder);
- return coordSys === this ? this.pointToData(pixel) : null;
- };
- return Polar2;
- }();
- function getCoordSys(finder) {
- var seriesModel = finder.seriesModel;
- var polarModel = finder.polarModel;
- return polarModel && polarModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;
- }
- var Polar_default = Polar;
- // node_modules/echarts/lib/coord/polar/polarCreator.js
- function resizePolar(polar, polarModel, api) {
- var center = polarModel.get("center");
- var width = api.getWidth();
- var height = api.getHeight();
- polar.cx = parsePercent2(center[0], width);
- polar.cy = parsePercent2(center[1], height);
- var radiusAxis = polar.getRadiusAxis();
- var size = Math.min(width, height) / 2;
- var radius = polarModel.get("radius");
- if (radius == null) {
- radius = [0, "100%"];
- } else if (!isArray(radius)) {
- radius = [0, radius];
- }
- var parsedRadius = [parsePercent2(radius[0], size), parsePercent2(radius[1], size)];
- radiusAxis.inverse ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0]) : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]);
- }
- function updatePolarScale(ecModel, api) {
- var polar = this;
- var angleAxis = polar.getAngleAxis();
- var radiusAxis = polar.getRadiusAxis();
- angleAxis.scale.setExtent(Infinity, -Infinity);
- radiusAxis.scale.setExtent(Infinity, -Infinity);
- ecModel.eachSeries(function(seriesModel) {
- if (seriesModel.coordinateSystem === polar) {
- var data_1 = seriesModel.getData();
- each(getDataDimensionsOnAxis(data_1, "radius"), function(dim) {
- radiusAxis.scale.unionExtentFromData(data_1, dim);
- });
- each(getDataDimensionsOnAxis(data_1, "angle"), function(dim) {
- angleAxis.scale.unionExtentFromData(data_1, dim);
- });
- }
- });
- niceScaleExtent(angleAxis.scale, angleAxis.model);
- niceScaleExtent(radiusAxis.scale, radiusAxis.model);
- if (angleAxis.type === "category" && !angleAxis.onBand) {
- var extent = angleAxis.getExtent();
- var diff = 360 / angleAxis.scale.count();
- angleAxis.inverse ? extent[1] += diff : extent[1] -= diff;
- angleAxis.setExtent(extent[0], extent[1]);
- }
- }
- function isAngleAxisModel(axisModel) {
- return axisModel.mainType === "angleAxis";
- }
- function setAxis(axis, axisModel) {
- axis.type = axisModel.get("type");
- axis.scale = createScaleByModel(axisModel);
- axis.onBand = axisModel.get("boundaryGap") && axis.type === "category";
- axis.inverse = axisModel.get("inverse");
- if (isAngleAxisModel(axisModel)) {
- axis.inverse = axis.inverse !== axisModel.get("clockwise");
- var startAngle = axisModel.get("startAngle");
- axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));
- }
- axisModel.axis = axis;
- axis.model = axisModel;
- }
- var polarCreator = {
- dimensions: polarDimensions,
- create: function(ecModel, api) {
- var polarList = [];
- ecModel.eachComponent("polar", function(polarModel, idx) {
- var polar = new Polar_default(idx + "");
- polar.update = updatePolarScale;
- var radiusAxis = polar.getRadiusAxis();
- var angleAxis = polar.getAngleAxis();
- var radiusAxisModel = polarModel.findAxisModel("radiusAxis");
- var angleAxisModel = polarModel.findAxisModel("angleAxis");
- setAxis(radiusAxis, radiusAxisModel);
- setAxis(angleAxis, angleAxisModel);
- resizePolar(polar, polarModel, api);
- polarList.push(polar);
- polarModel.coordinateSystem = polar;
- polar.model = polarModel;
- });
- ecModel.eachSeries(function(seriesModel) {
- if (seriesModel.get("coordinateSystem") === "polar") {
- var polarModel = seriesModel.getReferringComponents("polar", SINGLE_REFERRING).models[0];
- if (true) {
- if (!polarModel) {
- throw new Error('Polar "' + retrieve(seriesModel.get("polarIndex"), seriesModel.get("polarId"), 0) + '" not found');
- }
- }
- seriesModel.coordinateSystem = polarModel.coordinateSystem;
- }
- });
- return polarList;
- }
- };
- var polarCreator_default = polarCreator;
- // node_modules/echarts/lib/component/axis/AngleAxisView.js
- init_define_APP_INFO();
- var elementList = ["axisLine", "axisLabel", "axisTick", "minorTick", "splitLine", "minorSplitLine", "splitArea"];
- function getAxisLineShape(polar, rExtent, angle) {
- rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());
- var start = polar.coordToPoint([rExtent[0], angle]);
- var end = polar.coordToPoint([rExtent[1], angle]);
- return {
- x1: start[0],
- y1: start[1],
- x2: end[0],
- y2: end[1]
- };
- }
- function getRadiusIdx(polar) {
- var radiusAxis = polar.getRadiusAxis();
- return radiusAxis.inverse ? 0 : 1;
- }
- function fixAngleOverlap(list) {
- var firstItem = list[0];
- var lastItem = list[list.length - 1];
- if (firstItem && lastItem && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) {
- list.pop();
- }
- }
- var AngleAxisView = function(_super) {
- __extends(AngleAxisView2, _super);
- function AngleAxisView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = AngleAxisView2.type;
- _this.axisPointerClass = "PolarAxisPointer";
- return _this;
- }
- AngleAxisView2.prototype.render = function(angleAxisModel, ecModel) {
- this.group.removeAll();
- if (!angleAxisModel.get("show")) {
- return;
- }
- var angleAxis = angleAxisModel.axis;
- var polar = angleAxis.polar;
- var radiusExtent = polar.getRadiusAxis().getExtent();
- var ticksAngles = angleAxis.getTicksCoords();
- var minorTickAngles = angleAxis.getMinorTicksCoords();
- var labels = map(angleAxis.getViewLabels(), function(labelItem) {
- labelItem = clone(labelItem);
- var scale = angleAxis.scale;
- var tickValue = scale.type === "ordinal" ? scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;
- labelItem.coord = angleAxis.dataToCoord(tickValue);
- return labelItem;
- });
- fixAngleOverlap(labels);
- fixAngleOverlap(ticksAngles);
- each(elementList, function(name) {
- if (angleAxisModel.get([name, "show"]) && (!angleAxis.scale.isBlank() || name === "axisLine")) {
- angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels);
- }
- }, this);
- };
- AngleAxisView2.type = "angleAxis";
- return AngleAxisView2;
- }(AxisView_default);
- var angelAxisElementsBuilders = {
- axisLine: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
- var lineStyleModel = angleAxisModel.getModel(["axisLine", "lineStyle"]);
- var rId = getRadiusIdx(polar);
- var r0Id = rId ? 0 : 1;
- var shape;
- if (radiusExtent[r0Id] === 0) {
- shape = new Circle_default({
- shape: {
- cx: polar.cx,
- cy: polar.cy,
- r: radiusExtent[rId]
- },
- style: lineStyleModel.getLineStyle(),
- z2: 1,
- silent: true
- });
- } else {
- shape = new Ring_default({
- shape: {
- cx: polar.cx,
- cy: polar.cy,
- r: radiusExtent[rId],
- r0: radiusExtent[r0Id]
- },
- style: lineStyleModel.getLineStyle(),
- z2: 1,
- silent: true
- });
- }
- shape.style.fill = null;
- group.add(shape);
- },
- axisTick: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
- var tickModel = angleAxisModel.getModel("axisTick");
- var tickLen = (tickModel.get("inside") ? -1 : 1) * tickModel.get("length");
- var radius = radiusExtent[getRadiusIdx(polar)];
- var lines = map(ticksAngles, function(tickAngleItem) {
- return new Line_default({
- shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord)
- });
- });
- group.add(mergePath(lines, {
- style: defaults(tickModel.getModel("lineStyle").getLineStyle(), {
- stroke: angleAxisModel.get(["axisLine", "lineStyle", "color"])
- })
- }));
- },
- minorTick: function(group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) {
- if (!minorTickAngles.length) {
- return;
- }
- var tickModel = angleAxisModel.getModel("axisTick");
- var minorTickModel = angleAxisModel.getModel("minorTick");
- var tickLen = (tickModel.get("inside") ? -1 : 1) * minorTickModel.get("length");
- var radius = radiusExtent[getRadiusIdx(polar)];
- var lines = [];
- for (var i = 0; i < minorTickAngles.length; i++) {
- for (var k = 0; k < minorTickAngles[i].length; k++) {
- lines.push(new Line_default({
- shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord)
- }));
- }
- }
- group.add(mergePath(lines, {
- style: defaults(minorTickModel.getModel("lineStyle").getLineStyle(), defaults(tickModel.getLineStyle(), {
- stroke: angleAxisModel.get(["axisLine", "lineStyle", "color"])
- }))
- }));
- },
- axisLabel: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) {
- var rawCategoryData = angleAxisModel.getCategories(true);
- var commonLabelModel = angleAxisModel.getModel("axisLabel");
- var labelMargin = commonLabelModel.get("margin");
- var triggerEvent = angleAxisModel.get("triggerEvent");
- each(labels, function(labelItem, idx) {
- var labelModel = commonLabelModel;
- var tickValue = labelItem.tickValue;
- var r = radiusExtent[getRadiusIdx(polar)];
- var p = polar.coordToPoint([r + labelMargin, labelItem.coord]);
- var cx = polar.cx;
- var cy = polar.cy;
- var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3 ? "center" : p[0] > cx ? "left" : "right";
- var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3 ? "middle" : p[1] > cy ? "top" : "bottom";
- if (rawCategoryData && rawCategoryData[tickValue]) {
- var rawCategoryItem = rawCategoryData[tickValue];
- if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {
- labelModel = new Model_default(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel);
- }
- }
- var textEl = new Text_default({
- silent: AxisBuilder_default.isLabelSilent(angleAxisModel),
- style: createTextStyle(labelModel, {
- x: p[0],
- y: p[1],
- fill: labelModel.getTextColor() || angleAxisModel.get(["axisLine", "lineStyle", "color"]),
- text: labelItem.formattedLabel,
- align: labelTextAlign,
- verticalAlign: labelTextVerticalAlign
- })
- });
- group.add(textEl);
- if (triggerEvent) {
- var eventData = AxisBuilder_default.makeAxisEventDataBase(angleAxisModel);
- eventData.targetType = "axisLabel";
- eventData.value = labelItem.rawLabel;
- getECData(textEl).eventData = eventData;
- }
- }, this);
- },
- splitLine: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
- var splitLineModel = angleAxisModel.getModel("splitLine");
- var lineStyleModel = splitLineModel.getModel("lineStyle");
- var lineColors = lineStyleModel.get("color");
- var lineCount = 0;
- lineColors = lineColors instanceof Array ? lineColors : [lineColors];
- var splitLines = [];
- for (var i = 0; i < ticksAngles.length; i++) {
- var colorIndex = lineCount++ % lineColors.length;
- splitLines[colorIndex] = splitLines[colorIndex] || [];
- splitLines[colorIndex].push(new Line_default({
- shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord)
- }));
- }
- for (var i = 0; i < splitLines.length; i++) {
- group.add(mergePath(splitLines[i], {
- style: defaults({
- stroke: lineColors[i % lineColors.length]
- }, lineStyleModel.getLineStyle()),
- silent: true,
- z: angleAxisModel.get("z")
- }));
- }
- },
- minorSplitLine: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
- if (!minorTickAngles.length) {
- return;
- }
- var minorSplitLineModel = angleAxisModel.getModel("minorSplitLine");
- var lineStyleModel = minorSplitLineModel.getModel("lineStyle");
- var lines = [];
- for (var i = 0; i < minorTickAngles.length; i++) {
- for (var k = 0; k < minorTickAngles[i].length; k++) {
- lines.push(new Line_default({
- shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord)
- }));
- }
- }
- group.add(mergePath(lines, {
- style: lineStyleModel.getLineStyle(),
- silent: true,
- z: angleAxisModel.get("z")
- }));
- },
- splitArea: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
- if (!ticksAngles.length) {
- return;
- }
- var splitAreaModel = angleAxisModel.getModel("splitArea");
- var areaStyleModel = splitAreaModel.getModel("areaStyle");
- var areaColors = areaStyleModel.get("color");
- var lineCount = 0;
- areaColors = areaColors instanceof Array ? areaColors : [areaColors];
- var splitAreas = [];
- var RADIAN = Math.PI / 180;
- var prevAngle = -ticksAngles[0].coord * RADIAN;
- var r0 = Math.min(radiusExtent[0], radiusExtent[1]);
- var r1 = Math.max(radiusExtent[0], radiusExtent[1]);
- var clockwise = angleAxisModel.get("clockwise");
- for (var i = 1, len = ticksAngles.length; i <= len; i++) {
- var coord = i === len ? ticksAngles[0].coord : ticksAngles[i].coord;
- var colorIndex = lineCount++ % areaColors.length;
- splitAreas[colorIndex] = splitAreas[colorIndex] || [];
- splitAreas[colorIndex].push(new Sector_default({
- shape: {
- cx: polar.cx,
- cy: polar.cy,
- r0,
- r: r1,
- startAngle: prevAngle,
- endAngle: -coord * RADIAN,
- clockwise
- },
- silent: true
- }));
- prevAngle = -coord * RADIAN;
- }
- for (var i = 0; i < splitAreas.length; i++) {
- group.add(mergePath(splitAreas[i], {
- style: defaults({
- fill: areaColors[i % areaColors.length]
- }, areaStyleModel.getAreaStyle()),
- silent: true
- }));
- }
- }
- };
- var AngleAxisView_default = AngleAxisView;
- // node_modules/echarts/lib/component/axis/RadiusAxisView.js
- init_define_APP_INFO();
- var axisBuilderAttrs = ["axisLine", "axisTickLabel", "axisName"];
- var selfBuilderAttrs = ["splitLine", "splitArea", "minorSplitLine"];
- var RadiusAxisView = function(_super) {
- __extends(RadiusAxisView2, _super);
- function RadiusAxisView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = RadiusAxisView2.type;
- _this.axisPointerClass = "PolarAxisPointer";
- return _this;
- }
- RadiusAxisView2.prototype.render = function(radiusAxisModel, ecModel) {
- this.group.removeAll();
- if (!radiusAxisModel.get("show")) {
- return;
- }
- var oldAxisGroup = this._axisGroup;
- var newAxisGroup = this._axisGroup = new Group_default();
- this.group.add(newAxisGroup);
- var radiusAxis = radiusAxisModel.axis;
- var polar = radiusAxis.polar;
- var angleAxis = polar.getAngleAxis();
- var ticksCoords = radiusAxis.getTicksCoords();
- var minorTicksCoords = radiusAxis.getMinorTicksCoords();
- var axisAngle = angleAxis.getExtent()[0];
- var radiusExtent = radiusAxis.getExtent();
- var layout4 = layoutAxis(polar, radiusAxisModel, axisAngle);
- var axisBuilder = new AxisBuilder_default(radiusAxisModel, layout4);
- each(axisBuilderAttrs, axisBuilder.add, axisBuilder);
- newAxisGroup.add(axisBuilder.getGroup());
- groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel);
- each(selfBuilderAttrs, function(name) {
- if (radiusAxisModel.get([name, "show"]) && !radiusAxis.scale.isBlank()) {
- axisElementBuilders[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);
- }
- }, this);
- };
- RadiusAxisView2.type = "radiusAxis";
- return RadiusAxisView2;
- }(AxisView_default);
- var axisElementBuilders = {
- splitLine: function(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {
- var splitLineModel = radiusAxisModel.getModel("splitLine");
- var lineStyleModel = splitLineModel.getModel("lineStyle");
- var lineColors = lineStyleModel.get("color");
- var lineCount = 0;
- lineColors = lineColors instanceof Array ? lineColors : [lineColors];
- var splitLines = [];
- for (var i = 0; i < ticksCoords.length; i++) {
- var colorIndex = lineCount++ % lineColors.length;
- splitLines[colorIndex] = splitLines[colorIndex] || [];
- splitLines[colorIndex].push(new Circle_default({
- shape: {
- cx: polar.cx,
- cy: polar.cy,
- r: Math.max(ticksCoords[i].coord, 0)
- }
- }));
- }
- for (var i = 0; i < splitLines.length; i++) {
- group.add(mergePath(splitLines[i], {
- style: defaults({
- stroke: lineColors[i % lineColors.length],
- fill: null
- }, lineStyleModel.getLineStyle()),
- silent: true
- }));
- }
- },
- minorSplitLine: function(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {
- if (!minorTicksCoords.length) {
- return;
- }
- var minorSplitLineModel = radiusAxisModel.getModel("minorSplitLine");
- var lineStyleModel = minorSplitLineModel.getModel("lineStyle");
- var lines = [];
- for (var i = 0; i < minorTicksCoords.length; i++) {
- for (var k = 0; k < minorTicksCoords[i].length; k++) {
- lines.push(new Circle_default({
- shape: {
- cx: polar.cx,
- cy: polar.cy,
- r: minorTicksCoords[i][k].coord
- }
- }));
- }
- }
- group.add(mergePath(lines, {
- style: defaults({
- fill: null
- }, lineStyleModel.getLineStyle()),
- silent: true
- }));
- },
- splitArea: function(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {
- if (!ticksCoords.length) {
- return;
- }
- var splitAreaModel = radiusAxisModel.getModel("splitArea");
- var areaStyleModel = splitAreaModel.getModel("areaStyle");
- var areaColors = areaStyleModel.get("color");
- var lineCount = 0;
- areaColors = areaColors instanceof Array ? areaColors : [areaColors];
- var splitAreas = [];
- var prevRadius = ticksCoords[0].coord;
- for (var i = 1; i < ticksCoords.length; i++) {
- var colorIndex = lineCount++ % areaColors.length;
- splitAreas[colorIndex] = splitAreas[colorIndex] || [];
- splitAreas[colorIndex].push(new Sector_default({
- shape: {
- cx: polar.cx,
- cy: polar.cy,
- r0: prevRadius,
- r: ticksCoords[i].coord,
- startAngle: 0,
- endAngle: Math.PI * 2
- },
- silent: true
- }));
- prevRadius = ticksCoords[i].coord;
- }
- for (var i = 0; i < splitAreas.length; i++) {
- group.add(mergePath(splitAreas[i], {
- style: defaults({
- fill: areaColors[i % areaColors.length]
- }, areaStyleModel.getAreaStyle()),
- silent: true
- }));
- }
- }
- };
- function layoutAxis(polar, radiusAxisModel, axisAngle) {
- return {
- position: [polar.cx, polar.cy],
- rotation: axisAngle / 180 * Math.PI,
- labelDirection: -1,
- tickDirection: -1,
- nameDirection: 1,
- labelRotate: radiusAxisModel.getModel("axisLabel").get("rotate"),
- z2: 1
- };
- }
- var RadiusAxisView_default = RadiusAxisView;
- // node_modules/echarts/lib/layout/barPolar.js
- init_define_APP_INFO();
- function getSeriesStackId(seriesModel) {
- return seriesModel.get("stack") || "__ec_stack_" + seriesModel.seriesIndex;
- }
- function getAxisKey(polar, axis) {
- return axis.dim + polar.model.componentIndex;
- }
- function barLayoutPolar(seriesType, ecModel, api) {
- var lastStackCoords = {};
- var barWidthAndOffset = calRadialBar(filter(ecModel.getSeriesByType(seriesType), function(seriesModel) {
- return !ecModel.isSeriesFiltered(seriesModel) && seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === "polar";
- }));
- ecModel.eachSeriesByType(seriesType, function(seriesModel) {
- if (seriesModel.coordinateSystem.type !== "polar") {
- return;
- }
- var data = seriesModel.getData();
- var polar = seriesModel.coordinateSystem;
- var baseAxis = polar.getBaseAxis();
- var axisKey = getAxisKey(polar, baseAxis);
- var stackId = getSeriesStackId(seriesModel);
- var columnLayoutInfo = barWidthAndOffset[axisKey][stackId];
- var columnOffset = columnLayoutInfo.offset;
- var columnWidth = columnLayoutInfo.width;
- var valueAxis = polar.getOtherAxis(baseAxis);
- var cx = seriesModel.coordinateSystem.cx;
- var cy = seriesModel.coordinateSystem.cy;
- var barMinHeight = seriesModel.get("barMinHeight") || 0;
- var barMinAngle = seriesModel.get("barMinAngle") || 0;
- lastStackCoords[stackId] = lastStackCoords[stackId] || [];
- var valueDim = data.mapDimension(valueAxis.dim);
- var baseDim = data.mapDimension(baseAxis.dim);
- var stacked = isDimensionStacked(
- data,
- valueDim
- );
- var clampLayout = baseAxis.dim !== "radius" || !seriesModel.get("roundCap", true);
- var valueAxisStart = valueAxis.dataToCoord(0);
- for (var idx = 0, len = data.count(); idx < len; idx++) {
- var value = data.get(valueDim, idx);
- var baseValue = data.get(baseDim, idx);
- var sign = value >= 0 ? "p" : "n";
- var baseCoord = valueAxisStart;
- if (stacked) {
- if (!lastStackCoords[stackId][baseValue]) {
- lastStackCoords[stackId][baseValue] = {
- p: valueAxisStart,
- n: valueAxisStart
- };
- }
- baseCoord = lastStackCoords[stackId][baseValue][sign];
- }
- var r0 = void 0;
- var r = void 0;
- var startAngle = void 0;
- var endAngle = void 0;
- if (valueAxis.dim === "radius") {
- var radiusSpan = valueAxis.dataToCoord(value) - valueAxisStart;
- var angle = baseAxis.dataToCoord(baseValue);
- if (Math.abs(radiusSpan) < barMinHeight) {
- radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight;
- }
- r0 = baseCoord;
- r = baseCoord + radiusSpan;
- startAngle = angle - columnOffset;
- endAngle = startAngle - columnWidth;
- stacked && (lastStackCoords[stackId][baseValue][sign] = r);
- } else {
- var angleSpan = valueAxis.dataToCoord(value, clampLayout) - valueAxisStart;
- var radius = baseAxis.dataToCoord(baseValue);
- if (Math.abs(angleSpan) < barMinAngle) {
- angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle;
- }
- r0 = radius + columnOffset;
- r = r0 + columnWidth;
- startAngle = baseCoord;
- endAngle = baseCoord + angleSpan;
- stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle);
- }
- data.setItemLayout(idx, {
- cx,
- cy,
- r0,
- r,
- startAngle: -startAngle * Math.PI / 180,
- endAngle: -endAngle * Math.PI / 180,
- clockwise: startAngle >= endAngle
- });
- }
- });
- }
- function calRadialBar(barSeries) {
- var columnsMap = {};
- each(barSeries, function(seriesModel, idx) {
- var data = seriesModel.getData();
- var polar = seriesModel.coordinateSystem;
- var baseAxis = polar.getBaseAxis();
- var axisKey = getAxisKey(polar, baseAxis);
- var axisExtent = baseAxis.getExtent();
- var bandWidth = baseAxis.type === "category" ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();
- var columnsOnAxis = columnsMap[axisKey] || {
- bandWidth,
- remainedWidth: bandWidth,
- autoWidthCount: 0,
- categoryGap: "20%",
- gap: "30%",
- stacks: {}
- };
- var stacks = columnsOnAxis.stacks;
- columnsMap[axisKey] = columnsOnAxis;
- var stackId = getSeriesStackId(seriesModel);
- if (!stacks[stackId]) {
- columnsOnAxis.autoWidthCount++;
- }
- stacks[stackId] = stacks[stackId] || {
- width: 0,
- maxWidth: 0
- };
- var barWidth = parsePercent2(seriesModel.get("barWidth"), bandWidth);
- var barMaxWidth = parsePercent2(seriesModel.get("barMaxWidth"), bandWidth);
- var barGap = seriesModel.get("barGap");
- var barCategoryGap = seriesModel.get("barCategoryGap");
- if (barWidth && !stacks[stackId].width) {
- barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);
- stacks[stackId].width = barWidth;
- columnsOnAxis.remainedWidth -= barWidth;
- }
- barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);
- barGap != null && (columnsOnAxis.gap = barGap);
- barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);
- });
- var result = {};
- each(columnsMap, function(columnsOnAxis, coordSysName) {
- result[coordSysName] = {};
- var stacks = columnsOnAxis.stacks;
- var bandWidth = columnsOnAxis.bandWidth;
- var categoryGap = parsePercent2(columnsOnAxis.categoryGap, bandWidth);
- var barGapPercent = parsePercent2(columnsOnAxis.gap, 1);
- var remainedWidth = columnsOnAxis.remainedWidth;
- var autoWidthCount = columnsOnAxis.autoWidthCount;
- var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);
- autoWidth = Math.max(autoWidth, 0);
- each(stacks, function(column, stack) {
- var maxWidth = column.maxWidth;
- if (maxWidth && maxWidth < autoWidth) {
- maxWidth = Math.min(maxWidth, remainedWidth);
- if (column.width) {
- maxWidth = Math.min(maxWidth, column.width);
- }
- remainedWidth -= maxWidth;
- column.width = maxWidth;
- autoWidthCount--;
- }
- });
- autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);
- autoWidth = Math.max(autoWidth, 0);
- var widthSum = 0;
- var lastColumn;
- each(stacks, function(column, idx) {
- if (!column.width) {
- column.width = autoWidth;
- }
- lastColumn = column;
- widthSum += column.width * (1 + barGapPercent);
- });
- if (lastColumn) {
- widthSum -= lastColumn.width * barGapPercent;
- }
- var offset = -widthSum / 2;
- each(stacks, function(column, stackId) {
- result[coordSysName][stackId] = result[coordSysName][stackId] || {
- offset,
- width: column.width
- };
- offset += column.width * (1 + barGapPercent);
- });
- });
- return result;
- }
- var barPolar_default = barLayoutPolar;
- // node_modules/echarts/lib/component/polar/install.js
- var angleAxisExtraOption = {
- startAngle: 90,
- clockwise: true,
- splitNumber: 12,
- axisLabel: {
- rotate: 0
- }
- };
- var radiusAxisExtraOption = {
- splitNumber: 5
- };
- var PolarView = function(_super) {
- __extends(PolarView2, _super);
- function PolarView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = PolarView2.type;
- return _this;
- }
- PolarView2.type = "polar";
- return PolarView2;
- }(Component_default2);
- function install7(registers) {
- use(install5);
- AxisView_default.registerAxisPointerClass("PolarAxisPointer", PolarAxisPointer_default);
- registers.registerCoordinateSystem("polar", polarCreator_default);
- registers.registerComponentModel(PolarModel_default);
- registers.registerComponentView(PolarView);
- axisModelCreator(registers, "angle", AngleAxisModel, angleAxisExtraOption);
- axisModelCreator(registers, "radius", RadiusAxisModel, radiusAxisExtraOption);
- registers.registerComponentView(AngleAxisView_default);
- registers.registerComponentView(RadiusAxisView_default);
- registers.registerLayout(curry(barPolar_default, "bar"));
- }
- // node_modules/echarts/lib/component/singleAxis/install.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/axis/SingleAxisView.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/coord/single/singleAxisHelper.js
- init_define_APP_INFO();
- function layout2(axisModel, opt) {
- opt = opt || {};
- var single = axisModel.coordinateSystem;
- var axis = axisModel.axis;
- var layout4 = {};
- var axisPosition = axis.position;
- var orient = axis.orient;
- var rect = single.getRect();
- var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];
- var positionMap = {
- horizontal: {
- top: rectBound[2],
- bottom: rectBound[3]
- },
- vertical: {
- left: rectBound[0],
- right: rectBound[1]
- }
- };
- layout4.position = [orient === "vertical" ? positionMap.vertical[axisPosition] : rectBound[0], orient === "horizontal" ? positionMap.horizontal[axisPosition] : rectBound[3]];
- var r = {
- horizontal: 0,
- vertical: 1
- };
- layout4.rotation = Math.PI / 2 * r[orient];
- var directionMap = {
- top: -1,
- bottom: 1,
- right: 1,
- left: -1
- };
- layout4.labelDirection = layout4.tickDirection = layout4.nameDirection = directionMap[axisPosition];
- if (axisModel.get(["axisTick", "inside"])) {
- layout4.tickDirection = -layout4.tickDirection;
- }
- if (retrieve(opt.labelInside, axisModel.get(["axisLabel", "inside"]))) {
- layout4.labelDirection = -layout4.labelDirection;
- }
- var labelRotation = opt.rotate;
- labelRotation == null && (labelRotation = axisModel.get(["axisLabel", "rotate"]));
- layout4.labelRotation = axisPosition === "top" ? -labelRotation : labelRotation;
- layout4.z2 = 1;
- return layout4;
- }
- // node_modules/echarts/lib/component/axis/SingleAxisView.js
- var axisBuilderAttrs2 = ["axisLine", "axisTickLabel", "axisName"];
- var selfBuilderAttrs2 = ["splitArea", "splitLine"];
- var SingleAxisView = function(_super) {
- __extends(SingleAxisView2, _super);
- function SingleAxisView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = SingleAxisView2.type;
- _this.axisPointerClass = "SingleAxisPointer";
- return _this;
- }
- SingleAxisView2.prototype.render = function(axisModel, ecModel, api, payload) {
- var group = this.group;
- group.removeAll();
- var oldAxisGroup = this._axisGroup;
- this._axisGroup = new Group_default();
- var layout4 = layout2(axisModel);
- var axisBuilder = new AxisBuilder_default(axisModel, layout4);
- each(axisBuilderAttrs2, axisBuilder.add, axisBuilder);
- group.add(this._axisGroup);
- group.add(axisBuilder.getGroup());
- each(selfBuilderAttrs2, function(name) {
- if (axisModel.get([name, "show"])) {
- axisElementBuilders2[name](this, this.group, this._axisGroup, axisModel);
- }
- }, this);
- groupTransition(oldAxisGroup, this._axisGroup, axisModel);
- _super.prototype.render.call(this, axisModel, ecModel, api, payload);
- };
- SingleAxisView2.prototype.remove = function() {
- rectCoordAxisHandleRemove(this);
- };
- SingleAxisView2.type = "singleAxis";
- return SingleAxisView2;
- }(AxisView_default);
- var axisElementBuilders2 = {
- splitLine: function(axisView, group, axisGroup, axisModel) {
- var axis = axisModel.axis;
- if (axis.scale.isBlank()) {
- return;
- }
- var splitLineModel = axisModel.getModel("splitLine");
- var lineStyleModel = splitLineModel.getModel("lineStyle");
- var lineColors = lineStyleModel.get("color");
- lineColors = lineColors instanceof Array ? lineColors : [lineColors];
- var gridRect = axisModel.coordinateSystem.getRect();
- var isHorizontal = axis.isHorizontal();
- var splitLines = [];
- var lineCount = 0;
- var ticksCoords = axis.getTicksCoords({
- tickModel: splitLineModel
- });
- var p1 = [];
- var p2 = [];
- for (var i = 0; i < ticksCoords.length; ++i) {
- var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);
- if (isHorizontal) {
- p1[0] = tickCoord;
- p1[1] = gridRect.y;
- p2[0] = tickCoord;
- p2[1] = gridRect.y + gridRect.height;
- } else {
- p1[0] = gridRect.x;
- p1[1] = tickCoord;
- p2[0] = gridRect.x + gridRect.width;
- p2[1] = tickCoord;
- }
- var colorIndex = lineCount++ % lineColors.length;
- splitLines[colorIndex] = splitLines[colorIndex] || [];
- splitLines[colorIndex].push(new Line_default({
- subPixelOptimize: true,
- shape: {
- x1: p1[0],
- y1: p1[1],
- x2: p2[0],
- y2: p2[1]
- },
- silent: true
- }));
- }
- var lineStyle = lineStyleModel.getLineStyle(["color"]);
- for (var i = 0; i < splitLines.length; ++i) {
- group.add(mergePath(splitLines[i], {
- style: defaults({
- stroke: lineColors[i % lineColors.length]
- }, lineStyle),
- silent: true
- }));
- }
- },
- splitArea: function(axisView, group, axisGroup, axisModel) {
- rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel);
- }
- };
- var SingleAxisView_default = SingleAxisView;
- // node_modules/echarts/lib/coord/single/AxisModel.js
- init_define_APP_INFO();
- var SingleAxisModel = function(_super) {
- __extends(SingleAxisModel2, _super);
- function SingleAxisModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = SingleAxisModel2.type;
- return _this;
- }
- SingleAxisModel2.prototype.getCoordSysModel = function() {
- return this;
- };
- SingleAxisModel2.type = "singleAxis";
- SingleAxisModel2.layoutMode = "box";
- SingleAxisModel2.defaultOption = {
- left: "5%",
- top: "5%",
- right: "5%",
- bottom: "5%",
- type: "value",
- position: "bottom",
- orient: "horizontal",
- axisLine: {
- show: true,
- lineStyle: {
- width: 1,
- type: "solid"
- }
- },
- tooltip: {
- show: true
- },
- axisTick: {
- show: true,
- length: 6,
- lineStyle: {
- width: 1
- }
- },
- axisLabel: {
- show: true,
- interval: "auto"
- },
- splitLine: {
- show: true,
- lineStyle: {
- type: "dashed",
- opacity: 0.2
- }
- }
- };
- return SingleAxisModel2;
- }(Component_default);
- mixin(SingleAxisModel, AxisModelCommonMixin.prototype);
- var AxisModel_default = SingleAxisModel;
- // node_modules/echarts/lib/coord/single/singleCreator.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/coord/single/Single.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/coord/single/SingleAxis.js
- init_define_APP_INFO();
- var SingleAxis = function(_super) {
- __extends(SingleAxis2, _super);
- function SingleAxis2(dim, scale, coordExtent, axisType, position) {
- var _this = _super.call(this, dim, scale, coordExtent) || this;
- _this.type = axisType || "value";
- _this.position = position || "bottom";
- return _this;
- }
- SingleAxis2.prototype.isHorizontal = function() {
- var position = this.position;
- return position === "top" || position === "bottom";
- };
- SingleAxis2.prototype.pointToData = function(point, clamp) {
- return this.coordinateSystem.pointToData(point)[0];
- };
- return SingleAxis2;
- }(Axis_default);
- var SingleAxis_default = SingleAxis;
- // node_modules/echarts/lib/coord/single/Single.js
- var singleDimensions = ["single"];
- var Single = function() {
- function Single2(axisModel, ecModel, api) {
- this.type = "single";
- this.dimension = "single";
- this.dimensions = singleDimensions;
- this.axisPointerEnabled = true;
- this.model = axisModel;
- this._init(axisModel, ecModel, api);
- }
- Single2.prototype._init = function(axisModel, ecModel, api) {
- var dim = this.dimension;
- var axis = new SingleAxis_default(dim, createScaleByModel(axisModel), [0, 0], axisModel.get("type"), axisModel.get("position"));
- var isCategory = axis.type === "category";
- axis.onBand = isCategory && axisModel.get("boundaryGap");
- axis.inverse = axisModel.get("inverse");
- axis.orient = axisModel.get("orient");
- axisModel.axis = axis;
- axis.model = axisModel;
- axis.coordinateSystem = this;
- this._axis = axis;
- };
- Single2.prototype.update = function(ecModel, api) {
- ecModel.eachSeries(function(seriesModel) {
- if (seriesModel.coordinateSystem === this) {
- var data_1 = seriesModel.getData();
- each(data_1.mapDimensionsAll(this.dimension), function(dim) {
- this._axis.scale.unionExtentFromData(data_1, dim);
- }, this);
- niceScaleExtent(this._axis.scale, this._axis.model);
- }
- }, this);
- };
- Single2.prototype.resize = function(axisModel, api) {
- this._rect = getLayoutRect({
- left: axisModel.get("left"),
- top: axisModel.get("top"),
- right: axisModel.get("right"),
- bottom: axisModel.get("bottom"),
- width: axisModel.get("width"),
- height: axisModel.get("height")
- }, {
- width: api.getWidth(),
- height: api.getHeight()
- });
- this._adjustAxis();
- };
- Single2.prototype.getRect = function() {
- return this._rect;
- };
- Single2.prototype._adjustAxis = function() {
- var rect = this._rect;
- var axis = this._axis;
- var isHorizontal = axis.isHorizontal();
- var extent = isHorizontal ? [0, rect.width] : [0, rect.height];
- var idx = axis.reverse ? 1 : 0;
- axis.setExtent(extent[idx], extent[1 - idx]);
- this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);
- };
- Single2.prototype._updateAxisTransform = function(axis, coordBase) {
- var axisExtent = axis.getExtent();
- var extentSum = axisExtent[0] + axisExtent[1];
- var isHorizontal = axis.isHorizontal();
- axis.toGlobalCoord = isHorizontal ? function(coord) {
- return coord + coordBase;
- } : function(coord) {
- return extentSum - coord + coordBase;
- };
- axis.toLocalCoord = isHorizontal ? function(coord) {
- return coord - coordBase;
- } : function(coord) {
- return extentSum - coord + coordBase;
- };
- };
- Single2.prototype.getAxis = function() {
- return this._axis;
- };
- Single2.prototype.getBaseAxis = function() {
- return this._axis;
- };
- Single2.prototype.getAxes = function() {
- return [this._axis];
- };
- Single2.prototype.getTooltipAxes = function() {
- return {
- baseAxes: [this.getAxis()],
- otherAxes: []
- };
- };
- Single2.prototype.containPoint = function(point) {
- var rect = this.getRect();
- var axis = this.getAxis();
- var orient = axis.orient;
- if (orient === "horizontal") {
- return axis.contain(axis.toLocalCoord(point[0])) && point[1] >= rect.y && point[1] <= rect.y + rect.height;
- } else {
- return axis.contain(axis.toLocalCoord(point[1])) && point[0] >= rect.y && point[0] <= rect.y + rect.height;
- }
- };
- Single2.prototype.pointToData = function(point) {
- var axis = this.getAxis();
- return [axis.coordToData(axis.toLocalCoord(point[axis.orient === "horizontal" ? 0 : 1]))];
- };
- Single2.prototype.dataToPoint = function(val) {
- var axis = this.getAxis();
- var rect = this.getRect();
- var pt = [];
- var idx = axis.orient === "horizontal" ? 0 : 1;
- if (val instanceof Array) {
- val = val[0];
- }
- pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));
- pt[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2;
- return pt;
- };
- Single2.prototype.convertToPixel = function(ecModel, finder, value) {
- var coordSys = getCoordSys2(finder);
- return coordSys === this ? this.dataToPoint(value) : null;
- };
- Single2.prototype.convertFromPixel = function(ecModel, finder, pixel) {
- var coordSys = getCoordSys2(finder);
- return coordSys === this ? this.pointToData(pixel) : null;
- };
- return Single2;
- }();
- function getCoordSys2(finder) {
- var seriesModel = finder.seriesModel;
- var singleModel = finder.singleAxisModel;
- return singleModel && singleModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;
- }
- var Single_default = Single;
- // node_modules/echarts/lib/coord/single/singleCreator.js
- function create2(ecModel, api) {
- var singles = [];
- ecModel.eachComponent("singleAxis", function(axisModel, idx) {
- var single = new Single_default(axisModel, ecModel, api);
- single.name = "single_" + idx;
- single.resize(axisModel, api);
- axisModel.coordinateSystem = single;
- singles.push(single);
- });
- ecModel.eachSeries(function(seriesModel) {
- if (seriesModel.get("coordinateSystem") === "singleAxis") {
- var singleAxisModel = seriesModel.getReferringComponents("singleAxis", SINGLE_REFERRING).models[0];
- seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;
- }
- });
- return singles;
- }
- var singleCreator = {
- create: create2,
- dimensions: singleDimensions
- };
- var singleCreator_default = singleCreator;
- // node_modules/echarts/lib/component/axisPointer/SingleAxisPointer.js
- init_define_APP_INFO();
- var XY = ["x", "y"];
- var WH = ["width", "height"];
- var SingleAxisPointer = function(_super) {
- __extends(SingleAxisPointer2, _super);
- function SingleAxisPointer2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- SingleAxisPointer2.prototype.makeElOption = function(elOption, value, axisModel, axisPointerModel, api) {
- var axis = axisModel.axis;
- var coordSys = axis.coordinateSystem;
- var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis));
- var pixelValue = coordSys.dataToPoint(value)[0];
- var axisPointerType = axisPointerModel.get("type");
- if (axisPointerType && axisPointerType !== "none") {
- var elStyle = buildElStyle(axisPointerModel);
- var pointerOption = pointerShapeBuilder3[axisPointerType](axis, pixelValue, otherExtent);
- pointerOption.style = elStyle;
- elOption.graphicKey = pointerOption.type;
- elOption.pointer = pointerOption;
- }
- var layoutInfo = layout2(axisModel);
- buildCartesianSingleLabelElOption(
- value,
- elOption,
- layoutInfo,
- axisModel,
- axisPointerModel,
- api
- );
- };
- SingleAxisPointer2.prototype.getHandleTransform = function(value, axisModel, axisPointerModel) {
- var layoutInfo = layout2(axisModel, {
- labelInside: false
- });
- layoutInfo.labelMargin = axisPointerModel.get(["handle", "margin"]);
- var position = getTransformedPosition(axisModel.axis, value, layoutInfo);
- return {
- x: position[0],
- y: position[1],
- rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)
- };
- };
- SingleAxisPointer2.prototype.updateHandleTransform = function(transform, delta, axisModel, axisPointerModel) {
- var axis = axisModel.axis;
- var coordSys = axis.coordinateSystem;
- var dimIndex = getPointDimIndex(axis);
- var axisExtent = getGlobalExtent(coordSys, dimIndex);
- var currPosition = [transform.x, transform.y];
- currPosition[dimIndex] += delta[dimIndex];
- currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);
- currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);
- var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex);
- var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;
- var cursorPoint = [cursorOtherValue, cursorOtherValue];
- cursorPoint[dimIndex] = currPosition[dimIndex];
- return {
- x: currPosition[0],
- y: currPosition[1],
- rotation: transform.rotation,
- cursorPoint,
- tooltipOption: {
- verticalAlign: "middle"
- }
- };
- };
- return SingleAxisPointer2;
- }(BaseAxisPointer_default);
- var pointerShapeBuilder3 = {
- line: function(axis, pixelValue, otherExtent) {
- var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis));
- return {
- type: "Line",
- subPixelOptimize: true,
- shape: targetShape
- };
- },
- shadow: function(axis, pixelValue, otherExtent) {
- var bandWidth = axis.getBandWidth();
- var span = otherExtent[1] - otherExtent[0];
- return {
- type: "Rect",
- shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis))
- };
- }
- };
- function getPointDimIndex(axis) {
- return axis.isHorizontal() ? 0 : 1;
- }
- function getGlobalExtent(coordSys, dimIndex) {
- var rect = coordSys.getRect();
- return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]];
- }
- var SingleAxisPointer_default = SingleAxisPointer;
- // node_modules/echarts/lib/component/singleAxis/install.js
- var SingleView = function(_super) {
- __extends(SingleView2, _super);
- function SingleView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = SingleView2.type;
- return _this;
- }
- SingleView2.type = "single";
- return SingleView2;
- }(Component_default2);
- function install8(registers) {
- use(install5);
- AxisView_default.registerAxisPointerClass("SingleAxisPointer", SingleAxisPointer_default);
- registers.registerComponentView(SingleView);
- registers.registerComponentView(SingleAxisView_default);
- registers.registerComponentModel(AxisModel_default);
- axisModelCreator(registers, "single", AxisModel_default, AxisModel_default.defaultOption);
- registers.registerCoordinateSystem("single", singleCreator_default);
- }
- // node_modules/echarts/lib/component/calendar/install.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/coord/calendar/CalendarModel.js
- init_define_APP_INFO();
- var CalendarModel = function(_super) {
- __extends(CalendarModel2, _super);
- function CalendarModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = CalendarModel2.type;
- return _this;
- }
- CalendarModel2.prototype.init = function(option, parentModel, ecModel) {
- var inputPositionParams = getLayoutParams(option);
- _super.prototype.init.apply(this, arguments);
- mergeAndNormalizeLayoutParams(option, inputPositionParams);
- };
- CalendarModel2.prototype.mergeOption = function(option) {
- _super.prototype.mergeOption.apply(this, arguments);
- mergeAndNormalizeLayoutParams(this.option, option);
- };
- CalendarModel2.prototype.getCellSize = function() {
- return this.option.cellSize;
- };
- CalendarModel2.type = "calendar";
- CalendarModel2.defaultOption = {
- z: 2,
- left: 80,
- top: 60,
- cellSize: 20,
- orient: "horizontal",
- splitLine: {
- show: true,
- lineStyle: {
- color: "#000",
- width: 1,
- type: "solid"
- }
- },
- itemStyle: {
- color: "#fff",
- borderWidth: 1,
- borderColor: "#ccc"
- },
- dayLabel: {
- show: true,
- firstDay: 0,
- position: "start",
- margin: "50%",
- color: "#000"
- },
- monthLabel: {
- show: true,
- position: "start",
- margin: 5,
- align: "center",
- formatter: null,
- color: "#000"
- },
- yearLabel: {
- show: true,
- position: null,
- margin: 30,
- formatter: null,
- color: "#ccc",
- fontFamily: "sans-serif",
- fontWeight: "bolder",
- fontSize: 20
- }
- };
- return CalendarModel2;
- }(Component_default);
- function mergeAndNormalizeLayoutParams(target, raw) {
- var cellSize = target.cellSize;
- var cellSizeArr;
- if (!isArray(cellSize)) {
- cellSizeArr = target.cellSize = [cellSize, cellSize];
- } else {
- cellSizeArr = cellSize;
- }
- if (cellSizeArr.length === 1) {
- cellSizeArr[1] = cellSizeArr[0];
- }
- var ignoreSize = map([0, 1], function(hvIdx) {
- if (sizeCalculable(raw, hvIdx)) {
- cellSizeArr[hvIdx] = "auto";
- }
- return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== "auto";
- });
- mergeLayoutParam(target, raw, {
- type: "box",
- ignoreSize
- });
- }
- var CalendarModel_default = CalendarModel;
- // node_modules/echarts/lib/component/calendar/CalendarView.js
- init_define_APP_INFO();
- var CalendarView = function(_super) {
- __extends(CalendarView2, _super);
- function CalendarView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = CalendarView2.type;
- return _this;
- }
- CalendarView2.prototype.render = function(calendarModel, ecModel, api) {
- var group = this.group;
- group.removeAll();
- var coordSys = calendarModel.coordinateSystem;
- var rangeData = coordSys.getRangeInfo();
- var orient = coordSys.getOrient();
- var localeModel = ecModel.getLocaleModel();
- this._renderDayRect(calendarModel, rangeData, group);
- this._renderLines(calendarModel, rangeData, orient, group);
- this._renderYearText(calendarModel, rangeData, orient, group);
- this._renderMonthText(calendarModel, localeModel, orient, group);
- this._renderWeekText(calendarModel, localeModel, rangeData, orient, group);
- };
- CalendarView2.prototype._renderDayRect = function(calendarModel, rangeData, group) {
- var coordSys = calendarModel.coordinateSystem;
- var itemRectStyleModel = calendarModel.getModel("itemStyle").getItemStyle();
- var sw = coordSys.getCellWidth();
- var sh = coordSys.getCellHeight();
- for (var i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time) {
- var point = coordSys.dataToRect([i], false).tl;
- var rect = new Rect_default({
- shape: {
- x: point[0],
- y: point[1],
- width: sw,
- height: sh
- },
- cursor: "default",
- style: itemRectStyleModel
- });
- group.add(rect);
- }
- };
- CalendarView2.prototype._renderLines = function(calendarModel, rangeData, orient, group) {
- var self = this;
- var coordSys = calendarModel.coordinateSystem;
- var lineStyleModel = calendarModel.getModel(["splitLine", "lineStyle"]).getLineStyle();
- var show = calendarModel.get(["splitLine", "show"]);
- var lineWidth = lineStyleModel.lineWidth;
- this._tlpoints = [];
- this._blpoints = [];
- this._firstDayOfMonth = [];
- this._firstDayPoints = [];
- var firstDay = rangeData.start;
- for (var i = 0; firstDay.time <= rangeData.end.time; i++) {
- addPoints(firstDay.formatedDate);
- if (i === 0) {
- firstDay = coordSys.getDateInfo(rangeData.start.y + "-" + rangeData.start.m);
- }
- var date = firstDay.date;
- date.setMonth(date.getMonth() + 1);
- firstDay = coordSys.getDateInfo(date);
- }
- addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate);
- function addPoints(date2) {
- self._firstDayOfMonth.push(coordSys.getDateInfo(date2));
- self._firstDayPoints.push(coordSys.dataToRect([date2], false).tl);
- var points = self._getLinePointsOfOneWeek(calendarModel, date2, orient);
- self._tlpoints.push(points[0]);
- self._blpoints.push(points[points.length - 1]);
- show && self._drawSplitline(points, lineStyleModel, group);
- }
- show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group);
- show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group);
- };
- CalendarView2.prototype._getEdgesPoints = function(points, lineWidth, orient) {
- var rs = [points[0].slice(), points[points.length - 1].slice()];
- var idx = orient === "horizontal" ? 0 : 1;
- rs[0][idx] = rs[0][idx] - lineWidth / 2;
- rs[1][idx] = rs[1][idx] + lineWidth / 2;
- return rs;
- };
- CalendarView2.prototype._drawSplitline = function(points, lineStyle, group) {
- var poyline = new Polyline_default({
- z2: 20,
- shape: {
- points
- },
- style: lineStyle
- });
- group.add(poyline);
- };
- CalendarView2.prototype._getLinePointsOfOneWeek = function(calendarModel, date, orient) {
- var coordSys = calendarModel.coordinateSystem;
- var parsedDate = coordSys.getDateInfo(date);
- var points = [];
- for (var i = 0; i < 7; i++) {
- var tmpD = coordSys.getNextNDay(parsedDate.time, i);
- var point = coordSys.dataToRect([tmpD.time], false);
- points[2 * tmpD.day] = point.tl;
- points[2 * tmpD.day + 1] = point[orient === "horizontal" ? "bl" : "tr"];
- }
- return points;
- };
- CalendarView2.prototype._formatterLabel = function(formatter, params) {
- if (isString(formatter) && formatter) {
- return formatTplSimple(formatter, params);
- }
- if (isFunction(formatter)) {
- return formatter(params);
- }
- return params.nameMap;
- };
- CalendarView2.prototype._yearTextPositionControl = function(textEl, point, orient, position, margin) {
- var x = point[0];
- var y = point[1];
- var aligns = ["center", "bottom"];
- if (position === "bottom") {
- y += margin;
- aligns = ["center", "top"];
- } else if (position === "left") {
- x -= margin;
- } else if (position === "right") {
- x += margin;
- aligns = ["center", "top"];
- } else {
- y -= margin;
- }
- var rotate2 = 0;
- if (position === "left" || position === "right") {
- rotate2 = Math.PI / 2;
- }
- return {
- rotation: rotate2,
- x,
- y,
- style: {
- align: aligns[0],
- verticalAlign: aligns[1]
- }
- };
- };
- CalendarView2.prototype._renderYearText = function(calendarModel, rangeData, orient, group) {
- var yearLabel = calendarModel.getModel("yearLabel");
- if (!yearLabel.get("show")) {
- return;
- }
- var margin = yearLabel.get("margin");
- var pos = yearLabel.get("position");
- if (!pos) {
- pos = orient !== "horizontal" ? "top" : "left";
- }
- var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]];
- var xc = (points[0][0] + points[1][0]) / 2;
- var yc = (points[0][1] + points[1][1]) / 2;
- var idx = orient === "horizontal" ? 0 : 1;
- var posPoints = {
- top: [xc, points[idx][1]],
- bottom: [xc, points[1 - idx][1]],
- left: [points[1 - idx][0], yc],
- right: [points[idx][0], yc]
- };
- var name = rangeData.start.y;
- if (+rangeData.end.y > +rangeData.start.y) {
- name = name + "-" + rangeData.end.y;
- }
- var formatter = yearLabel.get("formatter");
- var params = {
- start: rangeData.start.y,
- end: rangeData.end.y,
- nameMap: name
- };
- var content = this._formatterLabel(formatter, params);
- var yearText = new Text_default({
- z2: 30,
- style: createTextStyle(yearLabel, {
- text: content
- })
- });
- yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));
- group.add(yearText);
- };
- CalendarView2.prototype._monthTextPositionControl = function(point, isCenter, orient, position, margin) {
- var align = "left";
- var vAlign = "top";
- var x = point[0];
- var y = point[1];
- if (orient === "horizontal") {
- y = y + margin;
- if (isCenter) {
- align = "center";
- }
- if (position === "start") {
- vAlign = "bottom";
- }
- } else {
- x = x + margin;
- if (isCenter) {
- vAlign = "middle";
- }
- if (position === "start") {
- align = "right";
- }
- }
- return {
- x,
- y,
- align,
- verticalAlign: vAlign
- };
- };
- CalendarView2.prototype._renderMonthText = function(calendarModel, localeModel, orient, group) {
- var monthLabel = calendarModel.getModel("monthLabel");
- if (!monthLabel.get("show")) {
- return;
- }
- var nameMap = monthLabel.get("nameMap");
- var margin = monthLabel.get("margin");
- var pos = monthLabel.get("position");
- var align = monthLabel.get("align");
- var termPoints = [this._tlpoints, this._blpoints];
- if (!nameMap || isString(nameMap)) {
- if (nameMap) {
- localeModel = getLocaleModel(nameMap) || localeModel;
- }
- nameMap = localeModel.get(["time", "monthAbbr"]) || [];
- }
- var idx = pos === "start" ? 0 : 1;
- var axis = orient === "horizontal" ? 0 : 1;
- margin = pos === "start" ? -margin : margin;
- var isCenter = align === "center";
- for (var i = 0; i < termPoints[idx].length - 1; i++) {
- var tmp = termPoints[idx][i].slice();
- var firstDay = this._firstDayOfMonth[i];
- if (isCenter) {
- var firstDayPoints = this._firstDayPoints[i];
- tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2;
- }
- var formatter = monthLabel.get("formatter");
- var name_1 = nameMap[+firstDay.m - 1];
- var params = {
- yyyy: firstDay.y,
- yy: (firstDay.y + "").slice(2),
- MM: firstDay.m,
- M: +firstDay.m,
- nameMap: name_1
- };
- var content = this._formatterLabel(formatter, params);
- var monthText = new Text_default({
- z2: 30,
- style: extend(createTextStyle(monthLabel, {
- text: content
- }), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin))
- });
- group.add(monthText);
- }
- };
- CalendarView2.prototype._weekTextPositionControl = function(point, orient, position, margin, cellSize) {
- var align = "center";
- var vAlign = "middle";
- var x = point[0];
- var y = point[1];
- var isStart = position === "start";
- if (orient === "horizontal") {
- x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2;
- align = isStart ? "right" : "left";
- } else {
- y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2;
- vAlign = isStart ? "bottom" : "top";
- }
- return {
- x,
- y,
- align,
- verticalAlign: vAlign
- };
- };
- CalendarView2.prototype._renderWeekText = function(calendarModel, localeModel, rangeData, orient, group) {
- var dayLabel = calendarModel.getModel("dayLabel");
- if (!dayLabel.get("show")) {
- return;
- }
- var coordSys = calendarModel.coordinateSystem;
- var pos = dayLabel.get("position");
- var nameMap = dayLabel.get("nameMap");
- var margin = dayLabel.get("margin");
- var firstDayOfWeek = coordSys.getFirstDayOfWeek();
- if (!nameMap || isString(nameMap)) {
- if (nameMap) {
- localeModel = getLocaleModel(nameMap) || localeModel;
- }
- var dayOfWeekShort = localeModel.get(["time", "dayOfWeekShort"]);
- nameMap = dayOfWeekShort || map(localeModel.get(["time", "dayOfWeekAbbr"]), function(val) {
- return val[0];
- });
- }
- var start = coordSys.getNextNDay(rangeData.end.time, 7 - rangeData.lweek).time;
- var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()];
- margin = parsePercent2(margin, Math.min(cellSize[1], cellSize[0]));
- if (pos === "start") {
- start = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time;
- margin = -margin;
- }
- for (var i = 0; i < 7; i++) {
- var tmpD = coordSys.getNextNDay(start, i);
- var point = coordSys.dataToRect([tmpD.time], false).center;
- var day = i;
- day = Math.abs((i + firstDayOfWeek) % 7);
- var weekText = new Text_default({
- z2: 30,
- style: extend(createTextStyle(dayLabel, {
- text: nameMap[day]
- }), this._weekTextPositionControl(point, orient, pos, margin, cellSize))
- });
- group.add(weekText);
- }
- };
- CalendarView2.type = "calendar";
- return CalendarView2;
- }(Component_default2);
- var CalendarView_default = CalendarView;
- // node_modules/echarts/lib/coord/calendar/Calendar.js
- init_define_APP_INFO();
- var PROXIMATE_ONE_DAY = 864e5;
- var Calendar = function() {
- function Calendar2(calendarModel, ecModel, api) {
- this.type = "calendar";
- this.dimensions = Calendar2.dimensions;
- this.getDimensionsInfo = Calendar2.getDimensionsInfo;
- this._model = calendarModel;
- }
- Calendar2.getDimensionsInfo = function() {
- return [{
- name: "time",
- type: "time"
- }, "value"];
- };
- Calendar2.prototype.getRangeInfo = function() {
- return this._rangeInfo;
- };
- Calendar2.prototype.getModel = function() {
- return this._model;
- };
- Calendar2.prototype.getRect = function() {
- return this._rect;
- };
- Calendar2.prototype.getCellWidth = function() {
- return this._sw;
- };
- Calendar2.prototype.getCellHeight = function() {
- return this._sh;
- };
- Calendar2.prototype.getOrient = function() {
- return this._orient;
- };
- Calendar2.prototype.getFirstDayOfWeek = function() {
- return this._firstDayOfWeek;
- };
- Calendar2.prototype.getDateInfo = function(date) {
- date = parseDate(date);
- var y = date.getFullYear();
- var m = date.getMonth() + 1;
- var mStr = m < 10 ? "0" + m : "" + m;
- var d = date.getDate();
- var dStr = d < 10 ? "0" + d : "" + d;
- var day = date.getDay();
- day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7);
- return {
- y: y + "",
- m: mStr,
- d: dStr,
- day,
- time: date.getTime(),
- formatedDate: y + "-" + mStr + "-" + dStr,
- date
- };
- };
- Calendar2.prototype.getNextNDay = function(date, n) {
- n = n || 0;
- if (n === 0) {
- return this.getDateInfo(date);
- }
- date = new Date(this.getDateInfo(date).time);
- date.setDate(date.getDate() + n);
- return this.getDateInfo(date);
- };
- Calendar2.prototype.update = function(ecModel, api) {
- this._firstDayOfWeek = +this._model.getModel("dayLabel").get("firstDay");
- this._orient = this._model.get("orient");
- this._lineWidth = this._model.getModel("itemStyle").getItemStyle().lineWidth || 0;
- this._rangeInfo = this._getRangeInfo(this._initRangeOption());
- var weeks = this._rangeInfo.weeks || 1;
- var whNames = ["width", "height"];
- var cellSize = this._model.getCellSize().slice();
- var layoutParams = this._model.getBoxLayoutParams();
- var cellNumbers = this._orient === "horizontal" ? [weeks, 7] : [7, weeks];
- each([0, 1], function(idx) {
- if (cellSizeSpecified(cellSize, idx)) {
- layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx];
- }
- });
- var whGlobal = {
- width: api.getWidth(),
- height: api.getHeight()
- };
- var calendarRect = this._rect = getLayoutRect(layoutParams, whGlobal);
- each([0, 1], function(idx) {
- if (!cellSizeSpecified(cellSize, idx)) {
- cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx];
- }
- });
- function cellSizeSpecified(cellSize2, idx) {
- return cellSize2[idx] != null && cellSize2[idx] !== "auto";
- }
- this._sw = cellSize[0];
- this._sh = cellSize[1];
- };
- Calendar2.prototype.dataToPoint = function(data, clamp) {
- isArray(data) && (data = data[0]);
- clamp == null && (clamp = true);
- var dayInfo = this.getDateInfo(data);
- var range = this._rangeInfo;
- var date = dayInfo.formatedDate;
- if (clamp && !(dayInfo.time >= range.start.time && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY)) {
- return [NaN, NaN];
- }
- var week = dayInfo.day;
- var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek;
- if (this._orient === "vertical") {
- return [this._rect.x + week * this._sw + this._sw / 2, this._rect.y + nthWeek * this._sh + this._sh / 2];
- }
- return [this._rect.x + nthWeek * this._sw + this._sw / 2, this._rect.y + week * this._sh + this._sh / 2];
- };
- Calendar2.prototype.pointToData = function(point) {
- var date = this.pointToDate(point);
- return date && date.time;
- };
- Calendar2.prototype.dataToRect = function(data, clamp) {
- var point = this.dataToPoint(data, clamp);
- return {
- contentShape: {
- x: point[0] - (this._sw - this._lineWidth) / 2,
- y: point[1] - (this._sh - this._lineWidth) / 2,
- width: this._sw - this._lineWidth,
- height: this._sh - this._lineWidth
- },
- center: point,
- tl: [point[0] - this._sw / 2, point[1] - this._sh / 2],
- tr: [point[0] + this._sw / 2, point[1] - this._sh / 2],
- br: [point[0] + this._sw / 2, point[1] + this._sh / 2],
- bl: [point[0] - this._sw / 2, point[1] + this._sh / 2]
- };
- };
- Calendar2.prototype.pointToDate = function(point) {
- var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1;
- var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1;
- var range = this._rangeInfo.range;
- if (this._orient === "vertical") {
- return this._getDateByWeeksAndDay(nthY, nthX - 1, range);
- }
- return this._getDateByWeeksAndDay(nthX, nthY - 1, range);
- };
- Calendar2.prototype.convertToPixel = function(ecModel, finder, value) {
- var coordSys = getCoordSys3(finder);
- return coordSys === this ? coordSys.dataToPoint(value) : null;
- };
- Calendar2.prototype.convertFromPixel = function(ecModel, finder, pixel) {
- var coordSys = getCoordSys3(finder);
- return coordSys === this ? coordSys.pointToData(pixel) : null;
- };
- Calendar2.prototype.containPoint = function(point) {
- console.warn("Not implemented.");
- return false;
- };
- Calendar2.prototype._initRangeOption = function() {
- var range = this._model.get("range");
- var normalizedRange;
- if (isArray(range) && range.length === 1) {
- range = range[0];
- }
- if (!isArray(range)) {
- var rangeStr = range.toString();
- if (/^\d{4}$/.test(rangeStr)) {
- normalizedRange = [rangeStr + "-01-01", rangeStr + "-12-31"];
- }
- if (/^\d{4}[\/|-]\d{1,2}$/.test(rangeStr)) {
- var start = this.getDateInfo(rangeStr);
- var firstDay = start.date;
- firstDay.setMonth(firstDay.getMonth() + 1);
- var end = this.getNextNDay(firstDay, -1);
- normalizedRange = [start.formatedDate, end.formatedDate];
- }
- if (/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(rangeStr)) {
- normalizedRange = [rangeStr, rangeStr];
- }
- } else {
- normalizedRange = range;
- }
- if (!normalizedRange) {
- if (true) {
- logError("Invalid date range.");
- }
- return range;
- }
- var tmp = this._getRangeInfo(normalizedRange);
- if (tmp.start.time > tmp.end.time) {
- normalizedRange.reverse();
- }
- return normalizedRange;
- };
- Calendar2.prototype._getRangeInfo = function(range) {
- var parsedRange = [this.getDateInfo(range[0]), this.getDateInfo(range[1])];
- var reversed;
- if (parsedRange[0].time > parsedRange[1].time) {
- reversed = true;
- parsedRange.reverse();
- }
- var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY) - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1;
- var date = new Date(parsedRange[0].time);
- var startDateNum = date.getDate();
- var endDateNum = parsedRange[1].date.getDate();
- date.setDate(startDateNum + allDay - 1);
- var dateNum = date.getDate();
- if (dateNum !== endDateNum) {
- var sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1;
- while ((dateNum = date.getDate()) !== endDateNum && (date.getTime() - parsedRange[1].time) * sign > 0) {
- allDay -= sign;
- date.setDate(dateNum - sign);
- }
- }
- var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7);
- var nthWeek = reversed ? -weeks + 1 : weeks - 1;
- reversed && parsedRange.reverse();
- return {
- range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate],
- start: parsedRange[0],
- end: parsedRange[1],
- allDay,
- weeks,
- nthWeek,
- fweek: parsedRange[0].day,
- lweek: parsedRange[1].day
- };
- };
- Calendar2.prototype._getDateByWeeksAndDay = function(nthWeek, day, range) {
- var rangeInfo = this._getRangeInfo(range);
- if (nthWeek > rangeInfo.weeks || nthWeek === 0 && day < rangeInfo.fweek || nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) {
- return null;
- }
- var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day;
- var date = new Date(rangeInfo.start.time);
- date.setDate(+rangeInfo.start.d + nthDay);
- return this.getDateInfo(date);
- };
- Calendar2.create = function(ecModel, api) {
- var calendarList = [];
- ecModel.eachComponent("calendar", function(calendarModel) {
- var calendar = new Calendar2(calendarModel, ecModel, api);
- calendarList.push(calendar);
- calendarModel.coordinateSystem = calendar;
- });
- ecModel.eachSeries(function(calendarSeries) {
- if (calendarSeries.get("coordinateSystem") === "calendar") {
- calendarSeries.coordinateSystem = calendarList[calendarSeries.get("calendarIndex") || 0];
- }
- });
- return calendarList;
- };
- Calendar2.dimensions = ["time", "value"];
- return Calendar2;
- }();
- function getCoordSys3(finder) {
- var calendarModel = finder.calendarModel;
- var seriesModel = finder.seriesModel;
- var coordSys = calendarModel ? calendarModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem : null;
- return coordSys;
- }
- var Calendar_default = Calendar;
- // node_modules/echarts/lib/component/calendar/install.js
- function install9(registers) {
- registers.registerComponentModel(CalendarModel_default);
- registers.registerComponentView(CalendarView_default);
- registers.registerCoordinateSystem("calendar", Calendar_default);
- }
- // node_modules/echarts/lib/component/graphic/install.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/graphic/GraphicModel.js
- init_define_APP_INFO();
- function setKeyInfoToNewElOption(resultItem, newElOption) {
- var existElOption = resultItem.existing;
- newElOption.id = resultItem.keyInfo.id;
- !newElOption.type && existElOption && (newElOption.type = existElOption.type);
- if (newElOption.parentId == null) {
- var newElParentOption = newElOption.parentOption;
- if (newElParentOption) {
- newElOption.parentId = newElParentOption.id;
- } else if (existElOption) {
- newElOption.parentId = existElOption.parentId;
- }
- }
- newElOption.parentOption = null;
- }
- function isSetLoc(obj, props) {
- var isSet;
- each(props, function(prop) {
- obj[prop] != null && obj[prop] !== "auto" && (isSet = true);
- });
- return isSet;
- }
- function mergeNewElOptionToExist(existList, index, newElOption) {
- var newElOptCopy = extend({}, newElOption);
- var existElOption = existList[index];
- var $action = newElOption.$action || "merge";
- if ($action === "merge") {
- if (existElOption) {
- if (true) {
- var newType = newElOption.type;
- assert(!newType || existElOption.type === newType, 'Please set $action: "replace" to change `type`');
- }
- merge(existElOption, newElOptCopy, true);
- mergeLayoutParam(existElOption, newElOptCopy, {
- ignoreSize: true
- });
- copyLayoutParams(newElOption, existElOption);
- copyTransitionInfo(newElOption, existElOption);
- copyTransitionInfo(newElOption, existElOption, "shape");
- copyTransitionInfo(newElOption, existElOption, "style");
- copyTransitionInfo(newElOption, existElOption, "extra");
- newElOption.clipPath = existElOption.clipPath;
- } else {
- existList[index] = newElOptCopy;
- }
- } else if ($action === "replace") {
- existList[index] = newElOptCopy;
- } else if ($action === "remove") {
- existElOption && (existList[index] = null);
- }
- }
- var TRANSITION_PROPS_TO_COPY = ["transition", "enterFrom", "leaveTo"];
- var ROOT_TRANSITION_PROPS_TO_COPY = TRANSITION_PROPS_TO_COPY.concat(["enterAnimation", "updateAnimation", "leaveAnimation"]);
- function copyTransitionInfo(target, source, targetProp) {
- if (targetProp) {
- if (!target[targetProp] && source[targetProp]) {
- target[targetProp] = {};
- }
- target = target[targetProp];
- source = source[targetProp];
- }
- if (!target || !source) {
- return;
- }
- var props = targetProp ? TRANSITION_PROPS_TO_COPY : ROOT_TRANSITION_PROPS_TO_COPY;
- for (var i = 0; i < props.length; i++) {
- var prop = props[i];
- if (target[prop] == null && source[prop] != null) {
- target[prop] = source[prop];
- }
- }
- }
- function setLayoutInfoToExist(existItem, newElOption) {
- if (!existItem) {
- return;
- }
- existItem.hv = newElOption.hv = [
- isSetLoc(newElOption, ["left", "right"]),
- isSetLoc(newElOption, ["top", "bottom"])
- ];
- if (existItem.type === "group") {
- var existingGroupOpt = existItem;
- var newGroupOpt = newElOption;
- existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0);
- existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0);
- }
- }
- var GraphicComponentModel = function(_super) {
- __extends(GraphicComponentModel2, _super);
- function GraphicComponentModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = GraphicComponentModel2.type;
- _this.preventAutoZ = true;
- return _this;
- }
- GraphicComponentModel2.prototype.mergeOption = function(option, ecModel) {
- var elements = this.option.elements;
- this.option.elements = null;
- _super.prototype.mergeOption.call(this, option, ecModel);
- this.option.elements = elements;
- };
- GraphicComponentModel2.prototype.optionUpdated = function(newOption, isInit) {
- var thisOption = this.option;
- var newList = (isInit ? thisOption : newOption).elements;
- var existList = thisOption.elements = isInit ? [] : thisOption.elements;
- var flattenedList = [];
- this._flatten(newList, flattenedList, null);
- var mappingResult = mappingToExists(existList, flattenedList, "normalMerge");
- var elOptionsToUpdate = this._elOptionsToUpdate = [];
- each(mappingResult, function(resultItem, index) {
- var newElOption = resultItem.newOption;
- if (true) {
- assert(isObject(newElOption) || resultItem.existing, "Empty graphic option definition");
- }
- if (!newElOption) {
- return;
- }
- elOptionsToUpdate.push(newElOption);
- setKeyInfoToNewElOption(resultItem, newElOption);
- mergeNewElOptionToExist(existList, index, newElOption);
- setLayoutInfoToExist(existList[index], newElOption);
- }, this);
- thisOption.elements = filter(existList, function(item) {
- item && delete item.$action;
- return item != null;
- });
- };
- GraphicComponentModel2.prototype._flatten = function(optionList, result, parentOption) {
- each(optionList, function(option) {
- if (!option) {
- return;
- }
- if (parentOption) {
- option.parentOption = parentOption;
- }
- result.push(option);
- var children = option.children;
- if (children && children.length) {
- this._flatten(children, result, option);
- }
- delete option.children;
- }, this);
- };
- GraphicComponentModel2.prototype.useElOptionsToUpdate = function() {
- var els = this._elOptionsToUpdate;
- this._elOptionsToUpdate = null;
- return els;
- };
- GraphicComponentModel2.type = "graphic";
- GraphicComponentModel2.defaultOption = {
- elements: []
- };
- return GraphicComponentModel2;
- }(Component_default);
- // node_modules/echarts/lib/component/graphic/GraphicView.js
- init_define_APP_INFO();
- var nonShapeGraphicElements = {
- path: null,
- compoundPath: null,
- group: Group_default,
- image: Image_default,
- text: Text_default
- };
- var inner5 = makeInner();
- var GraphicComponentView = function(_super) {
- __extends(GraphicComponentView2, _super);
- function GraphicComponentView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = GraphicComponentView2.type;
- return _this;
- }
- GraphicComponentView2.prototype.init = function() {
- this._elMap = createHashMap();
- };
- GraphicComponentView2.prototype.render = function(graphicModel, ecModel, api) {
- if (graphicModel !== this._lastGraphicModel) {
- this._clear();
- }
- this._lastGraphicModel = graphicModel;
- this._updateElements(graphicModel);
- this._relocate(graphicModel, api);
- };
- GraphicComponentView2.prototype._updateElements = function(graphicModel) {
- var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();
- if (!elOptionsToUpdate) {
- return;
- }
- var elMap = this._elMap;
- var rootGroup = this.group;
- var globalZ = graphicModel.get("z");
- var globalZLevel = graphicModel.get("zlevel");
- each(elOptionsToUpdate, function(elOption) {
- var id = convertOptionIdName(elOption.id, null);
- var elExisting = id != null ? elMap.get(id) : null;
- var parentId = convertOptionIdName(elOption.parentId, null);
- var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup;
- var elType = elOption.type;
- var elOptionStyle = elOption.style;
- if (elType === "text" && elOptionStyle) {
- if (elOption.hv && elOption.hv[1]) {
- elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = elOptionStyle.verticalAlign = elOptionStyle.align = null;
- }
- }
- var textContentOption = elOption.textContent;
- var textConfig = elOption.textConfig;
- if (elOptionStyle && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) {
- var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true);
- if (!textConfig && convertResult.textConfig) {
- textConfig = elOption.textConfig = convertResult.textConfig;
- }
- if (!textContentOption && convertResult.textContent) {
- textContentOption = convertResult.textContent;
- }
- }
- var elOptionCleaned = getCleanedElOption(elOption);
- if (true) {
- elExisting && assert(targetElParent === elExisting.parent, "Changing parent is not supported.");
- }
- var $action = elOption.$action || "merge";
- var isMerge = $action === "merge";
- var isReplace = $action === "replace";
- if (isMerge) {
- var isInit = !elExisting;
- var el_1 = elExisting;
- if (isInit) {
- el_1 = createEl(id, targetElParent, elOption.type, elMap);
- } else {
- el_1 && (inner5(el_1).isNew = false);
- stopPreviousKeyframeAnimationAndRestore(el_1);
- }
- if (el_1) {
- applyUpdateTransition(el_1, elOptionCleaned, graphicModel, {
- isInit
- });
- updateCommonAttrs(el_1, elOption, globalZ, globalZLevel);
- }
- } else if (isReplace) {
- removeEl(elExisting, elOption, elMap, graphicModel);
- var el_2 = createEl(id, targetElParent, elOption.type, elMap);
- if (el_2) {
- applyUpdateTransition(el_2, elOptionCleaned, graphicModel, {
- isInit: true
- });
- updateCommonAttrs(el_2, elOption, globalZ, globalZLevel);
- }
- } else if ($action === "remove") {
- updateLeaveTo(elExisting, elOption);
- removeEl(elExisting, elOption, elMap, graphicModel);
- }
- var el = elMap.get(id);
- if (el && textContentOption) {
- if (isMerge) {
- var textContentExisting = el.getTextContent();
- textContentExisting ? textContentExisting.attr(textContentOption) : el.setTextContent(new Text_default(textContentOption));
- } else if (isReplace) {
- el.setTextContent(new Text_default(textContentOption));
- }
- }
- if (el) {
- var clipPathOption = elOption.clipPath;
- if (clipPathOption) {
- var clipPathType = clipPathOption.type;
- var clipPath = void 0;
- var isInit = false;
- if (isMerge) {
- var oldClipPath = el.getClipPath();
- isInit = !oldClipPath || inner5(oldClipPath).type !== clipPathType;
- clipPath = isInit ? newEl(clipPathType) : oldClipPath;
- } else if (isReplace) {
- isInit = true;
- clipPath = newEl(clipPathType);
- }
- el.setClipPath(clipPath);
- applyUpdateTransition(clipPath, clipPathOption, graphicModel, {
- isInit
- });
- applyKeyframeAnimation(clipPath, clipPathOption.keyframeAnimation, graphicModel);
- }
- var elInner = inner5(el);
- el.setTextConfig(textConfig);
- elInner.option = elOption;
- setEventData(el, graphicModel, elOption);
- setTooltipConfig({
- el,
- componentModel: graphicModel,
- itemName: el.name,
- itemTooltipOption: elOption.tooltip
- });
- applyKeyframeAnimation(el, elOption.keyframeAnimation, graphicModel);
- }
- });
- };
- GraphicComponentView2.prototype._relocate = function(graphicModel, api) {
- var elOptions = graphicModel.option.elements;
- var rootGroup = this.group;
- var elMap = this._elMap;
- var apiWidth = api.getWidth();
- var apiHeight = api.getHeight();
- var xy = ["x", "y"];
- for (var i = 0; i < elOptions.length; i++) {
- var elOption = elOptions[i];
- var id = convertOptionIdName(elOption.id, null);
- var el = id != null ? elMap.get(id) : null;
- if (!el || !el.isGroup) {
- continue;
- }
- var parentEl = el.parent;
- var isParentRoot = parentEl === rootGroup;
- var elInner = inner5(el);
- var parentElInner = inner5(parentEl);
- elInner.width = parsePercent2(elInner.option.width, isParentRoot ? apiWidth : parentElInner.width) || 0;
- elInner.height = parsePercent2(elInner.option.height, isParentRoot ? apiHeight : parentElInner.height) || 0;
- }
- for (var i = elOptions.length - 1; i >= 0; i--) {
- var elOption = elOptions[i];
- var id = convertOptionIdName(elOption.id, null);
- var el = id != null ? elMap.get(id) : null;
- if (!el) {
- continue;
- }
- var parentEl = el.parent;
- var parentElInner = inner5(parentEl);
- var containerInfo = parentEl === rootGroup ? {
- width: apiWidth,
- height: apiHeight
- } : {
- width: parentElInner.width,
- height: parentElInner.height
- };
- var layoutPos = {};
- var layouted = positionElement(el, elOption, containerInfo, null, {
- hv: elOption.hv,
- boundingMode: elOption.bounding
- }, layoutPos);
- if (!inner5(el).isNew && layouted) {
- var transition = elOption.transition;
- var animatePos = {};
- for (var k = 0; k < xy.length; k++) {
- var key = xy[k];
- var val = layoutPos[key];
- if (transition && (isTransitionAll(transition) || indexOf(transition, key) >= 0)) {
- animatePos[key] = val;
- } else {
- el[key] = val;
- }
- }
- updateProps(el, animatePos, graphicModel, 0);
- } else {
- el.attr(layoutPos);
- }
- }
- };
- GraphicComponentView2.prototype._clear = function() {
- var _this = this;
- var elMap = this._elMap;
- elMap.each(function(el) {
- removeEl(el, inner5(el).option, elMap, _this._lastGraphicModel);
- });
- this._elMap = createHashMap();
- };
- GraphicComponentView2.prototype.dispose = function() {
- this._clear();
- };
- GraphicComponentView2.type = "graphic";
- return GraphicComponentView2;
- }(Component_default2);
- function newEl(graphicType) {
- if (true) {
- assert(graphicType, "graphic type MUST be set");
- }
- var Clz = hasOwn(nonShapeGraphicElements, graphicType) ? nonShapeGraphicElements[graphicType] : getShapeClass(graphicType);
- if (true) {
- assert(Clz, "graphic type " + graphicType + " can not be found");
- }
- var el = new Clz({});
- inner5(el).type = graphicType;
- return el;
- }
- function createEl(id, targetElParent, graphicType, elMap) {
- var el = newEl(graphicType);
- targetElParent.add(el);
- elMap.set(id, el);
- inner5(el).id = id;
- inner5(el).isNew = true;
- return el;
- }
- function removeEl(elExisting, elOption, elMap, graphicModel) {
- var existElParent = elExisting && elExisting.parent;
- if (existElParent) {
- elExisting.type === "group" && elExisting.traverse(function(el) {
- removeEl(el, elOption, elMap, graphicModel);
- });
- applyLeaveTransition(elExisting, elOption, graphicModel);
- elMap.removeKey(inner5(elExisting).id);
- }
- }
- function updateCommonAttrs(el, elOption, defaultZ, defaultZlevel) {
- if (!el.isGroup) {
- each([
- ["cursor", Displayable_default.prototype.cursor],
- ["zlevel", defaultZlevel || 0],
- ["z", defaultZ || 0],
- ["z2", 0]
- ], function(item) {
- var prop = item[0];
- if (hasOwn(elOption, prop)) {
- el[prop] = retrieve2(elOption[prop], item[1]);
- } else if (el[prop] == null) {
- el[prop] = item[1];
- }
- });
- }
- each(keys(elOption), function(key) {
- if (key.indexOf("on") === 0) {
- var val = elOption[key];
- el[key] = isFunction(val) ? val : null;
- }
- });
- if (hasOwn(elOption, "draggable")) {
- el.draggable = elOption.draggable;
- }
- elOption.name != null && (el.name = elOption.name);
- elOption.id != null && (el.id = elOption.id);
- }
- function getCleanedElOption(elOption) {
- elOption = extend({}, elOption);
- each(["id", "parentId", "$action", "hv", "bounding", "textContent", "clipPath"].concat(LOCATION_PARAMS), function(name) {
- delete elOption[name];
- });
- return elOption;
- }
- function setEventData(el, graphicModel, elOption) {
- var eventData = getECData(el).eventData;
- if (!el.silent && !el.ignore && !eventData) {
- eventData = getECData(el).eventData = {
- componentType: "graphic",
- componentIndex: graphicModel.componentIndex,
- name: el.name
- };
- }
- if (eventData) {
- eventData.info = elOption.info;
- }
- }
- // node_modules/echarts/lib/component/graphic/install.js
- function install10(registers) {
- registers.registerComponentModel(GraphicComponentModel);
- registers.registerComponentView(GraphicComponentView);
- registers.registerPreprocessor(function(option) {
- var graphicOption = option.graphic;
- if (isArray(graphicOption)) {
- if (!graphicOption[0] || !graphicOption[0].elements) {
- option.graphic = [{
- elements: graphicOption
- }];
- } else {
- option.graphic = [option.graphic[0]];
- }
- } else if (graphicOption && !graphicOption.elements) {
- option.graphic = [{
- elements: [graphicOption]
- }];
- }
- });
- }
- // node_modules/echarts/lib/component/toolbox/install.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/dataZoom/installDataZoomSelect.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/dataZoom/SelectZoomModel.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/dataZoom/DataZoomModel.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/dataZoom/helper.js
- init_define_APP_INFO();
- var DATA_ZOOM_AXIS_DIMENSIONS = ["x", "y", "radius", "angle", "single"];
- var SERIES_COORDS = ["cartesian2d", "polar", "singleAxis"];
- function isCoordSupported(seriesModel) {
- var coordType = seriesModel.get("coordinateSystem");
- return indexOf(SERIES_COORDS, coordType) >= 0;
- }
- function getAxisMainType(axisDim) {
- if (true) {
- assert(axisDim);
- }
- return axisDim + "Axis";
- }
- function findEffectedDataZooms(ecModel, payload) {
- var axisRecords = createHashMap();
- var effectedModels = [];
- var effectedModelMap = createHashMap();
- ecModel.eachComponent({
- mainType: "dataZoom",
- query: payload
- }, function(dataZoomModel) {
- if (!effectedModelMap.get(dataZoomModel.uid)) {
- addToEffected(dataZoomModel);
- }
- });
- var foundNewLink;
- do {
- foundNewLink = false;
- ecModel.eachComponent("dataZoom", processSingle);
- } while (foundNewLink);
- function processSingle(dataZoomModel) {
- if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) {
- addToEffected(dataZoomModel);
- foundNewLink = true;
- }
- }
- function addToEffected(dataZoom) {
- effectedModelMap.set(dataZoom.uid, true);
- effectedModels.push(dataZoom);
- markAxisControlled(dataZoom);
- }
- function isLinked(dataZoomModel) {
- var isLink = false;
- dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
- var axisIdxArr = axisRecords.get(axisDim);
- if (axisIdxArr && axisIdxArr[axisIndex]) {
- isLink = true;
- }
- });
- return isLink;
- }
- function markAxisControlled(dataZoomModel) {
- dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
- (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true;
- });
- }
- return effectedModels;
- }
- function collectReferCoordSysModelInfo(dataZoomModel) {
- var ecModel = dataZoomModel.ecModel;
- var coordSysInfoWrap = {
- infoList: [],
- infoMap: createHashMap()
- };
- dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
- var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);
- if (!axisModel) {
- return;
- }
- var coordSysModel = axisModel.getCoordSysModel();
- if (!coordSysModel) {
- return;
- }
- var coordSysUid = coordSysModel.uid;
- var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid);
- if (!coordSysInfo) {
- coordSysInfo = {
- model: coordSysModel,
- axisModels: []
- };
- coordSysInfoWrap.infoList.push(coordSysInfo);
- coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo);
- }
- coordSysInfo.axisModels.push(axisModel);
- });
- return coordSysInfoWrap;
- }
- // node_modules/echarts/lib/component/dataZoom/DataZoomModel.js
- var DataZoomAxisInfo = function() {
- function DataZoomAxisInfo2() {
- this.indexList = [];
- this.indexMap = [];
- }
- DataZoomAxisInfo2.prototype.add = function(axisCmptIdx) {
- if (!this.indexMap[axisCmptIdx]) {
- this.indexList.push(axisCmptIdx);
- this.indexMap[axisCmptIdx] = true;
- }
- };
- return DataZoomAxisInfo2;
- }();
- var DataZoomModel = function(_super) {
- __extends(DataZoomModel2, _super);
- function DataZoomModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = DataZoomModel2.type;
- _this._autoThrottle = true;
- _this._noTarget = true;
- _this._rangePropMode = ["percent", "percent"];
- return _this;
- }
- DataZoomModel2.prototype.init = function(option, parentModel, ecModel) {
- var inputRawOption = retrieveRawOption(option);
- this.settledOption = inputRawOption;
- this.mergeDefaultAndTheme(option, ecModel);
- this._doInit(inputRawOption);
- };
- DataZoomModel2.prototype.mergeOption = function(newOption) {
- var inputRawOption = retrieveRawOption(newOption);
- merge(this.option, newOption, true);
- merge(this.settledOption, inputRawOption, true);
- this._doInit(inputRawOption);
- };
- DataZoomModel2.prototype._doInit = function(inputRawOption) {
- var thisOption = this.option;
- this._setDefaultThrottle(inputRawOption);
- this._updateRangeUse(inputRawOption);
- var settledOption = this.settledOption;
- each([["start", "startValue"], ["end", "endValue"]], function(names, index) {
- if (this._rangePropMode[index] === "value") {
- thisOption[names[0]] = settledOption[names[0]] = null;
- }
- }, this);
- this._resetTarget();
- };
- DataZoomModel2.prototype._resetTarget = function() {
- var optionOrient = this.get("orient", true);
- var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap();
- var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap);
- if (hasAxisSpecified) {
- this._orient = optionOrient || this._makeAutoOrientByTargetAxis();
- } else {
- this._orient = optionOrient || "horizontal";
- this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient);
- }
- this._noTarget = true;
- targetAxisIndexMap.each(function(axisInfo) {
- if (axisInfo.indexList.length) {
- this._noTarget = false;
- }
- }, this);
- };
- DataZoomModel2.prototype._fillSpecifiedTargetAxis = function(targetAxisIndexMap) {
- var hasAxisSpecified = false;
- each(DATA_ZOOM_AXIS_DIMENSIONS, function(axisDim) {
- var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING);
- if (!refering.specified) {
- return;
- }
- hasAxisSpecified = true;
- var axisInfo = new DataZoomAxisInfo();
- each(refering.models, function(axisModel) {
- axisInfo.add(axisModel.componentIndex);
- });
- targetAxisIndexMap.set(axisDim, axisInfo);
- }, this);
- return hasAxisSpecified;
- };
- DataZoomModel2.prototype._fillAutoTargetAxisByOrient = function(targetAxisIndexMap, orient) {
- var ecModel = this.ecModel;
- var needAuto = true;
- if (needAuto) {
- var axisDim = orient === "vertical" ? "y" : "x";
- var axisModels = ecModel.findComponents({
- mainType: axisDim + "Axis"
- });
- setParallelAxis(axisModels, axisDim);
- }
- if (needAuto) {
- var axisModels = ecModel.findComponents({
- mainType: "singleAxis",
- filter: function(axisModel) {
- return axisModel.get("orient", true) === orient;
- }
- });
- setParallelAxis(axisModels, "single");
- }
- function setParallelAxis(axisModels2, axisDim2) {
- var axisModel = axisModels2[0];
- if (!axisModel) {
- return;
- }
- var axisInfo = new DataZoomAxisInfo();
- axisInfo.add(axisModel.componentIndex);
- targetAxisIndexMap.set(axisDim2, axisInfo);
- needAuto = false;
- if (axisDim2 === "x" || axisDim2 === "y") {
- var gridModel_1 = axisModel.getReferringComponents("grid", SINGLE_REFERRING).models[0];
- gridModel_1 && each(axisModels2, function(axModel) {
- if (axisModel.componentIndex !== axModel.componentIndex && gridModel_1 === axModel.getReferringComponents("grid", SINGLE_REFERRING).models[0]) {
- axisInfo.add(axModel.componentIndex);
- }
- });
- }
- }
- if (needAuto) {
- each(DATA_ZOOM_AXIS_DIMENSIONS, function(axisDim2) {
- if (!needAuto) {
- return;
- }
- var axisModels2 = ecModel.findComponents({
- mainType: getAxisMainType(axisDim2),
- filter: function(axisModel) {
- return axisModel.get("type", true) === "category";
- }
- });
- if (axisModels2[0]) {
- var axisInfo = new DataZoomAxisInfo();
- axisInfo.add(axisModels2[0].componentIndex);
- targetAxisIndexMap.set(axisDim2, axisInfo);
- needAuto = false;
- }
- }, this);
- }
- };
- DataZoomModel2.prototype._makeAutoOrientByTargetAxis = function() {
- var dim;
- this.eachTargetAxis(function(axisDim) {
- !dim && (dim = axisDim);
- }, this);
- return dim === "y" ? "vertical" : "horizontal";
- };
- DataZoomModel2.prototype._setDefaultThrottle = function(inputRawOption) {
- if (inputRawOption.hasOwnProperty("throttle")) {
- this._autoThrottle = false;
- }
- if (this._autoThrottle) {
- var globalOption = this.ecModel.option;
- this.option.throttle = globalOption.animation && globalOption.animationDurationUpdate > 0 ? 100 : 20;
- }
- };
- DataZoomModel2.prototype._updateRangeUse = function(inputRawOption) {
- var rangePropMode = this._rangePropMode;
- var rangeModeInOption = this.get("rangeMode");
- each([["start", "startValue"], ["end", "endValue"]], function(names, index) {
- var percentSpecified = inputRawOption[names[0]] != null;
- var valueSpecified = inputRawOption[names[1]] != null;
- if (percentSpecified && !valueSpecified) {
- rangePropMode[index] = "percent";
- } else if (!percentSpecified && valueSpecified) {
- rangePropMode[index] = "value";
- } else if (rangeModeInOption) {
- rangePropMode[index] = rangeModeInOption[index];
- } else if (percentSpecified) {
- rangePropMode[index] = "percent";
- }
- });
- };
- DataZoomModel2.prototype.noTarget = function() {
- return this._noTarget;
- };
- DataZoomModel2.prototype.getFirstTargetAxisModel = function() {
- var firstAxisModel;
- this.eachTargetAxis(function(axisDim, axisIndex) {
- if (firstAxisModel == null) {
- firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);
- }
- }, this);
- return firstAxisModel;
- };
- DataZoomModel2.prototype.eachTargetAxis = function(callback, context) {
- this._targetAxisInfoMap.each(function(axisInfo, axisDim) {
- each(axisInfo.indexList, function(axisIndex) {
- callback.call(context, axisDim, axisIndex);
- });
- });
- };
- DataZoomModel2.prototype.getAxisProxy = function(axisDim, axisIndex) {
- var axisModel = this.getAxisModel(axisDim, axisIndex);
- if (axisModel) {
- return axisModel.__dzAxisProxy;
- }
- };
- DataZoomModel2.prototype.getAxisModel = function(axisDim, axisIndex) {
- if (true) {
- assert(axisDim && axisIndex != null);
- }
- var axisInfo = this._targetAxisInfoMap.get(axisDim);
- if (axisInfo && axisInfo.indexMap[axisIndex]) {
- return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);
- }
- };
- DataZoomModel2.prototype.setRawRange = function(opt) {
- var thisOption = this.option;
- var settledOption = this.settledOption;
- each([["start", "startValue"], ["end", "endValue"]], function(names) {
- if (opt[names[0]] != null || opt[names[1]] != null) {
- thisOption[names[0]] = settledOption[names[0]] = opt[names[0]];
- thisOption[names[1]] = settledOption[names[1]] = opt[names[1]];
- }
- }, this);
- this._updateRangeUse(opt);
- };
- DataZoomModel2.prototype.setCalculatedRange = function(opt) {
- var option = this.option;
- each(["start", "startValue", "end", "endValue"], function(name) {
- option[name] = opt[name];
- });
- };
- DataZoomModel2.prototype.getPercentRange = function() {
- var axisProxy = this.findRepresentativeAxisProxy();
- if (axisProxy) {
- return axisProxy.getDataPercentWindow();
- }
- };
- DataZoomModel2.prototype.getValueRange = function(axisDim, axisIndex) {
- if (axisDim == null && axisIndex == null) {
- var axisProxy = this.findRepresentativeAxisProxy();
- if (axisProxy) {
- return axisProxy.getDataValueWindow();
- }
- } else {
- return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow();
- }
- };
- DataZoomModel2.prototype.findRepresentativeAxisProxy = function(axisModel) {
- if (axisModel) {
- return axisModel.__dzAxisProxy;
- }
- var firstProxy;
- var axisDimList = this._targetAxisInfoMap.keys();
- for (var i = 0; i < axisDimList.length; i++) {
- var axisDim = axisDimList[i];
- var axisInfo = this._targetAxisInfoMap.get(axisDim);
- for (var j = 0; j < axisInfo.indexList.length; j++) {
- var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]);
- if (proxy.hostedBy(this)) {
- return proxy;
- }
- if (!firstProxy) {
- firstProxy = proxy;
- }
- }
- }
- return firstProxy;
- };
- DataZoomModel2.prototype.getRangePropMode = function() {
- return this._rangePropMode.slice();
- };
- DataZoomModel2.prototype.getOrient = function() {
- if (true) {
- assert(this._orient);
- }
- return this._orient;
- };
- DataZoomModel2.type = "dataZoom";
- DataZoomModel2.dependencies = ["xAxis", "yAxis", "radiusAxis", "angleAxis", "singleAxis", "series", "toolbox"];
- DataZoomModel2.defaultOption = {
- z: 4,
- filterMode: "filter",
- start: 0,
- end: 100
- };
- return DataZoomModel2;
- }(Component_default);
- function retrieveRawOption(option) {
- var ret = {};
- each(["start", "end", "startValue", "endValue", "throttle"], function(name) {
- option.hasOwnProperty(name) && (ret[name] = option[name]);
- });
- return ret;
- }
- var DataZoomModel_default = DataZoomModel;
- // node_modules/echarts/lib/component/dataZoom/SelectZoomModel.js
- var SelectDataZoomModel = function(_super) {
- __extends(SelectDataZoomModel2, _super);
- function SelectDataZoomModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = SelectDataZoomModel2.type;
- return _this;
- }
- SelectDataZoomModel2.type = "dataZoom.select";
- return SelectDataZoomModel2;
- }(DataZoomModel_default);
- var SelectZoomModel_default = SelectDataZoomModel;
- // node_modules/echarts/lib/component/dataZoom/SelectZoomView.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/dataZoom/DataZoomView.js
- init_define_APP_INFO();
- var DataZoomView = function(_super) {
- __extends(DataZoomView2, _super);
- function DataZoomView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = DataZoomView2.type;
- return _this;
- }
- DataZoomView2.prototype.render = function(dataZoomModel, ecModel, api, payload) {
- this.dataZoomModel = dataZoomModel;
- this.ecModel = ecModel;
- this.api = api;
- };
- DataZoomView2.type = "dataZoom";
- return DataZoomView2;
- }(Component_default2);
- var DataZoomView_default = DataZoomView;
- // node_modules/echarts/lib/component/dataZoom/SelectZoomView.js
- var SelectDataZoomView = function(_super) {
- __extends(SelectDataZoomView2, _super);
- function SelectDataZoomView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = SelectDataZoomView2.type;
- return _this;
- }
- SelectDataZoomView2.type = "dataZoom.select";
- return SelectDataZoomView2;
- }(DataZoomView_default);
- var SelectZoomView_default = SelectDataZoomView;
- // node_modules/echarts/lib/component/dataZoom/installCommon.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/dataZoom/dataZoomProcessor.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/dataZoom/AxisProxy.js
- init_define_APP_INFO();
- var each3 = each;
- var asc2 = asc;
- var AxisProxy = function() {
- function AxisProxy2(dimName, axisIndex, dataZoomModel, ecModel) {
- this._dimName = dimName;
- this._axisIndex = axisIndex;
- this.ecModel = ecModel;
- this._dataZoomModel = dataZoomModel;
- }
- AxisProxy2.prototype.hostedBy = function(dataZoomModel) {
- return this._dataZoomModel === dataZoomModel;
- };
- AxisProxy2.prototype.getDataValueWindow = function() {
- return this._valueWindow.slice();
- };
- AxisProxy2.prototype.getDataPercentWindow = function() {
- return this._percentWindow.slice();
- };
- AxisProxy2.prototype.getTargetSeriesModels = function() {
- var seriesModels = [];
- this.ecModel.eachSeries(function(seriesModel) {
- if (isCoordSupported(seriesModel)) {
- var axisMainType = getAxisMainType(this._dimName);
- var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0];
- if (axisModel && this._axisIndex === axisModel.componentIndex) {
- seriesModels.push(seriesModel);
- }
- }
- }, this);
- return seriesModels;
- };
- AxisProxy2.prototype.getAxisModel = function() {
- return this.ecModel.getComponent(this._dimName + "Axis", this._axisIndex);
- };
- AxisProxy2.prototype.getMinMaxSpan = function() {
- return clone(this._minMaxSpan);
- };
- AxisProxy2.prototype.calculateDataWindow = function(opt) {
- var dataExtent = this._dataExtent;
- var axisModel = this.getAxisModel();
- var scale = axisModel.axis.scale;
- var rangePropMode = this._dataZoomModel.getRangePropMode();
- var percentExtent = [0, 100];
- var percentWindow = [];
- var valueWindow = [];
- var hasPropModeValue;
- each3(["start", "end"], function(prop, idx) {
- var boundPercent = opt[prop];
- var boundValue = opt[prop + "Value"];
- if (rangePropMode[idx] === "percent") {
- boundPercent == null && (boundPercent = percentExtent[idx]);
- boundValue = scale.parse(linearMap(boundPercent, percentExtent, dataExtent));
- } else {
- hasPropModeValue = true;
- boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue);
- boundPercent = linearMap(boundValue, dataExtent, percentExtent);
- }
- valueWindow[idx] = boundValue;
- percentWindow[idx] = boundPercent;
- });
- asc2(valueWindow);
- asc2(percentWindow);
- var spans = this._minMaxSpan;
- hasPropModeValue ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false) : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);
- function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) {
- var suffix = toValue ? "Span" : "ValueSpan";
- sliderMove(0, fromWindow, fromExtent, "all", spans["min" + suffix], spans["max" + suffix]);
- for (var i = 0; i < 2; i++) {
- toWindow[i] = linearMap(fromWindow[i], fromExtent, toExtent, true);
- toValue && (toWindow[i] = scale.parse(toWindow[i]));
- }
- }
- return {
- valueWindow,
- percentWindow
- };
- };
- AxisProxy2.prototype.reset = function(dataZoomModel) {
- if (dataZoomModel !== this._dataZoomModel) {
- return;
- }
- var targetSeries = this.getTargetSeriesModels();
- this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries);
- this._updateMinMaxSpan();
- var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);
- this._valueWindow = dataWindow.valueWindow;
- this._percentWindow = dataWindow.percentWindow;
- this._setAxisModel();
- };
- AxisProxy2.prototype.filterData = function(dataZoomModel, api) {
- if (dataZoomModel !== this._dataZoomModel) {
- return;
- }
- var axisDim = this._dimName;
- var seriesModels = this.getTargetSeriesModels();
- var filterMode = dataZoomModel.get("filterMode");
- var valueWindow = this._valueWindow;
- if (filterMode === "none") {
- return;
- }
- each3(seriesModels, function(seriesModel) {
- var seriesData = seriesModel.getData();
- var dataDims = seriesData.mapDimensionsAll(axisDim);
- if (!dataDims.length) {
- return;
- }
- if (filterMode === "weakFilter") {
- var store_1 = seriesData.getStore();
- var dataDimIndices_1 = map(dataDims, function(dim) {
- return seriesData.getDimensionIndex(dim);
- }, seriesData);
- seriesData.filterSelf(function(dataIndex) {
- var leftOut;
- var rightOut;
- var hasValue;
- for (var i = 0; i < dataDims.length; i++) {
- var value = store_1.get(dataDimIndices_1[i], dataIndex);
- var thisHasValue = !isNaN(value);
- var thisLeftOut = value < valueWindow[0];
- var thisRightOut = value > valueWindow[1];
- if (thisHasValue && !thisLeftOut && !thisRightOut) {
- return true;
- }
- thisHasValue && (hasValue = true);
- thisLeftOut && (leftOut = true);
- thisRightOut && (rightOut = true);
- }
- return hasValue && leftOut && rightOut;
- });
- } else {
- each3(dataDims, function(dim) {
- if (filterMode === "empty") {
- seriesModel.setData(seriesData = seriesData.map(dim, function(value) {
- return !isInWindow(value) ? NaN : value;
- }));
- } else {
- var range = {};
- range[dim] = valueWindow;
- seriesData.selectRange(range);
- }
- });
- }
- each3(dataDims, function(dim) {
- seriesData.setApproximateExtent(valueWindow, dim);
- });
- });
- function isInWindow(value) {
- return value >= valueWindow[0] && value <= valueWindow[1];
- }
- };
- AxisProxy2.prototype._updateMinMaxSpan = function() {
- var minMaxSpan = this._minMaxSpan = {};
- var dataZoomModel = this._dataZoomModel;
- var dataExtent = this._dataExtent;
- each3(["min", "max"], function(minMax) {
- var percentSpan = dataZoomModel.get(minMax + "Span");
- var valueSpan = dataZoomModel.get(minMax + "ValueSpan");
- valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan));
- if (valueSpan != null) {
- percentSpan = linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);
- } else if (percentSpan != null) {
- valueSpan = linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0];
- }
- minMaxSpan[minMax + "Span"] = percentSpan;
- minMaxSpan[minMax + "ValueSpan"] = valueSpan;
- }, this);
- };
- AxisProxy2.prototype._setAxisModel = function() {
- var axisModel = this.getAxisModel();
- var percentWindow = this._percentWindow;
- var valueWindow = this._valueWindow;
- if (!percentWindow) {
- return;
- }
- var precision = getPixelPrecision(valueWindow, [0, 500]);
- precision = Math.min(precision, 20);
- var rawExtentInfo = axisModel.axis.scale.rawExtentInfo;
- if (percentWindow[0] !== 0) {
- rawExtentInfo.setDeterminedMinMax("min", +valueWindow[0].toFixed(precision));
- }
- if (percentWindow[1] !== 100) {
- rawExtentInfo.setDeterminedMinMax("max", +valueWindow[1].toFixed(precision));
- }
- rawExtentInfo.freeze();
- };
- return AxisProxy2;
- }();
- function calculateDataExtent(axisProxy, axisDim, seriesModels) {
- var dataExtent = [Infinity, -Infinity];
- each3(seriesModels, function(seriesModel) {
- unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim);
- });
- var axisModel = axisProxy.getAxisModel();
- var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate();
- return [rawExtentResult.min, rawExtentResult.max];
- }
- var AxisProxy_default = AxisProxy;
- // node_modules/echarts/lib/component/dataZoom/dataZoomProcessor.js
- var dataZoomProcessor = {
- getTargetSeries: function(ecModel) {
- function eachAxisModel(cb) {
- ecModel.eachComponent("dataZoom", function(dataZoomModel) {
- dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
- var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);
- cb(axisDim, axisIndex, axisModel, dataZoomModel);
- });
- });
- }
- eachAxisModel(function(axisDim, axisIndex, axisModel, dataZoomModel) {
- axisModel.__dzAxisProxy = null;
- });
- var proxyList = [];
- eachAxisModel(function(axisDim, axisIndex, axisModel, dataZoomModel) {
- if (!axisModel.__dzAxisProxy) {
- axisModel.__dzAxisProxy = new AxisProxy_default(axisDim, axisIndex, dataZoomModel, ecModel);
- proxyList.push(axisModel.__dzAxisProxy);
- }
- });
- var seriesModelMap = createHashMap();
- each(proxyList, function(axisProxy) {
- each(axisProxy.getTargetSeriesModels(), function(seriesModel) {
- seriesModelMap.set(seriesModel.uid, seriesModel);
- });
- });
- return seriesModelMap;
- },
- overallReset: function(ecModel, api) {
- ecModel.eachComponent("dataZoom", function(dataZoomModel) {
- dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
- dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel);
- });
- dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
- dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api);
- });
- });
- ecModel.eachComponent("dataZoom", function(dataZoomModel) {
- var axisProxy = dataZoomModel.findRepresentativeAxisProxy();
- if (axisProxy) {
- var percentRange = axisProxy.getDataPercentWindow();
- var valueRange = axisProxy.getDataValueWindow();
- dataZoomModel.setCalculatedRange({
- start: percentRange[0],
- end: percentRange[1],
- startValue: valueRange[0],
- endValue: valueRange[1]
- });
- }
- });
- }
- };
- var dataZoomProcessor_default = dataZoomProcessor;
- // node_modules/echarts/lib/component/dataZoom/dataZoomAction.js
- init_define_APP_INFO();
- function installDataZoomAction(registers) {
- registers.registerAction("dataZoom", function(payload, ecModel) {
- var effectedModels = findEffectedDataZooms(ecModel, payload);
- each(effectedModels, function(dataZoomModel) {
- dataZoomModel.setRawRange({
- start: payload.start,
- end: payload.end,
- startValue: payload.startValue,
- endValue: payload.endValue
- });
- });
- });
- }
- // node_modules/echarts/lib/component/dataZoom/installCommon.js
- var installed = false;
- function installCommon(registers) {
- if (installed) {
- return;
- }
- installed = true;
- registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, dataZoomProcessor_default);
- installDataZoomAction(registers);
- registers.registerSubTypeDefaulter("dataZoom", function() {
- return "slider";
- });
- }
- // node_modules/echarts/lib/component/dataZoom/installDataZoomSelect.js
- function install11(registers) {
- registers.registerComponentModel(SelectZoomModel_default);
- registers.registerComponentView(SelectZoomView_default);
- installCommon(registers);
- }
- // node_modules/echarts/lib/component/toolbox/ToolboxModel.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/toolbox/featureManager.js
- init_define_APP_INFO();
- var ToolboxFeature = function() {
- function ToolboxFeature2() {
- }
- return ToolboxFeature2;
- }();
- var features = {};
- function registerFeature(name, ctor) {
- features[name] = ctor;
- }
- function getFeature(name) {
- return features[name];
- }
- // node_modules/echarts/lib/component/toolbox/ToolboxModel.js
- var ToolboxModel = function(_super) {
- __extends(ToolboxModel2, _super);
- function ToolboxModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = ToolboxModel2.type;
- return _this;
- }
- ToolboxModel2.prototype.optionUpdated = function() {
- _super.prototype.optionUpdated.apply(this, arguments);
- var ecModel = this.ecModel;
- each(this.option.feature, function(featureOpt, featureName) {
- var Feature = getFeature(featureName);
- if (Feature) {
- if (Feature.getDefaultOption) {
- Feature.defaultOption = Feature.getDefaultOption(ecModel);
- }
- merge(featureOpt, Feature.defaultOption);
- }
- });
- };
- ToolboxModel2.type = "toolbox";
- ToolboxModel2.layoutMode = {
- type: "box",
- ignoreSize: true
- };
- ToolboxModel2.defaultOption = {
- show: true,
- z: 6,
- orient: "horizontal",
- left: "right",
- top: "top",
- backgroundColor: "transparent",
- borderColor: "#ccc",
- borderRadius: 0,
- borderWidth: 0,
- padding: 5,
- itemSize: 15,
- itemGap: 8,
- showTitle: true,
- iconStyle: {
- borderColor: "#666",
- color: "none"
- },
- emphasis: {
- iconStyle: {
- borderColor: "#3E98C5"
- }
- },
- tooltip: {
- show: false,
- position: "bottom"
- }
- };
- return ToolboxModel2;
- }(Component_default);
- var ToolboxModel_default = ToolboxModel;
- // node_modules/echarts/lib/component/toolbox/ToolboxView.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/helper/listComponent.js
- init_define_APP_INFO();
- function layout3(group, componentModel, api) {
- var boxLayoutParams = componentModel.getBoxLayoutParams();
- var padding = componentModel.get("padding");
- var viewportSize = {
- width: api.getWidth(),
- height: api.getHeight()
- };
- var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);
- box(componentModel.get("orient"), group, componentModel.get("itemGap"), rect.width, rect.height);
- positionElement(group, boxLayoutParams, viewportSize, padding);
- }
- function makeBackground(rect, componentModel) {
- var padding = normalizeCssArray(componentModel.get("padding"));
- var style = componentModel.getItemStyle(["color", "opacity"]);
- style.fill = componentModel.get("backgroundColor");
- rect = new Rect_default({
- shape: {
- x: rect.x - padding[3],
- y: rect.y - padding[0],
- width: rect.width + padding[1] + padding[3],
- height: rect.height + padding[0] + padding[2],
- r: componentModel.get("borderRadius")
- },
- style,
- silent: true,
- z2: -1
- });
- return rect;
- }
- // node_modules/echarts/lib/component/toolbox/ToolboxView.js
- var ToolboxView = function(_super) {
- __extends(ToolboxView2, _super);
- function ToolboxView2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- ToolboxView2.prototype.render = function(toolboxModel, ecModel, api, payload) {
- var group = this.group;
- group.removeAll();
- if (!toolboxModel.get("show")) {
- return;
- }
- var itemSize = +toolboxModel.get("itemSize");
- var isVertical = toolboxModel.get("orient") === "vertical";
- var featureOpts = toolboxModel.get("feature") || {};
- var features2 = this._features || (this._features = {});
- var featureNames = [];
- each(featureOpts, function(opt, name) {
- featureNames.push(name);
- });
- new DataDiffer_default(this._featureNames || [], featureNames).add(processFeature).update(processFeature).remove(curry(processFeature, null)).execute();
- this._featureNames = featureNames;
- function processFeature(newIndex, oldIndex) {
- var featureName = featureNames[newIndex];
- var oldName = featureNames[oldIndex];
- var featureOpt = featureOpts[featureName];
- var featureModel = new Model_default(featureOpt, toolboxModel, toolboxModel.ecModel);
- var feature;
- if (payload && payload.newTitle != null && payload.featureName === featureName) {
- featureOpt.title = payload.newTitle;
- }
- if (featureName && !oldName) {
- if (isUserFeatureName(featureName)) {
- feature = {
- onclick: featureModel.option.onclick,
- featureName
- };
- } else {
- var Feature = getFeature(featureName);
- if (!Feature) {
- return;
- }
- feature = new Feature();
- }
- features2[featureName] = feature;
- } else {
- feature = features2[oldName];
- if (!feature) {
- return;
- }
- }
- feature.uid = getUID("toolbox-feature");
- feature.model = featureModel;
- feature.ecModel = ecModel;
- feature.api = api;
- var isToolboxFeature = feature instanceof ToolboxFeature;
- if (!featureName && oldName) {
- isToolboxFeature && feature.dispose && feature.dispose(ecModel, api);
- return;
- }
- if (!featureModel.get("show") || isToolboxFeature && feature.unusable) {
- isToolboxFeature && feature.remove && feature.remove(ecModel, api);
- return;
- }
- createIconPaths(featureModel, feature, featureName);
- featureModel.setIconStatus = function(iconName, status) {
- var option = this.option;
- var iconPaths = this.iconPaths;
- option.iconStatus = option.iconStatus || {};
- option.iconStatus[iconName] = status;
- if (iconPaths[iconName]) {
- (status === "emphasis" ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]);
- }
- };
- if (feature instanceof ToolboxFeature) {
- if (feature.render) {
- feature.render(featureModel, ecModel, api, payload);
- }
- }
- }
- function createIconPaths(featureModel, feature, featureName) {
- var iconStyleModel = featureModel.getModel("iconStyle");
- var iconStyleEmphasisModel = featureModel.getModel(["emphasis", "iconStyle"]);
- var icons = feature instanceof ToolboxFeature && feature.getIcons ? feature.getIcons() : featureModel.get("icon");
- var titles = featureModel.get("title") || {};
- var iconsMap;
- var titlesMap;
- if (isString(icons)) {
- iconsMap = {};
- iconsMap[featureName] = icons;
- } else {
- iconsMap = icons;
- }
- if (isString(titles)) {
- titlesMap = {};
- titlesMap[featureName] = titles;
- } else {
- titlesMap = titles;
- }
- var iconPaths = featureModel.iconPaths = {};
- each(iconsMap, function(iconStr, iconName) {
- var path = createIcon(iconStr, {}, {
- x: -itemSize / 2,
- y: -itemSize / 2,
- width: itemSize,
- height: itemSize
- });
- path.setStyle(iconStyleModel.getItemStyle());
- var pathEmphasisState = path.ensureState("emphasis");
- pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle();
- var textContent = new Text_default({
- style: {
- text: titlesMap[iconName],
- align: iconStyleEmphasisModel.get("textAlign"),
- borderRadius: iconStyleEmphasisModel.get("textBorderRadius"),
- padding: iconStyleEmphasisModel.get("textPadding"),
- fill: null
- },
- ignore: true
- });
- path.setTextContent(textContent);
- setTooltipConfig({
- el: path,
- componentModel: toolboxModel,
- itemName: iconName,
- formatterParamsExtra: {
- title: titlesMap[iconName]
- }
- });
- path.__title = titlesMap[iconName];
- path.on("mouseover", function() {
- var hoverStyle = iconStyleEmphasisModel.getItemStyle();
- var defaultTextPosition = isVertical ? toolboxModel.get("right") == null && toolboxModel.get("left") !== "right" ? "right" : "left" : toolboxModel.get("bottom") == null && toolboxModel.get("top") !== "bottom" ? "bottom" : "top";
- textContent.setStyle({
- fill: iconStyleEmphasisModel.get("textFill") || hoverStyle.fill || hoverStyle.stroke || "#000",
- backgroundColor: iconStyleEmphasisModel.get("textBackgroundColor")
- });
- path.setTextConfig({
- position: iconStyleEmphasisModel.get("textPosition") || defaultTextPosition
- });
- textContent.ignore = !toolboxModel.get("showTitle");
- api.enterEmphasis(this);
- }).on("mouseout", function() {
- if (featureModel.get(["iconStatus", iconName]) !== "emphasis") {
- api.leaveEmphasis(this);
- }
- textContent.hide();
- });
- (featureModel.get(["iconStatus", iconName]) === "emphasis" ? enterEmphasis : leaveEmphasis)(path);
- group.add(path);
- path.on("click", bind(feature.onclick, feature, ecModel, api, iconName));
- iconPaths[iconName] = path;
- });
- }
- layout3(group, toolboxModel, api);
- group.add(makeBackground(group.getBoundingRect(), toolboxModel));
- isVertical || group.eachChild(function(icon) {
- var titleText = icon.__title;
- var emphasisState = icon.ensureState("emphasis");
- var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {});
- var textContent = icon.getTextContent();
- var emphasisTextState = textContent && textContent.ensureState("emphasis");
- if (emphasisTextState && !isFunction(emphasisTextState) && titleText) {
- var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {});
- var rect = getBoundingRect(titleText, Text_default.makeFont(emphasisTextStyle));
- var offsetX = icon.x + group.x;
- var offsetY = icon.y + group.y + itemSize;
- var needPutOnTop = false;
- if (offsetY + rect.height > api.getHeight()) {
- emphasisTextConfig.position = "top";
- needPutOnTop = true;
- }
- var topOffset = needPutOnTop ? -5 - rect.height : itemSize + 10;
- if (offsetX + rect.width / 2 > api.getWidth()) {
- emphasisTextConfig.position = ["100%", topOffset];
- emphasisTextStyle.align = "right";
- } else if (offsetX - rect.width / 2 < 0) {
- emphasisTextConfig.position = [0, topOffset];
- emphasisTextStyle.align = "left";
- }
- }
- });
- };
- ToolboxView2.prototype.updateView = function(toolboxModel, ecModel, api, payload) {
- each(this._features, function(feature) {
- feature instanceof ToolboxFeature && feature.updateView && feature.updateView(feature.model, ecModel, api, payload);
- });
- };
- ToolboxView2.prototype.remove = function(ecModel, api) {
- each(this._features, function(feature) {
- feature instanceof ToolboxFeature && feature.remove && feature.remove(ecModel, api);
- });
- this.group.removeAll();
- };
- ToolboxView2.prototype.dispose = function(ecModel, api) {
- each(this._features, function(feature) {
- feature instanceof ToolboxFeature && feature.dispose && feature.dispose(ecModel, api);
- });
- };
- ToolboxView2.type = "toolbox";
- return ToolboxView2;
- }(Component_default2);
- function isUserFeatureName(featureName) {
- return featureName.indexOf("my") === 0;
- }
- var ToolboxView_default = ToolboxView;
- // node_modules/echarts/lib/component/toolbox/feature/SaveAsImage.js
- init_define_APP_INFO();
- var SaveAsImage = function(_super) {
- __extends(SaveAsImage2, _super);
- function SaveAsImage2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- SaveAsImage2.prototype.onclick = function(ecModel, api) {
- var model = this.model;
- var title = model.get("name") || ecModel.get("title.0.text") || "echarts";
- var isSvg = api.getZr().painter.getType() === "svg";
- var type = isSvg ? "svg" : model.get("type", true) || "png";
- var url = api.getConnectedDataURL({
- type,
- backgroundColor: model.get("backgroundColor", true) || ecModel.get("backgroundColor") || "#fff",
- connectedBackgroundColor: model.get("connectedBackgroundColor"),
- excludeComponents: model.get("excludeComponents"),
- pixelRatio: model.get("pixelRatio")
- });
- var browser = env_default.browser;
- if (isFunction(MouseEvent) && (browser.newEdge || !browser.ie && !browser.edge)) {
- var $a = document.createElement("a");
- $a.download = title + "." + type;
- $a.target = "_blank";
- $a.href = url;
- var evt = new MouseEvent("click", {
- view: document.defaultView,
- bubbles: true,
- cancelable: false
- });
- $a.dispatchEvent(evt);
- } else {
- if (window.navigator.msSaveOrOpenBlob || isSvg) {
- var parts = url.split(",");
- var base64Encoded = parts[0].indexOf("base64") > -1;
- var bstr = isSvg ? decodeURIComponent(parts[1]) : parts[1];
- base64Encoded && (bstr = window.atob(bstr));
- var filename = title + "." + type;
- if (window.navigator.msSaveOrOpenBlob) {
- var n = bstr.length;
- var u8arr = new Uint8Array(n);
- while (n--) {
- u8arr[n] = bstr.charCodeAt(n);
- }
- var blob = new Blob([u8arr]);
- window.navigator.msSaveOrOpenBlob(blob, filename);
- } else {
- var frame = document.createElement("iframe");
- document.body.appendChild(frame);
- var cw = frame.contentWindow;
- var doc = cw.document;
- doc.open("image/svg+xml", "replace");
- doc.write(bstr);
- doc.close();
- cw.focus();
- doc.execCommand("SaveAs", true, filename);
- document.body.removeChild(frame);
- }
- } else {
- var lang = model.get("lang");
- var html = '<body style="margin:0;"><img src="' + url + '" style="max-width:100%;" title="' + (lang && lang[0] || "") + '" /></body>';
- var tab = window.open();
- tab.document.write(html);
- tab.document.title = title;
- }
- }
- };
- SaveAsImage2.getDefaultOption = function(ecModel) {
- var defaultOption2 = {
- show: true,
- icon: "M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",
- title: ecModel.getLocaleModel().get(["toolbox", "saveAsImage", "title"]),
- type: "png",
- connectedBackgroundColor: "#fff",
- name: "",
- excludeComponents: ["toolbox"],
- lang: ecModel.getLocaleModel().get(["toolbox", "saveAsImage", "lang"])
- };
- return defaultOption2;
- };
- return SaveAsImage2;
- }(ToolboxFeature);
- var SaveAsImage_default = SaveAsImage;
- // node_modules/echarts/lib/component/toolbox/feature/MagicType.js
- init_define_APP_INFO();
- var INNER_STACK_KEYWORD = "__ec_magicType_stack__";
- var radioTypes = [["line", "bar"], ["stack"]];
- var MagicType = function(_super) {
- __extends(MagicType2, _super);
- function MagicType2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- MagicType2.prototype.getIcons = function() {
- var model = this.model;
- var availableIcons = model.get("icon");
- var icons = {};
- each(model.get("type"), function(type) {
- if (availableIcons[type]) {
- icons[type] = availableIcons[type];
- }
- });
- return icons;
- };
- MagicType2.getDefaultOption = function(ecModel) {
- var defaultOption2 = {
- show: true,
- type: [],
- icon: {
- line: "M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",
- bar: "M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",
- 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"
- },
- title: ecModel.getLocaleModel().get(["toolbox", "magicType", "title"]),
- option: {},
- seriesIndex: {}
- };
- return defaultOption2;
- };
- MagicType2.prototype.onclick = function(ecModel, api, type) {
- var model = this.model;
- var seriesIndex = model.get(["seriesIndex", type]);
- if (!seriesOptGenreator[type]) {
- return;
- }
- var newOption = {
- series: []
- };
- var generateNewSeriesTypes = function(seriesModel) {
- var seriesType = seriesModel.subType;
- var seriesId = seriesModel.id;
- var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model);
- if (newSeriesOpt) {
- defaults(newSeriesOpt, seriesModel.option);
- newOption.series.push(newSeriesOpt);
- }
- var coordSys = seriesModel.coordinateSystem;
- if (coordSys && coordSys.type === "cartesian2d" && (type === "line" || type === "bar")) {
- var categoryAxis = coordSys.getAxesByScale("ordinal")[0];
- if (categoryAxis) {
- var axisDim = categoryAxis.dim;
- var axisType = axisDim + "Axis";
- var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];
- var axisIndex = axisModel.componentIndex;
- newOption[axisType] = newOption[axisType] || [];
- for (var i = 0; i <= axisIndex; i++) {
- newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {};
- }
- newOption[axisType][axisIndex].boundaryGap = type === "bar";
- }
- }
- };
- each(radioTypes, function(radio) {
- if (indexOf(radio, type) >= 0) {
- each(radio, function(item) {
- model.setIconStatus(item, "normal");
- });
- }
- });
- model.setIconStatus(type, "emphasis");
- ecModel.eachComponent({
- mainType: "series",
- query: seriesIndex == null ? null : {
- seriesIndex
- }
- }, generateNewSeriesTypes);
- var newTitle;
- var currentType = type;
- if (type === "stack") {
- newTitle = merge({
- stack: model.option.title.tiled,
- tiled: model.option.title.stack
- }, model.option.title);
- if (model.get(["iconStatus", type]) !== "emphasis") {
- currentType = "tiled";
- }
- }
- api.dispatchAction({
- type: "changeMagicType",
- currentType,
- newOption,
- newTitle,
- featureName: "magicType"
- });
- };
- return MagicType2;
- }(ToolboxFeature);
- var seriesOptGenreator = {
- "line": function(seriesType, seriesId, seriesModel, model) {
- if (seriesType === "bar") {
- return merge({
- id: seriesId,
- type: "line",
- data: seriesModel.get("data"),
- stack: seriesModel.get("stack"),
- markPoint: seriesModel.get("markPoint"),
- markLine: seriesModel.get("markLine")
- }, model.get(["option", "line"]) || {}, true);
- }
- },
- "bar": function(seriesType, seriesId, seriesModel, model) {
- if (seriesType === "line") {
- return merge({
- id: seriesId,
- type: "bar",
- data: seriesModel.get("data"),
- stack: seriesModel.get("stack"),
- markPoint: seriesModel.get("markPoint"),
- markLine: seriesModel.get("markLine")
- }, model.get(["option", "bar"]) || {}, true);
- }
- },
- "stack": function(seriesType, seriesId, seriesModel, model) {
- var isStack = seriesModel.get("stack") === INNER_STACK_KEYWORD;
- if (seriesType === "line" || seriesType === "bar") {
- model.setIconStatus("stack", isStack ? "normal" : "emphasis");
- return merge({
- id: seriesId,
- stack: isStack ? "" : INNER_STACK_KEYWORD
- }, model.get(["option", "stack"]) || {}, true);
- }
- }
- };
- registerAction({
- type: "changeMagicType",
- event: "magicTypeChanged",
- update: "prepareAndUpdate"
- }, function(payload, ecModel) {
- ecModel.mergeOption(payload.newOption);
- });
- var MagicType_default = MagicType;
- // node_modules/echarts/lib/component/toolbox/feature/DataView.js
- init_define_APP_INFO();
- var BLOCK_SPLITER = new Array(60).join("-");
- var ITEM_SPLITER = " ";
- function groupSeries(ecModel) {
- var seriesGroupByCategoryAxis = {};
- var otherSeries = [];
- var meta = [];
- ecModel.eachRawSeries(function(seriesModel) {
- var coordSys = seriesModel.coordinateSystem;
- if (coordSys && (coordSys.type === "cartesian2d" || coordSys.type === "polar")) {
- var baseAxis = coordSys.getBaseAxis();
- if (baseAxis.type === "category") {
- var key = baseAxis.dim + "_" + baseAxis.index;
- if (!seriesGroupByCategoryAxis[key]) {
- seriesGroupByCategoryAxis[key] = {
- categoryAxis: baseAxis,
- valueAxis: coordSys.getOtherAxis(baseAxis),
- series: []
- };
- meta.push({
- axisDim: baseAxis.dim,
- axisIndex: baseAxis.index
- });
- }
- seriesGroupByCategoryAxis[key].series.push(seriesModel);
- } else {
- otherSeries.push(seriesModel);
- }
- } else {
- otherSeries.push(seriesModel);
- }
- });
- return {
- seriesGroupByCategoryAxis,
- other: otherSeries,
- meta
- };
- }
- function assembleSeriesWithCategoryAxis(groups) {
- var tables = [];
- each(groups, function(group, key) {
- var categoryAxis = group.categoryAxis;
- var valueAxis = group.valueAxis;
- var valueAxisDim = valueAxis.dim;
- var headers = [" "].concat(map(group.series, function(series) {
- return series.name;
- }));
- var columns = [categoryAxis.model.getCategories()];
- each(group.series, function(series) {
- var rawData = series.getRawData();
- columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function(val) {
- return val;
- }));
- });
- var lines = [headers.join(ITEM_SPLITER)];
- for (var i = 0; i < columns[0].length; i++) {
- var items = [];
- for (var j = 0; j < columns.length; j++) {
- items.push(columns[j][i]);
- }
- lines.push(items.join(ITEM_SPLITER));
- }
- tables.push(lines.join("\n"));
- });
- return tables.join("\n\n" + BLOCK_SPLITER + "\n\n");
- }
- function assembleOtherSeries(series) {
- return map(series, function(series2) {
- var data = series2.getRawData();
- var lines = [series2.name];
- var vals = [];
- data.each(data.dimensions, function() {
- var argLen = arguments.length;
- var dataIndex = arguments[argLen - 1];
- var name = data.getName(dataIndex);
- for (var i = 0; i < argLen - 1; i++) {
- vals[i] = arguments[i];
- }
- lines.push((name ? name + ITEM_SPLITER : "") + vals.join(ITEM_SPLITER));
- });
- return lines.join("\n");
- }).join("\n\n" + BLOCK_SPLITER + "\n\n");
- }
- function getContentFromModel(ecModel) {
- var result = groupSeries(ecModel);
- return {
- value: filter([assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis), assembleOtherSeries(result.other)], function(str) {
- return !!str.replace(/[\n\t\s]/g, "");
- }).join("\n\n" + BLOCK_SPLITER + "\n\n"),
- meta: result.meta
- };
- }
- function trim2(str) {
- return str.replace(/^\s\s*/, "").replace(/\s\s*$/, "");
- }
- function isTSVFormat(block) {
- var firstLine = block.slice(0, block.indexOf("\n"));
- if (firstLine.indexOf(ITEM_SPLITER) >= 0) {
- return true;
- }
- }
- var itemSplitRegex = new RegExp("[" + ITEM_SPLITER + "]+", "g");
- function parseTSVContents(tsv) {
- var tsvLines = tsv.split(/\n+/g);
- var headers = trim2(tsvLines.shift()).split(itemSplitRegex);
- var categories = [];
- var series = map(headers, function(header) {
- return {
- name: header,
- data: []
- };
- });
- for (var i = 0; i < tsvLines.length; i++) {
- var items = trim2(tsvLines[i]).split(itemSplitRegex);
- categories.push(items.shift());
- for (var j = 0; j < items.length; j++) {
- series[j] && (series[j].data[i] = items[j]);
- }
- }
- return {
- series,
- categories
- };
- }
- function parseListContents(str) {
- var lines = str.split(/\n+/g);
- var seriesName = trim2(lines.shift());
- var data = [];
- for (var i = 0; i < lines.length; i++) {
- var line = trim2(lines[i]);
- if (!line) {
- continue;
- }
- var items = line.split(itemSplitRegex);
- var name_1 = "";
- var value = void 0;
- var hasName = false;
- if (isNaN(items[0])) {
- hasName = true;
- name_1 = items[0];
- items = items.slice(1);
- data[i] = {
- name: name_1,
- value: []
- };
- value = data[i].value;
- } else {
- value = data[i] = [];
- }
- for (var j = 0; j < items.length; j++) {
- value.push(+items[j]);
- }
- if (value.length === 1) {
- hasName ? data[i].value = value[0] : data[i] = value[0];
- }
- }
- return {
- name: seriesName,
- data
- };
- }
- function parseContents(str, blockMetaList) {
- var blocks = str.split(new RegExp("\n*" + BLOCK_SPLITER + "\n*", "g"));
- var newOption = {
- series: []
- };
- each(blocks, function(block, idx) {
- if (isTSVFormat(block)) {
- var result = parseTSVContents(block);
- var blockMeta = blockMetaList[idx];
- var axisKey = blockMeta.axisDim + "Axis";
- if (blockMeta) {
- newOption[axisKey] = newOption[axisKey] || [];
- newOption[axisKey][blockMeta.axisIndex] = {
- data: result.categories
- };
- newOption.series = newOption.series.concat(result.series);
- }
- } else {
- var result = parseListContents(block);
- newOption.series.push(result);
- }
- });
- return newOption;
- }
- var DataView = function(_super) {
- __extends(DataView2, _super);
- function DataView2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- DataView2.prototype.onclick = function(ecModel, api) {
- setTimeout(function() {
- api.dispatchAction({
- type: "hideTip"
- });
- });
- var container = api.getDom();
- var model = this.model;
- if (this._dom) {
- container.removeChild(this._dom);
- }
- var root = document.createElement("div");
- root.style.cssText = "position:absolute;top:0;bottom:0;left:0;right:0;padding:5px";
- root.style.backgroundColor = model.get("backgroundColor") || "#fff";
- var header = document.createElement("h4");
- var lang = model.get("lang") || [];
- header.innerHTML = lang[0] || model.get("title");
- header.style.cssText = "margin:10px 20px";
- header.style.color = model.get("textColor");
- var viewMain = document.createElement("div");
- var textarea = document.createElement("textarea");
- viewMain.style.cssText = "overflow:auto";
- var optionToContent = model.get("optionToContent");
- var contentToOption = model.get("contentToOption");
- var result = getContentFromModel(ecModel);
- if (isFunction(optionToContent)) {
- var htmlOrDom = optionToContent(api.getOption());
- if (isString(htmlOrDom)) {
- viewMain.innerHTML = htmlOrDom;
- } else if (isDom(htmlOrDom)) {
- viewMain.appendChild(htmlOrDom);
- }
- } else {
- textarea.readOnly = model.get("readOnly");
- var style = textarea.style;
- 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";
- style.color = model.get("textColor");
- style.borderColor = model.get("textareaBorderColor");
- style.backgroundColor = model.get("textareaColor");
- textarea.value = result.value;
- viewMain.appendChild(textarea);
- }
- var blockMetaList = result.meta;
- var buttonContainer = document.createElement("div");
- buttonContainer.style.cssText = "position:absolute;bottom:5px;left:0;right:0";
- var buttonStyle = "float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px";
- var closeButton = document.createElement("div");
- var refreshButton = document.createElement("div");
- buttonStyle += ";background-color:" + model.get("buttonColor");
- buttonStyle += ";color:" + model.get("buttonTextColor");
- var self = this;
- function close() {
- container.removeChild(root);
- self._dom = null;
- }
- addEventListener(closeButton, "click", close);
- addEventListener(refreshButton, "click", function() {
- if (contentToOption == null && optionToContent != null || contentToOption != null && optionToContent == null) {
- if (true) {
- warn("It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.");
- }
- close();
- return;
- }
- var newOption;
- try {
- if (isFunction(contentToOption)) {
- newOption = contentToOption(viewMain, api.getOption());
- } else {
- newOption = parseContents(textarea.value, blockMetaList);
- }
- } catch (e) {
- close();
- throw new Error("Data view format error " + e);
- }
- if (newOption) {
- api.dispatchAction({
- type: "changeDataView",
- newOption
- });
- }
- close();
- });
- closeButton.innerHTML = lang[1];
- refreshButton.innerHTML = lang[2];
- refreshButton.style.cssText = closeButton.style.cssText = buttonStyle;
- !model.get("readOnly") && buttonContainer.appendChild(refreshButton);
- buttonContainer.appendChild(closeButton);
- root.appendChild(header);
- root.appendChild(viewMain);
- root.appendChild(buttonContainer);
- viewMain.style.height = container.clientHeight - 80 + "px";
- container.appendChild(root);
- this._dom = root;
- };
- DataView2.prototype.remove = function(ecModel, api) {
- this._dom && api.getDom().removeChild(this._dom);
- };
- DataView2.prototype.dispose = function(ecModel, api) {
- this.remove(ecModel, api);
- };
- DataView2.getDefaultOption = function(ecModel) {
- var defaultOption2 = {
- show: true,
- readOnly: false,
- optionToContent: null,
- contentToOption: null,
- icon: "M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",
- title: ecModel.getLocaleModel().get(["toolbox", "dataView", "title"]),
- lang: ecModel.getLocaleModel().get(["toolbox", "dataView", "lang"]),
- backgroundColor: "#fff",
- textColor: "#000",
- textareaColor: "#fff",
- textareaBorderColor: "#333",
- buttonColor: "#c23531",
- buttonTextColor: "#fff"
- };
- return defaultOption2;
- };
- return DataView2;
- }(ToolboxFeature);
- function tryMergeDataOption(newData, originalData) {
- return map(newData, function(newVal, idx) {
- var original = originalData && originalData[idx];
- if (isObject(original) && !isArray(original)) {
- var newValIsObject = isObject(newVal) && !isArray(newVal);
- if (!newValIsObject) {
- newVal = {
- value: newVal
- };
- }
- var shouldDeleteName = original.name != null && newVal.name == null;
- newVal = defaults(newVal, original);
- shouldDeleteName && delete newVal.name;
- return newVal;
- } else {
- return newVal;
- }
- });
- }
- registerAction({
- type: "changeDataView",
- event: "dataViewChanged",
- update: "prepareAndUpdate"
- }, function(payload, ecModel) {
- var newSeriesOptList = [];
- each(payload.newOption.series, function(seriesOpt) {
- var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];
- if (!seriesModel) {
- newSeriesOptList.push(extend({
- type: "scatter"
- }, seriesOpt));
- } else {
- var originalData = seriesModel.get("data");
- newSeriesOptList.push({
- name: seriesOpt.name,
- data: tryMergeDataOption(seriesOpt.data, originalData)
- });
- }
- });
- ecModel.mergeOption(defaults({
- series: newSeriesOptList
- }, payload.newOption));
- });
- var DataView_default = DataView;
- // node_modules/echarts/lib/component/toolbox/feature/Restore.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/dataZoom/history.js
- init_define_APP_INFO();
- var each4 = each;
- var inner6 = makeInner();
- function push(ecModel, newSnapshot) {
- var storedSnapshots = getStoreSnapshots(ecModel);
- each4(newSnapshot, function(batchItem, dataZoomId) {
- var i = storedSnapshots.length - 1;
- for (; i >= 0; i--) {
- var snapshot = storedSnapshots[i];
- if (snapshot[dataZoomId]) {
- break;
- }
- }
- if (i < 0) {
- var dataZoomModel = ecModel.queryComponents({
- mainType: "dataZoom",
- subType: "select",
- id: dataZoomId
- })[0];
- if (dataZoomModel) {
- var percentRange = dataZoomModel.getPercentRange();
- storedSnapshots[0][dataZoomId] = {
- dataZoomId,
- start: percentRange[0],
- end: percentRange[1]
- };
- }
- }
- });
- storedSnapshots.push(newSnapshot);
- }
- function pop(ecModel) {
- var storedSnapshots = getStoreSnapshots(ecModel);
- var head = storedSnapshots[storedSnapshots.length - 1];
- storedSnapshots.length > 1 && storedSnapshots.pop();
- var snapshot = {};
- each4(head, function(batchItem, dataZoomId) {
- for (var i = storedSnapshots.length - 1; i >= 0; i--) {
- batchItem = storedSnapshots[i][dataZoomId];
- if (batchItem) {
- snapshot[dataZoomId] = batchItem;
- break;
- }
- }
- });
- return snapshot;
- }
- function clear2(ecModel) {
- inner6(ecModel).snapshots = null;
- }
- function count(ecModel) {
- return getStoreSnapshots(ecModel).length;
- }
- function getStoreSnapshots(ecModel) {
- var store = inner6(ecModel);
- if (!store.snapshots) {
- store.snapshots = [{}];
- }
- return store.snapshots;
- }
- // node_modules/echarts/lib/component/toolbox/feature/Restore.js
- var RestoreOption = function(_super) {
- __extends(RestoreOption2, _super);
- function RestoreOption2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- RestoreOption2.prototype.onclick = function(ecModel, api) {
- clear2(ecModel);
- api.dispatchAction({
- type: "restore",
- from: this.uid
- });
- };
- RestoreOption2.getDefaultOption = function(ecModel) {
- var defaultOption2 = {
- show: true,
- icon: "M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",
- title: ecModel.getLocaleModel().get(["toolbox", "restore", "title"])
- };
- return defaultOption2;
- };
- return RestoreOption2;
- }(ToolboxFeature);
- registerAction({
- type: "restore",
- event: "restore",
- update: "prepareAndUpdate"
- }, function(payload, ecModel) {
- ecModel.resetOption("recreate");
- });
- var Restore_default = RestoreOption;
- // node_modules/echarts/lib/component/toolbox/feature/DataZoom.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/helper/BrushTargetManager.js
- init_define_APP_INFO();
- var INCLUDE_FINDER_MAIN_TYPES = ["grid", "xAxis", "yAxis", "geo", "graph", "polar", "radiusAxis", "angleAxis", "bmap"];
- var BrushTargetManager = function() {
- function BrushTargetManager2(finder, ecModel, opt) {
- var _this = this;
- this._targetInfoList = [];
- var foundCpts = parseFinder2(ecModel, finder);
- each(targetInfoBuilders, function(builder, type) {
- if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {
- builder(foundCpts, _this._targetInfoList);
- }
- });
- }
- BrushTargetManager2.prototype.setOutputRanges = function(areas, ecModel) {
- this.matchOutputRanges(areas, ecModel, function(area, coordRange, coordSys) {
- (area.coordRanges || (area.coordRanges = [])).push(coordRange);
- if (!area.coordRange) {
- area.coordRange = coordRange;
- var result = coordConvert[area.brushType](0, coordSys, coordRange);
- area.__rangeOffset = {
- offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),
- xyMinMax: result.xyMinMax
- };
- }
- });
- return areas;
- };
- BrushTargetManager2.prototype.matchOutputRanges = function(areas, ecModel, cb) {
- each(areas, function(area) {
- var targetInfo = this.findTargetInfo(area, ecModel);
- if (targetInfo && targetInfo !== true) {
- each(targetInfo.coordSyses, function(coordSys) {
- var result = coordConvert[area.brushType](1, coordSys, area.range, true);
- cb(area, result.values, coordSys, ecModel);
- });
- }
- }, this);
- };
- BrushTargetManager2.prototype.setInputRanges = function(areas, ecModel) {
- each(areas, function(area) {
- var targetInfo = this.findTargetInfo(area, ecModel);
- if (true) {
- assert(!targetInfo || targetInfo === true || area.coordRange, "coordRange must be specified when coord index specified.");
- assert(!targetInfo || targetInfo !== true || area.range, "range must be specified in global brush.");
- }
- area.range = area.range || [];
- if (targetInfo && targetInfo !== true) {
- area.panelId = targetInfo.panelId;
- var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);
- var rangeOffset = area.__rangeOffset;
- area.range = rangeOffset ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax)) : result.values;
- }
- }, this);
- };
- BrushTargetManager2.prototype.makePanelOpts = function(api, getDefaultBrushType) {
- return map(this._targetInfoList, function(targetInfo) {
- var rect = targetInfo.getPanelRect();
- return {
- panelId: targetInfo.panelId,
- defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null,
- clipPath: makeRectPanelClipPath(rect),
- isTargetByCursor: makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),
- getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect)
- };
- });
- };
- BrushTargetManager2.prototype.controlSeries = function(area, seriesModel, ecModel) {
- var targetInfo = this.findTargetInfo(area, ecModel);
- return targetInfo === true || targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0;
- };
- BrushTargetManager2.prototype.findTargetInfo = function(area, ecModel) {
- var targetInfoList = this._targetInfoList;
- var foundCpts = parseFinder2(ecModel, area);
- for (var i = 0; i < targetInfoList.length; i++) {
- var targetInfo = targetInfoList[i];
- var areaPanelId = area.panelId;
- if (areaPanelId) {
- if (targetInfo.panelId === areaPanelId) {
- return targetInfo;
- }
- } else {
- for (var j = 0; j < targetInfoMatchers.length; j++) {
- if (targetInfoMatchers[j](foundCpts, targetInfo)) {
- return targetInfo;
- }
- }
- }
- }
- return true;
- };
- return BrushTargetManager2;
- }();
- function formatMinMax(minMax) {
- minMax[0] > minMax[1] && minMax.reverse();
- return minMax;
- }
- function parseFinder2(ecModel, finder) {
- return parseFinder(ecModel, finder, {
- includeMainTypes: INCLUDE_FINDER_MAIN_TYPES
- });
- }
- var targetInfoBuilders = {
- grid: function(foundCpts, targetInfoList) {
- var xAxisModels = foundCpts.xAxisModels;
- var yAxisModels = foundCpts.yAxisModels;
- var gridModels = foundCpts.gridModels;
- var gridModelMap = createHashMap();
- var xAxesHas = {};
- var yAxesHas = {};
- if (!xAxisModels && !yAxisModels && !gridModels) {
- return;
- }
- each(xAxisModels, function(axisModel) {
- var gridModel = axisModel.axis.grid.model;
- gridModelMap.set(gridModel.id, gridModel);
- xAxesHas[gridModel.id] = true;
- });
- each(yAxisModels, function(axisModel) {
- var gridModel = axisModel.axis.grid.model;
- gridModelMap.set(gridModel.id, gridModel);
- yAxesHas[gridModel.id] = true;
- });
- each(gridModels, function(gridModel) {
- gridModelMap.set(gridModel.id, gridModel);
- xAxesHas[gridModel.id] = true;
- yAxesHas[gridModel.id] = true;
- });
- gridModelMap.each(function(gridModel) {
- var grid = gridModel.coordinateSystem;
- var cartesians = [];
- each(grid.getCartesians(), function(cartesian, index) {
- if (indexOf(xAxisModels, cartesian.getAxis("x").model) >= 0 || indexOf(yAxisModels, cartesian.getAxis("y").model) >= 0) {
- cartesians.push(cartesian);
- }
- });
- targetInfoList.push({
- panelId: "grid--" + gridModel.id,
- gridModel,
- coordSysModel: gridModel,
- coordSys: cartesians[0],
- coordSyses: cartesians,
- getPanelRect: panelRectBuilders.grid,
- xAxisDeclared: xAxesHas[gridModel.id],
- yAxisDeclared: yAxesHas[gridModel.id]
- });
- });
- },
- geo: function(foundCpts, targetInfoList) {
- each(foundCpts.geoModels, function(geoModel) {
- var coordSys = geoModel.coordinateSystem;
- targetInfoList.push({
- panelId: "geo--" + geoModel.id,
- geoModel,
- coordSysModel: geoModel,
- coordSys,
- coordSyses: [coordSys],
- getPanelRect: panelRectBuilders.geo
- });
- });
- }
- };
- var targetInfoMatchers = [
- function(foundCpts, targetInfo) {
- var xAxisModel = foundCpts.xAxisModel;
- var yAxisModel = foundCpts.yAxisModel;
- var gridModel = foundCpts.gridModel;
- !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);
- !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);
- return gridModel && gridModel === targetInfo.gridModel;
- },
- function(foundCpts, targetInfo) {
- var geoModel = foundCpts.geoModel;
- return geoModel && geoModel === targetInfo.geoModel;
- }
- ];
- var panelRectBuilders = {
- grid: function() {
- return this.coordSys.master.getRect().clone();
- },
- geo: function() {
- var coordSys = this.coordSys;
- var rect = coordSys.getBoundingRect().clone();
- rect.applyTransform(getTransform(coordSys));
- return rect;
- }
- };
- var coordConvert = {
- lineX: curry(axisConvert, 0),
- lineY: curry(axisConvert, 1),
- rect: function(to, coordSys, rangeOrCoordRange, clamp) {
- var xminymin = to ? coordSys.pointToData([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp);
- var xmaxymax = to ? coordSys.pointToData([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp);
- var values = [formatMinMax([xminymin[0], xmaxymax[0]]), formatMinMax([xminymin[1], xmaxymax[1]])];
- return {
- values,
- xyMinMax: values
- };
- },
- polygon: function(to, coordSys, rangeOrCoordRange, clamp) {
- var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];
- var values = map(rangeOrCoordRange, function(item) {
- var p = to ? coordSys.pointToData(item, clamp) : coordSys.dataToPoint(item, clamp);
- xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);
- xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);
- xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);
- xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);
- return p;
- });
- return {
- values,
- xyMinMax
- };
- }
- };
- function axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {
- if (true) {
- assert(coordSys.type === "cartesian2d", "lineX/lineY brush is available only in cartesian2d.");
- }
- var axis = coordSys.getAxis(["x", "y"][axisNameIndex]);
- var values = formatMinMax(map([0, 1], function(i) {
- return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]), true) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));
- }));
- var xyMinMax = [];
- xyMinMax[axisNameIndex] = values;
- xyMinMax[1 - axisNameIndex] = [NaN, NaN];
- return {
- values,
- xyMinMax
- };
- }
- var diffProcessor = {
- lineX: curry(axisDiffProcessor, 0),
- lineY: curry(axisDiffProcessor, 1),
- rect: function(values, refer, scales) {
- 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]]];
- },
- polygon: function(values, refer, scales) {
- return map(values, function(item, idx) {
- return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];
- });
- }
- };
- function axisDiffProcessor(axisNameIndex, values, refer, scales) {
- return [values[0] - scales[axisNameIndex] * refer[0], values[1] - scales[axisNameIndex] * refer[1]];
- }
- function getScales(xyMinMaxCurr, xyMinMaxOrigin) {
- var sizeCurr = getSize(xyMinMaxCurr);
- var sizeOrigin = getSize(xyMinMaxOrigin);
- var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];
- isNaN(scales[0]) && (scales[0] = 1);
- isNaN(scales[1]) && (scales[1] = 1);
- return scales;
- }
- function getSize(xyMinMax) {
- return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN];
- }
- var BrushTargetManager_default = BrushTargetManager;
- // node_modules/echarts/lib/component/toolbox/feature/DataZoom.js
- var each5 = each;
- var DATA_ZOOM_ID_BASE = makeInternalComponentId("toolbox-dataZoom_");
- var DataZoomFeature = function(_super) {
- __extends(DataZoomFeature2, _super);
- function DataZoomFeature2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- DataZoomFeature2.prototype.render = function(featureModel, ecModel, api, payload) {
- if (!this._brushController) {
- this._brushController = new BrushController_default(api.getZr());
- this._brushController.on("brush", bind(this._onBrush, this)).mount();
- }
- updateZoomBtnStatus(featureModel, ecModel, this, payload, api);
- updateBackBtnStatus(featureModel, ecModel);
- };
- DataZoomFeature2.prototype.onclick = function(ecModel, api, type) {
- handlers[type].call(this);
- };
- DataZoomFeature2.prototype.remove = function(ecModel, api) {
- this._brushController && this._brushController.unmount();
- };
- DataZoomFeature2.prototype.dispose = function(ecModel, api) {
- this._brushController && this._brushController.dispose();
- };
- DataZoomFeature2.prototype._onBrush = function(eventParam) {
- var areas = eventParam.areas;
- if (!eventParam.isEnd || !areas.length) {
- return;
- }
- var snapshot = {};
- var ecModel = this.ecModel;
- this._brushController.updateCovers([]);
- var brushTargetManager = new BrushTargetManager_default(makeAxisFinder(this.model), ecModel, {
- include: ["grid"]
- });
- brushTargetManager.matchOutputRanges(areas, ecModel, function(area, coordRange, coordSys) {
- if (coordSys.type !== "cartesian2d") {
- return;
- }
- var brushType = area.brushType;
- if (brushType === "rect") {
- setBatch("x", coordSys, coordRange[0]);
- setBatch("y", coordSys, coordRange[1]);
- } else {
- setBatch({
- lineX: "x",
- lineY: "y"
- }[brushType], coordSys, coordRange);
- }
- });
- push(ecModel, snapshot);
- this._dispatchZoomAction(snapshot);
- function setBatch(dimName, coordSys, minMax) {
- var axis = coordSys.getAxis(dimName);
- var axisModel = axis.model;
- var dataZoomModel = findDataZoom(dimName, axisModel, ecModel);
- var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();
- if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {
- minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan);
- }
- dataZoomModel && (snapshot[dataZoomModel.id] = {
- dataZoomId: dataZoomModel.id,
- startValue: minMax[0],
- endValue: minMax[1]
- });
- }
- function findDataZoom(dimName, axisModel, ecModel2) {
- var found;
- ecModel2.eachComponent({
- mainType: "dataZoom",
- subType: "select"
- }, function(dzModel) {
- var has3 = dzModel.getAxisModel(dimName, axisModel.componentIndex);
- has3 && (found = dzModel);
- });
- return found;
- }
- };
- ;
- DataZoomFeature2.prototype._dispatchZoomAction = function(snapshot) {
- var batch = [];
- each5(snapshot, function(batchItem, dataZoomId) {
- batch.push(clone(batchItem));
- });
- batch.length && this.api.dispatchAction({
- type: "dataZoom",
- from: this.uid,
- batch
- });
- };
- DataZoomFeature2.getDefaultOption = function(ecModel) {
- var defaultOption2 = {
- show: true,
- filterMode: "filter",
- icon: {
- zoom: "M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",
- back: "M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"
- },
- title: ecModel.getLocaleModel().get(["toolbox", "dataZoom", "title"]),
- brushStyle: {
- borderWidth: 0,
- color: "rgba(210,219,238,0.2)"
- }
- };
- return defaultOption2;
- };
- return DataZoomFeature2;
- }(ToolboxFeature);
- var handlers = {
- zoom: function() {
- var nextActive = !this._isZoomActive;
- this.api.dispatchAction({
- type: "takeGlobalCursor",
- key: "dataZoomSelect",
- dataZoomSelectActive: nextActive
- });
- },
- back: function() {
- this._dispatchZoomAction(pop(this.ecModel));
- }
- };
- function makeAxisFinder(dzFeatureModel) {
- var setting = {
- xAxisIndex: dzFeatureModel.get("xAxisIndex", true),
- yAxisIndex: dzFeatureModel.get("yAxisIndex", true),
- xAxisId: dzFeatureModel.get("xAxisId", true),
- yAxisId: dzFeatureModel.get("yAxisId", true)
- };
- if (setting.xAxisIndex == null && setting.xAxisId == null) {
- setting.xAxisIndex = "all";
- }
- if (setting.yAxisIndex == null && setting.yAxisId == null) {
- setting.yAxisIndex = "all";
- }
- return setting;
- }
- function updateBackBtnStatus(featureModel, ecModel) {
- featureModel.setIconStatus("back", count(ecModel) > 1 ? "emphasis" : "normal");
- }
- function updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {
- var zoomActive = view._isZoomActive;
- if (payload && payload.type === "takeGlobalCursor") {
- zoomActive = payload.key === "dataZoomSelect" ? payload.dataZoomSelectActive : false;
- }
- view._isZoomActive = zoomActive;
- featureModel.setIconStatus("zoom", zoomActive ? "emphasis" : "normal");
- var brushTargetManager = new BrushTargetManager_default(makeAxisFinder(featureModel), ecModel, {
- include: ["grid"]
- });
- var panels = brushTargetManager.makePanelOpts(api, function(targetInfo) {
- return targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared ? "lineX" : !targetInfo.xAxisDeclared && targetInfo.yAxisDeclared ? "lineY" : "rect";
- });
- view._brushController.setPanels(panels).enableBrush(zoomActive && panels.length ? {
- brushType: "auto",
- brushStyle: featureModel.getModel("brushStyle").getItemStyle()
- } : false);
- }
- registerInternalOptionCreator("dataZoom", function(ecModel) {
- var toolboxModel = ecModel.getComponent("toolbox", 0);
- var featureDataZoomPath = ["feature", "dataZoom"];
- if (!toolboxModel || toolboxModel.get(featureDataZoomPath) == null) {
- return;
- }
- var dzFeatureModel = toolboxModel.getModel(featureDataZoomPath);
- var dzOptions = [];
- var finder = makeAxisFinder(dzFeatureModel);
- var finderResult = parseFinder(ecModel, finder);
- each5(finderResult.xAxisModels, function(axisModel) {
- return buildInternalOptions(axisModel, "xAxis", "xAxisIndex");
- });
- each5(finderResult.yAxisModels, function(axisModel) {
- return buildInternalOptions(axisModel, "yAxis", "yAxisIndex");
- });
- function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) {
- var axisIndex = axisModel.componentIndex;
- var newOpt = {
- type: "select",
- $fromToolbox: true,
- filterMode: dzFeatureModel.get("filterMode", true) || "filter",
- id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex
- };
- newOpt[axisIndexPropName] = axisIndex;
- dzOptions.push(newOpt);
- }
- return dzOptions;
- });
- var DataZoom_default = DataZoomFeature;
- // node_modules/echarts/lib/component/toolbox/install.js
- function install12(registers) {
- registers.registerComponentModel(ToolboxModel_default);
- registers.registerComponentView(ToolboxView_default);
- registerFeature("saveAsImage", SaveAsImage_default);
- registerFeature("magicType", MagicType_default);
- registerFeature("dataView", DataView_default);
- registerFeature("dataZoom", DataZoom_default);
- registerFeature("restore", Restore_default);
- use(install11);
- }
- // node_modules/echarts/lib/component/tooltip/install.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/tooltip/TooltipModel.js
- init_define_APP_INFO();
- var TooltipModel = function(_super) {
- __extends(TooltipModel2, _super);
- function TooltipModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = TooltipModel2.type;
- return _this;
- }
- TooltipModel2.type = "tooltip";
- TooltipModel2.dependencies = ["axisPointer"];
- TooltipModel2.defaultOption = {
- z: 60,
- show: true,
- showContent: true,
- trigger: "item",
- triggerOn: "mousemove|click",
- alwaysShowContent: false,
- displayMode: "single",
- renderMode: "auto",
- confine: null,
- showDelay: 0,
- hideDelay: 100,
- transitionDuration: 0.4,
- enterable: false,
- backgroundColor: "#fff",
- shadowBlur: 10,
- shadowColor: "rgba(0, 0, 0, .2)",
- shadowOffsetX: 1,
- shadowOffsetY: 2,
- borderRadius: 4,
- borderWidth: 1,
- padding: null,
- extraCssText: "",
- axisPointer: {
- type: "line",
- axis: "auto",
- animation: "auto",
- animationDurationUpdate: 200,
- animationEasingUpdate: "exponentialOut",
- crossStyle: {
- color: "#999",
- width: 1,
- type: "dashed",
- textStyle: {}
- }
- },
- textStyle: {
- color: "#666",
- fontSize: 14
- }
- };
- return TooltipModel2;
- }(Component_default);
- var TooltipModel_default = TooltipModel;
- // node_modules/echarts/lib/component/tooltip/TooltipView.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/tooltip/TooltipHTMLContent.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/tooltip/helper.js
- init_define_APP_INFO();
- function shouldTooltipConfine(tooltipModel) {
- var confineOption = tooltipModel.get("confine");
- return confineOption != null ? !!confineOption : tooltipModel.get("renderMode") === "richText";
- }
- function testStyle(styleProps) {
- if (!env_default.domSupported) {
- return;
- }
- var style = document.documentElement.style;
- for (var i = 0, len = styleProps.length; i < len; i++) {
- if (styleProps[i] in style) {
- return styleProps[i];
- }
- }
- }
- var TRANSFORM_VENDOR = testStyle(["transform", "webkitTransform", "OTransform", "MozTransform", "msTransform"]);
- var TRANSITION_VENDOR = testStyle(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]);
- function toCSSVendorPrefix(styleVendor, styleProp) {
- if (!styleVendor) {
- return styleProp;
- }
- styleProp = toCamelCase(styleProp, true);
- var idx = styleVendor.indexOf(styleProp);
- styleVendor = idx === -1 ? styleProp : "-" + styleVendor.slice(0, idx) + "-" + styleProp;
- return styleVendor.toLowerCase();
- }
- function getComputedStyle(el, style) {
- var stl = el.currentStyle || document.defaultView && document.defaultView.getComputedStyle(el);
- return stl ? style ? stl[style] : stl : null;
- }
- // node_modules/echarts/lib/component/tooltip/TooltipHTMLContent.js
- var CSS_TRANSITION_VENDOR = toCSSVendorPrefix(TRANSITION_VENDOR, "transition");
- var CSS_TRANSFORM_VENDOR = toCSSVendorPrefix(TRANSFORM_VENDOR, "transform");
- var gCssText = "position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;" + (env_default.transform3dSupported ? "will-change:transform;" : "");
- function mirrorPos(pos) {
- pos = pos === "left" ? "right" : pos === "right" ? "left" : pos === "top" ? "bottom" : "top";
- return pos;
- }
- function assembleArrow(tooltipModel, borderColor, arrowPosition) {
- if (!isString(arrowPosition) || arrowPosition === "inside") {
- return "";
- }
- var backgroundColor = tooltipModel.get("backgroundColor");
- var borderWidth = tooltipModel.get("borderWidth");
- borderColor = convertToColorString(borderColor);
- var arrowPos = mirrorPos(arrowPosition);
- var arrowSize = Math.max(Math.round(borderWidth) * 1.5, 6);
- var positionStyle = "";
- var transformStyle = CSS_TRANSFORM_VENDOR + ":";
- var rotateDeg;
- if (indexOf(["left", "right"], arrowPos) > -1) {
- positionStyle += "top:50%";
- transformStyle += "translateY(-50%) rotate(" + (rotateDeg = arrowPos === "left" ? -225 : -45) + "deg)";
- } else {
- positionStyle += "left:50%";
- transformStyle += "translateX(-50%) rotate(" + (rotateDeg = arrowPos === "top" ? 225 : 45) + "deg)";
- }
- var rotateRadian = rotateDeg * Math.PI / 180;
- var arrowWH = arrowSize + borderWidth;
- var rotatedWH = arrowWH * Math.abs(Math.cos(rotateRadian)) + arrowWH * Math.abs(Math.sin(rotateRadian));
- var arrowOffset = Math.round(((rotatedWH - Math.SQRT2 * borderWidth) / 2 + Math.SQRT2 * borderWidth - (rotatedWH - arrowWH) / 2) * 100) / 100;
- positionStyle += ";" + arrowPos + ":-" + arrowOffset + "px";
- var borderStyle = borderColor + " solid " + borderWidth + "px;";
- var styleCss = ["position:absolute;width:" + arrowSize + "px;height:" + arrowSize + "px;", positionStyle + ";" + transformStyle + ";", "border-bottom:" + borderStyle, "border-right:" + borderStyle, "background-color:" + backgroundColor + ";"];
- return '<div style="' + styleCss.join("") + '"></div>';
- }
- function assembleTransition(duration, onlyFade) {
- var transitionCurve = "cubic-bezier(0.23,1,0.32,1)";
- var transitionOption = " " + duration / 2 + "s " + transitionCurve;
- var transitionText = "opacity" + transitionOption + ",visibility" + transitionOption;
- if (!onlyFade) {
- transitionOption = " " + duration + "s " + transitionCurve;
- transitionText += env_default.transformSupported ? "," + CSS_TRANSFORM_VENDOR + transitionOption : ",left" + transitionOption + ",top" + transitionOption;
- }
- return CSS_TRANSITION_VENDOR + ":" + transitionText;
- }
- function assembleTransform(x, y, toString) {
- var x0 = x.toFixed(0) + "px";
- var y0 = y.toFixed(0) + "px";
- if (!env_default.transformSupported) {
- return toString ? "top:" + y0 + ";left:" + x0 + ";" : [["top", y0], ["left", x0]];
- }
- var is3d = env_default.transform3dSupported;
- var translate2 = "translate" + (is3d ? "3d" : "") + "(" + x0 + "," + y0 + (is3d ? ",0" : "") + ")";
- return toString ? "top:0;left:0;" + CSS_TRANSFORM_VENDOR + ":" + translate2 + ";" : [["top", 0], ["left", 0], [TRANSFORM_VENDOR, translate2]];
- }
- function assembleFont(textStyleModel) {
- var cssText = [];
- var fontSize = textStyleModel.get("fontSize");
- var color = textStyleModel.getTextColor();
- color && cssText.push("color:" + color);
- cssText.push("font:" + textStyleModel.getFont());
- fontSize && cssText.push("line-height:" + Math.round(fontSize * 3 / 2) + "px");
- var shadowColor = textStyleModel.get("textShadowColor");
- var shadowBlur = textStyleModel.get("textShadowBlur") || 0;
- var shadowOffsetX = textStyleModel.get("textShadowOffsetX") || 0;
- var shadowOffsetY = textStyleModel.get("textShadowOffsetY") || 0;
- shadowColor && shadowBlur && cssText.push("text-shadow:" + shadowOffsetX + "px " + shadowOffsetY + "px " + shadowBlur + "px " + shadowColor);
- each(["decoration", "align"], function(name) {
- var val = textStyleModel.get(name);
- val && cssText.push("text-" + name + ":" + val);
- });
- return cssText.join(";");
- }
- function assembleCssText(tooltipModel, enableTransition, onlyFade) {
- var cssText = [];
- var transitionDuration = tooltipModel.get("transitionDuration");
- var backgroundColor = tooltipModel.get("backgroundColor");
- var shadowBlur = tooltipModel.get("shadowBlur");
- var shadowColor = tooltipModel.get("shadowColor");
- var shadowOffsetX = tooltipModel.get("shadowOffsetX");
- var shadowOffsetY = tooltipModel.get("shadowOffsetY");
- var textStyleModel = tooltipModel.getModel("textStyle");
- var padding = getPaddingFromTooltipModel(tooltipModel, "html");
- var boxShadow = shadowOffsetX + "px " + shadowOffsetY + "px " + shadowBlur + "px " + shadowColor;
- cssText.push("box-shadow:" + boxShadow);
- enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade));
- if (backgroundColor) {
- cssText.push("background-color:" + backgroundColor);
- }
- each(["width", "color", "radius"], function(name) {
- var borderName = "border-" + name;
- var camelCase = toCamelCase(borderName);
- var val = tooltipModel.get(camelCase);
- val != null && cssText.push(borderName + ":" + val + (name === "color" ? "" : "px"));
- });
- cssText.push(assembleFont(textStyleModel));
- if (padding != null) {
- cssText.push("padding:" + normalizeCssArray(padding).join("px ") + "px");
- }
- return cssText.join(";") + ";";
- }
- function makeStyleCoord(out, zr, appendToBody, zrX, zrY) {
- var zrPainter = zr && zr.painter;
- if (appendToBody) {
- var zrViewportRoot = zrPainter && zrPainter.getViewportRoot();
- if (zrViewportRoot) {
- transformLocalCoord(out, zrViewportRoot, document.body, zrX, zrY);
- }
- } else {
- out[0] = zrX;
- out[1] = zrY;
- var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset();
- if (viewportRootOffset) {
- out[0] += viewportRootOffset.offsetLeft;
- out[1] += viewportRootOffset.offsetTop;
- }
- }
- out[2] = out[0] / zr.getWidth();
- out[3] = out[1] / zr.getHeight();
- }
- var TooltipHTMLContent = function() {
- function TooltipHTMLContent2(container, api, opt) {
- this._show = false;
- this._styleCoord = [0, 0, 0, 0];
- this._enterable = true;
- this._firstShow = true;
- this._longHide = true;
- if (env_default.wxa) {
- return null;
- }
- var el = document.createElement("div");
- el.domBelongToZr = true;
- this.el = el;
- var zr = this._zr = api.getZr();
- var appendToBody = this._appendToBody = opt && opt.appendToBody;
- makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2);
- if (appendToBody) {
- document.body.appendChild(el);
- } else {
- container.appendChild(el);
- }
- this._container = container;
- var self = this;
- el.onmouseenter = function() {
- if (self._enterable) {
- clearTimeout(self._hideTimeout);
- self._show = true;
- }
- self._inContent = true;
- };
- el.onmousemove = function(e) {
- e = e || window.event;
- if (!self._enterable) {
- var handler = zr.handler;
- var zrViewportRoot = zr.painter.getViewportRoot();
- normalizeEvent(zrViewportRoot, e, true);
- handler.dispatch("mousemove", e);
- }
- };
- el.onmouseleave = function() {
- self._inContent = false;
- if (self._enterable) {
- if (self._show) {
- self.hideLater(self._hideDelay);
- }
- }
- };
- }
- TooltipHTMLContent2.prototype.update = function(tooltipModel) {
- var container = this._container;
- var position = getComputedStyle(container, "position");
- var domStyle = container.style;
- if (domStyle.position !== "absolute" && position !== "absolute") {
- domStyle.position = "relative";
- }
- var alwaysShowContent = tooltipModel.get("alwaysShowContent");
- alwaysShowContent && this._moveIfResized();
- this.el.className = tooltipModel.get("className") || "";
- };
- TooltipHTMLContent2.prototype.show = function(tooltipModel, nearPointColor) {
- clearTimeout(this._hideTimeout);
- clearTimeout(this._longHideTimeout);
- var el = this.el;
- var style = el.style;
- var styleCoord = this._styleCoord;
- if (!el.innerHTML) {
- style.display = "none";
- } else {
- 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"));
- }
- this._show = true;
- this._firstShow = false;
- this._longHide = false;
- };
- TooltipHTMLContent2.prototype.setContent = function(content, markers, tooltipModel, borderColor, arrowPosition) {
- var el = this.el;
- if (content == null) {
- el.innerHTML = "";
- return;
- }
- var arrow = "";
- if (isString(arrowPosition) && tooltipModel.get("trigger") === "item" && !shouldTooltipConfine(tooltipModel)) {
- arrow = assembleArrow(tooltipModel, borderColor, arrowPosition);
- }
- if (isString(content)) {
- el.innerHTML = content + arrow;
- } else if (content) {
- el.innerHTML = "";
- if (!isArray(content)) {
- content = [content];
- }
- for (var i = 0; i < content.length; i++) {
- if (isDom(content[i]) && content[i].parentNode !== el) {
- el.appendChild(content[i]);
- }
- }
- if (arrow && el.childNodes.length) {
- var arrowEl = document.createElement("div");
- arrowEl.innerHTML = arrow;
- el.appendChild(arrowEl);
- }
- }
- };
- TooltipHTMLContent2.prototype.setEnterable = function(enterable) {
- this._enterable = enterable;
- };
- TooltipHTMLContent2.prototype.getSize = function() {
- var el = this.el;
- return [el.offsetWidth, el.offsetHeight];
- };
- TooltipHTMLContent2.prototype.moveTo = function(zrX, zrY) {
- var styleCoord = this._styleCoord;
- makeStyleCoord(styleCoord, this._zr, this._appendToBody, zrX, zrY);
- if (styleCoord[0] != null && styleCoord[1] != null) {
- var style_1 = this.el.style;
- var transforms = assembleTransform(styleCoord[0], styleCoord[1]);
- each(transforms, function(transform) {
- style_1[transform[0]] = transform[1];
- });
- }
- };
- TooltipHTMLContent2.prototype._moveIfResized = function() {
- var ratioX = this._styleCoord[2];
- var ratioY = this._styleCoord[3];
- this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());
- };
- TooltipHTMLContent2.prototype.hide = function() {
- var _this = this;
- var style = this.el.style;
- style.visibility = "hidden";
- style.opacity = "0";
- env_default.transform3dSupported && (style.willChange = "");
- this._show = false;
- this._longHideTimeout = setTimeout(function() {
- return _this._longHide = true;
- }, 500);
- };
- TooltipHTMLContent2.prototype.hideLater = function(time) {
- if (this._show && !(this._inContent && this._enterable)) {
- if (time) {
- this._hideDelay = time;
- this._show = false;
- this._hideTimeout = setTimeout(bind(this.hide, this), time);
- } else {
- this.hide();
- }
- }
- };
- TooltipHTMLContent2.prototype.isShow = function() {
- return this._show;
- };
- TooltipHTMLContent2.prototype.dispose = function() {
- this.el.parentNode.removeChild(this.el);
- };
- return TooltipHTMLContent2;
- }();
- var TooltipHTMLContent_default = TooltipHTMLContent;
- // node_modules/echarts/lib/component/tooltip/TooltipRichContent.js
- init_define_APP_INFO();
- var TooltipRichContent = function() {
- function TooltipRichContent2(api) {
- this._show = false;
- this._styleCoord = [0, 0, 0, 0];
- this._enterable = true;
- this._zr = api.getZr();
- makeStyleCoord2(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2);
- }
- TooltipRichContent2.prototype.update = function(tooltipModel) {
- var alwaysShowContent = tooltipModel.get("alwaysShowContent");
- alwaysShowContent && this._moveIfResized();
- };
- TooltipRichContent2.prototype.show = function() {
- if (this._hideTimeout) {
- clearTimeout(this._hideTimeout);
- }
- this.el.show();
- this._show = true;
- };
- TooltipRichContent2.prototype.setContent = function(content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) {
- var _this = this;
- if (isObject(content)) {
- throwError(true ? "Passing DOM nodes as content is not supported in richText tooltip!" : "");
- }
- if (this.el) {
- this._zr.remove(this.el);
- }
- var textStyleModel = tooltipModel.getModel("textStyle");
- this.el = new Text_default({
- style: {
- rich: markupStyleCreator.richTextStyles,
- text: content,
- lineHeight: 22,
- borderWidth: 1,
- borderColor,
- textShadowColor: textStyleModel.get("textShadowColor"),
- fill: tooltipModel.get(["textStyle", "color"]),
- padding: getPaddingFromTooltipModel(tooltipModel, "richText"),
- verticalAlign: "top",
- align: "left"
- },
- z: tooltipModel.get("z")
- });
- each(["backgroundColor", "borderRadius", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"], function(propName) {
- _this.el.style[propName] = tooltipModel.get(propName);
- });
- each(["textShadowBlur", "textShadowOffsetX", "textShadowOffsetY"], function(propName) {
- _this.el.style[propName] = textStyleModel.get(propName) || 0;
- });
- this._zr.add(this.el);
- var self = this;
- this.el.on("mouseover", function() {
- if (self._enterable) {
- clearTimeout(self._hideTimeout);
- self._show = true;
- }
- self._inContent = true;
- });
- this.el.on("mouseout", function() {
- if (self._enterable) {
- if (self._show) {
- self.hideLater(self._hideDelay);
- }
- }
- self._inContent = false;
- });
- };
- TooltipRichContent2.prototype.setEnterable = function(enterable) {
- this._enterable = enterable;
- };
- TooltipRichContent2.prototype.getSize = function() {
- var el = this.el;
- var bounding = this.el.getBoundingRect();
- var shadowOuterSize = calcShadowOuterSize(el.style);
- return [bounding.width + shadowOuterSize.left + shadowOuterSize.right, bounding.height + shadowOuterSize.top + shadowOuterSize.bottom];
- };
- TooltipRichContent2.prototype.moveTo = function(x, y) {
- var el = this.el;
- if (el) {
- var styleCoord = this._styleCoord;
- makeStyleCoord2(styleCoord, this._zr, x, y);
- x = styleCoord[0];
- y = styleCoord[1];
- var style = el.style;
- var borderWidth = mathMaxWith0(style.borderWidth || 0);
- var shadowOuterSize = calcShadowOuterSize(style);
- el.x = x + borderWidth + shadowOuterSize.left;
- el.y = y + borderWidth + shadowOuterSize.top;
- el.markRedraw();
- }
- };
- TooltipRichContent2.prototype._moveIfResized = function() {
- var ratioX = this._styleCoord[2];
- var ratioY = this._styleCoord[3];
- this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());
- };
- TooltipRichContent2.prototype.hide = function() {
- if (this.el) {
- this.el.hide();
- }
- this._show = false;
- };
- TooltipRichContent2.prototype.hideLater = function(time) {
- if (this._show && !(this._inContent && this._enterable)) {
- if (time) {
- this._hideDelay = time;
- this._show = false;
- this._hideTimeout = setTimeout(bind(this.hide, this), time);
- } else {
- this.hide();
- }
- }
- };
- TooltipRichContent2.prototype.isShow = function() {
- return this._show;
- };
- TooltipRichContent2.prototype.dispose = function() {
- this._zr.remove(this.el);
- };
- return TooltipRichContent2;
- }();
- function mathMaxWith0(val) {
- return Math.max(0, val);
- }
- function calcShadowOuterSize(style) {
- var shadowBlur = mathMaxWith0(style.shadowBlur || 0);
- var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0);
- var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0);
- return {
- left: mathMaxWith0(shadowBlur - shadowOffsetX),
- right: mathMaxWith0(shadowBlur + shadowOffsetX),
- top: mathMaxWith0(shadowBlur - shadowOffsetY),
- bottom: mathMaxWith0(shadowBlur + shadowOffsetY)
- };
- }
- function makeStyleCoord2(out, zr, zrX, zrY) {
- out[0] = zrX;
- out[1] = zrY;
- out[2] = out[0] / zr.getWidth();
- out[3] = out[1] / zr.getHeight();
- }
- var TooltipRichContent_default = TooltipRichContent;
- // node_modules/echarts/lib/component/tooltip/TooltipView.js
- var proxyRect = new Rect_default({
- shape: {
- x: -1,
- y: -1,
- width: 2,
- height: 2
- }
- });
- var TooltipView = function(_super) {
- __extends(TooltipView2, _super);
- function TooltipView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = TooltipView2.type;
- return _this;
- }
- TooltipView2.prototype.init = function(ecModel, api) {
- if (env_default.node || !api.getDom()) {
- return;
- }
- var tooltipModel = ecModel.getComponent("tooltip");
- var renderMode = this._renderMode = getTooltipRenderMode(tooltipModel.get("renderMode"));
- this._tooltipContent = renderMode === "richText" ? new TooltipRichContent_default(api) : new TooltipHTMLContent_default(api.getDom(), api, {
- appendToBody: tooltipModel.get("appendToBody", true)
- });
- };
- TooltipView2.prototype.render = function(tooltipModel, ecModel, api) {
- if (env_default.node || !api.getDom()) {
- return;
- }
- this.group.removeAll();
- this._tooltipModel = tooltipModel;
- this._ecModel = ecModel;
- this._api = api;
- this._alwaysShowContent = tooltipModel.get("alwaysShowContent");
- var tooltipContent = this._tooltipContent;
- tooltipContent.update(tooltipModel);
- tooltipContent.setEnterable(tooltipModel.get("enterable"));
- this._initGlobalListener();
- this._keepShow();
- if (this._renderMode !== "richText" && tooltipModel.get("transitionDuration")) {
- createOrUpdate(this, "_updatePosition", 50, "fixRate");
- } else {
- clear(this, "_updatePosition");
- }
- };
- TooltipView2.prototype._initGlobalListener = function() {
- var tooltipModel = this._tooltipModel;
- var triggerOn = tooltipModel.get("triggerOn");
- register("itemTooltip", this._api, bind(function(currTrigger, e, dispatchAction3) {
- if (triggerOn !== "none") {
- if (triggerOn.indexOf(currTrigger) >= 0) {
- this._tryShow(e, dispatchAction3);
- } else if (currTrigger === "leave") {
- this._hide(dispatchAction3);
- }
- }
- }, this));
- };
- TooltipView2.prototype._keepShow = function() {
- var tooltipModel = this._tooltipModel;
- var ecModel = this._ecModel;
- var api = this._api;
- var triggerOn = tooltipModel.get("triggerOn");
- if (this._lastX != null && this._lastY != null && triggerOn !== "none" && triggerOn !== "click") {
- var self_1 = this;
- clearTimeout(this._refreshUpdateTimeout);
- this._refreshUpdateTimeout = setTimeout(function() {
- !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, {
- x: self_1._lastX,
- y: self_1._lastY,
- dataByCoordSys: self_1._lastDataByCoordSys
- });
- });
- }
- };
- TooltipView2.prototype.manuallyShowTip = function(tooltipModel, ecModel, api, payload) {
- if (payload.from === this.uid || env_default.node || !api.getDom()) {
- return;
- }
- var dispatchAction3 = makeDispatchAction2(payload, api);
- this._ticket = "";
- var dataByCoordSys = payload.dataByCoordSys;
- var cmptRef = findComponentReference(payload, ecModel, api);
- if (cmptRef) {
- var rect = cmptRef.el.getBoundingRect().clone();
- rect.applyTransform(cmptRef.el.transform);
- this._tryShow({
- offsetX: rect.x + rect.width / 2,
- offsetY: rect.y + rect.height / 2,
- target: cmptRef.el,
- position: payload.position,
- positionDefault: "bottom"
- }, dispatchAction3);
- } else if (payload.tooltip && payload.x != null && payload.y != null) {
- var el = proxyRect;
- el.x = payload.x;
- el.y = payload.y;
- el.update();
- getECData(el).tooltipConfig = {
- name: null,
- option: payload.tooltip
- };
- this._tryShow({
- offsetX: payload.x,
- offsetY: payload.y,
- target: el
- }, dispatchAction3);
- } else if (dataByCoordSys) {
- this._tryShow({
- offsetX: payload.x,
- offsetY: payload.y,
- position: payload.position,
- dataByCoordSys,
- tooltipOption: payload.tooltipOption
- }, dispatchAction3);
- } else if (payload.seriesIndex != null) {
- if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) {
- return;
- }
- var pointInfo = findPointFromSeries(payload, ecModel);
- var cx = pointInfo.point[0];
- var cy = pointInfo.point[1];
- if (cx != null && cy != null) {
- this._tryShow({
- offsetX: cx,
- offsetY: cy,
- target: pointInfo.el,
- position: payload.position,
- positionDefault: "bottom"
- }, dispatchAction3);
- }
- } else if (payload.x != null && payload.y != null) {
- api.dispatchAction({
- type: "updateAxisPointer",
- x: payload.x,
- y: payload.y
- });
- this._tryShow({
- offsetX: payload.x,
- offsetY: payload.y,
- position: payload.position,
- target: api.getZr().findHover(payload.x, payload.y).target
- }, dispatchAction3);
- }
- };
- TooltipView2.prototype.manuallyHideTip = function(tooltipModel, ecModel, api, payload) {
- var tooltipContent = this._tooltipContent;
- if (!this._alwaysShowContent && this._tooltipModel) {
- tooltipContent.hideLater(this._tooltipModel.get("hideDelay"));
- }
- this._lastX = this._lastY = this._lastDataByCoordSys = null;
- if (payload.from !== this.uid) {
- this._hide(makeDispatchAction2(payload, api));
- }
- };
- TooltipView2.prototype._manuallyAxisShowTip = function(tooltipModel, ecModel, api, payload) {
- var seriesIndex = payload.seriesIndex;
- var dataIndex = payload.dataIndex;
- var coordSysAxesInfo = ecModel.getComponent("axisPointer").coordSysAxesInfo;
- if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {
- return;
- }
- var seriesModel = ecModel.getSeriesByIndex(seriesIndex);
- if (!seriesModel) {
- return;
- }
- var data = seriesModel.getData();
- var tooltipCascadedModel = buildTooltipModel([data.getItemModel(dataIndex), seriesModel, (seriesModel.coordinateSystem || {}).model], this._tooltipModel);
- if (tooltipCascadedModel.get("trigger") !== "axis") {
- return;
- }
- api.dispatchAction({
- type: "updateAxisPointer",
- seriesIndex,
- dataIndex,
- position: payload.position
- });
- return true;
- };
- TooltipView2.prototype._tryShow = function(e, dispatchAction3) {
- var el = e.target;
- var tooltipModel = this._tooltipModel;
- if (!tooltipModel) {
- return;
- }
- this._lastX = e.offsetX;
- this._lastY = e.offsetY;
- var dataByCoordSys = e.dataByCoordSys;
- if (dataByCoordSys && dataByCoordSys.length) {
- this._showAxisTooltip(dataByCoordSys, e);
- } else if (el) {
- this._lastDataByCoordSys = null;
- var seriesDispatcher_1;
- var cmptDispatcher_1;
- findEventDispatcher(el, function(target) {
- if (getECData(target).dataIndex != null) {
- seriesDispatcher_1 = target;
- return true;
- }
- if (getECData(target).tooltipConfig != null) {
- cmptDispatcher_1 = target;
- return true;
- }
- }, true);
- if (seriesDispatcher_1) {
- this._showSeriesItemTooltip(e, seriesDispatcher_1, dispatchAction3);
- } else if (cmptDispatcher_1) {
- this._showComponentItemTooltip(e, cmptDispatcher_1, dispatchAction3);
- } else {
- this._hide(dispatchAction3);
- }
- } else {
- this._lastDataByCoordSys = null;
- this._hide(dispatchAction3);
- }
- };
- TooltipView2.prototype._showOrMove = function(tooltipModel, cb) {
- var delay = tooltipModel.get("showDelay");
- cb = bind(cb, this);
- clearTimeout(this._showTimout);
- delay > 0 ? this._showTimout = setTimeout(cb, delay) : cb();
- };
- TooltipView2.prototype._showAxisTooltip = function(dataByCoordSys, e) {
- var ecModel = this._ecModel;
- var globalTooltipModel = this._tooltipModel;
- var point = [e.offsetX, e.offsetY];
- var singleTooltipModel = buildTooltipModel([e.tooltipOption], globalTooltipModel);
- var renderMode = this._renderMode;
- var cbParamsList = [];
- var articleMarkup = createTooltipMarkup("section", {
- blocks: [],
- noHeader: true
- });
- var markupTextArrLegacy = [];
- var markupStyleCreator = new TooltipMarkupStyleCreator();
- each(dataByCoordSys, function(itemCoordSys) {
- each(itemCoordSys.dataByAxis, function(axisItem) {
- var axisModel = ecModel.getComponent(axisItem.axisDim + "Axis", axisItem.axisIndex);
- var axisValue = axisItem.value;
- if (!axisModel || axisValue == null) {
- return;
- }
- var axisValueLabel = getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt);
- var axisSectionMarkup = createTooltipMarkup("section", {
- header: axisValueLabel,
- noHeader: !trim(axisValueLabel),
- sortBlocks: true,
- blocks: []
- });
- articleMarkup.blocks.push(axisSectionMarkup);
- each(axisItem.seriesDataIndices, function(idxItem) {
- var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);
- var dataIndex = idxItem.dataIndexInside;
- var cbParams = series.getDataParams(dataIndex);
- if (cbParams.dataIndex < 0) {
- return;
- }
- cbParams.axisDim = axisItem.axisDim;
- cbParams.axisIndex = axisItem.axisIndex;
- cbParams.axisType = axisItem.axisType;
- cbParams.axisId = axisItem.axisId;
- cbParams.axisValue = getAxisRawValue(axisModel.axis, {
- value: axisValue
- });
- cbParams.axisValueLabel = axisValueLabel;
- cbParams.marker = markupStyleCreator.makeTooltipMarker("item", convertToColorString(cbParams.color), renderMode);
- var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null));
- var frag = seriesTooltipResult.frag;
- if (frag) {
- var valueFormatter = buildTooltipModel([series], globalTooltipModel).get("valueFormatter");
- axisSectionMarkup.blocks.push(valueFormatter ? extend({
- valueFormatter
- }, frag) : frag);
- }
- if (seriesTooltipResult.text) {
- markupTextArrLegacy.push(seriesTooltipResult.text);
- }
- cbParamsList.push(cbParams);
- });
- });
- });
- articleMarkup.blocks.reverse();
- markupTextArrLegacy.reverse();
- var positionExpr = e.position;
- var orderMode = singleTooltipModel.get("order");
- var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get("useUTC"), singleTooltipModel.get("textStyle"));
- builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText);
- var blockBreak = renderMode === "richText" ? "\n\n" : "<br/>";
- var allMarkupText = markupTextArrLegacy.join(blockBreak);
- this._showOrMove(singleTooltipModel, function() {
- if (this._updateContentNotChangedOnAxis(dataByCoordSys, cbParamsList)) {
- this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList);
- } else {
- this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + "", point[0], point[1], positionExpr, null, markupStyleCreator);
- }
- });
- };
- TooltipView2.prototype._showSeriesItemTooltip = function(e, dispatcher, dispatchAction3) {
- var ecModel = this._ecModel;
- var ecData = getECData(dispatcher);
- var seriesIndex = ecData.seriesIndex;
- var seriesModel = ecModel.getSeriesByIndex(seriesIndex);
- var dataModel = ecData.dataModel || seriesModel;
- var dataIndex = ecData.dataIndex;
- var dataType = ecData.dataType;
- var data = dataModel.getData(dataType);
- var renderMode = this._renderMode;
- var positionDefault = e.positionDefault;
- var tooltipModel = buildTooltipModel([data.getItemModel(dataIndex), dataModel, seriesModel && (seriesModel.coordinateSystem || {}).model], this._tooltipModel, positionDefault ? {
- position: positionDefault
- } : null);
- var tooltipTrigger = tooltipModel.get("trigger");
- if (tooltipTrigger != null && tooltipTrigger !== "item") {
- return;
- }
- var params = dataModel.getDataParams(dataIndex, dataType);
- var markupStyleCreator = new TooltipMarkupStyleCreator();
- params.marker = markupStyleCreator.makeTooltipMarker("item", convertToColorString(params.color), renderMode);
- var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType));
- var orderMode = tooltipModel.get("order");
- var valueFormatter = tooltipModel.get("valueFormatter");
- var frag = seriesTooltipResult.frag;
- var markupText = frag ? buildTooltipMarkup(valueFormatter ? extend({
- valueFormatter
- }, frag) : frag, markupStyleCreator, renderMode, orderMode, ecModel.get("useUTC"), tooltipModel.get("textStyle")) : seriesTooltipResult.text;
- var asyncTicket = "item_" + dataModel.name + "_" + dataIndex;
- this._showOrMove(tooltipModel, function() {
- this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator);
- });
- dispatchAction3({
- type: "showTip",
- dataIndexInside: dataIndex,
- dataIndex: data.getRawIndex(dataIndex),
- seriesIndex,
- from: this.uid
- });
- };
- TooltipView2.prototype._showComponentItemTooltip = function(e, el, dispatchAction3) {
- var ecData = getECData(el);
- var tooltipConfig = ecData.tooltipConfig;
- var tooltipOpt = tooltipConfig.option || {};
- if (isString(tooltipOpt)) {
- var content = tooltipOpt;
- tooltipOpt = {
- content,
- formatter: content
- };
- }
- var tooltipModelCascade = [tooltipOpt];
- var cmpt = this._ecModel.getComponent(ecData.componentMainType, ecData.componentIndex);
- if (cmpt) {
- tooltipModelCascade.push(cmpt);
- }
- tooltipModelCascade.push({
- formatter: tooltipOpt.content
- });
- var positionDefault = e.positionDefault;
- var subTooltipModel = buildTooltipModel(tooltipModelCascade, this._tooltipModel, positionDefault ? {
- position: positionDefault
- } : null);
- var defaultHtml = subTooltipModel.get("content");
- var asyncTicket = Math.random() + "";
- var markupStyleCreator = new TooltipMarkupStyleCreator();
- this._showOrMove(subTooltipModel, function() {
- var formatterParams = clone(subTooltipModel.get("formatterParams") || {});
- this._showTooltipContent(subTooltipModel, defaultHtml, formatterParams, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator);
- });
- dispatchAction3({
- type: "showTip",
- from: this.uid
- });
- };
- TooltipView2.prototype._showTooltipContent = function(tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) {
- this._ticket = "";
- if (!tooltipModel.get("showContent") || !tooltipModel.get("show")) {
- return;
- }
- var tooltipContent = this._tooltipContent;
- tooltipContent.setEnterable(tooltipModel.get("enterable"));
- var formatter = tooltipModel.get("formatter");
- positionExpr = positionExpr || tooltipModel.get("position");
- var html = defaultHtml;
- var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get("trigger"), tooltipModel.get("borderColor"));
- var nearPointColor = nearPoint.color;
- if (formatter) {
- if (isString(formatter)) {
- var useUTC = tooltipModel.ecModel.get("useUTC");
- var params0 = isArray(params) ? params[0] : params;
- var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf("time") >= 0;
- html = formatter;
- if (isTimeAxis) {
- html = format(params0.axisValue, html, useUTC);
- }
- html = formatTpl(html, params, true);
- } else if (isFunction(formatter)) {
- var callback = bind(function(cbTicket, html2) {
- if (cbTicket === this._ticket) {
- tooltipContent.setContent(html2, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);
- this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);
- }
- }, this);
- this._ticket = asyncTicket;
- html = formatter(params, asyncTicket, callback);
- } else {
- html = formatter;
- }
- }
- tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);
- tooltipContent.show(tooltipModel, nearPointColor);
- this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);
- };
- TooltipView2.prototype._getNearestPoint = function(point, tooltipDataParams, trigger, borderColor) {
- if (trigger === "axis" || isArray(tooltipDataParams)) {
- return {
- color: borderColor || (this._renderMode === "html" ? "#fff" : "none")
- };
- }
- if (!isArray(tooltipDataParams)) {
- return {
- color: borderColor || tooltipDataParams.color || tooltipDataParams.borderColor
- };
- }
- };
- TooltipView2.prototype._updatePosition = function(tooltipModel, positionExpr, x, y, content, params, el) {
- var viewWidth = this._api.getWidth();
- var viewHeight = this._api.getHeight();
- positionExpr = positionExpr || tooltipModel.get("position");
- var contentSize = content.getSize();
- var align = tooltipModel.get("align");
- var vAlign = tooltipModel.get("verticalAlign");
- var rect = el && el.getBoundingRect().clone();
- el && rect.applyTransform(el.transform);
- if (isFunction(positionExpr)) {
- positionExpr = positionExpr([x, y], params, content.el, rect, {
- viewSize: [viewWidth, viewHeight],
- contentSize: contentSize.slice()
- });
- }
- if (isArray(positionExpr)) {
- x = parsePercent2(positionExpr[0], viewWidth);
- y = parsePercent2(positionExpr[1], viewHeight);
- } else if (isObject(positionExpr)) {
- var boxLayoutPosition = positionExpr;
- boxLayoutPosition.width = contentSize[0];
- boxLayoutPosition.height = contentSize[1];
- var layoutRect = getLayoutRect(boxLayoutPosition, {
- width: viewWidth,
- height: viewHeight
- });
- x = layoutRect.x;
- y = layoutRect.y;
- align = null;
- vAlign = null;
- } else if (isString(positionExpr) && el) {
- var pos = calcTooltipPosition(positionExpr, rect, contentSize, tooltipModel.get("borderWidth"));
- x = pos[0];
- y = pos[1];
- } else {
- var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20);
- x = pos[0];
- y = pos[1];
- }
- align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === "right" ? contentSize[0] : 0);
- vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === "bottom" ? contentSize[1] : 0);
- if (shouldTooltipConfine(tooltipModel)) {
- var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight);
- x = pos[0];
- y = pos[1];
- }
- content.moveTo(x, y);
- };
- TooltipView2.prototype._updateContentNotChangedOnAxis = function(dataByCoordSys, cbParamsList) {
- var lastCoordSys = this._lastDataByCoordSys;
- var lastCbParamsList = this._cbParamsList;
- var contentNotChanged = !!lastCoordSys && lastCoordSys.length === dataByCoordSys.length;
- contentNotChanged && each(lastCoordSys, function(lastItemCoordSys, indexCoordSys) {
- var lastDataByAxis = lastItemCoordSys.dataByAxis || [];
- var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {};
- var thisDataByAxis = thisItemCoordSys.dataByAxis || [];
- contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length;
- contentNotChanged && each(lastDataByAxis, function(lastItem, indexAxis) {
- var thisItem = thisDataByAxis[indexAxis] || {};
- var lastIndices = lastItem.seriesDataIndices || [];
- var newIndices = thisItem.seriesDataIndices || [];
- contentNotChanged = contentNotChanged && lastItem.value === thisItem.value && lastItem.axisType === thisItem.axisType && lastItem.axisId === thisItem.axisId && lastIndices.length === newIndices.length;
- contentNotChanged && each(lastIndices, function(lastIdxItem, j) {
- var newIdxItem = newIndices[j];
- contentNotChanged = contentNotChanged && lastIdxItem.seriesIndex === newIdxItem.seriesIndex && lastIdxItem.dataIndex === newIdxItem.dataIndex;
- });
- lastCbParamsList && each(lastItem.seriesDataIndices, function(idxItem) {
- var seriesIdx = idxItem.seriesIndex;
- var cbParams = cbParamsList[seriesIdx];
- var lastCbParams = lastCbParamsList[seriesIdx];
- if (cbParams && lastCbParams && lastCbParams.data !== cbParams.data) {
- contentNotChanged = false;
- }
- });
- });
- });
- this._lastDataByCoordSys = dataByCoordSys;
- this._cbParamsList = cbParamsList;
- return !!contentNotChanged;
- };
- TooltipView2.prototype._hide = function(dispatchAction3) {
- this._lastDataByCoordSys = null;
- dispatchAction3({
- type: "hideTip",
- from: this.uid
- });
- };
- TooltipView2.prototype.dispose = function(ecModel, api) {
- if (env_default.node || !api.getDom()) {
- return;
- }
- clear(this, "_updatePosition");
- this._tooltipContent.dispose();
- unregister("itemTooltip", api);
- };
- TooltipView2.type = "tooltip";
- return TooltipView2;
- }(Component_default2);
- function buildTooltipModel(modelCascade, globalTooltipModel, defaultTooltipOption) {
- var ecModel = globalTooltipModel.ecModel;
- var resultModel;
- if (defaultTooltipOption) {
- resultModel = new Model_default(defaultTooltipOption, ecModel, ecModel);
- resultModel = new Model_default(globalTooltipModel.option, resultModel, ecModel);
- } else {
- resultModel = globalTooltipModel;
- }
- for (var i = modelCascade.length - 1; i >= 0; i--) {
- var tooltipOpt = modelCascade[i];
- if (tooltipOpt) {
- if (tooltipOpt instanceof Model_default) {
- tooltipOpt = tooltipOpt.get("tooltip", true);
- }
- if (isString(tooltipOpt)) {
- tooltipOpt = {
- formatter: tooltipOpt
- };
- }
- if (tooltipOpt) {
- resultModel = new Model_default(tooltipOpt, resultModel, ecModel);
- }
- }
- }
- return resultModel;
- }
- function makeDispatchAction2(payload, api) {
- return payload.dispatchAction || bind(api.dispatchAction, api);
- }
- function refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) {
- var size = content.getSize();
- var width = size[0];
- var height = size[1];
- if (gapH != null) {
- if (x + width + gapH + 2 > viewWidth) {
- x -= width + gapH;
- } else {
- x += gapH;
- }
- }
- if (gapV != null) {
- if (y + height + gapV > viewHeight) {
- y -= height + gapV;
- } else {
- y += gapV;
- }
- }
- return [x, y];
- }
- function confineTooltipPosition(x, y, content, viewWidth, viewHeight) {
- var size = content.getSize();
- var width = size[0];
- var height = size[1];
- x = Math.min(x + width, viewWidth) - width;
- y = Math.min(y + height, viewHeight) - height;
- x = Math.max(x, 0);
- y = Math.max(y, 0);
- return [x, y];
- }
- function calcTooltipPosition(position, rect, contentSize, borderWidth) {
- var domWidth = contentSize[0];
- var domHeight = contentSize[1];
- var offset = Math.ceil(Math.SQRT2 * borderWidth) + 8;
- var x = 0;
- var y = 0;
- var rectWidth = rect.width;
- var rectHeight = rect.height;
- switch (position) {
- case "inside":
- x = rect.x + rectWidth / 2 - domWidth / 2;
- y = rect.y + rectHeight / 2 - domHeight / 2;
- break;
- case "top":
- x = rect.x + rectWidth / 2 - domWidth / 2;
- y = rect.y - domHeight - offset;
- break;
- case "bottom":
- x = rect.x + rectWidth / 2 - domWidth / 2;
- y = rect.y + rectHeight + offset;
- break;
- case "left":
- x = rect.x - domWidth - offset;
- y = rect.y + rectHeight / 2 - domHeight / 2;
- break;
- case "right":
- x = rect.x + rectWidth + offset;
- y = rect.y + rectHeight / 2 - domHeight / 2;
- }
- return [x, y];
- }
- function isCenterAlign(align) {
- return align === "center" || align === "middle";
- }
- function findComponentReference(payload, ecModel, api) {
- var queryOptionMap = preParseFinder(payload).queryOptionMap;
- var componentMainType = queryOptionMap.keys()[0];
- if (!componentMainType || componentMainType === "series") {
- return;
- }
- var queryResult = queryReferringComponents(ecModel, componentMainType, queryOptionMap.get(componentMainType), {
- useDefault: false,
- enableAll: false,
- enableNone: false
- });
- var model = queryResult.models[0];
- if (!model) {
- return;
- }
- var view = api.getViewOfComponentModel(model);
- var el;
- view.group.traverse(function(subEl) {
- var tooltipConfig = getECData(subEl).tooltipConfig;
- if (tooltipConfig && tooltipConfig.name === payload.name) {
- el = subEl;
- return true;
- }
- });
- if (el) {
- return {
- componentMainType,
- componentIndex: model.componentIndex,
- el
- };
- }
- }
- var TooltipView_default = TooltipView;
- // node_modules/echarts/lib/component/tooltip/install.js
- function install13(registers) {
- use(install5);
- registers.registerComponentModel(TooltipModel_default);
- registers.registerComponentView(TooltipView_default);
- registers.registerAction({
- type: "showTip",
- event: "showTip",
- update: "tooltip:manuallyShowTip"
- }, noop);
- registers.registerAction({
- type: "hideTip",
- event: "hideTip",
- update: "tooltip:manuallyHideTip"
- }, noop);
- }
- // node_modules/echarts/lib/component/brush/install.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/brush/preprocessor.js
- init_define_APP_INFO();
- var DEFAULT_TOOLBOX_BTNS = ["rect", "polygon", "keep", "clear"];
- function brushPreprocessor(option, isNew) {
- var brushComponents = normalizeToArray(option ? option.brush : []);
- if (!brushComponents.length) {
- return;
- }
- var brushComponentSpecifiedBtns = [];
- each(brushComponents, function(brushOpt) {
- var tbs = brushOpt.hasOwnProperty("toolbox") ? brushOpt.toolbox : [];
- if (tbs instanceof Array) {
- brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs);
- }
- });
- var toolbox = option && option.toolbox;
- if (isArray(toolbox)) {
- toolbox = toolbox[0];
- }
- if (!toolbox) {
- toolbox = {
- feature: {}
- };
- option.toolbox = [toolbox];
- }
- var toolboxFeature = toolbox.feature || (toolbox.feature = {});
- var toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {});
- var brushTypes = toolboxBrush.type || (toolboxBrush.type = []);
- brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns);
- removeDuplicate(brushTypes);
- if (isNew && !brushTypes.length) {
- brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS);
- }
- }
- function removeDuplicate(arr) {
- var map2 = {};
- each(arr, function(val) {
- map2[val] = 1;
- });
- arr.length = 0;
- each(map2, function(flag, val) {
- arr.push(val);
- });
- }
- // node_modules/echarts/lib/component/brush/BrushView.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/brush/visualEncoding.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/visual/visualSolution.js
- init_define_APP_INFO();
- var each6 = each;
- function hasKeys(obj) {
- if (obj) {
- for (var name_1 in obj) {
- if (obj.hasOwnProperty(name_1)) {
- return true;
- }
- }
- }
- }
- function createVisualMappings(option, stateList, supplementVisualOption) {
- var visualMappings = {};
- each6(stateList, function(state) {
- var mappings = visualMappings[state] = createMappings();
- each6(option[state], function(visualData, visualType) {
- if (!VisualMapping_default.isValidType(visualType)) {
- return;
- }
- var mappingOption = {
- type: visualType,
- visual: visualData
- };
- supplementVisualOption && supplementVisualOption(mappingOption, state);
- mappings[visualType] = new VisualMapping_default(mappingOption);
- if (visualType === "opacity") {
- mappingOption = clone(mappingOption);
- mappingOption.type = "colorAlpha";
- mappings.__hidden.__alphaForOpacity = new VisualMapping_default(mappingOption);
- }
- });
- });
- return visualMappings;
- function createMappings() {
- var Creater = function() {
- };
- Creater.prototype.__hidden = Creater.prototype;
- var obj = new Creater();
- return obj;
- }
- }
- function replaceVisualOption(thisOption, newOption, keys2) {
- var has3;
- each(keys2, function(key) {
- if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {
- has3 = true;
- }
- });
- has3 && each(keys2, function(key) {
- if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {
- thisOption[key] = clone(newOption[key]);
- } else {
- delete thisOption[key];
- }
- });
- }
- function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) {
- var visualTypesMap = {};
- each(stateList, function(state) {
- var visualTypes = VisualMapping_default.prepareVisualTypes(visualMappings[state]);
- visualTypesMap[state] = visualTypes;
- });
- var dataIndex;
- function getVisual(key) {
- return getItemVisualFromData(data, dataIndex, key);
- }
- function setVisual(key, value) {
- setItemVisualFromData(data, dataIndex, key, value);
- }
- if (dimension == null) {
- data.each(eachItem);
- } else {
- data.each([dimension], eachItem);
- }
- function eachItem(valueOrIndex, index) {
- dataIndex = dimension == null ? valueOrIndex : index;
- var rawDataItem = data.getRawDataItem(dataIndex);
- if (rawDataItem && rawDataItem.visualMap === false) {
- return;
- }
- var valueState = getValueState.call(scope, valueOrIndex);
- var mappings = visualMappings[valueState];
- var visualTypes = visualTypesMap[valueState];
- for (var i = 0, len = visualTypes.length; i < len; i++) {
- var type = visualTypes[i];
- mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual);
- }
- }
- }
- function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) {
- var visualTypesMap = {};
- each(stateList, function(state) {
- var visualTypes = VisualMapping_default.prepareVisualTypes(visualMappings[state]);
- visualTypesMap[state] = visualTypes;
- });
- return {
- progress: function progress(params, data) {
- var dimIndex;
- if (dim != null) {
- dimIndex = data.getDimensionIndex(dim);
- }
- function getVisual(key) {
- return getItemVisualFromData(data, dataIndex, key);
- }
- function setVisual(key, value2) {
- setItemVisualFromData(data, dataIndex, key, value2);
- }
- var dataIndex;
- var store = data.getStore();
- while ((dataIndex = params.next()) != null) {
- var rawDataItem = data.getRawDataItem(dataIndex);
- if (rawDataItem && rawDataItem.visualMap === false) {
- continue;
- }
- var value = dim != null ? store.get(dimIndex, dataIndex) : dataIndex;
- var valueState = getValueState(value);
- var mappings = visualMappings[valueState];
- var visualTypes = visualTypesMap[valueState];
- for (var i = 0, len = visualTypes.length; i < len; i++) {
- var type = visualTypes[i];
- mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual);
- }
- }
- }
- };
- }
- // node_modules/echarts/lib/component/brush/selector.js
- init_define_APP_INFO();
- function makeBrushCommonSelectorForSeries(area) {
- var brushType = area.brushType;
- var selectors = {
- point: function(itemLayout) {
- return selector[brushType].point(itemLayout, selectors, area);
- },
- rect: function(itemLayout) {
- return selector[brushType].rect(itemLayout, selectors, area);
- }
- };
- return selectors;
- }
- var selector = {
- lineX: getLineSelectors(0),
- lineY: getLineSelectors(1),
- rect: {
- point: function(itemLayout, selectors, area) {
- return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);
- },
- rect: function(itemLayout, selectors, area) {
- return itemLayout && area.boundingRect.intersect(itemLayout);
- }
- },
- polygon: {
- point: function(itemLayout, selectors, area) {
- return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]) && contain(area.range, itemLayout[0], itemLayout[1]);
- },
- rect: function(itemLayout, selectors, area) {
- var points = area.range;
- if (!itemLayout || points.length <= 1) {
- return false;
- }
- var x = itemLayout.x;
- var y = itemLayout.y;
- var width = itemLayout.width;
- var height = itemLayout.height;
- var p = points[0];
- 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)) {
- return true;
- }
- }
- }
- };
- function getLineSelectors(xyIndex) {
- var xy = ["x", "y"];
- var wh = ["width", "height"];
- return {
- point: function(itemLayout, selectors, area) {
- if (itemLayout) {
- var range = area.range;
- var p = itemLayout[xyIndex];
- return inLineRange(p, range);
- }
- },
- rect: function(itemLayout, selectors, area) {
- if (itemLayout) {
- var range = area.range;
- var layoutRange = [itemLayout[xy[xyIndex]], itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]];
- layoutRange[1] < layoutRange[0] && layoutRange.reverse();
- return inLineRange(layoutRange[0], range) || inLineRange(layoutRange[1], range) || inLineRange(range[0], layoutRange) || inLineRange(range[1], layoutRange);
- }
- }
- };
- }
- function inLineRange(p, range) {
- return range[0] <= p && p <= range[1];
- }
- // node_modules/echarts/lib/component/brush/visualEncoding.js
- var STATE_LIST = ["inBrush", "outOfBrush"];
- var DISPATCH_METHOD = "__ecBrushSelect";
- var DISPATCH_FLAG = "__ecInBrushSelectEvent";
- function layoutCovers(ecModel) {
- ecModel.eachComponent({
- mainType: "brush"
- }, function(brushModel) {
- var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager_default(brushModel.option, ecModel);
- brushTargetManager.setInputRanges(brushModel.areas, ecModel);
- });
- }
- function brushVisual(ecModel, api, payload) {
- var brushSelected = [];
- var throttleType;
- var throttleDelay;
- ecModel.eachComponent({
- mainType: "brush"
- }, function(brushModel) {
- payload && payload.type === "takeGlobalCursor" && brushModel.setBrushOption(payload.key === "brush" ? payload.brushOption : {
- brushType: false
- });
- });
- layoutCovers(ecModel);
- ecModel.eachComponent({
- mainType: "brush"
- }, function(brushModel, brushIndex) {
- var thisBrushSelected = {
- brushId: brushModel.id,
- brushIndex,
- brushName: brushModel.name,
- areas: clone(brushModel.areas),
- selected: []
- };
- brushSelected.push(thisBrushSelected);
- var brushOption = brushModel.option;
- var brushLink = brushOption.brushLink;
- var linkedSeriesMap = [];
- var selectedDataIndexForLink = [];
- var rangeInfoBySeries = [];
- var hasBrushExists = false;
- if (!brushIndex) {
- throttleType = brushOption.throttleType;
- throttleDelay = brushOption.throttleDelay;
- }
- var areas = map(brushModel.areas, function(area) {
- var builder = boundingRectBuilders[area.brushType];
- var selectableArea = defaults({
- boundingRect: builder ? builder(area) : void 0
- }, area);
- selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea);
- return selectableArea;
- });
- var visualMappings = createVisualMappings(brushModel.option, STATE_LIST, function(mappingOption) {
- mappingOption.mappingMethod = "fixed";
- });
- isArray(brushLink) && each(brushLink, function(seriesIndex) {
- linkedSeriesMap[seriesIndex] = 1;
- });
- function linkOthers(seriesIndex) {
- return brushLink === "all" || !!linkedSeriesMap[seriesIndex];
- }
- function brushed(rangeInfoList) {
- return !!rangeInfoList.length;
- }
- ecModel.eachSeries(function(seriesModel, seriesIndex) {
- var rangeInfoList = rangeInfoBySeries[seriesIndex] = [];
- seriesModel.subType === "parallel" ? stepAParallel(seriesModel, seriesIndex) : stepAOthers(seriesModel, seriesIndex, rangeInfoList);
- });
- function stepAParallel(seriesModel, seriesIndex) {
- var coordSys = seriesModel.coordinateSystem;
- hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed();
- linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function(activeState, dataIndex) {
- activeState === "active" && (selectedDataIndexForLink[dataIndex] = 1);
- });
- }
- function stepAOthers(seriesModel, seriesIndex, rangeInfoList) {
- if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) {
- return;
- }
- each(areas, function(area) {
- if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) {
- rangeInfoList.push(area);
- }
- hasBrushExists = hasBrushExists || brushed(rangeInfoList);
- });
- if (linkOthers(seriesIndex) && brushed(rangeInfoList)) {
- var data_1 = seriesModel.getData();
- data_1.each(function(dataIndex) {
- if (checkInRange(seriesModel, rangeInfoList, data_1, dataIndex)) {
- selectedDataIndexForLink[dataIndex] = 1;
- }
- });
- }
- }
- ecModel.eachSeries(function(seriesModel, seriesIndex) {
- var seriesBrushSelected = {
- seriesId: seriesModel.id,
- seriesIndex,
- seriesName: seriesModel.name,
- dataIndex: []
- };
- thisBrushSelected.selected.push(seriesBrushSelected);
- var rangeInfoList = rangeInfoBySeries[seriesIndex];
- var data = seriesModel.getData();
- var getValueState = linkOthers(seriesIndex) ? function(dataIndex) {
- return selectedDataIndexForLink[dataIndex] ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), "inBrush") : "outOfBrush";
- } : function(dataIndex) {
- return checkInRange(seriesModel, rangeInfoList, data, dataIndex) ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), "inBrush") : "outOfBrush";
- };
- (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) && applyVisual(STATE_LIST, visualMappings, data, getValueState);
- });
- });
- dispatchAction(api, throttleType, throttleDelay, brushSelected, payload);
- }
- function dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) {
- if (!payload) {
- return;
- }
- var zr = api.getZr();
- if (zr[DISPATCH_FLAG]) {
- return;
- }
- if (!zr[DISPATCH_METHOD]) {
- zr[DISPATCH_METHOD] = doDispatch;
- }
- var fn = createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType);
- fn(api, brushSelected);
- }
- function doDispatch(api, brushSelected) {
- if (!api.isDisposed()) {
- var zr = api.getZr();
- zr[DISPATCH_FLAG] = true;
- api.dispatchAction({
- type: "brushSelect",
- batch: brushSelected
- });
- zr[DISPATCH_FLAG] = false;
- }
- }
- function checkInRange(seriesModel, rangeInfoList, data, dataIndex) {
- for (var i = 0, len = rangeInfoList.length; i < len; i++) {
- var area = rangeInfoList[i];
- if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) {
- return true;
- }
- }
- }
- function brushModelNotControll(brushModel, seriesIndex) {
- var seriesIndices = brushModel.option.seriesIndex;
- return seriesIndices != null && seriesIndices !== "all" && (isArray(seriesIndices) ? indexOf(seriesIndices, seriesIndex) < 0 : seriesIndex !== seriesIndices);
- }
- var boundingRectBuilders = {
- rect: function(area) {
- return getBoundingRectFromMinMax(area.range);
- },
- polygon: function(area) {
- var minMax;
- var range = area.range;
- for (var i = 0, len = range.length; i < len; i++) {
- minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]];
- var rg = range[i];
- rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]);
- rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]);
- rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]);
- rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]);
- }
- return minMax && getBoundingRectFromMinMax(minMax);
- }
- };
- function getBoundingRectFromMinMax(minMax) {
- return new BoundingRect_default(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]);
- }
- // node_modules/echarts/lib/component/brush/BrushView.js
- var BrushView = function(_super) {
- __extends(BrushView2, _super);
- function BrushView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = BrushView2.type;
- return _this;
- }
- BrushView2.prototype.init = function(ecModel, api) {
- this.ecModel = ecModel;
- this.api = api;
- this.model;
- (this._brushController = new BrushController_default(api.getZr())).on("brush", bind(this._onBrush, this)).mount();
- };
- BrushView2.prototype.render = function(brushModel, ecModel, api, payload) {
- this.model = brushModel;
- this._updateController(brushModel, ecModel, api, payload);
- };
- BrushView2.prototype.updateTransform = function(brushModel, ecModel, api, payload) {
- layoutCovers(ecModel);
- this._updateController(brushModel, ecModel, api, payload);
- };
- BrushView2.prototype.updateVisual = function(brushModel, ecModel, api, payload) {
- this.updateTransform(brushModel, ecModel, api, payload);
- };
- BrushView2.prototype.updateView = function(brushModel, ecModel, api, payload) {
- this._updateController(brushModel, ecModel, api, payload);
- };
- BrushView2.prototype._updateController = function(brushModel, ecModel, api, payload) {
- (!payload || payload.$from !== brushModel.id) && this._brushController.setPanels(brushModel.brushTargetManager.makePanelOpts(api)).enableBrush(brushModel.brushOption).updateCovers(brushModel.areas.slice());
- };
- BrushView2.prototype.dispose = function() {
- this._brushController.dispose();
- };
- BrushView2.prototype._onBrush = function(eventParam) {
- var modelId = this.model.id;
- var areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel);
- (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({
- type: "brush",
- brushId: modelId,
- areas: clone(areas),
- $from: modelId
- });
- eventParam.isEnd && this.api.dispatchAction({
- type: "brushEnd",
- brushId: modelId,
- areas: clone(areas),
- $from: modelId
- });
- };
- BrushView2.type = "brush";
- return BrushView2;
- }(Component_default2);
- var BrushView_default = BrushView;
- // node_modules/echarts/lib/component/brush/BrushModel.js
- init_define_APP_INFO();
- var DEFAULT_OUT_OF_BRUSH_COLOR = "#ddd";
- var BrushModel = function(_super) {
- __extends(BrushModel2, _super);
- function BrushModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = BrushModel2.type;
- _this.areas = [];
- _this.brushOption = {};
- return _this;
- }
- BrushModel2.prototype.optionUpdated = function(newOption, isInit) {
- var thisOption = this.option;
- !isInit && replaceVisualOption(thisOption, newOption, ["inBrush", "outOfBrush"]);
- var inBrush = thisOption.inBrush = thisOption.inBrush || {};
- thisOption.outOfBrush = thisOption.outOfBrush || {
- color: DEFAULT_OUT_OF_BRUSH_COLOR
- };
- if (!inBrush.hasOwnProperty("liftZ")) {
- inBrush.liftZ = 5;
- }
- };
- BrushModel2.prototype.setAreas = function(areas) {
- if (true) {
- assert(isArray(areas));
- each(areas, function(area) {
- assert(area.brushType, "Illegal areas");
- });
- }
- if (!areas) {
- return;
- }
- this.areas = map(areas, function(area) {
- return generateBrushOption(this.option, area);
- }, this);
- };
- BrushModel2.prototype.setBrushOption = function(brushOption) {
- this.brushOption = generateBrushOption(this.option, brushOption);
- this.brushType = this.brushOption.brushType;
- };
- BrushModel2.type = "brush";
- BrushModel2.dependencies = ["geo", "grid", "xAxis", "yAxis", "parallel", "series"];
- BrushModel2.defaultOption = {
- seriesIndex: "all",
- brushType: "rect",
- brushMode: "single",
- transformable: true,
- brushStyle: {
- borderWidth: 1,
- color: "rgba(210,219,238,0.3)",
- borderColor: "#D2DBEE"
- },
- throttleType: "fixRate",
- throttleDelay: 0,
- removeOnClick: true,
- z: 1e4
- };
- return BrushModel2;
- }(Component_default);
- function generateBrushOption(option, brushOption) {
- return merge({
- brushType: option.brushType,
- brushMode: option.brushMode,
- transformable: option.transformable,
- brushStyle: new Model_default(option.brushStyle).getItemStyle(),
- removeOnClick: option.removeOnClick,
- z: option.z
- }, brushOption, true);
- }
- var BrushModel_default = BrushModel;
- // node_modules/echarts/lib/component/toolbox/feature/Brush.js
- init_define_APP_INFO();
- var ICON_TYPES = ["rect", "polygon", "lineX", "lineY", "keep", "clear"];
- var BrushFeature = function(_super) {
- __extends(BrushFeature2, _super);
- function BrushFeature2() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- BrushFeature2.prototype.render = function(featureModel, ecModel, api) {
- var brushType;
- var brushMode;
- var isBrushed;
- ecModel.eachComponent({
- mainType: "brush"
- }, function(brushModel) {
- brushType = brushModel.brushType;
- brushMode = brushModel.brushOption.brushMode || "single";
- isBrushed = isBrushed || !!brushModel.areas.length;
- });
- this._brushType = brushType;
- this._brushMode = brushMode;
- each(featureModel.get("type", true), function(type) {
- featureModel.setIconStatus(type, (type === "keep" ? brushMode === "multiple" : type === "clear" ? isBrushed : type === brushType) ? "emphasis" : "normal");
- });
- };
- BrushFeature2.prototype.updateView = function(featureModel, ecModel, api) {
- this.render(featureModel, ecModel, api);
- };
- BrushFeature2.prototype.getIcons = function() {
- var model = this.model;
- var availableIcons = model.get("icon", true);
- var icons = {};
- each(model.get("type", true), function(type) {
- if (availableIcons[type]) {
- icons[type] = availableIcons[type];
- }
- });
- return icons;
- };
- ;
- BrushFeature2.prototype.onclick = function(ecModel, api, type) {
- var brushType = this._brushType;
- var brushMode = this._brushMode;
- if (type === "clear") {
- api.dispatchAction({
- type: "axisAreaSelect",
- intervals: []
- });
- api.dispatchAction({
- type: "brush",
- command: "clear",
- areas: []
- });
- } else {
- api.dispatchAction({
- type: "takeGlobalCursor",
- key: "brush",
- brushOption: {
- brushType: type === "keep" ? brushType : brushType === type ? false : type,
- brushMode: type === "keep" ? brushMode === "multiple" ? "single" : "multiple" : brushMode
- }
- });
- }
- };
- ;
- BrushFeature2.getDefaultOption = function(ecModel) {
- var defaultOption2 = {
- show: true,
- type: ICON_TYPES.slice(),
- icon: {
- rect: "M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",
- polygon: "M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",
- lineX: "M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",
- lineY: "M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",
- keep: "M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",
- clear: "M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"
- },
- title: ecModel.getLocaleModel().get(["toolbox", "brush", "title"])
- };
- return defaultOption2;
- };
- return BrushFeature2;
- }(ToolboxFeature);
- var Brush_default = BrushFeature;
- // node_modules/echarts/lib/component/brush/install.js
- function install14(registers) {
- registers.registerComponentView(BrushView_default);
- registers.registerComponentModel(BrushModel_default);
- registers.registerPreprocessor(brushPreprocessor);
- registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, brushVisual);
- registers.registerAction({
- type: "brush",
- event: "brush",
- update: "updateVisual"
- }, function(payload, ecModel) {
- ecModel.eachComponent({
- mainType: "brush",
- query: payload
- }, function(brushModel) {
- brushModel.setAreas(payload.areas);
- });
- });
- registers.registerAction({
- type: "brushSelect",
- event: "brushSelected",
- update: "none"
- }, noop);
- registers.registerAction({
- type: "brushEnd",
- event: "brushEnd",
- update: "none"
- }, noop);
- registerFeature("brush", Brush_default);
- }
- // node_modules/echarts/lib/component/title/install.js
- init_define_APP_INFO();
- var TitleModel = function(_super) {
- __extends(TitleModel2, _super);
- function TitleModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = TitleModel2.type;
- _this.layoutMode = {
- type: "box",
- ignoreSize: true
- };
- return _this;
- }
- TitleModel2.type = "title";
- TitleModel2.defaultOption = {
- z: 6,
- show: true,
- text: "",
- target: "blank",
- subtext: "",
- subtarget: "blank",
- left: 0,
- top: 0,
- backgroundColor: "rgba(0,0,0,0)",
- borderColor: "#ccc",
- borderWidth: 0,
- padding: 5,
- itemGap: 10,
- textStyle: {
- fontSize: 18,
- fontWeight: "bold",
- color: "#464646"
- },
- subtextStyle: {
- fontSize: 12,
- color: "#6E7079"
- }
- };
- return TitleModel2;
- }(Component_default);
- var TitleView = function(_super) {
- __extends(TitleView2, _super);
- function TitleView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = TitleView2.type;
- return _this;
- }
- TitleView2.prototype.render = function(titleModel, ecModel, api) {
- this.group.removeAll();
- if (!titleModel.get("show")) {
- return;
- }
- var group = this.group;
- var textStyleModel = titleModel.getModel("textStyle");
- var subtextStyleModel = titleModel.getModel("subtextStyle");
- var textAlign = titleModel.get("textAlign");
- var textVerticalAlign = retrieve2(titleModel.get("textBaseline"), titleModel.get("textVerticalAlign"));
- var textEl = new Text_default({
- style: createTextStyle(textStyleModel, {
- text: titleModel.get("text"),
- fill: textStyleModel.getTextColor()
- }, {
- disableBox: true
- }),
- z2: 10
- });
- var textRect = textEl.getBoundingRect();
- var subText = titleModel.get("subtext");
- var subTextEl = new Text_default({
- style: createTextStyle(subtextStyleModel, {
- text: subText,
- fill: subtextStyleModel.getTextColor(),
- y: textRect.height + titleModel.get("itemGap"),
- verticalAlign: "top"
- }, {
- disableBox: true
- }),
- z2: 10
- });
- var link = titleModel.get("link");
- var sublink = titleModel.get("sublink");
- var triggerEvent = titleModel.get("triggerEvent", true);
- textEl.silent = !link && !triggerEvent;
- subTextEl.silent = !sublink && !triggerEvent;
- if (link) {
- textEl.on("click", function() {
- windowOpen(link, "_" + titleModel.get("target"));
- });
- }
- if (sublink) {
- subTextEl.on("click", function() {
- windowOpen(sublink, "_" + titleModel.get("subtarget"));
- });
- }
- getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent ? {
- componentType: "title",
- componentIndex: titleModel.componentIndex
- } : null;
- group.add(textEl);
- subText && group.add(subTextEl);
- var groupRect = group.getBoundingRect();
- var layoutOption = titleModel.getBoxLayoutParams();
- layoutOption.width = groupRect.width;
- layoutOption.height = groupRect.height;
- var layoutRect = getLayoutRect(layoutOption, {
- width: api.getWidth(),
- height: api.getHeight()
- }, titleModel.get("padding"));
- if (!textAlign) {
- textAlign = titleModel.get("left") || titleModel.get("right");
- if (textAlign === "middle") {
- textAlign = "center";
- }
- if (textAlign === "right") {
- layoutRect.x += layoutRect.width;
- } else if (textAlign === "center") {
- layoutRect.x += layoutRect.width / 2;
- }
- }
- if (!textVerticalAlign) {
- textVerticalAlign = titleModel.get("top") || titleModel.get("bottom");
- if (textVerticalAlign === "center") {
- textVerticalAlign = "middle";
- }
- if (textVerticalAlign === "bottom") {
- layoutRect.y += layoutRect.height;
- } else if (textVerticalAlign === "middle") {
- layoutRect.y += layoutRect.height / 2;
- }
- textVerticalAlign = textVerticalAlign || "top";
- }
- group.x = layoutRect.x;
- group.y = layoutRect.y;
- group.markRedraw();
- var alignStyle = {
- align: textAlign,
- verticalAlign: textVerticalAlign
- };
- textEl.setStyle(alignStyle);
- subTextEl.setStyle(alignStyle);
- groupRect = group.getBoundingRect();
- var padding = layoutRect.margin;
- var style = titleModel.getItemStyle(["color", "opacity"]);
- style.fill = titleModel.get("backgroundColor");
- var rect = new Rect_default({
- shape: {
- x: groupRect.x - padding[3],
- y: groupRect.y - padding[0],
- width: groupRect.width + padding[1] + padding[3],
- height: groupRect.height + padding[0] + padding[2],
- r: titleModel.get("borderRadius")
- },
- style,
- subPixelOptimize: true,
- silent: true
- });
- group.add(rect);
- };
- TitleView2.type = "title";
- return TitleView2;
- }(Component_default2);
- function install15(registers) {
- registers.registerComponentModel(TitleModel);
- registers.registerComponentView(TitleView);
- }
- // node_modules/echarts/lib/component/timeline/install.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/timeline/SliderTimelineModel.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/timeline/TimelineModel.js
- init_define_APP_INFO();
- var TimelineModel = function(_super) {
- __extends(TimelineModel2, _super);
- function TimelineModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = TimelineModel2.type;
- _this.layoutMode = "box";
- return _this;
- }
- TimelineModel2.prototype.init = function(option, parentModel, ecModel) {
- this.mergeDefaultAndTheme(option, ecModel);
- this._initData();
- };
- TimelineModel2.prototype.mergeOption = function(option) {
- _super.prototype.mergeOption.apply(this, arguments);
- this._initData();
- };
- TimelineModel2.prototype.setCurrentIndex = function(currentIndex) {
- if (currentIndex == null) {
- currentIndex = this.option.currentIndex;
- }
- var count2 = this._data.count();
- if (this.option.loop) {
- currentIndex = (currentIndex % count2 + count2) % count2;
- } else {
- currentIndex >= count2 && (currentIndex = count2 - 1);
- currentIndex < 0 && (currentIndex = 0);
- }
- this.option.currentIndex = currentIndex;
- };
- TimelineModel2.prototype.getCurrentIndex = function() {
- return this.option.currentIndex;
- };
- TimelineModel2.prototype.isIndexMax = function() {
- return this.getCurrentIndex() >= this._data.count() - 1;
- };
- TimelineModel2.prototype.setPlayState = function(state) {
- this.option.autoPlay = !!state;
- };
- TimelineModel2.prototype.getPlayState = function() {
- return !!this.option.autoPlay;
- };
- TimelineModel2.prototype._initData = function() {
- var thisOption = this.option;
- var dataArr = thisOption.data || [];
- var axisType = thisOption.axisType;
- var names = this._names = [];
- var processedDataArr;
- if (axisType === "category") {
- processedDataArr = [];
- each(dataArr, function(item, index) {
- var value = convertOptionIdName(getDataItemValue(item), "");
- var newItem;
- if (isObject(item)) {
- newItem = clone(item);
- newItem.value = index;
- } else {
- newItem = index;
- }
- processedDataArr.push(newItem);
- names.push(value);
- });
- } else {
- processedDataArr = dataArr;
- }
- var dimType = {
- category: "ordinal",
- time: "time",
- value: "number"
- }[axisType] || "number";
- var data = this._data = new SeriesData_default([{
- name: "value",
- type: dimType
- }], this);
- data.initData(processedDataArr, names);
- };
- TimelineModel2.prototype.getData = function() {
- return this._data;
- };
- TimelineModel2.prototype.getCategories = function() {
- if (this.get("axisType") === "category") {
- return this._names.slice();
- }
- };
- TimelineModel2.type = "timeline";
- TimelineModel2.defaultOption = {
- z: 4,
- show: true,
- axisType: "time",
- realtime: true,
- left: "20%",
- top: null,
- right: "20%",
- bottom: 0,
- width: null,
- height: 40,
- padding: 5,
- controlPosition: "left",
- autoPlay: false,
- rewind: false,
- loop: true,
- playInterval: 2e3,
- currentIndex: 0,
- itemStyle: {},
- label: {
- color: "#000"
- },
- data: []
- };
- return TimelineModel2;
- }(Component_default);
- var TimelineModel_default = TimelineModel;
- // node_modules/echarts/lib/component/timeline/SliderTimelineModel.js
- var SliderTimelineModel = function(_super) {
- __extends(SliderTimelineModel2, _super);
- function SliderTimelineModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = SliderTimelineModel2.type;
- return _this;
- }
- SliderTimelineModel2.type = "timeline.slider";
- SliderTimelineModel2.defaultOption = inheritDefaultOption(TimelineModel_default.defaultOption, {
- backgroundColor: "rgba(0,0,0,0)",
- borderColor: "#ccc",
- borderWidth: 0,
- orient: "horizontal",
- inverse: false,
- tooltip: {
- trigger: "item"
- },
- symbol: "circle",
- symbolSize: 12,
- lineStyle: {
- show: true,
- width: 2,
- color: "#DAE1F5"
- },
- label: {
- position: "auto",
- show: true,
- interval: "auto",
- rotate: 0,
- color: "#A4B1D7"
- },
- itemStyle: {
- color: "#A4B1D7",
- borderWidth: 1
- },
- checkpointStyle: {
- symbol: "circle",
- symbolSize: 15,
- color: "#316bf3",
- borderColor: "#fff",
- borderWidth: 2,
- shadowBlur: 2,
- shadowOffsetX: 1,
- shadowOffsetY: 1,
- shadowColor: "rgba(0, 0, 0, 0.3)",
- animation: true,
- animationDuration: 300,
- animationEasing: "quinticInOut"
- },
- controlStyle: {
- show: true,
- showPlayBtn: true,
- showPrevBtn: true,
- showNextBtn: true,
- itemSize: 24,
- itemGap: 12,
- position: "left",
- playIcon: "path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",
- stopIcon: "path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",
- 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",
- prevIcon: "M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",
- prevBtnSize: 18,
- nextBtnSize: 18,
- color: "#A4B1D7",
- borderColor: "#A4B1D7",
- borderWidth: 1
- },
- emphasis: {
- label: {
- show: true,
- color: "#6f778d"
- },
- itemStyle: {
- color: "#316BF3"
- },
- controlStyle: {
- color: "#316BF3",
- borderColor: "#316BF3",
- borderWidth: 2
- }
- },
- progress: {
- lineStyle: {
- color: "#316BF3"
- },
- itemStyle: {
- color: "#316BF3"
- },
- label: {
- color: "#6f778d"
- }
- },
- data: []
- });
- return SliderTimelineModel2;
- }(TimelineModel_default);
- mixin(SliderTimelineModel, DataFormatMixin.prototype);
- var SliderTimelineModel_default = SliderTimelineModel;
- // node_modules/echarts/lib/component/timeline/SliderTimelineView.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/timeline/TimelineView.js
- init_define_APP_INFO();
- var TimelineView = function(_super) {
- __extends(TimelineView2, _super);
- function TimelineView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = TimelineView2.type;
- return _this;
- }
- TimelineView2.type = "timeline";
- return TimelineView2;
- }(Component_default2);
- var TimelineView_default = TimelineView;
- // node_modules/echarts/lib/component/timeline/TimelineAxis.js
- init_define_APP_INFO();
- var TimelineAxis = function(_super) {
- __extends(TimelineAxis2, _super);
- function TimelineAxis2(dim, scale, coordExtent, axisType) {
- var _this = _super.call(this, dim, scale, coordExtent) || this;
- _this.type = axisType || "value";
- return _this;
- }
- TimelineAxis2.prototype.getLabelModel = function() {
- return this.model.getModel("label");
- };
- TimelineAxis2.prototype.isHorizontal = function() {
- return this.model.get("orient") === "horizontal";
- };
- return TimelineAxis2;
- }(Axis_default);
- var TimelineAxis_default = TimelineAxis;
- // node_modules/echarts/lib/component/timeline/SliderTimelineView.js
- var PI = Math.PI;
- var labelDataIndexStore = makeInner();
- var SliderTimelineView = function(_super) {
- __extends(SliderTimelineView2, _super);
- function SliderTimelineView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = SliderTimelineView2.type;
- return _this;
- }
- SliderTimelineView2.prototype.init = function(ecModel, api) {
- this.api = api;
- };
- SliderTimelineView2.prototype.render = function(timelineModel, ecModel, api) {
- this.model = timelineModel;
- this.api = api;
- this.ecModel = ecModel;
- this.group.removeAll();
- if (timelineModel.get("show", true)) {
- var layoutInfo_1 = this._layout(timelineModel, api);
- var mainGroup_1 = this._createGroup("_mainGroup");
- var labelGroup = this._createGroup("_labelGroup");
- var axis_1 = this._axis = this._createAxis(layoutInfo_1, timelineModel);
- timelineModel.formatTooltip = function(dataIndex) {
- var name = axis_1.scale.getLabel({
- value: dataIndex
- });
- return createTooltipMarkup("nameValue", {
- noName: true,
- value: name
- });
- };
- each(["AxisLine", "AxisTick", "Control", "CurrentPointer"], function(name) {
- this["_render" + name](layoutInfo_1, mainGroup_1, axis_1, timelineModel);
- }, this);
- this._renderAxisLabel(layoutInfo_1, labelGroup, axis_1, timelineModel);
- this._position(layoutInfo_1, timelineModel);
- }
- this._doPlayStop();
- this._updateTicksStatus();
- };
- SliderTimelineView2.prototype.remove = function() {
- this._clearTimer();
- this.group.removeAll();
- };
- SliderTimelineView2.prototype.dispose = function() {
- this._clearTimer();
- };
- SliderTimelineView2.prototype._layout = function(timelineModel, api) {
- var labelPosOpt = timelineModel.get(["label", "position"]);
- var orient = timelineModel.get("orient");
- var viewRect = getViewRect(timelineModel, api);
- var parsedLabelPos;
- if (labelPosOpt == null || labelPosOpt === "auto") {
- parsedLabelPos = orient === "horizontal" ? viewRect.y + viewRect.height / 2 < api.getHeight() / 2 ? "-" : "+" : viewRect.x + viewRect.width / 2 < api.getWidth() / 2 ? "+" : "-";
- } else if (isString(labelPosOpt)) {
- parsedLabelPos = {
- horizontal: {
- top: "-",
- bottom: "+"
- },
- vertical: {
- left: "-",
- right: "+"
- }
- }[orient][labelPosOpt];
- } else {
- parsedLabelPos = labelPosOpt;
- }
- var labelAlignMap = {
- horizontal: "center",
- vertical: parsedLabelPos >= 0 || parsedLabelPos === "+" ? "left" : "right"
- };
- var labelBaselineMap = {
- horizontal: parsedLabelPos >= 0 || parsedLabelPos === "+" ? "top" : "bottom",
- vertical: "middle"
- };
- var rotationMap = {
- horizontal: 0,
- vertical: PI / 2
- };
- var mainLength = orient === "vertical" ? viewRect.height : viewRect.width;
- var controlModel = timelineModel.getModel("controlStyle");
- var showControl = controlModel.get("show", true);
- var controlSize = showControl ? controlModel.get("itemSize") : 0;
- var controlGap = showControl ? controlModel.get("itemGap") : 0;
- var sizePlusGap = controlSize + controlGap;
- var labelRotation = timelineModel.get(["label", "rotate"]) || 0;
- labelRotation = labelRotation * PI / 180;
- var playPosition;
- var prevBtnPosition;
- var nextBtnPosition;
- var controlPosition = controlModel.get("position", true);
- var showPlayBtn = showControl && controlModel.get("showPlayBtn", true);
- var showPrevBtn = showControl && controlModel.get("showPrevBtn", true);
- var showNextBtn = showControl && controlModel.get("showNextBtn", true);
- var xLeft = 0;
- var xRight = mainLength;
- if (controlPosition === "left" || controlPosition === "bottom") {
- showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap);
- showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap);
- showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);
- } else {
- showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);
- showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap);
- showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);
- }
- var axisExtent = [xLeft, xRight];
- if (timelineModel.get("inverse")) {
- axisExtent.reverse();
- }
- return {
- viewRect,
- mainLength,
- orient,
- rotation: rotationMap[orient],
- labelRotation,
- labelPosOpt: parsedLabelPos,
- labelAlign: timelineModel.get(["label", "align"]) || labelAlignMap[orient],
- labelBaseline: timelineModel.get(["label", "verticalAlign"]) || timelineModel.get(["label", "baseline"]) || labelBaselineMap[orient],
- playPosition,
- prevBtnPosition,
- nextBtnPosition,
- axisExtent,
- controlSize,
- controlGap
- };
- };
- SliderTimelineView2.prototype._position = function(layoutInfo, timelineModel) {
- var mainGroup = this._mainGroup;
- var labelGroup = this._labelGroup;
- var viewRect = layoutInfo.viewRect;
- if (layoutInfo.orient === "vertical") {
- var m = create();
- var rotateOriginX = viewRect.x;
- var rotateOriginY = viewRect.y + viewRect.height;
- translate(m, m, [-rotateOriginX, -rotateOriginY]);
- rotate(m, m, -PI / 2);
- translate(m, m, [rotateOriginX, rotateOriginY]);
- viewRect = viewRect.clone();
- viewRect.applyTransform(m);
- }
- var viewBound = getBound(viewRect);
- var mainBound = getBound(mainGroup.getBoundingRect());
- var labelBound = getBound(labelGroup.getBoundingRect());
- var mainPosition = [mainGroup.x, mainGroup.y];
- var labelsPosition = [labelGroup.x, labelGroup.y];
- labelsPosition[0] = mainPosition[0] = viewBound[0][0];
- var labelPosOpt = layoutInfo.labelPosOpt;
- if (labelPosOpt == null || isString(labelPosOpt)) {
- var mainBoundIdx = labelPosOpt === "+" ? 0 : 1;
- toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);
- toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx);
- } else {
- var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1;
- toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);
- labelsPosition[1] = mainPosition[1] + labelPosOpt;
- }
- mainGroup.setPosition(mainPosition);
- labelGroup.setPosition(labelsPosition);
- mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation;
- setOrigin(mainGroup);
- setOrigin(labelGroup);
- function setOrigin(targetGroup) {
- targetGroup.originX = viewBound[0][0] - targetGroup.x;
- targetGroup.originY = viewBound[1][0] - targetGroup.y;
- }
- function getBound(rect) {
- return [[rect.x, rect.x + rect.width], [rect.y, rect.y + rect.height]];
- }
- function toBound(fromPos, from, to, dimIdx, boundIdx) {
- fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx];
- }
- };
- SliderTimelineView2.prototype._createAxis = function(layoutInfo, timelineModel) {
- var data = timelineModel.getData();
- var axisType = timelineModel.get("axisType");
- var scale = createScaleByModel2(timelineModel, axisType);
- scale.getTicks = function() {
- return data.mapArray(["value"], function(value) {
- return {
- value
- };
- });
- };
- var dataExtent = data.getDataExtent("value");
- scale.setExtent(dataExtent[0], dataExtent[1]);
- scale.calcNiceTicks();
- var axis = new TimelineAxis_default("value", scale, layoutInfo.axisExtent, axisType);
- axis.model = timelineModel;
- return axis;
- };
- SliderTimelineView2.prototype._createGroup = function(key) {
- var newGroup = this[key] = new Group_default();
- this.group.add(newGroup);
- return newGroup;
- };
- SliderTimelineView2.prototype._renderAxisLine = function(layoutInfo, group, axis, timelineModel) {
- var axisExtent = axis.getExtent();
- if (!timelineModel.get(["lineStyle", "show"])) {
- return;
- }
- var line = new Line_default({
- shape: {
- x1: axisExtent[0],
- y1: 0,
- x2: axisExtent[1],
- y2: 0
- },
- style: extend({
- lineCap: "round"
- }, timelineModel.getModel("lineStyle").getLineStyle()),
- silent: true,
- z2: 1
- });
- group.add(line);
- var progressLine = this._progressLine = new Line_default({
- shape: {
- x1: axisExtent[0],
- x2: this._currentPointer ? this._currentPointer.x : axisExtent[0],
- y1: 0,
- y2: 0
- },
- style: defaults({
- lineCap: "round",
- lineWidth: line.style.lineWidth
- }, timelineModel.getModel(["progress", "lineStyle"]).getLineStyle()),
- silent: true,
- z2: 1
- });
- group.add(progressLine);
- };
- SliderTimelineView2.prototype._renderAxisTick = function(layoutInfo, group, axis, timelineModel) {
- var _this = this;
- var data = timelineModel.getData();
- var ticks = axis.scale.getTicks();
- this._tickSymbols = [];
- each(ticks, function(tick) {
- var tickCoord = axis.dataToCoord(tick.value);
- var itemModel = data.getItemModel(tick.value);
- var itemStyleModel = itemModel.getModel("itemStyle");
- var hoverStyleModel = itemModel.getModel(["emphasis", "itemStyle"]);
- var progressStyleModel = itemModel.getModel(["progress", "itemStyle"]);
- var symbolOpt = {
- x: tickCoord,
- y: 0,
- onclick: bind(_this._changeTimeline, _this, tick.value)
- };
- var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt);
- el.ensureState("emphasis").style = hoverStyleModel.getItemStyle();
- el.ensureState("progress").style = progressStyleModel.getItemStyle();
- enableHoverEmphasis(el);
- var ecData = getECData(el);
- if (itemModel.get("tooltip")) {
- ecData.dataIndex = tick.value;
- ecData.dataModel = timelineModel;
- } else {
- ecData.dataIndex = ecData.dataModel = null;
- }
- _this._tickSymbols.push(el);
- });
- };
- SliderTimelineView2.prototype._renderAxisLabel = function(layoutInfo, group, axis, timelineModel) {
- var _this = this;
- var labelModel = axis.getLabelModel();
- if (!labelModel.get("show")) {
- return;
- }
- var data = timelineModel.getData();
- var labels = axis.getViewLabels();
- this._tickLabels = [];
- each(labels, function(labelItem) {
- var dataIndex = labelItem.tickValue;
- var itemModel = data.getItemModel(dataIndex);
- var normalLabelModel = itemModel.getModel("label");
- var hoverLabelModel = itemModel.getModel(["emphasis", "label"]);
- var progressLabelModel = itemModel.getModel(["progress", "label"]);
- var tickCoord = axis.dataToCoord(labelItem.tickValue);
- var textEl = new Text_default({
- x: tickCoord,
- y: 0,
- rotation: layoutInfo.labelRotation - layoutInfo.rotation,
- onclick: bind(_this._changeTimeline, _this, dataIndex),
- silent: false,
- style: createTextStyle(normalLabelModel, {
- text: labelItem.formattedLabel,
- align: layoutInfo.labelAlign,
- verticalAlign: layoutInfo.labelBaseline
- })
- });
- textEl.ensureState("emphasis").style = createTextStyle(hoverLabelModel);
- textEl.ensureState("progress").style = createTextStyle(progressLabelModel);
- group.add(textEl);
- enableHoverEmphasis(textEl);
- labelDataIndexStore(textEl).dataIndex = dataIndex;
- _this._tickLabels.push(textEl);
- });
- };
- SliderTimelineView2.prototype._renderControl = function(layoutInfo, group, axis, timelineModel) {
- var controlSize = layoutInfo.controlSize;
- var rotation = layoutInfo.rotation;
- var itemStyle = timelineModel.getModel("controlStyle").getItemStyle();
- var hoverStyle = timelineModel.getModel(["emphasis", "controlStyle"]).getItemStyle();
- var playState = timelineModel.getPlayState();
- var inverse = timelineModel.get("inverse", true);
- makeBtn(layoutInfo.nextBtnPosition, "next", bind(this._changeTimeline, this, inverse ? "-" : "+"));
- makeBtn(layoutInfo.prevBtnPosition, "prev", bind(this._changeTimeline, this, inverse ? "+" : "-"));
- makeBtn(layoutInfo.playPosition, playState ? "stop" : "play", bind(this._handlePlayClick, this, !playState), true);
- function makeBtn(position, iconName, onclick, willRotate) {
- if (!position) {
- return;
- }
- var iconSize = parsePercent(retrieve2(timelineModel.get(["controlStyle", iconName + "BtnSize"]), controlSize), controlSize);
- var rect = [0, -iconSize / 2, iconSize, iconSize];
- var btn = makeControlIcon(timelineModel, iconName + "Icon", rect, {
- x: position[0],
- y: position[1],
- originX: controlSize / 2,
- originY: 0,
- rotation: willRotate ? -rotation : 0,
- rectHover: true,
- style: itemStyle,
- onclick
- });
- btn.ensureState("emphasis").style = hoverStyle;
- group.add(btn);
- enableHoverEmphasis(btn);
- }
- };
- SliderTimelineView2.prototype._renderCurrentPointer = function(layoutInfo, group, axis, timelineModel) {
- var data = timelineModel.getData();
- var currentIndex = timelineModel.getCurrentIndex();
- var pointerModel = data.getItemModel(currentIndex).getModel("checkpointStyle");
- var me = this;
- var callback = {
- onCreate: function(pointer) {
- pointer.draggable = true;
- pointer.drift = bind(me._handlePointerDrag, me);
- pointer.ondragend = bind(me._handlePointerDragend, me);
- pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel, true);
- },
- onUpdate: function(pointer) {
- pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel);
- }
- };
- this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback);
- };
- SliderTimelineView2.prototype._handlePlayClick = function(nextState) {
- this._clearTimer();
- this.api.dispatchAction({
- type: "timelinePlayChange",
- playState: nextState,
- from: this.uid
- });
- };
- SliderTimelineView2.prototype._handlePointerDrag = function(dx, dy, e) {
- this._clearTimer();
- this._pointerChangeTimeline([e.offsetX, e.offsetY]);
- };
- SliderTimelineView2.prototype._handlePointerDragend = function(e) {
- this._pointerChangeTimeline([e.offsetX, e.offsetY], true);
- };
- SliderTimelineView2.prototype._pointerChangeTimeline = function(mousePos, trigger) {
- var toCoord = this._toAxisCoord(mousePos)[0];
- var axis = this._axis;
- var axisExtent = asc(axis.getExtent().slice());
- toCoord > axisExtent[1] && (toCoord = axisExtent[1]);
- toCoord < axisExtent[0] && (toCoord = axisExtent[0]);
- this._currentPointer.x = toCoord;
- this._currentPointer.markRedraw();
- this._progressLine.shape.x2 = toCoord;
- this._progressLine.dirty();
- var targetDataIndex = this._findNearestTick(toCoord);
- var timelineModel = this.model;
- if (trigger || targetDataIndex !== timelineModel.getCurrentIndex() && timelineModel.get("realtime")) {
- this._changeTimeline(targetDataIndex);
- }
- };
- SliderTimelineView2.prototype._doPlayStop = function() {
- var _this = this;
- this._clearTimer();
- if (this.model.getPlayState()) {
- this._timer = setTimeout(function() {
- var timelineModel = _this.model;
- _this._changeTimeline(timelineModel.getCurrentIndex() + (timelineModel.get("rewind", true) ? -1 : 1));
- }, this.model.get("playInterval"));
- }
- };
- SliderTimelineView2.prototype._toAxisCoord = function(vertex) {
- var trans = this._mainGroup.getLocalTransform();
- return applyTransform(vertex, trans, true);
- };
- SliderTimelineView2.prototype._findNearestTick = function(axisCoord) {
- var data = this.model.getData();
- var dist = Infinity;
- var targetDataIndex;
- var axis = this._axis;
- data.each(["value"], function(value, dataIndex) {
- var coord = axis.dataToCoord(value);
- var d = Math.abs(coord - axisCoord);
- if (d < dist) {
- dist = d;
- targetDataIndex = dataIndex;
- }
- });
- return targetDataIndex;
- };
- SliderTimelineView2.prototype._clearTimer = function() {
- if (this._timer) {
- clearTimeout(this._timer);
- this._timer = null;
- }
- };
- SliderTimelineView2.prototype._changeTimeline = function(nextIndex) {
- var currentIndex = this.model.getCurrentIndex();
- if (nextIndex === "+") {
- nextIndex = currentIndex + 1;
- } else if (nextIndex === "-") {
- nextIndex = currentIndex - 1;
- }
- this.api.dispatchAction({
- type: "timelineChange",
- currentIndex: nextIndex,
- from: this.uid
- });
- };
- SliderTimelineView2.prototype._updateTicksStatus = function() {
- var currentIndex = this.model.getCurrentIndex();
- var tickSymbols = this._tickSymbols;
- var tickLabels = this._tickLabels;
- if (tickSymbols) {
- for (var i = 0; i < tickSymbols.length; i++) {
- tickSymbols && tickSymbols[i] && tickSymbols[i].toggleState("progress", i < currentIndex);
- }
- }
- if (tickLabels) {
- for (var i = 0; i < tickLabels.length; i++) {
- tickLabels && tickLabels[i] && tickLabels[i].toggleState("progress", labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex);
- }
- }
- };
- SliderTimelineView2.type = "timeline.slider";
- return SliderTimelineView2;
- }(TimelineView_default);
- function createScaleByModel2(model, axisType) {
- axisType = axisType || model.get("type");
- if (axisType) {
- switch (axisType) {
- case "category":
- return new Ordinal_default({
- ordinalMeta: model.getCategories(),
- extent: [Infinity, -Infinity]
- });
- case "time":
- return new Time_default({
- locale: model.ecModel.getLocaleModel(),
- useUTC: model.ecModel.get("useUTC")
- });
- default:
- return new Interval_default();
- }
- }
- }
- function getViewRect(model, api) {
- return getLayoutRect(model.getBoxLayoutParams(), {
- width: api.getWidth(),
- height: api.getHeight()
- }, model.get("padding"));
- }
- function makeControlIcon(timelineModel, objPath, rect, opts) {
- var style = opts.style;
- var icon = createIcon(timelineModel.get(["controlStyle", objPath]), opts || {}, new BoundingRect_default(rect[0], rect[1], rect[2], rect[3]));
- if (style) {
- icon.setStyle(style);
- }
- return icon;
- }
- function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {
- var color = itemStyleModel.get("color");
- if (!symbol) {
- var symbolType = hostModel.get("symbol");
- symbol = createSymbol(symbolType, -1, -1, 2, 2, color);
- symbol.setStyle("strokeNoScale", true);
- group.add(symbol);
- callback && callback.onCreate(symbol);
- } else {
- symbol.setColor(color);
- group.add(symbol);
- callback && callback.onUpdate(symbol);
- }
- var itemStyle = itemStyleModel.getItemStyle(["color"]);
- symbol.setStyle(itemStyle);
- opt = merge({
- rectHover: true,
- z2: 100
- }, opt, true);
- var symbolSize = normalizeSymbolSize(hostModel.get("symbolSize"));
- opt.scaleX = symbolSize[0] / 2;
- opt.scaleY = symbolSize[1] / 2;
- var symbolOffset = normalizeSymbolOffset(hostModel.get("symbolOffset"), symbolSize);
- if (symbolOffset) {
- opt.x = (opt.x || 0) + symbolOffset[0];
- opt.y = (opt.y || 0) + symbolOffset[1];
- }
- var symbolRotate = hostModel.get("symbolRotate");
- opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;
- symbol.attr(opt);
- symbol.updateTransform();
- return symbol;
- }
- function pointerMoveTo(pointer, progressLine, dataIndex, axis, timelineModel, noAnimation) {
- if (pointer.dragging) {
- return;
- }
- var pointerModel = timelineModel.getModel("checkpointStyle");
- var toCoord = axis.dataToCoord(timelineModel.getData().get("value", dataIndex));
- if (noAnimation || !pointerModel.get("animation", true)) {
- pointer.attr({
- x: toCoord,
- y: 0
- });
- progressLine && progressLine.attr({
- shape: {
- x2: toCoord
- }
- });
- } else {
- var animationCfg = {
- duration: pointerModel.get("animationDuration", true),
- easing: pointerModel.get("animationEasing", true)
- };
- pointer.stopAnimation(null, true);
- pointer.animateTo({
- x: toCoord,
- y: 0
- }, animationCfg);
- progressLine && progressLine.animateTo({
- shape: {
- x2: toCoord
- }
- }, animationCfg);
- }
- }
- var SliderTimelineView_default = SliderTimelineView;
- // node_modules/echarts/lib/component/timeline/timelineAction.js
- init_define_APP_INFO();
- function installTimelineAction(registers) {
- registers.registerAction({
- type: "timelineChange",
- event: "timelineChanged",
- update: "prepareAndUpdate"
- }, function(payload, ecModel, api) {
- var timelineModel = ecModel.getComponent("timeline");
- if (timelineModel && payload.currentIndex != null) {
- timelineModel.setCurrentIndex(payload.currentIndex);
- if (!timelineModel.get("loop", true) && timelineModel.isIndexMax() && timelineModel.getPlayState()) {
- timelineModel.setPlayState(false);
- api.dispatchAction({
- type: "timelinePlayChange",
- playState: false,
- from: payload.from
- });
- }
- }
- ecModel.resetOption("timeline", {
- replaceMerge: timelineModel.get("replaceMerge", true)
- });
- return defaults({
- currentIndex: timelineModel.option.currentIndex
- }, payload);
- });
- registers.registerAction({
- type: "timelinePlayChange",
- event: "timelinePlayChanged",
- update: "update"
- }, function(payload, ecModel) {
- var timelineModel = ecModel.getComponent("timeline");
- if (timelineModel && payload.playState != null) {
- timelineModel.setPlayState(payload.playState);
- }
- });
- }
- // node_modules/echarts/lib/component/timeline/preprocessor.js
- init_define_APP_INFO();
- function timelinePreprocessor(option) {
- var timelineOpt = option && option.timeline;
- if (!isArray(timelineOpt)) {
- timelineOpt = timelineOpt ? [timelineOpt] : [];
- }
- each(timelineOpt, function(opt) {
- if (!opt) {
- return;
- }
- compatibleEC2(opt);
- });
- }
- function compatibleEC2(opt) {
- var type = opt.type;
- var ec2Types = {
- "number": "value",
- "time": "time"
- };
- if (ec2Types[type]) {
- opt.axisType = ec2Types[type];
- delete opt.type;
- }
- transferItem(opt);
- if (has(opt, "controlPosition")) {
- var controlStyle = opt.controlStyle || (opt.controlStyle = {});
- if (!has(controlStyle, "position")) {
- controlStyle.position = opt.controlPosition;
- }
- if (controlStyle.position === "none" && !has(controlStyle, "show")) {
- controlStyle.show = false;
- delete controlStyle.position;
- }
- delete opt.controlPosition;
- }
- each(opt.data || [], function(dataItem) {
- if (isObject(dataItem) && !isArray(dataItem)) {
- if (!has(dataItem, "value") && has(dataItem, "name")) {
- dataItem.value = dataItem.name;
- }
- transferItem(dataItem);
- }
- });
- }
- function transferItem(opt) {
- var itemStyle = opt.itemStyle || (opt.itemStyle = {});
- var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {});
- var label = opt.label || opt.label || {};
- var labelNormal = label.normal || (label.normal = {});
- var excludeLabelAttr = {
- normal: 1,
- emphasis: 1
- };
- each(label, function(value, name) {
- if (!excludeLabelAttr[name] && !has(labelNormal, name)) {
- labelNormal[name] = value;
- }
- });
- if (itemStyleEmphasis.label && !has(label, "emphasis")) {
- label.emphasis = itemStyleEmphasis.label;
- delete itemStyleEmphasis.label;
- }
- }
- function has(obj, attr) {
- return obj.hasOwnProperty(attr);
- }
- // node_modules/echarts/lib/component/timeline/install.js
- function install16(registers) {
- registers.registerComponentModel(SliderTimelineModel_default);
- registers.registerComponentView(SliderTimelineView_default);
- registers.registerSubTypeDefaulter("timeline", function() {
- return "slider";
- });
- installTimelineAction(registers);
- registers.registerPreprocessor(timelinePreprocessor);
- }
- // node_modules/echarts/lib/component/marker/installMarkPoint.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/marker/checkMarkerInSeries.js
- init_define_APP_INFO();
- function checkMarkerInSeries(seriesOpts, markerType) {
- if (!seriesOpts) {
- return false;
- }
- var seriesOptArr = isArray(seriesOpts) ? seriesOpts : [seriesOpts];
- for (var idx = 0; idx < seriesOptArr.length; idx++) {
- if (seriesOptArr[idx] && seriesOptArr[idx][markerType]) {
- return true;
- }
- }
- return false;
- }
- // node_modules/echarts/lib/component/marker/MarkPointModel.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/marker/MarkerModel.js
- init_define_APP_INFO();
- function fillLabel(opt) {
- defaultEmphasis(opt, "label", ["show"]);
- }
- var inner7 = makeInner();
- var MarkerModel = function(_super) {
- __extends(MarkerModel2, _super);
- function MarkerModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = MarkerModel2.type;
- _this.createdBySelf = false;
- return _this;
- }
- MarkerModel2.prototype.init = function(option, parentModel, ecModel) {
- if (true) {
- if (this.type === "marker") {
- throw new Error("Marker component is abstract component. Use markLine, markPoint, markArea instead.");
- }
- }
- this.mergeDefaultAndTheme(option, ecModel);
- this._mergeOption(option, ecModel, false, true);
- };
- MarkerModel2.prototype.isAnimationEnabled = function() {
- if (env_default.node) {
- return false;
- }
- var hostSeries = this.__hostSeries;
- return this.getShallow("animation") && hostSeries && hostSeries.isAnimationEnabled();
- };
- MarkerModel2.prototype.mergeOption = function(newOpt, ecModel) {
- this._mergeOption(newOpt, ecModel, false, false);
- };
- MarkerModel2.prototype._mergeOption = function(newOpt, ecModel, createdBySelf, isInit) {
- var componentType = this.mainType;
- if (!createdBySelf) {
- ecModel.eachSeries(function(seriesModel) {
- var markerOpt = seriesModel.get(this.mainType, true);
- var markerModel = inner7(seriesModel)[componentType];
- if (!markerOpt || !markerOpt.data) {
- inner7(seriesModel)[componentType] = null;
- return;
- }
- if (!markerModel) {
- if (isInit) {
- fillLabel(markerOpt);
- }
- each(markerOpt.data, function(item) {
- if (item instanceof Array) {
- fillLabel(item[0]);
- fillLabel(item[1]);
- } else {
- fillLabel(item);
- }
- });
- markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel);
- extend(markerModel, {
- mainType: this.mainType,
- seriesIndex: seriesModel.seriesIndex,
- name: seriesModel.name,
- createdBySelf: true
- });
- markerModel.__hostSeries = seriesModel;
- } else {
- markerModel._mergeOption(markerOpt, ecModel, true);
- }
- inner7(seriesModel)[componentType] = markerModel;
- }, this);
- }
- };
- MarkerModel2.prototype.formatTooltip = function(dataIndex, multipleSeries, dataType) {
- var data = this.getData();
- var value = this.getRawValue(dataIndex);
- var itemName = data.getName(dataIndex);
- return createTooltipMarkup("section", {
- header: this.name,
- blocks: [createTooltipMarkup("nameValue", {
- name: itemName,
- value,
- noName: !itemName,
- noValue: value == null
- })]
- });
- };
- MarkerModel2.prototype.getData = function() {
- return this._data;
- };
- MarkerModel2.prototype.setData = function(data) {
- this._data = data;
- };
- MarkerModel2.getMarkerModelFromSeries = function(seriesModel, componentType) {
- return inner7(seriesModel)[componentType];
- };
- MarkerModel2.type = "marker";
- MarkerModel2.dependencies = ["series", "grid", "polar", "geo"];
- return MarkerModel2;
- }(Component_default);
- mixin(MarkerModel, DataFormatMixin.prototype);
- var MarkerModel_default = MarkerModel;
- // node_modules/echarts/lib/component/marker/MarkPointModel.js
- var MarkPointModel = function(_super) {
- __extends(MarkPointModel2, _super);
- function MarkPointModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = MarkPointModel2.type;
- return _this;
- }
- MarkPointModel2.prototype.createMarkerModelFromSeries = function(markerOpt, masterMarkerModel, ecModel) {
- return new MarkPointModel2(markerOpt, masterMarkerModel, ecModel);
- };
- MarkPointModel2.type = "markPoint";
- MarkPointModel2.defaultOption = {
- z: 5,
- symbol: "pin",
- symbolSize: 50,
- tooltip: {
- trigger: "item"
- },
- label: {
- show: true,
- position: "inside"
- },
- itemStyle: {
- borderWidth: 2
- },
- emphasis: {
- label: {
- show: true
- }
- }
- };
- return MarkPointModel2;
- }(MarkerModel_default);
- var MarkPointModel_default = MarkPointModel;
- // node_modules/echarts/lib/component/marker/MarkPointView.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/marker/markerHelper.js
- init_define_APP_INFO();
- function hasXOrY(item) {
- return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y)));
- }
- function hasXAndY(item) {
- return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y));
- }
- function markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) {
- var coordArr = [];
- var stacked = isDimensionStacked(
- data,
- targetDataDim
- );
- var calcDataDim = stacked ? data.getCalculationInfo("stackResultDimension") : targetDataDim;
- var value = numCalculate(data, calcDataDim, markerType);
- var dataIndex = data.indicesOfNearest(calcDataDim, value)[0];
- coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);
- coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);
- var coordArrValue = data.get(targetDataDim, dataIndex);
- var precision = getPrecision(data.get(targetDataDim, dataIndex));
- precision = Math.min(precision, 20);
- if (precision >= 0) {
- coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);
- }
- return [coordArr, coordArrValue];
- }
- var markerTypeCalculator = {
- min: curry(markerTypeCalculatorWithExtent, "min"),
- max: curry(markerTypeCalculatorWithExtent, "max"),
- average: curry(markerTypeCalculatorWithExtent, "average"),
- median: curry(markerTypeCalculatorWithExtent, "median")
- };
- function dataTransform(seriesModel, item) {
- var data = seriesModel.getData();
- var coordSys = seriesModel.coordinateSystem;
- if (item && !hasXAndY(item) && !isArray(item.coord) && coordSys) {
- var dims = coordSys.dimensions;
- var axisInfo = getAxisInfo2(item, data, coordSys, seriesModel);
- item = clone(item);
- if (item.type && markerTypeCalculator[item.type] && axisInfo.baseAxis && axisInfo.valueAxis) {
- var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);
- var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);
- var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);
- item.coord = coordInfo[0];
- item.value = coordInfo[1];
- } else {
- var coord = [item.xAxis != null ? item.xAxis : item.radiusAxis, item.yAxis != null ? item.yAxis : item.angleAxis];
- for (var i = 0; i < 2; i++) {
- if (markerTypeCalculator[coord[i]]) {
- coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]);
- }
- }
- item.coord = coord;
- }
- }
- return item;
- }
- function getAxisInfo2(item, data, coordSys, seriesModel) {
- var ret = {};
- if (item.valueIndex != null || item.valueDim != null) {
- ret.valueDataDim = item.valueIndex != null ? data.getDimension(item.valueIndex) : item.valueDim;
- ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim));
- ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);
- ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);
- } else {
- ret.baseAxis = seriesModel.getBaseAxis();
- ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);
- ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);
- ret.valueDataDim = data.mapDimension(ret.valueAxis.dim);
- }
- return ret;
- }
- function dataDimToCoordDim(seriesModel, dataDim) {
- var dimItem = seriesModel.getData().getDimensionInfo(dataDim);
- return dimItem && dimItem.coordDim;
- }
- function dataFilter(coordSys, item) {
- return coordSys && coordSys.containData && item.coord && !hasXOrY(item) ? coordSys.containData(item.coord) : true;
- }
- function zoneFilter(coordSys, item1, item2) {
- return coordSys && coordSys.containZone && item1.coord && item2.coord && !hasXOrY(item1) && !hasXOrY(item2) ? coordSys.containZone(item1.coord, item2.coord) : true;
- }
- function createMarkerDimValueGetter(inCoordSys, dims) {
- return inCoordSys ? function(item, dimName, dataIndex, dimIndex) {
- var rawVal = dimIndex < 2 ? item.coord && item.coord[dimIndex] : item.value;
- return parseDataValue(rawVal, dims[dimIndex]);
- } : function(item, dimName, dataIndex, dimIndex) {
- return parseDataValue(item.value, dims[dimIndex]);
- };
- }
- function numCalculate(data, valueDataDim, type) {
- if (type === "average") {
- var sum_1 = 0;
- var count_1 = 0;
- data.each(valueDataDim, function(val, idx) {
- if (!isNaN(val)) {
- sum_1 += val;
- count_1++;
- }
- });
- return sum_1 / count_1;
- } else if (type === "median") {
- return data.getMedian(valueDataDim);
- } else {
- return data.getDataExtent(valueDataDim)[type === "max" ? 1 : 0];
- }
- }
- // node_modules/echarts/lib/component/marker/MarkerView.js
- init_define_APP_INFO();
- var inner8 = makeInner();
- var MarkerView = function(_super) {
- __extends(MarkerView2, _super);
- function MarkerView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = MarkerView2.type;
- return _this;
- }
- MarkerView2.prototype.init = function() {
- this.markerGroupMap = createHashMap();
- };
- MarkerView2.prototype.render = function(markerModel, ecModel, api) {
- var _this = this;
- var markerGroupMap = this.markerGroupMap;
- markerGroupMap.each(function(item) {
- inner8(item).keep = false;
- });
- ecModel.eachSeries(function(seriesModel) {
- var markerModel2 = MarkerModel_default.getMarkerModelFromSeries(seriesModel, _this.type);
- markerModel2 && _this.renderSeries(seriesModel, markerModel2, ecModel, api);
- });
- markerGroupMap.each(function(item) {
- !inner8(item).keep && _this.group.remove(item.group);
- });
- };
- MarkerView2.prototype.markKeep = function(drawGroup) {
- inner8(drawGroup).keep = true;
- };
- MarkerView2.prototype.toggleBlurSeries = function(seriesModelList, isBlur) {
- var _this = this;
- each(seriesModelList, function(seriesModel) {
- var markerModel = MarkerModel_default.getMarkerModelFromSeries(seriesModel, _this.type);
- if (markerModel) {
- var data = markerModel.getData();
- data.eachItemGraphicEl(function(el) {
- if (el) {
- isBlur ? enterBlur(el) : leaveBlur(el);
- }
- });
- }
- });
- };
- MarkerView2.type = "marker";
- return MarkerView2;
- }(Component_default2);
- var MarkerView_default = MarkerView;
- // node_modules/echarts/lib/component/marker/MarkPointView.js
- function updateMarkerLayout(mpData, seriesModel, api) {
- var coordSys = seriesModel.coordinateSystem;
- mpData.each(function(idx) {
- var itemModel = mpData.getItemModel(idx);
- var point;
- var xPx = parsePercent2(itemModel.get("x"), api.getWidth());
- var yPx = parsePercent2(itemModel.get("y"), api.getHeight());
- if (!isNaN(xPx) && !isNaN(yPx)) {
- point = [xPx, yPx];
- } else if (seriesModel.getMarkerPosition) {
- point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx));
- } else if (coordSys) {
- var x = mpData.get(coordSys.dimensions[0], idx);
- var y = mpData.get(coordSys.dimensions[1], idx);
- point = coordSys.dataToPoint([x, y]);
- }
- if (!isNaN(xPx)) {
- point[0] = xPx;
- }
- if (!isNaN(yPx)) {
- point[1] = yPx;
- }
- mpData.setItemLayout(idx, point);
- });
- }
- var MarkPointView = function(_super) {
- __extends(MarkPointView2, _super);
- function MarkPointView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = MarkPointView2.type;
- return _this;
- }
- MarkPointView2.prototype.updateTransform = function(markPointModel, ecModel, api) {
- ecModel.eachSeries(function(seriesModel) {
- var mpModel = MarkerModel_default.getMarkerModelFromSeries(seriesModel, "markPoint");
- if (mpModel) {
- updateMarkerLayout(mpModel.getData(), seriesModel, api);
- this.markerGroupMap.get(seriesModel.id).updateLayout();
- }
- }, this);
- };
- MarkPointView2.prototype.renderSeries = function(seriesModel, mpModel, ecModel, api) {
- var coordSys = seriesModel.coordinateSystem;
- var seriesId = seriesModel.id;
- var seriesData = seriesModel.getData();
- var symbolDrawMap = this.markerGroupMap;
- var symbolDraw = symbolDrawMap.get(seriesId) || symbolDrawMap.set(seriesId, new SymbolDraw_default());
- var mpData = createData(coordSys, seriesModel, mpModel);
- mpModel.setData(mpData);
- updateMarkerLayout(mpModel.getData(), seriesModel, api);
- mpData.each(function(idx) {
- var itemModel = mpData.getItemModel(idx);
- var symbol = itemModel.getShallow("symbol");
- var symbolSize = itemModel.getShallow("symbolSize");
- var symbolRotate = itemModel.getShallow("symbolRotate");
- var symbolOffset = itemModel.getShallow("symbolOffset");
- var symbolKeepAspect = itemModel.getShallow("symbolKeepAspect");
- if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate) || isFunction(symbolOffset)) {
- var rawIdx = mpModel.getRawValue(idx);
- var dataParams = mpModel.getDataParams(idx);
- if (isFunction(symbol)) {
- symbol = symbol(rawIdx, dataParams);
- }
- if (isFunction(symbolSize)) {
- symbolSize = symbolSize(rawIdx, dataParams);
- }
- if (isFunction(symbolRotate)) {
- symbolRotate = symbolRotate(rawIdx, dataParams);
- }
- if (isFunction(symbolOffset)) {
- symbolOffset = symbolOffset(rawIdx, dataParams);
- }
- }
- var style = itemModel.getModel("itemStyle").getItemStyle();
- var color = getVisualFromData(seriesData, "color");
- if (!style.fill) {
- style.fill = color;
- }
- mpData.setItemVisual(idx, {
- symbol,
- symbolSize,
- symbolRotate,
- symbolOffset,
- symbolKeepAspect,
- style
- });
- });
- symbolDraw.updateData(mpData);
- this.group.add(symbolDraw.group);
- mpData.eachItemGraphicEl(function(el) {
- el.traverse(function(child) {
- getECData(child).dataModel = mpModel;
- });
- });
- this.markKeep(symbolDraw);
- symbolDraw.group.silent = mpModel.get("silent") || seriesModel.get("silent");
- };
- MarkPointView2.type = "markPoint";
- return MarkPointView2;
- }(MarkerView_default);
- function createData(coordSys, seriesModel, mpModel) {
- var coordDimsInfos;
- if (coordSys) {
- coordDimsInfos = map(coordSys && coordSys.dimensions, function(coordDim) {
- var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};
- return extend(extend({}, info), {
- name: coordDim,
- ordinalMeta: null
- });
- });
- } else {
- coordDimsInfos = [{
- name: "value",
- type: "float"
- }];
- }
- var mpData = new SeriesData_default(coordDimsInfos, mpModel);
- var dataOpt = map(mpModel.get("data"), curry(dataTransform, seriesModel));
- if (coordSys) {
- dataOpt = filter(dataOpt, curry(dataFilter, coordSys));
- }
- var dimValueGetter = createMarkerDimValueGetter(!!coordSys, coordDimsInfos);
- mpData.initData(dataOpt, null, dimValueGetter);
- return mpData;
- }
- var MarkPointView_default = MarkPointView;
- // node_modules/echarts/lib/component/marker/installMarkPoint.js
- function install17(registers) {
- registers.registerComponentModel(MarkPointModel_default);
- registers.registerComponentView(MarkPointView_default);
- registers.registerPreprocessor(function(opt) {
- if (checkMarkerInSeries(opt.series, "markPoint")) {
- opt.markPoint = opt.markPoint || {};
- }
- });
- }
- // node_modules/echarts/lib/component/marker/installMarkLine.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/marker/MarkLineModel.js
- init_define_APP_INFO();
- var MarkLineModel = function(_super) {
- __extends(MarkLineModel2, _super);
- function MarkLineModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = MarkLineModel2.type;
- return _this;
- }
- MarkLineModel2.prototype.createMarkerModelFromSeries = function(markerOpt, masterMarkerModel, ecModel) {
- return new MarkLineModel2(markerOpt, masterMarkerModel, ecModel);
- };
- MarkLineModel2.type = "markLine";
- MarkLineModel2.defaultOption = {
- z: 5,
- symbol: ["circle", "arrow"],
- symbolSize: [8, 16],
- symbolOffset: 0,
- precision: 2,
- tooltip: {
- trigger: "item"
- },
- label: {
- show: true,
- position: "end",
- distance: 5
- },
- lineStyle: {
- type: "dashed"
- },
- emphasis: {
- label: {
- show: true
- },
- lineStyle: {
- width: 3
- }
- },
- animationEasing: "linear"
- };
- return MarkLineModel2;
- }(MarkerModel_default);
- var MarkLineModel_default = MarkLineModel;
- // node_modules/echarts/lib/component/marker/MarkLineView.js
- init_define_APP_INFO();
- var inner9 = makeInner();
- var markLineTransform = function(seriesModel, coordSys, mlModel, item) {
- var data = seriesModel.getData();
- var itemArray;
- if (!isArray(item)) {
- var mlType = item.type;
- if (mlType === "min" || mlType === "max" || mlType === "average" || mlType === "median" || item.xAxis != null || item.yAxis != null) {
- var valueAxis = void 0;
- var value = void 0;
- if (item.yAxis != null || item.xAxis != null) {
- valueAxis = coordSys.getAxis(item.yAxis != null ? "y" : "x");
- value = retrieve(item.yAxis, item.xAxis);
- } else {
- var axisInfo = getAxisInfo2(item, data, coordSys, seriesModel);
- valueAxis = axisInfo.valueAxis;
- var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);
- value = numCalculate(data, valueDataDim, mlType);
- }
- var valueIndex = valueAxis.dim === "x" ? 0 : 1;
- var baseIndex = 1 - valueIndex;
- var mlFrom = clone(item);
- var mlTo = {
- coord: []
- };
- mlFrom.type = null;
- mlFrom.coord = [];
- mlFrom.coord[baseIndex] = -Infinity;
- mlTo.coord[baseIndex] = Infinity;
- var precision = mlModel.get("precision");
- if (precision >= 0 && isNumber(value)) {
- value = +value.toFixed(Math.min(precision, 20));
- }
- mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;
- itemArray = [mlFrom, mlTo, {
- type: mlType,
- valueIndex: item.valueIndex,
- value
- }];
- } else {
- if (true) {
- logError("Invalid markLine data.");
- }
- itemArray = [];
- }
- } else {
- itemArray = item;
- }
- var normalizedItem = [dataTransform(seriesModel, itemArray[0]), dataTransform(seriesModel, itemArray[1]), extend({}, itemArray[2])];
- normalizedItem[2].type = normalizedItem[2].type || null;
- merge(normalizedItem[2], normalizedItem[0]);
- merge(normalizedItem[2], normalizedItem[1]);
- return normalizedItem;
- };
- function isInifinity(val) {
- return !isNaN(val) && !isFinite(val);
- }
- function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {
- var otherDimIndex = 1 - dimIndex;
- var dimName = coordSys.dimensions[dimIndex];
- return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);
- }
- function markLineFilter(coordSys, item) {
- if (coordSys.type === "cartesian2d") {
- var fromCoord = item[0].coord;
- var toCoord = item[1].coord;
- if (fromCoord && toCoord && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) {
- return true;
- }
- }
- return dataFilter(coordSys, item[0]) && dataFilter(coordSys, item[1]);
- }
- function updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) {
- var coordSys = seriesModel.coordinateSystem;
- var itemModel = data.getItemModel(idx);
- var point;
- var xPx = parsePercent2(itemModel.get("x"), api.getWidth());
- var yPx = parsePercent2(itemModel.get("y"), api.getHeight());
- if (!isNaN(xPx) && !isNaN(yPx)) {
- point = [xPx, yPx];
- } else {
- if (seriesModel.getMarkerPosition) {
- point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx));
- } else {
- var dims = coordSys.dimensions;
- var x = data.get(dims[0], idx);
- var y = data.get(dims[1], idx);
- point = coordSys.dataToPoint([x, y]);
- }
- if (isCoordinateSystemType(coordSys, "cartesian2d")) {
- var xAxis = coordSys.getAxis("x");
- var yAxis = coordSys.getAxis("y");
- var dims = coordSys.dimensions;
- if (isInifinity(data.get(dims[0], idx))) {
- point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);
- } else if (isInifinity(data.get(dims[1], idx))) {
- point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);
- }
- }
- if (!isNaN(xPx)) {
- point[0] = xPx;
- }
- if (!isNaN(yPx)) {
- point[1] = yPx;
- }
- }
- data.setItemLayout(idx, point);
- }
- var MarkLineView = function(_super) {
- __extends(MarkLineView2, _super);
- function MarkLineView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = MarkLineView2.type;
- return _this;
- }
- MarkLineView2.prototype.updateTransform = function(markLineModel, ecModel, api) {
- ecModel.eachSeries(function(seriesModel) {
- var mlModel = MarkerModel_default.getMarkerModelFromSeries(seriesModel, "markLine");
- if (mlModel) {
- var mlData_1 = mlModel.getData();
- var fromData_1 = inner9(mlModel).from;
- var toData_1 = inner9(mlModel).to;
- fromData_1.each(function(idx) {
- updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api);
- updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api);
- });
- mlData_1.each(function(idx) {
- mlData_1.setItemLayout(idx, [fromData_1.getItemLayout(idx), toData_1.getItemLayout(idx)]);
- });
- this.markerGroupMap.get(seriesModel.id).updateLayout();
- }
- }, this);
- };
- MarkLineView2.prototype.renderSeries = function(seriesModel, mlModel, ecModel, api) {
- var coordSys = seriesModel.coordinateSystem;
- var seriesId = seriesModel.id;
- var seriesData = seriesModel.getData();
- var lineDrawMap = this.markerGroupMap;
- var lineDraw = lineDrawMap.get(seriesId) || lineDrawMap.set(seriesId, new LineDraw_default());
- this.group.add(lineDraw.group);
- var mlData = createList(coordSys, seriesModel, mlModel);
- var fromData = mlData.from;
- var toData = mlData.to;
- var lineData = mlData.line;
- inner9(mlModel).from = fromData;
- inner9(mlModel).to = toData;
- mlModel.setData(lineData);
- var symbolType = mlModel.get("symbol");
- var symbolSize = mlModel.get("symbolSize");
- var symbolRotate = mlModel.get("symbolRotate");
- var symbolOffset = mlModel.get("symbolOffset");
- if (!isArray(symbolType)) {
- symbolType = [symbolType, symbolType];
- }
- if (!isArray(symbolSize)) {
- symbolSize = [symbolSize, symbolSize];
- }
- if (!isArray(symbolRotate)) {
- symbolRotate = [symbolRotate, symbolRotate];
- }
- if (!isArray(symbolOffset)) {
- symbolOffset = [symbolOffset, symbolOffset];
- }
- mlData.from.each(function(idx) {
- updateDataVisualAndLayout(fromData, idx, true);
- updateDataVisualAndLayout(toData, idx, false);
- });
- lineData.each(function(idx) {
- var lineStyle = lineData.getItemModel(idx).getModel("lineStyle").getLineStyle();
- lineData.setItemLayout(idx, [fromData.getItemLayout(idx), toData.getItemLayout(idx)]);
- if (lineStyle.stroke == null) {
- lineStyle.stroke = fromData.getItemVisual(idx, "style").fill;
- }
- lineData.setItemVisual(idx, {
- fromSymbolKeepAspect: fromData.getItemVisual(idx, "symbolKeepAspect"),
- fromSymbolOffset: fromData.getItemVisual(idx, "symbolOffset"),
- fromSymbolRotate: fromData.getItemVisual(idx, "symbolRotate"),
- fromSymbolSize: fromData.getItemVisual(idx, "symbolSize"),
- fromSymbol: fromData.getItemVisual(idx, "symbol"),
- toSymbolKeepAspect: toData.getItemVisual(idx, "symbolKeepAspect"),
- toSymbolOffset: toData.getItemVisual(idx, "symbolOffset"),
- toSymbolRotate: toData.getItemVisual(idx, "symbolRotate"),
- toSymbolSize: toData.getItemVisual(idx, "symbolSize"),
- toSymbol: toData.getItemVisual(idx, "symbol"),
- style: lineStyle
- });
- });
- lineDraw.updateData(lineData);
- mlData.line.eachItemGraphicEl(function(el) {
- getECData(el).dataModel = mlModel;
- el.traverse(function(child) {
- getECData(child).dataModel = mlModel;
- });
- });
- function updateDataVisualAndLayout(data, idx, isFrom) {
- var itemModel = data.getItemModel(idx);
- updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api);
- var style = itemModel.getModel("itemStyle").getItemStyle();
- if (style.fill == null) {
- style.fill = getVisualFromData(seriesData, "color");
- }
- data.setItemVisual(idx, {
- symbolKeepAspect: itemModel.get("symbolKeepAspect"),
- symbolOffset: retrieve2(itemModel.get("symbolOffset", true), symbolOffset[isFrom ? 0 : 1]),
- symbolRotate: retrieve2(itemModel.get("symbolRotate", true), symbolRotate[isFrom ? 0 : 1]),
- symbolSize: retrieve2(itemModel.get("symbolSize"), symbolSize[isFrom ? 0 : 1]),
- symbol: retrieve2(itemModel.get("symbol", true), symbolType[isFrom ? 0 : 1]),
- style
- });
- }
- this.markKeep(lineDraw);
- lineDraw.group.silent = mlModel.get("silent") || seriesModel.get("silent");
- };
- MarkLineView2.type = "markLine";
- return MarkLineView2;
- }(MarkerView_default);
- function createList(coordSys, seriesModel, mlModel) {
- var coordDimsInfos;
- if (coordSys) {
- coordDimsInfos = map(coordSys && coordSys.dimensions, function(coordDim) {
- var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};
- return extend(extend({}, info), {
- name: coordDim,
- ordinalMeta: null
- });
- });
- } else {
- coordDimsInfos = [{
- name: "value",
- type: "float"
- }];
- }
- var fromData = new SeriesData_default(coordDimsInfos, mlModel);
- var toData = new SeriesData_default(coordDimsInfos, mlModel);
- var lineData = new SeriesData_default([], mlModel);
- var optData = map(mlModel.get("data"), curry(markLineTransform, seriesModel, coordSys, mlModel));
- if (coordSys) {
- optData = filter(optData, curry(markLineFilter, coordSys));
- }
- var dimValueGetter = createMarkerDimValueGetter(!!coordSys, coordDimsInfos);
- fromData.initData(map(optData, function(item) {
- return item[0];
- }), null, dimValueGetter);
- toData.initData(map(optData, function(item) {
- return item[1];
- }), null, dimValueGetter);
- lineData.initData(map(optData, function(item) {
- return item[2];
- }));
- lineData.hasItemOption = true;
- return {
- from: fromData,
- to: toData,
- line: lineData
- };
- }
- var MarkLineView_default = MarkLineView;
- // node_modules/echarts/lib/component/marker/installMarkLine.js
- function install18(registers) {
- registers.registerComponentModel(MarkLineModel_default);
- registers.registerComponentView(MarkLineView_default);
- registers.registerPreprocessor(function(opt) {
- if (checkMarkerInSeries(opt.series, "markLine")) {
- opt.markLine = opt.markLine || {};
- }
- });
- }
- // node_modules/echarts/lib/component/marker/installMarkArea.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/marker/MarkAreaModel.js
- init_define_APP_INFO();
- var MarkAreaModel = function(_super) {
- __extends(MarkAreaModel2, _super);
- function MarkAreaModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = MarkAreaModel2.type;
- return _this;
- }
- MarkAreaModel2.prototype.createMarkerModelFromSeries = function(markerOpt, masterMarkerModel, ecModel) {
- return new MarkAreaModel2(markerOpt, masterMarkerModel, ecModel);
- };
- MarkAreaModel2.type = "markArea";
- MarkAreaModel2.defaultOption = {
- z: 1,
- tooltip: {
- trigger: "item"
- },
- animation: false,
- label: {
- show: true,
- position: "top"
- },
- itemStyle: {
- borderWidth: 0
- },
- emphasis: {
- label: {
- show: true,
- position: "top"
- }
- }
- };
- return MarkAreaModel2;
- }(MarkerModel_default);
- var MarkAreaModel_default = MarkAreaModel;
- // node_modules/echarts/lib/component/marker/MarkAreaView.js
- init_define_APP_INFO();
- var inner10 = makeInner();
- var markAreaTransform = function(seriesModel, coordSys, maModel, item) {
- var lt = dataTransform(seriesModel, item[0]);
- var rb = dataTransform(seriesModel, item[1]);
- var ltCoord = lt.coord;
- var rbCoord = rb.coord;
- ltCoord[0] = retrieve(ltCoord[0], -Infinity);
- ltCoord[1] = retrieve(ltCoord[1], -Infinity);
- rbCoord[0] = retrieve(rbCoord[0], Infinity);
- rbCoord[1] = retrieve(rbCoord[1], Infinity);
- var result = mergeAll([{}, lt, rb]);
- result.coord = [lt.coord, rb.coord];
- result.x0 = lt.x;
- result.y0 = lt.y;
- result.x1 = rb.x;
- result.y1 = rb.y;
- return result;
- };
- function isInifinity2(val) {
- return !isNaN(val) && !isFinite(val);
- }
- function ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {
- var otherDimIndex = 1 - dimIndex;
- return isInifinity2(fromCoord[otherDimIndex]) && isInifinity2(toCoord[otherDimIndex]);
- }
- function markAreaFilter(coordSys, item) {
- var fromCoord = item.coord[0];
- var toCoord = item.coord[1];
- var item0 = {
- coord: fromCoord,
- x: item.x0,
- y: item.y0
- };
- var item1 = {
- coord: toCoord,
- x: item.x1,
- y: item.y1
- };
- if (isCoordinateSystemType(coordSys, "cartesian2d")) {
- if (fromCoord && toCoord && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord, coordSys))) {
- return true;
- }
- return zoneFilter(coordSys, item0, item1);
- }
- return dataFilter(coordSys, item0) || dataFilter(coordSys, item1);
- }
- function getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) {
- var coordSys = seriesModel.coordinateSystem;
- var itemModel = data.getItemModel(idx);
- var point;
- var xPx = parsePercent2(itemModel.get(dims[0]), api.getWidth());
- var yPx = parsePercent2(itemModel.get(dims[1]), api.getHeight());
- if (!isNaN(xPx) && !isNaN(yPx)) {
- point = [xPx, yPx];
- } else {
- if (seriesModel.getMarkerPosition) {
- point = seriesModel.getMarkerPosition(data.getValues(dims, idx));
- } else {
- var x = data.get(dims[0], idx);
- var y = data.get(dims[1], idx);
- var pt = [x, y];
- coordSys.clampData && coordSys.clampData(pt, pt);
- point = coordSys.dataToPoint(pt, true);
- }
- if (isCoordinateSystemType(coordSys, "cartesian2d")) {
- var xAxis = coordSys.getAxis("x");
- var yAxis = coordSys.getAxis("y");
- var x = data.get(dims[0], idx);
- var y = data.get(dims[1], idx);
- if (isInifinity2(x)) {
- point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === "x0" ? 0 : 1]);
- } else if (isInifinity2(y)) {
- point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === "y0" ? 0 : 1]);
- }
- }
- if (!isNaN(xPx)) {
- point[0] = xPx;
- }
- if (!isNaN(yPx)) {
- point[1] = yPx;
- }
- }
- return point;
- }
- var dimPermutations = [["x0", "y0"], ["x1", "y0"], ["x1", "y1"], ["x0", "y1"]];
- var MarkAreaView = function(_super) {
- __extends(MarkAreaView2, _super);
- function MarkAreaView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = MarkAreaView2.type;
- return _this;
- }
- MarkAreaView2.prototype.updateTransform = function(markAreaModel, ecModel, api) {
- ecModel.eachSeries(function(seriesModel) {
- var maModel = MarkerModel_default.getMarkerModelFromSeries(seriesModel, "markArea");
- if (maModel) {
- var areaData_1 = maModel.getData();
- areaData_1.each(function(idx) {
- var points = map(dimPermutations, function(dim) {
- return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api);
- });
- areaData_1.setItemLayout(idx, points);
- var el = areaData_1.getItemGraphicEl(idx);
- el.setShape("points", points);
- });
- }
- }, this);
- };
- MarkAreaView2.prototype.renderSeries = function(seriesModel, maModel, ecModel, api) {
- var coordSys = seriesModel.coordinateSystem;
- var seriesId = seriesModel.id;
- var seriesData = seriesModel.getData();
- var areaGroupMap = this.markerGroupMap;
- var polygonGroup = areaGroupMap.get(seriesId) || areaGroupMap.set(seriesId, {
- group: new Group_default()
- });
- this.group.add(polygonGroup.group);
- this.markKeep(polygonGroup);
- var areaData = createList2(coordSys, seriesModel, maModel);
- maModel.setData(areaData);
- areaData.each(function(idx) {
- var points = map(dimPermutations, function(dim) {
- return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);
- });
- var xAxisScale = coordSys.getAxis("x").scale;
- var yAxisScale = coordSys.getAxis("y").scale;
- var xAxisExtent = xAxisScale.getExtent();
- var yAxisExtent = yAxisScale.getExtent();
- var xPointExtent = [xAxisScale.parse(areaData.get("x0", idx)), xAxisScale.parse(areaData.get("x1", idx))];
- var yPointExtent = [yAxisScale.parse(areaData.get("y0", idx)), yAxisScale.parse(areaData.get("y1", idx))];
- asc(xPointExtent);
- asc(yPointExtent);
- var overlapped = !(xAxisExtent[0] > xPointExtent[1] || xAxisExtent[1] < xPointExtent[0] || yAxisExtent[0] > yPointExtent[1] || yAxisExtent[1] < yPointExtent[0]);
- var allClipped = !overlapped;
- areaData.setItemLayout(idx, {
- points,
- allClipped
- });
- var style = areaData.getItemModel(idx).getModel("itemStyle").getItemStyle();
- var color = getVisualFromData(seriesData, "color");
- if (!style.fill) {
- style.fill = color;
- if (isString(style.fill)) {
- style.fill = modifyAlpha(style.fill, 0.4);
- }
- }
- if (!style.stroke) {
- style.stroke = color;
- }
- areaData.setItemVisual(idx, "style", style);
- });
- areaData.diff(inner10(polygonGroup).data).add(function(idx) {
- var layout4 = areaData.getItemLayout(idx);
- if (!layout4.allClipped) {
- var polygon = new Polygon_default({
- shape: {
- points: layout4.points
- }
- });
- areaData.setItemGraphicEl(idx, polygon);
- polygonGroup.group.add(polygon);
- }
- }).update(function(newIdx, oldIdx) {
- var polygon = inner10(polygonGroup).data.getItemGraphicEl(oldIdx);
- var layout4 = areaData.getItemLayout(newIdx);
- if (!layout4.allClipped) {
- if (polygon) {
- updateProps(polygon, {
- shape: {
- points: layout4.points
- }
- }, maModel, newIdx);
- } else {
- polygon = new Polygon_default({
- shape: {
- points: layout4.points
- }
- });
- }
- areaData.setItemGraphicEl(newIdx, polygon);
- polygonGroup.group.add(polygon);
- } else if (polygon) {
- polygonGroup.group.remove(polygon);
- }
- }).remove(function(idx) {
- var polygon = inner10(polygonGroup).data.getItemGraphicEl(idx);
- polygonGroup.group.remove(polygon);
- }).execute();
- areaData.eachItemGraphicEl(function(polygon, idx) {
- var itemModel = areaData.getItemModel(idx);
- var style = areaData.getItemVisual(idx, "style");
- polygon.useStyle(areaData.getItemVisual(idx, "style"));
- setLabelStyle(polygon, getLabelStatesModels(itemModel), {
- labelFetcher: maModel,
- labelDataIndex: idx,
- defaultText: areaData.getName(idx) || "",
- inheritColor: isString(style.fill) ? modifyAlpha(style.fill, 1) : "#000"
- });
- setStatesStylesFromModel(polygon, itemModel);
- toggleHoverEmphasis(polygon, null, null, itemModel.get(["emphasis", "disabled"]));
- getECData(polygon).dataModel = maModel;
- });
- inner10(polygonGroup).data = areaData;
- polygonGroup.group.silent = maModel.get("silent") || seriesModel.get("silent");
- };
- MarkAreaView2.type = "markArea";
- return MarkAreaView2;
- }(MarkerView_default);
- function createList2(coordSys, seriesModel, maModel) {
- var areaData;
- var dataDims;
- var dims = ["x0", "y0", "x1", "y1"];
- if (coordSys) {
- var coordDimsInfos_1 = map(coordSys && coordSys.dimensions, function(coordDim) {
- var data = seriesModel.getData();
- var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {};
- return extend(extend({}, info), {
- name: coordDim,
- ordinalMeta: null
- });
- });
- dataDims = map(dims, function(dim, idx) {
- return {
- name: dim,
- type: coordDimsInfos_1[idx % 2].type
- };
- });
- areaData = new SeriesData_default(dataDims, maModel);
- } else {
- dataDims = [{
- name: "value",
- type: "float"
- }];
- areaData = new SeriesData_default(dataDims, maModel);
- }
- var optData = map(maModel.get("data"), curry(markAreaTransform, seriesModel, coordSys, maModel));
- if (coordSys) {
- optData = filter(optData, curry(markAreaFilter, coordSys));
- }
- var dimValueGetter = coordSys ? function(item, dimName, dataIndex, dimIndex) {
- var rawVal = item.coord[Math.floor(dimIndex / 2)][dimIndex % 2];
- return parseDataValue(rawVal, dataDims[dimIndex]);
- } : function(item, dimName, dataIndex, dimIndex) {
- return parseDataValue(item.value, dataDims[dimIndex]);
- };
- areaData.initData(optData, null, dimValueGetter);
- areaData.hasItemOption = true;
- return areaData;
- }
- var MarkAreaView_default = MarkAreaView;
- // node_modules/echarts/lib/component/marker/installMarkArea.js
- function install19(registers) {
- registers.registerComponentModel(MarkAreaModel_default);
- registers.registerComponentView(MarkAreaView_default);
- registers.registerPreprocessor(function(opt) {
- if (checkMarkerInSeries(opt.series, "markArea")) {
- opt.markArea = opt.markArea || {};
- }
- });
- }
- // node_modules/echarts/lib/component/legend/install.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/legend/installLegendPlain.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/legend/LegendModel.js
- init_define_APP_INFO();
- var getDefaultSelectorOptions = function(ecModel, type) {
- if (type === "all") {
- return {
- type: "all",
- title: ecModel.getLocaleModel().get(["legend", "selector", "all"])
- };
- } else if (type === "inverse") {
- return {
- type: "inverse",
- title: ecModel.getLocaleModel().get(["legend", "selector", "inverse"])
- };
- }
- };
- var LegendModel = function(_super) {
- __extends(LegendModel2, _super);
- function LegendModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = LegendModel2.type;
- _this.layoutMode = {
- type: "box",
- ignoreSize: true
- };
- return _this;
- }
- LegendModel2.prototype.init = function(option, parentModel, ecModel) {
- this.mergeDefaultAndTheme(option, ecModel);
- option.selected = option.selected || {};
- this._updateSelector(option);
- };
- LegendModel2.prototype.mergeOption = function(option, ecModel) {
- _super.prototype.mergeOption.call(this, option, ecModel);
- this._updateSelector(option);
- };
- LegendModel2.prototype._updateSelector = function(option) {
- var selector2 = option.selector;
- var ecModel = this.ecModel;
- if (selector2 === true) {
- selector2 = option.selector = ["all", "inverse"];
- }
- if (isArray(selector2)) {
- each(selector2, function(item, index) {
- isString(item) && (item = {
- type: item
- });
- selector2[index] = merge(item, getDefaultSelectorOptions(ecModel, item.type));
- });
- }
- };
- LegendModel2.prototype.optionUpdated = function() {
- this._updateData(this.ecModel);
- var legendData = this._data;
- if (legendData[0] && this.get("selectedMode") === "single") {
- var hasSelected = false;
- for (var i = 0; i < legendData.length; i++) {
- var name_1 = legendData[i].get("name");
- if (this.isSelected(name_1)) {
- this.select(name_1);
- hasSelected = true;
- break;
- }
- }
- !hasSelected && this.select(legendData[0].get("name"));
- }
- };
- LegendModel2.prototype._updateData = function(ecModel) {
- var potentialData = [];
- var availableNames = [];
- ecModel.eachRawSeries(function(seriesModel) {
- var seriesName = seriesModel.name;
- availableNames.push(seriesName);
- var isPotential;
- if (seriesModel.legendVisualProvider) {
- var provider = seriesModel.legendVisualProvider;
- var names = provider.getAllNames();
- if (!ecModel.isSeriesFiltered(seriesModel)) {
- availableNames = availableNames.concat(names);
- }
- if (names.length) {
- potentialData = potentialData.concat(names);
- } else {
- isPotential = true;
- }
- } else {
- isPotential = true;
- }
- if (isPotential && isNameSpecified(seriesModel)) {
- potentialData.push(seriesModel.name);
- }
- });
- this._availableNames = availableNames;
- var rawData = this.get("data") || potentialData;
- var legendData = map(rawData, function(dataItem) {
- if (isString(dataItem) || isNumber(dataItem)) {
- dataItem = {
- name: dataItem
- };
- }
- return new Model_default(dataItem, this, this.ecModel);
- }, this);
- this._data = legendData;
- };
- LegendModel2.prototype.getData = function() {
- return this._data;
- };
- LegendModel2.prototype.select = function(name) {
- var selected = this.option.selected;
- var selectedMode = this.get("selectedMode");
- if (selectedMode === "single") {
- var data = this._data;
- each(data, function(dataItem) {
- selected[dataItem.get("name")] = false;
- });
- }
- selected[name] = true;
- };
- LegendModel2.prototype.unSelect = function(name) {
- if (this.get("selectedMode") !== "single") {
- this.option.selected[name] = false;
- }
- };
- LegendModel2.prototype.toggleSelected = function(name) {
- var selected = this.option.selected;
- if (!selected.hasOwnProperty(name)) {
- selected[name] = true;
- }
- this[selected[name] ? "unSelect" : "select"](name);
- };
- LegendModel2.prototype.allSelect = function() {
- var data = this._data;
- var selected = this.option.selected;
- each(data, function(dataItem) {
- selected[dataItem.get("name", true)] = true;
- });
- };
- LegendModel2.prototype.inverseSelect = function() {
- var data = this._data;
- var selected = this.option.selected;
- each(data, function(dataItem) {
- var name = dataItem.get("name", true);
- if (!selected.hasOwnProperty(name)) {
- selected[name] = true;
- }
- selected[name] = !selected[name];
- });
- };
- LegendModel2.prototype.isSelected = function(name) {
- var selected = this.option.selected;
- return !(selected.hasOwnProperty(name) && !selected[name]) && indexOf(this._availableNames, name) >= 0;
- };
- LegendModel2.prototype.getOrient = function() {
- return this.get("orient") === "vertical" ? {
- index: 1,
- name: "vertical"
- } : {
- index: 0,
- name: "horizontal"
- };
- };
- LegendModel2.type = "legend.plain";
- LegendModel2.dependencies = ["series"];
- LegendModel2.defaultOption = {
- z: 4,
- show: true,
- orient: "horizontal",
- left: "center",
- top: 0,
- align: "auto",
- backgroundColor: "rgba(0,0,0,0)",
- borderColor: "#ccc",
- borderRadius: 0,
- borderWidth: 0,
- padding: 5,
- itemGap: 10,
- itemWidth: 25,
- itemHeight: 14,
- symbolRotate: "inherit",
- symbolKeepAspect: true,
- inactiveColor: "#ccc",
- inactiveBorderColor: "#ccc",
- inactiveBorderWidth: "auto",
- itemStyle: {
- color: "inherit",
- opacity: "inherit",
- borderColor: "inherit",
- borderWidth: "auto",
- borderCap: "inherit",
- borderJoin: "inherit",
- borderDashOffset: "inherit",
- borderMiterLimit: "inherit"
- },
- lineStyle: {
- width: "auto",
- color: "inherit",
- inactiveColor: "#ccc",
- inactiveWidth: 2,
- opacity: "inherit",
- type: "inherit",
- cap: "inherit",
- join: "inherit",
- dashOffset: "inherit",
- miterLimit: "inherit"
- },
- textStyle: {
- color: "#333"
- },
- selectedMode: true,
- selector: false,
- selectorLabel: {
- show: true,
- borderRadius: 10,
- padding: [3, 5, 3, 5],
- fontSize: 12,
- fontFamily: "sans-serif",
- color: "#666",
- borderWidth: 1,
- borderColor: "#666"
- },
- emphasis: {
- selectorLabel: {
- show: true,
- color: "#eee",
- backgroundColor: "#666"
- }
- },
- selectorPosition: "auto",
- selectorItemGap: 7,
- selectorButtonGap: 10,
- tooltip: {
- show: false
- }
- };
- return LegendModel2;
- }(Component_default);
- var LegendModel_default = LegendModel;
- // node_modules/echarts/lib/component/legend/LegendView.js
- init_define_APP_INFO();
- var curry2 = curry;
- var each7 = each;
- var Group = Group_default;
- var LegendView = function(_super) {
- __extends(LegendView2, _super);
- function LegendView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = LegendView2.type;
- _this.newlineDisabled = false;
- return _this;
- }
- LegendView2.prototype.init = function() {
- this.group.add(this._contentGroup = new Group());
- this.group.add(this._selectorGroup = new Group());
- this._isFirstRender = true;
- };
- LegendView2.prototype.getContentGroup = function() {
- return this._contentGroup;
- };
- LegendView2.prototype.getSelectorGroup = function() {
- return this._selectorGroup;
- };
- LegendView2.prototype.render = function(legendModel, ecModel, api) {
- var isFirstRender = this._isFirstRender;
- this._isFirstRender = false;
- this.resetInner();
- if (!legendModel.get("show", true)) {
- return;
- }
- var itemAlign = legendModel.get("align");
- var orient = legendModel.get("orient");
- if (!itemAlign || itemAlign === "auto") {
- itemAlign = legendModel.get("left") === "right" && orient === "vertical" ? "right" : "left";
- }
- var selector2 = legendModel.get("selector", true);
- var selectorPosition = legendModel.get("selectorPosition", true);
- if (selector2 && (!selectorPosition || selectorPosition === "auto")) {
- selectorPosition = orient === "horizontal" ? "end" : "start";
- }
- this.renderInner(itemAlign, legendModel, ecModel, api, selector2, orient, selectorPosition);
- var positionInfo = legendModel.getBoxLayoutParams();
- var viewportSize = {
- width: api.getWidth(),
- height: api.getHeight()
- };
- var padding = legendModel.get("padding");
- var maxSize = getLayoutRect(positionInfo, viewportSize, padding);
- var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector2, selectorPosition);
- var layoutRect = getLayoutRect(defaults({
- width: mainRect.width,
- height: mainRect.height
- }, positionInfo), viewportSize, padding);
- this.group.x = layoutRect.x - mainRect.x;
- this.group.y = layoutRect.y - mainRect.y;
- this.group.markRedraw();
- this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));
- };
- LegendView2.prototype.resetInner = function() {
- this.getContentGroup().removeAll();
- this._backgroundEl && this.group.remove(this._backgroundEl);
- this.getSelectorGroup().removeAll();
- };
- LegendView2.prototype.renderInner = function(itemAlign, legendModel, ecModel, api, selector2, orient, selectorPosition) {
- var contentGroup = this.getContentGroup();
- var legendDrawnMap = createHashMap();
- var selectMode = legendModel.get("selectedMode");
- var excludeSeriesId = [];
- ecModel.eachRawSeries(function(seriesModel) {
- !seriesModel.get("legendHoverLink") && excludeSeriesId.push(seriesModel.id);
- });
- each7(legendModel.getData(), function(legendItemModel, dataIndex) {
- var name = legendItemModel.get("name");
- if (!this.newlineDisabled && (name === "" || name === "\n")) {
- var g = new Group();
- g.newline = true;
- contentGroup.add(g);
- return;
- }
- var seriesModel = ecModel.getSeriesByName(name)[0];
- if (legendDrawnMap.get(name)) {
- return;
- }
- if (seriesModel) {
- var data = seriesModel.getData();
- var lineVisualStyle = data.getVisual("legendLineStyle") || {};
- var legendIcon = data.getVisual("legendIcon");
- var style = data.getVisual("style");
- var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, style, legendIcon, selectMode, api);
- 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));
- legendDrawnMap.set(name, true);
- } else {
- ecModel.eachRawSeries(function(seriesModel2) {
- if (legendDrawnMap.get(name)) {
- return;
- }
- if (seriesModel2.legendVisualProvider) {
- var provider = seriesModel2.legendVisualProvider;
- if (!provider.containName(name)) {
- return;
- }
- var idx = provider.indexOfName(name);
- var style2 = provider.getItemVisual(idx, "style");
- var legendIcon2 = provider.getItemVisual(idx, "legendIcon");
- var colorArr = parse(style2.fill);
- if (colorArr && colorArr[3] === 0) {
- colorArr[3] = 0.2;
- style2 = extend(extend({}, style2), {
- fill: stringify(colorArr, "rgba")
- });
- }
- var itemGroup2 = this._createItem(seriesModel2, name, dataIndex, legendItemModel, legendModel, itemAlign, {}, style2, legendIcon2, selectMode, api);
- 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));
- legendDrawnMap.set(name, true);
- }
- }, this);
- }
- if (true) {
- if (!legendDrawnMap.get(name)) {
- console.warn(name + " series not exists. Legend data should be same with series name or data name.");
- }
- }
- }, this);
- if (selector2) {
- this._createSelector(selector2, legendModel, api, orient, selectorPosition);
- }
- };
- LegendView2.prototype._createSelector = function(selector2, legendModel, api, orient, selectorPosition) {
- var selectorGroup = this.getSelectorGroup();
- each7(selector2, function createSelectorButton(selectorItem) {
- var type = selectorItem.type;
- var labelText = new Text_default({
- style: {
- x: 0,
- y: 0,
- align: "center",
- verticalAlign: "middle"
- },
- onclick: function() {
- api.dispatchAction({
- type: type === "all" ? "legendAllSelect" : "legendInverseSelect"
- });
- }
- });
- selectorGroup.add(labelText);
- var labelModel = legendModel.getModel("selectorLabel");
- var emphasisLabelModel = legendModel.getModel(["emphasis", "selectorLabel"]);
- setLabelStyle(labelText, {
- normal: labelModel,
- emphasis: emphasisLabelModel
- }, {
- defaultText: selectorItem.title
- });
- enableHoverEmphasis(labelText);
- });
- };
- LegendView2.prototype._createItem = function(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, itemVisualStyle, legendIcon, selectMode, api) {
- var drawType = seriesModel.visualDrawType;
- var itemWidth = legendModel.get("itemWidth");
- var itemHeight = legendModel.get("itemHeight");
- var isSelected = legendModel.isSelected(name);
- var iconRotate = legendItemModel.get("symbolRotate");
- var symbolKeepAspect = legendItemModel.get("symbolKeepAspect");
- var legendIconType = legendItemModel.get("icon");
- legendIcon = legendIconType || legendIcon || "roundRect";
- var style = getLegendStyle(legendIcon, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api);
- var itemGroup = new Group();
- var textStyleModel = legendItemModel.getModel("textStyle");
- if (isFunction(seriesModel.getLegendIcon) && (!legendIconType || legendIconType === "inherit")) {
- itemGroup.add(seriesModel.getLegendIcon({
- itemWidth,
- itemHeight,
- icon: legendIcon,
- iconRotate,
- itemStyle: style.itemStyle,
- lineStyle: style.lineStyle,
- symbolKeepAspect
- }));
- } else {
- var rotate2 = legendIconType === "inherit" && seriesModel.getData().getVisual("symbol") ? iconRotate === "inherit" ? seriesModel.getData().getVisual("symbolRotate") : iconRotate : 0;
- itemGroup.add(getDefaultLegendIcon({
- itemWidth,
- itemHeight,
- icon: legendIcon,
- iconRotate: rotate2,
- itemStyle: style.itemStyle,
- lineStyle: style.lineStyle,
- symbolKeepAspect
- }));
- }
- var textX = itemAlign === "left" ? itemWidth + 5 : -5;
- var textAlign = itemAlign;
- var formatter = legendModel.get("formatter");
- var content = name;
- if (isString(formatter) && formatter) {
- content = formatter.replace("{name}", name != null ? name : "");
- } else if (isFunction(formatter)) {
- content = formatter(name);
- }
- var inactiveColor = legendItemModel.get("inactiveColor");
- itemGroup.add(new Text_default({
- style: createTextStyle(textStyleModel, {
- text: content,
- x: textX,
- y: itemHeight / 2,
- fill: isSelected ? textStyleModel.getTextColor() : inactiveColor,
- align: textAlign,
- verticalAlign: "middle"
- })
- }));
- var hitRect = new Rect_default({
- shape: itemGroup.getBoundingRect(),
- invisible: true
- });
- var tooltipModel = legendItemModel.getModel("tooltip");
- if (tooltipModel.get("show")) {
- setTooltipConfig({
- el: hitRect,
- componentModel: legendModel,
- itemName: name,
- itemTooltipOption: tooltipModel.option
- });
- }
- itemGroup.add(hitRect);
- itemGroup.eachChild(function(child) {
- child.silent = true;
- });
- hitRect.silent = !selectMode;
- this.getContentGroup().add(itemGroup);
- enableHoverEmphasis(itemGroup);
- itemGroup.__legendDataIndex = dataIndex;
- return itemGroup;
- };
- LegendView2.prototype.layoutInner = function(legendModel, itemAlign, maxSize, isFirstRender, selector2, selectorPosition) {
- var contentGroup = this.getContentGroup();
- var selectorGroup = this.getSelectorGroup();
- box(legendModel.get("orient"), contentGroup, legendModel.get("itemGap"), maxSize.width, maxSize.height);
- var contentRect = contentGroup.getBoundingRect();
- var contentPos = [-contentRect.x, -contentRect.y];
- selectorGroup.markRedraw();
- contentGroup.markRedraw();
- if (selector2) {
- box(
- "horizontal",
- selectorGroup,
- legendModel.get("selectorItemGap", true)
- );
- var selectorRect = selectorGroup.getBoundingRect();
- var selectorPos = [-selectorRect.x, -selectorRect.y];
- var selectorButtonGap = legendModel.get("selectorButtonGap", true);
- var orientIdx = legendModel.getOrient().index;
- var wh = orientIdx === 0 ? "width" : "height";
- var hw = orientIdx === 0 ? "height" : "width";
- var yx = orientIdx === 0 ? "y" : "x";
- if (selectorPosition === "end") {
- selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;
- } else {
- contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;
- }
- selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;
- selectorGroup.x = selectorPos[0];
- selectorGroup.y = selectorPos[1];
- contentGroup.x = contentPos[0];
- contentGroup.y = contentPos[1];
- var mainRect = {
- x: 0,
- y: 0
- };
- mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];
- mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);
- mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);
- return mainRect;
- } else {
- contentGroup.x = contentPos[0];
- contentGroup.y = contentPos[1];
- return this.group.getBoundingRect();
- }
- };
- LegendView2.prototype.remove = function() {
- this.getContentGroup().removeAll();
- this._isFirstRender = true;
- };
- LegendView2.type = "legend.plain";
- return LegendView2;
- }(Component_default2);
- function getLegendStyle(iconType, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api) {
- function handleCommonProps(style, visualStyle) {
- if (style.lineWidth === "auto") {
- style.lineWidth = visualStyle.lineWidth > 0 ? 2 : 0;
- }
- each7(style, function(propVal, propName) {
- style[propName] === "inherit" && (style[propName] = visualStyle[propName]);
- });
- }
- var itemStyleModel = legendItemModel.getModel("itemStyle");
- var itemStyle = itemStyleModel.getItemStyle();
- var iconBrushType = iconType.lastIndexOf("empty", 0) === 0 ? "fill" : "stroke";
- var decalStyle = itemStyleModel.getShallow("decal");
- itemStyle.decal = !decalStyle || decalStyle === "inherit" ? itemVisualStyle.decal : createOrUpdatePatternFromDecal(decalStyle, api);
- if (itemStyle.fill === "inherit") {
- itemStyle.fill = itemVisualStyle[drawType];
- }
- if (itemStyle.stroke === "inherit") {
- itemStyle.stroke = itemVisualStyle[iconBrushType];
- }
- if (itemStyle.opacity === "inherit") {
- itemStyle.opacity = (drawType === "fill" ? itemVisualStyle : lineVisualStyle).opacity;
- }
- handleCommonProps(itemStyle, itemVisualStyle);
- var legendLineModel = legendItemModel.getModel("lineStyle");
- var lineStyle = legendLineModel.getLineStyle();
- handleCommonProps(lineStyle, lineVisualStyle);
- itemStyle.fill === "auto" && (itemStyle.fill = itemVisualStyle.fill);
- itemStyle.stroke === "auto" && (itemStyle.stroke = itemVisualStyle.fill);
- lineStyle.stroke === "auto" && (lineStyle.stroke = itemVisualStyle.fill);
- if (!isSelected) {
- var borderWidth = legendItemModel.get("inactiveBorderWidth");
- var visualHasBorder = itemStyle[iconBrushType];
- itemStyle.lineWidth = borderWidth === "auto" ? itemVisualStyle.lineWidth > 0 && visualHasBorder ? 2 : 0 : itemStyle.lineWidth;
- itemStyle.fill = legendItemModel.get("inactiveColor");
- itemStyle.stroke = legendItemModel.get("inactiveBorderColor");
- lineStyle.stroke = legendLineModel.get("inactiveColor");
- lineStyle.lineWidth = legendLineModel.get("inactiveWidth");
- }
- return {
- itemStyle,
- lineStyle
- };
- }
- function getDefaultLegendIcon(opt) {
- var symboType = opt.icon || "roundRect";
- var icon = createSymbol(symboType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill, opt.symbolKeepAspect);
- icon.setStyle(opt.itemStyle);
- icon.rotation = (opt.iconRotate || 0) * Math.PI / 180;
- icon.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);
- if (symboType.indexOf("empty") > -1) {
- icon.style.stroke = icon.style.fill;
- icon.style.fill = "#fff";
- icon.style.lineWidth = 2;
- }
- return icon;
- }
- function dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {
- dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);
- api.dispatchAction({
- type: "legendToggleSelect",
- name: seriesName != null ? seriesName : dataName
- });
- dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);
- }
- function isUseHoverLayer(api) {
- var list = api.getZr().storage.getDisplayList();
- var emphasisState;
- var i = 0;
- var len = list.length;
- while (i < len && !(emphasisState = list[i].states.emphasis)) {
- i++;
- }
- return emphasisState && emphasisState.hoverLayer;
- }
- function dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {
- if (!isUseHoverLayer(api)) {
- api.dispatchAction({
- type: "highlight",
- seriesName,
- name: dataName,
- excludeSeriesId
- });
- }
- }
- function dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {
- if (!isUseHoverLayer(api)) {
- api.dispatchAction({
- type: "downplay",
- seriesName,
- name: dataName,
- excludeSeriesId
- });
- }
- }
- var LegendView_default = LegendView;
- // node_modules/echarts/lib/component/legend/legendFilter.js
- init_define_APP_INFO();
- function legendFilter(ecModel) {
- var legendModels = ecModel.findComponents({
- mainType: "legend"
- });
- if (legendModels && legendModels.length) {
- ecModel.filterSeries(function(series) {
- for (var i = 0; i < legendModels.length; i++) {
- if (!legendModels[i].isSelected(series.name)) {
- return false;
- }
- }
- return true;
- });
- }
- }
- // node_modules/echarts/lib/component/legend/legendAction.js
- init_define_APP_INFO();
- function legendSelectActionHandler(methodName, payload, ecModel) {
- var selectedMap = {};
- var isToggleSelect = methodName === "toggleSelected";
- var isSelected;
- ecModel.eachComponent("legend", function(legendModel) {
- if (isToggleSelect && isSelected != null) {
- legendModel[isSelected ? "select" : "unSelect"](payload.name);
- } else if (methodName === "allSelect" || methodName === "inverseSelect") {
- legendModel[methodName]();
- } else {
- legendModel[methodName](payload.name);
- isSelected = legendModel.isSelected(payload.name);
- }
- var legendData = legendModel.getData();
- each(legendData, function(model) {
- var name = model.get("name");
- if (name === "\n" || name === "") {
- return;
- }
- var isItemSelected = legendModel.isSelected(name);
- if (selectedMap.hasOwnProperty(name)) {
- selectedMap[name] = selectedMap[name] && isItemSelected;
- } else {
- selectedMap[name] = isItemSelected;
- }
- });
- });
- return methodName === "allSelect" || methodName === "inverseSelect" ? {
- selected: selectedMap
- } : {
- name: payload.name,
- selected: selectedMap
- };
- }
- function installLegendAction(registers) {
- registers.registerAction("legendToggleSelect", "legendselectchanged", curry(legendSelectActionHandler, "toggleSelected"));
- registers.registerAction("legendAllSelect", "legendselectall", curry(legendSelectActionHandler, "allSelect"));
- registers.registerAction("legendInverseSelect", "legendinverseselect", curry(legendSelectActionHandler, "inverseSelect"));
- registers.registerAction("legendSelect", "legendselected", curry(legendSelectActionHandler, "select"));
- registers.registerAction("legendUnSelect", "legendunselected", curry(legendSelectActionHandler, "unSelect"));
- }
- // node_modules/echarts/lib/component/legend/installLegendPlain.js
- function install20(registers) {
- registers.registerComponentModel(LegendModel_default);
- registers.registerComponentView(LegendView_default);
- registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);
- registers.registerSubTypeDefaulter("legend", function() {
- return "plain";
- });
- installLegendAction(registers);
- }
- // node_modules/echarts/lib/component/legend/installLegendScroll.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/legend/ScrollableLegendModel.js
- init_define_APP_INFO();
- var ScrollableLegendModel = function(_super) {
- __extends(ScrollableLegendModel2, _super);
- function ScrollableLegendModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = ScrollableLegendModel2.type;
- return _this;
- }
- ScrollableLegendModel2.prototype.setScrollDataIndex = function(scrollDataIndex) {
- this.option.scrollDataIndex = scrollDataIndex;
- };
- ScrollableLegendModel2.prototype.init = function(option, parentModel, ecModel) {
- var inputPositionParams = getLayoutParams(option);
- _super.prototype.init.call(this, option, parentModel, ecModel);
- mergeAndNormalizeLayoutParams2(this, option, inputPositionParams);
- };
- ScrollableLegendModel2.prototype.mergeOption = function(option, ecModel) {
- _super.prototype.mergeOption.call(this, option, ecModel);
- mergeAndNormalizeLayoutParams2(this, this.option, option);
- };
- ScrollableLegendModel2.type = "legend.scroll";
- ScrollableLegendModel2.defaultOption = inheritDefaultOption(LegendModel_default.defaultOption, {
- scrollDataIndex: 0,
- pageButtonItemGap: 5,
- pageButtonGap: null,
- pageButtonPosition: "end",
- pageFormatter: "{current}/{total}",
- pageIcons: {
- horizontal: ["M0,0L12,-10L12,10z", "M0,0L-12,-10L-12,10z"],
- vertical: ["M0,0L20,0L10,-20z", "M0,0L20,0L10,20z"]
- },
- pageIconColor: "#2f4554",
- pageIconInactiveColor: "#aaa",
- pageIconSize: 15,
- pageTextStyle: {
- color: "#333"
- },
- animationDurationUpdate: 800
- });
- return ScrollableLegendModel2;
- }(LegendModel_default);
- function mergeAndNormalizeLayoutParams2(legendModel, target, raw) {
- var orient = legendModel.getOrient();
- var ignoreSize = [1, 1];
- ignoreSize[orient.index] = 0;
- mergeLayoutParam(target, raw, {
- type: "box",
- ignoreSize: !!ignoreSize
- });
- }
- var ScrollableLegendModel_default = ScrollableLegendModel;
- // node_modules/echarts/lib/component/legend/ScrollableLegendView.js
- init_define_APP_INFO();
- var Group2 = Group_default;
- var WH2 = ["width", "height"];
- var XY2 = ["x", "y"];
- var ScrollableLegendView = function(_super) {
- __extends(ScrollableLegendView2, _super);
- function ScrollableLegendView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = ScrollableLegendView2.type;
- _this.newlineDisabled = true;
- _this._currentIndex = 0;
- return _this;
- }
- ScrollableLegendView2.prototype.init = function() {
- _super.prototype.init.call(this);
- this.group.add(this._containerGroup = new Group2());
- this._containerGroup.add(this.getContentGroup());
- this.group.add(this._controllerGroup = new Group2());
- };
- ScrollableLegendView2.prototype.resetInner = function() {
- _super.prototype.resetInner.call(this);
- this._controllerGroup.removeAll();
- this._containerGroup.removeClipPath();
- this._containerGroup.__rectSize = null;
- };
- ScrollableLegendView2.prototype.renderInner = function(itemAlign, legendModel, ecModel, api, selector2, orient, selectorPosition) {
- var self = this;
- _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector2, orient, selectorPosition);
- var controllerGroup = this._controllerGroup;
- var pageIconSize = legendModel.get("pageIconSize", true);
- var pageIconSizeArr = isArray(pageIconSize) ? pageIconSize : [pageIconSize, pageIconSize];
- createPageButton("pagePrev", 0);
- var pageTextStyleModel = legendModel.getModel("pageTextStyle");
- controllerGroup.add(new Text_default({
- name: "pageText",
- style: {
- text: "xx/xx",
- fill: pageTextStyleModel.getTextColor(),
- font: pageTextStyleModel.getFont(),
- verticalAlign: "middle",
- align: "center"
- },
- silent: true
- }));
- createPageButton("pageNext", 1);
- function createPageButton(name, iconIdx) {
- var pageDataIndexName = name + "DataIndex";
- var icon = createIcon(legendModel.get("pageIcons", true)[legendModel.getOrient().name][iconIdx], {
- onclick: bind(self._pageGo, self, pageDataIndexName, legendModel, api)
- }, {
- x: -pageIconSizeArr[0] / 2,
- y: -pageIconSizeArr[1] / 2,
- width: pageIconSizeArr[0],
- height: pageIconSizeArr[1]
- });
- icon.name = name;
- controllerGroup.add(icon);
- }
- };
- ScrollableLegendView2.prototype.layoutInner = function(legendModel, itemAlign, maxSize, isFirstRender, selector2, selectorPosition) {
- var selectorGroup = this.getSelectorGroup();
- var orientIdx = legendModel.getOrient().index;
- var wh = WH2[orientIdx];
- var xy = XY2[orientIdx];
- var hw = WH2[1 - orientIdx];
- var yx = XY2[1 - orientIdx];
- selector2 && box(
- "horizontal",
- selectorGroup,
- legendModel.get("selectorItemGap", true)
- );
- var selectorButtonGap = legendModel.get("selectorButtonGap", true);
- var selectorRect = selectorGroup.getBoundingRect();
- var selectorPos = [-selectorRect.x, -selectorRect.y];
- var processMaxSize = clone(maxSize);
- selector2 && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap);
- var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy);
- if (selector2) {
- if (selectorPosition === "end") {
- selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap;
- } else {
- var offset = selectorRect[wh] + selectorButtonGap;
- selectorPos[orientIdx] -= offset;
- mainRect[xy] -= offset;
- }
- mainRect[wh] += selectorRect[wh] + selectorButtonGap;
- selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2;
- mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]);
- mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]);
- selectorGroup.x = selectorPos[0];
- selectorGroup.y = selectorPos[1];
- selectorGroup.markRedraw();
- }
- return mainRect;
- };
- ScrollableLegendView2.prototype._layoutContentAndController = function(legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) {
- var contentGroup = this.getContentGroup();
- var containerGroup = this._containerGroup;
- var controllerGroup = this._controllerGroup;
- box(legendModel.get("orient"), contentGroup, legendModel.get("itemGap"), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height);
- box(
- "horizontal",
- controllerGroup,
- legendModel.get("pageButtonItemGap", true)
- );
- var contentRect = contentGroup.getBoundingRect();
- var controllerRect = controllerGroup.getBoundingRect();
- var showController = this._showController = contentRect[wh] > maxSize[wh];
- var contentPos = [-contentRect.x, -contentRect.y];
- if (!isFirstRender) {
- contentPos[orientIdx] = contentGroup[xy];
- }
- var containerPos = [0, 0];
- var controllerPos = [-controllerRect.x, -controllerRect.y];
- var pageButtonGap = retrieve2(legendModel.get("pageButtonGap", true), legendModel.get("itemGap", true));
- if (showController) {
- var pageButtonPosition = legendModel.get("pageButtonPosition", true);
- if (pageButtonPosition === "end") {
- controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];
- } else {
- containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;
- }
- }
- controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2;
- contentGroup.setPosition(contentPos);
- containerGroup.setPosition(containerPos);
- controllerGroup.setPosition(controllerPos);
- var mainRect = {
- x: 0,
- y: 0
- };
- mainRect[wh] = showController ? maxSize[wh] : contentRect[wh];
- mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]);
- mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]);
- containerGroup.__rectSize = maxSize[wh];
- if (showController) {
- var clipShape = {
- x: 0,
- y: 0
- };
- clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0);
- clipShape[hw] = mainRect[hw];
- containerGroup.setClipPath(new Rect_default({
- shape: clipShape
- }));
- containerGroup.__rectSize = clipShape[wh];
- } else {
- controllerGroup.eachChild(function(child) {
- child.attr({
- invisible: true,
- silent: true
- });
- });
- }
- var pageInfo = this._getPageInfo(legendModel);
- pageInfo.pageIndex != null && updateProps(
- contentGroup,
- {
- x: pageInfo.contentPosition[0],
- y: pageInfo.contentPosition[1]
- },
- showController ? legendModel : null
- );
- this._updatePageInfoView(legendModel, pageInfo);
- return mainRect;
- };
- ScrollableLegendView2.prototype._pageGo = function(to, legendModel, api) {
- var scrollDataIndex = this._getPageInfo(legendModel)[to];
- scrollDataIndex != null && api.dispatchAction({
- type: "legendScroll",
- scrollDataIndex,
- legendId: legendModel.id
- });
- };
- ScrollableLegendView2.prototype._updatePageInfoView = function(legendModel, pageInfo) {
- var controllerGroup = this._controllerGroup;
- each(["pagePrev", "pageNext"], function(name) {
- var key = name + "DataIndex";
- var canJump = pageInfo[key] != null;
- var icon = controllerGroup.childOfName(name);
- if (icon) {
- icon.setStyle("fill", canJump ? legendModel.get("pageIconColor", true) : legendModel.get("pageIconInactiveColor", true));
- icon.cursor = canJump ? "pointer" : "default";
- }
- });
- var pageText = controllerGroup.childOfName("pageText");
- var pageFormatter = legendModel.get("pageFormatter");
- var pageIndex = pageInfo.pageIndex;
- var current = pageIndex != null ? pageIndex + 1 : 0;
- var total = pageInfo.pageCount;
- pageText && pageFormatter && pageText.setStyle("text", isString(pageFormatter) ? pageFormatter.replace("{current}", current == null ? "" : current + "").replace("{total}", total == null ? "" : total + "") : pageFormatter({
- current,
- total
- }));
- };
- ScrollableLegendView2.prototype._getPageInfo = function(legendModel) {
- var scrollDataIndex = legendModel.get("scrollDataIndex", true);
- var contentGroup = this.getContentGroup();
- var containerRectSize = this._containerGroup.__rectSize;
- var orientIdx = legendModel.getOrient().index;
- var wh = WH2[orientIdx];
- var xy = XY2[orientIdx];
- var targetItemIndex = this._findTargetItemIndex(scrollDataIndex);
- var children = contentGroup.children();
- var targetItem = children[targetItemIndex];
- var itemCount = children.length;
- var pCount = !itemCount ? 0 : 1;
- var result = {
- contentPosition: [contentGroup.x, contentGroup.y],
- pageCount: pCount,
- pageIndex: pCount - 1,
- pagePrevDataIndex: null,
- pageNextDataIndex: null
- };
- if (!targetItem) {
- return result;
- }
- var targetItemInfo = getItemInfo(targetItem);
- result.contentPosition[orientIdx] = -targetItemInfo.s;
- for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) {
- currItemInfo = getItemInfo(children[i]);
- if (!currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize || currItemInfo && !intersect(currItemInfo, winStartItemInfo.s)) {
- if (winEndItemInfo.i > winStartItemInfo.i) {
- winStartItemInfo = winEndItemInfo;
- } else {
- winStartItemInfo = currItemInfo;
- }
- if (winStartItemInfo) {
- if (result.pageNextDataIndex == null) {
- result.pageNextDataIndex = winStartItemInfo.i;
- }
- ++result.pageCount;
- }
- }
- winEndItemInfo = currItemInfo;
- }
- for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) {
- currItemInfo = getItemInfo(children[i]);
- if ((!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s)) && winStartItemInfo.i < winEndItemInfo.i) {
- winEndItemInfo = winStartItemInfo;
- if (result.pagePrevDataIndex == null) {
- result.pagePrevDataIndex = winStartItemInfo.i;
- }
- ++result.pageCount;
- ++result.pageIndex;
- }
- winStartItemInfo = currItemInfo;
- }
- return result;
- function getItemInfo(el) {
- if (el) {
- var itemRect = el.getBoundingRect();
- var start = itemRect[xy] + el[xy];
- return {
- s: start,
- e: start + itemRect[wh],
- i: el.__legendDataIndex
- };
- }
- }
- function intersect(itemInfo, winStart) {
- return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize;
- }
- };
- ScrollableLegendView2.prototype._findTargetItemIndex = function(targetDataIndex) {
- if (!this._showController) {
- return 0;
- }
- var index;
- var contentGroup = this.getContentGroup();
- var defaultIndex;
- contentGroup.eachChild(function(child, idx) {
- var legendDataIdx = child.__legendDataIndex;
- if (defaultIndex == null && legendDataIdx != null) {
- defaultIndex = idx;
- }
- if (legendDataIdx === targetDataIndex) {
- index = idx;
- }
- });
- return index != null ? index : defaultIndex;
- };
- ScrollableLegendView2.type = "legend.scroll";
- return ScrollableLegendView2;
- }(LegendView_default);
- var ScrollableLegendView_default = ScrollableLegendView;
- // node_modules/echarts/lib/component/legend/scrollableLegendAction.js
- init_define_APP_INFO();
- function installScrollableLegendAction(registers) {
- registers.registerAction("legendScroll", "legendscroll", function(payload, ecModel) {
- var scrollDataIndex = payload.scrollDataIndex;
- scrollDataIndex != null && ecModel.eachComponent({
- mainType: "legend",
- subType: "scroll",
- query: payload
- }, function(legendModel) {
- legendModel.setScrollDataIndex(scrollDataIndex);
- });
- });
- }
- // node_modules/echarts/lib/component/legend/installLegendScroll.js
- function install21(registers) {
- use(install20);
- registers.registerComponentModel(ScrollableLegendModel_default);
- registers.registerComponentView(ScrollableLegendView_default);
- installScrollableLegendAction(registers);
- }
- // node_modules/echarts/lib/component/legend/install.js
- function install22(registers) {
- use(install20);
- use(install21);
- }
- // node_modules/echarts/lib/component/dataZoom/install.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/dataZoom/installDataZoomInside.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/dataZoom/InsideZoomModel.js
- init_define_APP_INFO();
- var InsideZoomModel = function(_super) {
- __extends(InsideZoomModel2, _super);
- function InsideZoomModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = InsideZoomModel2.type;
- return _this;
- }
- InsideZoomModel2.type = "dataZoom.inside";
- InsideZoomModel2.defaultOption = inheritDefaultOption(DataZoomModel_default.defaultOption, {
- disabled: false,
- zoomLock: false,
- zoomOnMouseWheel: true,
- moveOnMouseMove: true,
- moveOnMouseWheel: false,
- preventDefaultMouseMove: true
- });
- return InsideZoomModel2;
- }(DataZoomModel_default);
- var InsideZoomModel_default = InsideZoomModel;
- // node_modules/echarts/lib/component/dataZoom/InsideZoomView.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/dataZoom/roams.js
- init_define_APP_INFO();
- var inner11 = makeInner();
- function setViewInfoToCoordSysRecord(api, dataZoomModel, getRange) {
- inner11(api).coordSysRecordMap.each(function(coordSysRecord) {
- var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);
- if (dzInfo) {
- dzInfo.getRange = getRange;
- }
- });
- }
- function disposeCoordSysRecordIfNeeded(api, dataZoomModel) {
- var coordSysRecordMap = inner11(api).coordSysRecordMap;
- var coordSysKeyArr = coordSysRecordMap.keys();
- for (var i = 0; i < coordSysKeyArr.length; i++) {
- var coordSysKey = coordSysKeyArr[i];
- var coordSysRecord = coordSysRecordMap.get(coordSysKey);
- var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;
- if (dataZoomInfoMap) {
- var dzUid = dataZoomModel.uid;
- var dzInfo = dataZoomInfoMap.get(dzUid);
- if (dzInfo) {
- dataZoomInfoMap.removeKey(dzUid);
- if (!dataZoomInfoMap.keys().length) {
- disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);
- }
- }
- }
- }
- }
- function disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) {
- if (coordSysRecord) {
- coordSysRecordMap.removeKey(coordSysRecord.model.uid);
- var controller = coordSysRecord.controller;
- controller && controller.dispose();
- }
- }
- function createCoordSysRecord(api, coordSysModel) {
- var coordSysRecord = {
- model: coordSysModel,
- containsPoint: curry(containsPoint, coordSysModel),
- dispatchAction: curry(dispatchAction2, api),
- dataZoomInfoMap: null,
- controller: null
- };
- var controller = coordSysRecord.controller = new RoamController_default(api.getZr());
- each(["pan", "zoom", "scrollMove"], function(eventName) {
- controller.on(eventName, function(event) {
- var batch = [];
- coordSysRecord.dataZoomInfoMap.each(function(dzInfo) {
- if (!event.isAvailableBehavior(dzInfo.model.option)) {
- return;
- }
- var method = (dzInfo.getRange || {})[eventName];
- var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event);
- !dzInfo.model.get("disabled", true) && range && batch.push({
- dataZoomId: dzInfo.model.id,
- start: range[0],
- end: range[1]
- });
- });
- batch.length && coordSysRecord.dispatchAction(batch);
- });
- });
- return coordSysRecord;
- }
- function dispatchAction2(api, batch) {
- if (!api.isDisposed()) {
- api.dispatchAction({
- type: "dataZoom",
- animation: {
- easing: "cubicOut",
- duration: 100
- },
- batch
- });
- }
- }
- function containsPoint(coordSysModel, e, x, y) {
- return coordSysModel.coordinateSystem.containPoint([x, y]);
- }
- function mergeControllerParams(dataZoomInfoMap) {
- var controlType;
- var prefix = "type_";
- var typePriority = {
- "type_true": 2,
- "type_move": 1,
- "type_false": 0,
- "type_undefined": -1
- };
- var preventDefaultMouseMove = true;
- dataZoomInfoMap.each(function(dataZoomInfo) {
- var dataZoomModel = dataZoomInfo.model;
- var oneType = dataZoomModel.get("disabled", true) ? false : dataZoomModel.get("zoomLock", true) ? "move" : true;
- if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {
- controlType = oneType;
- }
- preventDefaultMouseMove = preventDefaultMouseMove && dataZoomModel.get("preventDefaultMouseMove", true);
- });
- return {
- controlType,
- opt: {
- zoomOnMouseWheel: true,
- moveOnMouseMove: true,
- moveOnMouseWheel: true,
- preventDefaultMouseMove: !!preventDefaultMouseMove
- }
- };
- }
- function installDataZoomRoamProcessor(registers) {
- registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, function(ecModel, api) {
- var apiInner = inner11(api);
- var coordSysRecordMap = apiInner.coordSysRecordMap || (apiInner.coordSysRecordMap = createHashMap());
- coordSysRecordMap.each(function(coordSysRecord) {
- coordSysRecord.dataZoomInfoMap = null;
- });
- ecModel.eachComponent({
- mainType: "dataZoom",
- subType: "inside"
- }, function(dataZoomModel) {
- var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel);
- each(dzReferCoordSysWrap.infoList, function(dzCoordSysInfo) {
- var coordSysUid = dzCoordSysInfo.model.uid;
- var coordSysRecord = coordSysRecordMap.get(coordSysUid) || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model));
- var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap || (coordSysRecord.dataZoomInfoMap = createHashMap());
- dataZoomInfoMap.set(dataZoomModel.uid, {
- dzReferCoordSysInfo: dzCoordSysInfo,
- model: dataZoomModel,
- getRange: null
- });
- });
- });
- coordSysRecordMap.each(function(coordSysRecord) {
- var controller = coordSysRecord.controller;
- var firstDzInfo;
- var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;
- if (dataZoomInfoMap) {
- var firstDzKey = dataZoomInfoMap.keys()[0];
- if (firstDzKey != null) {
- firstDzInfo = dataZoomInfoMap.get(firstDzKey);
- }
- }
- if (!firstDzInfo) {
- disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);
- return;
- }
- var controllerParams = mergeControllerParams(dataZoomInfoMap);
- controller.enable(controllerParams.controlType, controllerParams.opt);
- controller.setPointerChecker(coordSysRecord.containsPoint);
- createOrUpdate(coordSysRecord, "dispatchAction", firstDzInfo.model.get("throttle", true), "fixRate");
- });
- });
- }
- // node_modules/echarts/lib/component/dataZoom/InsideZoomView.js
- var InsideZoomView = function(_super) {
- __extends(InsideZoomView2, _super);
- function InsideZoomView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = "dataZoom.inside";
- return _this;
- }
- InsideZoomView2.prototype.render = function(dataZoomModel, ecModel, api) {
- _super.prototype.render.apply(this, arguments);
- if (dataZoomModel.noTarget()) {
- this._clear();
- return;
- }
- this.range = dataZoomModel.getPercentRange();
- setViewInfoToCoordSysRecord(api, dataZoomModel, {
- pan: bind(getRangeHandlers.pan, this),
- zoom: bind(getRangeHandlers.zoom, this),
- scrollMove: bind(getRangeHandlers.scrollMove, this)
- });
- };
- InsideZoomView2.prototype.dispose = function() {
- this._clear();
- _super.prototype.dispose.apply(this, arguments);
- };
- InsideZoomView2.prototype._clear = function() {
- disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);
- this.range = null;
- };
- InsideZoomView2.type = "dataZoom.inside";
- return InsideZoomView2;
- }(DataZoomView_default);
- var getRangeHandlers = {
- zoom: function(coordSysInfo, coordSysMainType, controller, e) {
- var lastRange = this.range;
- var range = lastRange.slice();
- var axisModel = coordSysInfo.axisModels[0];
- if (!axisModel) {
- return;
- }
- var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo);
- var percentPoint = (directionInfo.signal > 0 ? directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel : directionInfo.pixel - directionInfo.pixelStart) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];
- var scale = Math.max(1 / e.scale, 0);
- range[0] = (range[0] - percentPoint) * scale + percentPoint;
- range[1] = (range[1] - percentPoint) * scale + percentPoint;
- var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();
- sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);
- this.range = range;
- if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {
- return range;
- }
- },
- pan: makeMover(function(range, axisModel, coordSysInfo, coordSysMainType, controller, e) {
- var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo);
- return directionInfo.signal * (range[1] - range[0]) * directionInfo.pixel / directionInfo.pixelLength;
- }),
- scrollMove: makeMover(function(range, axisModel, coordSysInfo, coordSysMainType, controller, e) {
- var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo);
- return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;
- })
- };
- function makeMover(getPercentDelta) {
- return function(coordSysInfo, coordSysMainType, controller, e) {
- var lastRange = this.range;
- var range = lastRange.slice();
- var axisModel = coordSysInfo.axisModels[0];
- if (!axisModel) {
- return;
- }
- var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e);
- sliderMove(percentDelta, range, [0, 100], "all");
- this.range = range;
- if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {
- return range;
- }
- };
- }
- var getDirectionInfo = {
- grid: function(oldPoint, newPoint, axisModel, controller, coordSysInfo) {
- var axis = axisModel.axis;
- var ret = {};
- var rect = coordSysInfo.model.coordinateSystem.getRect();
- oldPoint = oldPoint || [0, 0];
- if (axis.dim === "x") {
- ret.pixel = newPoint[0] - oldPoint[0];
- ret.pixelLength = rect.width;
- ret.pixelStart = rect.x;
- ret.signal = axis.inverse ? 1 : -1;
- } else {
- ret.pixel = newPoint[1] - oldPoint[1];
- ret.pixelLength = rect.height;
- ret.pixelStart = rect.y;
- ret.signal = axis.inverse ? -1 : 1;
- }
- return ret;
- },
- polar: function(oldPoint, newPoint, axisModel, controller, coordSysInfo) {
- var axis = axisModel.axis;
- var ret = {};
- var polar = coordSysInfo.model.coordinateSystem;
- var radiusExtent = polar.getRadiusAxis().getExtent();
- var angleExtent = polar.getAngleAxis().getExtent();
- oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];
- newPoint = polar.pointToCoord(newPoint);
- if (axisModel.mainType === "radiusAxis") {
- ret.pixel = newPoint[0] - oldPoint[0];
- ret.pixelLength = radiusExtent[1] - radiusExtent[0];
- ret.pixelStart = radiusExtent[0];
- ret.signal = axis.inverse ? 1 : -1;
- } else {
- ret.pixel = newPoint[1] - oldPoint[1];
- ret.pixelLength = angleExtent[1] - angleExtent[0];
- ret.pixelStart = angleExtent[0];
- ret.signal = axis.inverse ? -1 : 1;
- }
- return ret;
- },
- singleAxis: function(oldPoint, newPoint, axisModel, controller, coordSysInfo) {
- var axis = axisModel.axis;
- var rect = coordSysInfo.model.coordinateSystem.getRect();
- var ret = {};
- oldPoint = oldPoint || [0, 0];
- if (axis.orient === "horizontal") {
- ret.pixel = newPoint[0] - oldPoint[0];
- ret.pixelLength = rect.width;
- ret.pixelStart = rect.x;
- ret.signal = axis.inverse ? 1 : -1;
- } else {
- ret.pixel = newPoint[1] - oldPoint[1];
- ret.pixelLength = rect.height;
- ret.pixelStart = rect.y;
- ret.signal = axis.inverse ? -1 : 1;
- }
- return ret;
- }
- };
- var InsideZoomView_default = InsideZoomView;
- // node_modules/echarts/lib/component/dataZoom/installDataZoomInside.js
- function install23(registers) {
- installCommon(registers);
- registers.registerComponentModel(InsideZoomModel_default);
- registers.registerComponentView(InsideZoomView_default);
- installDataZoomRoamProcessor(registers);
- }
- // node_modules/echarts/lib/component/dataZoom/installDataZoomSlider.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/dataZoom/SliderZoomModel.js
- init_define_APP_INFO();
- var SliderZoomModel = function(_super) {
- __extends(SliderZoomModel2, _super);
- function SliderZoomModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = SliderZoomModel2.type;
- return _this;
- }
- SliderZoomModel2.type = "dataZoom.slider";
- SliderZoomModel2.layoutMode = "box";
- SliderZoomModel2.defaultOption = inheritDefaultOption(DataZoomModel_default.defaultOption, {
- show: true,
- right: "ph",
- top: "ph",
- width: "ph",
- height: "ph",
- left: null,
- bottom: null,
- borderColor: "#d2dbee",
- borderRadius: 3,
- backgroundColor: "rgba(47,69,84,0)",
- dataBackground: {
- lineStyle: {
- color: "#d2dbee",
- width: 0.5
- },
- areaStyle: {
- color: "#d2dbee",
- opacity: 0.2
- }
- },
- selectedDataBackground: {
- lineStyle: {
- color: "#8fb0f7",
- width: 0.5
- },
- areaStyle: {
- color: "#8fb0f7",
- opacity: 0.2
- }
- },
- fillerColor: "rgba(135,175,274,0.2)",
- handleIcon: "path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",
- handleSize: "100%",
- handleStyle: {
- color: "#fff",
- borderColor: "#ACB8D1"
- },
- moveHandleSize: 7,
- moveHandleIcon: "path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",
- moveHandleStyle: {
- color: "#D2DBEE",
- opacity: 0.7
- },
- showDetail: true,
- showDataShadow: "auto",
- realtime: true,
- zoomLock: false,
- textStyle: {
- color: "#6E7079"
- },
- brushSelect: true,
- brushStyle: {
- color: "rgba(135,175,274,0.15)"
- },
- emphasis: {
- handleStyle: {
- borderColor: "#8FB0F7"
- },
- moveHandleStyle: {
- color: "#8FB0F7"
- }
- }
- });
- return SliderZoomModel2;
- }(DataZoomModel_default);
- var SliderZoomModel_default = SliderZoomModel;
- // node_modules/echarts/lib/component/dataZoom/SliderZoomView.js
- init_define_APP_INFO();
- var Rect = Rect_default;
- var DEFAULT_LOCATION_EDGE_GAP = 7;
- var DEFAULT_FRAME_BORDER_WIDTH = 1;
- var DEFAULT_FILLER_SIZE = 30;
- var DEFAULT_MOVE_HANDLE_SIZE = 7;
- var HORIZONTAL = "horizontal";
- var VERTICAL = "vertical";
- var LABEL_GAP = 5;
- var SHOW_DATA_SHADOW_SERIES_TYPE = ["line", "bar", "candlestick", "scatter"];
- var REALTIME_ANIMATION_CONFIG = {
- easing: "cubicOut",
- duration: 100,
- delay: 0
- };
- var SliderZoomView = function(_super) {
- __extends(SliderZoomView2, _super);
- function SliderZoomView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = SliderZoomView2.type;
- _this._displayables = {};
- return _this;
- }
- SliderZoomView2.prototype.init = function(ecModel, api) {
- this.api = api;
- this._onBrush = bind(this._onBrush, this);
- this._onBrushEnd = bind(this._onBrushEnd, this);
- };
- SliderZoomView2.prototype.render = function(dataZoomModel, ecModel, api, payload) {
- _super.prototype.render.apply(this, arguments);
- createOrUpdate(this, "_dispatchZoomAction", dataZoomModel.get("throttle"), "fixRate");
- this._orient = dataZoomModel.getOrient();
- if (dataZoomModel.get("show") === false) {
- this.group.removeAll();
- return;
- }
- if (dataZoomModel.noTarget()) {
- this._clear();
- this.group.removeAll();
- return;
- }
- if (!payload || payload.type !== "dataZoom" || payload.from !== this.uid) {
- this._buildView();
- }
- this._updateView();
- };
- SliderZoomView2.prototype.dispose = function() {
- this._clear();
- _super.prototype.dispose.apply(this, arguments);
- };
- SliderZoomView2.prototype._clear = function() {
- clear(this, "_dispatchZoomAction");
- var zr = this.api.getZr();
- zr.off("mousemove", this._onBrush);
- zr.off("mouseup", this._onBrushEnd);
- };
- SliderZoomView2.prototype._buildView = function() {
- var thisGroup = this.group;
- thisGroup.removeAll();
- this._brushing = false;
- this._displayables.brushRect = null;
- this._resetLocation();
- this._resetInterval();
- var barGroup = this._displayables.sliderGroup = new Group_default();
- this._renderBackground();
- this._renderHandle();
- this._renderDataShadow();
- thisGroup.add(barGroup);
- this._positionGroup();
- };
- SliderZoomView2.prototype._resetLocation = function() {
- var dataZoomModel = this.dataZoomModel;
- var api = this.api;
- var showMoveHandle = dataZoomModel.get("brushSelect");
- var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0;
- var coordRect = this._findCoordRect();
- var ecSize = {
- width: api.getWidth(),
- height: api.getHeight()
- };
- var positionInfo = this._orient === HORIZONTAL ? {
- right: ecSize.width - coordRect.x - coordRect.width,
- top: ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize,
- width: coordRect.width,
- height: DEFAULT_FILLER_SIZE
- } : {
- right: DEFAULT_LOCATION_EDGE_GAP,
- top: coordRect.y,
- width: DEFAULT_FILLER_SIZE,
- height: coordRect.height
- };
- var layoutParams = getLayoutParams(dataZoomModel.option);
- each(["right", "top", "width", "height"], function(name) {
- if (layoutParams[name] === "ph") {
- layoutParams[name] = positionInfo[name];
- }
- });
- var layoutRect = getLayoutRect(layoutParams, ecSize);
- this._location = {
- x: layoutRect.x,
- y: layoutRect.y
- };
- this._size = [layoutRect.width, layoutRect.height];
- this._orient === VERTICAL && this._size.reverse();
- };
- SliderZoomView2.prototype._positionGroup = function() {
- var thisGroup = this.group;
- var location = this._location;
- var orient = this._orient;
- var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();
- var inverse = targetAxisModel && targetAxisModel.get("inverse");
- var sliderGroup = this._displayables.sliderGroup;
- var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse;
- sliderGroup.attr(orient === HORIZONTAL && !inverse ? {
- scaleY: otherAxisInverse ? 1 : -1,
- scaleX: 1
- } : orient === HORIZONTAL && inverse ? {
- scaleY: otherAxisInverse ? 1 : -1,
- scaleX: -1
- } : orient === VERTICAL && !inverse ? {
- scaleY: otherAxisInverse ? -1 : 1,
- scaleX: 1,
- rotation: Math.PI / 2
- } : {
- scaleY: otherAxisInverse ? -1 : 1,
- scaleX: -1,
- rotation: Math.PI / 2
- });
- var rect = thisGroup.getBoundingRect([sliderGroup]);
- thisGroup.x = location.x - rect.x;
- thisGroup.y = location.y - rect.y;
- thisGroup.markRedraw();
- };
- SliderZoomView2.prototype._getViewExtent = function() {
- return [0, this._size[0]];
- };
- SliderZoomView2.prototype._renderBackground = function() {
- var dataZoomModel = this.dataZoomModel;
- var size = this._size;
- var barGroup = this._displayables.sliderGroup;
- var brushSelect = dataZoomModel.get("brushSelect");
- barGroup.add(new Rect({
- silent: true,
- shape: {
- x: 0,
- y: 0,
- width: size[0],
- height: size[1]
- },
- style: {
- fill: dataZoomModel.get("backgroundColor")
- },
- z2: -40
- }));
- var clickPanel = new Rect({
- shape: {
- x: 0,
- y: 0,
- width: size[0],
- height: size[1]
- },
- style: {
- fill: "transparent"
- },
- z2: 0,
- onclick: bind(this._onClickPanel, this)
- });
- var zr = this.api.getZr();
- if (brushSelect) {
- clickPanel.on("mousedown", this._onBrushStart, this);
- clickPanel.cursor = "crosshair";
- zr.on("mousemove", this._onBrush);
- zr.on("mouseup", this._onBrushEnd);
- } else {
- zr.off("mousemove", this._onBrush);
- zr.off("mouseup", this._onBrushEnd);
- }
- barGroup.add(clickPanel);
- };
- SliderZoomView2.prototype._renderDataShadow = function() {
- var info = this._dataShadowInfo = this._prepareDataShadowInfo();
- this._displayables.dataShadowSegs = [];
- if (!info) {
- return;
- }
- var size = this._size;
- var oldSize = this._shadowSize || [];
- var seriesModel = info.series;
- var data = seriesModel.getRawData();
- var otherDim = seriesModel.getShadowDim ? seriesModel.getShadowDim() : info.otherDim;
- if (otherDim == null) {
- return;
- }
- var polygonPts = this._shadowPolygonPts;
- var polylinePts = this._shadowPolylinePts;
- if (data !== this._shadowData || otherDim !== this._shadowDim || size[0] !== oldSize[0] || size[1] !== oldSize[1]) {
- var otherDataExtent_1 = data.getDataExtent(otherDim);
- var otherOffset = (otherDataExtent_1[1] - otherDataExtent_1[0]) * 0.3;
- otherDataExtent_1 = [otherDataExtent_1[0] - otherOffset, otherDataExtent_1[1] + otherOffset];
- var otherShadowExtent_1 = [0, size[1]];
- var thisShadowExtent = [0, size[0]];
- var areaPoints_1 = [[size[0], 0], [0, 0]];
- var linePoints_1 = [];
- var step_1 = thisShadowExtent[1] / (data.count() - 1);
- var thisCoord_1 = 0;
- var stride_1 = Math.round(data.count() / size[0]);
- var lastIsEmpty_1;
- data.each([otherDim], function(value, index) {
- if (stride_1 > 0 && index % stride_1) {
- thisCoord_1 += step_1;
- return;
- }
- var isEmpty = value == null || isNaN(value) || value === "";
- var otherCoord = isEmpty ? 0 : linearMap(value, otherDataExtent_1, otherShadowExtent_1, true);
- if (isEmpty && !lastIsEmpty_1 && index) {
- areaPoints_1.push([areaPoints_1[areaPoints_1.length - 1][0], 0]);
- linePoints_1.push([linePoints_1[linePoints_1.length - 1][0], 0]);
- } else if (!isEmpty && lastIsEmpty_1) {
- areaPoints_1.push([thisCoord_1, 0]);
- linePoints_1.push([thisCoord_1, 0]);
- }
- areaPoints_1.push([thisCoord_1, otherCoord]);
- linePoints_1.push([thisCoord_1, otherCoord]);
- thisCoord_1 += step_1;
- lastIsEmpty_1 = isEmpty;
- });
- polygonPts = this._shadowPolygonPts = areaPoints_1;
- polylinePts = this._shadowPolylinePts = linePoints_1;
- }
- this._shadowData = data;
- this._shadowDim = otherDim;
- this._shadowSize = [size[0], size[1]];
- var dataZoomModel = this.dataZoomModel;
- function createDataShadowGroup(isSelectedArea) {
- var model = dataZoomModel.getModel(isSelectedArea ? "selectedDataBackground" : "dataBackground");
- var group2 = new Group_default();
- var polygon = new Polygon_default({
- shape: {
- points: polygonPts
- },
- segmentIgnoreThreshold: 1,
- style: model.getModel("areaStyle").getAreaStyle(),
- silent: true,
- z2: -20
- });
- var polyline = new Polyline_default({
- shape: {
- points: polylinePts
- },
- segmentIgnoreThreshold: 1,
- style: model.getModel("lineStyle").getLineStyle(),
- silent: true,
- z2: -19
- });
- group2.add(polygon);
- group2.add(polyline);
- return group2;
- }
- for (var i = 0; i < 3; i++) {
- var group = createDataShadowGroup(i === 1);
- this._displayables.sliderGroup.add(group);
- this._displayables.dataShadowSegs.push(group);
- }
- };
- SliderZoomView2.prototype._prepareDataShadowInfo = function() {
- var dataZoomModel = this.dataZoomModel;
- var showDataShadow = dataZoomModel.get("showDataShadow");
- if (showDataShadow === false) {
- return;
- }
- var result;
- var ecModel = this.ecModel;
- dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
- var seriesModels = dataZoomModel.getAxisProxy(axisDim, axisIndex).getTargetSeriesModels();
- each(seriesModels, function(seriesModel) {
- if (result) {
- return;
- }
- if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get("type")) < 0) {
- return;
- }
- var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis;
- var otherDim = getOtherDim(axisDim);
- var otherAxisInverse;
- var coordSys = seriesModel.coordinateSystem;
- if (otherDim != null && coordSys.getOtherAxis) {
- otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse;
- }
- otherDim = seriesModel.getData().mapDimension(otherDim);
- result = {
- thisAxis,
- series: seriesModel,
- thisDim: axisDim,
- otherDim,
- otherAxisInverse
- };
- }, this);
- }, this);
- return result;
- };
- SliderZoomView2.prototype._renderHandle = function() {
- var thisGroup = this.group;
- var displayables = this._displayables;
- var handles = displayables.handles = [null, null];
- var handleLabels = displayables.handleLabels = [null, null];
- var sliderGroup = this._displayables.sliderGroup;
- var size = this._size;
- var dataZoomModel = this.dataZoomModel;
- var api = this.api;
- var borderRadius = dataZoomModel.get("borderRadius") || 0;
- var brushSelect = dataZoomModel.get("brushSelect");
- var filler = displayables.filler = new Rect({
- silent: brushSelect,
- style: {
- fill: dataZoomModel.get("fillerColor")
- },
- textConfig: {
- position: "inside"
- }
- });
- sliderGroup.add(filler);
- sliderGroup.add(new Rect({
- silent: true,
- subPixelOptimize: true,
- shape: {
- x: 0,
- y: 0,
- width: size[0],
- height: size[1],
- r: borderRadius
- },
- style: {
- stroke: dataZoomModel.get("dataBackgroundColor") || dataZoomModel.get("borderColor"),
- lineWidth: DEFAULT_FRAME_BORDER_WIDTH,
- fill: "rgba(0,0,0,0)"
- }
- }));
- each([0, 1], function(handleIndex) {
- var iconStr = dataZoomModel.get("handleIcon");
- if (!symbolBuildProxies[iconStr] && iconStr.indexOf("path://") < 0 && iconStr.indexOf("image://") < 0) {
- iconStr = "path://" + iconStr;
- if (true) {
- deprecateLog("handleIcon now needs 'path://' prefix when using a path string");
- }
- }
- var path = createSymbol(iconStr, -1, 0, 2, 2, null, true);
- path.attr({
- cursor: getCursor(this._orient),
- draggable: true,
- drift: bind(this._onDragMove, this, handleIndex),
- ondragend: bind(this._onDragEnd, this),
- onmouseover: bind(this._showDataInfo, this, true),
- onmouseout: bind(this._showDataInfo, this, false),
- z2: 5
- });
- var bRect = path.getBoundingRect();
- var handleSize = dataZoomModel.get("handleSize");
- this._handleHeight = parsePercent2(handleSize, this._size[1]);
- this._handleWidth = bRect.width / bRect.height * this._handleHeight;
- path.setStyle(dataZoomModel.getModel("handleStyle").getItemStyle());
- path.style.strokeNoScale = true;
- path.rectHover = true;
- path.ensureState("emphasis").style = dataZoomModel.getModel(["emphasis", "handleStyle"]).getItemStyle();
- enableHoverEmphasis(path);
- var handleColor = dataZoomModel.get("handleColor");
- if (handleColor != null) {
- path.style.fill = handleColor;
- }
- sliderGroup.add(handles[handleIndex] = path);
- var textStyleModel = dataZoomModel.getModel("textStyle");
- thisGroup.add(handleLabels[handleIndex] = new Text_default({
- silent: true,
- invisible: true,
- style: createTextStyle(textStyleModel, {
- x: 0,
- y: 0,
- text: "",
- verticalAlign: "middle",
- align: "center",
- fill: textStyleModel.getTextColor(),
- font: textStyleModel.getFont()
- }),
- z2: 10
- }));
- }, this);
- var actualMoveZone = filler;
- if (brushSelect) {
- var moveHandleHeight = parsePercent2(dataZoomModel.get("moveHandleSize"), size[1]);
- var moveHandle_1 = displayables.moveHandle = new Rect_default({
- style: dataZoomModel.getModel("moveHandleStyle").getItemStyle(),
- silent: true,
- shape: {
- r: [0, 0, 2, 2],
- y: size[1] - 0.5,
- height: moveHandleHeight
- }
- });
- var iconSize = moveHandleHeight * 0.8;
- var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get("moveHandleIcon"), -iconSize / 2, -iconSize / 2, iconSize, iconSize, "#fff", true);
- moveHandleIcon.silent = true;
- moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5;
- moveHandle_1.ensureState("emphasis").style = dataZoomModel.getModel(["emphasis", "moveHandleStyle"]).getItemStyle();
- var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10));
- actualMoveZone = displayables.moveZone = new Rect_default({
- invisible: true,
- shape: {
- y: size[1] - moveZoneExpandSize,
- height: moveHandleHeight + moveZoneExpandSize
- }
- });
- actualMoveZone.on("mouseover", function() {
- api.enterEmphasis(moveHandle_1);
- }).on("mouseout", function() {
- api.leaveEmphasis(moveHandle_1);
- });
- sliderGroup.add(moveHandle_1);
- sliderGroup.add(moveHandleIcon);
- sliderGroup.add(actualMoveZone);
- }
- actualMoveZone.attr({
- draggable: true,
- cursor: getCursor(this._orient),
- drift: bind(this._onDragMove, this, "all"),
- ondragstart: bind(this._showDataInfo, this, true),
- ondragend: bind(this._onDragEnd, this),
- onmouseover: bind(this._showDataInfo, this, true),
- onmouseout: bind(this._showDataInfo, this, false)
- });
- };
- SliderZoomView2.prototype._resetInterval = function() {
- var range = this._range = this.dataZoomModel.getPercentRange();
- var viewExtent = this._getViewExtent();
- this._handleEnds = [linearMap(range[0], [0, 100], viewExtent, true), linearMap(range[1], [0, 100], viewExtent, true)];
- };
- SliderZoomView2.prototype._updateInterval = function(handleIndex, delta) {
- var dataZoomModel = this.dataZoomModel;
- var handleEnds = this._handleEnds;
- var viewExtend = this._getViewExtent();
- var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();
- var percentExtent = [0, 100];
- 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);
- var lastRange = this._range;
- var range = this._range = asc([linearMap(handleEnds[0], viewExtend, percentExtent, true), linearMap(handleEnds[1], viewExtend, percentExtent, true)]);
- return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1];
- };
- SliderZoomView2.prototype._updateView = function(nonRealtime) {
- var displaybles = this._displayables;
- var handleEnds = this._handleEnds;
- var handleInterval = asc(handleEnds.slice());
- var size = this._size;
- each([0, 1], function(handleIndex) {
- var handle = displaybles.handles[handleIndex];
- var handleHeight = this._handleHeight;
- handle.attr({
- scaleX: handleHeight / 2,
- scaleY: handleHeight / 2,
- x: handleEnds[handleIndex] + (handleIndex ? -1 : 1),
- y: size[1] / 2 - handleHeight / 2
- });
- }, this);
- displaybles.filler.setShape({
- x: handleInterval[0],
- y: 0,
- width: handleInterval[1] - handleInterval[0],
- height: size[1]
- });
- var viewExtent = {
- x: handleInterval[0],
- width: handleInterval[1] - handleInterval[0]
- };
- if (displaybles.moveHandle) {
- displaybles.moveHandle.setShape(viewExtent);
- displaybles.moveZone.setShape(viewExtent);
- displaybles.moveZone.getBoundingRect();
- displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr("x", viewExtent.x + viewExtent.width / 2);
- }
- var dataShadowSegs = displaybles.dataShadowSegs;
- var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]];
- for (var i = 0; i < dataShadowSegs.length; i++) {
- var segGroup = dataShadowSegs[i];
- var clipPath = segGroup.getClipPath();
- if (!clipPath) {
- clipPath = new Rect_default();
- segGroup.setClipPath(clipPath);
- }
- clipPath.setShape({
- x: segIntervals[i],
- y: 0,
- width: segIntervals[i + 1] - segIntervals[i],
- height: size[1]
- });
- }
- this._updateDataInfo(nonRealtime);
- };
- SliderZoomView2.prototype._updateDataInfo = function(nonRealtime) {
- var dataZoomModel = this.dataZoomModel;
- var displaybles = this._displayables;
- var handleLabels = displaybles.handleLabels;
- var orient = this._orient;
- var labelTexts = ["", ""];
- if (dataZoomModel.get("showDetail")) {
- var axisProxy = dataZoomModel.findRepresentativeAxisProxy();
- if (axisProxy) {
- var axis = axisProxy.getAxisModel().axis;
- var range = this._range;
- var dataInterval = nonRealtime ? axisProxy.calculateDataWindow({
- start: range[0],
- end: range[1]
- }).valueWindow : axisProxy.getDataValueWindow();
- labelTexts = [this._formatLabel(dataInterval[0], axis), this._formatLabel(dataInterval[1], axis)];
- }
- }
- var orderedHandleEnds = asc(this._handleEnds.slice());
- setLabel.call(this, 0);
- setLabel.call(this, 1);
- function setLabel(handleIndex) {
- var barTransform = getTransform(displaybles.handles[handleIndex].parent, this.group);
- var direction = transformDirection(handleIndex === 0 ? "right" : "left", barTransform);
- var offset = this._handleWidth / 2 + LABEL_GAP;
- var textPoint = applyTransform([orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset), this._size[1] / 2], barTransform);
- handleLabels[handleIndex].setStyle({
- x: textPoint[0],
- y: textPoint[1],
- verticalAlign: orient === HORIZONTAL ? "middle" : direction,
- align: orient === HORIZONTAL ? direction : "center",
- text: labelTexts[handleIndex]
- });
- }
- };
- SliderZoomView2.prototype._formatLabel = function(value, axis) {
- var dataZoomModel = this.dataZoomModel;
- var labelFormatter = dataZoomModel.get("labelFormatter");
- var labelPrecision = dataZoomModel.get("labelPrecision");
- if (labelPrecision == null || labelPrecision === "auto") {
- labelPrecision = axis.getPixelPrecision();
- }
- var valueStr = value == null || isNaN(value) ? "" : axis.type === "category" || axis.type === "time" ? axis.scale.getLabel({
- value: Math.round(value)
- }) : value.toFixed(Math.min(labelPrecision, 20));
- return isFunction(labelFormatter) ? labelFormatter(value, valueStr) : isString(labelFormatter) ? labelFormatter.replace("{value}", valueStr) : valueStr;
- };
- SliderZoomView2.prototype._showDataInfo = function(showOrHide) {
- showOrHide = this._dragging || showOrHide;
- var displayables = this._displayables;
- var handleLabels = displayables.handleLabels;
- handleLabels[0].attr("invisible", !showOrHide);
- handleLabels[1].attr("invisible", !showOrHide);
- displayables.moveHandle && this.api[showOrHide ? "enterEmphasis" : "leaveEmphasis"](displayables.moveHandle, 1);
- };
- SliderZoomView2.prototype._onDragMove = function(handleIndex, dx, dy, event) {
- this._dragging = true;
- stop(event.event);
- var barTransform = this._displayables.sliderGroup.getLocalTransform();
- var vertex = applyTransform([dx, dy], barTransform, true);
- var changed = this._updateInterval(handleIndex, vertex[0]);
- var realtime = this.dataZoomModel.get("realtime");
- this._updateView(!realtime);
- changed && realtime && this._dispatchZoomAction(true);
- };
- SliderZoomView2.prototype._onDragEnd = function() {
- this._dragging = false;
- this._showDataInfo(false);
- var realtime = this.dataZoomModel.get("realtime");
- !realtime && this._dispatchZoomAction(false);
- };
- SliderZoomView2.prototype._onClickPanel = function(e) {
- var size = this._size;
- var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY);
- if (localPoint[0] < 0 || localPoint[0] > size[0] || localPoint[1] < 0 || localPoint[1] > size[1]) {
- return;
- }
- var handleEnds = this._handleEnds;
- var center = (handleEnds[0] + handleEnds[1]) / 2;
- var changed = this._updateInterval("all", localPoint[0] - center);
- this._updateView();
- changed && this._dispatchZoomAction(false);
- };
- SliderZoomView2.prototype._onBrushStart = function(e) {
- var x = e.offsetX;
- var y = e.offsetY;
- this._brushStart = new Point_default(x, y);
- this._brushing = true;
- this._brushStartTime = +new Date();
- };
- SliderZoomView2.prototype._onBrushEnd = function(e) {
- if (!this._brushing) {
- return;
- }
- var brushRect = this._displayables.brushRect;
- this._brushing = false;
- if (!brushRect) {
- return;
- }
- brushRect.attr("ignore", true);
- var brushShape = brushRect.shape;
- var brushEndTime = +new Date();
- if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) {
- return;
- }
- var viewExtend = this._getViewExtent();
- var percentExtent = [0, 100];
- this._range = asc([linearMap(brushShape.x, viewExtend, percentExtent, true), linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)]);
- this._handleEnds = [brushShape.x, brushShape.x + brushShape.width];
- this._updateView();
- this._dispatchZoomAction(false);
- };
- SliderZoomView2.prototype._onBrush = function(e) {
- if (this._brushing) {
- stop(e.event);
- this._updateBrushRect(e.offsetX, e.offsetY);
- }
- };
- SliderZoomView2.prototype._updateBrushRect = function(mouseX, mouseY) {
- var displayables = this._displayables;
- var dataZoomModel = this.dataZoomModel;
- var brushRect = displayables.brushRect;
- if (!brushRect) {
- brushRect = displayables.brushRect = new Rect({
- silent: true,
- style: dataZoomModel.getModel("brushStyle").getItemStyle()
- });
- displayables.sliderGroup.add(brushRect);
- }
- brushRect.attr("ignore", false);
- var brushStart = this._brushStart;
- var sliderGroup = this._displayables.sliderGroup;
- var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY);
- var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y);
- var size = this._size;
- endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0);
- brushRect.setShape({
- x: startPoint[0],
- y: 0,
- width: endPoint[0] - startPoint[0],
- height: size[1]
- });
- };
- SliderZoomView2.prototype._dispatchZoomAction = function(realtime) {
- var range = this._range;
- this.api.dispatchAction({
- type: "dataZoom",
- from: this.uid,
- dataZoomId: this.dataZoomModel.id,
- animation: realtime ? REALTIME_ANIMATION_CONFIG : null,
- start: range[0],
- end: range[1]
- });
- };
- SliderZoomView2.prototype._findCoordRect = function() {
- var rect;
- var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList;
- if (!rect && coordSysInfoList.length) {
- var coordSys = coordSysInfoList[0].model.coordinateSystem;
- rect = coordSys.getRect && coordSys.getRect();
- }
- if (!rect) {
- var width = this.api.getWidth();
- var height = this.api.getHeight();
- rect = {
- x: width * 0.2,
- y: height * 0.2,
- width: width * 0.6,
- height: height * 0.6
- };
- }
- return rect;
- };
- SliderZoomView2.type = "dataZoom.slider";
- return SliderZoomView2;
- }(DataZoomView_default);
- function getOtherDim(thisDim) {
- var map2 = {
- x: "y",
- y: "x",
- radius: "angle",
- angle: "radius"
- };
- return map2[thisDim];
- }
- function getCursor(orient) {
- return orient === "vertical" ? "ns-resize" : "ew-resize";
- }
- var SliderZoomView_default = SliderZoomView;
- // node_modules/echarts/lib/component/dataZoom/installDataZoomSlider.js
- function install24(registers) {
- registers.registerComponentModel(SliderZoomModel_default);
- registers.registerComponentView(SliderZoomView_default);
- installCommon(registers);
- }
- // node_modules/echarts/lib/component/dataZoom/install.js
- function install25(registers) {
- use(install23);
- use(install24);
- }
- // node_modules/echarts/lib/component/visualMap/install.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/visualMap/installVisualMapContinuous.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/visualMap/ContinuousModel.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/visualMap/VisualMapModel.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/visual/visualDefault.js
- init_define_APP_INFO();
- var visualDefault = {
- get: function(visualType, key, isCategory) {
- var value = clone((defaultOption[visualType] || {})[key]);
- return isCategory ? isArray(value) ? value[value.length - 1] : value : value;
- }
- };
- var defaultOption = {
- color: {
- active: ["#006edd", "#e0ffff"],
- inactive: ["rgba(0,0,0,0)"]
- },
- colorHue: {
- active: [0, 360],
- inactive: [0, 0]
- },
- colorSaturation: {
- active: [0.3, 1],
- inactive: [0, 0]
- },
- colorLightness: {
- active: [0.9, 0.5],
- inactive: [0, 0]
- },
- colorAlpha: {
- active: [0.3, 1],
- inactive: [0, 0]
- },
- opacity: {
- active: [0.3, 1],
- inactive: [0, 0]
- },
- symbol: {
- active: ["circle", "roundRect", "diamond"],
- inactive: ["none"]
- },
- symbolSize: {
- active: [10, 50],
- inactive: [0, 0]
- }
- };
- var visualDefault_default = visualDefault;
- // node_modules/echarts/lib/component/visualMap/VisualMapModel.js
- var mapVisual = VisualMapping_default.mapVisual;
- var eachVisual = VisualMapping_default.eachVisual;
- var isArray2 = isArray;
- var each8 = each;
- var asc3 = asc;
- var linearMap2 = linearMap;
- var VisualMapModel = function(_super) {
- __extends(VisualMapModel2, _super);
- function VisualMapModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = VisualMapModel2.type;
- _this.stateList = ["inRange", "outOfRange"];
- _this.replacableOptionKeys = ["inRange", "outOfRange", "target", "controller", "color"];
- _this.layoutMode = {
- type: "box",
- ignoreSize: true
- };
- _this.dataBound = [-Infinity, Infinity];
- _this.targetVisuals = {};
- _this.controllerVisuals = {};
- return _this;
- }
- VisualMapModel2.prototype.init = function(option, parentModel, ecModel) {
- this.mergeDefaultAndTheme(option, ecModel);
- };
- VisualMapModel2.prototype.optionUpdated = function(newOption, isInit) {
- var thisOption = this.option;
- !isInit && replaceVisualOption(thisOption, newOption, this.replacableOptionKeys);
- this.textStyleModel = this.getModel("textStyle");
- this.resetItemSize();
- this.completeVisualOption();
- };
- VisualMapModel2.prototype.resetVisual = function(supplementVisualOption) {
- var stateList = this.stateList;
- supplementVisualOption = bind(supplementVisualOption, this);
- this.controllerVisuals = createVisualMappings(this.option.controller, stateList, supplementVisualOption);
- this.targetVisuals = createVisualMappings(this.option.target, stateList, supplementVisualOption);
- };
- VisualMapModel2.prototype.getItemSymbol = function() {
- return null;
- };
- VisualMapModel2.prototype.getTargetSeriesIndices = function() {
- var optionSeriesIndex = this.option.seriesIndex;
- var seriesIndices = [];
- if (optionSeriesIndex == null || optionSeriesIndex === "all") {
- this.ecModel.eachSeries(function(seriesModel, index) {
- seriesIndices.push(index);
- });
- } else {
- seriesIndices = normalizeToArray(optionSeriesIndex);
- }
- return seriesIndices;
- };
- VisualMapModel2.prototype.eachTargetSeries = function(callback, context) {
- each(this.getTargetSeriesIndices(), function(seriesIndex) {
- var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex);
- if (seriesModel) {
- callback.call(context, seriesModel);
- }
- }, this);
- };
- VisualMapModel2.prototype.isTargetSeries = function(seriesModel) {
- var is = false;
- this.eachTargetSeries(function(model) {
- model === seriesModel && (is = true);
- });
- return is;
- };
- VisualMapModel2.prototype.formatValueText = function(value, isCategory, edgeSymbols) {
- var option = this.option;
- var precision = option.precision;
- var dataBound = this.dataBound;
- var formatter = option.formatter;
- var isMinMax;
- edgeSymbols = edgeSymbols || ["<", ">"];
- if (isArray(value)) {
- value = value.slice();
- isMinMax = true;
- }
- var textValue = isCategory ? value : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value);
- if (isString(formatter)) {
- return formatter.replace("{value}", isMinMax ? textValue[0] : textValue).replace("{value2}", isMinMax ? textValue[1] : textValue);
- } else if (isFunction(formatter)) {
- return isMinMax ? formatter(value[0], value[1]) : formatter(value);
- }
- if (isMinMax) {
- if (value[0] === dataBound[0]) {
- return edgeSymbols[0] + " " + textValue[1];
- } else if (value[1] === dataBound[1]) {
- return edgeSymbols[1] + " " + textValue[0];
- } else {
- return textValue[0] + " - " + textValue[1];
- }
- } else {
- return textValue;
- }
- function toFixed(val) {
- return val === dataBound[0] ? "min" : val === dataBound[1] ? "max" : (+val).toFixed(Math.min(precision, 20));
- }
- };
- VisualMapModel2.prototype.resetExtent = function() {
- var thisOption = this.option;
- var extent = asc3([thisOption.min, thisOption.max]);
- this._dataExtent = extent;
- };
- VisualMapModel2.prototype.getDataDimensionIndex = function(data) {
- var optDim = this.option.dimension;
- if (optDim != null) {
- return data.getDimensionIndex(optDim);
- }
- var dimNames = data.dimensions;
- for (var i = dimNames.length - 1; i >= 0; i--) {
- var dimName = dimNames[i];
- var dimInfo = data.getDimensionInfo(dimName);
- if (!dimInfo.isCalculationCoord) {
- return dimInfo.storeDimIndex;
- }
- }
- };
- VisualMapModel2.prototype.getExtent = function() {
- return this._dataExtent.slice();
- };
- VisualMapModel2.prototype.completeVisualOption = function() {
- var ecModel = this.ecModel;
- var thisOption = this.option;
- var base = {
- inRange: thisOption.inRange,
- outOfRange: thisOption.outOfRange
- };
- var target = thisOption.target || (thisOption.target = {});
- var controller = thisOption.controller || (thisOption.controller = {});
- merge(target, base);
- merge(controller, base);
- var isCategory = this.isCategory();
- completeSingle.call(this, target);
- completeSingle.call(this, controller);
- completeInactive.call(this, target, "inRange", "outOfRange");
- completeController.call(this, controller);
- function completeSingle(base2) {
- if (isArray2(thisOption.color) && !base2.inRange) {
- base2.inRange = {
- color: thisOption.color.slice().reverse()
- };
- }
- base2.inRange = base2.inRange || {
- color: ecModel.get("gradientColor")
- };
- }
- function completeInactive(base2, stateExist, stateAbsent) {
- var optExist = base2[stateExist];
- var optAbsent = base2[stateAbsent];
- if (optExist && !optAbsent) {
- optAbsent = base2[stateAbsent] = {};
- each8(optExist, function(visualData, visualType) {
- if (!VisualMapping_default.isValidType(visualType)) {
- return;
- }
- var defa = visualDefault_default.get(visualType, "inactive", isCategory);
- if (defa != null) {
- optAbsent[visualType] = defa;
- if (visualType === "color" && !optAbsent.hasOwnProperty("opacity") && !optAbsent.hasOwnProperty("colorAlpha")) {
- optAbsent.opacity = [0, 0];
- }
- }
- });
- }
- }
- function completeController(controller2) {
- var symbolExists = (controller2.inRange || {}).symbol || (controller2.outOfRange || {}).symbol;
- var symbolSizeExists = (controller2.inRange || {}).symbolSize || (controller2.outOfRange || {}).symbolSize;
- var inactiveColor = this.get("inactiveColor");
- var itemSymbol = this.getItemSymbol();
- var defaultSymbol = itemSymbol || "roundRect";
- each8(this.stateList, function(state) {
- var itemSize = this.itemSize;
- var visuals = controller2[state];
- if (!visuals) {
- visuals = controller2[state] = {
- color: isCategory ? inactiveColor : [inactiveColor]
- };
- }
- if (visuals.symbol == null) {
- visuals.symbol = symbolExists && clone(symbolExists) || (isCategory ? defaultSymbol : [defaultSymbol]);
- }
- if (visuals.symbolSize == null) {
- visuals.symbolSize = symbolSizeExists && clone(symbolSizeExists) || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);
- }
- visuals.symbol = mapVisual(visuals.symbol, function(symbol) {
- return symbol === "none" ? defaultSymbol : symbol;
- });
- var symbolSize = visuals.symbolSize;
- if (symbolSize != null) {
- var max_1 = -Infinity;
- eachVisual(symbolSize, function(value) {
- value > max_1 && (max_1 = value);
- });
- visuals.symbolSize = mapVisual(symbolSize, function(value) {
- return linearMap2(value, [0, max_1], [0, itemSize[0]], true);
- });
- }
- }, this);
- }
- };
- VisualMapModel2.prototype.resetItemSize = function() {
- this.itemSize = [parseFloat(this.get("itemWidth")), parseFloat(this.get("itemHeight"))];
- };
- VisualMapModel2.prototype.isCategory = function() {
- return !!this.option.categories;
- };
- VisualMapModel2.prototype.setSelected = function(selected) {
- };
- VisualMapModel2.prototype.getSelected = function() {
- return null;
- };
- VisualMapModel2.prototype.getValueState = function(value) {
- return null;
- };
- VisualMapModel2.prototype.getVisualMeta = function(getColorVisual2) {
- return null;
- };
- VisualMapModel2.type = "visualMap";
- VisualMapModel2.dependencies = ["series"];
- VisualMapModel2.defaultOption = {
- show: true,
- z: 4,
- seriesIndex: "all",
- min: 0,
- max: 200,
- left: 0,
- right: null,
- top: null,
- bottom: 0,
- itemWidth: null,
- itemHeight: null,
- inverse: false,
- orient: "vertical",
- backgroundColor: "rgba(0,0,0,0)",
- borderColor: "#ccc",
- contentColor: "#5793f3",
- inactiveColor: "#aaa",
- borderWidth: 0,
- padding: 5,
- textGap: 10,
- precision: 0,
- textStyle: {
- color: "#333"
- }
- };
- return VisualMapModel2;
- }(Component_default);
- var VisualMapModel_default = VisualMapModel;
- // node_modules/echarts/lib/component/visualMap/ContinuousModel.js
- var DEFAULT_BAR_BOUND = [20, 140];
- var ContinuousModel = function(_super) {
- __extends(ContinuousModel2, _super);
- function ContinuousModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = ContinuousModel2.type;
- return _this;
- }
- ContinuousModel2.prototype.optionUpdated = function(newOption, isInit) {
- _super.prototype.optionUpdated.apply(this, arguments);
- this.resetExtent();
- this.resetVisual(function(mappingOption) {
- mappingOption.mappingMethod = "linear";
- mappingOption.dataExtent = this.getExtent();
- });
- this._resetRange();
- };
- ContinuousModel2.prototype.resetItemSize = function() {
- _super.prototype.resetItemSize.apply(this, arguments);
- var itemSize = this.itemSize;
- (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]);
- (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]);
- };
- ContinuousModel2.prototype._resetRange = function() {
- var dataExtent = this.getExtent();
- var range = this.option.range;
- if (!range || range.auto) {
- dataExtent.auto = 1;
- this.option.range = dataExtent;
- } else if (isArray(range)) {
- if (range[0] > range[1]) {
- range.reverse();
- }
- range[0] = Math.max(range[0], dataExtent[0]);
- range[1] = Math.min(range[1], dataExtent[1]);
- }
- };
- ContinuousModel2.prototype.completeVisualOption = function() {
- _super.prototype.completeVisualOption.apply(this, arguments);
- each(this.stateList, function(state) {
- var symbolSize = this.option.controller[state].symbolSize;
- if (symbolSize && symbolSize[0] !== symbolSize[1]) {
- symbolSize[0] = symbolSize[1] / 3;
- }
- }, this);
- };
- ContinuousModel2.prototype.setSelected = function(selected) {
- this.option.range = selected.slice();
- this._resetRange();
- };
- ContinuousModel2.prototype.getSelected = function() {
- var dataExtent = this.getExtent();
- var dataInterval = asc((this.get("range") || []).slice());
- dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]);
- dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]);
- dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]);
- dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]);
- return dataInterval;
- };
- ContinuousModel2.prototype.getValueState = function(value) {
- var range = this.option.range;
- var dataExtent = this.getExtent();
- return (range[0] <= dataExtent[0] || range[0] <= value) && (range[1] >= dataExtent[1] || value <= range[1]) ? "inRange" : "outOfRange";
- };
- ContinuousModel2.prototype.findTargetDataIndices = function(range) {
- var result = [];
- this.eachTargetSeries(function(seriesModel) {
- var dataIndices = [];
- var data = seriesModel.getData();
- data.each(this.getDataDimensionIndex(data), function(value, dataIndex) {
- range[0] <= value && value <= range[1] && dataIndices.push(dataIndex);
- }, this);
- result.push({
- seriesId: seriesModel.id,
- dataIndex: dataIndices
- });
- }, this);
- return result;
- };
- ContinuousModel2.prototype.getVisualMeta = function(getColorVisual2) {
- var oVals = getColorStopValues(this, "outOfRange", this.getExtent());
- var iVals = getColorStopValues(this, "inRange", this.option.range.slice());
- var stops = [];
- function setStop(value, valueState) {
- stops.push({
- value,
- color: getColorVisual2(value, valueState)
- });
- }
- var iIdx = 0;
- var oIdx = 0;
- var iLen = iVals.length;
- var oLen = oVals.length;
- for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) {
- if (oVals[oIdx] < iVals[iIdx]) {
- setStop(oVals[oIdx], "outOfRange");
- }
- }
- for (var first = 1; iIdx < iLen; iIdx++, first = 0) {
- first && stops.length && setStop(iVals[iIdx], "outOfRange");
- setStop(iVals[iIdx], "inRange");
- }
- for (var first = 1; oIdx < oLen; oIdx++) {
- if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) {
- if (first) {
- stops.length && setStop(stops[stops.length - 1].value, "outOfRange");
- first = 0;
- }
- setStop(oVals[oIdx], "outOfRange");
- }
- }
- var stopsLen = stops.length;
- return {
- stops,
- outerColors: [stopsLen ? stops[0].color : "transparent", stopsLen ? stops[stopsLen - 1].color : "transparent"]
- };
- };
- ContinuousModel2.type = "visualMap.continuous";
- ContinuousModel2.defaultOption = inheritDefaultOption(VisualMapModel_default.defaultOption, {
- align: "auto",
- calculable: false,
- hoverLink: true,
- realtime: true,
- handleIcon: "path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",
- handleSize: "120%",
- handleStyle: {
- borderColor: "#fff",
- borderWidth: 1
- },
- indicatorIcon: "circle",
- indicatorSize: "50%",
- indicatorStyle: {
- borderColor: "#fff",
- borderWidth: 2,
- shadowBlur: 2,
- shadowOffsetX: 1,
- shadowOffsetY: 1,
- shadowColor: "rgba(0,0,0,0.2)"
- }
- });
- return ContinuousModel2;
- }(VisualMapModel_default);
- function getColorStopValues(visualMapModel, valueState, dataExtent) {
- if (dataExtent[0] === dataExtent[1]) {
- return dataExtent.slice();
- }
- var count2 = 200;
- var step = (dataExtent[1] - dataExtent[0]) / count2;
- var value = dataExtent[0];
- var stopValues = [];
- for (var i = 0; i <= count2 && value < dataExtent[1]; i++) {
- stopValues.push(value);
- value += step;
- }
- stopValues.push(dataExtent[1]);
- return stopValues;
- }
- var ContinuousModel_default = ContinuousModel;
- // node_modules/echarts/lib/component/visualMap/ContinuousView.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/visualMap/VisualMapView.js
- init_define_APP_INFO();
- var VisualMapView = function(_super) {
- __extends(VisualMapView2, _super);
- function VisualMapView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = VisualMapView2.type;
- _this.autoPositionValues = {
- left: 1,
- right: 1,
- top: 1,
- bottom: 1
- };
- return _this;
- }
- VisualMapView2.prototype.init = function(ecModel, api) {
- this.ecModel = ecModel;
- this.api = api;
- };
- VisualMapView2.prototype.render = function(visualMapModel, ecModel, api, payload) {
- this.visualMapModel = visualMapModel;
- if (visualMapModel.get("show") === false) {
- this.group.removeAll();
- return;
- }
- this.doRender(visualMapModel, ecModel, api, payload);
- };
- VisualMapView2.prototype.renderBackground = function(group) {
- var visualMapModel = this.visualMapModel;
- var padding = normalizeCssArray(visualMapModel.get("padding") || 0);
- var rect = group.getBoundingRect();
- group.add(new Rect_default({
- z2: -1,
- silent: true,
- shape: {
- x: rect.x - padding[3],
- y: rect.y - padding[0],
- width: rect.width + padding[3] + padding[1],
- height: rect.height + padding[0] + padding[2]
- },
- style: {
- fill: visualMapModel.get("backgroundColor"),
- stroke: visualMapModel.get("borderColor"),
- lineWidth: visualMapModel.get("borderWidth")
- }
- }));
- };
- VisualMapView2.prototype.getControllerVisual = function(targetValue, visualCluster, opts) {
- opts = opts || {};
- var forceState = opts.forceState;
- var visualMapModel = this.visualMapModel;
- var visualObj = {};
- if (visualCluster === "color") {
- var defaultColor = visualMapModel.get("contentColor");
- visualObj.color = defaultColor;
- }
- function getter(key) {
- return visualObj[key];
- }
- function setter(key, value) {
- visualObj[key] = value;
- }
- var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)];
- var visualTypes = VisualMapping_default.prepareVisualTypes(mappings);
- each(visualTypes, function(type) {
- var visualMapping = mappings[type];
- if (opts.convertOpacityToAlpha && type === "opacity") {
- type = "colorAlpha";
- visualMapping = mappings.__alphaForOpacity;
- }
- if (VisualMapping_default.dependsOn(type, visualCluster)) {
- visualMapping && visualMapping.applyVisual(targetValue, getter, setter);
- }
- });
- return visualObj[visualCluster];
- };
- VisualMapView2.prototype.positionGroup = function(group) {
- var model = this.visualMapModel;
- var api = this.api;
- positionElement(group, model.getBoxLayoutParams(), {
- width: api.getWidth(),
- height: api.getHeight()
- });
- };
- VisualMapView2.prototype.doRender = function(visualMapModel, ecModel, api, payload) {
- };
- VisualMapView2.type = "visualMap";
- return VisualMapView2;
- }(Component_default2);
- var VisualMapView_default = VisualMapView;
- // node_modules/echarts/lib/component/visualMap/helper.js
- init_define_APP_INFO();
- var paramsSet = [["left", "right", "width"], ["top", "bottom", "height"]];
- function getItemAlign(visualMapModel, api, itemSize) {
- var modelOption = visualMapModel.option;
- var itemAlign = modelOption.align;
- if (itemAlign != null && itemAlign !== "auto") {
- return itemAlign;
- }
- var ecSize = {
- width: api.getWidth(),
- height: api.getHeight()
- };
- var realIndex = modelOption.orient === "horizontal" ? 1 : 0;
- var reals = paramsSet[realIndex];
- var fakeValue = [0, null, 10];
- var layoutInput = {};
- for (var i = 0; i < 3; i++) {
- layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i];
- layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]];
- }
- var rParam = [["x", "width", 3], ["y", "height", 0]][realIndex];
- var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding);
- return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 < ecSize[rParam[1]] * 0.5 ? 0 : 1];
- }
- function makeHighDownBatch(batch, visualMapModel) {
- each(batch || [], function(batchItem) {
- if (batchItem.dataIndex != null) {
- batchItem.dataIndexInside = batchItem.dataIndex;
- batchItem.dataIndex = null;
- }
- batchItem.highlightKey = "visualMap" + (visualMapModel ? visualMapModel.componentIndex : "");
- });
- return batch;
- }
- // node_modules/echarts/lib/component/visualMap/ContinuousView.js
- var linearMap3 = linearMap;
- var each9 = each;
- var mathMin = Math.min;
- var mathMax = Math.max;
- var HOVER_LINK_SIZE = 12;
- var HOVER_LINK_OUT = 6;
- var ContinuousView = function(_super) {
- __extends(ContinuousView2, _super);
- function ContinuousView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = ContinuousView2.type;
- _this._shapes = {};
- _this._dataInterval = [];
- _this._handleEnds = [];
- _this._hoverLinkDataIndices = [];
- return _this;
- }
- ContinuousView2.prototype.doRender = function(visualMapModel, ecModel, api, payload) {
- this._api = api;
- if (!payload || payload.type !== "selectDataRange" || payload.from !== this.uid) {
- this._buildView();
- }
- };
- ContinuousView2.prototype._buildView = function() {
- this.group.removeAll();
- var visualMapModel = this.visualMapModel;
- var thisGroup = this.group;
- this._orient = visualMapModel.get("orient");
- this._useHandle = visualMapModel.get("calculable");
- this._resetInterval();
- this._renderBar(thisGroup);
- var dataRangeText = visualMapModel.get("text");
- this._renderEndsText(thisGroup, dataRangeText, 0);
- this._renderEndsText(thisGroup, dataRangeText, 1);
- this._updateView(true);
- this.renderBackground(thisGroup);
- this._updateView();
- this._enableHoverLinkToSeries();
- this._enableHoverLinkFromSeries();
- this.positionGroup(thisGroup);
- };
- ContinuousView2.prototype._renderEndsText = function(group, dataRangeText, endsIndex) {
- if (!dataRangeText) {
- return;
- }
- var text = dataRangeText[1 - endsIndex];
- text = text != null ? text + "" : "";
- var visualMapModel = this.visualMapModel;
- var textGap = visualMapModel.get("textGap");
- var itemSize = visualMapModel.itemSize;
- var barGroup = this._shapes.mainGroup;
- var position = this._applyTransform([itemSize[0] / 2, endsIndex === 0 ? -textGap : itemSize[1] + textGap], barGroup);
- var align = this._applyTransform(endsIndex === 0 ? "bottom" : "top", barGroup);
- var orient = this._orient;
- var textStyleModel = this.visualMapModel.textStyleModel;
- this.group.add(new Text_default({
- style: createTextStyle(textStyleModel, {
- x: position[0],
- y: position[1],
- verticalAlign: orient === "horizontal" ? "middle" : align,
- align: orient === "horizontal" ? align : "center",
- text
- })
- }));
- };
- ContinuousView2.prototype._renderBar = function(targetGroup) {
- var visualMapModel = this.visualMapModel;
- var shapes = this._shapes;
- var itemSize = visualMapModel.itemSize;
- var orient = this._orient;
- var useHandle = this._useHandle;
- var itemAlign = getItemAlign(visualMapModel, this.api, itemSize);
- var mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign);
- var gradientBarGroup = new Group_default();
- mainGroup.add(gradientBarGroup);
- gradientBarGroup.add(shapes.outOfRange = createPolygon());
- gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor2(this._orient) : null, bind(this._dragHandle, this, "all", false), bind(this._dragHandle, this, "all", true)));
- gradientBarGroup.setClipPath(new Rect_default({
- shape: {
- x: 0,
- y: 0,
- width: itemSize[0],
- height: itemSize[1],
- r: 3
- }
- }));
- var textRect = visualMapModel.textStyleModel.getTextRect("\u56FD");
- var textSize = mathMax(textRect.width, textRect.height);
- if (useHandle) {
- shapes.handleThumbs = [];
- shapes.handleLabels = [];
- shapes.handleLabelPoints = [];
- this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient);
- this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient);
- }
- this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient);
- targetGroup.add(mainGroup);
- };
- ContinuousView2.prototype._createHandle = function(visualMapModel, mainGroup, handleIndex, itemSize, textSize, orient) {
- var onDrift = bind(this._dragHandle, this, handleIndex, false);
- var onDragEnd = bind(this._dragHandle, this, handleIndex, true);
- var handleSize = parsePercent(visualMapModel.get("handleSize"), itemSize[0]);
- var handleThumb = createSymbol(visualMapModel.get("handleIcon"), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true);
- var cursor = getCursor2(this._orient);
- handleThumb.attr({
- cursor,
- draggable: true,
- drift: onDrift,
- ondragend: onDragEnd,
- onmousemove: function(e) {
- stop(e.event);
- }
- });
- handleThumb.x = itemSize[0] / 2;
- handleThumb.useStyle(visualMapModel.getModel("handleStyle").getItemStyle());
- handleThumb.setStyle({
- strokeNoScale: true,
- strokeFirst: true
- });
- handleThumb.style.lineWidth *= 2;
- handleThumb.ensureState("emphasis").style = visualMapModel.getModel(["emphasis", "handleStyle"]).getItemStyle();
- setAsHighDownDispatcher(handleThumb, true);
- mainGroup.add(handleThumb);
- var textStyleModel = this.visualMapModel.textStyleModel;
- var handleLabel = new Text_default({
- cursor,
- draggable: true,
- drift: onDrift,
- onmousemove: function(e) {
- stop(e.event);
- },
- ondragend: onDragEnd,
- style: createTextStyle(textStyleModel, {
- x: 0,
- y: 0,
- text: ""
- })
- });
- handleLabel.ensureState("blur").style = {
- opacity: 0.1
- };
- handleLabel.stateTransition = {
- duration: 200
- };
- this.group.add(handleLabel);
- var handleLabelPoint = [handleSize, 0];
- var shapes = this._shapes;
- shapes.handleThumbs[handleIndex] = handleThumb;
- shapes.handleLabelPoints[handleIndex] = handleLabelPoint;
- shapes.handleLabels[handleIndex] = handleLabel;
- };
- ContinuousView2.prototype._createIndicator = function(visualMapModel, mainGroup, itemSize, textSize, orient) {
- var scale = parsePercent(visualMapModel.get("indicatorSize"), itemSize[0]);
- var indicator = createSymbol(visualMapModel.get("indicatorIcon"), -scale / 2, -scale / 2, scale, scale, null, true);
- indicator.attr({
- cursor: "move",
- invisible: true,
- silent: true,
- x: itemSize[0] / 2
- });
- var indicatorStyle = visualMapModel.getModel("indicatorStyle").getItemStyle();
- if (indicator instanceof Image_default) {
- var pathStyle = indicator.style;
- indicator.useStyle(extend({
- image: pathStyle.image,
- x: pathStyle.x,
- y: pathStyle.y,
- width: pathStyle.width,
- height: pathStyle.height
- }, indicatorStyle));
- } else {
- indicator.useStyle(indicatorStyle);
- }
- mainGroup.add(indicator);
- var textStyleModel = this.visualMapModel.textStyleModel;
- var indicatorLabel = new Text_default({
- silent: true,
- invisible: true,
- style: createTextStyle(textStyleModel, {
- x: 0,
- y: 0,
- text: ""
- })
- });
- this.group.add(indicatorLabel);
- var indicatorLabelPoint = [(orient === "horizontal" ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2, 0];
- var shapes = this._shapes;
- shapes.indicator = indicator;
- shapes.indicatorLabel = indicatorLabel;
- shapes.indicatorLabelPoint = indicatorLabelPoint;
- this._firstShowIndicator = true;
- };
- ContinuousView2.prototype._dragHandle = function(handleIndex, isEnd, dx, dy) {
- if (!this._useHandle) {
- return;
- }
- this._dragging = !isEnd;
- if (!isEnd) {
- var vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true);
- this._updateInterval(handleIndex, vertex[1]);
- this._hideIndicator();
- this._updateView();
- }
- if (isEnd === !this.visualMapModel.get("realtime")) {
- this.api.dispatchAction({
- type: "selectDataRange",
- from: this.uid,
- visualMapId: this.visualMapModel.id,
- selected: this._dataInterval.slice()
- });
- }
- if (isEnd) {
- !this._hovering && this._clearHoverLinkToSeries();
- } else if (useHoverLinkOnHandle(this.visualMapModel)) {
- this._doHoverLinkToSeries(this._handleEnds[handleIndex], false);
- }
- };
- ContinuousView2.prototype._resetInterval = function() {
- var visualMapModel = this.visualMapModel;
- var dataInterval = this._dataInterval = visualMapModel.getSelected();
- var dataExtent = visualMapModel.getExtent();
- var sizeExtent = [0, visualMapModel.itemSize[1]];
- this._handleEnds = [linearMap3(dataInterval[0], dataExtent, sizeExtent, true), linearMap3(dataInterval[1], dataExtent, sizeExtent, true)];
- };
- ContinuousView2.prototype._updateInterval = function(handleIndex, delta) {
- delta = delta || 0;
- var visualMapModel = this.visualMapModel;
- var handleEnds = this._handleEnds;
- var sizeExtent = [0, visualMapModel.itemSize[1]];
- sliderMove(
- delta,
- handleEnds,
- sizeExtent,
- handleIndex,
- 0
- );
- var dataExtent = visualMapModel.getExtent();
- this._dataInterval = [linearMap3(handleEnds[0], sizeExtent, dataExtent, true), linearMap3(handleEnds[1], sizeExtent, dataExtent, true)];
- };
- ContinuousView2.prototype._updateView = function(forSketch) {
- var visualMapModel = this.visualMapModel;
- var dataExtent = visualMapModel.getExtent();
- var shapes = this._shapes;
- var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]];
- var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds;
- var visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, "inRange");
- var visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, "outOfRange");
- shapes.inRange.setStyle({
- fill: visualInRange.barColor
- }).setShape("points", visualInRange.barPoints);
- shapes.outOfRange.setStyle({
- fill: visualOutOfRange.barColor
- }).setShape("points", visualOutOfRange.barPoints);
- this._updateHandle(inRangeHandleEnds, visualInRange);
- };
- ContinuousView2.prototype._createBarVisual = function(dataInterval, dataExtent, handleEnds, forceState) {
- var opts = {
- forceState,
- convertOpacityToAlpha: true
- };
- var colorStops = this._makeColorGradient(dataInterval, opts);
- var symbolSizes = [this.getControllerVisual(dataInterval[0], "symbolSize", opts), this.getControllerVisual(dataInterval[1], "symbolSize", opts)];
- var barPoints = this._createBarPoints(handleEnds, symbolSizes);
- return {
- barColor: new LinearGradient_default(0, 0, 0, 1, colorStops),
- barPoints,
- handlesColor: [colorStops[0].color, colorStops[colorStops.length - 1].color]
- };
- };
- ContinuousView2.prototype._makeColorGradient = function(dataInterval, opts) {
- var sampleNumber = 100;
- var colorStops = [];
- var step = (dataInterval[1] - dataInterval[0]) / sampleNumber;
- colorStops.push({
- color: this.getControllerVisual(dataInterval[0], "color", opts),
- offset: 0
- });
- for (var i = 1; i < sampleNumber; i++) {
- var currValue = dataInterval[0] + step * i;
- if (currValue > dataInterval[1]) {
- break;
- }
- colorStops.push({
- color: this.getControllerVisual(currValue, "color", opts),
- offset: i / sampleNumber
- });
- }
- colorStops.push({
- color: this.getControllerVisual(dataInterval[1], "color", opts),
- offset: 1
- });
- return colorStops;
- };
- ContinuousView2.prototype._createBarPoints = function(handleEnds, symbolSizes) {
- var itemSize = this.visualMapModel.itemSize;
- return [[itemSize[0] - symbolSizes[0], handleEnds[0]], [itemSize[0], handleEnds[0]], [itemSize[0], handleEnds[1]], [itemSize[0] - symbolSizes[1], handleEnds[1]]];
- };
- ContinuousView2.prototype._createBarGroup = function(itemAlign) {
- var orient = this._orient;
- var inverse = this.visualMapModel.get("inverse");
- return new Group_default(orient === "horizontal" && !inverse ? {
- scaleX: itemAlign === "bottom" ? 1 : -1,
- rotation: Math.PI / 2
- } : orient === "horizontal" && inverse ? {
- scaleX: itemAlign === "bottom" ? -1 : 1,
- rotation: -Math.PI / 2
- } : orient === "vertical" && !inverse ? {
- scaleX: itemAlign === "left" ? 1 : -1,
- scaleY: -1
- } : {
- scaleX: itemAlign === "left" ? 1 : -1
- });
- };
- ContinuousView2.prototype._updateHandle = function(handleEnds, visualInRange) {
- if (!this._useHandle) {
- return;
- }
- var shapes = this._shapes;
- var visualMapModel = this.visualMapModel;
- var handleThumbs = shapes.handleThumbs;
- var handleLabels = shapes.handleLabels;
- var itemSize = visualMapModel.itemSize;
- var dataExtent = visualMapModel.getExtent();
- each9([0, 1], function(handleIndex) {
- var handleThumb = handleThumbs[handleIndex];
- handleThumb.setStyle("fill", visualInRange.handlesColor[handleIndex]);
- handleThumb.y = handleEnds[handleIndex];
- var val = linearMap3(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true);
- var symbolSize = this.getControllerVisual(val, "symbolSize");
- handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0];
- handleThumb.x = itemSize[0] - symbolSize / 2;
- var textPoint = applyTransform(shapes.handleLabelPoints[handleIndex], getTransform(handleThumb, this.group));
- handleLabels[handleIndex].setStyle({
- x: textPoint[0],
- y: textPoint[1],
- text: visualMapModel.formatValueText(this._dataInterval[handleIndex]),
- verticalAlign: "middle",
- align: this._orient === "vertical" ? this._applyTransform("left", shapes.mainGroup) : "center"
- });
- }, this);
- };
- ContinuousView2.prototype._showIndicator = function(cursorValue, textValue, rangeSymbol, halfHoverLinkSize) {
- var visualMapModel = this.visualMapModel;
- var dataExtent = visualMapModel.getExtent();
- var itemSize = visualMapModel.itemSize;
- var sizeExtent = [0, itemSize[1]];
- var shapes = this._shapes;
- var indicator = shapes.indicator;
- if (!indicator) {
- return;
- }
- indicator.attr("invisible", false);
- var opts = {
- convertOpacityToAlpha: true
- };
- var color = this.getControllerVisual(cursorValue, "color", opts);
- var symbolSize = this.getControllerVisual(cursorValue, "symbolSize");
- var y = linearMap3(cursorValue, dataExtent, sizeExtent, true);
- var x = itemSize[0] - symbolSize / 2;
- var oldIndicatorPos = {
- x: indicator.x,
- y: indicator.y
- };
- indicator.y = y;
- indicator.x = x;
- var textPoint = applyTransform(shapes.indicatorLabelPoint, getTransform(indicator, this.group));
- var indicatorLabel = shapes.indicatorLabel;
- indicatorLabel.attr("invisible", false);
- var align = this._applyTransform("left", shapes.mainGroup);
- var orient = this._orient;
- var isHorizontal = orient === "horizontal";
- indicatorLabel.setStyle({
- text: (rangeSymbol ? rangeSymbol : "") + visualMapModel.formatValueText(textValue),
- verticalAlign: isHorizontal ? align : "middle",
- align: isHorizontal ? "center" : align
- });
- var indicatorNewProps = {
- x,
- y,
- style: {
- fill: color
- }
- };
- var labelNewProps = {
- style: {
- x: textPoint[0],
- y: textPoint[1]
- }
- };
- if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {
- var animationCfg = {
- duration: 100,
- easing: "cubicInOut",
- additive: true
- };
- indicator.x = oldIndicatorPos.x;
- indicator.y = oldIndicatorPos.y;
- indicator.animateTo(indicatorNewProps, animationCfg);
- indicatorLabel.animateTo(labelNewProps, animationCfg);
- } else {
- indicator.attr(indicatorNewProps);
- indicatorLabel.attr(labelNewProps);
- }
- this._firstShowIndicator = false;
- var handleLabels = this._shapes.handleLabels;
- if (handleLabels) {
- for (var i = 0; i < handleLabels.length; i++) {
- this._api.enterBlur(handleLabels[i]);
- }
- }
- };
- ContinuousView2.prototype._enableHoverLinkToSeries = function() {
- var self = this;
- this._shapes.mainGroup.on("mousemove", function(e) {
- self._hovering = true;
- if (!self._dragging) {
- var itemSize = self.visualMapModel.itemSize;
- var pos = self._applyTransform([e.offsetX, e.offsetY], self._shapes.mainGroup, true, true);
- pos[1] = mathMin(mathMax(0, pos[1]), itemSize[1]);
- self._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize[0]);
- }
- }).on("mouseout", function() {
- self._hovering = false;
- !self._dragging && self._clearHoverLinkToSeries();
- });
- };
- ContinuousView2.prototype._enableHoverLinkFromSeries = function() {
- var zr = this.api.getZr();
- if (this.visualMapModel.option.hoverLink) {
- zr.on("mouseover", this._hoverLinkFromSeriesMouseOver, this);
- zr.on("mouseout", this._hideIndicator, this);
- } else {
- this._clearHoverLinkFromSeries();
- }
- };
- ContinuousView2.prototype._doHoverLinkToSeries = function(cursorPos, hoverOnBar) {
- var visualMapModel = this.visualMapModel;
- var itemSize = visualMapModel.itemSize;
- if (!visualMapModel.option.hoverLink) {
- return;
- }
- var sizeExtent = [0, itemSize[1]];
- var dataExtent = visualMapModel.getExtent();
- cursorPos = mathMin(mathMax(sizeExtent[0], cursorPos), sizeExtent[1]);
- var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent);
- var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize];
- var cursorValue = linearMap3(cursorPos, sizeExtent, dataExtent, true);
- var valueRange = [linearMap3(hoverRange[0], sizeExtent, dataExtent, true), linearMap3(hoverRange[1], sizeExtent, dataExtent, true)];
- hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity);
- hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity);
- if (hoverOnBar) {
- if (valueRange[0] === -Infinity) {
- this._showIndicator(cursorValue, valueRange[1], "< ", halfHoverLinkSize);
- } else if (valueRange[1] === Infinity) {
- this._showIndicator(cursorValue, valueRange[0], "> ", halfHoverLinkSize);
- } else {
- this._showIndicator(cursorValue, cursorValue, "\u2248 ", halfHoverLinkSize);
- }
- }
- var oldBatch = this._hoverLinkDataIndices;
- var newBatch = [];
- if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) {
- newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange);
- }
- var resultBatches = compressBatches(oldBatch, newBatch);
- this._dispatchHighDown("downplay", makeHighDownBatch(resultBatches[0], visualMapModel));
- this._dispatchHighDown("highlight", makeHighDownBatch(resultBatches[1], visualMapModel));
- };
- ContinuousView2.prototype._hoverLinkFromSeriesMouseOver = function(e) {
- var el = e.target;
- var visualMapModel = this.visualMapModel;
- if (!el || getECData(el).dataIndex == null) {
- return;
- }
- var ecData = getECData(el);
- var dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex);
- if (!visualMapModel.isTargetSeries(dataModel)) {
- return;
- }
- var data = dataModel.getData(ecData.dataType);
- var value = data.getStore().get(visualMapModel.getDataDimensionIndex(data), ecData.dataIndex);
- if (!isNaN(value)) {
- this._showIndicator(value, value);
- }
- };
- ContinuousView2.prototype._hideIndicator = function() {
- var shapes = this._shapes;
- shapes.indicator && shapes.indicator.attr("invisible", true);
- shapes.indicatorLabel && shapes.indicatorLabel.attr("invisible", true);
- var handleLabels = this._shapes.handleLabels;
- if (handleLabels) {
- for (var i = 0; i < handleLabels.length; i++) {
- this._api.leaveBlur(handleLabels[i]);
- }
- }
- };
- ContinuousView2.prototype._clearHoverLinkToSeries = function() {
- this._hideIndicator();
- var indices = this._hoverLinkDataIndices;
- this._dispatchHighDown("downplay", makeHighDownBatch(indices, this.visualMapModel));
- indices.length = 0;
- };
- ContinuousView2.prototype._clearHoverLinkFromSeries = function() {
- this._hideIndicator();
- var zr = this.api.getZr();
- zr.off("mouseover", this._hoverLinkFromSeriesMouseOver);
- zr.off("mouseout", this._hideIndicator);
- };
- ContinuousView2.prototype._applyTransform = function(vertex, element, inverse, global) {
- var transform = getTransform(element, global ? null : this.group);
- return isArray(vertex) ? applyTransform(vertex, transform, inverse) : transformDirection(vertex, transform, inverse);
- };
- ContinuousView2.prototype._dispatchHighDown = function(type, batch) {
- batch && batch.length && this.api.dispatchAction({
- type,
- batch
- });
- };
- ContinuousView2.prototype.dispose = function() {
- this._clearHoverLinkFromSeries();
- this._clearHoverLinkToSeries();
- };
- ContinuousView2.prototype.remove = function() {
- this._clearHoverLinkFromSeries();
- this._clearHoverLinkToSeries();
- };
- ContinuousView2.type = "visualMap.continuous";
- return ContinuousView2;
- }(VisualMapView_default);
- function createPolygon(points, cursor, onDrift, onDragEnd) {
- return new Polygon_default({
- shape: {
- points
- },
- draggable: !!onDrift,
- cursor,
- drift: onDrift,
- onmousemove: function(e) {
- stop(e.event);
- },
- ondragend: onDragEnd
- });
- }
- function getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) {
- var halfHoverLinkSize = HOVER_LINK_SIZE / 2;
- var hoverLinkDataSize = visualMapModel.get("hoverLinkDataSize");
- if (hoverLinkDataSize) {
- halfHoverLinkSize = linearMap3(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2;
- }
- return halfHoverLinkSize;
- }
- function useHoverLinkOnHandle(visualMapModel) {
- var hoverLinkOnHandle = visualMapModel.get("hoverLinkOnHandle");
- return !!(hoverLinkOnHandle == null ? visualMapModel.get("realtime") : hoverLinkOnHandle);
- }
- function getCursor2(orient) {
- return orient === "vertical" ? "ns-resize" : "ew-resize";
- }
- var ContinuousView_default = ContinuousView;
- // node_modules/echarts/lib/component/visualMap/installCommon.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/visualMap/visualMapAction.js
- init_define_APP_INFO();
- var visualMapActionInfo = {
- type: "selectDataRange",
- event: "dataRangeSelected",
- update: "update"
- };
- var visualMapActionHander = function(payload, ecModel) {
- ecModel.eachComponent({
- mainType: "visualMap",
- query: payload
- }, function(model) {
- model.setSelected(payload.selected);
- });
- };
- // node_modules/echarts/lib/component/visualMap/visualEncoding.js
- init_define_APP_INFO();
- var visualMapEncodingHandlers = [
- {
- createOnAllSeries: true,
- reset: function(seriesModel, ecModel) {
- var resetDefines = [];
- ecModel.eachComponent("visualMap", function(visualMapModel) {
- var pipelineContext = seriesModel.pipelineContext;
- if (!visualMapModel.isTargetSeries(seriesModel) || pipelineContext && pipelineContext.large) {
- return;
- }
- resetDefines.push(incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimensionIndex(seriesModel.getData())));
- });
- return resetDefines;
- }
- },
- {
- createOnAllSeries: true,
- reset: function(seriesModel, ecModel) {
- var data = seriesModel.getData();
- var visualMetaList = [];
- ecModel.eachComponent("visualMap", function(visualMapModel) {
- if (visualMapModel.isTargetSeries(seriesModel)) {
- var visualMeta = visualMapModel.getVisualMeta(bind(getColorVisual, null, seriesModel, visualMapModel)) || {
- stops: [],
- outerColors: []
- };
- var dimIdx = visualMapModel.getDataDimensionIndex(data);
- if (dimIdx >= 0) {
- visualMeta.dimension = dimIdx;
- visualMetaList.push(visualMeta);
- }
- }
- });
- seriesModel.getData().setVisual("visualMeta", visualMetaList);
- }
- }
- ];
- function getColorVisual(seriesModel, visualMapModel, value, valueState) {
- var mappings = visualMapModel.targetVisuals[valueState];
- var visualTypes = VisualMapping_default.prepareVisualTypes(mappings);
- var resultVisual = {
- color: getVisualFromData(seriesModel.getData(), "color")
- };
- for (var i = 0, len = visualTypes.length; i < len; i++) {
- var type = visualTypes[i];
- var mapping = mappings[type === "opacity" ? "__alphaForOpacity" : type];
- mapping && mapping.applyVisual(value, getVisual, setVisual);
- }
- return resultVisual.color;
- function getVisual(key) {
- return resultVisual[key];
- }
- function setVisual(key, value2) {
- resultVisual[key] = value2;
- }
- }
- // node_modules/echarts/lib/component/visualMap/preprocessor.js
- init_define_APP_INFO();
- var each10 = each;
- function visualMapPreprocessor(option) {
- var visualMap = option && option.visualMap;
- if (!isArray(visualMap)) {
- visualMap = visualMap ? [visualMap] : [];
- }
- each10(visualMap, function(opt) {
- if (!opt) {
- return;
- }
- if (has2(opt, "splitList") && !has2(opt, "pieces")) {
- opt.pieces = opt.splitList;
- delete opt.splitList;
- }
- var pieces = opt.pieces;
- if (pieces && isArray(pieces)) {
- each10(pieces, function(piece) {
- if (isObject(piece)) {
- if (has2(piece, "start") && !has2(piece, "min")) {
- piece.min = piece.start;
- }
- if (has2(piece, "end") && !has2(piece, "max")) {
- piece.max = piece.end;
- }
- }
- });
- }
- });
- }
- function has2(obj, name) {
- return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);
- }
- // node_modules/echarts/lib/component/visualMap/installCommon.js
- var installed2 = false;
- function installCommon2(registers) {
- if (installed2) {
- return;
- }
- installed2 = true;
- registers.registerSubTypeDefaulter("visualMap", function(option) {
- return !option.categories && (!(option.pieces ? option.pieces.length > 0 : option.splitNumber > 0) || option.calculable) ? "continuous" : "piecewise";
- });
- registers.registerAction(visualMapActionInfo, visualMapActionHander);
- each(visualMapEncodingHandlers, function(handler) {
- registers.registerVisual(registers.PRIORITY.VISUAL.COMPONENT, handler);
- });
- registers.registerPreprocessor(visualMapPreprocessor);
- }
- // node_modules/echarts/lib/component/visualMap/installVisualMapContinuous.js
- function install26(registers) {
- registers.registerComponentModel(ContinuousModel_default);
- registers.registerComponentView(ContinuousView_default);
- installCommon2(registers);
- }
- // node_modules/echarts/lib/component/visualMap/installVisualMapPiecewise.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/visualMap/PiecewiseModel.js
- init_define_APP_INFO();
- var PiecewiseModel = function(_super) {
- __extends(PiecewiseModel2, _super);
- function PiecewiseModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = PiecewiseModel2.type;
- _this._pieceList = [];
- return _this;
- }
- PiecewiseModel2.prototype.optionUpdated = function(newOption, isInit) {
- _super.prototype.optionUpdated.apply(this, arguments);
- this.resetExtent();
- var mode = this._mode = this._determineMode();
- this._pieceList = [];
- resetMethods[this._mode].call(this, this._pieceList);
- this._resetSelected(newOption, isInit);
- var categories = this.option.categories;
- this.resetVisual(function(mappingOption, state) {
- if (mode === "categories") {
- mappingOption.mappingMethod = "category";
- mappingOption.categories = clone(categories);
- } else {
- mappingOption.dataExtent = this.getExtent();
- mappingOption.mappingMethod = "piecewise";
- mappingOption.pieceList = map(this._pieceList, function(piece) {
- piece = clone(piece);
- if (state !== "inRange") {
- piece.visual = null;
- }
- return piece;
- });
- }
- });
- };
- PiecewiseModel2.prototype.completeVisualOption = function() {
- var option = this.option;
- var visualTypesInPieces = {};
- var visualTypes = VisualMapping_default.listVisualTypes();
- var isCategory = this.isCategory();
- each(option.pieces, function(piece) {
- each(visualTypes, function(visualType) {
- if (piece.hasOwnProperty(visualType)) {
- visualTypesInPieces[visualType] = 1;
- }
- });
- });
- each(visualTypesInPieces, function(v, visualType) {
- var exists = false;
- each(this.stateList, function(state) {
- exists = exists || has3(option, state, visualType) || has3(option.target, state, visualType);
- }, this);
- !exists && each(this.stateList, function(state) {
- (option[state] || (option[state] = {}))[visualType] = visualDefault_default.get(visualType, state === "inRange" ? "active" : "inactive", isCategory);
- });
- }, this);
- function has3(obj, state, visualType) {
- return obj && obj[state] && obj[state].hasOwnProperty(visualType);
- }
- _super.prototype.completeVisualOption.apply(this, arguments);
- };
- PiecewiseModel2.prototype._resetSelected = function(newOption, isInit) {
- var thisOption = this.option;
- var pieceList = this._pieceList;
- var selected = (isInit ? thisOption : newOption).selected || {};
- thisOption.selected = selected;
- each(pieceList, function(piece, index) {
- var key = this.getSelectedMapKey(piece);
- if (!selected.hasOwnProperty(key)) {
- selected[key] = true;
- }
- }, this);
- if (thisOption.selectedMode === "single") {
- var hasSel_1 = false;
- each(pieceList, function(piece, index) {
- var key = this.getSelectedMapKey(piece);
- if (selected[key]) {
- hasSel_1 ? selected[key] = false : hasSel_1 = true;
- }
- }, this);
- }
- };
- PiecewiseModel2.prototype.getItemSymbol = function() {
- return this.get("itemSymbol");
- };
- PiecewiseModel2.prototype.getSelectedMapKey = function(piece) {
- return this._mode === "categories" ? piece.value + "" : piece.index + "";
- };
- PiecewiseModel2.prototype.getPieceList = function() {
- return this._pieceList;
- };
- PiecewiseModel2.prototype._determineMode = function() {
- var option = this.option;
- return option.pieces && option.pieces.length > 0 ? "pieces" : this.option.categories ? "categories" : "splitNumber";
- };
- PiecewiseModel2.prototype.setSelected = function(selected) {
- this.option.selected = clone(selected);
- };
- PiecewiseModel2.prototype.getValueState = function(value) {
- var index = VisualMapping_default.findPieceIndex(value, this._pieceList);
- return index != null ? this.option.selected[this.getSelectedMapKey(this._pieceList[index])] ? "inRange" : "outOfRange" : "outOfRange";
- };
- PiecewiseModel2.prototype.findTargetDataIndices = function(pieceIndex) {
- var result = [];
- var pieceList = this._pieceList;
- this.eachTargetSeries(function(seriesModel) {
- var dataIndices = [];
- var data = seriesModel.getData();
- data.each(this.getDataDimensionIndex(data), function(value, dataIndex) {
- var pIdx = VisualMapping_default.findPieceIndex(value, pieceList);
- pIdx === pieceIndex && dataIndices.push(dataIndex);
- }, this);
- result.push({
- seriesId: seriesModel.id,
- dataIndex: dataIndices
- });
- }, this);
- return result;
- };
- PiecewiseModel2.prototype.getRepresentValue = function(piece) {
- var representValue;
- if (this.isCategory()) {
- representValue = piece.value;
- } else {
- if (piece.value != null) {
- representValue = piece.value;
- } else {
- var pieceInterval = piece.interval || [];
- representValue = pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity ? 0 : (pieceInterval[0] + pieceInterval[1]) / 2;
- }
- }
- return representValue;
- };
- PiecewiseModel2.prototype.getVisualMeta = function(getColorVisual2) {
- if (this.isCategory()) {
- return;
- }
- var stops = [];
- var outerColors = ["", ""];
- var visualMapModel = this;
- function setStop(interval, valueState) {
- var representValue = visualMapModel.getRepresentValue({
- interval
- });
- if (!valueState) {
- valueState = visualMapModel.getValueState(representValue);
- }
- var color = getColorVisual2(representValue, valueState);
- if (interval[0] === -Infinity) {
- outerColors[0] = color;
- } else if (interval[1] === Infinity) {
- outerColors[1] = color;
- } else {
- stops.push({
- value: interval[0],
- color
- }, {
- value: interval[1],
- color
- });
- }
- }
- var pieceList = this._pieceList.slice();
- if (!pieceList.length) {
- pieceList.push({
- interval: [-Infinity, Infinity]
- });
- } else {
- var edge = pieceList[0].interval[0];
- edge !== -Infinity && pieceList.unshift({
- interval: [-Infinity, edge]
- });
- edge = pieceList[pieceList.length - 1].interval[1];
- edge !== Infinity && pieceList.push({
- interval: [edge, Infinity]
- });
- }
- var curr = -Infinity;
- each(pieceList, function(piece) {
- var interval = piece.interval;
- if (interval) {
- interval[0] > curr && setStop([curr, interval[0]], "outOfRange");
- setStop(interval.slice());
- curr = interval[1];
- }
- }, this);
- return {
- stops,
- outerColors
- };
- };
- PiecewiseModel2.type = "visualMap.piecewise";
- PiecewiseModel2.defaultOption = inheritDefaultOption(VisualMapModel_default.defaultOption, {
- selected: null,
- minOpen: false,
- maxOpen: false,
- align: "auto",
- itemWidth: 20,
- itemHeight: 14,
- itemSymbol: "roundRect",
- pieces: null,
- categories: null,
- splitNumber: 5,
- selectedMode: "multiple",
- itemGap: 10,
- hoverLink: true
- });
- return PiecewiseModel2;
- }(VisualMapModel_default);
- var resetMethods = {
- splitNumber: function(outPieceList) {
- var thisOption = this.option;
- var precision = Math.min(thisOption.precision, 20);
- var dataExtent = this.getExtent();
- var splitNumber = thisOption.splitNumber;
- splitNumber = Math.max(parseInt(splitNumber, 10), 1);
- thisOption.splitNumber = splitNumber;
- var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber;
- while (+splitStep.toFixed(precision) !== splitStep && precision < 5) {
- precision++;
- }
- thisOption.precision = precision;
- splitStep = +splitStep.toFixed(precision);
- if (thisOption.minOpen) {
- outPieceList.push({
- interval: [-Infinity, dataExtent[0]],
- close: [0, 0]
- });
- }
- for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) {
- var max = index === splitNumber - 1 ? dataExtent[1] : curr + splitStep;
- outPieceList.push({
- interval: [curr, max],
- close: [1, 1]
- });
- }
- if (thisOption.maxOpen) {
- outPieceList.push({
- interval: [dataExtent[1], Infinity],
- close: [0, 0]
- });
- }
- reformIntervals(outPieceList);
- each(outPieceList, function(piece, index2) {
- piece.index = index2;
- piece.text = this.formatValueText(piece.interval);
- }, this);
- },
- categories: function(outPieceList) {
- var thisOption = this.option;
- each(thisOption.categories, function(cate) {
- outPieceList.push({
- text: this.formatValueText(cate, true),
- value: cate
- });
- }, this);
- normalizeReverse(thisOption, outPieceList);
- },
- pieces: function(outPieceList) {
- var thisOption = this.option;
- each(thisOption.pieces, function(pieceListItem, index) {
- if (!isObject(pieceListItem)) {
- pieceListItem = {
- value: pieceListItem
- };
- }
- var item = {
- text: "",
- index
- };
- if (pieceListItem.label != null) {
- item.text = pieceListItem.label;
- }
- if (pieceListItem.hasOwnProperty("value")) {
- var value = item.value = pieceListItem.value;
- item.interval = [value, value];
- item.close = [1, 1];
- } else {
- var interval = item.interval = [];
- var close_1 = item.close = [0, 0];
- var closeList = [1, 0, 1];
- var infinityList = [-Infinity, Infinity];
- var useMinMax = [];
- for (var lg = 0; lg < 2; lg++) {
- var names = [["gte", "gt", "min"], ["lte", "lt", "max"]][lg];
- for (var i = 0; i < 3 && interval[lg] == null; i++) {
- interval[lg] = pieceListItem[names[i]];
- close_1[lg] = closeList[i];
- useMinMax[lg] = i === 2;
- }
- interval[lg] == null && (interval[lg] = infinityList[lg]);
- }
- useMinMax[0] && interval[1] === Infinity && (close_1[0] = 0);
- useMinMax[1] && interval[0] === -Infinity && (close_1[1] = 0);
- if (true) {
- if (interval[0] > interval[1]) {
- console.warn("Piece " + index + "is illegal: " + interval + " lower bound should not greater then uppper bound.");
- }
- }
- if (interval[0] === interval[1] && close_1[0] && close_1[1]) {
- item.value = interval[0];
- }
- }
- item.visual = VisualMapping_default.retrieveVisuals(pieceListItem);
- outPieceList.push(item);
- }, this);
- normalizeReverse(thisOption, outPieceList);
- reformIntervals(outPieceList);
- each(outPieceList, function(piece) {
- var close = piece.close;
- var edgeSymbols = [["<", "\u2264"][close[1]], [">", "\u2265"][close[0]]];
- piece.text = piece.text || this.formatValueText(piece.value != null ? piece.value : piece.interval, false, edgeSymbols);
- }, this);
- }
- };
- function normalizeReverse(thisOption, pieceList) {
- var inverse = thisOption.inverse;
- if (thisOption.orient === "vertical" ? !inverse : inverse) {
- pieceList.reverse();
- }
- }
- var PiecewiseModel_default = PiecewiseModel;
- // node_modules/echarts/lib/component/visualMap/PiecewiseView.js
- init_define_APP_INFO();
- var PiecewiseVisualMapView = function(_super) {
- __extends(PiecewiseVisualMapView2, _super);
- function PiecewiseVisualMapView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = PiecewiseVisualMapView2.type;
- return _this;
- }
- PiecewiseVisualMapView2.prototype.doRender = function() {
- var thisGroup = this.group;
- thisGroup.removeAll();
- var visualMapModel = this.visualMapModel;
- var textGap = visualMapModel.get("textGap");
- var textStyleModel = visualMapModel.textStyleModel;
- var textFont = textStyleModel.getFont();
- var textFill = textStyleModel.getTextColor();
- var itemAlign = this._getItemAlign();
- var itemSize = visualMapModel.itemSize;
- var viewData = this._getViewData();
- var endsText = viewData.endsText;
- var showLabel = retrieve(visualMapModel.get("showLabel", true), !endsText);
- endsText && this._renderEndsText(thisGroup, endsText[0], itemSize, showLabel, itemAlign);
- each(viewData.viewPieceList, function(item) {
- var piece = item.piece;
- var itemGroup = new Group_default();
- itemGroup.onclick = bind(this._onItemClick, this, piece);
- this._enableHoverLink(itemGroup, item.indexInModelPieceList);
- var representValue = visualMapModel.getRepresentValue(piece);
- this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]]);
- if (showLabel) {
- var visualState = this.visualMapModel.getValueState(representValue);
- itemGroup.add(new Text_default({
- style: {
- x: itemAlign === "right" ? -textGap : itemSize[0] + textGap,
- y: itemSize[1] / 2,
- text: piece.text,
- verticalAlign: "middle",
- align: itemAlign,
- font: textFont,
- fill: textFill,
- opacity: visualState === "outOfRange" ? 0.5 : 1
- }
- }));
- }
- thisGroup.add(itemGroup);
- }, this);
- endsText && this._renderEndsText(thisGroup, endsText[1], itemSize, showLabel, itemAlign);
- box(visualMapModel.get("orient"), thisGroup, visualMapModel.get("itemGap"));
- this.renderBackground(thisGroup);
- this.positionGroup(thisGroup);
- };
- PiecewiseVisualMapView2.prototype._enableHoverLink = function(itemGroup, pieceIndex) {
- var _this = this;
- itemGroup.on("mouseover", function() {
- return onHoverLink("highlight");
- }).on("mouseout", function() {
- return onHoverLink("downplay");
- });
- var onHoverLink = function(method) {
- var visualMapModel = _this.visualMapModel;
- visualMapModel.option.hoverLink && _this.api.dispatchAction({
- type: method,
- batch: makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel)
- });
- };
- };
- PiecewiseVisualMapView2.prototype._getItemAlign = function() {
- var visualMapModel = this.visualMapModel;
- var modelOption = visualMapModel.option;
- if (modelOption.orient === "vertical") {
- return getItemAlign(visualMapModel, this.api, visualMapModel.itemSize);
- } else {
- var align = modelOption.align;
- if (!align || align === "auto") {
- align = "left";
- }
- return align;
- }
- };
- PiecewiseVisualMapView2.prototype._renderEndsText = function(group, text, itemSize, showLabel, itemAlign) {
- if (!text) {
- return;
- }
- var itemGroup = new Group_default();
- var textStyleModel = this.visualMapModel.textStyleModel;
- itemGroup.add(new Text_default({
- style: createTextStyle(textStyleModel, {
- x: showLabel ? itemAlign === "right" ? itemSize[0] : 0 : itemSize[0] / 2,
- y: itemSize[1] / 2,
- verticalAlign: "middle",
- align: showLabel ? itemAlign : "center",
- text
- })
- }));
- group.add(itemGroup);
- };
- PiecewiseVisualMapView2.prototype._getViewData = function() {
- var visualMapModel = this.visualMapModel;
- var viewPieceList = map(visualMapModel.getPieceList(), function(piece, index) {
- return {
- piece,
- indexInModelPieceList: index
- };
- });
- var endsText = visualMapModel.get("text");
- var orient = visualMapModel.get("orient");
- var inverse = visualMapModel.get("inverse");
- if (orient === "horizontal" ? inverse : !inverse) {
- viewPieceList.reverse();
- } else if (endsText) {
- endsText = endsText.slice().reverse();
- }
- return {
- viewPieceList,
- endsText
- };
- };
- PiecewiseVisualMapView2.prototype._createItemSymbol = function(group, representValue, shapeParam) {
- group.add(createSymbol(
- this.getControllerVisual(representValue, "symbol"),
- shapeParam[0],
- shapeParam[1],
- shapeParam[2],
- shapeParam[3],
- this.getControllerVisual(representValue, "color")
- ));
- };
- PiecewiseVisualMapView2.prototype._onItemClick = function(piece) {
- var visualMapModel = this.visualMapModel;
- var option = visualMapModel.option;
- var selectedMode = option.selectedMode;
- if (!selectedMode) {
- return;
- }
- var selected = clone(option.selected);
- var newKey = visualMapModel.getSelectedMapKey(piece);
- if (selectedMode === "single" || selectedMode === true) {
- selected[newKey] = true;
- each(selected, function(o, key) {
- selected[key] = key === newKey;
- });
- } else {
- selected[newKey] = !selected[newKey];
- }
- this.api.dispatchAction({
- type: "selectDataRange",
- from: this.uid,
- visualMapId: this.visualMapModel.id,
- selected
- });
- };
- PiecewiseVisualMapView2.type = "visualMap.piecewise";
- return PiecewiseVisualMapView2;
- }(VisualMapView_default);
- var PiecewiseView_default = PiecewiseVisualMapView;
- // node_modules/echarts/lib/component/visualMap/installVisualMapPiecewise.js
- function install27(registers) {
- registers.registerComponentModel(PiecewiseModel_default);
- registers.registerComponentView(PiecewiseView_default);
- installCommon2(registers);
- }
- // node_modules/echarts/lib/component/visualMap/install.js
- function install28(registers) {
- use(install26);
- use(install27);
- }
- // node_modules/echarts/lib/component/aria/install.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/visual/aria.js
- init_define_APP_INFO();
- var DEFAULT_OPTION = {
- label: {
- enabled: true
- },
- decal: {
- show: false
- }
- };
- var inner12 = makeInner();
- var decalPaletteScope = {};
- function ariaVisual(ecModel, api) {
- var ariaModel = ecModel.getModel("aria");
- if (!ariaModel.get("enabled")) {
- return;
- }
- var defaultOption2 = clone(DEFAULT_OPTION);
- merge(defaultOption2.label, ecModel.getLocaleModel().get("aria"), false);
- merge(ariaModel.option, defaultOption2, false);
- setDecal();
- setLabel();
- function setDecal() {
- var decalModel = ariaModel.getModel("decal");
- var useDecal = decalModel.get("show");
- if (useDecal) {
- var paletteScopeGroupByType_1 = createHashMap();
- ecModel.eachSeries(function(seriesModel) {
- if (seriesModel.isColorBySeries()) {
- return;
- }
- var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);
- if (!decalScope) {
- decalScope = {};
- paletteScopeGroupByType_1.set(seriesModel.type, decalScope);
- }
- inner12(seriesModel).scope = decalScope;
- });
- ecModel.eachRawSeries(function(seriesModel) {
- if (ecModel.isSeriesFiltered(seriesModel)) {
- return;
- }
- if (isFunction(seriesModel.enableAriaDecal)) {
- seriesModel.enableAriaDecal();
- return;
- }
- var data = seriesModel.getData();
- if (!seriesModel.isColorBySeries()) {
- var dataAll_1 = seriesModel.getRawData();
- var idxMap_1 = {};
- var decalScope_1 = inner12(seriesModel).scope;
- data.each(function(idx) {
- var rawIdx = data.getRawIndex(idx);
- idxMap_1[rawIdx] = idx;
- });
- var dataCount_1 = dataAll_1.count();
- dataAll_1.each(function(rawIdx) {
- var idx = idxMap_1[rawIdx];
- var name = dataAll_1.getName(rawIdx) || rawIdx + "";
- var paletteDecal2 = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);
- var specifiedDecal2 = data.getItemVisual(idx, "decal");
- data.setItemVisual(idx, "decal", mergeDecal(specifiedDecal2, paletteDecal2));
- });
- } else {
- var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());
- var specifiedDecal = data.getVisual("decal");
- data.setVisual("decal", mergeDecal(specifiedDecal, paletteDecal));
- }
- function mergeDecal(specifiedDecal2, paletteDecal2) {
- var resultDecal = specifiedDecal2 ? extend(extend({}, paletteDecal2), specifiedDecal2) : paletteDecal2;
- resultDecal.dirty = true;
- return resultDecal;
- }
- });
- }
- }
- function setLabel() {
- var labelLocale = ecModel.getLocaleModel().get("aria");
- var labelModel = ariaModel.getModel("label");
- labelModel.option = defaults(labelModel.option, labelLocale);
- if (!labelModel.get("enabled")) {
- return;
- }
- var dom = api.getZr().dom;
- if (labelModel.get("description")) {
- dom.setAttribute("aria-label", labelModel.get("description"));
- return;
- }
- var seriesCnt = ecModel.getSeriesCount();
- var maxDataCnt = labelModel.get(["data", "maxCount"]) || 10;
- var maxSeriesCnt = labelModel.get(["series", "maxCount"]) || 10;
- var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);
- var ariaLabel;
- if (seriesCnt < 1) {
- return;
- } else {
- var title = getTitle();
- if (title) {
- var withTitle = labelModel.get(["general", "withTitle"]);
- ariaLabel = replace(withTitle, {
- title
- });
- } else {
- ariaLabel = labelModel.get(["general", "withoutTitle"]);
- }
- var seriesLabels_1 = [];
- var prefix = seriesCnt > 1 ? labelModel.get(["series", "multiple", "prefix"]) : labelModel.get(["series", "single", "prefix"]);
- ariaLabel += replace(prefix, {
- seriesCount: seriesCnt
- });
- ecModel.eachSeries(function(seriesModel, idx) {
- if (idx < displaySeriesCnt) {
- var seriesLabel = void 0;
- var seriesName = seriesModel.get("name");
- var withName = seriesName ? "withName" : "withoutName";
- seriesLabel = seriesCnt > 1 ? labelModel.get(["series", "multiple", withName]) : labelModel.get(["series", "single", withName]);
- seriesLabel = replace(seriesLabel, {
- seriesId: seriesModel.seriesIndex,
- seriesName: seriesModel.get("name"),
- seriesType: getSeriesTypeName(seriesModel.subType)
- });
- var data = seriesModel.getData();
- if (data.count() > maxDataCnt) {
- var partialLabel = labelModel.get(["data", "partialData"]);
- seriesLabel += replace(partialLabel, {
- displayCnt: maxDataCnt
- });
- } else {
- seriesLabel += labelModel.get(["data", "allData"]);
- }
- var middleSeparator_1 = labelModel.get(["data", "separator", "middle"]);
- var endSeparator_1 = labelModel.get(["data", "separator", "end"]);
- var dataLabels = [];
- for (var i = 0; i < data.count(); i++) {
- if (i < maxDataCnt) {
- var name_1 = data.getName(i);
- var value = data.getValues(i);
- var dataLabel = labelModel.get(["data", name_1 ? "withName" : "withoutName"]);
- dataLabels.push(replace(dataLabel, {
- name: name_1,
- value: value.join(middleSeparator_1)
- }));
- }
- }
- seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;
- seriesLabels_1.push(seriesLabel);
- }
- });
- var separatorModel = labelModel.getModel(["series", "multiple", "separator"]);
- var middleSeparator = separatorModel.get("middle");
- var endSeparator = separatorModel.get("end");
- ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;
- dom.setAttribute("aria-label", ariaLabel);
- }
- }
- function replace(str, keyValues) {
- if (!isString(str)) {
- return str;
- }
- var result = str;
- each(keyValues, function(value, key) {
- result = result.replace(new RegExp("\\{\\s*" + key + "\\s*\\}", "g"), value);
- });
- return result;
- }
- function getTitle() {
- var title = ecModel.get("title");
- if (title && title.length) {
- title = title[0];
- }
- return title && title.text;
- }
- function getSeriesTypeName(type) {
- return ecModel.getLocaleModel().get(["series", "typeNames"])[type] || "\u81EA\u5B9A\u4E49\u56FE";
- }
- }
- // node_modules/echarts/lib/component/aria/preprocessor.js
- init_define_APP_INFO();
- function ariaPreprocessor(option) {
- if (!option || !option.aria) {
- return;
- }
- var aria = option.aria;
- if (aria.show != null) {
- aria.enabled = aria.show;
- }
- aria.label = aria.label || {};
- each(["description", "general", "series", "data"], function(name) {
- if (aria[name] != null) {
- aria.label[name] = aria[name];
- }
- });
- }
- // node_modules/echarts/lib/component/aria/install.js
- function install29(registers) {
- registers.registerPreprocessor(ariaPreprocessor);
- registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual);
- }
- // node_modules/echarts/lib/component/transform/install.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/component/transform/filterTransform.js
- init_define_APP_INFO();
- // node_modules/echarts/lib/util/conditionalExpression.js
- init_define_APP_INFO();
- var RELATIONAL_EXPRESSION_OP_ALIAS_MAP = {
- value: "eq",
- "<": "lt",
- "<=": "lte",
- ">": "gt",
- ">=": "gte",
- "=": "eq",
- "!=": "ne",
- "<>": "ne"
- };
- var RegExpEvaluator = function() {
- function RegExpEvaluator2(rVal) {
- var condValue = this._condVal = isString(rVal) ? new RegExp(rVal) : isRegExp(rVal) ? rVal : null;
- if (condValue == null) {
- var errMsg = "";
- if (true) {
- errMsg = makePrintable("Illegal regexp", rVal, "in");
- }
- throwError(errMsg);
- }
- }
- RegExpEvaluator2.prototype.evaluate = function(lVal) {
- var type = typeof lVal;
- return isString(type) ? this._condVal.test(lVal) : isNumber(type) ? this._condVal.test(lVal + "") : false;
- };
- return RegExpEvaluator2;
- }();
- var ConstConditionInternal = function() {
- function ConstConditionInternal2() {
- }
- ConstConditionInternal2.prototype.evaluate = function() {
- return this.value;
- };
- return ConstConditionInternal2;
- }();
- var AndConditionInternal = function() {
- function AndConditionInternal2() {
- }
- AndConditionInternal2.prototype.evaluate = function() {
- var children = this.children;
- for (var i = 0; i < children.length; i++) {
- if (!children[i].evaluate()) {
- return false;
- }
- }
- return true;
- };
- return AndConditionInternal2;
- }();
- var OrConditionInternal = function() {
- function OrConditionInternal2() {
- }
- OrConditionInternal2.prototype.evaluate = function() {
- var children = this.children;
- for (var i = 0; i < children.length; i++) {
- if (children[i].evaluate()) {
- return true;
- }
- }
- return false;
- };
- return OrConditionInternal2;
- }();
- var NotConditionInternal = function() {
- function NotConditionInternal2() {
- }
- NotConditionInternal2.prototype.evaluate = function() {
- return !this.child.evaluate();
- };
- return NotConditionInternal2;
- }();
- var RelationalConditionInternal = function() {
- function RelationalConditionInternal2() {
- }
- RelationalConditionInternal2.prototype.evaluate = function() {
- var needParse = !!this.valueParser;
- var getValue = this.getValue;
- var tarValRaw = getValue(this.valueGetterParam);
- var tarValParsed = needParse ? this.valueParser(tarValRaw) : null;
- for (var i = 0; i < this.subCondList.length; i++) {
- if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) {
- return false;
- }
- }
- return true;
- };
- return RelationalConditionInternal2;
- }();
- function parseOption(exprOption, getters) {
- if (exprOption === true || exprOption === false) {
- var cond = new ConstConditionInternal();
- cond.value = exprOption;
- return cond;
- }
- var errMsg = "";
- if (!isObjectNotArray(exprOption)) {
- if (true) {
- errMsg = makePrintable("Illegal config. Expect a plain object but actually", exprOption);
- }
- throwError(errMsg);
- }
- if (exprOption.and) {
- return parseAndOrOption("and", exprOption, getters);
- } else if (exprOption.or) {
- return parseAndOrOption("or", exprOption, getters);
- } else if (exprOption.not) {
- return parseNotOption(exprOption, getters);
- }
- return parseRelationalOption(exprOption, getters);
- }
- function parseAndOrOption(op, exprOption, getters) {
- var subOptionArr = exprOption[op];
- var errMsg = "";
- if (true) {
- errMsg = makePrintable('"and"/"or" condition should only be `' + op + ": [...]` and must not be empty array.", "Illegal condition:", exprOption);
- }
- if (!isArray(subOptionArr)) {
- throwError(errMsg);
- }
- if (!subOptionArr.length) {
- throwError(errMsg);
- }
- var cond = op === "and" ? new AndConditionInternal() : new OrConditionInternal();
- cond.children = map(subOptionArr, function(subOption) {
- return parseOption(subOption, getters);
- });
- if (!cond.children.length) {
- throwError(errMsg);
- }
- return cond;
- }
- function parseNotOption(exprOption, getters) {
- var subOption = exprOption.not;
- var errMsg = "";
- if (true) {
- errMsg = makePrintable('"not" condition should only be `not: {}`.', "Illegal condition:", exprOption);
- }
- if (!isObjectNotArray(subOption)) {
- throwError(errMsg);
- }
- var cond = new NotConditionInternal();
- cond.child = parseOption(subOption, getters);
- if (!cond.child) {
- throwError(errMsg);
- }
- return cond;
- }
- function parseRelationalOption(exprOption, getters) {
- var errMsg = "";
- var valueGetterParam = getters.prepareGetValue(exprOption);
- var subCondList = [];
- var exprKeys = keys(exprOption);
- var parserName = exprOption.parser;
- var valueParser = parserName ? getRawValueParser(parserName) : null;
- for (var i = 0; i < exprKeys.length; i++) {
- var keyRaw = exprKeys[i];
- if (keyRaw === "parser" || getters.valueGetterAttrMap.get(keyRaw)) {
- continue;
- }
- var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw;
- var condValueRaw = exprOption[keyRaw];
- var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw;
- var evaluator = createFilterComparator(op, condValueParsed) || op === "reg" && new RegExpEvaluator(condValueParsed);
- if (!evaluator) {
- if (true) {
- errMsg = makePrintable('Illegal relational operation: "' + keyRaw + '" in condition:', exprOption);
- }
- throwError(errMsg);
- }
- subCondList.push(evaluator);
- }
- if (!subCondList.length) {
- if (true) {
- errMsg = makePrintable("Relational condition must have at least one operator.", "Illegal condition:", exprOption);
- }
- throwError(errMsg);
- }
- var cond = new RelationalConditionInternal();
- cond.valueGetterParam = valueGetterParam;
- cond.valueParser = valueParser;
- cond.getValue = getters.getValue;
- cond.subCondList = subCondList;
- return cond;
- }
- function isObjectNotArray(val) {
- return isObject(val) && !isArrayLike(val);
- }
- var ConditionalExpressionParsed = function() {
- function ConditionalExpressionParsed2(exprOption, getters) {
- this._cond = parseOption(exprOption, getters);
- }
- ConditionalExpressionParsed2.prototype.evaluate = function() {
- return this._cond.evaluate();
- };
- return ConditionalExpressionParsed2;
- }();
- function parseConditionalExpression(exprOption, getters) {
- return new ConditionalExpressionParsed(exprOption, getters);
- }
- // node_modules/echarts/lib/component/transform/filterTransform.js
- var filterTransform = {
- type: "echarts:filter",
- transform: function(params) {
- var upstream = params.upstream;
- var rawItem;
- var condition = parseConditionalExpression(params.config, {
- valueGetterAttrMap: createHashMap({
- dimension: true
- }),
- prepareGetValue: function(exprOption) {
- var errMsg = "";
- var dimLoose = exprOption.dimension;
- if (!hasOwn(exprOption, "dimension")) {
- if (true) {
- errMsg = makePrintable('Relation condition must has prop "dimension" specified.', "Illegal condition:", exprOption);
- }
- throwError(errMsg);
- }
- var dimInfo = upstream.getDimensionInfo(dimLoose);
- if (!dimInfo) {
- if (true) {
- errMsg = makePrintable("Can not find dimension info via: " + dimLoose + ".\n", "Existing dimensions: ", upstream.cloneAllDimensionInfo(), ".\n", "Illegal condition:", exprOption, ".\n");
- }
- throwError(errMsg);
- }
- return {
- dimIdx: dimInfo.index
- };
- },
- getValue: function(param) {
- return upstream.retrieveValueFromItem(rawItem, param.dimIdx);
- }
- });
- var resultData = [];
- for (var i = 0, len = upstream.count(); i < len; i++) {
- rawItem = upstream.getRawDataItem(i);
- if (condition.evaluate()) {
- resultData.push(rawItem);
- }
- }
- return {
- data: resultData
- };
- }
- };
- // node_modules/echarts/lib/component/transform/sortTransform.js
- init_define_APP_INFO();
- var sampleLog = "";
- if (true) {
- sampleLog = ["Valid config is like:", '{ dimension: "age", order: "asc" }', 'or [{ dimension: "age", order: "asc"], { dimension: "date", order: "desc" }]'].join(" ");
- }
- var sortTransform = {
- type: "echarts:sort",
- transform: function(params) {
- var upstream = params.upstream;
- var config = params.config;
- var errMsg = "";
- var orderExprList = normalizeToArray(config);
- if (!orderExprList.length) {
- if (true) {
- errMsg = "Empty `config` in sort transform.";
- }
- throwError(errMsg);
- }
- var orderDefList = [];
- each(orderExprList, function(orderExpr) {
- var dimLoose = orderExpr.dimension;
- var order = orderExpr.order;
- var parserName = orderExpr.parser;
- var incomparable = orderExpr.incomparable;
- if (dimLoose == null) {
- if (true) {
- errMsg = 'Sort transform config must has "dimension" specified.' + sampleLog;
- }
- throwError(errMsg);
- }
- if (order !== "asc" && order !== "desc") {
- if (true) {
- errMsg = 'Sort transform config must has "order" specified.' + sampleLog;
- }
- throwError(errMsg);
- }
- if (incomparable && incomparable !== "min" && incomparable !== "max") {
- var errMsg_1 = "";
- if (true) {
- errMsg_1 = 'incomparable must be "min" or "max" rather than "' + incomparable + '".';
- }
- throwError(errMsg_1);
- }
- if (order !== "asc" && order !== "desc") {
- var errMsg_2 = "";
- if (true) {
- errMsg_2 = 'order must be "asc" or "desc" rather than "' + order + '".';
- }
- throwError(errMsg_2);
- }
- var dimInfo = upstream.getDimensionInfo(dimLoose);
- if (!dimInfo) {
- if (true) {
- errMsg = makePrintable("Can not find dimension info via: " + dimLoose + ".\n", "Existing dimensions: ", upstream.cloneAllDimensionInfo(), ".\n", "Illegal config:", orderExpr, ".\n");
- }
- throwError(errMsg);
- }
- var parser = parserName ? getRawValueParser(parserName) : null;
- if (parserName && !parser) {
- if (true) {
- errMsg = makePrintable("Invalid parser name " + parserName + ".\n", "Illegal config:", orderExpr, ".\n");
- }
- throwError(errMsg);
- }
- orderDefList.push({
- dimIdx: dimInfo.index,
- parser,
- comparator: new SortOrderComparator(order, incomparable)
- });
- });
- var sourceFormat = upstream.sourceFormat;
- if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {
- if (true) {
- errMsg = 'sourceFormat "' + sourceFormat + '" is not supported yet';
- }
- throwError(errMsg);
- }
- var resultData = [];
- for (var i = 0, len = upstream.count(); i < len; i++) {
- resultData.push(upstream.getRawDataItem(i));
- }
- resultData.sort(function(item0, item1) {
- for (var i2 = 0; i2 < orderDefList.length; i2++) {
- var orderDef = orderDefList[i2];
- var val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx);
- var val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx);
- if (orderDef.parser) {
- val0 = orderDef.parser(val0);
- val1 = orderDef.parser(val1);
- }
- var result = orderDef.comparator.evaluate(val0, val1);
- if (result !== 0) {
- return result;
- }
- }
- return 0;
- });
- return {
- data: resultData
- };
- }
- };
- // node_modules/echarts/lib/component/transform/install.js
- function install30(registers) {
- registers.registerTransform(filterTransform);
- registers.registerTransform(sortTransform);
- }
- // node_modules/echarts/lib/component/dataset/install.js
- init_define_APP_INFO();
- var DatasetModel = function(_super) {
- __extends(DatasetModel2, _super);
- function DatasetModel2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = "dataset";
- return _this;
- }
- DatasetModel2.prototype.init = function(option, parentModel, ecModel) {
- _super.prototype.init.call(this, option, parentModel, ecModel);
- this._sourceManager = new SourceManager(this);
- disableTransformOptionMerge(this);
- };
- DatasetModel2.prototype.mergeOption = function(newOption, ecModel) {
- _super.prototype.mergeOption.call(this, newOption, ecModel);
- disableTransformOptionMerge(this);
- };
- DatasetModel2.prototype.optionUpdated = function() {
- this._sourceManager.dirty();
- };
- DatasetModel2.prototype.getSourceManager = function() {
- return this._sourceManager;
- };
- DatasetModel2.type = "dataset";
- DatasetModel2.defaultOption = {
- seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN
- };
- return DatasetModel2;
- }(Component_default);
- var DatasetView = function(_super) {
- __extends(DatasetView2, _super);
- function DatasetView2() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = "dataset";
- return _this;
- }
- DatasetView2.type = "dataset";
- return DatasetView2;
- }(Component_default2);
- function install31(registers) {
- registers.registerComponentModel(DatasetModel);
- registers.registerComponentView(DatasetView);
- }
- export {
- install29 as AriaComponent,
- install5 as AxisPointerComponent,
- install14 as BrushComponent,
- install9 as CalendarComponent,
- install25 as DataZoomComponent,
- install23 as DataZoomInsideComponent,
- install24 as DataZoomSliderComponent,
- install31 as DatasetComponent,
- install3 as GeoComponent,
- install10 as GraphicComponent,
- install6 as GridComponent,
- install as GridSimpleComponent,
- install22 as LegendComponent,
- install20 as LegendPlainComponent,
- install21 as LegendScrollComponent,
- install19 as MarkAreaComponent,
- install18 as MarkLineComponent,
- install17 as MarkPointComponent,
- install4 as ParallelComponent,
- install7 as PolarComponent,
- install2 as RadarComponent,
- install8 as SingleAxisComponent,
- install16 as TimelineComponent,
- install15 as TitleComponent,
- install12 as ToolboxComponent,
- install13 as TooltipComponent,
- install30 as TransformComponent,
- install28 as VisualMapComponent,
- install26 as VisualMapContinuousComponent,
- install27 as VisualMapPiecewiseComponent
- };
- //# sourceMappingURL=echarts_components.js.map
|