echarts.min_4.8.js 1.4 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. !function(t, e) {
  20. "object" == typeof exports && "undefined" != typeof module ? e(exports) : "function" == typeof define && define.amd ? define(["exports"], e) : e(t.echarts = {})
  21. }(this, function(t) {
  22. "use strict";
  23. var e = 2311
  24. , n = function() {
  25. return e++
  26. }
  27. , v = "object" == typeof wx && "function" == typeof wx.getSystemInfoSync ? {
  28. browser: {},
  29. os: {},
  30. node: !1,
  31. wxa: !0,
  32. canvasSupported: !0,
  33. svgSupported: !1,
  34. touchEventsSupported: !0,
  35. domSupported: !1
  36. } : "undefined" == typeof document && "undefined" != typeof self ? {
  37. browser: {},
  38. os: {},
  39. node: !1,
  40. worker: !0,
  41. canvasSupported: !0,
  42. domSupported: !1
  43. } : "undefined" == typeof navigator ? {
  44. browser: {},
  45. os: {},
  46. node: !0,
  47. worker: !1,
  48. canvasSupported: !0,
  49. svgSupported: !0,
  50. domSupported: !1
  51. } : function(t) {
  52. var e = {}
  53. , i = t.match(/Firefox\/([\d.]+)/)
  54. , n = t.match(/MSIE\s([\d.]+)/) || t.match(/Trident\/.+?rv:(([\d.]+))/)
  55. , o = t.match(/Edge\/([\d.]+)/)
  56. , a = /micromessenger/i.test(t);
  57. i && (e.firefox = !0,
  58. e.version = i[1]);
  59. n && (e.ie = !0,
  60. e.version = n[1]);
  61. o && (e.edge = !0,
  62. e.version = o[1]);
  63. a && (e.weChat = !0);
  64. return {
  65. browser: e,
  66. os: {},
  67. node: !1,
  68. canvasSupported: !!document.createElement("canvas").getContext,
  69. svgSupported: "undefined" != typeof SVGRect,
  70. touchEventsSupported: "ontouchstart"in window && !e.ie && !e.edge,
  71. pointerEventsSupported: "onpointerdown"in window && (e.edge || e.ie && 11 <= e.version),
  72. domSupported: "undefined" != typeof document
  73. }
  74. }(navigator.userAgent);
  75. var s = {
  76. "[object Function]": 1,
  77. "[object RegExp]": 1,
  78. "[object Date]": 1,
  79. "[object Error]": 1,
  80. "[object CanvasGradient]": 1,
  81. "[object CanvasPattern]": 1,
  82. "[object Image]": 1,
  83. "[object Canvas]": 1
  84. }
  85. , l = {
  86. "[object Int8Array]": 1,
  87. "[object Uint8Array]": 1,
  88. "[object Uint8ClampedArray]": 1,
  89. "[object Int16Array]": 1,
  90. "[object Uint16Array]": 1,
  91. "[object Int32Array]": 1,
  92. "[object Uint32Array]": 1,
  93. "[object Float32Array]": 1,
  94. "[object Float64Array]": 1
  95. }
  96. , u = Object.prototype.toString
  97. , i = Array.prototype
  98. , r = i.forEach
  99. , h = i.filter
  100. , o = i.slice
  101. , c = i.map
  102. , d = i.reduce
  103. , a = {};
  104. function f(t, e) {
  105. "createCanvas" === t && (g = null),
  106. a[t] = e
  107. }
  108. function k(t) {
  109. if (null == t || "object" != typeof t)
  110. return t;
  111. var e = t
  112. , i = u.call(t);
  113. if ("[object Array]" === i) {
  114. if (!$(t)) {
  115. e = [];
  116. for (var n = 0, o = t.length; n < o; n++)
  117. e[n] = k(t[n])
  118. }
  119. } else if (l[i]) {
  120. if (!$(t)) {
  121. var a = t.constructor;
  122. if (t.constructor.from)
  123. e = a.from(t);
  124. else {
  125. e = new a(t.length);
  126. for (n = 0,
  127. o = t.length; n < o; n++)
  128. e[n] = k(t[n])
  129. }
  130. }
  131. } else if (!s[i] && !$(t) && !G(t))
  132. for (var r in e = {},
  133. t)
  134. t.hasOwnProperty(r) && (e[r] = k(t[r]));
  135. return e
  136. }
  137. function m(t, e, i) {
  138. if (!z(e) || !z(t))
  139. return i ? k(e) : t;
  140. for (var n in e)
  141. if (e.hasOwnProperty(n)) {
  142. var o = t[n]
  143. , a = e[n];
  144. !z(a) || !z(o) || L(a) || L(o) || G(a) || G(o) || B(a) || B(o) || $(a) || $(o) ? !i && n in t || (t[n] = k(e[n])) : m(o, a, i)
  145. }
  146. return t
  147. }
  148. function p(t, e) {
  149. for (var i = t[0], n = 1, o = t.length; n < o; n++)
  150. i = m(i, t[n], e);
  151. return i
  152. }
  153. function P(t, e) {
  154. for (var i in e)
  155. e.hasOwnProperty(i) && (t[i] = e[i]);
  156. return t
  157. }
  158. function D(t, e, i) {
  159. for (var n in e)
  160. e.hasOwnProperty(n) && (i ? null != e[n] : null == t[n]) && (t[n] = e[n]);
  161. return t
  162. }
  163. function y() {
  164. return a.createCanvas()
  165. }
  166. var g;
  167. function x() {
  168. return g = g || y().getContext("2d")
  169. }
  170. function _(t, e) {
  171. if (t) {
  172. if (t.indexOf)
  173. return t.indexOf(e);
  174. for (var i = 0, n = t.length; i < n; i++)
  175. if (t[i] === e)
  176. return i
  177. }
  178. return -1
  179. }
  180. function w(t, e) {
  181. var i = t.prototype;
  182. function n() {}
  183. for (var o in n.prototype = e.prototype,
  184. t.prototype = new n,
  185. i)
  186. i.hasOwnProperty(o) && (t.prototype[o] = i[o]);
  187. (t.prototype.constructor = t).superClass = e
  188. }
  189. function b(t, e, i) {
  190. D(t = "prototype"in t ? t.prototype : t, e = "prototype"in e ? e.prototype : e, i)
  191. }
  192. function N(t) {
  193. if (t)
  194. return "string" != typeof t && "number" == typeof t.length
  195. }
  196. function E(t, e, i) {
  197. if (t && e)
  198. if (t.forEach && t.forEach === r)
  199. t.forEach(e, i);
  200. else if (t.length === +t.length)
  201. for (var n = 0, o = t.length; n < o; n++)
  202. e.call(i, t[n], n, t);
  203. else
  204. for (var a in t)
  205. t.hasOwnProperty(a) && e.call(i, t[a], a, t)
  206. }
  207. function O(t, e, i) {
  208. if (t && e) {
  209. if (t.map && t.map === c)
  210. return t.map(e, i);
  211. for (var n = [], o = 0, a = t.length; o < a; o++)
  212. n.push(e.call(i, t[o], o, t));
  213. return n
  214. }
  215. }
  216. function S(t, e, i, n) {
  217. if (t && e) {
  218. if (t.reduce && t.reduce === d)
  219. return t.reduce(e, i, n);
  220. for (var o = 0, a = t.length; o < a; o++)
  221. i = e.call(n, i, t[o], o, t);
  222. return i
  223. }
  224. }
  225. function M(t, e, i) {
  226. if (t && e) {
  227. if (t.filter && t.filter === h)
  228. return t.filter(e, i);
  229. for (var n = [], o = 0, a = t.length; o < a; o++)
  230. e.call(i, t[o], o, t) && n.push(t[o]);
  231. return n
  232. }
  233. }
  234. function I(t, e, i) {
  235. if (t && e)
  236. for (var n = 0, o = t.length; n < o; n++)
  237. if (e.call(i, t[n], n, t))
  238. return t[n]
  239. }
  240. function A(t, e) {
  241. var i = o.call(arguments, 2);
  242. return function() {
  243. return t.apply(e, i.concat(o.call(arguments)))
  244. }
  245. }
  246. function T(t) {
  247. var e = o.call(arguments, 1);
  248. return function() {
  249. return t.apply(this, e.concat(o.call(arguments)))
  250. }
  251. }
  252. function L(t) {
  253. return "[object Array]" === u.call(t)
  254. }
  255. function C(t) {
  256. return "function" == typeof t
  257. }
  258. function R(t) {
  259. return "[object String]" === u.call(t)
  260. }
  261. function z(t) {
  262. var e = typeof t;
  263. return "function" == e || !!t && "object" == e
  264. }
  265. function B(t) {
  266. return !!s[u.call(t)]
  267. }
  268. function V(t) {
  269. return !!l[u.call(t)]
  270. }
  271. function G(t) {
  272. return "object" == typeof t && "number" == typeof t.nodeType && "object" == typeof t.ownerDocument
  273. }
  274. function F(t) {
  275. return t != t
  276. }
  277. function W(t) {
  278. for (var e = 0, i = arguments.length; e < i; e++)
  279. if (null != arguments[e])
  280. return arguments[e]
  281. }
  282. function H(t, e) {
  283. return null != t ? t : e
  284. }
  285. function Z(t, e, i) {
  286. return null != t ? t : null != e ? e : i
  287. }
  288. function U() {
  289. return Function.call.apply(o, arguments)
  290. }
  291. function X(t) {
  292. if ("number" == typeof t)
  293. return [t, t, t, t];
  294. var e = t.length;
  295. return 2 === e ? [t[0], t[1], t[0], t[1]] : 3 === e ? [t[0], t[1], t[2], t[1]] : t
  296. }
  297. function Y(t, e) {
  298. if (!t)
  299. throw new Error(e)
  300. }
  301. function j(t) {
  302. return null == t ? null : "function" == typeof t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "")
  303. }
  304. a.createCanvas = function() {
  305. return document.createElement("canvas")
  306. }
  307. ;
  308. var q = "__ec_primitive__";
  309. function K(t) {
  310. t[q] = !0
  311. }
  312. function $(t) {
  313. return t[q]
  314. }
  315. function J(t) {
  316. var i = L(t);
  317. this.data = {};
  318. var n = this;
  319. function e(t, e) {
  320. i ? n.set(t, e) : n.set(e, t)
  321. }
  322. t instanceof J ? t.each(e) : t && E(t, e)
  323. }
  324. function Q(t) {
  325. return new J(t)
  326. }
  327. function tt(t, e) {
  328. for (var i = new t.constructor(t.length + e.length), n = 0; n < t.length; n++)
  329. i[n] = t[n];
  330. var o = t.length;
  331. for (n = 0; n < e.length; n++)
  332. i[n + o] = e[n];
  333. return i
  334. }
  335. function et() {}
  336. J.prototype = {
  337. constructor: J,
  338. get: function(t) {
  339. return this.data.hasOwnProperty(t) ? this.data[t] : null
  340. },
  341. set: function(t, e) {
  342. return this.data[t] = e
  343. },
  344. each: function(t, e) {
  345. for (var i in void 0 !== e && (t = A(t, e)),
  346. this.data)
  347. this.data.hasOwnProperty(i) && t(this.data[i], i)
  348. },
  349. removeKey: function(t) {
  350. delete this.data[t]
  351. }
  352. };
  353. var it = (Object.freeze || Object)({
  354. $override: f,
  355. clone: k,
  356. merge: m,
  357. mergeAll: p,
  358. extend: P,
  359. defaults: D,
  360. createCanvas: y,
  361. getContext: x,
  362. indexOf: _,
  363. inherits: w,
  364. mixin: b,
  365. isArrayLike: N,
  366. each: E,
  367. map: O,
  368. reduce: S,
  369. filter: M,
  370. find: I,
  371. bind: A,
  372. curry: T,
  373. isArray: L,
  374. isFunction: C,
  375. isString: R,
  376. isObject: z,
  377. isBuiltInObject: B,
  378. isTypedArray: V,
  379. isDom: G,
  380. eqNaN: F,
  381. retrieve: W,
  382. retrieve2: H,
  383. retrieve3: Z,
  384. slice: U,
  385. normalizeCssArray: X,
  386. assert: Y,
  387. trim: j,
  388. setAsPrimitive: K,
  389. isPrimitive: $,
  390. createHashMap: Q,
  391. concatArray: tt,
  392. noop: et
  393. })
  394. , nt = "undefined" == typeof Float32Array ? Array : Float32Array;
  395. function ot(t, e) {
  396. var i = new nt(2);
  397. return null == t && (t = 0),
  398. null == e && (e = 0),
  399. i[0] = t,
  400. i[1] = e,
  401. i
  402. }
  403. function at(t, e) {
  404. return t[0] = e[0],
  405. t[1] = e[1],
  406. t
  407. }
  408. function rt(t) {
  409. var e = new nt(2);
  410. return e[0] = t[0],
  411. e[1] = t[1],
  412. e
  413. }
  414. function st(t, e, i) {
  415. return t[0] = e,
  416. t[1] = i,
  417. t
  418. }
  419. function lt(t, e, i) {
  420. return t[0] = e[0] + i[0],
  421. t[1] = e[1] + i[1],
  422. t
  423. }
  424. function ut(t, e, i, n) {
  425. return t[0] = e[0] + i[0] * n,
  426. t[1] = e[1] + i[1] * n,
  427. t
  428. }
  429. function ht(t, e, i) {
  430. return t[0] = e[0] - i[0],
  431. t[1] = e[1] - i[1],
  432. t
  433. }
  434. function ct(t) {
  435. return Math.sqrt(ft(t))
  436. }
  437. var dt = ct;
  438. function ft(t) {
  439. return t[0] * t[0] + t[1] * t[1]
  440. }
  441. var pt = ft;
  442. function gt(t, e, i) {
  443. return t[0] = e[0] * i,
  444. t[1] = e[1] * i,
  445. t
  446. }
  447. function mt(t, e) {
  448. var i = ct(e);
  449. return 0 === i ? (t[0] = 0,
  450. t[1] = 0) : (t[0] = e[0] / i,
  451. t[1] = e[1] / i),
  452. t
  453. }
  454. function vt(t, e) {
  455. return Math.sqrt((t[0] - e[0]) * (t[0] - e[0]) + (t[1] - e[1]) * (t[1] - e[1]))
  456. }
  457. var yt = vt;
  458. function xt(t, e) {
  459. return (t[0] - e[0]) * (t[0] - e[0]) + (t[1] - e[1]) * (t[1] - e[1])
  460. }
  461. var _t = xt;
  462. function wt(t, e, i, n) {
  463. return t[0] = e[0] + n * (i[0] - e[0]),
  464. t[1] = e[1] + n * (i[1] - e[1]),
  465. t
  466. }
  467. function bt(t, e, i) {
  468. var n = e[0]
  469. , o = e[1];
  470. return t[0] = i[0] * n + i[2] * o + i[4],
  471. t[1] = i[1] * n + i[3] * o + i[5],
  472. t
  473. }
  474. function St(t, e, i) {
  475. return t[0] = Math.min(e[0], i[0]),
  476. t[1] = Math.min(e[1], i[1]),
  477. t
  478. }
  479. function Mt(t, e, i) {
  480. return t[0] = Math.max(e[0], i[0]),
  481. t[1] = Math.max(e[1], i[1]),
  482. t
  483. }
  484. var It = (Object.freeze || Object)({
  485. create: ot,
  486. copy: at,
  487. clone: rt,
  488. set: st,
  489. add: lt,
  490. scaleAndAdd: ut,
  491. sub: ht,
  492. len: ct,
  493. length: dt,
  494. lenSquare: ft,
  495. lengthSquare: pt,
  496. mul: function(t, e, i) {
  497. return t[0] = e[0] * i[0],
  498. t[1] = e[1] * i[1],
  499. t
  500. },
  501. div: function(t, e, i) {
  502. return t[0] = e[0] / i[0],
  503. t[1] = e[1] / i[1],
  504. t
  505. },
  506. dot: function(t, e) {
  507. return t[0] * e[0] + t[1] * e[1]
  508. },
  509. scale: gt,
  510. normalize: mt,
  511. distance: vt,
  512. dist: yt,
  513. distanceSquare: xt,
  514. distSquare: _t,
  515. negate: function(t, e) {
  516. return t[0] = -e[0],
  517. t[1] = -e[1],
  518. t
  519. },
  520. lerp: wt,
  521. applyTransform: bt,
  522. min: St,
  523. max: Mt
  524. });
  525. function Tt() {
  526. this.on("mousedown", this._dragStart, this),
  527. this.on("mousemove", this._drag, this),
  528. this.on("mouseup", this._dragEnd, this)
  529. }
  530. function At(t, e) {
  531. return {
  532. target: t,
  533. topTarget: e && e.topTarget
  534. }
  535. }
  536. Tt.prototype = {
  537. constructor: Tt,
  538. _dragStart: function(t) {
  539. for (var e = t.target; e && !e.draggable; )
  540. e = e.parent;
  541. e && ((this._draggingTarget = e).dragging = !0,
  542. this._x = t.offsetX,
  543. this._y = t.offsetY,
  544. this.dispatchToElement(At(e, t), "dragstart", t.event))
  545. },
  546. _drag: function(t) {
  547. var e = this._draggingTarget;
  548. if (e) {
  549. var i = t.offsetX
  550. , n = t.offsetY
  551. , o = i - this._x
  552. , a = n - this._y;
  553. this._x = i,
  554. this._y = n,
  555. e.drift(o, a, t),
  556. this.dispatchToElement(At(e, t), "drag", t.event);
  557. var r = this.findHover(i, n, e).target
  558. , s = this._dropTarget;
  559. e !== (this._dropTarget = r) && (s && r !== s && this.dispatchToElement(At(s, t), "dragleave", t.event),
  560. r && r !== s && this.dispatchToElement(At(r, t), "dragenter", t.event))
  561. }
  562. },
  563. _dragEnd: function(t) {
  564. var e = this._draggingTarget;
  565. e && (e.dragging = !1),
  566. this.dispatchToElement(At(e, t), "dragend", t.event),
  567. this._dropTarget && this.dispatchToElement(At(this._dropTarget, t), "drop", t.event),
  568. this._draggingTarget = null,
  569. this._dropTarget = null
  570. }
  571. };
  572. var Dt = Array.prototype.slice
  573. , Ct = function(t) {
  574. this._$handlers = {},
  575. this._$eventProcessor = t
  576. };
  577. function Lt(t, e, i, n, o, a) {
  578. var r = t._$handlers;
  579. if ("function" == typeof i && (o = n,
  580. n = i,
  581. i = null),
  582. !n || !e)
  583. return t;
  584. i = function(t, e) {
  585. var i = t._$eventProcessor;
  586. return null != e && i && i.normalizeQuery && (e = i.normalizeQuery(e)),
  587. e
  588. }(t, i),
  589. r[e] || (r[e] = []);
  590. for (var s = 0; s < r[e].length; s++)
  591. if (r[e][s].h === n)
  592. return t;
  593. var l = {
  594. h: n,
  595. one: a,
  596. query: i,
  597. ctx: o || t,
  598. callAtLast: n.zrEventfulCallAtLast
  599. }
  600. , u = r[e].length - 1
  601. , h = r[e][u];
  602. return h && h.callAtLast ? r[e].splice(u, 0, l) : r[e].push(l),
  603. t
  604. }
  605. Ct.prototype = {
  606. constructor: Ct,
  607. one: function(t, e, i, n) {
  608. return Lt(this, t, e, i, n, !0)
  609. },
  610. on: function(t, e, i, n) {
  611. return Lt(this, t, e, i, n, !1)
  612. },
  613. isSilent: function(t) {
  614. var e = this._$handlers;
  615. return !e[t] || !e[t].length
  616. },
  617. off: function(t, e) {
  618. var i = this._$handlers;
  619. if (!t)
  620. return this._$handlers = {},
  621. this;
  622. if (e) {
  623. if (i[t]) {
  624. for (var n = [], o = 0, a = i[t].length; o < a; o++)
  625. i[t][o].h !== e && n.push(i[t][o]);
  626. i[t] = n
  627. }
  628. i[t] && 0 === i[t].length && delete i[t]
  629. } else
  630. delete i[t];
  631. return this
  632. },
  633. trigger: function(t) {
  634. var e = this._$handlers[t]
  635. , i = this._$eventProcessor;
  636. if (e) {
  637. var n = arguments
  638. , o = n.length;
  639. 3 < o && (n = Dt.call(n, 1));
  640. for (var a = e.length, r = 0; r < a; ) {
  641. var s = e[r];
  642. if (i && i.filter && null != s.query && !i.filter(t, s.query))
  643. r++;
  644. else {
  645. switch (o) {
  646. case 1:
  647. s.h.call(s.ctx);
  648. break;
  649. case 2:
  650. s.h.call(s.ctx, n[1]);
  651. break;
  652. case 3:
  653. s.h.call(s.ctx, n[1], n[2]);
  654. break;
  655. default:
  656. s.h.apply(s.ctx, n)
  657. }
  658. s.one ? (e.splice(r, 1),
  659. a--) : r++
  660. }
  661. }
  662. }
  663. return i && i.afterTrigger && i.afterTrigger(t),
  664. this
  665. },
  666. triggerWithContext: function(t) {
  667. var e = this._$handlers[t]
  668. , i = this._$eventProcessor;
  669. if (e) {
  670. var n = arguments
  671. , o = n.length;
  672. 4 < o && (n = Dt.call(n, 1, n.length - 1));
  673. for (var a = n[n.length - 1], r = e.length, s = 0; s < r; ) {
  674. var l = e[s];
  675. if (i && i.filter && null != l.query && !i.filter(t, l.query))
  676. s++;
  677. else {
  678. switch (o) {
  679. case 1:
  680. l.h.call(a);
  681. break;
  682. case 2:
  683. l.h.call(a, n[1]);
  684. break;
  685. case 3:
  686. l.h.call(a, n[1], n[2]);
  687. break;
  688. default:
  689. l.h.apply(a, n)
  690. }
  691. l.one ? (e.splice(s, 1),
  692. r--) : s++
  693. }
  694. }
  695. }
  696. return i && i.afterTrigger && i.afterTrigger(t),
  697. this
  698. }
  699. };
  700. var kt = Math.log(2);
  701. function Pt(t, e, i, n, o, a) {
  702. var r = n + "-" + o
  703. , s = t.length;
  704. if (a.hasOwnProperty(r))
  705. return a[r];
  706. if (1 === e) {
  707. var l = Math.round(Math.log((1 << s) - 1 & ~o) / kt);
  708. return t[i][l]
  709. }
  710. for (var u = n | 1 << i, h = i + 1; n & 1 << h; )
  711. h++;
  712. for (var c = 0, d = 0, f = 0; d < s; d++) {
  713. var p = 1 << d;
  714. p & o || (c += (f % 2 ? -1 : 1) * t[i][d] * Pt(t, e - 1, h, u, o | p, a),
  715. f++)
  716. }
  717. return a[r] = c
  718. }
  719. function Nt(t, e) {
  720. var i = [[t[0], t[1], 1, 0, 0, 0, -e[0] * t[0], -e[0] * t[1]], [0, 0, 0, t[0], t[1], 1, -e[1] * t[0], -e[1] * t[1]], [t[2], t[3], 1, 0, 0, 0, -e[2] * t[2], -e[2] * t[3]], [0, 0, 0, t[2], t[3], 1, -e[3] * t[2], -e[3] * t[3]], [t[4], t[5], 1, 0, 0, 0, -e[4] * t[4], -e[4] * t[5]], [0, 0, 0, t[4], t[5], 1, -e[5] * t[4], -e[5] * t[5]], [t[6], t[7], 1, 0, 0, 0, -e[6] * t[6], -e[6] * t[7]], [0, 0, 0, t[6], t[7], 1, -e[7] * t[6], -e[7] * t[7]]]
  721. , n = {}
  722. , o = Pt(i, 8, 0, 0, 0, n);
  723. if (0 !== o) {
  724. for (var a = [], r = 0; r < 8; r++)
  725. for (var s = 0; s < 8; s++)
  726. null == a[s] && (a[s] = 0),
  727. a[s] += ((r + s) % 2 ? -1 : 1) * Pt(i, 7, 0 === r ? 1 : 0, 1 << r, 1 << s, n) / o * e[r];
  728. return function(t, e, i) {
  729. var n = e * a[6] + i * a[7] + 1;
  730. t[0] = (e * a[0] + i * a[1] + a[2]) / n,
  731. t[1] = (e * a[3] + i * a[4] + a[5]) / n
  732. }
  733. }
  734. }
  735. var Ot = "___zrEVENTSAVED"
  736. , Et = [];
  737. function Rt(t, e, i, n, o) {
  738. if (e.getBoundingClientRect && v.domSupported && !zt(e)) {
  739. var a = e[Ot] || (e[Ot] = {})
  740. , r = function(t, e, i) {
  741. for (var n = i ? "invTrans" : "trans", o = e[n], a = e.srcCoords, r = !0, s = [], l = [], u = 0; u < 4; u++) {
  742. var h = t[u].getBoundingClientRect()
  743. , c = 2 * u
  744. , d = h.left
  745. , f = h.top;
  746. s.push(d, f),
  747. r = r && a && d === a[c] && f === a[1 + c],
  748. l.push(t[u].offsetLeft, t[u].offsetTop)
  749. }
  750. return r && o ? o : (e.srcCoords = s,
  751. e[n] = i ? Nt(l, s) : Nt(s, l))
  752. }(function(t, e) {
  753. var i = e.markers;
  754. if (i)
  755. return i;
  756. i = e.markers = [];
  757. for (var n = ["left", "right"], o = ["top", "bottom"], a = 0; a < 4; a++) {
  758. var r = document.createElement("div")
  759. , s = r.style
  760. , l = a % 2
  761. , u = (a >> 1) % 2;
  762. s.cssText = ["position: absolute", "visibility: hidden", "padding: 0", "margin: 0", "border-width: 0", "user-select: none", "width:0", "height:0", n[l] + ":0", o[u] + ":0", n[1 - l] + ":auto", o[1 - u] + ":auto", ""].join("!important;"),
  763. t.appendChild(r),
  764. i.push(r)
  765. }
  766. return i
  767. }(e, a), a, o);
  768. if (r)
  769. return r(t, i, n),
  770. !0
  771. }
  772. return !1
  773. }
  774. function zt(t) {
  775. return "CANVAS" === t.nodeName.toUpperCase()
  776. }
  777. var Bt = "undefined" != typeof window && !!window.addEventListener
  778. , Vt = /^(?:mouse|pointer|contextmenu|drag|drop)|click/
  779. , Gt = [];
  780. function Ft(t, e, i, n) {
  781. return i = i || {},
  782. n || !v.canvasSupported ? Wt(t, e, i) : v.browser.firefox && null != e.layerX && e.layerX !== e.offsetX ? (i.zrX = e.layerX,
  783. i.zrY = e.layerY) : null != e.offsetX ? (i.zrX = e.offsetX,
  784. i.zrY = e.offsetY) : Wt(t, e, i),
  785. i
  786. }
  787. function Wt(t, e, i) {
  788. if (v.domSupported && t.getBoundingClientRect) {
  789. var n = e.clientX
  790. , o = e.clientY;
  791. if (zt(t)) {
  792. var a = t.getBoundingClientRect();
  793. return i.zrX = n - a.left,
  794. void (i.zrY = o - a.top)
  795. }
  796. if (Rt(Gt, t, n, o))
  797. return i.zrX = Gt[0],
  798. void (i.zrY = Gt[1])
  799. }
  800. i.zrX = i.zrY = 0
  801. }
  802. function Ht(t) {
  803. return t || window.event
  804. }
  805. function Zt(t, e, i) {
  806. if (null != (e = Ht(e)).zrX)
  807. return e;
  808. var n = e.type;
  809. if (n && 0 <= n.indexOf("touch")) {
  810. var o = "touchend" !== n ? e.targetTouches[0] : e.changedTouches[0];
  811. o && Ft(t, o, e, i)
  812. } else
  813. Ft(t, e, e, i),
  814. e.zrDelta = e.wheelDelta ? e.wheelDelta / 120 : -(e.detail || 0) / 3;
  815. var a = e.button;
  816. return null == e.which && void 0 !== a && Vt.test(e.type) && (e.which = 1 & a ? 1 : 2 & a ? 3 : 4 & a ? 2 : 0),
  817. e
  818. }
  819. function Ut(t, e, i, n) {
  820. Bt ? t.addEventListener(e, i, n) : t.attachEvent("on" + e, i)
  821. }
  822. var Xt = Bt ? function(t) {
  823. t.preventDefault(),
  824. t.stopPropagation(),
  825. t.cancelBubble = !0
  826. }
  827. : function(t) {
  828. t.returnValue = !1,
  829. t.cancelBubble = !0
  830. }
  831. ;
  832. function Yt(t) {
  833. return 2 === t.which || 3 === t.which
  834. }
  835. function jt() {
  836. this._track = []
  837. }
  838. function qt(t) {
  839. var e = t[1][0] - t[0][0]
  840. , i = t[1][1] - t[0][1];
  841. return Math.sqrt(e * e + i * i)
  842. }
  843. jt.prototype = {
  844. constructor: jt,
  845. recognize: function(t, e, i) {
  846. return this._doTrack(t, e, i),
  847. this._recognize(t)
  848. },
  849. clear: function() {
  850. return this._track.length = 0,
  851. this
  852. },
  853. _doTrack: function(t, e, i) {
  854. var n = t.touches;
  855. if (n) {
  856. for (var o = {
  857. points: [],
  858. touches: [],
  859. target: e,
  860. event: t
  861. }, a = 0, r = n.length; a < r; a++) {
  862. var s = n[a]
  863. , l = Ft(i, s, {});
  864. o.points.push([l.zrX, l.zrY]),
  865. o.touches.push(s)
  866. }
  867. this._track.push(o)
  868. }
  869. },
  870. _recognize: function(t) {
  871. for (var e in Kt)
  872. if (Kt.hasOwnProperty(e)) {
  873. var i = Kt[e](this._track, t);
  874. if (i)
  875. return i
  876. }
  877. }
  878. };
  879. var Kt = {
  880. pinch: function(t, e) {
  881. var i = t.length;
  882. if (i) {
  883. var n = (t[i - 1] || {}).points
  884. , o = (t[i - 2] || {}).points || n;
  885. if (o && 1 < o.length && n && 1 < n.length) {
  886. var a = qt(n) / qt(o);
  887. isFinite(a) || (a = 1),
  888. e.pinchScale = a;
  889. var r = function(t) {
  890. return [(t[0][0] + t[1][0]) / 2, (t[0][1] + t[1][1]) / 2]
  891. }(n);
  892. return e.pinchX = r[0],
  893. e.pinchY = r[1],
  894. {
  895. type: "pinch",
  896. target: t[0].target,
  897. event: e
  898. }
  899. }
  900. }
  901. }
  902. }
  903. , $t = "silent";
  904. function Jt() {
  905. Xt(this.event)
  906. }
  907. function Qt() {}
  908. Qt.prototype.dispose = function() {}
  909. ;
  910. function te(t, e, i, n) {
  911. Ct.call(this),
  912. this.storage = t,
  913. this.painter = e,
  914. this.painterRoot = n,
  915. i = i || new Qt,
  916. this.proxy = null,
  917. this._hovered = {},
  918. this._lastTouchMoment,
  919. this._lastX,
  920. this._lastY,
  921. this._gestureMgr,
  922. Tt.call(this),
  923. this.setHandlerProxy(i)
  924. }
  925. var ee = ["click", "dblclick", "mousewheel", "mouseout", "mouseup", "mousedown", "mousemove", "contextmenu"];
  926. function ie(t, e, i) {
  927. if (t[t.rectHover ? "rectContain" : "contain"](e, i)) {
  928. for (var n, o = t; o; ) {
  929. if (o.clipPath && !o.clipPath.contain(e, i))
  930. return !1;
  931. o.silent && (n = !0),
  932. o = o.parent
  933. }
  934. return !n || $t
  935. }
  936. return !1
  937. }
  938. function ne(t, e, i) {
  939. var n = t.painter;
  940. return e < 0 || e > n.getWidth() || i < 0 || i > n.getHeight()
  941. }
  942. te.prototype = {
  943. constructor: te,
  944. setHandlerProxy: function(e) {
  945. this.proxy && this.proxy.dispose(),
  946. e && (E(ee, function(t) {
  947. e.on && e.on(t, this[t], this)
  948. }, this),
  949. e.handler = this),
  950. this.proxy = e
  951. },
  952. mousemove: function(t) {
  953. var e = t.zrX
  954. , i = t.zrY
  955. , n = ne(this, e, i)
  956. , o = this._hovered
  957. , a = o.target;
  958. a && !a.__zr && (a = (o = this.findHover(o.x, o.y)).target);
  959. var r = this._hovered = n ? {
  960. x: e,
  961. y: i
  962. } : this.findHover(e, i)
  963. , s = r.target
  964. , l = this.proxy;
  965. l.setCursor && l.setCursor(s ? s.cursor : "default"),
  966. a && s !== a && this.dispatchToElement(o, "mouseout", t),
  967. this.dispatchToElement(r, "mousemove", t),
  968. s && s !== a && this.dispatchToElement(r, "mouseover", t)
  969. },
  970. mouseout: function(t) {
  971. var e = t.zrEventControl
  972. , i = t.zrIsToLocalDOM;
  973. "only_globalout" !== e && this.dispatchToElement(this._hovered, "mouseout", t),
  974. "no_globalout" !== e && (i || this.trigger("globalout", {
  975. type: "globalout",
  976. event: t
  977. }))
  978. },
  979. resize: function(t) {
  980. this._hovered = {}
  981. },
  982. dispatch: function(t, e) {
  983. var i = this[t];
  984. i && i.call(this, e)
  985. },
  986. dispose: function() {
  987. this.proxy.dispose(),
  988. this.storage = this.proxy = this.painter = null
  989. },
  990. setCursorStyle: function(t) {
  991. var e = this.proxy;
  992. e.setCursor && e.setCursor(t)
  993. },
  994. dispatchToElement: function(t, e, i) {
  995. var n = (t = t || {}).target;
  996. if (!n || !n.silent) {
  997. for (var o = "on" + e, a = function(t, e, i) {
  998. return {
  999. type: t,
  1000. event: i,
  1001. target: e.target,
  1002. topTarget: e.topTarget,
  1003. cancelBubble: !1,
  1004. offsetX: i.zrX,
  1005. offsetY: i.zrY,
  1006. gestureEvent: i.gestureEvent,
  1007. pinchX: i.pinchX,
  1008. pinchY: i.pinchY,
  1009. pinchScale: i.pinchScale,
  1010. wheelDelta: i.zrDelta,
  1011. zrByTouch: i.zrByTouch,
  1012. which: i.which,
  1013. stop: Jt
  1014. }
  1015. }(e, t, i); n && (n[o] && (a.cancelBubble = n[o].call(n, a)),
  1016. n.trigger(e, a),
  1017. n = n.parent,
  1018. !a.cancelBubble); )
  1019. ;
  1020. a.cancelBubble || (this.trigger(e, a),
  1021. this.painter && this.painter.eachOtherLayer(function(t) {
  1022. "function" == typeof t[o] && t[o].call(t, a),
  1023. t.trigger && t.trigger(e, a)
  1024. }))
  1025. }
  1026. },
  1027. findHover: function(t, e, i) {
  1028. for (var n = this.storage.getDisplayList(), o = {
  1029. x: t,
  1030. y: e
  1031. }, a = n.length - 1; 0 <= a; a--) {
  1032. var r;
  1033. if (n[a] !== i && !n[a].ignore && (r = ie(n[a], t, e)) && (o.topTarget || (o.topTarget = n[a]),
  1034. r !== $t)) {
  1035. o.target = n[a];
  1036. break
  1037. }
  1038. }
  1039. return o
  1040. },
  1041. processGesture: function(t, e) {
  1042. this._gestureMgr || (this._gestureMgr = new jt);
  1043. var i = this._gestureMgr;
  1044. "start" === e && i.clear();
  1045. var n = i.recognize(t, this.findHover(t.zrX, t.zrY, null).target, this.proxy.dom);
  1046. if ("end" === e && i.clear(),
  1047. n) {
  1048. var o = n.type;
  1049. t.gestureEvent = o,
  1050. this.dispatchToElement({
  1051. target: n.target
  1052. }, o, n.event)
  1053. }
  1054. }
  1055. },
  1056. E(["click", "mousedown", "mouseup", "mousewheel", "dblclick", "contextmenu"], function(r) {
  1057. te.prototype[r] = function(t) {
  1058. var e, i, n = t.zrX, o = t.zrY, a = ne(this, n, o);
  1059. if ("mouseup" === r && a || (i = (e = this.findHover(n, o)).target),
  1060. "mousedown" === r)
  1061. this._downEl = i,
  1062. this._downPoint = [t.zrX, t.zrY],
  1063. this._upEl = i;
  1064. else if ("mouseup" === r)
  1065. this._upEl = i;
  1066. else if ("click" === r) {
  1067. if (this._downEl !== this._upEl || !this._downPoint || 4 < yt(this._downPoint, [t.zrX, t.zrY]))
  1068. return;
  1069. this._downPoint = null
  1070. }
  1071. this.dispatchToElement(e, r, t)
  1072. }
  1073. }),
  1074. b(te, Ct),
  1075. b(te, Tt);
  1076. var oe = "undefined" == typeof Float32Array ? Array : Float32Array;
  1077. function ae() {
  1078. var t = new oe(6);
  1079. return re(t),
  1080. t
  1081. }
  1082. function re(t) {
  1083. return t[0] = 1,
  1084. t[1] = 0,
  1085. t[2] = 0,
  1086. t[3] = 1,
  1087. t[4] = 0,
  1088. t[5] = 0,
  1089. t
  1090. }
  1091. function se(t, e) {
  1092. return t[0] = e[0],
  1093. t[1] = e[1],
  1094. t[2] = e[2],
  1095. t[3] = e[3],
  1096. t[4] = e[4],
  1097. t[5] = e[5],
  1098. t
  1099. }
  1100. function le(t, e, i) {
  1101. var n = e[0] * i[0] + e[2] * i[1]
  1102. , o = e[1] * i[0] + e[3] * i[1]
  1103. , a = e[0] * i[2] + e[2] * i[3]
  1104. , r = e[1] * i[2] + e[3] * i[3]
  1105. , s = e[0] * i[4] + e[2] * i[5] + e[4]
  1106. , l = e[1] * i[4] + e[3] * i[5] + e[5];
  1107. return t[0] = n,
  1108. t[1] = o,
  1109. t[2] = a,
  1110. t[3] = r,
  1111. t[4] = s,
  1112. t[5] = l,
  1113. t
  1114. }
  1115. function ue(t, e, i) {
  1116. return t[0] = e[0],
  1117. t[1] = e[1],
  1118. t[2] = e[2],
  1119. t[3] = e[3],
  1120. t[4] = e[4] + i[0],
  1121. t[5] = e[5] + i[1],
  1122. t
  1123. }
  1124. function he(t, e, i) {
  1125. var n = e[0]
  1126. , o = e[2]
  1127. , a = e[4]
  1128. , r = e[1]
  1129. , s = e[3]
  1130. , l = e[5]
  1131. , u = Math.sin(i)
  1132. , h = Math.cos(i);
  1133. return t[0] = n * h + r * u,
  1134. t[1] = -n * u + r * h,
  1135. t[2] = o * h + s * u,
  1136. t[3] = -o * u + h * s,
  1137. t[4] = h * a + u * l,
  1138. t[5] = h * l - u * a,
  1139. t
  1140. }
  1141. function ce(t, e, i) {
  1142. var n = i[0]
  1143. , o = i[1];
  1144. return t[0] = e[0] * n,
  1145. t[1] = e[1] * o,
  1146. t[2] = e[2] * n,
  1147. t[3] = e[3] * o,
  1148. t[4] = e[4] * n,
  1149. t[5] = e[5] * o,
  1150. t
  1151. }
  1152. function de(t, e) {
  1153. var i = e[0]
  1154. , n = e[2]
  1155. , o = e[4]
  1156. , a = e[1]
  1157. , r = e[3]
  1158. , s = e[5]
  1159. , l = i * r - a * n;
  1160. return l ? (l = 1 / l,
  1161. t[0] = r * l,
  1162. t[1] = -a * l,
  1163. t[2] = -n * l,
  1164. t[3] = i * l,
  1165. t[4] = (n * s - r * o) * l,
  1166. t[5] = (a * o - i * s) * l,
  1167. t) : null
  1168. }
  1169. function fe(t) {
  1170. var e = ae();
  1171. return se(e, t),
  1172. e
  1173. }
  1174. var pe = (Object.freeze || Object)({
  1175. create: ae,
  1176. identity: re,
  1177. copy: se,
  1178. mul: le,
  1179. translate: ue,
  1180. rotate: he,
  1181. scale: ce,
  1182. invert: de,
  1183. clone: fe
  1184. })
  1185. , ge = re;
  1186. function me(t) {
  1187. return 5e-5 < t || t < -5e-5
  1188. }
  1189. var ve = function(t) {
  1190. (t = t || {}).position || (this.position = [0, 0]),
  1191. null == t.rotation && (this.rotation = 0),
  1192. t.scale || (this.scale = [1, 1]),
  1193. this.origin = this.origin || null
  1194. }
  1195. , ye = ve.prototype;
  1196. ye.transform = null,
  1197. ye.needLocalTransform = function() {
  1198. return me(this.rotation) || me(this.position[0]) || me(this.position[1]) || me(this.scale[0] - 1) || me(this.scale[1] - 1)
  1199. }
  1200. ;
  1201. var xe = [];
  1202. ye.updateTransform = function() {
  1203. var t = this.parent
  1204. , e = t && t.transform
  1205. , i = this.needLocalTransform()
  1206. , n = this.transform;
  1207. if (i || e) {
  1208. n = n || ae(),
  1209. i ? this.getLocalTransform(n) : ge(n),
  1210. e && (i ? le(n, t.transform, n) : se(n, t.transform)),
  1211. this.transform = n;
  1212. var o = this.globalScaleRatio;
  1213. if (null != o && 1 !== o) {
  1214. this.getGlobalScale(xe);
  1215. var a = xe[0] < 0 ? -1 : 1
  1216. , r = xe[1] < 0 ? -1 : 1
  1217. , s = ((xe[0] - a) * o + a) / xe[0] || 0
  1218. , l = ((xe[1] - r) * o + r) / xe[1] || 0;
  1219. n[0] *= s,
  1220. n[1] *= s,
  1221. n[2] *= l,
  1222. n[3] *= l
  1223. }
  1224. this.invTransform = this.invTransform || ae(),
  1225. de(this.invTransform, n)
  1226. } else
  1227. n && ge(n)
  1228. }
  1229. ,
  1230. ye.getLocalTransform = function(t) {
  1231. return ve.getLocalTransform(this, t)
  1232. }
  1233. ,
  1234. ye.setTransform = function(t) {
  1235. var e = this.transform
  1236. , i = t.dpr || 1;
  1237. e ? t.setTransform(i * e[0], i * e[1], i * e[2], i * e[3], i * e[4], i * e[5]) : t.setTransform(i, 0, 0, i, 0, 0)
  1238. }
  1239. ,
  1240. ye.restoreTransform = function(t) {
  1241. var e = t.dpr || 1;
  1242. t.setTransform(e, 0, 0, e, 0, 0)
  1243. }
  1244. ;
  1245. var _e = []
  1246. , we = ae();
  1247. ye.setLocalTransform = function(t) {
  1248. if (t) {
  1249. var e = t[0] * t[0] + t[1] * t[1]
  1250. , i = t[2] * t[2] + t[3] * t[3]
  1251. , n = this.position
  1252. , o = this.scale;
  1253. me(e - 1) && (e = Math.sqrt(e)),
  1254. me(i - 1) && (i = Math.sqrt(i)),
  1255. t[0] < 0 && (e = -e),
  1256. t[3] < 0 && (i = -i),
  1257. n[0] = t[4],
  1258. n[1] = t[5],
  1259. o[0] = e,
  1260. o[1] = i,
  1261. this.rotation = Math.atan2(-t[1] / i, t[0] / e)
  1262. }
  1263. }
  1264. ,
  1265. ye.decomposeTransform = function() {
  1266. if (this.transform) {
  1267. var t = this.parent
  1268. , e = this.transform;
  1269. t && t.transform && (le(_e, t.invTransform, e),
  1270. e = _e);
  1271. var i = this.origin;
  1272. i && (i[0] || i[1]) && (we[4] = i[0],
  1273. we[5] = i[1],
  1274. le(_e, e, we),
  1275. _e[4] -= i[0],
  1276. _e[5] -= i[1],
  1277. e = _e),
  1278. this.setLocalTransform(e)
  1279. }
  1280. }
  1281. ,
  1282. ye.getGlobalScale = function(t) {
  1283. var e = this.transform;
  1284. return t = t || [],
  1285. e ? (t[0] = Math.sqrt(e[0] * e[0] + e[1] * e[1]),
  1286. t[1] = Math.sqrt(e[2] * e[2] + e[3] * e[3]),
  1287. e[0] < 0 && (t[0] = -t[0]),
  1288. e[3] < 0 && (t[1] = -t[1])) : (t[0] = 1,
  1289. t[1] = 1),
  1290. t
  1291. }
  1292. ,
  1293. ye.transformCoordToLocal = function(t, e) {
  1294. var i = [t, e]
  1295. , n = this.invTransform;
  1296. return n && bt(i, i, n),
  1297. i
  1298. }
  1299. ,
  1300. ye.transformCoordToGlobal = function(t, e) {
  1301. var i = [t, e]
  1302. , n = this.transform;
  1303. return n && bt(i, i, n),
  1304. i
  1305. }
  1306. ,
  1307. ve.getLocalTransform = function(t, e) {
  1308. ge(e = e || []);
  1309. var i = t.origin
  1310. , n = t.scale || [1, 1]
  1311. , o = t.rotation || 0
  1312. , a = t.position || [0, 0];
  1313. return i && (e[4] -= i[0],
  1314. e[5] -= i[1]),
  1315. ce(e, e, n),
  1316. o && he(e, e, o),
  1317. i && (e[4] += i[0],
  1318. e[5] += i[1]),
  1319. e[4] += a[0],
  1320. e[5] += a[1],
  1321. e
  1322. }
  1323. ;
  1324. var be = {
  1325. linear: function(t) {
  1326. return t
  1327. },
  1328. quadraticIn: function(t) {
  1329. return t * t
  1330. },
  1331. quadraticOut: function(t) {
  1332. return t * (2 - t)
  1333. },
  1334. quadraticInOut: function(t) {
  1335. return (t *= 2) < 1 ? .5 * t * t : -.5 * (--t * (t - 2) - 1)
  1336. },
  1337. cubicIn: function(t) {
  1338. return t * t * t
  1339. },
  1340. cubicOut: function(t) {
  1341. return --t * t * t + 1
  1342. },
  1343. cubicInOut: function(t) {
  1344. return (t *= 2) < 1 ? .5 * t * t * t : .5 * ((t -= 2) * t * t + 2)
  1345. },
  1346. quarticIn: function(t) {
  1347. return t * t * t * t
  1348. },
  1349. quarticOut: function(t) {
  1350. return 1 - --t * t * t * t
  1351. },
  1352. quarticInOut: function(t) {
  1353. return (t *= 2) < 1 ? .5 * t * t * t * t : -.5 * ((t -= 2) * t * t * t - 2)
  1354. },
  1355. quinticIn: function(t) {
  1356. return t * t * t * t * t
  1357. },
  1358. quinticOut: function(t) {
  1359. return --t * t * t * t * t + 1
  1360. },
  1361. quinticInOut: function(t) {
  1362. return (t *= 2) < 1 ? .5 * t * t * t * t * t : .5 * ((t -= 2) * t * t * t * t + 2)
  1363. },
  1364. sinusoidalIn: function(t) {
  1365. return 1 - Math.cos(t * Math.PI / 2)
  1366. },
  1367. sinusoidalOut: function(t) {
  1368. return Math.sin(t * Math.PI / 2)
  1369. },
  1370. sinusoidalInOut: function(t) {
  1371. return .5 * (1 - Math.cos(Math.PI * t))
  1372. },
  1373. exponentialIn: function(t) {
  1374. return 0 === t ? 0 : Math.pow(1024, t - 1)
  1375. },
  1376. exponentialOut: function(t) {
  1377. return 1 === t ? 1 : 1 - Math.pow(2, -10 * t)
  1378. },
  1379. exponentialInOut: function(t) {
  1380. return 0 === t ? 0 : 1 === t ? 1 : (t *= 2) < 1 ? .5 * Math.pow(1024, t - 1) : .5 * (2 - Math.pow(2, -10 * (t - 1)))
  1381. },
  1382. circularIn: function(t) {
  1383. return 1 - Math.sqrt(1 - t * t)
  1384. },
  1385. circularOut: function(t) {
  1386. return Math.sqrt(1 - --t * t)
  1387. },
  1388. circularInOut: function(t) {
  1389. return (t *= 2) < 1 ? -.5 * (Math.sqrt(1 - t * t) - 1) : .5 * (Math.sqrt(1 - (t -= 2) * t) + 1)
  1390. },
  1391. elasticIn: function(t) {
  1392. var e, i = .1;
  1393. return 0 === t ? 0 : 1 === t ? 1 : (e = !i || i < 1 ? (i = 1,
  1394. .1) : .4 * Math.asin(1 / i) / (2 * Math.PI),
  1395. -i * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - e) * (2 * Math.PI) / .4))
  1396. },
  1397. elasticOut: function(t) {
  1398. var e, i = .1;
  1399. return 0 === t ? 0 : 1 === t ? 1 : (e = !i || i < 1 ? (i = 1,
  1400. .1) : .4 * Math.asin(1 / i) / (2 * Math.PI),
  1401. i * Math.pow(2, -10 * t) * Math.sin((t - e) * (2 * Math.PI) / .4) + 1)
  1402. },
  1403. elasticInOut: function(t) {
  1404. var e, i = .1;
  1405. return 0 === t ? 0 : 1 === t ? 1 : (e = !i || i < 1 ? (i = 1,
  1406. .1) : .4 * Math.asin(1 / i) / (2 * Math.PI),
  1407. (t *= 2) < 1 ? i * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - e) * (2 * Math.PI) / .4) * -.5 : i * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - e) * (2 * Math.PI) / .4) * .5 + 1)
  1408. },
  1409. backIn: function(t) {
  1410. return t * t * (2.70158 * t - 1.70158)
  1411. },
  1412. backOut: function(t) {
  1413. return --t * t * (2.70158 * t + 1.70158) + 1
  1414. },
  1415. backInOut: function(t) {
  1416. var e = 2.5949095;
  1417. return (t *= 2) < 1 ? t * t * ((1 + e) * t - e) * .5 : .5 * ((t -= 2) * t * ((1 + e) * t + e) + 2)
  1418. },
  1419. bounceIn: function(t) {
  1420. return 1 - be.bounceOut(1 - t)
  1421. },
  1422. bounceOut: function(t) {
  1423. return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375
  1424. },
  1425. bounceInOut: function(t) {
  1426. return t < .5 ? .5 * be.bounceIn(2 * t) : .5 * be.bounceOut(2 * t - 1) + .5
  1427. }
  1428. };
  1429. function Se(t) {
  1430. this._target = t.target,
  1431. this._life = t.life || 1e3,
  1432. this._delay = t.delay || 0,
  1433. this._initialized = !1,
  1434. this.loop = null != t.loop && t.loop,
  1435. this.gap = t.gap || 0,
  1436. this.easing = t.easing || "Linear",
  1437. this.onframe = t.onframe,
  1438. this.ondestroy = t.ondestroy,
  1439. this.onrestart = t.onrestart,
  1440. this._pausedTime = 0,
  1441. this._paused = !1
  1442. }
  1443. Se.prototype = {
  1444. constructor: Se,
  1445. step: function(t, e) {
  1446. if (this._initialized || (this._startTime = t + this._delay,
  1447. this._initialized = !0),
  1448. this._paused)
  1449. this._pausedTime += e;
  1450. else {
  1451. var i = (t - this._startTime - this._pausedTime) / this._life;
  1452. if (!(i < 0)) {
  1453. i = Math.min(i, 1);
  1454. var n = this.easing
  1455. , o = "string" == typeof n ? be[n] : n
  1456. , a = "function" == typeof o ? o(i) : i;
  1457. return this.fire("frame", a),
  1458. 1 === i ? this.loop ? (this.restart(t),
  1459. "restart") : (this._needsRemove = !0,
  1460. "destroy") : null
  1461. }
  1462. }
  1463. },
  1464. restart: function(t) {
  1465. var e = (t - this._startTime - this._pausedTime) % this._life;
  1466. this._startTime = t - e + this.gap,
  1467. this._pausedTime = 0,
  1468. this._needsRemove = !1
  1469. },
  1470. fire: function(t, e) {
  1471. this[t = "on" + t] && this[t](this._target, e)
  1472. },
  1473. pause: function() {
  1474. this._paused = !0
  1475. },
  1476. resume: function() {
  1477. this._paused = !1
  1478. }
  1479. };
  1480. function Me() {
  1481. this.head = null,
  1482. this.tail = null,
  1483. this._len = 0
  1484. }
  1485. var Ie = Me.prototype;
  1486. Ie.insert = function(t) {
  1487. var e = new Ae(t);
  1488. return this.insertEntry(e),
  1489. e
  1490. }
  1491. ,
  1492. Ie.insertEntry = function(t) {
  1493. this.head ? ((this.tail.next = t).prev = this.tail,
  1494. t.next = null,
  1495. this.tail = t) : this.head = this.tail = t,
  1496. this._len++
  1497. }
  1498. ,
  1499. Ie.remove = function(t) {
  1500. var e = t.prev
  1501. , i = t.next;
  1502. e ? e.next = i : this.head = i,
  1503. i ? i.prev = e : this.tail = e,
  1504. t.next = t.prev = null,
  1505. this._len--
  1506. }
  1507. ,
  1508. Ie.len = function() {
  1509. return this._len
  1510. }
  1511. ,
  1512. Ie.clear = function() {
  1513. this.head = this.tail = null,
  1514. this._len = 0
  1515. }
  1516. ;
  1517. function Te(t) {
  1518. this._list = new Me,
  1519. this._map = {},
  1520. this._maxSize = t || 10,
  1521. this._lastRemovedEntry = null
  1522. }
  1523. var Ae = function(t) {
  1524. this.value = t,
  1525. this.next,
  1526. this.prev
  1527. }
  1528. , De = Te.prototype;
  1529. De.put = function(t, e) {
  1530. var i = this._list
  1531. , n = this._map
  1532. , o = null;
  1533. if (null == n[t]) {
  1534. var a = i.len()
  1535. , r = this._lastRemovedEntry;
  1536. if (a >= this._maxSize && 0 < a) {
  1537. var s = i.head;
  1538. i.remove(s),
  1539. delete n[s.key],
  1540. o = s.value,
  1541. this._lastRemovedEntry = s
  1542. }
  1543. r ? r.value = e : r = new Ae(e),
  1544. r.key = t,
  1545. i.insertEntry(r),
  1546. n[t] = r
  1547. }
  1548. return o
  1549. }
  1550. ,
  1551. De.get = function(t) {
  1552. var e = this._map[t]
  1553. , i = this._list;
  1554. if (null != e)
  1555. return e !== i.tail && (i.remove(e),
  1556. i.insertEntry(e)),
  1557. e.value
  1558. }
  1559. ,
  1560. De.clear = function() {
  1561. this._list.clear(),
  1562. this._map = {}
  1563. }
  1564. ;
  1565. var Ce = {
  1566. transparent: [0, 0, 0, 0],
  1567. aliceblue: [240, 248, 255, 1],
  1568. antiquewhite: [250, 235, 215, 1],
  1569. aqua: [0, 255, 255, 1],
  1570. aquamarine: [127, 255, 212, 1],
  1571. azure: [240, 255, 255, 1],
  1572. beige: [245, 245, 220, 1],
  1573. bisque: [255, 228, 196, 1],
  1574. black: [0, 0, 0, 1],
  1575. blanchedalmond: [255, 235, 205, 1],
  1576. blue: [0, 0, 255, 1],
  1577. blueviolet: [138, 43, 226, 1],
  1578. brown: [165, 42, 42, 1],
  1579. burlywood: [222, 184, 135, 1],
  1580. cadetblue: [95, 158, 160, 1],
  1581. chartreuse: [127, 255, 0, 1],
  1582. chocolate: [210, 105, 30, 1],
  1583. coral: [255, 127, 80, 1],
  1584. cornflowerblue: [100, 149, 237, 1],
  1585. cornsilk: [255, 248, 220, 1],
  1586. crimson: [220, 20, 60, 1],
  1587. cyan: [0, 255, 255, 1],
  1588. darkblue: [0, 0, 139, 1],
  1589. darkcyan: [0, 139, 139, 1],
  1590. darkgoldenrod: [184, 134, 11, 1],
  1591. darkgray: [169, 169, 169, 1],
  1592. darkgreen: [0, 100, 0, 1],
  1593. darkgrey: [169, 169, 169, 1],
  1594. darkkhaki: [189, 183, 107, 1],
  1595. darkmagenta: [139, 0, 139, 1],
  1596. darkolivegreen: [85, 107, 47, 1],
  1597. darkorange: [255, 140, 0, 1],
  1598. darkorchid: [153, 50, 204, 1],
  1599. darkred: [139, 0, 0, 1],
  1600. darksalmon: [233, 150, 122, 1],
  1601. darkseagreen: [143, 188, 143, 1],
  1602. darkslateblue: [72, 61, 139, 1],
  1603. darkslategray: [47, 79, 79, 1],
  1604. darkslategrey: [47, 79, 79, 1],
  1605. darkturquoise: [0, 206, 209, 1],
  1606. darkviolet: [148, 0, 211, 1],
  1607. deeppink: [255, 20, 147, 1],
  1608. deepskyblue: [0, 191, 255, 1],
  1609. dimgray: [105, 105, 105, 1],
  1610. dimgrey: [105, 105, 105, 1],
  1611. dodgerblue: [30, 144, 255, 1],
  1612. firebrick: [178, 34, 34, 1],
  1613. floralwhite: [255, 250, 240, 1],
  1614. forestgreen: [34, 139, 34, 1],
  1615. fuchsia: [255, 0, 255, 1],
  1616. gainsboro: [220, 220, 220, 1],
  1617. ghostwhite: [248, 248, 255, 1],
  1618. gold: [255, 215, 0, 1],
  1619. goldenrod: [218, 165, 32, 1],
  1620. gray: [128, 128, 128, 1],
  1621. green: [0, 128, 0, 1],
  1622. greenyellow: [173, 255, 47, 1],
  1623. grey: [128, 128, 128, 1],
  1624. honeydew: [240, 255, 240, 1],
  1625. hotpink: [255, 105, 180, 1],
  1626. indianred: [205, 92, 92, 1],
  1627. indigo: [75, 0, 130, 1],
  1628. ivory: [255, 255, 240, 1],
  1629. khaki: [240, 230, 140, 1],
  1630. lavender: [230, 230, 250, 1],
  1631. lavenderblush: [255, 240, 245, 1],
  1632. lawngreen: [124, 252, 0, 1],
  1633. lemonchiffon: [255, 250, 205, 1],
  1634. lightblue: [173, 216, 230, 1],
  1635. lightcoral: [240, 128, 128, 1],
  1636. lightcyan: [224, 255, 255, 1],
  1637. lightgoldenrodyellow: [250, 250, 210, 1],
  1638. lightgray: [211, 211, 211, 1],
  1639. lightgreen: [144, 238, 144, 1],
  1640. lightgrey: [211, 211, 211, 1],
  1641. lightpink: [255, 182, 193, 1],
  1642. lightsalmon: [255, 160, 122, 1],
  1643. lightseagreen: [32, 178, 170, 1],
  1644. lightskyblue: [135, 206, 250, 1],
  1645. lightslategray: [119, 136, 153, 1],
  1646. lightslategrey: [119, 136, 153, 1],
  1647. lightsteelblue: [176, 196, 222, 1],
  1648. lightyellow: [255, 255, 224, 1],
  1649. lime: [0, 255, 0, 1],
  1650. limegreen: [50, 205, 50, 1],
  1651. linen: [250, 240, 230, 1],
  1652. magenta: [255, 0, 255, 1],
  1653. maroon: [128, 0, 0, 1],
  1654. mediumaquamarine: [102, 205, 170, 1],
  1655. mediumblue: [0, 0, 205, 1],
  1656. mediumorchid: [186, 85, 211, 1],
  1657. mediumpurple: [147, 112, 219, 1],
  1658. mediumseagreen: [60, 179, 113, 1],
  1659. mediumslateblue: [123, 104, 238, 1],
  1660. mediumspringgreen: [0, 250, 154, 1],
  1661. mediumturquoise: [72, 209, 204, 1],
  1662. mediumvioletred: [199, 21, 133, 1],
  1663. midnightblue: [25, 25, 112, 1],
  1664. mintcream: [245, 255, 250, 1],
  1665. mistyrose: [255, 228, 225, 1],
  1666. moccasin: [255, 228, 181, 1],
  1667. navajowhite: [255, 222, 173, 1],
  1668. navy: [0, 0, 128, 1],
  1669. oldlace: [253, 245, 230, 1],
  1670. olive: [128, 128, 0, 1],
  1671. olivedrab: [107, 142, 35, 1],
  1672. orange: [255, 165, 0, 1],
  1673. orangered: [255, 69, 0, 1],
  1674. orchid: [218, 112, 214, 1],
  1675. palegoldenrod: [238, 232, 170, 1],
  1676. palegreen: [152, 251, 152, 1],
  1677. paleturquoise: [175, 238, 238, 1],
  1678. palevioletred: [219, 112, 147, 1],
  1679. papayawhip: [255, 239, 213, 1],
  1680. peachpuff: [255, 218, 185, 1],
  1681. peru: [205, 133, 63, 1],
  1682. pink: [255, 192, 203, 1],
  1683. plum: [221, 160, 221, 1],
  1684. powderblue: [176, 224, 230, 1],
  1685. purple: [128, 0, 128, 1],
  1686. red: [255, 0, 0, 1],
  1687. rosybrown: [188, 143, 143, 1],
  1688. royalblue: [65, 105, 225, 1],
  1689. saddlebrown: [139, 69, 19, 1],
  1690. salmon: [250, 128, 114, 1],
  1691. sandybrown: [244, 164, 96, 1],
  1692. seagreen: [46, 139, 87, 1],
  1693. seashell: [255, 245, 238, 1],
  1694. sienna: [160, 82, 45, 1],
  1695. silver: [192, 192, 192, 1],
  1696. skyblue: [135, 206, 235, 1],
  1697. slateblue: [106, 90, 205, 1],
  1698. slategray: [112, 128, 144, 1],
  1699. slategrey: [112, 128, 144, 1],
  1700. snow: [255, 250, 250, 1],
  1701. springgreen: [0, 255, 127, 1],
  1702. steelblue: [70, 130, 180, 1],
  1703. tan: [210, 180, 140, 1],
  1704. teal: [0, 128, 128, 1],
  1705. thistle: [216, 191, 216, 1],
  1706. tomato: [255, 99, 71, 1],
  1707. turquoise: [64, 224, 208, 1],
  1708. violet: [238, 130, 238, 1],
  1709. wheat: [245, 222, 179, 1],
  1710. white: [255, 255, 255, 1],
  1711. whitesmoke: [245, 245, 245, 1],
  1712. yellow: [255, 255, 0, 1],
  1713. yellowgreen: [154, 205, 50, 1]
  1714. };
  1715. function Le(t) {
  1716. return (t = Math.round(t)) < 0 ? 0 : 255 < t ? 255 : t
  1717. }
  1718. function ke(t) {
  1719. return t < 0 ? 0 : 1 < t ? 1 : t
  1720. }
  1721. function Pe(t) {
  1722. return t.length && "%" === t.charAt(t.length - 1) ? Le(parseFloat(t) / 100 * 255) : Le(parseInt(t, 10))
  1723. }
  1724. function Ne(t) {
  1725. return t.length && "%" === t.charAt(t.length - 1) ? ke(parseFloat(t) / 100) : ke(parseFloat(t))
  1726. }
  1727. function Oe(t, e, i) {
  1728. return i < 0 ? i += 1 : 1 < i && (i -= 1),
  1729. 6 * i < 1 ? t + (e - t) * i * 6 : 2 * i < 1 ? e : 3 * i < 2 ? t + (e - t) * (2 / 3 - i) * 6 : t
  1730. }
  1731. function Ee(t, e, i) {
  1732. return t + (e - t) * i
  1733. }
  1734. function Re(t, e, i, n, o) {
  1735. return t[0] = e,
  1736. t[1] = i,
  1737. t[2] = n,
  1738. t[3] = o,
  1739. t
  1740. }
  1741. function ze(t, e) {
  1742. return t[0] = e[0],
  1743. t[1] = e[1],
  1744. t[2] = e[2],
  1745. t[3] = e[3],
  1746. t
  1747. }
  1748. var Be = new Te(20)
  1749. , Ve = null;
  1750. function Ge(t, e) {
  1751. Ve && ze(Ve, e),
  1752. Ve = Be.put(t, Ve || e.slice())
  1753. }
  1754. function Fe(t, e) {
  1755. if (t) {
  1756. e = e || [];
  1757. var i = Be.get(t);
  1758. if (i)
  1759. return ze(e, i);
  1760. var n, o = (t += "").replace(/ /g, "").toLowerCase();
  1761. if (o in Ce)
  1762. return ze(e, Ce[o]),
  1763. Ge(t, e),
  1764. e;
  1765. if ("#" === o.charAt(0))
  1766. return 4 === o.length ? 0 <= (n = parseInt(o.substr(1), 16)) && n <= 4095 ? (Re(e, (3840 & n) >> 4 | (3840 & n) >> 8, 240 & n | (240 & n) >> 4, 15 & n | (15 & n) << 4, 1),
  1767. Ge(t, e),
  1768. e) : void Re(e, 0, 0, 0, 1) : 7 === o.length ? 0 <= (n = parseInt(o.substr(1), 16)) && n <= 16777215 ? (Re(e, (16711680 & n) >> 16, (65280 & n) >> 8, 255 & n, 1),
  1769. Ge(t, e),
  1770. e) : void Re(e, 0, 0, 0, 1) : void 0;
  1771. var a = o.indexOf("(")
  1772. , r = o.indexOf(")");
  1773. if (-1 !== a && r + 1 === o.length) {
  1774. var s = o.substr(0, a)
  1775. , l = o.substr(a + 1, r - (a + 1)).split(",")
  1776. , u = 1;
  1777. switch (s) {
  1778. case "rgba":
  1779. if (4 !== l.length)
  1780. return void Re(e, 0, 0, 0, 1);
  1781. u = Ne(l.pop());
  1782. case "rgb":
  1783. return 3 !== l.length ? void Re(e, 0, 0, 0, 1) : (Re(e, Pe(l[0]), Pe(l[1]), Pe(l[2]), u),
  1784. Ge(t, e),
  1785. e);
  1786. case "hsla":
  1787. return 4 !== l.length ? void Re(e, 0, 0, 0, 1) : (l[3] = Ne(l[3]),
  1788. We(l, e),
  1789. Ge(t, e),
  1790. e);
  1791. case "hsl":
  1792. return 3 !== l.length ? void Re(e, 0, 0, 0, 1) : (We(l, e),
  1793. Ge(t, e),
  1794. e);
  1795. default:
  1796. return
  1797. }
  1798. }
  1799. Re(e, 0, 0, 0, 1)
  1800. }
  1801. }
  1802. function We(t, e) {
  1803. var i = (parseFloat(t[0]) % 360 + 360) % 360 / 360
  1804. , n = Ne(t[1])
  1805. , o = Ne(t[2])
  1806. , a = o <= .5 ? o * (n + 1) : o + n - o * n
  1807. , r = 2 * o - a;
  1808. return Re(e = e || [], Le(255 * Oe(r, a, i + 1 / 3)), Le(255 * Oe(r, a, i)), Le(255 * Oe(r, a, i - 1 / 3)), 1),
  1809. 4 === t.length && (e[3] = t[3]),
  1810. e
  1811. }
  1812. function He(t, e) {
  1813. var i = Fe(t);
  1814. if (i) {
  1815. for (var n = 0; n < 3; n++)
  1816. i[n] = e < 0 ? i[n] * (1 - e) | 0 : (255 - i[n]) * e + i[n] | 0,
  1817. 255 < i[n] ? i[n] = 255 : t[n] < 0 && (i[n] = 0);
  1818. return $e(i, 4 === i.length ? "rgba" : "rgb")
  1819. }
  1820. }
  1821. function Ze(t) {
  1822. var e = Fe(t);
  1823. if (e)
  1824. return ((1 << 24) + (e[0] << 16) + (e[1] << 8) + +e[2]).toString(16).slice(1)
  1825. }
  1826. function Ue(t, e, i) {
  1827. if (e && e.length && 0 <= t && t <= 1) {
  1828. i = i || [];
  1829. var n = t * (e.length - 1)
  1830. , o = Math.floor(n)
  1831. , a = Math.ceil(n)
  1832. , r = e[o]
  1833. , s = e[a]
  1834. , l = n - o;
  1835. return i[0] = Le(Ee(r[0], s[0], l)),
  1836. i[1] = Le(Ee(r[1], s[1], l)),
  1837. i[2] = Le(Ee(r[2], s[2], l)),
  1838. i[3] = ke(Ee(r[3], s[3], l)),
  1839. i
  1840. }
  1841. }
  1842. var Xe = Ue;
  1843. function Ye(t, e, i) {
  1844. if (e && e.length && 0 <= t && t <= 1) {
  1845. var n = t * (e.length - 1)
  1846. , o = Math.floor(n)
  1847. , a = Math.ceil(n)
  1848. , r = Fe(e[o])
  1849. , s = Fe(e[a])
  1850. , l = n - o
  1851. , u = $e([Le(Ee(r[0], s[0], l)), Le(Ee(r[1], s[1], l)), Le(Ee(r[2], s[2], l)), ke(Ee(r[3], s[3], l))], "rgba");
  1852. return i ? {
  1853. color: u,
  1854. leftIndex: o,
  1855. rightIndex: a,
  1856. value: n
  1857. } : u
  1858. }
  1859. }
  1860. var je = Ye;
  1861. function qe(t, e, i, n) {
  1862. if (t = Fe(t))
  1863. return t = function(t) {
  1864. if (t) {
  1865. var e, i, n = t[0] / 255, o = t[1] / 255, a = t[2] / 255, r = Math.min(n, o, a), s = Math.max(n, o, a), l = s - r, u = (s + r) / 2;
  1866. if (0 == l)
  1867. i = e = 0;
  1868. else {
  1869. i = u < .5 ? l / (s + r) : l / (2 - s - r);
  1870. var h = ((s - n) / 6 + l / 2) / l
  1871. , c = ((s - o) / 6 + l / 2) / l
  1872. , d = ((s - a) / 6 + l / 2) / l;
  1873. n === s ? e = d - c : o === s ? e = 1 / 3 + h - d : a === s && (e = 2 / 3 + c - h),
  1874. e < 0 && (e += 1),
  1875. 1 < e && (e -= 1)
  1876. }
  1877. var f = [360 * e, i, u];
  1878. return null != t[3] && f.push(t[3]),
  1879. f
  1880. }
  1881. }(t),
  1882. null != e && (t[0] = function(t) {
  1883. return (t = Math.round(t)) < 0 ? 0 : 360 < t ? 360 : t
  1884. }(e)),
  1885. null != i && (t[1] = Ne(i)),
  1886. null != n && (t[2] = Ne(n)),
  1887. $e(We(t), "rgba")
  1888. }
  1889. function Ke(t, e) {
  1890. if ((t = Fe(t)) && null != e)
  1891. return t[3] = ke(e),
  1892. $e(t, "rgba")
  1893. }
  1894. function $e(t, e) {
  1895. if (t && t.length) {
  1896. var i = t[0] + "," + t[1] + "," + t[2];
  1897. return "rgba" !== e && "hsva" !== e && "hsla" !== e || (i += "," + t[3]),
  1898. e + "(" + i + ")"
  1899. }
  1900. }
  1901. var Je = (Object.freeze || Object)({
  1902. parse: Fe,
  1903. lift: He,
  1904. toHex: Ze,
  1905. fastLerp: Ue,
  1906. fastMapToColor: Xe,
  1907. lerp: Ye,
  1908. mapToColor: je,
  1909. modifyHSL: qe,
  1910. modifyAlpha: Ke,
  1911. stringify: $e
  1912. })
  1913. , Qe = Array.prototype.slice;
  1914. function ti(t, e) {
  1915. return t[e]
  1916. }
  1917. function ei(t, e, i) {
  1918. t[e] = i
  1919. }
  1920. function ii(t, e, i) {
  1921. return (e - t) * i + t
  1922. }
  1923. function ni(t, e, i) {
  1924. return .5 < i ? e : t
  1925. }
  1926. function oi(t, e, i, n, o) {
  1927. var a = t.length;
  1928. if (1 === o)
  1929. for (var r = 0; r < a; r++)
  1930. n[r] = ii(t[r], e[r], i);
  1931. else {
  1932. var s = a && t[0].length;
  1933. for (r = 0; r < a; r++)
  1934. for (var l = 0; l < s; l++)
  1935. n[r][l] = ii(t[r][l], e[r][l], i)
  1936. }
  1937. }
  1938. function ai(t, e, i) {
  1939. var n = t.length
  1940. , o = e.length;
  1941. if (n !== o)
  1942. if (o < n)
  1943. t.length = o;
  1944. else
  1945. for (var a = n; a < o; a++)
  1946. t.push(1 === i ? e[a] : Qe.call(e[a]));
  1947. var r = t[0] && t[0].length;
  1948. for (a = 0; a < t.length; a++)
  1949. if (1 === i)
  1950. isNaN(t[a]) && (t[a] = e[a]);
  1951. else
  1952. for (var s = 0; s < r; s++)
  1953. isNaN(t[a][s]) && (t[a][s] = e[a][s])
  1954. }
  1955. function ri(t, e, i) {
  1956. if (t === e)
  1957. return !0;
  1958. var n = t.length;
  1959. if (n !== e.length)
  1960. return !1;
  1961. if (1 === i) {
  1962. for (var o = 0; o < n; o++)
  1963. if (t[o] !== e[o])
  1964. return !1
  1965. } else {
  1966. var a = t[0].length;
  1967. for (o = 0; o < n; o++)
  1968. for (var r = 0; r < a; r++)
  1969. if (t[o][r] !== e[o][r])
  1970. return !1
  1971. }
  1972. return !0
  1973. }
  1974. function si(t, e, i, n, o, a, r, s, l) {
  1975. var u = t.length;
  1976. if (1 === l)
  1977. for (var h = 0; h < u; h++)
  1978. s[h] = li(t[h], e[h], i[h], n[h], o, a, r);
  1979. else {
  1980. var c = t[0].length;
  1981. for (h = 0; h < u; h++)
  1982. for (var d = 0; d < c; d++)
  1983. s[h][d] = li(t[h][d], e[h][d], i[h][d], n[h][d], o, a, r)
  1984. }
  1985. }
  1986. function li(t, e, i, n, o, a, r) {
  1987. var s = .5 * (i - t)
  1988. , l = .5 * (n - e);
  1989. return (2 * (e - i) + s + l) * r + (-3 * (e - i) - 2 * s - l) * a + s * o + e
  1990. }
  1991. function ui(t) {
  1992. if (N(t)) {
  1993. var e = t.length;
  1994. if (N(t[0])) {
  1995. for (var i = [], n = 0; n < e; n++)
  1996. i.push(Qe.call(t[n]));
  1997. return i
  1998. }
  1999. return Qe.call(t)
  2000. }
  2001. return t
  2002. }
  2003. function hi(t) {
  2004. return t[0] = Math.floor(t[0]),
  2005. t[1] = Math.floor(t[1]),
  2006. t[2] = Math.floor(t[2]),
  2007. "rgba(" + t.join(",") + ")"
  2008. }
  2009. function ci(t, e, i, n, a, o) {
  2010. var r = t._getter
  2011. , s = t._setter
  2012. , l = "spline" === e
  2013. , u = n.length;
  2014. if (u) {
  2015. var h, c = N(n[0].value), d = !1, f = !1, p = c ? function(t) {
  2016. var e = t[t.length - 1].value;
  2017. return N(e && e[0]) ? 2 : 1
  2018. }(n) : 0;
  2019. n.sort(function(t, e) {
  2020. return t.time - e.time
  2021. }),
  2022. h = n[u - 1].time;
  2023. for (var g = [], m = [], v = n[0].value, y = !0, x = 0; x < u; x++) {
  2024. g.push(n[x].time / h);
  2025. var _ = n[x].value;
  2026. if (c && ri(_, v, p) || !c && _ === v || (y = !1),
  2027. "string" == typeof (v = _)) {
  2028. var w = Fe(_);
  2029. w ? (_ = w,
  2030. d = !0) : f = !0
  2031. }
  2032. m.push(_)
  2033. }
  2034. if (o || !y) {
  2035. var b = m[u - 1];
  2036. for (x = 0; x < u - 1; x++)
  2037. c ? ai(m[x], b, p) : !isNaN(m[x]) || isNaN(b) || f || d || (m[x] = b);
  2038. c && ai(r(t._target, a), b, p);
  2039. var S, M, I, T, A, D = 0, C = 0;
  2040. if (d)
  2041. var L = [0, 0, 0, 0];
  2042. var k = new Se({
  2043. target: t._target,
  2044. life: h,
  2045. loop: t._loop,
  2046. delay: t._delay,
  2047. onframe: function(t, e) {
  2048. var i;
  2049. if (e < 0)
  2050. i = 0;
  2051. else if (e < C) {
  2052. for (i = Math.min(D + 1, u - 1); 0 <= i && !(g[i] <= e); i--)
  2053. ;
  2054. i = Math.min(i, u - 2)
  2055. } else {
  2056. for (i = D; i < u && !(g[i] > e); i++)
  2057. ;
  2058. i = Math.min(i - 1, u - 2)
  2059. }
  2060. C = e;
  2061. var n = g[(D = i) + 1] - g[i];
  2062. if (0 != n)
  2063. if (S = (e - g[i]) / n,
  2064. l)
  2065. if (I = m[i],
  2066. M = m[0 === i ? i : i - 1],
  2067. T = m[u - 2 < i ? u - 1 : i + 1],
  2068. A = m[u - 3 < i ? u - 1 : i + 2],
  2069. c)
  2070. si(M, I, T, A, S, S * S, S * S * S, r(t, a), p);
  2071. else {
  2072. if (d)
  2073. o = si(M, I, T, A, S, S * S, S * S * S, L, 1),
  2074. o = hi(L);
  2075. else {
  2076. if (f)
  2077. return ni(I, T, S);
  2078. o = li(M, I, T, A, S, S * S, S * S * S)
  2079. }
  2080. s(t, a, o)
  2081. }
  2082. else if (c)
  2083. oi(m[i], m[i + 1], S, r(t, a), p);
  2084. else {
  2085. var o;
  2086. if (d)
  2087. oi(m[i], m[i + 1], S, L, 1),
  2088. o = hi(L);
  2089. else {
  2090. if (f)
  2091. return ni(m[i], m[i + 1], S);
  2092. o = ii(m[i], m[i + 1], S)
  2093. }
  2094. s(t, a, o)
  2095. }
  2096. },
  2097. ondestroy: i
  2098. });
  2099. return e && "spline" !== e && (k.easing = e),
  2100. k
  2101. }
  2102. }
  2103. }
  2104. function di(t, e, i, n) {
  2105. this._tracks = {},
  2106. this._target = t,
  2107. this._loop = e || !1,
  2108. this._getter = i || ti,
  2109. this._setter = n || ei,
  2110. this._clipCount = 0,
  2111. this._delay = 0,
  2112. this._doneList = [],
  2113. this._onframeList = [],
  2114. this._clipList = []
  2115. }
  2116. di.prototype = {
  2117. when: function(t, e) {
  2118. var i = this._tracks;
  2119. for (var n in e)
  2120. if (e.hasOwnProperty(n)) {
  2121. if (!i[n]) {
  2122. i[n] = [];
  2123. var o = this._getter(this._target, n);
  2124. if (null == o)
  2125. continue;
  2126. 0 !== t && i[n].push({
  2127. time: 0,
  2128. value: ui(o)
  2129. })
  2130. }
  2131. i[n].push({
  2132. time: t,
  2133. value: e[n]
  2134. })
  2135. }
  2136. return this
  2137. },
  2138. during: function(t) {
  2139. return this._onframeList.push(t),
  2140. this
  2141. },
  2142. pause: function() {
  2143. for (var t = 0; t < this._clipList.length; t++)
  2144. this._clipList[t].pause();
  2145. this._paused = !0
  2146. },
  2147. resume: function() {
  2148. for (var t = 0; t < this._clipList.length; t++)
  2149. this._clipList[t].resume();
  2150. this._paused = !1
  2151. },
  2152. isPaused: function() {
  2153. return !!this._paused
  2154. },
  2155. _doneCallback: function() {
  2156. this._tracks = {},
  2157. this._clipList.length = 0;
  2158. for (var t = this._doneList, e = t.length, i = 0; i < e; i++)
  2159. t[i].call(this)
  2160. },
  2161. start: function(t, e) {
  2162. function i() {
  2163. --a || o._doneCallback()
  2164. }
  2165. var n, o = this, a = 0;
  2166. for (var r in this._tracks)
  2167. if (this._tracks.hasOwnProperty(r)) {
  2168. var s = ci(this, t, i, this._tracks[r], r, e);
  2169. s && (this._clipList.push(s),
  2170. a++,
  2171. this.animation && this.animation.addClip(s),
  2172. n = s)
  2173. }
  2174. if (n) {
  2175. var l = n.onframe;
  2176. n.onframe = function(t, e) {
  2177. l(t, e);
  2178. for (var i = 0; i < o._onframeList.length; i++)
  2179. o._onframeList[i](t, e)
  2180. }
  2181. }
  2182. return a || this._doneCallback(),
  2183. this
  2184. },
  2185. stop: function(t) {
  2186. for (var e = this._clipList, i = this.animation, n = 0; n < e.length; n++) {
  2187. var o = e[n];
  2188. t && o.onframe(this._target, 1),
  2189. i && i.removeClip(o)
  2190. }
  2191. e.length = 0
  2192. },
  2193. delay: function(t) {
  2194. return this._delay = t,
  2195. this
  2196. },
  2197. done: function(t) {
  2198. return t && this._doneList.push(t),
  2199. this
  2200. },
  2201. getClips: function() {
  2202. return this._clipList
  2203. }
  2204. };
  2205. var fi = 1;
  2206. "undefined" != typeof window && (fi = Math.max(window.devicePixelRatio || 1, 1));
  2207. var pi = fi
  2208. , gi = function() {};
  2209. function mi() {
  2210. this.animators = []
  2211. }
  2212. var vi = gi;
  2213. function yi(t, e, i, n, o, a, r, s) {
  2214. R(n) ? (a = o,
  2215. o = n,
  2216. n = 0) : C(o) ? (a = o,
  2217. o = "linear",
  2218. n = 0) : C(n) ? (a = n,
  2219. n = 0) : i = C(i) ? (a = i,
  2220. 500) : i || 500,
  2221. t.stopAnimation(),
  2222. function t(e, i, n, o, a, r, s) {
  2223. var l = {};
  2224. var u = 0;
  2225. for (var h in o)
  2226. o.hasOwnProperty(h) && (null != n[h] ? z(o[h]) && !N(o[h]) ? t(e, i ? i + "." + h : h, n[h], o[h], a, r, s) : (s ? (l[h] = n[h],
  2227. xi(e, i, h, o[h])) : l[h] = o[h],
  2228. u++) : null == o[h] || s || xi(e, i, h, o[h]));
  2229. 0 < u && e.animate(i, !1).when(null == a ? 500 : a, l).delay(r || 0)
  2230. }(t, "", t, e, i, n, s);
  2231. var l = t.animators.slice()
  2232. , u = l.length;
  2233. function h() {
  2234. --u || a && a()
  2235. }
  2236. u || a && a();
  2237. for (var c = 0; c < l.length; c++)
  2238. l[c].done(h).start(o, r)
  2239. }
  2240. function xi(t, e, i, n) {
  2241. if (e) {
  2242. var o = {};
  2243. o[e] = {},
  2244. o[e][i] = n,
  2245. t.attr(o)
  2246. } else
  2247. t.attr(i, n)
  2248. }
  2249. mi.prototype = {
  2250. constructor: mi,
  2251. animate: function(t, e) {
  2252. var i, n = !1, o = this, a = this.__zr;
  2253. if (t) {
  2254. var r = t.split(".")
  2255. , s = o;
  2256. n = "shape" === r[0];
  2257. for (var l = 0, u = r.length; l < u; l++)
  2258. s = s && s[r[l]];
  2259. s && (i = s)
  2260. } else
  2261. i = o;
  2262. if (i) {
  2263. var h = o.animators
  2264. , c = new di(i,e);
  2265. return c.during(function(t) {
  2266. o.dirty(n)
  2267. }).done(function() {
  2268. h.splice(_(h, c), 1)
  2269. }),
  2270. h.push(c),
  2271. a && a.animation.addAnimator(c),
  2272. c
  2273. }
  2274. vi('Property "' + t + '" is not existed in element ' + o.id)
  2275. },
  2276. stopAnimation: function(t) {
  2277. for (var e = this.animators, i = e.length, n = 0; n < i; n++)
  2278. e[n].stop(t);
  2279. return e.length = 0,
  2280. this
  2281. },
  2282. animateTo: function(t, e, i, n, o, a) {
  2283. yi(this, t, e, i, n, o, a)
  2284. },
  2285. animateFrom: function(t, e, i, n, o, a) {
  2286. yi(this, t, e, i, n, o, a, !0)
  2287. }
  2288. };
  2289. var _i = function(t) {
  2290. ve.call(this, t),
  2291. Ct.call(this, t),
  2292. mi.call(this, t),
  2293. this.id = t.id || n()
  2294. };
  2295. _i.prototype = {
  2296. type: "element",
  2297. name: "",
  2298. __zr: null,
  2299. ignore: !1,
  2300. clipPath: null,
  2301. isGroup: !1,
  2302. drift: function(t, e) {
  2303. switch (this.draggable) {
  2304. case "horizontal":
  2305. e = 0;
  2306. break;
  2307. case "vertical":
  2308. t = 0
  2309. }
  2310. var i = this.transform;
  2311. (i = i || (this.transform = [1, 0, 0, 1, 0, 0]))[4] += t,
  2312. i[5] += e,
  2313. this.decomposeTransform(),
  2314. this.dirty(!1)
  2315. },
  2316. beforeUpdate: function() {},
  2317. afterUpdate: function() {},
  2318. update: function() {
  2319. this.updateTransform()
  2320. },
  2321. traverse: function(t, e) {},
  2322. attrKV: function(t, e) {
  2323. if ("position" === t || "scale" === t || "origin" === t) {
  2324. if (e) {
  2325. var i = this[t];
  2326. (i = i || (this[t] = []))[0] = e[0],
  2327. i[1] = e[1]
  2328. }
  2329. } else
  2330. this[t] = e
  2331. },
  2332. hide: function() {
  2333. this.ignore = !0,
  2334. this.__zr && this.__zr.refresh()
  2335. },
  2336. show: function() {
  2337. this.ignore = !1,
  2338. this.__zr && this.__zr.refresh()
  2339. },
  2340. attr: function(t, e) {
  2341. if ("string" == typeof t)
  2342. this.attrKV(t, e);
  2343. else if (z(t))
  2344. for (var i in t)
  2345. t.hasOwnProperty(i) && this.attrKV(i, t[i]);
  2346. return this.dirty(!1),
  2347. this
  2348. },
  2349. setClipPath: function(t) {
  2350. var e = this.__zr;
  2351. e && t.addSelfToZr(e),
  2352. this.clipPath && this.clipPath !== t && this.removeClipPath(),
  2353. (this.clipPath = t).__zr = e,
  2354. (t.__clipTarget = this).dirty(!1)
  2355. },
  2356. removeClipPath: function() {
  2357. var t = this.clipPath;
  2358. t && (t.__zr && t.removeSelfFromZr(t.__zr),
  2359. t.__zr = null,
  2360. t.__clipTarget = null,
  2361. this.clipPath = null,
  2362. this.dirty(!1))
  2363. },
  2364. addSelfToZr: function(t) {
  2365. this.__zr = t;
  2366. var e = this.animators;
  2367. if (e)
  2368. for (var i = 0; i < e.length; i++)
  2369. t.animation.addAnimator(e[i]);
  2370. this.clipPath && this.clipPath.addSelfToZr(t)
  2371. },
  2372. removeSelfFromZr: function(t) {
  2373. this.__zr = null;
  2374. var e = this.animators;
  2375. if (e)
  2376. for (var i = 0; i < e.length; i++)
  2377. t.animation.removeAnimator(e[i]);
  2378. this.clipPath && this.clipPath.removeSelfFromZr(t)
  2379. }
  2380. },
  2381. b(_i, mi),
  2382. b(_i, ve),
  2383. b(_i, Ct);
  2384. var wi, bi, Si, Mi, Ii = bt, Ti = Math.min, Ai = Math.max;
  2385. function Di(t, e, i, n) {
  2386. i < 0 && (t += i,
  2387. i = -i),
  2388. n < 0 && (e += n,
  2389. n = -n),
  2390. this.x = t,
  2391. this.y = e,
  2392. this.width = i,
  2393. this.height = n
  2394. }
  2395. Di.prototype = {
  2396. constructor: Di,
  2397. union: function(t) {
  2398. var e = Ti(t.x, this.x)
  2399. , i = Ti(t.y, this.y);
  2400. this.width = Ai(t.x + t.width, this.x + this.width) - e,
  2401. this.height = Ai(t.y + t.height, this.y + this.height) - i,
  2402. this.x = e,
  2403. this.y = i
  2404. },
  2405. applyTransform: (wi = [],
  2406. bi = [],
  2407. Si = [],
  2408. Mi = [],
  2409. function(t) {
  2410. if (t) {
  2411. wi[0] = Si[0] = this.x,
  2412. wi[1] = Mi[1] = this.y,
  2413. bi[0] = Mi[0] = this.x + this.width,
  2414. bi[1] = Si[1] = this.y + this.height,
  2415. Ii(wi, wi, t),
  2416. Ii(bi, bi, t),
  2417. Ii(Si, Si, t),
  2418. Ii(Mi, Mi, t),
  2419. this.x = Ti(wi[0], bi[0], Si[0], Mi[0]),
  2420. this.y = Ti(wi[1], bi[1], Si[1], Mi[1]);
  2421. var e = Ai(wi[0], bi[0], Si[0], Mi[0])
  2422. , i = Ai(wi[1], bi[1], Si[1], Mi[1]);
  2423. this.width = e - this.x,
  2424. this.height = i - this.y
  2425. }
  2426. }
  2427. ),
  2428. calculateTransform: function(t) {
  2429. var e = t.width / this.width
  2430. , i = t.height / this.height
  2431. , n = ae();
  2432. return ue(n, n, [-this.x, -this.y]),
  2433. ce(n, n, [e, i]),
  2434. ue(n, n, [t.x, t.y]),
  2435. n
  2436. },
  2437. intersect: function(t) {
  2438. if (!t)
  2439. return !1;
  2440. t instanceof Di || (t = Di.create(t));
  2441. var e = this
  2442. , i = e.x
  2443. , n = e.x + e.width
  2444. , o = e.y
  2445. , a = e.y + e.height
  2446. , r = t.x
  2447. , s = t.x + t.width
  2448. , l = t.y
  2449. , u = t.y + t.height;
  2450. return !(n < r || s < i || a < l || u < o)
  2451. },
  2452. contain: function(t, e) {
  2453. var i = this;
  2454. return t >= i.x && t <= i.x + i.width && e >= i.y && e <= i.y + i.height
  2455. },
  2456. clone: function() {
  2457. return new Di(this.x,this.y,this.width,this.height)
  2458. },
  2459. copy: function(t) {
  2460. this.x = t.x,
  2461. this.y = t.y,
  2462. this.width = t.width,
  2463. this.height = t.height
  2464. },
  2465. plain: function() {
  2466. return {
  2467. x: this.x,
  2468. y: this.y,
  2469. width: this.width,
  2470. height: this.height
  2471. }
  2472. }
  2473. },
  2474. Di.create = function(t) {
  2475. return new Di(t.x,t.y,t.width,t.height)
  2476. }
  2477. ;
  2478. var Ci = function(t) {
  2479. for (var e in t = t || {},
  2480. _i.call(this, t),
  2481. t)
  2482. t.hasOwnProperty(e) && (this[e] = t[e]);
  2483. this._children = [],
  2484. this.__storage = null,
  2485. this.__dirty = !0
  2486. };
  2487. Ci.prototype = {
  2488. constructor: Ci,
  2489. isGroup: !0,
  2490. type: "group",
  2491. silent: !1,
  2492. children: function() {
  2493. return this._children.slice()
  2494. },
  2495. childAt: function(t) {
  2496. return this._children[t]
  2497. },
  2498. childOfName: function(t) {
  2499. for (var e = this._children, i = 0; i < e.length; i++)
  2500. if (e[i].name === t)
  2501. return e[i]
  2502. },
  2503. childCount: function() {
  2504. return this._children.length
  2505. },
  2506. add: function(t) {
  2507. return t && t !== this && t.parent !== this && (this._children.push(t),
  2508. this._doAdd(t)),
  2509. this
  2510. },
  2511. addBefore: function(t, e) {
  2512. if (t && t !== this && t.parent !== this && e && e.parent === this) {
  2513. var i = this._children
  2514. , n = i.indexOf(e);
  2515. 0 <= n && (i.splice(n, 0, t),
  2516. this._doAdd(t))
  2517. }
  2518. return this
  2519. },
  2520. _doAdd: function(t) {
  2521. t.parent && t.parent.remove(t);
  2522. var e = (t.parent = this).__storage
  2523. , i = this.__zr;
  2524. e && e !== t.__storage && (e.addToStorage(t),
  2525. t instanceof Ci && t.addChildrenToStorage(e)),
  2526. i && i.refresh()
  2527. },
  2528. remove: function(t) {
  2529. var e = this.__zr
  2530. , i = this.__storage
  2531. , n = this._children
  2532. , o = _(n, t);
  2533. return o < 0 || (n.splice(o, 1),
  2534. t.parent = null,
  2535. i && (i.delFromStorage(t),
  2536. t instanceof Ci && t.delChildrenFromStorage(i)),
  2537. e && e.refresh()),
  2538. this
  2539. },
  2540. removeAll: function() {
  2541. var t, e, i = this._children, n = this.__storage;
  2542. for (e = 0; e < i.length; e++)
  2543. t = i[e],
  2544. n && (n.delFromStorage(t),
  2545. t instanceof Ci && t.delChildrenFromStorage(n)),
  2546. t.parent = null;
  2547. return i.length = 0,
  2548. this
  2549. },
  2550. eachChild: function(t, e) {
  2551. for (var i = this._children, n = 0; n < i.length; n++) {
  2552. var o = i[n];
  2553. t.call(e, o, n)
  2554. }
  2555. return this
  2556. },
  2557. traverse: function(t, e) {
  2558. for (var i = 0; i < this._children.length; i++) {
  2559. var n = this._children[i];
  2560. t.call(e, n),
  2561. "group" === n.type && n.traverse(t, e)
  2562. }
  2563. return this
  2564. },
  2565. addChildrenToStorage: function(t) {
  2566. for (var e = 0; e < this._children.length; e++) {
  2567. var i = this._children[e];
  2568. t.addToStorage(i),
  2569. i instanceof Ci && i.addChildrenToStorage(t)
  2570. }
  2571. },
  2572. delChildrenFromStorage: function(t) {
  2573. for (var e = 0; e < this._children.length; e++) {
  2574. var i = this._children[e];
  2575. t.delFromStorage(i),
  2576. i instanceof Ci && i.delChildrenFromStorage(t)
  2577. }
  2578. },
  2579. dirty: function() {
  2580. return this.__dirty = !0,
  2581. this.__zr && this.__zr.refresh(),
  2582. this
  2583. },
  2584. getBoundingRect: function(t) {
  2585. for (var e = null, i = new Di(0,0,0,0), n = t || this._children, o = [], a = 0; a < n.length; a++) {
  2586. var r = n[a];
  2587. if (!r.ignore && !r.invisible) {
  2588. var s = r.getBoundingRect()
  2589. , l = r.getLocalTransform(o);
  2590. l ? (i.copy(s),
  2591. i.applyTransform(l),
  2592. (e = e || i.clone()).union(i)) : (e = e || s.clone()).union(s)
  2593. }
  2594. }
  2595. return e || i
  2596. }
  2597. },
  2598. w(Ci, _i);
  2599. var Li = 32
  2600. , ki = 7;
  2601. function Pi(t, e, i, n) {
  2602. var o = e + 1;
  2603. if (o === i)
  2604. return 1;
  2605. if (n(t[o++], t[e]) < 0) {
  2606. for (; o < i && n(t[o], t[o - 1]) < 0; )
  2607. o++;
  2608. !function(t, e, i) {
  2609. i--;
  2610. for (; e < i; ) {
  2611. var n = t[e];
  2612. t[e++] = t[i],
  2613. t[i--] = n
  2614. }
  2615. }(t, e, o)
  2616. } else
  2617. for (; o < i && 0 <= n(t[o], t[o - 1]); )
  2618. o++;
  2619. return o - e
  2620. }
  2621. function Ni(t, e, i, n, o) {
  2622. for (n === e && n++; n < i; n++) {
  2623. for (var a, r = t[n], s = e, l = n; s < l; )
  2624. o(r, t[a = s + l >>> 1]) < 0 ? l = a : s = 1 + a;
  2625. var u = n - s;
  2626. switch (u) {
  2627. case 3:
  2628. t[s + 3] = t[s + 2];
  2629. case 2:
  2630. t[s + 2] = t[s + 1];
  2631. case 1:
  2632. t[s + 1] = t[s];
  2633. break;
  2634. default:
  2635. for (; 0 < u; )
  2636. t[s + u] = t[s + u - 1],
  2637. u--
  2638. }
  2639. t[s] = r
  2640. }
  2641. }
  2642. function Oi(t, e, i, n, o, a) {
  2643. var r = 0
  2644. , s = 0
  2645. , l = 1;
  2646. if (0 < a(t, e[i + o])) {
  2647. for (s = n - o; l < s && 0 < a(t, e[i + o + l]); )
  2648. (l = 1 + ((r = l) << 1)) <= 0 && (l = s);
  2649. s < l && (l = s),
  2650. r += o,
  2651. l += o
  2652. } else {
  2653. for (s = o + 1; l < s && a(t, e[i + o - l]) <= 0; )
  2654. (l = 1 + ((r = l) << 1)) <= 0 && (l = s);
  2655. s < l && (l = s);
  2656. var u = r;
  2657. r = o - l,
  2658. l = o - u
  2659. }
  2660. for (r++; r < l; ) {
  2661. var h = r + (l - r >>> 1);
  2662. 0 < a(t, e[i + h]) ? r = h + 1 : l = h
  2663. }
  2664. return l
  2665. }
  2666. function Ei(t, e, i, n, o, a) {
  2667. var r = 0
  2668. , s = 0
  2669. , l = 1;
  2670. if (a(t, e[i + o]) < 0) {
  2671. for (s = o + 1; l < s && a(t, e[i + o - l]) < 0; )
  2672. (l = 1 + ((r = l) << 1)) <= 0 && (l = s);
  2673. s < l && (l = s);
  2674. var u = r;
  2675. r = o - l,
  2676. l = o - u
  2677. } else {
  2678. for (s = n - o; l < s && 0 <= a(t, e[i + o + l]); )
  2679. (l = 1 + ((r = l) << 1)) <= 0 && (l = s);
  2680. s < l && (l = s),
  2681. r += o,
  2682. l += o
  2683. }
  2684. for (r++; r < l; ) {
  2685. var h = r + (l - r >>> 1);
  2686. a(t, e[i + h]) < 0 ? l = h : r = h + 1
  2687. }
  2688. return l
  2689. }
  2690. function Ri(p, g) {
  2691. var r, s, m = ki, l = 0, v = [];
  2692. function e(t) {
  2693. var e = r[t]
  2694. , i = s[t]
  2695. , n = r[t + 1]
  2696. , o = s[t + 1];
  2697. s[t] = i + o,
  2698. t === l - 3 && (r[t + 1] = r[t + 2],
  2699. s[t + 1] = s[t + 2]),
  2700. l--;
  2701. var a = Ei(p[n], p, e, i, 0, g);
  2702. e += a,
  2703. 0 !== (i -= a) && 0 !== (o = Oi(p[e + i - 1], p, n, o, o - 1, g)) && (i <= o ? function(t, e, i, n) {
  2704. var o = 0;
  2705. for (o = 0; o < e; o++)
  2706. v[o] = p[t + o];
  2707. var a = 0
  2708. , r = i
  2709. , s = t;
  2710. if (p[s++] = p[r++],
  2711. 0 == --n) {
  2712. for (o = 0; o < e; o++)
  2713. p[s + o] = v[a + o];
  2714. return
  2715. }
  2716. if (1 === e) {
  2717. for (o = 0; o < n; o++)
  2718. p[s + o] = p[r + o];
  2719. return p[s + n] = v[a]
  2720. }
  2721. var l, u, h, c = m;
  2722. for (; ; ) {
  2723. u = l = 0,
  2724. h = !1;
  2725. do {
  2726. if (g(p[r], v[a]) < 0) {
  2727. if (p[s++] = p[r++],
  2728. u++,
  2729. (l = 0) == --n) {
  2730. h = !0;
  2731. break
  2732. }
  2733. } else if (p[s++] = v[a++],
  2734. l++,
  2735. u = 0,
  2736. 1 == --e) {
  2737. h = !0;
  2738. break
  2739. }
  2740. } while ((l | u) < c);
  2741. if (h)
  2742. break;
  2743. do {
  2744. if (0 !== (l = Ei(p[r], v, a, e, 0, g))) {
  2745. for (o = 0; o < l; o++)
  2746. p[s + o] = v[a + o];
  2747. if (s += l,
  2748. a += l,
  2749. (e -= l) <= 1) {
  2750. h = !0;
  2751. break
  2752. }
  2753. }
  2754. if (p[s++] = p[r++],
  2755. 0 == --n) {
  2756. h = !0;
  2757. break
  2758. }
  2759. if (0 !== (u = Oi(v[a], p, r, n, 0, g))) {
  2760. for (o = 0; o < u; o++)
  2761. p[s + o] = p[r + o];
  2762. if (s += u,
  2763. r += u,
  2764. 0 === (n -= u)) {
  2765. h = !0;
  2766. break
  2767. }
  2768. }
  2769. if (p[s++] = v[a++],
  2770. 1 == --e) {
  2771. h = !0;
  2772. break
  2773. }
  2774. c--
  2775. } while (ki <= l || ki <= u);
  2776. if (h)
  2777. break;
  2778. c < 0 && (c = 0),
  2779. c += 2
  2780. }
  2781. if ((m = c) < 1 && (m = 1),
  2782. 1 === e) {
  2783. for (o = 0; o < n; o++)
  2784. p[s + o] = p[r + o];
  2785. p[s + n] = v[a]
  2786. } else {
  2787. if (0 === e)
  2788. throw new Error;
  2789. for (o = 0; o < e; o++)
  2790. p[s + o] = v[a + o]
  2791. }
  2792. }(e, i, n, o) : function(t, e, i, n) {
  2793. var o = 0;
  2794. for (o = 0; o < n; o++)
  2795. v[o] = p[i + o];
  2796. var a = t + e - 1
  2797. , r = n - 1
  2798. , s = i + n - 1
  2799. , l = 0
  2800. , u = 0;
  2801. if (p[s--] = p[a--],
  2802. 0 == --e) {
  2803. for (l = s - (n - 1),
  2804. o = 0; o < n; o++)
  2805. p[l + o] = v[o];
  2806. return
  2807. }
  2808. if (1 === n) {
  2809. for (u = (s -= e) + 1,
  2810. l = (a -= e) + 1,
  2811. o = e - 1; 0 <= o; o--)
  2812. p[u + o] = p[l + o];
  2813. return p[s] = v[r]
  2814. }
  2815. var h = m;
  2816. for (; ; ) {
  2817. var c = 0
  2818. , d = 0
  2819. , f = !1;
  2820. do {
  2821. if (g(v[r], p[a]) < 0) {
  2822. if (p[s--] = p[a--],
  2823. c++,
  2824. (d = 0) == --e) {
  2825. f = !0;
  2826. break
  2827. }
  2828. } else if (p[s--] = v[r--],
  2829. d++,
  2830. c = 0,
  2831. 1 == --n) {
  2832. f = !0;
  2833. break
  2834. }
  2835. } while ((c | d) < h);
  2836. if (f)
  2837. break;
  2838. do {
  2839. if (0 !== (c = e - Ei(v[r], p, t, e, e - 1, g))) {
  2840. for (e -= c,
  2841. u = (s -= c) + 1,
  2842. l = (a -= c) + 1,
  2843. o = c - 1; 0 <= o; o--)
  2844. p[u + o] = p[l + o];
  2845. if (0 === e) {
  2846. f = !0;
  2847. break
  2848. }
  2849. }
  2850. if (p[s--] = v[r--],
  2851. 1 == --n) {
  2852. f = !0;
  2853. break
  2854. }
  2855. if (0 !== (d = n - Oi(p[a], v, 0, n, n - 1, g))) {
  2856. for (n -= d,
  2857. u = (s -= d) + 1,
  2858. l = (r -= d) + 1,
  2859. o = 0; o < d; o++)
  2860. p[u + o] = v[l + o];
  2861. if (n <= 1) {
  2862. f = !0;
  2863. break
  2864. }
  2865. }
  2866. if (p[s--] = p[a--],
  2867. 0 == --e) {
  2868. f = !0;
  2869. break
  2870. }
  2871. h--
  2872. } while (ki <= c || ki <= d);
  2873. if (f)
  2874. break;
  2875. h < 0 && (h = 0),
  2876. h += 2
  2877. }
  2878. (m = h) < 1 && (m = 1);
  2879. if (1 === n) {
  2880. for (u = (s -= e) + 1,
  2881. l = (a -= e) + 1,
  2882. o = e - 1; 0 <= o; o--)
  2883. p[u + o] = p[l + o];
  2884. p[s] = v[r]
  2885. } else {
  2886. if (0 === n)
  2887. throw new Error;
  2888. for (l = s - (n - 1),
  2889. o = 0; o < n; o++)
  2890. p[l + o] = v[o]
  2891. }
  2892. }(e, i, n, o))
  2893. }
  2894. r = [],
  2895. s = [],
  2896. this.mergeRuns = function() {
  2897. for (; 1 < l; ) {
  2898. var t = l - 2;
  2899. if (1 <= t && s[t - 1] <= s[t] + s[t + 1] || 2 <= t && s[t - 2] <= s[t] + s[t - 1])
  2900. s[t - 1] < s[t + 1] && t--;
  2901. else if (s[t] > s[t + 1])
  2902. break;
  2903. e(t)
  2904. }
  2905. }
  2906. ,
  2907. this.forceMergeRuns = function() {
  2908. for (; 1 < l; ) {
  2909. var t = l - 2;
  2910. 0 < t && s[t - 1] < s[t + 1] && t--,
  2911. e(t)
  2912. }
  2913. }
  2914. ,
  2915. this.pushRun = function(t, e) {
  2916. r[l] = t,
  2917. s[l] = e,
  2918. l += 1
  2919. }
  2920. }
  2921. function zi(t, e, i, n) {
  2922. i = i || 0;
  2923. var o = (n = n || t.length) - i;
  2924. if (!(o < 2)) {
  2925. var a = 0;
  2926. if (o < Li)
  2927. Ni(t, i, n, i + (a = Pi(t, i, n, e)), e);
  2928. else {
  2929. var r = new Ri(t,e)
  2930. , s = function(t) {
  2931. for (var e = 0; Li <= t; )
  2932. e |= 1 & t,
  2933. t >>= 1;
  2934. return t + e
  2935. }(o);
  2936. do {
  2937. if ((a = Pi(t, i, n, e)) < s) {
  2938. var l = o;
  2939. s < l && (l = s),
  2940. Ni(t, i, i + l, i + a, e),
  2941. a = l
  2942. }
  2943. r.pushRun(i, a),
  2944. r.mergeRuns(),
  2945. o -= a,
  2946. i += a
  2947. } while (0 !== o);
  2948. r.forceMergeRuns()
  2949. }
  2950. }
  2951. }
  2952. function Bi(t, e) {
  2953. return t.zlevel === e.zlevel ? t.z === e.z ? t.z2 - e.z2 : t.z - e.z : t.zlevel - e.zlevel
  2954. }
  2955. function Vi() {
  2956. this._roots = [],
  2957. this._displayList = [],
  2958. this._displayListLen = 0
  2959. }
  2960. Vi.prototype = {
  2961. constructor: Vi,
  2962. traverse: function(t, e) {
  2963. for (var i = 0; i < this._roots.length; i++)
  2964. this._roots[i].traverse(t, e)
  2965. },
  2966. getDisplayList: function(t, e) {
  2967. return e = e || !1,
  2968. t && this.updateDisplayList(e),
  2969. this._displayList
  2970. },
  2971. updateDisplayList: function(t) {
  2972. this._displayListLen = 0;
  2973. for (var e = this._roots, i = this._displayList, n = 0, o = e.length; n < o; n++)
  2974. this._updateAndAddDisplayable(e[n], null, t);
  2975. i.length = this._displayListLen,
  2976. v.canvasSupported && zi(i, Bi)
  2977. },
  2978. _updateAndAddDisplayable: function(t, e, i) {
  2979. if (!t.ignore || i) {
  2980. t.beforeUpdate(),
  2981. t.__dirty && t.update(),
  2982. t.afterUpdate();
  2983. var n = t.clipPath;
  2984. if (n) {
  2985. e = e ? e.slice() : [];
  2986. for (var o = n, a = t; o; )
  2987. o.parent = a,
  2988. o.updateTransform(),
  2989. e.push(o),
  2990. o = (a = o).clipPath
  2991. }
  2992. if (t.isGroup) {
  2993. for (var r = t._children, s = 0; s < r.length; s++) {
  2994. var l = r[s];
  2995. t.__dirty && (l.__dirty = !0),
  2996. this._updateAndAddDisplayable(l, e, i)
  2997. }
  2998. t.__dirty = !1
  2999. } else
  3000. t.__clipPaths = e,
  3001. this._displayList[this._displayListLen++] = t
  3002. }
  3003. },
  3004. addRoot: function(t) {
  3005. t.__storage !== this && (t instanceof Ci && t.addChildrenToStorage(this),
  3006. this.addToStorage(t),
  3007. this._roots.push(t))
  3008. },
  3009. delRoot: function(t) {
  3010. if (null == t) {
  3011. for (var e = 0; e < this._roots.length; e++) {
  3012. var i = this._roots[e];
  3013. i instanceof Ci && i.delChildrenFromStorage(this)
  3014. }
  3015. return this._roots = [],
  3016. this._displayList = [],
  3017. void (this._displayListLen = 0)
  3018. }
  3019. if (t instanceof Array) {
  3020. e = 0;
  3021. for (var n = t.length; e < n; e++)
  3022. this.delRoot(t[e])
  3023. } else {
  3024. var o = _(this._roots, t);
  3025. 0 <= o && (this.delFromStorage(t),
  3026. this._roots.splice(o, 1),
  3027. t instanceof Ci && t.delChildrenFromStorage(this))
  3028. }
  3029. },
  3030. addToStorage: function(t) {
  3031. return t && (t.__storage = this,
  3032. t.dirty(!1)),
  3033. this
  3034. },
  3035. delFromStorage: function(t) {
  3036. return t && (t.__storage = null),
  3037. this
  3038. },
  3039. dispose: function() {
  3040. this._renderList = this._roots = null
  3041. },
  3042. displayableSortFunc: Bi
  3043. };
  3044. var Gi = {
  3045. shadowBlur: 1,
  3046. shadowOffsetX: 1,
  3047. shadowOffsetY: 1,
  3048. textShadowBlur: 1,
  3049. textShadowOffsetX: 1,
  3050. textShadowOffsetY: 1,
  3051. textBoxShadowBlur: 1,
  3052. textBoxShadowOffsetX: 1,
  3053. textBoxShadowOffsetY: 1
  3054. }
  3055. , Fi = function(t, e, i) {
  3056. return Gi.hasOwnProperty(e) ? i * t.dpr : i
  3057. }
  3058. , Wi = {
  3059. NONE: 0,
  3060. STYLE_BIND: 1,
  3061. PLAIN_TEXT: 2
  3062. }
  3063. , Hi = 9
  3064. , Zi = [["shadowBlur", 0], ["shadowOffsetX", 0], ["shadowOffsetY", 0], ["shadowColor", "#000"], ["lineCap", "butt"], ["lineJoin", "miter"], ["miterLimit", 10]]
  3065. , Ui = function(t) {
  3066. this.extendFrom(t, !1)
  3067. };
  3068. function Xi(t, e, i) {
  3069. var n = null == e.x ? 0 : e.x
  3070. , o = null == e.x2 ? 1 : e.x2
  3071. , a = null == e.y ? 0 : e.y
  3072. , r = null == e.y2 ? 0 : e.y2;
  3073. return e.global || (n = n * i.width + i.x,
  3074. o = o * i.width + i.x,
  3075. a = a * i.height + i.y,
  3076. r = r * i.height + i.y),
  3077. n = isNaN(n) ? 0 : n,
  3078. o = isNaN(o) ? 1 : o,
  3079. a = isNaN(a) ? 0 : a,
  3080. r = isNaN(r) ? 0 : r,
  3081. t.createLinearGradient(n, a, o, r)
  3082. }
  3083. function Yi(t, e, i) {
  3084. var n = i.width
  3085. , o = i.height
  3086. , a = Math.min(n, o)
  3087. , r = null == e.x ? .5 : e.x
  3088. , s = null == e.y ? .5 : e.y
  3089. , l = null == e.r ? .5 : e.r;
  3090. return e.global || (r = r * n + i.x,
  3091. s = s * o + i.y,
  3092. l *= a),
  3093. t.createRadialGradient(r, s, 0, r, s, l)
  3094. }
  3095. Ui.prototype = {
  3096. constructor: Ui,
  3097. fill: "#000",
  3098. stroke: null,
  3099. opacity: 1,
  3100. fillOpacity: null,
  3101. strokeOpacity: null,
  3102. lineDash: null,
  3103. lineDashOffset: 0,
  3104. shadowBlur: 0,
  3105. shadowOffsetX: 0,
  3106. shadowOffsetY: 0,
  3107. lineWidth: 1,
  3108. strokeNoScale: !1,
  3109. text: null,
  3110. font: null,
  3111. textFont: null,
  3112. fontStyle: null,
  3113. fontWeight: null,
  3114. fontSize: null,
  3115. fontFamily: null,
  3116. textTag: null,
  3117. textFill: "#000",
  3118. textStroke: null,
  3119. textWidth: null,
  3120. textHeight: null,
  3121. textStrokeWidth: 0,
  3122. textLineHeight: null,
  3123. textPosition: "inside",
  3124. textRect: null,
  3125. textOffset: null,
  3126. textAlign: null,
  3127. textVerticalAlign: null,
  3128. textDistance: 5,
  3129. textShadowColor: "transparent",
  3130. textShadowBlur: 0,
  3131. textShadowOffsetX: 0,
  3132. textShadowOffsetY: 0,
  3133. textBoxShadowColor: "transparent",
  3134. textBoxShadowBlur: 0,
  3135. textBoxShadowOffsetX: 0,
  3136. textBoxShadowOffsetY: 0,
  3137. transformText: !1,
  3138. textRotation: 0,
  3139. textOrigin: null,
  3140. textBackgroundColor: null,
  3141. textBorderColor: null,
  3142. textBorderWidth: 0,
  3143. textBorderRadius: 0,
  3144. textPadding: null,
  3145. rich: null,
  3146. truncate: null,
  3147. blend: null,
  3148. bind: function(t, e, i) {
  3149. var n = this
  3150. , o = i && i.style
  3151. , a = !o || t.__attrCachedBy !== Wi.STYLE_BIND;
  3152. t.__attrCachedBy = Wi.STYLE_BIND;
  3153. for (var r = 0; r < Zi.length; r++) {
  3154. var s = Zi[r]
  3155. , l = s[0];
  3156. !a && n[l] === o[l] || (t[l] = Fi(t, l, n[l] || s[1]))
  3157. }
  3158. if (!a && n.fill === o.fill || (t.fillStyle = n.fill),
  3159. !a && n.stroke === o.stroke || (t.strokeStyle = n.stroke),
  3160. !a && n.opacity === o.opacity || (t.globalAlpha = null == n.opacity ? 1 : n.opacity),
  3161. !a && n.blend === o.blend || (t.globalCompositeOperation = n.blend || "source-over"),
  3162. this.hasStroke()) {
  3163. var u = n.lineWidth;
  3164. t.lineWidth = u / (this.strokeNoScale && e && e.getLineScale ? e.getLineScale() : 1)
  3165. }
  3166. },
  3167. hasFill: function() {
  3168. var t = this.fill;
  3169. return null != t && "none" !== t
  3170. },
  3171. hasStroke: function() {
  3172. var t = this.stroke;
  3173. return null != t && "none" !== t && 0 < this.lineWidth
  3174. },
  3175. extendFrom: function(t, e) {
  3176. if (t)
  3177. for (var i in t)
  3178. !t.hasOwnProperty(i) || !0 !== e && (!1 === e ? this.hasOwnProperty(i) : null == t[i]) || (this[i] = t[i])
  3179. },
  3180. set: function(t, e) {
  3181. "string" == typeof t ? this[t] = e : this.extendFrom(t, !0)
  3182. },
  3183. clone: function() {
  3184. var t = new this.constructor;
  3185. return t.extendFrom(this, !0),
  3186. t
  3187. },
  3188. getGradient: function(t, e, i) {
  3189. for (var n = ("radial" === e.type ? Yi : Xi)(t, e, i), o = e.colorStops, a = 0; a < o.length; a++)
  3190. n.addColorStop(o[a].offset, o[a].color);
  3191. return n
  3192. }
  3193. };
  3194. for (var ji = Ui.prototype, qi = 0; qi < Zi.length; qi++) {
  3195. var Ki = Zi[qi];
  3196. Ki[0]in ji || (ji[Ki[0]] = Ki[1])
  3197. }
  3198. Ui.getGradient = ji.getGradient;
  3199. function $i(t, e) {
  3200. this.image = t,
  3201. this.repeat = e,
  3202. this.type = "pattern"
  3203. }
  3204. function Ji() {
  3205. return !1
  3206. }
  3207. function Qi(t, e, i) {
  3208. var n = y()
  3209. , o = e.getWidth()
  3210. , a = e.getHeight()
  3211. , r = n.style;
  3212. return r && (r.position = "absolute",
  3213. r.left = 0,
  3214. r.top = 0,
  3215. r.width = o + "px",
  3216. r.height = a + "px",
  3217. n.setAttribute("data-zr-dom-id", t)),
  3218. n.width = o * i,
  3219. n.height = a * i,
  3220. n
  3221. }
  3222. function tn(t, e, i) {
  3223. var n;
  3224. i = i || pi,
  3225. "string" == typeof t ? n = Qi(t, e, i) : z(t) && (t = (n = t).id),
  3226. this.id = t;
  3227. var o = (this.dom = n).style;
  3228. o && (n.onselectstart = Ji,
  3229. o["-webkit-user-select"] = "none",
  3230. o["user-select"] = "none",
  3231. o["-webkit-touch-callout"] = "none",
  3232. o["-webkit-tap-highlight-color"] = "rgba(0,0,0,0)",
  3233. o.padding = 0,
  3234. o.margin = 0,
  3235. o["border-width"] = 0),
  3236. this.domBack = null,
  3237. this.ctxBack = null,
  3238. this.painter = e,
  3239. this.config = null,
  3240. this.clearColor = 0,
  3241. this.motionBlur = !1,
  3242. this.lastFrameAlpha = .7,
  3243. this.dpr = i
  3244. }
  3245. tn.prototype = {
  3246. constructor: tn,
  3247. __dirty: !0,
  3248. __used: !($i.prototype.getCanvasPattern = function(t) {
  3249. return t.createPattern(this.image, this.repeat || "repeat")
  3250. }
  3251. ),
  3252. __drawIndex: 0,
  3253. __startIndex: 0,
  3254. __endIndex: 0,
  3255. incremental: !1,
  3256. getElementCount: function() {
  3257. return this.__endIndex - this.__startIndex
  3258. },
  3259. initContext: function() {
  3260. this.ctx = this.dom.getContext("2d"),
  3261. this.ctx.dpr = this.dpr
  3262. },
  3263. createBackBuffer: function() {
  3264. var t = this.dpr;
  3265. this.domBack = Qi("back-" + this.id, this.painter, t),
  3266. this.ctxBack = this.domBack.getContext("2d"),
  3267. 1 !== t && this.ctxBack.scale(t, t)
  3268. },
  3269. resize: function(t, e) {
  3270. var i = this.dpr
  3271. , n = this.dom
  3272. , o = n.style
  3273. , a = this.domBack;
  3274. o && (o.width = t + "px",
  3275. o.height = e + "px"),
  3276. n.width = t * i,
  3277. n.height = e * i,
  3278. a && (a.width = t * i,
  3279. a.height = e * i,
  3280. 1 !== i && this.ctxBack.scale(i, i))
  3281. },
  3282. clear: function(t, e) {
  3283. var i, n = this.dom, o = this.ctx, a = n.width, r = n.height, s = (e = e || this.clearColor,
  3284. this.motionBlur && !t), l = this.lastFrameAlpha, u = this.dpr;
  3285. s && (this.domBack || this.createBackBuffer(),
  3286. this.ctxBack.globalCompositeOperation = "copy",
  3287. this.ctxBack.drawImage(n, 0, 0, a / u, r / u)),
  3288. o.clearRect(0, 0, a, r),
  3289. e && "transparent" !== e && (e.colorStops ? (i = e.__canvasGradient || Ui.getGradient(o, e, {
  3290. x: 0,
  3291. y: 0,
  3292. width: a,
  3293. height: r
  3294. }),
  3295. e.__canvasGradient = i) : e.image && (i = $i.prototype.getCanvasPattern.call(e, o)),
  3296. o.save(),
  3297. o.fillStyle = i || e,
  3298. o.fillRect(0, 0, a, r),
  3299. o.restore());
  3300. if (s) {
  3301. var h = this.domBack;
  3302. o.save(),
  3303. o.globalAlpha = l,
  3304. o.drawImage(h, 0, 0, a, r),
  3305. o.restore()
  3306. }
  3307. }
  3308. };
  3309. var en = "undefined" != typeof window && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function(t) {
  3310. setTimeout(t, 16)
  3311. }
  3312. , nn = new Te(50);
  3313. function on(t) {
  3314. if ("string" != typeof t)
  3315. return t;
  3316. var e = nn.get(t);
  3317. return e && e.image
  3318. }
  3319. function an(t, e, i, n, o) {
  3320. if (t) {
  3321. if ("string" != typeof t)
  3322. return t;
  3323. if (e && e.__zrImageSrc === t || !i)
  3324. return e;
  3325. var a = nn.get(t)
  3326. , r = {
  3327. hostEl: i,
  3328. cb: n,
  3329. cbPayload: o
  3330. };
  3331. return a ? sn(e = a.image) || a.pending.push(r) : ((e = new Image).onload = e.onerror = rn,
  3332. nn.put(t, e.__cachedImgObj = {
  3333. image: e,
  3334. pending: [r]
  3335. }),
  3336. e.src = e.__zrImageSrc = t),
  3337. e
  3338. }
  3339. return e
  3340. }
  3341. function rn() {
  3342. var t = this.__cachedImgObj;
  3343. this.onload = this.onerror = this.__cachedImgObj = null;
  3344. for (var e = 0; e < t.pending.length; e++) {
  3345. var i = t.pending[e]
  3346. , n = i.cb;
  3347. n && n(this, i.cbPayload),
  3348. i.hostEl.dirty()
  3349. }
  3350. t.pending.length = 0
  3351. }
  3352. function sn(t) {
  3353. return t && t.width && t.height
  3354. }
  3355. var ln = {}
  3356. , un = 0
  3357. , hn = 5e3
  3358. , cn = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g
  3359. , dn = "12px sans-serif"
  3360. , fn = {};
  3361. function pn(t, e) {
  3362. var i = t + ":" + (e = e || dn);
  3363. if (ln[i])
  3364. return ln[i];
  3365. for (var n, o, a = (t + "").split("\n"), r = 0, s = 0, l = a.length; s < l; s++)
  3366. r = Math.max((n = a[s],
  3367. o = e,
  3368. fn.measureText(n, o)).width, r);
  3369. return hn < un && (un = 0,
  3370. ln = {}),
  3371. un++,
  3372. ln[i] = r
  3373. }
  3374. function gn(t, e, i, n, o, a, r, s) {
  3375. return r ? function(t, e, i, n, o, a, r, s) {
  3376. var l = In(t, {
  3377. rich: r,
  3378. truncate: s,
  3379. font: e,
  3380. textAlign: i,
  3381. textPadding: o,
  3382. textLineHeight: a
  3383. })
  3384. , u = l.outerWidth
  3385. , h = l.outerHeight
  3386. , c = mn(0, u, i)
  3387. , d = vn(0, h, n);
  3388. return new Di(c,d,u,h)
  3389. }(t, e, i, n, o, a, r, s) : function(t, e, i, n, o, a, r) {
  3390. var s = Mn(t, e, o, a, r)
  3391. , l = pn(t, e);
  3392. o && (l += o[1] + o[3]);
  3393. var u = s.outerHeight
  3394. , h = mn(0, l, i)
  3395. , c = vn(0, u, n)
  3396. , d = new Di(h,c,l,u);
  3397. return d.lineHeight = s.lineHeight,
  3398. d
  3399. }(t, e, i, n, o, a, s)
  3400. }
  3401. function mn(t, e, i) {
  3402. return "right" === i ? t -= e : "center" === i && (t -= e / 2),
  3403. t
  3404. }
  3405. function vn(t, e, i) {
  3406. return "middle" === i ? t -= e / 2 : "bottom" === i && (t -= e),
  3407. t
  3408. }
  3409. function yn(t, e, i) {
  3410. var n = e.textPosition
  3411. , o = e.textDistance
  3412. , a = i.x
  3413. , r = i.y;
  3414. o = o || 0;
  3415. var s = i.height
  3416. , l = i.width
  3417. , u = s / 2
  3418. , h = "left"
  3419. , c = "top";
  3420. switch (n) {
  3421. case "left":
  3422. a -= o,
  3423. r += u,
  3424. h = "right",
  3425. c = "middle";
  3426. break;
  3427. case "right":
  3428. a += o + l,
  3429. r += u,
  3430. c = "middle";
  3431. break;
  3432. case "top":
  3433. a += l / 2,
  3434. r -= o,
  3435. h = "center",
  3436. c = "bottom";
  3437. break;
  3438. case "bottom":
  3439. a += l / 2,
  3440. r += s + o,
  3441. h = "center";
  3442. break;
  3443. case "inside":
  3444. a += l / 2,
  3445. r += u,
  3446. h = "center",
  3447. c = "middle";
  3448. break;
  3449. case "insideLeft":
  3450. a += o,
  3451. r += u,
  3452. c = "middle";
  3453. break;
  3454. case "insideRight":
  3455. a += l - o,
  3456. r += u,
  3457. h = "right",
  3458. c = "middle";
  3459. break;
  3460. case "insideTop":
  3461. a += l / 2,
  3462. r += o,
  3463. h = "center";
  3464. break;
  3465. case "insideBottom":
  3466. a += l / 2,
  3467. r += s - o,
  3468. h = "center",
  3469. c = "bottom";
  3470. break;
  3471. case "insideTopLeft":
  3472. a += o,
  3473. r += o;
  3474. break;
  3475. case "insideTopRight":
  3476. a += l - o,
  3477. r += o,
  3478. h = "right";
  3479. break;
  3480. case "insideBottomLeft":
  3481. a += o,
  3482. r += s - o,
  3483. c = "bottom";
  3484. break;
  3485. case "insideBottomRight":
  3486. a += l - o,
  3487. r += s - o,
  3488. h = "right",
  3489. c = "bottom"
  3490. }
  3491. return (t = t || {}).x = a,
  3492. t.y = r,
  3493. t.textAlign = h,
  3494. t.textVerticalAlign = c,
  3495. t
  3496. }
  3497. function xn(t, e, i, n, o) {
  3498. if (!e)
  3499. return "";
  3500. var a = (t + "").split("\n");
  3501. o = _n(e, i, n, o);
  3502. for (var r = 0, s = a.length; r < s; r++)
  3503. a[r] = wn(a[r], o);
  3504. return a.join("\n")
  3505. }
  3506. function _n(t, e, i, n) {
  3507. (n = P({}, n)).font = e;
  3508. i = H(i, "...");
  3509. n.maxIterations = H(n.maxIterations, 2);
  3510. var o = n.minChar = H(n.minChar, 0);
  3511. n.cnCharWidth = pn("国", e);
  3512. var a = n.ascCharWidth = pn("a", e);
  3513. n.placeholder = H(n.placeholder, "");
  3514. for (var r = t = Math.max(0, t - 1), s = 0; s < o && a <= r; s++)
  3515. r -= a;
  3516. var l = pn(i, e);
  3517. return r < l && (i = "",
  3518. l = 0),
  3519. r = t - l,
  3520. n.ellipsis = i,
  3521. n.ellipsisWidth = l,
  3522. n.contentWidth = r,
  3523. n.containerWidth = t,
  3524. n
  3525. }
  3526. function wn(t, e) {
  3527. var i = e.containerWidth
  3528. , n = e.font
  3529. , o = e.contentWidth;
  3530. if (!i)
  3531. return "";
  3532. var a = pn(t, n);
  3533. if (a <= i)
  3534. return t;
  3535. for (var r = 0; ; r++) {
  3536. if (a <= o || r >= e.maxIterations) {
  3537. t += e.ellipsis;
  3538. break
  3539. }
  3540. var s = 0 === r ? bn(t, o, e.ascCharWidth, e.cnCharWidth) : 0 < a ? Math.floor(t.length * o / a) : 0;
  3541. a = pn(t = t.substr(0, s), n)
  3542. }
  3543. return "" === t && (t = e.placeholder),
  3544. t
  3545. }
  3546. function bn(t, e, i, n) {
  3547. for (var o = 0, a = 0, r = t.length; a < r && o < e; a++) {
  3548. var s = t.charCodeAt(a);
  3549. o += 0 <= s && s <= 127 ? i : n
  3550. }
  3551. return a
  3552. }
  3553. function Sn(t) {
  3554. return pn("国", t)
  3555. }
  3556. function Mn(t, e, i, n, o) {
  3557. null != t && (t += "");
  3558. var a = H(n, Sn(e))
  3559. , r = t ? t.split("\n") : []
  3560. , s = r.length * a
  3561. , l = s
  3562. , u = !0;
  3563. if (i && (l += i[0] + i[2]),
  3564. t && o) {
  3565. u = !1;
  3566. var h = o.outerHeight
  3567. , c = o.outerWidth;
  3568. if (null != h && h < l)
  3569. t = "",
  3570. r = [];
  3571. else if (null != c)
  3572. for (var d = _n(c - (i ? i[1] + i[3] : 0), e, o.ellipsis, {
  3573. minChar: o.minChar,
  3574. placeholder: o.placeholder
  3575. }), f = 0, p = r.length; f < p; f++)
  3576. r[f] = wn(r[f], d)
  3577. }
  3578. return {
  3579. lines: r,
  3580. height: s,
  3581. outerHeight: l,
  3582. lineHeight: a,
  3583. canCacheByTextString: u
  3584. }
  3585. }
  3586. function In(t, e) {
  3587. var i = {
  3588. lines: [],
  3589. width: 0,
  3590. height: 0
  3591. };
  3592. if (null != t && (t += ""),
  3593. !t)
  3594. return i;
  3595. for (var n, o = cn.lastIndex = 0; null != (n = cn.exec(t)); ) {
  3596. var a = n.index;
  3597. o < a && Tn(i, t.substring(o, a)),
  3598. Tn(i, n[2], n[1]),
  3599. o = cn.lastIndex
  3600. }
  3601. o < t.length && Tn(i, t.substring(o, t.length));
  3602. var r = i.lines
  3603. , s = 0
  3604. , l = 0
  3605. , u = []
  3606. , h = e.textPadding
  3607. , c = e.truncate
  3608. , d = c && c.outerWidth
  3609. , f = c && c.outerHeight;
  3610. h && (null != d && (d -= h[1] + h[3]),
  3611. null != f && (f -= h[0] + h[2]));
  3612. for (var p = 0; p < r.length; p++) {
  3613. for (var g = r[p], m = 0, v = 0, y = 0; y < g.tokens.length; y++) {
  3614. var x = (C = g.tokens[y]).styleName && e.rich[C.styleName] || {}
  3615. , _ = C.textPadding = x.textPadding
  3616. , w = C.font = x.font || e.font
  3617. , b = C.textHeight = H(x.textHeight, Sn(w));
  3618. if (_ && (b += _[0] + _[2]),
  3619. C.height = b,
  3620. C.lineHeight = Z(x.textLineHeight, e.textLineHeight, b),
  3621. C.textAlign = x && x.textAlign || e.textAlign,
  3622. C.textVerticalAlign = x && x.textVerticalAlign || "middle",
  3623. null != f && s + C.lineHeight > f)
  3624. return {
  3625. lines: [],
  3626. width: 0,
  3627. height: 0
  3628. };
  3629. C.textWidth = pn(C.text, w);
  3630. var S = x.textWidth
  3631. , M = null == S || "auto" === S;
  3632. if ("string" == typeof S && "%" === S.charAt(S.length - 1))
  3633. C.percentWidth = S,
  3634. u.push(C),
  3635. S = 0;
  3636. else {
  3637. if (M) {
  3638. S = C.textWidth;
  3639. var I = x.textBackgroundColor
  3640. , T = I && I.image;
  3641. T && sn(T = on(T)) && (S = Math.max(S, T.width * b / T.height))
  3642. }
  3643. var A = _ ? _[1] + _[3] : 0;
  3644. S += A;
  3645. var D = null != d ? d - v : null;
  3646. null != D && D < S && (!M || D < A ? (C.text = "",
  3647. C.textWidth = S = 0) : (C.text = xn(C.text, D - A, w, c.ellipsis, {
  3648. minChar: c.minChar
  3649. }),
  3650. C.textWidth = pn(C.text, w),
  3651. S = C.textWidth + A))
  3652. }
  3653. v += C.width = S,
  3654. x && (m = Math.max(m, C.lineHeight))
  3655. }
  3656. g.width = v,
  3657. s += g.lineHeight = m,
  3658. l = Math.max(l, v)
  3659. }
  3660. i.outerWidth = i.width = H(e.textWidth, l),
  3661. i.outerHeight = i.height = H(e.textHeight, s),
  3662. h && (i.outerWidth += h[1] + h[3],
  3663. i.outerHeight += h[0] + h[2]);
  3664. for (p = 0; p < u.length; p++) {
  3665. var C, L = (C = u[p]).percentWidth;
  3666. C.width = parseInt(L, 10) / 100 * l
  3667. }
  3668. return i
  3669. }
  3670. function Tn(t, e, i) {
  3671. for (var n = "" === e, o = e.split("\n"), a = t.lines, r = 0; r < o.length; r++) {
  3672. var s = o[r]
  3673. , l = {
  3674. styleName: i,
  3675. text: s,
  3676. isLineHolder: !s && !n
  3677. };
  3678. if (r)
  3679. a.push({
  3680. tokens: [l]
  3681. });
  3682. else {
  3683. var u = (a[a.length - 1] || (a[0] = {
  3684. tokens: []
  3685. })).tokens
  3686. , h = u.length;
  3687. 1 === h && u[0].isLineHolder ? u[0] = l : !s && h && !n || u.push(l)
  3688. }
  3689. }
  3690. }
  3691. function An(t) {
  3692. var e = (t.fontSize || t.fontFamily) && [t.fontStyle, t.fontWeight, (t.fontSize || 12) + "px", t.fontFamily || "sans-serif"].join(" ");
  3693. return e && j(e) || t.textFont || t.font
  3694. }
  3695. function Dn(t, e) {
  3696. var i, n, o, a, r, s = e.x, l = e.y, u = e.width, h = e.height, c = e.r;
  3697. u < 0 && (s += u,
  3698. u = -u),
  3699. h < 0 && (l += h,
  3700. h = -h),
  3701. "number" == typeof c ? i = n = o = a = c : c instanceof Array ? 1 === c.length ? i = n = o = a = c[0] : 2 === c.length ? (i = o = c[0],
  3702. n = a = c[1]) : 3 === c.length ? (i = c[0],
  3703. n = a = c[1],
  3704. o = c[2]) : (i = c[0],
  3705. n = c[1],
  3706. o = c[2],
  3707. a = c[3]) : i = n = o = a = 0,
  3708. u < i + n && (i *= u / (r = i + n),
  3709. n *= u / r),
  3710. u < o + a && (o *= u / (r = o + a),
  3711. a *= u / r),
  3712. h < n + o && (n *= h / (r = n + o),
  3713. o *= h / r),
  3714. h < i + a && (i *= h / (r = i + a),
  3715. a *= h / r),
  3716. t.moveTo(s + i, l),
  3717. t.lineTo(s + u - n, l),
  3718. 0 !== n && t.arc(s + u - n, l + n, n, -Math.PI / 2, 0),
  3719. t.lineTo(s + u, l + h - o),
  3720. 0 !== o && t.arc(s + u - o, l + h - o, o, 0, Math.PI / 2),
  3721. t.lineTo(s + a, l + h),
  3722. 0 !== a && t.arc(s + a, l + h - a, a, Math.PI / 2, Math.PI),
  3723. t.lineTo(s, l + i),
  3724. 0 !== i && t.arc(s + i, l + i, i, Math.PI, 1.5 * Math.PI)
  3725. }
  3726. fn.measureText = function(t, e) {
  3727. var i = x();
  3728. return i.font = e || dn,
  3729. i.measureText(t)
  3730. }
  3731. ;
  3732. var Cn = dn
  3733. , Ln = {
  3734. left: 1,
  3735. right: 1,
  3736. center: 1
  3737. }
  3738. , kn = {
  3739. top: 1,
  3740. bottom: 1,
  3741. middle: 1
  3742. }
  3743. , Pn = [["textShadowBlur", "shadowBlur", 0], ["textShadowOffsetX", "shadowOffsetX", 0], ["textShadowOffsetY", "shadowOffsetY", 0], ["textShadowColor", "shadowColor", "transparent"]]
  3744. , Nn = {}
  3745. , On = {};
  3746. function En(t) {
  3747. return Rn(t),
  3748. E(t.rich, Rn),
  3749. t
  3750. }
  3751. function Rn(t) {
  3752. if (t) {
  3753. t.font = An(t);
  3754. var e = t.textAlign;
  3755. "middle" === e && (e = "center"),
  3756. t.textAlign = null == e || Ln[e] ? e : "left";
  3757. var i = t.textVerticalAlign || t.textBaseline;
  3758. "center" === i && (i = "middle"),
  3759. t.textVerticalAlign = null == i || kn[i] ? i : "top",
  3760. t.textPadding && (t.textPadding = X(t.textPadding))
  3761. }
  3762. }
  3763. function zn(t, e, i, n, o, a) {
  3764. n.rich ? function(t, e, i, n, o, a) {
  3765. a !== Hi && (e.__attrCachedBy = Wi.NONE);
  3766. var r = t.__textCotentBlock;
  3767. r && !t.__dirtyText || (r = t.__textCotentBlock = In(i, n));
  3768. !function(t, e, i, n, o) {
  3769. var a = i.width
  3770. , r = i.outerWidth
  3771. , s = i.outerHeight
  3772. , l = n.textPadding
  3773. , u = Hn(On, t, n, o)
  3774. , h = u.baseX
  3775. , c = u.baseY
  3776. , d = u.textAlign
  3777. , f = u.textVerticalAlign;
  3778. Bn(e, n, o, h, c);
  3779. var p = mn(h, r, d)
  3780. , g = vn(c, s, f)
  3781. , m = p
  3782. , v = g;
  3783. l && (m += l[3],
  3784. v += l[0]);
  3785. var y = m + a;
  3786. Gn(n) && Fn(t, e, n, p, g, r, s);
  3787. for (var x = 0; x < i.lines.length; x++) {
  3788. for (var _, w = i.lines[x], b = w.tokens, S = b.length, M = w.lineHeight, I = w.width, T = 0, A = m, D = y, C = S - 1; T < S && (!(_ = b[T]).textAlign || "left" === _.textAlign); )
  3789. Vn(t, e, _, n, M, v, A, "left"),
  3790. I -= _.width,
  3791. A += _.width,
  3792. T++;
  3793. for (; 0 <= C && "right" === (_ = b[C]).textAlign; )
  3794. Vn(t, e, _, n, M, v, D, "right"),
  3795. I -= _.width,
  3796. D -= _.width,
  3797. C--;
  3798. for (A += (a - (A - m) - (y - D) - I) / 2; T <= C; )
  3799. _ = b[T],
  3800. Vn(t, e, _, n, M, v, A + _.width / 2, "center"),
  3801. A += _.width,
  3802. T++;
  3803. v += M
  3804. }
  3805. }(t, e, r, n, o)
  3806. }(t, e, i, n, o, a) : function(t, e, i, n, o, a) {
  3807. var r, s = Gn(n), l = !1, u = e.__attrCachedBy === Wi.PLAIN_TEXT;
  3808. a !== Hi ? (a && (r = a.style,
  3809. l = !s && u && r),
  3810. e.__attrCachedBy = s ? Wi.NONE : Wi.PLAIN_TEXT) : u && (e.__attrCachedBy = Wi.NONE);
  3811. var h = n.font || Cn;
  3812. l && h === (r.font || Cn) || (e.font = h);
  3813. var c = t.__computedFont;
  3814. t.__styleFont !== h && (t.__styleFont = h,
  3815. c = t.__computedFont = e.font);
  3816. var d = n.textPadding
  3817. , f = n.textLineHeight
  3818. , p = t.__textCotentBlock;
  3819. p && !t.__dirtyText || (p = t.__textCotentBlock = Mn(i, c, d, f, n.truncate));
  3820. var g = p.outerHeight
  3821. , m = p.lines
  3822. , v = p.lineHeight
  3823. , y = Hn(On, t, n, o)
  3824. , x = y.baseX
  3825. , _ = y.baseY
  3826. , w = y.textAlign || "left"
  3827. , b = y.textVerticalAlign;
  3828. Bn(e, n, o, x, _);
  3829. var S = vn(_, g, b)
  3830. , M = x
  3831. , I = S;
  3832. if (s || d) {
  3833. var T = pn(i, c);
  3834. d && (T += d[1] + d[3]);
  3835. var A = mn(x, T, w);
  3836. s && Fn(t, e, n, A, S, T, g),
  3837. d && (M = jn(x, w, d),
  3838. I += d[0])
  3839. }
  3840. e.textAlign = w,
  3841. e.textBaseline = "middle",
  3842. e.globalAlpha = n.opacity || 1;
  3843. for (var D = 0; D < Pn.length; D++) {
  3844. var C = Pn[D]
  3845. , L = C[0]
  3846. , k = C[1]
  3847. , P = n[L];
  3848. l && P === r[L] || (e[k] = Fi(e, k, P || C[2]))
  3849. }
  3850. I += v / 2;
  3851. var N = n.textStrokeWidth
  3852. , O = l ? r.textStrokeWidth : null
  3853. , E = !l || N !== O
  3854. , R = !l || E || n.textStroke !== r.textStroke
  3855. , z = Un(n.textStroke, N)
  3856. , B = Xn(n.textFill);
  3857. z && (E && (e.lineWidth = N),
  3858. R && (e.strokeStyle = z));
  3859. B && (l && n.textFill === r.textFill || (e.fillStyle = B));
  3860. if (1 === m.length)
  3861. z && e.strokeText(m[0], M, I),
  3862. B && e.fillText(m[0], M, I);
  3863. else
  3864. for (D = 0; D < m.length; D++)
  3865. z && e.strokeText(m[D], M, I),
  3866. B && e.fillText(m[D], M, I),
  3867. I += v
  3868. }(t, e, i, n, o, a)
  3869. }
  3870. function Bn(t, e, i, n, o) {
  3871. if (i && e.textRotation) {
  3872. var a = e.textOrigin;
  3873. "center" === a ? (n = i.width / 2 + i.x,
  3874. o = i.height / 2 + i.y) : a && (n = a[0] + i.x,
  3875. o = a[1] + i.y),
  3876. t.translate(n, o),
  3877. t.rotate(-e.textRotation),
  3878. t.translate(-n, -o)
  3879. }
  3880. }
  3881. function Vn(t, e, i, n, o, a, r, s) {
  3882. var l = n.rich[i.styleName] || {};
  3883. l.text = i.text;
  3884. var u = i.textVerticalAlign
  3885. , h = a + o / 2;
  3886. "top" === u ? h = a + i.height / 2 : "bottom" === u && (h = a + o - i.height / 2),
  3887. !i.isLineHolder && Gn(l) && Fn(t, e, l, "right" === s ? r - i.width : "center" === s ? r - i.width / 2 : r, h - i.height / 2, i.width, i.height);
  3888. var c = i.textPadding;
  3889. c && (r = jn(r, s, c),
  3890. h -= i.height / 2 - c[2] - i.textHeight / 2),
  3891. Zn(e, "shadowBlur", Z(l.textShadowBlur, n.textShadowBlur, 0)),
  3892. Zn(e, "shadowColor", l.textShadowColor || n.textShadowColor || "transparent"),
  3893. Zn(e, "shadowOffsetX", Z(l.textShadowOffsetX, n.textShadowOffsetX, 0)),
  3894. Zn(e, "shadowOffsetY", Z(l.textShadowOffsetY, n.textShadowOffsetY, 0)),
  3895. Zn(e, "textAlign", s),
  3896. Zn(e, "textBaseline", "middle"),
  3897. Zn(e, "font", i.font || Cn);
  3898. var d = Un(l.textStroke || n.textStroke, p)
  3899. , f = Xn(l.textFill || n.textFill)
  3900. , p = H(l.textStrokeWidth, n.textStrokeWidth);
  3901. d && (Zn(e, "lineWidth", p),
  3902. Zn(e, "strokeStyle", d),
  3903. e.strokeText(i.text, r, h)),
  3904. f && (Zn(e, "fillStyle", f),
  3905. e.fillText(i.text, r, h))
  3906. }
  3907. function Gn(t) {
  3908. return !!(t.textBackgroundColor || t.textBorderWidth && t.textBorderColor)
  3909. }
  3910. function Fn(t, e, i, n, o, a, r) {
  3911. var s = i.textBackgroundColor
  3912. , l = i.textBorderWidth
  3913. , u = i.textBorderColor
  3914. , h = R(s);
  3915. if (Zn(e, "shadowBlur", i.textBoxShadowBlur || 0),
  3916. Zn(e, "shadowColor", i.textBoxShadowColor || "transparent"),
  3917. Zn(e, "shadowOffsetX", i.textBoxShadowOffsetX || 0),
  3918. Zn(e, "shadowOffsetY", i.textBoxShadowOffsetY || 0),
  3919. h || l && u) {
  3920. e.beginPath();
  3921. var c = i.textBorderRadius;
  3922. c ? Dn(e, {
  3923. x: n,
  3924. y: o,
  3925. width: a,
  3926. height: r,
  3927. r: c
  3928. }) : e.rect(n, o, a, r),
  3929. e.closePath()
  3930. }
  3931. if (h)
  3932. if (Zn(e, "fillStyle", s),
  3933. null != i.fillOpacity) {
  3934. var d = e.globalAlpha;
  3935. e.globalAlpha = i.fillOpacity * i.opacity,
  3936. e.fill(),
  3937. e.globalAlpha = d
  3938. } else
  3939. e.fill();
  3940. else if (z(s)) {
  3941. var f = s.image;
  3942. (f = an(f, null, t, Wn, s)) && sn(f) && e.drawImage(f, n, o, a, r)
  3943. }
  3944. if (l && u)
  3945. if (Zn(e, "lineWidth", l),
  3946. Zn(e, "strokeStyle", u),
  3947. null != i.strokeOpacity) {
  3948. d = e.globalAlpha;
  3949. e.globalAlpha = i.strokeOpacity * i.opacity,
  3950. e.stroke(),
  3951. e.globalAlpha = d
  3952. } else
  3953. e.stroke()
  3954. }
  3955. function Wn(t, e) {
  3956. e.image = t
  3957. }
  3958. function Hn(t, e, i, n) {
  3959. var o = i.x || 0
  3960. , a = i.y || 0
  3961. , r = i.textAlign
  3962. , s = i.textVerticalAlign;
  3963. if (n) {
  3964. var l = i.textPosition;
  3965. if (l instanceof Array)
  3966. o = n.x + Yn(l[0], n.width),
  3967. a = n.y + Yn(l[1], n.height);
  3968. else {
  3969. var u = e && e.calculateTextPosition ? e.calculateTextPosition(Nn, i, n) : yn(Nn, i, n);
  3970. o = u.x,
  3971. a = u.y,
  3972. r = r || u.textAlign,
  3973. s = s || u.textVerticalAlign
  3974. }
  3975. var h = i.textOffset;
  3976. h && (o += h[0],
  3977. a += h[1])
  3978. }
  3979. return (t = t || {}).baseX = o,
  3980. t.baseY = a,
  3981. t.textAlign = r,
  3982. t.textVerticalAlign = s,
  3983. t
  3984. }
  3985. function Zn(t, e, i) {
  3986. return t[e] = Fi(t, e, i),
  3987. t[e]
  3988. }
  3989. function Un(t, e) {
  3990. return null == t || e <= 0 || "transparent" === t || "none" === t ? null : t.image || t.colorStops ? "#000" : t
  3991. }
  3992. function Xn(t) {
  3993. return null == t || "none" === t ? null : t.image || t.colorStops ? "#000" : t
  3994. }
  3995. function Yn(t, e) {
  3996. return "string" == typeof t ? 0 <= t.lastIndexOf("%") ? parseFloat(t) / 100 * e : parseFloat(t) : t
  3997. }
  3998. function jn(t, e, i) {
  3999. return "right" === e ? t - i[1] : "center" === e ? t + i[3] / 2 - i[1] / 2 : t + i[3]
  4000. }
  4001. function qn(t, e) {
  4002. return null != t && (t || e.textBackgroundColor || e.textBorderWidth && e.textBorderColor || e.textPadding)
  4003. }
  4004. function Kn() {}
  4005. var $n = new Di;
  4006. function Jn(t) {
  4007. for (var e in t = t || {},
  4008. _i.call(this, t),
  4009. t)
  4010. t.hasOwnProperty(e) && "style" !== e && (this[e] = t[e]);
  4011. this.style = new Ui(t.style,this),
  4012. this._rect = null,
  4013. this.__clipPaths = null
  4014. }
  4015. function Qn(t) {
  4016. Jn.call(this, t)
  4017. }
  4018. Jn.prototype = {
  4019. constructor: Jn,
  4020. type: "displayable",
  4021. __dirty: !0,
  4022. invisible: !(Kn.prototype = {
  4023. constructor: Kn,
  4024. drawRectText: function(t, e) {
  4025. var i = this.style;
  4026. e = i.textRect || e,
  4027. this.__dirty && En(i);
  4028. var n = i.text;
  4029. if (null != n && (n += ""),
  4030. qn(n, i)) {
  4031. t.save();
  4032. var o = this.transform;
  4033. i.transformText ? this.setTransform(t) : o && ($n.copy(e),
  4034. $n.applyTransform(o),
  4035. e = $n),
  4036. zn(this, t, n, i, e, Hi),
  4037. t.restore()
  4038. }
  4039. }
  4040. }),
  4041. z: 0,
  4042. z2: 0,
  4043. zlevel: 0,
  4044. draggable: !1,
  4045. dragging: !1,
  4046. silent: !1,
  4047. culling: !1,
  4048. cursor: "pointer",
  4049. rectHover: !1,
  4050. progressive: !1,
  4051. incremental: !1,
  4052. globalScaleRatio: 1,
  4053. beforeBrush: function(t) {},
  4054. afterBrush: function(t) {},
  4055. brush: function(t, e) {},
  4056. getBoundingRect: function() {},
  4057. contain: function(t, e) {
  4058. return this.rectContain(t, e)
  4059. },
  4060. traverse: function(t, e) {
  4061. t.call(e, this)
  4062. },
  4063. rectContain: function(t, e) {
  4064. var i = this.transformCoordToLocal(t, e);
  4065. return this.getBoundingRect().contain(i[0], i[1])
  4066. },
  4067. dirty: function() {
  4068. this.__dirty = this.__dirtyText = !0,
  4069. this._rect = null,
  4070. this.__zr && this.__zr.refresh()
  4071. },
  4072. animateStyle: function(t) {
  4073. return this.animate("style", t)
  4074. },
  4075. attrKV: function(t, e) {
  4076. "style" !== t ? _i.prototype.attrKV.call(this, t, e) : this.style.set(e)
  4077. },
  4078. setStyle: function(t, e) {
  4079. return this.style.set(t, e),
  4080. this.dirty(!1),
  4081. this
  4082. },
  4083. useStyle: function(t) {
  4084. return this.style = new Ui(t,this),
  4085. this.dirty(!1),
  4086. this
  4087. },
  4088. calculateTextPosition: null
  4089. },
  4090. w(Jn, _i),
  4091. b(Jn, Kn),
  4092. Qn.prototype = {
  4093. constructor: Qn,
  4094. type: "image",
  4095. brush: function(t, e) {
  4096. var i = this.style
  4097. , n = i.image;
  4098. i.bind(t, this, e);
  4099. var o = this._image = an(n, this._image, this, this.onload);
  4100. if (o && sn(o)) {
  4101. var a = i.x || 0
  4102. , r = i.y || 0
  4103. , s = i.width
  4104. , l = i.height
  4105. , u = o.width / o.height;
  4106. if (null == s && null != l ? s = l * u : null == l && null != s ? l = s / u : null == s && null == l && (s = o.width,
  4107. l = o.height),
  4108. this.setTransform(t),
  4109. i.sWidth && i.sHeight) {
  4110. var h = i.sx || 0
  4111. , c = i.sy || 0;
  4112. t.drawImage(o, h, c, i.sWidth, i.sHeight, a, r, s, l)
  4113. } else if (i.sx && i.sy) {
  4114. var d = s - (h = i.sx)
  4115. , f = l - (c = i.sy);
  4116. t.drawImage(o, h, c, d, f, a, r, s, l)
  4117. } else
  4118. t.drawImage(o, a, r, s, l);
  4119. null != i.text && (this.restoreTransform(t),
  4120. this.drawRectText(t, this.getBoundingRect()))
  4121. }
  4122. },
  4123. getBoundingRect: function() {
  4124. var t = this.style;
  4125. return this._rect || (this._rect = new Di(t.x || 0,t.y || 0,t.width || 0,t.height || 0)),
  4126. this._rect
  4127. }
  4128. },
  4129. w(Qn, Jn);
  4130. var to = 314159;
  4131. function eo(t) {
  4132. return parseInt(t, 10)
  4133. }
  4134. var io = new Di(0,0,0,0)
  4135. , no = new Di(0,0,0,0);
  4136. function oo(t, e, i) {
  4137. this.type = "canvas";
  4138. var n = !t.nodeName || "CANVAS" === t.nodeName.toUpperCase();
  4139. this._opts = i = P({}, i || {}),
  4140. this.dpr = i.devicePixelRatio || pi,
  4141. this._singleCanvas = n;
  4142. var o = (this.root = t).style;
  4143. o && (o["-webkit-tap-highlight-color"] = "transparent",
  4144. o["-webkit-user-select"] = o["user-select"] = o["-webkit-touch-callout"] = "none",
  4145. t.innerHTML = ""),
  4146. this.storage = e;
  4147. var a = this._zlevelList = []
  4148. , r = this._layers = {};
  4149. if (this._layerConfig = {},
  4150. this._needsManuallyCompositing = !1,
  4151. n) {
  4152. var s = t.width
  4153. , l = t.height;
  4154. null != i.width && (s = i.width),
  4155. null != i.height && (l = i.height),
  4156. this.dpr = i.devicePixelRatio || 1,
  4157. t.width = s * this.dpr,
  4158. t.height = l * this.dpr,
  4159. this._width = s,
  4160. this._height = l;
  4161. var u = new tn(t,this,this.dpr);
  4162. u.__builtin__ = !0,
  4163. u.initContext(),
  4164. (r[to] = u).zlevel = to,
  4165. a.push(to),
  4166. this._domRoot = t
  4167. } else {
  4168. this._width = this._getSize(0),
  4169. this._height = this._getSize(1);
  4170. var h = this._domRoot = function(t, e) {
  4171. var i = document.createElement("div");
  4172. return i.style.cssText = ["position:relative", "width:" + t + "px", "height:" + e + "px", "padding:0", "margin:0", "border-width:0"].join(";") + ";",
  4173. i
  4174. }(this._width, this._height);
  4175. t.appendChild(h)
  4176. }
  4177. this._hoverlayer = null,
  4178. this._hoverElements = []
  4179. }
  4180. oo.prototype = {
  4181. constructor: oo,
  4182. getType: function() {
  4183. return "canvas"
  4184. },
  4185. isSingleCanvas: function() {
  4186. return this._singleCanvas
  4187. },
  4188. getViewportRoot: function() {
  4189. return this._domRoot
  4190. },
  4191. getViewportRootOffset: function() {
  4192. var t = this.getViewportRoot();
  4193. if (t)
  4194. return {
  4195. offsetLeft: t.offsetLeft || 0,
  4196. offsetTop: t.offsetTop || 0
  4197. }
  4198. },
  4199. refresh: function(t) {
  4200. var e = this.storage.getDisplayList(!0)
  4201. , i = this._zlevelList;
  4202. this._redrawId = Math.random(),
  4203. this._paintList(e, t, this._redrawId);
  4204. for (var n = 0; n < i.length; n++) {
  4205. var o = i[n]
  4206. , a = this._layers[o];
  4207. if (!a.__builtin__ && a.refresh) {
  4208. var r = 0 === n ? this._backgroundColor : null;
  4209. a.refresh(r)
  4210. }
  4211. }
  4212. return this.refreshHover(),
  4213. this
  4214. },
  4215. addHover: function(t, e) {
  4216. if (!t.__hoverMir) {
  4217. var i = new t.constructor({
  4218. style: t.style,
  4219. shape: t.shape,
  4220. z: t.z,
  4221. z2: t.z2,
  4222. silent: t.silent
  4223. });
  4224. return (i.__from = t).__hoverMir = i,
  4225. e && i.setStyle(e),
  4226. this._hoverElements.push(i),
  4227. i
  4228. }
  4229. },
  4230. removeHover: function(t) {
  4231. var e = t.__hoverMir
  4232. , i = this._hoverElements
  4233. , n = _(i, e);
  4234. 0 <= n && i.splice(n, 1),
  4235. t.__hoverMir = null
  4236. },
  4237. clearHover: function(t) {
  4238. for (var e = this._hoverElements, i = 0; i < e.length; i++) {
  4239. var n = e[i].__from;
  4240. n && (n.__hoverMir = null)
  4241. }
  4242. e.length = 0
  4243. },
  4244. refreshHover: function() {
  4245. var t = this._hoverElements
  4246. , e = t.length
  4247. , i = this._hoverlayer;
  4248. if (i && i.clear(),
  4249. e) {
  4250. zi(t, this.storage.displayableSortFunc);
  4251. var n = {};
  4252. (i = i || (this._hoverlayer = this.getLayer(1e5))).ctx.save();
  4253. for (var o = 0; o < e; ) {
  4254. var a = t[o]
  4255. , r = a.__from;
  4256. r && r.__zr ? (o++,
  4257. r.invisible || (a.transform = r.transform,
  4258. a.invTransform = r.invTransform,
  4259. a.__clipPaths = r.__clipPaths,
  4260. this._doPaintEl(a, i, !0, n))) : (t.splice(o, 1),
  4261. r.__hoverMir = null,
  4262. e--)
  4263. }
  4264. i.ctx.restore()
  4265. }
  4266. },
  4267. getHoverLayer: function() {
  4268. return this.getLayer(1e5)
  4269. },
  4270. _paintList: function(t, e, i) {
  4271. if (this._redrawId === i) {
  4272. e = e || !1,
  4273. this._updateLayerStatus(t);
  4274. var n = this._doPaintList(t, e);
  4275. if (this._needsManuallyCompositing && this._compositeManually(),
  4276. !n) {
  4277. var o = this;
  4278. en(function() {
  4279. o._paintList(t, e, i)
  4280. })
  4281. }
  4282. }
  4283. },
  4284. _compositeManually: function() {
  4285. var e = this.getLayer(to).ctx
  4286. , i = this._domRoot.width
  4287. , n = this._domRoot.height;
  4288. e.clearRect(0, 0, i, n),
  4289. this.eachBuiltinLayer(function(t) {
  4290. t.virtual && e.drawImage(t.dom, 0, 0, i, n)
  4291. })
  4292. },
  4293. _doPaintList: function(t, e) {
  4294. for (var i = [], n = 0; n < this._zlevelList.length; n++) {
  4295. var o = this._zlevelList[n];
  4296. (s = this._layers[o]).__builtin__ && s !== this._hoverlayer && (s.__dirty || e) && i.push(s)
  4297. }
  4298. for (var a = !0, r = 0; r < i.length; r++) {
  4299. var s, l = (s = i[r]).ctx, u = {};
  4300. l.save();
  4301. var h = e ? s.__startIndex : s.__drawIndex
  4302. , c = !e && s.incremental && Date.now
  4303. , d = c && Date.now()
  4304. , f = s.zlevel === this._zlevelList[0] ? this._backgroundColor : null;
  4305. if (s.__startIndex === s.__endIndex)
  4306. s.clear(!1, f);
  4307. else if (h === s.__startIndex) {
  4308. var p = t[h];
  4309. p.incremental && p.notClear && !e || s.clear(!1, f)
  4310. }
  4311. -1 === h && (console.error("For some unknown reason. drawIndex is -1"),
  4312. h = s.__startIndex);
  4313. for (var g = h; g < s.__endIndex; g++) {
  4314. var m = t[g];
  4315. if (this._doPaintEl(m, s, e, u),
  4316. m.__dirty = m.__dirtyText = !1,
  4317. c)
  4318. if (15 < Date.now() - d)
  4319. break
  4320. }
  4321. s.__drawIndex = g,
  4322. s.__drawIndex < s.__endIndex && (a = !1),
  4323. u.prevElClipPaths && l.restore(),
  4324. l.restore()
  4325. }
  4326. return v.wxa && E(this._layers, function(t) {
  4327. t && t.ctx && t.ctx.draw && t.ctx.draw()
  4328. }),
  4329. a
  4330. },
  4331. _doPaintEl: function(t, e, i, n) {
  4332. var o = e.ctx
  4333. , a = t.transform;
  4334. if ((e.__dirty || i) && !t.invisible && 0 !== t.style.opacity && (!a || a[0] || a[3]) && (!t.culling || !function(t, e, i) {
  4335. return io.copy(t.getBoundingRect()),
  4336. t.transform && io.applyTransform(t.transform),
  4337. no.width = e,
  4338. no.height = i,
  4339. !io.intersect(no)
  4340. }(t, this._width, this._height))) {
  4341. var r = t.__clipPaths
  4342. , s = n.prevElClipPaths;
  4343. s && !function(t, e) {
  4344. if (t === e)
  4345. return !1;
  4346. if (!t || !e || t.length !== e.length)
  4347. return !0;
  4348. for (var i = 0; i < t.length; i++)
  4349. if (t[i] !== e[i])
  4350. return !0;
  4351. return !1
  4352. }(r, s) || (s && (o.restore(),
  4353. n.prevElClipPaths = null,
  4354. n.prevEl = null),
  4355. r && (o.save(),
  4356. function(t, e) {
  4357. for (var i = 0; i < t.length; i++) {
  4358. var n = t[i];
  4359. n.setTransform(e),
  4360. e.beginPath(),
  4361. n.buildPath(e, n.shape),
  4362. e.clip(),
  4363. n.restoreTransform(e)
  4364. }
  4365. }(r, o),
  4366. n.prevElClipPaths = r)),
  4367. t.beforeBrush && t.beforeBrush(o),
  4368. t.brush(o, n.prevEl || null),
  4369. (n.prevEl = t).afterBrush && t.afterBrush(o)
  4370. }
  4371. },
  4372. getLayer: function(t, e) {
  4373. this._singleCanvas && !this._needsManuallyCompositing && (t = to);
  4374. var i = this._layers[t];
  4375. return i || ((i = new tn("zr_" + t,this,this.dpr)).zlevel = t,
  4376. i.__builtin__ = !0,
  4377. this._layerConfig[t] ? m(i, this._layerConfig[t], !0) : this._layerConfig[t - .01] && m(i, this._layerConfig[t - .01], !0),
  4378. e && (i.virtual = e),
  4379. this.insertLayer(t, i),
  4380. i.initContext()),
  4381. i
  4382. },
  4383. insertLayer: function(t, e) {
  4384. var i = this._layers
  4385. , n = this._zlevelList
  4386. , o = n.length
  4387. , a = null
  4388. , r = -1
  4389. , s = this._domRoot;
  4390. if (i[t])
  4391. vi("ZLevel " + t + " has been used already");
  4392. else if (function(t) {
  4393. return !!t && (!!t.__builtin__ || "function" == typeof t.resize && "function" == typeof t.refresh)
  4394. }(e)) {
  4395. if (0 < o && t > n[0]) {
  4396. for (r = 0; r < o - 1 && !(n[r] < t && n[r + 1] > t); r++)
  4397. ;
  4398. a = i[n[r]]
  4399. }
  4400. if (n.splice(r + 1, 0, t),
  4401. !(i[t] = e).virtual)
  4402. if (a) {
  4403. var l = a.dom;
  4404. l.nextSibling ? s.insertBefore(e.dom, l.nextSibling) : s.appendChild(e.dom)
  4405. } else
  4406. s.firstChild ? s.insertBefore(e.dom, s.firstChild) : s.appendChild(e.dom)
  4407. } else
  4408. vi("Layer of zlevel " + t + " is not valid")
  4409. },
  4410. eachLayer: function(t, e) {
  4411. var i, n, o = this._zlevelList;
  4412. for (n = 0; n < o.length; n++)
  4413. i = o[n],
  4414. t.call(e, this._layers[i], i)
  4415. },
  4416. eachBuiltinLayer: function(t, e) {
  4417. var i, n, o, a = this._zlevelList;
  4418. for (o = 0; o < a.length; o++)
  4419. n = a[o],
  4420. (i = this._layers[n]).__builtin__ && t.call(e, i, n)
  4421. },
  4422. eachOtherLayer: function(t, e) {
  4423. var i, n, o, a = this._zlevelList;
  4424. for (o = 0; o < a.length; o++)
  4425. n = a[o],
  4426. (i = this._layers[n]).__builtin__ || t.call(e, i, n)
  4427. },
  4428. getLayers: function() {
  4429. return this._layers
  4430. },
  4431. _updateLayerStatus: function(t) {
  4432. function e(t) {
  4433. o && (o.__endIndex !== t && (o.__dirty = !0),
  4434. o.__endIndex = t)
  4435. }
  4436. if (this.eachBuiltinLayer(function(t, e) {
  4437. t.__dirty = t.__used = !1
  4438. }),
  4439. this._singleCanvas)
  4440. for (var i = 1; i < t.length; i++) {
  4441. if ((r = t[i]).zlevel !== t[i - 1].zlevel || r.incremental) {
  4442. this._needsManuallyCompositing = !0;
  4443. break
  4444. }
  4445. }
  4446. var n, o = null, a = 0;
  4447. for (i = 0; i < t.length; i++) {
  4448. var r, s, l = (r = t[i]).zlevel;
  4449. n !== l && (n = l,
  4450. a = 0),
  4451. r.incremental ? ((s = this.getLayer(l + .001, this._needsManuallyCompositing)).incremental = !0,
  4452. a = 1) : s = this.getLayer(l + (0 < a ? .01 : 0), this._needsManuallyCompositing),
  4453. s.__builtin__ || vi("ZLevel " + l + " has been used by unkown layer " + s.id),
  4454. s !== o && (s.__used = !0,
  4455. s.__startIndex !== i && (s.__dirty = !0),
  4456. s.__startIndex = i,
  4457. s.incremental ? s.__drawIndex = -1 : s.__drawIndex = i,
  4458. e(i),
  4459. o = s),
  4460. r.__dirty && (s.__dirty = !0,
  4461. s.incremental && s.__drawIndex < 0 && (s.__drawIndex = i))
  4462. }
  4463. e(i),
  4464. this.eachBuiltinLayer(function(t, e) {
  4465. !t.__used && 0 < t.getElementCount() && (t.__dirty = !0,
  4466. t.__startIndex = t.__endIndex = t.__drawIndex = 0),
  4467. t.__dirty && t.__drawIndex < 0 && (t.__drawIndex = t.__startIndex)
  4468. })
  4469. },
  4470. clear: function() {
  4471. return this.eachBuiltinLayer(this._clearLayer),
  4472. this
  4473. },
  4474. _clearLayer: function(t) {
  4475. t.clear()
  4476. },
  4477. setBackgroundColor: function(t) {
  4478. this._backgroundColor = t
  4479. },
  4480. configLayer: function(t, e) {
  4481. if (e) {
  4482. var i = this._layerConfig;
  4483. i[t] ? m(i[t], e, !0) : i[t] = e;
  4484. for (var n = 0; n < this._zlevelList.length; n++) {
  4485. var o = this._zlevelList[n];
  4486. if (o === t || o === t + .01)
  4487. m(this._layers[o], i[t], !0)
  4488. }
  4489. }
  4490. },
  4491. delLayer: function(t) {
  4492. var e = this._layers
  4493. , i = this._zlevelList
  4494. , n = e[t];
  4495. n && (n.dom.parentNode.removeChild(n.dom),
  4496. delete e[t],
  4497. i.splice(_(i, t), 1))
  4498. },
  4499. resize: function(e, i) {
  4500. if (this._domRoot.style) {
  4501. var t = this._domRoot;
  4502. t.style.display = "none";
  4503. var n = this._opts;
  4504. if (null != e && (n.width = e),
  4505. null != i && (n.height = i),
  4506. e = this._getSize(0),
  4507. i = this._getSize(1),
  4508. t.style.display = "",
  4509. this._width !== e || i !== this._height) {
  4510. for (var o in t.style.width = e + "px",
  4511. t.style.height = i + "px",
  4512. this._layers)
  4513. this._layers.hasOwnProperty(o) && this._layers[o].resize(e, i);
  4514. E(this._progressiveLayers, function(t) {
  4515. t.resize(e, i)
  4516. }),
  4517. this.refresh(!0)
  4518. }
  4519. this._width = e,
  4520. this._height = i
  4521. } else {
  4522. if (null == e || null == i)
  4523. return;
  4524. this._width = e,
  4525. this._height = i,
  4526. this.getLayer(to).resize(e, i)
  4527. }
  4528. return this
  4529. },
  4530. clearLayer: function(t) {
  4531. var e = this._layers[t];
  4532. e && e.clear()
  4533. },
  4534. dispose: function() {
  4535. this.root.innerHTML = "",
  4536. this.root = this.storage = this._domRoot = this._layers = null
  4537. },
  4538. getRenderedCanvas: function(t) {
  4539. if (t = t || {},
  4540. this._singleCanvas && !this._compositeManually)
  4541. return this._layers[to].dom;
  4542. var e = new tn("image",this,t.pixelRatio || this.dpr);
  4543. if (e.initContext(),
  4544. e.clear(!1, t.backgroundColor || this._backgroundColor),
  4545. t.pixelRatio <= this.dpr) {
  4546. this.refresh();
  4547. var i = e.dom.width
  4548. , n = e.dom.height
  4549. , o = e.ctx;
  4550. this.eachLayer(function(t) {
  4551. t.__builtin__ ? o.drawImage(t.dom, 0, 0, i, n) : t.renderToCanvas && (e.ctx.save(),
  4552. t.renderToCanvas(e.ctx),
  4553. e.ctx.restore())
  4554. })
  4555. } else
  4556. for (var a = {}, r = this.storage.getDisplayList(!0), s = 0; s < r.length; s++) {
  4557. var l = r[s];
  4558. this._doPaintEl(l, e, !0, a)
  4559. }
  4560. return e.dom
  4561. },
  4562. getWidth: function() {
  4563. return this._width
  4564. },
  4565. getHeight: function() {
  4566. return this._height
  4567. },
  4568. _getSize: function(t) {
  4569. var e = this._opts
  4570. , i = ["width", "height"][t]
  4571. , n = ["clientWidth", "clientHeight"][t]
  4572. , o = ["paddingLeft", "paddingTop"][t]
  4573. , a = ["paddingRight", "paddingBottom"][t];
  4574. if (null != e[i] && "auto" !== e[i])
  4575. return parseFloat(e[i]);
  4576. var r = this.root
  4577. , s = document.defaultView.getComputedStyle(r);
  4578. return (r[n] || eo(s[i]) || eo(r.style[i])) - (eo(s[o]) || 0) - (eo(s[a]) || 0) | 0
  4579. },
  4580. pathToImage: function(t, e) {
  4581. e = e || this.dpr;
  4582. var i = document.createElement("canvas")
  4583. , n = i.getContext("2d")
  4584. , o = t.getBoundingRect()
  4585. , a = t.style
  4586. , r = a.shadowBlur * e
  4587. , s = a.shadowOffsetX * e
  4588. , l = a.shadowOffsetY * e
  4589. , u = a.hasStroke() ? a.lineWidth : 0
  4590. , h = Math.max(u / 2, r - s)
  4591. , c = Math.max(u / 2, s + r)
  4592. , d = Math.max(u / 2, r - l)
  4593. , f = Math.max(u / 2, l + r)
  4594. , p = o.width + h + c
  4595. , g = o.height + d + f;
  4596. i.width = p * e,
  4597. i.height = g * e,
  4598. n.scale(e, e),
  4599. n.clearRect(0, 0, p, g),
  4600. n.dpr = e;
  4601. var m = {
  4602. position: t.position,
  4603. rotation: t.rotation,
  4604. scale: t.scale
  4605. };
  4606. t.position = [h - o.x, d - o.y],
  4607. t.rotation = 0,
  4608. t.scale = [1, 1],
  4609. t.updateTransform(),
  4610. t && t.brush(n);
  4611. var v = new Qn({
  4612. style: {
  4613. x: 0,
  4614. y: 0,
  4615. image: i
  4616. }
  4617. });
  4618. return null != m.position && (v.position = t.position = m.position),
  4619. null != m.rotation && (v.rotation = t.rotation = m.rotation),
  4620. null != m.scale && (v.scale = t.scale = m.scale),
  4621. v
  4622. }
  4623. };
  4624. function ao(t) {
  4625. t = t || {},
  4626. this.stage = t.stage || {},
  4627. this.onframe = t.onframe || function() {}
  4628. ,
  4629. this._clips = [],
  4630. this._running = !1,
  4631. this._time,
  4632. this._pausedTime,
  4633. this._pauseStart,
  4634. this._paused = !1,
  4635. Ct.call(this)
  4636. }
  4637. ao.prototype = {
  4638. constructor: ao,
  4639. addClip: function(t) {
  4640. this._clips.push(t)
  4641. },
  4642. addAnimator: function(t) {
  4643. t.animation = this;
  4644. for (var e = t.getClips(), i = 0; i < e.length; i++)
  4645. this.addClip(e[i])
  4646. },
  4647. removeClip: function(t) {
  4648. var e = _(this._clips, t);
  4649. 0 <= e && this._clips.splice(e, 1)
  4650. },
  4651. removeAnimator: function(t) {
  4652. for (var e = t.getClips(), i = 0; i < e.length; i++)
  4653. this.removeClip(e[i]);
  4654. t.animation = null
  4655. },
  4656. _update: function() {
  4657. for (var t = (new Date).getTime() - this._pausedTime, e = t - this._time, i = this._clips, n = i.length, o = [], a = [], r = 0; r < n; r++) {
  4658. var s = i[r]
  4659. , l = s.step(t, e);
  4660. l && (o.push(l),
  4661. a.push(s))
  4662. }
  4663. for (r = 0; r < n; )
  4664. i[r]._needsRemove ? (i[r] = i[n - 1],
  4665. i.pop(),
  4666. n--) : r++;
  4667. n = o.length;
  4668. for (r = 0; r < n; r++)
  4669. a[r].fire(o[r]);
  4670. this._time = t,
  4671. this.onframe(e),
  4672. this.trigger("frame", e),
  4673. this.stage.update && this.stage.update()
  4674. },
  4675. _startLoop: function() {
  4676. var e = this;
  4677. this._running = !0,
  4678. en(function t() {
  4679. e._running && (en(t),
  4680. e._paused || e._update())
  4681. })
  4682. },
  4683. start: function() {
  4684. this._time = (new Date).getTime(),
  4685. this._pausedTime = 0,
  4686. this._startLoop()
  4687. },
  4688. stop: function() {
  4689. this._running = !1
  4690. },
  4691. pause: function() {
  4692. this._paused || (this._pauseStart = (new Date).getTime(),
  4693. this._paused = !0)
  4694. },
  4695. resume: function() {
  4696. this._paused && (this._pausedTime += (new Date).getTime() - this._pauseStart,
  4697. this._paused = !1)
  4698. },
  4699. clear: function() {
  4700. this._clips = []
  4701. },
  4702. isFinished: function() {
  4703. return !this._clips.length
  4704. },
  4705. animate: function(t, e) {
  4706. var i = new di(t,(e = e || {}).loop,e.getter,e.setter);
  4707. return this.addAnimator(i),
  4708. i
  4709. }
  4710. },
  4711. b(ao, Ct);
  4712. var ro, so, lo = v.domSupported, uo = (so = {
  4713. pointerdown: 1,
  4714. pointerup: 1,
  4715. pointermove: 1,
  4716. pointerout: 1
  4717. },
  4718. {
  4719. mouse: ro = ["click", "dblclick", "mousewheel", "mouseout", "mouseup", "mousedown", "mousemove", "contextmenu"],
  4720. touch: ["touchstart", "touchend", "touchmove"],
  4721. pointer: O(ro, function(t) {
  4722. var e = t.replace("mouse", "pointer");
  4723. return so.hasOwnProperty(e) ? e : t
  4724. })
  4725. }), ho = {
  4726. mouse: ["mousemove", "mouseup"],
  4727. pointer: ["pointermove", "pointerup"]
  4728. };
  4729. function co(t) {
  4730. return "mousewheel" === t && v.browser.firefox ? "DOMMouseScroll" : t
  4731. }
  4732. function fo(t) {
  4733. var e = t.pointerType;
  4734. return "pen" === e || "touch" === e
  4735. }
  4736. function po(t) {
  4737. t && (t.zrByTouch = !0)
  4738. }
  4739. function go(t, e) {
  4740. for (var i = e, n = !1; i && 9 !== i.nodeType && !(n = i.domBelongToZr || i !== e && i === t.painterRoot); )
  4741. i = i.parentNode;
  4742. return n
  4743. }
  4744. function mo(t, e) {
  4745. this.type = e.type,
  4746. this.target = this.currentTarget = t.dom,
  4747. this.pointerType = e.pointerType,
  4748. this.clientX = e.clientX,
  4749. this.clientY = e.clientY
  4750. }
  4751. var vo = mo.prototype;
  4752. vo.stopPropagation = vo.stopImmediatePropagation = vo.preventDefault = et;
  4753. var yo = {
  4754. mousedown: function(t) {
  4755. t = Zt(this.dom, t),
  4756. this._mayPointerCapture = [t.zrX, t.zrY],
  4757. this.trigger("mousedown", t)
  4758. },
  4759. mousemove: function(t) {
  4760. t = Zt(this.dom, t);
  4761. var e = this._mayPointerCapture;
  4762. !e || t.zrX === e[0] && t.zrY === e[1] || Mo(this, !0),
  4763. this.trigger("mousemove", t)
  4764. },
  4765. mouseup: function(t) {
  4766. t = Zt(this.dom, t),
  4767. Mo(this, !1),
  4768. this.trigger("mouseup", t)
  4769. },
  4770. mouseout: function(t) {
  4771. t = Zt(this.dom, t),
  4772. this._pointerCapturing && (t.zrEventControl = "no_globalout");
  4773. var e = t.toElement || t.relatedTarget;
  4774. t.zrIsToLocalDOM = go(this, e),
  4775. this.trigger("mouseout", t)
  4776. },
  4777. touchstart: function(t) {
  4778. po(t = Zt(this.dom, t)),
  4779. this._lastTouchMoment = new Date,
  4780. this.handler.processGesture(t, "start"),
  4781. yo.mousemove.call(this, t),
  4782. yo.mousedown.call(this, t)
  4783. },
  4784. touchmove: function(t) {
  4785. po(t = Zt(this.dom, t)),
  4786. this.handler.processGesture(t, "change"),
  4787. yo.mousemove.call(this, t)
  4788. },
  4789. touchend: function(t) {
  4790. po(t = Zt(this.dom, t)),
  4791. this.handler.processGesture(t, "end"),
  4792. yo.mouseup.call(this, t),
  4793. +new Date - this._lastTouchMoment < 300 && yo.click.call(this, t)
  4794. },
  4795. pointerdown: function(t) {
  4796. yo.mousedown.call(this, t)
  4797. },
  4798. pointermove: function(t) {
  4799. fo(t) || yo.mousemove.call(this, t)
  4800. },
  4801. pointerup: function(t) {
  4802. yo.mouseup.call(this, t)
  4803. },
  4804. pointerout: function(t) {
  4805. fo(t) || yo.mouseout.call(this, t)
  4806. }
  4807. };
  4808. E(["click", "mousewheel", "dblclick", "contextmenu"], function(e) {
  4809. yo[e] = function(t) {
  4810. t = Zt(this.dom, t),
  4811. this.trigger(e, t)
  4812. }
  4813. });
  4814. var xo = {
  4815. pointermove: function(t) {
  4816. fo(t) || xo.mousemove.call(this, t)
  4817. },
  4818. pointerup: function(t) {
  4819. xo.mouseup.call(this, t)
  4820. },
  4821. mousemove: function(t) {
  4822. this.trigger("mousemove", t)
  4823. },
  4824. mouseup: function(t) {
  4825. var e = this._pointerCapturing;
  4826. Mo(this, !1),
  4827. this.trigger("mouseup", t),
  4828. e && (t.zrEventControl = "only_globalout",
  4829. this.trigger("mouseout", t))
  4830. }
  4831. };
  4832. function _o(i, n) {
  4833. var o = n.domHandlers;
  4834. v.pointerEventsSupported ? E(uo.pointer, function(e) {
  4835. bo(n, e, function(t) {
  4836. o[e].call(i, t)
  4837. })
  4838. }) : (v.touchEventsSupported && E(uo.touch, function(e) {
  4839. bo(n, e, function(t) {
  4840. o[e].call(i, t),
  4841. function(t) {
  4842. t.touching = !0,
  4843. null != t.touchTimer && (clearTimeout(t.touchTimer),
  4844. t.touchTimer = null),
  4845. t.touchTimer = setTimeout(function() {
  4846. t.touching = !1,
  4847. t.touchTimer = null
  4848. }, 700)
  4849. }(n)
  4850. })
  4851. }),
  4852. E(uo.mouse, function(e) {
  4853. bo(n, e, function(t) {
  4854. t = Ht(t),
  4855. n.touching || o[e].call(i, t)
  4856. })
  4857. }))
  4858. }
  4859. function wo(i, n) {
  4860. function t(e) {
  4861. bo(n, e, function(t) {
  4862. t = Ht(t),
  4863. go(i, t.target) || (t = function(t, e) {
  4864. return Zt(t.dom, new mo(t,e), !0)
  4865. }(i, t),
  4866. n.domHandlers[e].call(i, t))
  4867. }, {
  4868. capture: !0
  4869. })
  4870. }
  4871. v.pointerEventsSupported ? E(ho.pointer, t) : v.touchEventsSupported || E(ho.mouse, t)
  4872. }
  4873. function bo(t, e, i, n) {
  4874. t.mounted[e] = i,
  4875. t.listenerOpts[e] = n,
  4876. Ut(t.domTarget, co(e), i, n)
  4877. }
  4878. function So(t) {
  4879. var e, i, n, o, a = t.mounted;
  4880. for (var r in a)
  4881. a.hasOwnProperty(r) && (e = t.domTarget,
  4882. i = co(r),
  4883. n = a[r],
  4884. o = t.listenerOpts[r],
  4885. Bt ? e.removeEventListener(i, n, o) : e.detachEvent("on" + i, n));
  4886. t.mounted = {}
  4887. }
  4888. function Mo(t, e) {
  4889. if (t._mayPointerCapture = null,
  4890. lo && t._pointerCapturing ^ e) {
  4891. t._pointerCapturing = e;
  4892. var i = t._globalHandlerScope;
  4893. e ? wo(t, i) : So(i)
  4894. }
  4895. }
  4896. function Io(t, e) {
  4897. this.domTarget = t,
  4898. this.domHandlers = e,
  4899. this.mounted = {},
  4900. this.listenerOpts = {},
  4901. this.touchTimer = null,
  4902. this.touching = !1
  4903. }
  4904. function To(t, e) {
  4905. Ct.call(this),
  4906. this.dom = t,
  4907. this.painterRoot = e,
  4908. this._localHandlerScope = new Io(t,yo),
  4909. lo && (this._globalHandlerScope = new Io(document,xo)),
  4910. this._pointerCapturing = !1,
  4911. this._mayPointerCapture = null,
  4912. _o(this, this._localHandlerScope)
  4913. }
  4914. var Ao = To.prototype;
  4915. Ao.dispose = function() {
  4916. So(this._localHandlerScope),
  4917. lo && So(this._globalHandlerScope)
  4918. }
  4919. ,
  4920. Ao.setCursor = function(t) {
  4921. this.dom.style && (this.dom.style.cursor = t || "default")
  4922. }
  4923. ,
  4924. b(To, Ct);
  4925. var Do = !v.canvasSupported
  4926. , Co = {
  4927. canvas: oo
  4928. }
  4929. , Lo = {};
  4930. function ko(t, e) {
  4931. var i = new No(n(),t,e);
  4932. return Lo[i.id] = i
  4933. }
  4934. function Po(t, e) {
  4935. Co[t] = e
  4936. }
  4937. var No = function(t, e, i) {
  4938. i = i || {},
  4939. this.dom = e,
  4940. this.id = t;
  4941. var n = this
  4942. , o = new Vi
  4943. , a = i.renderer;
  4944. if (Do) {
  4945. if (!Co.vml)
  4946. throw new Error("You need to require 'zrender/vml/vml' to support IE8");
  4947. a = "vml"
  4948. } else
  4949. a && Co[a] || (a = "canvas");
  4950. var r = new Co[a](e,o,i,t);
  4951. this.storage = o,
  4952. this.painter = r;
  4953. var s = v.node || v.worker ? null : new To(r.getViewportRoot(),r.root);
  4954. this.handler = new te(o,r,s,r.root),
  4955. this.animation = new ao({
  4956. stage: {
  4957. update: A(this.flush, this)
  4958. }
  4959. }),
  4960. this.animation.start(),
  4961. this._needsRefresh;
  4962. var l = o.delFromStorage
  4963. , u = o.addToStorage;
  4964. o.delFromStorage = function(t) {
  4965. l.call(o, t),
  4966. t && t.removeSelfFromZr(n)
  4967. }
  4968. ,
  4969. o.addToStorage = function(t) {
  4970. u.call(o, t),
  4971. t.addSelfToZr(n)
  4972. }
  4973. };
  4974. No.prototype = {
  4975. constructor: No,
  4976. getId: function() {
  4977. return this.id
  4978. },
  4979. add: function(t) {
  4980. this.storage.addRoot(t),
  4981. this._needsRefresh = !0
  4982. },
  4983. remove: function(t) {
  4984. this.storage.delRoot(t),
  4985. this._needsRefresh = !0
  4986. },
  4987. configLayer: function(t, e) {
  4988. this.painter.configLayer && this.painter.configLayer(t, e),
  4989. this._needsRefresh = !0
  4990. },
  4991. setBackgroundColor: function(t) {
  4992. this.painter.setBackgroundColor && this.painter.setBackgroundColor(t),
  4993. this._needsRefresh = !0
  4994. },
  4995. refreshImmediately: function() {
  4996. this._needsRefresh = this._needsRefreshHover = !1,
  4997. this.painter.refresh(),
  4998. this._needsRefresh = this._needsRefreshHover = !1
  4999. },
  5000. refresh: function() {
  5001. this._needsRefresh = !0
  5002. },
  5003. flush: function() {
  5004. var t;
  5005. this._needsRefresh && (t = !0,
  5006. this.refreshImmediately()),
  5007. this._needsRefreshHover && (t = !0,
  5008. this.refreshHoverImmediately()),
  5009. t && this.trigger("rendered")
  5010. },
  5011. addHover: function(t, e) {
  5012. if (this.painter.addHover) {
  5013. var i = this.painter.addHover(t, e);
  5014. return this.refreshHover(),
  5015. i
  5016. }
  5017. },
  5018. removeHover: function(t) {
  5019. this.painter.removeHover && (this.painter.removeHover(t),
  5020. this.refreshHover())
  5021. },
  5022. clearHover: function() {
  5023. this.painter.clearHover && (this.painter.clearHover(),
  5024. this.refreshHover())
  5025. },
  5026. refreshHover: function() {
  5027. this._needsRefreshHover = !0
  5028. },
  5029. refreshHoverImmediately: function() {
  5030. this._needsRefreshHover = !1,
  5031. this.painter.refreshHover && this.painter.refreshHover()
  5032. },
  5033. resize: function(t) {
  5034. t = t || {},
  5035. this.painter.resize(t.width, t.height),
  5036. this.handler.resize()
  5037. },
  5038. clearAnimation: function() {
  5039. this.animation.clear()
  5040. },
  5041. getWidth: function() {
  5042. return this.painter.getWidth()
  5043. },
  5044. getHeight: function() {
  5045. return this.painter.getHeight()
  5046. },
  5047. pathToImage: function(t, e) {
  5048. return this.painter.pathToImage(t, e)
  5049. },
  5050. setCursorStyle: function(t) {
  5051. this.handler.setCursorStyle(t)
  5052. },
  5053. findHover: function(t, e) {
  5054. return this.handler.findHover(t, e)
  5055. },
  5056. on: function(t, e, i) {
  5057. this.handler.on(t, e, i)
  5058. },
  5059. off: function(t, e) {
  5060. this.handler.off(t, e)
  5061. },
  5062. trigger: function(t, e) {
  5063. this.handler.trigger(t, e)
  5064. },
  5065. clear: function() {
  5066. this.storage.delRoot(),
  5067. this.painter.clear()
  5068. },
  5069. dispose: function() {
  5070. this.animation.stop(),
  5071. this.clear(),
  5072. this.storage.dispose(),
  5073. this.painter.dispose(),
  5074. this.handler.dispose(),
  5075. this.animation = this.storage = this.painter = this.handler = null,
  5076. function(t) {
  5077. delete Lo[t]
  5078. }(this.id)
  5079. }
  5080. };
  5081. var Oo = (Object.freeze || Object)({
  5082. version: "4.3.1",
  5083. init: ko,
  5084. dispose: function(t) {
  5085. if (t)
  5086. t.dispose();
  5087. else {
  5088. for (var e in Lo)
  5089. Lo.hasOwnProperty(e) && Lo[e].dispose();
  5090. Lo = {}
  5091. }
  5092. return this
  5093. },
  5094. getInstance: function(t) {
  5095. return Lo[t]
  5096. },
  5097. registerPainter: Po
  5098. })
  5099. , Eo = E
  5100. , Ro = z
  5101. , zo = L
  5102. , Bo = "series\0";
  5103. function Vo(t) {
  5104. return t instanceof Array ? t : null == t ? [] : [t]
  5105. }
  5106. function Go(t, e, i) {
  5107. if (t) {
  5108. t[e] = t[e] || {},
  5109. t.emphasis = t.emphasis || {},
  5110. t.emphasis[e] = t.emphasis[e] || {};
  5111. for (var n = 0, o = i.length; n < o; n++) {
  5112. var a = i[n];
  5113. !t.emphasis[e].hasOwnProperty(a) && t[e].hasOwnProperty(a) && (t.emphasis[e][a] = t[e][a])
  5114. }
  5115. }
  5116. }
  5117. var Fo = ["fontStyle", "fontWeight", "fontSize", "fontFamily", "rich", "tag", "color", "textBorderColor", "textBorderWidth", "width", "height", "lineHeight", "align", "verticalAlign", "baseline", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY", "textShadowColor", "textShadowBlur", "textShadowOffsetX", "textShadowOffsetY", "backgroundColor", "borderColor", "borderWidth", "borderRadius", "padding"];
  5118. function Wo(t) {
  5119. return !Ro(t) || zo(t) || t instanceof Date ? t : t.value
  5120. }
  5121. function Ho(t, o) {
  5122. o = (o || []).slice();
  5123. var a = O(t || [], function(t, e) {
  5124. return {
  5125. exist: t
  5126. }
  5127. });
  5128. return Eo(o, function(t, e) {
  5129. if (Ro(t)) {
  5130. for (var i = 0; i < a.length; i++)
  5131. if (!a[i].option && null != t.id && a[i].exist.id === t.id + "")
  5132. return a[i].option = t,
  5133. void (o[e] = null);
  5134. for (i = 0; i < a.length; i++) {
  5135. var n = a[i].exist;
  5136. if (!(a[i].option || null != n.id && null != t.id || null == t.name || Xo(t) || Xo(n) || n.name !== t.name + ""))
  5137. return a[i].option = t,
  5138. void (o[e] = null)
  5139. }
  5140. }
  5141. }),
  5142. Eo(o, function(t, e) {
  5143. if (Ro(t)) {
  5144. for (var i = 0; i < a.length; i++) {
  5145. var n = a[i].exist;
  5146. if (!a[i].option && !Xo(n) && null == t.id) {
  5147. a[i].option = t;
  5148. break
  5149. }
  5150. }
  5151. i >= a.length && a.push({
  5152. option: t
  5153. })
  5154. }
  5155. }),
  5156. a
  5157. }
  5158. function Zo(t) {
  5159. var r = Q();
  5160. Eo(t, function(t, e) {
  5161. var i = t.exist;
  5162. i && r.set(i.id, t)
  5163. }),
  5164. Eo(t, function(t, e) {
  5165. var i = t.option;
  5166. Y(!i || null == i.id || !r.get(i.id) || r.get(i.id) === t, "id duplicates: " + (i && i.id)),
  5167. i && null != i.id && r.set(i.id, t),
  5168. t.keyInfo || (t.keyInfo = {})
  5169. }),
  5170. Eo(t, function(t, e) {
  5171. var i = t.exist
  5172. , n = t.option
  5173. , o = t.keyInfo;
  5174. if (Ro(n)) {
  5175. if (o.name = null != n.name ? n.name + "" : i ? i.name : Bo + e,
  5176. i)
  5177. o.id = i.id;
  5178. else if (null != n.id)
  5179. o.id = n.id + "";
  5180. else
  5181. for (var a = 0; o.id = "\0" + o.name + "\0" + a++,
  5182. r.get(o.id); )
  5183. ;
  5184. r.set(o.id, t)
  5185. }
  5186. })
  5187. }
  5188. function Uo(t) {
  5189. var e = t.name;
  5190. return !(!e || !e.indexOf(Bo))
  5191. }
  5192. function Xo(t) {
  5193. return Ro(t) && t.id && 0 === (t.id + "").indexOf("\0_ec_\0")
  5194. }
  5195. function Yo(e, t) {
  5196. return null != t.dataIndexInside ? t.dataIndexInside : null != t.dataIndex ? L(t.dataIndex) ? O(t.dataIndex, function(t) {
  5197. return e.indexOfRawIndex(t)
  5198. }) : e.indexOfRawIndex(t.dataIndex) : null != t.name ? L(t.name) ? O(t.name, function(t) {
  5199. return e.indexOfName(t)
  5200. }) : e.indexOfName(t.name) : void 0
  5201. }
  5202. function jo() {
  5203. var e = "__\0ec_inner_" + qo++ + "_" + Math.random().toFixed(5);
  5204. return function(t) {
  5205. return t[e] || (t[e] = {})
  5206. }
  5207. }
  5208. var qo = 0;
  5209. function Ko(s, l, u) {
  5210. if (R(l)) {
  5211. var t = {};
  5212. t[l + "Index"] = 0,
  5213. l = t
  5214. }
  5215. var e = u && u.defaultMainType;
  5216. !e || $o(l, e + "Index") || $o(l, e + "Id") || $o(l, e + "Name") || (l[e + "Index"] = 0);
  5217. var h = {};
  5218. return Eo(l, function(t, e) {
  5219. t = l[e];
  5220. if ("dataIndex" !== e && "dataIndexInside" !== e) {
  5221. var i = e.match(/^(\w+)(Index|Id|Name)$/) || []
  5222. , n = i[1]
  5223. , o = (i[2] || "").toLowerCase();
  5224. if (!(!n || !o || null == t || "index" === o && "none" === t || u && u.includeMainTypes && _(u.includeMainTypes, n) < 0)) {
  5225. var a = {
  5226. mainType: n
  5227. };
  5228. "index" === o && "all" === t || (a[o] = t);
  5229. var r = s.queryComponents(a);
  5230. h[n + "Models"] = r,
  5231. h[n + "Model"] = r[0]
  5232. }
  5233. } else
  5234. h[e] = t
  5235. }),
  5236. h
  5237. }
  5238. function $o(t, e) {
  5239. return t && t.hasOwnProperty(e)
  5240. }
  5241. function Jo(t, e, i) {
  5242. t.setAttribute ? t.setAttribute(e, i) : t[e] = i
  5243. }
  5244. function Qo(t) {
  5245. return "auto" === t ? v.domSupported ? "html" : "richText" : t || "html"
  5246. }
  5247. function ta(t, i) {
  5248. var n = Q()
  5249. , o = [];
  5250. return E(t, function(t) {
  5251. var e = i(t);
  5252. (n.get(e) || (o.push(e),
  5253. n.set(e, []))).push(t)
  5254. }),
  5255. {
  5256. keys: o,
  5257. buckets: n
  5258. }
  5259. }
  5260. var ea = "."
  5261. , ia = "___EC__COMPONENT__CONTAINER___";
  5262. function na(t) {
  5263. var e = {
  5264. main: "",
  5265. sub: ""
  5266. };
  5267. return t && (t = t.split(ea),
  5268. e.main = t[0] || "",
  5269. e.sub = t[1] || ""),
  5270. e
  5271. }
  5272. function oa(t) {
  5273. (t.$constructor = t).extend = function(t) {
  5274. function e() {
  5275. t.$constructor ? t.$constructor.apply(this, arguments) : i.apply(this, arguments)
  5276. }
  5277. var i = this;
  5278. return P(e.prototype, t),
  5279. e.extend = this.extend,
  5280. e.superCall = sa,
  5281. e.superApply = la,
  5282. w(e, this),
  5283. e.superClass = i,
  5284. e
  5285. }
  5286. }
  5287. var aa = 0;
  5288. function ra(t) {
  5289. var e = ["__\0is_clz", aa++, Math.random().toFixed(3)].join("_");
  5290. t.prototype[e] = !0,
  5291. t.isInstance = function(t) {
  5292. return !(!t || !t[e])
  5293. }
  5294. }
  5295. function sa(t, e) {
  5296. var i = U(arguments, 2);
  5297. return this.superClass.prototype[e].apply(t, i)
  5298. }
  5299. function la(t, e, i) {
  5300. return this.superClass.prototype[e].apply(t, i)
  5301. }
  5302. function ua(i, t) {
  5303. t = t || {};
  5304. var o = {};
  5305. if (i.registerClass = function(t, e) {
  5306. if (e)
  5307. if (function(t) {
  5308. Y(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t), 'componentType "' + t + '" illegal')
  5309. }(e),
  5310. (e = na(e)).sub) {
  5311. if (e.sub !== ia) {
  5312. (function(t) {
  5313. var e = o[t.main];
  5314. e && e[ia] || ((e = o[t.main] = {})[ia] = !0);
  5315. return e
  5316. }
  5317. )(e)[e.sub] = t
  5318. }
  5319. } else
  5320. o[e.main] = t;
  5321. return t
  5322. }
  5323. ,
  5324. i.getClass = function(t, e, i) {
  5325. var n = o[t];
  5326. if (n && n[ia] && (n = e ? n[e] : null),
  5327. i && !n)
  5328. throw new Error(e ? "Component " + t + "." + (e || "") + " not exists. Load it first." : t + ".type should be specified.");
  5329. return n
  5330. }
  5331. ,
  5332. i.getClassesByMainType = function(t) {
  5333. t = na(t);
  5334. var i = []
  5335. , e = o[t.main];
  5336. return e && e[ia] ? E(e, function(t, e) {
  5337. e !== ia && i.push(t)
  5338. }) : i.push(e),
  5339. i
  5340. }
  5341. ,
  5342. i.hasClass = function(t) {
  5343. return t = na(t),
  5344. !!o[t.main]
  5345. }
  5346. ,
  5347. i.getAllClassMainTypes = function() {
  5348. var i = [];
  5349. return E(o, function(t, e) {
  5350. i.push(e)
  5351. }),
  5352. i
  5353. }
  5354. ,
  5355. i.hasSubTypes = function(t) {
  5356. t = na(t);
  5357. var e = o[t.main];
  5358. return e && e[ia]
  5359. }
  5360. ,
  5361. i.parseClassType = na,
  5362. t.registerWhenExtend) {
  5363. var n = i.extend;
  5364. n && (i.extend = function(t) {
  5365. var e = n.call(this, t);
  5366. return i.registerClass(e, t.type)
  5367. }
  5368. )
  5369. }
  5370. return i
  5371. }
  5372. function ha(s) {
  5373. for (var t = 0; t < s.length; t++)
  5374. s[t][1] || (s[t][1] = s[t][0]);
  5375. return function(t, e, i) {
  5376. for (var n = {}, o = 0; o < s.length; o++) {
  5377. var a = s[o][1];
  5378. if (!(e && 0 <= _(e, a) || i && _(i, a) < 0)) {
  5379. var r = t.getShallow(a);
  5380. null != r && (n[s[o][0]] = r)
  5381. }
  5382. }
  5383. return n
  5384. }
  5385. }
  5386. var ca = ha([["lineWidth", "width"], ["stroke", "color"], ["opacity"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"]])
  5387. , da = {
  5388. getLineStyle: function(t) {
  5389. var e = ca(this, t);
  5390. return e.lineDash = this.getLineDash(e.lineWidth),
  5391. e
  5392. },
  5393. getLineDash: function(t) {
  5394. null == t && (t = 1);
  5395. var e = this.get("type")
  5396. , i = Math.max(t, 2)
  5397. , n = 4 * t;
  5398. return "solid" !== e && null != e && ("dashed" === e ? [n, n] : [i, i])
  5399. }
  5400. }
  5401. , fa = ha([["fill", "color"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["opacity"], ["shadowColor"]])
  5402. , pa = {
  5403. getAreaStyle: function(t, e) {
  5404. return fa(this, t, e)
  5405. }
  5406. }
  5407. , ga = Math.pow
  5408. , ma = Math.sqrt
  5409. , va = 1e-8
  5410. , ya = 1e-4
  5411. , xa = ma(3)
  5412. , _a = 1 / 3
  5413. , wa = ot()
  5414. , ba = ot()
  5415. , Sa = ot();
  5416. function Ma(t) {
  5417. return -va < t && t < va
  5418. }
  5419. function Ia(t) {
  5420. return va < t || t < -va
  5421. }
  5422. function Ta(t, e, i, n, o) {
  5423. var a = 1 - o;
  5424. return a * a * (a * t + 3 * o * e) + o * o * (o * n + 3 * a * i)
  5425. }
  5426. function Aa(t, e, i, n, o) {
  5427. var a = 1 - o;
  5428. return 3 * (((e - t) * a + 2 * (i - e) * o) * a + (n - i) * o * o)
  5429. }
  5430. function Da(t, e, i, n, o) {
  5431. var a = 6 * i - 12 * e + 6 * t
  5432. , r = 9 * e + 3 * n - 3 * t - 9 * i
  5433. , s = 3 * e - 3 * t
  5434. , l = 0;
  5435. if (Ma(r)) {
  5436. if (Ia(a))
  5437. 0 <= (h = -s / a) && h <= 1 && (o[l++] = h)
  5438. } else {
  5439. var u = a * a - 4 * r * s;
  5440. if (Ma(u))
  5441. o[0] = -a / (2 * r);
  5442. else if (0 < u) {
  5443. var h, c = ma(u), d = (-a - c) / (2 * r);
  5444. 0 <= (h = (-a + c) / (2 * r)) && h <= 1 && (o[l++] = h),
  5445. 0 <= d && d <= 1 && (o[l++] = d)
  5446. }
  5447. }
  5448. return l
  5449. }
  5450. function Ca(t, e, i, n, o, a) {
  5451. var r = (e - t) * o + t
  5452. , s = (i - e) * o + e
  5453. , l = (n - i) * o + i
  5454. , u = (s - r) * o + r
  5455. , h = (l - s) * o + s
  5456. , c = (h - u) * o + u;
  5457. a[0] = t,
  5458. a[1] = r,
  5459. a[2] = u,
  5460. a[3] = c,
  5461. a[4] = c,
  5462. a[5] = h,
  5463. a[6] = l,
  5464. a[7] = n
  5465. }
  5466. function La(t, e, i, n) {
  5467. var o = 1 - n;
  5468. return o * (o * t + 2 * n * e) + n * n * i
  5469. }
  5470. function ka(t, e, i, n) {
  5471. return 2 * ((1 - n) * (e - t) + n * (i - e))
  5472. }
  5473. function Pa(t, e, i) {
  5474. var n = t + i - 2 * e;
  5475. return 0 == n ? .5 : (t - e) / n
  5476. }
  5477. function Na(t, e, i, n, o) {
  5478. var a = (e - t) * n + t
  5479. , r = (i - e) * n + e
  5480. , s = (r - a) * n + a;
  5481. o[0] = t,
  5482. o[1] = a,
  5483. o[2] = s,
  5484. o[3] = s,
  5485. o[4] = r,
  5486. o[5] = i
  5487. }
  5488. var Oa = Math.min
  5489. , Ea = Math.max
  5490. , Ra = Math.sin
  5491. , za = Math.cos
  5492. , Ba = 2 * Math.PI
  5493. , Va = ot()
  5494. , Ga = ot()
  5495. , Fa = ot();
  5496. function Wa(t, e, i) {
  5497. if (0 !== t.length) {
  5498. var n, o = t[0], a = o[0], r = o[0], s = o[1], l = o[1];
  5499. for (n = 1; n < t.length; n++)
  5500. o = t[n],
  5501. a = Oa(a, o[0]),
  5502. r = Ea(r, o[0]),
  5503. s = Oa(s, o[1]),
  5504. l = Ea(l, o[1]);
  5505. e[0] = a,
  5506. e[1] = s,
  5507. i[0] = r,
  5508. i[1] = l
  5509. }
  5510. }
  5511. function Ha(t, e, i, n, o, a) {
  5512. o[0] = Oa(t, i),
  5513. o[1] = Oa(e, n),
  5514. a[0] = Ea(t, i),
  5515. a[1] = Ea(e, n)
  5516. }
  5517. var Za = []
  5518. , Ua = [];
  5519. function Xa(t, e, i, n, o, a, r, s, l, u) {
  5520. var h, c = Da, d = Ta, f = c(t, i, o, r, Za);
  5521. for (l[0] = 1 / 0,
  5522. l[1] = 1 / 0,
  5523. u[0] = -1 / 0,
  5524. u[1] = -1 / 0,
  5525. h = 0; h < f; h++) {
  5526. var p = d(t, i, o, r, Za[h]);
  5527. l[0] = Oa(p, l[0]),
  5528. u[0] = Ea(p, u[0])
  5529. }
  5530. for (f = c(e, n, a, s, Ua),
  5531. h = 0; h < f; h++) {
  5532. var g = d(e, n, a, s, Ua[h]);
  5533. l[1] = Oa(g, l[1]),
  5534. u[1] = Ea(g, u[1])
  5535. }
  5536. l[0] = Oa(t, l[0]),
  5537. u[0] = Ea(t, u[0]),
  5538. l[0] = Oa(r, l[0]),
  5539. u[0] = Ea(r, u[0]),
  5540. l[1] = Oa(e, l[1]),
  5541. u[1] = Ea(e, u[1]),
  5542. l[1] = Oa(s, l[1]),
  5543. u[1] = Ea(s, u[1])
  5544. }
  5545. function Ya(t, e, i, n, o, a, r, s, l) {
  5546. var u = St
  5547. , h = Mt
  5548. , c = Math.abs(o - a);
  5549. if (c % Ba < 1e-4 && 1e-4 < c)
  5550. return s[0] = t - i,
  5551. s[1] = e - n,
  5552. l[0] = t + i,
  5553. void (l[1] = e + n);
  5554. if (Va[0] = za(o) * i + t,
  5555. Va[1] = Ra(o) * n + e,
  5556. Ga[0] = za(a) * i + t,
  5557. Ga[1] = Ra(a) * n + e,
  5558. u(s, Va, Ga),
  5559. h(l, Va, Ga),
  5560. (o %= Ba) < 0 && (o += Ba),
  5561. (a %= Ba) < 0 && (a += Ba),
  5562. a < o && !r ? a += Ba : o < a && r && (o += Ba),
  5563. r) {
  5564. var d = a;
  5565. a = o,
  5566. o = d
  5567. }
  5568. for (var f = 0; f < a; f += Math.PI / 2)
  5569. o < f && (Fa[0] = za(f) * i + t,
  5570. Fa[1] = Ra(f) * n + e,
  5571. u(s, Fa, s),
  5572. h(l, Fa, l))
  5573. }
  5574. var ja = {
  5575. M: 1,
  5576. L: 2,
  5577. C: 3,
  5578. Q: 4,
  5579. A: 5,
  5580. Z: 6,
  5581. R: 7
  5582. }
  5583. , qa = []
  5584. , Ka = []
  5585. , $a = []
  5586. , Ja = []
  5587. , Qa = Math.min
  5588. , tr = Math.max
  5589. , er = Math.cos
  5590. , ir = Math.sin
  5591. , nr = Math.sqrt
  5592. , or = Math.abs
  5593. , ar = "undefined" != typeof Float32Array
  5594. , rr = function(t) {
  5595. this._saveData = !t,
  5596. this._saveData && (this.data = []),
  5597. this._ctx = null
  5598. };
  5599. function sr(t, e, i, n, o, a, r) {
  5600. if (0 === o)
  5601. return !1;
  5602. var s = o
  5603. , l = 0;
  5604. if (e + s < r && n + s < r || r < e - s && r < n - s || t + s < a && i + s < a || a < t - s && a < i - s)
  5605. return !1;
  5606. if (t === i)
  5607. return Math.abs(a - t) <= s / 2;
  5608. var u = (l = (e - n) / (t - i)) * a - r + (t * n - i * e) / (t - i);
  5609. return u * u / (l * l + 1) <= s / 2 * s / 2
  5610. }
  5611. function lr(t, e, i, n, o, a, r, s, l, u, h) {
  5612. if (0 === l)
  5613. return !1;
  5614. var c = l;
  5615. return !(e + c < h && n + c < h && a + c < h && s + c < h || h < e - c && h < n - c && h < a - c && h < s - c || t + c < u && i + c < u && o + c < u && r + c < u || u < t - c && u < i - c && u < o - c && u < r - c) && function(t, e, i, n, o, a, r, s, l, u, h) {
  5616. var c, d, f, p, g, m = .005, v = 1 / 0;
  5617. wa[0] = l,
  5618. wa[1] = u;
  5619. for (var y = 0; y < 1; y += .05)
  5620. ba[0] = Ta(t, i, o, r, y),
  5621. ba[1] = Ta(e, n, a, s, y),
  5622. (p = _t(wa, ba)) < v && (c = y,
  5623. v = p);
  5624. v = 1 / 0;
  5625. for (var x = 0; x < 32 && !(m < ya); x++)
  5626. d = c - m,
  5627. f = c + m,
  5628. ba[0] = Ta(t, i, o, r, d),
  5629. ba[1] = Ta(e, n, a, s, d),
  5630. p = _t(ba, wa),
  5631. 0 <= d && p < v ? (c = d,
  5632. v = p) : (Sa[0] = Ta(t, i, o, r, f),
  5633. Sa[1] = Ta(e, n, a, s, f),
  5634. g = _t(Sa, wa),
  5635. f <= 1 && g < v ? (c = f,
  5636. v = g) : m *= .5);
  5637. return h && (h[0] = Ta(t, i, o, r, c),
  5638. h[1] = Ta(e, n, a, s, c)),
  5639. ma(v)
  5640. }(t, e, i, n, o, a, r, s, u, h, null) <= c / 2
  5641. }
  5642. function ur(t, e, i, n, o, a, r, s, l) {
  5643. if (0 === r)
  5644. return !1;
  5645. var u = r;
  5646. return !(e + u < l && n + u < l && a + u < l || l < e - u && l < n - u && l < a - u || t + u < s && i + u < s && o + u < s || s < t - u && s < i - u && s < o - u) && function(t, e, i, n, o, a, r, s, l) {
  5647. var u, h = .005, c = 1 / 0;
  5648. wa[0] = r,
  5649. wa[1] = s;
  5650. for (var d = 0; d < 1; d += .05) {
  5651. ba[0] = La(t, i, o, d),
  5652. ba[1] = La(e, n, a, d),
  5653. (m = _t(wa, ba)) < c && (u = d,
  5654. c = m)
  5655. }
  5656. c = 1 / 0;
  5657. for (var f = 0; f < 32 && !(h < ya); f++) {
  5658. var p = u - h
  5659. , g = u + h;
  5660. ba[0] = La(t, i, o, p),
  5661. ba[1] = La(e, n, a, p);
  5662. var m = _t(ba, wa);
  5663. if (0 <= p && m < c)
  5664. u = p,
  5665. c = m;
  5666. else {
  5667. Sa[0] = La(t, i, o, g),
  5668. Sa[1] = La(e, n, a, g);
  5669. var v = _t(Sa, wa);
  5670. g <= 1 && v < c ? (u = g,
  5671. c = v) : h *= .5
  5672. }
  5673. }
  5674. return l && (l[0] = La(t, i, o, u),
  5675. l[1] = La(e, n, a, u)),
  5676. ma(c)
  5677. }(t, e, i, n, o, a, s, l, null) <= u / 2
  5678. }
  5679. rr.prototype = {
  5680. constructor: rr,
  5681. _xi: 0,
  5682. _yi: 0,
  5683. _x0: 0,
  5684. _y0: 0,
  5685. _ux: 0,
  5686. _uy: 0,
  5687. _len: 0,
  5688. _lineDash: null,
  5689. _dashOffset: 0,
  5690. _dashIdx: 0,
  5691. _dashSum: 0,
  5692. setScale: function(t, e, i) {
  5693. i = i || 0,
  5694. this._ux = or(i / pi / t) || 0,
  5695. this._uy = or(i / pi / e) || 0
  5696. },
  5697. getContext: function() {
  5698. return this._ctx
  5699. },
  5700. beginPath: function(t) {
  5701. return (this._ctx = t) && t.beginPath(),
  5702. t && (this.dpr = t.dpr),
  5703. this._saveData && (this._len = 0),
  5704. this._lineDash && (this._lineDash = null,
  5705. this._dashOffset = 0),
  5706. this
  5707. },
  5708. moveTo: function(t, e) {
  5709. return this.addData(ja.M, t, e),
  5710. this._ctx && this._ctx.moveTo(t, e),
  5711. this._x0 = t,
  5712. this._y0 = e,
  5713. this._xi = t,
  5714. this._yi = e,
  5715. this
  5716. },
  5717. lineTo: function(t, e) {
  5718. var i = or(t - this._xi) > this._ux || or(e - this._yi) > this._uy || this._len < 5;
  5719. return this.addData(ja.L, t, e),
  5720. this._ctx && i && (this._needsDash() ? this._dashedLineTo(t, e) : this._ctx.lineTo(t, e)),
  5721. i && (this._xi = t,
  5722. this._yi = e),
  5723. this
  5724. },
  5725. bezierCurveTo: function(t, e, i, n, o, a) {
  5726. return this.addData(ja.C, t, e, i, n, o, a),
  5727. this._ctx && (this._needsDash() ? this._dashedBezierTo(t, e, i, n, o, a) : this._ctx.bezierCurveTo(t, e, i, n, o, a)),
  5728. this._xi = o,
  5729. this._yi = a,
  5730. this
  5731. },
  5732. quadraticCurveTo: function(t, e, i, n) {
  5733. return this.addData(ja.Q, t, e, i, n),
  5734. this._ctx && (this._needsDash() ? this._dashedQuadraticTo(t, e, i, n) : this._ctx.quadraticCurveTo(t, e, i, n)),
  5735. this._xi = i,
  5736. this._yi = n,
  5737. this
  5738. },
  5739. arc: function(t, e, i, n, o, a) {
  5740. return this.addData(ja.A, t, e, i, i, n, o - n, 0, a ? 0 : 1),
  5741. this._ctx && this._ctx.arc(t, e, i, n, o, a),
  5742. this._xi = er(o) * i + t,
  5743. this._yi = ir(o) * i + e,
  5744. this
  5745. },
  5746. arcTo: function(t, e, i, n, o) {
  5747. return this._ctx && this._ctx.arcTo(t, e, i, n, o),
  5748. this
  5749. },
  5750. rect: function(t, e, i, n) {
  5751. return this._ctx && this._ctx.rect(t, e, i, n),
  5752. this.addData(ja.R, t, e, i, n),
  5753. this
  5754. },
  5755. closePath: function() {
  5756. this.addData(ja.Z);
  5757. var t = this._ctx
  5758. , e = this._x0
  5759. , i = this._y0;
  5760. return t && (this._needsDash() && this._dashedLineTo(e, i),
  5761. t.closePath()),
  5762. this._xi = e,
  5763. this._yi = i,
  5764. this
  5765. },
  5766. fill: function(t) {
  5767. t && t.fill(),
  5768. this.toStatic()
  5769. },
  5770. stroke: function(t) {
  5771. t && t.stroke(),
  5772. this.toStatic()
  5773. },
  5774. setLineDash: function(t) {
  5775. if (t instanceof Array) {
  5776. this._lineDash = t;
  5777. for (var e = this._dashIdx = 0, i = 0; i < t.length; i++)
  5778. e += t[i];
  5779. this._dashSum = e
  5780. }
  5781. return this
  5782. },
  5783. setLineDashOffset: function(t) {
  5784. return this._dashOffset = t,
  5785. this
  5786. },
  5787. len: function() {
  5788. return this._len
  5789. },
  5790. setData: function(t) {
  5791. var e = t.length;
  5792. this.data && this.data.length === e || !ar || (this.data = new Float32Array(e));
  5793. for (var i = 0; i < e; i++)
  5794. this.data[i] = t[i];
  5795. this._len = e
  5796. },
  5797. appendPath: function(t) {
  5798. t instanceof Array || (t = [t]);
  5799. for (var e = t.length, i = 0, n = this._len, o = 0; o < e; o++)
  5800. i += t[o].len();
  5801. ar && this.data instanceof Float32Array && (this.data = new Float32Array(n + i));
  5802. for (o = 0; o < e; o++)
  5803. for (var a = t[o].data, r = 0; r < a.length; r++)
  5804. this.data[n++] = a[r];
  5805. this._len = n
  5806. },
  5807. addData: function(t) {
  5808. if (this._saveData) {
  5809. var e = this.data;
  5810. this._len + arguments.length > e.length && (this._expandData(),
  5811. e = this.data);
  5812. for (var i = 0; i < arguments.length; i++)
  5813. e[this._len++] = arguments[i];
  5814. this._prevCmd = t
  5815. }
  5816. },
  5817. _expandData: function() {
  5818. if (!(this.data instanceof Array)) {
  5819. for (var t = [], e = 0; e < this._len; e++)
  5820. t[e] = this.data[e];
  5821. this.data = t
  5822. }
  5823. },
  5824. _needsDash: function() {
  5825. return this._lineDash
  5826. },
  5827. _dashedLineTo: function(t, e) {
  5828. var i, n, o = this._dashSum, a = this._dashOffset, r = this._lineDash, s = this._ctx, l = this._xi, u = this._yi, h = t - l, c = e - u, d = nr(h * h + c * c), f = l, p = u, g = r.length;
  5829. for (a < 0 && (a = o + a),
  5830. f -= (a %= o) * (h /= d),
  5831. p -= a * (c /= d); 0 < h && f <= t || h < 0 && t <= f || 0 === h && (0 < c && p <= e || c < 0 && e <= p); )
  5832. f += h * (i = r[n = this._dashIdx]),
  5833. p += c * i,
  5834. this._dashIdx = (n + 1) % g,
  5835. 0 < h && f < l || h < 0 && l < f || 0 < c && p < u || c < 0 && u < p || s[n % 2 ? "moveTo" : "lineTo"](0 <= h ? Qa(f, t) : tr(f, t), 0 <= c ? Qa(p, e) : tr(p, e));
  5836. h = f - t,
  5837. c = p - e,
  5838. this._dashOffset = -nr(h * h + c * c)
  5839. },
  5840. _dashedBezierTo: function(t, e, i, n, o, a) {
  5841. var r, s, l, u, h, c = this._dashSum, d = this._dashOffset, f = this._lineDash, p = this._ctx, g = this._xi, m = this._yi, v = Ta, y = 0, x = this._dashIdx, _ = f.length, w = 0;
  5842. for (d < 0 && (d = c + d),
  5843. d %= c,
  5844. r = 0; r < 1; r += .1)
  5845. s = v(g, t, i, o, r + .1) - v(g, t, i, o, r),
  5846. l = v(m, e, n, a, r + .1) - v(m, e, n, a, r),
  5847. y += nr(s * s + l * l);
  5848. for (; x < _ && !(d < (w += f[x])); x++)
  5849. ;
  5850. for (r = (w - d) / y; r <= 1; )
  5851. u = v(g, t, i, o, r),
  5852. h = v(m, e, n, a, r),
  5853. x % 2 ? p.moveTo(u, h) : p.lineTo(u, h),
  5854. r += f[x] / y,
  5855. x = (x + 1) % _;
  5856. x % 2 != 0 && p.lineTo(o, a),
  5857. s = o - u,
  5858. l = a - h,
  5859. this._dashOffset = -nr(s * s + l * l)
  5860. },
  5861. _dashedQuadraticTo: function(t, e, i, n) {
  5862. var o = i
  5863. , a = n;
  5864. i = (i + 2 * t) / 3,
  5865. n = (n + 2 * e) / 3,
  5866. t = (this._xi + 2 * t) / 3,
  5867. e = (this._yi + 2 * e) / 3,
  5868. this._dashedBezierTo(t, e, i, n, o, a)
  5869. },
  5870. toStatic: function() {
  5871. var t = this.data;
  5872. t instanceof Array && (t.length = this._len,
  5873. ar && (this.data = new Float32Array(t)))
  5874. },
  5875. getBoundingRect: function() {
  5876. qa[0] = qa[1] = $a[0] = $a[1] = Number.MAX_VALUE,
  5877. Ka[0] = Ka[1] = Ja[0] = Ja[1] = -Number.MAX_VALUE;
  5878. for (var t, e, i, n, o, a, r, s, l, u, h, c, d, f, p = this.data, g = 0, m = 0, v = 0, y = 0, x = 0; x < p.length; ) {
  5879. var _ = p[x++];
  5880. switch (1 === x && (v = g = p[x],
  5881. y = m = p[x + 1]),
  5882. _) {
  5883. case ja.M:
  5884. g = v = p[x++],
  5885. m = y = p[x++],
  5886. $a[0] = v,
  5887. $a[1] = y,
  5888. Ja[0] = v,
  5889. Ja[1] = y;
  5890. break;
  5891. case ja.L:
  5892. Ha(g, m, p[x], p[x + 1], $a, Ja),
  5893. g = p[x++],
  5894. m = p[x++];
  5895. break;
  5896. case ja.C:
  5897. Xa(g, m, p[x++], p[x++], p[x++], p[x++], p[x], p[x + 1], $a, Ja),
  5898. g = p[x++],
  5899. m = p[x++];
  5900. break;
  5901. case ja.Q:
  5902. t = g,
  5903. e = m,
  5904. i = p[x++],
  5905. n = p[x++],
  5906. o = p[x],
  5907. a = p[x + 1],
  5908. r = $a,
  5909. s = Ja,
  5910. u = l = void 0,
  5911. u = La,
  5912. h = Ea(Oa((l = Pa)(t, i, o), 1), 0),
  5913. c = Ea(Oa(l(e, n, a), 1), 0),
  5914. d = u(t, i, o, h),
  5915. f = u(e, n, a, c),
  5916. r[0] = Oa(t, o, d),
  5917. r[1] = Oa(e, a, f),
  5918. s[0] = Ea(t, o, d),
  5919. s[1] = Ea(e, a, f),
  5920. g = p[x++],
  5921. m = p[x++];
  5922. break;
  5923. case ja.A:
  5924. var w = p[x++]
  5925. , b = p[x++]
  5926. , S = p[x++]
  5927. , M = p[x++]
  5928. , I = p[x++]
  5929. , T = p[x++] + I;
  5930. x += 1;
  5931. var A = 1 - p[x++];
  5932. 1 === x && (v = er(I) * S + w,
  5933. y = ir(I) * M + b),
  5934. Ya(w, b, S, M, I, T, A, $a, Ja),
  5935. g = er(T) * S + w,
  5936. m = ir(T) * M + b;
  5937. break;
  5938. case ja.R:
  5939. Ha(v = g = p[x++], y = m = p[x++], v + p[x++], y + p[x++], $a, Ja);
  5940. break;
  5941. case ja.Z:
  5942. g = v,
  5943. m = y
  5944. }
  5945. St(qa, qa, $a),
  5946. Mt(Ka, Ka, Ja)
  5947. }
  5948. return 0 === x && (qa[0] = qa[1] = Ka[0] = Ka[1] = 0),
  5949. new Di(qa[0],qa[1],Ka[0] - qa[0],Ka[1] - qa[1])
  5950. },
  5951. rebuildPath: function(t) {
  5952. for (var e, i, n, o, a, r, s = this.data, l = this._ux, u = this._uy, h = this._len, c = 0; c < h; ) {
  5953. var d = s[c++];
  5954. switch (1 === c && (e = n = s[c],
  5955. i = o = s[c + 1]),
  5956. d) {
  5957. case ja.M:
  5958. e = n = s[c++],
  5959. i = o = s[c++],
  5960. t.moveTo(n, o);
  5961. break;
  5962. case ja.L:
  5963. a = s[c++],
  5964. r = s[c++],
  5965. (or(a - n) > l || or(r - o) > u || c === h - 1) && (t.lineTo(a, r),
  5966. n = a,
  5967. o = r);
  5968. break;
  5969. case ja.C:
  5970. t.bezierCurveTo(s[c++], s[c++], s[c++], s[c++], s[c++], s[c++]),
  5971. n = s[c - 2],
  5972. o = s[c - 1];
  5973. break;
  5974. case ja.Q:
  5975. t.quadraticCurveTo(s[c++], s[c++], s[c++], s[c++]),
  5976. n = s[c - 2],
  5977. o = s[c - 1];
  5978. break;
  5979. case ja.A:
  5980. var f = s[c++]
  5981. , p = s[c++]
  5982. , g = s[c++]
  5983. , m = s[c++]
  5984. , v = s[c++]
  5985. , y = s[c++]
  5986. , x = s[c++]
  5987. , _ = s[c++]
  5988. , w = m < g ? g : m
  5989. , b = m < g ? 1 : g / m
  5990. , S = m < g ? m / g : 1
  5991. , M = v + y;
  5992. .001 < Math.abs(g - m) ? (t.translate(f, p),
  5993. t.rotate(x),
  5994. t.scale(b, S),
  5995. t.arc(0, 0, w, v, M, 1 - _),
  5996. t.scale(1 / b, 1 / S),
  5997. t.rotate(-x),
  5998. t.translate(-f, -p)) : t.arc(f, p, w, v, M, 1 - _),
  5999. 1 === c && (e = er(v) * g + f,
  6000. i = ir(v) * m + p),
  6001. n = er(M) * g + f,
  6002. o = ir(M) * m + p;
  6003. break;
  6004. case ja.R:
  6005. e = n = s[c],
  6006. i = o = s[c + 1],
  6007. t.rect(s[c++], s[c++], s[c++], s[c++]);
  6008. break;
  6009. case ja.Z:
  6010. t.closePath(),
  6011. n = e,
  6012. o = i
  6013. }
  6014. }
  6015. }
  6016. },
  6017. rr.CMD = ja;
  6018. var hr = 2 * Math.PI;
  6019. function cr(t) {
  6020. return (t %= hr) < 0 && (t += hr),
  6021. t
  6022. }
  6023. var dr = 2 * Math.PI;
  6024. function fr(t, e, i, n, o, a, r, s, l) {
  6025. if (0 === r)
  6026. return !1;
  6027. var u = r;
  6028. s -= t,
  6029. l -= e;
  6030. var h = Math.sqrt(s * s + l * l);
  6031. if (i < h - u || h + u < i)
  6032. return !1;
  6033. if (Math.abs(n - o) % dr < 1e-4)
  6034. return !0;
  6035. if (a) {
  6036. var c = n;
  6037. n = cr(o),
  6038. o = cr(c)
  6039. } else
  6040. n = cr(n),
  6041. o = cr(o);
  6042. o < n && (o += dr);
  6043. var d = Math.atan2(l, s);
  6044. return d < 0 && (d += dr),
  6045. n <= d && d <= o || n <= d + dr && d + dr <= o
  6046. }
  6047. function pr(t, e, i, n, o, a) {
  6048. if (e < a && n < a || a < e && a < n)
  6049. return 0;
  6050. if (n === e)
  6051. return 0;
  6052. var r = n < e ? 1 : -1
  6053. , s = (a - e) / (n - e);
  6054. 1 != s && 0 != s || (r = n < e ? .5 : -.5);
  6055. var l = s * (i - t) + t;
  6056. return l === o ? 1 / 0 : o < l ? r : 0
  6057. }
  6058. var gr = rr.CMD
  6059. , mr = 2 * Math.PI
  6060. , vr = 1e-4;
  6061. var yr = [-1, -1, -1]
  6062. , xr = [-1, -1];
  6063. function _r(t, e, i, n, o, a, r, s, l, u) {
  6064. if (e < u && n < u && a < u && s < u || u < e && u < n && u < a && u < s)
  6065. return 0;
  6066. var h, c = function(t, e, i, n, o, a) {
  6067. var r = n + 3 * (e - i) - t
  6068. , s = 3 * (i - 2 * e + t)
  6069. , l = 3 * (e - t)
  6070. , u = t - o
  6071. , h = s * s - 3 * r * l
  6072. , c = s * l - 9 * r * u
  6073. , d = l * l - 3 * s * u
  6074. , f = 0;
  6075. if (Ma(h) && Ma(c)) {
  6076. if (Ma(s))
  6077. a[0] = 0;
  6078. else
  6079. 0 <= (M = -l / s) && M <= 1 && (a[f++] = M)
  6080. } else {
  6081. var p = c * c - 4 * h * d;
  6082. if (Ma(p)) {
  6083. var g = c / h
  6084. , m = -g / 2;
  6085. 0 <= (M = -s / r + g) && M <= 1 && (a[f++] = M),
  6086. 0 <= m && m <= 1 && (a[f++] = m)
  6087. } else if (0 < p) {
  6088. var v = ma(p)
  6089. , y = h * s + 1.5 * r * (-c + v)
  6090. , x = h * s + 1.5 * r * (-c - v);
  6091. 0 <= (M = (-s - ((y = y < 0 ? -ga(-y, _a) : ga(y, _a)) + (x = x < 0 ? -ga(-x, _a) : ga(x, _a)))) / (3 * r)) && M <= 1 && (a[f++] = M)
  6092. } else {
  6093. var _ = (2 * h * s - 3 * r * c) / (2 * ma(h * h * h))
  6094. , w = Math.acos(_) / 3
  6095. , b = ma(h)
  6096. , S = Math.cos(w)
  6097. , M = (-s - 2 * b * S) / (3 * r)
  6098. , I = (m = (-s + b * (S + xa * Math.sin(w))) / (3 * r),
  6099. (-s + b * (S - xa * Math.sin(w))) / (3 * r));
  6100. 0 <= M && M <= 1 && (a[f++] = M),
  6101. 0 <= m && m <= 1 && (a[f++] = m),
  6102. 0 <= I && I <= 1 && (a[f++] = I)
  6103. }
  6104. }
  6105. return f
  6106. }(e, n, a, s, u, yr);
  6107. if (0 === c)
  6108. return 0;
  6109. for (var d, f, p = 0, g = -1, m = 0; m < c; m++) {
  6110. var v = yr[m]
  6111. , y = 0 === v || 1 === v ? .5 : 1;
  6112. Ta(t, i, o, r, v) < l || (g < 0 && (g = Da(e, n, a, s, xr),
  6113. xr[1] < xr[0] && 1 < g && (void 0,
  6114. h = xr[0],
  6115. xr[0] = xr[1],
  6116. xr[1] = h),
  6117. d = Ta(e, n, a, s, xr[0]),
  6118. 1 < g && (f = Ta(e, n, a, s, xr[1]))),
  6119. 2 === g ? v < xr[0] ? p += d < e ? y : -y : v < xr[1] ? p += f < d ? y : -y : p += s < f ? y : -y : v < xr[0] ? p += d < e ? y : -y : p += s < d ? y : -y)
  6120. }
  6121. return p
  6122. }
  6123. function wr(t, e, i, n, o, a, r, s) {
  6124. if (e < s && n < s && a < s || s < e && s < n && s < a)
  6125. return 0;
  6126. var l = function(t, e, i, n, o) {
  6127. var a = t - 2 * e + i
  6128. , r = 2 * (e - t)
  6129. , s = t - n
  6130. , l = 0;
  6131. if (Ma(a)) {
  6132. if (Ia(r))
  6133. 0 <= (h = -s / r) && h <= 1 && (o[l++] = h)
  6134. } else {
  6135. var u = r * r - 4 * a * s;
  6136. if (Ma(u))
  6137. 0 <= (h = -r / (2 * a)) && h <= 1 && (o[l++] = h);
  6138. else if (0 < u) {
  6139. var h, c = ma(u), d = (-r - c) / (2 * a);
  6140. 0 <= (h = (-r + c) / (2 * a)) && h <= 1 && (o[l++] = h),
  6141. 0 <= d && d <= 1 && (o[l++] = d)
  6142. }
  6143. }
  6144. return l
  6145. }(e, n, a, s, yr);
  6146. if (0 === l)
  6147. return 0;
  6148. var u = Pa(e, n, a);
  6149. if (0 <= u && u <= 1) {
  6150. for (var h = 0, c = La(e, n, a, u), d = 0; d < l; d++) {
  6151. var f = 0 === yr[d] || 1 === yr[d] ? .5 : 1;
  6152. La(t, i, o, yr[d]) < r || (yr[d] < u ? h += c < e ? f : -f : h += a < c ? f : -f)
  6153. }
  6154. return h
  6155. }
  6156. f = 0 === yr[0] || 1 === yr[0] ? .5 : 1;
  6157. return La(t, i, o, yr[0]) < r ? 0 : a < e ? f : -f
  6158. }
  6159. function br(t, e, i, n, o, a, r, s) {
  6160. if (i < (s -= e) || s < -i)
  6161. return 0;
  6162. var l = Math.sqrt(i * i - s * s);
  6163. yr[0] = -l,
  6164. yr[1] = l;
  6165. var u = Math.abs(n - o);
  6166. if (u < 1e-4)
  6167. return 0;
  6168. if (u % mr < 1e-4) {
  6169. o = mr;
  6170. var h = a ? 1 : -1;
  6171. return r >= yr[n = 0] + t && r <= yr[1] + t ? h : 0
  6172. }
  6173. if (a) {
  6174. l = n;
  6175. n = cr(o),
  6176. o = cr(l)
  6177. } else
  6178. n = cr(n),
  6179. o = cr(o);
  6180. o < n && (o += mr);
  6181. for (var c = 0, d = 0; d < 2; d++) {
  6182. var f = yr[d];
  6183. if (r < f + t) {
  6184. var p = Math.atan2(s, f);
  6185. h = a ? 1 : -1;
  6186. p < 0 && (p = mr + p),
  6187. (n <= p && p <= o || n <= p + mr && p + mr <= o) && (p > Math.PI / 2 && p < 1.5 * Math.PI && (h = -h),
  6188. c += h)
  6189. }
  6190. }
  6191. return c
  6192. }
  6193. function Sr(t, e, i, n, o) {
  6194. for (var a = 0, r = 0, s = 0, l = 0, u = 0, h = 0; h < t.length; ) {
  6195. var c = t[h++];
  6196. switch (c === gr.M && 1 < h && (i || (a += pr(r, s, l, u, n, o))),
  6197. 1 === h && (l = r = t[h],
  6198. u = s = t[h + 1]),
  6199. c) {
  6200. case gr.M:
  6201. r = l = t[h++],
  6202. s = u = t[h++];
  6203. break;
  6204. case gr.L:
  6205. if (i) {
  6206. if (sr(r, s, t[h], t[h + 1], e, n, o))
  6207. return !0
  6208. } else
  6209. a += pr(r, s, t[h], t[h + 1], n, o) || 0;
  6210. r = t[h++],
  6211. s = t[h++];
  6212. break;
  6213. case gr.C:
  6214. if (i) {
  6215. if (lr(r, s, t[h++], t[h++], t[h++], t[h++], t[h], t[h + 1], e, n, o))
  6216. return !0
  6217. } else
  6218. a += _r(r, s, t[h++], t[h++], t[h++], t[h++], t[h], t[h + 1], n, o) || 0;
  6219. r = t[h++],
  6220. s = t[h++];
  6221. break;
  6222. case gr.Q:
  6223. if (i) {
  6224. if (ur(r, s, t[h++], t[h++], t[h], t[h + 1], e, n, o))
  6225. return !0
  6226. } else
  6227. a += wr(r, s, t[h++], t[h++], t[h], t[h + 1], n, o) || 0;
  6228. r = t[h++],
  6229. s = t[h++];
  6230. break;
  6231. case gr.A:
  6232. var d = t[h++]
  6233. , f = t[h++]
  6234. , p = t[h++]
  6235. , g = t[h++]
  6236. , m = t[h++]
  6237. , v = t[h++];
  6238. h += 1;
  6239. var y = 1 - t[h++]
  6240. , x = Math.cos(m) * p + d
  6241. , _ = Math.sin(m) * g + f;
  6242. 1 < h ? a += pr(r, s, x, _, n, o) : (l = x,
  6243. u = _);
  6244. var w = (n - d) * g / p + d;
  6245. if (i) {
  6246. if (fr(d, f, g, m, m + v, y, e, w, o))
  6247. return !0
  6248. } else
  6249. a += br(d, f, g, m, m + v, y, w, o);
  6250. r = Math.cos(m + v) * p + d,
  6251. s = Math.sin(m + v) * g + f;
  6252. break;
  6253. case gr.R:
  6254. l = r = t[h++],
  6255. u = s = t[h++];
  6256. x = l + t[h++],
  6257. _ = u + t[h++];
  6258. if (i) {
  6259. if (sr(l, u, x, u, e, n, o) || sr(x, u, x, _, e, n, o) || sr(x, _, l, _, e, n, o) || sr(l, _, l, u, e, n, o))
  6260. return !0
  6261. } else
  6262. a += pr(x, u, x, _, n, o),
  6263. a += pr(l, _, l, u, n, o);
  6264. break;
  6265. case gr.Z:
  6266. if (i) {
  6267. if (sr(r, s, l, u, e, n, o))
  6268. return !0
  6269. } else
  6270. a += pr(r, s, l, u, n, o);
  6271. r = l,
  6272. s = u
  6273. }
  6274. }
  6275. return i || function(t, e) {
  6276. return Math.abs(t - e) < vr
  6277. }(s, u) || (a += pr(r, s, l, u, n, o) || 0),
  6278. 0 !== a
  6279. }
  6280. var Mr = $i.prototype.getCanvasPattern
  6281. , Ir = Math.abs
  6282. , Tr = new rr(!0);
  6283. function Ar(t) {
  6284. Jn.call(this, t),
  6285. this.path = null
  6286. }
  6287. Ar.prototype = {
  6288. constructor: Ar,
  6289. type: "path",
  6290. __dirtyPath: !0,
  6291. strokeContainThreshold: 5,
  6292. segmentIgnoreThreshold: 0,
  6293. subPixelOptimize: !1,
  6294. brush: function(t, e) {
  6295. var i, n = this.style, o = this.path || Tr, a = n.hasStroke(), r = n.hasFill(), s = n.fill, l = n.stroke, u = r && !!s.colorStops, h = a && !!l.colorStops, c = r && !!s.image, d = a && !!l.image;
  6296. n.bind(t, this, e),
  6297. this.setTransform(t),
  6298. this.__dirty && (u && (i = i || this.getBoundingRect(),
  6299. this._fillGradient = n.getGradient(t, s, i)),
  6300. h && (i = i || this.getBoundingRect(),
  6301. this._strokeGradient = n.getGradient(t, l, i)));
  6302. u ? t.fillStyle = this._fillGradient : c && (t.fillStyle = Mr.call(s, t)),
  6303. h ? t.strokeStyle = this._strokeGradient : d && (t.strokeStyle = Mr.call(l, t));
  6304. var f = n.lineDash
  6305. , p = n.lineDashOffset
  6306. , g = !!t.setLineDash
  6307. , m = this.getGlobalScale();
  6308. if (o.setScale(m[0], m[1], this.segmentIgnoreThreshold),
  6309. this.__dirtyPath || f && !g && a ? (o.beginPath(t),
  6310. f && !g && (o.setLineDash(f),
  6311. o.setLineDashOffset(p)),
  6312. this.buildPath(o, this.shape, !1),
  6313. this.path && (this.__dirtyPath = !1)) : (t.beginPath(),
  6314. this.path.rebuildPath(t)),
  6315. r)
  6316. if (null != n.fillOpacity) {
  6317. var v = t.globalAlpha;
  6318. t.globalAlpha = n.fillOpacity * n.opacity,
  6319. o.fill(t),
  6320. t.globalAlpha = v
  6321. } else
  6322. o.fill(t);
  6323. if (f && g && (t.setLineDash(f),
  6324. t.lineDashOffset = p),
  6325. a)
  6326. if (null != n.strokeOpacity) {
  6327. v = t.globalAlpha;
  6328. t.globalAlpha = n.strokeOpacity * n.opacity,
  6329. o.stroke(t),
  6330. t.globalAlpha = v
  6331. } else
  6332. o.stroke(t);
  6333. f && g && t.setLineDash([]),
  6334. null != n.text && (this.restoreTransform(t),
  6335. this.drawRectText(t, this.getBoundingRect()))
  6336. },
  6337. buildPath: function(t, e, i) {},
  6338. createPathProxy: function() {
  6339. this.path = new rr
  6340. },
  6341. getBoundingRect: function() {
  6342. var t = this._rect
  6343. , e = this.style
  6344. , i = !t;
  6345. if (i) {
  6346. var n = this.path;
  6347. n = n || (this.path = new rr),
  6348. this.__dirtyPath && (n.beginPath(),
  6349. this.buildPath(n, this.shape, !1)),
  6350. t = n.getBoundingRect()
  6351. }
  6352. if (this._rect = t,
  6353. e.hasStroke()) {
  6354. var o = this._rectWithStroke || (this._rectWithStroke = t.clone());
  6355. if (this.__dirty || i) {
  6356. o.copy(t);
  6357. var a = e.lineWidth
  6358. , r = e.strokeNoScale ? this.getLineScale() : 1;
  6359. e.hasFill() || (a = Math.max(a, this.strokeContainThreshold || 4)),
  6360. 1e-10 < r && (o.width += a / r,
  6361. o.height += a / r,
  6362. o.x -= a / r / 2,
  6363. o.y -= a / r / 2)
  6364. }
  6365. return o
  6366. }
  6367. return t
  6368. },
  6369. contain: function(t, e) {
  6370. var i = this.transformCoordToLocal(t, e)
  6371. , n = this.getBoundingRect()
  6372. , o = this.style;
  6373. if (t = i[0],
  6374. e = i[1],
  6375. n.contain(t, e)) {
  6376. var a = this.path.data;
  6377. if (o.hasStroke()) {
  6378. var r = o.lineWidth
  6379. , s = o.strokeNoScale ? this.getLineScale() : 1;
  6380. if (1e-10 < s && (o.hasFill() || (r = Math.max(r, this.strokeContainThreshold)),
  6381. function(t, e, i, n) {
  6382. return Sr(t, e, !0, i, n)
  6383. }(a, r / s, t, e)))
  6384. return !0
  6385. }
  6386. if (o.hasFill())
  6387. return function(t, e, i) {
  6388. return Sr(t, 0, !1, e, i)
  6389. }(a, t, e)
  6390. }
  6391. return !1
  6392. },
  6393. dirty: function(t) {
  6394. null == t && (t = !0),
  6395. t && (this.__dirtyPath = t,
  6396. this._rect = null),
  6397. this.__dirty = this.__dirtyText = !0,
  6398. this.__zr && this.__zr.refresh(),
  6399. this.__clipTarget && this.__clipTarget.dirty()
  6400. },
  6401. animateShape: function(t) {
  6402. return this.animate("shape", t)
  6403. },
  6404. attrKV: function(t, e) {
  6405. "shape" === t ? (this.setShape(e),
  6406. this.__dirtyPath = !0,
  6407. this._rect = null) : Jn.prototype.attrKV.call(this, t, e)
  6408. },
  6409. setShape: function(t, e) {
  6410. var i = this.shape;
  6411. if (i) {
  6412. if (z(t))
  6413. for (var n in t)
  6414. t.hasOwnProperty(n) && (i[n] = t[n]);
  6415. else
  6416. i[t] = e;
  6417. this.dirty(!0)
  6418. }
  6419. return this
  6420. },
  6421. getLineScale: function() {
  6422. var t = this.transform;
  6423. return t && 1e-10 < Ir(t[0] - 1) && 1e-10 < Ir(t[3] - 1) ? Math.sqrt(Ir(t[0] * t[3] - t[2] * t[1])) : 1
  6424. }
  6425. },
  6426. Ar.extend = function(o) {
  6427. function t(t) {
  6428. Ar.call(this, t),
  6429. o.style && this.style.extendFrom(o.style, !1);
  6430. var e = o.shape;
  6431. if (e) {
  6432. this.shape = this.shape || {};
  6433. var i = this.shape;
  6434. for (var n in e)
  6435. !i.hasOwnProperty(n) && e.hasOwnProperty(n) && (i[n] = e[n])
  6436. }
  6437. o.init && o.init.call(this, t)
  6438. }
  6439. for (var e in w(t, Ar),
  6440. o)
  6441. "style" !== e && "shape" !== e && (t.prototype[e] = o[e]);
  6442. return t
  6443. }
  6444. ,
  6445. w(Ar, Jn);
  6446. function Dr(t) {
  6447. return Math.sqrt(t[0] * t[0] + t[1] * t[1])
  6448. }
  6449. var Cr = rr.CMD
  6450. , Lr = [[], [], []]
  6451. , kr = Math.sqrt
  6452. , Pr = Math.atan2
  6453. , Nr = function(t, e) {
  6454. var i, n, o, a, r, s = t.data, l = Cr.M, u = Cr.C, h = Cr.L, c = Cr.R, d = Cr.A, f = Cr.Q;
  6455. for (a = o = 0; o < s.length; ) {
  6456. switch (i = s[o++],
  6457. a = o,
  6458. n = 0,
  6459. i) {
  6460. case l:
  6461. case h:
  6462. n = 1;
  6463. break;
  6464. case u:
  6465. n = 3;
  6466. break;
  6467. case f:
  6468. n = 2;
  6469. break;
  6470. case d:
  6471. var p = e[4]
  6472. , g = e[5]
  6473. , m = kr(e[0] * e[0] + e[1] * e[1])
  6474. , v = kr(e[2] * e[2] + e[3] * e[3])
  6475. , y = Pr(-e[1] / v, e[0] / m);
  6476. s[o] *= m,
  6477. s[o++] += p,
  6478. s[o] *= v,
  6479. s[o++] += g,
  6480. s[o++] *= m,
  6481. s[o++] *= v,
  6482. s[o++] += y,
  6483. s[o++] += y,
  6484. a = o += 2;
  6485. break;
  6486. case c:
  6487. x[0] = s[o++],
  6488. x[1] = s[o++],
  6489. bt(x, x, e),
  6490. s[a++] = x[0],
  6491. s[a++] = x[1],
  6492. x[0] += s[o++],
  6493. x[1] += s[o++],
  6494. bt(x, x, e),
  6495. s[a++] = x[0],
  6496. s[a++] = x[1]
  6497. }
  6498. for (r = 0; r < n; r++) {
  6499. var x;
  6500. (x = Lr[r])[0] = s[o++],
  6501. x[1] = s[o++],
  6502. bt(x, x, e),
  6503. s[a++] = x[0],
  6504. s[a++] = x[1]
  6505. }
  6506. }
  6507. }
  6508. , Or = Math.sqrt
  6509. , Er = Math.sin
  6510. , Rr = Math.cos
  6511. , zr = Math.PI
  6512. , Br = function(t, e) {
  6513. return (t[0] * e[0] + t[1] * e[1]) / (Dr(t) * Dr(e))
  6514. }
  6515. , Vr = function(t, e) {
  6516. return (t[0] * e[1] < t[1] * e[0] ? -1 : 1) * Math.acos(Br(t, e))
  6517. };
  6518. function Gr(t, e, i, n, o, a, r, s, l, u, h) {
  6519. var c = l * (zr / 180)
  6520. , d = Rr(c) * (t - i) / 2 + Er(c) * (e - n) / 2
  6521. , f = -1 * Er(c) * (t - i) / 2 + Rr(c) * (e - n) / 2
  6522. , p = d * d / (r * r) + f * f / (s * s);
  6523. 1 < p && (r *= Or(p),
  6524. s *= Or(p));
  6525. var g = (o === a ? -1 : 1) * Or((r * r * (s * s) - r * r * (f * f) - s * s * (d * d)) / (r * r * (f * f) + s * s * (d * d))) || 0
  6526. , m = g * r * f / s
  6527. , v = g * -s * d / r
  6528. , y = (t + i) / 2 + Rr(c) * m - Er(c) * v
  6529. , x = (e + n) / 2 + Er(c) * m + Rr(c) * v
  6530. , _ = Vr([1, 0], [(d - m) / r, (f - v) / s])
  6531. , w = [(d - m) / r, (f - v) / s]
  6532. , b = [(-1 * d - m) / r, (-1 * f - v) / s]
  6533. , S = Vr(w, b);
  6534. Br(w, b) <= -1 && (S = zr),
  6535. 1 <= Br(w, b) && (S = 0),
  6536. 0 === a && 0 < S && (S -= 2 * zr),
  6537. 1 === a && S < 0 && (S += 2 * zr),
  6538. h.addData(u, y, x, r, s, _, S, c, a)
  6539. }
  6540. var Fr = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi
  6541. , Wr = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;
  6542. function Hr(t, e) {
  6543. var i = function(t) {
  6544. if (!t)
  6545. return new rr;
  6546. for (var e, i = 0, n = 0, o = i, a = n, r = new rr, s = rr.CMD, l = t.match(Fr), u = 0; u < l.length; u++) {
  6547. for (var h, c = l[u], d = c.charAt(0), f = c.match(Wr) || [], p = f.length, g = 0; g < p; g++)
  6548. f[g] = parseFloat(f[g]);
  6549. for (var m = 0; m < p; ) {
  6550. var v, y, x, _, w, b, S, M = i, I = n;
  6551. switch (d) {
  6552. case "l":
  6553. i += f[m++],
  6554. n += f[m++],
  6555. h = s.L,
  6556. r.addData(h, i, n);
  6557. break;
  6558. case "L":
  6559. i = f[m++],
  6560. n = f[m++],
  6561. h = s.L,
  6562. r.addData(h, i, n);
  6563. break;
  6564. case "m":
  6565. i += f[m++],
  6566. n += f[m++],
  6567. h = s.M,
  6568. r.addData(h, i, n),
  6569. o = i,
  6570. a = n,
  6571. d = "l";
  6572. break;
  6573. case "M":
  6574. i = f[m++],
  6575. n = f[m++],
  6576. h = s.M,
  6577. r.addData(h, i, n),
  6578. o = i,
  6579. a = n,
  6580. d = "L";
  6581. break;
  6582. case "h":
  6583. i += f[m++],
  6584. h = s.L,
  6585. r.addData(h, i, n);
  6586. break;
  6587. case "H":
  6588. i = f[m++],
  6589. h = s.L,
  6590. r.addData(h, i, n);
  6591. break;
  6592. case "v":
  6593. n += f[m++],
  6594. h = s.L,
  6595. r.addData(h, i, n);
  6596. break;
  6597. case "V":
  6598. n = f[m++],
  6599. h = s.L,
  6600. r.addData(h, i, n);
  6601. break;
  6602. case "C":
  6603. h = s.C,
  6604. r.addData(h, f[m++], f[m++], f[m++], f[m++], f[m++], f[m++]),
  6605. i = f[m - 2],
  6606. n = f[m - 1];
  6607. break;
  6608. case "c":
  6609. h = s.C,
  6610. r.addData(h, f[m++] + i, f[m++] + n, f[m++] + i, f[m++] + n, f[m++] + i, f[m++] + n),
  6611. i += f[m - 2],
  6612. n += f[m - 1];
  6613. break;
  6614. case "S":
  6615. v = i,
  6616. y = n;
  6617. var T = r.len()
  6618. , A = r.data;
  6619. e === s.C && (v += i - A[T - 4],
  6620. y += n - A[T - 3]),
  6621. h = s.C,
  6622. M = f[m++],
  6623. I = f[m++],
  6624. i = f[m++],
  6625. n = f[m++],
  6626. r.addData(h, v, y, M, I, i, n);
  6627. break;
  6628. case "s":
  6629. v = i,
  6630. y = n;
  6631. T = r.len(),
  6632. A = r.data;
  6633. e === s.C && (v += i - A[T - 4],
  6634. y += n - A[T - 3]),
  6635. h = s.C,
  6636. M = i + f[m++],
  6637. I = n + f[m++],
  6638. i += f[m++],
  6639. n += f[m++],
  6640. r.addData(h, v, y, M, I, i, n);
  6641. break;
  6642. case "Q":
  6643. M = f[m++],
  6644. I = f[m++],
  6645. i = f[m++],
  6646. n = f[m++],
  6647. h = s.Q,
  6648. r.addData(h, M, I, i, n);
  6649. break;
  6650. case "q":
  6651. M = f[m++] + i,
  6652. I = f[m++] + n,
  6653. i += f[m++],
  6654. n += f[m++],
  6655. h = s.Q,
  6656. r.addData(h, M, I, i, n);
  6657. break;
  6658. case "T":
  6659. v = i,
  6660. y = n;
  6661. T = r.len(),
  6662. A = r.data;
  6663. e === s.Q && (v += i - A[T - 4],
  6664. y += n - A[T - 3]),
  6665. i = f[m++],
  6666. n = f[m++],
  6667. h = s.Q,
  6668. r.addData(h, v, y, i, n);
  6669. break;
  6670. case "t":
  6671. v = i,
  6672. y = n;
  6673. T = r.len(),
  6674. A = r.data;
  6675. e === s.Q && (v += i - A[T - 4],
  6676. y += n - A[T - 3]),
  6677. i += f[m++],
  6678. n += f[m++],
  6679. h = s.Q,
  6680. r.addData(h, v, y, i, n);
  6681. break;
  6682. case "A":
  6683. x = f[m++],
  6684. _ = f[m++],
  6685. w = f[m++],
  6686. b = f[m++],
  6687. S = f[m++],
  6688. Gr(M = i, I = n, i = f[m++], n = f[m++], b, S, x, _, w, h = s.A, r);
  6689. break;
  6690. case "a":
  6691. x = f[m++],
  6692. _ = f[m++],
  6693. w = f[m++],
  6694. b = f[m++],
  6695. S = f[m++],
  6696. Gr(M = i, I = n, i += f[m++], n += f[m++], b, S, x, _, w, h = s.A, r)
  6697. }
  6698. }
  6699. "z" !== d && "Z" !== d || (h = s.Z,
  6700. r.addData(h),
  6701. i = o,
  6702. n = a),
  6703. e = h
  6704. }
  6705. return r.toStatic(),
  6706. r
  6707. }(t);
  6708. return (e = e || {}).buildPath = function(t) {
  6709. if (t.setData) {
  6710. t.setData(i.data),
  6711. (e = t.getContext()) && t.rebuildPath(e)
  6712. } else {
  6713. var e = t;
  6714. i.rebuildPath(e)
  6715. }
  6716. }
  6717. ,
  6718. e.applyTransform = function(t) {
  6719. Nr(i, t),
  6720. this.dirty(!0)
  6721. }
  6722. ,
  6723. e
  6724. }
  6725. function Zr(t, e) {
  6726. return new Ar(Hr(t, e))
  6727. }
  6728. var Ur = function(t) {
  6729. Jn.call(this, t)
  6730. };
  6731. Ur.prototype = {
  6732. constructor: Ur,
  6733. type: "text",
  6734. brush: function(t, e) {
  6735. var i = this.style;
  6736. this.__dirty && En(i),
  6737. i.fill = i.stroke = i.shadowBlur = i.shadowColor = i.shadowOffsetX = i.shadowOffsetY = null;
  6738. var n = i.text;
  6739. null != n && (n += ""),
  6740. qn(n, i) ? (this.setTransform(t),
  6741. zn(this, t, n, i, null, e),
  6742. this.restoreTransform(t)) : t.__attrCachedBy = Wi.NONE
  6743. },
  6744. getBoundingRect: function() {
  6745. var t = this.style;
  6746. if (this.__dirty && En(t),
  6747. !this._rect) {
  6748. var e = t.text;
  6749. null != e ? e += "" : e = "";
  6750. var i = gn(t.text + "", t.font, t.textAlign, t.textVerticalAlign, t.textPadding, t.textLineHeight, t.rich);
  6751. if (i.x += t.x || 0,
  6752. i.y += t.y || 0,
  6753. Un(t.textStroke, t.textStrokeWidth)) {
  6754. var n = t.textStrokeWidth;
  6755. i.x -= n / 2,
  6756. i.y -= n / 2,
  6757. i.width += n,
  6758. i.height += n
  6759. }
  6760. this._rect = i
  6761. }
  6762. return this._rect
  6763. }
  6764. },
  6765. w(Ur, Jn);
  6766. function Xr(l) {
  6767. return v.browser.ie && 11 <= v.browser.version ? function() {
  6768. var t, e = this.__clipPaths, i = this.style;
  6769. if (e)
  6770. for (var n = 0; n < e.length; n++) {
  6771. var o = e[n]
  6772. , a = o && o.shape
  6773. , r = o && o.type;
  6774. if (a && ("sector" === r && a.startAngle === a.endAngle || "rect" === r && (!a.width || !a.height))) {
  6775. for (var s = 0; s < jr.length; s++)
  6776. jr[s][2] = i[jr[s][0]],
  6777. i[jr[s][0]] = jr[s][1];
  6778. t = !0;
  6779. break
  6780. }
  6781. }
  6782. if (l.apply(this, arguments),
  6783. t)
  6784. for (s = 0; s < jr.length; s++)
  6785. i[jr[s][0]] = jr[s][2]
  6786. }
  6787. : l
  6788. }
  6789. var Yr = Ar.extend({
  6790. type: "circle",
  6791. shape: {
  6792. cx: 0,
  6793. cy: 0,
  6794. r: 0
  6795. },
  6796. buildPath: function(t, e, i) {
  6797. i && t.moveTo(e.cx + e.r, e.cy),
  6798. t.arc(e.cx, e.cy, e.r, 0, 2 * Math.PI, !0)
  6799. }
  6800. })
  6801. , jr = [["shadowBlur", 0], ["shadowColor", "#000"], ["shadowOffsetX", 0], ["shadowOffsetY", 0]]
  6802. , qr = Ar.extend({
  6803. type: "sector",
  6804. shape: {
  6805. cx: 0,
  6806. cy: 0,
  6807. r0: 0,
  6808. r: 0,
  6809. startAngle: 0,
  6810. endAngle: 2 * Math.PI,
  6811. clockwise: !0
  6812. },
  6813. brush: Xr(Ar.prototype.brush),
  6814. buildPath: function(t, e) {
  6815. var i = e.cx
  6816. , n = e.cy
  6817. , o = Math.max(e.r0 || 0, 0)
  6818. , a = Math.max(e.r, 0)
  6819. , r = e.startAngle
  6820. , s = e.endAngle
  6821. , l = e.clockwise
  6822. , u = Math.cos(r)
  6823. , h = Math.sin(r);
  6824. t.moveTo(u * o + i, h * o + n),
  6825. t.lineTo(u * a + i, h * a + n),
  6826. t.arc(i, n, a, r, s, !l),
  6827. t.lineTo(Math.cos(s) * o + i, Math.sin(s) * o + n),
  6828. 0 !== o && t.arc(i, n, o, s, r, l),
  6829. t.closePath()
  6830. }
  6831. })
  6832. , Kr = Ar.extend({
  6833. type: "ring",
  6834. shape: {
  6835. cx: 0,
  6836. cy: 0,
  6837. r: 0,
  6838. r0: 0
  6839. },
  6840. buildPath: function(t, e) {
  6841. var i = e.cx
  6842. , n = e.cy
  6843. , o = 2 * Math.PI;
  6844. t.moveTo(i + e.r, n),
  6845. t.arc(i, n, e.r, 0, o, !1),
  6846. t.moveTo(i + e.r0, n),
  6847. t.arc(i, n, e.r0, 0, o, !0)
  6848. }
  6849. });
  6850. function $r(t, e, i, n, o, a, r) {
  6851. var s = .5 * (i - t)
  6852. , l = .5 * (n - e);
  6853. return (2 * (e - i) + s + l) * r + (-3 * (e - i) - 2 * s - l) * a + s * o + e
  6854. }
  6855. function Jr(t, e, i) {
  6856. var n = e.points
  6857. , o = e.smooth;
  6858. if (n && 2 <= n.length) {
  6859. if (o && "spline" !== o) {
  6860. var a = function(t, e, i, n) {
  6861. var o, a, r, s, l = [], u = [], h = [], c = [];
  6862. if (n) {
  6863. r = [1 / 0, 1 / 0],
  6864. s = [-1 / 0, -1 / 0];
  6865. for (var d = 0, f = t.length; d < f; d++)
  6866. St(r, r, t[d]),
  6867. Mt(s, s, t[d]);
  6868. St(r, r, n[0]),
  6869. Mt(s, s, n[1])
  6870. }
  6871. for (d = 0,
  6872. f = t.length; d < f; d++) {
  6873. var p = t[d];
  6874. if (i)
  6875. o = t[d ? d - 1 : f - 1],
  6876. a = t[(d + 1) % f];
  6877. else {
  6878. if (0 === d || d === f - 1) {
  6879. l.push(rt(t[d]));
  6880. continue
  6881. }
  6882. o = t[d - 1],
  6883. a = t[d + 1]
  6884. }
  6885. ht(u, a, o),
  6886. gt(u, u, e);
  6887. var g = vt(p, o)
  6888. , m = vt(p, a)
  6889. , v = g + m;
  6890. 0 !== v && (g /= v,
  6891. m /= v),
  6892. gt(h, u, -g),
  6893. gt(c, u, m);
  6894. var y = lt([], p, h)
  6895. , x = lt([], p, c);
  6896. n && (Mt(y, y, r),
  6897. St(y, y, s),
  6898. Mt(x, x, r),
  6899. St(x, x, s)),
  6900. l.push(y),
  6901. l.push(x)
  6902. }
  6903. return i && l.push(l.shift()),
  6904. l
  6905. }(n, o, i, e.smoothConstraint);
  6906. t.moveTo(n[0][0], n[0][1]);
  6907. for (var r = n.length, s = 0; s < (i ? r : r - 1); s++) {
  6908. var l = a[2 * s]
  6909. , u = a[2 * s + 1]
  6910. , h = n[(s + 1) % r];
  6911. t.bezierCurveTo(l[0], l[1], u[0], u[1], h[0], h[1])
  6912. }
  6913. } else {
  6914. "spline" === o && (n = function(t, e) {
  6915. for (var i = t.length, n = [], o = 0, a = 1; a < i; a++)
  6916. o += vt(t[a - 1], t[a]);
  6917. var r = o / 2;
  6918. r = r < i ? i : r;
  6919. for (a = 0; a < r; a++) {
  6920. var s, l, u, h = a / (r - 1) * (e ? i : i - 1), c = Math.floor(h), d = h - c, f = t[c % i];
  6921. u = e ? (s = t[(c - 1 + i) % i],
  6922. l = t[(c + 1) % i],
  6923. t[(c + 2) % i]) : (s = t[0 === c ? c : c - 1],
  6924. l = t[i - 2 < c ? i - 1 : c + 1],
  6925. t[i - 3 < c ? i - 1 : c + 2]);
  6926. var p = d * d
  6927. , g = d * p;
  6928. n.push([$r(s[0], f[0], l[0], u[0], d, p, g), $r(s[1], f[1], l[1], u[1], d, p, g)])
  6929. }
  6930. return n
  6931. }(n, i)),
  6932. t.moveTo(n[0][0], n[0][1]);
  6933. s = 1;
  6934. for (var c = n.length; s < c; s++)
  6935. t.lineTo(n[s][0], n[s][1])
  6936. }
  6937. i && t.closePath()
  6938. }
  6939. }
  6940. var Qr = Ar.extend({
  6941. type: "polygon",
  6942. shape: {
  6943. points: null,
  6944. smooth: !1,
  6945. smoothConstraint: null
  6946. },
  6947. buildPath: function(t, e) {
  6948. Jr(t, e, !0)
  6949. }
  6950. })
  6951. , ts = Ar.extend({
  6952. type: "polyline",
  6953. shape: {
  6954. points: null,
  6955. smooth: !1,
  6956. smoothConstraint: null
  6957. },
  6958. style: {
  6959. stroke: "#000",
  6960. fill: null
  6961. },
  6962. buildPath: function(t, e) {
  6963. Jr(t, e, !1)
  6964. }
  6965. })
  6966. , es = Math.round;
  6967. function is(t, e, i) {
  6968. if (e) {
  6969. var n = e.x1
  6970. , o = e.x2
  6971. , a = e.y1
  6972. , r = e.y2;
  6973. t.x1 = n,
  6974. t.x2 = o,
  6975. t.y1 = a,
  6976. t.y2 = r;
  6977. var s = i && i.lineWidth;
  6978. s && (es(2 * n) === es(2 * o) && (t.x1 = t.x2 = os(n, s, !0)),
  6979. es(2 * a) === es(2 * r) && (t.y1 = t.y2 = os(a, s, !0)))
  6980. }
  6981. }
  6982. function ns(t, e, i) {
  6983. if (e) {
  6984. var n = e.x
  6985. , o = e.y
  6986. , a = e.width
  6987. , r = e.height;
  6988. t.x = n,
  6989. t.y = o,
  6990. t.width = a,
  6991. t.height = r;
  6992. var s = i && i.lineWidth;
  6993. s && (t.x = os(n, s, !0),
  6994. t.y = os(o, s, !0),
  6995. t.width = Math.max(os(n + a, s, !1) - t.x, 0 === a ? 0 : 1),
  6996. t.height = Math.max(os(o + r, s, !1) - t.y, 0 === r ? 0 : 1))
  6997. }
  6998. }
  6999. function os(t, e, i) {
  7000. if (!e)
  7001. return t;
  7002. var n = es(2 * t);
  7003. return (n + es(e)) % 2 == 0 ? n / 2 : (n + (i ? 1 : -1)) / 2
  7004. }
  7005. var as = {}
  7006. , rs = Ar.extend({
  7007. type: "rect",
  7008. shape: {
  7009. r: 0,
  7010. x: 0,
  7011. y: 0,
  7012. width: 0,
  7013. height: 0
  7014. },
  7015. buildPath: function(t, e) {
  7016. var i, n, o, a;
  7017. this.subPixelOptimize ? (ns(as, e, this.style),
  7018. i = as.x,
  7019. n = as.y,
  7020. o = as.width,
  7021. a = as.height,
  7022. as.r = e.r,
  7023. e = as) : (i = e.x,
  7024. n = e.y,
  7025. o = e.width,
  7026. a = e.height),
  7027. e.r ? Dn(t, e) : t.rect(i, n, o, a),
  7028. t.closePath()
  7029. }
  7030. })
  7031. , ss = {}
  7032. , ls = Ar.extend({
  7033. type: "line",
  7034. shape: {
  7035. x1: 0,
  7036. y1: 0,
  7037. x2: 0,
  7038. y2: 0,
  7039. percent: 1
  7040. },
  7041. style: {
  7042. stroke: "#000",
  7043. fill: null
  7044. },
  7045. buildPath: function(t, e) {
  7046. var i, n, o, a;
  7047. a = this.subPixelOptimize ? (is(ss, e, this.style),
  7048. i = ss.x1,
  7049. n = ss.y1,
  7050. o = ss.x2,
  7051. ss.y2) : (i = e.x1,
  7052. n = e.y1,
  7053. o = e.x2,
  7054. e.y2);
  7055. var r = e.percent;
  7056. 0 !== r && (t.moveTo(i, n),
  7057. r < 1 && (o = i * (1 - r) + o * r,
  7058. a = n * (1 - r) + a * r),
  7059. t.lineTo(o, a))
  7060. },
  7061. pointAt: function(t) {
  7062. var e = this.shape;
  7063. return [e.x1 * (1 - t) + e.x2 * t, e.y1 * (1 - t) + e.y2 * t]
  7064. }
  7065. })
  7066. , us = [];
  7067. function hs(t, e, i) {
  7068. var n = t.cpx2
  7069. , o = t.cpy2;
  7070. return null === n || null === o ? [(i ? Aa : Ta)(t.x1, t.cpx1, t.cpx2, t.x2, e), (i ? Aa : Ta)(t.y1, t.cpy1, t.cpy2, t.y2, e)] : [(i ? ka : La)(t.x1, t.cpx1, t.x2, e), (i ? ka : La)(t.y1, t.cpy1, t.y2, e)]
  7071. }
  7072. function cs(t) {
  7073. this.colorStops = t || []
  7074. }
  7075. var ds = Ar.extend({
  7076. type: "bezier-curve",
  7077. shape: {
  7078. x1: 0,
  7079. y1: 0,
  7080. x2: 0,
  7081. y2: 0,
  7082. cpx1: 0,
  7083. cpy1: 0,
  7084. percent: 1
  7085. },
  7086. style: {
  7087. stroke: "#000",
  7088. fill: null
  7089. },
  7090. buildPath: function(t, e) {
  7091. var i = e.x1
  7092. , n = e.y1
  7093. , o = e.x2
  7094. , a = e.y2
  7095. , r = e.cpx1
  7096. , s = e.cpy1
  7097. , l = e.cpx2
  7098. , u = e.cpy2
  7099. , h = e.percent;
  7100. 0 !== h && (t.moveTo(i, n),
  7101. null == l || null == u ? (h < 1 && (Na(i, r, o, h, us),
  7102. r = us[1],
  7103. o = us[2],
  7104. Na(n, s, a, h, us),
  7105. s = us[1],
  7106. a = us[2]),
  7107. t.quadraticCurveTo(r, s, o, a)) : (h < 1 && (Ca(i, r, l, o, h, us),
  7108. r = us[1],
  7109. l = us[2],
  7110. o = us[3],
  7111. Ca(n, s, u, a, h, us),
  7112. s = us[1],
  7113. u = us[2],
  7114. a = us[3]),
  7115. t.bezierCurveTo(r, s, l, u, o, a)))
  7116. },
  7117. pointAt: function(t) {
  7118. return hs(this.shape, t, !1)
  7119. },
  7120. tangentAt: function(t) {
  7121. var e = hs(this.shape, t, !0);
  7122. return mt(e, e)
  7123. }
  7124. })
  7125. , fs = Ar.extend({
  7126. type: "arc",
  7127. shape: {
  7128. cx: 0,
  7129. cy: 0,
  7130. r: 0,
  7131. startAngle: 0,
  7132. endAngle: 2 * Math.PI,
  7133. clockwise: !0
  7134. },
  7135. style: {
  7136. stroke: "#000",
  7137. fill: null
  7138. },
  7139. buildPath: function(t, e) {
  7140. var i = e.cx
  7141. , n = e.cy
  7142. , o = Math.max(e.r, 0)
  7143. , a = e.startAngle
  7144. , r = e.endAngle
  7145. , s = e.clockwise
  7146. , l = Math.cos(a)
  7147. , u = Math.sin(a);
  7148. t.moveTo(l * o + i, u * o + n),
  7149. t.arc(i, n, o, a, r, !s)
  7150. }
  7151. })
  7152. , ps = Ar.extend({
  7153. type: "compound",
  7154. shape: {
  7155. paths: null
  7156. },
  7157. _updatePathDirty: function() {
  7158. for (var t = this.__dirtyPath, e = this.shape.paths, i = 0; i < e.length; i++)
  7159. t = t || e[i].__dirtyPath;
  7160. this.__dirtyPath = t,
  7161. this.__dirty = this.__dirty || t
  7162. },
  7163. beforeBrush: function() {
  7164. this._updatePathDirty();
  7165. for (var t = this.shape.paths || [], e = this.getGlobalScale(), i = 0; i < t.length; i++)
  7166. t[i].path || t[i].createPathProxy(),
  7167. t[i].path.setScale(e[0], e[1], t[i].segmentIgnoreThreshold)
  7168. },
  7169. buildPath: function(t, e) {
  7170. for (var i = e.paths || [], n = 0; n < i.length; n++)
  7171. i[n].buildPath(t, i[n].shape, !0)
  7172. },
  7173. afterBrush: function() {
  7174. for (var t = this.shape.paths || [], e = 0; e < t.length; e++)
  7175. t[e].__dirtyPath = !1
  7176. },
  7177. getBoundingRect: function() {
  7178. return this._updatePathDirty(),
  7179. Ar.prototype.getBoundingRect.call(this)
  7180. }
  7181. });
  7182. cs.prototype = {
  7183. constructor: cs,
  7184. addColorStop: function(t, e) {
  7185. this.colorStops.push({
  7186. offset: t,
  7187. color: e
  7188. })
  7189. }
  7190. };
  7191. function gs(t, e, i, n, o, a) {
  7192. this.x = null == t ? 0 : t,
  7193. this.y = null == e ? 0 : e,
  7194. this.x2 = null == i ? 1 : i,
  7195. this.y2 = null == n ? 0 : n,
  7196. this.type = "linear",
  7197. this.global = a || !1,
  7198. cs.call(this, o)
  7199. }
  7200. gs.prototype = {
  7201. constructor: gs
  7202. },
  7203. w(gs, cs);
  7204. function ms(t, e, i, n, o) {
  7205. this.x = null == t ? .5 : t,
  7206. this.y = null == e ? .5 : e,
  7207. this.r = null == i ? .5 : i,
  7208. this.type = "radial",
  7209. this.global = o || !1,
  7210. cs.call(this, n)
  7211. }
  7212. function vs(t) {
  7213. Jn.call(this, t),
  7214. this._displayables = [],
  7215. this._temporaryDisplayables = [],
  7216. this._cursor = 0,
  7217. this.notClear = !0
  7218. }
  7219. ms.prototype = {
  7220. constructor: ms
  7221. },
  7222. w(ms, cs),
  7223. vs.prototype.incremental = !0,
  7224. vs.prototype.clearDisplaybles = function() {
  7225. this._displayables = [],
  7226. this._temporaryDisplayables = [],
  7227. this._cursor = 0,
  7228. this.dirty(),
  7229. this.notClear = !1
  7230. }
  7231. ,
  7232. vs.prototype.addDisplayable = function(t, e) {
  7233. e ? this._temporaryDisplayables.push(t) : this._displayables.push(t),
  7234. this.dirty()
  7235. }
  7236. ,
  7237. vs.prototype.addDisplayables = function(t, e) {
  7238. e = e || !1;
  7239. for (var i = 0; i < t.length; i++)
  7240. this.addDisplayable(t[i], e)
  7241. }
  7242. ,
  7243. vs.prototype.eachPendingDisplayable = function(t) {
  7244. for (var e = this._cursor; e < this._displayables.length; e++)
  7245. t && t(this._displayables[e]);
  7246. for (e = 0; e < this._temporaryDisplayables.length; e++)
  7247. t && t(this._temporaryDisplayables[e])
  7248. }
  7249. ,
  7250. vs.prototype.update = function() {
  7251. this.updateTransform();
  7252. for (var t = this._cursor; t < this._displayables.length; t++) {
  7253. (e = this._displayables[t]).parent = this,
  7254. e.update(),
  7255. e.parent = null
  7256. }
  7257. for (t = 0; t < this._temporaryDisplayables.length; t++) {
  7258. var e;
  7259. (e = this._temporaryDisplayables[t]).parent = this,
  7260. e.update(),
  7261. e.parent = null
  7262. }
  7263. }
  7264. ,
  7265. vs.prototype.brush = function(t, e) {
  7266. for (var i = this._cursor; i < this._displayables.length; i++) {
  7267. (n = this._displayables[i]).beforeBrush && n.beforeBrush(t),
  7268. n.brush(t, i === this._cursor ? null : this._displayables[i - 1]),
  7269. n.afterBrush && n.afterBrush(t)
  7270. }
  7271. this._cursor = i;
  7272. for (i = 0; i < this._temporaryDisplayables.length; i++) {
  7273. var n;
  7274. (n = this._temporaryDisplayables[i]).beforeBrush && n.beforeBrush(t),
  7275. n.brush(t, 0 === i ? null : this._temporaryDisplayables[i - 1]),
  7276. n.afterBrush && n.afterBrush(t)
  7277. }
  7278. this._temporaryDisplayables = [],
  7279. this.notClear = !0
  7280. }
  7281. ;
  7282. var ys = [];
  7283. vs.prototype.getBoundingRect = function() {
  7284. if (!this._rect) {
  7285. for (var t = new Di(1 / 0,1 / 0,-1 / 0,-1 / 0), e = 0; e < this._displayables.length; e++) {
  7286. var i = this._displayables[e]
  7287. , n = i.getBoundingRect().clone();
  7288. i.needLocalTransform() && n.applyTransform(i.getLocalTransform(ys)),
  7289. t.union(n)
  7290. }
  7291. this._rect = t
  7292. }
  7293. return this._rect
  7294. }
  7295. ,
  7296. vs.prototype.contain = function(t, e) {
  7297. var i = this.transformCoordToLocal(t, e);
  7298. if (this.getBoundingRect().contain(i[0], i[1]))
  7299. for (var n = 0; n < this._displayables.length; n++) {
  7300. if (this._displayables[n].contain(t, e))
  7301. return !0
  7302. }
  7303. return !1
  7304. }
  7305. ,
  7306. w(vs, Jn);
  7307. var xs = Math.max
  7308. , _s = Math.min
  7309. , ws = {}
  7310. , bs = 1
  7311. , Ss = {
  7312. color: "textFill",
  7313. textBorderColor: "textStroke",
  7314. textBorderWidth: "textStrokeWidth"
  7315. }
  7316. , Ms = "emphasis"
  7317. , Is = "normal"
  7318. , Ts = 1
  7319. , As = {}
  7320. , Ds = {};
  7321. function Cs(t) {
  7322. return Ar.extend(t)
  7323. }
  7324. function Ls(t, e) {
  7325. Ds[t] = e
  7326. }
  7327. function ks(t) {
  7328. if (Ds.hasOwnProperty(t))
  7329. return Ds[t]
  7330. }
  7331. function Ps(t, e, i, n) {
  7332. var o = Zr(t, e);
  7333. return i && ("center" === n && (i = Os(i, o.getBoundingRect())),
  7334. Rs(o, i)),
  7335. o
  7336. }
  7337. function Ns(t, i, n) {
  7338. var o = new Qn({
  7339. style: {
  7340. image: t,
  7341. x: i.x,
  7342. y: i.y,
  7343. width: i.width,
  7344. height: i.height
  7345. },
  7346. onload: function(t) {
  7347. if ("center" === n) {
  7348. var e = {
  7349. width: t.width,
  7350. height: t.height
  7351. };
  7352. o.setStyle(Os(i, e))
  7353. }
  7354. }
  7355. });
  7356. return o
  7357. }
  7358. function Os(t, e) {
  7359. var i, n = e.width / e.height, o = t.height * n;
  7360. return i = o <= t.width ? t.height : (o = t.width) / n,
  7361. {
  7362. x: t.x + t.width / 2 - o / 2,
  7363. y: t.y + t.height / 2 - i / 2,
  7364. width: o,
  7365. height: i
  7366. }
  7367. }
  7368. var Es = function(t, e) {
  7369. for (var i = [], n = t.length, o = 0; o < n; o++) {
  7370. var a = t[o];
  7371. a.path || a.createPathProxy(),
  7372. a.__dirtyPath && a.buildPath(a.path, a.shape, !0),
  7373. i.push(a.path)
  7374. }
  7375. var r = new Ar(e);
  7376. return r.createPathProxy(),
  7377. r.buildPath = function(t) {
  7378. t.appendPath(i);
  7379. var e = t.getContext();
  7380. e && t.rebuildPath(e)
  7381. }
  7382. ,
  7383. r
  7384. };
  7385. function Rs(t, e) {
  7386. if (t.applyTransform) {
  7387. var i = t.getBoundingRect().calculateTransform(e);
  7388. t.applyTransform(i)
  7389. }
  7390. }
  7391. var zs = os;
  7392. function Bs(t) {
  7393. return null != t && "none" !== t
  7394. }
  7395. var Vs = Q()
  7396. , Gs = 0;
  7397. function Fs(t) {
  7398. var e = t.__hoverStl;
  7399. if (e && !t.__highlighted) {
  7400. var i = t.__zr
  7401. , n = t.useHoverLayer && i && "canvas" === i.painter.type;
  7402. if (t.__highlighted = n ? "layer" : "plain",
  7403. !(t.isGroup || !i && t.useHoverLayer)) {
  7404. var o = t
  7405. , a = t.style;
  7406. n && (a = (o = i.addHover(t)).style),
  7407. ll(a),
  7408. n || function(t) {
  7409. if (t.__hoverStlDirty) {
  7410. t.__hoverStlDirty = !1;
  7411. var e = t.__hoverStl;
  7412. if (e) {
  7413. var i = t.__cachedNormalStl = {};
  7414. t.__cachedNormalZ2 = t.z2;
  7415. var n = t.style;
  7416. for (var o in e)
  7417. null != e[o] && (i[o] = n[o]);
  7418. i.fill = n.fill,
  7419. i.stroke = n.stroke
  7420. } else
  7421. t.__cachedNormalStl = t.__cachedNormalZ2 = null
  7422. }
  7423. }(o),
  7424. a.extendFrom(e),
  7425. Ws(a, e, "fill"),
  7426. Ws(a, e, "stroke"),
  7427. sl(a),
  7428. n || (t.dirty(!1),
  7429. t.z2 += bs)
  7430. }
  7431. }
  7432. }
  7433. function Ws(t, e, i) {
  7434. !Bs(e[i]) && Bs(t[i]) && (t[i] = function(t) {
  7435. if ("string" != typeof t)
  7436. return t;
  7437. var e = Vs.get(t);
  7438. return e || (e = He(t, -.1),
  7439. Gs < 1e4 && (Vs.set(t, e),
  7440. Gs++)),
  7441. e
  7442. }(t[i]))
  7443. }
  7444. function Hs(t) {
  7445. var e = t.__highlighted;
  7446. if (e && (t.__highlighted = !1,
  7447. !t.isGroup))
  7448. if ("layer" === e)
  7449. t.__zr && t.__zr.removeHover(t);
  7450. else {
  7451. var i = t.style
  7452. , n = t.__cachedNormalStl;
  7453. n && (ll(i),
  7454. t.setStyle(n),
  7455. sl(i));
  7456. var o = t.__cachedNormalZ2;
  7457. null != o && t.z2 - o === bs && (t.z2 = o)
  7458. }
  7459. }
  7460. function Zs(t, e, i) {
  7461. var n, o = Is, a = Is;
  7462. t.__highlighted && (o = Ms,
  7463. n = !0),
  7464. e(t, i),
  7465. t.__highlighted && (a = Ms,
  7466. n = !0),
  7467. t.isGroup && t.traverse(function(t) {
  7468. t.isGroup || e(t, i)
  7469. }),
  7470. n && t.__highDownOnUpdate && t.__highDownOnUpdate(o, a)
  7471. }
  7472. function Us(t, e) {
  7473. e = t.__hoverStl = !1 !== e && (t.hoverStyle || e || {}),
  7474. t.__hoverStlDirty = !0,
  7475. t.__highlighted && (t.__cachedNormalStl = null,
  7476. Hs(t),
  7477. Fs(t))
  7478. }
  7479. function Xs(t) {
  7480. Ks(this, t) || this.__highByOuter || Zs(this, Fs)
  7481. }
  7482. function Ys(t) {
  7483. Ks(this, t) || this.__highByOuter || Zs(this, Hs)
  7484. }
  7485. function js(t) {
  7486. this.__highByOuter |= 1 << (t || 0),
  7487. Zs(this, Fs)
  7488. }
  7489. function qs(t) {
  7490. (this.__highByOuter &= ~(1 << (t || 0))) || Zs(this, Hs)
  7491. }
  7492. function Ks(t, e) {
  7493. return t.__highDownSilentOnTouch && e.zrByTouch
  7494. }
  7495. function $s(t, e) {
  7496. Js(t, !0),
  7497. Zs(t, Us, e)
  7498. }
  7499. function Js(t, e) {
  7500. var i = !1 === e;
  7501. if (t.__highDownSilentOnTouch = t.highDownSilentOnTouch,
  7502. t.__highDownOnUpdate = t.highDownOnUpdate,
  7503. !i || t.__highDownDispatcher) {
  7504. var n = i ? "off" : "on";
  7505. t[n]("mouseover", Xs)[n]("mouseout", Ys),
  7506. t[n]("emphasis", js)[n]("normal", qs),
  7507. t.__highByOuter = t.__highByOuter || 0,
  7508. t.__highDownDispatcher = !i
  7509. }
  7510. }
  7511. function Qs(t) {
  7512. return !(!t || !t.__highDownDispatcher)
  7513. }
  7514. function tl(t) {
  7515. var e = As[t];
  7516. return null == e && Ts <= 32 && (e = As[t] = Ts++),
  7517. e
  7518. }
  7519. function el(t, e, i, n, o, a, r) {
  7520. var s, l = (o = o || ws).labelFetcher, u = o.labelDataIndex, h = o.labelDimIndex, c = o.labelProp, d = i.getShallow("show"), f = n.getShallow("show");
  7521. (d || f) && (l && (s = l.getFormattedLabel(u, "normal", null, h, c)),
  7522. null == s && (s = C(o.defaultText) ? o.defaultText(u, o) : o.defaultText));
  7523. var p = d ? s : null
  7524. , g = f ? H(l ? l.getFormattedLabel(u, "emphasis", null, h, c) : null, s) : null;
  7525. null == p && null == g || (nl(t, i, a, o),
  7526. nl(e, n, r, o, !0)),
  7527. t.text = p,
  7528. e.text = g
  7529. }
  7530. function il(t, e, i) {
  7531. var n = t.style;
  7532. e && (ll(n),
  7533. t.setStyle(e),
  7534. sl(n)),
  7535. n = t.__hoverStl,
  7536. i && n && (ll(n),
  7537. P(n, i),
  7538. sl(n))
  7539. }
  7540. function nl(t, e, i, n, o) {
  7541. return ol(t, e, n, o),
  7542. i && P(t, i),
  7543. t
  7544. }
  7545. function ol(t, e, i, n) {
  7546. if ((i = i || ws).isRectText) {
  7547. var o;
  7548. i.getTextPosition ? o = i.getTextPosition(e, n) : "outside" === (o = e.getShallow("position") || (n ? null : "inside")) && (o = "top"),
  7549. t.textPosition = o,
  7550. t.textOffset = e.getShallow("offset");
  7551. var a = e.getShallow("rotate");
  7552. null != a && (a *= Math.PI / 180),
  7553. t.textRotation = a,
  7554. t.textDistance = H(e.getShallow("distance"), n ? null : 5)
  7555. }
  7556. var r, s = e.ecModel, l = s && s.option.textStyle, u = function(t) {
  7557. var e;
  7558. for (; t && t !== t.ecModel; ) {
  7559. var i = (t.option || ws).rich;
  7560. if (i)
  7561. for (var n in e = e || {},
  7562. i)
  7563. i.hasOwnProperty(n) && (e[n] = 1);
  7564. t = t.parentModel
  7565. }
  7566. return e
  7567. }(e);
  7568. if (u)
  7569. for (var h in r = {},
  7570. u)
  7571. if (u.hasOwnProperty(h)) {
  7572. var c = e.getModel(["rich", h]);
  7573. al(r[h] = {}, c, l, i, n)
  7574. }
  7575. return t.rich = r,
  7576. al(t, e, l, i, n, !0),
  7577. i.forceRich && !i.textStyle && (i.textStyle = {}),
  7578. t
  7579. }
  7580. function al(t, e, i, n, o, a) {
  7581. i = !o && i || ws,
  7582. t.textFill = rl(e.getShallow("color"), n) || i.color,
  7583. t.textStroke = rl(e.getShallow("textBorderColor"), n) || i.textBorderColor,
  7584. t.textStrokeWidth = H(e.getShallow("textBorderWidth"), i.textBorderWidth),
  7585. o || (a && (t.insideRollbackOpt = n,
  7586. sl(t)),
  7587. null == t.textFill && (t.textFill = n.autoColor)),
  7588. t.fontStyle = e.getShallow("fontStyle") || i.fontStyle,
  7589. t.fontWeight = e.getShallow("fontWeight") || i.fontWeight,
  7590. t.fontSize = e.getShallow("fontSize") || i.fontSize,
  7591. t.fontFamily = e.getShallow("fontFamily") || i.fontFamily,
  7592. t.textAlign = e.getShallow("align"),
  7593. t.textVerticalAlign = e.getShallow("verticalAlign") || e.getShallow("baseline"),
  7594. t.textLineHeight = e.getShallow("lineHeight"),
  7595. t.textWidth = e.getShallow("width"),
  7596. t.textHeight = e.getShallow("height"),
  7597. t.textTag = e.getShallow("tag"),
  7598. a && n.disableBox || (t.textBackgroundColor = rl(e.getShallow("backgroundColor"), n),
  7599. t.textPadding = e.getShallow("padding"),
  7600. t.textBorderColor = rl(e.getShallow("borderColor"), n),
  7601. t.textBorderWidth = e.getShallow("borderWidth"),
  7602. t.textBorderRadius = e.getShallow("borderRadius"),
  7603. t.textBoxShadowColor = e.getShallow("shadowColor"),
  7604. t.textBoxShadowBlur = e.getShallow("shadowBlur"),
  7605. t.textBoxShadowOffsetX = e.getShallow("shadowOffsetX"),
  7606. t.textBoxShadowOffsetY = e.getShallow("shadowOffsetY")),
  7607. t.textShadowColor = e.getShallow("textShadowColor") || i.textShadowColor,
  7608. t.textShadowBlur = e.getShallow("textShadowBlur") || i.textShadowBlur,
  7609. t.textShadowOffsetX = e.getShallow("textShadowOffsetX") || i.textShadowOffsetX,
  7610. t.textShadowOffsetY = e.getShallow("textShadowOffsetY") || i.textShadowOffsetY
  7611. }
  7612. function rl(t, e) {
  7613. return "auto" !== t ? t : e && e.autoColor ? e.autoColor : null
  7614. }
  7615. function sl(t) {
  7616. var e, i = t.textPosition, n = t.insideRollbackOpt;
  7617. if (n && null == t.textFill) {
  7618. var o = n.autoColor
  7619. , a = n.isRectText
  7620. , r = n.useInsideStyle
  7621. , s = !1 !== r && (!0 === r || a && i && "string" == typeof i && 0 <= i.indexOf("inside"))
  7622. , l = !s && null != o;
  7623. (s || l) && (e = {
  7624. textFill: t.textFill,
  7625. textStroke: t.textStroke,
  7626. textStrokeWidth: t.textStrokeWidth
  7627. }),
  7628. s && (t.textFill = "#fff",
  7629. null == t.textStroke && (t.textStroke = o,
  7630. null == t.textStrokeWidth && (t.textStrokeWidth = 2))),
  7631. l && (t.textFill = o)
  7632. }
  7633. t.insideRollback = e
  7634. }
  7635. function ll(t) {
  7636. var e = t.insideRollback;
  7637. e && (t.textFill = e.textFill,
  7638. t.textStroke = e.textStroke,
  7639. t.textStrokeWidth = e.textStrokeWidth,
  7640. t.insideRollback = null)
  7641. }
  7642. function ul(t, e) {
  7643. var i = e && e.getModel("textStyle");
  7644. return j([t.fontStyle || i && i.getShallow("fontStyle") || "", t.fontWeight || i && i.getShallow("fontWeight") || "", (t.fontSize || i && i.getShallow("fontSize") || 12) + "px", t.fontFamily || i && i.getShallow("fontFamily") || "sans-serif"].join(" "))
  7645. }
  7646. function hl(t, e, i, n, o, a) {
  7647. if ("function" == typeof o && (a = o,
  7648. o = null),
  7649. n && n.isAnimationEnabled()) {
  7650. var r = t ? "Update" : ""
  7651. , s = n.getShallow("animationDuration" + r)
  7652. , l = n.getShallow("animationEasing" + r)
  7653. , u = n.getShallow("animationDelay" + r);
  7654. "function" == typeof u && (u = u(o, n.getAnimationDelayParams ? n.getAnimationDelayParams(e, o) : null)),
  7655. "function" == typeof s && (s = s(o)),
  7656. 0 < s ? e.animateTo(i, s, u || 0, l, a, !!a) : (e.stopAnimation(),
  7657. e.attr(i),
  7658. a && a())
  7659. } else
  7660. e.stopAnimation(),
  7661. e.attr(i),
  7662. a && a()
  7663. }
  7664. function cl(t, e, i, n, o) {
  7665. hl(!0, t, e, i, n, o)
  7666. }
  7667. function dl(t, e, i, n, o) {
  7668. hl(!1, t, e, i, n, o)
  7669. }
  7670. function fl(t, e) {
  7671. for (var i = re([]); t && t !== e; )
  7672. le(i, t.getLocalTransform(), i),
  7673. t = t.parent;
  7674. return i
  7675. }
  7676. function pl(t, e, i) {
  7677. return e && !N(e) && (e = ve.getLocalTransform(e)),
  7678. i && (e = de([], e)),
  7679. bt([], t, e)
  7680. }
  7681. function gl(t, e, i) {
  7682. var n = 0 === e[4] || 0 === e[5] || 0 === e[0] ? 1 : Math.abs(2 * e[4] / e[0])
  7683. , o = 0 === e[4] || 0 === e[5] || 0 === e[2] ? 1 : Math.abs(2 * e[4] / e[2])
  7684. , a = ["left" === t ? -n : "right" === t ? n : 0, "top" === t ? -o : "bottom" === t ? o : 0];
  7685. return a = pl(a, e, i),
  7686. Math.abs(a[0]) > Math.abs(a[1]) ? 0 < a[0] ? "right" : "left" : 0 < a[1] ? "bottom" : "top"
  7687. }
  7688. function ml(t, e, n, i) {
  7689. if (t && e) {
  7690. var o, a = (o = {},
  7691. t.traverse(function(t) {
  7692. !t.isGroup && t.anid && (o[t.anid] = t)
  7693. }),
  7694. o);
  7695. e.traverse(function(t) {
  7696. if (!t.isGroup && t.anid) {
  7697. var e = a[t.anid];
  7698. if (e) {
  7699. var i = r(t);
  7700. t.attr(r(e)),
  7701. cl(t, i, n, t.dataIndex)
  7702. }
  7703. }
  7704. })
  7705. }
  7706. function r(t) {
  7707. var e = {
  7708. position: rt(t.position),
  7709. rotation: t.rotation
  7710. };
  7711. return t.shape && (e.shape = P({}, t.shape)),
  7712. e
  7713. }
  7714. }
  7715. function vl(t, n) {
  7716. return O(t, function(t) {
  7717. var e = t[0];
  7718. e = xs(e, n.x),
  7719. e = _s(e, n.x + n.width);
  7720. var i = t[1];
  7721. return i = xs(i, n.y),
  7722. [e, i = _s(i, n.y + n.height)]
  7723. })
  7724. }
  7725. function yl(t, e, i) {
  7726. var n = (e = P({
  7727. rectHover: !0
  7728. }, e)).style = {
  7729. strokeNoScale: !0
  7730. };
  7731. if (i = i || {
  7732. x: -1,
  7733. y: -1,
  7734. width: 2,
  7735. height: 2
  7736. },
  7737. t)
  7738. return 0 === t.indexOf("image://") ? (n.image = t.slice(8),
  7739. D(n, i),
  7740. new Qn(e)) : Ps(t.replace("path://", ""), e, i, "center")
  7741. }
  7742. function xl(t, e, i, n, o) {
  7743. for (var a = 0, r = o[o.length - 1]; a < o.length; a++) {
  7744. var s = o[a];
  7745. if (_l(t, e, i, n, s[0], s[1], r[0], r[1]))
  7746. return !0;
  7747. r = s
  7748. }
  7749. }
  7750. function _l(t, e, i, n, o, a, r, s) {
  7751. var l = i - t
  7752. , u = n - e
  7753. , h = r - o
  7754. , c = s - a
  7755. , d = wl(h, c, l, u);
  7756. if (function(t) {
  7757. return t <= 1e-6 && -1e-6 <= t
  7758. }(d))
  7759. return !1;
  7760. var f = t - o
  7761. , p = e - a
  7762. , g = wl(f, p, l, u) / d;
  7763. if (g < 0 || 1 < g)
  7764. return !1;
  7765. var m = wl(f, p, h, c) / d;
  7766. return !(m < 0 || 1 < m)
  7767. }
  7768. function wl(t, e, i, n) {
  7769. return t * n - i * e
  7770. }
  7771. Ls("circle", Yr),
  7772. Ls("sector", qr),
  7773. Ls("ring", Kr),
  7774. Ls("polygon", Qr),
  7775. Ls("polyline", ts),
  7776. Ls("rect", rs),
  7777. Ls("line", ls),
  7778. Ls("bezierCurve", ds),
  7779. Ls("arc", fs);
  7780. var bl = (Object.freeze || Object)({
  7781. Z2_EMPHASIS_LIFT: bs,
  7782. CACHED_LABEL_STYLE_PROPERTIES: Ss,
  7783. extendShape: Cs,
  7784. extendPath: function(t, e) {
  7785. return function(t, e) {
  7786. return Ar.extend(Hr(t, e))
  7787. }(t, e)
  7788. },
  7789. registerShape: Ls,
  7790. getShapeClass: ks,
  7791. makePath: Ps,
  7792. makeImage: Ns,
  7793. mergePath: Es,
  7794. resizePath: Rs,
  7795. subPixelOptimizeLine: function(t) {
  7796. return is(t.shape, t.shape, t.style),
  7797. t
  7798. },
  7799. subPixelOptimizeRect: function(t) {
  7800. return ns(t.shape, t.shape, t.style),
  7801. t
  7802. },
  7803. subPixelOptimize: zs,
  7804. setElementHoverStyle: Us,
  7805. setHoverStyle: $s,
  7806. setAsHighDownDispatcher: Js,
  7807. isHighDownDispatcher: Qs,
  7808. getHighlightDigit: tl,
  7809. setLabelStyle: el,
  7810. modifyLabelStyle: il,
  7811. setTextStyle: nl,
  7812. setText: function(t, e, i) {
  7813. var n, o = {
  7814. isRectText: !0
  7815. };
  7816. !1 === i ? n = !0 : o.autoColor = i,
  7817. ol(t, e, o, n)
  7818. },
  7819. getFont: ul,
  7820. updateProps: cl,
  7821. initProps: dl,
  7822. getTransform: fl,
  7823. applyTransform: pl,
  7824. transformDirection: gl,
  7825. groupTransition: ml,
  7826. clipPointsByRect: vl,
  7827. clipRectByRect: function(t, e) {
  7828. var i = xs(t.x, e.x)
  7829. , n = _s(t.x + t.width, e.x + e.width)
  7830. , o = xs(t.y, e.y)
  7831. , a = _s(t.y + t.height, e.y + e.height);
  7832. if (i <= n && o <= a)
  7833. return {
  7834. x: i,
  7835. y: o,
  7836. width: n - i,
  7837. height: a - o
  7838. }
  7839. },
  7840. createIcon: yl,
  7841. linePolygonIntersect: xl,
  7842. lineLineIntersect: _l,
  7843. Group: Ci,
  7844. Image: Qn,
  7845. Text: Ur,
  7846. Circle: Yr,
  7847. Sector: qr,
  7848. Ring: Kr,
  7849. Polygon: Qr,
  7850. Polyline: ts,
  7851. Rect: rs,
  7852. Line: ls,
  7853. BezierCurve: ds,
  7854. Arc: fs,
  7855. IncrementalDisplayable: vs,
  7856. CompoundPath: ps,
  7857. LinearGradient: gs,
  7858. RadialGradient: ms,
  7859. BoundingRect: Di
  7860. })
  7861. , Sl = ["textStyle", "color"]
  7862. , Ml = {
  7863. getTextColor: function(t) {
  7864. var e = this.ecModel;
  7865. return this.getShallow("color") || (!t && e ? e.get(Sl) : null)
  7866. },
  7867. getFont: function() {
  7868. return ul({
  7869. fontStyle: this.getShallow("fontStyle"),
  7870. fontWeight: this.getShallow("fontWeight"),
  7871. fontSize: this.getShallow("fontSize"),
  7872. fontFamily: this.getShallow("fontFamily")
  7873. }, this.ecModel)
  7874. },
  7875. getTextRect: function(t) {
  7876. return gn(t, this.getFont(), this.getShallow("align"), this.getShallow("verticalAlign") || this.getShallow("baseline"), this.getShallow("padding"), this.getShallow("lineHeight"), this.getShallow("rich"), this.getShallow("truncateText"))
  7877. }
  7878. }
  7879. , Il = ha([["fill", "color"], ["stroke", "borderColor"], ["lineWidth", "borderWidth"], ["opacity"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"], ["textPosition"], ["textAlign"]])
  7880. , Tl = {
  7881. getItemStyle: function(t, e) {
  7882. var i = Il(this, t, e)
  7883. , n = this.getBorderLineDash();
  7884. return n && (i.lineDash = n),
  7885. i
  7886. },
  7887. getBorderLineDash: function() {
  7888. var t = this.get("borderType");
  7889. return "solid" === t || null == t ? null : "dashed" === t ? [5, 5] : [1, 1]
  7890. }
  7891. }
  7892. , Al = b
  7893. , Dl = jo();
  7894. function Cl(t, e, i) {
  7895. this.parentModel = e,
  7896. this.ecModel = i,
  7897. this.option = t
  7898. }
  7899. function Ll(t, e, i) {
  7900. for (var n = 0; n < e.length && (!e[n] || null != (t = t && "object" == typeof t ? t[e[n]] : null)); n++)
  7901. ;
  7902. return null == t && i && (t = i.get(e)),
  7903. t
  7904. }
  7905. function kl(t, e) {
  7906. var i = Dl(t).getParent;
  7907. return i ? i.call(t, e) : t.parentModel
  7908. }
  7909. Cl.prototype = {
  7910. constructor: Cl,
  7911. init: null,
  7912. mergeOption: function(t) {
  7913. m(this.option, t, !0)
  7914. },
  7915. get: function(t, e) {
  7916. return null == t ? this.option : Ll(this.option, this.parsePath(t), !e && kl(this, t))
  7917. },
  7918. getShallow: function(t, e) {
  7919. var i = this.option
  7920. , n = null == i ? i : i[t]
  7921. , o = !e && kl(this, t);
  7922. return null == n && o && (n = o.getShallow(t)),
  7923. n
  7924. },
  7925. getModel: function(t, e) {
  7926. var i;
  7927. return new Cl(null == t ? this.option : Ll(this.option, t = this.parsePath(t)),e = e || (i = kl(this, t)) && i.getModel(t),this.ecModel)
  7928. },
  7929. isEmpty: function() {
  7930. return null == this.option
  7931. },
  7932. restoreData: function() {},
  7933. clone: function() {
  7934. return new this.constructor(k(this.option))
  7935. },
  7936. setReadOnly: function(t) {},
  7937. parsePath: function(t) {
  7938. return "string" == typeof t && (t = t.split(".")),
  7939. t
  7940. },
  7941. customizeGetParent: function(t) {
  7942. Dl(this).getParent = t
  7943. },
  7944. isAnimationEnabled: function() {
  7945. if (!v.node) {
  7946. if (null != this.option.animation)
  7947. return !!this.option.animation;
  7948. if (this.parentModel)
  7949. return this.parentModel.isAnimationEnabled()
  7950. }
  7951. }
  7952. },
  7953. oa(Cl),
  7954. ra(Cl),
  7955. Al(Cl, da),
  7956. Al(Cl, pa),
  7957. Al(Cl, Ml),
  7958. Al(Cl, Tl);
  7959. var Pl = 0;
  7960. function Nl(t) {
  7961. return [t || "", Pl++, Math.random().toFixed(5)].join("_")
  7962. }
  7963. var Ol = 1e-4;
  7964. function El(t, e, i, n) {
  7965. var o = e[1] - e[0]
  7966. , a = i[1] - i[0];
  7967. if (0 == o)
  7968. return 0 == a ? i[0] : (i[0] + i[1]) / 2;
  7969. if (n)
  7970. if (0 < o) {
  7971. if (t <= e[0])
  7972. return i[0];
  7973. if (t >= e[1])
  7974. return i[1]
  7975. } else {
  7976. if (t >= e[0])
  7977. return i[0];
  7978. if (t <= e[1])
  7979. return i[1]
  7980. }
  7981. else {
  7982. if (t === e[0])
  7983. return i[0];
  7984. if (t === e[1])
  7985. return i[1]
  7986. }
  7987. return (t - e[0]) / o * a + i[0]
  7988. }
  7989. function Rl(t, e) {
  7990. switch (t) {
  7991. case "center":
  7992. case "middle":
  7993. t = "50%";
  7994. break;
  7995. case "left":
  7996. case "top":
  7997. t = "0%";
  7998. break;
  7999. case "right":
  8000. case "bottom":
  8001. t = "100%"
  8002. }
  8003. return "string" == typeof t ? function(t) {
  8004. return t.replace(/^\s+|\s+$/g, "")
  8005. }(t).match(/%$/) ? parseFloat(t) / 100 * e : parseFloat(t) : null == t ? NaN : +t
  8006. }
  8007. function zl(t, e, i) {
  8008. return null == e && (e = 10),
  8009. e = Math.min(Math.max(0, e), 20),
  8010. t = (+t).toFixed(e),
  8011. i ? t : +t
  8012. }
  8013. function Bl(t) {
  8014. return t.sort(function(t, e) {
  8015. return t - e
  8016. }),
  8017. t
  8018. }
  8019. function Vl(t) {
  8020. if (t = +t,
  8021. isNaN(t))
  8022. return 0;
  8023. for (var e = 1, i = 0; Math.round(t * e) / e !== t; )
  8024. e *= 10,
  8025. i++;
  8026. return i
  8027. }
  8028. function Gl(t) {
  8029. var e = t.toString()
  8030. , i = e.indexOf("e");
  8031. if (0 < i) {
  8032. var n = +e.slice(i + 1);
  8033. return n < 0 ? -n : 0
  8034. }
  8035. var o = e.indexOf(".");
  8036. return o < 0 ? 0 : e.length - 1 - o
  8037. }
  8038. function Fl(t, e) {
  8039. var i = Math.log
  8040. , n = Math.LN10
  8041. , o = Math.floor(i(t[1] - t[0]) / n)
  8042. , a = Math.round(i(Math.abs(e[1] - e[0])) / n)
  8043. , r = Math.min(Math.max(-o + a, 0), 20);
  8044. return isFinite(r) ? r : 20
  8045. }
  8046. function Wl(t, e, i) {
  8047. if (!t[e])
  8048. return 0;
  8049. var n = S(t, function(t, e) {
  8050. return t + (isNaN(e) ? 0 : e)
  8051. }, 0);
  8052. if (0 === n)
  8053. return 0;
  8054. for (var o = Math.pow(10, i), a = O(t, function(t) {
  8055. return (isNaN(t) ? 0 : t) / n * o * 100
  8056. }), r = 100 * o, s = O(a, function(t) {
  8057. return Math.floor(t)
  8058. }), l = S(s, function(t, e) {
  8059. return t + e
  8060. }, 0), u = O(a, function(t, e) {
  8061. return t - s[e]
  8062. }); l < r; ) {
  8063. for (var h = Number.NEGATIVE_INFINITY, c = null, d = 0, f = u.length; d < f; ++d)
  8064. u[d] > h && (h = u[d],
  8065. c = d);
  8066. ++s[c],
  8067. u[c] = 0,
  8068. ++l
  8069. }
  8070. return s[e] / o
  8071. }
  8072. var Hl = 9007199254740991;
  8073. function Zl(t) {
  8074. var e = 2 * Math.PI;
  8075. return (t % e + e) % e
  8076. }
  8077. function Ul(t) {
  8078. return -Ol < t && t < Ol
  8079. }
  8080. var Xl = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;
  8081. function Yl(t) {
  8082. if (t instanceof Date)
  8083. return t;
  8084. if ("string" != typeof t)
  8085. return null == t ? new Date(NaN) : new Date(Math.round(t));
  8086. var e = Xl.exec(t);
  8087. if (!e)
  8088. return new Date(NaN);
  8089. if (e[8]) {
  8090. var i = +e[4] || 0;
  8091. return "Z" !== e[8].toUpperCase() && (i -= e[8].slice(0, 3)),
  8092. new Date(Date.UTC(+e[1], +(e[2] || 1) - 1, +e[3] || 1, i, +(e[5] || 0), +e[6] || 0, +e[7] || 0))
  8093. }
  8094. return new Date(+e[1],+(e[2] || 1) - 1,+e[3] || 1,+e[4] || 0,+(e[5] || 0),+e[6] || 0,+e[7] || 0)
  8095. }
  8096. function jl(t) {
  8097. return Math.pow(10, ql(t))
  8098. }
  8099. function ql(t) {
  8100. if (0 === t)
  8101. return 0;
  8102. var e = Math.floor(Math.log(t) / Math.LN10);
  8103. return 10 <= t / Math.pow(10, e) && e++,
  8104. e
  8105. }
  8106. function Kl(t, e) {
  8107. var i = ql(t)
  8108. , n = Math.pow(10, i)
  8109. , o = t / n;
  8110. return t = (e ? o < 1.5 ? 1 : o < 2.5 ? 2 : o < 4 ? 3 : o < 7 ? 5 : 10 : o < 1 ? 1 : o < 2 ? 2 : o < 3 ? 3 : o < 5 ? 5 : 10) * n,
  8111. -20 <= i ? +t.toFixed(i < 0 ? -i : 0) : t
  8112. }
  8113. function $l(t) {
  8114. t.sort(function(t, e) {
  8115. return function t(e, i, n) {
  8116. return e.interval[n] < i.interval[n] || e.interval[n] === i.interval[n] && (e.close[n] - i.close[n] == (n ? -1 : 1) || !n && t(e, i, 1))
  8117. }(t, e, 0) ? -1 : 1
  8118. });
  8119. for (var e = -1 / 0, i = 1, n = 0; n < t.length; ) {
  8120. for (var o = t[n].interval, a = t[n].close, r = 0; r < 2; r++)
  8121. o[r] <= e && (o[r] = e,
  8122. a[r] = r ? 1 : 1 - i),
  8123. e = o[r],
  8124. i = a[r];
  8125. o[0] === o[1] && a[0] * a[1] != 1 ? t.splice(n, 1) : n++
  8126. }
  8127. return t
  8128. }
  8129. function Jl(t) {
  8130. return 0 <= t - parseFloat(t)
  8131. }
  8132. var Ql = (Object.freeze || Object)({
  8133. linearMap: El,
  8134. parsePercent: Rl,
  8135. round: zl,
  8136. asc: Bl,
  8137. getPrecision: Vl,
  8138. getPrecisionSafe: Gl,
  8139. getPixelPrecision: Fl,
  8140. getPercentWithPrecision: Wl,
  8141. MAX_SAFE_INTEGER: Hl,
  8142. remRadian: Zl,
  8143. isRadianAroundZero: Ul,
  8144. parseDate: Yl,
  8145. quantity: jl,
  8146. quantityExponent: ql,
  8147. nice: Kl,
  8148. quantile: function(t, e) {
  8149. var i = (t.length - 1) * e + 1
  8150. , n = Math.floor(i)
  8151. , o = +t[n - 1]
  8152. , a = i - n;
  8153. return a ? o + a * (t[n] - o) : o
  8154. },
  8155. reformIntervals: $l,
  8156. isNumeric: Jl
  8157. });
  8158. function tu(t) {
  8159. return isNaN(t) ? "-" : (t = (t + "").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, "$1,") + (1 < t.length ? "." + t[1] : "")
  8160. }
  8161. function eu(t, e) {
  8162. return t = (t || "").toLowerCase().replace(/-(.)/g, function(t, e) {
  8163. return e.toUpperCase()
  8164. }),
  8165. e && t && (t = t.charAt(0).toUpperCase() + t.slice(1)),
  8166. t
  8167. }
  8168. var iu = X
  8169. , nu = /([&<>"'])/g
  8170. , ou = {
  8171. "&": "&amp;",
  8172. "<": "&lt;",
  8173. ">": "&gt;",
  8174. '"': "&quot;",
  8175. "'": "&#39;"
  8176. };
  8177. function au(t) {
  8178. return null == t ? "" : (t + "").replace(nu, function(t, e) {
  8179. return ou[e]
  8180. })
  8181. }
  8182. function ru(t, e) {
  8183. return "{" + t + (null == e ? "" : e) + "}"
  8184. }
  8185. var su = ["a", "b", "c", "d", "e", "f", "g"];
  8186. function lu(t, e, i) {
  8187. L(e) || (e = [e]);
  8188. var n = e.length;
  8189. if (!n)
  8190. return "";
  8191. for (var o = e[0].$vars || [], a = 0; a < o.length; a++) {
  8192. var r = su[a];
  8193. t = t.replace(ru(r), ru(r, 0))
  8194. }
  8195. for (var s = 0; s < n; s++)
  8196. for (var l = 0; l < o.length; l++) {
  8197. var u = e[s][o[l]];
  8198. t = t.replace(ru(su[l], s), i ? au(u) : u)
  8199. }
  8200. return t
  8201. }
  8202. function uu(i, t, n) {
  8203. return E(t, function(t, e) {
  8204. i = i.replace("{" + e + "}", n ? au(t) : t)
  8205. }),
  8206. i
  8207. }
  8208. function hu(t, e) {
  8209. var i = (t = R(t) ? {
  8210. color: t,
  8211. extraCssText: e
  8212. } : t || {}).color
  8213. , n = t.type
  8214. , o = (e = t.extraCssText,
  8215. t.renderMode || "html")
  8216. , a = t.markerId || "X";
  8217. return i ? "html" === o ? "subItem" === n ? '<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:' + au(i) + ";" + (e || "") + '"></span>' : '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:' + au(i) + ";" + (e || "") + '"></span>' : {
  8218. renderMode: o,
  8219. content: "{marker" + a + "|} ",
  8220. style: {
  8221. color: i
  8222. }
  8223. } : ""
  8224. }
  8225. function cu(t, e) {
  8226. return "0000".substr(0, e - (t += "").length) + t
  8227. }
  8228. function du(t, e, i) {
  8229. "week" !== t && "month" !== t && "quarter" !== t && "half-year" !== t && "year" !== t || (t = "MM-dd\nyyyy");
  8230. var n = Yl(e)
  8231. , o = i ? "UTC" : ""
  8232. , a = n["get" + o + "FullYear"]()
  8233. , r = n["get" + o + "Month"]() + 1
  8234. , s = n["get" + o + "Date"]()
  8235. , l = n["get" + o + "Hours"]()
  8236. , u = n["get" + o + "Minutes"]()
  8237. , h = n["get" + o + "Seconds"]()
  8238. , c = n["get" + o + "Milliseconds"]();
  8239. return t = t.replace("MM", cu(r, 2)).replace("M", r).replace("yyyy", a).replace("yy", a % 100).replace("dd", cu(s, 2)).replace("d", s).replace("hh", cu(l, 2)).replace("h", l).replace("mm", cu(u, 2)).replace("m", u).replace("ss", cu(h, 2)).replace("s", h).replace("SSS", cu(c, 3))
  8240. }
  8241. function fu(t) {
  8242. return t ? t.charAt(0).toUpperCase() + t.substr(1) : t
  8243. }
  8244. var pu = xn;
  8245. function gu(t, e) {
  8246. if ("_blank" === e || "blank" === e) {
  8247. var i = window.open();
  8248. i.opener = null,
  8249. i.location = t
  8250. } else
  8251. window.open(t, e)
  8252. }
  8253. var mu = (Object.freeze || Object)({
  8254. addCommas: tu,
  8255. toCamelCase: eu,
  8256. normalizeCssArray: iu,
  8257. encodeHTML: au,
  8258. formatTpl: lu,
  8259. formatTplSimple: uu,
  8260. getTooltipMarker: hu,
  8261. formatTime: du,
  8262. capitalFirst: fu,
  8263. truncateText: pu,
  8264. getTextBoundingRect: function(t) {
  8265. return gn(t.text, t.font, t.textAlign, t.textVerticalAlign, t.textPadding, t.textLineHeight, t.rich, t.truncate)
  8266. },
  8267. getTextRect: function(t, e, i, n, o, a, r, s) {
  8268. return gn(t, e, i, n, o, s, a, r)
  8269. },
  8270. windowOpen: gu
  8271. })
  8272. , vu = E
  8273. , yu = ["left", "right", "top", "bottom", "width", "height"]
  8274. , xu = [["width", "left", "right"], ["height", "top", "bottom"]];
  8275. function _u(h, c, d, f, p) {
  8276. var g = 0
  8277. , m = 0;
  8278. null == f && (f = 1 / 0),
  8279. null == p && (p = 1 / 0);
  8280. var v = 0;
  8281. c.eachChild(function(t, e) {
  8282. var i, n, o = t.position, a = t.getBoundingRect(), r = c.childAt(e + 1), s = r && r.getBoundingRect();
  8283. if ("horizontal" === h) {
  8284. var l = a.width + (s ? -s.x + a.x : 0);
  8285. v = f < (i = g + l) || t.newline ? (g = 0,
  8286. i = l,
  8287. m += v + d,
  8288. a.height) : Math.max(v, a.height)
  8289. } else {
  8290. var u = a.height + (s ? -s.y + a.y : 0);
  8291. v = p < (n = m + u) || t.newline ? (g += v + d,
  8292. m = 0,
  8293. n = u,
  8294. a.width) : Math.max(v, a.width)
  8295. }
  8296. t.newline || (o[0] = g,
  8297. o[1] = m,
  8298. "horizontal" === h ? g = i + d : m = n + d)
  8299. })
  8300. }
  8301. var wu = _u;
  8302. T(_u, "vertical"),
  8303. T(_u, "horizontal");
  8304. function bu(t, e, i) {
  8305. i = iu(i || 0);
  8306. var n = e.width
  8307. , o = e.height
  8308. , a = Rl(t.left, n)
  8309. , r = Rl(t.top, o)
  8310. , s = Rl(t.right, n)
  8311. , l = Rl(t.bottom, o)
  8312. , u = Rl(t.width, n)
  8313. , h = Rl(t.height, o)
  8314. , c = i[2] + i[0]
  8315. , d = i[1] + i[3]
  8316. , f = t.aspect;
  8317. switch (isNaN(u) && (u = n - s - d - a),
  8318. isNaN(h) && (h = o - l - c - r),
  8319. null != f && (isNaN(u) && isNaN(h) && (n / o < f ? u = .8 * n : h = .8 * o),
  8320. isNaN(u) && (u = f * h),
  8321. isNaN(h) && (h = u / f)),
  8322. isNaN(a) && (a = n - s - u - d),
  8323. isNaN(r) && (r = o - l - h - c),
  8324. t.left || t.right) {
  8325. case "center":
  8326. a = n / 2 - u / 2 - i[3];
  8327. break;
  8328. case "right":
  8329. a = n - u - d
  8330. }
  8331. switch (t.top || t.bottom) {
  8332. case "middle":
  8333. case "center":
  8334. r = o / 2 - h / 2 - i[0];
  8335. break;
  8336. case "bottom":
  8337. r = o - h - c
  8338. }
  8339. a = a || 0,
  8340. r = r || 0,
  8341. isNaN(u) && (u = n - d - a - (s || 0)),
  8342. isNaN(h) && (h = o - c - r - (l || 0));
  8343. var p = new Di(a + i[3],r + i[0],u,h);
  8344. return p.margin = i,
  8345. p
  8346. }
  8347. function Su(t, e, i, n, o) {
  8348. var a = !o || !o.hv || o.hv[0]
  8349. , r = !o || !o.hv || o.hv[1]
  8350. , s = o && o.boundingMode || "all";
  8351. if (a || r) {
  8352. var l;
  8353. if ("raw" === s)
  8354. l = "group" === t.type ? new Di(0,0,+e.width || 0,+e.height || 0) : t.getBoundingRect();
  8355. else if (l = t.getBoundingRect(),
  8356. t.needLocalTransform()) {
  8357. var u = t.getLocalTransform();
  8358. (l = l.clone()).applyTransform(u)
  8359. }
  8360. e = bu(D({
  8361. width: l.width,
  8362. height: l.height
  8363. }, e), i, n);
  8364. var h = t.position
  8365. , c = a ? e.x - l.x : 0
  8366. , d = r ? e.y - l.y : 0;
  8367. t.attr("position", "raw" === s ? [c, d] : [h[0] + c, h[1] + d])
  8368. }
  8369. }
  8370. function Mu(l, u, t) {
  8371. z(t) || (t = {});
  8372. var h = t.ignoreSize;
  8373. L(h) || (h = [h, h]);
  8374. var e = n(xu[0], 0)
  8375. , i = n(xu[1], 1);
  8376. function n(t, e) {
  8377. var i = {}
  8378. , n = 0
  8379. , o = {}
  8380. , a = 0;
  8381. if (vu(t, function(t) {
  8382. o[t] = l[t]
  8383. }),
  8384. vu(t, function(t) {
  8385. c(u, t) && (i[t] = o[t] = u[t]),
  8386. d(i, t) && n++,
  8387. d(o, t) && a++
  8388. }),
  8389. h[e])
  8390. return d(u, t[1]) ? o[t[2]] = null : d(u, t[2]) && (o[t[1]] = null),
  8391. o;
  8392. if (2 !== a && n) {
  8393. if (2 <= n)
  8394. return i;
  8395. for (var r = 0; r < t.length; r++) {
  8396. var s = t[r];
  8397. if (!c(i, s) && c(l, s)) {
  8398. i[s] = l[s];
  8399. break
  8400. }
  8401. }
  8402. return i
  8403. }
  8404. return o
  8405. }
  8406. function c(t, e) {
  8407. return t.hasOwnProperty(e)
  8408. }
  8409. function d(t, e) {
  8410. return null != t[e] && "auto" !== t[e]
  8411. }
  8412. function o(t, e, i) {
  8413. vu(t, function(t) {
  8414. e[t] = i[t]
  8415. })
  8416. }
  8417. o(xu[0], l, e),
  8418. o(xu[1], l, i)
  8419. }
  8420. function Iu(t) {
  8421. return Tu({}, t)
  8422. }
  8423. function Tu(e, i) {
  8424. return i && e && vu(yu, function(t) {
  8425. i.hasOwnProperty(t) && (e[t] = i[t])
  8426. }),
  8427. e
  8428. }
  8429. var Au, Du, Cu, Lu = jo(), ku = Cl.extend({
  8430. type: "component",
  8431. id: "",
  8432. name: "",
  8433. mainType: "",
  8434. subType: "",
  8435. componentIndex: 0,
  8436. defaultOption: null,
  8437. ecModel: null,
  8438. dependentModels: [],
  8439. uid: null,
  8440. layoutMode: null,
  8441. $constructor: function(t, e, i, n) {
  8442. Cl.call(this, t, e, i, n),
  8443. this.uid = Nl("ec_cpt_model")
  8444. },
  8445. init: function(t, e, i, n) {
  8446. this.mergeDefaultAndTheme(t, i)
  8447. },
  8448. mergeDefaultAndTheme: function(t, e) {
  8449. var i = this.layoutMode
  8450. , n = i ? Iu(t) : {};
  8451. m(t, e.getTheme().get(this.mainType)),
  8452. m(t, this.getDefaultOption()),
  8453. i && Mu(t, n, i)
  8454. },
  8455. mergeOption: function(t, e) {
  8456. m(this.option, t, !0);
  8457. var i = this.layoutMode;
  8458. i && Mu(this.option, t, i)
  8459. },
  8460. optionUpdated: function(t, e) {},
  8461. getDefaultOption: function() {
  8462. var t = Lu(this);
  8463. if (!t.defaultOption) {
  8464. for (var e = [], i = this.constructor; i; ) {
  8465. var n = i.prototype.defaultOption;
  8466. n && e.push(n),
  8467. i = i.superClass
  8468. }
  8469. for (var o = {}, a = e.length - 1; 0 <= a; a--)
  8470. o = m(o, e[a], !0);
  8471. t.defaultOption = o
  8472. }
  8473. return t.defaultOption
  8474. },
  8475. getReferringComponents: function(t) {
  8476. return this.ecModel.queryComponents({
  8477. mainType: t,
  8478. index: this.get(t + "Index", !0),
  8479. id: this.get(t + "Id", !0)
  8480. })
  8481. }
  8482. });
  8483. function Pu(t, e) {
  8484. return t[e] || (t[e] = {
  8485. predecessor: [],
  8486. successor: []
  8487. }),
  8488. t[e]
  8489. }
  8490. ua(ku, {
  8491. registerWhenExtend: !0
  8492. }),
  8493. Du = {},
  8494. (Au = ku).registerSubTypeDefaulter = function(t, e) {
  8495. t = na(t),
  8496. Du[t.main] = e
  8497. }
  8498. ,
  8499. Au.determineSubType = function(t, e) {
  8500. var i = e.type;
  8501. if (!i) {
  8502. var n = na(t).main;
  8503. Au.hasSubTypes(t) && Du[n] && (i = Du[n](e))
  8504. }
  8505. return i
  8506. }
  8507. ,
  8508. Cu = function(t) {
  8509. var e = [];
  8510. E(ku.getClassesByMainType(t), function(t) {
  8511. e = e.concat(t.prototype.dependencies || [])
  8512. }),
  8513. e = O(e, function(t) {
  8514. return na(t).main
  8515. }),
  8516. "dataset" !== t && _(e, "dataset") <= 0 && e.unshift("dataset");
  8517. return e
  8518. }
  8519. ,
  8520. ku.topologicalTravel = function(t, e, i, n) {
  8521. if (t.length) {
  8522. var o = function(e) {
  8523. var o = {}
  8524. , a = [];
  8525. return E(e, function(i) {
  8526. var n = Pu(o, i)
  8527. , t = function(t, e) {
  8528. var i = [];
  8529. return E(t, function(t) {
  8530. 0 <= _(e, t) && i.push(t)
  8531. }),
  8532. i
  8533. }(n.originalDeps = Cu(i), e);
  8534. n.entryCount = t.length,
  8535. 0 === n.entryCount && a.push(i),
  8536. E(t, function(t) {
  8537. _(n.predecessor, t) < 0 && n.predecessor.push(t);
  8538. var e = Pu(o, t);
  8539. _(e.successor, t) < 0 && e.successor.push(i)
  8540. })
  8541. }),
  8542. {
  8543. graph: o,
  8544. noEntryList: a
  8545. }
  8546. }(e)
  8547. , a = o.graph
  8548. , r = o.noEntryList
  8549. , s = {};
  8550. for (E(t, function(t) {
  8551. s[t] = !0
  8552. }); r.length; ) {
  8553. var l = r.pop()
  8554. , u = a[l]
  8555. , h = !!s[l];
  8556. h && (i.call(n, l, u.originalDeps.slice()),
  8557. delete s[l]),
  8558. E(u.successor, h ? d : c)
  8559. }
  8560. E(s, function() {
  8561. throw new Error("Circle dependency may exists")
  8562. })
  8563. }
  8564. function c(t) {
  8565. a[t].entryCount--,
  8566. 0 === a[t].entryCount && r.push(t)
  8567. }
  8568. function d(t) {
  8569. s[t] = !0,
  8570. c(t)
  8571. }
  8572. }
  8573. ,
  8574. b(ku, {
  8575. getBoxLayoutParams: function() {
  8576. return {
  8577. left: this.get("left"),
  8578. top: this.get("top"),
  8579. right: this.get("right"),
  8580. bottom: this.get("bottom"),
  8581. width: this.get("width"),
  8582. height: this.get("height")
  8583. }
  8584. }
  8585. });
  8586. var Nu = "";
  8587. "undefined" != typeof navigator && (Nu = navigator.platform || "");
  8588. var Ou = {
  8589. color: ["#c23531", "#2f4554", "#61a0a8", "#d48265", "#91c7ae", "#749f83", "#ca8622", "#bda29a", "#6e7074", "#546570", "#c4ccd3"],
  8590. gradientColor: ["#f6efa6", "#d88273", "#bf444c"],
  8591. textStyle: {
  8592. fontFamily: Nu.match(/^Win/) ? "Microsoft YaHei" : "sans-serif",
  8593. fontSize: 12,
  8594. fontStyle: "normal",
  8595. fontWeight: "normal"
  8596. },
  8597. blendMode: null,
  8598. animation: "auto",
  8599. animationDuration: 1e3,
  8600. animationDurationUpdate: 300,
  8601. animationEasing: "exponentialOut",
  8602. animationEasingUpdate: "cubicOut",
  8603. animationThreshold: 2e3,
  8604. progressiveThreshold: 3e3,
  8605. progressive: 400,
  8606. hoverLayerThreshold: 3e3,
  8607. useUTC: !1
  8608. }
  8609. , Eu = jo();
  8610. var Ru = {
  8611. clearColorPalette: function() {
  8612. Eu(this).colorIdx = 0,
  8613. Eu(this).colorNameMap = {}
  8614. },
  8615. getColorFromPalette: function(t, e, i) {
  8616. var n = Eu(e = e || this)
  8617. , o = n.colorIdx || 0
  8618. , a = n.colorNameMap = n.colorNameMap || {};
  8619. if (a.hasOwnProperty(t))
  8620. return a[t];
  8621. var r = Vo(this.get("color", !0))
  8622. , s = this.get("colorLayer", !0)
  8623. , l = null != i && s ? function(t, e) {
  8624. for (var i = t.length, n = 0; n < i; n++)
  8625. if (t[n].length > e)
  8626. return t[n];
  8627. return t[i - 1]
  8628. }(s, i) : r;
  8629. if ((l = l || r) && l.length) {
  8630. var u = l[o];
  8631. return t && (a[t] = u),
  8632. n.colorIdx = (o + 1) % l.length,
  8633. u
  8634. }
  8635. }
  8636. }
  8637. , zu = "original"
  8638. , Bu = "arrayRows"
  8639. , Vu = "objectRows"
  8640. , Gu = "keyedColumns"
  8641. , Fu = "unknown"
  8642. , Wu = "typedArray"
  8643. , Hu = "column"
  8644. , Zu = "row";
  8645. function Uu(t) {
  8646. this.fromDataset = t.fromDataset,
  8647. this.data = t.data || (t.sourceFormat === Gu ? {} : []),
  8648. this.sourceFormat = t.sourceFormat || Fu,
  8649. this.seriesLayoutBy = t.seriesLayoutBy || Hu,
  8650. this.dimensionsDefine = t.dimensionsDefine,
  8651. this.encodeDefine = t.encodeDefine && Q(t.encodeDefine),
  8652. this.startIndex = t.startIndex || 0,
  8653. this.dimensionsDetectCount = t.dimensionsDetectCount
  8654. }
  8655. Uu.seriesDataToSource = function(t) {
  8656. return new Uu({
  8657. data: t,
  8658. sourceFormat: V(t) ? Wu : zu,
  8659. fromDataset: !1
  8660. })
  8661. }
  8662. ,
  8663. ra(Uu);
  8664. var Xu = {
  8665. Must: 1,
  8666. Might: 2,
  8667. Not: 3
  8668. }
  8669. , Yu = jo();
  8670. function ju(t) {
  8671. var e = t.option
  8672. , i = e.data
  8673. , n = V(i) ? Wu : zu
  8674. , o = !1
  8675. , a = e.seriesLayoutBy
  8676. , r = e.sourceHeader
  8677. , s = e.dimensions
  8678. , l = Qu(t);
  8679. if (l) {
  8680. var u = l.option;
  8681. i = u.source,
  8682. n = Yu(l).sourceFormat,
  8683. o = !0,
  8684. a = a || u.seriesLayoutBy,
  8685. null == r && (r = u.sourceHeader),
  8686. s = s || u.dimensions
  8687. }
  8688. var h = function(t, e, i, n, o) {
  8689. if (!t)
  8690. return {
  8691. dimensionsDefine: qu(o)
  8692. };
  8693. var a, r;
  8694. if (e === Bu)
  8695. "auto" === n || null == n ? Ku(function(t) {
  8696. null != t && "-" !== t && (R(t) ? null == r && (r = 1) : r = 0)
  8697. }, i, t, 10) : r = n ? 1 : 0,
  8698. o || 1 !== r || (o = [],
  8699. Ku(function(t, e) {
  8700. o[e] = null != t ? t : ""
  8701. }, i, t)),
  8702. a = o ? o.length : i === Zu ? t.length : t[0] ? t[0].length : null;
  8703. else if (e === Vu)
  8704. o = o || function(t) {
  8705. var e, i = 0;
  8706. for (; i < t.length && !(e = t[i++]); )
  8707. ;
  8708. if (e) {
  8709. var n = [];
  8710. return E(e, function(t, e) {
  8711. n.push(e)
  8712. }),
  8713. n
  8714. }
  8715. }(t);
  8716. else if (e === Gu)
  8717. o || (o = [],
  8718. E(t, function(t, e) {
  8719. o.push(e)
  8720. }));
  8721. else if (e === zu) {
  8722. var s = Wo(t[0]);
  8723. a = L(s) && s.length || 1
  8724. }
  8725. return {
  8726. startIndex: r,
  8727. dimensionsDefine: qu(o),
  8728. dimensionsDetectCount: a
  8729. }
  8730. }(i, n, a, r, s);
  8731. Yu(t).source = new Uu({
  8732. data: i,
  8733. fromDataset: o,
  8734. seriesLayoutBy: a,
  8735. sourceFormat: n,
  8736. dimensionsDefine: h.dimensionsDefine,
  8737. startIndex: h.startIndex,
  8738. dimensionsDetectCount: h.dimensionsDetectCount,
  8739. encodeDefine: e.encode
  8740. })
  8741. }
  8742. function qu(t) {
  8743. if (t) {
  8744. var n = Q();
  8745. return O(t, function(t, e) {
  8746. if (null == (t = P({}, z(t) ? t : {
  8747. name: t
  8748. })).name)
  8749. return t;
  8750. t.name += "",
  8751. null == t.displayName && (t.displayName = t.name);
  8752. var i = n.get(t.name);
  8753. return i ? t.name += "-" + i.count++ : n.set(t.name, {
  8754. count: 1
  8755. }),
  8756. t
  8757. })
  8758. }
  8759. }
  8760. function Ku(t, e, i, n) {
  8761. if (null == n && (n = 1 / 0),
  8762. e === Zu)
  8763. for (var o = 0; o < i.length && o < n; o++)
  8764. t(i[o] ? i[o][0] : null, o);
  8765. else {
  8766. var a = i[0] || [];
  8767. for (o = 0; o < a.length && o < n; o++)
  8768. t(a[o], o)
  8769. }
  8770. }
  8771. function $u(i, t, e) {
  8772. var a = {}
  8773. , n = Qu(t);
  8774. if (!n || !i)
  8775. return a;
  8776. var r, o, s = [], l = [], u = t.ecModel, h = Yu(u).datasetMap, c = n.uid + "_" + e.seriesLayoutBy;
  8777. E(i = i.slice(), function(t, e) {
  8778. z(t) || (i[e] = {
  8779. name: t
  8780. }),
  8781. "ordinal" === t.type && null == r && (o = p(i[r = e])),
  8782. a[t.name] = []
  8783. });
  8784. var d = h.get(c) || h.set(c, {
  8785. categoryWayDim: o,
  8786. valueWayDim: 0
  8787. });
  8788. function f(t, e, i) {
  8789. for (var n = 0; n < i; n++)
  8790. t.push(e + n)
  8791. }
  8792. function p(t) {
  8793. var e = t.dimsDef;
  8794. return e ? e.length : 1
  8795. }
  8796. return E(i, function(t, e) {
  8797. var i = t.name
  8798. , n = p(t);
  8799. if (null == r) {
  8800. var o = d.valueWayDim;
  8801. f(a[i], o, n),
  8802. f(l, o, n),
  8803. d.valueWayDim += n
  8804. } else if (r === e)
  8805. f(a[i], 0, n),
  8806. f(s, 0, n);
  8807. else {
  8808. o = d.categoryWayDim;
  8809. f(a[i], o, n),
  8810. f(l, o, n),
  8811. d.categoryWayDim += n
  8812. }
  8813. }),
  8814. s.length && (a.itemName = s),
  8815. l.length && (a.seriesName = l),
  8816. a
  8817. }
  8818. function Ju(t, l, u) {
  8819. var e = {};
  8820. if (!Qu(t))
  8821. return e;
  8822. var h, c = l.sourceFormat, d = l.dimensionsDefine;
  8823. c !== Vu && c !== Gu || E(d, function(t, e) {
  8824. "name" === (z(t) ? t.name : t) && (h = e)
  8825. });
  8826. var i = function() {
  8827. for (var t = {}, e = {}, i = [], n = 0, o = Math.min(5, u); n < o; n++) {
  8828. var a = th(l.data, c, l.seriesLayoutBy, d, l.startIndex, n);
  8829. i.push(a);
  8830. var r = a === Xu.Not;
  8831. if (r && null == t.v && n !== h && (t.v = n),
  8832. null != t.n && t.n !== t.v && (r || i[t.n] !== Xu.Not) || (t.n = n),
  8833. s(t) && i[t.n] !== Xu.Not)
  8834. return t;
  8835. r || (a === Xu.Might && null == e.v && n !== h && (e.v = n),
  8836. null != e.n && e.n !== e.v || (e.n = n))
  8837. }
  8838. function s(t) {
  8839. return null != t.v && null != t.n
  8840. }
  8841. return s(t) ? t : s(e) ? e : null
  8842. }();
  8843. if (i) {
  8844. e.value = i.v;
  8845. var n = null != h ? h : i.n;
  8846. e.itemName = [n],
  8847. e.seriesName = [n]
  8848. }
  8849. return e
  8850. }
  8851. function Qu(t) {
  8852. var e = t.option;
  8853. if (!e.data)
  8854. return t.ecModel.getComponent("dataset", e.datasetIndex || 0)
  8855. }
  8856. function th(t, e, i, n, o, a) {
  8857. var r, s, l;
  8858. if (V(t))
  8859. return Xu.Not;
  8860. if (n) {
  8861. var u = n[a];
  8862. z(u) ? (s = u.name,
  8863. l = u.type) : R(u) && (s = u)
  8864. }
  8865. if (null != l)
  8866. return "ordinal" === l ? Xu.Must : Xu.Not;
  8867. if (e === Bu)
  8868. if (i === Zu) {
  8869. for (var h = t[a], c = 0; c < (h || []).length && c < 5; c++)
  8870. if (null != (r = g(h[o + c])))
  8871. return r
  8872. } else
  8873. for (c = 0; c < t.length && c < 5; c++) {
  8874. var d = t[o + c];
  8875. if (d && null != (r = g(d[a])))
  8876. return r
  8877. }
  8878. else if (e === Vu) {
  8879. if (!s)
  8880. return Xu.Not;
  8881. for (c = 0; c < t.length && c < 5; c++) {
  8882. if ((f = t[c]) && null != (r = g(f[s])))
  8883. return r
  8884. }
  8885. } else if (e === Gu) {
  8886. if (!s)
  8887. return Xu.Not;
  8888. if (!(h = t[s]) || V(h))
  8889. return Xu.Not;
  8890. for (c = 0; c < h.length && c < 5; c++)
  8891. if (null != (r = g(h[c])))
  8892. return r
  8893. } else if (e === zu)
  8894. for (c = 0; c < t.length && c < 5; c++) {
  8895. var f, p = Wo(f = t[c]);
  8896. if (!L(p))
  8897. return Xu.Not;
  8898. if (null != (r = g(p[a])))
  8899. return r
  8900. }
  8901. function g(t) {
  8902. var e = R(t);
  8903. return null != t && isFinite(t) && "" !== t ? e ? Xu.Might : Xu.Not : e && "-" !== t ? Xu.Must : void 0
  8904. }
  8905. return Xu.Not
  8906. }
  8907. var eh = "\0_ec_inner"
  8908. , ih = Cl.extend({
  8909. init: function(t, e, i, n) {
  8910. i = i || {},
  8911. this.option = null,
  8912. this._theme = new Cl(i),
  8913. this._optionManager = n
  8914. },
  8915. setOption: function(t, e) {
  8916. Y(!(eh in t), "please use chart.getOption()"),
  8917. this._optionManager.setOption(t, e),
  8918. this.resetOption(null)
  8919. },
  8920. resetOption: function(t) {
  8921. var e = !1
  8922. , i = this._optionManager;
  8923. if (!t || "recreate" === t) {
  8924. var n = i.mountOption("recreate" === t);
  8925. this.option && "recreate" !== t ? (this.restoreData(),
  8926. this.mergeOption(n)) : function(t) {
  8927. t = t,
  8928. this.option = {},
  8929. this.option[eh] = 1,
  8930. this._componentsMap = Q({
  8931. series: []
  8932. }),
  8933. this._seriesIndices,
  8934. this._seriesIndicesMap,
  8935. function(i, t) {
  8936. var n = i.color && !i.colorLayer;
  8937. E(t, function(t, e) {
  8938. "colorLayer" === e && n || ku.hasClass(e) || ("object" == typeof t ? i[e] = i[e] ? m(i[e], t, !1) : k(t) : null == i[e] && (i[e] = t))
  8939. })
  8940. }(t, this._theme.option),
  8941. m(t, Ou, !1),
  8942. this.mergeOption(t)
  8943. }
  8944. .call(this, n),
  8945. e = !0
  8946. }
  8947. if ("timeline" !== t && "media" !== t || this.restoreData(),
  8948. !t || "recreate" === t || "timeline" === t) {
  8949. var o = i.getTimelineOption(this);
  8950. o && (this.mergeOption(o),
  8951. e = !0)
  8952. }
  8953. if (!t || "recreate" === t || "media" === t) {
  8954. var a = i.getMediaOption(this, this._api);
  8955. a.length && E(a, function(t) {
  8956. this.mergeOption(t, e = !0)
  8957. }, this)
  8958. }
  8959. return e
  8960. },
  8961. mergeOption: function(n) {
  8962. var l = this.option
  8963. , u = this._componentsMap
  8964. , i = [];
  8965. !function(t) {
  8966. Yu(t).datasetMap = Q()
  8967. }(this),
  8968. E(n, function(t, e) {
  8969. null != t && (ku.hasClass(e) ? e && i.push(e) : l[e] = null == l[e] ? k(t) : m(l[e], t, !0))
  8970. }),
  8971. ku.topologicalTravel(i, ku.getAllClassMainTypes(), function(r, t) {
  8972. var e = Vo(n[r])
  8973. , i = Ho(u.get(r), e);
  8974. Zo(i),
  8975. E(i, function(t, e) {
  8976. var i = t.option;
  8977. z(i) && (t.keyInfo.mainType = r,
  8978. t.keyInfo.subType = function(t, e, i) {
  8979. return e.type ? e.type : i ? i.subType : ku.determineSubType(t, e)
  8980. }(r, i, t.exist))
  8981. });
  8982. var s = function(e, t) {
  8983. L(t) || (t = t ? [t] : []);
  8984. var i = {};
  8985. return E(t, function(t) {
  8986. i[t] = (e.get(t) || []).slice()
  8987. }),
  8988. i
  8989. }(u, t);
  8990. l[r] = [],
  8991. u.set(r, []),
  8992. E(i, function(t, e) {
  8993. var i = t.exist
  8994. , n = t.option;
  8995. if (Y(z(n) || i, "Empty component definition"),
  8996. n) {
  8997. var o = ku.getClass(r, t.keyInfo.subType, !0);
  8998. if (i && i.constructor === o)
  8999. i.name = t.keyInfo.name,
  9000. i.mergeOption(n, this),
  9001. i.optionUpdated(n, !1);
  9002. else {
  9003. var a = P({
  9004. dependentModels: s,
  9005. componentIndex: e
  9006. }, t.keyInfo);
  9007. P(i = new o(n,this,this,a), a),
  9008. i.init(n, this, this, a),
  9009. i.optionUpdated(null, !0)
  9010. }
  9011. } else
  9012. i.mergeOption({}, this),
  9013. i.optionUpdated({}, !1);
  9014. u.get(r)[e] = i,
  9015. l[r][e] = i.option
  9016. }, this),
  9017. "series" === r && nh(this, u.get("series"))
  9018. }, this),
  9019. this._seriesIndicesMap = Q(this._seriesIndices = this._seriesIndices || [])
  9020. },
  9021. getOption: function() {
  9022. var n = k(this.option);
  9023. return E(n, function(t, e) {
  9024. if (ku.hasClass(e)) {
  9025. for (var i = (t = Vo(t)).length - 1; 0 <= i; i--)
  9026. Xo(t[i]) && t.splice(i, 1);
  9027. n[e] = t
  9028. }
  9029. }),
  9030. delete n[eh],
  9031. n
  9032. },
  9033. getTheme: function() {
  9034. return this._theme
  9035. },
  9036. getComponent: function(t, e) {
  9037. var i = this._componentsMap.get(t);
  9038. if (i)
  9039. return i[e || 0]
  9040. },
  9041. queryComponents: function(t) {
  9042. var e = t.mainType;
  9043. if (!e)
  9044. return [];
  9045. var i, n = t.index, o = t.id, a = t.name, r = this._componentsMap.get(e);
  9046. if (!r || !r.length)
  9047. return [];
  9048. if (null != n)
  9049. L(n) || (n = [n]),
  9050. i = M(O(n, function(t) {
  9051. return r[t]
  9052. }), function(t) {
  9053. return !!t
  9054. });
  9055. else if (null != o) {
  9056. var s = L(o);
  9057. i = M(r, function(t) {
  9058. return s && 0 <= _(o, t.id) || !s && t.id === o
  9059. })
  9060. } else if (null != a) {
  9061. var l = L(a);
  9062. i = M(r, function(t) {
  9063. return l && 0 <= _(a, t.name) || !l && t.name === a
  9064. })
  9065. } else
  9066. i = r.slice();
  9067. return oh(i, t)
  9068. },
  9069. findComponents: function(t) {
  9070. var e, i, n, o, a, r = t.query, s = t.mainType, l = (i = s + "Index",
  9071. n = s + "Id",
  9072. o = s + "Name",
  9073. !(e = r) || null == e[i] && null == e[n] && null == e[o] ? null : {
  9074. mainType: s,
  9075. index: e[i],
  9076. id: e[n],
  9077. name: e[o]
  9078. }), u = l ? this.queryComponents(l) : this._componentsMap.get(s);
  9079. return a = oh(u, t),
  9080. t.filter ? M(a, t.filter) : a
  9081. },
  9082. eachComponent: function(t, n, o) {
  9083. var e = this._componentsMap;
  9084. if ("function" == typeof t)
  9085. o = n,
  9086. n = t,
  9087. e.each(function(t, i) {
  9088. E(t, function(t, e) {
  9089. n.call(o, i, t, e)
  9090. })
  9091. });
  9092. else if (R(t))
  9093. E(e.get(t), n, o);
  9094. else if (z(t)) {
  9095. E(this.findComponents(t), n, o)
  9096. }
  9097. },
  9098. getSeriesByName: function(e) {
  9099. return M(this._componentsMap.get("series"), function(t) {
  9100. return t.name === e
  9101. })
  9102. },
  9103. getSeriesByIndex: function(t) {
  9104. return this._componentsMap.get("series")[t]
  9105. },
  9106. getSeriesByType: function(e) {
  9107. return M(this._componentsMap.get("series"), function(t) {
  9108. return t.subType === e
  9109. })
  9110. },
  9111. getSeries: function() {
  9112. return this._componentsMap.get("series").slice()
  9113. },
  9114. getSeriesCount: function() {
  9115. return this._componentsMap.get("series").length
  9116. },
  9117. eachSeries: function(i, n) {
  9118. E(this._seriesIndices, function(t) {
  9119. var e = this._componentsMap.get("series")[t];
  9120. i.call(n, e, t)
  9121. }, this)
  9122. },
  9123. eachRawSeries: function(t, e) {
  9124. E(this._componentsMap.get("series"), t, e)
  9125. },
  9126. eachSeriesByType: function(i, n, o) {
  9127. E(this._seriesIndices, function(t) {
  9128. var e = this._componentsMap.get("series")[t];
  9129. e.subType === i && n.call(o, e, t)
  9130. }, this)
  9131. },
  9132. eachRawSeriesByType: function(t, e, i) {
  9133. return E(this.getSeriesByType(t), e, i)
  9134. },
  9135. isSeriesFiltered: function(t) {
  9136. return null == this._seriesIndicesMap.get(t.componentIndex)
  9137. },
  9138. getCurrentSeriesIndices: function() {
  9139. return (this._seriesIndices || []).slice()
  9140. },
  9141. filterSeries: function(t, e) {
  9142. var i = M(this._componentsMap.get("series"), t, e);
  9143. nh(this, i)
  9144. },
  9145. restoreData: function(i) {
  9146. var n = this._componentsMap;
  9147. nh(this, n.get("series"));
  9148. var o = [];
  9149. n.each(function(t, e) {
  9150. o.push(e)
  9151. }),
  9152. ku.topologicalTravel(o, ku.getAllClassMainTypes(), function(e, t) {
  9153. E(n.get(e), function(t) {
  9154. "series" === e && function(t, e) {
  9155. if (e) {
  9156. var i = e.seiresIndex
  9157. , n = e.seriesId
  9158. , o = e.seriesName;
  9159. return null != i && t.componentIndex !== i || null != n && t.id !== n || null != o && t.name !== o
  9160. }
  9161. }(t, i) || t.restoreData()
  9162. })
  9163. })
  9164. }
  9165. });
  9166. function nh(t, e) {
  9167. t._seriesIndicesMap = Q(t._seriesIndices = O(e, function(t) {
  9168. return t.componentIndex
  9169. }) || [])
  9170. }
  9171. function oh(t, e) {
  9172. return e.hasOwnProperty("subType") ? M(t, function(t) {
  9173. return t.subType === e.subType
  9174. }) : t
  9175. }
  9176. b(ih, Ru);
  9177. var ah = ["getDom", "getZr", "getWidth", "getHeight", "getDevicePixelRatio", "dispatchAction", "isDisposed", "on", "off", "getDataURL", "getConnectedDataURL", "getModel", "getOption", "getViewOfComponentModel", "getViewOfSeriesModel"];
  9178. function rh(e) {
  9179. E(ah, function(t) {
  9180. this[t] = A(e[t], e)
  9181. }, this)
  9182. }
  9183. var sh = {};
  9184. function lh() {
  9185. this._coordinateSystems = []
  9186. }
  9187. lh.prototype = {
  9188. constructor: lh,
  9189. create: function(n, o) {
  9190. var a = [];
  9191. E(sh, function(t, e) {
  9192. var i = t.create(n, o);
  9193. a = a.concat(i || [])
  9194. }),
  9195. this._coordinateSystems = a
  9196. },
  9197. update: function(e, i) {
  9198. E(this._coordinateSystems, function(t) {
  9199. t.update && t.update(e, i)
  9200. })
  9201. },
  9202. getCoordinateSystems: function() {
  9203. return this._coordinateSystems.slice()
  9204. }
  9205. },
  9206. lh.register = function(t, e) {
  9207. sh[t] = e
  9208. }
  9209. ,
  9210. lh.get = function(t) {
  9211. return sh[t]
  9212. }
  9213. ;
  9214. var uh = E
  9215. , hh = k
  9216. , ch = O
  9217. , dh = m
  9218. , fh = /^(min|max)?(.+)$/;
  9219. function ph(t) {
  9220. this._api = t,
  9221. this._timelineOptions = [],
  9222. this._mediaList = [],
  9223. this._mediaDefault,
  9224. this._currentMediaIndices = [],
  9225. this._optionBackup,
  9226. this._newBaseOption
  9227. }
  9228. function gh(t, e, i) {
  9229. var a = {
  9230. width: e,
  9231. height: i,
  9232. aspectratio: e / i
  9233. }
  9234. , r = !0;
  9235. return E(t, function(t, e) {
  9236. var i = e.match(fh);
  9237. if (i && i[1] && i[2]) {
  9238. var n = i[1]
  9239. , o = i[2].toLowerCase();
  9240. !function(t, e, i) {
  9241. return "min" === i ? e <= t : "max" === i ? t <= e : t === e
  9242. }(a[o], t, n) && (r = !1)
  9243. }
  9244. }),
  9245. r
  9246. }
  9247. ph.prototype = {
  9248. constructor: ph,
  9249. setOption: function(t, e) {
  9250. t && E(Vo(t.series), function(t) {
  9251. t && t.data && V(t.data) && K(t.data)
  9252. }),
  9253. t = hh(t);
  9254. var i = this._optionBackup
  9255. , n = function(t, i, n) {
  9256. var e, o, a = [], r = [], s = t.timeline;
  9257. t.baseOption && (o = t.baseOption);
  9258. (s || t.options) && (o = o || {},
  9259. a = (t.options || []).slice());
  9260. if (t.media) {
  9261. o = o || {};
  9262. var l = t.media;
  9263. uh(l, function(t) {
  9264. t && t.option && (t.query ? r.push(t) : e = e || t)
  9265. })
  9266. }
  9267. o = o || t;
  9268. o.timeline || (o.timeline = s);
  9269. return uh([o].concat(a).concat(O(r, function(t) {
  9270. return t.option
  9271. })), function(e) {
  9272. uh(i, function(t) {
  9273. t(e, n)
  9274. })
  9275. }),
  9276. {
  9277. baseOption: o,
  9278. timelineOptions: a,
  9279. mediaDefault: e,
  9280. mediaList: r
  9281. }
  9282. }
  9283. .call(this, t, e, !i);
  9284. this._newBaseOption = n.baseOption,
  9285. i ? (function(o, t) {
  9286. uh(t = t || {}, function(t, e) {
  9287. if (null != t) {
  9288. var i = o[e];
  9289. if (ku.hasClass(e)) {
  9290. t = Vo(t);
  9291. var n = Ho(i = Vo(i), t);
  9292. o[e] = ch(n, function(t) {
  9293. return t.option && t.exist ? dh(t.exist, t.option, !0) : t.exist || t.option
  9294. })
  9295. } else
  9296. o[e] = dh(i, t, !0)
  9297. }
  9298. })
  9299. }(i.baseOption, n.baseOption),
  9300. n.timelineOptions.length && (i.timelineOptions = n.timelineOptions),
  9301. n.mediaList.length && (i.mediaList = n.mediaList),
  9302. n.mediaDefault && (i.mediaDefault = n.mediaDefault)) : this._optionBackup = n
  9303. },
  9304. mountOption: function(t) {
  9305. var e = this._optionBackup;
  9306. return this._timelineOptions = ch(e.timelineOptions, hh),
  9307. this._mediaList = ch(e.mediaList, hh),
  9308. this._mediaDefault = hh(e.mediaDefault),
  9309. this._currentMediaIndices = [],
  9310. hh(t ? e.baseOption : this._newBaseOption)
  9311. },
  9312. getTimelineOption: function(t) {
  9313. var e, i = this._timelineOptions;
  9314. if (i.length) {
  9315. var n = t.getComponent("timeline");
  9316. n && (e = hh(i[n.getCurrentIndex()], !0))
  9317. }
  9318. return e
  9319. },
  9320. getMediaOption: function(t) {
  9321. var e = this._api.getWidth()
  9322. , i = this._api.getHeight()
  9323. , n = this._mediaList
  9324. , o = this._mediaDefault
  9325. , a = []
  9326. , r = [];
  9327. if (!n.length && !o)
  9328. return r;
  9329. for (var s = 0, l = n.length; s < l; s++)
  9330. gh(n[s].query, e, i) && a.push(s);
  9331. return !a.length && o && (a = [-1]),
  9332. a.length && !function(t, e) {
  9333. return t.join(",") === e.join(",")
  9334. }(a, this._currentMediaIndices) && (r = ch(a, function(t) {
  9335. return hh(-1 === t ? o.option : n[t].option)
  9336. })),
  9337. this._currentMediaIndices = a,
  9338. r
  9339. }
  9340. };
  9341. var mh = E
  9342. , vh = z
  9343. , yh = ["areaStyle", "lineStyle", "nodeStyle", "linkStyle", "chordStyle", "label", "labelLine"];
  9344. function xh(t) {
  9345. var e = t && t.itemStyle;
  9346. if (e)
  9347. for (var i = 0, n = yh.length; i < n; i++) {
  9348. var o = yh[i]
  9349. , a = e.normal
  9350. , r = e.emphasis;
  9351. a && a[o] && (t[o] = t[o] || {},
  9352. t[o].normal ? m(t[o].normal, a[o]) : t[o].normal = a[o],
  9353. a[o] = null),
  9354. r && r[o] && (t[o] = t[o] || {},
  9355. t[o].emphasis ? m(t[o].emphasis, r[o]) : t[o].emphasis = r[o],
  9356. r[o] = null)
  9357. }
  9358. }
  9359. function _h(t, e, i) {
  9360. if (t && t[e] && (t[e].normal || t[e].emphasis)) {
  9361. var n = t[e].normal
  9362. , o = t[e].emphasis;
  9363. n && (i ? (t[e].normal = t[e].emphasis = null,
  9364. D(t[e], n)) : t[e] = n),
  9365. o && (t.emphasis = t.emphasis || {},
  9366. t.emphasis[e] = o)
  9367. }
  9368. }
  9369. function wh(t) {
  9370. _h(t, "itemStyle"),
  9371. _h(t, "lineStyle"),
  9372. _h(t, "areaStyle"),
  9373. _h(t, "label"),
  9374. _h(t, "labelLine"),
  9375. _h(t, "upperLabel"),
  9376. _h(t, "edgeLabel")
  9377. }
  9378. function bh(t, e) {
  9379. var i = vh(t) && t[e]
  9380. , n = vh(i) && i.textStyle;
  9381. if (n)
  9382. for (var o = 0, a = Fo.length; o < a; o++) {
  9383. e = Fo[o];
  9384. n.hasOwnProperty(e) && (i[e] = n[e])
  9385. }
  9386. }
  9387. function Sh(t) {
  9388. t && (wh(t),
  9389. bh(t, "label"),
  9390. t.emphasis && bh(t.emphasis, "label"))
  9391. }
  9392. function Mh(t) {
  9393. return L(t) ? t : t ? [t] : []
  9394. }
  9395. function Ih(t) {
  9396. return (L(t) ? t[0] : t) || {}
  9397. }
  9398. function Th(e, t) {
  9399. mh(Mh(e.series), function(t) {
  9400. vh(t) && function(t) {
  9401. if (vh(t)) {
  9402. xh(t),
  9403. wh(t),
  9404. bh(t, "label"),
  9405. bh(t, "upperLabel"),
  9406. bh(t, "edgeLabel"),
  9407. t.emphasis && (bh(t.emphasis, "label"),
  9408. bh(t.emphasis, "upperLabel"),
  9409. bh(t.emphasis, "edgeLabel")),
  9410. (i = t.markPoint) && (xh(i),
  9411. Sh(i)),
  9412. (n = t.markLine) && (xh(n),
  9413. Sh(n));
  9414. var e = t.markArea;
  9415. e && Sh(e);
  9416. var i, n, o = t.data;
  9417. if ("graph" === t.type) {
  9418. o = o || t.nodes;
  9419. var a = t.links || t.edges;
  9420. if (a && !V(a))
  9421. for (var r = 0; r < a.length; r++)
  9422. Sh(a[r]);
  9423. E(t.categories, function(t) {
  9424. wh(t)
  9425. })
  9426. }
  9427. if (o && !V(o))
  9428. for (r = 0; r < o.length; r++)
  9429. Sh(o[r]);
  9430. if ((i = t.markPoint) && i.data) {
  9431. var s = i.data;
  9432. for (r = 0; r < s.length; r++)
  9433. Sh(s[r])
  9434. }
  9435. if ((n = t.markLine) && n.data) {
  9436. var l = n.data;
  9437. for (r = 0; r < l.length; r++)
  9438. L(l[r]) ? (Sh(l[r][0]),
  9439. Sh(l[r][1])) : Sh(l[r])
  9440. }
  9441. "gauge" === t.type ? (bh(t, "axisLabel"),
  9442. bh(t, "title"),
  9443. bh(t, "detail")) : "treemap" === t.type ? (_h(t.breadcrumb, "itemStyle"),
  9444. E(t.levels, function(t) {
  9445. wh(t)
  9446. })) : "tree" === t.type && wh(t.leaves)
  9447. }
  9448. }(t)
  9449. });
  9450. var i = ["xAxis", "yAxis", "radiusAxis", "angleAxis", "singleAxis", "parallelAxis", "radar"];
  9451. t && i.push("valueAxis", "categoryAxis", "logAxis", "timeAxis"),
  9452. mh(i, function(t) {
  9453. mh(Mh(e[t]), function(t) {
  9454. t && (bh(t, "axisLabel"),
  9455. bh(t.axisPointer, "label"))
  9456. })
  9457. }),
  9458. mh(Mh(e.parallel), function(t) {
  9459. var e = t && t.parallelAxisDefault;
  9460. bh(e, "axisLabel"),
  9461. bh(e && e.axisPointer, "label")
  9462. }),
  9463. mh(Mh(e.calendar), function(t) {
  9464. _h(t, "itemStyle"),
  9465. bh(t, "dayLabel"),
  9466. bh(t, "monthLabel"),
  9467. bh(t, "yearLabel")
  9468. }),
  9469. mh(Mh(e.radar), function(t) {
  9470. bh(t, "name")
  9471. }),
  9472. mh(Mh(e.geo), function(t) {
  9473. vh(t) && (Sh(t),
  9474. mh(Mh(t.regions), function(t) {
  9475. Sh(t)
  9476. }))
  9477. }),
  9478. mh(Mh(e.timeline), function(t) {
  9479. Sh(t),
  9480. _h(t, "label"),
  9481. _h(t, "itemStyle"),
  9482. _h(t, "controlStyle", !0);
  9483. var e = t.data;
  9484. L(e) && E(e, function(t) {
  9485. z(t) && (_h(t, "label"),
  9486. _h(t, "itemStyle"))
  9487. })
  9488. }),
  9489. mh(Mh(e.toolbox), function(t) {
  9490. _h(t, "iconStyle"),
  9491. mh(t.feature, function(t) {
  9492. _h(t, "iconStyle")
  9493. })
  9494. }),
  9495. bh(Ih(e.axisPointer), "label"),
  9496. bh(Ih(e.tooltip).axisPointer, "label")
  9497. }
  9498. function Ah(e) {
  9499. E(Dh, function(t) {
  9500. t[0]in e && !(t[1]in e) && (e[t[1]] = e[t[0]])
  9501. })
  9502. }
  9503. var Dh = [["x", "left"], ["y", "top"], ["x2", "right"], ["y2", "bottom"]]
  9504. , Ch = ["grid", "geo", "parallel", "legend", "toolbox", "title", "visualMap", "dataZoom", "timeline"]
  9505. , Lh = function(i, t) {
  9506. Th(i, t),
  9507. i.series = Vo(i.series),
  9508. E(i.series, function(t) {
  9509. if (z(t)) {
  9510. var e = t.type;
  9511. if ("line" === e)
  9512. null != t.clipOverflow && (t.clip = t.clipOverflow);
  9513. else if ("pie" === e || "gauge" === e)
  9514. null != t.clockWise && (t.clockwise = t.clockWise);
  9515. else if ("gauge" === e) {
  9516. var i = function(t, e) {
  9517. e = e.split(",");
  9518. for (var i = t, n = 0; n < e.length && null != (i = i && i[e[n]]); n++)
  9519. ;
  9520. return i
  9521. }(t, "pointer.color");
  9522. null != i && function(t, e, i, n) {
  9523. e = e.split(",");
  9524. for (var o, a = t, r = 0; r < e.length - 1; r++)
  9525. null == a[o = e[r]] && (a[o] = {}),
  9526. a = a[o];
  9527. !n && null != a[e[r]] || (a[e[r]] = i)
  9528. }(t, "itemStyle.color", i)
  9529. }
  9530. Ah(t)
  9531. }
  9532. }),
  9533. i.dataRange && (i.visualMap = i.dataRange),
  9534. E(Ch, function(t) {
  9535. var e = i[t];
  9536. e && (L(e) || (e = [e]),
  9537. E(e, function(t) {
  9538. Ah(t)
  9539. }))
  9540. })
  9541. };
  9542. function kh(m) {
  9543. E(m, function(h, c) {
  9544. var d = []
  9545. , f = [NaN, NaN]
  9546. , t = [h.stackResultDimension, h.stackedOverDimension]
  9547. , p = h.data
  9548. , g = h.isStackedByIndex
  9549. , e = p.map(t, function(t, e, i) {
  9550. var n, o, a = p.get(h.stackedDimension, i);
  9551. if (isNaN(a))
  9552. return f;
  9553. g ? o = p.getRawIndex(i) : n = p.get(h.stackedByDimension, i);
  9554. for (var r = NaN, s = c - 1; 0 <= s; s--) {
  9555. var l = m[s];
  9556. if (g || (o = l.data.rawIndexOf(l.stackedByDimension, n)),
  9557. 0 <= o) {
  9558. var u = l.data.getByRawIndex(l.stackResultDimension, o);
  9559. if (0 <= a && 0 < u || a <= 0 && u < 0) {
  9560. a += u,
  9561. r = u;
  9562. break
  9563. }
  9564. }
  9565. }
  9566. return d[0] = a,
  9567. d[1] = r,
  9568. d
  9569. });
  9570. p.hostModel.setData(e),
  9571. h.data = e
  9572. })
  9573. }
  9574. function Ph(t, e) {
  9575. Uu.isInstance(t) || (t = Uu.seriesDataToSource(t)),
  9576. this._source = t;
  9577. var i = this._data = t.data
  9578. , n = t.sourceFormat;
  9579. n === Wu && (this._offset = 0,
  9580. this._dimSize = e,
  9581. this._data = i),
  9582. P(this, Oh[n === Bu ? n + "_" + t.seriesLayoutBy : n])
  9583. }
  9584. var Nh = Ph.prototype;
  9585. Nh.pure = !1;
  9586. var Oh = {
  9587. arrayRows_column: {
  9588. pure: Nh.persistent = !0,
  9589. count: function() {
  9590. return Math.max(0, this._data.length - this._source.startIndex)
  9591. },
  9592. getItem: function(t) {
  9593. return this._data[t + this._source.startIndex]
  9594. },
  9595. appendData: zh
  9596. },
  9597. arrayRows_row: {
  9598. pure: !0,
  9599. count: function() {
  9600. var t = this._data[0];
  9601. return t ? Math.max(0, t.length - this._source.startIndex) : 0
  9602. },
  9603. getItem: function(t) {
  9604. t += this._source.startIndex;
  9605. for (var e = [], i = this._data, n = 0; n < i.length; n++) {
  9606. var o = i[n];
  9607. e.push(o ? o[t] : null)
  9608. }
  9609. return e
  9610. },
  9611. appendData: function() {
  9612. throw new Error('Do not support appendData when set seriesLayoutBy: "row".')
  9613. }
  9614. },
  9615. objectRows: {
  9616. pure: !0,
  9617. count: Eh,
  9618. getItem: Rh,
  9619. appendData: zh
  9620. },
  9621. keyedColumns: {
  9622. pure: !0,
  9623. count: function() {
  9624. var t = this._source.dimensionsDefine[0].name
  9625. , e = this._data[t];
  9626. return e ? e.length : 0
  9627. },
  9628. getItem: function(t) {
  9629. for (var e = [], i = this._source.dimensionsDefine, n = 0; n < i.length; n++) {
  9630. var o = this._data[i[n].name];
  9631. e.push(o ? o[t] : null)
  9632. }
  9633. return e
  9634. },
  9635. appendData: function(t) {
  9636. var o = this._data;
  9637. E(t, function(t, e) {
  9638. for (var i = o[e] || (o[e] = []), n = 0; n < (t || []).length; n++)
  9639. i.push(t[n])
  9640. })
  9641. }
  9642. },
  9643. original: {
  9644. count: Eh,
  9645. getItem: Rh,
  9646. appendData: zh
  9647. },
  9648. typedArray: {
  9649. persistent: !(Nh.getSource = function() {
  9650. return this._source
  9651. }
  9652. ),
  9653. pure: !0,
  9654. count: function() {
  9655. return this._data ? this._data.length / this._dimSize : 0
  9656. },
  9657. getItem: function(t, e) {
  9658. t -= this._offset,
  9659. e = e || [];
  9660. for (var i = this._dimSize * t, n = 0; n < this._dimSize; n++)
  9661. e[n] = this._data[i + n];
  9662. return e
  9663. },
  9664. appendData: function(t) {
  9665. this._data = t
  9666. },
  9667. clean: function() {
  9668. this._offset += this.count(),
  9669. this._data = null
  9670. }
  9671. }
  9672. };
  9673. function Eh() {
  9674. return this._data.length
  9675. }
  9676. function Rh(t) {
  9677. return this._data[t]
  9678. }
  9679. function zh(t) {
  9680. for (var e = 0; e < t.length; e++)
  9681. this._data.push(t[e])
  9682. }
  9683. var Bh = {
  9684. arrayRows: Vh,
  9685. objectRows: function(t, e, i, n) {
  9686. return null != i ? t[n] : t
  9687. },
  9688. keyedColumns: Vh,
  9689. original: function(t, e, i, n) {
  9690. var o = Wo(t);
  9691. return null != i && o instanceof Array ? o[i] : o
  9692. },
  9693. typedArray: Vh
  9694. };
  9695. function Vh(t, e, i, n) {
  9696. return null != i ? t[i] : t
  9697. }
  9698. var Gh = {
  9699. arrayRows: Fh,
  9700. objectRows: function(t, e, i, n) {
  9701. return Wh(t[e], this._dimensionInfos[e])
  9702. },
  9703. keyedColumns: Fh,
  9704. original: function(t, e, i, n) {
  9705. var o = t && (null == t.value ? t : t.value);
  9706. return !this._rawData.pure && function(t) {
  9707. return Ro(t) && !(t instanceof Array)
  9708. }(t) && (this.hasItemOption = !0),
  9709. Wh(o instanceof Array ? o[n] : o, this._dimensionInfos[e])
  9710. },
  9711. typedArray: function(t, e, i, n) {
  9712. return t[n]
  9713. }
  9714. };
  9715. function Fh(t, e, i, n) {
  9716. return Wh(t[n], this._dimensionInfos[e])
  9717. }
  9718. function Wh(t, e) {
  9719. var i = e && e.type;
  9720. if ("ordinal" !== i)
  9721. return "time" === i && "number" != typeof t && null != t && "-" !== t && (t = +Yl(t)),
  9722. null == t || "" === t ? NaN : +t;
  9723. var n = e && e.ordinalMeta;
  9724. return n ? n.parseAndCollect(t) : t
  9725. }
  9726. function Hh(t, e, i) {
  9727. if (t) {
  9728. var n = t.getRawDataItem(e);
  9729. if (null != n) {
  9730. var o, a, r = t.getProvider().getSource().sourceFormat, s = t.getDimensionInfo(i);
  9731. return s && (o = s.name,
  9732. a = s.index),
  9733. Bh[r](n, e, a, o)
  9734. }
  9735. }
  9736. }
  9737. function Zh(t, e, i) {
  9738. if (t) {
  9739. var n = t.getProvider().getSource().sourceFormat;
  9740. if (n === zu || n === Vu) {
  9741. var o = t.getRawDataItem(e);
  9742. return n !== zu || z(o) || (o = null),
  9743. o ? o[i] : void 0
  9744. }
  9745. }
  9746. }
  9747. var Uh = /\{@(.+?)\}/g
  9748. , Xh = {
  9749. getDataParams: function(t, e) {
  9750. var i = this.getData(e)
  9751. , n = this.getRawValue(t, e)
  9752. , o = i.getRawIndex(t)
  9753. , a = i.getName(t)
  9754. , r = i.getRawDataItem(t)
  9755. , s = i.getItemVisual(t, "color")
  9756. , l = i.getItemVisual(t, "borderColor")
  9757. , u = this.ecModel.getComponent("tooltip")
  9758. , h = Qo(u && u.get("renderMode"))
  9759. , c = this.mainType
  9760. , d = "series" === c
  9761. , f = i.userOutput;
  9762. return {
  9763. componentType: c,
  9764. componentSubType: this.subType,
  9765. componentIndex: this.componentIndex,
  9766. seriesType: d ? this.subType : null,
  9767. seriesIndex: this.seriesIndex,
  9768. seriesId: d ? this.id : null,
  9769. seriesName: d ? this.name : null,
  9770. name: a,
  9771. dataIndex: o,
  9772. data: r,
  9773. dataType: e,
  9774. value: n,
  9775. color: s,
  9776. borderColor: l,
  9777. dimensionNames: f ? f.dimensionNames : null,
  9778. encode: f ? f.encode : null,
  9779. marker: hu({
  9780. color: s,
  9781. renderMode: h
  9782. }),
  9783. $vars: ["seriesName", "name", "value"]
  9784. }
  9785. },
  9786. getFormattedLabel: function(n, t, e, i, o) {
  9787. t = t || "normal";
  9788. var a = this.getData(e)
  9789. , r = a.getItemModel(n)
  9790. , s = this.getDataParams(n, e);
  9791. null != i && s.value instanceof Array && (s.value = s.value[i]);
  9792. var l = r.get("normal" === t ? [o || "label", "formatter"] : [t, o || "label", "formatter"]);
  9793. return "function" == typeof l ? (s.status = t,
  9794. s.dimensionIndex = i,
  9795. l(s)) : "string" == typeof l ? lu(l, s).replace(Uh, function(t, e) {
  9796. var i = e.length;
  9797. return "[" === e.charAt(0) && "]" === e.charAt(i - 1) && (e = +e.slice(1, i - 1)),
  9798. Hh(a, n, e)
  9799. }) : void 0
  9800. },
  9801. getRawValue: function(t, e) {
  9802. return Hh(this.getData(e), t)
  9803. },
  9804. formatTooltip: function() {}
  9805. };
  9806. function Yh(t) {
  9807. return new jh(t)
  9808. }
  9809. function jh(t) {
  9810. t = t || {},
  9811. this._reset = t.reset,
  9812. this._plan = t.plan,
  9813. this._count = t.count,
  9814. this._onDirty = t.onDirty,
  9815. this._dirty = !0,
  9816. this.context
  9817. }
  9818. var qh = jh.prototype;
  9819. qh.perform = function(t) {
  9820. var e, i = this._upstream, n = t && t.skip;
  9821. if (this._dirty && i) {
  9822. var o = this.context;
  9823. o.data = o.outputData = i.context.outputData
  9824. }
  9825. this.__pipeline && (this.__pipeline.currentTask = this),
  9826. this._plan && !n && (e = this._plan(this.context));
  9827. var a, r = h(this._modBy), s = this._modDataCount || 0, l = h(t && t.modBy), u = t && t.modDataCount || 0;
  9828. function h(t) {
  9829. return 1 <= t || (t = 1),
  9830. t
  9831. }
  9832. r === l && s === u || (e = "reset"),
  9833. !this._dirty && "reset" !== e || (this._dirty = !1,
  9834. a = function(t, e) {
  9835. var i, n;
  9836. t._dueIndex = t._outputDueEnd = t._dueEnd = 0,
  9837. t._settedOutputEnd = null,
  9838. !e && t._reset && ((i = t._reset(t.context)) && i.progress && (n = i.forceFirstProgress,
  9839. i = i.progress),
  9840. L(i) && !i.length && (i = null));
  9841. t._progress = i,
  9842. t._modBy = t._modDataCount = null;
  9843. var o = t._downstream;
  9844. return o && o.dirty(),
  9845. n
  9846. }(this, n)),
  9847. this._modBy = l,
  9848. this._modDataCount = u;
  9849. var c = t && t.step;
  9850. if (this._dueEnd = i ? i._outputDueEnd : this._count ? this._count(this.context) : 1 / 0,
  9851. this._progress) {
  9852. var d = this._dueIndex
  9853. , f = Math.min(null != c ? this._dueIndex + c : 1 / 0, this._dueEnd);
  9854. if (!n && (a || d < f)) {
  9855. var p = this._progress;
  9856. if (L(p))
  9857. for (var g = 0; g < p.length; g++)
  9858. ac(this, p[g], d, f, l, u);
  9859. else
  9860. ac(this, p, d, f, l, u)
  9861. }
  9862. this._dueIndex = f;
  9863. var m = null != this._settedOutputEnd ? this._settedOutputEnd : f;
  9864. this._outputDueEnd = m
  9865. } else
  9866. this._dueIndex = this._outputDueEnd = null != this._settedOutputEnd ? this._settedOutputEnd : this._dueEnd;
  9867. return this.unfinished()
  9868. }
  9869. ;
  9870. var Kh, $h, Jh, Qh, tc, ec, ic = ec = {
  9871. reset: function(t, e, i, n) {
  9872. $h = t,
  9873. Kh = e,
  9874. Jh = i,
  9875. Qh = n,
  9876. tc = Math.ceil(Qh / Jh),
  9877. ec.next = 1 < Jh && 0 < Qh ? oc : nc
  9878. }
  9879. };
  9880. function nc() {
  9881. return $h < Kh ? $h++ : null
  9882. }
  9883. function oc() {
  9884. var t = $h % tc * Jh + Math.ceil($h / tc)
  9885. , e = Kh <= $h ? null : t < Qh ? t : $h;
  9886. return $h++,
  9887. e
  9888. }
  9889. function ac(t, e, i, n, o, a) {
  9890. ic.reset(i, n, o, a),
  9891. t._callingProgress = e,
  9892. t._callingProgress({
  9893. start: i,
  9894. end: n,
  9895. count: n - i,
  9896. next: ic.next
  9897. }, t.context)
  9898. }
  9899. qh.dirty = function() {
  9900. this._dirty = !0,
  9901. this._onDirty && this._onDirty(this.context)
  9902. }
  9903. ,
  9904. qh.unfinished = function() {
  9905. return this._progress && this._dueIndex < this._dueEnd
  9906. }
  9907. ,
  9908. qh.pipe = function(t) {
  9909. this._downstream === t && !this._dirty || ((this._downstream = t)._upstream = this,
  9910. t.dirty())
  9911. }
  9912. ,
  9913. qh.dispose = function() {
  9914. this._disposed || (this._upstream && (this._upstream._downstream = null),
  9915. this._downstream && (this._downstream._upstream = null),
  9916. this._dirty = !1,
  9917. this._disposed = !0)
  9918. }
  9919. ,
  9920. qh.getUpstream = function() {
  9921. return this._upstream
  9922. }
  9923. ,
  9924. qh.getDownstream = function() {
  9925. return this._downstream
  9926. }
  9927. ,
  9928. qh.setOutputEnd = function(t) {
  9929. this._outputDueEnd = this._settedOutputEnd = t
  9930. }
  9931. ;
  9932. var rc = jo()
  9933. , sc = ku.extend({
  9934. type: "series.__base__",
  9935. seriesIndex: 0,
  9936. coordinateSystem: null,
  9937. defaultOption: null,
  9938. legendVisualProvider: null,
  9939. visualColorAccessPath: "itemStyle.color",
  9940. visualBorderColorAccessPath: "itemStyle.borderColor",
  9941. layoutMode: null,
  9942. init: function(t, e, i, n) {
  9943. this.seriesIndex = this.componentIndex,
  9944. this.dataTask = Yh({
  9945. count: uc,
  9946. reset: hc
  9947. }),
  9948. this.dataTask.context = {
  9949. model: this
  9950. },
  9951. this.mergeDefaultAndTheme(t, i),
  9952. ju(this);
  9953. var o = this.getInitialData(t, i);
  9954. dc(o, this),
  9955. this.dataTask.context.data = o,
  9956. rc(this).dataBeforeProcessed = o,
  9957. lc(this)
  9958. },
  9959. mergeDefaultAndTheme: function(t, e) {
  9960. var i = this.layoutMode
  9961. , n = i ? Iu(t) : {}
  9962. , o = this.subType;
  9963. ku.hasClass(o) && (o += "Series"),
  9964. m(t, e.getTheme().get(this.subType)),
  9965. m(t, this.getDefaultOption()),
  9966. Go(t, "label", ["show"]),
  9967. this.fillDataTextStyle(t.data),
  9968. i && Mu(t, n, i)
  9969. },
  9970. mergeOption: function(t, e) {
  9971. t = m(this.option, t, !0),
  9972. this.fillDataTextStyle(t.data);
  9973. var i = this.layoutMode;
  9974. i && Mu(this.option, t, i),
  9975. ju(this);
  9976. var n = this.getInitialData(t, e);
  9977. dc(n, this),
  9978. this.dataTask.dirty(),
  9979. this.dataTask.context.data = n,
  9980. rc(this).dataBeforeProcessed = n,
  9981. lc(this)
  9982. },
  9983. fillDataTextStyle: function(t) {
  9984. if (t && !V(t))
  9985. for (var e = ["show"], i = 0; i < t.length; i++)
  9986. t[i] && t[i].label && Go(t[i], "label", e)
  9987. },
  9988. getInitialData: function() {},
  9989. appendData: function(t) {
  9990. this.getRawData().appendData(t.data)
  9991. },
  9992. getData: function(t) {
  9993. var e = pc(this);
  9994. if (e) {
  9995. var i = e.context.data;
  9996. return null == t ? i : i.getLinkedData(t)
  9997. }
  9998. return rc(this).data
  9999. },
  10000. setData: function(t) {
  10001. var e = pc(this);
  10002. if (e) {
  10003. var i = e.context;
  10004. i.data !== t && e.modifyOutputEnd && e.setOutputEnd(t.count()),
  10005. i.outputData = t,
  10006. e !== this.dataTask && (i.data = t)
  10007. }
  10008. rc(this).data = t
  10009. },
  10010. getSource: function() {
  10011. return function(t) {
  10012. return Yu(t).source
  10013. }(this)
  10014. },
  10015. getRawData: function() {
  10016. return rc(this).dataBeforeProcessed
  10017. },
  10018. getBaseAxis: function() {
  10019. var t = this.coordinateSystem;
  10020. return t && t.getBaseAxis && t.getBaseAxis()
  10021. },
  10022. formatTooltip: function(o, h, t, c) {
  10023. var d = this
  10024. , e = "html" === (c = c || "html") ? "<br/>" : "\n"
  10025. , f = "richText" === c
  10026. , p = {}
  10027. , g = 0;
  10028. function i(t) {
  10029. return {
  10030. renderMode: c,
  10031. content: au(tu(t)),
  10032. style: p
  10033. }
  10034. }
  10035. var m = this.getData()
  10036. , a = m.mapDimension("defaultedTooltip", !0)
  10037. , n = a.length
  10038. , r = this.getRawValue(o)
  10039. , s = L(r)
  10040. , v = m.getItemVisual(o, "color");
  10041. z(v) && v.colorStops && (v = (v.colorStops[0] || {}).color),
  10042. v = v || "transparent";
  10043. var l = (1 < n || s && !n ? function(t) {
  10044. var l = S(t, function(t, e, i) {
  10045. var n = m.getDimensionInfo(i);
  10046. return t | (n && !1 !== n.tooltip && null != n.displayName)
  10047. }, 0)
  10048. , u = [];
  10049. function e(t, e) {
  10050. var i = m.getDimensionInfo(e);
  10051. if (i && !1 !== i.otherDims.tooltip) {
  10052. var n = i.type
  10053. , o = "sub" + d.seriesIndex + "at" + g
  10054. , a = hu({
  10055. color: v,
  10056. type: "subItem",
  10057. renderMode: c,
  10058. markerId: o
  10059. })
  10060. , r = "string" == typeof a ? a : a.content
  10061. , s = (l ? r + au(i.displayName || "-") + ": " : "") + au("ordinal" === n ? t + "" : "time" === n ? h ? "" : du("yyyy/MM/dd hh:mm:ss", t) : tu(t));
  10062. s && u.push(s),
  10063. f && (p[o] = v,
  10064. ++g)
  10065. }
  10066. }
  10067. a.length ? E(a, function(t) {
  10068. e(Hh(m, o, t), t)
  10069. }) : E(t, e);
  10070. var i = l ? f ? "\n" : "<br/>" : ""
  10071. , n = i + u.join(i || ", ");
  10072. return {
  10073. renderMode: c,
  10074. content: n,
  10075. style: p
  10076. }
  10077. }(r) : i(n ? Hh(m, o, a[0]) : s ? r[0] : r)).content
  10078. , u = d.seriesIndex + "at" + g
  10079. , y = hu({
  10080. color: v,
  10081. type: "item",
  10082. renderMode: c,
  10083. markerId: u
  10084. });
  10085. p[u] = v,
  10086. ++g;
  10087. var x = m.getName(o)
  10088. , _ = this.name;
  10089. Uo(this) || (_ = ""),
  10090. _ = _ ? au(_) + (h ? ": " : e) : "";
  10091. var w = "string" == typeof y ? y : y.content;
  10092. return {
  10093. html: h ? w + _ + l : _ + w + (x ? au(x) + ": " + l : l),
  10094. markers: p
  10095. }
  10096. },
  10097. isAnimationEnabled: function() {
  10098. if (v.node)
  10099. return !1;
  10100. var t = this.getShallow("animation");
  10101. return t && this.getData().count() > this.getShallow("animationThreshold") && (t = !1),
  10102. t
  10103. },
  10104. restoreData: function() {
  10105. this.dataTask.dirty()
  10106. },
  10107. getColorFromPalette: function(t, e, i) {
  10108. var n = this.ecModel
  10109. , o = Ru.getColorFromPalette.call(this, t, e, i);
  10110. return o = o || n.getColorFromPalette(t, e, i)
  10111. },
  10112. coordDimToDataDim: function(t) {
  10113. return this.getRawData().mapDimension(t, !0)
  10114. },
  10115. getProgressive: function() {
  10116. return this.get("progressive")
  10117. },
  10118. getProgressiveThreshold: function() {
  10119. return this.get("progressiveThreshold")
  10120. },
  10121. getAxisTooltipData: null,
  10122. getTooltipPosition: null,
  10123. pipeTask: null,
  10124. preventIncremental: null,
  10125. pipelineContext: null
  10126. });
  10127. function lc(t) {
  10128. var e = t.name;
  10129. Uo(t) || (t.name = function(t) {
  10130. var i = t.getRawData()
  10131. , e = i.mapDimension("seriesName", !0)
  10132. , n = [];
  10133. return E(e, function(t) {
  10134. var e = i.getDimensionInfo(t);
  10135. e.displayName && n.push(e.displayName)
  10136. }),
  10137. n.join(" ")
  10138. }(t) || e)
  10139. }
  10140. function uc(t) {
  10141. return t.model.getRawData().count()
  10142. }
  10143. function hc(t) {
  10144. var e = t.model;
  10145. return e.setData(e.getRawData().cloneShallow()),
  10146. cc
  10147. }
  10148. function cc(t, e) {
  10149. e.outputData && t.end > e.outputData.count() && e.model.getRawData().cloneShallow(e.outputData)
  10150. }
  10151. function dc(e, i) {
  10152. E(e.CHANGABLE_METHODS, function(t) {
  10153. e.wrapMethod(t, T(fc, i))
  10154. })
  10155. }
  10156. function fc(t) {
  10157. var e = pc(t);
  10158. e && e.setOutputEnd(this.count())
  10159. }
  10160. function pc(t) {
  10161. var e = (t.ecModel || {}).scheduler
  10162. , i = e && e.getPipeline(t.uid);
  10163. if (i) {
  10164. var n = i.currentTask;
  10165. if (n) {
  10166. var o = n.agentStubMap;
  10167. o && (n = o.get(t.uid))
  10168. }
  10169. return n
  10170. }
  10171. }
  10172. b(sc, Xh),
  10173. b(sc, Ru);
  10174. var gc = function() {
  10175. this.group = new Ci,
  10176. this.uid = Nl("viewComponent")
  10177. };
  10178. gc.prototype = {
  10179. constructor: gc,
  10180. init: function(t, e) {},
  10181. render: function(t, e, i, n) {},
  10182. dispose: function() {},
  10183. filterForExposedEvent: null
  10184. };
  10185. var mc = gc.prototype;
  10186. mc.updateView = mc.updateLayout = mc.updateVisual = function(t, e, i, n) {}
  10187. ,
  10188. oa(gc),
  10189. ua(gc, {
  10190. registerWhenExtend: !0
  10191. });
  10192. function vc() {
  10193. var s = jo();
  10194. return function(t) {
  10195. var e = s(t)
  10196. , i = t.pipelineContext
  10197. , n = e.large
  10198. , o = e.progressiveRender
  10199. , a = e.large = i && i.large
  10200. , r = e.progressiveRender = i && i.progressiveRender;
  10201. return !!(n ^ a || o ^ r) && "reset"
  10202. }
  10203. }
  10204. var yc = jo()
  10205. , xc = vc();
  10206. function _c() {
  10207. this.group = new Ci,
  10208. this.uid = Nl("viewChart"),
  10209. this.renderTask = Yh({
  10210. plan: Mc,
  10211. reset: Ic
  10212. }),
  10213. this.renderTask.context = {
  10214. view: this
  10215. }
  10216. }
  10217. var wc = _c.prototype = {
  10218. type: "chart",
  10219. init: function(t, e) {},
  10220. render: function(t, e, i, n) {},
  10221. highlight: function(t, e, i, n) {
  10222. Sc(t.getData(), n, "emphasis")
  10223. },
  10224. downplay: function(t, e, i, n) {
  10225. Sc(t.getData(), n, "normal")
  10226. },
  10227. remove: function(t, e) {
  10228. this.group.removeAll()
  10229. },
  10230. dispose: function() {},
  10231. incrementalPrepareRender: null,
  10232. incrementalRender: null,
  10233. updateTransform: null,
  10234. filterForExposedEvent: null
  10235. };
  10236. function bc(t, e, i) {
  10237. if (t && (t.trigger(e, i),
  10238. t.isGroup && !Qs(t)))
  10239. for (var n = 0, o = t.childCount(); n < o; n++)
  10240. bc(t.childAt(n), e, i)
  10241. }
  10242. function Sc(e, t, i) {
  10243. var n = Yo(e, t)
  10244. , o = t && null != t.highlightKey ? tl(t.highlightKey) : null;
  10245. null != n ? E(Vo(n), function(t) {
  10246. bc(e.getItemGraphicEl(t), i, o)
  10247. }) : e.eachItemGraphicEl(function(t) {
  10248. bc(t, i, o)
  10249. })
  10250. }
  10251. function Mc(t) {
  10252. return xc(t.model)
  10253. }
  10254. function Ic(t) {
  10255. var e = t.model
  10256. , i = t.ecModel
  10257. , n = t.api
  10258. , o = t.payload
  10259. , a = e.pipelineContext.progressiveRender
  10260. , r = t.view
  10261. , s = o && yc(o).updateMethod
  10262. , l = a ? "incrementalPrepareRender" : s && r[s] ? s : "render";
  10263. return "render" !== l && r[l](e, i, n, o),
  10264. Tc[l]
  10265. }
  10266. wc.updateView = wc.updateLayout = wc.updateVisual = function(t, e, i, n) {
  10267. this.render(t, e, i, n)
  10268. }
  10269. ,
  10270. oa(_c),
  10271. ua(_c, {
  10272. registerWhenExtend: !0
  10273. }),
  10274. _c.markUpdateMethod = function(t, e) {
  10275. yc(t).updateMethod = e
  10276. }
  10277. ;
  10278. var Tc = {
  10279. incrementalPrepareRender: {
  10280. progress: function(t, e) {
  10281. e.view.incrementalRender(t, e.model, e.ecModel, e.api, e.payload)
  10282. }
  10283. },
  10284. render: {
  10285. forceFirstProgress: !0,
  10286. progress: function(t, e) {
  10287. e.view.render(e.model, e.ecModel, e.api, e.payload)
  10288. }
  10289. }
  10290. }
  10291. , Ac = "\0__throttleOriginMethod"
  10292. , Dc = "\0__throttleRate"
  10293. , Cc = "\0__throttleType";
  10294. function Lc(t, i, n) {
  10295. var o, a, r, s, l, u = 0, h = 0, c = null;
  10296. function d() {
  10297. h = (new Date).getTime(),
  10298. c = null,
  10299. t.apply(r, s || [])
  10300. }
  10301. i = i || 0;
  10302. function e() {
  10303. o = (new Date).getTime(),
  10304. r = this,
  10305. s = arguments;
  10306. var t = l || i
  10307. , e = l || n;
  10308. l = null,
  10309. a = o - (e ? u : h) - t,
  10310. clearTimeout(c),
  10311. e ? c = setTimeout(d, t) : 0 <= a ? d() : c = setTimeout(d, -a),
  10312. u = o
  10313. }
  10314. return e.clear = function() {
  10315. c && (clearTimeout(c),
  10316. c = null)
  10317. }
  10318. ,
  10319. e.debounceNextCall = function(t) {
  10320. l = t
  10321. }
  10322. ,
  10323. e
  10324. }
  10325. function kc(t, e, i, n) {
  10326. var o = t[e];
  10327. if (o) {
  10328. var a = o[Ac] || o
  10329. , r = o[Cc];
  10330. if (o[Dc] !== i || r !== n) {
  10331. if (null == i || !n)
  10332. return t[e] = a;
  10333. (o = t[e] = Lc(a, i, "debounce" === n))[Ac] = a,
  10334. o[Cc] = n,
  10335. o[Dc] = i
  10336. }
  10337. return o
  10338. }
  10339. }
  10340. function Pc(t, e) {
  10341. var i = t[e];
  10342. i && i[Ac] && (t[e] = i[Ac])
  10343. }
  10344. var Nc = {
  10345. createOnAllSeries: !0,
  10346. performRawSeries: !0,
  10347. reset: function(e, t) {
  10348. var i = e.getData()
  10349. , a = (e.visualColorAccessPath || "itemStyle.color").split(".")
  10350. , n = e.get(a)
  10351. , o = !C(n) || n instanceof cs ? null : n;
  10352. n && !o || (n = e.getColorFromPalette(e.name, null, t.getSeriesCount())),
  10353. i.setVisual("color", n);
  10354. var r = (e.visualBorderColorAccessPath || "itemStyle.borderColor").split(".")
  10355. , s = e.get(r);
  10356. if (i.setVisual("borderColor", s),
  10357. !t.isSeriesFiltered(e)) {
  10358. o && i.each(function(t) {
  10359. i.setItemVisual(t, "color", o(e.getDataParams(t)))
  10360. });
  10361. return {
  10362. dataEach: i.hasItemOption ? function(t, e) {
  10363. var i = t.getItemModel(e)
  10364. , n = i.get(a, !0)
  10365. , o = i.get(r, !0);
  10366. null != n && t.setItemVisual(e, "color", n),
  10367. null != o && t.setItemVisual(e, "borderColor", o)
  10368. }
  10369. : null
  10370. }
  10371. }
  10372. }
  10373. }
  10374. , Oc = {
  10375. legend: {
  10376. selector: {
  10377. all: "全选",
  10378. inverse: "反选"
  10379. }
  10380. },
  10381. toolbox: {
  10382. brush: {
  10383. title: {
  10384. rect: "矩形选择",
  10385. polygon: "圈选",
  10386. lineX: "横向选择",
  10387. lineY: "纵向选择",
  10388. keep: "保持选择",
  10389. clear: "清除选择"
  10390. }
  10391. },
  10392. dataView: {
  10393. title: "数据视图",
  10394. lang: ["数据视图", "关闭", "刷新"]
  10395. },
  10396. dataZoom: {
  10397. title: {
  10398. zoom: "区域缩放",
  10399. back: "区域缩放还原"
  10400. }
  10401. },
  10402. magicType: {
  10403. title: {
  10404. line: "切换为折线图",
  10405. bar: "切换为柱状图",
  10406. stack: "切换为堆叠",
  10407. tiled: "切换为平铺"
  10408. }
  10409. },
  10410. restore: {
  10411. title: "还原"
  10412. },
  10413. saveAsImage: {
  10414. title: "保存为图片",
  10415. lang: ["右键另存为图片"]
  10416. }
  10417. },
  10418. series: {
  10419. typeNames: {
  10420. pie: "饼图",
  10421. bar: "柱状图",
  10422. line: "折线图",
  10423. scatter: "散点图",
  10424. effectScatter: "涟漪散点图",
  10425. radar: "雷达图",
  10426. tree: "树图",
  10427. treemap: "矩形树图",
  10428. boxplot: "箱型图",
  10429. candlestick: "K线图",
  10430. k: "K线图",
  10431. heatmap: "热力图",
  10432. map: "地图",
  10433. parallel: "平行坐标图",
  10434. lines: "线图",
  10435. graph: "关系图",
  10436. sankey: "桑基图",
  10437. funnel: "漏斗图",
  10438. gauge: "仪表盘图",
  10439. pictorialBar: "象形柱图",
  10440. themeRiver: "主题河流图",
  10441. sunburst: "旭日图"
  10442. }
  10443. },
  10444. aria: {
  10445. general: {
  10446. withTitle: "这是一个关于“{title}”的图表。",
  10447. withoutTitle: "这是一个图表,"
  10448. },
  10449. series: {
  10450. single: {
  10451. prefix: "",
  10452. withName: "图表类型是{seriesType},表示{seriesName}。",
  10453. withoutName: "图表类型是{seriesType}。"
  10454. },
  10455. multiple: {
  10456. prefix: "它由{seriesCount}个图表系列组成。",
  10457. withName: "第{seriesId}个系列是一个表示{seriesName}的{seriesType},",
  10458. withoutName: "第{seriesId}个系列是一个{seriesType},",
  10459. separator: {
  10460. middle: ";",
  10461. end: "。"
  10462. }
  10463. }
  10464. },
  10465. data: {
  10466. allData: "其数据是——",
  10467. partialData: "其中,前{displayCnt}项是——",
  10468. withName: "{name}的数据是{value}",
  10469. withoutName: "{value}",
  10470. separator: {
  10471. middle: ",",
  10472. end: ""
  10473. }
  10474. }
  10475. }
  10476. }
  10477. , Ec = function(t, e) {
  10478. var a = e.getModel("aria");
  10479. if (a.get("show"))
  10480. if (a.get("description"))
  10481. t.setAttribute("aria-label", a.get("description"));
  10482. else {
  10483. var h = 0;
  10484. e.eachSeries(function(t, e) {
  10485. ++h
  10486. }, this);
  10487. var i, c = a.get("data.maxCount") || 10, n = a.get("series.maxCount") || 10, d = Math.min(h, n);
  10488. if (!(h < 1)) {
  10489. var o = function() {
  10490. var t = e.getModel("title").option;
  10491. t && t.length && (t = t[0]);
  10492. return t && t.text
  10493. }();
  10494. i = o ? p(g("general.withTitle"), {
  10495. title: o
  10496. }) : g("general.withoutTitle");
  10497. var f = [];
  10498. i += p(g(1 < h ? "series.multiple.prefix" : "series.single.prefix"), {
  10499. seriesCount: h
  10500. }),
  10501. e.eachSeries(function(t, e) {
  10502. if (e < d) {
  10503. var i, n = t.get("name"), o = "series." + (1 < h ? "multiple" : "single") + ".";
  10504. i = p(i = g(n ? o + "withName" : o + "withoutName"), {
  10505. seriesId: t.seriesIndex,
  10506. seriesName: t.get("name"),
  10507. seriesType: function(t) {
  10508. return Oc.series.typeNames[t] || "自定义图"
  10509. }(t.subType)
  10510. });
  10511. var a = t.getData();
  10512. (window.data = a).count() > c ? i += p(g("data.partialData"), {
  10513. displayCnt: c
  10514. }) : i += g("data.allData");
  10515. for (var r = [], s = 0; s < a.count(); s++)
  10516. if (s < c) {
  10517. var l = a.getName(s)
  10518. , u = Hh(a, s);
  10519. r.push(p(g(l ? "data.withName" : "data.withoutName"), {
  10520. name: l,
  10521. value: u
  10522. }))
  10523. }
  10524. i += r.join(g("data.separator.middle")) + g("data.separator.end"),
  10525. f.push(i)
  10526. }
  10527. }),
  10528. i += f.join(g("series.multiple.separator.middle")) + g("series.multiple.separator.end"),
  10529. t.setAttribute("aria-label", i)
  10530. }
  10531. }
  10532. function p(t, e) {
  10533. if ("string" != typeof t)
  10534. return t;
  10535. var i = t;
  10536. return E(e, function(t, e) {
  10537. i = i.replace(new RegExp("\\{\\s*" + e + "\\s*\\}","g"), t)
  10538. }),
  10539. i
  10540. }
  10541. function g(t) {
  10542. var e = a.get(t);
  10543. if (null != e)
  10544. return e;
  10545. for (var i = t.split("."), n = Oc.aria, o = 0; o < i.length; ++o)
  10546. n = n[i[o]];
  10547. return n
  10548. }
  10549. }
  10550. , Rc = Math.PI;
  10551. function zc(t, e, i, n) {
  10552. this.ecInstance = t,
  10553. this.api = e,
  10554. this.unfinished;
  10555. i = this._dataProcessorHandlers = i.slice(),
  10556. n = this._visualHandlers = n.slice();
  10557. this._allHandlers = i.concat(n),
  10558. this._stageTaskMap = Q()
  10559. }
  10560. var Bc = zc.prototype;
  10561. function Vc(l, t, u, h, c) {
  10562. var d;
  10563. function f(t, e) {
  10564. return t.setDirty && (!t.dirtyMap || t.dirtyMap.get(e.__pipeline.id))
  10565. }
  10566. c = c || {},
  10567. E(t, function(n, t) {
  10568. if (!c.visualType || c.visualType === n.visualType) {
  10569. var e = l._stageTaskMap.get(n.uid)
  10570. , i = e.seriesTaskMap
  10571. , o = e.overallTask;
  10572. if (o) {
  10573. var a, r = o.agentStubMap;
  10574. r.each(function(t) {
  10575. f(c, t) && (t.dirty(),
  10576. a = !0)
  10577. }),
  10578. a && o.dirty(),
  10579. Gc(o, h);
  10580. var s = l.getPerformArgs(o, c.block);
  10581. r.each(function(t) {
  10582. t.perform(s)
  10583. }),
  10584. d |= o.perform(s)
  10585. } else
  10586. i && i.each(function(t, e) {
  10587. f(c, t) && t.dirty();
  10588. var i = l.getPerformArgs(t, c.block);
  10589. i.skip = !n.performRawSeries && u.isSeriesFiltered(t.context.model),
  10590. Gc(t, h),
  10591. d |= t.perform(i)
  10592. })
  10593. }
  10594. }),
  10595. l.unfinished |= d
  10596. }
  10597. Bc.restoreData = function(t, e) {
  10598. t.restoreData(e),
  10599. this._stageTaskMap.each(function(t) {
  10600. var e = t.overallTask;
  10601. e && e.dirty()
  10602. })
  10603. }
  10604. ,
  10605. Bc.getPerformArgs = function(t, e) {
  10606. if (t.__pipeline) {
  10607. var i = this._pipelineMap.get(t.__pipeline.id)
  10608. , n = i.context
  10609. , o = !e && i.progressiveEnabled && (!n || n.progressiveRender) && t.__idxInPipeline > i.blockIndex ? i.step : null
  10610. , a = n && n.modDataCount;
  10611. return {
  10612. step: o,
  10613. modBy: null != a ? Math.ceil(a / o) : null,
  10614. modDataCount: a
  10615. }
  10616. }
  10617. }
  10618. ,
  10619. Bc.getPipeline = function(t) {
  10620. return this._pipelineMap.get(t)
  10621. }
  10622. ,
  10623. Bc.updateStreamModes = function(t, e) {
  10624. var i = this._pipelineMap.get(t.uid)
  10625. , n = t.getData().count()
  10626. , o = i.progressiveEnabled && e.incrementalPrepareRender && n >= i.threshold
  10627. , a = t.get("large") && n >= t.get("largeThreshold")
  10628. , r = "mod" === t.get("progressiveChunkMode") ? n : null;
  10629. t.pipelineContext = i.context = {
  10630. progressiveRender: o,
  10631. modDataCount: r,
  10632. large: a
  10633. }
  10634. }
  10635. ,
  10636. Bc.restorePipelines = function(t) {
  10637. var n = this
  10638. , o = n._pipelineMap = Q();
  10639. t.eachSeries(function(t) {
  10640. var e = t.getProgressive()
  10641. , i = t.uid;
  10642. o.set(i, {
  10643. id: i,
  10644. head: null,
  10645. tail: null,
  10646. threshold: t.getProgressiveThreshold(),
  10647. progressiveEnabled: e && !(t.preventIncremental && t.preventIncremental()),
  10648. blockIndex: -1,
  10649. step: Math.round(e || 700),
  10650. count: 0
  10651. }),
  10652. Kc(n, t, t.dataTask)
  10653. })
  10654. }
  10655. ,
  10656. Bc.prepareStageTasks = function() {
  10657. var i = this._stageTaskMap
  10658. , n = this.ecInstance.getModel()
  10659. , o = this.api;
  10660. E(this._allHandlers, function(t) {
  10661. var e = i.get(t.uid) || i.set(t.uid, []);
  10662. t.reset && function(n, o, t, a, r) {
  10663. var s = t.seriesTaskMap || (t.seriesTaskMap = Q())
  10664. , e = o.seriesType
  10665. , i = o.getTargetSeries;
  10666. o.createOnAllSeries ? a.eachRawSeries(l) : e ? a.eachRawSeriesByType(e, l) : i && i(a, r).each(l);
  10667. function l(t) {
  10668. var e = t.uid
  10669. , i = s.get(e) || s.set(e, Yh({
  10670. plan: Uc,
  10671. reset: Xc,
  10672. count: qc
  10673. }));
  10674. i.context = {
  10675. model: t,
  10676. ecModel: a,
  10677. api: r,
  10678. useClearVisual: o.isVisual && !o.isLayout,
  10679. plan: o.plan,
  10680. reset: o.reset,
  10681. scheduler: n
  10682. },
  10683. Kc(n, t, i)
  10684. }
  10685. var u = n._pipelineMap;
  10686. s.each(function(t, e) {
  10687. u.get(e) || (t.dispose(),
  10688. s.removeKey(e))
  10689. })
  10690. }(this, t, e, n, o),
  10691. t.overallReset && function(n, t, e, i, o) {
  10692. var a = e.overallTask = e.overallTask || Yh({
  10693. reset: Fc
  10694. });
  10695. a.context = {
  10696. ecModel: i,
  10697. api: o,
  10698. overallReset: t.overallReset,
  10699. scheduler: n
  10700. };
  10701. var r = a.agentStubMap = a.agentStubMap || Q()
  10702. , s = t.seriesType
  10703. , l = t.getTargetSeries
  10704. , u = !0
  10705. , h = t.modifyOutputEnd;
  10706. s ? i.eachRawSeriesByType(s, c) : l ? l(i, o).each(c) : (u = !1,
  10707. E(i.getSeries(), c));
  10708. function c(t) {
  10709. var e = t.uid
  10710. , i = r.get(e);
  10711. i || (i = r.set(e, Yh({
  10712. reset: Wc,
  10713. onDirty: Zc
  10714. })),
  10715. a.dirty()),
  10716. i.context = {
  10717. model: t,
  10718. overallProgress: u,
  10719. modifyOutputEnd: h
  10720. },
  10721. i.agent = a,
  10722. i.__block = u,
  10723. Kc(n, t, i)
  10724. }
  10725. var d = n._pipelineMap;
  10726. r.each(function(t, e) {
  10727. d.get(e) || (t.dispose(),
  10728. a.dirty(),
  10729. r.removeKey(e))
  10730. })
  10731. }(this, t, e, n, o)
  10732. }, this)
  10733. }
  10734. ,
  10735. Bc.prepareView = function(t, e, i, n) {
  10736. var o = t.renderTask
  10737. , a = o.context;
  10738. a.model = e,
  10739. a.ecModel = i,
  10740. a.api = n,
  10741. o.__block = !t.incrementalPrepareRender,
  10742. Kc(this, e, o)
  10743. }
  10744. ,
  10745. Bc.performDataProcessorTasks = function(t, e) {
  10746. Vc(this, this._dataProcessorHandlers, t, e, {
  10747. block: !0
  10748. })
  10749. }
  10750. ,
  10751. Bc.performVisualTasks = function(t, e, i) {
  10752. Vc(this, this._visualHandlers, t, e, i)
  10753. }
  10754. ,
  10755. Bc.performSeriesTasks = function(t) {
  10756. var e;
  10757. t.eachSeries(function(t) {
  10758. e |= t.dataTask.perform()
  10759. }),
  10760. this.unfinished |= e
  10761. }
  10762. ,
  10763. Bc.plan = function() {
  10764. this._pipelineMap.each(function(t) {
  10765. var e = t.tail;
  10766. do {
  10767. if (e.__block) {
  10768. t.blockIndex = e.__idxInPipeline;
  10769. break
  10770. }
  10771. e = e.getUpstream()
  10772. } while (e)
  10773. })
  10774. }
  10775. ;
  10776. var Gc = Bc.updatePayload = function(t, e) {
  10777. "remain" !== e && (t.context.payload = e)
  10778. }
  10779. ;
  10780. function Fc(t) {
  10781. t.overallReset(t.ecModel, t.api, t.payload)
  10782. }
  10783. function Wc(t, e) {
  10784. return t.overallProgress && Hc
  10785. }
  10786. function Hc() {
  10787. this.agent.dirty(),
  10788. this.getDownstream().dirty()
  10789. }
  10790. function Zc() {
  10791. this.agent && this.agent.dirty()
  10792. }
  10793. function Uc(t) {
  10794. return t.plan && t.plan(t.model, t.ecModel, t.api, t.payload)
  10795. }
  10796. function Xc(t) {
  10797. t.useClearVisual && t.data.clearAllVisual();
  10798. var e = t.resetDefines = Vo(t.reset(t.model, t.ecModel, t.api, t.payload));
  10799. return 1 < e.length ? O(e, function(t, e) {
  10800. return jc(e)
  10801. }) : Yc
  10802. }
  10803. var Yc = jc(0);
  10804. function jc(a) {
  10805. return function(t, e) {
  10806. var i = e.data
  10807. , n = e.resetDefines[a];
  10808. if (n && n.dataEach)
  10809. for (var o = t.start; o < t.end; o++)
  10810. n.dataEach(i, o);
  10811. else
  10812. n && n.progress && n.progress(t, i)
  10813. }
  10814. }
  10815. function qc(t) {
  10816. return t.data.count()
  10817. }
  10818. function Kc(t, e, i) {
  10819. var n = e.uid
  10820. , o = t._pipelineMap.get(n);
  10821. o.head || (o.head = i),
  10822. o.tail && o.tail.pipe(i),
  10823. (o.tail = i).__idxInPipeline = o.count++,
  10824. i.__pipeline = o
  10825. }
  10826. zc.wrapStageHandler = function(t, e) {
  10827. return C(t) && (t = {
  10828. overallReset: t,
  10829. seriesType: function(t) {
  10830. $c = null;
  10831. try {
  10832. t(Jc, Qc)
  10833. } catch (t) {}
  10834. return $c
  10835. }(t)
  10836. }),
  10837. t.uid = Nl("stageHandler"),
  10838. e && (t.visualType = e),
  10839. t
  10840. }
  10841. ;
  10842. var $c, Jc = {}, Qc = {};
  10843. function td(t, e) {
  10844. for (var i in e.prototype)
  10845. t[i] = et
  10846. }
  10847. td(Jc, ih),
  10848. td(Qc, rh),
  10849. Jc.eachSeriesByType = Jc.eachRawSeriesByType = function(t) {
  10850. $c = t
  10851. }
  10852. ,
  10853. Jc.eachComponent = function(t) {
  10854. "series" === t.mainType && t.subType && ($c = t.subType)
  10855. }
  10856. ;
  10857. function ed() {
  10858. return {
  10859. axisLine: {
  10860. lineStyle: {
  10861. color: od
  10862. }
  10863. },
  10864. axisTick: {
  10865. lineStyle: {
  10866. color: od
  10867. }
  10868. },
  10869. axisLabel: {
  10870. textStyle: {
  10871. color: od
  10872. }
  10873. },
  10874. splitLine: {
  10875. lineStyle: {
  10876. type: "dashed",
  10877. color: "#aaa"
  10878. }
  10879. },
  10880. splitArea: {
  10881. areaStyle: {
  10882. color: od
  10883. }
  10884. }
  10885. }
  10886. }
  10887. var id = ["#37A2DA", "#32C5E9", "#67E0E3", "#9FE6B8", "#FFDB5C", "#ff9f7f", "#fb7293", "#E062AE", "#E690D1", "#e7bcf3", "#9d96f5", "#8378EA", "#96BFFF"]
  10888. , nd = {
  10889. color: id,
  10890. colorLayer: [["#37A2DA", "#ffd85c", "#fd7b5f"], ["#37A2DA", "#67E0E3", "#FFDB5C", "#ff9f7f", "#E062AE", "#9d96f5"], ["#37A2DA", "#32C5E9", "#9FE6B8", "#FFDB5C", "#ff9f7f", "#fb7293", "#e7bcf3", "#8378EA", "#96BFFF"], id]
  10891. }
  10892. , od = "#eee"
  10893. , ad = ["#dd6b66", "#759aa0", "#e69d87", "#8dc1a9", "#ea7e53", "#eedd78", "#73a373", "#73b9bc", "#7289ab", "#91ca8c", "#f49f42"]
  10894. , rd = {
  10895. color: ad,
  10896. backgroundColor: "#333",
  10897. tooltip: {
  10898. axisPointer: {
  10899. lineStyle: {
  10900. color: od
  10901. },
  10902. crossStyle: {
  10903. color: od
  10904. },
  10905. label: {
  10906. color: "#000"
  10907. }
  10908. }
  10909. },
  10910. legend: {
  10911. textStyle: {
  10912. color: od
  10913. }
  10914. },
  10915. textStyle: {
  10916. color: od
  10917. },
  10918. title: {
  10919. textStyle: {
  10920. color: od
  10921. }
  10922. },
  10923. toolbox: {
  10924. iconStyle: {
  10925. normal: {
  10926. borderColor: od
  10927. }
  10928. }
  10929. },
  10930. dataZoom: {
  10931. textStyle: {
  10932. color: od
  10933. }
  10934. },
  10935. visualMap: {
  10936. textStyle: {
  10937. color: od
  10938. }
  10939. },
  10940. timeline: {
  10941. lineStyle: {
  10942. color: od
  10943. },
  10944. itemStyle: {
  10945. normal: {
  10946. color: ad[1]
  10947. }
  10948. },
  10949. label: {
  10950. normal: {
  10951. textStyle: {
  10952. color: od
  10953. }
  10954. }
  10955. },
  10956. controlStyle: {
  10957. normal: {
  10958. color: od,
  10959. borderColor: od
  10960. }
  10961. }
  10962. },
  10963. timeAxis: ed(),
  10964. logAxis: ed(),
  10965. valueAxis: ed(),
  10966. categoryAxis: ed(),
  10967. line: {
  10968. symbol: "circle"
  10969. },
  10970. graph: {
  10971. color: ad
  10972. },
  10973. gauge: {
  10974. title: {
  10975. textStyle: {
  10976. color: od
  10977. }
  10978. }
  10979. },
  10980. candlestick: {
  10981. itemStyle: {
  10982. normal: {
  10983. color: "#FD1050",
  10984. color0: "#0CF49B",
  10985. borderColor: "#FD1050",
  10986. borderColor0: "#0CF49B"
  10987. }
  10988. }
  10989. }
  10990. };
  10991. rd.categoryAxis.splitLine.show = !1,
  10992. ku.extend({
  10993. type: "dataset",
  10994. defaultOption: {
  10995. seriesLayoutBy: Hu,
  10996. sourceHeader: null,
  10997. dimensions: null,
  10998. source: null
  10999. },
  11000. optionUpdated: function() {
  11001. !function(t) {
  11002. var e = t.option.source
  11003. , i = Fu;
  11004. if (V(e))
  11005. i = Wu;
  11006. else if (L(e)) {
  11007. 0 === e.length && (i = Bu);
  11008. for (var n = 0, o = e.length; n < o; n++) {
  11009. var a = e[n];
  11010. if (null != a) {
  11011. if (L(a)) {
  11012. i = Bu;
  11013. break
  11014. }
  11015. if (z(a)) {
  11016. i = Vu;
  11017. break
  11018. }
  11019. }
  11020. }
  11021. } else if (z(e)) {
  11022. for (var r in e)
  11023. if (e.hasOwnProperty(r) && N(e[r])) {
  11024. i = Gu;
  11025. break
  11026. }
  11027. } else if (null != e)
  11028. throw new Error("Invalid data");
  11029. Yu(t).sourceFormat = i
  11030. }(this)
  11031. }
  11032. }),
  11033. gc.extend({
  11034. type: "dataset"
  11035. });
  11036. var sd = Ar.extend({
  11037. type: "ellipse",
  11038. shape: {
  11039. cx: 0,
  11040. cy: 0,
  11041. rx: 0,
  11042. ry: 0
  11043. },
  11044. buildPath: function(t, e) {
  11045. var i = e.cx
  11046. , n = e.cy
  11047. , o = e.rx
  11048. , a = e.ry
  11049. , r = .5522848 * o
  11050. , s = .5522848 * a;
  11051. t.moveTo(i - o, n),
  11052. t.bezierCurveTo(i - o, n - s, i - r, n - a, i, n - a),
  11053. t.bezierCurveTo(i + r, n - a, i + o, n - s, i + o, n),
  11054. t.bezierCurveTo(i + o, n + s, i + r, n + a, i, n + a),
  11055. t.bezierCurveTo(i - r, n + a, i - o, n + s, i - o, n),
  11056. t.closePath()
  11057. }
  11058. })
  11059. , ld = /[\s,]+/;
  11060. function ud(t) {
  11061. R(t) && (t = (new DOMParser).parseFromString(t, "text/xml"));
  11062. for (9 === t.nodeType && (t = t.firstChild); "svg" !== t.nodeName.toLowerCase() || 1 !== t.nodeType; )
  11063. t = t.nextSibling;
  11064. return t
  11065. }
  11066. function hd() {
  11067. this._defs = {},
  11068. this._root = null,
  11069. this._isDefine = !1,
  11070. this._isText = !1
  11071. }
  11072. hd.prototype.parse = function(t, e) {
  11073. e = e || {};
  11074. var i = ud(t);
  11075. if (!i)
  11076. throw new Error("Illegal svg");
  11077. var n = new Ci;
  11078. this._root = n;
  11079. var o = i.getAttribute("viewBox") || ""
  11080. , a = parseFloat(i.getAttribute("width") || e.width)
  11081. , r = parseFloat(i.getAttribute("height") || e.height);
  11082. isNaN(a) && (a = null),
  11083. isNaN(r) && (r = null),
  11084. md(i, n, null, !0);
  11085. for (var s, l, u = i.firstChild; u; )
  11086. this._parseNode(u, n),
  11087. u = u.nextSibling;
  11088. if (o) {
  11089. var h = j(o).split(ld);
  11090. 4 <= h.length && (s = {
  11091. x: parseFloat(h[0] || 0),
  11092. y: parseFloat(h[1] || 0),
  11093. width: parseFloat(h[2]),
  11094. height: parseFloat(h[3])
  11095. })
  11096. }
  11097. if (s && null != a && null != r && (l = wd(s, a, r),
  11098. !e.ignoreViewBox)) {
  11099. var c = n;
  11100. (n = new Ci).add(c),
  11101. c.scale = l.scale.slice(),
  11102. c.position = l.position.slice()
  11103. }
  11104. return e.ignoreRootClip || null == a || null == r || n.setClipPath(new rs({
  11105. shape: {
  11106. x: 0,
  11107. y: 0,
  11108. width: a,
  11109. height: r
  11110. }
  11111. })),
  11112. {
  11113. root: n,
  11114. width: a,
  11115. height: r,
  11116. viewBoxRect: s,
  11117. viewBoxTransform: l
  11118. }
  11119. }
  11120. ,
  11121. hd.prototype._parseNode = function(t, e) {
  11122. var i, n, o = t.nodeName.toLowerCase();
  11123. if ("defs" === o ? this._isDefine = !0 : "text" === o && (this._isText = !0),
  11124. this._isDefine) {
  11125. if (n = dd[o]) {
  11126. var a = n.call(this, t)
  11127. , r = t.getAttribute("id");
  11128. r && (this._defs[r] = a)
  11129. }
  11130. } else
  11131. (n = cd[o]) && (i = n.call(this, t, e),
  11132. e.add(i));
  11133. for (var s = t.firstChild; s; )
  11134. 1 === s.nodeType && this._parseNode(s, i),
  11135. 3 === s.nodeType && this._isText && this._parseText(s, i),
  11136. s = s.nextSibling;
  11137. "defs" === o ? this._isDefine = !1 : "text" === o && (this._isText = !1)
  11138. }
  11139. ,
  11140. hd.prototype._parseText = function(t, e) {
  11141. if (1 === t.nodeType) {
  11142. var i = t.getAttribute("dx") || 0
  11143. , n = t.getAttribute("dy") || 0;
  11144. this._textX += parseFloat(i),
  11145. this._textY += parseFloat(n)
  11146. }
  11147. var o = new Ur({
  11148. style: {
  11149. text: t.textContent,
  11150. transformText: !0
  11151. },
  11152. position: [this._textX || 0, this._textY || 0]
  11153. });
  11154. fd(e, o),
  11155. md(t, o, this._defs);
  11156. var a = o.style.fontSize;
  11157. a && a < 9 && (o.style.fontSize = 9,
  11158. o.scale = o.scale || [1, 1],
  11159. o.scale[0] *= a / 9,
  11160. o.scale[1] *= a / 9);
  11161. var r = o.getBoundingRect();
  11162. return this._textX += r.width,
  11163. e.add(o),
  11164. o
  11165. }
  11166. ;
  11167. var cd = {
  11168. g: function(t, e) {
  11169. var i = new Ci;
  11170. return fd(e, i),
  11171. md(t, i, this._defs),
  11172. i
  11173. },
  11174. rect: function(t, e) {
  11175. var i = new rs;
  11176. return fd(e, i),
  11177. md(t, i, this._defs),
  11178. i.setShape({
  11179. x: parseFloat(t.getAttribute("x") || 0),
  11180. y: parseFloat(t.getAttribute("y") || 0),
  11181. width: parseFloat(t.getAttribute("width") || 0),
  11182. height: parseFloat(t.getAttribute("height") || 0)
  11183. }),
  11184. i
  11185. },
  11186. circle: function(t, e) {
  11187. var i = new Yr;
  11188. return fd(e, i),
  11189. md(t, i, this._defs),
  11190. i.setShape({
  11191. cx: parseFloat(t.getAttribute("cx") || 0),
  11192. cy: parseFloat(t.getAttribute("cy") || 0),
  11193. r: parseFloat(t.getAttribute("r") || 0)
  11194. }),
  11195. i
  11196. },
  11197. line: function(t, e) {
  11198. var i = new ls;
  11199. return fd(e, i),
  11200. md(t, i, this._defs),
  11201. i.setShape({
  11202. x1: parseFloat(t.getAttribute("x1") || 0),
  11203. y1: parseFloat(t.getAttribute("y1") || 0),
  11204. x2: parseFloat(t.getAttribute("x2") || 0),
  11205. y2: parseFloat(t.getAttribute("y2") || 0)
  11206. }),
  11207. i
  11208. },
  11209. ellipse: function(t, e) {
  11210. var i = new sd;
  11211. return fd(e, i),
  11212. md(t, i, this._defs),
  11213. i.setShape({
  11214. cx: parseFloat(t.getAttribute("cx") || 0),
  11215. cy: parseFloat(t.getAttribute("cy") || 0),
  11216. rx: parseFloat(t.getAttribute("rx") || 0),
  11217. ry: parseFloat(t.getAttribute("ry") || 0)
  11218. }),
  11219. i
  11220. },
  11221. polygon: function(t, e) {
  11222. var i = t.getAttribute("points");
  11223. i = i && pd(i);
  11224. var n = new Qr({
  11225. shape: {
  11226. points: i || []
  11227. }
  11228. });
  11229. return fd(e, n),
  11230. md(t, n, this._defs),
  11231. n
  11232. },
  11233. polyline: function(t, e) {
  11234. var i = new Ar;
  11235. fd(e, i),
  11236. md(t, i, this._defs);
  11237. var n = t.getAttribute("points");
  11238. return n = n && pd(n),
  11239. new ts({
  11240. shape: {
  11241. points: n || []
  11242. }
  11243. })
  11244. },
  11245. image: function(t, e) {
  11246. var i = new Qn;
  11247. return fd(e, i),
  11248. md(t, i, this._defs),
  11249. i.setStyle({
  11250. image: t.getAttribute("xlink:href"),
  11251. x: t.getAttribute("x"),
  11252. y: t.getAttribute("y"),
  11253. width: t.getAttribute("width"),
  11254. height: t.getAttribute("height")
  11255. }),
  11256. i
  11257. },
  11258. text: function(t, e) {
  11259. var i = t.getAttribute("x") || 0
  11260. , n = t.getAttribute("y") || 0
  11261. , o = t.getAttribute("dx") || 0
  11262. , a = t.getAttribute("dy") || 0;
  11263. this._textX = parseFloat(i) + parseFloat(o),
  11264. this._textY = parseFloat(n) + parseFloat(a);
  11265. var r = new Ci;
  11266. return fd(e, r),
  11267. md(t, r, this._defs),
  11268. r
  11269. },
  11270. tspan: function(t, e) {
  11271. var i = t.getAttribute("x")
  11272. , n = t.getAttribute("y");
  11273. null != i && (this._textX = parseFloat(i)),
  11274. null != n && (this._textY = parseFloat(n));
  11275. var o = t.getAttribute("dx") || 0
  11276. , a = t.getAttribute("dy") || 0
  11277. , r = new Ci;
  11278. return fd(e, r),
  11279. md(t, r, this._defs),
  11280. this._textX += o,
  11281. this._textY += a,
  11282. r
  11283. },
  11284. path: function(t, e) {
  11285. var i = Zr(t.getAttribute("d") || "");
  11286. return fd(e, i),
  11287. md(t, i, this._defs),
  11288. i
  11289. }
  11290. }
  11291. , dd = {
  11292. lineargradient: function(t) {
  11293. var e = parseInt(t.getAttribute("x1") || 0, 10)
  11294. , i = parseInt(t.getAttribute("y1") || 0, 10)
  11295. , n = parseInt(t.getAttribute("x2") || 10, 10)
  11296. , o = parseInt(t.getAttribute("y2") || 0, 10)
  11297. , a = new gs(e,i,n,o);
  11298. return function(t, e) {
  11299. var i = t.firstChild;
  11300. for (; i; ) {
  11301. if (1 === i.nodeType) {
  11302. var n = i.getAttribute("offset");
  11303. n = 0 < n.indexOf("%") ? parseInt(n, 10) / 100 : n ? parseFloat(n) : 0;
  11304. var o = i.getAttribute("stop-color") || "#000000";
  11305. e.addColorStop(n, o)
  11306. }
  11307. i = i.nextSibling
  11308. }
  11309. }(t, a),
  11310. a
  11311. },
  11312. radialgradient: function(t) {}
  11313. };
  11314. function fd(t, e) {
  11315. t && t.__inheritedStyle && (e.__inheritedStyle || (e.__inheritedStyle = {}),
  11316. D(e.__inheritedStyle, t.__inheritedStyle))
  11317. }
  11318. function pd(t) {
  11319. for (var e = j(t).split(ld), i = [], n = 0; n < e.length; n += 2) {
  11320. var o = parseFloat(e[n])
  11321. , a = parseFloat(e[n + 1]);
  11322. i.push([o, a])
  11323. }
  11324. return i
  11325. }
  11326. var gd = {
  11327. fill: "fill",
  11328. stroke: "stroke",
  11329. "stroke-width": "lineWidth",
  11330. opacity: "opacity",
  11331. "fill-opacity": "fillOpacity",
  11332. "stroke-opacity": "strokeOpacity",
  11333. "stroke-dasharray": "lineDash",
  11334. "stroke-dashoffset": "lineDashOffset",
  11335. "stroke-linecap": "lineCap",
  11336. "stroke-linejoin": "lineJoin",
  11337. "stroke-miterlimit": "miterLimit",
  11338. "font-family": "fontFamily",
  11339. "font-size": "fontSize",
  11340. "font-style": "fontStyle",
  11341. "font-weight": "fontWeight",
  11342. "text-align": "textAlign",
  11343. "alignment-baseline": "textBaseline"
  11344. };
  11345. function md(t, e, i, n) {
  11346. var o = e.__inheritedStyle || {}
  11347. , a = "text" === e.type;
  11348. if (1 === t.nodeType && (function(t, e) {
  11349. var i = t.getAttribute("transform");
  11350. if (i) {
  11351. i = i.replace(/,/g, " ");
  11352. var n = null
  11353. , o = [];
  11354. i.replace(xd, function(t, e, i) {
  11355. o.push(e, i)
  11356. });
  11357. for (var a = o.length - 1; 0 < a; a -= 2) {
  11358. var r = o[a]
  11359. , s = o[a - 1];
  11360. switch (n = n || ae(),
  11361. s) {
  11362. case "translate":
  11363. r = j(r).split(ld),
  11364. ue(n, n, [parseFloat(r[0]), parseFloat(r[1] || 0)]);
  11365. break;
  11366. case "scale":
  11367. r = j(r).split(ld),
  11368. ce(n, n, [parseFloat(r[0]), parseFloat(r[1] || r[0])]);
  11369. break;
  11370. case "rotate":
  11371. r = j(r).split(ld),
  11372. he(n, n, parseFloat(r[0]));
  11373. break;
  11374. case "skew":
  11375. r = j(r).split(ld),
  11376. console.warn("Skew transform is not supported yet");
  11377. break;
  11378. case "matrix":
  11379. r = j(r).split(ld);
  11380. n[0] = parseFloat(r[0]),
  11381. n[1] = parseFloat(r[1]),
  11382. n[2] = parseFloat(r[2]),
  11383. n[3] = parseFloat(r[3]),
  11384. n[4] = parseFloat(r[4]),
  11385. n[5] = parseFloat(r[5])
  11386. }
  11387. }
  11388. e.setLocalTransform(n)
  11389. }
  11390. }(t, e),
  11391. P(o, function(t) {
  11392. var e = t.getAttribute("style")
  11393. , i = {};
  11394. if (!e)
  11395. return i;
  11396. var n, o = {};
  11397. _d.lastIndex = 0;
  11398. for (; null != (n = _d.exec(e)); )
  11399. o[n[1]] = n[2];
  11400. for (var a in gd)
  11401. gd.hasOwnProperty(a) && null != o[a] && (i[gd[a]] = o[a]);
  11402. return i
  11403. }(t)),
  11404. !n))
  11405. for (var r in gd)
  11406. if (gd.hasOwnProperty(r)) {
  11407. var s = t.getAttribute(r);
  11408. null != s && (o[gd[r]] = s)
  11409. }
  11410. var l = a ? "textFill" : "fill"
  11411. , u = a ? "textStroke" : "stroke";
  11412. e.style = e.style || new Ui;
  11413. var h = e.style;
  11414. null != o.fill && h.set(l, yd(o.fill, i)),
  11415. null != o.stroke && h.set(u, yd(o.stroke, i)),
  11416. E(["lineWidth", "opacity", "fillOpacity", "strokeOpacity", "miterLimit", "fontSize"], function(t) {
  11417. var e = "lineWidth" === t && a ? "textStrokeWidth" : t;
  11418. null != o[t] && h.set(e, parseFloat(o[t]))
  11419. }),
  11420. o.textBaseline && "auto" !== o.textBaseline || (o.textBaseline = "alphabetic"),
  11421. "alphabetic" === o.textBaseline && (o.textBaseline = "bottom"),
  11422. "start" === o.textAlign && (o.textAlign = "left"),
  11423. "end" === o.textAlign && (o.textAlign = "right"),
  11424. E(["lineDashOffset", "lineCap", "lineJoin", "fontWeight", "fontFamily", "fontStyle", "textAlign", "textBaseline"], function(t) {
  11425. null != o[t] && h.set(t, o[t])
  11426. }),
  11427. o.lineDash && (e.style.lineDash = j(o.lineDash).split(ld)),
  11428. h[u] && "none" !== h[u] && (e[u] = !0),
  11429. e.__inheritedStyle = o
  11430. }
  11431. var vd = /url\(\s*#(.*?)\)/;
  11432. function yd(t, e) {
  11433. var i = e && t && t.match(vd);
  11434. return i ? e[j(i[1])] : t
  11435. }
  11436. var xd = /(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g;
  11437. var _d = /([^\s:;]+)\s*:\s*([^:;]+)/g;
  11438. function wd(t, e, i) {
  11439. var n = e / t.width
  11440. , o = i / t.height
  11441. , a = Math.min(n, o);
  11442. return {
  11443. scale: [a, a],
  11444. position: [-(t.x + t.width / 2) * a + e / 2, -(t.y + t.height / 2) * a + i / 2]
  11445. }
  11446. }
  11447. var bd = Q()
  11448. , Sd = {
  11449. registerMap: function(t, e, i) {
  11450. var n;
  11451. return E(n = L(e) ? e : e.svg ? [{
  11452. type: "svg",
  11453. source: e.svg,
  11454. specialAreas: e.specialAreas
  11455. }] : (e.geoJson && !e.features && (i = e.specialAreas,
  11456. e = e.geoJson),
  11457. [{
  11458. type: "geoJSON",
  11459. source: e,
  11460. specialAreas: i
  11461. }]), function(t) {
  11462. var e = t.type;
  11463. "geoJson" === e && (e = t.type = "geoJSON"),
  11464. (0,
  11465. Md[e])(t)
  11466. }),
  11467. bd.set(t, n)
  11468. },
  11469. retrieveMap: function(t) {
  11470. return bd.get(t)
  11471. }
  11472. }
  11473. , Md = {
  11474. geoJSON: function(t) {
  11475. var e = t.source;
  11476. t.geoJSON = R(e) ? "undefined" != typeof JSON && JSON.parse ? JSON.parse(e) : new Function("return (" + e + ");")() : e
  11477. },
  11478. svg: function(t) {
  11479. t.svgXML = ud(t.source)
  11480. }
  11481. }
  11482. , Id = Y
  11483. , Td = E
  11484. , Ad = C
  11485. , Dd = z
  11486. , Cd = ku.parseClassType
  11487. , Ld = {
  11488. PROCESSOR: {
  11489. FILTER: 1e3,
  11490. SERIES_FILTER: 800,
  11491. STATISTIC: 5e3
  11492. },
  11493. VISUAL: {
  11494. LAYOUT: 1e3,
  11495. PROGRESSIVE_LAYOUT: 1100,
  11496. GLOBAL: 2e3,
  11497. CHART: 3e3,
  11498. POST_CHART_LAYOUT: 3500,
  11499. COMPONENT: 4e3,
  11500. BRUSH: 5e3
  11501. }
  11502. }
  11503. , kd = "__flagInMainProcess"
  11504. , Pd = "__optionUpdated"
  11505. , Nd = /^[a-zA-Z0-9_]+$/;
  11506. function Od(n, o) {
  11507. return function(t, e, i) {
  11508. !o && this._disposed || (t = t && t.toLowerCase(),
  11509. Ct.prototype[n].call(this, t, e, i))
  11510. }
  11511. }
  11512. function Ed() {
  11513. Ct.call(this)
  11514. }
  11515. function Rd(t, e, i) {
  11516. i = i || {},
  11517. "string" == typeof e && (e = sf[e]),
  11518. this.id,
  11519. this.group,
  11520. this._dom = t;
  11521. var n = this._zr = ko(t, {
  11522. renderer: i.renderer || "canvas",
  11523. devicePixelRatio: i.devicePixelRatio,
  11524. width: i.width,
  11525. height: i.height
  11526. });
  11527. this._throttledZrFlush = Lc(A(n.flush, n), 17),
  11528. (e = k(e)) && Lh(e, !0),
  11529. this._theme = e,
  11530. this._chartsViews = [],
  11531. this._chartsMap = {},
  11532. this._componentsViews = [],
  11533. this._componentsMap = {},
  11534. this._coordSysMgr = new lh;
  11535. var o = this._api = function(i) {
  11536. var t = i._coordSysMgr;
  11537. return P(new rh(i), {
  11538. getCoordinateSystems: A(t.getCoordinateSystems, t),
  11539. getComponentByElement: function(t) {
  11540. for (; t; ) {
  11541. var e = t.__ecComponentInfo;
  11542. if (null != e)
  11543. return i._model.getComponent(e.mainType, e.index);
  11544. t = t.parent
  11545. }
  11546. }
  11547. })
  11548. }(this);
  11549. function a(t, e) {
  11550. return t.__prio - e.__prio
  11551. }
  11552. zi(rf, a),
  11553. zi(nf, a),
  11554. this._scheduler = new zc(this,o,nf,rf),
  11555. Ct.call(this, this._ecEventProcessor = new Qd),
  11556. this._messageCenter = new Ed,
  11557. this._initEvents(),
  11558. this.resize = A(this.resize, this),
  11559. this._pendingActions = [],
  11560. n.animation.on("frame", this._onframe, this),
  11561. function(t, e) {
  11562. t.on("rendered", function() {
  11563. e.trigger("rendered"),
  11564. !t.animation.isFinished() || e[Pd] || e._scheduler.unfinished || e._pendingActions.length || e.trigger("finished")
  11565. })
  11566. }(n, this),
  11567. K(this)
  11568. }
  11569. Ed.prototype.on = Od("on", !0),
  11570. Ed.prototype.off = Od("off", !0),
  11571. Ed.prototype.one = Od("one", !0),
  11572. b(Ed, Ct);
  11573. var zd = Rd.prototype;
  11574. function Bd(t, e, i) {
  11575. if (!this._disposed) {
  11576. var n, o = this._model, a = this._coordSysMgr.getCoordinateSystems();
  11577. e = Ko(o, e);
  11578. for (var r = 0; r < a.length; r++) {
  11579. var s = a[r];
  11580. if (s[t] && null != (n = s[t](o, e, i)))
  11581. return n
  11582. }
  11583. }
  11584. }
  11585. zd._onframe = function() {
  11586. if (!this._disposed) {
  11587. var t = this._scheduler;
  11588. if (this[Pd]) {
  11589. var e = this[Pd].silent;
  11590. this[kd] = !0,
  11591. Gd(this),
  11592. Vd.update.call(this),
  11593. this[kd] = !1,
  11594. this[Pd] = !1,
  11595. Zd.call(this, e),
  11596. Ud.call(this, e)
  11597. } else if (t.unfinished) {
  11598. var i = 1
  11599. , n = this._model
  11600. , o = this._api;
  11601. t.unfinished = !1;
  11602. do {
  11603. var a = +new Date;
  11604. t.performSeriesTasks(n),
  11605. t.performDataProcessorTasks(n),
  11606. Wd(this, n),
  11607. t.performVisualTasks(n),
  11608. qd(this, this._model, o, "remain"),
  11609. i -= +new Date - a
  11610. } while (0 < i && t.unfinished);
  11611. t.unfinished || this._zr.flush()
  11612. }
  11613. }
  11614. }
  11615. ,
  11616. zd.getDom = function() {
  11617. return this._dom
  11618. }
  11619. ,
  11620. zd.getZr = function() {
  11621. return this._zr
  11622. }
  11623. ,
  11624. zd.setOption = function(t, e, i) {
  11625. if (!this._disposed) {
  11626. var n;
  11627. if (Dd(e) && (i = e.lazyUpdate,
  11628. n = e.silent,
  11629. e = e.notMerge),
  11630. this[kd] = !0,
  11631. !this._model || e) {
  11632. var o = new ph(this._api)
  11633. , a = this._theme
  11634. , r = this._model = new ih;
  11635. r.scheduler = this._scheduler,
  11636. r.init(null, null, a, o)
  11637. }
  11638. this._model.setOption(t, of),
  11639. i ? (this[Pd] = {
  11640. silent: n
  11641. },
  11642. this[kd] = !1) : (Gd(this),
  11643. Vd.update.call(this),
  11644. this._zr.flush(),
  11645. this[Pd] = !1,
  11646. this[kd] = !1,
  11647. Zd.call(this, n),
  11648. Ud.call(this, n))
  11649. }
  11650. }
  11651. ,
  11652. zd.setTheme = function() {
  11653. console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")
  11654. }
  11655. ,
  11656. zd.getModel = function() {
  11657. return this._model
  11658. }
  11659. ,
  11660. zd.getOption = function() {
  11661. return this._model && this._model.getOption()
  11662. }
  11663. ,
  11664. zd.getWidth = function() {
  11665. return this._zr.getWidth()
  11666. }
  11667. ,
  11668. zd.getHeight = function() {
  11669. return this._zr.getHeight()
  11670. }
  11671. ,
  11672. zd.getDevicePixelRatio = function() {
  11673. return this._zr.painter.dpr || window.devicePixelRatio || 1
  11674. }
  11675. ,
  11676. zd.getRenderedCanvas = function(t) {
  11677. if (v.canvasSupported)
  11678. return (t = t || {}).pixelRatio = t.pixelRatio || 1,
  11679. t.backgroundColor = t.backgroundColor || this._model.get("backgroundColor"),
  11680. this._zr.painter.getRenderedCanvas(t)
  11681. }
  11682. ,
  11683. zd.getSvgDataURL = function() {
  11684. if (v.svgSupported) {
  11685. var t = this._zr;
  11686. return E(t.storage.getDisplayList(), function(t) {
  11687. t.stopAnimation(!0)
  11688. }),
  11689. t.painter.toDataURL()
  11690. }
  11691. }
  11692. ,
  11693. zd.getDataURL = function(t) {
  11694. if (!this._disposed) {
  11695. var e = (t = t || {}).excludeComponents
  11696. , i = this._model
  11697. , n = []
  11698. , o = this;
  11699. Td(e, function(t) {
  11700. i.eachComponent({
  11701. mainType: t
  11702. }, function(t) {
  11703. var e = o._componentsMap[t.__viewId];
  11704. e.group.ignore || (n.push(e),
  11705. e.group.ignore = !0)
  11706. })
  11707. });
  11708. var a = "svg" === this._zr.painter.getType() ? this.getSvgDataURL() : this.getRenderedCanvas(t).toDataURL("image/" + (t && t.type || "png"));
  11709. return Td(n, function(t) {
  11710. t.group.ignore = !1
  11711. }),
  11712. a
  11713. }
  11714. }
  11715. ,
  11716. zd.getConnectedDataURL = function(o) {
  11717. if (!this._disposed && v.canvasSupported) {
  11718. var a = "svg" === o.type
  11719. , r = this.group
  11720. , s = Math.min
  11721. , l = Math.max;
  11722. if (hf[r]) {
  11723. var u = 1 / 0
  11724. , h = 1 / 0
  11725. , c = -1 / 0
  11726. , d = -1 / 0
  11727. , f = []
  11728. , i = o && o.pixelRatio || 1;
  11729. E(uf, function(t, e) {
  11730. if (t.group === r) {
  11731. var i = a ? t.getZr().painter.getSvgDom().innerHTML : t.getRenderedCanvas(k(o))
  11732. , n = t.getDom().getBoundingClientRect();
  11733. u = s(n.left, u),
  11734. h = s(n.top, h),
  11735. c = l(n.right, c),
  11736. d = l(n.bottom, d),
  11737. f.push({
  11738. dom: i,
  11739. left: n.left,
  11740. top: n.top
  11741. })
  11742. }
  11743. });
  11744. var t = (c *= i) - (u *= i)
  11745. , e = (d *= i) - (h *= i)
  11746. , n = y()
  11747. , p = ko(n, {
  11748. renderer: a ? "svg" : "canvas"
  11749. });
  11750. if (p.resize({
  11751. width: t,
  11752. height: e
  11753. }),
  11754. a) {
  11755. var g = "";
  11756. return Td(f, function(t) {
  11757. var e = t.left - u
  11758. , i = t.top - h;
  11759. g += '<g transform="translate(' + e + "," + i + ')">' + t.dom + "</g>"
  11760. }),
  11761. p.painter.getSvgRoot().innerHTML = g,
  11762. o.connectedBackgroundColor && p.painter.setBackgroundColor(o.connectedBackgroundColor),
  11763. p.refreshImmediately(),
  11764. p.painter.toDataURL()
  11765. }
  11766. return o.connectedBackgroundColor && p.add(new rs({
  11767. shape: {
  11768. x: 0,
  11769. y: 0,
  11770. width: t,
  11771. height: e
  11772. },
  11773. style: {
  11774. fill: o.connectedBackgroundColor
  11775. }
  11776. })),
  11777. Td(f, function(t) {
  11778. var e = new Qn({
  11779. style: {
  11780. x: t.left * i - u,
  11781. y: t.top * i - h,
  11782. image: t.dom
  11783. }
  11784. });
  11785. p.add(e)
  11786. }),
  11787. p.refreshImmediately(),
  11788. n.toDataURL("image/" + (o && o.type || "png"))
  11789. }
  11790. return this.getDataURL(o)
  11791. }
  11792. }
  11793. ,
  11794. zd.convertToPixel = T(Bd, "convertToPixel"),
  11795. zd.convertFromPixel = T(Bd, "convertFromPixel"),
  11796. zd.containPixel = function(t, o) {
  11797. var a;
  11798. if (!this._disposed)
  11799. return E(t = Ko(this._model, t), function(t, n) {
  11800. 0 <= n.indexOf("Models") && E(t, function(t) {
  11801. var e = t.coordinateSystem;
  11802. if (e && e.containPoint)
  11803. a |= !!e.containPoint(o);
  11804. else if ("seriesModels" === n) {
  11805. var i = this._chartsMap[t.__viewId];
  11806. i && i.containPoint && (a |= i.containPoint(o, t))
  11807. }
  11808. }, this)
  11809. }, this),
  11810. !!a
  11811. }
  11812. ,
  11813. zd.getVisual = function(t, e) {
  11814. var i = (t = Ko(this._model, t, {
  11815. defaultMainType: "series"
  11816. })).seriesModel.getData()
  11817. , n = t.hasOwnProperty("dataIndexInside") ? t.dataIndexInside : t.hasOwnProperty("dataIndex") ? i.indexOfRawIndex(t.dataIndex) : null;
  11818. return null != n ? i.getItemVisual(n, e) : i.getVisual(e)
  11819. }
  11820. ,
  11821. zd.getViewOfComponentModel = function(t) {
  11822. return this._componentsMap[t.__viewId]
  11823. }
  11824. ,
  11825. zd.getViewOfSeriesModel = function(t) {
  11826. return this._chartsMap[t.__viewId]
  11827. }
  11828. ;
  11829. var Vd = {
  11830. prepareAndUpdate: function(t) {
  11831. Gd(this),
  11832. Vd.update.call(this, t)
  11833. },
  11834. update: function(t) {
  11835. var e = this._model
  11836. , i = this._api
  11837. , n = this._zr
  11838. , o = this._coordSysMgr
  11839. , a = this._scheduler;
  11840. if (e) {
  11841. a.restoreData(e, t),
  11842. a.performSeriesTasks(e),
  11843. o.create(e, i),
  11844. a.performDataProcessorTasks(e, t),
  11845. Wd(this, e),
  11846. o.update(e, i),
  11847. Yd(e),
  11848. a.performVisualTasks(e, t),
  11849. jd(this, e, i, t);
  11850. var r = e.get("backgroundColor") || "transparent";
  11851. if (v.canvasSupported)
  11852. n.setBackgroundColor(r);
  11853. else {
  11854. var s = Fe(r);
  11855. r = $e(s, "rgb"),
  11856. 0 === s[3] && (r = "transparent")
  11857. }
  11858. Kd(e, i)
  11859. }
  11860. },
  11861. updateTransform: function(o) {
  11862. var a = this._model
  11863. , r = this
  11864. , s = this._api;
  11865. if (a) {
  11866. var l = [];
  11867. a.eachComponent(function(t, e) {
  11868. var i = r.getViewOfComponentModel(e);
  11869. if (i && i.__alive)
  11870. if (i.updateTransform) {
  11871. var n = i.updateTransform(e, a, s, o);
  11872. n && n.update && l.push(i)
  11873. } else
  11874. l.push(i)
  11875. });
  11876. var n = Q();
  11877. a.eachSeries(function(t) {
  11878. var e = r._chartsMap[t.__viewId];
  11879. if (e.updateTransform) {
  11880. var i = e.updateTransform(t, a, s, o);
  11881. i && i.update && n.set(t.uid, 1)
  11882. } else
  11883. n.set(t.uid, 1)
  11884. }),
  11885. Yd(a),
  11886. this._scheduler.performVisualTasks(a, o, {
  11887. setDirty: !0,
  11888. dirtyMap: n
  11889. }),
  11890. qd(r, a, s, o, n),
  11891. Kd(a, this._api)
  11892. }
  11893. },
  11894. updateView: function(t) {
  11895. var e = this._model;
  11896. e && (_c.markUpdateMethod(t, "updateView"),
  11897. Yd(e),
  11898. this._scheduler.performVisualTasks(e, t, {
  11899. setDirty: !0
  11900. }),
  11901. jd(this, this._model, this._api, t),
  11902. Kd(e, this._api))
  11903. },
  11904. updateVisual: function(t) {
  11905. Vd.update.call(this, t)
  11906. },
  11907. updateLayout: function(t) {
  11908. Vd.update.call(this, t)
  11909. }
  11910. };
  11911. function Gd(t) {
  11912. var e = t._model
  11913. , i = t._scheduler;
  11914. i.restorePipelines(e),
  11915. i.prepareStageTasks(),
  11916. Xd(t, "component", e, i),
  11917. Xd(t, "chart", e, i),
  11918. i.plan()
  11919. }
  11920. function Fd(e, i, n, o, t) {
  11921. var a = e._model;
  11922. if (o) {
  11923. var r = {};
  11924. r[o + "Id"] = n[o + "Id"],
  11925. r[o + "Index"] = n[o + "Index"],
  11926. r[o + "Name"] = n[o + "Name"];
  11927. var s = {
  11928. mainType: o,
  11929. query: r
  11930. };
  11931. t && (s.subType = t);
  11932. var l = n.excludeSeriesId;
  11933. null != l && (l = Q(Vo(l))),
  11934. a && a.eachComponent(s, function(t) {
  11935. l && null != l.get(t.id) || u(e["series" === o ? "_chartsMap" : "_componentsMap"][t.__viewId])
  11936. }, e)
  11937. } else
  11938. Td(e._componentsViews.concat(e._chartsViews), u);
  11939. function u(t) {
  11940. t && t.__alive && t[i] && t[i](t.__model, a, e._api, n)
  11941. }
  11942. }
  11943. function Wd(t, e) {
  11944. var i = t._chartsMap
  11945. , n = t._scheduler;
  11946. e.eachSeries(function(t) {
  11947. n.updateStreamModes(t, i[t.__viewId])
  11948. })
  11949. }
  11950. function Hd(e, t) {
  11951. var i = e.type
  11952. , n = e.escapeConnect
  11953. , o = tf[i]
  11954. , a = o.actionInfo
  11955. , r = (a.update || "update").split(":")
  11956. , s = r.pop();
  11957. r = null != r[0] && Cd(r[0]),
  11958. this[kd] = !0;
  11959. var l = [e]
  11960. , u = !1;
  11961. e.batch && (u = !0,
  11962. l = O(e.batch, function(t) {
  11963. return (t = D(P({}, t), e)).batch = null,
  11964. t
  11965. }));
  11966. var h, c = [], d = "highlight" === i || "downplay" === i;
  11967. Td(l, function(t) {
  11968. (h = (h = o.action(t, this._model, this._api)) || P({}, t)).type = a.event || h.type,
  11969. c.push(h),
  11970. d ? Fd(this, s, t, "series") : r && Fd(this, s, t, r.main, r.sub)
  11971. }, this),
  11972. "none" === s || d || r || (this[Pd] ? (Gd(this),
  11973. Vd.update.call(this, e),
  11974. this[Pd] = !1) : Vd[s].call(this, e)),
  11975. h = u ? {
  11976. type: a.event || i,
  11977. escapeConnect: n,
  11978. batch: c
  11979. } : c[0],
  11980. this[kd] = !1,
  11981. t || this._messageCenter.trigger(h.type, h)
  11982. }
  11983. function Zd(t) {
  11984. for (var e = this._pendingActions; e.length; ) {
  11985. var i = e.shift();
  11986. Hd.call(this, i, t)
  11987. }
  11988. }
  11989. function Ud(t) {
  11990. t || this.trigger("updated")
  11991. }
  11992. function Xd(t, e, o, a) {
  11993. for (var r = "component" === e, s = r ? t._componentsViews : t._chartsViews, l = r ? t._componentsMap : t._chartsMap, u = t._zr, h = t._api, i = 0; i < s.length; i++)
  11994. s[i].__alive = !1;
  11995. function n(t) {
  11996. var e = "_ec_" + t.id + "_" + t.type
  11997. , i = l[e];
  11998. if (!i) {
  11999. var n = Cd(t.type);
  12000. (i = new (r ? gc.getClass(n.main, n.sub) : _c.getClass(n.sub))).init(o, h),
  12001. l[e] = i,
  12002. s.push(i),
  12003. u.add(i.group)
  12004. }
  12005. t.__viewId = i.__id = e,
  12006. i.__alive = !0,
  12007. i.__model = t,
  12008. i.group.__ecComponentInfo = {
  12009. mainType: t.mainType,
  12010. index: t.componentIndex
  12011. },
  12012. r || a.prepareView(i, t, o, h)
  12013. }
  12014. r ? o.eachComponent(function(t, e) {
  12015. "series" !== t && n(e)
  12016. }) : o.eachSeries(n);
  12017. for (i = 0; i < s.length; ) {
  12018. var c = s[i];
  12019. c.__alive ? i++ : (r || c.renderTask.dispose(),
  12020. u.remove(c.group),
  12021. c.dispose(o, h),
  12022. s.splice(i, 1),
  12023. delete l[c.__id],
  12024. c.__id = c.group.__ecComponentInfo = null)
  12025. }
  12026. }
  12027. function Yd(t) {
  12028. t.clearColorPalette(),
  12029. t.eachSeries(function(t) {
  12030. t.clearColorPalette()
  12031. })
  12032. }
  12033. function jd(t, e, i, n) {
  12034. !function(t, i, n, o, e) {
  12035. Td(e || t._componentsViews, function(t) {
  12036. var e = t.__model;
  12037. t.render(e, i, n, o),
  12038. Jd(e, t)
  12039. })
  12040. }(t, e, i, n),
  12041. Td(t._chartsViews, function(t) {
  12042. t.__alive = !1
  12043. }),
  12044. qd(t, e, i, n),
  12045. Td(t._chartsViews, function(t) {
  12046. t.__alive || t.remove(e, i)
  12047. })
  12048. }
  12049. function qd(n, t, e, o, a) {
  12050. var r, s = n._scheduler;
  12051. t.eachSeries(function(t) {
  12052. var e = n._chartsMap[t.__viewId];
  12053. e.__alive = !0;
  12054. var i = e.renderTask;
  12055. s.updatePayload(i, o),
  12056. a && a.get(t.uid) && i.dirty(),
  12057. r |= i.perform(s.getPerformArgs(i)),
  12058. e.group.silent = !!t.get("silent"),
  12059. Jd(t, e),
  12060. function(t, e) {
  12061. var i = t.get("blendMode") || null;
  12062. e.group.traverse(function(t) {
  12063. t.isGroup || t.style.blend !== i && t.setStyle("blend", i),
  12064. t.eachPendingDisplayable && t.eachPendingDisplayable(function(t) {
  12065. t.setStyle("blend", i)
  12066. })
  12067. })
  12068. }(t, e)
  12069. }),
  12070. s.unfinished |= r,
  12071. function(i, t) {
  12072. var e = i._zr.storage
  12073. , n = 0;
  12074. e.traverse(function(t) {
  12075. n++
  12076. }),
  12077. n > t.get("hoverLayerThreshold") && !v.node && t.eachSeries(function(t) {
  12078. if (!t.preventUsingHoverLayer) {
  12079. var e = i._chartsMap[t.__viewId];
  12080. e.__alive && e.group.traverse(function(t) {
  12081. t.useHoverLayer = !0
  12082. })
  12083. }
  12084. })
  12085. }(n, t),
  12086. Ec(n._zr.dom, t)
  12087. }
  12088. function Kd(e, i) {
  12089. Td(af, function(t) {
  12090. t(e, i)
  12091. })
  12092. }
  12093. zd.resize = function(t) {
  12094. if (!this._disposed) {
  12095. this._zr.resize(t);
  12096. var e = this._model;
  12097. if (this._loadingFX && this._loadingFX.resize(),
  12098. e) {
  12099. var i = e.resetOption("media")
  12100. , n = t && t.silent;
  12101. this[kd] = !0,
  12102. i && Gd(this),
  12103. Vd.update.call(this),
  12104. this[kd] = !1,
  12105. Zd.call(this, n),
  12106. Ud.call(this, n)
  12107. }
  12108. }
  12109. }
  12110. ,
  12111. zd.showLoading = function(t, e) {
  12112. if (!this._disposed && (Dd(t) && (e = t,
  12113. t = ""),
  12114. t = t || "default",
  12115. this.hideLoading(),
  12116. lf[t])) {
  12117. var i = lf[t](this._api, e)
  12118. , n = this._zr;
  12119. this._loadingFX = i,
  12120. n.add(i)
  12121. }
  12122. }
  12123. ,
  12124. zd.hideLoading = function() {
  12125. this._disposed || (this._loadingFX && this._zr.remove(this._loadingFX),
  12126. this._loadingFX = null)
  12127. }
  12128. ,
  12129. zd.makeActionFromEvent = function(t) {
  12130. var e = P({}, t);
  12131. return e.type = ef[t.type],
  12132. e
  12133. }
  12134. ,
  12135. zd.dispatchAction = function(t, e) {
  12136. this._disposed || (Dd(e) || (e = {
  12137. silent: !!e
  12138. }),
  12139. tf[t.type] && this._model && (this[kd] ? this._pendingActions.push(t) : (Hd.call(this, t, e.silent),
  12140. e.flush ? this._zr.flush(!0) : !1 !== e.flush && v.browser.weChat && this._throttledZrFlush(),
  12141. Zd.call(this, e.silent),
  12142. Ud.call(this, e.silent))))
  12143. }
  12144. ,
  12145. zd.appendData = function(t) {
  12146. if (!this._disposed) {
  12147. var e = t.seriesIndex;
  12148. this.getModel().getSeriesByIndex(e).appendData(t),
  12149. this._scheduler.unfinished = !0
  12150. }
  12151. }
  12152. ,
  12153. zd.on = Od("on", !1),
  12154. zd.off = Od("off", !1),
  12155. zd.one = Od("one", !1);
  12156. var $d = ["click", "dblclick", "mouseover", "mouseout", "mousemove", "mousedown", "mouseup", "globalout", "contextmenu"];
  12157. function Jd(t, e) {
  12158. var i = t.get("z")
  12159. , n = t.get("zlevel");
  12160. e.group.traverse(function(t) {
  12161. "group" !== t.type && (null != i && (t.z = i),
  12162. null != n && (t.zlevel = n))
  12163. })
  12164. }
  12165. function Qd() {
  12166. this.eventInfo
  12167. }
  12168. zd._initEvents = function() {
  12169. Td($d, function(u) {
  12170. function t(t) {
  12171. var e, i = this.getModel(), n = t.target;
  12172. if ("globalout" === u)
  12173. e = {};
  12174. else if (n && null != n.dataIndex) {
  12175. var o = n.dataModel || i.getSeriesByIndex(n.seriesIndex);
  12176. e = o && o.getDataParams(n.dataIndex, n.dataType, n) || {}
  12177. } else
  12178. n && n.eventData && (e = P({}, n.eventData));
  12179. if (e) {
  12180. var a = e.componentType
  12181. , r = e.componentIndex;
  12182. "markLine" !== a && "markPoint" !== a && "markArea" !== a || (a = "series",
  12183. r = e.seriesIndex);
  12184. var s = a && null != r && i.getComponent(a, r)
  12185. , l = s && this["series" === s.mainType ? "_chartsMap" : "_componentsMap"][s.__viewId];
  12186. e.event = t,
  12187. e.type = u,
  12188. this._ecEventProcessor.eventInfo = {
  12189. targetEl: n,
  12190. packedEvent: e,
  12191. model: s,
  12192. view: l
  12193. },
  12194. this.trigger(u, e)
  12195. }
  12196. }
  12197. t.zrEventfulCallAtLast = !0,
  12198. this._zr.on(u, t, this)
  12199. }, this),
  12200. Td(ef, function(t, e) {
  12201. this._messageCenter.on(e, function(t) {
  12202. this.trigger(e, t)
  12203. }, this)
  12204. }, this)
  12205. }
  12206. ,
  12207. zd.isDisposed = function() {
  12208. return this._disposed
  12209. }
  12210. ,
  12211. zd.clear = function() {
  12212. this._disposed || this.setOption({
  12213. series: []
  12214. }, !0)
  12215. }
  12216. ,
  12217. zd.dispose = function() {
  12218. if (!this._disposed) {
  12219. this._disposed = !0,
  12220. Jo(this.getDom(), ff, "");
  12221. var e = this._api
  12222. , i = this._model;
  12223. Td(this._componentsViews, function(t) {
  12224. t.dispose(i, e)
  12225. }),
  12226. Td(this._chartsViews, function(t) {
  12227. t.dispose(i, e)
  12228. }),
  12229. this._zr.dispose(),
  12230. delete uf[this.id]
  12231. }
  12232. }
  12233. ,
  12234. b(Rd, Ct),
  12235. Qd.prototype = {
  12236. constructor: Qd,
  12237. normalizeQuery: function(t) {
  12238. var s = {}
  12239. , l = {}
  12240. , u = {};
  12241. if (R(t)) {
  12242. var e = Cd(t);
  12243. s.mainType = e.main || null,
  12244. s.subType = e.sub || null
  12245. } else {
  12246. var h = ["Index", "Name", "Id"]
  12247. , c = {
  12248. name: 1,
  12249. dataIndex: 1,
  12250. dataType: 1
  12251. };
  12252. E(t, function(t, e) {
  12253. for (var i = !1, n = 0; n < h.length; n++) {
  12254. var o = h[n]
  12255. , a = e.lastIndexOf(o);
  12256. if (0 < a && a === e.length - o.length) {
  12257. var r = e.slice(0, a);
  12258. "data" !== r && (s.mainType = r,
  12259. s[o.toLowerCase()] = t,
  12260. i = !0)
  12261. }
  12262. }
  12263. c.hasOwnProperty(e) && (l[e] = t,
  12264. i = !0),
  12265. i || (u[e] = t)
  12266. })
  12267. }
  12268. return {
  12269. cptQuery: s,
  12270. dataQuery: l,
  12271. otherQuery: u
  12272. }
  12273. },
  12274. filter: function(t, e, i) {
  12275. var n = this.eventInfo;
  12276. if (!n)
  12277. return !0;
  12278. var o = n.targetEl
  12279. , a = n.packedEvent
  12280. , r = n.model
  12281. , s = n.view;
  12282. if (!r || !s)
  12283. return !0;
  12284. var l = e.cptQuery
  12285. , u = e.dataQuery;
  12286. return h(l, r, "mainType") && h(l, r, "subType") && h(l, r, "index", "componentIndex") && h(l, r, "name") && h(l, r, "id") && h(u, a, "name") && h(u, a, "dataIndex") && h(u, a, "dataType") && (!s.filterForExposedEvent || s.filterForExposedEvent(t, e.otherQuery, o, a));
  12287. function h(t, e, i, n) {
  12288. return null == t[i] || e[n || i] === t[i]
  12289. }
  12290. },
  12291. afterTrigger: function() {
  12292. this.eventInfo = null
  12293. }
  12294. };
  12295. var tf = {}
  12296. , ef = {}
  12297. , nf = []
  12298. , of = []
  12299. , af = []
  12300. , rf = []
  12301. , sf = {}
  12302. , lf = {}
  12303. , uf = {}
  12304. , hf = {}
  12305. , cf = new Date - 0
  12306. , df = new Date - 0
  12307. , ff = "_echarts_instance_";
  12308. function pf(t) {
  12309. hf[t] = !1
  12310. }
  12311. var gf = pf;
  12312. function mf(t) {
  12313. return uf[function(t, e) {
  12314. return t.getAttribute ? t.getAttribute(e) : t[e]
  12315. }(t, ff)]
  12316. }
  12317. function vf(t, e) {
  12318. sf[t] = e
  12319. }
  12320. function yf(t) {
  12321. of.push(t)
  12322. }
  12323. function xf(t, e) {
  12324. Mf(nf, t, e, 1e3)
  12325. }
  12326. function _f(t, e, i) {
  12327. "function" == typeof e && (i = e,
  12328. e = "");
  12329. var n = Dd(t) ? t.type : [t, t = {
  12330. event: e
  12331. }][0];
  12332. t.event = (t.event || n).toLowerCase(),
  12333. e = t.event,
  12334. Id(Nd.test(n) && Nd.test(e)),
  12335. tf[n] || (tf[n] = {
  12336. action: i,
  12337. actionInfo: t
  12338. }),
  12339. ef[e] = n
  12340. }
  12341. function wf(t, e) {
  12342. lh.register(t, e)
  12343. }
  12344. function bf(t, e) {
  12345. Mf(rf, t, e, 1e3, "layout")
  12346. }
  12347. function Sf(t, e) {
  12348. Mf(rf, t, e, 3e3, "visual")
  12349. }
  12350. function Mf(t, e, i, n, o) {
  12351. (Ad(e) || Dd(e)) && (i = e,
  12352. e = n);
  12353. var a = zc.wrapStageHandler(i, o);
  12354. return a.__prio = e,
  12355. a.__raw = i,
  12356. t.push(a),
  12357. a
  12358. }
  12359. function If(t, e) {
  12360. lf[t] = e
  12361. }
  12362. function Tf(t) {
  12363. return ku.extend(t)
  12364. }
  12365. function Af(t) {
  12366. return gc.extend(t)
  12367. }
  12368. function Df(t) {
  12369. return sc.extend(t)
  12370. }
  12371. function Cf(t) {
  12372. return _c.extend(t)
  12373. }
  12374. Sf(2e3, Nc),
  12375. yf(Lh),
  12376. xf(900, function(t) {
  12377. var a = Q();
  12378. t.eachSeries(function(t) {
  12379. var e = t.get("stack");
  12380. if (e) {
  12381. var i = a.get(e) || a.set(e, [])
  12382. , n = t.getData()
  12383. , o = {
  12384. stackResultDimension: n.getCalculationInfo("stackResultDimension"),
  12385. stackedOverDimension: n.getCalculationInfo("stackedOverDimension"),
  12386. stackedDimension: n.getCalculationInfo("stackedDimension"),
  12387. stackedByDimension: n.getCalculationInfo("stackedByDimension"),
  12388. isStackedByIndex: n.getCalculationInfo("isStackedByIndex"),
  12389. data: n,
  12390. seriesModel: t
  12391. };
  12392. if (!o.stackedDimension || !o.isStackedByIndex && !o.stackedByDimension)
  12393. return;
  12394. i.length && n.setCalculationInfo("stackedOnSeries", i[i.length - 1].seriesModel),
  12395. i.push(o)
  12396. }
  12397. }),
  12398. a.each(kh)
  12399. }),
  12400. If("default", function(o, a) {
  12401. D(a = a || {}, {
  12402. text: "loading",
  12403. textColor: "#000",
  12404. fontSize: "12px",
  12405. maskColor: "rgba(255, 255, 255, 0.8)",
  12406. showSpinner: !0,
  12407. color: "#c23531",
  12408. spinnerRadius: 10,
  12409. lineWidth: 5,
  12410. zlevel: 0
  12411. });
  12412. var t = new Ci
  12413. , r = new rs({
  12414. style: {
  12415. fill: a.maskColor
  12416. },
  12417. zlevel: a.zlevel,
  12418. z: 1e4
  12419. });
  12420. t.add(r);
  12421. var s = a.fontSize + " sans-serif"
  12422. , l = new rs({
  12423. style: {
  12424. fill: "none",
  12425. text: a.text,
  12426. font: s,
  12427. textPosition: "right",
  12428. textDistance: 10,
  12429. textFill: a.textColor
  12430. },
  12431. zlevel: a.zlevel,
  12432. z: 10001
  12433. });
  12434. if (t.add(l),
  12435. a.showSpinner) {
  12436. var u = new fs({
  12437. shape: {
  12438. startAngle: -Rc / 2,
  12439. endAngle: -Rc / 2 + .1,
  12440. r: a.spinnerRadius
  12441. },
  12442. style: {
  12443. stroke: a.color,
  12444. lineCap: "round",
  12445. lineWidth: a.lineWidth
  12446. },
  12447. zlevel: a.zlevel,
  12448. z: 10001
  12449. });
  12450. u.animateShape(!0).when(1e3, {
  12451. endAngle: 3 * Rc / 2
  12452. }).start("circularInOut"),
  12453. u.animateShape(!0).when(1e3, {
  12454. startAngle: 3 * Rc / 2
  12455. }).delay(300).start("circularInOut"),
  12456. t.add(u)
  12457. }
  12458. return t.resize = function() {
  12459. var t = pn(a.text, s)
  12460. , e = a.showSpinner ? a.spinnerRadius : 0
  12461. , i = (o.getWidth() - 2 * e - (a.showSpinner && t ? 10 : 0) - t) / 2 - (a.showSpinner ? 0 : t / 2)
  12462. , n = o.getHeight() / 2;
  12463. a.showSpinner && u.setShape({
  12464. cx: i,
  12465. cy: n
  12466. }),
  12467. l.setShape({
  12468. x: i - e,
  12469. y: n - e,
  12470. width: 2 * e,
  12471. height: 2 * e
  12472. }),
  12473. r.setShape({
  12474. x: 0,
  12475. y: 0,
  12476. width: o.getWidth(),
  12477. height: o.getHeight()
  12478. })
  12479. }
  12480. ,
  12481. t.resize(),
  12482. t
  12483. }),
  12484. _f({
  12485. type: "highlight",
  12486. event: "highlight",
  12487. update: "highlight"
  12488. }, et),
  12489. _f({
  12490. type: "downplay",
  12491. event: "downplay",
  12492. update: "downplay"
  12493. }, et),
  12494. vf("light", nd),
  12495. vf("dark", rd);
  12496. function Lf(t) {
  12497. return t
  12498. }
  12499. function kf(t, e, i, n, o) {
  12500. this._old = t,
  12501. this._new = e,
  12502. this._oldKeyGetter = i || Lf,
  12503. this._newKeyGetter = n || Lf,
  12504. this.context = o
  12505. }
  12506. function Pf(t, e, i, n, o) {
  12507. for (var a = 0; a < t.length; a++) {
  12508. var r = "_ec_" + o[n](t[a], a)
  12509. , s = e[r];
  12510. null == s ? (i.push(r),
  12511. e[r] = a) : (s.length || (e[r] = s = [s]),
  12512. s.push(a))
  12513. }
  12514. }
  12515. kf.prototype = {
  12516. constructor: kf,
  12517. add: function(t) {
  12518. return this._add = t,
  12519. this
  12520. },
  12521. update: function(t) {
  12522. return this._update = t,
  12523. this
  12524. },
  12525. remove: function(t) {
  12526. return this._remove = t,
  12527. this
  12528. },
  12529. execute: function() {
  12530. var t = this._old
  12531. , e = this._new
  12532. , i = {}
  12533. , n = []
  12534. , o = [];
  12535. for (Pf(t, {}, n, "_oldKeyGetter", this),
  12536. Pf(e, i, o, "_newKeyGetter", this),
  12537. a = 0; a < t.length; a++) {
  12538. if (null != (s = i[r = n[a]]))
  12539. (u = s.length) ? (1 === u && (i[r] = null),
  12540. s = s.shift()) : i[r] = null,
  12541. this._update && this._update(s, a);
  12542. else
  12543. this._remove && this._remove(a)
  12544. }
  12545. for (var a = 0; a < o.length; a++) {
  12546. var r = o[a];
  12547. if (i.hasOwnProperty(r)) {
  12548. var s;
  12549. if (null == (s = i[r]))
  12550. continue;
  12551. if (s.length)
  12552. for (var l = 0, u = s.length; l < u; l++)
  12553. this._add && this._add(s[l]);
  12554. else
  12555. this._add && this._add(s)
  12556. }
  12557. }
  12558. }
  12559. };
  12560. var Nf = Q(["tooltip", "label", "itemName", "itemId", "seriesName"]);
  12561. function Of(t, e) {
  12562. return t.hasOwnProperty(e) || (t[e] = []),
  12563. t[e]
  12564. }
  12565. function Ef(t) {
  12566. return "category" === t ? "ordinal" : "time" === t ? "time" : "float"
  12567. }
  12568. function Rf(t) {
  12569. null != t && P(this, t),
  12570. this.otherDims = {}
  12571. }
  12572. var zf = z
  12573. , Bf = "undefined"
  12574. , Vf = {
  12575. float: typeof Float64Array == Bf ? Array : Float64Array,
  12576. int: typeof Int32Array == Bf ? Array : Int32Array,
  12577. ordinal: Array,
  12578. number: Array,
  12579. time: Array
  12580. }
  12581. , Gf = typeof Uint32Array == Bf ? Array : Uint32Array
  12582. , Ff = typeof Int32Array == Bf ? Array : Int32Array
  12583. , Wf = typeof Uint16Array == Bf ? Array : Uint16Array;
  12584. function Hf(t) {
  12585. return 65535 < t._rawCount ? Gf : Wf
  12586. }
  12587. var Zf = ["hasItemOption", "_nameList", "_idList", "_invertedIndicesMap", "_rawData", "_chunkSize", "_chunkCount", "_dimValueGetter", "_count", "_rawCount", "_nameDimIdx", "_idDimIdx"]
  12588. , Uf = ["_extent", "_approximateExtent", "_rawExtent"];
  12589. function Xf(e, i) {
  12590. E(Zf.concat(i.__wrappedMethods || []), function(t) {
  12591. i.hasOwnProperty(t) && (e[t] = i[t])
  12592. }),
  12593. e.__wrappedMethods = i.__wrappedMethods,
  12594. E(Uf, function(t) {
  12595. e[t] = k(i[t])
  12596. }),
  12597. e._calculationInfo = P(i._calculationInfo)
  12598. }
  12599. var Yf = function(t, e) {
  12600. t = t || ["x", "y"];
  12601. for (var i = {}, n = [], o = {}, a = 0; a < t.length; a++) {
  12602. var r = t[a];
  12603. R(r) ? r = new Rf({
  12604. name: r
  12605. }) : r instanceof Rf || (r = new Rf(r));
  12606. var s = r.name;
  12607. r.type = r.type || "float",
  12608. r.coordDim || (r.coordDim = s,
  12609. r.coordDimIndex = 0),
  12610. r.otherDims = r.otherDims || {},
  12611. n.push(s),
  12612. (i[s] = r).index = a,
  12613. r.createInvertedIndices && (o[s] = [])
  12614. }
  12615. this.dimensions = n,
  12616. this._dimensionInfos = i,
  12617. this.hostModel = e,
  12618. this.dataType,
  12619. this._indices = null,
  12620. this._count = 0,
  12621. this._rawCount = 0,
  12622. this._storage = {},
  12623. this._nameList = [],
  12624. this._idList = [],
  12625. this._optionModels = [],
  12626. this._visual = {},
  12627. this._layout = {},
  12628. this._itemVisuals = [],
  12629. this.hasItemVisual = {},
  12630. this._itemLayouts = [],
  12631. this._graphicEls = [],
  12632. this._chunkSize = 1e5,
  12633. this._chunkCount = 0,
  12634. this._rawData,
  12635. this._rawExtent = {},
  12636. this._extent = {},
  12637. this._approximateExtent = {},
  12638. this._dimensionsSummary = function(n) {
  12639. var t = {}
  12640. , a = t.encode = {}
  12641. , r = Q()
  12642. , s = []
  12643. , l = []
  12644. , u = t.userOutput = {
  12645. dimensionNames: n.dimensions.slice(),
  12646. encode: {}
  12647. };
  12648. E(n.dimensions, function(t) {
  12649. var o = n.getDimensionInfo(t)
  12650. , e = o.coordDim;
  12651. if (e) {
  12652. var i = o.coordDimIndex;
  12653. Of(a, e)[i] = t,
  12654. o.isExtraCoord || (r.set(e, 1),
  12655. function(t) {
  12656. return !("ordinal" === t || "time" === t)
  12657. }(o.type) && (s[0] = t),
  12658. Of(u.encode, e)[i] = o.index),
  12659. o.defaultTooltip && l.push(t)
  12660. }
  12661. Nf.each(function(t, e) {
  12662. var i = Of(a, e)
  12663. , n = o.otherDims[e];
  12664. null != n && !1 !== n && (i[n] = o.name)
  12665. })
  12666. });
  12667. var o = []
  12668. , h = {};
  12669. r.each(function(t, e) {
  12670. var i = a[e];
  12671. h[e] = i[0],
  12672. o = o.concat(i)
  12673. }),
  12674. t.dataDimsOnCoord = o,
  12675. t.encodeFirstDimNotExtra = h;
  12676. var e = a.label;
  12677. e && e.length && (s = e.slice());
  12678. var i = a.tooltip;
  12679. return i && i.length ? l = i.slice() : l.length || (l = s.slice()),
  12680. a.defaultedLabel = s,
  12681. a.defaultedTooltip = l,
  12682. t
  12683. }(this),
  12684. this._invertedIndicesMap = o,
  12685. this._calculationInfo = {},
  12686. this.userOutput = this._dimensionsSummary.userOutput
  12687. }
  12688. , jf = Yf.prototype;
  12689. function qf(t, e, i, n, o) {
  12690. var a = Vf[e.type]
  12691. , r = n - 1
  12692. , s = e.name
  12693. , l = t[s][r];
  12694. if (l && l.length < i) {
  12695. for (var u = new a(Math.min(o - r * i, i)), h = 0; h < l.length; h++)
  12696. u[h] = l[h];
  12697. t[s][r] = u
  12698. }
  12699. for (var c = n * i; c < o; c += i)
  12700. t[s].push(new a(Math.min(o - c, i)))
  12701. }
  12702. function Kf(o) {
  12703. var a = o._invertedIndicesMap;
  12704. E(a, function(t, e) {
  12705. var i = o._dimensionInfos[e].ordinalMeta;
  12706. if (i) {
  12707. t = a[e] = new Ff(i.categories.length);
  12708. for (var n = 0; n < t.length; n++)
  12709. t[n] = -1;
  12710. for (n = 0; n < o._count; n++)
  12711. t[o.get(e, n)] = n
  12712. }
  12713. })
  12714. }
  12715. function $f(t, e, i) {
  12716. var n;
  12717. if (null != e) {
  12718. var o = t._chunkSize
  12719. , a = Math.floor(i / o)
  12720. , r = i % o
  12721. , s = t.dimensions[e]
  12722. , l = t._storage[s][a];
  12723. if (l) {
  12724. n = l[r];
  12725. var u = t._dimensionInfos[s].ordinalMeta;
  12726. u && u.categories.length && (n = u.categories[n])
  12727. }
  12728. }
  12729. return n
  12730. }
  12731. function Jf(t) {
  12732. return t
  12733. }
  12734. function Qf(t) {
  12735. return t < this._count && 0 <= t ? this._indices[t] : -1
  12736. }
  12737. function tp(t, e) {
  12738. var i = t._idList[e];
  12739. return null == i && (i = $f(t, t._idDimIdx, e)),
  12740. null == i && (i = "e\0\0" + e),
  12741. i
  12742. }
  12743. function ep(t) {
  12744. return L(t) || (t = [t]),
  12745. t
  12746. }
  12747. function ip(t, e) {
  12748. var i = t.dimensions
  12749. , n = new Yf(O(i, t.getDimensionInfo, t),t.hostModel);
  12750. Xf(n, t);
  12751. for (var o = n._storage = {}, a = t._storage, r = 0; r < i.length; r++) {
  12752. var s = i[r];
  12753. a[s] && (0 <= _(e, s) ? (o[s] = np(a[s]),
  12754. n._rawExtent[s] = op(),
  12755. n._extent[s] = null) : o[s] = a[s])
  12756. }
  12757. return n
  12758. }
  12759. function np(t) {
  12760. for (var e, i, n = new Array(t.length), o = 0; o < t.length; o++)
  12761. n[o] = (e = t[o],
  12762. i = void 0,
  12763. (i = e.constructor) === Array ? e.slice() : new i(e));
  12764. return n
  12765. }
  12766. function op() {
  12767. return [1 / 0, -1 / 0]
  12768. }
  12769. jf.type = "list",
  12770. jf.hasItemOption = !0,
  12771. jf.getDimension = function(t) {
  12772. return "number" != typeof t && (isNaN(t) || this._dimensionInfos.hasOwnProperty(t)) || (t = this.dimensions[t]),
  12773. t
  12774. }
  12775. ,
  12776. jf.getDimensionInfo = function(t) {
  12777. return this._dimensionInfos[this.getDimension(t)]
  12778. }
  12779. ,
  12780. jf.getDimensionsOnCoord = function() {
  12781. return this._dimensionsSummary.dataDimsOnCoord.slice()
  12782. }
  12783. ,
  12784. jf.mapDimension = function(t, e) {
  12785. var i = this._dimensionsSummary;
  12786. if (null == e)
  12787. return i.encodeFirstDimNotExtra[t];
  12788. var n = i.encode[t];
  12789. return !0 === e ? (n || []).slice() : n && n[e]
  12790. }
  12791. ,
  12792. jf.initData = function(t, e, i) {
  12793. (Uu.isInstance(t) || N(t)) && (t = new Ph(t,this.dimensions.length)),
  12794. this._rawData = t,
  12795. this._storage = {},
  12796. this._indices = null,
  12797. this._nameList = e || [],
  12798. this._idList = [],
  12799. this._nameRepeatCount = {},
  12800. i || (this.hasItemOption = !1),
  12801. this.defaultDimValueGetter = Gh[this._rawData.getSource().sourceFormat],
  12802. this._dimValueGetter = i = i || this.defaultDimValueGetter,
  12803. this._dimValueGetterArrayRows = Gh.arrayRows,
  12804. this._rawExtent = {},
  12805. this._initDataFromProvider(0, t.count()),
  12806. t.pure && (this.hasItemOption = !1)
  12807. }
  12808. ,
  12809. jf.getProvider = function() {
  12810. return this._rawData
  12811. }
  12812. ,
  12813. jf.appendData = function(t) {
  12814. var e = this._rawData
  12815. , i = this.count();
  12816. e.appendData(t);
  12817. var n = e.count();
  12818. e.persistent || (n += i),
  12819. this._initDataFromProvider(i, n)
  12820. }
  12821. ,
  12822. jf.appendValues = function(t, e) {
  12823. for (var i = this._chunkSize, n = this._storage, o = this.dimensions, a = o.length, r = this._rawExtent, s = this.count(), l = s + Math.max(t.length, e ? e.length : 0), u = this._chunkCount, h = 0; h < a; h++) {
  12824. r[v = o[h]] || (r[v] = op()),
  12825. n[v] || (n[v] = []),
  12826. qf(n, this._dimensionInfos[v], i, u, l),
  12827. this._chunkCount = n[v].length
  12828. }
  12829. for (var c = new Array(a), d = s; d < l; d++) {
  12830. for (var f = d - s, p = Math.floor(d / i), g = d % i, m = 0; m < a; m++) {
  12831. var v = o[m]
  12832. , y = this._dimValueGetterArrayRows(t[f] || c, v, f, m);
  12833. n[v][p][g] = y;
  12834. var x = r[v];
  12835. y < x[0] && (x[0] = y),
  12836. y > x[1] && (x[1] = y)
  12837. }
  12838. e && (this._nameList[d] = e[f])
  12839. }
  12840. this._rawCount = this._count = l,
  12841. this._extent = {},
  12842. Kf(this)
  12843. }
  12844. ,
  12845. jf._initDataFromProvider = function(t, e) {
  12846. if (!(e <= t)) {
  12847. for (var i, n = this._chunkSize, o = this._rawData, a = this._storage, r = this.dimensions, s = r.length, l = this._dimensionInfos, u = this._nameList, h = this._idList, c = this._rawExtent, d = this._nameRepeatCount = {}, f = this._chunkCount, p = 0; p < s; p++) {
  12848. c[w = r[p]] || (c[w] = op());
  12849. var g = l[w];
  12850. 0 === g.otherDims.itemName && (i = this._nameDimIdx = p),
  12851. 0 === g.otherDims.itemId && (this._idDimIdx = p),
  12852. a[w] || (a[w] = []),
  12853. qf(a, g, n, f, e),
  12854. this._chunkCount = a[w].length
  12855. }
  12856. for (var m = new Array(s), v = t; v < e; v++) {
  12857. m = o.getItem(v, m);
  12858. for (var y = Math.floor(v / n), x = v % n, _ = 0; _ < s; _++) {
  12859. var w, b = a[w = r[_]][y], S = this._dimValueGetter(m, w, v, _);
  12860. b[x] = S;
  12861. var M = c[w];
  12862. S < M[0] && (M[0] = S),
  12863. S > M[1] && (M[1] = S)
  12864. }
  12865. if (!o.pure) {
  12866. var I = u[v];
  12867. if (m && null == I)
  12868. if (null != m.name)
  12869. u[v] = I = m.name;
  12870. else if (null != i) {
  12871. var T = r[i]
  12872. , A = a[T][y];
  12873. if (A) {
  12874. I = A[x];
  12875. var D = l[T].ordinalMeta;
  12876. D && D.categories.length && (I = D.categories[I])
  12877. }
  12878. }
  12879. var C = null == m ? null : m.id;
  12880. null == C && null != I && (d[I] = d[I] || 0,
  12881. 0 < d[C = I] && (C += "__ec__" + d[I]),
  12882. d[I]++),
  12883. null != C && (h[v] = C)
  12884. }
  12885. }
  12886. !o.persistent && o.clean && o.clean(),
  12887. this._rawCount = this._count = e,
  12888. this._extent = {},
  12889. Kf(this)
  12890. }
  12891. }
  12892. ,
  12893. jf.count = function() {
  12894. return this._count
  12895. }
  12896. ,
  12897. jf.getIndices = function() {
  12898. var t = this._indices;
  12899. if (t) {
  12900. var e = t.constructor
  12901. , i = this._count;
  12902. if (e === Array) {
  12903. o = new e(i);
  12904. for (var n = 0; n < i; n++)
  12905. o[n] = t[n]
  12906. } else
  12907. o = new e(t.buffer,0,i)
  12908. } else {
  12909. var o = new (e = Hf(this))(this.count());
  12910. for (n = 0; n < o.length; n++)
  12911. o[n] = n
  12912. }
  12913. return o
  12914. }
  12915. ,
  12916. jf.get = function(t, e) {
  12917. if (!(0 <= e && e < this._count))
  12918. return NaN;
  12919. var i = this._storage;
  12920. if (!i[t])
  12921. return NaN;
  12922. e = this.getRawIndex(e);
  12923. var n = Math.floor(e / this._chunkSize)
  12924. , o = e % this._chunkSize;
  12925. return i[t][n][o]
  12926. }
  12927. ,
  12928. jf.getByRawIndex = function(t, e) {
  12929. if (!(0 <= e && e < this._rawCount))
  12930. return NaN;
  12931. var i = this._storage[t];
  12932. if (!i)
  12933. return NaN;
  12934. var n = Math.floor(e / this._chunkSize)
  12935. , o = e % this._chunkSize;
  12936. return i[n][o]
  12937. }
  12938. ,
  12939. jf._getFast = function(t, e) {
  12940. var i = Math.floor(e / this._chunkSize)
  12941. , n = e % this._chunkSize;
  12942. return this._storage[t][i][n]
  12943. }
  12944. ,
  12945. jf.getValues = function(t, e) {
  12946. var i = [];
  12947. L(t) || (e = t,
  12948. t = this.dimensions);
  12949. for (var n = 0, o = t.length; n < o; n++)
  12950. i.push(this.get(t[n], e));
  12951. return i
  12952. }
  12953. ,
  12954. jf.hasValue = function(t) {
  12955. for (var e = this._dimensionsSummary.dataDimsOnCoord, i = 0, n = e.length; i < n; i++)
  12956. if (isNaN(this.get(e[i], t)))
  12957. return !1;
  12958. return !0
  12959. }
  12960. ,
  12961. jf.getDataExtent = function(t) {
  12962. t = this.getDimension(t);
  12963. var e = this._storage[t]
  12964. , i = op();
  12965. if (!e)
  12966. return i;
  12967. var n, o = this.count();
  12968. if (!this._indices)
  12969. return this._rawExtent[t].slice();
  12970. if (n = this._extent[t])
  12971. return n.slice();
  12972. for (var a = (n = i)[0], r = n[1], s = 0; s < o; s++) {
  12973. var l = this._getFast(t, this.getRawIndex(s));
  12974. l < a && (a = l),
  12975. r < l && (r = l)
  12976. }
  12977. return n = [a, r],
  12978. this._extent[t] = n
  12979. }
  12980. ,
  12981. jf.getApproximateExtent = function(t) {
  12982. return t = this.getDimension(t),
  12983. this._approximateExtent[t] || this.getDataExtent(t)
  12984. }
  12985. ,
  12986. jf.setApproximateExtent = function(t, e) {
  12987. e = this.getDimension(e),
  12988. this._approximateExtent[e] = t.slice()
  12989. }
  12990. ,
  12991. jf.getCalculationInfo = function(t) {
  12992. return this._calculationInfo[t]
  12993. }
  12994. ,
  12995. jf.setCalculationInfo = function(t, e) {
  12996. zf(t) ? P(this._calculationInfo, t) : this._calculationInfo[t] = e
  12997. }
  12998. ,
  12999. jf.getSum = function(t) {
  13000. var e = 0;
  13001. if (this._storage[t])
  13002. for (var i = 0, n = this.count(); i < n; i++) {
  13003. var o = this.get(t, i);
  13004. isNaN(o) || (e += o)
  13005. }
  13006. return e
  13007. }
  13008. ,
  13009. jf.getMedian = function(t) {
  13010. var i = [];
  13011. this.each(t, function(t, e) {
  13012. isNaN(t) || i.push(t)
  13013. });
  13014. var e = [].concat(i).sort(function(t, e) {
  13015. return t - e
  13016. })
  13017. , n = this.count();
  13018. return 0 === n ? 0 : n % 2 == 1 ? e[(n - 1) / 2] : (e[n / 2] + e[n / 2 - 1]) / 2
  13019. }
  13020. ,
  13021. jf.rawIndexOf = function(t, e) {
  13022. var i = (t && this._invertedIndicesMap[t])[e];
  13023. return null == i || isNaN(i) ? -1 : i
  13024. }
  13025. ,
  13026. jf.indexOfName = function(t) {
  13027. for (var e = 0, i = this.count(); e < i; e++)
  13028. if (this.getName(e) === t)
  13029. return e;
  13030. return -1
  13031. }
  13032. ,
  13033. jf.indexOfRawIndex = function(t) {
  13034. if (t >= this._rawCount || t < 0)
  13035. return -1;
  13036. if (!this._indices)
  13037. return t;
  13038. var e = this._indices
  13039. , i = e[t];
  13040. if (null != i && i < this._count && i === t)
  13041. return t;
  13042. for (var n = 0, o = this._count - 1; n <= o; ) {
  13043. var a = (n + o) / 2 | 0;
  13044. if (e[a] < t)
  13045. n = 1 + a;
  13046. else {
  13047. if (!(e[a] > t))
  13048. return a;
  13049. o = a - 1
  13050. }
  13051. }
  13052. return -1
  13053. }
  13054. ,
  13055. jf.indicesOfNearest = function(t, e, i) {
  13056. var n = [];
  13057. if (!this._storage[t])
  13058. return n;
  13059. null == i && (i = 1 / 0);
  13060. for (var o = 1 / 0, a = -1, r = 0, s = 0, l = this.count(); s < l; s++) {
  13061. var u = e - this.get(t, s)
  13062. , h = Math.abs(u);
  13063. h <= i && ((h < o || h === o && 0 <= u && a < 0) && (o = h,
  13064. a = u,
  13065. r = 0),
  13066. u === a && (n[r++] = s))
  13067. }
  13068. return n.length = r,
  13069. n
  13070. }
  13071. ,
  13072. jf.getRawIndex = Jf,
  13073. jf.getRawDataItem = function(t) {
  13074. if (this._rawData.persistent)
  13075. return this._rawData.getItem(this.getRawIndex(t));
  13076. for (var e = [], i = 0; i < this.dimensions.length; i++) {
  13077. var n = this.dimensions[i];
  13078. e.push(this.get(n, t))
  13079. }
  13080. return e
  13081. }
  13082. ,
  13083. jf.getName = function(t) {
  13084. var e = this.getRawIndex(t);
  13085. return this._nameList[e] || $f(this, this._nameDimIdx, e) || ""
  13086. }
  13087. ,
  13088. jf.getId = function(t) {
  13089. return tp(this, this.getRawIndex(t))
  13090. }
  13091. ,
  13092. jf.each = function(t, e, i, n) {
  13093. if (this._count) {
  13094. "function" == typeof t && (n = i,
  13095. i = e,
  13096. e = t,
  13097. t = []),
  13098. i = i || n || this;
  13099. for (var o = (t = O(ep(t), this.getDimension, this)).length, a = 0; a < this.count(); a++)
  13100. switch (o) {
  13101. case 0:
  13102. e.call(i, a);
  13103. break;
  13104. case 1:
  13105. e.call(i, this.get(t[0], a), a);
  13106. break;
  13107. case 2:
  13108. e.call(i, this.get(t[0], a), this.get(t[1], a), a);
  13109. break;
  13110. default:
  13111. for (var r = 0, s = []; r < o; r++)
  13112. s[r] = this.get(t[r], a);
  13113. s[r] = a,
  13114. e.apply(i, s)
  13115. }
  13116. }
  13117. }
  13118. ,
  13119. jf.filterSelf = function(t, e, i, n) {
  13120. if (this._count) {
  13121. "function" == typeof t && (n = i,
  13122. i = e,
  13123. e = t,
  13124. t = []),
  13125. i = i || n || this,
  13126. t = O(ep(t), this.getDimension, this);
  13127. for (var o = this.count(), a = new (Hf(this))(o), r = [], s = t.length, l = 0, u = t[0], h = 0; h < o; h++) {
  13128. var c, d = this.getRawIndex(h);
  13129. if (0 === s)
  13130. c = e.call(i, h);
  13131. else if (1 === s) {
  13132. var f = this._getFast(u, d);
  13133. c = e.call(i, f, h)
  13134. } else {
  13135. for (var p = 0; p < s; p++)
  13136. r[p] = this._getFast(u, d);
  13137. r[p] = h,
  13138. c = e.apply(i, r)
  13139. }
  13140. c && (a[l++] = d)
  13141. }
  13142. return l < o && (this._indices = a),
  13143. this._count = l,
  13144. this._extent = {},
  13145. this.getRawIndex = this._indices ? Qf : Jf,
  13146. this
  13147. }
  13148. }
  13149. ,
  13150. jf.selectRange = function(t) {
  13151. if (this._count) {
  13152. var e = [];
  13153. for (var i in t)
  13154. t.hasOwnProperty(i) && e.push(i);
  13155. var n = e.length;
  13156. if (n) {
  13157. var o = this.count()
  13158. , a = new (Hf(this))(o)
  13159. , r = 0
  13160. , s = e[0]
  13161. , l = t[s][0]
  13162. , u = t[s][1]
  13163. , h = !1;
  13164. if (!this._indices) {
  13165. var c = 0;
  13166. if (1 === n) {
  13167. for (var d = this._storage[e[0]], f = 0; f < this._chunkCount; f++)
  13168. for (var p = d[f], g = Math.min(this._count - f * this._chunkSize, this._chunkSize), m = 0; m < g; m++) {
  13169. (l <= (w = p[m]) && w <= u || isNaN(w)) && (a[r++] = c),
  13170. c++
  13171. }
  13172. h = !0
  13173. } else if (2 === n) {
  13174. d = this._storage[s];
  13175. var v = this._storage[e[1]]
  13176. , y = t[e[1]][0]
  13177. , x = t[e[1]][1];
  13178. for (f = 0; f < this._chunkCount; f++) {
  13179. p = d[f];
  13180. var _ = v[f];
  13181. for (g = Math.min(this._count - f * this._chunkSize, this._chunkSize),
  13182. m = 0; m < g; m++) {
  13183. var w = p[m]
  13184. , b = _[m];
  13185. (l <= w && w <= u || isNaN(w)) && (y <= b && b <= x || isNaN(b)) && (a[r++] = c),
  13186. c++
  13187. }
  13188. }
  13189. h = !0
  13190. }
  13191. }
  13192. if (!h)
  13193. if (1 === n)
  13194. for (m = 0; m < o; m++) {
  13195. var S = this.getRawIndex(m);
  13196. (l <= (w = this._getFast(s, S)) && w <= u || isNaN(w)) && (a[r++] = S)
  13197. }
  13198. else
  13199. for (m = 0; m < o; m++) {
  13200. var M = !0;
  13201. for (S = this.getRawIndex(m),
  13202. f = 0; f < n; f++) {
  13203. var I = e[f];
  13204. ((w = this._getFast(i, S)) < t[I][0] || w > t[I][1]) && (M = !1)
  13205. }
  13206. M && (a[r++] = this.getRawIndex(m))
  13207. }
  13208. return r < o && (this._indices = a),
  13209. this._count = r,
  13210. this._extent = {},
  13211. this.getRawIndex = this._indices ? Qf : Jf,
  13212. this
  13213. }
  13214. }
  13215. }
  13216. ,
  13217. jf.mapArray = function(t, e, i, n) {
  13218. "function" == typeof t && (n = i,
  13219. i = e,
  13220. e = t,
  13221. t = []),
  13222. i = i || n || this;
  13223. var o = [];
  13224. return this.each(t, function() {
  13225. o.push(e && e.apply(this, arguments))
  13226. }, i),
  13227. o
  13228. }
  13229. ,
  13230. jf.map = function(t, e, i, n) {
  13231. i = i || n || this;
  13232. var o = ip(this, t = O(ep(t), this.getDimension, this));
  13233. o._indices = this._indices,
  13234. o.getRawIndex = o._indices ? Qf : Jf;
  13235. for (var a = o._storage, r = [], s = this._chunkSize, l = t.length, u = this.count(), h = [], c = o._rawExtent, d = 0; d < u; d++) {
  13236. for (var f = 0; f < l; f++)
  13237. h[f] = this.get(t[f], d);
  13238. h[l] = d;
  13239. var p = e && e.apply(i, h);
  13240. if (null != p) {
  13241. "object" != typeof p && (r[0] = p,
  13242. p = r);
  13243. for (var g = this.getRawIndex(d), m = Math.floor(g / s), v = g % s, y = 0; y < p.length; y++) {
  13244. var x = t[y]
  13245. , _ = p[y]
  13246. , w = c[x]
  13247. , b = a[x];
  13248. b && (b[m][v] = _),
  13249. _ < w[0] && (w[0] = _),
  13250. _ > w[1] && (w[1] = _)
  13251. }
  13252. }
  13253. }
  13254. return o
  13255. }
  13256. ,
  13257. jf.downSample = function(t, e, i, n) {
  13258. for (var o = ip(this, [t]), a = o._storage, r = [], s = Math.floor(1 / e), l = a[t], u = this.count(), h = this._chunkSize, c = o._rawExtent[t], d = new (Hf(this))(u), f = 0, p = 0; p < u; p += s) {
  13259. u - p < s && (s = u - p,
  13260. r.length = s);
  13261. for (var g = 0; g < s; g++) {
  13262. var m = this.getRawIndex(p + g)
  13263. , v = Math.floor(m / h)
  13264. , y = m % h;
  13265. r[g] = l[v][y]
  13266. }
  13267. var x = i(r)
  13268. , _ = this.getRawIndex(Math.min(p + n(r, x) || 0, u - 1))
  13269. , w = _ % h;
  13270. (l[Math.floor(_ / h)][w] = x) < c[0] && (c[0] = x),
  13271. x > c[1] && (c[1] = x),
  13272. d[f++] = _
  13273. }
  13274. return o._count = f,
  13275. o._indices = d,
  13276. o.getRawIndex = Qf,
  13277. o
  13278. }
  13279. ,
  13280. jf.getItemModel = function(t) {
  13281. var e = this.hostModel;
  13282. return new Cl(this.getRawDataItem(t),e,e && e.ecModel)
  13283. }
  13284. ,
  13285. jf.diff = function(e) {
  13286. var i = this;
  13287. return new kf(e ? e.getIndices() : [],this.getIndices(),function(t) {
  13288. return tp(e, t)
  13289. }
  13290. ,function(t) {
  13291. return tp(i, t)
  13292. }
  13293. )
  13294. }
  13295. ,
  13296. jf.getVisual = function(t) {
  13297. var e = this._visual;
  13298. return e && e[t]
  13299. }
  13300. ,
  13301. jf.setVisual = function(t, e) {
  13302. if (zf(t))
  13303. for (var i in t)
  13304. t.hasOwnProperty(i) && this.setVisual(i, t[i]);
  13305. else
  13306. this._visual = this._visual || {},
  13307. this._visual[t] = e
  13308. }
  13309. ,
  13310. jf.setLayout = function(t, e) {
  13311. if (zf(t))
  13312. for (var i in t)
  13313. t.hasOwnProperty(i) && this.setLayout(i, t[i]);
  13314. else
  13315. this._layout[t] = e
  13316. }
  13317. ,
  13318. jf.getLayout = function(t) {
  13319. return this._layout[t]
  13320. }
  13321. ,
  13322. jf.getItemLayout = function(t) {
  13323. return this._itemLayouts[t]
  13324. }
  13325. ,
  13326. jf.setItemLayout = function(t, e, i) {
  13327. this._itemLayouts[t] = i ? P(this._itemLayouts[t] || {}, e) : e
  13328. }
  13329. ,
  13330. jf.clearItemLayouts = function() {
  13331. this._itemLayouts.length = 0
  13332. }
  13333. ,
  13334. jf.getItemVisual = function(t, e, i) {
  13335. var n = this._itemVisuals[t]
  13336. , o = n && n[e];
  13337. return null != o || i ? o : this.getVisual(e)
  13338. }
  13339. ,
  13340. jf.setItemVisual = function(t, e, i) {
  13341. var n = this._itemVisuals[t] || {}
  13342. , o = this.hasItemVisual;
  13343. if (this._itemVisuals[t] = n,
  13344. zf(e))
  13345. for (var a in e)
  13346. e.hasOwnProperty(a) && (n[a] = e[a],
  13347. o[a] = !0);
  13348. else
  13349. n[e] = i,
  13350. o[e] = !0
  13351. }
  13352. ,
  13353. jf.clearAllVisual = function() {
  13354. this._visual = {},
  13355. this._itemVisuals = [],
  13356. this.hasItemVisual = {}
  13357. }
  13358. ;
  13359. function ap(t) {
  13360. t.seriesIndex = this.seriesIndex,
  13361. t.dataIndex = this.dataIndex,
  13362. t.dataType = this.dataType
  13363. }
  13364. function rp(t, e, i) {
  13365. Uu.isInstance(e) || (e = Uu.seriesDataToSource(e)),
  13366. i = i || {},
  13367. t = (t || []).slice();
  13368. for (var n = (i.dimsDef || []).slice(), o = Q(), a = Q(), l = [], r = function(t, e, i, n) {
  13369. var o = Math.max(t.dimensionsDetectCount || 1, e.length, i.length, n || 0);
  13370. return E(e, function(t) {
  13371. var e = t.dimsDef;
  13372. e && (o = Math.max(o, e.length))
  13373. }),
  13374. o
  13375. }(e, t, n, i.dimCount), s = 0; s < r; s++) {
  13376. var u = n[s] = P({}, z(n[s]) ? n[s] : {
  13377. name: n[s]
  13378. })
  13379. , h = u.name
  13380. , c = l[s] = new Rf;
  13381. null != h && null == o.get(h) && (c.name = c.displayName = h,
  13382. o.set(h, s)),
  13383. null != u.type && (c.type = u.type),
  13384. null != u.displayName && (c.displayName = u.displayName)
  13385. }
  13386. var d = i.encodeDef;
  13387. !d && i.encodeDefaulter && (d = i.encodeDefaulter(e, r)),
  13388. (d = Q(d)).each(function(t, i) {
  13389. if (1 === (t = Vo(t).slice()).length && !R(t[0]) && t[0] < 0)
  13390. d.set(i, !1);
  13391. else {
  13392. var n = d.set(i, []);
  13393. E(t, function(t, e) {
  13394. R(t) && (t = o.get(t)),
  13395. null != t && t < r && (n[e] = t,
  13396. p(l[t], i, e))
  13397. })
  13398. }
  13399. });
  13400. var f = 0;
  13401. function p(t, e, i) {
  13402. null != Nf.get(e) ? t.otherDims[e] = i : (t.coordDim = e,
  13403. t.coordDimIndex = i,
  13404. a.set(e, !0))
  13405. }
  13406. E(t, function(o, t) {
  13407. var a, r, s;
  13408. if (R(o))
  13409. a = o,
  13410. o = {};
  13411. else {
  13412. a = o.name;
  13413. var e = o.ordinalMeta;
  13414. o.ordinalMeta = null,
  13415. (o = k(o)).ordinalMeta = e,
  13416. r = o.dimsDef,
  13417. s = o.otherDims,
  13418. o.name = o.coordDim = o.coordDimIndex = o.dimsDef = o.otherDims = null
  13419. }
  13420. if (!1 !== (i = d.get(a))) {
  13421. var i;
  13422. if (!(i = Vo(i)).length)
  13423. for (var n = 0; n < (r && r.length || 1); n++) {
  13424. for (; f < l.length && null != l[f].coordDim; )
  13425. f++;
  13426. f < l.length && i.push(f++)
  13427. }
  13428. E(i, function(t, e) {
  13429. var i = l[t];
  13430. if (p(D(i, o), a, e),
  13431. null == i.name && r) {
  13432. var n = r[e];
  13433. z(n) || (n = {
  13434. name: n
  13435. }),
  13436. i.name = i.displayName = n.name,
  13437. i.defaultTooltip = n.defaultTooltip
  13438. }
  13439. s && D(i.otherDims, s)
  13440. })
  13441. }
  13442. });
  13443. var g = i.generateCoord
  13444. , m = i.generateCoordCount
  13445. , v = null != m;
  13446. m = g ? m || 1 : 0;
  13447. for (var y, x, _ = g || "value", w = 0; w < r; w++) {
  13448. null == (c = l[w] = l[w] || new Rf).coordDim && (c.coordDim = sp(_, a, v),
  13449. c.coordDimIndex = 0,
  13450. (!g || m <= 0) && (c.isExtraCoord = !0),
  13451. m--),
  13452. null == c.name && (c.name = sp(c.coordDim, o)),
  13453. null == c.type && (y = e,
  13454. x = w,
  13455. c.name,
  13456. th(y.data, y.sourceFormat, y.seriesLayoutBy, y.dimensionsDefine, y.startIndex, x) === Xu.Must || c.isExtraCoord && (null != c.otherDims.itemName || null != c.otherDims.seriesName)) && (c.type = "ordinal")
  13457. }
  13458. return l
  13459. }
  13460. function sp(t, e, i) {
  13461. if (i || null != e.get(t)) {
  13462. for (var n = 0; null != e.get(t + n); )
  13463. n++;
  13464. t += n
  13465. }
  13466. return e.set(t, !0),
  13467. t
  13468. }
  13469. jf.setItemGraphicEl = function(t, e) {
  13470. var i = this.hostModel;
  13471. e && (e.dataIndex = t,
  13472. e.dataType = this.dataType,
  13473. e.seriesIndex = i && i.seriesIndex,
  13474. "group" === e.type && e.traverse(ap, e)),
  13475. this._graphicEls[t] = e
  13476. }
  13477. ,
  13478. jf.getItemGraphicEl = function(t) {
  13479. return this._graphicEls[t]
  13480. }
  13481. ,
  13482. jf.eachItemGraphicEl = function(i, n) {
  13483. E(this._graphicEls, function(t, e) {
  13484. t && i && i.call(n, t, e)
  13485. })
  13486. }
  13487. ,
  13488. jf.cloneShallow = function(t) {
  13489. if (!t) {
  13490. var e = O(this.dimensions, this.getDimensionInfo, this);
  13491. t = new Yf(e,this.hostModel)
  13492. }
  13493. if (t._storage = this._storage,
  13494. Xf(t, this),
  13495. this._indices) {
  13496. var i = this._indices.constructor;
  13497. t._indices = new i(this._indices)
  13498. } else
  13499. t._indices = null;
  13500. return t.getRawIndex = t._indices ? Qf : Jf,
  13501. t
  13502. }
  13503. ,
  13504. jf.wrapMethod = function(t, e) {
  13505. var i = this[t];
  13506. "function" == typeof i && (this.__wrappedMethods = this.__wrappedMethods || [],
  13507. this.__wrappedMethods.push(t),
  13508. this[t] = function() {
  13509. var t = i.apply(this, arguments);
  13510. return e.apply(this, [t].concat(U(arguments)))
  13511. }
  13512. )
  13513. }
  13514. ,
  13515. jf.TRANSFERABLE_METHODS = ["cloneShallow", "downSample", "map"],
  13516. jf.CHANGABLE_METHODS = ["filterSelf", "selectRange"];
  13517. var lp = function(t, e) {
  13518. return rp((e = e || {}).coordDimensions || [], t, {
  13519. dimsDef: e.dimensionsDefine || t.dimensionsDefine,
  13520. encodeDef: e.encodeDefine || t.encodeDefine,
  13521. dimCount: e.dimensionsCount,
  13522. encodeDefaulter: e.encodeDefaulter,
  13523. generateCoord: e.generateCoord,
  13524. generateCoordCount: e.generateCoordCount
  13525. })
  13526. };
  13527. function up(t) {
  13528. this.coordSysName = t,
  13529. this.coordSysDims = [],
  13530. this.axisMap = Q(),
  13531. this.categoryAxisMap = Q(),
  13532. this.firstCategoryDimIndex = null
  13533. }
  13534. var hp = {
  13535. cartesian2d: function(t, e, i, n) {
  13536. var o = t.getReferringComponents("xAxis")[0]
  13537. , a = t.getReferringComponents("yAxis")[0];
  13538. e.coordSysDims = ["x", "y"],
  13539. i.set("x", o),
  13540. i.set("y", a),
  13541. cp(o) && (n.set("x", o),
  13542. e.firstCategoryDimIndex = 0),
  13543. cp(a) && (n.set("y", a),
  13544. e.firstCategoryDimIndex,
  13545. e.firstCategoryDimIndex = 1)
  13546. },
  13547. singleAxis: function(t, e, i, n) {
  13548. var o = t.getReferringComponents("singleAxis")[0];
  13549. e.coordSysDims = ["single"],
  13550. i.set("single", o),
  13551. cp(o) && (n.set("single", o),
  13552. e.firstCategoryDimIndex = 0)
  13553. },
  13554. polar: function(t, e, i, n) {
  13555. var o = t.getReferringComponents("polar")[0]
  13556. , a = o.findAxisModel("radiusAxis")
  13557. , r = o.findAxisModel("angleAxis");
  13558. e.coordSysDims = ["radius", "angle"],
  13559. i.set("radius", a),
  13560. i.set("angle", r),
  13561. cp(a) && (n.set("radius", a),
  13562. e.firstCategoryDimIndex = 0),
  13563. cp(r) && (n.set("angle", r),
  13564. null == e.firstCategoryDimIndex && (e.firstCategoryDimIndex = 1))
  13565. },
  13566. geo: function(t, e, i, n) {
  13567. e.coordSysDims = ["lng", "lat"]
  13568. },
  13569. parallel: function(t, o, a, r) {
  13570. var s = t.ecModel
  13571. , e = s.getComponent("parallel", t.get("parallelIndex"))
  13572. , l = o.coordSysDims = e.dimensions.slice();
  13573. E(e.parallelAxisIndex, function(t, e) {
  13574. var i = s.getComponent("parallelAxis", t)
  13575. , n = l[e];
  13576. a.set(n, i),
  13577. cp(i) && null == o.firstCategoryDimIndex && (r.set(n, i),
  13578. o.firstCategoryDimIndex = e)
  13579. })
  13580. }
  13581. };
  13582. function cp(t) {
  13583. return "category" === t.get("type")
  13584. }
  13585. function dp(t, i, e) {
  13586. var n, o, a, r, s = (e = e || {}).byIndex, l = e.stackedCoordDimension, u = !(!t || !t.get("stack"));
  13587. if (E(i, function(t, e) {
  13588. R(t) && (i[e] = t = {
  13589. name: t
  13590. }),
  13591. u && !t.isExtraCoord && (s || n || !t.ordinalMeta || (n = t),
  13592. o || "ordinal" === t.type || "time" === t.type || l && l !== t.coordDim || (o = t))
  13593. }),
  13594. !o || s || n || (s = !0),
  13595. o) {
  13596. a = "__\0ecstackresult",
  13597. r = "__\0ecstackedover",
  13598. n && (n.createInvertedIndices = !0);
  13599. var h = o.coordDim
  13600. , c = o.type
  13601. , d = 0;
  13602. E(i, function(t) {
  13603. t.coordDim === h && d++
  13604. }),
  13605. i.push({
  13606. name: a,
  13607. coordDim: h,
  13608. coordDimIndex: d,
  13609. type: c,
  13610. isExtraCoord: !0,
  13611. isCalculationCoord: !0
  13612. }),
  13613. d++,
  13614. i.push({
  13615. name: r,
  13616. coordDim: r,
  13617. coordDimIndex: d,
  13618. type: c,
  13619. isExtraCoord: !0,
  13620. isCalculationCoord: !0
  13621. })
  13622. }
  13623. return {
  13624. stackedDimension: o && o.name,
  13625. stackedByDimension: n && n.name,
  13626. isStackedByIndex: s,
  13627. stackedOverDimension: r,
  13628. stackResultDimension: a
  13629. }
  13630. }
  13631. function fp(t, e) {
  13632. return !!e && e === t.getCalculationInfo("stackedDimension")
  13633. }
  13634. function pp(t, e) {
  13635. return fp(t, e) ? t.getCalculationInfo("stackResultDimension") : e
  13636. }
  13637. function gp(t, e, i) {
  13638. i = i || {},
  13639. Uu.isInstance(t) || (t = Uu.seriesDataToSource(t));
  13640. var n, o = e.get("coordinateSystem"), a = lh.get(o), r = function(t) {
  13641. var e = t.get("coordinateSystem")
  13642. , i = new up(e)
  13643. , n = hp[e];
  13644. if (n)
  13645. return n(t, i, i.axisMap, i.categoryAxisMap),
  13646. i
  13647. }(e);
  13648. r && (n = O(r.coordSysDims, function(t) {
  13649. var e = {
  13650. name: t
  13651. }
  13652. , i = r.axisMap.get(t);
  13653. if (i) {
  13654. var n = i.get("type");
  13655. e.type = Ef(n)
  13656. }
  13657. return e
  13658. })),
  13659. n = n || (a && (a.getDimensionsInfo ? a.getDimensionsInfo() : a.dimensions.slice()) || ["x", "y"]);
  13660. var s, l, u = lp(t, {
  13661. coordDimensions: n,
  13662. generateCoord: i.generateCoord,
  13663. encodeDefaulter: i.useEncodeDefaulter ? T($u, n, e) : null
  13664. });
  13665. r && E(u, function(t, e) {
  13666. var i = t.coordDim
  13667. , n = r.categoryAxisMap.get(i);
  13668. n && (null == s && (s = e),
  13669. t.ordinalMeta = n.getOrdinalMeta()),
  13670. null != t.otherDims.itemName && (l = !0)
  13671. }),
  13672. l || null == s || (u[s].otherDims.itemName = 0);
  13673. var h = dp(e, u)
  13674. , c = new Yf(u,e);
  13675. c.setCalculationInfo(h);
  13676. var d = null != s && function(t) {
  13677. if (t.sourceFormat === zu) {
  13678. var e = function(t) {
  13679. var e = 0;
  13680. for (; e < t.length && null == t[e]; )
  13681. e++;
  13682. return t[e]
  13683. }(t.data || []);
  13684. return null != e && !L(Wo(e))
  13685. }
  13686. }(t) ? function(t, e, i, n) {
  13687. return n === s ? i : this.defaultDimValueGetter(t, e, i, n)
  13688. }
  13689. : null;
  13690. return c.hasItemOption = !1,
  13691. c.initData(t, null, d),
  13692. c
  13693. }
  13694. function mp(t) {
  13695. this._setting = t || {},
  13696. this._extent = [1 / 0, -1 / 0],
  13697. this._interval = 0,
  13698. this.init && this.init.apply(this, arguments)
  13699. }
  13700. function vp(t) {
  13701. this.categories = t.categories || [],
  13702. this._needCollect = t.needCollect,
  13703. this._deduplication = t.deduplication,
  13704. this._map
  13705. }
  13706. mp.prototype.parse = function(t) {
  13707. return t
  13708. }
  13709. ,
  13710. mp.prototype.getSetting = function(t) {
  13711. return this._setting[t]
  13712. }
  13713. ,
  13714. mp.prototype.contain = function(t) {
  13715. var e = this._extent;
  13716. return t >= e[0] && t <= e[1]
  13717. }
  13718. ,
  13719. mp.prototype.normalize = function(t) {
  13720. var e = this._extent;
  13721. return e[1] === e[0] ? .5 : (t - e[0]) / (e[1] - e[0])
  13722. }
  13723. ,
  13724. mp.prototype.scale = function(t) {
  13725. var e = this._extent;
  13726. return t * (e[1] - e[0]) + e[0]
  13727. }
  13728. ,
  13729. mp.prototype.unionExtent = function(t) {
  13730. var e = this._extent;
  13731. t[0] < e[0] && (e[0] = t[0]),
  13732. t[1] > e[1] && (e[1] = t[1])
  13733. }
  13734. ,
  13735. mp.prototype.unionExtentFromData = function(t, e) {
  13736. this.unionExtent(t.getApproximateExtent(e))
  13737. }
  13738. ,
  13739. mp.prototype.getExtent = function() {
  13740. return this._extent.slice()
  13741. }
  13742. ,
  13743. mp.prototype.setExtent = function(t, e) {
  13744. var i = this._extent;
  13745. isNaN(t) || (i[0] = t),
  13746. isNaN(e) || (i[1] = e)
  13747. }
  13748. ,
  13749. mp.prototype.isBlank = function() {
  13750. return this._isBlank
  13751. }
  13752. ,
  13753. mp.prototype.setBlank = function(t) {
  13754. this._isBlank = t
  13755. }
  13756. ,
  13757. mp.prototype.getLabel = null,
  13758. oa(mp),
  13759. ua(mp, {
  13760. registerWhenExtend: !0
  13761. }),
  13762. vp.createByAxisModel = function(t) {
  13763. var e = t.option
  13764. , i = e.data
  13765. , n = i && O(i, _p);
  13766. return new vp({
  13767. categories: n,
  13768. needCollect: !n,
  13769. deduplication: !1 !== e.dedplication
  13770. })
  13771. }
  13772. ;
  13773. var yp = vp.prototype;
  13774. function xp(t) {
  13775. return t._map || (t._map = Q(t.categories))
  13776. }
  13777. function _p(t) {
  13778. return z(t) && null != t.value ? t.value : t + ""
  13779. }
  13780. yp.getOrdinal = function(t) {
  13781. return xp(this).get(t)
  13782. }
  13783. ,
  13784. yp.parseAndCollect = function(t) {
  13785. var e, i = this._needCollect;
  13786. if ("string" != typeof t && !i)
  13787. return t;
  13788. if (i && !this._deduplication)
  13789. return e = this.categories.length,
  13790. this.categories[e] = t,
  13791. e;
  13792. var n = xp(this);
  13793. return null == (e = n.get(t)) && (i ? (e = this.categories.length,
  13794. this.categories[e] = t,
  13795. n.set(t, e)) : e = NaN),
  13796. e
  13797. }
  13798. ;
  13799. var wp = mp.prototype
  13800. , bp = mp.extend({
  13801. type: "ordinal",
  13802. init: function(t, e) {
  13803. t && !L(t) || (t = new vp({
  13804. categories: t
  13805. })),
  13806. this._ordinalMeta = t,
  13807. this._extent = e || [0, t.categories.length - 1]
  13808. },
  13809. parse: function(t) {
  13810. return "string" == typeof t ? this._ordinalMeta.getOrdinal(t) : Math.round(t)
  13811. },
  13812. contain: function(t) {
  13813. return t = this.parse(t),
  13814. wp.contain.call(this, t) && null != this._ordinalMeta.categories[t]
  13815. },
  13816. normalize: function(t) {
  13817. return wp.normalize.call(this, this.parse(t))
  13818. },
  13819. scale: function(t) {
  13820. return Math.round(wp.scale.call(this, t))
  13821. },
  13822. getTicks: function() {
  13823. for (var t = [], e = this._extent, i = e[0]; i <= e[1]; )
  13824. t.push(i),
  13825. i++;
  13826. return t
  13827. },
  13828. getLabel: function(t) {
  13829. if (!this.isBlank())
  13830. return this._ordinalMeta.categories[t]
  13831. },
  13832. count: function() {
  13833. return this._extent[1] - this._extent[0] + 1
  13834. },
  13835. unionExtentFromData: function(t, e) {
  13836. this.unionExtent(t.getApproximateExtent(e))
  13837. },
  13838. getOrdinalMeta: function() {
  13839. return this._ordinalMeta
  13840. },
  13841. niceTicks: et,
  13842. niceExtent: et
  13843. });
  13844. bp.create = function() {
  13845. return new bp
  13846. }
  13847. ;
  13848. var Sp = zl;
  13849. function Mp(t) {
  13850. return Gl(t) + 2
  13851. }
  13852. function Ip(t, e, i) {
  13853. t[e] = Math.max(Math.min(t[e], i[1]), i[0])
  13854. }
  13855. function Tp(t, e) {
  13856. isFinite(t[0]) || (t[0] = e[0]),
  13857. isFinite(t[1]) || (t[1] = e[1]),
  13858. Ip(t, 0, e),
  13859. Ip(t, 1, e),
  13860. t[0] > t[1] && (t[0] = t[1])
  13861. }
  13862. var Ap = zl
  13863. , Dp = mp.extend({
  13864. type: "interval",
  13865. _interval: 0,
  13866. _intervalPrecision: 2,
  13867. setExtent: function(t, e) {
  13868. var i = this._extent;
  13869. isNaN(t) || (i[0] = parseFloat(t)),
  13870. isNaN(e) || (i[1] = parseFloat(e))
  13871. },
  13872. unionExtent: function(t) {
  13873. var e = this._extent;
  13874. t[0] < e[0] && (e[0] = t[0]),
  13875. t[1] > e[1] && (e[1] = t[1]),
  13876. Dp.prototype.setExtent.call(this, e[0], e[1])
  13877. },
  13878. getInterval: function() {
  13879. return this._interval
  13880. },
  13881. setInterval: function(t) {
  13882. this._interval = t,
  13883. this._niceExtent = this._extent.slice(),
  13884. this._intervalPrecision = Mp(t)
  13885. },
  13886. getTicks: function(t) {
  13887. var e = this._interval
  13888. , i = this._extent
  13889. , n = this._niceExtent
  13890. , o = this._intervalPrecision
  13891. , a = [];
  13892. if (!e)
  13893. return a;
  13894. i[0] < n[0] && (t ? a.push(Ap(n[0] - e, o)) : a.push(i[0]));
  13895. for (var r = n[0]; r <= n[1] && (a.push(r),
  13896. (r = Ap(r + e, o)) !== a[a.length - 1]); )
  13897. if (1e4 < a.length)
  13898. return [];
  13899. var s = a.length ? a[a.length - 1] : n[1];
  13900. return i[1] > s && (t ? a.push(Ap(s + e, o)) : a.push(i[1])),
  13901. a
  13902. },
  13903. getMinorTicks: function(t) {
  13904. for (var e = this.getTicks(!0), i = [], n = this.getExtent(), o = 1; o < e.length; o++) {
  13905. for (var a = e[o], r = e[o - 1], s = 0, l = [], u = (a - r) / t; s < t - 1; ) {
  13906. var h = zl(r + (s + 1) * u);
  13907. h > n[0] && h < n[1] && l.push(h),
  13908. s++
  13909. }
  13910. i.push(l)
  13911. }
  13912. return i
  13913. },
  13914. getLabel: function(t, e) {
  13915. if (null == t)
  13916. return "";
  13917. var i = e && e.precision;
  13918. return null == i ? i = Gl(t) || 0 : "auto" === i && (i = this._intervalPrecision),
  13919. tu(t = Ap(t, i, !0))
  13920. },
  13921. niceTicks: function(t, e, i) {
  13922. t = t || 5;
  13923. var n = this._extent
  13924. , o = n[1] - n[0];
  13925. if (isFinite(o)) {
  13926. o < 0 && (o = -o,
  13927. n.reverse());
  13928. var a = function(t, e, i, n) {
  13929. var o = {}
  13930. , a = t[1] - t[0]
  13931. , r = o.interval = Kl(a / e, !0);
  13932. null != i && r < i && (r = o.interval = i),
  13933. null != n && n < r && (r = o.interval = n);
  13934. var s = o.intervalPrecision = Mp(r);
  13935. return Tp(o.niceTickExtent = [Sp(Math.ceil(t[0] / r) * r, s), Sp(Math.floor(t[1] / r) * r, s)], t),
  13936. o
  13937. }(n, t, e, i);
  13938. this._intervalPrecision = a.intervalPrecision,
  13939. this._interval = a.interval,
  13940. this._niceExtent = a.niceTickExtent
  13941. }
  13942. },
  13943. niceExtent: function(t) {
  13944. var e = this._extent;
  13945. if (e[0] === e[1])
  13946. if (0 !== e[0]) {
  13947. var i = e[0];
  13948. t.fixMax || (e[1] += i / 2),
  13949. e[0] -= i / 2
  13950. } else
  13951. e[1] = 1;
  13952. var n = e[1] - e[0];
  13953. isFinite(n) || (e[0] = 0,
  13954. e[1] = 1),
  13955. this.niceTicks(t.splitNumber, t.minInterval, t.maxInterval);
  13956. var o = this._interval;
  13957. t.fixMin || (e[0] = Ap(Math.floor(e[0] / o) * o)),
  13958. t.fixMax || (e[1] = Ap(Math.ceil(e[1] / o) * o))
  13959. }
  13960. });
  13961. Dp.create = function() {
  13962. return new Dp
  13963. }
  13964. ;
  13965. var Cp = "__ec_stack_"
  13966. , Lp = "undefined" != typeof Float32Array ? Float32Array : Array;
  13967. function kp(t) {
  13968. return t.get("stack") || Cp + t.seriesIndex
  13969. }
  13970. function Pp(t) {
  13971. return t.dim + t.index
  13972. }
  13973. function Np(t, e) {
  13974. var i = [];
  13975. return e.eachSeriesByType(t, function(t) {
  13976. Vp(t) && !Gp(t) && i.push(t)
  13977. }),
  13978. i
  13979. }
  13980. function Op(t) {
  13981. var g = function(t) {
  13982. var l = {};
  13983. E(t, function(t) {
  13984. var e = t.coordinateSystem.getBaseAxis();
  13985. if ("time" === e.type || "value" === e.type)
  13986. for (var i = t.getData(), n = e.dim + "_" + e.index, o = i.mapDimension(e.dim), a = 0, r = i.count(); a < r; ++a) {
  13987. var s = i.get(o, a);
  13988. l[n] ? l[n].push(s) : l[n] = [s]
  13989. }
  13990. });
  13991. var e = [];
  13992. for (var i in l)
  13993. if (l.hasOwnProperty(i)) {
  13994. var n = l[i];
  13995. if (n) {
  13996. n.sort(function(t, e) {
  13997. return t - e
  13998. });
  13999. for (var o = null, a = 1; a < n.length; ++a) {
  14000. var r = n[a] - n[a - 1];
  14001. 0 < r && (o = null === o ? r : Math.min(o, r))
  14002. }
  14003. e[i] = o
  14004. }
  14005. }
  14006. return e
  14007. }(t)
  14008. , m = [];
  14009. return E(t, function(t) {
  14010. var e, i = t.coordinateSystem.getBaseAxis(), n = i.getExtent();
  14011. if ("category" === i.type)
  14012. e = i.getBandWidth();
  14013. else if ("value" === i.type || "time" === i.type) {
  14014. var o = i.dim + "_" + i.index
  14015. , a = g[o]
  14016. , r = Math.abs(n[1] - n[0])
  14017. , s = i.scale.getExtent()
  14018. , l = Math.abs(s[1] - s[0]);
  14019. e = a ? r / l * a : r
  14020. } else {
  14021. var u = t.getData();
  14022. e = Math.abs(n[1] - n[0]) / u.count()
  14023. }
  14024. var h = Rl(t.get("barWidth"), e)
  14025. , c = Rl(t.get("barMaxWidth"), e)
  14026. , d = Rl(t.get("barMinWidth") || 1, e)
  14027. , f = t.get("barGap")
  14028. , p = t.get("barCategoryGap");
  14029. m.push({
  14030. bandWidth: e,
  14031. barWidth: h,
  14032. barMaxWidth: c,
  14033. barMinWidth: d,
  14034. barGap: f,
  14035. barCategoryGap: p,
  14036. axisKey: Pp(i),
  14037. stackId: kp(t)
  14038. })
  14039. }),
  14040. Ep(m)
  14041. }
  14042. function Ep(t) {
  14043. var d = {};
  14044. E(t, function(t, e) {
  14045. var i = t.axisKey
  14046. , n = t.bandWidth
  14047. , o = d[i] || {
  14048. bandWidth: n,
  14049. remainedWidth: n,
  14050. autoWidthCount: 0,
  14051. categoryGap: "20%",
  14052. gap: "30%",
  14053. stacks: {}
  14054. }
  14055. , a = o.stacks;
  14056. d[i] = o;
  14057. var r = t.stackId;
  14058. a[r] || o.autoWidthCount++,
  14059. a[r] = a[r] || {
  14060. width: 0,
  14061. maxWidth: 0
  14062. };
  14063. var s = t.barWidth;
  14064. s && !a[r].width && (a[r].width = s,
  14065. s = Math.min(o.remainedWidth, s),
  14066. o.remainedWidth -= s);
  14067. var l = t.barMaxWidth;
  14068. l && (a[r].maxWidth = l);
  14069. var u = t.barMinWidth;
  14070. u && (a[r].minWidth = u);
  14071. var h = t.barGap;
  14072. null != h && (o.gap = h);
  14073. var c = t.barCategoryGap;
  14074. null != c && (o.categoryGap = c)
  14075. });
  14076. var f = {};
  14077. return E(d, function(t, i) {
  14078. f[i] = {};
  14079. var e = t.stacks
  14080. , n = t.bandWidth
  14081. , o = Rl(t.categoryGap, n)
  14082. , a = Rl(t.gap, 1)
  14083. , r = t.remainedWidth
  14084. , s = t.autoWidthCount
  14085. , l = (r - o) / (s + (s - 1) * a);
  14086. l = Math.max(l, 0),
  14087. E(e, function(t) {
  14088. var e = t.maxWidth
  14089. , i = t.minWidth;
  14090. if (t.width) {
  14091. n = t.width;
  14092. e && (n = Math.min(n, e)),
  14093. i && (n = Math.max(n, i)),
  14094. t.width = n,
  14095. r -= n + a * n,
  14096. s--
  14097. } else {
  14098. var n = l;
  14099. e && e < n && (n = Math.min(e, r)),
  14100. i && n < i && (n = i),
  14101. n !== l && (t.width = n,
  14102. r -= n + a * n,
  14103. s--)
  14104. }
  14105. }),
  14106. l = (r - o) / (s + (s - 1) * a),
  14107. l = Math.max(l, 0);
  14108. var u, h = 0;
  14109. E(e, function(t, e) {
  14110. t.width || (t.width = l),
  14111. h += (u = t).width * (1 + a)
  14112. }),
  14113. u && (h -= u.width * a);
  14114. var c = -h / 2;
  14115. E(e, function(t, e) {
  14116. f[i][e] = f[i][e] || {
  14117. bandWidth: n,
  14118. offset: c,
  14119. width: t.width
  14120. },
  14121. c += t.width * (1 + a)
  14122. })
  14123. }),
  14124. f
  14125. }
  14126. function Rp(t, e, i) {
  14127. if (t && e) {
  14128. var n = t[Pp(e)];
  14129. return null != n && null != i && (n = n[kp(i)]),
  14130. n
  14131. }
  14132. }
  14133. function zp(t, e) {
  14134. var i = Np(t, e)
  14135. , T = Op(i)
  14136. , A = {};
  14137. E(i, function(t) {
  14138. var e = t.getData()
  14139. , i = t.coordinateSystem
  14140. , n = i.getBaseAxis()
  14141. , o = kp(t)
  14142. , a = T[Pp(n)][o]
  14143. , r = a.offset
  14144. , s = a.width
  14145. , l = i.getOtherAxis(n)
  14146. , u = t.get("barMinHeight") || 0;
  14147. A[o] = A[o] || [],
  14148. e.setLayout({
  14149. bandWidth: a.bandWidth,
  14150. offset: r,
  14151. size: s
  14152. });
  14153. for (var h = e.mapDimension(l.dim), c = e.mapDimension(n.dim), d = fp(e, h), f = l.isHorizontal(), p = Fp(n, l, d), g = 0, m = e.count(); g < m; g++) {
  14154. var v, y, x, _, w, b = e.get(h, g), S = e.get(c, g), M = 0 <= b ? "p" : "n", I = p;
  14155. if (d && (A[o][S] || (A[o][S] = {
  14156. p: p,
  14157. n: p
  14158. }),
  14159. I = A[o][S][M]),
  14160. f)
  14161. v = I,
  14162. y = (w = i.dataToPoint([b, S]))[1] + r,
  14163. x = w[0] - p,
  14164. _ = s,
  14165. Math.abs(x) < u && (x = (x < 0 ? -1 : 1) * u),
  14166. isNaN(x) || d && (A[o][S][M] += x);
  14167. else
  14168. v = (w = i.dataToPoint([S, b]))[0] + r,
  14169. y = I,
  14170. x = s,
  14171. _ = w[1] - p,
  14172. Math.abs(_) < u && (_ = (_ <= 0 ? -1 : 1) * u),
  14173. isNaN(_) || d && (A[o][S][M] += _);
  14174. e.setItemLayout(g, {
  14175. x: v,
  14176. y: y,
  14177. width: x,
  14178. height: _
  14179. })
  14180. }
  14181. }, this)
  14182. }
  14183. var Bp = {
  14184. seriesType: "bar",
  14185. plan: vc(),
  14186. reset: function(t) {
  14187. if (Vp(t) && Gp(t)) {
  14188. var e = t.getData()
  14189. , c = t.coordinateSystem
  14190. , d = c.grid.getRect()
  14191. , f = c.getBaseAxis()
  14192. , p = c.getOtherAxis(f)
  14193. , g = e.mapDimension(p.dim)
  14194. , m = e.mapDimension(f.dim)
  14195. , v = p.isHorizontal()
  14196. , y = v ? 0 : 1
  14197. , x = Rp(Op([t]), f, t).width;
  14198. return .5 < x || (x = .5),
  14199. {
  14200. progress: function(t, e) {
  14201. var i, n = t.count, o = new Lp(2 * n), a = new Lp(2 * n), r = new Lp(n), s = [], l = [], u = 0, h = 0;
  14202. for (; null != (i = t.next()); )
  14203. l[y] = e.get(g, i),
  14204. l[1 - y] = e.get(m, i),
  14205. s = c.dataToPoint(l, null, s),
  14206. a[u] = v ? d.x + d.width : s[0],
  14207. o[u++] = s[0],
  14208. a[u] = v ? s[1] : d.y + d.height,
  14209. o[u++] = s[1],
  14210. r[h++] = i;
  14211. e.setLayout({
  14212. largePoints: o,
  14213. largeDataIndices: r,
  14214. largeBackgroundPoints: a,
  14215. barWidth: x,
  14216. valueAxisStart: Fp(f, p, !1),
  14217. backgroundStart: v ? d.x : d.y,
  14218. valueAxisHorizontal: v
  14219. })
  14220. }
  14221. }
  14222. }
  14223. }
  14224. };
  14225. function Vp(t) {
  14226. return t.coordinateSystem && "cartesian2d" === t.coordinateSystem.type
  14227. }
  14228. function Gp(t) {
  14229. return t.pipelineContext && t.pipelineContext.large
  14230. }
  14231. function Fp(t, e) {
  14232. return e.toGlobalCoord(e.dataToCoord("log" === e.type ? 1 : 0))
  14233. }
  14234. var Wp = Dp.prototype
  14235. , Hp = Math.ceil
  14236. , Zp = Math.floor
  14237. , Up = 36e5
  14238. , Xp = 864e5
  14239. , Yp = Dp.extend({
  14240. type: "time",
  14241. getLabel: function(t) {
  14242. var e = this._stepLvl
  14243. , i = new Date(t);
  14244. return du(e[0], i, this.getSetting("useUTC"))
  14245. },
  14246. niceExtent: function(t) {
  14247. var e = this._extent;
  14248. if (e[0] === e[1] && (e[0] -= Xp,
  14249. e[1] += Xp),
  14250. e[1] === -1 / 0 && e[0] === 1 / 0) {
  14251. var i = new Date;
  14252. e[1] = +new Date(i.getFullYear(),i.getMonth(),i.getDate()),
  14253. e[0] = e[1] - Xp
  14254. }
  14255. this.niceTicks(t.splitNumber, t.minInterval, t.maxInterval);
  14256. var n = this._interval;
  14257. t.fixMin || (e[0] = zl(Zp(e[0] / n) * n)),
  14258. t.fixMax || (e[1] = zl(Hp(e[1] / n) * n))
  14259. },
  14260. niceTicks: function(t, e, i) {
  14261. t = t || 10;
  14262. var n = this._extent
  14263. , o = n[1] - n[0]
  14264. , a = o / t;
  14265. null != e && a < e && (a = e),
  14266. null != i && i < a && (a = i);
  14267. var r = jp.length
  14268. , s = function(t, e, i, n) {
  14269. for (; i < n; ) {
  14270. var o = i + n >>> 1;
  14271. t[o][1] < e ? i = 1 + o : n = o
  14272. }
  14273. return i
  14274. }(jp, a, 0, r)
  14275. , l = jp[Math.min(s, r - 1)]
  14276. , u = l[1];
  14277. "year" === l[0] && (u *= Kl(o / u / t, !0));
  14278. var h = this.getSetting("useUTC") ? 0 : 60 * new Date(+n[0] || +n[1]).getTimezoneOffset() * 1e3
  14279. , c = [Math.round(Hp((n[0] - h) / u) * u + h), Math.round(Zp((n[1] - h) / u) * u + h)];
  14280. Tp(c, n),
  14281. this._stepLvl = l,
  14282. this._interval = u,
  14283. this._niceExtent = c
  14284. },
  14285. parse: function(t) {
  14286. return +Yl(t)
  14287. }
  14288. });
  14289. E(["contain", "normalize"], function(e) {
  14290. Yp.prototype[e] = function(t) {
  14291. return Wp[e].call(this, this.parse(t))
  14292. }
  14293. });
  14294. var jp = [["hh:mm:ss", 1e3], ["hh:mm:ss", 5e3], ["hh:mm:ss", 1e4], ["hh:mm:ss", 15e3], ["hh:mm:ss", 3e4], ["hh:mm\nMM-dd", 6e4], ["hh:mm\nMM-dd", 3e5], ["hh:mm\nMM-dd", 6e5], ["hh:mm\nMM-dd", 9e5], ["hh:mm\nMM-dd", 18e5], ["hh:mm\nMM-dd", Up], ["hh:mm\nMM-dd", 72e5], ["hh:mm\nMM-dd", 6 * Up], ["hh:mm\nMM-dd", 432e5], ["MM-dd\nyyyy", Xp], ["MM-dd\nyyyy", 2 * Xp], ["MM-dd\nyyyy", 3 * Xp], ["MM-dd\nyyyy", 4 * Xp], ["MM-dd\nyyyy", 5 * Xp], ["MM-dd\nyyyy", 6 * Xp], ["week", 7 * Xp], ["MM-dd\nyyyy", 864e6], ["week", 14 * Xp], ["week", 21 * Xp], ["month", 31 * Xp], ["week", 42 * Xp], ["month", 62 * Xp], ["week", 70 * Xp], ["quarter", 95 * Xp], ["month", 31 * Xp * 4], ["month", 13392e6], ["half-year", 16416e6], ["month", 31 * Xp * 8], ["month", 26784e6], ["year", 380 * Xp]];
  14295. Yp.create = function(t) {
  14296. return new Yp({
  14297. useUTC: t.ecModel.get("useUTC")
  14298. })
  14299. }
  14300. ;
  14301. var qp = mp.prototype
  14302. , Kp = Dp.prototype
  14303. , $p = Gl
  14304. , Jp = zl
  14305. , Qp = Math.floor
  14306. , tg = Math.ceil
  14307. , eg = Math.pow
  14308. , ig = Math.log
  14309. , ng = mp.extend({
  14310. type: "log",
  14311. base: 10,
  14312. $constructor: function() {
  14313. mp.apply(this, arguments),
  14314. this._originalScale = new Dp
  14315. },
  14316. getTicks: function(t) {
  14317. var i = this._originalScale
  14318. , n = this._extent
  14319. , o = i.getExtent();
  14320. return O(Kp.getTicks.call(this, t), function(t) {
  14321. var e = zl(eg(this.base, t));
  14322. return e = t === n[0] && i.__fixMin ? og(e, o[0]) : e,
  14323. e = t === n[1] && i.__fixMax ? og(e, o[1]) : e
  14324. }, this)
  14325. },
  14326. getMinorTicks: Kp.getMinorTicks,
  14327. getLabel: Kp.getLabel,
  14328. scale: function(t) {
  14329. return t = qp.scale.call(this, t),
  14330. eg(this.base, t)
  14331. },
  14332. setExtent: function(t, e) {
  14333. var i = this.base;
  14334. t = ig(t) / ig(i),
  14335. e = ig(e) / ig(i),
  14336. Kp.setExtent.call(this, t, e)
  14337. },
  14338. getExtent: function() {
  14339. var t = this.base
  14340. , e = qp.getExtent.call(this);
  14341. e[0] = eg(t, e[0]),
  14342. e[1] = eg(t, e[1]);
  14343. var i = this._originalScale
  14344. , n = i.getExtent();
  14345. return i.__fixMin && (e[0] = og(e[0], n[0])),
  14346. i.__fixMax && (e[1] = og(e[1], n[1])),
  14347. e
  14348. },
  14349. unionExtent: function(t) {
  14350. this._originalScale.unionExtent(t);
  14351. var e = this.base;
  14352. t[0] = ig(t[0]) / ig(e),
  14353. t[1] = ig(t[1]) / ig(e),
  14354. qp.unionExtent.call(this, t)
  14355. },
  14356. unionExtentFromData: function(t, e) {
  14357. this.unionExtent(t.getApproximateExtent(e))
  14358. },
  14359. niceTicks: function(t) {
  14360. t = t || 10;
  14361. var e = this._extent
  14362. , i = e[1] - e[0];
  14363. if (!(i == 1 / 0 || i <= 0)) {
  14364. var n = jl(i);
  14365. for (t / i * n <= .5 && (n *= 10); !isNaN(n) && Math.abs(n) < 1 && 0 < Math.abs(n); )
  14366. n *= 10;
  14367. var o = [zl(tg(e[0] / n) * n), zl(Qp(e[1] / n) * n)];
  14368. this._interval = n,
  14369. this._niceExtent = o
  14370. }
  14371. },
  14372. niceExtent: function(t) {
  14373. Kp.niceExtent.call(this, t);
  14374. var e = this._originalScale;
  14375. e.__fixMin = t.fixMin,
  14376. e.__fixMax = t.fixMax
  14377. }
  14378. });
  14379. function og(t, e) {
  14380. return Jp(t, $p(e))
  14381. }
  14382. function ag(t, e) {
  14383. var i, n, o, a = t.type, r = e.getMin(), s = e.getMax(), l = t.getExtent();
  14384. "ordinal" === a ? i = e.getCategories().length : (L(n = e.get("boundaryGap")) || (n = [n || 0, n || 0]),
  14385. "boolean" == typeof n[0] && (n = [0, 0]),
  14386. n[0] = Rl(n[0], 1),
  14387. n[1] = Rl(n[1], 1),
  14388. o = l[1] - l[0] || Math.abs(l[0])),
  14389. "dataMin" === r ? r = l[0] : "function" == typeof r && (r = r({
  14390. min: l[0],
  14391. max: l[1]
  14392. })),
  14393. "dataMax" === s ? s = l[1] : "function" == typeof s && (s = s({
  14394. min: l[0],
  14395. max: l[1]
  14396. }));
  14397. var u = null != r
  14398. , h = null != s;
  14399. null == r && (r = "ordinal" === a ? i ? 0 : NaN : l[0] - n[0] * o),
  14400. null == s && (s = "ordinal" === a ? i ? i - 1 : NaN : l[1] + n[1] * o),
  14401. null != r && isFinite(r) || (r = NaN),
  14402. null != s && isFinite(s) || (s = NaN),
  14403. t.setBlank(F(r) || F(s) || "ordinal" === a && !t.getOrdinalMeta().categories.length),
  14404. e.getNeedCrossZero() && (0 < r && 0 < s && !u && (r = 0),
  14405. r < 0 && s < 0 && !h && (s = 0));
  14406. var c = e.ecModel;
  14407. if (c && "time" === a) {
  14408. var d, f = Np("bar", c);
  14409. if (E(f, function(t) {
  14410. d |= t.getBaseAxis() === e.axis
  14411. }),
  14412. d) {
  14413. var p = Op(f)
  14414. , g = function(t, e, i, n) {
  14415. var o = i.axis.getExtent()
  14416. , a = o[1] - o[0]
  14417. , r = Rp(n, i.axis);
  14418. if (void 0 === r)
  14419. return {
  14420. min: t,
  14421. max: e
  14422. };
  14423. var s = 1 / 0;
  14424. E(r, function(t) {
  14425. s = Math.min(t.offset, s)
  14426. });
  14427. var l = -1 / 0;
  14428. E(r, function(t) {
  14429. l = Math.max(t.offset + t.width, l)
  14430. }),
  14431. s = Math.abs(s),
  14432. l = Math.abs(l);
  14433. var u = s + l
  14434. , h = e - t
  14435. , c = h / (1 - (s + l) / a) - h;
  14436. return {
  14437. min: t -= s / u * c,
  14438. max: e += l / u * c
  14439. }
  14440. }(r, s, e, p);
  14441. r = g.min,
  14442. s = g.max
  14443. }
  14444. }
  14445. return {
  14446. extent: [r, s],
  14447. fixMin: u,
  14448. fixMax: h
  14449. }
  14450. }
  14451. function rg(t, e) {
  14452. var i = ag(t, e)
  14453. , n = i.extent
  14454. , o = e.get("splitNumber");
  14455. "log" === t.type && (t.base = e.get("logBase"));
  14456. var a = t.type;
  14457. t.setExtent(n[0], n[1]),
  14458. t.niceExtent({
  14459. splitNumber: o,
  14460. fixMin: i.fixMin,
  14461. fixMax: i.fixMax,
  14462. minInterval: "interval" === a || "time" === a ? e.get("minInterval") : null,
  14463. maxInterval: "interval" === a || "time" === a ? e.get("maxInterval") : null
  14464. });
  14465. var r = e.get("interval");
  14466. null != r && t.setInterval && t.setInterval(r)
  14467. }
  14468. function sg(t, e) {
  14469. if (e = e || t.get("type"))
  14470. switch (e) {
  14471. case "category":
  14472. return new bp(t.getOrdinalMeta ? t.getOrdinalMeta() : t.getCategories(),[1 / 0, -1 / 0]);
  14473. case "value":
  14474. return new Dp;
  14475. default:
  14476. return (mp.getClass(e) || Dp).create(t)
  14477. }
  14478. }
  14479. function lg(i) {
  14480. var e, n = i.getLabelModel().get("formatter"), o = "category" === i.type ? i.scale.getExtent()[0] : null;
  14481. return "string" == typeof n ? (e = n,
  14482. n = function(t) {
  14483. return t = i.scale.getLabel(t),
  14484. e.replace("{value}", null != t ? t : "")
  14485. }
  14486. ) : "function" == typeof n ? function(t, e) {
  14487. return null != o && (e = t - o),
  14488. n(ug(i, t), e)
  14489. }
  14490. : function(t) {
  14491. return i.scale.getLabel(t)
  14492. }
  14493. }
  14494. function ug(t, e) {
  14495. return "category" === t.type ? t.scale.getLabel(e) : e
  14496. }
  14497. function hg(t) {
  14498. var e = t.get("interval");
  14499. return null == e ? "auto" : e
  14500. }
  14501. function cg(t) {
  14502. return "category" === t.type && 0 === hg(t.getLabelModel())
  14503. }
  14504. E(["contain", "normalize"], function(e) {
  14505. ng.prototype[e] = function(t) {
  14506. return t = ig(t) / ig(this.base),
  14507. qp[e].call(this, t)
  14508. }
  14509. }),
  14510. ng.create = function() {
  14511. return new ng
  14512. }
  14513. ;
  14514. var dg = {
  14515. getMin: function(t) {
  14516. var e = this.option
  14517. , i = t || null == e.rangeStart ? e.min : e.rangeStart;
  14518. return this.axis && null != i && "dataMin" !== i && "function" != typeof i && !F(i) && (i = this.axis.scale.parse(i)),
  14519. i
  14520. },
  14521. getMax: function(t) {
  14522. var e = this.option
  14523. , i = t || null == e.rangeEnd ? e.max : e.rangeEnd;
  14524. return this.axis && null != i && "dataMax" !== i && "function" != typeof i && !F(i) && (i = this.axis.scale.parse(i)),
  14525. i
  14526. },
  14527. getNeedCrossZero: function() {
  14528. var t = this.option;
  14529. return null == t.rangeStart && null == t.rangeEnd && !t.scale
  14530. },
  14531. getCoordSysModel: et,
  14532. setRange: function(t, e) {
  14533. this.option.rangeStart = t,
  14534. this.option.rangeEnd = e
  14535. },
  14536. resetRange: function() {
  14537. this.option.rangeStart = this.option.rangeEnd = null
  14538. }
  14539. }
  14540. , fg = Cs({
  14541. type: "triangle",
  14542. shape: {
  14543. cx: 0,
  14544. cy: 0,
  14545. width: 0,
  14546. height: 0
  14547. },
  14548. buildPath: function(t, e) {
  14549. var i = e.cx
  14550. , n = e.cy
  14551. , o = e.width / 2
  14552. , a = e.height / 2;
  14553. t.moveTo(i, n - a),
  14554. t.lineTo(i + o, n + a),
  14555. t.lineTo(i - o, n + a),
  14556. t.closePath()
  14557. }
  14558. })
  14559. , pg = Cs({
  14560. type: "diamond",
  14561. shape: {
  14562. cx: 0,
  14563. cy: 0,
  14564. width: 0,
  14565. height: 0
  14566. },
  14567. buildPath: function(t, e) {
  14568. var i = e.cx
  14569. , n = e.cy
  14570. , o = e.width / 2
  14571. , a = e.height / 2;
  14572. t.moveTo(i, n - a),
  14573. t.lineTo(i + o, n),
  14574. t.lineTo(i, n + a),
  14575. t.lineTo(i - o, n),
  14576. t.closePath()
  14577. }
  14578. })
  14579. , gg = Cs({
  14580. type: "pin",
  14581. shape: {
  14582. x: 0,
  14583. y: 0,
  14584. width: 0,
  14585. height: 0
  14586. },
  14587. buildPath: function(t, e) {
  14588. var i = e.x
  14589. , n = e.y
  14590. , o = e.width / 5 * 3
  14591. , a = Math.max(o, e.height)
  14592. , r = o / 2
  14593. , s = r * r / (a - r)
  14594. , l = n - a + r + s
  14595. , u = Math.asin(s / r)
  14596. , h = Math.cos(u) * r
  14597. , c = Math.sin(u)
  14598. , d = Math.cos(u)
  14599. , f = .6 * r
  14600. , p = .7 * r;
  14601. t.moveTo(i - h, l + s),
  14602. t.arc(i, l, r, Math.PI - u, 2 * Math.PI + u),
  14603. t.bezierCurveTo(i + h - c * f, l + s + d * f, i, n - p, i, n),
  14604. t.bezierCurveTo(i, n - p, i - h + c * f, l + s + d * f, i - h, l + s),
  14605. t.closePath()
  14606. }
  14607. })
  14608. , mg = Cs({
  14609. type: "arrow",
  14610. shape: {
  14611. x: 0,
  14612. y: 0,
  14613. width: 0,
  14614. height: 0
  14615. },
  14616. buildPath: function(t, e) {
  14617. var i = e.height
  14618. , n = e.width
  14619. , o = e.x
  14620. , a = e.y
  14621. , r = n / 3 * 2;
  14622. t.moveTo(o, a),
  14623. t.lineTo(o + r, a + i),
  14624. t.lineTo(o, a + i / 4 * 3),
  14625. t.lineTo(o - r, a + i),
  14626. t.lineTo(o, a),
  14627. t.closePath()
  14628. }
  14629. })
  14630. , vg = {
  14631. line: function(t, e, i, n, o) {
  14632. o.x1 = t,
  14633. o.y1 = e + n / 2,
  14634. o.x2 = t + i,
  14635. o.y2 = e + n / 2
  14636. },
  14637. rect: function(t, e, i, n, o) {
  14638. o.x = t,
  14639. o.y = e,
  14640. o.width = i,
  14641. o.height = n
  14642. },
  14643. roundRect: function(t, e, i, n, o) {
  14644. o.x = t,
  14645. o.y = e,
  14646. o.width = i,
  14647. o.height = n,
  14648. o.r = Math.min(i, n) / 4
  14649. },
  14650. square: function(t, e, i, n, o) {
  14651. var a = Math.min(i, n);
  14652. o.x = t,
  14653. o.y = e,
  14654. o.width = a,
  14655. o.height = a
  14656. },
  14657. circle: function(t, e, i, n, o) {
  14658. o.cx = t + i / 2,
  14659. o.cy = e + n / 2,
  14660. o.r = Math.min(i, n) / 2
  14661. },
  14662. diamond: function(t, e, i, n, o) {
  14663. o.cx = t + i / 2,
  14664. o.cy = e + n / 2,
  14665. o.width = i,
  14666. o.height = n
  14667. },
  14668. pin: function(t, e, i, n, o) {
  14669. o.x = t + i / 2,
  14670. o.y = e + n / 2,
  14671. o.width = i,
  14672. o.height = n
  14673. },
  14674. arrow: function(t, e, i, n, o) {
  14675. o.x = t + i / 2,
  14676. o.y = e + n / 2,
  14677. o.width = i,
  14678. o.height = n
  14679. },
  14680. triangle: function(t, e, i, n, o) {
  14681. o.cx = t + i / 2,
  14682. o.cy = e + n / 2,
  14683. o.width = i,
  14684. o.height = n
  14685. }
  14686. }
  14687. , yg = {};
  14688. E({
  14689. line: ls,
  14690. rect: rs,
  14691. roundRect: rs,
  14692. square: rs,
  14693. circle: Yr,
  14694. diamond: pg,
  14695. pin: gg,
  14696. arrow: mg,
  14697. triangle: fg
  14698. }, function(t, e) {
  14699. yg[e] = new t
  14700. });
  14701. var xg = Cs({
  14702. type: "symbol",
  14703. shape: {
  14704. symbolType: "",
  14705. x: 0,
  14706. y: 0,
  14707. width: 0,
  14708. height: 0
  14709. },
  14710. calculateTextPosition: function(t, e, i) {
  14711. var n = yn(t, e, i)
  14712. , o = this.shape;
  14713. return o && "pin" === o.symbolType && "inside" === e.textPosition && (n.y = i.y + .4 * i.height),
  14714. n
  14715. },
  14716. buildPath: function(t, e, i) {
  14717. var n = e.symbolType;
  14718. if ("none" !== n) {
  14719. var o = yg[n];
  14720. o = o || yg[n = "rect"],
  14721. vg[n](e.x, e.y, e.width, e.height, o.shape),
  14722. o.buildPath(t, o.shape, i)
  14723. }
  14724. }
  14725. });
  14726. function _g(t, e) {
  14727. if ("image" !== this.type) {
  14728. var i = this.style
  14729. , n = this.shape;
  14730. n && "line" === n.symbolType ? i.stroke = t : this.__isEmptyBrush ? (i.stroke = t,
  14731. i.fill = e || "#fff") : (i.fill && (i.fill = t),
  14732. i.stroke && (i.stroke = t)),
  14733. this.dirty(!1)
  14734. }
  14735. }
  14736. function wg(t, e, i, n, o, a, r) {
  14737. var s, l = 0 === t.indexOf("empty");
  14738. return l && (t = t.substr(5, 1).toLowerCase() + t.substr(6)),
  14739. (s = 0 === t.indexOf("image://") ? Ns(t.slice(8), new Di(e,i,n,o), r ? "center" : "cover") : 0 === t.indexOf("path://") ? Ps(t.slice(7), {}, new Di(e,i,n,o), r ? "center" : "cover") : new xg({
  14740. shape: {
  14741. symbolType: t,
  14742. x: e,
  14743. y: i,
  14744. width: n,
  14745. height: o
  14746. }
  14747. })).__isEmptyBrush = l,
  14748. s.setColor = _g,
  14749. s.setColor(a),
  14750. s
  14751. }
  14752. var bg = {
  14753. isDimensionStacked: fp,
  14754. enableDataStack: dp,
  14755. getStackedDimension: pp
  14756. };
  14757. var Sg = (Object.freeze || Object)({
  14758. createList: function(t) {
  14759. return gp(t.getSource(), t)
  14760. },
  14761. getLayoutRect: bu,
  14762. dataStack: bg,
  14763. createScale: function(t, e) {
  14764. var i = e;
  14765. Cl.isInstance(e) || b(i = new Cl(e), dg);
  14766. var n = sg(i);
  14767. return n.setExtent(t[0], t[1]),
  14768. rg(n, i),
  14769. n
  14770. },
  14771. mixinAxisModelCommonMethods: function(t) {
  14772. b(t, dg)
  14773. },
  14774. completeDimensions: rp,
  14775. createDimensions: lp,
  14776. createSymbol: wg
  14777. })
  14778. , Mg = 1e-8;
  14779. function Ig(t, e) {
  14780. return Math.abs(t - e) < Mg
  14781. }
  14782. function Tg(t, e, i) {
  14783. var n = 0
  14784. , o = t[0];
  14785. if (!o)
  14786. return !1;
  14787. for (var a = 1; a < t.length; a++) {
  14788. var r = t[a];
  14789. n += pr(o[0], o[1], r[0], r[1], e, i),
  14790. o = r
  14791. }
  14792. var s = t[0];
  14793. return Ig(o[0], s[0]) && Ig(o[1], s[1]) || (n += pr(o[0], o[1], s[0], s[1], e, i)),
  14794. 0 !== n
  14795. }
  14796. function Ag(t, e, i) {
  14797. if (this.name = t,
  14798. this.geometries = e,
  14799. i)
  14800. i = [i[0], i[1]];
  14801. else {
  14802. var n = this.getBoundingRect();
  14803. i = [n.x + n.width / 2, n.y + n.height / 2]
  14804. }
  14805. this.center = i
  14806. }
  14807. function Dg(t, e, i) {
  14808. for (var n = [], o = e[0], a = e[1], r = 0; r < t.length; r += 2) {
  14809. var s = t.charCodeAt(r) - 64
  14810. , l = t.charCodeAt(r + 1) - 64;
  14811. s = s >> 1 ^ -(1 & s),
  14812. l = l >> 1 ^ -(1 & l),
  14813. o = s += o,
  14814. a = l += a,
  14815. n.push([s / i, l / i])
  14816. }
  14817. return n
  14818. }
  14819. Ag.prototype = {
  14820. constructor: Ag,
  14821. properties: null,
  14822. getBoundingRect: function() {
  14823. var t = this._rect;
  14824. if (t)
  14825. return t;
  14826. for (var e = Number.MAX_VALUE, i = [e, e], n = [-e, -e], o = [], a = [], r = this.geometries, s = 0; s < r.length; s++) {
  14827. if ("polygon" === r[s].type)
  14828. Wa(r[s].exterior, o, a),
  14829. St(i, i, o),
  14830. Mt(n, n, a)
  14831. }
  14832. return 0 === s && (i[0] = i[1] = n[0] = n[1] = 0),
  14833. this._rect = new Di(i[0],i[1],n[0] - i[0],n[1] - i[1])
  14834. },
  14835. contain: function(t) {
  14836. var e = this.getBoundingRect()
  14837. , i = this.geometries;
  14838. if (!e.contain(t[0], t[1]))
  14839. return !1;
  14840. t: for (var n = 0, o = i.length; n < o; n++)
  14841. if ("polygon" === i[n].type) {
  14842. var a = i[n].exterior
  14843. , r = i[n].interiors;
  14844. if (Tg(a, t[0], t[1])) {
  14845. for (var s = 0; s < (r ? r.length : 0); s++)
  14846. if (Tg(r[s]))
  14847. continue t;
  14848. return !0
  14849. }
  14850. }
  14851. return !1
  14852. },
  14853. transformTo: function(t, e, i, n) {
  14854. var o = this.getBoundingRect()
  14855. , a = o.width / o.height;
  14856. i ? n = n || i / a : i = a * n;
  14857. for (var r = new Di(t,e,i,n), s = o.calculateTransform(r), l = this.geometries, u = 0; u < l.length; u++)
  14858. if ("polygon" === l[u].type) {
  14859. for (var h = l[u].exterior, c = l[u].interiors, d = 0; d < h.length; d++)
  14860. bt(h[d], h[d], s);
  14861. for (var f = 0; f < (c ? c.length : 0); f++)
  14862. for (d = 0; d < c[f].length; d++)
  14863. bt(c[f][d], c[f][d], s)
  14864. }
  14865. (o = this._rect).copy(r),
  14866. this.center = [o.x + o.width / 2, o.y + o.height / 2]
  14867. },
  14868. cloneShallow: function(t) {
  14869. null == t && (t = this.name);
  14870. var e = new Ag(t,this.geometries,this.center);
  14871. return e._rect = this._rect,
  14872. e.transformTo = null,
  14873. e
  14874. }
  14875. };
  14876. function Cg(t, r) {
  14877. return function(t) {
  14878. if (!t.UTF8Encoding)
  14879. return;
  14880. var e = t.UTF8Scale;
  14881. null == e && (e = 1024);
  14882. for (var i = t.features, n = 0; n < i.length; n++)
  14883. for (var o = i[n].geometry, a = o.coordinates, r = o.encodeOffsets, s = 0; s < a.length; s++) {
  14884. var l = a[s];
  14885. if ("Polygon" === o.type)
  14886. a[s] = Dg(l, r[s], e);
  14887. else if ("MultiPolygon" === o.type)
  14888. for (var u = 0; u < l.length; u++) {
  14889. var h = l[u];
  14890. l[u] = Dg(h, r[s][u], e)
  14891. }
  14892. }
  14893. t.UTF8Encoding = !1
  14894. }(t),
  14895. O(M(t.features, function(t) {
  14896. return t.geometry && t.properties && 0 < t.geometry.coordinates.length
  14897. }), function(t) {
  14898. var e = t.properties
  14899. , i = t.geometry
  14900. , n = i.coordinates
  14901. , o = [];
  14902. "Polygon" === i.type && o.push({
  14903. type: "polygon",
  14904. exterior: n[0],
  14905. interiors: n.slice(1)
  14906. }),
  14907. "MultiPolygon" === i.type && E(n, function(t) {
  14908. t[0] && o.push({
  14909. type: "polygon",
  14910. exterior: t[0],
  14911. interiors: t.slice(1)
  14912. })
  14913. });
  14914. var a = new Ag(e[r || "name"],o,e.cp);
  14915. return a.properties = e,
  14916. a
  14917. })
  14918. }
  14919. var Lg = jo();
  14920. function kg(t) {
  14921. return "category" === t.type ? function(t) {
  14922. var e = t.getLabelModel()
  14923. , i = Ng(t, e);
  14924. return !e.get("show") || t.scale.isBlank() ? {
  14925. labels: [],
  14926. labelCategoryInterval: i.labelCategoryInterval
  14927. } : i
  14928. }(t) : function(i) {
  14929. var t = i.scale.getTicks()
  14930. , n = lg(i);
  14931. return {
  14932. labels: O(t, function(t, e) {
  14933. return {
  14934. formattedLabel: n(t, e),
  14935. rawLabel: i.scale.getLabel(t),
  14936. tickValue: t
  14937. }
  14938. })
  14939. }
  14940. }(t)
  14941. }
  14942. function Pg(t, e) {
  14943. return "category" === t.type ? function(t, e) {
  14944. var i, n, o = Og(t, "ticks"), a = hg(e), r = Eg(o, a);
  14945. if (r)
  14946. return r;
  14947. e.get("show") && !t.scale.isBlank() || (i = []);
  14948. if (C(a))
  14949. i = Bg(t, a, !0);
  14950. else if ("auto" === a) {
  14951. var s = Ng(t, t.getLabelModel());
  14952. n = s.labelCategoryInterval,
  14953. i = O(s.labels, function(t) {
  14954. return t.tickValue
  14955. })
  14956. } else
  14957. i = zg(t, n = a, !0);
  14958. return Rg(o, a, {
  14959. ticks: i,
  14960. tickCategoryInterval: n
  14961. })
  14962. }(t, e) : {
  14963. ticks: t.scale.getTicks()
  14964. }
  14965. }
  14966. function Ng(t, e) {
  14967. var i, n = Og(t, "labels"), o = hg(e), a = Eg(n, o);
  14968. return a || Rg(n, o, {
  14969. labels: C(o) ? Bg(t, o) : zg(t, i = "auto" === o ? function(t) {
  14970. var e = Lg(t).autoInterval;
  14971. return null != e ? e : Lg(t).autoInterval = t.calculateCategoryInterval()
  14972. }(t) : o),
  14973. labelCategoryInterval: i
  14974. })
  14975. }
  14976. function Og(t, e) {
  14977. return Lg(t)[e] || (Lg(t)[e] = [])
  14978. }
  14979. function Eg(t, e) {
  14980. for (var i = 0; i < t.length; i++)
  14981. if (t[i].key === e)
  14982. return t[i].value
  14983. }
  14984. function Rg(t, e, i) {
  14985. return t.push({
  14986. key: e,
  14987. value: i
  14988. }),
  14989. i
  14990. }
  14991. function zg(t, e, i) {
  14992. var n = lg(t)
  14993. , o = t.scale
  14994. , a = o.getExtent()
  14995. , r = t.getLabelModel()
  14996. , s = []
  14997. , l = Math.max((e || 0) + 1, 1)
  14998. , u = a[0]
  14999. , h = o.count();
  15000. 0 !== u && 1 < l && 2 < h / l && (u = Math.round(Math.ceil(u / l) * l));
  15001. var c = cg(t)
  15002. , d = r.get("showMinLabel") || c
  15003. , f = r.get("showMaxLabel") || c;
  15004. d && u !== a[0] && g(a[0]);
  15005. for (var p = u; p <= a[1]; p += l)
  15006. g(p);
  15007. function g(t) {
  15008. s.push(i ? t : {
  15009. formattedLabel: n(t),
  15010. rawLabel: o.getLabel(t),
  15011. tickValue: t
  15012. })
  15013. }
  15014. return f && p - l !== a[1] && g(a[1]),
  15015. s
  15016. }
  15017. function Bg(t, i, n) {
  15018. var o = t.scale
  15019. , a = lg(t)
  15020. , r = [];
  15021. return E(o.getTicks(), function(t) {
  15022. var e = o.getLabel(t);
  15023. i(t, e) && r.push(n ? t : {
  15024. formattedLabel: a(t),
  15025. rawLabel: e,
  15026. tickValue: t
  15027. })
  15028. }),
  15029. r
  15030. }
  15031. var Vg = [0, 1]
  15032. , Gg = function(t, e, i) {
  15033. this.dim = t,
  15034. this.scale = e,
  15035. this._extent = i || [0, 0],
  15036. this.inverse = !1,
  15037. this.onBand = !1
  15038. };
  15039. function Fg(t, e) {
  15040. var i = (t[1] - t[0]) / e / 2;
  15041. t[0] += i,
  15042. t[1] -= i
  15043. }
  15044. Gg.prototype = {
  15045. constructor: Gg,
  15046. contain: function(t) {
  15047. var e = this._extent
  15048. , i = Math.min(e[0], e[1])
  15049. , n = Math.max(e[0], e[1]);
  15050. return i <= t && t <= n
  15051. },
  15052. containData: function(t) {
  15053. return this.scale.contain(t)
  15054. },
  15055. getExtent: function() {
  15056. return this._extent.slice()
  15057. },
  15058. getPixelPrecision: function(t) {
  15059. return Fl(t || this.scale.getExtent(), this._extent)
  15060. },
  15061. setExtent: function(t, e) {
  15062. var i = this._extent;
  15063. i[0] = t,
  15064. i[1] = e
  15065. },
  15066. dataToCoord: function(t, e) {
  15067. var i = this._extent
  15068. , n = this.scale;
  15069. return t = n.normalize(t),
  15070. this.onBand && "ordinal" === n.type && Fg(i = i.slice(), n.count()),
  15071. El(t, Vg, i, e)
  15072. },
  15073. coordToData: function(t, e) {
  15074. var i = this._extent
  15075. , n = this.scale;
  15076. this.onBand && "ordinal" === n.type && Fg(i = i.slice(), n.count());
  15077. var o = El(t, i, Vg, e);
  15078. return this.scale.scale(o)
  15079. },
  15080. pointToData: function(t, e) {},
  15081. getTicksCoords: function(t) {
  15082. var e = (t = t || {}).tickModel || this.getTickModel()
  15083. , i = O(Pg(this, e).ticks, function(t) {
  15084. return {
  15085. coord: this.dataToCoord(t),
  15086. tickValue: t
  15087. }
  15088. }, this);
  15089. return function(t, e, i, n) {
  15090. var o = e.length;
  15091. if (!t.onBand || i || !o)
  15092. return;
  15093. var a, r, s = t.getExtent();
  15094. if (1 === o)
  15095. e[0].coord = s[0],
  15096. a = e[1] = {
  15097. coord: s[0]
  15098. };
  15099. else {
  15100. var l = e[o - 1].tickValue - e[0].tickValue
  15101. , u = (e[o - 1].coord - e[0].coord) / l;
  15102. E(e, function(t) {
  15103. t.coord -= u / 2
  15104. });
  15105. var h = t.scale.getExtent();
  15106. r = 1 + h[1] - e[o - 1].tickValue,
  15107. a = {
  15108. coord: e[o - 1].coord + u * r
  15109. },
  15110. e.push(a)
  15111. }
  15112. var c = s[0] > s[1];
  15113. d(e[0].coord, s[0]) && (n ? e[0].coord = s[0] : e.shift());
  15114. n && d(s[0], e[0].coord) && e.unshift({
  15115. coord: s[0]
  15116. });
  15117. d(s[1], a.coord) && (n ? a.coord = s[1] : e.pop());
  15118. n && d(a.coord, s[1]) && e.push({
  15119. coord: s[1]
  15120. });
  15121. function d(t, e) {
  15122. return t = zl(t),
  15123. e = zl(e),
  15124. c ? e < t : t < e
  15125. }
  15126. }(this, i, e.get("alignWithLabel"), t.clamp),
  15127. i
  15128. },
  15129. getMinorTicksCoords: function() {
  15130. if ("ordinal" === this.scale.type)
  15131. return [];
  15132. var t = this.model.getModel("minorTick").get("splitNumber");
  15133. return 0 < t && t < 100 || (t = 5),
  15134. O(this.scale.getMinorTicks(t), function(t) {
  15135. return O(t, function(t) {
  15136. return {
  15137. coord: this.dataToCoord(t),
  15138. tickValue: t
  15139. }
  15140. }, this)
  15141. }, this)
  15142. },
  15143. getViewLabels: function() {
  15144. return kg(this).labels
  15145. },
  15146. getLabelModel: function() {
  15147. return this.model.getModel("axisLabel")
  15148. },
  15149. getTickModel: function() {
  15150. return this.model.getModel("axisTick")
  15151. },
  15152. getBandWidth: function() {
  15153. var t = this._extent
  15154. , e = this.scale.getExtent()
  15155. , i = e[1] - e[0] + (this.onBand ? 1 : 0);
  15156. 0 === i && (i = 1);
  15157. var n = Math.abs(t[1] - t[0]);
  15158. return Math.abs(n) / i
  15159. },
  15160. isHorizontal: null,
  15161. getRotate: null,
  15162. calculateCategoryInterval: function() {
  15163. return function(t) {
  15164. var e = function(t) {
  15165. var e = t.getLabelModel();
  15166. return {
  15167. axisRotate: t.getRotate ? t.getRotate() : t.isHorizontal && !t.isHorizontal() ? 90 : 0,
  15168. labelRotate: e.get("rotate") || 0,
  15169. font: e.getFont()
  15170. }
  15171. }(t)
  15172. , i = lg(t)
  15173. , n = (e.axisRotate - e.labelRotate) / 180 * Math.PI
  15174. , o = t.scale
  15175. , a = o.getExtent()
  15176. , r = o.count();
  15177. if (a[1] - a[0] < 1)
  15178. return 0;
  15179. var s = 1;
  15180. 40 < r && (s = Math.max(1, Math.floor(r / 40)));
  15181. for (var l = a[0], u = t.dataToCoord(l + 1) - t.dataToCoord(l), h = Math.abs(u * Math.cos(n)), c = Math.abs(u * Math.sin(n)), d = 0, f = 0; l <= a[1]; l += s) {
  15182. var p, g, m = gn(i(l), e.font, "center", "top");
  15183. p = 1.3 * m.width,
  15184. g = 1.3 * m.height,
  15185. d = Math.max(d, p, 7),
  15186. f = Math.max(f, g, 7)
  15187. }
  15188. var v = d / h
  15189. , y = f / c;
  15190. isNaN(v) && (v = 1 / 0),
  15191. isNaN(y) && (y = 1 / 0);
  15192. var x = Math.max(0, Math.floor(Math.min(v, y)))
  15193. , _ = Lg(t.model)
  15194. , w = t.getExtent()
  15195. , b = _.lastAutoInterval
  15196. , S = _.lastTickCount;
  15197. return null != b && null != S && Math.abs(b - x) <= 1 && Math.abs(S - r) <= 1 && x < b && _.axisExtend0 === w[0] && _.axisExtend1 === w[1] ? x = b : (_.lastTickCount = r,
  15198. _.lastAutoInterval = x,
  15199. _.axisExtend0 = w[0],
  15200. _.axisExtend1 = w[1]),
  15201. x
  15202. }(this)
  15203. }
  15204. };
  15205. var Wg = Cg
  15206. , Hg = {};
  15207. E(["map", "each", "filter", "indexOf", "inherits", "reduce", "filter", "bind", "curry", "isArray", "isString", "isObject", "isFunction", "extend", "defaults", "clone", "merge"], function(t) {
  15208. Hg[t] = it[t]
  15209. });
  15210. var Zg = {};
  15211. function Ug(t, e) {
  15212. var i = t.mapDimension("defaultedLabel", !0)
  15213. , n = i.length;
  15214. if (1 === n)
  15215. return Hh(t, e, i[0]);
  15216. if (n) {
  15217. for (var o = [], a = 0; a < i.length; a++) {
  15218. var r = Hh(t, e, i[a]);
  15219. o.push(r)
  15220. }
  15221. return o.join(" ")
  15222. }
  15223. }
  15224. function Xg(t, e, i) {
  15225. Ci.call(this),
  15226. this.updateData(t, e, i)
  15227. }
  15228. E(["extendShape", "extendPath", "makePath", "makeImage", "mergePath", "resizePath", "createIcon", "setHoverStyle", "setLabelStyle", "setTextStyle", "setText", "getFont", "updateProps", "initProps", "getTransform", "clipPointsByRect", "clipRectByRect", "registerShape", "getShapeClass", "Group", "Image", "Text", "Circle", "Sector", "Ring", "Polygon", "Polyline", "Rect", "Line", "BezierCurve", "Arc", "IncrementalDisplayable", "CompoundPath", "LinearGradient", "RadialGradient", "BoundingRect"], function(t) {
  15229. Zg[t] = bl[t]
  15230. }),
  15231. sc.extend({
  15232. type: "series.line",
  15233. dependencies: ["grid", "polar"],
  15234. getInitialData: function(t, e) {
  15235. return gp(this.getSource(), this, {
  15236. useEncodeDefaulter: !0
  15237. })
  15238. },
  15239. defaultOption: {
  15240. zlevel: 0,
  15241. z: 2,
  15242. coordinateSystem: "cartesian2d",
  15243. legendHoverLink: !0,
  15244. hoverAnimation: !0,
  15245. clip: !0,
  15246. label: {
  15247. position: "top"
  15248. },
  15249. lineStyle: {
  15250. width: 2,
  15251. type: "solid"
  15252. },
  15253. step: !1,
  15254. smooth: !1,
  15255. smoothMonotone: null,
  15256. symbol: "emptyCircle",
  15257. symbolSize: 4,
  15258. symbolRotate: null,
  15259. showSymbol: !0,
  15260. showAllSymbol: "auto",
  15261. connectNulls: !1,
  15262. sampling: "none",
  15263. animationEasing: "linear",
  15264. progressive: 0,
  15265. hoverLayerThreshold: 1 / 0
  15266. }
  15267. });
  15268. var Yg = Xg.prototype
  15269. , jg = Xg.getSymbolSize = function(t, e) {
  15270. var i = t.getItemVisual(e, "symbolSize");
  15271. return i instanceof Array ? i.slice() : [+i, +i]
  15272. }
  15273. ;
  15274. function qg(t) {
  15275. return [t[0] / 2, t[1] / 2]
  15276. }
  15277. function Kg(t, e) {
  15278. this.parent.drift(t, e)
  15279. }
  15280. Yg._createSymbol = function(t, e, i, n, o) {
  15281. this.removeAll();
  15282. var a = wg(t, -1, -1, 2, 2, e.getItemVisual(i, "color"), o);
  15283. a.attr({
  15284. z2: 100,
  15285. culling: !0,
  15286. scale: qg(n)
  15287. }),
  15288. a.drift = Kg,
  15289. this._symbolType = t,
  15290. this.add(a)
  15291. }
  15292. ,
  15293. Yg.stopSymbolAnimation = function(t) {
  15294. this.childAt(0).stopAnimation(t)
  15295. }
  15296. ,
  15297. Yg.getSymbolPath = function() {
  15298. return this.childAt(0)
  15299. }
  15300. ,
  15301. Yg.getScale = function() {
  15302. return this.childAt(0).scale
  15303. }
  15304. ,
  15305. Yg.highlight = function() {
  15306. this.childAt(0).trigger("emphasis")
  15307. }
  15308. ,
  15309. Yg.downplay = function() {
  15310. this.childAt(0).trigger("normal")
  15311. }
  15312. ,
  15313. Yg.setZ = function(t, e) {
  15314. var i = this.childAt(0);
  15315. i.zlevel = t,
  15316. i.z = e
  15317. }
  15318. ,
  15319. Yg.setDraggable = function(t) {
  15320. var e = this.childAt(0);
  15321. e.draggable = t,
  15322. e.cursor = t ? "move" : e.cursor
  15323. }
  15324. ,
  15325. Yg.updateData = function(t, e, i) {
  15326. this.silent = !1;
  15327. var n = t.getItemVisual(e, "symbol") || "circle"
  15328. , o = t.hostModel
  15329. , a = jg(t, e)
  15330. , r = n !== this._symbolType;
  15331. if (r) {
  15332. var s = t.getItemVisual(e, "symbolKeepAspect");
  15333. this._createSymbol(n, t, e, a, s)
  15334. } else {
  15335. (l = this.childAt(0)).silent = !1,
  15336. cl(l, {
  15337. scale: qg(a)
  15338. }, o, e)
  15339. }
  15340. if (this._updateCommon(t, e, a, i),
  15341. r) {
  15342. var l = this.childAt(0)
  15343. , u = i && i.fadeIn
  15344. , h = {
  15345. scale: l.scale.slice()
  15346. };
  15347. u && (h.style = {
  15348. opacity: l.style.opacity
  15349. }),
  15350. l.scale = [0, 0],
  15351. u && (l.style.opacity = 0),
  15352. dl(l, h, o, e)
  15353. }
  15354. this._seriesModel = o
  15355. }
  15356. ;
  15357. var $g = ["itemStyle"]
  15358. , Jg = ["emphasis", "itemStyle"]
  15359. , Qg = ["label"]
  15360. , tm = ["emphasis", "label"];
  15361. function em(t, e) {
  15362. if (!this.incremental && !this.useHoverLayer)
  15363. if ("emphasis" === e) {
  15364. var i = this.__symbolOriginalScale
  15365. , n = i[1] / i[0]
  15366. , o = {
  15367. scale: [Math.max(1.1 * i[0], i[0] + 3), Math.max(1.1 * i[1], i[1] + 3 * n)]
  15368. };
  15369. this.animateTo(o, 400, "elasticOut")
  15370. } else
  15371. "normal" === e && this.animateTo({
  15372. scale: this.__symbolOriginalScale
  15373. }, 400, "elasticOut")
  15374. }
  15375. function im(t) {
  15376. this.group = new Ci,
  15377. this._symbolCtor = t || Xg
  15378. }
  15379. Yg._updateCommon = function(i, t, e, n) {
  15380. var o = this.childAt(0)
  15381. , a = i.hostModel
  15382. , r = i.getItemVisual(t, "color");
  15383. "image" !== o.type ? o.useStyle({
  15384. strokeNoScale: !0
  15385. }) : o.setStyle({
  15386. opacity: null,
  15387. shadowBlur: null,
  15388. shadowOffsetX: null,
  15389. shadowOffsetY: null,
  15390. shadowColor: null
  15391. });
  15392. var s = n && n.itemStyle
  15393. , l = n && n.hoverItemStyle
  15394. , u = n && n.symbolOffset
  15395. , h = n && n.labelModel
  15396. , c = n && n.hoverLabelModel
  15397. , d = n && n.hoverAnimation
  15398. , f = n && n.cursorStyle;
  15399. if (!n || i.hasItemOption) {
  15400. var p = n && n.itemModel ? n.itemModel : i.getItemModel(t);
  15401. s = p.getModel($g).getItemStyle(["color"]),
  15402. l = p.getModel(Jg).getItemStyle(),
  15403. u = p.getShallow("symbolOffset"),
  15404. h = p.getModel(Qg),
  15405. c = p.getModel(tm),
  15406. d = p.getShallow("hoverAnimation"),
  15407. f = p.getShallow("cursor")
  15408. } else
  15409. l = P({}, l);
  15410. var g = o.style
  15411. , m = i.getItemVisual(t, "symbolRotate");
  15412. o.attr("rotation", (m || 0) * Math.PI / 180 || 0),
  15413. u && o.attr("position", [Rl(u[0], e[0]), Rl(u[1], e[1])]),
  15414. f && o.attr("cursor", f),
  15415. o.setColor(r, n && n.symbolInnerColor),
  15416. o.setStyle(s);
  15417. var v = i.getItemVisual(t, "opacity");
  15418. null != v && (g.opacity = v);
  15419. var y = i.getItemVisual(t, "liftZ")
  15420. , x = o.__z2Origin;
  15421. null != y ? null == x && (o.__z2Origin = o.z2,
  15422. o.z2 += y) : null != x && (o.z2 = x,
  15423. o.__z2Origin = null);
  15424. var _ = n && n.useNameLabel;
  15425. el(g, l, h, c, {
  15426. labelFetcher: a,
  15427. labelDataIndex: t,
  15428. defaultText: function(t, e) {
  15429. return _ ? i.getName(t) : Ug(i, t)
  15430. },
  15431. isRectText: !0,
  15432. autoColor: r
  15433. }),
  15434. o.__symbolOriginalScale = qg(e),
  15435. o.hoverStyle = l,
  15436. o.highDownOnUpdate = d && a.isAnimationEnabled() ? em : null,
  15437. $s(o)
  15438. }
  15439. ,
  15440. Yg.fadeOut = function(t, e) {
  15441. var i = this.childAt(0);
  15442. this.silent = i.silent = !0,
  15443. e && e.keepLabel || (i.style.text = null),
  15444. cl(i, {
  15445. style: {
  15446. opacity: 0
  15447. },
  15448. scale: [0, 0]
  15449. }, this._seriesModel, this.dataIndex, t)
  15450. }
  15451. ,
  15452. w(Xg, Ci);
  15453. var nm = im.prototype;
  15454. function om(t, e, i, n) {
  15455. return e && !isNaN(e[0]) && !isNaN(e[1]) && !(n.isIgnore && n.isIgnore(i)) && !(n.clipShape && !n.clipShape.contain(e[0], e[1])) && "none" !== t.getItemVisual(i, "symbol")
  15456. }
  15457. function am(t) {
  15458. return null == t || z(t) || (t = {
  15459. isIgnore: t
  15460. }),
  15461. t || {}
  15462. }
  15463. function rm(t) {
  15464. var e = t.hostModel;
  15465. return {
  15466. itemStyle: e.getModel("itemStyle").getItemStyle(["color"]),
  15467. hoverItemStyle: e.getModel("emphasis.itemStyle").getItemStyle(),
  15468. symbolRotate: e.get("symbolRotate"),
  15469. symbolOffset: e.get("symbolOffset"),
  15470. hoverAnimation: e.get("hoverAnimation"),
  15471. labelModel: e.getModel("label"),
  15472. hoverLabelModel: e.getModel("emphasis.label"),
  15473. cursorStyle: e.get("cursor")
  15474. }
  15475. }
  15476. function sm(t, e, i) {
  15477. var n, o = t.getBaseAxis(), a = t.getOtherAxis(o), r = function(t, e) {
  15478. var i = 0
  15479. , n = t.scale.getExtent();
  15480. "start" === e ? i = n[0] : "end" === e ? i = n[1] : 0 < n[0] ? i = n[0] : n[1] < 0 && (i = n[1]);
  15481. return i
  15482. }(a, i), s = o.dim, l = a.dim, u = e.mapDimension(l), h = e.mapDimension(s), c = "x" === l || "radius" === l ? 1 : 0, d = O(t.dimensions, function(t) {
  15483. return e.mapDimension(t)
  15484. }), f = e.getCalculationInfo("stackResultDimension");
  15485. return (n |= fp(e, d[0])) && (d[0] = f),
  15486. (n |= fp(e, d[1])) && (d[1] = f),
  15487. {
  15488. dataDimsForPoint: d,
  15489. valueStart: r,
  15490. valueAxisDim: l,
  15491. baseAxisDim: s,
  15492. stacked: !!n,
  15493. valueDim: u,
  15494. baseDim: h,
  15495. baseDataOffset: c,
  15496. stackedOverDimension: e.getCalculationInfo("stackedOverDimension")
  15497. }
  15498. }
  15499. function lm(t, e, i, n) {
  15500. var o = NaN;
  15501. t.stacked && (o = i.get(i.getCalculationInfo("stackedOverDimension"), n)),
  15502. isNaN(o) && (o = t.valueStart);
  15503. var a = t.baseDataOffset
  15504. , r = [];
  15505. return r[a] = i.get(t.baseDim, n),
  15506. r[1 - a] = o,
  15507. e.dataToPoint(r)
  15508. }
  15509. nm.updateData = function(o, a) {
  15510. a = am(a);
  15511. var r = this.group
  15512. , s = o.hostModel
  15513. , l = this._data
  15514. , u = this._symbolCtor
  15515. , h = rm(o);
  15516. l || r.removeAll(),
  15517. o.diff(l).add(function(t) {
  15518. var e = o.getItemLayout(t);
  15519. if (om(o, e, t, a)) {
  15520. var i = new u(o,t,h);
  15521. i.attr("position", e),
  15522. o.setItemGraphicEl(t, i),
  15523. r.add(i)
  15524. }
  15525. }).update(function(t, e) {
  15526. var i = l.getItemGraphicEl(e)
  15527. , n = o.getItemLayout(t);
  15528. om(o, n, t, a) ? (i ? (i.updateData(o, t, h),
  15529. cl(i, {
  15530. position: n
  15531. }, s)) : (i = new u(o,t)).attr("position", n),
  15532. r.add(i),
  15533. o.setItemGraphicEl(t, i)) : r.remove(i)
  15534. }).remove(function(t) {
  15535. var e = l.getItemGraphicEl(t);
  15536. e && e.fadeOut(function() {
  15537. r.remove(e)
  15538. })
  15539. }).execute(),
  15540. this._data = o
  15541. }
  15542. ,
  15543. nm.isPersistent = function() {
  15544. return !0
  15545. }
  15546. ,
  15547. nm.updateLayout = function() {
  15548. var n = this._data;
  15549. n && n.eachItemGraphicEl(function(t, e) {
  15550. var i = n.getItemLayout(e);
  15551. t.attr("position", i)
  15552. })
  15553. }
  15554. ,
  15555. nm.incrementalPrepareUpdate = function(t) {
  15556. this._seriesScope = rm(t),
  15557. this._data = null,
  15558. this.group.removeAll()
  15559. }
  15560. ,
  15561. nm.incrementalUpdate = function(t, e, i) {
  15562. function n(t) {
  15563. t.isGroup || (t.incremental = t.useHoverLayer = !0)
  15564. }
  15565. i = am(i);
  15566. for (var o = t.start; o < t.end; o++) {
  15567. var a = e.getItemLayout(o);
  15568. if (om(e, a, o, i)) {
  15569. var r = new this._symbolCtor(e,o,this._seriesScope);
  15570. r.traverse(n),
  15571. r.attr("position", a),
  15572. this.group.add(r),
  15573. e.setItemGraphicEl(o, r)
  15574. }
  15575. }
  15576. }
  15577. ,
  15578. nm.remove = function(t) {
  15579. var e = this.group
  15580. , i = this._data;
  15581. i && t ? i.eachItemGraphicEl(function(t) {
  15582. t.fadeOut(function() {
  15583. e.remove(t)
  15584. })
  15585. }) : e.removeAll()
  15586. }
  15587. ;
  15588. var um = St
  15589. , hm = Mt
  15590. , cm = ut
  15591. , dm = at
  15592. , fm = []
  15593. , pm = []
  15594. , gm = [];
  15595. function mm(t) {
  15596. return isNaN(t[0]) || isNaN(t[1])
  15597. }
  15598. function vm(t, e, i, n, o, a, r, s, l, u) {
  15599. return "none" !== u && u ? function(t, e, i, n, o, a, r, s, l, u, h) {
  15600. for (var c = 0, d = i, f = 0; f < n; f++) {
  15601. var p = e[d];
  15602. if (o <= d || d < 0)
  15603. break;
  15604. if (mm(p)) {
  15605. if (h) {
  15606. d += a;
  15607. continue
  15608. }
  15609. break
  15610. }
  15611. if (d === i)
  15612. t[0 < a ? "moveTo" : "lineTo"](p[0], p[1]);
  15613. else if (0 < l) {
  15614. var g = e[c]
  15615. , m = "y" === u ? 1 : 0
  15616. , v = (p[m] - g[m]) * l;
  15617. dm(pm, g),
  15618. pm[m] = g[m] + v,
  15619. dm(gm, p),
  15620. gm[m] = p[m] - v,
  15621. t.bezierCurveTo(pm[0], pm[1], gm[0], gm[1], p[0], p[1])
  15622. } else
  15623. t.lineTo(p[0], p[1]);
  15624. c = d,
  15625. d += a
  15626. }
  15627. return f
  15628. }
  15629. .apply(this, arguments) : function(t, e, i, n, o, a, r, s, l, u, h) {
  15630. for (var c = 0, d = i, f = 0; f < n; f++) {
  15631. var p = e[d];
  15632. if (o <= d || d < 0)
  15633. break;
  15634. if (mm(p)) {
  15635. if (h) {
  15636. d += a;
  15637. continue
  15638. }
  15639. break
  15640. }
  15641. if (d === i)
  15642. t[0 < a ? "moveTo" : "lineTo"](p[0], p[1]),
  15643. dm(pm, p);
  15644. else if (0 < l) {
  15645. var g = d + a
  15646. , m = e[g];
  15647. if (h)
  15648. for (; m && mm(e[g]); )
  15649. m = e[g += a];
  15650. var v = .5
  15651. , y = e[c];
  15652. if (!(m = e[g]) || mm(m))
  15653. dm(gm, p);
  15654. else {
  15655. var x, _;
  15656. if (mm(m) && !h && (m = p),
  15657. ht(fm, m, y),
  15658. "x" === u || "y" === u) {
  15659. var w = "x" === u ? 0 : 1;
  15660. x = Math.abs(p[w] - y[w]),
  15661. _ = Math.abs(p[w] - m[w])
  15662. } else
  15663. x = yt(p, y),
  15664. _ = yt(p, m);
  15665. cm(gm, p, fm, -l * (1 - (v = _ / (_ + x))))
  15666. }
  15667. um(pm, pm, s),
  15668. hm(pm, pm, r),
  15669. um(gm, gm, s),
  15670. hm(gm, gm, r),
  15671. t.bezierCurveTo(pm[0], pm[1], gm[0], gm[1], p[0], p[1]),
  15672. cm(pm, p, fm, l * v)
  15673. } else
  15674. t.lineTo(p[0], p[1]);
  15675. c = d,
  15676. d += a
  15677. }
  15678. return f
  15679. }
  15680. .apply(this, arguments)
  15681. }
  15682. function ym(t, e) {
  15683. var i = [1 / 0, 1 / 0]
  15684. , n = [-1 / 0, -1 / 0];
  15685. if (e)
  15686. for (var o = 0; o < t.length; o++) {
  15687. var a = t[o];
  15688. a[0] < i[0] && (i[0] = a[0]),
  15689. a[1] < i[1] && (i[1] = a[1]),
  15690. a[0] > n[0] && (n[0] = a[0]),
  15691. a[1] > n[1] && (n[1] = a[1])
  15692. }
  15693. return {
  15694. min: e ? i : n,
  15695. max: e ? n : i
  15696. }
  15697. }
  15698. var xm = Ar.extend({
  15699. type: "ec-polyline",
  15700. shape: {
  15701. points: [],
  15702. smooth: 0,
  15703. smoothConstraint: !0,
  15704. smoothMonotone: null,
  15705. connectNulls: !1
  15706. },
  15707. style: {
  15708. fill: null,
  15709. stroke: "#000"
  15710. },
  15711. brush: Xr(Ar.prototype.brush),
  15712. buildPath: function(t, e) {
  15713. var i = e.points
  15714. , n = 0
  15715. , o = i.length
  15716. , a = ym(i, e.smoothConstraint);
  15717. if (e.connectNulls) {
  15718. for (; 0 < o && mm(i[o - 1]); o--)
  15719. ;
  15720. for (; n < o && mm(i[n]); n++)
  15721. ;
  15722. }
  15723. for (; n < o; )
  15724. n += vm(t, i, n, o, o, 1, a.min, a.max, e.smooth, e.smoothMonotone, e.connectNulls) + 1
  15725. }
  15726. })
  15727. , _m = Ar.extend({
  15728. type: "ec-polygon",
  15729. shape: {
  15730. points: [],
  15731. stackedOnPoints: [],
  15732. smooth: 0,
  15733. stackedOnSmooth: 0,
  15734. smoothConstraint: !0,
  15735. smoothMonotone: null,
  15736. connectNulls: !1
  15737. },
  15738. brush: Xr(Ar.prototype.brush),
  15739. buildPath: function(t, e) {
  15740. var i = e.points
  15741. , n = e.stackedOnPoints
  15742. , o = 0
  15743. , a = i.length
  15744. , r = e.smoothMonotone
  15745. , s = ym(i, e.smoothConstraint)
  15746. , l = ym(n, e.smoothConstraint);
  15747. if (e.connectNulls) {
  15748. for (; 0 < a && mm(i[a - 1]); a--)
  15749. ;
  15750. for (; o < a && mm(i[o]); o++)
  15751. ;
  15752. }
  15753. for (; o < a; ) {
  15754. var u = vm(t, i, o, a, a, 1, s.min, s.max, e.smooth, r, e.connectNulls);
  15755. vm(t, n, o + u - 1, u, a, -1, l.min, l.max, e.stackedOnSmooth, r, e.connectNulls),
  15756. o += u + 1,
  15757. t.closePath()
  15758. }
  15759. }
  15760. });
  15761. function wm(t, e, i) {
  15762. var n = t.getArea()
  15763. , o = t.getBaseAxis().isHorizontal()
  15764. , a = n.x
  15765. , r = n.y
  15766. , s = n.width
  15767. , l = n.height
  15768. , u = i.get("lineStyle.width") || 2;
  15769. a -= u / 2,
  15770. r -= u / 2,
  15771. s += u,
  15772. l += u,
  15773. a = Math.floor(a),
  15774. s = Math.round(s);
  15775. var h = new rs({
  15776. shape: {
  15777. x: a,
  15778. y: r,
  15779. width: s,
  15780. height: l
  15781. }
  15782. });
  15783. return e && (h.shape[o ? "width" : "height"] = 0,
  15784. dl(h, {
  15785. shape: {
  15786. width: s,
  15787. height: l
  15788. }
  15789. }, i)),
  15790. h
  15791. }
  15792. function bm(t, e, i) {
  15793. var n = t.getArea()
  15794. , o = new qr({
  15795. shape: {
  15796. cx: zl(t.cx, 1),
  15797. cy: zl(t.cy, 1),
  15798. r0: zl(n.r0, 1),
  15799. r: zl(n.r, 1),
  15800. startAngle: n.startAngle,
  15801. endAngle: n.endAngle,
  15802. clockwise: n.clockwise
  15803. }
  15804. });
  15805. return e && (o.shape.endAngle = n.startAngle,
  15806. dl(o, {
  15807. shape: {
  15808. endAngle: n.endAngle
  15809. }
  15810. }, i)),
  15811. o
  15812. }
  15813. function Sm(t, e, i) {
  15814. return t ? "polar" === t.type ? bm(t, e, i) : "cartesian2d" === t.type ? wm(t, e, i) : null : null
  15815. }
  15816. function Mm(t, e) {
  15817. if (t.length === e.length) {
  15818. for (var i = 0; i < t.length; i++) {
  15819. var n = t[i]
  15820. , o = e[i];
  15821. if (n[0] !== o[0] || n[1] !== o[1])
  15822. return
  15823. }
  15824. return !0
  15825. }
  15826. }
  15827. function Im(t, e) {
  15828. var i = []
  15829. , n = []
  15830. , o = []
  15831. , a = [];
  15832. return Wa(t, i, n),
  15833. Wa(e, o, a),
  15834. Math.max(Math.abs(i[0] - o[0]), Math.abs(i[1] - o[1]), Math.abs(n[0] - a[0]), Math.abs(n[1] - a[1]))
  15835. }
  15836. function Tm(t) {
  15837. return "number" == typeof t ? t : t ? .5 : 0
  15838. }
  15839. function Am(t, e, i) {
  15840. for (var n = e.getBaseAxis(), o = "x" === n.dim || "radius" === n.dim ? 0 : 1, a = [], r = 0; r < t.length - 1; r++) {
  15841. var s = t[r + 1]
  15842. , l = t[r];
  15843. a.push(l);
  15844. var u = [];
  15845. switch (i) {
  15846. case "end":
  15847. u[o] = s[o],
  15848. u[1 - o] = l[1 - o],
  15849. a.push(u);
  15850. break;
  15851. case "middle":
  15852. var h = (l[o] + s[o]) / 2
  15853. , c = [];
  15854. u[o] = c[o] = h,
  15855. u[1 - o] = l[1 - o],
  15856. c[1 - o] = s[1 - o],
  15857. a.push(u),
  15858. a.push(c);
  15859. break;
  15860. default:
  15861. u[o] = l[o],
  15862. u[1 - o] = s[1 - o],
  15863. a.push(u)
  15864. }
  15865. }
  15866. return t[r] && a.push(t[r]),
  15867. a
  15868. }
  15869. function Dm(t, e, i) {
  15870. var n = t.get("showAllSymbol")
  15871. , o = "auto" === n;
  15872. if (!n || o) {
  15873. var a = i.getAxesByScale("ordinal")[0];
  15874. if (a && (!o || !function(t, e) {
  15875. var i = t.getExtent()
  15876. , n = Math.abs(i[1] - i[0]) / t.scale.count();
  15877. isNaN(n) && (n = 0);
  15878. for (var o = e.count(), a = Math.max(1, Math.round(o / 5)), r = 0; r < o; r += a)
  15879. if (1.5 * Xg.getSymbolSize(e, r)[t.isHorizontal() ? 1 : 0] > n)
  15880. return !1;
  15881. return !0
  15882. }(a, e))) {
  15883. var r = e.mapDimension(a.dim)
  15884. , s = {};
  15885. return E(a.getViewLabels(), function(t) {
  15886. s[t.tickValue] = 1
  15887. }),
  15888. function(t) {
  15889. return !s.hasOwnProperty(e.get(r, t))
  15890. }
  15891. }
  15892. }
  15893. }
  15894. function Cm(t, e, i) {
  15895. if ("cartesian2d" !== t.type)
  15896. return bm(t, e, i);
  15897. var n = t.getBaseAxis().isHorizontal()
  15898. , o = wm(t, e, i);
  15899. if (!i.get("clip", !0)) {
  15900. var a = o.shape
  15901. , r = Math.max(a.width, a.height);
  15902. n ? (a.y -= r,
  15903. a.height += 2 * r) : (a.x -= r,
  15904. a.width += 2 * r)
  15905. }
  15906. return o
  15907. }
  15908. _c.extend({
  15909. type: "line",
  15910. init: function() {
  15911. var t = new Ci
  15912. , e = new im;
  15913. this.group.add(e.group),
  15914. this._symbolDraw = e,
  15915. this._lineGroup = t
  15916. },
  15917. render: function(t, e, i) {
  15918. var n = t.coordinateSystem
  15919. , o = this.group
  15920. , a = t.getData()
  15921. , r = t.getModel("lineStyle")
  15922. , s = t.getModel("areaStyle")
  15923. , l = a.mapArray(a.getItemLayout)
  15924. , u = "polar" === n.type
  15925. , h = this._coordSys
  15926. , c = this._symbolDraw
  15927. , d = this._polyline
  15928. , f = this._polygon
  15929. , p = this._lineGroup
  15930. , g = t.get("animation")
  15931. , m = !s.isEmpty()
  15932. , v = s.get("origin")
  15933. , y = function(t, e, i) {
  15934. if (!i.valueDim)
  15935. return [];
  15936. for (var n = [], o = 0, a = e.count(); o < a; o++)
  15937. n.push(lm(i, t, e, o));
  15938. return n
  15939. }(n, a, sm(n, a, v))
  15940. , x = t.get("showSymbol")
  15941. , _ = x && !u && Dm(t, a, n)
  15942. , w = this._data;
  15943. w && w.eachItemGraphicEl(function(t, e) {
  15944. t.__temp && (o.remove(t),
  15945. w.setItemGraphicEl(e, null))
  15946. }),
  15947. x || c.remove(),
  15948. o.add(p);
  15949. var b, S = !u && t.get("step");
  15950. n && n.getArea && t.get("clip", !0) && (null != (b = n.getArea()).width ? (b.x -= .1,
  15951. b.y -= .1,
  15952. b.width += .2,
  15953. b.height += .2) : b.r0 && (b.r0 -= .5,
  15954. b.r1 += .5)),
  15955. this._clipShapeForSymbol = b,
  15956. d && h.type === n.type && S === this._step ? (m && !f ? f = this._newPolygon(l, y, n, g) : f && !m && (p.remove(f),
  15957. f = this._polygon = null),
  15958. p.setClipPath(Cm(n, !1, t)),
  15959. x && c.updateData(a, {
  15960. isIgnore: _,
  15961. clipShape: b
  15962. }),
  15963. a.eachItemGraphicEl(function(t) {
  15964. t.stopAnimation(!0)
  15965. }),
  15966. Mm(this._stackedOnPoints, y) && Mm(this._points, l) || (g ? this._updateAnimation(a, y, n, i, S, v) : (S && (l = Am(l, n, S),
  15967. y = Am(y, n, S)),
  15968. d.setShape({
  15969. points: l
  15970. }),
  15971. f && f.setShape({
  15972. points: l,
  15973. stackedOnPoints: y
  15974. })))) : (x && c.updateData(a, {
  15975. isIgnore: _,
  15976. clipShape: b
  15977. }),
  15978. S && (l = Am(l, n, S),
  15979. y = Am(y, n, S)),
  15980. d = this._newPolyline(l, n, g),
  15981. m && (f = this._newPolygon(l, y, n, g)),
  15982. p.setClipPath(Cm(n, !0, t)));
  15983. var M = function(t, e) {
  15984. var i = t.getVisual("visualMeta");
  15985. if (i && i.length && t.count() && "cartesian2d" === e.type) {
  15986. for (var n, o, a = i.length - 1; 0 <= a; a--) {
  15987. var r = i[a].dimension
  15988. , s = t.dimensions[r]
  15989. , l = t.getDimensionInfo(s);
  15990. if ("x" === (n = l && l.coordDim) || "y" === n) {
  15991. o = i[a];
  15992. break
  15993. }
  15994. }
  15995. if (o) {
  15996. var u = e.getAxis(n)
  15997. , h = O(o.stops, function(t) {
  15998. return {
  15999. coord: u.toGlobalCoord(u.dataToCoord(t.value)),
  16000. color: t.color
  16001. }
  16002. })
  16003. , c = h.length
  16004. , d = o.outerColors.slice();
  16005. c && h[0].coord > h[c - 1].coord && (h.reverse(),
  16006. d.reverse());
  16007. var f = h[0].coord - 10
  16008. , p = h[c - 1].coord + 10
  16009. , g = p - f;
  16010. if (g < .001)
  16011. return "transparent";
  16012. E(h, function(t) {
  16013. t.offset = (t.coord - f) / g
  16014. }),
  16015. h.push({
  16016. offset: c ? h[c - 1].offset : .5,
  16017. color: d[1] || "transparent"
  16018. }),
  16019. h.unshift({
  16020. offset: c ? h[0].offset : .5,
  16021. color: d[0] || "transparent"
  16022. });
  16023. var m = new gs(0,0,0,0,h,!0);
  16024. return m[n] = f,
  16025. m[n + "2"] = p,
  16026. m
  16027. }
  16028. }
  16029. }(a, n) || a.getVisual("color");
  16030. d.useStyle(D(r.getLineStyle(), {
  16031. fill: "none",
  16032. stroke: M,
  16033. lineJoin: "bevel"
  16034. }));
  16035. var I = t.get("smooth");
  16036. if (I = Tm(t.get("smooth")),
  16037. d.setShape({
  16038. smooth: I,
  16039. smoothMonotone: t.get("smoothMonotone"),
  16040. connectNulls: t.get("connectNulls")
  16041. }),
  16042. f) {
  16043. var T = a.getCalculationInfo("stackedOnSeries")
  16044. , A = 0;
  16045. f.useStyle(D(s.getAreaStyle(), {
  16046. fill: M,
  16047. opacity: .7,
  16048. lineJoin: "bevel"
  16049. })),
  16050. T && (A = Tm(T.get("smooth"))),
  16051. f.setShape({
  16052. smooth: I,
  16053. stackedOnSmooth: A,
  16054. smoothMonotone: t.get("smoothMonotone"),
  16055. connectNulls: t.get("connectNulls")
  16056. })
  16057. }
  16058. this._data = a,
  16059. this._coordSys = n,
  16060. this._stackedOnPoints = y,
  16061. this._points = l,
  16062. this._step = S,
  16063. this._valueOrigin = v
  16064. },
  16065. dispose: function() {},
  16066. highlight: function(t, e, i, n) {
  16067. var o = t.getData()
  16068. , a = Yo(o, n);
  16069. if (!(a instanceof Array) && null != a && 0 <= a) {
  16070. var r = o.getItemGraphicEl(a);
  16071. if (!r) {
  16072. var s = o.getItemLayout(a);
  16073. if (!s)
  16074. return;
  16075. if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(s[0], s[1]))
  16076. return;
  16077. (r = new Xg(o,a)).position = s,
  16078. r.setZ(t.get("zlevel"), t.get("z")),
  16079. r.ignore = isNaN(s[0]) || isNaN(s[1]),
  16080. r.__temp = !0,
  16081. o.setItemGraphicEl(a, r),
  16082. r.stopSymbolAnimation(!0),
  16083. this.group.add(r)
  16084. }
  16085. r.highlight()
  16086. } else
  16087. _c.prototype.highlight.call(this, t, e, i, n)
  16088. },
  16089. downplay: function(t, e, i, n) {
  16090. var o = t.getData()
  16091. , a = Yo(o, n);
  16092. if (null != a && 0 <= a) {
  16093. var r = o.getItemGraphicEl(a);
  16094. r && (r.__temp ? (o.setItemGraphicEl(a, null),
  16095. this.group.remove(r)) : r.downplay())
  16096. } else
  16097. _c.prototype.downplay.call(this, t, e, i, n)
  16098. },
  16099. _newPolyline: function(t) {
  16100. var e = this._polyline;
  16101. return e && this._lineGroup.remove(e),
  16102. e = new xm({
  16103. shape: {
  16104. points: t
  16105. },
  16106. silent: !0,
  16107. z2: 10
  16108. }),
  16109. this._lineGroup.add(e),
  16110. this._polyline = e
  16111. },
  16112. _newPolygon: function(t, e) {
  16113. var i = this._polygon;
  16114. return i && this._lineGroup.remove(i),
  16115. i = new _m({
  16116. shape: {
  16117. points: t,
  16118. stackedOnPoints: e
  16119. },
  16120. silent: !0
  16121. }),
  16122. this._lineGroup.add(i),
  16123. this._polygon = i
  16124. },
  16125. _updateAnimation: function(t, e, i, n, o, a) {
  16126. var r = this._polyline
  16127. , s = this._polygon
  16128. , l = t.hostModel
  16129. , u = function(t, e, i, n, o, a, r, s) {
  16130. for (var l = function(t, e) {
  16131. var i = [];
  16132. return e.diff(t).add(function(t) {
  16133. i.push({
  16134. cmd: "+",
  16135. idx: t
  16136. })
  16137. }).update(function(t, e) {
  16138. i.push({
  16139. cmd: "=",
  16140. idx: e,
  16141. idx1: t
  16142. })
  16143. }).remove(function(t) {
  16144. i.push({
  16145. cmd: "-",
  16146. idx: t
  16147. })
  16148. }).execute(),
  16149. i
  16150. }(t, e), u = [], h = [], c = [], d = [], f = [], p = [], g = [], m = sm(o, e, r), v = sm(a, t, s), y = 0; y < l.length; y++) {
  16151. var x = l[y]
  16152. , _ = !0;
  16153. switch (x.cmd) {
  16154. case "=":
  16155. var w = t.getItemLayout(x.idx)
  16156. , b = e.getItemLayout(x.idx1);
  16157. (isNaN(w[0]) || isNaN(w[1])) && (w = b.slice()),
  16158. u.push(w),
  16159. h.push(b),
  16160. c.push(i[x.idx]),
  16161. d.push(n[x.idx1]),
  16162. g.push(e.getRawIndex(x.idx1));
  16163. break;
  16164. case "+":
  16165. var S = x.idx;
  16166. u.push(o.dataToPoint([e.get(m.dataDimsForPoint[0], S), e.get(m.dataDimsForPoint[1], S)])),
  16167. h.push(e.getItemLayout(S).slice()),
  16168. c.push(lm(m, o, e, S)),
  16169. d.push(n[S]),
  16170. g.push(e.getRawIndex(S));
  16171. break;
  16172. case "-":
  16173. S = x.idx;
  16174. var M = t.getRawIndex(S);
  16175. M !== S ? (u.push(t.getItemLayout(S)),
  16176. h.push(a.dataToPoint([t.get(v.dataDimsForPoint[0], S), t.get(v.dataDimsForPoint[1], S)])),
  16177. c.push(i[S]),
  16178. d.push(lm(v, a, t, S)),
  16179. g.push(M)) : _ = !1
  16180. }
  16181. _ && (f.push(x),
  16182. p.push(p.length))
  16183. }
  16184. p.sort(function(t, e) {
  16185. return g[t] - g[e]
  16186. });
  16187. var I = []
  16188. , T = []
  16189. , A = []
  16190. , D = []
  16191. , C = [];
  16192. for (y = 0; y < p.length; y++) {
  16193. S = p[y];
  16194. I[y] = u[S],
  16195. T[y] = h[S],
  16196. A[y] = c[S],
  16197. D[y] = d[S],
  16198. C[y] = f[S]
  16199. }
  16200. return {
  16201. current: I,
  16202. next: T,
  16203. stackedOnCurrent: A,
  16204. stackedOnNext: D,
  16205. status: C
  16206. }
  16207. }(this._data, t, this._stackedOnPoints, e, this._coordSys, i, this._valueOrigin, a)
  16208. , h = u.current
  16209. , c = u.stackedOnCurrent
  16210. , d = u.next
  16211. , f = u.stackedOnNext;
  16212. if (o && (h = Am(u.current, i, o),
  16213. c = Am(u.stackedOnCurrent, i, o),
  16214. d = Am(u.next, i, o),
  16215. f = Am(u.stackedOnNext, i, o)),
  16216. 3e3 < Im(h, d) || s && 3e3 < Im(c, f))
  16217. return r.setShape({
  16218. points: d
  16219. }),
  16220. void (s && s.setShape({
  16221. points: d,
  16222. stackedOnPoints: f
  16223. }));
  16224. r.shape.__points = u.current,
  16225. r.shape.points = h,
  16226. cl(r, {
  16227. shape: {
  16228. points: d
  16229. }
  16230. }, l),
  16231. s && (s.setShape({
  16232. points: h,
  16233. stackedOnPoints: c
  16234. }),
  16235. cl(s, {
  16236. shape: {
  16237. points: d,
  16238. stackedOnPoints: f
  16239. }
  16240. }, l));
  16241. for (var p = [], g = u.status, m = 0; m < g.length; m++) {
  16242. if ("=" === g[m].cmd) {
  16243. var v = t.getItemGraphicEl(g[m].idx1);
  16244. v && p.push({
  16245. el: v,
  16246. ptIdx: m
  16247. })
  16248. }
  16249. }
  16250. r.animators && r.animators.length && r.animators[0].during(function() {
  16251. for (var t = 0; t < p.length; t++) {
  16252. p[t].el.attr("position", r.shape.__points[p[t].ptIdx])
  16253. }
  16254. })
  16255. },
  16256. remove: function(t) {
  16257. var i = this.group
  16258. , n = this._data;
  16259. this._lineGroup.removeAll(),
  16260. this._symbolDraw.remove(!0),
  16261. n && n.eachItemGraphicEl(function(t, e) {
  16262. t.__temp && (i.remove(t),
  16263. n.setItemGraphicEl(e, null))
  16264. }),
  16265. this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._data = null
  16266. }
  16267. });
  16268. function Lm(t, r, s) {
  16269. return {
  16270. seriesType: t,
  16271. performRawSeries: !0,
  16272. reset: function(u, t, e) {
  16273. var i = u.getData()
  16274. , h = u.get("symbol")
  16275. , c = u.get("symbolSize")
  16276. , n = u.get("symbolKeepAspect")
  16277. , d = u.get("symbolRotate")
  16278. , f = C(h)
  16279. , p = C(c)
  16280. , g = C(d)
  16281. , m = f || p || g
  16282. , o = !f && h ? h : r
  16283. , a = p ? null : c;
  16284. if (i.setVisual({
  16285. legendSymbol: s || o,
  16286. symbol: o,
  16287. symbolSize: a,
  16288. symbolKeepAspect: n,
  16289. symbolRotate: d
  16290. }),
  16291. !t.isSeriesFiltered(u))
  16292. return {
  16293. dataEach: i.hasItemOption || m ? function(t, e) {
  16294. if (m) {
  16295. var i = u.getRawValue(e)
  16296. , n = u.getDataParams(e);
  16297. f && t.setItemVisual(e, "symbol", h(i, n)),
  16298. p && t.setItemVisual(e, "symbolSize", c(i, n)),
  16299. g && t.setItemVisual(e, "symbolRotate", d(i, n))
  16300. }
  16301. if (t.hasItemOption) {
  16302. var o = t.getItemModel(e)
  16303. , a = o.getShallow("symbol", !0)
  16304. , r = o.getShallow("symbolSize", !0)
  16305. , s = o.getShallow("symbolRotate", !0)
  16306. , l = o.getShallow("symbolKeepAspect", !0);
  16307. null != a && t.setItemVisual(e, "symbol", a),
  16308. null != r && t.setItemVisual(e, "symbolSize", r),
  16309. null != s && t.setItemVisual(e, "symbolRotate", s),
  16310. null != l && t.setItemVisual(e, "symbolKeepAspect", l)
  16311. }
  16312. }
  16313. : null
  16314. }
  16315. }
  16316. }
  16317. }
  16318. function km(t) {
  16319. return {
  16320. seriesType: t,
  16321. plan: vc(),
  16322. reset: function(t) {
  16323. var e = t.getData()
  16324. , c = t.coordinateSystem
  16325. , d = t.pipelineContext.large;
  16326. if (c) {
  16327. var f = O(c.dimensions, function(t) {
  16328. return e.mapDimension(t)
  16329. }).slice(0, 2)
  16330. , p = f.length
  16331. , i = e.getCalculationInfo("stackResultDimension");
  16332. return fp(e, f[0]) && (f[0] = i),
  16333. fp(e, f[1]) && (f[1] = i),
  16334. p && {
  16335. progress: function(t, e) {
  16336. for (var i = t.end - t.start, n = d && new Float32Array(i * p), o = t.start, a = 0, r = [], s = []; o < t.end; o++) {
  16337. var l;
  16338. if (1 === p) {
  16339. var u = e.get(f[0], o);
  16340. l = !isNaN(u) && c.dataToPoint(u, null, s)
  16341. } else {
  16342. u = r[0] = e.get(f[0], o);
  16343. var h = r[1] = e.get(f[1], o);
  16344. l = !isNaN(u) && !isNaN(h) && c.dataToPoint(r, null, s)
  16345. }
  16346. d ? (n[a++] = l ? l[0] : NaN,
  16347. n[a++] = l ? l[1] : NaN) : e.setItemLayout(o, l && l.slice() || [NaN, NaN])
  16348. }
  16349. d && e.setLayout("symbolPoints", n)
  16350. }
  16351. }
  16352. }
  16353. }
  16354. }
  16355. }
  16356. function Pm(t, e) {
  16357. return Math.round(t.length / 2)
  16358. }
  16359. var Nm = {
  16360. average: function(t) {
  16361. for (var e = 0, i = 0, n = 0; n < t.length; n++)
  16362. isNaN(t[n]) || (e += t[n],
  16363. i++);
  16364. return 0 === i ? NaN : e / i
  16365. },
  16366. sum: function(t) {
  16367. for (var e = 0, i = 0; i < t.length; i++)
  16368. e += t[i] || 0;
  16369. return e
  16370. },
  16371. max: function(t) {
  16372. for (var e = -1 / 0, i = 0; i < t.length; i++)
  16373. t[i] > e && (e = t[i]);
  16374. return isFinite(e) ? e : NaN
  16375. },
  16376. min: function(t) {
  16377. for (var e = 1 / 0, i = 0; i < t.length; i++)
  16378. t[i] < e && (e = t[i]);
  16379. return isFinite(e) ? e : NaN
  16380. },
  16381. nearest: function(t) {
  16382. return t[0]
  16383. }
  16384. };
  16385. function Om(t) {
  16386. return this._axes[t]
  16387. }
  16388. function Em(t) {
  16389. this._axes = {},
  16390. this._dimList = [],
  16391. this.name = t || ""
  16392. }
  16393. function Rm(t) {
  16394. Em.call(this, t)
  16395. }
  16396. Em.prototype = {
  16397. constructor: Em,
  16398. type: "cartesian",
  16399. getAxis: function(t) {
  16400. return this._axes[t]
  16401. },
  16402. getAxes: function() {
  16403. return O(this._dimList, Om, this)
  16404. },
  16405. getAxesByScale: function(e) {
  16406. return e = e.toLowerCase(),
  16407. M(this.getAxes(), function(t) {
  16408. return t.scale.type === e
  16409. })
  16410. },
  16411. addAxis: function(t) {
  16412. var e = t.dim;
  16413. this._axes[e] = t,
  16414. this._dimList.push(e)
  16415. },
  16416. dataToCoord: function(t) {
  16417. return this._dataCoordConvert(t, "dataToCoord")
  16418. },
  16419. coordToData: function(t) {
  16420. return this._dataCoordConvert(t, "coordToData")
  16421. },
  16422. _dataCoordConvert: function(t, e) {
  16423. for (var i = this._dimList, n = t instanceof Array ? [] : {}, o = 0; o < i.length; o++) {
  16424. var a = i[o]
  16425. , r = this._axes[a];
  16426. n[a] = r[e](t[a])
  16427. }
  16428. return n
  16429. }
  16430. },
  16431. Rm.prototype = {
  16432. constructor: Rm,
  16433. type: "cartesian2d",
  16434. dimensions: ["x", "y"],
  16435. getBaseAxis: function() {
  16436. return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAxis("x")
  16437. },
  16438. containPoint: function(t) {
  16439. var e = this.getAxis("x")
  16440. , i = this.getAxis("y");
  16441. return e.contain(e.toLocalCoord(t[0])) && i.contain(i.toLocalCoord(t[1]))
  16442. },
  16443. containData: function(t) {
  16444. return this.getAxis("x").containData(t[0]) && this.getAxis("y").containData(t[1])
  16445. },
  16446. dataToPoint: function(t, e, i) {
  16447. var n = this.getAxis("x")
  16448. , o = this.getAxis("y");
  16449. return (i = i || [])[0] = n.toGlobalCoord(n.dataToCoord(t[0])),
  16450. i[1] = o.toGlobalCoord(o.dataToCoord(t[1])),
  16451. i
  16452. },
  16453. clampData: function(t, e) {
  16454. var i = this.getAxis("x").scale
  16455. , n = this.getAxis("y").scale
  16456. , o = i.getExtent()
  16457. , a = n.getExtent()
  16458. , r = i.parse(t[0])
  16459. , s = n.parse(t[1]);
  16460. return (e = e || [])[0] = Math.min(Math.max(Math.min(o[0], o[1]), r), Math.max(o[0], o[1])),
  16461. e[1] = Math.min(Math.max(Math.min(a[0], a[1]), s), Math.max(a[0], a[1])),
  16462. e
  16463. },
  16464. pointToData: function(t, e) {
  16465. var i = this.getAxis("x")
  16466. , n = this.getAxis("y");
  16467. return (e = e || [])[0] = i.coordToData(i.toLocalCoord(t[0])),
  16468. e[1] = n.coordToData(n.toLocalCoord(t[1])),
  16469. e
  16470. },
  16471. getOtherAxis: function(t) {
  16472. return this.getAxis("x" === t.dim ? "y" : "x")
  16473. },
  16474. getArea: function() {
  16475. var t = this.getAxis("x").getGlobalExtent()
  16476. , e = this.getAxis("y").getGlobalExtent()
  16477. , i = Math.min(t[0], t[1])
  16478. , n = Math.min(e[0], e[1]);
  16479. return new Di(i,n,Math.max(t[0], t[1]) - i,Math.max(e[0], e[1]) - n)
  16480. }
  16481. },
  16482. w(Rm, Em);
  16483. function zm(t, e, i, n, o) {
  16484. Gg.call(this, t, e, i),
  16485. this.type = n || "value",
  16486. this.position = o || "bottom"
  16487. }
  16488. zm.prototype = {
  16489. constructor: zm,
  16490. index: 0,
  16491. getAxesOnZeroOf: null,
  16492. model: null,
  16493. isHorizontal: function() {
  16494. var t = this.position;
  16495. return "top" === t || "bottom" === t
  16496. },
  16497. getGlobalExtent: function(t) {
  16498. var e = this.getExtent();
  16499. return e[0] = this.toGlobalCoord(e[0]),
  16500. e[1] = this.toGlobalCoord(e[1]),
  16501. t && e[0] > e[1] && e.reverse(),
  16502. e
  16503. },
  16504. getOtherAxis: function() {
  16505. this.grid.getOtherAxis()
  16506. },
  16507. pointToData: function(t, e) {
  16508. return this.coordToData(this.toLocalCoord(t["x" === this.dim ? 0 : 1]), e)
  16509. },
  16510. toLocalCoord: null,
  16511. toGlobalCoord: null
  16512. },
  16513. w(zm, Gg);
  16514. var Bm = {
  16515. show: !0,
  16516. zlevel: 0,
  16517. z: 0,
  16518. inverse: !1,
  16519. name: "",
  16520. nameLocation: "end",
  16521. nameRotate: null,
  16522. nameTruncate: {
  16523. maxWidth: null,
  16524. ellipsis: "...",
  16525. placeholder: "."
  16526. },
  16527. nameTextStyle: {},
  16528. nameGap: 15,
  16529. silent: !1,
  16530. triggerEvent: !1,
  16531. tooltip: {
  16532. show: !1
  16533. },
  16534. axisPointer: {},
  16535. axisLine: {
  16536. show: !0,
  16537. onZero: !0,
  16538. onZeroAxisIndex: null,
  16539. lineStyle: {
  16540. color: "#333",
  16541. width: 1,
  16542. type: "solid"
  16543. },
  16544. symbol: ["none", "none"],
  16545. symbolSize: [10, 15]
  16546. },
  16547. axisTick: {
  16548. show: !0,
  16549. inside: !1,
  16550. length: 5,
  16551. lineStyle: {
  16552. width: 1
  16553. }
  16554. },
  16555. axisLabel: {
  16556. show: !0,
  16557. inside: !1,
  16558. rotate: 0,
  16559. showMinLabel: null,
  16560. showMaxLabel: null,
  16561. margin: 8,
  16562. fontSize: 12
  16563. },
  16564. splitLine: {
  16565. show: !0,
  16566. lineStyle: {
  16567. color: ["#ccc"],
  16568. width: 1,
  16569. type: "solid"
  16570. }
  16571. },
  16572. splitArea: {
  16573. show: !1,
  16574. areaStyle: {
  16575. color: ["rgba(250,250,250,0.3)", "rgba(200,200,200,0.3)"]
  16576. }
  16577. }
  16578. }
  16579. , Vm = {};
  16580. Vm.categoryAxis = m({
  16581. boundaryGap: !0,
  16582. deduplication: null,
  16583. splitLine: {
  16584. show: !1
  16585. },
  16586. axisTick: {
  16587. alignWithLabel: !1,
  16588. interval: "auto"
  16589. },
  16590. axisLabel: {
  16591. interval: "auto"
  16592. }
  16593. }, Bm),
  16594. Vm.valueAxis = m({
  16595. boundaryGap: [0, 0],
  16596. splitNumber: 5,
  16597. minorTick: {
  16598. show: !1,
  16599. splitNumber: 5,
  16600. length: 3,
  16601. lineStyle: {}
  16602. },
  16603. minorSplitLine: {
  16604. show: !1,
  16605. lineStyle: {
  16606. color: "#eee",
  16607. width: 1
  16608. }
  16609. }
  16610. }, Bm),
  16611. Vm.timeAxis = D({
  16612. scale: !0,
  16613. min: "dataMin",
  16614. max: "dataMax"
  16615. }, Vm.valueAxis),
  16616. Vm.logAxis = D({
  16617. scale: !0,
  16618. logBase: 10
  16619. }, Vm.valueAxis);
  16620. function Gm(a, t, r, e) {
  16621. E(Fm, function(o) {
  16622. t.extend({
  16623. type: a + "Axis." + o,
  16624. mergeDefaultAndTheme: function(t, e) {
  16625. var i = this.layoutMode
  16626. , n = i ? Iu(t) : {};
  16627. m(t, e.getTheme().get(o + "Axis")),
  16628. m(t, this.getDefaultOption()),
  16629. t.type = r(a, t),
  16630. i && Mu(t, n, i)
  16631. },
  16632. optionUpdated: function() {
  16633. "category" === this.option.type && (this.__ordinalMeta = vp.createByAxisModel(this))
  16634. },
  16635. getCategories: function(t) {
  16636. var e = this.option;
  16637. if ("category" === e.type)
  16638. return t ? e.data : this.__ordinalMeta.categories
  16639. },
  16640. getOrdinalMeta: function() {
  16641. return this.__ordinalMeta
  16642. },
  16643. defaultOption: p([{}, Vm[o + "Axis"], e], !0)
  16644. })
  16645. }),
  16646. ku.registerSubTypeDefaulter(a + "Axis", T(r, a))
  16647. }
  16648. var Fm = ["value", "category", "time", "log"]
  16649. , Wm = ku.extend({
  16650. type: "cartesian2dAxis",
  16651. axis: null,
  16652. init: function() {
  16653. Wm.superApply(this, "init", arguments),
  16654. this.resetRange()
  16655. },
  16656. mergeOption: function() {
  16657. Wm.superApply(this, "mergeOption", arguments),
  16658. this.resetRange()
  16659. },
  16660. restoreData: function() {
  16661. Wm.superApply(this, "restoreData", arguments),
  16662. this.resetRange()
  16663. },
  16664. getCoordSysModel: function() {
  16665. return this.ecModel.queryComponents({
  16666. mainType: "grid",
  16667. index: this.option.gridIndex,
  16668. id: this.option.gridId
  16669. })[0]
  16670. }
  16671. });
  16672. function Hm(t, e) {
  16673. return e.type || (e.data ? "category" : "value")
  16674. }
  16675. m(Wm.prototype, dg);
  16676. var Zm = {
  16677. offset: 0
  16678. };
  16679. function Um(t, e) {
  16680. return t.getCoordSysModel() === e
  16681. }
  16682. function Xm(t, e, i) {
  16683. this._coordsMap = {},
  16684. this._coordsList = [],
  16685. this._axesMap = {},
  16686. this._axesList = [],
  16687. this._initCartesian(t, e, i),
  16688. this.model = t
  16689. }
  16690. Gm("x", Wm, Hm, Zm),
  16691. Gm("y", Wm, Hm, Zm),
  16692. ku.extend({
  16693. type: "grid",
  16694. dependencies: ["xAxis", "yAxis"],
  16695. layoutMode: "box",
  16696. coordinateSystem: null,
  16697. defaultOption: {
  16698. show: !1,
  16699. zlevel: 0,
  16700. z: 0,
  16701. left: "10%",
  16702. top: 60,
  16703. right: "10%",
  16704. bottom: 60,
  16705. containLabel: !1,
  16706. backgroundColor: "rgba(0,0,0,0)",
  16707. borderWidth: 1,
  16708. borderColor: "#ccc"
  16709. }
  16710. });
  16711. var Ym = Xm.prototype;
  16712. function jm(t, e, i, n) {
  16713. i.getAxesOnZeroOf = function() {
  16714. return o ? [o] : []
  16715. }
  16716. ;
  16717. var o, a = t[e], r = i.model, s = r.get("axisLine.onZero"), l = r.get("axisLine.onZeroAxisIndex");
  16718. if (s) {
  16719. if (null != l)
  16720. qm(a[l]) && (o = a[l]);
  16721. else
  16722. for (var u in a)
  16723. if (a.hasOwnProperty(u) && qm(a[u]) && !n[h(a[u])]) {
  16724. o = a[u];
  16725. break
  16726. }
  16727. o && (n[h(o)] = !0)
  16728. }
  16729. function h(t) {
  16730. return t.dim + "_" + t.index
  16731. }
  16732. }
  16733. function qm(t) {
  16734. return t && "category" !== t.type && "time" !== t.type && function(t) {
  16735. var e = t.scale.getExtent()
  16736. , i = e[0]
  16737. , n = e[1];
  16738. return !(0 < i && 0 < n || i < 0 && n < 0)
  16739. }(t)
  16740. }
  16741. Ym.type = "grid",
  16742. Ym.axisPointerEnabled = !0,
  16743. Ym.getRect = function() {
  16744. return this._rect
  16745. }
  16746. ,
  16747. Ym.update = function(t, e) {
  16748. var i = this._axesMap;
  16749. this._updateScale(t, this.model),
  16750. E(i.x, function(t) {
  16751. rg(t.scale, t.model)
  16752. }),
  16753. E(i.y, function(t) {
  16754. rg(t.scale, t.model)
  16755. });
  16756. var n = {};
  16757. E(i.x, function(t) {
  16758. jm(i, "y", t, n)
  16759. }),
  16760. E(i.y, function(t) {
  16761. jm(i, "x", t, n)
  16762. }),
  16763. this.resize(this.model, e)
  16764. }
  16765. ,
  16766. Ym.resize = function(t, e, i) {
  16767. var o = bu(t.getBoxLayoutParams(), {
  16768. width: e.getWidth(),
  16769. height: e.getHeight()
  16770. });
  16771. this._rect = o;
  16772. var n = this._axesList;
  16773. function a() {
  16774. E(n, function(t) {
  16775. var e = t.isHorizontal()
  16776. , i = e ? [0, o.width] : [0, o.height]
  16777. , n = t.inverse ? 1 : 0;
  16778. t.setExtent(i[n], i[1 - n]),
  16779. function(t, e) {
  16780. var i = t.getExtent()
  16781. , n = i[0] + i[1];
  16782. t.toGlobalCoord = "x" === t.dim ? function(t) {
  16783. return t + e
  16784. }
  16785. : function(t) {
  16786. return n - t + e
  16787. }
  16788. ,
  16789. t.toLocalCoord = "x" === t.dim ? function(t) {
  16790. return t - e
  16791. }
  16792. : function(t) {
  16793. return n - t + e
  16794. }
  16795. }(t, e ? o.x : o.y)
  16796. })
  16797. }
  16798. a(),
  16799. !i && t.get("containLabel") && (E(n, function(t) {
  16800. if (!t.model.get("axisLabel.inside")) {
  16801. var e = function(t) {
  16802. var e = t.model
  16803. , i = t.scale;
  16804. if (e.get("axisLabel.show") && !i.isBlank()) {
  16805. var n, o, a = "category" === t.type, r = i.getExtent();
  16806. o = a ? i.count() : (n = i.getTicks()).length;
  16807. var s, l, u, h, c, d, f, p, g, m = t.getLabelModel(), v = lg(t), y = 1;
  16808. 40 < o && (y = Math.ceil(o / 40));
  16809. for (var x = 0; x < o; x += y) {
  16810. var _ = v(n ? n[x] : r[0] + x)
  16811. , w = m.getTextRect(_)
  16812. , b = (l = w,
  16813. u = m.get("rotate") || 0,
  16814. void 0,
  16815. h = u * Math.PI / 180,
  16816. c = l.plain(),
  16817. d = c.width,
  16818. f = c.height,
  16819. p = d * Math.cos(h) + f * Math.sin(h),
  16820. g = d * Math.sin(h) + f * Math.cos(h),
  16821. new Di(c.x,c.y,p,g));
  16822. s ? s.union(b) : s = b
  16823. }
  16824. return s
  16825. }
  16826. }(t);
  16827. if (e) {
  16828. var i = t.isHorizontal() ? "height" : "width"
  16829. , n = t.model.get("axisLabel.margin");
  16830. o[i] -= e[i] + n,
  16831. "top" === t.position ? o.y += e.height + n : "left" === t.position && (o.x += e.width + n)
  16832. }
  16833. }
  16834. }),
  16835. a())
  16836. }
  16837. ,
  16838. Ym.getAxis = function(t, e) {
  16839. var i = this._axesMap[t];
  16840. if (null != i) {
  16841. if (null == e)
  16842. for (var n in i)
  16843. if (i.hasOwnProperty(n))
  16844. return i[n];
  16845. return i[e]
  16846. }
  16847. }
  16848. ,
  16849. Ym.getAxes = function() {
  16850. return this._axesList.slice()
  16851. }
  16852. ,
  16853. Ym.getCartesian = function(t, e) {
  16854. if (null != t && null != e) {
  16855. var i = "x" + t + "y" + e;
  16856. return this._coordsMap[i]
  16857. }
  16858. z(t) && (e = t.yAxisIndex,
  16859. t = t.xAxisIndex);
  16860. for (var n = 0, o = this._coordsList; n < o.length; n++)
  16861. if (o[n].getAxis("x").index === t || o[n].getAxis("y").index === e)
  16862. return o[n]
  16863. }
  16864. ,
  16865. Ym.getCartesians = function() {
  16866. return this._coordsList.slice()
  16867. }
  16868. ,
  16869. Ym.convertToPixel = function(t, e, i) {
  16870. var n = this._findConvertTarget(t, e);
  16871. return n.cartesian ? n.cartesian.dataToPoint(i) : n.axis ? n.axis.toGlobalCoord(n.axis.dataToCoord(i)) : null
  16872. }
  16873. ,
  16874. Ym.convertFromPixel = function(t, e, i) {
  16875. var n = this._findConvertTarget(t, e);
  16876. return n.cartesian ? n.cartesian.pointToData(i) : n.axis ? n.axis.coordToData(n.axis.toLocalCoord(i)) : null
  16877. }
  16878. ,
  16879. Ym._findConvertTarget = function(t, e) {
  16880. var i, n, o = e.seriesModel, a = e.xAxisModel || o && o.getReferringComponents("xAxis")[0], r = e.yAxisModel || o && o.getReferringComponents("yAxis")[0], s = e.gridModel, l = this._coordsList;
  16881. if (o)
  16882. _(l, i = o.coordinateSystem) < 0 && (i = null);
  16883. else if (a && r)
  16884. i = this.getCartesian(a.componentIndex, r.componentIndex);
  16885. else if (a)
  16886. n = this.getAxis("x", a.componentIndex);
  16887. else if (r)
  16888. n = this.getAxis("y", r.componentIndex);
  16889. else if (s) {
  16890. s.coordinateSystem === this && (i = this._coordsList[0])
  16891. }
  16892. return {
  16893. cartesian: i,
  16894. axis: n
  16895. }
  16896. }
  16897. ,
  16898. Ym.containPoint = function(t) {
  16899. var e = this._coordsList[0];
  16900. if (e)
  16901. return e.containPoint(t)
  16902. }
  16903. ,
  16904. Ym._initCartesian = function(r, t, e) {
  16905. var s = {
  16906. left: !1,
  16907. right: !1,
  16908. top: !1,
  16909. bottom: !1
  16910. }
  16911. , l = {
  16912. x: {},
  16913. y: {}
  16914. }
  16915. , u = {
  16916. x: 0,
  16917. y: 0
  16918. };
  16919. if (t.eachComponent("xAxis", i("x"), this),
  16920. t.eachComponent("yAxis", i("y"), this),
  16921. !u.x || !u.y)
  16922. return this._axesMap = {},
  16923. void (this._axesList = []);
  16924. function i(a) {
  16925. return function(t, e) {
  16926. if (Um(t, r)) {
  16927. var i = t.get("position");
  16928. "x" === a ? "top" !== i && "bottom" !== i && (i = s.bottom ? "top" : "bottom") : "left" !== i && "right" !== i && (i = s.left ? "right" : "left"),
  16929. s[i] = !0;
  16930. var n = new zm(a,sg(t),[0, 0],t.get("type"),i)
  16931. , o = "category" === n.type;
  16932. n.onBand = o && t.get("boundaryGap"),
  16933. n.inverse = t.get("inverse"),
  16934. (t.axis = n).model = t,
  16935. n.grid = this,
  16936. n.index = e,
  16937. this._axesList.push(n),
  16938. l[a][e] = n,
  16939. u[a]++
  16940. }
  16941. }
  16942. }
  16943. E((this._axesMap = l).x, function(o, a) {
  16944. E(l.y, function(t, e) {
  16945. var i = "x" + a + "y" + e
  16946. , n = new Rm(i);
  16947. n.grid = this,
  16948. n.model = r,
  16949. this._coordsMap[i] = n,
  16950. this._coordsList.push(n),
  16951. n.addAxis(o),
  16952. n.addAxis(t)
  16953. }, this)
  16954. }, this)
  16955. }
  16956. ,
  16957. Ym._updateScale = function(l, u) {
  16958. function h(e, i) {
  16959. E(e.mapDimension(i.dim, !0), function(t) {
  16960. i.scale.unionExtentFromData(e, pp(e, t))
  16961. })
  16962. }
  16963. E(this._axesList, function(t) {
  16964. t.scale.setExtent(1 / 0, -1 / 0)
  16965. }),
  16966. l.eachSeries(function(t) {
  16967. if (Jm(t)) {
  16968. var e = $m(t, l)
  16969. , i = e[0]
  16970. , n = e[1];
  16971. if (!Um(i, u) || !Um(n, u))
  16972. return;
  16973. var o = this.getCartesian(i.componentIndex, n.componentIndex)
  16974. , a = t.getData()
  16975. , r = o.getAxis("x")
  16976. , s = o.getAxis("y");
  16977. "list" === a.type && (h(a, r, t),
  16978. h(a, s, t))
  16979. }
  16980. }, this)
  16981. }
  16982. ,
  16983. Ym.getTooltipAxes = function(n) {
  16984. var o = []
  16985. , a = [];
  16986. return E(this.getCartesians(), function(t) {
  16987. var e = null != n && "auto" !== n ? t.getAxis(n) : t.getBaseAxis()
  16988. , i = t.getOtherAxis(e);
  16989. _(o, e) < 0 && o.push(e),
  16990. _(a, i) < 0 && a.push(i)
  16991. }),
  16992. {
  16993. baseAxes: o,
  16994. otherAxes: a
  16995. }
  16996. }
  16997. ;
  16998. var Km = ["xAxis", "yAxis"];
  16999. function $m(e) {
  17000. return O(Km, function(t) {
  17001. return e.getReferringComponents(t)[0]
  17002. })
  17003. }
  17004. function Jm(t) {
  17005. return "cartesian2d" === t.get("coordinateSystem")
  17006. }
  17007. Xm.create = function(n, o) {
  17008. var a = [];
  17009. return n.eachComponent("grid", function(t, e) {
  17010. var i = new Xm(t,n,o);
  17011. i.name = "grid_" + e,
  17012. i.resize(t, o, !0),
  17013. t.coordinateSystem = i,
  17014. a.push(i)
  17015. }),
  17016. n.eachSeries(function(t) {
  17017. if (Jm(t)) {
  17018. var e = $m(t)
  17019. , i = e[0]
  17020. , n = e[1]
  17021. , o = i.getCoordSysModel().coordinateSystem;
  17022. t.coordinateSystem = o.getCartesian(i.componentIndex, n.componentIndex)
  17023. }
  17024. }),
  17025. a
  17026. }
  17027. ,
  17028. Xm.dimensions = Xm.prototype.dimensions = Rm.prototype.dimensions,
  17029. lh.register("cartesian2d", Xm);
  17030. function Qm(t, e) {
  17031. this.opt = e,
  17032. this.axisModel = t,
  17033. D(e, {
  17034. labelOffset: 0,
  17035. nameDirection: 1,
  17036. tickDirection: 1,
  17037. labelDirection: 1,
  17038. silent: !0
  17039. }),
  17040. this.group = new Ci;
  17041. var i = new Ci({
  17042. position: e.position.slice(),
  17043. rotation: e.rotation
  17044. });
  17045. i.updateTransform(),
  17046. this._transform = i.transform,
  17047. this._dumbGroup = i
  17048. }
  17049. var tv = Math.PI;
  17050. Qm.prototype = {
  17051. constructor: Qm,
  17052. hasBuilder: function(t) {
  17053. return !!ev[t]
  17054. },
  17055. add: function(t) {
  17056. ev[t].call(this)
  17057. },
  17058. getGroup: function() {
  17059. return this.group
  17060. }
  17061. };
  17062. var ev = {
  17063. axisLine: function() {
  17064. var a = this.opt
  17065. , t = this.axisModel;
  17066. if (t.get("axisLine.show")) {
  17067. var e = this.axisModel.axis.getExtent()
  17068. , i = this._transform
  17069. , r = [e[0], 0]
  17070. , n = [e[1], 0];
  17071. i && (bt(r, r, i),
  17072. bt(n, n, i));
  17073. var s = P({
  17074. lineCap: "round"
  17075. }, t.getModel("axisLine.lineStyle").getLineStyle());
  17076. this.group.add(new ls({
  17077. anid: "line",
  17078. subPixelOptimize: !0,
  17079. shape: {
  17080. x1: r[0],
  17081. y1: r[1],
  17082. x2: n[0],
  17083. y2: n[1]
  17084. },
  17085. style: s,
  17086. strokeContainThreshold: a.strokeContainThreshold || 5,
  17087. silent: !0,
  17088. z2: 1
  17089. }));
  17090. var l = t.get("axisLine.symbol")
  17091. , o = t.get("axisLine.symbolSize")
  17092. , u = t.get("axisLine.symbolOffset") || 0;
  17093. if ("number" == typeof u && (u = [u, u]),
  17094. null != l) {
  17095. "string" == typeof l && (l = [l, l]),
  17096. "string" != typeof o && "number" != typeof o || (o = [o, o]);
  17097. var h = o[0]
  17098. , c = o[1];
  17099. E([{
  17100. rotate: a.rotation + Math.PI / 2,
  17101. offset: u[0],
  17102. r: 0
  17103. }, {
  17104. rotate: a.rotation - Math.PI / 2,
  17105. offset: u[1],
  17106. r: Math.sqrt((r[0] - n[0]) * (r[0] - n[0]) + (r[1] - n[1]) * (r[1] - n[1]))
  17107. }], function(t, e) {
  17108. if ("none" !== l[e] && null != l[e]) {
  17109. var i = wg(l[e], -h / 2, -c / 2, h, c, s.stroke, !0)
  17110. , n = t.r + t.offset
  17111. , o = [r[0] + n * Math.cos(a.rotation), r[1] - n * Math.sin(a.rotation)];
  17112. i.attr({
  17113. rotation: t.rotate,
  17114. position: o,
  17115. silent: !0,
  17116. z2: 11
  17117. }),
  17118. this.group.add(i)
  17119. }
  17120. }, this)
  17121. }
  17122. }
  17123. },
  17124. axisTickLabel: function() {
  17125. var t = this.axisModel
  17126. , e = this.opt
  17127. , i = function(t, e, i) {
  17128. var n = e.axis
  17129. , o = e.getModel("axisTick");
  17130. if (!o.get("show") || n.scale.isBlank())
  17131. return;
  17132. for (var a = o.getModel("lineStyle"), r = i.tickDirection * o.get("length"), s = lv(n.getTicksCoords(), t._transform, r, D(a.getLineStyle(), {
  17133. stroke: e.get("axisLine.lineStyle.color")
  17134. }), "ticks"), l = 0; l < s.length; l++)
  17135. t.group.add(s[l]);
  17136. return s
  17137. }(this, t, e);
  17138. !function(t, e, i) {
  17139. if (cg(t.axis))
  17140. return;
  17141. var n = t.get("axisLabel.showMinLabel")
  17142. , o = t.get("axisLabel.showMaxLabel");
  17143. i = i || [];
  17144. var a = (e = e || [])[0]
  17145. , r = e[1]
  17146. , s = e[e.length - 1]
  17147. , l = e[e.length - 2]
  17148. , u = i[0]
  17149. , h = i[1]
  17150. , c = i[i.length - 1]
  17151. , d = i[i.length - 2];
  17152. !1 === n ? (av(a),
  17153. av(u)) : rv(a, r) && (n ? (av(r),
  17154. av(h)) : (av(a),
  17155. av(u)));
  17156. !1 === o ? (av(s),
  17157. av(c)) : rv(l, s) && (o ? (av(l),
  17158. av(d)) : (av(s),
  17159. av(c)))
  17160. }(t, function(u, h, c) {
  17161. var d = h.axis;
  17162. if (!W(c.axisLabelShow, h.get("axisLabel.show")) || d.scale.isBlank())
  17163. return;
  17164. var f = h.getModel("axisLabel")
  17165. , p = f.get("margin")
  17166. , t = d.getViewLabels()
  17167. , e = (W(c.labelRotate, f.get("rotate")) || 0) * tv / 180
  17168. , g = nv(c.rotation, e, c.labelDirection)
  17169. , m = h.getCategories && h.getCategories(!0)
  17170. , v = []
  17171. , y = ov(h)
  17172. , x = h.get("triggerEvent");
  17173. return E(t, function(t, e) {
  17174. var i = t.tickValue
  17175. , n = t.formattedLabel
  17176. , o = t.rawLabel
  17177. , a = f;
  17178. m && m[i] && m[i].textStyle && (a = new Cl(m[i].textStyle,f,h.ecModel));
  17179. var r = a.getTextColor() || h.get("axisLine.lineStyle.color")
  17180. , s = [d.dataToCoord(i), c.labelOffset + c.labelDirection * p]
  17181. , l = new Ur({
  17182. anid: "label_" + i,
  17183. position: s,
  17184. rotation: g.rotation,
  17185. silent: y,
  17186. z2: 10
  17187. });
  17188. nl(l.style, a, {
  17189. text: n,
  17190. textAlign: a.getShallow("align", !0) || g.textAlign,
  17191. textVerticalAlign: a.getShallow("verticalAlign", !0) || a.getShallow("baseline", !0) || g.textVerticalAlign,
  17192. textFill: "function" == typeof r ? r("category" === d.type ? o : "value" === d.type ? i + "" : i, e) : r
  17193. }),
  17194. x && (l.eventData = iv(h),
  17195. l.eventData.targetType = "axisLabel",
  17196. l.eventData.value = o),
  17197. u._dumbGroup.add(l),
  17198. l.updateTransform(),
  17199. v.push(l),
  17200. u.group.add(l),
  17201. l.decomposeTransform()
  17202. }),
  17203. v
  17204. }(this, t, e), i),
  17205. function(t, e, i) {
  17206. var n = e.axis
  17207. , o = e.getModel("minorTick");
  17208. if (!o.get("show") || n.scale.isBlank())
  17209. return;
  17210. var a = n.getMinorTicksCoords();
  17211. if (!a.length)
  17212. return;
  17213. for (var r = o.getModel("lineStyle"), s = i.tickDirection * o.get("length"), l = D(r.getLineStyle(), D(e.getModel("axisTick").getLineStyle(), {
  17214. stroke: e.get("axisLine.lineStyle.color")
  17215. })), u = 0; u < a.length; u++)
  17216. for (var h = lv(a[u], t._transform, s, l, "minorticks_" + u), c = 0; c < h.length; c++)
  17217. t.group.add(h[c])
  17218. }(this, t, e)
  17219. },
  17220. axisName: function() {
  17221. var t = this.opt
  17222. , e = this.axisModel
  17223. , i = W(t.axisName, e.get("name"));
  17224. if (i) {
  17225. var n, o, a = e.get("nameLocation"), r = t.nameDirection, s = e.getModel("nameTextStyle"), l = e.get("nameGap") || 0, u = this.axisModel.axis.getExtent(), h = u[0] > u[1] ? -1 : 1, c = ["start" === a ? u[0] - h * l : "end" === a ? u[1] + h * l : (u[0] + u[1]) / 2, sv(a) ? t.labelOffset + r * l : 0], d = e.get("nameRotate");
  17226. null != d && (d = d * tv / 180),
  17227. sv(a) ? n = nv(t.rotation, null != d ? d : t.rotation, r) : (n = function(t, e, i, n) {
  17228. var o, a, r = Zl(i - t.rotation), s = n[0] > n[1], l = "start" === e && !s || "start" !== e && s;
  17229. o = Ul(r - tv / 2) ? (a = l ? "bottom" : "top",
  17230. "center") : Ul(r - 1.5 * tv) ? (a = l ? "top" : "bottom",
  17231. "center") : (a = "middle",
  17232. r < 1.5 * tv && tv / 2 < r ? l ? "left" : "right" : l ? "right" : "left");
  17233. return {
  17234. rotation: r,
  17235. textAlign: o,
  17236. textVerticalAlign: a
  17237. }
  17238. }(t, a, d || 0, u),
  17239. null != (o = t.axisNameAvailableWidth) && (o = Math.abs(o / Math.sin(n.rotation)),
  17240. isFinite(o) || (o = null)));
  17241. var f = s.getFont()
  17242. , p = e.get("nameTruncate", !0) || {}
  17243. , g = p.ellipsis
  17244. , m = W(t.nameTruncateMaxWidth, p.maxWidth, o)
  17245. , v = null != g && null != m ? pu(i, m, f, g, {
  17246. minChar: 2,
  17247. placeholder: p.placeholder
  17248. }) : i
  17249. , y = e.get("tooltip", !0)
  17250. , x = e.mainType
  17251. , _ = {
  17252. componentType: x,
  17253. name: i,
  17254. $vars: ["name"]
  17255. };
  17256. _[x + "Index"] = e.componentIndex;
  17257. var w = new Ur({
  17258. anid: "name",
  17259. __fullText: i,
  17260. __truncatedText: v,
  17261. position: c,
  17262. rotation: n.rotation,
  17263. silent: ov(e),
  17264. z2: 1,
  17265. tooltip: y && y.show ? P({
  17266. content: i,
  17267. formatter: function() {
  17268. return i
  17269. },
  17270. formatterParams: _
  17271. }, y) : null
  17272. });
  17273. nl(w.style, s, {
  17274. text: v,
  17275. textFont: f,
  17276. textFill: s.getTextColor() || e.get("axisLine.lineStyle.color"),
  17277. textAlign: s.get("align") || n.textAlign,
  17278. textVerticalAlign: s.get("verticalAlign") || n.textVerticalAlign
  17279. }),
  17280. e.get("triggerEvent") && (w.eventData = iv(e),
  17281. w.eventData.targetType = "axisName",
  17282. w.eventData.name = i),
  17283. this._dumbGroup.add(w),
  17284. w.updateTransform(),
  17285. this.group.add(w),
  17286. w.decomposeTransform()
  17287. }
  17288. }
  17289. }
  17290. , iv = Qm.makeAxisEventDataBase = function(t) {
  17291. var e = {
  17292. componentType: t.mainType,
  17293. componentIndex: t.componentIndex
  17294. };
  17295. return e[t.mainType + "Index"] = t.componentIndex,
  17296. e
  17297. }
  17298. , nv = Qm.innerTextLayout = function(t, e, i) {
  17299. var n, o = Zl(e - t);
  17300. return {
  17301. rotation: o,
  17302. textAlign: Ul(o) ? (n = 0 < i ? "top" : "bottom",
  17303. "center") : Ul(o - tv) ? (n = 0 < i ? "bottom" : "top",
  17304. "center") : (n = "middle",
  17305. 0 < o && o < tv ? 0 < i ? "right" : "left" : 0 < i ? "left" : "right"),
  17306. textVerticalAlign: n
  17307. }
  17308. }
  17309. ;
  17310. var ov = Qm.isLabelSilent = function(t) {
  17311. var e = t.get("tooltip");
  17312. return t.get("silent") || !(t.get("triggerEvent") || e && e.show)
  17313. }
  17314. ;
  17315. function av(t) {
  17316. t && (t.ignore = !0)
  17317. }
  17318. function rv(t, e) {
  17319. var i = t && t.getBoundingRect().clone()
  17320. , n = e && e.getBoundingRect().clone();
  17321. if (i && n) {
  17322. var o = re([]);
  17323. return he(o, o, -t.rotation),
  17324. i.applyTransform(le([], o, t.getLocalTransform())),
  17325. n.applyTransform(le([], o, e.getLocalTransform())),
  17326. i.intersect(n)
  17327. }
  17328. }
  17329. function sv(t) {
  17330. return "middle" === t || "center" === t
  17331. }
  17332. function lv(t, e, i, n, o) {
  17333. for (var a = [], r = [], s = [], l = 0; l < t.length; l++) {
  17334. var u = t[l].coord;
  17335. r[0] = u,
  17336. s[r[1] = 0] = u,
  17337. s[1] = i,
  17338. e && (bt(r, r, e),
  17339. bt(s, s, e));
  17340. var h = new ls({
  17341. anid: o + "_" + t[l].tickValue,
  17342. subPixelOptimize: !0,
  17343. shape: {
  17344. x1: r[0],
  17345. y1: r[1],
  17346. x2: s[0],
  17347. y2: s[1]
  17348. },
  17349. style: n,
  17350. z2: 2,
  17351. silent: !0
  17352. });
  17353. a.push(h)
  17354. }
  17355. return a
  17356. }
  17357. var uv = E
  17358. , hv = T;
  17359. function cv(t, e) {
  17360. var i = {
  17361. axesInfo: {},
  17362. seriesInvolved: !1,
  17363. coordSysAxesInfo: {},
  17364. coordSysMap: {}
  17365. };
  17366. return function(p, g, t) {
  17367. var a = g.getComponent("tooltip")
  17368. , m = g.getComponent("axisPointer")
  17369. , v = m.get("link", !0) || []
  17370. , y = [];
  17371. uv(t.getCoordinateSystems(), function(c) {
  17372. if (c.axisPointerEnabled) {
  17373. var t = gv(c.model)
  17374. , d = p.coordSysAxesInfo[t] = {}
  17375. , f = (p.coordSysMap[t] = c).model.getModel("tooltip", a);
  17376. if (uv(c.getAxes(), hv(o, !1, null)),
  17377. c.getTooltipAxes && a && f.get("show")) {
  17378. var e = "axis" === f.get("trigger")
  17379. , i = "cross" === f.get("axisPointer.type")
  17380. , n = c.getTooltipAxes(f.get("axisPointer.axis"));
  17381. (e || i) && uv(n.baseAxes, hv(o, !i || "cross", e)),
  17382. i && uv(n.otherAxes, hv(o, "cross", !1))
  17383. }
  17384. }
  17385. function o(t, e, i) {
  17386. var n = i.model.getModel("axisPointer", m)
  17387. , o = n.get("show");
  17388. if (o && ("auto" !== o || t || pv(n))) {
  17389. null == e && (e = n.get("triggerTooltip"));
  17390. var a = (n = t ? function(t, e, i, n, o, a) {
  17391. var r = e.getModel("axisPointer")
  17392. , s = {};
  17393. uv(["type", "snap", "lineStyle", "shadowStyle", "label", "animation", "animationDurationUpdate", "animationEasingUpdate", "z"], function(t) {
  17394. s[t] = k(r.get(t))
  17395. }),
  17396. s.snap = "category" !== t.type && !!a,
  17397. "cross" === r.get("type") && (s.type = "line");
  17398. var l = s.label || (s.label = {});
  17399. if (null == l.show && (l.show = !1),
  17400. "cross" === o) {
  17401. var u = r.get("label.show");
  17402. if (l.show = null == u || u,
  17403. !a) {
  17404. var h = s.lineStyle = r.get("crossStyle");
  17405. h && D(l, h.textStyle)
  17406. }
  17407. }
  17408. return t.model.getModel("axisPointer", new Cl(s,i,n))
  17409. }(i, f, m, g, t, e) : n).get("snap")
  17410. , r = gv(i.model)
  17411. , s = e || a || "category" === i.type
  17412. , l = p.axesInfo[r] = {
  17413. key: r,
  17414. axis: i,
  17415. coordSys: c,
  17416. axisPointerModel: n,
  17417. triggerTooltip: e,
  17418. involveSeries: s,
  17419. snap: a,
  17420. useHandle: pv(n),
  17421. seriesModels: []
  17422. };
  17423. d[r] = l,
  17424. p.seriesInvolved |= s;
  17425. var u = function(t, e) {
  17426. for (var i = e.model, n = e.dim, o = 0; o < t.length; o++) {
  17427. var a = t[o] || {};
  17428. if (dv(a[n + "AxisId"], i.id) || dv(a[n + "AxisIndex"], i.componentIndex) || dv(a[n + "AxisName"], i.name))
  17429. return o
  17430. }
  17431. }(v, i);
  17432. if (null != u) {
  17433. var h = y[u] || (y[u] = {
  17434. axesInfo: {}
  17435. });
  17436. h.axesInfo[r] = l,
  17437. h.mapper = v[u].mapper,
  17438. l.linkGroup = h
  17439. }
  17440. }
  17441. }
  17442. })
  17443. }(i, t, e),
  17444. i.seriesInvolved && function(o, t) {
  17445. t.eachSeries(function(i) {
  17446. var n = i.coordinateSystem
  17447. , t = i.get("tooltip.trigger", !0)
  17448. , e = i.get("tooltip.show", !0);
  17449. n && "none" !== t && !1 !== t && "item" !== t && !1 !== e && !1 !== i.get("axisPointer.show", !0) && uv(o.coordSysAxesInfo[gv(n.model)], function(t) {
  17450. var e = t.axis;
  17451. n.getAxis(e.dim) === e && (t.seriesModels.push(i),
  17452. null == t.seriesDataCount && (t.seriesDataCount = 0),
  17453. t.seriesDataCount += i.getData().count())
  17454. })
  17455. }, this)
  17456. }(i, t),
  17457. i
  17458. }
  17459. function dv(t, e) {
  17460. return "all" === t || L(t) && 0 <= _(t, e) || t === e
  17461. }
  17462. function fv(t) {
  17463. var e = (t.ecModel.getComponent("axisPointer") || {}).coordSysAxesInfo;
  17464. return e && e.axesInfo[gv(t)]
  17465. }
  17466. function pv(t) {
  17467. return !!t.get("handle.show")
  17468. }
  17469. function gv(t) {
  17470. return t.type + "||" + t.id
  17471. }
  17472. var mv = Af({
  17473. type: "axis",
  17474. _axisPointer: null,
  17475. axisPointerClass: null,
  17476. render: function(t, e, i, n) {
  17477. this.axisPointerClass && function(t) {
  17478. var e = fv(t);
  17479. if (e) {
  17480. var i = e.axisPointerModel
  17481. , n = e.axis.scale
  17482. , o = i.option
  17483. , a = i.get("status")
  17484. , r = i.get("value");
  17485. null != r && (r = n.parse(r));
  17486. var s = pv(i);
  17487. null == a && (o.status = s ? "show" : "hide");
  17488. var l = n.getExtent().slice();
  17489. l[0] > l[1] && l.reverse(),
  17490. (null == r || r > l[1]) && (r = l[1]),
  17491. r < l[0] && (r = l[0]),
  17492. o.value = r,
  17493. s && (o.status = e.axis.scale.isBlank() ? "hide" : "show")
  17494. }
  17495. }(t),
  17496. mv.superApply(this, "render", arguments),
  17497. vv(this, t, e, i, n, !0)
  17498. },
  17499. updateAxisPointer: function(t, e, i, n, o) {
  17500. vv(this, t, e, i, n, !1)
  17501. },
  17502. remove: function(t, e) {
  17503. var i = this._axisPointer;
  17504. i && i.remove(e),
  17505. mv.superApply(this, "remove", arguments)
  17506. },
  17507. dispose: function(t, e) {
  17508. yv(this, e),
  17509. mv.superApply(this, "dispose", arguments)
  17510. }
  17511. });
  17512. function vv(t, e, i, n, o, a) {
  17513. var r = mv.getAxisPointerClass(t.axisPointerClass);
  17514. if (r) {
  17515. var s = function(t) {
  17516. var e = fv(t);
  17517. return e && e.axisPointerModel
  17518. }(e);
  17519. s ? (t._axisPointer || (t._axisPointer = new r)).render(e, s, n, a) : yv(t, n)
  17520. }
  17521. }
  17522. function yv(t, e, i) {
  17523. var n = t._axisPointer;
  17524. n && n.dispose(e, i),
  17525. t._axisPointer = null
  17526. }
  17527. var xv = [];
  17528. function _v(t, e, i) {
  17529. i = i || {};
  17530. var n = t.coordinateSystem
  17531. , o = e.axis
  17532. , a = {}
  17533. , r = o.getAxesOnZeroOf()[0]
  17534. , s = o.position
  17535. , l = r ? "onZero" : s
  17536. , u = o.dim
  17537. , h = n.getRect()
  17538. , c = [h.x, h.x + h.width, h.y, h.y + h.height]
  17539. , d = {
  17540. left: 0,
  17541. right: 1,
  17542. top: 0,
  17543. bottom: 1,
  17544. onZero: 2
  17545. }
  17546. , f = e.get("offset") || 0
  17547. , p = "x" === u ? [c[2] - f, c[3] + f] : [c[0] - f, c[1] + f];
  17548. if (r) {
  17549. var g = r.toGlobalCoord(r.dataToCoord(0));
  17550. p[d.onZero] = Math.max(Math.min(g, p[1]), p[0])
  17551. }
  17552. a.position = ["y" === u ? p[d[l]] : c[0], "x" === u ? p[d[l]] : c[3]],
  17553. a.rotation = Math.PI / 2 * ("x" === u ? 0 : 1);
  17554. a.labelDirection = a.tickDirection = a.nameDirection = {
  17555. top: -1,
  17556. bottom: 1,
  17557. left: -1,
  17558. right: 1
  17559. }[s],
  17560. a.labelOffset = r ? p[d[s]] - p[d.onZero] : 0,
  17561. e.get("axisTick.inside") && (a.tickDirection = -a.tickDirection),
  17562. W(i.labelInside, e.get("axisLabel.inside")) && (a.labelDirection = -a.labelDirection);
  17563. var m = e.get("axisLabel.rotate");
  17564. return a.labelRotate = "top" === l ? -m : m,
  17565. a.z2 = 1,
  17566. a
  17567. }
  17568. function wv(t, e, i, n) {
  17569. var o = i.axis;
  17570. if (!o.scale.isBlank()) {
  17571. var a = i.getModel("splitArea")
  17572. , r = a.getModel("areaStyle")
  17573. , s = r.get("color")
  17574. , l = n.coordinateSystem.getRect()
  17575. , u = o.getTicksCoords({
  17576. tickModel: a,
  17577. clamp: !0
  17578. });
  17579. if (u.length) {
  17580. var h = s.length
  17581. , c = t.__splitAreaColors
  17582. , d = Q()
  17583. , f = 0;
  17584. if (c)
  17585. for (var p = 0; p < u.length; p++) {
  17586. var g = c.get(u[p].tickValue);
  17587. if (null != g) {
  17588. f = (g + (h - 1) * p) % h;
  17589. break
  17590. }
  17591. }
  17592. var m = o.toGlobalCoord(u[0].coord)
  17593. , v = r.getAreaStyle();
  17594. s = L(s) ? s : [s];
  17595. for (p = 1; p < u.length; p++) {
  17596. var y, x, _, w, b = o.toGlobalCoord(u[p].coord);
  17597. m = o.isHorizontal() ? (y = m,
  17598. x = l.y,
  17599. _ = b - y,
  17600. w = l.height,
  17601. y + _) : (y = l.x,
  17602. x = m,
  17603. _ = l.width,
  17604. x + (w = b - x));
  17605. var S = u[p - 1].tickValue;
  17606. null != S && d.set(S, f),
  17607. e.add(new rs({
  17608. anid: null != S ? "area_" + S : null,
  17609. shape: {
  17610. x: y,
  17611. y: x,
  17612. width: _,
  17613. height: w
  17614. },
  17615. style: D({
  17616. fill: s[f]
  17617. }, v),
  17618. silent: !0
  17619. })),
  17620. f = (f + 1) % h
  17621. }
  17622. t.__splitAreaColors = d
  17623. }
  17624. }
  17625. }
  17626. function bv(t) {
  17627. t.__splitAreaColors = null
  17628. }
  17629. mv.registerAxisPointerClass = function(t, e) {
  17630. xv[t] = e
  17631. }
  17632. ,
  17633. mv.getAxisPointerClass = function(t) {
  17634. return t && xv[t]
  17635. }
  17636. ;
  17637. var Sv = ["axisLine", "axisTickLabel", "axisName"]
  17638. , Mv = ["splitArea", "splitLine", "minorSplitLine"]
  17639. , Iv = mv.extend({
  17640. type: "cartesianAxis",
  17641. axisPointerClass: "CartesianAxisPointer",
  17642. render: function(e, t, i, n) {
  17643. this.group.removeAll();
  17644. var o = this._axisGroup;
  17645. if (this._axisGroup = new Ci,
  17646. this.group.add(this._axisGroup),
  17647. e.get("show")) {
  17648. var a = e.getCoordSysModel()
  17649. , r = _v(a, e)
  17650. , s = new Qm(e,r);
  17651. E(Sv, s.add, s),
  17652. this._axisGroup.add(s.getGroup()),
  17653. E(Mv, function(t) {
  17654. e.get(t + ".show") && this["_" + t](e, a)
  17655. }, this),
  17656. ml(o, this._axisGroup, e),
  17657. Iv.superCall(this, "render", e, t, i, n)
  17658. }
  17659. },
  17660. remove: function() {
  17661. bv(this)
  17662. },
  17663. _splitLine: function(t, e) {
  17664. var i = t.axis;
  17665. if (!i.scale.isBlank()) {
  17666. var n = t.getModel("splitLine")
  17667. , o = n.getModel("lineStyle")
  17668. , a = o.get("color");
  17669. a = L(a) ? a : [a];
  17670. for (var r = e.coordinateSystem.getRect(), s = i.isHorizontal(), l = 0, u = i.getTicksCoords({
  17671. tickModel: n
  17672. }), h = [], c = [], d = o.getLineStyle(), f = 0; f < u.length; f++) {
  17673. var p = i.toGlobalCoord(u[f].coord);
  17674. s ? (h[0] = p,
  17675. h[1] = r.y,
  17676. c[0] = p,
  17677. c[1] = r.y + r.height) : (h[0] = r.x,
  17678. h[1] = p,
  17679. c[0] = r.x + r.width,
  17680. c[1] = p);
  17681. var g = l++ % a.length
  17682. , m = u[f].tickValue;
  17683. this._axisGroup.add(new ls({
  17684. anid: null != m ? "line_" + u[f].tickValue : null,
  17685. subPixelOptimize: !0,
  17686. shape: {
  17687. x1: h[0],
  17688. y1: h[1],
  17689. x2: c[0],
  17690. y2: c[1]
  17691. },
  17692. style: D({
  17693. stroke: a[g]
  17694. }, d),
  17695. silent: !0
  17696. }))
  17697. }
  17698. }
  17699. },
  17700. _minorSplitLine: function(t, e) {
  17701. var i = t.axis
  17702. , n = t.getModel("minorSplitLine").getModel("lineStyle")
  17703. , o = e.coordinateSystem.getRect()
  17704. , a = i.isHorizontal()
  17705. , r = i.getMinorTicksCoords();
  17706. if (r.length)
  17707. for (var s = [], l = [], u = n.getLineStyle(), h = 0; h < r.length; h++)
  17708. for (var c = 0; c < r[h].length; c++) {
  17709. var d = i.toGlobalCoord(r[h][c].coord);
  17710. a ? (s[0] = d,
  17711. s[1] = o.y,
  17712. l[0] = d,
  17713. l[1] = o.y + o.height) : (s[0] = o.x,
  17714. s[1] = d,
  17715. l[0] = o.x + o.width,
  17716. l[1] = d),
  17717. this._axisGroup.add(new ls({
  17718. anid: "minor_line_" + r[h][c].tickValue,
  17719. subPixelOptimize: !0,
  17720. shape: {
  17721. x1: s[0],
  17722. y1: s[1],
  17723. x2: l[0],
  17724. y2: l[1]
  17725. },
  17726. style: u,
  17727. silent: !0
  17728. }))
  17729. }
  17730. },
  17731. _splitArea: function(t, e) {
  17732. wv(this, this._axisGroup, t, e)
  17733. }
  17734. });
  17735. Iv.extend({
  17736. type: "xAxis"
  17737. }),
  17738. Iv.extend({
  17739. type: "yAxis"
  17740. }),
  17741. Af({
  17742. type: "grid",
  17743. render: function(t, e) {
  17744. this.group.removeAll(),
  17745. t.get("show") && this.group.add(new rs({
  17746. shape: t.coordinateSystem.getRect(),
  17747. style: D({
  17748. fill: t.get("backgroundColor")
  17749. }, t.getItemStyle()),
  17750. silent: !0,
  17751. z2: -1
  17752. }))
  17753. }
  17754. }),
  17755. yf(function(t) {
  17756. t.xAxis && t.yAxis && !t.grid && (t.grid = {})
  17757. }),
  17758. Sf(Lm("line", "circle", "line")),
  17759. bf(km("line")),
  17760. xf(Ld.PROCESSOR.STATISTIC, {
  17761. seriesType: "line",
  17762. modifyOutputEnd: !0,
  17763. reset: function(t, e, i) {
  17764. var n = t.getData()
  17765. , o = t.get("sampling")
  17766. , a = t.coordinateSystem;
  17767. if ("cartesian2d" === a.type && o) {
  17768. var r, s = a.getBaseAxis(), l = a.getOtherAxis(s), u = s.getExtent(), h = u[1] - u[0], c = Math.round(n.count() / h);
  17769. 1 < c && ("string" == typeof o ? r = Nm[o] : "function" == typeof o && (r = o),
  17770. r && t.setData(n.downSample(n.mapDimension(l.dim), 1 / c, r, Pm)))
  17771. }
  17772. }
  17773. });
  17774. var Tv = sc.extend({
  17775. type: "series.__base_bar__",
  17776. getInitialData: function(t, e) {
  17777. return gp(this.getSource(), this, {
  17778. useEncodeDefaulter: !0
  17779. })
  17780. },
  17781. getMarkerPosition: function(t) {
  17782. var e = this.coordinateSystem;
  17783. if (e) {
  17784. var i = e.dataToPoint(e.clampData(t))
  17785. , n = this.getData()
  17786. , o = n.getLayout("offset")
  17787. , a = n.getLayout("size");
  17788. return i[e.getBaseAxis().isHorizontal() ? 0 : 1] += o + a / 2,
  17789. i
  17790. }
  17791. return [NaN, NaN]
  17792. },
  17793. defaultOption: {
  17794. zlevel: 0,
  17795. z: 2,
  17796. coordinateSystem: "cartesian2d",
  17797. legendHoverLink: !0,
  17798. barMinHeight: 0,
  17799. barMinAngle: 0,
  17800. large: !1,
  17801. largeThreshold: 400,
  17802. progressive: 3e3,
  17803. progressiveChunkMode: "mod",
  17804. itemStyle: {},
  17805. emphasis: {}
  17806. }
  17807. });
  17808. function Av(t, e, i, n, o, a) {
  17809. el(t, e, i.getModel("label"), i.getModel("emphasis.label"), {
  17810. labelFetcher: o,
  17811. labelDataIndex: a,
  17812. defaultText: Ug(o.getData(), a),
  17813. isRectText: !0,
  17814. autoColor: n
  17815. }),
  17816. Dv(t),
  17817. Dv(e)
  17818. }
  17819. function Dv(t, e) {
  17820. "outside" === t.textPosition && (t.textPosition = e)
  17821. }
  17822. Tv.extend({
  17823. type: "series.bar",
  17824. dependencies: ["grid", "polar"],
  17825. brushSelector: "rect",
  17826. getProgressive: function() {
  17827. return !!this.get("large") && this.get("progressive")
  17828. },
  17829. getProgressiveThreshold: function() {
  17830. var t = this.get("progressiveThreshold")
  17831. , e = this.get("largeThreshold");
  17832. return t < e && (t = e),
  17833. t
  17834. },
  17835. defaultOption: {
  17836. clip: !0,
  17837. roundCap: !1,
  17838. showBackground: !1,
  17839. backgroundStyle: {
  17840. color: "rgba(180, 180, 180, 0.2)",
  17841. borderColor: null,
  17842. borderWidth: 0,
  17843. borderType: "solid",
  17844. borderRadius: 0,
  17845. shadowBlur: 0,
  17846. shadowColor: null,
  17847. shadowOffsetX: 0,
  17848. shadowOffsetY: 0,
  17849. opacity: 1
  17850. }
  17851. }
  17852. });
  17853. var Cv = ha([["fill", "color"], ["stroke", "borderColor"], ["lineWidth", "borderWidth"], ["stroke", "barBorderColor"], ["lineWidth", "barBorderWidth"], ["opacity"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"]])
  17854. , Lv = {
  17855. getBarItemStyle: function(t) {
  17856. var e = Cv(this, t);
  17857. if (this.getBorderLineDash) {
  17858. var i = this.getBorderLineDash();
  17859. i && (e.lineDash = i)
  17860. }
  17861. return e
  17862. }
  17863. }
  17864. , kv = Cs({
  17865. type: "sausage",
  17866. shape: {
  17867. cx: 0,
  17868. cy: 0,
  17869. r0: 0,
  17870. r: 0,
  17871. startAngle: 0,
  17872. endAngle: 2 * Math.PI,
  17873. clockwise: !0
  17874. },
  17875. buildPath: function(t, e) {
  17876. var i = e.cx
  17877. , n = e.cy
  17878. , o = Math.max(e.r0 || 0, 0)
  17879. , a = Math.max(e.r, 0)
  17880. , r = .5 * (a - o)
  17881. , s = o + r
  17882. , l = e.startAngle
  17883. , u = e.endAngle
  17884. , h = e.clockwise
  17885. , c = Math.cos(l)
  17886. , d = Math.sin(l)
  17887. , f = Math.cos(u)
  17888. , p = Math.sin(u);
  17889. (h ? u - l < 2 * Math.PI : l - u < 2 * Math.PI) && (t.moveTo(c * o + i, d * o + n),
  17890. t.arc(c * s + i, d * s + n, r, -Math.PI + l, l, !h)),
  17891. t.arc(i, n, a, l, u, !h),
  17892. t.moveTo(f * a + i, p * a + n),
  17893. t.arc(f * s + i, p * s + n, r, u - 2 * Math.PI, u - Math.PI, !h),
  17894. 0 !== o && (t.arc(i, n, o, u, l, h),
  17895. t.moveTo(c * o + i, p * o + n)),
  17896. t.closePath()
  17897. }
  17898. })
  17899. , Pv = ["itemStyle", "barBorderWidth"]
  17900. , Nv = [0, 0];
  17901. P(Cl.prototype, Lv),
  17902. Cf({
  17903. type: "bar",
  17904. render: function(t, e, i) {
  17905. this._updateDrawMode(t);
  17906. var n = t.get("coordinateSystem");
  17907. return "cartesian2d" !== n && "polar" !== n || (this._isLargeDraw ? this._renderLarge(t, e, i) : this._renderNormal(t, e, i)),
  17908. this.group
  17909. },
  17910. incrementalPrepareRender: function(t, e, i) {
  17911. this._clear(),
  17912. this._updateDrawMode(t)
  17913. },
  17914. incrementalRender: function(t, e, i, n) {
  17915. this._incrementalRenderLarge(t, e)
  17916. },
  17917. _updateDrawMode: function(t) {
  17918. var e = t.pipelineContext.large;
  17919. (null == this._isLargeDraw || e ^ this._isLargeDraw) && (this._isLargeDraw = e,
  17920. this._clear())
  17921. },
  17922. _renderNormal: function(s, t, e) {
  17923. var l, u = this.group, h = s.getData(), c = this._data, d = s.coordinateSystem, i = d.getBaseAxis();
  17924. "cartesian2d" === d.type ? l = i.isHorizontal() : "polar" === d.type && (l = "angle" === i.dim);
  17925. var f = s.isAnimationEnabled() ? s : null
  17926. , p = s.get("clip", !0)
  17927. , g = function(t, e) {
  17928. var i = t.getArea && t.getArea();
  17929. if ("cartesian2d" === t.type) {
  17930. var n = t.getBaseAxis();
  17931. if ("category" !== n.type || !n.onBand) {
  17932. var o = e.getLayout("bandWidth");
  17933. n.isHorizontal() ? (i.x -= o,
  17934. i.width += 2 * o) : (i.y -= o,
  17935. i.height += 2 * o)
  17936. }
  17937. }
  17938. return i
  17939. }(d, h);
  17940. u.removeClipPath();
  17941. var m = s.get("roundCap", !0)
  17942. , v = s.get("showBackground", !0)
  17943. , y = s.getModel("backgroundStyle")
  17944. , x = y.get("barBorderRadius") || 0
  17945. , _ = []
  17946. , w = this._backgroundEls || [];
  17947. h.diff(c).add(function(t) {
  17948. var e = h.getItemModel(t)
  17949. , i = Gv[d.type](h, t, e);
  17950. if (v) {
  17951. var n = Gv[d.type](h, t)
  17952. , o = function(t, e, i) {
  17953. return new ("polar" === t.type ? qr : rs)({
  17954. shape: Xv(e, i, t),
  17955. silent: !0,
  17956. z2: 0
  17957. })
  17958. }(d, l, n);
  17959. o.useStyle(y.getBarItemStyle()),
  17960. "cartesian2d" === d.type && o.setShape("r", x),
  17961. _[t] = o
  17962. }
  17963. if (h.hasValue(t)) {
  17964. if (p)
  17965. if (Rv[d.type](g, i))
  17966. return void u.remove(a);
  17967. var a = zv[d.type](t, i, l, f, !1, m);
  17968. h.setItemGraphicEl(t, a),
  17969. u.add(a),
  17970. Wv(a, h, t, e, i, s, l, "polar" === d.type)
  17971. }
  17972. }).update(function(t, e) {
  17973. var i = h.getItemModel(t)
  17974. , n = Gv[d.type](h, t, i);
  17975. if (v) {
  17976. var o = w[e];
  17977. o.useStyle(y.getBarItemStyle()),
  17978. "cartesian2d" === d.type && o.setShape("r", x),
  17979. _[t] = o;
  17980. var a = Gv[d.type](h, t);
  17981. cl(o, {
  17982. shape: Xv(l, a, d)
  17983. }, f, t)
  17984. }
  17985. var r = c.getItemGraphicEl(e);
  17986. if (h.hasValue(t)) {
  17987. if (p)
  17988. if (Rv[d.type](g, n))
  17989. return void u.remove(r);
  17990. r ? cl(r, {
  17991. shape: n
  17992. }, f, t) : r = zv[d.type](t, n, l, f, !0, m),
  17993. h.setItemGraphicEl(t, r),
  17994. u.add(r),
  17995. Wv(r, h, t, i, n, s, l, "polar" === d.type)
  17996. } else
  17997. u.remove(r)
  17998. }).remove(function(t) {
  17999. var e = c.getItemGraphicEl(t);
  18000. "cartesian2d" === d.type ? e && Bv(t, f, e) : e && Vv(t, f, e)
  18001. }).execute();
  18002. var n = this._backgroundGroup || (this._backgroundGroup = new Ci);
  18003. n.removeAll();
  18004. for (var o = 0; o < _.length; ++o)
  18005. n.add(_[o]);
  18006. u.add(n),
  18007. this._backgroundEls = _,
  18008. this._data = h
  18009. },
  18010. _renderLarge: function(t, e, i) {
  18011. this._clear(),
  18012. Zv(t, this.group);
  18013. var n = t.get("clip", !0) ? Sm(t.coordinateSystem, !1, t) : null;
  18014. n ? this.group.setClipPath(n) : this.group.removeClipPath()
  18015. },
  18016. _incrementalRenderLarge: function(t, e) {
  18017. this._removeBackground(),
  18018. Zv(e, this.group, !0)
  18019. },
  18020. dispose: et,
  18021. remove: function(t) {
  18022. this._clear(t)
  18023. },
  18024. _clear: function(e) {
  18025. var t = this.group
  18026. , i = this._data;
  18027. e && e.get("animation") && i && !this._isLargeDraw ? (this._removeBackground(),
  18028. this._backgroundEls = [],
  18029. i.eachItemGraphicEl(function(t) {
  18030. "sector" === t.type ? Vv(t.dataIndex, e, t) : Bv(t.dataIndex, e, t)
  18031. })) : t.removeAll(),
  18032. this._data = null
  18033. },
  18034. _removeBackground: function() {
  18035. this.group.remove(this._backgroundGroup),
  18036. this._backgroundGroup = null
  18037. }
  18038. });
  18039. var Ov = Math.max
  18040. , Ev = Math.min
  18041. , Rv = {
  18042. cartesian2d: function(t, e) {
  18043. var i = e.width < 0 ? -1 : 1
  18044. , n = e.height < 0 ? -1 : 1;
  18045. i < 0 && (e.x += e.width,
  18046. e.width = -e.width),
  18047. n < 0 && (e.y += e.height,
  18048. e.height = -e.height);
  18049. var o = Ov(e.x, t.x)
  18050. , a = Ev(e.x + e.width, t.x + t.width)
  18051. , r = Ov(e.y, t.y)
  18052. , s = Ev(e.y + e.height, t.y + t.height);
  18053. e.x = o,
  18054. e.y = r,
  18055. e.width = a - o,
  18056. e.height = s - r;
  18057. var l = e.width < 0 || e.height < 0;
  18058. return i < 0 && (e.x += e.width,
  18059. e.width = -e.width),
  18060. n < 0 && (e.y += e.height,
  18061. e.height = -e.height),
  18062. l
  18063. },
  18064. polar: function(t) {
  18065. return !1
  18066. }
  18067. }
  18068. , zv = {
  18069. cartesian2d: function(t, e, i, n, o) {
  18070. var a = new rs({
  18071. shape: P({}, e),
  18072. z2: 1
  18073. });
  18074. if (a.name = "item",
  18075. n) {
  18076. var r = i ? "height" : "width"
  18077. , s = {};
  18078. a.shape[r] = 0,
  18079. s[r] = e[r],
  18080. bl[o ? "updateProps" : "initProps"](a, {
  18081. shape: s
  18082. }, n, t)
  18083. }
  18084. return a
  18085. },
  18086. polar: function(t, e, i, n, o, a) {
  18087. var r = e.startAngle < e.endAngle
  18088. , s = new (!i && a ? kv : qr)({
  18089. shape: D({
  18090. clockwise: r
  18091. }, e),
  18092. z2: 1
  18093. });
  18094. if (s.name = "item",
  18095. n) {
  18096. var l = i ? "r" : "endAngle"
  18097. , u = {};
  18098. s.shape[l] = i ? 0 : e.startAngle,
  18099. u[l] = e[l],
  18100. bl[o ? "updateProps" : "initProps"](s, {
  18101. shape: u
  18102. }, n, t)
  18103. }
  18104. return s
  18105. }
  18106. };
  18107. function Bv(t, e, i) {
  18108. i.style.text = null,
  18109. cl(i, {
  18110. shape: {
  18111. width: 0
  18112. }
  18113. }, e, t, function() {
  18114. i.parent && i.parent.remove(i)
  18115. })
  18116. }
  18117. function Vv(t, e, i) {
  18118. i.style.text = null,
  18119. cl(i, {
  18120. shape: {
  18121. r: i.shape.r0
  18122. }
  18123. }, e, t, function() {
  18124. i.parent && i.parent.remove(i)
  18125. })
  18126. }
  18127. var Gv = {
  18128. cartesian2d: function(t, e, i) {
  18129. var n = t.getItemLayout(e)
  18130. , o = i ? function(t, e) {
  18131. var i = t.get(Pv) || 0
  18132. , n = isNaN(e.width) ? Number.MAX_VALUE : Math.abs(e.width)
  18133. , o = isNaN(e.height) ? Number.MAX_VALUE : Math.abs(e.height);
  18134. return Math.min(i, n, o)
  18135. }(i, n) : 0
  18136. , a = 0 < n.width ? 1 : -1
  18137. , r = 0 < n.height ? 1 : -1;
  18138. return {
  18139. x: n.x + a * o / 2,
  18140. y: n.y + r * o / 2,
  18141. width: n.width - a * o,
  18142. height: n.height - r * o
  18143. }
  18144. },
  18145. polar: function(t, e, i) {
  18146. var n = t.getItemLayout(e);
  18147. return {
  18148. cx: n.cx,
  18149. cy: n.cy,
  18150. r0: n.r0,
  18151. r: n.r,
  18152. startAngle: n.startAngle,
  18153. endAngle: n.endAngle
  18154. }
  18155. }
  18156. };
  18157. function Fv(t) {
  18158. return null != t.startAngle && null != t.endAngle && t.startAngle === t.endAngle
  18159. }
  18160. function Wv(t, e, i, n, o, a, r, s) {
  18161. var l = e.getItemVisual(i, "color")
  18162. , u = e.getItemVisual(i, "opacity")
  18163. , h = e.getVisual("borderColor")
  18164. , c = n.getModel("itemStyle")
  18165. , d = n.getModel("emphasis.itemStyle").getBarItemStyle();
  18166. s || t.setShape("r", c.get("barBorderRadius") || 0),
  18167. t.useStyle(D({
  18168. stroke: Fv(o) ? "none" : h,
  18169. fill: Fv(o) ? "none" : l,
  18170. opacity: u
  18171. }, c.getBarItemStyle()));
  18172. var f = n.getShallow("cursor");
  18173. f && t.attr("cursor", f);
  18174. r ? o.height : o.width;
  18175. s || Av(t.style, d, n, l, a, i),
  18176. Fv(o) && (d.fill = d.stroke = "none"),
  18177. $s(t, d)
  18178. }
  18179. var Hv = Ar.extend({
  18180. type: "largeBar",
  18181. shape: {
  18182. points: []
  18183. },
  18184. buildPath: function(t, e) {
  18185. for (var i = e.points, n = this.__startPoint, o = this.__baseDimIdx, a = 0; a < i.length; a += 2)
  18186. n[o] = i[a + o],
  18187. t.moveTo(n[0], n[1]),
  18188. t.lineTo(i[a], i[a + 1])
  18189. }
  18190. });
  18191. function Zv(t, e, i) {
  18192. var n = t.getData()
  18193. , o = []
  18194. , a = n.getLayout("valueAxisHorizontal") ? 1 : 0;
  18195. o[1 - a] = n.getLayout("valueAxisStart");
  18196. var r = n.getLayout("largeDataIndices")
  18197. , s = n.getLayout("barWidth")
  18198. , l = t.getModel("backgroundStyle");
  18199. if (t.get("showBackground", !0)) {
  18200. var u = n.getLayout("largeBackgroundPoints")
  18201. , h = [];
  18202. h[1 - a] = n.getLayout("backgroundStart");
  18203. var c = new Hv({
  18204. shape: {
  18205. points: u
  18206. },
  18207. incremental: !!i,
  18208. __startPoint: h,
  18209. __baseDimIdx: a,
  18210. __largeDataIndices: r,
  18211. __barWidth: s,
  18212. silent: !0,
  18213. z2: 0
  18214. });
  18215. !function(t, e, i) {
  18216. var n = e.get("borderColor") || e.get("color")
  18217. , o = e.getItemStyle(["color", "borderColor"]);
  18218. t.useStyle(o),
  18219. t.style.fill = null,
  18220. t.style.stroke = n,
  18221. t.style.lineWidth = i.getLayout("barWidth")
  18222. }(c, l, n),
  18223. e.add(c)
  18224. }
  18225. var d = new Hv({
  18226. shape: {
  18227. points: n.getLayout("largePoints")
  18228. },
  18229. incremental: !!i,
  18230. __startPoint: o,
  18231. __baseDimIdx: a,
  18232. __largeDataIndices: r,
  18233. __barWidth: s
  18234. });
  18235. e.add(d),
  18236. function(t, e, i) {
  18237. var n = i.getVisual("borderColor") || i.getVisual("color")
  18238. , o = e.getModel("itemStyle").getItemStyle(["color", "borderColor"]);
  18239. t.useStyle(o),
  18240. t.style.fill = null,
  18241. t.style.stroke = n,
  18242. t.style.lineWidth = i.getLayout("barWidth")
  18243. }(d, t, n),
  18244. d.seriesIndex = t.seriesIndex,
  18245. t.get("silent") || (d.on("mousedown", Uv),
  18246. d.on("mousemove", Uv))
  18247. }
  18248. var Uv = Lc(function(t) {
  18249. var e = function(t, e, i) {
  18250. var n = t.__baseDimIdx
  18251. , o = 1 - n
  18252. , a = t.shape.points
  18253. , r = t.__largeDataIndices
  18254. , s = Math.abs(t.__barWidth / 2)
  18255. , l = t.__startPoint[o];
  18256. Nv[0] = e,
  18257. Nv[1] = i;
  18258. for (var u = Nv[n], h = Nv[1 - n], c = u - s, d = u + s, f = 0, p = a.length / 2; f < p; f++) {
  18259. var g = 2 * f
  18260. , m = a[g + n]
  18261. , v = a[g + o];
  18262. if (c <= m && m <= d && (l <= v ? l <= h && h <= v : v <= h && h <= l))
  18263. return r[f]
  18264. }
  18265. return -1
  18266. }(this, t.offsetX, t.offsetY);
  18267. this.dataIndex = 0 <= e ? e : null
  18268. }, 30, !1);
  18269. function Xv(t, e, i) {
  18270. var n, o = "polar" === i.type;
  18271. return n = o ? i.getArea() : i.grid.getRect(),
  18272. o ? {
  18273. cx: n.cx,
  18274. cy: n.cy,
  18275. r0: t ? n.r0 : e.r0,
  18276. r: t ? n.r : e.r,
  18277. startAngle: t ? e.startAngle : 0,
  18278. endAngle: t ? e.endAngle : 2 * Math.PI
  18279. } : {
  18280. x: t ? e.x : n.x,
  18281. y: t ? n.y : e.y,
  18282. width: t ? e.width : n.width,
  18283. height: t ? n.height : e.height
  18284. }
  18285. }
  18286. bf(Ld.VISUAL.LAYOUT, T(zp, "bar")),
  18287. bf(Ld.VISUAL.PROGRESSIVE_LAYOUT, Bp),
  18288. Sf({
  18289. seriesType: "bar",
  18290. reset: function(t) {
  18291. t.getData().setVisual("legendSymbol", "roundRect")
  18292. }
  18293. });
  18294. function Yv(t, e, i) {
  18295. e = L(e) && {
  18296. coordDimensions: e
  18297. } || P({}, e);
  18298. var n = t.getSource()
  18299. , o = lp(n, e)
  18300. , a = new Yf(o,t);
  18301. return a.initData(n, i),
  18302. a
  18303. }
  18304. var jv = {
  18305. updateSelectedMap: function(t) {
  18306. this._targetList = L(t) ? t.slice() : [],
  18307. this._selectTargetMap = S(t || [], function(t, e) {
  18308. return t.set(e.name, e),
  18309. t
  18310. }, Q())
  18311. },
  18312. select: function(t, e) {
  18313. var i = null != e ? this._targetList[e] : this._selectTargetMap.get(t);
  18314. "single" === this.get("selectedMode") && this._selectTargetMap.each(function(t) {
  18315. t.selected = !1
  18316. }),
  18317. i && (i.selected = !0)
  18318. },
  18319. unSelect: function(t, e) {
  18320. var i = null != e ? this._targetList[e] : this._selectTargetMap.get(t);
  18321. i && (i.selected = !1)
  18322. },
  18323. toggleSelected: function(t, e) {
  18324. var i = null != e ? this._targetList[e] : this._selectTargetMap.get(t);
  18325. if (null != i)
  18326. return this[i.selected ? "unSelect" : "select"](t, e),
  18327. i.selected
  18328. },
  18329. isSelected: function(t, e) {
  18330. var i = null != e ? this._targetList[e] : this._selectTargetMap.get(t);
  18331. return i && i.selected
  18332. }
  18333. };
  18334. function qv(i, e) {
  18335. this.getAllNames = function() {
  18336. var t = e();
  18337. return t.mapArray(t.getName)
  18338. }
  18339. ,
  18340. this.containName = function(t) {
  18341. return 0 <= e().indexOfName(t)
  18342. }
  18343. ,
  18344. this.indexOfName = function(t) {
  18345. return i().indexOfName(t)
  18346. }
  18347. ,
  18348. this.getItemVisual = function(t, e) {
  18349. return i().getItemVisual(t, e)
  18350. }
  18351. }
  18352. var Kv = Df({
  18353. type: "series.pie",
  18354. init: function(t) {
  18355. Kv.superApply(this, "init", arguments),
  18356. this.legendVisualProvider = new qv(A(this.getData, this),A(this.getRawData, this)),
  18357. this.updateSelectedMap(this._createSelectableList()),
  18358. this._defaultLabelLine(t)
  18359. },
  18360. mergeOption: function(t) {
  18361. Kv.superCall(this, "mergeOption", t),
  18362. this.updateSelectedMap(this._createSelectableList())
  18363. },
  18364. getInitialData: function(t, e) {
  18365. return Yv(this, {
  18366. coordDimensions: ["value"],
  18367. encodeDefaulter: T(Ju, this)
  18368. })
  18369. },
  18370. _createSelectableList: function() {
  18371. for (var t = this.getRawData(), e = t.mapDimension("value"), i = [], n = 0, o = t.count(); n < o; n++)
  18372. i.push({
  18373. name: t.getName(n),
  18374. value: t.get(e, n),
  18375. selected: Zh(t, n, "selected")
  18376. });
  18377. return i
  18378. },
  18379. getDataParams: function(t) {
  18380. var e = this.getData()
  18381. , i = Kv.superCall(this, "getDataParams", t)
  18382. , n = [];
  18383. return e.each(e.mapDimension("value"), function(t) {
  18384. n.push(t)
  18385. }),
  18386. i.percent = Wl(n, t, e.hostModel.get("percentPrecision")),
  18387. i.$vars.push("percent"),
  18388. i
  18389. },
  18390. _defaultLabelLine: function(t) {
  18391. Go(t, "labelLine", ["show"]);
  18392. var e = t.labelLine
  18393. , i = t.emphasis.labelLine;
  18394. e.show = e.show && t.label.show,
  18395. i.show = i.show && t.emphasis.label.show
  18396. },
  18397. defaultOption: {
  18398. zlevel: 0,
  18399. z: 2,
  18400. legendHoverLink: !0,
  18401. hoverAnimation: !0,
  18402. center: ["50%", "50%"],
  18403. radius: [0, "75%"],
  18404. clockwise: !0,
  18405. startAngle: 90,
  18406. minAngle: 0,
  18407. minShowLabelAngle: 0,
  18408. selectedOffset: 10,
  18409. hoverOffset: 10,
  18410. avoidLabelOverlap: !0,
  18411. percentPrecision: 2,
  18412. stillShowZeroSum: !0,
  18413. left: 0,
  18414. top: 0,
  18415. right: 0,
  18416. bottom: 0,
  18417. width: null,
  18418. height: null,
  18419. label: {
  18420. rotate: !1,
  18421. show: !0,
  18422. position: "outer",
  18423. alignTo: "none",
  18424. margin: "25%",
  18425. bleedMargin: 10,
  18426. distanceToLabelLine: 5
  18427. },
  18428. labelLine: {
  18429. show: !0,
  18430. length: 15,
  18431. length2: 15,
  18432. smooth: !1,
  18433. lineStyle: {
  18434. width: 1,
  18435. type: "solid"
  18436. }
  18437. },
  18438. itemStyle: {
  18439. borderWidth: 1
  18440. },
  18441. animationType: "expansion",
  18442. animationTypeUpdate: "transition",
  18443. animationEasing: "cubicOut"
  18444. }
  18445. });
  18446. function $v(t, e, i, n) {
  18447. var o = e.getData()
  18448. , a = this.dataIndex
  18449. , r = o.getName(a)
  18450. , s = e.get("selectedOffset");
  18451. n.dispatchAction({
  18452. type: "pieToggleSelect",
  18453. from: t,
  18454. name: r,
  18455. seriesId: e.id
  18456. }),
  18457. o.each(function(t) {
  18458. Jv(o.getItemGraphicEl(t), o.getItemLayout(t), e.isSelected(o.getName(t)), s, i)
  18459. })
  18460. }
  18461. function Jv(t, e, i, n, o) {
  18462. var a = (e.startAngle + e.endAngle) / 2
  18463. , r = i ? n : 0
  18464. , s = [Math.cos(a) * r, Math.sin(a) * r];
  18465. o ? t.animate().when(200, {
  18466. position: s
  18467. }).start("bounceOut") : t.attr("position", s)
  18468. }
  18469. function Qv(t, e) {
  18470. Ci.call(this);
  18471. var i = new qr({
  18472. z2: 2
  18473. })
  18474. , n = new ts
  18475. , o = new Ur;
  18476. this.add(i),
  18477. this.add(n),
  18478. this.add(o),
  18479. this.updateData(t, e, !0)
  18480. }
  18481. b(Kv, jv);
  18482. var ty = Qv.prototype;
  18483. ty.updateData = function(t, e, i) {
  18484. var n = this.childAt(0)
  18485. , o = this.childAt(1)
  18486. , a = this.childAt(2)
  18487. , r = t.hostModel
  18488. , s = t.getItemModel(e)
  18489. , l = t.getItemLayout(e)
  18490. , u = P({}, l);
  18491. u.label = null;
  18492. var h = r.getShallow("animationTypeUpdate");
  18493. i ? (n.setShape(u),
  18494. "scale" === r.getShallow("animationType") ? (n.shape.r = l.r0,
  18495. dl(n, {
  18496. shape: {
  18497. r: l.r
  18498. }
  18499. }, r, e)) : (n.shape.endAngle = l.startAngle,
  18500. cl(n, {
  18501. shape: {
  18502. endAngle: l.endAngle
  18503. }
  18504. }, r, e))) : "expansion" === h ? n.setShape(u) : cl(n, {
  18505. shape: u
  18506. }, r, e);
  18507. var c = t.getItemVisual(e, "color");
  18508. n.useStyle(D({
  18509. lineJoin: "bevel",
  18510. fill: c
  18511. }, s.getModel("itemStyle").getItemStyle())),
  18512. n.hoverStyle = s.getModel("emphasis.itemStyle").getItemStyle();
  18513. var d = s.getShallow("cursor");
  18514. d && n.attr("cursor", d),
  18515. Jv(this, t.getItemLayout(e), r.isSelected(t.getName(e)), r.get("selectedOffset"), r.get("animation"));
  18516. var f = !i && "transition" === h;
  18517. this._updateLabel(t, e, f),
  18518. this.highDownOnUpdate = r.get("silent") ? null : function(t, e) {
  18519. var i = r.isAnimationEnabled() && s.get("hoverAnimation");
  18520. "emphasis" === e ? (o.ignore = o.hoverIgnore,
  18521. a.ignore = a.hoverIgnore,
  18522. i && (n.stopAnimation(!0),
  18523. n.animateTo({
  18524. shape: {
  18525. r: l.r + r.get("hoverOffset")
  18526. }
  18527. }, 300, "elasticOut"))) : (o.ignore = o.normalIgnore,
  18528. a.ignore = a.normalIgnore,
  18529. i && (n.stopAnimation(!0),
  18530. n.animateTo({
  18531. shape: {
  18532. r: l.r
  18533. }
  18534. }, 300, "elasticOut")))
  18535. }
  18536. ,
  18537. $s(this)
  18538. }
  18539. ,
  18540. ty._updateLabel = function(t, e, i) {
  18541. var n = this.childAt(1)
  18542. , o = this.childAt(2)
  18543. , a = t.hostModel
  18544. , r = t.getItemModel(e)
  18545. , s = t.getItemLayout(e).label
  18546. , l = t.getItemVisual(e, "color");
  18547. if (!s || isNaN(s.x) || isNaN(s.y))
  18548. o.ignore = o.normalIgnore = o.hoverIgnore = n.ignore = n.normalIgnore = n.hoverIgnore = !0;
  18549. else {
  18550. var u = {
  18551. points: s.linePoints || [[s.x, s.y], [s.x, s.y], [s.x, s.y]]
  18552. }
  18553. , h = {
  18554. x: s.x,
  18555. y: s.y
  18556. };
  18557. i ? (cl(n, {
  18558. shape: u
  18559. }, a, e),
  18560. cl(o, {
  18561. style: h
  18562. }, a, e)) : (n.attr({
  18563. shape: u
  18564. }),
  18565. o.attr({
  18566. style: h
  18567. })),
  18568. o.attr({
  18569. rotation: s.rotation,
  18570. origin: [s.x, s.y],
  18571. z2: 10
  18572. });
  18573. var c = r.getModel("label")
  18574. , d = r.getModel("emphasis.label")
  18575. , f = r.getModel("labelLine")
  18576. , p = r.getModel("emphasis.labelLine");
  18577. l = t.getItemVisual(e, "color");
  18578. el(o.style, o.hoverStyle = {}, c, d, {
  18579. labelFetcher: t.hostModel,
  18580. labelDataIndex: e,
  18581. defaultText: s.text,
  18582. autoColor: l,
  18583. useInsideStyle: !!s.inside
  18584. }, {
  18585. textAlign: s.textAlign,
  18586. textVerticalAlign: s.verticalAlign,
  18587. opacity: t.getItemVisual(e, "opacity")
  18588. }),
  18589. o.ignore = o.normalIgnore = !c.get("show"),
  18590. o.hoverIgnore = !d.get("show"),
  18591. n.ignore = n.normalIgnore = !f.get("show"),
  18592. n.hoverIgnore = !p.get("show"),
  18593. n.setStyle({
  18594. stroke: l,
  18595. opacity: t.getItemVisual(e, "opacity")
  18596. }),
  18597. n.setStyle(f.getModel("lineStyle").getLineStyle()),
  18598. n.hoverStyle = p.getModel("lineStyle").getLineStyle();
  18599. var g = f.get("smooth");
  18600. g && !0 === g && (g = .4),
  18601. n.setShape({
  18602. smooth: g
  18603. })
  18604. }
  18605. }
  18606. ,
  18607. w(Qv, Ci);
  18608. function ey(i, t) {
  18609. E(t, function(a) {
  18610. a.update = "updateView",
  18611. _f(a, function(t, e) {
  18612. var o = {};
  18613. return e.eachComponent({
  18614. mainType: "series",
  18615. subType: i,
  18616. query: t
  18617. }, function(i) {
  18618. i[a.method] && i[a.method](t.name, t.dataIndex);
  18619. var n = i.getData();
  18620. n.each(function(t) {
  18621. var e = n.getName(t);
  18622. o[e] = i.isSelected(e) || !1
  18623. })
  18624. }),
  18625. {
  18626. name: t.name,
  18627. selected: o,
  18628. seriesId: t.seriesId
  18629. }
  18630. })
  18631. })
  18632. }
  18633. function iy(n) {
  18634. return {
  18635. getTargetSeries: function(t) {
  18636. var e = {}
  18637. , i = Q();
  18638. return t.eachSeriesByType(n, function(t) {
  18639. t.__paletteScope = e,
  18640. i.set(t.uid, t)
  18641. }),
  18642. i
  18643. },
  18644. reset: function(s, t) {
  18645. var l = s.getRawData()
  18646. , u = {}
  18647. , h = s.getData();
  18648. h.each(function(t) {
  18649. var e = h.getRawIndex(t);
  18650. u[e] = t
  18651. }),
  18652. l.each(function(t) {
  18653. var e, i = u[t], n = null != i && h.getItemVisual(i, "color", !0), o = null != i && h.getItemVisual(i, "borderColor", !0);
  18654. if (n && o || (e = l.getItemModel(t)),
  18655. !n) {
  18656. var a = e.get("itemStyle.color") || s.getColorFromPalette(l.getName(t) || t + "", s.__paletteScope, l.count());
  18657. null != i && h.setItemVisual(i, "color", a)
  18658. }
  18659. if (!o) {
  18660. var r = e.get("itemStyle.borderColor");
  18661. null != i && h.setItemVisual(i, "borderColor", r)
  18662. }
  18663. })
  18664. }
  18665. }
  18666. }
  18667. _c.extend({
  18668. type: "pie",
  18669. init: function() {
  18670. var t = new Ci;
  18671. this._sectorGroup = t
  18672. },
  18673. render: function(t, e, i, n) {
  18674. if (!n || n.from !== this.uid) {
  18675. var o = t.getData()
  18676. , a = this._data
  18677. , r = this.group
  18678. , s = e.get("animation")
  18679. , l = !a
  18680. , u = t.get("animationType")
  18681. , h = t.get("animationTypeUpdate")
  18682. , c = T($v, this.uid, t, s, i)
  18683. , d = t.get("selectedMode");
  18684. if (o.diff(a).add(function(t) {
  18685. var e = new Qv(o,t);
  18686. l && "scale" !== u && e.eachChild(function(t) {
  18687. t.stopAnimation(!0)
  18688. }),
  18689. d && e.on("click", c),
  18690. o.setItemGraphicEl(t, e),
  18691. r.add(e)
  18692. }).update(function(t, e) {
  18693. var i = a.getItemGraphicEl(e);
  18694. l || "transition" === h || i.eachChild(function(t) {
  18695. t.stopAnimation(!0)
  18696. }),
  18697. i.updateData(o, t),
  18698. i.off("click"),
  18699. d && i.on("click", c),
  18700. r.add(i),
  18701. o.setItemGraphicEl(t, i)
  18702. }).remove(function(t) {
  18703. var e = a.getItemGraphicEl(t);
  18704. r.remove(e)
  18705. }).execute(),
  18706. s && 0 < o.count() && (l ? "scale" !== u : "transition" !== h)) {
  18707. for (var f = o.getItemLayout(0), p = 1; isNaN(f.startAngle) && p < o.count(); ++p)
  18708. f = o.getItemLayout(p);
  18709. var g = Math.max(i.getWidth(), i.getHeight()) / 2
  18710. , m = A(r.removeClipPath, r);
  18711. r.setClipPath(this._createClipPath(f.cx, f.cy, g, f.startAngle, f.clockwise, m, t, l))
  18712. } else
  18713. r.removeClipPath();
  18714. this._data = o
  18715. }
  18716. },
  18717. dispose: function() {},
  18718. _createClipPath: function(t, e, i, n, o, a, r, s) {
  18719. var l = new qr({
  18720. shape: {
  18721. cx: t,
  18722. cy: e,
  18723. r0: 0,
  18724. r: i,
  18725. startAngle: n,
  18726. endAngle: n,
  18727. clockwise: o
  18728. }
  18729. });
  18730. return (s ? dl : cl)(l, {
  18731. shape: {
  18732. endAngle: n + (o ? 1 : -1) * Math.PI * 2
  18733. }
  18734. }, r, a),
  18735. l
  18736. },
  18737. containPoint: function(t, e) {
  18738. var i = e.getData().getItemLayout(0);
  18739. if (i) {
  18740. var n = t[0] - i.cx
  18741. , o = t[1] - i.cy
  18742. , a = Math.sqrt(n * n + o * o);
  18743. return a <= i.r && a >= i.r0
  18744. }
  18745. }
  18746. });
  18747. var ny = Math.PI / 180;
  18748. function oy(o, t, e, i, n, a, r, s, l, u) {
  18749. function h(t, e, i) {
  18750. for (var n = t; n < e && !(o[n].y + i > l + r); n++)
  18751. if (o[n].y += i,
  18752. t < n && n + 1 < e && o[n + 1].y > o[n].y + o[n].height)
  18753. return void c(n, i / 2);
  18754. c(e - 1, i / 2)
  18755. }
  18756. function c(t, e) {
  18757. for (var i = t; 0 <= i && !(o[i].y - e < l) && (o[i].y -= e,
  18758. !(0 < i && o[i].y > o[i - 1].y + o[i - 1].height)); i--)
  18759. ;
  18760. }
  18761. function d(t, e, i, n, o, a) {
  18762. for (var r = e ? Number.MAX_VALUE : 0, s = 0, l = t.length; s < l; s++)
  18763. if ("none" === t[s].labelAlignTo) {
  18764. var u = Math.abs(t[s].y - n)
  18765. , h = t[s].len
  18766. , c = t[s].len2
  18767. , d = u < o + h ? Math.sqrt((o + h + c) * (o + h + c) - u * u) : Math.abs(t[s].x - i);
  18768. e && r <= d && (d = r - 10),
  18769. !e && d <= r && (d = r + 10),
  18770. t[s].x = i + d * a,
  18771. r = d
  18772. }
  18773. }
  18774. o.sort(function(t, e) {
  18775. return t.y - e.y
  18776. });
  18777. for (var f, p = 0, g = o.length, m = [], v = [], y = 0; y < g; y++) {
  18778. if ("outer" === o[y].position && "labelLine" === o[y].labelAlignTo) {
  18779. var x = o[y].x - u;
  18780. o[y].linePoints[1][0] += x,
  18781. o[y].x = u
  18782. }
  18783. (f = o[y].y - p) < 0 && h(y, g, -f),
  18784. p = o[y].y + o[y].height
  18785. }
  18786. r - p < 0 && c(g - 1, p - r);
  18787. for (y = 0; y < g; y++)
  18788. o[y].y >= e ? v.push(o[y]) : m.push(o[y]);
  18789. d(m, !1, t, e, i, n),
  18790. d(v, !0, t, e, i, n)
  18791. }
  18792. function ay(t) {
  18793. return "center" === t.position
  18794. }
  18795. function ry(L, k, P, t, N, e) {
  18796. var O, E, R = L.getData(), z = [], B = !1, V = (L.get("minShowLabelAngle") || 0) * ny;
  18797. R.each(function(t) {
  18798. var e = R.getItemLayout(t)
  18799. , i = R.getItemModel(t)
  18800. , n = i.getModel("label")
  18801. , o = n.get("position") || i.get("emphasis.label.position")
  18802. , a = n.get("distanceToLabelLine")
  18803. , r = n.get("alignTo")
  18804. , s = Rl(n.get("margin"), P)
  18805. , l = n.get("bleedMargin")
  18806. , u = n.getFont()
  18807. , h = i.getModel("labelLine")
  18808. , c = h.get("length");
  18809. c = Rl(c, P);
  18810. var d = h.get("length2");
  18811. if (d = Rl(d, P),
  18812. !(e.angle < V)) {
  18813. var f, p, g, m, v = (e.startAngle + e.endAngle) / 2, y = Math.cos(v), x = Math.sin(v);
  18814. O = e.cx,
  18815. E = e.cy;
  18816. var _, w = L.getFormattedLabel(t, "normal") || R.getName(t), b = gn(w, u, m, "top"), S = "inside" === o || "inner" === o;
  18817. if ("center" === o)
  18818. f = e.cx,
  18819. p = e.cy,
  18820. m = "center";
  18821. else {
  18822. var M = (S ? (e.r + e.r0) / 2 * y : e.r * y) + O
  18823. , I = (S ? (e.r + e.r0) / 2 * x : e.r * x) + E;
  18824. if (f = M + 3 * y,
  18825. p = I + 3 * x,
  18826. !S) {
  18827. var T = M + y * (c + k - e.r)
  18828. , A = I + x * (c + k - e.r)
  18829. , D = T + (y < 0 ? -1 : 1) * d;
  18830. f = "edge" === r ? y < 0 ? N + s : N + P - s : D + (y < 0 ? -a : a),
  18831. g = [[M, I], [T, A], [D, p = A]]
  18832. }
  18833. m = S ? "center" : "edge" === r ? 0 < y ? "right" : "left" : 0 < y ? "left" : "right"
  18834. }
  18835. var C = n.get("rotate");
  18836. _ = "number" == typeof C ? C * (Math.PI / 180) : C ? y < 0 ? -v + Math.PI : -v : 0,
  18837. B = !!_,
  18838. e.label = {
  18839. x: f,
  18840. y: p,
  18841. position: o,
  18842. height: b.height,
  18843. len: c,
  18844. len2: d,
  18845. linePoints: g,
  18846. textAlign: m,
  18847. verticalAlign: "middle",
  18848. rotation: _,
  18849. inside: S,
  18850. labelDistance: a,
  18851. labelAlignTo: r,
  18852. labelMargin: s,
  18853. bleedMargin: l,
  18854. textRect: b,
  18855. text: w,
  18856. font: u
  18857. },
  18858. S || z.push(e.label)
  18859. }
  18860. }),
  18861. !B && L.get("avoidLabelOverlap") && function(t, e, i, n, o, a, r, s) {
  18862. for (var l = [], u = [], h = Number.MAX_VALUE, c = -Number.MAX_VALUE, d = 0; d < t.length; d++)
  18863. ay(t[d]) || (t[d].x < e ? (h = Math.min(h, t[d].x),
  18864. l.push(t[d])) : (c = Math.max(c, t[d].x),
  18865. u.push(t[d])));
  18866. for (oy(u, e, i, n, 1, 0, a, 0, s, c),
  18867. oy(l, e, i, n, -1, 0, a, 0, s, h),
  18868. d = 0; d < t.length; d++) {
  18869. var f = t[d];
  18870. if (!ay(f)) {
  18871. var p = f.linePoints;
  18872. if (p) {
  18873. var g, m = "edge" === f.labelAlignTo, v = f.textRect.width;
  18874. (g = m ? f.x < e ? p[2][0] - f.labelDistance - r - f.labelMargin : r + o - f.labelMargin - p[2][0] - f.labelDistance : f.x < e ? f.x - r - f.bleedMargin : r + o - f.x - f.bleedMargin) < f.textRect.width && (f.text = xn(f.text, g, f.font),
  18875. "edge" === f.labelAlignTo && (v = pn(f.text, f.font)));
  18876. var y = p[1][0] - p[2][0];
  18877. m ? f.x < e ? p[2][0] = r + f.labelMargin + v + f.labelDistance : p[2][0] = r + o - f.labelMargin - v - f.labelDistance : (f.x < e ? p[2][0] = f.x + f.labelDistance : p[2][0] = f.x - f.labelDistance,
  18878. p[1][0] = p[2][0] + y),
  18879. p[1][1] = p[2][1] = f.y
  18880. }
  18881. }
  18882. }
  18883. }(z, O, E, k, P, t, N, e)
  18884. }
  18885. var sy = 2 * Math.PI
  18886. , ly = Math.PI / 180;
  18887. function uy(t) {
  18888. return {
  18889. seriesType: t,
  18890. reset: function(t, e) {
  18891. var n = e.findComponents({
  18892. mainType: "legend"
  18893. });
  18894. if (n && n.length) {
  18895. var o = t.getData();
  18896. o.filterSelf(function(t) {
  18897. for (var e = o.getName(t), i = 0; i < n.length; i++)
  18898. if (!n[i].isSelected(e))
  18899. return !1;
  18900. return !0
  18901. })
  18902. }
  18903. }
  18904. }
  18905. }
  18906. ey("pie", [{
  18907. type: "pieToggleSelect",
  18908. event: "pieselectchanged",
  18909. method: "toggleSelected"
  18910. }, {
  18911. type: "pieSelect",
  18912. event: "pieselected",
  18913. method: "select"
  18914. }, {
  18915. type: "pieUnSelect",
  18916. event: "pieunselected",
  18917. method: "unSelect"
  18918. }]),
  18919. Sf(iy("pie")),
  18920. bf(T(function(t, e, A, i) {
  18921. e.eachSeriesByType(t, function(t) {
  18922. var o = t.getData()
  18923. , e = o.mapDimension("value")
  18924. , a = function(t, e) {
  18925. return bu(t.getBoxLayoutParams(), {
  18926. width: e.getWidth(),
  18927. height: e.getHeight()
  18928. })
  18929. }(t, A)
  18930. , i = t.get("center")
  18931. , n = t.get("radius");
  18932. L(n) || (n = [0, n]),
  18933. L(i) || (i = [i, i]);
  18934. var r = Rl(a.width, A.getWidth())
  18935. , s = Rl(a.height, A.getHeight())
  18936. , l = Math.min(r, s)
  18937. , u = Rl(i[0], r) + a.x
  18938. , h = Rl(i[1], s) + a.y
  18939. , c = Rl(n[0], l / 2)
  18940. , d = Rl(n[1], l / 2)
  18941. , f = -t.get("startAngle") * ly
  18942. , p = t.get("minAngle") * ly
  18943. , g = 0;
  18944. o.each(e, function(t) {
  18945. isNaN(t) || g++
  18946. });
  18947. var m = o.getSum(e)
  18948. , v = Math.PI / (m || g) * 2
  18949. , y = t.get("clockwise")
  18950. , x = t.get("roseType")
  18951. , _ = t.get("stillShowZeroSum")
  18952. , w = o.getDataExtent(e);
  18953. w[0] = 0;
  18954. var b = sy
  18955. , S = 0
  18956. , M = f
  18957. , I = y ? 1 : -1;
  18958. if (o.each(e, function(t, e) {
  18959. var i;
  18960. if (isNaN(t))
  18961. o.setItemLayout(e, {
  18962. angle: NaN,
  18963. startAngle: NaN,
  18964. endAngle: NaN,
  18965. clockwise: y,
  18966. cx: u,
  18967. cy: h,
  18968. r0: c,
  18969. r: x ? NaN : d,
  18970. viewRect: a
  18971. });
  18972. else {
  18973. (i = "area" !== x ? 0 === m && _ ? v : t * v : sy / g) < p ? b -= i = p : S += t;
  18974. var n = M + I * i;
  18975. o.setItemLayout(e, {
  18976. angle: i,
  18977. startAngle: M,
  18978. endAngle: n,
  18979. clockwise: y,
  18980. cx: u,
  18981. cy: h,
  18982. r0: c,
  18983. r: x ? El(t, w, [c, d]) : d,
  18984. viewRect: a
  18985. }),
  18986. M = n
  18987. }
  18988. }),
  18989. b < sy && g)
  18990. if (b <= .001) {
  18991. var T = sy / g;
  18992. o.each(e, function(t, e) {
  18993. if (!isNaN(t)) {
  18994. var i = o.getItemLayout(e);
  18995. i.angle = T,
  18996. i.startAngle = f + I * e * T,
  18997. i.endAngle = f + I * (e + 1) * T
  18998. }
  18999. })
  19000. } else
  19001. v = b / S,
  19002. M = f,
  19003. o.each(e, function(t, e) {
  19004. if (!isNaN(t)) {
  19005. var i = o.getItemLayout(e)
  19006. , n = i.angle === p ? p : t * v;
  19007. i.startAngle = M,
  19008. i.endAngle = M + I * n,
  19009. M += I * n
  19010. }
  19011. });
  19012. ry(t, d, a.width, a.height, a.x, a.y)
  19013. })
  19014. }, "pie")),
  19015. xf(uy("pie")),
  19016. sc.extend({
  19017. type: "series.scatter",
  19018. dependencies: ["grid", "polar", "geo", "singleAxis", "calendar"],
  19019. getInitialData: function(t, e) {
  19020. return gp(this.getSource(), this, {
  19021. useEncodeDefaulter: !0
  19022. })
  19023. },
  19024. brushSelector: "point",
  19025. getProgressive: function() {
  19026. var t = this.option.progressive;
  19027. return null == t ? this.option.large ? 5e3 : this.get("progressive") : t
  19028. },
  19029. getProgressiveThreshold: function() {
  19030. var t = this.option.progressiveThreshold;
  19031. return null == t ? this.option.large ? 1e4 : this.get("progressiveThreshold") : t
  19032. },
  19033. defaultOption: {
  19034. coordinateSystem: "cartesian2d",
  19035. zlevel: 0,
  19036. z: 2,
  19037. legendHoverLink: !0,
  19038. hoverAnimation: !0,
  19039. symbolSize: 10,
  19040. large: !1,
  19041. largeThreshold: 2e3,
  19042. itemStyle: {
  19043. opacity: .8
  19044. },
  19045. clip: !0
  19046. }
  19047. });
  19048. var hy = Cs({
  19049. shape: {
  19050. points: null
  19051. },
  19052. symbolProxy: null,
  19053. softClipShape: null,
  19054. buildPath: function(t, e) {
  19055. var i = e.points
  19056. , n = e.size
  19057. , o = this.symbolProxy
  19058. , a = o.shape;
  19059. if (!((t.getContext ? t.getContext() : t) && n[0] < 4))
  19060. for (var r = 0; r < i.length; ) {
  19061. var s = i[r++]
  19062. , l = i[r++];
  19063. isNaN(s) || isNaN(l) || this.softClipShape && !this.softClipShape.contain(s, l) || (a.x = s - n[0] / 2,
  19064. a.y = l - n[1] / 2,
  19065. a.width = n[0],
  19066. a.height = n[1],
  19067. o.buildPath(t, a, !0))
  19068. }
  19069. },
  19070. afterBrush: function(t) {
  19071. var e = this.shape
  19072. , i = e.points
  19073. , n = e.size;
  19074. if (n[0] < 4) {
  19075. this.setTransform(t);
  19076. for (var o = 0; o < i.length; ) {
  19077. var a = i[o++]
  19078. , r = i[o++];
  19079. isNaN(a) || isNaN(r) || this.softClipShape && !this.softClipShape.contain(a, r) || t.fillRect(a - n[0] / 2, r - n[1] / 2, n[0], n[1])
  19080. }
  19081. this.restoreTransform(t)
  19082. }
  19083. },
  19084. findDataIndex: function(t, e) {
  19085. for (var i = this.shape, n = i.points, o = i.size, a = Math.max(o[0], 4), r = Math.max(o[1], 4), s = n.length / 2 - 1; 0 <= s; s--) {
  19086. var l = 2 * s
  19087. , u = n[l] - a / 2
  19088. , h = n[1 + l] - r / 2;
  19089. if (u <= t && h <= e && t <= u + a && e <= h + r)
  19090. return s
  19091. }
  19092. return -1
  19093. }
  19094. });
  19095. function cy() {
  19096. this.group = new Ci
  19097. }
  19098. var dy = cy.prototype;
  19099. function fy(t, e, i) {
  19100. Gg.call(this, t, e, i),
  19101. this.type = "value",
  19102. this.angle = 0,
  19103. this.name = "",
  19104. this.model
  19105. }
  19106. function py(t, e, i) {
  19107. this._model = t,
  19108. this.dimensions = [],
  19109. this._indicatorAxes = O(t.getIndicatorModels(), function(t, e) {
  19110. var i = "indicator_" + e
  19111. , n = new fy(i,"log" === t.get("axisType") ? new ng : new Dp);
  19112. return n.name = t.get("name"),
  19113. (n.model = t).axis = n,
  19114. this.dimensions.push(i),
  19115. n
  19116. }, this),
  19117. this.resize(t, i),
  19118. this.cx,
  19119. this.cy,
  19120. this.r,
  19121. this.r0,
  19122. this.startAngle
  19123. }
  19124. dy.isPersistent = function() {
  19125. return !this._incremental
  19126. }
  19127. ,
  19128. dy.updateData = function(t, e) {
  19129. this.group.removeAll();
  19130. var i = new hy({
  19131. rectHover: !0,
  19132. cursor: "default"
  19133. });
  19134. i.setShape({
  19135. points: t.getLayout("symbolPoints")
  19136. }),
  19137. this._setCommon(i, t, !1, e),
  19138. this.group.add(i),
  19139. this._incremental = null
  19140. }
  19141. ,
  19142. dy.updateLayout = function(t) {
  19143. if (!this._incremental) {
  19144. var n = t.getLayout("symbolPoints");
  19145. this.group.eachChild(function(t) {
  19146. if (null != t.startIndex) {
  19147. var e = 2 * (t.endIndex - t.startIndex)
  19148. , i = 4 * t.startIndex * 2;
  19149. n = new Float32Array(n.buffer,i,e)
  19150. }
  19151. t.setShape("points", n)
  19152. })
  19153. }
  19154. }
  19155. ,
  19156. dy.incrementalPrepareUpdate = function(t) {
  19157. this.group.removeAll(),
  19158. this._clearIncremental(),
  19159. 2e6 < t.count() ? (this._incremental || (this._incremental = new vs({
  19160. silent: !0
  19161. })),
  19162. this.group.add(this._incremental)) : this._incremental = null
  19163. }
  19164. ,
  19165. dy.incrementalUpdate = function(t, e, i) {
  19166. var n;
  19167. this._incremental ? (n = new hy,
  19168. this._incremental.addDisplayable(n, !0)) : ((n = new hy({
  19169. rectHover: !0,
  19170. cursor: "default",
  19171. startIndex: t.start,
  19172. endIndex: t.end
  19173. })).incremental = !0,
  19174. this.group.add(n)),
  19175. n.setShape({
  19176. points: e.getLayout("symbolPoints")
  19177. }),
  19178. this._setCommon(n, e, !!this._incremental, i)
  19179. }
  19180. ,
  19181. dy._setCommon = function(i, t, e, n) {
  19182. var o = t.hostModel;
  19183. n = n || {};
  19184. var a = t.getVisual("symbolSize");
  19185. i.setShape("size", a instanceof Array ? a : [a, a]),
  19186. i.softClipShape = n.clipShape || null,
  19187. i.symbolProxy = wg(t.getVisual("symbol"), 0, 0, 0, 0),
  19188. i.setColor = i.symbolProxy.setColor;
  19189. var r = i.shape.size[0] < 4;
  19190. i.useStyle(o.getModel("itemStyle").getItemStyle(r ? ["color", "shadowBlur", "shadowColor"] : ["color"]));
  19191. var s = t.getVisual("color");
  19192. s && i.setColor(s),
  19193. e || (i.seriesIndex = o.seriesIndex,
  19194. i.on("mousemove", function(t) {
  19195. i.dataIndex = null;
  19196. var e = i.findDataIndex(t.offsetX, t.offsetY);
  19197. 0 <= e && (i.dataIndex = e + (i.startIndex || 0))
  19198. }))
  19199. }
  19200. ,
  19201. dy.remove = function() {
  19202. this._clearIncremental(),
  19203. this._incremental = null,
  19204. this.group.removeAll()
  19205. }
  19206. ,
  19207. dy._clearIncremental = function() {
  19208. var t = this._incremental;
  19209. t && t.clearDisplaybles()
  19210. }
  19211. ,
  19212. Cf({
  19213. type: "scatter",
  19214. render: function(t, e, i) {
  19215. var n = t.getData();
  19216. this._updateSymbolDraw(n, t).updateData(n, {
  19217. clipShape: this._getClipShape(t)
  19218. }),
  19219. this._finished = !0
  19220. },
  19221. incrementalPrepareRender: function(t, e, i) {
  19222. var n = t.getData();
  19223. this._updateSymbolDraw(n, t).incrementalPrepareUpdate(n),
  19224. this._finished = !1
  19225. },
  19226. incrementalRender: function(t, e, i) {
  19227. this._symbolDraw.incrementalUpdate(t, e.getData(), {
  19228. clipShape: this._getClipShape(e)
  19229. }),
  19230. this._finished = t.end === e.getData().count()
  19231. },
  19232. updateTransform: function(t, e, i) {
  19233. var n = t.getData();
  19234. if (this.group.dirty(),
  19235. !this._finished || 1e4 < n.count() || !this._symbolDraw.isPersistent())
  19236. return {
  19237. update: !0
  19238. };
  19239. var o = km().reset(t);
  19240. o.progress && o.progress({
  19241. start: 0,
  19242. end: n.count()
  19243. }, n),
  19244. this._symbolDraw.updateLayout(n)
  19245. },
  19246. _getClipShape: function(t) {
  19247. var e = t.coordinateSystem
  19248. , i = e && e.getArea && e.getArea();
  19249. return t.get("clip", !0) ? i : null
  19250. },
  19251. _updateSymbolDraw: function(t, e) {
  19252. var i = this._symbolDraw
  19253. , n = e.pipelineContext.large;
  19254. return i && n === this._isLargeDraw || (i && i.remove(),
  19255. i = this._symbolDraw = n ? new cy : new im,
  19256. this._isLargeDraw = n,
  19257. this.group.removeAll()),
  19258. this.group.add(i.group),
  19259. i
  19260. },
  19261. remove: function(t, e) {
  19262. this._symbolDraw && this._symbolDraw.remove(!0),
  19263. this._symbolDraw = null
  19264. },
  19265. dispose: function() {}
  19266. }),
  19267. Sf(Lm("scatter", "circle")),
  19268. bf(km("scatter")),
  19269. w(fy, Gg),
  19270. py.prototype.getIndicatorAxes = function() {
  19271. return this._indicatorAxes
  19272. }
  19273. ,
  19274. py.prototype.dataToPoint = function(t, e) {
  19275. var i = this._indicatorAxes[e];
  19276. return this.coordToPoint(i.dataToCoord(t), e)
  19277. }
  19278. ,
  19279. py.prototype.coordToPoint = function(t, e) {
  19280. var i = this._indicatorAxes[e].angle;
  19281. return [this.cx + t * Math.cos(i), this.cy - t * Math.sin(i)]
  19282. }
  19283. ,
  19284. py.prototype.pointToData = function(t) {
  19285. var e = t[0] - this.cx
  19286. , i = t[1] - this.cy
  19287. , n = Math.sqrt(e * e + i * i);
  19288. e /= n,
  19289. i /= n;
  19290. for (var o, a = Math.atan2(-i, e), r = 1 / 0, s = -1, l = 0; l < this._indicatorAxes.length; l++) {
  19291. var u = this._indicatorAxes[l]
  19292. , h = Math.abs(a - u.angle);
  19293. h < r && (o = u,
  19294. s = l,
  19295. r = h)
  19296. }
  19297. return [s, +(o && o.coordToData(n))]
  19298. }
  19299. ,
  19300. py.prototype.resize = function(t, e) {
  19301. var i = t.get("center")
  19302. , n = e.getWidth()
  19303. , o = e.getHeight()
  19304. , a = Math.min(n, o) / 2;
  19305. this.cx = Rl(i[0], n),
  19306. this.cy = Rl(i[1], o),
  19307. this.startAngle = t.get("startAngle") * Math.PI / 180;
  19308. var r = t.get("radius");
  19309. "string" != typeof r && "number" != typeof r || (r = [0, r]),
  19310. this.r0 = Rl(r[0], a),
  19311. this.r = Rl(r[1], a),
  19312. E(this._indicatorAxes, function(t, e) {
  19313. t.setExtent(this.r0, this.r);
  19314. var i = this.startAngle + e * Math.PI * 2 / this._indicatorAxes.length;
  19315. i = Math.atan2(Math.sin(i), Math.cos(i)),
  19316. t.angle = i
  19317. }, this)
  19318. }
  19319. ,
  19320. py.prototype.update = function(n, t) {
  19321. var o = this._indicatorAxes
  19322. , a = this._model;
  19323. E(o, function(t) {
  19324. t.scale.setExtent(1 / 0, -1 / 0)
  19325. }),
  19326. n.eachSeriesByType("radar", function(t, e) {
  19327. if ("radar" === t.get("coordinateSystem") && n.getComponent("radar", t.get("radarIndex")) === a) {
  19328. var i = t.getData();
  19329. E(o, function(t) {
  19330. t.scale.unionExtentFromData(i, i.mapDimension(t.dim))
  19331. })
  19332. }
  19333. }, this);
  19334. var c = a.get("splitNumber");
  19335. function d(t) {
  19336. var e = Math.pow(10, Math.floor(Math.log(t) / Math.LN10))
  19337. , i = t / e;
  19338. return 2 === i ? i = 5 : i *= 2,
  19339. i * e
  19340. }
  19341. E(o, function(t, e) {
  19342. var i = ag(t.scale, t.model).extent;
  19343. rg(t.scale, t.model);
  19344. var n = t.model
  19345. , o = t.scale
  19346. , a = n.getMin()
  19347. , r = n.getMax()
  19348. , s = o.getInterval();
  19349. if (null != a && null != r)
  19350. o.setExtent(+a, +r),
  19351. o.setInterval((r - a) / c);
  19352. else if (null != a)
  19353. for (; u = a + s * c,
  19354. o.setExtent(+a, u),
  19355. o.setInterval(s),
  19356. s = d(s),
  19357. u < i[1] && isFinite(u) && isFinite(i[1]); )
  19358. ;
  19359. else if (null != r)
  19360. for (; h = r - s * c,
  19361. o.setExtent(h, +r),
  19362. o.setInterval(s),
  19363. s = d(s),
  19364. h > i[0] && isFinite(h) && isFinite(i[0]); )
  19365. ;
  19366. else {
  19367. var l = o.getTicks().length - 1;
  19368. c < l && (s = d(s));
  19369. var u, h = zl((u = Math.ceil(i[1] / s) * s) - s * c);
  19370. o.setExtent(h, u),
  19371. o.setInterval(s)
  19372. }
  19373. })
  19374. }
  19375. ,
  19376. py.dimensions = [],
  19377. py.create = function(i, n) {
  19378. var o = [];
  19379. return i.eachComponent("radar", function(t) {
  19380. var e = new py(t,i,n);
  19381. o.push(e),
  19382. t.coordinateSystem = e
  19383. }),
  19384. i.eachSeriesByType("radar", function(t) {
  19385. "radar" === t.get("coordinateSystem") && (t.coordinateSystem = o[t.get("radarIndex") || 0])
  19386. }),
  19387. o
  19388. }
  19389. ,
  19390. lh.register("radar", py);
  19391. var gy = Vm.valueAxis;
  19392. function my(t, e) {
  19393. return D({
  19394. show: e
  19395. }, t)
  19396. }
  19397. Tf({
  19398. type: "radar",
  19399. optionUpdated: function() {
  19400. var o = this.get("boundaryGap")
  19401. , a = this.get("splitNumber")
  19402. , r = this.get("scale")
  19403. , s = this.get("axisLine")
  19404. , l = this.get("axisTick")
  19405. , u = this.get("axisType")
  19406. , h = this.get("axisLabel")
  19407. , c = this.get("name")
  19408. , d = this.get("name.show")
  19409. , f = this.get("name.formatter")
  19410. , p = this.get("nameGap")
  19411. , g = this.get("triggerEvent")
  19412. , t = O(this.get("indicator") || [], function(t) {
  19413. null != t.max && 0 < t.max && !t.min ? t.min = 0 : null != t.min && t.min < 0 && !t.max && (t.max = 0);
  19414. var e = c;
  19415. if (null != t.color && (e = D({
  19416. color: t.color
  19417. }, c)),
  19418. t = m(k(t), {
  19419. boundaryGap: o,
  19420. splitNumber: a,
  19421. scale: r,
  19422. axisLine: s,
  19423. axisTick: l,
  19424. axisType: u,
  19425. axisLabel: h,
  19426. name: t.text,
  19427. nameLocation: "end",
  19428. nameGap: p,
  19429. nameTextStyle: e,
  19430. triggerEvent: g
  19431. }, !1),
  19432. d || (t.name = ""),
  19433. "string" == typeof f) {
  19434. var i = t.name;
  19435. t.name = f.replace("{value}", null != i ? i : "")
  19436. } else
  19437. "function" == typeof f && (t.name = f(t.name, t));
  19438. var n = P(new Cl(t,null,this.ecModel), dg);
  19439. return n.mainType = "radar",
  19440. n.componentIndex = this.componentIndex,
  19441. n
  19442. }, this);
  19443. this.getIndicatorModels = function() {
  19444. return t
  19445. }
  19446. },
  19447. defaultOption: {
  19448. zlevel: 0,
  19449. z: 0,
  19450. center: ["50%", "50%"],
  19451. radius: "75%",
  19452. startAngle: 90,
  19453. name: {
  19454. show: !0
  19455. },
  19456. boundaryGap: [0, 0],
  19457. splitNumber: 5,
  19458. nameGap: 15,
  19459. scale: !1,
  19460. shape: "polygon",
  19461. axisLine: m({
  19462. lineStyle: {
  19463. color: "#bbb"
  19464. }
  19465. }, gy.axisLine),
  19466. axisLabel: my(gy.axisLabel, !1),
  19467. axisTick: my(gy.axisTick, !1),
  19468. axisType: "interval",
  19469. splitLine: my(gy.splitLine, !0),
  19470. splitArea: my(gy.splitArea, !0),
  19471. indicator: []
  19472. }
  19473. });
  19474. var vy = ["axisLine", "axisTickLabel", "axisName"];
  19475. Af({
  19476. type: "radar",
  19477. render: function(t, e, i) {
  19478. this.group.removeAll(),
  19479. this._buildAxes(t),
  19480. this._buildSplitLineAndArea(t)
  19481. },
  19482. _buildAxes: function(t) {
  19483. var e = t.coordinateSystem;
  19484. E(O(e.getIndicatorAxes(), function(t) {
  19485. return new Qm(t.model,{
  19486. position: [e.cx, e.cy],
  19487. rotation: t.angle,
  19488. labelDirection: -1,
  19489. tickDirection: -1,
  19490. nameDirection: 1
  19491. })
  19492. }), function(t) {
  19493. E(vy, t.add, t),
  19494. this.group.add(t.getGroup())
  19495. }, this)
  19496. },
  19497. _buildSplitLineAndArea: function(t) {
  19498. var n = t.coordinateSystem
  19499. , e = n.getIndicatorAxes();
  19500. if (e.length) {
  19501. var i = t.get("shape")
  19502. , o = t.getModel("splitLine")
  19503. , a = t.getModel("splitArea")
  19504. , r = o.getModel("lineStyle")
  19505. , s = a.getModel("areaStyle")
  19506. , l = o.get("show")
  19507. , u = a.get("show")
  19508. , h = r.get("color")
  19509. , c = s.get("color");
  19510. h = L(h) ? h : [h],
  19511. c = L(c) ? c : [c];
  19512. var d = []
  19513. , f = [];
  19514. if ("circle" === i)
  19515. for (var p = e[0].getTicksCoords(), g = n.cx, m = n.cy, v = 0; v < p.length; v++) {
  19516. if (l)
  19517. d[I(d, h, v)].push(new Yr({
  19518. shape: {
  19519. cx: g,
  19520. cy: m,
  19521. r: p[v].coord
  19522. }
  19523. }));
  19524. if (u && v < p.length - 1)
  19525. f[I(f, c, v)].push(new Kr({
  19526. shape: {
  19527. cx: g,
  19528. cy: m,
  19529. r0: p[v].coord,
  19530. r: p[v + 1].coord
  19531. }
  19532. }))
  19533. }
  19534. else {
  19535. var y, x = O(e, function(t, e) {
  19536. var i = t.getTicksCoords();
  19537. return y = null == y ? i.length - 1 : Math.min(i.length - 1, y),
  19538. O(i, function(t) {
  19539. return n.coordToPoint(t.coord, e)
  19540. })
  19541. }), _ = [];
  19542. for (v = 0; v <= y; v++) {
  19543. for (var w = [], b = 0; b < e.length; b++)
  19544. w.push(x[b][v]);
  19545. if (w[0] && w.push(w[0].slice()),
  19546. l)
  19547. d[I(d, h, v)].push(new ts({
  19548. shape: {
  19549. points: w
  19550. }
  19551. }));
  19552. if (u && _)
  19553. f[I(f, c, v - 1)].push(new Qr({
  19554. shape: {
  19555. points: w.concat(_)
  19556. }
  19557. }));
  19558. _ = w.slice().reverse()
  19559. }
  19560. }
  19561. var S = r.getLineStyle()
  19562. , M = s.getAreaStyle();
  19563. E(f, function(t, e) {
  19564. this.group.add(Es(t, {
  19565. style: D({
  19566. stroke: "none",
  19567. fill: c[e % c.length]
  19568. }, M),
  19569. silent: !0
  19570. }))
  19571. }, this),
  19572. E(d, function(t, e) {
  19573. this.group.add(Es(t, {
  19574. style: D({
  19575. fill: "none",
  19576. stroke: h[e % h.length]
  19577. }, S),
  19578. silent: !0
  19579. }))
  19580. }, this)
  19581. }
  19582. function I(t, e, i) {
  19583. var n = i % e.length;
  19584. return t[n] = t[n] || [],
  19585. n
  19586. }
  19587. }
  19588. });
  19589. var yy = sc.extend({
  19590. type: "series.radar",
  19591. dependencies: ["radar"],
  19592. init: function(t) {
  19593. yy.superApply(this, "init", arguments),
  19594. this.legendVisualProvider = new qv(A(this.getData, this),A(this.getRawData, this))
  19595. },
  19596. getInitialData: function(t, e) {
  19597. return Yv(this, {
  19598. generateCoord: "indicator_",
  19599. generateCoordCount: 1 / 0
  19600. })
  19601. },
  19602. formatTooltip: function(n) {
  19603. var o = this.getData()
  19604. , t = this.coordinateSystem.getIndicatorAxes()
  19605. , e = this.getData().getName(n);
  19606. return au("" === e ? this.name : e) + "<br/>" + O(t, function(t, e) {
  19607. var i = o.get(o.mapDimension(t.dim), n);
  19608. return au(t.name + " : " + i)
  19609. }).join("<br />")
  19610. },
  19611. getTooltipPosition: function(t) {
  19612. if (null != t)
  19613. for (var e = this.getData(), i = this.coordinateSystem, n = e.getValues(O(i.dimensions, function(t) {
  19614. return e.mapDimension(t)
  19615. }), t, !0), o = 0, a = n.length; o < a; o++)
  19616. if (!isNaN(n[o])) {
  19617. var r = i.getIndicatorAxes();
  19618. return i.coordToPoint(r[o].dataToCoord(n[o]), o)
  19619. }
  19620. },
  19621. defaultOption: {
  19622. zlevel: 0,
  19623. z: 2,
  19624. coordinateSystem: "radar",
  19625. legendHoverLink: !0,
  19626. radarIndex: 0,
  19627. lineStyle: {
  19628. width: 2,
  19629. type: "solid"
  19630. },
  19631. label: {
  19632. position: "top"
  19633. },
  19634. symbol: "emptyCircle",
  19635. symbolSize: 4
  19636. }
  19637. });
  19638. Cf({
  19639. type: "radar",
  19640. render: function(l, t, e) {
  19641. var i = l.coordinateSystem
  19642. , g = this.group
  19643. , m = l.getData()
  19644. , s = this._data;
  19645. function u(t, e) {
  19646. var i = t.getItemVisual(e, "symbol") || "circle"
  19647. , n = t.getItemVisual(e, "color");
  19648. if ("none" !== i) {
  19649. var o = function(t) {
  19650. return L(t) || (t = [+t, +t]),
  19651. t
  19652. }(t.getItemVisual(e, "symbolSize"))
  19653. , a = wg(i, -1, -1, 2, 2, n);
  19654. return a.attr({
  19655. style: {
  19656. strokeNoScale: !0
  19657. },
  19658. z2: 100,
  19659. scale: [o[0] / 2, o[1] / 2]
  19660. }),
  19661. a
  19662. }
  19663. }
  19664. function h(t, e, i, n, o, a) {
  19665. i.removeAll();
  19666. for (var r = 0; r < e.length - 1; r++) {
  19667. var s = u(n, o);
  19668. s && (t[s.__dimIdx = r] ? (s.attr("position", t[r]),
  19669. bl[a ? "initProps" : "updateProps"](s, {
  19670. position: e[r]
  19671. }, l, o)) : s.attr("position", e[r]),
  19672. i.add(s))
  19673. }
  19674. }
  19675. function c(t) {
  19676. return O(t, function(t) {
  19677. return [i.cx, i.cy]
  19678. })
  19679. }
  19680. m.diff(s).add(function(t) {
  19681. var e = m.getItemLayout(t);
  19682. if (e) {
  19683. var i = new Qr
  19684. , n = new ts
  19685. , o = {
  19686. shape: {
  19687. points: e
  19688. }
  19689. };
  19690. i.shape.points = c(e),
  19691. n.shape.points = c(e),
  19692. dl(i, o, l, t),
  19693. dl(n, o, l, t);
  19694. var a = new Ci
  19695. , r = new Ci;
  19696. a.add(n),
  19697. a.add(i),
  19698. a.add(r),
  19699. h(n.shape.points, e, r, m, t, !0),
  19700. m.setItemGraphicEl(t, a)
  19701. }
  19702. }).update(function(t, e) {
  19703. var i = s.getItemGraphicEl(e)
  19704. , n = i.childAt(0)
  19705. , o = i.childAt(1)
  19706. , a = i.childAt(2)
  19707. , r = {
  19708. shape: {
  19709. points: m.getItemLayout(t)
  19710. }
  19711. };
  19712. r.shape.points && (h(n.shape.points, r.shape.points, a, m, t, !1),
  19713. cl(n, r, l),
  19714. cl(o, r, l),
  19715. m.setItemGraphicEl(t, i))
  19716. }).remove(function(t) {
  19717. g.remove(s.getItemGraphicEl(t))
  19718. }).execute(),
  19719. m.eachItemGraphicEl(function(t, i) {
  19720. var e = m.getItemModel(i)
  19721. , n = t.childAt(0)
  19722. , o = t.childAt(1)
  19723. , a = t.childAt(2)
  19724. , r = m.getItemVisual(i, "color");
  19725. g.add(t),
  19726. n.useStyle(D(e.getModel("lineStyle").getLineStyle(), {
  19727. fill: "none",
  19728. stroke: r
  19729. })),
  19730. n.hoverStyle = e.getModel("emphasis.lineStyle").getLineStyle();
  19731. var s = e.getModel("areaStyle")
  19732. , l = e.getModel("emphasis.areaStyle")
  19733. , u = s.isEmpty() && s.parentModel.isEmpty()
  19734. , h = l.isEmpty() && l.parentModel.isEmpty();
  19735. h = h && u,
  19736. o.ignore = u,
  19737. o.useStyle(D(s.getAreaStyle(), {
  19738. fill: r,
  19739. opacity: .7
  19740. })),
  19741. o.hoverStyle = l.getAreaStyle();
  19742. var c = e.getModel("itemStyle").getItemStyle(["color"])
  19743. , d = e.getModel("emphasis.itemStyle").getItemStyle()
  19744. , f = e.getModel("label")
  19745. , p = e.getModel("emphasis.label");
  19746. a.eachChild(function(t) {
  19747. t.setStyle(c),
  19748. t.hoverStyle = k(d);
  19749. var e = m.get(m.dimensions[t.__dimIdx], i);
  19750. null != e && !isNaN(e) || (e = ""),
  19751. el(t.style, t.hoverStyle, f, p, {
  19752. labelFetcher: m.hostModel,
  19753. labelDataIndex: i,
  19754. labelDimIndex: t.__dimIdx,
  19755. defaultText: e,
  19756. autoColor: r,
  19757. isRectText: !0
  19758. })
  19759. }),
  19760. t.highDownOnUpdate = function(t, e) {
  19761. o.attr("ignore", "emphasis" === e ? h : u)
  19762. }
  19763. ,
  19764. $s(t)
  19765. }),
  19766. this._data = m
  19767. },
  19768. remove: function() {
  19769. this.group.removeAll(),
  19770. this._data = null
  19771. },
  19772. dispose: function() {}
  19773. });
  19774. function xy(t) {
  19775. return !isNaN(t[0]) && !isNaN(t[1])
  19776. }
  19777. function _y(t) {
  19778. return [t.cx, t.cy]
  19779. }
  19780. Sf(iy("radar")),
  19781. Sf(Lm("radar", "circle")),
  19782. bf(function(t) {
  19783. t.eachSeriesByType("radar", function(t) {
  19784. var i = t.getData()
  19785. , o = []
  19786. , a = t.coordinateSystem;
  19787. if (a) {
  19788. var e = a.getIndicatorAxes();
  19789. E(e, function(t, n) {
  19790. i.each(i.mapDimension(e[n].dim), function(t, e) {
  19791. o[e] = o[e] || [];
  19792. var i = a.dataToPoint(t, n);
  19793. o[e][n] = xy(i) ? i : _y(a)
  19794. })
  19795. }),
  19796. i.each(function(t) {
  19797. var e = I(o[t], function(t) {
  19798. return xy(t)
  19799. }) || _y(a);
  19800. o[t].push(e.slice()),
  19801. i.setItemLayout(t, o[t])
  19802. })
  19803. }
  19804. })
  19805. }),
  19806. xf(uy("radar")),
  19807. yf(function(i) {
  19808. var t = i.polar;
  19809. if (t) {
  19810. L(t) || (t = [t]);
  19811. var n = [];
  19812. E(t, function(t, e) {
  19813. t.indicator ? (t.type && !t.shape && (t.shape = t.type),
  19814. i.radar = i.radar || [],
  19815. L(i.radar) || (i.radar = [i.radar]),
  19816. i.radar.push(t)) : n.push(t)
  19817. }),
  19818. i.polar = n
  19819. }
  19820. E(i.series, function(t) {
  19821. t && "radar" === t.type && t.polarIndex && (t.radarIndex = t.polarIndex)
  19822. })
  19823. });
  19824. for (var wy = [126, 25], by = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, .7], [52, .7], [56, 7.7], [59, .7], [64, .7], [64, 0], [5, 0], [0, 3.5]], [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], [1, 92.4], [1, 3.5], [0, 3.5]]], Sy = 0; Sy < by.length; Sy++)
  19825. for (var My = 0; My < by[Sy].length; My++)
  19826. by[Sy][My][0] /= 10.5,
  19827. by[Sy][My][1] /= -14,
  19828. by[Sy][My][0] += wy[0],
  19829. by[Sy][My][1] += wy[1];
  19830. var Iy = {
  19831. "南海诸岛": [32, 80],
  19832. "广东": [0, -10],
  19833. "香港": [10, 5],
  19834. "澳门": [-10, 10],
  19835. "天津": [5, 5]
  19836. }
  19837. , Ty = {
  19838. Russia: [100, 60],
  19839. "United States": [-99, 38],
  19840. "United States of America": [-99, 38]
  19841. }
  19842. , Ay = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]]
  19843. , Dy = jo()
  19844. , Cy = {
  19845. load: function(n, t, e) {
  19846. var i = Dy(t).parsed;
  19847. if (i)
  19848. return i;
  19849. var o, a = t.specialAreas || {}, r = t.geoJSON;
  19850. try {
  19851. o = r ? Cg(r, e) : []
  19852. } catch (t) {
  19853. throw new Error("Invalid geoJson format\n" + t.message)
  19854. }
  19855. return function(t, e) {
  19856. "china" === t && e.push(new Ag("南海诸岛",O(by, function(t) {
  19857. return {
  19858. type: "polygon",
  19859. exterior: t
  19860. }
  19861. }),wy))
  19862. }(n, o),
  19863. E(o, function(t) {
  19864. var e = t.name;
  19865. !function(t, e) {
  19866. if ("china" === t) {
  19867. var i = Iy[e.name];
  19868. if (i) {
  19869. var n = e.center;
  19870. n[0] += i[0] / 10.5,
  19871. n[1] += -i[1] / 14
  19872. }
  19873. }
  19874. }(n, t),
  19875. function(t, e) {
  19876. if ("world" === t) {
  19877. var i = Ty[e.name];
  19878. if (i) {
  19879. var n = e.center;
  19880. n[0] = i[0],
  19881. n[1] = i[1]
  19882. }
  19883. }
  19884. }(n, t),
  19885. function(t, e) {
  19886. "china" === t && "台湾" === e.name && e.geometries.push({
  19887. type: "polygon",
  19888. exterior: Ay[0]
  19889. })
  19890. }(n, t);
  19891. var i = a[e];
  19892. i && t.transformTo(i.left, i.top, i.width, i.height)
  19893. }),
  19894. Dy(t).parsed = {
  19895. regions: o,
  19896. boundingRect: function(t) {
  19897. for (var e, i = 0; i < t.length; i++) {
  19898. var n = t[i].getBoundingRect();
  19899. (e = e || n.clone()).union(n)
  19900. }
  19901. return e
  19902. }(o)
  19903. }
  19904. }
  19905. };
  19906. var Ly = jo();
  19907. function ky(t, e) {
  19908. var i, n, o = t.svgXML;
  19909. try {
  19910. Y(null != (n = (i = o && function(t, e) {
  19911. return (new hd).parse(t, e)
  19912. }(o, {
  19913. ignoreViewBox: !0,
  19914. ignoreRootClip: !0
  19915. }) || {}).root))
  19916. } catch (t) {
  19917. throw new Error("Invalid svg format\n" + t.message)
  19918. }
  19919. var a = i.width
  19920. , r = i.height
  19921. , s = i.viewBoxRect;
  19922. if (e || (e = null == a || null == r ? n.getBoundingRect() : new Di(0,0,0,0),
  19923. null != a && (e.width = a),
  19924. null != r && (e.height = r)),
  19925. s) {
  19926. var l = wd(s, e.width, e.height)
  19927. , u = n;
  19928. (n = new Ci).add(u),
  19929. u.scale = l.scale,
  19930. u.position = l.position
  19931. }
  19932. return n.setClipPath(new rs({
  19933. shape: e.plain()
  19934. })),
  19935. {
  19936. root: n,
  19937. boundingRect: e
  19938. }
  19939. }
  19940. var Py = {
  19941. geoJSON: Cy,
  19942. svg: {
  19943. load: function(t, e) {
  19944. var i = Ly(e).originRoot;
  19945. if (i)
  19946. return {
  19947. root: i,
  19948. boundingRect: Ly(e).boundingRect
  19949. };
  19950. var n = ky(e);
  19951. return Ly(e).originRoot = n.root,
  19952. Ly(e).boundingRect = n.boundingRect,
  19953. n
  19954. },
  19955. makeGraphic: function(t, e, i) {
  19956. var n = Ly(e)
  19957. , o = n.rootMap || (n.rootMap = Q())
  19958. , a = o.get(i);
  19959. if (a)
  19960. return a;
  19961. var r = n.originRoot
  19962. , s = n.boundingRect;
  19963. return a = n.originRootHostKey ? ky(e, s).root : (n.originRootHostKey = i,
  19964. r),
  19965. o.set(i, a)
  19966. },
  19967. removeGraphic: function(t, e, i) {
  19968. var n = Ly(e)
  19969. , o = n.rootMap;
  19970. o && o.removeKey(i),
  19971. i === n.originRootHostKey && (n.originRootHostKey = null)
  19972. }
  19973. }
  19974. }
  19975. , Ny = {
  19976. load: function(n, o, a) {
  19977. var r, s = [], l = Q(), u = Q();
  19978. return E(Ey(n), function(t) {
  19979. var e = Py[t.type].load(n, t, a);
  19980. E(e.regions, function(t) {
  19981. var e = t.name;
  19982. o && o.hasOwnProperty(e) && (t = t.cloneShallow(e = o[e])),
  19983. s.push(t),
  19984. l.set(e, t),
  19985. u.set(e, t.center)
  19986. });
  19987. var i = e.boundingRect;
  19988. i && (r ? r.union(i) : r = i.clone())
  19989. }),
  19990. {
  19991. regions: s,
  19992. regionsMap: l,
  19993. nameCoordMap: u,
  19994. boundingRect: r || new Di(0,0,0,0)
  19995. }
  19996. },
  19997. makeGraphic: Oy("makeGraphic"),
  19998. removeGraphic: Oy("removeGraphic")
  19999. };
  20000. function Oy(a) {
  20001. return function(i, n) {
  20002. var t = Ey(i)
  20003. , o = [];
  20004. return E(t, function(t) {
  20005. var e = Py[t.type][a];
  20006. e && o.push(e(i, t, n))
  20007. }),
  20008. o
  20009. }
  20010. }
  20011. function Ey(t) {
  20012. return Sd.retrieveMap(t) || []
  20013. }
  20014. b(sc.extend({
  20015. type: "series.map",
  20016. dependencies: ["geo"],
  20017. layoutMode: "box",
  20018. needsDrawMap: !1,
  20019. seriesGroup: [],
  20020. getInitialData: function(t) {
  20021. for (var e = Yv(this, {
  20022. coordDimensions: ["value"],
  20023. encodeDefaulter: T(Ju, this)
  20024. }), i = e.mapDimension("value"), n = Q(), o = [], a = [], r = 0, s = e.count(); r < s; r++) {
  20025. var l = e.getName(r);
  20026. n.set(l, !0),
  20027. o.push({
  20028. name: l,
  20029. value: e.get(i, r),
  20030. selected: Zh(e, r, "selected")
  20031. })
  20032. }
  20033. return E(Ny.load(this.getMapType(), this.option.nameMap, this.option.nameProperty).regions, function(t) {
  20034. var e = t.name;
  20035. n.get(e) || (o.push({
  20036. name: e
  20037. }),
  20038. a.push(e))
  20039. }),
  20040. this.updateSelectedMap(o),
  20041. e.appendValues([], a),
  20042. e
  20043. },
  20044. getHostGeoModel: function() {
  20045. var t = this.option.geoIndex;
  20046. return null != t ? this.dependentModels.geo[t] : null
  20047. },
  20048. getMapType: function() {
  20049. return (this.getHostGeoModel() || this).option.map
  20050. },
  20051. getRawValue: function(t) {
  20052. var e = this.getData();
  20053. return e.get(e.mapDimension("value"), t)
  20054. },
  20055. getRegionModel: function(t) {
  20056. var e = this.getData();
  20057. return e.getItemModel(e.indexOfName(t))
  20058. },
  20059. formatTooltip: function(t) {
  20060. for (var e = this.getData(), i = tu(this.getRawValue(t)), n = e.getName(t), o = this.seriesGroup, a = [], r = 0; r < o.length; r++) {
  20061. var s = o[r].originalData.indexOfName(n)
  20062. , l = e.mapDimension("value");
  20063. isNaN(o[r].originalData.get(l, s)) || a.push(au(o[r].name))
  20064. }
  20065. return a.join(", ") + "<br />" + au(n + " : " + i)
  20066. },
  20067. getTooltipPosition: function(t) {
  20068. if (null != t) {
  20069. var e = this.getData().getName(t)
  20070. , i = this.coordinateSystem
  20071. , n = i.getRegion(e);
  20072. return n && i.dataToPoint(n.center)
  20073. }
  20074. },
  20075. setZoom: function(t) {
  20076. this.option.zoom = t
  20077. },
  20078. setCenter: function(t) {
  20079. this.option.center = t
  20080. },
  20081. defaultOption: {
  20082. zlevel: 0,
  20083. z: 2,
  20084. coordinateSystem: "geo",
  20085. map: "",
  20086. left: "center",
  20087. top: "center",
  20088. aspectScale: .75,
  20089. showLegendSymbol: !0,
  20090. dataRangeHoverLink: !0,
  20091. boundingCoords: null,
  20092. center: null,
  20093. zoom: 1,
  20094. scaleLimit: null,
  20095. label: {
  20096. show: !1,
  20097. color: "#000"
  20098. },
  20099. itemStyle: {
  20100. borderWidth: .5,
  20101. borderColor: "#444",
  20102. areaColor: "#eee"
  20103. },
  20104. emphasis: {
  20105. label: {
  20106. show: !0,
  20107. color: "rgb(100,0,0)"
  20108. },
  20109. itemStyle: {
  20110. areaColor: "rgba(255,215,0,0.8)"
  20111. }
  20112. },
  20113. nameProperty: "name"
  20114. }
  20115. }), jv);
  20116. var Ry = "\0_ec_interaction_mutex";
  20117. function zy(t, e) {
  20118. return !!By(t)[e]
  20119. }
  20120. function By(t) {
  20121. return t[Ry] || (t[Ry] = {})
  20122. }
  20123. function Vy(i) {
  20124. this.pointerChecker,
  20125. this._zr = i,
  20126. this._opt = {};
  20127. var t = A
  20128. , n = t(Gy, this)
  20129. , o = t(Fy, this)
  20130. , a = t(Wy, this)
  20131. , r = t(Hy, this)
  20132. , s = t(Zy, this);
  20133. Ct.call(this),
  20134. this.setPointerChecker = function(t) {
  20135. this.pointerChecker = t
  20136. }
  20137. ,
  20138. this.enable = function(t, e) {
  20139. this.disable(),
  20140. this._opt = D(k(e) || {}, {
  20141. zoomOnMouseWheel: !0,
  20142. moveOnMouseMove: !0,
  20143. moveOnMouseWheel: !1,
  20144. preventDefaultMouseMove: !0
  20145. }),
  20146. null == t && (t = !0),
  20147. !0 !== t && "move" !== t && "pan" !== t || (i.on("mousedown", n),
  20148. i.on("mousemove", o),
  20149. i.on("mouseup", a)),
  20150. !0 !== t && "scale" !== t && "zoom" !== t || (i.on("mousewheel", r),
  20151. i.on("pinch", s))
  20152. }
  20153. ,
  20154. this.disable = function() {
  20155. i.off("mousedown", n),
  20156. i.off("mousemove", o),
  20157. i.off("mouseup", a),
  20158. i.off("mousewheel", r),
  20159. i.off("pinch", s)
  20160. }
  20161. ,
  20162. this.dispose = this.disable,
  20163. this.isDragging = function() {
  20164. return this._dragging
  20165. }
  20166. ,
  20167. this.isPinching = function() {
  20168. return this._pinching
  20169. }
  20170. }
  20171. function Gy(t) {
  20172. if (!(Yt(t) || t.target && t.target.draggable)) {
  20173. var e = t.offsetX
  20174. , i = t.offsetY;
  20175. this.pointerChecker && this.pointerChecker(t, e, i) && (this._x = e,
  20176. this._y = i,
  20177. this._dragging = !0)
  20178. }
  20179. }
  20180. function Fy(t) {
  20181. if (this._dragging && Yy("moveOnMouseMove", t, this._opt) && "pinch" !== t.gestureEvent && !zy(this._zr, "globalPan")) {
  20182. var e = t.offsetX
  20183. , i = t.offsetY
  20184. , n = this._x
  20185. , o = this._y
  20186. , a = e - n
  20187. , r = i - o;
  20188. this._x = e,
  20189. this._y = i,
  20190. this._opt.preventDefaultMouseMove && Xt(t.event),
  20191. Xy(this, "pan", "moveOnMouseMove", t, {
  20192. dx: a,
  20193. dy: r,
  20194. oldX: n,
  20195. oldY: o,
  20196. newX: e,
  20197. newY: i
  20198. })
  20199. }
  20200. }
  20201. function Wy(t) {
  20202. Yt(t) || (this._dragging = !1)
  20203. }
  20204. function Hy(t) {
  20205. var e = Yy("zoomOnMouseWheel", t, this._opt)
  20206. , i = Yy("moveOnMouseWheel", t, this._opt)
  20207. , n = t.wheelDelta
  20208. , o = Math.abs(n)
  20209. , a = t.offsetX
  20210. , r = t.offsetY;
  20211. if (0 !== n && (e || i)) {
  20212. if (e) {
  20213. var s = 3 < o ? 1.4 : 1 < o ? 1.2 : 1.1;
  20214. Uy(this, "zoom", "zoomOnMouseWheel", t, {
  20215. scale: 0 < n ? s : 1 / s,
  20216. originX: a,
  20217. originY: r
  20218. })
  20219. }
  20220. if (i) {
  20221. var l = Math.abs(n);
  20222. Uy(this, "scrollMove", "moveOnMouseWheel", t, {
  20223. scrollDelta: (0 < n ? 1 : -1) * (3 < l ? .4 : 1 < l ? .15 : .05),
  20224. originX: a,
  20225. originY: r
  20226. })
  20227. }
  20228. }
  20229. }
  20230. function Zy(t) {
  20231. zy(this._zr, "globalPan") || Uy(this, "zoom", null, t, {
  20232. scale: 1 < t.pinchScale ? 1.1 : 1 / 1.1,
  20233. originX: t.pinchX,
  20234. originY: t.pinchY
  20235. })
  20236. }
  20237. function Uy(t, e, i, n, o) {
  20238. t.pointerChecker && t.pointerChecker(n, o.originX, o.originY) && (Xt(n.event),
  20239. Xy(t, e, i, n, o))
  20240. }
  20241. function Xy(t, e, i, n, o) {
  20242. o.isAvailableBehavior = A(Yy, null, i, n),
  20243. t.trigger(e, o)
  20244. }
  20245. function Yy(t, e, i) {
  20246. var n = i[t];
  20247. return !t || n && (!R(n) || e.event[n + "Key"])
  20248. }
  20249. function jy(t, e, i) {
  20250. var n = t.target
  20251. , o = n.position;
  20252. o[0] += e,
  20253. o[1] += i,
  20254. n.dirty()
  20255. }
  20256. function qy(t, e, i, n) {
  20257. var o = t.target
  20258. , a = t.zoomLimit
  20259. , r = o.position
  20260. , s = o.scale
  20261. , l = t.zoom = t.zoom || 1;
  20262. if (l *= e,
  20263. a) {
  20264. var u = a.min || 0
  20265. , h = a.max || 1 / 0;
  20266. l = Math.max(Math.min(h, l), u)
  20267. }
  20268. var c = l / t.zoom;
  20269. t.zoom = l,
  20270. r[0] -= (i - r[0]) * (c - 1),
  20271. r[1] -= (n - r[1]) * (c - 1),
  20272. s[0] *= c,
  20273. s[1] *= c,
  20274. o.dirty()
  20275. }
  20276. _f({
  20277. type: "takeGlobalCursor",
  20278. event: "globalCursorTaken",
  20279. update: "update"
  20280. }, function() {}),
  20281. b(Vy, Ct);
  20282. var Ky = {
  20283. axisPointer: 1,
  20284. tooltip: 1,
  20285. brush: 1
  20286. };
  20287. function $y(t, e, i) {
  20288. var n = e.getComponentByElement(t.topTarget)
  20289. , o = n && n.coordinateSystem;
  20290. return n && n !== i && !Ky[n.mainType] && o && o.model !== i
  20291. }
  20292. function Jy(t) {
  20293. var e = t.getItemStyle()
  20294. , i = t.get("areaColor");
  20295. return null != i && (e.fill = i),
  20296. e
  20297. }
  20298. function Qy(i, t) {
  20299. t.eachChild(function(e) {
  20300. E(e.__regions, function(t) {
  20301. e.trigger(i.isSelected(t.name) ? "emphasis" : "normal")
  20302. })
  20303. })
  20304. }
  20305. function tx(t, e) {
  20306. var i = new Ci;
  20307. this.uid = Nl("ec_map_draw"),
  20308. this._controller = new Vy(t.getZr()),
  20309. this._controllerHost = {
  20310. target: e ? i : null
  20311. },
  20312. this.group = i,
  20313. this._updateGroup = e,
  20314. this._mouseDownFlag,
  20315. this._mapName,
  20316. this._initialized,
  20317. i.add(this._regionsGroup = new Ci),
  20318. i.add(this._backgroundGroup = new Ci)
  20319. }
  20320. tx.prototype = {
  20321. constructor: tx,
  20322. draw: function(_, t, e, i, n) {
  20323. var w = "geo" === _.mainType
  20324. , b = _.getData && _.getData();
  20325. w && t.eachComponent({
  20326. mainType: "series",
  20327. subType: "map"
  20328. }, function(t) {
  20329. b || t.getHostGeoModel() !== _ || (b = t.getData())
  20330. });
  20331. var o = _.coordinateSystem;
  20332. this._updateBackground(o);
  20333. var S, M = this._regionsGroup, I = this.group, a = o.getTransformInfo(), T = !M.childAt(0) || n;
  20334. if (T)
  20335. I.transform = a.roamTransform,
  20336. I.decomposeTransform(),
  20337. I.dirty();
  20338. else {
  20339. var r = new ve;
  20340. r.transform = a.roamTransform,
  20341. r.decomposeTransform();
  20342. var s = {
  20343. scale: r.scale,
  20344. position: r.position
  20345. };
  20346. S = r.scale,
  20347. cl(I, s, _)
  20348. }
  20349. var A = a.rawScale
  20350. , D = a.rawPosition;
  20351. M.removeAll();
  20352. var C = ["itemStyle"]
  20353. , L = ["emphasis", "itemStyle"]
  20354. , k = ["label"]
  20355. , P = ["emphasis", "label"]
  20356. , N = Q();
  20357. E(o.regions, function(t) {
  20358. var e = N.get(t.name) || N.set(t.name, new Ci)
  20359. , a = new ps({
  20360. segmentIgnoreThreshold: 1,
  20361. shape: {
  20362. paths: []
  20363. }
  20364. });
  20365. e.add(a);
  20366. var i, n = (x = _.getRegionModel(t.name) || _).getModel(C), o = x.getModel(L), r = Jy(n), s = Jy(o), l = x.getModel(k), u = x.getModel(P);
  20367. if (b) {
  20368. i = b.indexOfName(t.name);
  20369. var h = b.getItemVisual(i, "color", !0);
  20370. h && (r.fill = h)
  20371. }
  20372. function c(t) {
  20373. return [t[0] * A[0] + D[0], t[1] * A[1] + D[1]]
  20374. }
  20375. E(t.geometries, function(t) {
  20376. if ("polygon" === t.type) {
  20377. for (var e = [], i = 0; i < t.exterior.length; ++i)
  20378. e.push(c(t.exterior[i]));
  20379. a.shape.paths.push(new Qr({
  20380. segmentIgnoreThreshold: 1,
  20381. shape: {
  20382. points: e
  20383. }
  20384. }));
  20385. for (i = 0; i < (t.interiors ? t.interiors.length : 0); ++i) {
  20386. for (var n = t.interiors[i], o = (e = [],
  20387. 0); o < n.length; ++o)
  20388. e.push(c(n[o]));
  20389. a.shape.paths.push(new Qr({
  20390. segmentIgnoreThreshold: 1,
  20391. shape: {
  20392. points: e
  20393. }
  20394. }))
  20395. }
  20396. }
  20397. }),
  20398. a.setStyle(r),
  20399. a.style.strokeNoScale = !0,
  20400. a.culling = !0;
  20401. var d = l.get("show")
  20402. , f = u.get("show")
  20403. , p = b && isNaN(b.get(b.mapDimension("value"), i))
  20404. , g = b && b.getItemLayout(i);
  20405. if (w || p && (d || f) || g && g.showLabel) {
  20406. var m, v = w ? t.name : i;
  20407. (!b || 0 <= i) && (m = _);
  20408. var y = new Ur({
  20409. position: c(t.center.slice()),
  20410. scale: [1 / I.scale[0], 1 / I.scale[1]],
  20411. z2: 10,
  20412. silent: !0
  20413. });
  20414. if (el(y.style, y.hoverStyle = {}, l, u, {
  20415. labelFetcher: m,
  20416. labelDataIndex: v,
  20417. defaultText: t.name,
  20418. useInsideStyle: !1
  20419. }, {
  20420. textAlign: "center",
  20421. textVerticalAlign: "middle"
  20422. }),
  20423. !T)
  20424. cl(y, {
  20425. scale: [1 / S[0], 1 / S[1]]
  20426. }, _);
  20427. e.add(y)
  20428. }
  20429. if (b)
  20430. b.setItemGraphicEl(i, e);
  20431. else {
  20432. var x = _.getRegionModel(t.name);
  20433. a.eventData = {
  20434. componentType: "geo",
  20435. componentIndex: _.componentIndex,
  20436. geoIndex: _.componentIndex,
  20437. name: t.name,
  20438. region: x && x.option || {}
  20439. }
  20440. }
  20441. (e.__regions || (e.__regions = [])).push(t),
  20442. e.highDownSilentOnTouch = !!_.get("selectedMode"),
  20443. $s(e, s),
  20444. M.add(e)
  20445. }),
  20446. this._updateController(_, t, e),
  20447. function(n, o, a, r, s) {
  20448. a.off("click"),
  20449. a.off("mousedown"),
  20450. o.get("selectedMode") && (a.on("mousedown", function() {
  20451. n._mouseDownFlag = !0
  20452. }),
  20453. a.on("click", function(t) {
  20454. if (n._mouseDownFlag) {
  20455. n._mouseDownFlag = !1;
  20456. for (var e = t.target; !e.__regions; )
  20457. e = e.parent;
  20458. if (e) {
  20459. var i = {
  20460. type: ("geo" === o.mainType ? "geo" : "map") + "ToggleSelect",
  20461. batch: O(e.__regions, function(t) {
  20462. return {
  20463. name: t.name,
  20464. from: s.uid
  20465. }
  20466. })
  20467. };
  20468. i[o.mainType + "Id"] = o.id,
  20469. r.dispatchAction(i),
  20470. Qy(o, a)
  20471. }
  20472. }
  20473. }))
  20474. }(this, _, M, e, i),
  20475. Qy(_, M)
  20476. },
  20477. remove: function() {
  20478. this._regionsGroup.removeAll(),
  20479. this._backgroundGroup.removeAll(),
  20480. this._controller.dispose(),
  20481. this._mapName && Ny.removeGraphic(this._mapName, this.uid),
  20482. this._mapName = null,
  20483. this._controllerHost = {}
  20484. },
  20485. _updateBackground: function(t) {
  20486. var e = t.map;
  20487. this._mapName !== e && E(Ny.makeGraphic(e, this.uid), function(t) {
  20488. this._backgroundGroup.add(t)
  20489. }, this),
  20490. this._mapName = e
  20491. },
  20492. _updateController: function(n, t, o) {
  20493. var a = n.coordinateSystem
  20494. , e = this._controller
  20495. , i = this._controllerHost;
  20496. i.zoomLimit = n.get("scaleLimit"),
  20497. i.zoom = a.getZoom(),
  20498. e.enable(n.get("roam") || !1);
  20499. var r = n.mainType;
  20500. function s() {
  20501. var t = {
  20502. type: "geoRoam",
  20503. componentType: r
  20504. };
  20505. return t[r + "Id"] = n.id,
  20506. t
  20507. }
  20508. e.off("pan").on("pan", function(t) {
  20509. this._mouseDownFlag = !1,
  20510. jy(i, t.dx, t.dy),
  20511. o.dispatchAction(P(s(), {
  20512. dx: t.dx,
  20513. dy: t.dy
  20514. }))
  20515. }, this),
  20516. e.off("zoom").on("zoom", function(t) {
  20517. if (this._mouseDownFlag = !1,
  20518. qy(i, t.scale, t.originX, t.originY),
  20519. o.dispatchAction(P(s(), {
  20520. zoom: t.scale,
  20521. originX: t.originX,
  20522. originY: t.originY
  20523. })),
  20524. this._updateGroup) {
  20525. var e = this.group.scale;
  20526. this._regionsGroup.traverse(function(t) {
  20527. "text" === t.type && t.attr("scale", [1 / e[0], 1 / e[1]])
  20528. })
  20529. }
  20530. }, this),
  20531. e.setPointerChecker(function(t, e, i) {
  20532. return a.getViewRectAfterRoam().contain(e, i) && !$y(t, o, n)
  20533. })
  20534. }
  20535. };
  20536. var ex = "__seriesMapHighDown"
  20537. , ix = "__seriesMapCallKey";
  20538. function nx(t) {
  20539. var e = this[ex];
  20540. e && e.recordVersion === this[ix] && ox(e, t)
  20541. }
  20542. function ox(t, e) {
  20543. var i = t.circle
  20544. , n = t.labelModel
  20545. , o = t.hoverLabelModel
  20546. , a = t.emphasisText
  20547. , r = t.normalText;
  20548. e ? (i.style.extendFrom(nl({}, o, {
  20549. text: o.get("show") ? a : null
  20550. }, {
  20551. isRectText: !0,
  20552. useInsideStyle: !1
  20553. }, !0)),
  20554. i.__mapOriginalZ2 = i.z2,
  20555. i.z2 += bs) : (nl(i.style, n, {
  20556. text: n.get("show") ? r : null,
  20557. textPosition: n.getShallow("position") || "bottom"
  20558. }, {
  20559. isRectText: !0,
  20560. useInsideStyle: !1
  20561. }),
  20562. i.dirty(!1),
  20563. null != i.__mapOriginalZ2 && (i.z2 = i.__mapOriginalZ2,
  20564. i.__mapOriginalZ2 = null))
  20565. }
  20566. function ax(t, e, i) {
  20567. var n = t.getZoom()
  20568. , o = t.getCenter()
  20569. , a = e.zoom
  20570. , r = t.dataToPoint(o);
  20571. if (null != e.dx && null != e.dy) {
  20572. r[0] -= e.dx,
  20573. r[1] -= e.dy;
  20574. o = t.pointToData(r);
  20575. t.setCenter(o)
  20576. }
  20577. if (null != a) {
  20578. if (i) {
  20579. var s = i.min || 0
  20580. , l = i.max || 1 / 0;
  20581. a = Math.max(Math.min(n * a, l), s) / n
  20582. }
  20583. t.scale[0] *= a,
  20584. t.scale[1] *= a;
  20585. var u = t.position
  20586. , h = (e.originX - u[0]) * (a - 1)
  20587. , c = (e.originY - u[1]) * (a - 1);
  20588. u[0] -= h,
  20589. u[1] -= c,
  20590. t.updateTransform();
  20591. o = t.pointToData(r);
  20592. t.setCenter(o),
  20593. t.setZoom(a * n)
  20594. }
  20595. return {
  20596. center: t.getCenter(),
  20597. zoom: t.getZoom()
  20598. }
  20599. }
  20600. Cf({
  20601. type: "map",
  20602. render: function(t, e, i, n) {
  20603. if (!n || "mapToggleSelect" !== n.type || n.from !== this.uid) {
  20604. var o = this.group;
  20605. if (o.removeAll(),
  20606. !t.getHostGeoModel()) {
  20607. if (n && "geoRoam" === n.type && "series" === n.componentType && n.seriesId === t.id)
  20608. (a = this._mapDraw) && o.add(a.group);
  20609. else if (t.needsDrawMap) {
  20610. var a = this._mapDraw || new tx(i,!0);
  20611. o.add(a.group),
  20612. a.draw(t, e, i, this, n),
  20613. this._mapDraw = a
  20614. } else
  20615. this._mapDraw && this._mapDraw.remove(),
  20616. this._mapDraw = null;
  20617. t.get("showLegendSymbol") && e.getComponent("legend") && this._renderSymbols(t, e, i)
  20618. }
  20619. }
  20620. },
  20621. remove: function() {
  20622. this._mapDraw && this._mapDraw.remove(),
  20623. this._mapDraw = null,
  20624. this.group.removeAll()
  20625. },
  20626. dispose: function() {
  20627. this._mapDraw && this._mapDraw.remove(),
  20628. this._mapDraw = null
  20629. },
  20630. _renderSymbols: function(x, t, e) {
  20631. var _ = x.originalData
  20632. , w = this.group;
  20633. _.each(_.mapDimension("value"), function(t, e) {
  20634. if (!isNaN(t)) {
  20635. var i = _.getItemLayout(e);
  20636. if (i && i.point) {
  20637. var n = i.point
  20638. , o = i.offset
  20639. , a = new Yr({
  20640. style: {
  20641. fill: x.getData().getVisual("color")
  20642. },
  20643. shape: {
  20644. cx: n[0] + 9 * o,
  20645. cy: n[1],
  20646. r: 3
  20647. },
  20648. silent: !0,
  20649. z2: 8 + (o ? 0 : bs + 1)
  20650. });
  20651. if (!o) {
  20652. var r = x.mainSeries.getData()
  20653. , s = _.getName(e)
  20654. , l = r.indexOfName(s)
  20655. , u = _.getItemModel(e)
  20656. , h = u.getModel("label")
  20657. , c = u.getModel("emphasis.label")
  20658. , d = r.getItemGraphicEl(l)
  20659. , f = H(x.getFormattedLabel(l, "normal"), s)
  20660. , p = H(x.getFormattedLabel(l, "emphasis"), f)
  20661. , g = d[ex]
  20662. , m = Math.random();
  20663. if (!g) {
  20664. g = d[ex] = {};
  20665. var v = T(nx, !0)
  20666. , y = T(nx, !1);
  20667. d.on("mouseover", v).on("mouseout", y).on("emphasis", v).on("normal", y)
  20668. }
  20669. P(g, {
  20670. recordVersion: d[ix] = m,
  20671. circle: a,
  20672. labelModel: h,
  20673. hoverLabelModel: c,
  20674. emphasisText: p,
  20675. normalText: f
  20676. }),
  20677. ox(g, !1)
  20678. }
  20679. w.add(a)
  20680. }
  20681. }
  20682. })
  20683. }
  20684. }),
  20685. _f({
  20686. type: "geoRoam",
  20687. event: "geoRoam",
  20688. update: "updateTransform"
  20689. }, function(n, t) {
  20690. var o = n.componentType || "series";
  20691. t.eachComponent({
  20692. mainType: o,
  20693. query: n
  20694. }, function(t) {
  20695. var e = t.coordinateSystem;
  20696. if ("geo" === e.type) {
  20697. var i = ax(e, n, t.get("scaleLimit"));
  20698. t.setCenter && t.setCenter(i.center),
  20699. t.setZoom && t.setZoom(i.zoom),
  20700. "series" === o && E(t.seriesGroup, function(t) {
  20701. t.setCenter(i.center),
  20702. t.setZoom(i.zoom)
  20703. })
  20704. }
  20705. })
  20706. });
  20707. var rx = bt;
  20708. function sx() {
  20709. ve.call(this)
  20710. }
  20711. function lx(t) {
  20712. this.name = t,
  20713. this.zoomLimit,
  20714. ve.call(this),
  20715. this._roamTransformable = new sx,
  20716. this._rawTransformable = new sx,
  20717. this._center,
  20718. this._zoom
  20719. }
  20720. function ux(t, e, i, n) {
  20721. var o = i.seriesModel
  20722. , a = o ? o.coordinateSystem : null;
  20723. return a === this ? a[t](n) : null
  20724. }
  20725. function hx(t, e, i, n) {
  20726. lx.call(this, t),
  20727. this.map = e;
  20728. var o = Ny.load(e, i);
  20729. this._nameCoordMap = o.nameCoordMap,
  20730. this._regionsMap = o.regionsMap,
  20731. this._invertLongitute = null == n || n,
  20732. this.regions = o.regions,
  20733. this._rect = o.boundingRect
  20734. }
  20735. function cx(t, e, i, n) {
  20736. var o = i.geoModel
  20737. , a = i.seriesModel
  20738. , r = o ? o.coordinateSystem : a ? a.coordinateSystem || (a.getReferringComponents("geo")[0] || {}).coordinateSystem : null;
  20739. return r === this ? r[t](n) : null
  20740. }
  20741. function dx(t, e) {
  20742. var i = t.get("boundingCoords");
  20743. if (null != i) {
  20744. var n = i[0]
  20745. , o = i[1];
  20746. isNaN(n[0]) || isNaN(n[1]) || isNaN(o[0]) || isNaN(o[1]) || this.setBoundingRect(n[0], n[1], o[0] - n[0], o[1] - n[1])
  20747. }
  20748. var a, r = this.getBoundingRect(), s = t.get("layoutCenter"), l = t.get("layoutSize"), u = e.getWidth(), h = e.getHeight(), c = r.width / r.height * this.aspectScale, d = !1;
  20749. if (s && l && (s = [Rl(s[0], u), Rl(s[1], h)],
  20750. l = Rl(l, Math.min(u, h)),
  20751. isNaN(s[0]) || isNaN(s[1]) || isNaN(l) || (d = !0)),
  20752. d) {
  20753. var f = {};
  20754. 1 < c ? (f.width = l,
  20755. f.height = l / c) : (f.height = l,
  20756. f.width = l * c),
  20757. f.y = s[1] - f.height / 2,
  20758. f.x = s[0] - f.width / 2
  20759. } else
  20760. (a = t.getBoxLayoutParams()).aspect = c,
  20761. f = bu(a, {
  20762. width: u,
  20763. height: h
  20764. });
  20765. this.setViewRect(f.x, f.y, f.width, f.height),
  20766. this.setCenter(t.get("center")),
  20767. this.setZoom(t.get("zoom"))
  20768. }
  20769. function fx(i, t) {
  20770. E(t.get("geoCoord"), function(t, e) {
  20771. i.addGeoCoord(e, t)
  20772. })
  20773. }
  20774. b(sx, ve),
  20775. lx.prototype = {
  20776. constructor: lx,
  20777. type: "view",
  20778. dimensions: ["x", "y"],
  20779. setBoundingRect: function(t, e, i, n) {
  20780. return this._rect = new Di(t,e,i,n),
  20781. this._rect
  20782. },
  20783. getBoundingRect: function() {
  20784. return this._rect
  20785. },
  20786. setViewRect: function(t, e, i, n) {
  20787. this.transformTo(t, e, i, n),
  20788. this._viewRect = new Di(t,e,i,n)
  20789. },
  20790. transformTo: function(t, e, i, n) {
  20791. var o = this.getBoundingRect()
  20792. , a = this._rawTransformable;
  20793. a.transform = o.calculateTransform(new Di(t,e,i,n)),
  20794. a.decomposeTransform(),
  20795. this._updateTransform()
  20796. },
  20797. setCenter: function(t) {
  20798. t && (this._center = t,
  20799. this._updateCenterAndZoom())
  20800. },
  20801. setZoom: function(t) {
  20802. t = t || 1;
  20803. var e = this.zoomLimit;
  20804. e && (null != e.max && (t = Math.min(e.max, t)),
  20805. null != e.min && (t = Math.max(e.min, t))),
  20806. this._zoom = t,
  20807. this._updateCenterAndZoom()
  20808. },
  20809. getDefaultCenter: function() {
  20810. var t = this.getBoundingRect();
  20811. return [t.x + t.width / 2, t.y + t.height / 2]
  20812. },
  20813. getCenter: function() {
  20814. return this._center || this.getDefaultCenter()
  20815. },
  20816. getZoom: function() {
  20817. return this._zoom || 1
  20818. },
  20819. getRoamTransform: function() {
  20820. return this._roamTransformable.getLocalTransform()
  20821. },
  20822. _updateCenterAndZoom: function() {
  20823. var t = this._rawTransformable.getLocalTransform()
  20824. , e = this._roamTransformable
  20825. , i = this.getDefaultCenter()
  20826. , n = this.getCenter()
  20827. , o = this.getZoom();
  20828. n = bt([], n, t),
  20829. i = bt([], i, t),
  20830. e.origin = n,
  20831. e.position = [i[0] - n[0], i[1] - n[1]],
  20832. e.scale = [o, o],
  20833. this._updateTransform()
  20834. },
  20835. _updateTransform: function() {
  20836. var t = this._roamTransformable
  20837. , e = this._rawTransformable;
  20838. (e.parent = t).updateTransform(),
  20839. e.updateTransform(),
  20840. se(this.transform || (this.transform = []), e.transform || ae()),
  20841. this._rawTransform = e.getLocalTransform(),
  20842. this.invTransform = this.invTransform || [],
  20843. de(this.invTransform, this.transform),
  20844. this.decomposeTransform()
  20845. },
  20846. getTransformInfo: function() {
  20847. var t = this._roamTransformable.transform
  20848. , e = this._rawTransformable;
  20849. return {
  20850. roamTransform: t ? U(t) : ae(),
  20851. rawScale: U(e.scale),
  20852. rawPosition: U(e.position)
  20853. }
  20854. },
  20855. getViewRect: function() {
  20856. return this._viewRect
  20857. },
  20858. getViewRectAfterRoam: function() {
  20859. var t = this.getBoundingRect().clone();
  20860. return t.applyTransform(this.transform),
  20861. t
  20862. },
  20863. dataToPoint: function(t, e, i) {
  20864. var n = e ? this._rawTransform : this.transform;
  20865. return i = i || [],
  20866. n ? rx(i, t, n) : at(i, t)
  20867. },
  20868. pointToData: function(t) {
  20869. var e = this.invTransform;
  20870. return e ? rx([], t, e) : [t[0], t[1]]
  20871. },
  20872. convertToPixel: T(ux, "dataToPoint"),
  20873. convertFromPixel: T(ux, "pointToData"),
  20874. containPoint: function(t) {
  20875. return this.getViewRectAfterRoam().contain(t[0], t[1])
  20876. }
  20877. },
  20878. b(lx, ve),
  20879. hx.prototype = {
  20880. constructor: hx,
  20881. type: "geo",
  20882. dimensions: ["lng", "lat"],
  20883. containCoord: function(t) {
  20884. for (var e = this.regions, i = 0; i < e.length; i++)
  20885. if (e[i].contain(t))
  20886. return !0;
  20887. return !1
  20888. },
  20889. transformTo: function(t, e, i, n) {
  20890. var o = this.getBoundingRect()
  20891. , a = this._invertLongitute;
  20892. o = o.clone(),
  20893. a && (o.y = -o.y - o.height);
  20894. var r = this._rawTransformable;
  20895. if (r.transform = o.calculateTransform(new Di(t,e,i,n)),
  20896. r.decomposeTransform(),
  20897. a) {
  20898. var s = r.scale;
  20899. s[1] = -s[1]
  20900. }
  20901. r.updateTransform(),
  20902. this._updateTransform()
  20903. },
  20904. getRegion: function(t) {
  20905. return this._regionsMap.get(t)
  20906. },
  20907. getRegionByCoord: function(t) {
  20908. for (var e = this.regions, i = 0; i < e.length; i++)
  20909. if (e[i].contain(t))
  20910. return e[i]
  20911. },
  20912. addGeoCoord: function(t, e) {
  20913. this._nameCoordMap.set(t, e)
  20914. },
  20915. getGeoCoord: function(t) {
  20916. return this._nameCoordMap.get(t)
  20917. },
  20918. getBoundingRect: function() {
  20919. return this._rect
  20920. },
  20921. dataToPoint: function(t, e, i) {
  20922. if ("string" == typeof t && (t = this.getGeoCoord(t)),
  20923. t)
  20924. return lx.prototype.dataToPoint.call(this, t, e, i)
  20925. },
  20926. convertToPixel: T(cx, "dataToPoint"),
  20927. convertFromPixel: T(cx, "pointToData")
  20928. },
  20929. b(hx, lx);
  20930. var px = {
  20931. dimensions: hx.prototype.dimensions,
  20932. create: function(t, s) {
  20933. var l = [];
  20934. t.eachComponent("geo", function(t, e) {
  20935. var i = t.get("map")
  20936. , n = t.get("aspectScale")
  20937. , o = !0
  20938. , a = Sd.retrieveMap(i);
  20939. a && a[0] && "svg" === a[0].type ? (null == n && (n = 1),
  20940. o = !1) : null == n && (n = .75);
  20941. var r = new hx(i + e,i,t.get("nameMap"),o);
  20942. r.aspectScale = n,
  20943. r.zoomLimit = t.get("scaleLimit"),
  20944. l.push(r),
  20945. fx(r, t),
  20946. (t.coordinateSystem = r).model = t,
  20947. r.resize = dx,
  20948. r.resize(t, s)
  20949. }),
  20950. t.eachSeries(function(t) {
  20951. if ("geo" === t.get("coordinateSystem")) {
  20952. var e = t.get("geoIndex") || 0;
  20953. t.coordinateSystem = l[e]
  20954. }
  20955. });
  20956. var i = {};
  20957. return t.eachSeriesByType("map", function(t) {
  20958. if (!t.getHostGeoModel()) {
  20959. var e = t.getMapType();
  20960. i[e] = i[e] || [],
  20961. i[e].push(t)
  20962. }
  20963. }),
  20964. E(i, function(t, e) {
  20965. var i = new hx(e,e,p(O(t, function(t) {
  20966. return t.get("nameMap")
  20967. })));
  20968. i.zoomLimit = W.apply(null, O(t, function(t) {
  20969. return t.get("scaleLimit")
  20970. })),
  20971. l.push(i),
  20972. i.resize = dx,
  20973. i.aspectScale = t[0].get("aspectScale"),
  20974. i.resize(t[0], s),
  20975. E(t, function(t) {
  20976. fx(t.coordinateSystem = i, t)
  20977. })
  20978. }),
  20979. l
  20980. },
  20981. getFilledRegions: function(t, e, i) {
  20982. for (var n = (t || []).slice(), o = Q(), a = 0; a < n.length; a++)
  20983. o.set(n[a].name, n[a]);
  20984. return E(Ny.load(e, i).regions, function(t) {
  20985. var e = t.name;
  20986. o.get(e) || n.push({
  20987. name: e
  20988. })
  20989. }),
  20990. n
  20991. }
  20992. };
  20993. wf("geo", px);
  20994. bf(function(i) {
  20995. var o = {};
  20996. i.eachSeriesByType("map", function(t) {
  20997. var e = t.getMapType();
  20998. if (!t.getHostGeoModel() && !o[e]) {
  20999. var l = {};
  21000. E(t.seriesGroup, function(t) {
  21001. var r = t.coordinateSystem
  21002. , s = t.originalData;
  21003. t.get("showLegendSymbol") && i.getComponent("legend") && s.each(s.mapDimension("value"), function(t, e) {
  21004. var i = s.getName(e)
  21005. , n = r.getRegion(i);
  21006. if (n && !isNaN(t)) {
  21007. var o = l[i] || 0
  21008. , a = r.dataToPoint(n.center);
  21009. l[i] = o + 1,
  21010. s.setItemLayout(e, {
  21011. point: a,
  21012. offset: o
  21013. })
  21014. }
  21015. })
  21016. });
  21017. var n = t.getData();
  21018. n.each(function(t) {
  21019. var e = n.getName(t)
  21020. , i = n.getItemLayout(t) || {};
  21021. i.showLabel = !l[e],
  21022. n.setItemLayout(t, i)
  21023. }),
  21024. o[e] = !0
  21025. }
  21026. })
  21027. }),
  21028. Sf(function(t) {
  21029. t.eachSeriesByType("map", function(t) {
  21030. var e = t.get("color")
  21031. , i = t.getModel("itemStyle")
  21032. , n = i.get("areaColor")
  21033. , o = i.get("color") || e[t.seriesIndex % e.length];
  21034. t.getData().setVisual({
  21035. areaColor: n,
  21036. color: o
  21037. })
  21038. })
  21039. }),
  21040. xf(Ld.PROCESSOR.STATISTIC, function(t) {
  21041. var n = {};
  21042. t.eachSeriesByType("map", function(t) {
  21043. var e = t.getHostGeoModel()
  21044. , i = e ? "o" + e.id : "i" + t.getMapType();
  21045. (n[i] = n[i] || []).push(t)
  21046. }),
  21047. E(n, function(t, e) {
  21048. for (var i = function(u, h) {
  21049. var c = {};
  21050. return E(u, function(n) {
  21051. n.each(n.mapDimension("value"), function(t, e) {
  21052. var i = "ec-" + n.getName(e);
  21053. c[i] = c[i] || [],
  21054. isNaN(t) || c[i].push(t)
  21055. })
  21056. }),
  21057. u[0].map(u[0].mapDimension("value"), function(t, e) {
  21058. for (var i, n = "ec-" + u[0].getName(e), o = 0, a = 1 / 0, r = -1 / 0, s = c[n].length, l = 0; l < s; l++)
  21059. a = Math.min(a, c[n][l]),
  21060. r = Math.max(r, c[n][l]),
  21061. o += c[n][l];
  21062. return i = "min" === h ? a : "max" === h ? r : "average" === h ? o / s : o,
  21063. 0 === s ? NaN : i
  21064. })
  21065. }(O(t, function(t) {
  21066. return t.getData()
  21067. }), t[0].get("mapValueCalculation")), n = 0; n < t.length; n++)
  21068. t[n].originalData = t[n].getData();
  21069. for (n = 0; n < t.length; n++)
  21070. (t[n].seriesGroup = t)[n].needsDrawMap = 0 === n && !t[n].getHostGeoModel(),
  21071. t[n].setData(i.cloneShallow()),
  21072. t[n].mainSeries = t[0]
  21073. })
  21074. }),
  21075. yf(function(t) {
  21076. var e = [];
  21077. E(t.series, function(t) {
  21078. t && "map" === t.type && (e.push(t),
  21079. t.map = t.map || t.mapType,
  21080. D(t, t.mapLocation))
  21081. })
  21082. }),
  21083. ey("map", [{
  21084. type: "mapToggleSelect",
  21085. event: "mapselectchanged",
  21086. method: "toggleSelected"
  21087. }, {
  21088. type: "mapSelect",
  21089. event: "mapselected",
  21090. method: "select"
  21091. }, {
  21092. type: "mapUnSelect",
  21093. event: "mapunselected",
  21094. method: "unSelect"
  21095. }]);
  21096. var gx = E
  21097. , mx = "\0__link_datas"
  21098. , vx = "\0__link_mainData";
  21099. function yx(i) {
  21100. var n = i.mainData
  21101. , t = i.datas;
  21102. t || (t = {
  21103. main: n
  21104. },
  21105. i.datasAttr = {
  21106. main: "data"
  21107. }),
  21108. i.datas = i.mainData = null,
  21109. Mx(n, t, i),
  21110. gx(t, function(e) {
  21111. gx(n.TRANSFERABLE_METHODS, function(t) {
  21112. e.wrapMethod(t, T(xx, i))
  21113. })
  21114. }),
  21115. n.wrapMethod("cloneShallow", T(bx, i)),
  21116. gx(n.CHANGABLE_METHODS, function(t) {
  21117. n.wrapMethod(t, T(_x, i))
  21118. }),
  21119. Y(t[n.dataType] === n)
  21120. }
  21121. function xx(t, e) {
  21122. if (function(t) {
  21123. return t[vx] === t
  21124. }(this)) {
  21125. var i = P({}, this[mx]);
  21126. Mx(i[this.dataType] = e, i, t)
  21127. } else
  21128. Ix(e, this.dataType, this[vx], t);
  21129. return e
  21130. }
  21131. function _x(t, e) {
  21132. return t.struct && t.struct.update(this),
  21133. e
  21134. }
  21135. function bx(i, n) {
  21136. return gx(n[mx], function(t, e) {
  21137. t !== n && Ix(t.cloneShallow(), e, n, i)
  21138. }),
  21139. n
  21140. }
  21141. function Sx(t) {
  21142. var e = this[vx];
  21143. return null == t || null == e ? e : e[mx][t]
  21144. }
  21145. function Mx(i, t, n) {
  21146. i[mx] = {},
  21147. gx(t, function(t, e) {
  21148. Ix(t, e, i, n)
  21149. })
  21150. }
  21151. function Ix(t, e, i, n) {
  21152. (i[mx][e] = t)[vx] = i,
  21153. t.dataType = e,
  21154. n.struct && (t[n.structAttr] = n.struct,
  21155. n.struct[n.datasAttr[e]] = t),
  21156. t.getLinkedData = Sx
  21157. }
  21158. function Tx(t, e) {
  21159. this.name = t || "",
  21160. this.depth = 0,
  21161. this.height = 0,
  21162. this.parentNode = null,
  21163. this.dataIndex = -1,
  21164. this.children = [],
  21165. this.viewChildren = [],
  21166. this.hostTree = e
  21167. }
  21168. function Ax(e, t) {
  21169. this.root,
  21170. this.data,
  21171. this._nodes = [],
  21172. this.hostModel = e,
  21173. this.levelModels = O(t || [], function(t) {
  21174. return new Cl(t,e,e.ecModel)
  21175. })
  21176. }
  21177. function Dx(t, e) {
  21178. var i = e.children;
  21179. t.parentNode !== e && (i.push(t),
  21180. t.parentNode = e)
  21181. }
  21182. function Cx(t, e) {
  21183. var i = t.isExpand ? t.children : []
  21184. , n = t.parentNode.children
  21185. , o = t.hierNode.i ? n[t.hierNode.i - 1] : null;
  21186. if (i.length) {
  21187. !function(t) {
  21188. var e = t.children
  21189. , i = e.length
  21190. , n = 0
  21191. , o = 0;
  21192. for (; 0 <= --i; ) {
  21193. var a = e[i];
  21194. a.hierNode.prelim += n,
  21195. a.hierNode.modifier += n,
  21196. o += a.hierNode.change,
  21197. n += a.hierNode.shift + o
  21198. }
  21199. }(t);
  21200. var a = (i[0].hierNode.prelim + i[i.length - 1].hierNode.prelim) / 2;
  21201. o ? (t.hierNode.prelim = o.hierNode.prelim + e(t, o),
  21202. t.hierNode.modifier = t.hierNode.prelim - a) : t.hierNode.prelim = a
  21203. } else
  21204. o && (t.hierNode.prelim = o.hierNode.prelim + e(t, o));
  21205. t.parentNode.hierNode.defaultAncestor = function(t, e, i, n) {
  21206. if (e) {
  21207. for (var o = t, a = t, r = a.parentNode.children[0], s = e, l = o.hierNode.modifier, u = a.hierNode.modifier, h = r.hierNode.modifier, c = s.hierNode.modifier; s = Nx(s),
  21208. a = Ox(a),
  21209. s && a; ) {
  21210. o = Nx(o),
  21211. r = Ox(r),
  21212. o.hierNode.ancestor = t;
  21213. var d = s.hierNode.prelim + c - a.hierNode.prelim - u + n(s, a);
  21214. 0 < d && (Ex((p = t,
  21215. g = i,
  21216. (f = s).hierNode.ancestor.parentNode === p.parentNode ? f.hierNode.ancestor : g), t, d),
  21217. u += d,
  21218. l += d),
  21219. c += s.hierNode.modifier,
  21220. u += a.hierNode.modifier,
  21221. l += o.hierNode.modifier,
  21222. h += r.hierNode.modifier
  21223. }
  21224. s && !Nx(o) && (o.hierNode.thread = s,
  21225. o.hierNode.modifier += c - l),
  21226. a && !Ox(r) && (r.hierNode.thread = a,
  21227. r.hierNode.modifier += u - h,
  21228. i = t)
  21229. }
  21230. var f, p, g;
  21231. return i
  21232. }(t, o, t.parentNode.hierNode.defaultAncestor || n[0], e)
  21233. }
  21234. function Lx(t) {
  21235. var e = t.hierNode.prelim + t.parentNode.hierNode.modifier;
  21236. t.setLayout({
  21237. x: e
  21238. }, !0),
  21239. t.hierNode.modifier += t.parentNode.hierNode.modifier
  21240. }
  21241. function kx(t) {
  21242. return arguments.length ? t : Rx
  21243. }
  21244. function Px(t, e) {
  21245. var i = {};
  21246. return t -= Math.PI / 2,
  21247. i.x = e * Math.cos(t),
  21248. i.y = e * Math.sin(t),
  21249. i
  21250. }
  21251. function Nx(t) {
  21252. var e = t.children;
  21253. return e.length && t.isExpand ? e[e.length - 1] : t.hierNode.thread
  21254. }
  21255. function Ox(t) {
  21256. var e = t.children;
  21257. return e.length && t.isExpand ? e[0] : t.hierNode.thread
  21258. }
  21259. function Ex(t, e, i) {
  21260. var n = i / (e.hierNode.i - t.hierNode.i);
  21261. e.hierNode.change -= n,
  21262. e.hierNode.shift += i,
  21263. e.hierNode.modifier += i,
  21264. e.hierNode.prelim += i,
  21265. t.hierNode.change += n
  21266. }
  21267. function Rx(t, e) {
  21268. return t.parentNode === e.parentNode ? 1 : 2
  21269. }
  21270. Tx.prototype = {
  21271. constructor: Tx,
  21272. isRemoved: function() {
  21273. return this.dataIndex < 0
  21274. },
  21275. eachNode: function(t, e, i) {
  21276. "function" == typeof t && (i = e,
  21277. e = t,
  21278. t = null),
  21279. R(t = t || {}) && (t = {
  21280. order: t
  21281. });
  21282. var n, o = t.order || "preorder", a = this[t.attr || "children"];
  21283. "preorder" === o && (n = e.call(i, this));
  21284. for (var r = 0; !n && r < a.length; r++)
  21285. a[r].eachNode(t, e, i);
  21286. "postorder" === o && e.call(i, this)
  21287. },
  21288. updateDepthAndHeight: function(t) {
  21289. var e = 0;
  21290. this.depth = t;
  21291. for (var i = 0; i < this.children.length; i++) {
  21292. var n = this.children[i];
  21293. n.updateDepthAndHeight(t + 1),
  21294. n.height > e && (e = n.height)
  21295. }
  21296. this.height = e + 1
  21297. },
  21298. getNodeById: function(t) {
  21299. if (this.getId() === t)
  21300. return this;
  21301. for (var e = 0, i = this.children, n = i.length; e < n; e++) {
  21302. var o = i[e].getNodeById(t);
  21303. if (o)
  21304. return o
  21305. }
  21306. },
  21307. contains: function(t) {
  21308. if (t === this)
  21309. return !0;
  21310. for (var e = 0, i = this.children, n = i.length; e < n; e++) {
  21311. var o = i[e].contains(t);
  21312. if (o)
  21313. return o
  21314. }
  21315. },
  21316. getAncestors: function(t) {
  21317. for (var e = [], i = t ? this : this.parentNode; i; )
  21318. e.push(i),
  21319. i = i.parentNode;
  21320. return e.reverse(),
  21321. e
  21322. },
  21323. getValue: function(t) {
  21324. var e = this.hostTree.data;
  21325. return e.get(e.getDimension(t || "value"), this.dataIndex)
  21326. },
  21327. setLayout: function(t, e) {
  21328. 0 <= this.dataIndex && this.hostTree.data.setItemLayout(this.dataIndex, t, e)
  21329. },
  21330. getLayout: function() {
  21331. return this.hostTree.data.getItemLayout(this.dataIndex)
  21332. },
  21333. getModel: function(t) {
  21334. if (!(this.dataIndex < 0)) {
  21335. var e = this.hostTree.data.getItemModel(this.dataIndex)
  21336. , i = this.getLevelModel();
  21337. return i ? e.getModel(t, i.getModel(t)) : e.getModel(t)
  21338. }
  21339. },
  21340. getLevelModel: function() {
  21341. return (this.hostTree.levelModels || [])[this.depth]
  21342. },
  21343. setVisual: function(t, e) {
  21344. 0 <= this.dataIndex && this.hostTree.data.setItemVisual(this.dataIndex, t, e)
  21345. },
  21346. getVisual: function(t, e) {
  21347. return this.hostTree.data.getItemVisual(this.dataIndex, t, e)
  21348. },
  21349. getRawIndex: function() {
  21350. return this.hostTree.data.getRawIndex(this.dataIndex)
  21351. },
  21352. getId: function() {
  21353. return this.hostTree.data.getId(this.dataIndex)
  21354. },
  21355. isAncestorOf: function(t) {
  21356. for (var e = t.parentNode; e; ) {
  21357. if (e === this)
  21358. return !0;
  21359. e = e.parentNode
  21360. }
  21361. return !1
  21362. },
  21363. isDescendantOf: function(t) {
  21364. return t !== this && t.isAncestorOf(this)
  21365. }
  21366. },
  21367. Ax.prototype = {
  21368. constructor: Ax,
  21369. type: "tree",
  21370. eachNode: function(t, e, i) {
  21371. this.root.eachNode(t, e, i)
  21372. },
  21373. getNodeByDataIndex: function(t) {
  21374. var e = this.data.getRawIndex(t);
  21375. return this._nodes[e]
  21376. },
  21377. getNodeByName: function(t) {
  21378. return this.root.getNodeByName(t)
  21379. },
  21380. update: function() {
  21381. for (var t = this.data, e = this._nodes, i = 0, n = e.length; i < n; i++)
  21382. e[i].dataIndex = -1;
  21383. for (i = 0,
  21384. n = t.count(); i < n; i++)
  21385. e[t.getRawIndex(i)].dataIndex = i
  21386. },
  21387. clearLayouts: function() {
  21388. this.data.clearItemLayouts()
  21389. }
  21390. },
  21391. Ax.createTree = function(t, e, i, n) {
  21392. var s = new Ax(e,i && i.levels)
  21393. , l = []
  21394. , u = 1;
  21395. !function t(e, i) {
  21396. var n = e.value;
  21397. u = Math.max(u, L(n) ? n.length : 1);
  21398. l.push(e);
  21399. var o = new Tx(e.name,s);
  21400. i ? Dx(o, i) : s.root = o;
  21401. s._nodes.push(o);
  21402. var a = e.children;
  21403. if (a)
  21404. for (var r = 0; r < a.length; r++)
  21405. t(a[r], o)
  21406. }(t),
  21407. s.root.updateDepthAndHeight(0);
  21408. var o = lp(l, {
  21409. coordDimensions: ["value"],
  21410. dimensionsCount: u
  21411. })
  21412. , a = new Yf(o,e);
  21413. return a.initData(l),
  21414. n && n(a),
  21415. yx({
  21416. mainData: a,
  21417. struct: s,
  21418. structAttr: "tree"
  21419. }),
  21420. s.update(),
  21421. s
  21422. }
  21423. ,
  21424. sc.extend({
  21425. type: "series.tree",
  21426. layoutInfo: null,
  21427. layoutMode: "box",
  21428. getInitialData: function(t) {
  21429. var e = {
  21430. name: t.name,
  21431. children: t.data
  21432. }
  21433. , n = new Cl(t.leaves || {},this,this.ecModel)
  21434. , o = Ax.createTree(e, this, {}, function(t) {
  21435. t.wrapMethod("getItemModel", function(t, e) {
  21436. var i = o.getNodeByDataIndex(e);
  21437. return i.children.length && i.isExpand || (t.parentModel = n),
  21438. t
  21439. })
  21440. });
  21441. var i = 0;
  21442. o.eachNode("preorder", function(t) {
  21443. t.depth > i && (i = t.depth)
  21444. });
  21445. var a = t.expandAndCollapse && 0 <= t.initialTreeDepth ? t.initialTreeDepth : i;
  21446. return o.root.eachNode("preorder", function(t) {
  21447. var e = t.hostTree.data.getRawDataItem(t.dataIndex);
  21448. t.isExpand = e && null != e.collapsed ? !e.collapsed : t.depth <= a
  21449. }),
  21450. o.data
  21451. },
  21452. getOrient: function() {
  21453. var t = this.get("orient");
  21454. return "horizontal" === t ? t = "LR" : "vertical" === t && (t = "TB"),
  21455. t
  21456. },
  21457. setZoom: function(t) {
  21458. this.option.zoom = t
  21459. },
  21460. setCenter: function(t) {
  21461. this.option.center = t
  21462. },
  21463. formatTooltip: function(t) {
  21464. for (var e = this.getData().tree, i = e.root.children[0], n = e.getNodeByDataIndex(t), o = n.getValue(), a = n.name; n && n !== i; )
  21465. a = n.parentNode.name + "." + a,
  21466. n = n.parentNode;
  21467. return au(a + (isNaN(o) || null == o ? "" : " : " + o))
  21468. },
  21469. defaultOption: {
  21470. zlevel: 0,
  21471. z: 2,
  21472. coordinateSystem: "view",
  21473. left: "12%",
  21474. top: "12%",
  21475. right: "12%",
  21476. bottom: "12%",
  21477. layout: "orthogonal",
  21478. edgeShape: "curve",
  21479. edgeForkPosition: "50%",
  21480. roam: !1,
  21481. nodeScaleRatio: .4,
  21482. center: null,
  21483. zoom: 1,
  21484. orient: "LR",
  21485. symbol: "emptyCircle",
  21486. symbolSize: 7,
  21487. expandAndCollapse: !0,
  21488. initialTreeDepth: 2,
  21489. lineStyle: {
  21490. color: "#ccc",
  21491. width: 1.5,
  21492. curveness: .5
  21493. },
  21494. itemStyle: {
  21495. color: "lightsteelblue",
  21496. borderColor: "#c23531",
  21497. borderWidth: 1.5
  21498. },
  21499. label: {
  21500. show: !0,
  21501. color: "#555"
  21502. },
  21503. leaves: {
  21504. label: {
  21505. show: !0
  21506. }
  21507. },
  21508. animationEasing: "linear",
  21509. animationDuration: 700,
  21510. animationDurationUpdate: 1e3
  21511. }
  21512. });
  21513. var zx = Cs({
  21514. shape: {
  21515. parentPoint: [],
  21516. childPoints: [],
  21517. orient: "",
  21518. forkPosition: ""
  21519. },
  21520. style: {
  21521. stroke: "#000",
  21522. fill: null
  21523. },
  21524. buildPath: function(t, e) {
  21525. var i = e.childPoints
  21526. , n = i.length
  21527. , o = e.parentPoint
  21528. , a = i[0]
  21529. , r = i[n - 1];
  21530. if (1 === n)
  21531. return t.moveTo(o[0], o[1]),
  21532. void t.lineTo(a[0], a[1]);
  21533. var s = e.orient
  21534. , l = "TB" === s || "BT" === s ? 0 : 1
  21535. , u = 1 - l
  21536. , h = Rl(e.forkPosition, 1)
  21537. , c = [];
  21538. c[l] = o[l],
  21539. c[u] = o[u] + (r[u] - o[u]) * h,
  21540. t.moveTo(o[0], o[1]),
  21541. t.lineTo(c[0], c[1]),
  21542. t.moveTo(a[0], a[1]),
  21543. c[l] = a[l],
  21544. t.lineTo(c[0], c[1]),
  21545. c[l] = r[l],
  21546. t.lineTo(c[0], c[1]),
  21547. t.lineTo(r[0], r[1]);
  21548. for (var d = 1; d < n - 1; d++) {
  21549. var f = i[d];
  21550. t.moveTo(f[0], f[1]),
  21551. c[l] = f[l],
  21552. t.lineTo(c[0], c[1])
  21553. }
  21554. }
  21555. });
  21556. function Bx(t, e) {
  21557. var i = t.getItemLayout(e);
  21558. return i && !isNaN(i.x) && !isNaN(i.y) && "none" !== t.getItemVisual(e, "symbol")
  21559. }
  21560. function Vx(t, e, i) {
  21561. return i.itemModel = e,
  21562. i.itemStyle = e.getModel("itemStyle").getItemStyle(),
  21563. i.hoverItemStyle = e.getModel("emphasis.itemStyle").getItemStyle(),
  21564. i.lineStyle = e.getModel("lineStyle").getLineStyle(),
  21565. i.labelModel = e.getModel("label"),
  21566. i.hoverLabelModel = e.getModel("emphasis.label"),
  21567. !1 === t.isExpand && 0 !== t.children.length ? i.symbolInnerColor = i.itemStyle.fill : i.symbolInnerColor = "#fff",
  21568. i
  21569. }
  21570. function Gx(t, e, i, n, o, a) {
  21571. var r = !i
  21572. , s = t.tree.getNodeByDataIndex(e)
  21573. , l = s.getModel()
  21574. , u = (a = Vx(s, l, a),
  21575. t.tree.root)
  21576. , h = s.parentNode === u ? s : s.parentNode || s
  21577. , c = t.getItemGraphicEl(h.dataIndex)
  21578. , d = h.getLayout()
  21579. , f = c ? {
  21580. x: c.position[0],
  21581. y: c.position[1],
  21582. rawX: c.__radialOldRawX,
  21583. rawY: c.__radialOldRawY
  21584. } : d
  21585. , p = s.getLayout();
  21586. r ? (i = new Xg(t,e,a)).attr("position", [f.x, f.y]) : i.updateData(t, e, a),
  21587. i.__radialOldRawX = i.__radialRawX,
  21588. i.__radialOldRawY = i.__radialRawY,
  21589. i.__radialRawX = p.rawX,
  21590. i.__radialRawY = p.rawY,
  21591. n.add(i),
  21592. t.setItemGraphicEl(e, i),
  21593. cl(i, {
  21594. position: [p.x, p.y]
  21595. }, o);
  21596. var g = i.getSymbolPath();
  21597. if ("radial" === a.layout) {
  21598. var m, v, y = u.children[0], x = y.getLayout(), _ = y.children.length;
  21599. if (p.x === x.x && !0 === s.isExpand) {
  21600. var w = {};
  21601. w.x = (y.children[0].getLayout().x + y.children[_ - 1].getLayout().x) / 2,
  21602. w.y = (y.children[0].getLayout().y + y.children[_ - 1].getLayout().y) / 2,
  21603. (m = Math.atan2(w.y - x.y, w.x - x.x)) < 0 && (m = 2 * Math.PI + m),
  21604. (v = w.x < x.x) && (m -= Math.PI)
  21605. } else
  21606. (m = Math.atan2(p.y - x.y, p.x - x.x)) < 0 && (m = 2 * Math.PI + m),
  21607. 0 === s.children.length || 0 !== s.children.length && !1 === s.isExpand ? (v = p.x < x.x) && (m -= Math.PI) : (v = p.x > x.x) || (m -= Math.PI);
  21608. var b = v ? "left" : "right"
  21609. , S = a.labelModel.get("rotate")
  21610. , M = S * (Math.PI / 180);
  21611. g.setStyle({
  21612. textPosition: a.labelModel.get("position") || b,
  21613. textRotation: null == S ? -m : M,
  21614. textOrigin: "center",
  21615. verticalAlign: "middle"
  21616. })
  21617. }
  21618. !function(t, e, i, n, o, a, r, s, l) {
  21619. var u = l.edgeShape
  21620. , h = n.__edge;
  21621. if ("curve" === u)
  21622. e.parentNode && e.parentNode !== i && cl(h = h || (n.__edge = new ds({
  21623. shape: Wx(l, o, o),
  21624. style: D({
  21625. opacity: 0,
  21626. strokeNoScale: !0
  21627. }, l.lineStyle)
  21628. })), {
  21629. shape: Wx(l, a, r),
  21630. style: {
  21631. opacity: 1
  21632. }
  21633. }, t);
  21634. else if ("polyline" === u && "orthogonal" === l.layout && e !== i && e.children && 0 !== e.children.length && !0 === e.isExpand) {
  21635. for (var c = e.children, d = [], f = 0; f < c.length; f++) {
  21636. var p = c[f].getLayout();
  21637. d.push([p.x, p.y])
  21638. }
  21639. cl(h = h || (n.__edge = new zx({
  21640. shape: {
  21641. parentPoint: [r.x, r.y],
  21642. childPoints: [[r.x, r.y]],
  21643. orient: l.orient,
  21644. forkPosition: l.edgeForkPosition
  21645. },
  21646. style: D({
  21647. opacity: 0,
  21648. strokeNoScale: !0
  21649. }, l.lineStyle)
  21650. })), {
  21651. shape: {
  21652. parentPoint: [r.x, r.y],
  21653. childPoints: d
  21654. },
  21655. style: {
  21656. opacity: 1
  21657. }
  21658. }, t)
  21659. }
  21660. s.add(h)
  21661. }(o, s, u, i, f, d, p, n, a)
  21662. }
  21663. function Fx(t, e, i, n, o, a) {
  21664. for (var r, s = t.tree.getNodeByDataIndex(e), l = t.tree.root, u = s.getModel(), h = (a = Vx(s, u, a),
  21665. s.parentNode === l ? s : s.parentNode || s), c = a.edgeShape; null == (r = h.getLayout()); )
  21666. h = h.parentNode === l ? h : h.parentNode || h;
  21667. cl(i, {
  21668. position: [r.x + 1, r.y + 1]
  21669. }, o, function() {
  21670. n.remove(i),
  21671. t.setItemGraphicEl(e, null)
  21672. }),
  21673. i.fadeOut(null, {
  21674. keepLabel: !0
  21675. });
  21676. var d = t.getItemGraphicEl(h.dataIndex).__edge
  21677. , f = i.__edge || (!1 === h.isExpand || 1 === h.children.length ? d : void 0);
  21678. c = a.edgeShape;
  21679. f && ("curve" === c ? cl(f, {
  21680. shape: Wx(a, r, r),
  21681. style: {
  21682. opacity: 0
  21683. }
  21684. }, o, function() {
  21685. n.remove(f)
  21686. }) : "polyline" === c && "orthogonal" === a.layout && cl(f, {
  21687. shape: {
  21688. parentPoint: [r.x, r.y],
  21689. childPoints: [[r.x, r.y]]
  21690. },
  21691. style: {
  21692. opacity: 0
  21693. }
  21694. }, o, function() {
  21695. n.remove(f)
  21696. }))
  21697. }
  21698. function Wx(t, e, i) {
  21699. var n, o, a, r, s, l, u, h, c = t.orient;
  21700. if ("radial" !== t.layout)
  21701. return s = e.x,
  21702. u = e.y,
  21703. l = i.x,
  21704. h = i.y,
  21705. "LR" !== c && "RL" !== c || (n = s + (l - s) * t.curvature,
  21706. o = u,
  21707. a = l + (s - l) * t.curvature,
  21708. r = h),
  21709. "TB" !== c && "BT" !== c || (n = s,
  21710. o = u + (h - u) * t.curvature,
  21711. a = l,
  21712. r = h + (u - h) * t.curvature),
  21713. {
  21714. x1: s,
  21715. y1: u,
  21716. x2: l,
  21717. y2: h,
  21718. cpx1: n,
  21719. cpy1: o,
  21720. cpx2: a,
  21721. cpy2: r
  21722. };
  21723. s = e.rawX,
  21724. u = e.rawY,
  21725. l = i.rawX,
  21726. h = i.rawY;
  21727. var d = Px(s, u)
  21728. , f = Px(s, u + (h - u) * t.curvature)
  21729. , p = Px(l, h + (u - h) * t.curvature)
  21730. , g = Px(l, h);
  21731. return {
  21732. x1: d.x,
  21733. y1: d.y,
  21734. x2: g.x,
  21735. y2: g.y,
  21736. cpx1: f.x,
  21737. cpy1: f.y,
  21738. cpx2: p.x,
  21739. cpy2: p.y
  21740. }
  21741. }
  21742. function Hx(t, e) {
  21743. for (var i, n = [t]; i = n.pop(); )
  21744. if (e(i),
  21745. i.isExpand) {
  21746. var o = i.children;
  21747. if (o.length)
  21748. for (var a = o.length - 1; 0 <= a; a--)
  21749. n.push(o[a])
  21750. }
  21751. }
  21752. Cf({
  21753. type: "tree",
  21754. init: function(t, e) {
  21755. this._oldTree,
  21756. this._mainGroup = new Ci,
  21757. this._controller = new Vy(e.getZr()),
  21758. this._controllerHost = {
  21759. target: this.group
  21760. },
  21761. this.group.add(this._mainGroup)
  21762. },
  21763. render: function(n, t, i, e) {
  21764. var o = n.getData()
  21765. , a = n.layoutInfo
  21766. , r = this._mainGroup
  21767. , s = n.get("layout");
  21768. "radial" === s ? r.attr("position", [a.x + a.width / 2, a.y + a.height / 2]) : r.attr("position", [a.x, a.y]),
  21769. this._updateViewCoordSys(n, a, s),
  21770. this._updateController(n, t, i);
  21771. var l = this._data
  21772. , u = {
  21773. expandAndCollapse: n.get("expandAndCollapse"),
  21774. layout: s,
  21775. edgeShape: n.get("edgeShape"),
  21776. edgeForkPosition: n.get("edgeForkPosition"),
  21777. orient: n.getOrient(),
  21778. curvature: n.get("lineStyle.curveness"),
  21779. symbolRotate: n.get("symbolRotate"),
  21780. symbolOffset: n.get("symbolOffset"),
  21781. hoverAnimation: n.get("hoverAnimation"),
  21782. useNameLabel: !0,
  21783. fadeIn: !0
  21784. };
  21785. o.diff(l).add(function(t) {
  21786. Bx(o, t) && Gx(o, t, null, r, n, u)
  21787. }).update(function(t, e) {
  21788. var i = l.getItemGraphicEl(e);
  21789. Bx(o, t) ? Gx(o, t, i, r, n, u) : i && Fx(l, e, i, r, n, u)
  21790. }).remove(function(t) {
  21791. var e = l.getItemGraphicEl(t);
  21792. e && Fx(l, t, e, r, n, u)
  21793. }).execute(),
  21794. this._nodeScaleRatio = n.get("nodeScaleRatio"),
  21795. this._updateNodeAndLinkScale(n),
  21796. !0 === u.expandAndCollapse && o.eachItemGraphicEl(function(t, e) {
  21797. t.off("click").on("click", function() {
  21798. i.dispatchAction({
  21799. type: "treeExpandAndCollapse",
  21800. seriesId: n.id,
  21801. dataIndex: e
  21802. })
  21803. })
  21804. }),
  21805. this._data = o
  21806. },
  21807. _updateViewCoordSys: function(t) {
  21808. var i = t.getData()
  21809. , n = [];
  21810. i.each(function(t) {
  21811. var e = i.getItemLayout(t);
  21812. !e || isNaN(e.x) || isNaN(e.y) || n.push([+e.x, +e.y])
  21813. });
  21814. var e = []
  21815. , o = [];
  21816. Wa(n, e, o);
  21817. var a = this._min
  21818. , r = this._max;
  21819. o[0] - e[0] == 0 && (e[0] = a ? a[0] : e[0] - 1,
  21820. o[0] = r ? r[0] : o[0] + 1),
  21821. o[1] - e[1] == 0 && (e[1] = a ? a[1] : e[1] - 1,
  21822. o[1] = r ? r[1] : o[1] + 1);
  21823. var s = t.coordinateSystem = new lx;
  21824. s.zoomLimit = t.get("scaleLimit"),
  21825. s.setBoundingRect(e[0], e[1], o[0] - e[0], o[1] - e[1]),
  21826. s.setCenter(t.get("center")),
  21827. s.setZoom(t.get("zoom")),
  21828. this.group.attr({
  21829. position: s.position,
  21830. scale: s.scale
  21831. }),
  21832. this._viewCoordSys = s,
  21833. this._min = e,
  21834. this._max = o
  21835. },
  21836. _updateController: function(o, t, a) {
  21837. var e = this._controller
  21838. , i = this._controllerHost
  21839. , r = this.group;
  21840. e.setPointerChecker(function(t, e, i) {
  21841. var n = r.getBoundingRect();
  21842. return n.applyTransform(r.transform),
  21843. n.contain(e, i) && !$y(t, a, o)
  21844. }),
  21845. e.enable(o.get("roam")),
  21846. i.zoomLimit = o.get("scaleLimit"),
  21847. i.zoom = o.coordinateSystem.getZoom(),
  21848. e.off("pan").off("zoom").on("pan", function(t) {
  21849. jy(i, t.dx, t.dy),
  21850. a.dispatchAction({
  21851. seriesId: o.id,
  21852. type: "treeRoam",
  21853. dx: t.dx,
  21854. dy: t.dy
  21855. })
  21856. }, this).on("zoom", function(t) {
  21857. qy(i, t.scale, t.originX, t.originY),
  21858. a.dispatchAction({
  21859. seriesId: o.id,
  21860. type: "treeRoam",
  21861. zoom: t.scale,
  21862. originX: t.originX,
  21863. originY: t.originY
  21864. }),
  21865. this._updateNodeAndLinkScale(o)
  21866. }, this)
  21867. },
  21868. _updateNodeAndLinkScale: function(t) {
  21869. var e = t.getData()
  21870. , i = this._getNodeGlobalScale(t)
  21871. , n = [i, i];
  21872. e.eachItemGraphicEl(function(t, e) {
  21873. t.attr("scale", n)
  21874. })
  21875. },
  21876. _getNodeGlobalScale: function(t) {
  21877. var e = t.coordinateSystem;
  21878. if ("view" !== e.type)
  21879. return 1;
  21880. var i = this._nodeScaleRatio
  21881. , n = e.scale
  21882. , o = n && n[0] || 1;
  21883. return ((e.getZoom() - 1) * i + 1) / o
  21884. },
  21885. dispose: function() {
  21886. this._controller && this._controller.dispose(),
  21887. this._controllerHost = {}
  21888. },
  21889. remove: function() {
  21890. this._mainGroup.removeAll(),
  21891. this._data = null
  21892. }
  21893. }),
  21894. _f({
  21895. type: "treeExpandAndCollapse",
  21896. event: "treeExpandAndCollapse",
  21897. update: "update"
  21898. }, function(n, t) {
  21899. t.eachComponent({
  21900. mainType: "series",
  21901. subType: "tree",
  21902. query: n
  21903. }, function(t) {
  21904. var e = n.dataIndex
  21905. , i = t.getData().tree.getNodeByDataIndex(e);
  21906. i.isExpand = !i.isExpand
  21907. })
  21908. }),
  21909. _f({
  21910. type: "treeRoam",
  21911. event: "treeRoam",
  21912. update: "none"
  21913. }, function(i, t) {
  21914. t.eachComponent({
  21915. mainType: "series",
  21916. subType: "tree",
  21917. query: i
  21918. }, function(t) {
  21919. var e = ax(t.coordinateSystem, i);
  21920. t.setCenter && t.setCenter(e.center),
  21921. t.setZoom && t.setZoom(e.zoom)
  21922. })
  21923. });
  21924. function Zx(t, e, i) {
  21925. if (t && 0 <= _(e, t.type)) {
  21926. var n = i.getData().tree.root
  21927. , o = t.targetNode;
  21928. if ("string" == typeof o && (o = n.getNodeById(o)),
  21929. o && n.contains(o))
  21930. return {
  21931. node: o
  21932. };
  21933. var a = t.targetNodeId;
  21934. if (null != a && (o = n.getNodeById(a)))
  21935. return {
  21936. node: o
  21937. }
  21938. }
  21939. }
  21940. function Ux(t) {
  21941. for (var e = []; t; )
  21942. (t = t.parentNode) && e.push(t);
  21943. return e.reverse()
  21944. }
  21945. function Xx(t, e) {
  21946. return 0 <= _(Ux(t), e)
  21947. }
  21948. function Yx(t, e) {
  21949. for (var i = []; t; ) {
  21950. var n = t.dataIndex;
  21951. i.push({
  21952. name: t.name,
  21953. dataIndex: n,
  21954. value: e.getRawValue(n)
  21955. }),
  21956. t = t.parentNode
  21957. }
  21958. return i.reverse(),
  21959. i
  21960. }
  21961. Sf(Lm("tree", "circle")),
  21962. bf(function(t, e) {
  21963. t.eachSeriesByType("tree", function(t) {
  21964. !function(t, e) {
  21965. var i = function(t, e) {
  21966. return bu(t.getBoxLayoutParams(), {
  21967. width: e.getWidth(),
  21968. height: e.getHeight()
  21969. })
  21970. }(t, e);
  21971. t.layoutInfo = i;
  21972. var n = t.get("layout")
  21973. , o = 0
  21974. , a = 0
  21975. , r = null;
  21976. r = "radial" === n ? (o = 2 * Math.PI,
  21977. a = Math.min(i.height, i.width) / 2,
  21978. kx(function(t, e) {
  21979. return (t.parentNode === e.parentNode ? 1 : 2) / t.depth
  21980. })) : (o = i.width,
  21981. a = i.height,
  21982. kx());
  21983. var s = t.getData().tree.root
  21984. , l = s.children[0];
  21985. if (l) {
  21986. !function(t) {
  21987. t.hierNode = {
  21988. defaultAncestor: null,
  21989. ancestor: t,
  21990. prelim: 0,
  21991. modifier: 0,
  21992. change: 0,
  21993. shift: 0,
  21994. i: 0,
  21995. thread: null
  21996. };
  21997. for (var e, i, n = [t]; e = n.pop(); )
  21998. if (i = e.children,
  21999. e.isExpand && i.length)
  22000. for (var o = i.length - 1; 0 <= o; o--) {
  22001. var a = i[o];
  22002. a.hierNode = {
  22003. defaultAncestor: null,
  22004. ancestor: a,
  22005. prelim: 0,
  22006. modifier: 0,
  22007. change: 0,
  22008. shift: 0,
  22009. i: o,
  22010. thread: null
  22011. },
  22012. n.push(a)
  22013. }
  22014. }(s),
  22015. function(t, e, i) {
  22016. for (var n, o = [t], a = []; n = o.pop(); )
  22017. if (a.push(n),
  22018. n.isExpand) {
  22019. var r = n.children;
  22020. if (r.length)
  22021. for (var s = 0; s < r.length; s++)
  22022. o.push(r[s])
  22023. }
  22024. for (; n = a.pop(); )
  22025. e(n, i)
  22026. }(l, Cx, r),
  22027. s.hierNode.modifier = -l.hierNode.prelim,
  22028. Hx(l, Lx);
  22029. var u = l
  22030. , h = l
  22031. , c = l;
  22032. Hx(l, function(t) {
  22033. var e = t.getLayout().x;
  22034. e < u.getLayout().x && (u = t),
  22035. e > h.getLayout().x && (h = t),
  22036. t.depth > c.depth && (c = t)
  22037. });
  22038. var d = u === h ? 1 : r(u, h) / 2
  22039. , f = d - u.getLayout().x
  22040. , p = 0
  22041. , g = 0
  22042. , m = 0
  22043. , v = 0;
  22044. if ("radial" === n)
  22045. p = o / (h.getLayout().x + d + f),
  22046. g = a / (c.depth - 1 || 1),
  22047. Hx(l, function(t) {
  22048. m = (t.getLayout().x + f) * p,
  22049. v = (t.depth - 1) * g;
  22050. var e = Px(m, v);
  22051. t.setLayout({
  22052. x: e.x,
  22053. y: e.y,
  22054. rawX: m,
  22055. rawY: v
  22056. }, !0)
  22057. });
  22058. else {
  22059. var y = t.getOrient();
  22060. "RL" === y || "LR" === y ? (g = a / (h.getLayout().x + d + f),
  22061. p = o / (c.depth - 1 || 1),
  22062. Hx(l, function(t) {
  22063. v = (t.getLayout().x + f) * g,
  22064. m = "LR" === y ? (t.depth - 1) * p : o - (t.depth - 1) * p,
  22065. t.setLayout({
  22066. x: m,
  22067. y: v
  22068. }, !0)
  22069. })) : "TB" !== y && "BT" !== y || (p = o / (h.getLayout().x + d + f),
  22070. g = a / (c.depth - 1 || 1),
  22071. Hx(l, function(t) {
  22072. m = (t.getLayout().x + f) * p,
  22073. v = "TB" === y ? (t.depth - 1) * g : a - (t.depth - 1) * g,
  22074. t.setLayout({
  22075. x: m,
  22076. y: v
  22077. }, !0)
  22078. }))
  22079. }
  22080. }
  22081. }(t, e)
  22082. })
  22083. }),
  22084. sc.extend({
  22085. type: "series.treemap",
  22086. layoutMode: "box",
  22087. dependencies: ["grid", "polar"],
  22088. preventUsingHoverLayer: !0,
  22089. _viewRoot: null,
  22090. defaultOption: {
  22091. progressive: 0,
  22092. left: "center",
  22093. top: "middle",
  22094. right: null,
  22095. bottom: null,
  22096. width: "80%",
  22097. height: "80%",
  22098. sort: !0,
  22099. clipWindow: "origin",
  22100. squareRatio: .5 * (1 + Math.sqrt(5)),
  22101. leafDepth: null,
  22102. drillDownIcon: "▶",
  22103. zoomToNodeRatio: .1024,
  22104. roam: !0,
  22105. nodeClick: "zoomToNode",
  22106. animation: !0,
  22107. animationDurationUpdate: 900,
  22108. animationEasing: "quinticInOut",
  22109. breadcrumb: {
  22110. show: !0,
  22111. height: 22,
  22112. left: "center",
  22113. top: "bottom",
  22114. emptyItemWidth: 25,
  22115. itemStyle: {
  22116. color: "rgba(0,0,0,0.7)",
  22117. borderColor: "rgba(255,255,255,0.7)",
  22118. borderWidth: 1,
  22119. shadowColor: "rgba(150,150,150,1)",
  22120. shadowBlur: 3,
  22121. shadowOffsetX: 0,
  22122. shadowOffsetY: 0,
  22123. textStyle: {
  22124. color: "#fff"
  22125. }
  22126. },
  22127. emphasis: {
  22128. textStyle: {}
  22129. }
  22130. },
  22131. label: {
  22132. show: !0,
  22133. distance: 0,
  22134. padding: 5,
  22135. position: "inside",
  22136. color: "#fff",
  22137. ellipsis: !0
  22138. },
  22139. upperLabel: {
  22140. show: !1,
  22141. position: [0, "50%"],
  22142. height: 20,
  22143. color: "#fff",
  22144. ellipsis: !0,
  22145. verticalAlign: "middle"
  22146. },
  22147. itemStyle: {
  22148. color: null,
  22149. colorAlpha: null,
  22150. colorSaturation: null,
  22151. borderWidth: 0,
  22152. gapWidth: 0,
  22153. borderColor: "#fff",
  22154. borderColorSaturation: null
  22155. },
  22156. emphasis: {
  22157. upperLabel: {
  22158. show: !0,
  22159. position: [0, "50%"],
  22160. color: "#fff",
  22161. ellipsis: !0,
  22162. verticalAlign: "middle"
  22163. }
  22164. },
  22165. visualDimension: 0,
  22166. visualMin: null,
  22167. visualMax: null,
  22168. color: [],
  22169. colorAlpha: null,
  22170. colorSaturation: null,
  22171. colorMappingBy: "index",
  22172. visibleMin: 10,
  22173. childrenVisibleMin: null,
  22174. levels: []
  22175. },
  22176. getInitialData: function(t, e) {
  22177. var i = {
  22178. name: t.name,
  22179. children: t.data
  22180. };
  22181. !function i(t) {
  22182. var n = 0;
  22183. E(t.children, function(t) {
  22184. i(t);
  22185. var e = t.value;
  22186. L(e) && (e = e[0]),
  22187. n += e
  22188. });
  22189. var e = t.value;
  22190. L(e) && (e = e[0]);
  22191. null != e && !isNaN(e) || (e = n);
  22192. e < 0 && (e = 0);
  22193. L(t.value) ? t.value[0] = e : t.value = e
  22194. }(i);
  22195. var n = t.levels || []
  22196. , o = O((n = t.levels = function(t, e) {
  22197. var n, i = e.get("color");
  22198. if (!i)
  22199. return;
  22200. if (E(t = t || [], function(t) {
  22201. var e = new Cl(t)
  22202. , i = e.get("color");
  22203. (e.get("itemStyle.color") || i && "none" !== i) && (n = !0)
  22204. }),
  22205. !n) {
  22206. (t[0] || (t[0] = {})).color = i.slice()
  22207. }
  22208. return t
  22209. }(n, e)) || [], function(t) {
  22210. return new Cl(t,this,e)
  22211. }, this)
  22212. , a = Ax.createTree(i, this, null, function(t) {
  22213. t.wrapMethod("getItemModel", function(t, e) {
  22214. var i = a.getNodeByDataIndex(e)
  22215. , n = o[i.depth];
  22216. return n && (t.parentModel = n),
  22217. t
  22218. })
  22219. });
  22220. return a.data
  22221. },
  22222. optionUpdated: function() {
  22223. this.resetViewRoot()
  22224. },
  22225. formatTooltip: function(t) {
  22226. var e = this.getData()
  22227. , i = this.getRawValue(t)
  22228. , n = L(i) ? tu(i[0]) : tu(i);
  22229. return au(e.getName(t) + ": " + n)
  22230. },
  22231. getDataParams: function(t) {
  22232. var e = sc.prototype.getDataParams.apply(this, arguments)
  22233. , i = this.getData().tree.getNodeByDataIndex(t);
  22234. return e.treePathInfo = Yx(i, this),
  22235. e
  22236. },
  22237. setLayoutInfo: function(t) {
  22238. this.layoutInfo = this.layoutInfo || {},
  22239. P(this.layoutInfo, t)
  22240. },
  22241. mapIdToIndex: function(t) {
  22242. var e = this._idIndexMap;
  22243. e || (e = this._idIndexMap = Q(),
  22244. this._idIndexMapCount = 0);
  22245. var i = e.get(t);
  22246. return null == i && e.set(t, i = this._idIndexMapCount++),
  22247. i
  22248. },
  22249. getViewRoot: function() {
  22250. return this._viewRoot
  22251. },
  22252. resetViewRoot: function(t) {
  22253. t ? this._viewRoot = t : t = this._viewRoot;
  22254. var e = this.getRawData().tree.root;
  22255. t && (t === e || e.contains(t)) || (this._viewRoot = e)
  22256. }
  22257. });
  22258. var jx = 5;
  22259. function qx(t) {
  22260. this.group = new Ci,
  22261. t.add(this.group)
  22262. }
  22263. function Kx(t, e, i, n, o, a) {
  22264. var r = [[o ? t : t - jx, e], [t + i, e], [t + i, e + n], [o ? t : t - jx, e + n]];
  22265. return a || r.splice(2, 0, [t + i + jx, e + n / 2]),
  22266. o || r.push([t, e + n / 2]),
  22267. r
  22268. }
  22269. qx.prototype = {
  22270. constructor: qx,
  22271. render: function(t, e, i, n) {
  22272. var o = t.getModel("breadcrumb")
  22273. , a = this.group;
  22274. if (a.removeAll(),
  22275. o.get("show") && i) {
  22276. var r = o.getModel("itemStyle")
  22277. , s = r.getModel("textStyle")
  22278. , l = {
  22279. pos: {
  22280. left: o.get("left"),
  22281. right: o.get("right"),
  22282. top: o.get("top"),
  22283. bottom: o.get("bottom")
  22284. },
  22285. box: {
  22286. width: e.getWidth(),
  22287. height: e.getHeight()
  22288. },
  22289. emptyItemWidth: o.get("emptyItemWidth"),
  22290. totalWidth: 0,
  22291. renderList: []
  22292. };
  22293. this._prepare(i, l, s),
  22294. this._renderContent(t, l, r, s, n),
  22295. Su(a, l.pos, l.box)
  22296. }
  22297. },
  22298. _prepare: function(t, e, i) {
  22299. for (var n = t; n; n = n.parentNode) {
  22300. var o = n.getModel().get("name")
  22301. , a = i.getTextRect(o)
  22302. , r = Math.max(a.width + 16, e.emptyItemWidth);
  22303. e.totalWidth += r + 8,
  22304. e.renderList.push({
  22305. node: n,
  22306. text: o,
  22307. width: r
  22308. })
  22309. }
  22310. },
  22311. _renderContent: function(t, e, i, n, o) {
  22312. for (var a, r, s = 0, l = e.emptyItemWidth, u = t.get("breadcrumb.height"), h = function(t, e, i) {
  22313. var n = e.width
  22314. , o = e.height
  22315. , a = Rl(t.x, n)
  22316. , r = Rl(t.y, o)
  22317. , s = Rl(t.x2, n)
  22318. , l = Rl(t.y2, o);
  22319. return (isNaN(a) || isNaN(parseFloat(t.x))) && (a = 0),
  22320. (isNaN(s) || isNaN(parseFloat(t.x2))) && (s = n),
  22321. (isNaN(r) || isNaN(parseFloat(t.y))) && (r = 0),
  22322. (isNaN(l) || isNaN(parseFloat(t.y2))) && (l = o),
  22323. i = iu(i || 0),
  22324. {
  22325. width: Math.max(s - a - i[1] - i[3], 0),
  22326. height: Math.max(l - r - i[0] - i[2], 0)
  22327. }
  22328. }(e.pos, e.box), c = e.totalWidth, d = e.renderList, f = d.length - 1; 0 <= f; f--) {
  22329. var p = d[f]
  22330. , g = p.node
  22331. , m = p.width
  22332. , v = p.text;
  22333. c > h.width && (c -= m - l,
  22334. m = l,
  22335. v = null);
  22336. var y = new Qr({
  22337. shape: {
  22338. points: Kx(s, 0, m, u, f === d.length - 1, 0 === f)
  22339. },
  22340. style: D(i.getItemStyle(), {
  22341. lineJoin: "bevel",
  22342. text: v,
  22343. textFill: n.getTextColor(),
  22344. textFont: n.getFont()
  22345. }),
  22346. z: 10,
  22347. onclick: T(o, g)
  22348. });
  22349. this.group.add(y),
  22350. a = t,
  22351. r = g,
  22352. y.eventData = {
  22353. componentType: "series",
  22354. componentSubType: "treemap",
  22355. componentIndex: a.componentIndex,
  22356. seriesIndex: a.componentIndex,
  22357. seriesName: a.name,
  22358. seriesType: "treemap",
  22359. selfType: "breadcrumb",
  22360. nodeData: {
  22361. dataIndex: r && r.dataIndex,
  22362. name: r && r.name
  22363. },
  22364. treePathInfo: r && Yx(r, a)
  22365. },
  22366. s += m + 8
  22367. }
  22368. },
  22369. remove: function() {
  22370. this.group.removeAll()
  22371. }
  22372. };
  22373. function $x(t) {
  22374. var e = s_(t);
  22375. return e.stroke = e.fill = e.lineWidth = null,
  22376. e
  22377. }
  22378. var Jx = A
  22379. , Qx = Ci
  22380. , t_ = rs
  22381. , e_ = E
  22382. , i_ = ["label"]
  22383. , n_ = ["emphasis", "label"]
  22384. , o_ = ["upperLabel"]
  22385. , a_ = ["emphasis", "upperLabel"]
  22386. , r_ = 10
  22387. , s_ = ha([["fill", "color"], ["stroke", "strokeColor"], ["lineWidth", "strokeWidth"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"]]);
  22388. function l_(h, r, s, l, u, e, c, t, i, n) {
  22389. if (c) {
  22390. var d = c.getLayout()
  22391. , o = h.getData();
  22392. if (o.setItemGraphicEl(c.dataIndex, null),
  22393. d && d.isInView) {
  22394. var f = d.width
  22395. , p = d.height
  22396. , g = d.borderWidth
  22397. , m = d.invisible
  22398. , v = c.getRawIndex()
  22399. , y = t && t.getRawIndex()
  22400. , a = c.viewChildren
  22401. , x = d.upperHeight
  22402. , _ = a && a.length
  22403. , w = c.getModel("itemStyle")
  22404. , b = c.getModel("emphasis.itemStyle")
  22405. , S = L("nodeGroup", Qx);
  22406. if (S) {
  22407. if (i.add(S),
  22408. S.attr("position", [d.x || 0, d.y || 0]),
  22409. S.__tmNodeWidth = f,
  22410. S.__tmNodeHeight = p,
  22411. d.isAboveViewRoot)
  22412. return S;
  22413. var M = c.getModel()
  22414. , I = L("background", t_, n, 1);
  22415. if (I && function(t, e, i) {
  22416. if (e.dataIndex = c.dataIndex,
  22417. e.seriesIndex = h.seriesIndex,
  22418. e.setShape({
  22419. x: 0,
  22420. y: 0,
  22421. width: f,
  22422. height: p
  22423. }),
  22424. m)
  22425. A(e);
  22426. else {
  22427. e.invisible = !1;
  22428. var n = c.getVisual("borderColor", !0)
  22429. , o = b.get("borderColor")
  22430. , a = $x(w);
  22431. a.fill = n;
  22432. var r = s_(b);
  22433. if (r.fill = o,
  22434. i) {
  22435. var s = f - 2 * g;
  22436. D(a, r, n, s, x, {
  22437. x: g,
  22438. y: 0,
  22439. width: s,
  22440. height: x
  22441. })
  22442. } else
  22443. a.text = r.text = null;
  22444. e.setStyle(a),
  22445. Us(e, r)
  22446. }
  22447. t.add(e)
  22448. }(S, I, _ && d.upperLabelHeight),
  22449. _)
  22450. Qs(S) && Js(S, !1),
  22451. I && (Js(I, !0),
  22452. o.setItemGraphicEl(c.dataIndex, I));
  22453. else {
  22454. var T = L("content", t_, n, 2);
  22455. T && function(t, e) {
  22456. e.dataIndex = c.dataIndex,
  22457. e.seriesIndex = h.seriesIndex;
  22458. var i = Math.max(f - 2 * g, 0)
  22459. , n = Math.max(p - 2 * g, 0);
  22460. if (e.culling = !0,
  22461. e.setShape({
  22462. x: g,
  22463. y: g,
  22464. width: i,
  22465. height: n
  22466. }),
  22467. m)
  22468. A(e);
  22469. else {
  22470. e.invisible = !1;
  22471. var o = c.getVisual("color", !0)
  22472. , a = $x(w);
  22473. a.fill = o;
  22474. var r = s_(b);
  22475. D(a, r, o, i, n),
  22476. e.setStyle(a),
  22477. Us(e, r)
  22478. }
  22479. t.add(e)
  22480. }(S, T),
  22481. I && Qs(I) && Js(I, !1),
  22482. Js(S, !0),
  22483. o.setItemGraphicEl(c.dataIndex, S)
  22484. }
  22485. return S
  22486. }
  22487. }
  22488. }
  22489. function A(t) {
  22490. t.invisible || e.push(t)
  22491. }
  22492. function D(t, e, i, n, o, a) {
  22493. var r = M.get("name")
  22494. , s = M.getModel(a ? o_ : i_)
  22495. , l = M.getModel(a ? a_ : n_)
  22496. , u = s.getShallow("show");
  22497. el(t, e, s, l, {
  22498. defaultText: u ? r : null,
  22499. autoColor: i,
  22500. isRectText: !0,
  22501. labelFetcher: h,
  22502. labelDataIndex: c.dataIndex,
  22503. labelProp: a ? "upperLabel" : "label"
  22504. }),
  22505. C(t, a, d),
  22506. C(e, a, d),
  22507. a && (t.textRect = k(a)),
  22508. t.truncate = u && s.get("ellipsis") ? {
  22509. outerWidth: n,
  22510. outerHeight: o,
  22511. minChar: 2
  22512. } : null
  22513. }
  22514. function C(t, e, i) {
  22515. var n = t.text;
  22516. if (!e && i.isLeafRoot && null != n) {
  22517. var o = h.get("drillDownIcon", !0);
  22518. t.text = o ? o + " " + n : n
  22519. }
  22520. }
  22521. function L(t, e, i, n) {
  22522. var o = null != y && s[t][y]
  22523. , a = u[t];
  22524. return o ? (s[t][y] = null,
  22525. function(t, e, i) {
  22526. (t[v] = {}).old = "nodeGroup" === i ? e.position.slice() : P({}, e.shape)
  22527. }(a, o, t)) : m || ((o = new e({
  22528. z: function(t, e) {
  22529. var i = t * r_ + e;
  22530. return (i - 1) / i
  22531. }(i, n)
  22532. })).__tmDepth = i,
  22533. function(t, e, i) {
  22534. var n = t[v] = {}
  22535. , o = c.parentNode;
  22536. if (o && (!l || "drillDown" === l.direction)) {
  22537. var a = 0
  22538. , r = 0
  22539. , s = u.background[o.getRawIndex()];
  22540. !l && s && s.old && (a = s.old.width,
  22541. r = s.old.height),
  22542. n.old = "nodeGroup" === i ? [0, r] : {
  22543. x: a,
  22544. y: r,
  22545. width: 0,
  22546. height: 0
  22547. }
  22548. }
  22549. n.fadein = "nodeGroup" !== i
  22550. }(a, 0, o.__tmStorageName = t)),
  22551. r[t][v] = o
  22552. }
  22553. }
  22554. Cf({
  22555. type: "treemap",
  22556. init: function(t, e) {
  22557. this._containerGroup,
  22558. this._storage = {
  22559. nodeGroup: [],
  22560. background: [],
  22561. content: []
  22562. },
  22563. this._oldTree,
  22564. this._breadcrumb,
  22565. this._controller,
  22566. this._state = "ready"
  22567. },
  22568. render: function(t, e, i, n) {
  22569. if (!(_(e.findComponents({
  22570. mainType: "series",
  22571. subType: "treemap",
  22572. query: n
  22573. }), t) < 0)) {
  22574. this.seriesModel = t,
  22575. this.api = i,
  22576. this.ecModel = e;
  22577. var o = Zx(n, ["treemapZoomToNode", "treemapRootToNode"], t)
  22578. , a = n && n.type
  22579. , r = t.layoutInfo
  22580. , s = !this._oldTree
  22581. , l = this._storage
  22582. , u = "treemapRootToNode" === a && o && l ? {
  22583. rootNodeGroup: l.nodeGroup[o.node.getRawIndex()],
  22584. direction: n.direction
  22585. } : null
  22586. , h = this._giveContainerGroup(r)
  22587. , c = this._doRender(h, t, u);
  22588. s || a && "treemapZoomToNode" !== a && "treemapRootToNode" !== a ? c.renderFinally() : this._doAnimation(h, c, t, u),
  22589. this._resetController(i),
  22590. this._renderBreadcrumb(t, i, o)
  22591. }
  22592. },
  22593. _giveContainerGroup: function(t) {
  22594. var e = this._containerGroup;
  22595. return e || (e = this._containerGroup = new Qx,
  22596. this._initEvents(e),
  22597. this.group.add(e)),
  22598. e.attr("position", [t.x, t.y]),
  22599. e
  22600. },
  22601. _doRender: function(t, e, i) {
  22602. var n = e.getData().tree
  22603. , o = this._oldTree
  22604. , a = {
  22605. nodeGroup: [],
  22606. background: [],
  22607. content: []
  22608. }
  22609. , r = {
  22610. nodeGroup: [],
  22611. background: [],
  22612. content: []
  22613. }
  22614. , s = this._storage
  22615. , l = []
  22616. , c = T(l_, e, r, s, i, a, l);
  22617. !function a(r, s, l, u, h) {
  22618. u ? e_(s = r, function(t, e) {
  22619. t.isRemoved() || i(e, e)
  22620. }) : new kf(s,r,t,t).add(i).update(i).remove(T(i, null)).execute();
  22621. function t(t) {
  22622. return t.getId()
  22623. }
  22624. function i(t, e) {
  22625. var i = null != t ? r[t] : null
  22626. , n = null != e ? s[e] : null
  22627. , o = c(i, n, l, h);
  22628. o && a(i && i.viewChildren || [], n && n.viewChildren || [], o, u, h + 1)
  22629. }
  22630. }(n.root ? [n.root] : [], o && o.root ? [o.root] : [], t, n === o || !o, 0);
  22631. var u, h, d = (h = {
  22632. nodeGroup: [],
  22633. background: [],
  22634. content: []
  22635. },
  22636. (u = s) && e_(u, function(t, e) {
  22637. var i = h[e];
  22638. e_(t, function(t) {
  22639. t && (i.push(t),
  22640. t.__tmWillDelete = 1)
  22641. })
  22642. }),
  22643. h);
  22644. return this._oldTree = n,
  22645. this._storage = r,
  22646. {
  22647. lastsForAnimation: a,
  22648. willDeleteEls: d,
  22649. renderFinally: function() {
  22650. e_(d, function(t) {
  22651. e_(t, function(t) {
  22652. t.parent && t.parent.remove(t)
  22653. })
  22654. }),
  22655. e_(l, function(t) {
  22656. t.invisible = !0,
  22657. t.dirty()
  22658. })
  22659. }
  22660. }
  22661. },
  22662. _doAnimation: function(t, a, e, s) {
  22663. if (e.get("animation")) {
  22664. var l = e.get("animationDurationUpdate")
  22665. , u = e.get("animationEasing")
  22666. , h = function() {
  22667. var a, r = [], s = {};
  22668. return {
  22669. add: function(t, e, i, n, o) {
  22670. return R(n) && (o = n,
  22671. n = 0),
  22672. !s[t.id] && (s[t.id] = 1,
  22673. r.push({
  22674. el: t,
  22675. target: e,
  22676. time: i,
  22677. delay: n,
  22678. easing: o
  22679. }),
  22680. !0)
  22681. },
  22682. done: function(t) {
  22683. return a = t,
  22684. this
  22685. },
  22686. start: function() {
  22687. for (var t = r.length, e = 0, i = r.length; e < i; e++) {
  22688. var n = r[e];
  22689. n.el.animateTo(n.target, n.time, n.delay, n.easing, o)
  22690. }
  22691. return this;
  22692. function o() {
  22693. --t || (r.length = 0,
  22694. s = {},
  22695. a && a())
  22696. }
  22697. }
  22698. }
  22699. }();
  22700. e_(a.willDeleteEls, function(t, r) {
  22701. e_(t, function(t, e) {
  22702. if (!t.invisible) {
  22703. var i, n = t.parent;
  22704. if (s && "drillDown" === s.direction)
  22705. i = n === s.rootNodeGroup ? {
  22706. shape: {
  22707. x: 0,
  22708. y: 0,
  22709. width: n.__tmNodeWidth,
  22710. height: n.__tmNodeHeight
  22711. },
  22712. style: {
  22713. opacity: 0
  22714. }
  22715. } : {
  22716. style: {
  22717. opacity: 0
  22718. }
  22719. };
  22720. else {
  22721. var o = 0
  22722. , a = 0;
  22723. n.__tmWillDelete || (o = n.__tmNodeWidth / 2,
  22724. a = n.__tmNodeHeight / 2),
  22725. i = "nodeGroup" === r ? {
  22726. position: [o, a],
  22727. style: {
  22728. opacity: 0
  22729. }
  22730. } : {
  22731. shape: {
  22732. x: o,
  22733. y: a,
  22734. width: 0,
  22735. height: 0
  22736. },
  22737. style: {
  22738. opacity: 0
  22739. }
  22740. }
  22741. }
  22742. i && h.add(t, i, l, u)
  22743. }
  22744. })
  22745. }),
  22746. e_(this._storage, function(t, o) {
  22747. e_(t, function(t, e) {
  22748. var i = a.lastsForAnimation[o][e]
  22749. , n = {};
  22750. i && ("nodeGroup" === o ? i.old && (n.position = t.position.slice(),
  22751. t.attr("position", i.old)) : (i.old && (n.shape = P({}, t.shape),
  22752. t.setShape(i.old)),
  22753. i.fadein ? (t.setStyle("opacity", 0),
  22754. n.style = {
  22755. opacity: 1
  22756. }) : 1 !== t.style.opacity && (n.style = {
  22757. opacity: 1
  22758. })),
  22759. h.add(t, n, l, u))
  22760. })
  22761. }, this),
  22762. this._state = "animating",
  22763. h.done(Jx(function() {
  22764. this._state = "ready",
  22765. a.renderFinally()
  22766. }, this)).start()
  22767. }
  22768. },
  22769. _resetController: function(t) {
  22770. var e = this._controller;
  22771. e || ((e = this._controller = new Vy(t.getZr())).enable(this.seriesModel.get("roam")),
  22772. e.on("pan", Jx(this._onPan, this)),
  22773. e.on("zoom", Jx(this._onZoom, this)));
  22774. var n = new Di(0,0,t.getWidth(),t.getHeight());
  22775. e.setPointerChecker(function(t, e, i) {
  22776. return n.contain(e, i)
  22777. })
  22778. },
  22779. _clearController: function() {
  22780. var t = this._controller;
  22781. t && (t.dispose(),
  22782. t = null)
  22783. },
  22784. _onPan: function(t) {
  22785. if ("animating" !== this._state && (3 < Math.abs(t.dx) || 3 < Math.abs(t.dy))) {
  22786. var e = this.seriesModel.getData().tree.root;
  22787. if (!e)
  22788. return;
  22789. var i = e.getLayout();
  22790. if (!i)
  22791. return;
  22792. this.api.dispatchAction({
  22793. type: "treemapMove",
  22794. from: this.uid,
  22795. seriesId: this.seriesModel.id,
  22796. rootRect: {
  22797. x: i.x + t.dx,
  22798. y: i.y + t.dy,
  22799. width: i.width,
  22800. height: i.height
  22801. }
  22802. })
  22803. }
  22804. },
  22805. _onZoom: function(t) {
  22806. var e = t.originX
  22807. , i = t.originY;
  22808. if ("animating" !== this._state) {
  22809. var n = this.seriesModel.getData().tree.root;
  22810. if (!n)
  22811. return;
  22812. var o = n.getLayout();
  22813. if (!o)
  22814. return;
  22815. var a = new Di(o.x,o.y,o.width,o.height)
  22816. , r = this.seriesModel.layoutInfo;
  22817. e -= r.x,
  22818. i -= r.y;
  22819. var s = ae();
  22820. ue(s, s, [-e, -i]),
  22821. ce(s, s, [t.scale, t.scale]),
  22822. ue(s, s, [e, i]),
  22823. a.applyTransform(s),
  22824. this.api.dispatchAction({
  22825. type: "treemapRender",
  22826. from: this.uid,
  22827. seriesId: this.seriesModel.id,
  22828. rootRect: {
  22829. x: a.x,
  22830. y: a.y,
  22831. width: a.width,
  22832. height: a.height
  22833. }
  22834. })
  22835. }
  22836. },
  22837. _initEvents: function(t) {
  22838. t.on("click", function(t) {
  22839. if ("ready" === this._state) {
  22840. var e = this.seriesModel.get("nodeClick", !0);
  22841. if (e) {
  22842. var i = this.findTarget(t.offsetX, t.offsetY);
  22843. if (i) {
  22844. var n = i.node;
  22845. if (n.getLayout().isLeafRoot)
  22846. this._rootToNode(i);
  22847. else if ("zoomToNode" === e)
  22848. this._zoomToNode(i);
  22849. else if ("link" === e) {
  22850. var o = n.hostTree.data.getItemModel(n.dataIndex)
  22851. , a = o.get("link", !0)
  22852. , r = o.get("target", !0) || "blank";
  22853. a && gu(a, r)
  22854. }
  22855. }
  22856. }
  22857. }
  22858. }, this)
  22859. },
  22860. _renderBreadcrumb: function(e, t, i) {
  22861. i = i || ((i = null != e.get("leafDepth", !0) ? {
  22862. node: e.getViewRoot()
  22863. } : this.findTarget(t.getWidth() / 2, t.getHeight() / 2)) || {
  22864. node: e.getData().tree.root
  22865. }),
  22866. (this._breadcrumb || (this._breadcrumb = new qx(this.group))).render(e, t, i.node, Jx(function(t) {
  22867. "animating" !== this._state && (Xx(e.getViewRoot(), t) ? this._rootToNode({
  22868. node: t
  22869. }) : this._zoomToNode({
  22870. node: t
  22871. }))
  22872. }, this))
  22873. },
  22874. remove: function() {
  22875. this._clearController(),
  22876. this._containerGroup && this._containerGroup.removeAll(),
  22877. this._storage = {
  22878. nodeGroup: [],
  22879. background: [],
  22880. content: []
  22881. },
  22882. this._state = "ready",
  22883. this._breadcrumb && this._breadcrumb.remove()
  22884. },
  22885. dispose: function() {
  22886. this._clearController()
  22887. },
  22888. _zoomToNode: function(t) {
  22889. this.api.dispatchAction({
  22890. type: "treemapZoomToNode",
  22891. from: this.uid,
  22892. seriesId: this.seriesModel.id,
  22893. targetNode: t.node
  22894. })
  22895. },
  22896. _rootToNode: function(t) {
  22897. this.api.dispatchAction({
  22898. type: "treemapRootToNode",
  22899. from: this.uid,
  22900. seriesId: this.seriesModel.id,
  22901. targetNode: t.node
  22902. })
  22903. },
  22904. findTarget: function(o, a) {
  22905. var r;
  22906. return this.seriesModel.getViewRoot().eachNode({
  22907. attr: "viewChildren",
  22908. order: "preorder"
  22909. }, function(t) {
  22910. var e = this._storage.background[t.getRawIndex()];
  22911. if (e) {
  22912. var i = e.transformCoordToLocal(o, a)
  22913. , n = e.shape;
  22914. if (!(n.x <= i[0] && i[0] <= n.x + n.width && n.y <= i[1] && i[1] <= n.y + n.height))
  22915. return !1;
  22916. r = {
  22917. node: t,
  22918. offsetX: i[0],
  22919. offsetY: i[1]
  22920. }
  22921. }
  22922. }, this),
  22923. r
  22924. }
  22925. });
  22926. for (var u_ = function() {}, h_ = ["treemapZoomToNode", "treemapRender", "treemapMove"], c_ = 0; c_ < h_.length; c_++)
  22927. _f({
  22928. type: h_[c_],
  22929. update: "updateView"
  22930. }, u_);
  22931. _f({
  22932. type: "treemapRootToNode",
  22933. update: "updateView"
  22934. }, function(o, t) {
  22935. t.eachComponent({
  22936. mainType: "series",
  22937. subType: "treemap",
  22938. query: o
  22939. }, function(t, e) {
  22940. var i = Zx(o, ["treemapZoomToNode", "treemapRootToNode"], t);
  22941. if (i) {
  22942. var n = t.getViewRoot();
  22943. n && (o.direction = Xx(n, i.node) ? "rollUp" : "drillDown"),
  22944. t.resetViewRoot(i.node)
  22945. }
  22946. })
  22947. });
  22948. var d_ = E
  22949. , f_ = z
  22950. , p_ = -1
  22951. , g_ = function(t) {
  22952. var e = t.mappingMethod
  22953. , i = t.type
  22954. , n = this.option = k(t);
  22955. this.type = i,
  22956. this.mappingMethod = e,
  22957. this._normalizeData = T_[e];
  22958. var o = m_[i];
  22959. this.applyVisual = o.applyVisual,
  22960. this.getColorMapper = o.getColorMapper,
  22961. this._doMap = o._doMap[e],
  22962. "piecewise" === e ? (v_(n),
  22963. function(i) {
  22964. var t = i.pieceList;
  22965. i.hasSpecialVisual = !1,
  22966. E(t, function(t, e) {
  22967. t.originIndex = e,
  22968. null != t.visual && (i.hasSpecialVisual = !0)
  22969. })
  22970. }(n)) : "category" === e ? n.categories ? function(t) {
  22971. var e = t.categories
  22972. , i = t.visual
  22973. , n = t.categoryMap = {};
  22974. if (d_(e, function(t, e) {
  22975. n[t] = e
  22976. }),
  22977. !L(i)) {
  22978. var o = [];
  22979. z(i) ? d_(i, function(t, e) {
  22980. var i = n[e];
  22981. o[null != i ? i : p_] = t
  22982. }) : o[p_] = i,
  22983. i = I_(t, o)
  22984. }
  22985. for (var a = e.length - 1; 0 <= a; a--)
  22986. null == i[a] && (delete n[e[a]],
  22987. e.pop())
  22988. }(n) : v_(n, !0) : (Y("linear" !== e || n.dataExtent),
  22989. v_(n))
  22990. };
  22991. g_.prototype = {
  22992. constructor: g_,
  22993. mapValueToVisual: function(t) {
  22994. var e = this._normalizeData(t);
  22995. return this._doMap(e, t)
  22996. },
  22997. getNormalizer: function() {
  22998. return A(this._normalizeData, this)
  22999. }
  23000. };
  23001. var m_ = g_.visualHandlers = {
  23002. color: {
  23003. applyVisual: __("color"),
  23004. getColorMapper: function() {
  23005. var o = this.option;
  23006. return A("category" === o.mappingMethod ? function(t, e) {
  23007. return e || (t = this._normalizeData(t)),
  23008. w_.call(this, t)
  23009. }
  23010. : function(t, e, i) {
  23011. var n = !!i;
  23012. return e || (t = this._normalizeData(t)),
  23013. i = Ue(t, o.parsedVisual, i),
  23014. n ? i : $e(i, "rgba")
  23015. }
  23016. , this)
  23017. },
  23018. _doMap: {
  23019. linear: function(t) {
  23020. return $e(Ue(t, this.option.parsedVisual), "rgba")
  23021. },
  23022. category: w_,
  23023. piecewise: function(t, e) {
  23024. var i = M_.call(this, e);
  23025. return null == i && (i = $e(Ue(t, this.option.parsedVisual), "rgba")),
  23026. i
  23027. },
  23028. fixed: b_
  23029. }
  23030. },
  23031. colorHue: y_(function(t, e) {
  23032. return qe(t, e)
  23033. }),
  23034. colorSaturation: y_(function(t, e) {
  23035. return qe(t, null, e)
  23036. }),
  23037. colorLightness: y_(function(t, e) {
  23038. return qe(t, null, null, e)
  23039. }),
  23040. colorAlpha: y_(function(t, e) {
  23041. return Ke(t, e)
  23042. }),
  23043. opacity: {
  23044. applyVisual: __("opacity"),
  23045. _doMap: S_([0, 1])
  23046. },
  23047. liftZ: {
  23048. applyVisual: __("liftZ"),
  23049. _doMap: {
  23050. linear: b_,
  23051. category: b_,
  23052. piecewise: b_,
  23053. fixed: b_
  23054. }
  23055. },
  23056. symbol: {
  23057. applyVisual: function(t, e, i) {
  23058. var n = this.mapValueToVisual(t);
  23059. if (R(n))
  23060. i("symbol", n);
  23061. else if (f_(n))
  23062. for (var o in n)
  23063. n.hasOwnProperty(o) && i(o, n[o])
  23064. },
  23065. _doMap: {
  23066. linear: x_,
  23067. category: w_,
  23068. piecewise: function(t, e) {
  23069. var i = M_.call(this, e);
  23070. return null == i && (i = x_.call(this, t)),
  23071. i
  23072. },
  23073. fixed: b_
  23074. }
  23075. },
  23076. symbolSize: {
  23077. applyVisual: __("symbolSize"),
  23078. _doMap: S_([0, 1])
  23079. }
  23080. };
  23081. function v_(t, e) {
  23082. var i = t.visual
  23083. , n = [];
  23084. z(i) ? d_(i, function(t) {
  23085. n.push(t)
  23086. }) : null != i && n.push(i);
  23087. e || 1 !== n.length || {
  23088. color: 1,
  23089. symbol: 1
  23090. }.hasOwnProperty(t.type) || (n[1] = n[0]),
  23091. I_(t, n)
  23092. }
  23093. function y_(n) {
  23094. return {
  23095. applyVisual: function(t, e, i) {
  23096. t = this.mapValueToVisual(t),
  23097. i("color", n(e("color"), t))
  23098. },
  23099. _doMap: S_([0, 1])
  23100. }
  23101. }
  23102. function x_(t) {
  23103. var e = this.option.visual;
  23104. return e[Math.round(El(t, [0, 1], [0, e.length - 1], !0))] || {}
  23105. }
  23106. function __(n) {
  23107. return function(t, e, i) {
  23108. i(n, this.mapValueToVisual(t))
  23109. }
  23110. }
  23111. function w_(t) {
  23112. var e = this.option.visual;
  23113. return e[this.option.loop && t !== p_ ? t % e.length : t]
  23114. }
  23115. function b_() {
  23116. return this.option.visual[0]
  23117. }
  23118. function S_(n) {
  23119. return {
  23120. linear: function(t) {
  23121. return El(t, n, this.option.visual, !0)
  23122. },
  23123. category: w_,
  23124. piecewise: function(t, e) {
  23125. var i = M_.call(this, e);
  23126. return null == i && (i = El(t, n, this.option.visual, !0)),
  23127. i
  23128. },
  23129. fixed: b_
  23130. }
  23131. }
  23132. function M_(t) {
  23133. var e = this.option
  23134. , i = e.pieceList;
  23135. if (e.hasSpecialVisual) {
  23136. var n = i[g_.findPieceIndex(t, i)];
  23137. if (n && n.visual)
  23138. return n.visual[this.type]
  23139. }
  23140. }
  23141. function I_(t, e) {
  23142. return t.visual = e,
  23143. "color" === t.type && (t.parsedVisual = O(e, function(t) {
  23144. return Fe(t)
  23145. })),
  23146. e
  23147. }
  23148. var T_ = {
  23149. linear: function(t) {
  23150. return El(t, this.option.dataExtent, [0, 1], !0)
  23151. },
  23152. piecewise: function(t) {
  23153. var e = this.option.pieceList
  23154. , i = g_.findPieceIndex(t, e, !0);
  23155. if (null != i)
  23156. return El(i, [0, e.length - 1], [0, 1], !0)
  23157. },
  23158. category: function(t) {
  23159. var e = this.option.categories ? this.option.categoryMap[t] : t;
  23160. return null == e ? p_ : e
  23161. },
  23162. fixed: et
  23163. };
  23164. function A_(t, e, i) {
  23165. return t ? e <= i : e < i
  23166. }
  23167. g_.listVisualTypes = function() {
  23168. var i = [];
  23169. return E(m_, function(t, e) {
  23170. i.push(e)
  23171. }),
  23172. i
  23173. }
  23174. ,
  23175. g_.addVisualHandler = function(t, e) {
  23176. m_[t] = e
  23177. }
  23178. ,
  23179. g_.isValidType = function(t) {
  23180. return m_.hasOwnProperty(t)
  23181. }
  23182. ,
  23183. g_.eachVisual = function(t, e, i) {
  23184. z(t) ? E(t, e, i) : e.call(i, t)
  23185. }
  23186. ,
  23187. g_.mapVisual = function(t, n, o) {
  23188. var a, r = L(t) ? [] : z(t) ? {} : (a = !0,
  23189. null);
  23190. return g_.eachVisual(t, function(t, e) {
  23191. var i = n.call(o, t, e);
  23192. a ? r = i : r[e] = i
  23193. }),
  23194. r
  23195. }
  23196. ,
  23197. g_.retrieveVisuals = function(i) {
  23198. var n, o = {};
  23199. return i && d_(m_, function(t, e) {
  23200. i.hasOwnProperty(e) && (o[e] = i[e],
  23201. n = !0)
  23202. }),
  23203. n ? o : null
  23204. }
  23205. ,
  23206. g_.prepareVisualTypes = function(t) {
  23207. if (f_(t)) {
  23208. var i = [];
  23209. d_(t, function(t, e) {
  23210. i.push(e)
  23211. }),
  23212. t = i
  23213. } else {
  23214. if (!L(t))
  23215. return [];
  23216. t = t.slice()
  23217. }
  23218. return t.sort(function(t, e) {
  23219. return "color" === e && "color" !== t && 0 === t.indexOf("color") ? 1 : -1
  23220. }),
  23221. t
  23222. }
  23223. ,
  23224. g_.dependsOn = function(t, e) {
  23225. return "color" === e ? !(!t || 0 !== t.indexOf(e)) : t === e
  23226. }
  23227. ,
  23228. g_.findPieceIndex = function(n, t, e) {
  23229. for (var o, a = 1 / 0, i = 0, r = t.length; i < r; i++) {
  23230. var s = t[i].value;
  23231. if (null != s) {
  23232. if (s === n || "string" == typeof s && s === n + "")
  23233. return i;
  23234. e && c(s, i)
  23235. }
  23236. }
  23237. for (i = 0,
  23238. r = t.length; i < r; i++) {
  23239. var l = t[i]
  23240. , u = l.interval
  23241. , h = l.close;
  23242. if (u) {
  23243. if (u[0] === -1 / 0) {
  23244. if (A_(h[1], n, u[1]))
  23245. return i
  23246. } else if (u[1] === 1 / 0) {
  23247. if (A_(h[0], u[0], n))
  23248. return i
  23249. } else if (A_(h[0], u[0], n) && A_(h[1], n, u[1]))
  23250. return i;
  23251. e && c(u[0], i),
  23252. e && c(u[1], i)
  23253. }
  23254. }
  23255. if (e)
  23256. return n === 1 / 0 ? t.length - 1 : n === -1 / 0 ? 0 : o;
  23257. function c(t, e) {
  23258. var i = Math.abs(t - n);
  23259. i < a && (a = i,
  23260. o = e)
  23261. }
  23262. }
  23263. ;
  23264. var D_ = L
  23265. , C_ = "itemStyle"
  23266. , L_ = {
  23267. seriesType: "treemap",
  23268. reset: function(t, e, i, n) {
  23269. var o = t.getData().tree
  23270. , a = o.root
  23271. , r = t.getModel(C_);
  23272. a.isRemoved() || !function n(t, e, o, a, r, s) {
  23273. var l = t.getModel();
  23274. var i = t.getLayout();
  23275. if (!i || i.invisible || !i.isInView)
  23276. return;
  23277. var u = t.getModel(C_);
  23278. var h = o[t.depth];
  23279. var c = k_(u, e, h, a);
  23280. var d = u.get("borderColor");
  23281. var f = u.get("borderColorSaturation");
  23282. var p;
  23283. null != f && (p = P_(c),
  23284. g = f,
  23285. d = null != (m = p) ? qe(m, null, null, g) : null);
  23286. var g, m;
  23287. t.setVisual("borderColor", d);
  23288. var v = t.viewChildren;
  23289. if (v && v.length) {
  23290. var y = O_(t, l, i, u, c, v);
  23291. E(v, function(t, e) {
  23292. if (t.depth >= r.length || t === r[t.depth]) {
  23293. var i = R_(l, c, t, e, y, s);
  23294. n(t, i, o, a, r, s)
  23295. }
  23296. })
  23297. } else
  23298. p = P_(c),
  23299. t.setVisual("color", p)
  23300. }(a, {}, O(o.levelModels, function(t) {
  23301. return t ? t.get(C_) : null
  23302. }), r, t.getViewRoot().getAncestors(), t)
  23303. }
  23304. };
  23305. function k_(i, n, o, a) {
  23306. var r = P({}, n);
  23307. return E(["color", "colorAlpha", "colorSaturation"], function(t) {
  23308. var e = i.get(t, !0);
  23309. null == e && o && (e = o[t]),
  23310. null == e && (e = n[t]),
  23311. null == e && (e = a.get(t)),
  23312. null != e && (r[t] = e)
  23313. }),
  23314. r
  23315. }
  23316. function P_(t) {
  23317. var e = N_(t, "color");
  23318. if (e) {
  23319. var i = N_(t, "colorAlpha")
  23320. , n = N_(t, "colorSaturation");
  23321. return n && (e = qe(e, null, null, n)),
  23322. i && (e = Ke(e, i)),
  23323. e
  23324. }
  23325. }
  23326. function N_(t, e) {
  23327. var i = t[e];
  23328. if (null != i && "none" !== i)
  23329. return i
  23330. }
  23331. function O_(t, e, i, n, o, a) {
  23332. if (a && a.length) {
  23333. var r = E_(e, "color") || null != o.color && "none" !== o.color && (E_(e, "colorAlpha") || E_(e, "colorSaturation"));
  23334. if (r) {
  23335. var s = e.get("visualMin")
  23336. , l = e.get("visualMax")
  23337. , u = i.dataExtent.slice();
  23338. null != s && s < u[0] && (u[0] = s),
  23339. null != l && l > u[1] && (u[1] = l);
  23340. var h = e.get("colorMappingBy")
  23341. , c = {
  23342. type: r.name,
  23343. dataExtent: u,
  23344. visual: r.range
  23345. };
  23346. "color" !== c.type || "index" !== h && "id" !== h ? c.mappingMethod = "linear" : (c.mappingMethod = "category",
  23347. c.loop = !0);
  23348. var d = new g_(c);
  23349. return d.__drColorMappingBy = h,
  23350. d
  23351. }
  23352. }
  23353. }
  23354. function E_(t, e) {
  23355. var i = t.get(e);
  23356. return D_(i) && i.length ? {
  23357. name: e,
  23358. range: i
  23359. } : null
  23360. }
  23361. function R_(t, e, i, n, o, a) {
  23362. var r = P({}, e);
  23363. if (o) {
  23364. var s = o.type
  23365. , l = "color" === s && o.__drColorMappingBy
  23366. , u = "index" === l ? n : "id" === l ? a.mapIdToIndex(i.getId()) : i.getValue(t.get("visualDimension"));
  23367. r[s] = o.mapValueToVisual(u)
  23368. }
  23369. return r
  23370. }
  23371. var z_ = Math.max
  23372. , B_ = Math.min
  23373. , V_ = W
  23374. , G_ = E
  23375. , F_ = ["itemStyle", "borderWidth"]
  23376. , W_ = ["itemStyle", "gapWidth"]
  23377. , H_ = ["upperLabel", "show"]
  23378. , Z_ = ["upperLabel", "height"]
  23379. , U_ = {
  23380. seriesType: "treemap",
  23381. reset: function(t, e, i, n) {
  23382. var o = i.getWidth()
  23383. , a = i.getHeight()
  23384. , r = t.option
  23385. , s = bu(t.getBoxLayoutParams(), {
  23386. width: i.getWidth(),
  23387. height: i.getHeight()
  23388. })
  23389. , l = r.size || []
  23390. , u = Rl(V_(s.width, l[0]), o)
  23391. , h = Rl(V_(s.height, l[1]), a)
  23392. , c = n && n.type
  23393. , d = Zx(n, ["treemapZoomToNode", "treemapRootToNode"], t)
  23394. , f = "treemapRender" === c || "treemapMove" === c ? n.rootRect : null
  23395. , p = t.getViewRoot()
  23396. , g = Ux(p);
  23397. if ("treemapMove" !== c) {
  23398. var m = "treemapZoomToNode" === c ? function(t, e, i, n, o) {
  23399. var a, r = (e || {}).node, s = [n, o];
  23400. if (!r || r === i)
  23401. return s;
  23402. var l = n * o
  23403. , u = l * t.option.zoomToNodeRatio;
  23404. for (; a = r.parentNode; ) {
  23405. for (var h = 0, c = a.children, d = 0, f = c.length; d < f; d++)
  23406. h += c[d].getValue();
  23407. var p = r.getValue();
  23408. if (0 === p)
  23409. return s;
  23410. u *= h / p;
  23411. var g = a.getModel()
  23412. , m = g.get(F_)
  23413. , v = Math.max(m, q_(g));
  23414. u += 4 * m * m + (3 * m + v) * Math.pow(u, .5),
  23415. Hl < u && (u = Hl),
  23416. r = a
  23417. }
  23418. u < l && (u = l);
  23419. var y = Math.pow(u / l, .5);
  23420. return [n * y, o * y]
  23421. }(t, d, p, u, h) : f ? [f.width, f.height] : [u, h]
  23422. , v = r.sort;
  23423. v && "asc" !== v && "desc" !== v && (v = "desc");
  23424. var y = {
  23425. squareRatio: r.squareRatio,
  23426. sort: v,
  23427. leafDepth: r.leafDepth
  23428. };
  23429. p.hostTree.clearLayouts();
  23430. var x = {
  23431. x: 0,
  23432. y: 0,
  23433. width: m[0],
  23434. height: m[1],
  23435. area: m[0] * m[1]
  23436. };
  23437. p.setLayout(x),
  23438. function t(e, i, n, o) {
  23439. var a;
  23440. var r;
  23441. if (e.isRemoved())
  23442. return;
  23443. var s = e.getLayout();
  23444. a = s.width;
  23445. r = s.height;
  23446. var l = e.getModel();
  23447. var u = l.get(F_);
  23448. var h = l.get(W_) / 2;
  23449. var c = q_(l);
  23450. var d = Math.max(u, c);
  23451. var f = u - h;
  23452. var p = d - h;
  23453. var l = e.getModel();
  23454. e.setLayout({
  23455. borderWidth: u,
  23456. upperHeight: d,
  23457. upperLabelHeight: c
  23458. }, !0);
  23459. a = z_(a - 2 * f, 0);
  23460. r = z_(r - f - p, 0);
  23461. var g = a * r;
  23462. var m = X_(e, l, g, i, n, o);
  23463. if (!m.length)
  23464. return;
  23465. var v = {
  23466. x: f,
  23467. y: p,
  23468. width: a,
  23469. height: r
  23470. };
  23471. var y = B_(a, r);
  23472. var x = 1 / 0;
  23473. var _ = [];
  23474. _.area = 0;
  23475. for (var w = 0, b = m.length; w < b; ) {
  23476. var S = m[w];
  23477. _.push(S),
  23478. _.area += S.getLayout().area;
  23479. var M = Y_(_, y, i.squareRatio);
  23480. x = M <= x ? (w++,
  23481. M) : (_.area -= _.pop().getLayout().area,
  23482. j_(_, y, v, h, !1),
  23483. y = B_(v.width, v.height),
  23484. _.length = _.area = 0,
  23485. 1 / 0)
  23486. }
  23487. _.length && j_(_, y, v, h, !0);
  23488. if (!n) {
  23489. var I = l.get("childrenVisibleMin");
  23490. null != I && g < I && (n = !0)
  23491. }
  23492. for (var w = 0, b = m.length; w < b; w++)
  23493. t(m[w], i, n, o + 1)
  23494. }(p, y, !1, 0);
  23495. x = p.getLayout();
  23496. G_(g, function(t, e) {
  23497. var i = (g[e + 1] || p).getValue();
  23498. t.setLayout(P({
  23499. dataExtent: [i, i],
  23500. borderWidth: 0,
  23501. upperHeight: 0
  23502. }, x))
  23503. })
  23504. }
  23505. var _ = t.getData().tree.root;
  23506. _.setLayout(function(t, e, i) {
  23507. if (e)
  23508. return {
  23509. x: e.x,
  23510. y: e.y
  23511. };
  23512. var n = {
  23513. x: 0,
  23514. y: 0
  23515. };
  23516. if (!i)
  23517. return n;
  23518. var o = i.node
  23519. , a = o.getLayout();
  23520. if (!a)
  23521. return n;
  23522. var r = [a.width / 2, a.height / 2]
  23523. , s = o;
  23524. for (; s; ) {
  23525. var l = s.getLayout();
  23526. r[0] += l.x,
  23527. r[1] += l.y,
  23528. s = s.parentNode
  23529. }
  23530. return {
  23531. x: t.width / 2 - r[0],
  23532. y: t.height / 2 - r[1]
  23533. }
  23534. }(s, f, d), !0),
  23535. t.setLayoutInfo(s),
  23536. function e(t, i, n, o, a) {
  23537. var r = t.getLayout();
  23538. var s = n[a];
  23539. var l = s && s === t;
  23540. if (s && !l || a === n.length && t !== o)
  23541. return;
  23542. t.setLayout({
  23543. isInView: !0,
  23544. invisible: !l && !i.intersect(r),
  23545. isAboveViewRoot: l
  23546. }, !0);
  23547. var u = new Di(i.x - r.x,i.y - r.y,i.width,i.height);
  23548. G_(t.viewChildren || [], function(t) {
  23549. e(t, u, n, o, a + 1)
  23550. })
  23551. }(_, new Di(-s.x,-s.y,o,a), g, p, 0)
  23552. }
  23553. };
  23554. function X_(t, e, i, n, o, a) {
  23555. var r = t.children || []
  23556. , s = n.sort;
  23557. "asc" !== s && "desc" !== s && (s = null);
  23558. var l = null != n.leafDepth && n.leafDepth <= a;
  23559. if (o && !l)
  23560. return t.viewChildren = [];
  23561. !function(t, n) {
  23562. n && t.sort(function(t, e) {
  23563. var i = "asc" === n ? t.getValue() - e.getValue() : e.getValue() - t.getValue();
  23564. return 0 == i ? "asc" === n ? t.dataIndex - e.dataIndex : e.dataIndex - t.dataIndex : i
  23565. })
  23566. }(r = M(r, function(t) {
  23567. return !t.isRemoved()
  23568. }), s);
  23569. var u = function(t, e, i) {
  23570. for (var n = 0, o = 0, a = e.length; o < a; o++)
  23571. n += e[o].getValue();
  23572. var r = t.get("visualDimension");
  23573. if (e && e.length)
  23574. if ("value" === r && i)
  23575. s = [e[e.length - 1].getValue(), e[0].getValue()],
  23576. "asc" === i && s.reverse();
  23577. else {
  23578. var s = [1 / 0, -1 / 0];
  23579. G_(e, function(t) {
  23580. var e = t.getValue(r);
  23581. e < s[0] && (s[0] = e),
  23582. e > s[1] && (s[1] = e)
  23583. })
  23584. }
  23585. else
  23586. s = [NaN, NaN];
  23587. return {
  23588. sum: n,
  23589. dataExtent: s
  23590. }
  23591. }(e, r, s);
  23592. if (0 === u.sum)
  23593. return t.viewChildren = [];
  23594. if (u.sum = function(t, e, i, n, o) {
  23595. if (!n)
  23596. return i;
  23597. for (var a = t.get("visibleMin"), r = o.length, s = r, l = r - 1; 0 <= l; l--) {
  23598. var u = o["asc" === n ? r - l - 1 : l].getValue();
  23599. u / i * e < a && (s = l,
  23600. i -= u)
  23601. }
  23602. return "asc" === n ? o.splice(0, r - s) : o.splice(s, r - s),
  23603. i
  23604. }(e, i, u.sum, s, r),
  23605. 0 === u.sum)
  23606. return t.viewChildren = [];
  23607. for (var h = 0, c = r.length; h < c; h++) {
  23608. var d = r[h].getValue() / u.sum * i;
  23609. r[h].setLayout({
  23610. area: d
  23611. })
  23612. }
  23613. return l && (r.length && t.setLayout({
  23614. isLeafRoot: !0
  23615. }, !0),
  23616. r.length = 0),
  23617. t.viewChildren = r,
  23618. t.setLayout({
  23619. dataExtent: u.dataExtent
  23620. }, !0),
  23621. r
  23622. }
  23623. function Y_(t, e, i) {
  23624. for (var n, o = 0, a = 1 / 0, r = 0, s = t.length; r < s; r++)
  23625. (n = t[r].getLayout().area) && (n < a && (a = n),
  23626. o < n && (o = n));
  23627. var l = t.area * t.area
  23628. , u = e * e * i;
  23629. return l ? z_(u * o / l, l / (u * a)) : 1 / 0
  23630. }
  23631. function j_(t, e, i, n, o) {
  23632. var a = e === i.width ? 0 : 1
  23633. , r = 1 - a
  23634. , s = ["x", "y"]
  23635. , l = ["width", "height"]
  23636. , u = i[s[a]]
  23637. , h = e ? t.area / e : 0;
  23638. (o || h > i[l[r]]) && (h = i[l[r]]);
  23639. for (var c = 0, d = t.length; c < d; c++) {
  23640. var f = t[c]
  23641. , p = {}
  23642. , g = h ? f.getLayout().area / h : 0
  23643. , m = p[l[r]] = z_(h - 2 * n, 0)
  23644. , v = i[s[a]] + i[l[a]] - u
  23645. , y = c === d - 1 || v < g ? v : g
  23646. , x = p[l[a]] = z_(y - 2 * n, 0);
  23647. p[s[r]] = i[s[r]] + B_(n, m / 2),
  23648. p[s[a]] = u + B_(n, x / 2),
  23649. u += y,
  23650. f.setLayout(p, !0)
  23651. }
  23652. i[s[r]] += h,
  23653. i[l[r]] -= h
  23654. }
  23655. function q_(t) {
  23656. return t.get(H_) ? t.get(Z_) : 0
  23657. }
  23658. function K_(t) {
  23659. return "_EC_" + t
  23660. }
  23661. Sf(L_),
  23662. bf(U_);
  23663. function $_(t) {
  23664. this._directed = t || !1,
  23665. this.nodes = [],
  23666. this.edges = [],
  23667. this._nodesMap = {},
  23668. this._edgesMap = {},
  23669. this.data,
  23670. this.edgeData
  23671. }
  23672. var J_ = $_.prototype;
  23673. function Q_(t, e) {
  23674. this.id = null == t ? "" : t,
  23675. this.inEdges = [],
  23676. this.outEdges = [],
  23677. this.edges = [],
  23678. this.hostGraph,
  23679. this.dataIndex = null == e ? -1 : e
  23680. }
  23681. function tw(t, e, i) {
  23682. this.node1 = t,
  23683. this.node2 = e,
  23684. this.dataIndex = null == i ? -1 : i
  23685. }
  23686. J_.type = "graph",
  23687. J_.isDirected = function() {
  23688. return this._directed
  23689. }
  23690. ,
  23691. J_.addNode = function(t, e) {
  23692. t = null == t ? "" + e : "" + t;
  23693. var i = this._nodesMap;
  23694. if (!i[K_(t)]) {
  23695. var n = new Q_(t,e);
  23696. return (n.hostGraph = this).nodes.push(n),
  23697. i[K_(t)] = n
  23698. }
  23699. }
  23700. ,
  23701. J_.getNodeByIndex = function(t) {
  23702. var e = this.data.getRawIndex(t);
  23703. return this.nodes[e]
  23704. }
  23705. ,
  23706. J_.getNodeById = function(t) {
  23707. return this._nodesMap[K_(t)]
  23708. }
  23709. ,
  23710. J_.addEdge = function(t, e, i) {
  23711. var n = this._nodesMap
  23712. , o = this._edgesMap;
  23713. if ("number" == typeof t && (t = this.nodes[t]),
  23714. "number" == typeof e && (e = this.nodes[e]),
  23715. Q_.isInstance(t) || (t = n[K_(t)]),
  23716. Q_.isInstance(e) || (e = n[K_(e)]),
  23717. t && e) {
  23718. var a = t.id + "-" + e.id;
  23719. if (!o[a]) {
  23720. var r = new tw(t,e,i);
  23721. return (r.hostGraph = this)._directed && (t.outEdges.push(r),
  23722. e.inEdges.push(r)),
  23723. t.edges.push(r),
  23724. t !== e && e.edges.push(r),
  23725. this.edges.push(r),
  23726. o[a] = r
  23727. }
  23728. }
  23729. }
  23730. ,
  23731. J_.getEdgeByIndex = function(t) {
  23732. var e = this.edgeData.getRawIndex(t);
  23733. return this.edges[e]
  23734. }
  23735. ,
  23736. J_.getEdge = function(t, e) {
  23737. Q_.isInstance(t) && (t = t.id),
  23738. Q_.isInstance(e) && (e = e.id);
  23739. var i = this._edgesMap;
  23740. return this._directed ? i[t + "-" + e] : i[t + "-" + e] || i[e + "-" + t]
  23741. }
  23742. ,
  23743. J_.eachNode = function(t, e) {
  23744. for (var i = this.nodes, n = i.length, o = 0; o < n; o++)
  23745. 0 <= i[o].dataIndex && t.call(e, i[o], o)
  23746. }
  23747. ,
  23748. J_.eachEdge = function(t, e) {
  23749. for (var i = this.edges, n = i.length, o = 0; o < n; o++)
  23750. 0 <= i[o].dataIndex && 0 <= i[o].node1.dataIndex && 0 <= i[o].node2.dataIndex && t.call(e, i[o], o)
  23751. }
  23752. ,
  23753. J_.breadthFirstTraverse = function(t, e, i, n) {
  23754. if (Q_.isInstance(e) || (e = this._nodesMap[K_(e)]),
  23755. e) {
  23756. for (var o = "out" === i ? "outEdges" : "in" === i ? "inEdges" : "edges", a = 0; a < this.nodes.length; a++)
  23757. this.nodes[a].__visited = !1;
  23758. if (!t.call(n, e, null))
  23759. for (var r = [e]; r.length; ) {
  23760. var s = r.shift()
  23761. , l = s[o];
  23762. for (a = 0; a < l.length; a++) {
  23763. var u = l[a]
  23764. , h = u.node1 === s ? u.node2 : u.node1;
  23765. if (!h.__visited) {
  23766. if (t.call(n, h, s))
  23767. return;
  23768. r.push(h),
  23769. h.__visited = !0
  23770. }
  23771. }
  23772. }
  23773. }
  23774. }
  23775. ,
  23776. J_.update = function() {
  23777. for (var t = this.data, i = this.edgeData, e = this.nodes, n = this.edges, o = 0, a = e.length; o < a; o++)
  23778. e[o].dataIndex = -1;
  23779. for (o = 0,
  23780. a = t.count(); o < a; o++)
  23781. e[t.getRawIndex(o)].dataIndex = o;
  23782. i.filterSelf(function(t) {
  23783. var e = n[i.getRawIndex(t)];
  23784. return 0 <= e.node1.dataIndex && 0 <= e.node2.dataIndex
  23785. });
  23786. for (o = 0,
  23787. a = n.length; o < a; o++)
  23788. n[o].dataIndex = -1;
  23789. for (o = 0,
  23790. a = i.count(); o < a; o++)
  23791. n[i.getRawIndex(o)].dataIndex = o
  23792. }
  23793. ,
  23794. J_.clone = function() {
  23795. for (var t = new $_(this._directed), e = this.nodes, i = this.edges, n = 0; n < e.length; n++)
  23796. t.addNode(e[n].id, e[n].dataIndex);
  23797. for (n = 0; n < i.length; n++) {
  23798. var o = i[n];
  23799. t.addEdge(o.node1.id, o.node2.id, o.dataIndex)
  23800. }
  23801. return t
  23802. }
  23803. ,
  23804. Q_.prototype = {
  23805. constructor: Q_,
  23806. degree: function() {
  23807. return this.edges.length
  23808. },
  23809. inDegree: function() {
  23810. return this.inEdges.length
  23811. },
  23812. outDegree: function() {
  23813. return this.outEdges.length
  23814. },
  23815. getModel: function(t) {
  23816. if (!(this.dataIndex < 0))
  23817. return this.hostGraph.data.getItemModel(this.dataIndex).getModel(t)
  23818. }
  23819. },
  23820. tw.prototype.getModel = function(t) {
  23821. if (!(this.dataIndex < 0))
  23822. return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)
  23823. }
  23824. ;
  23825. function ew(i, n) {
  23826. return {
  23827. getValue: function(t) {
  23828. var e = this[i][n];
  23829. return e.get(e.getDimension(t || "value"), this.dataIndex)
  23830. },
  23831. setVisual: function(t, e) {
  23832. 0 <= this.dataIndex && this[i][n].setItemVisual(this.dataIndex, t, e)
  23833. },
  23834. getVisual: function(t, e) {
  23835. return this[i][n].getItemVisual(this.dataIndex, t, e)
  23836. },
  23837. setLayout: function(t, e) {
  23838. 0 <= this.dataIndex && this[i][n].setItemLayout(this.dataIndex, t, e)
  23839. },
  23840. getLayout: function() {
  23841. return this[i][n].getItemLayout(this.dataIndex)
  23842. },
  23843. getGraphicEl: function() {
  23844. return this[i][n].getItemGraphicEl(this.dataIndex)
  23845. },
  23846. getRawIndex: function() {
  23847. return this[i][n].getRawIndex(this.dataIndex)
  23848. }
  23849. }
  23850. }
  23851. b(Q_, ew("hostGraph", "data")),
  23852. b(tw, ew("hostGraph", "edgeData")),
  23853. $_.Node = Q_,
  23854. $_.Edge = tw,
  23855. ra(Q_),
  23856. ra(tw);
  23857. function iw(t, e, i, n, o) {
  23858. for (var a = new $_(n), r = 0; r < t.length; r++)
  23859. a.addNode(W(t[r].id, t[r].name, r), r);
  23860. var s = []
  23861. , l = []
  23862. , u = 0;
  23863. for (r = 0; r < e.length; r++) {
  23864. var h = e[r]
  23865. , c = h.source
  23866. , d = h.target;
  23867. a.addEdge(c, d, u) && (l.push(h),
  23868. s.push(W(h.id, c + " > " + d)),
  23869. u++)
  23870. }
  23871. var f, p = i.get("coordinateSystem");
  23872. if ("cartesian2d" === p || "polar" === p)
  23873. f = gp(t, i);
  23874. else {
  23875. var g = lh.get(p)
  23876. , m = g && "view" !== g.type && g.dimensions || [];
  23877. _(m, "value") < 0 && m.concat(["value"]);
  23878. var v = lp(t, {
  23879. coordDimensions: m
  23880. });
  23881. (f = new Yf(v,i)).initData(t)
  23882. }
  23883. var y = new Yf(["value"],i);
  23884. return y.initData(l, s),
  23885. o && o(f, y),
  23886. yx({
  23887. mainData: f,
  23888. struct: a,
  23889. structAttr: "graph",
  23890. datas: {
  23891. node: f,
  23892. edge: y
  23893. },
  23894. datasAttr: {
  23895. node: "data",
  23896. edge: "edgeData"
  23897. }
  23898. }),
  23899. a.update(),
  23900. a
  23901. }
  23902. var nw = Df({
  23903. type: "series.graph",
  23904. init: function(t) {
  23905. nw.superApply(this, "init", arguments);
  23906. var e = this;
  23907. function i() {
  23908. return e._categoriesData
  23909. }
  23910. this.legendVisualProvider = new qv(i,i),
  23911. this.fillDataTextStyle(t.edges || t.links),
  23912. this._updateCategoriesData()
  23913. },
  23914. mergeOption: function(t) {
  23915. nw.superApply(this, "mergeOption", arguments),
  23916. this.fillDataTextStyle(t.edges || t.links),
  23917. this._updateCategoriesData()
  23918. },
  23919. mergeDefaultAndTheme: function(t) {
  23920. nw.superApply(this, "mergeDefaultAndTheme", arguments),
  23921. Go(t, ["edgeLabel"], ["show"])
  23922. },
  23923. getInitialData: function(t, s) {
  23924. var e = t.edges || t.links || []
  23925. , i = t.data || t.nodes || []
  23926. , l = this;
  23927. if (i && e)
  23928. return iw(i, e, this, !0, function(t, e) {
  23929. t.wrapMethod("getItemModel", function(t) {
  23930. var e = l._categoriesModels[t.getShallow("category")];
  23931. return e && (e.parentModel = t.parentModel,
  23932. t.parentModel = e),
  23933. t
  23934. });
  23935. var i = l.getModel("edgeLabel")
  23936. , n = new Cl({
  23937. label: i.option
  23938. },i.parentModel,s)
  23939. , o = l.getModel("emphasis.edgeLabel")
  23940. , a = new Cl({
  23941. emphasis: {
  23942. label: o.option
  23943. }
  23944. },o.parentModel,s);
  23945. function r(t) {
  23946. return (t = this.parsePath(t)) && "label" === t[0] ? n : t && "emphasis" === t[0] && "label" === t[1] ? a : this.parentModel
  23947. }
  23948. e.wrapMethod("getItemModel", function(t) {
  23949. return t.customizeGetParent(r),
  23950. t
  23951. })
  23952. }).data
  23953. },
  23954. getGraph: function() {
  23955. return this.getData().graph
  23956. },
  23957. getEdgeData: function() {
  23958. return this.getGraph().edgeData
  23959. },
  23960. getCategoriesData: function() {
  23961. return this._categoriesData
  23962. },
  23963. formatTooltip: function(t, e, i) {
  23964. if ("edge" !== i)
  23965. return nw.superApply(this, "formatTooltip", arguments);
  23966. var n = this.getData()
  23967. , o = this.getDataParams(t, i)
  23968. , a = n.graph.getEdgeByIndex(t)
  23969. , r = n.getName(a.node1.dataIndex)
  23970. , s = n.getName(a.node2.dataIndex)
  23971. , l = [];
  23972. return null != r && l.push(r),
  23973. null != s && l.push(s),
  23974. l = au(l.join(" > ")),
  23975. o.value && (l += " : " + au(o.value)),
  23976. l
  23977. },
  23978. _updateCategoriesData: function() {
  23979. var t = O(this.option.categories || [], function(t) {
  23980. return null != t.value ? t : P({
  23981. value: 0
  23982. }, t)
  23983. })
  23984. , e = new Yf(["value"],this);
  23985. e.initData(t),
  23986. this._categoriesData = e,
  23987. this._categoriesModels = e.mapArray(function(t) {
  23988. return e.getItemModel(t, !0)
  23989. })
  23990. },
  23991. setZoom: function(t) {
  23992. this.option.zoom = t
  23993. },
  23994. setCenter: function(t) {
  23995. this.option.center = t
  23996. },
  23997. isAnimationEnabled: function() {
  23998. return nw.superCall(this, "isAnimationEnabled") && !("force" === this.get("layout") && this.get("force.layoutAnimation"))
  23999. },
  24000. defaultOption: {
  24001. zlevel: 0,
  24002. z: 2,
  24003. coordinateSystem: "view",
  24004. legendHoverLink: !0,
  24005. hoverAnimation: !0,
  24006. layout: null,
  24007. focusNodeAdjacency: !1,
  24008. circular: {
  24009. rotateLabel: !1
  24010. },
  24011. force: {
  24012. initLayout: null,
  24013. repulsion: [0, 50],
  24014. gravity: .1,
  24015. friction: .6,
  24016. edgeLength: 30,
  24017. layoutAnimation: !0
  24018. },
  24019. left: "center",
  24020. top: "center",
  24021. symbol: "circle",
  24022. symbolSize: 10,
  24023. edgeSymbol: ["none", "none"],
  24024. edgeSymbolSize: 10,
  24025. edgeLabel: {
  24026. position: "middle",
  24027. distance: 5
  24028. },
  24029. draggable: !1,
  24030. roam: !1,
  24031. center: null,
  24032. zoom: 1,
  24033. nodeScaleRatio: .6,
  24034. label: {
  24035. show: !1,
  24036. formatter: "{b}"
  24037. },
  24038. itemStyle: {},
  24039. lineStyle: {
  24040. color: "#aaa",
  24041. width: 1,
  24042. curveness: 0,
  24043. opacity: .5
  24044. },
  24045. emphasis: {
  24046. label: {
  24047. show: !0
  24048. }
  24049. }
  24050. }
  24051. })
  24052. , ow = ls.prototype
  24053. , aw = ds.prototype;
  24054. function rw(t) {
  24055. return isNaN(+t.cpx1) || isNaN(+t.cpy1)
  24056. }
  24057. var sw = Cs({
  24058. type: "ec-line",
  24059. style: {
  24060. stroke: "#000",
  24061. fill: null
  24062. },
  24063. shape: {
  24064. x1: 0,
  24065. y1: 0,
  24066. x2: 0,
  24067. y2: 0,
  24068. percent: 1,
  24069. cpx1: null,
  24070. cpy1: null
  24071. },
  24072. buildPath: function(t, e) {
  24073. this[rw(e) ? "_buildPathLine" : "_buildPathCurve"](t, e)
  24074. },
  24075. _buildPathLine: ow.buildPath,
  24076. _buildPathCurve: aw.buildPath,
  24077. pointAt: function(t) {
  24078. return this[rw(this.shape) ? "_pointAtLine" : "_pointAtCurve"](t)
  24079. },
  24080. _pointAtLine: ow.pointAt,
  24081. _pointAtCurve: aw.pointAt,
  24082. tangentAt: function(t) {
  24083. var e = this.shape
  24084. , i = rw(e) ? [e.x2 - e.x1, e.y2 - e.y1] : this._tangentAtCurve(t);
  24085. return mt(i, i)
  24086. },
  24087. _tangentAtCurve: aw.tangentAt
  24088. })
  24089. , lw = ["fromSymbol", "toSymbol"];
  24090. function uw(t) {
  24091. return "_" + t + "Type"
  24092. }
  24093. function hw(t, e, i) {
  24094. var n = e.getItemVisual(i, "color")
  24095. , o = e.getItemVisual(i, t)
  24096. , a = e.getItemVisual(i, t + "Size");
  24097. if (o && "none" !== o) {
  24098. L(a) || (a = [a, a]);
  24099. var r = wg(o, -a[0] / 2, -a[1] / 2, a[0], a[1], n);
  24100. return r.name = t,
  24101. r
  24102. }
  24103. }
  24104. function cw(t, e) {
  24105. t.x1 = e[0][0],
  24106. t.y1 = e[0][1],
  24107. t.x2 = e[1][0],
  24108. t.y2 = e[1][1],
  24109. t.percent = 1;
  24110. var i = e[2];
  24111. i ? (t.cpx1 = i[0],
  24112. t.cpy1 = i[1]) : (t.cpx1 = NaN,
  24113. t.cpy1 = NaN)
  24114. }
  24115. function dw(t, e, i) {
  24116. Ci.call(this),
  24117. this._createLine(t, e, i)
  24118. }
  24119. var fw = dw.prototype;
  24120. function pw(t) {
  24121. this._ctor = t || dw,
  24122. this.group = new Ci
  24123. }
  24124. fw.beforeUpdate = function() {
  24125. var t = this.childOfName("fromSymbol")
  24126. , e = this.childOfName("toSymbol")
  24127. , i = this.childOfName("label");
  24128. if (t || e || !i.ignore) {
  24129. for (var n = 1, o = this.parent; o; )
  24130. o.scale && (n /= o.scale[0]),
  24131. o = o.parent;
  24132. var a = this.childOfName("line");
  24133. if (this.__dirty || a.__dirty) {
  24134. var r = a.shape.percent
  24135. , s = a.pointAt(0)
  24136. , l = a.pointAt(r)
  24137. , u = ht([], l, s);
  24138. if (mt(u, u),
  24139. t) {
  24140. t.attr("position", s);
  24141. var h = a.tangentAt(0);
  24142. t.attr("rotation", Math.PI / 2 - Math.atan2(h[1], h[0])),
  24143. t.attr("scale", [n * r, n * r])
  24144. }
  24145. if (e) {
  24146. e.attr("position", l);
  24147. h = a.tangentAt(1);
  24148. e.attr("rotation", -Math.PI / 2 - Math.atan2(h[1], h[0])),
  24149. e.attr("scale", [n * r, n * r])
  24150. }
  24151. if (!i.ignore) {
  24152. var c, d, f, p;
  24153. i.attr("position", l);
  24154. var g = i.__labelDistance
  24155. , m = g[0] * n
  24156. , v = g[1] * n
  24157. , y = r / 2
  24158. , x = [(h = a.tangentAt(y))[1], -h[0]]
  24159. , _ = a.pointAt(y);
  24160. 0 < x[1] && (x[0] = -x[0],
  24161. x[1] = -x[1]);
  24162. var w, b = h[0] < 0 ? -1 : 1;
  24163. if ("start" !== i.__position && "end" !== i.__position) {
  24164. var S = -Math.atan2(h[1], h[0]);
  24165. l[0] < s[0] && (S = Math.PI + S),
  24166. i.attr("rotation", S)
  24167. }
  24168. switch (i.__position) {
  24169. case "insideStartTop":
  24170. case "insideMiddleTop":
  24171. case "insideEndTop":
  24172. case "middle":
  24173. w = -v,
  24174. f = "bottom";
  24175. break;
  24176. case "insideStartBottom":
  24177. case "insideMiddleBottom":
  24178. case "insideEndBottom":
  24179. w = v,
  24180. f = "top";
  24181. break;
  24182. default:
  24183. w = 0,
  24184. f = "middle"
  24185. }
  24186. switch (i.__position) {
  24187. case "end":
  24188. c = [u[0] * m + l[0], u[1] * v + l[1]],
  24189. d = .8 < u[0] ? "left" : u[0] < -.8 ? "right" : "center",
  24190. f = .8 < u[1] ? "top" : u[1] < -.8 ? "bottom" : "middle";
  24191. break;
  24192. case "start":
  24193. c = [-u[0] * m + s[0], -u[1] * v + s[1]],
  24194. d = .8 < u[0] ? "right" : u[0] < -.8 ? "left" : "center",
  24195. f = .8 < u[1] ? "bottom" : u[1] < -.8 ? "top" : "middle";
  24196. break;
  24197. case "insideStartTop":
  24198. case "insideStart":
  24199. case "insideStartBottom":
  24200. c = [m * b + s[0], s[1] + w],
  24201. d = h[0] < 0 ? "right" : "left",
  24202. p = [-m * b, -w];
  24203. break;
  24204. case "insideMiddleTop":
  24205. case "insideMiddle":
  24206. case "insideMiddleBottom":
  24207. case "middle":
  24208. c = [_[0], _[1] + w],
  24209. d = "center",
  24210. p = [0, -w];
  24211. break;
  24212. case "insideEndTop":
  24213. case "insideEnd":
  24214. case "insideEndBottom":
  24215. c = [-m * b + l[0], l[1] + w],
  24216. d = 0 <= h[0] ? "right" : "left",
  24217. p = [m * b, -w]
  24218. }
  24219. i.attr({
  24220. style: {
  24221. textVerticalAlign: i.__verticalAlign || f,
  24222. textAlign: i.__textAlign || d
  24223. },
  24224. position: c,
  24225. scale: [n, n],
  24226. origin: p
  24227. })
  24228. }
  24229. }
  24230. }
  24231. }
  24232. ,
  24233. fw._createLine = function(i, n, t) {
  24234. var e = i.hostModel
  24235. , o = function(t) {
  24236. var e = new sw({
  24237. name: "line",
  24238. subPixelOptimize: !0
  24239. });
  24240. return cw(e.shape, t),
  24241. e
  24242. }(i.getItemLayout(n));
  24243. o.shape.percent = 0,
  24244. dl(o, {
  24245. shape: {
  24246. percent: 1
  24247. }
  24248. }, e, n),
  24249. this.add(o);
  24250. var a = new Ur({
  24251. name: "label",
  24252. lineLabelOriginalOpacity: 1
  24253. });
  24254. this.add(a),
  24255. E(lw, function(t) {
  24256. var e = hw(t, i, n);
  24257. this.add(e),
  24258. this[uw(t)] = i.getItemVisual(n, t)
  24259. }, this),
  24260. this._updateCommonStl(i, n, t)
  24261. }
  24262. ,
  24263. fw.updateData = function(o, a, t) {
  24264. var e = o.hostModel
  24265. , i = this.childOfName("line")
  24266. , n = o.getItemLayout(a)
  24267. , r = {
  24268. shape: {}
  24269. };
  24270. cw(r.shape, n),
  24271. cl(i, r, e, a),
  24272. E(lw, function(t) {
  24273. var e = o.getItemVisual(a, t)
  24274. , i = uw(t);
  24275. if (this[i] !== e) {
  24276. this.remove(this.childOfName(t));
  24277. var n = hw(t, o, a);
  24278. this.add(n)
  24279. }
  24280. this[i] = e
  24281. }, this),
  24282. this._updateCommonStl(o, a, t)
  24283. }
  24284. ,
  24285. fw._updateCommonStl = function(t, e, i) {
  24286. var n = t.hostModel
  24287. , o = this.childOfName("line")
  24288. , a = i && i.lineStyle
  24289. , r = i && i.hoverLineStyle
  24290. , s = i && i.labelModel
  24291. , l = i && i.hoverLabelModel;
  24292. if (!i || t.hasItemOption) {
  24293. var u = t.getItemModel(e);
  24294. a = u.getModel("lineStyle").getLineStyle(),
  24295. r = u.getModel("emphasis.lineStyle").getLineStyle(),
  24296. s = u.getModel("label"),
  24297. l = u.getModel("emphasis.label")
  24298. }
  24299. var h = t.getItemVisual(e, "color")
  24300. , c = Z(t.getItemVisual(e, "opacity"), a.opacity, 1);
  24301. o.useStyle(D({
  24302. strokeNoScale: !0,
  24303. fill: "none",
  24304. stroke: h,
  24305. opacity: c
  24306. }, a)),
  24307. o.hoverStyle = r,
  24308. E(lw, function(t) {
  24309. var e = this.childOfName(t);
  24310. e && (e.setColor(h),
  24311. e.setStyle({
  24312. opacity: c
  24313. }))
  24314. }, this);
  24315. var d, f, p = s.getShallow("show"), g = l.getShallow("show"), m = this.childOfName("label");
  24316. if ((p || g) && (d = h || "#000",
  24317. null == (f = n.getFormattedLabel(e, "normal", t.dataType)))) {
  24318. var v = n.getRawValue(e);
  24319. f = null == v ? t.getName(e) : isFinite(v) ? zl(v) : v
  24320. }
  24321. var y = p ? f : null
  24322. , x = g ? H(n.getFormattedLabel(e, "emphasis", t.dataType), f) : null
  24323. , _ = m.style;
  24324. if (null != y || null != x) {
  24325. nl(m.style, s, {
  24326. text: y
  24327. }, {
  24328. autoColor: d
  24329. }),
  24330. m.__textAlign = _.textAlign,
  24331. m.__verticalAlign = _.textVerticalAlign,
  24332. m.__position = s.get("position") || "middle";
  24333. var w = s.get("distance");
  24334. L(w) || (w = [w, w]),
  24335. m.__labelDistance = w
  24336. }
  24337. m.hoverStyle = null != x ? {
  24338. text: x,
  24339. textFill: l.getTextColor(!0),
  24340. fontStyle: l.getShallow("fontStyle"),
  24341. fontWeight: l.getShallow("fontWeight"),
  24342. fontSize: l.getShallow("fontSize"),
  24343. fontFamily: l.getShallow("fontFamily")
  24344. } : {
  24345. text: null
  24346. },
  24347. m.ignore = !p && !g,
  24348. $s(this)
  24349. }
  24350. ,
  24351. fw.highlight = function() {
  24352. this.trigger("emphasis")
  24353. }
  24354. ,
  24355. fw.downplay = function() {
  24356. this.trigger("normal")
  24357. }
  24358. ,
  24359. fw.updateLayout = function(t, e) {
  24360. this.setLinePoints(t.getItemLayout(e))
  24361. }
  24362. ,
  24363. fw.setLinePoints = function(t) {
  24364. var e = this.childOfName("line");
  24365. cw(e.shape, t),
  24366. e.dirty()
  24367. }
  24368. ,
  24369. w(dw, Ci);
  24370. var gw = pw.prototype;
  24371. function mw(t) {
  24372. var e = t.hostModel;
  24373. return {
  24374. lineStyle: e.getModel("lineStyle").getLineStyle(),
  24375. hoverLineStyle: e.getModel("emphasis.lineStyle").getLineStyle(),
  24376. labelModel: e.getModel("label"),
  24377. hoverLabelModel: e.getModel("emphasis.label")
  24378. }
  24379. }
  24380. function vw(t) {
  24381. return isNaN(t[0]) || isNaN(t[1])
  24382. }
  24383. function yw(t) {
  24384. return !vw(t[0]) && !vw(t[1])
  24385. }
  24386. function xw(t) {
  24387. var e = t.coordinateSystem;
  24388. if ("view" !== e.type)
  24389. return 1;
  24390. var i = t.option.nodeScaleRatio
  24391. , n = e.scale
  24392. , o = n && n[0] || 1;
  24393. return ((e.getZoom() - 1) * i + 1) / o
  24394. }
  24395. function _w(t) {
  24396. var e = t.getVisual("symbolSize");
  24397. return e instanceof Array && (e = (e[0] + e[1]) / 2),
  24398. +e
  24399. }
  24400. gw.isPersistent = function() {
  24401. return !0
  24402. }
  24403. ,
  24404. gw.updateData = function(i) {
  24405. var n = this
  24406. , e = n.group
  24407. , o = n._lineData;
  24408. n._lineData = i,
  24409. o || e.removeAll();
  24410. var a = mw(i);
  24411. i.diff(o).add(function(t) {
  24412. !function(t, e, i, n) {
  24413. if (!yw(e.getItemLayout(i)))
  24414. return;
  24415. var o = new t._ctor(e,i,n);
  24416. e.setItemGraphicEl(i, o),
  24417. t.group.add(o)
  24418. }(n, i, t, a)
  24419. }).update(function(t, e) {
  24420. !function(t, e, i, n, o, a) {
  24421. var r = e.getItemGraphicEl(n);
  24422. if (!yw(i.getItemLayout(o)))
  24423. return t.group.remove(r);
  24424. r ? r.updateData(i, o, a) : r = new t._ctor(i,o,a);
  24425. i.setItemGraphicEl(o, r),
  24426. t.group.add(r)
  24427. }(n, o, i, e, t, a)
  24428. }).remove(function(t) {
  24429. e.remove(o.getItemGraphicEl(t))
  24430. }).execute()
  24431. }
  24432. ,
  24433. gw.updateLayout = function() {
  24434. var i = this._lineData;
  24435. i && i.eachItemGraphicEl(function(t, e) {
  24436. t.updateLayout(i, e)
  24437. }, this)
  24438. }
  24439. ,
  24440. gw.incrementalPrepareUpdate = function(t) {
  24441. this._seriesScope = mw(t),
  24442. this._lineData = null,
  24443. this.group.removeAll()
  24444. }
  24445. ,
  24446. gw.incrementalUpdate = function(t, e) {
  24447. function i(t) {
  24448. t.isGroup || function(t) {
  24449. return t.animators && 0 < t.animators.length
  24450. }(t) || (t.incremental = t.useHoverLayer = !0)
  24451. }
  24452. for (var n = t.start; n < t.end; n++) {
  24453. if (yw(e.getItemLayout(n))) {
  24454. var o = new this._ctor(e,n,this._seriesScope);
  24455. o.traverse(i),
  24456. this.group.add(o),
  24457. e.setItemGraphicEl(n, o)
  24458. }
  24459. }
  24460. }
  24461. ,
  24462. gw.remove = function() {
  24463. this._clearIncremental(),
  24464. this._incremental = null,
  24465. this.group.removeAll()
  24466. }
  24467. ,
  24468. gw._clearIncremental = function() {
  24469. var t = this._incremental;
  24470. t && t.clearDisplaybles()
  24471. }
  24472. ;
  24473. var ww = []
  24474. , bw = []
  24475. , Sw = []
  24476. , Mw = La
  24477. , Iw = _t
  24478. , Tw = Math.abs;
  24479. function Aw(t, e, i) {
  24480. for (var n, o = t[0], a = t[1], r = t[2], s = 1 / 0, l = i * i, u = .1, h = .1; h <= .9; h += .1) {
  24481. ww[0] = Mw(o[0], a[0], r[0], h),
  24482. ww[1] = Mw(o[1], a[1], r[1], h),
  24483. (f = Tw(Iw(ww, e) - l)) < s && (s = f,
  24484. n = h)
  24485. }
  24486. for (var c = 0; c < 32; c++) {
  24487. var d = n + u;
  24488. bw[0] = Mw(o[0], a[0], r[0], n),
  24489. bw[1] = Mw(o[1], a[1], r[1], n),
  24490. Sw[0] = Mw(o[0], a[0], r[0], d),
  24491. Sw[1] = Mw(o[1], a[1], r[1], d);
  24492. var f = Iw(bw, e) - l;
  24493. if (Tw(f) < .01)
  24494. break;
  24495. var p = Iw(Sw, e) - l;
  24496. u /= 2,
  24497. f < 0 ? 0 <= p ? n += u : n -= u : 0 <= p ? n -= u : n += u
  24498. }
  24499. return n
  24500. }
  24501. function Dw(t, l) {
  24502. var u = []
  24503. , h = Na
  24504. , c = [[], [], []]
  24505. , d = [[], []]
  24506. , f = [];
  24507. l /= 2,
  24508. t.eachEdge(function(t, e) {
  24509. var i = t.getLayout()
  24510. , n = t.getVisual("fromSymbol")
  24511. , o = t.getVisual("toSymbol");
  24512. i.__original || (i.__original = [rt(i[0]), rt(i[1])],
  24513. i[2] && i.__original.push(rt(i[2])));
  24514. var a = i.__original;
  24515. if (null != i[2]) {
  24516. if (at(c[0], a[0]),
  24517. at(c[1], a[2]),
  24518. at(c[2], a[1]),
  24519. n && "none" !== n) {
  24520. var r = _w(t.node1)
  24521. , s = Aw(c, a[0], r * l);
  24522. h(c[0][0], c[1][0], c[2][0], s, u),
  24523. c[0][0] = u[3],
  24524. c[1][0] = u[4],
  24525. h(c[0][1], c[1][1], c[2][1], s, u),
  24526. c[0][1] = u[3],
  24527. c[1][1] = u[4]
  24528. }
  24529. if (o && "none" !== o) {
  24530. r = _w(t.node2),
  24531. s = Aw(c, a[1], r * l);
  24532. h(c[0][0], c[1][0], c[2][0], s, u),
  24533. c[1][0] = u[1],
  24534. c[2][0] = u[2],
  24535. h(c[0][1], c[1][1], c[2][1], s, u),
  24536. c[1][1] = u[1],
  24537. c[2][1] = u[2]
  24538. }
  24539. at(i[0], c[0]),
  24540. at(i[1], c[2]),
  24541. at(i[2], c[1])
  24542. } else {
  24543. if (at(d[0], a[0]),
  24544. at(d[1], a[1]),
  24545. ht(f, d[1], d[0]),
  24546. mt(f, f),
  24547. n && "none" !== n) {
  24548. r = _w(t.node1);
  24549. ut(d[0], d[0], f, r * l)
  24550. }
  24551. if (o && "none" !== o) {
  24552. r = _w(t.node2);
  24553. ut(d[1], d[1], f, -r * l)
  24554. }
  24555. at(i[0], d[0]),
  24556. at(i[1], d[1])
  24557. }
  24558. })
  24559. }
  24560. var Cw = "__focusNodeAdjacency"
  24561. , Lw = "__unfocusNodeAdjacency"
  24562. , kw = ["itemStyle", "opacity"]
  24563. , Pw = ["lineStyle", "opacity"];
  24564. function Nw(t, e) {
  24565. var i = t.getVisual("opacity");
  24566. return null != i ? i : t.getModel().get(e)
  24567. }
  24568. function Ow(t, e, i) {
  24569. var n = t.getGraphicEl()
  24570. , o = Nw(t, e);
  24571. null != i && (null == o && (o = 1),
  24572. o *= i),
  24573. n.downplay && n.downplay(),
  24574. n.traverse(function(t) {
  24575. if (!t.isGroup) {
  24576. var e = t.lineLabelOriginalOpacity;
  24577. null != e && null == i || (e = o),
  24578. t.setStyle("opacity", e)
  24579. }
  24580. })
  24581. }
  24582. function Ew(t, e) {
  24583. var i = Nw(t, e)
  24584. , n = t.getGraphicEl();
  24585. n.traverse(function(t) {
  24586. t.isGroup || t.setStyle("opacity", i)
  24587. }),
  24588. n.highlight && n.highlight()
  24589. }
  24590. Cf({
  24591. type: "graph",
  24592. init: function(t, e) {
  24593. var i = new im
  24594. , n = new pw
  24595. , o = this.group;
  24596. this._controller = new Vy(e.getZr()),
  24597. this._controllerHost = {
  24598. target: o
  24599. },
  24600. o.add(i.group),
  24601. o.add(n.group),
  24602. this._symbolDraw = i,
  24603. this._lineDraw = n,
  24604. this._firstRender = !0
  24605. },
  24606. render: function(o, t, a) {
  24607. var r = this
  24608. , e = o.coordinateSystem;
  24609. this._model = o;
  24610. var i = this._symbolDraw
  24611. , n = this._lineDraw
  24612. , s = this.group;
  24613. if ("view" === e.type) {
  24614. var l = {
  24615. position: e.position,
  24616. scale: e.scale
  24617. };
  24618. this._firstRender ? s.attr(l) : cl(s, l, o)
  24619. }
  24620. Dw(o.getGraph(), xw(o));
  24621. var u = o.getData();
  24622. i.updateData(u);
  24623. var h = o.getEdgeData();
  24624. n.updateData(h),
  24625. this._updateNodeAndLinkScale(),
  24626. this._updateController(o, t, a),
  24627. clearTimeout(this._layoutTimeout);
  24628. var c = o.forceLayout
  24629. , d = o.get("force.layoutAnimation");
  24630. c && this._startForceLayoutIteration(c, d),
  24631. u.eachItemGraphicEl(function(t, e) {
  24632. var i = u.getItemModel(e);
  24633. t.off("drag").off("dragend");
  24634. var n = i.get("draggable");
  24635. n && t.on("drag", function() {
  24636. c && (c.warmUp(),
  24637. this._layouting || this._startForceLayoutIteration(c, d),
  24638. c.setFixed(e),
  24639. u.setItemLayout(e, t.position))
  24640. }, this).on("dragend", function() {
  24641. c && c.setUnfixed(e)
  24642. }, this),
  24643. t.setDraggable(n && c),
  24644. t[Cw] && t.off("mouseover", t[Cw]),
  24645. t[Lw] && t.off("mouseout", t[Lw]),
  24646. i.get("focusNodeAdjacency") && (t.on("mouseover", t[Cw] = function() {
  24647. r._clearTimer(),
  24648. a.dispatchAction({
  24649. type: "focusNodeAdjacency",
  24650. seriesId: o.id,
  24651. dataIndex: t.dataIndex
  24652. })
  24653. }
  24654. ),
  24655. t.on("mouseout", t[Lw] = function() {
  24656. r._dispatchUnfocus(a)
  24657. }
  24658. ))
  24659. }, this),
  24660. u.graph.eachEdge(function(t) {
  24661. var e = t.getGraphicEl();
  24662. e[Cw] && e.off("mouseover", e[Cw]),
  24663. e[Lw] && e.off("mouseout", e[Lw]),
  24664. t.getModel().get("focusNodeAdjacency") && (e.on("mouseover", e[Cw] = function() {
  24665. r._clearTimer(),
  24666. a.dispatchAction({
  24667. type: "focusNodeAdjacency",
  24668. seriesId: o.id,
  24669. edgeDataIndex: t.dataIndex
  24670. })
  24671. }
  24672. ),
  24673. e.on("mouseout", e[Lw] = function() {
  24674. r._dispatchUnfocus(a)
  24675. }
  24676. ))
  24677. });
  24678. var f = "circular" === o.get("layout") && o.get("circular.rotateLabel")
  24679. , p = u.getLayout("cx")
  24680. , g = u.getLayout("cy");
  24681. u.eachItemGraphicEl(function(t, e) {
  24682. var i = u.getItemModel(e).get("label.rotate") || 0
  24683. , n = t.getSymbolPath();
  24684. if (f) {
  24685. var o = u.getItemLayout(e)
  24686. , a = Math.atan2(o[1] - g, o[0] - p);
  24687. a < 0 && (a = 2 * Math.PI + a);
  24688. var r = o[0] < p;
  24689. r && (a -= Math.PI);
  24690. var s = r ? "left" : "right";
  24691. il(n, {
  24692. textRotation: -a,
  24693. textPosition: s,
  24694. textOrigin: "center"
  24695. }, {
  24696. textPosition: s
  24697. })
  24698. } else
  24699. il(n, {
  24700. textRotation: i *= Math.PI / 180
  24701. })
  24702. }),
  24703. this._firstRender = !1
  24704. },
  24705. dispose: function() {
  24706. this._controller && this._controller.dispose(),
  24707. this._controllerHost = {},
  24708. this._clearTimer()
  24709. },
  24710. _dispatchUnfocus: function(t, e) {
  24711. var i = this;
  24712. this._clearTimer(),
  24713. this._unfocusDelayTimer = setTimeout(function() {
  24714. i._unfocusDelayTimer = null,
  24715. t.dispatchAction({
  24716. type: "unfocusNodeAdjacency",
  24717. seriesId: i._model.id
  24718. })
  24719. }, 500)
  24720. },
  24721. _clearTimer: function() {
  24722. this._unfocusDelayTimer && (clearTimeout(this._unfocusDelayTimer),
  24723. this._unfocusDelayTimer = null)
  24724. },
  24725. focusNodeAdjacency: function(t, e, i, n) {
  24726. var o = t.getData().graph
  24727. , a = n.dataIndex
  24728. , r = n.edgeDataIndex
  24729. , s = o.getNodeByIndex(a)
  24730. , l = o.getEdgeByIndex(r);
  24731. (s || l) && (o.eachNode(function(t) {
  24732. Ow(t, kw, .1)
  24733. }),
  24734. o.eachEdge(function(t) {
  24735. Ow(t, Pw, .1)
  24736. }),
  24737. s && (Ew(s, kw),
  24738. E(s.edges, function(t) {
  24739. t.dataIndex < 0 || (Ew(t, Pw),
  24740. Ew(t.node1, kw),
  24741. Ew(t.node2, kw))
  24742. })),
  24743. l && (Ew(l, Pw),
  24744. Ew(l.node1, kw),
  24745. Ew(l.node2, kw)))
  24746. },
  24747. unfocusNodeAdjacency: function(t, e, i, n) {
  24748. var o = t.getData().graph;
  24749. o.eachNode(function(t) {
  24750. Ow(t, kw)
  24751. }),
  24752. o.eachEdge(function(t) {
  24753. Ow(t, Pw)
  24754. })
  24755. },
  24756. _startForceLayoutIteration: function(t, i) {
  24757. var n = this;
  24758. !function e() {
  24759. t.step(function(t) {
  24760. n.updateLayout(n._model),
  24761. (n._layouting = !t) && (i ? n._layoutTimeout = setTimeout(e, 16) : e())
  24762. })
  24763. }()
  24764. },
  24765. _updateController: function(o, t, a) {
  24766. var e = this._controller
  24767. , i = this._controllerHost
  24768. , r = this.group;
  24769. e.setPointerChecker(function(t, e, i) {
  24770. var n = r.getBoundingRect();
  24771. return n.applyTransform(r.transform),
  24772. n.contain(e, i) && !$y(t, a, o)
  24773. }),
  24774. "view" === o.coordinateSystem.type ? (e.enable(o.get("roam")),
  24775. i.zoomLimit = o.get("scaleLimit"),
  24776. i.zoom = o.coordinateSystem.getZoom(),
  24777. e.off("pan").off("zoom").on("pan", function(t) {
  24778. jy(i, t.dx, t.dy),
  24779. a.dispatchAction({
  24780. seriesId: o.id,
  24781. type: "graphRoam",
  24782. dx: t.dx,
  24783. dy: t.dy
  24784. })
  24785. }).on("zoom", function(t) {
  24786. qy(i, t.scale, t.originX, t.originY),
  24787. a.dispatchAction({
  24788. seriesId: o.id,
  24789. type: "graphRoam",
  24790. zoom: t.scale,
  24791. originX: t.originX,
  24792. originY: t.originY
  24793. }),
  24794. this._updateNodeAndLinkScale(),
  24795. Dw(o.getGraph(), xw(o)),
  24796. this._lineDraw.updateLayout()
  24797. }, this)) : e.disable()
  24798. },
  24799. _updateNodeAndLinkScale: function() {
  24800. var t = this._model
  24801. , e = t.getData()
  24802. , i = xw(t)
  24803. , n = [i, i];
  24804. e.eachItemGraphicEl(function(t, e) {
  24805. t.attr("scale", n)
  24806. })
  24807. },
  24808. updateLayout: function(t) {
  24809. Dw(t.getGraph(), xw(t)),
  24810. this._symbolDraw.updateLayout(),
  24811. this._lineDraw.updateLayout()
  24812. },
  24813. remove: function(t, e) {
  24814. this._symbolDraw && this._symbolDraw.remove(),
  24815. this._lineDraw && this._lineDraw.remove()
  24816. }
  24817. }),
  24818. _f({
  24819. type: "focusNodeAdjacency",
  24820. event: "focusNodeAdjacency",
  24821. update: "series:focusNodeAdjacency"
  24822. }, function() {}),
  24823. _f({
  24824. type: "unfocusNodeAdjacency",
  24825. event: "unfocusNodeAdjacency",
  24826. update: "series:unfocusNodeAdjacency"
  24827. }, function() {});
  24828. _f({
  24829. type: "graphRoam",
  24830. event: "graphRoam",
  24831. update: "none"
  24832. }, function(i, t) {
  24833. t.eachComponent({
  24834. mainType: "series",
  24835. query: i
  24836. }, function(t) {
  24837. var e = ax(t.coordinateSystem, i);
  24838. t.setCenter && t.setCenter(e.center),
  24839. t.setZoom && t.setZoom(e.zoom)
  24840. })
  24841. });
  24842. function Rw(t) {
  24843. return t instanceof Array || (t = [t, t]),
  24844. t
  24845. }
  24846. function zw(t) {
  24847. var e = t.coordinateSystem;
  24848. if (!e || "view" === e.type) {
  24849. var i = t.getGraph();
  24850. i.eachNode(function(t) {
  24851. var e = t.getModel();
  24852. t.setLayout([+e.get("x"), +e.get("y")])
  24853. }),
  24854. Bw(i)
  24855. }
  24856. }
  24857. function Bw(t) {
  24858. t.eachEdge(function(t) {
  24859. var e = t.getModel().get("lineStyle.curveness") || 0
  24860. , i = rt(t.node1.getLayout())
  24861. , n = rt(t.node2.getLayout())
  24862. , o = [i, n];
  24863. +e && o.push([(i[0] + n[0]) / 2 - (i[1] - n[1]) * e, (i[1] + n[1]) / 2 - (n[0] - i[0]) * e]),
  24864. t.setLayout(o)
  24865. })
  24866. }
  24867. var Vw = Math.PI
  24868. , Gw = [];
  24869. function Fw(t, e) {
  24870. var i = t.coordinateSystem;
  24871. if (!i || "view" === i.type) {
  24872. var n = i.getBoundingRect()
  24873. , o = t.getData()
  24874. , a = o.graph
  24875. , s = n.width / 2 + n.x
  24876. , l = n.height / 2 + n.y
  24877. , r = Math.min(n.width, n.height) / 2
  24878. , u = o.count();
  24879. o.setLayout({
  24880. cx: s,
  24881. cy: l
  24882. }),
  24883. u && (Ww[e](t, i, a, o, r, s, l, u),
  24884. a.eachEdge(function(t) {
  24885. var e, i = t.getModel().get("lineStyle.curveness") || 0, n = rt(t.node1.getLayout()), o = rt(t.node2.getLayout()), a = (n[0] + o[0]) / 2, r = (n[1] + o[1]) / 2;
  24886. +i && (e = [s * (i *= 3) + a * (1 - i), l * i + r * (1 - i)]),
  24887. t.setLayout([n, o, e])
  24888. }))
  24889. }
  24890. }
  24891. var Ww = {
  24892. value: function(t, e, i, n, o, a, r, s) {
  24893. var l = 0
  24894. , u = n.getSum("value")
  24895. , h = 2 * Math.PI / (u || s);
  24896. i.eachNode(function(t) {
  24897. var e = t.getValue("value")
  24898. , i = h * (u ? e : 1) / 2;
  24899. l += i,
  24900. t.setLayout([o * Math.cos(l) + a, o * Math.sin(l) + r]),
  24901. l += i
  24902. })
  24903. },
  24904. symbolSize: function(t, e, i, n, o, a, r, s) {
  24905. var l = 0;
  24906. Gw.length = s;
  24907. var u = xw(t);
  24908. i.eachNode(function(t) {
  24909. var e = _w(t);
  24910. isNaN(e) && (e = 2),
  24911. e < 0 && (e = 0),
  24912. e *= u;
  24913. var i = Math.asin(e / 2 / o);
  24914. isNaN(i) && (i = Vw / 2),
  24915. Gw[t.dataIndex] = i,
  24916. l += 2 * i
  24917. });
  24918. var h = (2 * Vw - l) / s / 2
  24919. , c = 0;
  24920. i.eachNode(function(t) {
  24921. var e = h + Gw[t.dataIndex];
  24922. c += e,
  24923. t.setLayout([o * Math.cos(c) + a, o * Math.sin(c) + r]),
  24924. c += e
  24925. })
  24926. }
  24927. }
  24928. , Hw = ut;
  24929. xf(function(t) {
  24930. var a = t.findComponents({
  24931. mainType: "legend"
  24932. });
  24933. a && a.length && t.eachSeriesByType("graph", function(t) {
  24934. var e = t.getCategoriesData()
  24935. , n = t.getGraph().data
  24936. , o = e.mapArray(e.getName);
  24937. n.filterSelf(function(t) {
  24938. var e = n.getItemModel(t).getShallow("category");
  24939. if (null != e) {
  24940. "number" == typeof e && (e = o[e]);
  24941. for (var i = 0; i < a.length; i++)
  24942. if (!a[i].isSelected(e))
  24943. return !1
  24944. }
  24945. return !0
  24946. })
  24947. }, this)
  24948. }),
  24949. Sf(Lm("graph", "circle", null)),
  24950. Sf(function(t) {
  24951. var h = {};
  24952. t.eachSeriesByType("graph", function(s) {
  24953. var l = s.getCategoriesData()
  24954. , o = s.getData()
  24955. , u = {};
  24956. l.each(function(t) {
  24957. var e = l.getName(t);
  24958. u["ec-" + e] = t;
  24959. var i = l.getItemModel(t)
  24960. , n = i.get("itemStyle.color") || s.getColorFromPalette(e, h);
  24961. l.setItemVisual(t, "color", n);
  24962. for (var o = ["opacity", "symbol", "symbolSize", "symbolKeepAspect"], a = 0; a < o.length; a++) {
  24963. var r = i.getShallow(o[a], !0);
  24964. null != r && l.setItemVisual(t, o[a], r)
  24965. }
  24966. }),
  24967. l.count() && o.each(function(t) {
  24968. var e = o.getItemModel(t).getShallow("category");
  24969. if (null != e) {
  24970. "string" == typeof e && (e = u["ec-" + e]);
  24971. for (var i = ["color", "opacity", "symbol", "symbolSize", "symbolKeepAspect"], n = 0; n < i.length; n++)
  24972. null == o.getItemVisual(t, i[n], !0) && o.setItemVisual(t, i[n], l.getItemVisual(e, i[n]))
  24973. }
  24974. })
  24975. })
  24976. }),
  24977. Sf(function(t) {
  24978. t.eachSeriesByType("graph", function(t) {
  24979. var s = t.getGraph()
  24980. , l = t.getEdgeData()
  24981. , e = Rw(t.get("edgeSymbol"))
  24982. , i = Rw(t.get("edgeSymbolSize"))
  24983. , u = "lineStyle.color".split(".")
  24984. , h = "lineStyle.opacity".split(".");
  24985. l.setVisual("fromSymbol", e && e[0]),
  24986. l.setVisual("toSymbol", e && e[1]),
  24987. l.setVisual("fromSymbolSize", i && i[0]),
  24988. l.setVisual("toSymbolSize", i && i[1]),
  24989. l.setVisual("color", t.get(u)),
  24990. l.setVisual("opacity", t.get(h)),
  24991. l.each(function(t) {
  24992. var e = l.getItemModel(t)
  24993. , i = s.getEdgeByIndex(t)
  24994. , n = Rw(e.getShallow("symbol", !0))
  24995. , o = Rw(e.getShallow("symbolSize", !0))
  24996. , a = e.get(u)
  24997. , r = e.get(h);
  24998. switch (a) {
  24999. case "source":
  25000. a = i.node1.getVisual("color");
  25001. break;
  25002. case "target":
  25003. a = i.node2.getVisual("color")
  25004. }
  25005. n[0] && i.setVisual("fromSymbol", n[0]),
  25006. n[1] && i.setVisual("toSymbol", n[1]),
  25007. o[0] && i.setVisual("fromSymbolSize", o[0]),
  25008. o[1] && i.setVisual("toSymbolSize", o[1]),
  25009. i.setVisual("color", a),
  25010. i.setVisual("opacity", r)
  25011. })
  25012. })
  25013. }),
  25014. bf(function(t, e) {
  25015. t.eachSeriesByType("graph", function(t) {
  25016. var e = t.get("layout")
  25017. , i = t.coordinateSystem;
  25018. if (i && "view" !== i.type) {
  25019. var n = t.getData()
  25020. , o = [];
  25021. E(i.dimensions, function(t) {
  25022. o = o.concat(n.mapDimension(t, !0))
  25023. });
  25024. for (var a = 0; a < n.count(); a++) {
  25025. for (var r = [], s = !1, l = 0; l < o.length; l++) {
  25026. var u = n.get(o[l], a);
  25027. isNaN(u) || (s = !0),
  25028. r.push(u)
  25029. }
  25030. s ? n.setItemLayout(a, i.dataToPoint(r)) : n.setItemLayout(a, [NaN, NaN])
  25031. }
  25032. Bw(n.graph)
  25033. } else
  25034. e && "none" !== e || zw(t)
  25035. })
  25036. }),
  25037. bf(Ld.VISUAL.POST_CHART_LAYOUT, function(t) {
  25038. t.eachSeriesByType("graph", function(t) {
  25039. "circular" === t.get("layout") && Fw(t, "symbolSize")
  25040. })
  25041. }),
  25042. bf(function(t) {
  25043. t.eachSeriesByType("graph", function(t) {
  25044. if (!(l = t.coordinateSystem) || "view" === l.type)
  25045. if ("force" === t.get("layout")) {
  25046. var c = t.preservedPoints || {}
  25047. , d = t.getGraph()
  25048. , f = d.data
  25049. , e = d.edgeData
  25050. , i = t.getModel("force")
  25051. , n = i.get("initLayout");
  25052. t.preservedPoints ? f.each(function(t) {
  25053. var e = f.getId(t);
  25054. f.setItemLayout(t, c[e] || [NaN, NaN])
  25055. }) : n && "none" !== n ? "circular" === n && Fw(t, "value") : zw(t);
  25056. var o = f.getDataExtent("value")
  25057. , a = e.getDataExtent("value")
  25058. , r = i.get("repulsion")
  25059. , s = i.get("edgeLength");
  25060. L(r) || (r = [r, r]),
  25061. L(s) || (s = [s, s]),
  25062. s = [s[1], s[0]];
  25063. var l, u = f.mapArray("value", function(t, e) {
  25064. var i = f.getItemLayout(e)
  25065. , n = El(t, o, r);
  25066. return isNaN(n) && (n = (r[0] + r[1]) / 2),
  25067. {
  25068. w: n,
  25069. rep: n,
  25070. fixed: f.getItemModel(e).get("fixed"),
  25071. p: !i || isNaN(i[0]) || isNaN(i[1]) ? null : i
  25072. }
  25073. }), h = e.mapArray("value", function(t, e) {
  25074. var i = d.getEdgeByIndex(e)
  25075. , n = El(t, a, s);
  25076. isNaN(n) && (n = (s[0] + s[1]) / 2);
  25077. var o = i.getModel();
  25078. return {
  25079. n1: u[i.node1.dataIndex],
  25080. n2: u[i.node2.dataIndex],
  25081. d: n,
  25082. curveness: o.get("lineStyle.curveness") || 0,
  25083. ignoreForceLayout: o.get("ignoreForceLayout")
  25084. }
  25085. }), p = (l = t.coordinateSystem).getBoundingRect(), g = function(f, p, t) {
  25086. for (var e = t.rect, i = e.width, n = e.height, g = [e.x + i / 2, e.y + n / 2], m = null == t.gravity ? .1 : t.gravity, o = 0; o < f.length; o++) {
  25087. var a = f[o];
  25088. a.p || (a.p = ot(i * (Math.random() - .5) + g[0], n * (Math.random() - .5) + g[1])),
  25089. a.pp = rt(a.p),
  25090. a.edges = null
  25091. }
  25092. var r = null == t.friction ? .6 : t.friction
  25093. , v = r;
  25094. return {
  25095. warmUp: function() {
  25096. v = .8 * r
  25097. },
  25098. setFixed: function(t) {
  25099. f[t].fixed = !0
  25100. },
  25101. setUnfixed: function(t) {
  25102. f[t].fixed = !1
  25103. },
  25104. step: function(t) {
  25105. for (var e = [], i = f.length, n = 0; n < p.length; n++) {
  25106. var o = p[n];
  25107. if (!o.ignoreForceLayout) {
  25108. var a = o.n1;
  25109. ht(e, (u = o.n2).p, a.p);
  25110. var r = ct(e) - o.d
  25111. , s = u.w / (a.w + u.w);
  25112. isNaN(s) && (s = 0),
  25113. mt(e, e),
  25114. a.fixed || Hw(a.p, a.p, e, s * r * v),
  25115. u.fixed || Hw(u.p, u.p, e, -(1 - s) * r * v)
  25116. }
  25117. }
  25118. for (n = 0; n < i; n++) {
  25119. (d = f[n]).fixed || (ht(e, g, d.p),
  25120. Hw(d.p, d.p, e, m * v))
  25121. }
  25122. for (n = 0; n < i; n++) {
  25123. a = f[n];
  25124. for (var l = n + 1; l < i; l++) {
  25125. var u;
  25126. ht(e, (u = f[l]).p, a.p),
  25127. 0 === (r = ct(e)) && (st(e, Math.random() - .5, Math.random() - .5),
  25128. r = 1);
  25129. var h = (a.rep + u.rep) / r / r;
  25130. a.fixed || Hw(a.pp, a.pp, e, h),
  25131. u.fixed || Hw(u.pp, u.pp, e, -h)
  25132. }
  25133. }
  25134. var c = [];
  25135. for (n = 0; n < i; n++) {
  25136. var d;
  25137. (d = f[n]).fixed || (ht(c, d.p, d.pp),
  25138. Hw(d.p, d.p, c, v),
  25139. at(d.pp, d.p))
  25140. }
  25141. v *= .992,
  25142. t && t(f, p, v < .01)
  25143. }
  25144. }
  25145. }(u, h, {
  25146. rect: p,
  25147. gravity: i.get("gravity"),
  25148. friction: i.get("friction")
  25149. }), m = g.step;
  25150. g.step = function(h) {
  25151. for (var t = 0, e = u.length; t < e; t++)
  25152. u[t].fixed && at(u[t].p, d.getNodeByIndex(t).getLayout());
  25153. m(function(t, e, i) {
  25154. for (var n = 0, o = t.length; n < o; n++)
  25155. t[n].fixed || d.getNodeByIndex(n).setLayout(t[n].p),
  25156. c[f.getId(n)] = t[n].p;
  25157. for (n = 0,
  25158. o = e.length; n < o; n++) {
  25159. var a = e[n]
  25160. , r = d.getEdgeByIndex(n)
  25161. , s = a.n1.p
  25162. , l = a.n2.p
  25163. , u = r.getLayout();
  25164. (u = u ? u.slice() : [])[0] = u[0] || [],
  25165. u[1] = u[1] || [],
  25166. at(u[0], s),
  25167. at(u[1], l),
  25168. +a.curveness && (u[2] = [(s[0] + l[0]) / 2 - (s[1] - l[1]) * a.curveness, (s[1] + l[1]) / 2 - (l[0] - s[0]) * a.curveness]),
  25169. r.setLayout(u)
  25170. }
  25171. h && h(i)
  25172. })
  25173. }
  25174. ,
  25175. t.forceLayout = g,
  25176. t.preservedPoints = c,
  25177. g.step()
  25178. } else
  25179. t.forceLayout = null
  25180. })
  25181. }),
  25182. wf("graphView", {
  25183. create: function(t, d) {
  25184. var f = [];
  25185. return t.eachSeriesByType("graph", function(t) {
  25186. var e = t.get("coordinateSystem");
  25187. if (!e || "view" === e) {
  25188. var i = t.getData()
  25189. , n = []
  25190. , o = [];
  25191. Wa(i.mapArray(function(t) {
  25192. var e = i.getItemModel(t);
  25193. return [+e.get("x"), +e.get("y")]
  25194. }), n, o),
  25195. o[0] - n[0] == 0 && (o[0] += 1,
  25196. n[0] -= 1),
  25197. o[1] - n[1] == 0 && (o[1] += 1,
  25198. n[1] -= 1);
  25199. var a = (o[0] - n[0]) / (o[1] - n[1])
  25200. , r = function(t, e, i) {
  25201. var n = t.getBoxLayoutParams();
  25202. return n.aspect = i,
  25203. bu(n, {
  25204. width: e.getWidth(),
  25205. height: e.getHeight()
  25206. })
  25207. }(t, d, a);
  25208. isNaN(a) && (n = [r.x, r.y],
  25209. o = [r.x + r.width, r.y + r.height]);
  25210. var s = o[0] - n[0]
  25211. , l = o[1] - n[1]
  25212. , u = r.width
  25213. , h = r.height
  25214. , c = t.coordinateSystem = new lx;
  25215. c.zoomLimit = t.get("scaleLimit"),
  25216. c.setBoundingRect(n[0], n[1], s, l),
  25217. c.setViewRect(r.x, r.y, u, h),
  25218. c.setCenter(t.get("center")),
  25219. c.setZoom(t.get("zoom")),
  25220. f.push(c)
  25221. }
  25222. }),
  25223. f
  25224. }
  25225. });
  25226. sc.extend({
  25227. type: "series.gauge",
  25228. getInitialData: function(t, e) {
  25229. return Yv(this, ["value"])
  25230. },
  25231. defaultOption: {
  25232. zlevel: 0,
  25233. z: 2,
  25234. center: ["50%", "50%"],
  25235. legendHoverLink: !0,
  25236. radius: "75%",
  25237. startAngle: 225,
  25238. endAngle: -45,
  25239. clockwise: !0,
  25240. min: 0,
  25241. max: 100,
  25242. splitNumber: 10,
  25243. axisLine: {
  25244. show: !0,
  25245. lineStyle: {
  25246. color: [[.2, "#91c7ae"], [.8, "#63869e"], [1, "#c23531"]],
  25247. width: 30
  25248. }
  25249. },
  25250. splitLine: {
  25251. show: !0,
  25252. length: 30,
  25253. lineStyle: {
  25254. color: "#eee",
  25255. width: 2,
  25256. type: "solid"
  25257. }
  25258. },
  25259. axisTick: {
  25260. show: !0,
  25261. splitNumber: 5,
  25262. length: 8,
  25263. lineStyle: {
  25264. color: "#eee",
  25265. width: 1,
  25266. type: "solid"
  25267. }
  25268. },
  25269. axisLabel: {
  25270. show: !0,
  25271. distance: 5,
  25272. color: "auto"
  25273. },
  25274. pointer: {
  25275. show: !0,
  25276. length: "80%",
  25277. width: 8
  25278. },
  25279. itemStyle: {
  25280. color: "auto"
  25281. },
  25282. title: {
  25283. show: !0,
  25284. offsetCenter: [0, "-40%"],
  25285. color: "#333",
  25286. fontSize: 15
  25287. },
  25288. detail: {
  25289. show: !0,
  25290. backgroundColor: "rgba(0,0,0,0)",
  25291. borderWidth: 0,
  25292. borderColor: "#ccc",
  25293. width: 100,
  25294. height: null,
  25295. padding: [5, 10],
  25296. offsetCenter: [0, "40%"],
  25297. color: "auto",
  25298. fontSize: 30
  25299. }
  25300. }
  25301. });
  25302. var Zw = Ar.extend({
  25303. type: "echartsGaugePointer",
  25304. shape: {
  25305. angle: 0,
  25306. width: 10,
  25307. r: 10,
  25308. x: 0,
  25309. y: 0
  25310. },
  25311. buildPath: function(t, e) {
  25312. var i = Math.cos
  25313. , n = Math.sin
  25314. , o = e.r
  25315. , a = e.width
  25316. , r = e.angle
  25317. , s = e.x - i(r) * a * (o / 3 <= a ? 1 : 2)
  25318. , l = e.y - n(r) * a * (o / 3 <= a ? 1 : 2);
  25319. r = e.angle - Math.PI / 2,
  25320. t.moveTo(s, l),
  25321. t.lineTo(e.x + i(r) * a, e.y + n(r) * a),
  25322. t.lineTo(e.x + i(e.angle) * o, e.y + n(e.angle) * o),
  25323. t.lineTo(e.x - i(r) * a, e.y - n(r) * a),
  25324. t.lineTo(s, l)
  25325. }
  25326. });
  25327. function Uw(t, e) {
  25328. return e && ("string" == typeof e ? t = e.replace("{value}", null != t ? t : "") : "function" == typeof e && (t = e(t))),
  25329. t
  25330. }
  25331. var Xw = 2 * Math.PI
  25332. , Yw = (_c.extend({
  25333. type: "gauge",
  25334. render: function(t, e, i) {
  25335. this.group.removeAll();
  25336. var n = t.get("axisLine.lineStyle.color")
  25337. , o = function(t, e) {
  25338. var i = t.get("center")
  25339. , n = e.getWidth()
  25340. , o = e.getHeight()
  25341. , a = Math.min(n, o);
  25342. return {
  25343. cx: Rl(i[0], e.getWidth()),
  25344. cy: Rl(i[1], e.getHeight()),
  25345. r: Rl(t.get("radius"), a / 2)
  25346. }
  25347. }(t, i);
  25348. this._renderMain(t, e, i, n, o)
  25349. },
  25350. dispose: function() {},
  25351. _renderMain: function(t, e, i, n, o) {
  25352. for (var a = this.group, r = t.getModel("axisLine"), s = r.getModel("lineStyle"), l = t.get("clockwise"), u = -t.get("startAngle") / 180 * Math.PI, h = ((g = -t.get("endAngle") / 180 * Math.PI) - u) % Xw, c = u, d = s.get("width"), f = r.get("show"), p = 0; f && p < n.length; p++) {
  25353. var g, m = Math.min(Math.max(n[p][0], 0), 1), v = new qr({
  25354. shape: {
  25355. startAngle: c,
  25356. endAngle: g = u + h * m,
  25357. cx: o.cx,
  25358. cy: o.cy,
  25359. clockwise: l,
  25360. r0: o.r - d,
  25361. r: o.r
  25362. },
  25363. silent: !0
  25364. });
  25365. v.setStyle({
  25366. fill: n[p][1]
  25367. }),
  25368. v.setStyle(s.getLineStyle(["color", "borderWidth", "borderColor"])),
  25369. a.add(v),
  25370. c = g
  25371. }
  25372. function y(t) {
  25373. if (t <= 0)
  25374. return n[0][1];
  25375. for (var e = 0; e < n.length; e++)
  25376. if (n[e][0] >= t && (0 === e ? 0 : n[e - 1][0]) < t)
  25377. return n[e][1];
  25378. return n[e - 1][1]
  25379. }
  25380. if (!l) {
  25381. var x = u;
  25382. u = g,
  25383. g = x
  25384. }
  25385. this._renderTicks(t, e, i, y, o, u, g, l),
  25386. this._renderPointer(t, e, i, y, o, u, g, l),
  25387. this._renderTitle(t, e, i, y, o),
  25388. this._renderDetail(t, e, i, y, o)
  25389. },
  25390. _renderTicks: function(t, e, i, n, o, a, r, s) {
  25391. for (var l = this.group, u = o.cx, h = o.cy, c = o.r, d = +t.get("min"), f = +t.get("max"), p = t.getModel("splitLine"), g = t.getModel("axisTick"), m = t.getModel("axisLabel"), v = t.get("splitNumber"), y = g.get("splitNumber"), x = Rl(p.get("length"), c), _ = Rl(g.get("length"), c), w = a, b = (r - a) / v, S = b / y, M = p.getModel("lineStyle").getLineStyle(), I = g.getModel("lineStyle").getLineStyle(), T = 0; T <= v; T++) {
  25392. var A = Math.cos(w)
  25393. , D = Math.sin(w);
  25394. if (p.get("show")) {
  25395. var C = new ls({
  25396. shape: {
  25397. x1: A * c + u,
  25398. y1: D * c + h,
  25399. x2: A * (c - x) + u,
  25400. y2: D * (c - x) + h
  25401. },
  25402. style: M,
  25403. silent: !0
  25404. });
  25405. "auto" === M.stroke && C.setStyle({
  25406. stroke: n(T / v)
  25407. }),
  25408. l.add(C)
  25409. }
  25410. if (m.get("show")) {
  25411. var L = Uw(zl(T / v * (f - d) + d), m.get("formatter"))
  25412. , k = m.get("distance")
  25413. , P = n(T / v);
  25414. l.add(new Ur({
  25415. style: nl({}, m, {
  25416. text: L,
  25417. x: A * (c - x - k) + u,
  25418. y: D * (c - x - k) + h,
  25419. textVerticalAlign: D < -.4 ? "top" : .4 < D ? "bottom" : "middle",
  25420. textAlign: A < -.4 ? "left" : .4 < A ? "right" : "center"
  25421. }, {
  25422. autoColor: P
  25423. }),
  25424. silent: !0
  25425. }))
  25426. }
  25427. if (g.get("show") && T !== v) {
  25428. for (var N = 0; N <= y; N++) {
  25429. A = Math.cos(w),
  25430. D = Math.sin(w);
  25431. var O = new ls({
  25432. shape: {
  25433. x1: A * c + u,
  25434. y1: D * c + h,
  25435. x2: A * (c - _) + u,
  25436. y2: D * (c - _) + h
  25437. },
  25438. silent: !0,
  25439. style: I
  25440. });
  25441. "auto" === I.stroke && O.setStyle({
  25442. stroke: n((T + N / y) / v)
  25443. }),
  25444. l.add(O),
  25445. w += S
  25446. }
  25447. w -= S
  25448. } else
  25449. w += b
  25450. }
  25451. },
  25452. _renderPointer: function(n, t, e, o, a, i, r, s) {
  25453. var l = this.group
  25454. , u = this._data;
  25455. if (n.get("pointer.show")) {
  25456. var h = [+n.get("min"), +n.get("max")]
  25457. , c = [i, r]
  25458. , d = n.getData()
  25459. , f = d.mapDimension("value");
  25460. d.diff(u).add(function(t) {
  25461. var e = new Zw({
  25462. shape: {
  25463. angle: i
  25464. }
  25465. });
  25466. dl(e, {
  25467. shape: {
  25468. angle: El(d.get(f, t), h, c, !0)
  25469. }
  25470. }, n),
  25471. l.add(e),
  25472. d.setItemGraphicEl(t, e)
  25473. }).update(function(t, e) {
  25474. var i = u.getItemGraphicEl(e);
  25475. cl(i, {
  25476. shape: {
  25477. angle: El(d.get(f, t), h, c, !0)
  25478. }
  25479. }, n),
  25480. l.add(i),
  25481. d.setItemGraphicEl(t, i)
  25482. }).remove(function(t) {
  25483. var e = u.getItemGraphicEl(t);
  25484. l.remove(e)
  25485. }).execute(),
  25486. d.eachItemGraphicEl(function(t, e) {
  25487. var i = d.getItemModel(e)
  25488. , n = i.getModel("pointer");
  25489. t.setShape({
  25490. x: a.cx,
  25491. y: a.cy,
  25492. width: Rl(n.get("width"), a.r),
  25493. r: Rl(n.get("length"), a.r)
  25494. }),
  25495. t.useStyle(i.getModel("itemStyle").getItemStyle()),
  25496. "auto" === t.style.fill && t.setStyle("fill", o(El(d.get(f, e), h, [0, 1], !0))),
  25497. $s(t, i.getModel("emphasis.itemStyle").getItemStyle())
  25498. }),
  25499. this._data = d
  25500. } else
  25501. u && u.eachItemGraphicEl(function(t) {
  25502. l.remove(t)
  25503. })
  25504. },
  25505. _renderTitle: function(t, e, i, n, o) {
  25506. var a = t.getData()
  25507. , r = a.mapDimension("value")
  25508. , s = t.getModel("title");
  25509. if (s.get("show")) {
  25510. var l = s.get("offsetCenter")
  25511. , u = o.cx + Rl(l[0], o.r)
  25512. , h = o.cy + Rl(l[1], o.r)
  25513. , c = +t.get("min")
  25514. , d = +t.get("max")
  25515. , f = n(El(t.getData().get(r, 0), [c, d], [0, 1], !0));
  25516. this.group.add(new Ur({
  25517. silent: !0,
  25518. style: nl({}, s, {
  25519. x: u,
  25520. y: h,
  25521. text: a.getName(0),
  25522. textAlign: "center",
  25523. textVerticalAlign: "middle"
  25524. }, {
  25525. autoColor: f,
  25526. forceRich: !0
  25527. })
  25528. }))
  25529. }
  25530. },
  25531. _renderDetail: function(t, e, i, n, o) {
  25532. var a = t.getModel("detail")
  25533. , r = +t.get("min")
  25534. , s = +t.get("max");
  25535. if (a.get("show")) {
  25536. var l = a.get("offsetCenter")
  25537. , u = o.cx + Rl(l[0], o.r)
  25538. , h = o.cy + Rl(l[1], o.r)
  25539. , c = Rl(a.get("width"), o.r)
  25540. , d = Rl(a.get("height"), o.r)
  25541. , f = t.getData()
  25542. , p = f.get(f.mapDimension("value"), 0)
  25543. , g = n(El(p, [r, s], [0, 1], !0));
  25544. this.group.add(new Ur({
  25545. silent: !0,
  25546. style: nl({}, a, {
  25547. x: u,
  25548. y: h,
  25549. text: Uw(p, a.get("formatter")),
  25550. textWidth: isNaN(c) ? null : c,
  25551. textHeight: isNaN(d) ? null : d,
  25552. textAlign: "center",
  25553. textVerticalAlign: "middle"
  25554. }, {
  25555. autoColor: g,
  25556. forceRich: !0
  25557. })
  25558. }))
  25559. }
  25560. }
  25561. }),
  25562. Df({
  25563. type: "series.funnel",
  25564. init: function(t) {
  25565. Yw.superApply(this, "init", arguments),
  25566. this.legendVisualProvider = new qv(A(this.getData, this),A(this.getRawData, this)),
  25567. this._defaultLabelLine(t)
  25568. },
  25569. getInitialData: function(t, e) {
  25570. return Yv(this, {
  25571. coordDimensions: ["value"],
  25572. encodeDefaulter: T(Ju, this)
  25573. })
  25574. },
  25575. _defaultLabelLine: function(t) {
  25576. Go(t, "labelLine", ["show"]);
  25577. var e = t.labelLine
  25578. , i = t.emphasis.labelLine;
  25579. e.show = e.show && t.label.show,
  25580. i.show = i.show && t.emphasis.label.show
  25581. },
  25582. getDataParams: function(t) {
  25583. var e = this.getData()
  25584. , i = Yw.superCall(this, "getDataParams", t)
  25585. , n = e.mapDimension("value")
  25586. , o = e.getSum(n);
  25587. return i.percent = o ? +(e.get(n, t) / o * 100).toFixed(2) : 0,
  25588. i.$vars.push("percent"),
  25589. i
  25590. },
  25591. defaultOption: {
  25592. zlevel: 0,
  25593. z: 2,
  25594. legendHoverLink: !0,
  25595. left: 80,
  25596. top: 60,
  25597. right: 80,
  25598. bottom: 60,
  25599. minSize: "0%",
  25600. maxSize: "100%",
  25601. sort: "descending",
  25602. gap: 0,
  25603. funnelAlign: "center",
  25604. label: {
  25605. show: !0,
  25606. position: "outer"
  25607. },
  25608. labelLine: {
  25609. show: !0,
  25610. length: 20,
  25611. lineStyle: {
  25612. width: 1,
  25613. type: "solid"
  25614. }
  25615. },
  25616. itemStyle: {
  25617. borderColor: "#fff",
  25618. borderWidth: 1
  25619. },
  25620. emphasis: {
  25621. label: {
  25622. show: !0
  25623. }
  25624. }
  25625. }
  25626. }));
  25627. function jw(t, e) {
  25628. Ci.call(this);
  25629. var i = new Qr
  25630. , n = new ts
  25631. , o = new Ur;
  25632. this.add(i),
  25633. this.add(n),
  25634. this.add(o),
  25635. this.highDownOnUpdate = function(t, e) {
  25636. "emphasis" === e ? (n.ignore = n.hoverIgnore,
  25637. o.ignore = o.hoverIgnore) : (n.ignore = n.normalIgnore,
  25638. o.ignore = o.normalIgnore)
  25639. }
  25640. ,
  25641. this.updateData(t, e, !0)
  25642. }
  25643. var qw = jw.prototype
  25644. , Kw = ["itemStyle", "opacity"];
  25645. qw.updateData = function(t, e, i) {
  25646. var n = this.childAt(0)
  25647. , o = t.hostModel
  25648. , a = t.getItemModel(e)
  25649. , r = t.getItemLayout(e)
  25650. , s = t.getItemModel(e).get(Kw);
  25651. s = null == s ? 1 : s,
  25652. n.useStyle({}),
  25653. i ? (n.setShape({
  25654. points: r.points
  25655. }),
  25656. n.setStyle({
  25657. opacity: 0
  25658. }),
  25659. dl(n, {
  25660. style: {
  25661. opacity: s
  25662. }
  25663. }, o, e)) : cl(n, {
  25664. style: {
  25665. opacity: s
  25666. },
  25667. shape: {
  25668. points: r.points
  25669. }
  25670. }, o, e);
  25671. var l = a.getModel("itemStyle")
  25672. , u = t.getItemVisual(e, "color");
  25673. n.setStyle(D({
  25674. lineJoin: "round",
  25675. fill: u
  25676. }, l.getItemStyle(["opacity"]))),
  25677. n.hoverStyle = l.getModel("emphasis").getItemStyle(),
  25678. this._updateLabel(t, e),
  25679. $s(this)
  25680. }
  25681. ,
  25682. qw._updateLabel = function(t, e) {
  25683. var i = this.childAt(1)
  25684. , n = this.childAt(2)
  25685. , o = t.hostModel
  25686. , a = t.getItemModel(e)
  25687. , r = t.getItemLayout(e).label
  25688. , s = t.getItemVisual(e, "color");
  25689. cl(i, {
  25690. shape: {
  25691. points: r.linePoints || r.linePoints
  25692. }
  25693. }, o, e),
  25694. cl(n, {
  25695. style: {
  25696. x: r.x,
  25697. y: r.y
  25698. }
  25699. }, o, e),
  25700. n.attr({
  25701. rotation: r.rotation,
  25702. origin: [r.x, r.y],
  25703. z2: 10
  25704. });
  25705. var l = a.getModel("label")
  25706. , u = a.getModel("emphasis.label")
  25707. , h = a.getModel("labelLine")
  25708. , c = a.getModel("emphasis.labelLine");
  25709. s = t.getItemVisual(e, "color");
  25710. el(n.style, n.hoverStyle = {}, l, u, {
  25711. labelFetcher: t.hostModel,
  25712. labelDataIndex: e,
  25713. defaultText: t.getName(e),
  25714. autoColor: s,
  25715. useInsideStyle: !!r.inside
  25716. }, {
  25717. textAlign: r.textAlign,
  25718. textVerticalAlign: r.verticalAlign
  25719. }),
  25720. n.ignore = n.normalIgnore = !l.get("show"),
  25721. n.hoverIgnore = !u.get("show"),
  25722. i.ignore = i.normalIgnore = !h.get("show"),
  25723. i.hoverIgnore = !c.get("show"),
  25724. i.setStyle({
  25725. stroke: s
  25726. }),
  25727. i.setStyle(h.getModel("lineStyle").getLineStyle()),
  25728. i.hoverStyle = c.getModel("lineStyle").getLineStyle()
  25729. }
  25730. ,
  25731. w(jw, Ci);
  25732. _c.extend({
  25733. type: "funnel",
  25734. render: function(t, e, i) {
  25735. var n = t.getData()
  25736. , o = this._data
  25737. , a = this.group;
  25738. n.diff(o).add(function(t) {
  25739. var e = new jw(n,t);
  25740. n.setItemGraphicEl(t, e),
  25741. a.add(e)
  25742. }).update(function(t, e) {
  25743. var i = o.getItemGraphicEl(e);
  25744. i.updateData(n, t),
  25745. a.add(i),
  25746. n.setItemGraphicEl(t, i)
  25747. }).remove(function(t) {
  25748. var e = o.getItemGraphicEl(t);
  25749. a.remove(e)
  25750. }).execute(),
  25751. this._data = n
  25752. },
  25753. remove: function() {
  25754. this.group.removeAll(),
  25755. this._data = null
  25756. },
  25757. dispose: function() {}
  25758. });
  25759. Sf(iy("funnel")),
  25760. bf(function(t, w, e) {
  25761. t.eachSeriesByType("funnel", function(t) {
  25762. var o = t.getData()
  25763. , a = o.mapDimension("value")
  25764. , e = t.get("sort")
  25765. , r = function(t, e) {
  25766. return bu(t.getBoxLayoutParams(), {
  25767. width: e.getWidth(),
  25768. height: e.getHeight()
  25769. })
  25770. }(t, w)
  25771. , i = function(t, e) {
  25772. for (var i = t.mapDimension("value"), n = t.mapArray(i, function(t) {
  25773. return t
  25774. }), o = [], a = "ascending" === e, r = 0, s = t.count(); r < s; r++)
  25775. o[r] = r;
  25776. return "function" == typeof e ? o.sort(e) : "none" !== e && o.sort(function(t, e) {
  25777. return a ? n[t] - n[e] : n[e] - n[t]
  25778. }),
  25779. o
  25780. }(o, e)
  25781. , s = [Rl(t.get("minSize"), r.width), Rl(t.get("maxSize"), r.width)]
  25782. , n = o.getDataExtent(a)
  25783. , l = t.get("min")
  25784. , u = t.get("max");
  25785. null == l && (l = Math.min(n[0], 0)),
  25786. null == u && (u = n[1]);
  25787. function h(t, e) {
  25788. var i, n = El(o.get(a, t) || 0, [l, u], s, !0);
  25789. switch (c) {
  25790. case "left":
  25791. i = r.x;
  25792. break;
  25793. case "center":
  25794. i = r.x + (r.width - n) / 2;
  25795. break;
  25796. case "right":
  25797. i = r.x + r.width - n
  25798. }
  25799. return [[i, e], [i + n, e]]
  25800. }
  25801. var c = t.get("funnelAlign")
  25802. , d = t.get("gap")
  25803. , f = (r.height - d * (o.count() - 1)) / o.count()
  25804. , p = r.y;
  25805. "ascending" === e && (f = -f,
  25806. d = -d,
  25807. p += r.height,
  25808. i = i.reverse());
  25809. for (var g = 0; g < i.length; g++) {
  25810. var m = i[g]
  25811. , v = i[g + 1]
  25812. , y = o.getItemModel(m).get("itemStyle.height");
  25813. null == y ? y = f : (y = Rl(y, r.height),
  25814. "ascending" === e && (y = -y));
  25815. var x = h(m, p)
  25816. , _ = h(v, p + y);
  25817. p += y + d,
  25818. o.setItemLayout(m, {
  25819. points: x.concat(_.slice().reverse())
  25820. })
  25821. }
  25822. !function(g) {
  25823. g.each(function(t) {
  25824. var e, i, n, o, a = g.getItemModel(t), r = a.getModel("label").get("position"), s = a.getModel("labelLine"), l = g.getItemLayout(t), u = l.points, h = "inner" === r || "inside" === r || "center" === r || "insideLeft" === r || "insideRight" === r;
  25825. if (h)
  25826. e = "insideLeft" === r ? (i = (u[0][0] + u[3][0]) / 2 + 5,
  25827. n = (u[0][1] + u[3][1]) / 2,
  25828. "left") : "insideRight" === r ? (i = (u[1][0] + u[2][0]) / 2 - 5,
  25829. n = (u[1][1] + u[2][1]) / 2,
  25830. "right") : (i = (u[0][0] + u[1][0] + u[2][0] + u[3][0]) / 4,
  25831. n = (u[0][1] + u[1][1] + u[2][1] + u[3][1]) / 4,
  25832. "center"),
  25833. o = [[i, n], [i, n]];
  25834. else {
  25835. var c, d, f, p = s.get("length");
  25836. e = "left" === r ? (c = (u[3][0] + u[0][0]) / 2,
  25837. d = (u[3][1] + u[0][1]) / 2,
  25838. i = (f = c - p) - 5,
  25839. "right") : "right" === r ? (c = (u[1][0] + u[2][0]) / 2,
  25840. d = (u[1][1] + u[2][1]) / 2,
  25841. i = (f = c + p) + 5,
  25842. "left") : "rightTop" === r ? (c = u[1][0],
  25843. d = u[1][1],
  25844. i = (f = c + p) + 5,
  25845. "top") : "rightBottom" === r ? (c = u[2][0],
  25846. d = u[2][1],
  25847. i = (f = c + p) + 5,
  25848. "bottom") : "leftTop" === r ? (c = u[0][0],
  25849. d = u[1][1],
  25850. i = (f = c - p) - 5,
  25851. "right") : "leftBottom" === r ? (c = u[3][0],
  25852. d = u[2][1],
  25853. i = (f = c - p) - 5,
  25854. "right") : (c = (u[1][0] + u[2][0]) / 2,
  25855. d = (u[1][1] + u[2][1]) / 2,
  25856. i = (f = c + p) + 5,
  25857. "left");
  25858. o = [[c, d], [f, d]],
  25859. n = d
  25860. }
  25861. l.label = {
  25862. linePoints: o,
  25863. x: i,
  25864. y: n,
  25865. verticalAlign: "middle",
  25866. textAlign: e,
  25867. inside: h
  25868. }
  25869. })
  25870. }(o)
  25871. })
  25872. }),
  25873. xf(uy("funnel"));
  25874. function $w(t, e, i, n, o) {
  25875. Gg.call(this, t, e, i),
  25876. this.type = n || "value",
  25877. this.axisIndex = o
  25878. }
  25879. $w.prototype = {
  25880. constructor: $w,
  25881. model: null,
  25882. isHorizontal: function() {
  25883. return "horizontal" !== this.coordinateSystem.getModel().get("layout")
  25884. }
  25885. },
  25886. w($w, Gg);
  25887. function Jw(t, e, i, n, o, a) {
  25888. t = t || 0;
  25889. var r = i[1] - i[0];
  25890. if (null != o && (o = tb(o, [0, r])),
  25891. null != a && (a = Math.max(a, null != o ? o : 0)),
  25892. "all" === n) {
  25893. var s = Math.abs(e[1] - e[0]);
  25894. o = a = tb(s = tb(s, [0, r]), [o, a]),
  25895. n = 0
  25896. }
  25897. e[0] = tb(e[0], i),
  25898. e[1] = tb(e[1], i);
  25899. var l = Qw(e, n);
  25900. e[n] += t;
  25901. var u = o || 0
  25902. , h = i.slice();
  25903. l.sign < 0 ? h[0] += u : h[1] -= u,
  25904. e[n] = tb(e[n], h);
  25905. var c = Qw(e, n);
  25906. return null != o && (c.sign !== l.sign || c.span < o) && (e[1 - n] = e[n] + l.sign * o),
  25907. c = Qw(e, n),
  25908. null != a && c.span > a && (e[1 - n] = e[n] + c.sign * a),
  25909. e
  25910. }
  25911. function Qw(t, e) {
  25912. var i = t[e] - t[1 - e];
  25913. return {
  25914. span: Math.abs(i),
  25915. sign: 0 < i ? -1 : i < 0 ? 1 : e ? -1 : 1
  25916. }
  25917. }
  25918. function tb(t, e) {
  25919. return Math.min(null != e[1] ? e[1] : 1 / 0, Math.max(null != e[0] ? e[0] : -1 / 0, t))
  25920. }
  25921. var eb = E
  25922. , ib = Math.min
  25923. , nb = Math.max
  25924. , ob = Math.floor
  25925. , ab = Math.ceil
  25926. , rb = zl
  25927. , sb = Math.PI;
  25928. function lb(t, e, i) {
  25929. this._axesMap = Q(),
  25930. this._axesLayout = {},
  25931. this.dimensions = t.dimensions,
  25932. this._rect,
  25933. this._model = t,
  25934. this._init(t, e, i)
  25935. }
  25936. function ub(t, e) {
  25937. return ib(nb(t, e[0]), e[1])
  25938. }
  25939. lb.prototype = {
  25940. type: "parallel",
  25941. constructor: lb,
  25942. _init: function(t, r, e) {
  25943. var i = t.dimensions
  25944. , s = t.parallelAxisIndex;
  25945. eb(i, function(t, e) {
  25946. var i = s[e]
  25947. , n = r.getComponent("parallelAxis", i)
  25948. , o = this._axesMap.set(t, new $w(t,sg(n),[0, 0],n.get("type"),i))
  25949. , a = "category" === o.type;
  25950. o.onBand = a && n.get("boundaryGap"),
  25951. o.inverse = n.get("inverse"),
  25952. (n.axis = o).model = n,
  25953. o.coordinateSystem = n.coordinateSystem = this
  25954. }, this)
  25955. },
  25956. update: function(t, e) {
  25957. this._updateAxesFromSeries(this._model, t)
  25958. },
  25959. containPoint: function(t) {
  25960. var e = this._makeLayoutInfo()
  25961. , i = e.axisBase
  25962. , n = e.layoutBase
  25963. , o = e.pixelDimIndex
  25964. , a = t[1 - o]
  25965. , r = t[o];
  25966. return i <= a && a <= i + e.axisLength && n <= r && r <= n + e.layoutLength
  25967. },
  25968. getModel: function() {
  25969. return this._model
  25970. },
  25971. _updateAxesFromSeries: function(e, n) {
  25972. n.eachSeries(function(t) {
  25973. if (e.contains(t, n)) {
  25974. var i = t.getData();
  25975. eb(this.dimensions, function(t) {
  25976. var e = this._axesMap.get(t);
  25977. e.scale.unionExtentFromData(i, i.mapDimension(t)),
  25978. rg(e.scale, e.model)
  25979. }, this)
  25980. }
  25981. }, this)
  25982. },
  25983. resize: function(t, e) {
  25984. this._rect = bu(t.getBoxLayoutParams(), {
  25985. width: e.getWidth(),
  25986. height: e.getHeight()
  25987. }),
  25988. this._layoutAxes()
  25989. },
  25990. getRect: function() {
  25991. return this._rect
  25992. },
  25993. _makeLayoutInfo: function() {
  25994. var t, e = this._model, i = this._rect, n = ["x", "y"], o = ["width", "height"], a = e.get("layout"), r = "horizontal" === a ? 0 : 1, s = i[o[r]], l = [0, s], u = this.dimensions.length, h = ub(e.get("axisExpandWidth"), l), c = ub(e.get("axisExpandCount") || 0, [0, u]), d = e.get("axisExpandable") && 3 < u && c < u && 1 < c && 0 < h && 0 < s, f = e.get("axisExpandWindow");
  25995. f ? (t = ub(f[1] - f[0], l),
  25996. f[1] = f[0] + t) : (t = ub(h * (c - 1), l),
  25997. (f = [h * (e.get("axisExpandCenter") || ob(u / 2)) - t / 2])[1] = f[0] + t);
  25998. var p = (s - t) / (u - c);
  25999. p < 3 && (p = 0);
  26000. var g = [ob(rb(f[0] / h, 1)) + 1, ab(rb(f[1] / h, 1)) - 1]
  26001. , m = p / h * f[0];
  26002. return {
  26003. layout: a,
  26004. pixelDimIndex: r,
  26005. layoutBase: i[n[r]],
  26006. layoutLength: s,
  26007. axisBase: i[n[1 - r]],
  26008. axisLength: i[o[1 - r]],
  26009. axisExpandable: d,
  26010. axisExpandWidth: h,
  26011. axisCollapseWidth: p,
  26012. axisExpandWindow: f,
  26013. axisCount: u,
  26014. winInnerIndices: g,
  26015. axisExpandWindow0Pos: m
  26016. }
  26017. },
  26018. _layoutAxes: function() {
  26019. var l = this._rect
  26020. , t = this._axesMap
  26021. , e = this.dimensions
  26022. , u = this._makeLayoutInfo()
  26023. , h = u.layout;
  26024. t.each(function(t) {
  26025. var e = [0, u.axisLength]
  26026. , i = t.inverse ? 1 : 0;
  26027. t.setExtent(e[i], e[1 - i])
  26028. }),
  26029. eb(e, function(t, e) {
  26030. var i = (u.axisExpandable ? function(t, e) {
  26031. var i, n, o = e.layoutLength, a = e.axisExpandWidth, r = e.axisCount, s = e.axisCollapseWidth, l = e.winInnerIndices, u = s, h = !1;
  26032. t < l[0] ? (i = t * s,
  26033. n = s) : t <= l[1] ? (i = e.axisExpandWindow0Pos + t * a - e.axisExpandWindow[0],
  26034. u = a,
  26035. h = !0) : (i = o - (r - 1 - t) * s,
  26036. n = s);
  26037. return {
  26038. position: i,
  26039. axisNameAvailableWidth: u,
  26040. axisLabelShow: h,
  26041. nameTruncateMaxWidth: n
  26042. }
  26043. }
  26044. : function(t, e) {
  26045. var i = e.layoutLength / (e.axisCount - 1);
  26046. return {
  26047. position: i * t,
  26048. axisNameAvailableWidth: i,
  26049. axisLabelShow: !0
  26050. }
  26051. }
  26052. )(e, u)
  26053. , n = {
  26054. horizontal: {
  26055. x: i.position,
  26056. y: u.axisLength
  26057. },
  26058. vertical: {
  26059. x: 0,
  26060. y: i.position
  26061. }
  26062. }
  26063. , o = {
  26064. horizontal: sb / 2,
  26065. vertical: 0
  26066. }
  26067. , a = [n[h].x + l.x, n[h].y + l.y]
  26068. , r = o[h]
  26069. , s = ae();
  26070. he(s, s, r),
  26071. ue(s, s, a),
  26072. this._axesLayout[t] = {
  26073. position: a,
  26074. rotation: r,
  26075. transform: s,
  26076. axisNameAvailableWidth: i.axisNameAvailableWidth,
  26077. axisLabelShow: i.axisLabelShow,
  26078. nameTruncateMaxWidth: i.nameTruncateMaxWidth,
  26079. tickDirection: 1,
  26080. labelDirection: 1
  26081. }
  26082. }, this)
  26083. },
  26084. getAxis: function(t) {
  26085. return this._axesMap.get(t)
  26086. },
  26087. dataToPoint: function(t, e) {
  26088. return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t), e)
  26089. },
  26090. eachActiveState: function(e, t, i, n) {
  26091. null == i && (i = 0),
  26092. null == n && (n = e.count());
  26093. var o = this._axesMap
  26094. , a = this.dimensions
  26095. , r = []
  26096. , s = [];
  26097. E(a, function(t) {
  26098. r.push(e.mapDimension(t)),
  26099. s.push(o.get(t).model)
  26100. });
  26101. for (var l = this.hasAxisBrushed(), u = i; u < n; u++) {
  26102. var h;
  26103. if (l) {
  26104. h = "active";
  26105. for (var c = e.getValues(r, u), d = 0, f = a.length; d < f; d++) {
  26106. if ("inactive" === s[d].getActiveState(c[d])) {
  26107. h = "inactive";
  26108. break
  26109. }
  26110. }
  26111. } else
  26112. h = "normal";
  26113. t(h, u)
  26114. }
  26115. },
  26116. hasAxisBrushed: function() {
  26117. for (var t = this.dimensions, e = this._axesMap, i = !1, n = 0, o = t.length; n < o; n++)
  26118. "normal" !== e.get(t[n]).model.getActiveState() && (i = !0);
  26119. return i
  26120. },
  26121. axisCoordToPoint: function(t, e) {
  26122. return pl([t, 0], this._axesLayout[e].transform)
  26123. },
  26124. getAxisLayout: function(t) {
  26125. return k(this._axesLayout[t])
  26126. },
  26127. getSlidedAxisExpandWindow: function(t) {
  26128. var e = this._makeLayoutInfo()
  26129. , i = e.pixelDimIndex
  26130. , n = e.axisExpandWindow.slice()
  26131. , o = n[1] - n[0]
  26132. , a = [0, e.axisExpandWidth * (e.axisCount - 1)];
  26133. if (!this.containPoint(t))
  26134. return {
  26135. behavior: "none",
  26136. axisExpandWindow: n
  26137. };
  26138. var r, s = t[i] - e.layoutBase - e.axisExpandWindow0Pos, l = "slide", u = e.axisCollapseWidth, h = this._model.get("axisExpandSlideTriggerArea"), c = null != h[0];
  26139. if (u)
  26140. c && u && s < o * h[0] ? (l = "jump",
  26141. r = s - o * h[2]) : c && u && s > o * (1 - h[0]) ? (l = "jump",
  26142. r = s - o * (1 - h[2])) : 0 <= (r = s - o * h[1]) && (r = s - o * (1 - h[1])) <= 0 && (r = 0),
  26143. (r *= e.axisExpandWidth / u) ? Jw(r, n, a, "all") : l = "none";
  26144. else {
  26145. o = n[1] - n[0];
  26146. (n = [nb(0, a[1] * s / o - o / 2)])[1] = ib(a[1], n[0] + o),
  26147. n[0] = n[1] - o
  26148. }
  26149. return {
  26150. axisExpandWindow: n,
  26151. behavior: l
  26152. }
  26153. }
  26154. },
  26155. lh.register("parallel", {
  26156. create: function(n, o) {
  26157. var a = [];
  26158. return n.eachComponent("parallel", function(t, e) {
  26159. var i = new lb(t,n,o);
  26160. i.name = "parallel_" + e,
  26161. i.resize(t, o),
  26162. (t.coordinateSystem = i).model = t,
  26163. a.push(i)
  26164. }),
  26165. n.eachSeries(function(t) {
  26166. if ("parallel" === t.get("coordinateSystem")) {
  26167. var e = n.queryComponents({
  26168. mainType: "parallel",
  26169. index: t.get("parallelIndex"),
  26170. id: t.get("parallelId")
  26171. })[0];
  26172. t.coordinateSystem = e.coordinateSystem
  26173. }
  26174. }),
  26175. a
  26176. }
  26177. });
  26178. var hb = ku.extend({
  26179. type: "baseParallelAxis",
  26180. axis: null,
  26181. activeIntervals: [],
  26182. getAreaSelectStyle: function() {
  26183. return ha([["fill", "color"], ["lineWidth", "borderWidth"], ["stroke", "borderColor"], ["width", "width"], ["opacity", "opacity"]])(this.getModel("areaSelectStyle"))
  26184. },
  26185. setActiveIntervals: function(t) {
  26186. var e = this.activeIntervals = k(t);
  26187. if (e)
  26188. for (var i = e.length - 1; 0 <= i; i--)
  26189. Bl(e[i])
  26190. },
  26191. getActiveState: function(t) {
  26192. var e = this.activeIntervals;
  26193. if (!e.length)
  26194. return "normal";
  26195. if (null == t || isNaN(t))
  26196. return "inactive";
  26197. if (1 === e.length) {
  26198. var i = e[0];
  26199. if (i[0] <= t && t <= i[1])
  26200. return "active"
  26201. } else
  26202. for (var n = 0, o = e.length; n < o; n++)
  26203. if (e[n][0] <= t && t <= e[n][1])
  26204. return "active";
  26205. return "inactive"
  26206. }
  26207. });
  26208. m(hb.prototype, dg),
  26209. Gm("parallel", hb, function(t, e) {
  26210. return e.type || (e.data ? "category" : "value")
  26211. }, {
  26212. type: "value",
  26213. dim: null,
  26214. areaSelectStyle: {
  26215. width: 20,
  26216. borderWidth: 1,
  26217. borderColor: "rgba(160,197,232)",
  26218. color: "rgba(160,197,232)",
  26219. opacity: .3
  26220. },
  26221. realtime: !0,
  26222. z: 10
  26223. }),
  26224. ku.extend({
  26225. type: "parallel",
  26226. dependencies: ["parallelAxis"],
  26227. coordinateSystem: null,
  26228. dimensions: null,
  26229. parallelAxisIndex: null,
  26230. layoutMode: "box",
  26231. defaultOption: {
  26232. zlevel: 0,
  26233. z: 0,
  26234. left: 80,
  26235. top: 60,
  26236. right: 80,
  26237. bottom: 60,
  26238. layout: "horizontal",
  26239. axisExpandable: !1,
  26240. axisExpandCenter: null,
  26241. axisExpandCount: 0,
  26242. axisExpandWidth: 50,
  26243. axisExpandRate: 17,
  26244. axisExpandDebounce: 50,
  26245. axisExpandSlideTriggerArea: [-.15, .05, .4],
  26246. axisExpandTriggerOn: "click",
  26247. parallelAxisDefault: null
  26248. },
  26249. init: function() {
  26250. ku.prototype.init.apply(this, arguments),
  26251. this.mergeOption({})
  26252. },
  26253. mergeOption: function(t) {
  26254. var e = this.option;
  26255. t && m(e, t, !0),
  26256. this._initDimensions()
  26257. },
  26258. contains: function(t, e) {
  26259. var i = t.get("parallelIndex");
  26260. return null != i && e.getComponent("parallel", i) === this
  26261. },
  26262. setAxisExpand: function(e) {
  26263. E(["axisExpandable", "axisExpandCenter", "axisExpandCount", "axisExpandWidth", "axisExpandWindow"], function(t) {
  26264. e.hasOwnProperty(t) && (this.option[t] = e[t])
  26265. }, this)
  26266. },
  26267. _initDimensions: function() {
  26268. var e = this.dimensions = []
  26269. , i = this.parallelAxisIndex = [];
  26270. E(M(this.dependentModels.parallelAxis, function(t) {
  26271. return (t.get("parallelIndex") || 0) === this.componentIndex
  26272. }, this), function(t) {
  26273. e.push("dim" + t.get("dim")),
  26274. i.push(t.componentIndex)
  26275. })
  26276. }
  26277. });
  26278. _f({
  26279. type: "axisAreaSelect",
  26280. event: "axisAreaSelected"
  26281. }, function(e, t) {
  26282. t.eachComponent({
  26283. mainType: "parallelAxis",
  26284. query: e
  26285. }, function(t) {
  26286. t.axis.model.setActiveIntervals(e.intervals)
  26287. })
  26288. }),
  26289. _f("parallelAxisExpand", function(e, t) {
  26290. t.eachComponent({
  26291. mainType: "parallel",
  26292. query: e
  26293. }, function(t) {
  26294. t.setAxisExpand(e)
  26295. })
  26296. });
  26297. var cb = T
  26298. , db = E
  26299. , fb = O
  26300. , pb = Math.min
  26301. , gb = Math.max
  26302. , mb = Math.pow
  26303. , vb = 1e4
  26304. , yb = 6
  26305. , xb = 6
  26306. , _b = "globalPan"
  26307. , wb = {
  26308. w: [0, 0],
  26309. e: [0, 1],
  26310. n: [1, 0],
  26311. s: [1, 1]
  26312. }
  26313. , bb = {
  26314. w: "ew",
  26315. e: "ew",
  26316. n: "ns",
  26317. s: "ns",
  26318. ne: "nesw",
  26319. sw: "nesw",
  26320. nw: "nwse",
  26321. se: "nwse"
  26322. }
  26323. , Sb = {
  26324. brushStyle: {
  26325. lineWidth: 2,
  26326. stroke: "rgba(0,0,0,0.3)",
  26327. fill: "rgba(0,0,0,0.1)"
  26328. },
  26329. transformable: !0,
  26330. brushMode: "single",
  26331. removeOnClick: !1
  26332. }
  26333. , Mb = 0;
  26334. function Ib(t) {
  26335. Ct.call(this),
  26336. this._zr = t,
  26337. this.group = new Ci,
  26338. this._brushType,
  26339. this._brushOption,
  26340. this._panels,
  26341. this._track = [],
  26342. this._dragging,
  26343. this._covers = [],
  26344. this._creatingCover,
  26345. this._creatingPanel,
  26346. this._enableGlobalPan,
  26347. this._uid = "brushController_" + Mb++,
  26348. this._handlers = {},
  26349. db($b, function(t, e) {
  26350. this._handlers[e] = A(t, this)
  26351. }, this)
  26352. }
  26353. function Tb(t, e) {
  26354. var i = Qb[e.brushType].createCover(t, e);
  26355. return i.__brushOption = e,
  26356. Cb(i, e),
  26357. t.group.add(i),
  26358. i
  26359. }
  26360. function Ab(t, e) {
  26361. var i = kb(e);
  26362. return i.endCreating && (i.endCreating(t, e),
  26363. Cb(e, e.__brushOption)),
  26364. e
  26365. }
  26366. function Db(t, e) {
  26367. var i = e.__brushOption;
  26368. kb(e).updateCoverShape(t, e, i.range, i)
  26369. }
  26370. function Cb(t, e) {
  26371. var i = e.z;
  26372. null == i && (i = vb),
  26373. t.traverse(function(t) {
  26374. t.z = i,
  26375. t.z2 = i
  26376. })
  26377. }
  26378. function Lb(t, e) {
  26379. kb(e).updateCommon(t, e),
  26380. Db(t, e)
  26381. }
  26382. function kb(t) {
  26383. return Qb[t.__brushOption.brushType]
  26384. }
  26385. function Pb(t, e, i) {
  26386. var n, o = t._panels;
  26387. if (!o)
  26388. return !0;
  26389. var a = t._transform;
  26390. return db(o, function(t) {
  26391. t.isTargetByCursor(e, i, a) && (n = t)
  26392. }),
  26393. n
  26394. }
  26395. function Nb(t, e) {
  26396. var i = t._panels;
  26397. if (!i)
  26398. return !0;
  26399. var n = e.__brushOption.panelId;
  26400. return null == n || i[n]
  26401. }
  26402. function Ob(e) {
  26403. var t = e._covers
  26404. , i = t.length;
  26405. return db(t, function(t) {
  26406. e.group.remove(t)
  26407. }, e),
  26408. t.length = 0,
  26409. !!i
  26410. }
  26411. function Eb(t, e) {
  26412. var i = fb(t._covers, function(t) {
  26413. var e = t.__brushOption
  26414. , i = k(e.range);
  26415. return {
  26416. brushType: e.brushType,
  26417. panelId: e.panelId,
  26418. range: i
  26419. }
  26420. });
  26421. t.trigger("brush", i, {
  26422. isEnd: !!e.isEnd,
  26423. removeOnClick: !!e.removeOnClick
  26424. })
  26425. }
  26426. function Rb(t) {
  26427. var e = t.length - 1;
  26428. return e < 0 && (e = 0),
  26429. [t[0], t[e]]
  26430. }
  26431. function zb(e, i, t, n) {
  26432. var o = new Ci;
  26433. return o.add(new rs({
  26434. name: "main",
  26435. style: Fb(t),
  26436. silent: !0,
  26437. draggable: !0,
  26438. cursor: "move",
  26439. drift: cb(e, i, o, "nswe"),
  26440. ondragend: cb(Eb, i, {
  26441. isEnd: !0
  26442. })
  26443. })),
  26444. db(n, function(t) {
  26445. o.add(new rs({
  26446. name: t,
  26447. style: {
  26448. opacity: 0
  26449. },
  26450. draggable: !0,
  26451. silent: !0,
  26452. invisible: !0,
  26453. drift: cb(e, i, o, t),
  26454. ondragend: cb(Eb, i, {
  26455. isEnd: !0
  26456. })
  26457. }))
  26458. }),
  26459. o
  26460. }
  26461. function Bb(t, e, i, n) {
  26462. var o = n.brushStyle.lineWidth || 0
  26463. , a = gb(o, xb)
  26464. , r = i[0][0]
  26465. , s = i[1][0]
  26466. , l = r - o / 2
  26467. , u = s - o / 2
  26468. , h = i[0][1]
  26469. , c = i[1][1]
  26470. , d = h - a + o / 2
  26471. , f = c - a + o / 2
  26472. , p = h - r
  26473. , g = c - s
  26474. , m = p + o
  26475. , v = g + o;
  26476. Gb(t, e, "main", r, s, p, g),
  26477. n.transformable && (Gb(t, e, "w", l, u, a, v),
  26478. Gb(t, e, "e", d, u, a, v),
  26479. Gb(t, e, "n", l, u, m, a),
  26480. Gb(t, e, "s", l, f, m, a),
  26481. Gb(t, e, "nw", l, u, a, a),
  26482. Gb(t, e, "ne", d, u, a, a),
  26483. Gb(t, e, "sw", l, f, a, a),
  26484. Gb(t, e, "se", d, f, a, a))
  26485. }
  26486. function Vb(n, o) {
  26487. var t = o.__brushOption
  26488. , a = t.transformable
  26489. , e = o.childAt(0);
  26490. e.useStyle(Fb(t)),
  26491. e.attr({
  26492. silent: !a,
  26493. cursor: a ? "move" : "default"
  26494. }),
  26495. db(["w", "e", "n", "s", "se", "sw", "ne", "nw"], function(t) {
  26496. var e = o.childOfName(t)
  26497. , i = function t(e, i) {
  26498. {
  26499. if (1 < i.length) {
  26500. i = i.split("");
  26501. var n = [t(e, i[0]), t(e, i[1])];
  26502. return "e" !== n[0] && "w" !== n[0] || n.reverse(),
  26503. n.join("")
  26504. }
  26505. var o = {
  26506. w: "left",
  26507. e: "right",
  26508. n: "top",
  26509. s: "bottom"
  26510. }
  26511. , a = {
  26512. left: "w",
  26513. right: "e",
  26514. top: "n",
  26515. bottom: "s"
  26516. }
  26517. , n = gl(o[i], fl(e.group));
  26518. return a[n]
  26519. }
  26520. }(n, t);
  26521. e && e.attr({
  26522. silent: !a,
  26523. invisible: !a,
  26524. cursor: a ? bb[i] + "-resize" : null
  26525. })
  26526. })
  26527. }
  26528. function Gb(t, e, i, n, o, a, r) {
  26529. var s = e.childOfName(i);
  26530. s && s.setShape(function(t) {
  26531. var e = pb(t[0][0], t[1][0])
  26532. , i = pb(t[0][1], t[1][1])
  26533. , n = gb(t[0][0], t[1][0])
  26534. , o = gb(t[0][1], t[1][1]);
  26535. return {
  26536. x: e,
  26537. y: i,
  26538. width: n - e,
  26539. height: o - i
  26540. }
  26541. }(Xb(t, e, [[n, o], [n + a, o + r]])))
  26542. }
  26543. function Fb(t) {
  26544. return D({
  26545. strokeNoScale: !0
  26546. }, t.brushStyle)
  26547. }
  26548. function Wb(t, e, i, n) {
  26549. var o = [pb(t, i), pb(e, n)]
  26550. , a = [gb(t, i), gb(e, n)];
  26551. return [[o[0], a[0]], [o[1], a[1]]]
  26552. }
  26553. function Hb(t, e, i, n, o, a, r, s) {
  26554. var l = n.__brushOption
  26555. , u = t(l.range)
  26556. , h = Ub(i, a, r);
  26557. db(o.split(""), function(t) {
  26558. var e = wb[t];
  26559. u[e[0]][e[1]] += h[e[0]]
  26560. }),
  26561. l.range = e(Wb(u[0][0], u[1][0], u[0][1], u[1][1])),
  26562. Lb(i, n),
  26563. Eb(i, {
  26564. isEnd: !1
  26565. })
  26566. }
  26567. function Zb(t, e, i, n, o) {
  26568. var a = e.__brushOption.range
  26569. , r = Ub(t, i, n);
  26570. db(a, function(t) {
  26571. t[0] += r[0],
  26572. t[1] += r[1]
  26573. }),
  26574. Lb(t, e),
  26575. Eb(t, {
  26576. isEnd: !1
  26577. })
  26578. }
  26579. function Ub(t, e, i) {
  26580. var n = t.group
  26581. , o = n.transformCoordToLocal(e, i)
  26582. , a = n.transformCoordToLocal(0, 0);
  26583. return [o[0] - a[0], o[1] - a[1]]
  26584. }
  26585. function Xb(t, e, i) {
  26586. var n = Nb(t, e);
  26587. return n && !0 !== n ? n.clipPath(i, t._transform) : k(i)
  26588. }
  26589. function Yb(t) {
  26590. var e = t.event;
  26591. e.preventDefault && e.preventDefault()
  26592. }
  26593. function jb(t, e, i) {
  26594. return t.childOfName("main").contain(e, i)
  26595. }
  26596. function qb(t, e, i, n) {
  26597. var o, a = t._creatingCover, r = t._creatingPanel, s = t._brushOption;
  26598. if (t._track.push(i.slice()),
  26599. function(t) {
  26600. var e = t._track;
  26601. if (!e.length)
  26602. return !1;
  26603. var i = e[e.length - 1]
  26604. , n = e[0]
  26605. , o = i[0] - n[0]
  26606. , a = i[1] - n[1]
  26607. , r = mb(o * o + a * a, .5);
  26608. return yb < r
  26609. }(t) || a) {
  26610. if (r && !a) {
  26611. "single" === s.brushMode && Ob(t);
  26612. var l = k(s);
  26613. l.brushType = Kb(l.brushType, r),
  26614. l.panelId = !0 === r ? null : r.panelId,
  26615. a = t._creatingCover = Tb(t, l),
  26616. t._covers.push(a)
  26617. }
  26618. if (a) {
  26619. var u = Qb[Kb(t._brushType, r)];
  26620. a.__brushOption.range = u.getCreatingRange(Xb(t, a, t._track)),
  26621. n && (Ab(t, a),
  26622. u.updateCommon(t, a)),
  26623. Db(t, a),
  26624. o = {
  26625. isEnd: n
  26626. }
  26627. }
  26628. } else
  26629. n && "single" === s.brushMode && s.removeOnClick && Pb(t, e, i) && Ob(t) && (o = {
  26630. isEnd: n,
  26631. removeOnClick: !0
  26632. });
  26633. return o
  26634. }
  26635. function Kb(t, e) {
  26636. return "auto" === t ? e.defaultBrushType : t
  26637. }
  26638. Ib.prototype = {
  26639. constructor: Ib,
  26640. enableBrush: function(t) {
  26641. return this._brushType && function(t) {
  26642. var e = t._zr;
  26643. (function(t, e, i) {
  26644. var n = By(t);
  26645. n[e] === i && (n[e] = null)
  26646. }
  26647. )(e, _b, t._uid),
  26648. function(i, t) {
  26649. db(t, function(t, e) {
  26650. i.off(e, t)
  26651. })
  26652. }(e, t._handlers),
  26653. t._brushType = t._brushOption = null
  26654. }(this),
  26655. t.brushType && function(t, e) {
  26656. var i = t._zr;
  26657. t._enableGlobalPan || function(t, e, i) {
  26658. By(t)[e] = i
  26659. }(i, _b, t._uid);
  26660. (function(i, t) {
  26661. db(t, function(t, e) {
  26662. i.on(e, t)
  26663. })
  26664. }
  26665. )(i, t._handlers),
  26666. t._brushType = e.brushType,
  26667. t._brushOption = m(k(Sb), e, !0)
  26668. }(this, t),
  26669. this
  26670. },
  26671. setPanels: function(t) {
  26672. if (t && t.length) {
  26673. var e = this._panels = {};
  26674. E(t, function(t) {
  26675. e[t.panelId] = k(t)
  26676. })
  26677. } else
  26678. this._panels = null;
  26679. return this
  26680. },
  26681. mount: function(t) {
  26682. t = t || {},
  26683. this._enableGlobalPan = t.enableGlobalPan;
  26684. var e = this.group;
  26685. return this._zr.add(e),
  26686. e.attr({
  26687. position: t.position || [0, 0],
  26688. rotation: t.rotation || 0,
  26689. scale: t.scale || [1, 1]
  26690. }),
  26691. this._transform = e.getLocalTransform(),
  26692. this
  26693. },
  26694. eachCover: function(t, e) {
  26695. db(this._covers, t, e)
  26696. },
  26697. updateCovers: function(o) {
  26698. o = O(o, function(t) {
  26699. return m(k(Sb), t, !0)
  26700. });
  26701. var i = "\0-brush-index-"
  26702. , a = this._covers
  26703. , r = this._covers = []
  26704. , s = this
  26705. , l = this._creatingCover;
  26706. return new kf(a,o,function(t, e) {
  26707. return n(t.__brushOption, e)
  26708. }
  26709. ,n).add(t).update(t).remove(function(t) {
  26710. a[t] !== l && s.group.remove(a[t])
  26711. }).execute(),
  26712. this;
  26713. function n(t, e) {
  26714. return (null != t.id ? t.id : i + e) + "-" + t.brushType
  26715. }
  26716. function t(t, e) {
  26717. var i = o[t];
  26718. if (null != e && a[e] === l)
  26719. r[t] = a[e];
  26720. else {
  26721. var n = r[t] = null != e ? (a[e].__brushOption = i,
  26722. a[e]) : Ab(s, Tb(s, i));
  26723. Lb(s, n)
  26724. }
  26725. }
  26726. },
  26727. unmount: function() {
  26728. return this.enableBrush(!1),
  26729. Ob(this),
  26730. this._zr.remove(this.group),
  26731. this
  26732. },
  26733. dispose: function() {
  26734. this.unmount(),
  26735. this.off()
  26736. }
  26737. },
  26738. b(Ib, Ct);
  26739. var $b = {
  26740. mousedown: function(t) {
  26741. if (this._dragging)
  26742. Jb(this, t);
  26743. else if (!t.target || !t.target.draggable) {
  26744. Yb(t);
  26745. var e = this.group.transformCoordToLocal(t.offsetX, t.offsetY);
  26746. this._creatingCover = null,
  26747. (this._creatingPanel = Pb(this, t, e)) && (this._dragging = !0,
  26748. this._track = [e.slice()])
  26749. }
  26750. },
  26751. mousemove: function(t) {
  26752. var e = t.offsetX
  26753. , i = t.offsetY
  26754. , n = this.group.transformCoordToLocal(e, i);
  26755. if (function(t, e, i) {
  26756. if (t._brushType && !function(t, e, i) {
  26757. var n = t._zr;
  26758. return e < 0 || e > n.getWidth() || i < 0 || i > n.getHeight()
  26759. }(t, e)) {
  26760. var n = t._zr
  26761. , o = t._covers
  26762. , a = Pb(t, e, i);
  26763. if (!t._dragging)
  26764. for (var r = 0; r < o.length; r++) {
  26765. var s = o[r].__brushOption;
  26766. if (a && (!0 === a || s.panelId === a.panelId) && Qb[s.brushType].contain(o[r], i[0], i[1]))
  26767. return
  26768. }
  26769. a && n.setCursorStyle("crosshair")
  26770. }
  26771. }(this, t, n),
  26772. this._dragging) {
  26773. Yb(t);
  26774. var o = qb(this, t, n, !1);
  26775. o && Eb(this, o)
  26776. }
  26777. },
  26778. mouseup: function(t) {
  26779. Jb(this, t)
  26780. }
  26781. };
  26782. function Jb(t, e) {
  26783. if (t._dragging) {
  26784. Yb(e);
  26785. var i = e.offsetX
  26786. , n = e.offsetY
  26787. , o = t.group.transformCoordToLocal(i, n)
  26788. , a = qb(t, e, o, !0);
  26789. t._dragging = !1,
  26790. t._track = [],
  26791. t._creatingCover = null,
  26792. a && Eb(t, a)
  26793. }
  26794. }
  26795. var Qb = {
  26796. lineX: tS(0),
  26797. lineY: tS(1),
  26798. rect: {
  26799. createCover: function(t, e) {
  26800. return zb(cb(Hb, function(t) {
  26801. return t
  26802. }, function(t) {
  26803. return t
  26804. }), t, e, ["w", "e", "n", "s", "se", "sw", "ne", "nw"])
  26805. },
  26806. getCreatingRange: function(t) {
  26807. var e = Rb(t);
  26808. return Wb(e[1][0], e[1][1], e[0][0], e[0][1])
  26809. },
  26810. updateCoverShape: function(t, e, i, n) {
  26811. Bb(t, e, i, n)
  26812. },
  26813. updateCommon: Vb,
  26814. contain: jb
  26815. },
  26816. polygon: {
  26817. createCover: function(t, e) {
  26818. var i = new Ci;
  26819. return i.add(new ts({
  26820. name: "main",
  26821. style: Fb(e),
  26822. silent: !0
  26823. })),
  26824. i
  26825. },
  26826. getCreatingRange: function(t) {
  26827. return t
  26828. },
  26829. endCreating: function(t, e) {
  26830. e.remove(e.childAt(0)),
  26831. e.add(new Qr({
  26832. name: "main",
  26833. draggable: !0,
  26834. drift: cb(Zb, t, e),
  26835. ondragend: cb(Eb, t, {
  26836. isEnd: !0
  26837. })
  26838. }))
  26839. },
  26840. updateCoverShape: function(t, e, i, n) {
  26841. e.childAt(0).setShape({
  26842. points: Xb(t, e, i)
  26843. })
  26844. },
  26845. updateCommon: Vb,
  26846. contain: jb
  26847. }
  26848. };
  26849. function tS(l) {
  26850. return {
  26851. createCover: function(t, e) {
  26852. return zb(cb(Hb, function(t) {
  26853. var e = [t, [0, 100]];
  26854. return l && e.reverse(),
  26855. e
  26856. }, function(t) {
  26857. return t[l]
  26858. }), t, e, [["w", "e"], ["n", "s"]][l])
  26859. },
  26860. getCreatingRange: function(t) {
  26861. var e = Rb(t);
  26862. return [pb(e[0][l], e[1][l]), gb(e[0][l], e[1][l])]
  26863. },
  26864. updateCoverShape: function(t, e, i, n) {
  26865. var o, a = Nb(t, e);
  26866. if (!0 !== a && a.getLinearBrushOtherExtent)
  26867. o = a.getLinearBrushOtherExtent(l, t._transform);
  26868. else {
  26869. var r = t._zr;
  26870. o = [0, [r.getWidth(), r.getHeight()][1 - l]]
  26871. }
  26872. var s = [i, o];
  26873. l && s.reverse(),
  26874. Bb(t, e, s, n)
  26875. },
  26876. updateCommon: Vb,
  26877. contain: jb
  26878. }
  26879. }
  26880. function eS(i) {
  26881. return i = oS(i),
  26882. function(t, e) {
  26883. return vl(t, i)
  26884. }
  26885. }
  26886. function iS(o, a) {
  26887. return o = oS(o),
  26888. function(t) {
  26889. var e = null != a ? a : t
  26890. , i = e ? o.width : o.height
  26891. , n = e ? o.x : o.y;
  26892. return [n, n + (i || 0)]
  26893. }
  26894. }
  26895. function nS(n, o, a) {
  26896. return n = oS(n),
  26897. function(t, e, i) {
  26898. return n.contain(e[0], e[1]) && !$y(t, o, a)
  26899. }
  26900. }
  26901. function oS(t) {
  26902. return Di.create(t)
  26903. }
  26904. var aS = ["axisLine", "axisTickLabel", "axisName"]
  26905. , rS = Af({
  26906. type: "parallelAxis",
  26907. init: function(t, e) {
  26908. rS.superApply(this, "init", arguments),
  26909. (this._brushController = new Ib(e.getZr())).on("brush", A(this._onBrush, this))
  26910. },
  26911. render: function(t, e, i, n) {
  26912. if (!function(t, e, i) {
  26913. return i && "axisAreaSelect" === i.type && e.findComponents({
  26914. mainType: "parallelAxis",
  26915. query: i
  26916. })[0] === t
  26917. }(t, e, n)) {
  26918. this.axisModel = t,
  26919. this.api = i,
  26920. this.group.removeAll();
  26921. var o = this._axisGroup;
  26922. if (this._axisGroup = new Ci,
  26923. this.group.add(this._axisGroup),
  26924. t.get("show")) {
  26925. var a = function(t, e) {
  26926. return e.getComponent("parallel", t.get("parallelIndex"))
  26927. }(t, e)
  26928. , r = a.coordinateSystem
  26929. , s = t.getAreaSelectStyle()
  26930. , l = s.width
  26931. , u = t.axis.dim
  26932. , h = P({
  26933. strokeContainThreshold: l
  26934. }, r.getAxisLayout(u))
  26935. , c = new Qm(t,h);
  26936. E(aS, c.add, c),
  26937. this._axisGroup.add(c.getGroup()),
  26938. this._refreshBrushController(h, s, t, a, l, i);
  26939. var d = n && !1 === n.animation ? null : t;
  26940. ml(o, this._axisGroup, d)
  26941. }
  26942. }
  26943. },
  26944. _refreshBrushController: function(t, e, i, n, o, a) {
  26945. var r = i.axis.getExtent()
  26946. , s = r[1] - r[0]
  26947. , l = Math.min(30, .1 * Math.abs(s))
  26948. , u = Di.create({
  26949. x: r[0],
  26950. y: -o / 2,
  26951. width: s,
  26952. height: o
  26953. });
  26954. u.x -= l,
  26955. u.width += 2 * l,
  26956. this._brushController.mount({
  26957. enableGlobalPan: !0,
  26958. rotation: t.rotation,
  26959. position: t.position
  26960. }).setPanels([{
  26961. panelId: "pl",
  26962. clipPath: eS(u),
  26963. isTargetByCursor: nS(u, a, n),
  26964. getLinearBrushOtherExtent: iS(u, 0)
  26965. }]).enableBrush({
  26966. brushType: "lineX",
  26967. brushStyle: e,
  26968. removeOnClick: !0
  26969. }).updateCovers(function(t) {
  26970. var e = t.axis;
  26971. return O(t.activeIntervals, function(t) {
  26972. return {
  26973. brushType: "lineX",
  26974. panelId: "pl",
  26975. range: [e.dataToCoord(t[0], !0), e.dataToCoord(t[1], !0)]
  26976. }
  26977. })
  26978. }(i))
  26979. },
  26980. _onBrush: function(t, e) {
  26981. var i = this.axisModel
  26982. , n = i.axis
  26983. , o = O(t, function(t) {
  26984. return [n.coordToData(t.range[0], !0), n.coordToData(t.range[1], !0)]
  26985. });
  26986. !i.option.realtime !== e.isEnd && !e.removeOnClick || this.api.dispatchAction({
  26987. type: "axisAreaSelect",
  26988. parallelAxisId: i.id,
  26989. intervals: o
  26990. })
  26991. },
  26992. dispose: function() {
  26993. this._brushController.dispose()
  26994. }
  26995. });
  26996. Af({
  26997. type: "parallel",
  26998. render: function(t, e, i) {
  26999. this._model = t,
  27000. this._api = i,
  27001. this._handlers || (this._handlers = {},
  27002. E(sS, function(t, e) {
  27003. i.getZr().on(e, this._handlers[e] = A(t, this))
  27004. }, this)),
  27005. kc(this, "_throttledDispatchExpand", t.get("axisExpandRate"), "fixRate")
  27006. },
  27007. dispose: function(t, i) {
  27008. E(this._handlers, function(t, e) {
  27009. i.getZr().off(e, t)
  27010. }),
  27011. this._handlers = null
  27012. },
  27013. _throttledDispatchExpand: function(t) {
  27014. this._dispatchExpand(t)
  27015. },
  27016. _dispatchExpand: function(t) {
  27017. t && this._api.dispatchAction(P({
  27018. type: "parallelAxisExpand"
  27019. }, t))
  27020. }
  27021. });
  27022. var sS = {
  27023. mousedown: function(t) {
  27024. lS(this, "click") && (this._mouseDownPoint = [t.offsetX, t.offsetY])
  27025. },
  27026. mouseup: function(t) {
  27027. var e = this._mouseDownPoint;
  27028. if (lS(this, "click") && e) {
  27029. var i = [t.offsetX, t.offsetY];
  27030. if (5 < Math.pow(e[0] - i[0], 2) + Math.pow(e[1] - i[1], 2))
  27031. return;
  27032. var n = this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX, t.offsetY]);
  27033. "none" !== n.behavior && this._dispatchExpand({
  27034. axisExpandWindow: n.axisExpandWindow
  27035. })
  27036. }
  27037. this._mouseDownPoint = null
  27038. },
  27039. mousemove: function(t) {
  27040. if (!this._mouseDownPoint && lS(this, "mousemove")) {
  27041. var e = this._model
  27042. , i = e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX, t.offsetY])
  27043. , n = i.behavior;
  27044. "jump" === n && this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),
  27045. this._throttledDispatchExpand("none" === n ? null : {
  27046. axisExpandWindow: i.axisExpandWindow,
  27047. animation: "jump" === n && null
  27048. })
  27049. }
  27050. }
  27051. };
  27052. function lS(t, e) {
  27053. var i = t._model;
  27054. return i.get("axisExpandable") && i.get("axisExpandTriggerOn") === e
  27055. }
  27056. yf(function(t) {
  27057. !function(t) {
  27058. if (t.parallel)
  27059. return;
  27060. var e = !1;
  27061. E(t.series, function(t) {
  27062. t && "parallel" === t.type && (e = !0)
  27063. }),
  27064. e && (t.parallel = [{}])
  27065. }(t),
  27066. function(n) {
  27067. E(Vo(n.parallelAxis), function(t) {
  27068. if (z(t)) {
  27069. var e = t.parallelIndex || 0
  27070. , i = Vo(n.parallel)[e];
  27071. i && i.parallelAxisDefault && m(t, i.parallelAxisDefault, !1)
  27072. }
  27073. })
  27074. }(t)
  27075. }),
  27076. sc.extend({
  27077. type: "series.parallel",
  27078. dependencies: ["parallel"],
  27079. visualColorAccessPath: "lineStyle.color",
  27080. getInitialData: function(t, e) {
  27081. var i = this.getSource();
  27082. return function(t, e) {
  27083. if (t.encodeDefine)
  27084. return;
  27085. var i = e.ecModel.getComponent("parallel", e.get("parallelIndex"));
  27086. if (!i)
  27087. return;
  27088. var n = t.encodeDefine = Q();
  27089. E(i.dimensions, function(t) {
  27090. var e = function(t) {
  27091. return +t.replace("dim", "")
  27092. }(t);
  27093. n.set(t, e)
  27094. })
  27095. }(i, this),
  27096. gp(i, this)
  27097. },
  27098. getRawIndicesByActiveState: function(i) {
  27099. var t = this.coordinateSystem
  27100. , n = this.getData()
  27101. , o = [];
  27102. return t.eachActiveState(n, function(t, e) {
  27103. i === t && o.push(n.getRawIndex(e))
  27104. }),
  27105. o
  27106. },
  27107. defaultOption: {
  27108. zlevel: 0,
  27109. z: 2,
  27110. coordinateSystem: "parallel",
  27111. parallelIndex: 0,
  27112. label: {
  27113. show: !1
  27114. },
  27115. inactiveOpacity: .05,
  27116. activeOpacity: 1,
  27117. lineStyle: {
  27118. width: 1,
  27119. opacity: .45,
  27120. type: "solid"
  27121. },
  27122. emphasis: {
  27123. label: {
  27124. show: !1
  27125. }
  27126. },
  27127. progressive: 500,
  27128. smooth: !1,
  27129. animationEasing: "linear"
  27130. }
  27131. });
  27132. _c.extend({
  27133. type: "parallel",
  27134. init: function() {
  27135. this._dataGroup = new Ci,
  27136. this.group.add(this._dataGroup),
  27137. this._data,
  27138. this._initialized
  27139. },
  27140. render: function(a, t, e, r) {
  27141. var i = this._dataGroup
  27142. , s = a.getData()
  27143. , l = this._data
  27144. , u = a.coordinateSystem
  27145. , h = u.dimensions
  27146. , c = cS(a);
  27147. if (s.diff(l).add(function(t) {
  27148. dS(hS(s, i, t, h, u), s, t, c)
  27149. }).update(function(t, e) {
  27150. var i = l.getItemGraphicEl(e)
  27151. , n = uS(s, t, h, u);
  27152. s.setItemGraphicEl(t, i);
  27153. var o = r && !1 === r.animation ? null : a;
  27154. cl(i, {
  27155. shape: {
  27156. points: n
  27157. }
  27158. }, o, t),
  27159. dS(i, s, t, c)
  27160. }).remove(function(t) {
  27161. var e = l.getItemGraphicEl(t);
  27162. i.remove(e)
  27163. }).execute(),
  27164. !this._initialized) {
  27165. this._initialized = !0;
  27166. var n = function(t, e, i) {
  27167. var n = t.model
  27168. , o = t.getRect()
  27169. , a = new rs({
  27170. shape: {
  27171. x: o.x,
  27172. y: o.y,
  27173. width: o.width,
  27174. height: o.height
  27175. }
  27176. })
  27177. , r = "horizontal" === n.get("layout") ? "width" : "height";
  27178. return a.setShape(r, 0),
  27179. dl(a, {
  27180. shape: {
  27181. width: o.width,
  27182. height: o.height
  27183. }
  27184. }, e, i),
  27185. a
  27186. }(u, a, function() {
  27187. setTimeout(function() {
  27188. i.removeClipPath()
  27189. })
  27190. });
  27191. i.setClipPath(n)
  27192. }
  27193. this._data = s
  27194. },
  27195. incrementalPrepareRender: function(t, e, i) {
  27196. this._initialized = !0,
  27197. this._data = null,
  27198. this._dataGroup.removeAll()
  27199. },
  27200. incrementalRender: function(t, e, i) {
  27201. for (var n = e.getData(), o = e.coordinateSystem, a = o.dimensions, r = cS(e), s = t.start; s < t.end; s++) {
  27202. var l = hS(n, this._dataGroup, s, a, o);
  27203. l.incremental = !0,
  27204. dS(l, n, s, r)
  27205. }
  27206. },
  27207. dispose: function() {},
  27208. remove: function() {
  27209. this._dataGroup && this._dataGroup.removeAll(),
  27210. this._data = null
  27211. }
  27212. });
  27213. function uS(t, e, i, n) {
  27214. for (var o, a = [], r = 0; r < i.length; r++) {
  27215. var s = i[r]
  27216. , l = t.get(t.mapDimension(s), e);
  27217. o = l,
  27218. ("category" === n.getAxis(s).type ? null == o : null == o || isNaN(o)) || a.push(n.dataToPoint(l, s))
  27219. }
  27220. return a
  27221. }
  27222. function hS(t, e, i, n, o) {
  27223. var a = uS(t, i, n, o)
  27224. , r = new ts({
  27225. shape: {
  27226. points: a
  27227. },
  27228. silent: !0,
  27229. z2: 10
  27230. });
  27231. return e.add(r),
  27232. t.setItemGraphicEl(i, r),
  27233. r
  27234. }
  27235. function cS(t) {
  27236. var e = t.get("smooth", !0);
  27237. return !0 === e && (e = .3),
  27238. {
  27239. lineStyle: t.getModel("lineStyle").getLineStyle(),
  27240. smooth: null != e ? e : .3
  27241. }
  27242. }
  27243. function dS(t, e, i, n) {
  27244. var o = n.lineStyle;
  27245. e.hasItemOption && (o = e.getItemModel(i).getModel("lineStyle").getLineStyle());
  27246. t.useStyle(o);
  27247. var a = t.style;
  27248. a.fill = null,
  27249. a.stroke = e.getItemVisual(i, "color"),
  27250. a.opacity = e.getItemVisual(i, "opacity"),
  27251. n.smooth && (t.shape.smooth = n.smooth)
  27252. }
  27253. var fS = ["lineStyle", "normal", "opacity"];
  27254. Sf({
  27255. seriesType: "parallel",
  27256. reset: function(t, e, i) {
  27257. var n = t.getModel("itemStyle")
  27258. , o = t.getModel("lineStyle")
  27259. , a = e.get("color")
  27260. , r = o.get("color") || n.get("color") || a[t.seriesIndex % a.length]
  27261. , s = t.get("inactiveOpacity")
  27262. , l = t.get("activeOpacity")
  27263. , u = t.getModel("lineStyle").getLineStyle()
  27264. , h = t.coordinateSystem
  27265. , c = t.getData()
  27266. , d = {
  27267. normal: u.opacity,
  27268. active: l,
  27269. inactive: s
  27270. };
  27271. return c.setVisual("color", r),
  27272. {
  27273. progress: function(t, o) {
  27274. h.eachActiveState(o, function(t, e) {
  27275. var i = d[t];
  27276. if ("normal" === t && o.hasItemOption) {
  27277. var n = o.getItemModel(e).get(fS, !0);
  27278. null != n && (i = n)
  27279. }
  27280. o.setItemVisual(e, "opacity", i)
  27281. }, t.start, t.end)
  27282. }
  27283. }
  27284. }
  27285. });
  27286. var pS = sc.extend({
  27287. type: "series.sankey",
  27288. layoutInfo: null,
  27289. levelModels: null,
  27290. getInitialData: function(t, e) {
  27291. for (var i = t.edges || t.links, n = t.data || t.nodes, o = t.levels, a = this.levelModels = {}, r = 0; r < o.length; r++)
  27292. null != o[r].depth && 0 <= o[r].depth && (a[o[r].depth] = new Cl(o[r],this,e));
  27293. if (n && i)
  27294. return iw(n, i, this, !0, function(t, e) {
  27295. t.wrapMethod("getItemModel", function(t, n) {
  27296. return t.customizeGetParent(function(t) {
  27297. var e = this.parentModel
  27298. , i = e.getData().getItemLayout(n).depth;
  27299. return e.levelModels[i] || this.parentModel
  27300. }),
  27301. t
  27302. }),
  27303. e.wrapMethod("getItemModel", function(t, n) {
  27304. return t.customizeGetParent(function(t) {
  27305. var e = this.parentModel
  27306. , i = e.getGraph().getEdgeByIndex(n).node1.getLayout().depth;
  27307. return e.levelModels[i] || this.parentModel
  27308. }),
  27309. t
  27310. })
  27311. }).data
  27312. },
  27313. setNodePosition: function(t, e) {
  27314. var i = this.option.data[t];
  27315. i.localX = e[0],
  27316. i.localY = e[1]
  27317. },
  27318. getGraph: function() {
  27319. return this.getData().graph
  27320. },
  27321. getEdgeData: function() {
  27322. return this.getGraph().edgeData
  27323. },
  27324. formatTooltip: function(t, e, i) {
  27325. if ("edge" === i) {
  27326. var n = this.getDataParams(t, i)
  27327. , o = n.data
  27328. , a = o.source + " -- " + o.target;
  27329. return n.value && (a += " : " + n.value),
  27330. au(a)
  27331. }
  27332. if ("node" !== i)
  27333. return pS.superCall(this, "formatTooltip", t, e);
  27334. var r = this.getGraph().getNodeByIndex(t).getLayout().value
  27335. , s = this.getDataParams(t, i).data.name;
  27336. if (r)
  27337. a = s + " : " + r;
  27338. return au(a)
  27339. },
  27340. optionUpdated: function() {
  27341. var t = this.option;
  27342. !0 === t.focusNodeAdjacency && (t.focusNodeAdjacency = "allEdges")
  27343. },
  27344. getDataParams: function(t, e) {
  27345. var i = pS.superCall(this, "getDataParams", t, e);
  27346. if (null == i.value && "node" === e) {
  27347. var n = this.getGraph().getNodeByIndex(t).getLayout().value;
  27348. i.value = n
  27349. }
  27350. return i
  27351. },
  27352. defaultOption: {
  27353. zlevel: 0,
  27354. z: 2,
  27355. coordinateSystem: "view",
  27356. layout: null,
  27357. left: "5%",
  27358. top: "5%",
  27359. right: "20%",
  27360. bottom: "5%",
  27361. orient: "horizontal",
  27362. nodeWidth: 20,
  27363. nodeGap: 8,
  27364. draggable: !0,
  27365. focusNodeAdjacency: !1,
  27366. layoutIterations: 32,
  27367. label: {
  27368. show: !0,
  27369. position: "right",
  27370. color: "#000",
  27371. fontSize: 12
  27372. },
  27373. levels: [],
  27374. nodeAlign: "justify",
  27375. itemStyle: {
  27376. borderWidth: 1,
  27377. borderColor: "#333"
  27378. },
  27379. lineStyle: {
  27380. color: "#314656",
  27381. opacity: .2,
  27382. curveness: .5
  27383. },
  27384. emphasis: {
  27385. label: {
  27386. show: !0
  27387. },
  27388. lineStyle: {
  27389. opacity: .5
  27390. }
  27391. },
  27392. animationEasing: "linear",
  27393. animationDuration: 1e3
  27394. }
  27395. })
  27396. , gS = ["itemStyle", "opacity"]
  27397. , mS = ["emphasis", "itemStyle", "opacity"]
  27398. , vS = ["lineStyle", "opacity"]
  27399. , yS = ["emphasis", "lineStyle", "opacity"];
  27400. function xS(t, e) {
  27401. return t.getVisual("opacity") || t.getModel().get(e)
  27402. }
  27403. function _S(t, e, i) {
  27404. var n = t.getGraphicEl()
  27405. , o = xS(t, e);
  27406. null != i && (null == o && (o = 1),
  27407. o *= i),
  27408. n.downplay && n.downplay(),
  27409. n.traverse(function(t) {
  27410. "group" !== t.type && t.setStyle("opacity", o)
  27411. })
  27412. }
  27413. function wS(t, e) {
  27414. var i = xS(t, e)
  27415. , n = t.getGraphicEl();
  27416. n.traverse(function(t) {
  27417. "group" !== t.type && t.setStyle("opacity", i)
  27418. }),
  27419. n.highlight && n.highlight()
  27420. }
  27421. var bS = Cs({
  27422. shape: {
  27423. x1: 0,
  27424. y1: 0,
  27425. x2: 0,
  27426. y2: 0,
  27427. cpx1: 0,
  27428. cpy1: 0,
  27429. cpx2: 0,
  27430. cpy2: 0,
  27431. extent: 0,
  27432. orient: ""
  27433. },
  27434. buildPath: function(t, e) {
  27435. var i = e.extent;
  27436. t.moveTo(e.x1, e.y1),
  27437. t.bezierCurveTo(e.cpx1, e.cpy1, e.cpx2, e.cpy2, e.x2, e.y2),
  27438. "vertical" === e.orient ? (t.lineTo(e.x2 + i, e.y2),
  27439. t.bezierCurveTo(e.cpx2 + i, e.cpy2, e.cpx1 + i, e.cpy1, e.x1 + i, e.y1)) : (t.lineTo(e.x2, e.y2 + i),
  27440. t.bezierCurveTo(e.cpx2, e.cpy2 + i, e.cpx1, e.cpy1 + i, e.x1, e.y1 + i)),
  27441. t.closePath()
  27442. },
  27443. highlight: function() {
  27444. this.trigger("emphasis")
  27445. },
  27446. downplay: function() {
  27447. this.trigger("normal")
  27448. }
  27449. });
  27450. Cf({
  27451. type: "sankey",
  27452. _model: null,
  27453. _focusAdjacencyDisabled: !1,
  27454. render: function(w, t, n) {
  27455. var o = this
  27456. , e = w.getGraph()
  27457. , b = this.group
  27458. , i = w.layoutInfo
  27459. , S = i.width
  27460. , M = i.height
  27461. , u = w.getData()
  27462. , I = w.getData("edge")
  27463. , T = w.get("orient");
  27464. this._model = w,
  27465. b.removeAll(),
  27466. b.attr("position", [i.x, i.y]),
  27467. e.eachEdge(function(t) {
  27468. var e = new bS;
  27469. e.dataIndex = t.dataIndex,
  27470. e.seriesIndex = w.seriesIndex,
  27471. e.dataType = "edge";
  27472. var i, n, o, a, r, s, l, u, h = t.getModel("lineStyle"), c = h.get("curveness"), d = t.node1.getLayout(), f = t.node1.getModel(), p = f.get("localX"), g = f.get("localY"), m = t.node2.getLayout(), v = t.node2.getModel(), y = v.get("localX"), x = v.get("localY"), _ = t.getLayout();
  27473. switch (e.shape.extent = Math.max(1, _.dy),
  27474. u = "vertical" === (e.shape.orient = T) ? (i = (null != p ? p * S : d.x) + _.sy,
  27475. n = (null != g ? g * M : d.y) + d.dy,
  27476. o = (null != y ? y * S : m.x) + _.ty,
  27477. r = i,
  27478. s = n * (1 - c) + (a = null != x ? x * M : m.y) * c,
  27479. l = o,
  27480. n * c + a * (1 - c)) : (i = (null != p ? p * S : d.x) + d.dx,
  27481. n = (null != g ? g * M : d.y) + _.sy,
  27482. r = i * (1 - c) + (o = null != y ? y * S : m.x) * c,
  27483. s = n,
  27484. l = i * c + o * (1 - c),
  27485. a = (null != x ? x * M : m.y) + _.ty),
  27486. e.setShape({
  27487. x1: i,
  27488. y1: n,
  27489. x2: o,
  27490. y2: a,
  27491. cpx1: r,
  27492. cpy1: s,
  27493. cpx2: l,
  27494. cpy2: u
  27495. }),
  27496. e.setStyle(h.getItemStyle()),
  27497. e.style.fill) {
  27498. case "source":
  27499. e.style.fill = t.node1.getVisual("color");
  27500. break;
  27501. case "target":
  27502. e.style.fill = t.node2.getVisual("color")
  27503. }
  27504. $s(e, t.getModel("emphasis.lineStyle").getItemStyle()),
  27505. b.add(e),
  27506. I.setItemGraphicEl(t.dataIndex, e)
  27507. }),
  27508. e.eachNode(function(t) {
  27509. var e = t.getLayout()
  27510. , i = t.getModel()
  27511. , n = i.get("localX")
  27512. , o = i.get("localY")
  27513. , a = i.getModel("label")
  27514. , r = i.getModel("emphasis.label")
  27515. , s = new rs({
  27516. shape: {
  27517. x: null != n ? n * S : e.x,
  27518. y: null != o ? o * M : e.y,
  27519. width: e.dx,
  27520. height: e.dy
  27521. },
  27522. style: i.getModel("itemStyle").getItemStyle()
  27523. })
  27524. , l = t.getModel("emphasis.itemStyle").getItemStyle();
  27525. el(s.style, l, a, r, {
  27526. labelFetcher: w,
  27527. labelDataIndex: t.dataIndex,
  27528. defaultText: t.id,
  27529. isRectText: !0
  27530. }),
  27531. s.setStyle("fill", t.getVisual("color")),
  27532. $s(s, l),
  27533. b.add(s),
  27534. u.setItemGraphicEl(t.dataIndex, s),
  27535. s.dataType = "node"
  27536. }),
  27537. u.eachItemGraphicEl(function(t, i) {
  27538. var e = u.getItemModel(i);
  27539. e.get("draggable") && (t.drift = function(t, e) {
  27540. o._focusAdjacencyDisabled = !0,
  27541. this.shape.x += t,
  27542. this.shape.y += e,
  27543. this.dirty(),
  27544. n.dispatchAction({
  27545. type: "dragNode",
  27546. seriesId: w.id,
  27547. dataIndex: u.getRawIndex(i),
  27548. localX: this.shape.x / S,
  27549. localY: this.shape.y / M
  27550. })
  27551. }
  27552. ,
  27553. t.ondragend = function() {
  27554. o._focusAdjacencyDisabled = !1
  27555. }
  27556. ,
  27557. t.draggable = !0,
  27558. t.cursor = "move"),
  27559. t.highlight = function() {
  27560. this.trigger("emphasis")
  27561. }
  27562. ,
  27563. t.downplay = function() {
  27564. this.trigger("normal")
  27565. }
  27566. ,
  27567. t.focusNodeAdjHandler && t.off("mouseover", t.focusNodeAdjHandler),
  27568. t.unfocusNodeAdjHandler && t.off("mouseout", t.unfocusNodeAdjHandler),
  27569. e.get("focusNodeAdjacency") && (t.on("mouseover", t.focusNodeAdjHandler = function() {
  27570. o._focusAdjacencyDisabled || (o._clearTimer(),
  27571. n.dispatchAction({
  27572. type: "focusNodeAdjacency",
  27573. seriesId: w.id,
  27574. dataIndex: t.dataIndex
  27575. }))
  27576. }
  27577. ),
  27578. t.on("mouseout", t.unfocusNodeAdjHandler = function() {
  27579. o._focusAdjacencyDisabled || o._dispatchUnfocus(n)
  27580. }
  27581. ))
  27582. }),
  27583. I.eachItemGraphicEl(function(t, e) {
  27584. var i = I.getItemModel(e);
  27585. t.focusNodeAdjHandler && t.off("mouseover", t.focusNodeAdjHandler),
  27586. t.unfocusNodeAdjHandler && t.off("mouseout", t.unfocusNodeAdjHandler),
  27587. i.get("focusNodeAdjacency") && (t.on("mouseover", t.focusNodeAdjHandler = function() {
  27588. o._focusAdjacencyDisabled || (o._clearTimer(),
  27589. n.dispatchAction({
  27590. type: "focusNodeAdjacency",
  27591. seriesId: w.id,
  27592. edgeDataIndex: t.dataIndex
  27593. }))
  27594. }
  27595. ),
  27596. t.on("mouseout", t.unfocusNodeAdjHandler = function() {
  27597. o._focusAdjacencyDisabled || o._dispatchUnfocus(n)
  27598. }
  27599. ))
  27600. }),
  27601. !this._data && w.get("animation") && b.setClipPath(function(t, e, i) {
  27602. var n = new rs({
  27603. shape: {
  27604. x: t.x - 10,
  27605. y: t.y - 10,
  27606. width: 0,
  27607. height: t.height + 20
  27608. }
  27609. });
  27610. return dl(n, {
  27611. shape: {
  27612. width: t.width + 20
  27613. }
  27614. }, e, i),
  27615. n
  27616. }(b.getBoundingRect(), w, function() {
  27617. b.removeClipPath()
  27618. })),
  27619. this._data = w.getData()
  27620. },
  27621. dispose: function() {
  27622. this._clearTimer()
  27623. },
  27624. _dispatchUnfocus: function(t) {
  27625. var e = this;
  27626. this._clearTimer(),
  27627. this._unfocusDelayTimer = setTimeout(function() {
  27628. e._unfocusDelayTimer = null,
  27629. t.dispatchAction({
  27630. type: "unfocusNodeAdjacency",
  27631. seriesId: e._model.id
  27632. })
  27633. }, 500)
  27634. },
  27635. _clearTimer: function() {
  27636. this._unfocusDelayTimer && (clearTimeout(this._unfocusDelayTimer),
  27637. this._unfocusDelayTimer = null)
  27638. },
  27639. focusNodeAdjacency: function(t, e, i, n) {
  27640. var o = t.getData()
  27641. , a = o.graph
  27642. , r = n.dataIndex
  27643. , s = o.getItemModel(r)
  27644. , l = n.edgeDataIndex;
  27645. if (null != r || null != l) {
  27646. var u = a.getNodeByIndex(r)
  27647. , h = a.getEdgeByIndex(l);
  27648. if (a.eachNode(function(t) {
  27649. _S(t, gS, .1)
  27650. }),
  27651. a.eachEdge(function(t) {
  27652. _S(t, vS, .1)
  27653. }),
  27654. u) {
  27655. wS(u, mS);
  27656. var c = s.get("focusNodeAdjacency");
  27657. "outEdges" === c ? E(u.outEdges, function(t) {
  27658. t.dataIndex < 0 || (wS(t, yS),
  27659. wS(t.node2, mS))
  27660. }) : "inEdges" === c ? E(u.inEdges, function(t) {
  27661. t.dataIndex < 0 || (wS(t, yS),
  27662. wS(t.node1, mS))
  27663. }) : "allEdges" === c && E(u.edges, function(t) {
  27664. t.dataIndex < 0 || (wS(t, yS),
  27665. t.node1 !== u && wS(t.node1, mS),
  27666. t.node2 !== u && wS(t.node2, mS))
  27667. })
  27668. }
  27669. h && (wS(h, yS),
  27670. wS(h.node1, mS),
  27671. wS(h.node2, mS))
  27672. }
  27673. },
  27674. unfocusNodeAdjacency: function(t, e, i, n) {
  27675. var o = t.getGraph();
  27676. o.eachNode(function(t) {
  27677. _S(t, gS)
  27678. }),
  27679. o.eachEdge(function(t) {
  27680. _S(t, vS)
  27681. })
  27682. }
  27683. }),
  27684. _f({
  27685. type: "dragNode",
  27686. event: "dragnode",
  27687. update: "update"
  27688. }, function(e, t) {
  27689. t.eachComponent({
  27690. mainType: "series",
  27691. subType: "sankey",
  27692. query: e
  27693. }, function(t) {
  27694. t.setNodePosition(e.dataIndex, [e.localX, e.localY])
  27695. })
  27696. });
  27697. function SS(t) {
  27698. var e = t.hostGraph.data.getRawDataItem(t.dataIndex);
  27699. return null != e.depth && 0 <= e.depth
  27700. }
  27701. function MS(t, l, u, h, c) {
  27702. var d = "vertical" === c ? "x" : "y";
  27703. E(t, function(t) {
  27704. var e, i, n;
  27705. t.sort(function(t, e) {
  27706. return t.getLayout()[d] - e.getLayout()[d]
  27707. });
  27708. for (var o = 0, a = t.length, r = "vertical" === c ? "dx" : "dy", s = 0; s < a; s++)
  27709. 0 < (n = o - (i = t[s]).getLayout()[d]) && (e = i.getLayout()[d] + n,
  27710. "vertical" === c ? i.setLayout({
  27711. x: e
  27712. }, !0) : i.setLayout({
  27713. y: e
  27714. }, !0)),
  27715. o = i.getLayout()[d] + i.getLayout()[r] + l;
  27716. if (0 < (n = o - l - ("vertical" === c ? h : u)))
  27717. for (e = i.getLayout()[d] - n,
  27718. "vertical" === c ? i.setLayout({
  27719. x: e
  27720. }, !0) : i.setLayout({
  27721. y: e
  27722. }, !0),
  27723. o = e,
  27724. s = a - 2; 0 <= s; --s)
  27725. 0 < (n = (i = t[s]).getLayout()[d] + i.getLayout()[r] + l - o) && (e = i.getLayout()[d] - n,
  27726. "vertical" === c ? i.setLayout({
  27727. x: e
  27728. }, !0) : i.setLayout({
  27729. y: e
  27730. }, !0)),
  27731. o = i.getLayout()[d]
  27732. })
  27733. }
  27734. function IS(t, a, r) {
  27735. E(t.slice().reverse(), function(t) {
  27736. E(t, function(t) {
  27737. if (t.outEdges.length) {
  27738. var e = PS(t.outEdges, TS, r) / PS(t.outEdges, kS, r);
  27739. if (isNaN(e)) {
  27740. var i = t.outEdges.length;
  27741. e = i ? PS(t.outEdges, AS, r) / i : 0
  27742. }
  27743. if ("vertical" === r) {
  27744. var n = t.getLayout().x + (e - LS(t, r)) * a;
  27745. t.setLayout({
  27746. x: n
  27747. }, !0)
  27748. } else {
  27749. var o = t.getLayout().y + (e - LS(t, r)) * a;
  27750. t.setLayout({
  27751. y: o
  27752. }, !0)
  27753. }
  27754. }
  27755. })
  27756. })
  27757. }
  27758. function TS(t, e) {
  27759. return LS(t.node2, e) * t.getValue()
  27760. }
  27761. function AS(t, e) {
  27762. return LS(t.node2, e)
  27763. }
  27764. function DS(t, e) {
  27765. return LS(t.node1, e) * t.getValue()
  27766. }
  27767. function CS(t, e) {
  27768. return LS(t.node1, e)
  27769. }
  27770. function LS(t, e) {
  27771. return "vertical" === e ? t.getLayout().x + t.getLayout().dx / 2 : t.getLayout().y + t.getLayout().dy / 2
  27772. }
  27773. function kS(t) {
  27774. return t.getValue()
  27775. }
  27776. function PS(t, e, i) {
  27777. for (var n = 0, o = t.length, a = -1; ++a < o; ) {
  27778. var r = +e.call(t, t[a], i);
  27779. isNaN(r) || (n += r)
  27780. }
  27781. return n
  27782. }
  27783. function NS(t, a, r) {
  27784. E(t, function(t) {
  27785. E(t, function(t) {
  27786. if (t.inEdges.length) {
  27787. var e = PS(t.inEdges, DS, r) / PS(t.inEdges, kS, r);
  27788. if (isNaN(e)) {
  27789. var i = t.inEdges.length;
  27790. e = i ? PS(t.inEdges, CS, r) / i : 0
  27791. }
  27792. if ("vertical" === r) {
  27793. var n = t.getLayout().x + (e - LS(t, r)) * a;
  27794. t.setLayout({
  27795. x: n
  27796. }, !0)
  27797. } else {
  27798. var o = t.getLayout().y + (e - LS(t, r)) * a;
  27799. t.setLayout({
  27800. y: o
  27801. }, !0)
  27802. }
  27803. }
  27804. })
  27805. })
  27806. }
  27807. bf(function(t, u, e) {
  27808. t.eachSeriesByType("sankey", function(t) {
  27809. var e = t.get("nodeWidth")
  27810. , i = t.get("nodeGap")
  27811. , n = function(t, e) {
  27812. return bu(t.getBoxLayoutParams(), {
  27813. width: e.getWidth(),
  27814. height: e.getHeight()
  27815. })
  27816. }(t, u)
  27817. , o = (t.layoutInfo = n).width
  27818. , a = n.height
  27819. , r = t.getGraph()
  27820. , s = r.nodes
  27821. , l = r.edges;
  27822. !function(t) {
  27823. E(t, function(t) {
  27824. var e = PS(t.outEdges, kS)
  27825. , i = PS(t.inEdges, kS)
  27826. , n = t.getValue() || 0
  27827. , o = Math.max(e, i, n);
  27828. t.setLayout({
  27829. value: o
  27830. }, !0)
  27831. })
  27832. }(s),
  27833. function(t, e, i, n, o, a, r, s, l) {
  27834. (function(t, e, i, n, o, a, r) {
  27835. for (var s = [], l = [], u = [], h = [], c = 0, d = 0; d < e.length; d++)
  27836. s[d] = 1;
  27837. for (d = 0; d < t.length; d++)
  27838. l[d] = t[d].inEdges.length,
  27839. 0 === l[d] && u.push(t[d]);
  27840. var f = -1;
  27841. for (; u.length; ) {
  27842. for (var p = 0; p < u.length; p++) {
  27843. var g = u[p]
  27844. , m = g.hostGraph.data.getRawDataItem(g.dataIndex)
  27845. , v = null != m.depth && 0 <= m.depth;
  27846. v && m.depth > f && (f = m.depth),
  27847. g.setLayout({
  27848. depth: v ? m.depth : c
  27849. }, !0),
  27850. "vertical" === a ? g.setLayout({
  27851. dy: i
  27852. }, !0) : g.setLayout({
  27853. dx: i
  27854. }, !0);
  27855. for (var y = 0; y < g.outEdges.length; y++) {
  27856. var x = g.outEdges[y]
  27857. , _ = e.indexOf(x);
  27858. s[_] = 0;
  27859. var w = x.node2
  27860. , b = t.indexOf(w);
  27861. 0 == --l[b] && h.indexOf(w) < 0 && h.push(w)
  27862. }
  27863. }
  27864. ++c,
  27865. u = h,
  27866. h = []
  27867. }
  27868. for (d = 0; d < s.length; d++)
  27869. if (1 === s[d])
  27870. throw new Error("Sankey is a DAG, the original data has cycle!");
  27871. var S = c - 1 < f ? f : c - 1;
  27872. r && "left" !== r && function(t, e, i, n) {
  27873. if ("right" === e) {
  27874. for (var o = [], a = t, r = 0; a.length; ) {
  27875. for (var s = 0; s < a.length; s++) {
  27876. var l = a[s];
  27877. l.setLayout({
  27878. skNodeHeight: r
  27879. }, !0);
  27880. for (var u = 0; u < l.inEdges.length; u++) {
  27881. var h = l.inEdges[u];
  27882. o.indexOf(h.node1) < 0 && o.push(h.node1)
  27883. }
  27884. }
  27885. a = o,
  27886. o = [],
  27887. ++r
  27888. }
  27889. E(t, function(t) {
  27890. SS(t) || t.setLayout({
  27891. depth: Math.max(0, n - t.getLayout().skNodeHeight)
  27892. }, !0)
  27893. })
  27894. } else
  27895. "justify" === e && function(t, e) {
  27896. E(t, function(t) {
  27897. SS(t) || t.outEdges.length || t.setLayout({
  27898. depth: e
  27899. }, !0)
  27900. })
  27901. }(t, n)
  27902. }(t, r, 0, S);
  27903. !function(t, i, n) {
  27904. E(t, function(t) {
  27905. var e = t.getLayout().depth * i;
  27906. "vertical" === n ? t.setLayout({
  27907. y: e
  27908. }, !0) : t.setLayout({
  27909. x: e
  27910. }, !0)
  27911. })
  27912. }(t, "vertical" === a ? (o - i) / S : (n - i) / S, a)
  27913. }
  27914. )(t, e, i, o, a, s, l),
  27915. function(t, e, i, n, o, a, r) {
  27916. var s = function(t, e) {
  27917. var i = []
  27918. , n = "vertical" === e ? "y" : "x"
  27919. , o = ta(t, function(t) {
  27920. return t.getLayout()[n]
  27921. });
  27922. return o.keys.sort(function(t, e) {
  27923. return t - e
  27924. }),
  27925. E(o.keys, function(t) {
  27926. i.push(o.buckets.get(t))
  27927. }),
  27928. i
  27929. }(t, r);
  27930. (function(t, e, o, a, r, s) {
  27931. var l = 1 / 0;
  27932. E(t, function(t) {
  27933. var e = t.length
  27934. , i = 0;
  27935. E(t, function(t) {
  27936. i += t.getLayout().value
  27937. });
  27938. var n = "vertical" === s ? (a - (e - 1) * r) / i : (o - (e - 1) * r) / i;
  27939. n < l && (l = n)
  27940. }),
  27941. E(t, function(t) {
  27942. E(t, function(t, e) {
  27943. var i = t.getLayout().value * l;
  27944. "vertical" === s ? (t.setLayout({
  27945. x: e
  27946. }, !0),
  27947. t.setLayout({
  27948. dx: i
  27949. }, !0)) : (t.setLayout({
  27950. y: e
  27951. }, !0),
  27952. t.setLayout({
  27953. dy: i
  27954. }, !0))
  27955. })
  27956. }),
  27957. E(e, function(t) {
  27958. var e = +t.getValue() * l;
  27959. t.setLayout({
  27960. dy: e
  27961. }, !0)
  27962. })
  27963. }
  27964. )(s, e, i, n, o, r),
  27965. MS(s, o, i, n, r);
  27966. for (var l = 1; 0 < a; a--)
  27967. IS(s, l *= .99, r),
  27968. MS(s, o, i, n, r),
  27969. NS(s, l, r),
  27970. MS(s, o, i, n, r)
  27971. }(t, e, a, o, n, r, s),
  27972. function(t, e) {
  27973. var i = "vertical" === e ? "x" : "y";
  27974. E(t, function(t) {
  27975. t.outEdges.sort(function(t, e) {
  27976. return t.node2.getLayout()[i] - e.node2.getLayout()[i]
  27977. }),
  27978. t.inEdges.sort(function(t, e) {
  27979. return t.node1.getLayout()[i] - e.node1.getLayout()[i]
  27980. })
  27981. }),
  27982. E(t, function(t) {
  27983. var e = 0
  27984. , i = 0;
  27985. E(t.outEdges, function(t) {
  27986. t.setLayout({
  27987. sy: e
  27988. }, !0),
  27989. e += t.getLayout().dy
  27990. }),
  27991. E(t.inEdges, function(t) {
  27992. t.setLayout({
  27993. ty: i
  27994. }, !0),
  27995. i += t.getLayout().dy
  27996. })
  27997. })
  27998. }(t, s)
  27999. }(s, l, e, i, o, a, 0 !== M(s, function(t) {
  28000. return 0 === t.getLayout().value
  28001. }).length ? 0 : t.get("layoutIterations"), t.get("orient"), t.get("nodeAlign"))
  28002. })
  28003. }),
  28004. Sf(function(t, e) {
  28005. t.eachSeriesByType("sankey", function(n) {
  28006. var t = n.getGraph().nodes;
  28007. if (t.length) {
  28008. var o = 1 / 0
  28009. , a = -1 / 0;
  28010. E(t, function(t) {
  28011. var e = t.getLayout().value;
  28012. e < o && (o = e),
  28013. a < e && (a = e)
  28014. }),
  28015. E(t, function(t) {
  28016. var e = new g_({
  28017. type: "color",
  28018. mappingMethod: "linear",
  28019. dataExtent: [o, a],
  28020. visual: n.get("color")
  28021. }).mapValueToVisual(t.getLayout().value)
  28022. , i = t.getModel().get("itemStyle.color");
  28023. null != i ? t.setVisual("color", i) : t.setVisual("color", e)
  28024. })
  28025. }
  28026. })
  28027. });
  28028. var OS = {
  28029. _baseAxisDim: null,
  28030. getInitialData: function(t, e) {
  28031. var i, n, o = e.getComponent("xAxis", this.get("xAxisIndex")), a = e.getComponent("yAxis", this.get("yAxisIndex")), r = o.get("type"), s = a.get("type");
  28032. "category" === r ? (t.layout = "horizontal",
  28033. i = o.getOrdinalMeta(),
  28034. n = !0) : "category" === s ? (t.layout = "vertical",
  28035. i = a.getOrdinalMeta(),
  28036. n = !0) : t.layout = t.layout || "horizontal";
  28037. var l = ["x", "y"]
  28038. , u = "horizontal" === t.layout ? 0 : 1
  28039. , h = this._baseAxisDim = l[u]
  28040. , c = l[1 - u]
  28041. , d = [o, a]
  28042. , f = d[u].get("type")
  28043. , p = d[1 - u].get("type")
  28044. , g = t.data;
  28045. if (g && n) {
  28046. var m = [];
  28047. E(g, function(t, e) {
  28048. var i;
  28049. t.value && L(t.value) ? (i = t.value.slice(),
  28050. t.value.unshift(e)) : L(t) ? (i = t.slice(),
  28051. t.unshift(e)) : i = t,
  28052. m.push(i)
  28053. }),
  28054. t.data = m
  28055. }
  28056. var v = this.defaultValueDimensions
  28057. , y = [{
  28058. name: h,
  28059. type: Ef(f),
  28060. ordinalMeta: i,
  28061. otherDims: {
  28062. tooltip: !1,
  28063. itemName: 0
  28064. },
  28065. dimsDef: ["base"]
  28066. }, {
  28067. name: c,
  28068. type: Ef(p),
  28069. dimsDef: v.slice()
  28070. }];
  28071. return Yv(this, {
  28072. coordDimensions: y,
  28073. dimensionsCount: v.length + 1,
  28074. encodeDefaulter: T($u, y, this)
  28075. })
  28076. },
  28077. getBaseAxis: function() {
  28078. var t = this._baseAxisDim;
  28079. return this.ecModel.getComponent(t + "Axis", this.get(t + "AxisIndex")).axis
  28080. }
  28081. };
  28082. b(sc.extend({
  28083. type: "series.boxplot",
  28084. dependencies: ["xAxis", "yAxis", "grid"],
  28085. defaultValueDimensions: [{
  28086. name: "min",
  28087. defaultTooltip: !0
  28088. }, {
  28089. name: "Q1",
  28090. defaultTooltip: !0
  28091. }, {
  28092. name: "median",
  28093. defaultTooltip: !0
  28094. }, {
  28095. name: "Q3",
  28096. defaultTooltip: !0
  28097. }, {
  28098. name: "max",
  28099. defaultTooltip: !0
  28100. }],
  28101. dimensions: null,
  28102. defaultOption: {
  28103. zlevel: 0,
  28104. z: 2,
  28105. coordinateSystem: "cartesian2d",
  28106. legendHoverLink: !0,
  28107. hoverAnimation: !0,
  28108. layout: null,
  28109. boxWidth: [7, 50],
  28110. itemStyle: {
  28111. color: "#fff",
  28112. borderWidth: 1
  28113. },
  28114. emphasis: {
  28115. itemStyle: {
  28116. borderWidth: 2,
  28117. shadowBlur: 5,
  28118. shadowOffsetX: 2,
  28119. shadowOffsetY: 2,
  28120. shadowColor: "rgba(0,0,0,0.4)"
  28121. }
  28122. },
  28123. animationEasing: "elasticOut",
  28124. animationDuration: 800
  28125. }
  28126. }), OS, !0);
  28127. var ES = ["itemStyle"]
  28128. , RS = ["emphasis", "itemStyle"]
  28129. , zS = (_c.extend({
  28130. type: "boxplot",
  28131. render: function(t, e, i) {
  28132. var o = t.getData()
  28133. , a = this.group
  28134. , r = this._data;
  28135. this._data || a.removeAll();
  28136. var s = "horizontal" === t.get("layout") ? 1 : 0;
  28137. o.diff(r).add(function(t) {
  28138. if (o.hasValue(t)) {
  28139. var e = BS(o.getItemLayout(t), o, t, s, !0);
  28140. o.setItemGraphicEl(t, e),
  28141. a.add(e)
  28142. }
  28143. }).update(function(t, e) {
  28144. var i = r.getItemGraphicEl(e);
  28145. if (o.hasValue(t)) {
  28146. var n = o.getItemLayout(t);
  28147. i ? VS(n, i, o, t) : i = BS(n, o, t, s),
  28148. a.add(i),
  28149. o.setItemGraphicEl(t, i)
  28150. } else
  28151. a.remove(i)
  28152. }).remove(function(t) {
  28153. var e = r.getItemGraphicEl(t);
  28154. e && a.remove(e)
  28155. }).execute(),
  28156. this._data = o
  28157. },
  28158. remove: function(t) {
  28159. var e = this.group
  28160. , i = this._data;
  28161. this._data = null,
  28162. i && i.eachItemGraphicEl(function(t) {
  28163. t && e.remove(t)
  28164. })
  28165. },
  28166. dispose: et
  28167. }),
  28168. Ar.extend({
  28169. type: "boxplotBoxPath",
  28170. shape: {},
  28171. buildPath: function(t, e) {
  28172. var i = e.points
  28173. , n = 0;
  28174. for (t.moveTo(i[n][0], i[n][1]),
  28175. n++; n < 4; n++)
  28176. t.lineTo(i[n][0], i[n][1]);
  28177. for (t.closePath(); n < i.length; n++)
  28178. t.moveTo(i[n][0], i[n][1]),
  28179. n++,
  28180. t.lineTo(i[n][0], i[n][1])
  28181. }
  28182. }));
  28183. function BS(t, e, i, n, o) {
  28184. var a = t.ends
  28185. , r = new zS({
  28186. shape: {
  28187. points: o ? function(t, e, i) {
  28188. return O(t, function(t) {
  28189. return (t = t.slice())[e] = i.initBaseline,
  28190. t
  28191. })
  28192. }(a, n, t) : a
  28193. }
  28194. });
  28195. return VS(t, r, e, i, o),
  28196. r
  28197. }
  28198. function VS(t, e, i, n, o) {
  28199. var a = i.hostModel;
  28200. (0,
  28201. bl[o ? "initProps" : "updateProps"])(e, {
  28202. shape: {
  28203. points: t.ends
  28204. }
  28205. }, a, n);
  28206. var r = i.getItemModel(n)
  28207. , s = r.getModel(ES)
  28208. , l = i.getItemVisual(n, "color")
  28209. , u = s.getItemStyle(["borderColor"]);
  28210. u.stroke = l,
  28211. u.strokeNoScale = !0,
  28212. e.useStyle(u),
  28213. e.z2 = 100,
  28214. $s(e, r.getModel(RS).getItemStyle())
  28215. }
  28216. var GS = ["itemStyle", "borderColor"]
  28217. , FS = E;
  28218. Sf(function(n, t) {
  28219. var o = n.get("color");
  28220. n.eachRawSeriesByType("boxplot", function(t) {
  28221. var e = o[t.seriesIndex % o.length]
  28222. , i = t.getData();
  28223. i.setVisual({
  28224. legendSymbol: "roundRect",
  28225. color: t.get(GS) || e
  28226. }),
  28227. n.isSeriesFiltered(t) || i.each(function(t) {
  28228. var e = i.getItemModel(t);
  28229. i.setItemVisual(t, {
  28230. color: e.get(GS, !0)
  28231. })
  28232. })
  28233. })
  28234. }),
  28235. bf(function(t) {
  28236. var e = function(t) {
  28237. var n = []
  28238. , o = [];
  28239. return t.eachSeriesByType("boxplot", function(t) {
  28240. var e = t.getBaseAxis()
  28241. , i = _(o, e);
  28242. i < 0 && (i = o.length,
  28243. o[i] = e,
  28244. n[i] = {
  28245. axis: e,
  28246. seriesModels: []
  28247. }),
  28248. n[i].seriesModels.push(t)
  28249. }),
  28250. n
  28251. }(t);
  28252. FS(e, function(i) {
  28253. var t = i.seriesModels;
  28254. t.length && (function(t) {
  28255. var e, i, n = t.axis, o = t.seriesModels, a = o.length, r = t.boxWidthList = [], s = t.boxOffsetList = [], l = [];
  28256. if ("category" === n.type)
  28257. i = n.getBandWidth();
  28258. else {
  28259. var u = 0;
  28260. FS(o, function(t) {
  28261. u = Math.max(u, t.getData().count())
  28262. }),
  28263. e = n.getExtent(),
  28264. Math.abs(e[1] - e[0])
  28265. }
  28266. FS(o, function(t) {
  28267. var e = t.get("boxWidth");
  28268. L(e) || (e = [e, e]),
  28269. l.push([Rl(e[0], i) || 0, Rl(e[1], i) || 0])
  28270. });
  28271. var h = .8 * i - 2
  28272. , c = h / a * .3
  28273. , d = (h - c * (a - 1)) / a
  28274. , f = d / 2 - h / 2;
  28275. FS(o, function(t, e) {
  28276. s.push(f),
  28277. f += c + d,
  28278. r.push(Math.min(Math.max(d, l[e][0]), l[e][1]))
  28279. })
  28280. }(i),
  28281. FS(t, function(t, e) {
  28282. !function(t, r, e) {
  28283. var s = t.coordinateSystem
  28284. , l = t.getData()
  28285. , a = e / 2
  28286. , u = "horizontal" === t.get("layout") ? 0 : 1
  28287. , h = 1 - u
  28288. , i = ["x", "y"]
  28289. , n = l.mapDimension(i[u])
  28290. , o = l.mapDimension(i[h], !0);
  28291. if (null == n || o.length < 5)
  28292. return;
  28293. for (var c = 0; c < l.count(); c++) {
  28294. var d = l.get(n, c)
  28295. , f = x(d, o[2], c)
  28296. , p = x(d, o[0], c)
  28297. , g = x(d, o[1], c)
  28298. , m = x(d, o[3], c)
  28299. , v = x(d, o[4], c)
  28300. , y = [];
  28301. _(y, g, 0),
  28302. _(y, m, 1),
  28303. y.push(p, g, v, m),
  28304. w(y, p),
  28305. w(y, v),
  28306. w(y, f),
  28307. l.setItemLayout(c, {
  28308. initBaseline: f[h],
  28309. ends: y
  28310. })
  28311. }
  28312. function x(t, e, i) {
  28313. var n, o = l.get(e, i), a = [];
  28314. return a[u] = t,
  28315. a[h] = o,
  28316. isNaN(t) || isNaN(o) ? n = [NaN, NaN] : (n = s.dataToPoint(a))[u] += r,
  28317. n
  28318. }
  28319. function _(t, e, i) {
  28320. var n = e.slice()
  28321. , o = e.slice();
  28322. n[u] += a,
  28323. o[u] -= a,
  28324. i ? t.push(n, o) : t.push(o, n)
  28325. }
  28326. function w(t, e) {
  28327. var i = e.slice()
  28328. , n = e.slice();
  28329. i[u] -= a,
  28330. n[u] += a,
  28331. t.push(i, n)
  28332. }
  28333. }(t, i.boxOffsetList[e], i.boxWidthList[e])
  28334. }))
  28335. })
  28336. }),
  28337. b(sc.extend({
  28338. type: "series.candlestick",
  28339. dependencies: ["xAxis", "yAxis", "grid"],
  28340. defaultValueDimensions: [{
  28341. name: "open",
  28342. defaultTooltip: !0
  28343. }, {
  28344. name: "close",
  28345. defaultTooltip: !0
  28346. }, {
  28347. name: "lowest",
  28348. defaultTooltip: !0
  28349. }, {
  28350. name: "highest",
  28351. defaultTooltip: !0
  28352. }],
  28353. dimensions: null,
  28354. defaultOption: {
  28355. zlevel: 0,
  28356. z: 2,
  28357. coordinateSystem: "cartesian2d",
  28358. legendHoverLink: !0,
  28359. hoverAnimation: !0,
  28360. layout: null,
  28361. clip: !0,
  28362. itemStyle: {
  28363. color: "#c23531",
  28364. color0: "#314656",
  28365. borderWidth: 1,
  28366. borderColor: "#c23531",
  28367. borderColor0: "#314656"
  28368. },
  28369. emphasis: {
  28370. itemStyle: {
  28371. borderWidth: 2
  28372. }
  28373. },
  28374. barMaxWidth: null,
  28375. barMinWidth: null,
  28376. barWidth: null,
  28377. large: !0,
  28378. largeThreshold: 600,
  28379. progressive: 3e3,
  28380. progressiveThreshold: 1e4,
  28381. progressiveChunkMode: "mod",
  28382. animationUpdate: !1,
  28383. animationEasing: "linear",
  28384. animationDuration: 300
  28385. },
  28386. getShadowDim: function() {
  28387. return "open"
  28388. },
  28389. brushSelector: function(t, e, i) {
  28390. var n = e.getItemLayout(t);
  28391. return n && i.rect(n.brushRect)
  28392. }
  28393. }), OS, !0);
  28394. var WS = ["itemStyle"]
  28395. , HS = ["emphasis", "itemStyle"]
  28396. , ZS = ["color", "color0", "borderColor", "borderColor0"]
  28397. , US = (_c.extend({
  28398. type: "candlestick",
  28399. render: function(t, e, i) {
  28400. this.group.removeClipPath(),
  28401. this._updateDrawMode(t),
  28402. this._isLargeDraw ? this._renderLarge(t) : this._renderNormal(t)
  28403. },
  28404. incrementalPrepareRender: function(t, e, i) {
  28405. this._clear(),
  28406. this._updateDrawMode(t)
  28407. },
  28408. incrementalRender: function(t, e, i, n) {
  28409. this._isLargeDraw ? this._incrementalRenderLarge(t, e) : this._incrementalRenderNormal(t, e)
  28410. },
  28411. _updateDrawMode: function(t) {
  28412. var e = t.pipelineContext.large;
  28413. (null == this._isLargeDraw || e ^ this._isLargeDraw) && (this._isLargeDraw = e,
  28414. this._clear())
  28415. },
  28416. _renderNormal: function(o) {
  28417. var a = o.getData()
  28418. , r = this._data
  28419. , s = this.group
  28420. , l = a.getLayout("isSimpleBox")
  28421. , u = o.get("clip", !0)
  28422. , t = o.coordinateSystem
  28423. , h = t.getArea && t.getArea();
  28424. this._data || s.removeAll(),
  28425. a.diff(r).add(function(t) {
  28426. if (a.hasValue(t)) {
  28427. var e, i = a.getItemLayout(t);
  28428. if (u && YS(h, i))
  28429. return;
  28430. dl(e = XS(i, t, !0), {
  28431. shape: {
  28432. points: i.ends
  28433. }
  28434. }, o, t),
  28435. jS(e, a, t, l),
  28436. s.add(e),
  28437. a.setItemGraphicEl(t, e)
  28438. }
  28439. }).update(function(t, e) {
  28440. var i = r.getItemGraphicEl(e);
  28441. if (a.hasValue(t)) {
  28442. var n = a.getItemLayout(t);
  28443. u && YS(h, n) ? s.remove(i) : (i ? cl(i, {
  28444. shape: {
  28445. points: n.ends
  28446. }
  28447. }, o, t) : i = XS(n, t),
  28448. jS(i, a, t, l),
  28449. s.add(i),
  28450. a.setItemGraphicEl(t, i))
  28451. } else
  28452. s.remove(i)
  28453. }).remove(function(t) {
  28454. var e = r.getItemGraphicEl(t);
  28455. e && s.remove(e)
  28456. }).execute(),
  28457. this._data = a
  28458. },
  28459. _renderLarge: function(t) {
  28460. this._clear(),
  28461. KS(t, this.group);
  28462. var e = t.get("clip", !0) ? Sm(t.coordinateSystem, !1, t) : null;
  28463. e ? this.group.setClipPath(e) : this.group.removeClipPath()
  28464. },
  28465. _incrementalRenderNormal: function(t, e) {
  28466. for (var i, n = e.getData(), o = n.getLayout("isSimpleBox"); null != (i = t.next()); ) {
  28467. var a;
  28468. jS(a = XS(n.getItemLayout(i), i), n, i, o),
  28469. a.incremental = !0,
  28470. this.group.add(a)
  28471. }
  28472. },
  28473. _incrementalRenderLarge: function(t, e) {
  28474. KS(e, this.group, !0)
  28475. },
  28476. remove: function(t) {
  28477. this._clear()
  28478. },
  28479. _clear: function() {
  28480. this.group.removeAll(),
  28481. this._data = null
  28482. },
  28483. dispose: et
  28484. }),
  28485. Ar.extend({
  28486. type: "normalCandlestickBox",
  28487. shape: {},
  28488. buildPath: function(t, e) {
  28489. var i = e.points;
  28490. this.__simpleBox ? (t.moveTo(i[4][0], i[4][1]),
  28491. t.lineTo(i[6][0], i[6][1])) : (t.moveTo(i[0][0], i[0][1]),
  28492. t.lineTo(i[1][0], i[1][1]),
  28493. t.lineTo(i[2][0], i[2][1]),
  28494. t.lineTo(i[3][0], i[3][1]),
  28495. t.closePath(),
  28496. t.moveTo(i[4][0], i[4][1]),
  28497. t.lineTo(i[5][0], i[5][1]),
  28498. t.moveTo(i[6][0], i[6][1]),
  28499. t.lineTo(i[7][0], i[7][1]))
  28500. }
  28501. }));
  28502. function XS(t, e, i) {
  28503. var n = t.ends;
  28504. return new US({
  28505. shape: {
  28506. points: i ? function(t, e) {
  28507. return O(t, function(t) {
  28508. return (t = t.slice())[1] = e.initBaseline,
  28509. t
  28510. })
  28511. }(n, t) : n
  28512. },
  28513. z2: 100
  28514. })
  28515. }
  28516. function YS(t, e) {
  28517. for (var i = !0, n = 0; n < e.ends.length; n++)
  28518. if (t.contain(e.ends[n][0], e.ends[n][1])) {
  28519. i = !1;
  28520. break
  28521. }
  28522. return i
  28523. }
  28524. function jS(t, e, i, n) {
  28525. var o = e.getItemModel(i)
  28526. , a = o.getModel(WS)
  28527. , r = e.getItemVisual(i, "color")
  28528. , s = e.getItemVisual(i, "borderColor") || r
  28529. , l = a.getItemStyle(ZS);
  28530. t.useStyle(l),
  28531. t.style.strokeNoScale = !0,
  28532. t.style.fill = r,
  28533. t.style.stroke = s,
  28534. t.__simpleBox = n,
  28535. $s(t, o.getModel(HS).getItemStyle())
  28536. }
  28537. var qS = Ar.extend({
  28538. type: "largeCandlestickBox",
  28539. shape: {},
  28540. buildPath: function(t, e) {
  28541. for (var i = e.points, n = 0; n < i.length; )
  28542. if (this.__sign === i[n++]) {
  28543. var o = i[n++];
  28544. t.moveTo(o, i[n++]),
  28545. t.lineTo(o, i[n++])
  28546. } else
  28547. n += 3
  28548. }
  28549. });
  28550. function KS(t, e, i) {
  28551. var n = t.getData()
  28552. , o = n.getLayout("largePoints")
  28553. , a = new qS({
  28554. shape: {
  28555. points: o
  28556. },
  28557. __sign: 1
  28558. });
  28559. e.add(a);
  28560. var r = new qS({
  28561. shape: {
  28562. points: o
  28563. },
  28564. __sign: -1
  28565. });
  28566. e.add(r),
  28567. $S(1, a, t, n),
  28568. $S(-1, r, t, n),
  28569. i && (a.incremental = !0,
  28570. r.incremental = !0)
  28571. }
  28572. function $S(t, e, i, n) {
  28573. var o = 0 < t ? "P" : "N"
  28574. , a = n.getVisual("borderColor" + o) || n.getVisual("color" + o)
  28575. , r = i.getModel(WS).getItemStyle(ZS);
  28576. e.useStyle(r),
  28577. e.style.fill = null,
  28578. e.style.stroke = a
  28579. }
  28580. var JS = ["itemStyle", "borderColor"]
  28581. , QS = ["itemStyle", "borderColor0"]
  28582. , tM = ["itemStyle", "color"]
  28583. , eM = ["itemStyle", "color0"]
  28584. , iM = {
  28585. seriesType: "candlestick",
  28586. plan: vc(),
  28587. performRawSeries: !0,
  28588. reset: function(t, e) {
  28589. if (t.getData().setVisual({
  28590. legendSymbol: "roundRect",
  28591. colorP: a(1, t),
  28592. colorN: a(-1, t),
  28593. borderColorP: r(1, t),
  28594. borderColorN: r(-1, t)
  28595. }),
  28596. !e.isSeriesFiltered(t))
  28597. return !t.pipelineContext.large && {
  28598. progress: function(t, e) {
  28599. var i;
  28600. for (; null != (i = t.next()); ) {
  28601. var n = e.getItemModel(i)
  28602. , o = e.getItemLayout(i).sign;
  28603. e.setItemVisual(i, {
  28604. color: a(o, n),
  28605. borderColor: r(o, n)
  28606. })
  28607. }
  28608. }
  28609. };
  28610. function a(t, e) {
  28611. return e.get(0 < t ? tM : eM)
  28612. }
  28613. function r(t, e) {
  28614. return e.get(0 < t ? JS : QS)
  28615. }
  28616. }
  28617. }
  28618. , nM = "undefined" != typeof Float32Array ? Float32Array : Array
  28619. , oM = {
  28620. seriesType: "candlestick",
  28621. plan: vc(),
  28622. reset: function(t) {
  28623. var x = t.coordinateSystem
  28624. , e = t.getData()
  28625. , _ = function(t, e) {
  28626. var i, n = t.getBaseAxis(), o = "category" === n.type ? n.getBandWidth() : (i = n.getExtent(),
  28627. Math.abs(i[1] - i[0]) / e.count()), a = Rl(H(t.get("barMaxWidth"), o), o), r = Rl(H(t.get("barMinWidth"), 1), o), s = t.get("barWidth");
  28628. return null != s ? Rl(s, o) : Math.max(Math.min(o / 2, a), r)
  28629. }(t, e)
  28630. , i = ["x", "y"]
  28631. , w = e.mapDimension(i[0])
  28632. , n = e.mapDimension(i[1], !0)
  28633. , b = n[0]
  28634. , S = n[1]
  28635. , M = n[2]
  28636. , I = n[3];
  28637. if (e.setLayout({
  28638. candleWidth: _,
  28639. isSimpleBox: _ <= 1.3
  28640. }),
  28641. !(null == w || n.length < 4))
  28642. return {
  28643. progress: t.pipelineContext.large ? function(t, e) {
  28644. var i, n, o = new nM(4 * t.count), a = 0, r = [], s = [];
  28645. for (; null != (n = t.next()); ) {
  28646. var l = e.get(w, n)
  28647. , u = e.get(b, n)
  28648. , h = e.get(S, n)
  28649. , c = e.get(M, n)
  28650. , d = e.get(I, n);
  28651. isNaN(l) || isNaN(c) || isNaN(d) ? (o[a++] = NaN,
  28652. a += 3) : (o[a++] = aM(e, n, u, h, S),
  28653. r[0] = l,
  28654. r[1] = c,
  28655. i = x.dataToPoint(r, null, s),
  28656. o[a++] = i ? i[0] : NaN,
  28657. o[a++] = i ? i[1] : NaN,
  28658. r[1] = d,
  28659. i = x.dataToPoint(r, null, s),
  28660. o[a++] = i ? i[1] : NaN)
  28661. }
  28662. e.setLayout("largePoints", o)
  28663. }
  28664. : function(t, e) {
  28665. var i;
  28666. for (; null != (i = t.next()); ) {
  28667. var n = e.get(w, i)
  28668. , o = e.get(b, i)
  28669. , a = e.get(S, i)
  28670. , r = e.get(M, i)
  28671. , s = e.get(I, i)
  28672. , l = Math.min(o, a)
  28673. , u = Math.max(o, a)
  28674. , h = g(l, n)
  28675. , c = g(u, n)
  28676. , d = g(r, n)
  28677. , f = g(s, n)
  28678. , p = [];
  28679. m(p, c, 0),
  28680. m(p, h, 1),
  28681. p.push(y(f), y(c), y(d), y(h)),
  28682. e.setItemLayout(i, {
  28683. sign: aM(e, i, o, a, S),
  28684. initBaseline: a < o ? c[1] : h[1],
  28685. ends: p,
  28686. brushRect: v(r, s, n)
  28687. })
  28688. }
  28689. function g(t, e) {
  28690. var i = [];
  28691. return i[0] = e,
  28692. i[1] = t,
  28693. isNaN(e) || isNaN(t) ? [NaN, NaN] : x.dataToPoint(i)
  28694. }
  28695. function m(t, e, i) {
  28696. var n = e.slice()
  28697. , o = e.slice();
  28698. n[0] = zs(n[0] + _ / 2, 1, !1),
  28699. o[0] = zs(o[0] - _ / 2, 1, !0),
  28700. i ? t.push(n, o) : t.push(o, n)
  28701. }
  28702. function v(t, e, i) {
  28703. var n = g(t, i)
  28704. , o = g(e, i);
  28705. return n[0] -= _ / 2,
  28706. o[0] -= _ / 2,
  28707. {
  28708. x: n[0],
  28709. y: n[1],
  28710. width: _,
  28711. height: o[1] - n[1]
  28712. }
  28713. }
  28714. function y(t) {
  28715. return t[0] = zs(t[0], 1),
  28716. t
  28717. }
  28718. }
  28719. }
  28720. }
  28721. };
  28722. function aM(t, e, i, n, o) {
  28723. return n < i ? -1 : i < n ? 1 : 0 < e ? t.get(o, e - 1) <= n ? 1 : -1 : 1
  28724. }
  28725. yf(function(t) {
  28726. t && L(t.series) && E(t.series, function(t) {
  28727. z(t) && "k" === t.type && (t.type = "candlestick")
  28728. })
  28729. }),
  28730. Sf(iM),
  28731. bf(oM),
  28732. sc.extend({
  28733. type: "series.effectScatter",
  28734. dependencies: ["grid", "polar"],
  28735. getInitialData: function(t, e) {
  28736. return gp(this.getSource(), this, {
  28737. useEncodeDefaulter: !0
  28738. })
  28739. },
  28740. brushSelector: "point",
  28741. defaultOption: {
  28742. coordinateSystem: "cartesian2d",
  28743. zlevel: 0,
  28744. z: 2,
  28745. legendHoverLink: !0,
  28746. effectType: "ripple",
  28747. progressive: 0,
  28748. showEffectOn: "render",
  28749. rippleEffect: {
  28750. period: 4,
  28751. scale: 2.5,
  28752. brushType: "fill"
  28753. },
  28754. symbolSize: 10
  28755. }
  28756. });
  28757. function rM(t, e) {
  28758. var i = e.rippleEffectColor || e.color;
  28759. t.eachChild(function(t) {
  28760. t.attr({
  28761. z: e.z,
  28762. zlevel: e.zlevel,
  28763. style: {
  28764. stroke: "stroke" === e.brushType ? i : null,
  28765. fill: "fill" === e.brushType ? i : null
  28766. }
  28767. })
  28768. })
  28769. }
  28770. function sM(t, e) {
  28771. Ci.call(this);
  28772. var i = new Xg(t,e)
  28773. , n = new Ci;
  28774. this.add(i),
  28775. this.add(n),
  28776. n.beforeUpdate = function() {
  28777. this.attr(i.getScale())
  28778. }
  28779. ,
  28780. this.updateData(t, e)
  28781. }
  28782. var lM = sM.prototype;
  28783. lM.stopEffectAnimation = function() {
  28784. this.childAt(1).removeAll()
  28785. }
  28786. ,
  28787. lM.startEffectAnimation = function(t) {
  28788. for (var e = t.symbolType, i = t.color, n = this.childAt(1), o = 0; o < 3; o++) {
  28789. var a = wg(e, -1, -1, 2, 2, i);
  28790. a.attr({
  28791. style: {
  28792. strokeNoScale: !0
  28793. },
  28794. z2: 99,
  28795. silent: !0,
  28796. scale: [.5, .5]
  28797. });
  28798. var r = -o / 3 * t.period + t.effectOffset;
  28799. a.animate("", !0).when(t.period, {
  28800. scale: [t.rippleScale / 2, t.rippleScale / 2]
  28801. }).delay(r).start(),
  28802. a.animateStyle(!0).when(t.period, {
  28803. opacity: 0
  28804. }).delay(r).start(),
  28805. n.add(a)
  28806. }
  28807. rM(n, t)
  28808. }
  28809. ,
  28810. lM.updateEffectAnimation = function(t) {
  28811. for (var e = this._effectCfg, i = this.childAt(1), n = ["symbolType", "period", "rippleScale"], o = 0; o < n.length; o++) {
  28812. var a = n[o];
  28813. if (e[a] !== t[a])
  28814. return this.stopEffectAnimation(),
  28815. void this.startEffectAnimation(t)
  28816. }
  28817. rM(i, t)
  28818. }
  28819. ,
  28820. lM.highlight = function() {
  28821. this.trigger("emphasis")
  28822. }
  28823. ,
  28824. lM.downplay = function() {
  28825. this.trigger("normal")
  28826. }
  28827. ,
  28828. lM.updateData = function(t, e) {
  28829. var i = t.hostModel;
  28830. this.childAt(0).updateData(t, e);
  28831. var n = this.childAt(1)
  28832. , o = t.getItemModel(e)
  28833. , a = t.getItemVisual(e, "symbol")
  28834. , r = function(t) {
  28835. return L(t) || (t = [+t, +t]),
  28836. t
  28837. }(t.getItemVisual(e, "symbolSize"))
  28838. , s = t.getItemVisual(e, "color");
  28839. n.attr("scale", r),
  28840. n.traverse(function(t) {
  28841. t.attr({
  28842. fill: s
  28843. })
  28844. });
  28845. var l = o.getShallow("symbolOffset");
  28846. if (l) {
  28847. var u = n.position;
  28848. u[0] = Rl(l[0], r[0]),
  28849. u[1] = Rl(l[1], r[1])
  28850. }
  28851. var h = t.getItemVisual(e, "symbolRotate");
  28852. n.rotation = (h || 0) * Math.PI / 180 || 0;
  28853. var c = {};
  28854. if (c.showEffectOn = i.get("showEffectOn"),
  28855. c.rippleScale = o.get("rippleEffect.scale"),
  28856. c.brushType = o.get("rippleEffect.brushType"),
  28857. c.period = 1e3 * o.get("rippleEffect.period"),
  28858. c.effectOffset = e / t.count(),
  28859. c.z = o.getShallow("z") || 0,
  28860. c.zlevel = o.getShallow("zlevel") || 0,
  28861. c.symbolType = a,
  28862. c.color = s,
  28863. c.rippleEffectColor = o.get("rippleEffect.color"),
  28864. this.off("mouseover").off("mouseout").off("emphasis").off("normal"),
  28865. "render" === c.showEffectOn)
  28866. this._effectCfg ? this.updateEffectAnimation(c) : this.startEffectAnimation(c),
  28867. this._effectCfg = c;
  28868. else {
  28869. this._effectCfg = null,
  28870. this.stopEffectAnimation();
  28871. var d = this.childAt(0)
  28872. , f = function() {
  28873. d.highlight(),
  28874. "render" !== c.showEffectOn && this.startEffectAnimation(c)
  28875. }
  28876. , p = function() {
  28877. d.downplay(),
  28878. "render" !== c.showEffectOn && this.stopEffectAnimation()
  28879. };
  28880. this.on("mouseover", f, this).on("mouseout", p, this).on("emphasis", f, this).on("normal", p, this)
  28881. }
  28882. this._effectCfg = c
  28883. }
  28884. ,
  28885. lM.fadeOut = function(t) {
  28886. this.off("mouseover").off("mouseout").off("emphasis").off("normal"),
  28887. t && t()
  28888. }
  28889. ,
  28890. w(sM, Ci),
  28891. Cf({
  28892. type: "effectScatter",
  28893. init: function() {
  28894. this._symbolDraw = new im(sM)
  28895. },
  28896. render: function(t, e, i) {
  28897. var n = t.getData()
  28898. , o = this._symbolDraw;
  28899. o.updateData(n),
  28900. this.group.add(o.group)
  28901. },
  28902. updateTransform: function(t, e, i) {
  28903. var n = t.getData();
  28904. this.group.dirty();
  28905. var o = km().reset(t);
  28906. o.progress && o.progress({
  28907. start: 0,
  28908. end: n.count()
  28909. }, n),
  28910. this._symbolDraw.updateLayout(n)
  28911. },
  28912. _updateGroupTransform: function(t) {
  28913. var e = t.coordinateSystem;
  28914. e && e.getRoamTransform && (this.group.transform = fe(e.getRoamTransform()),
  28915. this.group.decomposeTransform())
  28916. },
  28917. remove: function(t, e) {
  28918. this._symbolDraw && this._symbolDraw.remove(e)
  28919. },
  28920. dispose: function() {}
  28921. }),
  28922. Sf(Lm("effectScatter", "circle")),
  28923. bf(km("effectScatter"));
  28924. var uM = "undefined" == typeof Uint32Array ? Array : Uint32Array
  28925. , hM = "undefined" == typeof Float64Array ? Array : Float64Array;
  28926. function cM(t) {
  28927. var e = t.data;
  28928. e && e[0] && e[0][0] && e[0][0].coord && (t.data = O(e, function(t) {
  28929. var e = {
  28930. coords: [t[0].coord, t[1].coord]
  28931. };
  28932. return t[0].name && (e.fromName = t[0].name),
  28933. t[1].name && (e.toName = t[1].name),
  28934. p([e, t[0], t[1]])
  28935. }))
  28936. }
  28937. var dM = sc.extend({
  28938. type: "series.lines",
  28939. dependencies: ["grid", "polar"],
  28940. visualColorAccessPath: "lineStyle.color",
  28941. init: function(t) {
  28942. t.data = t.data || [],
  28943. cM(t);
  28944. var e = this._processFlatCoordsArray(t.data);
  28945. this._flatCoords = e.flatCoords,
  28946. this._flatCoordsOffset = e.flatCoordsOffset,
  28947. e.flatCoords && (t.data = new Float32Array(e.count)),
  28948. dM.superApply(this, "init", arguments)
  28949. },
  28950. mergeOption: function(t) {
  28951. if (t.data = t.data || [],
  28952. cM(t),
  28953. t.data) {
  28954. var e = this._processFlatCoordsArray(t.data);
  28955. this._flatCoords = e.flatCoords,
  28956. this._flatCoordsOffset = e.flatCoordsOffset,
  28957. e.flatCoords && (t.data = new Float32Array(e.count))
  28958. }
  28959. dM.superApply(this, "mergeOption", arguments)
  28960. },
  28961. appendData: function(t) {
  28962. var e = this._processFlatCoordsArray(t.data);
  28963. e.flatCoords && (this._flatCoords ? (this._flatCoords = tt(this._flatCoords, e.flatCoords),
  28964. this._flatCoordsOffset = tt(this._flatCoordsOffset, e.flatCoordsOffset)) : (this._flatCoords = e.flatCoords,
  28965. this._flatCoordsOffset = e.flatCoordsOffset),
  28966. t.data = new Float32Array(e.count)),
  28967. this.getRawData().appendData(t.data)
  28968. },
  28969. _getCoordsFromItemModel: function(t) {
  28970. var e = this.getData().getItemModel(t);
  28971. return e.option instanceof Array ? e.option : e.getShallow("coords")
  28972. },
  28973. getLineCoordsCount: function(t) {
  28974. return this._flatCoordsOffset ? this._flatCoordsOffset[2 * t + 1] : this._getCoordsFromItemModel(t).length
  28975. },
  28976. getLineCoords: function(t, e) {
  28977. if (this._flatCoordsOffset) {
  28978. for (var i = this._flatCoordsOffset[2 * t], n = this._flatCoordsOffset[2 * t + 1], o = 0; o < n; o++)
  28979. e[o] = e[o] || [],
  28980. e[o][0] = this._flatCoords[i + 2 * o],
  28981. e[o][1] = this._flatCoords[i + 2 * o + 1];
  28982. return n
  28983. }
  28984. var a = this._getCoordsFromItemModel(t);
  28985. for (o = 0; o < a.length; o++)
  28986. e[o] = e[o] || [],
  28987. e[o][0] = a[o][0],
  28988. e[o][1] = a[o][1];
  28989. return a.length
  28990. },
  28991. _processFlatCoordsArray: function(t) {
  28992. var e = 0;
  28993. if (this._flatCoords && (e = this._flatCoords.length),
  28994. "number" != typeof t[0])
  28995. return {
  28996. flatCoordsOffset: null,
  28997. flatCoords: null,
  28998. count: t.length
  28999. };
  29000. for (var i = t.length, n = new uM(i), o = new hM(i), a = 0, r = 0, s = 0, l = 0; l < i; ) {
  29001. s++;
  29002. var u = t[l++];
  29003. n[r++] = a + e,
  29004. n[r++] = u;
  29005. for (var h = 0; h < u; h++) {
  29006. var c = t[l++]
  29007. , d = t[l++];
  29008. o[a++] = c,
  29009. o[a++] = d
  29010. }
  29011. }
  29012. return {
  29013. flatCoordsOffset: new Uint32Array(n.buffer,0,r),
  29014. flatCoords: o,
  29015. count: s
  29016. }
  29017. },
  29018. getInitialData: function(t, e) {
  29019. var a = new Yf(["value"],this);
  29020. return a.hasItemOption = !1,
  29021. a.initData(t.data, [], function(t, e, i, n) {
  29022. if (t instanceof Array)
  29023. return NaN;
  29024. a.hasItemOption = !0;
  29025. var o = t.value;
  29026. return null != o ? o instanceof Array ? o[n] : o : void 0
  29027. }),
  29028. a
  29029. },
  29030. formatTooltip: function(t) {
  29031. var e = this.getData().getItemModel(t)
  29032. , i = e.get("name");
  29033. if (i)
  29034. return i;
  29035. var n = e.get("fromName")
  29036. , o = e.get("toName")
  29037. , a = [];
  29038. return null != n && a.push(n),
  29039. null != o && a.push(o),
  29040. au(a.join(" > "))
  29041. },
  29042. preventIncremental: function() {
  29043. return !!this.get("effect.show")
  29044. },
  29045. getProgressive: function() {
  29046. var t = this.option.progressive;
  29047. return null == t ? this.option.large ? 1e4 : this.get("progressive") : t
  29048. },
  29049. getProgressiveThreshold: function() {
  29050. var t = this.option.progressiveThreshold;
  29051. return null == t ? this.option.large ? 2e4 : this.get("progressiveThreshold") : t
  29052. },
  29053. defaultOption: {
  29054. coordinateSystem: "geo",
  29055. zlevel: 0,
  29056. z: 2,
  29057. legendHoverLink: !0,
  29058. hoverAnimation: !0,
  29059. xAxisIndex: 0,
  29060. yAxisIndex: 0,
  29061. symbol: ["none", "none"],
  29062. symbolSize: [10, 10],
  29063. geoIndex: 0,
  29064. effect: {
  29065. show: !1,
  29066. period: 4,
  29067. constantSpeed: 0,
  29068. symbol: "circle",
  29069. symbolSize: 3,
  29070. loop: !0,
  29071. trailLength: .2
  29072. },
  29073. large: !1,
  29074. largeThreshold: 2e3,
  29075. polyline: !1,
  29076. clip: !0,
  29077. label: {
  29078. show: !1,
  29079. position: "end"
  29080. },
  29081. lineStyle: {
  29082. opacity: .5
  29083. }
  29084. }
  29085. });
  29086. function fM(t, e, i) {
  29087. Ci.call(this),
  29088. this.add(this.createLine(t, e, i)),
  29089. this._updateEffectSymbol(t, e)
  29090. }
  29091. var pM = fM.prototype;
  29092. function gM(t, e, i) {
  29093. Ci.call(this),
  29094. this._createPolyline(t, e, i)
  29095. }
  29096. pM.createLine = function(t, e, i) {
  29097. return new dw(t,e,i)
  29098. }
  29099. ,
  29100. pM._updateEffectSymbol = function(t, e) {
  29101. var i = t.getItemModel(e).getModel("effect")
  29102. , n = i.get("symbolSize")
  29103. , o = i.get("symbol");
  29104. L(n) || (n = [n, n]);
  29105. var a = i.get("color") || t.getItemVisual(e, "color")
  29106. , r = this.childAt(1);
  29107. this._symbolType !== o && (this.remove(r),
  29108. (r = wg(o, -.5, -.5, 1, 1, a)).z2 = 100,
  29109. r.culling = !0,
  29110. this.add(r)),
  29111. r && (r.setStyle("shadowColor", a),
  29112. r.setStyle(i.getItemStyle(["color"])),
  29113. r.attr("scale", n),
  29114. r.setColor(a),
  29115. r.attr("scale", n),
  29116. this._symbolType = o,
  29117. this._symbolScale = n,
  29118. this._updateEffectAnimation(t, i, e))
  29119. }
  29120. ,
  29121. pM._updateEffectAnimation = function(e, t, i) {
  29122. var n = this.childAt(1);
  29123. if (n) {
  29124. var o = this
  29125. , a = e.getItemLayout(i)
  29126. , r = 1e3 * t.get("period")
  29127. , s = t.get("loop")
  29128. , l = t.get("constantSpeed")
  29129. , u = W(t.get("delay"), function(t) {
  29130. return t / e.count() * r / 3
  29131. })
  29132. , h = "function" == typeof u;
  29133. if (n.ignore = !0,
  29134. this.updateAnimationPoints(n, a),
  29135. 0 < l && (r = this.getLineLength(n) / l * 1e3),
  29136. r !== this._period || s !== this._loop) {
  29137. n.stopAnimation();
  29138. var c = u;
  29139. h && (c = u(i)),
  29140. 0 < n.__t && (c = -r * n.__t),
  29141. n.__t = 0;
  29142. var d = n.animate("", s).when(r, {
  29143. __t: 1
  29144. }).delay(c).during(function() {
  29145. o.updateSymbolPosition(n)
  29146. });
  29147. s || d.done(function() {
  29148. o.remove(n)
  29149. }),
  29150. d.start()
  29151. }
  29152. this._period = r,
  29153. this._loop = s
  29154. }
  29155. }
  29156. ,
  29157. pM.getLineLength = function(t) {
  29158. return yt(t.__p1, t.__cp1) + yt(t.__cp1, t.__p2)
  29159. }
  29160. ,
  29161. pM.updateAnimationPoints = function(t, e) {
  29162. t.__p1 = e[0],
  29163. t.__p2 = e[1],
  29164. t.__cp1 = e[2] || [(e[0][0] + e[1][0]) / 2, (e[0][1] + e[1][1]) / 2]
  29165. }
  29166. ,
  29167. pM.updateData = function(t, e, i) {
  29168. this.childAt(0).updateData(t, e, i),
  29169. this._updateEffectSymbol(t, e)
  29170. }
  29171. ,
  29172. pM.updateSymbolPosition = function(t) {
  29173. var e = t.__p1
  29174. , i = t.__p2
  29175. , n = t.__cp1
  29176. , o = t.__t
  29177. , a = t.position
  29178. , r = [a[0], a[1]]
  29179. , s = La
  29180. , l = ka;
  29181. a[0] = s(e[0], n[0], i[0], o),
  29182. a[1] = s(e[1], n[1], i[1], o);
  29183. var u = l(e[0], n[0], i[0], o)
  29184. , h = l(e[1], n[1], i[1], o);
  29185. if (t.rotation = -Math.atan2(h, u) - Math.PI / 2,
  29186. "line" === this._symbolType || "rect" === this._symbolType || "roundRect" === this._symbolType)
  29187. if (void 0 !== t.__lastT && t.__lastT < t.__t) {
  29188. var c = 1.05 * yt(r, a);
  29189. t.attr("scale", [t.scale[0], c]),
  29190. 1 === o && (a[0] = r[0] + (a[0] - r[0]) / 2,
  29191. a[1] = r[1] + (a[1] - r[1]) / 2)
  29192. } else if (1 === t.__lastT) {
  29193. c = 2 * yt(e, a);
  29194. t.attr("scale", [t.scale[0], c])
  29195. } else
  29196. t.attr("scale", this._symbolScale);
  29197. t.__lastT = t.__t,
  29198. t.ignore = !1
  29199. }
  29200. ,
  29201. pM.updateLayout = function(t, e) {
  29202. this.childAt(0).updateLayout(t, e);
  29203. var i = t.getItemModel(e).getModel("effect");
  29204. this._updateEffectAnimation(t, i, e)
  29205. }
  29206. ,
  29207. w(fM, Ci);
  29208. var mM = gM.prototype;
  29209. function vM(t, e, i) {
  29210. fM.call(this, t, e, i),
  29211. this._lastFrame = 0,
  29212. this._lastFramePercent = 0
  29213. }
  29214. mM._createPolyline = function(t, e, i) {
  29215. var n = t.getItemLayout(e)
  29216. , o = new ts({
  29217. shape: {
  29218. points: n
  29219. }
  29220. });
  29221. this.add(o),
  29222. this._updateCommonStl(t, e, i)
  29223. }
  29224. ,
  29225. mM.updateData = function(t, e, i) {
  29226. var n = t.hostModel;
  29227. cl(this.childAt(0), {
  29228. shape: {
  29229. points: t.getItemLayout(e)
  29230. }
  29231. }, n, e),
  29232. this._updateCommonStl(t, e, i)
  29233. }
  29234. ,
  29235. mM._updateCommonStl = function(t, e, i) {
  29236. var n = this.childAt(0)
  29237. , o = t.getItemModel(e)
  29238. , a = t.getItemVisual(e, "color")
  29239. , r = i && i.lineStyle
  29240. , s = i && i.hoverLineStyle;
  29241. i && !t.hasItemOption || (r = o.getModel("lineStyle").getLineStyle(),
  29242. s = o.getModel("emphasis.lineStyle").getLineStyle()),
  29243. n.useStyle(D({
  29244. strokeNoScale: !0,
  29245. fill: "none",
  29246. stroke: a
  29247. }, r)),
  29248. n.hoverStyle = s,
  29249. $s(this)
  29250. }
  29251. ,
  29252. mM.updateLayout = function(t, e) {
  29253. this.childAt(0).setShape("points", t.getItemLayout(e))
  29254. }
  29255. ,
  29256. w(gM, Ci);
  29257. var yM = vM.prototype;
  29258. yM.createLine = function(t, e, i) {
  29259. return new gM(t,e,i)
  29260. }
  29261. ,
  29262. yM.updateAnimationPoints = function(t, e) {
  29263. this._points = e;
  29264. for (var i = [0], n = 0, o = 1; o < e.length; o++) {
  29265. var a = e[o - 1]
  29266. , r = e[o];
  29267. n += yt(a, r),
  29268. i.push(n)
  29269. }
  29270. if (0 !== n) {
  29271. for (o = 0; o < i.length; o++)
  29272. i[o] /= n;
  29273. this._offsets = i,
  29274. this._length = n
  29275. }
  29276. }
  29277. ,
  29278. yM.getLineLength = function(t) {
  29279. return this._length
  29280. }
  29281. ,
  29282. yM.updateSymbolPosition = function(t) {
  29283. var e = t.__t
  29284. , i = this._points
  29285. , n = this._offsets
  29286. , o = i.length;
  29287. if (n) {
  29288. var a = this._lastFrame;
  29289. if (e < this._lastFramePercent) {
  29290. for (r = Math.min(a + 1, o - 1); 0 <= r && !(n[r] <= e); r--)
  29291. ;
  29292. r = Math.min(r, o - 2)
  29293. } else {
  29294. for (var r = a; r < o && !(n[r] > e); r++)
  29295. ;
  29296. r = Math.min(r - 1, o - 2)
  29297. }
  29298. wt(t.position, i[r], i[r + 1], (e - n[r]) / (n[r + 1] - n[r]));
  29299. var s = i[r + 1][0] - i[r][0]
  29300. , l = i[r + 1][1] - i[r][1];
  29301. t.rotation = -Math.atan2(l, s) - Math.PI / 2,
  29302. this._lastFrame = r,
  29303. this._lastFramePercent = e,
  29304. t.ignore = !1
  29305. }
  29306. }
  29307. ,
  29308. w(vM, fM);
  29309. var xM = Cs({
  29310. shape: {
  29311. polyline: !1,
  29312. curveness: 0,
  29313. segs: []
  29314. },
  29315. buildPath: function(t, e) {
  29316. var i = e.segs
  29317. , n = e.curveness;
  29318. if (e.polyline)
  29319. for (var o = 0; o < i.length; ) {
  29320. var a = i[o++];
  29321. if (0 < a) {
  29322. t.moveTo(i[o++], i[o++]);
  29323. for (var r = 1; r < a; r++)
  29324. t.lineTo(i[o++], i[o++])
  29325. }
  29326. }
  29327. else
  29328. for (o = 0; o < i.length; ) {
  29329. var s = i[o++]
  29330. , l = i[o++]
  29331. , u = i[o++]
  29332. , h = i[o++];
  29333. if (t.moveTo(s, l),
  29334. 0 < n) {
  29335. var c = (s + u) / 2 - (l - h) * n
  29336. , d = (l + h) / 2 - (u - s) * n;
  29337. t.quadraticCurveTo(c, d, u, h)
  29338. } else
  29339. t.lineTo(u, h)
  29340. }
  29341. },
  29342. findDataIndex: function(t, e) {
  29343. var i = this.shape
  29344. , n = i.segs
  29345. , o = i.curveness;
  29346. if (i.polyline)
  29347. for (var a = 0, r = 0; r < n.length; ) {
  29348. var s = n[r++];
  29349. if (0 < s)
  29350. for (var l = n[r++], u = n[r++], h = 1; h < s; h++) {
  29351. if (sr(l, u, c = n[r++], d = n[r++]))
  29352. return a
  29353. }
  29354. a++
  29355. }
  29356. else
  29357. for (a = 0,
  29358. r = 0; r < n.length; ) {
  29359. l = n[r++],
  29360. u = n[r++];
  29361. var c = n[r++]
  29362. , d = n[r++];
  29363. if (0 < o) {
  29364. if (ur(l, u, (l + c) / 2 - (u - d) * o, (u + d) / 2 - (c - l) * o, c, d))
  29365. return a
  29366. } else if (sr(l, u, c, d))
  29367. return a;
  29368. a++
  29369. }
  29370. return -1
  29371. }
  29372. });
  29373. function _M() {
  29374. this.group = new Ci
  29375. }
  29376. var wM = _M.prototype;
  29377. wM.isPersistent = function() {
  29378. return !this._incremental
  29379. }
  29380. ,
  29381. wM.updateData = function(t) {
  29382. this.group.removeAll();
  29383. var e = new xM({
  29384. rectHover: !0,
  29385. cursor: "default"
  29386. });
  29387. e.setShape({
  29388. segs: t.getLayout("linesPoints")
  29389. }),
  29390. this._setCommon(e, t),
  29391. this.group.add(e),
  29392. this._incremental = null
  29393. }
  29394. ,
  29395. wM.incrementalPrepareUpdate = function(t) {
  29396. this.group.removeAll(),
  29397. this._clearIncremental(),
  29398. 5e5 < t.count() ? (this._incremental || (this._incremental = new vs({
  29399. silent: !0
  29400. })),
  29401. this.group.add(this._incremental)) : this._incremental = null
  29402. }
  29403. ,
  29404. wM.incrementalUpdate = function(t, e) {
  29405. var i = new xM;
  29406. i.setShape({
  29407. segs: e.getLayout("linesPoints")
  29408. }),
  29409. this._setCommon(i, e, !!this._incremental),
  29410. this._incremental ? this._incremental.addDisplayable(i, !0) : (i.rectHover = !0,
  29411. i.cursor = "default",
  29412. i.__startIndex = t.start,
  29413. this.group.add(i))
  29414. }
  29415. ,
  29416. wM.remove = function() {
  29417. this._clearIncremental(),
  29418. this._incremental = null,
  29419. this.group.removeAll()
  29420. }
  29421. ,
  29422. wM._setCommon = function(i, t, e) {
  29423. var n = t.hostModel;
  29424. i.setShape({
  29425. polyline: n.get("polyline"),
  29426. curveness: n.get("lineStyle.curveness")
  29427. }),
  29428. i.useStyle(n.getModel("lineStyle").getLineStyle()),
  29429. i.style.strokeNoScale = !0;
  29430. var o = t.getVisual("color");
  29431. o && i.setStyle("stroke", o),
  29432. i.setStyle("fill"),
  29433. e || (i.seriesIndex = n.seriesIndex,
  29434. i.on("mousemove", function(t) {
  29435. i.dataIndex = null;
  29436. var e = i.findDataIndex(t.offsetX, t.offsetY);
  29437. 0 < e && (i.dataIndex = e + i.__startIndex)
  29438. }))
  29439. }
  29440. ,
  29441. wM._clearIncremental = function() {
  29442. var t = this._incremental;
  29443. t && t.clearDisplaybles()
  29444. }
  29445. ;
  29446. var bM = {
  29447. seriesType: "lines",
  29448. plan: vc(),
  29449. reset: function(g) {
  29450. var m = g.coordinateSystem
  29451. , v = g.get("polyline")
  29452. , y = g.pipelineContext.large;
  29453. return {
  29454. progress: function(t, e) {
  29455. var i = [];
  29456. if (y) {
  29457. var n, o = t.end - t.start;
  29458. if (v) {
  29459. for (var a = 0, r = t.start; r < t.end; r++)
  29460. a += g.getLineCoordsCount(r);
  29461. n = new Float32Array(o + 2 * a)
  29462. } else
  29463. n = new Float32Array(4 * o);
  29464. var s = 0
  29465. , l = [];
  29466. for (r = t.start; r < t.end; r++) {
  29467. var u = g.getLineCoords(r, i);
  29468. v && (n[s++] = u);
  29469. for (var h = 0; h < u; h++)
  29470. l = m.dataToPoint(i[h], !1, l),
  29471. n[s++] = l[0],
  29472. n[s++] = l[1]
  29473. }
  29474. e.setLayout("linesPoints", n)
  29475. } else
  29476. for (r = t.start; r < t.end; r++) {
  29477. var c = e.getItemModel(r)
  29478. , d = (u = g.getLineCoords(r, i),
  29479. []);
  29480. if (v)
  29481. for (var f = 0; f < u; f++)
  29482. d.push(m.dataToPoint(i[f]));
  29483. else {
  29484. d[0] = m.dataToPoint(i[0]),
  29485. d[1] = m.dataToPoint(i[1]);
  29486. var p = c.get("lineStyle.curveness");
  29487. +p && (d[2] = [(d[0][0] + d[1][0]) / 2 - (d[0][1] - d[1][1]) * p, (d[0][1] + d[1][1]) / 2 - (d[1][0] - d[0][0]) * p])
  29488. }
  29489. e.setItemLayout(r, d)
  29490. }
  29491. }
  29492. }
  29493. }
  29494. };
  29495. function SM(t) {
  29496. return t instanceof Array || (t = [t, t]),
  29497. t
  29498. }
  29499. Cf({
  29500. type: "lines",
  29501. init: function() {},
  29502. render: function(t, e, i) {
  29503. var n = t.getData()
  29504. , o = this._updateLineDraw(n, t)
  29505. , a = t.get("zlevel")
  29506. , r = t.get("effect.trailLength")
  29507. , s = i.getZr()
  29508. , l = "svg" === s.painter.getType();
  29509. l || s.painter.getLayer(a).clear(!0),
  29510. null == this._lastZlevel || l || s.configLayer(this._lastZlevel, {
  29511. motionBlur: !1
  29512. }),
  29513. this._showEffect(t) && r && (l || s.configLayer(a, {
  29514. motionBlur: !0,
  29515. lastFrameAlpha: Math.max(Math.min(r / 10 + .9, 1), 0)
  29516. })),
  29517. o.updateData(n);
  29518. var u = t.get("clip", !0) && Sm(t.coordinateSystem, !1, t);
  29519. u ? this.group.setClipPath(u) : this.group.removeClipPath(),
  29520. this._lastZlevel = a,
  29521. this._finished = !0
  29522. },
  29523. incrementalPrepareRender: function(t, e, i) {
  29524. var n = t.getData();
  29525. this._updateLineDraw(n, t).incrementalPrepareUpdate(n),
  29526. this._clearLayer(i),
  29527. this._finished = !1
  29528. },
  29529. incrementalRender: function(t, e, i) {
  29530. this._lineDraw.incrementalUpdate(t, e.getData()),
  29531. this._finished = t.end === e.getData().count()
  29532. },
  29533. updateTransform: function(t, e, i) {
  29534. var n = t.getData()
  29535. , o = t.pipelineContext;
  29536. if (!this._finished || o.large || o.progressiveRender)
  29537. return {
  29538. update: !0
  29539. };
  29540. var a = bM.reset(t);
  29541. a.progress && a.progress({
  29542. start: 0,
  29543. end: n.count()
  29544. }, n),
  29545. this._lineDraw.updateLayout(),
  29546. this._clearLayer(i)
  29547. },
  29548. _updateLineDraw: function(t, e) {
  29549. var i = this._lineDraw
  29550. , n = this._showEffect(e)
  29551. , o = !!e.get("polyline")
  29552. , a = e.pipelineContext.large;
  29553. return i && n === this._hasEffet && o === this._isPolyline && a === this._isLargeDraw || (i && i.remove(),
  29554. i = this._lineDraw = a ? new _M : new pw(o ? n ? vM : gM : n ? fM : dw),
  29555. this._hasEffet = n,
  29556. this._isPolyline = o,
  29557. this._isLargeDraw = a,
  29558. this.group.removeAll()),
  29559. this.group.add(i.group),
  29560. i
  29561. },
  29562. _showEffect: function(t) {
  29563. return !!t.get("effect.show")
  29564. },
  29565. _clearLayer: function(t) {
  29566. var e = t.getZr();
  29567. "svg" === e.painter.getType() || null == this._lastZlevel || e.painter.getLayer(this._lastZlevel).clear(!0)
  29568. },
  29569. remove: function(t, e) {
  29570. this._lineDraw && this._lineDraw.remove(),
  29571. this._lineDraw = null,
  29572. this._clearLayer(e)
  29573. },
  29574. dispose: function() {}
  29575. });
  29576. var MM = "lineStyle.opacity".split(".")
  29577. , IM = {
  29578. seriesType: "lines",
  29579. reset: function(t, e, i) {
  29580. var n = SM(t.get("symbol"))
  29581. , o = SM(t.get("symbolSize"))
  29582. , a = t.getData();
  29583. return a.setVisual("fromSymbol", n && n[0]),
  29584. a.setVisual("toSymbol", n && n[1]),
  29585. a.setVisual("fromSymbolSize", o && o[0]),
  29586. a.setVisual("toSymbolSize", o && o[1]),
  29587. a.setVisual("opacity", t.get(MM)),
  29588. {
  29589. dataEach: a.hasItemOption ? function(t, e) {
  29590. var i = t.getItemModel(e)
  29591. , n = SM(i.getShallow("symbol", !0))
  29592. , o = SM(i.getShallow("symbolSize", !0))
  29593. , a = i.get(MM);
  29594. n[0] && t.setItemVisual(e, "fromSymbol", n[0]),
  29595. n[1] && t.setItemVisual(e, "toSymbol", n[1]),
  29596. o[0] && t.setItemVisual(e, "fromSymbolSize", o[0]),
  29597. o[1] && t.setItemVisual(e, "toSymbolSize", o[1]),
  29598. t.setItemVisual(e, "opacity", a)
  29599. }
  29600. : null
  29601. }
  29602. }
  29603. };
  29604. bf(bM),
  29605. Sf(IM),
  29606. sc.extend({
  29607. type: "series.heatmap",
  29608. getInitialData: function(t, e) {
  29609. return gp(this.getSource(), this, {
  29610. generateCoord: "value"
  29611. })
  29612. },
  29613. preventIncremental: function() {
  29614. var t = lh.get(this.get("coordinateSystem"));
  29615. if (t && t.dimensions)
  29616. return "lng" === t.dimensions[0] && "lat" === t.dimensions[1]
  29617. },
  29618. defaultOption: {
  29619. coordinateSystem: "cartesian2d",
  29620. zlevel: 0,
  29621. z: 2,
  29622. geoIndex: 0,
  29623. blurSize: 30,
  29624. pointSize: 20,
  29625. maxOpacity: 1,
  29626. minOpacity: 0
  29627. }
  29628. });
  29629. function TM() {
  29630. var t = y();
  29631. this.canvas = t,
  29632. this.blurSize = 30,
  29633. this.pointSize = 20,
  29634. this.maxOpacity = 1,
  29635. this.minOpacity = 0,
  29636. this._gradientPixels = {}
  29637. }
  29638. TM.prototype = {
  29639. update: function(t, e, i, n, o, a) {
  29640. var r = this._getBrush()
  29641. , s = this._getGradient(t, o, "inRange")
  29642. , l = this._getGradient(t, o, "outOfRange")
  29643. , u = this.pointSize + this.blurSize
  29644. , h = this.canvas
  29645. , c = h.getContext("2d")
  29646. , d = t.length;
  29647. h.width = e,
  29648. h.height = i;
  29649. for (var f = 0; f < d; ++f) {
  29650. var p = t[f]
  29651. , g = p[0]
  29652. , m = p[1]
  29653. , v = n(p[2]);
  29654. c.globalAlpha = v,
  29655. c.drawImage(r, g - u, m - u)
  29656. }
  29657. if (!h.width || !h.height)
  29658. return h;
  29659. for (var y = c.getImageData(0, 0, h.width, h.height), x = y.data, _ = 0, w = x.length, b = this.minOpacity, S = this.maxOpacity - b; _ < w; ) {
  29660. v = x[_ + 3] / 256;
  29661. var M = 4 * Math.floor(255 * v);
  29662. if (0 < v) {
  29663. var I = a(v) ? s : l;
  29664. 0 < v && (v = v * S + b),
  29665. x[_++] = I[M],
  29666. x[_++] = I[1 + M],
  29667. x[_++] = I[2 + M],
  29668. x[_++] = I[3 + M] * v * 256
  29669. } else
  29670. _ += 4
  29671. }
  29672. return c.putImageData(y, 0, 0),
  29673. h
  29674. },
  29675. _getBrush: function() {
  29676. var t = this._brushCanvas || (this._brushCanvas = y())
  29677. , e = this.pointSize + this.blurSize
  29678. , i = 2 * e;
  29679. t.width = i,
  29680. t.height = i;
  29681. var n = t.getContext("2d");
  29682. return n.clearRect(0, 0, i, i),
  29683. n.shadowOffsetX = i,
  29684. n.shadowBlur = this.blurSize,
  29685. n.shadowColor = "#000",
  29686. n.beginPath(),
  29687. n.arc(-e, e, this.pointSize, 0, 2 * Math.PI, !0),
  29688. n.closePath(),
  29689. n.fill(),
  29690. t
  29691. },
  29692. _getGradient: function(t, e, i) {
  29693. for (var n = this._gradientPixels, o = n[i] || (n[i] = new Uint8ClampedArray(1024)), a = [0, 0, 0, 0], r = 0, s = 0; s < 256; s++)
  29694. e[i](s / 255, !0, a),
  29695. o[r++] = a[0],
  29696. o[r++] = a[1],
  29697. o[r++] = a[2],
  29698. o[r++] = a[3];
  29699. return o
  29700. }
  29701. },
  29702. Cf({
  29703. type: "heatmap",
  29704. render: function(i, t, e) {
  29705. var n;
  29706. t.eachComponent("visualMap", function(e) {
  29707. e.eachTargetSeries(function(t) {
  29708. t === i && (n = e)
  29709. })
  29710. }),
  29711. this.group.removeAll(),
  29712. this._incrementalDisplayable = null;
  29713. var o = i.coordinateSystem;
  29714. "cartesian2d" === o.type || "calendar" === o.type ? this._renderOnCartesianAndCalendar(i, e, 0, i.getData().count()) : function(t) {
  29715. var e = t.dimensions;
  29716. return "lng" === e[0] && "lat" === e[1]
  29717. }(o) && this._renderOnGeo(o, i, n, e)
  29718. },
  29719. incrementalPrepareRender: function(t, e, i) {
  29720. this.group.removeAll()
  29721. },
  29722. incrementalRender: function(t, e, i, n) {
  29723. e.coordinateSystem && this._renderOnCartesianAndCalendar(e, n, t.start, t.end, !0)
  29724. },
  29725. _renderOnCartesianAndCalendar: function(t, e, i, n, o) {
  29726. var a, r, s = t.coordinateSystem;
  29727. if ("cartesian2d" === s.type) {
  29728. var l = s.getAxis("x")
  29729. , u = s.getAxis("y");
  29730. a = l.getBandWidth(),
  29731. r = u.getBandWidth()
  29732. }
  29733. for (var h = this.group, c = t.getData(), d = "emphasis.itemStyle", f = "emphasis.label", p = t.getModel("itemStyle").getItemStyle(["color"]), g = t.getModel(d).getItemStyle(), m = t.getModel("label"), v = t.getModel(f), y = s.type, x = "cartesian2d" === y ? [c.mapDimension("x"), c.mapDimension("y"), c.mapDimension("value")] : [c.mapDimension("time"), c.mapDimension("value")], _ = i; _ < n; _++) {
  29734. var w;
  29735. if ("cartesian2d" === y) {
  29736. if (isNaN(c.get(x[2], _)))
  29737. continue;
  29738. var b = s.dataToPoint([c.get(x[0], _), c.get(x[1], _)]);
  29739. w = new rs({
  29740. shape: {
  29741. x: Math.floor(Math.round(b[0]) - a / 2),
  29742. y: Math.floor(Math.round(b[1]) - r / 2),
  29743. width: Math.ceil(a),
  29744. height: Math.ceil(r)
  29745. },
  29746. style: {
  29747. fill: c.getItemVisual(_, "color"),
  29748. opacity: c.getItemVisual(_, "opacity")
  29749. }
  29750. })
  29751. } else {
  29752. if (isNaN(c.get(x[1], _)))
  29753. continue;
  29754. w = new rs({
  29755. z2: 1,
  29756. shape: s.dataToRect([c.get(x[0], _)]).contentShape,
  29757. style: {
  29758. fill: c.getItemVisual(_, "color"),
  29759. opacity: c.getItemVisual(_, "opacity")
  29760. }
  29761. })
  29762. }
  29763. var S = c.getItemModel(_);
  29764. c.hasItemOption && (p = S.getModel("itemStyle").getItemStyle(["color"]),
  29765. g = S.getModel(d).getItemStyle(),
  29766. m = S.getModel("label"),
  29767. v = S.getModel(f));
  29768. var M = t.getRawValue(_)
  29769. , I = "-";
  29770. M && null != M[2] && (I = M[2]),
  29771. el(p, g, m, v, {
  29772. labelFetcher: t,
  29773. labelDataIndex: _,
  29774. defaultText: I,
  29775. isRectText: !0
  29776. }),
  29777. w.setStyle(p),
  29778. $s(w, c.hasItemOption ? g : P({}, g)),
  29779. (w.incremental = o) && (w.useHoverLayer = !0),
  29780. h.add(w),
  29781. c.setItemGraphicEl(_, w)
  29782. }
  29783. },
  29784. _renderOnGeo: function(o, t, e, i) {
  29785. var n = e.targetVisuals.inRange
  29786. , a = e.targetVisuals.outOfRange
  29787. , r = t.getData()
  29788. , s = this._hmLayer || this._hmLayer || new TM;
  29789. s.blurSize = t.get("blurSize"),
  29790. s.pointSize = t.get("pointSize"),
  29791. s.minOpacity = t.get("minOpacity"),
  29792. s.maxOpacity = t.get("maxOpacity");
  29793. var l = o.getViewRect().clone()
  29794. , u = o.getRoamTransform();
  29795. l.applyTransform(u);
  29796. var h = Math.max(l.x, 0)
  29797. , c = Math.max(l.y, 0)
  29798. , d = Math.min(l.width + l.x, i.getWidth())
  29799. , f = Math.min(l.height + l.y, i.getHeight())
  29800. , p = d - h
  29801. , g = f - c
  29802. , m = [r.mapDimension("lng"), r.mapDimension("lat"), r.mapDimension("value")]
  29803. , v = r.mapArray(m, function(t, e, i) {
  29804. var n = o.dataToPoint([t, e]);
  29805. return n[0] -= h,
  29806. n[1] -= c,
  29807. n.push(i),
  29808. n
  29809. })
  29810. , y = e.getExtent()
  29811. , x = "visualMap.continuous" === e.type ? function(t, e) {
  29812. var i = t[1] - t[0];
  29813. return e = [(e[0] - t[0]) / i, (e[1] - t[0]) / i],
  29814. function(t) {
  29815. return t >= e[0] && t <= e[1]
  29816. }
  29817. }(y, e.option.range) : function(e, n, o) {
  29818. var i = e[1] - e[0]
  29819. , a = (n = O(n, function(t) {
  29820. return {
  29821. interval: [(t.interval[0] - e[0]) / i, (t.interval[1] - e[0]) / i]
  29822. }
  29823. })).length
  29824. , r = 0;
  29825. return function(t) {
  29826. for (var e = r; e < a; e++) {
  29827. if ((i = n[e].interval)[0] <= t && t <= i[1]) {
  29828. r = e;
  29829. break
  29830. }
  29831. }
  29832. if (e === a)
  29833. for (e = r - 1; 0 <= e; e--) {
  29834. var i;
  29835. if ((i = n[e].interval)[0] <= t && t <= i[1]) {
  29836. r = e;
  29837. break
  29838. }
  29839. }
  29840. return 0 <= e && e < a && o[e]
  29841. }
  29842. }(y, e.getPieceList(), e.option.selected);
  29843. s.update(v, p, g, n.color.getNormalizer(), {
  29844. inRange: n.color.getColorMapper(),
  29845. outOfRange: a.color.getColorMapper()
  29846. }, x);
  29847. var _ = new Qn({
  29848. style: {
  29849. width: p,
  29850. height: g,
  29851. x: h,
  29852. y: c,
  29853. image: s.canvas
  29854. },
  29855. silent: !0
  29856. });
  29857. this.group.add(_)
  29858. },
  29859. dispose: function() {}
  29860. });
  29861. var AM = Tv.extend({
  29862. type: "series.pictorialBar",
  29863. dependencies: ["grid"],
  29864. defaultOption: {
  29865. symbol: "circle",
  29866. symbolSize: null,
  29867. symbolRotate: null,
  29868. symbolPosition: null,
  29869. symbolOffset: null,
  29870. symbolMargin: null,
  29871. symbolRepeat: !1,
  29872. symbolRepeatDirection: "end",
  29873. symbolClip: !1,
  29874. symbolBoundingData: null,
  29875. symbolPatternSize: 400,
  29876. barGap: "-100%",
  29877. progressive: 0,
  29878. hoverAnimation: !1
  29879. },
  29880. getInitialData: function(t) {
  29881. return t.stack = null,
  29882. AM.superApply(this, "getInitialData", arguments)
  29883. }
  29884. })
  29885. , DM = ["itemStyle", "borderWidth"]
  29886. , CM = [{
  29887. xy: "x",
  29888. wh: "width",
  29889. index: 0,
  29890. posDesc: ["left", "right"]
  29891. }, {
  29892. xy: "y",
  29893. wh: "height",
  29894. index: 1,
  29895. posDesc: ["top", "bottom"]
  29896. }]
  29897. , LM = new Yr;
  29898. Cf({
  29899. type: "pictorialBar",
  29900. render: function(t, e, i) {
  29901. var r = this.group
  29902. , s = t.getData()
  29903. , l = this._data
  29904. , n = t.coordinateSystem
  29905. , o = !!n.getBaseAxis().isHorizontal()
  29906. , a = n.grid.getRect()
  29907. , u = {
  29908. ecSize: {
  29909. width: i.getWidth(),
  29910. height: i.getHeight()
  29911. },
  29912. seriesModel: t,
  29913. coordSys: n,
  29914. coordSysExtent: [[a.x, a.x + a.width], [a.y, a.y + a.height]],
  29915. isHorizontal: o,
  29916. valueDim: CM[+o],
  29917. categoryDim: CM[1 - o]
  29918. };
  29919. return s.diff(l).add(function(t) {
  29920. if (s.hasValue(t)) {
  29921. var e = BM(s, t)
  29922. , i = kM(s, t, e, u)
  29923. , n = WM(s, u, i);
  29924. s.setItemGraphicEl(t, n),
  29925. r.add(n),
  29926. YM(n, u, i)
  29927. }
  29928. }).update(function(t, e) {
  29929. var i = l.getItemGraphicEl(e);
  29930. if (s.hasValue(t)) {
  29931. var n = BM(s, t)
  29932. , o = kM(s, t, n, u)
  29933. , a = ZM(s, o);
  29934. i && a !== i.__pictorialShapeStr && (r.remove(i),
  29935. s.setItemGraphicEl(t, null),
  29936. i = null),
  29937. i ? function(t, e, i) {
  29938. var n = i.animationModel
  29939. , o = i.dataIndex;
  29940. cl(t.__pictorialBundle, {
  29941. position: i.bundlePosition.slice()
  29942. }, n, o),
  29943. i.symbolRepeat ? OM(t, e, i, !0) : EM(t, e, i, !0);
  29944. RM(t, i, !0),
  29945. zM(t, e, i, !0)
  29946. }(i, u, o) : i = WM(s, u, o, !0),
  29947. s.setItemGraphicEl(t, i),
  29948. i.__pictorialSymbolMeta = o,
  29949. r.add(i),
  29950. YM(i, u, o)
  29951. } else
  29952. r.remove(i)
  29953. }).remove(function(t) {
  29954. var e = l.getItemGraphicEl(t);
  29955. e && HM(l, t, e.__pictorialSymbolMeta.animationModel, e)
  29956. }).execute(),
  29957. this._data = s,
  29958. this.group
  29959. },
  29960. dispose: et,
  29961. remove: function(e, t) {
  29962. var i = this.group
  29963. , n = this._data;
  29964. e.get("animation") ? n && n.eachItemGraphicEl(function(t) {
  29965. HM(n, t.dataIndex, e, t)
  29966. }) : i.removeAll()
  29967. }
  29968. });
  29969. function kM(t, e, i, n) {
  29970. var o = t.getItemLayout(e)
  29971. , a = i.get("symbolRepeat")
  29972. , r = i.get("symbolClip")
  29973. , s = i.get("symbolPosition") || "start"
  29974. , l = (i.get("symbolRotate") || 0) * Math.PI / 180 || 0
  29975. , u = i.get("symbolPatternSize") || 2
  29976. , h = i.isAnimationEnabled()
  29977. , c = {
  29978. dataIndex: e,
  29979. layout: o,
  29980. itemModel: i,
  29981. symbolType: t.getItemVisual(e, "symbol") || "circle",
  29982. color: t.getItemVisual(e, "color"),
  29983. symbolClip: r,
  29984. symbolRepeat: a,
  29985. symbolRepeatDirection: i.get("symbolRepeatDirection"),
  29986. symbolPatternSize: u,
  29987. rotation: l,
  29988. animationModel: h ? i : null,
  29989. hoverAnimation: h && i.get("hoverAnimation"),
  29990. z2: i.getShallow("z", !0) || 0
  29991. };
  29992. !function(t, e, i, n, o) {
  29993. var a, r = n.valueDim, s = t.get("symbolBoundingData"), l = n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()), u = l.toGlobalCoord(l.dataToCoord(0)), h = 1 - +(i[r.wh] <= 0);
  29994. if (L(s)) {
  29995. var c = [PM(l, s[0]) - u, PM(l, s[1]) - u];
  29996. c[1] < c[0] && c.reverse(),
  29997. a = c[h]
  29998. } else
  29999. a = null != s ? PM(l, s) - u : e ? n.coordSysExtent[r.index][h] - u : i[r.wh];
  30000. o.boundingLength = a,
  30001. e && (o.repeatCutLength = i[r.wh]);
  30002. o.pxSign = 0 < a ? 1 : a < 0 ? -1 : 0
  30003. }(i, a, o, n, c),
  30004. function(t, e, i, n, o, a, r, s, l, u) {
  30005. var h = l.valueDim
  30006. , c = l.categoryDim
  30007. , d = Math.abs(i[c.wh])
  30008. , f = t.getItemVisual(e, "symbolSize");
  30009. f = L(f) ? f.slice() : (null == f && (f = "100%"),
  30010. [f, f]);
  30011. f[c.index] = Rl(f[c.index], d),
  30012. f[h.index] = Rl(f[h.index], n ? d : Math.abs(a)),
  30013. u.symbolSize = f,
  30014. (u.symbolScale = [f[0] / s, f[1] / s])[h.index] *= (l.isHorizontal ? -1 : 1) * r
  30015. }(t, e, o, a, 0, c.boundingLength, c.pxSign, u, n, c),
  30016. function(t, e, i, n, o) {
  30017. var a = t.get(DM) || 0;
  30018. a && (LM.attr({
  30019. scale: e.slice(),
  30020. rotation: i
  30021. }),
  30022. LM.updateTransform(),
  30023. a /= LM.getLineScale(),
  30024. a *= e[n.valueDim.index]);
  30025. o.valueLineWidth = a
  30026. }(i, c.symbolScale, l, n, c);
  30027. var d = c.symbolSize
  30028. , f = i.get("symbolOffset");
  30029. return L(f) && (f = [Rl(f[0], d[0]), Rl(f[1], d[1])]),
  30030. function(t, e, i, n, o, a, r, s, l, u, h, c) {
  30031. var d = h.categoryDim
  30032. , f = h.valueDim
  30033. , p = c.pxSign
  30034. , g = Math.max(e[f.index] + s, 0)
  30035. , m = g;
  30036. if (n) {
  30037. var v = Math.abs(l)
  30038. , y = W(t.get("symbolMargin"), "15%") + ""
  30039. , x = !1;
  30040. y.lastIndexOf("!") === y.length - 1 && (x = !0,
  30041. y = y.slice(0, y.length - 1)),
  30042. y = Rl(y, e[f.index]);
  30043. var _ = Math.max(g + 2 * y, 0)
  30044. , w = x ? 0 : 2 * y
  30045. , b = Jl(n)
  30046. , S = b ? n : jM((v + w) / _);
  30047. _ = g + 2 * (y = (v - S * g) / 2 / (x ? S : S - 1)),
  30048. w = x ? 0 : 2 * y,
  30049. b || "fixed" === n || (S = u ? jM((Math.abs(u) + w) / _) : 0),
  30050. m = S * _ - w,
  30051. c.repeatTimes = S,
  30052. c.symbolMargin = y
  30053. }
  30054. var M = p * (m / 2)
  30055. , I = c.pathPosition = [];
  30056. I[d.index] = i[d.wh] / 2,
  30057. I[f.index] = "start" === r ? M : "end" === r ? l - M : l / 2,
  30058. a && (I[0] += a[0],
  30059. I[1] += a[1]);
  30060. var T = c.bundlePosition = [];
  30061. T[d.index] = i[d.xy],
  30062. T[f.index] = i[f.xy];
  30063. var A = c.barRectShape = P({}, i);
  30064. A[f.wh] = p * Math.max(Math.abs(i[f.wh]), Math.abs(I[f.index] + M)),
  30065. A[d.wh] = i[d.wh];
  30066. var D = c.clipShape = {};
  30067. D[d.xy] = -i[d.xy],
  30068. D[d.wh] = h.ecSize[d.wh],
  30069. D[f.xy] = 0,
  30070. D[f.wh] = i[f.wh]
  30071. }(i, d, o, a, 0, f, s, c.valueLineWidth, c.boundingLength, c.repeatCutLength, n, c),
  30072. c
  30073. }
  30074. function PM(t, e) {
  30075. return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))
  30076. }
  30077. function NM(t) {
  30078. var e = t.symbolPatternSize
  30079. , i = wg(t.symbolType, -e / 2, -e / 2, e, e, t.color);
  30080. return i.attr({
  30081. culling: !0
  30082. }),
  30083. "image" !== i.type && i.setStyle({
  30084. strokeNoScale: !0
  30085. }),
  30086. i
  30087. }
  30088. function OM(t, e, o, i) {
  30089. var n = t.__pictorialBundle
  30090. , a = o.symbolSize
  30091. , r = o.valueLineWidth
  30092. , s = o.pathPosition
  30093. , l = e.valueDim
  30094. , u = o.repeatTimes || 0
  30095. , h = 0
  30096. , c = a[e.valueDim.index] + r + 2 * o.symbolMargin;
  30097. for (UM(t, function(t) {
  30098. t.__pictorialAnimationIndex = h,
  30099. t.__pictorialRepeatTimes = u,
  30100. h < u ? XM(t, null, p(h), o, i) : XM(t, null, {
  30101. scale: [0, 0]
  30102. }, o, i, function() {
  30103. n.remove(t)
  30104. }),
  30105. FM(t, o),
  30106. h++
  30107. }); h < u; h++) {
  30108. var d = NM(o);
  30109. d.__pictorialAnimationIndex = h,
  30110. d.__pictorialRepeatTimes = u,
  30111. n.add(d);
  30112. var f = p(h);
  30113. XM(d, {
  30114. position: f.position,
  30115. scale: [0, 0]
  30116. }, {
  30117. scale: f.scale,
  30118. rotation: f.rotation
  30119. }, o, i),
  30120. d.on("mouseover", g).on("mouseout", m),
  30121. FM(d, o)
  30122. }
  30123. function p(t) {
  30124. var e = s.slice()
  30125. , i = o.pxSign
  30126. , n = t;
  30127. return ("start" === o.symbolRepeatDirection ? 0 < i : i < 0) && (n = u - 1 - t),
  30128. e[l.index] = c * (n - u / 2 + .5) + s[l.index],
  30129. {
  30130. position: e,
  30131. scale: o.symbolScale.slice(),
  30132. rotation: o.rotation
  30133. }
  30134. }
  30135. function g() {
  30136. UM(t, function(t) {
  30137. t.trigger("emphasis")
  30138. })
  30139. }
  30140. function m() {
  30141. UM(t, function(t) {
  30142. t.trigger("normal")
  30143. })
  30144. }
  30145. }
  30146. function EM(t, e, i, n) {
  30147. var o = t.__pictorialBundle
  30148. , a = t.__pictorialMainPath;
  30149. a ? XM(a, null, {
  30150. position: i.pathPosition.slice(),
  30151. scale: i.symbolScale.slice(),
  30152. rotation: i.rotation
  30153. }, i, n) : (a = t.__pictorialMainPath = NM(i),
  30154. o.add(a),
  30155. XM(a, {
  30156. position: i.pathPosition.slice(),
  30157. scale: [0, 0],
  30158. rotation: i.rotation
  30159. }, {
  30160. scale: i.symbolScale.slice()
  30161. }, i, n),
  30162. a.on("mouseover", function() {
  30163. this.trigger("emphasis")
  30164. }).on("mouseout", function() {
  30165. this.trigger("normal")
  30166. })),
  30167. FM(a, i)
  30168. }
  30169. function RM(t, e, i) {
  30170. var n = P({}, e.barRectShape)
  30171. , o = t.__pictorialBarRect;
  30172. o ? XM(o, null, {
  30173. shape: n
  30174. }, e, i) : (o = t.__pictorialBarRect = new rs({
  30175. z2: 2,
  30176. shape: n,
  30177. silent: !0,
  30178. style: {
  30179. stroke: "transparent",
  30180. fill: "transparent",
  30181. lineWidth: 0
  30182. }
  30183. }),
  30184. t.add(o))
  30185. }
  30186. function zM(t, e, i, n) {
  30187. if (i.symbolClip) {
  30188. var o = t.__pictorialClipPath
  30189. , a = P({}, i.clipShape)
  30190. , r = e.valueDim
  30191. , s = i.animationModel
  30192. , l = i.dataIndex;
  30193. if (o)
  30194. cl(o, {
  30195. shape: a
  30196. }, s, l);
  30197. else {
  30198. a[r.wh] = 0,
  30199. o = new rs({
  30200. shape: a
  30201. }),
  30202. t.__pictorialBundle.setClipPath(o),
  30203. t.__pictorialClipPath = o;
  30204. var u = {};
  30205. u[r.wh] = i.clipShape[r.wh],
  30206. bl[n ? "updateProps" : "initProps"](o, {
  30207. shape: u
  30208. }, s, l)
  30209. }
  30210. }
  30211. }
  30212. function BM(t, e) {
  30213. var i = t.getItemModel(e);
  30214. return i.getAnimationDelayParams = VM,
  30215. i.isAnimationEnabled = GM,
  30216. i
  30217. }
  30218. function VM(t) {
  30219. return {
  30220. index: t.__pictorialAnimationIndex,
  30221. count: t.__pictorialRepeatTimes
  30222. }
  30223. }
  30224. function GM() {
  30225. return this.parentModel.isAnimationEnabled() && !!this.getShallow("animation")
  30226. }
  30227. function FM(t, e) {
  30228. t.off("emphasis").off("normal");
  30229. var i = e.symbolScale.slice();
  30230. e.hoverAnimation && t.on("emphasis", function() {
  30231. this.animateTo({
  30232. scale: [1.1 * i[0], 1.1 * i[1]]
  30233. }, 400, "elasticOut")
  30234. }).on("normal", function() {
  30235. this.animateTo({
  30236. scale: i.slice()
  30237. }, 400, "elasticOut")
  30238. })
  30239. }
  30240. function WM(t, e, i, n) {
  30241. var o = new Ci
  30242. , a = new Ci;
  30243. return o.add(a),
  30244. (o.__pictorialBundle = a).attr("position", i.bundlePosition.slice()),
  30245. i.symbolRepeat ? OM(o, e, i) : EM(o, 0, i),
  30246. RM(o, i, n),
  30247. zM(o, e, i, n),
  30248. o.__pictorialShapeStr = ZM(t, i),
  30249. o.__pictorialSymbolMeta = i,
  30250. o
  30251. }
  30252. function HM(t, e, i, n) {
  30253. var o = n.__pictorialBarRect;
  30254. o && (o.style.text = null);
  30255. var a = [];
  30256. UM(n, function(t) {
  30257. a.push(t)
  30258. }),
  30259. n.__pictorialMainPath && a.push(n.__pictorialMainPath),
  30260. n.__pictorialClipPath && (i = null),
  30261. E(a, function(t) {
  30262. cl(t, {
  30263. scale: [0, 0]
  30264. }, i, e, function() {
  30265. n.parent && n.parent.remove(n)
  30266. })
  30267. }),
  30268. t.setItemGraphicEl(e, null)
  30269. }
  30270. function ZM(t, e) {
  30271. return [t.getItemVisual(e.dataIndex, "symbol") || "none", !!e.symbolRepeat, !!e.symbolClip].join(":")
  30272. }
  30273. function UM(e, i, n) {
  30274. E(e.__pictorialBundle.children(), function(t) {
  30275. t !== e.__pictorialBarRect && i.call(n, t)
  30276. })
  30277. }
  30278. function XM(t, e, i, n, o, a) {
  30279. e && t.attr(e),
  30280. n.symbolClip && !o ? i && t.attr(i) : i && bl[o ? "updateProps" : "initProps"](t, i, n.animationModel, n.dataIndex, a)
  30281. }
  30282. function YM(t, e, i) {
  30283. var n = i.color
  30284. , o = i.dataIndex
  30285. , a = i.itemModel
  30286. , r = a.getModel("itemStyle").getItemStyle(["color"])
  30287. , s = a.getModel("emphasis.itemStyle").getItemStyle()
  30288. , l = a.getShallow("cursor");
  30289. UM(t, function(t) {
  30290. t.setColor(n),
  30291. t.setStyle(D({
  30292. fill: n,
  30293. opacity: i.opacity
  30294. }, r)),
  30295. $s(t, s),
  30296. l && (t.cursor = l),
  30297. t.z2 = i.z2
  30298. });
  30299. var u = {}
  30300. , h = (e.valueDim.posDesc[+(0 < i.boundingLength)],
  30301. t.__pictorialBarRect);
  30302. Av(h.style, u, a, n, e.seriesModel, o),
  30303. $s(h, u)
  30304. }
  30305. function jM(t) {
  30306. var e = Math.round(t);
  30307. return Math.abs(t - e) < 1e-4 ? e : Math.ceil(t)
  30308. }
  30309. bf(T(zp, "pictorialBar")),
  30310. Sf(Lm("pictorialBar", "roundRect"));
  30311. function qM(t, e, i, n, o) {
  30312. Gg.call(this, t, e, i),
  30313. this.type = n || "value",
  30314. this.position = o || "bottom",
  30315. this.orient = null
  30316. }
  30317. function KM(t, e, i) {
  30318. this.dimension = "single",
  30319. this.dimensions = ["single"],
  30320. this._axis = null,
  30321. this._rect,
  30322. this._init(t, e, i),
  30323. this.model = t
  30324. }
  30325. function $M(t, e) {
  30326. e = e || {};
  30327. var i = t.coordinateSystem
  30328. , n = t.axis
  30329. , o = {}
  30330. , a = n.position
  30331. , r = n.orient
  30332. , s = i.getRect()
  30333. , l = [s.x, s.x + s.width, s.y, s.y + s.height]
  30334. , u = {
  30335. horizontal: {
  30336. top: l[2],
  30337. bottom: l[3]
  30338. },
  30339. vertical: {
  30340. left: l[0],
  30341. right: l[1]
  30342. }
  30343. };
  30344. o.position = ["vertical" === r ? u.vertical[a] : l[0], "horizontal" === r ? u.horizontal[a] : l[3]];
  30345. o.rotation = Math.PI / 2 * {
  30346. horizontal: 0,
  30347. vertical: 1
  30348. }[r];
  30349. o.labelDirection = o.tickDirection = o.nameDirection = {
  30350. top: -1,
  30351. bottom: 1,
  30352. right: 1,
  30353. left: -1
  30354. }[a],
  30355. t.get("axisTick.inside") && (o.tickDirection = -o.tickDirection),
  30356. W(e.labelInside, t.get("axisLabel.inside")) && (o.labelDirection = -o.labelDirection);
  30357. var h = e.rotate;
  30358. return null == h && (h = t.get("axisLabel.rotate")),
  30359. o.labelRotation = "top" === a ? -h : h,
  30360. o.z2 = 1,
  30361. o
  30362. }
  30363. qM.prototype = {
  30364. constructor: qM,
  30365. model: null,
  30366. isHorizontal: function() {
  30367. var t = this.position;
  30368. return "top" === t || "bottom" === t
  30369. },
  30370. pointToData: function(t, e) {
  30371. return this.coordinateSystem.pointToData(t, e)[0]
  30372. },
  30373. toGlobalCoord: null,
  30374. toLocalCoord: null
  30375. },
  30376. w(qM, Gg),
  30377. lh.register("single", {
  30378. create: function(n, o) {
  30379. var a = [];
  30380. return n.eachComponent("singleAxis", function(t, e) {
  30381. var i = new KM(t,n,o);
  30382. i.name = "single_" + e,
  30383. i.resize(t, o),
  30384. t.coordinateSystem = i,
  30385. a.push(i)
  30386. }),
  30387. n.eachSeries(function(t) {
  30388. if ("singleAxis" === t.get("coordinateSystem")) {
  30389. var e = n.queryComponents({
  30390. mainType: "singleAxis",
  30391. index: t.get("singleAxisIndex"),
  30392. id: t.get("singleAxisId")
  30393. })[0];
  30394. t.coordinateSystem = e && e.coordinateSystem
  30395. }
  30396. }),
  30397. a
  30398. },
  30399. dimensions: (KM.prototype = {
  30400. type: "singleAxis",
  30401. axisPointerEnabled: !0,
  30402. constructor: KM,
  30403. _init: function(t, e, i) {
  30404. var n = this.dimension
  30405. , o = new qM(n,sg(t),[0, 0],t.get("type"),t.get("position"))
  30406. , a = "category" === o.type;
  30407. o.onBand = a && t.get("boundaryGap"),
  30408. o.inverse = t.get("inverse"),
  30409. o.orient = t.get("orient"),
  30410. (t.axis = o).model = t,
  30411. (o.coordinateSystem = this)._axis = o
  30412. },
  30413. update: function(t, e) {
  30414. t.eachSeries(function(t) {
  30415. if (t.coordinateSystem === this) {
  30416. var e = t.getData();
  30417. E(e.mapDimension(this.dimension, !0), function(t) {
  30418. this._axis.scale.unionExtentFromData(e, t)
  30419. }, this),
  30420. rg(this._axis.scale, this._axis.model)
  30421. }
  30422. }, this)
  30423. },
  30424. resize: function(t, e) {
  30425. this._rect = bu({
  30426. left: t.get("left"),
  30427. top: t.get("top"),
  30428. right: t.get("right"),
  30429. bottom: t.get("bottom"),
  30430. width: t.get("width"),
  30431. height: t.get("height")
  30432. }, {
  30433. width: e.getWidth(),
  30434. height: e.getHeight()
  30435. }),
  30436. this._adjustAxis()
  30437. },
  30438. getRect: function() {
  30439. return this._rect
  30440. },
  30441. _adjustAxis: function() {
  30442. var t = this._rect
  30443. , e = this._axis
  30444. , i = e.isHorizontal()
  30445. , n = i ? [0, t.width] : [0, t.height]
  30446. , o = e.reverse ? 1 : 0;
  30447. e.setExtent(n[o], n[1 - o]),
  30448. this._updateAxisTransform(e, i ? t.x : t.y)
  30449. },
  30450. _updateAxisTransform: function(t, e) {
  30451. var i = t.getExtent()
  30452. , n = i[0] + i[1]
  30453. , o = t.isHorizontal();
  30454. t.toGlobalCoord = o ? function(t) {
  30455. return t + e
  30456. }
  30457. : function(t) {
  30458. return n - t + e
  30459. }
  30460. ,
  30461. t.toLocalCoord = o ? function(t) {
  30462. return t - e
  30463. }
  30464. : function(t) {
  30465. return n - t + e
  30466. }
  30467. },
  30468. getAxis: function() {
  30469. return this._axis
  30470. },
  30471. getBaseAxis: function() {
  30472. return this._axis
  30473. },
  30474. getAxes: function() {
  30475. return [this._axis]
  30476. },
  30477. getTooltipAxes: function() {
  30478. return {
  30479. baseAxes: [this.getAxis()]
  30480. }
  30481. },
  30482. containPoint: function(t) {
  30483. var e = this.getRect()
  30484. , i = this.getAxis();
  30485. return "horizontal" === i.orient ? i.contain(i.toLocalCoord(t[0])) && t[1] >= e.y && t[1] <= e.y + e.height : i.contain(i.toLocalCoord(t[1])) && t[0] >= e.y && t[0] <= e.y + e.height
  30486. },
  30487. pointToData: function(t) {
  30488. var e = this.getAxis();
  30489. return [e.coordToData(e.toLocalCoord(t["horizontal" === e.orient ? 0 : 1]))]
  30490. },
  30491. dataToPoint: function(t) {
  30492. var e = this.getAxis()
  30493. , i = this.getRect()
  30494. , n = []
  30495. , o = "horizontal" === e.orient ? 0 : 1;
  30496. return t instanceof Array && (t = t[0]),
  30497. n[o] = e.toGlobalCoord(e.dataToCoord(+t)),
  30498. n[1 - o] = 0 == o ? i.y + i.height / 2 : i.x + i.width / 2,
  30499. n
  30500. }
  30501. }).dimensions
  30502. });
  30503. var JM = ["axisLine", "axisTickLabel", "axisName"]
  30504. , QM = ["splitArea", "splitLine"]
  30505. , tI = mv.extend({
  30506. type: "singleAxis",
  30507. axisPointerClass: "SingleAxisPointer",
  30508. render: function(e, t, i, n) {
  30509. var o = this.group;
  30510. o.removeAll();
  30511. var a = this._axisGroup;
  30512. this._axisGroup = new Ci;
  30513. var r = $M(e)
  30514. , s = new Qm(e,r);
  30515. E(JM, s.add, s),
  30516. o.add(this._axisGroup),
  30517. o.add(s.getGroup()),
  30518. E(QM, function(t) {
  30519. e.get(t + ".show") && this["_" + t](e)
  30520. }, this),
  30521. ml(a, this._axisGroup, e),
  30522. tI.superCall(this, "render", e, t, i, n)
  30523. },
  30524. remove: function() {
  30525. bv(this)
  30526. },
  30527. _splitLine: function(t) {
  30528. var e = t.axis;
  30529. if (!e.scale.isBlank()) {
  30530. var i = t.getModel("splitLine")
  30531. , n = i.getModel("lineStyle")
  30532. , o = n.get("width")
  30533. , a = n.get("color");
  30534. a = a instanceof Array ? a : [a];
  30535. for (var r = t.coordinateSystem.getRect(), s = e.isHorizontal(), l = [], u = 0, h = e.getTicksCoords({
  30536. tickModel: i
  30537. }), c = [], d = [], f = 0; f < h.length; ++f) {
  30538. var p = e.toGlobalCoord(h[f].coord);
  30539. s ? (c[0] = p,
  30540. c[1] = r.y,
  30541. d[0] = p,
  30542. d[1] = r.y + r.height) : (c[0] = r.x,
  30543. c[1] = p,
  30544. d[0] = r.x + r.width,
  30545. d[1] = p);
  30546. var g = u++ % a.length;
  30547. l[g] = l[g] || [],
  30548. l[g].push(new ls({
  30549. subPixelOptimize: !0,
  30550. shape: {
  30551. x1: c[0],
  30552. y1: c[1],
  30553. x2: d[0],
  30554. y2: d[1]
  30555. },
  30556. style: {
  30557. lineWidth: o
  30558. },
  30559. silent: !0
  30560. }))
  30561. }
  30562. for (f = 0; f < l.length; ++f)
  30563. this.group.add(Es(l[f], {
  30564. style: {
  30565. stroke: a[f % a.length],
  30566. lineDash: n.getLineDash(o),
  30567. lineWidth: o
  30568. },
  30569. silent: !0
  30570. }))
  30571. }
  30572. },
  30573. _splitArea: function(t) {
  30574. wv(this, this._axisGroup, t, t)
  30575. }
  30576. })
  30577. , eI = ku.extend({
  30578. type: "singleAxis",
  30579. layoutMode: "box",
  30580. axis: null,
  30581. coordinateSystem: null,
  30582. getCoordSysModel: function() {
  30583. return this
  30584. }
  30585. });
  30586. m(eI.prototype, dg),
  30587. Gm("single", eI, function(t, e) {
  30588. return e.type || (e.data ? "category" : "value")
  30589. }, {
  30590. left: "5%",
  30591. top: "5%",
  30592. right: "5%",
  30593. bottom: "5%",
  30594. type: "value",
  30595. position: "bottom",
  30596. orient: "horizontal",
  30597. axisLine: {
  30598. show: !0,
  30599. lineStyle: {
  30600. width: 1,
  30601. type: "solid"
  30602. }
  30603. },
  30604. tooltip: {
  30605. show: !0
  30606. },
  30607. axisTick: {
  30608. show: !0,
  30609. length: 6,
  30610. lineStyle: {
  30611. width: 1
  30612. }
  30613. },
  30614. axisLabel: {
  30615. show: !0,
  30616. interval: "auto"
  30617. },
  30618. splitLine: {
  30619. show: !0,
  30620. lineStyle: {
  30621. type: "dashed",
  30622. opacity: .2
  30623. }
  30624. }
  30625. });
  30626. function iI(t, e) {
  30627. var i, n = [], o = t.seriesIndex;
  30628. if (null == o || !(i = e.getSeriesByIndex(o)))
  30629. return {
  30630. point: []
  30631. };
  30632. var a = i.getData()
  30633. , r = Yo(a, t);
  30634. if (null == r || r < 0 || L(r))
  30635. return {
  30636. point: []
  30637. };
  30638. var s = a.getItemGraphicEl(r)
  30639. , l = i.coordinateSystem;
  30640. if (i.getTooltipPosition)
  30641. n = i.getTooltipPosition(r) || [];
  30642. else if (l && l.dataToPoint)
  30643. n = l.dataToPoint(a.getValues(O(l.dimensions, function(t) {
  30644. return a.mapDimension(t)
  30645. }), r, !0)) || [];
  30646. else if (s) {
  30647. var u = s.getBoundingRect().clone();
  30648. u.applyTransform(s.transform),
  30649. n = [u.x + u.width / 2, u.y + u.height / 2]
  30650. }
  30651. return {
  30652. point: n,
  30653. el: s
  30654. }
  30655. }
  30656. var nI = E
  30657. , oI = T
  30658. , aI = jo();
  30659. function rI(t, e, i, n, o) {
  30660. var a = t.axis;
  30661. if (!a.scale.isBlank() && a.containData(e))
  30662. if (t.involveSeries) {
  30663. var r = function(l, t) {
  30664. var u = t.axis
  30665. , h = u.dim
  30666. , c = l
  30667. , d = []
  30668. , f = Number.MAX_VALUE
  30669. , p = -1;
  30670. return nI(t.seriesModels, function(e, t) {
  30671. var i, n, o = e.getData().mapDimension(h, !0);
  30672. if (e.getAxisTooltipData) {
  30673. var a = e.getAxisTooltipData(o, l, u);
  30674. n = a.dataIndices,
  30675. i = a.nestestValue
  30676. } else {
  30677. if (!(n = e.getData().indicesOfNearest(o[0], l, "category" === u.type ? .5 : null)).length)
  30678. return;
  30679. i = e.getData().get(o[0], n[0])
  30680. }
  30681. if (null != i && isFinite(i)) {
  30682. var r = l - i
  30683. , s = Math.abs(r);
  30684. s <= f && ((s < f || 0 <= r && p < 0) && (f = s,
  30685. p = r,
  30686. c = i,
  30687. d.length = 0),
  30688. nI(n, function(t) {
  30689. d.push({
  30690. seriesIndex: e.seriesIndex,
  30691. dataIndexInside: t,
  30692. dataIndex: e.getData().getRawIndex(t)
  30693. })
  30694. }))
  30695. }
  30696. }),
  30697. {
  30698. payloadBatch: d,
  30699. snapToValue: c
  30700. }
  30701. }(e, t)
  30702. , s = r.payloadBatch
  30703. , l = r.snapToValue;
  30704. s[0] && null == o.seriesIndex && P(o, s[0]),
  30705. !n && t.snap && a.containData(l) && null != l && (e = l),
  30706. i.showPointer(t, e, s, o),
  30707. i.showTooltip(t, r, l)
  30708. } else
  30709. i.showPointer(t, e)
  30710. }
  30711. function sI(t, e, i, n) {
  30712. t[e.key] = {
  30713. value: i,
  30714. payloadBatch: n
  30715. }
  30716. }
  30717. function lI(t, e, i, n) {
  30718. var o = i.payloadBatch
  30719. , a = e.axis
  30720. , r = a.model
  30721. , s = e.axisPointerModel;
  30722. if (e.triggerTooltip && o.length) {
  30723. var l = e.coordSys.model
  30724. , u = gv(l)
  30725. , h = t.map[u];
  30726. h || (h = t.map[u] = {
  30727. coordSysId: l.id,
  30728. coordSysIndex: l.componentIndex,
  30729. coordSysType: l.type,
  30730. coordSysMainType: l.mainType,
  30731. dataByAxis: []
  30732. },
  30733. t.list.push(h)),
  30734. h.dataByAxis.push({
  30735. axisDim: a.dim,
  30736. axisIndex: r.componentIndex,
  30737. axisType: r.type,
  30738. axisId: r.id,
  30739. value: n,
  30740. valueLabelOpt: {
  30741. precision: s.get("label.precision"),
  30742. formatter: s.get("label.formatter")
  30743. },
  30744. seriesDataIndices: o.slice()
  30745. })
  30746. }
  30747. }
  30748. function uI(t) {
  30749. var e = t.axis.model
  30750. , i = {}
  30751. , n = i.axisDim = t.axis.dim;
  30752. return i.axisIndex = i[n + "AxisIndex"] = e.componentIndex,
  30753. i.axisName = i[n + "AxisName"] = e.name,
  30754. i.axisId = i[n + "AxisId"] = e.id,
  30755. i
  30756. }
  30757. function hI(t) {
  30758. return !t || null == t[0] || isNaN(t[0]) || null == t[1] || isNaN(t[1])
  30759. }
  30760. Tf({
  30761. type: "axisPointer",
  30762. coordSysAxesInfo: null,
  30763. defaultOption: {
  30764. show: "auto",
  30765. triggerOn: null,
  30766. zlevel: 0,
  30767. z: 50,
  30768. type: "line",
  30769. snap: !1,
  30770. triggerTooltip: !0,
  30771. value: null,
  30772. status: null,
  30773. link: [],
  30774. animation: null,
  30775. animationDurationUpdate: 200,
  30776. lineStyle: {
  30777. color: "#aaa",
  30778. width: 1,
  30779. type: "solid"
  30780. },
  30781. shadowStyle: {
  30782. color: "rgba(150,150,150,0.3)"
  30783. },
  30784. label: {
  30785. show: !0,
  30786. formatter: null,
  30787. precision: "auto",
  30788. margin: 3,
  30789. color: "#fff",
  30790. padding: [5, 7, 5, 7],
  30791. backgroundColor: "auto",
  30792. borderColor: null,
  30793. borderWidth: 0,
  30794. shadowBlur: 3,
  30795. shadowColor: "#aaa"
  30796. },
  30797. handle: {
  30798. show: !1,
  30799. icon: "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",
  30800. size: 45,
  30801. margin: 50,
  30802. color: "#333",
  30803. shadowBlur: 3,
  30804. shadowColor: "#aaa",
  30805. shadowOffsetX: 0,
  30806. shadowOffsetY: 2,
  30807. throttle: 40
  30808. }
  30809. }
  30810. });
  30811. var cI = jo()
  30812. , dI = E;
  30813. function fI(t, e, i) {
  30814. if (!v.node) {
  30815. var n = e.getZr();
  30816. cI(n).records || (cI(n).records = {}),
  30817. function(o, a) {
  30818. if (cI(o).initialized)
  30819. return;
  30820. function t(t, n) {
  30821. o.on(t, function(e) {
  30822. var i = function(i) {
  30823. var n = {
  30824. showTip: [],
  30825. hideTip: []
  30826. }
  30827. , o = function(t) {
  30828. var e = n[t.type];
  30829. e ? e.push(t) : (t.dispatchAction = o,
  30830. i.dispatchAction(t))
  30831. };
  30832. return {
  30833. dispatchAction: o,
  30834. pendings: n
  30835. }
  30836. }(a);
  30837. dI(cI(o).records, function(t) {
  30838. t && n(t, e, i.dispatchAction)
  30839. }),
  30840. function(t, e) {
  30841. var i, n = t.showTip.length, o = t.hideTip.length;
  30842. n ? i = t.showTip[n - 1] : o && (i = t.hideTip[o - 1]);
  30843. i && (i.dispatchAction = null,
  30844. e.dispatchAction(i))
  30845. }(i.pendings, a)
  30846. })
  30847. }
  30848. cI(o).initialized = !0,
  30849. t("click", T(gI, "click")),
  30850. t("mousemove", T(gI, "mousemove")),
  30851. t("globalout", pI)
  30852. }(n, e),
  30853. (cI(n).records[t] || (cI(n).records[t] = {})).handler = i
  30854. }
  30855. }
  30856. function pI(t, e, i) {
  30857. t.handler("leave", null, i)
  30858. }
  30859. function gI(t, e, i, n) {
  30860. e.handler(t, i, n)
  30861. }
  30862. function mI(t, e) {
  30863. if (!v.node) {
  30864. var i = e.getZr();
  30865. (cI(i).records || {})[t] && (cI(i).records[t] = null)
  30866. }
  30867. }
  30868. var vI = Af({
  30869. type: "axisPointer",
  30870. render: function(t, e, i) {
  30871. var n = e.getComponent("tooltip")
  30872. , o = t.get("triggerOn") || n && n.get("triggerOn") || "mousemove|click";
  30873. fI("axisPointer", i, function(t, e, i) {
  30874. "none" !== o && ("leave" === t || 0 <= o.indexOf(t)) && i({
  30875. type: "updateAxisPointer",
  30876. currTrigger: t,
  30877. x: e && e.offsetX,
  30878. y: e && e.offsetY
  30879. })
  30880. })
  30881. },
  30882. remove: function(t, e) {
  30883. mI(e.getZr(), "axisPointer"),
  30884. vI.superApply(this._model, "remove", arguments)
  30885. },
  30886. dispose: function(t, e) {
  30887. mI("axisPointer", e),
  30888. vI.superApply(this._model, "dispose", arguments)
  30889. }
  30890. })
  30891. , yI = jo()
  30892. , xI = k
  30893. , _I = A;
  30894. function wI() {}
  30895. function bI(t, e, i, n) {
  30896. !function i(n, t) {
  30897. {
  30898. if (z(n) && z(t)) {
  30899. var o = !0;
  30900. return E(t, function(t, e) {
  30901. o = o && i(n[e], t)
  30902. }),
  30903. !!o
  30904. }
  30905. return n === t
  30906. }
  30907. }(yI(i).lastProp, n) && (yI(i).lastProp = n,
  30908. e ? cl(i, n, t) : (i.stopAnimation(),
  30909. i.attr(n)))
  30910. }
  30911. function SI(t, e) {
  30912. t[e.get("label.show") ? "show" : "hide"]()
  30913. }
  30914. function MI(t) {
  30915. return {
  30916. position: t.position.slice(),
  30917. rotation: t.rotation || 0
  30918. }
  30919. }
  30920. function II(t, e, i) {
  30921. var n = e.get("z")
  30922. , o = e.get("zlevel");
  30923. t && t.traverse(function(t) {
  30924. "group" !== t.type && (null != n && (t.z = n),
  30925. null != o && (t.zlevel = o),
  30926. t.silent = i)
  30927. })
  30928. }
  30929. function TI(t) {
  30930. var e, i = t.get("type"), n = t.getModel(i + "Style");
  30931. return "line" === i ? (e = n.getLineStyle()).fill = null : "shadow" === i && ((e = n.getAreaStyle()).stroke = null),
  30932. e
  30933. }
  30934. function AI(t, e, i, n, o) {
  30935. var a = DI(i.get("value"), e.axis, e.ecModel, i.get("seriesDataIndices"), {
  30936. precision: i.get("label.precision"),
  30937. formatter: i.get("label.formatter")
  30938. })
  30939. , r = i.getModel("label")
  30940. , s = iu(r.get("padding") || 0)
  30941. , l = r.getFont()
  30942. , u = gn(a, l)
  30943. , h = o.position
  30944. , c = u.width + s[1] + s[3]
  30945. , d = u.height + s[0] + s[2]
  30946. , f = o.align;
  30947. "right" === f && (h[0] -= c),
  30948. "center" === f && (h[0] -= c / 2);
  30949. var p = o.verticalAlign;
  30950. "bottom" === p && (h[1] -= d),
  30951. "middle" === p && (h[1] -= d / 2),
  30952. function(t, e, i, n) {
  30953. var o = n.getWidth()
  30954. , a = n.getHeight();
  30955. t[0] = Math.min(t[0] + e, o) - e,
  30956. t[1] = Math.min(t[1] + i, a) - i,
  30957. t[0] = Math.max(t[0], 0),
  30958. t[1] = Math.max(t[1], 0)
  30959. }(h, c, d, n);
  30960. var g = r.get("backgroundColor");
  30961. g && "auto" !== g || (g = e.get("axisLine.lineStyle.color")),
  30962. t.label = {
  30963. shape: {
  30964. x: 0,
  30965. y: 0,
  30966. width: c,
  30967. height: d,
  30968. r: r.get("borderRadius")
  30969. },
  30970. position: h.slice(),
  30971. style: {
  30972. text: a,
  30973. textFont: l,
  30974. textFill: r.getTextColor(),
  30975. textPosition: "inside",
  30976. textPadding: s,
  30977. fill: g,
  30978. stroke: r.get("borderColor") || "transparent",
  30979. lineWidth: r.get("borderWidth") || 0,
  30980. shadowBlur: r.get("shadowBlur"),
  30981. shadowColor: r.get("shadowColor"),
  30982. shadowOffsetX: r.get("shadowOffsetX"),
  30983. shadowOffsetY: r.get("shadowOffsetY")
  30984. },
  30985. z2: 10
  30986. }
  30987. }
  30988. function DI(t, e, o, i, n) {
  30989. t = e.scale.parse(t);
  30990. var a = e.scale.getLabel(t, {
  30991. precision: n.precision
  30992. })
  30993. , r = n.formatter;
  30994. if (r) {
  30995. var s = {
  30996. value: ug(e, t),
  30997. axisDimension: e.dim,
  30998. axisIndex: e.index,
  30999. seriesData: []
  31000. };
  31001. E(i, function(t) {
  31002. var e = o.getSeriesByIndex(t.seriesIndex)
  31003. , i = t.dataIndexInside
  31004. , n = e && e.getDataParams(i);
  31005. n && s.seriesData.push(n)
  31006. }),
  31007. R(r) ? a = r.replace("{value}", a) : C(r) && (a = r(s))
  31008. }
  31009. return a
  31010. }
  31011. function CI(t, e, i) {
  31012. var n = ae();
  31013. return he(n, n, i.rotation),
  31014. ue(n, n, i.position),
  31015. pl([t.dataToCoord(e), (i.labelOffset || 0) + (i.labelDirection || 1) * (i.labelMargin || 0)], n)
  31016. }
  31017. function LI(t, e, i, n, o, a) {
  31018. var r = Qm.innerTextLayout(i.rotation, 0, i.labelDirection);
  31019. i.labelMargin = o.get("label.margin"),
  31020. AI(e, n, o, a, {
  31021. position: CI(n.axis, t, i),
  31022. align: r.textAlign,
  31023. verticalAlign: r.textVerticalAlign
  31024. })
  31025. }
  31026. function kI(t, e, i) {
  31027. return {
  31028. x1: t[i = i || 0],
  31029. y1: t[1 - i],
  31030. x2: e[i],
  31031. y2: e[1 - i]
  31032. }
  31033. }
  31034. function PI(t, e, i) {
  31035. return {
  31036. x: t[i = i || 0],
  31037. y: t[1 - i],
  31038. width: e[i],
  31039. height: e[1 - i]
  31040. }
  31041. }
  31042. function NI(t, e, i, n, o, a) {
  31043. return {
  31044. cx: t,
  31045. cy: e,
  31046. r0: i,
  31047. r: n,
  31048. startAngle: o,
  31049. endAngle: a,
  31050. clockwise: !0
  31051. }
  31052. }
  31053. oa((wI.prototype = {
  31054. _group: null,
  31055. _lastGraphicKey: null,
  31056. _handle: null,
  31057. _dragging: !1,
  31058. _lastValue: null,
  31059. _lastStatus: null,
  31060. _payloadInfo: null,
  31061. animationThreshold: 15,
  31062. render: function(t, e, i, n) {
  31063. var o = e.get("value")
  31064. , a = e.get("status");
  31065. if (this._axisModel = t,
  31066. this._axisPointerModel = e,
  31067. this._api = i,
  31068. n || this._lastValue !== o || this._lastStatus !== a) {
  31069. this._lastValue = o,
  31070. this._lastStatus = a;
  31071. var r = this._group
  31072. , s = this._handle;
  31073. if (!a || "hide" === a)
  31074. return r && r.hide(),
  31075. void (s && s.hide());
  31076. r && r.show(),
  31077. s && s.show();
  31078. var l = {};
  31079. this.makeElOption(l, o, t, e, i);
  31080. var u = l.graphicKey;
  31081. u !== this._lastGraphicKey && this.clear(i),
  31082. this._lastGraphicKey = u;
  31083. var h = this._moveAnimation = this.determineAnimation(t, e);
  31084. if (r) {
  31085. var c = T(bI, e, h);
  31086. this.updatePointerEl(r, l, c, e),
  31087. this.updateLabelEl(r, l, c, e)
  31088. } else
  31089. r = this._group = new Ci,
  31090. this.createPointerEl(r, l, t, e),
  31091. this.createLabelEl(r, l, t, e),
  31092. i.getZr().add(r);
  31093. II(r, e, !0),
  31094. this._renderHandle(o)
  31095. }
  31096. },
  31097. remove: function(t) {
  31098. this.clear(t)
  31099. },
  31100. dispose: function(t) {
  31101. this.clear(t)
  31102. },
  31103. determineAnimation: function(t, e) {
  31104. var i = e.get("animation")
  31105. , n = t.axis
  31106. , o = "category" === n.type
  31107. , a = e.get("snap");
  31108. if (!a && !o)
  31109. return !1;
  31110. if ("auto" !== i && null != i)
  31111. return !0 === i;
  31112. var r = this.animationThreshold;
  31113. if (o && n.getBandWidth() > r)
  31114. return !0;
  31115. if (a) {
  31116. var s = fv(t).seriesDataCount
  31117. , l = n.getExtent();
  31118. return Math.abs(l[0] - l[1]) / s > r
  31119. }
  31120. return !1
  31121. },
  31122. makeElOption: function(t, e, i, n, o) {},
  31123. createPointerEl: function(t, e, i, n) {
  31124. var o = e.pointer;
  31125. if (o) {
  31126. var a = yI(t).pointerEl = new bl[o.type](xI(e.pointer));
  31127. t.add(a)
  31128. }
  31129. },
  31130. createLabelEl: function(t, e, i, n) {
  31131. if (e.label) {
  31132. var o = yI(t).labelEl = new rs(xI(e.label));
  31133. t.add(o),
  31134. SI(o, n)
  31135. }
  31136. },
  31137. updatePointerEl: function(t, e, i) {
  31138. var n = yI(t).pointerEl;
  31139. n && e.pointer && (n.setStyle(e.pointer.style),
  31140. i(n, {
  31141. shape: e.pointer.shape
  31142. }))
  31143. },
  31144. updateLabelEl: function(t, e, i, n) {
  31145. var o = yI(t).labelEl;
  31146. o && (o.setStyle(e.label.style),
  31147. i(o, {
  31148. shape: e.label.shape,
  31149. position: e.label.position
  31150. }),
  31151. SI(o, n))
  31152. },
  31153. _renderHandle: function(t) {
  31154. if (!this._dragging && this.updateHandleTransform) {
  31155. var e, i = this._axisPointerModel, n = this._api.getZr(), o = this._handle, a = i.getModel("handle"), r = i.get("status");
  31156. if (!a.get("show") || !r || "hide" === r)
  31157. return o && n.remove(o),
  31158. void (this._handle = null);
  31159. this._handle || (e = !0,
  31160. o = this._handle = yl(a.get("icon"), {
  31161. cursor: "move",
  31162. draggable: !0,
  31163. onmousemove: function(t) {
  31164. Xt(t.event)
  31165. },
  31166. onmousedown: _I(this._onHandleDragMove, this, 0, 0),
  31167. drift: _I(this._onHandleDragMove, this),
  31168. ondragend: _I(this._onHandleDragEnd, this)
  31169. }),
  31170. n.add(o)),
  31171. II(o, i, !1);
  31172. o.setStyle(a.getItemStyle(null, ["color", "borderColor", "borderWidth", "opacity", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"]));
  31173. var s = a.get("size");
  31174. L(s) || (s = [s, s]),
  31175. o.attr("scale", [s[0] / 2, s[1] / 2]),
  31176. kc(this, "_doDispatchAxisPointer", a.get("throttle") || 0, "fixRate"),
  31177. this._moveHandleToValue(t, e)
  31178. }
  31179. },
  31180. _moveHandleToValue: function(t, e) {
  31181. bI(this._axisPointerModel, !e && this._moveAnimation, this._handle, MI(this.getHandleTransform(t, this._axisModel, this._axisPointerModel)))
  31182. },
  31183. _onHandleDragMove: function(t, e) {
  31184. var i = this._handle;
  31185. if (i) {
  31186. this._dragging = !0;
  31187. var n = this.updateHandleTransform(MI(i), [t, e], this._axisModel, this._axisPointerModel);
  31188. this._payloadInfo = n,
  31189. i.stopAnimation(),
  31190. i.attr(MI(n)),
  31191. yI(i).lastProp = null,
  31192. this._doDispatchAxisPointer()
  31193. }
  31194. },
  31195. _doDispatchAxisPointer: function() {
  31196. if (this._handle) {
  31197. var t = this._payloadInfo
  31198. , e = this._axisModel;
  31199. this._api.dispatchAction({
  31200. type: "updateAxisPointer",
  31201. x: t.cursorPoint[0],
  31202. y: t.cursorPoint[1],
  31203. tooltipOption: t.tooltipOption,
  31204. axesInfo: [{
  31205. axisDim: e.axis.dim,
  31206. axisIndex: e.componentIndex
  31207. }]
  31208. })
  31209. }
  31210. },
  31211. _onHandleDragEnd: function(t) {
  31212. if (this._dragging = !1,
  31213. this._handle) {
  31214. var e = this._axisPointerModel.get("value");
  31215. this._moveHandleToValue(e),
  31216. this._api.dispatchAction({
  31217. type: "hideTip"
  31218. })
  31219. }
  31220. },
  31221. getHandleTransform: null,
  31222. updateHandleTransform: null,
  31223. clear: function(t) {
  31224. this._lastValue = null,
  31225. this._lastStatus = null;
  31226. var e = t.getZr()
  31227. , i = this._group
  31228. , n = this._handle;
  31229. e && i && (this._lastGraphicKey = null,
  31230. i && e.remove(i),
  31231. n && e.remove(n),
  31232. this._group = null,
  31233. this._handle = null,
  31234. this._payloadInfo = null)
  31235. },
  31236. doClear: function() {},
  31237. buildLabel: function(t, e, i) {
  31238. return {
  31239. x: t[i = i || 0],
  31240. y: t[1 - i],
  31241. width: e[i],
  31242. height: e[1 - i]
  31243. }
  31244. }
  31245. }).constructor = wI);
  31246. var OI = wI.extend({
  31247. makeElOption: function(t, e, i, n, o) {
  31248. var a = i.axis
  31249. , r = a.grid
  31250. , s = n.get("type")
  31251. , l = EI(r, a).getOtherAxis(a).getGlobalExtent()
  31252. , u = a.toGlobalCoord(a.dataToCoord(e, !0));
  31253. if (s && "none" !== s) {
  31254. var h = TI(n)
  31255. , c = RI[s](a, u, l);
  31256. c.style = h,
  31257. t.graphicKey = c.type,
  31258. t.pointer = c
  31259. }
  31260. LI(e, t, _v(r.model, i), i, n, o)
  31261. },
  31262. getHandleTransform: function(t, e, i) {
  31263. var n = _v(e.axis.grid.model, e, {
  31264. labelInside: !1
  31265. });
  31266. return n.labelMargin = i.get("handle.margin"),
  31267. {
  31268. position: CI(e.axis, t, n),
  31269. rotation: n.rotation + (n.labelDirection < 0 ? Math.PI : 0)
  31270. }
  31271. },
  31272. updateHandleTransform: function(t, e, i, n) {
  31273. var o = i.axis
  31274. , a = o.grid
  31275. , r = o.getGlobalExtent(!0)
  31276. , s = EI(a, o).getOtherAxis(o).getGlobalExtent()
  31277. , l = "x" === o.dim ? 0 : 1
  31278. , u = t.position;
  31279. u[l] += e[l],
  31280. u[l] = Math.min(r[1], u[l]),
  31281. u[l] = Math.max(r[0], u[l]);
  31282. var h = (s[1] + s[0]) / 2
  31283. , c = [h, h];
  31284. c[l] = u[l];
  31285. return {
  31286. position: u,
  31287. rotation: t.rotation,
  31288. cursorPoint: c,
  31289. tooltipOption: [{
  31290. verticalAlign: "middle"
  31291. }, {
  31292. align: "center"
  31293. }][l]
  31294. }
  31295. }
  31296. });
  31297. function EI(t, e) {
  31298. var i = {};
  31299. return i[e.dim + "AxisIndex"] = e.index,
  31300. t.getCartesian(i)
  31301. }
  31302. var RI = {
  31303. line: function(t, e, i) {
  31304. return {
  31305. type: "Line",
  31306. subPixelOptimize: !0,
  31307. shape: kI([e, i[0]], [e, i[1]], zI(t))
  31308. }
  31309. },
  31310. shadow: function(t, e, i) {
  31311. var n = Math.max(1, t.getBandWidth())
  31312. , o = i[1] - i[0];
  31313. return {
  31314. type: "Rect",
  31315. shape: PI([e - n / 2, i[0]], [n, o], zI(t))
  31316. }
  31317. }
  31318. };
  31319. function zI(t) {
  31320. return "x" === t.dim ? 0 : 1
  31321. }
  31322. mv.registerAxisPointerClass("CartesianAxisPointer", OI),
  31323. yf(function(t) {
  31324. if (t) {
  31325. t.axisPointer && 0 !== t.axisPointer.length || (t.axisPointer = {});
  31326. var e = t.axisPointer.link;
  31327. e && !L(e) && (t.axisPointer.link = [e])
  31328. }
  31329. }),
  31330. xf(Ld.PROCESSOR.STATISTIC, function(t, e) {
  31331. t.getComponent("axisPointer").coordSysAxesInfo = cv(t, e)
  31332. }),
  31333. _f({
  31334. type: "updateAxisPointer",
  31335. event: "updateAxisPointer",
  31336. update: ":updateAxisPointer"
  31337. }, function(t, e, i) {
  31338. var n = t.currTrigger
  31339. , r = [t.x, t.y]
  31340. , o = t
  31341. , a = t.dispatchAction || A(i.dispatchAction, i)
  31342. , s = e.getComponent("axisPointer").coordSysAxesInfo;
  31343. if (s) {
  31344. hI(r) && (r = iI({
  31345. seriesIndex: o.seriesIndex,
  31346. dataIndex: o.dataIndex
  31347. }, e).point);
  31348. var l = hI(r)
  31349. , u = o.axesInfo
  31350. , h = s.axesInfo
  31351. , c = "leave" === n || hI(r)
  31352. , d = {}
  31353. , f = {}
  31354. , p = {
  31355. list: [],
  31356. map: {}
  31357. }
  31358. , g = {
  31359. showPointer: oI(sI, f),
  31360. showTooltip: oI(lI, p)
  31361. };
  31362. nI(s.coordSysMap, function(t, e) {
  31363. var a = l || t.containPoint(r);
  31364. nI(s.coordSysAxesInfo[e], function(t, e) {
  31365. var i = t.axis
  31366. , n = function(t, e) {
  31367. for (var i = 0; i < (t || []).length; i++) {
  31368. var n = t[i];
  31369. if (e.axis.dim === n.axisDim && e.axis.model.componentIndex === n.axisIndex)
  31370. return n
  31371. }
  31372. }(u, t);
  31373. if (!c && a && (!u || n)) {
  31374. var o = n && n.value;
  31375. null != o || l || (o = i.pointToData(r)),
  31376. null != o && rI(t, o, g, !1, d)
  31377. }
  31378. })
  31379. });
  31380. var m = {};
  31381. return nI(h, function(o, t) {
  31382. var a = o.linkGroup;
  31383. a && !f[t] && nI(a.axesInfo, function(t, e) {
  31384. var i = f[e];
  31385. if (t !== o && i) {
  31386. var n = i.value;
  31387. a.mapper && (n = o.axis.scale.parse(a.mapper(n, uI(t), uI(o)))),
  31388. m[o.key] = n
  31389. }
  31390. })
  31391. }),
  31392. nI(m, function(t, e) {
  31393. rI(h[e], t, g, !0, d)
  31394. }),
  31395. function(o, t, e) {
  31396. var a = e.axesInfo = [];
  31397. nI(t, function(t, e) {
  31398. var i = t.axisPointerModel.option
  31399. , n = o[e];
  31400. n ? (t.useHandle || (i.status = "show"),
  31401. i.value = n.value,
  31402. i.seriesDataIndices = (n.payloadBatch || []).slice()) : t.useHandle || (i.status = "hide"),
  31403. "show" === i.status && a.push({
  31404. axisDim: t.axis.dim,
  31405. axisIndex: t.axis.model.componentIndex,
  31406. value: i.value
  31407. })
  31408. })
  31409. }(f, h, d),
  31410. function(t, e, i, n) {
  31411. if (hI(e) || !t.list.length)
  31412. return n({
  31413. type: "hideTip"
  31414. });
  31415. var o = ((t.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};
  31416. n({
  31417. type: "showTip",
  31418. escapeConnect: !0,
  31419. x: e[0],
  31420. y: e[1],
  31421. tooltipOption: i.tooltipOption,
  31422. position: i.position,
  31423. dataIndexInside: o.dataIndexInside,
  31424. dataIndex: o.dataIndex,
  31425. seriesIndex: o.seriesIndex,
  31426. dataByCoordSys: t.list
  31427. })
  31428. }(p, r, t, a),
  31429. function(t, e, i) {
  31430. var n = i.getZr()
  31431. , o = "axisPointerLastHighlights"
  31432. , a = aI(n)[o] || {}
  31433. , r = aI(n)[o] = {};
  31434. nI(t, function(t, e) {
  31435. var i = t.axisPointerModel.option;
  31436. "show" === i.status && nI(i.seriesDataIndices, function(t) {
  31437. var e = t.seriesIndex + " | " + t.dataIndex;
  31438. r[e] = t
  31439. })
  31440. });
  31441. var s = []
  31442. , l = [];
  31443. E(a, function(t, e) {
  31444. r[e] || l.push(t)
  31445. }),
  31446. E(r, function(t, e) {
  31447. a[e] || s.push(t)
  31448. }),
  31449. l.length && i.dispatchAction({
  31450. type: "downplay",
  31451. escapeConnect: !0,
  31452. batch: l
  31453. }),
  31454. s.length && i.dispatchAction({
  31455. type: "highlight",
  31456. escapeConnect: !0,
  31457. batch: s
  31458. })
  31459. }(h, 0, i),
  31460. d
  31461. }
  31462. });
  31463. var BI = ["x", "y"]
  31464. , VI = ["width", "height"]
  31465. , GI = wI.extend({
  31466. makeElOption: function(t, e, i, n, o) {
  31467. var a = i.axis
  31468. , r = a.coordinateSystem
  31469. , s = HI(r, 1 - WI(a))
  31470. , l = r.dataToPoint(e)[0]
  31471. , u = n.get("type");
  31472. if (u && "none" !== u) {
  31473. var h = TI(n)
  31474. , c = FI[u](a, l, s);
  31475. c.style = h,
  31476. t.graphicKey = c.type,
  31477. t.pointer = c
  31478. }
  31479. LI(e, t, $M(i), i, n, o)
  31480. },
  31481. getHandleTransform: function(t, e, i) {
  31482. var n = $M(e, {
  31483. labelInside: !1
  31484. });
  31485. return n.labelMargin = i.get("handle.margin"),
  31486. {
  31487. position: CI(e.axis, t, n),
  31488. rotation: n.rotation + (n.labelDirection < 0 ? Math.PI : 0)
  31489. }
  31490. },
  31491. updateHandleTransform: function(t, e, i, n) {
  31492. var o = i.axis
  31493. , a = o.coordinateSystem
  31494. , r = WI(o)
  31495. , s = HI(a, r)
  31496. , l = t.position;
  31497. l[r] += e[r],
  31498. l[r] = Math.min(s[1], l[r]),
  31499. l[r] = Math.max(s[0], l[r]);
  31500. var u = HI(a, 1 - r)
  31501. , h = (u[1] + u[0]) / 2
  31502. , c = [h, h];
  31503. return c[r] = l[r],
  31504. {
  31505. position: l,
  31506. rotation: t.rotation,
  31507. cursorPoint: c,
  31508. tooltipOption: {
  31509. verticalAlign: "middle"
  31510. }
  31511. }
  31512. }
  31513. })
  31514. , FI = {
  31515. line: function(t, e, i) {
  31516. return {
  31517. type: "Line",
  31518. subPixelOptimize: !0,
  31519. shape: kI([e, i[0]], [e, i[1]], WI(t))
  31520. }
  31521. },
  31522. shadow: function(t, e, i) {
  31523. var n = t.getBandWidth()
  31524. , o = i[1] - i[0];
  31525. return {
  31526. type: "Rect",
  31527. shape: PI([e - n / 2, i[0]], [n, o], WI(t))
  31528. }
  31529. }
  31530. };
  31531. function WI(t) {
  31532. return t.isHorizontal() ? 0 : 1
  31533. }
  31534. function HI(t, e) {
  31535. var i = t.getRect();
  31536. return [i[BI[e]], i[BI[e]] + i[VI[e]]]
  31537. }
  31538. mv.registerAxisPointerClass("SingleAxisPointer", GI),
  31539. Af({
  31540. type: "single"
  31541. });
  31542. var ZI = sc.extend({
  31543. type: "series.themeRiver",
  31544. dependencies: ["singleAxis"],
  31545. nameMap: null,
  31546. init: function(t) {
  31547. ZI.superApply(this, "init", arguments),
  31548. this.legendVisualProvider = new qv(A(this.getData, this),A(this.getRawData, this))
  31549. },
  31550. fixData: function(t) {
  31551. var e = t.length
  31552. , i = ta(t, function(t) {
  31553. return t[2]
  31554. })
  31555. , n = [];
  31556. i.buckets.each(function(t, e) {
  31557. n.push({
  31558. name: e,
  31559. dataList: t
  31560. })
  31561. });
  31562. for (var o = n.length, a = -1, r = -1, s = 0; s < o; ++s) {
  31563. var l = n[s].dataList.length;
  31564. a < l && (a = l,
  31565. r = s)
  31566. }
  31567. for (var u = 0; u < o; ++u)
  31568. if (u !== r)
  31569. for (var h = n[u].name, c = 0; c < a; ++c) {
  31570. for (var d = n[r].dataList[c][0], f = n[u].dataList.length, p = -1, g = 0; g < f; ++g) {
  31571. if (n[u].dataList[g][0] === d) {
  31572. p = g;
  31573. break
  31574. }
  31575. }
  31576. -1 === p && (t[e] = [],
  31577. t[e][0] = d,
  31578. t[e][1] = 0,
  31579. t[e][2] = h,
  31580. e++)
  31581. }
  31582. return t
  31583. },
  31584. getInitialData: function(t, e) {
  31585. for (var i = e.queryComponents({
  31586. mainType: "singleAxis",
  31587. index: this.get("singleAxisIndex"),
  31588. id: this.get("singleAxisId")
  31589. })[0].get("type"), n = M(t.data, function(t) {
  31590. return void 0 !== t[2]
  31591. }), o = this.fixData(n || []), a = [], r = this.nameMap = Q(), s = 0, l = 0; l < o.length; ++l)
  31592. a.push(o[l][2]),
  31593. r.get(o[l][2]) || (r.set(o[l][2], s),
  31594. s++);
  31595. var u = lp(o, {
  31596. coordDimensions: ["single"],
  31597. dimensionsDefine: [{
  31598. name: "time",
  31599. type: Ef(i)
  31600. }, {
  31601. name: "value",
  31602. type: "float"
  31603. }, {
  31604. name: "name",
  31605. type: "ordinal"
  31606. }],
  31607. encodeDefine: {
  31608. single: 0,
  31609. value: 1,
  31610. itemName: 2
  31611. }
  31612. })
  31613. , h = new Yf(u,this);
  31614. return h.initData(o),
  31615. h
  31616. },
  31617. getLayerSeries: function() {
  31618. for (var i = this.getData(), t = i.count(), e = [], n = 0; n < t; ++n)
  31619. e[n] = n;
  31620. var o = i.mapDimension("single")
  31621. , a = ta(e, function(t) {
  31622. return i.get("name", t)
  31623. })
  31624. , r = [];
  31625. return a.buckets.each(function(t, e) {
  31626. t.sort(function(t, e) {
  31627. return i.get(o, t) - i.get(o, e)
  31628. }),
  31629. r.push({
  31630. name: e,
  31631. indices: t
  31632. })
  31633. }),
  31634. r
  31635. },
  31636. getAxisTooltipData: function(t, e, i) {
  31637. L(t) || (t = t ? [t] : []);
  31638. for (var n, o = this.getData(), a = this.getLayerSeries(), r = [], s = a.length, l = 0; l < s; ++l) {
  31639. for (var u = Number.MAX_VALUE, h = -1, c = a[l].indices.length, d = 0; d < c; ++d) {
  31640. var f = o.get(t[0], a[l].indices[d])
  31641. , p = Math.abs(f - e);
  31642. p <= u && (n = f,
  31643. u = p,
  31644. h = a[l].indices[d])
  31645. }
  31646. r.push(h)
  31647. }
  31648. return {
  31649. dataIndices: r,
  31650. nestestValue: n
  31651. }
  31652. },
  31653. formatTooltip: function(t) {
  31654. var e = this.getData()
  31655. , i = e.getName(t)
  31656. , n = e.get(e.mapDimension("value"), t);
  31657. return !isNaN(n) && null != n || (n = "-"),
  31658. au(i + " : " + n)
  31659. },
  31660. defaultOption: {
  31661. zlevel: 0,
  31662. z: 2,
  31663. coordinateSystem: "singleAxis",
  31664. boundaryGap: ["10%", "10%"],
  31665. singleAxisIndex: 0,
  31666. animationEasing: "linear",
  31667. label: {
  31668. margin: 4,
  31669. show: !0,
  31670. position: "left",
  31671. color: "#000",
  31672. fontSize: 11
  31673. },
  31674. emphasis: {
  31675. label: {
  31676. show: !0
  31677. }
  31678. }
  31679. }
  31680. });
  31681. Cf({
  31682. type: "themeRiver",
  31683. init: function() {
  31684. this._layers = []
  31685. },
  31686. render: function(b, t, e) {
  31687. var S = b.getData()
  31688. , M = this.group
  31689. , I = b.getLayerSeries()
  31690. , i = S.getLayout("layoutInfo")
  31691. , n = i.rect
  31692. , o = i.boundaryGap;
  31693. function a(t) {
  31694. return t.name
  31695. }
  31696. M.attr("position", [0, n.y + o[0]]);
  31697. var r = new kf(this._layersSeries || [],I,a,a)
  31698. , T = {};
  31699. function s(t, e, i) {
  31700. var n = this._layers;
  31701. if ("remove" !== t) {
  31702. for (var o, a, r, s = [], l = [], u = I[e].indices, h = 0; h < u.length; h++) {
  31703. var c = S.getItemLayout(u[h])
  31704. , d = c.x
  31705. , f = c.y0
  31706. , p = c.y;
  31707. s.push([d, f]),
  31708. l.push([d, f + p]),
  31709. o = S.getItemVisual(u[h], "color")
  31710. }
  31711. var g = S.getItemLayout(u[0])
  31712. , m = S.getItemModel(u[h - 1])
  31713. , v = m.getModel("label")
  31714. , y = v.get("margin");
  31715. if ("add" === t) {
  31716. var x = T[e] = new Ci;
  31717. a = new _m({
  31718. shape: {
  31719. points: s,
  31720. stackedOnPoints: l,
  31721. smooth: .4,
  31722. stackedOnSmooth: .4,
  31723. smoothConstraint: !1
  31724. },
  31725. z2: 0
  31726. }),
  31727. r = new Ur({
  31728. style: {
  31729. x: g.x - y,
  31730. y: g.y0 + g.y / 2
  31731. }
  31732. }),
  31733. x.add(a),
  31734. x.add(r),
  31735. M.add(x),
  31736. a.setClipPath(function(t, e, i) {
  31737. var n = new rs({
  31738. shape: {
  31739. x: t.x - 10,
  31740. y: t.y - 10,
  31741. width: 0,
  31742. height: t.height + 20
  31743. }
  31744. });
  31745. return dl(n, {
  31746. shape: {
  31747. width: t.width + 20,
  31748. height: t.height + 20
  31749. }
  31750. }, e, i),
  31751. n
  31752. }(a.getBoundingRect(), b, function() {
  31753. a.removeClipPath()
  31754. }))
  31755. } else {
  31756. x = n[i];
  31757. a = x.childAt(0),
  31758. r = x.childAt(1),
  31759. M.add(x),
  31760. T[e] = x,
  31761. cl(a, {
  31762. shape: {
  31763. points: s,
  31764. stackedOnPoints: l
  31765. }
  31766. }, b),
  31767. cl(r, {
  31768. style: {
  31769. x: g.x - y,
  31770. y: g.y0 + g.y / 2
  31771. }
  31772. }, b)
  31773. }
  31774. var _ = m.getModel("emphasis.itemStyle")
  31775. , w = m.getModel("itemStyle");
  31776. nl(r.style, v, {
  31777. text: v.get("show") ? b.getFormattedLabel(u[h - 1], "normal") || S.getName(u[h - 1]) : null,
  31778. textVerticalAlign: "middle"
  31779. }),
  31780. a.setStyle(P({
  31781. fill: o
  31782. }, w.getItemStyle(["color"]))),
  31783. $s(a, _.getItemStyle())
  31784. } else
  31785. M.remove(n[e])
  31786. }
  31787. r.add(A(s, this, "add")).update(A(s, this, "update")).remove(A(s, this, "remove")).execute(),
  31788. this._layersSeries = I,
  31789. this._layers = T
  31790. },
  31791. dispose: function() {}
  31792. });
  31793. function UI(i, t, e) {
  31794. if (i.count())
  31795. for (var n, o = t.coordinateSystem, a = t.getLayerSeries(), r = i.mapDimension("single"), s = i.mapDimension("value"), l = O(a, function(t) {
  31796. return O(t.indices, function(t) {
  31797. var e = o.dataToPoint(i.get(r, t));
  31798. return e[1] = i.get(s, t),
  31799. e
  31800. })
  31801. }), u = function(t) {
  31802. for (var e = t.length, i = t[0].length, n = [], o = [], a = 0, r = {}, s = 0; s < i; ++s) {
  31803. for (var l = 0, u = 0; l < e; ++l)
  31804. u += t[l][s][1];
  31805. a < u && (a = u),
  31806. n.push(u)
  31807. }
  31808. for (var h = 0; h < i; ++h)
  31809. o[h] = (a - n[h]) / 2;
  31810. for (var c = a = 0; c < i; ++c) {
  31811. var d = n[c] + o[c];
  31812. a < d && (a = d)
  31813. }
  31814. return r.y0 = o,
  31815. r.max = a,
  31816. r
  31817. }(l), h = u.y0, c = e / u.max, d = a.length, f = a[0].indices.length, p = 0; p < f; ++p) {
  31818. n = h[p] * c,
  31819. i.setItemLayout(a[0].indices[p], {
  31820. layerIndex: 0,
  31821. x: l[0][p][0],
  31822. y0: n,
  31823. y: l[0][p][1] * c
  31824. });
  31825. for (var g = 1; g < d; ++g)
  31826. n += l[g - 1][p][1] * c,
  31827. i.setItemLayout(a[g].indices[p], {
  31828. layerIndex: g,
  31829. x: l[g][p][0],
  31830. y0: n,
  31831. y: l[g][p][1] * c
  31832. })
  31833. }
  31834. }
  31835. bf(function(t, e) {
  31836. t.eachSeriesByType("themeRiver", function(t) {
  31837. var e = t.getData()
  31838. , i = t.coordinateSystem
  31839. , n = {}
  31840. , o = i.getRect();
  31841. n.rect = o;
  31842. var a = t.get("boundaryGap")
  31843. , r = i.getAxis();
  31844. (n.boundaryGap = a,
  31845. "horizontal" === r.orient) ? (a[0] = Rl(a[0], o.height),
  31846. a[1] = Rl(a[1], o.height),
  31847. UI(e, t, o.height - a[0] - a[1])) : (a[0] = Rl(a[0], o.width),
  31848. a[1] = Rl(a[1], o.width),
  31849. UI(e, t, o.width - a[0] - a[1]));
  31850. e.setLayout("layoutInfo", n)
  31851. })
  31852. }),
  31853. Sf(function(t) {
  31854. t.eachSeriesByType("themeRiver", function(o) {
  31855. var a = o.getData()
  31856. , r = o.getRawData()
  31857. , s = o.get("color")
  31858. , l = Q();
  31859. a.each(function(t) {
  31860. l.set(a.getRawIndex(t), t)
  31861. }),
  31862. r.each(function(t) {
  31863. var e = r.getName(t)
  31864. , i = s[(o.nameMap.get(e) - 1) % s.length];
  31865. r.setItemVisual(t, "color", i);
  31866. var n = l.get(t);
  31867. null != n && a.setItemVisual(n, "color", i)
  31868. })
  31869. })
  31870. }),
  31871. xf(uy("themeRiver")),
  31872. sc.extend({
  31873. type: "series.sunburst",
  31874. _viewRoot: null,
  31875. getInitialData: function(t, e) {
  31876. var i = {
  31877. name: t.name,
  31878. children: t.data
  31879. };
  31880. !function i(t) {
  31881. var n = 0;
  31882. E(t.children, function(t) {
  31883. i(t);
  31884. var e = t.value;
  31885. L(e) && (e = e[0]),
  31886. n += e
  31887. });
  31888. var e = t.value;
  31889. L(e) && (e = e[0]);
  31890. null != e && !isNaN(e) || (e = n);
  31891. e < 0 && (e = 0);
  31892. L(t.value) ? t.value[0] = e : t.value = e
  31893. }(i);
  31894. var n = t.levels || []
  31895. , o = {};
  31896. return o.levels = n,
  31897. Ax.createTree(i, this, o).data
  31898. },
  31899. optionUpdated: function() {
  31900. this.resetViewRoot()
  31901. },
  31902. getDataParams: function(t) {
  31903. var e = sc.prototype.getDataParams.apply(this, arguments)
  31904. , i = this.getData().tree.getNodeByDataIndex(t);
  31905. return e.treePathInfo = Yx(i, this),
  31906. e
  31907. },
  31908. defaultOption: {
  31909. zlevel: 0,
  31910. z: 2,
  31911. center: ["50%", "50%"],
  31912. radius: [0, "75%"],
  31913. clockwise: !0,
  31914. startAngle: 90,
  31915. minAngle: 0,
  31916. percentPrecision: 2,
  31917. stillShowZeroSum: !0,
  31918. highlightPolicy: "descendant",
  31919. nodeClick: "rootToNode",
  31920. renderLabelForZeroData: !1,
  31921. label: {
  31922. rotate: "radial",
  31923. show: !0,
  31924. opacity: 1,
  31925. align: "center",
  31926. position: "inside",
  31927. distance: 5,
  31928. silent: !0
  31929. },
  31930. itemStyle: {
  31931. borderWidth: 1,
  31932. borderColor: "white",
  31933. borderType: "solid",
  31934. shadowBlur: 0,
  31935. shadowColor: "rgba(0, 0, 0, 0.2)",
  31936. shadowOffsetX: 0,
  31937. shadowOffsetY: 0,
  31938. opacity: 1
  31939. },
  31940. highlight: {
  31941. itemStyle: {
  31942. opacity: 1
  31943. }
  31944. },
  31945. downplay: {
  31946. itemStyle: {
  31947. opacity: .5
  31948. },
  31949. label: {
  31950. opacity: .6
  31951. }
  31952. },
  31953. animationType: "expansion",
  31954. animationDuration: 1e3,
  31955. animationDurationUpdate: 500,
  31956. animationEasing: "cubicOut",
  31957. data: [],
  31958. levels: [],
  31959. sort: "desc"
  31960. },
  31961. getViewRoot: function() {
  31962. return this._viewRoot
  31963. },
  31964. resetViewRoot: function(t) {
  31965. t ? this._viewRoot = t : t = this._viewRoot;
  31966. var e = this.getRawData().tree.root;
  31967. t && (t === e || e.contains(t)) || (this._viewRoot = e)
  31968. }
  31969. });
  31970. var XI = "none"
  31971. , YI = "ancestor"
  31972. , jI = "self"
  31973. , qI = 2
  31974. , KI = 4;
  31975. function $I(t, e, i) {
  31976. Ci.call(this);
  31977. var n = new qr({
  31978. z2: qI
  31979. });
  31980. n.seriesIndex = e.seriesIndex;
  31981. var o = new Ur({
  31982. z2: KI,
  31983. silent: t.getModel("label").get("silent")
  31984. });
  31985. function a() {
  31986. o.ignore = o.hoverIgnore
  31987. }
  31988. function r() {
  31989. o.ignore = o.normalIgnore
  31990. }
  31991. this.add(n),
  31992. this.add(o),
  31993. this.updateData(!0, t, "normal", e, i),
  31994. this.on("emphasis", a).on("normal", r).on("mouseover", a).on("mouseout", r)
  31995. }
  31996. var JI = $I.prototype;
  31997. JI.updateData = function(t, e, i, n, o) {
  31998. (this.node = e).piece = this,
  31999. n = n || this._seriesModel,
  32000. o = o || this._ecModel;
  32001. var a = this.childAt(0);
  32002. a.dataIndex = e.dataIndex;
  32003. var r = e.getModel()
  32004. , s = e.getLayout()
  32005. , l = P({}, s);
  32006. l.label = null;
  32007. var u = function(t, e, i) {
  32008. var n = t.getVisual("color")
  32009. , o = t.getVisual("visualMeta");
  32010. o && 0 !== o.length || (n = null);
  32011. var a = t.getModel("itemStyle").get("color");
  32012. {
  32013. if (a)
  32014. return a;
  32015. if (n)
  32016. return n;
  32017. if (0 === t.depth)
  32018. return i.option.color[0];
  32019. var r = i.option.color.length;
  32020. a = i.option.color[function(t) {
  32021. var e = t;
  32022. for (; 1 < e.depth; )
  32023. e = e.parentNode;
  32024. return _(t.getAncestors()[0].children, e)
  32025. }(t) % r]
  32026. }
  32027. return a
  32028. }(e, 0, o);
  32029. !function(t, e, i) {
  32030. e.getData().setItemVisual(t.dataIndex, "color", i)
  32031. }(e, n, u);
  32032. var h, c = r.getModel("itemStyle").getItemStyle();
  32033. "normal" === i ? h = c : h = m(r.getModel(i + ".itemStyle").getItemStyle(), c);
  32034. h = D({
  32035. lineJoin: "bevel",
  32036. fill: h.fill || u
  32037. }, h),
  32038. t ? (a.setShape(l),
  32039. a.shape.r = s.r0,
  32040. cl(a, {
  32041. shape: {
  32042. r: s.r
  32043. }
  32044. }, n, e.dataIndex),
  32045. a.useStyle(h)) : "object" == typeof h.fill && h.fill.type || "object" == typeof a.style.fill && a.style.fill.type ? (cl(a, {
  32046. shape: l
  32047. }, n),
  32048. a.useStyle(h)) : cl(a, {
  32049. shape: l,
  32050. style: h
  32051. }, n),
  32052. this._updateLabel(n, u, i);
  32053. var d = r.getShallow("cursor");
  32054. if (d && a.attr("cursor", d),
  32055. t) {
  32056. var f = n.getShallow("highlightPolicy");
  32057. this._initEvents(a, e, n, f)
  32058. }
  32059. this._seriesModel = n || this._seriesModel,
  32060. this._ecModel = o || this._ecModel,
  32061. $s(this)
  32062. }
  32063. ,
  32064. JI.onEmphasis = function(e) {
  32065. var i = this;
  32066. this.node.hostTree.root.eachNode(function(t) {
  32067. t.piece && (i.node === t ? t.piece.updateData(!1, t, "emphasis") : !function(t, e, i) {
  32068. return i !== XI && (i === jI ? t === e : i === YI ? t === e || t.isAncestorOf(e) : t === e || t.isDescendantOf(e))
  32069. }(t, i.node, e) ? e !== XI && t.piece.childAt(0).trigger("downplay") : t.piece.childAt(0).trigger("highlight"))
  32070. })
  32071. }
  32072. ,
  32073. JI.onNormal = function() {
  32074. this.node.hostTree.root.eachNode(function(t) {
  32075. t.piece && t.piece.updateData(!1, t, "normal")
  32076. })
  32077. }
  32078. ,
  32079. JI.onHighlight = function() {
  32080. this.updateData(!1, this.node, "highlight")
  32081. }
  32082. ,
  32083. JI.onDownplay = function() {
  32084. this.updateData(!1, this.node, "downplay")
  32085. }
  32086. ,
  32087. JI._updateLabel = function(t, e, i) {
  32088. var n = this.node.getModel()
  32089. , o = n.getModel("label")
  32090. , a = "normal" === i || "emphasis" === i ? o : n.getModel(i + ".label")
  32091. , r = n.getModel("emphasis.label")
  32092. , s = W(t.getFormattedLabel(this.node.dataIndex, i, null, null, "label"), this.node.name);
  32093. !1 === S("show") && (s = "");
  32094. var l = this.node.getLayout()
  32095. , u = a.get("minAngle");
  32096. null == u && (u = o.get("minAngle")),
  32097. u = u / 180 * Math.PI;
  32098. var h = l.endAngle - l.startAngle;
  32099. null != u && Math.abs(h) < u && (s = "");
  32100. var c = this.childAt(1);
  32101. el(c.style, c.hoverStyle || {}, o, r, {
  32102. defaultText: a.getShallow("show") ? s : null,
  32103. autoColor: e,
  32104. useInsideStyle: !0
  32105. });
  32106. var d, f = (l.startAngle + l.endAngle) / 2, p = Math.cos(f), g = Math.sin(f), m = S("position"), v = S("distance") || 0, y = S("align");
  32107. "outside" === m ? (d = l.r + v,
  32108. y = f > Math.PI / 2 ? "right" : "left") : y && "center" !== y ? "left" === y ? (d = l.r0 + v,
  32109. f > Math.PI / 2 && (y = "right")) : "right" === y && (d = l.r - v,
  32110. f > Math.PI / 2 && (y = "left")) : (d = (l.r + l.r0) / 2,
  32111. y = "center"),
  32112. c.attr("style", {
  32113. text: s,
  32114. textAlign: y,
  32115. textVerticalAlign: S("verticalAlign") || "middle",
  32116. opacity: S("opacity")
  32117. });
  32118. var x = d * p + l.cx
  32119. , _ = d * g + l.cy;
  32120. c.attr("position", [x, _]);
  32121. var w = S("rotate")
  32122. , b = 0;
  32123. function S(t) {
  32124. var e = a.get(t);
  32125. return null == e ? o.get(t) : e
  32126. }
  32127. "radial" === w ? (b = -f) < -Math.PI / 2 && (b += Math.PI) : "tangential" === w ? (b = Math.PI / 2 - f) > Math.PI / 2 ? b -= Math.PI : b < -Math.PI / 2 && (b += Math.PI) : "number" == typeof w && (b = w * Math.PI / 180),
  32128. c.attr("rotation", b)
  32129. }
  32130. ,
  32131. JI._initEvents = function(t, e, i, n) {
  32132. t.off("mouseover").off("mouseout").off("emphasis").off("normal");
  32133. function o() {
  32134. r.onEmphasis(n)
  32135. }
  32136. function a() {
  32137. r.onNormal()
  32138. }
  32139. var r = this;
  32140. i.isAnimationEnabled() && t.on("mouseover", o).on("mouseout", a).on("emphasis", o).on("normal", a).on("downplay", function() {
  32141. r.onDownplay()
  32142. }).on("highlight", function() {
  32143. r.onHighlight()
  32144. })
  32145. }
  32146. ,
  32147. w($I, Ci);
  32148. _c.extend({
  32149. type: "sunburst",
  32150. init: function() {},
  32151. render: function(o, a, t, e) {
  32152. var n = this;
  32153. this.seriesModel = o,
  32154. this.api = t,
  32155. this.ecModel = a;
  32156. var r = o.getData()
  32157. , s = r.tree.root
  32158. , i = o.getViewRoot()
  32159. , l = this.group
  32160. , u = o.get("renderLabelForZeroData")
  32161. , h = [];
  32162. i.eachNode(function(t) {
  32163. h.push(t)
  32164. });
  32165. var c = this._oldChildren || [];
  32166. if (function(i, n) {
  32167. if (0 === i.length && 0 === n.length)
  32168. return;
  32169. function t(t) {
  32170. return t.getId()
  32171. }
  32172. function e(t, e) {
  32173. !function(t, e) {
  32174. u || !t || t.getValue() || (t = null);
  32175. if (t !== s && e !== s)
  32176. if (e && e.piece)
  32177. t ? (e.piece.updateData(!1, t, "normal", o, a),
  32178. r.setItemGraphicEl(t.dataIndex, e.piece)) : function(t) {
  32179. if (!t)
  32180. return;
  32181. t.piece && (l.remove(t.piece),
  32182. t.piece = null)
  32183. }(e);
  32184. else if (t) {
  32185. var i = new $I(t,o,a);
  32186. l.add(i),
  32187. r.setItemGraphicEl(t.dataIndex, i)
  32188. }
  32189. }(null == t ? null : i[t], null == e ? null : n[e])
  32190. }
  32191. new kf(n,i,t,t).add(e).update(e).remove(T(e, null)).execute()
  32192. }(h, c),
  32193. function(t, e) {
  32194. if (0 < e.depth) {
  32195. n.virtualPiece ? n.virtualPiece.updateData(!1, t, "normal", o, a) : (n.virtualPiece = new $I(t,o,a),
  32196. l.add(n.virtualPiece)),
  32197. e.piece._onclickEvent && e.piece.off("click", e.piece._onclickEvent);
  32198. var i = function(t) {
  32199. n._rootToNode(e.parentNode)
  32200. };
  32201. e.piece._onclickEvent = i,
  32202. n.virtualPiece.on("click", i)
  32203. } else
  32204. n.virtualPiece && (l.remove(n.virtualPiece),
  32205. n.virtualPiece = null)
  32206. }(s, i),
  32207. e && e.highlight && e.highlight.piece) {
  32208. var d = o.getShallow("highlightPolicy");
  32209. e.highlight.piece.onEmphasis(d)
  32210. } else if (e && e.unhighlight) {
  32211. var f = this.virtualPiece;
  32212. !f && s.children.length && (f = s.children[0].piece),
  32213. f && f.onNormal()
  32214. }
  32215. this._initEvents(),
  32216. this._oldChildren = h
  32217. },
  32218. dispose: function() {},
  32219. _initEvents: function() {
  32220. function t(o) {
  32221. var a = !1;
  32222. r.seriesModel.getViewRoot().eachNode(function(t) {
  32223. if (!a && t.piece && t.piece.childAt(0) === o.target) {
  32224. var e = t.getModel().get("nodeClick");
  32225. if ("rootToNode" === e)
  32226. r._rootToNode(t);
  32227. else if ("link" === e) {
  32228. var i = t.getModel()
  32229. , n = i.get("link");
  32230. if (n)
  32231. gu(n, i.get("target", !0) || "_blank")
  32232. }
  32233. a = !0
  32234. }
  32235. })
  32236. }
  32237. var r = this;
  32238. this.group._onclickEvent && this.group.off("click", this.group._onclickEvent),
  32239. this.group.on("click", t),
  32240. this.group._onclickEvent = t
  32241. },
  32242. _rootToNode: function(t) {
  32243. t !== this.seriesModel.getViewRoot() && this.api.dispatchAction({
  32244. type: "sunburstRootToNode",
  32245. from: this.uid,
  32246. seriesId: this.seriesModel.id,
  32247. targetNode: t
  32248. })
  32249. },
  32250. containPoint: function(t, e) {
  32251. var i = e.getData().getItemLayout(0);
  32252. if (i) {
  32253. var n = t[0] - i.cx
  32254. , o = t[1] - i.cy
  32255. , a = Math.sqrt(n * n + o * o);
  32256. return a <= i.r && a >= i.r0
  32257. }
  32258. }
  32259. });
  32260. var QI = "sunburstRootToNode";
  32261. _f({
  32262. type: QI,
  32263. update: "updateView"
  32264. }, function(o, t) {
  32265. t.eachComponent({
  32266. mainType: "series",
  32267. subType: "sunburst",
  32268. query: o
  32269. }, function(t, e) {
  32270. var i = Zx(o, [QI], t);
  32271. if (i) {
  32272. var n = t.getViewRoot();
  32273. n && (o.direction = Xx(n, i.node) ? "rollUp" : "drillDown"),
  32274. t.resetViewRoot(i.node)
  32275. }
  32276. })
  32277. });
  32278. var tT = "sunburstHighlight";
  32279. _f({
  32280. type: tT,
  32281. update: "updateView"
  32282. }, function(n, t) {
  32283. t.eachComponent({
  32284. mainType: "series",
  32285. subType: "sunburst",
  32286. query: n
  32287. }, function(t, e) {
  32288. var i = Zx(n, [tT], t);
  32289. i && (n.highlight = i.node)
  32290. })
  32291. });
  32292. _f({
  32293. type: "sunburstUnhighlight",
  32294. update: "updateView"
  32295. }, function(i, t) {
  32296. t.eachComponent({
  32297. mainType: "series",
  32298. subType: "sunburst",
  32299. query: i
  32300. }, function(t, e) {
  32301. i.unhighlight = !0
  32302. })
  32303. });
  32304. var eT = Math.PI / 180;
  32305. function iT(t, e) {
  32306. if ("function" == typeof e)
  32307. return t.sort(e);
  32308. var n = "asc" === e;
  32309. return t.sort(function(t, e) {
  32310. var i = (t.getValue() - e.getValue()) * (n ? 1 : -1);
  32311. return 0 == i ? (t.dataIndex - e.dataIndex) * (n ? -1 : 1) : i
  32312. })
  32313. }
  32314. function nT(a, r) {
  32315. return r = r || [0, 0],
  32316. O(["x", "y"], function(t, e) {
  32317. var i = this.getAxis(t)
  32318. , n = r[e]
  32319. , o = a[e] / 2;
  32320. return "category" === i.type ? i.getBandWidth() : Math.abs(i.dataToCoord(n - o) - i.dataToCoord(n + o))
  32321. }, this)
  32322. }
  32323. Sf(T(iy, "sunburst")),
  32324. bf(T(function(t, e, C, i) {
  32325. e.eachSeriesByType(t, function(t) {
  32326. var e = t.get("center")
  32327. , i = t.get("radius");
  32328. L(i) || (i = [0, i]),
  32329. L(e) || (e = [e, e]);
  32330. var n = C.getWidth()
  32331. , o = C.getHeight()
  32332. , h = Math.min(n, o)
  32333. , c = Rl(e[0], n)
  32334. , d = Rl(e[1], o)
  32335. , f = Rl(i[0], h / 2)
  32336. , a = Rl(i[1], h / 2)
  32337. , r = -t.get("startAngle") * eT
  32338. , p = t.get("minAngle") * eT
  32339. , g = t.getData().tree.root
  32340. , s = t.getViewRoot()
  32341. , m = s.depth
  32342. , l = t.get("sort");
  32343. null != l && !function e(t, i) {
  32344. var n = t.children || [];
  32345. t.children = iT(n, i);
  32346. n.length && E(t.children, function(t) {
  32347. e(t, i)
  32348. })
  32349. }(s, l);
  32350. var u = 0;
  32351. E(s.children, function(t) {
  32352. isNaN(t.getValue()) || u++
  32353. });
  32354. var v = s.getValue()
  32355. , y = Math.PI / (v || u) * 2
  32356. , x = 0 < s.depth
  32357. , _ = s.height - (x ? -1 : 1)
  32358. , w = (a - f) / (_ || 1)
  32359. , b = t.get("clockwise")
  32360. , S = t.get("stillShowZeroSum")
  32361. , M = b ? 1 : -1
  32362. , I = function(t, e) {
  32363. if (t) {
  32364. var i = e;
  32365. if (t !== g) {
  32366. var n = t.getValue()
  32367. , o = 0 === v && S ? y : n * y;
  32368. o < p && (o = p),
  32369. i = e + M * o;
  32370. var a = t.depth - m - (x ? -1 : 1)
  32371. , r = f + w * a
  32372. , s = f + w * (1 + a)
  32373. , l = t.getModel();
  32374. null != l.get("r0") && (r = Rl(l.get("r0"), h / 2)),
  32375. null != l.get("r") && (s = Rl(l.get("r"), h / 2)),
  32376. t.setLayout({
  32377. angle: o,
  32378. startAngle: e,
  32379. endAngle: i,
  32380. clockwise: b,
  32381. cx: c,
  32382. cy: d,
  32383. r0: r,
  32384. r: s
  32385. })
  32386. }
  32387. if (t.children && t.children.length) {
  32388. var u = 0;
  32389. E(t.children, function(t) {
  32390. u += I(t, e + u)
  32391. })
  32392. }
  32393. return i - e
  32394. }
  32395. };
  32396. if (x) {
  32397. var T = f
  32398. , A = f + w
  32399. , D = 2 * Math.PI;
  32400. g.setLayout({
  32401. angle: D,
  32402. startAngle: r,
  32403. endAngle: r + D,
  32404. clockwise: b,
  32405. cx: c,
  32406. cy: d,
  32407. r0: T,
  32408. r: A
  32409. })
  32410. }
  32411. I(s, r)
  32412. })
  32413. }, "sunburst")),
  32414. xf(T(uy, "sunburst"));
  32415. function oT(a, r) {
  32416. return r = r || [0, 0],
  32417. O([0, 1], function(t) {
  32418. var e = r[t]
  32419. , i = a[t] / 2
  32420. , n = []
  32421. , o = [];
  32422. return n[t] = e - i,
  32423. o[t] = e + i,
  32424. n[1 - t] = o[1 - t] = r[1 - t],
  32425. Math.abs(this.dataToPoint(n)[t] - this.dataToPoint(o)[t])
  32426. }, this)
  32427. }
  32428. function aT(t, e) {
  32429. var i = this.getAxis()
  32430. , n = e instanceof Array ? e[0] : e
  32431. , o = (t instanceof Array ? t[0] : t) / 2;
  32432. return "category" === i.type ? i.getBandWidth() : Math.abs(i.dataToCoord(n - o) - i.dataToCoord(n + o))
  32433. }
  32434. function rT(s, l) {
  32435. return O(["Radius", "Angle"], function(t, e) {
  32436. var i = this["get" + t + "Axis"]()
  32437. , n = l[e]
  32438. , o = s[e] / 2
  32439. , a = "dataTo" + t
  32440. , r = "category" === i.type ? i.getBandWidth() : Math.abs(i[a](n - o) - i[a](n + o));
  32441. return "Angle" === t && (r = r * Math.PI / 180),
  32442. r
  32443. }, this)
  32444. }
  32445. var sT = Ss
  32446. , lT = ["itemStyle"]
  32447. , uT = ["emphasis", "itemStyle"]
  32448. , hT = ["label"]
  32449. , cT = ["emphasis", "label"]
  32450. , dT = "e\0\0"
  32451. , fT = {
  32452. cartesian2d: function(e) {
  32453. var t = e.grid.getRect();
  32454. return {
  32455. coordSys: {
  32456. type: "cartesian2d",
  32457. x: t.x,
  32458. y: t.y,
  32459. width: t.width,
  32460. height: t.height
  32461. },
  32462. api: {
  32463. coord: function(t) {
  32464. return e.dataToPoint(t)
  32465. },
  32466. size: A(nT, e)
  32467. }
  32468. }
  32469. },
  32470. geo: function(e) {
  32471. var t = e.getBoundingRect();
  32472. return {
  32473. coordSys: {
  32474. type: "geo",
  32475. x: t.x,
  32476. y: t.y,
  32477. width: t.width,
  32478. height: t.height,
  32479. zoom: e.getZoom()
  32480. },
  32481. api: {
  32482. coord: function(t) {
  32483. return e.dataToPoint(t)
  32484. },
  32485. size: A(oT, e)
  32486. }
  32487. }
  32488. },
  32489. singleAxis: function(e) {
  32490. var t = e.getRect();
  32491. return {
  32492. coordSys: {
  32493. type: "singleAxis",
  32494. x: t.x,
  32495. y: t.y,
  32496. width: t.width,
  32497. height: t.height
  32498. },
  32499. api: {
  32500. coord: function(t) {
  32501. return e.dataToPoint(t)
  32502. },
  32503. size: A(aT, e)
  32504. }
  32505. }
  32506. },
  32507. polar: function(o) {
  32508. var a = o.getRadiusAxis()
  32509. , r = o.getAngleAxis()
  32510. , t = a.getExtent();
  32511. return t[0] > t[1] && t.reverse(),
  32512. {
  32513. coordSys: {
  32514. type: "polar",
  32515. cx: o.cx,
  32516. cy: o.cy,
  32517. r: t[1],
  32518. r0: t[0]
  32519. },
  32520. api: {
  32521. coord: A(function(t) {
  32522. var e = a.dataToRadius(t[0])
  32523. , i = r.dataToAngle(t[1])
  32524. , n = o.coordToPoint([e, i]);
  32525. return n.push(e, i * Math.PI / 180),
  32526. n
  32527. }),
  32528. size: A(rT, o)
  32529. }
  32530. }
  32531. },
  32532. calendar: function(i) {
  32533. var t = i.getRect()
  32534. , e = i.getRangeInfo();
  32535. return {
  32536. coordSys: {
  32537. type: "calendar",
  32538. x: t.x,
  32539. y: t.y,
  32540. width: t.width,
  32541. height: t.height,
  32542. cellWidth: i.getCellWidth(),
  32543. cellHeight: i.getCellHeight(),
  32544. rangeInfo: {
  32545. start: e.start,
  32546. end: e.end,
  32547. weeks: e.weeks,
  32548. dayCount: e.allDay
  32549. }
  32550. },
  32551. api: {
  32552. coord: function(t, e) {
  32553. return i.dataToPoint(t, e)
  32554. }
  32555. }
  32556. }
  32557. }
  32558. };
  32559. function pT(t, e, i, n, o) {
  32560. null == i[t] || o || (e[t] = i[t],
  32561. i[t] = n[t])
  32562. }
  32563. function gT(a, r, e, t) {
  32564. var i = a.get("renderItem")
  32565. , n = a.coordinateSystem
  32566. , o = {};
  32567. n && (o = n.prepareCustoms ? n.prepareCustoms() : fT[n.type](n));
  32568. var s, l, u, h, c, d = D({
  32569. getWidth: t.getWidth,
  32570. getHeight: t.getHeight,
  32571. getZr: t.getZr,
  32572. getDevicePixelRatio: t.getDevicePixelRatio,
  32573. value: function(t, e) {
  32574. return null == e && (e = s),
  32575. r.get(r.getDimension(t || 0), e)
  32576. },
  32577. style: function(t, e) {
  32578. null == e && (e = s),
  32579. g(e);
  32580. var i = l.getModel(lT).getItemStyle();
  32581. null != c && (i.fill = c);
  32582. var n = r.getItemVisual(e, "opacity");
  32583. null != n && (i.opacity = n);
  32584. var o = t ? _T(t, u) : u;
  32585. return nl(i, o, null, {
  32586. autoColor: c,
  32587. isRectText: !0
  32588. }),
  32589. i.text = o.getShallow("show") ? H(a.getFormattedLabel(e, "normal"), Ug(r, e)) : null,
  32590. t && wT(i, t),
  32591. i
  32592. },
  32593. styleEmphasis: function(t, e) {
  32594. null == e && (e = s),
  32595. g(e);
  32596. var i = l.getModel(uT).getItemStyle()
  32597. , n = t ? _T(t, h) : h;
  32598. return nl(i, n, null, {
  32599. isRectText: !0
  32600. }, !0),
  32601. i.text = n.getShallow("show") ? Z(a.getFormattedLabel(e, "emphasis"), a.getFormattedLabel(e, "normal"), Ug(r, e)) : null,
  32602. t && wT(i, t),
  32603. i
  32604. },
  32605. visual: function(t, e) {
  32606. return null == e && (e = s),
  32607. r.getItemVisual(e, t)
  32608. },
  32609. barLayout: function(t) {
  32610. if (n.getBaseAxis) {
  32611. return function(t) {
  32612. var e = []
  32613. , i = t.axis;
  32614. if ("category" === i.type) {
  32615. for (var n = i.getBandWidth(), o = 0; o < t.count; o++)
  32616. e.push(D({
  32617. bandWidth: n,
  32618. axisKey: "axis0",
  32619. stackId: Cp + o
  32620. }, t));
  32621. var a = Ep(e)
  32622. , r = [];
  32623. for (o = 0; o < t.count; o++) {
  32624. var s = a.axis0[Cp + o];
  32625. s.offsetCenter = s.offset + s.width / 2,
  32626. r.push(s)
  32627. }
  32628. return r
  32629. }
  32630. }(D({
  32631. axis: n.getBaseAxis()
  32632. }, t))
  32633. }
  32634. },
  32635. currentSeriesIndices: function() {
  32636. return e.getCurrentSeriesIndices()
  32637. },
  32638. font: function(t) {
  32639. return ul(t, e)
  32640. }
  32641. }, o.api || {}), f = {
  32642. context: {},
  32643. seriesId: a.id,
  32644. seriesName: a.name,
  32645. seriesIndex: a.seriesIndex,
  32646. coordSys: o.coordSys,
  32647. dataInsideLength: r.count(),
  32648. encode: function(o) {
  32649. var a = {};
  32650. return E(o.dimensions, function(t, e) {
  32651. var i = o.getDimensionInfo(t);
  32652. if (!i.isExtraCoord) {
  32653. var n = i.coordDim;
  32654. (a[n] = a[n] || [])[i.coordDimIndex] = e
  32655. }
  32656. }),
  32657. a
  32658. }(a.getData())
  32659. }, p = !0;
  32660. return function(t, e) {
  32661. return s = t,
  32662. p = !0,
  32663. i && i(D({
  32664. dataIndexInside: t,
  32665. dataIndex: r.getRawIndex(t),
  32666. actionType: e ? e.type : null
  32667. }, f), d)
  32668. }
  32669. ;
  32670. function g(t) {
  32671. null == t && (t = s),
  32672. p && (l = r.getItemModel(t),
  32673. u = l.getModel(hT),
  32674. h = l.getModel(cT),
  32675. c = r.getItemVisual(t, "color"),
  32676. p = !1)
  32677. }
  32678. }
  32679. function mT(t, e, i, n, o, a) {
  32680. return (t = vT(t, e, i, n, o, a, !0)) && a.setItemGraphicEl(e, t),
  32681. t
  32682. }
  32683. function vT(t, e, i, n, o, a, r) {
  32684. var s = !i
  32685. , l = (i = i || {}).type
  32686. , u = i.shape
  32687. , h = i.style;
  32688. if (t && (s || null != l && l !== t.__customGraphicType || "path" === l && function(t) {
  32689. return t && (t.hasOwnProperty("pathData") || t.hasOwnProperty("d"))
  32690. }(u) && ST(u) !== t.__customPathData || "image" === l && MT(h, "image") && h.image !== t.__customImagePath || "text" === l && MT(u, "text") && h.text !== t.__customText) && (o.remove(t),
  32691. t = null),
  32692. !s) {
  32693. var c = !t;
  32694. return function(e, t, i, n, o, a, r) {
  32695. var s = {}
  32696. , l = i.style || {};
  32697. if (i.shape && (s.shape = k(i.shape)),
  32698. i.position && (s.position = i.position.slice()),
  32699. i.scale && (s.scale = i.scale.slice()),
  32700. i.origin && (s.origin = i.origin.slice()),
  32701. i.rotation && (s.rotation = i.rotation),
  32702. "image" === e.type && i.style) {
  32703. var u = s.style = {};
  32704. E(["x", "y", "width", "height"], function(t) {
  32705. pT(t, u, l, e.style, a)
  32706. })
  32707. }
  32708. if ("text" === e.type && i.style) {
  32709. u = s.style = {};
  32710. E(["x", "y"], function(t) {
  32711. pT(t, u, l, e.style, a)
  32712. }),
  32713. !l.hasOwnProperty("textFill") && l.fill && (l.textFill = l.fill),
  32714. !l.hasOwnProperty("textStroke") && l.stroke && (l.textStroke = l.stroke)
  32715. }
  32716. if ("group" !== e.type && (e.useStyle(l),
  32717. a)) {
  32718. e.style.opacity = 0;
  32719. var h = l.opacity;
  32720. null == h && (h = 1),
  32721. dl(e, {
  32722. style: {
  32723. opacity: h
  32724. }
  32725. }, n, t)
  32726. }
  32727. a ? e.attr(s) : cl(e, s, n, t),
  32728. i.hasOwnProperty("z2") && e.attr("z2", i.z2 || 0),
  32729. i.hasOwnProperty("silent") && e.attr("silent", i.silent),
  32730. i.hasOwnProperty("invisible") && e.attr("invisible", i.invisible),
  32731. i.hasOwnProperty("ignore") && e.attr("ignore", i.ignore),
  32732. i.hasOwnProperty("info") && e.attr("info", i.info);
  32733. var c = i.styleEmphasis;
  32734. Us(e, c),
  32735. r && Js(e, !1 !== c)
  32736. }(t = t || function(t) {
  32737. var e, i = t.type;
  32738. if ("path" === i) {
  32739. var n = t.shape
  32740. , o = null != n.width && null != n.height ? {
  32741. x: n.x || 0,
  32742. y: n.y || 0,
  32743. width: n.width,
  32744. height: n.height
  32745. } : null
  32746. , a = ST(n);
  32747. (e = Ps(a, null, o, n.layout || "center")).__customPathData = a
  32748. } else if ("image" === i)
  32749. (e = new Qn({})).__customImagePath = t.style.image;
  32750. else if ("text" === i)
  32751. (e = new Ur({})).__customText = t.style.text;
  32752. else if ("group" === i)
  32753. e = new Ci;
  32754. else {
  32755. if ("compoundPath" === i)
  32756. throw new Error('"compoundPath" is not supported yet.');
  32757. e = new (ks(i))
  32758. }
  32759. return e.__customGraphicType = i,
  32760. e.name = t.name,
  32761. e
  32762. }(i), e, i, n, 0, c, r),
  32763. "group" === l && function(t, e, i, n, o) {
  32764. var a = i.children
  32765. , r = a ? a.length : 0
  32766. , s = i.$mergeChildren
  32767. , l = "byName" === s || i.diffChildrenByName
  32768. , u = !1 === s;
  32769. if (!r && !l && !u)
  32770. return;
  32771. if (l)
  32772. return function(t) {
  32773. new kf(t.oldChildren,t.newChildren,yT,yT,t).add(xT).update(xT).remove(bT).execute()
  32774. }({
  32775. oldChildren: t.children() || [],
  32776. newChildren: a || [],
  32777. dataIndex: e,
  32778. animatableModel: n,
  32779. group: t,
  32780. data: o
  32781. });
  32782. u && t.removeAll();
  32783. for (var h = 0; h < r; h++)
  32784. a[h] && vT(t.childAt(h), e, a[h], n, t, o)
  32785. }(t, e, i, n, a),
  32786. o.add(t),
  32787. t
  32788. }
  32789. }
  32790. function yT(t, e) {
  32791. var i = t && t.name;
  32792. return null != i ? i : dT + e
  32793. }
  32794. function xT(t, e) {
  32795. var i = this.context
  32796. , n = null != t ? i.newChildren[t] : null;
  32797. vT(null != e ? i.oldChildren[e] : null, i.dataIndex, n, i.animatableModel, i.group, i.data)
  32798. }
  32799. function _T(i, t) {
  32800. var n = new Cl({},t);
  32801. return E(sT, function(t, e) {
  32802. i.hasOwnProperty(t) && (n.option[e] = i[t])
  32803. }),
  32804. n
  32805. }
  32806. function wT(t, e) {
  32807. for (var i in e)
  32808. !e.hasOwnProperty(i) && sT.hasOwnProperty(i) || (t[i] = e[i])
  32809. }
  32810. function bT(t) {
  32811. var e = this.context
  32812. , i = e.oldChildren[t];
  32813. i && e.group.remove(i)
  32814. }
  32815. function ST(t) {
  32816. return t && (t.pathData || t.d)
  32817. }
  32818. function MT(t, e) {
  32819. return t && t.hasOwnProperty(e)
  32820. }
  32821. function IT(t) {
  32822. return t.get("stack") || "__ec_stack_" + t.seriesIndex
  32823. }
  32824. function TT(t, e) {
  32825. return e.dim + t.model.componentIndex
  32826. }
  32827. function AT(t, e) {
  32828. Gg.call(this, "radius", t, e),
  32829. this.type = "category"
  32830. }
  32831. sc.extend({
  32832. type: "series.custom",
  32833. dependencies: ["grid", "polar", "geo", "singleAxis", "calendar"],
  32834. defaultOption: {
  32835. coordinateSystem: "cartesian2d",
  32836. zlevel: 0,
  32837. z: 2,
  32838. legendHoverLink: !0,
  32839. useTransform: !0,
  32840. clip: !1
  32841. },
  32842. getInitialData: function(t, e) {
  32843. return gp(this.getSource(), this)
  32844. },
  32845. getDataParams: function(t, e, i) {
  32846. var n = sc.prototype.getDataParams.apply(this, arguments);
  32847. return i && (n.info = i.info),
  32848. n
  32849. }
  32850. }),
  32851. _c.extend({
  32852. type: "custom",
  32853. _data: null,
  32854. render: function(i, t, e, n) {
  32855. var o = this._data
  32856. , a = i.getData()
  32857. , r = this.group
  32858. , s = gT(i, a, t, e);
  32859. a.diff(o).add(function(t) {
  32860. mT(null, t, s(t, n), i, r, a)
  32861. }).update(function(t, e) {
  32862. mT(o.getItemGraphicEl(e), t, s(t, n), i, r, a)
  32863. }).remove(function(t) {
  32864. var e = o.getItemGraphicEl(t);
  32865. e && r.remove(e)
  32866. }).execute();
  32867. var l = i.get("clip", !0) ? Sm(i.coordinateSystem, !1, i) : null;
  32868. l ? r.setClipPath(l) : r.removeClipPath(),
  32869. this._data = a
  32870. },
  32871. incrementalPrepareRender: function(t, e, i) {
  32872. this.group.removeAll(),
  32873. this._data = null
  32874. },
  32875. incrementalRender: function(t, e, i, n, o) {
  32876. var a = e.getData()
  32877. , r = gT(e, a, i, n);
  32878. function s(t) {
  32879. t.isGroup || (t.incremental = !0,
  32880. t.useHoverLayer = !0)
  32881. }
  32882. for (var l = t.start; l < t.end; l++) {
  32883. mT(null, l, r(l, o), e, this.group, a).traverse(s)
  32884. }
  32885. },
  32886. dispose: et,
  32887. filterForExposedEvent: function(t, e, i, n) {
  32888. var o = e.element;
  32889. if (null == o || i.name === o)
  32890. return !0;
  32891. for (; (i = i.parent) && i !== this.group; )
  32892. if (i.name === o)
  32893. return !0;
  32894. return !1
  32895. }
  32896. }),
  32897. AT.prototype = {
  32898. constructor: AT,
  32899. pointToData: function(t, e) {
  32900. return this.polar.pointToData(t, e)["radius" === this.dim ? 0 : 1]
  32901. },
  32902. dataToRadius: Gg.prototype.dataToCoord,
  32903. radiusToData: Gg.prototype.coordToData
  32904. },
  32905. w(AT, Gg);
  32906. var DT = jo();
  32907. function CT(t, e) {
  32908. e = e || [0, 360],
  32909. Gg.call(this, "angle", t, e),
  32910. this.type = "category"
  32911. }
  32912. CT.prototype = {
  32913. constructor: CT,
  32914. pointToData: function(t, e) {
  32915. return this.polar.pointToData(t, e)["radius" === this.dim ? 0 : 1]
  32916. },
  32917. dataToAngle: Gg.prototype.dataToCoord,
  32918. angleToData: Gg.prototype.coordToData,
  32919. calculateCategoryInterval: function() {
  32920. var t = this.getLabelModel()
  32921. , e = this.scale
  32922. , i = e.getExtent()
  32923. , n = e.count();
  32924. if (i[1] - i[0] < 1)
  32925. return 0;
  32926. var o = i[0]
  32927. , a = this.dataToCoord(o + 1) - this.dataToCoord(o)
  32928. , r = Math.abs(a)
  32929. , s = gn(o, t.getFont(), "center", "top")
  32930. , l = Math.max(s.height, 7) / r;
  32931. isNaN(l) && (l = 1 / 0);
  32932. var u = Math.max(0, Math.floor(l))
  32933. , h = DT(this.model)
  32934. , c = h.lastAutoInterval
  32935. , d = h.lastTickCount;
  32936. return null != c && null != d && Math.abs(c - u) <= 1 && Math.abs(d - n) <= 1 && u < c ? u = c : (h.lastTickCount = n,
  32937. h.lastAutoInterval = u),
  32938. u
  32939. }
  32940. },
  32941. w(CT, Gg);
  32942. function LT(t) {
  32943. this.name = t || "",
  32944. this.cx = 0,
  32945. this.cy = 0,
  32946. this._radiusAxis = new AT,
  32947. this._angleAxis = new CT,
  32948. this._radiusAxis.polar = this._angleAxis.polar = this
  32949. }
  32950. LT.prototype = {
  32951. type: "polar",
  32952. axisPointerEnabled: !0,
  32953. constructor: LT,
  32954. dimensions: ["radius", "angle"],
  32955. model: null,
  32956. containPoint: function(t) {
  32957. var e = this.pointToCoord(t);
  32958. return this._radiusAxis.contain(e[0]) && this._angleAxis.contain(e[1])
  32959. },
  32960. containData: function(t) {
  32961. return this._radiusAxis.containData(t[0]) && this._angleAxis.containData(t[1])
  32962. },
  32963. getAxis: function(t) {
  32964. return this["_" + t + "Axis"]
  32965. },
  32966. getAxes: function() {
  32967. return [this._radiusAxis, this._angleAxis]
  32968. },
  32969. getAxesByScale: function(t) {
  32970. var e = []
  32971. , i = this._angleAxis
  32972. , n = this._radiusAxis;
  32973. return i.scale.type === t && e.push(i),
  32974. n.scale.type === t && e.push(n),
  32975. e
  32976. },
  32977. getAngleAxis: function() {
  32978. return this._angleAxis
  32979. },
  32980. getRadiusAxis: function() {
  32981. return this._radiusAxis
  32982. },
  32983. getOtherAxis: function(t) {
  32984. var e = this._angleAxis;
  32985. return t === e ? this._radiusAxis : e
  32986. },
  32987. getBaseAxis: function() {
  32988. return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAngleAxis()
  32989. },
  32990. getTooltipAxes: function(t) {
  32991. var e = null != t && "auto" !== t ? this.getAxis(t) : this.getBaseAxis();
  32992. return {
  32993. baseAxes: [e],
  32994. otherAxes: [this.getOtherAxis(e)]
  32995. }
  32996. },
  32997. dataToPoint: function(t, e) {
  32998. return this.coordToPoint([this._radiusAxis.dataToRadius(t[0], e), this._angleAxis.dataToAngle(t[1], e)])
  32999. },
  33000. pointToData: function(t, e) {
  33001. var i = this.pointToCoord(t);
  33002. return [this._radiusAxis.radiusToData(i[0], e), this._angleAxis.angleToData(i[1], e)]
  33003. },
  33004. pointToCoord: function(t) {
  33005. var e = t[0] - this.cx
  33006. , i = t[1] - this.cy
  33007. , n = this.getAngleAxis()
  33008. , o = n.getExtent()
  33009. , a = Math.min(o[0], o[1])
  33010. , r = Math.max(o[0], o[1]);
  33011. n.inverse ? a = r - 360 : r = a + 360;
  33012. var s = Math.sqrt(e * e + i * i);
  33013. e /= s,
  33014. i /= s;
  33015. for (var l = Math.atan2(-i, e) / Math.PI * 180, u = l < a ? 1 : -1; l < a || r < l; )
  33016. l += 360 * u;
  33017. return [s, l]
  33018. },
  33019. coordToPoint: function(t) {
  33020. var e = t[0]
  33021. , i = t[1] / 180 * Math.PI;
  33022. return [Math.cos(i) * e + this.cx, -Math.sin(i) * e + this.cy]
  33023. },
  33024. getArea: function() {
  33025. var t = this.getAngleAxis()
  33026. , e = this.getRadiusAxis().getExtent().slice();
  33027. e[0] > e[1] && e.reverse();
  33028. var i = t.getExtent()
  33029. , n = Math.PI / 180;
  33030. return {
  33031. cx: this.cx,
  33032. cy: this.cy,
  33033. r0: e[0],
  33034. r: e[1],
  33035. startAngle: -i[0] * n,
  33036. endAngle: -i[1] * n,
  33037. clockwise: t.inverse,
  33038. contain: function(t, e) {
  33039. var i = t - this.cx
  33040. , n = e - this.cy
  33041. , o = i * i + n * n
  33042. , a = this.r
  33043. , r = this.r0;
  33044. return o <= a * a && r * r <= o
  33045. }
  33046. }
  33047. }
  33048. };
  33049. var kT = ku.extend({
  33050. type: "polarAxis",
  33051. axis: null,
  33052. getCoordSysModel: function() {
  33053. return this.ecModel.queryComponents({
  33054. mainType: "polar",
  33055. index: this.option.polarIndex,
  33056. id: this.option.polarId
  33057. })[0]
  33058. }
  33059. });
  33060. m(kT.prototype, dg);
  33061. var PT = {
  33062. splitNumber: 5
  33063. };
  33064. function NT(t, e) {
  33065. return e.type || (e.data ? "category" : "value")
  33066. }
  33067. function OT(t, e) {
  33068. var i = this
  33069. , n = i.getAngleAxis()
  33070. , o = i.getRadiusAxis();
  33071. if (n.scale.setExtent(1 / 0, -1 / 0),
  33072. o.scale.setExtent(1 / 0, -1 / 0),
  33073. t.eachSeries(function(t) {
  33074. if (t.coordinateSystem === i) {
  33075. var e = t.getData();
  33076. E(e.mapDimension("radius", !0), function(t) {
  33077. o.scale.unionExtentFromData(e, pp(e, t))
  33078. }),
  33079. E(e.mapDimension("angle", !0), function(t) {
  33080. n.scale.unionExtentFromData(e, pp(e, t))
  33081. })
  33082. }
  33083. }),
  33084. rg(n.scale, n.model),
  33085. rg(o.scale, o.model),
  33086. "category" === n.type && !n.onBand) {
  33087. var a = n.getExtent()
  33088. , r = 360 / n.scale.count();
  33089. n.inverse ? a[1] += r : a[1] -= r,
  33090. n.setExtent(a[0], a[1])
  33091. }
  33092. }
  33093. function ET(t, e) {
  33094. if (t.type = e.get("type"),
  33095. t.scale = sg(e),
  33096. t.onBand = e.get("boundaryGap") && "category" === t.type,
  33097. t.inverse = e.get("inverse"),
  33098. "angleAxis" === e.mainType) {
  33099. t.inverse ^= e.get("clockwise");
  33100. var i = e.get("startAngle");
  33101. t.setExtent(i, i + (t.inverse ? -360 : 360))
  33102. }
  33103. (e.axis = t).model = e
  33104. }
  33105. Gm("angle", kT, NT, {
  33106. startAngle: 90,
  33107. clockwise: !0,
  33108. splitNumber: 12,
  33109. axisLabel: {
  33110. rotate: !1
  33111. }
  33112. }),
  33113. Gm("radius", kT, NT, PT),
  33114. Tf({
  33115. type: "polar",
  33116. dependencies: ["polarAxis", "angleAxis"],
  33117. coordinateSystem: null,
  33118. findAxisModel: function(t) {
  33119. var e;
  33120. return this.ecModel.eachComponent(t, function(t) {
  33121. t.getCoordSysModel() === this && (e = t)
  33122. }, this),
  33123. e
  33124. },
  33125. defaultOption: {
  33126. zlevel: 0,
  33127. z: 0,
  33128. center: ["50%", "50%"],
  33129. radius: "80%"
  33130. }
  33131. }),
  33132. lh.register("polar", {
  33133. dimensions: LT.prototype.dimensions,
  33134. create: function(i, s) {
  33135. var l = [];
  33136. return i.eachComponent("polar", function(t, e) {
  33137. var i = new LT(e);
  33138. i.update = OT;
  33139. var n = i.getRadiusAxis()
  33140. , o = i.getAngleAxis()
  33141. , a = t.findAxisModel("radiusAxis")
  33142. , r = t.findAxisModel("angleAxis");
  33143. ET(n, a),
  33144. ET(o, r),
  33145. function(t, e, i) {
  33146. var n = e.get("center")
  33147. , o = i.getWidth()
  33148. , a = i.getHeight();
  33149. t.cx = Rl(n[0], o),
  33150. t.cy = Rl(n[1], a);
  33151. var r = t.getRadiusAxis()
  33152. , s = Math.min(o, a) / 2
  33153. , l = e.get("radius");
  33154. null == l ? l = [0, "100%"] : L(l) || (l = [0, l]),
  33155. l = [Rl(l[0], s), Rl(l[1], s)],
  33156. r.inverse ? r.setExtent(l[1], l[0]) : r.setExtent(l[0], l[1])
  33157. }(i, t, s),
  33158. l.push(i),
  33159. (t.coordinateSystem = i).model = t
  33160. }),
  33161. i.eachSeries(function(t) {
  33162. if ("polar" === t.get("coordinateSystem")) {
  33163. var e = i.queryComponents({
  33164. mainType: "polar",
  33165. index: t.get("polarIndex"),
  33166. id: t.get("polarId")
  33167. })[0];
  33168. t.coordinateSystem = e.coordinateSystem
  33169. }
  33170. }),
  33171. l
  33172. }
  33173. });
  33174. var RT = ["axisLine", "axisLabel", "axisTick", "minorTick", "splitLine", "minorSplitLine", "splitArea"];
  33175. function zT(t, e, i) {
  33176. e[1] > e[0] && (e = e.slice().reverse());
  33177. var n = t.coordToPoint([e[0], i])
  33178. , o = t.coordToPoint([e[1], i]);
  33179. return {
  33180. x1: n[0],
  33181. y1: n[1],
  33182. x2: o[0],
  33183. y2: o[1]
  33184. }
  33185. }
  33186. function BT(t) {
  33187. return t.getRadiusAxis().inverse ? 0 : 1
  33188. }
  33189. function VT(t) {
  33190. var e = t[0]
  33191. , i = t[t.length - 1];
  33192. e && i && Math.abs(Math.abs(e.coord - i.coord) - 360) < 1e-4 && t.pop()
  33193. }
  33194. mv.extend({
  33195. type: "angleAxis",
  33196. axisPointerClass: "PolarAxisPointer",
  33197. render: function(e, t) {
  33198. if (this.group.removeAll(),
  33199. e.get("show")) {
  33200. var i = e.axis
  33201. , n = i.polar
  33202. , o = n.getRadiusAxis().getExtent()
  33203. , a = i.getTicksCoords()
  33204. , r = i.getMinorTicksCoords()
  33205. , s = O(i.getViewLabels(), function(t) {
  33206. return (t = k(t)).coord = i.dataToCoord(t.tickValue),
  33207. t
  33208. });
  33209. VT(s),
  33210. VT(a),
  33211. E(RT, function(t) {
  33212. !e.get(t + ".show") || i.scale.isBlank() && "axisLine" !== t || this["_" + t](e, n, a, r, o, s)
  33213. }, this)
  33214. }
  33215. },
  33216. _axisLine: function(t, e, i, n, o) {
  33217. var a, r = t.getModel("axisLine.lineStyle"), s = BT(e), l = s ? 0 : 1;
  33218. (a = 0 === o[l] ? new Yr({
  33219. shape: {
  33220. cx: e.cx,
  33221. cy: e.cy,
  33222. r: o[s]
  33223. },
  33224. style: r.getLineStyle(),
  33225. z2: 1,
  33226. silent: !0
  33227. }) : new Kr({
  33228. shape: {
  33229. cx: e.cx,
  33230. cy: e.cy,
  33231. r: o[s],
  33232. r0: o[l]
  33233. },
  33234. style: r.getLineStyle(),
  33235. z2: 1,
  33236. silent: !0
  33237. })).style.fill = null,
  33238. this.group.add(a)
  33239. },
  33240. _axisTick: function(t, e, i, n, o) {
  33241. var a = t.getModel("axisTick")
  33242. , r = (a.get("inside") ? -1 : 1) * a.get("length")
  33243. , s = o[BT(e)]
  33244. , l = O(i, function(t) {
  33245. return new ls({
  33246. shape: zT(e, [s, s + r], t.coord)
  33247. })
  33248. });
  33249. this.group.add(Es(l, {
  33250. style: D(a.getModel("lineStyle").getLineStyle(), {
  33251. stroke: t.get("axisLine.lineStyle.color")
  33252. })
  33253. }))
  33254. },
  33255. _minorTick: function(t, e, i, n, o) {
  33256. if (n.length) {
  33257. for (var a = t.getModel("axisTick"), r = t.getModel("minorTick"), s = (a.get("inside") ? -1 : 1) * r.get("length"), l = o[BT(e)], u = [], h = 0; h < n.length; h++)
  33258. for (var c = 0; c < n[h].length; c++)
  33259. u.push(new ls({
  33260. shape: zT(e, [l, l + s], n[h][c].coord)
  33261. }));
  33262. this.group.add(Es(u, {
  33263. style: D(r.getModel("lineStyle").getLineStyle(), D(a.getLineStyle(), {
  33264. stroke: t.get("axisLine.lineStyle.color")
  33265. }))
  33266. }))
  33267. }
  33268. },
  33269. _axisLabel: function(c, d, t, e, f, i) {
  33270. var p = c.getCategories(!0)
  33271. , g = c.getModel("axisLabel")
  33272. , m = g.get("margin")
  33273. , v = c.get("triggerEvent");
  33274. E(i, function(t, e) {
  33275. var i = g
  33276. , n = t.tickValue
  33277. , o = f[BT(d)]
  33278. , a = d.coordToPoint([o + m, t.coord])
  33279. , r = d.cx
  33280. , s = d.cy
  33281. , l = Math.abs(a[0] - r) / o < .3 ? "center" : a[0] > r ? "left" : "right"
  33282. , u = Math.abs(a[1] - s) / o < .3 ? "middle" : a[1] > s ? "top" : "bottom";
  33283. p && p[n] && p[n].textStyle && (i = new Cl(p[n].textStyle,g,g.ecModel));
  33284. var h = new Ur({
  33285. silent: Qm.isLabelSilent(c)
  33286. });
  33287. this.group.add(h),
  33288. nl(h.style, i, {
  33289. x: a[0],
  33290. y: a[1],
  33291. textFill: i.getTextColor() || c.get("axisLine.lineStyle.color"),
  33292. text: t.formattedLabel,
  33293. textAlign: l,
  33294. textVerticalAlign: u
  33295. }),
  33296. v && (h.eventData = Qm.makeAxisEventDataBase(c),
  33297. h.eventData.targetType = "axisLabel",
  33298. h.eventData.value = t.rawLabel)
  33299. }, this)
  33300. },
  33301. _splitLine: function(t, e, i, n, o) {
  33302. var a = t.getModel("splitLine").getModel("lineStyle")
  33303. , r = a.get("color")
  33304. , s = 0;
  33305. r = r instanceof Array ? r : [r];
  33306. for (var l = [], u = 0; u < i.length; u++) {
  33307. var h = s++ % r.length;
  33308. l[h] = l[h] || [],
  33309. l[h].push(new ls({
  33310. shape: zT(e, o, i[u].coord)
  33311. }))
  33312. }
  33313. for (u = 0; u < l.length; u++)
  33314. this.group.add(Es(l[u], {
  33315. style: D({
  33316. stroke: r[u % r.length]
  33317. }, a.getLineStyle()),
  33318. silent: !0,
  33319. z: t.get("z")
  33320. }))
  33321. },
  33322. _minorSplitLine: function(t, e, i, n, o) {
  33323. if (n.length) {
  33324. for (var a = t.getModel("minorSplitLine").getModel("lineStyle"), r = [], s = 0; s < n.length; s++)
  33325. for (var l = 0; l < n[s].length; l++)
  33326. r.push(new ls({
  33327. shape: zT(e, o, n[s][l].coord)
  33328. }));
  33329. this.group.add(Es(r, {
  33330. style: a.getLineStyle(),
  33331. silent: !0,
  33332. z: t.get("z")
  33333. }))
  33334. }
  33335. },
  33336. _splitArea: function(t, e, i, n, o) {
  33337. if (i.length) {
  33338. var a = t.getModel("splitArea").getModel("areaStyle")
  33339. , r = a.get("color")
  33340. , s = 0;
  33341. r = r instanceof Array ? r : [r];
  33342. for (var l = [], u = Math.PI / 180, h = -i[0].coord * u, c = Math.min(o[0], o[1]), d = Math.max(o[0], o[1]), f = t.get("clockwise"), p = 1; p < i.length; p++) {
  33343. var g = s++ % r.length;
  33344. l[g] = l[g] || [],
  33345. l[g].push(new qr({
  33346. shape: {
  33347. cx: e.cx,
  33348. cy: e.cy,
  33349. r0: c,
  33350. r: d,
  33351. startAngle: h,
  33352. endAngle: -i[p].coord * u,
  33353. clockwise: f
  33354. },
  33355. silent: !0
  33356. })),
  33357. h = -i[p].coord * u
  33358. }
  33359. for (p = 0; p < l.length; p++)
  33360. this.group.add(Es(l[p], {
  33361. style: D({
  33362. fill: r[p % r.length]
  33363. }, a.getAreaStyle()),
  33364. silent: !0
  33365. }))
  33366. }
  33367. }
  33368. });
  33369. var GT = ["axisLine", "axisTickLabel", "axisName"]
  33370. , FT = ["splitLine", "splitArea", "minorSplitLine"];
  33371. mv.extend({
  33372. type: "radiusAxis",
  33373. axisPointerClass: "PolarAxisPointer",
  33374. render: function(e, t) {
  33375. if (this.group.removeAll(),
  33376. e.get("show")) {
  33377. var i = e.axis
  33378. , n = i.polar
  33379. , o = n.getAngleAxis()
  33380. , a = i.getTicksCoords()
  33381. , r = i.getMinorTicksCoords()
  33382. , s = o.getExtent()[0]
  33383. , l = i.getExtent()
  33384. , u = function(t, e, i) {
  33385. return {
  33386. position: [t.cx, t.cy],
  33387. rotation: i / 180 * Math.PI,
  33388. labelDirection: -1,
  33389. tickDirection: -1,
  33390. nameDirection: 1,
  33391. labelRotate: e.getModel("axisLabel").get("rotate"),
  33392. z2: 1
  33393. }
  33394. }(n, e, s)
  33395. , h = new Qm(e,u);
  33396. E(GT, h.add, h),
  33397. this.group.add(h.getGroup()),
  33398. E(FT, function(t) {
  33399. e.get(t + ".show") && !i.scale.isBlank() && this["_" + t](e, n, s, l, a, r)
  33400. }, this)
  33401. }
  33402. },
  33403. _splitLine: function(t, e, i, n, o) {
  33404. var a = t.getModel("splitLine").getModel("lineStyle")
  33405. , r = a.get("color")
  33406. , s = 0;
  33407. r = r instanceof Array ? r : [r];
  33408. for (var l = [], u = 0; u < o.length; u++) {
  33409. var h = s++ % r.length;
  33410. l[h] = l[h] || [],
  33411. l[h].push(new Yr({
  33412. shape: {
  33413. cx: e.cx,
  33414. cy: e.cy,
  33415. r: o[u].coord
  33416. }
  33417. }))
  33418. }
  33419. for (u = 0; u < l.length; u++)
  33420. this.group.add(Es(l[u], {
  33421. style: D({
  33422. stroke: r[u % r.length],
  33423. fill: null
  33424. }, a.getLineStyle()),
  33425. silent: !0
  33426. }))
  33427. },
  33428. _minorSplitLine: function(t, e, i, n, o, a) {
  33429. if (a.length) {
  33430. for (var r = t.getModel("minorSplitLine").getModel("lineStyle"), s = [], l = 0; l < a.length; l++)
  33431. for (var u = 0; u < a[l].length; u++)
  33432. s.push(new Yr({
  33433. shape: {
  33434. cx: e.cx,
  33435. cy: e.cy,
  33436. r: a[l][u].coord
  33437. }
  33438. }));
  33439. this.group.add(Es(s, {
  33440. style: D({
  33441. fill: null
  33442. }, r.getLineStyle()),
  33443. silent: !0
  33444. }))
  33445. }
  33446. },
  33447. _splitArea: function(t, e, i, n, o) {
  33448. if (o.length) {
  33449. var a = t.getModel("splitArea").getModel("areaStyle")
  33450. , r = a.get("color")
  33451. , s = 0;
  33452. r = r instanceof Array ? r : [r];
  33453. for (var l = [], u = o[0].coord, h = 1; h < o.length; h++) {
  33454. var c = s++ % r.length;
  33455. l[c] = l[c] || [],
  33456. l[c].push(new qr({
  33457. shape: {
  33458. cx: e.cx,
  33459. cy: e.cy,
  33460. r0: u,
  33461. r: o[h].coord,
  33462. startAngle: 0,
  33463. endAngle: 2 * Math.PI
  33464. },
  33465. silent: !0
  33466. })),
  33467. u = o[h].coord
  33468. }
  33469. for (h = 0; h < l.length; h++)
  33470. this.group.add(Es(l[h], {
  33471. style: D({
  33472. fill: r[h % r.length]
  33473. }, a.getAreaStyle()),
  33474. silent: !0
  33475. }))
  33476. }
  33477. }
  33478. });
  33479. var WT = wI.extend({
  33480. makeElOption: function(t, e, i, n, o) {
  33481. var a = i.axis;
  33482. "angle" === a.dim && (this.animationThreshold = Math.PI / 18);
  33483. var r, s = a.polar, l = s.getOtherAxis(a).getExtent();
  33484. r = a["dataTo" + fu(a.dim)](e);
  33485. var u = n.get("type");
  33486. if (u && "none" !== u) {
  33487. var h = TI(n)
  33488. , c = HT[u](a, s, r, l, h);
  33489. c.style = h,
  33490. t.graphicKey = c.type,
  33491. t.pointer = c
  33492. }
  33493. var d = n.get("label.margin");
  33494. AI(t, i, n, o, function(t, e, i, n, o) {
  33495. var a = e.axis
  33496. , r = a.dataToCoord(t)
  33497. , s = n.getAngleAxis().getExtent()[0];
  33498. s = s / 180 * Math.PI;
  33499. var l, u, h, c = n.getRadiusAxis().getExtent();
  33500. if ("radius" === a.dim) {
  33501. var d = ae();
  33502. he(d, d, s),
  33503. ue(d, d, [n.cx, n.cy]),
  33504. l = pl([r, -o], d);
  33505. var f = e.getModel("axisLabel").get("rotate") || 0
  33506. , p = Qm.innerTextLayout(s, f * Math.PI / 180, -1);
  33507. u = p.textAlign,
  33508. h = p.textVerticalAlign
  33509. } else {
  33510. var g = c[1];
  33511. l = n.coordToPoint([g + o, r]);
  33512. var m = n.cx
  33513. , v = n.cy;
  33514. u = Math.abs(l[0] - m) / g < .3 ? "center" : l[0] > m ? "left" : "right",
  33515. h = Math.abs(l[1] - v) / g < .3 ? "middle" : l[1] > v ? "top" : "bottom"
  33516. }
  33517. return {
  33518. position: l,
  33519. align: u,
  33520. verticalAlign: h
  33521. }
  33522. }(e, i, 0, s, d))
  33523. }
  33524. });
  33525. var HT = {
  33526. line: function(t, e, i, n, o) {
  33527. return "angle" === t.dim ? {
  33528. type: "Line",
  33529. shape: kI(e.coordToPoint([n[0], i]), e.coordToPoint([n[1], i]))
  33530. } : {
  33531. type: "Circle",
  33532. shape: {
  33533. cx: e.cx,
  33534. cy: e.cy,
  33535. r: i
  33536. }
  33537. }
  33538. },
  33539. shadow: function(t, e, i, n, o) {
  33540. var a = Math.max(1, t.getBandWidth())
  33541. , r = Math.PI / 180;
  33542. return "angle" === t.dim ? {
  33543. type: "Sector",
  33544. shape: NI(e.cx, e.cy, n[0], n[1], (-i - a / 2) * r, (a / 2 - i) * r)
  33545. } : {
  33546. type: "Sector",
  33547. shape: NI(e.cx, e.cy, i - a / 2, i + a / 2, 0, 2 * Math.PI)
  33548. }
  33549. }
  33550. };
  33551. function ZT(n, t) {
  33552. t.update = "updateView",
  33553. _f(t, function(t, e) {
  33554. var i = {};
  33555. return e.eachComponent({
  33556. mainType: "geo",
  33557. query: t
  33558. }, function(e) {
  33559. e[n](t.name),
  33560. E(e.coordinateSystem.regions, function(t) {
  33561. i[t.name] = e.isSelected(t.name) || !1
  33562. })
  33563. }),
  33564. {
  33565. selected: i,
  33566. name: t.name
  33567. }
  33568. })
  33569. }
  33570. mv.registerAxisPointerClass("PolarAxisPointer", WT),
  33571. bf(T(function(t, e, i) {
  33572. var N = {}
  33573. , O = function(t) {
  33574. var g = {};
  33575. E(t, function(t, e) {
  33576. var i = t.getData()
  33577. , n = t.coordinateSystem
  33578. , o = n.getBaseAxis()
  33579. , a = TT(n, o)
  33580. , r = o.getExtent()
  33581. , s = "category" === o.type ? o.getBandWidth() : Math.abs(r[1] - r[0]) / i.count()
  33582. , l = g[a] || {
  33583. bandWidth: s,
  33584. remainedWidth: s,
  33585. autoWidthCount: 0,
  33586. categoryGap: "20%",
  33587. gap: "30%",
  33588. stacks: {}
  33589. }
  33590. , u = l.stacks;
  33591. g[a] = l;
  33592. var h = IT(t);
  33593. u[h] || l.autoWidthCount++,
  33594. u[h] = u[h] || {
  33595. width: 0,
  33596. maxWidth: 0
  33597. };
  33598. var c = Rl(t.get("barWidth"), s)
  33599. , d = Rl(t.get("barMaxWidth"), s)
  33600. , f = t.get("barGap")
  33601. , p = t.get("barCategoryGap");
  33602. c && !u[h].width && (c = Math.min(l.remainedWidth, c),
  33603. u[h].width = c,
  33604. l.remainedWidth -= c),
  33605. d && (u[h].maxWidth = d),
  33606. null != f && (l.gap = f),
  33607. null != p && (l.categoryGap = p)
  33608. });
  33609. var d = {};
  33610. return E(g, function(t, i) {
  33611. d[i] = {};
  33612. var e = t.stacks
  33613. , n = t.bandWidth
  33614. , o = Rl(t.categoryGap, n)
  33615. , a = Rl(t.gap, 1)
  33616. , r = t.remainedWidth
  33617. , s = t.autoWidthCount
  33618. , l = (r - o) / (s + (s - 1) * a);
  33619. l = Math.max(l, 0),
  33620. E(e, function(t, e) {
  33621. var i = t.maxWidth;
  33622. i && i < l && (i = Math.min(i, r),
  33623. t.width && (i = Math.min(i, t.width)),
  33624. r -= i,
  33625. t.width = i,
  33626. s--)
  33627. }),
  33628. l = (r - o) / (s + (s - 1) * a),
  33629. l = Math.max(l, 0);
  33630. var u, h = 0;
  33631. E(e, function(t, e) {
  33632. t.width || (t.width = l),
  33633. h += (u = t).width * (1 + a)
  33634. }),
  33635. u && (h -= u.width * a);
  33636. var c = -h / 2;
  33637. E(e, function(t, e) {
  33638. d[i][e] = d[i][e] || {
  33639. offset: c,
  33640. width: t.width
  33641. },
  33642. c += t.width * (1 + a)
  33643. })
  33644. }),
  33645. d
  33646. }(M(e.getSeriesByType(t), function(t) {
  33647. return !e.isSeriesFiltered(t) && t.coordinateSystem && "polar" === t.coordinateSystem.type
  33648. }));
  33649. e.eachSeriesByType(t, function(t) {
  33650. if ("polar" === t.coordinateSystem.type) {
  33651. var e = t.getData()
  33652. , i = t.coordinateSystem
  33653. , n = i.getBaseAxis()
  33654. , o = TT(i, n)
  33655. , a = IT(t)
  33656. , r = O[o][a]
  33657. , s = r.offset
  33658. , l = r.width
  33659. , u = i.getOtherAxis(n)
  33660. , h = t.coordinateSystem.cx
  33661. , c = t.coordinateSystem.cy
  33662. , d = t.get("barMinHeight") || 0
  33663. , f = t.get("barMinAngle") || 0;
  33664. N[a] = N[a] || [];
  33665. for (var p = e.mapDimension(u.dim), g = e.mapDimension(n.dim), m = fp(e, p), v = "radius" !== n.dim || !t.get("roundCap", !0), y = u.getExtent()[0], x = 0, _ = e.count(); x < _; x++) {
  33666. var w, b, S, M, I = e.get(p, x), T = e.get(g, x), A = 0 <= I ? "p" : "n", D = y;
  33667. if (m && (N[a][T] || (N[a][T] = {
  33668. p: y,
  33669. n: y
  33670. }),
  33671. D = N[a][T][A]),
  33672. "radius" === u.dim) {
  33673. var C = u.dataToRadius(I) - y
  33674. , L = n.dataToAngle(T);
  33675. Math.abs(C) < d && (C = (C < 0 ? -1 : 1) * d),
  33676. b = (w = D) + C,
  33677. M = (S = L - s) - l,
  33678. m && (N[a][T][A] = b)
  33679. } else {
  33680. var k = u.dataToAngle(I, v) - y
  33681. , P = n.dataToRadius(T);
  33682. Math.abs(k) < f && (k = (k < 0 ? -1 : 1) * f),
  33683. b = (w = P + s) + l,
  33684. M = (S = D) + k,
  33685. m && (N[a][T][A] = M)
  33686. }
  33687. e.setItemLayout(x, {
  33688. cx: h,
  33689. cy: c,
  33690. r0: w,
  33691. r: b,
  33692. startAngle: -S * Math.PI / 180,
  33693. endAngle: -M * Math.PI / 180
  33694. })
  33695. }
  33696. }
  33697. }, this)
  33698. }, "bar")),
  33699. Af({
  33700. type: "polar"
  33701. }),
  33702. b(ku.extend({
  33703. type: "geo",
  33704. coordinateSystem: null,
  33705. layoutMode: "box",
  33706. init: function(t) {
  33707. ku.prototype.init.apply(this, arguments),
  33708. Go(t, "label", ["show"])
  33709. },
  33710. optionUpdated: function() {
  33711. var t = this.option
  33712. , i = this;
  33713. t.regions = px.getFilledRegions(t.regions, t.map, t.nameMap),
  33714. this._optionModelMap = S(t.regions || [], function(t, e) {
  33715. return e.name && t.set(e.name, new Cl(e,i)),
  33716. t
  33717. }, Q()),
  33718. this.updateSelectedMap(t.regions)
  33719. },
  33720. defaultOption: {
  33721. zlevel: 0,
  33722. z: 0,
  33723. show: !0,
  33724. left: "center",
  33725. top: "center",
  33726. aspectScale: null,
  33727. silent: !1,
  33728. map: "",
  33729. boundingCoords: null,
  33730. center: null,
  33731. zoom: 1,
  33732. scaleLimit: null,
  33733. label: {
  33734. show: !1,
  33735. color: "#000"
  33736. },
  33737. itemStyle: {
  33738. borderWidth: .5,
  33739. borderColor: "#444",
  33740. color: "#eee"
  33741. },
  33742. emphasis: {
  33743. label: {
  33744. show: !0,
  33745. color: "rgb(100,0,0)"
  33746. },
  33747. itemStyle: {
  33748. color: "rgba(255,215,0,0.8)"
  33749. }
  33750. },
  33751. regions: []
  33752. },
  33753. getRegionModel: function(t) {
  33754. return this._optionModelMap.get(t) || new Cl(null,this,this.ecModel)
  33755. },
  33756. getFormattedLabel: function(t, e) {
  33757. var i = this.getRegionModel(t).get("label" + ("normal" === e ? "." : e + ".") + "formatter")
  33758. , n = {
  33759. name: t
  33760. };
  33761. return "function" == typeof i ? (n.status = e,
  33762. i(n)) : "string" == typeof i ? i.replace("{a}", null != t ? t : "") : void 0
  33763. },
  33764. setZoom: function(t) {
  33765. this.option.zoom = t
  33766. },
  33767. setCenter: function(t) {
  33768. this.option.center = t
  33769. }
  33770. }), jv),
  33771. Af({
  33772. type: "geo",
  33773. init: function(t, e) {
  33774. var i = new tx(e,!0);
  33775. this._mapDraw = i,
  33776. this.group.add(i.group)
  33777. },
  33778. render: function(t, e, i, n) {
  33779. if (!n || "geoToggleSelect" !== n.type || n.from !== this.uid) {
  33780. var o = this._mapDraw;
  33781. t.get("show") ? o.draw(t, e, i, this, n) : this._mapDraw.group.removeAll(),
  33782. this.group.silent = t.get("silent")
  33783. }
  33784. },
  33785. dispose: function() {
  33786. this._mapDraw && this._mapDraw.remove()
  33787. }
  33788. }),
  33789. ZT("toggleSelected", {
  33790. type: "geoToggleSelect",
  33791. event: "geoselectchanged"
  33792. }),
  33793. ZT("select", {
  33794. type: "geoSelect",
  33795. event: "geoselected"
  33796. }),
  33797. ZT("unSelect", {
  33798. type: "geoUnSelect",
  33799. event: "geounselected"
  33800. });
  33801. function UT(t, e, i) {
  33802. this._model = t
  33803. }
  33804. function XT(t, e, i, n) {
  33805. var o = i.calendarModel
  33806. , a = i.seriesModel
  33807. , r = o ? o.coordinateSystem : a ? a.coordinateSystem : null;
  33808. return r === this ? r[t](n) : null
  33809. }
  33810. UT.prototype = {
  33811. constructor: UT,
  33812. type: "calendar",
  33813. dimensions: ["time", "value"],
  33814. getDimensionsInfo: function() {
  33815. return [{
  33816. name: "time",
  33817. type: "time"
  33818. }, "value"]
  33819. },
  33820. getRangeInfo: function() {
  33821. return this._rangeInfo
  33822. },
  33823. getModel: function() {
  33824. return this._model
  33825. },
  33826. getRect: function() {
  33827. return this._rect
  33828. },
  33829. getCellWidth: function() {
  33830. return this._sw
  33831. },
  33832. getCellHeight: function() {
  33833. return this._sh
  33834. },
  33835. getOrient: function() {
  33836. return this._orient
  33837. },
  33838. getFirstDayOfWeek: function() {
  33839. return this._firstDayOfWeek
  33840. },
  33841. getDateInfo: function(t) {
  33842. var e = (t = Yl(t)).getFullYear()
  33843. , i = t.getMonth() + 1;
  33844. i = i < 10 ? "0" + i : i;
  33845. var n = t.getDate();
  33846. n = n < 10 ? "0" + n : n;
  33847. var o = t.getDay();
  33848. return {
  33849. y: e,
  33850. m: i,
  33851. d: n,
  33852. day: o = Math.abs((o + 7 - this.getFirstDayOfWeek()) % 7),
  33853. time: t.getTime(),
  33854. formatedDate: e + "-" + i + "-" + n,
  33855. date: t
  33856. }
  33857. },
  33858. getNextNDay: function(t, e) {
  33859. return 0 === (e = e || 0) || (t = new Date(this.getDateInfo(t).time)).setDate(t.getDate() + e),
  33860. this.getDateInfo(t)
  33861. },
  33862. update: function(t, e) {
  33863. this._firstDayOfWeek = +this._model.getModel("dayLabel").get("firstDay"),
  33864. this._orient = this._model.get("orient"),
  33865. this._lineWidth = this._model.getModel("itemStyle").getItemStyle().lineWidth || 0,
  33866. this._rangeInfo = this._getRangeInfo(this._initRangeOption());
  33867. var i = this._rangeInfo.weeks || 1
  33868. , n = ["width", "height"]
  33869. , o = this._model.get("cellSize").slice()
  33870. , a = this._model.getBoxLayoutParams()
  33871. , r = "horizontal" === this._orient ? [i, 7] : [7, i];
  33872. E([0, 1], function(t) {
  33873. u(o, t) && (a[n[t]] = o[t] * r[t])
  33874. });
  33875. var s = {
  33876. width: e.getWidth(),
  33877. height: e.getHeight()
  33878. }
  33879. , l = this._rect = bu(a, s);
  33880. function u(t, e) {
  33881. return null != t[e] && "auto" !== t[e]
  33882. }
  33883. E([0, 1], function(t) {
  33884. u(o, t) || (o[t] = l[n[t]] / r[t])
  33885. }),
  33886. this._sw = o[0],
  33887. this._sh = o[1]
  33888. },
  33889. dataToPoint: function(t, e) {
  33890. L(t) && (t = t[0]),
  33891. null == e && (e = !0);
  33892. var i = this.getDateInfo(t)
  33893. , n = this._rangeInfo
  33894. , o = i.formatedDate;
  33895. if (e && !(i.time >= n.start.time && i.time < n.end.time + 864e5))
  33896. return [NaN, NaN];
  33897. var a = i.day
  33898. , r = this._getRangeInfo([n.start.time, o]).nthWeek;
  33899. return "vertical" === this._orient ? [this._rect.x + a * this._sw + this._sw / 2, this._rect.y + r * this._sh + this._sh / 2] : [this._rect.x + r * this._sw + this._sw / 2, this._rect.y + a * this._sh + this._sh / 2]
  33900. },
  33901. pointToData: function(t) {
  33902. var e = this.pointToDate(t);
  33903. return e && e.time
  33904. },
  33905. dataToRect: function(t, e) {
  33906. var i = this.dataToPoint(t, e);
  33907. return {
  33908. contentShape: {
  33909. x: i[0] - (this._sw - this._lineWidth) / 2,
  33910. y: i[1] - (this._sh - this._lineWidth) / 2,
  33911. width: this._sw - this._lineWidth,
  33912. height: this._sh - this._lineWidth
  33913. },
  33914. center: i,
  33915. tl: [i[0] - this._sw / 2, i[1] - this._sh / 2],
  33916. tr: [i[0] + this._sw / 2, i[1] - this._sh / 2],
  33917. br: [i[0] + this._sw / 2, i[1] + this._sh / 2],
  33918. bl: [i[0] - this._sw / 2, i[1] + this._sh / 2]
  33919. }
  33920. },
  33921. pointToDate: function(t) {
  33922. var e = Math.floor((t[0] - this._rect.x) / this._sw) + 1
  33923. , i = Math.floor((t[1] - this._rect.y) / this._sh) + 1
  33924. , n = this._rangeInfo.range;
  33925. return "vertical" === this._orient ? this._getDateByWeeksAndDay(i, e - 1, n) : this._getDateByWeeksAndDay(e, i - 1, n)
  33926. },
  33927. convertToPixel: T(XT, "dataToPoint"),
  33928. convertFromPixel: T(XT, "pointToData"),
  33929. _initRangeOption: function() {
  33930. var t = this._model.get("range")
  33931. , e = t;
  33932. if (L(e) && 1 === e.length && (e = e[0]),
  33933. /^\d{4}$/.test(e) && (t = [e + "-01-01", e + "-12-31"]),
  33934. /^\d{4}[\/|-]\d{1,2}$/.test(e)) {
  33935. var i = this.getDateInfo(e)
  33936. , n = i.date;
  33937. n.setMonth(n.getMonth() + 1);
  33938. var o = this.getNextNDay(n, -1);
  33939. t = [i.formatedDate, o.formatedDate]
  33940. }
  33941. /^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(e) && (t = [e, e]);
  33942. var a = this._getRangeInfo(t);
  33943. return a.start.time > a.end.time && t.reverse(),
  33944. t
  33945. },
  33946. _getRangeInfo: function(t) {
  33947. var e;
  33948. (t = [this.getDateInfo(t[0]), this.getDateInfo(t[1])])[0].time > t[1].time && (e = !0,
  33949. t.reverse());
  33950. var i = Math.floor(t[1].time / 864e5) - Math.floor(t[0].time / 864e5) + 1
  33951. , n = new Date(t[0].time)
  33952. , o = n.getDate()
  33953. , a = t[1].date.getDate();
  33954. n.setDate(o + i - 1);
  33955. var r = n.getDate();
  33956. if (r !== a)
  33957. for (var s = 0 < n.getTime() - t[1].time ? 1 : -1; (r = n.getDate()) !== a && 0 < (n.getTime() - t[1].time) * s; )
  33958. i -= s,
  33959. n.setDate(r - s);
  33960. var l = Math.floor((i + t[0].day + 6) / 7)
  33961. , u = e ? 1 - l : l - 1;
  33962. return e && t.reverse(),
  33963. {
  33964. range: [t[0].formatedDate, t[1].formatedDate],
  33965. start: t[0],
  33966. end: t[1],
  33967. allDay: i,
  33968. weeks: l,
  33969. nthWeek: u,
  33970. fweek: t[0].day,
  33971. lweek: t[1].day
  33972. }
  33973. },
  33974. _getDateByWeeksAndDay: function(t, e, i) {
  33975. var n = this._getRangeInfo(i);
  33976. if (t > n.weeks || 0 === t && e < n.fweek || t === n.weeks && e > n.lweek)
  33977. return !1;
  33978. var o = 7 * (t - 1) - n.fweek + e
  33979. , a = new Date(n.start.time);
  33980. return a.setDate(n.start.d + o),
  33981. this.getDateInfo(a)
  33982. }
  33983. },
  33984. UT.dimensions = UT.prototype.dimensions,
  33985. UT.getDimensionsInfo = UT.prototype.getDimensionsInfo,
  33986. UT.create = function(i, n) {
  33987. var o = [];
  33988. return i.eachComponent("calendar", function(t) {
  33989. var e = new UT(t,i,n);
  33990. o.push(e),
  33991. t.coordinateSystem = e
  33992. }),
  33993. i.eachSeries(function(t) {
  33994. "calendar" === t.get("coordinateSystem") && (t.coordinateSystem = o[t.get("calendarIndex") || 0])
  33995. }),
  33996. o
  33997. }
  33998. ,
  33999. lh.register("calendar", UT);
  34000. var YT = ku.extend({
  34001. type: "calendar",
  34002. coordinateSystem: null,
  34003. defaultOption: {
  34004. zlevel: 0,
  34005. z: 2,
  34006. left: 80,
  34007. top: 60,
  34008. cellSize: 20,
  34009. orient: "horizontal",
  34010. splitLine: {
  34011. show: !0,
  34012. lineStyle: {
  34013. color: "#000",
  34014. width: 1,
  34015. type: "solid"
  34016. }
  34017. },
  34018. itemStyle: {
  34019. color: "#fff",
  34020. borderWidth: 1,
  34021. borderColor: "#ccc"
  34022. },
  34023. dayLabel: {
  34024. show: !0,
  34025. firstDay: 0,
  34026. position: "start",
  34027. margin: "50%",
  34028. nameMap: "en",
  34029. color: "#000"
  34030. },
  34031. monthLabel: {
  34032. show: !0,
  34033. position: "start",
  34034. margin: 5,
  34035. align: "center",
  34036. nameMap: "en",
  34037. formatter: null,
  34038. color: "#000"
  34039. },
  34040. yearLabel: {
  34041. show: !0,
  34042. position: null,
  34043. margin: 30,
  34044. formatter: null,
  34045. color: "#ccc",
  34046. fontFamily: "sans-serif",
  34047. fontWeight: "bolder",
  34048. fontSize: 20
  34049. }
  34050. },
  34051. init: function(t, e, i, n) {
  34052. var o = Iu(t);
  34053. YT.superApply(this, "init", arguments),
  34054. jT(t, o)
  34055. },
  34056. mergeOption: function(t, e) {
  34057. YT.superApply(this, "mergeOption", arguments),
  34058. jT(this.option, t)
  34059. }
  34060. });
  34061. function jT(t, e) {
  34062. var i = t.cellSize;
  34063. L(i) ? 1 === i.length && (i[1] = i[0]) : i = t.cellSize = [i, i];
  34064. var n = O([0, 1], function(t) {
  34065. return function(t, e) {
  34066. return null != t[xu[e][0]] || null != t[xu[e][1]] && null != t[xu[e][2]]
  34067. }(e, t) && (i[t] = "auto"),
  34068. null != i[t] && "auto" !== i[t]
  34069. });
  34070. Mu(t, e, {
  34071. type: "box",
  34072. ignoreSize: n
  34073. })
  34074. }
  34075. var qT = {
  34076. EN: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  34077. CN: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"]
  34078. }
  34079. , KT = {
  34080. EN: ["S", "M", "T", "W", "T", "F", "S"],
  34081. CN: ["日", "一", "二", "三", "四", "五", "六"]
  34082. };
  34083. Af({
  34084. type: "calendar",
  34085. _tlpoints: null,
  34086. _blpoints: null,
  34087. _firstDayOfMonth: null,
  34088. _firstDayPoints: null,
  34089. render: function(t, e, i) {
  34090. var n = this.group;
  34091. n.removeAll();
  34092. var o = t.coordinateSystem
  34093. , a = o.getRangeInfo()
  34094. , r = o.getOrient();
  34095. this._renderDayRect(t, a, n),
  34096. this._renderLines(t, a, r, n),
  34097. this._renderYearText(t, a, r, n),
  34098. this._renderMonthText(t, r, n),
  34099. this._renderWeekText(t, a, r, n)
  34100. },
  34101. _renderDayRect: function(t, e, i) {
  34102. for (var n = t.coordinateSystem, o = t.getModel("itemStyle").getItemStyle(), a = n.getCellWidth(), r = n.getCellHeight(), s = e.start.time; s <= e.end.time; s = n.getNextNDay(s, 1).time) {
  34103. var l = n.dataToRect([s], !1).tl
  34104. , u = new rs({
  34105. shape: {
  34106. x: l[0],
  34107. y: l[1],
  34108. width: a,
  34109. height: r
  34110. },
  34111. cursor: "default",
  34112. style: o
  34113. });
  34114. i.add(u)
  34115. }
  34116. },
  34117. _renderLines: function(i, t, n, o) {
  34118. var a = this
  34119. , r = i.coordinateSystem
  34120. , s = i.getModel("splitLine.lineStyle").getLineStyle()
  34121. , l = i.get("splitLine.show")
  34122. , e = s.lineWidth;
  34123. this._tlpoints = [],
  34124. this._blpoints = [],
  34125. this._firstDayOfMonth = [],
  34126. this._firstDayPoints = [];
  34127. for (var u = t.start, h = 0; u.time <= t.end.time; h++) {
  34128. d(u.formatedDate),
  34129. 0 === h && (u = r.getDateInfo(t.start.y + "-" + t.start.m));
  34130. var c = u.date;
  34131. c.setMonth(c.getMonth() + 1),
  34132. u = r.getDateInfo(c)
  34133. }
  34134. function d(t) {
  34135. a._firstDayOfMonth.push(r.getDateInfo(t)),
  34136. a._firstDayPoints.push(r.dataToRect([t], !1).tl);
  34137. var e = a._getLinePointsOfOneWeek(i, t, n);
  34138. a._tlpoints.push(e[0]),
  34139. a._blpoints.push(e[e.length - 1]),
  34140. l && a._drawSplitline(e, s, o)
  34141. }
  34142. d(r.getNextNDay(t.end.time, 1).formatedDate),
  34143. l && this._drawSplitline(a._getEdgesPoints(a._tlpoints, e, n), s, o),
  34144. l && this._drawSplitline(a._getEdgesPoints(a._blpoints, e, n), s, o)
  34145. },
  34146. _getEdgesPoints: function(t, e, i) {
  34147. var n = [t[0].slice(), t[t.length - 1].slice()]
  34148. , o = "horizontal" === i ? 0 : 1;
  34149. return n[0][o] = n[0][o] - e / 2,
  34150. n[1][o] = n[1][o] + e / 2,
  34151. n
  34152. },
  34153. _drawSplitline: function(t, e, i) {
  34154. var n = new ts({
  34155. z2: 20,
  34156. shape: {
  34157. points: t
  34158. },
  34159. style: e
  34160. });
  34161. i.add(n)
  34162. },
  34163. _getLinePointsOfOneWeek: function(t, e, i) {
  34164. var n = t.coordinateSystem;
  34165. e = n.getDateInfo(e);
  34166. for (var o = [], a = 0; a < 7; a++) {
  34167. var r = n.getNextNDay(e.time, a)
  34168. , s = n.dataToRect([r.time], !1);
  34169. o[2 * r.day] = s.tl,
  34170. o[2 * r.day + 1] = s["horizontal" === i ? "bl" : "tr"]
  34171. }
  34172. return o
  34173. },
  34174. _formatterLabel: function(t, e) {
  34175. return "string" == typeof t && t ? uu(t, e) : "function" == typeof t ? t(e) : e.nameMap
  34176. },
  34177. _yearTextPositionControl: function(t, e, i, n, o) {
  34178. e = e.slice();
  34179. var a = ["center", "bottom"];
  34180. "bottom" === n ? (e[1] += o,
  34181. a = ["center", "top"]) : "left" === n ? e[0] -= o : "right" === n ? (e[0] += o,
  34182. a = ["center", "top"]) : e[1] -= o;
  34183. var r = 0;
  34184. return "left" !== n && "right" !== n || (r = Math.PI / 2),
  34185. {
  34186. rotation: r,
  34187. position: e,
  34188. style: {
  34189. textAlign: a[0],
  34190. textVerticalAlign: a[1]
  34191. }
  34192. }
  34193. },
  34194. _renderYearText: function(t, e, i, n) {
  34195. var o = t.getModel("yearLabel");
  34196. if (o.get("show")) {
  34197. var a = o.get("margin")
  34198. , r = o.get("position");
  34199. r = r || ("horizontal" !== i ? "top" : "left");
  34200. var s = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]]
  34201. , l = (s[0][0] + s[1][0]) / 2
  34202. , u = (s[0][1] + s[1][1]) / 2
  34203. , h = "horizontal" === i ? 0 : 1
  34204. , c = {
  34205. top: [l, s[h][1]],
  34206. bottom: [l, s[1 - h][1]],
  34207. left: [s[1 - h][0], u],
  34208. right: [s[h][0], u]
  34209. }
  34210. , d = e.start.y;
  34211. +e.end.y > +e.start.y && (d = d + "-" + e.end.y);
  34212. var f = o.get("formatter")
  34213. , p = {
  34214. start: e.start.y,
  34215. end: e.end.y,
  34216. nameMap: d
  34217. }
  34218. , g = this._formatterLabel(f, p)
  34219. , m = new Ur({
  34220. z2: 30
  34221. });
  34222. nl(m.style, o, {
  34223. text: g
  34224. }),
  34225. m.attr(this._yearTextPositionControl(m, c[r], i, r, a)),
  34226. n.add(m)
  34227. }
  34228. },
  34229. _monthTextPositionControl: function(t, e, i, n, o) {
  34230. var a = "left"
  34231. , r = "top"
  34232. , s = t[0]
  34233. , l = t[1];
  34234. return "horizontal" === i ? (l += o,
  34235. e && (a = "center"),
  34236. "start" === n && (r = "bottom")) : (s += o,
  34237. e && (r = "middle"),
  34238. "start" === n && (a = "right")),
  34239. {
  34240. x: s,
  34241. y: l,
  34242. textAlign: a,
  34243. textVerticalAlign: r
  34244. }
  34245. },
  34246. _renderMonthText: function(t, e, i) {
  34247. var n = t.getModel("monthLabel");
  34248. if (n.get("show")) {
  34249. var o = n.get("nameMap")
  34250. , a = n.get("margin")
  34251. , r = n.get("position")
  34252. , s = n.get("align")
  34253. , l = [this._tlpoints, this._blpoints];
  34254. R(o) && (o = qT[o.toUpperCase()] || []);
  34255. var u = "start" === r ? 0 : 1
  34256. , h = "horizontal" === e ? 0 : 1;
  34257. a = "start" === r ? -a : a;
  34258. for (var c = "center" === s, d = 0; d < l[u].length - 1; d++) {
  34259. var f = l[u][d].slice()
  34260. , p = this._firstDayOfMonth[d];
  34261. if (c) {
  34262. var g = this._firstDayPoints[d];
  34263. f[h] = (g[h] + l[0][d + 1][h]) / 2
  34264. }
  34265. var m = n.get("formatter")
  34266. , v = o[+p.m - 1]
  34267. , y = {
  34268. yyyy: p.y,
  34269. yy: (p.y + "").slice(2),
  34270. MM: p.m,
  34271. M: +p.m,
  34272. nameMap: v
  34273. }
  34274. , x = this._formatterLabel(m, y)
  34275. , _ = new Ur({
  34276. z2: 30
  34277. });
  34278. P(nl(_.style, n, {
  34279. text: x
  34280. }), this._monthTextPositionControl(f, c, e, r, a)),
  34281. i.add(_)
  34282. }
  34283. }
  34284. },
  34285. _weekTextPositionControl: function(t, e, i, n, o) {
  34286. var a = "center"
  34287. , r = "middle"
  34288. , s = t[0]
  34289. , l = t[1]
  34290. , u = "start" === i;
  34291. return "horizontal" === e ? (s = s + n + (u ? 1 : -1) * o[0] / 2,
  34292. a = u ? "right" : "left") : (l = l + n + (u ? 1 : -1) * o[1] / 2,
  34293. r = u ? "bottom" : "top"),
  34294. {
  34295. x: s,
  34296. y: l,
  34297. textAlign: a,
  34298. textVerticalAlign: r
  34299. }
  34300. },
  34301. _renderWeekText: function(t, e, i, n) {
  34302. var o = t.getModel("dayLabel");
  34303. if (o.get("show")) {
  34304. var a = t.coordinateSystem
  34305. , r = o.get("position")
  34306. , s = o.get("nameMap")
  34307. , l = o.get("margin")
  34308. , u = a.getFirstDayOfWeek();
  34309. R(s) && (s = KT[s.toUpperCase()] || []);
  34310. var h = a.getNextNDay(e.end.time, 7 - e.lweek).time
  34311. , c = [a.getCellWidth(), a.getCellHeight()];
  34312. l = Rl(l, c["horizontal" === i ? 0 : 1]),
  34313. "start" === r && (h = a.getNextNDay(e.start.time, -(7 + e.fweek)).time,
  34314. l = -l);
  34315. for (var d = 0; d < 7; d++) {
  34316. var f, p = a.getNextNDay(h, d), g = a.dataToRect([p.time], !1).center;
  34317. f = Math.abs((d + u) % 7);
  34318. var m = new Ur({
  34319. z2: 30
  34320. });
  34321. P(nl(m.style, o, {
  34322. text: s[f]
  34323. }), this._weekTextPositionControl(g, i, r, l, c)),
  34324. n.add(m)
  34325. }
  34326. }
  34327. }
  34328. });
  34329. var $T = {
  34330. path: null,
  34331. compoundPath: null,
  34332. group: Ci,
  34333. image: Qn,
  34334. text: Ur
  34335. };
  34336. yf(function(t) {
  34337. var e = t.graphic;
  34338. L(e) ? e[0] && e[0].elements ? t.graphic = [t.graphic[0]] : t.graphic = [{
  34339. elements: e
  34340. }] : e && !e.elements && (t.graphic = [{
  34341. elements: [e]
  34342. }])
  34343. });
  34344. var JT = Tf({
  34345. type: "graphic",
  34346. defaultOption: {
  34347. elements: [],
  34348. parentId: null
  34349. },
  34350. _elOptionsToUpdate: null,
  34351. mergeOption: function(t) {
  34352. var e = this.option.elements;
  34353. this.option.elements = null,
  34354. JT.superApply(this, "mergeOption", arguments),
  34355. this.option.elements = e
  34356. },
  34357. optionUpdated: function(t, e) {
  34358. var i = this.option
  34359. , n = (e ? i : t).elements
  34360. , o = i.elements = e ? [] : i.elements
  34361. , a = [];
  34362. this._flatten(n, a);
  34363. var r = Ho(o, a);
  34364. Zo(r);
  34365. var s = this._elOptionsToUpdate = [];
  34366. E(r, function(t, e) {
  34367. var i = t.option;
  34368. i && (s.push(i),
  34369. function(t, e) {
  34370. var i = t.exist;
  34371. if (e.id = t.keyInfo.id,
  34372. !e.type && i && (e.type = i.type),
  34373. null == e.parentId) {
  34374. var n = e.parentOption;
  34375. n ? e.parentId = n.id : i && (e.parentId = i.parentId)
  34376. }
  34377. e.parentOption = null
  34378. }(t, i),
  34379. function(t, e, i) {
  34380. var n = P({}, i)
  34381. , o = t[e]
  34382. , a = i.$action || "merge";
  34383. "merge" === a ? o ? (m(o, n, !0),
  34384. Mu(o, n, {
  34385. ignoreSize: !0
  34386. }),
  34387. Tu(i, o)) : t[e] = n : "replace" === a ? t[e] = n : "remove" === a && o && (t[e] = null)
  34388. }(o, e, i),
  34389. function(t, e) {
  34390. if (!t)
  34391. return;
  34392. t.hv = e.hv = [eA(e, ["left", "right"]), eA(e, ["top", "bottom"])],
  34393. "group" === t.type && (null == t.width && (t.width = e.width = 0),
  34394. null == t.height && (t.height = e.height = 0))
  34395. }(o[e], i))
  34396. }, this);
  34397. for (var l = o.length - 1; 0 <= l; l--)
  34398. null == o[l] ? o.splice(l, 1) : delete o[l].$action
  34399. },
  34400. _flatten: function(t, i, n) {
  34401. E(t, function(t) {
  34402. if (t) {
  34403. n && (t.parentOption = n),
  34404. i.push(t);
  34405. var e = t.children;
  34406. "group" === t.type && e && this._flatten(e, i, t),
  34407. delete t.children
  34408. }
  34409. }, this)
  34410. },
  34411. useElOptionsToUpdate: function() {
  34412. var t = this._elOptionsToUpdate;
  34413. return this._elOptionsToUpdate = null,
  34414. t
  34415. }
  34416. });
  34417. function QT(t, e, i, n) {
  34418. var o = i.type
  34419. , a = new ($T.hasOwnProperty(o) ? $T[o] : ks(o))(i);
  34420. e.add(a),
  34421. n.set(t, a),
  34422. a.__ecGraphicId = t
  34423. }
  34424. function tA(t, e) {
  34425. var i = t && t.parent;
  34426. i && ("group" === t.type && t.traverse(function(t) {
  34427. tA(t, e)
  34428. }),
  34429. e.removeKey(t.__ecGraphicId),
  34430. i.remove(t))
  34431. }
  34432. function eA(e, t) {
  34433. var i;
  34434. return E(t, function(t) {
  34435. null != e[t] && "auto" !== e[t] && (i = !0)
  34436. }),
  34437. i
  34438. }
  34439. Af({
  34440. type: "graphic",
  34441. init: function(t, e) {
  34442. this._elMap = Q(),
  34443. this._lastGraphicModel
  34444. },
  34445. render: function(t, e, i) {
  34446. t !== this._lastGraphicModel && this._clear(),
  34447. this._lastGraphicModel = t,
  34448. this._updateElements(t),
  34449. this._relocate(t, i)
  34450. },
  34451. _updateElements: function(u) {
  34452. var t = u.useElOptionsToUpdate();
  34453. if (t) {
  34454. var h = this._elMap
  34455. , c = this.group;
  34456. E(t, function(t) {
  34457. var e = t.$action
  34458. , i = t.id
  34459. , n = h.get(i)
  34460. , o = t.parentId
  34461. , a = null != o ? h.get(o) : c
  34462. , r = t.style;
  34463. "text" === t.type && r && (t.hv && t.hv[1] && (r.textVerticalAlign = r.textBaseline = null),
  34464. !r.hasOwnProperty("textFill") && r.fill && (r.textFill = r.fill),
  34465. !r.hasOwnProperty("textStroke") && r.stroke && (r.textStroke = r.stroke));
  34466. var s = function(e) {
  34467. return e = P({}, e),
  34468. E(["id", "parentId", "$action", "hv", "bounding"].concat(yu), function(t) {
  34469. delete e[t]
  34470. }),
  34471. e
  34472. }(t);
  34473. e && "merge" !== e ? "replace" === e ? (tA(n, h),
  34474. QT(i, a, s, h)) : "remove" === e && tA(n, h) : n ? n.attr(s) : QT(i, a, s, h);
  34475. var l = h.get(i);
  34476. l && (l.__ecGraphicWidthOption = t.width,
  34477. l.__ecGraphicHeightOption = t.height,
  34478. function(t, e) {
  34479. var i = t.eventData;
  34480. t.silent || t.ignore || i || (i = t.eventData = {
  34481. componentType: "graphic",
  34482. componentIndex: e.componentIndex,
  34483. name: t.name
  34484. });
  34485. i && (i.info = t.info)
  34486. }(l, u))
  34487. })
  34488. }
  34489. },
  34490. _relocate: function(t, e) {
  34491. for (var i = t.option.elements, n = this.group, o = this._elMap, a = e.getWidth(), r = e.getHeight(), s = 0; s < i.length; s++) {
  34492. var l = i[s];
  34493. if ((h = o.get(l.id)) && h.isGroup) {
  34494. var u = (c = h.parent) === n;
  34495. h.__ecGraphicWidth = Rl(h.__ecGraphicWidthOption, u ? a : c.__ecGraphicWidth) || 0,
  34496. h.__ecGraphicHeight = Rl(h.__ecGraphicHeightOption, u ? r : c.__ecGraphicHeight) || 0
  34497. }
  34498. }
  34499. for (s = i.length - 1; 0 <= s; s--) {
  34500. var h, c;
  34501. l = i[s];
  34502. if (h = o.get(l.id))
  34503. Su(h, l, (c = h.parent) === n ? {
  34504. width: a,
  34505. height: r
  34506. } : {
  34507. width: c.__ecGraphicWidth,
  34508. height: c.__ecGraphicHeight
  34509. }, null, {
  34510. hv: l.hv,
  34511. boundingMode: l.bounding
  34512. })
  34513. }
  34514. },
  34515. _clear: function() {
  34516. var e = this._elMap;
  34517. e.each(function(t) {
  34518. tA(t, e)
  34519. }),
  34520. this._elMap = Q()
  34521. },
  34522. dispose: function() {
  34523. this._clear()
  34524. }
  34525. });
  34526. var iA = {};
  34527. function nA(t, e) {
  34528. iA[t] = e
  34529. }
  34530. function oA(t) {
  34531. return iA[t]
  34532. }
  34533. var aA = Tf({
  34534. type: "toolbox",
  34535. layoutMode: {
  34536. type: "box",
  34537. ignoreSize: !0
  34538. },
  34539. optionUpdated: function() {
  34540. aA.superApply(this, "optionUpdated", arguments),
  34541. E(this.option.feature, function(t, e) {
  34542. var i = oA(e);
  34543. i && m(t, i.defaultOption)
  34544. })
  34545. },
  34546. defaultOption: {
  34547. show: !0,
  34548. z: 6,
  34549. zlevel: 0,
  34550. orient: "horizontal",
  34551. left: "right",
  34552. top: "top",
  34553. backgroundColor: "transparent",
  34554. borderColor: "#ccc",
  34555. borderRadius: 0,
  34556. borderWidth: 0,
  34557. padding: 5,
  34558. itemSize: 15,
  34559. itemGap: 8,
  34560. showTitle: !0,
  34561. iconStyle: {
  34562. borderColor: "#666",
  34563. color: "none"
  34564. },
  34565. emphasis: {
  34566. iconStyle: {
  34567. borderColor: "#3E98C5"
  34568. }
  34569. },
  34570. tooltip: {
  34571. show: !1
  34572. }
  34573. }
  34574. });
  34575. function rA(t, e) {
  34576. var i = iu(e.get("padding"))
  34577. , n = e.getItemStyle(["color", "opacity"]);
  34578. return n.fill = e.get("backgroundColor"),
  34579. t = new rs({
  34580. shape: {
  34581. x: t.x - i[3],
  34582. y: t.y - i[0],
  34583. width: t.width + i[1] + i[3],
  34584. height: t.height + i[0] + i[2],
  34585. r: e.get("borderRadius")
  34586. },
  34587. style: n,
  34588. silent: !0,
  34589. z2: -1
  34590. })
  34591. }
  34592. Af({
  34593. type: "toolbox",
  34594. render: function(h, c, d, l) {
  34595. var f = this.group;
  34596. if (f.removeAll(),
  34597. h.get("show")) {
  34598. var p = +h.get("itemSize")
  34599. , u = h.get("feature") || {}
  34600. , g = this._features || (this._features = {})
  34601. , m = [];
  34602. E(u, function(t, e) {
  34603. m.push(e)
  34604. }),
  34605. new kf(this._featureNames || [],m).add(t).update(t).remove(T(t, null)).execute(),
  34606. this._featureNames = m,
  34607. function(t, e, i) {
  34608. var n = e.getBoxLayoutParams()
  34609. , o = e.get("padding")
  34610. , a = {
  34611. width: i.getWidth(),
  34612. height: i.getHeight()
  34613. }
  34614. , r = bu(n, a, o);
  34615. wu(e.get("orient"), t, e.get("itemGap"), r.width, r.height),
  34616. Su(t, n, a, o)
  34617. }(f, h, d),
  34618. f.add(rA(f.getBoundingRect(), h)),
  34619. f.eachChild(function(t) {
  34620. var e = t.__title
  34621. , i = t.hoverStyle;
  34622. if (i && e) {
  34623. var n = gn(e, An(i))
  34624. , o = t.position[0] + f.position[0]
  34625. , a = !1;
  34626. t.position[1] + f.position[1] + p + n.height > d.getHeight() && (i.textPosition = "top",
  34627. a = !0);
  34628. var r = a ? -5 - n.height : p + 8;
  34629. o + n.width / 2 > d.getWidth() ? (i.textPosition = ["100%", r],
  34630. i.textAlign = "right") : o - n.width / 2 < 0 && (i.textPosition = [0, r],
  34631. i.textAlign = "left")
  34632. }
  34633. })
  34634. }
  34635. function t(t, e) {
  34636. var i, n = m[t], o = m[e], a = u[n], r = new Cl(a,h,h.ecModel);
  34637. if (l && null != l.newTitle && l.featureName === n && (a.title = l.newTitle),
  34638. n && !o) {
  34639. if (function(t) {
  34640. return 0 === t.indexOf("my")
  34641. }(n))
  34642. i = {
  34643. model: r,
  34644. onclick: r.option.onclick,
  34645. featureName: n
  34646. };
  34647. else {
  34648. var s = oA(n);
  34649. if (!s)
  34650. return;
  34651. i = new s(r,c,d)
  34652. }
  34653. g[n] = i
  34654. } else {
  34655. if (!(i = g[o]))
  34656. return;
  34657. i.model = r,
  34658. i.ecModel = c,
  34659. i.api = d
  34660. }
  34661. n || !o ? r.get("show") && !i.unusable ? (function(o, a, t) {
  34662. var r = o.getModel("iconStyle")
  34663. , s = o.getModel("emphasis.iconStyle")
  34664. , e = a.getIcons ? a.getIcons() : o.get("icon")
  34665. , l = o.get("title") || {};
  34666. if ("string" == typeof e) {
  34667. var i = e
  34668. , n = l;
  34669. l = {},
  34670. (e = {})[t] = i,
  34671. l[t] = n
  34672. }
  34673. var u = o.iconPaths = {};
  34674. E(e, function(t, e) {
  34675. var i = yl(t, {}, {
  34676. x: -p / 2,
  34677. y: -p / 2,
  34678. width: p,
  34679. height: p
  34680. });
  34681. i.setStyle(r.getItemStyle()),
  34682. i.hoverStyle = s.getItemStyle(),
  34683. i.setStyle({
  34684. text: l[e],
  34685. textAlign: s.get("textAlign"),
  34686. textBorderRadius: s.get("textBorderRadius"),
  34687. textPadding: s.get("textPadding"),
  34688. textFill: null
  34689. });
  34690. var n = h.getModel("tooltip");
  34691. n && n.get("show") && i.attr("tooltip", P({
  34692. content: l[e],
  34693. formatter: n.get("formatter", !0) || function() {
  34694. return l[e]
  34695. }
  34696. ,
  34697. formatterParams: {
  34698. componentType: "toolbox",
  34699. name: e,
  34700. title: l[e],
  34701. $vars: ["name", "title"]
  34702. },
  34703. position: n.get("position", !0) || "bottom"
  34704. }, n.option)),
  34705. $s(i),
  34706. h.get("showTitle") && (i.__title = l[e],
  34707. i.on("mouseover", function() {
  34708. var t = s.getItemStyle()
  34709. , e = "vertical" === h.get("orient") ? null == h.get("right") ? "right" : "left" : null == h.get("bottom") ? "bottom" : "top";
  34710. i.setStyle({
  34711. textFill: s.get("textFill") || t.fill || t.stroke || "#000",
  34712. textBackgroundColor: s.get("textBackgroundColor"),
  34713. textPosition: s.get("textPosition") || e
  34714. })
  34715. }).on("mouseout", function() {
  34716. i.setStyle({
  34717. textFill: null,
  34718. textBackgroundColor: null
  34719. })
  34720. })),
  34721. i.trigger(o.get("iconStatus." + e) || "normal"),
  34722. f.add(i),
  34723. i.on("click", A(a.onclick, a, c, d, e)),
  34724. u[e] = i
  34725. })
  34726. }(r, i, n),
  34727. r.setIconStatus = function(t, e) {
  34728. var i = this.option
  34729. , n = this.iconPaths;
  34730. i.iconStatus = i.iconStatus || {},
  34731. i.iconStatus[t] = e,
  34732. n[t] && n[t].trigger(e)
  34733. }
  34734. ,
  34735. i.render && i.render(r, c, d, l)) : i.remove && i.remove(c, d) : i.dispose && i.dispose(c, d)
  34736. }
  34737. },
  34738. updateView: function(t, e, i, n) {
  34739. E(this._features, function(t) {
  34740. t.updateView && t.updateView(t.model, e, i, n)
  34741. })
  34742. },
  34743. remove: function(e, i) {
  34744. E(this._features, function(t) {
  34745. t.remove && t.remove(e, i)
  34746. }),
  34747. this.group.removeAll()
  34748. },
  34749. dispose: function(e, i) {
  34750. E(this._features, function(t) {
  34751. t.dispose && t.dispose(e, i)
  34752. })
  34753. }
  34754. });
  34755. var sA = Oc.toolbox.saveAsImage;
  34756. function lA(t) {
  34757. this.model = t
  34758. }
  34759. lA.defaultOption = {
  34760. show: !0,
  34761. icon: "M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",
  34762. title: sA.title,
  34763. type: "png",
  34764. connectedBackgroundColor: "#fff",
  34765. name: "",
  34766. excludeComponents: ["toolbox"],
  34767. pixelRatio: 1,
  34768. lang: sA.lang.slice()
  34769. },
  34770. lA.prototype.unusable = !v.canvasSupported,
  34771. lA.prototype.onclick = function(t, e) {
  34772. var i = this.model
  34773. , n = i.get("name") || t.get("title.0.text") || "echarts"
  34774. , o = "svg" === e.getZr().painter.getType() ? "svg" : i.get("type", !0) || "png"
  34775. , a = e.getConnectedDataURL({
  34776. type: o,
  34777. backgroundColor: i.get("backgroundColor", !0) || t.get("backgroundColor") || "#fff",
  34778. connectedBackgroundColor: i.get("connectedBackgroundColor"),
  34779. excludeComponents: i.get("excludeComponents"),
  34780. pixelRatio: i.get("pixelRatio")
  34781. });
  34782. if ("function" != typeof MouseEvent || v.browser.ie || v.browser.edge)
  34783. if (window.navigator.msSaveOrOpenBlob) {
  34784. for (var r = atob(a.split(",")[1]), s = r.length, l = new Uint8Array(s); s--; )
  34785. l[s] = r.charCodeAt(s);
  34786. var u = new Blob([l]);
  34787. window.navigator.msSaveOrOpenBlob(u, n + "." + o)
  34788. } else {
  34789. var h = i.get("lang")
  34790. , c = '<body style="margin:0;"><img src="' + a + '" style="max-width:100%;" title="' + (h && h[0] || "") + '" /></body>';
  34791. window.open().document.write(c)
  34792. }
  34793. else {
  34794. var d = document.createElement("a");
  34795. d.download = n + "." + o,
  34796. d.target = "_blank",
  34797. d.href = a;
  34798. var f = new MouseEvent("click",{
  34799. view: window,
  34800. bubbles: !0,
  34801. cancelable: !1
  34802. });
  34803. d.dispatchEvent(f)
  34804. }
  34805. }
  34806. ,
  34807. nA("saveAsImage", lA);
  34808. var uA = Oc.toolbox.magicType
  34809. , hA = "__ec_magicType_stack__";
  34810. function cA(t) {
  34811. this.model = t
  34812. }
  34813. cA.defaultOption = {
  34814. show: !0,
  34815. type: [],
  34816. icon: {
  34817. line: "M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",
  34818. bar: "M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",
  34819. stack: "M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"
  34820. },
  34821. title: k(uA.title),
  34822. option: {},
  34823. seriesIndex: {}
  34824. };
  34825. var dA = cA.prototype;
  34826. dA.getIcons = function() {
  34827. var t = this.model
  34828. , e = t.get("icon")
  34829. , i = {};
  34830. return E(t.get("type"), function(t) {
  34831. e[t] && (i[t] = e[t])
  34832. }),
  34833. i
  34834. }
  34835. ;
  34836. var fA = {
  34837. line: function(t, e, i, n) {
  34838. if ("bar" === t)
  34839. return m({
  34840. id: e,
  34841. type: "line",
  34842. data: i.get("data"),
  34843. stack: i.get("stack"),
  34844. markPoint: i.get("markPoint"),
  34845. markLine: i.get("markLine")
  34846. }, n.get("option.line") || {}, !0)
  34847. },
  34848. bar: function(t, e, i, n) {
  34849. if ("line" === t)
  34850. return m({
  34851. id: e,
  34852. type: "bar",
  34853. data: i.get("data"),
  34854. stack: i.get("stack"),
  34855. markPoint: i.get("markPoint"),
  34856. markLine: i.get("markLine")
  34857. }, n.get("option.bar") || {}, !0)
  34858. },
  34859. stack: function(t, e, i, n) {
  34860. var o = i.get("stack") === hA;
  34861. if ("line" === t || "bar" === t)
  34862. return n.setIconStatus("stack", o ? "normal" : "emphasis"),
  34863. m({
  34864. id: e,
  34865. stack: o ? "" : hA
  34866. }, n.get("option.stack") || {}, !0)
  34867. }
  34868. }
  34869. , pA = [["line", "bar"], ["stack"]];
  34870. dA.onclick = function(u, t, h) {
  34871. var c = this.model
  34872. , e = c.get("seriesIndex." + h);
  34873. if (fA[h]) {
  34874. var i, d = {
  34875. series: []
  34876. };
  34877. if (E(pA, function(t) {
  34878. 0 <= _(t, h) && E(t, function(t) {
  34879. c.setIconStatus(t, "normal")
  34880. })
  34881. }),
  34882. c.setIconStatus(h, "emphasis"),
  34883. u.eachComponent({
  34884. mainType: "series",
  34885. query: null == e ? null : {
  34886. seriesIndex: e
  34887. }
  34888. }, function(t) {
  34889. var e = t.subType
  34890. , i = t.id
  34891. , n = fA[h](e, i, t, c);
  34892. n && (D(n, t.option),
  34893. d.series.push(n));
  34894. var o = t.coordinateSystem;
  34895. if (o && "cartesian2d" === o.type && ("line" === h || "bar" === h)) {
  34896. var a = o.getAxesByScale("ordinal")[0];
  34897. if (a) {
  34898. var r = a.dim + "Axis"
  34899. , s = u.queryComponents({
  34900. mainType: r,
  34901. index: t.get(name + "Index"),
  34902. id: t.get(name + "Id")
  34903. })[0].componentIndex;
  34904. d[r] = d[r] || [];
  34905. for (var l = 0; l <= s; l++)
  34906. d[r][s] = d[r][s] || {};
  34907. d[r][s].boundaryGap = "bar" === h
  34908. }
  34909. }
  34910. }),
  34911. "stack" === h)
  34912. i = d.series && d.series[0] && d.series[0].stack === hA ? m({
  34913. stack: uA.title.tiled
  34914. }, uA.title) : k(uA.title);
  34915. t.dispatchAction({
  34916. type: "changeMagicType",
  34917. currentType: h,
  34918. newOption: d,
  34919. newTitle: i,
  34920. featureName: "magicType"
  34921. })
  34922. }
  34923. }
  34924. ,
  34925. _f({
  34926. type: "changeMagicType",
  34927. event: "magicTypeChanged",
  34928. update: "prepareAndUpdate"
  34929. }, function(t, e) {
  34930. e.mergeOption(t.newOption)
  34931. }),
  34932. nA("magicType", cA);
  34933. var gA = Oc.toolbox.dataView
  34934. , mA = new Array(60).join("-")
  34935. , vA = "\t";
  34936. function yA(t) {
  34937. var e = function(t) {
  34938. var o = {}
  34939. , a = []
  34940. , r = [];
  34941. return t.eachRawSeries(function(t) {
  34942. var e = t.coordinateSystem;
  34943. if (!e || "cartesian2d" !== e.type && "polar" !== e.type)
  34944. a.push(t);
  34945. else {
  34946. var i = e.getBaseAxis();
  34947. if ("category" === i.type) {
  34948. var n = i.dim + "_" + i.index;
  34949. o[n] || (o[n] = {
  34950. categoryAxis: i,
  34951. valueAxis: e.getOtherAxis(i),
  34952. series: []
  34953. },
  34954. r.push({
  34955. axisDim: i.dim,
  34956. axisIndex: i.index
  34957. })),
  34958. o[n].series.push(t)
  34959. } else
  34960. a.push(t)
  34961. }
  34962. }),
  34963. {
  34964. seriesGroupByCategoryAxis: o,
  34965. other: a,
  34966. meta: r
  34967. }
  34968. }(t);
  34969. return {
  34970. value: M([function(t) {
  34971. var h = [];
  34972. return E(t, function(t, e) {
  34973. var i = t.categoryAxis
  34974. , n = t.valueAxis.dim
  34975. , o = [" "].concat(O(t.series, function(t) {
  34976. return t.name
  34977. }))
  34978. , a = [i.model.getCategories()];
  34979. E(t.series, function(t) {
  34980. a.push(t.getRawData().mapArray(n, function(t) {
  34981. return t
  34982. }))
  34983. });
  34984. for (var r = [o.join(vA)], s = 0; s < a[0].length; s++) {
  34985. for (var l = [], u = 0; u < a.length; u++)
  34986. l.push(a[u][s]);
  34987. r.push(l.join(vA))
  34988. }
  34989. h.push(r.join("\n"))
  34990. }),
  34991. h.join("\n\n" + mA + "\n\n")
  34992. }(e.seriesGroupByCategoryAxis), function(t) {
  34993. return O(t, function(t) {
  34994. var o = t.getRawData()
  34995. , a = [t.name]
  34996. , r = [];
  34997. return o.each(o.dimensions, function() {
  34998. for (var t = arguments.length, e = arguments[t - 1], i = o.getName(e), n = 0; n < t - 1; n++)
  34999. r[n] = arguments[n];
  35000. a.push((i ? i + vA : "") + r.join(vA))
  35001. }),
  35002. a.join("\n")
  35003. }).join("\n\n" + mA + "\n\n")
  35004. }(e.other)], function(t) {
  35005. return t.replace(/[\n\t\s]/g, "")
  35006. }).join("\n\n" + mA + "\n\n"),
  35007. meta: e.meta
  35008. }
  35009. }
  35010. function xA(t) {
  35011. return t.replace(/^\s\s*/, "").replace(/\s\s*$/, "")
  35012. }
  35013. var _A = new RegExp("[" + vA + "]+","g");
  35014. function wA(t, a) {
  35015. var e = t.split(new RegExp("\n*" + mA + "\n*","g"))
  35016. , r = {
  35017. series: []
  35018. };
  35019. return E(e, function(t, e) {
  35020. if (function(t) {
  35021. if (0 <= t.slice(0, t.indexOf("\n")).indexOf(vA))
  35022. return !0
  35023. }(t)) {
  35024. var i = function(t) {
  35025. for (var e = t.split(/\n+/g), i = [], n = O(xA(e.shift()).split(_A), function(t) {
  35026. return {
  35027. name: t,
  35028. data: []
  35029. }
  35030. }), o = 0; o < e.length; o++) {
  35031. var a = xA(e[o]).split(_A);
  35032. i.push(a.shift());
  35033. for (var r = 0; r < a.length; r++)
  35034. n[r] && (n[r].data[o] = a[r])
  35035. }
  35036. return {
  35037. series: n,
  35038. categories: i
  35039. }
  35040. }(t)
  35041. , n = a[e]
  35042. , o = n.axisDim + "Axis";
  35043. n && (r[o] = r[o] || [],
  35044. r[o][n.axisIndex] = {
  35045. data: i.categories
  35046. },
  35047. r.series = r.series.concat(i.series))
  35048. } else {
  35049. i = function(t) {
  35050. for (var e = t.split(/\n+/g), i = xA(e.shift()), n = [], o = 0; o < e.length; o++) {
  35051. var a, r = xA(e[o]).split(_A), s = "", l = !1;
  35052. a = isNaN(r[0]) ? (l = !0,
  35053. s = r[0],
  35054. r = r.slice(1),
  35055. n[o] = {
  35056. name: s,
  35057. value: []
  35058. },
  35059. n[o].value) : n[o] = [];
  35060. for (var u = 0; u < r.length; u++)
  35061. a.push(+r[u]);
  35062. 1 === a.length && (l ? n[o].value = a[0] : n[o] = a[0])
  35063. }
  35064. return {
  35065. name: i,
  35066. data: n
  35067. }
  35068. }(t);
  35069. r.series.push(i)
  35070. }
  35071. }),
  35072. r
  35073. }
  35074. function bA(t) {
  35075. this._dom = null,
  35076. this.model = t
  35077. }
  35078. bA.defaultOption = {
  35079. show: !0,
  35080. readOnly: !1,
  35081. optionToContent: null,
  35082. contentToOption: null,
  35083. icon: "M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",
  35084. title: k(gA.title),
  35085. lang: k(gA.lang),
  35086. backgroundColor: "#fff",
  35087. textColor: "#000",
  35088. textareaColor: "#fff",
  35089. textareaBorderColor: "#333",
  35090. buttonColor: "#c23531",
  35091. buttonTextColor: "#fff"
  35092. },
  35093. bA.prototype.onclick = function(t, e) {
  35094. var i = e.getDom()
  35095. , n = this.model;
  35096. this._dom && i.removeChild(this._dom);
  35097. var o = document.createElement("div");
  35098. o.style.cssText = "position:absolute;left:5px;top:5px;bottom:5px;right:5px;",
  35099. o.style.backgroundColor = n.get("backgroundColor") || "#fff";
  35100. var a = document.createElement("h4")
  35101. , r = n.get("lang") || [];
  35102. a.innerHTML = r[0] || n.get("title"),
  35103. a.style.cssText = "margin: 10px 20px;",
  35104. a.style.color = n.get("textColor");
  35105. var s = document.createElement("div")
  35106. , l = document.createElement("textarea");
  35107. s.style.cssText = "display:block;width:100%;overflow:auto;";
  35108. var u = n.get("optionToContent")
  35109. , h = n.get("contentToOption")
  35110. , c = yA(t);
  35111. if ("function" == typeof u) {
  35112. var d = u(e.getOption());
  35113. "string" == typeof d ? s.innerHTML = d : G(d) && s.appendChild(d)
  35114. } else
  35115. s.appendChild(l),
  35116. l.readOnly = n.get("readOnly"),
  35117. l.style.cssText = "width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;",
  35118. l.style.color = n.get("textColor"),
  35119. l.style.borderColor = n.get("textareaBorderColor"),
  35120. l.style.backgroundColor = n.get("textareaColor"),
  35121. l.value = c.value;
  35122. var f = c.meta
  35123. , p = document.createElement("div");
  35124. p.style.cssText = "position:absolute;bottom:0;left:0;right:0;";
  35125. var g = "float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px"
  35126. , m = document.createElement("div")
  35127. , v = document.createElement("div");
  35128. g += ";background-color:" + n.get("buttonColor"),
  35129. g += ";color:" + n.get("buttonTextColor");
  35130. var y = this;
  35131. function x() {
  35132. i.removeChild(o),
  35133. y._dom = null
  35134. }
  35135. Ut(m, "click", x),
  35136. Ut(v, "click", function() {
  35137. var t;
  35138. try {
  35139. t = "function" == typeof h ? h(s, e.getOption()) : wA(l.value, f)
  35140. } catch (t) {
  35141. throw x(),
  35142. new Error("Data view format error " + t)
  35143. }
  35144. t && e.dispatchAction({
  35145. type: "changeDataView",
  35146. newOption: t
  35147. }),
  35148. x()
  35149. }),
  35150. m.innerHTML = r[1],
  35151. v.innerHTML = r[2],
  35152. v.style.cssText = g,
  35153. m.style.cssText = g,
  35154. n.get("readOnly") || p.appendChild(v),
  35155. p.appendChild(m),
  35156. o.appendChild(a),
  35157. o.appendChild(s),
  35158. o.appendChild(p),
  35159. s.style.height = i.clientHeight - 80 + "px",
  35160. i.appendChild(o),
  35161. this._dom = o
  35162. }
  35163. ,
  35164. bA.prototype.remove = function(t, e) {
  35165. this._dom && e.getDom().removeChild(this._dom)
  35166. }
  35167. ,
  35168. bA.prototype.dispose = function(t, e) {
  35169. this.remove(t, e)
  35170. }
  35171. ,
  35172. nA("dataView", bA),
  35173. _f({
  35174. type: "changeDataView",
  35175. event: "dataViewChanged",
  35176. update: "prepareAndUpdate"
  35177. }, function(t, n) {
  35178. var o = [];
  35179. E(t.newOption.series, function(t) {
  35180. var e = n.getSeriesByName(t.name)[0];
  35181. if (e) {
  35182. var i = e.get("data");
  35183. o.push({
  35184. name: t.name,
  35185. data: function(t, n) {
  35186. return O(t, function(t, e) {
  35187. var i = n && n[e];
  35188. return z(i) && !L(i) ? (z(t) && !L(t) && (t = t.value),
  35189. D({
  35190. value: t
  35191. }, i)) : t
  35192. })
  35193. }(t.data, i)
  35194. })
  35195. } else
  35196. o.push(P({
  35197. type: "scatter"
  35198. }, t))
  35199. }),
  35200. n.mergeOption(D({
  35201. series: o
  35202. }, t.newOption))
  35203. });
  35204. var SA = E
  35205. , MA = _
  35206. , IA = T
  35207. , TA = ["dataToPoint", "pointToData"]
  35208. , AA = ["grid", "xAxis", "yAxis", "geo", "graph", "polar", "radiusAxis", "angleAxis", "bmap"];
  35209. function DA(t, e, i) {
  35210. var n = this._targetInfoList = []
  35211. , o = {}
  35212. , a = kA(e, t);
  35213. SA(PA, function(t, e) {
  35214. i && i.include && !(0 <= MA(i.include, e)) || t(a, n, o)
  35215. })
  35216. }
  35217. var CA = DA.prototype;
  35218. function LA(t) {
  35219. return t[0] > t[1] && t.reverse(),
  35220. t
  35221. }
  35222. function kA(t, e) {
  35223. return Ko(t, e, {
  35224. includeMainTypes: AA
  35225. })
  35226. }
  35227. CA.setOutputRanges = function(t, e) {
  35228. this.matchOutputRanges(t, e, function(t, e, i) {
  35229. if ((t.coordRanges || (t.coordRanges = [])).push(e),
  35230. !t.coordRange) {
  35231. t.coordRange = e;
  35232. var n = EA[t.brushType](0, i, e);
  35233. t.__rangeOffset = {
  35234. offset: zA[t.brushType](n.values, t.range, [1, 1]),
  35235. xyMinMax: n.xyMinMax
  35236. }
  35237. }
  35238. })
  35239. }
  35240. ,
  35241. CA.matchOutputRanges = function(t, n, o) {
  35242. SA(t, function(i) {
  35243. var t = this.findTargetInfo(i, n);
  35244. t && !0 !== t && E(t.coordSyses, function(t) {
  35245. var e = EA[i.brushType](1, t, i.range);
  35246. o(i, e.values, t, n)
  35247. })
  35248. }, this)
  35249. }
  35250. ,
  35251. CA.setInputRanges = function(t, o) {
  35252. SA(t, function(t) {
  35253. var e = this.findTargetInfo(t, o);
  35254. if (t.range = t.range || [],
  35255. e && !0 !== e) {
  35256. t.panelId = e.panelId;
  35257. var i = EA[t.brushType](0, e.coordSys, t.coordRange)
  35258. , n = t.__rangeOffset;
  35259. t.range = n ? zA[t.brushType](i.values, n.offset, function(t, e) {
  35260. var i = VA(t)
  35261. , n = VA(e)
  35262. , o = [i[0] / n[0], i[1] / n[1]];
  35263. return isNaN(o[0]) && (o[0] = 1),
  35264. isNaN(o[1]) && (o[1] = 1),
  35265. o
  35266. }(i.xyMinMax, n.xyMinMax)) : i.values
  35267. }
  35268. }, this)
  35269. }
  35270. ,
  35271. CA.makePanelOpts = function(i, n) {
  35272. return O(this._targetInfoList, function(t) {
  35273. var e = t.getPanelRect();
  35274. return {
  35275. panelId: t.panelId,
  35276. defaultBrushType: n && n(t),
  35277. clipPath: eS(e),
  35278. isTargetByCursor: nS(e, i, t.coordSysModel),
  35279. getLinearBrushOtherExtent: iS(e)
  35280. }
  35281. })
  35282. }
  35283. ,
  35284. CA.controlSeries = function(t, e, i) {
  35285. var n = this.findTargetInfo(t, i);
  35286. return !0 === n || n && 0 <= MA(n.coordSyses, e.coordinateSystem)
  35287. }
  35288. ,
  35289. CA.findTargetInfo = function(t, e) {
  35290. for (var i = this._targetInfoList, n = kA(e, t), o = 0; o < i.length; o++) {
  35291. var a = i[o]
  35292. , r = t.panelId;
  35293. if (r) {
  35294. if (a.panelId === r)
  35295. return a
  35296. } else
  35297. for (o = 0; o < NA.length; o++)
  35298. if (NA[o](n, a))
  35299. return a
  35300. }
  35301. return !0
  35302. }
  35303. ;
  35304. var PA = {
  35305. grid: function(t, n) {
  35306. var o = t.xAxisModels
  35307. , a = t.yAxisModels
  35308. , e = t.gridModels
  35309. , i = Q()
  35310. , r = {}
  35311. , s = {};
  35312. (o || a || e) && (SA(o, function(t) {
  35313. var e = t.axis.grid.model;
  35314. i.set(e.id, e),
  35315. r[e.id] = !0
  35316. }),
  35317. SA(a, function(t) {
  35318. var e = t.axis.grid.model;
  35319. i.set(e.id, e),
  35320. s[e.id] = !0
  35321. }),
  35322. SA(e, function(t) {
  35323. i.set(t.id, t),
  35324. r[t.id] = !0,
  35325. s[t.id] = !0
  35326. }),
  35327. i.each(function(t) {
  35328. var e = t.coordinateSystem
  35329. , i = [];
  35330. SA(e.getCartesians(), function(t, e) {
  35331. (0 <= MA(o, t.getAxis("x").model) || 0 <= MA(a, t.getAxis("y").model)) && i.push(t)
  35332. }),
  35333. n.push({
  35334. panelId: "grid--" + t.id,
  35335. gridModel: t,
  35336. coordSysModel: t,
  35337. coordSys: i[0],
  35338. coordSyses: i,
  35339. getPanelRect: OA.grid,
  35340. xAxisDeclared: r[t.id],
  35341. yAxisDeclared: s[t.id]
  35342. })
  35343. }))
  35344. },
  35345. geo: function(t, i) {
  35346. SA(t.geoModels, function(t) {
  35347. var e = t.coordinateSystem;
  35348. i.push({
  35349. panelId: "geo--" + t.id,
  35350. geoModel: t,
  35351. coordSysModel: t,
  35352. coordSys: e,
  35353. coordSyses: [e],
  35354. getPanelRect: OA.geo
  35355. })
  35356. })
  35357. }
  35358. }
  35359. , NA = [function(t, e) {
  35360. var i = t.xAxisModel
  35361. , n = t.yAxisModel
  35362. , o = t.gridModel;
  35363. return !o && i && (o = i.axis.grid.model),
  35364. !o && n && (o = n.axis.grid.model),
  35365. o && o === e.gridModel
  35366. }
  35367. , function(t, e) {
  35368. var i = t.geoModel;
  35369. return i && i === e.geoModel
  35370. }
  35371. ]
  35372. , OA = {
  35373. grid: function() {
  35374. return this.coordSys.grid.getRect().clone()
  35375. },
  35376. geo: function() {
  35377. var t = this.coordSys
  35378. , e = t.getBoundingRect().clone();
  35379. return e.applyTransform(fl(t)),
  35380. e
  35381. }
  35382. }
  35383. , EA = {
  35384. lineX: IA(RA, 0),
  35385. lineY: IA(RA, 1),
  35386. rect: function(t, e, i) {
  35387. var n = e[TA[t]]([i[0][0], i[1][0]])
  35388. , o = e[TA[t]]([i[0][1], i[1][1]])
  35389. , a = [LA([n[0], o[0]]), LA([n[1], o[1]])];
  35390. return {
  35391. values: a,
  35392. xyMinMax: a
  35393. }
  35394. },
  35395. polygon: function(i, n, t) {
  35396. var o = [[1 / 0, -1 / 0], [1 / 0, -1 / 0]];
  35397. return {
  35398. values: O(t, function(t) {
  35399. var e = n[TA[i]](t);
  35400. return o[0][0] = Math.min(o[0][0], e[0]),
  35401. o[1][0] = Math.min(o[1][0], e[1]),
  35402. o[0][1] = Math.max(o[0][1], e[0]),
  35403. o[1][1] = Math.max(o[1][1], e[1]),
  35404. e
  35405. }),
  35406. xyMinMax: o
  35407. }
  35408. }
  35409. };
  35410. function RA(t, e, i, n) {
  35411. var o = i.getAxis(["x", "y"][t])
  35412. , a = LA(O([0, 1], function(t) {
  35413. return e ? o.coordToData(o.toLocalCoord(n[t])) : o.toGlobalCoord(o.dataToCoord(n[t]))
  35414. }))
  35415. , r = [];
  35416. return r[t] = a,
  35417. r[1 - t] = [NaN, NaN],
  35418. {
  35419. values: a,
  35420. xyMinMax: r
  35421. }
  35422. }
  35423. var zA = {
  35424. lineX: IA(BA, 0),
  35425. lineY: IA(BA, 1),
  35426. rect: function(t, e, i) {
  35427. return [[t[0][0] - i[0] * e[0][0], t[0][1] - i[0] * e[0][1]], [t[1][0] - i[1] * e[1][0], t[1][1] - i[1] * e[1][1]]]
  35428. },
  35429. polygon: function(t, i, n) {
  35430. return O(t, function(t, e) {
  35431. return [t[0] - n[0] * i[e][0], t[1] - n[1] * i[e][1]]
  35432. })
  35433. }
  35434. };
  35435. function BA(t, e, i, n) {
  35436. return [e[0] - n[t] * i[0], e[1] - n[t] * i[1]]
  35437. }
  35438. function VA(t) {
  35439. return t ? [t[0][1] - t[0][0], t[1][1] - t[1][0]] : [NaN, NaN]
  35440. }
  35441. var GA = E
  35442. , FA = "\0_ec_hist_store";
  35443. function WA(t) {
  35444. var e = t[FA];
  35445. return e = e || (t[FA] = [{}])
  35446. }
  35447. ku.registerSubTypeDefaulter("dataZoom", function() {
  35448. return "slider"
  35449. });
  35450. var HA = ["cartesian2d", "polar", "singleAxis"];
  35451. var ZA, UA, XA, YA, jA = (UA = ["axisIndex", "axis", "index", "id"],
  35452. XA = O(ZA = (ZA = ["x", "y", "z", "radius", "angle", "single"]).slice(), fu),
  35453. YA = O(UA = (UA || []).slice(), fu),
  35454. function(o, a) {
  35455. E(ZA, function(t, e) {
  35456. for (var i = {
  35457. name: t,
  35458. capital: XA[e]
  35459. }, n = 0; n < UA.length; n++)
  35460. i[UA[n]] = t + YA[n];
  35461. o.call(a, i)
  35462. })
  35463. }
  35464. );
  35465. function qA(o, a, r) {
  35466. return function(t) {
  35467. var e, i = {
  35468. nodes: [],
  35469. records: {}
  35470. };
  35471. if (a(function(t) {
  35472. i.records[t.name] = {}
  35473. }),
  35474. !t)
  35475. return i;
  35476. for (s(t, i); e = !1,
  35477. o(n),
  35478. e; )
  35479. ;
  35480. function n(t) {
  35481. !function(t, e) {
  35482. return 0 <= _(e.nodes, t)
  35483. }(t, i) && function(t, i) {
  35484. var n = !1;
  35485. return a(function(e) {
  35486. E(r(t, e) || [], function(t) {
  35487. i.records[e.name][t] && (n = !0)
  35488. })
  35489. }),
  35490. n
  35491. }(t, i) && (s(t, i),
  35492. e = !0)
  35493. }
  35494. return i
  35495. }
  35496. ;
  35497. function s(t, i) {
  35498. i.nodes.push(t),
  35499. a(function(e) {
  35500. E(r(t, e) || [], function(t) {
  35501. i.records[e.name][t] = !0
  35502. })
  35503. })
  35504. }
  35505. }
  35506. function KA(t, e, i, n) {
  35507. this._dimName = t,
  35508. this._axisIndex = e,
  35509. this._valueWindow,
  35510. this._percentWindow,
  35511. this._dataExtent,
  35512. this._minMaxSpan,
  35513. this.ecModel = n,
  35514. this._dataZoomModel = i
  35515. }
  35516. var $A = E
  35517. , JA = Bl;
  35518. function QA(t, e) {
  35519. var i = t.getAxisModel()
  35520. , n = t._percentWindow
  35521. , o = t._valueWindow;
  35522. if (n) {
  35523. var a = Fl(o, [0, 500]);
  35524. a = Math.min(a, 20);
  35525. var r = e || 0 === n[0] && 100 === n[1];
  35526. i.setRange(r ? null : +o[0].toFixed(a), r ? null : +o[1].toFixed(a))
  35527. }
  35528. }
  35529. KA.prototype = {
  35530. constructor: KA,
  35531. hostedBy: function(t) {
  35532. return this._dataZoomModel === t
  35533. },
  35534. getDataValueWindow: function() {
  35535. return this._valueWindow.slice()
  35536. },
  35537. getDataPercentWindow: function() {
  35538. return this._percentWindow.slice()
  35539. },
  35540. getTargetSeriesModels: function() {
  35541. var n = []
  35542. , o = this.ecModel;
  35543. return o.eachSeries(function(t) {
  35544. if (function(t) {
  35545. return 0 <= _(HA, t)
  35546. }(t.get("coordinateSystem"))) {
  35547. var e = this._dimName
  35548. , i = o.queryComponents({
  35549. mainType: e + "Axis",
  35550. index: t.get(e + "AxisIndex"),
  35551. id: t.get(e + "AxisId")
  35552. })[0];
  35553. this._axisIndex === (i && i.componentIndex) && n.push(t)
  35554. }
  35555. }, this),
  35556. n
  35557. },
  35558. getAxisModel: function() {
  35559. return this.ecModel.getComponent(this._dimName + "Axis", this._axisIndex)
  35560. },
  35561. getOtherAxisModel: function() {
  35562. var t, e, i, n = this._dimName, o = this.ecModel, a = this.getAxisModel();
  35563. return t = "x" === n || "y" === n ? (e = "gridIndex",
  35564. "x" === n ? "y" : "x") : (e = "polarIndex",
  35565. "angle" === n ? "radius" : "angle"),
  35566. o.eachComponent(t + "Axis", function(t) {
  35567. (t.get(e) || 0) === (a.get(e) || 0) && (i = t)
  35568. }),
  35569. i
  35570. },
  35571. getMinMaxSpan: function() {
  35572. return k(this._minMaxSpan)
  35573. },
  35574. calculateDataWindow: function(o) {
  35575. var a, r = this._dataExtent, s = this.getAxisModel().axis.scale, l = this._dataZoomModel.getRangePropMode(), u = [0, 100], h = [], c = [];
  35576. $A(["start", "end"], function(t, e) {
  35577. var i = o[t]
  35578. , n = o[t + "Value"];
  35579. "percent" === l[e] ? (null == i && (i = u[e]),
  35580. n = s.parse(El(i, u, r))) : (a = !0,
  35581. i = El(n = null == n ? r[e] : s.parse(n), r, u)),
  35582. c[e] = n,
  35583. h[e] = i
  35584. }),
  35585. JA(c),
  35586. JA(h);
  35587. var d = this._minMaxSpan;
  35588. function t(t, e, i, n, o) {
  35589. var a = o ? "Span" : "ValueSpan";
  35590. Jw(0, t, i, "all", d["min" + a], d["max" + a]);
  35591. for (var r = 0; r < 2; r++)
  35592. e[r] = El(t[r], i, n, !0),
  35593. o && (e[r] = s.parse(e[r]))
  35594. }
  35595. return a ? t(c, h, r, u, !1) : t(h, c, u, r, !0),
  35596. {
  35597. valueWindow: c,
  35598. percentWindow: h
  35599. }
  35600. },
  35601. reset: function(t) {
  35602. if (t === this._dataZoomModel) {
  35603. var e = this.getTargetSeriesModels();
  35604. this._dataExtent = function(t, e, i) {
  35605. var n = [1 / 0, -1 / 0];
  35606. $A(i, function(t) {
  35607. var i = t.getData();
  35608. i && $A(i.mapDimension(e, !0), function(t) {
  35609. var e = i.getApproximateExtent(t);
  35610. e[0] < n[0] && (n[0] = e[0]),
  35611. e[1] > n[1] && (n[1] = e[1])
  35612. })
  35613. }),
  35614. n[1] < n[0] && (n = [NaN, NaN]);
  35615. return function(t, e) {
  35616. var i = t.getAxisModel()
  35617. , n = i.getMin(!0)
  35618. , o = "category" === i.get("type")
  35619. , a = o && i.getCategories().length;
  35620. null != n && "dataMin" !== n && "function" != typeof n ? e[0] = n : o && (e[0] = 0 < a ? 0 : NaN);
  35621. var r = i.getMax(!0);
  35622. null != r && "dataMax" !== r && "function" != typeof r ? e[1] = r : o && (e[1] = 0 < a ? a - 1 : NaN);
  35623. i.get("scale", !0) || (0 < e[0] && (e[0] = 0),
  35624. e[1] < 0 && (e[1] = 0))
  35625. }(t, n),
  35626. n
  35627. }(this, this._dimName, e),
  35628. function(n) {
  35629. var o = n._minMaxSpan = {}
  35630. , a = n._dataZoomModel
  35631. , r = n._dataExtent;
  35632. $A(["min", "max"], function(t) {
  35633. var e = a.get(t + "Span")
  35634. , i = a.get(t + "ValueSpan");
  35635. null != i && (i = n.getAxisModel().axis.scale.parse(i)),
  35636. null != i ? e = El(r[0] + i, r, [0, 100], !0) : null != e && (i = El(e, [0, 100], r, !0) - r[0]),
  35637. o[t + "Span"] = e,
  35638. o[t + "ValueSpan"] = i
  35639. })
  35640. }(this);
  35641. var i = this.calculateDataWindow(t.settledOption);
  35642. this._valueWindow = i.valueWindow,
  35643. this._percentWindow = i.percentWindow,
  35644. QA(this)
  35645. }
  35646. },
  35647. restore: function(t) {
  35648. t === this._dataZoomModel && (this._valueWindow = this._percentWindow = null,
  35649. QA(this, !0))
  35650. },
  35651. filterData: function(t, e) {
  35652. if (t === this._dataZoomModel) {
  35653. var n = this._dimName
  35654. , i = this.getTargetSeriesModels()
  35655. , o = t.get("filterMode")
  35656. , c = this._valueWindow;
  35657. "none" !== o && $A(i, function(i) {
  35658. var u = i.getData()
  35659. , h = u.mapDimension(n, !0);
  35660. h.length && ("weakFilter" === o ? u.filterSelf(function(t) {
  35661. for (var e, i, n, o = 0; o < h.length; o++) {
  35662. var a = u.get(h[o], t)
  35663. , r = !isNaN(a)
  35664. , s = a < c[0]
  35665. , l = a > c[1];
  35666. if (r && !s && !l)
  35667. return !0;
  35668. r && (n = !0),
  35669. s && (e = !0),
  35670. l && (i = !0)
  35671. }
  35672. return n && e && i
  35673. }) : $A(h, function(t) {
  35674. if ("empty" === o)
  35675. i.setData(u = u.map(t, function(t) {
  35676. return function(t) {
  35677. return t >= c[0] && t <= c[1]
  35678. }(t) ? t : NaN
  35679. }));
  35680. else {
  35681. var e = {};
  35682. e[t] = c,
  35683. u.selectRange(e)
  35684. }
  35685. }),
  35686. $A(h, function(t) {
  35687. u.setApproximateExtent(c, t)
  35688. }))
  35689. })
  35690. }
  35691. }
  35692. };
  35693. var tD = E
  35694. , eD = jA
  35695. , iD = Tf({
  35696. type: "dataZoom",
  35697. dependencies: ["xAxis", "yAxis", "zAxis", "radiusAxis", "angleAxis", "singleAxis", "series"],
  35698. defaultOption: {
  35699. zlevel: 0,
  35700. z: 4,
  35701. orient: null,
  35702. xAxisIndex: null,
  35703. yAxisIndex: null,
  35704. filterMode: "filter",
  35705. throttle: null,
  35706. start: 0,
  35707. end: 100,
  35708. startValue: null,
  35709. endValue: null,
  35710. minSpan: null,
  35711. maxSpan: null,
  35712. minValueSpan: null,
  35713. maxValueSpan: null,
  35714. rangeMode: null
  35715. },
  35716. init: function(t, e, i) {
  35717. this._dataIntervalByAxis = {},
  35718. this._dataInfo = {},
  35719. this._axisProxies = {},
  35720. this.textStyleModel,
  35721. this._autoThrottle = !0,
  35722. this._rangePropMode = ["percent", "percent"];
  35723. var n = nD(t);
  35724. this.settledOption = n,
  35725. this.mergeDefaultAndTheme(t, i),
  35726. this.doInit(n)
  35727. },
  35728. mergeOption: function(t) {
  35729. var e = nD(t);
  35730. m(this.option, t, !0),
  35731. m(this.settledOption, e, !0),
  35732. this.doInit(e)
  35733. },
  35734. doInit: function(t) {
  35735. var i = this.option;
  35736. v.canvasSupported || (i.realtime = !1),
  35737. this._setDefaultThrottle(t),
  35738. oD(this, t);
  35739. var n = this.settledOption;
  35740. tD([["start", "startValue"], ["end", "endValue"]], function(t, e) {
  35741. "value" === this._rangePropMode[e] && (i[t[0]] = n[t[0]] = null)
  35742. }, this),
  35743. this.textStyleModel = this.getModel("textStyle"),
  35744. this._resetTarget(),
  35745. this._giveAxisProxies()
  35746. },
  35747. _giveAxisProxies: function() {
  35748. var r = this._axisProxies;
  35749. this.eachTargetAxis(function(t, e, i, n) {
  35750. var o = this.dependentModels[t.axis][e]
  35751. , a = o.__dzAxisProxy || (o.__dzAxisProxy = new KA(t.name,e,this,n));
  35752. r[t.name + "_" + e] = a
  35753. }, this)
  35754. },
  35755. _resetTarget: function() {
  35756. var i = this.option
  35757. , t = this._judgeAutoMode();
  35758. eD(function(t) {
  35759. var e = t.axisIndex;
  35760. i[e] = Vo(i[e])
  35761. }, this),
  35762. "axisIndex" === t ? this._autoSetAxisIndex() : "orient" === t && this._autoSetOrient()
  35763. },
  35764. _judgeAutoMode: function() {
  35765. var e = this.option
  35766. , i = !1;
  35767. eD(function(t) {
  35768. null != e[t.axisIndex] && (i = !0)
  35769. }, this);
  35770. var t = e.orient;
  35771. return null == t && i ? "orient" : i ? void 0 : (null == t && (e.orient = "horizontal"),
  35772. "axisIndex")
  35773. },
  35774. _autoSetAxisIndex: function() {
  35775. var a = !0
  35776. , e = this.get("orient", !0)
  35777. , r = this.option
  35778. , t = this.dependentModels;
  35779. if (a) {
  35780. var i = "vertical" === e ? "y" : "x";
  35781. t[i + "Axis"].length ? (r[i + "AxisIndex"] = [0],
  35782. a = !1) : tD(t.singleAxis, function(t) {
  35783. a && t.get("orient", !0) === e && (r.singleAxisIndex = [t.componentIndex],
  35784. a = !1)
  35785. })
  35786. }
  35787. a && eD(function(t) {
  35788. if (a) {
  35789. var e = []
  35790. , i = this.dependentModels[t.axis];
  35791. if (i.length && !e.length)
  35792. for (var n = 0, o = i.length; n < o; n++)
  35793. "category" === i[n].get("type") && e.push(n);
  35794. (r[t.axisIndex] = e).length && (a = !1)
  35795. }
  35796. }, this),
  35797. a && this.ecModel.eachSeries(function(o) {
  35798. this._isSeriesHasAllAxesTypeOf(o, "value") && eD(function(t) {
  35799. var e = r[t.axisIndex]
  35800. , i = o.get(t.axisIndex)
  35801. , n = o.get(t.axisId);
  35802. _(e, i = o.ecModel.queryComponents({
  35803. mainType: t.axis,
  35804. index: i,
  35805. id: n
  35806. })[0].componentIndex) < 0 && e.push(i)
  35807. })
  35808. }, this)
  35809. },
  35810. _autoSetOrient: function() {
  35811. var e;
  35812. this.eachTargetAxis(function(t) {
  35813. e = e || t.name
  35814. }, this),
  35815. this.option.orient = "y" === e ? "vertical" : "horizontal"
  35816. },
  35817. _isSeriesHasAllAxesTypeOf: function(n, o) {
  35818. var a = !0;
  35819. return eD(function(t) {
  35820. var e = n.get(t.axisIndex)
  35821. , i = this.dependentModels[t.axis][e];
  35822. i && i.get("type") === o || (a = !1)
  35823. }, this),
  35824. a
  35825. },
  35826. _setDefaultThrottle: function(t) {
  35827. if (t.hasOwnProperty("throttle") && (this._autoThrottle = !1),
  35828. this._autoThrottle) {
  35829. var e = this.ecModel.option;
  35830. this.option.throttle = e.animation && 0 < e.animationDurationUpdate ? 100 : 20
  35831. }
  35832. },
  35833. getFirstTargetAxisModel: function() {
  35834. var i;
  35835. return eD(function(t) {
  35836. if (null == i) {
  35837. var e = this.get(t.axisIndex);
  35838. e.length && (i = this.dependentModels[t.axis][e[0]])
  35839. }
  35840. }, this),
  35841. i
  35842. },
  35843. eachTargetAxis: function(i, n) {
  35844. var o = this.ecModel;
  35845. eD(function(e) {
  35846. tD(this.get(e.axisIndex), function(t) {
  35847. i.call(n, e, t, this, o)
  35848. }, this)
  35849. }, this)
  35850. },
  35851. getAxisProxy: function(t, e) {
  35852. return this._axisProxies[t + "_" + e]
  35853. },
  35854. getAxisModel: function(t, e) {
  35855. var i = this.getAxisProxy(t, e);
  35856. return i && i.getAxisModel()
  35857. },
  35858. setRawRange: function(e) {
  35859. var i = this.option
  35860. , n = this.settledOption;
  35861. tD([["start", "startValue"], ["end", "endValue"]], function(t) {
  35862. null == e[t[0]] && null == e[t[1]] || (i[t[0]] = n[t[0]] = e[t[0]],
  35863. i[t[1]] = n[t[1]] = e[t[1]])
  35864. }, this),
  35865. oD(this, e)
  35866. },
  35867. setCalculatedRange: function(e) {
  35868. var i = this.option;
  35869. tD(["start", "startValue", "end", "endValue"], function(t) {
  35870. i[t] = e[t]
  35871. })
  35872. },
  35873. getPercentRange: function() {
  35874. var t = this.findRepresentativeAxisProxy();
  35875. if (t)
  35876. return t.getDataPercentWindow()
  35877. },
  35878. getValueRange: function(t, e) {
  35879. if (null != t || null != e)
  35880. return this.getAxisProxy(t, e).getDataValueWindow();
  35881. var i = this.findRepresentativeAxisProxy();
  35882. return i ? i.getDataValueWindow() : void 0
  35883. },
  35884. findRepresentativeAxisProxy: function(t) {
  35885. if (t)
  35886. return t.__dzAxisProxy;
  35887. var e = this._axisProxies;
  35888. for (var i in e)
  35889. if (e.hasOwnProperty(i) && e[i].hostedBy(this))
  35890. return e[i];
  35891. for (var i in e)
  35892. if (e.hasOwnProperty(i) && !e[i].hostedBy(this))
  35893. return e[i]
  35894. },
  35895. getRangePropMode: function() {
  35896. return this._rangePropMode.slice()
  35897. }
  35898. });
  35899. function nD(e) {
  35900. var i = {};
  35901. return tD(["start", "end", "startValue", "endValue", "throttle"], function(t) {
  35902. e.hasOwnProperty(t) && (i[t] = e[t])
  35903. }),
  35904. i
  35905. }
  35906. function oD(t, o) {
  35907. var a = t._rangePropMode
  35908. , r = t.get("rangeMode");
  35909. tD([["start", "startValue"], ["end", "endValue"]], function(t, e) {
  35910. var i = null != o[t[0]]
  35911. , n = null != o[t[1]];
  35912. i && !n ? a[e] = "percent" : !i && n ? a[e] = "value" : r ? a[e] = r[e] : i && (a[e] = "percent")
  35913. })
  35914. }
  35915. var aD = gc.extend({
  35916. type: "dataZoom",
  35917. render: function(t, e, i, n) {
  35918. this.dataZoomModel = t,
  35919. this.ecModel = e,
  35920. this.api = i
  35921. },
  35922. getTargetCoordInfo: function() {
  35923. var t = this.dataZoomModel
  35924. , o = this.ecModel
  35925. , a = {};
  35926. return t.eachTargetAxis(function(t, e) {
  35927. var i = o.getComponent(t.axis, e);
  35928. if (i) {
  35929. var n = i.getCoordSysModel();
  35930. n && function(t, e, i, n) {
  35931. for (var o, a = 0; a < i.length; a++)
  35932. if (i[a].model === t) {
  35933. o = i[a];
  35934. break
  35935. }
  35936. o || i.push(o = {
  35937. model: t,
  35938. axisModels: [],
  35939. coordIndex: n
  35940. });
  35941. o.axisModels.push(e)
  35942. }(n, i, a[n.mainType] || (a[n.mainType] = []), n.componentIndex)
  35943. }
  35944. }, this),
  35945. a
  35946. }
  35947. });
  35948. iD.extend({
  35949. type: "dataZoom.select"
  35950. }),
  35951. aD.extend({
  35952. type: "dataZoom.select"
  35953. }),
  35954. xf({
  35955. getTargetSeries: function(t) {
  35956. var n = Q();
  35957. return t.eachComponent("dataZoom", function(t) {
  35958. t.eachTargetAxis(function(t, e, i) {
  35959. E(i.getAxisProxy(t.name, e).getTargetSeriesModels(), function(t) {
  35960. n.set(t.uid, t)
  35961. })
  35962. })
  35963. }),
  35964. n
  35965. },
  35966. modifyOutputEnd: !0,
  35967. overallReset: function(t, n) {
  35968. t.eachComponent("dataZoom", function(t) {
  35969. t.eachTargetAxis(function(t, e, i) {
  35970. i.getAxisProxy(t.name, e).reset(i, n)
  35971. }),
  35972. t.eachTargetAxis(function(t, e, i) {
  35973. i.getAxisProxy(t.name, e).filterData(i, n)
  35974. })
  35975. }),
  35976. t.eachComponent("dataZoom", function(t) {
  35977. var e = t.findRepresentativeAxisProxy()
  35978. , i = e.getDataPercentWindow()
  35979. , n = e.getDataValueWindow();
  35980. t.setCalculatedRange({
  35981. start: i[0],
  35982. end: i[1],
  35983. startValue: n[0],
  35984. endValue: n[1]
  35985. })
  35986. })
  35987. }
  35988. }),
  35989. _f("dataZoom", function(i, t) {
  35990. var n = qA(A(t.eachComponent, t, "dataZoom"), jA, function(t, e) {
  35991. return t.get(e.axisIndex)
  35992. })
  35993. , o = [];
  35994. t.eachComponent({
  35995. mainType: "dataZoom",
  35996. query: i
  35997. }, function(t, e) {
  35998. o.push.apply(o, n(t).nodes)
  35999. }),
  36000. E(o, function(t, e) {
  36001. t.setRawRange({
  36002. start: i.start,
  36003. end: i.end,
  36004. startValue: i.startValue,
  36005. endValue: i.endValue
  36006. })
  36007. })
  36008. });
  36009. var rD = Oc.toolbox.dataZoom
  36010. , sD = E;
  36011. function lD(t, e, i) {
  36012. (this._brushController = new Ib(i.getZr())).on("brush", A(this._onBrush, this)).mount(),
  36013. this._isZoomActive
  36014. }
  36015. lD.defaultOption = {
  36016. show: !0,
  36017. filterMode: "filter",
  36018. icon: {
  36019. zoom: "M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",
  36020. back: "M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"
  36021. },
  36022. title: k(rD.title)
  36023. };
  36024. var uD = lD.prototype;
  36025. uD.render = function(t, e, i, n) {
  36026. this.model = t,
  36027. this.ecModel = e,
  36028. this.api = i,
  36029. function(t, e, i, n, o) {
  36030. var a = i._isZoomActive;
  36031. n && "takeGlobalCursor" === n.type && (a = "dataZoomSelect" === n.key && n.dataZoomSelectActive);
  36032. i._isZoomActive = a,
  36033. t.setIconStatus("zoom", a ? "emphasis" : "normal");
  36034. var r = new DA(cD(t.option),e,{
  36035. include: ["grid"]
  36036. });
  36037. i._brushController.setPanels(r.makePanelOpts(o, function(t) {
  36038. return t.xAxisDeclared && !t.yAxisDeclared ? "lineX" : !t.xAxisDeclared && t.yAxisDeclared ? "lineY" : "rect"
  36039. })).enableBrush(!!a && {
  36040. brushType: "auto",
  36041. brushStyle: {
  36042. lineWidth: 0,
  36043. fill: "rgba(0,0,0,0.2)"
  36044. }
  36045. })
  36046. }(t, e, this, n, i),
  36047. function(t, e) {
  36048. t.setIconStatus("back", 1 < function(t) {
  36049. return WA(t).length
  36050. }(e) ? "emphasis" : "normal")
  36051. }(t, e)
  36052. }
  36053. ,
  36054. uD.onclick = function(t, e, i) {
  36055. hD[i].call(this)
  36056. }
  36057. ,
  36058. uD.remove = function(t, e) {
  36059. this._brushController.unmount()
  36060. }
  36061. ,
  36062. uD.dispose = function(t, e) {
  36063. this._brushController.dispose()
  36064. }
  36065. ;
  36066. var hD = {
  36067. zoom: function() {
  36068. var t = !this._isZoomActive;
  36069. this.api.dispatchAction({
  36070. type: "takeGlobalCursor",
  36071. key: "dataZoomSelect",
  36072. dataZoomSelectActive: t
  36073. })
  36074. },
  36075. back: function() {
  36076. this._dispatchZoomAction(function(t) {
  36077. var n = WA(t)
  36078. , e = n[n.length - 1];
  36079. 1 < n.length && n.pop();
  36080. var o = {};
  36081. return GA(e, function(t, e) {
  36082. for (var i = n.length - 1; 0 <= i; i--) {
  36083. if (t = n[i][e]) {
  36084. o[e] = t;
  36085. break
  36086. }
  36087. }
  36088. }),
  36089. o
  36090. }(this.ecModel))
  36091. }
  36092. };
  36093. function cD(e) {
  36094. var i = {};
  36095. return E(["xAxisIndex", "yAxisIndex"], function(t) {
  36096. i[t] = e[t],
  36097. null == i[t] && (i[t] = "all"),
  36098. !1 !== i[t] && "none" !== i[t] || (i[t] = [])
  36099. }),
  36100. i
  36101. }
  36102. uD._onBrush = function(t, e) {
  36103. if (e.isEnd && t.length) {
  36104. var s = {}
  36105. , l = this.ecModel;
  36106. this._brushController.updateCovers([]),
  36107. new DA(cD(this.model.option),l,{
  36108. include: ["grid"]
  36109. }).matchOutputRanges(t, l, function(t, e, i) {
  36110. if ("cartesian2d" === i.type) {
  36111. var n = t.brushType;
  36112. "rect" === n ? (o("x", i, e[0]),
  36113. o("y", i, e[1])) : o({
  36114. lineX: "x",
  36115. lineY: "y"
  36116. }[n], i, e)
  36117. }
  36118. }),
  36119. function(a, t) {
  36120. var r = WA(a);
  36121. GA(t, function(t, e) {
  36122. for (var i = r.length - 1; 0 <= i; i--) {
  36123. if (r[i][e])
  36124. break
  36125. }
  36126. if (i < 0) {
  36127. var n = a.queryComponents({
  36128. mainType: "dataZoom",
  36129. subType: "select",
  36130. id: e
  36131. })[0];
  36132. if (n) {
  36133. var o = n.getPercentRange();
  36134. r[0][e] = {
  36135. dataZoomId: e,
  36136. start: o[0],
  36137. end: o[1]
  36138. }
  36139. }
  36140. }
  36141. }),
  36142. r.push(t)
  36143. }(l, s),
  36144. this._dispatchZoomAction(s)
  36145. }
  36146. function o(t, e, i) {
  36147. var n = e.getAxis(t)
  36148. , o = n.model
  36149. , a = function(e, i, t) {
  36150. var n;
  36151. return t.eachComponent({
  36152. mainType: "dataZoom",
  36153. subType: "select"
  36154. }, function(t) {
  36155. t.getAxisModel(e, i.componentIndex) && (n = t)
  36156. }),
  36157. n
  36158. }(t, o, l)
  36159. , r = a.findRepresentativeAxisProxy(o).getMinMaxSpan();
  36160. null == r.minValueSpan && null == r.maxValueSpan || (i = Jw(0, i.slice(), n.scale.getExtent(), 0, r.minValueSpan, r.maxValueSpan)),
  36161. a && (s[a.id] = {
  36162. dataZoomId: a.id,
  36163. startValue: i[0],
  36164. endValue: i[1]
  36165. })
  36166. }
  36167. }
  36168. ,
  36169. uD._dispatchZoomAction = function(t) {
  36170. var i = [];
  36171. sD(t, function(t, e) {
  36172. i.push(k(t))
  36173. }),
  36174. i.length && this.api.dispatchAction({
  36175. type: "dataZoom",
  36176. from: this.uid,
  36177. batch: i
  36178. })
  36179. }
  36180. ,
  36181. nA("dataZoom", lD),
  36182. yf(function(s) {
  36183. if (s) {
  36184. var l = s.dataZoom || (s.dataZoom = []);
  36185. L(l) || (s.dataZoom = l = [l]);
  36186. var t = s.toolbox;
  36187. if (t && (L(t) && (t = t[0]),
  36188. t && t.feature)) {
  36189. var e = t.feature.dataZoom;
  36190. i("xAxis", e),
  36191. i("yAxis", e)
  36192. }
  36193. }
  36194. function i(n, o) {
  36195. if (o) {
  36196. var a = n + "Index"
  36197. , r = o[a];
  36198. null == r || "all" === r || L(r) || (r = !1 === r || "none" === r ? [] : [r]),
  36199. function(t, e) {
  36200. var i = s[t];
  36201. L(i) || (i = i ? [i] : []);
  36202. sD(i, e)
  36203. }(n, function(t, e) {
  36204. if (null == r || "all" === r || -1 !== _(r, e)) {
  36205. var i = {
  36206. type: "select",
  36207. $fromToolbox: !0,
  36208. filterMode: o.filterMode || "filter",
  36209. id: "\0_ec_\0toolbox-dataZoom_" + n + e
  36210. };
  36211. i[a] = e,
  36212. l.push(i)
  36213. }
  36214. })
  36215. }
  36216. }
  36217. });
  36218. var dD = Oc.toolbox.restore;
  36219. function fD(t) {
  36220. this.model = t
  36221. }
  36222. fD.defaultOption = {
  36223. show: !0,
  36224. icon: "M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",
  36225. title: dD.title
  36226. },
  36227. fD.prototype.onclick = function(t, e, i) {
  36228. !function(t) {
  36229. t[FA] = null
  36230. }(t),
  36231. e.dispatchAction({
  36232. type: "restore",
  36233. from: this.uid
  36234. })
  36235. }
  36236. ,
  36237. nA("restore", fD),
  36238. _f({
  36239. type: "restore",
  36240. event: "restore",
  36241. update: "prepareAndUpdate"
  36242. }, function(t, e) {
  36243. e.resetOption("recreate")
  36244. }),
  36245. Tf({
  36246. type: "tooltip",
  36247. dependencies: ["axisPointer"],
  36248. defaultOption: {
  36249. zlevel: 0,
  36250. z: 60,
  36251. show: !0,
  36252. showContent: !0,
  36253. trigger: "item",
  36254. triggerOn: "mousemove|click",
  36255. alwaysShowContent: !1,
  36256. displayMode: "single",
  36257. renderMode: "auto",
  36258. confine: !1,
  36259. showDelay: 0,
  36260. hideDelay: 100,
  36261. transitionDuration: .4,
  36262. enterable: !1,
  36263. backgroundColor: "rgba(50,50,50,0.7)",
  36264. borderColor: "#333",
  36265. borderRadius: 4,
  36266. borderWidth: 0,
  36267. padding: 5,
  36268. extraCssText: "",
  36269. axisPointer: {
  36270. type: "line",
  36271. axis: "auto",
  36272. animation: "auto",
  36273. animationDurationUpdate: 200,
  36274. animationEasingUpdate: "exponentialOut",
  36275. crossStyle: {
  36276. color: "#999",
  36277. width: 1,
  36278. type: "dashed",
  36279. textStyle: {}
  36280. }
  36281. },
  36282. textStyle: {
  36283. color: "#fff",
  36284. fontSize: 14
  36285. }
  36286. }
  36287. });
  36288. var pD = E
  36289. , gD = eu
  36290. , mD = ["", "-webkit-", "-moz-", "-o-"];
  36291. function vD(o) {
  36292. var a = []
  36293. , t = o.get("transitionDuration")
  36294. , e = o.get("backgroundColor")
  36295. , i = o.getModel("textStyle")
  36296. , n = o.get("padding");
  36297. return t && a.push(function(t) {
  36298. var e = "cubic-bezier(0.23, 1, 0.32, 1)"
  36299. , i = "left " + t + "s " + e + ",top " + t + "s " + e;
  36300. return O(mD, function(t) {
  36301. return t + "transition:" + i
  36302. }).join(";")
  36303. }(t)),
  36304. e && (v.canvasSupported ? a.push("background-Color:" + e) : (a.push("background-Color:#" + Ze(e)),
  36305. a.push("filter:alpha(opacity=70)"))),
  36306. pD(["width", "color", "radius"], function(t) {
  36307. var e = "border-" + t
  36308. , i = gD(e)
  36309. , n = o.get(i);
  36310. null != n && a.push(e + ":" + n + ("color" === t ? "" : "px"))
  36311. }),
  36312. a.push(function(i) {
  36313. var n = []
  36314. , t = i.get("fontSize")
  36315. , e = i.getTextColor();
  36316. return e && n.push("color:" + e),
  36317. n.push("font:" + i.getFont()),
  36318. t && n.push("line-height:" + Math.round(3 * t / 2) + "px"),
  36319. pD(["decoration", "align"], function(t) {
  36320. var e = i.get(t);
  36321. e && n.push("text-" + t + ":" + e)
  36322. }),
  36323. n.join(";")
  36324. }(i)),
  36325. null != n && a.push("padding:" + iu(n).join("px ") + "px"),
  36326. a.join(";") + ";"
  36327. }
  36328. function yD(t, e, i, n, o) {
  36329. var a = e && e.painter;
  36330. if (i) {
  36331. var r = a && a.getViewportRoot();
  36332. r && function(t, e, i, n, o) {
  36333. Rt(Et, e, n, o, !0) && Rt(t, i, Et[0], Et[1])
  36334. }(t, r, document.body, n, o)
  36335. } else {
  36336. t[0] = n,
  36337. t[1] = o;
  36338. var s = a && a.getViewportRootOffset();
  36339. s && (t[0] += s.offsetLeft,
  36340. t[1] += s.offsetTop)
  36341. }
  36342. }
  36343. function xD(t, e, i) {
  36344. if (v.wxa)
  36345. return null;
  36346. var n = document.createElement("div");
  36347. n.domBelongToZr = !0,
  36348. this.el = n;
  36349. var o = this._zr = e.getZr()
  36350. , a = this._appendToBody = i && i.appendToBody;
  36351. this._styleCoord = [0, 0],
  36352. yD(this._styleCoord, o, a, e.getWidth() / 2, e.getHeight() / 2),
  36353. a ? document.body.appendChild(n) : t.appendChild(n),
  36354. this._container = t,
  36355. this._show = !1,
  36356. this._hideTimeout;
  36357. var r = this;
  36358. n.onmouseenter = function() {
  36359. r._enterable && (clearTimeout(r._hideTimeout),
  36360. r._show = !0),
  36361. r._inContent = !0
  36362. }
  36363. ,
  36364. n.onmousemove = function(t) {
  36365. if (t = t || window.event,
  36366. !r._enterable) {
  36367. var e = o.handler;
  36368. Zt(o.painter.getViewportRoot(), t, !0),
  36369. e.dispatch("mousemove", t)
  36370. }
  36371. }
  36372. ,
  36373. n.onmouseleave = function() {
  36374. r._enterable && r._show && r.hideLater(r._hideDelay),
  36375. r._inContent = !1
  36376. }
  36377. }
  36378. function _D(t) {
  36379. this._zr = t.getZr(),
  36380. this._show = !1,
  36381. this._hideTimeout
  36382. }
  36383. xD.prototype = {
  36384. constructor: xD,
  36385. _enterable: !0,
  36386. update: function() {
  36387. var t = this._container
  36388. , e = t.currentStyle || document.defaultView.getComputedStyle(t)
  36389. , i = t.style;
  36390. "absolute" !== i.position && "absolute" !== e.position && (i.position = "relative")
  36391. },
  36392. show: function(t) {
  36393. clearTimeout(this._hideTimeout);
  36394. var e = this.el
  36395. , i = this._styleCoord;
  36396. e.style.cssText = "position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;" + vD(t) + ";left:" + i[0] + "px;top:" + i[1] + "px;" + (t.get("extraCssText") || ""),
  36397. e.style.display = e.innerHTML ? "block" : "none",
  36398. e.style.pointerEvents = this._enterable ? "auto" : "none",
  36399. this._show = !0
  36400. },
  36401. setContent: function(t) {
  36402. this.el.innerHTML = null == t ? "" : t
  36403. },
  36404. setEnterable: function(t) {
  36405. this._enterable = t
  36406. },
  36407. getSize: function() {
  36408. var t = this.el;
  36409. return [t.clientWidth, t.clientHeight]
  36410. },
  36411. moveTo: function(t, e) {
  36412. var i = this._styleCoord;
  36413. yD(i, this._zr, this._appendToBody, t, e);
  36414. var n = this.el.style;
  36415. n.left = i[0] + "px",
  36416. n.top = i[1] + "px"
  36417. },
  36418. hide: function() {
  36419. this.el.style.display = "none",
  36420. this._show = !1
  36421. },
  36422. hideLater: function(t) {
  36423. !this._show || this._inContent && this._enterable || (t ? (this._hideDelay = t,
  36424. this._show = !1,
  36425. this._hideTimeout = setTimeout(A(this.hide, this), t)) : this.hide())
  36426. },
  36427. isShow: function() {
  36428. return this._show
  36429. },
  36430. dispose: function() {
  36431. this.el.parentNode.removeChild(this.el)
  36432. },
  36433. getOuterSize: function() {
  36434. var t = this.el.clientWidth
  36435. , e = this.el.clientHeight;
  36436. if (document.defaultView && document.defaultView.getComputedStyle) {
  36437. var i = document.defaultView.getComputedStyle(this.el);
  36438. i && (t += parseInt(i.borderLeftWidth, 10) + parseInt(i.borderRightWidth, 10),
  36439. e += parseInt(i.borderTopWidth, 10) + parseInt(i.borderBottomWidth, 10))
  36440. }
  36441. return {
  36442. width: t,
  36443. height: e
  36444. }
  36445. }
  36446. },
  36447. _D.prototype = {
  36448. constructor: _D,
  36449. _enterable: !0,
  36450. update: function() {},
  36451. show: function(t) {
  36452. this._hideTimeout && clearTimeout(this._hideTimeout),
  36453. this.el.attr("show", !0),
  36454. this._show = !0
  36455. },
  36456. setContent: function(t, e, i) {
  36457. this.el && this._zr.remove(this.el);
  36458. for (var n = {}, o = t, a = "{marker", r = o.indexOf(a); 0 <= r; ) {
  36459. var s = o.indexOf("|}")
  36460. , l = o.substr(r + a.length, s - r - a.length);
  36461. -1 < l.indexOf("sub") ? n["marker" + l] = {
  36462. textWidth: 4,
  36463. textHeight: 4,
  36464. textBorderRadius: 2,
  36465. textBackgroundColor: e[l],
  36466. textOffset: [3, 0]
  36467. } : n["marker" + l] = {
  36468. textWidth: 10,
  36469. textHeight: 10,
  36470. textBorderRadius: 5,
  36471. textBackgroundColor: e[l]
  36472. },
  36473. r = (o = o.substr(s + 1)).indexOf("{marker")
  36474. }
  36475. this.el = new Ur({
  36476. style: {
  36477. rich: n,
  36478. text: t,
  36479. textLineHeight: 20,
  36480. textBackgroundColor: i.get("backgroundColor"),
  36481. textBorderRadius: i.get("borderRadius"),
  36482. textFill: i.get("textStyle.color"),
  36483. textPadding: i.get("padding")
  36484. },
  36485. z: i.get("z")
  36486. }),
  36487. this._zr.add(this.el);
  36488. var u = this;
  36489. this.el.on("mouseover", function() {
  36490. u._enterable && (clearTimeout(u._hideTimeout),
  36491. u._show = !0),
  36492. u._inContent = !0
  36493. }),
  36494. this.el.on("mouseout", function() {
  36495. u._enterable && u._show && u.hideLater(u._hideDelay),
  36496. u._inContent = !1
  36497. })
  36498. },
  36499. setEnterable: function(t) {
  36500. this._enterable = t
  36501. },
  36502. getSize: function() {
  36503. var t = this.el.getBoundingRect();
  36504. return [t.width, t.height]
  36505. },
  36506. moveTo: function(t, e) {
  36507. this.el && this.el.attr("position", [t, e])
  36508. },
  36509. hide: function() {
  36510. this.el && this.el.hide(),
  36511. this._show = !1
  36512. },
  36513. hideLater: function(t) {
  36514. !this._show || this._inContent && this._enterable || (t ? (this._hideDelay = t,
  36515. this._show = !1,
  36516. this._hideTimeout = setTimeout(A(this.hide, this), t)) : this.hide())
  36517. },
  36518. isShow: function() {
  36519. return this._show
  36520. },
  36521. getOuterSize: function() {
  36522. var t = this.getSize();
  36523. return {
  36524. width: t[0],
  36525. height: t[1]
  36526. }
  36527. }
  36528. };
  36529. var wD = A
  36530. , bD = E
  36531. , SD = Rl
  36532. , MD = new rs({
  36533. shape: {
  36534. x: -1,
  36535. y: -1,
  36536. width: 2,
  36537. height: 2
  36538. }
  36539. });
  36540. function ID(t) {
  36541. for (var e = t.pop(); t.length; ) {
  36542. var i = t.pop();
  36543. i && (Cl.isInstance(i) && (i = i.get("tooltip", !0)),
  36544. "string" == typeof i && (i = {
  36545. formatter: i
  36546. }),
  36547. e = new Cl(i,e,e.ecModel))
  36548. }
  36549. return e
  36550. }
  36551. function TD(t, e) {
  36552. return t.dispatchAction || A(e.dispatchAction, e)
  36553. }
  36554. function AD(t) {
  36555. return "center" === t || "middle" === t
  36556. }
  36557. Af({
  36558. type: "tooltip",
  36559. init: function(t, e) {
  36560. if (!v.node) {
  36561. var i, n = t.getComponent("tooltip"), o = n.get("renderMode");
  36562. this._renderMode = Qo(o),
  36563. "html" === this._renderMode ? (i = new xD(e.getDom(),e,{
  36564. appendToBody: n.get("appendToBody", !0)
  36565. }),
  36566. this._newLine = "<br/>") : (i = new _D(e),
  36567. this._newLine = "\n"),
  36568. this._tooltipContent = i
  36569. }
  36570. },
  36571. render: function(t, e, i) {
  36572. if (!v.node) {
  36573. this.group.removeAll(),
  36574. this._tooltipModel = t,
  36575. this._ecModel = e,
  36576. this._api = i,
  36577. this._lastDataByCoordSys = null,
  36578. this._alwaysShowContent = t.get("alwaysShowContent");
  36579. var n = this._tooltipContent;
  36580. n.update(),
  36581. n.setEnterable(t.get("enterable")),
  36582. this._initGlobalListener(),
  36583. this._keepShow()
  36584. }
  36585. },
  36586. _initGlobalListener: function() {
  36587. var n = this._tooltipModel.get("triggerOn");
  36588. fI("itemTooltip", this._api, wD(function(t, e, i) {
  36589. "none" !== n && (0 <= n.indexOf(t) ? this._tryShow(e, i) : "leave" === t && this._hide(i))
  36590. }, this))
  36591. },
  36592. _keepShow: function() {
  36593. var t = this._tooltipModel
  36594. , e = this._ecModel
  36595. , i = this._api;
  36596. if (null != this._lastX && null != this._lastY && "none" !== t.get("triggerOn")) {
  36597. var n = this;
  36598. clearTimeout(this._refreshUpdateTimeout),
  36599. this._refreshUpdateTimeout = setTimeout(function() {
  36600. i.isDisposed() || n.manuallyShowTip(t, e, i, {
  36601. x: n._lastX,
  36602. y: n._lastY
  36603. })
  36604. })
  36605. }
  36606. },
  36607. manuallyShowTip: function(t, e, i, n) {
  36608. if (n.from !== this.uid && !v.node) {
  36609. var o = TD(n, i);
  36610. this._ticket = "";
  36611. var a = n.dataByCoordSys;
  36612. if (n.tooltip && null != n.x && null != n.y) {
  36613. var r = MD;
  36614. r.position = [n.x, n.y],
  36615. r.update(),
  36616. r.tooltip = n.tooltip,
  36617. this._tryShow({
  36618. offsetX: n.x,
  36619. offsetY: n.y,
  36620. target: r
  36621. }, o)
  36622. } else if (a)
  36623. this._tryShow({
  36624. offsetX: n.x,
  36625. offsetY: n.y,
  36626. position: n.position,
  36627. dataByCoordSys: n.dataByCoordSys,
  36628. tooltipOption: n.tooltipOption
  36629. }, o);
  36630. else if (null != n.seriesIndex) {
  36631. if (this._manuallyAxisShowTip(t, e, i, n))
  36632. return;
  36633. var s = iI(n, e)
  36634. , l = s.point[0]
  36635. , u = s.point[1];
  36636. null != l && null != u && this._tryShow({
  36637. offsetX: l,
  36638. offsetY: u,
  36639. position: n.position,
  36640. target: s.el
  36641. }, o)
  36642. } else
  36643. null != n.x && null != n.y && (i.dispatchAction({
  36644. type: "updateAxisPointer",
  36645. x: n.x,
  36646. y: n.y
  36647. }),
  36648. this._tryShow({
  36649. offsetX: n.x,
  36650. offsetY: n.y,
  36651. position: n.position,
  36652. target: i.getZr().findHover(n.x, n.y).target
  36653. }, o))
  36654. }
  36655. },
  36656. manuallyHideTip: function(t, e, i, n) {
  36657. var o = this._tooltipContent;
  36658. !this._alwaysShowContent && this._tooltipModel && o.hideLater(this._tooltipModel.get("hideDelay")),
  36659. this._lastX = this._lastY = null,
  36660. n.from !== this.uid && this._hide(TD(n, i))
  36661. },
  36662. _manuallyAxisShowTip: function(t, e, i, n) {
  36663. var o = n.seriesIndex
  36664. , a = n.dataIndex
  36665. , r = e.getComponent("axisPointer").coordSysAxesInfo;
  36666. if (null != o && null != a && null != r) {
  36667. var s = e.getSeriesByIndex(o);
  36668. if (s)
  36669. if ("axis" === (t = ID([s.getData().getItemModel(a), s, (s.coordinateSystem || {}).model, t])).get("trigger"))
  36670. return i.dispatchAction({
  36671. type: "updateAxisPointer",
  36672. seriesIndex: o,
  36673. dataIndex: a,
  36674. position: n.position
  36675. }),
  36676. !0
  36677. }
  36678. },
  36679. _tryShow: function(t, e) {
  36680. var i = t.target;
  36681. if (this._tooltipModel) {
  36682. this._lastX = t.offsetX,
  36683. this._lastY = t.offsetY;
  36684. var n = t.dataByCoordSys;
  36685. n && n.length ? this._showAxisTooltip(n, t) : i && null != i.dataIndex ? (this._lastDataByCoordSys = null,
  36686. this._showSeriesItemTooltip(t, i, e)) : i && i.tooltip ? (this._lastDataByCoordSys = null,
  36687. this._showComponentItemTooltip(t, i, e)) : (this._lastDataByCoordSys = null,
  36688. this._hide(e))
  36689. }
  36690. },
  36691. _showOrMove: function(t, e) {
  36692. var i = t.get("showDelay");
  36693. e = A(e, this),
  36694. clearTimeout(this._showTimout),
  36695. 0 < i ? this._showTimout = setTimeout(e, i) : e()
  36696. },
  36697. _showAxisTooltip: function(t, e) {
  36698. var d = this._ecModel
  36699. , i = this._tooltipModel
  36700. , n = [e.offsetX, e.offsetY]
  36701. , o = []
  36702. , f = []
  36703. , a = ID([e.tooltipOption, i])
  36704. , p = this._renderMode
  36705. , r = this._newLine
  36706. , g = {};
  36707. bD(t, function(t) {
  36708. bD(t.dataByAxis, function(s) {
  36709. var l = d.getComponent(s.axisDim + "Axis", s.axisIndex)
  36710. , u = s.value
  36711. , h = [];
  36712. if (l && null != u) {
  36713. var c = DI(u, l.axis, d, s.seriesDataIndices, s.valueLabelOpt);
  36714. E(s.seriesDataIndices, function(t) {
  36715. var e = d.getSeriesByIndex(t.seriesIndex)
  36716. , i = t.dataIndexInside
  36717. , n = e && e.getDataParams(i);
  36718. if (n.axisDim = s.axisDim,
  36719. n.axisIndex = s.axisIndex,
  36720. n.axisType = s.axisType,
  36721. n.axisId = s.axisId,
  36722. n.axisValue = ug(l.axis, u),
  36723. n.axisValueLabel = c,
  36724. n) {
  36725. f.push(n);
  36726. var o, a = e.formatTooltip(i, !0, null, p);
  36727. if (z(a)) {
  36728. o = a.html;
  36729. var r = a.markers;
  36730. m(g, r)
  36731. } else
  36732. o = a;
  36733. h.push(o)
  36734. }
  36735. });
  36736. var t = c;
  36737. "html" !== p ? o.push(h.join(r)) : o.push((t ? au(t) + r : "") + h.join(r))
  36738. }
  36739. })
  36740. }, this),
  36741. o.reverse(),
  36742. o = o.join(this._newLine + this._newLine);
  36743. var s = e.position;
  36744. this._showOrMove(a, function() {
  36745. this._updateContentNotChangedOnAxis(t) ? this._updatePosition(a, s, n[0], n[1], this._tooltipContent, f) : this._showTooltipContent(a, o, f, Math.random(), n[0], n[1], s, void 0, g)
  36746. })
  36747. },
  36748. _showSeriesItemTooltip: function(t, e, i) {
  36749. var n = this._ecModel
  36750. , o = e.seriesIndex
  36751. , a = n.getSeriesByIndex(o)
  36752. , r = e.dataModel || a
  36753. , s = e.dataIndex
  36754. , l = e.dataType
  36755. , u = r.getData(l)
  36756. , h = ID([u.getItemModel(s), r, a && (a.coordinateSystem || {}).model, this._tooltipModel])
  36757. , c = h.get("trigger");
  36758. if (null == c || "item" === c) {
  36759. var d, f, p = r.getDataParams(s, l), g = r.formatTooltip(s, !1, l, this._renderMode);
  36760. f = z(g) ? (d = g.html,
  36761. g.markers) : (d = g,
  36762. null);
  36763. var m = "item_" + r.name + "_" + s;
  36764. this._showOrMove(h, function() {
  36765. this._showTooltipContent(h, d, p, m, t.offsetX, t.offsetY, t.position, t.target, f)
  36766. }),
  36767. i({
  36768. type: "showTip",
  36769. dataIndexInside: s,
  36770. dataIndex: u.getRawIndex(s),
  36771. seriesIndex: o,
  36772. from: this.uid
  36773. })
  36774. }
  36775. },
  36776. _showComponentItemTooltip: function(t, e, i) {
  36777. var n = e.tooltip;
  36778. if ("string" == typeof n) {
  36779. n = {
  36780. content: n,
  36781. formatter: n
  36782. }
  36783. }
  36784. var o = new Cl(n,this._tooltipModel,this._ecModel)
  36785. , a = o.get("content")
  36786. , r = Math.random();
  36787. this._showOrMove(o, function() {
  36788. this._showTooltipContent(o, a, o.get("formatterParams") || {}, r, t.offsetX, t.offsetY, t.position, e)
  36789. }),
  36790. i({
  36791. type: "showTip",
  36792. from: this.uid
  36793. })
  36794. },
  36795. _showTooltipContent: function(i, t, n, e, o, a, r, s, l) {
  36796. if (this._ticket = "",
  36797. i.get("showContent") && i.get("show")) {
  36798. var u = this._tooltipContent
  36799. , h = i.get("formatter");
  36800. r = r || i.get("position");
  36801. var c = t;
  36802. if (h && "string" == typeof h)
  36803. c = lu(h, n, !0);
  36804. else if ("function" == typeof h) {
  36805. var d = wD(function(t, e) {
  36806. t === this._ticket && (u.setContent(e, l, i),
  36807. this._updatePosition(i, r, o, a, u, n, s))
  36808. }, this);
  36809. this._ticket = e,
  36810. c = h(n, e, d)
  36811. }
  36812. u.setContent(c, l, i),
  36813. u.show(i),
  36814. this._updatePosition(i, r, o, a, u, n, s)
  36815. }
  36816. },
  36817. _updatePosition: function(t, e, i, n, o, a, r) {
  36818. var s = this._api.getWidth()
  36819. , l = this._api.getHeight();
  36820. e = e || t.get("position");
  36821. var u = o.getSize()
  36822. , h = t.get("align")
  36823. , c = t.get("verticalAlign")
  36824. , d = r && r.getBoundingRect().clone();
  36825. if (r && d.applyTransform(r.transform),
  36826. "function" == typeof e && (e = e([i, n], a, o.el, d, {
  36827. viewSize: [s, l],
  36828. contentSize: u.slice()
  36829. })),
  36830. L(e))
  36831. i = SD(e[0], s),
  36832. n = SD(e[1], l);
  36833. else if (z(e)) {
  36834. e.width = u[0],
  36835. e.height = u[1];
  36836. var f = bu(e, {
  36837. width: s,
  36838. height: l
  36839. });
  36840. i = f.x,
  36841. n = f.y,
  36842. c = h = null
  36843. } else if ("string" == typeof e && r) {
  36844. i = (p = function(t, e, i) {
  36845. var n = i[0]
  36846. , o = i[1]
  36847. , a = 0
  36848. , r = 0
  36849. , s = e.width
  36850. , l = e.height;
  36851. switch (t) {
  36852. case "inside":
  36853. a = e.x + s / 2 - n / 2,
  36854. r = e.y + l / 2 - o / 2;
  36855. break;
  36856. case "top":
  36857. a = e.x + s / 2 - n / 2,
  36858. r = e.y - o - 5;
  36859. break;
  36860. case "bottom":
  36861. a = e.x + s / 2 - n / 2,
  36862. r = e.y + l + 5;
  36863. break;
  36864. case "left":
  36865. a = e.x - n - 5,
  36866. r = e.y + l / 2 - o / 2;
  36867. break;
  36868. case "right":
  36869. a = e.x + s + 5,
  36870. r = e.y + l / 2 - o / 2
  36871. }
  36872. return [a, r]
  36873. }(e, d, u))[0],
  36874. n = p[1]
  36875. } else {
  36876. var p;
  36877. i = (p = function(t, e, i, n, o, a, r) {
  36878. var s = i.getOuterSize()
  36879. , l = s.width
  36880. , u = s.height;
  36881. null != a && (n < t + l + a ? t -= l + a : t += a);
  36882. null != r && (o < e + u + r ? e -= u + r : e += r);
  36883. return [t, e]
  36884. }(i, n, o, s, l, h ? null : 20, c ? null : 20))[0],
  36885. n = p[1]
  36886. }
  36887. h && (i -= AD(h) ? u[0] / 2 : "right" === h ? u[0] : 0),
  36888. c && (n -= AD(c) ? u[1] / 2 : "bottom" === c ? u[1] : 0),
  36889. t.get("confine") && (i = (p = function(t, e, i, n, o) {
  36890. var a = i.getOuterSize()
  36891. , r = a.width
  36892. , s = a.height;
  36893. return t = Math.min(t + r, n) - r,
  36894. e = Math.min(e + s, o) - s,
  36895. t = Math.max(t, 0),
  36896. e = Math.max(e, 0),
  36897. [t, e]
  36898. }(i, n, o, s, l))[0],
  36899. n = p[1]);
  36900. o.moveTo(i, n)
  36901. },
  36902. _updateContentNotChangedOnAxis: function(n) {
  36903. var t = this._lastDataByCoordSys
  36904. , r = !!t && t.length === n.length;
  36905. return r && bD(t, function(t, e) {
  36906. var i = t.dataByAxis || {}
  36907. , a = (n[e] || {}).dataByAxis || [];
  36908. (r &= i.length === a.length) && bD(i, function(t, e) {
  36909. var i = a[e] || {}
  36910. , n = t.seriesDataIndices || []
  36911. , o = i.seriesDataIndices || [];
  36912. (r &= t.value === i.value && t.axisType === i.axisType && t.axisId === i.axisId && n.length === o.length) && bD(n, function(t, e) {
  36913. var i = o[e];
  36914. r &= t.seriesIndex === i.seriesIndex && t.dataIndex === i.dataIndex
  36915. })
  36916. })
  36917. }),
  36918. this._lastDataByCoordSys = n,
  36919. !!r
  36920. },
  36921. _hide: function(t) {
  36922. this._lastDataByCoordSys = null,
  36923. t({
  36924. type: "hideTip",
  36925. from: this.uid
  36926. })
  36927. },
  36928. dispose: function(t, e) {
  36929. v.node || (this._tooltipContent.dispose(),
  36930. mI("itemTooltip", e))
  36931. }
  36932. }),
  36933. _f({
  36934. type: "showTip",
  36935. event: "showTip",
  36936. update: "tooltip:manuallyShowTip"
  36937. }, function() {}),
  36938. _f({
  36939. type: "hideTip",
  36940. event: "hideTip",
  36941. update: "tooltip:manuallyHideTip"
  36942. }, function() {});
  36943. var DD = ["rect", "polygon", "keep", "clear"];
  36944. var CD = E;
  36945. function LD(t) {
  36946. if (t)
  36947. for (var e in t)
  36948. if (t.hasOwnProperty(e))
  36949. return !0
  36950. }
  36951. function kD(t, e, a) {
  36952. var i = {};
  36953. return CD(e, function(n) {
  36954. var o = i[n] = function() {
  36955. function t() {}
  36956. return t.prototype.__hidden = t.prototype,
  36957. new t
  36958. }();
  36959. CD(t[n], function(t, e) {
  36960. if (g_.isValidType(e)) {
  36961. var i = {
  36962. type: e,
  36963. visual: t
  36964. };
  36965. a && a(i, n),
  36966. o[e] = new g_(i),
  36967. "opacity" === e && ((i = k(i)).type = "colorAlpha",
  36968. o.__hidden.__alphaForOpacity = new g_(i))
  36969. }
  36970. })
  36971. }),
  36972. i
  36973. }
  36974. function PD(e, i, t) {
  36975. var n;
  36976. E(t, function(t) {
  36977. i.hasOwnProperty(t) && LD(i[t]) && (n = !0)
  36978. }),
  36979. n && E(t, function(t) {
  36980. i.hasOwnProperty(t) && LD(i[t]) ? e[t] = k(i[t]) : delete e[t]
  36981. })
  36982. }
  36983. var ND = {
  36984. lineX: OD(0),
  36985. lineY: OD(1),
  36986. rect: {
  36987. point: function(t, e, i) {
  36988. return t && i.boundingRect.contain(t[0], t[1])
  36989. },
  36990. rect: function(t, e, i) {
  36991. return t && i.boundingRect.intersect(t)
  36992. }
  36993. },
  36994. polygon: {
  36995. point: function(t, e, i) {
  36996. return t && i.boundingRect.contain(t[0], t[1]) && Tg(i.range, t[0], t[1])
  36997. },
  36998. rect: function(t, e, i) {
  36999. var n = i.range;
  37000. if (!t || n.length <= 1)
  37001. return !1;
  37002. var o = t.x
  37003. , a = t.y
  37004. , r = t.width
  37005. , s = t.height
  37006. , l = n[0];
  37007. return !!(Tg(n, o, a) || Tg(n, o + r, a) || Tg(n, o, a + s) || Tg(n, o + r, a + s) || Di.create(t).contain(l[0], l[1]) || xl(o, a, o + r, a, n) || xl(o, a, o, a + s, n) || xl(o + r, a, o + r, a + s, n) || xl(o, a + s, o + r, a + s, n)) || void 0
  37008. }
  37009. }
  37010. };
  37011. function OD(a) {
  37012. var r = ["x", "y"]
  37013. , s = ["width", "height"];
  37014. return {
  37015. point: function(t, e, i) {
  37016. if (t) {
  37017. var n = i.range;
  37018. return ED(t[a], n)
  37019. }
  37020. },
  37021. rect: function(t, e, i) {
  37022. if (t) {
  37023. var n = i.range
  37024. , o = [t[r[a]], t[r[a]] + t[s[a]]];
  37025. return o[1] < o[0] && o.reverse(),
  37026. ED(o[0], n) || ED(o[1], n) || ED(n[0], o) || ED(n[1], o)
  37027. }
  37028. }
  37029. }
  37030. }
  37031. function ED(t, e) {
  37032. return e[0] <= t && t <= e[1]
  37033. }
  37034. var RD = ["inBrush", "outOfBrush"]
  37035. , zD = "__ecBrushSelect"
  37036. , BD = "__ecInBrushSelectEvent"
  37037. , VD = Ld.VISUAL.BRUSH;
  37038. function GD(e) {
  37039. e.eachComponent({
  37040. mainType: "brush"
  37041. }, function(t) {
  37042. (t.brushTargetManager = new DA(t.option,e)).setInputRanges(t.areas, e)
  37043. })
  37044. }
  37045. function FD(t, e) {
  37046. if (!t.isDisposed()) {
  37047. var i = t.getZr();
  37048. i[BD] = !0,
  37049. t.dispatchAction({
  37050. type: "brushSelect",
  37051. batch: e
  37052. }),
  37053. i[BD] = !1
  37054. }
  37055. }
  37056. function WD(t, e, i, n) {
  37057. for (var o = 0, a = e.length; o < a; o++) {
  37058. var r = e[o];
  37059. if (t[r.brushType](n, i, r.selectors, r))
  37060. return !0
  37061. }
  37062. }
  37063. function HD(t) {
  37064. var r = t.brushSelector;
  37065. if (R(r)) {
  37066. var e = [];
  37067. return E(ND, function(a, t) {
  37068. e[t] = function(t, e, i, n) {
  37069. var o = e.getItemLayout(t);
  37070. return a[r](o, i, n)
  37071. }
  37072. }),
  37073. e
  37074. }
  37075. if (C(r)) {
  37076. var i = {};
  37077. return E(ND, function(t, e) {
  37078. i[e] = r
  37079. }),
  37080. i
  37081. }
  37082. return r
  37083. }
  37084. bf(VD, function(t, e, i) {
  37085. t.eachComponent({
  37086. mainType: "brush"
  37087. }, function(t) {
  37088. i && "takeGlobalCursor" === i.type && t.setBrushOption("brush" === i.key ? i.brushOption : {
  37089. brushType: !1
  37090. })
  37091. }),
  37092. GD(t)
  37093. }),
  37094. Sf(VD, function(p, t, e) {
  37095. var o, g, m = [];
  37096. p.eachComponent({
  37097. mainType: "brush"
  37098. }, function(a, t) {
  37099. var s = {
  37100. brushId: a.id,
  37101. brushIndex: t,
  37102. brushName: a.name,
  37103. areas: k(a.areas),
  37104. selected: []
  37105. };
  37106. m.push(s);
  37107. var e = a.option
  37108. , i = e.brushLink
  37109. , n = []
  37110. , l = []
  37111. , u = []
  37112. , h = 0;
  37113. t || (o = e.throttleType,
  37114. g = e.throttleDelay);
  37115. var r = O(a.areas, function(t) {
  37116. return function(i) {
  37117. var n = i.selectors = {};
  37118. return E(ND[i.brushType], function(e, t) {
  37119. n[t] = function(t) {
  37120. return e(t, n, i)
  37121. }
  37122. }),
  37123. i
  37124. }(D({
  37125. boundingRect: ZD[t.brushType](t)
  37126. }, t))
  37127. })
  37128. , c = kD(a.option, RD, function(t) {
  37129. t.mappingMethod = "fixed"
  37130. });
  37131. function d(t) {
  37132. return "all" === i || n[t]
  37133. }
  37134. function f(t) {
  37135. return !!t.length
  37136. }
  37137. L(i) && E(i, function(t) {
  37138. n[t] = 1
  37139. }),
  37140. p.eachSeries(function(t, e) {
  37141. var i = u[e] = [];
  37142. "parallel" === t.subType ? function(t, e) {
  37143. var i = t.coordinateSystem;
  37144. h |= i.hasAxisBrushed(),
  37145. d(e) && i.eachActiveState(t.getData(), function(t, e) {
  37146. "active" === t && (l[e] = 1)
  37147. })
  37148. }(t, e) : function(e, t, i) {
  37149. var n = HD(e);
  37150. if (!n || function(t, e) {
  37151. var i = t.option.seriesIndex;
  37152. return null != i && "all" !== i && (L(i) ? _(i, e) < 0 : e !== i)
  37153. }(a, t))
  37154. return;
  37155. if (E(r, function(t) {
  37156. n[t.brushType] && a.brushTargetManager.controlSeries(t, e, p) && i.push(t),
  37157. h |= f(i)
  37158. }),
  37159. d(t) && f(i)) {
  37160. var o = e.getData();
  37161. o.each(function(t) {
  37162. WD(n, i, o, t) && (l[t] = 1)
  37163. })
  37164. }
  37165. }(t, e, i)
  37166. }),
  37167. p.eachSeries(function(t, e) {
  37168. var i = {
  37169. seriesId: t.id,
  37170. seriesIndex: e,
  37171. seriesName: t.name,
  37172. dataIndex: []
  37173. };
  37174. s.selected.push(i);
  37175. var n = HD(t)
  37176. , o = u[e]
  37177. , a = t.getData()
  37178. , r = d(e) ? function(t) {
  37179. return l[t] ? (i.dataIndex.push(a.getRawIndex(t)),
  37180. "inBrush") : "outOfBrush"
  37181. }
  37182. : function(t) {
  37183. return WD(n, o, a, t) ? (i.dataIndex.push(a.getRawIndex(t)),
  37184. "inBrush") : "outOfBrush"
  37185. }
  37186. ;
  37187. (d(e) ? h : f(o)) && function(t, u, h, c, d, f) {
  37188. var p, g = {};
  37189. function m(t) {
  37190. return h.getItemVisual(p, t)
  37191. }
  37192. function v(t, e) {
  37193. h.setItemVisual(p, t, e)
  37194. }
  37195. function e(t, e) {
  37196. p = null == f ? t : e;
  37197. var i = h.getRawDataItem(p);
  37198. if (!i || !1 !== i.visualMap)
  37199. for (var n = c.call(d, t), o = u[n], a = g[n], r = 0, s = a.length; r < s; r++) {
  37200. var l = a[r];
  37201. o[l] && o[l].applyVisual(t, m, v)
  37202. }
  37203. }
  37204. E(t, function(t) {
  37205. var e = g_.prepareVisualTypes(u[t]);
  37206. g[t] = e
  37207. }),
  37208. null == f ? h.each(e) : h.each([f], e)
  37209. }(RD, c, a, r)
  37210. })
  37211. }),
  37212. function(t, e, i, n, o) {
  37213. if (!o)
  37214. return;
  37215. var a = t.getZr();
  37216. if (a[BD])
  37217. return;
  37218. a[zD] || (a[zD] = FD);
  37219. kc(a, zD, i, e)(t, n)
  37220. }(t, o, g, m, e)
  37221. });
  37222. var ZD = {
  37223. lineX: et,
  37224. lineY: et,
  37225. rect: function(t) {
  37226. return UD(t.range)
  37227. },
  37228. polygon: function(t) {
  37229. for (var e, i = t.range, n = 0, o = i.length; n < o; n++) {
  37230. e = e || [[1 / 0, -1 / 0], [1 / 0, -1 / 0]];
  37231. var a = i[n];
  37232. a[0] < e[0][0] && (e[0][0] = a[0]),
  37233. a[0] > e[0][1] && (e[0][1] = a[0]),
  37234. a[1] < e[1][0] && (e[1][0] = a[1]),
  37235. a[1] > e[1][1] && (e[1][1] = a[1])
  37236. }
  37237. return e && UD(e)
  37238. }
  37239. };
  37240. function UD(t) {
  37241. return new Di(t[0][0],t[1][0],t[0][1] - t[0][0],t[1][1] - t[1][0])
  37242. }
  37243. var XD = ["#ddd"];
  37244. Tf({
  37245. type: "brush",
  37246. dependencies: ["geo", "grid", "xAxis", "yAxis", "parallel", "series"],
  37247. defaultOption: {
  37248. toolbox: null,
  37249. brushLink: null,
  37250. seriesIndex: "all",
  37251. geoIndex: null,
  37252. xAxisIndex: null,
  37253. yAxisIndex: null,
  37254. brushType: "rect",
  37255. brushMode: "single",
  37256. transformable: !0,
  37257. brushStyle: {
  37258. borderWidth: 1,
  37259. color: "rgba(120,140,180,0.3)",
  37260. borderColor: "rgba(120,140,180,0.8)"
  37261. },
  37262. throttleType: "fixRate",
  37263. throttleDelay: 0,
  37264. removeOnClick: !0,
  37265. z: 1e4
  37266. },
  37267. areas: [],
  37268. brushType: null,
  37269. brushOption: {},
  37270. coordInfoList: [],
  37271. optionUpdated: function(t, e) {
  37272. var i = this.option;
  37273. e || PD(i, t, ["inBrush", "outOfBrush"]);
  37274. var n = i.inBrush = i.inBrush || {};
  37275. i.outOfBrush = i.outOfBrush || {
  37276. color: XD
  37277. },
  37278. n.hasOwnProperty("liftZ") || (n.liftZ = 5)
  37279. },
  37280. setAreas: function(t) {
  37281. t && (this.areas = O(t, function(t) {
  37282. return YD(this.option, t)
  37283. }, this))
  37284. },
  37285. setBrushOption: function(t) {
  37286. this.brushOption = YD(this.option, t),
  37287. this.brushType = this.brushOption.brushType
  37288. }
  37289. });
  37290. function YD(t, e) {
  37291. return m({
  37292. brushType: t.brushType,
  37293. brushMode: t.brushMode,
  37294. transformable: t.transformable,
  37295. brushStyle: new Cl(t.brushStyle).getItemStyle(),
  37296. removeOnClick: t.removeOnClick,
  37297. z: t.z
  37298. }, e, !0)
  37299. }
  37300. function jD(t, e, i, n) {
  37301. n && n.$from === t.id || this._brushController.setPanels(t.brushTargetManager.makePanelOpts(i)).enableBrush(t.brushOption).updateCovers(t.areas.slice())
  37302. }
  37303. Af({
  37304. type: "brush",
  37305. init: function(t, e) {
  37306. this.ecModel = t,
  37307. this.api = e,
  37308. this.model,
  37309. (this._brushController = new Ib(e.getZr())).on("brush", A(this._onBrush, this)).mount()
  37310. },
  37311. render: function(t) {
  37312. return this.model = t,
  37313. jD.apply(this, arguments)
  37314. },
  37315. updateTransform: function(t, e) {
  37316. return GD(e),
  37317. jD.apply(this, arguments)
  37318. },
  37319. updateView: jD,
  37320. dispose: function() {
  37321. this._brushController.dispose()
  37322. },
  37323. _onBrush: function(t, e) {
  37324. var i = this.model.id;
  37325. this.model.brushTargetManager.setOutputRanges(t, this.ecModel),
  37326. e.isEnd && !e.removeOnClick || this.api.dispatchAction({
  37327. type: "brush",
  37328. brushId: i,
  37329. areas: k(t),
  37330. $from: i
  37331. }),
  37332. e.isEnd && this.api.dispatchAction({
  37333. type: "brushEnd",
  37334. brushId: i,
  37335. areas: k(t),
  37336. $from: i
  37337. })
  37338. }
  37339. }),
  37340. _f({
  37341. type: "brush",
  37342. event: "brush"
  37343. }, function(e, t) {
  37344. t.eachComponent({
  37345. mainType: "brush",
  37346. query: e
  37347. }, function(t) {
  37348. t.setAreas(e.areas)
  37349. })
  37350. }),
  37351. _f({
  37352. type: "brushSelect",
  37353. event: "brushSelected",
  37354. update: "none"
  37355. }, function() {}),
  37356. _f({
  37357. type: "brushEnd",
  37358. event: "brushEnd",
  37359. update: "none"
  37360. }, function() {});
  37361. var qD = Oc.toolbox.brush;
  37362. function KD(t, e, i) {
  37363. this.model = t,
  37364. this.ecModel = e,
  37365. this.api = i,
  37366. this._brushType,
  37367. this._brushMode
  37368. }
  37369. KD.defaultOption = {
  37370. show: !0,
  37371. type: ["rect", "polygon", "lineX", "lineY", "keep", "clear"],
  37372. icon: {
  37373. rect: "M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",
  37374. polygon: "M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",
  37375. lineX: "M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",
  37376. lineY: "M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",
  37377. keep: "M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",
  37378. clear: "M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"
  37379. },
  37380. title: k(qD.title)
  37381. };
  37382. var $D = KD.prototype;
  37383. $D.render = $D.updateView = function(e, t, i) {
  37384. var n, o, a;
  37385. t.eachComponent({
  37386. mainType: "brush"
  37387. }, function(t) {
  37388. n = t.brushType,
  37389. o = t.brushOption.brushMode || "single",
  37390. a |= t.areas.length
  37391. }),
  37392. this._brushType = n,
  37393. this._brushMode = o,
  37394. E(e.get("type", !0), function(t) {
  37395. e.setIconStatus(t, ("keep" === t ? "multiple" === o : "clear" === t ? a : t === n) ? "emphasis" : "normal")
  37396. })
  37397. }
  37398. ,
  37399. $D.getIcons = function() {
  37400. var t = this.model
  37401. , e = t.get("icon", !0)
  37402. , i = {};
  37403. return E(t.get("type", !0), function(t) {
  37404. e[t] && (i[t] = e[t])
  37405. }),
  37406. i
  37407. }
  37408. ,
  37409. $D.onclick = function(t, e, i) {
  37410. var n = this._brushType
  37411. , o = this._brushMode;
  37412. "clear" === i ? (e.dispatchAction({
  37413. type: "axisAreaSelect",
  37414. intervals: []
  37415. }),
  37416. e.dispatchAction({
  37417. type: "brush",
  37418. command: "clear",
  37419. areas: []
  37420. })) : e.dispatchAction({
  37421. type: "takeGlobalCursor",
  37422. key: "brush",
  37423. brushOption: {
  37424. brushType: "keep" === i ? n : n !== i && i,
  37425. brushMode: "keep" === i ? "multiple" === o ? "single" : "multiple" : o
  37426. }
  37427. })
  37428. }
  37429. ,
  37430. nA("brush", KD),
  37431. yf(function(t, e) {
  37432. var i = t && t.brush;
  37433. if (L(i) || (i = i ? [i] : []),
  37434. i.length) {
  37435. var n = [];
  37436. E(i, function(t) {
  37437. var e = t.hasOwnProperty("toolbox") ? t.toolbox : [];
  37438. e instanceof Array && (n = n.concat(e))
  37439. });
  37440. var o = t && t.toolbox;
  37441. L(o) && (o = o[0]),
  37442. o || (o = {
  37443. feature: {}
  37444. },
  37445. t.toolbox = [o]);
  37446. var a = o.feature || (o.feature = {})
  37447. , r = a.brush || (a.brush = {})
  37448. , s = r.type || (r.type = []);
  37449. s.push.apply(s, n),
  37450. function(i) {
  37451. var e = {};
  37452. E(i, function(t) {
  37453. e[t] = 1
  37454. }),
  37455. i.length = 0,
  37456. E(e, function(t, e) {
  37457. i.push(e)
  37458. })
  37459. }(s),
  37460. e && !s.length && s.push.apply(s, DD)
  37461. }
  37462. }),
  37463. Tf({
  37464. type: "title",
  37465. layoutMode: {
  37466. type: "box",
  37467. ignoreSize: !0
  37468. },
  37469. defaultOption: {
  37470. zlevel: 0,
  37471. z: 6,
  37472. show: !0,
  37473. text: "",
  37474. target: "blank",
  37475. subtext: "",
  37476. subtarget: "blank",
  37477. left: 0,
  37478. top: 0,
  37479. backgroundColor: "rgba(0,0,0,0)",
  37480. borderColor: "#ccc",
  37481. borderWidth: 0,
  37482. padding: 5,
  37483. itemGap: 10,
  37484. textStyle: {
  37485. fontSize: 18,
  37486. fontWeight: "bolder",
  37487. color: "#333"
  37488. },
  37489. subtextStyle: {
  37490. color: "#aaa"
  37491. }
  37492. }
  37493. }),
  37494. Af({
  37495. type: "title",
  37496. render: function(t, e, i) {
  37497. if (this.group.removeAll(),
  37498. t.get("show")) {
  37499. var n = this.group
  37500. , o = t.getModel("textStyle")
  37501. , a = t.getModel("subtextStyle")
  37502. , r = t.get("textAlign")
  37503. , s = H(t.get("textBaseline"), t.get("textVerticalAlign"))
  37504. , l = new Ur({
  37505. style: nl({}, o, {
  37506. text: t.get("text"),
  37507. textFill: o.getTextColor()
  37508. }, {
  37509. disableBox: !0
  37510. }),
  37511. z2: 10
  37512. })
  37513. , u = l.getBoundingRect()
  37514. , h = t.get("subtext")
  37515. , c = new Ur({
  37516. style: nl({}, a, {
  37517. text: h,
  37518. textFill: a.getTextColor(),
  37519. y: u.height + t.get("itemGap"),
  37520. textVerticalAlign: "top"
  37521. }, {
  37522. disableBox: !0
  37523. }),
  37524. z2: 10
  37525. })
  37526. , d = t.get("link")
  37527. , f = t.get("sublink")
  37528. , p = t.get("triggerEvent", !0);
  37529. l.silent = !d && !p,
  37530. c.silent = !f && !p,
  37531. d && l.on("click", function() {
  37532. gu(d, "_" + t.get("target"))
  37533. }),
  37534. f && c.on("click", function() {
  37535. gu(d, "_" + t.get("subtarget"))
  37536. }),
  37537. l.eventData = c.eventData = p ? {
  37538. componentType: "title",
  37539. componentIndex: t.componentIndex
  37540. } : null,
  37541. n.add(l),
  37542. h && n.add(c);
  37543. var g = n.getBoundingRect()
  37544. , m = t.getBoxLayoutParams();
  37545. m.width = g.width,
  37546. m.height = g.height;
  37547. var v = bu(m, {
  37548. width: i.getWidth(),
  37549. height: i.getHeight()
  37550. }, t.get("padding"));
  37551. r || ("middle" === (r = t.get("left") || t.get("right")) && (r = "center"),
  37552. "right" === r ? v.x += v.width : "center" === r && (v.x += v.width / 2)),
  37553. s || ("center" === (s = t.get("top") || t.get("bottom")) && (s = "middle"),
  37554. "bottom" === s ? v.y += v.height : "middle" === s && (v.y += v.height / 2),
  37555. s = s || "top"),
  37556. n.attr("position", [v.x, v.y]);
  37557. var y = {
  37558. textAlign: r,
  37559. textVerticalAlign: s
  37560. };
  37561. l.setStyle(y),
  37562. c.setStyle(y),
  37563. g = n.getBoundingRect();
  37564. var x = v.margin
  37565. , _ = t.getItemStyle(["color", "opacity"]);
  37566. _.fill = t.get("backgroundColor");
  37567. var w = new rs({
  37568. shape: {
  37569. x: g.x - x[3],
  37570. y: g.y - x[0],
  37571. width: g.width + x[1] + x[3],
  37572. height: g.height + x[0] + x[2],
  37573. r: t.get("borderRadius")
  37574. },
  37575. style: _,
  37576. subPixelOptimize: !0,
  37577. silent: !0
  37578. });
  37579. n.add(w)
  37580. }
  37581. }
  37582. });
  37583. function JD(t) {
  37584. var e = t.itemStyle || (t.itemStyle = {})
  37585. , i = e.emphasis || (e.emphasis = {})
  37586. , n = t.label || t.label || {}
  37587. , o = n.normal || (n.normal = {})
  37588. , a = {
  37589. normal: 1,
  37590. emphasis: 1
  37591. };
  37592. E(n, function(t, e) {
  37593. a[e] || QD(o, e) || (o[e] = t)
  37594. }),
  37595. i.label && !QD(n, "emphasis") && (n.emphasis = i.label,
  37596. delete i.label)
  37597. }
  37598. function QD(t, e) {
  37599. return t.hasOwnProperty(e)
  37600. }
  37601. ku.registerSubTypeDefaulter("timeline", function() {
  37602. return "slider"
  37603. }),
  37604. _f({
  37605. type: "timelineChange",
  37606. event: "timelineChanged",
  37607. update: "prepareAndUpdate"
  37608. }, function(t, e) {
  37609. var i = e.getComponent("timeline");
  37610. return i && null != t.currentIndex && (i.setCurrentIndex(t.currentIndex),
  37611. !i.get("loop", !0) && i.isIndexMax() && i.setPlayState(!1)),
  37612. e.resetOption("timeline"),
  37613. D({
  37614. currentIndex: i.option.currentIndex
  37615. }, t)
  37616. }),
  37617. _f({
  37618. type: "timelinePlayChange",
  37619. event: "timelinePlayChanged",
  37620. update: "update"
  37621. }, function(t, e) {
  37622. var i = e.getComponent("timeline");
  37623. i && null != t.playState && i.setPlayState(t.playState)
  37624. });
  37625. var tC = ku.extend({
  37626. type: "timeline",
  37627. layoutMode: "box",
  37628. defaultOption: {
  37629. zlevel: 0,
  37630. z: 4,
  37631. show: !0,
  37632. axisType: "time",
  37633. realtime: !0,
  37634. left: "20%",
  37635. top: null,
  37636. right: "20%",
  37637. bottom: 0,
  37638. width: null,
  37639. height: 40,
  37640. padding: 5,
  37641. controlPosition: "left",
  37642. autoPlay: !1,
  37643. rewind: !1,
  37644. loop: !0,
  37645. playInterval: 2e3,
  37646. currentIndex: 0,
  37647. itemStyle: {},
  37648. label: {
  37649. color: "#000"
  37650. },
  37651. data: []
  37652. },
  37653. init: function(t, e, i) {
  37654. this._data,
  37655. this._names,
  37656. this.mergeDefaultAndTheme(t, i),
  37657. this._initData()
  37658. },
  37659. mergeOption: function(t) {
  37660. tC.superApply(this, "mergeOption", arguments),
  37661. this._initData()
  37662. },
  37663. setCurrentIndex: function(t) {
  37664. null == t && (t = this.option.currentIndex);
  37665. var e = this._data.count();
  37666. this.option.loop ? t = (t % e + e) % e : (e <= t && (t = e - 1),
  37667. t < 0 && (t = 0)),
  37668. this.option.currentIndex = t
  37669. },
  37670. getCurrentIndex: function() {
  37671. return this.option.currentIndex
  37672. },
  37673. isIndexMax: function() {
  37674. return this.getCurrentIndex() >= this._data.count() - 1
  37675. },
  37676. setPlayState: function(t) {
  37677. this.option.autoPlay = !!t
  37678. },
  37679. getPlayState: function() {
  37680. return !!this.option.autoPlay
  37681. },
  37682. _initData: function() {
  37683. var t = this.option
  37684. , e = t.data || []
  37685. , i = t.axisType
  37686. , o = this._names = [];
  37687. if ("category" === i) {
  37688. var a = [];
  37689. E(e, function(t, e) {
  37690. var i, n = Wo(t);
  37691. z(t) ? (i = k(t)).value = e : i = e,
  37692. a.push(i),
  37693. R(n) || null != n && !isNaN(n) || (n = ""),
  37694. o.push(n + "")
  37695. }),
  37696. e = a
  37697. }
  37698. var n = {
  37699. category: "ordinal",
  37700. time: "time"
  37701. }[i] || "number";
  37702. (this._data = new Yf([{
  37703. name: "value",
  37704. type: n
  37705. }],this)).initData(e, o)
  37706. },
  37707. getData: function() {
  37708. return this._data
  37709. },
  37710. getCategories: function() {
  37711. if ("category" === this.get("axisType"))
  37712. return this._names.slice()
  37713. }
  37714. });
  37715. b(tC.extend({
  37716. type: "timeline.slider",
  37717. defaultOption: {
  37718. backgroundColor: "rgba(0,0,0,0)",
  37719. borderColor: "#ccc",
  37720. borderWidth: 0,
  37721. orient: "horizontal",
  37722. inverse: !1,
  37723. tooltip: {
  37724. trigger: "item"
  37725. },
  37726. symbol: "emptyCircle",
  37727. symbolSize: 10,
  37728. lineStyle: {
  37729. show: !0,
  37730. width: 2,
  37731. color: "#304654"
  37732. },
  37733. label: {
  37734. position: "auto",
  37735. show: !0,
  37736. interval: "auto",
  37737. rotate: 0,
  37738. color: "#304654"
  37739. },
  37740. itemStyle: {
  37741. color: "#304654",
  37742. borderWidth: 1
  37743. },
  37744. checkpointStyle: {
  37745. symbol: "circle",
  37746. symbolSize: 13,
  37747. color: "#c23531",
  37748. borderWidth: 5,
  37749. borderColor: "rgba(194,53,49, 0.5)",
  37750. animation: !0,
  37751. animationDuration: 300,
  37752. animationEasing: "quinticInOut"
  37753. },
  37754. controlStyle: {
  37755. show: !0,
  37756. showPlayBtn: !0,
  37757. showPrevBtn: !0,
  37758. showNextBtn: !0,
  37759. itemSize: 22,
  37760. itemGap: 12,
  37761. position: "left",
  37762. playIcon: "path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",
  37763. stopIcon: "path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",
  37764. nextIcon: "path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",
  37765. prevIcon: "path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",
  37766. color: "#304654",
  37767. borderColor: "#304654",
  37768. borderWidth: 1
  37769. },
  37770. emphasis: {
  37771. label: {
  37772. show: !0,
  37773. color: "#c23531"
  37774. },
  37775. itemStyle: {
  37776. color: "#c23531"
  37777. },
  37778. controlStyle: {
  37779. color: "#c23531",
  37780. borderColor: "#c23531",
  37781. borderWidth: 2
  37782. }
  37783. },
  37784. data: []
  37785. }
  37786. }), Xh);
  37787. function eC(t, e, i, n) {
  37788. Gg.call(this, t, e, i),
  37789. this.type = n || "value",
  37790. this.model = null
  37791. }
  37792. var iC = gc.extend({
  37793. type: "timeline"
  37794. });
  37795. eC.prototype = {
  37796. constructor: eC,
  37797. getLabelModel: function() {
  37798. return this.model.getModel("label")
  37799. },
  37800. isHorizontal: function() {
  37801. return "horizontal" === this.model.get("orient")
  37802. }
  37803. },
  37804. w(eC, Gg);
  37805. var nC = A
  37806. , oC = E
  37807. , aC = Math.PI;
  37808. function rC(t, e, i, n, o, a) {
  37809. var r = e.get("color");
  37810. o ? (o.setColor(r),
  37811. i.add(o),
  37812. a && a.onUpdate(o)) : ((o = wg(t.get("symbol"), -1, -1, 2, 2, r)).setStyle("strokeNoScale", !0),
  37813. i.add(o),
  37814. a && a.onCreate(o));
  37815. var s = e.getItemStyle(["color", "symbol", "symbolSize"]);
  37816. o.setStyle(s),
  37817. n = m({
  37818. rectHover: !0,
  37819. z2: 100
  37820. }, n, !0);
  37821. var l = t.get("symbolSize");
  37822. (l = l instanceof Array ? l.slice() : [+l, +l])[0] /= 2,
  37823. l[1] /= 2,
  37824. n.scale = l;
  37825. var u = t.get("symbolOffset");
  37826. if (u) {
  37827. var h = n.position = n.position || [0, 0];
  37828. h[0] += Rl(u[0], l[0]),
  37829. h[1] += Rl(u[1], l[1])
  37830. }
  37831. var c = t.get("symbolRotate");
  37832. return n.rotation = (c || 0) * Math.PI / 180 || 0,
  37833. o.attr(n),
  37834. o.updateTransform(),
  37835. o
  37836. }
  37837. function sC(t, e, i, n, o) {
  37838. if (!t.dragging) {
  37839. var a = n.getModel("checkpointStyle")
  37840. , r = i.dataToCoord(n.getData().get(["value"], e));
  37841. o || !a.get("animation", !0) ? t.attr({
  37842. position: [r, 0]
  37843. }) : (t.stopAnimation(!0),
  37844. t.animateTo({
  37845. position: [r, 0]
  37846. }, a.get("animationDuration", !0), a.get("animationEasing", !0)))
  37847. }
  37848. }
  37849. iC.extend({
  37850. type: "timeline.slider",
  37851. init: function(t, e) {
  37852. this.api = e,
  37853. this._axis,
  37854. this._viewRect,
  37855. this._timer,
  37856. this._currentPointer,
  37857. this._mainGroup,
  37858. this._labelGroup
  37859. },
  37860. render: function(e, t, i, n) {
  37861. if (this.model = e,
  37862. this.api = i,
  37863. this.ecModel = t,
  37864. this.group.removeAll(),
  37865. e.get("show", !0)) {
  37866. var o = this._layout(e, i)
  37867. , a = this._createGroup("mainGroup")
  37868. , r = this._createGroup("labelGroup")
  37869. , s = this._axis = this._createAxis(o, e);
  37870. e.formatTooltip = function(t) {
  37871. return au(s.scale.getLabel(t))
  37872. }
  37873. ,
  37874. oC(["AxisLine", "AxisTick", "Control", "CurrentPointer"], function(t) {
  37875. this["_render" + t](o, a, s, e)
  37876. }, this),
  37877. this._renderAxisLabel(o, r, s, e),
  37878. this._position(o, e)
  37879. }
  37880. this._doPlayStop()
  37881. },
  37882. remove: function() {
  37883. this._clearTimer(),
  37884. this.group.removeAll()
  37885. },
  37886. dispose: function() {
  37887. this._clearTimer()
  37888. },
  37889. _layout: function(t, e) {
  37890. var i = t.get("label.position")
  37891. , n = t.get("orient")
  37892. , o = function(t, e) {
  37893. return bu(t.getBoxLayoutParams(), {
  37894. width: e.getWidth(),
  37895. height: e.getHeight()
  37896. }, t.get("padding"))
  37897. }(t, e);
  37898. null == i || "auto" === i ? i = "horizontal" === n ? o.y + o.height / 2 < e.getHeight() / 2 ? "-" : "+" : o.x + o.width / 2 < e.getWidth() / 2 ? "+" : "-" : isNaN(i) && (i = {
  37899. horizontal: {
  37900. top: "-",
  37901. bottom: "+"
  37902. },
  37903. vertical: {
  37904. left: "-",
  37905. right: "+"
  37906. }
  37907. }[n][i]);
  37908. var a, r, s, l, u = {
  37909. horizontal: "center",
  37910. vertical: 0 <= i || "+" === i ? "left" : "right"
  37911. }, h = {
  37912. horizontal: 0 <= i || "+" === i ? "top" : "bottom",
  37913. vertical: "middle"
  37914. }, c = {
  37915. horizontal: 0,
  37916. vertical: aC / 2
  37917. }, d = "vertical" === n ? o.height : o.width, f = t.getModel("controlStyle"), p = f.get("show", !0), g = p ? f.get("itemSize") : 0, m = p ? f.get("itemGap") : 0, v = g + m, y = t.get("label.rotate") || 0;
  37918. y = y * aC / 180;
  37919. var x = f.get("position", !0)
  37920. , _ = p && f.get("showPlayBtn", !0)
  37921. , w = p && f.get("showPrevBtn", !0)
  37922. , b = p && f.get("showNextBtn", !0)
  37923. , S = 0
  37924. , M = d;
  37925. return "left" === x || "bottom" === x ? (_ && (a = [0, 0],
  37926. S += v),
  37927. w && (r = [S, 0],
  37928. S += v)) : (_ && (a = [M - g, 0],
  37929. M -= v),
  37930. w && (r = [0, 0],
  37931. S += v)),
  37932. b && (s = [M - g, 0],
  37933. M -= v),
  37934. l = [S, M],
  37935. t.get("inverse") && l.reverse(),
  37936. {
  37937. viewRect: o,
  37938. mainLength: d,
  37939. orient: n,
  37940. rotation: c[n],
  37941. labelRotation: y,
  37942. labelPosOpt: i,
  37943. labelAlign: t.get("label.align") || u[n],
  37944. labelBaseline: t.get("label.verticalAlign") || t.get("label.baseline") || h[n],
  37945. playPosition: a,
  37946. prevBtnPosition: r,
  37947. nextBtnPosition: s,
  37948. axisExtent: l,
  37949. controlSize: g,
  37950. controlGap: m
  37951. }
  37952. },
  37953. _position: function(t, e) {
  37954. var i = this._mainGroup
  37955. , n = this._labelGroup
  37956. , o = t.viewRect;
  37957. if ("vertical" === t.orient) {
  37958. var a = ae()
  37959. , r = o.x
  37960. , s = o.y + o.height;
  37961. ue(a, a, [-r, -s]),
  37962. he(a, a, -aC / 2),
  37963. ue(a, a, [r, s]),
  37964. (o = o.clone()).applyTransform(a)
  37965. }
  37966. var l = m(o)
  37967. , u = m(i.getBoundingRect())
  37968. , h = m(n.getBoundingRect())
  37969. , c = i.position
  37970. , d = n.position;
  37971. d[0] = c[0] = l[0][0];
  37972. var f, p = t.labelPosOpt;
  37973. isNaN(p) ? (v(c, u, l, 1, f = "+" === p ? 0 : 1),
  37974. v(d, h, l, 1, 1 - f)) : (v(c, u, l, 1, f = 0 <= p ? 0 : 1),
  37975. d[1] = c[1] + p);
  37976. function g(t) {
  37977. var e = t.position;
  37978. t.origin = [l[0][0] - e[0], l[1][0] - e[1]]
  37979. }
  37980. function m(t) {
  37981. return [[t.x, t.x + t.width], [t.y, t.y + t.height]]
  37982. }
  37983. function v(t, e, i, n, o) {
  37984. t[n] += i[n][o] - e[n][o]
  37985. }
  37986. i.attr("position", c),
  37987. n.attr("position", d),
  37988. i.rotation = n.rotation = t.rotation,
  37989. g(i),
  37990. g(n)
  37991. },
  37992. _createAxis: function(t, e) {
  37993. var i = e.getData()
  37994. , n = e.get("axisType")
  37995. , o = sg(e, n);
  37996. o.getTicks = function() {
  37997. return i.mapArray(["value"], function(t) {
  37998. return t
  37999. })
  38000. }
  38001. ;
  38002. var a = i.getDataExtent("value");
  38003. o.setExtent(a[0], a[1]),
  38004. o.niceTicks();
  38005. var r = new eC("value",o,t.axisExtent,n);
  38006. return r.model = e,
  38007. r
  38008. },
  38009. _createGroup: function(t) {
  38010. var e = this["_" + t] = new Ci;
  38011. return this.group.add(e),
  38012. e
  38013. },
  38014. _renderAxisLine: function(t, e, i, n) {
  38015. var o = i.getExtent();
  38016. n.get("lineStyle.show") && e.add(new ls({
  38017. shape: {
  38018. x1: o[0],
  38019. y1: 0,
  38020. x2: o[1],
  38021. y2: 0
  38022. },
  38023. style: P({
  38024. lineCap: "round"
  38025. }, n.getModel("lineStyle").getLineStyle()),
  38026. silent: !0,
  38027. z2: 1
  38028. }))
  38029. },
  38030. _renderAxisTick: function(t, s, l, u) {
  38031. var h = u.getData()
  38032. , e = l.scale.getTicks();
  38033. oC(e, function(t) {
  38034. var e = l.dataToCoord(t)
  38035. , i = h.getItemModel(t)
  38036. , n = i.getModel("itemStyle")
  38037. , o = i.getModel("emphasis.itemStyle")
  38038. , a = {
  38039. position: [e, 0],
  38040. onclick: nC(this._changeTimeline, this, t)
  38041. }
  38042. , r = rC(i, n, s, a);
  38043. $s(r, o.getItemStyle()),
  38044. i.get("tooltip") ? (r.dataIndex = t,
  38045. r.dataModel = u) : r.dataIndex = r.dataModel = null
  38046. }, this)
  38047. },
  38048. _renderAxisLabel: function(s, l, u, t) {
  38049. if (u.getLabelModel().get("show")) {
  38050. var h = t.getData()
  38051. , e = u.getViewLabels();
  38052. oC(e, function(t) {
  38053. var e = t.tickValue
  38054. , i = h.getItemModel(e)
  38055. , n = i.getModel("label")
  38056. , o = i.getModel("emphasis.label")
  38057. , a = u.dataToCoord(t.tickValue)
  38058. , r = new Ur({
  38059. position: [a, 0],
  38060. rotation: s.labelRotation - s.rotation,
  38061. onclick: nC(this._changeTimeline, this, e),
  38062. silent: !1
  38063. });
  38064. nl(r.style, n, {
  38065. text: t.formattedLabel,
  38066. textAlign: s.labelAlign,
  38067. textVerticalAlign: s.labelBaseline
  38068. }),
  38069. l.add(r),
  38070. $s(r, nl({}, o))
  38071. }, this)
  38072. }
  38073. },
  38074. _renderControl: function(t, a, e, r) {
  38075. var s = t.controlSize
  38076. , l = t.rotation
  38077. , u = r.getModel("controlStyle").getItemStyle()
  38078. , h = r.getModel("emphasis.controlStyle").getItemStyle()
  38079. , c = [0, -s / 2, s, s]
  38080. , i = r.getPlayState()
  38081. , n = r.get("inverse", !0);
  38082. function o(t, e, i, n) {
  38083. if (t) {
  38084. var o = function(t, e, i, n) {
  38085. return Ps(t.get(e).replace(/^path:\/\//, ""), k(n || {}), new Di(i[0],i[1],i[2],i[3]), "center")
  38086. }(r, e, c, {
  38087. position: t,
  38088. origin: [s / 2, 0],
  38089. rotation: n ? -l : 0,
  38090. rectHover: !0,
  38091. style: u,
  38092. onclick: i
  38093. });
  38094. a.add(o),
  38095. $s(o, h)
  38096. }
  38097. }
  38098. o(t.nextBtnPosition, "controlStyle.nextIcon", nC(this._changeTimeline, this, n ? "-" : "+")),
  38099. o(t.prevBtnPosition, "controlStyle.prevIcon", nC(this._changeTimeline, this, n ? "+" : "-")),
  38100. o(t.playPosition, "controlStyle." + (i ? "stopIcon" : "playIcon"), nC(this._handlePlayClick, this, !i), !0)
  38101. },
  38102. _renderCurrentPointer: function(t, e, i, n) {
  38103. var o = n.getData()
  38104. , a = n.getCurrentIndex()
  38105. , r = o.getItemModel(a).getModel("checkpointStyle")
  38106. , s = this
  38107. , l = {
  38108. onCreate: function(t) {
  38109. t.draggable = !0,
  38110. t.drift = nC(s._handlePointerDrag, s),
  38111. t.ondragend = nC(s._handlePointerDragend, s),
  38112. sC(t, a, i, n, !0)
  38113. },
  38114. onUpdate: function(t) {
  38115. sC(t, a, i, n)
  38116. }
  38117. };
  38118. this._currentPointer = rC(r, r, this._mainGroup, {}, this._currentPointer, l)
  38119. },
  38120. _handlePlayClick: function(t) {
  38121. this._clearTimer(),
  38122. this.api.dispatchAction({
  38123. type: "timelinePlayChange",
  38124. playState: t,
  38125. from: this.uid
  38126. })
  38127. },
  38128. _handlePointerDrag: function(t, e, i) {
  38129. this._clearTimer(),
  38130. this._pointerChangeTimeline([i.offsetX, i.offsetY])
  38131. },
  38132. _handlePointerDragend: function(t) {
  38133. this._pointerChangeTimeline([t.offsetX, t.offsetY], !0)
  38134. },
  38135. _pointerChangeTimeline: function(t, e) {
  38136. var i = this._toAxisCoord(t)[0]
  38137. , n = Bl(this._axis.getExtent().slice());
  38138. i > n[1] && (i = n[1]),
  38139. i < n[0] && (i = n[0]),
  38140. this._currentPointer.position[0] = i,
  38141. this._currentPointer.dirty();
  38142. var o = this._findNearestTick(i)
  38143. , a = this.model;
  38144. (e || o !== a.getCurrentIndex() && a.get("realtime")) && this._changeTimeline(o)
  38145. },
  38146. _doPlayStop: function() {
  38147. this._clearTimer(),
  38148. this.model.getPlayState() && (this._timer = setTimeout(nC(function() {
  38149. var t = this.model;
  38150. this._changeTimeline(t.getCurrentIndex() + (t.get("rewind", !0) ? -1 : 1))
  38151. }, this), this.model.get("playInterval")))
  38152. },
  38153. _toAxisCoord: function(t) {
  38154. return pl(t, this._mainGroup.getLocalTransform(), !0)
  38155. },
  38156. _findNearestTick: function(o) {
  38157. var a, t = this.model.getData(), r = 1 / 0, s = this._axis;
  38158. return t.each(["value"], function(t, e) {
  38159. var i = s.dataToCoord(t)
  38160. , n = Math.abs(i - o);
  38161. n < r && (r = n,
  38162. a = e)
  38163. }),
  38164. a
  38165. },
  38166. _clearTimer: function() {
  38167. this._timer && (clearTimeout(this._timer),
  38168. this._timer = null)
  38169. },
  38170. _changeTimeline: function(t) {
  38171. var e = this.model.getCurrentIndex();
  38172. "+" === t ? t = e + 1 : "-" === t && (t = e - 1),
  38173. this.api.dispatchAction({
  38174. type: "timelineChange",
  38175. currentIndex: t,
  38176. from: this.uid
  38177. })
  38178. }
  38179. }),
  38180. yf(function(t) {
  38181. var e = t && t.timeline;
  38182. L(e) || (e = e ? [e] : []),
  38183. E(e, function(t) {
  38184. t && function(t) {
  38185. var e = t.type
  38186. , i = {
  38187. number: "value",
  38188. time: "time"
  38189. };
  38190. i[e] && (t.axisType = i[e],
  38191. delete t.type);
  38192. if (JD(t),
  38193. QD(t, "controlPosition")) {
  38194. var n = t.controlStyle || (t.controlStyle = {});
  38195. QD(n, "position") || (n.position = t.controlPosition),
  38196. "none" !== n.position || QD(n, "show") || (n.show = !1,
  38197. delete n.position),
  38198. delete t.controlPosition
  38199. }
  38200. E(t.data || [], function(t) {
  38201. z(t) && !L(t) && (!QD(t, "value") && QD(t, "name") && (t.value = t.name),
  38202. JD(t))
  38203. })
  38204. }(t)
  38205. })
  38206. });
  38207. var lC = tu
  38208. , uC = au;
  38209. function hC(t) {
  38210. Go(t, "label", ["show"])
  38211. }
  38212. var cC = Tf({
  38213. type: "marker",
  38214. dependencies: ["series", "grid", "polar", "geo"],
  38215. init: function(t, e, i) {
  38216. this.mergeDefaultAndTheme(t, i),
  38217. this._mergeOption(t, i, !1, !0)
  38218. },
  38219. isAnimationEnabled: function() {
  38220. if (v.node)
  38221. return !1;
  38222. var t = this.__hostSeries;
  38223. return this.getShallow("animation") && t && t.isAnimationEnabled()
  38224. },
  38225. mergeOption: function(t, e) {
  38226. this._mergeOption(t, e, !1, !1)
  38227. },
  38228. _mergeOption: function(t, n, e, o) {
  38229. var a = this.constructor
  38230. , r = this.mainType + "Model";
  38231. e || n.eachSeries(function(t) {
  38232. var e = t.get(this.mainType, !0)
  38233. , i = t[r];
  38234. e && e.data ? (i ? i._mergeOption(e, n, !0) : (o && hC(e),
  38235. E(e.data, function(t) {
  38236. t instanceof Array ? (hC(t[0]),
  38237. hC(t[1])) : hC(t)
  38238. }),
  38239. P(i = new a(e,this,n), {
  38240. mainType: this.mainType,
  38241. seriesIndex: t.seriesIndex,
  38242. name: t.name,
  38243. createdBySelf: !0
  38244. }),
  38245. i.__hostSeries = t),
  38246. t[r] = i) : t[r] = null
  38247. }, this)
  38248. },
  38249. formatTooltip: function(t) {
  38250. var e = this.getData()
  38251. , i = this.getRawValue(t)
  38252. , n = L(i) ? O(i, lC).join(", ") : lC(i)
  38253. , o = e.getName(t)
  38254. , a = uC(this.name);
  38255. return null == i && !o || (a += "<br />"),
  38256. o && (a += uC(o),
  38257. null != i && (a += " : ")),
  38258. null != i && (a += uC(n)),
  38259. a
  38260. },
  38261. getData: function() {
  38262. return this._data
  38263. },
  38264. setData: function(t) {
  38265. this._data = t
  38266. }
  38267. });
  38268. b(cC, Xh),
  38269. cC.extend({
  38270. type: "markPoint",
  38271. defaultOption: {
  38272. zlevel: 0,
  38273. z: 5,
  38274. symbol: "pin",
  38275. symbolSize: 50,
  38276. tooltip: {
  38277. trigger: "item"
  38278. },
  38279. label: {
  38280. show: !0,
  38281. position: "inside"
  38282. },
  38283. itemStyle: {
  38284. borderWidth: 2
  38285. },
  38286. emphasis: {
  38287. label: {
  38288. show: !0
  38289. }
  38290. }
  38291. }
  38292. });
  38293. var dC = _;
  38294. function fC(t, e, i, n, o, a) {
  38295. var r = []
  38296. , s = fp(e, n) ? e.getCalculationInfo("stackResultDimension") : n
  38297. , l = _C(e, s, t)
  38298. , u = e.indicesOfNearest(s, l)[0];
  38299. r[o] = e.get(i, u),
  38300. r[a] = e.get(s, u);
  38301. var h = e.get(n, u)
  38302. , c = Vl(e.get(n, u));
  38303. return 0 <= (c = Math.min(c, 20)) && (r[a] = +r[a].toFixed(c)),
  38304. [r, h]
  38305. }
  38306. var pC = T
  38307. , gC = {
  38308. min: pC(fC, "min"),
  38309. max: pC(fC, "max"),
  38310. average: pC(fC, "average")
  38311. };
  38312. function mC(t, e) {
  38313. var i = t.getData()
  38314. , n = t.coordinateSystem;
  38315. if (e && !function(t) {
  38316. return !isNaN(parseFloat(t.x)) && !isNaN(parseFloat(t.y))
  38317. }(e) && !L(e.coord) && n) {
  38318. var o = n.dimensions
  38319. , a = vC(e, i, n, t);
  38320. if ((e = k(e)).type && gC[e.type] && a.baseAxis && a.valueAxis) {
  38321. var r = dC(o, a.baseAxis.dim)
  38322. , s = dC(o, a.valueAxis.dim)
  38323. , l = gC[e.type](i, a.baseDataDim, a.valueDataDim, r, s);
  38324. e.coord = l[0],
  38325. e.value = l[1]
  38326. } else {
  38327. for (var u = [null != e.xAxis ? e.xAxis : e.radiusAxis, null != e.yAxis ? e.yAxis : e.angleAxis], h = 0; h < 2; h++)
  38328. gC[u[h]] && (u[h] = _C(i, i.mapDimension(o[h]), u[h]));
  38329. e.coord = u
  38330. }
  38331. }
  38332. return e
  38333. }
  38334. function vC(t, e, i, n) {
  38335. var o = {};
  38336. return null != t.valueIndex || null != t.valueDim ? (o.valueDataDim = null != t.valueIndex ? e.getDimension(t.valueIndex) : t.valueDim,
  38337. o.valueAxis = i.getAxis(function(t, e) {
  38338. var i = t.getData()
  38339. , n = i.dimensions;
  38340. e = i.getDimension(e);
  38341. for (var o = 0; o < n.length; o++) {
  38342. var a = i.getDimensionInfo(n[o]);
  38343. if (a.name === e)
  38344. return a.coordDim
  38345. }
  38346. }(n, o.valueDataDim)),
  38347. o.baseAxis = i.getOtherAxis(o.valueAxis),
  38348. o.baseDataDim = e.mapDimension(o.baseAxis.dim)) : (o.baseAxis = n.getBaseAxis(),
  38349. o.valueAxis = i.getOtherAxis(o.baseAxis),
  38350. o.baseDataDim = e.mapDimension(o.baseAxis.dim),
  38351. o.valueDataDim = e.mapDimension(o.valueAxis.dim)),
  38352. o
  38353. }
  38354. function yC(t, e) {
  38355. return !(t && t.containData && e.coord && !function(t) {
  38356. return !(isNaN(parseFloat(t.x)) && isNaN(parseFloat(t.y)))
  38357. }(e)) || t.containData(e.coord)
  38358. }
  38359. function xC(t, e, i, n) {
  38360. return n < 2 ? t.coord && t.coord[n] : t.value
  38361. }
  38362. function _C(t, e, i) {
  38363. if ("average" !== i)
  38364. return "median" === i ? t.getMedian(e) : t.getDataExtent(e, !0)["max" === i ? 1 : 0];
  38365. var n = 0
  38366. , o = 0;
  38367. return t.each(e, function(t, e) {
  38368. isNaN(t) || (n += t,
  38369. o++)
  38370. }),
  38371. n / o
  38372. }
  38373. var wC = Af({
  38374. type: "marker",
  38375. init: function() {
  38376. this.markerGroupMap = Q()
  38377. },
  38378. render: function(t, i, n) {
  38379. var e = this.markerGroupMap;
  38380. e.each(function(t) {
  38381. t.__keep = !1
  38382. });
  38383. var o = this.type + "Model";
  38384. i.eachSeries(function(t) {
  38385. var e = t[o];
  38386. e && this.renderSeries(t, e, i, n)
  38387. }, this),
  38388. e.each(function(t) {
  38389. t.__keep || this.group.remove(t.group)
  38390. }, this)
  38391. },
  38392. renderSeries: function() {}
  38393. });
  38394. function bC(s, l, u) {
  38395. var h = l.coordinateSystem;
  38396. s.each(function(t) {
  38397. var e, i = s.getItemModel(t), n = Rl(i.get("x"), u.getWidth()), o = Rl(i.get("y"), u.getHeight());
  38398. if (isNaN(n) || isNaN(o)) {
  38399. if (l.getMarkerPosition)
  38400. e = l.getMarkerPosition(s.getValues(s.dimensions, t));
  38401. else if (h) {
  38402. var a = s.get(h.dimensions[0], t)
  38403. , r = s.get(h.dimensions[1], t);
  38404. e = h.dataToPoint([a, r])
  38405. }
  38406. } else
  38407. e = [n, o];
  38408. isNaN(n) || (e[0] = n),
  38409. isNaN(o) || (e[1] = o),
  38410. s.setItemLayout(t, e)
  38411. })
  38412. }
  38413. wC.extend({
  38414. type: "markPoint",
  38415. updateTransform: function(t, e, i) {
  38416. e.eachSeries(function(t) {
  38417. var e = t.markPointModel;
  38418. e && (bC(e.getData(), t, i),
  38419. this.markerGroupMap.get(t.id).updateLayout(e))
  38420. }, this)
  38421. },
  38422. renderSeries: function(t, l, e, i) {
  38423. var n = t.coordinateSystem
  38424. , o = t.id
  38425. , u = t.getData()
  38426. , a = this.markerGroupMap
  38427. , r = a.get(o) || a.set(o, new im)
  38428. , h = function(t, e, i) {
  38429. var n;
  38430. n = t ? O(t && t.dimensions, function(t) {
  38431. return D({
  38432. name: t
  38433. }, e.getData().getDimensionInfo(e.getData().mapDimension(t)) || {})
  38434. }) : [{
  38435. name: "value",
  38436. type: "float"
  38437. }];
  38438. var o = new Yf(n,i)
  38439. , a = O(i.get("data"), T(mC, e));
  38440. t && (a = M(a, T(yC, t)));
  38441. return o.initData(a, null, t ? xC : function(t) {
  38442. return t.value
  38443. }
  38444. ),
  38445. o
  38446. }(n, t, l);
  38447. l.setData(h),
  38448. bC(l.getData(), t, i),
  38449. h.each(function(t) {
  38450. var e = h.getItemModel(t)
  38451. , i = e.getShallow("symbol")
  38452. , n = e.getShallow("symbolSize")
  38453. , o = C(i)
  38454. , a = C(n);
  38455. if (o || a) {
  38456. var r = l.getRawValue(t)
  38457. , s = l.getDataParams(t);
  38458. o && (i = i(r, s)),
  38459. a && (n = n(r, s))
  38460. }
  38461. h.setItemVisual(t, {
  38462. symbol: i,
  38463. symbolSize: n,
  38464. color: e.get("itemStyle.color") || u.getVisual("color")
  38465. })
  38466. }),
  38467. r.updateData(h),
  38468. this.group.add(r.group),
  38469. h.eachItemGraphicEl(function(t) {
  38470. t.traverse(function(t) {
  38471. t.dataModel = l
  38472. })
  38473. }),
  38474. r.__keep = !0,
  38475. r.group.silent = l.get("silent") || t.get("silent")
  38476. }
  38477. }),
  38478. yf(function(t) {
  38479. t.markPoint = t.markPoint || {}
  38480. }),
  38481. cC.extend({
  38482. type: "markLine",
  38483. defaultOption: {
  38484. zlevel: 0,
  38485. z: 5,
  38486. symbol: ["circle", "arrow"],
  38487. symbolSize: [8, 16],
  38488. precision: 2,
  38489. tooltip: {
  38490. trigger: "item"
  38491. },
  38492. label: {
  38493. show: !0,
  38494. position: "end",
  38495. distance: 5
  38496. },
  38497. lineStyle: {
  38498. type: "dashed"
  38499. },
  38500. emphasis: {
  38501. label: {
  38502. show: !0
  38503. },
  38504. lineStyle: {
  38505. width: 3
  38506. }
  38507. },
  38508. animationEasing: "linear"
  38509. }
  38510. });
  38511. function SC(t, e, i, n) {
  38512. var o = t.getData()
  38513. , a = n.type;
  38514. if (!L(n) && ("min" === a || "max" === a || "average" === a || "median" === a || null != n.xAxis || null != n.yAxis)) {
  38515. var r, s;
  38516. if (null != n.yAxis || null != n.xAxis)
  38517. r = e.getAxis(null != n.yAxis ? "y" : "x"),
  38518. s = W(n.yAxis, n.xAxis);
  38519. else {
  38520. var l = vC(n, o, e, t);
  38521. r = l.valueAxis,
  38522. s = _C(o, pp(o, l.valueDataDim), a)
  38523. }
  38524. var u = "x" === r.dim ? 0 : 1
  38525. , h = 1 - u
  38526. , c = k(n)
  38527. , d = {};
  38528. c.type = null,
  38529. c.coord = [],
  38530. d.coord = [],
  38531. c.coord[h] = -1 / 0,
  38532. d.coord[h] = 1 / 0;
  38533. var f = i.get("precision");
  38534. 0 <= f && "number" == typeof s && (s = +s.toFixed(Math.min(f, 20))),
  38535. c.coord[u] = d.coord[u] = s,
  38536. n = [c, d, {
  38537. type: a,
  38538. valueIndex: n.valueIndex,
  38539. value: s
  38540. }]
  38541. }
  38542. return (n = [mC(t, n[0]), mC(t, n[1]), P({}, n[2])])[2].type = n[2].type || "",
  38543. m(n[2], n[0]),
  38544. m(n[2], n[1]),
  38545. n
  38546. }
  38547. function MC(t) {
  38548. return !isNaN(t) && !isFinite(t)
  38549. }
  38550. function IC(t, e, i, n) {
  38551. var o = 1 - t
  38552. , a = n.dimensions[t];
  38553. return MC(e[o]) && MC(i[o]) && e[t] === i[t] && n.getAxis(a).containData(e[t])
  38554. }
  38555. function TC(t, e) {
  38556. if ("cartesian2d" === t.type) {
  38557. var i = e[0].coord
  38558. , n = e[1].coord;
  38559. if (i && n && (IC(1, i, n, t) || IC(0, i, n, t)))
  38560. return !0
  38561. }
  38562. return yC(t, e[0]) && yC(t, e[1])
  38563. }
  38564. function AC(t, e, i, n, o) {
  38565. var a, r = n.coordinateSystem, s = t.getItemModel(e), l = Rl(s.get("x"), o.getWidth()), u = Rl(s.get("y"), o.getHeight());
  38566. if (isNaN(l) || isNaN(u)) {
  38567. if (n.getMarkerPosition)
  38568. a = n.getMarkerPosition(t.getValues(t.dimensions, e));
  38569. else {
  38570. var h = r.dimensions
  38571. , c = t.get(h[0], e)
  38572. , d = t.get(h[1], e);
  38573. a = r.dataToPoint([c, d])
  38574. }
  38575. if ("cartesian2d" === r.type) {
  38576. var f = r.getAxis("x")
  38577. , p = r.getAxis("y");
  38578. h = r.dimensions;
  38579. MC(t.get(h[0], e)) ? a[0] = f.toGlobalCoord(f.getExtent()[i ? 0 : 1]) : MC(t.get(h[1], e)) && (a[1] = p.toGlobalCoord(p.getExtent()[i ? 0 : 1]))
  38580. }
  38581. isNaN(l) || (a[0] = l),
  38582. isNaN(u) || (a[1] = u)
  38583. } else
  38584. a = [l, u];
  38585. t.setItemLayout(e, a)
  38586. }
  38587. wC.extend({
  38588. type: "markLine",
  38589. updateTransform: function(t, e, a) {
  38590. e.eachSeries(function(e) {
  38591. var t = e.markLineModel;
  38592. if (t) {
  38593. var i = t.getData()
  38594. , n = t.__from
  38595. , o = t.__to;
  38596. n.each(function(t) {
  38597. AC(n, t, !0, e, a),
  38598. AC(o, t, !1, e, a)
  38599. }),
  38600. i.each(function(t) {
  38601. i.setItemLayout(t, [n.getItemLayout(t), o.getItemLayout(t)])
  38602. }),
  38603. this.markerGroupMap.get(e.id).updateLayout()
  38604. }
  38605. }, this)
  38606. },
  38607. renderSeries: function(o, i, t, a) {
  38608. var e = o.coordinateSystem
  38609. , n = o.id
  38610. , r = o.getData()
  38611. , s = this.markerGroupMap
  38612. , l = s.get(n) || s.set(n, new pw);
  38613. this.group.add(l.group);
  38614. var u = function(t, e, i) {
  38615. var n;
  38616. n = t ? O(t && t.dimensions, function(t) {
  38617. return D({
  38618. name: t
  38619. }, e.getData().getDimensionInfo(e.getData().mapDimension(t)) || {})
  38620. }) : [{
  38621. name: "value",
  38622. type: "float"
  38623. }];
  38624. var o = new Yf(n,i)
  38625. , a = new Yf(n,i)
  38626. , r = new Yf([],i)
  38627. , s = O(i.get("data"), T(SC, e, t, i));
  38628. t && (s = M(s, T(TC, t)));
  38629. var l = t ? xC : function(t) {
  38630. return t.value
  38631. }
  38632. ;
  38633. return o.initData(O(s, function(t) {
  38634. return t[0]
  38635. }), null, l),
  38636. a.initData(O(s, function(t) {
  38637. return t[1]
  38638. }), null, l),
  38639. r.initData(O(s, function(t) {
  38640. return t[2]
  38641. })),
  38642. r.hasItemOption = !0,
  38643. {
  38644. from: o,
  38645. to: a,
  38646. line: r
  38647. }
  38648. }(e, o, i)
  38649. , h = u.from
  38650. , c = u.to
  38651. , d = u.line;
  38652. i.__from = h,
  38653. i.__to = c,
  38654. i.setData(d);
  38655. var f = i.get("symbol")
  38656. , p = i.get("symbolSize");
  38657. function g(t, e, i) {
  38658. var n = t.getItemModel(e);
  38659. AC(t, e, i, o, a),
  38660. t.setItemVisual(e, {
  38661. symbolSize: n.get("symbolSize") || p[i ? 0 : 1],
  38662. symbol: n.get("symbol", !0) || f[i ? 0 : 1],
  38663. color: n.get("itemStyle.color") || r.getVisual("color")
  38664. })
  38665. }
  38666. L(f) || (f = [f, f]),
  38667. "number" == typeof p && (p = [p, p]),
  38668. u.from.each(function(t) {
  38669. g(h, t, !0),
  38670. g(c, t, !1)
  38671. }),
  38672. d.each(function(t) {
  38673. var e = d.getItemModel(t).get("lineStyle.color");
  38674. d.setItemVisual(t, {
  38675. color: e || h.getItemVisual(t, "color")
  38676. }),
  38677. d.setItemLayout(t, [h.getItemLayout(t), c.getItemLayout(t)]),
  38678. d.setItemVisual(t, {
  38679. fromSymbolSize: h.getItemVisual(t, "symbolSize"),
  38680. fromSymbol: h.getItemVisual(t, "symbol"),
  38681. toSymbolSize: c.getItemVisual(t, "symbolSize"),
  38682. toSymbol: c.getItemVisual(t, "symbol")
  38683. })
  38684. }),
  38685. l.updateData(d),
  38686. u.line.eachItemGraphicEl(function(t, e) {
  38687. t.traverse(function(t) {
  38688. t.dataModel = i
  38689. })
  38690. }),
  38691. l.__keep = !0,
  38692. l.group.silent = i.get("silent") || o.get("silent")
  38693. }
  38694. }),
  38695. yf(function(t) {
  38696. t.markLine = t.markLine || {}
  38697. }),
  38698. cC.extend({
  38699. type: "markArea",
  38700. defaultOption: {
  38701. zlevel: 0,
  38702. z: 1,
  38703. tooltip: {
  38704. trigger: "item"
  38705. },
  38706. animation: !1,
  38707. label: {
  38708. show: !0,
  38709. position: "top"
  38710. },
  38711. itemStyle: {
  38712. borderWidth: 0
  38713. },
  38714. emphasis: {
  38715. label: {
  38716. show: !0,
  38717. position: "top"
  38718. }
  38719. }
  38720. }
  38721. });
  38722. function DC(t, e, i, n) {
  38723. var o = mC(t, n[0])
  38724. , a = mC(t, n[1])
  38725. , r = W
  38726. , s = o.coord
  38727. , l = a.coord;
  38728. s[0] = r(s[0], -1 / 0),
  38729. s[1] = r(s[1], -1 / 0),
  38730. l[0] = r(l[0], 1 / 0),
  38731. l[1] = r(l[1], 1 / 0);
  38732. var u = p([{}, o, a]);
  38733. return u.coord = [o.coord, a.coord],
  38734. u.x0 = o.x,
  38735. u.y0 = o.y,
  38736. u.x1 = a.x,
  38737. u.y1 = a.y,
  38738. u
  38739. }
  38740. function CC(t) {
  38741. return !isNaN(t) && !isFinite(t)
  38742. }
  38743. function LC(t, e, i) {
  38744. var n = 1 - t;
  38745. return CC(e[n]) && CC(i[n])
  38746. }
  38747. function kC(t, e) {
  38748. var i = e.coord[0]
  38749. , n = e.coord[1];
  38750. return !("cartesian2d" !== t.type || !i || !n || !LC(1, i, n) && !LC(0, i, n)) || (yC(t, {
  38751. coord: i,
  38752. x: e.x0,
  38753. y: e.y0
  38754. }) || yC(t, {
  38755. coord: n,
  38756. x: e.x1,
  38757. y: e.y1
  38758. }))
  38759. }
  38760. function PC(t, e, i, n, o) {
  38761. var a, r = n.coordinateSystem, s = t.getItemModel(e), l = Rl(s.get(i[0]), o.getWidth()), u = Rl(s.get(i[1]), o.getHeight());
  38762. if (isNaN(l) || isNaN(u)) {
  38763. if (n.getMarkerPosition)
  38764. a = n.getMarkerPosition(t.getValues(i, e));
  38765. else {
  38766. var h = [f = t.get(i[0], e), p = t.get(i[1], e)];
  38767. r.clampData && r.clampData(h, h),
  38768. a = r.dataToPoint(h, !0)
  38769. }
  38770. if ("cartesian2d" === r.type) {
  38771. var c = r.getAxis("x")
  38772. , d = r.getAxis("y")
  38773. , f = t.get(i[0], e)
  38774. , p = t.get(i[1], e);
  38775. CC(f) ? a[0] = c.toGlobalCoord(c.getExtent()["x0" === i[0] ? 0 : 1]) : CC(p) && (a[1] = d.toGlobalCoord(d.getExtent()["y0" === i[1] ? 0 : 1]))
  38776. }
  38777. isNaN(l) || (a[0] = l),
  38778. isNaN(u) || (a[1] = u)
  38779. } else
  38780. a = [l, u];
  38781. return a
  38782. }
  38783. var NC = [["x0", "y0"], ["x1", "y0"], ["x1", "y1"], ["x0", "y1"]];
  38784. wC.extend({
  38785. type: "markArea",
  38786. updateTransform: function(t, e, o) {
  38787. e.eachSeries(function(i) {
  38788. var t = i.markAreaModel;
  38789. if (t) {
  38790. var n = t.getData();
  38791. n.each(function(e) {
  38792. var t = O(NC, function(t) {
  38793. return PC(n, e, t, i, o)
  38794. });
  38795. n.setItemLayout(e, t),
  38796. n.getItemGraphicEl(e).setShape("points", t)
  38797. })
  38798. }
  38799. }, this)
  38800. },
  38801. renderSeries: function(i, r, t, n) {
  38802. var e = i.coordinateSystem
  38803. , o = i.id
  38804. , a = i.getData()
  38805. , s = this.markerGroupMap
  38806. , l = s.get(o) || s.set(o, {
  38807. group: new Ci
  38808. });
  38809. this.group.add(l.group),
  38810. l.__keep = !0;
  38811. var u = function(t, i, e) {
  38812. var n, o;
  38813. o = t ? (n = O(t && t.dimensions, function(t) {
  38814. var e = i.getData();
  38815. return D({
  38816. name: t
  38817. }, e.getDimensionInfo(e.mapDimension(t)) || {})
  38818. }),
  38819. new Yf(O(["x0", "y0", "x1", "y1"], function(t, e) {
  38820. return {
  38821. name: t,
  38822. type: n[e % 2].type
  38823. }
  38824. }),e)) : new Yf(n = [{
  38825. name: "value",
  38826. type: "float"
  38827. }],e);
  38828. var a = O(e.get("data"), T(DC, i, t, e));
  38829. t && (a = M(a, T(kC, t)));
  38830. var r = t ? function(t, e, i, n) {
  38831. return t.coord[Math.floor(n / 2)][n % 2]
  38832. }
  38833. : function(t) {
  38834. return t.value
  38835. }
  38836. ;
  38837. return o.initData(a, null, r),
  38838. o.hasItemOption = !0,
  38839. o
  38840. }(e, i, r);
  38841. r.setData(u),
  38842. u.each(function(e) {
  38843. u.setItemLayout(e, O(NC, function(t) {
  38844. return PC(u, e, t, i, n)
  38845. })),
  38846. u.setItemVisual(e, {
  38847. color: a.getVisual("color")
  38848. })
  38849. }),
  38850. u.diff(l.__data).add(function(t) {
  38851. var e = new Qr({
  38852. shape: {
  38853. points: u.getItemLayout(t)
  38854. }
  38855. });
  38856. u.setItemGraphicEl(t, e),
  38857. l.group.add(e)
  38858. }).update(function(t, e) {
  38859. var i = l.__data.getItemGraphicEl(e);
  38860. cl(i, {
  38861. shape: {
  38862. points: u.getItemLayout(t)
  38863. }
  38864. }, r, t),
  38865. l.group.add(i),
  38866. u.setItemGraphicEl(t, i)
  38867. }).remove(function(t) {
  38868. var e = l.__data.getItemGraphicEl(t);
  38869. l.group.remove(e)
  38870. }).execute(),
  38871. u.eachItemGraphicEl(function(t, e) {
  38872. var i = u.getItemModel(e)
  38873. , n = i.getModel("label")
  38874. , o = i.getModel("emphasis.label")
  38875. , a = u.getItemVisual(e, "color");
  38876. t.useStyle(D(i.getModel("itemStyle").getItemStyle(), {
  38877. fill: Ke(a, .4),
  38878. stroke: a
  38879. })),
  38880. t.hoverStyle = i.getModel("emphasis.itemStyle").getItemStyle(),
  38881. el(t.style, t.hoverStyle, n, o, {
  38882. labelFetcher: r,
  38883. labelDataIndex: e,
  38884. defaultText: u.getName(e) || "",
  38885. isRectText: !0,
  38886. autoColor: a
  38887. }),
  38888. $s(t, {}),
  38889. t.dataModel = r
  38890. }),
  38891. l.__data = u,
  38892. l.group.silent = r.get("silent") || i.get("silent")
  38893. }
  38894. }),
  38895. yf(function(t) {
  38896. t.markArea = t.markArea || {}
  38897. });
  38898. var OC = Oc.legend.selector
  38899. , EC = {
  38900. all: {
  38901. type: "all",
  38902. title: k(OC.all)
  38903. },
  38904. inverse: {
  38905. type: "inverse",
  38906. title: k(OC.inverse)
  38907. }
  38908. }
  38909. , RC = Tf({
  38910. type: "legend.plain",
  38911. dependencies: ["series"],
  38912. layoutMode: {
  38913. type: "box",
  38914. ignoreSize: !0
  38915. },
  38916. init: function(t, e, i) {
  38917. this.mergeDefaultAndTheme(t, i),
  38918. t.selected = t.selected || {},
  38919. this._updateSelector(t)
  38920. },
  38921. mergeOption: function(t) {
  38922. RC.superCall(this, "mergeOption", t),
  38923. this._updateSelector(t)
  38924. },
  38925. _updateSelector: function(t) {
  38926. var i = t.selector;
  38927. !0 === i && (i = t.selector = ["all", "inverse"]),
  38928. L(i) && E(i, function(t, e) {
  38929. R(t) && (t = {
  38930. type: t
  38931. }),
  38932. i[e] = m(t, EC[t.type])
  38933. })
  38934. },
  38935. optionUpdated: function() {
  38936. this._updateData(this.ecModel);
  38937. var t = this._data;
  38938. if (t[0] && "single" === this.get("selectedMode")) {
  38939. for (var e = !1, i = 0; i < t.length; i++) {
  38940. var n = t[i].get("name");
  38941. if (this.isSelected(n)) {
  38942. this.select(n),
  38943. e = !0;
  38944. break
  38945. }
  38946. }
  38947. e || this.select(t[0].get("name"))
  38948. }
  38949. },
  38950. _updateData: function(o) {
  38951. var a = []
  38952. , r = [];
  38953. o.eachRawSeries(function(t) {
  38954. var e, i = t.name;
  38955. if (r.push(i),
  38956. t.legendVisualProvider) {
  38957. var n = t.legendVisualProvider.getAllNames();
  38958. o.isSeriesFiltered(t) || (r = r.concat(n)),
  38959. n.length ? a = a.concat(n) : e = !0
  38960. } else
  38961. e = !0;
  38962. e && Uo(t) && a.push(t.name)
  38963. }),
  38964. this._availableNames = r;
  38965. var t = O(this.get("data") || a, function(t) {
  38966. return "string" != typeof t && "number" != typeof t || (t = {
  38967. name: t
  38968. }),
  38969. new Cl(t,this,this.ecModel)
  38970. }, this);
  38971. this._data = t
  38972. },
  38973. getData: function() {
  38974. return this._data
  38975. },
  38976. select: function(t) {
  38977. var e = this.option.selected;
  38978. "single" === this.get("selectedMode") && E(this._data, function(t) {
  38979. e[t.get("name")] = !1
  38980. });
  38981. e[t] = !0
  38982. },
  38983. unSelect: function(t) {
  38984. "single" !== this.get("selectedMode") && (this.option.selected[t] = !1)
  38985. },
  38986. toggleSelected: function(t) {
  38987. var e = this.option.selected;
  38988. e.hasOwnProperty(t) || (e[t] = !0),
  38989. this[e[t] ? "unSelect" : "select"](t)
  38990. },
  38991. allSelect: function() {
  38992. var t = this._data
  38993. , e = this.option.selected;
  38994. E(t, function(t) {
  38995. e[t.get("name", !0)] = !0
  38996. })
  38997. },
  38998. inverseSelect: function() {
  38999. var t = this._data
  39000. , i = this.option.selected;
  39001. E(t, function(t) {
  39002. var e = t.get("name", !0);
  39003. i.hasOwnProperty(e) || (i[e] = !0),
  39004. i[e] = !i[e]
  39005. })
  39006. },
  39007. isSelected: function(t) {
  39008. var e = this.option.selected;
  39009. return !(e.hasOwnProperty(t) && !e[t]) && 0 <= _(this._availableNames, t)
  39010. },
  39011. getOrient: function() {
  39012. return "vertical" === this.get("orient") ? {
  39013. index: 1,
  39014. name: "vertical"
  39015. } : {
  39016. index: 0,
  39017. name: "horizontal"
  39018. }
  39019. },
  39020. defaultOption: {
  39021. zlevel: 0,
  39022. z: 4,
  39023. show: !0,
  39024. orient: "horizontal",
  39025. left: "center",
  39026. top: 0,
  39027. align: "auto",
  39028. backgroundColor: "rgba(0,0,0,0)",
  39029. borderColor: "#ccc",
  39030. borderRadius: 0,
  39031. borderWidth: 0,
  39032. padding: 5,
  39033. itemGap: 10,
  39034. itemWidth: 25,
  39035. itemHeight: 14,
  39036. inactiveColor: "#ccc",
  39037. inactiveBorderColor: "#ccc",
  39038. itemStyle: {
  39039. borderWidth: 0
  39040. },
  39041. textStyle: {
  39042. color: "#333"
  39043. },
  39044. selectedMode: !0,
  39045. selector: !1,
  39046. selectorLabel: {
  39047. show: !0,
  39048. borderRadius: 10,
  39049. padding: [3, 5, 3, 5],
  39050. fontSize: 12,
  39051. fontFamily: " sans-serif",
  39052. color: "#666",
  39053. borderWidth: 1,
  39054. borderColor: "#666"
  39055. },
  39056. emphasis: {
  39057. selectorLabel: {
  39058. show: !0,
  39059. color: "#eee",
  39060. backgroundColor: "#666"
  39061. }
  39062. },
  39063. selectorPosition: "auto",
  39064. selectorItemGap: 7,
  39065. selectorButtonGap: 10,
  39066. tooltip: {
  39067. show: !1
  39068. }
  39069. }
  39070. });
  39071. function zC(t, e, i) {
  39072. var o, a = {}, r = "toggleSelected" === t;
  39073. return i.eachComponent("legend", function(n) {
  39074. r && null != o ? n[o ? "select" : "unSelect"](e.name) : "allSelect" === t || "inverseSelect" === t ? n[t]() : (n[t](e.name),
  39075. o = n.isSelected(e.name)),
  39076. E(n.getData(), function(t) {
  39077. var e = t.get("name");
  39078. if ("\n" !== e && "" !== e) {
  39079. var i = n.isSelected(e);
  39080. a.hasOwnProperty(e) ? a[e] = a[e] && i : a[e] = i
  39081. }
  39082. })
  39083. }),
  39084. "allSelect" === t || "inverseSelect" === t ? {
  39085. selected: a
  39086. } : {
  39087. name: e.name,
  39088. selected: a
  39089. }
  39090. }
  39091. _f("legendToggleSelect", "legendselectchanged", T(zC, "toggleSelected")),
  39092. _f("legendAllSelect", "legendselectall", T(zC, "allSelect")),
  39093. _f("legendInverseSelect", "legendinverseselect", T(zC, "inverseSelect")),
  39094. _f("legendSelect", "legendselected", T(zC, "select")),
  39095. _f("legendUnSelect", "legendunselected", T(zC, "unSelect"));
  39096. var BC = T
  39097. , VC = E
  39098. , GC = Ci
  39099. , FC = Af({
  39100. type: "legend.plain",
  39101. newlineDisabled: !1,
  39102. init: function() {
  39103. this.group.add(this._contentGroup = new GC),
  39104. this._backgroundEl,
  39105. this.group.add(this._selectorGroup = new GC),
  39106. this._isFirstRender = !0
  39107. },
  39108. getContentGroup: function() {
  39109. return this._contentGroup
  39110. },
  39111. getSelectorGroup: function() {
  39112. return this._selectorGroup
  39113. },
  39114. render: function(t, e, i) {
  39115. var n = this._isFirstRender;
  39116. if (this._isFirstRender = !1,
  39117. this.resetInner(),
  39118. t.get("show", !0)) {
  39119. var o = t.get("align")
  39120. , a = t.get("orient");
  39121. o && "auto" !== o || (o = "right" === t.get("left") && "vertical" === a ? "right" : "left");
  39122. var r = t.get("selector", !0)
  39123. , s = t.get("selectorPosition", !0);
  39124. !r || s && "auto" !== s || (s = "horizontal" === a ? "end" : "start"),
  39125. this.renderInner(o, t, e, i, r, a, s);
  39126. var l = t.getBoxLayoutParams()
  39127. , u = {
  39128. width: i.getWidth(),
  39129. height: i.getHeight()
  39130. }
  39131. , h = t.get("padding")
  39132. , c = bu(l, u, h)
  39133. , d = this.layoutInner(t, o, c, n, r, s)
  39134. , f = bu(D({
  39135. width: d.width,
  39136. height: d.height
  39137. }, l), u, h);
  39138. this.group.attr("position", [f.x - d.x, f.y - d.y]),
  39139. this.group.add(this._backgroundEl = rA(d, t))
  39140. }
  39141. },
  39142. resetInner: function() {
  39143. this.getContentGroup().removeAll(),
  39144. this._backgroundEl && this.group.remove(this._backgroundEl),
  39145. this.getSelectorGroup().removeAll()
  39146. },
  39147. renderInner: function(u, h, c, d, t, e, i) {
  39148. var f = this.getContentGroup()
  39149. , p = Q()
  39150. , g = h.get("selectedMode")
  39151. , m = [];
  39152. c.eachRawSeries(function(t) {
  39153. t.get("legendHoverLink") || m.push(t.id)
  39154. }),
  39155. VC(h.getData(), function(a, r) {
  39156. var s = a.get("name");
  39157. if (this.newlineDisabled || "" !== s && "\n" !== s) {
  39158. var t = c.getSeriesByName(s)[0];
  39159. if (!p.get(s))
  39160. if (t) {
  39161. var e = t.getData()
  39162. , i = e.getVisual("color")
  39163. , n = e.getVisual("borderColor");
  39164. "function" == typeof i && (i = i(t.getDataParams(0))),
  39165. "function" == typeof n && (n = n(t.getDataParams(0)));
  39166. var o = e.getVisual("legendSymbol") || "roundRect"
  39167. , l = e.getVisual("symbol");
  39168. this._createItem(s, r, a, h, o, l, u, i, n, g).on("click", BC(HC, s, null, d, m)).on("mouseover", BC(ZC, t.name, null, d, m)).on("mouseout", BC(UC, t.name, null, d, m)),
  39169. p.set(s, !0)
  39170. } else
  39171. c.eachRawSeries(function(t) {
  39172. if (!p.get(s) && t.legendVisualProvider) {
  39173. var e = t.legendVisualProvider;
  39174. if (!e.containName(s))
  39175. return;
  39176. var i = e.indexOfName(s)
  39177. , n = e.getItemVisual(i, "color")
  39178. , o = e.getItemVisual(i, "borderColor");
  39179. this._createItem(s, r, a, h, "roundRect", null, u, n, o, g).on("click", BC(HC, null, s, d, m)).on("mouseover", BC(ZC, null, s, d, m)).on("mouseout", BC(UC, null, s, d, m)),
  39180. p.set(s, !0)
  39181. }
  39182. }, this)
  39183. } else
  39184. f.add(new GC({
  39185. newline: !0
  39186. }))
  39187. }, this),
  39188. t && this._createSelector(t, h, d, e, i)
  39189. },
  39190. _createSelector: function(t, a, r, e, i) {
  39191. var s = this.getSelectorGroup();
  39192. VC(t, function(t) {
  39193. !function(t) {
  39194. var e = t.type
  39195. , i = new Ur({
  39196. style: {
  39197. x: 0,
  39198. y: 0,
  39199. align: "center",
  39200. verticalAlign: "middle"
  39201. },
  39202. onclick: function() {
  39203. r.dispatchAction({
  39204. type: "all" === e ? "legendAllSelect" : "legendInverseSelect"
  39205. })
  39206. }
  39207. });
  39208. s.add(i);
  39209. var n = a.getModel("selectorLabel")
  39210. , o = a.getModel("emphasis.selectorLabel");
  39211. el(i.style, i.hoverStyle = {}, n, o, {
  39212. defaultText: t.title,
  39213. isRectText: !1
  39214. }),
  39215. $s(i)
  39216. }(t)
  39217. })
  39218. },
  39219. _createItem: function(t, e, i, n, o, a, r, s, l, u) {
  39220. var h = n.get("itemWidth")
  39221. , c = n.get("itemHeight")
  39222. , d = n.get("inactiveColor")
  39223. , f = n.get("inactiveBorderColor")
  39224. , p = n.get("symbolKeepAspect")
  39225. , g = n.getModel("itemStyle")
  39226. , m = n.isSelected(t)
  39227. , v = new GC
  39228. , y = i.getModel("textStyle")
  39229. , x = i.get("icon")
  39230. , _ = i.getModel("tooltip")
  39231. , w = _.parentModel
  39232. , b = wg(o = x || o, 0, 0, h, c, m ? s : d, null == p || p);
  39233. if (v.add(WC(b, o, g, l, f, m)),
  39234. !x && a && (a !== o || "none" === a)) {
  39235. var S = .8 * c;
  39236. "none" === a && (a = "circle");
  39237. var M = wg(a, (h - S) / 2, (c - S) / 2, S, S, m ? s : d, null == p || p);
  39238. v.add(WC(M, a, g, l, f, m))
  39239. }
  39240. var I = "left" === r ? h + 5 : -5
  39241. , T = r
  39242. , A = n.get("formatter")
  39243. , D = t;
  39244. "string" == typeof A && A ? D = A.replace("{name}", null != t ? t : "") : "function" == typeof A && (D = A(t)),
  39245. v.add(new Ur({
  39246. style: nl({}, y, {
  39247. text: D,
  39248. x: I,
  39249. y: c / 2,
  39250. textFill: m ? y.getTextColor() : d,
  39251. textAlign: T,
  39252. textVerticalAlign: "middle"
  39253. })
  39254. }));
  39255. var C = new rs({
  39256. shape: v.getBoundingRect(),
  39257. invisible: !0,
  39258. tooltip: _.get("show") ? P({
  39259. content: t,
  39260. formatter: w.get("formatter", !0) || function() {
  39261. return t
  39262. }
  39263. ,
  39264. formatterParams: {
  39265. componentType: "legend",
  39266. legendIndex: n.componentIndex,
  39267. name: t,
  39268. $vars: ["name"]
  39269. }
  39270. }, _.option) : null
  39271. });
  39272. return v.add(C),
  39273. v.eachChild(function(t) {
  39274. t.silent = !0
  39275. }),
  39276. C.silent = !u,
  39277. this.getContentGroup().add(v),
  39278. $s(v),
  39279. v.__legendDataIndex = e,
  39280. v
  39281. },
  39282. layoutInner: function(t, e, i, n, o, a) {
  39283. var r = this.getContentGroup()
  39284. , s = this.getSelectorGroup();
  39285. wu(t.get("orient"), r, t.get("itemGap"), i.width, i.height);
  39286. var l = r.getBoundingRect()
  39287. , u = [-l.x, -l.y];
  39288. if (o) {
  39289. wu("horizontal", s, t.get("selectorItemGap", !0));
  39290. var h = s.getBoundingRect()
  39291. , c = [-h.x, -h.y]
  39292. , d = t.get("selectorButtonGap", !0)
  39293. , f = t.getOrient().index
  39294. , p = 0 === f ? "width" : "height"
  39295. , g = 0 === f ? "height" : "width"
  39296. , m = 0 === f ? "y" : "x";
  39297. "end" === a ? c[f] += l[p] + d : u[f] += h[p] + d,
  39298. c[1 - f] += l[g] / 2 - h[g] / 2,
  39299. s.attr("position", c),
  39300. r.attr("position", u);
  39301. var v = {
  39302. x: 0,
  39303. y: 0
  39304. };
  39305. return v[p] = l[p] + d + h[p],
  39306. v[g] = Math.max(l[g], h[g]),
  39307. v[m] = Math.min(0, h[m] + c[1 - f]),
  39308. v
  39309. }
  39310. return r.attr("position", u),
  39311. this.group.getBoundingRect()
  39312. },
  39313. remove: function() {
  39314. this.getContentGroup().removeAll(),
  39315. this._isFirstRender = !0
  39316. }
  39317. });
  39318. function WC(t, e, i, n, o, a) {
  39319. var r;
  39320. return "line" !== e && e.indexOf("empty") < 0 ? (r = i.getItemStyle(),
  39321. t.style.stroke = n,
  39322. a || (r.stroke = o)) : r = i.getItemStyle(["borderWidth", "borderColor"]),
  39323. t.setStyle(r)
  39324. }
  39325. function HC(t, e, i, n) {
  39326. UC(t, e, i, n),
  39327. i.dispatchAction({
  39328. type: "legendToggleSelect",
  39329. name: null != t ? t : e
  39330. }),
  39331. ZC(t, e, i, n)
  39332. }
  39333. function ZC(t, e, i, n) {
  39334. var o = i.getZr().storage.getDisplayList()[0];
  39335. o && o.useHoverLayer || i.dispatchAction({
  39336. type: "highlight",
  39337. seriesName: t,
  39338. name: e,
  39339. excludeSeriesId: n
  39340. })
  39341. }
  39342. function UC(t, e, i, n) {
  39343. var o = i.getZr().storage.getDisplayList()[0];
  39344. o && o.useHoverLayer || i.dispatchAction({
  39345. type: "downplay",
  39346. seriesName: t,
  39347. name: e,
  39348. excludeSeriesId: n
  39349. })
  39350. }
  39351. xf(Ld.PROCESSOR.SERIES_FILTER, function(t) {
  39352. var i = t.findComponents({
  39353. mainType: "legend"
  39354. });
  39355. i && i.length && t.filterSeries(function(t) {
  39356. for (var e = 0; e < i.length; e++)
  39357. if (!i[e].isSelected(t.name))
  39358. return !1;
  39359. return !0
  39360. })
  39361. }),
  39362. ku.registerSubTypeDefaulter("legend", function() {
  39363. return "plain"
  39364. });
  39365. var XC = RC.extend({
  39366. type: "legend.scroll",
  39367. setScrollDataIndex: function(t) {
  39368. this.option.scrollDataIndex = t
  39369. },
  39370. defaultOption: {
  39371. scrollDataIndex: 0,
  39372. pageButtonItemGap: 5,
  39373. pageButtonGap: null,
  39374. pageButtonPosition: "end",
  39375. pageFormatter: "{current}/{total}",
  39376. pageIcons: {
  39377. horizontal: ["M0,0L12,-10L12,10z", "M0,0L-12,-10L-12,10z"],
  39378. vertical: ["M0,0L20,0L10,-20z", "M0,0L20,0L10,20z"]
  39379. },
  39380. pageIconColor: "#2f4554",
  39381. pageIconInactiveColor: "#aaa",
  39382. pageIconSize: 15,
  39383. pageTextStyle: {
  39384. color: "#333"
  39385. },
  39386. animationDurationUpdate: 800
  39387. },
  39388. init: function(t, e, i, n) {
  39389. var o = Iu(t);
  39390. XC.superCall(this, "init", t, e, i, n),
  39391. YC(this, t, o)
  39392. },
  39393. mergeOption: function(t, e) {
  39394. XC.superCall(this, "mergeOption", t, e),
  39395. YC(this, this.option, t)
  39396. }
  39397. });
  39398. function YC(t, e, i) {
  39399. var n = [1, 1];
  39400. n[t.getOrient().index] = 0,
  39401. Mu(e, i, {
  39402. type: "box",
  39403. ignoreSize: n
  39404. })
  39405. }
  39406. var jC = Ci
  39407. , qC = ["width", "height"]
  39408. , KC = ["x", "y"]
  39409. , $C = FC.extend({
  39410. type: "legend.scroll",
  39411. newlineDisabled: !0,
  39412. init: function() {
  39413. $C.superCall(this, "init"),
  39414. this._currentIndex = 0,
  39415. this.group.add(this._containerGroup = new jC),
  39416. this._containerGroup.add(this.getContentGroup()),
  39417. this.group.add(this._controllerGroup = new jC),
  39418. this._showController
  39419. },
  39420. resetInner: function() {
  39421. $C.superCall(this, "resetInner"),
  39422. this._controllerGroup.removeAll(),
  39423. this._containerGroup.removeClipPath(),
  39424. this._containerGroup.__rectSize = null
  39425. },
  39426. renderInner: function(t, o, e, a, i, n, r) {
  39427. var s = this;
  39428. $C.superCall(this, "renderInner", t, o, e, a, i, n, r);
  39429. var l = this._controllerGroup
  39430. , u = o.get("pageIconSize", !0);
  39431. L(u) || (u = [u, u]),
  39432. c("pagePrev", 0);
  39433. var h = o.getModel("pageTextStyle");
  39434. function c(t, e) {
  39435. var i = t + "DataIndex"
  39436. , n = yl(o.get("pageIcons", !0)[o.getOrient().name][e], {
  39437. onclick: A(s._pageGo, s, i, o, a)
  39438. }, {
  39439. x: -u[0] / 2,
  39440. y: -u[1] / 2,
  39441. width: u[0],
  39442. height: u[1]
  39443. });
  39444. n.name = t,
  39445. l.add(n)
  39446. }
  39447. l.add(new Ur({
  39448. name: "pageText",
  39449. style: {
  39450. textFill: h.getTextColor(),
  39451. font: h.getFont(),
  39452. textVerticalAlign: "middle",
  39453. textAlign: "center"
  39454. },
  39455. silent: !0
  39456. })),
  39457. c("pageNext", 1)
  39458. },
  39459. layoutInner: function(t, e, i, n, o, a) {
  39460. var r = this.getSelectorGroup()
  39461. , s = t.getOrient().index
  39462. , l = qC[s]
  39463. , u = KC[s]
  39464. , h = qC[1 - s]
  39465. , c = KC[1 - s];
  39466. o && wu("horizontal", r, t.get("selectorItemGap", !0));
  39467. var d = t.get("selectorButtonGap", !0)
  39468. , f = r.getBoundingRect()
  39469. , p = [-f.x, -f.y]
  39470. , g = k(i);
  39471. o && (g[l] = i[l] - f[l] - d);
  39472. var m = this._layoutContentAndController(t, n, g, s, l, h, c);
  39473. if (o) {
  39474. if ("end" === a)
  39475. p[s] += m[l] + d;
  39476. else {
  39477. var v = f[l] + d;
  39478. p[s] -= v,
  39479. m[u] -= v
  39480. }
  39481. m[l] += f[l] + d,
  39482. p[1 - s] += m[c] + m[h] / 2 - f[h] / 2,
  39483. m[h] = Math.max(m[h], f[h]),
  39484. m[c] = Math.min(m[c], f[c] + p[1 - s]),
  39485. r.attr("position", p)
  39486. }
  39487. return m
  39488. },
  39489. _layoutContentAndController: function(t, e, i, n, o, a, r) {
  39490. var s = this.getContentGroup()
  39491. , l = this._containerGroup
  39492. , u = this._controllerGroup;
  39493. wu(t.get("orient"), s, t.get("itemGap"), n ? i.width : null, n ? null : i.height),
  39494. wu("horizontal", u, t.get("pageButtonItemGap", !0));
  39495. var h = s.getBoundingRect()
  39496. , c = u.getBoundingRect()
  39497. , d = this._showController = h[o] > i[o]
  39498. , f = [-h.x, -h.y];
  39499. e || (f[n] = s.position[n]);
  39500. var p = [0, 0]
  39501. , g = [-c.x, -c.y]
  39502. , m = H(t.get("pageButtonGap", !0), t.get("itemGap", !0));
  39503. d && ("end" === t.get("pageButtonPosition", !0) ? g[n] += i[o] - c[o] : p[n] += c[o] + m);
  39504. g[1 - n] += h[a] / 2 - c[a] / 2,
  39505. s.attr("position", f),
  39506. l.attr("position", p),
  39507. u.attr("position", g);
  39508. var v = {
  39509. x: 0,
  39510. y: 0
  39511. };
  39512. if (v[o] = d ? i[o] : h[o],
  39513. v[a] = Math.max(h[a], c[a]),
  39514. v[r] = Math.min(0, c[r] + g[1 - n]),
  39515. l.__rectSize = i[o],
  39516. d) {
  39517. var y = {
  39518. x: 0,
  39519. y: 0
  39520. };
  39521. y[o] = Math.max(i[o] - c[o] - m, 0),
  39522. y[a] = v[a],
  39523. l.setClipPath(new rs({
  39524. shape: y
  39525. })),
  39526. l.__rectSize = y[o]
  39527. } else
  39528. u.eachChild(function(t) {
  39529. t.attr({
  39530. invisible: !0,
  39531. silent: !0
  39532. })
  39533. });
  39534. var x = this._getPageInfo(t);
  39535. return null != x.pageIndex && cl(s, {
  39536. position: x.contentPosition
  39537. }, d && t),
  39538. this._updatePageInfoView(t, x),
  39539. v
  39540. },
  39541. _pageGo: function(t, e, i) {
  39542. var n = this._getPageInfo(e)[t];
  39543. null != n && i.dispatchAction({
  39544. type: "legendScroll",
  39545. scrollDataIndex: n,
  39546. legendId: e.id
  39547. })
  39548. },
  39549. _updatePageInfoView: function(n, o) {
  39550. var a = this._controllerGroup;
  39551. E(["pagePrev", "pageNext"], function(t) {
  39552. var e = null != o[t + "DataIndex"]
  39553. , i = a.childOfName(t);
  39554. i && (i.setStyle("fill", e ? n.get("pageIconColor", !0) : n.get("pageIconInactiveColor", !0)),
  39555. i.cursor = e ? "pointer" : "default")
  39556. });
  39557. var t = a.childOfName("pageText")
  39558. , e = n.get("pageFormatter")
  39559. , i = o.pageIndex
  39560. , r = null != i ? i + 1 : 0
  39561. , s = o.pageCount;
  39562. t && e && t.setStyle("text", R(e) ? e.replace("{current}", r).replace("{total}", s) : e({
  39563. current: r,
  39564. total: s
  39565. }))
  39566. },
  39567. _getPageInfo: function(t) {
  39568. var e = t.get("scrollDataIndex", !0)
  39569. , i = this.getContentGroup()
  39570. , n = this._containerGroup.__rectSize
  39571. , o = t.getOrient().index
  39572. , a = qC[o]
  39573. , r = KC[o]
  39574. , s = this._findTargetItemIndex(e)
  39575. , l = i.children()
  39576. , u = l[s]
  39577. , h = l.length
  39578. , c = h ? 1 : 0
  39579. , d = {
  39580. contentPosition: i.position.slice(),
  39581. pageCount: c,
  39582. pageIndex: c - 1,
  39583. pagePrevDataIndex: null,
  39584. pageNextDataIndex: null
  39585. };
  39586. if (!u)
  39587. return d;
  39588. var f = y(u);
  39589. d.contentPosition[o] = -f.s;
  39590. for (var p = s + 1, g = f, m = f, v = null; p <= h; ++p)
  39591. (!(v = y(l[p])) && m.e > g.s + n || v && !x(v, g.s)) && (g = m.i > g.i ? m : v) && (null == d.pageNextDataIndex && (d.pageNextDataIndex = g.i),
  39592. ++d.pageCount),
  39593. m = v;
  39594. for (p = s - 1,
  39595. g = f,
  39596. m = f,
  39597. v = null; -1 <= p; --p)
  39598. (v = y(l[p])) && x(m, v.s) || !(g.i < m.i) || (m = g,
  39599. null == d.pagePrevDataIndex && (d.pagePrevDataIndex = g.i),
  39600. ++d.pageCount,
  39601. ++d.pageIndex),
  39602. g = v;
  39603. return d;
  39604. function y(t) {
  39605. if (t) {
  39606. var e = t.getBoundingRect()
  39607. , i = e[r] + t.position[o];
  39608. return {
  39609. s: i,
  39610. e: i + e[a],
  39611. i: t.__legendDataIndex
  39612. }
  39613. }
  39614. }
  39615. function x(t, e) {
  39616. return t.e >= e && t.s <= e + n
  39617. }
  39618. },
  39619. _findTargetItemIndex: function(n) {
  39620. return this._showController ? (this.getContentGroup().eachChild(function(t, e) {
  39621. var i = t.__legendDataIndex;
  39622. null == a && null != i && (a = e),
  39623. i === n && (o = e)
  39624. }),
  39625. null != o ? o : a) : 0;
  39626. var o, a
  39627. }
  39628. });
  39629. _f("legendScroll", "legendscroll", function(t, e) {
  39630. var i = t.scrollDataIndex;
  39631. null != i && e.eachComponent({
  39632. mainType: "legend",
  39633. subType: "scroll",
  39634. query: t
  39635. }, function(t) {
  39636. t.setScrollDataIndex(i)
  39637. })
  39638. });
  39639. iD.extend({
  39640. type: "dataZoom.slider",
  39641. layoutMode: "box",
  39642. defaultOption: {
  39643. show: !0,
  39644. right: "ph",
  39645. top: "ph",
  39646. width: "ph",
  39647. height: "ph",
  39648. left: null,
  39649. bottom: null,
  39650. backgroundColor: "rgba(47,69,84,0)",
  39651. dataBackground: {
  39652. lineStyle: {
  39653. color: "#2f4554",
  39654. width: .5,
  39655. opacity: .3
  39656. },
  39657. areaStyle: {
  39658. color: "rgba(47,69,84,0.3)",
  39659. opacity: .3
  39660. }
  39661. },
  39662. borderColor: "#ddd",
  39663. fillerColor: "rgba(167,183,204,0.4)",
  39664. handleIcon: "M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",
  39665. handleSize: "100%",
  39666. handleStyle: {
  39667. color: "#a7b7cc"
  39668. },
  39669. labelPrecision: null,
  39670. labelFormatter: null,
  39671. showDetail: !0,
  39672. showDataShadow: "auto",
  39673. realtime: !0,
  39674. zoomLock: !1,
  39675. textStyle: {
  39676. color: "#333"
  39677. }
  39678. }
  39679. });
  39680. var JC = rs
  39681. , QC = El
  39682. , tL = Bl
  39683. , eL = A
  39684. , iL = E
  39685. , nL = "horizontal"
  39686. , oL = "vertical"
  39687. , aL = ["line", "bar", "candlestick", "scatter"]
  39688. , rL = aD.extend({
  39689. type: "dataZoom.slider",
  39690. init: function(t, e) {
  39691. this._displayables = {},
  39692. this._orient,
  39693. this._range,
  39694. this._handleEnds,
  39695. this._size,
  39696. this._handleWidth,
  39697. this._handleHeight,
  39698. this._location,
  39699. this._dragging,
  39700. this._dataShadowInfo,
  39701. this.api = e
  39702. },
  39703. render: function(t, e, i, n) {
  39704. rL.superApply(this, "render", arguments),
  39705. kc(this, "_dispatchZoomAction", this.dataZoomModel.get("throttle"), "fixRate"),
  39706. this._orient = t.get("orient"),
  39707. !1 !== this.dataZoomModel.get("show") ? (n && "dataZoom" === n.type && n.from === this.uid || this._buildView(),
  39708. this._updateView()) : this.group.removeAll()
  39709. },
  39710. remove: function() {
  39711. rL.superApply(this, "remove", arguments),
  39712. Pc(this, "_dispatchZoomAction")
  39713. },
  39714. dispose: function() {
  39715. rL.superApply(this, "dispose", arguments),
  39716. Pc(this, "_dispatchZoomAction")
  39717. },
  39718. _buildView: function() {
  39719. var t = this.group;
  39720. t.removeAll(),
  39721. this._resetLocation(),
  39722. this._resetInterval();
  39723. var e = this._displayables.barGroup = new Ci;
  39724. this._renderBackground(),
  39725. this._renderHandle(),
  39726. this._renderDataShadow(),
  39727. t.add(e),
  39728. this._positionGroup()
  39729. },
  39730. _resetLocation: function() {
  39731. var t = this.dataZoomModel
  39732. , e = this.api
  39733. , i = this._findCoordRect()
  39734. , n = {
  39735. width: e.getWidth(),
  39736. height: e.getHeight()
  39737. }
  39738. , o = this._orient === nL ? {
  39739. right: n.width - i.x - i.width,
  39740. top: n.height - 30 - 7,
  39741. width: i.width,
  39742. height: 30
  39743. } : {
  39744. right: 7,
  39745. top: i.y,
  39746. width: 30,
  39747. height: i.height
  39748. }
  39749. , a = Iu(t.option);
  39750. E(["right", "top", "width", "height"], function(t) {
  39751. "ph" === a[t] && (a[t] = o[t])
  39752. });
  39753. var r = bu(a, n, t.padding);
  39754. this._location = {
  39755. x: r.x,
  39756. y: r.y
  39757. },
  39758. this._size = [r.width, r.height],
  39759. this._orient === oL && this._size.reverse()
  39760. },
  39761. _positionGroup: function() {
  39762. var t = this.group
  39763. , e = this._location
  39764. , i = this._orient
  39765. , n = this.dataZoomModel.getFirstTargetAxisModel()
  39766. , o = n && n.get("inverse")
  39767. , a = this._displayables.barGroup
  39768. , r = (this._dataShadowInfo || {}).otherAxisInverse;
  39769. a.attr(i !== nL || o ? i === nL && o ? {
  39770. scale: r ? [-1, 1] : [-1, -1]
  39771. } : i !== oL || o ? {
  39772. scale: r ? [-1, -1] : [-1, 1],
  39773. rotation: Math.PI / 2
  39774. } : {
  39775. scale: r ? [1, -1] : [1, 1],
  39776. rotation: Math.PI / 2
  39777. } : {
  39778. scale: r ? [1, 1] : [1, -1]
  39779. });
  39780. var s = t.getBoundingRect([a]);
  39781. t.attr("position", [e.x - s.x, e.y - s.y])
  39782. },
  39783. _getViewExtent: function() {
  39784. return [0, this._size[0]]
  39785. },
  39786. _renderBackground: function() {
  39787. var t = this.dataZoomModel
  39788. , e = this._size
  39789. , i = this._displayables.barGroup;
  39790. i.add(new JC({
  39791. silent: !0,
  39792. shape: {
  39793. x: 0,
  39794. y: 0,
  39795. width: e[0],
  39796. height: e[1]
  39797. },
  39798. style: {
  39799. fill: t.get("backgroundColor")
  39800. },
  39801. z2: -40
  39802. })),
  39803. i.add(new JC({
  39804. shape: {
  39805. x: 0,
  39806. y: 0,
  39807. width: e[0],
  39808. height: e[1]
  39809. },
  39810. style: {
  39811. fill: "transparent"
  39812. },
  39813. z2: 0,
  39814. onclick: A(this._onClickPanelClick, this)
  39815. }))
  39816. },
  39817. _renderDataShadow: function() {
  39818. var t = this._dataShadowInfo = this._prepareDataShadowInfo();
  39819. if (t) {
  39820. var e = this._size
  39821. , i = t.series
  39822. , n = i.getRawData()
  39823. , o = i.getShadowDim ? i.getShadowDim() : t.otherDim;
  39824. if (null != o) {
  39825. var a = n.getDataExtent(o)
  39826. , r = .3 * (a[1] - a[0]);
  39827. a = [a[0] - r, a[1] + r];
  39828. var s, l = [0, e[1]], u = [0, e[0]], h = [[e[0], 0], [0, 0]], c = [], d = u[1] / (n.count() - 1), f = 0, p = Math.round(n.count() / e[0]);
  39829. n.each([o], function(t, e) {
  39830. if (0 < p && e % p)
  39831. f += d;
  39832. else {
  39833. var i = null == t || isNaN(t) || "" === t
  39834. , n = i ? 0 : QC(t, a, l, !0);
  39835. i && !s && e ? (h.push([h[h.length - 1][0], 0]),
  39836. c.push([c[c.length - 1][0], 0])) : !i && s && (h.push([f, 0]),
  39837. c.push([f, 0])),
  39838. h.push([f, n]),
  39839. c.push([f, n]),
  39840. f += d,
  39841. s = i
  39842. }
  39843. });
  39844. var g = this.dataZoomModel;
  39845. this._displayables.barGroup.add(new Qr({
  39846. shape: {
  39847. points: h
  39848. },
  39849. style: D({
  39850. fill: g.get("dataBackgroundColor")
  39851. }, g.getModel("dataBackground.areaStyle").getAreaStyle()),
  39852. silent: !0,
  39853. z2: -20
  39854. })),
  39855. this._displayables.barGroup.add(new ts({
  39856. shape: {
  39857. points: c
  39858. },
  39859. style: g.getModel("dataBackground.lineStyle").getLineStyle(),
  39860. silent: !0,
  39861. z2: -19
  39862. }))
  39863. }
  39864. }
  39865. },
  39866. _prepareDataShadowInfo: function() {
  39867. var t = this.dataZoomModel
  39868. , s = t.get("showDataShadow");
  39869. if (!1 !== s) {
  39870. var l, u = this.ecModel;
  39871. return t.eachTargetAxis(function(a, r) {
  39872. E(t.getAxisProxy(a.name, r).getTargetSeriesModels(), function(t) {
  39873. if (!(l || !0 !== s && _(aL, t.get("type")) < 0)) {
  39874. var e, i = u.getComponent(a.axis, r).axis, n = function(t) {
  39875. return {
  39876. x: "y",
  39877. y: "x",
  39878. radius: "angle",
  39879. angle: "radius"
  39880. }[t]
  39881. }(a.name), o = t.coordinateSystem;
  39882. null != n && o.getOtherAxis && (e = o.getOtherAxis(i).inverse),
  39883. n = t.getData().mapDimension(n),
  39884. l = {
  39885. thisAxis: i,
  39886. series: t,
  39887. thisDim: a.name,
  39888. otherDim: n,
  39889. otherAxisInverse: e
  39890. }
  39891. }
  39892. }, this)
  39893. }, this),
  39894. l
  39895. }
  39896. },
  39897. _renderHandle: function() {
  39898. var t = this._displayables
  39899. , a = t.handles = []
  39900. , r = t.handleLabels = []
  39901. , s = this._displayables.barGroup
  39902. , e = this._size
  39903. , l = this.dataZoomModel;
  39904. s.add(t.filler = new JC({
  39905. draggable: !0,
  39906. cursor: sL(this._orient),
  39907. drift: eL(this._onDragMove, this, "all"),
  39908. ondragstart: eL(this._showDataInfo, this, !0),
  39909. ondragend: eL(this._onDragEnd, this),
  39910. onmouseover: eL(this._showDataInfo, this, !0),
  39911. onmouseout: eL(this._showDataInfo, this, !1),
  39912. style: {
  39913. fill: l.get("fillerColor"),
  39914. textPosition: "inside"
  39915. }
  39916. })),
  39917. s.add(new JC({
  39918. silent: !0,
  39919. subPixelOptimize: !0,
  39920. shape: {
  39921. x: 0,
  39922. y: 0,
  39923. width: e[0],
  39924. height: e[1]
  39925. },
  39926. style: {
  39927. stroke: l.get("dataBackgroundColor") || l.get("borderColor"),
  39928. lineWidth: 1,
  39929. fill: "rgba(0,0,0,0)"
  39930. }
  39931. })),
  39932. iL([0, 1], function(t) {
  39933. var e = yl(l.get("handleIcon"), {
  39934. cursor: sL(this._orient),
  39935. draggable: !0,
  39936. drift: eL(this._onDragMove, this, t),
  39937. ondragend: eL(this._onDragEnd, this),
  39938. onmouseover: eL(this._showDataInfo, this, !0),
  39939. onmouseout: eL(this._showDataInfo, this, !1)
  39940. }, {
  39941. x: -1,
  39942. y: 0,
  39943. width: 2,
  39944. height: 2
  39945. })
  39946. , i = e.getBoundingRect();
  39947. this._handleHeight = Rl(l.get("handleSize"), this._size[1]),
  39948. this._handleWidth = i.width / i.height * this._handleHeight,
  39949. e.setStyle(l.getModel("handleStyle").getItemStyle());
  39950. var n = l.get("handleColor");
  39951. null != n && (e.style.fill = n),
  39952. s.add(a[t] = e);
  39953. var o = l.textStyleModel;
  39954. this.group.add(r[t] = new Ur({
  39955. silent: !0,
  39956. invisible: !0,
  39957. style: {
  39958. x: 0,
  39959. y: 0,
  39960. text: "",
  39961. textVerticalAlign: "middle",
  39962. textAlign: "center",
  39963. textFill: o.getTextColor(),
  39964. textFont: o.getFont()
  39965. },
  39966. z2: 10
  39967. }))
  39968. }, this)
  39969. },
  39970. _resetInterval: function() {
  39971. var t = this._range = this.dataZoomModel.getPercentRange()
  39972. , e = this._getViewExtent();
  39973. this._handleEnds = [QC(t[0], [0, 100], e, !0), QC(t[1], [0, 100], e, !0)]
  39974. },
  39975. _updateInterval: function(t, e) {
  39976. var i = this.dataZoomModel
  39977. , n = this._handleEnds
  39978. , o = this._getViewExtent()
  39979. , a = i.findRepresentativeAxisProxy().getMinMaxSpan()
  39980. , r = [0, 100];
  39981. Jw(e, n, o, i.get("zoomLock") ? "all" : t, null != a.minSpan ? QC(a.minSpan, r, o, !0) : null, null != a.maxSpan ? QC(a.maxSpan, r, o, !0) : null);
  39982. var s = this._range
  39983. , l = this._range = tL([QC(n[0], o, r, !0), QC(n[1], o, r, !0)]);
  39984. return !s || s[0] !== l[0] || s[1] !== l[1]
  39985. },
  39986. _updateView: function(t) {
  39987. var n = this._displayables
  39988. , o = this._handleEnds
  39989. , e = tL(o.slice())
  39990. , a = this._size;
  39991. iL([0, 1], function(t) {
  39992. var e = n.handles[t]
  39993. , i = this._handleHeight;
  39994. e.attr({
  39995. scale: [i / 2, i / 2],
  39996. position: [o[t], a[1] / 2 - i / 2]
  39997. })
  39998. }, this),
  39999. n.filler.setShape({
  40000. x: e[0],
  40001. y: 0,
  40002. width: e[1] - e[0],
  40003. height: a[1]
  40004. }),
  40005. this._updateDataInfo(t)
  40006. },
  40007. _updateDataInfo: function(t) {
  40008. var e = this.dataZoomModel
  40009. , a = this._displayables
  40010. , r = a.handleLabels
  40011. , s = this._orient
  40012. , l = ["", ""];
  40013. if (e.get("showDetail")) {
  40014. var i = e.findRepresentativeAxisProxy();
  40015. if (i) {
  40016. var n = i.getAxisModel().axis
  40017. , o = this._range
  40018. , u = t ? i.calculateDataWindow({
  40019. start: o[0],
  40020. end: o[1]
  40021. }).valueWindow : i.getDataValueWindow();
  40022. l = [this._formatLabel(u[0], n), this._formatLabel(u[1], n)]
  40023. }
  40024. }
  40025. var h = tL(this._handleEnds.slice());
  40026. function c(t) {
  40027. var e = fl(a.handles[t].parent, this.group)
  40028. , i = gl(0 === t ? "right" : "left", e)
  40029. , n = this._handleWidth / 2 + 5
  40030. , o = pl([h[t] + (0 === t ? -n : n), this._size[1] / 2], e);
  40031. r[t].setStyle({
  40032. x: o[0],
  40033. y: o[1],
  40034. textVerticalAlign: s === nL ? "middle" : i,
  40035. textAlign: s === nL ? i : "center",
  40036. text: l[t]
  40037. })
  40038. }
  40039. c.call(this, 0),
  40040. c.call(this, 1)
  40041. },
  40042. _formatLabel: function(t, e) {
  40043. var i = this.dataZoomModel
  40044. , n = i.get("labelFormatter")
  40045. , o = i.get("labelPrecision");
  40046. null != o && "auto" !== o || (o = e.getPixelPrecision());
  40047. var a = null == t || isNaN(t) ? "" : "category" === e.type || "time" === e.type ? e.scale.getLabel(Math.round(t)) : t.toFixed(Math.min(o, 20));
  40048. return C(n) ? n(t, a) : R(n) ? n.replace("{value}", a) : a
  40049. },
  40050. _showDataInfo: function(t) {
  40051. t = this._dragging || t;
  40052. var e = this._displayables.handleLabels;
  40053. e[0].attr("invisible", !t),
  40054. e[1].attr("invisible", !t)
  40055. },
  40056. _onDragMove: function(t, e, i, n) {
  40057. this._dragging = !0,
  40058. Xt(n.event);
  40059. var o = pl([e, i], this._displayables.barGroup.getLocalTransform(), !0)
  40060. , a = this._updateInterval(t, o[0])
  40061. , r = this.dataZoomModel.get("realtime");
  40062. this._updateView(!r),
  40063. a && r && this._dispatchZoomAction()
  40064. },
  40065. _onDragEnd: function() {
  40066. this._dragging = !1,
  40067. this._showDataInfo(!1),
  40068. this.dataZoomModel.get("realtime") || this._dispatchZoomAction()
  40069. },
  40070. _onClickPanelClick: function(t) {
  40071. var e = this._size
  40072. , i = this._displayables.barGroup.transformCoordToLocal(t.offsetX, t.offsetY);
  40073. if (!(i[0] < 0 || i[0] > e[0] || i[1] < 0 || i[1] > e[1])) {
  40074. var n = this._handleEnds
  40075. , o = (n[0] + n[1]) / 2
  40076. , a = this._updateInterval("all", i[0] - o);
  40077. this._updateView(),
  40078. a && this._dispatchZoomAction()
  40079. }
  40080. },
  40081. _dispatchZoomAction: function() {
  40082. var t = this._range;
  40083. this.api.dispatchAction({
  40084. type: "dataZoom",
  40085. from: this.uid,
  40086. dataZoomId: this.dataZoomModel.id,
  40087. start: t[0],
  40088. end: t[1]
  40089. })
  40090. },
  40091. _findCoordRect: function() {
  40092. var i;
  40093. if (iL(this.getTargetCoordInfo(), function(t) {
  40094. if (!i && t.length) {
  40095. var e = t[0].model.coordinateSystem;
  40096. i = e.getRect && e.getRect()
  40097. }
  40098. }),
  40099. !i) {
  40100. var t = this.api.getWidth()
  40101. , e = this.api.getHeight();
  40102. i = {
  40103. x: .2 * t,
  40104. y: .2 * e,
  40105. width: .6 * t,
  40106. height: .6 * e
  40107. }
  40108. }
  40109. return i
  40110. }
  40111. });
  40112. function sL(t) {
  40113. return "vertical" === t ? "ns-resize" : "ew-resize"
  40114. }
  40115. iD.extend({
  40116. type: "dataZoom.inside",
  40117. defaultOption: {
  40118. disabled: !1,
  40119. zoomLock: !1,
  40120. zoomOnMouseWheel: !0,
  40121. moveOnMouseMove: !0,
  40122. moveOnMouseWheel: !1,
  40123. preventDefaultMouseMove: !0
  40124. }
  40125. });
  40126. var lL = "\0_ec_dataZoom_roams";
  40127. function uL(t, n) {
  40128. var e = cL(t)
  40129. , o = n.dataZoomId
  40130. , a = n.coordId;
  40131. E(e, function(t, e) {
  40132. var i = t.dataZoomInfos;
  40133. i[o] && _(n.allCoordIds, a) < 0 && (delete i[o],
  40134. t.count--)
  40135. }),
  40136. dL(e);
  40137. var i = e[a];
  40138. i || ((i = e[a] = {
  40139. coordId: a,
  40140. dataZoomInfos: {},
  40141. count: 0
  40142. }).controller = function(t, r) {
  40143. var e = new Vy(t.getZr());
  40144. return E(["pan", "zoom", "scrollMove"], function(a) {
  40145. e.on(a, function(n) {
  40146. var o = [];
  40147. E(r.dataZoomInfos, function(t) {
  40148. if (n.isAvailableBehavior(t.dataZoomModel.option)) {
  40149. var e = (t.getRange || {})[a]
  40150. , i = e && e(r.controller, n);
  40151. !t.dataZoomModel.get("disabled", !0) && i && o.push({
  40152. dataZoomId: t.dataZoomId,
  40153. start: i[0],
  40154. end: i[1]
  40155. })
  40156. }
  40157. }),
  40158. o.length && r.dispatchAction(o)
  40159. })
  40160. }),
  40161. e
  40162. }(t, i),
  40163. i.dispatchAction = T(fL, t)),
  40164. i.dataZoomInfos[o] || i.count++,
  40165. i.dataZoomInfos[o] = n;
  40166. var r = function(t) {
  40167. var n, o = {
  40168. type_true: 2,
  40169. type_move: 1,
  40170. type_false: 0,
  40171. type_undefined: -1
  40172. }, a = !0;
  40173. return E(t, function(t) {
  40174. var e = t.dataZoomModel
  40175. , i = !e.get("disabled", !0) && (!e.get("zoomLock", !0) || "move");
  40176. o["type_" + n] < o["type_" + i] && (n = i),
  40177. a &= e.get("preventDefaultMouseMove", !0)
  40178. }),
  40179. {
  40180. controlType: n,
  40181. opt: {
  40182. zoomOnMouseWheel: !0,
  40183. moveOnMouseMove: !0,
  40184. moveOnMouseWheel: !0,
  40185. preventDefaultMouseMove: !!a
  40186. }
  40187. }
  40188. }(i.dataZoomInfos);
  40189. i.controller.enable(r.controlType, r.opt),
  40190. i.controller.setPointerChecker(n.containsPoint),
  40191. kc(i, "dispatchAction", n.dataZoomModel.get("throttle", !0), "fixRate")
  40192. }
  40193. function hL(t) {
  40194. return t.type + "\0_" + t.id
  40195. }
  40196. function cL(t) {
  40197. var e = t.getZr();
  40198. return e[lL] || (e[lL] = {})
  40199. }
  40200. function dL(i) {
  40201. E(i, function(t, e) {
  40202. t.count || (t.controller.dispose(),
  40203. delete i[e])
  40204. })
  40205. }
  40206. function fL(t, e) {
  40207. t.dispatchAction({
  40208. type: "dataZoom",
  40209. batch: e
  40210. })
  40211. }
  40212. var pL = A
  40213. , gL = aD.extend({
  40214. type: "dataZoom.inside",
  40215. init: function(t, e) {
  40216. this._range
  40217. },
  40218. render: function(r, t, s, e) {
  40219. gL.superApply(this, "render", arguments),
  40220. this._range = r.getPercentRange(),
  40221. E(this.getTargetCoordInfo(), function(t, o) {
  40222. var a = O(t, function(t) {
  40223. return hL(t.model)
  40224. });
  40225. E(t, function(e) {
  40226. var n = e.model
  40227. , i = {};
  40228. E(["pan", "zoom", "scrollMove"], function(t) {
  40229. i[t] = pL(mL[t], this, e, o)
  40230. }, this),
  40231. uL(s, {
  40232. coordId: hL(n),
  40233. allCoordIds: a,
  40234. containsPoint: function(t, e, i) {
  40235. return n.coordinateSystem.containPoint([e, i])
  40236. },
  40237. dataZoomId: r.id,
  40238. dataZoomModel: r,
  40239. getRange: i
  40240. })
  40241. }, this)
  40242. }, this)
  40243. },
  40244. dispose: function() {
  40245. !function(t, i) {
  40246. var e = cL(t);
  40247. E(e, function(t) {
  40248. t.controller.dispose();
  40249. var e = t.dataZoomInfos;
  40250. e[i] && (delete e[i],
  40251. t.count--)
  40252. }),
  40253. dL(e)
  40254. }(this.api, this.dataZoomModel.id),
  40255. gL.superApply(this, "dispose", arguments),
  40256. this._range = null
  40257. }
  40258. })
  40259. , mL = {
  40260. zoom: function(t, e, i, n) {
  40261. var o = this._range
  40262. , a = o.slice()
  40263. , r = t.axisModels[0];
  40264. if (r) {
  40265. var s = xL[e](null, [n.originX, n.originY], r, i, t)
  40266. , l = (0 < s.signal ? s.pixelStart + s.pixelLength - s.pixel : s.pixel - s.pixelStart) / s.pixelLength * (a[1] - a[0]) + a[0]
  40267. , u = Math.max(1 / n.scale, 0);
  40268. a[0] = (a[0] - l) * u + l,
  40269. a[1] = (a[1] - l) * u + l;
  40270. var h = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();
  40271. return Jw(0, a, [0, 100], 0, h.minSpan, h.maxSpan),
  40272. this._range = a,
  40273. o[0] !== a[0] || o[1] !== a[1] ? a : void 0
  40274. }
  40275. },
  40276. pan: vL(function(t, e, i, n, o, a) {
  40277. var r = xL[n]([a.oldX, a.oldY], [a.newX, a.newY], e, o, i);
  40278. return r.signal * (t[1] - t[0]) * r.pixel / r.pixelLength
  40279. }),
  40280. scrollMove: vL(function(t, e, i, n, o, a) {
  40281. return xL[n]([0, 0], [a.scrollDelta, a.scrollDelta], e, o, i).signal * (t[1] - t[0]) * a.scrollDelta
  40282. })
  40283. };
  40284. function vL(l) {
  40285. return function(t, e, i, n) {
  40286. var o = this._range
  40287. , a = o.slice()
  40288. , r = t.axisModels[0];
  40289. if (r) {
  40290. var s = l(a, r, t, e, i, n);
  40291. return Jw(s, a, [0, 100], "all"),
  40292. this._range = a,
  40293. o[0] !== a[0] || o[1] !== a[1] ? a : void 0
  40294. }
  40295. }
  40296. }
  40297. function yL(t) {
  40298. var e = t && t.visualMap;
  40299. L(e) || (e = e ? [e] : []),
  40300. _L(e, function(t) {
  40301. if (t) {
  40302. wL(t, "splitList") && !wL(t, "pieces") && (t.pieces = t.splitList,
  40303. delete t.splitList);
  40304. var e = t.pieces;
  40305. e && L(e) && _L(e, function(t) {
  40306. z(t) && (wL(t, "start") && !wL(t, "min") && (t.min = t.start),
  40307. wL(t, "end") && !wL(t, "max") && (t.max = t.end))
  40308. })
  40309. }
  40310. })
  40311. }
  40312. var xL = {
  40313. grid: function(t, e, i, n, o) {
  40314. var a = i.axis
  40315. , r = {}
  40316. , s = o.model.coordinateSystem.getRect();
  40317. return t = t || [0, 0],
  40318. "x" === a.dim ? (r.pixel = e[0] - t[0],
  40319. r.pixelLength = s.width,
  40320. r.pixelStart = s.x,
  40321. r.signal = a.inverse ? 1 : -1) : (r.pixel = e[1] - t[1],
  40322. r.pixelLength = s.height,
  40323. r.pixelStart = s.y,
  40324. r.signal = a.inverse ? -1 : 1),
  40325. r
  40326. },
  40327. polar: function(t, e, i, n, o) {
  40328. var a = i.axis
  40329. , r = {}
  40330. , s = o.model.coordinateSystem
  40331. , l = s.getRadiusAxis().getExtent()
  40332. , u = s.getAngleAxis().getExtent();
  40333. return t = t ? s.pointToCoord(t) : [0, 0],
  40334. e = s.pointToCoord(e),
  40335. "radiusAxis" === i.mainType ? (r.pixel = e[0] - t[0],
  40336. r.pixelLength = l[1] - l[0],
  40337. r.pixelStart = l[0],
  40338. r.signal = a.inverse ? 1 : -1) : (r.pixel = e[1] - t[1],
  40339. r.pixelLength = u[1] - u[0],
  40340. r.pixelStart = u[0],
  40341. r.signal = a.inverse ? -1 : 1),
  40342. r
  40343. },
  40344. singleAxis: function(t, e, i, n, o) {
  40345. var a = i.axis
  40346. , r = o.model.coordinateSystem.getRect()
  40347. , s = {};
  40348. return t = t || [0, 0],
  40349. "horizontal" === a.orient ? (s.pixel = e[0] - t[0],
  40350. s.pixelLength = r.width,
  40351. s.pixelStart = r.x,
  40352. s.signal = a.inverse ? 1 : -1) : (s.pixel = e[1] - t[1],
  40353. s.pixelLength = r.height,
  40354. s.pixelStart = r.y,
  40355. s.signal = a.inverse ? -1 : 1),
  40356. s
  40357. }
  40358. }
  40359. , _L = E;
  40360. function wL(t, e) {
  40361. return t && t.hasOwnProperty && t.hasOwnProperty(e)
  40362. }
  40363. ku.registerSubTypeDefaulter("visualMap", function(t) {
  40364. return t.categories || (t.pieces ? 0 < t.pieces.length : 0 < t.splitNumber) && !t.calculable ? "piecewise" : "continuous"
  40365. });
  40366. var bL = Ld.VISUAL.COMPONENT;
  40367. function SL(t, e, i, n) {
  40368. for (var o = e.targetVisuals[n], a = g_.prepareVisualTypes(o), r = {
  40369. color: t.getData().getVisual("color")
  40370. }, s = 0, l = a.length; s < l; s++) {
  40371. var u = a[s]
  40372. , h = o["opacity" === u ? "__alphaForOpacity" : u];
  40373. h && h.applyVisual(i, c, d)
  40374. }
  40375. return r.color;
  40376. function c(t) {
  40377. return r[t]
  40378. }
  40379. function d(t, e) {
  40380. r[t] = e
  40381. }
  40382. }
  40383. Sf(bL, {
  40384. createOnAllSeries: !0,
  40385. reset: function(i, t) {
  40386. var n = [];
  40387. return t.eachComponent("visualMap", function(t) {
  40388. var e = i.pipelineContext;
  40389. !t.isTargetSeries(i) || e && e.large || n.push(function(t, f, p, g) {
  40390. var m = {};
  40391. return E(t, function(t) {
  40392. var e = g_.prepareVisualTypes(f[t]);
  40393. m[t] = e
  40394. }),
  40395. {
  40396. progress: function(t, i) {
  40397. function e(t) {
  40398. return i.getItemVisual(o, t)
  40399. }
  40400. function n(t, e) {
  40401. i.setItemVisual(o, t, e)
  40402. }
  40403. var o;
  40404. for (null != g && (g = i.getDimension(g)); null != (o = t.next()); ) {
  40405. var a = i.getRawDataItem(o);
  40406. if (!a || !1 !== a.visualMap)
  40407. for (var r = null != g ? i.get(g, o, !0) : o, s = p(r), l = f[s], u = m[s], h = 0, c = u.length; h < c; h++) {
  40408. var d = u[h];
  40409. l[d] && l[d].applyVisual(r, e, n)
  40410. }
  40411. }
  40412. }
  40413. }
  40414. }(t.stateList, t.targetVisuals, A(t.getValueState, t), t.getDataDimension(i.getData())))
  40415. }),
  40416. n
  40417. }
  40418. }),
  40419. Sf(bL, {
  40420. createOnAllSeries: !0,
  40421. reset: function(o, t) {
  40422. var a = o.getData()
  40423. , r = [];
  40424. t.eachComponent("visualMap", function(t) {
  40425. if (t.isTargetSeries(o)) {
  40426. var e = t.getVisualMeta(A(SL, null, o, t)) || {
  40427. stops: [],
  40428. outerColors: []
  40429. }
  40430. , i = t.getDataDimension(a)
  40431. , n = a.getDimensionInfo(i);
  40432. null != n && (e.dimension = n.index,
  40433. r.push(e))
  40434. }
  40435. }),
  40436. o.getData().setVisual("visualMeta", r)
  40437. }
  40438. });
  40439. var ML = function(t, e, i) {
  40440. var n = k((IL[t] || {})[e]);
  40441. return i && L(n) ? n[n.length - 1] : n
  40442. }
  40443. , IL = {
  40444. color: {
  40445. active: ["#006edd", "#e0ffff"],
  40446. inactive: ["rgba(0,0,0,0)"]
  40447. },
  40448. colorHue: {
  40449. active: [0, 360],
  40450. inactive: [0, 0]
  40451. },
  40452. colorSaturation: {
  40453. active: [.3, 1],
  40454. inactive: [0, 0]
  40455. },
  40456. colorLightness: {
  40457. active: [.9, .5],
  40458. inactive: [0, 0]
  40459. },
  40460. colorAlpha: {
  40461. active: [.3, 1],
  40462. inactive: [0, 0]
  40463. },
  40464. opacity: {
  40465. active: [.3, 1],
  40466. inactive: [0, 0]
  40467. },
  40468. symbol: {
  40469. active: ["circle", "roundRect", "diamond"],
  40470. inactive: ["none"]
  40471. },
  40472. symbolSize: {
  40473. active: [10, 50],
  40474. inactive: [0, 0]
  40475. }
  40476. }
  40477. , TL = g_.mapVisual
  40478. , AL = g_.eachVisual
  40479. , DL = L
  40480. , CL = E
  40481. , LL = Bl
  40482. , kL = El
  40483. , PL = Tf({
  40484. type: "visualMap",
  40485. dependencies: ["series"],
  40486. stateList: ["inRange", "outOfRange"],
  40487. replacableOptionKeys: ["inRange", "outOfRange", "target", "controller", "color"],
  40488. dataBound: [-1 / 0, 1 / 0],
  40489. layoutMode: {
  40490. type: "box",
  40491. ignoreSize: !0
  40492. },
  40493. defaultOption: {
  40494. show: !0,
  40495. zlevel: 0,
  40496. z: 4,
  40497. seriesIndex: "all",
  40498. min: 0,
  40499. max: 200,
  40500. dimension: null,
  40501. inRange: null,
  40502. outOfRange: null,
  40503. left: 0,
  40504. right: null,
  40505. top: null,
  40506. bottom: 0,
  40507. itemWidth: null,
  40508. itemHeight: null,
  40509. inverse: !1,
  40510. orient: "vertical",
  40511. backgroundColor: "rgba(0,0,0,0)",
  40512. borderColor: "#ccc",
  40513. contentColor: "#5793f3",
  40514. inactiveColor: "#aaa",
  40515. borderWidth: 0,
  40516. padding: 5,
  40517. textGap: 10,
  40518. precision: 0,
  40519. color: null,
  40520. formatter: null,
  40521. text: null,
  40522. textStyle: {
  40523. color: "#333"
  40524. }
  40525. },
  40526. init: function(t, e, i) {
  40527. this._dataExtent,
  40528. this.targetVisuals = {},
  40529. this.controllerVisuals = {},
  40530. this.textStyleModel,
  40531. this.itemSize,
  40532. this.mergeDefaultAndTheme(t, i)
  40533. },
  40534. optionUpdated: function(t, e) {
  40535. var i = this.option;
  40536. v.canvasSupported || (i.realtime = !1),
  40537. e || PD(i, t, this.replacableOptionKeys),
  40538. this.textStyleModel = this.getModel("textStyle"),
  40539. this.resetItemSize(),
  40540. this.completeVisualOption()
  40541. },
  40542. resetVisual: function(t) {
  40543. var e = this.stateList;
  40544. t = A(t, this),
  40545. this.controllerVisuals = kD(this.option.controller, e, t),
  40546. this.targetVisuals = kD(this.option.target, e, t)
  40547. },
  40548. getTargetSeriesIndices: function() {
  40549. var t = this.option.seriesIndex
  40550. , i = [];
  40551. return null == t || "all" === t ? this.ecModel.eachSeries(function(t, e) {
  40552. i.push(e)
  40553. }) : i = Vo(t),
  40554. i
  40555. },
  40556. eachTargetSeries: function(e, i) {
  40557. E(this.getTargetSeriesIndices(), function(t) {
  40558. e.call(i, this.ecModel.getSeriesByIndex(t))
  40559. }, this)
  40560. },
  40561. isTargetSeries: function(e) {
  40562. var i = !1;
  40563. return this.eachTargetSeries(function(t) {
  40564. t === e && (i = !0)
  40565. }),
  40566. i
  40567. },
  40568. formatValueText: function(t, e, i) {
  40569. var n, o, a = this.option, r = a.precision, s = this.dataBound, l = a.formatter;
  40570. return i = i || ["<", ">"],
  40571. L(t) && (t = t.slice(),
  40572. n = !0),
  40573. o = e ? t : n ? [u(t[0]), u(t[1])] : u(t),
  40574. R(l) ? l.replace("{value}", n ? o[0] : o).replace("{value2}", n ? o[1] : o) : C(l) ? n ? l(t[0], t[1]) : l(t) : n ? t[0] === s[0] ? i[0] + " " + o[1] : t[1] === s[1] ? i[1] + " " + o[0] : o[0] + " - " + o[1] : o;
  40575. function u(t) {
  40576. return t === s[0] ? "min" : t === s[1] ? "max" : (+t).toFixed(Math.min(r, 20))
  40577. }
  40578. },
  40579. resetExtent: function() {
  40580. var t = this.option
  40581. , e = LL([t.min, t.max]);
  40582. this._dataExtent = e
  40583. },
  40584. getDataDimension: function(t) {
  40585. var e = this.option.dimension
  40586. , i = t.dimensions;
  40587. if (null != e || i.length) {
  40588. if (null != e)
  40589. return t.getDimension(e);
  40590. for (var n = t.dimensions, o = n.length - 1; 0 <= o; o--) {
  40591. var a = n[o];
  40592. if (!t.getDimensionInfo(a).isCalculationCoord)
  40593. return a
  40594. }
  40595. }
  40596. },
  40597. getExtent: function() {
  40598. return this._dataExtent.slice()
  40599. },
  40600. completeVisualOption: function() {
  40601. var t = this.ecModel
  40602. , e = this.option
  40603. , i = {
  40604. inRange: e.inRange,
  40605. outOfRange: e.outOfRange
  40606. }
  40607. , n = e.target || (e.target = {})
  40608. , o = e.controller || (e.controller = {});
  40609. m(n, i),
  40610. m(o, i);
  40611. var u = this.isCategory();
  40612. function a(n) {
  40613. DL(e.color) && !n.inRange && (n.inRange = {
  40614. color: e.color.slice().reverse()
  40615. }),
  40616. n.inRange = n.inRange || {
  40617. color: t.get("gradientColor")
  40618. },
  40619. CL(this.stateList, function(t) {
  40620. var e = n[t];
  40621. if (R(e)) {
  40622. var i = ML(e, "active", u);
  40623. i ? (n[t] = {},
  40624. n[t][e] = i) : delete n[t]
  40625. }
  40626. }, this)
  40627. }
  40628. a.call(this, n),
  40629. a.call(this, o),
  40630. function(t, e, i) {
  40631. var n = t[e]
  40632. , o = t[i];
  40633. n && !o && (o = t[i] = {},
  40634. CL(n, function(t, e) {
  40635. if (g_.isValidType(e)) {
  40636. var i = ML(e, "inactive", u);
  40637. null != i && (o[e] = i,
  40638. "color" !== e || o.hasOwnProperty("opacity") || o.hasOwnProperty("colorAlpha") || (o.opacity = [0, 0]))
  40639. }
  40640. }))
  40641. }
  40642. .call(this, n, "inRange", "outOfRange"),
  40643. function(a) {
  40644. var r = (a.inRange || {}).symbol || (a.outOfRange || {}).symbol
  40645. , s = (a.inRange || {}).symbolSize || (a.outOfRange || {}).symbolSize
  40646. , l = this.get("inactiveColor");
  40647. CL(this.stateList, function(t) {
  40648. var e = this.itemSize
  40649. , i = a[t];
  40650. null == (i = i || (a[t] = {
  40651. color: u ? l : [l]
  40652. })).symbol && (i.symbol = r && k(r) || (u ? "roundRect" : ["roundRect"])),
  40653. null == i.symbolSize && (i.symbolSize = s && k(s) || (u ? e[0] : [e[0], e[0]])),
  40654. i.symbol = TL(i.symbol, function(t) {
  40655. return "none" === t || "square" === t ? "roundRect" : t
  40656. });
  40657. var n = i.symbolSize;
  40658. if (null != n) {
  40659. var o = -1 / 0;
  40660. AL(n, function(t) {
  40661. o < t && (o = t)
  40662. }),
  40663. i.symbolSize = TL(n, function(t) {
  40664. return kL(t, [0, o], [0, e[0]], !0)
  40665. })
  40666. }
  40667. }, this)
  40668. }
  40669. .call(this, o)
  40670. },
  40671. resetItemSize: function() {
  40672. this.itemSize = [parseFloat(this.get("itemWidth")), parseFloat(this.get("itemHeight"))]
  40673. },
  40674. isCategory: function() {
  40675. return !!this.option.categories
  40676. },
  40677. setSelected: et,
  40678. getValueState: et,
  40679. getVisualMeta: et
  40680. })
  40681. , NL = [20, 140]
  40682. , OL = PL.extend({
  40683. type: "visualMap.continuous",
  40684. defaultOption: {
  40685. align: "auto",
  40686. calculable: !1,
  40687. range: null,
  40688. realtime: !0,
  40689. itemHeight: null,
  40690. itemWidth: null,
  40691. hoverLink: !0,
  40692. hoverLinkDataSize: null,
  40693. hoverLinkOnHandle: null
  40694. },
  40695. optionUpdated: function(t, e) {
  40696. OL.superApply(this, "optionUpdated", arguments),
  40697. this.resetExtent(),
  40698. this.resetVisual(function(t) {
  40699. t.mappingMethod = "linear",
  40700. t.dataExtent = this.getExtent()
  40701. }),
  40702. this._resetRange()
  40703. },
  40704. resetItemSize: function() {
  40705. OL.superApply(this, "resetItemSize", arguments);
  40706. var t = this.itemSize;
  40707. "horizontal" === this._orient && t.reverse(),
  40708. null != t[0] && !isNaN(t[0]) || (t[0] = NL[0]),
  40709. null != t[1] && !isNaN(t[1]) || (t[1] = NL[1])
  40710. },
  40711. _resetRange: function() {
  40712. var t = this.getExtent()
  40713. , e = this.option.range;
  40714. !e || e.auto ? (t.auto = 1,
  40715. this.option.range = t) : L(e) && (e[0] > e[1] && e.reverse(),
  40716. e[0] = Math.max(e[0], t[0]),
  40717. e[1] = Math.min(e[1], t[1]))
  40718. },
  40719. completeVisualOption: function() {
  40720. PL.prototype.completeVisualOption.apply(this, arguments),
  40721. E(this.stateList, function(t) {
  40722. var e = this.option.controller[t].symbolSize;
  40723. e && e[0] !== e[1] && (e[0] = 0)
  40724. }, this)
  40725. },
  40726. setSelected: function(t) {
  40727. this.option.range = t.slice(),
  40728. this._resetRange()
  40729. },
  40730. getSelected: function() {
  40731. var t = this.getExtent()
  40732. , e = Bl((this.get("range") || []).slice());
  40733. return e[0] > t[1] && (e[0] = t[1]),
  40734. e[1] > t[1] && (e[1] = t[1]),
  40735. e[0] < t[0] && (e[0] = t[0]),
  40736. e[1] < t[0] && (e[1] = t[0]),
  40737. e
  40738. },
  40739. getValueState: function(t) {
  40740. var e = this.option.range
  40741. , i = this.getExtent();
  40742. return (e[0] <= i[0] || e[0] <= t) && (e[1] >= i[1] || t <= e[1]) ? "inRange" : "outOfRange"
  40743. },
  40744. findTargetDataIndices: function(n) {
  40745. var o = [];
  40746. return this.eachTargetSeries(function(t) {
  40747. var i = []
  40748. , e = t.getData();
  40749. e.each(this.getDataDimension(e), function(t, e) {
  40750. n[0] <= t && t <= n[1] && i.push(e)
  40751. }, this),
  40752. o.push({
  40753. seriesId: t.id,
  40754. dataIndex: i
  40755. })
  40756. }, this),
  40757. o
  40758. },
  40759. getVisualMeta: function(i) {
  40760. var t = EL(this, "outOfRange", this.getExtent())
  40761. , e = EL(this, "inRange", this.option.range.slice())
  40762. , n = [];
  40763. function o(t, e) {
  40764. n.push({
  40765. value: t,
  40766. color: i(t, e)
  40767. })
  40768. }
  40769. for (var a = 0, r = 0, s = e.length, l = t.length; r < l && (!e.length || t[r] <= e[0]); r++)
  40770. t[r] < e[a] && o(t[r], "outOfRange");
  40771. for (var u = 1; a < s; a++,
  40772. u = 0)
  40773. u && n.length && o(e[a], "outOfRange"),
  40774. o(e[a], "inRange");
  40775. for (u = 1; r < l; r++)
  40776. (!e.length || e[e.length - 1] < t[r]) && (u && (n.length && o(n[n.length - 1].value, "outOfRange"),
  40777. u = 0),
  40778. o(t[r], "outOfRange"));
  40779. var h = n.length;
  40780. return {
  40781. stops: n,
  40782. outerColors: [h ? n[0].color : "transparent", h ? n[h - 1].color : "transparent"]
  40783. }
  40784. }
  40785. });
  40786. function EL(t, e, i) {
  40787. if (i[0] === i[1])
  40788. return i.slice();
  40789. for (var n = (i[1] - i[0]) / 200, o = i[0], a = [], r = 0; r <= 200 && o < i[1]; r++)
  40790. a.push(o),
  40791. o += n;
  40792. return a.push(i[1]),
  40793. a
  40794. }
  40795. var RL = Af({
  40796. type: "visualMap",
  40797. autoPositionValues: {
  40798. left: 1,
  40799. right: 1,
  40800. top: 1,
  40801. bottom: 1
  40802. },
  40803. init: function(t, e) {
  40804. this.ecModel = t,
  40805. this.api = e,
  40806. this.visualMapModel
  40807. },
  40808. render: function(t, e, i, n) {
  40809. !1 !== (this.visualMapModel = t).get("show") ? this.doRender.apply(this, arguments) : this.group.removeAll()
  40810. },
  40811. renderBackground: function(t) {
  40812. var e = this.visualMapModel
  40813. , i = iu(e.get("padding") || 0)
  40814. , n = t.getBoundingRect();
  40815. t.add(new rs({
  40816. z2: -1,
  40817. silent: !0,
  40818. shape: {
  40819. x: n.x - i[3],
  40820. y: n.y - i[0],
  40821. width: n.width + i[3] + i[1],
  40822. height: n.height + i[0] + i[2]
  40823. },
  40824. style: {
  40825. fill: e.get("backgroundColor"),
  40826. stroke: e.get("borderColor"),
  40827. lineWidth: e.get("borderWidth")
  40828. }
  40829. }))
  40830. },
  40831. getControllerVisual: function(i, n, o) {
  40832. var t = (o = o || {}).forceState
  40833. , e = this.visualMapModel
  40834. , a = {};
  40835. if ("symbol" === n && (a.symbol = e.get("itemSymbol")),
  40836. "color" === n) {
  40837. var r = e.get("contentColor");
  40838. a.color = r
  40839. }
  40840. function s(t) {
  40841. return a[t]
  40842. }
  40843. function l(t, e) {
  40844. a[t] = e
  40845. }
  40846. var u = e.controllerVisuals[t || e.getValueState(i)];
  40847. return E(g_.prepareVisualTypes(u), function(t) {
  40848. var e = u[t];
  40849. o.convertOpacityToAlpha && "opacity" === t && (t = "colorAlpha",
  40850. e = u.__alphaForOpacity),
  40851. g_.dependsOn(t, n) && e && e.applyVisual(i, s, l)
  40852. }),
  40853. a[n]
  40854. },
  40855. positionGroup: function(t) {
  40856. var e = this.visualMapModel
  40857. , i = this.api;
  40858. Su(t, e.getBoxLayoutParams(), {
  40859. width: i.getWidth(),
  40860. height: i.getHeight()
  40861. })
  40862. },
  40863. doRender: et
  40864. });
  40865. function zL(t, e, i) {
  40866. var n = t.option
  40867. , o = n.align;
  40868. if (null != o && "auto" !== o)
  40869. return o;
  40870. for (var a = {
  40871. width: e.getWidth(),
  40872. height: e.getHeight()
  40873. }, r = "horizontal" === n.orient ? 1 : 0, s = [["left", "right", "width"], ["top", "bottom", "height"]], l = s[r], u = [0, null, 10], h = {}, c = 0; c < 3; c++)
  40874. h[s[1 - r][c]] = u[c],
  40875. h[l[c]] = 2 === c ? i[0] : n[l[c]];
  40876. var d = [["x", "width", 3], ["y", "height", 0]][r]
  40877. , f = bu(h, a, n.padding);
  40878. return l[(f.margin[d[2]] || 0) + f[d[0]] + .5 * f[d[1]] < .5 * a[d[1]] ? 0 : 1]
  40879. }
  40880. function BL(t, e) {
  40881. return E(t || [], function(t) {
  40882. null != t.dataIndex && (t.dataIndexInside = t.dataIndex,
  40883. t.dataIndex = null),
  40884. t.highlightKey = "visualMap" + (e ? e.componentIndex : "")
  40885. }),
  40886. t
  40887. }
  40888. var VL = El
  40889. , GL = E
  40890. , FL = Math.min
  40891. , WL = Math.max
  40892. , HL = RL.extend({
  40893. type: "visualMap.continuous",
  40894. init: function() {
  40895. HL.superApply(this, "init", arguments),
  40896. this._shapes = {},
  40897. this._dataInterval = [],
  40898. this._handleEnds = [],
  40899. this._orient,
  40900. this._useHandle,
  40901. this._hoverLinkDataIndices = [],
  40902. this._dragging,
  40903. this._hovering
  40904. },
  40905. doRender: function(t, e, i, n) {
  40906. n && "selectDataRange" === n.type && n.from === this.uid || this._buildView()
  40907. },
  40908. _buildView: function() {
  40909. this.group.removeAll();
  40910. var t = this.visualMapModel
  40911. , e = this.group;
  40912. this._orient = t.get("orient"),
  40913. this._useHandle = t.get("calculable"),
  40914. this._resetInterval(),
  40915. this._renderBar(e);
  40916. var i = t.get("text");
  40917. this._renderEndsText(e, i, 0),
  40918. this._renderEndsText(e, i, 1),
  40919. this._updateView(!0),
  40920. this.renderBackground(e),
  40921. this._updateView(),
  40922. this._enableHoverLinkToSeries(),
  40923. this._enableHoverLinkFromSeries(),
  40924. this.positionGroup(e)
  40925. },
  40926. _renderEndsText: function(t, e, i) {
  40927. if (e) {
  40928. var n = e[1 - i];
  40929. n = null != n ? n + "" : "";
  40930. var o = this.visualMapModel
  40931. , a = o.get("textGap")
  40932. , r = o.itemSize
  40933. , s = this._shapes.barGroup
  40934. , l = this._applyTransform([r[0] / 2, 0 === i ? -a : r[1] + a], s)
  40935. , u = this._applyTransform(0 === i ? "bottom" : "top", s)
  40936. , h = this._orient
  40937. , c = this.visualMapModel.textStyleModel;
  40938. this.group.add(new Ur({
  40939. style: {
  40940. x: l[0],
  40941. y: l[1],
  40942. textVerticalAlign: "horizontal" === h ? "middle" : u,
  40943. textAlign: "horizontal" === h ? u : "center",
  40944. text: n,
  40945. textFont: c.getFont(),
  40946. textFill: c.getTextColor()
  40947. }
  40948. }))
  40949. }
  40950. },
  40951. _renderBar: function(t) {
  40952. var e = this.visualMapModel
  40953. , i = this._shapes
  40954. , n = e.itemSize
  40955. , o = this._orient
  40956. , a = this._useHandle
  40957. , r = zL(e, this.api, n)
  40958. , s = i.barGroup = this._createBarGroup(r);
  40959. s.add(i.outOfRange = ZL()),
  40960. s.add(i.inRange = ZL(null, a ? XL(this._orient) : null, A(this._dragHandle, this, "all", !1), A(this._dragHandle, this, "all", !0)));
  40961. var l = e.textStyleModel.getTextRect("国")
  40962. , u = WL(l.width, l.height);
  40963. a && (i.handleThumbs = [],
  40964. i.handleLabels = [],
  40965. i.handleLabelPoints = [],
  40966. this._createHandle(s, 0, n, u, o, r),
  40967. this._createHandle(s, 1, n, u, o, r)),
  40968. this._createIndicator(s, n, u, o),
  40969. t.add(s)
  40970. },
  40971. _createHandle: function(t, e, i, n, o) {
  40972. var a = A(this._dragHandle, this, e, !1)
  40973. , r = A(this._dragHandle, this, e, !0)
  40974. , s = ZL(function(t, e) {
  40975. return 0 === t ? [[0, 0], [e, 0], [e, -e]] : [[0, 0], [e, 0], [e, e]]
  40976. }(e, n), XL(this._orient), a, r);
  40977. s.position[0] = i[0],
  40978. t.add(s);
  40979. var l = this.visualMapModel.textStyleModel
  40980. , u = new Ur({
  40981. draggable: !0,
  40982. drift: a,
  40983. onmousemove: function(t) {
  40984. Xt(t.event)
  40985. },
  40986. ondragend: r,
  40987. style: {
  40988. x: 0,
  40989. y: 0,
  40990. text: "",
  40991. textFont: l.getFont(),
  40992. textFill: l.getTextColor()
  40993. }
  40994. });
  40995. this.group.add(u);
  40996. var h = ["horizontal" === o ? n / 2 : 1.5 * n, "horizontal" === o ? 0 === e ? -1.5 * n : 1.5 * n : 0 === e ? -n / 2 : n / 2]
  40997. , c = this._shapes;
  40998. c.handleThumbs[e] = s,
  40999. c.handleLabelPoints[e] = h,
  41000. c.handleLabels[e] = u
  41001. },
  41002. _createIndicator: function(t, e, i, n) {
  41003. var o = ZL([[0, 0]], "move");
  41004. o.position[0] = e[0],
  41005. o.attr({
  41006. invisible: !0,
  41007. silent: !0
  41008. }),
  41009. t.add(o);
  41010. var a = this.visualMapModel.textStyleModel
  41011. , r = new Ur({
  41012. silent: !0,
  41013. invisible: !0,
  41014. style: {
  41015. x: 0,
  41016. y: 0,
  41017. text: "",
  41018. textFont: a.getFont(),
  41019. textFill: a.getTextColor()
  41020. }
  41021. });
  41022. this.group.add(r);
  41023. var s = ["horizontal" === n ? i / 2 : 9, 0]
  41024. , l = this._shapes;
  41025. l.indicator = o,
  41026. l.indicatorLabel = r,
  41027. l.indicatorLabelPoint = s
  41028. },
  41029. _dragHandle: function(t, e, i, n) {
  41030. if (this._useHandle) {
  41031. if (this._dragging = !e,
  41032. !e) {
  41033. var o = this._applyTransform([i, n], this._shapes.barGroup, !0);
  41034. this._updateInterval(t, o[1]),
  41035. this._updateView()
  41036. }
  41037. e === !this.visualMapModel.get("realtime") && this.api.dispatchAction({
  41038. type: "selectDataRange",
  41039. from: this.uid,
  41040. visualMapId: this.visualMapModel.id,
  41041. selected: this._dataInterval.slice()
  41042. }),
  41043. e ? this._hovering || this._clearHoverLinkToSeries() : UL(this.visualMapModel) && this._doHoverLinkToSeries(this._handleEnds[t], !1)
  41044. }
  41045. },
  41046. _resetInterval: function() {
  41047. var t = this.visualMapModel
  41048. , e = this._dataInterval = t.getSelected()
  41049. , i = t.getExtent()
  41050. , n = [0, t.itemSize[1]];
  41051. this._handleEnds = [VL(e[0], i, n, !0), VL(e[1], i, n, !0)]
  41052. },
  41053. _updateInterval: function(t, e) {
  41054. e = e || 0;
  41055. var i = this.visualMapModel
  41056. , n = this._handleEnds
  41057. , o = [0, i.itemSize[1]];
  41058. Jw(e, n, o, t, 0);
  41059. var a = i.getExtent();
  41060. this._dataInterval = [VL(n[0], o, a, !0), VL(n[1], o, a, !0)]
  41061. },
  41062. _updateView: function(t) {
  41063. var e = this.visualMapModel
  41064. , i = e.getExtent()
  41065. , n = this._shapes
  41066. , o = [0, e.itemSize[1]]
  41067. , a = t ? o : this._handleEnds
  41068. , r = this._createBarVisual(this._dataInterval, i, a, "inRange")
  41069. , s = this._createBarVisual(i, i, o, "outOfRange");
  41070. n.inRange.setStyle({
  41071. fill: r.barColor,
  41072. opacity: r.opacity
  41073. }).setShape("points", r.barPoints),
  41074. n.outOfRange.setStyle({
  41075. fill: s.barColor,
  41076. opacity: s.opacity
  41077. }).setShape("points", s.barPoints),
  41078. this._updateHandle(a, r)
  41079. },
  41080. _createBarVisual: function(t, e, i, n) {
  41081. var o = {
  41082. forceState: n,
  41083. convertOpacityToAlpha: !0
  41084. }
  41085. , a = this._makeColorGradient(t, o)
  41086. , r = [this.getControllerVisual(t[0], "symbolSize", o), this.getControllerVisual(t[1], "symbolSize", o)]
  41087. , s = this._createBarPoints(i, r);
  41088. return {
  41089. barColor: new gs(0,0,0,1,a),
  41090. barPoints: s,
  41091. handlesColor: [a[0].color, a[a.length - 1].color]
  41092. }
  41093. },
  41094. _makeColorGradient: function(t, e) {
  41095. var i = []
  41096. , n = (t[1] - t[0]) / 100;
  41097. i.push({
  41098. color: this.getControllerVisual(t[0], "color", e),
  41099. offset: 0
  41100. });
  41101. for (var o = 1; o < 100; o++) {
  41102. var a = t[0] + n * o;
  41103. if (a > t[1])
  41104. break;
  41105. i.push({
  41106. color: this.getControllerVisual(a, "color", e),
  41107. offset: o / 100
  41108. })
  41109. }
  41110. return i.push({
  41111. color: this.getControllerVisual(t[1], "color", e),
  41112. offset: 1
  41113. }),
  41114. i
  41115. },
  41116. _createBarPoints: function(t, e) {
  41117. var i = this.visualMapModel.itemSize;
  41118. return [[i[0] - e[0], t[0]], [i[0], t[0]], [i[0], t[1]], [i[0] - e[1], t[1]]]
  41119. },
  41120. _createBarGroup: function(t) {
  41121. var e = this._orient
  41122. , i = this.visualMapModel.get("inverse");
  41123. return new Ci("horizontal" !== e || i ? "horizontal" === e && i ? {
  41124. scale: "bottom" === t ? [-1, 1] : [1, 1],
  41125. rotation: -Math.PI / 2
  41126. } : "vertical" !== e || i ? {
  41127. scale: "left" === t ? [1, 1] : [-1, 1]
  41128. } : {
  41129. scale: "left" === t ? [1, -1] : [-1, -1]
  41130. } : {
  41131. scale: "bottom" === t ? [1, 1] : [-1, 1],
  41132. rotation: Math.PI / 2
  41133. })
  41134. },
  41135. _updateHandle: function(n, o) {
  41136. if (this._useHandle) {
  41137. var a = this._shapes
  41138. , r = this.visualMapModel
  41139. , s = a.handleThumbs
  41140. , l = a.handleLabels;
  41141. GL([0, 1], function(t) {
  41142. var e = s[t];
  41143. e.setStyle("fill", o.handlesColor[t]),
  41144. e.position[1] = n[t];
  41145. var i = pl(a.handleLabelPoints[t], fl(e, this.group));
  41146. l[t].setStyle({
  41147. x: i[0],
  41148. y: i[1],
  41149. text: r.formatValueText(this._dataInterval[t]),
  41150. textVerticalAlign: "middle",
  41151. textAlign: this._applyTransform("horizontal" === this._orient ? 0 === t ? "bottom" : "top" : "left", a.barGroup)
  41152. })
  41153. }, this)
  41154. }
  41155. },
  41156. _showIndicator: function(t, e, i, n) {
  41157. var o = this.visualMapModel
  41158. , a = o.getExtent()
  41159. , r = o.itemSize
  41160. , s = [0, r[1]]
  41161. , l = VL(t, a, s, !0)
  41162. , u = this._shapes
  41163. , h = u.indicator;
  41164. if (h) {
  41165. h.position[1] = l,
  41166. h.attr("invisible", !1),
  41167. h.setShape("points", function(t, e, i, n) {
  41168. return t ? [[0, -FL(e, WL(i, 0))], [6, 0], [0, FL(e, WL(n - i, 0))]] : [[0, 0], [5, -5], [5, 5]]
  41169. }(!!i, n, l, r[1]));
  41170. var c = this.getControllerVisual(t, "color", {
  41171. convertOpacityToAlpha: !0
  41172. });
  41173. h.setStyle("fill", c);
  41174. var d = pl(u.indicatorLabelPoint, fl(h, this.group))
  41175. , f = u.indicatorLabel;
  41176. f.attr("invisible", !1);
  41177. var p = this._applyTransform("left", u.barGroup)
  41178. , g = this._orient;
  41179. f.setStyle({
  41180. text: (i || "") + o.formatValueText(e),
  41181. textVerticalAlign: "horizontal" === g ? p : "middle",
  41182. textAlign: "horizontal" === g ? "center" : p,
  41183. x: d[0],
  41184. y: d[1]
  41185. })
  41186. }
  41187. },
  41188. _enableHoverLinkToSeries: function() {
  41189. var n = this;
  41190. this._shapes.barGroup.on("mousemove", function(t) {
  41191. if (n._hovering = !0,
  41192. !n._dragging) {
  41193. var e = n.visualMapModel.itemSize
  41194. , i = n._applyTransform([t.offsetX, t.offsetY], n._shapes.barGroup, !0, !0);
  41195. i[1] = FL(WL(0, i[1]), e[1]),
  41196. n._doHoverLinkToSeries(i[1], 0 <= i[0] && i[0] <= e[0])
  41197. }
  41198. }).on("mouseout", function() {
  41199. n._hovering = !1,
  41200. n._dragging || n._clearHoverLinkToSeries()
  41201. })
  41202. },
  41203. _enableHoverLinkFromSeries: function() {
  41204. var t = this.api.getZr();
  41205. this.visualMapModel.option.hoverLink ? (t.on("mouseover", this._hoverLinkFromSeriesMouseOver, this),
  41206. t.on("mouseout", this._hideIndicator, this)) : this._clearHoverLinkFromSeries()
  41207. },
  41208. _doHoverLinkToSeries: function(t, e) {
  41209. var i = this.visualMapModel
  41210. , n = i.itemSize;
  41211. if (i.option.hoverLink) {
  41212. var o = [0, n[1]]
  41213. , a = i.getExtent();
  41214. t = FL(WL(o[0], t), o[1]);
  41215. var r = function(t, e, i) {
  41216. var n = 6
  41217. , o = t.get("hoverLinkDataSize");
  41218. o && (n = VL(o, e, i, !0) / 2);
  41219. return n
  41220. }(i, a, o)
  41221. , s = [t - r, t + r]
  41222. , l = VL(t, o, a, !0)
  41223. , u = [VL(s[0], o, a, !0), VL(s[1], o, a, !0)];
  41224. s[0] < o[0] && (u[0] = -1 / 0),
  41225. o[1] < s[1] && (u[1] = 1 / 0),
  41226. e && (u[0] === -1 / 0 ? this._showIndicator(l, u[1], "< ", r) : u[1] === 1 / 0 ? this._showIndicator(l, u[0], "> ", r) : this._showIndicator(l, l, "≈ ", r));
  41227. var h = this._hoverLinkDataIndices
  41228. , c = [];
  41229. (e || UL(i)) && (c = this._hoverLinkDataIndices = i.findTargetDataIndices(u));
  41230. var d = function(t, e) {
  41231. var i = {}
  41232. , n = {};
  41233. return o(t || [], i),
  41234. o(e || [], n, i),
  41235. [a(i), a(n)];
  41236. function o(t, e, i) {
  41237. for (var n = 0, o = t.length; n < o; n++)
  41238. for (var a = t[n].seriesId, r = Vo(t[n].dataIndex), s = i && i[a], l = 0, u = r.length; l < u; l++) {
  41239. var h = r[l];
  41240. s && s[h] ? s[h] = null : (e[a] || (e[a] = {}))[h] = 1
  41241. }
  41242. }
  41243. function a(t, e) {
  41244. var i = [];
  41245. for (var n in t)
  41246. if (t.hasOwnProperty(n) && null != t[n])
  41247. if (e)
  41248. i.push(+n);
  41249. else {
  41250. var o = a(t[n], !0);
  41251. o.length && i.push({
  41252. seriesId: n,
  41253. dataIndex: o
  41254. })
  41255. }
  41256. return i
  41257. }
  41258. }(h, c);
  41259. this._dispatchHighDown("downplay", BL(d[0], i)),
  41260. this._dispatchHighDown("highlight", BL(d[1], i))
  41261. }
  41262. },
  41263. _hoverLinkFromSeriesMouseOver: function(t) {
  41264. var e = t.target
  41265. , i = this.visualMapModel;
  41266. if (e && null != e.dataIndex) {
  41267. var n = this.ecModel.getSeriesByIndex(e.seriesIndex);
  41268. if (i.isTargetSeries(n)) {
  41269. var o = n.getData(e.dataType)
  41270. , a = o.get(i.getDataDimension(o), e.dataIndex, !0);
  41271. isNaN(a) || this._showIndicator(a, a)
  41272. }
  41273. }
  41274. },
  41275. _hideIndicator: function() {
  41276. var t = this._shapes;
  41277. t.indicator && t.indicator.attr("invisible", !0),
  41278. t.indicatorLabel && t.indicatorLabel.attr("invisible", !0)
  41279. },
  41280. _clearHoverLinkToSeries: function() {
  41281. this._hideIndicator();
  41282. var t = this._hoverLinkDataIndices;
  41283. this._dispatchHighDown("downplay", BL(t, this.visualMapModel)),
  41284. t.length = 0
  41285. },
  41286. _clearHoverLinkFromSeries: function() {
  41287. this._hideIndicator();
  41288. var t = this.api.getZr();
  41289. t.off("mouseover", this._hoverLinkFromSeriesMouseOver),
  41290. t.off("mouseout", this._hideIndicator)
  41291. },
  41292. _applyTransform: function(t, e, i, n) {
  41293. var o = fl(e, n ? null : this.group);
  41294. return bl[L(t) ? "applyTransform" : "transformDirection"](t, o, i)
  41295. },
  41296. _dispatchHighDown: function(t, e) {
  41297. e && e.length && this.api.dispatchAction({
  41298. type: t,
  41299. batch: e
  41300. })
  41301. },
  41302. dispose: function() {
  41303. this._clearHoverLinkFromSeries(),
  41304. this._clearHoverLinkToSeries()
  41305. },
  41306. remove: function() {
  41307. this._clearHoverLinkFromSeries(),
  41308. this._clearHoverLinkToSeries()
  41309. }
  41310. });
  41311. function ZL(t, e, i, n) {
  41312. return new Qr({
  41313. shape: {
  41314. points: t
  41315. },
  41316. draggable: !!i,
  41317. cursor: e,
  41318. drift: i,
  41319. onmousemove: function(t) {
  41320. Xt(t.event)
  41321. },
  41322. ondragend: n
  41323. })
  41324. }
  41325. function UL(t) {
  41326. var e = t.get("hoverLinkOnHandle");
  41327. return !!(null == e ? t.get("realtime") : e)
  41328. }
  41329. function XL(t) {
  41330. return "vertical" === t ? "ns-resize" : "ew-resize"
  41331. }
  41332. _f({
  41333. type: "selectDataRange",
  41334. event: "dataRangeSelected",
  41335. update: "update"
  41336. }, function(e, t) {
  41337. t.eachComponent({
  41338. mainType: "visualMap",
  41339. query: e
  41340. }, function(t) {
  41341. t.setSelected(e.selected)
  41342. })
  41343. }),
  41344. yf(yL);
  41345. var YL = PL.extend({
  41346. type: "visualMap.piecewise",
  41347. defaultOption: {
  41348. selected: null,
  41349. minOpen: !1,
  41350. maxOpen: !1,
  41351. align: "auto",
  41352. itemWidth: 20,
  41353. itemHeight: 14,
  41354. itemSymbol: "roundRect",
  41355. pieceList: null,
  41356. categories: null,
  41357. splitNumber: 5,
  41358. selectedMode: "multiple",
  41359. itemGap: 10,
  41360. hoverLink: !0,
  41361. showLabel: null
  41362. },
  41363. optionUpdated: function(t, e) {
  41364. YL.superApply(this, "optionUpdated", arguments),
  41365. this._pieceList = [],
  41366. this.resetExtent();
  41367. var i = this._mode = this._determineMode();
  41368. jL[this._mode].call(this),
  41369. this._resetSelected(t, e);
  41370. var n = this.option.categories;
  41371. this.resetVisual(function(t, e) {
  41372. "categories" === i ? (t.mappingMethod = "category",
  41373. t.categories = k(n)) : (t.dataExtent = this.getExtent(),
  41374. t.mappingMethod = "piecewise",
  41375. t.pieceList = O(this._pieceList, function(t) {
  41376. t = k(t);
  41377. return "inRange" !== e && (t.visual = null),
  41378. t
  41379. }))
  41380. })
  41381. },
  41382. completeVisualOption: function() {
  41383. var n = this.option
  41384. , i = {}
  41385. , t = g_.listVisualTypes()
  41386. , o = this.isCategory();
  41387. function a(t, e, i) {
  41388. return t && t[e] && (z(t[e]) ? t[e].hasOwnProperty(i) : t[e] === i)
  41389. }
  41390. E(n.pieces, function(e) {
  41391. E(t, function(t) {
  41392. e.hasOwnProperty(t) && (i[t] = 1)
  41393. })
  41394. }),
  41395. E(i, function(t, e) {
  41396. var i = 0;
  41397. E(this.stateList, function(t) {
  41398. i |= a(n, t, e) || a(n.target, t, e)
  41399. }, this),
  41400. i || E(this.stateList, function(t) {
  41401. (n[t] || (n[t] = {}))[e] = ML(e, "inRange" === t ? "active" : "inactive", o)
  41402. })
  41403. }, this),
  41404. PL.prototype.completeVisualOption.apply(this, arguments)
  41405. },
  41406. _resetSelected: function(t, e) {
  41407. var i = this.option
  41408. , n = this._pieceList
  41409. , o = (e ? i : t).selected || {};
  41410. if (i.selected = o,
  41411. E(n, function(t, e) {
  41412. var i = this.getSelectedMapKey(t);
  41413. o.hasOwnProperty(i) || (o[i] = !0)
  41414. }, this),
  41415. "single" === i.selectedMode) {
  41416. var a = !1;
  41417. E(n, function(t, e) {
  41418. var i = this.getSelectedMapKey(t);
  41419. o[i] && (a ? o[i] = !1 : a = !0)
  41420. }, this)
  41421. }
  41422. },
  41423. getSelectedMapKey: function(t) {
  41424. return "categories" === this._mode ? t.value + "" : t.index + ""
  41425. },
  41426. getPieceList: function() {
  41427. return this._pieceList
  41428. },
  41429. _determineMode: function() {
  41430. var t = this.option;
  41431. return t.pieces && 0 < t.pieces.length ? "pieces" : this.option.categories ? "categories" : "splitNumber"
  41432. },
  41433. setSelected: function(t) {
  41434. this.option.selected = k(t)
  41435. },
  41436. getValueState: function(t) {
  41437. var e = g_.findPieceIndex(t, this._pieceList);
  41438. return null != e && this.option.selected[this.getSelectedMapKey(this._pieceList[e])] ? "inRange" : "outOfRange"
  41439. },
  41440. findTargetDataIndices: function(n) {
  41441. var o = [];
  41442. return this.eachTargetSeries(function(t) {
  41443. var i = []
  41444. , e = t.getData();
  41445. e.each(this.getDataDimension(e), function(t, e) {
  41446. g_.findPieceIndex(t, this._pieceList) === n && i.push(e)
  41447. }, this),
  41448. o.push({
  41449. seriesId: t.id,
  41450. dataIndex: i
  41451. })
  41452. }, this),
  41453. o
  41454. },
  41455. getRepresentValue: function(t) {
  41456. var e;
  41457. if (this.isCategory())
  41458. e = t.value;
  41459. else if (null != t.value)
  41460. e = t.value;
  41461. else {
  41462. var i = t.interval || [];
  41463. e = i[0] === -1 / 0 && i[1] === 1 / 0 ? 0 : (i[0] + i[1]) / 2
  41464. }
  41465. return e
  41466. },
  41467. getVisualMeta: function(o) {
  41468. if (!this.isCategory()) {
  41469. var a = []
  41470. , r = []
  41471. , s = this
  41472. , t = this._pieceList.slice();
  41473. if (t.length) {
  41474. var e = t[0].interval[0];
  41475. e !== -1 / 0 && t.unshift({
  41476. interval: [-1 / 0, e]
  41477. }),
  41478. (e = t[t.length - 1].interval[1]) !== 1 / 0 && t.push({
  41479. interval: [e, 1 / 0]
  41480. })
  41481. } else
  41482. t.push({
  41483. interval: [-1 / 0, 1 / 0]
  41484. });
  41485. var i = -1 / 0;
  41486. return E(t, function(t) {
  41487. var e = t.interval;
  41488. e && (e[0] > i && n([i, e[0]], "outOfRange"),
  41489. n(e.slice()),
  41490. i = e[1])
  41491. }, this),
  41492. {
  41493. stops: a,
  41494. outerColors: r
  41495. }
  41496. }
  41497. function n(t, e) {
  41498. var i = s.getRepresentValue({
  41499. interval: t
  41500. });
  41501. e = e || s.getValueState(i);
  41502. var n = o(i, e);
  41503. t[0] === -1 / 0 ? r[0] = n : t[1] === 1 / 0 ? r[1] = n : a.push({
  41504. value: t[0],
  41505. color: n
  41506. }, {
  41507. value: t[1],
  41508. color: n
  41509. })
  41510. }
  41511. }
  41512. })
  41513. , jL = {
  41514. splitNumber: function() {
  41515. var t = this.option
  41516. , e = this._pieceList
  41517. , i = Math.min(t.precision, 20)
  41518. , n = this.getExtent()
  41519. , o = t.splitNumber;
  41520. o = Math.max(parseInt(o, 10), 1),
  41521. t.splitNumber = o;
  41522. for (var a = (n[1] - n[0]) / o; +a.toFixed(i) !== a && i < 5; )
  41523. i++;
  41524. t.precision = i,
  41525. a = +a.toFixed(i),
  41526. t.minOpen && e.push({
  41527. interval: [-1 / 0, n[0]],
  41528. close: [0, 0]
  41529. });
  41530. for (var r = 0, s = n[0]; r < o; s += a,
  41531. r++) {
  41532. var l = r === o - 1 ? n[1] : s + a;
  41533. e.push({
  41534. interval: [s, l],
  41535. close: [1, 1]
  41536. })
  41537. }
  41538. t.maxOpen && e.push({
  41539. interval: [n[1], 1 / 0],
  41540. close: [0, 0]
  41541. }),
  41542. $l(e),
  41543. E(e, function(t, e) {
  41544. t.index = e,
  41545. t.text = this.formatValueText(t.interval)
  41546. }, this)
  41547. },
  41548. categories: function() {
  41549. var t = this.option;
  41550. E(t.categories, function(t) {
  41551. this._pieceList.push({
  41552. text: this.formatValueText(t, !0),
  41553. value: t
  41554. })
  41555. }, this),
  41556. qL(t, this._pieceList)
  41557. },
  41558. pieces: function() {
  41559. var t = this.option
  41560. , d = this._pieceList;
  41561. E(t.pieces, function(t, e) {
  41562. z(t) || (t = {
  41563. value: t
  41564. });
  41565. var i = {
  41566. text: "",
  41567. index: e
  41568. };
  41569. if (null != t.label && (i.text = t.label),
  41570. t.hasOwnProperty("value")) {
  41571. var n = i.value = t.value;
  41572. i.interval = [n, n],
  41573. i.close = [1, 1]
  41574. } else {
  41575. for (var o = i.interval = [], a = i.close = [0, 0], r = [1, 0, 1], s = [-1 / 0, 1 / 0], l = [], u = 0; u < 2; u++) {
  41576. for (var h = [["gte", "gt", "min"], ["lte", "lt", "max"]][u], c = 0; c < 3 && null == o[u]; c++)
  41577. o[u] = t[h[c]],
  41578. a[u] = r[c],
  41579. l[u] = 2 === c;
  41580. null == o[u] && (o[u] = s[u])
  41581. }
  41582. l[0] && o[1] === 1 / 0 && (a[0] = 0),
  41583. l[1] && o[0] === -1 / 0 && (a[1] = 0),
  41584. o[0] === o[1] && a[0] && a[1] && (i.value = o[0])
  41585. }
  41586. i.visual = g_.retrieveVisuals(t),
  41587. d.push(i)
  41588. }, this),
  41589. qL(t, d),
  41590. $l(d),
  41591. E(d, function(t) {
  41592. var e = t.close
  41593. , i = [["<", "≤"][e[1]], [">", "≥"][e[0]]];
  41594. t.text = t.text || this.formatValueText(null != t.value ? t.value : t.interval, !1, i)
  41595. }, this)
  41596. }
  41597. };
  41598. function qL(t, e) {
  41599. var i = t.inverse;
  41600. ("vertical" === t.orient ? !i : i) && e.reverse()
  41601. }
  41602. RL.extend({
  41603. type: "visualMap.piecewise",
  41604. doRender: function() {
  41605. var a = this.group;
  41606. a.removeAll();
  41607. var r = this.visualMapModel
  41608. , s = r.get("textGap")
  41609. , t = r.textStyleModel
  41610. , l = t.getFont()
  41611. , u = t.getTextColor()
  41612. , h = this._getItemAlign()
  41613. , c = r.itemSize
  41614. , e = this._getViewData()
  41615. , i = e.endsText
  41616. , d = W(r.get("showLabel", !0), !i);
  41617. i && this._renderEndsText(a, i[0], c, d, h),
  41618. E(e.viewPieceList, function(t) {
  41619. var e = t.piece
  41620. , i = new Ci;
  41621. i.onclick = A(this._onItemClick, this, e),
  41622. this._enableHoverLink(i, t.indexInModelPieceList);
  41623. var n = r.getRepresentValue(e);
  41624. if (this._createItemSymbol(i, n, [0, 0, c[0], c[1]]),
  41625. d) {
  41626. var o = this.visualMapModel.getValueState(n);
  41627. i.add(new Ur({
  41628. style: {
  41629. x: "right" === h ? -s : c[0] + s,
  41630. y: c[1] / 2,
  41631. text: e.text,
  41632. textVerticalAlign: "middle",
  41633. textAlign: h,
  41634. textFont: l,
  41635. textFill: u,
  41636. opacity: "outOfRange" === o ? .5 : 1
  41637. }
  41638. }))
  41639. }
  41640. a.add(i)
  41641. }, this),
  41642. i && this._renderEndsText(a, i[1], c, d, h),
  41643. wu(r.get("orient"), a, r.get("itemGap")),
  41644. this.renderBackground(a),
  41645. this.positionGroup(a)
  41646. },
  41647. _enableHoverLink: function(t, i) {
  41648. function e(t) {
  41649. var e = this.visualMapModel;
  41650. e.option.hoverLink && this.api.dispatchAction({
  41651. type: t,
  41652. batch: BL(e.findTargetDataIndices(i), e)
  41653. })
  41654. }
  41655. t.on("mouseover", A(e, this, "highlight")).on("mouseout", A(e, this, "downplay"))
  41656. },
  41657. _getItemAlign: function() {
  41658. var t = this.visualMapModel
  41659. , e = t.option;
  41660. if ("vertical" === e.orient)
  41661. return zL(t, this.api, t.itemSize);
  41662. var i = e.align;
  41663. return i && "auto" !== i || (i = "left"),
  41664. i
  41665. },
  41666. _renderEndsText: function(t, e, i, n, o) {
  41667. if (e) {
  41668. var a = new Ci
  41669. , r = this.visualMapModel.textStyleModel;
  41670. a.add(new Ur({
  41671. style: {
  41672. x: n ? "right" === o ? i[0] : 0 : i[0] / 2,
  41673. y: i[1] / 2,
  41674. textVerticalAlign: "middle",
  41675. textAlign: n ? o : "center",
  41676. text: e,
  41677. textFont: r.getFont(),
  41678. textFill: r.getTextColor()
  41679. }
  41680. })),
  41681. t.add(a)
  41682. }
  41683. },
  41684. _getViewData: function() {
  41685. var t = this.visualMapModel
  41686. , e = O(t.getPieceList(), function(t, e) {
  41687. return {
  41688. piece: t,
  41689. indexInModelPieceList: e
  41690. }
  41691. })
  41692. , i = t.get("text")
  41693. , n = t.get("orient")
  41694. , o = t.get("inverse");
  41695. return ("horizontal" === n ? o : !o) ? e.reverse() : i = i && i.slice().reverse(),
  41696. {
  41697. viewPieceList: e,
  41698. endsText: i
  41699. }
  41700. },
  41701. _createItemSymbol: function(t, e, i) {
  41702. t.add(wg(this.getControllerVisual(e, "symbol"), i[0], i[1], i[2], i[3], this.getControllerVisual(e, "color")))
  41703. },
  41704. _onItemClick: function(t) {
  41705. var e = this.visualMapModel
  41706. , i = e.option
  41707. , n = k(i.selected)
  41708. , o = e.getSelectedMapKey(t);
  41709. "single" === i.selectedMode ? (n[o] = !0,
  41710. E(n, function(t, e) {
  41711. n[e] = e === o
  41712. })) : n[o] = !n[o],
  41713. this.api.dispatchAction({
  41714. type: "selectDataRange",
  41715. from: this.uid,
  41716. visualMapId: this.visualMapModel.id,
  41717. selected: n
  41718. })
  41719. }
  41720. });
  41721. yf(yL);
  41722. var KL, $L = "urn:schemas-microsoft-com:vml", JL = "undefined" == typeof window ? null : window, QL = !1, tk = JL && JL.document;
  41723. function ek(t) {
  41724. return KL(t)
  41725. }
  41726. if (tk && !v.canvasSupported)
  41727. try {
  41728. tk.namespaces.zrvml || tk.namespaces.add("zrvml", $L),
  41729. KL = function(t) {
  41730. return tk.createElement("<zrvml:" + t + ' class="zrvml">')
  41731. }
  41732. } catch (t) {
  41733. KL = function(t) {
  41734. return tk.createElement("<" + t + ' xmlns="' + $L + '" class="zrvml">')
  41735. }
  41736. }
  41737. var ik, nk = rr.CMD, ok = Math.round, ak = Math.sqrt, rk = Math.abs, sk = Math.cos, lk = Math.sin, uk = Math.max;
  41738. if (!v.canvasSupported) {
  41739. var hk = ","
  41740. , ck = "progid:DXImageTransform.Microsoft"
  41741. , dk = 21600
  41742. , fk = dk / 2
  41743. , pk = function(t) {
  41744. t.style.cssText = "position:absolute;left:0;top:0;width:1px;height:1px;",
  41745. t.coordsize = dk + "," + dk,
  41746. t.coordorigin = "0,0"
  41747. }
  41748. , gk = function(t, e, i) {
  41749. return "rgb(" + [t, e, i].join(",") + ")"
  41750. }
  41751. , mk = function(t, e) {
  41752. e && t && e.parentNode !== t && t.appendChild(e)
  41753. }
  41754. , vk = function(t, e) {
  41755. e && t && e.parentNode === t && t.removeChild(e)
  41756. }
  41757. , yk = function(t, e, i) {
  41758. return 1e5 * (parseFloat(t) || 0) + 1e3 * (parseFloat(e) || 0) + i
  41759. }
  41760. , xk = Yn
  41761. , _k = function(t, e, i) {
  41762. var n = Fe(e);
  41763. i = +i,
  41764. isNaN(i) && (i = 1),
  41765. n && (t.color = gk(n[0], n[1], n[2]),
  41766. t.opacity = i * n[3])
  41767. }
  41768. , wk = function(t, e, i, n) {
  41769. var o = "fill" === e
  41770. , a = t.getElementsByTagName(e)[0];
  41771. null != i[e] && "none" !== i[e] && (o || !o && i.lineWidth) ? (t[o ? "filled" : "stroked"] = "true",
  41772. i[e]instanceof cs && vk(t, a),
  41773. a = a || ek(e),
  41774. o ? function(t, e, i) {
  41775. var n, o, a = e.fill;
  41776. if (null != a)
  41777. if (a instanceof cs) {
  41778. var r, s = 0, l = [0, 0], u = 0, h = 1, c = i.getBoundingRect(), d = c.width, f = c.height;
  41779. if ("linear" === a.type) {
  41780. r = "gradient";
  41781. var p = i.transform
  41782. , g = [a.x * d, a.y * f]
  41783. , m = [a.x2 * d, a.y2 * f];
  41784. p && (bt(g, g, p),
  41785. bt(m, m, p));
  41786. var v = m[0] - g[0]
  41787. , y = m[1] - g[1];
  41788. (s = 180 * Math.atan2(v, y) / Math.PI) < 0 && (s += 360),
  41789. s < 1e-6 && (s = 0)
  41790. } else {
  41791. r = "gradientradial";
  41792. g = [a.x * d, a.y * f],
  41793. p = i.transform;
  41794. var x = i.scale
  41795. , _ = d
  41796. , w = f;
  41797. l = [(g[0] - c.x) / _, (g[1] - c.y) / w],
  41798. p && bt(g, g, p),
  41799. _ /= x[0] * dk,
  41800. w /= x[1] * dk;
  41801. var b = uk(_, w);
  41802. u = 0 / b,
  41803. h = 2 * a.r / b - u
  41804. }
  41805. var S = a.colorStops.slice();
  41806. S.sort(function(t, e) {
  41807. return t.offset - e.offset
  41808. });
  41809. for (var M = S.length, I = [], T = [], A = 0; A < M; A++) {
  41810. var D = S[A]
  41811. , C = (n = D.color,
  41812. void 0,
  41813. o = Fe(n),
  41814. [gk(o[0], o[1], o[2]), o[3]]);
  41815. T.push(D.offset * h + u + " " + C[0]),
  41816. 0 !== A && A !== M - 1 || I.push(C)
  41817. }
  41818. if (2 <= M) {
  41819. var L = I[0][0]
  41820. , k = I[1][0]
  41821. , P = I[0][1] * e.opacity
  41822. , N = I[1][1] * e.opacity;
  41823. t.type = r,
  41824. t.method = "none",
  41825. t.focus = "100%",
  41826. t.angle = s,
  41827. t.color = L,
  41828. t.color2 = k,
  41829. t.colors = T.join(","),
  41830. t.opacity = N,
  41831. t.opacity2 = P
  41832. }
  41833. "radial" === r && (t.focusposition = l.join(","))
  41834. } else
  41835. _k(t, a, e.opacity)
  41836. }(a, i, n) : function(t, e) {
  41837. e.lineDash && (t.dashstyle = e.lineDash.join(" ")),
  41838. null == e.stroke || e.stroke instanceof cs || _k(t, e.stroke, e.opacity)
  41839. }(a, i),
  41840. mk(t, a)) : (t[o ? "filled" : "stroked"] = "false",
  41841. vk(t, a))
  41842. }
  41843. , bk = [[], [], []];
  41844. Ar.prototype.brushVML = function(t) {
  41845. var e = this.style
  41846. , i = this._vmlEl;
  41847. i || (i = ek("shape"),
  41848. pk(i),
  41849. this._vmlEl = i),
  41850. wk(i, "fill", e, this),
  41851. wk(i, "stroke", e, this);
  41852. var n = this.transform
  41853. , o = null != n
  41854. , a = i.getElementsByTagName("stroke")[0];
  41855. if (a) {
  41856. var r = e.lineWidth;
  41857. if (o && !e.strokeNoScale) {
  41858. var s = n[0] * n[3] - n[1] * n[2];
  41859. r *= ak(rk(s))
  41860. }
  41861. a.weight = r + "px"
  41862. }
  41863. var l = this.path || (this.path = new rr);
  41864. this.__dirtyPath && (l.beginPath(),
  41865. l.subPixelOptimize = !1,
  41866. this.buildPath(l, this.shape),
  41867. l.toStatic(),
  41868. this.__dirtyPath = !1),
  41869. i.path = function(t, e) {
  41870. var i, n, o, a, r, s, l = nk.M, u = nk.C, h = nk.L, c = nk.A, d = nk.Q, f = [], p = t.data, g = t.len();
  41871. for (a = 0; a < g; ) {
  41872. switch (n = "",
  41873. i = 0,
  41874. o = p[a++]) {
  41875. case l:
  41876. n = " m ",
  41877. i = 1,
  41878. r = p[a++],
  41879. s = p[a++],
  41880. bk[0][0] = r,
  41881. bk[0][1] = s;
  41882. break;
  41883. case h:
  41884. n = " l ",
  41885. i = 1,
  41886. r = p[a++],
  41887. s = p[a++],
  41888. bk[0][0] = r,
  41889. bk[0][1] = s;
  41890. break;
  41891. case d:
  41892. case u:
  41893. n = " c ",
  41894. i = 3;
  41895. var m, v, y = p[a++], x = p[a++], _ = p[a++], w = p[a++];
  41896. o === d ? (_ = ((m = _) + 2 * y) / 3,
  41897. w = ((v = w) + 2 * x) / 3,
  41898. y = (r + 2 * y) / 3,
  41899. x = (s + 2 * x) / 3) : (m = p[a++],
  41900. v = p[a++]),
  41901. bk[0][0] = y,
  41902. bk[0][1] = x,
  41903. bk[1][0] = _,
  41904. bk[1][1] = w,
  41905. r = bk[2][0] = m,
  41906. s = bk[2][1] = v;
  41907. break;
  41908. case c:
  41909. var b = 0
  41910. , S = 0
  41911. , M = 1
  41912. , I = 1
  41913. , T = 0;
  41914. e && (b = e[4],
  41915. S = e[5],
  41916. M = ak(e[0] * e[0] + e[1] * e[1]),
  41917. I = ak(e[2] * e[2] + e[3] * e[3]),
  41918. T = Math.atan2(-e[1] / I, e[0] / M));
  41919. var A = p[a++]
  41920. , D = p[a++]
  41921. , C = p[a++]
  41922. , L = p[a++]
  41923. , k = p[a++] + T
  41924. , P = p[a++] + k + T;
  41925. a++;
  41926. var N = p[a++]
  41927. , O = A + sk(k) * C
  41928. , E = D + lk(k) * L
  41929. , R = (y = A + sk(P) * C,
  41930. x = D + lk(P) * L,
  41931. N ? " wa " : " at ");
  41932. Math.abs(O - y) < 1e-4 && (.01 < Math.abs(P - k) ? N && (O += .0125) : Math.abs(E - D) < 1e-4 ? N && O < A || !N && A < O ? x -= .0125 : x += .0125 : N && E < D || !N && D < E ? y += .0125 : y -= .0125),
  41933. f.push(R, ok(((A - C) * M + b) * dk - fk), hk, ok(((D - L) * I + S) * dk - fk), hk, ok(((A + C) * M + b) * dk - fk), hk, ok(((D + L) * I + S) * dk - fk), hk, ok((O * M + b) * dk - fk), hk, ok((E * I + S) * dk - fk), hk, ok((y * M + b) * dk - fk), hk, ok((x * I + S) * dk - fk)),
  41934. r = y,
  41935. s = x;
  41936. break;
  41937. case nk.R:
  41938. var z = bk[0]
  41939. , B = bk[1];
  41940. z[0] = p[a++],
  41941. z[1] = p[a++],
  41942. B[0] = z[0] + p[a++],
  41943. B[1] = z[1] + p[a++],
  41944. e && (bt(z, z, e),
  41945. bt(B, B, e)),
  41946. z[0] = ok(z[0] * dk - fk),
  41947. B[0] = ok(B[0] * dk - fk),
  41948. z[1] = ok(z[1] * dk - fk),
  41949. B[1] = ok(B[1] * dk - fk),
  41950. f.push(" m ", z[0], hk, z[1], " l ", B[0], hk, z[1], " l ", B[0], hk, B[1], " l ", z[0], hk, B[1]);
  41951. break;
  41952. case nk.Z:
  41953. f.push(" x ")
  41954. }
  41955. if (0 < i) {
  41956. f.push(n);
  41957. for (var V = 0; V < i; V++) {
  41958. var G = bk[V];
  41959. e && bt(G, G, e),
  41960. f.push(ok(G[0] * dk - fk), hk, ok(G[1] * dk - fk), V < i - 1 ? hk : "")
  41961. }
  41962. }
  41963. }
  41964. return f.join("")
  41965. }(l, this.transform),
  41966. i.style.zIndex = yk(this.zlevel, this.z, this.z2),
  41967. mk(t, i),
  41968. null != e.text ? this.drawRectText(t, this.getBoundingRect()) : this.removeRectText(t)
  41969. }
  41970. ,
  41971. Ar.prototype.onRemove = function(t) {
  41972. vk(t, this._vmlEl),
  41973. this.removeRectText(t)
  41974. }
  41975. ,
  41976. Ar.prototype.onAdd = function(t) {
  41977. mk(t, this._vmlEl),
  41978. this.appendRectText(t)
  41979. }
  41980. ;
  41981. Qn.prototype.brushVML = function(t) {
  41982. var e, i, n = this.style, o = n.image;
  41983. if (function(t) {
  41984. return "object" == typeof t && t.tagName && "IMG" === t.tagName.toUpperCase()
  41985. }(o)) {
  41986. var a = o.src;
  41987. if (a === this._imageSrc)
  41988. e = this._imageWidth,
  41989. i = this._imageHeight;
  41990. else {
  41991. var r = o.runtimeStyle
  41992. , s = r.width
  41993. , l = r.height;
  41994. r.width = "auto",
  41995. r.height = "auto",
  41996. e = o.width,
  41997. i = o.height,
  41998. r.width = s,
  41999. r.height = l,
  42000. this._imageSrc = a,
  42001. this._imageWidth = e,
  42002. this._imageHeight = i
  42003. }
  42004. o = a
  42005. } else
  42006. o === this._imageSrc && (e = this._imageWidth,
  42007. i = this._imageHeight);
  42008. if (o) {
  42009. var u = n.x || 0
  42010. , h = n.y || 0
  42011. , c = n.width
  42012. , d = n.height
  42013. , f = n.sWidth
  42014. , p = n.sHeight
  42015. , g = n.sx || 0
  42016. , m = n.sy || 0
  42017. , v = f && p
  42018. , y = this._vmlEl;
  42019. y || (y = tk.createElement("div"),
  42020. pk(y),
  42021. this._vmlEl = y);
  42022. var x, _ = y.style, w = !1, b = 1, S = 1;
  42023. if (this.transform && (x = this.transform,
  42024. b = ak(x[0] * x[0] + x[1] * x[1]),
  42025. S = ak(x[2] * x[2] + x[3] * x[3]),
  42026. w = x[1] || x[2]),
  42027. w) {
  42028. var M = [u, h]
  42029. , I = [u + c, h]
  42030. , T = [u, h + d]
  42031. , A = [u + c, h + d];
  42032. bt(M, M, x),
  42033. bt(I, I, x),
  42034. bt(T, T, x),
  42035. bt(A, A, x);
  42036. var D = uk(M[0], I[0], T[0], A[0])
  42037. , C = uk(M[1], I[1], T[1], A[1])
  42038. , L = [];
  42039. L.push("M11=", x[0] / b, hk, "M12=", x[2] / S, hk, "M21=", x[1] / b, hk, "M22=", x[3] / S, hk, "Dx=", ok(u * b + x[4]), hk, "Dy=", ok(h * S + x[5])),
  42040. _.padding = "0 " + ok(D) + "px " + ok(C) + "px 0",
  42041. _.filter = ck + ".Matrix(" + L.join("") + ", SizingMethod=clip)"
  42042. } else
  42043. x && (u = u * b + x[4],
  42044. h = h * S + x[5]),
  42045. _.filter = "",
  42046. _.left = ok(u) + "px",
  42047. _.top = ok(h) + "px";
  42048. var k = this._imageEl
  42049. , P = this._cropEl;
  42050. k || (k = tk.createElement("div"),
  42051. this._imageEl = k);
  42052. var N = k.style;
  42053. if (v) {
  42054. if (e && i)
  42055. N.width = ok(b * e * c / f) + "px",
  42056. N.height = ok(S * i * d / p) + "px";
  42057. else {
  42058. var O = new Image
  42059. , E = this;
  42060. O.onload = function() {
  42061. O.onload = null,
  42062. e = O.width,
  42063. i = O.height,
  42064. N.width = ok(b * e * c / f) + "px",
  42065. N.height = ok(S * i * d / p) + "px",
  42066. E._imageWidth = e,
  42067. E._imageHeight = i,
  42068. E._imageSrc = o
  42069. }
  42070. ,
  42071. O.src = o
  42072. }
  42073. P || ((P = tk.createElement("div")).style.overflow = "hidden",
  42074. this._cropEl = P);
  42075. var R = P.style;
  42076. R.width = ok((c + g * c / f) * b),
  42077. R.height = ok((d + m * d / p) * S),
  42078. R.filter = ck + ".Matrix(Dx=" + -g * c / f * b + ",Dy=" + -m * d / p * S + ")",
  42079. P.parentNode || y.appendChild(P),
  42080. k.parentNode !== P && P.appendChild(k)
  42081. } else
  42082. N.width = ok(b * c) + "px",
  42083. N.height = ok(S * d) + "px",
  42084. y.appendChild(k),
  42085. P && P.parentNode && (y.removeChild(P),
  42086. this._cropEl = null);
  42087. var z = ""
  42088. , B = n.opacity;
  42089. B < 1 && (z += ".Alpha(opacity=" + ok(100 * B) + ") "),
  42090. z += ck + ".AlphaImageLoader(src=" + o + ", SizingMethod=scale)",
  42091. N.filter = z,
  42092. y.style.zIndex = yk(this.zlevel, this.z, this.z2),
  42093. mk(t, y),
  42094. null != n.text && this.drawRectText(t, this.getBoundingRect())
  42095. }
  42096. }
  42097. ,
  42098. Qn.prototype.onRemove = function(t) {
  42099. vk(t, this._vmlEl),
  42100. this._vmlEl = null,
  42101. this._cropEl = null,
  42102. this._imageEl = null,
  42103. this.removeRectText(t)
  42104. }
  42105. ,
  42106. Qn.prototype.onAdd = function(t) {
  42107. mk(t, this._vmlEl),
  42108. this.appendRectText(t)
  42109. }
  42110. ;
  42111. var Sk, Mk = "normal", Ik = {}, Tk = 0, Ak = document.createElement("div");
  42112. ik = function(t, e) {
  42113. var i = tk;
  42114. Sk || ((Sk = i.createElement("div")).style.cssText = "position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",
  42115. tk.body.appendChild(Sk));
  42116. try {
  42117. Sk.style.font = e
  42118. } catch (t) {}
  42119. return Sk.innerHTML = "",
  42120. Sk.appendChild(i.createTextNode(t)),
  42121. {
  42122. width: Sk.offsetWidth
  42123. }
  42124. }
  42125. ,
  42126. fn["measureText"] = ik;
  42127. for (var Dk = new Di, Ck = function(t, e, i, n) {
  42128. var o = this.style;
  42129. this.__dirty && En(o);
  42130. var a = o.text;
  42131. if (null != a && (a += ""),
  42132. a) {
  42133. if (o.rich) {
  42134. var r = In(a, o);
  42135. a = [];
  42136. for (var s = 0; s < r.lines.length; s++) {
  42137. for (var l = r.lines[s].tokens, u = [], h = 0; h < l.length; h++)
  42138. u.push(l[h].text);
  42139. a.push(u.join(""))
  42140. }
  42141. a = a.join("\n")
  42142. }
  42143. var c, d, f = o.textAlign, p = o.textVerticalAlign, g = function(t) {
  42144. var e = Ik[t];
  42145. if (!e) {
  42146. 100 < Tk && (Tk = 0,
  42147. Ik = {});
  42148. var i, n = Ak.style;
  42149. try {
  42150. n.font = t,
  42151. i = n.fontFamily.split(",")[0]
  42152. } catch (t) {}
  42153. e = {
  42154. style: n.fontStyle || Mk,
  42155. variant: n.fontVariant || Mk,
  42156. weight: n.fontWeight || Mk,
  42157. size: 0 | parseFloat(n.fontSize || 12),
  42158. family: i || "Microsoft YaHei"
  42159. },
  42160. Ik[t] = e,
  42161. Tk++
  42162. }
  42163. return e
  42164. }(o.font), m = g.style + " " + g.variant + " " + g.weight + " " + g.size + 'px "' + g.family + '"';
  42165. i = i || gn(a, m, f, p, o.textPadding, o.textLineHeight);
  42166. var v = this.transform;
  42167. if (v && !n && (Dk.copy(e),
  42168. Dk.applyTransform(v),
  42169. e = Dk),
  42170. n)
  42171. c = e.x,
  42172. d = e.y;
  42173. else {
  42174. var y = o.textPosition;
  42175. if (y instanceof Array)
  42176. c = e.x + xk(y[0], e.width),
  42177. d = e.y + xk(y[1], e.height),
  42178. f = f || "left";
  42179. else {
  42180. var x = this.calculateTextPosition ? this.calculateTextPosition({}, o, e) : yn({}, o, e);
  42181. c = x.x,
  42182. d = x.y,
  42183. f = f || x.textAlign,
  42184. p = p || x.textVerticalAlign
  42185. }
  42186. }
  42187. c = mn(c, i.width, f),
  42188. d = vn(d, i.height, p),
  42189. d += i.height / 2;
  42190. var _, w, b, S = ek, M = this._textVmlEl;
  42191. M ? w = (_ = (b = M.firstChild).nextSibling).nextSibling : (M = S("line"),
  42192. _ = S("path"),
  42193. w = S("textpath"),
  42194. b = S("skew"),
  42195. w.style["v-text-align"] = "left",
  42196. pk(M),
  42197. _.textpathok = !0,
  42198. w.on = !0,
  42199. M.from = "0 0",
  42200. M.to = "1000 0.05",
  42201. mk(M, b),
  42202. mk(M, _),
  42203. mk(M, w),
  42204. this._textVmlEl = M);
  42205. var I = [c, d]
  42206. , T = M.style;
  42207. v && n ? (bt(I, I, v),
  42208. b.on = !0,
  42209. b.matrix = v[0].toFixed(3) + hk + v[2].toFixed(3) + hk + v[1].toFixed(3) + hk + v[3].toFixed(3) + ",0,0",
  42210. b.offset = (ok(I[0]) || 0) + "," + (ok(I[1]) || 0),
  42211. b.origin = "0 0",
  42212. T.left = "0px",
  42213. T.top = "0px") : (b.on = !1,
  42214. T.left = ok(c) + "px",
  42215. T.top = ok(d) + "px"),
  42216. w.string = function(t) {
  42217. return String(t).replace(/&/g, "&amp;").replace(/"/g, "&quot;")
  42218. }(a);
  42219. try {
  42220. w.style.font = m
  42221. } catch (t) {}
  42222. wk(M, "fill", {
  42223. fill: o.textFill,
  42224. opacity: o.opacity
  42225. }, this),
  42226. wk(M, "stroke", {
  42227. stroke: o.textStroke,
  42228. opacity: o.opacity,
  42229. lineDash: o.lineDash || null
  42230. }, this),
  42231. M.style.zIndex = yk(this.zlevel, this.z, this.z2),
  42232. mk(t, M)
  42233. }
  42234. }, Lk = function(t) {
  42235. vk(t, this._textVmlEl),
  42236. this._textVmlEl = null
  42237. }, kk = function(t) {
  42238. mk(t, this._textVmlEl)
  42239. }, Pk = [Kn, Jn, Qn, Ar, Ur], Nk = 0; Nk < Pk.length; Nk++) {
  42240. var Ok = Pk[Nk].prototype;
  42241. Ok.drawRectText = Ck,
  42242. Ok.removeRectText = Lk,
  42243. Ok.appendRectText = kk
  42244. }
  42245. Ur.prototype.brushVML = function(t) {
  42246. var e = this.style;
  42247. null != e.text ? this.drawRectText(t, {
  42248. x: e.x || 0,
  42249. y: e.y || 0,
  42250. width: 0,
  42251. height: 0
  42252. }, this.getBoundingRect(), !0) : this.removeRectText(t)
  42253. }
  42254. ,
  42255. Ur.prototype.onRemove = function(t) {
  42256. this.removeRectText(t)
  42257. }
  42258. ,
  42259. Ur.prototype.onAdd = function(t) {
  42260. this.appendRectText(t)
  42261. }
  42262. }
  42263. function Ek(t) {
  42264. return parseInt(t, 10)
  42265. }
  42266. function Rk(t, e) {
  42267. !function() {
  42268. if (!QL && tk) {
  42269. QL = !0;
  42270. var t = tk.styleSheets;
  42271. t.length < 31 ? tk.createStyleSheet().addRule(".zrvml", "behavior:url(#default#VML)") : t[0].addRule(".zrvml", "behavior:url(#default#VML)")
  42272. }
  42273. }(),
  42274. this.root = t,
  42275. this.storage = e;
  42276. var i = document.createElement("div")
  42277. , n = document.createElement("div");
  42278. i.style.cssText = "display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",
  42279. n.style.cssText = "position:absolute;left:0;top:0;",
  42280. t.appendChild(i),
  42281. this._vmlRoot = n,
  42282. this._vmlViewport = i,
  42283. this.resize();
  42284. var o = e.delFromStorage
  42285. , a = e.addToStorage;
  42286. e.delFromStorage = function(t) {
  42287. o.call(e, t),
  42288. t && t.onRemove && t.onRemove(n)
  42289. }
  42290. ,
  42291. e.addToStorage = function(t) {
  42292. t.onAdd && t.onAdd(n),
  42293. a.call(e, t)
  42294. }
  42295. ,
  42296. this._firstPaint = !0
  42297. }
  42298. Rk.prototype = {
  42299. constructor: Rk,
  42300. getType: function() {
  42301. return "vml"
  42302. },
  42303. getViewportRoot: function() {
  42304. return this._vmlViewport
  42305. },
  42306. getViewportRootOffset: function() {
  42307. var t = this.getViewportRoot();
  42308. if (t)
  42309. return {
  42310. offsetLeft: t.offsetLeft || 0,
  42311. offsetTop: t.offsetTop || 0
  42312. }
  42313. },
  42314. refresh: function() {
  42315. var t = this.storage.getDisplayList(!0, !0);
  42316. this._paintList(t)
  42317. },
  42318. _paintList: function(t) {
  42319. for (var e = this._vmlRoot, i = 0; i < t.length; i++) {
  42320. var n = t[i];
  42321. n.invisible || n.ignore ? (n.__alreadyNotVisible || n.onRemove(e),
  42322. n.__alreadyNotVisible = !0) : (n.__alreadyNotVisible && n.onAdd(e),
  42323. n.__alreadyNotVisible = !1,
  42324. n.__dirty && (n.beforeBrush && n.beforeBrush(),
  42325. (n.brushVML || n.brush).call(n, e),
  42326. n.afterBrush && n.afterBrush())),
  42327. n.__dirty = !1
  42328. }
  42329. this._firstPaint && (this._vmlViewport.appendChild(e),
  42330. this._firstPaint = !1)
  42331. },
  42332. resize: function(t, e) {
  42333. t = null == t ? this._getWidth() : t,
  42334. e = null == e ? this._getHeight() : e;
  42335. if (this._width !== t || this._height !== e) {
  42336. this._width = t,
  42337. this._height = e;
  42338. var i = this._vmlViewport.style;
  42339. i.width = t + "px",
  42340. i.height = e + "px"
  42341. }
  42342. },
  42343. dispose: function() {
  42344. this.root.innerHTML = "",
  42345. this._vmlRoot = this._vmlViewport = this.storage = null
  42346. },
  42347. getWidth: function() {
  42348. return this._width
  42349. },
  42350. getHeight: function() {
  42351. return this._height
  42352. },
  42353. clear: function() {
  42354. this._vmlViewport && this.root.removeChild(this._vmlViewport)
  42355. },
  42356. _getWidth: function() {
  42357. var t = this.root
  42358. , e = t.currentStyle;
  42359. return (t.clientWidth || Ek(e.width)) - Ek(e.paddingLeft) - Ek(e.paddingRight) | 0
  42360. },
  42361. _getHeight: function() {
  42362. var t = this.root
  42363. , e = t.currentStyle;
  42364. return (t.clientHeight || Ek(e.height)) - Ek(e.paddingTop) - Ek(e.paddingBottom) | 0
  42365. }
  42366. },
  42367. E(["getLayer", "insertLayer", "eachLayer", "eachBuiltinLayer", "eachOtherLayer", "getLayers", "modLayer", "delLayer", "clearLayer", "toDataURL", "pathToImage"], function(t) {
  42368. Rk.prototype[t] = function(t) {
  42369. return function() {
  42370. vi('In IE8.0 VML mode painter not support method "' + t + '"')
  42371. }
  42372. }(t)
  42373. }),
  42374. Po("vml", Rk);
  42375. function zk(t) {
  42376. return document.createElementNS("http://www.w3.org/2000/svg", t)
  42377. }
  42378. var Bk = rr.CMD
  42379. , Vk = Array.prototype.join
  42380. , Gk = "none"
  42381. , Fk = Math.round
  42382. , Wk = Math.sin
  42383. , Hk = Math.cos
  42384. , Zk = Math.PI
  42385. , Uk = 2 * Math.PI
  42386. , Xk = 180 / Zk
  42387. , Yk = 1e-4;
  42388. function jk(t) {
  42389. return Fk(1e4 * t) / 1e4
  42390. }
  42391. function qk(t) {
  42392. return t < Yk && -Yk < t
  42393. }
  42394. function Kk(t, e) {
  42395. e && $k(t, "transform", "matrix(" + Vk.call(e, ",") + ")")
  42396. }
  42397. function $k(t, e, i) {
  42398. i && ("linear" === i.type || "radial" === i.type) || t.setAttribute(e, i)
  42399. }
  42400. function Jk(t, e, i, n) {
  42401. if (function(t, e) {
  42402. var i = e ? t.textFill : t.fill;
  42403. return null != i && i !== Gk
  42404. }(e, i)) {
  42405. var o = i ? e.textFill : e.fill;
  42406. $k(t, "fill", o = "transparent" === o ? Gk : o),
  42407. $k(t, "fill-opacity", null != e.fillOpacity ? e.fillOpacity * e.opacity : e.opacity)
  42408. } else
  42409. $k(t, "fill", Gk);
  42410. if (function(t, e) {
  42411. var i = e ? t.textStroke : t.stroke;
  42412. return null != i && i !== Gk
  42413. }(e, i)) {
  42414. var a = i ? e.textStroke : e.stroke;
  42415. $k(t, "stroke", a = "transparent" === a ? Gk : a),
  42416. $k(t, "stroke-width", (i ? e.textStrokeWidth : e.lineWidth) / (!i && e.strokeNoScale ? n.getLineScale() : 1)),
  42417. $k(t, "paint-order", i ? "stroke" : "fill"),
  42418. $k(t, "stroke-opacity", null != e.strokeOpacity ? e.strokeOpacity : e.opacity),
  42419. e.lineDash ? ($k(t, "stroke-dasharray", e.lineDash.join(",")),
  42420. $k(t, "stroke-dashoffset", Fk(e.lineDashOffset || 0))) : $k(t, "stroke-dasharray", ""),
  42421. e.lineCap && $k(t, "stroke-linecap", e.lineCap),
  42422. e.lineJoin && $k(t, "stroke-linejoin", e.lineJoin),
  42423. e.miterLimit && $k(t, "stroke-miterlimit", e.miterLimit)
  42424. } else
  42425. $k(t, "stroke", Gk)
  42426. }
  42427. var Qk = {};
  42428. Qk.brush = function(t) {
  42429. var e = t.style
  42430. , i = t.__svgEl;
  42431. i || (i = zk("path"),
  42432. t.__svgEl = i),
  42433. t.path || t.createPathProxy();
  42434. var n = t.path;
  42435. if (t.__dirtyPath) {
  42436. n.beginPath(),
  42437. n.subPixelOptimize = !1,
  42438. t.buildPath(n, t.shape),
  42439. t.__dirtyPath = !1;
  42440. var o = function(t) {
  42441. for (var e = [], i = t.data, n = t.len(), o = 0; o < n; ) {
  42442. var a = ""
  42443. , r = 0;
  42444. switch (i[o++]) {
  42445. case Bk.M:
  42446. a = "M",
  42447. r = 2;
  42448. break;
  42449. case Bk.L:
  42450. a = "L",
  42451. r = 2;
  42452. break;
  42453. case Bk.Q:
  42454. a = "Q",
  42455. r = 4;
  42456. break;
  42457. case Bk.C:
  42458. a = "C",
  42459. r = 6;
  42460. break;
  42461. case Bk.A:
  42462. var s = i[o++]
  42463. , l = i[o++]
  42464. , u = i[o++]
  42465. , h = i[o++]
  42466. , c = i[o++]
  42467. , d = i[o++]
  42468. , f = i[o++]
  42469. , p = i[o++]
  42470. , g = Math.abs(d)
  42471. , m = qk(g - Uk) || (p ? Uk <= d : Uk <= -d)
  42472. , v = 0 < d ? d % Uk : d % Uk + Uk
  42473. , y = !1;
  42474. y = !!m || !qk(g) && Zk <= v == !!p;
  42475. var x = jk(s + u * Hk(c))
  42476. , _ = jk(l + h * Wk(c));
  42477. m && (d = p ? Uk - 1e-4 : 1e-4 - Uk,
  42478. y = !0,
  42479. 9 === o && e.push("M", x, _));
  42480. var w = jk(s + u * Hk(c + d))
  42481. , b = jk(l + h * Wk(c + d));
  42482. e.push("A", jk(u), jk(h), Fk(f * Xk), +y, +p, w, b);
  42483. break;
  42484. case Bk.Z:
  42485. a = "Z";
  42486. break;
  42487. case Bk.R:
  42488. w = jk(i[o++]),
  42489. b = jk(i[o++]);
  42490. var S = jk(i[o++])
  42491. , M = jk(i[o++]);
  42492. e.push("M", w, b, "L", w + S, b, "L", w + S, b + M, "L", w, b + M, "L", w, b)
  42493. }
  42494. a && e.push(a);
  42495. for (var I = 0; I < r; I++)
  42496. e.push(jk(i[o++]))
  42497. }
  42498. return e.join(" ")
  42499. }(n);
  42500. o.indexOf("NaN") < 0 && $k(i, "d", o)
  42501. }
  42502. Jk(i, e, !1, t),
  42503. Kk(i, t.transform),
  42504. null != e.text ? rP(t, t.getBoundingRect()) : lP(t)
  42505. }
  42506. ;
  42507. var tP = {
  42508. brush: function(t) {
  42509. var e = t.style
  42510. , i = e.image;
  42511. i instanceof HTMLImageElement && (i = i.src);
  42512. if (i) {
  42513. var n = e.x || 0
  42514. , o = e.y || 0
  42515. , a = e.width
  42516. , r = e.height
  42517. , s = t.__svgEl;
  42518. s || (s = zk("image"),
  42519. t.__svgEl = s),
  42520. i !== t.__imageSrc && (function(t, e, i) {
  42521. t.setAttributeNS("http://www.w3.org/1999/xlink", e, i)
  42522. }(s, "href", i),
  42523. t.__imageSrc = i),
  42524. $k(s, "width", a),
  42525. $k(s, "height", r),
  42526. $k(s, "x", n),
  42527. $k(s, "y", o),
  42528. Kk(s, t.transform),
  42529. null != e.text ? rP(t, t.getBoundingRect()) : lP(t)
  42530. }
  42531. }
  42532. }
  42533. , eP = {}
  42534. , iP = new Di
  42535. , nP = {}
  42536. , oP = []
  42537. , aP = {
  42538. left: "start",
  42539. right: "end",
  42540. center: "middle",
  42541. middle: "middle"
  42542. }
  42543. , rP = function(t, e) {
  42544. var i = t.style
  42545. , n = t.transform
  42546. , o = t instanceof Ur || i.transformText;
  42547. t.__dirty && En(i);
  42548. var a = i.text;
  42549. if (null != a && (a += ""),
  42550. qn(a, i)) {
  42551. null == a && (a = ""),
  42552. !o && n && (iP.copy(e),
  42553. iP.applyTransform(n),
  42554. e = iP);
  42555. var r = t.__textSvgEl;
  42556. r || (r = zk("text"),
  42557. t.__textSvgEl = r);
  42558. var s = r.style
  42559. , l = i.font || dn
  42560. , u = r.__computedFont;
  42561. l !== r.__styleFont && (s.font = r.__styleFont = l,
  42562. u = r.__computedFont = s.font);
  42563. var h = i.textPadding
  42564. , c = i.textLineHeight
  42565. , d = t.__textCotentBlock;
  42566. d && !t.__dirtyText || (d = t.__textCotentBlock = Mn(a, u, h, c, i.truncate));
  42567. var f = d.outerHeight
  42568. , p = d.lineHeight;
  42569. Hn(nP, t, i, e);
  42570. var g = nP.baseX
  42571. , m = nP.baseY
  42572. , v = nP.textAlign || "left"
  42573. , y = nP.textVerticalAlign;
  42574. !function(t, e, i, n, o, a, r) {
  42575. re(oP),
  42576. e && i && se(oP, i);
  42577. var s = n.textRotation;
  42578. if (o && s) {
  42579. var l = n.textOrigin;
  42580. "center" === l ? (a = o.width / 2 + o.x,
  42581. r = o.height / 2 + o.y) : l && (a = l[0] + o.x,
  42582. r = l[1] + o.y),
  42583. oP[4] -= a,
  42584. oP[5] -= r,
  42585. he(oP, oP, s),
  42586. oP[4] += a,
  42587. oP[5] += r
  42588. }
  42589. Kk(t, oP)
  42590. }(r, o, n, i, e, g, m);
  42591. var x = g
  42592. , _ = vn(m, f, y);
  42593. h && (x = function(t, e, i) {
  42594. return "right" === e ? t - i[1] : "center" === e ? t + i[3] / 2 - i[1] / 2 : t + i[3]
  42595. }(g, v, h),
  42596. _ += h[0]),
  42597. _ += p / 2,
  42598. Jk(r, i, !0, t);
  42599. var w = d.canCacheByTextString
  42600. , b = t.__tspanList || (t.__tspanList = [])
  42601. , S = b.length;
  42602. if (w && t.__canCacheByTextString && t.__text === a) {
  42603. if (t.__dirtyText && S)
  42604. for (var M = 0; M < S; ++M)
  42605. sP(b[M], v, x, _ + M * p)
  42606. } else {
  42607. t.__text = a,
  42608. t.__canCacheByTextString = w;
  42609. var I = d.lines
  42610. , T = I.length;
  42611. for (M = 0; M < T; M++) {
  42612. var A = b[M]
  42613. , D = I[M];
  42614. A ? A.__zrText !== D && (A.innerHTML = "",
  42615. A.appendChild(document.createTextNode(D))) : (A = b[M] = zk("tspan"),
  42616. r.appendChild(A),
  42617. A.appendChild(document.createTextNode(D))),
  42618. sP(A, v, x, _ + M * p)
  42619. }
  42620. if (T < S) {
  42621. for (; M < S; M++)
  42622. r.removeChild(b[M]);
  42623. b.length = T
  42624. }
  42625. }
  42626. }
  42627. };
  42628. function sP(t, e, i, n) {
  42629. $k(t, "dominant-baseline", "middle"),
  42630. $k(t, "text-anchor", aP[e]),
  42631. $k(t, "x", i),
  42632. $k(t, "y", n)
  42633. }
  42634. function lP(t) {
  42635. t && t.__textSvgEl && (t.__textSvgEl.parentNode && t.__textSvgEl.parentNode.removeChild(t.__textSvgEl),
  42636. t.__textSvgEl = null,
  42637. t.__tspanList = [],
  42638. t.__text = null)
  42639. }
  42640. function uP() {}
  42641. function hP(t, e) {
  42642. for (var i = 0, n = e.length, o = 0, a = 0; i < n; i++) {
  42643. var r = e[i];
  42644. if (r.removed) {
  42645. for (s = [],
  42646. l = a; l < a + r.count; l++)
  42647. s.push(l);
  42648. r.indices = s,
  42649. a += r.count
  42650. } else {
  42651. for (var s = [], l = o; l < o + r.count; l++)
  42652. s.push(l);
  42653. r.indices = s,
  42654. o += r.count,
  42655. r.added || (a += r.count)
  42656. }
  42657. }
  42658. return e
  42659. }
  42660. eP.drawRectText = rP,
  42661. eP.brush = function(t) {
  42662. null != t.style.text ? rP(t, !1) : lP(t)
  42663. }
  42664. ,
  42665. uP.prototype = {
  42666. diff: function(l, u, t) {
  42667. t = t || function(t, e) {
  42668. return t === e
  42669. }
  42670. ,
  42671. this.equals = t;
  42672. var h = this;
  42673. l = l.slice();
  42674. var c = (u = u.slice()).length
  42675. , d = l.length
  42676. , f = 1
  42677. , e = c + d
  42678. , p = [{
  42679. newPos: -1,
  42680. components: []
  42681. }]
  42682. , i = this.extractCommon(p[0], u, l, 0);
  42683. if (p[0].newPos + 1 >= c && d <= i + 1) {
  42684. for (var n = [], o = 0; o < u.length; o++)
  42685. n.push(o);
  42686. return [{
  42687. indices: n,
  42688. count: u.length
  42689. }]
  42690. }
  42691. function a() {
  42692. for (var t = -1 * f; t <= f; t += 2) {
  42693. var e, i = p[t - 1], n = p[t + 1], o = (n ? n.newPos : 0) - t;
  42694. i && (p[t - 1] = void 0);
  42695. var a = i && i.newPos + 1 < c
  42696. , r = n && 0 <= o && o < d;
  42697. if (a || r) {
  42698. if (!a || r && i.newPos < n.newPos ? (e = {
  42699. newPos: (s = n).newPos,
  42700. components: s.components.slice(0)
  42701. },
  42702. h.pushComponent(e.components, void 0, !0)) : ((e = i).newPos++,
  42703. h.pushComponent(e.components, !0, void 0)),
  42704. o = h.extractCommon(e, u, l, t),
  42705. e.newPos + 1 >= c && d <= o + 1)
  42706. return hP(h, e.components, u, l);
  42707. p[t] = e
  42708. } else
  42709. p[t] = void 0
  42710. }
  42711. var s;
  42712. f++
  42713. }
  42714. for (; f <= e; ) {
  42715. var r = a();
  42716. if (r)
  42717. return r
  42718. }
  42719. },
  42720. pushComponent: function(t, e, i) {
  42721. var n = t[t.length - 1];
  42722. n && n.added === e && n.removed === i ? t[t.length - 1] = {
  42723. count: n.count + 1,
  42724. added: e,
  42725. removed: i
  42726. } : t.push({
  42727. count: 1,
  42728. added: e,
  42729. removed: i
  42730. })
  42731. },
  42732. extractCommon: function(t, e, i, n) {
  42733. for (var o = e.length, a = i.length, r = t.newPos, s = r - n, l = 0; r + 1 < o && s + 1 < a && this.equals(e[r + 1], i[s + 1]); )
  42734. r++,
  42735. s++,
  42736. l++;
  42737. return l && t.components.push({
  42738. count: l
  42739. }),
  42740. t.newPos = r,
  42741. s
  42742. },
  42743. tokenize: function(t) {
  42744. return t.slice()
  42745. },
  42746. join: function(t) {
  42747. return t.slice()
  42748. }
  42749. };
  42750. var cP = new uP;
  42751. function dP(t, e, i, n, o) {
  42752. this._zrId = t,
  42753. this._svgRoot = e,
  42754. this._tagNames = "string" == typeof i ? [i] : i,
  42755. this._markLabel = n,
  42756. this._domName = o || "_dom",
  42757. this.nextId = 0
  42758. }
  42759. function fP(t, e) {
  42760. dP.call(this, t, e, ["linearGradient", "radialGradient"], "__gradient_in_use__")
  42761. }
  42762. function pP(t, e) {
  42763. dP.call(this, t, e, "clipPath", "__clippath_in_use__")
  42764. }
  42765. function gP(t, e) {
  42766. dP.call(this, t, e, ["filter"], "__filter_in_use__", "_shadowDom")
  42767. }
  42768. function mP(t) {
  42769. return t && (t.shadowBlur || t.shadowOffsetX || t.shadowOffsetY || t.textShadowBlur || t.textShadowOffsetX || t.textShadowOffsetY)
  42770. }
  42771. function vP(t) {
  42772. return parseInt(t, 10)
  42773. }
  42774. function yP(t, e) {
  42775. return e && t && e.parentNode !== t
  42776. }
  42777. function xP(t, e, i) {
  42778. if (yP(t, e) && i) {
  42779. var n = i.nextSibling;
  42780. n ? t.insertBefore(e, n) : t.appendChild(e)
  42781. }
  42782. }
  42783. function _P(t, e) {
  42784. if (yP(t, e)) {
  42785. var i = t.firstChild;
  42786. i ? t.insertBefore(e, i) : t.appendChild(e)
  42787. }
  42788. }
  42789. function wP(t, e) {
  42790. e && t && e.parentNode === t && t.removeChild(e)
  42791. }
  42792. function bP(t) {
  42793. return t.__textSvgEl
  42794. }
  42795. function SP(t) {
  42796. return t.__svgEl
  42797. }
  42798. dP.prototype.createElement = zk,
  42799. dP.prototype.getDefs = function(t) {
  42800. var e = this._svgRoot
  42801. , n = this._svgRoot.getElementsByTagName("defs");
  42802. return 0 === n.length ? t ? ((n = e.insertBefore(this.createElement("defs"), e.firstChild)).contains || (n.contains = function(t) {
  42803. var e = n.children;
  42804. if (!e)
  42805. return !1;
  42806. for (var i = e.length - 1; 0 <= i; --i)
  42807. if (e[i] === t)
  42808. return !0;
  42809. return !1
  42810. }
  42811. ),
  42812. n) : null : n[0]
  42813. }
  42814. ,
  42815. dP.prototype.update = function(t, e) {
  42816. if (t) {
  42817. var i = this.getDefs(!1);
  42818. if (t[this._domName] && i.contains(t[this._domName]))
  42819. "function" == typeof e && e(t);
  42820. else {
  42821. var n = this.add(t);
  42822. n && (t[this._domName] = n)
  42823. }
  42824. }
  42825. }
  42826. ,
  42827. dP.prototype.addDom = function(t) {
  42828. this.getDefs(!0).appendChild(t)
  42829. }
  42830. ,
  42831. dP.prototype.removeDom = function(t) {
  42832. var e = this.getDefs(!1);
  42833. e && t[this._domName] && (e.removeChild(t[this._domName]),
  42834. t[this._domName] = null)
  42835. }
  42836. ,
  42837. dP.prototype.getDoms = function() {
  42838. var i = this.getDefs(!1);
  42839. if (!i)
  42840. return [];
  42841. var n = [];
  42842. return E(this._tagNames, function(t) {
  42843. var e = i.getElementsByTagName(t);
  42844. n = n.concat([].slice.call(e))
  42845. }),
  42846. n
  42847. }
  42848. ,
  42849. dP.prototype.markAllUnused = function() {
  42850. var t = this.getDoms()
  42851. , e = this;
  42852. E(t, function(t) {
  42853. t[e._markLabel] = "0"
  42854. })
  42855. }
  42856. ,
  42857. dP.prototype.markUsed = function(t) {
  42858. t && (t[this._markLabel] = "1")
  42859. }
  42860. ,
  42861. dP.prototype.removeUnused = function() {
  42862. var e = this.getDefs(!1);
  42863. if (e) {
  42864. var t = this.getDoms()
  42865. , i = this;
  42866. E(t, function(t) {
  42867. "1" !== t[i._markLabel] && e.removeChild(t)
  42868. })
  42869. }
  42870. }
  42871. ,
  42872. dP.prototype.getSvgProxy = function(t) {
  42873. return t instanceof Ar ? Qk : t instanceof Qn ? tP : t instanceof Ur ? eP : Qk
  42874. }
  42875. ,
  42876. dP.prototype.getTextSvgElement = function(t) {
  42877. return t.__textSvgEl
  42878. }
  42879. ,
  42880. dP.prototype.getSvgElement = function(t) {
  42881. return t.__svgEl
  42882. }
  42883. ,
  42884. w(fP, dP),
  42885. fP.prototype.addWithoutUpdate = function(a, r) {
  42886. if (r && r.style) {
  42887. var s = this;
  42888. E(["fill", "stroke"], function(t) {
  42889. if (r.style[t] && ("linear" === r.style[t].type || "radial" === r.style[t].type)) {
  42890. var e, i = r.style[t], n = s.getDefs(!0);
  42891. i._dom ? (e = i._dom,
  42892. n.contains(i._dom) || s.addDom(e)) : e = s.add(i),
  42893. s.markUsed(r);
  42894. var o = e.getAttribute("id");
  42895. a.setAttribute(t, "url(#" + o + ")")
  42896. }
  42897. })
  42898. }
  42899. }
  42900. ,
  42901. fP.prototype.add = function(t) {
  42902. var e;
  42903. if ("linear" === t.type)
  42904. e = this.createElement("linearGradient");
  42905. else {
  42906. if ("radial" !== t.type)
  42907. return vi("Illegal gradient type."),
  42908. null;
  42909. e = this.createElement("radialGradient")
  42910. }
  42911. return t.id = t.id || this.nextId++,
  42912. e.setAttribute("id", "zr" + this._zrId + "-gradient-" + t.id),
  42913. this.updateDom(t, e),
  42914. this.addDom(e),
  42915. e
  42916. }
  42917. ,
  42918. fP.prototype.update = function(i) {
  42919. var n = this;
  42920. dP.prototype.update.call(this, i, function() {
  42921. var t = i.type
  42922. , e = i._dom.tagName;
  42923. "linear" === t && "linearGradient" === e || "radial" === t && "radialGradient" === e ? n.updateDom(i, i._dom) : (n.removeDom(i),
  42924. n.add(i))
  42925. })
  42926. }
  42927. ,
  42928. fP.prototype.updateDom = function(t, e) {
  42929. if ("linear" === t.type)
  42930. e.setAttribute("x1", t.x),
  42931. e.setAttribute("y1", t.y),
  42932. e.setAttribute("x2", t.x2),
  42933. e.setAttribute("y2", t.y2);
  42934. else {
  42935. if ("radial" !== t.type)
  42936. return void vi("Illegal gradient type.");
  42937. e.setAttribute("cx", t.x),
  42938. e.setAttribute("cy", t.y),
  42939. e.setAttribute("r", t.r)
  42940. }
  42941. t.global ? e.setAttribute("gradientUnits", "userSpaceOnUse") : e.setAttribute("gradientUnits", "objectBoundingBox"),
  42942. e.innerHTML = "";
  42943. for (var i = t.colorStops, n = 0, o = i.length; n < o; ++n) {
  42944. var a = this.createElement("stop");
  42945. a.setAttribute("offset", 100 * i[n].offset + "%");
  42946. var r = i[n].color;
  42947. if (r.indexOf(!1)) {
  42948. var s = Fe(r)[3]
  42949. , l = Ze(r);
  42950. a.setAttribute("stop-color", "#" + l),
  42951. a.setAttribute("stop-opacity", s)
  42952. } else
  42953. a.setAttribute("stop-color", i[n].color);
  42954. e.appendChild(a)
  42955. }
  42956. t._dom = e
  42957. }
  42958. ,
  42959. fP.prototype.markUsed = function(t) {
  42960. if (t.style) {
  42961. var e = t.style.fill;
  42962. e && e._dom && dP.prototype.markUsed.call(this, e._dom),
  42963. (e = t.style.stroke) && e._dom && dP.prototype.markUsed.call(this, e._dom)
  42964. }
  42965. }
  42966. ,
  42967. w(pP, dP),
  42968. pP.prototype.update = function(t) {
  42969. var e = this.getSvgElement(t);
  42970. e && this.updateDom(e, t.__clipPaths, !1);
  42971. var i = this.getTextSvgElement(t);
  42972. i && this.updateDom(i, t.__clipPaths, !0),
  42973. this.markUsed(t)
  42974. }
  42975. ,
  42976. pP.prototype.updateDom = function(t, e, i) {
  42977. if (e && 0 < e.length) {
  42978. var n, o, a = this.getDefs(!0), r = e[0], s = i ? "_textDom" : "_dom";
  42979. r[s] ? (o = r[s].getAttribute("id"),
  42980. n = r[s],
  42981. a.contains(n) || a.appendChild(n)) : (o = "zr" + this._zrId + "-clip-" + this.nextId,
  42982. ++this.nextId,
  42983. (n = this.createElement("clipPath")).setAttribute("id", o),
  42984. a.appendChild(n),
  42985. r[s] = n);
  42986. var l = this.getSvgProxy(r);
  42987. if (r.transform && r.parent.invTransform && !i) {
  42988. var u = Array.prototype.slice.call(r.transform);
  42989. le(r.transform, r.parent.invTransform, r.transform),
  42990. l.brush(r),
  42991. r.transform = u
  42992. } else
  42993. l.brush(r);
  42994. var h = this.getSvgElement(r);
  42995. n.innerHTML = "",
  42996. n.appendChild(h.cloneNode()),
  42997. t.setAttribute("clip-path", "url(#" + o + ")"),
  42998. 1 < e.length && this.updateDom(n, e.slice(1), i)
  42999. } else
  43000. t && t.setAttribute("clip-path", "none")
  43001. }
  43002. ,
  43003. pP.prototype.markUsed = function(t) {
  43004. var e = this;
  43005. t.__clipPaths && E(t.__clipPaths, function(t) {
  43006. t._dom && dP.prototype.markUsed.call(e, t._dom),
  43007. t._textDom && dP.prototype.markUsed.call(e, t._textDom)
  43008. })
  43009. }
  43010. ,
  43011. w(gP, dP),
  43012. gP.prototype.addWithoutUpdate = function(t, e) {
  43013. if (e && mP(e.style)) {
  43014. var i;
  43015. if (e._shadowDom)
  43016. i = e._shadowDom,
  43017. this.getDefs(!0).contains(e._shadowDom) || this.addDom(i);
  43018. else
  43019. i = this.add(e);
  43020. this.markUsed(e);
  43021. var n = i.getAttribute("id");
  43022. t.style.filter = "url(#" + n + ")"
  43023. }
  43024. }
  43025. ,
  43026. gP.prototype.add = function(t) {
  43027. var e = this.createElement("filter");
  43028. return t._shadowDomId = t._shadowDomId || this.nextId++,
  43029. e.setAttribute("id", "zr" + this._zrId + "-shadow-" + t._shadowDomId),
  43030. this.updateDom(t, e),
  43031. this.addDom(e),
  43032. e
  43033. }
  43034. ,
  43035. gP.prototype.update = function(t, e) {
  43036. if (mP(e.style)) {
  43037. var i = this;
  43038. dP.prototype.update.call(this, e, function() {
  43039. i.updateDom(e, e._shadowDom)
  43040. })
  43041. } else
  43042. this.remove(t, e)
  43043. }
  43044. ,
  43045. gP.prototype.remove = function(t, e) {
  43046. null != e._shadowDomId && (this.removeDom(t),
  43047. t.style.filter = "")
  43048. }
  43049. ,
  43050. gP.prototype.updateDom = function(t, e) {
  43051. var i = e.getElementsByTagName("feDropShadow");
  43052. i = 0 === i.length ? this.createElement("feDropShadow") : i[0];
  43053. var n, o, a, r, s = t.style, l = t.scale && t.scale[0] || 1, u = t.scale && t.scale[1] || 1;
  43054. if (s.shadowBlur || s.shadowOffsetX || s.shadowOffsetY)
  43055. n = s.shadowOffsetX || 0,
  43056. o = s.shadowOffsetY || 0,
  43057. a = s.shadowBlur,
  43058. r = s.shadowColor;
  43059. else {
  43060. if (!s.textShadowBlur)
  43061. return void this.removeDom(e, s);
  43062. n = s.textShadowOffsetX || 0,
  43063. o = s.textShadowOffsetY || 0,
  43064. a = s.textShadowBlur,
  43065. r = s.textShadowColor
  43066. }
  43067. i.setAttribute("dx", n / l),
  43068. i.setAttribute("dy", o / u),
  43069. i.setAttribute("flood-color", r);
  43070. var h = a / 2 / l + " " + a / 2 / u;
  43071. i.setAttribute("stdDeviation", h),
  43072. e.setAttribute("x", "-100%"),
  43073. e.setAttribute("y", "-100%"),
  43074. e.setAttribute("width", Math.ceil(a / 2 * 200) + "%"),
  43075. e.setAttribute("height", Math.ceil(a / 2 * 200) + "%"),
  43076. e.appendChild(i),
  43077. t._shadowDom = e
  43078. }
  43079. ,
  43080. gP.prototype.markUsed = function(t) {
  43081. t._shadowDom && dP.prototype.markUsed.call(this, t._shadowDom)
  43082. }
  43083. ;
  43084. function MP(t, e, i, n) {
  43085. this.root = t,
  43086. this.storage = e,
  43087. this._opts = i = P({}, i || {});
  43088. var o = zk("svg");
  43089. o.setAttribute("xmlns", "http://www.w3.org/2000/svg"),
  43090. o.setAttribute("version", "1.1"),
  43091. o.setAttribute("baseProfile", "full"),
  43092. o.style.cssText = "user-select:none;position:absolute;left:0;top:0;";
  43093. var a = zk("g");
  43094. o.appendChild(a);
  43095. var r = zk("g");
  43096. o.appendChild(r),
  43097. this.gradientManager = new fP(n,r),
  43098. this.clipPathManager = new pP(n,r),
  43099. this.shadowManager = new gP(n,r);
  43100. var s = document.createElement("div");
  43101. s.style.cssText = "overflow:hidden;position:relative",
  43102. this._svgDom = o,
  43103. this._svgRoot = r,
  43104. this._backgroundRoot = a,
  43105. this._viewport = s,
  43106. t.appendChild(s),
  43107. s.appendChild(o),
  43108. this.resize(i.width, i.height),
  43109. this._visibleList = []
  43110. }
  43111. MP.prototype = {
  43112. constructor: MP,
  43113. getType: function() {
  43114. return "svg"
  43115. },
  43116. getViewportRoot: function() {
  43117. return this._viewport
  43118. },
  43119. getSvgDom: function() {
  43120. return this._svgDom
  43121. },
  43122. getSvgRoot: function() {
  43123. return this._svgRoot
  43124. },
  43125. getViewportRootOffset: function() {
  43126. var t = this.getViewportRoot();
  43127. if (t)
  43128. return {
  43129. offsetLeft: t.offsetLeft || 0,
  43130. offsetTop: t.offsetTop || 0
  43131. }
  43132. },
  43133. refresh: function() {
  43134. var t = this.storage.getDisplayList(!0);
  43135. this._paintList(t)
  43136. },
  43137. setBackgroundColor: function(t) {
  43138. this._backgroundRoot && this._backgroundNode && this._backgroundRoot.removeChild(this._backgroundNode);
  43139. var e = zk("rect");
  43140. e.setAttribute("width", this.getWidth()),
  43141. e.setAttribute("height", this.getHeight()),
  43142. e.setAttribute("x", 0),
  43143. e.setAttribute("y", 0),
  43144. e.setAttribute("id", 0),
  43145. e.style.fill = t,
  43146. this._backgroundRoot.appendChild(e),
  43147. this._backgroundNode = e
  43148. },
  43149. _paintList: function(t) {
  43150. this.gradientManager.markAllUnused(),
  43151. this.clipPathManager.markAllUnused(),
  43152. this.shadowManager.markAllUnused();
  43153. var e, i, n = this._svgRoot, o = this._visibleList, a = t.length, r = [];
  43154. for (e = 0; e < a; e++) {
  43155. var s = t[e]
  43156. , l = (i = s)instanceof Ar ? Qk : i instanceof Qn ? tP : i instanceof Ur ? eP : Qk
  43157. , u = SP(s) || bP(s);
  43158. s.invisible || (s.__dirty && (l && l.brush(s),
  43159. this.clipPathManager.update(s),
  43160. s.style && (this.gradientManager.update(s.style.fill),
  43161. this.gradientManager.update(s.style.stroke),
  43162. this.shadowManager.update(u, s)),
  43163. s.__dirty = !1),
  43164. r.push(s))
  43165. }
  43166. var h, c = function(t, e, i) {
  43167. return cP.diff(t, e, i)
  43168. }(o, r);
  43169. for (e = 0; e < c.length; e++) {
  43170. if ((p = c[e]).removed)
  43171. for (var d = 0; d < p.count; d++) {
  43172. u = SP(s = o[p.indices[d]]);
  43173. var f = bP(s);
  43174. wP(n, u),
  43175. wP(n, f)
  43176. }
  43177. }
  43178. for (e = 0; e < c.length; e++) {
  43179. var p;
  43180. if ((p = c[e]).added)
  43181. for (d = 0; d < p.count; d++) {
  43182. u = SP(s = r[p.indices[d]]),
  43183. f = bP(s);
  43184. h ? xP(n, u, h) : _P(n, u),
  43185. u ? xP(n, f, u) : h ? xP(n, f, h) : _P(n, f),
  43186. xP(n, f, u),
  43187. h = f || u || h,
  43188. this.gradientManager.addWithoutUpdate(u || f, s),
  43189. this.shadowManager.addWithoutUpdate(u || f, s),
  43190. this.clipPathManager.markUsed(s)
  43191. }
  43192. else if (!p.removed)
  43193. for (d = 0; d < p.count; d++) {
  43194. u = SP(s = r[p.indices[d]]),
  43195. f = bP(s),
  43196. u = SP(s),
  43197. f = bP(s);
  43198. this.gradientManager.markUsed(s),
  43199. this.gradientManager.addWithoutUpdate(u || f, s),
  43200. this.shadowManager.markUsed(s),
  43201. this.shadowManager.addWithoutUpdate(u || f, s),
  43202. this.clipPathManager.markUsed(s),
  43203. f && xP(n, f, u),
  43204. h = u || f || h
  43205. }
  43206. }
  43207. this.gradientManager.removeUnused(),
  43208. this.clipPathManager.removeUnused(),
  43209. this.shadowManager.removeUnused(),
  43210. this._visibleList = r
  43211. },
  43212. _getDefs: function(t) {
  43213. var n, e = this._svgDom;
  43214. return 0 !== (n = e.getElementsByTagName("defs")).length ? n[0] : t ? ((n = e.insertBefore(zk("defs"), e.firstChild)).contains || (n.contains = function(t) {
  43215. var e = n.children;
  43216. if (!e)
  43217. return !1;
  43218. for (var i = e.length - 1; 0 <= i; --i)
  43219. if (e[i] === t)
  43220. return !0;
  43221. return !1
  43222. }
  43223. ),
  43224. n) : null
  43225. },
  43226. resize: function(t, e) {
  43227. var i = this._viewport;
  43228. i.style.display = "none";
  43229. var n = this._opts;
  43230. if (null != t && (n.width = t),
  43231. null != e && (n.height = e),
  43232. t = this._getSize(0),
  43233. e = this._getSize(1),
  43234. i.style.display = "",
  43235. this._width !== t || this._height !== e) {
  43236. this._width = t,
  43237. this._height = e;
  43238. var o = i.style;
  43239. o.width = t + "px",
  43240. o.height = e + "px";
  43241. var a = this._svgDom;
  43242. a.setAttribute("width", t),
  43243. a.setAttribute("height", e)
  43244. }
  43245. this._backgroundNode && (this._backgroundNode.setAttribute("width", t),
  43246. this._backgroundNode.setAttribute("height", e))
  43247. },
  43248. getWidth: function() {
  43249. return this._width
  43250. },
  43251. getHeight: function() {
  43252. return this._height
  43253. },
  43254. _getSize: function(t) {
  43255. var e = this._opts
  43256. , i = ["width", "height"][t]
  43257. , n = ["clientWidth", "clientHeight"][t]
  43258. , o = ["paddingLeft", "paddingTop"][t]
  43259. , a = ["paddingRight", "paddingBottom"][t];
  43260. if (null != e[i] && "auto" !== e[i])
  43261. return parseFloat(e[i]);
  43262. var r = this.root
  43263. , s = document.defaultView.getComputedStyle(r);
  43264. return (r[n] || vP(s[i]) || vP(r.style[i])) - (vP(s[o]) || 0) - (vP(s[a]) || 0) | 0
  43265. },
  43266. dispose: function() {
  43267. this.root.innerHTML = "",
  43268. this._svgRoot = this._backgroundRoot = this._svgDom = this._backgroundNode = this._viewport = this.storage = null
  43269. },
  43270. clear: function() {
  43271. this._viewport && this.root.removeChild(this._viewport)
  43272. },
  43273. toDataURL: function() {
  43274. return this.refresh(),
  43275. "data:image/svg+xml;charset=UTF-8," + encodeURIComponent(this._svgDom.outerHTML.replace(/></g, ">\n\r<"))
  43276. }
  43277. },
  43278. E(["getLayer", "insertLayer", "eachLayer", "eachBuiltinLayer", "eachOtherLayer", "getLayers", "modLayer", "delLayer", "clearLayer", "pathToImage"], function(t) {
  43279. MP.prototype[t] = function(t) {
  43280. return function() {
  43281. vi('In SVG mode painter not support method "' + t + '"')
  43282. }
  43283. }(t)
  43284. }),
  43285. Po("svg", MP),
  43286. t.version = "4.8.0",
  43287. t.dependencies = {
  43288. zrender: "4.3.1"
  43289. },
  43290. t.PRIORITY = Ld,
  43291. t.init = function(t, e, i) {
  43292. var n = mf(t);
  43293. if (n)
  43294. return n;
  43295. var o = new Rd(t,e,i);
  43296. return o.id = "ec_" + cf++,
  43297. uf[o.id] = o,
  43298. Jo(t, ff, o.id),
  43299. function(n) {
  43300. var o = "__connectUpdateStatus";
  43301. function a(t, e) {
  43302. for (var i = 0; i < t.length; i++) {
  43303. t[i][o] = e
  43304. }
  43305. }
  43306. Td(ef, function(t, e) {
  43307. n._messageCenter.on(e, function(t) {
  43308. if (hf[n.group] && 0 !== n[o]) {
  43309. if (t && t.escapeConnect)
  43310. return;
  43311. var e = n.makeActionFromEvent(t)
  43312. , i = [];
  43313. Td(uf, function(t) {
  43314. t !== n && t.group === n.group && i.push(t)
  43315. }),
  43316. a(i, 0),
  43317. Td(i, function(t) {
  43318. 1 !== t[o] && t.dispatchAction(e)
  43319. }),
  43320. a(i, 2)
  43321. }
  43322. })
  43323. })
  43324. }(o),
  43325. o
  43326. }
  43327. ,
  43328. t.connect = function(e) {
  43329. if (L(e)) {
  43330. var t = e;
  43331. e = null,
  43332. Td(t, function(t) {
  43333. null != t.group && (e = t.group)
  43334. }),
  43335. e = e || "g_" + df++,
  43336. Td(t, function(t) {
  43337. t.group = e
  43338. })
  43339. }
  43340. return hf[e] = !0,
  43341. e
  43342. }
  43343. ,
  43344. t.disConnect = pf,
  43345. t.disconnect = gf,
  43346. t.dispose = function(t) {
  43347. "string" == typeof t ? t = uf[t] : t instanceof Rd || (t = mf(t)),
  43348. t instanceof Rd && !t.isDisposed() && t.dispose()
  43349. }
  43350. ,
  43351. t.getInstanceByDom = mf,
  43352. t.getInstanceById = function(t) {
  43353. return uf[t]
  43354. }
  43355. ,
  43356. t.registerTheme = vf,
  43357. t.registerPreprocessor = yf,
  43358. t.registerProcessor = xf,
  43359. t.registerPostUpdate = function(t) {
  43360. af.push(t)
  43361. }
  43362. ,
  43363. t.registerAction = _f,
  43364. t.registerCoordinateSystem = wf,
  43365. t.getCoordinateSystemDimensions = function(t) {
  43366. var e = lh.get(t);
  43367. if (e)
  43368. return e.getDimensionsInfo ? e.getDimensionsInfo() : e.dimensions.slice()
  43369. }
  43370. ,
  43371. t.registerLayout = bf,
  43372. t.registerVisual = Sf,
  43373. t.registerLoading = If,
  43374. t.extendComponentModel = Tf,
  43375. t.extendComponentView = Af,
  43376. t.extendSeriesModel = Df,
  43377. t.extendChartView = Cf,
  43378. t.setCanvasCreator = function(t) {
  43379. f("createCanvas", t)
  43380. }
  43381. ,
  43382. t.registerMap = function(t, e, i) {
  43383. Sd.registerMap(t, e, i)
  43384. }
  43385. ,
  43386. t.getMap = function(t) {
  43387. var e = Sd.retrieveMap(t);
  43388. return e && e[0] && {
  43389. geoJson: e[0].geoJSON,
  43390. specialAreas: e[0].specialAreas
  43391. }
  43392. }
  43393. ,
  43394. t.dataTool = {},
  43395. t.zrender = Oo,
  43396. t.number = Ql,
  43397. t.format = mu,
  43398. t.throttle = Lc,
  43399. t.helper = Sg,
  43400. t.matrix = pe,
  43401. t.vector = It,
  43402. t.color = Je,
  43403. t.parseGeoJSON = Cg,
  43404. t.parseGeoJson = Wg,
  43405. t.util = Hg,
  43406. t.graphic = Zg,
  43407. t.List = Yf,
  43408. t.Model = Cl,
  43409. t.Axis = Gg,
  43410. t.env = v
  43411. });