chunk-43FE5UYX.js 283 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395
  1. import {
  2. AxisModelCommonMixin,
  3. Axis_default,
  4. BezierCurve_default,
  5. Circle_default,
  6. Component_default,
  7. Component_default2,
  8. DataDiffer_default,
  9. Ellipse_default,
  10. GeoJSONRegion,
  11. GeoSVGRegion,
  12. Group_default,
  13. Interval_default,
  14. Line_default,
  15. LinearGradient_default,
  16. Model_default,
  17. OrdinalMeta_default,
  18. Polygon_default,
  19. Polyline_default,
  20. RadialGradient_default,
  21. Ring_default,
  22. SINGLE_REFERRING,
  23. SPECIAL_STATES,
  24. __extends,
  25. applyTransform as applyTransform2,
  26. asc,
  27. clear,
  28. clipPointsByRect,
  29. createFromString,
  30. createOrUpdate,
  31. createOrUpdatePatternFromDecal,
  32. createScaleByModel,
  33. createSymbol,
  34. createTextStyle,
  35. defaultEmphasis,
  36. enableComponentHighDownFeatures,
  37. enterEmphasis,
  38. estimateLabelUnionRect,
  39. fetchLayoutMode,
  40. findEventDispatcher,
  41. getAnimationConfig,
  42. getDataDimensionsOnAxis,
  43. getECData,
  44. getLabelStatesModels,
  45. getLayoutParams,
  46. getLayoutRect,
  47. getPrecisionSafe,
  48. getScaleExtent,
  49. getTransform,
  50. getUID,
  51. groupTransition,
  52. hideOverlap,
  53. ifAxisCrossZero,
  54. increaseInterval,
  55. initProps,
  56. isIntervalOrLogScale,
  57. isMiddleOrRightButtonOnMouseUpDown,
  58. isRadianAroundZero,
  59. isValueNice,
  60. leaveEmphasis,
  61. linearMap,
  62. makeInner,
  63. makeStyleMapper,
  64. mergeLayoutParam,
  65. mergePath,
  66. niceScaleExtent,
  67. normalizeSymbolOffset,
  68. normalizeSymbolSize,
  69. normalizeToArray,
  70. parseGeoJSON,
  71. parsePercent,
  72. prepareLayoutList,
  73. registerAction,
  74. remRadian,
  75. removeElement,
  76. retrieveRawValue,
  77. round,
  78. saveOldStyle,
  79. setDefaultStateProxy,
  80. setLabelStyle,
  81. setTooltipConfig,
  82. shouldShowAllLabels,
  83. stop,
  84. toggleHoverEmphasis,
  85. transformDirection,
  86. traverseElements,
  87. updateProps,
  88. warn
  89. } from "./chunk-4Z63X5VE.js";
  90. import {
  91. BoundingRect_default,
  92. CompoundPath_default,
  93. Displayable_default,
  94. Eventful_default,
  95. Image_default,
  96. Path_default,
  97. Rect_default,
  98. TRANSFORMABLE_PROPS,
  99. TSpan_default,
  100. Text_default,
  101. Transformable_default,
  102. applyTransform,
  103. assert,
  104. bind,
  105. clone,
  106. cloneValue,
  107. copy,
  108. copy2,
  109. create,
  110. createHashMap,
  111. curry,
  112. defaults,
  113. each,
  114. eqNaN,
  115. extend,
  116. fastLerp,
  117. filter,
  118. hasOwn,
  119. identity,
  120. indexOf,
  121. invert,
  122. isArray,
  123. isArrayLike,
  124. isFunction,
  125. isNumber,
  126. isObject,
  127. isString,
  128. keys,
  129. map,
  130. max,
  131. merge,
  132. mergeAll,
  133. min,
  134. mixin,
  135. modifyAlpha,
  136. modifyHSL,
  137. mul,
  138. noop,
  139. normalize,
  140. parse,
  141. reduce,
  142. retrieve,
  143. retrieve2,
  144. retrieve3,
  145. rotate,
  146. scale,
  147. stringify,
  148. sub,
  149. translate,
  150. trim
  151. } from "./chunk-NFL6MJ5K.js";
  152. import {
  153. init_define_APP_INFO
  154. } from "./chunk-XY75H3MP.js";
  155. // node_modules/echarts/lib/component/grid/installSimple.js
  156. init_define_APP_INFO();
  157. // node_modules/echarts/lib/coord/cartesian/GridModel.js
  158. init_define_APP_INFO();
  159. var GridModel = function(_super) {
  160. __extends(GridModel2, _super);
  161. function GridModel2() {
  162. return _super !== null && _super.apply(this, arguments) || this;
  163. }
  164. GridModel2.type = "grid";
  165. GridModel2.dependencies = ["xAxis", "yAxis"];
  166. GridModel2.layoutMode = "box";
  167. GridModel2.defaultOption = {
  168. show: false,
  169. z: 0,
  170. left: "10%",
  171. top: 60,
  172. right: "10%",
  173. bottom: 70,
  174. containLabel: false,
  175. backgroundColor: "rgba(0,0,0,0)",
  176. borderWidth: 1,
  177. borderColor: "#ccc"
  178. };
  179. return GridModel2;
  180. }(Component_default);
  181. var GridModel_default = GridModel;
  182. // node_modules/echarts/lib/coord/cartesian/AxisModel.js
  183. init_define_APP_INFO();
  184. var CartesianAxisModel = function(_super) {
  185. __extends(CartesianAxisModel2, _super);
  186. function CartesianAxisModel2() {
  187. return _super !== null && _super.apply(this, arguments) || this;
  188. }
  189. CartesianAxisModel2.prototype.getCoordSysModel = function() {
  190. return this.getReferringComponents("grid", SINGLE_REFERRING).models[0];
  191. };
  192. CartesianAxisModel2.type = "cartesian2dAxis";
  193. return CartesianAxisModel2;
  194. }(Component_default);
  195. mixin(CartesianAxisModel, AxisModelCommonMixin);
  196. // node_modules/echarts/lib/coord/axisModelCreator.js
  197. init_define_APP_INFO();
  198. // node_modules/echarts/lib/coord/axisDefault.js
  199. init_define_APP_INFO();
  200. var defaultOption = {
  201. show: true,
  202. z: 0,
  203. inverse: false,
  204. name: "",
  205. nameLocation: "end",
  206. nameRotate: null,
  207. nameTruncate: {
  208. maxWidth: null,
  209. ellipsis: "...",
  210. placeholder: "."
  211. },
  212. nameTextStyle: {},
  213. nameGap: 15,
  214. silent: false,
  215. triggerEvent: false,
  216. tooltip: {
  217. show: false
  218. },
  219. axisPointer: {},
  220. axisLine: {
  221. show: true,
  222. onZero: true,
  223. onZeroAxisIndex: null,
  224. lineStyle: {
  225. color: "#6E7079",
  226. width: 1,
  227. type: "solid"
  228. },
  229. symbol: ["none", "none"],
  230. symbolSize: [10, 15]
  231. },
  232. axisTick: {
  233. show: true,
  234. inside: false,
  235. length: 5,
  236. lineStyle: {
  237. width: 1
  238. }
  239. },
  240. axisLabel: {
  241. show: true,
  242. inside: false,
  243. rotate: 0,
  244. showMinLabel: null,
  245. showMaxLabel: null,
  246. margin: 8,
  247. fontSize: 12
  248. },
  249. splitLine: {
  250. show: true,
  251. lineStyle: {
  252. color: ["#E0E6F1"],
  253. width: 1,
  254. type: "solid"
  255. }
  256. },
  257. splitArea: {
  258. show: false,
  259. areaStyle: {
  260. color: ["rgba(250,250,250,0.2)", "rgba(210,219,238,0.2)"]
  261. }
  262. }
  263. };
  264. var categoryAxis = merge({
  265. boundaryGap: true,
  266. deduplication: null,
  267. splitLine: {
  268. show: false
  269. },
  270. axisTick: {
  271. alignWithLabel: false,
  272. interval: "auto"
  273. },
  274. axisLabel: {
  275. interval: "auto"
  276. }
  277. }, defaultOption);
  278. var valueAxis = merge({
  279. boundaryGap: [0, 0],
  280. axisLine: {
  281. show: "auto"
  282. },
  283. axisTick: {
  284. show: "auto"
  285. },
  286. splitNumber: 5,
  287. minorTick: {
  288. show: false,
  289. splitNumber: 5,
  290. length: 3,
  291. lineStyle: {}
  292. },
  293. minorSplitLine: {
  294. show: false,
  295. lineStyle: {
  296. color: "#F4F7FD",
  297. width: 1
  298. }
  299. }
  300. }, defaultOption);
  301. var timeAxis = merge({
  302. splitNumber: 6,
  303. axisLabel: {
  304. showMinLabel: false,
  305. showMaxLabel: false,
  306. rich: {
  307. primary: {
  308. fontWeight: "bold"
  309. }
  310. }
  311. },
  312. splitLine: {
  313. show: false
  314. }
  315. }, valueAxis);
  316. var logAxis = defaults({
  317. logBase: 10
  318. }, valueAxis);
  319. var axisDefault_default = {
  320. category: categoryAxis,
  321. value: valueAxis,
  322. time: timeAxis,
  323. log: logAxis
  324. };
  325. // node_modules/echarts/lib/coord/axisCommonTypes.js
  326. init_define_APP_INFO();
  327. var AXIS_TYPES = {
  328. value: 1,
  329. category: 1,
  330. time: 1,
  331. log: 1
  332. };
  333. // node_modules/echarts/lib/coord/axisModelCreator.js
  334. function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {
  335. each(AXIS_TYPES, function(v, axisType) {
  336. var defaultOption2 = merge(merge({}, axisDefault_default[axisType], true), extraDefaultOption, true);
  337. var AxisModel = function(_super) {
  338. __extends(AxisModel2, _super);
  339. function AxisModel2() {
  340. var _this = _super !== null && _super.apply(this, arguments) || this;
  341. _this.type = axisName + "Axis." + axisType;
  342. return _this;
  343. }
  344. AxisModel2.prototype.mergeDefaultAndTheme = function(option, ecModel) {
  345. var layoutMode = fetchLayoutMode(this);
  346. var inputPositionParams = layoutMode ? getLayoutParams(option) : {};
  347. var themeModel = ecModel.getTheme();
  348. merge(option, themeModel.get(axisType + "Axis"));
  349. merge(option, this.getDefaultOption());
  350. option.type = getAxisType(option);
  351. if (layoutMode) {
  352. mergeLayoutParam(option, inputPositionParams, layoutMode);
  353. }
  354. };
  355. AxisModel2.prototype.optionUpdated = function() {
  356. var thisOption = this.option;
  357. if (thisOption.type === "category") {
  358. this.__ordinalMeta = OrdinalMeta_default.createByAxisModel(this);
  359. }
  360. };
  361. AxisModel2.prototype.getCategories = function(rawData) {
  362. var option = this.option;
  363. if (option.type === "category") {
  364. if (rawData) {
  365. return option.data;
  366. }
  367. return this.__ordinalMeta.categories;
  368. }
  369. };
  370. AxisModel2.prototype.getOrdinalMeta = function() {
  371. return this.__ordinalMeta;
  372. };
  373. AxisModel2.type = axisName + "Axis." + axisType;
  374. AxisModel2.defaultOption = defaultOption2;
  375. return AxisModel2;
  376. }(BaseAxisModelClass);
  377. registers.registerComponentModel(AxisModel);
  378. });
  379. registers.registerSubTypeDefaulter(axisName + "Axis", getAxisType);
  380. }
  381. function getAxisType(option) {
  382. return option.type || (option.data ? "category" : "value");
  383. }
  384. // node_modules/echarts/lib/coord/cartesian/Grid.js
  385. init_define_APP_INFO();
  386. // node_modules/echarts/lib/coord/cartesian/Cartesian2D.js
  387. init_define_APP_INFO();
  388. // node_modules/echarts/lib/coord/cartesian/Cartesian.js
  389. init_define_APP_INFO();
  390. var Cartesian = function() {
  391. function Cartesian2(name) {
  392. this.type = "cartesian";
  393. this._dimList = [];
  394. this._axes = {};
  395. this.name = name || "";
  396. }
  397. Cartesian2.prototype.getAxis = function(dim) {
  398. return this._axes[dim];
  399. };
  400. Cartesian2.prototype.getAxes = function() {
  401. return map(this._dimList, function(dim) {
  402. return this._axes[dim];
  403. }, this);
  404. };
  405. Cartesian2.prototype.getAxesByScale = function(scaleType) {
  406. scaleType = scaleType.toLowerCase();
  407. return filter(this.getAxes(), function(axis) {
  408. return axis.scale.type === scaleType;
  409. });
  410. };
  411. Cartesian2.prototype.addAxis = function(axis) {
  412. var dim = axis.dim;
  413. this._axes[dim] = axis;
  414. this._dimList.push(dim);
  415. };
  416. return Cartesian2;
  417. }();
  418. var Cartesian_default = Cartesian;
  419. // node_modules/echarts/lib/coord/cartesian/Cartesian2D.js
  420. var cartesian2DDimensions = ["x", "y"];
  421. function canCalculateAffineTransform(scale2) {
  422. return scale2.type === "interval" || scale2.type === "time";
  423. }
  424. var Cartesian2D = function(_super) {
  425. __extends(Cartesian2D2, _super);
  426. function Cartesian2D2() {
  427. var _this = _super !== null && _super.apply(this, arguments) || this;
  428. _this.type = "cartesian2d";
  429. _this.dimensions = cartesian2DDimensions;
  430. return _this;
  431. }
  432. Cartesian2D2.prototype.calcAffineTransform = function() {
  433. this._transform = this._invTransform = null;
  434. var xAxisScale = this.getAxis("x").scale;
  435. var yAxisScale = this.getAxis("y").scale;
  436. if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {
  437. return;
  438. }
  439. var xScaleExtent = xAxisScale.getExtent();
  440. var yScaleExtent = yAxisScale.getExtent();
  441. var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);
  442. var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);
  443. var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];
  444. var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];
  445. if (!xScaleSpan || !yScaleSpan) {
  446. return;
  447. }
  448. var scaleX = (end[0] - start[0]) / xScaleSpan;
  449. var scaleY = (end[1] - start[1]) / yScaleSpan;
  450. var translateX = start[0] - xScaleExtent[0] * scaleX;
  451. var translateY = start[1] - yScaleExtent[0] * scaleY;
  452. var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];
  453. this._invTransform = invert([], m);
  454. };
  455. Cartesian2D2.prototype.getBaseAxis = function() {
  456. return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAxis("x");
  457. };
  458. Cartesian2D2.prototype.containPoint = function(point) {
  459. var axisX = this.getAxis("x");
  460. var axisY = this.getAxis("y");
  461. return axisX.contain(axisX.toLocalCoord(point[0])) && axisY.contain(axisY.toLocalCoord(point[1]));
  462. };
  463. Cartesian2D2.prototype.containData = function(data) {
  464. return this.getAxis("x").containData(data[0]) && this.getAxis("y").containData(data[1]);
  465. };
  466. Cartesian2D2.prototype.containZone = function(data1, data2) {
  467. var zoneDiag1 = this.dataToPoint(data1);
  468. var zoneDiag2 = this.dataToPoint(data2);
  469. var area = this.getArea();
  470. var zone = new BoundingRect_default(zoneDiag1[0], zoneDiag1[1], zoneDiag2[0] - zoneDiag1[0], zoneDiag2[1] - zoneDiag1[1]);
  471. return area.intersect(zone);
  472. };
  473. Cartesian2D2.prototype.dataToPoint = function(data, clamp, out) {
  474. out = out || [];
  475. var xVal = data[0];
  476. var yVal = data[1];
  477. if (this._transform && xVal != null && isFinite(xVal) && yVal != null && isFinite(yVal)) {
  478. return applyTransform(out, data, this._transform);
  479. }
  480. var xAxis = this.getAxis("x");
  481. var yAxis = this.getAxis("y");
  482. out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal, clamp));
  483. out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal, clamp));
  484. return out;
  485. };
  486. Cartesian2D2.prototype.clampData = function(data, out) {
  487. var xScale = this.getAxis("x").scale;
  488. var yScale = this.getAxis("y").scale;
  489. var xAxisExtent = xScale.getExtent();
  490. var yAxisExtent = yScale.getExtent();
  491. var x = xScale.parse(data[0]);
  492. var y = yScale.parse(data[1]);
  493. out = out || [];
  494. out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]));
  495. out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));
  496. return out;
  497. };
  498. Cartesian2D2.prototype.pointToData = function(point, clamp) {
  499. var out = [];
  500. if (this._invTransform) {
  501. return applyTransform(out, point, this._invTransform);
  502. }
  503. var xAxis = this.getAxis("x");
  504. var yAxis = this.getAxis("y");
  505. out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]), clamp);
  506. out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]), clamp);
  507. return out;
  508. };
  509. Cartesian2D2.prototype.getOtherAxis = function(axis) {
  510. return this.getAxis(axis.dim === "x" ? "y" : "x");
  511. };
  512. Cartesian2D2.prototype.getArea = function() {
  513. var xExtent = this.getAxis("x").getGlobalExtent();
  514. var yExtent = this.getAxis("y").getGlobalExtent();
  515. var x = Math.min(xExtent[0], xExtent[1]);
  516. var y = Math.min(yExtent[0], yExtent[1]);
  517. var width = Math.max(xExtent[0], xExtent[1]) - x;
  518. var height = Math.max(yExtent[0], yExtent[1]) - y;
  519. return new BoundingRect_default(x, y, width, height);
  520. };
  521. return Cartesian2D2;
  522. }(Cartesian_default);
  523. var Cartesian2D_default = Cartesian2D;
  524. // node_modules/echarts/lib/coord/cartesian/Axis2D.js
  525. init_define_APP_INFO();
  526. var Axis2D = function(_super) {
  527. __extends(Axis2D2, _super);
  528. function Axis2D2(dim, scale2, coordExtent, axisType, position) {
  529. var _this = _super.call(this, dim, scale2, coordExtent) || this;
  530. _this.index = 0;
  531. _this.type = axisType || "value";
  532. _this.position = position || "bottom";
  533. return _this;
  534. }
  535. Axis2D2.prototype.isHorizontal = function() {
  536. var position = this.position;
  537. return position === "top" || position === "bottom";
  538. };
  539. Axis2D2.prototype.getGlobalExtent = function(asc2) {
  540. var ret = this.getExtent();
  541. ret[0] = this.toGlobalCoord(ret[0]);
  542. ret[1] = this.toGlobalCoord(ret[1]);
  543. asc2 && ret[0] > ret[1] && ret.reverse();
  544. return ret;
  545. };
  546. Axis2D2.prototype.pointToData = function(point, clamp) {
  547. return this.coordToData(this.toLocalCoord(point[this.dim === "x" ? 0 : 1]), clamp);
  548. };
  549. Axis2D2.prototype.setCategorySortInfo = function(info) {
  550. if (this.type !== "category") {
  551. return false;
  552. }
  553. this.model.option.categorySortInfo = info;
  554. this.scale.setSortInfo(info);
  555. };
  556. return Axis2D2;
  557. }(Axis_default);
  558. var Axis2D_default = Axis2D;
  559. // node_modules/echarts/lib/coord/cartesian/cartesianAxisHelper.js
  560. init_define_APP_INFO();
  561. function layout(gridModel, axisModel, opt) {
  562. opt = opt || {};
  563. var grid = gridModel.coordinateSystem;
  564. var axis = axisModel.axis;
  565. var layout2 = {};
  566. var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];
  567. var rawAxisPosition = axis.position;
  568. var axisPosition = otherAxisOnZeroOf ? "onZero" : rawAxisPosition;
  569. var axisDim = axis.dim;
  570. var rect = grid.getRect();
  571. var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];
  572. var idx = {
  573. left: 0,
  574. right: 1,
  575. top: 0,
  576. bottom: 1,
  577. onZero: 2
  578. };
  579. var axisOffset = axisModel.get("offset") || 0;
  580. var posBound = axisDim === "x" ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];
  581. if (otherAxisOnZeroOf) {
  582. var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));
  583. posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);
  584. }
  585. layout2.position = [axisDim === "y" ? posBound[idx[axisPosition]] : rectBound[0], axisDim === "x" ? posBound[idx[axisPosition]] : rectBound[3]];
  586. layout2.rotation = Math.PI / 2 * (axisDim === "x" ? 0 : 1);
  587. var dirMap = {
  588. top: -1,
  589. bottom: 1,
  590. left: -1,
  591. right: 1
  592. };
  593. layout2.labelDirection = layout2.tickDirection = layout2.nameDirection = dirMap[rawAxisPosition];
  594. layout2.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;
  595. if (axisModel.get(["axisTick", "inside"])) {
  596. layout2.tickDirection = -layout2.tickDirection;
  597. }
  598. if (retrieve(opt.labelInside, axisModel.get(["axisLabel", "inside"]))) {
  599. layout2.labelDirection = -layout2.labelDirection;
  600. }
  601. var labelRotate = axisModel.get(["axisLabel", "rotate"]);
  602. layout2.labelRotate = axisPosition === "top" ? -labelRotate : labelRotate;
  603. layout2.z2 = 1;
  604. return layout2;
  605. }
  606. function isCartesian2DSeries(seriesModel) {
  607. return seriesModel.get("coordinateSystem") === "cartesian2d";
  608. }
  609. function findAxisModels(seriesModel) {
  610. var axisModelMap = {
  611. xAxisModel: null,
  612. yAxisModel: null
  613. };
  614. each(axisModelMap, function(v, key) {
  615. var axisType = key.replace(/Model$/, "");
  616. var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];
  617. if (true) {
  618. if (!axisModel) {
  619. throw new Error(axisType + ' "' + retrieve3(seriesModel.get(axisType + "Index"), seriesModel.get(axisType + "Id"), 0) + '" not found');
  620. }
  621. }
  622. axisModelMap[key] = axisModel;
  623. });
  624. return axisModelMap;
  625. }
  626. // node_modules/echarts/lib/coord/axisAlignTicks.js
  627. init_define_APP_INFO();
  628. var mathLog = Math.log;
  629. function alignScaleTicks(scale2, axisModel, alignToScale) {
  630. var intervalScaleProto = Interval_default.prototype;
  631. var alignToTicks = intervalScaleProto.getTicks.call(alignToScale);
  632. var alignToNicedTicks = intervalScaleProto.getTicks.call(alignToScale, true);
  633. var alignToSplitNumber = alignToTicks.length - 1;
  634. var alignToInterval = intervalScaleProto.getInterval.call(alignToScale);
  635. var scaleExtent = getScaleExtent(scale2, axisModel);
  636. var rawExtent = scaleExtent.extent;
  637. var isMinFixed = scaleExtent.fixMin;
  638. var isMaxFixed = scaleExtent.fixMax;
  639. if (scale2.type === "log") {
  640. var logBase = mathLog(scale2.base);
  641. rawExtent = [mathLog(rawExtent[0]) / logBase, mathLog(rawExtent[1]) / logBase];
  642. }
  643. scale2.setExtent(rawExtent[0], rawExtent[1]);
  644. scale2.calcNiceExtent({
  645. splitNumber: alignToSplitNumber,
  646. fixMin: isMinFixed,
  647. fixMax: isMaxFixed
  648. });
  649. var extent = intervalScaleProto.getExtent.call(scale2);
  650. if (isMinFixed) {
  651. rawExtent[0] = extent[0];
  652. }
  653. if (isMaxFixed) {
  654. rawExtent[1] = extent[1];
  655. }
  656. var interval = intervalScaleProto.getInterval.call(scale2);
  657. var min2 = rawExtent[0];
  658. var max2 = rawExtent[1];
  659. if (isMinFixed && isMaxFixed) {
  660. interval = (max2 - min2) / alignToSplitNumber;
  661. } else if (isMinFixed) {
  662. max2 = rawExtent[0] + interval * alignToSplitNumber;
  663. while (max2 < rawExtent[1] && isFinite(max2) && isFinite(rawExtent[1])) {
  664. interval = increaseInterval(interval);
  665. max2 = rawExtent[0] + interval * alignToSplitNumber;
  666. }
  667. } else if (isMaxFixed) {
  668. min2 = rawExtent[1] - interval * alignToSplitNumber;
  669. while (min2 > rawExtent[0] && isFinite(min2) && isFinite(rawExtent[0])) {
  670. interval = increaseInterval(interval);
  671. min2 = rawExtent[1] - interval * alignToSplitNumber;
  672. }
  673. } else {
  674. var nicedSplitNumber = scale2.getTicks().length - 1;
  675. if (nicedSplitNumber > alignToSplitNumber) {
  676. interval = increaseInterval(interval);
  677. }
  678. var range = interval * alignToSplitNumber;
  679. max2 = Math.ceil(rawExtent[1] / interval) * interval;
  680. min2 = round(max2 - range);
  681. if (min2 < 0 && rawExtent[0] >= 0) {
  682. min2 = 0;
  683. max2 = round(range);
  684. } else if (max2 > 0 && rawExtent[1] <= 0) {
  685. max2 = 0;
  686. min2 = -round(range);
  687. }
  688. }
  689. var t0 = (alignToTicks[0].value - alignToNicedTicks[0].value) / alignToInterval;
  690. var t1 = (alignToTicks[alignToSplitNumber].value - alignToNicedTicks[alignToSplitNumber].value) / alignToInterval;
  691. intervalScaleProto.setExtent.call(scale2, min2 + interval * t0, max2 + interval * t1);
  692. intervalScaleProto.setInterval.call(scale2, interval);
  693. if (t0 || t1) {
  694. intervalScaleProto.setNiceExtent.call(scale2, min2 + interval, max2 - interval);
  695. }
  696. if (true) {
  697. var ticks = intervalScaleProto.getTicks.call(scale2);
  698. if (ticks[1] && (!isValueNice(interval) || getPrecisionSafe(ticks[1].value) > getPrecisionSafe(interval))) {
  699. warn(
  700. "The ticks may be not readable when set min: " + axisModel.get("min") + ", max: " + axisModel.get("max") + " and alignTicks: true"
  701. );
  702. }
  703. }
  704. }
  705. // node_modules/echarts/lib/coord/cartesian/Grid.js
  706. var Grid = function() {
  707. function Grid2(gridModel, ecModel, api) {
  708. this.type = "grid";
  709. this._coordsMap = {};
  710. this._coordsList = [];
  711. this._axesMap = {};
  712. this._axesList = [];
  713. this.axisPointerEnabled = true;
  714. this.dimensions = cartesian2DDimensions;
  715. this._initCartesian(gridModel, ecModel, api);
  716. this.model = gridModel;
  717. }
  718. Grid2.prototype.getRect = function() {
  719. return this._rect;
  720. };
  721. Grid2.prototype.update = function(ecModel, api) {
  722. var axesMap = this._axesMap;
  723. this._updateScale(ecModel, this.model);
  724. function updateAxisTicks(axes) {
  725. var alignTo;
  726. var axesIndices = keys(axes);
  727. var len = axesIndices.length;
  728. if (!len) {
  729. return;
  730. }
  731. var axisNeedsAlign = [];
  732. for (var i = len - 1; i >= 0; i--) {
  733. var idx = +axesIndices[i];
  734. var axis = axes[idx];
  735. var model = axis.model;
  736. var scale2 = axis.scale;
  737. if (isIntervalOrLogScale(scale2) && model.get("alignTicks") && model.get("interval") == null) {
  738. axisNeedsAlign.push(axis);
  739. } else {
  740. niceScaleExtent(scale2, model);
  741. if (isIntervalOrLogScale(scale2)) {
  742. alignTo = axis;
  743. }
  744. }
  745. }
  746. ;
  747. if (axisNeedsAlign.length) {
  748. if (!alignTo) {
  749. alignTo = axisNeedsAlign.pop();
  750. niceScaleExtent(alignTo.scale, alignTo.model);
  751. }
  752. each(axisNeedsAlign, function(axis2) {
  753. alignScaleTicks(axis2.scale, axis2.model, alignTo.scale);
  754. });
  755. }
  756. }
  757. updateAxisTicks(axesMap.x);
  758. updateAxisTicks(axesMap.y);
  759. var onZeroRecords = {};
  760. each(axesMap.x, function(xAxis) {
  761. fixAxisOnZero(axesMap, "y", xAxis, onZeroRecords);
  762. });
  763. each(axesMap.y, function(yAxis) {
  764. fixAxisOnZero(axesMap, "x", yAxis, onZeroRecords);
  765. });
  766. this.resize(this.model, api);
  767. };
  768. Grid2.prototype.resize = function(gridModel, api, ignoreContainLabel) {
  769. var boxLayoutParams = gridModel.getBoxLayoutParams();
  770. var isContainLabel = !ignoreContainLabel && gridModel.get("containLabel");
  771. var gridRect = getLayoutRect(boxLayoutParams, {
  772. width: api.getWidth(),
  773. height: api.getHeight()
  774. });
  775. this._rect = gridRect;
  776. var axesList = this._axesList;
  777. adjustAxes();
  778. if (isContainLabel) {
  779. each(axesList, function(axis) {
  780. if (!axis.model.get(["axisLabel", "inside"])) {
  781. var labelUnionRect = estimateLabelUnionRect(axis);
  782. if (labelUnionRect) {
  783. var dim = axis.isHorizontal() ? "height" : "width";
  784. var margin = axis.model.get(["axisLabel", "margin"]);
  785. gridRect[dim] -= labelUnionRect[dim] + margin;
  786. if (axis.position === "top") {
  787. gridRect.y += labelUnionRect.height + margin;
  788. } else if (axis.position === "left") {
  789. gridRect.x += labelUnionRect.width + margin;
  790. }
  791. }
  792. }
  793. });
  794. adjustAxes();
  795. }
  796. each(this._coordsList, function(coord) {
  797. coord.calcAffineTransform();
  798. });
  799. function adjustAxes() {
  800. each(axesList, function(axis) {
  801. var isHorizontal = axis.isHorizontal();
  802. var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];
  803. var idx = axis.inverse ? 1 : 0;
  804. axis.setExtent(extent[idx], extent[1 - idx]);
  805. updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y);
  806. });
  807. }
  808. };
  809. Grid2.prototype.getAxis = function(dim, axisIndex) {
  810. var axesMapOnDim = this._axesMap[dim];
  811. if (axesMapOnDim != null) {
  812. return axesMapOnDim[axisIndex || 0];
  813. }
  814. };
  815. Grid2.prototype.getAxes = function() {
  816. return this._axesList.slice();
  817. };
  818. Grid2.prototype.getCartesian = function(xAxisIndex, yAxisIndex) {
  819. if (xAxisIndex != null && yAxisIndex != null) {
  820. var key = "x" + xAxisIndex + "y" + yAxisIndex;
  821. return this._coordsMap[key];
  822. }
  823. if (isObject(xAxisIndex)) {
  824. yAxisIndex = xAxisIndex.yAxisIndex;
  825. xAxisIndex = xAxisIndex.xAxisIndex;
  826. }
  827. for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) {
  828. if (coordList[i].getAxis("x").index === xAxisIndex || coordList[i].getAxis("y").index === yAxisIndex) {
  829. return coordList[i];
  830. }
  831. }
  832. };
  833. Grid2.prototype.getCartesians = function() {
  834. return this._coordsList.slice();
  835. };
  836. Grid2.prototype.convertToPixel = function(ecModel, finder, value) {
  837. var target = this._findConvertTarget(finder);
  838. return target.cartesian ? target.cartesian.dataToPoint(value) : target.axis ? target.axis.toGlobalCoord(target.axis.dataToCoord(value)) : null;
  839. };
  840. Grid2.prototype.convertFromPixel = function(ecModel, finder, value) {
  841. var target = this._findConvertTarget(finder);
  842. return target.cartesian ? target.cartesian.pointToData(value) : target.axis ? target.axis.coordToData(target.axis.toLocalCoord(value)) : null;
  843. };
  844. Grid2.prototype._findConvertTarget = function(finder) {
  845. var seriesModel = finder.seriesModel;
  846. var xAxisModel = finder.xAxisModel || seriesModel && seriesModel.getReferringComponents("xAxis", SINGLE_REFERRING).models[0];
  847. var yAxisModel = finder.yAxisModel || seriesModel && seriesModel.getReferringComponents("yAxis", SINGLE_REFERRING).models[0];
  848. var gridModel = finder.gridModel;
  849. var coordsList = this._coordsList;
  850. var cartesian;
  851. var axis;
  852. if (seriesModel) {
  853. cartesian = seriesModel.coordinateSystem;
  854. indexOf(coordsList, cartesian) < 0 && (cartesian = null);
  855. } else if (xAxisModel && yAxisModel) {
  856. cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);
  857. } else if (xAxisModel) {
  858. axis = this.getAxis("x", xAxisModel.componentIndex);
  859. } else if (yAxisModel) {
  860. axis = this.getAxis("y", yAxisModel.componentIndex);
  861. } else if (gridModel) {
  862. var grid = gridModel.coordinateSystem;
  863. if (grid === this) {
  864. cartesian = this._coordsList[0];
  865. }
  866. }
  867. return {
  868. cartesian,
  869. axis
  870. };
  871. };
  872. Grid2.prototype.containPoint = function(point) {
  873. var coord = this._coordsList[0];
  874. if (coord) {
  875. return coord.containPoint(point);
  876. }
  877. };
  878. Grid2.prototype._initCartesian = function(gridModel, ecModel, api) {
  879. var _this = this;
  880. var grid = this;
  881. var axisPositionUsed = {
  882. left: false,
  883. right: false,
  884. top: false,
  885. bottom: false
  886. };
  887. var axesMap = {
  888. x: {},
  889. y: {}
  890. };
  891. var axesCount = {
  892. x: 0,
  893. y: 0
  894. };
  895. ecModel.eachComponent("xAxis", createAxisCreator("x"), this);
  896. ecModel.eachComponent("yAxis", createAxisCreator("y"), this);
  897. if (!axesCount.x || !axesCount.y) {
  898. this._axesMap = {};
  899. this._axesList = [];
  900. return;
  901. }
  902. this._axesMap = axesMap;
  903. each(axesMap.x, function(xAxis, xAxisIndex) {
  904. each(axesMap.y, function(yAxis, yAxisIndex) {
  905. var key = "x" + xAxisIndex + "y" + yAxisIndex;
  906. var cartesian = new Cartesian2D_default(key);
  907. cartesian.master = _this;
  908. cartesian.model = gridModel;
  909. _this._coordsMap[key] = cartesian;
  910. _this._coordsList.push(cartesian);
  911. cartesian.addAxis(xAxis);
  912. cartesian.addAxis(yAxis);
  913. });
  914. });
  915. function createAxisCreator(dimName) {
  916. return function(axisModel, idx) {
  917. if (!isAxisUsedInTheGrid(axisModel, gridModel)) {
  918. return;
  919. }
  920. var axisPosition = axisModel.get("position");
  921. if (dimName === "x") {
  922. if (axisPosition !== "top" && axisPosition !== "bottom") {
  923. axisPosition = axisPositionUsed.bottom ? "top" : "bottom";
  924. }
  925. } else {
  926. if (axisPosition !== "left" && axisPosition !== "right") {
  927. axisPosition = axisPositionUsed.left ? "right" : "left";
  928. }
  929. }
  930. axisPositionUsed[axisPosition] = true;
  931. var axis = new Axis2D_default(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get("type"), axisPosition);
  932. var isCategory = axis.type === "category";
  933. axis.onBand = isCategory && axisModel.get("boundaryGap");
  934. axis.inverse = axisModel.get("inverse");
  935. axisModel.axis = axis;
  936. axis.model = axisModel;
  937. axis.grid = grid;
  938. axis.index = idx;
  939. grid._axesList.push(axis);
  940. axesMap[dimName][idx] = axis;
  941. axesCount[dimName]++;
  942. };
  943. }
  944. };
  945. Grid2.prototype._updateScale = function(ecModel, gridModel) {
  946. each(this._axesList, function(axis) {
  947. axis.scale.setExtent(Infinity, -Infinity);
  948. if (axis.type === "category") {
  949. var categorySortInfo = axis.model.get("categorySortInfo");
  950. axis.scale.setSortInfo(categorySortInfo);
  951. }
  952. });
  953. ecModel.eachSeries(function(seriesModel) {
  954. if (isCartesian2DSeries(seriesModel)) {
  955. var axesModelMap = findAxisModels(seriesModel);
  956. var xAxisModel = axesModelMap.xAxisModel;
  957. var yAxisModel = axesModelMap.yAxisModel;
  958. if (!isAxisUsedInTheGrid(xAxisModel, gridModel) || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {
  959. return;
  960. }
  961. var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);
  962. var data = seriesModel.getData();
  963. var xAxis = cartesian.getAxis("x");
  964. var yAxis = cartesian.getAxis("y");
  965. unionExtent(data, xAxis);
  966. unionExtent(data, yAxis);
  967. }
  968. }, this);
  969. function unionExtent(data, axis) {
  970. each(getDataDimensionsOnAxis(data, axis.dim), function(dim) {
  971. axis.scale.unionExtentFromData(data, dim);
  972. });
  973. }
  974. };
  975. Grid2.prototype.getTooltipAxes = function(dim) {
  976. var baseAxes = [];
  977. var otherAxes = [];
  978. each(this.getCartesians(), function(cartesian) {
  979. var baseAxis = dim != null && dim !== "auto" ? cartesian.getAxis(dim) : cartesian.getBaseAxis();
  980. var otherAxis = cartesian.getOtherAxis(baseAxis);
  981. indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);
  982. indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);
  983. });
  984. return {
  985. baseAxes,
  986. otherAxes
  987. };
  988. };
  989. Grid2.create = function(ecModel, api) {
  990. var grids = [];
  991. ecModel.eachComponent("grid", function(gridModel, idx) {
  992. var grid = new Grid2(gridModel, ecModel, api);
  993. grid.name = "grid_" + idx;
  994. grid.resize(gridModel, api, true);
  995. gridModel.coordinateSystem = grid;
  996. grids.push(grid);
  997. });
  998. ecModel.eachSeries(function(seriesModel) {
  999. if (!isCartesian2DSeries(seriesModel)) {
  1000. return;
  1001. }
  1002. var axesModelMap = findAxisModels(seriesModel);
  1003. var xAxisModel = axesModelMap.xAxisModel;
  1004. var yAxisModel = axesModelMap.yAxisModel;
  1005. var gridModel = xAxisModel.getCoordSysModel();
  1006. if (true) {
  1007. if (!gridModel) {
  1008. throw new Error('Grid "' + retrieve3(xAxisModel.get("gridIndex"), xAxisModel.get("gridId"), 0) + '" not found');
  1009. }
  1010. if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {
  1011. throw new Error("xAxis and yAxis must use the same grid");
  1012. }
  1013. }
  1014. var grid = gridModel.coordinateSystem;
  1015. seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);
  1016. });
  1017. return grids;
  1018. };
  1019. Grid2.dimensions = cartesian2DDimensions;
  1020. return Grid2;
  1021. }();
  1022. function isAxisUsedInTheGrid(axisModel, gridModel) {
  1023. return axisModel.getCoordSysModel() === gridModel;
  1024. }
  1025. function fixAxisOnZero(axesMap, otherAxisDim, axis, onZeroRecords) {
  1026. axis.getAxesOnZeroOf = function() {
  1027. return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];
  1028. };
  1029. var otherAxes = axesMap[otherAxisDim];
  1030. var otherAxisOnZeroOf;
  1031. var axisModel = axis.model;
  1032. var onZero = axisModel.get(["axisLine", "onZero"]);
  1033. var onZeroAxisIndex = axisModel.get(["axisLine", "onZeroAxisIndex"]);
  1034. if (!onZero) {
  1035. return;
  1036. }
  1037. if (onZeroAxisIndex != null) {
  1038. if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {
  1039. otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];
  1040. }
  1041. } else {
  1042. for (var idx in otherAxes) {
  1043. if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx]) && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {
  1044. otherAxisOnZeroOf = otherAxes[idx];
  1045. break;
  1046. }
  1047. }
  1048. }
  1049. if (otherAxisOnZeroOf) {
  1050. onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;
  1051. }
  1052. function getOnZeroRecordKey(axis2) {
  1053. return axis2.dim + "_" + axis2.index;
  1054. }
  1055. }
  1056. function canOnZeroToAxis(axis) {
  1057. return axis && axis.type !== "category" && axis.type !== "time" && ifAxisCrossZero(axis);
  1058. }
  1059. function updateAxisTransform(axis, coordBase) {
  1060. var axisExtent = axis.getExtent();
  1061. var axisExtentSum = axisExtent[0] + axisExtent[1];
  1062. axis.toGlobalCoord = axis.dim === "x" ? function(coord) {
  1063. return coord + coordBase;
  1064. } : function(coord) {
  1065. return axisExtentSum - coord + coordBase;
  1066. };
  1067. axis.toLocalCoord = axis.dim === "x" ? function(coord) {
  1068. return coord - coordBase;
  1069. } : function(coord) {
  1070. return axisExtentSum - coord + coordBase;
  1071. };
  1072. }
  1073. var Grid_default = Grid;
  1074. // node_modules/echarts/lib/component/axis/CartesianAxisView.js
  1075. init_define_APP_INFO();
  1076. // node_modules/echarts/lib/component/axis/AxisBuilder.js
  1077. init_define_APP_INFO();
  1078. var PI = Math.PI;
  1079. var AxisBuilder = function() {
  1080. function AxisBuilder2(axisModel, opt) {
  1081. this.group = new Group_default();
  1082. this.opt = opt;
  1083. this.axisModel = axisModel;
  1084. defaults(opt, {
  1085. labelOffset: 0,
  1086. nameDirection: 1,
  1087. tickDirection: 1,
  1088. labelDirection: 1,
  1089. silent: true,
  1090. handleAutoShown: function() {
  1091. return true;
  1092. }
  1093. });
  1094. var transformGroup = new Group_default({
  1095. x: opt.position[0],
  1096. y: opt.position[1],
  1097. rotation: opt.rotation
  1098. });
  1099. transformGroup.updateTransform();
  1100. this._transformGroup = transformGroup;
  1101. }
  1102. AxisBuilder2.prototype.hasBuilder = function(name) {
  1103. return !!builders[name];
  1104. };
  1105. AxisBuilder2.prototype.add = function(name) {
  1106. builders[name](this.opt, this.axisModel, this.group, this._transformGroup);
  1107. };
  1108. AxisBuilder2.prototype.getGroup = function() {
  1109. return this.group;
  1110. };
  1111. AxisBuilder2.innerTextLayout = function(axisRotation, textRotation, direction) {
  1112. var rotationDiff = remRadian(textRotation - axisRotation);
  1113. var textAlign;
  1114. var textVerticalAlign;
  1115. if (isRadianAroundZero(rotationDiff)) {
  1116. textVerticalAlign = direction > 0 ? "top" : "bottom";
  1117. textAlign = "center";
  1118. } else if (isRadianAroundZero(rotationDiff - PI)) {
  1119. textVerticalAlign = direction > 0 ? "bottom" : "top";
  1120. textAlign = "center";
  1121. } else {
  1122. textVerticalAlign = "middle";
  1123. if (rotationDiff > 0 && rotationDiff < PI) {
  1124. textAlign = direction > 0 ? "right" : "left";
  1125. } else {
  1126. textAlign = direction > 0 ? "left" : "right";
  1127. }
  1128. }
  1129. return {
  1130. rotation: rotationDiff,
  1131. textAlign,
  1132. textVerticalAlign
  1133. };
  1134. };
  1135. AxisBuilder2.makeAxisEventDataBase = function(axisModel) {
  1136. var eventData = {
  1137. componentType: axisModel.mainType,
  1138. componentIndex: axisModel.componentIndex
  1139. };
  1140. eventData[axisModel.mainType + "Index"] = axisModel.componentIndex;
  1141. return eventData;
  1142. };
  1143. AxisBuilder2.isLabelSilent = function(axisModel) {
  1144. var tooltipOpt = axisModel.get("tooltip");
  1145. return axisModel.get("silent") || !(axisModel.get("triggerEvent") || tooltipOpt && tooltipOpt.show);
  1146. };
  1147. return AxisBuilder2;
  1148. }();
  1149. var builders = {
  1150. axisLine: function(opt, axisModel, group, transformGroup) {
  1151. var shown = axisModel.get(["axisLine", "show"]);
  1152. if (shown === "auto" && opt.handleAutoShown) {
  1153. shown = opt.handleAutoShown("axisLine");
  1154. }
  1155. if (!shown) {
  1156. return;
  1157. }
  1158. var extent = axisModel.axis.getExtent();
  1159. var matrix = transformGroup.transform;
  1160. var pt1 = [extent[0], 0];
  1161. var pt2 = [extent[1], 0];
  1162. if (matrix) {
  1163. applyTransform(pt1, pt1, matrix);
  1164. applyTransform(pt2, pt2, matrix);
  1165. }
  1166. var lineStyle = extend({
  1167. lineCap: "round"
  1168. }, axisModel.getModel(["axisLine", "lineStyle"]).getLineStyle());
  1169. var line = new Line_default({
  1170. subPixelOptimize: true,
  1171. shape: {
  1172. x1: pt1[0],
  1173. y1: pt1[1],
  1174. x2: pt2[0],
  1175. y2: pt2[1]
  1176. },
  1177. style: lineStyle,
  1178. strokeContainThreshold: opt.strokeContainThreshold || 5,
  1179. silent: true,
  1180. z2: 1
  1181. });
  1182. line.anid = "line";
  1183. group.add(line);
  1184. var arrows = axisModel.get(["axisLine", "symbol"]);
  1185. if (arrows != null) {
  1186. var arrowSize = axisModel.get(["axisLine", "symbolSize"]);
  1187. if (isString(arrows)) {
  1188. arrows = [arrows, arrows];
  1189. }
  1190. if (isString(arrowSize) || isNumber(arrowSize)) {
  1191. arrowSize = [arrowSize, arrowSize];
  1192. }
  1193. var arrowOffset = normalizeSymbolOffset(axisModel.get(["axisLine", "symbolOffset"]) || 0, arrowSize);
  1194. var symbolWidth_1 = arrowSize[0];
  1195. var symbolHeight_1 = arrowSize[1];
  1196. each([{
  1197. rotate: opt.rotation + Math.PI / 2,
  1198. offset: arrowOffset[0],
  1199. r: 0
  1200. }, {
  1201. rotate: opt.rotation - Math.PI / 2,
  1202. offset: arrowOffset[1],
  1203. r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0]) + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1]))
  1204. }], function(point, index) {
  1205. if (arrows[index] !== "none" && arrows[index] != null) {
  1206. var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true);
  1207. var r = point.r + point.offset;
  1208. symbol.attr({
  1209. rotation: point.rotate,
  1210. x: pt1[0] + r * Math.cos(opt.rotation),
  1211. y: pt1[1] - r * Math.sin(opt.rotation),
  1212. silent: true,
  1213. z2: 11
  1214. });
  1215. group.add(symbol);
  1216. }
  1217. });
  1218. }
  1219. },
  1220. axisTickLabel: function(opt, axisModel, group, transformGroup) {
  1221. var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt);
  1222. var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt);
  1223. fixMinMaxLabelShow(axisModel, labelEls, ticksEls);
  1224. buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection);
  1225. if (axisModel.get(["axisLabel", "hideOverlap"])) {
  1226. var labelList = prepareLayoutList(map(labelEls, function(label) {
  1227. return {
  1228. label,
  1229. priority: label.z2,
  1230. defaultAttr: {
  1231. ignore: label.ignore
  1232. }
  1233. };
  1234. }));
  1235. hideOverlap(labelList);
  1236. }
  1237. },
  1238. axisName: function(opt, axisModel, group, transformGroup) {
  1239. var name = retrieve(opt.axisName, axisModel.get("name"));
  1240. if (!name) {
  1241. return;
  1242. }
  1243. var nameLocation = axisModel.get("nameLocation");
  1244. var nameDirection = opt.nameDirection;
  1245. var textStyleModel = axisModel.getModel("nameTextStyle");
  1246. var gap = axisModel.get("nameGap") || 0;
  1247. var extent = axisModel.axis.getExtent();
  1248. var gapSignal = extent[0] > extent[1] ? -1 : 1;
  1249. var pos = [
  1250. nameLocation === "start" ? extent[0] - gapSignal * gap : nameLocation === "end" ? extent[1] + gapSignal * gap : (extent[0] + extent[1]) / 2,
  1251. isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0
  1252. ];
  1253. var labelLayout;
  1254. var nameRotation = axisModel.get("nameRotate");
  1255. if (nameRotation != null) {
  1256. nameRotation = nameRotation * PI / 180;
  1257. }
  1258. var axisNameAvailableWidth;
  1259. if (isNameLocationCenter(nameLocation)) {
  1260. labelLayout = AxisBuilder.innerTextLayout(
  1261. opt.rotation,
  1262. nameRotation != null ? nameRotation : opt.rotation,
  1263. nameDirection
  1264. );
  1265. } else {
  1266. labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent);
  1267. axisNameAvailableWidth = opt.axisNameAvailableWidth;
  1268. if (axisNameAvailableWidth != null) {
  1269. axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation));
  1270. !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);
  1271. }
  1272. }
  1273. var textFont = textStyleModel.getFont();
  1274. var truncateOpt = axisModel.get("nameTruncate", true) || {};
  1275. var ellipsis = truncateOpt.ellipsis;
  1276. var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth);
  1277. var textEl = new Text_default({
  1278. x: pos[0],
  1279. y: pos[1],
  1280. rotation: labelLayout.rotation,
  1281. silent: AxisBuilder.isLabelSilent(axisModel),
  1282. style: createTextStyle(textStyleModel, {
  1283. text: name,
  1284. font: textFont,
  1285. overflow: "truncate",
  1286. width: maxWidth,
  1287. ellipsis,
  1288. fill: textStyleModel.getTextColor() || axisModel.get(["axisLine", "lineStyle", "color"]),
  1289. align: textStyleModel.get("align") || labelLayout.textAlign,
  1290. verticalAlign: textStyleModel.get("verticalAlign") || labelLayout.textVerticalAlign
  1291. }),
  1292. z2: 1
  1293. });
  1294. setTooltipConfig({
  1295. el: textEl,
  1296. componentModel: axisModel,
  1297. itemName: name
  1298. });
  1299. textEl.__fullText = name;
  1300. textEl.anid = "name";
  1301. if (axisModel.get("triggerEvent")) {
  1302. var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);
  1303. eventData.targetType = "axisName";
  1304. eventData.name = name;
  1305. getECData(textEl).eventData = eventData;
  1306. }
  1307. transformGroup.add(textEl);
  1308. textEl.updateTransform();
  1309. group.add(textEl);
  1310. textEl.decomposeTransform();
  1311. }
  1312. };
  1313. function endTextLayout(rotation, textPosition, textRotate, extent) {
  1314. var rotationDiff = remRadian(textRotate - rotation);
  1315. var textAlign;
  1316. var textVerticalAlign;
  1317. var inverse = extent[0] > extent[1];
  1318. var onLeft = textPosition === "start" && !inverse || textPosition !== "start" && inverse;
  1319. if (isRadianAroundZero(rotationDiff - PI / 2)) {
  1320. textVerticalAlign = onLeft ? "bottom" : "top";
  1321. textAlign = "center";
  1322. } else if (isRadianAroundZero(rotationDiff - PI * 1.5)) {
  1323. textVerticalAlign = onLeft ? "top" : "bottom";
  1324. textAlign = "center";
  1325. } else {
  1326. textVerticalAlign = "middle";
  1327. if (rotationDiff < PI * 1.5 && rotationDiff > PI / 2) {
  1328. textAlign = onLeft ? "left" : "right";
  1329. } else {
  1330. textAlign = onLeft ? "right" : "left";
  1331. }
  1332. }
  1333. return {
  1334. rotation: rotationDiff,
  1335. textAlign,
  1336. textVerticalAlign
  1337. };
  1338. }
  1339. function fixMinMaxLabelShow(axisModel, labelEls, tickEls) {
  1340. if (shouldShowAllLabels(axisModel.axis)) {
  1341. return;
  1342. }
  1343. var showMinLabel = axisModel.get(["axisLabel", "showMinLabel"]);
  1344. var showMaxLabel = axisModel.get(["axisLabel", "showMaxLabel"]);
  1345. labelEls = labelEls || [];
  1346. tickEls = tickEls || [];
  1347. var firstLabel = labelEls[0];
  1348. var nextLabel = labelEls[1];
  1349. var lastLabel = labelEls[labelEls.length - 1];
  1350. var prevLabel = labelEls[labelEls.length - 2];
  1351. var firstTick = tickEls[0];
  1352. var nextTick = tickEls[1];
  1353. var lastTick = tickEls[tickEls.length - 1];
  1354. var prevTick = tickEls[tickEls.length - 2];
  1355. if (showMinLabel === false) {
  1356. ignoreEl(firstLabel);
  1357. ignoreEl(firstTick);
  1358. } else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {
  1359. if (showMinLabel) {
  1360. ignoreEl(nextLabel);
  1361. ignoreEl(nextTick);
  1362. } else {
  1363. ignoreEl(firstLabel);
  1364. ignoreEl(firstTick);
  1365. }
  1366. }
  1367. if (showMaxLabel === false) {
  1368. ignoreEl(lastLabel);
  1369. ignoreEl(lastTick);
  1370. } else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {
  1371. if (showMaxLabel) {
  1372. ignoreEl(prevLabel);
  1373. ignoreEl(prevTick);
  1374. } else {
  1375. ignoreEl(lastLabel);
  1376. ignoreEl(lastTick);
  1377. }
  1378. }
  1379. }
  1380. function ignoreEl(el) {
  1381. el && (el.ignore = true);
  1382. }
  1383. function isTwoLabelOverlapped(current, next) {
  1384. var firstRect = current && current.getBoundingRect().clone();
  1385. var nextRect = next && next.getBoundingRect().clone();
  1386. if (!firstRect || !nextRect) {
  1387. return;
  1388. }
  1389. var mRotationBack = identity([]);
  1390. rotate(mRotationBack, mRotationBack, -current.rotation);
  1391. firstRect.applyTransform(mul([], mRotationBack, current.getLocalTransform()));
  1392. nextRect.applyTransform(mul([], mRotationBack, next.getLocalTransform()));
  1393. return firstRect.intersect(nextRect);
  1394. }
  1395. function isNameLocationCenter(nameLocation) {
  1396. return nameLocation === "middle" || nameLocation === "center";
  1397. }
  1398. function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {
  1399. var tickEls = [];
  1400. var pt1 = [];
  1401. var pt2 = [];
  1402. for (var i = 0; i < ticksCoords.length; i++) {
  1403. var tickCoord = ticksCoords[i].coord;
  1404. pt1[0] = tickCoord;
  1405. pt1[1] = 0;
  1406. pt2[0] = tickCoord;
  1407. pt2[1] = tickEndCoord;
  1408. if (tickTransform) {
  1409. applyTransform(pt1, pt1, tickTransform);
  1410. applyTransform(pt2, pt2, tickTransform);
  1411. }
  1412. var tickEl = new Line_default({
  1413. subPixelOptimize: true,
  1414. shape: {
  1415. x1: pt1[0],
  1416. y1: pt1[1],
  1417. x2: pt2[0],
  1418. y2: pt2[1]
  1419. },
  1420. style: tickLineStyle,
  1421. z2: 2,
  1422. autoBatch: true,
  1423. silent: true
  1424. });
  1425. tickEl.anid = anidPrefix + "_" + ticksCoords[i].tickValue;
  1426. tickEls.push(tickEl);
  1427. }
  1428. return tickEls;
  1429. }
  1430. function buildAxisMajorTicks(group, transformGroup, axisModel, opt) {
  1431. var axis = axisModel.axis;
  1432. var tickModel = axisModel.getModel("axisTick");
  1433. var shown = tickModel.get("show");
  1434. if (shown === "auto" && opt.handleAutoShown) {
  1435. shown = opt.handleAutoShown("axisTick");
  1436. }
  1437. if (!shown || axis.scale.isBlank()) {
  1438. return;
  1439. }
  1440. var lineStyleModel = tickModel.getModel("lineStyle");
  1441. var tickEndCoord = opt.tickDirection * tickModel.get("length");
  1442. var ticksCoords = axis.getTicksCoords();
  1443. var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {
  1444. stroke: axisModel.get(["axisLine", "lineStyle", "color"])
  1445. }), "ticks");
  1446. for (var i = 0; i < ticksEls.length; i++) {
  1447. group.add(ticksEls[i]);
  1448. }
  1449. return ticksEls;
  1450. }
  1451. function buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) {
  1452. var axis = axisModel.axis;
  1453. var minorTickModel = axisModel.getModel("minorTick");
  1454. if (!minorTickModel.get("show") || axis.scale.isBlank()) {
  1455. return;
  1456. }
  1457. var minorTicksCoords = axis.getMinorTicksCoords();
  1458. if (!minorTicksCoords.length) {
  1459. return;
  1460. }
  1461. var lineStyleModel = minorTickModel.getModel("lineStyle");
  1462. var tickEndCoord = tickDirection * minorTickModel.get("length");
  1463. var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel("axisTick").getLineStyle(), {
  1464. stroke: axisModel.get(["axisLine", "lineStyle", "color"])
  1465. }));
  1466. for (var i = 0; i < minorTicksCoords.length; i++) {
  1467. var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, "minorticks_" + i);
  1468. for (var k = 0; k < minorTicksEls.length; k++) {
  1469. group.add(minorTicksEls[k]);
  1470. }
  1471. }
  1472. }
  1473. function buildAxisLabel(group, transformGroup, axisModel, opt) {
  1474. var axis = axisModel.axis;
  1475. var show = retrieve(opt.axisLabelShow, axisModel.get(["axisLabel", "show"]));
  1476. if (!show || axis.scale.isBlank()) {
  1477. return;
  1478. }
  1479. var labelModel = axisModel.getModel("axisLabel");
  1480. var labelMargin = labelModel.get("margin");
  1481. var labels = axis.getViewLabels();
  1482. var labelRotation = (retrieve(opt.labelRotate, labelModel.get("rotate")) || 0) * PI / 180;
  1483. var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);
  1484. var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);
  1485. var labelEls = [];
  1486. var silent = AxisBuilder.isLabelSilent(axisModel);
  1487. var triggerEvent = axisModel.get("triggerEvent");
  1488. each(labels, function(labelItem, index) {
  1489. var tickValue = axis.scale.type === "ordinal" ? axis.scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;
  1490. var formattedLabel = labelItem.formattedLabel;
  1491. var rawLabel = labelItem.rawLabel;
  1492. var itemLabelModel = labelModel;
  1493. if (rawCategoryData && rawCategoryData[tickValue]) {
  1494. var rawCategoryItem = rawCategoryData[tickValue];
  1495. if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {
  1496. itemLabelModel = new Model_default(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);
  1497. }
  1498. }
  1499. var textColor = itemLabelModel.getTextColor() || axisModel.get(["axisLine", "lineStyle", "color"]);
  1500. var tickCoord = axis.dataToCoord(tickValue);
  1501. var textEl = new Text_default({
  1502. x: tickCoord,
  1503. y: opt.labelOffset + opt.labelDirection * labelMargin,
  1504. rotation: labelLayout.rotation,
  1505. silent,
  1506. z2: 10 + (labelItem.level || 0),
  1507. style: createTextStyle(itemLabelModel, {
  1508. text: formattedLabel,
  1509. align: itemLabelModel.getShallow("align", true) || labelLayout.textAlign,
  1510. verticalAlign: itemLabelModel.getShallow("verticalAlign", true) || itemLabelModel.getShallow("baseline", true) || labelLayout.textVerticalAlign,
  1511. fill: isFunction(textColor) ? textColor(
  1512. axis.type === "category" ? rawLabel : axis.type === "value" ? tickValue + "" : tickValue,
  1513. index
  1514. ) : textColor
  1515. })
  1516. });
  1517. textEl.anid = "label_" + tickValue;
  1518. if (triggerEvent) {
  1519. var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);
  1520. eventData.targetType = "axisLabel";
  1521. eventData.value = rawLabel;
  1522. eventData.tickIndex = index;
  1523. if (axis.type === "category") {
  1524. eventData.dataIndex = tickValue;
  1525. }
  1526. getECData(textEl).eventData = eventData;
  1527. }
  1528. transformGroup.add(textEl);
  1529. textEl.updateTransform();
  1530. labelEls.push(textEl);
  1531. group.add(textEl);
  1532. textEl.decomposeTransform();
  1533. });
  1534. return labelEls;
  1535. }
  1536. var AxisBuilder_default = AxisBuilder;
  1537. // node_modules/echarts/lib/component/axis/AxisView.js
  1538. init_define_APP_INFO();
  1539. // node_modules/echarts/lib/component/axisPointer/modelHelper.js
  1540. init_define_APP_INFO();
  1541. function collect(ecModel, api) {
  1542. var result = {
  1543. axesInfo: {},
  1544. seriesInvolved: false,
  1545. coordSysAxesInfo: {},
  1546. coordSysMap: {}
  1547. };
  1548. collectAxesInfo(result, ecModel, api);
  1549. result.seriesInvolved && collectSeriesInfo(result, ecModel);
  1550. return result;
  1551. }
  1552. function collectAxesInfo(result, ecModel, api) {
  1553. var globalTooltipModel = ecModel.getComponent("tooltip");
  1554. var globalAxisPointerModel = ecModel.getComponent("axisPointer");
  1555. var linksOption = globalAxisPointerModel.get("link", true) || [];
  1556. var linkGroups = [];
  1557. each(api.getCoordinateSystems(), function(coordSys) {
  1558. if (!coordSys.axisPointerEnabled) {
  1559. return;
  1560. }
  1561. var coordSysKey = makeKey(coordSys.model);
  1562. var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {};
  1563. result.coordSysMap[coordSysKey] = coordSys;
  1564. var coordSysModel = coordSys.model;
  1565. var baseTooltipModel = coordSysModel.getModel("tooltip", globalTooltipModel);
  1566. each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null));
  1567. if (coordSys.getTooltipAxes && globalTooltipModel && baseTooltipModel.get("show")) {
  1568. var triggerAxis = baseTooltipModel.get("trigger") === "axis";
  1569. var cross = baseTooltipModel.get(["axisPointer", "type"]) === "cross";
  1570. var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(["axisPointer", "axis"]));
  1571. if (triggerAxis || cross) {
  1572. each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? "cross" : true, triggerAxis));
  1573. }
  1574. if (cross) {
  1575. each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, "cross", false));
  1576. }
  1577. }
  1578. function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {
  1579. var axisPointerModel = axis.model.getModel("axisPointer", globalAxisPointerModel);
  1580. var axisPointerShow = axisPointerModel.get("show");
  1581. if (!axisPointerShow || axisPointerShow === "auto" && !fromTooltip && !isHandleTrigger(axisPointerModel)) {
  1582. return;
  1583. }
  1584. if (triggerTooltip == null) {
  1585. triggerTooltip = axisPointerModel.get("triggerTooltip");
  1586. }
  1587. axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;
  1588. var snap = axisPointerModel.get("snap");
  1589. var axisKey = makeKey(axis.model);
  1590. var involveSeries = triggerTooltip || snap || axis.type === "category";
  1591. var axisInfo = result.axesInfo[axisKey] = {
  1592. key: axisKey,
  1593. axis,
  1594. coordSys,
  1595. axisPointerModel,
  1596. triggerTooltip,
  1597. involveSeries,
  1598. snap,
  1599. useHandle: isHandleTrigger(axisPointerModel),
  1600. seriesModels: [],
  1601. linkGroup: null
  1602. };
  1603. axesInfoInCoordSys[axisKey] = axisInfo;
  1604. result.seriesInvolved = result.seriesInvolved || involveSeries;
  1605. var groupIndex = getLinkGroupIndex(linksOption, axis);
  1606. if (groupIndex != null) {
  1607. var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {
  1608. axesInfo: {}
  1609. });
  1610. linkGroup.axesInfo[axisKey] = axisInfo;
  1611. linkGroup.mapper = linksOption[groupIndex].mapper;
  1612. axisInfo.linkGroup = linkGroup;
  1613. }
  1614. }
  1615. });
  1616. }
  1617. function makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) {
  1618. var tooltipAxisPointerModel = baseTooltipModel.getModel("axisPointer");
  1619. var fields = ["type", "snap", "lineStyle", "shadowStyle", "label", "animation", "animationDurationUpdate", "animationEasingUpdate", "z"];
  1620. var volatileOption = {};
  1621. each(fields, function(field) {
  1622. volatileOption[field] = clone(tooltipAxisPointerModel.get(field));
  1623. });
  1624. volatileOption.snap = axis.type !== "category" && !!triggerTooltip;
  1625. if (tooltipAxisPointerModel.get("type") === "cross") {
  1626. volatileOption.type = "line";
  1627. }
  1628. var labelOption = volatileOption.label || (volatileOption.label = {});
  1629. labelOption.show == null && (labelOption.show = false);
  1630. if (fromTooltip === "cross") {
  1631. var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(["label", "show"]);
  1632. labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true;
  1633. if (!triggerTooltip) {
  1634. var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get("crossStyle");
  1635. crossStyle && defaults(labelOption, crossStyle.textStyle);
  1636. }
  1637. }
  1638. return axis.model.getModel("axisPointer", new Model_default(volatileOption, globalAxisPointerModel, ecModel));
  1639. }
  1640. function collectSeriesInfo(result, ecModel) {
  1641. ecModel.eachSeries(function(seriesModel) {
  1642. var coordSys = seriesModel.coordinateSystem;
  1643. var seriesTooltipTrigger = seriesModel.get(["tooltip", "trigger"], true);
  1644. var seriesTooltipShow = seriesModel.get(["tooltip", "show"], true);
  1645. if (!coordSys || seriesTooltipTrigger === "none" || seriesTooltipTrigger === false || seriesTooltipTrigger === "item" || seriesTooltipShow === false || seriesModel.get(["axisPointer", "show"], true) === false) {
  1646. return;
  1647. }
  1648. each(result.coordSysAxesInfo[makeKey(coordSys.model)], function(axisInfo) {
  1649. var axis = axisInfo.axis;
  1650. if (coordSys.getAxis(axis.dim) === axis) {
  1651. axisInfo.seriesModels.push(seriesModel);
  1652. axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0);
  1653. axisInfo.seriesDataCount += seriesModel.getData().count();
  1654. }
  1655. });
  1656. });
  1657. }
  1658. function getLinkGroupIndex(linksOption, axis) {
  1659. var axisModel = axis.model;
  1660. var dim = axis.dim;
  1661. for (var i = 0; i < linksOption.length; i++) {
  1662. var linkOption = linksOption[i] || {};
  1663. if (checkPropInLink(linkOption[dim + "AxisId"], axisModel.id) || checkPropInLink(linkOption[dim + "AxisIndex"], axisModel.componentIndex) || checkPropInLink(linkOption[dim + "AxisName"], axisModel.name)) {
  1664. return i;
  1665. }
  1666. }
  1667. }
  1668. function checkPropInLink(linkPropValue, axisPropValue) {
  1669. return linkPropValue === "all" || isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0 || linkPropValue === axisPropValue;
  1670. }
  1671. function fixValue(axisModel) {
  1672. var axisInfo = getAxisInfo(axisModel);
  1673. if (!axisInfo) {
  1674. return;
  1675. }
  1676. var axisPointerModel = axisInfo.axisPointerModel;
  1677. var scale2 = axisInfo.axis.scale;
  1678. var option = axisPointerModel.option;
  1679. var status = axisPointerModel.get("status");
  1680. var value = axisPointerModel.get("value");
  1681. if (value != null) {
  1682. value = scale2.parse(value);
  1683. }
  1684. var useHandle = isHandleTrigger(axisPointerModel);
  1685. if (status == null) {
  1686. option.status = useHandle ? "show" : "hide";
  1687. }
  1688. var extent = scale2.getExtent().slice();
  1689. extent[0] > extent[1] && extent.reverse();
  1690. if (value == null || value > extent[1]) {
  1691. value = extent[1];
  1692. }
  1693. if (value < extent[0]) {
  1694. value = extent[0];
  1695. }
  1696. option.value = value;
  1697. if (useHandle) {
  1698. option.status = axisInfo.axis.scale.isBlank() ? "hide" : "show";
  1699. }
  1700. }
  1701. function getAxisInfo(axisModel) {
  1702. var coordSysAxesInfo = (axisModel.ecModel.getComponent("axisPointer") || {}).coordSysAxesInfo;
  1703. return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];
  1704. }
  1705. function getAxisPointerModel(axisModel) {
  1706. var axisInfo = getAxisInfo(axisModel);
  1707. return axisInfo && axisInfo.axisPointerModel;
  1708. }
  1709. function isHandleTrigger(axisPointerModel) {
  1710. return !!axisPointerModel.get(["handle", "show"]);
  1711. }
  1712. function makeKey(model) {
  1713. return model.type + "||" + model.id;
  1714. }
  1715. // node_modules/echarts/lib/component/axis/AxisView.js
  1716. var axisPointerClazz = {};
  1717. var AxisView = function(_super) {
  1718. __extends(AxisView2, _super);
  1719. function AxisView2() {
  1720. var _this = _super !== null && _super.apply(this, arguments) || this;
  1721. _this.type = AxisView2.type;
  1722. return _this;
  1723. }
  1724. AxisView2.prototype.render = function(axisModel, ecModel, api, payload) {
  1725. this.axisPointerClass && fixValue(axisModel);
  1726. _super.prototype.render.apply(this, arguments);
  1727. this._doUpdateAxisPointerClass(axisModel, api, true);
  1728. };
  1729. AxisView2.prototype.updateAxisPointer = function(axisModel, ecModel, api, payload) {
  1730. this._doUpdateAxisPointerClass(axisModel, api, false);
  1731. };
  1732. AxisView2.prototype.remove = function(ecModel, api) {
  1733. var axisPointer = this._axisPointer;
  1734. axisPointer && axisPointer.remove(api);
  1735. };
  1736. AxisView2.prototype.dispose = function(ecModel, api) {
  1737. this._disposeAxisPointer(api);
  1738. _super.prototype.dispose.apply(this, arguments);
  1739. };
  1740. AxisView2.prototype._doUpdateAxisPointerClass = function(axisModel, api, forceRender) {
  1741. var Clazz = AxisView2.getAxisPointerClass(this.axisPointerClass);
  1742. if (!Clazz) {
  1743. return;
  1744. }
  1745. var axisPointerModel = getAxisPointerModel(axisModel);
  1746. axisPointerModel ? (this._axisPointer || (this._axisPointer = new Clazz())).render(axisModel, axisPointerModel, api, forceRender) : this._disposeAxisPointer(api);
  1747. };
  1748. AxisView2.prototype._disposeAxisPointer = function(api) {
  1749. this._axisPointer && this._axisPointer.dispose(api);
  1750. this._axisPointer = null;
  1751. };
  1752. AxisView2.registerAxisPointerClass = function(type, clazz) {
  1753. if (true) {
  1754. if (axisPointerClazz[type]) {
  1755. throw new Error("axisPointer " + type + " exists");
  1756. }
  1757. }
  1758. axisPointerClazz[type] = clazz;
  1759. };
  1760. ;
  1761. AxisView2.getAxisPointerClass = function(type) {
  1762. return type && axisPointerClazz[type];
  1763. };
  1764. ;
  1765. AxisView2.type = "axis";
  1766. return AxisView2;
  1767. }(Component_default2);
  1768. var AxisView_default = AxisView;
  1769. // node_modules/echarts/lib/component/axis/axisSplitHelper.js
  1770. init_define_APP_INFO();
  1771. var inner = makeInner();
  1772. function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {
  1773. var axis = axisModel.axis;
  1774. if (axis.scale.isBlank()) {
  1775. return;
  1776. }
  1777. var splitAreaModel = axisModel.getModel("splitArea");
  1778. var areaStyleModel = splitAreaModel.getModel("areaStyle");
  1779. var areaColors = areaStyleModel.get("color");
  1780. var gridRect = gridModel.coordinateSystem.getRect();
  1781. var ticksCoords = axis.getTicksCoords({
  1782. tickModel: splitAreaModel,
  1783. clamp: true
  1784. });
  1785. if (!ticksCoords.length) {
  1786. return;
  1787. }
  1788. var areaColorsLen = areaColors.length;
  1789. var lastSplitAreaColors = inner(axisView).splitAreaColors;
  1790. var newSplitAreaColors = createHashMap();
  1791. var colorIndex = 0;
  1792. if (lastSplitAreaColors) {
  1793. for (var i = 0; i < ticksCoords.length; i++) {
  1794. var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);
  1795. if (cIndex != null) {
  1796. colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;
  1797. break;
  1798. }
  1799. }
  1800. }
  1801. var prev = axis.toGlobalCoord(ticksCoords[0].coord);
  1802. var areaStyle = areaStyleModel.getAreaStyle();
  1803. areaColors = isArray(areaColors) ? areaColors : [areaColors];
  1804. for (var i = 1; i < ticksCoords.length; i++) {
  1805. var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);
  1806. var x = void 0;
  1807. var y = void 0;
  1808. var width = void 0;
  1809. var height = void 0;
  1810. if (axis.isHorizontal()) {
  1811. x = prev;
  1812. y = gridRect.y;
  1813. width = tickCoord - x;
  1814. height = gridRect.height;
  1815. prev = x + width;
  1816. } else {
  1817. x = gridRect.x;
  1818. y = prev;
  1819. width = gridRect.width;
  1820. height = tickCoord - y;
  1821. prev = y + height;
  1822. }
  1823. var tickValue = ticksCoords[i - 1].tickValue;
  1824. tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);
  1825. axisGroup.add(new Rect_default({
  1826. anid: tickValue != null ? "area_" + tickValue : null,
  1827. shape: {
  1828. x,
  1829. y,
  1830. width,
  1831. height
  1832. },
  1833. style: defaults({
  1834. fill: areaColors[colorIndex]
  1835. }, areaStyle),
  1836. autoBatch: true,
  1837. silent: true
  1838. }));
  1839. colorIndex = (colorIndex + 1) % areaColorsLen;
  1840. }
  1841. inner(axisView).splitAreaColors = newSplitAreaColors;
  1842. }
  1843. function rectCoordAxisHandleRemove(axisView) {
  1844. inner(axisView).splitAreaColors = null;
  1845. }
  1846. // node_modules/echarts/lib/component/axis/CartesianAxisView.js
  1847. var axisBuilderAttrs = ["axisLine", "axisTickLabel", "axisName"];
  1848. var selfBuilderAttrs = ["splitArea", "splitLine", "minorSplitLine"];
  1849. var CartesianAxisView = function(_super) {
  1850. __extends(CartesianAxisView2, _super);
  1851. function CartesianAxisView2() {
  1852. var _this = _super !== null && _super.apply(this, arguments) || this;
  1853. _this.type = CartesianAxisView2.type;
  1854. _this.axisPointerClass = "CartesianAxisPointer";
  1855. return _this;
  1856. }
  1857. CartesianAxisView2.prototype.render = function(axisModel, ecModel, api, payload) {
  1858. this.group.removeAll();
  1859. var oldAxisGroup = this._axisGroup;
  1860. this._axisGroup = new Group_default();
  1861. this.group.add(this._axisGroup);
  1862. if (!axisModel.get("show")) {
  1863. return;
  1864. }
  1865. var gridModel = axisModel.getCoordSysModel();
  1866. var layout2 = layout(gridModel, axisModel);
  1867. var axisBuilder = new AxisBuilder_default(axisModel, extend({
  1868. handleAutoShown: function(elementType) {
  1869. var cartesians = gridModel.coordinateSystem.getCartesians();
  1870. for (var i = 0; i < cartesians.length; i++) {
  1871. if (isIntervalOrLogScale(cartesians[i].getOtherAxis(axisModel.axis).scale)) {
  1872. return true;
  1873. }
  1874. }
  1875. return false;
  1876. }
  1877. }, layout2));
  1878. each(axisBuilderAttrs, axisBuilder.add, axisBuilder);
  1879. this._axisGroup.add(axisBuilder.getGroup());
  1880. each(selfBuilderAttrs, function(name) {
  1881. if (axisModel.get([name, "show"])) {
  1882. axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);
  1883. }
  1884. }, this);
  1885. var isInitialSortFromBarRacing = payload && payload.type === "changeAxisOrder" && payload.isInitSort;
  1886. if (!isInitialSortFromBarRacing) {
  1887. groupTransition(oldAxisGroup, this._axisGroup, axisModel);
  1888. }
  1889. _super.prototype.render.call(this, axisModel, ecModel, api, payload);
  1890. };
  1891. CartesianAxisView2.prototype.remove = function() {
  1892. rectCoordAxisHandleRemove(this);
  1893. };
  1894. CartesianAxisView2.type = "cartesianAxis";
  1895. return CartesianAxisView2;
  1896. }(AxisView_default);
  1897. var axisElementBuilders = {
  1898. splitLine: function(axisView, axisGroup, axisModel, gridModel) {
  1899. var axis = axisModel.axis;
  1900. if (axis.scale.isBlank()) {
  1901. return;
  1902. }
  1903. var splitLineModel = axisModel.getModel("splitLine");
  1904. var lineStyleModel = splitLineModel.getModel("lineStyle");
  1905. var lineColors = lineStyleModel.get("color");
  1906. lineColors = isArray(lineColors) ? lineColors : [lineColors];
  1907. var gridRect = gridModel.coordinateSystem.getRect();
  1908. var isHorizontal = axis.isHorizontal();
  1909. var lineCount = 0;
  1910. var ticksCoords = axis.getTicksCoords({
  1911. tickModel: splitLineModel
  1912. });
  1913. var p1 = [];
  1914. var p2 = [];
  1915. var lineStyle = lineStyleModel.getLineStyle();
  1916. for (var i = 0; i < ticksCoords.length; i++) {
  1917. var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);
  1918. if (isHorizontal) {
  1919. p1[0] = tickCoord;
  1920. p1[1] = gridRect.y;
  1921. p2[0] = tickCoord;
  1922. p2[1] = gridRect.y + gridRect.height;
  1923. } else {
  1924. p1[0] = gridRect.x;
  1925. p1[1] = tickCoord;
  1926. p2[0] = gridRect.x + gridRect.width;
  1927. p2[1] = tickCoord;
  1928. }
  1929. var colorIndex = lineCount++ % lineColors.length;
  1930. var tickValue = ticksCoords[i].tickValue;
  1931. axisGroup.add(new Line_default({
  1932. anid: tickValue != null ? "line_" + ticksCoords[i].tickValue : null,
  1933. subPixelOptimize: true,
  1934. autoBatch: true,
  1935. shape: {
  1936. x1: p1[0],
  1937. y1: p1[1],
  1938. x2: p2[0],
  1939. y2: p2[1]
  1940. },
  1941. style: defaults({
  1942. stroke: lineColors[colorIndex]
  1943. }, lineStyle),
  1944. silent: true
  1945. }));
  1946. }
  1947. },
  1948. minorSplitLine: function(axisView, axisGroup, axisModel, gridModel) {
  1949. var axis = axisModel.axis;
  1950. var minorSplitLineModel = axisModel.getModel("minorSplitLine");
  1951. var lineStyleModel = minorSplitLineModel.getModel("lineStyle");
  1952. var gridRect = gridModel.coordinateSystem.getRect();
  1953. var isHorizontal = axis.isHorizontal();
  1954. var minorTicksCoords = axis.getMinorTicksCoords();
  1955. if (!minorTicksCoords.length) {
  1956. return;
  1957. }
  1958. var p1 = [];
  1959. var p2 = [];
  1960. var lineStyle = lineStyleModel.getLineStyle();
  1961. for (var i = 0; i < minorTicksCoords.length; i++) {
  1962. for (var k = 0; k < minorTicksCoords[i].length; k++) {
  1963. var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);
  1964. if (isHorizontal) {
  1965. p1[0] = tickCoord;
  1966. p1[1] = gridRect.y;
  1967. p2[0] = tickCoord;
  1968. p2[1] = gridRect.y + gridRect.height;
  1969. } else {
  1970. p1[0] = gridRect.x;
  1971. p1[1] = tickCoord;
  1972. p2[0] = gridRect.x + gridRect.width;
  1973. p2[1] = tickCoord;
  1974. }
  1975. axisGroup.add(new Line_default({
  1976. anid: "minor_line_" + minorTicksCoords[i][k].tickValue,
  1977. subPixelOptimize: true,
  1978. autoBatch: true,
  1979. shape: {
  1980. x1: p1[0],
  1981. y1: p1[1],
  1982. x2: p2[0],
  1983. y2: p2[1]
  1984. },
  1985. style: lineStyle,
  1986. silent: true
  1987. }));
  1988. }
  1989. }
  1990. },
  1991. splitArea: function(axisView, axisGroup, axisModel, gridModel) {
  1992. rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);
  1993. }
  1994. };
  1995. var CartesianXAxisView = function(_super) {
  1996. __extends(CartesianXAxisView2, _super);
  1997. function CartesianXAxisView2() {
  1998. var _this = _super !== null && _super.apply(this, arguments) || this;
  1999. _this.type = CartesianXAxisView2.type;
  2000. return _this;
  2001. }
  2002. CartesianXAxisView2.type = "xAxis";
  2003. return CartesianXAxisView2;
  2004. }(CartesianAxisView);
  2005. var CartesianYAxisView = function(_super) {
  2006. __extends(CartesianYAxisView2, _super);
  2007. function CartesianYAxisView2() {
  2008. var _this = _super !== null && _super.apply(this, arguments) || this;
  2009. _this.type = CartesianXAxisView.type;
  2010. return _this;
  2011. }
  2012. CartesianYAxisView2.type = "yAxis";
  2013. return CartesianYAxisView2;
  2014. }(CartesianAxisView);
  2015. // node_modules/echarts/lib/component/grid/installSimple.js
  2016. var GridView = function(_super) {
  2017. __extends(GridView2, _super);
  2018. function GridView2() {
  2019. var _this = _super !== null && _super.apply(this, arguments) || this;
  2020. _this.type = "grid";
  2021. return _this;
  2022. }
  2023. GridView2.prototype.render = function(gridModel, ecModel) {
  2024. this.group.removeAll();
  2025. if (gridModel.get("show")) {
  2026. this.group.add(new Rect_default({
  2027. shape: gridModel.coordinateSystem.getRect(),
  2028. style: defaults({
  2029. fill: gridModel.get("backgroundColor")
  2030. }, gridModel.getItemStyle()),
  2031. silent: true,
  2032. z2: -1
  2033. }));
  2034. }
  2035. };
  2036. GridView2.type = "grid";
  2037. return GridView2;
  2038. }(Component_default2);
  2039. var extraOption = {
  2040. offset: 0
  2041. };
  2042. function install(registers) {
  2043. registers.registerComponentView(GridView);
  2044. registers.registerComponentModel(GridModel_default);
  2045. registers.registerCoordinateSystem("cartesian2d", Grid_default);
  2046. axisModelCreator(registers, "x", CartesianAxisModel, extraOption);
  2047. axisModelCreator(registers, "y", CartesianAxisModel, extraOption);
  2048. registers.registerComponentView(CartesianXAxisView);
  2049. registers.registerComponentView(CartesianYAxisView);
  2050. registers.registerPreprocessor(function(option) {
  2051. if (option.xAxis && option.yAxis && !option.grid) {
  2052. option.grid = {};
  2053. }
  2054. });
  2055. }
  2056. // node_modules/echarts/lib/component/radar/install.js
  2057. init_define_APP_INFO();
  2058. // node_modules/echarts/lib/coord/radar/RadarModel.js
  2059. init_define_APP_INFO();
  2060. var valueAxisDefault = axisDefault_default.value;
  2061. function defaultsShow(opt, show) {
  2062. return defaults({
  2063. show
  2064. }, opt);
  2065. }
  2066. var RadarModel = function(_super) {
  2067. __extends(RadarModel2, _super);
  2068. function RadarModel2() {
  2069. var _this = _super !== null && _super.apply(this, arguments) || this;
  2070. _this.type = RadarModel2.type;
  2071. return _this;
  2072. }
  2073. RadarModel2.prototype.optionUpdated = function() {
  2074. var boundaryGap = this.get("boundaryGap");
  2075. var splitNumber = this.get("splitNumber");
  2076. var scale2 = this.get("scale");
  2077. var axisLine = this.get("axisLine");
  2078. var axisTick = this.get("axisTick");
  2079. var axisLabel = this.get("axisLabel");
  2080. var nameTextStyle = this.get("axisName");
  2081. var showName = this.get(["axisName", "show"]);
  2082. var nameFormatter = this.get(["axisName", "formatter"]);
  2083. var nameGap = this.get("axisNameGap");
  2084. var triggerEvent = this.get("triggerEvent");
  2085. var indicatorModels = map(this.get("indicator") || [], function(indicatorOpt) {
  2086. if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) {
  2087. indicatorOpt.min = 0;
  2088. } else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) {
  2089. indicatorOpt.max = 0;
  2090. }
  2091. var iNameTextStyle = nameTextStyle;
  2092. if (indicatorOpt.color != null) {
  2093. iNameTextStyle = defaults({
  2094. color: indicatorOpt.color
  2095. }, nameTextStyle);
  2096. }
  2097. var innerIndicatorOpt = merge(clone(indicatorOpt), {
  2098. boundaryGap,
  2099. splitNumber,
  2100. scale: scale2,
  2101. axisLine,
  2102. axisTick,
  2103. axisLabel,
  2104. name: indicatorOpt.text,
  2105. showName,
  2106. nameLocation: "end",
  2107. nameGap,
  2108. nameTextStyle: iNameTextStyle,
  2109. triggerEvent
  2110. }, false);
  2111. if (isString(nameFormatter)) {
  2112. var indName = innerIndicatorOpt.name;
  2113. innerIndicatorOpt.name = nameFormatter.replace("{value}", indName != null ? indName : "");
  2114. } else if (isFunction(nameFormatter)) {
  2115. innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt);
  2116. }
  2117. var model = new Model_default(innerIndicatorOpt, null, this.ecModel);
  2118. mixin(model, AxisModelCommonMixin.prototype);
  2119. model.mainType = "radar";
  2120. model.componentIndex = this.componentIndex;
  2121. return model;
  2122. }, this);
  2123. this._indicatorModels = indicatorModels;
  2124. };
  2125. RadarModel2.prototype.getIndicatorModels = function() {
  2126. return this._indicatorModels;
  2127. };
  2128. RadarModel2.type = "radar";
  2129. RadarModel2.defaultOption = {
  2130. z: 0,
  2131. center: ["50%", "50%"],
  2132. radius: "75%",
  2133. startAngle: 90,
  2134. axisName: {
  2135. show: true
  2136. },
  2137. boundaryGap: [0, 0],
  2138. splitNumber: 5,
  2139. axisNameGap: 15,
  2140. scale: false,
  2141. shape: "polygon",
  2142. axisLine: merge({
  2143. lineStyle: {
  2144. color: "#bbb"
  2145. }
  2146. }, valueAxisDefault.axisLine),
  2147. axisLabel: defaultsShow(valueAxisDefault.axisLabel, false),
  2148. axisTick: defaultsShow(valueAxisDefault.axisTick, false),
  2149. splitLine: defaultsShow(valueAxisDefault.splitLine, true),
  2150. splitArea: defaultsShow(valueAxisDefault.splitArea, true),
  2151. indicator: []
  2152. };
  2153. return RadarModel2;
  2154. }(Component_default);
  2155. var RadarModel_default = RadarModel;
  2156. // node_modules/echarts/lib/component/radar/RadarView.js
  2157. init_define_APP_INFO();
  2158. var axisBuilderAttrs2 = ["axisLine", "axisTickLabel", "axisName"];
  2159. var RadarView = function(_super) {
  2160. __extends(RadarView2, _super);
  2161. function RadarView2() {
  2162. var _this = _super !== null && _super.apply(this, arguments) || this;
  2163. _this.type = RadarView2.type;
  2164. return _this;
  2165. }
  2166. RadarView2.prototype.render = function(radarModel, ecModel, api) {
  2167. var group = this.group;
  2168. group.removeAll();
  2169. this._buildAxes(radarModel);
  2170. this._buildSplitLineAndArea(radarModel);
  2171. };
  2172. RadarView2.prototype._buildAxes = function(radarModel) {
  2173. var radar = radarModel.coordinateSystem;
  2174. var indicatorAxes = radar.getIndicatorAxes();
  2175. var axisBuilders = map(indicatorAxes, function(indicatorAxis) {
  2176. var axisName = indicatorAxis.model.get("showName") ? indicatorAxis.name : "";
  2177. var axisBuilder = new AxisBuilder_default(indicatorAxis.model, {
  2178. axisName,
  2179. position: [radar.cx, radar.cy],
  2180. rotation: indicatorAxis.angle,
  2181. labelDirection: -1,
  2182. tickDirection: -1,
  2183. nameDirection: 1
  2184. });
  2185. return axisBuilder;
  2186. });
  2187. each(axisBuilders, function(axisBuilder) {
  2188. each(axisBuilderAttrs2, axisBuilder.add, axisBuilder);
  2189. this.group.add(axisBuilder.getGroup());
  2190. }, this);
  2191. };
  2192. RadarView2.prototype._buildSplitLineAndArea = function(radarModel) {
  2193. var radar = radarModel.coordinateSystem;
  2194. var indicatorAxes = radar.getIndicatorAxes();
  2195. if (!indicatorAxes.length) {
  2196. return;
  2197. }
  2198. var shape = radarModel.get("shape");
  2199. var splitLineModel = radarModel.getModel("splitLine");
  2200. var splitAreaModel = radarModel.getModel("splitArea");
  2201. var lineStyleModel = splitLineModel.getModel("lineStyle");
  2202. var areaStyleModel = splitAreaModel.getModel("areaStyle");
  2203. var showSplitLine = splitLineModel.get("show");
  2204. var showSplitArea = splitAreaModel.get("show");
  2205. var splitLineColors = lineStyleModel.get("color");
  2206. var splitAreaColors = areaStyleModel.get("color");
  2207. var splitLineColorsArr = isArray(splitLineColors) ? splitLineColors : [splitLineColors];
  2208. var splitAreaColorsArr = isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors];
  2209. var splitLines = [];
  2210. var splitAreas = [];
  2211. function getColorIndex(areaOrLine, areaOrLineColorList, idx) {
  2212. var colorIndex2 = idx % areaOrLineColorList.length;
  2213. areaOrLine[colorIndex2] = areaOrLine[colorIndex2] || [];
  2214. return colorIndex2;
  2215. }
  2216. if (shape === "circle") {
  2217. var ticksRadius = indicatorAxes[0].getTicksCoords();
  2218. var cx = radar.cx;
  2219. var cy = radar.cy;
  2220. for (var i = 0; i < ticksRadius.length; i++) {
  2221. if (showSplitLine) {
  2222. var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);
  2223. splitLines[colorIndex].push(new Circle_default({
  2224. shape: {
  2225. cx,
  2226. cy,
  2227. r: ticksRadius[i].coord
  2228. }
  2229. }));
  2230. }
  2231. if (showSplitArea && i < ticksRadius.length - 1) {
  2232. var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i);
  2233. splitAreas[colorIndex].push(new Ring_default({
  2234. shape: {
  2235. cx,
  2236. cy,
  2237. r0: ticksRadius[i].coord,
  2238. r: ticksRadius[i + 1].coord
  2239. }
  2240. }));
  2241. }
  2242. }
  2243. } else {
  2244. var realSplitNumber_1;
  2245. var axesTicksPoints = map(indicatorAxes, function(indicatorAxis, idx) {
  2246. var ticksCoords = indicatorAxis.getTicksCoords();
  2247. realSplitNumber_1 = realSplitNumber_1 == null ? ticksCoords.length - 1 : Math.min(ticksCoords.length - 1, realSplitNumber_1);
  2248. return map(ticksCoords, function(tickCoord) {
  2249. return radar.coordToPoint(tickCoord.coord, idx);
  2250. });
  2251. });
  2252. var prevPoints = [];
  2253. for (var i = 0; i <= realSplitNumber_1; i++) {
  2254. var points3 = [];
  2255. for (var j = 0; j < indicatorAxes.length; j++) {
  2256. points3.push(axesTicksPoints[j][i]);
  2257. }
  2258. if (points3[0]) {
  2259. points3.push(points3[0].slice());
  2260. } else {
  2261. if (true) {
  2262. console.error("Can't draw value axis " + i);
  2263. }
  2264. }
  2265. if (showSplitLine) {
  2266. var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);
  2267. splitLines[colorIndex].push(new Polyline_default({
  2268. shape: {
  2269. points: points3
  2270. }
  2271. }));
  2272. }
  2273. if (showSplitArea && prevPoints) {
  2274. var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i - 1);
  2275. splitAreas[colorIndex].push(new Polygon_default({
  2276. shape: {
  2277. points: points3.concat(prevPoints)
  2278. }
  2279. }));
  2280. }
  2281. prevPoints = points3.slice().reverse();
  2282. }
  2283. }
  2284. var lineStyle = lineStyleModel.getLineStyle();
  2285. var areaStyle = areaStyleModel.getAreaStyle();
  2286. each(splitAreas, function(splitAreas2, idx) {
  2287. this.group.add(mergePath(splitAreas2, {
  2288. style: defaults({
  2289. stroke: "none",
  2290. fill: splitAreaColorsArr[idx % splitAreaColorsArr.length]
  2291. }, areaStyle),
  2292. silent: true
  2293. }));
  2294. }, this);
  2295. each(splitLines, function(splitLines2, idx) {
  2296. this.group.add(mergePath(splitLines2, {
  2297. style: defaults({
  2298. fill: "none",
  2299. stroke: splitLineColorsArr[idx % splitLineColorsArr.length]
  2300. }, lineStyle),
  2301. silent: true
  2302. }));
  2303. }, this);
  2304. };
  2305. RadarView2.type = "radar";
  2306. return RadarView2;
  2307. }(Component_default2);
  2308. var RadarView_default = RadarView;
  2309. // node_modules/echarts/lib/coord/radar/Radar.js
  2310. init_define_APP_INFO();
  2311. // node_modules/echarts/lib/coord/radar/IndicatorAxis.js
  2312. init_define_APP_INFO();
  2313. var IndicatorAxis = function(_super) {
  2314. __extends(IndicatorAxis2, _super);
  2315. function IndicatorAxis2(dim, scale2, radiusExtent) {
  2316. var _this = _super.call(this, dim, scale2, radiusExtent) || this;
  2317. _this.type = "value";
  2318. _this.angle = 0;
  2319. _this.name = "";
  2320. return _this;
  2321. }
  2322. return IndicatorAxis2;
  2323. }(Axis_default);
  2324. var IndicatorAxis_default = IndicatorAxis;
  2325. // node_modules/echarts/lib/coord/radar/Radar.js
  2326. var Radar = function() {
  2327. function Radar2(radarModel, ecModel, api) {
  2328. this.dimensions = [];
  2329. this._model = radarModel;
  2330. this._indicatorAxes = map(radarModel.getIndicatorModels(), function(indicatorModel, idx) {
  2331. var dim = "indicator_" + idx;
  2332. var indicatorAxis = new IndicatorAxis_default(
  2333. dim,
  2334. new Interval_default()
  2335. );
  2336. indicatorAxis.name = indicatorModel.get("name");
  2337. indicatorAxis.model = indicatorModel;
  2338. indicatorModel.axis = indicatorAxis;
  2339. this.dimensions.push(dim);
  2340. return indicatorAxis;
  2341. }, this);
  2342. this.resize(radarModel, api);
  2343. }
  2344. Radar2.prototype.getIndicatorAxes = function() {
  2345. return this._indicatorAxes;
  2346. };
  2347. Radar2.prototype.dataToPoint = function(value, indicatorIndex) {
  2348. var indicatorAxis = this._indicatorAxes[indicatorIndex];
  2349. return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex);
  2350. };
  2351. Radar2.prototype.coordToPoint = function(coord, indicatorIndex) {
  2352. var indicatorAxis = this._indicatorAxes[indicatorIndex];
  2353. var angle = indicatorAxis.angle;
  2354. var x = this.cx + coord * Math.cos(angle);
  2355. var y = this.cy - coord * Math.sin(angle);
  2356. return [x, y];
  2357. };
  2358. Radar2.prototype.pointToData = function(pt) {
  2359. var dx = pt[0] - this.cx;
  2360. var dy = pt[1] - this.cy;
  2361. var radius = Math.sqrt(dx * dx + dy * dy);
  2362. dx /= radius;
  2363. dy /= radius;
  2364. var radian = Math.atan2(-dy, dx);
  2365. var minRadianDiff = Infinity;
  2366. var closestAxis;
  2367. var closestAxisIdx = -1;
  2368. for (var i = 0; i < this._indicatorAxes.length; i++) {
  2369. var indicatorAxis = this._indicatorAxes[i];
  2370. var diff = Math.abs(radian - indicatorAxis.angle);
  2371. if (diff < minRadianDiff) {
  2372. closestAxis = indicatorAxis;
  2373. closestAxisIdx = i;
  2374. minRadianDiff = diff;
  2375. }
  2376. }
  2377. return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))];
  2378. };
  2379. Radar2.prototype.resize = function(radarModel, api) {
  2380. var center = radarModel.get("center");
  2381. var viewWidth = api.getWidth();
  2382. var viewHeight = api.getHeight();
  2383. var viewSize = Math.min(viewWidth, viewHeight) / 2;
  2384. this.cx = parsePercent(center[0], viewWidth);
  2385. this.cy = parsePercent(center[1], viewHeight);
  2386. this.startAngle = radarModel.get("startAngle") * Math.PI / 180;
  2387. var radius = radarModel.get("radius");
  2388. if (isString(radius) || isNumber(radius)) {
  2389. radius = [0, radius];
  2390. }
  2391. this.r0 = parsePercent(radius[0], viewSize);
  2392. this.r = parsePercent(radius[1], viewSize);
  2393. each(this._indicatorAxes, function(indicatorAxis, idx) {
  2394. indicatorAxis.setExtent(this.r0, this.r);
  2395. var angle = this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length;
  2396. angle = Math.atan2(Math.sin(angle), Math.cos(angle));
  2397. indicatorAxis.angle = angle;
  2398. }, this);
  2399. };
  2400. Radar2.prototype.update = function(ecModel, api) {
  2401. var indicatorAxes = this._indicatorAxes;
  2402. var radarModel = this._model;
  2403. each(indicatorAxes, function(indicatorAxis) {
  2404. indicatorAxis.scale.setExtent(Infinity, -Infinity);
  2405. });
  2406. ecModel.eachSeriesByType("radar", function(radarSeries, idx) {
  2407. if (radarSeries.get("coordinateSystem") !== "radar" || ecModel.getComponent("radar", radarSeries.get("radarIndex")) !== radarModel) {
  2408. return;
  2409. }
  2410. var data = radarSeries.getData();
  2411. each(indicatorAxes, function(indicatorAxis) {
  2412. indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim));
  2413. });
  2414. }, this);
  2415. var splitNumber = radarModel.get("splitNumber");
  2416. var dummyScale = new Interval_default();
  2417. dummyScale.setExtent(0, splitNumber);
  2418. dummyScale.setInterval(1);
  2419. each(indicatorAxes, function(indicatorAxis, idx) {
  2420. alignScaleTicks(indicatorAxis.scale, indicatorAxis.model, dummyScale);
  2421. });
  2422. };
  2423. Radar2.prototype.convertToPixel = function(ecModel, finder, value) {
  2424. console.warn("Not implemented.");
  2425. return null;
  2426. };
  2427. Radar2.prototype.convertFromPixel = function(ecModel, finder, pixel) {
  2428. console.warn("Not implemented.");
  2429. return null;
  2430. };
  2431. Radar2.prototype.containPoint = function(point) {
  2432. console.warn("Not implemented.");
  2433. return false;
  2434. };
  2435. Radar2.create = function(ecModel, api) {
  2436. var radarList = [];
  2437. ecModel.eachComponent("radar", function(radarModel) {
  2438. var radar = new Radar2(radarModel, ecModel, api);
  2439. radarList.push(radar);
  2440. radarModel.coordinateSystem = radar;
  2441. });
  2442. ecModel.eachSeriesByType("radar", function(radarSeries) {
  2443. if (radarSeries.get("coordinateSystem") === "radar") {
  2444. radarSeries.coordinateSystem = radarList[radarSeries.get("radarIndex") || 0];
  2445. }
  2446. });
  2447. return radarList;
  2448. };
  2449. Radar2.dimensions = [];
  2450. return Radar2;
  2451. }();
  2452. var Radar_default = Radar;
  2453. // node_modules/echarts/lib/component/radar/install.js
  2454. function install2(registers) {
  2455. registers.registerCoordinateSystem("radar", Radar_default);
  2456. registers.registerComponentModel(RadarModel_default);
  2457. registers.registerComponentView(RadarView_default);
  2458. registers.registerVisual({
  2459. seriesType: "radar",
  2460. reset: function(seriesModel) {
  2461. var data = seriesModel.getData();
  2462. data.each(function(idx) {
  2463. data.setItemVisual(idx, "legendIcon", "roundRect");
  2464. });
  2465. data.setVisual("legendIcon", "roundRect");
  2466. }
  2467. });
  2468. }
  2469. // node_modules/echarts/lib/component/geo/install.js
  2470. init_define_APP_INFO();
  2471. // node_modules/echarts/lib/coord/geo/GeoModel.js
  2472. init_define_APP_INFO();
  2473. // node_modules/echarts/lib/coord/geo/geoCreator.js
  2474. init_define_APP_INFO();
  2475. // node_modules/echarts/lib/coord/geo/Geo.js
  2476. init_define_APP_INFO();
  2477. // node_modules/echarts/lib/coord/View.js
  2478. init_define_APP_INFO();
  2479. var v2ApplyTransform = applyTransform;
  2480. var View = function(_super) {
  2481. __extends(View2, _super);
  2482. function View2(name) {
  2483. var _this = _super.call(this) || this;
  2484. _this.type = "view";
  2485. _this.dimensions = ["x", "y"];
  2486. _this._roamTransformable = new Transformable_default();
  2487. _this._rawTransformable = new Transformable_default();
  2488. _this.name = name;
  2489. return _this;
  2490. }
  2491. View2.prototype.setBoundingRect = function(x, y, width, height) {
  2492. this._rect = new BoundingRect_default(x, y, width, height);
  2493. return this._rect;
  2494. };
  2495. View2.prototype.getBoundingRect = function() {
  2496. return this._rect;
  2497. };
  2498. View2.prototype.setViewRect = function(x, y, width, height) {
  2499. this._transformTo(x, y, width, height);
  2500. this._viewRect = new BoundingRect_default(x, y, width, height);
  2501. };
  2502. View2.prototype._transformTo = function(x, y, width, height) {
  2503. var rect = this.getBoundingRect();
  2504. var rawTransform = this._rawTransformable;
  2505. rawTransform.transform = rect.calculateTransform(new BoundingRect_default(x, y, width, height));
  2506. var rawParent = rawTransform.parent;
  2507. rawTransform.parent = null;
  2508. rawTransform.decomposeTransform();
  2509. rawTransform.parent = rawParent;
  2510. this._updateTransform();
  2511. };
  2512. View2.prototype.setCenter = function(centerCoord, api) {
  2513. if (!centerCoord) {
  2514. return;
  2515. }
  2516. this._center = [parsePercent(centerCoord[0], api.getWidth()), parsePercent(centerCoord[1], api.getHeight())];
  2517. this._updateCenterAndZoom();
  2518. };
  2519. View2.prototype.setZoom = function(zoom) {
  2520. zoom = zoom || 1;
  2521. var zoomLimit = this.zoomLimit;
  2522. if (zoomLimit) {
  2523. if (zoomLimit.max != null) {
  2524. zoom = Math.min(zoomLimit.max, zoom);
  2525. }
  2526. if (zoomLimit.min != null) {
  2527. zoom = Math.max(zoomLimit.min, zoom);
  2528. }
  2529. }
  2530. this._zoom = zoom;
  2531. this._updateCenterAndZoom();
  2532. };
  2533. View2.prototype.getDefaultCenter = function() {
  2534. var rawRect = this.getBoundingRect();
  2535. var cx = rawRect.x + rawRect.width / 2;
  2536. var cy = rawRect.y + rawRect.height / 2;
  2537. return [cx, cy];
  2538. };
  2539. View2.prototype.getCenter = function() {
  2540. return this._center || this.getDefaultCenter();
  2541. };
  2542. View2.prototype.getZoom = function() {
  2543. return this._zoom || 1;
  2544. };
  2545. View2.prototype.getRoamTransform = function() {
  2546. return this._roamTransformable.getLocalTransform();
  2547. };
  2548. View2.prototype._updateCenterAndZoom = function() {
  2549. var rawTransformMatrix = this._rawTransformable.getLocalTransform();
  2550. var roamTransform = this._roamTransformable;
  2551. var defaultCenter = this.getDefaultCenter();
  2552. var center = this.getCenter();
  2553. var zoom = this.getZoom();
  2554. center = applyTransform([], center, rawTransformMatrix);
  2555. defaultCenter = applyTransform([], defaultCenter, rawTransformMatrix);
  2556. roamTransform.originX = center[0];
  2557. roamTransform.originY = center[1];
  2558. roamTransform.x = defaultCenter[0] - center[0];
  2559. roamTransform.y = defaultCenter[1] - center[1];
  2560. roamTransform.scaleX = roamTransform.scaleY = zoom;
  2561. this._updateTransform();
  2562. };
  2563. View2.prototype._updateTransform = function() {
  2564. var roamTransformable = this._roamTransformable;
  2565. var rawTransformable = this._rawTransformable;
  2566. rawTransformable.parent = roamTransformable;
  2567. roamTransformable.updateTransform();
  2568. rawTransformable.updateTransform();
  2569. copy(this.transform || (this.transform = []), rawTransformable.transform || create());
  2570. this._rawTransform = rawTransformable.getLocalTransform();
  2571. this.invTransform = this.invTransform || [];
  2572. invert(this.invTransform, this.transform);
  2573. this.decomposeTransform();
  2574. };
  2575. View2.prototype.getTransformInfo = function() {
  2576. var rawTransformable = this._rawTransformable;
  2577. var roamTransformable = this._roamTransformable;
  2578. var dummyTransformable = new Transformable_default();
  2579. dummyTransformable.transform = roamTransformable.transform;
  2580. dummyTransformable.decomposeTransform();
  2581. return {
  2582. roam: {
  2583. x: dummyTransformable.x,
  2584. y: dummyTransformable.y,
  2585. scaleX: dummyTransformable.scaleX,
  2586. scaleY: dummyTransformable.scaleY
  2587. },
  2588. raw: {
  2589. x: rawTransformable.x,
  2590. y: rawTransformable.y,
  2591. scaleX: rawTransformable.scaleX,
  2592. scaleY: rawTransformable.scaleY
  2593. }
  2594. };
  2595. };
  2596. View2.prototype.getViewRect = function() {
  2597. return this._viewRect;
  2598. };
  2599. View2.prototype.getViewRectAfterRoam = function() {
  2600. var rect = this.getBoundingRect().clone();
  2601. rect.applyTransform(this.transform);
  2602. return rect;
  2603. };
  2604. View2.prototype.dataToPoint = function(data, noRoam, out) {
  2605. var transform = noRoam ? this._rawTransform : this.transform;
  2606. out = out || [];
  2607. return transform ? v2ApplyTransform(out, data, transform) : copy2(out, data);
  2608. };
  2609. View2.prototype.pointToData = function(point) {
  2610. var invTransform = this.invTransform;
  2611. return invTransform ? v2ApplyTransform([], point, invTransform) : [point[0], point[1]];
  2612. };
  2613. View2.prototype.convertToPixel = function(ecModel, finder, value) {
  2614. var coordSys = getCoordSys(finder);
  2615. return coordSys === this ? coordSys.dataToPoint(value) : null;
  2616. };
  2617. View2.prototype.convertFromPixel = function(ecModel, finder, pixel) {
  2618. var coordSys = getCoordSys(finder);
  2619. return coordSys === this ? coordSys.pointToData(pixel) : null;
  2620. };
  2621. View2.prototype.containPoint = function(point) {
  2622. return this.getViewRectAfterRoam().contain(point[0], point[1]);
  2623. };
  2624. View2.dimensions = ["x", "y"];
  2625. return View2;
  2626. }(Transformable_default);
  2627. function getCoordSys(finder) {
  2628. var seriesModel = finder.seriesModel;
  2629. return seriesModel ? seriesModel.coordinateSystem : null;
  2630. }
  2631. var View_default = View;
  2632. // node_modules/echarts/lib/coord/geo/geoSourceManager.js
  2633. init_define_APP_INFO();
  2634. // node_modules/echarts/lib/coord/geo/GeoSVGResource.js
  2635. init_define_APP_INFO();
  2636. // node_modules/zrender/lib/tool/parseSVG.js
  2637. init_define_APP_INFO();
  2638. // node_modules/zrender/lib/tool/parseXML.js
  2639. init_define_APP_INFO();
  2640. function parseXML(svg) {
  2641. if (isString(svg)) {
  2642. var parser = new DOMParser();
  2643. svg = parser.parseFromString(svg, "text/xml");
  2644. }
  2645. var svgNode = svg;
  2646. if (svgNode.nodeType === 9) {
  2647. svgNode = svgNode.firstChild;
  2648. }
  2649. while (svgNode.nodeName.toLowerCase() !== "svg" || svgNode.nodeType !== 1) {
  2650. svgNode = svgNode.nextSibling;
  2651. }
  2652. return svgNode;
  2653. }
  2654. // node_modules/zrender/lib/tool/parseSVG.js
  2655. var nodeParsers;
  2656. var INHERITABLE_STYLE_ATTRIBUTES_MAP = {
  2657. "fill": "fill",
  2658. "stroke": "stroke",
  2659. "stroke-width": "lineWidth",
  2660. "opacity": "opacity",
  2661. "fill-opacity": "fillOpacity",
  2662. "stroke-opacity": "strokeOpacity",
  2663. "stroke-dasharray": "lineDash",
  2664. "stroke-dashoffset": "lineDashOffset",
  2665. "stroke-linecap": "lineCap",
  2666. "stroke-linejoin": "lineJoin",
  2667. "stroke-miterlimit": "miterLimit",
  2668. "font-family": "fontFamily",
  2669. "font-size": "fontSize",
  2670. "font-style": "fontStyle",
  2671. "font-weight": "fontWeight",
  2672. "text-anchor": "textAlign",
  2673. "visibility": "visibility",
  2674. "display": "display"
  2675. };
  2676. var INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS = keys(INHERITABLE_STYLE_ATTRIBUTES_MAP);
  2677. var SELF_STYLE_ATTRIBUTES_MAP = {
  2678. "alignment-baseline": "textBaseline",
  2679. "stop-color": "stopColor"
  2680. };
  2681. var SELF_STYLE_ATTRIBUTES_MAP_KEYS = keys(SELF_STYLE_ATTRIBUTES_MAP);
  2682. var SVGParser = function() {
  2683. function SVGParser2() {
  2684. this._defs = {};
  2685. this._root = null;
  2686. }
  2687. SVGParser2.prototype.parse = function(xml, opt) {
  2688. opt = opt || {};
  2689. var svg = parseXML(xml);
  2690. if (true) {
  2691. if (!svg) {
  2692. throw new Error("Illegal svg");
  2693. }
  2694. }
  2695. this._defsUsePending = [];
  2696. var root = new Group_default();
  2697. this._root = root;
  2698. var named = [];
  2699. var viewBox = svg.getAttribute("viewBox") || "";
  2700. var width = parseFloat(svg.getAttribute("width") || opt.width);
  2701. var height = parseFloat(svg.getAttribute("height") || opt.height);
  2702. isNaN(width) && (width = null);
  2703. isNaN(height) && (height = null);
  2704. parseAttributes(svg, root, null, true, false);
  2705. var child = svg.firstChild;
  2706. while (child) {
  2707. this._parseNode(child, root, named, null, false, false);
  2708. child = child.nextSibling;
  2709. }
  2710. applyDefs(this._defs, this._defsUsePending);
  2711. this._defsUsePending = [];
  2712. var viewBoxRect;
  2713. var viewBoxTransform;
  2714. if (viewBox) {
  2715. var viewBoxArr = splitNumberSequence(viewBox);
  2716. if (viewBoxArr.length >= 4) {
  2717. viewBoxRect = {
  2718. x: parseFloat(viewBoxArr[0] || 0),
  2719. y: parseFloat(viewBoxArr[1] || 0),
  2720. width: parseFloat(viewBoxArr[2]),
  2721. height: parseFloat(viewBoxArr[3])
  2722. };
  2723. }
  2724. }
  2725. if (viewBoxRect && width != null && height != null) {
  2726. viewBoxTransform = makeViewBoxTransform(viewBoxRect, { x: 0, y: 0, width, height });
  2727. if (!opt.ignoreViewBox) {
  2728. var elRoot = root;
  2729. root = new Group_default();
  2730. root.add(elRoot);
  2731. elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;
  2732. elRoot.x = viewBoxTransform.x;
  2733. elRoot.y = viewBoxTransform.y;
  2734. }
  2735. }
  2736. if (!opt.ignoreRootClip && width != null && height != null) {
  2737. root.setClipPath(new Rect_default({
  2738. shape: { x: 0, y: 0, width, height }
  2739. }));
  2740. }
  2741. return {
  2742. root,
  2743. width,
  2744. height,
  2745. viewBoxRect,
  2746. viewBoxTransform,
  2747. named
  2748. };
  2749. };
  2750. SVGParser2.prototype._parseNode = function(xmlNode, parentGroup, named, namedFrom, isInDefs, isInText) {
  2751. var nodeName = xmlNode.nodeName.toLowerCase();
  2752. var el;
  2753. var namedFromForSub = namedFrom;
  2754. if (nodeName === "defs") {
  2755. isInDefs = true;
  2756. }
  2757. if (nodeName === "text") {
  2758. isInText = true;
  2759. }
  2760. if (nodeName === "defs" || nodeName === "switch") {
  2761. el = parentGroup;
  2762. } else {
  2763. if (!isInDefs) {
  2764. var parser_1 = nodeParsers[nodeName];
  2765. if (parser_1 && hasOwn(nodeParsers, nodeName)) {
  2766. el = parser_1.call(this, xmlNode, parentGroup);
  2767. var nameAttr = xmlNode.getAttribute("name");
  2768. if (nameAttr) {
  2769. var newNamed = {
  2770. name: nameAttr,
  2771. namedFrom: null,
  2772. svgNodeTagLower: nodeName,
  2773. el
  2774. };
  2775. named.push(newNamed);
  2776. if (nodeName === "g") {
  2777. namedFromForSub = newNamed;
  2778. }
  2779. } else if (namedFrom) {
  2780. named.push({
  2781. name: namedFrom.name,
  2782. namedFrom,
  2783. svgNodeTagLower: nodeName,
  2784. el
  2785. });
  2786. }
  2787. parentGroup.add(el);
  2788. }
  2789. }
  2790. var parser = paintServerParsers[nodeName];
  2791. if (parser && hasOwn(paintServerParsers, nodeName)) {
  2792. var def = parser.call(this, xmlNode);
  2793. var id = xmlNode.getAttribute("id");
  2794. if (id) {
  2795. this._defs[id] = def;
  2796. }
  2797. }
  2798. }
  2799. if (el && el.isGroup) {
  2800. var child = xmlNode.firstChild;
  2801. while (child) {
  2802. if (child.nodeType === 1) {
  2803. this._parseNode(child, el, named, namedFromForSub, isInDefs, isInText);
  2804. } else if (child.nodeType === 3 && isInText) {
  2805. this._parseText(child, el);
  2806. }
  2807. child = child.nextSibling;
  2808. }
  2809. }
  2810. };
  2811. SVGParser2.prototype._parseText = function(xmlNode, parentGroup) {
  2812. var text = new TSpan_default({
  2813. style: {
  2814. text: xmlNode.textContent
  2815. },
  2816. silent: true,
  2817. x: this._textX || 0,
  2818. y: this._textY || 0
  2819. });
  2820. inheritStyle(parentGroup, text);
  2821. parseAttributes(xmlNode, text, this._defsUsePending, false, false);
  2822. applyTextAlignment(text, parentGroup);
  2823. var textStyle = text.style;
  2824. var fontSize = textStyle.fontSize;
  2825. if (fontSize && fontSize < 9) {
  2826. textStyle.fontSize = 9;
  2827. text.scaleX *= fontSize / 9;
  2828. text.scaleY *= fontSize / 9;
  2829. }
  2830. var font = (textStyle.fontSize || textStyle.fontFamily) && [
  2831. textStyle.fontStyle,
  2832. textStyle.fontWeight,
  2833. (textStyle.fontSize || 12) + "px",
  2834. textStyle.fontFamily || "sans-serif"
  2835. ].join(" ");
  2836. textStyle.font = font;
  2837. var rect = text.getBoundingRect();
  2838. this._textX += rect.width;
  2839. parentGroup.add(text);
  2840. return text;
  2841. };
  2842. SVGParser2.internalField = function() {
  2843. nodeParsers = {
  2844. "g": function(xmlNode, parentGroup) {
  2845. var g = new Group_default();
  2846. inheritStyle(parentGroup, g);
  2847. parseAttributes(xmlNode, g, this._defsUsePending, false, false);
  2848. return g;
  2849. },
  2850. "rect": function(xmlNode, parentGroup) {
  2851. var rect = new Rect_default();
  2852. inheritStyle(parentGroup, rect);
  2853. parseAttributes(xmlNode, rect, this._defsUsePending, false, false);
  2854. rect.setShape({
  2855. x: parseFloat(xmlNode.getAttribute("x") || "0"),
  2856. y: parseFloat(xmlNode.getAttribute("y") || "0"),
  2857. width: parseFloat(xmlNode.getAttribute("width") || "0"),
  2858. height: parseFloat(xmlNode.getAttribute("height") || "0")
  2859. });
  2860. rect.silent = true;
  2861. return rect;
  2862. },
  2863. "circle": function(xmlNode, parentGroup) {
  2864. var circle = new Circle_default();
  2865. inheritStyle(parentGroup, circle);
  2866. parseAttributes(xmlNode, circle, this._defsUsePending, false, false);
  2867. circle.setShape({
  2868. cx: parseFloat(xmlNode.getAttribute("cx") || "0"),
  2869. cy: parseFloat(xmlNode.getAttribute("cy") || "0"),
  2870. r: parseFloat(xmlNode.getAttribute("r") || "0")
  2871. });
  2872. circle.silent = true;
  2873. return circle;
  2874. },
  2875. "line": function(xmlNode, parentGroup) {
  2876. var line = new Line_default();
  2877. inheritStyle(parentGroup, line);
  2878. parseAttributes(xmlNode, line, this._defsUsePending, false, false);
  2879. line.setShape({
  2880. x1: parseFloat(xmlNode.getAttribute("x1") || "0"),
  2881. y1: parseFloat(xmlNode.getAttribute("y1") || "0"),
  2882. x2: parseFloat(xmlNode.getAttribute("x2") || "0"),
  2883. y2: parseFloat(xmlNode.getAttribute("y2") || "0")
  2884. });
  2885. line.silent = true;
  2886. return line;
  2887. },
  2888. "ellipse": function(xmlNode, parentGroup) {
  2889. var ellipse = new Ellipse_default();
  2890. inheritStyle(parentGroup, ellipse);
  2891. parseAttributes(xmlNode, ellipse, this._defsUsePending, false, false);
  2892. ellipse.setShape({
  2893. cx: parseFloat(xmlNode.getAttribute("cx") || "0"),
  2894. cy: parseFloat(xmlNode.getAttribute("cy") || "0"),
  2895. rx: parseFloat(xmlNode.getAttribute("rx") || "0"),
  2896. ry: parseFloat(xmlNode.getAttribute("ry") || "0")
  2897. });
  2898. ellipse.silent = true;
  2899. return ellipse;
  2900. },
  2901. "polygon": function(xmlNode, parentGroup) {
  2902. var pointsStr = xmlNode.getAttribute("points");
  2903. var pointsArr;
  2904. if (pointsStr) {
  2905. pointsArr = parsePoints(pointsStr);
  2906. }
  2907. var polygon = new Polygon_default({
  2908. shape: {
  2909. points: pointsArr || []
  2910. },
  2911. silent: true
  2912. });
  2913. inheritStyle(parentGroup, polygon);
  2914. parseAttributes(xmlNode, polygon, this._defsUsePending, false, false);
  2915. return polygon;
  2916. },
  2917. "polyline": function(xmlNode, parentGroup) {
  2918. var pointsStr = xmlNode.getAttribute("points");
  2919. var pointsArr;
  2920. if (pointsStr) {
  2921. pointsArr = parsePoints(pointsStr);
  2922. }
  2923. var polyline = new Polyline_default({
  2924. shape: {
  2925. points: pointsArr || []
  2926. },
  2927. silent: true
  2928. });
  2929. inheritStyle(parentGroup, polyline);
  2930. parseAttributes(xmlNode, polyline, this._defsUsePending, false, false);
  2931. return polyline;
  2932. },
  2933. "image": function(xmlNode, parentGroup) {
  2934. var img = new Image_default();
  2935. inheritStyle(parentGroup, img);
  2936. parseAttributes(xmlNode, img, this._defsUsePending, false, false);
  2937. img.setStyle({
  2938. image: xmlNode.getAttribute("xlink:href") || xmlNode.getAttribute("href"),
  2939. x: +xmlNode.getAttribute("x"),
  2940. y: +xmlNode.getAttribute("y"),
  2941. width: +xmlNode.getAttribute("width"),
  2942. height: +xmlNode.getAttribute("height")
  2943. });
  2944. img.silent = true;
  2945. return img;
  2946. },
  2947. "text": function(xmlNode, parentGroup) {
  2948. var x = xmlNode.getAttribute("x") || "0";
  2949. var y = xmlNode.getAttribute("y") || "0";
  2950. var dx = xmlNode.getAttribute("dx") || "0";
  2951. var dy = xmlNode.getAttribute("dy") || "0";
  2952. this._textX = parseFloat(x) + parseFloat(dx);
  2953. this._textY = parseFloat(y) + parseFloat(dy);
  2954. var g = new Group_default();
  2955. inheritStyle(parentGroup, g);
  2956. parseAttributes(xmlNode, g, this._defsUsePending, false, true);
  2957. return g;
  2958. },
  2959. "tspan": function(xmlNode, parentGroup) {
  2960. var x = xmlNode.getAttribute("x");
  2961. var y = xmlNode.getAttribute("y");
  2962. if (x != null) {
  2963. this._textX = parseFloat(x);
  2964. }
  2965. if (y != null) {
  2966. this._textY = parseFloat(y);
  2967. }
  2968. var dx = xmlNode.getAttribute("dx") || "0";
  2969. var dy = xmlNode.getAttribute("dy") || "0";
  2970. var g = new Group_default();
  2971. inheritStyle(parentGroup, g);
  2972. parseAttributes(xmlNode, g, this._defsUsePending, false, true);
  2973. this._textX += parseFloat(dx);
  2974. this._textY += parseFloat(dy);
  2975. return g;
  2976. },
  2977. "path": function(xmlNode, parentGroup) {
  2978. var d = xmlNode.getAttribute("d") || "";
  2979. var path = createFromString(d);
  2980. inheritStyle(parentGroup, path);
  2981. parseAttributes(xmlNode, path, this._defsUsePending, false, false);
  2982. path.silent = true;
  2983. return path;
  2984. }
  2985. };
  2986. }();
  2987. return SVGParser2;
  2988. }();
  2989. var paintServerParsers = {
  2990. "lineargradient": function(xmlNode) {
  2991. var x1 = parseInt(xmlNode.getAttribute("x1") || "0", 10);
  2992. var y1 = parseInt(xmlNode.getAttribute("y1") || "0", 10);
  2993. var x2 = parseInt(xmlNode.getAttribute("x2") || "10", 10);
  2994. var y2 = parseInt(xmlNode.getAttribute("y2") || "0", 10);
  2995. var gradient = new LinearGradient_default(x1, y1, x2, y2);
  2996. parsePaintServerUnit(xmlNode, gradient);
  2997. parseGradientColorStops(xmlNode, gradient);
  2998. return gradient;
  2999. },
  3000. "radialgradient": function(xmlNode) {
  3001. var cx = parseInt(xmlNode.getAttribute("cx") || "0", 10);
  3002. var cy = parseInt(xmlNode.getAttribute("cy") || "0", 10);
  3003. var r = parseInt(xmlNode.getAttribute("r") || "0", 10);
  3004. var gradient = new RadialGradient_default(cx, cy, r);
  3005. parsePaintServerUnit(xmlNode, gradient);
  3006. parseGradientColorStops(xmlNode, gradient);
  3007. return gradient;
  3008. }
  3009. };
  3010. function parsePaintServerUnit(xmlNode, gradient) {
  3011. var gradientUnits = xmlNode.getAttribute("gradientUnits");
  3012. if (gradientUnits === "userSpaceOnUse") {
  3013. gradient.global = true;
  3014. }
  3015. }
  3016. function parseGradientColorStops(xmlNode, gradient) {
  3017. var stop2 = xmlNode.firstChild;
  3018. while (stop2) {
  3019. if (stop2.nodeType === 1 && stop2.nodeName.toLocaleLowerCase() === "stop") {
  3020. var offsetStr = stop2.getAttribute("offset");
  3021. var offset = void 0;
  3022. if (offsetStr && offsetStr.indexOf("%") > 0) {
  3023. offset = parseInt(offsetStr, 10) / 100;
  3024. } else if (offsetStr) {
  3025. offset = parseFloat(offsetStr);
  3026. } else {
  3027. offset = 0;
  3028. }
  3029. var styleVals = {};
  3030. parseInlineStyle(stop2, styleVals, styleVals);
  3031. var stopColor = styleVals.stopColor || stop2.getAttribute("stop-color") || "#000000";
  3032. gradient.colorStops.push({
  3033. offset,
  3034. color: stopColor
  3035. });
  3036. }
  3037. stop2 = stop2.nextSibling;
  3038. }
  3039. }
  3040. function inheritStyle(parent, child) {
  3041. if (parent && parent.__inheritedStyle) {
  3042. if (!child.__inheritedStyle) {
  3043. child.__inheritedStyle = {};
  3044. }
  3045. defaults(child.__inheritedStyle, parent.__inheritedStyle);
  3046. }
  3047. }
  3048. function parsePoints(pointsString) {
  3049. var list = splitNumberSequence(pointsString);
  3050. var points3 = [];
  3051. for (var i = 0; i < list.length; i += 2) {
  3052. var x = parseFloat(list[i]);
  3053. var y = parseFloat(list[i + 1]);
  3054. points3.push([x, y]);
  3055. }
  3056. return points3;
  3057. }
  3058. function parseAttributes(xmlNode, el, defsUsePending, onlyInlineStyle, isTextGroup) {
  3059. var disp = el;
  3060. var inheritedStyle = disp.__inheritedStyle = disp.__inheritedStyle || {};
  3061. var selfStyle = {};
  3062. if (xmlNode.nodeType === 1) {
  3063. parseTransformAttribute(xmlNode, el);
  3064. parseInlineStyle(xmlNode, inheritedStyle, selfStyle);
  3065. if (!onlyInlineStyle) {
  3066. parseAttributeStyle(xmlNode, inheritedStyle, selfStyle);
  3067. }
  3068. }
  3069. disp.style = disp.style || {};
  3070. if (inheritedStyle.fill != null) {
  3071. disp.style.fill = getFillStrokeStyle(disp, "fill", inheritedStyle.fill, defsUsePending);
  3072. }
  3073. if (inheritedStyle.stroke != null) {
  3074. disp.style.stroke = getFillStrokeStyle(disp, "stroke", inheritedStyle.stroke, defsUsePending);
  3075. }
  3076. each([
  3077. "lineWidth",
  3078. "opacity",
  3079. "fillOpacity",
  3080. "strokeOpacity",
  3081. "miterLimit",
  3082. "fontSize"
  3083. ], function(propName) {
  3084. if (inheritedStyle[propName] != null) {
  3085. disp.style[propName] = parseFloat(inheritedStyle[propName]);
  3086. }
  3087. });
  3088. each([
  3089. "lineDashOffset",
  3090. "lineCap",
  3091. "lineJoin",
  3092. "fontWeight",
  3093. "fontFamily",
  3094. "fontStyle",
  3095. "textAlign"
  3096. ], function(propName) {
  3097. if (inheritedStyle[propName] != null) {
  3098. disp.style[propName] = inheritedStyle[propName];
  3099. }
  3100. });
  3101. if (isTextGroup) {
  3102. disp.__selfStyle = selfStyle;
  3103. }
  3104. if (inheritedStyle.lineDash) {
  3105. disp.style.lineDash = map(splitNumberSequence(inheritedStyle.lineDash), function(str) {
  3106. return parseFloat(str);
  3107. });
  3108. }
  3109. if (inheritedStyle.visibility === "hidden" || inheritedStyle.visibility === "collapse") {
  3110. disp.invisible = true;
  3111. }
  3112. if (inheritedStyle.display === "none") {
  3113. disp.ignore = true;
  3114. }
  3115. }
  3116. function applyTextAlignment(text, parentGroup) {
  3117. var parentSelfStyle = parentGroup.__selfStyle;
  3118. if (parentSelfStyle) {
  3119. var textBaseline = parentSelfStyle.textBaseline;
  3120. var zrTextBaseline = textBaseline;
  3121. if (!textBaseline || textBaseline === "auto") {
  3122. zrTextBaseline = "alphabetic";
  3123. } else if (textBaseline === "baseline") {
  3124. zrTextBaseline = "alphabetic";
  3125. } else if (textBaseline === "before-edge" || textBaseline === "text-before-edge") {
  3126. zrTextBaseline = "top";
  3127. } else if (textBaseline === "after-edge" || textBaseline === "text-after-edge") {
  3128. zrTextBaseline = "bottom";
  3129. } else if (textBaseline === "central" || textBaseline === "mathematical") {
  3130. zrTextBaseline = "middle";
  3131. }
  3132. text.style.textBaseline = zrTextBaseline;
  3133. }
  3134. var parentInheritedStyle = parentGroup.__inheritedStyle;
  3135. if (parentInheritedStyle) {
  3136. var textAlign = parentInheritedStyle.textAlign;
  3137. var zrTextAlign = textAlign;
  3138. if (textAlign) {
  3139. if (textAlign === "middle") {
  3140. zrTextAlign = "center";
  3141. }
  3142. text.style.textAlign = zrTextAlign;
  3143. }
  3144. }
  3145. }
  3146. var urlRegex = /^url\(\s*#(.*?)\)/;
  3147. function getFillStrokeStyle(el, method, str, defsUsePending) {
  3148. var urlMatch = str && str.match(urlRegex);
  3149. if (urlMatch) {
  3150. var url = trim(urlMatch[1]);
  3151. defsUsePending.push([el, method, url]);
  3152. return;
  3153. }
  3154. if (str === "none") {
  3155. str = null;
  3156. }
  3157. return str;
  3158. }
  3159. function applyDefs(defs, defsUsePending) {
  3160. for (var i = 0; i < defsUsePending.length; i++) {
  3161. var item = defsUsePending[i];
  3162. item[0].style[item[1]] = defs[item[2]];
  3163. }
  3164. }
  3165. var numberReg = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;
  3166. function splitNumberSequence(rawStr) {
  3167. return rawStr.match(numberReg) || [];
  3168. }
  3169. var transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g;
  3170. var DEGREE_TO_ANGLE = Math.PI / 180;
  3171. function parseTransformAttribute(xmlNode, node) {
  3172. var transform = xmlNode.getAttribute("transform");
  3173. if (transform) {
  3174. transform = transform.replace(/,/g, " ");
  3175. var transformOps_1 = [];
  3176. var mt = null;
  3177. transform.replace(transformRegex, function(str, type2, value2) {
  3178. transformOps_1.push(type2, value2);
  3179. return "";
  3180. });
  3181. for (var i = transformOps_1.length - 1; i > 0; i -= 2) {
  3182. var value = transformOps_1[i];
  3183. var type = transformOps_1[i - 1];
  3184. var valueArr = splitNumberSequence(value);
  3185. mt = mt || create();
  3186. switch (type) {
  3187. case "translate":
  3188. translate(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || "0")]);
  3189. break;
  3190. case "scale":
  3191. scale(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]);
  3192. break;
  3193. case "rotate":
  3194. rotate(mt, mt, -parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);
  3195. break;
  3196. case "skewX":
  3197. var sx = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);
  3198. mul(mt, [1, 0, sx, 1, 0, 0], mt);
  3199. break;
  3200. case "skewY":
  3201. var sy = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);
  3202. mul(mt, [1, sy, 0, 1, 0, 0], mt);
  3203. break;
  3204. case "matrix":
  3205. mt[0] = parseFloat(valueArr[0]);
  3206. mt[1] = parseFloat(valueArr[1]);
  3207. mt[2] = parseFloat(valueArr[2]);
  3208. mt[3] = parseFloat(valueArr[3]);
  3209. mt[4] = parseFloat(valueArr[4]);
  3210. mt[5] = parseFloat(valueArr[5]);
  3211. break;
  3212. }
  3213. }
  3214. node.setLocalTransform(mt);
  3215. }
  3216. }
  3217. var styleRegex = /([^\s:;]+)\s*:\s*([^:;]+)/g;
  3218. function parseInlineStyle(xmlNode, inheritableStyleResult, selfStyleResult) {
  3219. var style = xmlNode.getAttribute("style");
  3220. if (!style) {
  3221. return;
  3222. }
  3223. styleRegex.lastIndex = 0;
  3224. var styleRegResult;
  3225. while ((styleRegResult = styleRegex.exec(style)) != null) {
  3226. var svgStlAttr = styleRegResult[1];
  3227. var zrInheritableStlAttr = hasOwn(INHERITABLE_STYLE_ATTRIBUTES_MAP, svgStlAttr) ? INHERITABLE_STYLE_ATTRIBUTES_MAP[svgStlAttr] : null;
  3228. if (zrInheritableStlAttr) {
  3229. inheritableStyleResult[zrInheritableStlAttr] = styleRegResult[2];
  3230. }
  3231. var zrSelfStlAttr = hasOwn(SELF_STYLE_ATTRIBUTES_MAP, svgStlAttr) ? SELF_STYLE_ATTRIBUTES_MAP[svgStlAttr] : null;
  3232. if (zrSelfStlAttr) {
  3233. selfStyleResult[zrSelfStlAttr] = styleRegResult[2];
  3234. }
  3235. }
  3236. }
  3237. function parseAttributeStyle(xmlNode, inheritableStyleResult, selfStyleResult) {
  3238. for (var i = 0; i < INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {
  3239. var svgAttrName = INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS[i];
  3240. var attrValue = xmlNode.getAttribute(svgAttrName);
  3241. if (attrValue != null) {
  3242. inheritableStyleResult[INHERITABLE_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;
  3243. }
  3244. }
  3245. for (var i = 0; i < SELF_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {
  3246. var svgAttrName = SELF_STYLE_ATTRIBUTES_MAP_KEYS[i];
  3247. var attrValue = xmlNode.getAttribute(svgAttrName);
  3248. if (attrValue != null) {
  3249. selfStyleResult[SELF_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;
  3250. }
  3251. }
  3252. }
  3253. function makeViewBoxTransform(viewBoxRect, boundingRect) {
  3254. var scaleX = boundingRect.width / viewBoxRect.width;
  3255. var scaleY = boundingRect.height / viewBoxRect.height;
  3256. var scale2 = Math.min(scaleX, scaleY);
  3257. return {
  3258. scale: scale2,
  3259. x: -(viewBoxRect.x + viewBoxRect.width / 2) * scale2 + (boundingRect.x + boundingRect.width / 2),
  3260. y: -(viewBoxRect.y + viewBoxRect.height / 2) * scale2 + (boundingRect.y + boundingRect.height / 2)
  3261. };
  3262. }
  3263. function parseSVG(xml, opt) {
  3264. var parser = new SVGParser();
  3265. return parser.parse(xml, opt);
  3266. }
  3267. // node_modules/echarts/lib/coord/geo/GeoSVGResource.js
  3268. var REGION_AVAILABLE_SVG_TAG_MAP = createHashMap([
  3269. "rect",
  3270. "circle",
  3271. "line",
  3272. "ellipse",
  3273. "polygon",
  3274. "polyline",
  3275. "path",
  3276. "text",
  3277. "tspan",
  3278. "g"
  3279. ]);
  3280. var GeoSVGResource = function() {
  3281. function GeoSVGResource2(mapName, svg) {
  3282. this.type = "geoSVG";
  3283. this._usedGraphicMap = createHashMap();
  3284. this._freedGraphics = [];
  3285. this._mapName = mapName;
  3286. this._parsedXML = parseXML(svg);
  3287. }
  3288. GeoSVGResource2.prototype.load = function() {
  3289. var firstGraphic = this._firstGraphic;
  3290. if (!firstGraphic) {
  3291. firstGraphic = this._firstGraphic = this._buildGraphic(this._parsedXML);
  3292. this._freedGraphics.push(firstGraphic);
  3293. this._boundingRect = this._firstGraphic.boundingRect.clone();
  3294. var _a = createRegions(firstGraphic.named), regions = _a.regions, regionsMap = _a.regionsMap;
  3295. this._regions = regions;
  3296. this._regionsMap = regionsMap;
  3297. }
  3298. return {
  3299. boundingRect: this._boundingRect,
  3300. regions: this._regions,
  3301. regionsMap: this._regionsMap
  3302. };
  3303. };
  3304. GeoSVGResource2.prototype._buildGraphic = function(svgXML) {
  3305. var result;
  3306. var rootFromParse;
  3307. try {
  3308. result = svgXML && parseSVG(svgXML, {
  3309. ignoreViewBox: true,
  3310. ignoreRootClip: true
  3311. }) || {};
  3312. rootFromParse = result.root;
  3313. assert(rootFromParse != null);
  3314. } catch (e) {
  3315. throw new Error("Invalid svg format\n" + e.message);
  3316. }
  3317. var root = new Group_default();
  3318. root.add(rootFromParse);
  3319. root.isGeoSVGGraphicRoot = true;
  3320. var svgWidth = result.width;
  3321. var svgHeight = result.height;
  3322. var viewBoxRect = result.viewBoxRect;
  3323. var boundingRect = this._boundingRect;
  3324. if (!boundingRect) {
  3325. var bRectX = void 0;
  3326. var bRectY = void 0;
  3327. var bRectWidth = void 0;
  3328. var bRectHeight = void 0;
  3329. if (svgWidth != null) {
  3330. bRectX = 0;
  3331. bRectWidth = svgWidth;
  3332. } else if (viewBoxRect) {
  3333. bRectX = viewBoxRect.x;
  3334. bRectWidth = viewBoxRect.width;
  3335. }
  3336. if (svgHeight != null) {
  3337. bRectY = 0;
  3338. bRectHeight = svgHeight;
  3339. } else if (viewBoxRect) {
  3340. bRectY = viewBoxRect.y;
  3341. bRectHeight = viewBoxRect.height;
  3342. }
  3343. if (bRectX == null || bRectY == null) {
  3344. var calculatedBoundingRect = rootFromParse.getBoundingRect();
  3345. if (bRectX == null) {
  3346. bRectX = calculatedBoundingRect.x;
  3347. bRectWidth = calculatedBoundingRect.width;
  3348. }
  3349. if (bRectY == null) {
  3350. bRectY = calculatedBoundingRect.y;
  3351. bRectHeight = calculatedBoundingRect.height;
  3352. }
  3353. }
  3354. boundingRect = this._boundingRect = new BoundingRect_default(bRectX, bRectY, bRectWidth, bRectHeight);
  3355. }
  3356. if (viewBoxRect) {
  3357. var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect);
  3358. rootFromParse.scaleX = rootFromParse.scaleY = viewBoxTransform.scale;
  3359. rootFromParse.x = viewBoxTransform.x;
  3360. rootFromParse.y = viewBoxTransform.y;
  3361. }
  3362. root.setClipPath(new Rect_default({
  3363. shape: boundingRect.plain()
  3364. }));
  3365. var named = [];
  3366. each(result.named, function(namedItem) {
  3367. if (REGION_AVAILABLE_SVG_TAG_MAP.get(namedItem.svgNodeTagLower) != null) {
  3368. named.push(namedItem);
  3369. setSilent(namedItem.el);
  3370. }
  3371. });
  3372. return {
  3373. root,
  3374. boundingRect,
  3375. named
  3376. };
  3377. };
  3378. GeoSVGResource2.prototype.useGraphic = function(hostKey) {
  3379. var usedRootMap = this._usedGraphicMap;
  3380. var svgGraphic = usedRootMap.get(hostKey);
  3381. if (svgGraphic) {
  3382. return svgGraphic;
  3383. }
  3384. svgGraphic = this._freedGraphics.pop() || this._buildGraphic(this._parsedXML);
  3385. usedRootMap.set(hostKey, svgGraphic);
  3386. return svgGraphic;
  3387. };
  3388. GeoSVGResource2.prototype.freeGraphic = function(hostKey) {
  3389. var usedRootMap = this._usedGraphicMap;
  3390. var svgGraphic = usedRootMap.get(hostKey);
  3391. if (svgGraphic) {
  3392. usedRootMap.removeKey(hostKey);
  3393. this._freedGraphics.push(svgGraphic);
  3394. }
  3395. };
  3396. return GeoSVGResource2;
  3397. }();
  3398. function setSilent(el) {
  3399. el.silent = false;
  3400. if (el.isGroup) {
  3401. el.traverse(function(child) {
  3402. child.silent = false;
  3403. });
  3404. }
  3405. }
  3406. function createRegions(named) {
  3407. var regions = [];
  3408. var regionsMap = createHashMap();
  3409. each(named, function(namedItem) {
  3410. if (namedItem.namedFrom != null) {
  3411. return;
  3412. }
  3413. var region = new GeoSVGRegion(namedItem.name, namedItem.el);
  3414. regions.push(region);
  3415. regionsMap.set(namedItem.name, region);
  3416. });
  3417. return {
  3418. regions,
  3419. regionsMap
  3420. };
  3421. }
  3422. // node_modules/echarts/lib/coord/geo/GeoJSONResource.js
  3423. init_define_APP_INFO();
  3424. // node_modules/echarts/lib/coord/geo/fix/nanhai.js
  3425. init_define_APP_INFO();
  3426. var geoCoord = [126, 25];
  3427. var nanhaiName = "\u5357\u6D77\u8BF8\u5C9B";
  3428. var points = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7], [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]], [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], [1, 92.4], [1, 3.5], [0, 3.5]]];
  3429. for (i = 0; i < points.length; i++) {
  3430. for (k = 0; k < points[i].length; k++) {
  3431. points[i][k][0] /= 10.5;
  3432. points[i][k][1] /= -10.5 / 0.75;
  3433. points[i][k][0] += geoCoord[0];
  3434. points[i][k][1] += geoCoord[1];
  3435. }
  3436. }
  3437. var k;
  3438. var i;
  3439. function fixNanhai(mapType, regions) {
  3440. if (mapType === "china") {
  3441. for (var i = 0; i < regions.length; i++) {
  3442. if (regions[i].name === nanhaiName) {
  3443. return;
  3444. }
  3445. }
  3446. regions.push(new GeoJSONRegion(nanhaiName, map(points, function(exterior) {
  3447. return {
  3448. type: "polygon",
  3449. exterior
  3450. };
  3451. }), geoCoord));
  3452. }
  3453. }
  3454. // node_modules/echarts/lib/coord/geo/fix/textCoord.js
  3455. init_define_APP_INFO();
  3456. var coordsOffsetMap = {
  3457. "\u5357\u6D77\u8BF8\u5C9B": [32, 80],
  3458. "\u5E7F\u4E1C": [0, -10],
  3459. "\u9999\u6E2F": [10, 5],
  3460. "\u6FB3\u95E8": [-10, 10],
  3461. "\u5929\u6D25": [5, 5]
  3462. };
  3463. function fixTextCoords(mapType, region) {
  3464. if (mapType === "china") {
  3465. var coordFix = coordsOffsetMap[region.name];
  3466. if (coordFix) {
  3467. var cp = region.getCenter();
  3468. cp[0] += coordFix[0] / 10.5;
  3469. cp[1] += -coordFix[1] / (10.5 / 0.75);
  3470. region.setCenter(cp);
  3471. }
  3472. }
  3473. }
  3474. // node_modules/echarts/lib/coord/geo/fix/diaoyuIsland.js
  3475. init_define_APP_INFO();
  3476. var points2 = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]];
  3477. function fixDiaoyuIsland(mapType, region) {
  3478. if (mapType === "china" && region.name === "\u53F0\u6E7E") {
  3479. region.geometries.push({
  3480. type: "polygon",
  3481. exterior: points2[0]
  3482. });
  3483. }
  3484. }
  3485. // node_modules/echarts/lib/coord/geo/GeoJSONResource.js
  3486. var DEFAULT_NAME_PROPERTY = "name";
  3487. var GeoJSONResource = function() {
  3488. function GeoJSONResource2(mapName, geoJSON, specialAreas) {
  3489. this.type = "geoJSON";
  3490. this._parsedMap = createHashMap();
  3491. this._mapName = mapName;
  3492. this._specialAreas = specialAreas;
  3493. this._geoJSON = parseInput(geoJSON);
  3494. }
  3495. GeoJSONResource2.prototype.load = function(nameMap, nameProperty) {
  3496. nameProperty = nameProperty || DEFAULT_NAME_PROPERTY;
  3497. var parsed = this._parsedMap.get(nameProperty);
  3498. if (!parsed) {
  3499. var rawRegions = this._parseToRegions(nameProperty);
  3500. parsed = this._parsedMap.set(nameProperty, {
  3501. regions: rawRegions,
  3502. boundingRect: calculateBoundingRect(rawRegions)
  3503. });
  3504. }
  3505. var regionsMap = createHashMap();
  3506. var finalRegions = [];
  3507. each(parsed.regions, function(region) {
  3508. var regionName = region.name;
  3509. if (nameMap && hasOwn(nameMap, regionName)) {
  3510. region = region.cloneShallow(regionName = nameMap[regionName]);
  3511. }
  3512. finalRegions.push(region);
  3513. regionsMap.set(regionName, region);
  3514. });
  3515. return {
  3516. regions: finalRegions,
  3517. boundingRect: parsed.boundingRect || new BoundingRect_default(0, 0, 0, 0),
  3518. regionsMap
  3519. };
  3520. };
  3521. GeoJSONResource2.prototype._parseToRegions = function(nameProperty) {
  3522. var mapName = this._mapName;
  3523. var geoJSON = this._geoJSON;
  3524. var rawRegions;
  3525. try {
  3526. rawRegions = geoJSON ? parseGeoJSON(geoJSON, nameProperty) : [];
  3527. } catch (e) {
  3528. throw new Error("Invalid geoJson format\n" + e.message);
  3529. }
  3530. fixNanhai(mapName, rawRegions);
  3531. each(rawRegions, function(region) {
  3532. var regionName = region.name;
  3533. fixTextCoords(mapName, region);
  3534. fixDiaoyuIsland(mapName, region);
  3535. var specialArea = this._specialAreas && this._specialAreas[regionName];
  3536. if (specialArea) {
  3537. region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height);
  3538. }
  3539. }, this);
  3540. return rawRegions;
  3541. };
  3542. GeoJSONResource2.prototype.getMapForUser = function() {
  3543. return {
  3544. geoJson: this._geoJSON,
  3545. geoJSON: this._geoJSON,
  3546. specialAreas: this._specialAreas
  3547. };
  3548. };
  3549. return GeoJSONResource2;
  3550. }();
  3551. function calculateBoundingRect(regions) {
  3552. var rect;
  3553. for (var i = 0; i < regions.length; i++) {
  3554. var regionRect = regions[i].getBoundingRect();
  3555. rect = rect || regionRect.clone();
  3556. rect.union(regionRect);
  3557. }
  3558. return rect;
  3559. }
  3560. function parseInput(source) {
  3561. return !isString(source) ? source : typeof JSON !== "undefined" && JSON.parse ? JSON.parse(source) : new Function("return (" + source + ");")();
  3562. }
  3563. // node_modules/echarts/lib/coord/geo/geoSourceManager.js
  3564. var storage = createHashMap();
  3565. var geoSourceManager_default = {
  3566. registerMap: function(mapName, rawDef, rawSpecialAreas) {
  3567. if (rawDef.svg) {
  3568. var resource = new GeoSVGResource(mapName, rawDef.svg);
  3569. storage.set(mapName, resource);
  3570. } else {
  3571. var geoJSON = rawDef.geoJson || rawDef.geoJSON;
  3572. if (geoJSON && !rawDef.features) {
  3573. rawSpecialAreas = rawDef.specialAreas;
  3574. } else {
  3575. geoJSON = rawDef;
  3576. }
  3577. var resource = new GeoJSONResource(mapName, geoJSON, rawSpecialAreas);
  3578. storage.set(mapName, resource);
  3579. }
  3580. },
  3581. getGeoResource: function(mapName) {
  3582. return storage.get(mapName);
  3583. },
  3584. getMapForUser: function(mapName) {
  3585. var resource = storage.get(mapName);
  3586. return resource && resource.type === "geoJSON" && resource.getMapForUser();
  3587. },
  3588. load: function(mapName, nameMap, nameProperty) {
  3589. var resource = storage.get(mapName);
  3590. if (!resource) {
  3591. if (true) {
  3592. console.error("Map " + mapName + " not exists. The GeoJSON of the map must be provided.");
  3593. }
  3594. return;
  3595. }
  3596. return resource.load(nameMap, nameProperty);
  3597. }
  3598. };
  3599. // node_modules/echarts/lib/coord/geo/Geo.js
  3600. var GEO_DEFAULT_PARAMS = {
  3601. "geoJSON": {
  3602. aspectScale: 0.75,
  3603. invertLongitute: true
  3604. },
  3605. "geoSVG": {
  3606. aspectScale: 1,
  3607. invertLongitute: false
  3608. }
  3609. };
  3610. var geo2DDimensions = ["lng", "lat"];
  3611. var Geo = function(_super) {
  3612. __extends(Geo2, _super);
  3613. function Geo2(name, map2, opt) {
  3614. var _this = _super.call(this, name) || this;
  3615. _this.dimensions = geo2DDimensions;
  3616. _this.type = "geo";
  3617. _this._nameCoordMap = createHashMap();
  3618. _this.map = map2;
  3619. var projection = opt.projection;
  3620. var source = geoSourceManager_default.load(map2, opt.nameMap, opt.nameProperty);
  3621. var resource = geoSourceManager_default.getGeoResource(map2);
  3622. var resourceType = _this.resourceType = resource ? resource.type : null;
  3623. var regions = _this.regions = source.regions;
  3624. var defaultParams = GEO_DEFAULT_PARAMS[resource.type];
  3625. _this._regionsMap = source.regionsMap;
  3626. _this.regions = source.regions;
  3627. if (projection) {
  3628. if (resourceType === "geoSVG") {
  3629. if (true) {
  3630. warn("Map " + map2 + " with SVG source can't use projection. Only GeoJSON source supports projection.");
  3631. }
  3632. projection = null;
  3633. }
  3634. if (!(projection.project && projection.unproject)) {
  3635. if (true) {
  3636. warn("project and unproject must be both provided in the projeciton.");
  3637. }
  3638. projection = null;
  3639. }
  3640. }
  3641. _this.projection = projection;
  3642. var boundingRect;
  3643. if (projection) {
  3644. for (var i = 0; i < regions.length; i++) {
  3645. var regionRect = regions[i].getBoundingRect(projection);
  3646. boundingRect = boundingRect || regionRect.clone();
  3647. boundingRect.union(regionRect);
  3648. }
  3649. } else {
  3650. boundingRect = source.boundingRect;
  3651. }
  3652. _this.setBoundingRect(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height);
  3653. _this.aspectScale = projection ? 1 : retrieve2(opt.aspectScale, defaultParams.aspectScale);
  3654. _this._invertLongitute = projection ? false : defaultParams.invertLongitute;
  3655. return _this;
  3656. }
  3657. Geo2.prototype._transformTo = function(x, y, width, height) {
  3658. var rect = this.getBoundingRect();
  3659. var invertLongitute = this._invertLongitute;
  3660. rect = rect.clone();
  3661. if (invertLongitute) {
  3662. rect.y = -rect.y - rect.height;
  3663. }
  3664. var rawTransformable = this._rawTransformable;
  3665. rawTransformable.transform = rect.calculateTransform(new BoundingRect_default(x, y, width, height));
  3666. var rawParent = rawTransformable.parent;
  3667. rawTransformable.parent = null;
  3668. rawTransformable.decomposeTransform();
  3669. rawTransformable.parent = rawParent;
  3670. if (invertLongitute) {
  3671. rawTransformable.scaleY = -rawTransformable.scaleY;
  3672. }
  3673. this._updateTransform();
  3674. };
  3675. Geo2.prototype.getRegion = function(name) {
  3676. return this._regionsMap.get(name);
  3677. };
  3678. Geo2.prototype.getRegionByCoord = function(coord) {
  3679. var regions = this.regions;
  3680. for (var i = 0; i < regions.length; i++) {
  3681. var region = regions[i];
  3682. if (region.type === "geoJSON" && region.contain(coord)) {
  3683. return regions[i];
  3684. }
  3685. }
  3686. };
  3687. Geo2.prototype.addGeoCoord = function(name, geoCoord2) {
  3688. this._nameCoordMap.set(name, geoCoord2);
  3689. };
  3690. Geo2.prototype.getGeoCoord = function(name) {
  3691. var region = this._regionsMap.get(name);
  3692. return this._nameCoordMap.get(name) || region && region.getCenter();
  3693. };
  3694. Geo2.prototype.dataToPoint = function(data, noRoam, out) {
  3695. if (isString(data)) {
  3696. data = this.getGeoCoord(data);
  3697. }
  3698. if (data) {
  3699. var projection = this.projection;
  3700. if (projection) {
  3701. data = projection.project(data);
  3702. }
  3703. return data && this.projectedToPoint(data, noRoam, out);
  3704. }
  3705. };
  3706. Geo2.prototype.pointToData = function(point) {
  3707. var projection = this.projection;
  3708. if (projection) {
  3709. point = projection.unproject(point);
  3710. }
  3711. return point && this.pointToProjected(point);
  3712. };
  3713. Geo2.prototype.pointToProjected = function(point) {
  3714. return _super.prototype.pointToData.call(this, point);
  3715. };
  3716. Geo2.prototype.projectedToPoint = function(projected, noRoam, out) {
  3717. return _super.prototype.dataToPoint.call(this, projected, noRoam, out);
  3718. };
  3719. Geo2.prototype.convertToPixel = function(ecModel, finder, value) {
  3720. var coordSys = getCoordSys2(finder);
  3721. return coordSys === this ? coordSys.dataToPoint(value) : null;
  3722. };
  3723. Geo2.prototype.convertFromPixel = function(ecModel, finder, pixel) {
  3724. var coordSys = getCoordSys2(finder);
  3725. return coordSys === this ? coordSys.pointToData(pixel) : null;
  3726. };
  3727. return Geo2;
  3728. }(View_default);
  3729. mixin(Geo, View_default);
  3730. function getCoordSys2(finder) {
  3731. var geoModel = finder.geoModel;
  3732. var seriesModel = finder.seriesModel;
  3733. return geoModel ? geoModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem || (seriesModel.getReferringComponents("geo", SINGLE_REFERRING).models[0] || {}).coordinateSystem : null;
  3734. }
  3735. var Geo_default = Geo;
  3736. // node_modules/echarts/lib/coord/geo/geoCreator.js
  3737. function resizeGeo(geoModel, api) {
  3738. var boundingCoords = geoModel.get("boundingCoords");
  3739. if (boundingCoords != null) {
  3740. var leftTop_1 = boundingCoords[0];
  3741. var rightBottom_1 = boundingCoords[1];
  3742. if (!(isFinite(leftTop_1[0]) && isFinite(leftTop_1[1]) && isFinite(rightBottom_1[0]) && isFinite(rightBottom_1[1]))) {
  3743. if (true) {
  3744. console.error("Invalid boundingCoords");
  3745. }
  3746. } else {
  3747. var projection_1 = this.projection;
  3748. if (projection_1) {
  3749. var xMin = leftTop_1[0];
  3750. var yMin = leftTop_1[1];
  3751. var xMax = rightBottom_1[0];
  3752. var yMax = rightBottom_1[1];
  3753. leftTop_1 = [Infinity, Infinity];
  3754. rightBottom_1 = [-Infinity, -Infinity];
  3755. var sampleLine = function(x0, y0, x1, y1) {
  3756. var dx = x1 - x0;
  3757. var dy = y1 - y0;
  3758. for (var i = 0; i <= 100; i++) {
  3759. var p = i / 100;
  3760. var pt = projection_1.project([x0 + dx * p, y0 + dy * p]);
  3761. min(leftTop_1, leftTop_1, pt);
  3762. max(rightBottom_1, rightBottom_1, pt);
  3763. }
  3764. };
  3765. sampleLine(xMin, yMin, xMax, yMin);
  3766. sampleLine(xMax, yMin, xMax, yMax);
  3767. sampleLine(xMax, yMax, xMin, yMax);
  3768. sampleLine(xMin, yMax, xMax, yMin);
  3769. }
  3770. this.setBoundingRect(leftTop_1[0], leftTop_1[1], rightBottom_1[0] - leftTop_1[0], rightBottom_1[1] - leftTop_1[1]);
  3771. }
  3772. }
  3773. var rect = this.getBoundingRect();
  3774. var centerOption = geoModel.get("layoutCenter");
  3775. var sizeOption = geoModel.get("layoutSize");
  3776. var viewWidth = api.getWidth();
  3777. var viewHeight = api.getHeight();
  3778. var aspect = rect.width / rect.height * this.aspectScale;
  3779. var useCenterAndSize = false;
  3780. var center;
  3781. var size;
  3782. if (centerOption && sizeOption) {
  3783. center = [parsePercent(centerOption[0], viewWidth), parsePercent(centerOption[1], viewHeight)];
  3784. size = parsePercent(sizeOption, Math.min(viewWidth, viewHeight));
  3785. if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) {
  3786. useCenterAndSize = true;
  3787. } else {
  3788. if (true) {
  3789. console.warn("Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.");
  3790. }
  3791. }
  3792. }
  3793. var viewRect;
  3794. if (useCenterAndSize) {
  3795. viewRect = {};
  3796. if (aspect > 1) {
  3797. viewRect.width = size;
  3798. viewRect.height = size / aspect;
  3799. } else {
  3800. viewRect.height = size;
  3801. viewRect.width = size * aspect;
  3802. }
  3803. viewRect.y = center[1] - viewRect.height / 2;
  3804. viewRect.x = center[0] - viewRect.width / 2;
  3805. } else {
  3806. var boxLayoutOption = geoModel.getBoxLayoutParams();
  3807. boxLayoutOption.aspect = aspect;
  3808. viewRect = getLayoutRect(boxLayoutOption, {
  3809. width: viewWidth,
  3810. height: viewHeight
  3811. });
  3812. }
  3813. this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);
  3814. this.setCenter(geoModel.get("center"), api);
  3815. this.setZoom(geoModel.get("zoom"));
  3816. }
  3817. function setGeoCoords(geo, model) {
  3818. each(model.get("geoCoord"), function(geoCoord2, name) {
  3819. geo.addGeoCoord(name, geoCoord2);
  3820. });
  3821. }
  3822. var GeoCreator = function() {
  3823. function GeoCreator2() {
  3824. this.dimensions = geo2DDimensions;
  3825. }
  3826. GeoCreator2.prototype.create = function(ecModel, api) {
  3827. var geoList = [];
  3828. function getCommonGeoProperties(model) {
  3829. return {
  3830. nameProperty: model.get("nameProperty"),
  3831. aspectScale: model.get("aspectScale"),
  3832. projection: model.get("projection")
  3833. };
  3834. }
  3835. ecModel.eachComponent("geo", function(geoModel, idx) {
  3836. var mapName = geoModel.get("map");
  3837. var geo = new Geo_default(mapName + idx, mapName, extend({
  3838. nameMap: geoModel.get("nameMap")
  3839. }, getCommonGeoProperties(geoModel)));
  3840. geo.zoomLimit = geoModel.get("scaleLimit");
  3841. geoList.push(geo);
  3842. geoModel.coordinateSystem = geo;
  3843. geo.model = geoModel;
  3844. geo.resize = resizeGeo;
  3845. geo.resize(geoModel, api);
  3846. });
  3847. ecModel.eachSeries(function(seriesModel) {
  3848. var coordSys = seriesModel.get("coordinateSystem");
  3849. if (coordSys === "geo") {
  3850. var geoIndex = seriesModel.get("geoIndex") || 0;
  3851. seriesModel.coordinateSystem = geoList[geoIndex];
  3852. }
  3853. });
  3854. var mapModelGroupBySeries = {};
  3855. ecModel.eachSeriesByType("map", function(seriesModel) {
  3856. if (!seriesModel.getHostGeoModel()) {
  3857. var mapType = seriesModel.getMapType();
  3858. mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];
  3859. mapModelGroupBySeries[mapType].push(seriesModel);
  3860. }
  3861. });
  3862. each(mapModelGroupBySeries, function(mapSeries, mapType) {
  3863. var nameMapList = map(mapSeries, function(singleMapSeries) {
  3864. return singleMapSeries.get("nameMap");
  3865. });
  3866. var geo = new Geo_default(mapType, mapType, extend({
  3867. nameMap: mergeAll(nameMapList)
  3868. }, getCommonGeoProperties(mapSeries[0])));
  3869. geo.zoomLimit = retrieve.apply(null, map(mapSeries, function(singleMapSeries) {
  3870. return singleMapSeries.get("scaleLimit");
  3871. }));
  3872. geoList.push(geo);
  3873. geo.resize = resizeGeo;
  3874. geo.resize(mapSeries[0], api);
  3875. each(mapSeries, function(singleMapSeries) {
  3876. singleMapSeries.coordinateSystem = geo;
  3877. setGeoCoords(geo, singleMapSeries);
  3878. });
  3879. });
  3880. return geoList;
  3881. };
  3882. GeoCreator2.prototype.getFilledRegions = function(originRegionArr, mapName, nameMap, nameProperty) {
  3883. var regionsArr = (originRegionArr || []).slice();
  3884. var dataNameMap = createHashMap();
  3885. for (var i = 0; i < regionsArr.length; i++) {
  3886. dataNameMap.set(regionsArr[i].name, regionsArr[i]);
  3887. }
  3888. var source = geoSourceManager_default.load(mapName, nameMap, nameProperty);
  3889. each(source.regions, function(region) {
  3890. var name = region.name;
  3891. !dataNameMap.get(name) && regionsArr.push({
  3892. name
  3893. });
  3894. });
  3895. return regionsArr;
  3896. };
  3897. return GeoCreator2;
  3898. }();
  3899. var geoCreator = new GeoCreator();
  3900. var geoCreator_default = geoCreator;
  3901. // node_modules/echarts/lib/coord/geo/GeoModel.js
  3902. var GeoModel = function(_super) {
  3903. __extends(GeoModel2, _super);
  3904. function GeoModel2() {
  3905. var _this = _super !== null && _super.apply(this, arguments) || this;
  3906. _this.type = GeoModel2.type;
  3907. return _this;
  3908. }
  3909. GeoModel2.prototype.init = function(option, parentModel, ecModel) {
  3910. var source = geoSourceManager_default.getGeoResource(option.map);
  3911. if (source && source.type === "geoJSON") {
  3912. var itemStyle = option.itemStyle = option.itemStyle || {};
  3913. if (!("color" in itemStyle)) {
  3914. itemStyle.color = "#eee";
  3915. }
  3916. }
  3917. this.mergeDefaultAndTheme(option, ecModel);
  3918. defaultEmphasis(option, "label", ["show"]);
  3919. };
  3920. GeoModel2.prototype.optionUpdated = function() {
  3921. var _this = this;
  3922. var option = this.option;
  3923. option.regions = geoCreator_default.getFilledRegions(option.regions, option.map, option.nameMap, option.nameProperty);
  3924. var selectedMap = {};
  3925. this._optionModelMap = reduce(option.regions || [], function(optionModelMap, regionOpt) {
  3926. var regionName = regionOpt.name;
  3927. if (regionName) {
  3928. optionModelMap.set(regionName, new Model_default(regionOpt, _this, _this.ecModel));
  3929. if (regionOpt.selected) {
  3930. selectedMap[regionName] = true;
  3931. }
  3932. }
  3933. return optionModelMap;
  3934. }, createHashMap());
  3935. if (!option.selectedMap) {
  3936. option.selectedMap = selectedMap;
  3937. }
  3938. };
  3939. GeoModel2.prototype.getRegionModel = function(name) {
  3940. return this._optionModelMap.get(name) || new Model_default(null, this, this.ecModel);
  3941. };
  3942. GeoModel2.prototype.getFormattedLabel = function(name, status) {
  3943. var regionModel = this.getRegionModel(name);
  3944. var formatter = status === "normal" ? regionModel.get(["label", "formatter"]) : regionModel.get(["emphasis", "label", "formatter"]);
  3945. var params = {
  3946. name
  3947. };
  3948. if (isFunction(formatter)) {
  3949. params.status = status;
  3950. return formatter(params);
  3951. } else if (isString(formatter)) {
  3952. return formatter.replace("{a}", name != null ? name : "");
  3953. }
  3954. };
  3955. GeoModel2.prototype.setZoom = function(zoom) {
  3956. this.option.zoom = zoom;
  3957. };
  3958. GeoModel2.prototype.setCenter = function(center) {
  3959. this.option.center = center;
  3960. };
  3961. GeoModel2.prototype.select = function(name) {
  3962. var option = this.option;
  3963. var selectedMode = option.selectedMode;
  3964. if (!selectedMode) {
  3965. return;
  3966. }
  3967. if (selectedMode !== "multiple") {
  3968. option.selectedMap = null;
  3969. }
  3970. var selectedMap = option.selectedMap || (option.selectedMap = {});
  3971. selectedMap[name] = true;
  3972. };
  3973. GeoModel2.prototype.unSelect = function(name) {
  3974. var selectedMap = this.option.selectedMap;
  3975. if (selectedMap) {
  3976. selectedMap[name] = false;
  3977. }
  3978. };
  3979. GeoModel2.prototype.toggleSelected = function(name) {
  3980. this[this.isSelected(name) ? "unSelect" : "select"](name);
  3981. };
  3982. GeoModel2.prototype.isSelected = function(name) {
  3983. var selectedMap = this.option.selectedMap;
  3984. return !!(selectedMap && selectedMap[name]);
  3985. };
  3986. GeoModel2.type = "geo";
  3987. GeoModel2.layoutMode = "box";
  3988. GeoModel2.defaultOption = {
  3989. z: 0,
  3990. show: true,
  3991. left: "center",
  3992. top: "center",
  3993. aspectScale: null,
  3994. silent: false,
  3995. map: "",
  3996. boundingCoords: null,
  3997. center: null,
  3998. zoom: 1,
  3999. scaleLimit: null,
  4000. label: {
  4001. show: false,
  4002. color: "#000"
  4003. },
  4004. itemStyle: {
  4005. borderWidth: 0.5,
  4006. borderColor: "#444"
  4007. },
  4008. emphasis: {
  4009. label: {
  4010. show: true,
  4011. color: "rgb(100,0,0)"
  4012. },
  4013. itemStyle: {
  4014. color: "rgba(255,215,0,0.8)"
  4015. }
  4016. },
  4017. select: {
  4018. label: {
  4019. show: true,
  4020. color: "rgb(100,0,0)"
  4021. },
  4022. itemStyle: {
  4023. color: "rgba(255,215,0,0.8)"
  4024. }
  4025. },
  4026. regions: []
  4027. };
  4028. return GeoModel2;
  4029. }(Component_default);
  4030. var GeoModel_default = GeoModel;
  4031. // node_modules/echarts/lib/action/roamHelper.js
  4032. init_define_APP_INFO();
  4033. function getCenterCoord(view, point) {
  4034. return view.pointToProjected ? view.pointToProjected(point) : view.pointToData(point);
  4035. }
  4036. function updateCenterAndZoom(view, payload, zoomLimit, api) {
  4037. var previousZoom = view.getZoom();
  4038. var center = view.getCenter();
  4039. var zoom = payload.zoom;
  4040. var point = view.projectedToPoint ? view.projectedToPoint(center) : view.dataToPoint(center);
  4041. if (payload.dx != null && payload.dy != null) {
  4042. point[0] -= payload.dx;
  4043. point[1] -= payload.dy;
  4044. view.setCenter(getCenterCoord(view, point), api);
  4045. }
  4046. if (zoom != null) {
  4047. if (zoomLimit) {
  4048. var zoomMin = zoomLimit.min || 0;
  4049. var zoomMax = zoomLimit.max || Infinity;
  4050. zoom = Math.max(Math.min(previousZoom * zoom, zoomMax), zoomMin) / previousZoom;
  4051. }
  4052. view.scaleX *= zoom;
  4053. view.scaleY *= zoom;
  4054. var fixX = (payload.originX - view.x) * (zoom - 1);
  4055. var fixY = (payload.originY - view.y) * (zoom - 1);
  4056. view.x -= fixX;
  4057. view.y -= fixY;
  4058. view.updateTransform();
  4059. view.setCenter(getCenterCoord(view, point), api);
  4060. view.setZoom(zoom * previousZoom);
  4061. }
  4062. return {
  4063. center: view.getCenter(),
  4064. zoom: view.getZoom()
  4065. };
  4066. }
  4067. // node_modules/echarts/lib/component/geo/GeoView.js
  4068. init_define_APP_INFO();
  4069. // node_modules/echarts/lib/component/helper/MapDraw.js
  4070. init_define_APP_INFO();
  4071. // node_modules/echarts/lib/component/helper/RoamController.js
  4072. init_define_APP_INFO();
  4073. // node_modules/echarts/lib/component/helper/interactionMutex.js
  4074. init_define_APP_INFO();
  4075. var ATTR = "\0_ec_interaction_mutex";
  4076. function take(zr, resourceKey, userKey) {
  4077. var store = getStore(zr);
  4078. store[resourceKey] = userKey;
  4079. }
  4080. function release(zr, resourceKey, userKey) {
  4081. var store = getStore(zr);
  4082. var uKey = store[resourceKey];
  4083. if (uKey === userKey) {
  4084. store[resourceKey] = null;
  4085. }
  4086. }
  4087. function isTaken(zr, resourceKey) {
  4088. return !!getStore(zr)[resourceKey];
  4089. }
  4090. function getStore(zr) {
  4091. return zr[ATTR] || (zr[ATTR] = {});
  4092. }
  4093. registerAction({
  4094. type: "takeGlobalCursor",
  4095. event: "globalCursorTaken",
  4096. update: "update"
  4097. }, noop);
  4098. // node_modules/echarts/lib/component/helper/RoamController.js
  4099. var RoamController = function(_super) {
  4100. __extends(RoamController2, _super);
  4101. function RoamController2(zr) {
  4102. var _this = _super.call(this) || this;
  4103. _this._zr = zr;
  4104. var mousedownHandler = bind(_this._mousedownHandler, _this);
  4105. var mousemoveHandler = bind(_this._mousemoveHandler, _this);
  4106. var mouseupHandler = bind(_this._mouseupHandler, _this);
  4107. var mousewheelHandler = bind(_this._mousewheelHandler, _this);
  4108. var pinchHandler = bind(_this._pinchHandler, _this);
  4109. _this.enable = function(controlType, opt) {
  4110. this.disable();
  4111. this._opt = defaults(clone(opt) || {}, {
  4112. zoomOnMouseWheel: true,
  4113. moveOnMouseMove: true,
  4114. moveOnMouseWheel: false,
  4115. preventDefaultMouseMove: true
  4116. });
  4117. if (controlType == null) {
  4118. controlType = true;
  4119. }
  4120. if (controlType === true || controlType === "move" || controlType === "pan") {
  4121. zr.on("mousedown", mousedownHandler);
  4122. zr.on("mousemove", mousemoveHandler);
  4123. zr.on("mouseup", mouseupHandler);
  4124. }
  4125. if (controlType === true || controlType === "scale" || controlType === "zoom") {
  4126. zr.on("mousewheel", mousewheelHandler);
  4127. zr.on("pinch", pinchHandler);
  4128. }
  4129. };
  4130. _this.disable = function() {
  4131. zr.off("mousedown", mousedownHandler);
  4132. zr.off("mousemove", mousemoveHandler);
  4133. zr.off("mouseup", mouseupHandler);
  4134. zr.off("mousewheel", mousewheelHandler);
  4135. zr.off("pinch", pinchHandler);
  4136. };
  4137. return _this;
  4138. }
  4139. RoamController2.prototype.isDragging = function() {
  4140. return this._dragging;
  4141. };
  4142. RoamController2.prototype.isPinching = function() {
  4143. return this._pinching;
  4144. };
  4145. RoamController2.prototype.setPointerChecker = function(pointerChecker) {
  4146. this.pointerChecker = pointerChecker;
  4147. };
  4148. RoamController2.prototype.dispose = function() {
  4149. this.disable();
  4150. };
  4151. RoamController2.prototype._mousedownHandler = function(e) {
  4152. if (isMiddleOrRightButtonOnMouseUpDown(e) || e.target && e.target.draggable) {
  4153. return;
  4154. }
  4155. var x = e.offsetX;
  4156. var y = e.offsetY;
  4157. if (this.pointerChecker && this.pointerChecker(e, x, y)) {
  4158. this._x = x;
  4159. this._y = y;
  4160. this._dragging = true;
  4161. }
  4162. };
  4163. RoamController2.prototype._mousemoveHandler = function(e) {
  4164. if (!this._dragging || !isAvailableBehavior("moveOnMouseMove", e, this._opt) || e.gestureEvent === "pinch" || isTaken(this._zr, "globalPan")) {
  4165. return;
  4166. }
  4167. var x = e.offsetX;
  4168. var y = e.offsetY;
  4169. var oldX = this._x;
  4170. var oldY = this._y;
  4171. var dx = x - oldX;
  4172. var dy = y - oldY;
  4173. this._x = x;
  4174. this._y = y;
  4175. this._opt.preventDefaultMouseMove && stop(e.event);
  4176. trigger(this, "pan", "moveOnMouseMove", e, {
  4177. dx,
  4178. dy,
  4179. oldX,
  4180. oldY,
  4181. newX: x,
  4182. newY: y,
  4183. isAvailableBehavior: null
  4184. });
  4185. };
  4186. RoamController2.prototype._mouseupHandler = function(e) {
  4187. if (!isMiddleOrRightButtonOnMouseUpDown(e)) {
  4188. this._dragging = false;
  4189. }
  4190. };
  4191. RoamController2.prototype._mousewheelHandler = function(e) {
  4192. var shouldZoom = isAvailableBehavior("zoomOnMouseWheel", e, this._opt);
  4193. var shouldMove = isAvailableBehavior("moveOnMouseWheel", e, this._opt);
  4194. var wheelDelta = e.wheelDelta;
  4195. var absWheelDeltaDelta = Math.abs(wheelDelta);
  4196. var originX = e.offsetX;
  4197. var originY = e.offsetY;
  4198. if (wheelDelta === 0 || !shouldZoom && !shouldMove) {
  4199. return;
  4200. }
  4201. if (shouldZoom) {
  4202. var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1;
  4203. var scale2 = wheelDelta > 0 ? factor : 1 / factor;
  4204. checkPointerAndTrigger(this, "zoom", "zoomOnMouseWheel", e, {
  4205. scale: scale2,
  4206. originX,
  4207. originY,
  4208. isAvailableBehavior: null
  4209. });
  4210. }
  4211. if (shouldMove) {
  4212. var absDelta = Math.abs(wheelDelta);
  4213. var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05);
  4214. checkPointerAndTrigger(this, "scrollMove", "moveOnMouseWheel", e, {
  4215. scrollDelta,
  4216. originX,
  4217. originY,
  4218. isAvailableBehavior: null
  4219. });
  4220. }
  4221. };
  4222. RoamController2.prototype._pinchHandler = function(e) {
  4223. if (isTaken(this._zr, "globalPan")) {
  4224. return;
  4225. }
  4226. var scale2 = e.pinchScale > 1 ? 1.1 : 1 / 1.1;
  4227. checkPointerAndTrigger(this, "zoom", null, e, {
  4228. scale: scale2,
  4229. originX: e.pinchX,
  4230. originY: e.pinchY,
  4231. isAvailableBehavior: null
  4232. });
  4233. };
  4234. return RoamController2;
  4235. }(Eventful_default);
  4236. function checkPointerAndTrigger(controller, eventName, behaviorToCheck, e, contollerEvent) {
  4237. if (controller.pointerChecker && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)) {
  4238. stop(e.event);
  4239. trigger(controller, eventName, behaviorToCheck, e, contollerEvent);
  4240. }
  4241. }
  4242. function trigger(controller, eventName, behaviorToCheck, e, contollerEvent) {
  4243. contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e);
  4244. controller.trigger(eventName, contollerEvent);
  4245. }
  4246. function isAvailableBehavior(behaviorToCheck, e, settings) {
  4247. var setting = settings[behaviorToCheck];
  4248. return !behaviorToCheck || setting && (!isString(setting) || e.event[setting + "Key"]);
  4249. }
  4250. var RoamController_default = RoamController;
  4251. // node_modules/echarts/lib/component/helper/roamHelper.js
  4252. init_define_APP_INFO();
  4253. function updateViewOnPan(controllerHost, dx, dy) {
  4254. var target = controllerHost.target;
  4255. target.x += dx;
  4256. target.y += dy;
  4257. target.dirty();
  4258. }
  4259. function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) {
  4260. var target = controllerHost.target;
  4261. var zoomLimit = controllerHost.zoomLimit;
  4262. var newZoom = controllerHost.zoom = controllerHost.zoom || 1;
  4263. newZoom *= zoomDelta;
  4264. if (zoomLimit) {
  4265. var zoomMin = zoomLimit.min || 0;
  4266. var zoomMax = zoomLimit.max || Infinity;
  4267. newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);
  4268. }
  4269. var zoomScale = newZoom / controllerHost.zoom;
  4270. controllerHost.zoom = newZoom;
  4271. target.x -= (zoomX - target.x) * (zoomScale - 1);
  4272. target.y -= (zoomY - target.y) * (zoomScale - 1);
  4273. target.scaleX *= zoomScale;
  4274. target.scaleY *= zoomScale;
  4275. target.dirty();
  4276. }
  4277. // node_modules/echarts/lib/component/helper/cursorHelper.js
  4278. init_define_APP_INFO();
  4279. var IRRELEVANT_EXCLUDES = {
  4280. "axisPointer": 1,
  4281. "tooltip": 1,
  4282. "brush": 1
  4283. };
  4284. function onIrrelevantElement(e, api, targetCoordSysModel) {
  4285. var model = api.getComponentByElement(e.topTarget);
  4286. var coordSys = model && model.coordinateSystem;
  4287. return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType) && coordSys && coordSys.model !== targetCoordSysModel;
  4288. }
  4289. // node_modules/echarts/lib/component/helper/MapDraw.js
  4290. var OPTION_STYLE_ENABLED_TAGS = ["rect", "circle", "line", "ellipse", "polygon", "polyline", "path"];
  4291. var OPTION_STYLE_ENABLED_TAG_MAP = createHashMap(OPTION_STYLE_ENABLED_TAGS);
  4292. var STATE_TRIGGER_TAG_MAP = createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(["g"]));
  4293. var LABEL_HOST_MAP = createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(["g"]));
  4294. var mapLabelRaw = makeInner();
  4295. function getFixedItemStyle(model) {
  4296. var itemStyle = model.getItemStyle();
  4297. var areaColor = model.get("areaColor");
  4298. if (areaColor != null) {
  4299. itemStyle.fill = areaColor;
  4300. }
  4301. return itemStyle;
  4302. }
  4303. function fixLineStyle(styleHost) {
  4304. var style = styleHost.style;
  4305. if (style) {
  4306. style.stroke = style.stroke || style.fill;
  4307. style.fill = null;
  4308. }
  4309. }
  4310. var MapDraw = function() {
  4311. function MapDraw2(api) {
  4312. var group = new Group_default();
  4313. this.uid = getUID("ec_map_draw");
  4314. this._controller = new RoamController_default(api.getZr());
  4315. this._controllerHost = {
  4316. target: group
  4317. };
  4318. this.group = group;
  4319. group.add(this._regionsGroup = new Group_default());
  4320. group.add(this._svgGroup = new Group_default());
  4321. }
  4322. MapDraw2.prototype.draw = function(mapOrGeoModel, ecModel, api, fromView, payload) {
  4323. var isGeo = mapOrGeoModel.mainType === "geo";
  4324. var data = mapOrGeoModel.getData && mapOrGeoModel.getData();
  4325. isGeo && ecModel.eachComponent({
  4326. mainType: "series",
  4327. subType: "map"
  4328. }, function(mapSeries) {
  4329. if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {
  4330. data = mapSeries.getData();
  4331. }
  4332. });
  4333. var geo = mapOrGeoModel.coordinateSystem;
  4334. var regionsGroup = this._regionsGroup;
  4335. var group = this.group;
  4336. var transformInfo = geo.getTransformInfo();
  4337. var transformInfoRaw = transformInfo.raw;
  4338. var transformInfoRoam = transformInfo.roam;
  4339. var isFirstDraw = !regionsGroup.childAt(0) || payload;
  4340. if (isFirstDraw) {
  4341. group.x = transformInfoRoam.x;
  4342. group.y = transformInfoRoam.y;
  4343. group.scaleX = transformInfoRoam.scaleX;
  4344. group.scaleY = transformInfoRoam.scaleY;
  4345. group.dirty();
  4346. } else {
  4347. updateProps(group, transformInfoRoam, mapOrGeoModel);
  4348. }
  4349. var isVisualEncodedByVisualMap = data && data.getVisual("visualMeta") && data.getVisual("visualMeta").length > 0;
  4350. var viewBuildCtx = {
  4351. api,
  4352. geo,
  4353. mapOrGeoModel,
  4354. data,
  4355. isVisualEncodedByVisualMap,
  4356. isGeo,
  4357. transformInfoRaw
  4358. };
  4359. if (geo.resourceType === "geoJSON") {
  4360. this._buildGeoJSON(viewBuildCtx);
  4361. } else if (geo.resourceType === "geoSVG") {
  4362. this._buildSVG(viewBuildCtx);
  4363. }
  4364. this._updateController(mapOrGeoModel, ecModel, api);
  4365. this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api, fromView);
  4366. };
  4367. MapDraw2.prototype._buildGeoJSON = function(viewBuildCtx) {
  4368. var regionsGroupByName = this._regionsGroupByName = createHashMap();
  4369. var regionsInfoByName = createHashMap();
  4370. var regionsGroup = this._regionsGroup;
  4371. var transformInfoRaw = viewBuildCtx.transformInfoRaw;
  4372. var mapOrGeoModel = viewBuildCtx.mapOrGeoModel;
  4373. var data = viewBuildCtx.data;
  4374. var projection = viewBuildCtx.geo.projection;
  4375. var projectionStream = projection && projection.stream;
  4376. function transformPoint(point, project) {
  4377. if (project) {
  4378. point = project(point);
  4379. }
  4380. return point && [point[0] * transformInfoRaw.scaleX + transformInfoRaw.x, point[1] * transformInfoRaw.scaleY + transformInfoRaw.y];
  4381. }
  4382. ;
  4383. function transformPolygonPoints(inPoints) {
  4384. var outPoints = [];
  4385. var project = !projectionStream && projection && projection.project;
  4386. for (var i = 0; i < inPoints.length; ++i) {
  4387. var newPt = transformPoint(inPoints[i], project);
  4388. newPt && outPoints.push(newPt);
  4389. }
  4390. return outPoints;
  4391. }
  4392. function getPolyShape(points3) {
  4393. return {
  4394. shape: {
  4395. points: transformPolygonPoints(points3)
  4396. }
  4397. };
  4398. }
  4399. regionsGroup.removeAll();
  4400. each(viewBuildCtx.geo.regions, function(region) {
  4401. var regionName = region.name;
  4402. var regionGroup = regionsGroupByName.get(regionName);
  4403. var _a = regionsInfoByName.get(regionName) || {}, dataIdx = _a.dataIdx, regionModel = _a.regionModel;
  4404. if (!regionGroup) {
  4405. regionGroup = regionsGroupByName.set(regionName, new Group_default());
  4406. regionsGroup.add(regionGroup);
  4407. dataIdx = data ? data.indexOfName(regionName) : null;
  4408. regionModel = viewBuildCtx.isGeo ? mapOrGeoModel.getRegionModel(regionName) : data ? data.getItemModel(dataIdx) : null;
  4409. regionsInfoByName.set(regionName, {
  4410. dataIdx,
  4411. regionModel
  4412. });
  4413. }
  4414. var polygonSubpaths = [];
  4415. var polylineSubpaths = [];
  4416. each(region.geometries, function(geometry) {
  4417. if (geometry.type === "polygon") {
  4418. var polys = [geometry.exterior].concat(geometry.interiors || []);
  4419. if (projectionStream) {
  4420. polys = projectPolys(polys, projectionStream);
  4421. }
  4422. each(polys, function(poly) {
  4423. polygonSubpaths.push(new Polygon_default(getPolyShape(poly)));
  4424. });
  4425. } else {
  4426. var points3 = geometry.points;
  4427. if (projectionStream) {
  4428. points3 = projectPolys(points3, projectionStream, true);
  4429. }
  4430. each(points3, function(points4) {
  4431. polylineSubpaths.push(new Polyline_default(getPolyShape(points4)));
  4432. });
  4433. }
  4434. });
  4435. var centerPt = transformPoint(region.getCenter(), projection && projection.project);
  4436. function createCompoundPath(subpaths, isLine) {
  4437. if (!subpaths.length) {
  4438. return;
  4439. }
  4440. var compoundPath = new CompoundPath_default({
  4441. culling: true,
  4442. segmentIgnoreThreshold: 1,
  4443. shape: {
  4444. paths: subpaths
  4445. }
  4446. });
  4447. regionGroup.add(compoundPath);
  4448. applyOptionStyleForRegion(viewBuildCtx, compoundPath, dataIdx, regionModel);
  4449. resetLabelForRegion(viewBuildCtx, compoundPath, regionName, regionModel, mapOrGeoModel, dataIdx, centerPt);
  4450. if (isLine) {
  4451. fixLineStyle(compoundPath);
  4452. each(compoundPath.states, fixLineStyle);
  4453. }
  4454. }
  4455. createCompoundPath(polygonSubpaths);
  4456. createCompoundPath(polylineSubpaths, true);
  4457. });
  4458. regionsGroupByName.each(function(regionGroup, regionName) {
  4459. var _a = regionsInfoByName.get(regionName), dataIdx = _a.dataIdx, regionModel = _a.regionModel;
  4460. resetEventTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel, dataIdx);
  4461. resetTooltipForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel);
  4462. resetStateTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel);
  4463. }, this);
  4464. };
  4465. MapDraw2.prototype._buildSVG = function(viewBuildCtx) {
  4466. var mapName = viewBuildCtx.geo.map;
  4467. var transformInfoRaw = viewBuildCtx.transformInfoRaw;
  4468. this._svgGroup.x = transformInfoRaw.x;
  4469. this._svgGroup.y = transformInfoRaw.y;
  4470. this._svgGroup.scaleX = transformInfoRaw.scaleX;
  4471. this._svgGroup.scaleY = transformInfoRaw.scaleY;
  4472. if (this._svgResourceChanged(mapName)) {
  4473. this._freeSVG();
  4474. this._useSVG(mapName);
  4475. }
  4476. var svgDispatcherMap = this._svgDispatcherMap = createHashMap();
  4477. var focusSelf = false;
  4478. each(this._svgGraphicRecord.named, function(namedItem) {
  4479. var regionName = namedItem.name;
  4480. var mapOrGeoModel = viewBuildCtx.mapOrGeoModel;
  4481. var data = viewBuildCtx.data;
  4482. var svgNodeTagLower = namedItem.svgNodeTagLower;
  4483. var el = namedItem.el;
  4484. var dataIdx = data ? data.indexOfName(regionName) : null;
  4485. var regionModel = mapOrGeoModel.getRegionModel(regionName);
  4486. if (OPTION_STYLE_ENABLED_TAG_MAP.get(svgNodeTagLower) != null && el instanceof Displayable_default) {
  4487. applyOptionStyleForRegion(viewBuildCtx, el, dataIdx, regionModel);
  4488. }
  4489. if (el instanceof Displayable_default) {
  4490. el.culling = true;
  4491. }
  4492. el.z2EmphasisLift = 0;
  4493. if (!namedItem.namedFrom) {
  4494. if (LABEL_HOST_MAP.get(svgNodeTagLower) != null) {
  4495. resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, null);
  4496. }
  4497. resetEventTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx);
  4498. resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel);
  4499. if (STATE_TRIGGER_TAG_MAP.get(svgNodeTagLower) != null) {
  4500. var focus_1 = resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel);
  4501. if (focus_1 === "self") {
  4502. focusSelf = true;
  4503. }
  4504. var els = svgDispatcherMap.get(regionName) || svgDispatcherMap.set(regionName, []);
  4505. els.push(el);
  4506. }
  4507. }
  4508. }, this);
  4509. this._enableBlurEntireSVG(focusSelf, viewBuildCtx);
  4510. };
  4511. MapDraw2.prototype._enableBlurEntireSVG = function(focusSelf, viewBuildCtx) {
  4512. if (focusSelf && viewBuildCtx.isGeo) {
  4513. var blurStyle = viewBuildCtx.mapOrGeoModel.getModel(["blur", "itemStyle"]).getItemStyle();
  4514. var opacity_1 = blurStyle.opacity;
  4515. this._svgGraphicRecord.root.traverse(function(el) {
  4516. if (!el.isGroup) {
  4517. setDefaultStateProxy(el);
  4518. var style = el.ensureState("blur").style || {};
  4519. if (style.opacity == null && opacity_1 != null) {
  4520. style.opacity = opacity_1;
  4521. }
  4522. el.ensureState("emphasis");
  4523. }
  4524. });
  4525. }
  4526. };
  4527. MapDraw2.prototype.remove = function() {
  4528. this._regionsGroup.removeAll();
  4529. this._regionsGroupByName = null;
  4530. this._svgGroup.removeAll();
  4531. this._freeSVG();
  4532. this._controller.dispose();
  4533. this._controllerHost = null;
  4534. };
  4535. MapDraw2.prototype.findHighDownDispatchers = function(name, geoModel) {
  4536. if (name == null) {
  4537. return [];
  4538. }
  4539. var geo = geoModel.coordinateSystem;
  4540. if (geo.resourceType === "geoJSON") {
  4541. var regionsGroupByName = this._regionsGroupByName;
  4542. if (regionsGroupByName) {
  4543. var regionGroup = regionsGroupByName.get(name);
  4544. return regionGroup ? [regionGroup] : [];
  4545. }
  4546. } else if (geo.resourceType === "geoSVG") {
  4547. return this._svgDispatcherMap && this._svgDispatcherMap.get(name) || [];
  4548. }
  4549. };
  4550. MapDraw2.prototype._svgResourceChanged = function(mapName) {
  4551. return this._svgMapName !== mapName;
  4552. };
  4553. MapDraw2.prototype._useSVG = function(mapName) {
  4554. var resource = geoSourceManager_default.getGeoResource(mapName);
  4555. if (resource && resource.type === "geoSVG") {
  4556. var svgGraphic = resource.useGraphic(this.uid);
  4557. this._svgGroup.add(svgGraphic.root);
  4558. this._svgGraphicRecord = svgGraphic;
  4559. this._svgMapName = mapName;
  4560. }
  4561. };
  4562. MapDraw2.prototype._freeSVG = function() {
  4563. var mapName = this._svgMapName;
  4564. if (mapName == null) {
  4565. return;
  4566. }
  4567. var resource = geoSourceManager_default.getGeoResource(mapName);
  4568. if (resource && resource.type === "geoSVG") {
  4569. resource.freeGraphic(this.uid);
  4570. }
  4571. this._svgGraphicRecord = null;
  4572. this._svgDispatcherMap = null;
  4573. this._svgGroup.removeAll();
  4574. this._svgMapName = null;
  4575. };
  4576. MapDraw2.prototype._updateController = function(mapOrGeoModel, ecModel, api) {
  4577. var geo = mapOrGeoModel.coordinateSystem;
  4578. var controller = this._controller;
  4579. var controllerHost = this._controllerHost;
  4580. controllerHost.zoomLimit = mapOrGeoModel.get("scaleLimit");
  4581. controllerHost.zoom = geo.getZoom();
  4582. controller.enable(mapOrGeoModel.get("roam") || false);
  4583. var mainType = mapOrGeoModel.mainType;
  4584. function makeActionBase() {
  4585. var action = {
  4586. type: "geoRoam",
  4587. componentType: mainType
  4588. };
  4589. action[mainType + "Id"] = mapOrGeoModel.id;
  4590. return action;
  4591. }
  4592. controller.off("pan").on("pan", function(e) {
  4593. this._mouseDownFlag = false;
  4594. updateViewOnPan(controllerHost, e.dx, e.dy);
  4595. api.dispatchAction(extend(makeActionBase(), {
  4596. dx: e.dx,
  4597. dy: e.dy,
  4598. animation: {
  4599. duration: 0
  4600. }
  4601. }));
  4602. }, this);
  4603. controller.off("zoom").on("zoom", function(e) {
  4604. this._mouseDownFlag = false;
  4605. updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);
  4606. api.dispatchAction(extend(makeActionBase(), {
  4607. zoom: e.scale,
  4608. originX: e.originX,
  4609. originY: e.originY,
  4610. animation: {
  4611. duration: 0
  4612. }
  4613. }));
  4614. }, this);
  4615. controller.setPointerChecker(function(e, x, y) {
  4616. return geo.containPoint([x, y]) && !onIrrelevantElement(e, api, mapOrGeoModel);
  4617. });
  4618. };
  4619. MapDraw2.prototype.resetForLabelLayout = function() {
  4620. this.group.traverse(function(el) {
  4621. var label = el.getTextContent();
  4622. if (label) {
  4623. label.ignore = mapLabelRaw(label).ignore;
  4624. }
  4625. });
  4626. };
  4627. MapDraw2.prototype._updateMapSelectHandler = function(mapOrGeoModel, regionsGroup, api, fromView) {
  4628. var mapDraw = this;
  4629. regionsGroup.off("mousedown");
  4630. regionsGroup.off("click");
  4631. if (mapOrGeoModel.get("selectedMode")) {
  4632. regionsGroup.on("mousedown", function() {
  4633. mapDraw._mouseDownFlag = true;
  4634. });
  4635. regionsGroup.on("click", function(e) {
  4636. if (!mapDraw._mouseDownFlag) {
  4637. return;
  4638. }
  4639. mapDraw._mouseDownFlag = false;
  4640. });
  4641. }
  4642. };
  4643. return MapDraw2;
  4644. }();
  4645. function applyOptionStyleForRegion(viewBuildCtx, el, dataIndex, regionModel) {
  4646. var normalStyleModel = regionModel.getModel("itemStyle");
  4647. var emphasisStyleModel = regionModel.getModel(["emphasis", "itemStyle"]);
  4648. var blurStyleModel = regionModel.getModel(["blur", "itemStyle"]);
  4649. var selectStyleModel = regionModel.getModel(["select", "itemStyle"]);
  4650. var normalStyle = getFixedItemStyle(normalStyleModel);
  4651. var emphasisStyle = getFixedItemStyle(emphasisStyleModel);
  4652. var selectStyle = getFixedItemStyle(selectStyleModel);
  4653. var blurStyle = getFixedItemStyle(blurStyleModel);
  4654. var data = viewBuildCtx.data;
  4655. if (data) {
  4656. var style = data.getItemVisual(dataIndex, "style");
  4657. var decal = data.getItemVisual(dataIndex, "decal");
  4658. if (viewBuildCtx.isVisualEncodedByVisualMap && style.fill) {
  4659. normalStyle.fill = style.fill;
  4660. }
  4661. if (decal) {
  4662. normalStyle.decal = createOrUpdatePatternFromDecal(decal, viewBuildCtx.api);
  4663. }
  4664. }
  4665. el.setStyle(normalStyle);
  4666. el.style.strokeNoScale = true;
  4667. el.ensureState("emphasis").style = emphasisStyle;
  4668. el.ensureState("select").style = selectStyle;
  4669. el.ensureState("blur").style = blurStyle;
  4670. setDefaultStateProxy(el);
  4671. }
  4672. function resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, labelXY) {
  4673. var data = viewBuildCtx.data;
  4674. var isGeo = viewBuildCtx.isGeo;
  4675. var isDataNaN = data && isNaN(data.get(data.mapDimension("value"), dataIdx));
  4676. var itemLayout = data && data.getItemLayout(dataIdx);
  4677. if (isGeo || isDataNaN || itemLayout && itemLayout.showLabel) {
  4678. var query = !isGeo ? dataIdx : regionName;
  4679. var labelFetcher = void 0;
  4680. if (!data || dataIdx >= 0) {
  4681. labelFetcher = mapOrGeoModel;
  4682. }
  4683. var specifiedTextOpt = labelXY ? {
  4684. normal: {
  4685. align: "center",
  4686. verticalAlign: "middle"
  4687. }
  4688. } : null;
  4689. setLabelStyle(el, getLabelStatesModels(regionModel), {
  4690. labelFetcher,
  4691. labelDataIndex: query,
  4692. defaultText: regionName
  4693. }, specifiedTextOpt);
  4694. var textEl = el.getTextContent();
  4695. if (textEl) {
  4696. mapLabelRaw(textEl).ignore = textEl.ignore;
  4697. if (el.textConfig && labelXY) {
  4698. var rect = el.getBoundingRect().clone();
  4699. el.textConfig.layoutRect = rect;
  4700. el.textConfig.position = [(labelXY[0] - rect.x) / rect.width * 100 + "%", (labelXY[1] - rect.y) / rect.height * 100 + "%"];
  4701. }
  4702. }
  4703. el.disableLabelAnimation = true;
  4704. } else {
  4705. el.removeTextContent();
  4706. el.removeTextConfig();
  4707. el.disableLabelAnimation = null;
  4708. }
  4709. }
  4710. function resetEventTriggerForRegion(viewBuildCtx, eventTrigger, regionName, regionModel, mapOrGeoModel, dataIdx) {
  4711. if (viewBuildCtx.data) {
  4712. viewBuildCtx.data.setItemGraphicEl(dataIdx, eventTrigger);
  4713. } else {
  4714. getECData(eventTrigger).eventData = {
  4715. componentType: "geo",
  4716. componentIndex: mapOrGeoModel.componentIndex,
  4717. geoIndex: mapOrGeoModel.componentIndex,
  4718. name: regionName,
  4719. region: regionModel && regionModel.option || {}
  4720. };
  4721. }
  4722. }
  4723. function resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {
  4724. if (!viewBuildCtx.data) {
  4725. setTooltipConfig({
  4726. el,
  4727. componentModel: mapOrGeoModel,
  4728. itemName: regionName,
  4729. itemTooltipOption: regionModel.get("tooltip")
  4730. });
  4731. }
  4732. }
  4733. function resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {
  4734. el.highDownSilentOnTouch = !!mapOrGeoModel.get("selectedMode");
  4735. var emphasisModel = regionModel.getModel("emphasis");
  4736. var focus = emphasisModel.get("focus");
  4737. toggleHoverEmphasis(el, focus, emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
  4738. if (viewBuildCtx.isGeo) {
  4739. enableComponentHighDownFeatures(el, mapOrGeoModel, regionName);
  4740. }
  4741. return focus;
  4742. }
  4743. function projectPolys(rings, createStream, isLine) {
  4744. var polygons = [];
  4745. var curPoly;
  4746. function startPolygon() {
  4747. curPoly = [];
  4748. }
  4749. function endPolygon() {
  4750. if (curPoly.length) {
  4751. polygons.push(curPoly);
  4752. curPoly = [];
  4753. }
  4754. }
  4755. var stream = createStream({
  4756. polygonStart: startPolygon,
  4757. polygonEnd: endPolygon,
  4758. lineStart: startPolygon,
  4759. lineEnd: endPolygon,
  4760. point: function(x, y) {
  4761. if (isFinite(x) && isFinite(y)) {
  4762. curPoly.push([x, y]);
  4763. }
  4764. },
  4765. sphere: function() {
  4766. }
  4767. });
  4768. !isLine && stream.polygonStart();
  4769. each(rings, function(ring) {
  4770. stream.lineStart();
  4771. for (var i = 0; i < ring.length; i++) {
  4772. stream.point(ring[i][0], ring[i][1]);
  4773. }
  4774. stream.lineEnd();
  4775. });
  4776. !isLine && stream.polygonEnd();
  4777. return polygons;
  4778. }
  4779. var MapDraw_default = MapDraw;
  4780. // node_modules/echarts/lib/component/geo/GeoView.js
  4781. var GeoView = function(_super) {
  4782. __extends(GeoView2, _super);
  4783. function GeoView2() {
  4784. var _this = _super !== null && _super.apply(this, arguments) || this;
  4785. _this.type = GeoView2.type;
  4786. _this.focusBlurEnabled = true;
  4787. return _this;
  4788. }
  4789. GeoView2.prototype.init = function(ecModel, api) {
  4790. this._api = api;
  4791. };
  4792. GeoView2.prototype.render = function(geoModel, ecModel, api, payload) {
  4793. this._model = geoModel;
  4794. if (!geoModel.get("show")) {
  4795. this._mapDraw && this._mapDraw.remove();
  4796. this._mapDraw = null;
  4797. return;
  4798. }
  4799. if (!this._mapDraw) {
  4800. this._mapDraw = new MapDraw_default(api);
  4801. }
  4802. var mapDraw = this._mapDraw;
  4803. mapDraw.draw(geoModel, ecModel, api, this, payload);
  4804. mapDraw.group.on("click", this._handleRegionClick, this);
  4805. mapDraw.group.silent = geoModel.get("silent");
  4806. this.group.add(mapDraw.group);
  4807. this.updateSelectStatus(geoModel, ecModel, api);
  4808. };
  4809. GeoView2.prototype._handleRegionClick = function(e) {
  4810. var eventData;
  4811. findEventDispatcher(e.target, function(current) {
  4812. return (eventData = getECData(current).eventData) != null;
  4813. }, true);
  4814. if (eventData) {
  4815. this._api.dispatchAction({
  4816. type: "geoToggleSelect",
  4817. geoId: this._model.id,
  4818. name: eventData.name
  4819. });
  4820. }
  4821. };
  4822. GeoView2.prototype.updateSelectStatus = function(model, ecModel, api) {
  4823. var _this = this;
  4824. this._mapDraw.group.traverse(function(node) {
  4825. var eventData = getECData(node).eventData;
  4826. if (eventData) {
  4827. _this._model.isSelected(eventData.name) ? api.enterSelect(node) : api.leaveSelect(node);
  4828. return true;
  4829. }
  4830. });
  4831. };
  4832. GeoView2.prototype.findHighDownDispatchers = function(name) {
  4833. return this._mapDraw && this._mapDraw.findHighDownDispatchers(name, this._model);
  4834. };
  4835. GeoView2.prototype.dispose = function() {
  4836. this._mapDraw && this._mapDraw.remove();
  4837. };
  4838. GeoView2.type = "geo";
  4839. return GeoView2;
  4840. }(Component_default2);
  4841. var GeoView_default = GeoView;
  4842. // node_modules/echarts/lib/component/geo/install.js
  4843. function registerMap(mapName, geoJson, specialAreas) {
  4844. geoSourceManager_default.registerMap(mapName, geoJson, specialAreas);
  4845. }
  4846. function install3(registers) {
  4847. registers.registerCoordinateSystem("geo", geoCreator_default);
  4848. registers.registerComponentModel(GeoModel_default);
  4849. registers.registerComponentView(GeoView_default);
  4850. registers.registerImpl("registerMap", registerMap);
  4851. registers.registerImpl("getMap", function(mapName) {
  4852. return geoSourceManager_default.getMapForUser(mapName);
  4853. });
  4854. function makeAction(method, actionInfo2) {
  4855. actionInfo2.update = "geo:updateSelectStatus";
  4856. registers.registerAction(actionInfo2, function(payload, ecModel) {
  4857. var selected = {};
  4858. var allSelected = [];
  4859. ecModel.eachComponent({
  4860. mainType: "geo",
  4861. query: payload
  4862. }, function(geoModel) {
  4863. geoModel[method](payload.name);
  4864. var geo = geoModel.coordinateSystem;
  4865. each(geo.regions, function(region) {
  4866. selected[region.name] = geoModel.isSelected(region.name) || false;
  4867. });
  4868. var names = [];
  4869. each(selected, function(v, name) {
  4870. selected[name] && names.push(name);
  4871. });
  4872. allSelected.push({
  4873. geoIndex: geoModel.componentIndex,
  4874. name: names
  4875. });
  4876. });
  4877. return {
  4878. selected,
  4879. allSelected,
  4880. name: payload.name
  4881. };
  4882. });
  4883. }
  4884. makeAction("toggleSelected", {
  4885. type: "geoToggleSelect",
  4886. event: "geoselectchanged"
  4887. });
  4888. makeAction("select", {
  4889. type: "geoSelect",
  4890. event: "geoselected"
  4891. });
  4892. makeAction("unSelect", {
  4893. type: "geoUnSelect",
  4894. event: "geounselected"
  4895. });
  4896. registers.registerAction({
  4897. type: "geoRoam",
  4898. event: "geoRoam",
  4899. update: "updateTransform"
  4900. }, function(payload, ecModel, api) {
  4901. var componentType = payload.componentType || "series";
  4902. ecModel.eachComponent({
  4903. mainType: componentType,
  4904. query: payload
  4905. }, function(componentModel) {
  4906. var geo = componentModel.coordinateSystem;
  4907. if (geo.type !== "geo") {
  4908. return;
  4909. }
  4910. var res = updateCenterAndZoom(geo, payload, componentModel.get("scaleLimit"), api);
  4911. componentModel.setCenter && componentModel.setCenter(res.center);
  4912. componentModel.setZoom && componentModel.setZoom(res.zoom);
  4913. if (componentType === "series") {
  4914. each(componentModel.seriesGroup, function(seriesModel) {
  4915. seriesModel.setCenter(res.center);
  4916. seriesModel.setZoom(res.zoom);
  4917. });
  4918. }
  4919. });
  4920. });
  4921. }
  4922. // node_modules/echarts/lib/component/parallel/install.js
  4923. init_define_APP_INFO();
  4924. // node_modules/echarts/lib/coord/parallel/parallelPreprocessor.js
  4925. init_define_APP_INFO();
  4926. function parallelPreprocessor(option) {
  4927. createParallelIfNeeded(option);
  4928. mergeAxisOptionFromParallel(option);
  4929. }
  4930. function createParallelIfNeeded(option) {
  4931. if (option.parallel) {
  4932. return;
  4933. }
  4934. var hasParallelSeries = false;
  4935. each(option.series, function(seriesOpt) {
  4936. if (seriesOpt && seriesOpt.type === "parallel") {
  4937. hasParallelSeries = true;
  4938. }
  4939. });
  4940. if (hasParallelSeries) {
  4941. option.parallel = [{}];
  4942. }
  4943. }
  4944. function mergeAxisOptionFromParallel(option) {
  4945. var axes = normalizeToArray(option.parallelAxis);
  4946. each(axes, function(axisOption) {
  4947. if (!isObject(axisOption)) {
  4948. return;
  4949. }
  4950. var parallelIndex = axisOption.parallelIndex || 0;
  4951. var parallelOption = normalizeToArray(option.parallel)[parallelIndex];
  4952. if (parallelOption && parallelOption.parallelAxisDefault) {
  4953. merge(axisOption, parallelOption.parallelAxisDefault, false);
  4954. }
  4955. });
  4956. }
  4957. // node_modules/echarts/lib/component/parallel/ParallelView.js
  4958. init_define_APP_INFO();
  4959. var CLICK_THRESHOLD = 5;
  4960. var ParallelView = function(_super) {
  4961. __extends(ParallelView2, _super);
  4962. function ParallelView2() {
  4963. var _this = _super !== null && _super.apply(this, arguments) || this;
  4964. _this.type = ParallelView2.type;
  4965. return _this;
  4966. }
  4967. ParallelView2.prototype.render = function(parallelModel, ecModel, api) {
  4968. this._model = parallelModel;
  4969. this._api = api;
  4970. if (!this._handlers) {
  4971. this._handlers = {};
  4972. each(handlers, function(handler, eventName) {
  4973. api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this));
  4974. }, this);
  4975. }
  4976. createOrUpdate(this, "_throttledDispatchExpand", parallelModel.get("axisExpandRate"), "fixRate");
  4977. };
  4978. ParallelView2.prototype.dispose = function(ecModel, api) {
  4979. clear(this, "_throttledDispatchExpand");
  4980. each(this._handlers, function(handler, eventName) {
  4981. api.getZr().off(eventName, handler);
  4982. });
  4983. this._handlers = null;
  4984. };
  4985. ParallelView2.prototype._throttledDispatchExpand = function(opt) {
  4986. this._dispatchExpand(opt);
  4987. };
  4988. ParallelView2.prototype._dispatchExpand = function(opt) {
  4989. opt && this._api.dispatchAction(extend({
  4990. type: "parallelAxisExpand"
  4991. }, opt));
  4992. };
  4993. ParallelView2.type = "parallel";
  4994. return ParallelView2;
  4995. }(Component_default2);
  4996. var handlers = {
  4997. mousedown: function(e) {
  4998. if (checkTrigger(this, "click")) {
  4999. this._mouseDownPoint = [e.offsetX, e.offsetY];
  5000. }
  5001. },
  5002. mouseup: function(e) {
  5003. var mouseDownPoint = this._mouseDownPoint;
  5004. if (checkTrigger(this, "click") && mouseDownPoint) {
  5005. var point = [e.offsetX, e.offsetY];
  5006. var dist = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2);
  5007. if (dist > CLICK_THRESHOLD) {
  5008. return;
  5009. }
  5010. var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);
  5011. result.behavior !== "none" && this._dispatchExpand({
  5012. axisExpandWindow: result.axisExpandWindow
  5013. });
  5014. }
  5015. this._mouseDownPoint = null;
  5016. },
  5017. mousemove: function(e) {
  5018. if (this._mouseDownPoint || !checkTrigger(this, "mousemove")) {
  5019. return;
  5020. }
  5021. var model = this._model;
  5022. var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);
  5023. var behavior = result.behavior;
  5024. behavior === "jump" && this._throttledDispatchExpand.debounceNextCall(model.get("axisExpandDebounce"));
  5025. this._throttledDispatchExpand(behavior === "none" ? null : {
  5026. axisExpandWindow: result.axisExpandWindow,
  5027. animation: behavior === "jump" ? null : {
  5028. duration: 0
  5029. }
  5030. });
  5031. }
  5032. };
  5033. function checkTrigger(view, triggerOn) {
  5034. var model = view._model;
  5035. return model.get("axisExpandable") && model.get("axisExpandTriggerOn") === triggerOn;
  5036. }
  5037. var ParallelView_default = ParallelView;
  5038. // node_modules/echarts/lib/coord/parallel/ParallelModel.js
  5039. init_define_APP_INFO();
  5040. var ParallelModel = function(_super) {
  5041. __extends(ParallelModel2, _super);
  5042. function ParallelModel2() {
  5043. var _this = _super !== null && _super.apply(this, arguments) || this;
  5044. _this.type = ParallelModel2.type;
  5045. return _this;
  5046. }
  5047. ParallelModel2.prototype.init = function() {
  5048. _super.prototype.init.apply(this, arguments);
  5049. this.mergeOption({});
  5050. };
  5051. ParallelModel2.prototype.mergeOption = function(newOption) {
  5052. var thisOption = this.option;
  5053. newOption && merge(thisOption, newOption, true);
  5054. this._initDimensions();
  5055. };
  5056. ParallelModel2.prototype.contains = function(model, ecModel) {
  5057. var parallelIndex = model.get("parallelIndex");
  5058. return parallelIndex != null && ecModel.getComponent("parallel", parallelIndex) === this;
  5059. };
  5060. ParallelModel2.prototype.setAxisExpand = function(opt) {
  5061. each(["axisExpandable", "axisExpandCenter", "axisExpandCount", "axisExpandWidth", "axisExpandWindow"], function(name) {
  5062. if (opt.hasOwnProperty(name)) {
  5063. this.option[name] = opt[name];
  5064. }
  5065. }, this);
  5066. };
  5067. ParallelModel2.prototype._initDimensions = function() {
  5068. var dimensions = this.dimensions = [];
  5069. var parallelAxisIndex = this.parallelAxisIndex = [];
  5070. var axisModels = filter(this.ecModel.queryComponents({
  5071. mainType: "parallelAxis"
  5072. }), function(axisModel) {
  5073. return (axisModel.get("parallelIndex") || 0) === this.componentIndex;
  5074. }, this);
  5075. each(axisModels, function(axisModel) {
  5076. dimensions.push("dim" + axisModel.get("dim"));
  5077. parallelAxisIndex.push(axisModel.componentIndex);
  5078. });
  5079. };
  5080. ParallelModel2.type = "parallel";
  5081. ParallelModel2.dependencies = ["parallelAxis"];
  5082. ParallelModel2.layoutMode = "box";
  5083. ParallelModel2.defaultOption = {
  5084. z: 0,
  5085. left: 80,
  5086. top: 60,
  5087. right: 80,
  5088. bottom: 60,
  5089. layout: "horizontal",
  5090. axisExpandable: false,
  5091. axisExpandCenter: null,
  5092. axisExpandCount: 0,
  5093. axisExpandWidth: 50,
  5094. axisExpandRate: 17,
  5095. axisExpandDebounce: 50,
  5096. axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],
  5097. axisExpandTriggerOn: "click",
  5098. parallelAxisDefault: null
  5099. };
  5100. return ParallelModel2;
  5101. }(Component_default);
  5102. var ParallelModel_default = ParallelModel;
  5103. // node_modules/echarts/lib/coord/parallel/parallelCreator.js
  5104. init_define_APP_INFO();
  5105. // node_modules/echarts/lib/coord/parallel/Parallel.js
  5106. init_define_APP_INFO();
  5107. // node_modules/echarts/lib/coord/parallel/ParallelAxis.js
  5108. init_define_APP_INFO();
  5109. var ParallelAxis = function(_super) {
  5110. __extends(ParallelAxis2, _super);
  5111. function ParallelAxis2(dim, scale2, coordExtent, axisType, axisIndex) {
  5112. var _this = _super.call(this, dim, scale2, coordExtent) || this;
  5113. _this.type = axisType || "value";
  5114. _this.axisIndex = axisIndex;
  5115. return _this;
  5116. }
  5117. ParallelAxis2.prototype.isHorizontal = function() {
  5118. return this.coordinateSystem.getModel().get("layout") !== "horizontal";
  5119. };
  5120. return ParallelAxis2;
  5121. }(Axis_default);
  5122. var ParallelAxis_default = ParallelAxis;
  5123. // node_modules/echarts/lib/component/helper/sliderMove.js
  5124. init_define_APP_INFO();
  5125. function sliderMove(delta, handleEnds, extent, handleIndex, minSpan, maxSpan) {
  5126. delta = delta || 0;
  5127. var extentSpan = extent[1] - extent[0];
  5128. if (minSpan != null) {
  5129. minSpan = restrict(minSpan, [0, extentSpan]);
  5130. }
  5131. if (maxSpan != null) {
  5132. maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0);
  5133. }
  5134. if (handleIndex === "all") {
  5135. var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);
  5136. handleSpan = restrict(handleSpan, [0, extentSpan]);
  5137. minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]);
  5138. handleIndex = 0;
  5139. }
  5140. handleEnds[0] = restrict(handleEnds[0], extent);
  5141. handleEnds[1] = restrict(handleEnds[1], extent);
  5142. var originalDistSign = getSpanSign(handleEnds, handleIndex);
  5143. handleEnds[handleIndex] += delta;
  5144. var extentMinSpan = minSpan || 0;
  5145. var realExtent = extent.slice();
  5146. originalDistSign.sign < 0 ? realExtent[0] += extentMinSpan : realExtent[1] -= extentMinSpan;
  5147. handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent);
  5148. var currDistSign;
  5149. currDistSign = getSpanSign(handleEnds, handleIndex);
  5150. if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) {
  5151. handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;
  5152. }
  5153. currDistSign = getSpanSign(handleEnds, handleIndex);
  5154. if (maxSpan != null && currDistSign.span > maxSpan) {
  5155. handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan;
  5156. }
  5157. return handleEnds;
  5158. }
  5159. function getSpanSign(handleEnds, handleIndex) {
  5160. var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex];
  5161. return {
  5162. span: Math.abs(dist),
  5163. sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1
  5164. };
  5165. }
  5166. function restrict(value, extend2) {
  5167. return Math.min(extend2[1] != null ? extend2[1] : Infinity, Math.max(extend2[0] != null ? extend2[0] : -Infinity, value));
  5168. }
  5169. // node_modules/echarts/lib/coord/parallel/Parallel.js
  5170. var each2 = each;
  5171. var mathMin = Math.min;
  5172. var mathMax = Math.max;
  5173. var mathFloor = Math.floor;
  5174. var mathCeil = Math.ceil;
  5175. var round2 = round;
  5176. var PI2 = Math.PI;
  5177. var Parallel = function() {
  5178. function Parallel2(parallelModel, ecModel, api) {
  5179. this.type = "parallel";
  5180. this._axesMap = createHashMap();
  5181. this._axesLayout = {};
  5182. this.dimensions = parallelModel.dimensions;
  5183. this._model = parallelModel;
  5184. this._init(parallelModel, ecModel, api);
  5185. }
  5186. Parallel2.prototype._init = function(parallelModel, ecModel, api) {
  5187. var dimensions = parallelModel.dimensions;
  5188. var parallelAxisIndex = parallelModel.parallelAxisIndex;
  5189. each2(dimensions, function(dim, idx) {
  5190. var axisIndex = parallelAxisIndex[idx];
  5191. var axisModel = ecModel.getComponent("parallelAxis", axisIndex);
  5192. var axis = this._axesMap.set(dim, new ParallelAxis_default(dim, createScaleByModel(axisModel), [0, 0], axisModel.get("type"), axisIndex));
  5193. var isCategory = axis.type === "category";
  5194. axis.onBand = isCategory && axisModel.get("boundaryGap");
  5195. axis.inverse = axisModel.get("inverse");
  5196. axisModel.axis = axis;
  5197. axis.model = axisModel;
  5198. axis.coordinateSystem = axisModel.coordinateSystem = this;
  5199. }, this);
  5200. };
  5201. Parallel2.prototype.update = function(ecModel, api) {
  5202. this._updateAxesFromSeries(this._model, ecModel);
  5203. };
  5204. Parallel2.prototype.containPoint = function(point) {
  5205. var layoutInfo = this._makeLayoutInfo();
  5206. var axisBase = layoutInfo.axisBase;
  5207. var layoutBase = layoutInfo.layoutBase;
  5208. var pixelDimIndex = layoutInfo.pixelDimIndex;
  5209. var pAxis = point[1 - pixelDimIndex];
  5210. var pLayout = point[pixelDimIndex];
  5211. return pAxis >= axisBase && pAxis <= axisBase + layoutInfo.axisLength && pLayout >= layoutBase && pLayout <= layoutBase + layoutInfo.layoutLength;
  5212. };
  5213. Parallel2.prototype.getModel = function() {
  5214. return this._model;
  5215. };
  5216. Parallel2.prototype._updateAxesFromSeries = function(parallelModel, ecModel) {
  5217. ecModel.eachSeries(function(seriesModel) {
  5218. if (!parallelModel.contains(seriesModel, ecModel)) {
  5219. return;
  5220. }
  5221. var data = seriesModel.getData();
  5222. each2(this.dimensions, function(dim) {
  5223. var axis = this._axesMap.get(dim);
  5224. axis.scale.unionExtentFromData(data, data.mapDimension(dim));
  5225. niceScaleExtent(axis.scale, axis.model);
  5226. }, this);
  5227. }, this);
  5228. };
  5229. Parallel2.prototype.resize = function(parallelModel, api) {
  5230. this._rect = getLayoutRect(parallelModel.getBoxLayoutParams(), {
  5231. width: api.getWidth(),
  5232. height: api.getHeight()
  5233. });
  5234. this._layoutAxes();
  5235. };
  5236. Parallel2.prototype.getRect = function() {
  5237. return this._rect;
  5238. };
  5239. Parallel2.prototype._makeLayoutInfo = function() {
  5240. var parallelModel = this._model;
  5241. var rect = this._rect;
  5242. var xy = ["x", "y"];
  5243. var wh = ["width", "height"];
  5244. var layout2 = parallelModel.get("layout");
  5245. var pixelDimIndex = layout2 === "horizontal" ? 0 : 1;
  5246. var layoutLength = rect[wh[pixelDimIndex]];
  5247. var layoutExtent = [0, layoutLength];
  5248. var axisCount = this.dimensions.length;
  5249. var axisExpandWidth = restrict2(parallelModel.get("axisExpandWidth"), layoutExtent);
  5250. var axisExpandCount = restrict2(parallelModel.get("axisExpandCount") || 0, [0, axisCount]);
  5251. var axisExpandable = parallelModel.get("axisExpandable") && axisCount > 3 && axisCount > axisExpandCount && axisExpandCount > 1 && axisExpandWidth > 0 && layoutLength > 0;
  5252. var axisExpandWindow = parallelModel.get("axisExpandWindow");
  5253. var winSize;
  5254. if (!axisExpandWindow) {
  5255. winSize = restrict2(axisExpandWidth * (axisExpandCount - 1), layoutExtent);
  5256. var axisExpandCenter = parallelModel.get("axisExpandCenter") || mathFloor(axisCount / 2);
  5257. axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2];
  5258. axisExpandWindow[1] = axisExpandWindow[0] + winSize;
  5259. } else {
  5260. winSize = restrict2(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent);
  5261. axisExpandWindow[1] = axisExpandWindow[0] + winSize;
  5262. }
  5263. var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount);
  5264. axisCollapseWidth < 3 && (axisCollapseWidth = 0);
  5265. var winInnerIndices = [mathFloor(round2(axisExpandWindow[0] / axisExpandWidth, 1)) + 1, mathCeil(round2(axisExpandWindow[1] / axisExpandWidth, 1)) - 1];
  5266. var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0];
  5267. return {
  5268. layout: layout2,
  5269. pixelDimIndex,
  5270. layoutBase: rect[xy[pixelDimIndex]],
  5271. layoutLength,
  5272. axisBase: rect[xy[1 - pixelDimIndex]],
  5273. axisLength: rect[wh[1 - pixelDimIndex]],
  5274. axisExpandable,
  5275. axisExpandWidth,
  5276. axisCollapseWidth,
  5277. axisExpandWindow,
  5278. axisCount,
  5279. winInnerIndices,
  5280. axisExpandWindow0Pos
  5281. };
  5282. };
  5283. Parallel2.prototype._layoutAxes = function() {
  5284. var rect = this._rect;
  5285. var axes = this._axesMap;
  5286. var dimensions = this.dimensions;
  5287. var layoutInfo = this._makeLayoutInfo();
  5288. var layout2 = layoutInfo.layout;
  5289. axes.each(function(axis) {
  5290. var axisExtent = [0, layoutInfo.axisLength];
  5291. var idx = axis.inverse ? 1 : 0;
  5292. axis.setExtent(axisExtent[idx], axisExtent[1 - idx]);
  5293. });
  5294. each2(dimensions, function(dim, idx) {
  5295. var posInfo = (layoutInfo.axisExpandable ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo);
  5296. var positionTable = {
  5297. horizontal: {
  5298. x: posInfo.position,
  5299. y: layoutInfo.axisLength
  5300. },
  5301. vertical: {
  5302. x: 0,
  5303. y: posInfo.position
  5304. }
  5305. };
  5306. var rotationTable = {
  5307. horizontal: PI2 / 2,
  5308. vertical: 0
  5309. };
  5310. var position = [positionTable[layout2].x + rect.x, positionTable[layout2].y + rect.y];
  5311. var rotation = rotationTable[layout2];
  5312. var transform = create();
  5313. rotate(transform, transform, rotation);
  5314. translate(transform, transform, position);
  5315. this._axesLayout[dim] = {
  5316. position,
  5317. rotation,
  5318. transform,
  5319. axisNameAvailableWidth: posInfo.axisNameAvailableWidth,
  5320. axisLabelShow: posInfo.axisLabelShow,
  5321. nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth,
  5322. tickDirection: 1,
  5323. labelDirection: 1
  5324. };
  5325. }, this);
  5326. };
  5327. Parallel2.prototype.getAxis = function(dim) {
  5328. return this._axesMap.get(dim);
  5329. };
  5330. Parallel2.prototype.dataToPoint = function(value, dim) {
  5331. return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim);
  5332. };
  5333. Parallel2.prototype.eachActiveState = function(data, callback, start, end) {
  5334. start == null && (start = 0);
  5335. end == null && (end = data.count());
  5336. var axesMap = this._axesMap;
  5337. var dimensions = this.dimensions;
  5338. var dataDimensions = [];
  5339. var axisModels = [];
  5340. each(dimensions, function(axisDim) {
  5341. dataDimensions.push(data.mapDimension(axisDim));
  5342. axisModels.push(axesMap.get(axisDim).model);
  5343. });
  5344. var hasActiveSet = this.hasAxisBrushed();
  5345. for (var dataIndex = start; dataIndex < end; dataIndex++) {
  5346. var activeState = void 0;
  5347. if (!hasActiveSet) {
  5348. activeState = "normal";
  5349. } else {
  5350. activeState = "active";
  5351. var values = data.getValues(dataDimensions, dataIndex);
  5352. for (var j = 0, lenj = dimensions.length; j < lenj; j++) {
  5353. var state = axisModels[j].getActiveState(values[j]);
  5354. if (state === "inactive") {
  5355. activeState = "inactive";
  5356. break;
  5357. }
  5358. }
  5359. }
  5360. callback(activeState, dataIndex);
  5361. }
  5362. };
  5363. Parallel2.prototype.hasAxisBrushed = function() {
  5364. var dimensions = this.dimensions;
  5365. var axesMap = this._axesMap;
  5366. var hasActiveSet = false;
  5367. for (var j = 0, lenj = dimensions.length; j < lenj; j++) {
  5368. if (axesMap.get(dimensions[j]).model.getActiveState() !== "normal") {
  5369. hasActiveSet = true;
  5370. }
  5371. }
  5372. return hasActiveSet;
  5373. };
  5374. Parallel2.prototype.axisCoordToPoint = function(coord, dim) {
  5375. var axisLayout = this._axesLayout[dim];
  5376. return applyTransform2([coord, 0], axisLayout.transform);
  5377. };
  5378. Parallel2.prototype.getAxisLayout = function(dim) {
  5379. return clone(this._axesLayout[dim]);
  5380. };
  5381. Parallel2.prototype.getSlidedAxisExpandWindow = function(point) {
  5382. var layoutInfo = this._makeLayoutInfo();
  5383. var pixelDimIndex = layoutInfo.pixelDimIndex;
  5384. var axisExpandWindow = layoutInfo.axisExpandWindow.slice();
  5385. var winSize = axisExpandWindow[1] - axisExpandWindow[0];
  5386. var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)];
  5387. if (!this.containPoint(point)) {
  5388. return {
  5389. behavior: "none",
  5390. axisExpandWindow
  5391. };
  5392. }
  5393. var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos;
  5394. var delta;
  5395. var behavior = "slide";
  5396. var axisCollapseWidth = layoutInfo.axisCollapseWidth;
  5397. var triggerArea = this._model.get("axisExpandSlideTriggerArea");
  5398. var useJump = triggerArea[0] != null;
  5399. if (axisCollapseWidth) {
  5400. if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) {
  5401. behavior = "jump";
  5402. delta = pointCoord - winSize * triggerArea[2];
  5403. } else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) {
  5404. behavior = "jump";
  5405. delta = pointCoord - winSize * (1 - triggerArea[2]);
  5406. } else {
  5407. (delta = pointCoord - winSize * triggerArea[1]) >= 0 && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0 && (delta = 0);
  5408. }
  5409. delta *= layoutInfo.axisExpandWidth / axisCollapseWidth;
  5410. delta ? sliderMove(delta, axisExpandWindow, extent, "all") : behavior = "none";
  5411. } else {
  5412. var winSize2 = axisExpandWindow[1] - axisExpandWindow[0];
  5413. var pos = extent[1] * pointCoord / winSize2;
  5414. axisExpandWindow = [mathMax(0, pos - winSize2 / 2)];
  5415. axisExpandWindow[1] = mathMin(extent[1], axisExpandWindow[0] + winSize2);
  5416. axisExpandWindow[0] = axisExpandWindow[1] - winSize2;
  5417. }
  5418. return {
  5419. axisExpandWindow,
  5420. behavior
  5421. };
  5422. };
  5423. return Parallel2;
  5424. }();
  5425. function restrict2(len, extent) {
  5426. return mathMin(mathMax(len, extent[0]), extent[1]);
  5427. }
  5428. function layoutAxisWithoutExpand(axisIndex, layoutInfo) {
  5429. var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1);
  5430. return {
  5431. position: step * axisIndex,
  5432. axisNameAvailableWidth: step,
  5433. axisLabelShow: true
  5434. };
  5435. }
  5436. function layoutAxisWithExpand(axisIndex, layoutInfo) {
  5437. var layoutLength = layoutInfo.layoutLength;
  5438. var axisExpandWidth = layoutInfo.axisExpandWidth;
  5439. var axisCount = layoutInfo.axisCount;
  5440. var axisCollapseWidth = layoutInfo.axisCollapseWidth;
  5441. var winInnerIndices = layoutInfo.winInnerIndices;
  5442. var position;
  5443. var axisNameAvailableWidth = axisCollapseWidth;
  5444. var axisLabelShow = false;
  5445. var nameTruncateMaxWidth;
  5446. if (axisIndex < winInnerIndices[0]) {
  5447. position = axisIndex * axisCollapseWidth;
  5448. nameTruncateMaxWidth = axisCollapseWidth;
  5449. } else if (axisIndex <= winInnerIndices[1]) {
  5450. position = layoutInfo.axisExpandWindow0Pos + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0];
  5451. axisNameAvailableWidth = axisExpandWidth;
  5452. axisLabelShow = true;
  5453. } else {
  5454. position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth;
  5455. nameTruncateMaxWidth = axisCollapseWidth;
  5456. }
  5457. return {
  5458. position,
  5459. axisNameAvailableWidth,
  5460. axisLabelShow,
  5461. nameTruncateMaxWidth
  5462. };
  5463. }
  5464. var Parallel_default = Parallel;
  5465. // node_modules/echarts/lib/coord/parallel/parallelCreator.js
  5466. function createParallelCoordSys(ecModel, api) {
  5467. var coordSysList = [];
  5468. ecModel.eachComponent("parallel", function(parallelModel, idx) {
  5469. var coordSys = new Parallel_default(parallelModel, ecModel, api);
  5470. coordSys.name = "parallel_" + idx;
  5471. coordSys.resize(parallelModel, api);
  5472. parallelModel.coordinateSystem = coordSys;
  5473. coordSys.model = parallelModel;
  5474. coordSysList.push(coordSys);
  5475. });
  5476. ecModel.eachSeries(function(seriesModel) {
  5477. if (seriesModel.get("coordinateSystem") === "parallel") {
  5478. var parallelModel = seriesModel.getReferringComponents("parallel", SINGLE_REFERRING).models[0];
  5479. seriesModel.coordinateSystem = parallelModel.coordinateSystem;
  5480. }
  5481. });
  5482. return coordSysList;
  5483. }
  5484. var parallelCoordSysCreator = {
  5485. create: createParallelCoordSys
  5486. };
  5487. var parallelCreator_default = parallelCoordSysCreator;
  5488. // node_modules/echarts/lib/coord/parallel/AxisModel.js
  5489. init_define_APP_INFO();
  5490. var ParallelAxisModel = function(_super) {
  5491. __extends(ParallelAxisModel2, _super);
  5492. function ParallelAxisModel2() {
  5493. var _this = _super !== null && _super.apply(this, arguments) || this;
  5494. _this.type = ParallelAxisModel2.type;
  5495. _this.activeIntervals = [];
  5496. return _this;
  5497. }
  5498. ParallelAxisModel2.prototype.getAreaSelectStyle = function() {
  5499. return makeStyleMapper([
  5500. ["fill", "color"],
  5501. ["lineWidth", "borderWidth"],
  5502. ["stroke", "borderColor"],
  5503. ["width", "width"],
  5504. ["opacity", "opacity"]
  5505. ])(this.getModel("areaSelectStyle"));
  5506. };
  5507. ParallelAxisModel2.prototype.setActiveIntervals = function(intervals) {
  5508. var activeIntervals = this.activeIntervals = clone(intervals);
  5509. if (activeIntervals) {
  5510. for (var i = activeIntervals.length - 1; i >= 0; i--) {
  5511. asc(activeIntervals[i]);
  5512. }
  5513. }
  5514. };
  5515. ParallelAxisModel2.prototype.getActiveState = function(value) {
  5516. var activeIntervals = this.activeIntervals;
  5517. if (!activeIntervals.length) {
  5518. return "normal";
  5519. }
  5520. if (value == null || isNaN(+value)) {
  5521. return "inactive";
  5522. }
  5523. if (activeIntervals.length === 1) {
  5524. var interval = activeIntervals[0];
  5525. if (interval[0] <= value && value <= interval[1]) {
  5526. return "active";
  5527. }
  5528. } else {
  5529. for (var i = 0, len = activeIntervals.length; i < len; i++) {
  5530. if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) {
  5531. return "active";
  5532. }
  5533. }
  5534. }
  5535. return "inactive";
  5536. };
  5537. return ParallelAxisModel2;
  5538. }(Component_default);
  5539. mixin(ParallelAxisModel, AxisModelCommonMixin);
  5540. var AxisModel_default = ParallelAxisModel;
  5541. // node_modules/echarts/lib/component/axis/ParallelAxisView.js
  5542. init_define_APP_INFO();
  5543. // node_modules/echarts/lib/component/helper/BrushController.js
  5544. init_define_APP_INFO();
  5545. var BRUSH_PANEL_GLOBAL = true;
  5546. var mathMin2 = Math.min;
  5547. var mathMax2 = Math.max;
  5548. var mathPow = Math.pow;
  5549. var COVER_Z = 1e4;
  5550. var UNSELECT_THRESHOLD = 6;
  5551. var MIN_RESIZE_LINE_WIDTH = 6;
  5552. var MUTEX_RESOURCE_KEY = "globalPan";
  5553. var DIRECTION_MAP = {
  5554. w: [0, 0],
  5555. e: [0, 1],
  5556. n: [1, 0],
  5557. s: [1, 1]
  5558. };
  5559. var CURSOR_MAP = {
  5560. w: "ew",
  5561. e: "ew",
  5562. n: "ns",
  5563. s: "ns",
  5564. ne: "nesw",
  5565. sw: "nesw",
  5566. nw: "nwse",
  5567. se: "nwse"
  5568. };
  5569. var DEFAULT_BRUSH_OPT = {
  5570. brushStyle: {
  5571. lineWidth: 2,
  5572. stroke: "rgba(210,219,238,0.3)",
  5573. fill: "#D2DBEE"
  5574. },
  5575. transformable: true,
  5576. brushMode: "single",
  5577. removeOnClick: false
  5578. };
  5579. var baseUID = 0;
  5580. var BrushController = function(_super) {
  5581. __extends(BrushController2, _super);
  5582. function BrushController2(zr) {
  5583. var _this = _super.call(this) || this;
  5584. _this._track = [];
  5585. _this._covers = [];
  5586. _this._handlers = {};
  5587. if (true) {
  5588. assert(zr);
  5589. }
  5590. _this._zr = zr;
  5591. _this.group = new Group_default();
  5592. _this._uid = "brushController_" + baseUID++;
  5593. each(pointerHandlers, function(handler, eventName) {
  5594. this._handlers[eventName] = bind(handler, this);
  5595. }, _this);
  5596. return _this;
  5597. }
  5598. BrushController2.prototype.enableBrush = function(brushOption) {
  5599. if (true) {
  5600. assert(this._mounted);
  5601. }
  5602. this._brushType && this._doDisableBrush();
  5603. brushOption.brushType && this._doEnableBrush(brushOption);
  5604. return this;
  5605. };
  5606. BrushController2.prototype._doEnableBrush = function(brushOption) {
  5607. var zr = this._zr;
  5608. if (!this._enableGlobalPan) {
  5609. take(zr, MUTEX_RESOURCE_KEY, this._uid);
  5610. }
  5611. each(this._handlers, function(handler, eventName) {
  5612. zr.on(eventName, handler);
  5613. });
  5614. this._brushType = brushOption.brushType;
  5615. this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true);
  5616. };
  5617. BrushController2.prototype._doDisableBrush = function() {
  5618. var zr = this._zr;
  5619. release(zr, MUTEX_RESOURCE_KEY, this._uid);
  5620. each(this._handlers, function(handler, eventName) {
  5621. zr.off(eventName, handler);
  5622. });
  5623. this._brushType = this._brushOption = null;
  5624. };
  5625. BrushController2.prototype.setPanels = function(panelOpts) {
  5626. if (panelOpts && panelOpts.length) {
  5627. var panels_1 = this._panels = {};
  5628. each(panelOpts, function(panelOpts2) {
  5629. panels_1[panelOpts2.panelId] = clone(panelOpts2);
  5630. });
  5631. } else {
  5632. this._panels = null;
  5633. }
  5634. return this;
  5635. };
  5636. BrushController2.prototype.mount = function(opt) {
  5637. opt = opt || {};
  5638. if (true) {
  5639. this._mounted = true;
  5640. }
  5641. this._enableGlobalPan = opt.enableGlobalPan;
  5642. var thisGroup = this.group;
  5643. this._zr.add(thisGroup);
  5644. thisGroup.attr({
  5645. x: opt.x || 0,
  5646. y: opt.y || 0,
  5647. rotation: opt.rotation || 0,
  5648. scaleX: opt.scaleX || 1,
  5649. scaleY: opt.scaleY || 1
  5650. });
  5651. this._transform = thisGroup.getLocalTransform();
  5652. return this;
  5653. };
  5654. BrushController2.prototype.updateCovers = function(coverConfigList) {
  5655. if (true) {
  5656. assert(this._mounted);
  5657. }
  5658. coverConfigList = map(coverConfigList, function(coverConfig) {
  5659. return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true);
  5660. });
  5661. var tmpIdPrefix = "\0-brush-index-";
  5662. var oldCovers = this._covers;
  5663. var newCovers = this._covers = [];
  5664. var controller = this;
  5665. var creatingCover = this._creatingCover;
  5666. new DataDiffer_default(oldCovers, coverConfigList, oldGetKey, getKey).add(addOrUpdate).update(addOrUpdate).remove(remove).execute();
  5667. return this;
  5668. function getKey(brushOption, index) {
  5669. return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index) + "-" + brushOption.brushType;
  5670. }
  5671. function oldGetKey(cover, index) {
  5672. return getKey(cover.__brushOption, index);
  5673. }
  5674. function addOrUpdate(newIndex, oldIndex) {
  5675. var newBrushInternal = coverConfigList[newIndex];
  5676. if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {
  5677. newCovers[newIndex] = oldCovers[oldIndex];
  5678. } else {
  5679. var cover = newCovers[newIndex] = oldIndex != null ? (oldCovers[oldIndex].__brushOption = newBrushInternal, oldCovers[oldIndex]) : endCreating(controller, createCover(controller, newBrushInternal));
  5680. updateCoverAfterCreation(controller, cover);
  5681. }
  5682. }
  5683. function remove(oldIndex) {
  5684. if (oldCovers[oldIndex] !== creatingCover) {
  5685. controller.group.remove(oldCovers[oldIndex]);
  5686. }
  5687. }
  5688. };
  5689. BrushController2.prototype.unmount = function() {
  5690. if (true) {
  5691. if (!this._mounted) {
  5692. return;
  5693. }
  5694. }
  5695. this.enableBrush(false);
  5696. clearCovers(this);
  5697. this._zr.remove(this.group);
  5698. if (true) {
  5699. this._mounted = false;
  5700. }
  5701. return this;
  5702. };
  5703. BrushController2.prototype.dispose = function() {
  5704. this.unmount();
  5705. this.off();
  5706. };
  5707. return BrushController2;
  5708. }(Eventful_default);
  5709. function createCover(controller, brushOption) {
  5710. var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);
  5711. cover.__brushOption = brushOption;
  5712. updateZ(cover, brushOption);
  5713. controller.group.add(cover);
  5714. return cover;
  5715. }
  5716. function endCreating(controller, creatingCover) {
  5717. var coverRenderer = getCoverRenderer(creatingCover);
  5718. if (coverRenderer.endCreating) {
  5719. coverRenderer.endCreating(controller, creatingCover);
  5720. updateZ(creatingCover, creatingCover.__brushOption);
  5721. }
  5722. return creatingCover;
  5723. }
  5724. function updateCoverShape(controller, cover) {
  5725. var brushOption = cover.__brushOption;
  5726. getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption);
  5727. }
  5728. function updateZ(cover, brushOption) {
  5729. var z = brushOption.z;
  5730. z == null && (z = COVER_Z);
  5731. cover.traverse(function(el) {
  5732. el.z = z;
  5733. el.z2 = z;
  5734. });
  5735. }
  5736. function updateCoverAfterCreation(controller, cover) {
  5737. getCoverRenderer(cover).updateCommon(controller, cover);
  5738. updateCoverShape(controller, cover);
  5739. }
  5740. function getCoverRenderer(cover) {
  5741. return coverRenderers[cover.__brushOption.brushType];
  5742. }
  5743. function getPanelByPoint(controller, e, localCursorPoint) {
  5744. var panels = controller._panels;
  5745. if (!panels) {
  5746. return BRUSH_PANEL_GLOBAL;
  5747. }
  5748. var panel;
  5749. var transform = controller._transform;
  5750. each(panels, function(pn) {
  5751. pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);
  5752. });
  5753. return panel;
  5754. }
  5755. function getPanelByCover(controller, cover) {
  5756. var panels = controller._panels;
  5757. if (!panels) {
  5758. return BRUSH_PANEL_GLOBAL;
  5759. }
  5760. var panelId = cover.__brushOption.panelId;
  5761. return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL;
  5762. }
  5763. function clearCovers(controller) {
  5764. var covers = controller._covers;
  5765. var originalLength = covers.length;
  5766. each(covers, function(cover) {
  5767. controller.group.remove(cover);
  5768. }, controller);
  5769. covers.length = 0;
  5770. return !!originalLength;
  5771. }
  5772. function trigger2(controller, opt) {
  5773. var areas = map(controller._covers, function(cover) {
  5774. var brushOption = cover.__brushOption;
  5775. var range = clone(brushOption.range);
  5776. return {
  5777. brushType: brushOption.brushType,
  5778. panelId: brushOption.panelId,
  5779. range
  5780. };
  5781. });
  5782. controller.trigger("brush", {
  5783. areas,
  5784. isEnd: !!opt.isEnd,
  5785. removeOnClick: !!opt.removeOnClick
  5786. });
  5787. }
  5788. function shouldShowCover(controller) {
  5789. var track = controller._track;
  5790. if (!track.length) {
  5791. return false;
  5792. }
  5793. var p2 = track[track.length - 1];
  5794. var p1 = track[0];
  5795. var dx = p2[0] - p1[0];
  5796. var dy = p2[1] - p1[1];
  5797. var dist = mathPow(dx * dx + dy * dy, 0.5);
  5798. return dist > UNSELECT_THRESHOLD;
  5799. }
  5800. function getTrackEnds(track) {
  5801. var tail = track.length - 1;
  5802. tail < 0 && (tail = 0);
  5803. return [track[0], track[tail]];
  5804. }
  5805. function createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) {
  5806. var cover = new Group_default();
  5807. cover.add(new Rect_default({
  5808. name: "main",
  5809. style: makeStyle(brushOption),
  5810. silent: true,
  5811. draggable: true,
  5812. cursor: "move",
  5813. drift: curry(driftRect, rectRangeConverter, controller, cover, ["n", "s", "w", "e"]),
  5814. ondragend: curry(trigger2, controller, {
  5815. isEnd: true
  5816. })
  5817. }));
  5818. each(edgeNameSequences, function(nameSequence) {
  5819. cover.add(new Rect_default({
  5820. name: nameSequence.join(""),
  5821. style: {
  5822. opacity: 0
  5823. },
  5824. draggable: true,
  5825. silent: true,
  5826. invisible: true,
  5827. drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence),
  5828. ondragend: curry(trigger2, controller, {
  5829. isEnd: true
  5830. })
  5831. }));
  5832. });
  5833. return cover;
  5834. }
  5835. function updateBaseRect(controller, cover, localRange, brushOption) {
  5836. var lineWidth = brushOption.brushStyle.lineWidth || 0;
  5837. var handleSize = mathMax2(lineWidth, MIN_RESIZE_LINE_WIDTH);
  5838. var x = localRange[0][0];
  5839. var y = localRange[1][0];
  5840. var xa = x - lineWidth / 2;
  5841. var ya = y - lineWidth / 2;
  5842. var x2 = localRange[0][1];
  5843. var y2 = localRange[1][1];
  5844. var x2a = x2 - handleSize + lineWidth / 2;
  5845. var y2a = y2 - handleSize + lineWidth / 2;
  5846. var width = x2 - x;
  5847. var height = y2 - y;
  5848. var widtha = width + lineWidth;
  5849. var heighta = height + lineWidth;
  5850. updateRectShape(controller, cover, "main", x, y, width, height);
  5851. if (brushOption.transformable) {
  5852. updateRectShape(controller, cover, "w", xa, ya, handleSize, heighta);
  5853. updateRectShape(controller, cover, "e", x2a, ya, handleSize, heighta);
  5854. updateRectShape(controller, cover, "n", xa, ya, widtha, handleSize);
  5855. updateRectShape(controller, cover, "s", xa, y2a, widtha, handleSize);
  5856. updateRectShape(controller, cover, "nw", xa, ya, handleSize, handleSize);
  5857. updateRectShape(controller, cover, "ne", x2a, ya, handleSize, handleSize);
  5858. updateRectShape(controller, cover, "sw", xa, y2a, handleSize, handleSize);
  5859. updateRectShape(controller, cover, "se", x2a, y2a, handleSize, handleSize);
  5860. }
  5861. }
  5862. function updateCommon(controller, cover) {
  5863. var brushOption = cover.__brushOption;
  5864. var transformable = brushOption.transformable;
  5865. var mainEl = cover.childAt(0);
  5866. mainEl.useStyle(makeStyle(brushOption));
  5867. mainEl.attr({
  5868. silent: !transformable,
  5869. cursor: transformable ? "move" : "default"
  5870. });
  5871. each([["w"], ["e"], ["n"], ["s"], ["s", "e"], ["s", "w"], ["n", "e"], ["n", "w"]], function(nameSequence) {
  5872. var el = cover.childOfName(nameSequence.join(""));
  5873. var globalDir = nameSequence.length === 1 ? getGlobalDirection1(controller, nameSequence[0]) : getGlobalDirection2(controller, nameSequence);
  5874. el && el.attr({
  5875. silent: !transformable,
  5876. invisible: !transformable,
  5877. cursor: transformable ? CURSOR_MAP[globalDir] + "-resize" : null
  5878. });
  5879. });
  5880. }
  5881. function updateRectShape(controller, cover, name, x, y, w, h) {
  5882. var el = cover.childOfName(name);
  5883. el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]])));
  5884. }
  5885. function makeStyle(brushOption) {
  5886. return defaults({
  5887. strokeNoScale: true
  5888. }, brushOption.brushStyle);
  5889. }
  5890. function formatRectRange(x, y, x2, y2) {
  5891. var min2 = [mathMin2(x, x2), mathMin2(y, y2)];
  5892. var max2 = [mathMax2(x, x2), mathMax2(y, y2)];
  5893. return [
  5894. [min2[0], max2[0]],
  5895. [min2[1], max2[1]]
  5896. ];
  5897. }
  5898. function getTransform2(controller) {
  5899. return getTransform(controller.group);
  5900. }
  5901. function getGlobalDirection1(controller, localDirName) {
  5902. var map2 = {
  5903. w: "left",
  5904. e: "right",
  5905. n: "top",
  5906. s: "bottom"
  5907. };
  5908. var inverseMap = {
  5909. left: "w",
  5910. right: "e",
  5911. top: "n",
  5912. bottom: "s"
  5913. };
  5914. var dir = transformDirection(map2[localDirName], getTransform2(controller));
  5915. return inverseMap[dir];
  5916. }
  5917. function getGlobalDirection2(controller, localDirNameSeq) {
  5918. var globalDir = [getGlobalDirection1(controller, localDirNameSeq[0]), getGlobalDirection1(controller, localDirNameSeq[1])];
  5919. (globalDir[0] === "e" || globalDir[0] === "w") && globalDir.reverse();
  5920. return globalDir.join("");
  5921. }
  5922. function driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) {
  5923. var brushOption = cover.__brushOption;
  5924. var rectRange = rectRangeConverter.toRectRange(brushOption.range);
  5925. var localDelta = toLocalDelta(controller, dx, dy);
  5926. each(dirNameSequence, function(dirName) {
  5927. var ind = DIRECTION_MAP[dirName];
  5928. rectRange[ind[0]][ind[1]] += localDelta[ind[0]];
  5929. });
  5930. brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]));
  5931. updateCoverAfterCreation(controller, cover);
  5932. trigger2(controller, {
  5933. isEnd: false
  5934. });
  5935. }
  5936. function driftPolygon(controller, cover, dx, dy) {
  5937. var range = cover.__brushOption.range;
  5938. var localDelta = toLocalDelta(controller, dx, dy);
  5939. each(range, function(point) {
  5940. point[0] += localDelta[0];
  5941. point[1] += localDelta[1];
  5942. });
  5943. updateCoverAfterCreation(controller, cover);
  5944. trigger2(controller, {
  5945. isEnd: false
  5946. });
  5947. }
  5948. function toLocalDelta(controller, dx, dy) {
  5949. var thisGroup = controller.group;
  5950. var localD = thisGroup.transformCoordToLocal(dx, dy);
  5951. var localZero = thisGroup.transformCoordToLocal(0, 0);
  5952. return [localD[0] - localZero[0], localD[1] - localZero[1]];
  5953. }
  5954. function clipByPanel(controller, cover, data) {
  5955. var panel = getPanelByCover(controller, cover);
  5956. return panel && panel !== BRUSH_PANEL_GLOBAL ? panel.clipPath(data, controller._transform) : clone(data);
  5957. }
  5958. function pointsToRect(points3) {
  5959. var xmin = mathMin2(points3[0][0], points3[1][0]);
  5960. var ymin = mathMin2(points3[0][1], points3[1][1]);
  5961. var xmax = mathMax2(points3[0][0], points3[1][0]);
  5962. var ymax = mathMax2(points3[0][1], points3[1][1]);
  5963. return {
  5964. x: xmin,
  5965. y: ymin,
  5966. width: xmax - xmin,
  5967. height: ymax - ymin
  5968. };
  5969. }
  5970. function resetCursor(controller, e, localCursorPoint) {
  5971. if (!controller._brushType || isOutsideZrArea(controller, e.offsetX, e.offsetY)) {
  5972. return;
  5973. }
  5974. var zr = controller._zr;
  5975. var covers = controller._covers;
  5976. var currPanel = getPanelByPoint(controller, e, localCursorPoint);
  5977. if (!controller._dragging) {
  5978. for (var i = 0; i < covers.length; i++) {
  5979. var brushOption = covers[i].__brushOption;
  5980. if (currPanel && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId) && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) {
  5981. return;
  5982. }
  5983. }
  5984. }
  5985. currPanel && zr.setCursorStyle("crosshair");
  5986. }
  5987. function preventDefault(e) {
  5988. var rawE = e.event;
  5989. rawE.preventDefault && rawE.preventDefault();
  5990. }
  5991. function mainShapeContain(cover, x, y) {
  5992. return cover.childOfName("main").contain(x, y);
  5993. }
  5994. function updateCoverByMouse(controller, e, localCursorPoint, isEnd) {
  5995. var creatingCover = controller._creatingCover;
  5996. var panel = controller._creatingPanel;
  5997. var thisBrushOption = controller._brushOption;
  5998. var eventParams;
  5999. controller._track.push(localCursorPoint.slice());
  6000. if (shouldShowCover(controller) || creatingCover) {
  6001. if (panel && !creatingCover) {
  6002. thisBrushOption.brushMode === "single" && clearCovers(controller);
  6003. var brushOption = clone(thisBrushOption);
  6004. brushOption.brushType = determineBrushType(brushOption.brushType, panel);
  6005. brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId;
  6006. creatingCover = controller._creatingCover = createCover(controller, brushOption);
  6007. controller._covers.push(creatingCover);
  6008. }
  6009. if (creatingCover) {
  6010. var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];
  6011. var coverBrushOption = creatingCover.__brushOption;
  6012. coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));
  6013. if (isEnd) {
  6014. endCreating(controller, creatingCover);
  6015. coverRenderer.updateCommon(controller, creatingCover);
  6016. }
  6017. updateCoverShape(controller, creatingCover);
  6018. eventParams = {
  6019. isEnd
  6020. };
  6021. }
  6022. } else if (isEnd && thisBrushOption.brushMode === "single" && thisBrushOption.removeOnClick) {
  6023. if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) {
  6024. eventParams = {
  6025. isEnd,
  6026. removeOnClick: true
  6027. };
  6028. }
  6029. }
  6030. return eventParams;
  6031. }
  6032. function determineBrushType(brushType, panel) {
  6033. if (brushType === "auto") {
  6034. if (true) {
  6035. assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is "atuo"');
  6036. }
  6037. return panel.defaultBrushType;
  6038. }
  6039. return brushType;
  6040. }
  6041. var pointerHandlers = {
  6042. mousedown: function(e) {
  6043. if (this._dragging) {
  6044. handleDragEnd(this, e);
  6045. } else if (!e.target || !e.target.draggable) {
  6046. preventDefault(e);
  6047. var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY);
  6048. this._creatingCover = null;
  6049. var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint);
  6050. if (panel) {
  6051. this._dragging = true;
  6052. this._track = [localCursorPoint.slice()];
  6053. }
  6054. }
  6055. },
  6056. mousemove: function(e) {
  6057. var x = e.offsetX;
  6058. var y = e.offsetY;
  6059. var localCursorPoint = this.group.transformCoordToLocal(x, y);
  6060. resetCursor(this, e, localCursorPoint);
  6061. if (this._dragging) {
  6062. preventDefault(e);
  6063. var eventParams = updateCoverByMouse(this, e, localCursorPoint, false);
  6064. eventParams && trigger2(this, eventParams);
  6065. }
  6066. },
  6067. mouseup: function(e) {
  6068. handleDragEnd(this, e);
  6069. }
  6070. };
  6071. function handleDragEnd(controller, e) {
  6072. if (controller._dragging) {
  6073. preventDefault(e);
  6074. var x = e.offsetX;
  6075. var y = e.offsetY;
  6076. var localCursorPoint = controller.group.transformCoordToLocal(x, y);
  6077. var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);
  6078. controller._dragging = false;
  6079. controller._track = [];
  6080. controller._creatingCover = null;
  6081. eventParams && trigger2(controller, eventParams);
  6082. }
  6083. }
  6084. function isOutsideZrArea(controller, x, y) {
  6085. var zr = controller._zr;
  6086. return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();
  6087. }
  6088. var coverRenderers = {
  6089. lineX: getLineRenderer(0),
  6090. lineY: getLineRenderer(1),
  6091. rect: {
  6092. createCover: function(controller, brushOption) {
  6093. function returnInput(range) {
  6094. return range;
  6095. }
  6096. return createBaseRectCover({
  6097. toRectRange: returnInput,
  6098. fromRectRange: returnInput
  6099. }, controller, brushOption, [["w"], ["e"], ["n"], ["s"], ["s", "e"], ["s", "w"], ["n", "e"], ["n", "w"]]);
  6100. },
  6101. getCreatingRange: function(localTrack) {
  6102. var ends = getTrackEnds(localTrack);
  6103. return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]);
  6104. },
  6105. updateCoverShape: function(controller, cover, localRange, brushOption) {
  6106. updateBaseRect(controller, cover, localRange, brushOption);
  6107. },
  6108. updateCommon,
  6109. contain: mainShapeContain
  6110. },
  6111. polygon: {
  6112. createCover: function(controller, brushOption) {
  6113. var cover = new Group_default();
  6114. cover.add(new Polyline_default({
  6115. name: "main",
  6116. style: makeStyle(brushOption),
  6117. silent: true
  6118. }));
  6119. return cover;
  6120. },
  6121. getCreatingRange: function(localTrack) {
  6122. return localTrack;
  6123. },
  6124. endCreating: function(controller, cover) {
  6125. cover.remove(cover.childAt(0));
  6126. cover.add(new Polygon_default({
  6127. name: "main",
  6128. draggable: true,
  6129. drift: curry(driftPolygon, controller, cover),
  6130. ondragend: curry(trigger2, controller, {
  6131. isEnd: true
  6132. })
  6133. }));
  6134. },
  6135. updateCoverShape: function(controller, cover, localRange, brushOption) {
  6136. cover.childAt(0).setShape({
  6137. points: clipByPanel(controller, cover, localRange)
  6138. });
  6139. },
  6140. updateCommon,
  6141. contain: mainShapeContain
  6142. }
  6143. };
  6144. function getLineRenderer(xyIndex) {
  6145. return {
  6146. createCover: function(controller, brushOption) {
  6147. return createBaseRectCover({
  6148. toRectRange: function(range) {
  6149. var rectRange = [range, [0, 100]];
  6150. xyIndex && rectRange.reverse();
  6151. return rectRange;
  6152. },
  6153. fromRectRange: function(rectRange) {
  6154. return rectRange[xyIndex];
  6155. }
  6156. }, controller, brushOption, [[["w"], ["e"]], [["n"], ["s"]]][xyIndex]);
  6157. },
  6158. getCreatingRange: function(localTrack) {
  6159. var ends = getTrackEnds(localTrack);
  6160. var min2 = mathMin2(ends[0][xyIndex], ends[1][xyIndex]);
  6161. var max2 = mathMax2(ends[0][xyIndex], ends[1][xyIndex]);
  6162. return [min2, max2];
  6163. },
  6164. updateCoverShape: function(controller, cover, localRange, brushOption) {
  6165. var otherExtent;
  6166. var panel = getPanelByCover(controller, cover);
  6167. if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) {
  6168. otherExtent = panel.getLinearBrushOtherExtent(xyIndex);
  6169. } else {
  6170. var zr = controller._zr;
  6171. otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];
  6172. }
  6173. var rectRange = [localRange, otherExtent];
  6174. xyIndex && rectRange.reverse();
  6175. updateBaseRect(controller, cover, rectRange, brushOption);
  6176. },
  6177. updateCommon,
  6178. contain: mainShapeContain
  6179. };
  6180. }
  6181. var BrushController_default = BrushController;
  6182. // node_modules/echarts/lib/component/helper/brushHelper.js
  6183. init_define_APP_INFO();
  6184. function makeRectPanelClipPath(rect) {
  6185. rect = normalizeRect(rect);
  6186. return function(localPoints) {
  6187. return clipPointsByRect(localPoints, rect);
  6188. };
  6189. }
  6190. function makeLinearBrushOtherExtent(rect, specifiedXYIndex) {
  6191. rect = normalizeRect(rect);
  6192. return function(xyIndex) {
  6193. var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;
  6194. var brushWidth = idx ? rect.width : rect.height;
  6195. var base = idx ? rect.x : rect.y;
  6196. return [base, base + (brushWidth || 0)];
  6197. };
  6198. }
  6199. function makeRectIsTargetByCursor(rect, api, targetModel) {
  6200. var boundingRect = normalizeRect(rect);
  6201. return function(e, localCursorPoint) {
  6202. return boundingRect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e, api, targetModel);
  6203. };
  6204. }
  6205. function normalizeRect(rect) {
  6206. return BoundingRect_default.create(rect);
  6207. }
  6208. // node_modules/echarts/lib/component/axis/ParallelAxisView.js
  6209. var elementList = ["axisLine", "axisTickLabel", "axisName"];
  6210. var ParallelAxisView = function(_super) {
  6211. __extends(ParallelAxisView2, _super);
  6212. function ParallelAxisView2() {
  6213. var _this = _super !== null && _super.apply(this, arguments) || this;
  6214. _this.type = ParallelAxisView2.type;
  6215. return _this;
  6216. }
  6217. ParallelAxisView2.prototype.init = function(ecModel, api) {
  6218. _super.prototype.init.apply(this, arguments);
  6219. (this._brushController = new BrushController_default(api.getZr())).on("brush", bind(this._onBrush, this));
  6220. };
  6221. ParallelAxisView2.prototype.render = function(axisModel, ecModel, api, payload) {
  6222. if (fromAxisAreaSelect(axisModel, ecModel, payload)) {
  6223. return;
  6224. }
  6225. this.axisModel = axisModel;
  6226. this.api = api;
  6227. this.group.removeAll();
  6228. var oldAxisGroup = this._axisGroup;
  6229. this._axisGroup = new Group_default();
  6230. this.group.add(this._axisGroup);
  6231. if (!axisModel.get("show")) {
  6232. return;
  6233. }
  6234. var coordSysModel = getCoordSysModel(axisModel, ecModel);
  6235. var coordSys = coordSysModel.coordinateSystem;
  6236. var areaSelectStyle = axisModel.getAreaSelectStyle();
  6237. var areaWidth = areaSelectStyle.width;
  6238. var dim = axisModel.axis.dim;
  6239. var axisLayout = coordSys.getAxisLayout(dim);
  6240. var builderOpt = extend({
  6241. strokeContainThreshold: areaWidth
  6242. }, axisLayout);
  6243. var axisBuilder = new AxisBuilder_default(axisModel, builderOpt);
  6244. each(elementList, axisBuilder.add, axisBuilder);
  6245. this._axisGroup.add(axisBuilder.getGroup());
  6246. this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api);
  6247. groupTransition(oldAxisGroup, this._axisGroup, axisModel);
  6248. };
  6249. ParallelAxisView2.prototype._refreshBrushController = function(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api) {
  6250. var extent = axisModel.axis.getExtent();
  6251. var extentLen = extent[1] - extent[0];
  6252. var extra = Math.min(30, Math.abs(extentLen) * 0.1);
  6253. var rect = BoundingRect_default.create({
  6254. x: extent[0],
  6255. y: -areaWidth / 2,
  6256. width: extentLen,
  6257. height: areaWidth
  6258. });
  6259. rect.x -= extra;
  6260. rect.width += 2 * extra;
  6261. this._brushController.mount({
  6262. enableGlobalPan: true,
  6263. rotation: builderOpt.rotation,
  6264. x: builderOpt.position[0],
  6265. y: builderOpt.position[1]
  6266. }).setPanels([{
  6267. panelId: "pl",
  6268. clipPath: makeRectPanelClipPath(rect),
  6269. isTargetByCursor: makeRectIsTargetByCursor(rect, api, coordSysModel),
  6270. getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect, 0)
  6271. }]).enableBrush({
  6272. brushType: "lineX",
  6273. brushStyle: areaSelectStyle,
  6274. removeOnClick: true
  6275. }).updateCovers(getCoverInfoList(axisModel));
  6276. };
  6277. ParallelAxisView2.prototype._onBrush = function(eventParam) {
  6278. var coverInfoList = eventParam.areas;
  6279. var axisModel = this.axisModel;
  6280. var axis = axisModel.axis;
  6281. var intervals = map(coverInfoList, function(coverInfo) {
  6282. return [axis.coordToData(coverInfo.range[0], true), axis.coordToData(coverInfo.range[1], true)];
  6283. });
  6284. if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) {
  6285. this.api.dispatchAction({
  6286. type: "axisAreaSelect",
  6287. parallelAxisId: axisModel.id,
  6288. intervals
  6289. });
  6290. }
  6291. };
  6292. ParallelAxisView2.prototype.dispose = function() {
  6293. this._brushController.dispose();
  6294. };
  6295. ParallelAxisView2.type = "parallelAxis";
  6296. return ParallelAxisView2;
  6297. }(Component_default2);
  6298. function fromAxisAreaSelect(axisModel, ecModel, payload) {
  6299. return payload && payload.type === "axisAreaSelect" && ecModel.findComponents({
  6300. mainType: "parallelAxis",
  6301. query: payload
  6302. })[0] === axisModel;
  6303. }
  6304. function getCoverInfoList(axisModel) {
  6305. var axis = axisModel.axis;
  6306. return map(axisModel.activeIntervals, function(interval) {
  6307. return {
  6308. brushType: "lineX",
  6309. panelId: "pl",
  6310. range: [axis.dataToCoord(interval[0], true), axis.dataToCoord(interval[1], true)]
  6311. };
  6312. });
  6313. }
  6314. function getCoordSysModel(axisModel, ecModel) {
  6315. return ecModel.getComponent("parallel", axisModel.get("parallelIndex"));
  6316. }
  6317. var ParallelAxisView_default = ParallelAxisView;
  6318. // node_modules/echarts/lib/component/axis/parallelAxisAction.js
  6319. init_define_APP_INFO();
  6320. var actionInfo = {
  6321. type: "axisAreaSelect",
  6322. event: "axisAreaSelected"
  6323. };
  6324. function installParallelActions(registers) {
  6325. registers.registerAction(actionInfo, function(payload, ecModel) {
  6326. ecModel.eachComponent({
  6327. mainType: "parallelAxis",
  6328. query: payload
  6329. }, function(parallelAxisModel) {
  6330. parallelAxisModel.axis.model.setActiveIntervals(payload.intervals);
  6331. });
  6332. });
  6333. registers.registerAction("parallelAxisExpand", function(payload, ecModel) {
  6334. ecModel.eachComponent({
  6335. mainType: "parallel",
  6336. query: payload
  6337. }, function(parallelModel) {
  6338. parallelModel.setAxisExpand(payload);
  6339. });
  6340. });
  6341. }
  6342. // node_modules/echarts/lib/component/parallel/install.js
  6343. var defaultAxisOption = {
  6344. type: "value",
  6345. areaSelectStyle: {
  6346. width: 20,
  6347. borderWidth: 1,
  6348. borderColor: "rgba(160,197,232)",
  6349. color: "rgba(160,197,232)",
  6350. opacity: 0.3
  6351. },
  6352. realtime: true,
  6353. z: 10
  6354. };
  6355. function install4(registers) {
  6356. registers.registerComponentView(ParallelView_default);
  6357. registers.registerComponentModel(ParallelModel_default);
  6358. registers.registerCoordinateSystem("parallel", parallelCreator_default);
  6359. registers.registerPreprocessor(parallelPreprocessor);
  6360. registers.registerComponentModel(AxisModel_default);
  6361. registers.registerComponentView(ParallelAxisView_default);
  6362. axisModelCreator(registers, "parallel", AxisModel_default, defaultAxisOption);
  6363. installParallelActions(registers);
  6364. }
  6365. // node_modules/echarts/lib/chart/helper/labelHelper.js
  6366. init_define_APP_INFO();
  6367. function getDefaultLabel(data, dataIndex) {
  6368. var labelDims = data.mapDimensionsAll("defaultedLabel");
  6369. var len = labelDims.length;
  6370. if (len === 1) {
  6371. var rawVal = retrieveRawValue(data, dataIndex, labelDims[0]);
  6372. return rawVal != null ? rawVal + "" : null;
  6373. } else if (len) {
  6374. var vals = [];
  6375. for (var i = 0; i < labelDims.length; i++) {
  6376. vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));
  6377. }
  6378. return vals.join(" ");
  6379. }
  6380. }
  6381. function getDefaultInterpolatedLabel(data, interpolatedValue) {
  6382. var labelDims = data.mapDimensionsAll("defaultedLabel");
  6383. if (!isArray(interpolatedValue)) {
  6384. return interpolatedValue + "";
  6385. }
  6386. var vals = [];
  6387. for (var i = 0; i < labelDims.length; i++) {
  6388. var dimIndex = data.getDimensionIndex(labelDims[i]);
  6389. if (dimIndex >= 0) {
  6390. vals.push(interpolatedValue[dimIndex]);
  6391. }
  6392. }
  6393. return vals.join(" ");
  6394. }
  6395. // node_modules/echarts/lib/chart/helper/Symbol.js
  6396. init_define_APP_INFO();
  6397. var Symbol = function(_super) {
  6398. __extends(Symbol2, _super);
  6399. function Symbol2(data, idx, seriesScope, opts) {
  6400. var _this = _super.call(this) || this;
  6401. _this.updateData(data, idx, seriesScope, opts);
  6402. return _this;
  6403. }
  6404. Symbol2.prototype._createSymbol = function(symbolType, data, idx, symbolSize, keepAspect) {
  6405. this.removeAll();
  6406. var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect);
  6407. symbolPath.attr({
  6408. z2: 100,
  6409. culling: true,
  6410. scaleX: symbolSize[0] / 2,
  6411. scaleY: symbolSize[1] / 2
  6412. });
  6413. symbolPath.drift = driftSymbol;
  6414. this._symbolType = symbolType;
  6415. this.add(symbolPath);
  6416. };
  6417. Symbol2.prototype.stopSymbolAnimation = function(toLastFrame) {
  6418. this.childAt(0).stopAnimation(null, toLastFrame);
  6419. };
  6420. Symbol2.prototype.getSymbolType = function() {
  6421. return this._symbolType;
  6422. };
  6423. Symbol2.prototype.getSymbolPath = function() {
  6424. return this.childAt(0);
  6425. };
  6426. Symbol2.prototype.highlight = function() {
  6427. enterEmphasis(this.childAt(0));
  6428. };
  6429. Symbol2.prototype.downplay = function() {
  6430. leaveEmphasis(this.childAt(0));
  6431. };
  6432. Symbol2.prototype.setZ = function(zlevel, z) {
  6433. var symbolPath = this.childAt(0);
  6434. symbolPath.zlevel = zlevel;
  6435. symbolPath.z = z;
  6436. };
  6437. Symbol2.prototype.setDraggable = function(draggable, hasCursorOption) {
  6438. var symbolPath = this.childAt(0);
  6439. symbolPath.draggable = draggable;
  6440. symbolPath.cursor = !hasCursorOption && draggable ? "move" : symbolPath.cursor;
  6441. };
  6442. Symbol2.prototype.updateData = function(data, idx, seriesScope, opts) {
  6443. this.silent = false;
  6444. var symbolType = data.getItemVisual(idx, "symbol") || "circle";
  6445. var seriesModel = data.hostModel;
  6446. var symbolSize = Symbol2.getSymbolSize(data, idx);
  6447. var isInit = symbolType !== this._symbolType;
  6448. var disableAnimation = opts && opts.disableAnimation;
  6449. if (isInit) {
  6450. var keepAspect = data.getItemVisual(idx, "symbolKeepAspect");
  6451. this._createSymbol(symbolType, data, idx, symbolSize, keepAspect);
  6452. } else {
  6453. var symbolPath = this.childAt(0);
  6454. symbolPath.silent = false;
  6455. var target = {
  6456. scaleX: symbolSize[0] / 2,
  6457. scaleY: symbolSize[1] / 2
  6458. };
  6459. disableAnimation ? symbolPath.attr(target) : updateProps(symbolPath, target, seriesModel, idx);
  6460. saveOldStyle(symbolPath);
  6461. }
  6462. this._updateCommon(data, idx, symbolSize, seriesScope, opts);
  6463. if (isInit) {
  6464. var symbolPath = this.childAt(0);
  6465. if (!disableAnimation) {
  6466. var target = {
  6467. scaleX: this._sizeX,
  6468. scaleY: this._sizeY,
  6469. style: {
  6470. opacity: symbolPath.style.opacity
  6471. }
  6472. };
  6473. symbolPath.scaleX = symbolPath.scaleY = 0;
  6474. symbolPath.style.opacity = 0;
  6475. initProps(symbolPath, target, seriesModel, idx);
  6476. }
  6477. }
  6478. if (disableAnimation) {
  6479. this.childAt(0).stopAnimation("leave");
  6480. }
  6481. };
  6482. Symbol2.prototype._updateCommon = function(data, idx, symbolSize, seriesScope, opts) {
  6483. var symbolPath = this.childAt(0);
  6484. var seriesModel = data.hostModel;
  6485. var emphasisItemStyle;
  6486. var blurItemStyle;
  6487. var selectItemStyle;
  6488. var focus;
  6489. var blurScope;
  6490. var emphasisDisabled;
  6491. var labelStatesModels;
  6492. var hoverScale;
  6493. var cursorStyle;
  6494. if (seriesScope) {
  6495. emphasisItemStyle = seriesScope.emphasisItemStyle;
  6496. blurItemStyle = seriesScope.blurItemStyle;
  6497. selectItemStyle = seriesScope.selectItemStyle;
  6498. focus = seriesScope.focus;
  6499. blurScope = seriesScope.blurScope;
  6500. labelStatesModels = seriesScope.labelStatesModels;
  6501. hoverScale = seriesScope.hoverScale;
  6502. cursorStyle = seriesScope.cursorStyle;
  6503. emphasisDisabled = seriesScope.emphasisDisabled;
  6504. }
  6505. if (!seriesScope || data.hasItemOption) {
  6506. var itemModel = seriesScope && seriesScope.itemModel ? seriesScope.itemModel : data.getItemModel(idx);
  6507. var emphasisModel = itemModel.getModel("emphasis");
  6508. emphasisItemStyle = emphasisModel.getModel("itemStyle").getItemStyle();
  6509. selectItemStyle = itemModel.getModel(["select", "itemStyle"]).getItemStyle();
  6510. blurItemStyle = itemModel.getModel(["blur", "itemStyle"]).getItemStyle();
  6511. focus = emphasisModel.get("focus");
  6512. blurScope = emphasisModel.get("blurScope");
  6513. emphasisDisabled = emphasisModel.get("disabled");
  6514. labelStatesModels = getLabelStatesModels(itemModel);
  6515. hoverScale = emphasisModel.getShallow("scale");
  6516. cursorStyle = itemModel.getShallow("cursor");
  6517. }
  6518. var symbolRotate = data.getItemVisual(idx, "symbolRotate");
  6519. symbolPath.attr("rotation", (symbolRotate || 0) * Math.PI / 180 || 0);
  6520. var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, "symbolOffset"), symbolSize);
  6521. if (symbolOffset) {
  6522. symbolPath.x = symbolOffset[0];
  6523. symbolPath.y = symbolOffset[1];
  6524. }
  6525. cursorStyle && symbolPath.attr("cursor", cursorStyle);
  6526. var symbolStyle = data.getItemVisual(idx, "style");
  6527. var visualColor = symbolStyle.fill;
  6528. if (symbolPath instanceof Image_default) {
  6529. var pathStyle = symbolPath.style;
  6530. symbolPath.useStyle(extend({
  6531. image: pathStyle.image,
  6532. x: pathStyle.x,
  6533. y: pathStyle.y,
  6534. width: pathStyle.width,
  6535. height: pathStyle.height
  6536. }, symbolStyle));
  6537. } else {
  6538. if (symbolPath.__isEmptyBrush) {
  6539. symbolPath.useStyle(extend({}, symbolStyle));
  6540. } else {
  6541. symbolPath.useStyle(symbolStyle);
  6542. }
  6543. symbolPath.style.decal = null;
  6544. symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);
  6545. symbolPath.style.strokeNoScale = true;
  6546. }
  6547. var liftZ = data.getItemVisual(idx, "liftZ");
  6548. var z2Origin = this._z2;
  6549. if (liftZ != null) {
  6550. if (z2Origin == null) {
  6551. this._z2 = symbolPath.z2;
  6552. symbolPath.z2 += liftZ;
  6553. }
  6554. } else if (z2Origin != null) {
  6555. symbolPath.z2 = z2Origin;
  6556. this._z2 = null;
  6557. }
  6558. var useNameLabel = opts && opts.useNameLabel;
  6559. setLabelStyle(symbolPath, labelStatesModels, {
  6560. labelFetcher: seriesModel,
  6561. labelDataIndex: idx,
  6562. defaultText: getLabelDefaultText,
  6563. inheritColor: visualColor,
  6564. defaultOpacity: symbolStyle.opacity
  6565. });
  6566. function getLabelDefaultText(idx2) {
  6567. return useNameLabel ? data.getName(idx2) : getDefaultLabel(data, idx2);
  6568. }
  6569. this._sizeX = symbolSize[0] / 2;
  6570. this._sizeY = symbolSize[1] / 2;
  6571. var emphasisState = symbolPath.ensureState("emphasis");
  6572. emphasisState.style = emphasisItemStyle;
  6573. symbolPath.ensureState("select").style = selectItemStyle;
  6574. symbolPath.ensureState("blur").style = blurItemStyle;
  6575. if (hoverScale) {
  6576. var scaleRatio = Math.max(isNumber(hoverScale) ? hoverScale : 1.1, 3 / this._sizeY);
  6577. emphasisState.scaleX = this._sizeX * scaleRatio;
  6578. emphasisState.scaleY = this._sizeY * scaleRatio;
  6579. }
  6580. this.setSymbolScale(1);
  6581. toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);
  6582. };
  6583. Symbol2.prototype.setSymbolScale = function(scale2) {
  6584. this.scaleX = this.scaleY = scale2;
  6585. };
  6586. Symbol2.prototype.fadeOut = function(cb, seriesModel, opt) {
  6587. var symbolPath = this.childAt(0);
  6588. var dataIndex = getECData(this).dataIndex;
  6589. var animationOpt = opt && opt.animation;
  6590. this.silent = symbolPath.silent = true;
  6591. if (opt && opt.fadeLabel) {
  6592. var textContent = symbolPath.getTextContent();
  6593. if (textContent) {
  6594. removeElement(textContent, {
  6595. style: {
  6596. opacity: 0
  6597. }
  6598. }, seriesModel, {
  6599. dataIndex,
  6600. removeOpt: animationOpt,
  6601. cb: function() {
  6602. symbolPath.removeTextContent();
  6603. }
  6604. });
  6605. }
  6606. } else {
  6607. symbolPath.removeTextContent();
  6608. }
  6609. removeElement(symbolPath, {
  6610. style: {
  6611. opacity: 0
  6612. },
  6613. scaleX: 0,
  6614. scaleY: 0
  6615. }, seriesModel, {
  6616. dataIndex,
  6617. cb,
  6618. removeOpt: animationOpt
  6619. });
  6620. };
  6621. Symbol2.getSymbolSize = function(data, idx) {
  6622. return normalizeSymbolSize(data.getItemVisual(idx, "symbolSize"));
  6623. };
  6624. return Symbol2;
  6625. }(Group_default);
  6626. function driftSymbol(dx, dy) {
  6627. this.parent.drift(dx, dy);
  6628. }
  6629. var Symbol_default = Symbol;
  6630. // node_modules/echarts/lib/chart/helper/SymbolDraw.js
  6631. init_define_APP_INFO();
  6632. function symbolNeedsDraw(data, point, idx, opt) {
  6633. return point && !isNaN(point[0]) && !isNaN(point[1]) && !(opt.isIgnore && opt.isIgnore(idx)) && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1])) && data.getItemVisual(idx, "symbol") !== "none";
  6634. }
  6635. function normalizeUpdateOpt(opt) {
  6636. if (opt != null && !isObject(opt)) {
  6637. opt = {
  6638. isIgnore: opt
  6639. };
  6640. }
  6641. return opt || {};
  6642. }
  6643. function makeSeriesScope(data) {
  6644. var seriesModel = data.hostModel;
  6645. var emphasisModel = seriesModel.getModel("emphasis");
  6646. return {
  6647. emphasisItemStyle: emphasisModel.getModel("itemStyle").getItemStyle(),
  6648. blurItemStyle: seriesModel.getModel(["blur", "itemStyle"]).getItemStyle(),
  6649. selectItemStyle: seriesModel.getModel(["select", "itemStyle"]).getItemStyle(),
  6650. focus: emphasisModel.get("focus"),
  6651. blurScope: emphasisModel.get("blurScope"),
  6652. emphasisDisabled: emphasisModel.get("disabled"),
  6653. hoverScale: emphasisModel.get("scale"),
  6654. labelStatesModels: getLabelStatesModels(seriesModel),
  6655. cursorStyle: seriesModel.get("cursor")
  6656. };
  6657. }
  6658. var SymbolDraw = function() {
  6659. function SymbolDraw2(SymbolCtor) {
  6660. this.group = new Group_default();
  6661. this._SymbolCtor = SymbolCtor || Symbol_default;
  6662. }
  6663. SymbolDraw2.prototype.updateData = function(data, opt) {
  6664. this._progressiveEls = null;
  6665. opt = normalizeUpdateOpt(opt);
  6666. var group = this.group;
  6667. var seriesModel = data.hostModel;
  6668. var oldData = this._data;
  6669. var SymbolCtor = this._SymbolCtor;
  6670. var disableAnimation = opt.disableAnimation;
  6671. var seriesScope = makeSeriesScope(data);
  6672. var symbolUpdateOpt = {
  6673. disableAnimation
  6674. };
  6675. var getSymbolPoint = opt.getSymbolPoint || function(idx) {
  6676. return data.getItemLayout(idx);
  6677. };
  6678. if (!oldData) {
  6679. group.removeAll();
  6680. }
  6681. data.diff(oldData).add(function(newIdx) {
  6682. var point = getSymbolPoint(newIdx);
  6683. if (symbolNeedsDraw(data, point, newIdx, opt)) {
  6684. var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);
  6685. symbolEl.setPosition(point);
  6686. data.setItemGraphicEl(newIdx, symbolEl);
  6687. group.add(symbolEl);
  6688. }
  6689. }).update(function(newIdx, oldIdx) {
  6690. var symbolEl = oldData.getItemGraphicEl(oldIdx);
  6691. var point = getSymbolPoint(newIdx);
  6692. if (!symbolNeedsDraw(data, point, newIdx, opt)) {
  6693. group.remove(symbolEl);
  6694. return;
  6695. }
  6696. var newSymbolType = data.getItemVisual(newIdx, "symbol") || "circle";
  6697. var oldSymbolType = symbolEl && symbolEl.getSymbolType && symbolEl.getSymbolType();
  6698. if (!symbolEl || oldSymbolType && oldSymbolType !== newSymbolType) {
  6699. group.remove(symbolEl);
  6700. symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);
  6701. symbolEl.setPosition(point);
  6702. } else {
  6703. symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);
  6704. var target = {
  6705. x: point[0],
  6706. y: point[1]
  6707. };
  6708. disableAnimation ? symbolEl.attr(target) : updateProps(symbolEl, target, seriesModel);
  6709. }
  6710. group.add(symbolEl);
  6711. data.setItemGraphicEl(newIdx, symbolEl);
  6712. }).remove(function(oldIdx) {
  6713. var el = oldData.getItemGraphicEl(oldIdx);
  6714. el && el.fadeOut(function() {
  6715. group.remove(el);
  6716. }, seriesModel);
  6717. }).execute();
  6718. this._getSymbolPoint = getSymbolPoint;
  6719. this._data = data;
  6720. };
  6721. ;
  6722. SymbolDraw2.prototype.updateLayout = function() {
  6723. var _this = this;
  6724. var data = this._data;
  6725. if (data) {
  6726. data.eachItemGraphicEl(function(el, idx) {
  6727. var point = _this._getSymbolPoint(idx);
  6728. el.setPosition(point);
  6729. el.markRedraw();
  6730. });
  6731. }
  6732. };
  6733. ;
  6734. SymbolDraw2.prototype.incrementalPrepareUpdate = function(data) {
  6735. this._seriesScope = makeSeriesScope(data);
  6736. this._data = null;
  6737. this.group.removeAll();
  6738. };
  6739. ;
  6740. SymbolDraw2.prototype.incrementalUpdate = function(taskParams, data, opt) {
  6741. this._progressiveEls = [];
  6742. opt = normalizeUpdateOpt(opt);
  6743. function updateIncrementalAndHover(el2) {
  6744. if (!el2.isGroup) {
  6745. el2.incremental = true;
  6746. el2.ensureState("emphasis").hoverLayer = true;
  6747. }
  6748. }
  6749. for (var idx = taskParams.start; idx < taskParams.end; idx++) {
  6750. var point = data.getItemLayout(idx);
  6751. if (symbolNeedsDraw(data, point, idx, opt)) {
  6752. var el = new this._SymbolCtor(data, idx, this._seriesScope);
  6753. el.traverse(updateIncrementalAndHover);
  6754. el.setPosition(point);
  6755. this.group.add(el);
  6756. data.setItemGraphicEl(idx, el);
  6757. this._progressiveEls.push(el);
  6758. }
  6759. }
  6760. };
  6761. ;
  6762. SymbolDraw2.prototype.eachRendered = function(cb) {
  6763. traverseElements(this._progressiveEls || this.group, cb);
  6764. };
  6765. SymbolDraw2.prototype.remove = function(enableAnimation) {
  6766. var group = this.group;
  6767. var data = this._data;
  6768. if (data && enableAnimation) {
  6769. data.eachItemGraphicEl(function(el) {
  6770. el.fadeOut(function() {
  6771. group.remove(el);
  6772. }, data.hostModel);
  6773. });
  6774. } else {
  6775. group.removeAll();
  6776. }
  6777. };
  6778. ;
  6779. return SymbolDraw2;
  6780. }();
  6781. var SymbolDraw_default = SymbolDraw;
  6782. // node_modules/echarts/lib/coord/CoordinateSystem.js
  6783. init_define_APP_INFO();
  6784. function isCoordinateSystemType(coordSys, type) {
  6785. return coordSys.type === type;
  6786. }
  6787. // node_modules/echarts/lib/visual/VisualMapping.js
  6788. init_define_APP_INFO();
  6789. var each3 = each;
  6790. var isObject2 = isObject;
  6791. var CATEGORY_DEFAULT_VISUAL_INDEX = -1;
  6792. var VisualMapping = function() {
  6793. function VisualMapping2(option) {
  6794. var mappingMethod = option.mappingMethod;
  6795. var visualType = option.type;
  6796. var thisOption = this.option = clone(option);
  6797. this.type = visualType;
  6798. this.mappingMethod = mappingMethod;
  6799. this._normalizeData = normalizers[mappingMethod];
  6800. var visualHandler = VisualMapping2.visualHandlers[visualType];
  6801. this.applyVisual = visualHandler.applyVisual;
  6802. this.getColorMapper = visualHandler.getColorMapper;
  6803. this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod];
  6804. if (mappingMethod === "piecewise") {
  6805. normalizeVisualRange(thisOption);
  6806. preprocessForPiecewise(thisOption);
  6807. } else if (mappingMethod === "category") {
  6808. thisOption.categories ? preprocessForSpecifiedCategory(thisOption) : normalizeVisualRange(thisOption, true);
  6809. } else {
  6810. assert(mappingMethod !== "linear" || thisOption.dataExtent);
  6811. normalizeVisualRange(thisOption);
  6812. }
  6813. }
  6814. VisualMapping2.prototype.mapValueToVisual = function(value) {
  6815. var normalized = this._normalizeData(value);
  6816. return this._normalizedToVisual(normalized, value);
  6817. };
  6818. VisualMapping2.prototype.getNormalizer = function() {
  6819. return bind(this._normalizeData, this);
  6820. };
  6821. VisualMapping2.listVisualTypes = function() {
  6822. return keys(VisualMapping2.visualHandlers);
  6823. };
  6824. VisualMapping2.isValidType = function(visualType) {
  6825. return VisualMapping2.visualHandlers.hasOwnProperty(visualType);
  6826. };
  6827. VisualMapping2.eachVisual = function(visual, callback, context) {
  6828. if (isObject(visual)) {
  6829. each(visual, callback, context);
  6830. } else {
  6831. callback.call(context, visual);
  6832. }
  6833. };
  6834. VisualMapping2.mapVisual = function(visual, callback, context) {
  6835. var isPrimary;
  6836. var newVisual = isArray(visual) ? [] : isObject(visual) ? {} : (isPrimary = true, null);
  6837. VisualMapping2.eachVisual(visual, function(v, key) {
  6838. var newVal = callback.call(context, v, key);
  6839. isPrimary ? newVisual = newVal : newVisual[key] = newVal;
  6840. });
  6841. return newVisual;
  6842. };
  6843. VisualMapping2.retrieveVisuals = function(obj) {
  6844. var ret = {};
  6845. var hasVisual;
  6846. obj && each3(VisualMapping2.visualHandlers, function(h, visualType) {
  6847. if (obj.hasOwnProperty(visualType)) {
  6848. ret[visualType] = obj[visualType];
  6849. hasVisual = true;
  6850. }
  6851. });
  6852. return hasVisual ? ret : null;
  6853. };
  6854. VisualMapping2.prepareVisualTypes = function(visualTypes) {
  6855. if (isArray(visualTypes)) {
  6856. visualTypes = visualTypes.slice();
  6857. } else if (isObject2(visualTypes)) {
  6858. var types_1 = [];
  6859. each3(visualTypes, function(item, type) {
  6860. types_1.push(type);
  6861. });
  6862. visualTypes = types_1;
  6863. } else {
  6864. return [];
  6865. }
  6866. visualTypes.sort(function(type1, type2) {
  6867. return type2 === "color" && type1 !== "color" && type1.indexOf("color") === 0 ? 1 : -1;
  6868. });
  6869. return visualTypes;
  6870. };
  6871. VisualMapping2.dependsOn = function(visualType1, visualType2) {
  6872. return visualType2 === "color" ? !!(visualType1 && visualType1.indexOf(visualType2) === 0) : visualType1 === visualType2;
  6873. };
  6874. VisualMapping2.findPieceIndex = function(value, pieceList, findClosestWhenOutside) {
  6875. var possibleI;
  6876. var abs = Infinity;
  6877. for (var i = 0, len = pieceList.length; i < len; i++) {
  6878. var pieceValue = pieceList[i].value;
  6879. if (pieceValue != null) {
  6880. if (pieceValue === value || isString(pieceValue) && pieceValue === value + "") {
  6881. return i;
  6882. }
  6883. findClosestWhenOutside && updatePossible(pieceValue, i);
  6884. }
  6885. }
  6886. for (var i = 0, len = pieceList.length; i < len; i++) {
  6887. var piece = pieceList[i];
  6888. var interval = piece.interval;
  6889. var close_1 = piece.close;
  6890. if (interval) {
  6891. if (interval[0] === -Infinity) {
  6892. if (littleThan(close_1[1], value, interval[1])) {
  6893. return i;
  6894. }
  6895. } else if (interval[1] === Infinity) {
  6896. if (littleThan(close_1[0], interval[0], value)) {
  6897. return i;
  6898. }
  6899. } else if (littleThan(close_1[0], interval[0], value) && littleThan(close_1[1], value, interval[1])) {
  6900. return i;
  6901. }
  6902. findClosestWhenOutside && updatePossible(interval[0], i);
  6903. findClosestWhenOutside && updatePossible(interval[1], i);
  6904. }
  6905. }
  6906. if (findClosestWhenOutside) {
  6907. return value === Infinity ? pieceList.length - 1 : value === -Infinity ? 0 : possibleI;
  6908. }
  6909. function updatePossible(val, index) {
  6910. var newAbs = Math.abs(val - value);
  6911. if (newAbs < abs) {
  6912. abs = newAbs;
  6913. possibleI = index;
  6914. }
  6915. }
  6916. };
  6917. VisualMapping2.visualHandlers = {
  6918. color: {
  6919. applyVisual: makeApplyVisual("color"),
  6920. getColorMapper: function() {
  6921. var thisOption = this.option;
  6922. return bind(thisOption.mappingMethod === "category" ? function(value, isNormalized) {
  6923. !isNormalized && (value = this._normalizeData(value));
  6924. return doMapCategory.call(this, value);
  6925. } : function(value, isNormalized, out) {
  6926. var returnRGBArray = !!out;
  6927. !isNormalized && (value = this._normalizeData(value));
  6928. out = fastLerp(value, thisOption.parsedVisual, out);
  6929. return returnRGBArray ? out : stringify(out, "rgba");
  6930. }, this);
  6931. },
  6932. _normalizedToVisual: {
  6933. linear: function(normalized) {
  6934. return stringify(fastLerp(normalized, this.option.parsedVisual), "rgba");
  6935. },
  6936. category: doMapCategory,
  6937. piecewise: function(normalized, value) {
  6938. var result = getSpecifiedVisual.call(this, value);
  6939. if (result == null) {
  6940. result = stringify(fastLerp(normalized, this.option.parsedVisual), "rgba");
  6941. }
  6942. return result;
  6943. },
  6944. fixed: doMapFixed
  6945. }
  6946. },
  6947. colorHue: makePartialColorVisualHandler(function(color, value) {
  6948. return modifyHSL(color, value);
  6949. }),
  6950. colorSaturation: makePartialColorVisualHandler(function(color, value) {
  6951. return modifyHSL(color, null, value);
  6952. }),
  6953. colorLightness: makePartialColorVisualHandler(function(color, value) {
  6954. return modifyHSL(color, null, null, value);
  6955. }),
  6956. colorAlpha: makePartialColorVisualHandler(function(color, value) {
  6957. return modifyAlpha(color, value);
  6958. }),
  6959. decal: {
  6960. applyVisual: makeApplyVisual("decal"),
  6961. _normalizedToVisual: {
  6962. linear: null,
  6963. category: doMapCategory,
  6964. piecewise: null,
  6965. fixed: null
  6966. }
  6967. },
  6968. opacity: {
  6969. applyVisual: makeApplyVisual("opacity"),
  6970. _normalizedToVisual: createNormalizedToNumericVisual([0, 1])
  6971. },
  6972. liftZ: {
  6973. applyVisual: makeApplyVisual("liftZ"),
  6974. _normalizedToVisual: {
  6975. linear: doMapFixed,
  6976. category: doMapFixed,
  6977. piecewise: doMapFixed,
  6978. fixed: doMapFixed
  6979. }
  6980. },
  6981. symbol: {
  6982. applyVisual: function(value, getter, setter) {
  6983. var symbolCfg = this.mapValueToVisual(value);
  6984. setter("symbol", symbolCfg);
  6985. },
  6986. _normalizedToVisual: {
  6987. linear: doMapToArray,
  6988. category: doMapCategory,
  6989. piecewise: function(normalized, value) {
  6990. var result = getSpecifiedVisual.call(this, value);
  6991. if (result == null) {
  6992. result = doMapToArray.call(this, normalized);
  6993. }
  6994. return result;
  6995. },
  6996. fixed: doMapFixed
  6997. }
  6998. },
  6999. symbolSize: {
  7000. applyVisual: makeApplyVisual("symbolSize"),
  7001. _normalizedToVisual: createNormalizedToNumericVisual([0, 1])
  7002. }
  7003. };
  7004. return VisualMapping2;
  7005. }();
  7006. function preprocessForPiecewise(thisOption) {
  7007. var pieceList = thisOption.pieceList;
  7008. thisOption.hasSpecialVisual = false;
  7009. each(pieceList, function(piece, index) {
  7010. piece.originIndex = index;
  7011. if (piece.visual != null) {
  7012. thisOption.hasSpecialVisual = true;
  7013. }
  7014. });
  7015. }
  7016. function preprocessForSpecifiedCategory(thisOption) {
  7017. var categories = thisOption.categories;
  7018. var categoryMap = thisOption.categoryMap = {};
  7019. var visual = thisOption.visual;
  7020. each3(categories, function(cate, index) {
  7021. categoryMap[cate] = index;
  7022. });
  7023. if (!isArray(visual)) {
  7024. var visualArr_1 = [];
  7025. if (isObject(visual)) {
  7026. each3(visual, function(v, cate) {
  7027. var index = categoryMap[cate];
  7028. visualArr_1[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v;
  7029. });
  7030. } else {
  7031. visualArr_1[CATEGORY_DEFAULT_VISUAL_INDEX] = visual;
  7032. }
  7033. visual = setVisualToOption(thisOption, visualArr_1);
  7034. }
  7035. for (var i = categories.length - 1; i >= 0; i--) {
  7036. if (visual[i] == null) {
  7037. delete categoryMap[categories[i]];
  7038. categories.pop();
  7039. }
  7040. }
  7041. }
  7042. function normalizeVisualRange(thisOption, isCategory) {
  7043. var visual = thisOption.visual;
  7044. var visualArr = [];
  7045. if (isObject(visual)) {
  7046. each3(visual, function(v) {
  7047. visualArr.push(v);
  7048. });
  7049. } else if (visual != null) {
  7050. visualArr.push(visual);
  7051. }
  7052. var doNotNeedPair = {
  7053. color: 1,
  7054. symbol: 1
  7055. };
  7056. if (!isCategory && visualArr.length === 1 && !doNotNeedPair.hasOwnProperty(thisOption.type)) {
  7057. visualArr[1] = visualArr[0];
  7058. }
  7059. setVisualToOption(thisOption, visualArr);
  7060. }
  7061. function makePartialColorVisualHandler(applyValue) {
  7062. return {
  7063. applyVisual: function(value, getter, setter) {
  7064. var colorChannel = this.mapValueToVisual(value);
  7065. setter("color", applyValue(getter("color"), colorChannel));
  7066. },
  7067. _normalizedToVisual: createNormalizedToNumericVisual([0, 1])
  7068. };
  7069. }
  7070. function doMapToArray(normalized) {
  7071. var visual = this.option.visual;
  7072. return visual[Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))] || {};
  7073. }
  7074. function makeApplyVisual(visualType) {
  7075. return function(value, getter, setter) {
  7076. setter(visualType, this.mapValueToVisual(value));
  7077. };
  7078. }
  7079. function doMapCategory(normalized) {
  7080. var visual = this.option.visual;
  7081. return visual[this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX ? normalized % visual.length : normalized];
  7082. }
  7083. function doMapFixed() {
  7084. return this.option.visual[0];
  7085. }
  7086. function createNormalizedToNumericVisual(sourceExtent) {
  7087. return {
  7088. linear: function(normalized) {
  7089. return linearMap(normalized, sourceExtent, this.option.visual, true);
  7090. },
  7091. category: doMapCategory,
  7092. piecewise: function(normalized, value) {
  7093. var result = getSpecifiedVisual.call(this, value);
  7094. if (result == null) {
  7095. result = linearMap(normalized, sourceExtent, this.option.visual, true);
  7096. }
  7097. return result;
  7098. },
  7099. fixed: doMapFixed
  7100. };
  7101. }
  7102. function getSpecifiedVisual(value) {
  7103. var thisOption = this.option;
  7104. var pieceList = thisOption.pieceList;
  7105. if (thisOption.hasSpecialVisual) {
  7106. var pieceIndex = VisualMapping.findPieceIndex(value, pieceList);
  7107. var piece = pieceList[pieceIndex];
  7108. if (piece && piece.visual) {
  7109. return piece.visual[this.type];
  7110. }
  7111. }
  7112. }
  7113. function setVisualToOption(thisOption, visualArr) {
  7114. thisOption.visual = visualArr;
  7115. if (thisOption.type === "color") {
  7116. thisOption.parsedVisual = map(visualArr, function(item) {
  7117. var color = parse(item);
  7118. if (!color && true) {
  7119. warn("'" + item + "' is an illegal color, fallback to '#000000'", true);
  7120. }
  7121. return color || [0, 0, 0, 1];
  7122. });
  7123. }
  7124. return visualArr;
  7125. }
  7126. var normalizers = {
  7127. linear: function(value) {
  7128. return linearMap(value, this.option.dataExtent, [0, 1], true);
  7129. },
  7130. piecewise: function(value) {
  7131. var pieceList = this.option.pieceList;
  7132. var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true);
  7133. if (pieceIndex != null) {
  7134. return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true);
  7135. }
  7136. },
  7137. category: function(value) {
  7138. var index = this.option.categories ? this.option.categoryMap[value] : value;
  7139. return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index;
  7140. },
  7141. fixed: noop
  7142. };
  7143. function littleThan(close, a, b) {
  7144. return close ? a <= b : a < b;
  7145. }
  7146. var VisualMapping_default = VisualMapping;
  7147. // node_modules/echarts/lib/chart/helper/Line.js
  7148. init_define_APP_INFO();
  7149. // node_modules/echarts/lib/chart/helper/LinePath.js
  7150. init_define_APP_INFO();
  7151. var straightLineProto = Line_default.prototype;
  7152. var bezierCurveProto = BezierCurve_default.prototype;
  7153. var StraightLineShape = function() {
  7154. function StraightLineShape2() {
  7155. this.x1 = 0;
  7156. this.y1 = 0;
  7157. this.x2 = 0;
  7158. this.y2 = 0;
  7159. this.percent = 1;
  7160. }
  7161. return StraightLineShape2;
  7162. }();
  7163. var CurveShape = function(_super) {
  7164. __extends(CurveShape2, _super);
  7165. function CurveShape2() {
  7166. return _super !== null && _super.apply(this, arguments) || this;
  7167. }
  7168. return CurveShape2;
  7169. }(StraightLineShape);
  7170. function isStraightLine(shape) {
  7171. return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);
  7172. }
  7173. var ECLinePath = function(_super) {
  7174. __extends(ECLinePath2, _super);
  7175. function ECLinePath2(opts) {
  7176. var _this = _super.call(this, opts) || this;
  7177. _this.type = "ec-line";
  7178. return _this;
  7179. }
  7180. ECLinePath2.prototype.getDefaultStyle = function() {
  7181. return {
  7182. stroke: "#000",
  7183. fill: null
  7184. };
  7185. };
  7186. ECLinePath2.prototype.getDefaultShape = function() {
  7187. return new StraightLineShape();
  7188. };
  7189. ECLinePath2.prototype.buildPath = function(ctx, shape) {
  7190. if (isStraightLine(shape)) {
  7191. straightLineProto.buildPath.call(this, ctx, shape);
  7192. } else {
  7193. bezierCurveProto.buildPath.call(this, ctx, shape);
  7194. }
  7195. };
  7196. ECLinePath2.prototype.pointAt = function(t) {
  7197. if (isStraightLine(this.shape)) {
  7198. return straightLineProto.pointAt.call(this, t);
  7199. } else {
  7200. return bezierCurveProto.pointAt.call(this, t);
  7201. }
  7202. };
  7203. ECLinePath2.prototype.tangentAt = function(t) {
  7204. var shape = this.shape;
  7205. var p = isStraightLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t);
  7206. return normalize(p, p);
  7207. };
  7208. return ECLinePath2;
  7209. }(Path_default);
  7210. var LinePath_default = ECLinePath;
  7211. // node_modules/echarts/lib/chart/helper/Line.js
  7212. var SYMBOL_CATEGORIES = ["fromSymbol", "toSymbol"];
  7213. function makeSymbolTypeKey(symbolCategory) {
  7214. return "_" + symbolCategory + "Type";
  7215. }
  7216. function createSymbol2(name, lineData, idx) {
  7217. var symbolType = lineData.getItemVisual(idx, name);
  7218. if (!symbolType || symbolType === "none") {
  7219. return;
  7220. }
  7221. var symbolSize = lineData.getItemVisual(idx, name + "Size");
  7222. var symbolRotate = lineData.getItemVisual(idx, name + "Rotate");
  7223. var symbolOffset = lineData.getItemVisual(idx, name + "Offset");
  7224. var symbolKeepAspect = lineData.getItemVisual(idx, name + "KeepAspect");
  7225. var symbolSizeArr = normalizeSymbolSize(symbolSize);
  7226. var symbolOffsetArr = normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);
  7227. var symbolPath = createSymbol(symbolType, -symbolSizeArr[0] / 2 + symbolOffsetArr[0], -symbolSizeArr[1] / 2 + symbolOffsetArr[1], symbolSizeArr[0], symbolSizeArr[1], null, symbolKeepAspect);
  7228. symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate) ? void 0 : +symbolRotate * Math.PI / 180 || 0;
  7229. symbolPath.name = name;
  7230. return symbolPath;
  7231. }
  7232. function createLine(points3) {
  7233. var line = new LinePath_default({
  7234. name: "line",
  7235. subPixelOptimize: true
  7236. });
  7237. setLinePoints(line.shape, points3);
  7238. return line;
  7239. }
  7240. function setLinePoints(targetShape, points3) {
  7241. targetShape.x1 = points3[0][0];
  7242. targetShape.y1 = points3[0][1];
  7243. targetShape.x2 = points3[1][0];
  7244. targetShape.y2 = points3[1][1];
  7245. targetShape.percent = 1;
  7246. var cp1 = points3[2];
  7247. if (cp1) {
  7248. targetShape.cpx1 = cp1[0];
  7249. targetShape.cpy1 = cp1[1];
  7250. } else {
  7251. targetShape.cpx1 = NaN;
  7252. targetShape.cpy1 = NaN;
  7253. }
  7254. }
  7255. var Line = function(_super) {
  7256. __extends(Line2, _super);
  7257. function Line2(lineData, idx, seriesScope) {
  7258. var _this = _super.call(this) || this;
  7259. _this._createLine(lineData, idx, seriesScope);
  7260. return _this;
  7261. }
  7262. Line2.prototype._createLine = function(lineData, idx, seriesScope) {
  7263. var seriesModel = lineData.hostModel;
  7264. var linePoints = lineData.getItemLayout(idx);
  7265. var line = createLine(linePoints);
  7266. line.shape.percent = 0;
  7267. initProps(line, {
  7268. shape: {
  7269. percent: 1
  7270. }
  7271. }, seriesModel, idx);
  7272. this.add(line);
  7273. each(SYMBOL_CATEGORIES, function(symbolCategory) {
  7274. var symbol = createSymbol2(symbolCategory, lineData, idx);
  7275. this.add(symbol);
  7276. this[makeSymbolTypeKey(symbolCategory)] = lineData.getItemVisual(idx, symbolCategory);
  7277. }, this);
  7278. this._updateCommonStl(lineData, idx, seriesScope);
  7279. };
  7280. Line2.prototype.updateData = function(lineData, idx, seriesScope) {
  7281. var seriesModel = lineData.hostModel;
  7282. var line = this.childOfName("line");
  7283. var linePoints = lineData.getItemLayout(idx);
  7284. var target = {
  7285. shape: {}
  7286. };
  7287. setLinePoints(target.shape, linePoints);
  7288. updateProps(line, target, seriesModel, idx);
  7289. each(SYMBOL_CATEGORIES, function(symbolCategory) {
  7290. var symbolType = lineData.getItemVisual(idx, symbolCategory);
  7291. var key = makeSymbolTypeKey(symbolCategory);
  7292. if (this[key] !== symbolType) {
  7293. this.remove(this.childOfName(symbolCategory));
  7294. var symbol = createSymbol2(symbolCategory, lineData, idx);
  7295. this.add(symbol);
  7296. }
  7297. this[key] = symbolType;
  7298. }, this);
  7299. this._updateCommonStl(lineData, idx, seriesScope);
  7300. };
  7301. ;
  7302. Line2.prototype.getLinePath = function() {
  7303. return this.childAt(0);
  7304. };
  7305. Line2.prototype._updateCommonStl = function(lineData, idx, seriesScope) {
  7306. var seriesModel = lineData.hostModel;
  7307. var line = this.childOfName("line");
  7308. var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;
  7309. var blurLineStyle = seriesScope && seriesScope.blurLineStyle;
  7310. var selectLineStyle = seriesScope && seriesScope.selectLineStyle;
  7311. var labelStatesModels = seriesScope && seriesScope.labelStatesModels;
  7312. var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled;
  7313. var focus = seriesScope && seriesScope.focus;
  7314. var blurScope = seriesScope && seriesScope.blurScope;
  7315. if (!seriesScope || lineData.hasItemOption) {
  7316. var itemModel = lineData.getItemModel(idx);
  7317. var emphasisModel = itemModel.getModel("emphasis");
  7318. emphasisLineStyle = emphasisModel.getModel("lineStyle").getLineStyle();
  7319. blurLineStyle = itemModel.getModel(["blur", "lineStyle"]).getLineStyle();
  7320. selectLineStyle = itemModel.getModel(["select", "lineStyle"]).getLineStyle();
  7321. emphasisDisabled = emphasisModel.get("disabled");
  7322. focus = emphasisModel.get("focus");
  7323. blurScope = emphasisModel.get("blurScope");
  7324. labelStatesModels = getLabelStatesModels(itemModel);
  7325. }
  7326. var lineStyle = lineData.getItemVisual(idx, "style");
  7327. var visualColor = lineStyle.stroke;
  7328. line.useStyle(lineStyle);
  7329. line.style.fill = null;
  7330. line.style.strokeNoScale = true;
  7331. line.ensureState("emphasis").style = emphasisLineStyle;
  7332. line.ensureState("blur").style = blurLineStyle;
  7333. line.ensureState("select").style = selectLineStyle;
  7334. each(SYMBOL_CATEGORIES, function(symbolCategory) {
  7335. var symbol = this.childOfName(symbolCategory);
  7336. if (symbol) {
  7337. symbol.setColor(visualColor);
  7338. symbol.style.opacity = lineStyle.opacity;
  7339. for (var i = 0; i < SPECIAL_STATES.length; i++) {
  7340. var stateName = SPECIAL_STATES[i];
  7341. var lineState = line.getState(stateName);
  7342. if (lineState) {
  7343. var lineStateStyle = lineState.style || {};
  7344. var state = symbol.ensureState(stateName);
  7345. var stateStyle = state.style || (state.style = {});
  7346. if (lineStateStyle.stroke != null) {
  7347. stateStyle[symbol.__isEmptyBrush ? "stroke" : "fill"] = lineStateStyle.stroke;
  7348. }
  7349. if (lineStateStyle.opacity != null) {
  7350. stateStyle.opacity = lineStateStyle.opacity;
  7351. }
  7352. }
  7353. }
  7354. symbol.markRedraw();
  7355. }
  7356. }, this);
  7357. var rawVal = seriesModel.getRawValue(idx);
  7358. setLabelStyle(this, labelStatesModels, {
  7359. labelDataIndex: idx,
  7360. labelFetcher: {
  7361. getFormattedLabel: function(dataIndex, stateName) {
  7362. return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType);
  7363. }
  7364. },
  7365. inheritColor: visualColor || "#000",
  7366. defaultOpacity: lineStyle.opacity,
  7367. defaultText: (rawVal == null ? lineData.getName(idx) : isFinite(rawVal) ? round(rawVal) : rawVal) + ""
  7368. });
  7369. var label = this.getTextContent();
  7370. if (label) {
  7371. var labelNormalModel = labelStatesModels.normal;
  7372. label.__align = label.style.align;
  7373. label.__verticalAlign = label.style.verticalAlign;
  7374. label.__position = labelNormalModel.get("position") || "middle";
  7375. var distance = labelNormalModel.get("distance");
  7376. if (!isArray(distance)) {
  7377. distance = [distance, distance];
  7378. }
  7379. label.__labelDistance = distance;
  7380. }
  7381. this.setTextConfig({
  7382. position: null,
  7383. local: true,
  7384. inside: false
  7385. });
  7386. toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);
  7387. };
  7388. Line2.prototype.highlight = function() {
  7389. enterEmphasis(this);
  7390. };
  7391. Line2.prototype.downplay = function() {
  7392. leaveEmphasis(this);
  7393. };
  7394. Line2.prototype.updateLayout = function(lineData, idx) {
  7395. this.setLinePoints(lineData.getItemLayout(idx));
  7396. };
  7397. Line2.prototype.setLinePoints = function(points3) {
  7398. var linePath = this.childOfName("line");
  7399. setLinePoints(linePath.shape, points3);
  7400. linePath.dirty();
  7401. };
  7402. Line2.prototype.beforeUpdate = function() {
  7403. var lineGroup = this;
  7404. var symbolFrom = lineGroup.childOfName("fromSymbol");
  7405. var symbolTo = lineGroup.childOfName("toSymbol");
  7406. var label = lineGroup.getTextContent();
  7407. if (!symbolFrom && !symbolTo && (!label || label.ignore)) {
  7408. return;
  7409. }
  7410. var invScale = 1;
  7411. var parentNode = this.parent;
  7412. while (parentNode) {
  7413. if (parentNode.scaleX) {
  7414. invScale /= parentNode.scaleX;
  7415. }
  7416. parentNode = parentNode.parent;
  7417. }
  7418. var line = lineGroup.childOfName("line");
  7419. if (!this.__dirty && !line.__dirty) {
  7420. return;
  7421. }
  7422. var percent = line.shape.percent;
  7423. var fromPos = line.pointAt(0);
  7424. var toPos = line.pointAt(percent);
  7425. var d = sub([], toPos, fromPos);
  7426. normalize(d, d);
  7427. function setSymbolRotation(symbol, percent2) {
  7428. var specifiedRotation = symbol.__specifiedRotation;
  7429. if (specifiedRotation == null) {
  7430. var tangent2 = line.tangentAt(percent2);
  7431. symbol.attr("rotation", (percent2 === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent2[1], tangent2[0]));
  7432. } else {
  7433. symbol.attr("rotation", specifiedRotation);
  7434. }
  7435. }
  7436. if (symbolFrom) {
  7437. symbolFrom.setPosition(fromPos);
  7438. setSymbolRotation(symbolFrom, 0);
  7439. symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent;
  7440. symbolFrom.markRedraw();
  7441. }
  7442. if (symbolTo) {
  7443. symbolTo.setPosition(toPos);
  7444. setSymbolRotation(symbolTo, 1);
  7445. symbolTo.scaleX = symbolTo.scaleY = invScale * percent;
  7446. symbolTo.markRedraw();
  7447. }
  7448. if (label && !label.ignore) {
  7449. label.x = label.y = 0;
  7450. label.originX = label.originY = 0;
  7451. var textAlign = void 0;
  7452. var textVerticalAlign = void 0;
  7453. var distance = label.__labelDistance;
  7454. var distanceX = distance[0] * invScale;
  7455. var distanceY = distance[1] * invScale;
  7456. var halfPercent = percent / 2;
  7457. var tangent = line.tangentAt(halfPercent);
  7458. var n = [tangent[1], -tangent[0]];
  7459. var cp = line.pointAt(halfPercent);
  7460. if (n[1] > 0) {
  7461. n[0] = -n[0];
  7462. n[1] = -n[1];
  7463. }
  7464. var dir = tangent[0] < 0 ? -1 : 1;
  7465. if (label.__position !== "start" && label.__position !== "end") {
  7466. var rotation = -Math.atan2(tangent[1], tangent[0]);
  7467. if (toPos[0] < fromPos[0]) {
  7468. rotation = Math.PI + rotation;
  7469. }
  7470. label.rotation = rotation;
  7471. }
  7472. var dy = void 0;
  7473. switch (label.__position) {
  7474. case "insideStartTop":
  7475. case "insideMiddleTop":
  7476. case "insideEndTop":
  7477. case "middle":
  7478. dy = -distanceY;
  7479. textVerticalAlign = "bottom";
  7480. break;
  7481. case "insideStartBottom":
  7482. case "insideMiddleBottom":
  7483. case "insideEndBottom":
  7484. dy = distanceY;
  7485. textVerticalAlign = "top";
  7486. break;
  7487. default:
  7488. dy = 0;
  7489. textVerticalAlign = "middle";
  7490. }
  7491. switch (label.__position) {
  7492. case "end":
  7493. label.x = d[0] * distanceX + toPos[0];
  7494. label.y = d[1] * distanceY + toPos[1];
  7495. textAlign = d[0] > 0.8 ? "left" : d[0] < -0.8 ? "right" : "center";
  7496. textVerticalAlign = d[1] > 0.8 ? "top" : d[1] < -0.8 ? "bottom" : "middle";
  7497. break;
  7498. case "start":
  7499. label.x = -d[0] * distanceX + fromPos[0];
  7500. label.y = -d[1] * distanceY + fromPos[1];
  7501. textAlign = d[0] > 0.8 ? "right" : d[0] < -0.8 ? "left" : "center";
  7502. textVerticalAlign = d[1] > 0.8 ? "bottom" : d[1] < -0.8 ? "top" : "middle";
  7503. break;
  7504. case "insideStartTop":
  7505. case "insideStart":
  7506. case "insideStartBottom":
  7507. label.x = distanceX * dir + fromPos[0];
  7508. label.y = fromPos[1] + dy;
  7509. textAlign = tangent[0] < 0 ? "right" : "left";
  7510. label.originX = -distanceX * dir;
  7511. label.originY = -dy;
  7512. break;
  7513. case "insideMiddleTop":
  7514. case "insideMiddle":
  7515. case "insideMiddleBottom":
  7516. case "middle":
  7517. label.x = cp[0];
  7518. label.y = cp[1] + dy;
  7519. textAlign = "center";
  7520. label.originY = -dy;
  7521. break;
  7522. case "insideEndTop":
  7523. case "insideEnd":
  7524. case "insideEndBottom":
  7525. label.x = -distanceX * dir + toPos[0];
  7526. label.y = toPos[1] + dy;
  7527. textAlign = tangent[0] >= 0 ? "right" : "left";
  7528. label.originX = distanceX * dir;
  7529. label.originY = -dy;
  7530. break;
  7531. }
  7532. label.scaleX = label.scaleY = invScale;
  7533. label.setStyle({
  7534. verticalAlign: label.__verticalAlign || textVerticalAlign,
  7535. align: label.__align || textAlign
  7536. });
  7537. }
  7538. };
  7539. return Line2;
  7540. }(Group_default);
  7541. var Line_default2 = Line;
  7542. // node_modules/echarts/lib/chart/helper/LineDraw.js
  7543. init_define_APP_INFO();
  7544. var LineDraw = function() {
  7545. function LineDraw2(LineCtor) {
  7546. this.group = new Group_default();
  7547. this._LineCtor = LineCtor || Line_default2;
  7548. }
  7549. LineDraw2.prototype.updateData = function(lineData) {
  7550. var _this = this;
  7551. this._progressiveEls = null;
  7552. var lineDraw = this;
  7553. var group = lineDraw.group;
  7554. var oldLineData = lineDraw._lineData;
  7555. lineDraw._lineData = lineData;
  7556. if (!oldLineData) {
  7557. group.removeAll();
  7558. }
  7559. var seriesScope = makeSeriesScope2(lineData);
  7560. lineData.diff(oldLineData).add(function(idx) {
  7561. _this._doAdd(lineData, idx, seriesScope);
  7562. }).update(function(newIdx, oldIdx) {
  7563. _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope);
  7564. }).remove(function(idx) {
  7565. group.remove(oldLineData.getItemGraphicEl(idx));
  7566. }).execute();
  7567. };
  7568. ;
  7569. LineDraw2.prototype.updateLayout = function() {
  7570. var lineData = this._lineData;
  7571. if (!lineData) {
  7572. return;
  7573. }
  7574. lineData.eachItemGraphicEl(function(el, idx) {
  7575. el.updateLayout(lineData, idx);
  7576. }, this);
  7577. };
  7578. ;
  7579. LineDraw2.prototype.incrementalPrepareUpdate = function(lineData) {
  7580. this._seriesScope = makeSeriesScope2(lineData);
  7581. this._lineData = null;
  7582. this.group.removeAll();
  7583. };
  7584. ;
  7585. LineDraw2.prototype.incrementalUpdate = function(taskParams, lineData) {
  7586. this._progressiveEls = [];
  7587. function updateIncrementalAndHover(el2) {
  7588. if (!el2.isGroup && !isEffectObject(el2)) {
  7589. el2.incremental = true;
  7590. el2.ensureState("emphasis").hoverLayer = true;
  7591. }
  7592. }
  7593. for (var idx = taskParams.start; idx < taskParams.end; idx++) {
  7594. var itemLayout = lineData.getItemLayout(idx);
  7595. if (lineNeedsDraw(itemLayout)) {
  7596. var el = new this._LineCtor(lineData, idx, this._seriesScope);
  7597. el.traverse(updateIncrementalAndHover);
  7598. this.group.add(el);
  7599. lineData.setItemGraphicEl(idx, el);
  7600. this._progressiveEls.push(el);
  7601. }
  7602. }
  7603. };
  7604. ;
  7605. LineDraw2.prototype.remove = function() {
  7606. this.group.removeAll();
  7607. };
  7608. ;
  7609. LineDraw2.prototype.eachRendered = function(cb) {
  7610. traverseElements(this._progressiveEls || this.group, cb);
  7611. };
  7612. LineDraw2.prototype._doAdd = function(lineData, idx, seriesScope) {
  7613. var itemLayout = lineData.getItemLayout(idx);
  7614. if (!lineNeedsDraw(itemLayout)) {
  7615. return;
  7616. }
  7617. var el = new this._LineCtor(lineData, idx, seriesScope);
  7618. lineData.setItemGraphicEl(idx, el);
  7619. this.group.add(el);
  7620. };
  7621. LineDraw2.prototype._doUpdate = function(oldLineData, newLineData, oldIdx, newIdx, seriesScope) {
  7622. var itemEl = oldLineData.getItemGraphicEl(oldIdx);
  7623. if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) {
  7624. this.group.remove(itemEl);
  7625. return;
  7626. }
  7627. if (!itemEl) {
  7628. itemEl = new this._LineCtor(newLineData, newIdx, seriesScope);
  7629. } else {
  7630. itemEl.updateData(newLineData, newIdx, seriesScope);
  7631. }
  7632. newLineData.setItemGraphicEl(newIdx, itemEl);
  7633. this.group.add(itemEl);
  7634. };
  7635. return LineDraw2;
  7636. }();
  7637. function isEffectObject(el) {
  7638. return el.animators && el.animators.length > 0;
  7639. }
  7640. function makeSeriesScope2(lineData) {
  7641. var hostModel = lineData.hostModel;
  7642. var emphasisModel = hostModel.getModel("emphasis");
  7643. return {
  7644. lineStyle: hostModel.getModel("lineStyle").getLineStyle(),
  7645. emphasisLineStyle: emphasisModel.getModel(["lineStyle"]).getLineStyle(),
  7646. blurLineStyle: hostModel.getModel(["blur", "lineStyle"]).getLineStyle(),
  7647. selectLineStyle: hostModel.getModel(["select", "lineStyle"]).getLineStyle(),
  7648. emphasisDisabled: emphasisModel.get("disabled"),
  7649. blurScope: emphasisModel.get("blurScope"),
  7650. focus: emphasisModel.get("focus"),
  7651. labelStatesModels: getLabelStatesModels(hostModel)
  7652. };
  7653. }
  7654. function isPointNaN(pt) {
  7655. return isNaN(pt[0]) || isNaN(pt[1]);
  7656. }
  7657. function lineNeedsDraw(pts) {
  7658. return pts && !isPointNaN(pts[0]) && !isPointNaN(pts[1]);
  7659. }
  7660. var LineDraw_default = LineDraw;
  7661. // node_modules/echarts/lib/util/styleCompat.js
  7662. init_define_APP_INFO();
  7663. var deprecatedLogs = {};
  7664. function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) {
  7665. return style && (style.legacy || style.legacy !== false && !hasOwnTextContentOption && !hasOwnTextConfig && elType !== "tspan" && (elType === "text" || hasOwn(style, "text")));
  7666. }
  7667. function convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) {
  7668. var srcStyle = hostStyle;
  7669. var textConfig;
  7670. var textContent;
  7671. var textContentStyle;
  7672. if (elType === "text") {
  7673. textContentStyle = srcStyle;
  7674. } else {
  7675. textContentStyle = {};
  7676. hasOwn(srcStyle, "text") && (textContentStyle.text = srcStyle.text);
  7677. hasOwn(srcStyle, "rich") && (textContentStyle.rich = srcStyle.rich);
  7678. hasOwn(srcStyle, "textFill") && (textContentStyle.fill = srcStyle.textFill);
  7679. hasOwn(srcStyle, "textStroke") && (textContentStyle.stroke = srcStyle.textStroke);
  7680. hasOwn(srcStyle, "fontFamily") && (textContentStyle.fontFamily = srcStyle.fontFamily);
  7681. hasOwn(srcStyle, "fontSize") && (textContentStyle.fontSize = srcStyle.fontSize);
  7682. hasOwn(srcStyle, "fontStyle") && (textContentStyle.fontStyle = srcStyle.fontStyle);
  7683. hasOwn(srcStyle, "fontWeight") && (textContentStyle.fontWeight = srcStyle.fontWeight);
  7684. textContent = {
  7685. type: "text",
  7686. style: textContentStyle,
  7687. silent: true
  7688. };
  7689. textConfig = {};
  7690. var hasOwnPos = hasOwn(srcStyle, "textPosition");
  7691. if (isNormal) {
  7692. textConfig.position = hasOwnPos ? srcStyle.textPosition : "inside";
  7693. } else {
  7694. hasOwnPos && (textConfig.position = srcStyle.textPosition);
  7695. }
  7696. hasOwn(srcStyle, "textPosition") && (textConfig.position = srcStyle.textPosition);
  7697. hasOwn(srcStyle, "textOffset") && (textConfig.offset = srcStyle.textOffset);
  7698. hasOwn(srcStyle, "textRotation") && (textConfig.rotation = srcStyle.textRotation);
  7699. hasOwn(srcStyle, "textDistance") && (textConfig.distance = srcStyle.textDistance);
  7700. }
  7701. convertEC4CompatibleRichItem(textContentStyle, hostStyle);
  7702. each(textContentStyle.rich, function(richItem) {
  7703. convertEC4CompatibleRichItem(richItem, richItem);
  7704. });
  7705. return {
  7706. textConfig,
  7707. textContent
  7708. };
  7709. }
  7710. function convertEC4CompatibleRichItem(out, richItem) {
  7711. if (!richItem) {
  7712. return;
  7713. }
  7714. richItem.font = richItem.textFont || richItem.font;
  7715. hasOwn(richItem, "textStrokeWidth") && (out.lineWidth = richItem.textStrokeWidth);
  7716. hasOwn(richItem, "textAlign") && (out.align = richItem.textAlign);
  7717. hasOwn(richItem, "textVerticalAlign") && (out.verticalAlign = richItem.textVerticalAlign);
  7718. hasOwn(richItem, "textLineHeight") && (out.lineHeight = richItem.textLineHeight);
  7719. hasOwn(richItem, "textWidth") && (out.width = richItem.textWidth);
  7720. hasOwn(richItem, "textHeight") && (out.height = richItem.textHeight);
  7721. hasOwn(richItem, "textBackgroundColor") && (out.backgroundColor = richItem.textBackgroundColor);
  7722. hasOwn(richItem, "textPadding") && (out.padding = richItem.textPadding);
  7723. hasOwn(richItem, "textBorderColor") && (out.borderColor = richItem.textBorderColor);
  7724. hasOwn(richItem, "textBorderWidth") && (out.borderWidth = richItem.textBorderWidth);
  7725. hasOwn(richItem, "textBorderRadius") && (out.borderRadius = richItem.textBorderRadius);
  7726. hasOwn(richItem, "textBoxShadowColor") && (out.shadowColor = richItem.textBoxShadowColor);
  7727. hasOwn(richItem, "textBoxShadowBlur") && (out.shadowBlur = richItem.textBoxShadowBlur);
  7728. hasOwn(richItem, "textBoxShadowOffsetX") && (out.shadowOffsetX = richItem.textBoxShadowOffsetX);
  7729. hasOwn(richItem, "textBoxShadowOffsetY") && (out.shadowOffsetY = richItem.textBoxShadowOffsetY);
  7730. }
  7731. function convertToEC4StyleForCustomSerise(itemStl, txStl, txCfg) {
  7732. var out = itemStl;
  7733. out.textPosition = out.textPosition || txCfg.position || "inside";
  7734. txCfg.offset != null && (out.textOffset = txCfg.offset);
  7735. txCfg.rotation != null && (out.textRotation = txCfg.rotation);
  7736. txCfg.distance != null && (out.textDistance = txCfg.distance);
  7737. var isInside = out.textPosition.indexOf("inside") >= 0;
  7738. var hostFill = itemStl.fill || "#000";
  7739. convertToEC4RichItem(out, txStl);
  7740. var textFillNotSet = out.textFill == null;
  7741. if (isInside) {
  7742. if (textFillNotSet) {
  7743. out.textFill = txCfg.insideFill || "#fff";
  7744. !out.textStroke && txCfg.insideStroke && (out.textStroke = txCfg.insideStroke);
  7745. !out.textStroke && (out.textStroke = hostFill);
  7746. out.textStrokeWidth == null && (out.textStrokeWidth = 2);
  7747. }
  7748. } else {
  7749. if (textFillNotSet) {
  7750. out.textFill = itemStl.fill || txCfg.outsideFill || "#000";
  7751. }
  7752. !out.textStroke && txCfg.outsideStroke && (out.textStroke = txCfg.outsideStroke);
  7753. }
  7754. out.text = txStl.text;
  7755. out.rich = txStl.rich;
  7756. each(txStl.rich, function(richItem) {
  7757. convertToEC4RichItem(richItem, richItem);
  7758. });
  7759. return out;
  7760. }
  7761. function convertToEC4RichItem(out, richItem) {
  7762. if (!richItem) {
  7763. return;
  7764. }
  7765. hasOwn(richItem, "fill") && (out.textFill = richItem.fill);
  7766. hasOwn(richItem, "stroke") && (out.textStroke = richItem.fill);
  7767. hasOwn(richItem, "lineWidth") && (out.textStrokeWidth = richItem.lineWidth);
  7768. hasOwn(richItem, "font") && (out.font = richItem.font);
  7769. hasOwn(richItem, "fontStyle") && (out.fontStyle = richItem.fontStyle);
  7770. hasOwn(richItem, "fontWeight") && (out.fontWeight = richItem.fontWeight);
  7771. hasOwn(richItem, "fontSize") && (out.fontSize = richItem.fontSize);
  7772. hasOwn(richItem, "fontFamily") && (out.fontFamily = richItem.fontFamily);
  7773. hasOwn(richItem, "align") && (out.textAlign = richItem.align);
  7774. hasOwn(richItem, "verticalAlign") && (out.textVerticalAlign = richItem.verticalAlign);
  7775. hasOwn(richItem, "lineHeight") && (out.textLineHeight = richItem.lineHeight);
  7776. hasOwn(richItem, "width") && (out.textWidth = richItem.width);
  7777. hasOwn(richItem, "height") && (out.textHeight = richItem.height);
  7778. hasOwn(richItem, "backgroundColor") && (out.textBackgroundColor = richItem.backgroundColor);
  7779. hasOwn(richItem, "padding") && (out.textPadding = richItem.padding);
  7780. hasOwn(richItem, "borderColor") && (out.textBorderColor = richItem.borderColor);
  7781. hasOwn(richItem, "borderWidth") && (out.textBorderWidth = richItem.borderWidth);
  7782. hasOwn(richItem, "borderRadius") && (out.textBorderRadius = richItem.borderRadius);
  7783. hasOwn(richItem, "shadowColor") && (out.textBoxShadowColor = richItem.shadowColor);
  7784. hasOwn(richItem, "shadowBlur") && (out.textBoxShadowBlur = richItem.shadowBlur);
  7785. hasOwn(richItem, "shadowOffsetX") && (out.textBoxShadowOffsetX = richItem.shadowOffsetX);
  7786. hasOwn(richItem, "shadowOffsetY") && (out.textBoxShadowOffsetY = richItem.shadowOffsetY);
  7787. hasOwn(richItem, "textShadowColor") && (out.textShadowColor = richItem.textShadowColor);
  7788. hasOwn(richItem, "textShadowBlur") && (out.textShadowBlur = richItem.textShadowBlur);
  7789. hasOwn(richItem, "textShadowOffsetX") && (out.textShadowOffsetX = richItem.textShadowOffsetX);
  7790. hasOwn(richItem, "textShadowOffsetY") && (out.textShadowOffsetY = richItem.textShadowOffsetY);
  7791. }
  7792. function warnDeprecated(deprecated, insteadApproach) {
  7793. if (true) {
  7794. var key = deprecated + "^_^" + insteadApproach;
  7795. if (!deprecatedLogs[key]) {
  7796. console.warn('[ECharts] DEPRECATED: "' + deprecated + '" has been deprecated. ' + insteadApproach);
  7797. deprecatedLogs[key] = true;
  7798. }
  7799. }
  7800. }
  7801. // node_modules/echarts/lib/animation/customGraphicTransition.js
  7802. init_define_APP_INFO();
  7803. var LEGACY_TRANSFORM_PROPS_MAP = {
  7804. position: ["x", "y"],
  7805. scale: ["scaleX", "scaleY"],
  7806. origin: ["originX", "originY"]
  7807. };
  7808. var LEGACY_TRANSFORM_PROPS = keys(LEGACY_TRANSFORM_PROPS_MAP);
  7809. var TRANSFORM_PROPS_MAP = reduce(TRANSFORMABLE_PROPS, function(obj, key) {
  7810. obj[key] = 1;
  7811. return obj;
  7812. }, {});
  7813. var transformPropNamesStr = TRANSFORMABLE_PROPS.join(", ");
  7814. var ELEMENT_ANIMATABLE_PROPS = ["", "style", "shape", "extra"];
  7815. var transitionInnerStore = makeInner();
  7816. function getElementAnimationConfig(animationType, el, elOption, parentModel, dataIndex) {
  7817. var animationProp = animationType + "Animation";
  7818. var config = getAnimationConfig(animationType, parentModel, dataIndex) || {};
  7819. var userDuring = transitionInnerStore(el).userDuring;
  7820. if (config.duration > 0) {
  7821. config.during = userDuring ? bind(duringCall, {
  7822. el,
  7823. userDuring
  7824. }) : null;
  7825. config.setToFinal = true;
  7826. config.scope = animationType;
  7827. }
  7828. extend(config, elOption[animationProp]);
  7829. return config;
  7830. }
  7831. function applyUpdateTransition(el, elOption, animatableModel, opts) {
  7832. opts = opts || {};
  7833. var dataIndex = opts.dataIndex, isInit = opts.isInit, clearStyle = opts.clearStyle;
  7834. var hasAnimation = animatableModel.isAnimationEnabled();
  7835. var store = transitionInnerStore(el);
  7836. var styleOpt = elOption.style;
  7837. store.userDuring = elOption.during;
  7838. var transFromProps = {};
  7839. var propsToSet = {};
  7840. prepareTransformAllPropsFinal(el, elOption, propsToSet);
  7841. prepareShapeOrExtraAllPropsFinal("shape", elOption, propsToSet);
  7842. prepareShapeOrExtraAllPropsFinal("extra", elOption, propsToSet);
  7843. if (!isInit && hasAnimation) {
  7844. prepareTransformTransitionFrom(el, elOption, transFromProps);
  7845. prepareShapeOrExtraTransitionFrom("shape", el, elOption, transFromProps);
  7846. prepareShapeOrExtraTransitionFrom("extra", el, elOption, transFromProps);
  7847. prepareStyleTransitionFrom(el, elOption, styleOpt, transFromProps);
  7848. }
  7849. propsToSet.style = styleOpt;
  7850. applyPropsDirectly(el, propsToSet, clearStyle);
  7851. applyMiscProps(el, elOption);
  7852. if (hasAnimation) {
  7853. if (isInit) {
  7854. var enterFromProps_1 = {};
  7855. each(ELEMENT_ANIMATABLE_PROPS, function(propName) {
  7856. var prop = propName ? elOption[propName] : elOption;
  7857. if (prop && prop.enterFrom) {
  7858. if (propName) {
  7859. enterFromProps_1[propName] = enterFromProps_1[propName] || {};
  7860. }
  7861. extend(propName ? enterFromProps_1[propName] : enterFromProps_1, prop.enterFrom);
  7862. }
  7863. });
  7864. var config = getElementAnimationConfig("enter", el, elOption, animatableModel, dataIndex);
  7865. if (config.duration > 0) {
  7866. el.animateFrom(enterFromProps_1, config);
  7867. }
  7868. } else {
  7869. applyPropsTransition(el, elOption, dataIndex || 0, animatableModel, transFromProps);
  7870. }
  7871. }
  7872. updateLeaveTo(el, elOption);
  7873. styleOpt ? el.dirty() : el.markRedraw();
  7874. }
  7875. function updateLeaveTo(el, elOption) {
  7876. var leaveToProps = transitionInnerStore(el).leaveToProps;
  7877. for (var i = 0; i < ELEMENT_ANIMATABLE_PROPS.length; i++) {
  7878. var propName = ELEMENT_ANIMATABLE_PROPS[i];
  7879. var prop = propName ? elOption[propName] : elOption;
  7880. if (prop && prop.leaveTo) {
  7881. if (!leaveToProps) {
  7882. leaveToProps = transitionInnerStore(el).leaveToProps = {};
  7883. }
  7884. if (propName) {
  7885. leaveToProps[propName] = leaveToProps[propName] || {};
  7886. }
  7887. extend(propName ? leaveToProps[propName] : leaveToProps, prop.leaveTo);
  7888. }
  7889. }
  7890. }
  7891. function applyLeaveTransition(el, elOption, animatableModel, onRemove) {
  7892. if (el) {
  7893. var parent_1 = el.parent;
  7894. var leaveToProps = transitionInnerStore(el).leaveToProps;
  7895. if (leaveToProps) {
  7896. var config = getElementAnimationConfig("update", el, elOption, animatableModel, 0);
  7897. config.done = function() {
  7898. parent_1.remove(el);
  7899. onRemove && onRemove();
  7900. };
  7901. el.animateTo(leaveToProps, config);
  7902. } else {
  7903. parent_1.remove(el);
  7904. onRemove && onRemove();
  7905. }
  7906. }
  7907. }
  7908. function isTransitionAll(transition) {
  7909. return transition === "all";
  7910. }
  7911. function applyPropsDirectly(el, allPropsFinal, clearStyle) {
  7912. var styleOpt = allPropsFinal.style;
  7913. if (!el.isGroup && styleOpt) {
  7914. if (clearStyle) {
  7915. el.useStyle({});
  7916. var animators = el.animators;
  7917. for (var i = 0; i < animators.length; i++) {
  7918. var animator = animators[i];
  7919. if (animator.targetName === "style") {
  7920. animator.changeTarget(el.style);
  7921. }
  7922. }
  7923. }
  7924. el.setStyle(styleOpt);
  7925. }
  7926. if (allPropsFinal) {
  7927. allPropsFinal.style = null;
  7928. allPropsFinal && el.attr(allPropsFinal);
  7929. allPropsFinal.style = styleOpt;
  7930. }
  7931. }
  7932. function applyPropsTransition(el, elOption, dataIndex, model, transFromProps) {
  7933. if (transFromProps) {
  7934. var config = getElementAnimationConfig("update", el, elOption, model, dataIndex);
  7935. if (config.duration > 0) {
  7936. el.animateFrom(transFromProps, config);
  7937. }
  7938. }
  7939. }
  7940. function applyMiscProps(el, elOption) {
  7941. hasOwn(elOption, "silent") && (el.silent = elOption.silent);
  7942. hasOwn(elOption, "ignore") && (el.ignore = elOption.ignore);
  7943. if (el instanceof Displayable_default) {
  7944. hasOwn(elOption, "invisible") && (el.invisible = elOption.invisible);
  7945. }
  7946. if (el instanceof Path_default) {
  7947. hasOwn(elOption, "autoBatch") && (el.autoBatch = elOption.autoBatch);
  7948. }
  7949. }
  7950. var tmpDuringScope = {};
  7951. var transitionDuringAPI = {
  7952. setTransform: function(key, val) {
  7953. if (true) {
  7954. assert(hasOwn(TRANSFORM_PROPS_MAP, key), "Only " + transformPropNamesStr + " available in `setTransform`.");
  7955. }
  7956. tmpDuringScope.el[key] = val;
  7957. return this;
  7958. },
  7959. getTransform: function(key) {
  7960. if (true) {
  7961. assert(hasOwn(TRANSFORM_PROPS_MAP, key), "Only " + transformPropNamesStr + " available in `getTransform`.");
  7962. }
  7963. return tmpDuringScope.el[key];
  7964. },
  7965. setShape: function(key, val) {
  7966. if (true) {
  7967. assertNotReserved(key);
  7968. }
  7969. var el = tmpDuringScope.el;
  7970. var shape = el.shape || (el.shape = {});
  7971. shape[key] = val;
  7972. el.dirtyShape && el.dirtyShape();
  7973. return this;
  7974. },
  7975. getShape: function(key) {
  7976. if (true) {
  7977. assertNotReserved(key);
  7978. }
  7979. var shape = tmpDuringScope.el.shape;
  7980. if (shape) {
  7981. return shape[key];
  7982. }
  7983. },
  7984. setStyle: function(key, val) {
  7985. if (true) {
  7986. assertNotReserved(key);
  7987. }
  7988. var el = tmpDuringScope.el;
  7989. var style = el.style;
  7990. if (style) {
  7991. if (true) {
  7992. if (eqNaN(val)) {
  7993. warn("style." + key + " must not be assigned with NaN.");
  7994. }
  7995. }
  7996. style[key] = val;
  7997. el.dirtyStyle && el.dirtyStyle();
  7998. }
  7999. return this;
  8000. },
  8001. getStyle: function(key) {
  8002. if (true) {
  8003. assertNotReserved(key);
  8004. }
  8005. var style = tmpDuringScope.el.style;
  8006. if (style) {
  8007. return style[key];
  8008. }
  8009. },
  8010. setExtra: function(key, val) {
  8011. if (true) {
  8012. assertNotReserved(key);
  8013. }
  8014. var extra = tmpDuringScope.el.extra || (tmpDuringScope.el.extra = {});
  8015. extra[key] = val;
  8016. return this;
  8017. },
  8018. getExtra: function(key) {
  8019. if (true) {
  8020. assertNotReserved(key);
  8021. }
  8022. var extra = tmpDuringScope.el.extra;
  8023. if (extra) {
  8024. return extra[key];
  8025. }
  8026. }
  8027. };
  8028. function assertNotReserved(key) {
  8029. if (true) {
  8030. if (key === "transition" || key === "enterFrom" || key === "leaveTo") {
  8031. throw new Error('key must not be "' + key + '"');
  8032. }
  8033. }
  8034. }
  8035. function duringCall() {
  8036. var scope = this;
  8037. var el = scope.el;
  8038. if (!el) {
  8039. return;
  8040. }
  8041. var latestUserDuring = transitionInnerStore(el).userDuring;
  8042. var scopeUserDuring = scope.userDuring;
  8043. if (latestUserDuring !== scopeUserDuring) {
  8044. scope.el = scope.userDuring = null;
  8045. return;
  8046. }
  8047. tmpDuringScope.el = el;
  8048. scopeUserDuring(transitionDuringAPI);
  8049. }
  8050. function prepareShapeOrExtraTransitionFrom(mainAttr, fromEl, elOption, transFromProps) {
  8051. var attrOpt = elOption[mainAttr];
  8052. if (!attrOpt) {
  8053. return;
  8054. }
  8055. var elPropsInAttr = fromEl[mainAttr];
  8056. var transFromPropsInAttr;
  8057. if (elPropsInAttr) {
  8058. var transition = elOption.transition;
  8059. var attrTransition = attrOpt.transition;
  8060. if (attrTransition) {
  8061. !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});
  8062. if (isTransitionAll(attrTransition)) {
  8063. extend(transFromPropsInAttr, elPropsInAttr);
  8064. } else {
  8065. var transitionKeys = normalizeToArray(attrTransition);
  8066. for (var i = 0; i < transitionKeys.length; i++) {
  8067. var key = transitionKeys[i];
  8068. var elVal = elPropsInAttr[key];
  8069. transFromPropsInAttr[key] = elVal;
  8070. }
  8071. }
  8072. } else if (isTransitionAll(transition) || indexOf(transition, mainAttr) >= 0) {
  8073. !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});
  8074. var elPropsInAttrKeys = keys(elPropsInAttr);
  8075. for (var i = 0; i < elPropsInAttrKeys.length; i++) {
  8076. var key = elPropsInAttrKeys[i];
  8077. var elVal = elPropsInAttr[key];
  8078. if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) {
  8079. transFromPropsInAttr[key] = elVal;
  8080. }
  8081. }
  8082. }
  8083. }
  8084. }
  8085. function prepareShapeOrExtraAllPropsFinal(mainAttr, elOption, allProps) {
  8086. var attrOpt = elOption[mainAttr];
  8087. if (!attrOpt) {
  8088. return;
  8089. }
  8090. var allPropsInAttr = allProps[mainAttr] = {};
  8091. var keysInAttr = keys(attrOpt);
  8092. for (var i = 0; i < keysInAttr.length; i++) {
  8093. var key = keysInAttr[i];
  8094. allPropsInAttr[key] = cloneValue(attrOpt[key]);
  8095. }
  8096. }
  8097. function prepareTransformTransitionFrom(el, elOption, transFromProps) {
  8098. var transition = elOption.transition;
  8099. var transitionKeys = isTransitionAll(transition) ? TRANSFORMABLE_PROPS : normalizeToArray(transition || []);
  8100. for (var i = 0; i < transitionKeys.length; i++) {
  8101. var key = transitionKeys[i];
  8102. if (key === "style" || key === "shape" || key === "extra") {
  8103. continue;
  8104. }
  8105. var elVal = el[key];
  8106. if (true) {
  8107. checkTransformPropRefer(key, "el.transition");
  8108. }
  8109. transFromProps[key] = elVal;
  8110. }
  8111. }
  8112. function prepareTransformAllPropsFinal(el, elOption, allProps) {
  8113. for (var i = 0; i < LEGACY_TRANSFORM_PROPS.length; i++) {
  8114. var legacyName = LEGACY_TRANSFORM_PROPS[i];
  8115. var xyName = LEGACY_TRANSFORM_PROPS_MAP[legacyName];
  8116. var legacyArr = elOption[legacyName];
  8117. if (legacyArr) {
  8118. allProps[xyName[0]] = legacyArr[0];
  8119. allProps[xyName[1]] = legacyArr[1];
  8120. }
  8121. }
  8122. for (var i = 0; i < TRANSFORMABLE_PROPS.length; i++) {
  8123. var key = TRANSFORMABLE_PROPS[i];
  8124. if (elOption[key] != null) {
  8125. allProps[key] = elOption[key];
  8126. }
  8127. }
  8128. }
  8129. function prepareStyleTransitionFrom(fromEl, elOption, styleOpt, transFromProps) {
  8130. if (!styleOpt) {
  8131. return;
  8132. }
  8133. var fromElStyle = fromEl.style;
  8134. var transFromStyleProps;
  8135. if (fromElStyle) {
  8136. var styleTransition = styleOpt.transition;
  8137. var elTransition = elOption.transition;
  8138. if (styleTransition && !isTransitionAll(styleTransition)) {
  8139. var transitionKeys = normalizeToArray(styleTransition);
  8140. !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});
  8141. for (var i = 0; i < transitionKeys.length; i++) {
  8142. var key = transitionKeys[i];
  8143. var elVal = fromElStyle[key];
  8144. transFromStyleProps[key] = elVal;
  8145. }
  8146. } else if (fromEl.getAnimationStyleProps && (isTransitionAll(elTransition) || isTransitionAll(styleTransition) || indexOf(elTransition, "style") >= 0)) {
  8147. var animationProps = fromEl.getAnimationStyleProps();
  8148. var animationStyleProps = animationProps ? animationProps.style : null;
  8149. if (animationStyleProps) {
  8150. !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});
  8151. var styleKeys = keys(styleOpt);
  8152. for (var i = 0; i < styleKeys.length; i++) {
  8153. var key = styleKeys[i];
  8154. if (animationStyleProps[key]) {
  8155. var elVal = fromElStyle[key];
  8156. transFromStyleProps[key] = elVal;
  8157. }
  8158. }
  8159. }
  8160. }
  8161. }
  8162. }
  8163. function isNonStyleTransitionEnabled(optVal, elVal) {
  8164. return !isArrayLike(optVal) ? optVal != null && isFinite(optVal) : optVal !== elVal;
  8165. }
  8166. var checkTransformPropRefer;
  8167. if (true) {
  8168. checkTransformPropRefer = function(key, usedIn) {
  8169. if (!hasOwn(TRANSFORM_PROPS_MAP, key)) {
  8170. warn("Prop `" + key + "` is not a permitted in `" + usedIn + "`. Only `" + keys(TRANSFORM_PROPS_MAP).join("`, `") + "` are permitted.");
  8171. }
  8172. };
  8173. }
  8174. // node_modules/echarts/lib/animation/customGraphicKeyframeAnimation.js
  8175. init_define_APP_INFO();
  8176. var getStateToRestore = makeInner();
  8177. var KEYFRAME_EXCLUDE_KEYS = ["percent", "easing", "shape", "style", "extra"];
  8178. function stopPreviousKeyframeAnimationAndRestore(el) {
  8179. el.stopAnimation("keyframe");
  8180. el.attr(getStateToRestore(el));
  8181. }
  8182. function applyKeyframeAnimation(el, animationOpts, animatableModel) {
  8183. if (!animatableModel.isAnimationEnabled() || !animationOpts) {
  8184. return;
  8185. }
  8186. if (isArray(animationOpts)) {
  8187. each(animationOpts, function(singleAnimationOpts) {
  8188. applyKeyframeAnimation(el, singleAnimationOpts, animatableModel);
  8189. });
  8190. return;
  8191. }
  8192. var keyframes = animationOpts.keyframes;
  8193. var duration = animationOpts.duration;
  8194. if (animatableModel && duration == null) {
  8195. var config = getAnimationConfig("enter", animatableModel, 0);
  8196. duration = config && config.duration;
  8197. }
  8198. if (!keyframes || !duration) {
  8199. return;
  8200. }
  8201. var stateToRestore = getStateToRestore(el);
  8202. each(ELEMENT_ANIMATABLE_PROPS, function(targetPropName) {
  8203. if (targetPropName && !el[targetPropName]) {
  8204. return;
  8205. }
  8206. var animator;
  8207. var endFrameIsSet = false;
  8208. keyframes.sort(function(a, b) {
  8209. return a.percent - b.percent;
  8210. });
  8211. each(keyframes, function(kf) {
  8212. var animators = el.animators;
  8213. var kfValues = targetPropName ? kf[targetPropName] : kf;
  8214. if (true) {
  8215. if (kf.percent >= 1) {
  8216. endFrameIsSet = true;
  8217. }
  8218. }
  8219. if (!kfValues) {
  8220. return;
  8221. }
  8222. var propKeys = keys(kfValues);
  8223. if (!targetPropName) {
  8224. propKeys = filter(propKeys, function(key) {
  8225. return indexOf(KEYFRAME_EXCLUDE_KEYS, key) < 0;
  8226. });
  8227. }
  8228. if (!propKeys.length) {
  8229. return;
  8230. }
  8231. if (!animator) {
  8232. animator = el.animate(targetPropName, animationOpts.loop, true);
  8233. animator.scope = "keyframe";
  8234. }
  8235. for (var i = 0; i < animators.length; i++) {
  8236. if (animators[i] !== animator && animators[i].targetName === animator.targetName) {
  8237. animators[i].stopTracks(propKeys);
  8238. }
  8239. }
  8240. targetPropName && (stateToRestore[targetPropName] = stateToRestore[targetPropName] || {});
  8241. var savedTarget = targetPropName ? stateToRestore[targetPropName] : stateToRestore;
  8242. each(propKeys, function(key) {
  8243. savedTarget[key] = ((targetPropName ? el[targetPropName] : el) || {})[key];
  8244. });
  8245. animator.whenWithKeys(duration * kf.percent, kfValues, propKeys, kf.easing);
  8246. });
  8247. if (!animator) {
  8248. return;
  8249. }
  8250. if (true) {
  8251. if (!endFrameIsSet) {
  8252. warn("End frame with percent: 1 is missing in the keyframeAnimation.", true);
  8253. }
  8254. }
  8255. animator.delay(animationOpts.delay || 0).duration(duration).start(animationOpts.easing);
  8256. });
  8257. }
  8258. export {
  8259. getDefaultLabel,
  8260. getDefaultInterpolatedLabel,
  8261. Symbol_default,
  8262. SymbolDraw_default,
  8263. isCoordinateSystemType,
  8264. axisModelCreator,
  8265. layout,
  8266. AxisBuilder_default,
  8267. collect,
  8268. getAxisInfo,
  8269. makeKey,
  8270. AxisView_default,
  8271. rectCoordAxisBuildSplitArea,
  8272. rectCoordAxisHandleRemove,
  8273. install,
  8274. install2,
  8275. RoamController_default,
  8276. updateViewOnPan,
  8277. updateViewOnZoom,
  8278. onIrrelevantElement,
  8279. geoSourceManager_default,
  8280. MapDraw_default,
  8281. View_default,
  8282. updateCenterAndZoom,
  8283. install3,
  8284. VisualMapping_default,
  8285. Line_default2 as Line_default,
  8286. LineDraw_default,
  8287. sliderMove,
  8288. BrushController_default,
  8289. makeRectPanelClipPath,
  8290. makeLinearBrushOtherExtent,
  8291. makeRectIsTargetByCursor,
  8292. install4,
  8293. isEC4CompatibleStyle,
  8294. convertFromEC4CompatibleStyle,
  8295. convertToEC4StyleForCustomSerise,
  8296. warnDeprecated,
  8297. applyUpdateTransition,
  8298. updateLeaveTo,
  8299. applyLeaveTransition,
  8300. isTransitionAll,
  8301. stopPreviousKeyframeAnimationAndRestore,
  8302. applyKeyframeAnimation
  8303. };
  8304. //# sourceMappingURL=chunk-43FE5UYX.js.map