12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742 |
- !function(t, e) {
- "object" == typeof exports && "undefined" != typeof module ? e(exports) : "function" == typeof define && define.amd ? define(["exports"], e) : e(t.echarts = {})
- }(this, function(t) {
- "use strict";
- function e(t) {
- if (null == t || "object" != typeof t)
- return t;
- var i = t
- , n = Jv.call(t);
- if ("[object Array]" === n) {
- i = [];
- for (var o = 0, a = t.length; o < a; o++)
- i[o] = e(t[o])
- } else if (Kv[n]) {
- var r = t.constructor;
- if (t.constructor.from)
- i = r.from(t);
- else {
- i = new r(t.length);
- for (var o = 0, a = t.length; o < a; o++)
- i[o] = e(t[o])
- }
- } else if (!$v[n] && !k(t) && !w(t)) {
- i = {};
- for (var s in t)
- t.hasOwnProperty(s) && (i[s] = e(t[s]))
- }
- return i
- }
- function i(t, n, o) {
- if (!_(n) || !_(t))
- return o ? e(n) : t;
- for (var a in n)
- if (n.hasOwnProperty(a)) {
- var r = t[a]
- , s = n[a];
- !_(s) || !_(r) || v(s) || v(r) || w(s) || w(r) || b(s) || b(r) || k(s) || k(r) ? !o && a in t || (t[a] = e(n[a], !0)) : i(r, s, o)
- }
- return t
- }
- function n(t, e) {
- for (var n = t[0], o = 1, a = t.length; o < a; o++)
- n = i(n, t[o], e);
- return n
- }
- function o(t, e) {
- for (var i in e)
- e.hasOwnProperty(i) && (t[i] = e[i]);
- return t
- }
- function a(t, e, i) {
- for (var n in e)
- e.hasOwnProperty(n) && (i ? null != e[n] : null == t[n]) && (t[n] = e[n]);
- return t
- }
- function r() {
- return Uv || (Uv = ay().getContext("2d")),
- Uv
- }
- function s(t, e) {
- if (t) {
- if (t.indexOf)
- return t.indexOf(e);
- for (var i = 0, n = t.length; i < n; i++)
- if (t[i] === e)
- return i
- }
- return -1
- }
- function l(t, e) {
- function i() {}
- var n = t.prototype;
- i.prototype = e.prototype,
- t.prototype = new i;
- for (var o in n)
- t.prototype[o] = n[o];
- t.prototype.constructor = t,
- t.superClass = e
- }
- function h(t, e, i) {
- a(t = "prototype"in t ? t.prototype : t, e = "prototype"in e ? e.prototype : e, i)
- }
- function u(t) {
- if (t)
- return "string" != typeof t && "number" == typeof t.length
- }
- function c(t, e, i) {
- if (t && e)
- if (t.forEach && t.forEach === ty)
- t.forEach(e, i);
- else if (t.length === +t.length)
- for (var n = 0, o = t.length; n < o; n++)
- e.call(i, t[n], n, t);
- else
- for (var a in t)
- t.hasOwnProperty(a) && e.call(i, t[a], a, t)
- }
- function d(t, e, i) {
- if (t && e) {
- if (t.map && t.map === ny)
- return t.map(e, i);
- for (var n = [], o = 0, a = t.length; o < a; o++)
- n.push(e.call(i, t[o], o, t));
- return n
- }
- }
- function f(t, e, i, n) {
- if (t && e) {
- if (t.reduce && t.reduce === oy)
- return t.reduce(e, i, n);
- for (var o = 0, a = t.length; o < a; o++)
- i = e.call(n, i, t[o], o, t);
- return i
- }
- }
- function g(t, e, i) {
- if (t && e) {
- if (t.filter && t.filter === ey)
- return t.filter(e, i);
- for (var n = [], o = 0, a = t.length; o < a; o++)
- e.call(i, t[o], o, t) && n.push(t[o]);
- return n
- }
- }
- function p(t, e) {
- var i = iy.call(arguments, 2);
- return function() {
- return t.apply(e, i.concat(iy.call(arguments)))
- }
- }
- function m(t) {
- var e = iy.call(arguments, 1);
- return function() {
- return t.apply(this, e.concat(iy.call(arguments)))
- }
- }
- function v(t) {
- return "[object Array]" === Jv.call(t)
- }
- function y(t) {
- return "function" == typeof t
- }
- function x(t) {
- return "[object String]" === Jv.call(t)
- }
- function _(t) {
- var e = typeof t;
- return "function" === e || !!t && "object" == e
- }
- function b(t) {
- return !!$v[Jv.call(t)]
- }
- function w(t) {
- return "object" == typeof t && "number" == typeof t.nodeType && "object" == typeof t.ownerDocument
- }
- function S(t) {
- return t !== t
- }
- function M(t) {
- for (var e = 0, i = arguments.length; e < i; e++)
- if (null != arguments[e])
- return arguments[e]
- }
- function I(t, e) {
- return null != t ? t : e
- }
- function T(t, e, i) {
- return null != t ? t : null != e ? e : i
- }
- function A() {
- return Function.call.apply(iy, arguments)
- }
- function C(t) {
- if ("number" == typeof t)
- return [t, t, t, t];
- var e = t.length;
- return 2 === e ? [t[0], t[1], t[0], t[1]] : 3 === e ? [t[0], t[1], t[2], t[1]] : t
- }
- function D(t, e) {
- if (!t)
- throw new Error(e)
- }
- function L(t) {
- t[ry] = !0
- }
- function k(t) {
- return t[ry]
- }
- function P(t) {
- t && c(t, function(t, e) {
- this.set(e, t)
- }, this)
- }
- function O(t) {
- return new P(t)
- }
- function z() {}
- function N(t, e) {
- var i = new hy(2);
- return null == t && (t = 0),
- null == e && (e = 0),
- i[0] = t,
- i[1] = e,
- i
- }
- function E(t, e) {
- return t[0] = e[0],
- t[1] = e[1],
- t
- }
- function R(t) {
- var e = new hy(2);
- return e[0] = t[0],
- e[1] = t[1],
- e
- }
- function V(t, e, i) {
- return t[0] = e,
- t[1] = i,
- t
- }
- function B(t, e, i) {
- return t[0] = e[0] + i[0],
- t[1] = e[1] + i[1],
- t
- }
- function G(t, e, i, n) {
- return t[0] = e[0] + i[0] * n,
- t[1] = e[1] + i[1] * n,
- t
- }
- function W(t, e, i) {
- return t[0] = e[0] - i[0],
- t[1] = e[1] - i[1],
- t
- }
- function H(t) {
- return Math.sqrt(F(t))
- }
- function F(t) {
- return t[0] * t[0] + t[1] * t[1]
- }
- function Z(t, e, i) {
- return t[0] = e[0] * i,
- t[1] = e[1] * i,
- t
- }
- function U(t, e) {
- var i = H(e);
- return 0 === i ? (t[0] = 0,
- t[1] = 0) : (t[0] = e[0] / i,
- t[1] = e[1] / i),
- t
- }
- function j(t, e) {
- return Math.sqrt((t[0] - e[0]) * (t[0] - e[0]) + (t[1] - e[1]) * (t[1] - e[1]))
- }
- function X(t, e) {
- return (t[0] - e[0]) * (t[0] - e[0]) + (t[1] - e[1]) * (t[1] - e[1])
- }
- function q(t, e, i, n) {
- return t[0] = e[0] + n * (i[0] - e[0]),
- t[1] = e[1] + n * (i[1] - e[1]),
- t
- }
- function Y(t, e, i) {
- var n = e[0]
- , o = e[1];
- return t[0] = i[0] * n + i[2] * o + i[4],
- t[1] = i[1] * n + i[3] * o + i[5],
- t
- }
- function $(t, e, i) {
- return t[0] = Math.min(e[0], i[0]),
- t[1] = Math.min(e[1], i[1]),
- t
- }
- function K(t, e, i) {
- return t[0] = Math.max(e[0], i[0]),
- t[1] = Math.max(e[1], i[1]),
- t
- }
- function J() {
- this.on("mousedown", this._dragStart, this),
- this.on("mousemove", this._drag, this),
- this.on("mouseup", this._dragEnd, this),
- this.on("globalout", this._dragEnd, this)
- }
- function Q(t, e) {
- return {
- target: t,
- topTarget: e && e.topTarget
- }
- }
- function tt(t, e, i) {
- return {
- type: t,
- event: i,
- target: e.target,
- topTarget: e.topTarget,
- cancelBubble: !1,
- offsetX: i.zrX,
- offsetY: i.zrY,
- gestureEvent: i.gestureEvent,
- pinchX: i.pinchX,
- pinchY: i.pinchY,
- pinchScale: i.pinchScale,
- wheelDelta: i.zrDelta,
- zrByTouch: i.zrByTouch,
- which: i.which
- }
- }
- function et() {}
- function it(t, e, i) {
- if (t[t.rectHover ? "rectContain" : "contain"](e, i)) {
- for (var n, o = t; o; ) {
- if (o.clipPath && !o.clipPath.contain(e, i))
- return !1;
- o.silent && (n = !0),
- o = o.parent
- }
- return !n || vy
- }
- return !1
- }
- function nt() {
- var t = new _y(6);
- return ot(t),
- t
- }
- function ot(t) {
- return t[0] = 1,
- t[1] = 0,
- t[2] = 0,
- t[3] = 1,
- t[4] = 0,
- t[5] = 0,
- t
- }
- function at(t, e) {
- return t[0] = e[0],
- t[1] = e[1],
- t[2] = e[2],
- t[3] = e[3],
- t[4] = e[4],
- t[5] = e[5],
- t
- }
- function rt(t, e, i) {
- var n = e[0] * i[0] + e[2] * i[1]
- , o = e[1] * i[0] + e[3] * i[1]
- , a = e[0] * i[2] + e[2] * i[3]
- , r = e[1] * i[2] + e[3] * i[3]
- , s = e[0] * i[4] + e[2] * i[5] + e[4]
- , l = e[1] * i[4] + e[3] * i[5] + e[5];
- return t[0] = n,
- t[1] = o,
- t[2] = a,
- t[3] = r,
- t[4] = s,
- t[5] = l,
- t
- }
- function st(t, e, i) {
- return t[0] = e[0],
- t[1] = e[1],
- t[2] = e[2],
- t[3] = e[3],
- t[4] = e[4] + i[0],
- t[5] = e[5] + i[1],
- t
- }
- function lt(t, e, i) {
- var n = e[0]
- , o = e[2]
- , a = e[4]
- , r = e[1]
- , s = e[3]
- , l = e[5]
- , h = Math.sin(i)
- , u = Math.cos(i);
- return t[0] = n * u + r * h,
- t[1] = -n * h + r * u,
- t[2] = o * u + s * h,
- t[3] = -o * h + u * s,
- t[4] = u * a + h * l,
- t[5] = u * l - h * a,
- t
- }
- function ht(t, e, i) {
- var n = i[0]
- , o = i[1];
- return t[0] = e[0] * n,
- t[1] = e[1] * o,
- t[2] = e[2] * n,
- t[3] = e[3] * o,
- t[4] = e[4] * n,
- t[5] = e[5] * o,
- t
- }
- function ut(t, e) {
- var i = e[0]
- , n = e[2]
- , o = e[4]
- , a = e[1]
- , r = e[3]
- , s = e[5]
- , l = i * r - a * n;
- return l ? (l = 1 / l,
- t[0] = r * l,
- t[1] = -a * l,
- t[2] = -n * l,
- t[3] = i * l,
- t[4] = (n * s - r * o) * l,
- t[5] = (a * o - i * s) * l,
- t) : null
- }
- function ct(t) {
- return t > Sy || t < -Sy
- }
- function dt(t) {
- this._target = t.target,
- this._life = t.life || 1e3,
- this._delay = t.delay || 0,
- this._initialized = !1,
- this.loop = null != t.loop && t.loop,
- this.gap = t.gap || 0,
- this.easing = t.easing || "Linear",
- this.onframe = t.onframe,
- this.ondestroy = t.ondestroy,
- this.onrestart = t.onrestart,
- this._pausedTime = 0,
- this._paused = !1
- }
- function ft(t) {
- return (t = Math.round(t)) < 0 ? 0 : t > 255 ? 255 : t
- }
- function gt(t) {
- return (t = Math.round(t)) < 0 ? 0 : t > 360 ? 360 : t
- }
- function pt(t) {
- return t < 0 ? 0 : t > 1 ? 1 : t
- }
- function mt(t) {
- return ft(t.length && "%" === t.charAt(t.length - 1) ? parseFloat(t) / 100 * 255 : parseInt(t, 10))
- }
- function vt(t) {
- return pt(t.length && "%" === t.charAt(t.length - 1) ? parseFloat(t) / 100 : parseFloat(t))
- }
- function yt(t, e, i) {
- return i < 0 ? i += 1 : i > 1 && (i -= 1),
- 6 * i < 1 ? t + (e - t) * i * 6 : 2 * i < 1 ? e : 3 * i < 2 ? t + (e - t) * (2 / 3 - i) * 6 : t
- }
- function xt(t, e, i) {
- return t + (e - t) * i
- }
- function _t(t, e, i, n, o) {
- return t[0] = e,
- t[1] = i,
- t[2] = n,
- t[3] = o,
- t
- }
- function bt(t, e) {
- return t[0] = e[0],
- t[1] = e[1],
- t[2] = e[2],
- t[3] = e[3],
- t
- }
- function wt(t, e) {
- Ny && bt(Ny, e),
- Ny = zy.put(t, Ny || e.slice())
- }
- function St(t, e) {
- if (t) {
- e = e || [];
- var i = zy.get(t);
- if (i)
- return bt(e, i);
- var n = (t += "").replace(/ /g, "").toLowerCase();
- if (n in Oy)
- return bt(e, Oy[n]),
- wt(t, e),
- e;
- if ("#" !== n.charAt(0)) {
- var o = n.indexOf("(")
- , a = n.indexOf(")");
- if (-1 !== o && a + 1 === n.length) {
- var r = n.substr(0, o)
- , s = n.substr(o + 1, a - (o + 1)).split(",")
- , l = 1;
- switch (r) {
- case "rgba":
- if (4 !== s.length)
- return void _t(e, 0, 0, 0, 1);
- l = vt(s.pop());
- case "rgb":
- return 3 !== s.length ? void _t(e, 0, 0, 0, 1) : (_t(e, mt(s[0]), mt(s[1]), mt(s[2]), l),
- wt(t, e),
- e);
- case "hsla":
- return 4 !== s.length ? void _t(e, 0, 0, 0, 1) : (s[3] = vt(s[3]),
- Mt(s, e),
- wt(t, e),
- e);
- case "hsl":
- return 3 !== s.length ? void _t(e, 0, 0, 0, 1) : (Mt(s, e),
- wt(t, e),
- e);
- default:
- return
- }
- }
- _t(e, 0, 0, 0, 1)
- } else {
- if (4 === n.length)
- return (h = parseInt(n.substr(1), 16)) >= 0 && h <= 4095 ? (_t(e, (3840 & h) >> 4 | (3840 & h) >> 8, 240 & h | (240 & h) >> 4, 15 & h | (15 & h) << 4, 1),
- wt(t, e),
- e) : void _t(e, 0, 0, 0, 1);
- if (7 === n.length) {
- var h = parseInt(n.substr(1), 16);
- return h >= 0 && h <= 16777215 ? (_t(e, (16711680 & h) >> 16, (65280 & h) >> 8, 255 & h, 1),
- wt(t, e),
- e) : void _t(e, 0, 0, 0, 1)
- }
- }
- }
- }
- function Mt(t, e) {
- var i = (parseFloat(t[0]) % 360 + 360) % 360 / 360
- , n = vt(t[1])
- , o = vt(t[2])
- , a = o <= .5 ? o * (n + 1) : o + n - o * n
- , r = 2 * o - a;
- return e = e || [],
- _t(e, ft(255 * yt(r, a, i + 1 / 3)), ft(255 * yt(r, a, i)), ft(255 * yt(r, a, i - 1 / 3)), 1),
- 4 === t.length && (e[3] = t[3]),
- e
- }
- function It(t) {
- if (t) {
- 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, h = (s + r) / 2;
- if (0 === l)
- e = 0,
- i = 0;
- else {
- i = h < .5 ? l / (s + r) : l / (2 - s - r);
- var u = ((s - n) / 6 + l / 2) / l
- , c = ((s - o) / 6 + l / 2) / l
- , d = ((s - a) / 6 + l / 2) / l;
- n === s ? e = d - c : o === s ? e = 1 / 3 + u - d : a === s && (e = 2 / 3 + c - u),
- e < 0 && (e += 1),
- e > 1 && (e -= 1)
- }
- var f = [360 * e, i, h];
- return null != t[3] && f.push(t[3]),
- f
- }
- }
- function Tt(t, e) {
- var i = St(t);
- if (i) {
- for (var n = 0; n < 3; n++)
- i[n] = e < 0 ? i[n] * (1 - e) | 0 : (255 - i[n]) * e + i[n] | 0;
- return Pt(i, 4 === i.length ? "rgba" : "rgb")
- }
- }
- function At(t) {
- var e = St(t);
- if (e)
- return ((1 << 24) + (e[0] << 16) + (e[1] << 8) + +e[2]).toString(16).slice(1)
- }
- function Ct(t, e, i) {
- if (e && e.length && t >= 0 && t <= 1) {
- i = i || [];
- var n = t * (e.length - 1)
- , o = Math.floor(n)
- , a = Math.ceil(n)
- , r = e[o]
- , s = e[a]
- , l = n - o;
- return i[0] = ft(xt(r[0], s[0], l)),
- i[1] = ft(xt(r[1], s[1], l)),
- i[2] = ft(xt(r[2], s[2], l)),
- i[3] = pt(xt(r[3], s[3], l)),
- i
- }
- }
- function Dt(t, e, i) {
- if (e && e.length && t >= 0 && t <= 1) {
- var n = t * (e.length - 1)
- , o = Math.floor(n)
- , a = Math.ceil(n)
- , r = St(e[o])
- , s = St(e[a])
- , l = n - o
- , h = Pt([ft(xt(r[0], s[0], l)), ft(xt(r[1], s[1], l)), ft(xt(r[2], s[2], l)), pt(xt(r[3], s[3], l))], "rgba");
- return i ? {
- color: h,
- leftIndex: o,
- rightIndex: a,
- value: n
- } : h
- }
- }
- function Lt(t, e, i, n) {
- if (t = St(t))
- return t = It(t),
- null != e && (t[0] = gt(e)),
- null != i && (t[1] = vt(i)),
- null != n && (t[2] = vt(n)),
- Pt(Mt(t), "rgba")
- }
- function kt(t, e) {
- if ((t = St(t)) && null != e)
- return t[3] = pt(e),
- Pt(t, "rgba")
- }
- function Pt(t, e) {
- if (t && t.length) {
- var i = t[0] + "," + t[1] + "," + t[2];
- return "rgba" !== e && "hsva" !== e && "hsla" !== e || (i += "," + t[3]),
- e + "(" + i + ")"
- }
- }
- function Ot(t, e) {
- return t[e]
- }
- function zt(t, e, i) {
- t[e] = i
- }
- function Nt(t, e, i) {
- return (e - t) * i + t
- }
- function Et(t, e, i) {
- return i > .5 ? e : t
- }
- function Rt(t, e, i, n, o) {
- var a = t.length;
- if (1 == o)
- for (s = 0; s < a; s++)
- n[s] = Nt(t[s], e[s], i);
- else
- for (var r = a && t[0].length, s = 0; s < a; s++)
- for (var l = 0; l < r; l++)
- n[s][l] = Nt(t[s][l], e[s][l], i)
- }
- function Vt(t, e, i) {
- var n = t.length
- , o = e.length;
- if (n !== o)
- if (n > o)
- t.length = o;
- else
- for (r = n; r < o; r++)
- t.push(1 === i ? e[r] : By.call(e[r]));
- for (var a = t[0] && t[0].length, r = 0; r < t.length; r++)
- if (1 === i)
- isNaN(t[r]) && (t[r] = e[r]);
- else
- for (var s = 0; s < a; s++)
- isNaN(t[r][s]) && (t[r][s] = e[r][s])
- }
- function Bt(t, e, i) {
- if (t === e)
- return !0;
- var n = t.length;
- if (n !== e.length)
- return !1;
- if (1 === i) {
- for (a = 0; a < n; a++)
- if (t[a] !== e[a])
- return !1
- } else
- for (var o = t[0].length, a = 0; a < n; a++)
- for (var r = 0; r < o; r++)
- if (t[a][r] !== e[a][r])
- return !1;
- return !0
- }
- function Gt(t, e, i, n, o, a, r, s, l) {
- var h = t.length;
- if (1 == l)
- for (c = 0; c < h; c++)
- s[c] = Wt(t[c], e[c], i[c], n[c], o, a, r);
- else
- for (var u = t[0].length, c = 0; c < h; c++)
- for (var d = 0; d < u; d++)
- s[c][d] = Wt(t[c][d], e[c][d], i[c][d], n[c][d], o, a, r)
- }
- function Wt(t, e, i, n, o, a, r) {
- var s = .5 * (i - t)
- , l = .5 * (n - e);
- return (2 * (e - i) + s + l) * r + (-3 * (e - i) - 2 * s - l) * a + s * o + e
- }
- function Ht(t) {
- if (u(t)) {
- var e = t.length;
- if (u(t[0])) {
- for (var i = [], n = 0; n < e; n++)
- i.push(By.call(t[n]));
- return i
- }
- return By.call(t)
- }
- return t
- }
- function Ft(t) {
- return t[0] = Math.floor(t[0]),
- t[1] = Math.floor(t[1]),
- t[2] = Math.floor(t[2]),
- "rgba(" + t.join(",") + ")"
- }
- function Zt(t) {
- var e = t[t.length - 1].value;
- return u(e && e[0]) ? 2 : 1
- }
- function Ut(t, e, i, n, o, a) {
- var r = t._getter
- , s = t._setter
- , l = "spline" === e
- , h = n.length;
- if (h) {
- var c, d = u(n[0].value), f = !1, g = !1, p = d ? Zt(n) : 0;
- n.sort(function(t, e) {
- return t.time - e.time
- }),
- c = n[h - 1].time;
- for (var m = [], v = [], y = n[0].value, x = !0, _ = 0; _ < h; _++) {
- m.push(n[_].time / c);
- var b = n[_].value;
- if (d && Bt(b, y, p) || !d && b === y || (x = !1),
- y = b,
- "string" == typeof b) {
- var w = St(b);
- w ? (b = w,
- f = !0) : g = !0
- }
- v.push(b)
- }
- if (a || !x) {
- for (var S = v[h - 1], _ = 0; _ < h - 1; _++)
- d ? Vt(v[_], S, p) : !isNaN(v[_]) || isNaN(S) || g || f || (v[_] = S);
- d && Vt(r(t._target, o), S, p);
- var M, I, T, A, C, D, L = 0, k = 0;
- if (f)
- var P = [0, 0, 0, 0];
- var O = new dt({
- target: t._target,
- life: c,
- loop: t._loop,
- delay: t._delay,
- onframe: function(t, e) {
- var i;
- if (e < 0)
- i = 0;
- else if (e < k) {
- for (i = M = Math.min(L + 1, h - 1); i >= 0 && !(m[i] <= e); i--)
- ;
- i = Math.min(i, h - 2)
- } else {
- for (i = L; i < h && !(m[i] > e); i++)
- ;
- i = Math.min(i - 1, h - 2)
- }
- L = i,
- k = e;
- var n = m[i + 1] - m[i];
- if (0 !== n)
- if (I = (e - m[i]) / n,
- l)
- if (A = v[i],
- T = v[0 === i ? i : i - 1],
- C = v[i > h - 2 ? h - 1 : i + 1],
- D = v[i > h - 3 ? h - 1 : i + 2],
- d)
- Gt(T, A, C, D, I, I * I, I * I * I, r(t, o), p);
- else {
- if (f)
- a = Gt(T, A, C, D, I, I * I, I * I * I, P, 1),
- a = Ft(P);
- else {
- if (g)
- return Et(A, C, I);
- a = Wt(T, A, C, D, I, I * I, I * I * I)
- }
- s(t, o, a)
- }
- else if (d)
- Rt(v[i], v[i + 1], I, r(t, o), p);
- else {
- var a;
- if (f)
- Rt(v[i], v[i + 1], I, P, 1),
- a = Ft(P);
- else {
- if (g)
- return Et(v[i], v[i + 1], I);
- a = Nt(v[i], v[i + 1], I)
- }
- s(t, o, a)
- }
- },
- ondestroy: i
- });
- return e && "spline" !== e && (O.easing = e),
- O
- }
- }
- }
- function jt(t, e, i, n) {
- i < 0 && (t += i,
- i = -i),
- n < 0 && (e += n,
- n = -n),
- this.x = t,
- this.y = e,
- this.width = i,
- this.height = n
- }
- function Xt(t) {
- for (var e = 0; t >= Ky; )
- e |= 1 & t,
- t >>= 1;
- return t + e
- }
- function qt(t, e, i, n) {
- var o = e + 1;
- if (o === i)
- return 1;
- if (n(t[o++], t[e]) < 0) {
- for (; o < i && n(t[o], t[o - 1]) < 0; )
- o++;
- Yt(t, e, o)
- } else
- for (; o < i && n(t[o], t[o - 1]) >= 0; )
- o++;
- return o - e
- }
- function Yt(t, e, i) {
- for (i--; e < i; ) {
- var n = t[e];
- t[e++] = t[i],
- t[i--] = n
- }
- }
- function $t(t, e, i, n, o) {
- for (n === e && n++; n < i; n++) {
- for (var a, r = t[n], s = e, l = n; s < l; )
- o(r, t[a = s + l >>> 1]) < 0 ? l = a : s = a + 1;
- var h = n - s;
- switch (h) {
- case 3:
- t[s + 3] = t[s + 2];
- case 2:
- t[s + 2] = t[s + 1];
- case 1:
- t[s + 1] = t[s];
- break;
- default:
- for (; h > 0; )
- t[s + h] = t[s + h - 1],
- h--
- }
- t[s] = r
- }
- }
- function Kt(t, e, i, n, o, a) {
- var r = 0
- , s = 0
- , l = 1;
- if (a(t, e[i + o]) > 0) {
- for (s = n - o; l < s && a(t, e[i + o + l]) > 0; )
- r = l,
- (l = 1 + (l << 1)) <= 0 && (l = s);
- l > s && (l = s),
- r += o,
- l += o
- } else {
- for (s = o + 1; l < s && a(t, e[i + o - l]) <= 0; )
- r = l,
- (l = 1 + (l << 1)) <= 0 && (l = s);
- l > s && (l = s);
- var h = r;
- r = o - l,
- l = o - h
- }
- for (r++; r < l; ) {
- var u = r + (l - r >>> 1);
- a(t, e[i + u]) > 0 ? r = u + 1 : l = u
- }
- return l
- }
- function Jt(t, e, i, n, o, a) {
- var r = 0
- , s = 0
- , l = 1;
- if (a(t, e[i + o]) < 0) {
- for (s = o + 1; l < s && a(t, e[i + o - l]) < 0; )
- r = l,
- (l = 1 + (l << 1)) <= 0 && (l = s);
- l > s && (l = s);
- var h = r;
- r = o - l,
- l = o - h
- } else {
- for (s = n - o; l < s && a(t, e[i + o + l]) >= 0; )
- r = l,
- (l = 1 + (l << 1)) <= 0 && (l = s);
- l > s && (l = s),
- r += o,
- l += o
- }
- for (r++; r < l; ) {
- var u = r + (l - r >>> 1);
- a(t, e[i + u]) < 0 ? l = u : r = u + 1
- }
- return l
- }
- function Qt(t, e) {
- function i(i) {
- var s = a[i]
- , h = r[i]
- , u = a[i + 1]
- , c = r[i + 1];
- r[i] = h + c,
- i === l - 3 && (a[i + 1] = a[i + 2],
- r[i + 1] = r[i + 2]),
- l--;
- var d = Jt(t[u], t, s, h, 0, e);
- s += d,
- 0 !== (h -= d) && 0 !== (c = Kt(t[s + h - 1], t, u, c, c - 1, e)) && (h <= c ? n(s, h, u, c) : o(s, h, u, c))
- }
- function n(i, n, o, a) {
- var r = 0;
- for (r = 0; r < n; r++)
- h[r] = t[i + r];
- var l = 0
- , u = o
- , c = i;
- if (t[c++] = t[u++],
- 0 != --a)
- if (1 !== n) {
- for (var d, f, g, p = s; ; ) {
- d = 0,
- f = 0,
- g = !1;
- do {
- if (e(t[u], h[l]) < 0) {
- if (t[c++] = t[u++],
- f++,
- d = 0,
- 0 == --a) {
- g = !0;
- break
- }
- } else if (t[c++] = h[l++],
- d++,
- f = 0,
- 1 == --n) {
- g = !0;
- break
- }
- } while ((d | f) < p);
- if (g)
- break;
- do {
- if (0 !== (d = Jt(t[u], h, l, n, 0, e))) {
- for (r = 0; r < d; r++)
- t[c + r] = h[l + r];
- if (c += d,
- l += d,
- (n -= d) <= 1) {
- g = !0;
- break
- }
- }
- if (t[c++] = t[u++],
- 0 == --a) {
- g = !0;
- break
- }
- if (0 !== (f = Kt(h[l], t, u, a, 0, e))) {
- for (r = 0; r < f; r++)
- t[c + r] = t[u + r];
- if (c += f,
- u += f,
- 0 === (a -= f)) {
- g = !0;
- break
- }
- }
- if (t[c++] = h[l++],
- 1 == --n) {
- g = !0;
- break
- }
- p--
- } while (d >= Jy || f >= Jy);
- if (g)
- break;
- p < 0 && (p = 0),
- p += 2
- }
- if ((s = p) < 1 && (s = 1),
- 1 === n) {
- for (r = 0; r < a; r++)
- t[c + r] = t[u + r];
- t[c + a] = h[l]
- } else {
- if (0 === n)
- throw new Error;
- for (r = 0; r < n; r++)
- t[c + r] = h[l + r]
- }
- } else {
- for (r = 0; r < a; r++)
- t[c + r] = t[u + r];
- t[c + a] = h[l]
- }
- else
- for (r = 0; r < n; r++)
- t[c + r] = h[l + r]
- }
- function o(i, n, o, a) {
- var r = 0;
- for (r = 0; r < a; r++)
- h[r] = t[o + r];
- var l = i + n - 1
- , u = a - 1
- , c = o + a - 1
- , d = 0
- , f = 0;
- if (t[c--] = t[l--],
- 0 != --n)
- if (1 !== a) {
- for (var g = s; ; ) {
- var p = 0
- , m = 0
- , v = !1;
- do {
- if (e(h[u], t[l]) < 0) {
- if (t[c--] = t[l--],
- p++,
- m = 0,
- 0 == --n) {
- v = !0;
- break
- }
- } else if (t[c--] = h[u--],
- m++,
- p = 0,
- 1 == --a) {
- v = !0;
- break
- }
- } while ((p | m) < g);
- if (v)
- break;
- do {
- if (0 != (p = n - Jt(h[u], t, i, n, n - 1, e))) {
- for (n -= p,
- f = (c -= p) + 1,
- d = (l -= p) + 1,
- r = p - 1; r >= 0; r--)
- t[f + r] = t[d + r];
- if (0 === n) {
- v = !0;
- break
- }
- }
- if (t[c--] = h[u--],
- 1 == --a) {
- v = !0;
- break
- }
- if (0 != (m = a - Kt(t[l], h, 0, a, a - 1, e))) {
- for (a -= m,
- f = (c -= m) + 1,
- d = (u -= m) + 1,
- r = 0; r < m; r++)
- t[f + r] = h[d + r];
- if (a <= 1) {
- v = !0;
- break
- }
- }
- if (t[c--] = t[l--],
- 0 == --n) {
- v = !0;
- break
- }
- g--
- } while (p >= Jy || m >= Jy);
- if (v)
- break;
- g < 0 && (g = 0),
- g += 2
- }
- if ((s = g) < 1 && (s = 1),
- 1 === a) {
- for (f = (c -= n) + 1,
- d = (l -= n) + 1,
- r = n - 1; r >= 0; r--)
- t[f + r] = t[d + r];
- t[c] = h[u]
- } else {
- if (0 === a)
- throw new Error;
- for (d = c - (a - 1),
- r = 0; r < a; r++)
- t[d + r] = h[r]
- }
- } else {
- for (f = (c -= n) + 1,
- d = (l -= n) + 1,
- r = n - 1; r >= 0; r--)
- t[f + r] = t[d + r];
- t[c] = h[u]
- }
- else
- for (d = c - (a - 1),
- r = 0; r < a; r++)
- t[d + r] = h[r]
- }
- var a, r, s = Jy, l = 0, h = [];
- a = [],
- r = [],
- this.mergeRuns = function() {
- for (; l > 1; ) {
- var t = l - 2;
- if (t >= 1 && r[t - 1] <= r[t] + r[t + 1] || t >= 2 && r[t - 2] <= r[t] + r[t - 1])
- r[t - 1] < r[t + 1] && t--;
- else if (r[t] > r[t + 1])
- break;
- i(t)
- }
- }
- ,
- this.forceMergeRuns = function() {
- for (; l > 1; ) {
- var t = l - 2;
- t > 0 && r[t - 1] < r[t + 1] && t--,
- i(t)
- }
- }
- ,
- this.pushRun = function(t, e) {
- a[l] = t,
- r[l] = e,
- l += 1
- }
- }
- function te(t, e, i, n) {
- i || (i = 0),
- n || (n = t.length);
- var o = n - i;
- if (!(o < 2)) {
- var a = 0;
- if (o < Ky)
- return a = qt(t, i, n, e),
- void $t(t, i, n, i + a, e);
- var r = new Qt(t,e)
- , s = Xt(o);
- do {
- if ((a = qt(t, i, n, e)) < s) {
- var l = o;
- l > s && (l = s),
- $t(t, i, i + l, i + a, e),
- a = l
- }
- r.pushRun(i, a),
- r.mergeRuns(),
- o -= a,
- i += a
- } while (0 !== o);
- r.forceMergeRuns()
- }
- }
- function ee(t, e) {
- return t.zlevel === e.zlevel ? t.z === e.z ? t.z2 - e.z2 : t.z - e.z : t.zlevel - e.zlevel
- }
- function ie(t, e, i) {
- var n = null == e.x ? 0 : e.x
- , o = null == e.x2 ? 1 : e.x2
- , a = null == e.y ? 0 : e.y
- , r = null == e.y2 ? 0 : e.y2;
- return e.global || (n = n * i.width + i.x,
- o = o * i.width + i.x,
- a = a * i.height + i.y,
- r = r * i.height + i.y),
- t.createLinearGradient(n, a, o, r)
- }
- function ne(t, e, i) {
- var n = i.width
- , o = i.height
- , a = Math.min(n, o)
- , r = null == e.x ? .5 : e.x
- , s = null == e.y ? .5 : e.y
- , l = null == e.r ? .5 : e.r;
- return e.global || (r = r * n + i.x,
- s = s * o + i.y,
- l *= a),
- t.createRadialGradient(r, s, 0, r, s, l)
- }
- function oe() {
- return !1
- }
- function ae(t, e, i) {
- var n = ay()
- , o = e.getWidth()
- , a = e.getHeight()
- , r = n.style;
- return r.position = "absolute",
- r.left = 0,
- r.top = 0,
- r.width = o + "px",
- r.height = a + "px",
- n.width = o * i,
- n.height = a * i,
- n.setAttribute("data-zr-dom-id", t),
- n
- }
- function re(t) {
- if ("string" == typeof t) {
- var e = lx.get(t);
- return e && e.image
- }
- return t
- }
- function se(t, e, i, n, o) {
- if (t) {
- if ("string" == typeof t) {
- if (e && e.__zrImageSrc === t || !i)
- return e;
- var a = lx.get(t)
- , r = {
- hostEl: i,
- cb: n,
- cbPayload: o
- };
- return a ? !he(e = a.image) && a.pending.push(r) : (!e && (e = new Image),
- e.onload = le,
- lx.put(t, e.__cachedImgObj = {
- image: e,
- pending: [r]
- }),
- e.src = e.__zrImageSrc = t),
- e
- }
- return t
- }
- return e
- }
- function le() {
- var t = this.__cachedImgObj;
- this.onload = this.__cachedImgObj = null;
- for (var e = 0; e < t.pending.length; e++) {
- var i = t.pending[e]
- , n = i.cb;
- n && n(this, i.cbPayload),
- i.hostEl.dirty()
- }
- t.pending.length = 0
- }
- function he(t) {
- return t && t.width && t.height
- }
- function ue(t, e) {
- var i = t + ":" + (e = e || fx);
- if (hx[i])
- return hx[i];
- for (var n = (t + "").split("\n"), o = 0, a = 0, r = n.length; a < r; a++)
- o = Math.max(gx(n[a], e).width, o);
- return ux > cx && (ux = 0,
- hx = {}),
- ux++,
- hx[i] = o,
- o
- }
- function ce(t, e, i, n, o, a, r) {
- return a ? fe(t, e, i, n, o, a, r) : de(t, e, i, n, o, r)
- }
- function de(t, e, i, n, o, a) {
- var r = we(t, e, o, a)
- , s = ue(t, e);
- o && (s += o[1] + o[3]);
- var l = r.outerHeight
- , h = new jt(ge(0, s, i),pe(0, l, n),s,l);
- return h.lineHeight = r.lineHeight,
- h
- }
- function fe(t, e, i, n, o, a, r) {
- var s = Se(t, {
- rich: a,
- truncate: r,
- font: e,
- textAlign: i,
- textPadding: o
- })
- , l = s.outerWidth
- , h = s.outerHeight;
- return new jt(ge(0, l, i),pe(0, h, n),l,h)
- }
- function ge(t, e, i) {
- return "right" === i ? t -= e : "center" === i && (t -= e / 2),
- t
- }
- function pe(t, e, i) {
- return "middle" === i ? t -= e / 2 : "bottom" === i && (t -= e),
- t
- }
- function me(t, e, i) {
- var n = e.x
- , o = e.y
- , a = e.height
- , r = e.width
- , s = a / 2
- , l = "left"
- , h = "top";
- switch (t) {
- case "left":
- n -= i,
- o += s,
- l = "right",
- h = "middle";
- break;
- case "right":
- n += i + r,
- o += s,
- h = "middle";
- break;
- case "top":
- n += r / 2,
- o -= i,
- l = "center",
- h = "bottom";
- break;
- case "bottom":
- n += r / 2,
- o += a + i,
- l = "center";
- break;
- case "inside":
- n += r / 2,
- o += s,
- l = "center",
- h = "middle";
- break;
- case "insideLeft":
- n += i,
- o += s,
- h = "middle";
- break;
- case "insideRight":
- n += r - i,
- o += s,
- l = "right",
- h = "middle";
- break;
- case "insideTop":
- n += r / 2,
- o += i,
- l = "center";
- break;
- case "insideBottom":
- n += r / 2,
- o += a - i,
- l = "center",
- h = "bottom";
- break;
- case "insideTopLeft":
- n += i,
- o += i;
- break;
- case "insideTopRight":
- n += r - i,
- o += i,
- l = "right";
- break;
- case "insideBottomLeft":
- n += i,
- o += a - i,
- h = "bottom";
- break;
- case "insideBottomRight":
- n += r - i,
- o += a - i,
- l = "right",
- h = "bottom"
- }
- return {
- x: n,
- y: o,
- textAlign: l,
- textVerticalAlign: h
- }
- }
- function ve(t, e, i, n, o) {
- if (!e)
- return "";
- var a = (t + "").split("\n");
- o = ye(e, i, n, o);
- for (var r = 0, s = a.length; r < s; r++)
- a[r] = xe(a[r], o);
- return a.join("\n")
- }
- function ye(t, e, i, n) {
- (n = o({}, n)).font = e;
- var i = I(i, "...");
- n.maxIterations = I(n.maxIterations, 2);
- var a = n.minChar = I(n.minChar, 0);
- n.cnCharWidth = ue("国", e);
- var r = n.ascCharWidth = ue("a", e);
- n.placeholder = I(n.placeholder, "");
- for (var s = t = Math.max(0, t - 1), l = 0; l < a && s >= r; l++)
- s -= r;
- var h = ue(i);
- return h > s && (i = "",
- h = 0),
- s = t - h,
- n.ellipsis = i,
- n.ellipsisWidth = h,
- n.contentWidth = s,
- n.containerWidth = t,
- n
- }
- function xe(t, e) {
- var i = e.containerWidth
- , n = e.font
- , o = e.contentWidth;
- if (!i)
- return "";
- var a = ue(t, n);
- if (a <= i)
- return t;
- for (var r = 0; ; r++) {
- if (a <= o || r >= e.maxIterations) {
- t += e.ellipsis;
- break
- }
- var s = 0 === r ? _e(t, o, e.ascCharWidth, e.cnCharWidth) : a > 0 ? Math.floor(t.length * o / a) : 0;
- a = ue(t = t.substr(0, s), n)
- }
- return "" === t && (t = e.placeholder),
- t
- }
- function _e(t, e, i, n) {
- for (var o = 0, a = 0, r = t.length; a < r && o < e; a++) {
- var s = t.charCodeAt(a);
- o += 0 <= s && s <= 127 ? i : n
- }
- return a
- }
- function be(t) {
- return ue("国", t)
- }
- function we(t, e, i, n) {
- null != t && (t += "");
- var o = be(e)
- , a = t ? t.split("\n") : []
- , r = a.length * o
- , s = r;
- if (i && (s += i[0] + i[2]),
- t && n) {
- var l = n.outerHeight
- , h = n.outerWidth;
- if (null != l && s > l)
- t = "",
- a = [];
- else if (null != h)
- for (var u = ye(h - (i ? i[1] + i[3] : 0), e, n.ellipsis, {
- minChar: n.minChar,
- placeholder: n.placeholder
- }), c = 0, d = a.length; c < d; c++)
- a[c] = xe(a[c], u)
- }
- return {
- lines: a,
- height: r,
- outerHeight: s,
- lineHeight: o
- }
- }
- function Se(t, e) {
- var i = {
- lines: [],
- width: 0,
- height: 0
- };
- if (null != t && (t += ""),
- !t)
- return i;
- for (var n, o = dx.lastIndex = 0; null != (n = dx.exec(t)); ) {
- var a = n.index;
- a > o && Me(i, t.substring(o, a)),
- Me(i, n[2], n[1]),
- o = dx.lastIndex
- }
- o < t.length && Me(i, t.substring(o, t.length));
- var r = i.lines
- , s = 0
- , l = 0
- , h = []
- , u = e.textPadding
- , c = e.truncate
- , d = c && c.outerWidth
- , f = c && c.outerHeight;
- u && (null != d && (d -= u[1] + u[3]),
- null != f && (f -= u[0] + u[2]));
- for (L = 0; L < r.length; L++) {
- for (var g = r[L], p = 0, m = 0, v = 0; v < g.tokens.length; v++) {
- var y = (k = g.tokens[v]).styleName && e.rich[k.styleName] || {}
- , x = k.textPadding = y.textPadding
- , _ = k.font = y.font || e.font
- , b = k.textHeight = I(y.textHeight, be(_));
- if (x && (b += x[0] + x[2]),
- k.height = b,
- k.lineHeight = T(y.textLineHeight, e.textLineHeight, b),
- k.textAlign = y && y.textAlign || e.textAlign,
- k.textVerticalAlign = y && y.textVerticalAlign || "middle",
- null != f && s + k.lineHeight > f)
- return {
- lines: [],
- width: 0,
- height: 0
- };
- k.textWidth = ue(k.text, _);
- var w = y.textWidth
- , S = null == w || "auto" === w;
- if ("string" == typeof w && "%" === w.charAt(w.length - 1))
- k.percentWidth = w,
- h.push(k),
- w = 0;
- else {
- if (S) {
- w = k.textWidth;
- var M = y.textBackgroundColor
- , A = M && M.image;
- A && he(A = re(A)) && (w = Math.max(w, A.width * b / A.height))
- }
- var C = x ? x[1] + x[3] : 0;
- w += C;
- var D = null != d ? d - m : null;
- null != D && D < w && (!S || D < C ? (k.text = "",
- k.textWidth = w = 0) : (k.text = ve(k.text, D - C, _, c.ellipsis, {
- minChar: c.minChar
- }),
- k.textWidth = ue(k.text, _),
- w = k.textWidth + C))
- }
- m += k.width = w,
- y && (p = Math.max(p, k.lineHeight))
- }
- g.width = m,
- g.lineHeight = p,
- s += p,
- l = Math.max(l, m)
- }
- i.outerWidth = i.width = I(e.textWidth, l),
- i.outerHeight = i.height = I(e.textHeight, s),
- u && (i.outerWidth += u[1] + u[3],
- i.outerHeight += u[0] + u[2]);
- for (var L = 0; L < h.length; L++) {
- var k = h[L]
- , P = k.percentWidth;
- k.width = parseInt(P, 10) / 100 * l
- }
- return i
- }
- function Me(t, e, i) {
- for (var n = "" === e, o = e.split("\n"), a = t.lines, r = 0; r < o.length; r++) {
- var s = o[r]
- , l = {
- styleName: i,
- text: s,
- isLineHolder: !s && !n
- };
- if (r)
- a.push({
- tokens: [l]
- });
- else {
- var h = (a[a.length - 1] || (a[0] = {
- tokens: []
- })).tokens
- , u = h.length;
- 1 === u && h[0].isLineHolder ? h[0] = l : (s || !u || n) && h.push(l)
- }
- }
- }
- function Ie(t) {
- return (t.fontSize || t.fontFamily) && [t.fontStyle, t.fontWeight, (t.fontSize || 12) + "px", t.fontFamily || "sans-serif"].join(" ") || t.textFont || t.font
- }
- function Te(t, e) {
- var i, n, o, a, r = e.x, s = e.y, l = e.width, h = e.height, u = e.r;
- l < 0 && (r += l,
- l = -l),
- h < 0 && (s += h,
- h = -h),
- "number" == typeof u ? i = n = o = a = u : u instanceof Array ? 1 === u.length ? i = n = o = a = u[0] : 2 === u.length ? (i = o = u[0],
- n = a = u[1]) : 3 === u.length ? (i = u[0],
- n = a = u[1],
- o = u[2]) : (i = u[0],
- n = u[1],
- o = u[2],
- a = u[3]) : i = n = o = a = 0;
- var c;
- i + n > l && (i *= l / (c = i + n),
- n *= l / c),
- o + a > l && (o *= l / (c = o + a),
- a *= l / c),
- n + o > h && (n *= h / (c = n + o),
- o *= h / c),
- i + a > h && (i *= h / (c = i + a),
- a *= h / c),
- t.moveTo(r + i, s),
- t.lineTo(r + l - n, s),
- 0 !== n && t.quadraticCurveTo(r + l, s, r + l, s + n),
- t.lineTo(r + l, s + h - o),
- 0 !== o && t.quadraticCurveTo(r + l, s + h, r + l - o, s + h),
- t.lineTo(r + a, s + h),
- 0 !== a && t.quadraticCurveTo(r, s + h, r, s + h - a),
- t.lineTo(r, s + i),
- 0 !== i && t.quadraticCurveTo(r, s, r + i, s)
- }
- function Ae(t) {
- return Ce(t),
- c(t.rich, Ce),
- t
- }
- function Ce(t) {
- if (t) {
- t.font = Ie(t);
- var e = t.textAlign;
- "middle" === e && (e = "center"),
- t.textAlign = null == e || mx[e] ? e : "left";
- var i = t.textVerticalAlign || t.textBaseline;
- "center" === i && (i = "middle"),
- t.textVerticalAlign = null == i || vx[i] ? i : "top",
- t.textPadding && (t.textPadding = C(t.textPadding))
- }
- }
- function De(t, e, i, n, o) {
- n.rich ? ke(t, e, i, n, o) : Le(t, e, i, n, o)
- }
- function Le(t, e, i, n, o) {
- var a = Be(e, "font", n.font || fx)
- , r = n.textPadding
- , s = t.__textCotentBlock;
- s && !t.__dirty || (s = t.__textCotentBlock = we(i, a, r, n.truncate));
- var l = s.outerHeight
- , h = s.lines
- , u = s.lineHeight
- , c = Ve(l, n, o)
- , d = c.baseX
- , f = c.baseY
- , g = c.textAlign
- , p = c.textVerticalAlign;
- Oe(e, n, o, d, f);
- var m = pe(f, l, p)
- , v = d
- , y = m
- , x = Ne(n);
- if (x || r) {
- var _ = ue(i, a);
- r && (_ += r[1] + r[3]);
- var b = ge(d, _, g);
- x && Ee(t, e, n, b, m, _, l),
- r && (v = Fe(d, g, r),
- y += r[0])
- }
- Be(e, "textAlign", g || "left"),
- Be(e, "textBaseline", "middle"),
- Be(e, "shadowBlur", n.textShadowBlur || 0),
- Be(e, "shadowColor", n.textShadowColor || "transparent"),
- Be(e, "shadowOffsetX", n.textShadowOffsetX || 0),
- Be(e, "shadowOffsetY", n.textShadowOffsetY || 0),
- y += u / 2;
- var w = n.textStrokeWidth
- , S = Ge(n.textStroke, w)
- , M = We(n.textFill);
- S && (Be(e, "lineWidth", w),
- Be(e, "strokeStyle", S)),
- M && Be(e, "fillStyle", M);
- for (var I = 0; I < h.length; I++)
- S && e.strokeText(h[I], v, y),
- M && e.fillText(h[I], v, y),
- y += u
- }
- function ke(t, e, i, n, o) {
- var a = t.__textCotentBlock;
- a && !t.__dirty || (a = t.__textCotentBlock = Se(i, n)),
- Pe(t, e, a, n, o)
- }
- function Pe(t, e, i, n, o) {
- var a = i.width
- , r = i.outerWidth
- , s = i.outerHeight
- , l = n.textPadding
- , h = Ve(s, n, o)
- , u = h.baseX
- , c = h.baseY
- , d = h.textAlign
- , f = h.textVerticalAlign;
- Oe(e, n, o, u, c);
- var g = ge(u, r, d)
- , p = pe(c, s, f)
- , m = g
- , v = p;
- l && (m += l[3],
- v += l[0]);
- var y = m + a;
- Ne(n) && Ee(t, e, n, g, p, r, s);
- for (var x = 0; x < i.lines.length; x++) {
- for (var _, b = i.lines[x], w = b.tokens, S = w.length, M = b.lineHeight, I = b.width, T = 0, A = m, C = y, D = S - 1; T < S && (!(_ = w[T]).textAlign || "left" === _.textAlign); )
- ze(t, e, _, n, M, v, A, "left"),
- I -= _.width,
- A += _.width,
- T++;
- for (; D >= 0 && "right" === (_ = w[D]).textAlign; )
- ze(t, e, _, n, M, v, C, "right"),
- I -= _.width,
- C -= _.width,
- D--;
- for (A += (a - (A - m) - (y - C) - I) / 2; T <= D; )
- ze(t, e, _ = w[T], n, M, v, A + _.width / 2, "center"),
- A += _.width,
- T++;
- v += M
- }
- }
- function Oe(t, e, i, n, o) {
- if (i && e.textRotation) {
- var a = e.textOrigin;
- "center" === a ? (n = i.width / 2 + i.x,
- o = i.height / 2 + i.y) : a && (n = a[0] + i.x,
- o = a[1] + i.y),
- t.translate(n, o),
- t.rotate(-e.textRotation),
- t.translate(-n, -o)
- }
- }
- function ze(t, e, i, n, o, a, r, s) {
- var l = n.rich[i.styleName] || {}
- , h = i.textVerticalAlign
- , u = a + o / 2;
- "top" === h ? u = a + i.height / 2 : "bottom" === h && (u = a + o - i.height / 2),
- !i.isLineHolder && Ne(l) && Ee(t, e, l, "right" === s ? r - i.width : "center" === s ? r - i.width / 2 : r, u - i.height / 2, i.width, i.height);
- var c = i.textPadding;
- c && (r = Fe(r, s, c),
- u -= i.height / 2 - c[2] - i.textHeight / 2),
- Be(e, "shadowBlur", T(l.textShadowBlur, n.textShadowBlur, 0)),
- Be(e, "shadowColor", l.textShadowColor || n.textShadowColor || "transparent"),
- Be(e, "shadowOffsetX", T(l.textShadowOffsetX, n.textShadowOffsetX, 0)),
- Be(e, "shadowOffsetY", T(l.textShadowOffsetY, n.textShadowOffsetY, 0)),
- Be(e, "textAlign", s),
- Be(e, "textBaseline", "middle"),
- Be(e, "font", i.font || fx);
- var d = Ge(l.textStroke || n.textStroke, g)
- , f = We(l.textFill || n.textFill)
- , g = I(l.textStrokeWidth, n.textStrokeWidth);
- d && (Be(e, "lineWidth", g),
- Be(e, "strokeStyle", d),
- e.strokeText(i.text, r, u)),
- f && (Be(e, "fillStyle", f),
- e.fillText(i.text, r, u))
- }
- function Ne(t) {
- return t.textBackgroundColor || t.textBorderWidth && t.textBorderColor
- }
- function Ee(t, e, i, n, o, a, r) {
- var s = i.textBackgroundColor
- , l = i.textBorderWidth
- , h = i.textBorderColor
- , u = x(s);
- if (Be(e, "shadowBlur", i.textBoxShadowBlur || 0),
- Be(e, "shadowColor", i.textBoxShadowColor || "transparent"),
- Be(e, "shadowOffsetX", i.textBoxShadowOffsetX || 0),
- Be(e, "shadowOffsetY", i.textBoxShadowOffsetY || 0),
- u || l && h) {
- e.beginPath();
- var c = i.textBorderRadius;
- c ? Te(e, {
- x: n,
- y: o,
- width: a,
- height: r,
- r: c
- }) : e.rect(n, o, a, r),
- e.closePath()
- }
- if (u)
- Be(e, "fillStyle", s),
- e.fill();
- else if (_(s)) {
- var d = s.image;
- (d = se(d, null, t, Re, s)) && he(d) && e.drawImage(d, n, o, a, r)
- }
- l && h && (Be(e, "lineWidth", l),
- Be(e, "strokeStyle", h),
- e.stroke())
- }
- function Re(t, e) {
- e.image = t
- }
- function Ve(t, e, i) {
- var n = e.x || 0
- , o = e.y || 0
- , a = e.textAlign
- , r = e.textVerticalAlign;
- if (i) {
- var s = e.textPosition;
- if (s instanceof Array)
- n = i.x + He(s[0], i.width),
- o = i.y + He(s[1], i.height);
- else {
- var l = me(s, i, e.textDistance);
- n = l.x,
- o = l.y,
- a = a || l.textAlign,
- r = r || l.textVerticalAlign
- }
- var h = e.textOffset;
- h && (n += h[0],
- o += h[1])
- }
- return {
- baseX: n,
- baseY: o,
- textAlign: a,
- textVerticalAlign: r
- }
- }
- function Be(t, e, i) {
- return t[e] = i,
- t[e]
- }
- function Ge(t, e) {
- return null == t || e <= 0 || "transparent" === t || "none" === t ? null : t.image || t.colorStops ? "#000" : t
- }
- function We(t) {
- return null == t || "none" === t ? null : t.image || t.colorStops ? "#000" : t
- }
- function He(t, e) {
- return "string" == typeof t ? t.lastIndexOf("%") >= 0 ? parseFloat(t) / 100 * e : parseFloat(t) : t
- }
- function Fe(t, e, i) {
- return "right" === e ? t - i[1] : "center" === e ? t + i[3] / 2 - i[1] / 2 : t + i[3]
- }
- function Ze(t, e) {
- return null != t && (t || e.textBackgroundColor || e.textBorderWidth && e.textBorderColor || e.textPadding)
- }
- function Ue(t) {
- t = t || {},
- jy.call(this, t);
- for (var e in t)
- t.hasOwnProperty(e) && "style" !== e && (this[e] = t[e]);
- this.style = new ex(t.style,this),
- this._rect = null,
- this.__clipPaths = []
- }
- function je(t) {
- Ue.call(this, t)
- }
- function Xe(t) {
- return parseInt(t, 10)
- }
- function qe(t) {
- return !!t && (!!t.__builtin__ || "function" == typeof t.resize && "function" == typeof t.refresh)
- }
- function Ye(t) {
- t.__unusedCount++
- }
- function $e(t) {
- 1 == t.__unusedCount && t.clear()
- }
- function Ke(t, e, i) {
- return _x.copy(t.getBoundingRect()),
- t.transform && _x.applyTransform(t.transform),
- bx.width = e,
- bx.height = i,
- !_x.intersect(bx)
- }
- function Je(t, e) {
- if (t == e)
- return !1;
- if (!t || !e || t.length !== e.length)
- return !0;
- for (var i = 0; i < t.length; i++)
- if (t[i] !== e[i])
- return !0
- }
- function Qe(t, e) {
- for (var i = 0; i < t.length; i++) {
- var n = t[i];
- n.setTransform(e),
- e.beginPath(),
- n.buildPath(e, n.shape),
- e.clip(),
- n.restoreTransform(e)
- }
- }
- function ti(t, e) {
- var i = document.createElement("div");
- return i.style.cssText = ["position:relative", "overflow:hidden", "width:" + t + "px", "height:" + e + "px", "padding:0", "margin:0", "border-width:0"].join(";") + ";",
- i
- }
- function ei(t) {
- return t.getBoundingClientRect ? t.getBoundingClientRect() : {
- left: 0,
- top: 0
- }
- }
- function ii(t, e, i, n) {
- return i = i || {},
- n || !Yv.canvasSupported ? ni(t, e, i) : Yv.browser.firefox && null != e.layerX && e.layerX !== e.offsetX ? (i.zrX = e.layerX,
- i.zrY = e.layerY) : null != e.offsetX ? (i.zrX = e.offsetX,
- i.zrY = e.offsetY) : ni(t, e, i),
- i
- }
- function ni(t, e, i) {
- var n = ei(t);
- i.zrX = e.clientX - n.left,
- i.zrY = e.clientY - n.top
- }
- function oi(t, e, i) {
- if (null != (e = e || window.event).zrX)
- return e;
- var n = e.type;
- if (n && n.indexOf("touch") >= 0) {
- var o = "touchend" != n ? e.targetTouches[0] : e.changedTouches[0];
- o && ii(t, o, e, i)
- } else
- ii(t, e, e, i),
- e.zrDelta = e.wheelDelta ? e.wheelDelta / 120 : -(e.detail || 0) / 3;
- var a = e.button;
- return null == e.which && void 0 !== a && Mx.test(e.type) && (e.which = 1 & a ? 1 : 2 & a ? 3 : 4 & a ? 2 : 0),
- e
- }
- function ai(t, e, i) {
- Sx ? t.addEventListener(e, i) : t.attachEvent("on" + e, i)
- }
- function ri(t, e, i) {
- Sx ? t.removeEventListener(e, i) : t.detachEvent("on" + e, i)
- }
- function si(t) {
- return t.which > 1
- }
- function li(t) {
- var e = t[1][0] - t[0][0]
- , i = t[1][1] - t[0][1];
- return Math.sqrt(e * e + i * i)
- }
- function hi(t) {
- return [(t[0][0] + t[1][0]) / 2, (t[0][1] + t[1][1]) / 2]
- }
- function ui(t) {
- return "mousewheel" === t && Yv.browser.firefox ? "DOMMouseScroll" : t
- }
- function ci(t, e, i) {
- var n = t._gestureMgr;
- "start" === i && n.clear();
- var o = n.recognize(e, t.handler.findHover(e.zrX, e.zrY, null).target, t.dom);
- if ("end" === i && n.clear(),
- o) {
- var a = o.type;
- e.gestureEvent = a,
- t.handler.dispatchToElement({
- target: o.target
- }, a, o.event)
- }
- }
- function di(t) {
- t._touching = !0,
- clearTimeout(t._touchTimer),
- t._touchTimer = setTimeout(function() {
- t._touching = !1
- }, 700)
- }
- function fi(t) {
- var e = t.pointerType;
- return "pen" === e || "touch" === e
- }
- function gi(t) {
- function e(t, e) {
- return function() {
- if (!e._touching)
- return t.apply(e, arguments)
- }
- }
- c(Lx, function(e) {
- t._handlers[e] = p(Ox[e], t)
- }),
- c(Px, function(e) {
- t._handlers[e] = p(Ox[e], t)
- }),
- c(Dx, function(i) {
- t._handlers[i] = e(Ox[i], t)
- })
- }
- function pi(t) {
- function e(e, i) {
- c(e, function(e) {
- ai(t, ui(e), i._handlers[e])
- }, i)
- }
- my.call(this),
- this.dom = t,
- this._touching = !1,
- this._touchTimer,
- this._gestureMgr = new Ax,
- this._handlers = {},
- gi(this),
- Yv.pointerEventsSupported ? e(Px, this) : (Yv.touchEventsSupported && e(Lx, this),
- e(Dx, this))
- }
- function mi(t, e) {
- var i = new Bx(Xv(),t,e);
- return Rx[i.id] = i,
- i
- }
- function vi(t, e) {
- Ex[t] = e
- }
- function yi(t) {
- delete Rx[t]
- }
- function xi(t) {
- return t.replace(/^\s+/, "").replace(/\s+$/, "")
- }
- function _i(t, e, i, n) {
- var o = e[1] - e[0]
- , a = i[1] - i[0];
- if (0 === o)
- return 0 === a ? i[0] : (i[0] + i[1]) / 2;
- if (n)
- if (o > 0) {
- if (t <= e[0])
- return i[0];
- if (t >= e[1])
- return i[1]
- } else {
- if (t >= e[0])
- return i[0];
- if (t <= e[1])
- return i[1]
- }
- else {
- if (t === e[0])
- return i[0];
- if (t === e[1])
- return i[1]
- }
- return (t - e[0]) / o * a + i[0]
- }
- function bi(t, e) {
- switch (t) {
- case "center":
- case "middle":
- t = "50%";
- break;
- case "left":
- case "top":
- t = "0%";
- break;
- case "right":
- case "bottom":
- t = "100%"
- }
- return "string" == typeof t ? xi(t).match(/%$/) ? parseFloat(t) / 100 * e : parseFloat(t) : null == t ? NaN : +t
- }
- function wi(t, e, i) {
- return null == e && (e = 10),
- e = Math.min(Math.max(0, e), 20),
- t = (+t).toFixed(e),
- i ? t : +t
- }
- function Si(t) {
- return t.sort(function(t, e) {
- return t - e
- }),
- t
- }
- function Mi(t) {
- if (t = +t,
- isNaN(t))
- return 0;
- for (var e = 1, i = 0; Math.round(t * e) / e !== t; )
- e *= 10,
- i++;
- return i
- }
- function Ii(t) {
- var e = t.toString()
- , i = e.indexOf("e");
- if (i > 0) {
- var n = +e.slice(i + 1);
- return n < 0 ? -n : 0
- }
- var o = e.indexOf(".");
- return o < 0 ? 0 : e.length - 1 - o
- }
- function Ti(t, e) {
- var i = Math.log
- , n = Math.LN10
- , o = Math.floor(i(t[1] - t[0]) / n)
- , a = Math.round(i(Math.abs(e[1] - e[0])) / n)
- , r = Math.min(Math.max(-o + a, 0), 20);
- return isFinite(r) ? r : 20
- }
- function Ai(t, e, i) {
- if (!t[e])
- return 0;
- var n = f(t, function(t, e) {
- return t + (isNaN(e) ? 0 : e)
- }, 0);
- if (0 === n)
- return 0;
- for (var o = Math.pow(10, i), a = d(t, function(t) {
- return (isNaN(t) ? 0 : t) / n * o * 100
- }), r = 100 * o, s = d(a, function(t) {
- return Math.floor(t)
- }), l = f(s, function(t, e) {
- return t + e
- }, 0), h = d(a, function(t, e) {
- return t - s[e]
- }); l < r; ) {
- for (var u = Number.NEGATIVE_INFINITY, c = null, g = 0, p = h.length; g < p; ++g)
- h[g] > u && (u = h[g],
- c = g);
- ++s[c],
- h[c] = 0,
- ++l
- }
- return s[e] / o
- }
- function Ci(t) {
- var e = 2 * Math.PI;
- return (t % e + e) % e
- }
- function Di(t) {
- return t > -Wx && t < Wx
- }
- function Li(t) {
- if (t instanceof Date)
- return t;
- if ("string" == typeof t) {
- var e = Fx.exec(t);
- if (!e)
- return new Date(NaN);
- if (e[8]) {
- var i = +e[4] || 0;
- return "Z" !== e[8].toUpperCase() && (i -= e[8].slice(0, 3)),
- new Date(Date.UTC(+e[1], +(e[2] || 1) - 1, +e[3] || 1, i, +(e[5] || 0), +e[6] || 0, +e[7] || 0))
- }
- return new Date(+e[1],+(e[2] || 1) - 1,+e[3] || 1,+e[4] || 0,+(e[5] || 0),+e[6] || 0,+e[7] || 0)
- }
- return null == t ? new Date(NaN) : new Date(Math.round(t))
- }
- function ki(t) {
- return Math.pow(10, Pi(t))
- }
- function Pi(t) {
- return Math.floor(Math.log(t) / Math.LN10)
- }
- function Oi(t, e) {
- var i, n = Pi(t), o = Math.pow(10, n), a = t / o;
- return i = e ? a < 1.5 ? 1 : a < 2.5 ? 2 : a < 4 ? 3 : a < 7 ? 5 : 10 : a < 1 ? 1 : a < 2 ? 2 : a < 3 ? 3 : a < 5 ? 5 : 10,
- t = i * o,
- n >= -20 ? +t.toFixed(n < 0 ? -n : 0) : t
- }
- function zi(t) {
- function e(t, i, n) {
- return t.interval[n] < i.interval[n] || t.interval[n] === i.interval[n] && (t.close[n] - i.close[n] == (n ? -1 : 1) || !n && e(t, i, 1))
- }
- t.sort(function(t, i) {
- return e(t, i, 0) ? -1 : 1
- });
- for (var i = -1 / 0, n = 1, o = 0; o < t.length; ) {
- for (var a = t[o].interval, r = t[o].close, s = 0; s < 2; s++)
- a[s] <= i && (a[s] = i,
- r[s] = s ? 1 : 1 - n),
- i = a[s],
- n = r[s];
- a[0] === a[1] && r[0] * r[1] != 1 ? t.splice(o, 1) : o++
- }
- return t
- }
- function Ni(t) {
- return t - parseFloat(t) >= 0
- }
- function Ei(t) {
- return isNaN(t) ? "-" : (t = (t + "").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, "$1,") + (t.length > 1 ? "." + t[1] : "")
- }
- function Ri(t, e) {
- return t = (t || "").toLowerCase().replace(/-(.)/g, function(t, e) {
- return e.toUpperCase()
- }),
- e && t && (t = t.charAt(0).toUpperCase() + t.slice(1)),
- t
- }
- function Vi(t) {
- return String(t).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'")
- }
- function Bi(t, e, i) {
- v(e) || (e = [e]);
- var n = e.length;
- if (!n)
- return "";
- for (var o = e[0].$vars || [], a = 0; a < o.length; a++) {
- var r = jx[a]
- , s = Xx(r, 0);
- t = t.replace(Xx(r), i ? Vi(s) : s)
- }
- for (var l = 0; l < n; l++)
- for (var h = 0; h < o.length; h++) {
- s = e[l][o[h]];
- t = t.replace(Xx(jx[h], l), i ? Vi(s) : s)
- }
- return t
- }
- function Gi(t, e, i) {
- return c(e, function(e, n) {
- t = t.replace("{" + n + "}", i ? Vi(e) : e)
- }),
- t
- }
- function Wi(t, e) {
- return t ? '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + Vi(t) + ";" + (e || "") + '"></span>' : ""
- }
- function Hi(t, e, i) {
- "week" !== t && "month" !== t && "quarter" !== t && "half-year" !== t && "year" !== t || (t = "MM-dd\nyyyy");
- var n = Li(e)
- , o = i ? "UTC" : ""
- , a = n["get" + o + "FullYear"]()
- , r = n["get" + o + "Month"]() + 1
- , s = n["get" + o + "Date"]()
- , l = n["get" + o + "Hours"]()
- , h = n["get" + o + "Minutes"]()
- , u = n["get" + o + "Seconds"]();
- return t = t.replace("MM", qx(r)).replace("M", r).replace("yyyy", a).replace("yy", a % 100).replace("dd", qx(s)).replace("d", s).replace("hh", qx(l)).replace("h", l).replace("mm", qx(h)).replace("m", h).replace("ss", qx(u)).replace("s", u)
- }
- function Fi(t) {
- return t ? t.charAt(0).toUpperCase() + t.substr(1) : t
- }
- function Zi(t, e, i) {
- return t[t_ + e] = i
- }
- function Ui(t, e) {
- return t[t_ + e]
- }
- function ji(t, e) {
- return t.hasOwnProperty(t_ + e)
- }
- function Xi(t) {
- var e = {
- main: "",
- sub: ""
- };
- return t && (t = t.split(Jx),
- e.main = t[0] || "",
- e.sub = t[1] || ""),
- e
- }
- function qi(t) {
- D(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t), 'componentType "' + t + '" illegal')
- }
- function Yi(t, e) {
- t.$constructor = t,
- t.extend = function(t) {
- var e = this
- , i = function() {
- t.$constructor ? t.$constructor.apply(this, arguments) : e.apply(this, arguments)
- };
- return o(i.prototype, t),
- i.extend = this.extend,
- i.superCall = $i,
- i.superApply = Ki,
- l(i, this),
- i.superClass = e,
- i
- }
- }
- function $i(t, e) {
- var i = A(arguments, 2);
- return this.superClass.prototype[e].apply(t, i)
- }
- function Ki(t, e, i) {
- return this.superClass.prototype[e].apply(t, i)
- }
- function Ji(t, e) {
- function i(t) {
- var e = n[t.main];
- return e && e[Qx] || ((e = n[t.main] = {})[Qx] = !0),
- e
- }
- e = e || {};
- var n = {};
- if (t.registerClass = function(t, e) {
- return e && (qi(e),
- (e = Xi(e)).sub ? e.sub !== Qx && (i(e)[e.sub] = t) : n[e.main] = t),
- t
- }
- ,
- t.getClass = function(t, e, i) {
- var o = n[t];
- if (o && o[Qx] && (o = e ? o[e] : null),
- i && !o)
- throw new Error(e ? "Component " + t + "." + (e || "") + " not exists. Load it first." : t + ".type should be specified.");
- return o
- }
- ,
- t.getClassesByMainType = function(t) {
- t = Xi(t);
- var e = []
- , i = n[t.main];
- return i && i[Qx] ? c(i, function(t, i) {
- i !== Qx && e.push(t)
- }) : e.push(i),
- e
- }
- ,
- t.hasClass = function(t) {
- return t = Xi(t),
- !!n[t.main]
- }
- ,
- t.getAllClassMainTypes = function() {
- var t = [];
- return c(n, function(e, i) {
- t.push(i)
- }),
- t
- }
- ,
- t.hasSubTypes = function(t) {
- t = Xi(t);
- var e = n[t.main];
- return e && e[Qx]
- }
- ,
- t.parseClassType = Xi,
- e.registerWhenExtend) {
- var o = t.extend;
- o && (t.extend = function(e) {
- var i = o.call(this, e);
- return t.registerClass(i, e.type)
- }
- )
- }
- return t
- }
- function Qi(t) {
- return t > -l_ && t < l_
- }
- function tn(t) {
- return t > l_ || t < -l_
- }
- function en(t, e, i, n, o) {
- var a = 1 - o;
- return a * a * (a * t + 3 * o * e) + o * o * (o * n + 3 * a * i)
- }
- function nn(t, e, i, n, o) {
- var a = 1 - o;
- return 3 * (((e - t) * a + 2 * (i - e) * o) * a + (n - i) * o * o)
- }
- function on(t, e, i, n, o, a) {
- var r = n + 3 * (e - i) - t
- , s = 3 * (i - 2 * e + t)
- , l = 3 * (e - t)
- , h = t - o
- , u = s * s - 3 * r * l
- , c = s * l - 9 * r * h
- , d = l * l - 3 * s * h
- , f = 0;
- if (Qi(u) && Qi(c))
- Qi(s) ? a[0] = 0 : (M = -l / s) >= 0 && M <= 1 && (a[f++] = M);
- else {
- var g = c * c - 4 * u * d;
- if (Qi(g)) {
- var p = c / u
- , m = -p / 2;
- (M = -s / r + p) >= 0 && M <= 1 && (a[f++] = M),
- m >= 0 && m <= 1 && (a[f++] = m)
- } else if (g > 0) {
- var v = s_(g)
- , y = u * s + 1.5 * r * (-c + v)
- , x = u * s + 1.5 * r * (-c - v);
- (M = (-s - ((y = y < 0 ? -r_(-y, c_) : r_(y, c_)) + (x = x < 0 ? -r_(-x, c_) : r_(x, c_)))) / (3 * r)) >= 0 && M <= 1 && (a[f++] = M)
- } else {
- var _ = (2 * u * s - 3 * r * c) / (2 * s_(u * u * u))
- , b = Math.acos(_) / 3
- , w = s_(u)
- , S = Math.cos(b)
- , M = (-s - 2 * w * S) / (3 * r)
- , m = (-s + w * (S + u_ * Math.sin(b))) / (3 * r)
- , I = (-s + w * (S - u_ * Math.sin(b))) / (3 * r);
- M >= 0 && M <= 1 && (a[f++] = M),
- m >= 0 && m <= 1 && (a[f++] = m),
- I >= 0 && I <= 1 && (a[f++] = I)
- }
- }
- return f
- }
- function an(t, e, i, n, o) {
- var a = 6 * i - 12 * e + 6 * t
- , r = 9 * e + 3 * n - 3 * t - 9 * i
- , s = 3 * e - 3 * t
- , l = 0;
- if (Qi(r))
- tn(a) && (c = -s / a) >= 0 && c <= 1 && (o[l++] = c);
- else {
- var h = a * a - 4 * r * s;
- if (Qi(h))
- o[0] = -a / (2 * r);
- else if (h > 0) {
- var u = s_(h)
- , c = (-a + u) / (2 * r)
- , d = (-a - u) / (2 * r);
- c >= 0 && c <= 1 && (o[l++] = c),
- d >= 0 && d <= 1 && (o[l++] = d)
- }
- }
- return l
- }
- function rn(t, e, i, n, o, a) {
- var r = (e - t) * o + t
- , s = (i - e) * o + e
- , l = (n - i) * o + i
- , h = (s - r) * o + r
- , u = (l - s) * o + s
- , c = (u - h) * o + h;
- a[0] = t,
- a[1] = r,
- a[2] = h,
- a[3] = c,
- a[4] = c,
- a[5] = u,
- a[6] = l,
- a[7] = n
- }
- function sn(t, e, i, n, o, a, r, s, l, h, u) {
- var c, d, f, g, p, m = .005, v = 1 / 0;
- d_[0] = l,
- d_[1] = h;
- for (var y = 0; y < 1; y += .05)
- f_[0] = en(t, i, o, r, y),
- f_[1] = en(e, n, a, s, y),
- (g = fy(d_, f_)) < v && (c = y,
- v = g);
- v = 1 / 0;
- for (var x = 0; x < 32 && !(m < h_); x++)
- d = c - m,
- f = c + m,
- f_[0] = en(t, i, o, r, d),
- f_[1] = en(e, n, a, s, d),
- g = fy(f_, d_),
- d >= 0 && g < v ? (c = d,
- v = g) : (g_[0] = en(t, i, o, r, f),
- g_[1] = en(e, n, a, s, f),
- p = fy(g_, d_),
- f <= 1 && p < v ? (c = f,
- v = p) : m *= .5);
- return u && (u[0] = en(t, i, o, r, c),
- u[1] = en(e, n, a, s, c)),
- s_(v)
- }
- function ln(t, e, i, n) {
- var o = 1 - n;
- return o * (o * t + 2 * n * e) + n * n * i
- }
- function hn(t, e, i, n) {
- return 2 * ((1 - n) * (e - t) + n * (i - e))
- }
- function un(t, e, i, n, o) {
- var a = t - 2 * e + i
- , r = 2 * (e - t)
- , s = t - n
- , l = 0;
- if (Qi(a))
- tn(r) && (c = -s / r) >= 0 && c <= 1 && (o[l++] = c);
- else {
- var h = r * r - 4 * a * s;
- if (Qi(h))
- (c = -r / (2 * a)) >= 0 && c <= 1 && (o[l++] = c);
- else if (h > 0) {
- var u = s_(h)
- , c = (-r + u) / (2 * a)
- , d = (-r - u) / (2 * a);
- c >= 0 && c <= 1 && (o[l++] = c),
- d >= 0 && d <= 1 && (o[l++] = d)
- }
- }
- return l
- }
- function cn(t, e, i) {
- var n = t + i - 2 * e;
- return 0 === n ? .5 : (t - e) / n
- }
- function dn(t, e, i, n, o) {
- var a = (e - t) * n + t
- , r = (i - e) * n + e
- , s = (r - a) * n + a;
- o[0] = t,
- o[1] = a,
- o[2] = s,
- o[3] = s,
- o[4] = r,
- o[5] = i
- }
- function fn(t, e, i, n, o, a, r, s, l) {
- var h, u = .005, c = 1 / 0;
- d_[0] = r,
- d_[1] = s;
- for (var d = 0; d < 1; d += .05)
- f_[0] = ln(t, i, o, d),
- f_[1] = ln(e, n, a, d),
- (m = fy(d_, f_)) < c && (h = d,
- c = m);
- c = 1 / 0;
- for (var f = 0; f < 32 && !(u < h_); f++) {
- var g = h - u
- , p = h + u;
- f_[0] = ln(t, i, o, g),
- f_[1] = ln(e, n, a, g);
- var m = fy(f_, d_);
- if (g >= 0 && m < c)
- h = g,
- c = m;
- else {
- g_[0] = ln(t, i, o, p),
- g_[1] = ln(e, n, a, p);
- var v = fy(g_, d_);
- p <= 1 && v < c ? (h = p,
- c = v) : u *= .5
- }
- }
- return l && (l[0] = ln(t, i, o, h),
- l[1] = ln(e, n, a, h)),
- s_(c)
- }
- function gn(t, e, i) {
- if (0 !== t.length) {
- var n, o = t[0], a = o[0], r = o[0], s = o[1], l = o[1];
- for (n = 1; n < t.length; n++)
- o = t[n],
- a = p_(a, o[0]),
- r = m_(r, o[0]),
- s = p_(s, o[1]),
- l = m_(l, o[1]);
- e[0] = a,
- e[1] = s,
- i[0] = r,
- i[1] = l
- }
- }
- function pn(t, e, i, n, o, a) {
- o[0] = p_(t, i),
- o[1] = p_(e, n),
- a[0] = m_(t, i),
- a[1] = m_(e, n)
- }
- function mn(t, e, i, n, o, a, r, s, l, h) {
- var u, c = an, d = en, f = c(t, i, o, r, S_);
- for (l[0] = 1 / 0,
- l[1] = 1 / 0,
- h[0] = -1 / 0,
- h[1] = -1 / 0,
- u = 0; u < f; u++) {
- var g = d(t, i, o, r, S_[u]);
- l[0] = p_(g, l[0]),
- h[0] = m_(g, h[0])
- }
- for (f = c(e, n, a, s, M_),
- u = 0; u < f; u++) {
- var p = d(e, n, a, s, M_[u]);
- l[1] = p_(p, l[1]),
- h[1] = m_(p, h[1])
- }
- l[0] = p_(t, l[0]),
- h[0] = m_(t, h[0]),
- l[0] = p_(r, l[0]),
- h[0] = m_(r, h[0]),
- l[1] = p_(e, l[1]),
- h[1] = m_(e, h[1]),
- l[1] = p_(s, l[1]),
- h[1] = m_(s, h[1])
- }
- function vn(t, e, i, n, o, a, r, s) {
- var l = cn
- , h = ln
- , u = m_(p_(l(t, i, o), 1), 0)
- , c = m_(p_(l(e, n, a), 1), 0)
- , d = h(t, i, o, u)
- , f = h(e, n, a, c);
- r[0] = p_(t, o, d),
- r[1] = p_(e, a, f),
- s[0] = m_(t, o, d),
- s[1] = m_(e, a, f)
- }
- function yn(t, e, i, n, o, a, r, s, l) {
- var h = $
- , u = K
- , c = Math.abs(o - a);
- if (c % x_ < 1e-4 && c > 1e-4)
- return s[0] = t - i,
- s[1] = e - n,
- l[0] = t + i,
- void (l[1] = e + n);
- if (__[0] = y_(o) * i + t,
- __[1] = v_(o) * n + e,
- b_[0] = y_(a) * i + t,
- b_[1] = v_(a) * n + e,
- h(s, __, b_),
- u(l, __, b_),
- (o %= x_) < 0 && (o += x_),
- (a %= x_) < 0 && (a += x_),
- o > a && !r ? a += x_ : o < a && r && (o += x_),
- r) {
- var d = a;
- a = o,
- o = d
- }
- for (var f = 0; f < a; f += Math.PI / 2)
- f > o && (w_[0] = y_(f) * i + t,
- w_[1] = v_(f) * n + e,
- h(s, w_, s),
- u(l, w_, l))
- }
- function xn(t, e, i, n, o, a, r) {
- if (0 === o)
- return !1;
- var s = o
- , l = 0
- , h = t;
- if (r > e + s && r > n + s || r < e - s && r < n - s || a > t + s && a > i + s || a < t - s && a < i - s)
- return !1;
- if (t === i)
- return Math.abs(a - t) <= s / 2;
- var u = (l = (e - n) / (t - i)) * a - r + (h = (t * n - i * e) / (t - i));
- return u * u / (l * l + 1) <= s / 2 * s / 2
- }
- function _n(t, e, i, n, o, a, r, s, l, h, u) {
- if (0 === l)
- return !1;
- var c = l;
- return !(u > e + c && u > n + c && u > a + c && u > s + c || u < e - c && u < n - c && u < a - c && u < s - c || h > t + c && h > i + c && h > o + c && h > r + c || h < t - c && h < i - c && h < o - c && h < r - c) && sn(t, e, i, n, o, a, r, s, h, u, null) <= c / 2
- }
- function bn(t, e, i, n, o, a, r, s, l) {
- if (0 === r)
- return !1;
- var h = r;
- return !(l > e + h && l > n + h && l > a + h || l < e - h && l < n - h && l < a - h || s > t + h && s > i + h && s > o + h || s < t - h && s < i - h && s < o - h) && fn(t, e, i, n, o, a, s, l, null) <= h / 2
- }
- function wn(t) {
- return (t %= V_) < 0 && (t += V_),
- t
- }
- function Sn(t, e, i, n, o, a, r, s, l) {
- if (0 === r)
- return !1;
- var h = r;
- s -= t,
- l -= e;
- var u = Math.sqrt(s * s + l * l);
- if (u - h > i || u + h < i)
- return !1;
- if (Math.abs(n - o) % B_ < 1e-4)
- return !0;
- if (a) {
- var c = n;
- n = wn(o),
- o = wn(c)
- } else
- n = wn(n),
- o = wn(o);
- n > o && (o += B_);
- var d = Math.atan2(l, s);
- return d < 0 && (d += B_),
- d >= n && d <= o || d + B_ >= n && d + B_ <= o
- }
- function Mn(t, e, i, n, o, a) {
- if (a > e && a > n || a < e && a < n)
- return 0;
- if (n === e)
- return 0;
- var r = n < e ? 1 : -1
- , s = (a - e) / (n - e);
- return 1 !== s && 0 !== s || (r = n < e ? .5 : -.5),
- s * (i - t) + t > o ? r : 0
- }
- function In(t, e) {
- return Math.abs(t - e) < W_
- }
- function Tn() {
- var t = F_[0];
- F_[0] = F_[1],
- F_[1] = t
- }
- function An(t, e, i, n, o, a, r, s, l, h) {
- if (h > e && h > n && h > a && h > s || h < e && h < n && h < a && h < s)
- return 0;
- var u = on(e, n, a, s, h, H_);
- if (0 === u)
- return 0;
- for (var c, d, f = 0, g = -1, p = 0; p < u; p++) {
- var m = H_[p]
- , v = 0 === m || 1 === m ? .5 : 1;
- en(t, i, o, r, m) < l || (g < 0 && (g = an(e, n, a, s, F_),
- F_[1] < F_[0] && g > 1 && Tn(),
- c = en(e, n, a, s, F_[0]),
- g > 1 && (d = en(e, n, a, s, F_[1]))),
- 2 == g ? m < F_[0] ? f += c < e ? v : -v : m < F_[1] ? f += d < c ? v : -v : f += s < d ? v : -v : m < F_[0] ? f += c < e ? v : -v : f += s < c ? v : -v)
- }
- return f
- }
- function Cn(t, e, i, n, o, a, r, s) {
- if (s > e && s > n && s > a || s < e && s < n && s < a)
- return 0;
- var l = un(e, n, a, s, H_);
- if (0 === l)
- return 0;
- var h = cn(e, n, a);
- if (h >= 0 && h <= 1) {
- for (var u = 0, c = ln(e, n, a, h), d = 0; d < l; d++) {
- f = 0 === H_[d] || 1 === H_[d] ? .5 : 1;
- (g = ln(t, i, o, H_[d])) < r || (H_[d] < h ? u += c < e ? f : -f : u += a < c ? f : -f)
- }
- return u
- }
- var f = 0 === H_[0] || 1 === H_[0] ? .5 : 1
- , g = ln(t, i, o, H_[0]);
- return g < r ? 0 : a < e ? f : -f
- }
- function Dn(t, e, i, n, o, a, r, s) {
- if ((s -= e) > i || s < -i)
- return 0;
- h = Math.sqrt(i * i - s * s);
- H_[0] = -h,
- H_[1] = h;
- var l = Math.abs(n - o);
- if (l < 1e-4)
- return 0;
- if (l % G_ < 1e-4) {
- n = 0,
- o = G_;
- g = a ? 1 : -1;
- return r >= H_[0] + t && r <= H_[1] + t ? g : 0
- }
- if (a) {
- var h = n;
- n = wn(o),
- o = wn(h)
- } else
- n = wn(n),
- o = wn(o);
- n > o && (o += G_);
- for (var u = 0, c = 0; c < 2; c++) {
- var d = H_[c];
- if (d + t > r) {
- var f = Math.atan2(s, d)
- , g = a ? 1 : -1;
- f < 0 && (f = G_ + f),
- (f >= n && f <= o || f + G_ >= n && f + G_ <= o) && (f > Math.PI / 2 && f < 1.5 * Math.PI && (g = -g),
- u += g)
- }
- }
- return u
- }
- function Ln(t, e, i, n, o) {
- for (var a = 0, r = 0, s = 0, l = 0, h = 0, u = 0; u < t.length; ) {
- var c = t[u++];
- switch (c === I_.M && u > 1 && (i || (a += Mn(r, s, l, h, n, o))),
- 1 == u && (l = r = t[u],
- h = s = t[u + 1]),
- c) {
- case I_.M:
- r = l = t[u++],
- s = h = t[u++];
- break;
- case I_.L:
- if (i) {
- if (xn(r, s, t[u], t[u + 1], e, n, o))
- return !0
- } else
- a += Mn(r, s, t[u], t[u + 1], n, o) || 0;
- r = t[u++],
- s = t[u++];
- break;
- case I_.C:
- if (i) {
- if (_n(r, s, t[u++], t[u++], t[u++], t[u++], t[u], t[u + 1], e, n, o))
- return !0
- } else
- a += An(r, s, t[u++], t[u++], t[u++], t[u++], t[u], t[u + 1], n, o) || 0;
- r = t[u++],
- s = t[u++];
- break;
- case I_.Q:
- if (i) {
- if (bn(r, s, t[u++], t[u++], t[u], t[u + 1], e, n, o))
- return !0
- } else
- a += Cn(r, s, t[u++], t[u++], t[u], t[u + 1], n, o) || 0;
- r = t[u++],
- s = t[u++];
- break;
- case I_.A:
- var d = t[u++]
- , f = t[u++]
- , g = t[u++]
- , p = t[u++]
- , m = t[u++]
- , v = t[u++]
- , y = (t[u++],
- 1 - t[u++])
- , x = Math.cos(m) * g + d
- , _ = Math.sin(m) * p + f;
- u > 1 ? a += Mn(r, s, x, _, n, o) : (l = x,
- h = _);
- var b = (n - d) * p / g + d;
- if (i) {
- if (Sn(d, f, p, m, m + v, y, e, b, o))
- return !0
- } else
- a += Dn(d, f, p, m, m + v, y, b, o);
- r = Math.cos(m + v) * g + d,
- s = Math.sin(m + v) * p + f;
- break;
- case I_.R:
- l = r = t[u++],
- h = s = t[u++];
- var x = l + t[u++]
- , _ = h + t[u++];
- if (i) {
- if (xn(l, h, x, h, e, n, o) || xn(x, h, x, _, e, n, o) || xn(x, _, l, _, e, n, o) || xn(l, _, l, h, e, n, o))
- return !0
- } else
- a += Mn(x, h, x, _, n, o),
- a += Mn(l, _, l, h, n, o);
- break;
- case I_.Z:
- if (i) {
- if (xn(r, s, l, h, e, n, o))
- return !0
- } else
- a += Mn(r, s, l, h, n, o);
- r = l,
- s = h
- }
- }
- return i || In(s, h) || (a += Mn(r, s, l, h, n, o) || 0),
- 0 !== a
- }
- function kn(t, e, i) {
- return Ln(t, 0, !1, e, i)
- }
- function Pn(t, e, i, n) {
- return Ln(t, e, !0, i, n)
- }
- function On(t) {
- Ue.call(this, t),
- this.path = null
- }
- function zn(t, e, i, n, o, a, r, s, l, h, u) {
- var c = l * (eb / 180)
- , d = tb(c) * (t - i) / 2 + Q_(c) * (e - n) / 2
- , f = -1 * Q_(c) * (t - i) / 2 + tb(c) * (e - n) / 2
- , g = d * d / (r * r) + f * f / (s * s);
- g > 1 && (r *= J_(g),
- s *= J_(g));
- var p = (o === a ? -1 : 1) * J_((r * r * (s * s) - r * r * (f * f) - s * s * (d * d)) / (r * r * (f * f) + s * s * (d * d))) || 0
- , m = p * r * f / s
- , v = p * -s * d / r
- , y = (t + i) / 2 + tb(c) * m - Q_(c) * v
- , x = (e + n) / 2 + Q_(c) * m + tb(c) * v
- , _ = ob([1, 0], [(d - m) / r, (f - v) / s])
- , b = [(d - m) / r, (f - v) / s]
- , w = [(-1 * d - m) / r, (-1 * f - v) / s]
- , S = ob(b, w);
- nb(b, w) <= -1 && (S = eb),
- nb(b, w) >= 1 && (S = 0),
- 0 === a && S > 0 && (S -= 2 * eb),
- 1 === a && S < 0 && (S += 2 * eb),
- u.addData(h, y, x, r, s, _, S, c, a)
- }
- function Nn(t) {
- if (!t)
- return [];
- var e, i = t.replace(/-/g, " -").replace(/ /g, " ").replace(/ /g, ",").replace(/,,/g, ",");
- for (e = 0; e < K_.length; e++)
- i = i.replace(new RegExp(K_[e],"g"), "|" + K_[e]);
- var n, o = i.split("|"), a = 0, r = 0, s = new R_, l = R_.CMD;
- for (e = 1; e < o.length; e++) {
- var h, u = o[e], c = u.charAt(0), d = 0, f = u.slice(1).replace(/e,-/g, "e-").split(",");
- f.length > 0 && "" === f[0] && f.shift();
- for (var g = 0; g < f.length; g++)
- f[g] = parseFloat(f[g]);
- for (; d < f.length && !isNaN(f[d]) && !isNaN(f[0]); ) {
- var p, m, v, y, x, _, b, w = a, S = r;
- switch (c) {
- case "l":
- a += f[d++],
- r += f[d++],
- h = l.L,
- s.addData(h, a, r);
- break;
- case "L":
- a = f[d++],
- r = f[d++],
- h = l.L,
- s.addData(h, a, r);
- break;
- case "m":
- a += f[d++],
- r += f[d++],
- h = l.M,
- s.addData(h, a, r),
- c = "l";
- break;
- case "M":
- a = f[d++],
- r = f[d++],
- h = l.M,
- s.addData(h, a, r),
- c = "L";
- break;
- case "h":
- a += f[d++],
- h = l.L,
- s.addData(h, a, r);
- break;
- case "H":
- a = f[d++],
- h = l.L,
- s.addData(h, a, r);
- break;
- case "v":
- r += f[d++],
- h = l.L,
- s.addData(h, a, r);
- break;
- case "V":
- r = f[d++],
- h = l.L,
- s.addData(h, a, r);
- break;
- case "C":
- h = l.C,
- s.addData(h, f[d++], f[d++], f[d++], f[d++], f[d++], f[d++]),
- a = f[d - 2],
- r = f[d - 1];
- break;
- case "c":
- h = l.C,
- s.addData(h, f[d++] + a, f[d++] + r, f[d++] + a, f[d++] + r, f[d++] + a, f[d++] + r),
- a += f[d - 2],
- r += f[d - 1];
- break;
- case "S":
- p = a,
- m = r;
- var M = s.len()
- , I = s.data;
- n === l.C && (p += a - I[M - 4],
- m += r - I[M - 3]),
- h = l.C,
- w = f[d++],
- S = f[d++],
- a = f[d++],
- r = f[d++],
- s.addData(h, p, m, w, S, a, r);
- break;
- case "s":
- p = a,
- m = r;
- var M = s.len()
- , I = s.data;
- n === l.C && (p += a - I[M - 4],
- m += r - I[M - 3]),
- h = l.C,
- w = a + f[d++],
- S = r + f[d++],
- a += f[d++],
- r += f[d++],
- s.addData(h, p, m, w, S, a, r);
- break;
- case "Q":
- w = f[d++],
- S = f[d++],
- a = f[d++],
- r = f[d++],
- h = l.Q,
- s.addData(h, w, S, a, r);
- break;
- case "q":
- w = f[d++] + a,
- S = f[d++] + r,
- a += f[d++],
- r += f[d++],
- h = l.Q,
- s.addData(h, w, S, a, r);
- break;
- case "T":
- p = a,
- m = r;
- var M = s.len()
- , I = s.data;
- n === l.Q && (p += a - I[M - 4],
- m += r - I[M - 3]),
- a = f[d++],
- r = f[d++],
- h = l.Q,
- s.addData(h, p, m, a, r);
- break;
- case "t":
- p = a,
- m = r;
- var M = s.len()
- , I = s.data;
- n === l.Q && (p += a - I[M - 4],
- m += r - I[M - 3]),
- a += f[d++],
- r += f[d++],
- h = l.Q,
- s.addData(h, p, m, a, r);
- break;
- case "A":
- v = f[d++],
- y = f[d++],
- x = f[d++],
- _ = f[d++],
- b = f[d++],
- zn(w = a, S = r, a = f[d++], r = f[d++], _, b, v, y, x, h = l.A, s);
- break;
- case "a":
- v = f[d++],
- y = f[d++],
- x = f[d++],
- _ = f[d++],
- b = f[d++],
- zn(w = a, S = r, a += f[d++], r += f[d++], _, b, v, y, x, h = l.A, s)
- }
- }
- "z" !== c && "Z" !== c || (h = l.Z,
- s.addData(h)),
- n = h
- }
- return s.toStatic(),
- s
- }
- function En(t, e) {
- var i = Nn(t);
- return e = e || {},
- e.buildPath = function(t) {
- if (t.setData)
- t.setData(i.data),
- (e = t.getContext()) && t.rebuildPath(e);
- else {
- var e = t;
- i.rebuildPath(e)
- }
- }
- ,
- e.applyTransform = function(t) {
- $_(i, t),
- this.dirty(!0)
- }
- ,
- e
- }
- function Rn(t, e) {
- return new On(En(t, e))
- }
- function Vn(t, e) {
- return On.extend(En(t, e))
- }
- function Bn(t, e, i, n, o, a, r) {
- var s = .5 * (i - t)
- , l = .5 * (n - e);
- return (2 * (e - i) + s + l) * r + (-3 * (e - i) - 2 * s - l) * a + s * o + e
- }
- function Gn(t, e, i) {
- var n = e.points
- , o = e.smooth;
- if (n && n.length >= 2) {
- if (o && "spline" !== o) {
- var a = db(n, o, i, e.smoothConstraint);
- t.moveTo(n[0][0], n[0][1]);
- for (var r = n.length, s = 0; s < (i ? r : r - 1); s++) {
- var l = a[2 * s]
- , h = a[2 * s + 1]
- , u = n[(s + 1) % r];
- t.bezierCurveTo(l[0], l[1], h[0], h[1], u[0], u[1])
- }
- } else {
- "spline" === o && (n = cb(n, i)),
- t.moveTo(n[0][0], n[0][1]);
- for (var s = 1, c = n.length; s < c; s++)
- t.lineTo(n[s][0], n[s][1])
- }
- i && t.closePath()
- }
- }
- function Wn(t, e, i) {
- var n = t.cpx2
- , o = t.cpy2;
- return null === n || null === o ? [(i ? nn : en)(t.x1, t.cpx1, t.cpx2, t.x2, e), (i ? nn : en)(t.y1, t.cpy1, t.cpy2, t.y2, e)] : [(i ? hn : ln)(t.x1, t.cpx1, t.x2, e), (i ? hn : ln)(t.y1, t.cpy1, t.y2, e)]
- }
- function Hn(t) {
- return On.extend(t)
- }
- function Fn(t, e, i, n) {
- var o = Rn(t, e)
- , a = o.getBoundingRect();
- return i && ("center" === n && (i = Un(i, a)),
- jn(o, i)),
- o
- }
- function Zn(t, e, i) {
- var n = new je({
- style: {
- image: t,
- x: e.x,
- y: e.y,
- width: e.width,
- height: e.height
- },
- onload: function(t) {
- if ("center" === i) {
- var o = {
- width: t.width,
- height: t.height
- };
- n.setStyle(Un(e, o))
- }
- }
- });
- return n
- }
- function Un(t, e) {
- var i, n = e.width / e.height, o = t.height * n;
- return i = o <= t.width ? t.height : (o = t.width) / n,
- {
- x: t.x + t.width / 2 - o / 2,
- y: t.y + t.height / 2 - i / 2,
- width: o,
- height: i
- }
- }
- function jn(t, e) {
- if (t.applyTransform) {
- var i = t.getBoundingRect().calculateTransform(e);
- t.applyTransform(i)
- }
- }
- function Xn(t) {
- var e = t.shape
- , i = t.style.lineWidth;
- return Mb(2 * e.x1) === Mb(2 * e.x2) && (e.x1 = e.x2 = Yn(e.x1, i, !0)),
- Mb(2 * e.y1) === Mb(2 * e.y2) && (e.y1 = e.y2 = Yn(e.y1, i, !0)),
- t
- }
- function qn(t) {
- var e = t.shape
- , i = t.style.lineWidth
- , n = e.x
- , o = e.y
- , a = e.width
- , r = e.height;
- return e.x = Yn(e.x, i, !0),
- e.y = Yn(e.y, i, !0),
- e.width = Math.max(Yn(n + a, i, !1) - e.x, 0 === a ? 0 : 1),
- e.height = Math.max(Yn(o + r, i, !1) - e.y, 0 === r ? 0 : 1),
- t
- }
- function Yn(t, e, i) {
- var n = Mb(2 * t);
- return (n + Mb(e)) % 2 == 0 ? n / 2 : (n + (i ? 1 : -1)) / 2
- }
- function $n(t) {
- return null != t && "none" != t
- }
- function Kn(t) {
- return "string" == typeof t ? Tt(t, -.1) : t
- }
- function Jn(t) {
- if (t.__hoverStlDirty) {
- var e = t.style.stroke
- , i = t.style.fill
- , n = t.__hoverStl;
- n.fill = n.fill || ($n(i) ? Kn(i) : null),
- n.stroke = n.stroke || ($n(e) ? Kn(e) : null);
- var o = {};
- for (var a in n)
- null != n[a] && (o[a] = t.style[a]);
- t.__normalStl = o,
- t.__hoverStlDirty = !1
- }
- }
- function Qn(t) {
- if (!t.__isHover) {
- if (Jn(t),
- t.useHoverLayer)
- t.__zr && t.__zr.addHover(t, t.__hoverStl);
- else {
- var e = t.style
- , i = e.insideRollbackOpt;
- i && vo(e),
- e.extendFrom(t.__hoverStl),
- i && (mo(e, e.insideOriginalTextPosition, i),
- null == e.textFill && (e.textFill = i.autoColor)),
- t.dirty(!1),
- t.z2 += 1
- }
- t.__isHover = !0
- }
- }
- function to(t) {
- if (t.__isHover) {
- var e = t.__normalStl;
- t.useHoverLayer ? t.__zr && t.__zr.removeHover(t) : (e && t.setStyle(e),
- t.z2 -= 1),
- t.__isHover = !1
- }
- }
- function eo(t) {
- "group" === t.type ? t.traverse(function(t) {
- "group" !== t.type && Qn(t)
- }) : Qn(t)
- }
- function io(t) {
- "group" === t.type ? t.traverse(function(t) {
- "group" !== t.type && to(t)
- }) : to(t)
- }
- function no(t, e) {
- t.__hoverStl = t.hoverStyle || e || {},
- t.__hoverStlDirty = !0,
- t.__isHover && Jn(t)
- }
- function oo(t) {
- this.__hoverSilentOnTouch && t.zrByTouch || !this.__isEmphasis && eo(this)
- }
- function ao(t) {
- this.__hoverSilentOnTouch && t.zrByTouch || !this.__isEmphasis && io(this)
- }
- function ro() {
- this.__isEmphasis = !0,
- eo(this)
- }
- function so() {
- this.__isEmphasis = !1,
- io(this)
- }
- function lo(t, e, i) {
- t.__hoverSilentOnTouch = i && i.hoverSilentOnTouch,
- "group" === t.type ? t.traverse(function(t) {
- "group" !== t.type && no(t, e)
- }) : no(t, e),
- t.on("mouseover", oo).on("mouseout", ao),
- t.on("emphasis", ro).on("normal", so)
- }
- function ho(t, e, i, n, o, a, r) {
- var s = (o = o || Ab).labelFetcher
- , l = o.labelDataIndex
- , h = o.labelDimIndex
- , u = i.getShallow("show")
- , c = n.getShallow("show")
- , d = u || c ? I(s ? s.getFormattedLabel(l, "normal", null, h) : null, o.defaultText) : null
- , f = u ? d : null
- , g = c ? I(s ? s.getFormattedLabel(l, "emphasis", null, h) : null, d) : null;
- null == f && null == g || (uo(t, i, a, o),
- uo(e, n, r, o, !0)),
- t.text = f,
- e.text = g
- }
- function uo(t, e, i, n, a) {
- return co(t, e, n, a),
- i && o(t, i),
- t.host && t.host.dirty && t.host.dirty(!1),
- t
- }
- function co(t, e, i, n) {
- if ((i = i || Ab).isRectText) {
- var o = e.getShallow("position") || (n ? null : "inside");
- "outside" === o && (o = "top"),
- t.textPosition = o,
- t.textOffset = e.getShallow("offset");
- var a = e.getShallow("rotate");
- null != a && (a *= Math.PI / 180),
- t.textRotation = a,
- t.textDistance = I(e.getShallow("distance"), n ? null : 5)
- }
- var r, s = e.ecModel, l = s && s.option.textStyle, h = fo(e);
- if (h) {
- r = {};
- for (var u in h)
- if (h.hasOwnProperty(u)) {
- var c = e.getModel(["rich", u]);
- go(r[u] = {}, c, l, i, n)
- }
- }
- return t.rich = r,
- go(t, e, l, i, n, !0),
- i.forceRich && !i.textStyle && (i.textStyle = {}),
- t
- }
- function fo(t) {
- for (var e; t && t !== t.ecModel; ) {
- var i = (t.option || Ab).rich;
- if (i) {
- e = e || {};
- for (var n in i)
- i.hasOwnProperty(n) && (e[n] = 1)
- }
- t = t.parentModel
- }
- return e
- }
- function go(t, e, i, n, o, a) {
- if (i = !o && i || Ab,
- t.textFill = po(e.getShallow("color"), n) || i.color,
- t.textStroke = po(e.getShallow("textBorderColor"), n) || i.textBorderColor,
- t.textStrokeWidth = I(e.getShallow("textBorderWidth"), i.textBorderWidth),
- !o) {
- if (a) {
- var r = t.textPosition;
- t.insideRollback = mo(t, r, n),
- t.insideOriginalTextPosition = r,
- t.insideRollbackOpt = n
- }
- null == t.textFill && (t.textFill = n.autoColor)
- }
- t.fontStyle = e.getShallow("fontStyle") || i.fontStyle,
- t.fontWeight = e.getShallow("fontWeight") || i.fontWeight,
- t.fontSize = e.getShallow("fontSize") || i.fontSize,
- t.fontFamily = e.getShallow("fontFamily") || i.fontFamily,
- t.textAlign = e.getShallow("align"),
- t.textVerticalAlign = e.getShallow("verticalAlign") || e.getShallow("baseline"),
- t.textLineHeight = e.getShallow("lineHeight"),
- t.textWidth = e.getShallow("width"),
- t.textHeight = e.getShallow("height"),
- t.textTag = e.getShallow("tag"),
- a && n.disableBox || (t.textBackgroundColor = po(e.getShallow("backgroundColor"), n),
- t.textPadding = e.getShallow("padding"),
- t.textBorderColor = po(e.getShallow("borderColor"), n),
- t.textBorderWidth = e.getShallow("borderWidth"),
- t.textBorderRadius = e.getShallow("borderRadius"),
- t.textBoxShadowColor = e.getShallow("shadowColor"),
- t.textBoxShadowBlur = e.getShallow("shadowBlur"),
- t.textBoxShadowOffsetX = e.getShallow("shadowOffsetX"),
- t.textBoxShadowOffsetY = e.getShallow("shadowOffsetY")),
- t.textShadowColor = e.getShallow("textShadowColor") || i.textShadowColor,
- t.textShadowBlur = e.getShallow("textShadowBlur") || i.textShadowBlur,
- t.textShadowOffsetX = e.getShallow("textShadowOffsetX") || i.textShadowOffsetX,
- t.textShadowOffsetY = e.getShallow("textShadowOffsetY") || i.textShadowOffsetY
- }
- function po(t, e) {
- return "auto" !== t ? t : e && e.autoColor ? e.autoColor : null
- }
- function mo(t, e, i) {
- var n, o = i.useInsideStyle;
- return null == t.textFill && !1 !== o && (!0 === o || i.isRectText && e && "string" == typeof e && e.indexOf("inside") >= 0) && (n = {
- textFill: null,
- textStroke: t.textStroke,
- textStrokeWidth: t.textStrokeWidth
- },
- t.textFill = "#fff",
- null == t.textStroke && (t.textStroke = i.autoColor,
- null == t.textStrokeWidth && (t.textStrokeWidth = 2))),
- n
- }
- function vo(t) {
- var e = t.insideRollback;
- e && (t.textFill = e.textFill,
- t.textStroke = e.textStroke,
- t.textStrokeWidth = e.textStrokeWidth)
- }
- function yo(t, e) {
- var i = e || e.getModel("textStyle");
- return [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(" ")
- }
- function xo(t, e, i, n, o, a) {
- if ("function" == typeof o && (a = o,
- o = null),
- n && n.isAnimationEnabled()) {
- var r = t ? "Update" : ""
- , s = n.getShallow("animationDuration" + r)
- , l = n.getShallow("animationEasing" + r)
- , h = n.getShallow("animationDelay" + r);
- "function" == typeof h && (h = h(o, n.getAnimationDelayParams ? n.getAnimationDelayParams(e, o) : null)),
- "function" == typeof s && (s = s(o)),
- s > 0 ? e.animateTo(i, s, h || 0, l, a, !!a) : (e.stopAnimation(),
- e.attr(i),
- a && a())
- } else
- e.stopAnimation(),
- e.attr(i),
- a && a()
- }
- function _o(t, e, i, n, o) {
- xo(!0, t, e, i, n, o)
- }
- function bo(t, e, i, n, o) {
- xo(!1, t, e, i, n, o)
- }
- function wo(t, e) {
- for (var i = ot([]); t && t !== e; )
- rt(i, t.getLocalTransform(), i),
- t = t.parent;
- return i
- }
- function So(t, e, i) {
- return e && !u(e) && (e = My.getLocalTransform(e)),
- i && (e = ut([], e)),
- Y([], t, e)
- }
- function Mo(t, e, i) {
- var n = 0 === e[4] || 0 === e[5] || 0 === e[0] ? 1 : Math.abs(2 * e[4] / e[0])
- , o = 0 === e[4] || 0 === e[5] || 0 === e[2] ? 1 : Math.abs(2 * e[4] / e[2])
- , a = ["left" === t ? -n : "right" === t ? n : 0, "top" === t ? -o : "bottom" === t ? o : 0];
- return a = So(a, e, i),
- Math.abs(a[0]) > Math.abs(a[1]) ? a[0] > 0 ? "right" : "left" : a[1] > 0 ? "bottom" : "top"
- }
- function Io(t, e, i, n) {
- function a(t) {
- var e = {
- position: R(t.position),
- rotation: t.rotation
- };
- return t.shape && (e.shape = o({}, t.shape)),
- e
- }
- if (t && e) {
- var r = function(t) {
- var e = {};
- return t.traverse(function(t) {
- !t.isGroup && t.anid && (e[t.anid] = t)
- }),
- e
- }(t);
- e.traverse(function(t) {
- if (!t.isGroup && t.anid) {
- var e = r[t.anid];
- if (e) {
- var n = a(t);
- t.attr(a(e)),
- _o(t, n, i, t.dataIndex)
- }
- }
- })
- }
- }
- function To(t, e) {
- return d(t, function(t) {
- var i = t[0];
- i = Ib(i, e.x),
- i = Tb(i, e.x + e.width);
- var n = t[1];
- return n = Ib(n, e.y),
- n = Tb(n, e.y + e.height),
- [i, n]
- })
- }
- function Ao(t, e, i) {
- var n = (e = o({
- rectHover: !0
- }, e)).style = {
- strokeNoScale: !0
- };
- if (i = i || {
- x: -1,
- y: -1,
- width: 2,
- height: 2
- },
- t)
- return 0 === t.indexOf("image://") ? (n.image = t.slice(8),
- a(n, i),
- new je(e)) : Fn(t.replace("path://", ""), e, i, "center")
- }
- function Co(t, e, i) {
- this.parentModel = e,
- this.ecModel = i,
- this.option = t
- }
- function Do(t, e, i) {
- for (var n = 0; n < e.length && (!e[n] || null != (t = t && "object" == typeof t ? t[e[n]] : null)); n++)
- ;
- return null == t && i && (t = i.get(e)),
- t
- }
- function Lo(t, e) {
- var i = Ui(t, "getParent");
- return i ? i.call(t, e) : t.parentModel
- }
- function ko(t) {
- return t instanceof Array ? t : null == t ? [] : [t]
- }
- function Po(t, e) {
- if (t)
- for (var i = t.emphasis = t.emphasis || {}, n = t.normal = t.normal || {}, o = 0, a = e.length; o < a; o++) {
- var r = e[o];
- !i.hasOwnProperty(r) && n.hasOwnProperty(r) && (i[r] = n[r])
- }
- }
- function Oo(t) {
- return t && (null == t.value ? t : t.value)
- }
- function zo(t) {
- return Eb(t) && !(t instanceof Array)
- }
- function No(t, e) {
- var i = e && e.type;
- return "ordinal" === i ? t : ("time" === i && "number" != typeof t && null != t && "-" !== t && (t = +Li(t)),
- null == t || "" === t ? NaN : +t)
- }
- function Eo(t, e) {
- e = (e || []).slice();
- var i = d(t || [], function(t, e) {
- return {
- exist: t
- }
- });
- return Nb(e, function(t, n) {
- if (Eb(t)) {
- for (o = 0; o < i.length; o++)
- if (!i[o].option && null != t.id && i[o].exist.id === t.id + "")
- return i[o].option = t,
- void (e[n] = null);
- for (var o = 0; o < i.length; o++) {
- var a = i[o].exist;
- if (!(i[o].option || null != a.id && null != t.id || null == t.name || Vo(t) || Vo(a) || a.name !== t.name + ""))
- return i[o].option = t,
- void (e[n] = null)
- }
- }
- }),
- Nb(e, function(t, e) {
- if (Eb(t)) {
- for (var n = 0; n < i.length; n++) {
- var o = i[n].exist;
- if (!i[n].option && !Vo(o) && null == t.id) {
- i[n].option = t;
- break
- }
- }
- n >= i.length && i.push({
- option: t
- })
- }
- }),
- i
- }
- function Ro(t) {
- var e = O();
- Nb(t, function(t, i) {
- var n = t.exist;
- n && e.set(n.id, t)
- }),
- Nb(t, function(t, i) {
- var n = t.option;
- D(!n || null == n.id || !e.get(n.id) || e.get(n.id) === t, "id duplicates: " + (n && n.id)),
- n && null != n.id && e.set(n.id, t),
- !t.keyInfo && (t.keyInfo = {})
- }),
- Nb(t, function(t, i) {
- var n = t.exist
- , o = t.option
- , a = t.keyInfo;
- if (Eb(o)) {
- if (a.name = null != o.name ? o.name + "" : n ? n.name : "\0-",
- n)
- a.id = n.id;
- else if (null != o.id)
- a.id = o.id + "";
- else {
- var r = 0;
- do {
- a.id = "\0" + a.name + "\0" + r++
- } while (e.get(a.id))
- }
- e.set(a.id, t)
- }
- })
- }
- function Vo(t) {
- return Eb(t) && t.id && 0 === (t.id + "").indexOf("\0_ec_\0")
- }
- function Bo(t, e) {
- function i(t, e, i) {
- for (var n = 0, o = t.length; n < o; n++)
- for (var a = t[n].seriesId, r = ko(t[n].dataIndex), s = i && i[a], l = 0, h = r.length; l < h; l++) {
- var u = r[l];
- s && s[u] ? s[u] = null : (e[a] || (e[a] = {}))[u] = 1
- }
- }
- function n(t, e) {
- var i = [];
- for (var o in t)
- if (t.hasOwnProperty(o) && null != t[o])
- if (e)
- i.push(+o);
- else {
- var a = n(t[o], !0);
- a.length && i.push({
- seriesId: o,
- dataIndex: a
- })
- }
- return i
- }
- var o = {}
- , a = {};
- return i(t || [], o),
- i(e || [], a, o),
- [n(o), n(a)]
- }
- function Go(t, e) {
- return null != e.dataIndexInside ? e.dataIndexInside : null != e.dataIndex ? v(e.dataIndex) ? d(e.dataIndex, function(e) {
- return t.indexOfRawIndex(e)
- }) : t.indexOfRawIndex(e.dataIndex) : null != e.name ? v(e.name) ? d(e.name, function(e) {
- return t.indexOfName(e)
- }) : t.indexOfName(e.name) : void 0
- }
- function Wo(t, e, i) {
- if (x(e)) {
- var n = {};
- n[e + "Index"] = 0,
- e = n
- }
- var o = i && i.defaultMainType;
- !o || Uo(e, o + "Index") || Uo(e, o + "Id") || Uo(e, o + "Name") || (e[o + "Index"] = 0);
- var a = {};
- return Nb(e, function(n, o) {
- var n = e[o];
- if ("dataIndex" !== o && "dataIndexInside" !== o) {
- var r = o.match(/^(\w+)(Index|Id|Name)$/) || []
- , l = r[1]
- , h = (r[2] || "").toLowerCase();
- if (!(!l || !h || null == n || "index" === h && "none" === n || i && i.includeMainTypes && s(i.includeMainTypes, l) < 0)) {
- var u = {
- mainType: l
- };
- "index" === h && "all" === n || (u[h] = n);
- var c = t.queryComponents(u);
- a[l + "Models"] = c,
- a[l + "Model"] = c[0]
- }
- } else
- a[o] = n
- }),
- a
- }
- function Ho(t, e) {
- var i = t.dimensions;
- e = t.getDimension(e);
- for (var n = 0; n < i.length; n++) {
- var o = t.getDimensionInfo(i[n]);
- if (o.name === e)
- return o.coordDim
- }
- }
- function Fo(t, e) {
- var i = [];
- return Nb(t.dimensions, function(n) {
- var o = t.getDimensionInfo(n);
- o.coordDim === e && (i[o.coordDimIndex] = o.name)
- }),
- i
- }
- function Zo(t, e) {
- var i = [];
- return Nb(t.dimensions, function(n) {
- var o = t.getDimensionInfo(n)
- , a = o.otherDims[e];
- null != a && !1 !== a && (i[a] = o.name)
- }),
- i
- }
- function Uo(t, e) {
- return t && t.hasOwnProperty(e)
- }
- function jo(t) {
- return [t || "", Gb++, Math.random()].join(Wb)
- }
- function Xo(t, e, i, n, o) {
- var a = 0
- , r = 0;
- null == n && (n = 1 / 0),
- null == o && (o = 1 / 0);
- var s = 0;
- e.eachChild(function(l, h) {
- var u, c, d = l.position, f = l.getBoundingRect(), g = e.childAt(h + 1), p = g && g.getBoundingRect();
- if ("horizontal" === t) {
- var m = f.width + (p ? -p.x + f.x : 0);
- (u = a + m) > n || l.newline ? (a = 0,
- u = m,
- r += s + i,
- s = f.height) : s = Math.max(s, f.height)
- } else {
- var v = f.height + (p ? -p.y + f.y : 0);
- (c = r + v) > o || l.newline ? (a += s + i,
- r = 0,
- c = v,
- s = f.width) : s = Math.max(s, f.width)
- }
- l.newline || (d[0] = a,
- d[1] = r,
- "horizontal" === t ? a = u + i : r = c + i)
- })
- }
- function qo(t, e, i) {
- var n = e.width
- , o = e.height
- , a = bi(t.x, n)
- , r = bi(t.y, o)
- , s = bi(t.x2, n)
- , l = bi(t.y2, o);
- return (isNaN(a) || isNaN(parseFloat(t.x))) && (a = 0),
- (isNaN(s) || isNaN(parseFloat(t.x2))) && (s = n),
- (isNaN(r) || isNaN(parseFloat(t.y))) && (r = 0),
- (isNaN(l) || isNaN(parseFloat(t.y2))) && (l = o),
- i = Ux(i || 0),
- {
- width: Math.max(s - a - i[1] - i[3], 0),
- height: Math.max(l - r - i[0] - i[2], 0)
- }
- }
- function Yo(t, e, i) {
- i = Ux(i || 0);
- var n = e.width
- , o = e.height
- , a = bi(t.left, n)
- , r = bi(t.top, o)
- , s = bi(t.right, n)
- , l = bi(t.bottom, o)
- , h = bi(t.width, n)
- , u = bi(t.height, o)
- , c = i[2] + i[0]
- , d = i[1] + i[3]
- , f = t.aspect;
- switch (isNaN(h) && (h = n - s - d - a),
- isNaN(u) && (u = o - l - c - r),
- null != f && (isNaN(h) && isNaN(u) && (f > n / o ? h = .8 * n : u = .8 * o),
- isNaN(h) && (h = f * u),
- isNaN(u) && (u = h / f)),
- isNaN(a) && (a = n - s - h - d),
- isNaN(r) && (r = o - l - u - c),
- t.left || t.right) {
- case "center":
- a = n / 2 - h / 2 - i[3];
- break;
- case "right":
- a = n - h - d
- }
- switch (t.top || t.bottom) {
- case "middle":
- case "center":
- r = o / 2 - u / 2 - i[0];
- break;
- case "bottom":
- r = o - u - c
- }
- a = a || 0,
- r = r || 0,
- isNaN(h) && (h = n - d - a - (s || 0)),
- isNaN(u) && (u = o - c - r - (l || 0));
- var g = new jt(a + i[3],r + i[0],h,u);
- return g.margin = i,
- g
- }
- function $o(t, e, i, n, o) {
- var r = !o || !o.hv || o.hv[0]
- , s = !o || !o.hv || o.hv[1]
- , l = o && o.boundingMode || "all";
- if (r || s) {
- var h;
- if ("raw" === l)
- h = "group" === t.type ? new jt(0,0,+e.width || 0,+e.height || 0) : t.getBoundingRect();
- else if (h = t.getBoundingRect(),
- t.needLocalTransform()) {
- var u = t.getLocalTransform();
- (h = h.clone()).applyTransform(u)
- }
- e = Yo(a({
- width: h.width,
- height: h.height
- }, e), i, n);
- var c = t.position
- , d = r ? e.x - h.x : 0
- , f = s ? e.y - h.y : 0;
- t.attr("position", "raw" === l ? [d, f] : [c[0] + d, c[1] + f])
- }
- }
- function Ko(t, e) {
- return null != t[Zb[e][0]] || null != t[Zb[e][1]] && null != t[Zb[e][2]]
- }
- function Jo(t, e, i) {
- function n(i, n) {
- var r = {}
- , l = 0
- , h = {}
- , u = 0;
- if (Hb(i, function(e) {
- h[e] = t[e]
- }),
- Hb(i, function(t) {
- o(e, t) && (r[t] = h[t] = e[t]),
- a(r, t) && l++,
- a(h, t) && u++
- }),
- s[n])
- return a(e, i[1]) ? h[i[2]] = null : a(e, i[2]) && (h[i[1]] = null),
- h;
- if (2 !== u && l) {
- if (l >= 2)
- return r;
- for (var c = 0; c < i.length; c++) {
- var d = i[c];
- if (!o(r, d) && o(t, d)) {
- r[d] = t[d];
- break
- }
- }
- return r
- }
- return h
- }
- function o(t, e) {
- return t.hasOwnProperty(e)
- }
- function a(t, e) {
- return null != t[e] && "auto" !== t[e]
- }
- function r(t, e, i) {
- Hb(t, function(t) {
- e[t] = i[t]
- })
- }
- !_(i) && (i = {});
- var s = i.ignoreSize;
- !v(s) && (s = [s, s]);
- var l = n(Zb[0], 0)
- , h = n(Zb[1], 1);
- r(Zb[0], t, l),
- r(Zb[1], t, h)
- }
- function Qo(t) {
- return ta({}, t)
- }
- function ta(t, e) {
- return e && t && Hb(Fb, function(i) {
- e.hasOwnProperty(i) && (t[i] = e[i])
- }),
- t
- }
- function ea(t, n) {
- c(n, function(n, o) {
- qb.hasClass(o) || ("object" == typeof n ? t[o] = t[o] ? i(t[o], n, !1) : e(n) : null == t[o] && (t[o] = n))
- })
- }
- function ia(t) {
- t = t,
- this.option = {},
- this.option[ow] = 1,
- this._componentsMap = O({
- series: []
- }),
- this._seriesIndices = null,
- ea(t, this._theme.option),
- i(t, $b, !1),
- this.mergeOption(t)
- }
- function na(t, e) {
- v(e) || (e = e ? [e] : []);
- var i = {};
- return Jb(e, function(e) {
- i[e] = (t.get(e) || []).slice()
- }),
- i
- }
- function oa(t, e, i) {
- return e.type ? e.type : i ? i.subType : qb.determineSubType(t, e)
- }
- function aa(t) {
- return tw(t, function(t) {
- return t.componentIndex
- }) || []
- }
- function ra(t, e) {
- return e.hasOwnProperty("subType") ? Qb(t, function(t) {
- return t.subType === e.subType
- }) : t
- }
- function sa(t) {}
- function la(t) {
- c(rw, function(e) {
- this[e] = p(t[e], t)
- }, this)
- }
- function ha() {
- this._coordinateSystems = []
- }
- function ua(t) {
- this._api = t,
- this._timelineOptions = [],
- this._mediaList = [],
- this._mediaDefault,
- this._currentMediaIndices = [],
- this._optionBackup,
- this._newBaseOption
- }
- function ca(t, e, i) {
- var n, o, a = [], r = [], s = t.timeline;
- if (t.baseOption && (o = t.baseOption),
- (s || t.options) && (o = o || {},
- a = (t.options || []).slice()),
- t.media) {
- o = o || {};
- var l = t.media;
- lw(l, function(t) {
- t && t.option && (t.query ? r.push(t) : n || (n = t))
- })
- }
- return o || (o = t),
- o.timeline || (o.timeline = s),
- lw([o].concat(a).concat(d(r, function(t) {
- return t.option
- })), function(t) {
- lw(e, function(e) {
- e(t, i)
- })
- }),
- {
- baseOption: o,
- timelineOptions: a,
- mediaDefault: n,
- mediaList: r
- }
- }
- function da(t, e, i) {
- var n = {
- width: e,
- height: i,
- aspectratio: e / i
- }
- , o = !0;
- return c(t, function(t, e) {
- var i = e.match(dw);
- if (i && i[1] && i[2]) {
- var a = i[1]
- , r = i[2].toLowerCase();
- fa(n[r], t, a) || (o = !1)
- }
- }),
- o
- }
- function fa(t, e, i) {
- return "min" === i ? t >= e : "max" === i ? t <= e : t === e
- }
- function ga(t, e) {
- return t.join(",") === e.join(",")
- }
- function pa(t, e) {
- lw(e = e || {}, function(e, i) {
- if (null != e) {
- var n = t[i];
- if (qb.hasClass(i)) {
- e = ko(e);
- var o = Eo(n = ko(n), e);
- t[i] = uw(o, function(t) {
- return t.option && t.exist ? cw(t.exist, t.option, !0) : t.exist || t.option
- })
- } else
- t[i] = cw(n, e, !0)
- }
- })
- }
- function ma(t) {
- var e = t && t.itemStyle;
- if (e)
- for (var n = 0, o = pw.length; n < o; n++) {
- var a = pw[n]
- , r = e.normal
- , s = e.emphasis;
- r && r[a] && (t[a] = t[a] || {},
- t[a].normal ? i(t[a].normal, r[a]) : t[a].normal = r[a],
- r[a] = null),
- s && s[a] && (t[a] = t[a] || {},
- t[a].emphasis ? i(t[a].emphasis, s[a]) : t[a].emphasis = s[a],
- s[a] = null)
- }
- }
- function va(t, e) {
- var i = gw(t) && t[e]
- , n = gw(i) && i.textStyle;
- if (n)
- for (var o = 0, a = Rb.length; o < a; o++) {
- var e = Rb[o];
- n.hasOwnProperty(e) && (i[e] = n[e])
- }
- }
- function ya(t) {
- gw(t) && (va(t, "normal"),
- va(t, "emphasis"))
- }
- function xa(t) {
- if (gw(t)) {
- ma(t),
- ya(t.label),
- ya(t.upperLabel),
- ya(t.edgeLabel);
- var e = t.markPoint;
- ma(e),
- ya(e && e.label);
- var i = t.markLine;
- ma(t.markLine),
- ya(i && i.label);
- var n = t.markArea;
- ya(n && n.label),
- va(t, "axisLabel"),
- va(t, "title"),
- va(t, "detail");
- var o = t.data;
- if (o)
- for (r = 0; r < o.length; r++)
- ma(o[r]),
- ya(o[r] && o[r].label);
- if ((e = t.markPoint) && e.data)
- for (var a = e.data, r = 0; r < a.length; r++)
- ma(a[r]),
- ya(a[r] && a[r].label);
- if ((i = t.markLine) && i.data)
- for (var s = i.data, r = 0; r < s.length; r++)
- v(s[r]) ? (ma(s[r][0]),
- ya(s[r][0] && s[r][0].label),
- ma(s[r][1]),
- ya(s[r][1] && s[r][1].label)) : (ma(s[r]),
- ya(s[r] && s[r].label))
- }
- }
- function _a(t) {
- return v(t) ? t : t ? [t] : []
- }
- function ba(t) {
- return (v(t) ? t[0] : t) || {}
- }
- function wa(t, e) {
- e = e.split(",");
- for (var i = t, n = 0; n < e.length && null != (i = i && i[e[n]]); n++)
- ;
- return i
- }
- function Sa(t, e, i, n) {
- e = e.split(",");
- for (var o, a = t, r = 0; r < e.length - 1; r++)
- null == a[o = e[r]] && (a[o] = {}),
- a = a[o];
- (n || null == a[e[r]]) && (a[e[r]] = i)
- }
- function Ma(t) {
- c(vw, function(e) {
- e[0]in t && !(e[1]in t) && (t[e[1]] = t[e[0]])
- })
- }
- function Ia() {
- this.group = new $y,
- this.uid = jo("viewChart")
- }
- function Ta(t, e) {
- if (t && (t.trigger(e),
- "group" === t.type))
- for (var i = 0; i < t.childCount(); i++)
- Ta(t.childAt(i), e)
- }
- function Aa(t, e, i) {
- var n = Go(t, e);
- null != n ? c(ko(n), function(e) {
- Ta(t.getItemGraphicEl(e), i)
- }) : t.eachItemGraphicEl(function(t) {
- Ta(t, i)
- })
- }
- function Ca(t, e, i) {
- function n() {
- u = (new Date).getTime(),
- c = null,
- t.apply(r, s || [])
- }
- var o, a, r, s, l, h = 0, u = 0, c = null;
- e = e || 0;
- var d = function() {
- o = (new Date).getTime(),
- r = this,
- s = arguments;
- var t = l || e
- , d = l || i;
- l = null,
- a = o - (d ? h : u) - t,
- clearTimeout(c),
- d ? c = setTimeout(n, t) : a >= 0 ? n() : c = setTimeout(n, -a),
- h = o
- };
- return d.clear = function() {
- c && (clearTimeout(c),
- c = null)
- }
- ,
- d.debounceNextCall = function(t) {
- l = t
- }
- ,
- d
- }
- function Da(t, e, i, n) {
- var o = t[e];
- if (o) {
- var a = o[Iw] || o
- , r = o[Aw];
- if (o[Tw] !== i || r !== n) {
- if (null == i || !n)
- return t[e] = a;
- (o = t[e] = Ca(a, i, "debounce" === n))[Iw] = a,
- o[Aw] = n,
- o[Tw] = i
- }
- return o
- }
- }
- function La(t, e) {
- var i = t[e];
- i && i[Iw] && (t[e] = i[Iw])
- }
- function ka(t) {
- return function(e, i, n) {
- e = e && e.toLowerCase(),
- my.prototype[t].call(this, e, i, n)
- }
- }
- function Pa() {
- my.call(this)
- }
- function Oa(t, i, n) {
- function o(t, e) {
- return t.prio - e.prio
- }
- n = n || {},
- "string" == typeof i && (i = Yw[i]),
- this.id,
- this.group,
- this._dom = t;
- var a = "canvas"
- , r = this._zr = mi(t, {
- renderer: n.renderer || a,
- devicePixelRatio: n.devicePixelRatio,
- width: n.width,
- height: n.height
- });
- this._throttledZrFlush = Ca(p(r.flush, r), 17),
- (i = e(i)) && _w(i, !0),
- this._theme = i,
- this._chartsViews = [],
- this._chartsMap = {},
- this._componentsViews = [],
- this._componentsMap = {},
- this._coordSysMgr = new ha,
- this._api = Ya(this),
- my.call(this),
- this._messageCenter = new Pa,
- this._initEvents(),
- this.resize = p(this.resize, this),
- this._pendingActions = [],
- te(qw, o),
- te(Uw, o),
- r.animation.on("frame", this._onframe, this),
- L(this)
- }
- function za(t, e, i) {
- var n, o = this._model, a = this._coordSysMgr.getCoordinateSystems();
- e = Wo(o, e);
- for (var r = 0; r < a.length; r++) {
- var s = a[r];
- if (s[t] && null != (n = s[t](o, e, i)))
- return n
- }
- }
- function Na(t, e, i, n, o) {
- function a(n) {
- n && n.__alive && n[e] && n[e](n.__model, r, t._api, i)
- }
- var r = t._model;
- if (n) {
- var s = {};
- s[n + "Id"] = i[n + "Id"],
- s[n + "Index"] = i[n + "Index"],
- s[n + "Name"] = i[n + "Name"];
- var l = {
- mainType: n,
- query: s
- };
- o && (l.subType = o),
- r && r.eachComponent(l, function(e, i) {
- a(t["series" === n ? "_chartsMap" : "_componentsMap"][e.__viewId])
- }, t)
- } else
- Dw(t._componentsViews.concat(t._chartsViews), a)
- }
- function Ea(t, e) {
- var i = t.type
- , n = t.escapeConnect
- , r = Fw[i]
- , s = r.actionInfo
- , l = (s.update || "update").split(":")
- , h = l.pop();
- l = null != l[0] && Lw(l[0]),
- this[Rw] = !0;
- var u = [t]
- , c = !1;
- t.batch && (c = !0,
- u = d(t.batch, function(e) {
- return e = a(o({}, e), t),
- e.batch = null,
- e
- }));
- var f, g = [], p = "highlight" === i || "downplay" === i;
- Dw(u, function(t) {
- f = r.action(t, this._model, this._api),
- (f = f || o({}, t)).type = s.event || f.type,
- g.push(f),
- p ? Na(this, h, t, "series") : l && Na(this, h, t, l.main, l.sub)
- }, this),
- "none" === h || p || l || (this[Vw] ? (Ww.prepareAndUpdate.call(this, t),
- this[Vw] = !1) : Ww[h].call(this, t)),
- f = c ? {
- type: s.event || i,
- escapeConnect: n,
- batch: g
- } : g[0],
- this[Rw] = !1,
- !e && this._messageCenter.trigger(f.type, f)
- }
- function Ra(t) {
- for (var e = this._pendingActions; e.length; ) {
- var i = e.shift();
- Ea.call(this, i, t)
- }
- }
- function Va(t) {
- !t && this.trigger("updated")
- }
- function Ba(t, e, i) {
- var n = this._api;
- Dw(this._componentsViews, function(o) {
- var a = o.__model;
- o[t](a, e, n, i),
- qa(a, o)
- }, this),
- e.eachSeries(function(o, a) {
- var r = this._chartsMap[o.__viewId];
- r[t](o, e, n, i),
- qa(o, r),
- Xa(o, r)
- }, this),
- ja(this._zr, e),
- Dw(Xw, function(t) {
- t(e, n)
- })
- }
- function Ga(t, e) {
- for (var i = "component" === t, n = i ? this._componentsViews : this._chartsViews, o = i ? this._componentsMap : this._chartsMap, a = this._zr, r = 0; r < n.length; r++)
- n[r].__alive = !1;
- e[i ? "eachComponent" : "eachSeries"](function(t, r) {
- if (i) {
- if ("series" === t)
- return
- } else
- r = t;
- var s = "_ec_" + r.id + "_" + r.type
- , l = o[s];
- if (!l) {
- var h = Lw(r.type)
- , u = i ? ww.getClass(h.main, h.sub) : Ia.getClass(h.sub);
- if (!u)
- return;
- (l = new u).init(e, this._api),
- o[s] = l,
- n.push(l),
- a.add(l.group)
- }
- r.__viewId = l.__id = s,
- l.__alive = !0,
- l.__model = r,
- l.group.__ecComponentInfo = {
- mainType: r.mainType,
- index: r.componentIndex
- }
- }, this);
- for (r = 0; r < n.length; ) {
- var s = n[r];
- s.__alive ? r++ : (a.remove(s.group),
- s.dispose(e, this._api),
- n.splice(r, 1),
- delete o[s.__id],
- s.__id = s.group.__ecComponentInfo = null)
- }
- }
- function Wa(t, e) {
- Dw(Uw, function(i) {
- i.func(t, e)
- })
- }
- function Ha(t) {
- var e = {};
- t.eachSeries(function(t) {
- var i = t.get("stack")
- , n = t.getData();
- if (i && "list" === n.type) {
- var o = e[i];
- e.hasOwnProperty(i) && o && (n.stackedOn = o),
- e[i] = n
- }
- })
- }
- function Fa(t, e) {
- var i = this._api;
- Dw(qw, function(n) {
- n.isLayout && n.func(t, i, e)
- })
- }
- function Za(t, e, i) {
- var n = this._api;
- t.clearColorPalette(),
- t.eachSeries(function(t) {
- t.clearColorPalette()
- }),
- Dw(qw, function(o) {
- (!i || !o.isLayout) && o.func(t, n, e)
- })
- }
- function Ua(t, e) {
- var i = this._api;
- Dw(this._componentsViews, function(n) {
- var o = n.__model;
- n.render(o, t, i, e),
- qa(o, n)
- }, this),
- Dw(this._chartsViews, function(t) {
- t.__alive = !1
- }, this),
- t.eachSeries(function(n, o) {
- var a = this._chartsMap[n.__viewId];
- a.__alive = !0,
- a.render(n, t, i, e),
- a.group.silent = !!n.get("silent"),
- qa(n, a),
- Xa(n, a)
- }, this),
- ja(this._zr, t),
- Dw(this._chartsViews, function(e) {
- e.__alive || e.remove(t, i)
- }, this)
- }
- function ja(t, e) {
- var i = t.storage
- , n = 0;
- i.traverse(function(t) {
- t.isGroup || n++
- }),
- n > e.get("hoverLayerThreshold") && !Yv.node && i.traverse(function(t) {
- t.isGroup || (t.useHoverLayer = !0)
- })
- }
- function Xa(t, e) {
- var i = 0;
- e.group.traverse(function(t) {
- "group" === t.type || t.ignore || i++
- });
- var n = +t.get("progressive")
- , o = i > t.get("progressiveThreshold") && n && !Yv.node;
- o && e.group.traverse(function(t) {
- t.isGroup || (t.progressive = o ? Math.floor(i++ / n) : -1,
- o && t.stopAnimation(!0))
- });
- var a = t.get("blendMode") || null;
- e.group.traverse(function(t) {
- t.isGroup || t.setStyle("blend", a)
- })
- }
- function qa(t, e) {
- var i = t.get("z")
- , n = t.get("zlevel");
- e.group.traverse(function(t) {
- "group" !== t.type && (null != i && (t.z = i),
- null != n && (t.zlevel = n))
- })
- }
- function Ya(t) {
- var e = t._coordSysMgr;
- return o(new la(t), {
- getCoordinateSystems: p(e.getCoordinateSystems, e),
- getComponentByElement: function(e) {
- for (; e; ) {
- var i = e.__ecComponentInfo;
- if (null != i)
- return t._model.getComponent(i.mainType, i.index);
- e = e.parent
- }
- }
- })
- }
- function $a(t) {
- function e(t, e) {
- for (var n = 0; n < t.length; n++)
- t[n][i] = e
- }
- var i = "__connectUpdateStatus";
- c(Zw, function(n, o) {
- t._messageCenter.on(o, function(n) {
- if (Jw[t.group] && 0 !== t[i]) {
- if (n && n.escapeConnect)
- return;
- var o = t.makeActionFromEvent(n)
- , a = [];
- c(Kw, function(e) {
- e !== t && e.group === t.group && a.push(e)
- }),
- e(a, 0),
- Dw(a, function(t) {
- 1 !== t[i] && t.dispatchAction(o)
- }),
- e(a, 2)
- }
- })
- })
- }
- function Ka(t) {
- Jw[t] = !1
- }
- function Ja(t) {
- var e;
- return e = t.getAttribute ? t.getAttribute(eS) : t[eS],
- Kw[e]
- }
- function Qa(t) {
- jw.push(t)
- }
- function tr(t, e) {
- "function" == typeof t && (e = t,
- t = Ow),
- Uw.push({
- prio: t,
- func: e
- })
- }
- function er(t, e, i) {
- "function" == typeof e && (i = e,
- e = "");
- var n = _(t) ? t.type : [t, t = {
- event: e
- }][0];
- t.event = (t.event || n).toLowerCase(),
- e = t.event,
- D(Bw.test(n) && Bw.test(e)),
- Fw[n] || (Fw[n] = {
- action: i,
- actionInfo: t
- }),
- Zw[e] = n
- }
- function ir(t, e) {
- ha.register(t, e)
- }
- function nr(t, e) {
- "function" == typeof t && (e = t,
- t = zw),
- qw.push({
- prio: t,
- func: e,
- isLayout: !0
- })
- }
- function or(t, e) {
- "function" == typeof t && (e = t,
- t = Nw),
- qw.push({
- prio: t,
- func: e
- })
- }
- function ar(t, e) {
- $w[t] = e
- }
- function rr(t) {
- return qb.extend(t)
- }
- function sr(t) {
- return ww.extend(t)
- }
- function lr(t) {
- return bw.extend(t)
- }
- function hr(t) {
- return Ia.extend(t)
- }
- function ur(t) {
- return t
- }
- function cr(t, e, i, n, o) {
- this._old = t,
- this._new = e,
- this._oldKeyGetter = i || ur,
- this._newKeyGetter = n || ur,
- this.context = o
- }
- function dr(t, e, i, n, o) {
- for (var a = 0; a < t.length; a++) {
- var r = "_ec_" + o[n](t[a], a)
- , s = e[r];
- null == s ? (i.push(r),
- e[r] = a) : (s.length || (e[r] = s = [s]),
- s.push(a))
- }
- }
- function fr(t, e) {
- c(sS.concat(e.__wrappedMethods || []), function(i) {
- e.hasOwnProperty(i) && (t[i] = e[i])
- }),
- t.__wrappedMethods = e.__wrappedMethods
- }
- function gr(t) {
- this._array = t || []
- }
- function pr(t) {
- return v(t) || (t = [t]),
- t
- }
- function mr(t, e) {
- var i = t.dimensions
- , n = new lS(d(i, t.getDimensionInfo, t),t.hostModel);
- fr(n, t);
- for (var o = n._storage = {}, a = t._storage, r = 0; r < i.length; r++) {
- var l = i[r]
- , h = a[l];
- s(e, l) >= 0 ? o[l] = new h.constructor(a[l].length) : o[l] = a[l]
- }
- return n
- }
- function vr(t, i, n) {
- function o(t, e, i) {
- gS[e] ? t.otherDims[e] = i : (t.coordDim = e,
- t.coordDimIndex = i,
- h.set(e, !0))
- }
- function a(t, e, i) {
- if (i || null != e.get(t)) {
- for (var n = 0; null != e.get(t + n); )
- n++;
- t += n
- }
- return e.set(t, !0),
- t
- }
- i = i || [],
- n = n || {},
- t = (t || []).slice();
- var r = (n.dimsDef || []).slice()
- , s = O(n.encodeDef)
- , l = O()
- , h = O()
- , u = []
- , c = n.dimCount;
- if (null == c) {
- var d = yr(i[0]);
- c = Math.max(v(d) && d.length || 1, t.length, r.length),
- cS(t, function(t) {
- var e = t.dimsDef;
- e && (c = Math.max(c, e.length))
- })
- }
- for (var f = 0; f < c; f++) {
- var g = dS(r[f]) ? {
- name: r[f]
- } : r[f] || {}
- , p = g.name
- , m = u[f] = {
- otherDims: {}
- };
- null != p && null == l.get(p) && (m.name = m.tooltipName = p,
- l.set(p, f)),
- null != g.type && (m.type = g.type)
- }
- s.each(function(t, e) {
- t = s.set(e, ko(t).slice()),
- cS(t, function(i, n) {
- dS(i) && (i = l.get(i)),
- null != i && i < c && (t[n] = i,
- o(u[i], e, n))
- })
- });
- var y = 0;
- cS(t, function(t, i) {
- var n, t, a, r;
- dS(t) ? (n = t,
- t = {}) : (n = t.name,
- t = e(t),
- a = t.dimsDef,
- r = t.otherDims,
- t.name = t.coordDim = t.coordDimIndex = t.dimsDef = t.otherDims = null);
- var l = ko(s.get(n));
- if (!l.length)
- for (var h = 0; h < (a && a.length || 1); h++) {
- for (; y < u.length && null != u[y].coordDim; )
- y++;
- y < u.length && l.push(y++)
- }
- cS(l, function(e, i) {
- var s = u[e];
- o(fS(s, t), n, i),
- null == s.name && a && (s.name = s.tooltipName = a[i]),
- r && fS(s.otherDims, r)
- })
- });
- for (var x = n.extraPrefix || "value", _ = 0; _ < c; _++)
- null == (m = u[_] = u[_] || {}).coordDim && (m.coordDim = a(x, h, n.extraFromZero),
- m.coordDimIndex = 0,
- m.isExtraCoord = !0),
- null == m.name && (m.name = a(m.coordDim, l)),
- null == m.type && pS(i, _) && (m.type = "ordinal");
- return u
- }
- function yr(t) {
- return v(t) ? t : _(t) ? t.value : t
- }
- function xr(t) {
- for (var e = 0; e < t.length && null == t[e]; )
- e++;
- return t[e]
- }
- function _r(t) {
- var e = xr(t);
- return null != e && !v(Oo(e))
- }
- function br(t, e, i) {
- t = t || [];
- var n = e.get("coordinateSystem")
- , o = mS[n]
- , a = ha.get(n)
- , r = {
- encodeDef: e.get("encode"),
- dimsDef: e.get("dimensions")
- }
- , l = o && o(t, e, i, r)
- , h = l && l.dimensions;
- h || (h = a && (a.getDimensionsInfo ? a.getDimensionsInfo() : a.dimensions.slice()) || ["x", "y"],
- h = vr(h, t, r));
- var u = l ? l.categoryIndex : -1
- , c = new lS(h,e)
- , d = Mr(l, t)
- , f = {}
- , g = u >= 0 && _r(t) ? function(t, e, i, n) {
- return zo(t) && (c.hasItemOption = !0),
- n === u ? i : No(Oo(t), h[n])
- }
- : function(t, e, i, n) {
- var o = Oo(t)
- , a = No(o && o[n], h[n]);
- zo(t) && (c.hasItemOption = !0);
- var r = l && l.categoryAxesModels;
- return r && r[e] && "string" == typeof a && (f[e] = f[e] || r[e].getCategories(),
- (a = s(f[e], a)) < 0 && !isNaN(a) && (a = +a)),
- a
- }
- ;
- return c.hasItemOption = !1,
- c.initData(t, d, g),
- c
- }
- function wr(t) {
- return "category" !== t && "time" !== t
- }
- function Sr(t) {
- return "category" === t ? "ordinal" : "time" === t ? "time" : "float"
- }
- function Mr(t, e) {
- var i, n = [], o = t && t.dimensions[t.categoryIndex];
- if (o && (i = t.categoryAxesModels[o.name]),
- i) {
- var a = i.getCategories();
- if (a) {
- var r = e.length;
- if (v(e[0]) && e[0].length > 1) {
- n = [];
- for (var s = 0; s < r; s++)
- n[s] = a[e[s][t.categoryIndex || 0]]
- } else
- n = a.slice(0)
- }
- }
- return n
- }
- function Ir(t) {
- this._setting = t || {},
- this._extent = [1 / 0, -1 / 0],
- this._interval = 0,
- this.init && this.init.apply(this, arguments)
- }
- function Tr(t, e, i, n) {
- var o = {}
- , a = t[1] - t[0]
- , r = o.interval = Oi(a / e, !0);
- null != i && r < i && (r = o.interval = i),
- null != n && r > n && (r = o.interval = n);
- var s = o.intervalPrecision = Ar(r);
- return Dr(o.niceTickExtent = [_S(Math.ceil(t[0] / r) * r, s), _S(Math.floor(t[1] / r) * r, s)], t),
- o
- }
- function Ar(t) {
- return Ii(t) + 2
- }
- function Cr(t, e, i) {
- t[e] = Math.max(Math.min(t[e], i[1]), i[0])
- }
- function Dr(t, e) {
- !isFinite(t[0]) && (t[0] = e[0]),
- !isFinite(t[1]) && (t[1] = e[1]),
- Cr(t, 0, e),
- Cr(t, 1, e),
- t[0] > t[1] && (t[0] = t[1])
- }
- function Lr(t, e, i, n) {
- var o = [];
- if (!t)
- return o;
- e[0] < i[0] && o.push(e[0]);
- for (var a = i[0]; a <= i[1] && (o.push(a),
- (a = _S(a + t, n)) !== o[o.length - 1]); )
- if (o.length > 1e4)
- return [];
- return e[1] > (o.length ? o[o.length - 1] : i[1]) && o.push(e[1]),
- o
- }
- function kr(t, e) {
- return PS(t, kS(e))
- }
- function Pr(t, e) {
- var i, n, o, a = t.type, r = e.getMin(), s = e.getMax(), l = null != r, h = null != s, u = t.getExtent();
- return "ordinal" === a ? i = (e.get("data") || []).length : (v(n = e.get("boundaryGap")) || (n = [n || 0, n || 0]),
- "boolean" == typeof n[0] && (n = [0, 0]),
- n[0] = bi(n[0], 1),
- n[1] = bi(n[1], 1),
- o = u[1] - u[0] || Math.abs(u[0])),
- null == r && (r = "ordinal" === a ? i ? 0 : NaN : u[0] - n[0] * o),
- null == s && (s = "ordinal" === a ? i ? i - 1 : NaN : u[1] + n[1] * o),
- "dataMin" === r ? r = u[0] : "function" == typeof r && (r = r({
- min: u[0],
- max: u[1]
- })),
- "dataMax" === s ? s = u[1] : "function" == typeof s && (s = s({
- min: u[0],
- max: u[1]
- })),
- (null == r || !isFinite(r)) && (r = NaN),
- (null == s || !isFinite(s)) && (s = NaN),
- t.setBlank(S(r) || S(s)),
- e.getNeedCrossZero() && (r > 0 && s > 0 && !l && (r = 0),
- r < 0 && s < 0 && !h && (s = 0)),
- [r, s]
- }
- function Or(t, e) {
- var i = Pr(t, e)
- , n = null != e.getMin()
- , o = null != e.getMax()
- , a = e.get("splitNumber");
- "log" === t.type && (t.base = e.get("logBase"));
- var r = t.type;
- t.setExtent(i[0], i[1]),
- t.niceExtent({
- splitNumber: a,
- fixMin: n,
- fixMax: o,
- minInterval: "interval" === r || "time" === r ? e.get("minInterval") : null,
- maxInterval: "interval" === r || "time" === r ? e.get("maxInterval") : null
- });
- var s = e.get("interval");
- null != s && t.setInterval && t.setInterval(s)
- }
- function zr(t, e) {
- if (e = e || t.get("type"))
- switch (e) {
- case "category":
- return new xS(t.getCategories(),[1 / 0, -1 / 0]);
- case "value":
- return new wS;
- default:
- return (Ir.getClass(e) || wS).create(t)
- }
- }
- function Nr(t, e, i, n, o) {
- var a, r = 0, s = 0, l = (n - o) / 180 * Math.PI, h = 1;
- e.length > 40 && (h = Math.floor(e.length / 40));
- for (var u = 0; u < t.length; u += h) {
- var c = t[u]
- , d = ce(e[u], i, "center", "top");
- d.x += c * Math.cos(l),
- d.y += c * Math.sin(l),
- d.width *= 1.3,
- d.height *= 1.3,
- a ? a.intersect(d) ? (s++,
- r = Math.max(r, s)) : (a.union(d),
- s = 0) : a = d.clone()
- }
- return 0 === r && h > 1 ? h : (r + 1) * h - 1
- }
- function Er(t, e) {
- var i = t.scale
- , n = i.getTicksLabels()
- , o = i.getTicks();
- return "string" == typeof e ? (e = function(t) {
- return function(e) {
- return t.replace("{value}", null != e ? e : "")
- }
- }(e),
- d(n, e)) : "function" == typeof e ? d(o, function(i, n) {
- return e(Rr(t, i), n)
- }, this) : n
- }
- function Rr(t, e) {
- return "category" === t.type ? t.scale.getLabel(e) : e
- }
- function Vr(t) {
- return _(t) && null != t.value ? t.value : t + ""
- }
- function Br(t, e) {
- if ("image" !== this.type) {
- var i = this.style
- , n = this.shape;
- n && "line" === n.symbolType ? i.stroke = t : this.__isEmptyBrush ? (i.stroke = t,
- i.fill = e || "#fff") : (i.fill && (i.fill = t),
- i.stroke && (i.stroke = t)),
- this.dirty(!1)
- }
- }
- function Gr(t, e, i, n, o, a, r) {
- var s = 0 === t.indexOf("empty");
- s && (t = t.substr(5, 1).toLowerCase() + t.substr(6));
- var l;
- return l = 0 === t.indexOf("image://") ? Zn(t.slice(8), new jt(e,i,n,o), r ? "center" : "cover") : 0 === t.indexOf("path://") ? Fn(t.slice(7), {}, new jt(e,i,n,o), r ? "center" : "cover") : new US({
- shape: {
- symbolType: t,
- x: e,
- y: i,
- width: n,
- height: o
- }
- }),
- l.__isEmptyBrush = s,
- l.setColor = Br,
- l.setColor(a),
- l
- }
- function Wr(t, e) {
- var i = (t[1] - t[0]) / e / 2;
- t[0] += i,
- t[1] -= i
- }
- function Hr(t) {
- return t ? d(Xr(t, "attribute"), function(t) {
- return {
- id: Ur(t, "id"),
- title: Ur(t, "title"),
- type: Ur(t, "type")
- }
- }) : []
- }
- function Fr(t, e) {
- return t ? d(Xr(t, "node"), function(t) {
- var i = {
- id: Ur(t, "id"),
- name: Ur(t, "label"),
- itemStyle: {
- normal: {}
- }
- }
- , n = jr(t, "viz:size")
- , o = jr(t, "viz:position")
- , a = jr(t, "viz:color")
- , r = jr(t, "attvalues");
- if (n && (i.symbolSize = parseFloat(Ur(n, "value"))),
- o && (i.x = parseFloat(Ur(o, "x")),
- i.y = parseFloat(Ur(o, "y"))),
- a && (i.itemStyle.normal.color = "rgb(" + [0 | Ur(a, "r"), 0 | Ur(a, "g"), 0 | Ur(a, "b")].join(",") + ")"),
- r) {
- var s = Xr(r, "attvalue");
- i.attributes = {};
- for (var l = 0; l < s.length; l++) {
- var h = s[l]
- , u = Ur(h, "for")
- , c = Ur(h, "value")
- , d = e[u];
- if (d) {
- switch (d.type) {
- case "integer":
- case "long":
- c = parseInt(c, 10);
- break;
- case "float":
- case "double":
- c = parseFloat(c);
- break;
- case "boolean":
- c = "true" == c.toLowerCase()
- }
- i.attributes[u] = c
- }
- }
- }
- return i
- }) : []
- }
- function Zr(t) {
- return t ? d(Xr(t, "edge"), function(t) {
- var e = {
- id: Ur(t, "id"),
- name: Ur(t, "label"),
- source: Ur(t, "source"),
- target: Ur(t, "target"),
- lineStyle: {
- normal: {}
- }
- }
- , i = e.lineStyle.normal
- , n = jr(t, "viz:thickness")
- , o = jr(t, "viz:color");
- return n && (i.width = parseFloat(n.getAttribute("value"))),
- o && (i.color = "rgb(" + [0 | Ur(o, "r"), 0 | Ur(o, "g"), 0 | Ur(o, "b")].join(",") + ")"),
- e
- }) : []
- }
- function Ur(t, e) {
- return t.getAttribute(e)
- }
- function jr(t, e) {
- for (var i = t.firstChild; i; ) {
- if (1 == i.nodeType && i.nodeName.toLowerCase() == e.toLowerCase())
- return i;
- i = i.nextSibling
- }
- return null
- }
- function Xr(t, e) {
- for (var i = t.firstChild, n = []; i; )
- i.nodeName.toLowerCase() == e.toLowerCase() && n.push(i),
- i = i.nextSibling;
- return n
- }
- function qr(t) {
- var e, i = Zo(t, "label");
- if (i.length)
- e = i[0];
- else
- for (var n, o = t.dimensions.slice(); o.length && (e = o.pop(),
- "ordinal" === (n = t.getDimensionInfo(e).type) || "time" === n); )
- ;
- return e
- }
- function Yr(t, e) {
- var i = t.getItemVisual(e, "symbolSize");
- return i instanceof Array ? i.slice() : [+i, +i]
- }
- function $r(t) {
- return [t[0] / 2, t[1] / 2]
- }
- function Kr(t, e, i) {
- $y.call(this),
- this.updateData(t, e, i)
- }
- function Jr(t, e) {
- this.parent.drift(t, e)
- }
- function Qr(t) {
- this.group = new $y,
- this._symbolCtor = t || Kr
- }
- function ts(t, e, i) {
- var n = t.getItemLayout(e);
- return n && !isNaN(n[0]) && !isNaN(n[1]) && !(i && i(e)) && "none" !== t.getItemVisual(e, "symbol")
- }
- function es(t) {
- return t >= 0 ? 1 : -1
- }
- function is(t, e, i) {
- for (var n, o = t.getBaseAxis(), a = t.getOtherAxis(o), r = o.onZero ? 0 : a.scale.getExtent()[0], s = a.dim, l = "x" === s || "radius" === s ? 1 : 0, h = e.stackedOn, u = e.get(s, i); h && es(h.get(s, i)) === es(u); ) {
- n = h;
- break
- }
- var c = [];
- return c[l] = e.get(o.dim, i),
- c[1 - l] = n ? n.get(s, i, !0) : r,
- t.dataToPoint(c)
- }
- function ns(t, e) {
- var i = [];
- return e.diff(t).add(function(t) {
- i.push({
- cmd: "+",
- idx: t
- })
- }).update(function(t, e) {
- i.push({
- cmd: "=",
- idx: e,
- idx1: t
- })
- }).remove(function(t) {
- i.push({
- cmd: "-",
- idx: t
- })
- }).execute(),
- i
- }
- function os(t) {
- return isNaN(t[0]) || isNaN(t[1])
- }
- function as(t, e, i, n, o, a, r, s, l, h, u) {
- for (var c = 0, d = i, f = 0; f < n; f++) {
- var g = e[d];
- if (d >= o || d < 0)
- break;
- if (os(g)) {
- if (u) {
- d += a;
- continue
- }
- break
- }
- if (d === i)
- t[a > 0 ? "moveTo" : "lineTo"](g[0], g[1]),
- uM(dM, g);
- else if (l > 0) {
- var p = d + a
- , m = e[p];
- if (u)
- for (; m && os(e[p]); )
- m = e[p += a];
- var v = .5
- , y = e[c];
- if (!(m = e[p]) || os(m))
- uM(fM, g);
- else {
- os(m) && !u && (m = g),
- W(cM, m, y);
- var x, _;
- if ("x" === h || "y" === h) {
- var b = "x" === h ? 0 : 1;
- x = Math.abs(g[b] - y[b]),
- _ = Math.abs(g[b] - m[b])
- } else
- x = dy(g, y),
- _ = dy(g, m);
- hM(fM, g, cM, -l * (1 - (v = _ / (_ + x))))
- }
- sM(dM, dM, s),
- lM(dM, dM, r),
- sM(fM, fM, s),
- lM(fM, fM, r),
- t.bezierCurveTo(dM[0], dM[1], fM[0], fM[1], g[0], g[1]),
- hM(dM, g, cM, l * v)
- } else
- t.lineTo(g[0], g[1]);
- c = d,
- d += a
- }
- return f
- }
- function rs(t, e) {
- var i = [1 / 0, 1 / 0]
- , n = [-1 / 0, -1 / 0];
- if (e)
- for (var o = 0; o < t.length; o++) {
- var a = t[o];
- a[0] < i[0] && (i[0] = a[0]),
- a[1] < i[1] && (i[1] = a[1]),
- a[0] > n[0] && (n[0] = a[0]),
- a[1] > n[1] && (n[1] = a[1])
- }
- return {
- min: e ? i : n,
- max: e ? n : i
- }
- }
- function ss(t, e) {
- if (t.length === e.length) {
- for (var i = 0; i < t.length; i++) {
- var n = t[i]
- , o = e[i];
- if (n[0] !== o[0] || n[1] !== o[1])
- return
- }
- return !0
- }
- }
- function ls(t) {
- return "number" == typeof t ? t : t ? .3 : 0
- }
- function hs(t) {
- var e = t.getGlobalExtent();
- if (t.onBand) {
- var i = t.getBandWidth() / 2 - 1
- , n = e[1] > e[0] ? 1 : -1;
- e[0] += n * i,
- e[1] -= n * i
- }
- return e
- }
- function us(t) {
- return t >= 0 ? 1 : -1
- }
- function cs(t, e) {
- var i = t.getBaseAxis()
- , n = t.getOtherAxis(i)
- , o = 0;
- if (!i.onZero) {
- var a = n.scale.getExtent();
- a[0] > 0 ? o = a[0] : a[1] < 0 && (o = a[1])
- }
- var r = n.dim
- , s = "x" === r || "radius" === r ? 1 : 0;
- return e.mapArray([r], function(n, a) {
- for (var l, h = e.stackedOn; h && us(h.get(r, a)) === us(n); ) {
- l = h;
- break
- }
- var u = [];
- return u[s] = e.get(i.dim, a),
- u[1 - s] = l ? l.get(r, a, !0) : o,
- t.dataToPoint(u)
- }, !0)
- }
- function ds(t, e, i) {
- var n = hs(t.getAxis("x"))
- , o = hs(t.getAxis("y"))
- , a = t.getBaseAxis().isHorizontal()
- , r = Math.min(n[0], n[1])
- , s = Math.min(o[0], o[1])
- , l = Math.max(n[0], n[1]) - r
- , h = Math.max(o[0], o[1]) - s
- , u = i.get("lineStyle.normal.width") || 2
- , c = i.get("clipOverflow") ? u / 2 : Math.max(l, h);
- a ? (s -= c,
- h += 2 * c) : (r -= c,
- l += 2 * c);
- var d = new pb({
- shape: {
- x: r,
- y: s,
- width: l,
- height: h
- }
- });
- return e && (d.shape[a ? "width" : "height"] = 0,
- bo(d, {
- shape: {
- width: l,
- height: h
- }
- }, i)),
- d
- }
- function fs(t, e, i) {
- var n = t.getAngleAxis()
- , o = t.getRadiusAxis().getExtent()
- , a = n.getExtent()
- , r = Math.PI / 180
- , s = new hb({
- shape: {
- cx: t.cx,
- cy: t.cy,
- r0: o[0],
- r: o[1],
- startAngle: -a[0] * r,
- endAngle: -a[1] * r,
- clockwise: n.inverse
- }
- });
- return e && (s.shape.endAngle = -a[0] * r,
- bo(s, {
- shape: {
- endAngle: -a[1] * r
- }
- }, i)),
- s
- }
- function gs(t, e, i) {
- return "polar" === t.type ? fs(t, e, i) : ds(t, e, i)
- }
- function ps(t, e, i) {
- for (var n = e.getBaseAxis(), o = "x" === n.dim || "radius" === n.dim ? 0 : 1, a = [], r = 0; r < t.length - 1; r++) {
- var s = t[r + 1]
- , l = t[r];
- a.push(l);
- var h = [];
- switch (i) {
- case "end":
- h[o] = s[o],
- h[1 - o] = l[1 - o],
- a.push(h);
- break;
- case "middle":
- var u = (l[o] + s[o]) / 2
- , c = [];
- h[o] = c[o] = u,
- h[1 - o] = l[1 - o],
- c[1 - o] = s[1 - o],
- a.push(h),
- a.push(c);
- break;
- default:
- h[o] = l[o],
- h[1 - o] = s[1 - o],
- a.push(h)
- }
- }
- return t[r] && a.push(t[r]),
- a
- }
- function ms(t, e) {
- var i = t.getVisual("visualMeta");
- if (i && i.length && t.count()) {
- for (var n, o = i.length - 1; o >= 0; o--)
- if (i[o].dimension < 2) {
- n = i[o];
- break
- }
- if (n && "cartesian2d" === e.type) {
- var a = n.dimension
- , r = t.dimensions[a]
- , s = e.getAxis(r)
- , l = d(n.stops, function(t) {
- return {
- coord: s.toGlobalCoord(s.dataToCoord(t.value)),
- color: t.color
- }
- })
- , h = l.length
- , u = n.outerColors.slice();
- h && l[0].coord > l[h - 1].coord && (l.reverse(),
- u.reverse());
- var f = l[0].coord - 10
- , g = l[h - 1].coord + 10
- , p = g - f;
- if (p < .001)
- return "transparent";
- c(l, function(t) {
- t.offset = (t.coord - f) / p
- }),
- l.push({
- offset: h ? l[h - 1].offset : .5,
- color: u[1] || "transparent"
- }),
- l.unshift({
- offset: h ? l[0].offset : .5,
- color: u[0] || "transparent"
- });
- var m = new wb(0,0,0,0,l,!0);
- return m[r] = f,
- m[r + "2"] = g,
- m
- }
- }
- }
- function vs(t) {
- return this._axes[t]
- }
- function ys(t) {
- _M.call(this, t)
- }
- function xs(t, e) {
- return e.type || (e.data ? "category" : "value")
- }
- function _s(t, e, i) {
- return t.getCoordSysModel() === e
- }
- function bs(t, e) {
- var i = e * Math.PI / 180
- , n = t.plain()
- , o = n.width
- , a = n.height
- , r = o * Math.cos(i) + a * Math.sin(i)
- , s = o * Math.sin(i) + a * Math.cos(i);
- return new jt(n.x,n.y,r,s)
- }
- function ws(t) {
- var e, i = t.model, n = i.getFormattedLabels(), o = i.getModel("axisLabel"), a = 1, r = n.length;
- r > 40 && (a = Math.ceil(r / 40));
- for (var s = 0; s < r; s += a)
- if (!t.isLabelIgnored(s)) {
- var l = bs(o.getTextRect(n[s]), o.get("rotate") || 0);
- e ? e.union(l) : e = l
- }
- return e
- }
- function Ss(t, e, i) {
- this._coordsMap = {},
- this._coordsList = [],
- this._axesMap = {},
- this._axesList = [],
- this._initCartesian(t, e, i),
- this.model = t
- }
- function Ms(t, e, i) {
- var n = t[e];
- if (i.onZero) {
- var o = i.onZeroAxisIndex;
- if (null == o) {
- for (var a in n)
- if (n.hasOwnProperty(a)) {
- var r = n[a];
- if (r && !Is(r)) {
- o = +a;
- break
- }
- }
- null == o && (i.onZero = !1),
- i.onZeroAxisIndex = o
- } else
- (r = n[o]) && Is(r) && (i.onZero = !1)
- }
- }
- function Is(t) {
- return "category" === t.type || "time" === t.type || !DM(t)
- }
- function Ts(t, e) {
- var i = t.getExtent()
- , n = i[0] + i[1];
- t.toGlobalCoord = "x" === t.dim ? function(t) {
- return t + e
- }
- : function(t) {
- return n - t + e
- }
- ,
- t.toLocalCoord = "x" === t.dim ? function(t) {
- return t - e
- }
- : function(t) {
- return n - t + e
- }
- }
- function As(t, e) {
- return d(PM, function(e) {
- var i = t.getReferringComponents(e)[0];
- return i
- })
- }
- function Cs(t) {
- return "cartesian2d" === t.get("coordinateSystem")
- }
- function Ds(t) {
- var e = {
- componentType: t.mainType
- };
- return e[t.mainType + "Index"] = t.componentIndex,
- e
- }
- function Ls(t, e, i, n) {
- var o, a, r = Ci(i - t.rotation), s = n[0] > n[1], l = "start" === e && !s || "start" !== e && s;
- return Di(r - OM / 2) ? (a = l ? "bottom" : "top",
- o = "center") : Di(r - 1.5 * OM) ? (a = l ? "top" : "bottom",
- o = "center") : (a = "middle",
- o = r < 1.5 * OM && r > OM / 2 ? l ? "left" : "right" : l ? "right" : "left"),
- {
- rotation: r,
- textAlign: o,
- textVerticalAlign: a
- }
- }
- function ks(t) {
- var e = t.get("tooltip");
- return t.get("silent") || !(t.get("triggerEvent") || e && e.show)
- }
- function Ps(t, e, i) {
- var n = t.get("axisLabel.showMinLabel")
- , o = t.get("axisLabel.showMaxLabel");
- e = e || [],
- i = i || [];
- var a = e[0]
- , r = e[1]
- , s = e[e.length - 1]
- , l = e[e.length - 2]
- , h = i[0]
- , u = i[1]
- , c = i[i.length - 1]
- , d = i[i.length - 2];
- !1 === n ? (Os(a),
- Os(h)) : zs(a, r) && (n ? (Os(r),
- Os(u)) : (Os(a),
- Os(h))),
- !1 === o ? (Os(s),
- Os(c)) : zs(l, s) && (o ? (Os(l),
- Os(d)) : (Os(s),
- Os(c)))
- }
- function Os(t) {
- t && (t.ignore = !0)
- }
- function zs(t, e, i) {
- var n = t && t.getBoundingRect().clone()
- , o = e && e.getBoundingRect().clone();
- if (n && o) {
- var a = ot([]);
- return lt(a, a, -t.rotation),
- n.applyTransform(rt([], a, t.getLocalTransform())),
- o.applyTransform(rt([], a, e.getLocalTransform())),
- n.intersect(o)
- }
- }
- function Ns(t) {
- return "middle" === t || "center" === t
- }
- function Es(t, e, i) {
- var n = e.axis;
- if (e.get("axisTick.show") && !n.scale.isBlank()) {
- for (var o = e.getModel("axisTick"), r = o.getModel("lineStyle"), s = o.get("length"), l = VM(o, i.labelInterval), h = n.getTicksCoords(o.get("alignWithLabel")), u = n.scale.getTicks(), c = e.get("axisLabel.showMinLabel"), d = e.get("axisLabel.showMaxLabel"), f = [], g = [], p = t._transform, m = [], v = h.length, y = 0; y < v; y++)
- if (!RM(n, y, l, v, c, d)) {
- var x = h[y];
- f[0] = x,
- f[1] = 0,
- g[0] = x,
- g[1] = i.tickDirection * s,
- p && (Y(f, f, p),
- Y(g, g, p));
- var _ = new mb(Xn({
- anid: "tick_" + u[y],
- shape: {
- x1: f[0],
- y1: f[1],
- x2: g[0],
- y2: g[1]
- },
- style: a(r.getLineStyle(), {
- stroke: e.get("axisLine.lineStyle.color")
- }),
- z2: 2,
- silent: !0
- }));
- t.group.add(_),
- m.push(_)
- }
- return m
- }
- }
- function Rs(t, e, i) {
- var n = e.axis;
- if (M(i.axisLabelShow, e.get("axisLabel.show")) && !n.scale.isBlank()) {
- var o = e.getModel("axisLabel")
- , a = o.get("margin")
- , r = n.scale.getTicks()
- , s = e.getFormattedLabels()
- , l = (M(i.labelRotate, o.get("rotate")) || 0) * OM / 180
- , h = EM(i.rotation, l, i.labelDirection)
- , u = e.get("data")
- , d = []
- , f = ks(e)
- , g = e.get("triggerEvent")
- , p = e.get("axisLabel.showMinLabel")
- , m = e.get("axisLabel.showMaxLabel");
- return c(r, function(l, c) {
- if (!RM(n, c, i.labelInterval, r.length, p, m)) {
- var v = o;
- u && u[l] && u[l].textStyle && (v = new Co(u[l].textStyle,o,e.ecModel));
- var y = v.getTextColor() || e.get("axisLine.lineStyle.color")
- , x = [n.dataToCoord(l), i.labelOffset + i.labelDirection * a]
- , _ = n.scale.getLabel(l)
- , b = new ab({
- anid: "label_" + l,
- position: x,
- rotation: h.rotation,
- silent: f,
- z2: 10
- });
- uo(b.style, v, {
- text: s[c],
- textAlign: v.getShallow("align", !0) || h.textAlign,
- textVerticalAlign: v.getShallow("verticalAlign", !0) || v.getShallow("baseline", !0) || h.textVerticalAlign,
- textFill: "function" == typeof y ? y("category" === n.type ? _ : "value" === n.type ? l + "" : l, c) : y
- }),
- g && (b.eventData = Ds(e),
- b.eventData.targetType = "axisLabel",
- b.eventData.value = _),
- t._dumbGroup.add(b),
- b.updateTransform(),
- d.push(b),
- t.group.add(b),
- b.decomposeTransform()
- }
- }),
- d
- }
- }
- function Vs(t, e) {
- var i = {
- axesInfo: {},
- seriesInvolved: !1,
- coordSysAxesInfo: {},
- coordSysMap: {}
- };
- return Bs(i, t, e),
- i.seriesInvolved && Ws(i, t),
- i
- }
- function Bs(t, e, i) {
- var n = e.getComponent("tooltip")
- , o = e.getComponent("axisPointer")
- , a = o.get("link", !0) || []
- , r = [];
- BM(i.getCoordinateSystems(), function(i) {
- function s(n, s, l) {
- var c = l.model.getModel("axisPointer", o)
- , d = c.get("show");
- if (d && ("auto" !== d || n || Xs(c))) {
- null == s && (s = c.get("triggerTooltip"));
- var f = (c = n ? Gs(l, u, o, e, n, s) : c).get("snap")
- , g = qs(l.model)
- , p = s || f || "category" === l.type
- , m = t.axesInfo[g] = {
- key: g,
- axis: l,
- coordSys: i,
- axisPointerModel: c,
- triggerTooltip: s,
- involveSeries: p,
- snap: f,
- useHandle: Xs(c),
- seriesModels: []
- };
- h[g] = m,
- t.seriesInvolved |= p;
- var v = Hs(a, l);
- if (null != v) {
- var y = r[v] || (r[v] = {
- axesInfo: {}
- });
- y.axesInfo[g] = m,
- y.mapper = a[v].mapper,
- m.linkGroup = y
- }
- }
- }
- if (i.axisPointerEnabled) {
- var l = qs(i.model)
- , h = t.coordSysAxesInfo[l] = {};
- t.coordSysMap[l] = i;
- var u = i.model.getModel("tooltip", n);
- if (BM(i.getAxes(), GM(s, !1, null)),
- i.getTooltipAxes && n && u.get("show")) {
- var c = "axis" === u.get("trigger")
- , d = "cross" === u.get("axisPointer.type")
- , f = i.getTooltipAxes(u.get("axisPointer.axis"));
- (c || d) && BM(f.baseAxes, GM(s, !d || "cross", c)),
- d && BM(f.otherAxes, GM(s, "cross", !1))
- }
- }
- })
- }
- function Gs(t, i, n, o, r, s) {
- var l = i.getModel("axisPointer")
- , h = {};
- BM(["type", "snap", "lineStyle", "shadowStyle", "label", "animation", "animationDurationUpdate", "animationEasingUpdate", "z"], function(t) {
- h[t] = e(l.get(t))
- }),
- h.snap = "category" !== t.type && !!s,
- "cross" === l.get("type") && (h.type = "line");
- var u = h.label || (h.label = {});
- if (null == u.show && (u.show = !1),
- "cross" === r && (u.show = !0,
- !s)) {
- var c = h.lineStyle = l.get("crossStyle");
- c && a(u, c.textStyle)
- }
- return t.model.getModel("axisPointer", new Co(h,n,o))
- }
- function Ws(t, e) {
- e.eachSeries(function(e) {
- var i = e.coordinateSystem
- , n = e.get("tooltip.trigger", !0)
- , o = e.get("tooltip.show", !0);
- i && "none" !== n && !1 !== n && "item" !== n && !1 !== o && !1 !== e.get("axisPointer.show", !0) && BM(t.coordSysAxesInfo[qs(i.model)], function(t) {
- var n = t.axis;
- i.getAxis(n.dim) === n && (t.seriesModels.push(e),
- null == t.seriesDataCount && (t.seriesDataCount = 0),
- t.seriesDataCount += e.getData().count())
- })
- }, this)
- }
- function Hs(t, e) {
- for (var i = e.model, n = e.dim, o = 0; o < t.length; o++) {
- var a = t[o] || {};
- if (Fs(a[n + "AxisId"], i.id) || Fs(a[n + "AxisIndex"], i.componentIndex) || Fs(a[n + "AxisName"], i.name))
- return o
- }
- }
- function Fs(t, e) {
- return "all" === t || v(t) && s(t, e) >= 0 || t === e
- }
- function Zs(t) {
- var e = Us(t);
- if (e) {
- var i = e.axisPointerModel
- , n = e.axis.scale
- , o = i.option
- , a = i.get("status")
- , r = i.get("value");
- null != r && (r = n.parse(r));
- var s = Xs(i);
- null == a && (o.status = s ? "show" : "hide");
- var l = n.getExtent().slice();
- l[0] > l[1] && l.reverse(),
- (null == r || r > l[1]) && (r = l[1]),
- r < l[0] && (r = l[0]),
- o.value = r,
- s && (o.status = e.axis.scale.isBlank() ? "hide" : "show")
- }
- }
- function Us(t) {
- var e = (t.ecModel.getComponent("axisPointer") || {}).coordSysAxesInfo;
- return e && e.axesInfo[qs(t)]
- }
- function js(t) {
- var e = Us(t);
- return e && e.axisPointerModel
- }
- function Xs(t) {
- return !!t.get("handle.show")
- }
- function qs(t) {
- return t.type + "||" + t.id
- }
- function Ys(t, e, i, n, o, a) {
- var r = WM.getAxisPointerClass(t.axisPointerClass);
- if (r) {
- var s = js(e);
- s ? (t._axisPointer || (t._axisPointer = new r)).render(e, s, n, a) : $s(t, n)
- }
- }
- function $s(t, e, i) {
- var n = t._axisPointer;
- n && n.dispose(e, i),
- t._axisPointer = null
- }
- function Ks(t, e, i) {
- i = i || {};
- var n = t.coordinateSystem
- , o = e.axis
- , a = {}
- , r = o.position
- , s = o.onZero ? "onZero" : r
- , l = o.dim
- , h = n.getRect()
- , u = [h.x, h.x + h.width, h.y, h.y + h.height]
- , c = {
- left: 0,
- right: 1,
- top: 0,
- bottom: 1,
- onZero: 2
- }
- , d = e.get("offset") || 0
- , f = "x" === l ? [u[2] - d, u[3] + d] : [u[0] - d, u[1] + d];
- if (o.onZero) {
- var g = n.getAxis("x" === l ? "y" : "x", o.onZeroAxisIndex)
- , p = g.toGlobalCoord(g.dataToCoord(0));
- f[c.onZero] = Math.max(Math.min(p, f[1]), f[0])
- }
- a.position = ["y" === l ? f[c[s]] : u[0], "x" === l ? f[c[s]] : u[3]],
- a.rotation = Math.PI / 2 * ("x" === l ? 0 : 1);
- var m = {
- top: -1,
- bottom: 1,
- left: -1,
- right: 1
- };
- a.labelDirection = a.tickDirection = a.nameDirection = m[r],
- a.labelOffset = o.onZero ? f[c[r]] - f[c.onZero] : 0,
- e.get("axisTick.inside") && (a.tickDirection = -a.tickDirection),
- M(i.labelInside, e.get("axisLabel.inside")) && (a.labelDirection = -a.labelDirection);
- var v = e.get("axisLabel.rotate");
- return a.labelRotate = "top" === s ? -v : v,
- a.labelInterval = o.getLabelInterval(),
- a.z2 = 1,
- a
- }
- function Js(t) {
- return t.get("stack") || qM + t.seriesIndex
- }
- function Qs(t) {
- return t.dim + t.index
- }
- function tl(t, e) {
- return el(d(t, function(t) {
- var e = t.getData()
- , i = t.coordinateSystem.getBaseAxis()
- , n = i.getExtent()
- , o = "category" === i.type ? i.getBandWidth() : Math.abs(n[1] - n[0]) / e.count();
- return {
- bandWidth: o,
- barWidth: bi(t.get("barWidth"), o),
- barMaxWidth: bi(t.get("barMaxWidth"), o),
- barGap: t.get("barGap"),
- barCategoryGap: t.get("barCategoryGap"),
- axisKey: Qs(i),
- stackId: Js(t)
- }
- }), e)
- }
- function el(t, e) {
- var i = {};
- c(t, function(t, e) {
- var n = t.axisKey
- , o = t.bandWidth
- , a = i[n] || {
- bandWidth: o,
- remainedWidth: o,
- autoWidthCount: 0,
- categoryGap: "20%",
- gap: "30%",
- stacks: {}
- }
- , r = a.stacks;
- i[n] = a;
- var s = t.stackId;
- r[s] || a.autoWidthCount++,
- r[s] = r[s] || {
- width: 0,
- maxWidth: 0
- };
- var l = t.barWidth;
- l && !r[s].width && (r[s].width = l,
- l = Math.min(a.remainedWidth, l),
- a.remainedWidth -= l);
- var h = t.barMaxWidth;
- h && (r[s].maxWidth = h);
- var u = t.barGap;
- null != u && (a.gap = u);
- var c = t.barCategoryGap;
- null != c && (a.categoryGap = c)
- });
- var n = {};
- return c(i, function(t, e) {
- n[e] = {};
- var i = t.stacks
- , o = t.bandWidth
- , a = bi(t.categoryGap, o)
- , r = bi(t.gap, 1)
- , s = t.remainedWidth
- , l = t.autoWidthCount
- , h = (s - a) / (l + (l - 1) * r);
- h = Math.max(h, 0),
- c(i, function(t, e) {
- var i = t.maxWidth;
- i && i < h && (i = Math.min(i, s),
- t.width && (i = Math.min(i, t.width)),
- s -= i,
- t.width = i,
- l--)
- }),
- h = (s - a) / (l + (l - 1) * r),
- h = Math.max(h, 0);
- var u, d = 0;
- c(i, function(t, e) {
- t.width || (t.width = h),
- u = t,
- d += t.width * (1 + r)
- }),
- u && (d -= u.width * r);
- var f = -d / 2;
- c(i, function(t, i) {
- n[e][i] = n[e][i] || {
- offset: f,
- width: t.width
- },
- f += t.width * (1 + r)
- })
- }),
- n
- }
- function il(t, e, i) {
- var n = tl(g(e.getSeriesByType(t), function(t) {
- return !e.isSeriesFiltered(t) && t.coordinateSystem && "cartesian2d" === t.coordinateSystem.type
- }))
- , o = {}
- , a = {};
- e.eachSeriesByType(t, function(t) {
- if ("cartesian2d" === t.coordinateSystem.type) {
- var e = t.getData()
- , i = t.coordinateSystem
- , r = i.getBaseAxis()
- , s = Js(t)
- , l = n[Qs(r)][s]
- , h = l.offset
- , u = l.width
- , c = i.getOtherAxis(r)
- , d = t.get("barMinHeight") || 0
- , f = r.onZero ? c.toGlobalCoord(c.dataToCoord(0)) : c.getGlobalExtent()[0]
- , g = [t.coordDimToDataDim("x")[0], t.coordDimToDataDim("y")[0]]
- , p = e.mapArray(g, function(t, e) {
- return i.dataToPoint([t, e])
- }, !0);
- o[s] = o[s] || [],
- a[s] = a[s] || [],
- e.setLayout({
- offset: h,
- size: u
- }),
- e.each(t.coordDimToDataDim(c.dim)[0], function(t, i) {
- if (!isNaN(t)) {
- o[s][i] || (o[s][i] = {
- p: f,
- n: f
- },
- a[s][i] = {
- p: f,
- n: f
- });
- var n, r, l, g, m = t >= 0 ? "p" : "n", v = p[i], y = o[s][i][m], x = a[s][i][m];
- c.isHorizontal() ? (n = y,
- r = v[1] + h,
- l = v[0] - x,
- g = u,
- a[s][i][m] += l,
- Math.abs(l) < d && (l = (l < 0 ? -1 : 1) * d),
- o[s][i][m] += l) : (n = v[0] + h,
- r = y,
- l = u,
- g = v[1] - x,
- a[s][i][m] += g,
- Math.abs(g) < d && (g = (g <= 0 ? -1 : 1) * d),
- o[s][i][m] += g),
- e.setItemLayout(i, {
- x: n,
- y: r,
- width: l,
- height: g
- })
- }
- }, !0)
- }
- }, this)
- }
- function nl(t, e, i, n, o, a, r) {
- ho(t, e, i.getModel("label.normal"), i.getModel("label.emphasis"), {
- labelFetcher: o,
- labelDataIndex: a,
- defaultText: o.getRawValue(a),
- isRectText: !0,
- autoColor: n
- }),
- ol(t),
- ol(e)
- }
- function ol(t, e) {
- "outside" === t.textPosition && (t.textPosition = e)
- }
- function al(t, e, i) {
- i.style.text = null,
- _o(i, {
- shape: {
- width: 0
- }
- }, e, t, function() {
- i.parent && i.parent.remove(i)
- })
- }
- function rl(t, e, i) {
- i.style.text = null,
- _o(i, {
- shape: {
- r: i.shape.r0
- }
- }, e, t, function() {
- i.parent && i.parent.remove(i)
- })
- }
- function sl(t, e, i, n, o, r, s, l) {
- var h = e.getItemVisual(i, "color")
- , u = e.getItemVisual(i, "opacity")
- , c = n.getModel("itemStyle.normal")
- , d = n.getModel("itemStyle.emphasis").getBarItemStyle();
- l || t.setShape("r", c.get("barBorderRadius") || 0),
- t.useStyle(a({
- fill: h,
- opacity: u
- }, c.getBarItemStyle()));
- var f = n.getShallow("cursor");
- f && t.attr("cursor", f);
- var g = s ? o.height > 0 ? "bottom" : "top" : o.width > 0 ? "left" : "right";
- l || nl(t.style, d, n, h, r, i, g),
- lo(t, d)
- }
- function ll(t, e) {
- var i = t.get(JM) || 0;
- return Math.min(i, Math.abs(e.width), Math.abs(e.height))
- }
- function hl(t, e, i, n) {
- var o = e.getData()
- , a = this.dataIndex
- , r = o.getName(a)
- , s = e.get("selectedOffset");
- n.dispatchAction({
- type: "pieToggleSelect",
- from: t,
- name: r,
- seriesId: e.id
- }),
- o.each(function(t) {
- ul(o.getItemGraphicEl(t), o.getItemLayout(t), e.isSelected(o.getName(t)), s, i)
- })
- }
- function ul(t, e, i, n, o) {
- var a = (e.startAngle + e.endAngle) / 2
- , r = Math.cos(a)
- , s = Math.sin(a)
- , l = i ? n : 0
- , h = [r * l, s * l];
- o ? t.animate().when(200, {
- position: h
- }).start("bounceOut") : t.attr("position", h)
- }
- function cl(t, e) {
- function i() {
- a.ignore = a.hoverIgnore,
- r.ignore = r.hoverIgnore
- }
- function n() {
- a.ignore = a.normalIgnore,
- r.ignore = r.normalIgnore
- }
- $y.call(this);
- var o = new hb({
- z2: 2
- })
- , a = new gb
- , r = new ab;
- this.add(o),
- this.add(a),
- this.add(r),
- this.updateData(t, e, !0),
- this.on("emphasis", i).on("normal", n).on("mouseover", i).on("mouseout", n)
- }
- function dl(t, e, i, n, o, a, r) {
- function s(e, i) {
- for (var n = e; n >= 0 && (t[n].y -= i,
- !(n > 0 && t[n].y > t[n - 1].y + t[n - 1].height)); n--)
- ;
- }
- function l(t, e, i, n, o, a) {
- for (var r = e ? Number.MAX_VALUE : 0, s = 0, l = t.length; s < l; s++)
- if ("center" !== t[s].position) {
- var h = Math.abs(t[s].y - n)
- , u = t[s].len
- , c = t[s].len2
- , d = h < o + u ? Math.sqrt((o + u + c) * (o + u + c) - h * h) : Math.abs(t[s].x - i);
- e && d >= r && (d = r - 10),
- !e && d <= r && (d = r + 10),
- t[s].x = i + d * a,
- r = d
- }
- }
- t.sort(function(t, e) {
- return t.y - e.y
- });
- for (var h, u = 0, c = t.length, d = [], f = [], g = 0; g < c; g++)
- (h = t[g].y - u) < 0 && function(e, i, n, o) {
- for (var a = e; a < i; a++)
- if (t[a].y += n,
- a > e && a + 1 < i && t[a + 1].y > t[a].y + t[a].height)
- return void s(a, n / 2);
- s(i - 1, n / 2)
- }(g, c, -h),
- u = t[g].y + t[g].height;
- r - u < 0 && s(c - 1, u - r);
- for (g = 0; g < c; g++)
- t[g].y >= i ? f.push(t[g]) : d.push(t[g]);
- l(d, !1, e, i, n, o),
- l(f, !0, e, i, n, o)
- }
- function fl(t, e, i, n, o, a) {
- for (var r = [], s = [], l = 0; l < t.length; l++)
- t[l].x < e ? r.push(t[l]) : s.push(t[l]);
- dl(s, e, i, n, 1, o, a),
- dl(r, e, i, n, -1, o, a);
- for (l = 0; l < t.length; l++) {
- var h = t[l].linePoints;
- if (h) {
- var u = h[1][0] - h[2][0];
- t[l].x < e ? h[2][0] = t[l].x + 3 : h[2][0] = t[l].x - 3,
- h[1][1] = h[2][1] = t[l].y,
- h[1][0] = h[2][0] + u
- }
- }
- }
- function gl() {
- this.group = new $y,
- this._symbolEl = new uI({})
- }
- function pl(t, e, i) {
- YS.call(this, t, e, i),
- this.type = "value",
- this.angle = 0,
- this.name = "",
- this.model
- }
- function ml(t, e, i) {
- this._model = t,
- this.dimensions = [],
- this._indicatorAxes = d(t.getIndicatorModels(), function(t, e) {
- var i = "indicator_" + e
- , n = new pl(i,new wS);
- return n.name = t.get("name"),
- n.model = t,
- t.axis = n,
- this.dimensions.push(i),
- n
- }, this),
- this.resize(t, i),
- this.cx,
- this.cy,
- this.r,
- this.startAngle
- }
- function vl(t, e) {
- return a({
- show: e
- }, t)
- }
- function yl(t) {
- return v(t) || (t = [+t, +t]),
- t
- }
- function xl(t, e) {
- return Math.abs(t - e) < pI
- }
- function _l(t, e, i) {
- var n = 0
- , o = t[0];
- if (!o)
- return !1;
- for (var a = 1; a < t.length; a++) {
- var r = t[a];
- n += Mn(o[0], o[1], r[0], r[1], e, i),
- o = r
- }
- var s = t[0];
- return xl(o[0], s[0]) && xl(o[1], s[1]) || (n += Mn(o[0], o[1], s[0], s[1], e, i)),
- 0 !== n
- }
- function bl(t, e, i) {
- if (this.name = t,
- this.geometries = e,
- i)
- i = [i[0], i[1]];
- else {
- var n = this.getBoundingRect();
- i = [n.x + n.width / 2, n.y + n.height / 2]
- }
- this.center = i
- }
- function wl(t) {
- if (!t.UTF8Encoding)
- return t;
- var e = t.UTF8Scale;
- null == e && (e = 1024);
- for (var i = t.features, n = 0; n < i.length; n++)
- for (var o = i[n].geometry, a = o.coordinates, r = o.encodeOffsets, s = 0; s < a.length; s++) {
- var l = a[s];
- if ("Polygon" === o.type)
- a[s] = Sl(l, r[s], e);
- else if ("MultiPolygon" === o.type)
- for (var h = 0; h < l.length; h++) {
- var u = l[h];
- l[h] = Sl(u, r[s][h], e)
- }
- }
- return t.UTF8Encoding = !1,
- t
- }
- function Sl(t, e, i) {
- for (var n = [], o = e[0], a = e[1], r = 0; r < t.length; r += 2) {
- var s = t.charCodeAt(r) - 64
- , l = t.charCodeAt(r + 1) - 64;
- s = s >> 1 ^ -(1 & s),
- l = l >> 1 ^ -(1 & l),
- o = s += o,
- a = l += a,
- n.push([s / i, l / i])
- }
- return n
- }
- function Ml() {
- My.call(this)
- }
- function Il(t) {
- this.name = t,
- this.zoomLimit,
- My.call(this),
- this._roamTransform = new Ml,
- this._viewTransform = new Ml,
- this._center,
- this._zoom
- }
- function Tl(t, e, i, n) {
- var o = i.seriesModel
- , a = o ? o.coordinateSystem : null;
- return a === this ? a[t](n) : null
- }
- function Al(t, e, i, n, o) {
- Il.call(this, t),
- this.map = e,
- this._nameCoordMap = O(),
- this.loadGeoJson(i, n, o)
- }
- function Cl(t, e, i, n) {
- var o = i.geoModel
- , a = i.seriesModel
- , r = o ? o.coordinateSystem : a ? a.coordinateSystem || (a.getReferringComponents("geo")[0] || {}).coordinateSystem : null;
- return r === this ? r[t](n) : null
- }
- function Dl(t, e) {
- var i = t.get("boundingCoords");
- if (null != i) {
- var n = i[0]
- , o = i[1];
- 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])
- }
- var a, r = this.getBoundingRect(), s = t.get("layoutCenter"), l = t.get("layoutSize"), h = e.getWidth(), u = e.getHeight(), c = t.get("aspectScale") || .75, d = r.width / r.height * c, f = !1;
- s && l && (s = [bi(s[0], h), bi(s[1], u)],
- l = bi(l, Math.min(h, u)),
- isNaN(s[0]) || isNaN(s[1]) || isNaN(l) || (f = !0));
- if (f) {
- var g = {};
- d > 1 ? (g.width = l,
- g.height = l / d) : (g.height = l,
- g.width = l * d),
- g.y = s[1] - g.height / 2,
- g.x = s[0] - g.width / 2
- } else
- (a = t.getBoxLayoutParams()).aspect = d,
- g = Yo(a, {
- width: h,
- height: u
- });
- this.setViewRect(g.x, g.y, g.width, g.height),
- this.setCenter(t.get("center")),
- this.setZoom(t.get("zoom"))
- }
- function Ll(t, e) {
- c(e.get("geoCoord"), function(e, i) {
- t.addGeoCoord(i, e)
- })
- }
- function kl(t, e, i) {
- zl(t)[e] = i
- }
- function Pl(t, e, i) {
- var n = zl(t);
- n[e] === i && (n[e] = null)
- }
- function Ol(t, e) {
- return !!zl(t)[e]
- }
- function zl(t) {
- return t[DI] || (t[DI] = {})
- }
- function Nl(t) {
- this.pointerChecker,
- this._zr = t,
- this._opt = {};
- var i = p
- , n = i(El, this)
- , o = i(Rl, this)
- , r = i(Vl, this)
- , s = i(Bl, this)
- , l = i(Gl, this);
- my.call(this),
- this.setPointerChecker = function(t) {
- this.pointerChecker = t
- }
- ,
- this.enable = function(i, h) {
- this.disable(),
- this._opt = a(e(h) || {}, {
- zoomOnMouseWheel: !0,
- moveOnMouseMove: !0,
- preventDefaultMouseMove: !0
- }),
- null == i && (i = !0),
- !0 !== i && "move" !== i && "pan" !== i || (t.on("mousedown", n),
- t.on("mousemove", o),
- t.on("mouseup", r)),
- !0 !== i && "scale" !== i && "zoom" !== i || (t.on("mousewheel", s),
- t.on("pinch", l))
- }
- ,
- this.disable = function() {
- t.off("mousedown", n),
- t.off("mousemove", o),
- t.off("mouseup", r),
- t.off("mousewheel", s),
- t.off("pinch", l)
- }
- ,
- this.dispose = this.disable,
- this.isDragging = function() {
- return this._dragging
- }
- ,
- this.isPinching = function() {
- return this._pinching
- }
- }
- function El(t) {
- if (!(si(t) || t.target && t.target.draggable)) {
- var e = t.offsetX
- , i = t.offsetY;
- this.pointerChecker && this.pointerChecker(t, e, i) && (this._x = e,
- this._y = i,
- this._dragging = !0)
- }
- }
- function Rl(t) {
- if (!si(t) && Hl(this, "moveOnMouseMove", t) && this._dragging && "pinch" !== t.gestureEvent && !Ol(this._zr, "globalPan")) {
- var e = t.offsetX
- , i = t.offsetY
- , n = this._x
- , o = this._y
- , a = e - n
- , r = i - o;
- this._x = e,
- this._y = i,
- this._opt.preventDefaultMouseMove && Ix(t.event),
- this.trigger("pan", a, r, n, o, e, i)
- }
- }
- function Vl(t) {
- si(t) || (this._dragging = !1)
- }
- function Bl(t) {
- if (Hl(this, "zoomOnMouseWheel", t) && 0 !== t.wheelDelta) {
- var e = t.wheelDelta > 0 ? 1.1 : 1 / 1.1;
- Wl.call(this, t, e, t.offsetX, t.offsetY)
- }
- }
- function Gl(t) {
- if (!Ol(this._zr, "globalPan")) {
- var e = t.pinchScale > 1 ? 1.1 : 1 / 1.1;
- Wl.call(this, t, e, t.pinchX, t.pinchY)
- }
- }
- function Wl(t, e, i, n) {
- this.pointerChecker && this.pointerChecker(t, i, n) && (Ix(t.event),
- this.trigger("zoom", e, i, n))
- }
- function Hl(t, e, i) {
- var n = t._opt[e];
- return n && (!x(n) || i.event[n + "Key"])
- }
- function Fl(t, e, i) {
- var n = t.target
- , o = n.position;
- o[0] += e,
- o[1] += i,
- n.dirty()
- }
- function Zl(t, e, i, n) {
- var o = t.target
- , a = t.zoomLimit
- , r = o.position
- , s = o.scale
- , l = t.zoom = t.zoom || 1;
- if (l *= e,
- a) {
- var h = a.min || 0
- , u = a.max || 1 / 0;
- l = Math.max(Math.min(u, l), h)
- }
- var c = l / t.zoom;
- t.zoom = l,
- r[0] -= (i - r[0]) * (c - 1),
- r[1] -= (n - r[1]) * (c - 1),
- s[0] *= c,
- s[1] *= c,
- o.dirty()
- }
- function Ul(t, e, i) {
- var n = e.getComponentByElement(t.topTarget)
- , o = n && n.coordinateSystem;
- return n && n !== i && !LI[n.mainType] && o && o.model !== i
- }
- function jl(t, e) {
- var i = t.getItemStyle()
- , n = t.get("areaColor");
- return null != n && (i.fill = n),
- i
- }
- function Xl(t, e, i, n, o) {
- i.off("click"),
- i.off("mousedown"),
- e.get("selectedMode") && (i.on("mousedown", function() {
- t._mouseDownFlag = !0
- }),
- i.on("click", function(a) {
- if (t._mouseDownFlag) {
- t._mouseDownFlag = !1;
- for (var r = a.target; !r.__regions; )
- r = r.parent;
- if (r) {
- var s = {
- type: ("geo" === e.mainType ? "geo" : "map") + "ToggleSelect",
- batch: d(r.__regions, function(t) {
- return {
- name: t.name,
- from: o.uid
- }
- })
- };
- s[e.mainType + "Id"] = e.id,
- n.dispatchAction(s),
- ql(e, i)
- }
- }
- }))
- }
- function ql(t, e) {
- e.eachChild(function(e) {
- c(e.__regions, function(i) {
- e.trigger(t.isSelected(i.name) ? "emphasis" : "normal")
- })
- })
- }
- function Yl(t, e) {
- var i = new $y;
- this._controller = new Nl(t.getZr()),
- this._controllerHost = {
- target: e ? i : null
- },
- this.group = i,
- this._updateGroup = e,
- this._mouseDownFlag
- }
- function $l(t, e, i) {
- var n = t.getZoom()
- , o = t.getCenter()
- , a = e.zoom
- , r = t.dataToPoint(o);
- if (null != e.dx && null != e.dy) {
- r[0] -= e.dx,
- r[1] -= e.dy;
- o = t.pointToData(r);
- t.setCenter(o)
- }
- if (null != a) {
- if (i) {
- var s = i.min || 0
- , l = i.max || 1 / 0;
- a = Math.max(Math.min(n * a, l), s) / n
- }
- t.scale[0] *= a,
- t.scale[1] *= a;
- var h = t.position
- , u = (e.originX - h[0]) * (a - 1)
- , c = (e.originY - h[1]) * (a - 1);
- h[0] -= u,
- h[1] -= c,
- t.updateTransform();
- o = t.pointToData(r);
- t.setCenter(o),
- t.setZoom(a * n)
- }
- return {
- center: t.getCenter(),
- zoom: t.getZoom()
- }
- }
- function Kl(t, e) {
- var i = {}
- , n = ["value"];
- return c(t, function(t) {
- t.each(n, function(e, n) {
- var o = "ec-" + t.getName(n);
- i[o] = i[o] || [],
- isNaN(e) || i[o].push(e)
- })
- }),
- t[0].map(n, function(n, o) {
- for (var a = "ec-" + t[0].getName(o), r = 0, s = 1 / 0, l = -1 / 0, h = i[a].length, u = 0; u < h; u++)
- s = Math.min(s, i[a][u]),
- l = Math.max(l, i[a][u]),
- r += i[a][u];
- var c;
- return c = "min" === e ? s : "max" === e ? l : "average" === e ? r / h : r,
- 0 === h ? NaN : c
- })
- }
- function Jl(t) {
- var e = t.mainData
- , i = t.datas;
- i || (i = {
- main: e
- },
- t.datasAttr = {
- main: "data"
- }),
- t.datas = t.mainData = null,
- oh(e, i, t),
- kI(i, function(i) {
- kI(e.TRANSFERABLE_METHODS, function(e) {
- i.wrapMethod(e, m(Ql, t))
- })
- }),
- e.wrapMethod("cloneShallow", m(eh, t)),
- kI(e.CHANGABLE_METHODS, function(i) {
- e.wrapMethod(i, m(th, t))
- }),
- D(i[e.dataType] === e)
- }
- function Ql(t, e) {
- if (nh(this)) {
- var i = o({}, this[PI]);
- i[this.dataType] = e,
- oh(e, i, t)
- } else
- ah(e, this.dataType, this[OI], t);
- return e
- }
- function th(t, e) {
- return t.struct && t.struct.update(this),
- e
- }
- function eh(t, e) {
- return kI(e[PI], function(i, n) {
- i !== e && ah(i.cloneShallow(), n, e, t)
- }),
- e
- }
- function ih(t) {
- var e = this[OI];
- return null == t || null == e ? e : e[PI][t]
- }
- function nh(t) {
- return t[OI] === t
- }
- function oh(t, e, i) {
- t[PI] = {},
- kI(e, function(e, n) {
- ah(e, n, t, i)
- })
- }
- function ah(t, e, i, n) {
- i[PI][e] = t,
- t[OI] = i,
- t.dataType = e,
- n.struct && (t[n.structAttr] = n.struct,
- n.struct[n.datasAttr[e]] = t),
- t.getLinkedData = ih
- }
- function rh(t, e, i) {
- this.root,
- this.data,
- this._nodes = [],
- this.hostModel = t,
- this.levelModels = d(e || [], function(e) {
- return new Co(e,t,t.ecModel)
- }),
- this.leavesModel = new Co(i || {},t,t.ecModel)
- }
- function sh(t, e) {
- var i = e.children;
- t.parentNode !== e && (i.push(t),
- t.parentNode = e)
- }
- function lh(t) {
- t.hierNode = {
- defaultAncestor: null,
- ancestor: t,
- prelim: 0,
- modifier: 0,
- change: 0,
- shift: 0,
- i: 0,
- thread: null
- };
- for (var e, i, n = [t]; e = n.pop(); )
- if (i = e.children,
- e.isExpand && i.length)
- for (var o = i.length - 1; o >= 0; o--) {
- var a = i[o];
- a.hierNode = {
- defaultAncestor: null,
- ancestor: a,
- prelim: 0,
- modifier: 0,
- change: 0,
- shift: 0,
- i: o,
- thread: null
- },
- n.push(a)
- }
- }
- function hh(t, e) {
- var i = t.isExpand ? t.children : []
- , n = t.parentNode.children
- , o = t.hierNode.i ? n[t.hierNode.i - 1] : null;
- if (i.length) {
- gh(t);
- var a = (i[0].hierNode.prelim + i[i.length - 1].hierNode.prelim) / 2;
- o ? (t.hierNode.prelim = o.hierNode.prelim + e(t, o),
- t.hierNode.modifier = t.hierNode.prelim - a) : t.hierNode.prelim = a
- } else
- o && (t.hierNode.prelim = o.hierNode.prelim + e(t, o));
- t.parentNode.hierNode.defaultAncestor = ph(t, o, t.parentNode.hierNode.defaultAncestor || n[0], e)
- }
- function uh(t) {
- var e = t.hierNode.prelim + t.parentNode.hierNode.modifier;
- t.setLayout({
- x: e
- }, !0),
- t.hierNode.modifier += t.parentNode.hierNode.modifier
- }
- function ch(t) {
- return arguments.length ? t : _h
- }
- function dh(t, e) {
- var i = {};
- return t -= Math.PI / 2,
- i.x = e * Math.cos(t),
- i.y = e * Math.sin(t),
- i
- }
- function fh(t, e) {
- return Yo(t.getBoxLayoutParams(), {
- width: e.getWidth(),
- height: e.getHeight()
- })
- }
- function gh(t) {
- for (var e = t.children, i = e.length, n = 0, o = 0; --i >= 0; ) {
- var a = e[i];
- a.hierNode.prelim += n,
- a.hierNode.modifier += n,
- o += a.hierNode.change,
- n += a.hierNode.shift + o
- }
- }
- function ph(t, e, i, n) {
- if (e) {
- for (var o = t, a = t, r = a.parentNode.children[0], s = e, l = o.hierNode.modifier, h = a.hierNode.modifier, u = r.hierNode.modifier, c = s.hierNode.modifier; s = mh(s),
- a = vh(a),
- s && a; ) {
- o = mh(o),
- r = vh(r),
- o.hierNode.ancestor = t;
- var d = s.hierNode.prelim + c - a.hierNode.prelim - h + n(s, a);
- d > 0 && (xh(yh(s, t, i), t, d),
- h += d,
- l += d),
- c += s.hierNode.modifier,
- h += a.hierNode.modifier,
- l += o.hierNode.modifier,
- u += r.hierNode.modifier
- }
- s && !mh(o) && (o.hierNode.thread = s,
- o.hierNode.modifier += c - l),
- a && !vh(r) && (r.hierNode.thread = a,
- r.hierNode.modifier += h - u,
- i = t)
- }
- return i
- }
- function mh(t) {
- var e = t.children;
- return e.length && t.isExpand ? e[e.length - 1] : t.hierNode.thread
- }
- function vh(t) {
- var e = t.children;
- return e.length && t.isExpand ? e[0] : t.hierNode.thread
- }
- function yh(t, e, i) {
- return t.hierNode.ancestor.parentNode === e.parentNode ? t.hierNode.ancestor : i
- }
- function xh(t, e, i) {
- var n = i / (e.hierNode.i - t.hierNode.i);
- e.hierNode.change -= n,
- e.hierNode.shift += i,
- e.hierNode.modifier += i,
- e.hierNode.prelim += i,
- t.hierNode.change += n
- }
- function _h(t, e) {
- return t.parentNode === e.parentNode ? 1 : 2
- }
- function bh(t, e) {
- var i = t.getItemLayout(e);
- return i && !isNaN(i.x) && !isNaN(i.y) && "none" !== t.getItemVisual(e, "symbol")
- }
- function wh(t, e, i) {
- return i.itemModel = e,
- i.itemStyle = e.getModel("itemStyle.normal").getItemStyle(),
- i.hoverItemStyle = e.getModel("itemStyle.emphasis").getItemStyle(),
- i.lineStyle = e.getModel("lineStyle.normal").getLineStyle(),
- i.labelModel = e.getModel("label.normal"),
- i.hoverLabelModel = e.getModel("label.emphasis"),
- !1 === t.isExpand && 0 !== t.children.length ? i.symbolInnerColor = i.itemStyle.fill : i.symbolInnerColor = "#fff",
- i
- }
- function Sh(t, e, i, n, o, r) {
- var s = !i
- , l = t.tree.getNodeByDataIndex(e)
- , r = wh(l, l.getModel(), r)
- , h = t.tree.root
- , u = l.parentNode === h ? l : l.parentNode || l
- , c = t.getItemGraphicEl(u.dataIndex)
- , d = u.getLayout()
- , f = c ? {
- x: c.position[0],
- y: c.position[1],
- rawX: c.__radialOldRawX,
- rawY: c.__radialOldRawY
- } : d
- , g = l.getLayout();
- s ? (i = new Kr(t,e,r)).attr("position", [f.x, f.y]) : i.updateData(t, e, r),
- i.__radialOldRawX = i.__radialRawX,
- i.__radialOldRawY = i.__radialRawY,
- i.__radialRawX = g.rawX,
- i.__radialRawY = g.rawY,
- n.add(i),
- t.setItemGraphicEl(e, i),
- _o(i, {
- position: [g.x, g.y]
- }, o);
- var p = i.getSymbolPath();
- if ("radial" === r.layout) {
- var m, v, y = h.children[0], x = y.getLayout(), _ = y.children.length;
- if (g.x === x.x && !0 === l.isExpand) {
- var b = {};
- b.x = (y.children[0].getLayout().x + y.children[_ - 1].getLayout().x) / 2,
- b.y = (y.children[0].getLayout().y + y.children[_ - 1].getLayout().y) / 2,
- (m = Math.atan2(b.y - x.y, b.x - x.x)) < 0 && (m = 2 * Math.PI + m),
- (v = b.x < x.x) && (m -= Math.PI)
- } else
- (m = Math.atan2(g.y - x.y, g.x - x.x)) < 0 && (m = 2 * Math.PI + m),
- 0 === l.children.length || 0 !== l.children.length && !1 === l.isExpand ? (v = g.x < x.x) && (m -= Math.PI) : (v = g.x > x.x) || (m -= Math.PI);
- var w = v ? "left" : "right";
- p.setStyle({
- textPosition: w,
- textRotation: -m,
- textOrigin: "center",
- verticalAlign: "middle"
- })
- }
- if (l.parentNode && l.parentNode !== h) {
- var S = i.__edge;
- S || (S = i.__edge = new yb({
- shape: Ih(r, f, f),
- style: a({
- opacity: 0
- }, r.lineStyle)
- })),
- _o(S, {
- shape: Ih(r, d, g),
- style: {
- opacity: 1
- }
- }, o),
- n.add(S)
- }
- }
- function Mh(t, e, i, n, o, a) {
- for (var r, s = t.tree.getNodeByDataIndex(e), l = t.tree.root, a = wh(s, s.getModel(), a), h = s.parentNode === l ? s : s.parentNode || s; null == (r = h.getLayout()); )
- h = h.parentNode === l ? h : h.parentNode || h;
- _o(i, {
- position: [r.x + 1, r.y + 1]
- }, o, function() {
- n.remove(i),
- t.setItemGraphicEl(e, null)
- }),
- i.fadeOut(null, {
- keepLabel: !0
- });
- var u = i.__edge;
- u && _o(u, {
- shape: Ih(a, r, r),
- style: {
- opacity: 0
- }
- }, o, function() {
- n.remove(u)
- })
- }
- function Ih(t, e, i) {
- var n, o, a, r, s = t.orient;
- if ("radial" === t.layout) {
- var l = e.rawX
- , h = e.rawY
- , u = i.rawX
- , c = i.rawY
- , d = dh(l, h)
- , f = dh(l, h + (c - h) * t.curvature)
- , g = dh(u, c + (h - c) * t.curvature)
- , p = dh(u, c);
- return {
- x1: d.x,
- y1: d.y,
- x2: p.x,
- y2: p.y,
- cpx1: f.x,
- cpy1: f.y,
- cpx2: g.x,
- cpy2: g.y
- }
- }
- var l = e.x
- , h = e.y
- , u = i.x
- , c = i.y;
- return "horizontal" === s && (n = l + (u - l) * t.curvature,
- o = h,
- a = u + (l - u) * t.curvature,
- r = c),
- "vertical" === s && (n = l,
- o = h + (c - h) * t.curvature,
- a = u,
- r = c + (h - c) * t.curvature),
- {
- x1: l,
- y1: h,
- x2: u,
- y2: c,
- cpx1: n,
- cpy1: o,
- cpx2: a,
- cpy2: r
- }
- }
- function Th(t, e, i) {
- for (var n, o = [t], a = []; n = o.pop(); )
- if (a.push(n),
- n.isExpand) {
- var r = n.children;
- if (r.length)
- for (var s = 0; s < r.length; s++)
- o.push(r[s])
- }
- for (; n = a.pop(); )
- e(n, i)
- }
- function Ah(t, e) {
- for (var i, n = [t]; i = n.pop(); )
- if (e(i),
- i.isExpand) {
- var o = i.children;
- if (o.length)
- for (var a = o.length - 1; a >= 0; a--)
- n.push(o[a])
- }
- }
- function Ch(t, e) {
- if (t && ("treemapZoomToNode" === t.type || "treemapRootToNode" === t.type)) {
- var i = e.getData().tree.root
- , n = t.targetNode;
- if (n && i.contains(n))
- return {
- node: n
- };
- var o = t.targetNodeId;
- if (null != o && (n = i.getNodeById(o)))
- return {
- node: n
- }
- }
- }
- function Dh(t) {
- for (var e = []; t; )
- (t = t.parentNode) && e.push(t);
- return e.reverse()
- }
- function Lh(t, e) {
- return s(Dh(t), e) >= 0
- }
- function kh(t, e) {
- for (var i = []; t; ) {
- var n = t.dataIndex;
- i.push({
- name: t.name,
- dataIndex: n,
- value: e.getRawValue(n)
- }),
- t = t.parentNode
- }
- return i.reverse(),
- i
- }
- function Ph(t) {
- var e = 0;
- c(t.children, function(t) {
- Ph(t);
- var i = t.value;
- v(i) && (i = i[0]),
- e += i
- });
- var i = t.value;
- v(i) && (i = i[0]),
- (null == i || isNaN(i)) && (i = e),
- i < 0 && (i = 0),
- v(t.value) ? t.value[0] = i : t.value = i
- }
- function Oh(t, e) {
- var i = e.get("color");
- if (i) {
- var n;
- return c(t = t || [], function(t) {
- var e = new Co(t)
- , i = e.get("color");
- (e.get("itemStyle.normal.color") || i && "none" !== i) && (n = !0)
- }),
- n || ((t[0] || (t[0] = {})).color = i.slice()),
- t
- }
- }
- function zh(t) {
- this.group = new $y,
- t.add(this.group)
- }
- function Nh(t, e, i, n, o, a) {
- var r = [[o ? t : t - EI, e], [t + i, e], [t + i, e + n], [o ? t : t - EI, e + n]];
- return !a && r.splice(2, 0, [t + i + EI, e + n / 2]),
- !o && r.push([t, e + n / 2]),
- r
- }
- function Eh(t, e, i) {
- t.eventData = {
- componentType: "series",
- componentSubType: "treemap",
- seriesIndex: e.componentIndex,
- seriesName: e.name,
- seriesType: "treemap",
- selfType: "breadcrumb",
- nodeData: {
- dataIndex: i && i.dataIndex,
- name: i && i.name
- },
- treePathInfo: i && kh(i, e)
- }
- }
- function Rh() {
- var t, e = [], i = {};
- return {
- add: function(t, n, o, a, r) {
- return x(a) && (r = a,
- a = 0),
- !i[t.id] && (i[t.id] = 1,
- e.push({
- el: t,
- target: n,
- time: o,
- delay: a,
- easing: r
- }),
- !0)
- },
- done: function(e) {
- return t = e,
- this
- },
- start: function() {
- for (var n = e.length, o = 0, a = e.length; o < a; o++) {
- var r = e[o];
- r.el.animateTo(r.target, r.time, r.delay, r.easing, function() {
- --n || (e.length = 0,
- i = {},
- t && t())
- })
- }
- return this
- }
- }
- }
- function Vh(t, i, n, a, r, s, l, h, u, c) {
- function d(t, e) {
- b ? !t.invisible && s.push(t) : (e(),
- t.__tmWillVisible || (t.invisible = !1))
- }
- function f(i, n, o, a, r, s) {
- var h = l.getModel()
- , u = M(t.getFormattedLabel(l.dataIndex, "normal", null, null, s ? "upperLabel" : "label"), h.get("name"));
- if (!s && v.isLeafRoot) {
- var c = t.get("drillDownIcon", !0);
- u = c ? c + " " + u : u
- }
- var d = h.getModel(s ? FI : WI)
- , f = h.getModel(s ? ZI : HI)
- , g = d.getShallow("show");
- ho(i, n, d, f, {
- defaultText: g ? u : null,
- autoColor: o,
- isRectText: !0
- }),
- s && (i.textRect = e(s)),
- i.truncate = g && d.get("ellipsis") ? {
- outerWidth: a,
- outerHeight: r,
- minChar: 2
- } : null
- }
- function g(t, e, o, a) {
- var s = null != S && n[t][S]
- , l = r[t];
- return s ? (n[t][S] = null,
- p(l, s, t)) : b || ((s = new e({
- z: Bh(o, a)
- })).__tmDepth = o,
- s.__tmStorageName = t,
- m(l, s, t)),
- i[t][w] = s
- }
- function p(t, e, i) {
- (t[w] = {}).old = "nodeGroup" === i ? e.position.slice() : o({}, e.shape)
- }
- function m(t, e, i) {
- var n = t[w] = {}
- , o = l.parentNode;
- if (o && (!a || "drillDown" === a.direction)) {
- var s = 0
- , h = 0
- , u = r.background[o.getRawIndex()];
- !a && u && u.old && (s = u.old.width,
- h = u.old.height),
- n.old = "nodeGroup" === i ? [0, h] : {
- x: s,
- y: h,
- width: 0,
- height: 0
- }
- }
- n.fadein = "nodeGroup" !== i
- }
- if (l) {
- var v = l.getLayout();
- if (v && v.isInView) {
- var y = v.width
- , x = v.height
- , _ = v.borderWidth
- , b = v.invisible
- , w = l.getRawIndex()
- , S = h && h.getRawIndex()
- , I = l.viewChildren
- , T = v.upperHeight
- , A = I && I.length
- , C = l.getModel("itemStyle.normal")
- , D = l.getModel("itemStyle.emphasis")
- , L = g("nodeGroup", VI);
- if (L) {
- if (u.add(L),
- L.attr("position", [v.x || 0, v.y || 0]),
- L.__tmNodeWidth = y,
- L.__tmNodeHeight = x,
- v.isAboveViewRoot)
- return L;
- var k = g("background", BI, c, jI);
- if (k && function(e, i, n) {
- i.dataIndex = l.dataIndex,
- i.seriesIndex = t.seriesIndex,
- i.setShape({
- x: 0,
- y: 0,
- width: y,
- height: x
- });
- var o = l.getVisual("borderColor", !0)
- , a = D.get("borderColor");
- d(i, function() {
- var t = YI(C);
- t.fill = o;
- var e = qI(D);
- if (e.fill = a,
- n) {
- var r = y - 2 * _;
- f(t, e, o, r, T, {
- x: _,
- y: 0,
- width: r,
- height: T
- })
- } else
- t.text = e.text = null;
- i.setStyle(t),
- lo(i, e)
- }),
- e.add(i)
- }(L, k, A && v.upperHeight),
- !A) {
- var P = g("content", BI, c, XI);
- P && function(e, i) {
- i.dataIndex = l.dataIndex,
- i.seriesIndex = t.seriesIndex;
- var n = Math.max(y - 2 * _, 0)
- , o = Math.max(x - 2 * _, 0);
- i.culling = !0,
- i.setShape({
- x: _,
- y: _,
- width: n,
- height: o
- });
- var a = l.getVisual("color", !0);
- d(i, function() {
- var t = YI(C);
- t.fill = a;
- var e = qI(D);
- f(t, e, a, n, o),
- i.setStyle(t),
- lo(i, e)
- }),
- e.add(i)
- }(L, P)
- }
- return L
- }
- }
- }
- }
- function Bh(t, e) {
- var i = t * UI + e;
- return (i - 1) / i
- }
- function Gh(t) {
- var e = t.pieceList;
- t.hasSpecialVisual = !1,
- c(e, function(e, i) {
- e.originIndex = i,
- null != e.visual && (t.hasSpecialVisual = !0)
- })
- }
- function Wh(t) {
- var e = t.categories
- , i = t.visual
- , n = t.categoryMap = {};
- if (JI(e, function(t, e) {
- n[t] = e
- }),
- !v(i)) {
- var o = [];
- _(i) ? JI(i, function(t, e) {
- var i = n[e];
- o[null != i ? i : tT] = t
- }) : o[tT] = i,
- i = $h(t, o)
- }
- for (var a = e.length - 1; a >= 0; a--)
- null == i[a] && (delete n[e[a]],
- e.pop())
- }
- function Hh(t, e) {
- var i = t.visual
- , n = [];
- _(i) ? JI(i, function(t) {
- n.push(t)
- }) : null != i && n.push(i);
- var o = {
- color: 1,
- symbol: 1
- };
- e || 1 !== n.length || o.hasOwnProperty(t.type) || (n[1] = n[0]),
- $h(t, n)
- }
- function Fh(t) {
- return {
- applyVisual: function(e, i, n) {
- e = this.mapValueToVisual(e),
- n("color", t(i("color"), e))
- },
- _doMap: qh([0, 1])
- }
- }
- function Zh(t) {
- var e = this.option.visual;
- return e[Math.round(_i(t, [0, 1], [0, e.length - 1], !0))] || {}
- }
- function Uh(t) {
- return function(e, i, n) {
- n(t, this.mapValueToVisual(e))
- }
- }
- function jh(t) {
- var e = this.option.visual;
- return e[this.option.loop && t !== tT ? t % e.length : t]
- }
- function Xh() {
- return this.option.visual[0]
- }
- function qh(t) {
- return {
- linear: function(e) {
- return _i(e, t, this.option.visual, !0)
- },
- category: jh,
- piecewise: function(e, i) {
- var n = Yh.call(this, i);
- return null == n && (n = _i(e, t, this.option.visual, !0)),
- n
- },
- fixed: Xh
- }
- }
- function Yh(t) {
- var e = this.option
- , i = e.pieceList;
- if (e.hasSpecialVisual) {
- var n = i[eT.findPieceIndex(t, i)];
- if (n && n.visual)
- return n.visual[this.type]
- }
- }
- function $h(t, e) {
- return t.visual = e,
- "color" === t.type && (t.parsedVisual = d(e, function(t) {
- return St(t)
- })),
- e
- }
- function Kh(t, e, i) {
- return t ? e <= i : e < i
- }
- function Jh(t, e, i, n, o, a) {
- var r = t.getModel()
- , s = t.getLayout();
- if (s && !s.invisible && s.isInView) {
- var l, h = t.getModel(aT), u = Qh(h, e, i[t.depth], n), d = h.get("borderColor"), f = h.get("borderColorSaturation");
- null != f && (d = eu(f, l = tu(u))),
- t.setVisual("borderColor", d);
- var g = t.viewChildren;
- if (g && g.length) {
- var p = nu(t, r, s, h, u, g);
- c(g, function(t, e) {
- (t.depth >= o.length || t === o[t.depth]) && Jh(t, au(r, u, t, e, p, a), i, n, o, a)
- })
- } else
- l = tu(u),
- t.setVisual("color", l)
- }
- }
- function Qh(t, e, i, n) {
- var a = o({}, e);
- return c(["color", "colorAlpha", "colorSaturation"], function(o) {
- var r = t.get(o, !0);
- null == r && i && (r = i[o]),
- null == r && (r = e[o]),
- null == r && (r = n.get(o)),
- null != r && (a[o] = r)
- }),
- a
- }
- function tu(t) {
- var e = iu(t, "color");
- if (e) {
- var i = iu(t, "colorAlpha")
- , n = iu(t, "colorSaturation");
- return n && (e = Lt(e, null, null, n)),
- i && (e = kt(e, i)),
- e
- }
- }
- function eu(t, e) {
- return null != e ? Lt(e, null, null, t) : null
- }
- function iu(t, e) {
- var i = t[e];
- if (null != i && "none" !== i)
- return i
- }
- function nu(t, e, i, n, o, a) {
- if (a && a.length) {
- var r = ou(e, "color") || null != o.color && "none" !== o.color && (ou(e, "colorAlpha") || ou(e, "colorSaturation"));
- if (r) {
- var s = e.get("visualMin")
- , l = e.get("visualMax")
- , h = i.dataExtent.slice();
- null != s && s < h[0] && (h[0] = s),
- null != l && l > h[1] && (h[1] = l);
- var u = e.get("colorMappingBy")
- , c = {
- type: r.name,
- dataExtent: h,
- visual: r.range
- };
- "color" !== c.type || "index" !== u && "id" !== u ? c.mappingMethod = "linear" : (c.mappingMethod = "category",
- c.loop = !0);
- var d = new eT(c);
- return d.__drColorMappingBy = u,
- d
- }
- }
- }
- function ou(t, e) {
- var i = t.get(e);
- return oT(i) && i.length ? {
- name: e,
- range: i
- } : null
- }
- function au(t, e, i, n, a, r) {
- var s = o({}, e);
- if (a) {
- var l = a.type
- , h = "color" === l && a.__drColorMappingBy
- , u = "index" === h ? n : "id" === h ? r.mapIdToIndex(i.getId()) : i.getValue(t.get("visualDimension"));
- s[l] = a.mapValueToVisual(u)
- }
- return s
- }
- function ru(t, e, i, n) {
- var o, a;
- if (!t.isRemoved()) {
- var r = t.getLayout();
- o = r.width,
- a = r.height;
- var s = (f = t.getModel()).get(uT)
- , l = f.get(cT) / 2
- , h = mu(f)
- , u = Math.max(s, h)
- , c = s - l
- , d = u - l
- , f = t.getModel();
- t.setLayout({
- borderWidth: s,
- upperHeight: u,
- upperLabelHeight: h
- }, !0);
- var g = (o = rT(o - 2 * c, 0)) * (a = rT(a - c - d, 0))
- , p = su(t, f, g, e, i, n);
- if (p.length) {
- var m = {
- x: c,
- y: d,
- width: o,
- height: a
- }
- , v = sT(o, a)
- , y = 1 / 0
- , x = [];
- x.area = 0;
- for (var _ = 0, b = p.length; _ < b; ) {
- var w = p[_];
- x.push(w),
- x.area += w.getLayout().area;
- var S = cu(x, v, e.squareRatio);
- S <= y ? (_++,
- y = S) : (x.area -= x.pop().getLayout().area,
- du(x, v, m, l, !1),
- v = sT(m.width, m.height),
- x.length = x.area = 0,
- y = 1 / 0)
- }
- if (x.length && du(x, v, m, l, !0),
- !i) {
- var M = f.get("childrenVisibleMin");
- null != M && g < M && (i = !0)
- }
- for (var _ = 0, b = p.length; _ < b; _++)
- ru(p[_], e, i, n + 1)
- }
- }
- }
- function su(t, e, i, n, o, a) {
- var r = t.children || []
- , s = n.sort;
- "asc" !== s && "desc" !== s && (s = null);
- var l = null != n.leafDepth && n.leafDepth <= a;
- if (o && !l)
- return t.viewChildren = [];
- hu(r = g(r, function(t) {
- return !t.isRemoved()
- }), s);
- var h = uu(e, r, s);
- if (0 === h.sum)
- return t.viewChildren = [];
- if (h.sum = lu(e, i, h.sum, s, r),
- 0 === h.sum)
- return t.viewChildren = [];
- for (var u = 0, c = r.length; u < c; u++) {
- var d = r[u].getValue() / h.sum * i;
- r[u].setLayout({
- area: d
- })
- }
- return l && (r.length && t.setLayout({
- isLeafRoot: !0
- }, !0),
- r.length = 0),
- t.viewChildren = r,
- t.setLayout({
- dataExtent: h.dataExtent
- }, !0),
- r
- }
- function lu(t, e, i, n, o) {
- if (!n)
- return i;
- for (var a = t.get("visibleMin"), r = o.length, s = r, l = r - 1; l >= 0; l--) {
- var h = o["asc" === n ? r - l - 1 : l].getValue();
- h / i * e < a && (s = l,
- i -= h)
- }
- return "asc" === n ? o.splice(0, r - s) : o.splice(s, r - s),
- i
- }
- function hu(t, e) {
- return e && t.sort(function(t, i) {
- var n = "asc" === e ? t.getValue() - i.getValue() : i.getValue() - t.getValue();
- return 0 === n ? "asc" === e ? t.dataIndex - i.dataIndex : i.dataIndex - t.dataIndex : n
- }),
- t
- }
- function uu(t, e, i) {
- for (var n = 0, o = 0, a = e.length; o < a; o++)
- n += e[o].getValue();
- var r = t.get("visualDimension");
- if (e && e.length)
- if ("value" === r && i)
- s = [e[e.length - 1].getValue(), e[0].getValue()],
- "asc" === i && s.reverse();
- else {
- var s = [1 / 0, -1 / 0];
- hT(e, function(t) {
- var e = t.getValue(r);
- e < s[0] && (s[0] = e),
- e > s[1] && (s[1] = e)
- })
- }
- else
- s = [NaN, NaN];
- return {
- sum: n,
- dataExtent: s
- }
- }
- function cu(t, e, i) {
- for (var n, o = 0, a = 1 / 0, r = 0, s = t.length; r < s; r++)
- (n = t[r].getLayout().area) && (n < a && (a = n),
- n > o && (o = n));
- var l = t.area * t.area
- , h = e * e * i;
- return l ? rT(h * o / l, l / (h * a)) : 1 / 0
- }
- function du(t, e, i, n, o) {
- var a = e === i.width ? 0 : 1
- , r = 1 - a
- , s = ["x", "y"]
- , l = ["width", "height"]
- , h = i[s[a]]
- , u = e ? t.area / e : 0;
- (o || u > i[l[r]]) && (u = i[l[r]]);
- for (var c = 0, d = t.length; c < d; c++) {
- var f = t[c]
- , g = {}
- , p = u ? f.getLayout().area / u : 0
- , m = g[l[r]] = rT(u - 2 * n, 0)
- , v = i[s[a]] + i[l[a]] - h
- , y = c === d - 1 || v < p ? v : p
- , x = g[l[a]] = rT(y - 2 * n, 0);
- g[s[r]] = i[s[r]] + sT(n, m / 2),
- g[s[a]] = h + sT(n, x / 2),
- h += y,
- f.setLayout(g, !0)
- }
- i[s[r]] += u,
- i[l[r]] -= u
- }
- function fu(t, e, i, n, o) {
- var a = (e || {}).node
- , r = [n, o];
- if (!a || a === i)
- return r;
- for (var s, l = n * o, h = l * t.option.zoomToNodeRatio; s = a.parentNode; ) {
- for (var u = 0, c = s.children, d = 0, f = c.length; d < f; d++)
- u += c[d].getValue();
- var g = a.getValue();
- if (0 === g)
- return r;
- h *= u / g;
- var p = s.getModel()
- , m = p.get(uT);
- (h += 4 * m * m + (3 * m + Math.max(m, mu(p))) * Math.pow(h, .5)) > Hx && (h = Hx),
- a = s
- }
- h < l && (h = l);
- var v = Math.pow(h / l, .5);
- return [n * v, o * v]
- }
- function gu(t, e, i) {
- if (e)
- return {
- x: e.x,
- y: e.y
- };
- var n = {
- x: 0,
- y: 0
- };
- if (!i)
- return n;
- var o = i.node
- , a = o.getLayout();
- if (!a)
- return n;
- for (var r = [a.width / 2, a.height / 2], s = o; s; ) {
- var l = s.getLayout();
- r[0] += l.x,
- r[1] += l.y,
- s = s.parentNode
- }
- return {
- x: t.width / 2 - r[0],
- y: t.height / 2 - r[1]
- }
- }
- function pu(t, e, i, n, o) {
- var a = t.getLayout()
- , r = i[o]
- , s = r && r === t;
- if (!(r && !s || o === i.length && t !== n)) {
- t.setLayout({
- isInView: !0,
- invisible: !s && !e.intersect(a),
- isAboveViewRoot: s
- }, !0);
- var l = new jt(e.x - a.x,e.y - a.y,e.width,e.height);
- hT(t.viewChildren || [], function(t) {
- pu(t, l, i, n, o + 1)
- })
- }
- }
- function mu(t) {
- return t.get(dT) ? t.get(fT) : 0
- }
- function vu(t) {
- return "_EC_" + t
- }
- function yu(t, e) {
- this.id = null == t ? "" : t,
- this.inEdges = [],
- this.outEdges = [],
- this.edges = [],
- this.hostGraph,
- this.dataIndex = null == e ? -1 : e
- }
- function xu(t, e, i) {
- this.node1 = t,
- this.node2 = e,
- this.dataIndex = null == i ? -1 : i
- }
- function _u(t) {
- return isNaN(+t.cpx1) || isNaN(+t.cpy1)
- }
- function bu(t) {
- return "_" + t + "Type"
- }
- function wu(t, e, i) {
- var n = e.getItemVisual(i, "color")
- , o = e.getItemVisual(i, t)
- , a = e.getItemVisual(i, t + "Size");
- if (o && "none" !== o) {
- v(a) || (a = [a, a]);
- var r = Gr(o, -a[0] / 2, -a[1] / 2, a[0], a[1], n);
- return r.name = t,
- r
- }
- }
- function Su(t) {
- var e = new bT({
- name: "line"
- });
- return Mu(e.shape, t),
- e
- }
- function Mu(t, e) {
- var i = e[0]
- , n = e[1]
- , o = e[2];
- t.x1 = i[0],
- t.y1 = i[1],
- t.x2 = n[0],
- t.y2 = n[1],
- t.percent = 1,
- o ? (t.cpx1 = o[0],
- t.cpy1 = o[1]) : (t.cpx1 = NaN,
- t.cpy1 = NaN)
- }
- function Iu(t, e, i) {
- $y.call(this),
- this._createLine(t, e, i)
- }
- function Tu(t) {
- return isNaN(t[0]) || isNaN(t[1])
- }
- function Au(t) {
- return !Tu(t[0]) && !Tu(t[1])
- }
- function Cu(t) {
- this._ctor = t || Iu,
- this.group = new $y
- }
- function Du(t, e, i) {
- for (var n, o = t[0], a = t[1], r = t[2], s = 1 / 0, l = i * i, h = .1, u = .1; u <= .9; u += .1)
- IT[0] = CT(o[0], a[0], r[0], u),
- IT[1] = CT(o[1], a[1], r[1], u),
- (f = LT(DT(IT, e) - l)) < s && (s = f,
- n = u);
- for (var c = 0; c < 32; c++) {
- var d = n + h;
- TT[0] = CT(o[0], a[0], r[0], n),
- TT[1] = CT(o[1], a[1], r[1], n),
- AT[0] = CT(o[0], a[0], r[0], d),
- AT[1] = CT(o[1], a[1], r[1], d);
- var f = DT(TT, e) - l;
- if (LT(f) < .01)
- break;
- var g = DT(AT, e) - l;
- h /= 2,
- f < 0 ? g >= 0 ? n += h : n -= h : g >= 0 ? n -= h : n += h
- }
- return n
- }
- function Lu(t, e) {
- return t.getVisual("opacity") || t.getModel().get(e)
- }
- function ku(t, e, i) {
- var n = t.getGraphicEl()
- , o = Lu(t, e);
- null != i && (null == o && (o = 1),
- o *= i),
- n.downplay && n.downplay(),
- n.traverse(function(t) {
- "group" !== t.type && t.setStyle("opacity", o)
- })
- }
- function Pu(t, e) {
- var i = Lu(t, e)
- , n = t.getGraphicEl();
- n.highlight && n.highlight(),
- n.traverse(function(t) {
- "group" !== t.type && t.setStyle("opacity", i)
- })
- }
- function Ou(t) {
- return t instanceof Array || (t = [t, t]),
- t
- }
- function zu(t) {
- var e = t.coordinateSystem;
- if (!e || "view" === e.type) {
- var i = t.getGraph();
- i.eachNode(function(t) {
- var e = t.getModel();
- t.setLayout([+e.get("x"), +e.get("y")])
- }),
- Nu(i)
- }
- }
- function Nu(t) {
- t.eachEdge(function(t) {
- var e = t.getModel().get("lineStyle.normal.curveness") || 0
- , i = R(t.node1.getLayout())
- , n = R(t.node2.getLayout())
- , o = [i, n];
- +e && o.push([(i[0] + n[0]) / 2 - (i[1] - n[1]) * e, (i[1] + n[1]) / 2 - (n[0] - i[0]) * e]),
- t.setLayout(o)
- })
- }
- function Eu(t) {
- var e = t.coordinateSystem;
- if (!e || "view" === e.type) {
- var i = e.getBoundingRect()
- , n = t.getData()
- , o = n.graph
- , a = 0
- , r = n.getSum("value")
- , s = 2 * Math.PI / (r || n.count())
- , l = i.width / 2 + i.x
- , h = i.height / 2 + i.y
- , u = Math.min(i.width, i.height) / 2;
- o.eachNode(function(t) {
- var e = t.getValue("value");
- a += s * (r ? e : 1) / 2,
- t.setLayout([u * Math.cos(a) + l, u * Math.sin(a) + h]),
- a += s * (r ? e : 1) / 2
- }),
- n.setLayout({
- cx: l,
- cy: h
- }),
- o.eachEdge(function(t) {
- var e, i = t.getModel().get("lineStyle.normal.curveness") || 0, n = R(t.node1.getLayout()), o = R(t.node2.getLayout()), a = (n[0] + o[0]) / 2, r = (n[1] + o[1]) / 2;
- +i && (e = [l * (i *= 3) + a * (1 - i), h * i + r * (1 - i)]),
- t.setLayout([n, o, e])
- })
- }
- }
- function Ru(t, e, i) {
- for (var n = i.rect, o = n.width, a = n.height, r = [n.x + o / 2, n.y + a / 2], s = null == i.gravity ? .1 : i.gravity, l = 0; l < t.length; l++) {
- var h = t[l];
- h.p || (h.p = N(o * (Math.random() - .5) + r[0], a * (Math.random() - .5) + r[1])),
- h.pp = R(h.p),
- h.edges = null
- }
- var u = .6;
- return {
- warmUp: function() {
- u = .5
- },
- setFixed: function(e) {
- t[e].fixed = !0
- },
- setUnfixed: function(e) {
- t[e].fixed = !1
- },
- step: function(i) {
- for (var n = [], o = t.length, a = 0; a < e.length; a++) {
- var l = e[a]
- , h = l.n1;
- W(n, (g = l.n2).p, h.p);
- var c = H(n) - l.d
- , d = g.w / (h.w + g.w);
- isNaN(d) && (d = 0),
- U(n, n),
- !h.fixed && zT(h.p, h.p, n, d * c * u),
- !g.fixed && zT(g.p, g.p, n, -(1 - d) * c * u)
- }
- for (a = 0; a < o; a++)
- (v = t[a]).fixed || (W(n, r, v.p),
- zT(v.p, v.p, n, s * u));
- for (a = 0; a < o; a++)
- for (var h = t[a], f = a + 1; f < o; f++) {
- var g = t[f];
- W(n, g.p, h.p),
- 0 === (c = H(n)) && (V(n, Math.random() - .5, Math.random() - .5),
- c = 1);
- var p = (h.rep + g.rep) / c / c;
- !h.fixed && zT(h.pp, h.pp, n, p),
- !g.fixed && zT(g.pp, g.pp, n, -p)
- }
- for (var m = [], a = 0; a < o; a++) {
- var v = t[a];
- v.fixed || (W(m, v.p, v.pp),
- zT(v.p, v.p, m, u),
- E(v.pp, v.p))
- }
- u *= .992,
- i && i(t, e, u < .01)
- }
- }
- }
- function Vu(t, e, i) {
- var n = t.getBoxLayoutParams();
- return n.aspect = i,
- Yo(n, {
- width: e.getWidth(),
- height: e.getHeight()
- })
- }
- function Bu(t, e) {
- var i = t.get("center")
- , n = e.getWidth()
- , o = e.getHeight()
- , a = Math.min(n, o);
- return {
- cx: bi(i[0], e.getWidth()),
- cy: bi(i[1], e.getHeight()),
- r: bi(t.get("radius"), a / 2)
- }
- }
- function Gu(t, e) {
- return e && ("string" == typeof e ? t = e.replace("{value}", null != t ? t : "") : "function" == typeof e && (t = e(t))),
- t
- }
- function Wu(t, e) {
- function i() {
- a.ignore = a.hoverIgnore,
- r.ignore = r.hoverIgnore
- }
- function n() {
- a.ignore = a.normalIgnore,
- r.ignore = r.normalIgnore
- }
- $y.call(this);
- var o = new fb
- , a = new gb
- , r = new ab;
- this.add(o),
- this.add(a),
- this.add(r),
- this.updateData(t, e, !0),
- this.on("emphasis", i).on("normal", n).on("mouseover", i).on("mouseout", n)
- }
- function Hu(t, e) {
- return Yo(t.getBoxLayoutParams(), {
- width: e.getWidth(),
- height: e.getHeight()
- })
- }
- function Fu(t, e) {
- for (var i = t.mapArray("value", function(t) {
- return t
- }), n = [], o = "ascending" === e, a = 0, r = t.count(); a < r; a++)
- n[a] = a;
- return "function" == typeof e ? n.sort(e) : "none" !== e && n.sort(function(t, e) {
- return o ? i[t] - i[e] : i[e] - i[t]
- }),
- n
- }
- function Zu(t) {
- t.each(function(e) {
- var i, n, o, a, r = t.getItemModel(e), s = r.getModel("label.normal").get("position"), l = r.getModel("labelLine.normal"), h = t.getItemLayout(e), u = h.points, c = "inner" === s || "inside" === s || "center" === s;
- if (c)
- i = "center",
- a = [[n = (u[0][0] + u[1][0] + u[2][0] + u[3][0]) / 4, o = (u[0][1] + u[1][1] + u[2][1] + u[3][1]) / 4], [n, o]];
- else {
- var d, f, g, p = l.get("length");
- "left" === s ? (d = (u[3][0] + u[0][0]) / 2,
- f = (u[3][1] + u[0][1]) / 2,
- n = (g = d - p) - 5,
- i = "right") : (d = (u[1][0] + u[2][0]) / 2,
- f = (u[1][1] + u[2][1]) / 2,
- n = (g = d + p) + 5,
- i = "left");
- var m = f;
- a = [[d, f], [g, m]],
- o = m
- }
- h.label = {
- linePoints: a,
- x: n,
- y: o,
- verticalAlign: "middle",
- textAlign: i,
- inside: c
- }
- })
- }
- function Uu(t) {
- if (!t.parallel) {
- var e = !1;
- c(t.series, function(t) {
- t && "parallel" === t.type && (e = !0)
- }),
- e && (t.parallel = [{}])
- }
- }
- function ju(t) {
- c(ko(t.parallelAxis), function(e) {
- if (_(e)) {
- var n = e.parallelIndex || 0
- , o = ko(t.parallel)[n];
- o && o.parallelAxisDefault && i(e, o.parallelAxisDefault, !1)
- }
- })
- }
- function Xu(t, e) {
- var i = t[e] - t[1 - e];
- return {
- span: Math.abs(i),
- sign: i > 0 ? -1 : i < 0 ? 1 : e ? -1 : 1
- }
- }
- function qu(t, e) {
- return Math.min(e[1], Math.max(e[0], t))
- }
- function Yu(t, e, i) {
- this._axesMap = O(),
- this._axesLayout = {},
- this.dimensions = t.dimensions,
- this._rect,
- this._model = t,
- this._init(t, e, i)
- }
- function $u(t, e) {
- return FT(ZT(t, e[0]), e[1])
- }
- function Ku(t, e) {
- var i = e.layoutLength / (e.axisCount - 1);
- return {
- position: i * t,
- axisNameAvailableWidth: i,
- axisLabelShow: !0
- }
- }
- function Ju(t, e) {
- var i, n, o = e.layoutLength, a = e.axisExpandWidth, r = e.axisCount, s = e.axisCollapseWidth, l = e.winInnerIndices, h = s, u = !1;
- return t < l[0] ? (i = t * s,
- n = s) : t <= l[1] ? (i = e.axisExpandWindow0Pos + t * a - e.axisExpandWindow[0],
- h = a,
- u = !0) : (i = o - (r - 1 - t) * s,
- n = s),
- {
- position: i,
- axisNameAvailableWidth: h,
- axisLabelShow: u,
- nameTruncateMaxWidth: n
- }
- }
- function Qu(t) {
- my.call(this),
- this._zr = t,
- this.group = new $y,
- this._brushType,
- this._brushOption,
- this._panels,
- this._track = [],
- this._dragging,
- this._covers = [],
- this._creatingCover,
- this._creatingPanel,
- this._enableGlobalPan,
- this._uid = "brushController_" + uA++,
- this._handlers = {},
- JT(cA, function(t, e) {
- this._handlers[e] = p(t, this)
- }, this)
- }
- function tc(t, n) {
- var o = t._zr;
- t._enableGlobalPan || kl(o, rA, t._uid),
- JT(t._handlers, function(t, e) {
- o.on(e, t)
- }),
- t._brushType = n.brushType,
- t._brushOption = i(e(hA), n, !0)
- }
- function ec(t) {
- var e = t._zr;
- Pl(e, rA, t._uid),
- JT(t._handlers, function(t, i) {
- e.off(i, t)
- }),
- t._brushType = t._brushOption = null
- }
- function ic(t, e) {
- var i = dA[e.brushType].createCover(t, e);
- return i.__brushOption = e,
- ac(i, e),
- t.group.add(i),
- i
- }
- function nc(t, e) {
- var i = sc(e);
- return i.endCreating && (i.endCreating(t, e),
- ac(e, e.__brushOption)),
- e
- }
- function oc(t, e) {
- var i = e.__brushOption;
- sc(e).updateCoverShape(t, e, i.range, i)
- }
- function ac(t, e) {
- var i = e.z;
- null == i && (i = nA),
- t.traverse(function(t) {
- t.z = i,
- t.z2 = i
- })
- }
- function rc(t, e) {
- sc(e).updateCommon(t, e),
- oc(t, e)
- }
- function sc(t) {
- return dA[t.__brushOption.brushType]
- }
- function lc(t, e, i) {
- var n = t._panels;
- if (!n)
- return !0;
- var o, a = t._transform;
- return JT(n, function(t) {
- t.isTargetByCursor(e, i, a) && (o = t)
- }),
- o
- }
- function hc(t, e) {
- var i = t._panels;
- if (!i)
- return !0;
- var n = e.__brushOption.panelId;
- return null == n || i[n]
- }
- function uc(t) {
- var e = t._covers
- , i = e.length;
- return JT(e, function(e) {
- t.group.remove(e)
- }, t),
- e.length = 0,
- !!i
- }
- function cc(t, i) {
- var n = QT(t._covers, function(t) {
- var i = t.__brushOption
- , n = e(i.range);
- return {
- brushType: i.brushType,
- panelId: i.panelId,
- range: n
- }
- });
- t.trigger("brush", n, {
- isEnd: !!i.isEnd,
- removeOnClick: !!i.removeOnClick
- })
- }
- function dc(t) {
- var e = t._track;
- if (!e.length)
- return !1;
- var i = e[e.length - 1]
- , n = e[0]
- , o = i[0] - n[0]
- , a = i[1] - n[1];
- return iA(o * o + a * a, .5) > oA
- }
- function fc(t) {
- var e = t.length - 1;
- return e < 0 && (e = 0),
- [t[0], t[e]]
- }
- function gc(t, e, i, n) {
- var o = new $y;
- return o.add(new pb({
- name: "main",
- style: yc(i),
- silent: !0,
- draggable: !0,
- cursor: "move",
- drift: KT(t, e, o, "nswe"),
- ondragend: KT(cc, e, {
- isEnd: !0
- })
- })),
- JT(n, function(i) {
- o.add(new pb({
- name: i,
- style: {
- opacity: 0
- },
- draggable: !0,
- silent: !0,
- invisible: !0,
- drift: KT(t, e, o, i),
- ondragend: KT(cc, e, {
- isEnd: !0
- })
- }))
- }),
- o
- }
- function pc(t, e, i, n) {
- var o = n.brushStyle.lineWidth || 0
- , a = eA(o, aA)
- , r = i[0][0]
- , s = i[1][0]
- , l = r - o / 2
- , h = s - o / 2
- , u = i[0][1]
- , c = i[1][1]
- , d = u - a + o / 2
- , f = c - a + o / 2
- , g = u - r
- , p = c - s
- , m = g + o
- , v = p + o;
- vc(t, e, "main", r, s, g, p),
- n.transformable && (vc(t, e, "w", l, h, a, v),
- vc(t, e, "e", d, h, a, v),
- vc(t, e, "n", l, h, m, a),
- vc(t, e, "s", l, f, m, a),
- vc(t, e, "nw", l, h, a, a),
- vc(t, e, "ne", d, h, a, a),
- vc(t, e, "sw", l, f, a, a),
- vc(t, e, "se", d, f, a, a))
- }
- function mc(t, e) {
- var i = e.__brushOption
- , n = i.transformable
- , o = e.childAt(0);
- o.useStyle(yc(i)),
- o.attr({
- silent: !n,
- cursor: n ? "move" : "default"
- }),
- JT(["w", "e", "n", "s", "se", "sw", "ne", "nw"], function(i) {
- var o = e.childOfName(i)
- , a = bc(t, i);
- o && o.attr({
- silent: !n,
- invisible: !n,
- cursor: n ? lA[a] + "-resize" : null
- })
- })
- }
- function vc(t, e, i, n, o, a, r) {
- var s = e.childOfName(i);
- s && s.setShape(Tc(Ic(t, e, [[n, o], [n + a, o + r]])))
- }
- function yc(t) {
- return a({
- strokeNoScale: !0
- }, t.brushStyle)
- }
- function xc(t, e, i, n) {
- var o = [tA(t, i), tA(e, n)]
- , a = [eA(t, i), eA(e, n)];
- return [[o[0], a[0]], [o[1], a[1]]]
- }
- function _c(t) {
- return wo(t.group)
- }
- function bc(t, e) {
- if (e.length > 1)
- return ("e" === (n = [bc(t, (e = e.split(""))[0]), bc(t, e[1])])[0] || "w" === n[0]) && n.reverse(),
- n.join("");
- var i = {
- left: "w",
- right: "e",
- top: "n",
- bottom: "s"
- }
- , n = Mo({
- w: "left",
- e: "right",
- n: "top",
- s: "bottom"
- }[e], _c(t));
- return i[n]
- }
- function wc(t, e, i, n, o, a, r, s) {
- var l = n.__brushOption
- , h = t(l.range)
- , u = Mc(i, a, r);
- JT(o.split(""), function(t) {
- var e = sA[t];
- h[e[0]][e[1]] += u[e[0]]
- }),
- l.range = e(xc(h[0][0], h[1][0], h[0][1], h[1][1])),
- rc(i, n),
- cc(i, {
- isEnd: !1
- })
- }
- function Sc(t, e, i, n, o) {
- var a = e.__brushOption.range
- , r = Mc(t, i, n);
- JT(a, function(t) {
- t[0] += r[0],
- t[1] += r[1]
- }),
- rc(t, e),
- cc(t, {
- isEnd: !1
- })
- }
- function Mc(t, e, i) {
- var n = t.group
- , o = n.transformCoordToLocal(e, i)
- , a = n.transformCoordToLocal(0, 0);
- return [o[0] - a[0], o[1] - a[1]]
- }
- function Ic(t, i, n) {
- var o = hc(t, i);
- return o && !0 !== o ? o.clipPath(n, t._transform) : e(n)
- }
- function Tc(t) {
- var e = tA(t[0][0], t[1][0])
- , i = tA(t[0][1], t[1][1]);
- return {
- x: e,
- y: i,
- width: eA(t[0][0], t[1][0]) - e,
- height: eA(t[0][1], t[1][1]) - i
- }
- }
- function Ac(t, e, i) {
- if (t._brushType) {
- var n = t._zr
- , o = t._covers
- , a = lc(t, e, i);
- if (!t._dragging)
- for (var r = 0; r < o.length; r++) {
- var s = o[r].__brushOption;
- if (a && (!0 === a || s.panelId === a.panelId) && dA[s.brushType].contain(o[r], i[0], i[1]))
- return
- }
- a && n.setCursorStyle("crosshair")
- }
- }
- function Cc(t) {
- var e = t.event;
- e.preventDefault && e.preventDefault()
- }
- function Dc(t, e, i) {
- return t.childOfName("main").contain(e, i)
- }
- function Lc(t, i, n, o) {
- var a, r = t._creatingCover, s = t._creatingPanel, l = t._brushOption;
- if (t._track.push(n.slice()),
- dc(t) || r) {
- if (s && !r) {
- "single" === l.brushMode && uc(t);
- var h = e(l);
- h.brushType = kc(h.brushType, s),
- h.panelId = !0 === s ? null : s.panelId,
- r = t._creatingCover = ic(t, h),
- t._covers.push(r)
- }
- if (r) {
- var u = dA[kc(t._brushType, s)];
- r.__brushOption.range = u.getCreatingRange(Ic(t, r, t._track)),
- o && (nc(t, r),
- u.updateCommon(t, r)),
- oc(t, r),
- a = {
- isEnd: o
- }
- }
- } else
- o && "single" === l.brushMode && l.removeOnClick && lc(t, i, n) && uc(t) && (a = {
- isEnd: o,
- removeOnClick: !0
- });
- return a
- }
- function kc(t, e) {
- return "auto" === t ? e.defaultBrushType : t
- }
- function Pc(t) {
- if (this._dragging) {
- Cc(t);
- var e = Lc(this, t, this.group.transformCoordToLocal(t.offsetX, t.offsetY), !0);
- this._dragging = !1,
- this._track = [],
- this._creatingCover = null,
- e && cc(this, e)
- }
- }
- function Oc(t) {
- return {
- createCover: function(e, i) {
- return gc(KT(wc, function(e) {
- var i = [e, [0, 100]];
- return t && i.reverse(),
- i
- }, function(e) {
- return e[t]
- }), e, i, [["w", "e"], ["n", "s"]][t])
- },
- getCreatingRange: function(e) {
- var i = fc(e);
- return [tA(i[0][t], i[1][t]), eA(i[0][t], i[1][t])]
- },
- updateCoverShape: function(e, i, n, o) {
- var a, r = hc(e, i);
- if (!0 !== r && r.getLinearBrushOtherExtent)
- a = r.getLinearBrushOtherExtent(t, e._transform);
- else {
- var s = e._zr;
- a = [0, [s.getWidth(), s.getHeight()][1 - t]]
- }
- var l = [n, a];
- t && l.reverse(),
- pc(e, i, l, o)
- },
- updateCommon: mc,
- contain: Dc
- }
- }
- function zc(t) {
- return t = Rc(t),
- function(e, i) {
- return To(e, t)
- }
- }
- function Nc(t, e) {
- return t = Rc(t),
- function(i) {
- var n = null != e ? e : i
- , o = n ? t.width : t.height
- , a = n ? t.x : t.y;
- return [a, a + (o || 0)]
- }
- }
- function Ec(t, e, i) {
- return t = Rc(t),
- function(n, o, a) {
- return t.contain(o[0], o[1]) && !Ul(n, e, i)
- }
- }
- function Rc(t) {
- return jt.create(t)
- }
- function Vc(t, e, i) {
- return i && "axisAreaSelect" === i.type && e.findComponents({
- mainType: "parallelAxis",
- query: i
- })[0] === t
- }
- function Bc(t) {
- var e = t.axis;
- return d(t.activeIntervals, function(t) {
- return {
- brushType: "lineX",
- panelId: "pl",
- range: [e.dataToCoord(t[0], !0), e.dataToCoord(t[1], !0)]
- }
- })
- }
- function Gc(t, e) {
- return e.getComponent("parallel", t.get("parallelIndex"))
- }
- function Wc(t, e) {
- var i = t._model;
- return i.get("axisExpandable") && i.get("axisExpandTriggerOn") === e
- }
- function Hc(t, e, i) {
- var n = t.get("data")
- , o = Fc(e);
- n && n.length && c(i, function(t) {
- if (t) {
- var e = s(n, t[o]);
- t[o] = e >= 0 ? e : NaN
- }
- })
- }
- function Fc(t) {
- return +t.replace("dim", "")
- }
- function Zc(t, e) {
- var i = 0;
- c(t, function(t) {
- var e = Fc(t);
- e > i && (i = e)
- });
- var n = e[0];
- n && n.length - 1 > i && (i = n.length - 1);
- for (var o = [], a = 0; a <= i; a++)
- o.push("dim" + a);
- return o
- }
- function Uc(t, e, i) {
- var n = t.model
- , o = t.getRect()
- , a = new pb({
- shape: {
- x: o.x,
- y: o.y,
- width: o.width,
- height: o.height
- }
- })
- , r = "horizontal" === n.get("layout") ? "width" : "height";
- return a.setShape(r, 0),
- bo(a, {
- shape: {
- width: o.width,
- height: o.height
- }
- }, e, i),
- a
- }
- function jc(t, e, i, n) {
- for (var o = [], a = 0; a < i.length; a++) {
- var r = i[a]
- , s = t.get(r, e);
- Yc(s, n.getAxis(r).type) || o.push(n.dataToPoint(s, r))
- }
- return o
- }
- function Xc(t, e, i, n, o) {
- var a = jc(t, i, n, o)
- , r = new gb({
- shape: {
- points: a
- },
- silent: !0,
- z2: 10
- });
- e.add(r),
- t.setItemGraphicEl(i, r)
- }
- function qc(t, e) {
- var i = t.hostModel.getModel("lineStyle.normal")
- , n = i.getLineStyle();
- t.eachItemGraphicEl(function(a, r) {
- if (t.hasItemOption) {
- var s = t.getItemModel(r).getModel("lineStyle.normal", i);
- n = s.getLineStyle(["color", "stroke"])
- }
- a.useStyle(o(n, {
- fill: null,
- stroke: t.getItemVisual(r, "color"),
- opacity: t.getItemVisual(r, "opacity")
- })),
- a.shape.smooth = e
- })
- }
- function Yc(t, e) {
- return "category" === e ? null == t : null == t || isNaN(t)
- }
- function $c(t, e, i) {
- var n = new pb({
- shape: {
- x: t.x - 10,
- y: t.y - 10,
- width: 0,
- height: t.height + 20
- }
- });
- return bo(n, {
- shape: {
- width: t.width + 20,
- height: t.height + 20
- }
- }, e, i),
- n
- }
- function Kc() {
- function t(e, n) {
- if (n >= i.length)
- return e;
- for (var o = -1, a = e.length, r = i[n++], s = {}, l = {}; ++o < a; ) {
- var h = r(e[o])
- , u = l[h];
- u ? u.push(e[o]) : l[h] = [e[o]]
- }
- return c(l, function(e, i) {
- s[i] = t(e, n)
- }),
- s
- }
- function e(t, o) {
- if (o >= i.length)
- return t;
- var a = []
- , r = n[o++];
- return c(t, function(t, i) {
- a.push({
- key: i,
- values: e(t, o)
- })
- }),
- r ? a.sort(function(t, e) {
- return r(t.key, e.key)
- }) : a
- }
- var i = []
- , n = [];
- return {
- key: function(t) {
- return i.push(t),
- this
- },
- sortKeys: function(t) {
- return n[i.length - 1] = t,
- this
- },
- entries: function(i) {
- return e(t(i, 0), 0)
- }
- }
- }
- function Jc(t, e) {
- return Yo(t.getBoxLayoutParams(), {
- width: e.getWidth(),
- height: e.getHeight()
- })
- }
- function Qc(t, e, i, n, o, a, r) {
- ed(t, i, o),
- od(t, e, a, n, r),
- cd(t)
- }
- function td(t) {
- c(t, function(t) {
- var e = gd(t.outEdges, yd)
- , i = gd(t.inEdges, yd)
- , n = Math.max(e, i);
- t.setLayout({
- value: n
- }, !0)
- })
- }
- function ed(t, e, i) {
- for (var n = t, o = null, a = 0; n.length; ) {
- o = [];
- for (var r = 0, s = n.length; r < s; r++) {
- var l = n[r];
- l.setLayout({
- x: a
- }, !0),
- l.setLayout({
- dx: e
- }, !0);
- for (var h = 0, u = l.outEdges.length; h < u; h++)
- o.push(l.outEdges[h].node2)
- }
- n = o,
- ++a
- }
- id(t, a),
- nd(t, (i - e) / (a - 1))
- }
- function id(t, e) {
- c(t, function(t) {
- t.outEdges.length || t.setLayout({
- x: e - 1
- }, !0)
- })
- }
- function nd(t, e) {
- c(t, function(t) {
- var i = t.getLayout().x * e;
- t.setLayout({
- x: i
- }, !0)
- })
- }
- function od(t, e, i, n, o) {
- var a = Kc().key(function(t) {
- return t.getLayout().x
- }).sortKeys(vd).entries(t).map(function(t) {
- return t.values
- });
- ad(t, a, e, i, n),
- rd(a, n, i);
- for (var r = 1; o > 0; o--)
- sd(a, r *= .99),
- rd(a, n, i),
- hd(a, r),
- rd(a, n, i)
- }
- function ad(t, e, i, n, o) {
- var a = [];
- c(e, function(t) {
- var e = t.length
- , i = 0;
- c(t, function(t) {
- i += t.getLayout().value
- });
- var r = (n - (e - 1) * o) / i;
- a.push(r)
- }),
- a.sort(function(t, e) {
- return t - e
- });
- var r = a[0];
- c(e, function(t) {
- c(t, function(t, e) {
- t.setLayout({
- y: e
- }, !0);
- var i = t.getLayout().value * r;
- t.setLayout({
- dy: i
- }, !0)
- })
- }),
- c(i, function(t) {
- var e = +t.getValue() * r;
- t.setLayout({
- dy: e
- }, !0)
- })
- }
- function rd(t, e, i) {
- c(t, function(t) {
- var n, o, a, r = 0, s = t.length;
- for (t.sort(md),
- a = 0; a < s; a++) {
- if (n = t[a],
- (o = r - n.getLayout().y) > 0) {
- l = n.getLayout().y + o;
- n.setLayout({
- y: l
- }, !0)
- }
- r = n.getLayout().y + n.getLayout().dy + e
- }
- if ((o = r - e - i) > 0) {
- var l = n.getLayout().y - o;
- for (n.setLayout({
- y: l
- }, !0),
- r = n.getLayout().y,
- a = s - 2; a >= 0; --a)
- (o = (n = t[a]).getLayout().y + n.getLayout().dy + e - r) > 0 && (l = n.getLayout().y - o,
- n.setLayout({
- y: l
- }, !0)),
- r = n.getLayout().y
- }
- })
- }
- function sd(t, e) {
- c(t.slice().reverse(), function(t) {
- c(t, function(t) {
- if (t.outEdges.length) {
- var i = gd(t.outEdges, ld) / gd(t.outEdges, yd)
- , n = t.getLayout().y + (i - pd(t)) * e;
- t.setLayout({
- y: n
- }, !0)
- }
- })
- })
- }
- function ld(t) {
- return pd(t.node2) * t.getValue()
- }
- function hd(t, e) {
- c(t, function(t) {
- c(t, function(t) {
- if (t.inEdges.length) {
- var i = gd(t.inEdges, ud) / gd(t.inEdges, yd)
- , n = t.getLayout().y + (i - pd(t)) * e;
- t.setLayout({
- y: n
- }, !0)
- }
- })
- })
- }
- function ud(t) {
- return pd(t.node1) * t.getValue()
- }
- function cd(t) {
- c(t, function(t) {
- t.outEdges.sort(dd),
- t.inEdges.sort(fd)
- }),
- c(t, function(t) {
- var e = 0
- , i = 0;
- c(t.outEdges, function(t) {
- t.setLayout({
- sy: e
- }, !0),
- e += t.getLayout().dy
- }),
- c(t.inEdges, function(t) {
- t.setLayout({
- ty: i
- }, !0),
- i += t.getLayout().dy
- })
- })
- }
- function dd(t, e) {
- return t.node2.getLayout().y - e.node2.getLayout().y
- }
- function fd(t, e) {
- return t.node1.getLayout().y - e.node1.getLayout().y
- }
- function gd(t, e) {
- for (var i = 0, n = t.length, o = -1; ++o < n; ) {
- var a = +e.call(t, t[o], o);
- isNaN(a) || (i += a)
- }
- return i
- }
- function pd(t) {
- return t.getLayout().y + t.getLayout().dy / 2
- }
- function md(t, e) {
- return t.getLayout().y - e.getLayout().y
- }
- function vd(t, e) {
- return t < e ? -1 : t > e ? 1 : t === e ? 0 : NaN
- }
- function yd(t) {
- return t.getValue()
- }
- function xd(t, e, i, n) {
- $y.call(this),
- this.bodyIndex,
- this.whiskerIndex,
- this.styleUpdater = i,
- this._createContent(t, e, n),
- this.updateData(t, e, n),
- this._seriesModel
- }
- function _d(t, e, i) {
- return d(t, function(t) {
- return t = t.slice(),
- t[e] = i.initBaseline,
- t
- })
- }
- function bd(t) {
- var e = {};
- return c(t, function(t, i) {
- e["ends" + i] = t
- }),
- e
- }
- function wd(t) {
- this.group = new $y,
- this.styleUpdater = t
- }
- function Sd(t, e, i) {
- var n = e.getItemModel(i)
- , o = n.getModel(MA)
- , a = e.getItemVisual(i, "color")
- , r = o.getItemStyle(["borderColor"])
- , s = t.childAt(t.whiskerIndex);
- s.style.set(r),
- s.style.stroke = a,
- s.dirty();
- var l = t.childAt(t.bodyIndex);
- l.style.set(r),
- l.style.stroke = a,
- l.dirty(),
- lo(t, n.getModel(IA).getItemStyle())
- }
- function Md(t) {
- var e = []
- , i = [];
- return t.eachSeriesByType("boxplot", function(t) {
- var n = t.getBaseAxis()
- , o = s(i, n);
- o < 0 && (o = i.length,
- i[o] = n,
- e[o] = {
- axis: n,
- seriesModels: []
- }),
- e[o].seriesModels.push(t)
- }),
- e
- }
- function Id(t) {
- var e, i, n = t.axis, o = t.seriesModels, a = o.length, r = t.boxWidthList = [], s = t.boxOffsetList = [], l = [];
- if ("category" === n.type)
- i = n.getBandWidth();
- else {
- var h = 0;
- AA(o, function(t) {
- h = Math.max(h, t.getData().count())
- }),
- e = n.getExtent(),
- Math.abs(e[1] - e[0])
- }
- AA(o, function(t) {
- var e = t.get("boxWidth");
- v(e) || (e = [e, e]),
- l.push([bi(e[0], i) || 0, bi(e[1], i) || 0])
- });
- var u = .8 * i - 2
- , c = u / a * .3
- , d = (u - c * (a - 1)) / a
- , f = d / 2 - u / 2;
- AA(o, function(t, e) {
- s.push(f),
- f += c + d,
- r.push(Math.min(Math.max(d, l[e][0]), l[e][1]))
- })
- }
- function Td(t, e, i) {
- var n, o = t.coordinateSystem, a = t.getData(), r = i / 2, s = t.get("layout"), l = "horizontal" === s ? 0 : 1, h = 1 - l, u = ["x", "y"], d = [];
- c(a.dimensions, function(t) {
- var e = a.getDimensionInfo(t).coordDim;
- e === u[h] ? d.push(t) : e === u[l] && (n = t)
- }),
- null == n || d.length < 5 || a.each([n].concat(d), function() {
- function t(t) {
- var i = [];
- i[l] = c,
- i[h] = t;
- var n;
- return isNaN(c) || isNaN(t) ? n = [NaN, NaN] : (n = o.dataToPoint(i))[l] += e,
- n
- }
- function i(t, e) {
- var i = t.slice()
- , n = t.slice();
- i[l] += r,
- n[l] -= r,
- e ? y.push(i, n) : y.push(n, i)
- }
- function n(t) {
- var e = [t.slice(), t.slice()];
- e[0][l] -= r,
- e[1][l] += r,
- v.push(e)
- }
- var u = arguments
- , c = u[0]
- , f = u[d.length + 1]
- , g = t(u[3])
- , p = t(u[1])
- , m = t(u[5])
- , v = [[p, t(u[2])], [m, t(u[4])]];
- n(p),
- n(m),
- n(g);
- var y = [];
- i(v[0][1], 0),
- i(v[1][1], 1),
- a.setItemLayout(f, {
- chartLayout: s,
- initBaseline: g[h],
- median: g,
- bodyEnds: y,
- whiskerEnds: v
- })
- })
- }
- function Ad(t, e, i) {
- var n = e.getItemModel(i)
- , o = n.getModel(CA)
- , a = e.getItemVisual(i, "color")
- , r = e.getItemVisual(i, "borderColor") || a
- , s = o.getItemStyle(["color", "color0", "borderColor", "borderColor0"])
- , l = t.childAt(t.whiskerIndex);
- l.useStyle(s),
- l.style.stroke = r;
- var h = t.childAt(t.bodyIndex);
- h.useStyle(s),
- h.style.fill = a,
- h.style.stroke = r,
- lo(t, n.getModel(DA).getItemStyle())
- }
- function Cd(t, e) {
- var i, n = t.getBaseAxis(), o = "category" === n.type ? n.getBandWidth() : (i = n.getExtent(),
- Math.abs(i[1] - i[0]) / e.count()), a = bi(zA(t.get("barMaxWidth"), o), o), r = bi(zA(t.get("barMinWidth"), 1), o), s = t.get("barWidth");
- return null != s ? bi(s, o) : Math.max(Math.min(o / 2, a), r)
- }
- function Dd(t) {
- return v(t) || (t = [+t, +t]),
- t
- }
- function Ld(t, e) {
- t.eachChild(function(t) {
- t.attr({
- z: e.z,
- zlevel: e.zlevel,
- style: {
- stroke: "stroke" === e.brushType ? e.color : null,
- fill: "fill" === e.brushType ? e.color : null
- }
- })
- })
- }
- function kd(t, e) {
- $y.call(this);
- var i = new Kr(t,e)
- , n = new $y;
- this.add(i),
- this.add(n),
- n.beforeUpdate = function() {
- this.attr(i.getScale())
- }
- ,
- this.updateData(t, e)
- }
- function Pd(t) {
- var e = t.data;
- e && e[0] && e[0][0] && e[0][0].coord && (t.data = d(e, function(t) {
- var e = {
- coords: [t[0].coord, t[1].coord]
- };
- return t[0].name && (e.fromName = t[0].name),
- t[1].name && (e.toName = t[1].name),
- n([e, t[0], t[1]])
- }))
- }
- function Od(t, e, i) {
- $y.call(this),
- this.add(this.createLine(t, e, i)),
- this._updateEffectSymbol(t, e)
- }
- function zd(t, e, i) {
- $y.call(this),
- this._createPolyline(t, e, i)
- }
- function Nd(t, e, i) {
- Od.call(this, t, e, i),
- this._lastFrame = 0,
- this._lastFramePercent = 0
- }
- function Ed() {
- this.group = new $y,
- this._lineEl = new GA
- }
- function Rd(t) {
- return t instanceof Array || (t = [t, t]),
- t
- }
- function Vd() {
- var t = ay();
- this.canvas = t,
- this.blurSize = 30,
- this.pointSize = 20,
- this.maxOpacity = 1,
- this.minOpacity = 0,
- this._gradientPixels = {}
- }
- function Bd(t, e, i) {
- var n = t[1] - t[0]
- , o = (e = d(e, function(e) {
- return {
- interval: [(e.interval[0] - t[0]) / n, (e.interval[1] - t[0]) / n]
- }
- })).length
- , a = 0;
- return function(t) {
- for (n = a; n < o; n++)
- if ((r = e[n].interval)[0] <= t && t <= r[1]) {
- a = n;
- break
- }
- if (n === o)
- for (var n = a - 1; n >= 0; n--) {
- var r = e[n].interval;
- if (r[0] <= t && t <= r[1]) {
- a = n;
- break
- }
- }
- return n >= 0 && n < o && i[n]
- }
- }
- function Gd(t, e) {
- var i = t[1] - t[0];
- return e = [(e[0] - t[0]) / i, (e[1] - t[0]) / i],
- function(t) {
- return t >= e[0] && t <= e[1]
- }
- }
- function Wd(t) {
- var e = t.dimensions;
- return "lng" === e[0] && "lat" === e[1]
- }
- function Hd(t, e, i, n) {
- var o = t.getItemLayout(e)
- , a = i.get("symbolRepeat")
- , r = i.get("symbolClip")
- , s = i.get("symbolPosition") || "start"
- , l = (i.get("symbolRotate") || 0) * Math.PI / 180 || 0
- , h = i.get("symbolPatternSize") || 2
- , u = i.isAnimationEnabled()
- , c = {
- dataIndex: e,
- layout: o,
- itemModel: i,
- symbolType: t.getItemVisual(e, "symbol") || "circle",
- color: t.getItemVisual(e, "color"),
- symbolClip: r,
- symbolRepeat: a,
- symbolRepeatDirection: i.get("symbolRepeatDirection"),
- symbolPatternSize: h,
- rotation: l,
- animationModel: u ? i : null,
- hoverAnimation: u && i.get("hoverAnimation"),
- z2: i.getShallow("z", !0) || 0
- };
- Fd(i, a, o, n, c),
- Ud(t, e, o, a, r, c.boundingLength, c.pxSign, h, n, c),
- jd(i, c.symbolScale, l, n, c);
- var d = c.symbolSize
- , f = i.get("symbolOffset");
- return v(f) && (f = [bi(f[0], d[0]), bi(f[1], d[1])]),
- Xd(i, d, o, a, r, f, s, c.valueLineWidth, c.boundingLength, c.repeatCutLength, n, c),
- c
- }
- function Fd(t, e, i, n, o) {
- var a, r = n.valueDim, s = t.get("symbolBoundingData"), l = n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()), h = l.toGlobalCoord(l.dataToCoord(0)), u = 1 - +(i[r.wh] <= 0);
- if (v(s)) {
- var c = [Zd(l, s[0]) - h, Zd(l, s[1]) - h];
- c[1] < c[0] && c.reverse(),
- a = c[u]
- } else
- a = null != s ? Zd(l, s) - h : e ? n.coordSysExtent[r.index][u] - h : i[r.wh];
- o.boundingLength = a,
- e && (o.repeatCutLength = i[r.wh]),
- o.pxSign = a > 0 ? 1 : a < 0 ? -1 : 0
- }
- function Zd(t, e) {
- return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))
- }
- function Ud(t, e, i, n, o, a, r, s, l, h) {
- var u = l.valueDim
- , c = l.categoryDim
- , d = Math.abs(i[c.wh])
- , f = t.getItemVisual(e, "symbolSize");
- v(f) ? f = f.slice() : (null == f && (f = "100%"),
- f = [f, f]),
- f[c.index] = bi(f[c.index], d),
- f[u.index] = bi(f[u.index], n ? d : Math.abs(a)),
- h.symbolSize = f,
- (h.symbolScale = [f[0] / s, f[1] / s])[u.index] *= (l.isHorizontal ? -1 : 1) * r
- }
- function jd(t, e, i, n, o) {
- var a = t.get(FA) || 0;
- a && (UA.attr({
- scale: e.slice(),
- rotation: i
- }),
- UA.updateTransform(),
- a /= UA.getLineScale(),
- a *= e[n.valueDim.index]),
- o.valueLineWidth = a
- }
- function Xd(t, e, i, n, a, r, s, l, h, u, c, d) {
- var f = c.categoryDim
- , g = c.valueDim
- , p = d.pxSign
- , m = Math.max(e[g.index] + l, 0)
- , v = m;
- if (n) {
- var y = Math.abs(h)
- , x = M(t.get("symbolMargin"), "15%") + ""
- , _ = !1;
- x.lastIndexOf("!") === x.length - 1 && (_ = !0,
- x = x.slice(0, x.length - 1)),
- x = bi(x, e[g.index]);
- var b = Math.max(m + 2 * x, 0)
- , w = _ ? 0 : 2 * x
- , S = Ni(n)
- , I = S ? n : cf((y + w) / b);
- b = m + 2 * (x = (y - I * m) / 2 / (_ ? I : I - 1)),
- w = _ ? 0 : 2 * x,
- S || "fixed" === n || (I = u ? cf((Math.abs(u) + w) / b) : 0),
- v = I * b - w,
- d.repeatTimes = I,
- d.symbolMargin = x
- }
- var T = p * (v / 2)
- , A = d.pathPosition = [];
- A[f.index] = i[f.wh] / 2,
- A[g.index] = "start" === s ? T : "end" === s ? h - T : h / 2,
- r && (A[0] += r[0],
- A[1] += r[1]);
- var C = d.bundlePosition = [];
- C[f.index] = i[f.xy],
- C[g.index] = i[g.xy];
- var D = d.barRectShape = o({}, i);
- D[g.wh] = p * Math.max(Math.abs(i[g.wh]), Math.abs(A[g.index] + T)),
- D[f.wh] = i[f.wh];
- var L = d.clipShape = {};
- L[f.xy] = -i[f.xy],
- L[f.wh] = c.ecSize[f.wh],
- L[g.xy] = 0,
- L[g.wh] = i[g.wh]
- }
- function qd(t) {
- var e = t.symbolPatternSize
- , i = Gr(t.symbolType, -e / 2, -e / 2, e, e, t.color);
- return i.attr({
- culling: !0
- }),
- "image" !== i.type && i.setStyle({
- strokeNoScale: !0
- }),
- i
- }
- function Yd(t, e, i, n) {
- function o(t) {
- var e = l.slice()
- , n = i.pxSign
- , o = t;
- return ("start" === i.symbolRepeatDirection ? n > 0 : n < 0) && (o = u - 1 - t),
- e[h.index] = d * (o - u / 2 + .5) + l[h.index],
- {
- position: e,
- scale: i.symbolScale.slice(),
- rotation: i.rotation
- }
- }
- var a = t.__pictorialBundle
- , r = i.symbolSize
- , s = i.valueLineWidth
- , l = i.pathPosition
- , h = e.valueDim
- , u = i.repeatTimes || 0
- , c = 0
- , d = r[e.valueDim.index] + s + 2 * i.symbolMargin;
- for (lf(t, function(t) {
- t.__pictorialAnimationIndex = c,
- t.__pictorialRepeatTimes = u,
- c < u ? hf(t, null, o(c), i, n) : hf(t, null, {
- scale: [0, 0]
- }, i, n, function() {
- a.remove(t)
- }),
- nf(t, i),
- c++
- }); c < u; c++) {
- var f = qd(i);
- f.__pictorialAnimationIndex = c,
- f.__pictorialRepeatTimes = u,
- a.add(f);
- var g = o(c);
- hf(f, {
- position: g.position,
- scale: [0, 0]
- }, {
- scale: g.scale,
- rotation: g.rotation
- }, i, n),
- f.on("mouseover", function() {
- lf(t, function(t) {
- t.trigger("emphasis")
- })
- }).on("mouseout", function() {
- lf(t, function(t) {
- t.trigger("normal")
- })
- }),
- nf(f, i)
- }
- }
- function $d(t, e, i, n) {
- var o = t.__pictorialBundle
- , a = t.__pictorialMainPath;
- a ? hf(a, null, {
- position: i.pathPosition.slice(),
- scale: i.symbolScale.slice(),
- rotation: i.rotation
- }, i, n) : (a = t.__pictorialMainPath = qd(i),
- o.add(a),
- hf(a, {
- position: i.pathPosition.slice(),
- scale: [0, 0],
- rotation: i.rotation
- }, {
- scale: i.symbolScale.slice()
- }, i, n),
- a.on("mouseover", function() {
- this.trigger("emphasis")
- }).on("mouseout", function() {
- this.trigger("normal")
- })),
- nf(a, i)
- }
- function Kd(t, e, i) {
- var n = o({}, e.barRectShape)
- , a = t.__pictorialBarRect;
- a ? hf(a, null, {
- shape: n
- }, e, i) : (a = t.__pictorialBarRect = new pb({
- z2: 2,
- shape: n,
- silent: !0,
- style: {
- stroke: "transparent",
- fill: "transparent",
- lineWidth: 0
- }
- }),
- t.add(a))
- }
- function Jd(t, e, i, n) {
- if (i.symbolClip) {
- var a = t.__pictorialClipPath
- , r = o({}, i.clipShape)
- , s = e.valueDim
- , l = i.animationModel
- , h = i.dataIndex;
- if (a)
- _o(a, {
- shape: r
- }, l, h);
- else {
- r[s.wh] = 0,
- a = new pb({
- shape: r
- }),
- t.__pictorialBundle.setClipPath(a),
- t.__pictorialClipPath = a;
- var u = {};
- u[s.wh] = i.clipShape[s.wh],
- Db[n ? "updateProps" : "initProps"](a, {
- shape: u
- }, l, h)
- }
- }
- }
- function Qd(t, e) {
- var i = t.getItemModel(e);
- return i.getAnimationDelayParams = tf,
- i.isAnimationEnabled = ef,
- i
- }
- function tf(t) {
- return {
- index: t.__pictorialAnimationIndex,
- count: t.__pictorialRepeatTimes
- }
- }
- function ef() {
- return this.parentModel.isAnimationEnabled() && !!this.getShallow("animation")
- }
- function nf(t, e) {
- t.off("emphasis").off("normal");
- var i = e.symbolScale.slice();
- e.hoverAnimation && t.on("emphasis", function() {
- this.animateTo({
- scale: [1.1 * i[0], 1.1 * i[1]]
- }, 400, "elasticOut")
- }).on("normal", function() {
- this.animateTo({
- scale: i.slice()
- }, 400, "elasticOut")
- })
- }
- function of(t, e, i, n) {
- var o = new $y
- , a = new $y;
- return o.add(a),
- o.__pictorialBundle = a,
- a.attr("position", i.bundlePosition.slice()),
- i.symbolRepeat ? Yd(o, e, i) : $d(o, e, i),
- Kd(o, i, n),
- Jd(o, e, i, n),
- o.__pictorialShapeStr = sf(t, i),
- o.__pictorialSymbolMeta = i,
- o
- }
- function af(t, e, i) {
- var n = i.animationModel
- , o = i.dataIndex;
- _o(t.__pictorialBundle, {
- position: i.bundlePosition.slice()
- }, n, o),
- i.symbolRepeat ? Yd(t, e, i, !0) : $d(t, e, i, !0),
- Kd(t, i, !0),
- Jd(t, e, i, !0)
- }
- function rf(t, e, i, n) {
- var o = n.__pictorialBarRect;
- o && (o.style.text = null);
- var a = [];
- lf(n, function(t) {
- a.push(t)
- }),
- n.__pictorialMainPath && a.push(n.__pictorialMainPath),
- n.__pictorialClipPath && (i = null),
- c(a, function(t) {
- _o(t, {
- scale: [0, 0]
- }, i, e, function() {
- n.parent && n.parent.remove(n)
- })
- }),
- t.setItemGraphicEl(e, null)
- }
- function sf(t, e) {
- return [t.getItemVisual(e.dataIndex, "symbol") || "none", !!e.symbolRepeat, !!e.symbolClip].join(":")
- }
- function lf(t, e, i) {
- c(t.__pictorialBundle.children(), function(n) {
- n !== t.__pictorialBarRect && e.call(i, n)
- })
- }
- function hf(t, e, i, n, o, a) {
- e && t.attr(e),
- n.symbolClip && !o ? i && t.attr(i) : i && Db[o ? "updateProps" : "initProps"](t, i, n.animationModel, n.dataIndex, a)
- }
- function uf(t, e, i) {
- var n = i.color
- , o = i.dataIndex
- , r = i.itemModel
- , s = r.getModel("itemStyle.normal").getItemStyle(["color"])
- , l = r.getModel("itemStyle.emphasis").getItemStyle()
- , h = r.getShallow("cursor");
- lf(t, function(t) {
- t.setColor(n),
- t.setStyle(a({
- fill: n,
- opacity: i.opacity
- }, s)),
- lo(t, l),
- h && (t.cursor = h),
- t.z2 = i.z2
- });
- var u = {}
- , c = e.valueDim.posDesc[+(i.boundingLength > 0)]
- , d = t.__pictorialBarRect;
- nl(d.style, u, r, n, e.seriesModel, o, c),
- lo(d, u)
- }
- function cf(t) {
- var e = Math.round(t);
- return Math.abs(t - e) < 1e-4 ? e : Math.ceil(t)
- }
- function df(t, e, i) {
- this.dimension = "single",
- this.dimensions = ["single"],
- this._axis = null,
- this._rect,
- this._init(t, e, i),
- this.model = t
- }
- function ff(t, e) {
- e = e || {};
- var i = t.coordinateSystem
- , n = t.axis
- , o = {}
- , a = n.position
- , r = n.orient
- , s = i.getRect()
- , l = [s.x, s.x + s.width, s.y, s.y + s.height]
- , h = {
- horizontal: {
- top: l[2],
- bottom: l[3]
- },
- vertical: {
- left: l[0],
- right: l[1]
- }
- };
- o.position = ["vertical" === r ? h.vertical[a] : l[0], "horizontal" === r ? h.horizontal[a] : l[3]];
- var u = {
- horizontal: 0,
- vertical: 1
- };
- o.rotation = Math.PI / 2 * u[r];
- var c = {
- top: -1,
- bottom: 1,
- right: 1,
- left: -1
- };
- o.labelDirection = o.tickDirection = o.nameDirection = c[a],
- t.get("axisTick.inside") && (o.tickDirection = -o.tickDirection),
- M(e.labelInside, t.get("axisLabel.inside")) && (o.labelDirection = -o.labelDirection);
- var d = e.rotate;
- return null == d && (d = t.get("axisLabel.rotate")),
- o.labelRotation = "top" === a ? -d : d,
- o.labelInterval = n.getLabelInterval(),
- o.z2 = 1,
- o
- }
- function gf(t, e, i, n, a) {
- var r = t.axis;
- if (!r.scale.isBlank() && r.containData(e))
- if (t.involveSeries) {
- var s = pf(e, t)
- , l = s.payloadBatch
- , h = s.snapToValue;
- l[0] && null == a.seriesIndex && o(a, l[0]),
- !n && t.snap && r.containData(h) && null != h && (e = h),
- i.showPointer(t, e, l, a),
- i.showTooltip(t, s, h)
- } else
- i.showPointer(t, e)
- }
- function pf(t, e) {
- var i = e.axis
- , n = i.dim
- , o = t
- , a = []
- , r = Number.MAX_VALUE
- , s = -1;
- return tC(e.seriesModels, function(e, l) {
- var h, u, c = e.coordDimToDataDim(n);
- if (e.getAxisTooltipData) {
- var d = e.getAxisTooltipData(c, t, i);
- u = d.dataIndices,
- h = d.nestestValue
- } else {
- if (!(u = e.getData().indicesOfNearest(c[0], t, !1, "category" === i.type ? .5 : null)).length)
- return;
- h = e.getData().get(c[0], u[0])
- }
- if (null != h && isFinite(h)) {
- var f = t - h
- , g = Math.abs(f);
- g <= r && ((g < r || f >= 0 && s < 0) && (r = g,
- s = f,
- o = h,
- a.length = 0),
- tC(u, function(t) {
- a.push({
- seriesIndex: e.seriesIndex,
- dataIndexInside: t,
- dataIndex: e.getData().getRawIndex(t)
- })
- }))
- }
- }),
- {
- payloadBatch: a,
- snapToValue: o
- }
- }
- function mf(t, e, i, n) {
- t[e.key] = {
- value: i,
- payloadBatch: n
- }
- }
- function vf(t, e, i, n) {
- var o = i.payloadBatch
- , a = e.axis
- , r = a.model
- , s = e.axisPointerModel;
- if (e.triggerTooltip && o.length) {
- var l = e.coordSys.model
- , h = qs(l)
- , u = t.map[h];
- u || (u = t.map[h] = {
- coordSysId: l.id,
- coordSysIndex: l.componentIndex,
- coordSysType: l.type,
- coordSysMainType: l.mainType,
- dataByAxis: []
- },
- t.list.push(u)),
- u.dataByAxis.push({
- axisDim: a.dim,
- axisIndex: r.componentIndex,
- axisType: r.type,
- axisId: r.id,
- value: n,
- valueLabelOpt: {
- precision: s.get("label.precision"),
- formatter: s.get("label.formatter")
- },
- seriesDataIndices: o.slice()
- })
- }
- }
- function yf(t, e, i) {
- var n = i.axesInfo = [];
- tC(e, function(e, i) {
- var o = e.axisPointerModel.option
- , a = t[i];
- a ? (!e.useHandle && (o.status = "show"),
- o.value = a.value,
- o.seriesDataIndices = (a.payloadBatch || []).slice()) : !e.useHandle && (o.status = "hide"),
- "show" === o.status && n.push({
- axisDim: e.axis.dim,
- axisIndex: e.axis.model.componentIndex,
- value: o.value
- })
- })
- }
- function xf(t, e, i, n) {
- if (!Sf(e) && t.list.length) {
- var o = ((t.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};
- n({
- type: "showTip",
- escapeConnect: !0,
- x: e[0],
- y: e[1],
- tooltipOption: i.tooltipOption,
- position: i.position,
- dataIndexInside: o.dataIndexInside,
- dataIndex: o.dataIndex,
- seriesIndex: o.seriesIndex,
- dataByCoordSys: t.list
- })
- } else
- n({
- type: "hideTip"
- })
- }
- function _f(t, e, i) {
- var n = i.getZr()
- , o = iC(n).axisPointerLastHighlights || {}
- , a = iC(n).axisPointerLastHighlights = {};
- tC(t, function(t, e) {
- var i = t.axisPointerModel.option;
- "show" === i.status && tC(i.seriesDataIndices, function(t) {
- var e = t.seriesIndex + " | " + t.dataIndex;
- a[e] = t
- })
- });
- var r = []
- , s = [];
- c(o, function(t, e) {
- !a[e] && s.push(t)
- }),
- c(a, function(t, e) {
- !o[e] && r.push(t)
- }),
- s.length && i.dispatchAction({
- type: "downplay",
- escapeConnect: !0,
- batch: s
- }),
- r.length && i.dispatchAction({
- type: "highlight",
- escapeConnect: !0,
- batch: r
- })
- }
- function bf(t, e) {
- for (var i = 0; i < (t || []).length; i++) {
- var n = t[i];
- if (e.axis.dim === n.axisDim && e.axis.model.componentIndex === n.axisIndex)
- return n
- }
- }
- function wf(t) {
- var e = t.axis.model
- , i = {}
- , n = i.axisDim = t.axis.dim;
- return i.axisIndex = i[n + "AxisIndex"] = e.componentIndex,
- i.axisName = i[n + "AxisName"] = e.name,
- i.axisId = i[n + "AxisId"] = e.id,
- i
- }
- function Sf(t) {
- return !t || null == t[0] || isNaN(t[0]) || null == t[1] || isNaN(t[1])
- }
- function Mf(t, e, i) {
- if (!Yv.node) {
- var n = e.getZr();
- nC(n).records || (nC(n).records = {}),
- If(n, e),
- (nC(n).records[t] || (nC(n).records[t] = {})).handler = i
- }
- }
- function If(t, e) {
- function i(i, n) {
- t.on(i, function(i) {
- var o = Df(e);
- oC(nC(t).records, function(t) {
- t && n(t, i, o.dispatchAction)
- }),
- Tf(o.pendings, e)
- })
- }
- nC(t).initialized || (nC(t).initialized = !0,
- i("click", m(Cf, "click")),
- i("mousemove", m(Cf, "mousemove")),
- i("globalout", Af))
- }
- function Tf(t, e) {
- var i, n = t.showTip.length, o = t.hideTip.length;
- n ? i = t.showTip[n - 1] : o && (i = t.hideTip[o - 1]),
- i && (i.dispatchAction = null,
- e.dispatchAction(i))
- }
- function Af(t, e, i) {
- t.handler("leave", null, i)
- }
- function Cf(t, e, i, n) {
- e.handler(t, i, n)
- }
- function Df(t) {
- var e = {
- showTip: [],
- hideTip: []
- }
- , i = function(n) {
- var o = e[n.type];
- o ? o.push(n) : (n.dispatchAction = i,
- t.dispatchAction(n))
- };
- return {
- dispatchAction: i,
- pendings: e
- }
- }
- function Lf(t, e) {
- if (!Yv.node) {
- var i = e.getZr();
- (nC(i).records || {})[t] && (nC(i).records[t] = null)
- }
- }
- function kf() {}
- function Pf(t, e, i, n) {
- Of(rC(i).lastProp, n) || (rC(i).lastProp = n,
- e ? _o(i, n, t) : (i.stopAnimation(),
- i.attr(n)))
- }
- function Of(t, e) {
- if (_(t) && _(e)) {
- var i = !0;
- return c(e, function(e, n) {
- i = i && Of(t[n], e)
- }),
- !!i
- }
- return t === e
- }
- function zf(t, e) {
- t[e.get("label.show") ? "show" : "hide"]()
- }
- function Nf(t) {
- return {
- position: t.position.slice(),
- rotation: t.rotation || 0
- }
- }
- function Ef(t, e, i) {
- var n = e.get("z")
- , o = e.get("zlevel");
- t && t.traverse(function(t) {
- "group" !== t.type && (null != n && (t.z = n),
- null != o && (t.zlevel = o),
- t.silent = i)
- })
- }
- function Rf(t) {
- var e, i = t.get("type"), n = t.getModel(i + "Style");
- return "line" === i ? (e = n.getLineStyle()).fill = null : "shadow" === i && ((e = n.getAreaStyle()).stroke = null),
- e
- }
- function Vf(t, e, i, n, o) {
- var a = Gf(i.get("value"), e.axis, e.ecModel, i.get("seriesDataIndices"), {
- precision: i.get("label.precision"),
- formatter: i.get("label.formatter")
- })
- , r = i.getModel("label")
- , s = Ux(r.get("padding") || 0)
- , l = r.getFont()
- , h = ce(a, l)
- , u = o.position
- , c = h.width + s[1] + s[3]
- , d = h.height + s[0] + s[2]
- , f = o.align;
- "right" === f && (u[0] -= c),
- "center" === f && (u[0] -= c / 2);
- var g = o.verticalAlign;
- "bottom" === g && (u[1] -= d),
- "middle" === g && (u[1] -= d / 2),
- Bf(u, c, d, n);
- var p = r.get("backgroundColor");
- p && "auto" !== p || (p = e.get("axisLine.lineStyle.color")),
- t.label = {
- shape: {
- x: 0,
- y: 0,
- width: c,
- height: d,
- r: r.get("borderRadius")
- },
- position: u.slice(),
- style: {
- text: a,
- textFont: l,
- textFill: r.getTextColor(),
- textPosition: "inside",
- fill: p,
- stroke: r.get("borderColor") || "transparent",
- lineWidth: r.get("borderWidth") || 0,
- shadowBlur: r.get("shadowBlur"),
- shadowColor: r.get("shadowColor"),
- shadowOffsetX: r.get("shadowOffsetX"),
- shadowOffsetY: r.get("shadowOffsetY")
- },
- z2: 10
- }
- }
- function Bf(t, e, i, n) {
- var o = n.getWidth()
- , a = n.getHeight();
- t[0] = Math.min(t[0] + e, o) - e,
- t[1] = Math.min(t[1] + i, a) - i,
- t[0] = Math.max(t[0], 0),
- t[1] = Math.max(t[1], 0)
- }
- function Gf(t, e, i, n, o) {
- var a = e.scale.getLabel(t, {
- precision: o.precision
- })
- , r = o.formatter;
- if (r) {
- var s = {
- value: Rr(e, t),
- seriesData: []
- };
- c(n, function(t) {
- var e = i.getSeriesByIndex(t.seriesIndex)
- , n = t.dataIndexInside
- , o = e && e.getDataParams(n);
- o && s.seriesData.push(o)
- }),
- x(r) ? a = r.replace("{value}", a) : y(r) && (a = r(s))
- }
- return a
- }
- function Wf(t, e, i) {
- var n = nt();
- return lt(n, n, i.rotation),
- st(n, n, i.position),
- So([t.dataToCoord(e), (i.labelOffset || 0) + (i.labelDirection || 1) * (i.labelMargin || 0)], n)
- }
- function Hf(t, e, i, n, o, a) {
- var r = zM.innerTextLayout(i.rotation, 0, i.labelDirection);
- i.labelMargin = o.get("label.margin"),
- Vf(e, n, o, a, {
- position: Wf(n.axis, t, i),
- align: r.textAlign,
- verticalAlign: r.textVerticalAlign
- })
- }
- function Ff(t, e, i) {
- return i = i || 0,
- {
- x1: t[i],
- y1: t[1 - i],
- x2: e[i],
- y2: e[1 - i]
- }
- }
- function Zf(t, e, i) {
- return i = i || 0,
- {
- x: t[i],
- y: t[1 - i],
- width: e[i],
- height: e[1 - i]
- }
- }
- function Uf(t, e, i, n, o, a) {
- return {
- cx: t,
- cy: e,
- r0: i,
- r: n,
- startAngle: o,
- endAngle: a,
- clockwise: !0
- }
- }
- function jf(t, e) {
- var i = {};
- return i[e.dim + "AxisIndex"] = e.index,
- t.getCartesian(i)
- }
- function Xf(t) {
- return "x" === t.dim ? 0 : 1
- }
- function qf(t) {
- return t.isHorizontal() ? 0 : 1
- }
- function Yf(t, e) {
- var i = t.getRect();
- return [i[cC[e]], i[cC[e]] + i[dC[e]]]
- }
- function $f(t, e, i) {
- var n = new pb({
- shape: {
- x: t.x - 10,
- y: t.y - 10,
- width: 0,
- height: t.height + 20
- }
- });
- return bo(n, {
- shape: {
- width: t.width + 20,
- height: t.height + 20
- }
- }, e, i),
- n
- }
- function Kf(t, e, i) {
- if (t.count())
- for (var n, o = e.coordinateSystem, a = e.getLayerSeries(), r = d(a, function(e) {
- return d(e.indices, function(e) {
- var i = o.dataToPoint(t.get("time", e));
- return i[1] = t.get("value", e),
- i
- })
- }), s = Jf(r), l = s.y0, h = i / s.max, u = a.length, c = a[0].indices.length, f = 0; f < c; ++f) {
- n = l[f] * h,
- t.setItemLayout(a[0].indices[f], {
- layerIndex: 0,
- x: r[0][f][0],
- y0: n,
- y: r[0][f][1] * h
- });
- for (var g = 1; g < u; ++g)
- n += r[g - 1][f][1] * h,
- t.setItemLayout(a[g].indices[f], {
- layerIndex: g,
- x: r[g][f][0],
- y0: n,
- y: r[g][f][1] * h
- })
- }
- }
- function Jf(t) {
- for (var e = t.length, i = t[0].length, n = [], o = [], a = 0, r = {}, s = 0; s < i; ++s) {
- for (var l = 0, h = 0; l < e; ++l)
- h += t[l][s][1];
- h > a && (a = h),
- n.push(h)
- }
- for (var u = 0; u < i; ++u)
- o[u] = (a - n[u]) / 2;
- a = 0;
- for (var c = 0; c < i; ++c) {
- var d = n[c] + o[c];
- d > a && (a = d)
- }
- return r.y0 = o,
- r.max = a,
- r
- }
- function Qf(t, e) {
- return e = e || [0, 0],
- d(["x", "y"], function(i, n) {
- var o = this.getAxis(i)
- , a = e[n]
- , r = t[n] / 2;
- return "category" === o.type ? o.getBandWidth() : Math.abs(o.dataToCoord(a - r) - o.dataToCoord(a + r))
- }, this)
- }
- function tg(t, e) {
- return e = e || [0, 0],
- d([0, 1], function(i) {
- var n = e[i]
- , o = t[i] / 2
- , a = []
- , r = [];
- return a[i] = n - o,
- r[i] = n + o,
- a[1 - i] = r[1 - i] = e[1 - i],
- Math.abs(this.dataToPoint(a)[i] - this.dataToPoint(r)[i])
- }, this)
- }
- function eg(t, e) {
- var i = this.getAxis()
- , n = e instanceof Array ? e[0] : e
- , o = (t instanceof Array ? t[0] : t) / 2;
- return "category" === i.type ? i.getBandWidth() : Math.abs(i.dataToCoord(n - o) - i.dataToCoord(n + o))
- }
- function ig(t, e) {
- return d(["Radius", "Angle"], function(i, n) {
- var o = this["get" + i + "Axis"]()
- , a = e[n]
- , r = t[n] / 2
- , s = "dataTo" + i
- , l = "category" === o.type ? o.getBandWidth() : Math.abs(o[s](a - r) - o[s](a + r));
- return "Angle" === i && (l = l * Math.PI / 180),
- l
- }, this)
- }
- function ng(t) {
- var e, i = t.type;
- if ("path" === i) {
- var n = t.shape;
- (e = Fn(n.pathData, null, {
- x: n.x || 0,
- y: n.y || 0,
- width: n.width || 0,
- height: n.height || 0
- }, "center")).__customPathData = t.pathData
- } else if ("image" === i)
- (e = new je({})).__customImagePath = t.style.image;
- else if ("text" === i)
- (e = new ab({})).__customText = t.style.text;
- else {
- var o = Db[i.charAt(0).toUpperCase() + i.slice(1)];
- e = new o
- }
- return e.__customGraphicType = i,
- e.name = t.name,
- e
- }
- function og(t, i, n, o, a, r) {
- var s = {}
- , l = n.style || {};
- if (n.shape && (s.shape = e(n.shape)),
- n.position && (s.position = n.position.slice()),
- n.scale && (s.scale = n.scale.slice()),
- n.origin && (s.origin = n.origin.slice()),
- n.rotation && (s.rotation = n.rotation),
- "image" === t.type && n.style) {
- h = s.style = {};
- c(["x", "y", "width", "height"], function(e) {
- ag(e, h, l, t.style, r)
- })
- }
- if ("text" === t.type && n.style) {
- var h = s.style = {};
- c(["x", "y"], function(e) {
- ag(e, h, l, t.style, r)
- }),
- !l.hasOwnProperty("textFill") && l.fill && (l.textFill = l.fill),
- !l.hasOwnProperty("textStroke") && l.stroke && (l.textStroke = l.stroke)
- }
- if ("group" !== t.type && (t.useStyle(l),
- r)) {
- t.style.opacity = 0;
- var u = l.opacity;
- null == u && (u = 1),
- bo(t, {
- style: {
- opacity: u
- }
- }, o, i)
- }
- r ? t.attr(s) : _o(t, s, o, i),
- t.attr({
- z2: n.z2 || 0,
- silent: n.silent
- }),
- !1 !== n.styleEmphasis && lo(t, n.styleEmphasis)
- }
- function ag(t, e, i, n, o) {
- null == i[t] || o || (e[t] = i[t],
- i[t] = n[t])
- }
- function rg(t, e, i, n) {
- function r(t) {
- null == t && (t = u),
- y && (c = e.getItemModel(t),
- d = c.getModel(yC),
- f = c.getModel(xC),
- g = qr(e),
- p = e.getItemVisual(t, "color"),
- y = !1)
- }
- var s = t.get("renderItem")
- , l = t.coordinateSystem
- , h = {};
- l && (h = l.prepareCustoms ? l.prepareCustoms() : bC[l.type](l));
- var u, c, d, f, g, p, m = a({
- getWidth: n.getWidth,
- getHeight: n.getHeight,
- getZr: n.getZr,
- getDevicePixelRatio: n.getDevicePixelRatio,
- value: function(t, i) {
- return null == i && (i = u),
- e.get(e.getDimension(t || 0), i)
- },
- style: function(i, n) {
- null == n && (n = u),
- r(n);
- var a = c.getModel(mC).getItemStyle();
- null != p && (a.fill = p);
- var s = e.getItemVisual(n, "opacity");
- return null != s && (a.opacity = s),
- null != g && (uo(a, d, null, {
- autoColor: p,
- isRectText: !0
- }),
- a.text = d.getShallow("show") ? I(t.getFormattedLabel(n, "normal"), e.get(g, n)) : null),
- i && o(a, i),
- a
- },
- styleEmphasis: function(i, n) {
- null == n && (n = u),
- r(n);
- var a = c.getModel(vC).getItemStyle();
- return null != g && (uo(a, f, null, {
- isRectText: !0
- }, !0),
- a.text = f.getShallow("show") ? T(t.getFormattedLabel(n, "emphasis"), t.getFormattedLabel(n, "normal"), e.get(g, n)) : null),
- i && o(a, i),
- a
- },
- visual: function(t, i) {
- return null == i && (i = u),
- e.getItemVisual(i, t)
- },
- barLayout: function(t) {
- if (l.getBaseAxis) {
- var e = l.getBaseAxis();
- return il.getLayoutOnAxis(a({
- axis: e
- }, t), n)
- }
- },
- currentSeriesIndices: function() {
- return i.getCurrentSeriesIndices()
- },
- font: function(t) {
- return yo(t, i)
- }
- }, h.api || {}), v = {
- context: {},
- seriesId: t.id,
- seriesName: t.name,
- seriesIndex: t.seriesIndex,
- coordSys: h.coordSys,
- dataInsideLength: e.count(),
- encode: sg(t.getData())
- }, y = !0;
- return function(t) {
- return u = t,
- y = !0,
- s && s(a({
- dataIndexInside: t,
- dataIndex: e.getRawIndex(t)
- }, v), m) || {}
- }
- }
- function sg(t) {
- var e = {};
- return c(t.dimensions, function(i, n) {
- var o = t.getDimensionInfo(i);
- if (!o.isExtraCoord) {
- var a = o.coordDim;
- (e[a] = e[a] || [])[o.coordDimIndex] = n
- }
- }),
- e
- }
- function lg(t, e, i, n, o, a) {
- (t = hg(t, e, i, n, o, a)) && a.setItemGraphicEl(e, t)
- }
- function hg(t, e, i, n, o, a) {
- var r = i.type;
- if (!t || r === t.__customGraphicType || "path" === r && i.pathData === t.__customPathData || "image" === r && i.style.image === t.__customImagePath || "text" === r && i.style.text === t.__customText || (o.remove(t),
- t = null),
- null != r) {
- var s = !t;
- if (!t && (t = ng(i)),
- og(t, e, i, n, a, s),
- "group" === r) {
- var l = t.children() || []
- , h = i.children || [];
- if (i.diffChildrenByName)
- ug({
- oldChildren: l,
- newChildren: h,
- dataIndex: e,
- animatableModel: n,
- group: t,
- data: a
- });
- else {
- for (var u = 0; u < h.length; u++)
- hg(t.childAt(u), e, h[u], n, t, a);
- for (; u < l.length; u++)
- l[u] && t.remove(l[u])
- }
- }
- return o.add(t),
- t
- }
- }
- function ug(t) {
- new cr(t.oldChildren,t.newChildren,cg,cg,t).add(dg).update(dg).remove(fg).execute()
- }
- function cg(t, e) {
- var i = t && t.name;
- return null != i ? i : _C + e
- }
- function dg(t, e) {
- var i = this.context
- , n = null != t ? i.newChildren[t] : null;
- hg(null != e ? i.oldChildren[e] : null, i.dataIndex, n, i.animatableModel, i.group, i.data)
- }
- function fg(t) {
- var e = this.context
- , i = e.oldChildren[t];
- i && e.group.remove(i)
- }
- function gg(t, e, i, n) {
- var o = i.type
- , a = Db[o.charAt(0).toUpperCase() + o.slice(1)]
- , r = new a(i);
- e.add(r),
- n.set(t, r),
- r.__ecGraphicId = t
- }
- function pg(t, e) {
- var i = t && t.parent;
- i && ("group" === t.type && t.traverse(function(t) {
- pg(t, e)
- }),
- e.removeKey(t.__ecGraphicId),
- i.remove(t))
- }
- function mg(t) {
- return t = o({}, t),
- c(["id", "parentId", "$action", "hv", "bounding"].concat(Fb), function(e) {
- delete t[e]
- }),
- t
- }
- function vg(t, e) {
- var i;
- return c(e, function(e) {
- null != t[e] && "auto" !== t[e] && (i = !0)
- }),
- i
- }
- function yg(t, e) {
- var i = t.exist;
- if (e.id = t.keyInfo.id,
- !e.type && i && (e.type = i.type),
- null == e.parentId) {
- var n = e.parentOption;
- n ? e.parentId = n.id : i && (e.parentId = i.parentId)
- }
- e.parentOption = null
- }
- function xg(t, e, n) {
- var a = o({}, n)
- , r = t[e]
- , s = n.$action || "merge";
- if ("merge" === s)
- if (r) {
- i(r, a, !0),
- Jo(r, a, {
- ignoreSize: !0
- }),
- ta(n, r)
- } else
- t[e] = a;
- else
- "replace" === s ? t[e] = a : "remove" === s && r && (t[e] = null)
- }
- function _g(t, e) {
- t && (t.hv = e.hv = [vg(e, ["left", "right"]), vg(e, ["top", "bottom"])],
- "group" === t.type && (null == t.width && (t.width = e.width = 0),
- null == t.height && (t.height = e.height = 0)))
- }
- function bg(t, e, i) {
- var n, o = {}, a = "toggleSelected" === t;
- return i.eachComponent("legend", function(i) {
- a && null != n ? i[n ? "select" : "unSelect"](e.name) : (i[t](e.name),
- n = i.isSelected(e.name)),
- c(i.getData(), function(t) {
- var e = t.get("name");
- if ("\n" !== e && "" !== e) {
- var n = i.isSelected(e);
- o.hasOwnProperty(e) ? o[e] = o[e] && n : o[e] = n
- }
- })
- }),
- {
- name: e.name,
- selected: o
- }
- }
- function wg(t, e, i) {
- var n = e.getBoxLayoutParams()
- , o = e.get("padding")
- , a = {
- width: i.getWidth(),
- height: i.getHeight()
- }
- , r = Yo(n, a, o);
- Ub(e.get("orient"), t, e.get("itemGap"), r.width, r.height),
- $o(t, n, a, o)
- }
- function Sg(t, e) {
- var i = Ux(e.get("padding"))
- , n = e.getItemStyle(["color", "opacity"]);
- return n.fill = e.get("backgroundColor"),
- t = new pb({
- shape: {
- x: t.x - i[3],
- y: t.y - i[0],
- width: t.width + i[1] + i[3],
- height: t.height + i[0] + i[2],
- r: e.get("borderRadius")
- },
- style: n,
- silent: !0,
- z2: -1
- })
- }
- function Mg(t, e) {
- e.dispatchAction({
- type: "legendToggleSelect",
- name: t
- })
- }
- function Ig(t, e, i) {
- var n = i.getZr().storage.getDisplayList()[0];
- n && n.useHoverLayer || t.get("legendHoverLink") && i.dispatchAction({
- type: "highlight",
- seriesName: t.name,
- name: e
- })
- }
- function Tg(t, e, i) {
- var n = i.getZr().storage.getDisplayList()[0];
- n && n.useHoverLayer || t.get("legendHoverLink") && i.dispatchAction({
- type: "downplay",
- seriesName: t.name,
- name: e
- })
- }
- function Ag(t, e, i) {
- var n = [1, 1];
- n[t.getOrient().index] = 0,
- Jo(e, i, {
- type: "box",
- ignoreSize: n
- })
- }
- function Cg(t) {
- var e = "left " + t + "s cubic-bezier(0.23, 1, 0.32, 1),top " + t + "s cubic-bezier(0.23, 1, 0.32, 1)";
- return d(NC, function(t) {
- return t + "transition:" + e
- }).join(";")
- }
- function Dg(t) {
- var e = []
- , i = t.get("fontSize")
- , n = t.getTextColor();
- return n && e.push("color:" + n),
- e.push("font:" + t.getFont()),
- i && e.push("line-height:" + Math.round(3 * i / 2) + "px"),
- OC(["decoration", "align"], function(i) {
- var n = t.get(i);
- n && e.push("text-" + i + ":" + n)
- }),
- e.join(";")
- }
- function Lg(t) {
- var e = []
- , i = t.get("transitionDuration")
- , n = t.get("backgroundColor")
- , o = t.getModel("textStyle")
- , a = t.get("padding");
- return i && e.push(Cg(i)),
- n && (Yv.canvasSupported ? e.push("background-Color:" + n) : (e.push("background-Color:#" + At(n)),
- e.push("filter:alpha(opacity=70)"))),
- OC(["width", "color", "radius"], function(i) {
- var n = "border-" + i
- , o = zC(n)
- , a = t.get(o);
- null != a && e.push(n + ":" + a + ("color" === i ? "" : "px"))
- }),
- e.push(Dg(o)),
- null != a && e.push("padding:" + Ux(a).join("px ") + "px"),
- e.join(";") + ";"
- }
- function kg(t, e) {
- var i = document.createElement("div")
- , n = this._zr = e.getZr();
- this.el = i,
- this._x = e.getWidth() / 2,
- this._y = e.getHeight() / 2,
- t.appendChild(i),
- this._container = t,
- this._show = !1,
- this._hideTimeout;
- var o = this;
- i.onmouseenter = function() {
- o._enterable && (clearTimeout(o._hideTimeout),
- o._show = !0),
- o._inContent = !0
- }
- ,
- i.onmousemove = function(e) {
- if (e = e || window.event,
- !o._enterable) {
- var i = n.handler;
- oi(t, e, !0),
- i.dispatch("mousemove", e)
- }
- }
- ,
- i.onmouseleave = function() {
- o._enterable && o._show && o.hideLater(o._hideDelay),
- o._inContent = !1
- }
- }
- function Pg(t) {
- for (var e = t.pop(); t.length; ) {
- var i = t.pop();
- i && (i instanceof Co && (i = i.get("tooltip", !0)),
- "string" == typeof i && (i = {
- formatter: i
- }),
- e = new Co(i,e,e.ecModel))
- }
- return e
- }
- function Og(t, e) {
- return t.dispatchAction || p(e.dispatchAction, e)
- }
- function zg(t, e, i, n, o, a, r) {
- var s = Eg(i)
- , l = s.width
- , h = s.height;
- return null != a && (t + l + a > n ? t -= l + a : t += a),
- null != r && (e + h + r > o ? e -= h + r : e += r),
- [t, e]
- }
- function Ng(t, e, i, n, o) {
- var a = Eg(i)
- , r = a.width
- , s = a.height;
- return t = Math.min(t + r, n) - r,
- e = Math.min(e + s, o) - s,
- t = Math.max(t, 0),
- e = Math.max(e, 0),
- [t, e]
- }
- function Eg(t) {
- var e = t.clientWidth
- , i = t.clientHeight;
- if (document.defaultView && document.defaultView.getComputedStyle) {
- var n = document.defaultView.getComputedStyle(t);
- n && (e += parseInt(n.paddingLeft, 10) + parseInt(n.paddingRight, 10) + parseInt(n.borderLeftWidth, 10) + parseInt(n.borderRightWidth, 10),
- i += parseInt(n.paddingTop, 10) + parseInt(n.paddingBottom, 10) + parseInt(n.borderTopWidth, 10) + parseInt(n.borderBottomWidth, 10))
- }
- return {
- width: e,
- height: i
- }
- }
- function Rg(t, e, i) {
- var n = i[0]
- , o = i[1]
- , a = 0
- , r = 0
- , s = e.width
- , l = e.height;
- switch (t) {
- case "inside":
- a = e.x + s / 2 - n / 2,
- r = e.y + l / 2 - o / 2;
- break;
- case "top":
- a = e.x + s / 2 - n / 2,
- r = e.y - o - 5;
- break;
- case "bottom":
- a = e.x + s / 2 - n / 2,
- r = e.y + l + 5;
- break;
- case "left":
- a = e.x - n - 5,
- r = e.y + l / 2 - o / 2;
- break;
- case "right":
- a = e.x + s + 5,
- r = e.y + l / 2 - o / 2
- }
- return [a, r]
- }
- function Vg(t) {
- return "center" === t || "middle" === t
- }
- function Bg(t) {
- return t.get("stack") || "__ec_stack_" + t.seriesIndex
- }
- function Gg(t) {
- return t.dim
- }
- function Wg(t, e) {
- var i = {};
- c(t, function(t, e) {
- var n = t.getData()
- , o = t.coordinateSystem.getBaseAxis()
- , a = o.getExtent()
- , r = "category" === o.type ? o.getBandWidth() : Math.abs(a[1] - a[0]) / n.count()
- , s = i[Gg(o)] || {
- bandWidth: r,
- remainedWidth: r,
- autoWidthCount: 0,
- categoryGap: "20%",
- gap: "30%",
- stacks: {}
- }
- , l = s.stacks;
- i[Gg(o)] = s;
- var h = Bg(t);
- l[h] || s.autoWidthCount++,
- l[h] = l[h] || {
- width: 0,
- maxWidth: 0
- };
- var u = bi(t.get("barWidth"), r)
- , c = bi(t.get("barMaxWidth"), r)
- , d = t.get("barGap")
- , f = t.get("barCategoryGap");
- u && !l[h].width && (u = Math.min(s.remainedWidth, u),
- l[h].width = u,
- s.remainedWidth -= u),
- c && (l[h].maxWidth = c),
- null != d && (s.gap = d),
- null != f && (s.categoryGap = f)
- });
- var n = {};
- return c(i, function(t, e) {
- n[e] = {};
- var i = t.stacks
- , o = t.bandWidth
- , a = bi(t.categoryGap, o)
- , r = bi(t.gap, 1)
- , s = t.remainedWidth
- , l = t.autoWidthCount
- , h = (s - a) / (l + (l - 1) * r);
- h = Math.max(h, 0),
- c(i, function(t, e) {
- var i = t.maxWidth;
- i && i < h && (i = Math.min(i, s),
- t.width && (i = Math.min(i, t.width)),
- s -= i,
- t.width = i,
- l--)
- }),
- h = (s - a) / (l + (l - 1) * r),
- h = Math.max(h, 0);
- var u, d = 0;
- c(i, function(t, e) {
- t.width || (t.width = h),
- u = t,
- d += t.width * (1 + r)
- }),
- u && (d -= u.width * r);
- var f = -d / 2;
- c(i, function(t, i) {
- n[e][i] = n[e][i] || {
- offset: f,
- width: t.width
- },
- f += t.width * (1 + r)
- })
- }),
- n
- }
- function Hg(t, e) {
- YS.call(this, "radius", t, e),
- this.type = "category"
- }
- function Fg(t, e) {
- e = e || [0, 360],
- YS.call(this, "angle", t, e),
- this.type = "category"
- }
- function Zg(t, e) {
- return e.type || (e.data ? "category" : "value")
- }
- function Ug(t, e, i) {
- var n = e.get("center")
- , o = i.getWidth()
- , a = i.getHeight();
- t.cx = bi(n[0], o),
- t.cy = bi(n[1], a);
- var r = t.getRadiusAxis()
- , s = Math.min(o, a) / 2
- , l = bi(e.get("radius"), s);
- r.inverse ? r.setExtent(l, 0) : r.setExtent(0, l)
- }
- function jg(t, e) {
- var i = this
- , n = i.getAngleAxis()
- , o = i.getRadiusAxis();
- if (n.scale.setExtent(1 / 0, -1 / 0),
- o.scale.setExtent(1 / 0, -1 / 0),
- t.eachSeries(function(t) {
- if (t.coordinateSystem === i) {
- var e = t.getData();
- o.scale.unionExtentFromData(e, "radius"),
- n.scale.unionExtentFromData(e, "angle")
- }
- }),
- Or(n.scale, n.model),
- Or(o.scale, o.model),
- "category" === n.type && !n.onBand) {
- var a = n.getExtent()
- , r = 360 / n.scale.count();
- n.inverse ? a[1] += r : a[1] -= r,
- n.setExtent(a[0], a[1])
- }
- }
- function Xg(t, e) {
- if (t.type = e.get("type"),
- t.scale = zr(e),
- t.onBand = e.get("boundaryGap") && "category" === t.type,
- t.inverse = e.get("inverse"),
- "angleAxis" === e.mainType) {
- t.inverse ^= e.get("clockwise");
- var i = e.get("startAngle");
- t.setExtent(i, i + (t.inverse ? -360 : 360))
- }
- e.axis = t,
- t.model = e
- }
- function qg(t, e, i) {
- e[1] > e[0] && (e = e.slice().reverse());
- var n = t.coordToPoint([e[0], i])
- , o = t.coordToPoint([e[1], i]);
- return {
- x1: n[0],
- y1: n[1],
- x2: o[0],
- y2: o[1]
- }
- }
- function Yg(t) {
- return t.getRadiusAxis().inverse ? 0 : 1
- }
- function $g(t, e, i) {
- return {
- position: [t.cx, t.cy],
- rotation: i / 180 * Math.PI,
- labelDirection: -1,
- tickDirection: -1,
- nameDirection: 1,
- labelRotate: e.getModel("axisLabel").get("rotate"),
- z2: 1
- }
- }
- function Kg(t, e, i, n, o) {
- var a = e.axis
- , r = a.dataToCoord(t)
- , s = n.getAngleAxis().getExtent()[0];
- s = s / 180 * Math.PI;
- var l, h, u, c = n.getRadiusAxis().getExtent();
- if ("radius" === a.dim) {
- var d = nt();
- lt(d, d, s),
- st(d, d, [n.cx, n.cy]),
- l = So([r, -o], d);
- var f = e.getModel("axisLabel").get("rotate") || 0
- , g = zM.innerTextLayout(s, f * Math.PI / 180, -1);
- h = g.textAlign,
- u = g.textVerticalAlign
- } else {
- var p = c[1];
- l = n.coordToPoint([p + o, r]);
- var m = n.cx
- , v = n.cy;
- h = Math.abs(l[0] - m) / p < .3 ? "center" : l[0] > m ? "left" : "right",
- u = Math.abs(l[1] - v) / p < .3 ? "middle" : l[1] > v ? "top" : "bottom"
- }
- return {
- position: l,
- align: h,
- verticalAlign: u
- }
- }
- function Jg(t, e) {
- e.update = "updateView",
- er(e, function(e, i) {
- var n = {};
- return i.eachComponent({
- mainType: "geo",
- query: e
- }, function(i) {
- i[t](e.name),
- c(i.coordinateSystem.regions, function(t) {
- n[t.name] = i.isSelected(t.name) || !1
- })
- }),
- {
- selected: n,
- name: e.name
- }
- })
- }
- function Qg(t) {
- var e = {};
- c(t, function(t) {
- e[t] = 1
- }),
- t.length = 0,
- c(e, function(e, i) {
- t.push(i)
- })
- }
- function tp(t) {
- if (t)
- for (var e in t)
- if (t.hasOwnProperty(e))
- return !0
- }
- function ep(t, i, n) {
- function o() {
- var t = function() {};
- return t.prototype.__hidden = t.prototype,
- new t
- }
- var a = {};
- return $C(i, function(i) {
- var r = a[i] = o();
- $C(t[i], function(t, o) {
- if (eT.isValidType(o)) {
- var a = {
- type: o,
- visual: t
- };
- n && n(a, i),
- r[o] = new eT(a),
- "opacity" === o && ((a = e(a)).type = "colorAlpha",
- r.__hidden.__alphaForOpacity = new eT(a))
- }
- })
- }),
- a
- }
- function ip(t, i, n) {
- var o;
- c(n, function(t) {
- i.hasOwnProperty(t) && tp(i[t]) && (o = !0)
- }),
- o && c(n, function(n) {
- i.hasOwnProperty(n) && tp(i[n]) ? t[n] = e(i[n]) : delete t[n]
- })
- }
- function np(t, e, i, n, o, a) {
- function r(t) {
- return i.getItemVisual(u, t)
- }
- function s(t, e) {
- i.setItemVisual(u, t, e)
- }
- function l(t, l) {
- u = null == a ? t : l;
- var c = i.getRawDataItem(u);
- if (!c || !1 !== c.visualMap)
- for (var d = n.call(o, t), f = e[d], g = h[d], p = 0, m = g.length; p < m; p++) {
- var v = g[p];
- f[v] && f[v].applyVisual(t, r, s)
- }
- }
- var h = {};
- c(t, function(t) {
- var i = eT.prepareVisualTypes(e[t]);
- h[t] = i
- });
- var u;
- null == a ? i.each(l, !0) : i.each([a], l, !0)
- }
- function op(t) {
- var e = ["x", "y"]
- , i = ["width", "height"];
- return {
- point: function(e, i, n) {
- if (e) {
- var o = n.range;
- return ap(e[t], o)
- }
- },
- rect: function(n, o, a) {
- if (n) {
- var r = a.range
- , s = [n[e[t]], n[e[t]] + n[i[t]]];
- return s[1] < s[0] && s.reverse(),
- ap(s[0], r) || ap(s[1], r) || ap(r[0], s) || ap(r[1], s)
- }
- }
- }
- }
- function ap(t, e) {
- return e[0] <= t && t <= e[1]
- }
- function rp(t, e, i, n, o) {
- for (var a = 0, r = o[o.length - 1]; a < o.length; a++) {
- var s = o[a];
- if (sp(t, e, i, n, s[0], s[1], r[0], r[1]))
- return !0;
- r = s
- }
- }
- function sp(t, e, i, n, o, a, r, s) {
- var l = hp(i - t, o - r, n - e, a - s);
- if (lp(l))
- return !1;
- var h = hp(o - t, o - r, a - e, a - s) / l;
- if (h < 0 || h > 1)
- return !1;
- var u = hp(i - t, o - t, n - e, a - e) / l;
- return !(u < 0 || u > 1)
- }
- function lp(t) {
- return t <= 1e-6 && t >= -1e-6
- }
- function hp(t, e, i, n) {
- return t * n - e * i
- }
- function up(t, e, i) {
- var n = this._targetInfoList = []
- , o = {}
- , a = dp(e, t);
- JC(oD, function(t, e) {
- (!i || !i.include || QC(i.include, e) >= 0) && t(a, n, o)
- })
- }
- function cp(t) {
- return t[0] > t[1] && t.reverse(),
- t
- }
- function dp(t, e) {
- return Wo(t, e, {
- includeMainTypes: iD
- })
- }
- function fp(t, e, i, n) {
- var o = i.getAxis(["x", "y"][t])
- , a = cp(d([0, 1], function(t) {
- return e ? o.coordToData(o.toLocalCoord(n[t])) : o.toGlobalCoord(o.dataToCoord(n[t]))
- }))
- , r = [];
- return r[t] = a,
- r[1 - t] = [NaN, NaN],
- {
- values: a,
- xyMinMax: r
- }
- }
- function gp(t, e, i, n) {
- return [e[0] - n[t] * i[0], e[1] - n[t] * i[1]]
- }
- function pp(t, e) {
- var i = mp(t)
- , n = mp(e)
- , o = [i[0] / n[0], i[1] / n[1]];
- return isNaN(o[0]) && (o[0] = 1),
- isNaN(o[1]) && (o[1] = 1),
- o
- }
- function mp(t) {
- return t ? [t[0][1] - t[0][0], t[1][1] - t[1][0]] : [NaN, NaN]
- }
- function vp(t, e, i, n, o) {
- if (o) {
- var a = t.getZr();
- a[cD] || (a[uD] || (a[uD] = yp),
- Da(a, uD, i, e)(t, n))
- }
- }
- function yp(t, e) {
- if (!t.isDisposed()) {
- var i = t.getZr();
- i[cD] = !0,
- t.dispatchAction({
- type: "brushSelect",
- batch: e
- }),
- i[cD] = !1
- }
- }
- function xp(t, e, i, n) {
- for (var o = 0, a = e.length; o < a; o++) {
- var r = e[o];
- if (t[r.brushType](n, i, r.selectors, r))
- return !0
- }
- }
- function _p(t) {
- var e = t.brushSelector;
- if (x(e)) {
- var i = [];
- return c(KC, function(t, n) {
- i[n] = function(i, n, o, a) {
- var r = n.getItemLayout(i);
- return t[e](r, o, a)
- }
- }),
- i
- }
- if (y(e)) {
- var n = {};
- return c(KC, function(t, i) {
- n[i] = e
- }),
- n
- }
- return e
- }
- function bp(t, e) {
- var i = t.option.seriesIndex;
- return null != i && "all" !== i && (v(i) ? s(i, e) < 0 : e !== i)
- }
- function wp(t) {
- var e = t.selectors = {};
- return c(KC[t.brushType], function(i, n) {
- e[n] = function(n) {
- return i(n, e, t)
- }
- }),
- t
- }
- function Sp(t) {
- return new jt(t[0][0],t[1][0],t[0][1] - t[0][0],t[1][1] - t[1][0])
- }
- function Mp(t, e) {
- return i({
- brushType: t.brushType,
- brushMode: t.brushMode,
- transformable: t.transformable,
- brushStyle: new Co(t.brushStyle).getItemStyle(),
- removeOnClick: t.removeOnClick,
- z: t.z
- }, e, !0)
- }
- function Ip(t, e, i, n) {
- (!n || n.$from !== t.id) && this._brushController.setPanels(t.brushTargetManager.makePanelOpts(i)).enableBrush(t.brushOption).updateCovers(t.areas.slice())
- }
- function Tp(t, e) {
- pD[t] = e
- }
- function Ap(t) {
- return pD[t]
- }
- function Cp(t, e, i) {
- this.model = t,
- this.ecModel = e,
- this.api = i,
- this._brushType,
- this._brushMode
- }
- function Dp(t, e, i) {
- this._model = t
- }
- function Lp(t, e, i, n) {
- var o = i.calendarModel
- , a = i.seriesModel
- , r = o ? o.coordinateSystem : a ? a.coordinateSystem : null;
- return r === this ? r[t](n) : null
- }
- function kp(t, e) {
- var i = t.cellSize;
- v(i) ? 1 === i.length && (i[1] = i[0]) : i = t.cellSize = [i, i];
- var n = d([0, 1], function(t) {
- return Ko(e, t) && (i[t] = "auto"),
- null != i[t] && "auto" !== i[t]
- });
- Jo(t, e, {
- type: "box",
- ignoreSize: n
- })
- }
- function Pp(t) {
- return s(wD, t) >= 0
- }
- function Op(t, e, i) {
- function n(t, e) {
- return s(e.nodes, t) >= 0
- }
- function o(t, n) {
- var o = !1;
- return e(function(e) {
- c(i(t, e) || [], function(t) {
- n.records[e.name][t] && (o = !0)
- })
- }),
- o
- }
- function a(t, n) {
- n.nodes.push(t),
- e(function(e) {
- c(i(t, e) || [], function(t) {
- n.records[e.name][t] = !0
- })
- })
- }
- return function(i) {
- var r = {
- nodes: [],
- records: {}
- };
- if (e(function(t) {
- r.records[t.name] = {}
- }),
- !i)
- return r;
- a(i, r);
- var s;
- do {
- s = !1,
- t(function(t) {
- !n(t, r) && o(t, r) && (a(t, r),
- s = !0)
- })
- } while (s);
- return r
- }
- }
- function zp(t, e, i) {
- var n = [1 / 0, -1 / 0];
- return MD(i, function(t) {
- var i = t.getData();
- i && MD(t.coordDimToDataDim(e), function(t) {
- var e = i.getDataExtent(t);
- e[0] < n[0] && (n[0] = e[0]),
- e[1] > n[1] && (n[1] = e[1])
- })
- }),
- n[1] < n[0] && (n = [NaN, NaN]),
- Np(t, n),
- n
- }
- function Np(t, e) {
- var i = t.getAxisModel()
- , n = i.getMin(!0)
- , o = "category" === i.get("type")
- , a = o && (i.get("data") || []).length;
- null != n && "dataMin" !== n && "function" != typeof n ? e[0] = n : o && (e[0] = a > 0 ? 0 : NaN);
- var r = i.getMax(!0);
- return null != r && "dataMax" !== r && "function" != typeof r ? e[1] = r : o && (e[1] = a > 0 ? a - 1 : NaN),
- i.get("scale", !0) || (e[0] > 0 && (e[0] = 0),
- e[1] < 0 && (e[1] = 0)),
- e
- }
- function Ep(t, e) {
- var i = t.getAxisModel()
- , n = t._percentWindow
- , o = t._valueWindow;
- if (n) {
- var a = Ti(o, [0, 500]);
- a = Math.min(a, 20);
- var r = e || 0 === n[0] && 100 === n[1];
- i.setRange(r ? null : +o[0].toFixed(a), r ? null : +o[1].toFixed(a))
- }
- }
- function Rp(t) {
- var e = t._minMaxSpan = {}
- , i = t._dataZoomModel;
- MD(["min", "max"], function(n) {
- e[n + "Span"] = i.get(n + "Span");
- var o = i.get(n + "ValueSpan");
- if (null != o && (e[n + "ValueSpan"] = o,
- null != (o = t.getAxisModel().axis.scale.parse(o)))) {
- var a = t._dataExtent;
- e[n + "Span"] = _i(a[0] + o, a, [0, 100], !0)
- }
- })
- }
- function Vp(t) {
- var e = {};
- return AD(["start", "end", "startValue", "endValue", "throttle"], function(i) {
- t.hasOwnProperty(i) && (e[i] = t[i])
- }),
- e
- }
- function Bp(t, e) {
- var i = t._rangePropMode
- , n = t.get("rangeMode");
- AD([["start", "startValue"], ["end", "endValue"]], function(t, o) {
- var a = null != e[t[0]]
- , r = null != e[t[1]];
- a && !r ? i[o] = "percent" : !a && r ? i[o] = "value" : n ? i[o] = n[o] : a && (i[o] = "percent")
- })
- }
- function Gp(t) {
- return {
- x: "y",
- y: "x",
- radius: "angle",
- angle: "radius"
- }[t]
- }
- function Wp(t) {
- return "vertical" === t ? "ns-resize" : "ew-resize"
- }
- function Hp(t, e) {
- var i = jp(t)
- , n = e.dataZoomId
- , o = e.coordId;
- c(i, function(t, i) {
- var a = t.dataZoomInfos;
- a[n] && s(e.allCoordIds, o) < 0 && (delete a[n],
- t.count--)
- }),
- qp(i);
- var a = i[o];
- a || ((a = i[o] = {
- coordId: o,
- dataZoomInfos: {},
- count: 0
- }).controller = Xp(t, a),
- a.dispatchAction = m(Jp, t)),
- !a.dataZoomInfos[n] && a.count++,
- a.dataZoomInfos[n] = e;
- var r = Qp(a.dataZoomInfos);
- a.controller.enable(r.controlType, r.opt),
- a.controller.setPointerChecker(e.containsPoint),
- Da(a, "dispatchAction", e.throttleRate, "fixRate")
- }
- function Fp(t, e) {
- var i = jp(t);
- c(i, function(t) {
- t.controller.dispose();
- var i = t.dataZoomInfos;
- i[e] && (delete i[e],
- t.count--)
- }),
- qp(i)
- }
- function Zp(t, e) {
- if (t && "dataZoom" === t.type && t.batch)
- for (var i = 0, n = t.batch.length; i < n; i++)
- if (t.batch[i].dataZoomId === e)
- return !1;
- return !0
- }
- function Up(t) {
- return t.type + "\0_" + t.id
- }
- function jp(t) {
- var e = t.getZr();
- return e[WD] || (e[WD] = {})
- }
- function Xp(t, e) {
- var i = new Nl(t.getZr());
- return i.on("pan", GD(Yp, e)),
- i.on("zoom", GD($p, e)),
- i
- }
- function qp(t) {
- c(t, function(e, i) {
- e.count || (e.controller.dispose(),
- delete t[i])
- })
- }
- function Yp(t, e, i, n, o, a, r) {
- Kp(t, function(s) {
- return s.panGetRange(t.controller, e, i, n, o, a, r)
- })
- }
- function $p(t, e, i, n) {
- Kp(t, function(o) {
- return o.zoomGetRange(t.controller, e, i, n)
- })
- }
- function Kp(t, e) {
- var i = [];
- c(t.dataZoomInfos, function(t) {
- var n = e(t);
- !t.disabled && n && i.push({
- dataZoomId: t.dataZoomId,
- start: n[0],
- end: n[1]
- })
- }),
- t.dispatchAction(i)
- }
- function Jp(t, e) {
- t.dispatchAction({
- type: "dataZoom",
- batch: e
- })
- }
- function Qp(t) {
- var e, i = {}, n = {
- true: 2,
- move: 1,
- false: 0,
- undefined: -1
- };
- return c(t, function(t) {
- var a = !t.disabled && (!t.zoomLock || "move");
- n[a] > n[e] && (e = a),
- o(i, t.roamControllerOpt)
- }),
- {
- controlType: e,
- opt: i
- }
- }
- function tm(t, e, i) {
- i.getAxisProxy(t.name, e).reset(i)
- }
- function em(t, e, i) {
- i.getAxisProxy(t.name, e).filterData(i)
- }
- function im(t, e) {
- return t && t.hasOwnProperty && t.hasOwnProperty(e)
- }
- function nm(t, e) {
- t.eachTargetSeries(function(e) {
- var i = e.getData();
- np(t.stateList, t.targetVisuals, i, t.getValueState, t, t.getDataDimension(i))
- })
- }
- function om(t) {
- t.eachSeries(function(e) {
- var i = e.getData()
- , n = [];
- t.eachComponent("visualMap", function(t) {
- if (t.isTargetSeries(e)) {
- var o = t.getVisualMeta(p(am, null, e, t)) || {
- stops: [],
- outerColors: []
- };
- o.dimension = t.getDataDimension(i),
- n.push(o)
- }
- }),
- e.getData().setVisual("visualMeta", n)
- })
- }
- function am(t, e, i, n) {
- for (var o = e.targetVisuals[n], a = eT.prepareVisualTypes(o), r = {
- color: t.getData().getVisual("color")
- }, s = 0, l = a.length; s < l; s++) {
- var h = a[s]
- , u = o["opacity" === h ? "__alphaForOpacity" : h];
- u && u.applyVisual(i, function(t) {
- return r[t]
- }, function(t, e) {
- r[t] = e
- })
- }
- return r.color
- }
- function rm(t, e, i) {
- if (i[0] === i[1])
- return i.slice();
- for (var n = (i[1] - i[0]) / 200, o = i[0], a = [], r = 0; r <= 200 && o < i[1]; r++)
- a.push(o),
- o += n;
- return a.push(i[1]),
- a
- }
- function sm(t, e, i) {
- var n = t.option
- , o = n.align;
- if (null != o && "auto" !== o)
- return o;
- for (var a = {
- width: e.getWidth(),
- height: e.getHeight()
- }, r = "horizontal" === n.orient ? 1 : 0, s = [["left", "right", "width"], ["top", "bottom", "height"]], l = s[r], h = [0, null, 10], u = {}, c = 0; c < 3; c++)
- u[s[1 - r][c]] = h[c],
- u[l[c]] = 2 === c ? i[0] : n[l[c]];
- var d = [["x", "width", 3], ["y", "height", 0]][r]
- , f = Yo(u, a, n.padding);
- return l[(f.margin[d[2]] || 0) + f[d[0]] + .5 * f[d[1]] < .5 * a[d[1]] ? 0 : 1]
- }
- function lm(t) {
- return c(t || [], function(e) {
- null != t.dataIndex && (t.dataIndexInside = t.dataIndex,
- t.dataIndex = null)
- }),
- t
- }
- function hm(t, e, i, n) {
- return new fb({
- shape: {
- points: t
- },
- draggable: !!i,
- cursor: e,
- drift: i,
- onmousemove: function(t) {
- Ix(t.event)
- },
- ondragend: n
- })
- }
- function um(t, e) {
- return 0 === t ? [[0, 0], [e, 0], [e, -e]] : [[0, 0], [e, 0], [e, e]]
- }
- function cm(t, e, i, n) {
- return t ? [[0, -hL(e, uL(i, 0))], [dL, 0], [0, hL(e, uL(n - i, 0))]] : [[0, 0], [5, -5], [5, 5]]
- }
- function dm(t, e, i) {
- var n = cL / 2
- , o = t.get("hoverLinkDataSize");
- return o && (n = sL(o, e, i, !0) / 2),
- n
- }
- function fm(t) {
- var e = t.get("hoverLinkOnHandle");
- return !!(null == e ? t.get("realtime") : e)
- }
- function gm(t) {
- return "vertical" === t ? "ns-resize" : "ew-resize"
- }
- function pm(t, e) {
- var i = t.inverse;
- ("vertical" === t.orient ? !i : i) && e.reverse()
- }
- function mm(t) {
- Po(t.label, ["show"])
- }
- function vm(t) {
- return !(isNaN(parseFloat(t.x)) && isNaN(parseFloat(t.y)))
- }
- function ym(t) {
- return !isNaN(parseFloat(t.x)) && !isNaN(parseFloat(t.y))
- }
- function xm(t, e, i) {
- var n = -1;
- do {
- n = Math.max(Mi(t.get(e, i)), n),
- t = t.stackedOn
- } while (t);
- return n
- }
- function _m(t, e, i, n, o, a) {
- var r = []
- , s = Im(e, n, t)
- , l = e.indicesOfNearest(n, s, !0)[0];
- r[o] = e.get(i, l, !0),
- r[a] = e.get(n, l, !0);
- var h = xm(e, n, l);
- return (h = Math.min(h, 20)) >= 0 && (r[a] = +r[a].toFixed(h)),
- r
- }
- function bm(t, i) {
- var n = t.getData()
- , o = t.coordinateSystem;
- if (i && !ym(i) && !v(i.coord) && o) {
- var a = o.dimensions
- , r = wm(i, n, o, t);
- if ((i = e(i)).type && bL[i.type] && r.baseAxis && r.valueAxis) {
- var s = xL(a, r.baseAxis.dim)
- , l = xL(a, r.valueAxis.dim);
- i.coord = bL[i.type](n, r.baseDataDim, r.valueDataDim, s, l),
- i.value = i.coord[l]
- } else {
- for (var h = [null != i.xAxis ? i.xAxis : i.radiusAxis, null != i.yAxis ? i.yAxis : i.angleAxis], u = 0; u < 2; u++)
- if (bL[h[u]]) {
- var c = t.coordDimToDataDim(a[u])[0];
- h[u] = Im(n, c, h[u])
- }
- i.coord = h
- }
- }
- return i
- }
- function wm(t, e, i, n) {
- var o = {};
- return null != t.valueIndex || null != t.valueDim ? (o.valueDataDim = null != t.valueIndex ? e.getDimension(t.valueIndex) : t.valueDim,
- o.valueAxis = i.getAxis(n.dataDimToCoordDim(o.valueDataDim)),
- o.baseAxis = i.getOtherAxis(o.valueAxis),
- o.baseDataDim = n.coordDimToDataDim(o.baseAxis.dim)[0]) : (o.baseAxis = n.getBaseAxis(),
- o.valueAxis = i.getOtherAxis(o.baseAxis),
- o.baseDataDim = n.coordDimToDataDim(o.baseAxis.dim)[0],
- o.valueDataDim = n.coordDimToDataDim(o.valueAxis.dim)[0]),
- o
- }
- function Sm(t, e) {
- return !(t && t.containData && e.coord && !vm(e)) || t.containData(e.coord)
- }
- function Mm(t, e, i, n) {
- return n < 2 ? t.coord && t.coord[n] : t.value
- }
- function Im(t, e, i) {
- if ("average" === i) {
- var n = 0
- , o = 0;
- return t.each(e, function(t, e) {
- isNaN(t) || (n += t,
- o++)
- }, !0),
- n / o
- }
- return t.getDataExtent(e, !0)["max" === i ? 1 : 0]
- }
- function Tm(t, e, i) {
- var n = e.coordinateSystem;
- t.each(function(o) {
- var a, r = t.getItemModel(o), s = bi(r.get("x"), i.getWidth()), l = bi(r.get("y"), i.getHeight());
- if (isNaN(s) || isNaN(l)) {
- if (e.getMarkerPosition)
- a = e.getMarkerPosition(t.getValues(t.dimensions, o));
- else if (n) {
- var h = t.get(n.dimensions[0], o)
- , u = t.get(n.dimensions[1], o);
- a = n.dataToPoint([h, u])
- }
- } else
- a = [s, l];
- isNaN(s) || (a[0] = s),
- isNaN(l) || (a[1] = l),
- t.setItemLayout(o, a)
- })
- }
- function Am(t, e, i) {
- var n;
- n = t ? d(t && t.dimensions, function(t) {
- var i = e.getData().getDimensionInfo(e.coordDimToDataDim(t)[0]) || {};
- return i.name = t,
- i
- }) : [{
- name: "value",
- type: "float"
- }];
- var o = new lS(n,i)
- , a = d(i.get("data"), m(bm, e));
- return t && (a = g(a, m(Sm, t))),
- o.initData(a, null, t ? Mm : function(t) {
- return t.value
- }
- ),
- o
- }
- function Cm(t) {
- return !isNaN(t) && !isFinite(t)
- }
- function Dm(t, e, i, n) {
- var o = 1 - t
- , a = n.dimensions[t];
- return Cm(e[o]) && Cm(i[o]) && e[t] === i[t] && n.getAxis(a).containData(e[t])
- }
- function Lm(t, e) {
- if ("cartesian2d" === t.type) {
- var i = e[0].coord
- , n = e[1].coord;
- if (i && n && (Dm(1, i, n, t) || Dm(0, i, n, t)))
- return !0
- }
- return Sm(t, e[0]) && Sm(t, e[1])
- }
- function km(t, e, i, n, o) {
- var a, r = n.coordinateSystem, s = t.getItemModel(e), l = bi(s.get("x"), o.getWidth()), h = bi(s.get("y"), o.getHeight());
- if (isNaN(l) || isNaN(h)) {
- if (n.getMarkerPosition)
- a = n.getMarkerPosition(t.getValues(t.dimensions, e));
- else {
- var u = r.dimensions
- , c = t.get(u[0], e)
- , d = t.get(u[1], e);
- a = r.dataToPoint([c, d])
- }
- if ("cartesian2d" === r.type) {
- var f = r.getAxis("x")
- , g = r.getAxis("y")
- , u = r.dimensions;
- Cm(t.get(u[0], e)) ? a[0] = f.toGlobalCoord(f.getExtent()[i ? 0 : 1]) : Cm(t.get(u[1], e)) && (a[1] = g.toGlobalCoord(g.getExtent()[i ? 0 : 1]))
- }
- isNaN(l) || (a[0] = l),
- isNaN(h) || (a[1] = h)
- } else
- a = [l, h];
- t.setItemLayout(e, a)
- }
- function Pm(t, e, i) {
- var n;
- n = t ? d(t && t.dimensions, function(t) {
- var i = e.getData().getDimensionInfo(e.coordDimToDataDim(t)[0]) || {};
- return i.name = t,
- i
- }) : [{
- name: "value",
- type: "float"
- }];
- var o = new lS(n,i)
- , a = new lS(n,i)
- , r = new lS([],i)
- , s = d(i.get("data"), m(SL, e, t, i));
- t && (s = g(s, m(Lm, t)));
- var l = t ? Mm : function(t) {
- return t.value
- }
- ;
- return o.initData(d(s, function(t) {
- return t[0]
- }), null, l),
- a.initData(d(s, function(t) {
- return t[1]
- }), null, l),
- r.initData(d(s, function(t) {
- return t[2]
- })),
- r.hasItemOption = !0,
- {
- from: o,
- to: a,
- line: r
- }
- }
- function Om(t) {
- return !isNaN(t) && !isFinite(t)
- }
- function zm(t, e, i, n) {
- var o = 1 - t;
- return Om(e[o]) && Om(i[o])
- }
- function Nm(t, e) {
- var i = e.coord[0]
- , n = e.coord[1];
- return !("cartesian2d" !== t.type || !i || !n || !zm(1, i, n, t) && !zm(0, i, n, t)) || (Sm(t, {
- coord: i,
- x: e.x0,
- y: e.y0
- }) || Sm(t, {
- coord: n,
- x: e.x1,
- y: e.y1
- }))
- }
- function Em(t, e, i, n, o) {
- var a, r = n.coordinateSystem, s = t.getItemModel(e), l = bi(s.get(i[0]), o.getWidth()), h = bi(s.get(i[1]), o.getHeight());
- if (isNaN(l) || isNaN(h)) {
- if (n.getMarkerPosition)
- a = n.getMarkerPosition(t.getValues(i, e));
- else {
- var u = t.get(i[0], e)
- , c = t.get(i[1], e);
- a = r.dataToPoint([u, c], !0)
- }
- if ("cartesian2d" === r.type) {
- var d = r.getAxis("x")
- , f = r.getAxis("y")
- , u = t.get(i[0], e)
- , c = t.get(i[1], e);
- Om(u) ? a[0] = d.toGlobalCoord(d.getExtent()["x0" === i[0] ? 0 : 1]) : Om(c) && (a[1] = f.toGlobalCoord(f.getExtent()["y0" === i[1] ? 0 : 1]))
- }
- isNaN(l) || (a[0] = l),
- isNaN(h) || (a[1] = h)
- } else
- a = [l, h];
- return a
- }
- function Rm(t, e, i) {
- var n, o, a = ["x0", "y0", "x1", "y1"];
- t ? (n = d(t && t.dimensions, function(t) {
- var i = e.getData().getDimensionInfo(e.coordDimToDataDim(t)[0]) || {};
- return i.name = t,
- i
- }),
- o = new lS(d(a, function(t, e) {
- return {
- name: t,
- type: n[e % 2].type
- }
- }),i)) : o = new lS(n = [{
- name: "value",
- type: "float"
- }],i);
- var r = d(i.get("data"), m(ML, e, t, i));
- t && (r = g(r, m(Nm, t)));
- var s = t ? function(t, e, i, n) {
- return t.coord[Math.floor(n / 2)][n % 2]
- }
- : function(t) {
- return t.value
- }
- ;
- return o.initData(r, null, s),
- o.hasItemOption = !0,
- o
- }
- function Vm(t) {
- var e = t.type
- , i = {
- number: "value",
- time: "time"
- };
- if (i[e] && (t.axisType = i[e],
- delete t.type),
- Bm(t),
- Gm(t, "controlPosition")) {
- var n = t.controlStyle || (t.controlStyle = {});
- Gm(n, "position") || (n.position = t.controlPosition),
- "none" !== n.position || Gm(n, "show") || (n.show = !1,
- delete n.position),
- delete t.controlPosition
- }
- c(t.data || [], function(t) {
- _(t) && !v(t) && (!Gm(t, "value") && Gm(t, "name") && (t.value = t.name),
- Bm(t))
- })
- }
- function Bm(t) {
- var e = t.itemStyle || (t.itemStyle = {})
- , i = e.emphasis || (e.emphasis = {})
- , n = t.label || t.label || {}
- , o = n.normal || (n.normal = {})
- , a = {
- normal: 1,
- emphasis: 1
- };
- c(n, function(t, e) {
- a[e] || Gm(o, e) || (o[e] = t)
- }),
- i.label && !Gm(n, "emphasis") && (n.emphasis = i.label,
- delete i.label)
- }
- function Gm(t, e) {
- return t.hasOwnProperty(e)
- }
- function Wm(t, e) {
- return Yo(t.getBoxLayoutParams(), {
- width: e.getWidth(),
- height: e.getHeight()
- }, t.get("padding"))
- }
- function Hm(t, i, n, o) {
- return Fn(t.get(i).replace(/^path:\/\//, ""), e(o || {}), new jt(n[0],n[1],n[2],n[3]), "center")
- }
- function Fm(t, e, n, o, a, r) {
- var s = e.get("color");
- a ? (a.setColor(s),
- n.add(a),
- r && r.onUpdate(a)) : ((a = Gr(t.get("symbol"), -1, -1, 2, 2, s)).setStyle("strokeNoScale", !0),
- n.add(a),
- r && r.onCreate(a));
- var l = e.getItemStyle(["color", "symbol", "symbolSize"]);
- a.setStyle(l),
- o = i({
- rectHover: !0,
- z2: 100
- }, o, !0);
- var h = t.get("symbolSize");
- (h = h instanceof Array ? h.slice() : [+h, +h])[0] /= 2,
- h[1] /= 2,
- o.scale = h;
- var u = t.get("symbolOffset");
- if (u) {
- var c = o.position = o.position || [0, 0];
- c[0] += bi(u[0], h[0]),
- c[1] += bi(u[1], h[1])
- }
- var d = t.get("symbolRotate");
- return o.rotation = (d || 0) * Math.PI / 180 || 0,
- a.attr(o),
- a.updateTransform(),
- a
- }
- function Zm(t, e, i, n, o) {
- if (!t.dragging) {
- var a = n.getModel("checkpointStyle")
- , r = i.dataToCoord(n.getData().get(["value"], e));
- o || !a.get("animation", !0) ? t.attr({
- position: [r, 0]
- }) : (t.stopAnimation(!0),
- t.animateTo({
- position: [r, 0]
- }, a.get("animationDuration", !0), a.get("animationEasing", !0)))
- }
- }
- function Um(t) {
- return 0 === t.indexOf("my")
- }
- function jm(t) {
- this.model = t
- }
- function Xm(t) {
- this.model = t
- }
- function qm(t) {
- var e = {}
- , i = []
- , n = [];
- return t.eachRawSeries(function(t) {
- var o = t.coordinateSystem;
- if (!o || "cartesian2d" !== o.type && "polar" !== o.type)
- i.push(t);
- else {
- var a = o.getBaseAxis();
- if ("category" === a.type) {
- var r = a.dim + "_" + a.index;
- e[r] || (e[r] = {
- categoryAxis: a,
- valueAxis: o.getOtherAxis(a),
- series: []
- },
- n.push({
- axisDim: a.dim,
- axisIndex: a.index
- })),
- e[r].series.push(t)
- } else
- i.push(t)
- }
- }),
- {
- seriesGroupByCategoryAxis: e,
- other: i,
- meta: n
- }
- }
- function Ym(t) {
- var e = [];
- return c(t, function(t, i) {
- var n = t.categoryAxis
- , o = t.valueAxis.dim
- , a = [" "].concat(d(t.series, function(t) {
- return t.name
- }))
- , r = [n.model.getCategories()];
- c(t.series, function(t) {
- r.push(t.getRawData().mapArray(o, function(t) {
- return t
- }))
- });
- for (var s = [a.join(GL)], l = 0; l < r[0].length; l++) {
- for (var h = [], u = 0; u < r.length; u++)
- h.push(r[u][l]);
- s.push(h.join(GL))
- }
- e.push(s.join("\n"))
- }),
- e.join("\n\n" + BL + "\n\n")
- }
- function $m(t) {
- return d(t, function(t) {
- var e = t.getRawData()
- , i = [t.name]
- , n = [];
- return e.each(e.dimensions, function() {
- for (var t = arguments.length, o = arguments[t - 1], a = e.getName(o), r = 0; r < t - 1; r++)
- n[r] = arguments[r];
- i.push((a ? a + GL : "") + n.join(GL))
- }),
- i.join("\n")
- }).join("\n\n" + BL + "\n\n")
- }
- function Km(t) {
- var e = qm(t);
- return {
- value: g([Ym(e.seriesGroupByCategoryAxis), $m(e.other)], function(t) {
- return t.replace(/[\n\t\s]/g, "")
- }).join("\n\n" + BL + "\n\n"),
- meta: e.meta
- }
- }
- function Jm(t) {
- return t.replace(/^\s\s*/, "").replace(/\s\s*$/, "")
- }
- function Qm(t) {
- if (t.slice(0, t.indexOf("\n")).indexOf(GL) >= 0)
- return !0
- }
- function tv(t) {
- for (var e = t.split(/\n+/g), i = [], n = d(Jm(e.shift()).split(WL), function(t) {
- return {
- name: t,
- data: []
- }
- }), o = 0; o < e.length; o++) {
- var a = Jm(e[o]).split(WL);
- i.push(a.shift());
- for (var r = 0; r < a.length; r++)
- n[r] && (n[r].data[o] = a[r])
- }
- return {
- series: n,
- categories: i
- }
- }
- function ev(t) {
- for (var e = t.split(/\n+/g), i = Jm(e.shift()), n = [], o = 0; o < e.length; o++) {
- var a, r = Jm(e[o]).split(WL), s = "", l = !1;
- isNaN(r[0]) ? (l = !0,
- s = r[0],
- r = r.slice(1),
- n[o] = {
- name: s,
- value: []
- },
- a = n[o].value) : a = n[o] = [];
- for (var h = 0; h < r.length; h++)
- a.push(+r[h]);
- 1 === a.length && (l ? n[o].value = a[0] : n[o] = a[0])
- }
- return {
- name: i,
- data: n
- }
- }
- function iv(t, e) {
- var i = {
- series: []
- };
- return c(t.split(new RegExp("\n*" + BL + "\n*","g")), function(t, n) {
- if (Qm(t)) {
- var o = tv(t)
- , a = e[n]
- , r = a.axisDim + "Axis";
- a && (i[r] = i[r] || [],
- i[r][a.axisIndex] = {
- data: o.categories
- },
- i.series = i.series.concat(o.series))
- } else {
- o = ev(t);
- i.series.push(o)
- }
- }),
- i
- }
- function nv(t) {
- this._dom = null,
- this.model = t
- }
- function ov(t, e) {
- return d(t, function(t, i) {
- var n = e && e[i];
- return _(n) && !v(n) ? (_(t) && !v(t) && (t = t.value),
- a({
- value: t
- }, n)) : t
- })
- }
- function av(t, e) {
- var i = hv(t);
- HL(e, function(e, n) {
- for (var o = i.length - 1; o >= 0 && !i[o][n]; o--)
- ;
- if (o < 0) {
- var a = t.queryComponents({
- mainType: "dataZoom",
- subType: "select",
- id: n
- })[0];
- if (a) {
- var r = a.getPercentRange();
- i[0][n] = {
- dataZoomId: n,
- start: r[0],
- end: r[1]
- }
- }
- }
- }),
- i.push(e)
- }
- function rv(t) {
- var e = hv(t)
- , i = e[e.length - 1];
- e.length > 1 && e.pop();
- var n = {};
- return HL(i, function(t, i) {
- for (var o = e.length - 1; o >= 0; o--)
- if (t = e[o][i]) {
- n[i] = t;
- break
- }
- }),
- n
- }
- function sv(t) {
- t[FL] = null
- }
- function lv(t) {
- return hv(t).length
- }
- function hv(t) {
- var e = t[FL];
- return e || (e = t[FL] = [{}]),
- e
- }
- function uv(t, e, i) {
- (this._brushController = new Qu(i.getZr())).on("brush", p(this._onBrush, this)).mount(),
- this._isZoomActive
- }
- function cv(t) {
- var e = {};
- return c(["xAxisIndex", "yAxisIndex"], function(i) {
- e[i] = t[i],
- null == e[i] && (e[i] = "all"),
- (!1 === e[i] || "none" === e[i]) && (e[i] = [])
- }),
- e
- }
- function dv(t, e) {
- t.setIconStatus("back", lv(e) > 1 ? "emphasis" : "normal")
- }
- function fv(t, e, i, n, o) {
- var a = i._isZoomActive;
- n && "takeGlobalCursor" === n.type && (a = "dataZoomSelect" === n.key && n.dataZoomSelectActive),
- i._isZoomActive = a,
- t.setIconStatus("zoom", a ? "emphasis" : "normal");
- var r = new up(cv(t.option),e,{
- include: ["grid"]
- });
- i._brushController.setPanels(r.makePanelOpts(o, function(t) {
- return t.xAxisDeclared && !t.yAxisDeclared ? "lineX" : !t.xAxisDeclared && t.yAxisDeclared ? "lineY" : "rect"
- })).enableBrush(!!a && {
- brushType: "auto",
- brushStyle: {
- lineWidth: 0,
- fill: "rgba(0,0,0,0.2)"
- }
- })
- }
- function gv(t) {
- this.model = t
- }
- function pv() {
- if (!QL && tk) {
- QL = !0;
- var t = tk.styleSheets;
- t.length < 31 ? tk.createStyleSheet().addRule(".zrvml", "behavior:url(#default#VML)") : t[0].addRule(".zrvml", "behavior:url(#default#VML)")
- }
- }
- function mv(t) {
- return parseInt(t, 10)
- }
- function vv(t, e) {
- pv(),
- this.root = t,
- this.storage = e;
- var i = document.createElement("div")
- , n = document.createElement("div");
- i.style.cssText = "display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",
- n.style.cssText = "position:absolute;left:0;top:0;",
- t.appendChild(i),
- this._vmlRoot = n,
- this._vmlViewport = i,
- this.resize();
- var o = e.delFromStorage
- , a = e.addToStorage;
- e.delFromStorage = function(t) {
- o.call(e, t),
- t && t.onRemove && t.onRemove(n)
- }
- ,
- e.addToStorage = function(t) {
- t.onAdd && t.onAdd(n),
- a.call(e, t)
- }
- ,
- this._firstPaint = !0
- }
- function yv(t) {
- return function() {
- Zy('In IE8.0 VML mode painter not support method "' + t + '"')
- }
- }
- function xv(t) {
- return document.createElementNS(Ok, t)
- }
- function _v(t) {
- return Ek(1e4 * t) / 1e4
- }
- function bv(t) {
- return t < Hk && t > -Hk
- }
- function wv(t, e) {
- var i = e ? t.textFill : t.fill;
- return null != i && i !== Nk
- }
- function Sv(t, e) {
- var i = e ? t.textStroke : t.stroke;
- return null != i && i !== Nk
- }
- function Mv(t, e) {
- e && Iv(t, "transform", "matrix(" + zk.call(e, ",") + ")")
- }
- function Iv(t, e, i) {
- (!i || "linear" !== i.type && "radial" !== i.type) && t.setAttribute(e, i)
- }
- function Tv(t, e, i) {
- t.setAttributeNS("http://www.w3.org/1999/xlink", e, i)
- }
- function Av(t, e, i) {
- if (wv(e, i)) {
- var n = i ? e.textFill : e.fill;
- n = "transparent" === n ? Nk : n,
- "none" !== t.getAttribute("clip-path") && n === Nk && (n = "rgba(0, 0, 0, 0.002)"),
- Iv(t, "fill", n),
- Iv(t, "fill-opacity", e.opacity)
- } else
- Iv(t, "fill", Nk);
- if (Sv(e, i)) {
- var o = i ? e.textStroke : e.stroke;
- Iv(t, "stroke", o = "transparent" === o ? Nk : o),
- Iv(t, "stroke-width", (i ? e.textStrokeWidth : e.lineWidth) / (e.strokeNoScale ? e.host.getLineScale() : 1)),
- Iv(t, "paint-order", "stroke"),
- Iv(t, "stroke-opacity", e.opacity),
- e.lineDash ? (Iv(t, "stroke-dasharray", e.lineDash.join(",")),
- Iv(t, "stroke-dashoffset", Ek(e.lineDashOffset || 0))) : Iv(t, "stroke-dasharray", ""),
- e.lineCap && Iv(t, "stroke-linecap", e.lineCap),
- e.lineJoin && Iv(t, "stroke-linejoin", e.lineJoin),
- e.miterLimit && Iv(t, "stroke-miterlimit", e.miterLimit)
- } else
- Iv(t, "stroke", Nk)
- }
- function Cv(t) {
- for (var e = [], i = t.data, n = t.len(), o = 0; o < n; ) {
- var a = ""
- , r = 0;
- switch (i[o++]) {
- case I_.M:
- a = "M",
- r = 2;
- break;
- case I_.L:
- a = "L",
- r = 2;
- break;
- case I_.Q:
- a = "Q",
- r = 4;
- break;
- case I_.C:
- a = "C",
- r = 6;
- break;
- case I_.A:
- var s = i[o++]
- , l = i[o++]
- , h = i[o++]
- , u = i[o++]
- , c = i[o++]
- , d = i[o++]
- , f = i[o++]
- , g = i[o++]
- , p = Math.abs(d)
- , m = bv(p % Gk) && !bv(p)
- , v = !1;
- v = p >= Gk || !bv(p) && (d > -Bk && d < 0 || d > Bk) == !!g;
- var y = _v(s + h * Vk(c))
- , x = _v(l + u * Rk(c));
- m && (d = g ? Gk - 1e-4 : 1e-4 - Gk,
- v = !0,
- 9 === o && e.push("M", y, x));
- var _ = _v(s + h * Vk(c + d))
- , b = _v(l + u * Rk(c + d));
- e.push("A", _v(h), _v(u), Ek(f * Wk), +v, +g, _, b);
- break;
- case I_.Z:
- a = "Z";
- break;
- case I_.R:
- var _ = _v(i[o++])
- , b = _v(i[o++])
- , w = _v(i[o++])
- , S = _v(i[o++]);
- e.push("M", _, b, "L", _ + w, b, "L", _ + w, b + S, "L", _, b + S, "L", _, b)
- }
- a && e.push(a);
- for (var M = 0; M < r; M++)
- e.push(_v(i[o++]))
- }
- return e.join(" ")
- }
- function Dv(t) {
- return "middle" === t ? "middle" : "bottom" === t ? "baseline" : "hanging"
- }
- function Lv() {}
- function kv(t, e, i, n) {
- for (var o = 0, a = e.length, r = 0, s = 0; o < a; o++) {
- var l = e[o];
- if (l.removed) {
- for (var h = [], u = s; u < s + l.count; u++)
- h.push(u);
- l.indices = h,
- s += l.count
- } else {
- for (var h = [], u = r; u < r + l.count; u++)
- h.push(u);
- l.indices = h,
- r += l.count,
- l.added || (s += l.count)
- }
- }
- return e
- }
- function Pv(t) {
- return {
- newPos: t.newPos,
- components: t.components.slice(0)
- }
- }
- function Ov(t, e, i) {
- this._svgRoot = t,
- this._tagNames = "string" == typeof e ? [e] : e,
- this._markLabel = i,
- this.nextId = 0
- }
- function zv(t) {
- Ov.call(this, t, ["linearGradient", "radialGradient"], "__gradient_in_use__")
- }
- function Nv(t) {
- Ov.call(this, t, "clipPath", "__clippath_in_use__")
- }
- function Ev(t) {
- return parseInt(t, 10)
- }
- function Rv(t) {
- return t instanceof On ? Fk : t instanceof je ? Zk : t instanceof ab ? Uk : Fk
- }
- function Vv(t, e) {
- return e && t && e.parentNode !== t
- }
- function Bv(t, e, i) {
- if (Vv(t, e) && i) {
- var n = i.nextSibling;
- n ? t.insertBefore(e, n) : t.appendChild(e)
- }
- }
- function Gv(t, e) {
- if (Vv(t, e)) {
- var i = t.firstChild;
- i ? t.insertBefore(e, i) : t.appendChild(e)
- }
- }
- function Wv(t, e) {
- e && t && e.parentNode === t && t.removeChild(e)
- }
- function Hv(t) {
- return t.__textSvgEl
- }
- function Fv(t) {
- return t.__svgEl
- }
- function Zv(t) {
- return function() {
- Zy('In SVG mode painter not support method "' + t + '"')
- }
- }
- var Uv, jv = 2311, Xv = function() {
- return jv++
- }, qv = {}, Yv = qv = "undefined" == typeof navigator ? {
- browser: {},
- os: {},
- node: !0,
- canvasSupported: !0,
- svgSupported: !0
- } : function(t) {
- var e = {}
- , i = {}
- , n = t.match(/Firefox\/([\d.]+)/)
- , o = t.match(/MSIE\s([\d.]+)/) || t.match(/Trident\/.+?rv:(([\d.]+))/)
- , a = t.match(/Edge\/([\d.]+)/)
- , r = /micromessenger/i.test(t);
- return n && (i.firefox = !0,
- i.version = n[1]),
- o && (i.ie = !0,
- i.version = o[1]),
- a && (i.edge = !0,
- i.version = a[1]),
- r && (i.weChat = !0),
- {
- browser: i,
- os: e,
- node: !1,
- canvasSupported: !!document.createElement("canvas").getContext,
- svgSupported: "undefined" != typeof SVGRect,
- touchEventsSupported: "ontouchstart"in window && !i.ie && !i.edge,
- pointerEventsSupported: "onpointerdown"in window && (i.edge || i.ie && i.version >= 11)
- }
- }(navigator.userAgent), $v = {
- "[object Function]": 1,
- "[object RegExp]": 1,
- "[object Date]": 1,
- "[object Error]": 1,
- "[object CanvasGradient]": 1,
- "[object CanvasPattern]": 1,
- "[object Image]": 1,
- "[object Canvas]": 1
- }, Kv = {
- "[object Int8Array]": 1,
- "[object Uint8Array]": 1,
- "[object Uint8ClampedArray]": 1,
- "[object Int16Array]": 1,
- "[object Uint16Array]": 1,
- "[object Int32Array]": 1,
- "[object Uint32Array]": 1,
- "[object Float32Array]": 1,
- "[object Float64Array]": 1
- }, Jv = Object.prototype.toString, Qv = Array.prototype, ty = Qv.forEach, ey = Qv.filter, iy = Qv.slice, ny = Qv.map, oy = Qv.reduce, ay = function() {
- return document.createElement("canvas")
- }, ry = "__ec_primitive__";
- P.prototype = {
- constructor: P,
- get: function(t) {
- return this["_ec_" + t]
- },
- set: function(t, e) {
- return this["_ec_" + t] = e,
- e
- },
- each: function(t, e) {
- void 0 !== e && (t = p(t, e));
- for (var i in this)
- this.hasOwnProperty(i) && t(this[i], i.slice(4))
- },
- removeKey: function(t) {
- delete this["_ec_" + t]
- }
- };
- var sy = {
- createCanvas: function(t) {
- ay = t
- }
- }
- , ly = (Object.freeze || Object)({
- clone: e,
- merge: i,
- mergeAll: n,
- extend: o,
- defaults: a,
- createCanvas: ay,
- getContext: r,
- indexOf: s,
- inherits: l,
- mixin: h,
- isArrayLike: u,
- each: c,
- map: d,
- reduce: f,
- filter: g,
- find: function(t, e, i) {
- if (t && e)
- for (var n = 0, o = t.length; n < o; n++)
- if (e.call(i, t[n], n, t))
- return t[n]
- },
- bind: p,
- curry: m,
- isArray: v,
- isFunction: y,
- isString: x,
- isObject: _,
- isBuiltInObject: b,
- isDom: w,
- eqNaN: S,
- retrieve: M,
- retrieve2: I,
- retrieve3: T,
- slice: A,
- normalizeCssArray: C,
- assert: D,
- setAsPrimitive: L,
- isPrimitive: k,
- createHashMap: O,
- noop: z,
- $inject: sy
- })
- , hy = "undefined" == typeof Float32Array ? Array : Float32Array
- , uy = H
- , cy = F
- , dy = j
- , fy = X
- , gy = (Object.freeze || Object)({
- create: N,
- copy: E,
- clone: R,
- set: V,
- add: B,
- scaleAndAdd: G,
- sub: W,
- len: H,
- length: uy,
- lenSquare: F,
- lengthSquare: cy,
- mul: function(t, e, i) {
- return t[0] = e[0] * i[0],
- t[1] = e[1] * i[1],
- t
- },
- div: function(t, e, i) {
- return t[0] = e[0] / i[0],
- t[1] = e[1] / i[1],
- t
- },
- dot: function(t, e) {
- return t[0] * e[0] + t[1] * e[1]
- },
- scale: Z,
- normalize: U,
- distance: j,
- dist: dy,
- distanceSquare: X,
- distSquare: fy,
- negate: function(t, e) {
- return t[0] = -e[0],
- t[1] = -e[1],
- t
- },
- lerp: q,
- applyTransform: Y,
- min: $,
- max: K
- });
- J.prototype = {
- constructor: J,
- _dragStart: function(t) {
- var e = t.target;
- e && e.draggable && (this._draggingTarget = e,
- e.dragging = !0,
- this._x = t.offsetX,
- this._y = t.offsetY,
- this.dispatchToElement(Q(e, t), "dragstart", t.event))
- },
- _drag: function(t) {
- var e = this._draggingTarget;
- if (e) {
- var i = t.offsetX
- , n = t.offsetY
- , o = i - this._x
- , a = n - this._y;
- this._x = i,
- this._y = n,
- e.drift(o, a, t),
- this.dispatchToElement(Q(e, t), "drag", t.event);
- var r = this.findHover(i, n, e).target
- , s = this._dropTarget;
- this._dropTarget = r,
- e !== r && (s && r !== s && this.dispatchToElement(Q(s, t), "dragleave", t.event),
- r && r !== s && this.dispatchToElement(Q(r, t), "dragenter", t.event))
- }
- },
- _dragEnd: function(t) {
- var e = this._draggingTarget;
- e && (e.dragging = !1),
- this.dispatchToElement(Q(e, t), "dragend", t.event),
- this._dropTarget && this.dispatchToElement(Q(this._dropTarget, t), "drop", t.event),
- this._draggingTarget = null,
- this._dropTarget = null
- }
- };
- var py = Array.prototype.slice
- , my = function() {
- this._$handlers = {}
- };
- my.prototype = {
- constructor: my,
- one: function(t, e, i) {
- var n = this._$handlers;
- if (!e || !t)
- return this;
- n[t] || (n[t] = []);
- for (var o = 0; o < n[t].length; o++)
- if (n[t][o].h === e)
- return this;
- return n[t].push({
- h: e,
- one: !0,
- ctx: i || this
- }),
- this
- },
- on: function(t, e, i) {
- var n = this._$handlers;
- if (!e || !t)
- return this;
- n[t] || (n[t] = []);
- for (var o = 0; o < n[t].length; o++)
- if (n[t][o].h === e)
- return this;
- return n[t].push({
- h: e,
- one: !1,
- ctx: i || this
- }),
- this
- },
- isSilent: function(t) {
- var e = this._$handlers;
- return e[t] && e[t].length
- },
- off: function(t, e) {
- var i = this._$handlers;
- if (!t)
- return this._$handlers = {},
- this;
- if (e) {
- if (i[t]) {
- for (var n = [], o = 0, a = i[t].length; o < a; o++)
- i[t][o].h != e && n.push(i[t][o]);
- i[t] = n
- }
- i[t] && 0 === i[t].length && delete i[t]
- } else
- delete i[t];
- return this
- },
- trigger: function(t) {
- if (this._$handlers[t]) {
- var e = arguments
- , i = e.length;
- i > 3 && (e = py.call(e, 1));
- for (var n = this._$handlers[t], o = n.length, a = 0; a < o; ) {
- switch (i) {
- case 1:
- n[a].h.call(n[a].ctx);
- break;
- case 2:
- n[a].h.call(n[a].ctx, e[1]);
- break;
- case 3:
- n[a].h.call(n[a].ctx, e[1], e[2]);
- break;
- default:
- n[a].h.apply(n[a].ctx, e)
- }
- n[a].one ? (n.splice(a, 1),
- o--) : a++
- }
- }
- return this
- },
- triggerWithContext: function(t) {
- if (this._$handlers[t]) {
- var e = arguments
- , i = e.length;
- i > 4 && (e = py.call(e, 1, e.length - 1));
- for (var n = e[e.length - 1], o = this._$handlers[t], a = o.length, r = 0; r < a; ) {
- switch (i) {
- case 1:
- o[r].h.call(n);
- break;
- case 2:
- o[r].h.call(n, e[1]);
- break;
- case 3:
- o[r].h.call(n, e[1], e[2]);
- break;
- default:
- o[r].h.apply(n, e)
- }
- o[r].one ? (o.splice(r, 1),
- a--) : r++
- }
- }
- return this
- }
- };
- var vy = "silent";
- et.prototype.dispose = function() {}
- ;
- var yy = ["click", "dblclick", "mousewheel", "mouseout", "mouseup", "mousedown", "mousemove", "contextmenu"]
- , xy = function(t, e, i, n) {
- my.call(this),
- this.storage = t,
- this.painter = e,
- this.painterRoot = n,
- i = i || new et,
- this.proxy = i,
- i.handler = this,
- this._hovered = {},
- this._lastTouchMoment,
- this._lastX,
- this._lastY,
- J.call(this),
- c(yy, function(t) {
- i.on && i.on(t, this[t], this)
- }, this)
- };
- xy.prototype = {
- constructor: xy,
- mousemove: function(t) {
- var e = t.zrX
- , i = t.zrY
- , n = this._hovered
- , o = n.target;
- o && !o.__zr && (o = (n = this.findHover(n.x, n.y)).target);
- var a = this._hovered = this.findHover(e, i)
- , r = a.target
- , s = this.proxy;
- s.setCursor && s.setCursor(r ? r.cursor : "default"),
- o && r !== o && this.dispatchToElement(n, "mouseout", t),
- this.dispatchToElement(a, "mousemove", t),
- r && r !== o && this.dispatchToElement(a, "mouseover", t)
- },
- mouseout: function(t) {
- this.dispatchToElement(this._hovered, "mouseout", t);
- var e, i = t.toElement || t.relatedTarget;
- do {
- i = i && i.parentNode
- } while (i && 9 != i.nodeType && !(e = i === this.painterRoot));
- !e && this.trigger("globalout", {
- event: t
- })
- },
- resize: function(t) {
- this._hovered = {}
- },
- dispatch: function(t, e) {
- var i = this[t];
- i && i.call(this, e)
- },
- dispose: function() {
- this.proxy.dispose(),
- this.storage = this.proxy = this.painter = null
- },
- setCursorStyle: function(t) {
- var e = this.proxy;
- e.setCursor && e.setCursor(t)
- },
- dispatchToElement: function(t, e, i) {
- var n = (t = t || {}).target;
- if (!n || !n.silent) {
- for (var o = "on" + e, a = tt(e, t, i); n && (n[o] && (a.cancelBubble = n[o].call(n, a)),
- n.trigger(e, a),
- n = n.parent,
- !a.cancelBubble); )
- ;
- a.cancelBubble || (this.trigger(e, a),
- this.painter && this.painter.eachOtherLayer(function(t) {
- "function" == typeof t[o] && t[o].call(t, a),
- t.trigger && t.trigger(e, a)
- }))
- }
- },
- findHover: function(t, e, i) {
- for (var n = this.storage.getDisplayList(), o = {
- x: t,
- y: e
- }, a = n.length - 1; a >= 0; a--) {
- var r;
- if (n[a] !== i && !n[a].ignore && (r = it(n[a], t, e)) && (!o.topTarget && (o.topTarget = n[a]),
- r !== vy)) {
- o.target = n[a];
- break
- }
- }
- return o
- }
- },
- c(["click", "mousedown", "mouseup", "mousewheel", "dblclick", "contextmenu"], function(t) {
- xy.prototype[t] = function(e) {
- var i = this.findHover(e.zrX, e.zrY)
- , n = i.target;
- if ("mousedown" === t)
- this._downEl = n,
- this._downPoint = [e.zrX, e.zrY],
- this._upEl = n;
- else if ("mosueup" === t)
- this._upEl = n;
- else if ("click" === t) {
- if (this._downEl !== this._upEl || !this._downPoint || dy(this._downPoint, [e.zrX, e.zrY]) > 4)
- return;
- this._downPoint = null
- }
- this.dispatchToElement(i, t, e)
- }
- }),
- h(xy, my),
- h(xy, J);
- var _y = "undefined" == typeof Float32Array ? Array : Float32Array
- , by = (Object.freeze || Object)({
- create: nt,
- identity: ot,
- copy: at,
- mul: rt,
- translate: st,
- rotate: lt,
- scale: ht,
- invert: ut
- })
- , wy = ot
- , Sy = 5e-5
- , My = function(t) {
- (t = t || {}).position || (this.position = [0, 0]),
- null == t.rotation && (this.rotation = 0),
- t.scale || (this.scale = [1, 1]),
- this.origin = this.origin || null
- }
- , Iy = My.prototype;
- Iy.transform = null,
- Iy.needLocalTransform = function() {
- return ct(this.rotation) || ct(this.position[0]) || ct(this.position[1]) || ct(this.scale[0] - 1) || ct(this.scale[1] - 1)
- }
- ,
- Iy.updateTransform = function() {
- var t = this.parent
- , e = t && t.transform
- , i = this.needLocalTransform()
- , n = this.transform;
- i || e ? (n = n || nt(),
- i ? this.getLocalTransform(n) : wy(n),
- e && (i ? rt(n, t.transform, n) : at(n, t.transform)),
- this.transform = n,
- this.invTransform = this.invTransform || nt(),
- ut(this.invTransform, n)) : n && wy(n)
- }
- ,
- Iy.getLocalTransform = function(t) {
- return My.getLocalTransform(this, t)
- }
- ,
- Iy.setTransform = function(t) {
- var e = this.transform
- , i = t.dpr || 1;
- 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)
- }
- ,
- Iy.restoreTransform = function(t) {
- var e = t.dpr || 1;
- t.setTransform(e, 0, 0, e, 0, 0)
- }
- ;
- var Ty = [];
- Iy.decomposeTransform = function() {
- if (this.transform) {
- var t = this.parent
- , e = this.transform;
- t && t.transform && (rt(Ty, t.invTransform, e),
- e = Ty);
- var i = e[0] * e[0] + e[1] * e[1]
- , n = e[2] * e[2] + e[3] * e[3]
- , o = this.position
- , a = this.scale;
- ct(i - 1) && (i = Math.sqrt(i)),
- ct(n - 1) && (n = Math.sqrt(n)),
- e[0] < 0 && (i = -i),
- e[3] < 0 && (n = -n),
- o[0] = e[4],
- o[1] = e[5],
- a[0] = i,
- a[1] = n,
- this.rotation = Math.atan2(-e[1] / n, e[0] / i)
- }
- }
- ,
- Iy.getGlobalScale = function() {
- var t = this.transform;
- if (!t)
- return [1, 1];
- var e = Math.sqrt(t[0] * t[0] + t[1] * t[1])
- , i = Math.sqrt(t[2] * t[2] + t[3] * t[3]);
- return t[0] < 0 && (e = -e),
- t[3] < 0 && (i = -i),
- [e, i]
- }
- ,
- Iy.transformCoordToLocal = function(t, e) {
- var i = [t, e]
- , n = this.invTransform;
- return n && Y(i, i, n),
- i
- }
- ,
- Iy.transformCoordToGlobal = function(t, e) {
- var i = [t, e]
- , n = this.transform;
- return n && Y(i, i, n),
- i
- }
- ,
- My.getLocalTransform = function(t, e) {
- wy(e = e || []);
- var i = t.origin
- , n = t.scale || [1, 1]
- , o = t.rotation || 0
- , a = t.position || [0, 0];
- return i && (e[4] -= i[0],
- e[5] -= i[1]),
- ht(e, e, n),
- o && lt(e, e, o),
- i && (e[4] += i[0],
- e[5] += i[1]),
- e[4] += a[0],
- e[5] += a[1],
- e
- }
- ;
- var Ay = {
- linear: function(t) {
- return t
- },
- quadraticIn: function(t) {
- return t * t
- },
- quadraticOut: function(t) {
- return t * (2 - t)
- },
- quadraticInOut: function(t) {
- return (t *= 2) < 1 ? .5 * t * t : -.5 * (--t * (t - 2) - 1)
- },
- cubicIn: function(t) {
- return t * t * t
- },
- cubicOut: function(t) {
- return --t * t * t + 1
- },
- cubicInOut: function(t) {
- return (t *= 2) < 1 ? .5 * t * t * t : .5 * ((t -= 2) * t * t + 2)
- },
- quarticIn: function(t) {
- return t * t * t * t
- },
- quarticOut: function(t) {
- return 1 - --t * t * t * t
- },
- quarticInOut: function(t) {
- return (t *= 2) < 1 ? .5 * t * t * t * t : -.5 * ((t -= 2) * t * t * t - 2)
- },
- quinticIn: function(t) {
- return t * t * t * t * t
- },
- quinticOut: function(t) {
- return --t * t * t * t * t + 1
- },
- quinticInOut: function(t) {
- return (t *= 2) < 1 ? .5 * t * t * t * t * t : .5 * ((t -= 2) * t * t * t * t + 2)
- },
- sinusoidalIn: function(t) {
- return 1 - Math.cos(t * Math.PI / 2)
- },
- sinusoidalOut: function(t) {
- return Math.sin(t * Math.PI / 2)
- },
- sinusoidalInOut: function(t) {
- return .5 * (1 - Math.cos(Math.PI * t))
- },
- exponentialIn: function(t) {
- return 0 === t ? 0 : Math.pow(1024, t - 1)
- },
- exponentialOut: function(t) {
- return 1 === t ? 1 : 1 - Math.pow(2, -10 * t)
- },
- exponentialInOut: function(t) {
- return 0 === t ? 0 : 1 === t ? 1 : (t *= 2) < 1 ? .5 * Math.pow(1024, t - 1) : .5 * (2 - Math.pow(2, -10 * (t - 1)))
- },
- circularIn: function(t) {
- return 1 - Math.sqrt(1 - t * t)
- },
- circularOut: function(t) {
- return Math.sqrt(1 - --t * t)
- },
- circularInOut: function(t) {
- return (t *= 2) < 1 ? -.5 * (Math.sqrt(1 - t * t) - 1) : .5 * (Math.sqrt(1 - (t -= 2) * t) + 1)
- },
- elasticIn: function(t) {
- var e, i = .1;
- return 0 === t ? 0 : 1 === t ? 1 : (!i || i < 1 ? (i = 1,
- e = .1) : e = .4 * Math.asin(1 / i) / (2 * Math.PI),
- -i * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - e) * (2 * Math.PI) / .4))
- },
- elasticOut: function(t) {
- var e, i = .1;
- return 0 === t ? 0 : 1 === t ? 1 : (!i || i < 1 ? (i = 1,
- e = .1) : e = .4 * Math.asin(1 / i) / (2 * Math.PI),
- i * Math.pow(2, -10 * t) * Math.sin((t - e) * (2 * Math.PI) / .4) + 1)
- },
- elasticInOut: function(t) {
- var e, i = .1;
- return 0 === t ? 0 : 1 === t ? 1 : (!i || i < 1 ? (i = 1,
- e = .1) : e = .4 * Math.asin(1 / i) / (2 * Math.PI),
- (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)
- },
- backIn: function(t) {
- var e = 1.70158;
- return t * t * ((e + 1) * t - e)
- },
- backOut: function(t) {
- var e = 1.70158;
- return --t * t * ((e + 1) * t + e) + 1
- },
- backInOut: function(t) {
- var e = 2.5949095;
- return (t *= 2) < 1 ? t * t * ((e + 1) * t - e) * .5 : .5 * ((t -= 2) * t * ((e + 1) * t + e) + 2)
- },
- bounceIn: function(t) {
- return 1 - Ay.bounceOut(1 - t)
- },
- bounceOut: function(t) {
- 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
- },
- bounceInOut: function(t) {
- return t < .5 ? .5 * Ay.bounceIn(2 * t) : .5 * Ay.bounceOut(2 * t - 1) + .5
- }
- };
- dt.prototype = {
- constructor: dt,
- step: function(t, e) {
- if (this._initialized || (this._startTime = t + this._delay,
- this._initialized = !0),
- this._paused)
- this._pausedTime += e;
- else {
- var i = (t - this._startTime - this._pausedTime) / this._life;
- if (!(i < 0)) {
- i = Math.min(i, 1);
- var n = this.easing
- , o = "string" == typeof n ? Ay[n] : n
- , a = "function" == typeof o ? o(i) : i;
- return this.fire("frame", a),
- 1 == i ? this.loop ? (this.restart(t),
- "restart") : (this._needsRemove = !0,
- "destroy") : null
- }
- }
- },
- restart: function(t) {
- var e = (t - this._startTime - this._pausedTime) % this._life;
- this._startTime = t - e + this.gap,
- this._pausedTime = 0,
- this._needsRemove = !1
- },
- fire: function(t, e) {
- this[t = "on" + t] && this[t](this._target, e)
- },
- pause: function() {
- this._paused = !0
- },
- resume: function() {
- this._paused = !1
- }
- };
- var Cy = function() {
- this.head = null,
- this.tail = null,
- this._len = 0
- }
- , Dy = Cy.prototype;
- Dy.insert = function(t) {
- var e = new Ly(t);
- return this.insertEntry(e),
- e
- }
- ,
- Dy.insertEntry = function(t) {
- this.head ? (this.tail.next = t,
- t.prev = this.tail,
- t.next = null,
- this.tail = t) : this.head = this.tail = t,
- this._len++
- }
- ,
- Dy.remove = function(t) {
- var e = t.prev
- , i = t.next;
- e ? e.next = i : this.head = i,
- i ? i.prev = e : this.tail = e,
- t.next = t.prev = null,
- this._len--
- }
- ,
- Dy.len = function() {
- return this._len
- }
- ,
- Dy.clear = function() {
- this.head = this.tail = null,
- this._len = 0
- }
- ;
- var Ly = function(t) {
- this.value = t,
- this.next,
- this.prev
- }
- , ky = function(t) {
- this._list = new Cy,
- this._map = {},
- this._maxSize = t || 10,
- this._lastRemovedEntry = null
- }
- , Py = ky.prototype;
- Py.put = function(t, e) {
- var i = this._list
- , n = this._map
- , o = null;
- if (null == n[t]) {
- var a = i.len()
- , r = this._lastRemovedEntry;
- if (a >= this._maxSize && a > 0) {
- var s = i.head;
- i.remove(s),
- delete n[s.key],
- o = s.value,
- this._lastRemovedEntry = s
- }
- r ? r.value = e : r = new Ly(e),
- r.key = t,
- i.insertEntry(r),
- n[t] = r
- }
- return o
- }
- ,
- Py.get = function(t) {
- var e = this._map[t]
- , i = this._list;
- if (null != e)
- return e !== i.tail && (i.remove(e),
- i.insertEntry(e)),
- e.value
- }
- ,
- Py.clear = function() {
- this._list.clear(),
- this._map = {}
- }
- ;
- var Oy = {
- transparent: [0, 0, 0, 0],
- aliceblue: [240, 248, 255, 1],
- antiquewhite: [250, 235, 215, 1],
- aqua: [0, 255, 255, 1],
- aquamarine: [127, 255, 212, 1],
- azure: [240, 255, 255, 1],
- beige: [245, 245, 220, 1],
- bisque: [255, 228, 196, 1],
- black: [0, 0, 0, 1],
- blanchedalmond: [255, 235, 205, 1],
- blue: [0, 0, 255, 1],
- blueviolet: [138, 43, 226, 1],
- brown: [165, 42, 42, 1],
- burlywood: [222, 184, 135, 1],
- cadetblue: [95, 158, 160, 1],
- chartreuse: [127, 255, 0, 1],
- chocolate: [210, 105, 30, 1],
- coral: [255, 127, 80, 1],
- cornflowerblue: [100, 149, 237, 1],
- cornsilk: [255, 248, 220, 1],
- crimson: [220, 20, 60, 1],
- cyan: [0, 255, 255, 1],
- darkblue: [0, 0, 139, 1],
- darkcyan: [0, 139, 139, 1],
- darkgoldenrod: [184, 134, 11, 1],
- darkgray: [169, 169, 169, 1],
- darkgreen: [0, 100, 0, 1],
- darkgrey: [169, 169, 169, 1],
- darkkhaki: [189, 183, 107, 1],
- darkmagenta: [139, 0, 139, 1],
- darkolivegreen: [85, 107, 47, 1],
- darkorange: [255, 140, 0, 1],
- darkorchid: [153, 50, 204, 1],
- darkred: [139, 0, 0, 1],
- darksalmon: [233, 150, 122, 1],
- darkseagreen: [143, 188, 143, 1],
- darkslateblue: [72, 61, 139, 1],
- darkslategray: [47, 79, 79, 1],
- darkslategrey: [47, 79, 79, 1],
- darkturquoise: [0, 206, 209, 1],
- darkviolet: [148, 0, 211, 1],
- deeppink: [255, 20, 147, 1],
- deepskyblue: [0, 191, 255, 1],
- dimgray: [105, 105, 105, 1],
- dimgrey: [105, 105, 105, 1],
- dodgerblue: [30, 144, 255, 1],
- firebrick: [178, 34, 34, 1],
- floralwhite: [255, 250, 240, 1],
- forestgreen: [34, 139, 34, 1],
- fuchsia: [255, 0, 255, 1],
- gainsboro: [220, 220, 220, 1],
- ghostwhite: [248, 248, 255, 1],
- gold: [255, 215, 0, 1],
- goldenrod: [218, 165, 32, 1],
- gray: [128, 128, 128, 1],
- green: [0, 128, 0, 1],
- greenyellow: [173, 255, 47, 1],
- grey: [128, 128, 128, 1],
- honeydew: [240, 255, 240, 1],
- hotpink: [255, 105, 180, 1],
- indianred: [205, 92, 92, 1],
- indigo: [75, 0, 130, 1],
- ivory: [255, 255, 240, 1],
- khaki: [240, 230, 140, 1],
- lavender: [230, 230, 250, 1],
- lavenderblush: [255, 240, 245, 1],
- lawngreen: [124, 252, 0, 1],
- lemonchiffon: [255, 250, 205, 1],
- lightblue: [173, 216, 230, 1],
- lightcoral: [240, 128, 128, 1],
- lightcyan: [224, 255, 255, 1],
- lightgoldenrodyellow: [250, 250, 210, 1],
- lightgray: [211, 211, 211, 1],
- lightgreen: [144, 238, 144, 1],
- lightgrey: [211, 211, 211, 1],
- lightpink: [255, 182, 193, 1],
- lightsalmon: [255, 160, 122, 1],
- lightseagreen: [32, 178, 170, 1],
- lightskyblue: [135, 206, 250, 1],
- lightslategray: [119, 136, 153, 1],
- lightslategrey: [119, 136, 153, 1],
- lightsteelblue: [176, 196, 222, 1],
- lightyellow: [255, 255, 224, 1],
- lime: [0, 255, 0, 1],
- limegreen: [50, 205, 50, 1],
- linen: [250, 240, 230, 1],
- magenta: [255, 0, 255, 1],
- maroon: [128, 0, 0, 1],
- mediumaquamarine: [102, 205, 170, 1],
- mediumblue: [0, 0, 205, 1],
- mediumorchid: [186, 85, 211, 1],
- mediumpurple: [147, 112, 219, 1],
- mediumseagreen: [60, 179, 113, 1],
- mediumslateblue: [123, 104, 238, 1],
- mediumspringgreen: [0, 250, 154, 1],
- mediumturquoise: [72, 209, 204, 1],
- mediumvioletred: [199, 21, 133, 1],
- midnightblue: [25, 25, 112, 1],
- mintcream: [245, 255, 250, 1],
- mistyrose: [255, 228, 225, 1],
- moccasin: [255, 228, 181, 1],
- navajowhite: [255, 222, 173, 1],
- navy: [0, 0, 128, 1],
- oldlace: [253, 245, 230, 1],
- olive: [128, 128, 0, 1],
- olivedrab: [107, 142, 35, 1],
- orange: [255, 165, 0, 1],
- orangered: [255, 69, 0, 1],
- orchid: [218, 112, 214, 1],
- palegoldenrod: [238, 232, 170, 1],
- palegreen: [152, 251, 152, 1],
- paleturquoise: [175, 238, 238, 1],
- palevioletred: [219, 112, 147, 1],
- papayawhip: [255, 239, 213, 1],
- peachpuff: [255, 218, 185, 1],
- peru: [205, 133, 63, 1],
- pink: [255, 192, 203, 1],
- plum: [221, 160, 221, 1],
- powderblue: [176, 224, 230, 1],
- purple: [128, 0, 128, 1],
- red: [255, 0, 0, 1],
- rosybrown: [188, 143, 143, 1],
- royalblue: [65, 105, 225, 1],
- saddlebrown: [139, 69, 19, 1],
- salmon: [250, 128, 114, 1],
- sandybrown: [244, 164, 96, 1],
- seagreen: [46, 139, 87, 1],
- seashell: [255, 245, 238, 1],
- sienna: [160, 82, 45, 1],
- silver: [192, 192, 192, 1],
- skyblue: [135, 206, 235, 1],
- slateblue: [106, 90, 205, 1],
- slategray: [112, 128, 144, 1],
- slategrey: [112, 128, 144, 1],
- snow: [255, 250, 250, 1],
- springgreen: [0, 255, 127, 1],
- steelblue: [70, 130, 180, 1],
- tan: [210, 180, 140, 1],
- teal: [0, 128, 128, 1],
- thistle: [216, 191, 216, 1],
- tomato: [255, 99, 71, 1],
- turquoise: [64, 224, 208, 1],
- violet: [238, 130, 238, 1],
- wheat: [245, 222, 179, 1],
- white: [255, 255, 255, 1],
- whitesmoke: [245, 245, 245, 1],
- yellow: [255, 255, 0, 1],
- yellowgreen: [154, 205, 50, 1]
- }
- , zy = new ky(20)
- , Ny = null
- , Ey = Ct
- , Ry = Dt
- , Vy = (Object.freeze || Object)({
- parse: St,
- lift: Tt,
- toHex: At,
- fastLerp: Ct,
- fastMapToColor: Ey,
- lerp: Dt,
- mapToColor: Ry,
- modifyHSL: Lt,
- modifyAlpha: kt,
- stringify: Pt
- })
- , By = Array.prototype.slice
- , Gy = function(t, e, i, n) {
- this._tracks = {},
- this._target = t,
- this._loop = e || !1,
- this._getter = i || Ot,
- this._setter = n || zt,
- this._clipCount = 0,
- this._delay = 0,
- this._doneList = [],
- this._onframeList = [],
- this._clipList = []
- };
- Gy.prototype = {
- when: function(t, e) {
- var i = this._tracks;
- for (var n in e)
- if (e.hasOwnProperty(n)) {
- if (!i[n]) {
- i[n] = [];
- var o = this._getter(this._target, n);
- if (null == o)
- continue;
- 0 !== t && i[n].push({
- time: 0,
- value: Ht(o)
- })
- }
- i[n].push({
- time: t,
- value: e[n]
- })
- }
- return this
- },
- during: function(t) {
- return this._onframeList.push(t),
- this
- },
- pause: function() {
- for (var t = 0; t < this._clipList.length; t++)
- this._clipList[t].pause();
- this._paused = !0
- },
- resume: function() {
- for (var t = 0; t < this._clipList.length; t++)
- this._clipList[t].resume();
- this._paused = !1
- },
- isPaused: function() {
- return !!this._paused
- },
- _doneCallback: function() {
- this._tracks = {},
- this._clipList.length = 0;
- for (var t = this._doneList, e = t.length, i = 0; i < e; i++)
- t[i].call(this)
- },
- start: function(t, e) {
- var i, n = this, o = 0;
- for (var a in this._tracks)
- if (this._tracks.hasOwnProperty(a)) {
- var r = Ut(this, t, function() {
- --o || n._doneCallback()
- }, this._tracks[a], a, e);
- r && (this._clipList.push(r),
- o++,
- this.animation && this.animation.addClip(r),
- i = r)
- }
- if (i) {
- var s = i.onframe;
- i.onframe = function(t, e) {
- s(t, e);
- for (var i = 0; i < n._onframeList.length; i++)
- n._onframeList[i](t, e)
- }
- }
- return o || this._doneCallback(),
- this
- },
- stop: function(t) {
- for (var e = this._clipList, i = this.animation, n = 0; n < e.length; n++) {
- var o = e[n];
- t && o.onframe(this._target, 1),
- i && i.removeClip(o)
- }
- e.length = 0
- },
- delay: function(t) {
- return this._delay = t,
- this
- },
- done: function(t) {
- return t && this._doneList.push(t),
- this
- },
- getClips: function() {
- return this._clipList
- }
- };
- var Wy = 1;
- "undefined" != typeof window && (Wy = Math.max(window.devicePixelRatio || 1, 1));
- var Hy = Wy
- , Fy = function() {}
- , Zy = Fy
- , Uy = function() {
- this.animators = []
- };
- Uy.prototype = {
- constructor: Uy,
- animate: function(t, e) {
- var i, n = !1, o = this, a = this.__zr;
- if (t) {
- var r = t.split(".")
- , l = o;
- n = "shape" === r[0];
- for (var h = 0, u = r.length; h < u; h++)
- l && (l = l[r[h]]);
- l && (i = l)
- } else
- i = o;
- if (i) {
- var c = o.animators
- , d = new Gy(i,e);
- return d.during(function(t) {
- o.dirty(n)
- }).done(function() {
- c.splice(s(c, d), 1)
- }),
- c.push(d),
- a && a.animation.addAnimator(d),
- d
- }
- Zy('Property "' + t + '" is not existed in element ' + o.id)
- },
- stopAnimation: function(t) {
- for (var e = this.animators, i = e.length, n = 0; n < i; n++)
- e[n].stop(t);
- return e.length = 0,
- this
- },
- animateTo: function(t, e, i, n, o, a) {
- x(i) ? (o = n,
- n = i,
- i = 0) : y(n) ? (o = n,
- n = "linear",
- i = 0) : y(i) ? (o = i,
- i = 0) : y(e) ? (o = e,
- e = 500) : e || (e = 500),
- this.stopAnimation(),
- this._animateToShallow("", this, t, e, i);
- var r = this.animators.slice()
- , s = r.length;
- s || o && o();
- for (var l = 0; l < r.length; l++)
- r[l].done(function() {
- --s || o && o()
- }).start(n, a)
- },
- _animateToShallow: function(t, e, i, n, o) {
- var a = {}
- , r = 0;
- for (var s in i)
- if (i.hasOwnProperty(s))
- if (null != e[s])
- _(i[s]) && !u(i[s]) ? this._animateToShallow(t ? t + "." + s : s, e[s], i[s], n, o) : (a[s] = i[s],
- r++);
- else if (null != i[s])
- if (t) {
- var l = {};
- l[t] = {},
- l[t][s] = i[s],
- this.attr(l)
- } else
- this.attr(s, i[s]);
- return r > 0 && this.animate(t, !1).when(null == n ? 500 : n, a).delay(o || 0),
- this
- }
- };
- var jy = function(t) {
- My.call(this, t),
- my.call(this, t),
- Uy.call(this, t),
- this.id = t.id || Xv()
- };
- jy.prototype = {
- type: "element",
- name: "",
- __zr: null,
- ignore: !1,
- clipPath: null,
- drift: function(t, e) {
- switch (this.draggable) {
- case "horizontal":
- e = 0;
- break;
- case "vertical":
- t = 0
- }
- var i = this.transform;
- i || (i = this.transform = [1, 0, 0, 1, 0, 0]),
- i[4] += t,
- i[5] += e,
- this.decomposeTransform(),
- this.dirty(!1)
- },
- beforeUpdate: function() {},
- afterUpdate: function() {},
- update: function() {
- this.updateTransform()
- },
- traverse: function(t, e) {},
- attrKV: function(t, e) {
- if ("position" === t || "scale" === t || "origin" === t) {
- if (e) {
- var i = this[t];
- i || (i = this[t] = []),
- i[0] = e[0],
- i[1] = e[1]
- }
- } else
- this[t] = e
- },
- hide: function() {
- this.ignore = !0,
- this.__zr && this.__zr.refresh()
- },
- show: function() {
- this.ignore = !1,
- this.__zr && this.__zr.refresh()
- },
- attr: function(t, e) {
- if ("string" == typeof t)
- this.attrKV(t, e);
- else if (_(t))
- for (var i in t)
- t.hasOwnProperty(i) && this.attrKV(i, t[i]);
- return this.dirty(!1),
- this
- },
- setClipPath: function(t) {
- var e = this.__zr;
- e && t.addSelfToZr(e),
- this.clipPath && this.clipPath !== t && this.removeClipPath(),
- this.clipPath = t,
- t.__zr = e,
- t.__clipTarget = this,
- this.dirty(!1)
- },
- removeClipPath: function() {
- var t = this.clipPath;
- t && (t.__zr && t.removeSelfFromZr(t.__zr),
- t.__zr = null,
- t.__clipTarget = null,
- this.clipPath = null,
- this.dirty(!1))
- },
- addSelfToZr: function(t) {
- this.__zr = t;
- var e = this.animators;
- if (e)
- for (var i = 0; i < e.length; i++)
- t.animation.addAnimator(e[i]);
- this.clipPath && this.clipPath.addSelfToZr(t)
- },
- removeSelfFromZr: function(t) {
- this.__zr = null;
- var e = this.animators;
- if (e)
- for (var i = 0; i < e.length; i++)
- t.animation.removeAnimator(e[i]);
- this.clipPath && this.clipPath.removeSelfFromZr(t)
- }
- },
- h(jy, Uy),
- h(jy, My),
- h(jy, my);
- var Xy = Y
- , qy = Math.min
- , Yy = Math.max;
- jt.prototype = {
- constructor: jt,
- union: function(t) {
- var e = qy(t.x, this.x)
- , i = qy(t.y, this.y);
- this.width = Yy(t.x + t.width, this.x + this.width) - e,
- this.height = Yy(t.y + t.height, this.y + this.height) - i,
- this.x = e,
- this.y = i
- },
- applyTransform: function() {
- var t = []
- , e = []
- , i = []
- , n = [];
- return function(o) {
- if (o) {
- t[0] = i[0] = this.x,
- t[1] = n[1] = this.y,
- e[0] = n[0] = this.x + this.width,
- e[1] = i[1] = this.y + this.height,
- Xy(t, t, o),
- Xy(e, e, o),
- Xy(i, i, o),
- Xy(n, n, o),
- this.x = qy(t[0], e[0], i[0], n[0]),
- this.y = qy(t[1], e[1], i[1], n[1]);
- var a = Yy(t[0], e[0], i[0], n[0])
- , r = Yy(t[1], e[1], i[1], n[1]);
- this.width = a - this.x,
- this.height = r - this.y
- }
- }
- }(),
- calculateTransform: function(t) {
- var e = this
- , i = t.width / e.width
- , n = t.height / e.height
- , o = nt();
- return st(o, o, [-e.x, -e.y]),
- ht(o, o, [i, n]),
- st(o, o, [t.x, t.y]),
- o
- },
- intersect: function(t) {
- if (!t)
- return !1;
- t instanceof jt || (t = jt.create(t));
- var e = this
- , i = e.x
- , n = e.x + e.width
- , o = e.y
- , a = e.y + e.height
- , r = t.x
- , s = t.x + t.width
- , l = t.y
- , h = t.y + t.height;
- return !(n < r || s < i || a < l || h < o)
- },
- contain: function(t, e) {
- var i = this;
- return t >= i.x && t <= i.x + i.width && e >= i.y && e <= i.y + i.height
- },
- clone: function() {
- return new jt(this.x,this.y,this.width,this.height)
- },
- copy: function(t) {
- this.x = t.x,
- this.y = t.y,
- this.width = t.width,
- this.height = t.height
- },
- plain: function() {
- return {
- x: this.x,
- y: this.y,
- width: this.width,
- height: this.height
- }
- }
- },
- jt.create = function(t) {
- return new jt(t.x,t.y,t.width,t.height)
- }
- ;
- var $y = function(t) {
- t = t || {},
- jy.call(this, t);
- for (var e in t)
- t.hasOwnProperty(e) && (this[e] = t[e]);
- this._children = [],
- this.__storage = null,
- this.__dirty = !0
- };
- $y.prototype = {
- constructor: $y,
- isGroup: !0,
- type: "group",
- silent: !1,
- children: function() {
- return this._children.slice()
- },
- childAt: function(t) {
- return this._children[t]
- },
- childOfName: function(t) {
- for (var e = this._children, i = 0; i < e.length; i++)
- if (e[i].name === t)
- return e[i]
- },
- childCount: function() {
- return this._children.length
- },
- add: function(t) {
- return t && t !== this && t.parent !== this && (this._children.push(t),
- this._doAdd(t)),
- this
- },
- addBefore: function(t, e) {
- if (t && t !== this && t.parent !== this && e && e.parent === this) {
- var i = this._children
- , n = i.indexOf(e);
- n >= 0 && (i.splice(n, 0, t),
- this._doAdd(t))
- }
- return this
- },
- _doAdd: function(t) {
- t.parent && t.parent.remove(t),
- t.parent = this;
- var e = this.__storage
- , i = this.__zr;
- e && e !== t.__storage && (e.addToStorage(t),
- t instanceof $y && t.addChildrenToStorage(e)),
- i && i.refresh()
- },
- remove: function(t) {
- var e = this.__zr
- , i = this.__storage
- , n = this._children
- , o = s(n, t);
- return o < 0 ? this : (n.splice(o, 1),
- t.parent = null,
- i && (i.delFromStorage(t),
- t instanceof $y && t.delChildrenFromStorage(i)),
- e && e.refresh(),
- this)
- },
- removeAll: function() {
- var t, e, i = this._children, n = this.__storage;
- for (e = 0; e < i.length; e++)
- t = i[e],
- n && (n.delFromStorage(t),
- t instanceof $y && t.delChildrenFromStorage(n)),
- t.parent = null;
- return i.length = 0,
- this
- },
- eachChild: function(t, e) {
- for (var i = this._children, n = 0; n < i.length; n++) {
- var o = i[n];
- t.call(e, o, n)
- }
- return this
- },
- traverse: function(t, e) {
- for (var i = 0; i < this._children.length; i++) {
- var n = this._children[i];
- t.call(e, n),
- "group" === n.type && n.traverse(t, e)
- }
- return this
- },
- addChildrenToStorage: function(t) {
- for (var e = 0; e < this._children.length; e++) {
- var i = this._children[e];
- t.addToStorage(i),
- i instanceof $y && i.addChildrenToStorage(t)
- }
- },
- delChildrenFromStorage: function(t) {
- for (var e = 0; e < this._children.length; e++) {
- var i = this._children[e];
- t.delFromStorage(i),
- i instanceof $y && i.delChildrenFromStorage(t)
- }
- },
- dirty: function() {
- return this.__dirty = !0,
- this.__zr && this.__zr.refresh(),
- this
- },
- getBoundingRect: function(t) {
- for (var e = null, i = new jt(0,0,0,0), n = t || this._children, o = [], a = 0; a < n.length; a++) {
- var r = n[a];
- if (!r.ignore && !r.invisible) {
- var s = r.getBoundingRect()
- , l = r.getLocalTransform(o);
- l ? (i.copy(s),
- i.applyTransform(l),
- (e = e || i.clone()).union(i)) : (e = e || s.clone()).union(s)
- }
- }
- return e || i
- }
- },
- l($y, jy);
- var Ky = 32
- , Jy = 7
- , Qy = function() {
- this._roots = [],
- this._displayList = [],
- this._displayListLen = 0
- };
- Qy.prototype = {
- constructor: Qy,
- traverse: function(t, e) {
- for (var i = 0; i < this._roots.length; i++)
- this._roots[i].traverse(t, e)
- },
- getDisplayList: function(t, e) {
- return e = e || !1,
- t && this.updateDisplayList(e),
- this._displayList
- },
- updateDisplayList: function(t) {
- this._displayListLen = 0;
- for (var e = this._roots, i = this._displayList, n = 0, o = e.length; n < o; n++)
- this._updateAndAddDisplayable(e[n], null, t);
- i.length = this._displayListLen,
- Yv.canvasSupported && te(i, ee)
- },
- _updateAndAddDisplayable: function(t, e, i) {
- if (!t.ignore || i) {
- t.beforeUpdate(),
- t.__dirty && t.update(),
- t.afterUpdate();
- var n = t.clipPath;
- if (n) {
- e = e ? e.slice() : [];
- for (var o = n, a = t; o; )
- o.parent = a,
- o.updateTransform(),
- e.push(o),
- a = o,
- o = o.clipPath
- }
- if (t.isGroup) {
- for (var r = t._children, s = 0; s < r.length; s++) {
- var l = r[s];
- t.__dirty && (l.__dirty = !0),
- this._updateAndAddDisplayable(l, e, i)
- }
- t.__dirty = !1
- } else
- t.__clipPaths = e,
- this._displayList[this._displayListLen++] = t
- }
- },
- addRoot: function(t) {
- t.__storage !== this && (t instanceof $y && t.addChildrenToStorage(this),
- this.addToStorage(t),
- this._roots.push(t))
- },
- delRoot: function(t) {
- if (null == t) {
- for (i = 0; i < this._roots.length; i++) {
- var e = this._roots[i];
- e instanceof $y && e.delChildrenFromStorage(this)
- }
- return this._roots = [],
- this._displayList = [],
- void (this._displayListLen = 0)
- }
- if (t instanceof Array)
- for (var i = 0, n = t.length; i < n; i++)
- this.delRoot(t[i]);
- else {
- var o = s(this._roots, t);
- o >= 0 && (this.delFromStorage(t),
- this._roots.splice(o, 1),
- t instanceof $y && t.delChildrenFromStorage(this))
- }
- },
- addToStorage: function(t) {
- return t.__storage = this,
- t.dirty(!1),
- this
- },
- delFromStorage: function(t) {
- return t && (t.__storage = null),
- this
- },
- dispose: function() {
- this._renderList = this._roots = null
- },
- displayableSortFunc: ee
- };
- var tx = [["shadowBlur", 0], ["shadowOffsetX", 0], ["shadowOffsetY", 0], ["shadowColor", "#000"], ["lineCap", "butt"], ["lineJoin", "miter"], ["miterLimit", 10]]
- , ex = function(t, e) {
- this.extendFrom(t, !1),
- this.host = e
- };
- ex.prototype = {
- constructor: ex,
- host: null,
- fill: "#000",
- stroke: null,
- opacity: 1,
- lineDash: null,
- lineDashOffset: 0,
- shadowBlur: 0,
- shadowOffsetX: 0,
- shadowOffsetY: 0,
- lineWidth: 1,
- strokeNoScale: !1,
- text: null,
- font: null,
- textFont: null,
- fontStyle: null,
- fontWeight: null,
- fontSize: null,
- fontFamily: null,
- textTag: null,
- textFill: "#000",
- textStroke: null,
- textWidth: null,
- textHeight: null,
- textStrokeWidth: 0,
- textLineHeight: null,
- textPosition: "inside",
- textRect: null,
- textOffset: null,
- textAlign: null,
- textVerticalAlign: null,
- textDistance: 5,
- textShadowColor: "transparent",
- textShadowBlur: 0,
- textShadowOffsetX: 0,
- textShadowOffsetY: 0,
- textBoxShadowColor: "transparent",
- textBoxShadowBlur: 0,
- textBoxShadowOffsetX: 0,
- textBoxShadowOffsetY: 0,
- transformText: !1,
- textRotation: 0,
- textOrigin: null,
- textBackgroundColor: null,
- textBorderColor: null,
- textBorderWidth: 0,
- textBorderRadius: 0,
- textPadding: null,
- rich: null,
- truncate: null,
- blend: null,
- bind: function(t, e, i) {
- for (var n = this, o = i && i.style, a = !o, r = 0; r < tx.length; r++) {
- var s = tx[r]
- , l = s[0];
- (a || n[l] !== o[l]) && (t[l] = n[l] || s[1])
- }
- if ((a || n.fill !== o.fill) && (t.fillStyle = n.fill),
- (a || n.stroke !== o.stroke) && (t.strokeStyle = n.stroke),
- (a || n.opacity !== o.opacity) && (t.globalAlpha = null == n.opacity ? 1 : n.opacity),
- (a || n.blend !== o.blend) && (t.globalCompositeOperation = n.blend || "source-over"),
- this.hasStroke()) {
- var h = n.lineWidth;
- t.lineWidth = h / (this.strokeNoScale && e && e.getLineScale ? e.getLineScale() : 1)
- }
- },
- hasFill: function() {
- var t = this.fill;
- return null != t && "none" !== t
- },
- hasStroke: function() {
- var t = this.stroke;
- return null != t && "none" !== t && this.lineWidth > 0
- },
- extendFrom: function(t, e) {
- if (t)
- for (var i in t)
- !t.hasOwnProperty(i) || !0 !== e && (!1 === e ? this.hasOwnProperty(i) : null == t[i]) || (this[i] = t[i])
- },
- set: function(t, e) {
- "string" == typeof t ? this[t] = e : this.extendFrom(t, !0)
- },
- clone: function() {
- var t = new this.constructor;
- return t.extendFrom(this, !0),
- t
- },
- getGradient: function(t, e, i) {
- for (var n = ("radial" === e.type ? ne : ie)(t, e, i), o = e.colorStops, a = 0; a < o.length; a++)
- n.addColorStop(o[a].offset, o[a].color);
- return n
- }
- };
- for (var ix = ex.prototype, nx = 0; nx < tx.length; nx++) {
- var ox = tx[nx];
- ox[0]in ix || (ix[ox[0]] = ox[1])
- }
- ex.getGradient = ix.getGradient;
- var ax = function(t, e) {
- this.image = t,
- this.repeat = e,
- this.type = "pattern"
- };
- ax.prototype.getCanvasPattern = function(t) {
- return t.createPattern(this.image, this.repeat || "repeat")
- }
- ;
- var rx = function(t, e, i) {
- var n;
- i = i || Hy,
- "string" == typeof t ? n = ae(t, e, i) : _(t) && (t = (n = t).id),
- this.id = t,
- this.dom = n;
- var o = n.style;
- o && (n.onselectstart = oe,
- o["-webkit-user-select"] = "none",
- o["user-select"] = "none",
- o["-webkit-touch-callout"] = "none",
- o["-webkit-tap-highlight-color"] = "rgba(0,0,0,0)",
- o.padding = 0,
- o.margin = 0,
- o["border-width"] = 0),
- this.domBack = null,
- this.ctxBack = null,
- this.painter = e,
- this.config = null,
- this.clearColor = 0,
- this.motionBlur = !1,
- this.lastFrameAlpha = .7,
- this.dpr = i
- };
- rx.prototype = {
- constructor: rx,
- elCount: 0,
- __dirty: !0,
- initContext: function() {
- this.ctx = this.dom.getContext("2d"),
- this.ctx.__currentValues = {},
- this.ctx.dpr = this.dpr
- },
- createBackBuffer: function() {
- var t = this.dpr;
- this.domBack = ae("back-" + this.id, this.painter, t),
- this.ctxBack = this.domBack.getContext("2d"),
- this.ctxBack.__currentValues = {},
- 1 != t && this.ctxBack.scale(t, t)
- },
- resize: function(t, e) {
- var i = this.dpr
- , n = this.dom
- , o = n.style
- , a = this.domBack;
- o.width = t + "px",
- o.height = e + "px",
- n.width = t * i,
- n.height = e * i,
- a && (a.width = t * i,
- a.height = e * i,
- 1 != i && this.ctxBack.scale(i, i))
- },
- clear: function(t) {
- var e = this.dom
- , i = this.ctx
- , n = e.width
- , o = e.height
- , a = this.clearColor
- , r = this.motionBlur && !t
- , s = this.lastFrameAlpha
- , l = this.dpr;
- if (r && (this.domBack || this.createBackBuffer(),
- this.ctxBack.globalCompositeOperation = "copy",
- this.ctxBack.drawImage(e, 0, 0, n / l, o / l)),
- i.clearRect(0, 0, n, o),
- a) {
- var h;
- a.colorStops ? (h = a.__canvasGradient || ex.getGradient(i, a, {
- x: 0,
- y: 0,
- width: n,
- height: o
- }),
- a.__canvasGradient = h) : a.image && (h = ax.prototype.getCanvasPattern.call(a, i)),
- i.save(),
- i.fillStyle = h || a,
- i.fillRect(0, 0, n, o),
- i.restore()
- }
- if (r) {
- var u = this.domBack;
- i.save(),
- i.globalAlpha = s,
- i.drawImage(u, 0, 0, n, o),
- i.restore()
- }
- }
- };
- var sx = "undefined" != typeof window && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function(t) {
- setTimeout(t, 16)
- }
- , lx = new ky(50)
- , hx = {}
- , ux = 0
- , cx = 5e3
- , dx = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g
- , fx = "12px sans-serif"
- , gx = function(t, e) {
- var i = r();
- return i.font = e || fx,
- i.measureText(t)
- }
- , px = {
- measureText: function(t) {
- gx = t
- }
- }
- , mx = {
- left: 1,
- right: 1,
- center: 1
- }
- , vx = {
- top: 1,
- bottom: 1,
- middle: 1
- }
- , yx = new jt
- , xx = function() {};
- xx.prototype = {
- constructor: xx,
- drawRectText: function(t, e) {
- var i = this.style;
- e = i.textRect || e,
- this.__dirty && Ae(i);
- var n = i.text;
- if (null != n && (n += ""),
- Ze(n, i)) {
- t.save();
- var o = this.transform;
- i.transformText ? this.setTransform(t) : o && (yx.copy(e),
- yx.applyTransform(o),
- e = yx),
- De(this, t, n, i, e),
- t.restore()
- }
- }
- },
- Ue.prototype = {
- constructor: Ue,
- type: "displayable",
- __dirty: !0,
- invisible: !1,
- z: 0,
- z2: 0,
- zlevel: 0,
- draggable: !1,
- dragging: !1,
- silent: !1,
- culling: !1,
- cursor: "pointer",
- rectHover: !1,
- progressive: -1,
- beforeBrush: function(t) {},
- afterBrush: function(t) {},
- brush: function(t, e) {},
- getBoundingRect: function() {},
- contain: function(t, e) {
- return this.rectContain(t, e)
- },
- traverse: function(t, e) {
- t.call(e, this)
- },
- rectContain: function(t, e) {
- var i = this.transformCoordToLocal(t, e);
- return this.getBoundingRect().contain(i[0], i[1])
- },
- dirty: function() {
- this.__dirty = !0,
- this._rect = null,
- this.__zr && this.__zr.refresh()
- },
- animateStyle: function(t) {
- return this.animate("style", t)
- },
- attrKV: function(t, e) {
- "style" !== t ? jy.prototype.attrKV.call(this, t, e) : this.style.set(e)
- },
- setStyle: function(t, e) {
- return this.style.set(t, e),
- this.dirty(!1),
- this
- },
- useStyle: function(t) {
- return this.style = new ex(t,this),
- this.dirty(!1),
- this
- }
- },
- l(Ue, jy),
- h(Ue, xx),
- je.prototype = {
- constructor: je,
- type: "image",
- brush: function(t, e) {
- var i = this.style
- , n = i.image;
- i.bind(t, this, e);
- var o = this._image = se(n, this._image, this, this.onload);
- if (o && he(o)) {
- var a = i.x || 0
- , r = i.y || 0
- , s = i.width
- , l = i.height
- , h = o.width / o.height;
- if (null == s && null != l ? s = l * h : null == l && null != s ? l = s / h : null == s && null == l && (s = o.width,
- l = o.height),
- this.setTransform(t),
- i.sWidth && i.sHeight) {
- var u = i.sx || 0
- , c = i.sy || 0;
- t.drawImage(o, u, c, i.sWidth, i.sHeight, a, r, s, l)
- } else if (i.sx && i.sy) {
- var d = s - (u = i.sx)
- , f = l - (c = i.sy);
- t.drawImage(o, u, c, d, f, a, r, s, l)
- } else
- t.drawImage(o, a, r, s, l);
- this.restoreTransform(t),
- null != i.text && this.drawRectText(t, this.getBoundingRect())
- }
- },
- getBoundingRect: function() {
- var t = this.style;
- return this._rect || (this._rect = new jt(t.x || 0,t.y || 0,t.width || 0,t.height || 0)),
- this._rect
- }
- },
- l(je, Ue);
- var _x = new jt(0,0,0,0)
- , bx = new jt(0,0,0,0)
- , wx = function(t, e, i) {
- this.type = "canvas";
- var n = !t.nodeName || "CANVAS" === t.nodeName.toUpperCase();
- this._opts = i = o({}, i || {}),
- this.dpr = i.devicePixelRatio || Hy,
- this._singleCanvas = n,
- this.root = t;
- var a = t.style;
- a && (a["-webkit-tap-highlight-color"] = "transparent",
- a["-webkit-user-select"] = a["user-select"] = a["-webkit-touch-callout"] = "none",
- t.innerHTML = ""),
- this.storage = e;
- var r = this._zlevelList = []
- , s = this._layers = {};
- if (this._layerConfig = {},
- n) {
- null != i.width && (t.width = i.width),
- null != i.height && (t.height = i.height);
- var l = t.width
- , h = t.height;
- this._width = l,
- this._height = h;
- var u = new rx(t,this,1);
- u.initContext(),
- s[0] = u,
- r.push(0),
- this._domRoot = t
- } else {
- this._width = this._getSize(0),
- this._height = this._getSize(1);
- var c = this._domRoot = ti(this._width, this._height);
- t.appendChild(c)
- }
- this._progressiveLayers = [],
- this._hoverlayer,
- this._hoverElements = []
- };
- wx.prototype = {
- constructor: wx,
- getType: function() {
- return "canvas"
- },
- isSingleCanvas: function() {
- return this._singleCanvas
- },
- getViewportRoot: function() {
- return this._domRoot
- },
- getViewportRootOffset: function() {
- var t = this.getViewportRoot();
- if (t)
- return {
- offsetLeft: t.offsetLeft || 0,
- offsetTop: t.offsetTop || 0
- }
- },
- refresh: function(t) {
- var e = this.storage.getDisplayList(!0)
- , i = this._zlevelList;
- this._paintList(e, t);
- for (var n = 0; n < i.length; n++) {
- var o = i[n]
- , a = this._layers[o];
- !a.__builtin__ && a.refresh && a.refresh()
- }
- return this.refreshHover(),
- this._progressiveLayers.length && this._startProgessive(),
- this
- },
- addHover: function(t, e) {
- if (!t.__hoverMir) {
- var i = new t.constructor({
- style: t.style,
- shape: t.shape
- });
- i.__from = t,
- t.__hoverMir = i,
- i.setStyle(e),
- this._hoverElements.push(i)
- }
- },
- removeHover: function(t) {
- var e = t.__hoverMir
- , i = this._hoverElements
- , n = s(i, e);
- n >= 0 && i.splice(n, 1),
- t.__hoverMir = null
- },
- clearHover: function(t) {
- for (var e = this._hoverElements, i = 0; i < e.length; i++) {
- var n = e[i].__from;
- n && (n.__hoverMir = null)
- }
- e.length = 0
- },
- refreshHover: function() {
- var t = this._hoverElements
- , e = t.length
- , i = this._hoverlayer;
- if (i && i.clear(),
- e) {
- te(t, this.storage.displayableSortFunc),
- i || (i = this._hoverlayer = this.getLayer(1e5));
- var n = {};
- i.ctx.save();
- for (var o = 0; o < e; ) {
- var a = t[o]
- , r = a.__from;
- r && r.__zr ? (o++,
- r.invisible || (a.transform = r.transform,
- a.invTransform = r.invTransform,
- a.__clipPaths = r.__clipPaths,
- this._doPaintEl(a, i, !0, n))) : (t.splice(o, 1),
- r.__hoverMir = null,
- e--)
- }
- i.ctx.restore()
- }
- },
- _startProgessive: function() {
- function t() {
- i === e._progressiveToken && e.storage && (e._doPaintList(e.storage.getDisplayList()),
- e._furtherProgressive ? (e._progress++,
- sx(t)) : e._progressiveToken = -1)
- }
- var e = this;
- if (e._furtherProgressive) {
- var i = e._progressiveToken = +new Date;
- e._progress++,
- sx(t)
- }
- },
- _clearProgressive: function() {
- this._progressiveToken = -1,
- this._progress = 0,
- c(this._progressiveLayers, function(t) {
- t.__dirty && t.clear()
- })
- },
- _paintList: function(t, e) {
- null == e && (e = !1),
- this._updateLayerStatus(t),
- this._clearProgressive(),
- this.eachBuiltinLayer(Ye),
- this._doPaintList(t, e),
- this.eachBuiltinLayer($e)
- },
- _doPaintList: function(t, e) {
- function i(t) {
- var e = a.dpr || 1;
- a.save(),
- a.globalAlpha = 1,
- a.shadowBlur = 0,
- n.__dirty = !0,
- a.setTransform(1, 0, 0, 1, 0, 0),
- a.drawImage(t.dom, 0, 0, u * e, d * e),
- a.restore()
- }
- for (var n, o, a, r, s, l, h = 0, u = this._width, d = this._height, f = this._progress, g = 0, p = t.length; g < p; g++) {
- var m = t[g]
- , v = this._singleCanvas ? 0 : m.zlevel
- , y = m.__frame;
- if (y < 0 && s && (i(s),
- s = null),
- o !== v && (a && a.restore(),
- r = {},
- o = v,
- (n = this.getLayer(o)).__builtin__ || Zy("ZLevel " + o + " has been used by unkown layer " + n.id),
- (a = n.ctx).save(),
- n.__unusedCount = 0,
- (n.__dirty || e) && n.clear()),
- n.__dirty || e) {
- if (y >= 0) {
- if (!s) {
- if ((s = this._progressiveLayers[Math.min(h++, 4)]).ctx.save(),
- s.renderScope = {},
- s && s.__progress > s.__maxProgress) {
- g = s.__nextIdxNotProg - 1;
- continue
- }
- l = s.__progress,
- s.__dirty || (f = l),
- s.__progress = f + 1
- }
- y === f && this._doPaintEl(m, s, !0, s.renderScope)
- } else
- this._doPaintEl(m, n, e, r);
- m.__dirty = !1
- }
- }
- s && i(s),
- a && a.restore(),
- this._furtherProgressive = !1,
- c(this._progressiveLayers, function(t) {
- t.__maxProgress >= t.__progress && (this._furtherProgressive = !0)
- }, this)
- },
- _doPaintEl: function(t, e, i, n) {
- var o = e.ctx
- , a = t.transform;
- if ((e.__dirty || i) && !t.invisible && 0 !== t.style.opacity && (!a || a[0] || a[3]) && (!t.culling || !Ke(t, this._width, this._height))) {
- var r = t.__clipPaths;
- (n.prevClipLayer !== e || Je(r, n.prevElClipPaths)) && (n.prevElClipPaths && (n.prevClipLayer.ctx.restore(),
- n.prevClipLayer = n.prevElClipPaths = null,
- n.prevEl = null),
- r && (o.save(),
- Qe(r, o),
- n.prevClipLayer = e,
- n.prevElClipPaths = r)),
- t.beforeBrush && t.beforeBrush(o),
- t.brush(o, n.prevEl || null),
- n.prevEl = t,
- t.afterBrush && t.afterBrush(o)
- }
- },
- getLayer: function(t) {
- if (this._singleCanvas)
- return this._layers[0];
- var e = this._layers[t];
- return e || ((e = new rx("zr_" + t,this,this.dpr)).__builtin__ = !0,
- this._layerConfig[t] && i(e, this._layerConfig[t], !0),
- this.insertLayer(t, e),
- e.initContext()),
- e
- },
- insertLayer: function(t, e) {
- var i = this._layers
- , n = this._zlevelList
- , o = n.length
- , a = null
- , r = -1
- , s = this._domRoot;
- if (i[t])
- Zy("ZLevel " + t + " has been used already");
- else if (qe(e)) {
- if (o > 0 && t > n[0]) {
- for (r = 0; r < o - 1 && !(n[r] < t && n[r + 1] > t); r++)
- ;
- a = i[n[r]]
- }
- if (n.splice(r + 1, 0, t),
- i[t] = e,
- !e.virtual)
- if (a) {
- var l = a.dom;
- l.nextSibling ? s.insertBefore(e.dom, l.nextSibling) : s.appendChild(e.dom)
- } else
- s.firstChild ? s.insertBefore(e.dom, s.firstChild) : s.appendChild(e.dom)
- } else
- Zy("Layer of zlevel " + t + " is not valid")
- },
- eachLayer: function(t, e) {
- var i, n, o = this._zlevelList;
- for (n = 0; n < o.length; n++)
- i = o[n],
- t.call(e, this._layers[i], i)
- },
- eachBuiltinLayer: function(t, e) {
- var i, n, o, a = this._zlevelList;
- for (o = 0; o < a.length; o++)
- n = a[o],
- (i = this._layers[n]).__builtin__ && t.call(e, i, n)
- },
- eachOtherLayer: function(t, e) {
- var i, n, o, a = this._zlevelList;
- for (o = 0; o < a.length; o++)
- n = a[o],
- (i = this._layers[n]).__builtin__ || t.call(e, i, n)
- },
- getLayers: function() {
- return this._layers
- },
- _updateLayerStatus: function(t) {
- var e = this._layers
- , i = this._progressiveLayers
- , n = {}
- , o = {};
- this.eachBuiltinLayer(function(t, e) {
- n[e] = t.elCount,
- t.elCount = 0,
- t.__dirty = !1
- }),
- c(i, function(t, e) {
- o[e] = t.elCount,
- t.elCount = 0,
- t.__dirty = !1
- });
- for (var a, r, s = 0, l = 0, h = 0, u = t.length; h < u; h++) {
- var d = t[h]
- , f = e[this._singleCanvas ? 0 : d.zlevel]
- , g = d.progressive;
- if (f && (f.elCount++,
- f.__dirty = f.__dirty || d.__dirty),
- g >= 0) {
- r !== g && (r = g,
- l++);
- var p = d.__frame = l - 1;
- if (!a) {
- var m = Math.min(s, 4);
- (a = i[m]) || (a = i[m] = new rx("progressive",this,this.dpr)).initContext(),
- a.__maxProgress = 0
- }
- a.__dirty = a.__dirty || d.__dirty,
- a.elCount++,
- a.__maxProgress = Math.max(a.__maxProgress, p),
- a.__maxProgress >= a.__progress && (f.__dirty = !0)
- } else
- d.__frame = -1,
- a && (a.__nextIdxNotProg = h,
- s++,
- a = null)
- }
- a && (s++,
- a.__nextIdxNotProg = h),
- this.eachBuiltinLayer(function(t, e) {
- n[e] !== t.elCount && (t.__dirty = !0)
- }),
- i.length = Math.min(s, 5),
- c(i, function(t, e) {
- o[e] !== t.elCount && (d.__dirty = !0),
- t.__dirty && (t.__progress = 0)
- })
- },
- clear: function() {
- return this.eachBuiltinLayer(this._clearLayer),
- this
- },
- _clearLayer: function(t) {
- t.clear()
- },
- configLayer: function(t, e) {
- if (e) {
- var n = this._layerConfig;
- n[t] ? i(n[t], e, !0) : n[t] = e;
- var o = this._layers[t];
- o && i(o, n[t], !0)
- }
- },
- delLayer: function(t) {
- var e = this._layers
- , i = this._zlevelList
- , n = e[t];
- n && (n.dom.parentNode.removeChild(n.dom),
- delete e[t],
- i.splice(s(i, t), 1))
- },
- resize: function(t, e) {
- var i = this._domRoot;
- i.style.display = "none";
- var n = this._opts;
- if (null != t && (n.width = t),
- null != e && (n.height = e),
- t = this._getSize(0),
- e = this._getSize(1),
- i.style.display = "",
- this._width != t || e != this._height) {
- i.style.width = t + "px",
- i.style.height = e + "px";
- for (var o in this._layers)
- this._layers.hasOwnProperty(o) && this._layers[o].resize(t, e);
- c(this._progressiveLayers, function(i) {
- i.resize(t, e)
- }),
- this.refresh(!0)
- }
- return this._width = t,
- this._height = e,
- this
- },
- clearLayer: function(t) {
- var e = this._layers[t];
- e && e.clear()
- },
- dispose: function() {
- this.root.innerHTML = "",
- this.root = this.storage = this._domRoot = this._layers = null
- },
- getRenderedCanvas: function(t) {
- function e(t, e) {
- var n = r._zlevelList;
- null == t && (t = -1 / 0);
- for (var o, a = 0; a < n.length; a++) {
- var s = n[a]
- , l = r._layers[s];
- if (!l.__builtin__ && s > t && s < e) {
- o = l;
- break
- }
- }
- o && o.renderToCanvas && (i.ctx.save(),
- o.renderToCanvas(i.ctx),
- i.ctx.restore())
- }
- if (t = t || {},
- this._singleCanvas)
- return this._layers[0].dom;
- var i = new rx("image",this,t.pixelRatio || this.dpr);
- i.initContext(),
- i.clearColor = t.backgroundColor,
- i.clear();
- for (var n, o = this.storage.getDisplayList(!0), a = {}, r = this, s = 0; s < o.length; s++) {
- var l = o[s];
- l.zlevel !== n && (e(n, l.zlevel),
- n = l.zlevel),
- this._doPaintEl(l, i, !0, a)
- }
- return e(n, 1 / 0),
- i.dom
- },
- getWidth: function() {
- return this._width
- },
- getHeight: function() {
- return this._height
- },
- _getSize: function(t) {
- var e = this._opts
- , i = ["width", "height"][t]
- , n = ["clientWidth", "clientHeight"][t]
- , o = ["paddingLeft", "paddingTop"][t]
- , a = ["paddingRight", "paddingBottom"][t];
- if (null != e[i] && "auto" !== e[i])
- return parseFloat(e[i]);
- var r = this.root
- , s = document.defaultView.getComputedStyle(r);
- return (r[n] || Xe(s[i]) || Xe(r.style[i])) - (Xe(s[o]) || 0) - (Xe(s[a]) || 0) | 0
- },
- pathToImage: function(t, e) {
- e = e || this.dpr;
- var i = document.createElement("canvas")
- , n = i.getContext("2d")
- , o = t.getBoundingRect()
- , a = t.style
- , r = a.shadowBlur
- , s = a.shadowOffsetX
- , l = a.shadowOffsetY
- , h = a.hasStroke() ? a.lineWidth : 0
- , u = Math.max(h / 2, -s + r)
- , c = Math.max(h / 2, s + r)
- , d = Math.max(h / 2, -l + r)
- , f = Math.max(h / 2, l + r)
- , g = o.width + u + c
- , p = o.height + d + f;
- i.width = g * e,
- i.height = p * e,
- n.scale(e, e),
- n.clearRect(0, 0, g, p),
- n.dpr = e;
- var m = {
- position: t.position,
- rotation: t.rotation,
- scale: t.scale
- };
- t.position = [u - o.x, d - o.y],
- t.rotation = 0,
- t.scale = [1, 1],
- t.updateTransform(),
- t && t.brush(n);
- var v = new je({
- style: {
- x: 0,
- y: 0,
- image: i
- }
- });
- return null != m.position && (v.position = t.position = m.position),
- null != m.rotation && (v.rotation = t.rotation = m.rotation),
- null != m.scale && (v.scale = t.scale = m.scale),
- v
- }
- };
- var Sx = "undefined" != typeof window && !!window.addEventListener
- , Mx = /^(?:mouse|pointer|contextmenu|drag|drop)|click/
- , Ix = Sx ? function(t) {
- t.preventDefault(),
- t.stopPropagation(),
- t.cancelBubble = !0
- }
- : function(t) {
- t.returnValue = !1,
- t.cancelBubble = !0
- }
- , Tx = function(t) {
- t = t || {},
- this.stage = t.stage || {},
- this.onframe = t.onframe || function() {}
- ,
- this._clips = [],
- this._running = !1,
- this._time,
- this._pausedTime,
- this._pauseStart,
- this._paused = !1,
- my.call(this)
- };
- Tx.prototype = {
- constructor: Tx,
- addClip: function(t) {
- this._clips.push(t)
- },
- addAnimator: function(t) {
- t.animation = this;
- for (var e = t.getClips(), i = 0; i < e.length; i++)
- this.addClip(e[i])
- },
- removeClip: function(t) {
- var e = s(this._clips, t);
- e >= 0 && this._clips.splice(e, 1)
- },
- removeAnimator: function(t) {
- for (var e = t.getClips(), i = 0; i < e.length; i++)
- this.removeClip(e[i]);
- t.animation = null
- },
- _update: function() {
- 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++) {
- var s = i[r]
- , l = s.step(t, e);
- l && (o.push(l),
- a.push(s))
- }
- for (r = 0; r < n; )
- i[r]._needsRemove ? (i[r] = i[n - 1],
- i.pop(),
- n--) : r++;
- n = o.length;
- for (r = 0; r < n; r++)
- a[r].fire(o[r]);
- this._time = t,
- this.onframe(e),
- this.trigger("frame", e),
- this.stage.update && this.stage.update()
- },
- _startLoop: function() {
- function t() {
- e._running && (sx(t),
- !e._paused && e._update())
- }
- var e = this;
- this._running = !0,
- sx(t)
- },
- start: function() {
- this._time = (new Date).getTime(),
- this._pausedTime = 0,
- this._startLoop()
- },
- stop: function() {
- this._running = !1
- },
- pause: function() {
- this._paused || (this._pauseStart = (new Date).getTime(),
- this._paused = !0)
- },
- resume: function() {
- this._paused && (this._pausedTime += (new Date).getTime() - this._pauseStart,
- this._paused = !1)
- },
- clear: function() {
- this._clips = []
- },
- animate: function(t, e) {
- var i = new Gy(t,(e = e || {}).loop,e.getter,e.setter);
- return this.addAnimator(i),
- i
- }
- },
- h(Tx, my);
- var Ax = function() {
- this._track = []
- };
- Ax.prototype = {
- constructor: Ax,
- recognize: function(t, e, i) {
- return this._doTrack(t, e, i),
- this._recognize(t)
- },
- clear: function() {
- return this._track.length = 0,
- this
- },
- _doTrack: function(t, e, i) {
- var n = t.touches;
- if (n) {
- for (var o = {
- points: [],
- touches: [],
- target: e,
- event: t
- }, a = 0, r = n.length; a < r; a++) {
- var s = n[a]
- , l = ii(i, s, {});
- o.points.push([l.zrX, l.zrY]),
- o.touches.push(s)
- }
- this._track.push(o)
- }
- },
- _recognize: function(t) {
- for (var e in Cx)
- if (Cx.hasOwnProperty(e)) {
- var i = Cx[e](this._track, t);
- if (i)
- return i
- }
- }
- };
- var Cx = {
- pinch: function(t, e) {
- var i = t.length;
- if (i) {
- var n = (t[i - 1] || {}).points
- , o = (t[i - 2] || {}).points || n;
- if (o && o.length > 1 && n && n.length > 1) {
- var a = li(n) / li(o);
- !isFinite(a) && (a = 1),
- e.pinchScale = a;
- var r = hi(n);
- return e.pinchX = r[0],
- e.pinchY = r[1],
- {
- type: "pinch",
- target: t[0].target,
- event: e
- }
- }
- }
- }
- }
- , Dx = ["click", "dblclick", "mousewheel", "mouseout", "mouseup", "mousedown", "mousemove", "contextmenu"]
- , Lx = ["touchstart", "touchend", "touchmove"]
- , kx = {
- pointerdown: 1,
- pointerup: 1,
- pointermove: 1,
- pointerout: 1
- }
- , Px = d(Dx, function(t) {
- var e = t.replace("mouse", "pointer");
- return kx[e] ? e : t
- })
- , Ox = {
- mousemove: function(t) {
- t = oi(this.dom, t),
- this.trigger("mousemove", t)
- },
- mouseout: function(t) {
- var e = (t = oi(this.dom, t)).toElement || t.relatedTarget;
- if (e != this.dom)
- for (; e && 9 != e.nodeType; ) {
- if (e === this.dom)
- return;
- e = e.parentNode
- }
- this.trigger("mouseout", t)
- },
- touchstart: function(t) {
- (t = oi(this.dom, t)).zrByTouch = !0,
- this._lastTouchMoment = new Date,
- ci(this, t, "start"),
- Ox.mousemove.call(this, t),
- Ox.mousedown.call(this, t),
- di(this)
- },
- touchmove: function(t) {
- (t = oi(this.dom, t)).zrByTouch = !0,
- ci(this, t, "change"),
- Ox.mousemove.call(this, t),
- di(this)
- },
- touchend: function(t) {
- (t = oi(this.dom, t)).zrByTouch = !0,
- ci(this, t, "end"),
- Ox.mouseup.call(this, t),
- +new Date - this._lastTouchMoment < 300 && Ox.click.call(this, t),
- di(this)
- },
- pointerdown: function(t) {
- Ox.mousedown.call(this, t)
- },
- pointermove: function(t) {
- fi(t) || Ox.mousemove.call(this, t)
- },
- pointerup: function(t) {
- Ox.mouseup.call(this, t)
- },
- pointerout: function(t) {
- fi(t) || Ox.mouseout.call(this, t)
- }
- };
- c(["click", "mousedown", "mouseup", "mousewheel", "dblclick", "contextmenu"], function(t) {
- Ox[t] = function(e) {
- e = oi(this.dom, e),
- this.trigger(t, e)
- }
- });
- var zx = pi.prototype;
- zx.dispose = function() {
- for (var t = Dx.concat(Lx), e = 0; e < t.length; e++) {
- var i = t[e];
- ri(this.dom, ui(i), this._handlers[i])
- }
- }
- ,
- zx.setCursor = function(t) {
- this.dom.style.cursor = t || "default"
- }
- ,
- h(pi, my);
- var Nx = !Yv.canvasSupported
- , Ex = {
- canvas: wx
- }
- , Rx = {}
- , Vx = "3.7.0"
- , Bx = function(t, e, i) {
- i = i || {},
- this.dom = e,
- this.id = t;
- var n = this
- , o = new Qy
- , a = i.renderer;
- if (Nx) {
- if (!Ex.vml)
- throw new Error("You need to require 'zrender/vml/vml' to support IE8");
- a = "vml"
- } else
- a && Ex[a] || (a = "canvas");
- var r = new Ex[a](e,o,i);
- this.storage = o,
- this.painter = r;
- var s = Yv.node ? null : new pi(r.getViewportRoot());
- this.handler = new xy(o,r,s,r.root),
- this.animation = new Tx({
- stage: {
- update: p(this.flush, this)
- }
- }),
- this.animation.start(),
- this._needsRefresh;
- var l = o.delFromStorage
- , h = o.addToStorage;
- o.delFromStorage = function(t) {
- l.call(o, t),
- t && t.removeSelfFromZr(n)
- }
- ,
- o.addToStorage = function(t) {
- h.call(o, t),
- t.addSelfToZr(n)
- }
- };
- Bx.prototype = {
- constructor: Bx,
- getId: function() {
- return this.id
- },
- add: function(t) {
- this.storage.addRoot(t),
- this._needsRefresh = !0
- },
- remove: function(t) {
- this.storage.delRoot(t),
- this._needsRefresh = !0
- },
- configLayer: function(t, e) {
- this.painter.configLayer(t, e),
- this._needsRefresh = !0
- },
- refreshImmediately: function() {
- this._needsRefresh = !1,
- this.painter.refresh(),
- this._needsRefresh = !1
- },
- refresh: function() {
- this._needsRefresh = !0
- },
- flush: function() {
- this._needsRefresh && this.refreshImmediately(),
- this._needsRefreshHover && this.refreshHoverImmediately()
- },
- addHover: function(t, e) {
- this.painter.addHover && (this.painter.addHover(t, e),
- this.refreshHover())
- },
- removeHover: function(t) {
- this.painter.removeHover && (this.painter.removeHover(t),
- this.refreshHover())
- },
- clearHover: function() {
- this.painter.clearHover && (this.painter.clearHover(),
- this.refreshHover())
- },
- refreshHover: function() {
- this._needsRefreshHover = !0
- },
- refreshHoverImmediately: function() {
- this._needsRefreshHover = !1,
- this.painter.refreshHover && this.painter.refreshHover()
- },
- resize: function(t) {
- t = t || {},
- this.painter.resize(t.width, t.height),
- this.handler.resize()
- },
- clearAnimation: function() {
- this.animation.clear()
- },
- getWidth: function() {
- return this.painter.getWidth()
- },
- getHeight: function() {
- return this.painter.getHeight()
- },
- pathToImage: function(t, e) {
- return this.painter.pathToImage(t, e)
- },
- setCursorStyle: function(t) {
- this.handler.setCursorStyle(t)
- },
- findHover: function(t, e) {
- return this.handler.findHover(t, e)
- },
- on: function(t, e, i) {
- this.handler.on(t, e, i)
- },
- off: function(t, e) {
- this.handler.off(t, e)
- },
- trigger: function(t, e) {
- this.handler.trigger(t, e)
- },
- clear: function() {
- this.storage.delRoot(),
- this.painter.clear()
- },
- dispose: function() {
- this.animation.stop(),
- this.clear(),
- this.storage.dispose(),
- this.painter.dispose(),
- this.handler.dispose(),
- this.animation = this.storage = this.painter = this.handler = null,
- yi(this.id)
- }
- };
- var Gx = (Object.freeze || Object)({
- version: Vx,
- init: mi,
- dispose: function(t) {
- if (t)
- t.dispose();
- else {
- for (var e in Rx)
- Rx.hasOwnProperty(e) && Rx[e].dispose();
- Rx = {}
- }
- return this
- },
- getInstance: function(t) {
- return Rx[t]
- },
- registerPainter: vi
- })
- , Wx = 1e-4
- , Hx = 9007199254740991
- , Fx = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/
- , Zx = (Object.freeze || Object)({
- linearMap: _i,
- parsePercent: bi,
- round: wi,
- asc: Si,
- getPrecision: Mi,
- getPrecisionSafe: Ii,
- getPixelPrecision: Ti,
- getPercentWithPrecision: Ai,
- MAX_SAFE_INTEGER: Hx,
- remRadian: Ci,
- isRadianAroundZero: Di,
- parseDate: Li,
- quantity: ki,
- nice: Oi,
- reformIntervals: zi,
- isNumeric: Ni
- })
- , Ux = C
- , jx = ["a", "b", "c", "d", "e", "f", "g"]
- , Xx = function(t, e) {
- return "{" + t + (null == e ? "" : e) + "}"
- }
- , qx = function(t) {
- return t < 10 ? "0" + t : t
- }
- , Yx = ve
- , $x = ce
- , Kx = (Object.freeze || Object)({
- addCommas: Ei,
- toCamelCase: Ri,
- normalizeCssArray: Ux,
- encodeHTML: Vi,
- formatTpl: Bi,
- formatTplSimple: Gi,
- getTooltipMarker: Wi,
- formatTime: Hi,
- capitalFirst: Fi,
- truncateText: Yx,
- getTextRect: $x
- })
- , Jx = "."
- , Qx = "___EC__COMPONENT__CONTAINER___"
- , t_ = "\0ec_\0"
- , e_ = function(t) {
- for (var e = 0; e < t.length; e++)
- t[e][1] || (t[e][1] = t[e][0]);
- return function(e, i, n) {
- for (var o = {}, a = 0; a < t.length; a++) {
- var r = t[a][1];
- if (!(i && s(i, r) >= 0 || n && s(n, r) < 0)) {
- var l = e.getShallow(r);
- null != l && (o[t[a][0]] = l)
- }
- }
- return o
- }
- }
- , i_ = e_([["lineWidth", "width"], ["stroke", "color"], ["opacity"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"]])
- , n_ = {
- getLineStyle: function(t) {
- var e = i_(this, t)
- , i = this.getLineDash(e.lineWidth);
- return i && (e.lineDash = i),
- e
- },
- getLineDash: function(t) {
- null == t && (t = 1);
- var e = this.get("type")
- , i = Math.max(t, 2)
- , n = 4 * t;
- return "solid" === e || null == e ? null : "dashed" === e ? [n, n] : [i, i]
- }
- }
- , o_ = e_([["fill", "color"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["opacity"], ["shadowColor"]])
- , a_ = {
- getAreaStyle: function(t, e) {
- return o_(this, t, e)
- }
- }
- , r_ = Math.pow
- , s_ = Math.sqrt
- , l_ = 1e-8
- , h_ = 1e-4
- , u_ = s_(3)
- , c_ = 1 / 3
- , d_ = N()
- , f_ = N()
- , g_ = N()
- , p_ = Math.min
- , m_ = Math.max
- , v_ = Math.sin
- , y_ = Math.cos
- , x_ = 2 * Math.PI
- , __ = N()
- , b_ = N()
- , w_ = N()
- , S_ = []
- , M_ = []
- , I_ = {
- M: 1,
- L: 2,
- C: 3,
- Q: 4,
- A: 5,
- Z: 6,
- R: 7
- }
- , T_ = []
- , A_ = []
- , C_ = []
- , D_ = []
- , L_ = Math.min
- , k_ = Math.max
- , P_ = Math.cos
- , O_ = Math.sin
- , z_ = Math.sqrt
- , N_ = Math.abs
- , E_ = "undefined" != typeof Float32Array
- , R_ = function(t) {
- this._saveData = !t,
- this._saveData && (this.data = []),
- this._ctx = null
- };
- R_.prototype = {
- constructor: R_,
- _xi: 0,
- _yi: 0,
- _x0: 0,
- _y0: 0,
- _ux: 0,
- _uy: 0,
- _len: 0,
- _lineDash: null,
- _dashOffset: 0,
- _dashIdx: 0,
- _dashSum: 0,
- setScale: function(t, e) {
- this._ux = N_(1 / Hy / t) || 0,
- this._uy = N_(1 / Hy / e) || 0
- },
- getContext: function() {
- return this._ctx
- },
- beginPath: function(t) {
- return this._ctx = t,
- t && t.beginPath(),
- t && (this.dpr = t.dpr),
- this._saveData && (this._len = 0),
- this._lineDash && (this._lineDash = null,
- this._dashOffset = 0),
- this
- },
- moveTo: function(t, e) {
- return this.addData(I_.M, t, e),
- this._ctx && this._ctx.moveTo(t, e),
- this._x0 = t,
- this._y0 = e,
- this._xi = t,
- this._yi = e,
- this
- },
- lineTo: function(t, e) {
- var i = N_(t - this._xi) > this._ux || N_(e - this._yi) > this._uy || this._len < 5;
- return this.addData(I_.L, t, e),
- this._ctx && i && (this._needsDash() ? this._dashedLineTo(t, e) : this._ctx.lineTo(t, e)),
- i && (this._xi = t,
- this._yi = e),
- this
- },
- bezierCurveTo: function(t, e, i, n, o, a) {
- return this.addData(I_.C, t, e, i, n, o, a),
- this._ctx && (this._needsDash() ? this._dashedBezierTo(t, e, i, n, o, a) : this._ctx.bezierCurveTo(t, e, i, n, o, a)),
- this._xi = o,
- this._yi = a,
- this
- },
- quadraticCurveTo: function(t, e, i, n) {
- return this.addData(I_.Q, t, e, i, n),
- this._ctx && (this._needsDash() ? this._dashedQuadraticTo(t, e, i, n) : this._ctx.quadraticCurveTo(t, e, i, n)),
- this._xi = i,
- this._yi = n,
- this
- },
- arc: function(t, e, i, n, o, a) {
- return this.addData(I_.A, t, e, i, i, n, o - n, 0, a ? 0 : 1),
- this._ctx && this._ctx.arc(t, e, i, n, o, a),
- this._xi = P_(o) * i + t,
- this._yi = O_(o) * i + t,
- this
- },
- arcTo: function(t, e, i, n, o) {
- return this._ctx && this._ctx.arcTo(t, e, i, n, o),
- this
- },
- rect: function(t, e, i, n) {
- return this._ctx && this._ctx.rect(t, e, i, n),
- this.addData(I_.R, t, e, i, n),
- this
- },
- closePath: function() {
- this.addData(I_.Z);
- var t = this._ctx
- , e = this._x0
- , i = this._y0;
- return t && (this._needsDash() && this._dashedLineTo(e, i),
- t.closePath()),
- this._xi = e,
- this._yi = i,
- this
- },
- fill: function(t) {
- t && t.fill(),
- this.toStatic()
- },
- stroke: function(t) {
- t && t.stroke(),
- this.toStatic()
- },
- setLineDash: function(t) {
- if (t instanceof Array) {
- this._lineDash = t,
- this._dashIdx = 0;
- for (var e = 0, i = 0; i < t.length; i++)
- e += t[i];
- this._dashSum = e
- }
- return this
- },
- setLineDashOffset: function(t) {
- return this._dashOffset = t,
- this
- },
- len: function() {
- return this._len
- },
- setData: function(t) {
- var e = t.length;
- this.data && this.data.length == e || !E_ || (this.data = new Float32Array(e));
- for (var i = 0; i < e; i++)
- this.data[i] = t[i];
- this._len = e
- },
- appendPath: function(t) {
- t instanceof Array || (t = [t]);
- for (var e = t.length, i = 0, n = this._len, o = 0; o < e; o++)
- i += t[o].len();
- E_ && this.data instanceof Float32Array && (this.data = new Float32Array(n + i));
- for (o = 0; o < e; o++)
- for (var a = t[o].data, r = 0; r < a.length; r++)
- this.data[n++] = a[r];
- this._len = n
- },
- addData: function(t) {
- if (this._saveData) {
- var e = this.data;
- this._len + arguments.length > e.length && (this._expandData(),
- e = this.data);
- for (var i = 0; i < arguments.length; i++)
- e[this._len++] = arguments[i];
- this._prevCmd = t
- }
- },
- _expandData: function() {
- if (!(this.data instanceof Array)) {
- for (var t = [], e = 0; e < this._len; e++)
- t[e] = this.data[e];
- this.data = t
- }
- },
- _needsDash: function() {
- return this._lineDash
- },
- _dashedLineTo: function(t, e) {
- var i, n, o = this._dashSum, a = this._dashOffset, r = this._lineDash, s = this._ctx, l = this._xi, h = this._yi, u = t - l, c = e - h, d = z_(u * u + c * c), f = l, g = h, p = r.length;
- for (u /= d,
- c /= d,
- a < 0 && (a = o + a),
- f -= (a %= o) * u,
- g -= a * c; u > 0 && f <= t || u < 0 && f >= t || 0 == u && (c > 0 && g <= e || c < 0 && g >= e); )
- f += u * (i = r[n = this._dashIdx]),
- g += c * i,
- this._dashIdx = (n + 1) % p,
- u > 0 && f < l || u < 0 && f > l || c > 0 && g < h || c < 0 && g > h || s[n % 2 ? "moveTo" : "lineTo"](u >= 0 ? L_(f, t) : k_(f, t), c >= 0 ? L_(g, e) : k_(g, e));
- u = f - t,
- c = g - e,
- this._dashOffset = -z_(u * u + c * c)
- },
- _dashedBezierTo: function(t, e, i, n, o, a) {
- var r, s, l, h, u, c = this._dashSum, d = this._dashOffset, f = this._lineDash, g = this._ctx, p = this._xi, m = this._yi, v = en, y = 0, x = this._dashIdx, _ = f.length, b = 0;
- for (d < 0 && (d = c + d),
- d %= c,
- r = 0; r < 1; r += .1)
- s = v(p, t, i, o, r + .1) - v(p, t, i, o, r),
- l = v(m, e, n, a, r + .1) - v(m, e, n, a, r),
- y += z_(s * s + l * l);
- for (; x < _ && !((b += f[x]) > d); x++)
- ;
- for (r = (b - d) / y; r <= 1; )
- h = v(p, t, i, o, r),
- u = v(m, e, n, a, r),
- x % 2 ? g.moveTo(h, u) : g.lineTo(h, u),
- r += f[x] / y,
- x = (x + 1) % _;
- x % 2 != 0 && g.lineTo(o, a),
- s = o - h,
- l = a - u,
- this._dashOffset = -z_(s * s + l * l)
- },
- _dashedQuadraticTo: function(t, e, i, n) {
- var o = i
- , a = n;
- i = (i + 2 * t) / 3,
- n = (n + 2 * e) / 3,
- t = (this._xi + 2 * t) / 3,
- e = (this._yi + 2 * e) / 3,
- this._dashedBezierTo(t, e, i, n, o, a)
- },
- toStatic: function() {
- var t = this.data;
- t instanceof Array && (t.length = this._len,
- E_ && (this.data = new Float32Array(t)))
- },
- getBoundingRect: function() {
- T_[0] = T_[1] = C_[0] = C_[1] = Number.MAX_VALUE,
- A_[0] = A_[1] = D_[0] = D_[1] = -Number.MAX_VALUE;
- for (var t = this.data, e = 0, i = 0, n = 0, o = 0, a = 0; a < t.length; ) {
- var r = t[a++];
- switch (1 == a && (n = e = t[a],
- o = i = t[a + 1]),
- r) {
- case I_.M:
- e = n = t[a++],
- i = o = t[a++],
- C_[0] = n,
- C_[1] = o,
- D_[0] = n,
- D_[1] = o;
- break;
- case I_.L:
- pn(e, i, t[a], t[a + 1], C_, D_),
- e = t[a++],
- i = t[a++];
- break;
- case I_.C:
- mn(e, i, t[a++], t[a++], t[a++], t[a++], t[a], t[a + 1], C_, D_),
- e = t[a++],
- i = t[a++];
- break;
- case I_.Q:
- vn(e, i, t[a++], t[a++], t[a], t[a + 1], C_, D_),
- e = t[a++],
- i = t[a++];
- break;
- case I_.A:
- var s = t[a++]
- , l = t[a++]
- , h = t[a++]
- , u = t[a++]
- , c = t[a++]
- , d = t[a++] + c
- , f = (t[a++],
- 1 - t[a++]);
- 1 == a && (n = P_(c) * h + s,
- o = O_(c) * u + l),
- yn(s, l, h, u, c, d, f, C_, D_),
- e = P_(d) * h + s,
- i = O_(d) * u + l;
- break;
- case I_.R:
- pn(n = e = t[a++], o = i = t[a++], n + t[a++], o + t[a++], C_, D_);
- break;
- case I_.Z:
- e = n,
- i = o
- }
- $(T_, T_, C_),
- K(A_, A_, D_)
- }
- return 0 === a && (T_[0] = T_[1] = A_[0] = A_[1] = 0),
- new jt(T_[0],T_[1],A_[0] - T_[0],A_[1] - T_[1])
- },
- rebuildPath: function(t) {
- for (var e, i, n, o, a, r, s = this.data, l = this._ux, h = this._uy, u = this._len, c = 0; c < u; ) {
- var d = s[c++];
- switch (1 == c && (e = n = s[c],
- i = o = s[c + 1]),
- d) {
- case I_.M:
- e = n = s[c++],
- i = o = s[c++],
- t.moveTo(n, o);
- break;
- case I_.L:
- a = s[c++],
- r = s[c++],
- (N_(a - n) > l || N_(r - o) > h || c === u - 1) && (t.lineTo(a, r),
- n = a,
- o = r);
- break;
- case I_.C:
- t.bezierCurveTo(s[c++], s[c++], s[c++], s[c++], s[c++], s[c++]),
- n = s[c - 2],
- o = s[c - 1];
- break;
- case I_.Q:
- t.quadraticCurveTo(s[c++], s[c++], s[c++], s[c++]),
- n = s[c - 2],
- o = s[c - 1];
- break;
- case I_.A:
- var f = s[c++]
- , g = s[c++]
- , p = s[c++]
- , m = s[c++]
- , v = s[c++]
- , y = s[c++]
- , x = s[c++]
- , _ = s[c++]
- , b = p > m ? p : m
- , w = p > m ? 1 : p / m
- , S = p > m ? m / p : 1
- , M = v + y;
- Math.abs(p - m) > .001 ? (t.translate(f, g),
- t.rotate(x),
- t.scale(w, S),
- t.arc(0, 0, b, v, M, 1 - _),
- t.scale(1 / w, 1 / S),
- t.rotate(-x),
- t.translate(-f, -g)) : t.arc(f, g, b, v, M, 1 - _),
- 1 == c && (e = P_(v) * p + f,
- i = O_(v) * m + g),
- n = P_(M) * p + f,
- o = O_(M) * m + g;
- break;
- case I_.R:
- e = n = s[c],
- i = o = s[c + 1],
- t.rect(s[c++], s[c++], s[c++], s[c++]);
- break;
- case I_.Z:
- t.closePath(),
- n = e,
- o = i
- }
- }
- }
- },
- R_.CMD = I_;
- var V_ = 2 * Math.PI
- , B_ = 2 * Math.PI
- , G_ = 2 * Math.PI
- , W_ = 1e-4
- , H_ = [-1, -1, -1]
- , F_ = [-1, -1]
- , Z_ = ax.prototype.getCanvasPattern
- , U_ = Math.abs
- , j_ = new R_(!0);
- On.prototype = {
- constructor: On,
- type: "path",
- __dirtyPath: !0,
- strokeContainThreshold: 5,
- brush: function(t, e) {
- var i = this.style
- , n = this.path || j_
- , o = i.hasStroke()
- , a = i.hasFill()
- , r = i.fill
- , s = i.stroke
- , l = a && !!r.colorStops
- , h = o && !!s.colorStops
- , u = a && !!r.image
- , c = o && !!s.image;
- if (i.bind(t, this, e),
- this.setTransform(t),
- this.__dirty) {
- var d;
- l && (d = d || this.getBoundingRect(),
- this._fillGradient = i.getGradient(t, r, d)),
- h && (d = d || this.getBoundingRect(),
- this._strokeGradient = i.getGradient(t, s, d))
- }
- l ? t.fillStyle = this._fillGradient : u && (t.fillStyle = Z_.call(r, t)),
- h ? t.strokeStyle = this._strokeGradient : c && (t.strokeStyle = Z_.call(s, t));
- var f = i.lineDash
- , g = i.lineDashOffset
- , p = !!t.setLineDash
- , m = this.getGlobalScale();
- n.setScale(m[0], m[1]),
- this.__dirtyPath || f && !p && o ? (n.beginPath(t),
- f && !p && (n.setLineDash(f),
- n.setLineDashOffset(g)),
- this.buildPath(n, this.shape, !1),
- this.path && (this.__dirtyPath = !1)) : (t.beginPath(),
- this.path.rebuildPath(t)),
- a && n.fill(t),
- f && p && (t.setLineDash(f),
- t.lineDashOffset = g),
- o && n.stroke(t),
- f && p && t.setLineDash([]),
- this.restoreTransform(t),
- null != i.text && this.drawRectText(t, this.getBoundingRect())
- },
- buildPath: function(t, e, i) {},
- createPathProxy: function() {
- this.path = new R_
- },
- getBoundingRect: function() {
- var t = this._rect
- , e = this.style
- , i = !t;
- if (i) {
- var n = this.path;
- n || (n = this.path = new R_),
- this.__dirtyPath && (n.beginPath(),
- this.buildPath(n, this.shape, !1)),
- t = n.getBoundingRect()
- }
- if (this._rect = t,
- e.hasStroke()) {
- var o = this._rectWithStroke || (this._rectWithStroke = t.clone());
- if (this.__dirty || i) {
- o.copy(t);
- var a = e.lineWidth
- , r = e.strokeNoScale ? this.getLineScale() : 1;
- e.hasFill() || (a = Math.max(a, this.strokeContainThreshold || 4)),
- r > 1e-10 && (o.width += a / r,
- o.height += a / r,
- o.x -= a / r / 2,
- o.y -= a / r / 2)
- }
- return o
- }
- return t
- },
- contain: function(t, e) {
- var i = this.transformCoordToLocal(t, e)
- , n = this.getBoundingRect()
- , o = this.style;
- if (t = i[0],
- e = i[1],
- n.contain(t, e)) {
- var a = this.path.data;
- if (o.hasStroke()) {
- var r = o.lineWidth
- , s = o.strokeNoScale ? this.getLineScale() : 1;
- if (s > 1e-10 && (o.hasFill() || (r = Math.max(r, this.strokeContainThreshold)),
- Pn(a, r / s, t, e)))
- return !0
- }
- if (o.hasFill())
- return kn(a, t, e)
- }
- return !1
- },
- dirty: function(t) {
- null == t && (t = !0),
- t && (this.__dirtyPath = t,
- this._rect = null),
- this.__dirty = !0,
- this.__zr && this.__zr.refresh(),
- this.__clipTarget && this.__clipTarget.dirty()
- },
- animateShape: function(t) {
- return this.animate("shape", t)
- },
- attrKV: function(t, e) {
- "shape" === t ? (this.setShape(e),
- this.__dirtyPath = !0,
- this._rect = null) : Ue.prototype.attrKV.call(this, t, e)
- },
- setShape: function(t, e) {
- var i = this.shape;
- if (i) {
- if (_(t))
- for (var n in t)
- t.hasOwnProperty(n) && (i[n] = t[n]);
- else
- i[t] = e;
- this.dirty(!0)
- }
- return this
- },
- getLineScale: function() {
- var t = this.transform;
- return t && U_(t[0] - 1) > 1e-10 && U_(t[3] - 1) > 1e-10 ? Math.sqrt(U_(t[0] * t[3] - t[2] * t[1])) : 1
- }
- },
- On.extend = function(t) {
- var e = function(e) {
- On.call(this, e),
- t.style && this.style.extendFrom(t.style, !1);
- var i = t.shape;
- if (i) {
- this.shape = this.shape || {};
- var n = this.shape;
- for (var o in i)
- !n.hasOwnProperty(o) && i.hasOwnProperty(o) && (n[o] = i[o])
- }
- t.init && t.init.call(this, e)
- };
- l(e, On);
- for (var i in t)
- "style" !== i && "shape" !== i && (e.prototype[i] = t[i]);
- return e
- }
- ,
- l(On, Ue);
- var X_ = [[], [], []]
- , q_ = Math.sqrt
- , Y_ = Math.atan2
- , $_ = function(t, e) {
- var i, n, o, a, r, s, l = t.data, h = I_.M, u = I_.C, c = I_.L, d = I_.R, f = I_.A, g = I_.Q;
- for (o = 0,
- a = 0; o < l.length; ) {
- switch (i = l[o++],
- a = o,
- n = 0,
- i) {
- case h:
- case c:
- n = 1;
- break;
- case u:
- n = 3;
- break;
- case g:
- n = 2;
- break;
- case f:
- var p = e[4]
- , m = e[5]
- , v = q_(e[0] * e[0] + e[1] * e[1])
- , y = q_(e[2] * e[2] + e[3] * e[3])
- , x = Y_(-e[1] / y, e[0] / v);
- l[o] *= v,
- l[o++] += p,
- l[o] *= y,
- l[o++] += m,
- l[o++] *= v,
- l[o++] *= y,
- l[o++] += x,
- l[o++] += x,
- a = o += 2;
- break;
- case d:
- s[0] = l[o++],
- s[1] = l[o++],
- Y(s, s, e),
- l[a++] = s[0],
- l[a++] = s[1],
- s[0] += l[o++],
- s[1] += l[o++],
- Y(s, s, e),
- l[a++] = s[0],
- l[a++] = s[1]
- }
- for (r = 0; r < n; r++)
- (s = X_[r])[0] = l[o++],
- s[1] = l[o++],
- Y(s, s, e),
- l[a++] = s[0],
- l[a++] = s[1]
- }
- }
- , K_ = ["m", "M", "l", "L", "v", "V", "h", "H", "z", "Z", "c", "C", "q", "Q", "t", "T", "s", "S", "a", "A"]
- , J_ = Math.sqrt
- , Q_ = Math.sin
- , tb = Math.cos
- , eb = Math.PI
- , ib = function(t) {
- return Math.sqrt(t[0] * t[0] + t[1] * t[1])
- }
- , nb = function(t, e) {
- return (t[0] * e[0] + t[1] * e[1]) / (ib(t) * ib(e))
- }
- , ob = function(t, e) {
- return (t[0] * e[1] < t[1] * e[0] ? -1 : 1) * Math.acos(nb(t, e))
- }
- , ab = function(t) {
- Ue.call(this, t)
- };
- ab.prototype = {
- constructor: ab,
- type: "text",
- brush: function(t, e) {
- var i = this.style;
- this.__dirty && Ae(i),
- i.fill = i.stroke = i.shadowBlur = i.shadowColor = i.shadowOffsetX = i.shadowOffsetY = null;
- var n = i.text;
- null != n && (n += ""),
- i.bind(t, this, e),
- Ze(n, i) && (this.setTransform(t),
- De(this, t, n, i),
- this.restoreTransform(t))
- },
- getBoundingRect: function() {
- var t = this.style;
- if (this.__dirty && Ae(t),
- !this._rect) {
- var e = t.text;
- null != e ? e += "" : e = "";
- var i = ce(t.text + "", t.font, t.textAlign, t.textVerticalAlign, t.textPadding, t.rich);
- if (i.x += t.x || 0,
- i.y += t.y || 0,
- Ge(t.textStroke, t.textStrokeWidth)) {
- var n = t.textStrokeWidth;
- i.x -= n / 2,
- i.y -= n / 2,
- i.width += n,
- i.height += n
- }
- this._rect = i
- }
- return this._rect
- }
- },
- l(ab, Ue);
- var rb = On.extend({
- type: "circle",
- shape: {
- cx: 0,
- cy: 0,
- r: 0
- },
- buildPath: function(t, e, i) {
- i && t.moveTo(e.cx + e.r, e.cy),
- t.arc(e.cx, e.cy, e.r, 0, 2 * Math.PI, !0)
- }
- })
- , sb = [["shadowBlur", 0], ["shadowColor", "#000"], ["shadowOffsetX", 0], ["shadowOffsetY", 0]]
- , lb = function(t) {
- return Yv.browser.ie && Yv.browser.version >= 11 ? function() {
- var e, i = this.__clipPaths, n = this.style;
- if (i)
- for (var o = 0; o < i.length; o++) {
- var a = i[o]
- , r = a && a.shape
- , s = a && a.type;
- if (r && ("sector" === s && r.startAngle === r.endAngle || "rect" === s && (!r.width || !r.height))) {
- for (l = 0; l < sb.length; l++)
- sb[l][2] = n[sb[l][0]],
- n[sb[l][0]] = sb[l][1];
- e = !0;
- break
- }
- }
- if (t.apply(this, arguments),
- e)
- for (var l = 0; l < sb.length; l++)
- n[sb[l][0]] = sb[l][2]
- }
- : t
- }
- , hb = On.extend({
- type: "sector",
- shape: {
- cx: 0,
- cy: 0,
- r0: 0,
- r: 0,
- startAngle: 0,
- endAngle: 2 * Math.PI,
- clockwise: !0
- },
- brush: lb(On.prototype.brush),
- buildPath: function(t, e) {
- var i = e.cx
- , n = e.cy
- , o = Math.max(e.r0 || 0, 0)
- , a = Math.max(e.r, 0)
- , r = e.startAngle
- , s = e.endAngle
- , l = e.clockwise
- , h = Math.cos(r)
- , u = Math.sin(r);
- t.moveTo(h * o + i, u * o + n),
- t.lineTo(h * a + i, u * a + n),
- t.arc(i, n, a, r, s, !l),
- t.lineTo(Math.cos(s) * o + i, Math.sin(s) * o + n),
- 0 !== o && t.arc(i, n, o, s, r, l),
- t.closePath()
- }
- })
- , ub = On.extend({
- type: "ring",
- shape: {
- cx: 0,
- cy: 0,
- r: 0,
- r0: 0
- },
- buildPath: function(t, e) {
- var i = e.cx
- , n = e.cy
- , o = 2 * Math.PI;
- t.moveTo(i + e.r, n),
- t.arc(i, n, e.r, 0, o, !1),
- t.moveTo(i + e.r0, n),
- t.arc(i, n, e.r0, 0, o, !0)
- }
- })
- , cb = function(t, e) {
- for (var i = t.length, n = [], o = 0, a = 1; a < i; a++)
- o += j(t[a - 1], t[a]);
- var r = o / 2;
- r = r < i ? i : r;
- for (a = 0; a < r; a++) {
- var s, l, h, u = a / (r - 1) * (e ? i : i - 1), c = Math.floor(u), d = u - c, f = t[c % i];
- e ? (s = t[(c - 1 + i) % i],
- l = t[(c + 1) % i],
- h = t[(c + 2) % i]) : (s = t[0 === c ? c : c - 1],
- l = t[c > i - 2 ? i - 1 : c + 1],
- h = t[c > i - 3 ? i - 1 : c + 2]);
- var g = d * d
- , p = d * g;
- n.push([Bn(s[0], f[0], l[0], h[0], d, g, p), Bn(s[1], f[1], l[1], h[1], d, g, p)])
- }
- return n
- }
- , db = function(t, e, i, n) {
- var o, a, r, s, l = [], h = [], u = [], c = [];
- if (n) {
- r = [1 / 0, 1 / 0],
- s = [-1 / 0, -1 / 0];
- for (var d = 0, f = t.length; d < f; d++)
- $(r, r, t[d]),
- K(s, s, t[d]);
- $(r, r, n[0]),
- K(s, s, n[1])
- }
- for (var d = 0, f = t.length; d < f; d++) {
- var g = t[d];
- if (i)
- o = t[d ? d - 1 : f - 1],
- a = t[(d + 1) % f];
- else {
- if (0 === d || d === f - 1) {
- l.push(R(t[d]));
- continue
- }
- o = t[d - 1],
- a = t[d + 1]
- }
- W(h, a, o),
- Z(h, h, e);
- var p = j(g, o)
- , m = j(g, a)
- , v = p + m;
- 0 !== v && (p /= v,
- m /= v),
- Z(u, h, -p),
- Z(c, h, m);
- var y = B([], g, u)
- , x = B([], g, c);
- n && (K(y, y, r),
- $(y, y, s),
- K(x, x, r),
- $(x, x, s)),
- l.push(y),
- l.push(x)
- }
- return i && l.push(l.shift()),
- l
- }
- , fb = On.extend({
- type: "polygon",
- shape: {
- points: null,
- smooth: !1,
- smoothConstraint: null
- },
- buildPath: function(t, e) {
- Gn(t, e, !0)
- }
- })
- , gb = On.extend({
- type: "polyline",
- shape: {
- points: null,
- smooth: !1,
- smoothConstraint: null
- },
- style: {
- stroke: "#000",
- fill: null
- },
- buildPath: function(t, e) {
- Gn(t, e, !1)
- }
- })
- , pb = On.extend({
- type: "rect",
- shape: {
- r: 0,
- x: 0,
- y: 0,
- width: 0,
- height: 0
- },
- buildPath: function(t, e) {
- var i = e.x
- , n = e.y
- , o = e.width
- , a = e.height;
- e.r ? Te(t, e) : t.rect(i, n, o, a),
- t.closePath()
- }
- })
- , mb = On.extend({
- type: "line",
- shape: {
- x1: 0,
- y1: 0,
- x2: 0,
- y2: 0,
- percent: 1
- },
- style: {
- stroke: "#000",
- fill: null
- },
- buildPath: function(t, e) {
- var i = e.x1
- , n = e.y1
- , o = e.x2
- , a = e.y2
- , r = e.percent;
- 0 !== r && (t.moveTo(i, n),
- r < 1 && (o = i * (1 - r) + o * r,
- a = n * (1 - r) + a * r),
- t.lineTo(o, a))
- },
- pointAt: function(t) {
- var e = this.shape;
- return [e.x1 * (1 - t) + e.x2 * t, e.y1 * (1 - t) + e.y2 * t]
- }
- })
- , vb = []
- , yb = On.extend({
- type: "bezier-curve",
- shape: {
- x1: 0,
- y1: 0,
- x2: 0,
- y2: 0,
- cpx1: 0,
- cpy1: 0,
- percent: 1
- },
- style: {
- stroke: "#000",
- fill: null
- },
- buildPath: function(t, e) {
- var i = e.x1
- , n = e.y1
- , o = e.x2
- , a = e.y2
- , r = e.cpx1
- , s = e.cpy1
- , l = e.cpx2
- , h = e.cpy2
- , u = e.percent;
- 0 !== u && (t.moveTo(i, n),
- null == l || null == h ? (u < 1 && (dn(i, r, o, u, vb),
- r = vb[1],
- o = vb[2],
- dn(n, s, a, u, vb),
- s = vb[1],
- a = vb[2]),
- t.quadraticCurveTo(r, s, o, a)) : (u < 1 && (rn(i, r, l, o, u, vb),
- r = vb[1],
- l = vb[2],
- o = vb[3],
- rn(n, s, h, a, u, vb),
- s = vb[1],
- h = vb[2],
- a = vb[3]),
- t.bezierCurveTo(r, s, l, h, o, a)))
- },
- pointAt: function(t) {
- return Wn(this.shape, t, !1)
- },
- tangentAt: function(t) {
- var e = Wn(this.shape, t, !0);
- return U(e, e)
- }
- })
- , xb = On.extend({
- type: "arc",
- shape: {
- cx: 0,
- cy: 0,
- r: 0,
- startAngle: 0,
- endAngle: 2 * Math.PI,
- clockwise: !0
- },
- style: {
- stroke: "#000",
- fill: null
- },
- buildPath: function(t, e) {
- var i = e.cx
- , n = e.cy
- , o = Math.max(e.r, 0)
- , a = e.startAngle
- , r = e.endAngle
- , s = e.clockwise
- , l = Math.cos(a)
- , h = Math.sin(a);
- t.moveTo(l * o + i, h * o + n),
- t.arc(i, n, o, a, r, !s)
- }
- })
- , _b = On.extend({
- type: "compound",
- shape: {
- paths: null
- },
- _updatePathDirty: function() {
- for (var t = this.__dirtyPath, e = this.shape.paths, i = 0; i < e.length; i++)
- t = t || e[i].__dirtyPath;
- this.__dirtyPath = t,
- this.__dirty = this.__dirty || t
- },
- beforeBrush: function() {
- this._updatePathDirty();
- for (var t = this.shape.paths || [], e = this.getGlobalScale(), i = 0; i < t.length; i++)
- t[i].path || t[i].createPathProxy(),
- t[i].path.setScale(e[0], e[1])
- },
- buildPath: function(t, e) {
- for (var i = e.paths || [], n = 0; n < i.length; n++)
- i[n].buildPath(t, i[n].shape, !0)
- },
- afterBrush: function() {
- for (var t = this.shape.paths || [], e = 0; e < t.length; e++)
- t[e].__dirtyPath = !1
- },
- getBoundingRect: function() {
- return this._updatePathDirty(),
- On.prototype.getBoundingRect.call(this)
- }
- })
- , bb = function(t) {
- this.colorStops = t || []
- };
- bb.prototype = {
- constructor: bb,
- addColorStop: function(t, e) {
- this.colorStops.push({
- offset: t,
- color: e
- })
- }
- };
- var wb = function(t, e, i, n, o, a) {
- this.x = null == t ? 0 : t,
- this.y = null == e ? 0 : e,
- this.x2 = null == i ? 1 : i,
- this.y2 = null == n ? 0 : n,
- this.type = "linear",
- this.global = a || !1,
- bb.call(this, o)
- };
- wb.prototype = {
- constructor: wb
- },
- l(wb, bb);
- var Sb = function(t, e, i, n, o) {
- this.x = null == t ? .5 : t,
- this.y = null == e ? .5 : e,
- this.r = null == i ? .5 : i,
- this.type = "radial",
- this.global = o || !1,
- bb.call(this, n)
- };
- Sb.prototype = {
- constructor: Sb
- },
- l(Sb, bb);
- var Mb = Math.round
- , Ib = Math.max
- , Tb = Math.min
- , Ab = {}
- , Cb = function(t, e) {
- for (var i = [], n = t.length, o = 0; o < n; o++) {
- var a = t[o];
- a.path || a.createPathProxy(),
- a.__dirtyPath && a.buildPath(a.path, a.shape, !0),
- i.push(a.path)
- }
- var r = new On(e);
- return r.createPathProxy(),
- r.buildPath = function(t) {
- t.appendPath(i);
- var e = t.getContext();
- e && t.rebuildPath(e)
- }
- ,
- r
- }
- , Db = (Object.freeze || Object)({
- extendShape: Hn,
- extendPath: function(t, e) {
- return Vn(t, e)
- },
- makePath: Fn,
- makeImage: Zn,
- mergePath: Cb,
- resizePath: jn,
- subPixelOptimizeLine: Xn,
- subPixelOptimizeRect: qn,
- subPixelOptimize: Yn,
- setHoverStyle: lo,
- setLabelStyle: ho,
- setTextStyle: uo,
- setText: function(t, e, i) {
- var n, o = {
- isRectText: !0
- };
- !1 === i ? n = !0 : o.autoColor = i,
- co(t, e, o, n),
- t.host && t.host.dirty && t.host.dirty(!1)
- },
- getFont: yo,
- updateProps: _o,
- initProps: bo,
- getTransform: wo,
- applyTransform: So,
- transformDirection: Mo,
- groupTransition: Io,
- clipPointsByRect: To,
- clipRectByRect: function(t, e) {
- var i = Ib(t.x, e.x)
- , n = Tb(t.x + t.width, e.x + e.width)
- , o = Ib(t.y, e.y)
- , a = Tb(t.y + t.height, e.y + e.height);
- if (n >= i && a >= o)
- return {
- x: i,
- y: o,
- width: n - i,
- height: a - o
- }
- },
- createIcon: Ao,
- Group: $y,
- Image: je,
- Text: ab,
- Circle: rb,
- Sector: hb,
- Ring: ub,
- Polygon: fb,
- Polyline: gb,
- Rect: pb,
- Line: mb,
- BezierCurve: yb,
- Arc: xb,
- CompoundPath: _b,
- LinearGradient: wb,
- RadialGradient: Sb,
- BoundingRect: jt
- })
- , Lb = ["textStyle", "color"]
- , kb = {
- getTextColor: function(t) {
- var e = this.ecModel;
- return this.getShallow("color") || (!t && e ? e.get(Lb) : null)
- },
- getFont: function() {
- return yo({
- fontStyle: this.getShallow("fontStyle"),
- fontWeight: this.getShallow("fontWeight"),
- fontSize: this.getShallow("fontSize"),
- fontFamily: this.getShallow("fontFamily")
- }, this.ecModel)
- },
- getTextRect: function(t) {
- return ce(t, this.getFont(), this.getShallow("align"), this.getShallow("verticalAlign") || this.getShallow("baseline"), this.getShallow("padding"), this.getShallow("rich"), this.getShallow("truncateText"))
- }
- }
- , Pb = e_([["fill", "color"], ["stroke", "borderColor"], ["lineWidth", "borderWidth"], ["opacity"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"], ["textPosition"], ["textAlign"]])
- , Ob = {
- getItemStyle: function(t, e) {
- var i = Pb(this, t, e)
- , n = this.getBorderLineDash();
- return n && (i.lineDash = n),
- i
- },
- getBorderLineDash: function() {
- var t = this.get("borderType");
- return "solid" === t || null == t ? null : "dashed" === t ? [5, 5] : [1, 1]
- }
- }
- , zb = h;
- Co.prototype = {
- constructor: Co,
- init: null,
- mergeOption: function(t) {
- i(this.option, t, !0)
- },
- get: function(t, e) {
- return null == t ? this.option : Do(this.option, this.parsePath(t), !e && Lo(this, t))
- },
- getShallow: function(t, e) {
- var i = this.option
- , n = null == i ? i : i[t]
- , o = !e && Lo(this, t);
- return null == n && o && (n = o.getShallow(t)),
- n
- },
- getModel: function(t, e) {
- var i, n = null == t ? this.option : Do(this.option, t = this.parsePath(t));
- return e = e || (i = Lo(this, t)) && i.getModel(t),
- new Co(n,e,this.ecModel)
- },
- isEmpty: function() {
- return null == this.option
- },
- restoreData: function() {},
- clone: function() {
- return new (0,
- this.constructor)(e(this.option))
- },
- setReadOnly: function(t) {},
- parsePath: function(t) {
- return "string" == typeof t && (t = t.split(".")),
- t
- },
- customizeGetParent: function(t) {
- Zi(this, "getParent", t)
- },
- isAnimationEnabled: function() {
- if (!Yv.node) {
- if (null != this.option.animation)
- return !!this.option.animation;
- if (this.parentModel)
- return this.parentModel.isAnimationEnabled()
- }
- }
- },
- Yi(Co),
- zb(Co, n_),
- zb(Co, a_),
- zb(Co, kb),
- zb(Co, Ob);
- var Nb = c
- , Eb = _
- , Rb = ["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"]
- , Vb = {
- getDataParams: function(t, e) {
- var i = this.getData(e)
- , n = this.getRawValue(t, e)
- , o = i.getRawIndex(t)
- , a = i.getName(t, !0)
- , r = i.getRawDataItem(t)
- , s = i.getItemVisual(t, "color");
- return {
- componentType: this.mainType,
- componentSubType: this.subType,
- seriesType: "series" === this.mainType ? this.subType : null,
- seriesIndex: this.seriesIndex,
- seriesId: this.id,
- seriesName: this.name,
- name: a,
- dataIndex: o,
- data: r,
- dataType: e,
- value: n,
- color: s,
- marker: Wi(s),
- $vars: ["seriesName", "name", "value"]
- }
- },
- getFormattedLabel: function(t, e, i, n, o) {
- e = e || "normal";
- var a = this.getData(i).getItemModel(t)
- , r = this.getDataParams(t, i);
- null != n && r.value instanceof Array && (r.value = r.value[n]);
- var s = a.get([o || "label", e, "formatter"]);
- return "function" == typeof s ? (r.status = e,
- s(r)) : "string" == typeof s ? Bi(s, r) : void 0
- },
- getRawValue: function(t, e) {
- var i = this.getData(e).getRawDataItem(t);
- if (null != i)
- return !Eb(i) || i instanceof Array ? i : i.value
- },
- formatTooltip: z
- }
- , Bb = function() {
- var t = 0;
- return function() {
- var e = "\0__ec_prop_getter_" + t++;
- return function(t) {
- return t[e] || (t[e] = {})
- }
- }
- }()
- , Gb = 0
- , Wb = "_"
- , Hb = c
- , Fb = ["left", "right", "top", "bottom", "width", "height"]
- , Zb = [["width", "left", "right"], ["height", "top", "bottom"]]
- , Ub = Xo
- , jb = (m(Xo, "vertical"),
- m(Xo, "horizontal"),
- {
- getBoxLayoutParams: function() {
- return {
- left: this.get("left"),
- top: this.get("top"),
- right: this.get("right"),
- bottom: this.get("bottom"),
- width: this.get("width"),
- height: this.get("height")
- }
- }
- })
- , Xb = Array.prototype.push
- , qb = Co.extend({
- type: "component",
- id: "",
- name: "",
- mainType: "",
- subType: "",
- componentIndex: 0,
- defaultOption: null,
- ecModel: null,
- dependentModels: [],
- uid: null,
- layoutMode: null,
- $constructor: function(t, e, i, n) {
- Co.call(this, t, e, i, n),
- this.uid = jo("componentModel")
- },
- init: function(t, e, i, n) {
- this.mergeDefaultAndTheme(t, i)
- },
- mergeDefaultAndTheme: function(t, e) {
- var n = this.layoutMode
- , o = n ? Qo(t) : {};
- i(t, e.getTheme().get(this.mainType)),
- i(t, this.getDefaultOption()),
- n && Jo(t, o, n)
- },
- mergeOption: function(t, e) {
- i(this.option, t, !0);
- var n = this.layoutMode;
- n && Jo(this.option, t, n)
- },
- optionUpdated: function(t, e) {},
- getDefaultOption: function() {
- if (!ji(this, "__defaultOption")) {
- for (var t = [], e = this.constructor; e; ) {
- var n = e.prototype.defaultOption;
- n && t.push(n),
- e = e.superClass
- }
- for (var o = {}, a = t.length - 1; a >= 0; a--)
- o = i(o, t[a], !0);
- Zi(this, "__defaultOption", o)
- }
- return Ui(this, "__defaultOption")
- },
- getReferringComponents: function(t) {
- return this.ecModel.queryComponents({
- mainType: t,
- index: this.get(t + "Index", !0),
- id: this.get(t + "Id", !0)
- })
- }
- });
- Ji(qb, {
- registerWhenExtend: !0
- }),
- function(t) {
- var e = {};
- t.registerSubTypeDefaulter = function(t, i) {
- t = Xi(t),
- e[t.main] = i
- }
- ,
- t.determineSubType = function(i, n) {
- var o = n.type;
- if (!o) {
- var a = Xi(i).main;
- t.hasSubTypes(i) && e[a] && (o = e[a](n))
- }
- return o
- }
- }(qb),
- function(t, e) {
- function i(t) {
- var i = {}
- , a = [];
- return c(t, function(r) {
- var l = n(i, r)
- , h = o(l.originalDeps = e(r), t);
- l.entryCount = h.length,
- 0 === l.entryCount && a.push(r),
- c(h, function(t) {
- s(l.predecessor, t) < 0 && l.predecessor.push(t);
- var e = n(i, t);
- s(e.successor, t) < 0 && e.successor.push(r)
- })
- }),
- {
- graph: i,
- noEntryList: a
- }
- }
- function n(t, e) {
- return t[e] || (t[e] = {
- predecessor: [],
- successor: []
- }),
- t[e]
- }
- function o(t, e) {
- var i = [];
- return c(t, function(t) {
- s(e, t) >= 0 && i.push(t)
- }),
- i
- }
- t.topologicalTravel = function(t, e, n, o) {
- function a(t) {
- s[t].entryCount--,
- 0 === s[t].entryCount && l.push(t)
- }
- if (t.length) {
- var r = i(e)
- , s = r.graph
- , l = r.noEntryList
- , h = {};
- for (c(t, function(t) {
- h[t] = !0
- }); l.length; ) {
- var u = l.pop()
- , d = s[u]
- , f = !!h[u];
- f && (n.call(o, u, d.originalDeps.slice()),
- delete h[u]),
- c(d.successor, f ? function(t) {
- h[t] = !0,
- a(t)
- }
- : a)
- }
- c(h, function() {
- throw new Error("Circle dependency may exists")
- })
- }
- }
- }(qb, function(t) {
- var e = [];
- return c(qb.getClassesByMainType(t), function(t) {
- Xb.apply(e, t.prototype.dependencies || [])
- }),
- d(e, function(t) {
- return Xi(t).main
- })
- }),
- h(qb, jb);
- var Yb = "";
- "undefined" != typeof navigator && (Yb = navigator.platform || "");
- var $b = {
- color: ["#c23531", "#2f4554", "#61a0a8", "#d48265", "#91c7ae", "#749f83", "#ca8622", "#bda29a", "#6e7074", "#546570", "#c4ccd3"],
- textStyle: {
- fontFamily: Yb.match(/^Win/) ? "Microsoft YaHei" : "sans-serif",
- fontSize: 12,
- fontStyle: "normal",
- fontWeight: "normal"
- },
- blendMode: null,
- animation: "auto",
- animationDuration: 1e3,
- animationDurationUpdate: 300,
- animationEasing: "exponentialOut",
- animationEasingUpdate: "cubicOut",
- animationThreshold: 2e3,
- progressiveThreshold: 3e3,
- progressive: 400,
- hoverLayerThreshold: 3e3,
- useUTC: !1
- }
- , Kb = {
- clearColorPalette: function() {
- Zi(this, "colorIdx", 0),
- Zi(this, "colorNameMap", {})
- },
- getColorFromPalette: function(t, e) {
- var i = Ui(e = e || this, "colorIdx") || 0
- , n = Ui(e, "colorNameMap") || Zi(e, "colorNameMap", {});
- if (n.hasOwnProperty(t))
- return n[t];
- var o = this.get("color", !0) || [];
- if (o.length) {
- var a = o[i];
- return t && (n[t] = a),
- Zi(e, "colorIdx", (i + 1) % o.length),
- a
- }
- }
- }
- , Jb = c
- , Qb = g
- , tw = d
- , ew = v
- , iw = s
- , nw = _
- , ow = "\0_ec_inner"
- , aw = Co.extend({
- constructor: aw,
- init: function(t, e, i, n) {
- i = i || {},
- this.option = null,
- this._theme = new Co(i),
- this._optionManager = n
- },
- setOption: function(t, e) {
- D(!(ow in t), "please use chart.getOption()"),
- this._optionManager.setOption(t, e),
- this.resetOption(null)
- },
- resetOption: function(t) {
- var e = !1
- , i = this._optionManager;
- if (!t || "recreate" === t) {
- var n = i.mountOption("recreate" === t);
- this.option && "recreate" !== t ? (this.restoreData(),
- this.mergeOption(n)) : ia.call(this, n),
- e = !0
- }
- if ("timeline" !== t && "media" !== t || this.restoreData(),
- !t || "recreate" === t || "timeline" === t) {
- var o = i.getTimelineOption(this);
- o && (this.mergeOption(o),
- e = !0)
- }
- if (!t || "recreate" === t || "media" === t) {
- var a = i.getMediaOption(this, this._api);
- a.length && Jb(a, function(t) {
- this.mergeOption(t, e = !0)
- }, this)
- }
- return e
- },
- mergeOption: function(t) {
- var n = this.option
- , a = this._componentsMap
- , r = [];
- Jb(t, function(t, o) {
- null != t && (qb.hasClass(o) ? r.push(o) : n[o] = null == n[o] ? e(t) : i(n[o], t, !0))
- }),
- qb.topologicalTravel(r, qb.getAllClassMainTypes(), function(e, i) {
- var r = ko(t[e])
- , s = Eo(a.get(e), r);
- Ro(s),
- Jb(s, function(t, i) {
- var n = t.option;
- nw(n) && (t.keyInfo.mainType = e,
- t.keyInfo.subType = oa(e, n, t.exist))
- });
- var l = na(a, i);
- n[e] = [],
- a.set(e, []),
- Jb(s, function(t, i) {
- var r = t.exist
- , s = t.option;
- if (D(nw(s) || r, "Empty component definition"),
- s) {
- var h = qb.getClass(e, t.keyInfo.subType, !0);
- if (r && r instanceof h)
- r.name = t.keyInfo.name,
- r.mergeOption(s, this),
- r.optionUpdated(s, !1);
- else {
- var u = o({
- dependentModels: l,
- componentIndex: i
- }, t.keyInfo);
- o(r = new h(s,this,this,u), u),
- r.init(s, this, this, u),
- r.optionUpdated(null, !0)
- }
- } else
- r.mergeOption({}, this),
- r.optionUpdated({}, !1);
- a.get(e)[i] = r,
- n[e][i] = r.option
- }, this),
- "series" === e && (this._seriesIndices = aa(a.get("series")))
- }, this),
- this._seriesIndices = this._seriesIndices || []
- },
- getOption: function() {
- var t = e(this.option);
- return Jb(t, function(e, i) {
- if (qb.hasClass(i)) {
- for (var n = (e = ko(e)).length - 1; n >= 0; n--)
- Vo(e[n]) && e.splice(n, 1);
- t[i] = e
- }
- }),
- delete t[ow],
- t
- },
- getTheme: function() {
- return this._theme
- },
- getComponent: function(t, e) {
- var i = this._componentsMap.get(t);
- if (i)
- return i[e || 0]
- },
- queryComponents: function(t) {
- var e = t.mainType;
- if (!e)
- return [];
- var i = t.index
- , n = t.id
- , o = t.name
- , a = this._componentsMap.get(e);
- if (!a || !a.length)
- return [];
- var r;
- if (null != i)
- ew(i) || (i = [i]),
- r = Qb(tw(i, function(t) {
- return a[t]
- }), function(t) {
- return !!t
- });
- else if (null != n) {
- var s = ew(n);
- r = Qb(a, function(t) {
- return s && iw(n, t.id) >= 0 || !s && t.id === n
- })
- } else if (null != o) {
- var l = ew(o);
- r = Qb(a, function(t) {
- return l && iw(o, t.name) >= 0 || !l && t.name === o
- })
- } else
- r = a.slice();
- return ra(r, t)
- },
- findComponents: function(t) {
- var e = t.query
- , i = t.mainType
- , n = function(t) {
- var e = i + "Index"
- , n = i + "Id"
- , o = i + "Name";
- return !t || null == t[e] && null == t[n] && null == t[o] ? null : {
- mainType: i,
- index: t[e],
- id: t[n],
- name: t[o]
- }
- }(e);
- return function(e) {
- return t.filter ? Qb(e, t.filter) : e
- }(ra(n ? this.queryComponents(n) : this._componentsMap.get(i), t))
- },
- eachComponent: function(t, e, i) {
- var n = this._componentsMap;
- if ("function" == typeof t)
- i = e,
- e = t,
- n.each(function(t, n) {
- Jb(t, function(t, o) {
- e.call(i, n, t, o)
- })
- });
- else if (x(t))
- Jb(n.get(t), e, i);
- else if (nw(t)) {
- var o = this.findComponents(t);
- Jb(o, e, i)
- }
- },
- getSeriesByName: function(t) {
- var e = this._componentsMap.get("series");
- return Qb(e, function(e) {
- return e.name === t
- })
- },
- getSeriesByIndex: function(t) {
- return this._componentsMap.get("series")[t]
- },
- getSeriesByType: function(t) {
- var e = this._componentsMap.get("series");
- return Qb(e, function(e) {
- return e.subType === t
- })
- },
- getSeries: function() {
- return this._componentsMap.get("series").slice()
- },
- eachSeries: function(t, e) {
- sa(),
- Jb(this._seriesIndices, function(i) {
- var n = this._componentsMap.get("series")[i];
- t.call(e, n, i)
- }, this)
- },
- eachRawSeries: function(t, e) {
- Jb(this._componentsMap.get("series"), t, e)
- },
- eachSeriesByType: function(t, e, i) {
- sa(),
- Jb(this._seriesIndices, function(n) {
- var o = this._componentsMap.get("series")[n];
- o.subType === t && e.call(i, o, n)
- }, this)
- },
- eachRawSeriesByType: function(t, e, i) {
- return Jb(this.getSeriesByType(t), e, i)
- },
- isSeriesFiltered: function(t) {
- return sa(),
- s(this._seriesIndices, t.componentIndex) < 0
- },
- getCurrentSeriesIndices: function() {
- return (this._seriesIndices || []).slice()
- },
- filterSeries: function(t, e) {
- sa();
- var i = Qb(this._componentsMap.get("series"), t, e);
- this._seriesIndices = aa(i)
- },
- restoreData: function() {
- var t = this._componentsMap;
- this._seriesIndices = aa(t.get("series"));
- var e = [];
- t.each(function(t, i) {
- e.push(i)
- }),
- qb.topologicalTravel(e, qb.getAllClassMainTypes(), function(e, i) {
- Jb(t.get(e), function(t) {
- t.restoreData()
- })
- })
- }
- });
- h(aw, Kb);
- var rw = ["getDom", "getZr", "getWidth", "getHeight", "getDevicePixelRatio", "dispatchAction", "isDisposed", "on", "off", "getDataURL", "getConnectedDataURL", "getModel", "getOption", "getViewOfComponentModel", "getViewOfSeriesModel"]
- , sw = {};
- ha.prototype = {
- constructor: ha,
- create: function(t, e) {
- var i = [];
- c(sw, function(n, o) {
- var a = n.create(t, e);
- i = i.concat(a || [])
- }),
- this._coordinateSystems = i
- },
- update: function(t, e) {
- c(this._coordinateSystems, function(i) {
- i.update && i.update(t, e)
- })
- },
- getCoordinateSystems: function() {
- return this._coordinateSystems.slice()
- }
- },
- ha.register = function(t, e) {
- sw[t] = e
- }
- ,
- ha.get = function(t) {
- return sw[t]
- }
- ;
- var lw = c
- , hw = e
- , uw = d
- , cw = i
- , dw = /^(min|max)?(.+)$/;
- ua.prototype = {
- constructor: ua,
- setOption: function(t, e) {
- t = hw(t, !0);
- var i = this._optionBackup
- , n = ca.call(this, t, e, !i);
- this._newBaseOption = n.baseOption,
- i ? (pa(i.baseOption, n.baseOption),
- n.timelineOptions.length && (i.timelineOptions = n.timelineOptions),
- n.mediaList.length && (i.mediaList = n.mediaList),
- n.mediaDefault && (i.mediaDefault = n.mediaDefault)) : this._optionBackup = n
- },
- mountOption: function(t) {
- var e = this._optionBackup;
- return this._timelineOptions = uw(e.timelineOptions, hw),
- this._mediaList = uw(e.mediaList, hw),
- this._mediaDefault = hw(e.mediaDefault),
- this._currentMediaIndices = [],
- hw(t ? e.baseOption : this._newBaseOption)
- },
- getTimelineOption: function(t) {
- var e, i = this._timelineOptions;
- if (i.length) {
- var n = t.getComponent("timeline");
- n && (e = hw(i[n.getCurrentIndex()], !0))
- }
- return e
- },
- getMediaOption: function(t) {
- var e = this._api.getWidth()
- , i = this._api.getHeight()
- , n = this._mediaList
- , o = this._mediaDefault
- , a = []
- , r = [];
- if (!n.length && !o)
- return r;
- for (var s = 0, l = n.length; s < l; s++)
- da(n[s].query, e, i) && a.push(s);
- return !a.length && o && (a = [-1]),
- a.length && !ga(a, this._currentMediaIndices) && (r = uw(a, function(t) {
- return hw(-1 === t ? o.option : n[t].option)
- })),
- this._currentMediaIndices = a,
- r
- }
- };
- var fw = c
- , gw = _
- , pw = ["areaStyle", "lineStyle", "nodeStyle", "linkStyle", "chordStyle", "label", "labelLine"]
- , mw = function(t, e) {
- fw(_a(t.series), function(t) {
- gw(t) && xa(t)
- });
- var i = ["xAxis", "yAxis", "radiusAxis", "angleAxis", "singleAxis", "parallelAxis", "radar"];
- e && i.push("valueAxis", "categoryAxis", "logAxis", "timeAxis"),
- fw(i, function(e) {
- fw(_a(t[e]), function(t) {
- t && (va(t, "axisLabel"),
- va(t.axisPointer, "label"))
- })
- }),
- fw(_a(t.parallel), function(t) {
- var e = t && t.parallelAxisDefault;
- va(e, "axisLabel"),
- va(e && e.axisPointer, "label")
- }),
- fw(_a(t.calendar), function(t) {
- va(t, "dayLabel"),
- va(t, "monthLabel"),
- va(t, "yearLabel")
- }),
- fw(_a(t.radar), function(t) {
- va(t, "name")
- }),
- fw(_a(t.geo), function(t) {
- gw(t) && (ya(t.label),
- fw(_a(t.regions), function(t) {
- ya(t.label)
- }))
- }),
- ya(ba(t.timeline).label),
- va(ba(t.axisPointer), "label"),
- va(ba(t.tooltip).axisPointer, "label")
- }
- , vw = [["x", "left"], ["y", "top"], ["x2", "right"], ["y2", "bottom"]]
- , yw = ["grid", "geo", "parallel", "legend", "toolbox", "title", "visualMap", "dataZoom", "timeline"]
- , xw = ["bar", "boxplot", "candlestick", "chord", "effectScatter", "funnel", "gauge", "lines", "graph", "heatmap", "line", "map", "parallel", "pie", "radar", "sankey", "scatter", "treemap"]
- , _w = function(t, e) {
- mw(t, e),
- t.series = ko(t.series),
- c(t.series, function(t) {
- if (_(t)) {
- var e = t.type;
- if ("pie" !== e && "gauge" !== e || null != t.clockWise && (t.clockwise = t.clockWise),
- "gauge" === e) {
- var i = wa(t, "pointer.color");
- null != i && Sa(t, "itemStyle.normal.color", i)
- }
- for (var n = 0; n < xw.length; n++)
- if (xw[n] === t.type) {
- Ma(t);
- break
- }
- }
- }),
- t.dataRange && (t.visualMap = t.dataRange),
- c(yw, function(e) {
- var i = t[e];
- i && (v(i) || (i = [i]),
- c(i, function(t) {
- Ma(t)
- }))
- })
- }
- , bw = qb.extend({
- type: "series.__base__",
- seriesIndex: 0,
- coordinateSystem: null,
- defaultOption: null,
- legendDataProvider: null,
- visualColorAccessPath: "itemStyle.normal.color",
- layoutMode: null,
- init: function(t, e, i, n) {
- this.seriesIndex = this.componentIndex,
- this.mergeDefaultAndTheme(t, i);
- var o = this.getInitialData(t, i);
- Zi(this, "dataBeforeProcessed", o),
- this.restoreData()
- },
- mergeDefaultAndTheme: function(t, e) {
- var n = this.layoutMode
- , o = n ? Qo(t) : {}
- , a = this.subType;
- qb.hasClass(a) && (a += "Series"),
- i(t, e.getTheme().get(this.subType)),
- i(t, this.getDefaultOption()),
- Po(t.label, ["show"]),
- this.fillDataTextStyle(t.data),
- n && Jo(t, o, n)
- },
- mergeOption: function(t, e) {
- t = i(this.option, t, !0),
- this.fillDataTextStyle(t.data);
- var n = this.layoutMode;
- n && Jo(this.option, t, n);
- var o = this.getInitialData(t, e);
- o && (Zi(this, "data", o),
- Zi(this, "dataBeforeProcessed", o.cloneShallow()))
- },
- fillDataTextStyle: function(t) {
- if (t)
- for (var e = ["show"], i = 0; i < t.length; i++)
- t[i] && t[i].label && Po(t[i].label, e)
- },
- getInitialData: function() {},
- getData: function(t) {
- var e = Ui(this, "data");
- return null == t ? e : e.getLinkedData(t)
- },
- setData: function(t) {
- Zi(this, "data", t)
- },
- getRawData: function() {
- return Ui(this, "dataBeforeProcessed")
- },
- coordDimToDataDim: function(t) {
- return Fo(this.getData(), t)
- },
- dataDimToCoordDim: function(t) {
- return Ho(this.getData(), t)
- },
- getBaseAxis: function() {
- var t = this.coordinateSystem;
- return t && t.getBaseAxis && t.getBaseAxis()
- },
- formatTooltip: function(t, e, i) {
- var n = Ui(this, "data")
- , o = this.getRawValue(t)
- , a = v(o) ? function(i) {
- function o(t, i) {
- var o = n.getDimensionInfo(i);
- if (o && !1 !== o.otherDims.tooltip) {
- var s = o.type
- , l = (a ? "- " + (o.tooltipName || o.name) + ": " : "") + ("ordinal" === s ? t + "" : "time" === s ? e ? "" : Hi("yyyy/MM/dd hh:mm:ss", t) : Ei(t));
- l && r.push(Vi(l))
- }
- }
- var a = f(i, function(t, e, i) {
- var o = n.getDimensionInfo(i);
- return t |= o && !1 !== o.tooltip && null != o.tooltipName
- }, 0)
- , r = []
- , s = Zo(n, "tooltip");
- return s.length ? c(s, function(e) {
- o(n.get(e, t), e)
- }) : c(i, o),
- (a ? "<br/>" : "") + r.join(a ? "<br/>" : ", ")
- }(o) : Vi(Ei(o))
- , r = n.getName(t)
- , s = n.getItemVisual(t, "color");
- _(s) && s.colorStops && (s = (s.colorStops[0] || {}).color);
- var l = Wi(s = s || "transparent")
- , h = this.name;
- return "\0-" === h && (h = ""),
- h = h ? Vi(h) + (e ? ": " : "<br/>") : "",
- e ? l + h + a : h + l + (r ? Vi(r) + ": " + a : a)
- },
- isAnimationEnabled: function() {
- if (Yv.node)
- return !1;
- var t = this.getShallow("animation");
- return t && this.getData().count() > this.getShallow("animationThreshold") && (t = !1),
- t
- },
- restoreData: function() {
- Zi(this, "data", Ui(this, "dataBeforeProcessed").cloneShallow())
- },
- getColorFromPalette: function(t, e) {
- var i = this.ecModel
- , n = Kb.getColorFromPalette.call(this, t, e);
- return n || (n = i.getColorFromPalette(t, e)),
- n
- },
- getAxisTooltipData: null,
- getTooltipPosition: null
- });
- h(bw, Vb),
- h(bw, Kb);
- var ww = function() {
- this.group = new $y,
- this.uid = jo("viewComponent")
- };
- ww.prototype = {
- constructor: ww,
- init: function(t, e) {},
- render: function(t, e, i, n) {},
- dispose: function() {}
- };
- var Sw = ww.prototype;
- Sw.updateView = Sw.updateLayout = Sw.updateVisual = function(t, e, i, n) {}
- ,
- Yi(ww),
- Ji(ww, {
- registerWhenExtend: !0
- }),
- Ia.prototype = {
- type: "chart",
- init: function(t, e) {},
- render: function(t, e, i, n) {},
- highlight: function(t, e, i, n) {
- Aa(t.getData(), n, "emphasis")
- },
- downplay: function(t, e, i, n) {
- Aa(t.getData(), n, "normal")
- },
- remove: function(t, e) {
- this.group.removeAll()
- },
- dispose: function() {}
- };
- var Mw = Ia.prototype;
- Mw.updateView = Mw.updateLayout = Mw.updateVisual = function(t, e, i, n) {
- this.render(t, e, i, n)
- }
- ,
- Yi(Ia),
- Ji(Ia, {
- registerWhenExtend: !0
- });
- var Iw = "\0__throttleOriginMethod"
- , Tw = "\0__throttleRate"
- , Aw = "\0__throttleType"
- , Cw = Math.PI
- , Dw = c
- , Lw = qb.parseClassType
- , kw = "3.8.0"
- , Pw = {
- zrender: "3.7.0"
- }
- , Ow = 1e3
- , zw = 1e3
- , Nw = 3e3
- , Ew = {
- PROCESSOR: {
- FILTER: Ow,
- STATISTIC: 5e3
- },
- VISUAL: {
- LAYOUT: zw,
- GLOBAL: 2e3,
- CHART: Nw,
- COMPONENT: 4e3,
- BRUSH: 5e3
- }
- }
- , Rw = "__flagInMainProcess"
- , Vw = "__optionUpdated"
- , Bw = /^[a-zA-Z0-9_]+$/;
- Pa.prototype.on = ka("on"),
- Pa.prototype.off = ka("off"),
- Pa.prototype.one = ka("one"),
- h(Pa, my);
- var Gw = Oa.prototype;
- Gw._onframe = function() {
- if (this[Vw]) {
- var t = this[Vw].silent;
- this[Rw] = !0,
- Ww.prepareAndUpdate.call(this),
- this[Rw] = !1,
- this[Vw] = !1,
- Ra.call(this, t),
- Va.call(this, t)
- }
- }
- ,
- Gw.getDom = function() {
- return this._dom
- }
- ,
- Gw.getZr = function() {
- return this._zr
- }
- ,
- Gw.setOption = function(t, e, i) {
- var n;
- if (_(e) && (i = e.lazyUpdate,
- n = e.silent,
- e = e.notMerge),
- this[Rw] = !0,
- !this._model || e) {
- var o = new ua(this._api)
- , a = this._theme;
- (this._model = new aw(null,null,a,o)).init(null, null, a, o)
- }
- this._model.setOption(t, jw),
- i ? (this[Vw] = {
- silent: n
- },
- this[Rw] = !1) : (Ww.prepareAndUpdate.call(this),
- this._zr.flush(),
- this[Vw] = !1,
- this[Rw] = !1,
- Ra.call(this, n),
- Va.call(this, n))
- }
- ,
- Gw.setTheme = function() {
- console.log("ECharts#setTheme() is DEPRECATED in ECharts 3.0")
- }
- ,
- Gw.getModel = function() {
- return this._model
- }
- ,
- Gw.getOption = function() {
- return this._model && this._model.getOption()
- }
- ,
- Gw.getWidth = function() {
- return this._zr.getWidth()
- }
- ,
- Gw.getHeight = function() {
- return this._zr.getHeight()
- }
- ,
- Gw.getDevicePixelRatio = function() {
- return this._zr.painter.dpr || window.devicePixelRatio || 1
- }
- ,
- Gw.getRenderedCanvas = function(t) {
- if (Yv.canvasSupported) {
- (t = t || {}).pixelRatio = t.pixelRatio || 1,
- t.backgroundColor = t.backgroundColor || this._model.get("backgroundColor");
- var e = this._zr;
- return c(e.storage.getDisplayList(), function(t) {
- t.stopAnimation(!0)
- }),
- e.painter.getRenderedCanvas(t)
- }
- }
- ,
- Gw.getSvgDataUrl = function() {
- if (Yv.svgSupported) {
- var t = this._zr;
- return c(t.storage.getDisplayList(), function(t) {
- t.stopAnimation(!0)
- }),
- t.painter.pathToSvg()
- }
- }
- ,
- Gw.getDataURL = function(t) {
- var e = (t = t || {}).excludeComponents
- , i = this._model
- , n = []
- , o = this;
- Dw(e, function(t) {
- i.eachComponent({
- mainType: t
- }, function(t) {
- var e = o._componentsMap[t.__viewId];
- e.group.ignore || (n.push(e),
- e.group.ignore = !0)
- })
- });
- var a = "svg" === this._zr.painter.getType() ? this.getSvgDataUrl() : this.getRenderedCanvas(t).toDataURL("image/" + (t && t.type || "png"));
- return Dw(n, function(t) {
- t.group.ignore = !1
- }),
- a
- }
- ,
- Gw.getConnectedDataURL = function(t) {
- if (Yv.canvasSupported) {
- var i = this.group
- , n = Math.min
- , o = Math.max;
- if (Jw[i]) {
- var a = 1 / 0
- , r = 1 / 0
- , s = -1 / 0
- , l = -1 / 0
- , h = []
- , u = t && t.pixelRatio || 1;
- c(Kw, function(u, c) {
- if (u.group === i) {
- var d = u.getRenderedCanvas(e(t))
- , f = u.getDom().getBoundingClientRect();
- a = n(f.left, a),
- r = n(f.top, r),
- s = o(f.right, s),
- l = o(f.bottom, l),
- h.push({
- dom: d,
- left: f.left,
- top: f.top
- })
- }
- });
- var d = (s *= u) - (a *= u)
- , f = (l *= u) - (r *= u)
- , g = ay();
- g.width = d,
- g.height = f;
- var p = mi(g);
- return Dw(h, function(t) {
- var e = new je({
- style: {
- x: t.left * u - a,
- y: t.top * u - r,
- image: t.dom
- }
- });
- p.add(e)
- }),
- p.refreshImmediately(),
- g.toDataURL("image/" + (t && t.type || "png"))
- }
- return this.getDataURL(t)
- }
- }
- ,
- Gw.convertToPixel = m(za, "convertToPixel"),
- Gw.convertFromPixel = m(za, "convertFromPixel"),
- Gw.containPixel = function(t, e) {
- var i;
- return t = Wo(this._model, t),
- c(t, function(t, n) {
- n.indexOf("Models") >= 0 && c(t, function(t) {
- var o = t.coordinateSystem;
- if (o && o.containPoint)
- i |= !!o.containPoint(e);
- else if ("seriesModels" === n) {
- var a = this._chartsMap[t.__viewId];
- a && a.containPoint && (i |= a.containPoint(e, t))
- }
- }, this)
- }, this),
- !!i
- }
- ,
- Gw.getVisual = function(t, e) {
- var i = (t = Wo(this._model, t, {
- defaultMainType: "series"
- })).seriesModel
- , n = i.getData()
- , o = t.hasOwnProperty("dataIndexInside") ? t.dataIndexInside : t.hasOwnProperty("dataIndex") ? n.indexOfRawIndex(t.dataIndex) : null;
- return null != o ? n.getItemVisual(o, e) : n.getVisual(e)
- }
- ,
- Gw.getViewOfComponentModel = function(t) {
- return this._componentsMap[t.__viewId]
- }
- ,
- Gw.getViewOfSeriesModel = function(t) {
- return this._chartsMap[t.__viewId]
- }
- ;
- var Ww = {
- update: function(t) {
- var e = this._model
- , i = this._api
- , n = this._coordSysMgr
- , o = this._zr;
- if (e) {
- e.restoreData(),
- n.create(this._model, this._api),
- Wa.call(this, e, i),
- Ha.call(this, e),
- n.update(e, i),
- Za.call(this, e, t),
- Ua.call(this, e, t);
- var a = e.get("backgroundColor") || "transparent"
- , r = o.painter;
- if (r.isSingleCanvas && r.isSingleCanvas())
- o.configLayer(0, {
- clearColor: a
- });
- else {
- if (!Yv.canvasSupported) {
- var s = St(a);
- a = Pt(s, "rgb"),
- 0 === s[3] && (a = "transparent")
- }
- a.colorStops || a.image ? (o.configLayer(0, {
- clearColor: a
- }),
- this.__hasGradientOrPatternBg = !0,
- this._dom.style.background = "transparent") : (this.__hasGradientOrPatternBg && o.configLayer(0, {
- clearColor: null
- }),
- this.__hasGradientOrPatternBg = !1,
- this._dom.style.background = a)
- }
- Dw(Xw, function(t) {
- t(e, i)
- })
- }
- },
- updateView: function(t) {
- var e = this._model;
- e && (e.eachSeries(function(t) {
- t.getData().clearAllVisual()
- }),
- Za.call(this, e, t),
- Ba.call(this, "updateView", e, t))
- },
- updateVisual: function(t) {
- var e = this._model;
- e && (e.eachSeries(function(t) {
- t.getData().clearAllVisual()
- }),
- Za.call(this, e, t, !0),
- Ba.call(this, "updateVisual", e, t))
- },
- updateLayout: function(t) {
- var e = this._model;
- e && (Fa.call(this, e, t),
- Ba.call(this, "updateLayout", e, t))
- },
- prepareAndUpdate: function(t) {
- var e = this._model;
- Ga.call(this, "component", e),
- Ga.call(this, "chart", e),
- Ww.update.call(this, t)
- }
- };
- Gw.resize = function(t) {
- this[Rw] = !0,
- this._zr.resize(t);
- var e = this._model && this._model.resetOption("media");
- Ww[e ? "prepareAndUpdate" : "update"].call(this),
- this._loadingFX && this._loadingFX.resize(),
- this[Rw] = !1;
- var i = t && t.silent;
- Ra.call(this, i),
- Va.call(this, i)
- }
- ,
- Gw.showLoading = function(t, e) {
- if (_(t) && (e = t,
- t = ""),
- t = t || "default",
- this.hideLoading(),
- $w[t]) {
- var i = $w[t](this._api, e)
- , n = this._zr;
- this._loadingFX = i,
- n.add(i)
- }
- }
- ,
- Gw.hideLoading = function() {
- this._loadingFX && this._zr.remove(this._loadingFX),
- this._loadingFX = null
- }
- ,
- Gw.makeActionFromEvent = function(t) {
- var e = o({}, t);
- return e.type = Zw[t.type],
- e
- }
- ,
- Gw.dispatchAction = function(t, e) {
- _(e) || (e = {
- silent: !!e
- }),
- Fw[t.type] && this._model && (this[Rw] ? this._pendingActions.push(t) : (Ea.call(this, t, e.silent),
- e.flush ? this._zr.flush(!0) : !1 !== e.flush && Yv.browser.weChat && this._throttledZrFlush(),
- Ra.call(this, e.silent),
- Va.call(this, e.silent)))
- }
- ,
- Gw.on = ka("on"),
- Gw.off = ka("off"),
- Gw.one = ka("one");
- var Hw = ["click", "dblclick", "mouseover", "mouseout", "mousemove", "mousedown", "mouseup", "globalout", "contextmenu"];
- Gw._initEvents = function() {
- Dw(Hw, function(t) {
- this._zr.on(t, function(e) {
- var i, n = this.getModel(), a = e.target;
- if ("globalout" === t)
- i = {};
- else if (a && null != a.dataIndex) {
- var r = a.dataModel || n.getSeriesByIndex(a.seriesIndex);
- i = r && r.getDataParams(a.dataIndex, a.dataType) || {}
- } else
- a && a.eventData && (i = o({}, a.eventData));
- i && (i.event = e,
- i.type = t,
- this.trigger(t, i))
- }, this)
- }, this),
- Dw(Zw, function(t, e) {
- this._messageCenter.on(e, function(t) {
- this.trigger(e, t)
- }, this)
- }, this)
- }
- ,
- Gw.isDisposed = function() {
- return this._disposed
- }
- ,
- Gw.clear = function() {
- this.setOption({
- series: []
- }, !0)
- }
- ,
- Gw.dispose = function() {
- if (!this._disposed) {
- this._disposed = !0;
- var t = this._api
- , e = this._model;
- Dw(this._componentsViews, function(i) {
- i.dispose(e, t)
- }),
- Dw(this._chartsViews, function(i) {
- i.dispose(e, t)
- }),
- this._zr.dispose(),
- delete Kw[this.id]
- }
- }
- ,
- h(Oa, my);
- var Fw = {}
- , Zw = {}
- , Uw = []
- , jw = []
- , Xw = []
- , qw = []
- , Yw = {}
- , $w = {}
- , Kw = {}
- , Jw = {}
- , Qw = new Date - 0
- , tS = new Date - 0
- , eS = "_echarts_instance_"
- , iS = Ka;
- or(2e3, function(t) {
- t.eachRawSeries(function(e) {
- var i = (e.visualColorAccessPath || "itemStyle.normal.color").split(".")
- , n = e.getData()
- , o = e.get(i) || e.getColorFromPalette(e.get("name"));
- n.setVisual("color", o),
- t.isSeriesFiltered(e) || ("function" != typeof o || o instanceof bb || n.each(function(t) {
- n.setItemVisual(t, "color", o(e.getDataParams(t)))
- }),
- n.each(function(t) {
- var e = n.getItemModel(t).get(i, !0);
- null != e && n.setItemVisual(t, "color", e)
- }))
- })
- }),
- Qa(_w),
- ar("default", function(t, e) {
- a(e = e || {}, {
- text: "loading",
- color: "#c23531",
- textColor: "#000",
- maskColor: "rgba(255, 255, 255, 0.8)",
- zlevel: 0
- });
- var i = new pb({
- style: {
- fill: e.maskColor
- },
- zlevel: e.zlevel,
- z: 1e4
- })
- , n = new xb({
- shape: {
- startAngle: -Cw / 2,
- endAngle: -Cw / 2 + .1,
- r: 10
- },
- style: {
- stroke: e.color,
- lineCap: "round",
- lineWidth: 5
- },
- zlevel: e.zlevel,
- z: 10001
- })
- , o = new pb({
- style: {
- fill: "none",
- text: e.text,
- textPosition: "right",
- textDistance: 10,
- textFill: e.textColor
- },
- zlevel: e.zlevel,
- z: 10001
- });
- n.animateShape(!0).when(1e3, {
- endAngle: 3 * Cw / 2
- }).start("circularInOut"),
- n.animateShape(!0).when(1e3, {
- startAngle: 3 * Cw / 2
- }).delay(300).start("circularInOut");
- var r = new $y;
- return r.add(n),
- r.add(o),
- r.add(i),
- r.resize = function() {
- var e = t.getWidth() / 2
- , a = t.getHeight() / 2;
- n.setShape({
- cx: e,
- cy: a
- });
- var r = n.shape.r;
- o.setShape({
- x: e - r,
- y: a - r,
- width: 2 * r,
- height: 2 * r
- }),
- i.setShape({
- x: 0,
- y: 0,
- width: t.getWidth(),
- height: t.getHeight()
- })
- }
- ,
- r.resize(),
- r
- }),
- er({
- type: "highlight",
- event: "highlight",
- update: "highlight"
- }, z),
- er({
- type: "downplay",
- event: "downplay",
- update: "downplay"
- }, z);
- var nS = {
- registerMap: function(e) {
- t.registerMap = e
- },
- getMap: function(e) {
- t.getMap = e
- },
- parseGeoJSON: function(e) {
- t.parseGeoJSON = e
- }
- };
- cr.prototype = {
- constructor: cr,
- add: function(t) {
- return this._add = t,
- this
- },
- update: function(t) {
- return this._update = t,
- this
- },
- remove: function(t) {
- return this._remove = t,
- this
- },
- execute: function() {
- var t = this._old
- , e = this._new
- , i = {}
- , n = []
- , o = [];
- for (dr(t, {}, n, "_oldKeyGetter", this),
- dr(e, i, o, "_newKeyGetter", this),
- a = 0; a < t.length; a++)
- null != (s = i[r = n[a]]) ? ((h = s.length) ? (1 === h && (i[r] = null),
- s = s.unshift()) : i[r] = null,
- this._update && this._update(s, a)) : this._remove && this._remove(a);
- for (var a = 0; a < o.length; a++) {
- var r = o[a];
- if (i.hasOwnProperty(r)) {
- var s = i[r];
- if (null == s)
- continue;
- if (s.length)
- for (var l = 0, h = s.length; l < h; l++)
- this._add && this._add(s[l]);
- else
- this._add && this._add(s)
- }
- }
- }
- };
- var oS = _
- , aS = "undefined" == typeof window ? global : window
- , rS = {
- float: void 0 === aS.Float64Array ? Array : aS.Float64Array,
- int: void 0 === aS.Int32Array ? Array : aS.Int32Array,
- ordinal: Array,
- number: Array,
- time: Array
- }
- , sS = ["stackedOn", "hasItemOption", "_nameList", "_idList", "_rawData"];
- gr.prototype.pure = !1,
- gr.prototype.count = function() {
- return this._array.length
- }
- ,
- gr.prototype.getItem = function(t) {
- return this._array[t]
- }
- ;
- var lS = function(t, e) {
- t = t || ["x", "y"];
- for (var i = {}, n = [], o = 0; o < t.length; o++) {
- var a, r = {};
- "string" == typeof t[o] ? r = {
- name: a = t[o],
- coordDim: a,
- coordDimIndex: 0,
- stackable: !1,
- type: "number"
- } : (a = (r = t[o]).name,
- r.type = r.type || "number",
- r.coordDim || (r.coordDim = a,
- r.coordDimIndex = 0)),
- r.otherDims = r.otherDims || {},
- n.push(a),
- i[a] = r
- }
- this.dimensions = n,
- this._dimensionInfos = i,
- this.hostModel = e,
- this.dataType,
- this.indices = [],
- this._storage = {},
- this._nameList = [],
- this._idList = [],
- this._optionModels = [],
- this.stackedOn = null,
- this._visual = {},
- this._layout = {},
- this._itemVisuals = [],
- this._itemLayouts = [],
- this._graphicEls = [],
- this._rawData,
- this._extent
- }
- , hS = lS.prototype;
- hS.type = "list",
- hS.hasItemOption = !0,
- hS.getDimension = function(t) {
- return isNaN(t) || (t = this.dimensions[t] || t),
- t
- }
- ,
- hS.getDimensionInfo = function(t) {
- return e(this._dimensionInfos[this.getDimension(t)])
- }
- ,
- hS.initData = function(t, e, i) {
- var n = v(t = t || []);
- n && (t = new gr(t)),
- this._rawData = t;
- var o, a = this._storage = {}, r = this.indices = [], s = this.dimensions, l = this._dimensionInfos, h = t.count(), u = [], c = {};
- e = e || [];
- for (x = 0; x < s.length; x++) {
- var d = l[s[x]];
- 0 === d.otherDims.itemName && (o = x);
- var f = rS[d.type];
- a[s[x]] = new f(h)
- }
- var g = this;
- i || (g.hasItemOption = !1),
- i = i || function(t, e, i, n) {
- var o = Oo(t);
- return zo(t) && (g.hasItemOption = !0),
- No(o instanceof Array ? o[n] : o, l[e])
- }
- ;
- for (x = 0; x < h; x++) {
- for (var p = t.getItem(x), m = 0; m < s.length; m++) {
- var y = s[m];
- a[y][x] = i(p, y, x, m)
- }
- r.push(x)
- }
- for (var x = 0; x < h; x++) {
- p = t.getItem(x);
- !e[x] && p && (null != p.name ? e[x] = p.name : null != o && (e[x] = a[s[o]][x]));
- var _ = e[x] || ""
- , b = p && p.id;
- !b && _ && (c[_] = c[_] || 0,
- b = _,
- c[_] > 0 && (b += "__ec__" + c[_]),
- c[_]++),
- b && (u[x] = b)
- }
- this._nameList = e,
- this._idList = u
- }
- ,
- hS.count = function() {
- return this.indices.length
- }
- ,
- hS.get = function(t, e, i) {
- var n = this._storage
- , o = this.indices[e];
- if (null == o || !n[t])
- return NaN;
- var a = n[t][o];
- if (i) {
- var r = this._dimensionInfos[t];
- if (r && r.stackable)
- for (var s = this.stackedOn; s; ) {
- var l = s.get(t, e);
- (a >= 0 && l > 0 || a <= 0 && l < 0) && (a += l),
- s = s.stackedOn
- }
- }
- return a
- }
- ,
- hS.getValues = function(t, e, i) {
- var n = [];
- v(t) || (i = e,
- e = t,
- t = this.dimensions);
- for (var o = 0, a = t.length; o < a; o++)
- n.push(this.get(t[o], e, i));
- return n
- }
- ,
- hS.hasValue = function(t) {
- for (var e = this.dimensions, i = this._dimensionInfos, n = 0, o = e.length; n < o; n++)
- if ("ordinal" !== i[e[n]].type && isNaN(this.get(e[n], t)))
- return !1;
- return !0
- }
- ,
- hS.getDataExtent = function(t, e, i) {
- t = this.getDimension(t);
- var n = this._storage[t]
- , o = this.getDimensionInfo(t);
- e = o && o.stackable && e;
- var a, r = (this._extent || (this._extent = {}))[t + !!e];
- if (r)
- return r;
- if (n) {
- for (var s = 1 / 0, l = -1 / 0, h = 0, u = this.count(); h < u; h++)
- a = this.get(t, h, e),
- i && !i(a, t, h) || (a < s && (s = a),
- a > l && (l = a));
- return this._extent[t + !!e] = [s, l]
- }
- return [1 / 0, -1 / 0]
- }
- ,
- hS.getSum = function(t, e) {
- var i = 0;
- if (this._storage[t])
- for (var n = 0, o = this.count(); n < o; n++) {
- var a = this.get(t, n, e);
- isNaN(a) || (i += a)
- }
- return i
- }
- ,
- hS.indexOf = function(t, e) {
- var i = this._storage[t]
- , n = this.indices;
- if (i)
- for (var o = 0, a = n.length; o < a; o++)
- if (i[n[o]] === e)
- return o;
- return -1
- }
- ,
- hS.indexOfName = function(t) {
- for (var e = this.indices, i = this._nameList, n = 0, o = e.length; n < o; n++)
- if (i[e[n]] === t)
- return n;
- return -1
- }
- ,
- hS.indexOfRawIndex = function(t) {
- var e = this.indices
- , i = e[t];
- if (null != i && i === t)
- return t;
- for (var n = 0, o = e.length - 1; n <= o; ) {
- var a = (n + o) / 2 | 0;
- if (e[a] < t)
- n = a + 1;
- else {
- if (!(e[a] > t))
- return a;
- o = a - 1
- }
- }
- return -1
- }
- ,
- hS.indicesOfNearest = function(t, e, i, n) {
- var o = [];
- if (!this._storage[t])
- return o;
- null == n && (n = 1 / 0);
- for (var a = Number.MAX_VALUE, r = -1, s = 0, l = this.count(); s < l; s++) {
- var h = e - this.get(t, s, i)
- , u = Math.abs(h);
- h <= n && u <= a && ((u < a || h >= 0 && r < 0) && (a = u,
- r = h,
- o.length = 0),
- o.push(s))
- }
- return o
- }
- ,
- hS.getRawIndex = function(t) {
- var e = this.indices[t];
- return null == e ? -1 : e
- }
- ,
- hS.getRawDataItem = function(t) {
- return this._rawData.getItem(this.getRawIndex(t))
- }
- ,
- hS.getName = function(t) {
- return this._nameList[this.indices[t]] || ""
- }
- ,
- hS.getId = function(t) {
- return this._idList[this.indices[t]] || this.getRawIndex(t) + ""
- }
- ,
- hS.each = function(t, e, i, n) {
- "function" == typeof t && (n = i,
- i = e,
- e = t,
- t = []);
- var o = []
- , a = (t = d(pr(t), this.getDimension, this)).length
- , r = this.indices;
- n = n || this;
- for (var s = 0; s < r.length; s++)
- switch (a) {
- case 0:
- e.call(n, s);
- break;
- case 1:
- e.call(n, this.get(t[0], s, i), s);
- break;
- case 2:
- e.call(n, this.get(t[0], s, i), this.get(t[1], s, i), s);
- break;
- default:
- for (var l = 0; l < a; l++)
- o[l] = this.get(t[l], s, i);
- o[l] = s,
- e.apply(n, o)
- }
- }
- ,
- hS.filterSelf = function(t, e, i, n) {
- "function" == typeof t && (n = i,
- i = e,
- e = t,
- t = []);
- var o = []
- , a = []
- , r = (t = d(pr(t), this.getDimension, this)).length
- , s = this.indices;
- n = n || this;
- for (var l = 0; l < s.length; l++) {
- var h;
- if (r)
- if (1 === r)
- h = e.call(n, this.get(t[0], l, i), l);
- else {
- for (var u = 0; u < r; u++)
- a[u] = this.get(t[u], l, i);
- a[u] = l,
- h = e.apply(n, a)
- }
- else
- h = e.call(n, l);
- h && o.push(s[l])
- }
- return this.indices = o,
- this._extent = {},
- this
- }
- ,
- hS.mapArray = function(t, e, i, n) {
- "function" == typeof t && (n = i,
- i = e,
- e = t,
- t = []);
- var o = [];
- return this.each(t, function() {
- o.push(e && e.apply(this, arguments))
- }, i, n),
- o
- }
- ,
- hS.map = function(t, e, i, n) {
- var o = mr(this, t = d(pr(t), this.getDimension, this))
- , a = o.indices = this.indices
- , r = o._storage
- , s = [];
- return this.each(t, function() {
- var i = arguments[arguments.length - 1]
- , n = e && e.apply(this, arguments);
- if (null != n) {
- "number" == typeof n && (s[0] = n,
- n = s);
- for (var o = 0; o < n.length; o++) {
- var l = t[o]
- , h = r[l]
- , u = a[i];
- h && (h[u] = n[o])
- }
- }
- }, i, n),
- o
- }
- ,
- hS.downSample = function(t, e, i, n) {
- for (var o = mr(this, [t]), a = this._storage, r = o._storage, s = this.indices, l = o.indices = [], h = [], u = [], c = Math.floor(1 / e), d = r[t], f = this.count(), g = 0; g < a[t].length; g++)
- r[t][g] = a[t][g];
- for (g = 0; g < f; g += c) {
- c > f - g && (c = f - g,
- h.length = c);
- for (var p = 0; p < c; p++) {
- var m = s[g + p];
- h[p] = d[m],
- u[p] = m
- }
- var v = i(h);
- d[m = u[n(h, v) || 0]] = v,
- l.push(m)
- }
- return o
- }
- ,
- hS.getItemModel = function(t) {
- var e = this.hostModel;
- return t = this.indices[t],
- new Co(this._rawData.getItem(t),e,e && e.ecModel)
- }
- ,
- hS.diff = function(t) {
- var e, i = this._idList, n = t && t._idList;
- return new cr(t ? t.indices : [],this.indices,function(t) {
- return null != (e = n[t]) ? e : "e\0\0" + t
- }
- ,function(t) {
- return null != (e = i[t]) ? e : "e\0\0" + t
- }
- )
- }
- ,
- hS.getVisual = function(t) {
- var e = this._visual;
- return e && e[t]
- }
- ,
- hS.setVisual = function(t, e) {
- if (oS(t))
- for (var i in t)
- t.hasOwnProperty(i) && this.setVisual(i, t[i]);
- else
- this._visual = this._visual || {},
- this._visual[t] = e
- }
- ,
- hS.setLayout = function(t, e) {
- if (oS(t))
- for (var i in t)
- t.hasOwnProperty(i) && this.setLayout(i, t[i]);
- else
- this._layout[t] = e
- }
- ,
- hS.getLayout = function(t) {
- return this._layout[t]
- }
- ,
- hS.getItemLayout = function(t) {
- return this._itemLayouts[t]
- }
- ,
- hS.setItemLayout = function(t, e, i) {
- this._itemLayouts[t] = i ? o(this._itemLayouts[t] || {}, e) : e
- }
- ,
- hS.clearItemLayouts = function() {
- this._itemLayouts.length = 0
- }
- ,
- hS.getItemVisual = function(t, e, i) {
- var n = this._itemVisuals[t]
- , o = n && n[e];
- return null != o || i ? o : this.getVisual(e)
- }
- ,
- hS.setItemVisual = function(t, e, i) {
- var n = this._itemVisuals[t] || {};
- if (this._itemVisuals[t] = n,
- oS(e))
- for (var o in e)
- e.hasOwnProperty(o) && (n[o] = e[o]);
- else
- n[e] = i
- }
- ,
- hS.clearAllVisual = function() {
- this._visual = {},
- this._itemVisuals = []
- }
- ;
- var uS = function(t) {
- t.seriesIndex = this.seriesIndex,
- t.dataIndex = this.dataIndex,
- t.dataType = this.dataType
- };
- hS.setItemGraphicEl = function(t, e) {
- var i = this.hostModel;
- e && (e.dataIndex = t,
- e.dataType = this.dataType,
- e.seriesIndex = i && i.seriesIndex,
- "group" === e.type && e.traverse(uS, e)),
- this._graphicEls[t] = e
- }
- ,
- hS.getItemGraphicEl = function(t) {
- return this._graphicEls[t]
- }
- ,
- hS.eachItemGraphicEl = function(t, e) {
- c(this._graphicEls, function(i, n) {
- i && t && t.call(e, i, n)
- })
- }
- ,
- hS.cloneShallow = function() {
- var t = d(this.dimensions, this.getDimensionInfo, this)
- , e = new lS(t,this.hostModel);
- return e._storage = this._storage,
- fr(e, this),
- e.indices = this.indices.slice(),
- this._extent && (e._extent = o({}, this._extent)),
- e
- }
- ,
- hS.wrapMethod = function(t, e) {
- var i = this[t];
- "function" == typeof i && (this.__wrappedMethods = this.__wrappedMethods || [],
- this.__wrappedMethods.push(t),
- this[t] = function() {
- var t = i.apply(this, arguments);
- return e.apply(this, [t].concat(A(arguments)))
- }
- )
- }
- ,
- hS.TRANSFERABLE_METHODS = ["cloneShallow", "downSample", "map"],
- hS.CHANGABLE_METHODS = ["filterSelf"];
- var cS = c
- , dS = x
- , fS = a
- , gS = {
- tooltip: 1,
- label: 1,
- itemName: 1
- }
- , pS = vr.guessOrdinal = function(t, e) {
- for (var i = 0, n = t.length; i < n; i++) {
- var o = yr(t[i]);
- if (!v(o))
- return !1;
- if (null != (o = o[e]) && isFinite(o) && "" !== o)
- return !1;
- if (dS(o) && "-" !== o)
- return !0
- }
- return !1
- }
- , mS = {
- cartesian2d: function(t, e, i, n) {
- var o = d(["xAxis", "yAxis"], function(t) {
- return i.queryComponents({
- mainType: t,
- index: e.get(t + "Index"),
- id: e.get(t + "Id")
- })[0]
- })
- , a = o[0]
- , r = o[1]
- , s = a.get("type")
- , l = r.get("type")
- , h = [{
- name: "x",
- type: Sr(s),
- stackable: wr(s)
- }, {
- name: "y",
- type: Sr(l),
- stackable: wr(l)
- }]
- , u = "category" === s
- , c = "category" === l;
- h = vr(h, t, n);
- var f = {};
- return u && (f.x = a),
- c && (f.y = r),
- {
- dimensions: h,
- categoryIndex: u ? 0 : c ? 1 : -1,
- categoryAxesModels: f
- }
- },
- singleAxis: function(t, e, i, n) {
- var o = i.queryComponents({
- mainType: "singleAxis",
- index: e.get("singleAxisIndex"),
- id: e.get("singleAxisId")
- })[0]
- , a = o.get("type")
- , r = "category" === a
- , s = [{
- name: "single",
- type: Sr(a),
- stackable: wr(a)
- }];
- s = vr(s, t, n);
- var l = {};
- return r && (l.single = o),
- {
- dimensions: s,
- categoryIndex: r ? 0 : -1,
- categoryAxesModels: l
- }
- },
- polar: function(t, e, i, n) {
- var o = i.queryComponents({
- mainType: "polar",
- index: e.get("polarIndex"),
- id: e.get("polarId")
- })[0]
- , a = o.findAxisModel("angleAxis")
- , r = o.findAxisModel("radiusAxis")
- , s = r.get("type")
- , l = a.get("type")
- , h = [{
- name: "radius",
- type: Sr(s),
- stackable: wr(s)
- }, {
- name: "angle",
- type: Sr(l),
- stackable: wr(l)
- }]
- , u = "category" === l
- , c = "category" === s;
- h = vr(h, t, n);
- var d = {};
- return c && (d.radius = r),
- u && (d.angle = a),
- {
- dimensions: h,
- categoryIndex: u ? 1 : c ? 0 : -1,
- categoryAxesModels: d
- }
- },
- geo: function(t, e, i, n) {
- return {
- dimensions: vr([{
- name: "lng"
- }, {
- name: "lat"
- }], t, n)
- }
- }
- }
- , vS = Ir.prototype;
- vS.parse = function(t) {
- return t
- }
- ,
- vS.getSetting = function(t) {
- return this._setting[t]
- }
- ,
- vS.contain = function(t) {
- var e = this._extent;
- return t >= e[0] && t <= e[1]
- }
- ,
- vS.normalize = function(t) {
- var e = this._extent;
- return e[1] === e[0] ? .5 : (t - e[0]) / (e[1] - e[0])
- }
- ,
- vS.scale = function(t) {
- var e = this._extent;
- return t * (e[1] - e[0]) + e[0]
- }
- ,
- vS.unionExtent = function(t) {
- var e = this._extent;
- t[0] < e[0] && (e[0] = t[0]),
- t[1] > e[1] && (e[1] = t[1])
- }
- ,
- vS.unionExtentFromData = function(t, e) {
- this.unionExtent(t.getDataExtent(e, !0))
- }
- ,
- vS.getExtent = function() {
- return this._extent.slice()
- }
- ,
- vS.setExtent = function(t, e) {
- var i = this._extent;
- isNaN(t) || (i[0] = t),
- isNaN(e) || (i[1] = e)
- }
- ,
- vS.getTicksLabels = function() {
- for (var t = [], e = this.getTicks(), i = 0; i < e.length; i++)
- t.push(this.getLabel(e[i]));
- return t
- }
- ,
- vS.isBlank = function() {
- return this._isBlank
- }
- ,
- vS.setBlank = function(t) {
- this._isBlank = t
- }
- ,
- Yi(Ir),
- Ji(Ir, {
- registerWhenExtend: !0
- });
- var yS = Ir.prototype
- , xS = Ir.extend({
- type: "ordinal",
- init: function(t, e) {
- this._data = t,
- this._extent = e || [0, t.length - 1]
- },
- parse: function(t) {
- return "string" == typeof t ? s(this._data, t) : Math.round(t)
- },
- contain: function(t) {
- return t = this.parse(t),
- yS.contain.call(this, t) && null != this._data[t]
- },
- normalize: function(t) {
- return yS.normalize.call(this, this.parse(t))
- },
- scale: function(t) {
- return Math.round(yS.scale.call(this, t))
- },
- getTicks: function() {
- for (var t = [], e = this._extent, i = e[0]; i <= e[1]; )
- t.push(i),
- i++;
- return t
- },
- getLabel: function(t) {
- return this._data[t]
- },
- count: function() {
- return this._extent[1] - this._extent[0] + 1
- },
- unionExtentFromData: function(t, e) {
- this.unionExtent(t.getDataExtent(e, !1))
- },
- niceTicks: z,
- niceExtent: z
- });
- xS.create = function() {
- return new xS
- }
- ;
- var _S = wi
- , bS = wi
- , wS = Ir.extend({
- type: "interval",
- _interval: 0,
- _intervalPrecision: 2,
- setExtent: function(t, e) {
- var i = this._extent;
- isNaN(t) || (i[0] = parseFloat(t)),
- isNaN(e) || (i[1] = parseFloat(e))
- },
- unionExtent: function(t) {
- var e = this._extent;
- t[0] < e[0] && (e[0] = t[0]),
- t[1] > e[1] && (e[1] = t[1]),
- wS.prototype.setExtent.call(this, e[0], e[1])
- },
- getInterval: function() {
- return this._interval
- },
- setInterval: function(t) {
- this._interval = t,
- this._niceExtent = this._extent.slice(),
- this._intervalPrecision = Ar(t)
- },
- getTicks: function() {
- return Lr(this._interval, this._extent, this._niceExtent, this._intervalPrecision)
- },
- getTicksLabels: function() {
- for (var t = [], e = this.getTicks(), i = 0; i < e.length; i++)
- t.push(this.getLabel(e[i]));
- return t
- },
- getLabel: function(t, e) {
- if (null == t)
- return "";
- var i = e && e.precision;
- return null == i ? i = Ii(t) || 0 : "auto" === i && (i = this._intervalPrecision),
- t = bS(t, i, !0),
- Ei(t)
- },
- niceTicks: function(t, e, i) {
- t = t || 5;
- var n = this._extent
- , o = n[1] - n[0];
- if (isFinite(o)) {
- o < 0 && (o = -o,
- n.reverse());
- var a = Tr(n, t, e, i);
- this._intervalPrecision = a.intervalPrecision,
- this._interval = a.interval,
- this._niceExtent = a.niceTickExtent
- }
- },
- niceExtent: function(t) {
- var e = this._extent;
- if (e[0] === e[1])
- if (0 !== e[0]) {
- var i = e[0];
- t.fixMax ? e[0] -= i / 2 : (e[1] += i / 2,
- e[0] -= i / 2)
- } else
- e[1] = 1;
- var n = e[1] - e[0];
- isFinite(n) || (e[0] = 0,
- e[1] = 1),
- this.niceTicks(t.splitNumber, t.minInterval, t.maxInterval);
- var o = this._interval;
- t.fixMin || (e[0] = bS(Math.floor(e[0] / o) * o)),
- t.fixMax || (e[1] = bS(Math.ceil(e[1] / o) * o))
- }
- });
- wS.create = function() {
- return new wS
- }
- ;
- var SS = wS.prototype
- , MS = Math.ceil
- , IS = Math.floor
- , TS = function(t, e, i, n) {
- for (; i < n; ) {
- var o = i + n >>> 1;
- t[o][1] < e ? i = o + 1 : n = o
- }
- return i
- }
- , AS = wS.extend({
- type: "time",
- getLabel: function(t) {
- var e = this._stepLvl
- , i = new Date(t);
- return Hi(e[0], i, this.getSetting("useUTC"))
- },
- niceExtent: function(t) {
- var e = this._extent;
- if (e[0] === e[1] && (e[0] -= 864e5,
- e[1] += 864e5),
- e[1] === -1 / 0 && e[0] === 1 / 0) {
- var i = new Date;
- e[1] = +new Date(i.getFullYear(),i.getMonth(),i.getDate()),
- e[0] = e[1] - 864e5
- }
- this.niceTicks(t.splitNumber, t.minInterval, t.maxInterval);
- var n = this._interval;
- t.fixMin || (e[0] = wi(IS(e[0] / n) * n)),
- t.fixMax || (e[1] = wi(MS(e[1] / n) * n))
- },
- niceTicks: function(t, e, i) {
- t = t || 10;
- var n = this._extent
- , o = n[1] - n[0]
- , a = o / t;
- null != e && a < e && (a = e),
- null != i && a > i && (a = i);
- var r = CS.length
- , s = TS(CS, a, 0, r)
- , l = CS[Math.min(s, r - 1)]
- , h = l[1];
- "year" === l[0] && (h *= Oi(o / h / t, !0));
- var u = this.getSetting("useUTC") ? 0 : 60 * new Date(+n[0] || +n[1]).getTimezoneOffset() * 1e3
- , c = [Math.round(MS((n[0] - u) / h) * h + u), Math.round(IS((n[1] - u) / h) * h + u)];
- Dr(c, n),
- this._stepLvl = l,
- this._interval = h,
- this._niceExtent = c
- },
- parse: function(t) {
- return +Li(t)
- }
- });
- c(["contain", "normalize"], function(t) {
- AS.prototype[t] = function(e) {
- return SS[t].call(this, this.parse(e))
- }
- });
- var CS = [["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", 36e5], ["hh:mm\nMM-dd", 72e5], ["hh:mm\nMM-dd", 216e5], ["hh:mm\nMM-dd", 432e5], ["MM-dd\nyyyy", 864e5], ["MM-dd\nyyyy", 1728e5], ["MM-dd\nyyyy", 2592e5], ["MM-dd\nyyyy", 3456e5], ["MM-dd\nyyyy", 432e6], ["MM-dd\nyyyy", 5184e5], ["week", 6048e5], ["MM-dd\nyyyy", 864e6], ["week", 12096e5], ["week", 18144e5], ["month", 26784e5], ["week", 36288e5], ["month", 53568e5], ["week", 36288e5], ["quarter", 8208e6], ["month", 107136e5], ["month", 13392e6], ["half-year", 16416e6], ["month", 214272e5], ["month", 26784e6], ["year", 32832e6]];
- AS.create = function(t) {
- return new AS({
- useUTC: t.ecModel.get("useUTC")
- })
- }
- ;
- var DS = Ir.prototype
- , LS = wS.prototype
- , kS = Ii
- , PS = wi
- , OS = Math.floor
- , zS = Math.ceil
- , NS = Math.pow
- , ES = Math.log
- , RS = Ir.extend({
- type: "log",
- base: 10,
- $constructor: function() {
- Ir.apply(this, arguments),
- this._originalScale = new wS
- },
- getTicks: function() {
- var t = this._originalScale
- , e = this._extent
- , i = t.getExtent();
- return d(LS.getTicks.call(this), function(n) {
- var o = wi(NS(this.base, n));
- return o = n === e[0] && t.__fixMin ? kr(o, i[0]) : o,
- o = n === e[1] && t.__fixMax ? kr(o, i[1]) : o
- }, this)
- },
- getLabel: LS.getLabel,
- scale: function(t) {
- return t = DS.scale.call(this, t),
- NS(this.base, t)
- },
- setExtent: function(t, e) {
- var i = this.base;
- t = ES(t) / ES(i),
- e = ES(e) / ES(i),
- LS.setExtent.call(this, t, e)
- },
- getExtent: function() {
- var t = this.base
- , e = DS.getExtent.call(this);
- e[0] = NS(t, e[0]),
- e[1] = NS(t, e[1]);
- var i = this._originalScale
- , n = i.getExtent();
- return i.__fixMin && (e[0] = kr(e[0], n[0])),
- i.__fixMax && (e[1] = kr(e[1], n[1])),
- e
- },
- unionExtent: function(t) {
- this._originalScale.unionExtent(t);
- var e = this.base;
- t[0] = ES(t[0]) / ES(e),
- t[1] = ES(t[1]) / ES(e),
- DS.unionExtent.call(this, t)
- },
- unionExtentFromData: function(t, e) {
- this.unionExtent(t.getDataExtent(e, !0, function(t) {
- return t > 0
- }))
- },
- niceTicks: function(t) {
- t = t || 10;
- var e = this._extent
- , i = e[1] - e[0];
- if (!(i === 1 / 0 || i <= 0)) {
- var n = ki(i);
- for (t / i * n <= .5 && (n *= 10); !isNaN(n) && Math.abs(n) < 1 && Math.abs(n) > 0; )
- n *= 10;
- var o = [wi(zS(e[0] / n) * n), wi(OS(e[1] / n) * n)];
- this._interval = n,
- this._niceExtent = o
- }
- },
- niceExtent: function(t) {
- LS.niceExtent.call(this, t);
- var e = this._originalScale;
- e.__fixMin = t.fixMin,
- e.__fixMax = t.fixMax
- }
- });
- c(["contain", "normalize"], function(t) {
- RS.prototype[t] = function(e) {
- return e = ES(e) / ES(this.base),
- DS[t].call(this, e)
- }
- }),
- RS.create = function() {
- return new RS
- }
- ;
- var VS = {
- getFormattedLabels: function() {
- return Er(this.axis, this.get("axisLabel.formatter"))
- },
- getCategories: function() {
- return "category" === this.get("type") && d(this.get("data"), Vr)
- },
- getMin: function(t) {
- var e = this.option
- , i = t || null == e.rangeStart ? e.min : e.rangeStart;
- return this.axis && null != i && "dataMin" !== i && "function" != typeof i && !S(i) && (i = this.axis.scale.parse(i)),
- i
- },
- getMax: function(t) {
- var e = this.option
- , i = t || null == e.rangeEnd ? e.max : e.rangeEnd;
- return this.axis && null != i && "dataMax" !== i && "function" != typeof i && !S(i) && (i = this.axis.scale.parse(i)),
- i
- },
- getNeedCrossZero: function() {
- var t = this.option;
- return null == t.rangeStart && null == t.rangeEnd && !t.scale
- },
- getCoordSysModel: z,
- setRange: function(t, e) {
- this.option.rangeStart = t,
- this.option.rangeEnd = e
- },
- resetRange: function() {
- this.option.rangeStart = this.option.rangeEnd = null
- }
- }
- , BS = Hn({
- type: "triangle",
- shape: {
- cx: 0,
- cy: 0,
- width: 0,
- height: 0
- },
- buildPath: function(t, e) {
- var i = e.cx
- , n = e.cy
- , o = e.width / 2
- , a = e.height / 2;
- t.moveTo(i, n - a),
- t.lineTo(i + o, n + a),
- t.lineTo(i - o, n + a),
- t.closePath()
- }
- })
- , GS = Hn({
- type: "diamond",
- shape: {
- cx: 0,
- cy: 0,
- width: 0,
- height: 0
- },
- buildPath: function(t, e) {
- var i = e.cx
- , n = e.cy
- , o = e.width / 2
- , a = e.height / 2;
- t.moveTo(i, n - a),
- t.lineTo(i + o, n),
- t.lineTo(i, n + a),
- t.lineTo(i - o, n),
- t.closePath()
- }
- })
- , WS = Hn({
- type: "pin",
- shape: {
- x: 0,
- y: 0,
- width: 0,
- height: 0
- },
- buildPath: function(t, e) {
- var i = e.x
- , n = e.y
- , o = e.width / 5 * 3
- , a = Math.max(o, e.height)
- , r = o / 2
- , s = r * r / (a - r)
- , l = n - a + r + s
- , h = Math.asin(s / r)
- , u = Math.cos(h) * r
- , c = Math.sin(h)
- , d = Math.cos(h)
- , f = .6 * r
- , g = .7 * r;
- t.moveTo(i - u, l + s),
- t.arc(i, l, r, Math.PI - h, 2 * Math.PI + h),
- t.bezierCurveTo(i + u - c * f, l + s + d * f, i, n - g, i, n),
- t.bezierCurveTo(i, n - g, i - u + c * f, l + s + d * f, i - u, l + s),
- t.closePath()
- }
- })
- , HS = Hn({
- type: "arrow",
- shape: {
- x: 0,
- y: 0,
- width: 0,
- height: 0
- },
- buildPath: function(t, e) {
- var i = e.height
- , n = e.width
- , o = e.x
- , a = e.y
- , r = n / 3 * 2;
- t.moveTo(o, a),
- t.lineTo(o + r, a + i),
- t.lineTo(o, a + i / 4 * 3),
- t.lineTo(o - r, a + i),
- t.lineTo(o, a),
- t.closePath()
- }
- })
- , FS = {
- line: function(t, e, i, n, o) {
- o.x1 = t,
- o.y1 = e + n / 2,
- o.x2 = t + i,
- o.y2 = e + n / 2
- },
- rect: function(t, e, i, n, o) {
- o.x = t,
- o.y = e,
- o.width = i,
- o.height = n
- },
- roundRect: function(t, e, i, n, o) {
- o.x = t,
- o.y = e,
- o.width = i,
- o.height = n,
- o.r = Math.min(i, n) / 4
- },
- square: function(t, e, i, n, o) {
- var a = Math.min(i, n);
- o.x = t,
- o.y = e,
- o.width = a,
- o.height = a
- },
- circle: function(t, e, i, n, o) {
- o.cx = t + i / 2,
- o.cy = e + n / 2,
- o.r = Math.min(i, n) / 2
- },
- diamond: function(t, e, i, n, o) {
- o.cx = t + i / 2,
- o.cy = e + n / 2,
- o.width = i,
- o.height = n
- },
- pin: function(t, e, i, n, o) {
- o.x = t + i / 2,
- o.y = e + n / 2,
- o.width = i,
- o.height = n
- },
- arrow: function(t, e, i, n, o) {
- o.x = t + i / 2,
- o.y = e + n / 2,
- o.width = i,
- o.height = n
- },
- triangle: function(t, e, i, n, o) {
- o.cx = t + i / 2,
- o.cy = e + n / 2,
- o.width = i,
- o.height = n
- }
- }
- , ZS = {};
- c({
- line: mb,
- rect: pb,
- roundRect: pb,
- square: pb,
- circle: rb,
- diamond: GS,
- pin: WS,
- arrow: HS,
- triangle: BS
- }, function(t, e) {
- ZS[e] = new t
- });
- var US = Hn({
- type: "symbol",
- shape: {
- symbolType: "",
- x: 0,
- y: 0,
- width: 0,
- height: 0
- },
- beforeBrush: function() {
- var t = this.style;
- "pin" === this.shape.symbolType && "inside" === t.textPosition && (t.textPosition = ["50%", "40%"],
- t.textAlign = "center",
- t.textVerticalAlign = "middle")
- },
- buildPath: function(t, e, i) {
- var n = e.symbolType
- , o = ZS[n];
- "none" !== e.symbolType && (o || (o = ZS[n = "rect"]),
- FS[n](e.x, e.y, e.width, e.height, o.shape),
- o.buildPath(t, o.shape, i))
- }
- })
- , jS = (Object.freeze || Object)({
- createList: function(t) {
- return br(t.get("data"), t, t.ecModel)
- },
- createScale: function(t, e) {
- var i = e;
- e instanceof Co || h(i = new Co(e), VS);
- var n = zr(i);
- return n.setExtent(t[0], t[1]),
- Or(n, i),
- n
- },
- mixinAxisModelCommonMethods: function(t) {
- h(t, VS)
- },
- completeDimensions: vr,
- createSymbol: Gr
- })
- , XS = _i
- , qS = [0, 1]
- , YS = function(t, e, i) {
- this.dim = t,
- this.scale = e,
- this._extent = i || [0, 0],
- this.inverse = !1,
- this.onBand = !1,
- this._labelInterval
- };
- YS.prototype = {
- constructor: YS,
- contain: function(t) {
- var e = this._extent
- , i = Math.min(e[0], e[1])
- , n = Math.max(e[0], e[1]);
- return t >= i && t <= n
- },
- containData: function(t) {
- return this.contain(this.dataToCoord(t))
- },
- getExtent: function() {
- return this._extent.slice()
- },
- getPixelPrecision: function(t) {
- return Ti(t || this.scale.getExtent(), this._extent)
- },
- setExtent: function(t, e) {
- var i = this._extent;
- i[0] = t,
- i[1] = e
- },
- dataToCoord: function(t, e) {
- var i = this._extent
- , n = this.scale;
- return t = n.normalize(t),
- this.onBand && "ordinal" === n.type && Wr(i = i.slice(), n.count()),
- XS(t, qS, i, e)
- },
- coordToData: function(t, e) {
- var i = this._extent
- , n = this.scale;
- this.onBand && "ordinal" === n.type && Wr(i = i.slice(), n.count());
- var o = XS(t, i, qS, e);
- return this.scale.scale(o)
- },
- pointToData: function(t, e) {},
- getTicksCoords: function(t) {
- if (this.onBand && !t) {
- for (var e = this.getBands(), i = [], n = 0; n < e.length; n++)
- i.push(e[n][0]);
- return e[n - 1] && i.push(e[n - 1][1]),
- i
- }
- return d(this.scale.getTicks(), this.dataToCoord, this)
- },
- getLabelsCoords: function() {
- return d(this.scale.getTicks(), this.dataToCoord, this)
- },
- getBands: function() {
- for (var t = this.getExtent(), e = [], i = this.scale.count(), n = t[0], o = t[1] - n, a = 0; a < i; a++)
- e.push([o * a / i + n, o * (a + 1) / i + n]);
- return e
- },
- getBandWidth: function() {
- var t = this._extent
- , e = this.scale.getExtent()
- , i = e[1] - e[0] + (this.onBand ? 1 : 0);
- 0 === i && (i = 1);
- var n = Math.abs(t[1] - t[0]);
- return Math.abs(n) / i
- },
- isHorizontal: null,
- getRotate: null,
- getLabelInterval: function() {
- var t = this._labelInterval;
- if (!t) {
- var e = this.model
- , i = e.getModel("axisLabel");
- t = i.get("interval"),
- "category" !== this.type || null != t && "auto" !== t || (t = Nr(d(this.scale.getTicks(), this.dataToCoord, this), e.getFormattedLabels(), i.getFont(), this.getRotate ? this.getRotate() : this.isHorizontal && !this.isHorizontal() ? 90 : 0, i.get("rotate"))),
- this._labelInterval = t
- }
- return t
- }
- };
- var $S = {};
- c(["map", "each", "filter", "indexOf", "inherits", "reduce", "filter", "bind", "curry", "isArray", "isString", "isObject", "isFunction", "extend", "defaults", "clone", "merge"], function(t) {
- $S[t] = ly[t]
- });
- var KS = (Object.freeze || Object)({
- parse: function(t) {
- var e;
- if (!(e = "string" == typeof t ? (new DOMParser).parseFromString(t, "text/xml") : t) || e.getElementsByTagName("parsererror").length)
- return null;
- var i = jr(e, "gexf");
- if (!i)
- return null;
- for (var n = jr(i, "graph"), o = Hr(jr(n, "attributes")), a = {}, r = 0; r < o.length; r++)
- a[o[r].id] = o[r];
- return {
- nodes: Fr(jr(n, "nodes"), a),
- links: Zr(jr(n, "edges"))
- }
- }
- })
- , JS = function(t, e) {
- var i = (t.length - 1) * e + 1
- , n = Math.floor(i)
- , o = +t[n - 1]
- , a = i - n;
- return a ? o + a * (t[n] - o) : o
- }
- , QS = (Object.freeze || Object)({
- version: "1.0.0",
- gexf: KS,
- prepareBoxplotData: function(t, e) {
- for (var i = [], n = [], o = [], a = (e = e || []).boundIQR, r = "none" === a || 0 === a, s = 0; s < t.length; s++) {
- o.push(s + "");
- var l = Si(t[s].slice())
- , h = JS(l, .25)
- , u = JS(l, .5)
- , c = JS(l, .75)
- , d = l[0]
- , f = l[l.length - 1]
- , g = (null == a ? 1.5 : a) * (c - h)
- , p = r ? d : Math.max(d, h - g)
- , m = r ? f : Math.min(f, c + g);
- i.push([p, h, u, c, m]);
- for (var v = 0; v < l.length; v++) {
- var y = l[v];
- if (y < p || y > m) {
- var x = [s, y];
- "vertical" === e.layout && x.reverse(),
- n.push(x)
- }
- }
- }
- return {
- boxData: i,
- outliers: n,
- axisData: o
- }
- }
- });
- bw.extend({
- type: "series.line",
- dependencies: ["grid", "polar"],
- getInitialData: function(t, e) {
- return br(t.data, this, e)
- },
- defaultOption: {
- zlevel: 0,
- z: 2,
- coordinateSystem: "cartesian2d",
- legendHoverLink: !0,
- hoverAnimation: !0,
- clipOverflow: !0,
- label: {
- normal: {
- position: "top"
- }
- },
- lineStyle: {
- normal: {
- width: 2,
- type: "solid"
- }
- },
- step: !1,
- smooth: !1,
- smoothMonotone: null,
- symbol: "emptyCircle",
- symbolSize: 4,
- symbolRotate: null,
- showSymbol: !0,
- showAllSymbol: !1,
- connectNulls: !1,
- sampling: "none",
- animationEasing: "linear",
- progressive: 0,
- hoverLayerThreshold: 1 / 0
- }
- });
- var tM = Kr.prototype;
- tM._createSymbol = function(t, e, i, n) {
- this.removeAll();
- var o = Gr(t, -1, -1, 2, 2, e.getItemVisual(i, "color"));
- o.attr({
- z2: 100,
- culling: !0,
- scale: $r(n)
- }),
- o.drift = Jr,
- this._symbolType = t,
- this.add(o)
- }
- ,
- tM.stopSymbolAnimation = function(t) {
- this.childAt(0).stopAnimation(t)
- }
- ,
- tM.getSymbolPath = function() {
- return this.childAt(0)
- }
- ,
- tM.getScale = function() {
- return this.childAt(0).scale
- }
- ,
- tM.highlight = function() {
- this.childAt(0).trigger("emphasis")
- }
- ,
- tM.downplay = function() {
- this.childAt(0).trigger("normal")
- }
- ,
- tM.setZ = function(t, e) {
- var i = this.childAt(0);
- i.zlevel = t,
- i.z = e
- }
- ,
- tM.setDraggable = function(t) {
- var e = this.childAt(0);
- e.draggable = t,
- e.cursor = t ? "move" : "pointer"
- }
- ,
- tM.updateData = function(t, e, i) {
- this.silent = !1;
- var n = t.getItemVisual(e, "symbol") || "circle"
- , o = t.hostModel
- , a = Yr(t, e)
- , r = n !== this._symbolType;
- if (r ? this._createSymbol(n, t, e, a) : ((s = this.childAt(0)).silent = !1,
- _o(s, {
- scale: $r(a)
- }, o, e)),
- this._updateCommon(t, e, a, i),
- r) {
- var s = this.childAt(0)
- , l = i && i.fadeIn
- , h = {
- scale: s.scale.slice()
- };
- l && (h.style = {
- opacity: s.style.opacity
- }),
- s.scale = [0, 0],
- l && (s.style.opacity = 0),
- bo(s, h, o, e)
- }
- this._seriesModel = o
- }
- ;
- var eM = ["itemStyle", "normal"]
- , iM = ["itemStyle", "emphasis"]
- , nM = ["label", "normal"]
- , oM = ["label", "emphasis"];
- tM._updateCommon = function(t, e, i, n) {
- var a = this.childAt(0)
- , r = t.hostModel
- , s = t.getItemVisual(e, "color");
- "image" !== a.type && a.useStyle({
- strokeNoScale: !0
- });
- var l = n && n.itemStyle
- , h = n && n.hoverItemStyle
- , u = n && n.symbolRotate
- , c = n && n.symbolOffset
- , d = n && n.labelModel
- , f = n && n.hoverLabelModel
- , g = n && n.hoverAnimation
- , p = n && n.cursorStyle;
- if (!n || t.hasItemOption) {
- var m = n && n.itemModel ? n.itemModel : t.getItemModel(e);
- l = m.getModel(eM).getItemStyle(["color"]),
- h = m.getModel(iM).getItemStyle(),
- u = m.getShallow("symbolRotate"),
- c = m.getShallow("symbolOffset"),
- d = m.getModel(nM),
- f = m.getModel(oM),
- g = m.getShallow("hoverAnimation"),
- p = m.getShallow("cursor")
- } else
- h = o({}, h);
- var v = a.style;
- a.attr("rotation", (u || 0) * Math.PI / 180 || 0),
- c && a.attr("position", [bi(c[0], i[0]), bi(c[1], i[1])]),
- p && a.attr("cursor", p),
- a.setColor(s, n && n.symbolInnerColor),
- a.setStyle(l);
- var y = t.getItemVisual(e, "opacity");
- null != y && (v.opacity = y);
- var x = n && n.useNameLabel
- , _ = !x && qr(t);
- (x || null != _) && ho(v, h, d, f, {
- labelFetcher: r,
- labelDataIndex: e,
- defaultText: x ? t.getName(e) : t.get(_, e),
- isRectText: !0,
- autoColor: s
- }),
- a.off("mouseover").off("mouseout").off("emphasis").off("normal"),
- a.hoverStyle = h,
- lo(a);
- var b = $r(i);
- if (g && r.isAnimationEnabled()) {
- var w = function() {
- var t = b[1] / b[0];
- this.animateTo({
- scale: [Math.max(1.1 * b[0], b[0] + 3), Math.max(1.1 * b[1], b[1] + 3 * t)]
- }, 400, "elasticOut")
- }
- , S = function() {
- this.animateTo({
- scale: b
- }, 400, "elasticOut")
- };
- a.on("mouseover", w).on("mouseout", S).on("emphasis", w).on("normal", S)
- }
- }
- ,
- tM.fadeOut = function(t, e) {
- var i = this.childAt(0);
- this.silent = i.silent = !0,
- !(e && e.keepLabel) && (i.style.text = null),
- _o(i, {
- style: {
- opacity: 0
- },
- scale: [0, 0]
- }, this._seriesModel, this.dataIndex, t)
- }
- ,
- l(Kr, $y);
- var aM = Qr.prototype;
- aM.updateData = function(t, e) {
- var i = this.group
- , n = t.hostModel
- , o = this._data
- , a = this._symbolCtor
- , r = {
- itemStyle: n.getModel("itemStyle.normal").getItemStyle(["color"]),
- hoverItemStyle: n.getModel("itemStyle.emphasis").getItemStyle(),
- symbolRotate: n.get("symbolRotate"),
- symbolOffset: n.get("symbolOffset"),
- hoverAnimation: n.get("hoverAnimation"),
- labelModel: n.getModel("label.normal"),
- hoverLabelModel: n.getModel("label.emphasis"),
- cursorStyle: n.get("cursor")
- };
- t.diff(o).add(function(n) {
- var o = t.getItemLayout(n);
- if (ts(t, n, e)) {
- var s = new a(t,n,r);
- s.attr("position", o),
- t.setItemGraphicEl(n, s),
- i.add(s)
- }
- }).update(function(s, l) {
- var h = o.getItemGraphicEl(l)
- , u = t.getItemLayout(s);
- ts(t, s, e) ? (h ? (h.updateData(t, s, r),
- _o(h, {
- position: u
- }, n)) : (h = new a(t,s)).attr("position", u),
- i.add(h),
- t.setItemGraphicEl(s, h)) : i.remove(h)
- }).remove(function(t) {
- var e = o.getItemGraphicEl(t);
- e && e.fadeOut(function() {
- i.remove(e)
- })
- }).execute(),
- this._data = t
- }
- ,
- aM.updateLayout = function() {
- var t = this._data;
- t && t.eachItemGraphicEl(function(e, i) {
- var n = t.getItemLayout(i);
- e.attr("position", n)
- })
- }
- ,
- aM.remove = function(t) {
- var e = this.group
- , i = this._data;
- i && (t ? i.eachItemGraphicEl(function(t) {
- t.fadeOut(function() {
- e.remove(t)
- })
- }) : e.removeAll())
- }
- ;
- var rM = function(t, e, i, n, o, a) {
- for (var r = ns(t, e), s = [], l = [], h = [], u = [], c = [], d = [], f = [], g = a.dimensions, p = 0; p < r.length; p++) {
- var m = r[p]
- , v = !0;
- switch (m.cmd) {
- case "=":
- var y = t.getItemLayout(m.idx)
- , x = e.getItemLayout(m.idx1);
- (isNaN(y[0]) || isNaN(y[1])) && (y = x.slice()),
- s.push(y),
- l.push(x),
- h.push(i[m.idx]),
- u.push(n[m.idx1]),
- f.push(e.getRawIndex(m.idx1));
- break;
- case "+":
- _ = m.idx;
- s.push(o.dataToPoint([e.get(g[0], _, !0), e.get(g[1], _, !0)])),
- l.push(e.getItemLayout(_).slice()),
- h.push(is(o, e, _)),
- u.push(n[_]),
- f.push(e.getRawIndex(_));
- break;
- case "-":
- var _ = m.idx
- , b = t.getRawIndex(_);
- b !== _ ? (s.push(t.getItemLayout(_)),
- l.push(a.dataToPoint([t.get(g[0], _, !0), t.get(g[1], _, !0)])),
- h.push(i[_]),
- u.push(is(a, t, _)),
- f.push(b)) : v = !1
- }
- v && (c.push(m),
- d.push(d.length))
- }
- d.sort(function(t, e) {
- return f[t] - f[e]
- });
- for (var w = [], S = [], M = [], I = [], T = [], p = 0; p < d.length; p++) {
- _ = d[p];
- w[p] = s[_],
- S[p] = l[_],
- M[p] = h[_],
- I[p] = u[_],
- T[p] = c[_]
- }
- return {
- current: w,
- next: S,
- stackedOnCurrent: M,
- stackedOnNext: I,
- status: T
- }
- }
- , sM = $
- , lM = K
- , hM = G
- , uM = E
- , cM = []
- , dM = []
- , fM = []
- , gM = On.extend({
- type: "ec-polyline",
- shape: {
- points: [],
- smooth: 0,
- smoothConstraint: !0,
- smoothMonotone: null,
- connectNulls: !1
- },
- style: {
- fill: null,
- stroke: "#000"
- },
- brush: lb(On.prototype.brush),
- buildPath: function(t, e) {
- var i = e.points
- , n = 0
- , o = i.length
- , a = rs(i, e.smoothConstraint);
- if (e.connectNulls) {
- for (; o > 0 && os(i[o - 1]); o--)
- ;
- for (; n < o && os(i[n]); n++)
- ;
- }
- for (; n < o; )
- n += as(t, i, n, o, o, 1, a.min, a.max, e.smooth, e.smoothMonotone, e.connectNulls) + 1
- }
- })
- , pM = On.extend({
- type: "ec-polygon",
- shape: {
- points: [],
- stackedOnPoints: [],
- smooth: 0,
- stackedOnSmooth: 0,
- smoothConstraint: !0,
- smoothMonotone: null,
- connectNulls: !1
- },
- brush: lb(On.prototype.brush),
- buildPath: function(t, e) {
- var i = e.points
- , n = e.stackedOnPoints
- , o = 0
- , a = i.length
- , r = e.smoothMonotone
- , s = rs(i, e.smoothConstraint)
- , l = rs(n, e.smoothConstraint);
- if (e.connectNulls) {
- for (; a > 0 && os(i[a - 1]); a--)
- ;
- for (; o < a && os(i[o]); o++)
- ;
- }
- for (; o < a; ) {
- var h = as(t, i, o, a, a, 1, s.min, s.max, e.smooth, r, e.connectNulls);
- as(t, n, o + h - 1, h, a, -1, l.min, l.max, e.stackedOnSmooth, r, e.connectNulls),
- o += h + 1,
- t.closePath()
- }
- }
- });
- Ia.extend({
- type: "line",
- init: function() {
- var t = new $y
- , e = new Qr;
- this.group.add(e.group),
- this._symbolDraw = e,
- this._lineGroup = t
- },
- render: function(t, e, i) {
- var n = t.coordinateSystem
- , o = this.group
- , r = t.getData()
- , s = t.getModel("lineStyle.normal")
- , l = t.getModel("areaStyle.normal")
- , h = r.mapArray(r.getItemLayout, !0)
- , u = "polar" === n.type
- , c = this._coordSys
- , d = this._symbolDraw
- , f = this._polyline
- , g = this._polygon
- , p = this._lineGroup
- , m = t.get("animation")
- , v = !l.isEmpty()
- , y = cs(n, r)
- , x = t.get("showSymbol")
- , _ = x && !u && !t.get("showAllSymbol") && this._getSymbolIgnoreFunc(r, n)
- , b = this._data;
- b && b.eachItemGraphicEl(function(t, e) {
- t.__temp && (o.remove(t),
- b.setItemGraphicEl(e, null))
- }),
- x || d.remove(),
- o.add(p);
- var w = !u && t.get("step");
- f && c.type === n.type && w === this._step ? (v && !g ? g = this._newPolygon(h, y, n, m) : g && !v && (p.remove(g),
- g = this._polygon = null),
- p.setClipPath(gs(n, !1, t)),
- x && d.updateData(r, _),
- r.eachItemGraphicEl(function(t) {
- t.stopAnimation(!0)
- }),
- ss(this._stackedOnPoints, y) && ss(this._points, h) || (m ? this._updateAnimation(r, y, n, i, w) : (w && (h = ps(h, n, w),
- y = ps(y, n, w)),
- f.setShape({
- points: h
- }),
- g && g.setShape({
- points: h,
- stackedOnPoints: y
- })))) : (x && d.updateData(r, _),
- w && (h = ps(h, n, w),
- y = ps(y, n, w)),
- f = this._newPolyline(h, n, m),
- v && (g = this._newPolygon(h, y, n, m)),
- p.setClipPath(gs(n, !0, t)));
- var S = ms(r, n) || r.getVisual("color");
- f.useStyle(a(s.getLineStyle(), {
- fill: "none",
- stroke: S,
- lineJoin: "bevel"
- }));
- var M = t.get("smooth");
- if (M = ls(t.get("smooth")),
- f.setShape({
- smooth: M,
- smoothMonotone: t.get("smoothMonotone"),
- connectNulls: t.get("connectNulls")
- }),
- g) {
- var I = r.stackedOn
- , T = 0;
- g.useStyle(a(l.getAreaStyle(), {
- fill: S,
- opacity: .7,
- lineJoin: "bevel"
- })),
- I && (T = ls(I.hostModel.get("smooth"))),
- g.setShape({
- smooth: M,
- stackedOnSmooth: T,
- smoothMonotone: t.get("smoothMonotone"),
- connectNulls: t.get("connectNulls")
- })
- }
- this._data = r,
- this._coordSys = n,
- this._stackedOnPoints = y,
- this._points = h,
- this._step = w
- },
- dispose: function() {},
- highlight: function(t, e, i, n) {
- var o = t.getData()
- , a = Go(o, n);
- if (!(a instanceof Array) && null != a && a >= 0) {
- var r = o.getItemGraphicEl(a);
- if (!r) {
- var s = o.getItemLayout(a);
- if (!s)
- return;
- (r = new Kr(o,a)).position = s,
- r.setZ(t.get("zlevel"), t.get("z")),
- r.ignore = isNaN(s[0]) || isNaN(s[1]),
- r.__temp = !0,
- o.setItemGraphicEl(a, r),
- r.stopSymbolAnimation(!0),
- this.group.add(r)
- }
- r.highlight()
- } else
- Ia.prototype.highlight.call(this, t, e, i, n)
- },
- downplay: function(t, e, i, n) {
- var o = t.getData()
- , a = Go(o, n);
- if (null != a && a >= 0) {
- var r = o.getItemGraphicEl(a);
- r && (r.__temp ? (o.setItemGraphicEl(a, null),
- this.group.remove(r)) : r.downplay())
- } else
- Ia.prototype.downplay.call(this, t, e, i, n)
- },
- _newPolyline: function(t) {
- var e = this._polyline;
- return e && this._lineGroup.remove(e),
- e = new gM({
- shape: {
- points: t
- },
- silent: !0,
- z2: 10
- }),
- this._lineGroup.add(e),
- this._polyline = e,
- e
- },
- _newPolygon: function(t, e) {
- var i = this._polygon;
- return i && this._lineGroup.remove(i),
- i = new pM({
- shape: {
- points: t,
- stackedOnPoints: e
- },
- silent: !0
- }),
- this._lineGroup.add(i),
- this._polygon = i,
- i
- },
- _getSymbolIgnoreFunc: function(t, e) {
- var i = e.getAxesByScale("ordinal")[0];
- if (i && i.isLabelIgnored)
- return p(i.isLabelIgnored, i)
- },
- _updateAnimation: function(t, e, i, n, o) {
- var a = this._polyline
- , r = this._polygon
- , s = t.hostModel
- , l = rM(this._data, t, this._stackedOnPoints, e, this._coordSys, i)
- , h = l.current
- , u = l.stackedOnCurrent
- , c = l.next
- , d = l.stackedOnNext;
- o && (h = ps(l.current, i, o),
- u = ps(l.stackedOnCurrent, i, o),
- c = ps(l.next, i, o),
- d = ps(l.stackedOnNext, i, o)),
- a.shape.__points = l.current,
- a.shape.points = h,
- _o(a, {
- shape: {
- points: c
- }
- }, s),
- r && (r.setShape({
- points: h,
- stackedOnPoints: u
- }),
- _o(r, {
- shape: {
- points: c,
- stackedOnPoints: d
- }
- }, s));
- for (var f = [], g = l.status, p = 0; p < g.length; p++)
- if ("=" === g[p].cmd) {
- var m = t.getItemGraphicEl(g[p].idx1);
- m && f.push({
- el: m,
- ptIdx: p
- })
- }
- a.animators && a.animators.length && a.animators[0].during(function() {
- for (var t = 0; t < f.length; t++)
- f[t].el.attr("position", a.shape.__points[f[t].ptIdx])
- })
- },
- remove: function(t) {
- var e = this.group
- , i = this._data;
- this._lineGroup.removeAll(),
- this._symbolDraw.remove(!0),
- i && i.eachItemGraphicEl(function(t, n) {
- t.__temp && (e.remove(t),
- i.setItemGraphicEl(n, null))
- }),
- this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._data = null
- }
- });
- var mM = function(t, e, i, n, o) {
- n.eachRawSeriesByType(t, function(t) {
- var o = t.getData()
- , a = t.get("symbol") || e
- , r = t.get("symbolSize");
- o.setVisual({
- legendSymbol: i || a,
- symbol: a,
- symbolSize: r
- }),
- n.isSeriesFiltered(t) || ("function" == typeof r && o.each(function(e) {
- var i = t.getRawValue(e)
- , n = t.getDataParams(e);
- o.setItemVisual(e, "symbolSize", r(i, n))
- }),
- o.each(function(t) {
- var e = o.getItemModel(t)
- , i = e.getShallow("symbol", !0)
- , n = e.getShallow("symbolSize", !0);
- null != i && o.setItemVisual(t, "symbol", i),
- null != n && o.setItemVisual(t, "symbolSize", n)
- }))
- })
- }
- , vM = function(t, e) {
- e.eachSeriesByType(t, function(t) {
- var e = t.getData()
- , i = t.coordinateSystem;
- if (i) {
- for (var n = [], o = i.dimensions, a = 0; a < o.length; a++)
- n.push(t.coordDimToDataDim(i.dimensions[a])[0]);
- 1 === n.length ? e.each(n[0], function(t, n) {
- e.setItemLayout(n, isNaN(t) ? [NaN, NaN] : i.dataToPoint(t))
- }) : 2 === n.length && e.each(n, function(t, n, o) {
- e.setItemLayout(o, isNaN(t) || isNaN(n) ? [NaN, NaN] : i.dataToPoint([t, n]))
- }, !0)
- }
- })
- }
- , yM = {
- average: function(t) {
- for (var e = 0, i = 0, n = 0; n < t.length; n++)
- isNaN(t[n]) || (e += t[n],
- i++);
- return 0 === i ? NaN : e / i
- },
- sum: function(t) {
- for (var e = 0, i = 0; i < t.length; i++)
- e += t[i] || 0;
- return e
- },
- max: function(t) {
- for (var e = -1 / 0, i = 0; i < t.length; i++)
- t[i] > e && (e = t[i]);
- return e
- },
- min: function(t) {
- for (var e = 1 / 0, i = 0; i < t.length; i++)
- t[i] < e && (e = t[i]);
- return e
- },
- nearest: function(t) {
- return t[0]
- }
- }
- , xM = function(t, e) {
- return Math.round(t.length / 2)
- }
- , _M = function(t) {
- this._axes = {},
- this._dimList = [],
- this.name = t || ""
- };
- _M.prototype = {
- constructor: _M,
- type: "cartesian",
- getAxis: function(t) {
- return this._axes[t]
- },
- getAxes: function() {
- return d(this._dimList, vs, this)
- },
- getAxesByScale: function(t) {
- return t = t.toLowerCase(),
- g(this.getAxes(), function(e) {
- return e.scale.type === t
- })
- },
- addAxis: function(t) {
- var e = t.dim;
- this._axes[e] = t,
- this._dimList.push(e)
- },
- dataToCoord: function(t) {
- return this._dataCoordConvert(t, "dataToCoord")
- },
- coordToData: function(t) {
- return this._dataCoordConvert(t, "coordToData")
- },
- _dataCoordConvert: function(t, e) {
- for (var i = this._dimList, n = t instanceof Array ? [] : {}, o = 0; o < i.length; o++) {
- var a = i[o]
- , r = this._axes[a];
- n[a] = r[e](t[a])
- }
- return n
- }
- },
- ys.prototype = {
- constructor: ys,
- type: "cartesian2d",
- dimensions: ["x", "y"],
- getBaseAxis: function() {
- return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAxis("x")
- },
- containPoint: function(t) {
- var e = this.getAxis("x")
- , i = this.getAxis("y");
- return e.contain(e.toLocalCoord(t[0])) && i.contain(i.toLocalCoord(t[1]))
- },
- containData: function(t) {
- return this.getAxis("x").containData(t[0]) && this.getAxis("y").containData(t[1])
- },
- dataToPoint: function(t, e) {
- var i = this.getAxis("x")
- , n = this.getAxis("y");
- return [i.toGlobalCoord(i.dataToCoord(t[0], e)), n.toGlobalCoord(n.dataToCoord(t[1], e))]
- },
- pointToData: function(t, e) {
- var i = this.getAxis("x")
- , n = this.getAxis("y");
- return [i.coordToData(i.toLocalCoord(t[0]), e), n.coordToData(n.toLocalCoord(t[1]), e)]
- },
- getOtherAxis: function(t) {
- return this.getAxis("x" === t.dim ? "y" : "x")
- }
- },
- l(ys, _M);
- var bM = function(t, e, i, n, o) {
- YS.call(this, t, e, i),
- this.type = n || "value",
- this.position = o || "bottom"
- };
- bM.prototype = {
- constructor: bM,
- index: 0,
- onZero: !1,
- model: null,
- isHorizontal: function() {
- var t = this.position;
- return "top" === t || "bottom" === t
- },
- getGlobalExtent: function(t) {
- var e = this.getExtent();
- return e[0] = this.toGlobalCoord(e[0]),
- e[1] = this.toGlobalCoord(e[1]),
- t && e[0] > e[1] && e.reverse(),
- e
- },
- getOtherAxis: function() {
- this.grid.getOtherAxis()
- },
- isLabelIgnored: function(t) {
- if ("category" === this.type) {
- var e = this.getLabelInterval();
- return "function" == typeof e && !e(t, this.scale.getLabel(t)) || t % (e + 1)
- }
- },
- pointToData: function(t, e) {
- return this.coordToData(this.toLocalCoord(t["x" === this.dim ? 0 : 1]), e)
- },
- toLocalCoord: null,
- toGlobalCoord: null
- },
- l(bM, YS);
- var wM = {
- show: !0,
- zlevel: 0,
- z: 0,
- inverse: !1,
- name: "",
- nameLocation: "end",
- nameRotate: null,
- nameTruncate: {
- maxWidth: null,
- ellipsis: "...",
- placeholder: "."
- },
- nameTextStyle: {},
- nameGap: 15,
- silent: !1,
- triggerEvent: !1,
- tooltip: {
- show: !1
- },
- axisPointer: {},
- axisLine: {
- show: !0,
- onZero: !0,
- onZeroAxisIndex: null,
- lineStyle: {
- color: "#333",
- width: 1,
- type: "solid"
- },
- symbol: ["none", "none"],
- symbolSize: [10, 15]
- },
- axisTick: {
- show: !0,
- inside: !1,
- length: 5,
- lineStyle: {
- width: 1
- }
- },
- axisLabel: {
- show: !0,
- inside: !1,
- rotate: 0,
- showMinLabel: null,
- showMaxLabel: null,
- margin: 8,
- fontSize: 12
- },
- splitLine: {
- show: !0,
- lineStyle: {
- color: ["#ccc"],
- width: 1,
- type: "solid"
- }
- },
- splitArea: {
- show: !1,
- areaStyle: {
- color: ["rgba(250,250,250,0.3)", "rgba(200,200,200,0.3)"]
- }
- }
- }
- , SM = {};
- SM.categoryAxis = i({
- boundaryGap: !0,
- splitLine: {
- show: !1
- },
- axisTick: {
- alignWithLabel: !1,
- interval: "auto"
- },
- axisLabel: {
- interval: "auto"
- }
- }, wM),
- SM.valueAxis = i({
- boundaryGap: [0, 0],
- splitNumber: 5
- }, wM),
- SM.timeAxis = a({
- scale: !0,
- min: "dataMin",
- max: "dataMax"
- }, SM.valueAxis),
- SM.logAxis = a({
- scale: !0,
- logBase: 10
- }, SM.valueAxis);
- var MM = ["value", "category", "time", "log"]
- , IM = function(t, e, o, a) {
- c(MM, function(r) {
- e.extend({
- type: t + "Axis." + r,
- mergeDefaultAndTheme: function(e, n) {
- var a = this.layoutMode
- , s = a ? Qo(e) : {};
- i(e, n.getTheme().get(r + "Axis")),
- i(e, this.getDefaultOption()),
- e.type = o(t, e),
- a && Jo(e, s, a)
- },
- defaultOption: n([{}, SM[r + "Axis"], a], !0)
- })
- }),
- qb.registerSubTypeDefaulter(t + "Axis", m(o, t))
- }
- , TM = qb.extend({
- type: "cartesian2dAxis",
- axis: null,
- init: function() {
- TM.superApply(this, "init", arguments),
- this.resetRange()
- },
- mergeOption: function() {
- TM.superApply(this, "mergeOption", arguments),
- this.resetRange()
- },
- restoreData: function() {
- TM.superApply(this, "restoreData", arguments),
- this.resetRange()
- },
- getCoordSysModel: function() {
- return this.ecModel.queryComponents({
- mainType: "grid",
- index: this.option.gridIndex,
- id: this.option.gridId
- })[0]
- }
- });
- i(TM.prototype, VS);
- var AM = {
- offset: 0
- };
- IM("x", TM, xs, AM),
- IM("y", TM, xs, AM),
- qb.extend({
- type: "grid",
- dependencies: ["xAxis", "yAxis"],
- layoutMode: "box",
- coordinateSystem: null,
- defaultOption: {
- show: !1,
- zlevel: 0,
- z: 0,
- left: "10%",
- top: 60,
- right: "10%",
- bottom: 60,
- containLabel: !1,
- backgroundColor: "rgba(0,0,0,0)",
- borderWidth: 1,
- borderColor: "#ccc"
- }
- });
- var CM = c
- , DM = function(t) {
- var e = t.scale.getExtent()
- , i = e[0]
- , n = e[1];
- return !(i > 0 && n > 0 || i < 0 && n < 0)
- }
- , LM = Or
- , kM = Ss.prototype;
- kM.type = "grid",
- kM.axisPointerEnabled = !0,
- kM.getRect = function() {
- return this._rect
- }
- ,
- kM.update = function(t, e) {
- var i = this._axesMap;
- this._updateScale(t, this.model),
- CM(i.x, function(t) {
- LM(t.scale, t.model)
- }),
- CM(i.y, function(t) {
- LM(t.scale, t.model)
- }),
- CM(i.x, function(t) {
- Ms(i, "y", t)
- }),
- CM(i.y, function(t) {
- Ms(i, "x", t)
- }),
- this.resize(this.model, e)
- }
- ,
- kM.resize = function(t, e, i) {
- function n() {
- CM(a, function(t) {
- var e = t.isHorizontal()
- , i = e ? [0, o.width] : [0, o.height]
- , n = t.inverse ? 1 : 0;
- t.setExtent(i[n], i[1 - n]),
- Ts(t, e ? o.x : o.y)
- })
- }
- var o = Yo(t.getBoxLayoutParams(), {
- width: e.getWidth(),
- height: e.getHeight()
- });
- this._rect = o;
- var a = this._axesList;
- n(),
- !i && t.get("containLabel") && (CM(a, function(t) {
- if (!t.model.get("axisLabel.inside")) {
- var e = ws(t);
- if (e) {
- var i = t.isHorizontal() ? "height" : "width"
- , n = t.model.get("axisLabel.margin");
- o[i] -= e[i] + n,
- "top" === t.position ? o.y += e.height + n : "left" === t.position && (o.x += e.width + n)
- }
- }
- }),
- n())
- }
- ,
- kM.getAxis = function(t, e) {
- var i = this._axesMap[t];
- if (null != i) {
- if (null == e)
- for (var n in i)
- if (i.hasOwnProperty(n))
- return i[n];
- return i[e]
- }
- }
- ,
- kM.getAxes = function() {
- return this._axesList.slice()
- }
- ,
- kM.getCartesian = function(t, e) {
- if (null != t && null != e) {
- var i = "x" + t + "y" + e;
- return this._coordsMap[i]
- }
- _(t) && (e = t.yAxisIndex,
- t = t.xAxisIndex);
- for (var n = 0, o = this._coordsList; n < o.length; n++)
- if (o[n].getAxis("x").index === t || o[n].getAxis("y").index === e)
- return o[n]
- }
- ,
- kM.getCartesians = function() {
- return this._coordsList.slice()
- }
- ,
- kM.convertToPixel = function(t, e, i) {
- var n = this._findConvertTarget(t, e);
- return n.cartesian ? n.cartesian.dataToPoint(i) : n.axis ? n.axis.toGlobalCoord(n.axis.dataToCoord(i)) : null
- }
- ,
- kM.convertFromPixel = function(t, e, i) {
- var n = this._findConvertTarget(t, e);
- return n.cartesian ? n.cartesian.pointToData(i) : n.axis ? n.axis.coordToData(n.axis.toLocalCoord(i)) : null
- }
- ,
- kM._findConvertTarget = function(t, e) {
- var i, n, o = e.seriesModel, a = e.xAxisModel || o && o.getReferringComponents("xAxis")[0], r = e.yAxisModel || o && o.getReferringComponents("yAxis")[0], l = e.gridModel, h = this._coordsList;
- return o ? s(h, i = o.coordinateSystem) < 0 && (i = null) : a && r ? i = this.getCartesian(a.componentIndex, r.componentIndex) : a ? n = this.getAxis("x", a.componentIndex) : r ? n = this.getAxis("y", r.componentIndex) : l && l.coordinateSystem === this && (i = this._coordsList[0]),
- {
- cartesian: i,
- axis: n
- }
- }
- ,
- kM.containPoint = function(t) {
- var e = this._coordsList[0];
- if (e)
- return e.containPoint(t)
- }
- ,
- kM._initCartesian = function(t, e, i) {
- function n(i) {
- return function(n, s) {
- if (_s(n, t, e)) {
- var l = n.get("position");
- "x" === i ? "top" !== l && "bottom" !== l && o[l = "bottom"] && (l = "top" === l ? "bottom" : "top") : "left" !== l && "right" !== l && o[l = "left"] && (l = "left" === l ? "right" : "left"),
- o[l] = !0;
- var h = new bM(i,zr(n),[0, 0],n.get("type"),l)
- , u = "category" === h.type;
- h.onBand = u && n.get("boundaryGap"),
- h.inverse = n.get("inverse"),
- h.onZero = n.get("axisLine.onZero"),
- h.onZeroAxisIndex = n.get("axisLine.onZeroAxisIndex"),
- n.axis = h,
- h.model = n,
- h.grid = this,
- h.index = s,
- this._axesList.push(h),
- a[i][s] = h,
- r[i]++
- }
- }
- }
- var o = {
- left: !1,
- right: !1,
- top: !1,
- bottom: !1
- }
- , a = {
- x: {},
- y: {}
- }
- , r = {
- x: 0,
- y: 0
- };
- if (e.eachComponent("xAxis", n("x"), this),
- e.eachComponent("yAxis", n("y"), this),
- !r.x || !r.y)
- return this._axesMap = {},
- void (this._axesList = []);
- this._axesMap = a,
- CM(a.x, function(e, i) {
- CM(a.y, function(n, o) {
- var a = "x" + i + "y" + o
- , r = new ys(a);
- r.grid = this,
- r.model = t,
- this._coordsMap[a] = r,
- this._coordsList.push(r),
- r.addAxis(e),
- r.addAxis(n)
- }, this)
- }, this)
- }
- ,
- kM._updateScale = function(t, e) {
- function i(t, e, i) {
- CM(i.coordDimToDataDim(e.dim), function(i) {
- e.scale.unionExtentFromData(t, i)
- })
- }
- c(this._axesList, function(t) {
- t.scale.setExtent(1 / 0, -1 / 0)
- }),
- t.eachSeries(function(n) {
- if (Cs(n)) {
- var o = As(n)
- , a = o[0]
- , r = o[1];
- if (!_s(a, e, t) || !_s(r, e, t))
- return;
- var s = this.getCartesian(a.componentIndex, r.componentIndex)
- , l = n.getData()
- , h = s.getAxis("x")
- , u = s.getAxis("y");
- "list" === l.type && (i(l, h, n),
- i(l, u, n))
- }
- }, this)
- }
- ,
- kM.getTooltipAxes = function(t) {
- var e = []
- , i = [];
- return CM(this.getCartesians(), function(n) {
- var o = null != t && "auto" !== t ? n.getAxis(t) : n.getBaseAxis()
- , a = n.getOtherAxis(o);
- s(e, o) < 0 && e.push(o),
- s(i, a) < 0 && i.push(a)
- }),
- {
- baseAxes: e,
- otherAxes: i
- }
- }
- ;
- var PM = ["xAxis", "yAxis"];
- Ss.create = function(t, e) {
- var i = [];
- return t.eachComponent("grid", function(n, o) {
- var a = new Ss(n,t,e);
- a.name = "grid_" + o,
- a.resize(n, e, !0),
- n.coordinateSystem = a,
- i.push(a)
- }),
- t.eachSeries(function(t) {
- if (Cs(t)) {
- var e = As(t)
- , i = e[0]
- , n = e[1]
- , o = i.getCoordSysModel()
- , a = o.coordinateSystem;
- t.coordinateSystem = a.getCartesian(i.componentIndex, n.componentIndex)
- }
- }),
- i
- }
- ,
- Ss.dimensions = Ss.prototype.dimensions = ys.prototype.dimensions,
- ha.register("cartesian2d", Ss);
- var OM = Math.PI
- , zM = function(t, e) {
- this.opt = e,
- this.axisModel = t,
- a(e, {
- labelOffset: 0,
- nameDirection: 1,
- tickDirection: 1,
- labelDirection: 1,
- silent: !0
- }),
- this.group = new $y;
- var i = new $y({
- position: e.position.slice(),
- rotation: e.rotation
- });
- i.updateTransform(),
- this._transform = i.transform,
- this._dumbGroup = i
- };
- zM.prototype = {
- constructor: zM,
- hasBuilder: function(t) {
- return !!NM[t]
- },
- add: function(t) {
- NM[t].call(this)
- },
- getGroup: function() {
- return this.group
- }
- };
- var NM = {
- axisLine: function() {
- var t = this.opt
- , e = this.axisModel;
- if (e.get("axisLine.show")) {
- var i = this.axisModel.axis.getExtent()
- , n = this._transform
- , a = [i[0], 0]
- , r = [i[1], 0];
- n && (Y(a, a, n),
- Y(r, r, n));
- var s = o({
- lineCap: "round"
- }, e.getModel("axisLine.lineStyle").getLineStyle());
- this.group.add(new mb(Xn({
- anid: "line",
- shape: {
- x1: a[0],
- y1: a[1],
- x2: r[0],
- y2: r[1]
- },
- style: s,
- strokeContainThreshold: t.strokeContainThreshold || 5,
- silent: !0,
- z2: 1
- })));
- var l = e.get("axisLine.symbol")
- , h = e.get("axisLine.symbolSize");
- if (null != l) {
- "string" == typeof l && (l = [l, l]),
- "string" != typeof h && "number" != typeof h || (h = [h, h]);
- var u = h[0]
- , d = h[1];
- c([[t.rotation + Math.PI / 2, a], [t.rotation - Math.PI / 2, r]], function(t, e) {
- if ("none" !== l[e] && null != l[e]) {
- var i = Gr(l[e], -u / 2, -d / 2, u, d, s.stroke, !0);
- i.attr({
- rotation: t[0],
- position: t[1],
- silent: !0
- }),
- this.group.add(i)
- }
- }, this)
- }
- }
- },
- axisTickLabel: function() {
- var t = this.axisModel
- , e = this.opt
- , i = Es(this, t, e);
- Ps(t, Rs(this, t, e), i)
- },
- axisName: function() {
- var t = this.opt
- , e = this.axisModel
- , i = M(t.axisName, e.get("name"));
- if (i) {
- var n, a = e.get("nameLocation"), r = t.nameDirection, s = e.getModel("nameTextStyle"), l = e.get("nameGap") || 0, h = this.axisModel.axis.getExtent(), u = h[0] > h[1] ? -1 : 1, c = ["start" === a ? h[0] - u * l : "end" === a ? h[1] + u * l : (h[0] + h[1]) / 2, Ns(a) ? t.labelOffset + r * l : 0], d = e.get("nameRotate");
- null != d && (d = d * OM / 180);
- var f;
- Ns(a) ? n = EM(t.rotation, null != d ? d : t.rotation, r) : (n = Ls(t, a, d || 0, h),
- null != (f = t.axisNameAvailableWidth) && (f = Math.abs(f / Math.sin(n.rotation)),
- !isFinite(f) && (f = null)));
- var g = s.getFont()
- , p = e.get("nameTruncate", !0) || {}
- , m = p.ellipsis
- , v = M(t.nameTruncateMaxWidth, p.maxWidth, f)
- , y = null != m && null != v ? Yx(i, v, g, m, {
- minChar: 2,
- placeholder: p.placeholder
- }) : i
- , x = e.get("tooltip", !0)
- , _ = e.mainType
- , b = {
- componentType: _,
- name: i,
- $vars: ["name"]
- };
- b[_ + "Index"] = e.componentIndex;
- var w = new ab({
- anid: "name",
- __fullText: i,
- __truncatedText: y,
- position: c,
- rotation: n.rotation,
- silent: ks(e),
- z2: 1,
- tooltip: x && x.show ? o({
- content: i,
- formatter: function() {
- return i
- },
- formatterParams: b
- }, x) : null
- });
- uo(w.style, s, {
- text: y,
- textFont: g,
- textFill: s.getTextColor() || e.get("axisLine.lineStyle.color"),
- textAlign: n.textAlign,
- textVerticalAlign: n.textVerticalAlign
- }),
- e.get("triggerEvent") && (w.eventData = Ds(e),
- w.eventData.targetType = "axisName",
- w.eventData.name = i),
- this._dumbGroup.add(w),
- w.updateTransform(),
- this.group.add(w),
- w.decomposeTransform()
- }
- }
- }
- , EM = zM.innerTextLayout = function(t, e, i) {
- var n, o, a = Ci(e - t);
- return Di(a) ? (o = i > 0 ? "top" : "bottom",
- n = "center") : Di(a - OM) ? (o = i > 0 ? "bottom" : "top",
- n = "center") : (o = "middle",
- n = a > 0 && a < OM ? i > 0 ? "right" : "left" : i > 0 ? "left" : "right"),
- {
- rotation: a,
- textAlign: n,
- textVerticalAlign: o
- }
- }
- , RM = zM.ifIgnoreOnTick = function(t, e, i, n, o, a) {
- if (0 === e && o || e === n - 1 && a)
- return !1;
- var r, s = t.scale;
- return "ordinal" === s.type && ("function" == typeof i ? (r = s.getTicks()[e],
- !i(r, s.getLabel(r))) : e % (i + 1))
- }
- , VM = zM.getInterval = function(t, e) {
- var i = t.get("interval");
- return null != i && "auto" != i || (i = e),
- i
- }
- , BM = c
- , GM = m
- , WM = sr({
- type: "axis",
- _axisPointer: null,
- axisPointerClass: null,
- render: function(t, e, i, n) {
- this.axisPointerClass && Zs(t),
- WM.superApply(this, "render", arguments),
- Ys(this, t, 0, i, 0, !0)
- },
- updateAxisPointer: function(t, e, i, n, o) {
- Ys(this, t, 0, i, 0, !1)
- },
- remove: function(t, e) {
- var i = this._axisPointer;
- i && i.remove(e),
- WM.superApply(this, "remove", arguments)
- },
- dispose: function(t, e) {
- $s(this, e),
- WM.superApply(this, "dispose", arguments)
- }
- })
- , HM = [];
- WM.registerAxisPointerClass = function(t, e) {
- HM[t] = e
- }
- ,
- WM.getAxisPointerClass = function(t) {
- return t && HM[t]
- }
- ;
- var FM = zM.ifIgnoreOnTick
- , ZM = zM.getInterval
- , UM = ["axisLine", "axisTickLabel", "axisName"]
- , jM = ["splitArea", "splitLine"]
- , XM = WM.extend({
- type: "cartesianAxis",
- axisPointerClass: "CartesianAxisPointer",
- render: function(t, e, i, n) {
- this.group.removeAll();
- var o = this._axisGroup;
- if (this._axisGroup = new $y,
- this.group.add(this._axisGroup),
- t.get("show")) {
- var a = t.getCoordSysModel()
- , r = Ks(a, t)
- , s = new zM(t,r);
- c(UM, s.add, s),
- this._axisGroup.add(s.getGroup()),
- c(jM, function(e) {
- t.get(e + ".show") && this["_" + e](t, a, r.labelInterval)
- }, this),
- Io(o, this._axisGroup, t),
- XM.superCall(this, "render", t, e, i, n)
- }
- },
- _splitLine: function(t, e, i) {
- var n = t.axis;
- if (!n.scale.isBlank()) {
- var o = t.getModel("splitLine")
- , r = o.getModel("lineStyle")
- , s = r.get("color")
- , l = ZM(o, i);
- s = v(s) ? s : [s];
- for (var h = e.coordinateSystem.getRect(), u = n.isHorizontal(), c = 0, d = n.getTicksCoords(), f = n.scale.getTicks(), g = t.get("axisLabel.showMinLabel"), p = t.get("axisLabel.showMaxLabel"), m = [], y = [], x = r.getLineStyle(), _ = 0; _ < d.length; _++)
- if (!FM(n, _, l, d.length, g, p)) {
- var b = n.toGlobalCoord(d[_]);
- u ? (m[0] = b,
- m[1] = h.y,
- y[0] = b,
- y[1] = h.y + h.height) : (m[0] = h.x,
- m[1] = b,
- y[0] = h.x + h.width,
- y[1] = b);
- var w = c++ % s.length;
- this._axisGroup.add(new mb(Xn({
- anid: "line_" + f[_],
- shape: {
- x1: m[0],
- y1: m[1],
- x2: y[0],
- y2: y[1]
- },
- style: a({
- stroke: s[w]
- }, x),
- silent: !0
- })))
- }
- }
- },
- _splitArea: function(t, e, i) {
- var n = t.axis;
- if (!n.scale.isBlank()) {
- var o = t.getModel("splitArea")
- , r = o.getModel("areaStyle")
- , s = r.get("color")
- , l = e.coordinateSystem.getRect()
- , h = n.getTicksCoords()
- , u = n.scale.getTicks()
- , c = n.toGlobalCoord(h[0])
- , d = n.toGlobalCoord(h[0])
- , f = 0
- , g = ZM(o, i)
- , p = r.getAreaStyle();
- s = v(s) ? s : [s];
- for (var m = t.get("axisLabel.showMinLabel"), y = t.get("axisLabel.showMaxLabel"), x = 1; x < h.length; x++)
- if (!FM(n, x, g, h.length, m, y)) {
- var _, b, w, S, M = n.toGlobalCoord(h[x]);
- n.isHorizontal() ? (_ = c,
- b = l.y,
- w = M - _,
- S = l.height) : (_ = l.x,
- b = d,
- w = l.width,
- S = M - b);
- var I = f++ % s.length;
- this._axisGroup.add(new pb({
- anid: "area_" + u[x],
- shape: {
- x: _,
- y: b,
- width: w,
- height: S
- },
- style: a({
- fill: s[I]
- }, p),
- silent: !0
- })),
- c = _ + w,
- d = b + S
- }
- }
- }
- });
- XM.extend({
- type: "xAxis"
- }),
- XM.extend({
- type: "yAxis"
- }),
- sr({
- type: "grid",
- render: function(t, e) {
- this.group.removeAll(),
- t.get("show") && this.group.add(new pb({
- shape: t.coordinateSystem.getRect(),
- style: a({
- fill: t.get("backgroundColor")
- }, t.getItemStyle()),
- silent: !0,
- z2: -1
- }))
- }
- }),
- Qa(function(t) {
- t.xAxis && t.yAxis && !t.grid && (t.grid = {})
- }),
- or(m(mM, "line", "circle", "line")),
- nr(m(vM, "line")),
- tr(Ew.PROCESSOR.STATISTIC, m(function(t, e, i) {
- e.eachSeriesByType(t, function(t) {
- var e = t.getData()
- , i = t.get("sampling")
- , n = t.coordinateSystem;
- if ("cartesian2d" === n.type && i) {
- var o = n.getBaseAxis()
- , a = n.getOtherAxis(o)
- , r = o.getExtent()
- , s = r[1] - r[0]
- , l = Math.round(e.count() / s);
- if (l > 1) {
- var h;
- "string" == typeof i ? h = yM[i] : "function" == typeof i && (h = i),
- h && (e = e.downSample(a.dim, 1 / l, h, xM),
- t.setData(e))
- }
- }
- }, this)
- }, "line"));
- var qM = "__ec_stack_";
- il.getLayoutOnAxis = function(t, e) {
- var i = []
- , n = t.axis;
- if ("category" === n.type) {
- for (var o = n.getBandWidth(), r = 0; r < t.count; r++)
- i.push(a({
- bandWidth: o,
- axisKey: "axis0",
- stackId: qM + r
- }, t));
- for (var s = el(i), l = [], r = 0; r < t.count; r++) {
- var h = s.axis0[qM + r];
- h.offsetCenter = h.offset + h.width / 2,
- l.push(h)
- }
- return l
- }
- }
- ;
- var YM = bw.extend({
- type: "series.__base_bar__",
- getInitialData: function(t, e) {
- return br(t.data, this, e)
- },
- getMarkerPosition: function(t) {
- var e = this.coordinateSystem;
- if (e) {
- var i = e.dataToPoint(t, !0)
- , n = this.getData()
- , o = n.getLayout("offset")
- , a = n.getLayout("size");
- return i[e.getBaseAxis().isHorizontal() ? 0 : 1] += o + a / 2,
- i
- }
- return [NaN, NaN]
- },
- defaultOption: {
- zlevel: 0,
- z: 2,
- coordinateSystem: "cartesian2d",
- legendHoverLink: !0,
- barMinHeight: 0,
- barMinAngle: 0,
- itemStyle: {}
- }
- });
- YM.extend({
- type: "series.bar",
- dependencies: ["grid", "polar"],
- brushSelector: "rect"
- });
- var $M = e_([["fill", "color"], ["stroke", "borderColor"], ["lineWidth", "borderWidth"], ["stroke", "barBorderColor"], ["lineWidth", "barBorderWidth"], ["opacity"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"]])
- , KM = {
- getBarItemStyle: function(t) {
- var e = $M(this, t);
- if (this.getBorderLineDash) {
- var i = this.getBorderLineDash();
- i && (e.lineDash = i)
- }
- return e
- }
- }
- , JM = ["itemStyle", "normal", "barBorderWidth"];
- o(Co.prototype, KM),
- hr({
- type: "bar",
- render: function(t, e, i) {
- var n = t.get("coordinateSystem");
- return "cartesian2d" !== n && "polar" !== n || this._render(t, e, i),
- this.group
- },
- dispose: z,
- _render: function(t, e, i) {
- var n, o = this.group, a = t.getData(), r = this._data, s = t.coordinateSystem, l = s.getBaseAxis();
- "cartesian2d" === s.type ? n = l.isHorizontal() : "polar" === s.type && (n = "angle" === l.dim);
- var h = t.isAnimationEnabled() ? t : null;
- a.diff(r).add(function(e) {
- if (a.hasValue(e)) {
- var i = a.getItemModel(e)
- , r = tI[s.type](a, e, i)
- , l = QM[s.type](a, e, i, r, n, h);
- a.setItemGraphicEl(e, l),
- o.add(l),
- sl(l, a, e, i, r, t, n, "polar" === s.type)
- }
- }).update(function(e, i) {
- var l = r.getItemGraphicEl(i);
- if (a.hasValue(e)) {
- var u = a.getItemModel(e)
- , c = tI[s.type](a, e, u);
- l ? _o(l, {
- shape: c
- }, h, e) : l = QM[s.type](a, e, u, c, n, h, !0),
- a.setItemGraphicEl(e, l),
- o.add(l),
- sl(l, a, e, u, c, t, n, "polar" === s.type)
- } else
- o.remove(l)
- }).remove(function(t) {
- var e = r.getItemGraphicEl(t);
- "cartesian2d" === s.type ? e && al(t, h, e) : e && rl(t, h, e)
- }).execute(),
- this._data = a
- },
- remove: function(t, e) {
- var i = this.group
- , n = this._data;
- t.get("animation") ? n && n.eachItemGraphicEl(function(e) {
- "sector" === e.type ? rl(e.dataIndex, t, e) : al(e.dataIndex, t, e)
- }) : i.removeAll()
- }
- });
- var QM = {
- cartesian2d: function(t, e, i, n, a, r, s) {
- var l = new pb({
- shape: o({}, n)
- });
- if (r) {
- var h = l.shape
- , u = a ? "height" : "width"
- , c = {};
- h[u] = 0,
- c[u] = n[u],
- Db[s ? "updateProps" : "initProps"](l, {
- shape: c
- }, r, e)
- }
- return l
- },
- polar: function(t, e, i, n, a, r, s) {
- var l = new hb({
- shape: o({}, n)
- });
- if (r) {
- var h = l.shape
- , u = a ? "r" : "endAngle"
- , c = {};
- h[u] = a ? 0 : n.startAngle,
- c[u] = n[u],
- Db[s ? "updateProps" : "initProps"](l, {
- shape: c
- }, r, e)
- }
- return l
- }
- }
- , tI = {
- cartesian2d: function(t, e, i) {
- var n = t.getItemLayout(e)
- , o = ll(i, n)
- , a = n.width > 0 ? 1 : -1
- , r = n.height > 0 ? 1 : -1;
- return {
- x: n.x + a * o / 2,
- y: n.y + r * o / 2,
- width: n.width - a * o,
- height: n.height - r * o
- }
- },
- polar: function(t, e, i) {
- var n = t.getItemLayout(e);
- return {
- cx: n.cx,
- cy: n.cy,
- r0: n.r0,
- r: n.r,
- startAngle: n.startAngle,
- endAngle: n.endAngle
- }
- }
- };
- nr(m(il, "bar")),
- or(function(t) {
- t.eachSeriesByType("bar", function(t) {
- t.getData().setVisual("legendSymbol", "roundRect")
- })
- });
- var eI = {
- updateSelectedMap: function(t) {
- this._targetList = t.slice(),
- this._selectTargetMap = f(t || [], function(t, e) {
- return t.set(e.name, e),
- t
- }, O())
- },
- select: function(t, e) {
- var i = null != e ? this._targetList[e] : this._selectTargetMap.get(t);
- "single" === this.get("selectedMode") && this._selectTargetMap.each(function(t) {
- t.selected = !1
- }),
- i && (i.selected = !0)
- },
- unSelect: function(t, e) {
- var i = null != e ? this._targetList[e] : this._selectTargetMap.get(t);
- i && (i.selected = !1)
- },
- toggleSelected: function(t, e) {
- var i = null != e ? this._targetList[e] : this._selectTargetMap.get(t);
- if (null != i)
- return this[i.selected ? "unSelect" : "select"](t, e),
- i.selected
- },
- isSelected: function(t, e) {
- var i = null != e ? this._targetList[e] : this._selectTargetMap.get(t);
- return i && i.selected
- }
- }
- , iI = lr({
- type: "series.pie",
- init: function(t) {
- iI.superApply(this, "init", arguments),
- this.legendDataProvider = function() {
- return this.getRawData()
- }
- ,
- this.updateSelectedMap(t.data),
- this._defaultLabelLine(t)
- },
- mergeOption: function(t) {
- iI.superCall(this, "mergeOption", t),
- this.updateSelectedMap(this.option.data)
- },
- getInitialData: function(t, e) {
- var i = vr(["value"], t.data)
- , n = new lS(i,this);
- return n.initData(t.data),
- n
- },
- getDataParams: function(t) {
- var e = this.getData()
- , i = iI.superCall(this, "getDataParams", t)
- , n = [];
- return e.each("value", function(t) {
- n.push(t)
- }),
- i.percent = Ai(n, t, e.hostModel.get("percentPrecision")),
- i.$vars.push("percent"),
- i
- },
- _defaultLabelLine: function(t) {
- Po(t.labelLine, ["show"]);
- var e = t.labelLine.normal
- , i = t.labelLine.emphasis;
- e.show = e.show && t.label.normal.show,
- i.show = i.show && t.label.emphasis.show
- },
- defaultOption: {
- zlevel: 0,
- z: 2,
- legendHoverLink: !0,
- hoverAnimation: !0,
- center: ["50%", "50%"],
- radius: [0, "75%"],
- clockwise: !0,
- startAngle: 90,
- minAngle: 0,
- selectedOffset: 10,
- hoverOffset: 10,
- avoidLabelOverlap: !0,
- percentPrecision: 2,
- stillShowZeroSum: !0,
- label: {
- normal: {
- rotate: !1,
- show: !0,
- position: "outer"
- },
- emphasis: {}
- },
- labelLine: {
- normal: {
- show: !0,
- length: 15,
- length2: 15,
- smooth: !1,
- lineStyle: {
- width: 1,
- type: "solid"
- }
- }
- },
- itemStyle: {
- normal: {
- borderWidth: 1
- },
- emphasis: {}
- },
- animationType: "expansion",
- animationEasing: "cubicOut",
- data: []
- }
- });
- h(iI, eI);
- var nI = cl.prototype;
- nI.updateData = function(t, e, i) {
- function n() {
- s.stopAnimation(!0),
- s.animateTo({
- shape: {
- r: u.r + l.get("hoverOffset")
- }
- }, 300, "elasticOut")
- }
- function r() {
- s.stopAnimation(!0),
- s.animateTo({
- shape: {
- r: u.r
- }
- }, 300, "elasticOut")
- }
- var s = this.childAt(0)
- , l = t.hostModel
- , h = t.getItemModel(e)
- , u = t.getItemLayout(e)
- , c = o({}, u);
- c.label = null,
- i ? (s.setShape(c),
- "scale" === l.getShallow("animationType") ? (s.shape.r = u.r0,
- bo(s, {
- shape: {
- r: u.r
- }
- }, l, e)) : (s.shape.endAngle = u.startAngle,
- _o(s, {
- shape: {
- endAngle: u.endAngle
- }
- }, l, e))) : _o(s, {
- shape: c
- }, l, e);
- var d = h.getModel("itemStyle")
- , f = t.getItemVisual(e, "color");
- s.useStyle(a({
- lineJoin: "bevel",
- fill: f
- }, d.getModel("normal").getItemStyle())),
- s.hoverStyle = d.getModel("emphasis").getItemStyle();
- var g = h.getShallow("cursor");
- g && s.attr("cursor", g),
- ul(this, t.getItemLayout(e), h.get("selected"), l.get("selectedOffset"), l.get("animation")),
- s.off("mouseover").off("mouseout").off("emphasis").off("normal"),
- h.get("hoverAnimation") && l.isAnimationEnabled() && s.on("mouseover", n).on("mouseout", r).on("emphasis", n).on("normal", r),
- this._updateLabel(t, e),
- lo(this)
- }
- ,
- nI._updateLabel = function(t, e) {
- var i = this.childAt(1)
- , n = this.childAt(2)
- , o = t.hostModel
- , a = t.getItemModel(e)
- , r = t.getItemLayout(e).label
- , s = t.getItemVisual(e, "color");
- _o(i, {
- shape: {
- points: r.linePoints || [[r.x, r.y], [r.x, r.y], [r.x, r.y]]
- }
- }, o, e),
- _o(n, {
- style: {
- x: r.x,
- y: r.y
- }
- }, o, e),
- n.attr({
- rotation: r.rotation,
- origin: [r.x, r.y],
- z2: 10
- });
- var l = a.getModel("label.normal")
- , h = a.getModel("label.emphasis")
- , u = a.getModel("labelLine.normal")
- , c = a.getModel("labelLine.emphasis")
- , s = t.getItemVisual(e, "color");
- ho(n.style, n.hoverStyle = {}, l, h, {
- labelFetcher: t.hostModel,
- labelDataIndex: e,
- defaultText: t.getName(e),
- autoColor: s,
- useInsideStyle: !!r.inside
- }, {
- textAlign: r.textAlign,
- textVerticalAlign: r.verticalAlign,
- opacity: t.getItemVisual(e, "opacity")
- }),
- n.ignore = n.normalIgnore = !l.get("show"),
- n.hoverIgnore = !h.get("show"),
- i.ignore = i.normalIgnore = !u.get("show"),
- i.hoverIgnore = !c.get("show"),
- i.setStyle({
- stroke: s,
- opacity: t.getItemVisual(e, "opacity")
- }),
- i.setStyle(u.getModel("lineStyle").getLineStyle()),
- i.hoverStyle = c.getModel("lineStyle").getLineStyle();
- var d = u.get("smooth");
- d && !0 === d && (d = .4),
- i.setShape({
- smooth: d
- })
- }
- ,
- l(cl, $y);
- Ia.extend({
- type: "pie",
- init: function() {
- var t = new $y;
- this._sectorGroup = t
- },
- render: function(t, e, i, n) {
- if (!n || n.from !== this.uid) {
- var o = t.getData()
- , a = this._data
- , r = this.group
- , s = e.get("animation")
- , l = !a
- , h = t.get("animationType")
- , u = m(hl, this.uid, t, s, i)
- , c = t.get("selectedMode");
- if (o.diff(a).add(function(t) {
- var e = new cl(o,t);
- l && "scale" !== h && e.eachChild(function(t) {
- t.stopAnimation(!0)
- }),
- c && e.on("click", u),
- o.setItemGraphicEl(t, e),
- r.add(e)
- }).update(function(t, e) {
- var i = a.getItemGraphicEl(e);
- i.updateData(o, t),
- i.off("click"),
- c && i.on("click", u),
- r.add(i),
- o.setItemGraphicEl(t, i)
- }).remove(function(t) {
- var e = a.getItemGraphicEl(t);
- r.remove(e)
- }).execute(),
- s && l && o.count() > 0 && "scale" !== h) {
- var d = o.getItemLayout(0)
- , f = Math.max(i.getWidth(), i.getHeight()) / 2
- , g = p(r.removeClipPath, r);
- r.setClipPath(this._createClipPath(d.cx, d.cy, f, d.startAngle, d.clockwise, g, t))
- }
- this._data = o
- }
- },
- dispose: function() {},
- _createClipPath: function(t, e, i, n, o, a, r) {
- var s = new hb({
- shape: {
- cx: t,
- cy: e,
- r0: 0,
- r: i,
- startAngle: n,
- endAngle: n,
- clockwise: o
- }
- });
- return bo(s, {
- shape: {
- endAngle: n + (o ? 1 : -1) * Math.PI * 2
- }
- }, r, a),
- s
- },
- containPoint: function(t, e) {
- var i = e.getData().getItemLayout(0);
- if (i) {
- var n = t[0] - i.cx
- , o = t[1] - i.cy
- , a = Math.sqrt(n * n + o * o);
- return a <= i.r && a >= i.r0
- }
- }
- });
- var oI = function(t, e) {
- c(e, function(e) {
- e.update = "updateView",
- er(e, function(i, n) {
- var o = {};
- return n.eachComponent({
- mainType: "series",
- subType: t,
- query: i
- }, function(t) {
- t[e.method] && t[e.method](i.name, i.dataIndex);
- var n = t.getData();
- n.each(function(e) {
- var i = n.getName(e);
- o[i] = t.isSelected(i) || !1
- })
- }),
- {
- name: i.name,
- selected: o
- }
- })
- })
- }
- , aI = function(t, e) {
- var i = {};
- e.eachRawSeriesByType(t, function(t) {
- var n = t.getRawData()
- , o = {};
- if (!e.isSeriesFiltered(t)) {
- var a = t.getData();
- a.each(function(t) {
- var e = a.getRawIndex(t);
- o[e] = t
- }),
- n.each(function(e) {
- var r = o[e]
- , s = null != r && a.getItemVisual(r, "color", !0);
- if (s)
- n.setItemVisual(e, "color", s);
- else {
- var l = n.getItemModel(e).get("itemStyle.normal.color") || t.getColorFromPalette(n.getName(e), i);
- n.setItemVisual(e, "color", l),
- null != r && a.setItemVisual(r, "color", l)
- }
- })
- }
- })
- }
- , rI = function(t, e, i, n) {
- var o, a, r = t.getData(), s = [], l = !1;
- r.each(function(i) {
- var n, h, u, c, d = r.getItemLayout(i), f = r.getItemModel(i), g = f.getModel("label.normal"), p = g.get("position") || f.get("label.emphasis.position"), m = f.getModel("labelLine.normal"), v = m.get("length"), y = m.get("length2"), x = (d.startAngle + d.endAngle) / 2, _ = Math.cos(x), b = Math.sin(x);
- o = d.cx,
- a = d.cy;
- var w = "inside" === p || "inner" === p;
- if ("center" === p)
- n = d.cx,
- h = d.cy,
- c = "center";
- else {
- var S = (w ? (d.r + d.r0) / 2 * _ : d.r * _) + o
- , M = (w ? (d.r + d.r0) / 2 * b : d.r * b) + a;
- if (n = S + 3 * _,
- h = M + 3 * b,
- !w) {
- var I = S + _ * (v + e - d.r)
- , T = M + b * (v + e - d.r)
- , A = I + (_ < 0 ? -1 : 1) * y
- , C = T;
- n = A + (_ < 0 ? -5 : 5),
- h = C,
- u = [[S, M], [I, T], [A, C]]
- }
- c = w ? "center" : _ > 0 ? "left" : "right"
- }
- var D = g.getFont()
- , L = g.get("rotate") ? _ < 0 ? -x + Math.PI : -x : 0
- , k = ce(t.getFormattedLabel(i, "normal") || r.getName(i), D, c, "top");
- l = !!L,
- d.label = {
- x: n,
- y: h,
- position: p,
- height: k.height,
- len: v,
- len2: y,
- linePoints: u,
- textAlign: c,
- verticalAlign: "middle",
- rotation: L,
- inside: w
- },
- w || s.push(d.label)
- }),
- !l && t.get("avoidLabelOverlap") && fl(s, o, a, e, i, n)
- }
- , sI = 2 * Math.PI
- , lI = Math.PI / 180
- , hI = function(t, e) {
- var i = e.findComponents({
- mainType: "legend"
- });
- i && i.length && e.eachSeriesByType(t, function(t) {
- var e = t.getData();
- e.filterSelf(function(t) {
- for (var n = e.getName(t), o = 0; o < i.length; o++)
- if (!i[o].isSelected(n))
- return !1;
- return !0
- }, this)
- }, this)
- };
- oI("pie", [{
- type: "pieToggleSelect",
- event: "pieselectchanged",
- method: "toggleSelected"
- }, {
- type: "pieSelect",
- event: "pieselected",
- method: "select"
- }, {
- type: "pieUnSelect",
- event: "pieunselected",
- method: "unSelect"
- }]),
- or(m(aI, "pie")),
- nr(m(function(t, e, i, n) {
- e.eachSeriesByType(t, function(t) {
- var e = t.get("center")
- , n = t.get("radius");
- v(n) || (n = [0, n]),
- v(e) || (e = [e, e]);
- var o = i.getWidth()
- , a = i.getHeight()
- , r = Math.min(o, a)
- , s = bi(e[0], o)
- , l = bi(e[1], a)
- , h = bi(n[0], r / 2)
- , u = bi(n[1], r / 2)
- , c = t.getData()
- , d = -t.get("startAngle") * lI
- , f = t.get("minAngle") * lI
- , g = 0;
- c.each("value", function(t) {
- !isNaN(t) && g++
- });
- var p = c.getSum("value")
- , m = Math.PI / (p || g) * 2
- , y = t.get("clockwise")
- , x = t.get("roseType")
- , _ = t.get("stillShowZeroSum")
- , b = c.getDataExtent("value");
- b[0] = 0;
- var w = sI
- , S = 0
- , M = d
- , I = y ? 1 : -1;
- if (c.each("value", function(t, e) {
- var i;
- if (isNaN(t))
- c.setItemLayout(e, {
- angle: NaN,
- startAngle: NaN,
- endAngle: NaN,
- clockwise: y,
- cx: s,
- cy: l,
- r0: h,
- r: x ? NaN : u
- });
- else {
- (i = "area" !== x ? 0 === p && _ ? m : t * m : sI / g) < f ? (i = f,
- w -= f) : S += t;
- var n = M + I * i;
- c.setItemLayout(e, {
- angle: i,
- startAngle: M,
- endAngle: n,
- clockwise: y,
- cx: s,
- cy: l,
- r0: h,
- r: x ? _i(t, b, [h, u]) : u
- }),
- M = n
- }
- }, !0),
- w < sI && g)
- if (w <= .001) {
- var T = sI / g;
- c.each("value", function(t, e) {
- if (!isNaN(t)) {
- var i = c.getItemLayout(e);
- i.angle = T,
- i.startAngle = d + I * e * T,
- i.endAngle = d + I * (e + 1) * T
- }
- })
- } else
- m = w / S,
- M = d,
- c.each("value", function(t, e) {
- if (!isNaN(t)) {
- var i = c.getItemLayout(e)
- , n = i.angle === f ? f : t * m;
- i.startAngle = M,
- i.endAngle = M + I * n,
- M += I * n
- }
- });
- rI(t, u, o, a)
- })
- }, "pie")),
- tr(m(hI, "pie")),
- bw.extend({
- type: "series.scatter",
- dependencies: ["grid", "polar", "geo", "singleAxis", "calendar"],
- getInitialData: function(t, e) {
- return br(t.data, this, e)
- },
- brushSelector: "point",
- defaultOption: {
- coordinateSystem: "cartesian2d",
- zlevel: 0,
- z: 2,
- legendHoverLink: !0,
- hoverAnimation: !0,
- symbolSize: 10,
- large: !1,
- largeThreshold: 2e3,
- itemStyle: {
- normal: {
- opacity: .8
- }
- }
- }
- });
- var uI = Hn({
- shape: {
- points: null,
- sizes: null
- },
- symbolProxy: null,
- buildPath: function(t, e) {
- for (var i = e.points, n = e.sizes, o = this.symbolProxy, a = o.shape, r = 0; r < i.length; r++) {
- var s = i[r];
- if (!isNaN(s[0]) && !isNaN(s[1])) {
- var l = n[r];
- l[0] < 4 ? t.rect(s[0] - l[0] / 2, s[1] - l[1] / 2, l[0], l[1]) : (a.x = s[0] - l[0] / 2,
- a.y = s[1] - l[1] / 2,
- a.width = l[0],
- a.height = l[1],
- o.buildPath(t, a, !0))
- }
- }
- },
- findDataIndex: function(t, e) {
- for (var i = this.shape, n = i.points, o = i.sizes, a = n.length - 1; a >= 0; a--) {
- var r = n[a]
- , s = o[a]
- , l = r[0] - s[0] / 2
- , h = r[1] - s[1] / 2;
- if (t >= l && e >= h && t <= l + s[0] && e <= h + s[1])
- return a
- }
- return -1
- }
- })
- , cI = gl.prototype;
- cI.updateData = function(t) {
- this.group.removeAll();
- var e = this._symbolEl
- , i = t.hostModel;
- e.setShape({
- points: t.mapArray(t.getItemLayout),
- sizes: t.mapArray(function(e) {
- var i = t.getItemVisual(e, "symbolSize");
- return i instanceof Array || (i = [i, i]),
- i
- })
- }),
- e.symbolProxy = Gr(t.getVisual("symbol"), 0, 0, 0, 0),
- e.setColor = e.symbolProxy.setColor,
- e.useStyle(i.getModel("itemStyle.normal").getItemStyle(["color"]));
- var n = t.getVisual("color");
- n && e.setColor(n),
- e.seriesIndex = i.seriesIndex,
- e.on("mousemove", function(t) {
- e.dataIndex = null;
- var i = e.findDataIndex(t.offsetX, t.offsetY);
- i >= 0 && (e.dataIndex = i)
- }),
- this.group.add(e)
- }
- ,
- cI.updateLayout = function(t) {
- var e = t.getData();
- this._symbolEl.setShape({
- points: e.mapArray(e.getItemLayout)
- })
- }
- ,
- cI.remove = function() {
- this.group.removeAll()
- }
- ,
- hr({
- type: "scatter",
- init: function() {
- this._normalSymbolDraw = new Qr,
- this._largeSymbolDraw = new gl
- },
- render: function(t, e, i) {
- var n = t.getData()
- , o = this._largeSymbolDraw
- , a = this._normalSymbolDraw
- , r = this.group
- , s = t.get("large") && n.count() > t.get("largeThreshold") ? o : a;
- this._symbolDraw = s,
- s.updateData(n),
- r.add(s.group),
- r.remove(s === o ? a.group : o.group)
- },
- updateLayout: function(t) {
- this._symbolDraw.updateLayout(t)
- },
- remove: function(t, e) {
- this._symbolDraw && this._symbolDraw.remove(e, !0)
- },
- dispose: function() {}
- }),
- or(m(mM, "scatter", "circle", null)),
- nr(m(vM, "scatter")),
- l(pl, YS),
- ml.prototype.getIndicatorAxes = function() {
- return this._indicatorAxes
- }
- ,
- ml.prototype.dataToPoint = function(t, e) {
- var i = this._indicatorAxes[e];
- return this.coordToPoint(i.dataToCoord(t), e)
- }
- ,
- ml.prototype.coordToPoint = function(t, e) {
- var i = this._indicatorAxes[e].angle;
- return [this.cx + t * Math.cos(i), this.cy - t * Math.sin(i)]
- }
- ,
- ml.prototype.pointToData = function(t) {
- var e = t[0] - this.cx
- , i = t[1] - this.cy
- , n = Math.sqrt(e * e + i * i);
- e /= n,
- i /= n;
- for (var o, a = Math.atan2(-i, e), r = 1 / 0, s = -1, l = 0; l < this._indicatorAxes.length; l++) {
- var h = this._indicatorAxes[l]
- , u = Math.abs(a - h.angle);
- u < r && (o = h,
- s = l,
- r = u)
- }
- return [s, +(o && o.coodToData(n))]
- }
- ,
- ml.prototype.resize = function(t, e) {
- var i = t.get("center")
- , n = e.getWidth()
- , o = e.getHeight()
- , a = Math.min(n, o) / 2;
- this.cx = bi(i[0], n),
- this.cy = bi(i[1], o),
- this.startAngle = t.get("startAngle") * Math.PI / 180,
- this.r = bi(t.get("radius"), a),
- c(this._indicatorAxes, function(t, e) {
- t.setExtent(0, this.r);
- var i = this.startAngle + e * Math.PI * 2 / this._indicatorAxes.length;
- i = Math.atan2(Math.sin(i), Math.cos(i)),
- t.angle = i
- }, this)
- }
- ,
- ml.prototype.update = function(t, e) {
- function i(t) {
- var e = Math.pow(10, Math.floor(Math.log(t) / Math.LN10))
- , i = t / e;
- return 2 === i ? i = 5 : i *= 2,
- i * e
- }
- var n = this._indicatorAxes
- , o = this._model;
- c(n, function(t) {
- t.scale.setExtent(1 / 0, -1 / 0)
- }),
- t.eachSeriesByType("radar", function(e, i) {
- if ("radar" === e.get("coordinateSystem") && t.getComponent("radar", e.get("radarIndex")) === o) {
- var a = e.getData();
- c(n, function(t) {
- t.scale.unionExtentFromData(a, t.dim)
- })
- }
- }, this);
- var a = o.get("splitNumber");
- c(n, function(t, e) {
- var n = Pr(t.scale, t.model);
- Or(t.scale, t.model);
- var o = t.model
- , r = t.scale
- , s = o.getMin()
- , l = o.getMax()
- , h = r.getInterval();
- if (null != s && null != l)
- r.setExtent(+s, +l),
- r.setInterval((l - s) / a);
- else if (null != s) {
- var u;
- do {
- u = s + h * a,
- r.setExtent(+s, u),
- r.setInterval(h),
- h = i(h)
- } while (u < n[1] && isFinite(u) && isFinite(n[1]))
- } else if (null != l) {
- var c;
- do {
- c = l - h * a,
- r.setExtent(c, +l),
- r.setInterval(h),
- h = i(h)
- } while (c > n[0] && isFinite(c) && isFinite(n[0]))
- } else {
- r.getTicks().length - 1 > a && (h = i(h));
- var d = Math.round((n[0] + n[1]) / 2 / h) * h
- , f = Math.round(a / 2);
- r.setExtent(wi(d - f * h), wi(d + (a - f) * h)),
- r.setInterval(h)
- }
- })
- }
- ,
- ml.dimensions = [],
- ml.create = function(t, e) {
- var i = [];
- return t.eachComponent("radar", function(n) {
- var o = new ml(n,t,e);
- i.push(o),
- n.coordinateSystem = o
- }),
- t.eachSeriesByType("radar", function(t) {
- "radar" === t.get("coordinateSystem") && (t.coordinateSystem = i[t.get("radarIndex") || 0])
- }),
- i
- }
- ,
- ha.register("radar", ml);
- var dI = SM.valueAxis
- , fI = (rr({
- type: "radar",
- optionUpdated: function() {
- var t = this.get("boundaryGap")
- , n = this.get("splitNumber")
- , r = this.get("scale")
- , s = this.get("axisLine")
- , l = this.get("axisTick")
- , h = this.get("axisLabel")
- , u = this.get("name")
- , c = this.get("name.show")
- , f = this.get("name.formatter")
- , g = this.get("nameGap")
- , p = this.get("triggerEvent")
- , m = d(this.get("indicator") || [], function(d) {
- null != d.max && d.max > 0 && !d.min ? d.min = 0 : null != d.min && d.min < 0 && !d.max && (d.max = 0);
- var m = u;
- if (null != d.color && (m = a({
- color: d.color
- }, u)),
- d = i(e(d), {
- boundaryGap: t,
- splitNumber: n,
- scale: r,
- axisLine: s,
- axisTick: l,
- axisLabel: h,
- name: d.text,
- nameLocation: "end",
- nameGap: g,
- nameTextStyle: m,
- triggerEvent: p
- }, !1),
- c || (d.name = ""),
- "string" == typeof f) {
- var v = d.name;
- d.name = f.replace("{value}", null != v ? v : "")
- } else
- "function" == typeof f && (d.name = f(d.name, d));
- var y = o(new Co(d,null,this.ecModel), VS);
- return y.mainType = "radar",
- y.componentIndex = this.componentIndex,
- y
- }, this);
- this.getIndicatorModels = function() {
- return m
- }
- },
- defaultOption: {
- zlevel: 0,
- z: 0,
- center: ["50%", "50%"],
- radius: "75%",
- startAngle: 90,
- name: {
- show: !0
- },
- boundaryGap: [0, 0],
- splitNumber: 5,
- nameGap: 15,
- scale: !1,
- shape: "polygon",
- axisLine: i({
- lineStyle: {
- color: "#bbb"
- }
- }, dI.axisLine),
- axisLabel: vl(dI.axisLabel, !1),
- axisTick: vl(dI.axisTick, !1),
- splitLine: vl(dI.splitLine, !0),
- splitArea: vl(dI.splitArea, !0),
- indicator: []
- }
- }),
- ["axisLine", "axisTickLabel", "axisName"]);
- sr({
- type: "radar",
- render: function(t, e, i) {
- this.group.removeAll(),
- this._buildAxes(t),
- this._buildSplitLineAndArea(t)
- },
- _buildAxes: function(t) {
- var e = t.coordinateSystem;
- c(d(e.getIndicatorAxes(), function(t) {
- return new zM(t.model,{
- position: [e.cx, e.cy],
- rotation: t.angle,
- labelDirection: -1,
- tickDirection: -1,
- nameDirection: 1
- })
- }), function(t) {
- c(fI, t.add, t),
- this.group.add(t.getGroup())
- }, this)
- },
- _buildSplitLineAndArea: function(t) {
- function e(t, e, i) {
- var n = i % e.length;
- return t[n] = t[n] || [],
- n
- }
- var i = t.coordinateSystem
- , n = i.getIndicatorAxes();
- if (n.length) {
- var o = t.get("shape")
- , r = t.getModel("splitLine")
- , s = t.getModel("splitArea")
- , l = r.getModel("lineStyle")
- , h = s.getModel("areaStyle")
- , u = r.get("show")
- , f = s.get("show")
- , g = l.get("color")
- , p = h.get("color");
- g = v(g) ? g : [g],
- p = v(p) ? p : [p];
- var m = []
- , y = [];
- if ("circle" === o)
- for (var x = n[0].getTicksCoords(), _ = i.cx, b = i.cy, w = 0; w < x.length; w++)
- u && m[C = e(m, g, w)].push(new rb({
- shape: {
- cx: _,
- cy: b,
- r: x[w]
- }
- })),
- f && w < x.length - 1 && y[C = e(y, p, w)].push(new ub({
- shape: {
- cx: _,
- cy: b,
- r0: x[w],
- r: x[w + 1]
- }
- }));
- else
- for (var S, M = d(n, function(t, e) {
- var n = t.getTicksCoords();
- return S = null == S ? n.length - 1 : Math.min(n.length - 1, S),
- d(n, function(t) {
- return i.coordToPoint(t, e)
- })
- }), I = [], w = 0; w <= S; w++) {
- for (var T = [], A = 0; A < n.length; A++)
- T.push(M[A][w]);
- if (T[0] && T.push(T[0].slice()),
- u && m[C = e(m, g, w)].push(new gb({
- shape: {
- points: T
- }
- })),
- f && I) {
- var C = e(y, p, w - 1);
- y[C].push(new fb({
- shape: {
- points: T.concat(I)
- }
- }))
- }
- I = T.slice().reverse()
- }
- var D = l.getLineStyle()
- , L = h.getAreaStyle();
- c(y, function(t, e) {
- this.group.add(Cb(t, {
- style: a({
- stroke: "none",
- fill: p[e % p.length]
- }, L),
- silent: !0
- }))
- }, this),
- c(m, function(t, e) {
- this.group.add(Cb(t, {
- style: a({
- fill: "none",
- stroke: g[e % g.length]
- }, D),
- silent: !0
- }))
- }, this)
- }
- }
- });
- var gI = bw.extend({
- type: "series.radar",
- dependencies: ["radar"],
- init: function(t) {
- gI.superApply(this, "init", arguments),
- this.legendDataProvider = function() {
- return this.getRawData()
- }
- },
- getInitialData: function(t, e) {
- var i = t.data || []
- , n = vr([], i, {
- extraPrefix: "indicator_",
- extraFromZero: !0
- })
- , o = new lS(n,this);
- return o.initData(i),
- o
- },
- formatTooltip: function(t) {
- var e = this.getRawValue(t)
- , i = this.coordinateSystem.getIndicatorAxes()
- , n = this.getData().getName(t);
- return Vi("" === n ? this.name : n) + "<br/>" + d(i, function(t, i) {
- return Vi(t.name + " : " + e[i])
- }).join("<br />")
- },
- defaultOption: {
- zlevel: 0,
- z: 2,
- coordinateSystem: "radar",
- legendHoverLink: !0,
- radarIndex: 0,
- lineStyle: {
- normal: {
- width: 2,
- type: "solid"
- }
- },
- label: {
- normal: {
- position: "top"
- }
- },
- symbol: "emptyCircle",
- symbolSize: 4
- }
- });
- hr({
- type: "radar",
- render: function(t, i, n) {
- function o(t, e) {
- var i = t.getItemVisual(e, "symbol") || "circle"
- , n = t.getItemVisual(e, "color");
- if ("none" !== i) {
- var o = yl(t.getItemVisual(e, "symbolSize"))
- , a = Gr(i, -1, -1, 2, 2, n);
- return a.attr({
- style: {
- strokeNoScale: !0
- },
- z2: 100,
- scale: [o[0] / 2, o[1] / 2]
- }),
- a
- }
- }
- function r(e, i, n, a, r, s) {
- n.removeAll();
- for (var l = 0; l < i.length - 1; l++) {
- var h = o(a, r);
- h && (h.__dimIdx = l,
- e[l] ? (h.attr("position", e[l]),
- Db[s ? "initProps" : "updateProps"](h, {
- position: i[l]
- }, t, r)) : h.attr("position", i[l]),
- n.add(h))
- }
- }
- function s(t) {
- return d(t, function(t) {
- return [l.cx, l.cy]
- })
- }
- var l = t.coordinateSystem
- , h = this.group
- , u = t.getData()
- , c = this._data;
- u.diff(c).add(function(e) {
- var i = u.getItemLayout(e);
- if (i) {
- var n = new fb
- , o = new gb
- , a = {
- shape: {
- points: i
- }
- };
- n.shape.points = s(i),
- o.shape.points = s(i),
- bo(n, a, t, e),
- bo(o, a, t, e);
- var l = new $y
- , h = new $y;
- l.add(o),
- l.add(n),
- l.add(h),
- r(o.shape.points, i, h, u, e, !0),
- u.setItemGraphicEl(e, l)
- }
- }).update(function(e, i) {
- var n = c.getItemGraphicEl(i)
- , o = n.childAt(0)
- , a = n.childAt(1)
- , s = n.childAt(2)
- , l = {
- shape: {
- points: u.getItemLayout(e)
- }
- };
- l.shape.points && (r(o.shape.points, l.shape.points, s, u, e, !1),
- _o(o, l, t),
- _o(a, l, t),
- u.setItemGraphicEl(e, n))
- }).remove(function(t) {
- h.remove(c.getItemGraphicEl(t))
- }).execute(),
- u.eachItemGraphicEl(function(t, i) {
- function n() {
- l.attr("ignore", m)
- }
- function o() {
- l.attr("ignore", p)
- }
- var r = u.getItemModel(i)
- , s = t.childAt(0)
- , l = t.childAt(1)
- , c = t.childAt(2)
- , d = u.getItemVisual(i, "color");
- h.add(t),
- s.useStyle(a(r.getModel("lineStyle.normal").getLineStyle(), {
- fill: "none",
- stroke: d
- })),
- s.hoverStyle = r.getModel("lineStyle.emphasis").getLineStyle();
- var f = r.getModel("areaStyle.normal")
- , g = r.getModel("areaStyle.emphasis")
- , p = f.isEmpty() && f.parentModel.isEmpty()
- , m = g.isEmpty() && g.parentModel.isEmpty();
- m = m && p,
- l.ignore = p,
- l.useStyle(a(f.getAreaStyle(), {
- fill: d,
- opacity: .7
- })),
- l.hoverStyle = g.getAreaStyle();
- var v = r.getModel("itemStyle.normal").getItemStyle(["color"])
- , y = r.getModel("itemStyle.emphasis").getItemStyle()
- , x = r.getModel("label.normal")
- , _ = r.getModel("label.emphasis");
- c.eachChild(function(t) {
- t.setStyle(v),
- t.hoverStyle = e(y),
- ho(t.style, t.hoverStyle, x, _, {
- labelFetcher: u.hostModel,
- labelDataIndex: i,
- labelDimIndex: t.__dimIdx,
- defaultText: u.get(u.dimensions[t.__dimIdx], i),
- autoColor: d,
- isRectText: !0
- })
- }),
- t.off("mouseover").off("mouseout").off("normal").off("emphasis"),
- t.on("emphasis", n).on("mouseover", n).on("normal", o).on("mouseout", o),
- lo(t)
- }),
- this._data = u
- },
- remove: function() {
- this.group.removeAll(),
- this._data = null
- },
- dispose: function() {}
- });
- or(m(aI, "radar")),
- or(m(mM, "radar", "circle", null)),
- nr(function(t) {
- t.eachSeriesByType("radar", function(t) {
- var e = t.getData()
- , i = []
- , n = t.coordinateSystem;
- if (n) {
- for (var o = 0; o < n.getIndicatorAxes().length; o++) {
- var a = e.dimensions[o];
- e.each(a, function(t, e) {
- i[e] = i[e] || [],
- i[e][o] = n.dataToPoint(t, o)
- })
- }
- e.each(function(t) {
- i[t][0] && i[t].push(i[t][0].slice()),
- e.setItemLayout(t, i[t])
- })
- }
- })
- }),
- tr(m(hI, "radar")),
- Qa(function(t) {
- var e = t.polar;
- if (e) {
- v(e) || (e = [e]);
- var i = [];
- c(e, function(e, n) {
- e.indicator ? (e.type && !e.shape && (e.shape = e.type),
- t.radar = t.radar || [],
- v(t.radar) || (t.radar = [t.radar]),
- t.radar.push(e)) : i.push(e)
- }),
- t.polar = i
- }
- c(t.series, function(t) {
- t && "radar" === t.type && t.polarIndex && (t.radarIndex = t.polarIndex)
- })
- });
- var pI = 1e-8;
- bl.prototype = {
- constructor: bl,
- properties: null,
- getBoundingRect: function() {
- var t = this._rect;
- if (t)
- return t;
- for (var e = Number.MAX_VALUE, i = [e, e], n = [-e, -e], o = [], a = [], r = this.geometries, s = 0; s < r.length; s++)
- "polygon" === r[s].type && (gn(r[s].exterior, o, a),
- $(i, i, o),
- K(n, n, a));
- return 0 === s && (i[0] = i[1] = n[0] = n[1] = 0),
- this._rect = new jt(i[0],i[1],n[0] - i[0],n[1] - i[1])
- },
- contain: function(t) {
- var e = this.getBoundingRect()
- , i = this.geometries;
- if (!e.contain(t[0], t[1]))
- return !1;
- t: for (var n = 0, o = i.length; n < o; n++)
- if ("polygon" === i[n].type) {
- var a = i[n].exterior
- , r = i[n].interiors;
- if (_l(a, t[0], t[1])) {
- for (var s = 0; s < (r ? r.length : 0); s++)
- if (_l(r[s]))
- continue t;
- return !0
- }
- }
- return !1
- },
- transformTo: function(t, e, i, n) {
- var o = this.getBoundingRect()
- , a = o.width / o.height;
- i ? n || (n = i / a) : i = a * n;
- for (var r = new jt(t,e,i,n), s = o.calculateTransform(r), l = this.geometries, h = 0; h < l.length; h++)
- if ("polygon" === l[h].type) {
- for (var u = l[h].exterior, c = l[h].interiors, d = 0; d < u.length; d++)
- Y(u[d], u[d], s);
- for (var f = 0; f < (c ? c.length : 0); f++)
- for (d = 0; d < c[f].length; d++)
- Y(c[f][d], c[f][d], s)
- }
- (o = this._rect).copy(r),
- this.center = [o.x + o.width / 2, o.y + o.height / 2]
- }
- };
- var mI = function(t) {
- return wl(t),
- d(g(t.features, function(t) {
- return t.geometry && t.properties && t.geometry.coordinates.length > 0
- }), function(t) {
- var e = t.properties
- , i = t.geometry
- , n = i.coordinates
- , o = [];
- "Polygon" === i.type && o.push({
- type: "polygon",
- exterior: n[0],
- interiors: n.slice(1)
- }),
- "MultiPolygon" === i.type && c(n, function(t) {
- t[0] && o.push({
- type: "polygon",
- exterior: t[0],
- interiors: t.slice(1)
- })
- });
- var a = new bl(e.name,o,e.cp);
- return a.properties = e,
- a
- })
- }
- , vI = Y;
- h(Ml, My),
- Il.prototype = {
- constructor: Il,
- type: "view",
- dimensions: ["x", "y"],
- setBoundingRect: function(t, e, i, n) {
- return this._rect = new jt(t,e,i,n),
- this._rect
- },
- getBoundingRect: function() {
- return this._rect
- },
- setViewRect: function(t, e, i, n) {
- this.transformTo(t, e, i, n),
- this._viewRect = new jt(t,e,i,n)
- },
- transformTo: function(t, e, i, n) {
- var o = this.getBoundingRect()
- , a = this._viewTransform;
- a.transform = o.calculateTransform(new jt(t,e,i,n)),
- a.decomposeTransform(),
- this._updateTransform()
- },
- setCenter: function(t) {
- t && (this._center = t,
- this._updateCenterAndZoom())
- },
- setZoom: function(t) {
- t = t || 1;
- var e = this.zoomLimit;
- e && (null != e.max && (t = Math.min(e.max, t)),
- null != e.min && (t = Math.max(e.min, t))),
- this._zoom = t,
- this._updateCenterAndZoom()
- },
- getDefaultCenter: function() {
- var t = this.getBoundingRect();
- return [t.x + t.width / 2, t.y + t.height / 2]
- },
- getCenter: function() {
- return this._center || this.getDefaultCenter()
- },
- getZoom: function() {
- return this._zoom || 1
- },
- getRoamTransform: function() {
- return this._roamTransform
- },
- _updateCenterAndZoom: function() {
- var t = this._viewTransform.getLocalTransform()
- , e = this._roamTransform
- , i = this.getDefaultCenter()
- , n = this.getCenter()
- , o = this.getZoom();
- n = Y([], n, t),
- i = Y([], i, t),
- e.origin = n,
- e.position = [i[0] - n[0], i[1] - n[1]],
- e.scale = [o, o],
- this._updateTransform()
- },
- _updateTransform: function() {
- var t = this._roamTransform
- , e = this._viewTransform;
- e.parent = t,
- t.updateTransform(),
- e.updateTransform(),
- e.transform && at(this.transform || (this.transform = []), e.transform),
- this.transform ? (this.invTransform = this.invTransform || [],
- ut(this.invTransform, this.transform)) : this.invTransform = null,
- this.decomposeTransform()
- },
- getViewRect: function() {
- return this._viewRect
- },
- getViewRectAfterRoam: function() {
- var t = this.getBoundingRect().clone();
- return t.applyTransform(this.transform),
- t
- },
- dataToPoint: function(t) {
- var e = this.transform;
- return e ? vI([], t, e) : [t[0], t[1]]
- },
- pointToData: function(t) {
- var e = this.invTransform;
- return e ? vI([], t, e) : [t[0], t[1]]
- },
- convertToPixel: m(Tl, "dataToPoint"),
- convertFromPixel: m(Tl, "pointToData"),
- containPoint: function(t) {
- return this.getViewRectAfterRoam().contain(t[0], t[1])
- }
- },
- h(Il, My);
- for (var yI = [126, 25], xI = [[[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]]], _I = 0; _I < xI.length; _I++)
- for (var bI = 0; bI < xI[_I].length; bI++)
- xI[_I][bI][0] /= 10.5,
- xI[_I][bI][1] /= -14,
- xI[_I][bI][0] += yI[0],
- xI[_I][bI][1] += yI[1];
- var wI = {
- "南海诸岛": [32, 80],
- "广东": [0, -10],
- "香港": [10, 5],
- "澳门": [-10, 10],
- "天津": [5, 5]
- }
- , SI = {
- Russia: [100, 60],
- "United States": [-99, 38],
- "United States of America": [-99, 38]
- }
- , MI = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]]
- , II = [function(t) {
- "china" === t.map && t.regions.push(new bl("南海诸岛",d(xI, function(t) {
- return {
- type: "polygon",
- exterior: t
- }
- }),yI))
- }
- , function(t) {
- c(t.regions, function(t) {
- var e = wI[t.name];
- if (e) {
- var i = t.center;
- i[0] += e[0] / 10.5,
- i[1] += -e[1] / 14
- }
- })
- }
- , function(t) {
- c(t.regions, function(t) {
- var e = SI[t.name];
- if (e) {
- var i = t.center;
- i[0] = e[0],
- i[1] = e[1]
- }
- })
- }
- , function(t) {
- if ("china" === t.map)
- for (var e = 0, i = t.regions.length; e < i; ++e)
- "台湾" === t.regions[e].name && t.regions[e].geometries.push({
- type: "polygon",
- exterior: MI[0]
- })
- }
- ];
- Al.prototype = {
- constructor: Al,
- type: "geo",
- dimensions: ["lng", "lat"],
- containCoord: function(t) {
- for (var e = this.regions, i = 0; i < e.length; i++)
- if (e[i].contain(t))
- return !0;
- return !1
- },
- loadGeoJson: function(t, e, i) {
- try {
- this.regions = t ? mI(t) : []
- } catch (t) {
- throw "Invalid geoJson format\n" + t.message
- }
- e = e || {},
- i = i || {};
- for (var n = this.regions, o = O(), a = 0; a < n.length; a++) {
- var r = n[a].name;
- r = i.hasOwnProperty(r) ? i[r] : r,
- n[a].name = r,
- o.set(r, n[a]),
- this.addGeoCoord(r, n[a].center);
- var s = e[r];
- s && n[a].transformTo(s.left, s.top, s.width, s.height)
- }
- this._regionsMap = o,
- this._rect = null,
- c(II, function(t) {
- t(this)
- }, this)
- },
- transformTo: function(t, e, i, n) {
- var o = this.getBoundingRect();
- (o = o.clone()).y = -o.y - o.height;
- var a = this._viewTransform;
- a.transform = o.calculateTransform(new jt(t,e,i,n)),
- a.decomposeTransform();
- var r = a.scale;
- r[1] = -r[1],
- a.updateTransform(),
- this._updateTransform()
- },
- getRegion: function(t) {
- return this._regionsMap.get(t)
- },
- getRegionByCoord: function(t) {
- for (var e = this.regions, i = 0; i < e.length; i++)
- if (e[i].contain(t))
- return e[i]
- },
- addGeoCoord: function(t, e) {
- this._nameCoordMap.set(t, e)
- },
- getGeoCoord: function(t) {
- return this._nameCoordMap.get(t)
- },
- getBoundingRect: function() {
- if (this._rect)
- return this._rect;
- for (var t, e = this.regions, i = 0; i < e.length; i++) {
- var n = e[i].getBoundingRect();
- (t = t || n.clone()).union(n)
- }
- return this._rect = t || new jt(0,0,0,0)
- },
- dataToPoint: function(t) {
- if ("string" == typeof t && (t = this.getGeoCoord(t)),
- t)
- return Il.prototype.dataToPoint.call(this, t)
- },
- convertToPixel: m(Cl, "dataToPoint"),
- convertFromPixel: m(Cl, "pointToData")
- },
- h(Al, Il);
- var TI = {}
- , AI = {
- dimensions: Al.prototype.dimensions,
- create: function(t, e) {
- var i = [];
- t.eachComponent("geo", function(t, n) {
- var o = t.get("map")
- , a = TI[o]
- , r = new Al(o + n,o,a && a.geoJson,a && a.specialAreas,t.get("nameMap"));
- r.zoomLimit = t.get("scaleLimit"),
- i.push(r),
- Ll(r, t),
- t.coordinateSystem = r,
- r.model = t,
- r.resize = Dl,
- r.resize(t, e)
- }),
- t.eachSeries(function(t) {
- if ("geo" === t.get("coordinateSystem")) {
- var e = t.get("geoIndex") || 0;
- t.coordinateSystem = i[e]
- }
- });
- var o = {};
- return t.eachSeriesByType("map", function(t) {
- if (!t.getHostGeoModel()) {
- var e = t.getMapType();
- o[e] = o[e] || [],
- o[e].push(t)
- }
- }),
- c(o, function(t, o) {
- var a = TI[o]
- , r = d(t, function(t) {
- return t.get("nameMap")
- })
- , s = new Al(o,o,a && a.geoJson,a && a.specialAreas,n(r));
- s.zoomLimit = M.apply(null, d(t, function(t) {
- return t.get("scaleLimit")
- })),
- i.push(s),
- s.resize = Dl,
- s.resize(t[0], e),
- c(t, function(t) {
- t.coordinateSystem = s,
- Ll(s, t)
- })
- }),
- i
- },
- registerMap: function(t, e, i) {
- e.geoJson && !e.features && (i = e.specialAreas,
- e = e.geoJson),
- "string" == typeof e && (e = "undefined" != typeof JSON && JSON.parse ? JSON.parse(e) : new Function("return (" + e + ");")()),
- TI[t] = {
- geoJson: e,
- specialAreas: i
- }
- },
- getMap: function(t) {
- return TI[t]
- },
- getFilledRegions: function(t, e, i) {
- var n = (t || []).slice();
- i = i || {};
- var o = AI.getMap(e)
- , a = o && o.geoJson;
- if (!a)
- return t;
- for (var r = O(), s = a.features, l = 0; l < n.length; l++)
- r.set(n[l].name, n[l]);
- for (l = 0; l < s.length; l++) {
- var h = s[l].properties.name;
- r.get(h) || (i.hasOwnProperty(h) && (h = i[h]),
- n.push({
- name: h
- }))
- }
- return n
- }
- };
- nS.registerMap(AI.registerMap),
- nS.getMap(AI.getMap),
- nS.parseGeoJSON(mI),
- ir("geo", AI);
- var CI = bw.extend({
- type: "series.map",
- dependencies: ["geo"],
- layoutMode: "box",
- needsDrawMap: !1,
- seriesGroup: [],
- init: function(t) {
- this._fillOption(t, this.getMapType()),
- CI.superApply(this, "init", arguments),
- this.updateSelectedMap(t.data)
- },
- getInitialData: function(t) {
- var e = vr(["value"], t.data || [])
- , i = new lS(e,this);
- return i.initData(t.data),
- i
- },
- mergeOption: function(t) {
- this._fillOption(t, this.getMapType()),
- CI.superApply(this, "mergeOption", arguments),
- this.updateSelectedMap(this.option.data)
- },
- getHostGeoModel: function() {
- var t = this.option.geoIndex;
- return null != t ? this.dependentModels.geo[t] : null
- },
- getMapType: function() {
- return (this.getHostGeoModel() || this).option.map
- },
- _fillOption: function(t, e) {
- t.data = AI.getFilledRegions(t.data, e, t.nameMap)
- },
- getRawValue: function(t) {
- return this.getData().get("value", t)
- },
- getRegionModel: function(t) {
- var e = this.getData();
- return e.getItemModel(e.indexOfName(t))
- },
- formatTooltip: function(t) {
- for (var e = this.getData(), i = Ei(this.getRawValue(t)), n = e.getName(t), o = this.seriesGroup, a = [], r = 0; r < o.length; r++) {
- var s = o[r].originalData.indexOfName(n);
- isNaN(o[r].originalData.get("value", s)) || a.push(Vi(o[r].name))
- }
- return a.join(", ") + "<br />" + Vi(n + " : " + i)
- },
- getTooltipPosition: function(t) {
- if (null != t) {
- var e = this.getData().getName(t)
- , i = this.coordinateSystem
- , n = i.getRegion(e);
- return n && i.dataToPoint(n.center)
- }
- },
- setZoom: function(t) {
- this.option.zoom = t
- },
- setCenter: function(t) {
- this.option.center = t
- },
- defaultOption: {
- zlevel: 0,
- z: 2,
- coordinateSystem: "geo",
- map: "",
- left: "center",
- top: "center",
- aspectScale: .75,
- showLegendSymbol: !0,
- dataRangeHoverLink: !0,
- boundingCoords: null,
- center: null,
- zoom: 1,
- scaleLimit: null,
- label: {
- normal: {
- show: !1,
- color: "#000"
- },
- emphasis: {
- show: !0,
- color: "rgb(100,0,0)"
- }
- },
- itemStyle: {
- normal: {
- borderWidth: .5,
- borderColor: "#444",
- areaColor: "#eee"
- },
- emphasis: {
- areaColor: "rgba(255,215,0,0.8)"
- }
- }
- }
- });
- h(CI, eI);
- var DI = "\0_ec_interaction_mutex";
- er({
- type: "takeGlobalCursor",
- event: "globalCursorTaken",
- update: "update"
- }, function() {}),
- h(Nl, my);
- var LI = {
- axisPointer: 1,
- tooltip: 1,
- brush: 1
- };
- Yl.prototype = {
- constructor: Yl,
- draw: function(t, e, i, n, o) {
- var a = "geo" === t.mainType
- , r = t.getData && t.getData();
- a && e.eachComponent({
- mainType: "series",
- subType: "map"
- }, function(e) {
- r || e.getHostGeoModel() !== t || (r = e.getData())
- });
- var s = t.coordinateSystem
- , l = this.group
- , h = s.scale
- , u = {
- position: s.position,
- scale: h
- };
- !l.childAt(0) || o ? l.attr(u) : _o(l, u, t),
- l.removeAll();
- var d = ["itemStyle", "normal"]
- , f = ["itemStyle", "emphasis"]
- , g = ["label", "normal"]
- , p = ["label", "emphasis"]
- , m = O();
- c(s.regions, function(e) {
- var i = m.get(e.name) || m.set(e.name, new $y)
- , n = new _b({
- shape: {
- paths: []
- }
- });
- i.add(n);
- var o, s = (D = t.getRegionModel(e.name) || t).getModel(d), u = D.getModel(f), v = jl(s), y = jl(u), x = D.getModel(g), _ = D.getModel(p);
- if (r) {
- o = r.indexOfName(e.name);
- var b = r.getItemVisual(o, "color", !0);
- b && (v.fill = b)
- }
- c(e.geometries, function(t) {
- if ("polygon" === t.type) {
- n.shape.paths.push(new fb({
- shape: {
- points: t.exterior
- }
- }));
- for (var e = 0; e < (t.interiors ? t.interiors.length : 0); e++)
- n.shape.paths.push(new fb({
- shape: {
- points: t.interiors[e]
- }
- }))
- }
- }),
- n.setStyle(v),
- n.style.strokeNoScale = !0,
- n.culling = !0;
- var w = x.get("show")
- , S = _.get("show")
- , M = r && isNaN(r.get("value", o))
- , I = r && r.getItemLayout(o);
- if (a || M && (w || S) || I && I.showLabel) {
- var T, A = a ? e.name : o;
- (!r || o >= 0) && (T = t);
- var C = new ab({
- position: e.center.slice(),
- scale: [1 / h[0], 1 / h[1]],
- z2: 10,
- silent: !0
- });
- ho(C.style, C.hoverStyle = {}, x, _, {
- labelFetcher: T,
- labelDataIndex: A,
- defaultText: e.name,
- useInsideStyle: !1
- }, {
- textAlign: "center",
- textVerticalAlign: "middle"
- }),
- i.add(C)
- }
- if (r)
- r.setItemGraphicEl(o, i);
- else {
- var D = t.getRegionModel(e.name);
- n.eventData = {
- componentType: "geo",
- geoIndex: t.componentIndex,
- name: e.name,
- region: D && D.option || {}
- }
- }
- (i.__regions || (i.__regions = [])).push(e),
- lo(i, y, {
- hoverSilentOnTouch: !!t.get("selectedMode")
- }),
- l.add(i)
- }),
- this._updateController(t, e, i),
- Xl(this, t, l, i, n),
- ql(t, l)
- },
- remove: function() {
- this.group.removeAll(),
- this._controller.dispose(),
- this._controllerHost = {}
- },
- _updateController: function(t, e, i) {
- function n() {
- var e = {
- type: "geoRoam",
- componentType: l
- };
- return e[l + "Id"] = t.id,
- e
- }
- var a = t.coordinateSystem
- , r = this._controller
- , s = this._controllerHost;
- s.zoomLimit = t.get("scaleLimit"),
- s.zoom = a.getZoom(),
- r.enable(t.get("roam") || !1);
- var l = t.mainType;
- r.off("pan").on("pan", function(t, e) {
- this._mouseDownFlag = !1,
- Fl(s, t, e),
- i.dispatchAction(o(n(), {
- dx: t,
- dy: e
- }))
- }, this),
- r.off("zoom").on("zoom", function(t, e, a) {
- if (this._mouseDownFlag = !1,
- Zl(s, t, e, a),
- i.dispatchAction(o(n(), {
- zoom: t,
- originX: e,
- originY: a
- })),
- this._updateGroup) {
- var r = this.group
- , l = r.scale;
- r.traverse(function(t) {
- "text" === t.type && t.attr("scale", [1 / l[0], 1 / l[1]])
- })
- }
- }, this),
- r.setPointerChecker(function(e, n, o) {
- return a.getViewRectAfterRoam().contain(n, o) && !Ul(e, i, t)
- })
- }
- },
- hr({
- type: "map",
- render: function(t, e, i, n) {
- if (!n || "mapToggleSelect" !== n.type || n.from !== this.uid) {
- var o = this.group;
- if (o.removeAll(),
- !t.getHostGeoModel()) {
- if (n && "geoRoam" === n.type && "series" === n.componentType && n.seriesId === t.id)
- (a = this._mapDraw) && o.add(a.group);
- else if (t.needsDrawMap) {
- var a = this._mapDraw || new Yl(i,!0);
- o.add(a.group),
- a.draw(t, e, i, this, n),
- this._mapDraw = a
- } else
- this._mapDraw && this._mapDraw.remove(),
- this._mapDraw = null;
- t.get("showLegendSymbol") && e.getComponent("legend") && this._renderSymbols(t, e, i)
- }
- }
- },
- remove: function() {
- this._mapDraw && this._mapDraw.remove(),
- this._mapDraw = null,
- this.group.removeAll()
- },
- dispose: function() {
- this._mapDraw && this._mapDraw.remove(),
- this._mapDraw = null
- },
- _renderSymbols: function(t, e, i) {
- var n = t.originalData
- , o = this.group;
- n.each("value", function(e, i) {
- if (!isNaN(e)) {
- var a = n.getItemLayout(i);
- if (a && a.point) {
- var r = a.point
- , s = a.offset
- , l = new rb({
- style: {
- fill: t.getData().getVisual("color")
- },
- shape: {
- cx: r[0] + 9 * s,
- cy: r[1],
- r: 3
- },
- silent: !0,
- z2: s ? 8 : 10
- });
- if (!s) {
- var h = t.mainSeries.getData()
- , u = n.getName(i)
- , c = h.indexOfName(u)
- , d = n.getItemModel(i)
- , f = d.getModel("label.normal")
- , g = d.getModel("label.emphasis")
- , p = h.getItemGraphicEl(c)
- , m = I(t.getFormattedLabel(i, "normal"), u)
- , v = I(t.getFormattedLabel(i, "emphasis"), m)
- , y = function() {
- var t = uo({}, g, {
- text: g.get("show") ? v : null
- }, {
- isRectText: !0,
- useInsideStyle: !1
- }, !0);
- l.style.extendFrom(t),
- l.__mapOriginalZ2 = l.z2,
- l.z2 += 1
- }
- , x = function() {
- uo(l.style, f, {
- text: f.get("show") ? m : null,
- textPosition: f.getShallow("position") || "bottom"
- }, {
- isRectText: !0,
- useInsideStyle: !1
- }),
- null != l.__mapOriginalZ2 && (l.z2 = l.__mapOriginalZ2,
- l.__mapOriginalZ2 = null)
- };
- p.on("mouseover", y).on("mouseout", x).on("emphasis", y).on("normal", x),
- x()
- }
- o.add(l)
- }
- }
- })
- }
- }),
- er({
- type: "geoRoam",
- event: "geoRoam",
- update: "updateLayout"
- }, function(t, e) {
- var i = t.componentType || "series";
- e.eachComponent({
- mainType: i,
- query: t
- }, function(e) {
- var n = e.coordinateSystem;
- if ("geo" === n.type) {
- var o = $l(n, t, e.get("scaleLimit"));
- e.setCenter && e.setCenter(o.center),
- e.setZoom && e.setZoom(o.zoom),
- "series" === i && c(e.seriesGroup, function(t) {
- t.setCenter(o.center),
- t.setZoom(o.zoom)
- })
- }
- })
- });
- nr(function(t) {
- var e = {};
- t.eachSeriesByType("map", function(i) {
- var n = i.getMapType();
- if (!i.getHostGeoModel() && !e[n]) {
- var o = {};
- c(i.seriesGroup, function(e) {
- var i = e.coordinateSystem
- , n = e.originalData;
- e.get("showLegendSymbol") && t.getComponent("legend") && n.each("value", function(t, e) {
- var a = n.getName(e)
- , r = i.getRegion(a);
- if (r && !isNaN(t)) {
- var s = o[a] || 0
- , l = i.dataToPoint(r.center);
- o[a] = s + 1,
- n.setItemLayout(e, {
- point: l,
- offset: s
- })
- }
- })
- });
- var a = i.getData();
- a.each(function(t) {
- var e = a.getName(t)
- , i = a.getItemLayout(t) || {};
- i.showLabel = !o[e],
- a.setItemLayout(t, i)
- }),
- e[n] = !0
- }
- })
- }),
- or(function(t) {
- t.eachSeriesByType("map", function(t) {
- var e = t.get("color")
- , i = t.getModel("itemStyle.normal")
- , n = i.get("areaColor")
- , o = i.get("color") || e[t.seriesIndex % e.length];
- t.getData().setVisual({
- areaColor: n,
- color: o
- })
- })
- }),
- tr(Ew.PROCESSOR.STATISTIC, function(t) {
- var e = {};
- t.eachSeriesByType("map", function(t) {
- var i = t.getHostGeoModel()
- , n = i ? "o" + i.id : "i" + t.getMapType();
- (e[n] = e[n] || []).push(t)
- }),
- c(e, function(t, e) {
- for (var i = Kl(d(t, function(t) {
- return t.getData()
- }), t[0].get("mapValueCalculation")), n = 0; n < t.length; n++)
- t[n].originalData = t[n].getData();
- for (n = 0; n < t.length; n++)
- t[n].seriesGroup = t,
- t[n].needsDrawMap = 0 === n && !t[n].getHostGeoModel(),
- t[n].setData(i.cloneShallow()),
- t[n].mainSeries = t[0]
- })
- }),
- Qa(function(t) {
- var e = [];
- c(t.series, function(t) {
- t && "map" === t.type && (e.push(t),
- t.map = t.map || t.mapType,
- a(t, t.mapLocation))
- })
- }),
- oI("map", [{
- type: "mapToggleSelect",
- event: "mapselectchanged",
- method: "toggleSelected"
- }, {
- type: "mapSelect",
- event: "mapselected",
- method: "select"
- }, {
- type: "mapUnSelect",
- event: "mapunselected",
- method: "unSelect"
- }]);
- var kI = c
- , PI = "\0__link_datas"
- , OI = "\0__link_mainData"
- , zI = function(t, e) {
- this.name = t || "",
- this.depth = 0,
- this.height = 0,
- this.parentNode = null,
- this.dataIndex = -1,
- this.children = [],
- this.viewChildren = [],
- this.hostTree = e
- };
- zI.prototype = {
- constructor: zI,
- isRemoved: function() {
- return this.dataIndex < 0
- },
- eachNode: function(t, e, i) {
- "function" == typeof t && (i = e,
- e = t,
- t = null),
- x(t = t || {}) && (t = {
- order: t
- });
- var n, o = t.order || "preorder", a = this[t.attr || "children"];
- "preorder" === o && (n = e.call(i, this));
- for (var r = 0; !n && r < a.length; r++)
- a[r].eachNode(t, e, i);
- "postorder" === o && e.call(i, this)
- },
- updateDepthAndHeight: function(t) {
- var e = 0;
- this.depth = t;
- for (var i = 0; i < this.children.length; i++) {
- var n = this.children[i];
- n.updateDepthAndHeight(t + 1),
- n.height > e && (e = n.height)
- }
- this.height = e + 1
- },
- getNodeById: function(t) {
- if (this.getId() === t)
- return this;
- for (var e = 0, i = this.children, n = i.length; e < n; e++) {
- var o = i[e].getNodeById(t);
- if (o)
- return o
- }
- },
- contains: function(t) {
- if (t === this)
- return !0;
- for (var e = 0, i = this.children, n = i.length; e < n; e++) {
- var o = i[e].contains(t);
- if (o)
- return o
- }
- },
- getAncestors: function(t) {
- for (var e = [], i = t ? this : this.parentNode; i; )
- e.push(i),
- i = i.parentNode;
- return e.reverse(),
- e
- },
- getValue: function(t) {
- var e = this.hostTree.data;
- return e.get(e.getDimension(t || "value"), this.dataIndex)
- },
- setLayout: function(t, e) {
- this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, t, e)
- },
- getLayout: function() {
- return this.hostTree.data.getItemLayout(this.dataIndex)
- },
- getModel: function(t) {
- if (!(this.dataIndex < 0)) {
- var e, i = this.hostTree, n = i.data.getItemModel(this.dataIndex), o = this.getLevelModel();
- return o || 0 !== this.children.length && (0 === this.children.length || !1 !== this.isExpand) || (e = this.getLeavesModel()),
- n.getModel(t, (o || e || i.hostModel).getModel(t))
- }
- },
- getLevelModel: function() {
- return (this.hostTree.levelModels || [])[this.depth]
- },
- getLeavesModel: function() {
- return this.hostTree.leavesModel
- },
- setVisual: function(t, e) {
- this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, t, e)
- },
- getVisual: function(t, e) {
- return this.hostTree.data.getItemVisual(this.dataIndex, t, e)
- },
- getRawIndex: function() {
- return this.hostTree.data.getRawIndex(this.dataIndex)
- },
- getId: function() {
- return this.hostTree.data.getId(this.dataIndex)
- }
- },
- rh.prototype = {
- constructor: rh,
- type: "tree",
- eachNode: function(t, e, i) {
- this.root.eachNode(t, e, i)
- },
- getNodeByDataIndex: function(t) {
- var e = this.data.getRawIndex(t);
- return this._nodes[e]
- },
- getNodeByName: function(t) {
- return this.root.getNodeByName(t)
- },
- update: function() {
- for (var t = this.data, e = this._nodes, i = 0, n = e.length; i < n; i++)
- e[i].dataIndex = -1;
- for (var i = 0, n = t.count(); i < n; i++)
- e[t.getRawIndex(i)].dataIndex = i
- },
- clearLayouts: function() {
- this.data.clearItemLayouts()
- }
- },
- rh.createTree = function(t, e, i) {
- function n(t, e) {
- var i = t.value;
- r = Math.max(r, v(i) ? i.length : 1),
- a.push(t);
- var s = new zI(t.name,o);
- e ? sh(s, e) : o.root = s,
- o._nodes.push(s);
- var l = t.children;
- if (l)
- for (var h = 0; h < l.length; h++)
- n(l[h], s)
- }
- var o = new rh(e,i.levels,i.leaves)
- , a = []
- , r = 1;
- n(t),
- o.root.updateDepthAndHeight(0);
- var s = vr([{
- name: "value"
- }], a, {
- dimCount: r
- })
- , l = new lS(s,e);
- return l.initData(a),
- Jl({
- mainData: l,
- struct: o,
- structAttr: "tree"
- }),
- o.update(),
- o
- }
- ,
- bw.extend({
- type: "series.tree",
- layoutInfo: null,
- layoutMode: "box",
- getInitialData: function(t) {
- var e = {
- name: t.name,
- children: t.data
- }
- , i = t.leaves || {}
- , n = {};
- n.leaves = i;
- var o = rh.createTree(e, this, n)
- , a = 0;
- o.eachNode("preorder", function(t) {
- t.depth > a && (a = t.depth)
- });
- var r = t.expandAndCollapse && t.initialTreeDepth >= 0 ? t.initialTreeDepth : a;
- return o.root.eachNode("preorder", function(t) {
- var e = t.hostTree.data.getRawDataItem(t.dataIndex);
- t.isExpand = e && null != e.collapsed ? !e.collapsed : t.depth <= r
- }),
- o.data
- },
- formatTooltip: function(t) {
- for (var e = this.getData().tree, i = e.root.children[0], n = e.getNodeByDataIndex(t), o = n.getValue(), a = n.name; n && n !== i; )
- a = n.parentNode.name + "." + a,
- n = n.parentNode;
- return Vi(a + (isNaN(o) || null == o ? "" : " : " + o))
- },
- defaultOption: {
- zlevel: 0,
- z: 2,
- left: "12%",
- top: "12%",
- right: "12%",
- bottom: "12%",
- layout: "orthogonal",
- orient: "horizontal",
- symbol: "emptyCircle",
- symbolSize: 7,
- expandAndCollapse: !0,
- initialTreeDepth: 2,
- lineStyle: {
- normal: {
- color: "#ccc",
- width: 1.5,
- curveness: .5
- }
- },
- itemStyle: {
- normal: {
- color: "lightsteelblue",
- borderColor: "#c23531",
- borderWidth: 1.5
- }
- },
- label: {
- normal: {
- show: !0,
- color: "#555"
- }
- },
- leaves: {
- label: {
- normal: {
- show: !0
- }
- }
- },
- animationEasing: "linear",
- animationDuration: 700,
- animationDurationUpdate: 1e3
- }
- }),
- hr({
- type: "tree",
- init: function(t, e) {
- this._oldTree,
- this._mainGroup = new $y,
- this.group.add(this._mainGroup)
- },
- render: function(t, e, i, n) {
- var o = t.getData()
- , a = t.layoutInfo
- , r = this._mainGroup
- , s = t.get("layout");
- "radial" === s ? r.attr("position", [a.x + a.width / 2, a.y + a.height / 2]) : r.attr("position", [a.x, a.y]);
- var l = this._data
- , h = {
- expandAndCollapse: t.get("expandAndCollapse"),
- layout: s,
- orient: t.get("orient"),
- curvature: t.get("lineStyle.normal.curveness"),
- symbolRotate: t.get("symbolRotate"),
- symbolOffset: t.get("symbolOffset"),
- hoverAnimation: t.get("hoverAnimation"),
- useNameLabel: !0,
- fadeIn: !0
- };
- o.diff(l).add(function(e) {
- bh(o, e) && Sh(o, e, null, r, t, h)
- }).update(function(e, i) {
- var n = l.getItemGraphicEl(i);
- bh(o, e) ? Sh(o, e, n, r, t, h) : n && Mh(o, e, n, r, t, h)
- }).remove(function(e) {
- var i = l.getItemGraphicEl(e);
- Mh(o, e, i, r, t, h)
- }).execute(),
- !0 === h.expandAndCollapse && o.eachItemGraphicEl(function(e, n) {
- e.off("click").on("click", function() {
- i.dispatchAction({
- type: "treeExpandAndCollapse",
- seriesId: t.id,
- dataIndex: n
- })
- })
- }),
- this._data = o
- },
- dispose: function() {},
- remove: function() {
- this._mainGroup.removeAll(),
- this._data = null
- }
- }),
- er({
- type: "treeExpandAndCollapse",
- event: "treeExpandAndCollapse",
- update: "update"
- }, function(t, e) {
- e.eachComponent({
- mainType: "series",
- subType: "tree",
- query: t
- }, function(e) {
- var i = t.dataIndex
- , n = e.getData().tree.getNodeByDataIndex(i);
- n.isExpand = !n.isExpand
- })
- });
- var NI = function(t, e) {
- var i = fh(t, e);
- t.layoutInfo = i;
- var n = t.get("layout")
- , o = 0
- , a = 0
- , r = null;
- "radial" === n ? (o = 2 * Math.PI,
- a = Math.min(i.height, i.width) / 2,
- r = ch(function(t, e) {
- return (t.parentNode === e.parentNode ? 1 : 2) / t.depth
- })) : (o = i.width,
- a = i.height,
- r = ch());
- var s = t.getData().tree.root
- , l = s.children[0];
- lh(s),
- Th(l, hh, r),
- s.hierNode.modifier = -l.hierNode.prelim,
- Ah(l, uh);
- var h = l
- , u = l
- , c = l;
- Ah(l, function(t) {
- var e = t.getLayout().x;
- e < h.getLayout().x && (h = t),
- e > u.getLayout().x && (u = t),
- t.depth > c.depth && (c = t)
- });
- var d = h === u ? 1 : r(h, u) / 2
- , f = d - h.getLayout().x
- , g = 0
- , p = 0
- , m = 0
- , v = 0;
- "radial" === n ? (g = o / (u.getLayout().x + d + f),
- p = a / (c.depth - 1 || 1),
- Ah(l, function(t) {
- m = (t.getLayout().x + f) * g,
- v = (t.depth - 1) * p;
- var e = dh(m, v);
- t.setLayout({
- x: e.x,
- y: e.y,
- rawX: m,
- rawY: v
- }, !0)
- })) : "horizontal" === t.get("orient") ? (p = a / (u.getLayout().x + d + f),
- g = o / (c.depth - 1 || 1),
- Ah(l, function(t) {
- v = (t.getLayout().x + f) * p,
- m = (t.depth - 1) * g,
- t.setLayout({
- x: m,
- y: v
- }, !0)
- })) : (g = o / (u.getLayout().x + d + f),
- p = a / (c.depth - 1 || 1),
- Ah(l, function(t) {
- m = (t.getLayout().x + f) * g,
- v = (t.depth - 1) * p,
- t.setLayout({
- x: m,
- y: v
- }, !0)
- }))
- };
- or(m(mM, "tree", "circle", null)),
- nr(function(t, e) {
- t.eachSeriesByType("tree", function(t) {
- NI(t, e)
- })
- }),
- nr(function(t, e) {
- t.eachSeriesByType("tree", function(t) {
- NI(t, e)
- })
- }),
- bw.extend({
- type: "series.treemap",
- layoutMode: "box",
- dependencies: ["grid", "polar"],
- _viewRoot: null,
- defaultOption: {
- progressive: 0,
- hoverLayerThreshold: 1 / 0,
- left: "center",
- top: "middle",
- right: null,
- bottom: null,
- width: "80%",
- height: "80%",
- sort: !0,
- clipWindow: "origin",
- squareRatio: .5 * (1 + Math.sqrt(5)),
- leafDepth: null,
- drillDownIcon: "▶",
- zoomToNodeRatio: .1024,
- roam: !0,
- nodeClick: "zoomToNode",
- animation: !0,
- animationDurationUpdate: 900,
- animationEasing: "quinticInOut",
- breadcrumb: {
- show: !0,
- height: 22,
- left: "center",
- top: "bottom",
- emptyItemWidth: 25,
- itemStyle: {
- normal: {
- color: "rgba(0,0,0,0.7)",
- borderColor: "rgba(255,255,255,0.7)",
- borderWidth: 1,
- shadowColor: "rgba(150,150,150,1)",
- shadowBlur: 3,
- shadowOffsetX: 0,
- shadowOffsetY: 0,
- textStyle: {
- color: "#fff"
- }
- },
- emphasis: {
- textStyle: {}
- }
- }
- },
- label: {
- normal: {
- show: !0,
- distance: 0,
- padding: 5,
- position: "inside",
- color: "#fff",
- ellipsis: !0
- }
- },
- upperLabel: {
- normal: {
- show: !1,
- position: [0, "50%"],
- height: 20,
- color: "#fff",
- ellipsis: !0,
- verticalAlign: "middle"
- },
- emphasis: {
- show: !0,
- position: [0, "50%"],
- color: "#fff",
- ellipsis: !0,
- verticalAlign: "middle"
- }
- },
- itemStyle: {
- normal: {
- color: null,
- colorAlpha: null,
- colorSaturation: null,
- borderWidth: 0,
- gapWidth: 0,
- borderColor: "#fff",
- borderColorSaturation: null
- },
- emphasis: {}
- },
- visualDimension: 0,
- visualMin: null,
- visualMax: null,
- color: [],
- colorAlpha: null,
- colorSaturation: null,
- colorMappingBy: "index",
- visibleMin: 10,
- childrenVisibleMin: null,
- levels: []
- },
- getInitialData: function(t, e) {
- var i = {
- name: t.name,
- children: t.data
- };
- Ph(i);
- var n = t.levels || [];
- n = t.levels = Oh(n, e);
- var o = {};
- return o.levels = n,
- rh.createTree(i, this, o).data
- },
- optionUpdated: function() {
- this.resetViewRoot()
- },
- formatTooltip: function(t) {
- var e = this.getData()
- , i = this.getRawValue(t)
- , n = Ei(v(i) ? i[0] : i);
- return Vi(e.getName(t) + ": " + n)
- },
- getDataParams: function(t) {
- var e = bw.prototype.getDataParams.apply(this, arguments)
- , i = this.getData().tree.getNodeByDataIndex(t);
- return e.treePathInfo = kh(i, this),
- e
- },
- setLayoutInfo: function(t) {
- this.layoutInfo = this.layoutInfo || {},
- o(this.layoutInfo, t)
- },
- mapIdToIndex: function(t) {
- var e = this._idIndexMap;
- e || (e = this._idIndexMap = O(),
- this._idIndexMapCount = 0);
- var i = e.get(t);
- return null == i && e.set(t, i = this._idIndexMapCount++),
- i
- },
- getViewRoot: function() {
- return this._viewRoot
- },
- resetViewRoot: function(t) {
- t ? this._viewRoot = t : t = this._viewRoot;
- var e = this.getData().tree.root;
- t && (t === e || e.contains(t)) || (this._viewRoot = e)
- }
- });
- var EI = 5;
- zh.prototype = {
- constructor: zh,
- render: function(t, e, i, n) {
- var o = t.getModel("breadcrumb")
- , a = this.group;
- if (a.removeAll(),
- o.get("show") && i) {
- var r = o.getModel("itemStyle.normal")
- , s = r.getModel("textStyle")
- , l = {
- pos: {
- left: o.get("left"),
- right: o.get("right"),
- top: o.get("top"),
- bottom: o.get("bottom")
- },
- box: {
- width: e.getWidth(),
- height: e.getHeight()
- },
- emptyItemWidth: o.get("emptyItemWidth"),
- totalWidth: 0,
- renderList: []
- };
- this._prepare(i, l, s),
- this._renderContent(t, l, r, s, n),
- $o(a, l.pos, l.box)
- }
- },
- _prepare: function(t, e, i) {
- for (var n = t; n; n = n.parentNode) {
- var o = n.getModel().get("name")
- , a = i.getTextRect(o)
- , r = Math.max(a.width + 16, e.emptyItemWidth);
- e.totalWidth += r + 8,
- e.renderList.push({
- node: n,
- text: o,
- width: r
- })
- }
- },
- _renderContent: function(t, e, i, n, o) {
- for (var r = 0, s = e.emptyItemWidth, l = t.get("breadcrumb.height"), h = qo(e.pos, e.box), u = e.totalWidth, c = e.renderList, d = c.length - 1; d >= 0; d--) {
- var f = c[d]
- , g = f.node
- , p = f.width
- , v = f.text;
- u > h.width && (u -= p - s,
- p = s,
- v = null);
- var y = new fb({
- shape: {
- points: Nh(r, 0, p, l, d === c.length - 1, 0 === d)
- },
- style: a(i.getItemStyle(), {
- lineJoin: "bevel",
- text: v,
- textFill: n.getTextColor(),
- textFont: n.getFont()
- }),
- z: 10,
- onclick: m(o, g)
- });
- this.group.add(y),
- Eh(y, t, g),
- r += p + 8
- }
- },
- remove: function() {
- this.group.removeAll()
- }
- };
- var RI = p
- , VI = $y
- , BI = pb
- , GI = c
- , WI = ["label", "normal"]
- , HI = ["label", "emphasis"]
- , FI = ["upperLabel", "normal"]
- , ZI = ["upperLabel", "emphasis"]
- , UI = 10
- , jI = 1
- , XI = 2
- , qI = e_([["fill", "color"], ["stroke", "strokeColor"], ["lineWidth", "strokeWidth"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"]])
- , YI = function(t) {
- var e = qI(t);
- return e.stroke = e.fill = e.lineWidth = null,
- e
- };
- hr({
- type: "treemap",
- init: function(t, e) {
- this._containerGroup,
- this._storage = {
- nodeGroup: [],
- background: [],
- content: []
- },
- this._oldTree,
- this._breadcrumb,
- this._controller,
- this._state = "ready"
- },
- render: function(t, e, i, n) {
- if (!(s(e.findComponents({
- mainType: "series",
- subType: "treemap",
- query: n
- }), t) < 0)) {
- this.seriesModel = t,
- this.api = i,
- this.ecModel = e;
- var o = Ch(n, t)
- , a = n && n.type
- , r = t.layoutInfo
- , l = !this._oldTree
- , h = this._storage
- , u = "treemapRootToNode" === a && o && h ? {
- rootNodeGroup: h.nodeGroup[o.node.getRawIndex()],
- direction: n.direction
- } : null
- , c = this._giveContainerGroup(r)
- , d = this._doRender(c, t, u);
- l || a && "treemapZoomToNode" !== a && "treemapRootToNode" !== a ? d.renderFinally() : this._doAnimation(c, d, t, u),
- this._resetController(i),
- this._renderBreadcrumb(t, i, o)
- }
- },
- _giveContainerGroup: function(t) {
- var e = this._containerGroup;
- return e || (e = this._containerGroup = new VI,
- this._initEvents(e),
- this.group.add(e)),
- e.attr("position", [t.x, t.y]),
- e
- },
- _doRender: function(t, e, i) {
- function n(t, e, i, o, a) {
- function r(t) {
- return t.getId()
- }
- function s(r, s) {
- var l = null != r ? t[r] : null
- , h = null != s ? e[s] : null
- , c = u(l, h, i, a);
- c && n(l && l.viewChildren || [], h && h.viewChildren || [], c, o, a + 1)
- }
- o ? (e = t,
- GI(t, function(t, e) {
- !t.isRemoved() && s(e, e)
- })) : new cr(e,t,r,r).add(s).update(s).remove(m(s, null)).execute()
- }
- var o = e.getData().tree
- , a = this._oldTree
- , r = {
- nodeGroup: [],
- background: [],
- content: []
- }
- , s = {
- nodeGroup: [],
- background: [],
- content: []
- }
- , l = this._storage
- , h = []
- , u = m(Vh, e, s, l, i, r, h);
- n(o.root ? [o.root] : [], a && a.root ? [a.root] : [], t, o === a || !a, 0);
- var c = function(t) {
- var e = {
- nodeGroup: [],
- background: [],
- content: []
- };
- return t && GI(t, function(t, i) {
- var n = e[i];
- GI(t, function(t) {
- t && (n.push(t),
- t.__tmWillDelete = 1)
- })
- }),
- e
- }(l);
- return this._oldTree = o,
- this._storage = s,
- {
- lastsForAnimation: r,
- willDeleteEls: c,
- renderFinally: function() {
- GI(c, function(t) {
- GI(t, function(t) {
- t.parent && t.parent.remove(t)
- })
- }),
- GI(h, function(t) {
- t.invisible = !0,
- t.dirty()
- })
- }
- }
- },
- _doAnimation: function(t, e, i, n) {
- if (i.get("animation")) {
- var a = i.get("animationDurationUpdate")
- , r = i.get("animationEasing")
- , s = Rh();
- GI(e.willDeleteEls, function(t, e) {
- GI(t, function(t, i) {
- if (!t.invisible) {
- var o, l = t.parent;
- if (n && "drillDown" === n.direction)
- o = l === n.rootNodeGroup ? {
- shape: {
- x: 0,
- y: 0,
- width: l.__tmNodeWidth,
- height: l.__tmNodeHeight
- },
- style: {
- opacity: 0
- }
- } : {
- style: {
- opacity: 0
- }
- };
- else {
- var h = 0
- , u = 0;
- l.__tmWillDelete || (h = l.__tmNodeWidth / 2,
- u = l.__tmNodeHeight / 2),
- o = "nodeGroup" === e ? {
- position: [h, u],
- style: {
- opacity: 0
- }
- } : {
- shape: {
- x: h,
- y: u,
- width: 0,
- height: 0
- },
- style: {
- opacity: 0
- }
- }
- }
- o && s.add(t, o, a, r)
- }
- })
- }),
- GI(this._storage, function(t, i) {
- GI(t, function(t, n) {
- var l = e.lastsForAnimation[i][n]
- , h = {};
- l && ("nodeGroup" === i ? l.old && (h.position = t.position.slice(),
- t.attr("position", l.old)) : (l.old && (h.shape = o({}, t.shape),
- t.setShape(l.old)),
- l.fadein ? (t.setStyle("opacity", 0),
- h.style = {
- opacity: 1
- }) : 1 !== t.style.opacity && (h.style = {
- opacity: 1
- })),
- s.add(t, h, a, r))
- })
- }, this),
- this._state = "animating",
- s.done(RI(function() {
- this._state = "ready",
- e.renderFinally()
- }, this)).start()
- }
- },
- _resetController: function(t) {
- var e = this._controller;
- e || ((e = this._controller = new Nl(t.getZr())).enable(this.seriesModel.get("roam")),
- e.on("pan", RI(this._onPan, this)),
- e.on("zoom", RI(this._onZoom, this)));
- var i = new jt(0,0,t.getWidth(),t.getHeight());
- e.setPointerChecker(function(t, e, n) {
- return i.contain(e, n)
- })
- },
- _clearController: function() {
- var t = this._controller;
- t && (t.dispose(),
- t = null)
- },
- _onPan: function(t, e) {
- if ("animating" !== this._state && (Math.abs(t) > 3 || Math.abs(e) > 3)) {
- var i = this.seriesModel.getData().tree.root;
- if (!i)
- return;
- var n = i.getLayout();
- if (!n)
- return;
- this.api.dispatchAction({
- type: "treemapMove",
- from: this.uid,
- seriesId: this.seriesModel.id,
- rootRect: {
- x: n.x + t,
- y: n.y + e,
- width: n.width,
- height: n.height
- }
- })
- }
- },
- _onZoom: function(t, e, i) {
- if ("animating" !== this._state) {
- var n = this.seriesModel.getData().tree.root;
- if (!n)
- return;
- var o = n.getLayout();
- if (!o)
- return;
- var a = new jt(o.x,o.y,o.width,o.height)
- , r = this.seriesModel.layoutInfo;
- e -= r.x,
- i -= r.y;
- var s = nt();
- st(s, s, [-e, -i]),
- ht(s, s, [t, t]),
- st(s, s, [e, i]),
- a.applyTransform(s),
- this.api.dispatchAction({
- type: "treemapRender",
- from: this.uid,
- seriesId: this.seriesModel.id,
- rootRect: {
- x: a.x,
- y: a.y,
- width: a.width,
- height: a.height
- }
- })
- }
- },
- _initEvents: function(t) {
- t.on("click", function(t) {
- if ("ready" === this._state) {
- var e = this.seriesModel.get("nodeClick", !0);
- if (e) {
- var i = this.findTarget(t.offsetX, t.offsetY);
- if (i) {
- var n = i.node;
- if (n.getLayout().isLeafRoot)
- this._rootToNode(i);
- else if ("zoomToNode" === e)
- this._zoomToNode(i);
- else if ("link" === e) {
- var o = n.hostTree.data.getItemModel(n.dataIndex)
- , a = o.get("link", !0)
- , r = o.get("target", !0) || "blank";
- a && window.open(a, r)
- }
- }
- }
- }
- }, this)
- },
- _renderBreadcrumb: function(t, e, i) {
- i || (i = null != t.get("leafDepth", !0) ? {
- node: t.getViewRoot()
- } : this.findTarget(e.getWidth() / 2, e.getHeight() / 2)) || (i = {
- node: t.getData().tree.root
- }),
- (this._breadcrumb || (this._breadcrumb = new zh(this.group))).render(t, e, i.node, RI(function(e) {
- "animating" !== this._state && (Lh(t.getViewRoot(), e) ? this._rootToNode({
- node: e
- }) : this._zoomToNode({
- node: e
- }))
- }, this))
- },
- remove: function() {
- this._clearController(),
- this._containerGroup && this._containerGroup.removeAll(),
- this._storage = {
- nodeGroup: [],
- background: [],
- content: []
- },
- this._state = "ready",
- this._breadcrumb && this._breadcrumb.remove()
- },
- dispose: function() {
- this._clearController()
- },
- _zoomToNode: function(t) {
- this.api.dispatchAction({
- type: "treemapZoomToNode",
- from: this.uid,
- seriesId: this.seriesModel.id,
- targetNode: t.node
- })
- },
- _rootToNode: function(t) {
- this.api.dispatchAction({
- type: "treemapRootToNode",
- from: this.uid,
- seriesId: this.seriesModel.id,
- targetNode: t.node
- })
- },
- findTarget: function(t, e) {
- var i;
- return this.seriesModel.getViewRoot().eachNode({
- attr: "viewChildren",
- order: "preorder"
- }, function(n) {
- var o = this._storage.background[n.getRawIndex()];
- if (o) {
- var a = o.transformCoordToLocal(t, e)
- , r = o.shape;
- if (!(r.x <= a[0] && a[0] <= r.x + r.width && r.y <= a[1] && a[1] <= r.y + r.height))
- return !1;
- i = {
- node: n,
- offsetX: a[0],
- offsetY: a[1]
- }
- }
- }, this),
- i
- }
- });
- for (var $I = ["treemapZoomToNode", "treemapRender", "treemapMove"], KI = 0; KI < $I.length; KI++)
- er({
- type: $I[KI],
- update: "updateView"
- }, function() {});
- er({
- type: "treemapRootToNode",
- update: "updateView"
- }, function(t, e) {
- e.eachComponent({
- mainType: "series",
- subType: "treemap",
- query: t
- }, function(e, i) {
- var n = Ch(t, e);
- if (n) {
- var o = e.getViewRoot();
- o && (t.direction = Lh(o, n.node) ? "rollUp" : "drillDown"),
- e.resetViewRoot(n.node)
- }
- })
- });
- var JI = c
- , QI = _
- , tT = -1
- , eT = function(t) {
- var i = t.mappingMethod
- , n = t.type
- , o = this.option = e(t);
- this.type = n,
- this.mappingMethod = i,
- this._normalizeData = nT[i];
- var a = iT[n];
- this.applyVisual = a.applyVisual,
- this.getColorMapper = a.getColorMapper,
- this._doMap = a._doMap[i],
- "piecewise" === i ? (Hh(o),
- Gh(o)) : "category" === i ? o.categories ? Wh(o) : Hh(o, !0) : (D("linear" !== i || o.dataExtent),
- Hh(o))
- };
- eT.prototype = {
- constructor: eT,
- mapValueToVisual: function(t) {
- var e = this._normalizeData(t);
- return this._doMap(e, t)
- },
- getNormalizer: function() {
- return p(this._normalizeData, this)
- }
- };
- var iT = eT.visualHandlers = {
- color: {
- applyVisual: Uh("color"),
- getColorMapper: function() {
- var t = this.option;
- return p("category" === t.mappingMethod ? function(t, e) {
- return !e && (t = this._normalizeData(t)),
- jh.call(this, t)
- }
- : function(e, i, n) {
- var o = !!n;
- return !i && (e = this._normalizeData(e)),
- n = Ct(e, t.parsedVisual, n),
- o ? n : Pt(n, "rgba")
- }
- , this)
- },
- _doMap: {
- linear: function(t) {
- return Pt(Ct(t, this.option.parsedVisual), "rgba")
- },
- category: jh,
- piecewise: function(t, e) {
- var i = Yh.call(this, e);
- return null == i && (i = Pt(Ct(t, this.option.parsedVisual), "rgba")),
- i
- },
- fixed: Xh
- }
- },
- colorHue: Fh(function(t, e) {
- return Lt(t, e)
- }),
- colorSaturation: Fh(function(t, e) {
- return Lt(t, null, e)
- }),
- colorLightness: Fh(function(t, e) {
- return Lt(t, null, null, e)
- }),
- colorAlpha: Fh(function(t, e) {
- return kt(t, e)
- }),
- opacity: {
- applyVisual: Uh("opacity"),
- _doMap: qh([0, 1])
- },
- symbol: {
- applyVisual: function(t, e, i) {
- var n = this.mapValueToVisual(t);
- if (x(n))
- i("symbol", n);
- else if (QI(n))
- for (var o in n)
- n.hasOwnProperty(o) && i(o, n[o])
- },
- _doMap: {
- linear: Zh,
- category: jh,
- piecewise: function(t, e) {
- var i = Yh.call(this, e);
- return null == i && (i = Zh.call(this, t)),
- i
- },
- fixed: Xh
- }
- },
- symbolSize: {
- applyVisual: Uh("symbolSize"),
- _doMap: qh([0, 1])
- }
- }
- , nT = {
- linear: function(t) {
- return _i(t, this.option.dataExtent, [0, 1], !0)
- },
- piecewise: function(t) {
- var e = this.option.pieceList
- , i = eT.findPieceIndex(t, e, !0);
- if (null != i)
- return _i(i, [0, e.length - 1], [0, 1], !0)
- },
- category: function(t) {
- var e = this.option.categories ? this.option.categoryMap[t] : t;
- return null == e ? tT : e
- },
- fixed: z
- };
- eT.listVisualTypes = function() {
- var t = [];
- return c(iT, function(e, i) {
- t.push(i)
- }),
- t
- }
- ,
- eT.addVisualHandler = function(t, e) {
- iT[t] = e
- }
- ,
- eT.isValidType = function(t) {
- return iT.hasOwnProperty(t)
- }
- ,
- eT.eachVisual = function(t, e, i) {
- _(t) ? c(t, e, i) : e.call(i, t)
- }
- ,
- eT.mapVisual = function(t, e, i) {
- var n, o = v(t) ? [] : _(t) ? {} : (n = !0,
- null);
- return eT.eachVisual(t, function(t, a) {
- var r = e.call(i, t, a);
- n ? o = r : o[a] = r
- }),
- o
- }
- ,
- eT.retrieveVisuals = function(t) {
- var e, i = {};
- return t && JI(iT, function(n, o) {
- t.hasOwnProperty(o) && (i[o] = t[o],
- e = !0)
- }),
- e ? i : null
- }
- ,
- eT.prepareVisualTypes = function(t) {
- if (QI(t)) {
- var e = [];
- JI(t, function(t, i) {
- e.push(i)
- }),
- t = e
- } else {
- if (!v(t))
- return [];
- t = t.slice()
- }
- return t.sort(function(t, e) {
- return "color" === e && "color" !== t && 0 === t.indexOf("color") ? 1 : -1
- }),
- t
- }
- ,
- eT.dependsOn = function(t, e) {
- return "color" === e ? !(!t || 0 !== t.indexOf(e)) : t === e
- }
- ,
- eT.findPieceIndex = function(t, e, i) {
- function n(e, i) {
- var n = Math.abs(e - t);
- n < a && (a = n,
- o = i)
- }
- for (var o, a = 1 / 0, r = 0, s = e.length; r < s; r++) {
- var l = e[r].value;
- if (null != l) {
- if (l === t || "string" == typeof l && l === t + "")
- return r;
- i && n(l, r)
- }
- }
- for (var r = 0, s = e.length; r < s; r++) {
- var h = e[r]
- , u = h.interval
- , c = h.close;
- if (u) {
- if (u[0] === -1 / 0) {
- if (Kh(c[1], t, u[1]))
- return r
- } else if (u[1] === 1 / 0) {
- if (Kh(c[0], u[0], t))
- return r
- } else if (Kh(c[0], u[0], t) && Kh(c[1], t, u[1]))
- return r;
- i && n(u[0], r),
- i && n(u[1], r)
- }
- }
- if (i)
- return t === 1 / 0 ? e.length - 1 : t === -1 / 0 ? 0 : o
- }
- ;
- var oT = v
- , aT = "itemStyle.normal"
- , rT = Math.max
- , sT = Math.min
- , lT = M
- , hT = c
- , uT = ["itemStyle", "normal", "borderWidth"]
- , cT = ["itemStyle", "normal", "gapWidth"]
- , dT = ["upperLabel", "normal", "show"]
- , fT = ["upperLabel", "normal", "height"];
- or(function(t, e, i) {
- var n = {
- mainType: "series",
- subType: "treemap",
- query: i
- };
- t.eachComponent(n, function(t) {
- var e = t.getData().tree
- , i = e.root
- , n = t.getModel(aT);
- i.isRemoved() || Jh(i, {}, d(e.levelModels, function(t) {
- return t ? t.get(aT) : null
- }), n, t.getViewRoot().getAncestors(), t)
- })
- }),
- nr(function(t, e, i) {
- var n = {
- mainType: "series",
- subType: "treemap",
- query: i
- };
- t.eachComponent(n, function(t) {
- var n = e.getWidth()
- , a = e.getHeight()
- , r = t.option
- , s = Yo(t.getBoxLayoutParams(), {
- width: e.getWidth(),
- height: e.getHeight()
- })
- , l = r.size || []
- , h = bi(lT(s.width, l[0]), n)
- , u = bi(lT(s.height, l[1]), a)
- , c = i && i.type
- , d = Ch(i, t)
- , f = "treemapRender" === c || "treemapMove" === c ? i.rootRect : null
- , g = t.getViewRoot()
- , p = Dh(g);
- if ("treemapMove" !== c) {
- var m = "treemapZoomToNode" === c ? fu(t, d, g, h, u) : f ? [f.width, f.height] : [h, u]
- , v = r.sort;
- v && "asc" !== v && "desc" !== v && (v = "desc");
- var y = {
- squareRatio: r.squareRatio,
- sort: v,
- leafDepth: r.leafDepth
- };
- g.hostTree.clearLayouts(),
- x = {
- x: 0,
- y: 0,
- width: m[0],
- height: m[1],
- area: m[0] * m[1]
- },
- g.setLayout(x),
- ru(g, y, !1, 0);
- var x = g.getLayout();
- hT(p, function(t, e) {
- var i = (p[e + 1] || g).getValue();
- t.setLayout(o({
- dataExtent: [i, i],
- borderWidth: 0,
- upperHeight: 0
- }, x))
- })
- }
- var _ = t.getData().tree.root;
- _.setLayout(gu(s, f, d), !0),
- t.setLayoutInfo(s),
- pu(_, new jt(-s.x,-s.y,n,a), p, g, 0)
- })
- });
- var gT = function(t) {
- this._directed = t || !1,
- this.nodes = [],
- this.edges = [],
- this._nodesMap = {},
- this._edgesMap = {},
- this.data,
- this.edgeData
- }
- , pT = gT.prototype;
- pT.type = "graph",
- pT.isDirected = function() {
- return this._directed
- }
- ,
- pT.addNode = function(t, e) {
- t = t || "" + e;
- var i = this._nodesMap;
- if (!i[vu(t)]) {
- var n = new yu(t,e);
- return n.hostGraph = this,
- this.nodes.push(n),
- i[vu(t)] = n,
- n
- }
- }
- ,
- pT.getNodeByIndex = function(t) {
- var e = this.data.getRawIndex(t);
- return this.nodes[e]
- }
- ,
- pT.getNodeById = function(t) {
- return this._nodesMap[vu(t)]
- }
- ,
- pT.addEdge = function(t, e, i) {
- var n = this._nodesMap
- , o = this._edgesMap;
- if ("number" == typeof t && (t = this.nodes[t]),
- "number" == typeof e && (e = this.nodes[e]),
- t instanceof yu || (t = n[vu(t)]),
- e instanceof yu || (e = n[vu(e)]),
- t && e) {
- var a = t.id + "-" + e.id;
- if (!o[a]) {
- var r = new xu(t,e,i);
- return r.hostGraph = this,
- this._directed && (t.outEdges.push(r),
- e.inEdges.push(r)),
- t.edges.push(r),
- t !== e && e.edges.push(r),
- this.edges.push(r),
- o[a] = r,
- r
- }
- }
- }
- ,
- pT.getEdgeByIndex = function(t) {
- var e = this.edgeData.getRawIndex(t);
- return this.edges[e]
- }
- ,
- pT.getEdge = function(t, e) {
- t instanceof yu && (t = t.id),
- e instanceof yu && (e = e.id);
- var i = this._edgesMap;
- return this._directed ? i[t + "-" + e] : i[t + "-" + e] || i[e + "-" + t]
- }
- ,
- pT.eachNode = function(t, e) {
- for (var i = this.nodes, n = i.length, o = 0; o < n; o++)
- i[o].dataIndex >= 0 && t.call(e, i[o], o)
- }
- ,
- pT.eachEdge = function(t, e) {
- for (var i = this.edges, n = i.length, o = 0; o < n; o++)
- i[o].dataIndex >= 0 && i[o].node1.dataIndex >= 0 && i[o].node2.dataIndex >= 0 && t.call(e, i[o], o)
- }
- ,
- pT.breadthFirstTraverse = function(t, e, i, n) {
- if (e instanceof yu || (e = this._nodesMap[vu(e)]),
- e) {
- for (var o = "out" === i ? "outEdges" : "in" === i ? "inEdges" : "edges", a = 0; a < this.nodes.length; a++)
- this.nodes[a].__visited = !1;
- if (!t.call(n, e, null))
- for (var r = [e]; r.length; )
- for (var s = r.shift(), l = s[o], a = 0; a < l.length; a++) {
- var h = l[a]
- , u = h.node1 === s ? h.node2 : h.node1;
- if (!u.__visited) {
- if (t.call(n, u, s))
- return;
- r.push(u),
- u.__visited = !0
- }
- }
- }
- }
- ,
- pT.update = function() {
- for (var t = this.data, e = this.edgeData, i = this.nodes, n = this.edges, o = 0, a = i.length; o < a; o++)
- i[o].dataIndex = -1;
- for (var o = 0, a = t.count(); o < a; o++)
- i[t.getRawIndex(o)].dataIndex = o;
- e.filterSelf(function(t) {
- var i = n[e.getRawIndex(t)];
- return i.node1.dataIndex >= 0 && i.node2.dataIndex >= 0
- });
- for (var o = 0, a = n.length; o < a; o++)
- n[o].dataIndex = -1;
- for (var o = 0, a = e.count(); o < a; o++)
- n[e.getRawIndex(o)].dataIndex = o
- }
- ,
- pT.clone = function() {
- for (var t = new gT(this._directed), e = this.nodes, i = this.edges, n = 0; n < e.length; n++)
- t.addNode(e[n].id, e[n].dataIndex);
- for (n = 0; n < i.length; n++) {
- var o = i[n];
- t.addEdge(o.node1.id, o.node2.id, o.dataIndex)
- }
- return t
- }
- ,
- yu.prototype = {
- constructor: yu,
- degree: function() {
- return this.edges.length
- },
- inDegree: function() {
- return this.inEdges.length
- },
- outDegree: function() {
- return this.outEdges.length
- },
- getModel: function(t) {
- if (!(this.dataIndex < 0))
- return this.hostGraph.data.getItemModel(this.dataIndex).getModel(t)
- }
- },
- xu.prototype.getModel = function(t) {
- if (!(this.dataIndex < 0))
- return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)
- }
- ;
- var mT = function(t, e) {
- return {
- getValue: function(i) {
- var n = this[t][e];
- return n.get(n.getDimension(i || "value"), this.dataIndex)
- },
- setVisual: function(i, n) {
- this.dataIndex >= 0 && this[t][e].setItemVisual(this.dataIndex, i, n)
- },
- getVisual: function(i, n) {
- return this[t][e].getItemVisual(this.dataIndex, i, n)
- },
- setLayout: function(i, n) {
- this.dataIndex >= 0 && this[t][e].setItemLayout(this.dataIndex, i, n)
- },
- getLayout: function() {
- return this[t][e].getItemLayout(this.dataIndex)
- },
- getGraphicEl: function() {
- return this[t][e].getItemGraphicEl(this.dataIndex)
- },
- getRawIndex: function() {
- return this[t][e].getRawIndex(this.dataIndex)
- }
- }
- };
- h(yu, mT("hostGraph", "data")),
- h(xu, mT("hostGraph", "edgeData")),
- gT.Node = yu,
- gT.Edge = xu;
- var vT = function(t, e, i, n, o) {
- for (var a = new gT(n), r = 0; r < t.length; r++)
- a.addNode(M(t[r].id, t[r].name, r), r);
- for (var s = [], l = [], h = 0, r = 0; r < e.length; r++) {
- var u = e[r]
- , c = u.source
- , d = u.target;
- a.addEdge(c, d, h) && (l.push(u),
- s.push(M(u.id, c + " > " + d)),
- h++)
- }
- var f, g = i.get("coordinateSystem");
- if ("cartesian2d" === g || "polar" === g)
- f = br(t, i, i.ecModel);
- else {
- var p = ha.get(g)
- , m = vr((p && "view" !== p.type ? p.dimensions || [] : []).concat(["value"]), t);
- (f = new lS(m,i)).initData(t)
- }
- var v = new lS(["value"],i);
- return v.initData(l, s),
- o && o(f, v),
- Jl({
- mainData: f,
- struct: a,
- structAttr: "graph",
- datas: {
- node: f,
- edge: v
- },
- datasAttr: {
- node: "data",
- edge: "edgeData"
- }
- }),
- a.update(),
- a
- }
- , yT = lr({
- type: "series.graph",
- init: function(t) {
- yT.superApply(this, "init", arguments),
- this.legendDataProvider = function() {
- return this._categoriesData
- }
- ,
- this.fillDataTextStyle(t.edges || t.links),
- this._updateCategoriesData()
- },
- mergeOption: function(t) {
- yT.superApply(this, "mergeOption", arguments),
- this.fillDataTextStyle(t.edges || t.links),
- this._updateCategoriesData()
- },
- mergeDefaultAndTheme: function(t) {
- yT.superApply(this, "mergeDefaultAndTheme", arguments),
- Po(t.edgeLabel, ["show"])
- },
- getInitialData: function(t, e) {
- var i = t.edges || t.links || []
- , n = t.data || t.nodes || []
- , o = this;
- if (n && i)
- return vT(n, i, this, !0, function(t, i) {
- function n(t) {
- return (t = this.parsePath(t)) && "label" === t[0] ? r : this.parentModel
- }
- t.wrapMethod("getItemModel", function(t) {
- var e = o._categoriesModels[t.getShallow("category")];
- return e && (e.parentModel = t.parentModel,
- t.parentModel = e),
- t
- });
- var a = o.getModel("edgeLabel")
- , r = new Co({
- label: a.option
- },a.parentModel,e);
- i.wrapMethod("getItemModel", function(t) {
- return t.customizeGetParent(n),
- t
- })
- }).data
- },
- getGraph: function() {
- return this.getData().graph
- },
- getEdgeData: function() {
- return this.getGraph().edgeData
- },
- getCategoriesData: function() {
- return this._categoriesData
- },
- formatTooltip: function(t, e, i) {
- if ("edge" === i) {
- var n = this.getData()
- , o = this.getDataParams(t, i)
- , a = n.graph.getEdgeByIndex(t)
- , r = n.getName(a.node1.dataIndex)
- , s = n.getName(a.node2.dataIndex)
- , l = [];
- return null != r && l.push(r),
- null != s && l.push(s),
- l = Vi(l.join(" > ")),
- o.value && (l += " : " + Vi(o.value)),
- l
- }
- return yT.superApply(this, "formatTooltip", arguments)
- },
- _updateCategoriesData: function() {
- var t = d(this.option.categories || [], function(t) {
- return null != t.value ? t : o({
- value: 0
- }, t)
- })
- , e = new lS(["value"],this);
- e.initData(t),
- this._categoriesData = e,
- this._categoriesModels = e.mapArray(function(t) {
- return e.getItemModel(t, !0)
- })
- },
- setZoom: function(t) {
- this.option.zoom = t
- },
- setCenter: function(t) {
- this.option.center = t
- },
- isAnimationEnabled: function() {
- return yT.superCall(this, "isAnimationEnabled") && !("force" === this.get("layout") && this.get("force.layoutAnimation"))
- },
- defaultOption: {
- zlevel: 0,
- z: 2,
- coordinateSystem: "view",
- legendHoverLink: !0,
- hoverAnimation: !0,
- layout: null,
- focusNodeAdjacency: !1,
- circular: {
- rotateLabel: !1
- },
- force: {
- initLayout: null,
- repulsion: [0, 50],
- gravity: .1,
- edgeLength: 30,
- layoutAnimation: !0
- },
- left: "center",
- top: "center",
- symbol: "circle",
- symbolSize: 10,
- edgeSymbol: ["none", "none"],
- edgeSymbolSize: 10,
- edgeLabel: {
- normal: {
- position: "middle"
- },
- emphasis: {}
- },
- draggable: !1,
- roam: !1,
- center: null,
- zoom: 1,
- nodeScaleRatio: .6,
- label: {
- normal: {
- show: !1,
- formatter: "{b}"
- },
- emphasis: {
- show: !0
- }
- },
- itemStyle: {
- normal: {},
- emphasis: {}
- },
- lineStyle: {
- normal: {
- color: "#aaa",
- width: 1,
- curveness: 0,
- opacity: .5
- },
- emphasis: {}
- }
- }
- })
- , xT = mb.prototype
- , _T = yb.prototype
- , bT = Hn({
- type: "ec-line",
- style: {
- stroke: "#000",
- fill: null
- },
- shape: {
- x1: 0,
- y1: 0,
- x2: 0,
- y2: 0,
- percent: 1,
- cpx1: null,
- cpy1: null
- },
- buildPath: function(t, e) {
- (_u(e) ? xT : _T).buildPath(t, e)
- },
- pointAt: function(t) {
- return _u(this.shape) ? xT.pointAt.call(this, t) : _T.pointAt.call(this, t)
- },
- tangentAt: function(t) {
- var e = this.shape
- , i = _u(e) ? [e.x2 - e.x1, e.y2 - e.y1] : _T.tangentAt.call(this, t);
- return U(i, i)
- }
- })
- , wT = ["fromSymbol", "toSymbol"]
- , ST = Iu.prototype;
- ST.beforeUpdate = function() {
- var t = this
- , e = t.childOfName("fromSymbol")
- , i = t.childOfName("toSymbol")
- , n = t.childOfName("label");
- if (e || i || !n.ignore) {
- for (var o = 1, a = this.parent; a; )
- a.scale && (o /= a.scale[0]),
- a = a.parent;
- var r = t.childOfName("line");
- if (this.__dirty || r.__dirty) {
- var s = r.shape.percent
- , l = r.pointAt(0)
- , h = r.pointAt(s)
- , u = W([], h, l);
- if (U(u, u),
- e && (e.attr("position", l),
- c = r.tangentAt(0),
- e.attr("rotation", Math.PI / 2 - Math.atan2(c[1], c[0])),
- e.attr("scale", [o * s, o * s])),
- i) {
- i.attr("position", h);
- var c = r.tangentAt(1);
- i.attr("rotation", -Math.PI / 2 - Math.atan2(c[1], c[0])),
- i.attr("scale", [o * s, o * s])
- }
- if (!n.ignore) {
- n.attr("position", h);
- var d, f, g, p = 5 * o;
- if ("end" === n.__position)
- d = [u[0] * p + h[0], u[1] * p + h[1]],
- f = u[0] > .8 ? "left" : u[0] < -.8 ? "right" : "center",
- g = u[1] > .8 ? "top" : u[1] < -.8 ? "bottom" : "middle";
- else if ("middle" === n.__position) {
- var m = s / 2
- , v = [(c = r.tangentAt(m))[1], -c[0]]
- , y = r.pointAt(m);
- v[1] > 0 && (v[0] = -v[0],
- v[1] = -v[1]),
- d = [y[0] + v[0] * p, y[1] + v[1] * p],
- f = "center",
- g = "bottom";
- var x = -Math.atan2(c[1], c[0]);
- h[0] < l[0] && (x = Math.PI + x),
- n.attr("rotation", x)
- } else
- d = [-u[0] * p + l[0], -u[1] * p + l[1]],
- f = u[0] > .8 ? "right" : u[0] < -.8 ? "left" : "center",
- g = u[1] > .8 ? "bottom" : u[1] < -.8 ? "top" : "middle";
- n.attr({
- style: {
- textVerticalAlign: n.__verticalAlign || g,
- textAlign: n.__textAlign || f
- },
- position: d,
- scale: [o, o]
- })
- }
- }
- }
- }
- ,
- ST._createLine = function(t, e, i) {
- var n = t.hostModel
- , o = Su(t.getItemLayout(e));
- o.shape.percent = 0,
- bo(o, {
- shape: {
- percent: 1
- }
- }, n, e),
- this.add(o);
- var a = new ab({
- name: "label"
- });
- this.add(a),
- c(wT, function(i) {
- var n = wu(i, t, e);
- this.add(n),
- this[bu(i)] = t.getItemVisual(e, i)
- }, this),
- this._updateCommonStl(t, e, i)
- }
- ,
- ST.updateData = function(t, e, i) {
- var n = t.hostModel
- , o = this.childOfName("line")
- , a = t.getItemLayout(e)
- , r = {
- shape: {}
- };
- Mu(r.shape, a),
- _o(o, r, n, e),
- c(wT, function(i) {
- var n = t.getItemVisual(e, i)
- , o = bu(i);
- if (this[o] !== n) {
- this.remove(this.childOfName(i));
- var a = wu(i, t, e);
- this.add(a)
- }
- this[o] = n
- }, this),
- this._updateCommonStl(t, e, i)
- }
- ,
- ST._updateCommonStl = function(t, e, i) {
- var n = t.hostModel
- , o = this.childOfName("line")
- , r = i && i.lineStyle
- , s = i && i.hoverLineStyle
- , l = i && i.labelModel
- , h = i && i.hoverLabelModel;
- if (!i || t.hasItemOption) {
- var u = t.getItemModel(e);
- r = u.getModel("lineStyle.normal").getLineStyle(),
- s = u.getModel("lineStyle.emphasis").getLineStyle(),
- l = u.getModel("label.normal"),
- h = u.getModel("label.emphasis")
- }
- var d = t.getItemVisual(e, "color")
- , f = T(t.getItemVisual(e, "opacity"), r.opacity, 1);
- o.useStyle(a({
- strokeNoScale: !0,
- fill: "none",
- stroke: d,
- opacity: f
- }, r)),
- o.hoverStyle = s,
- c(wT, function(t) {
- var e = this.childOfName(t);
- e && (e.setColor(d),
- e.setStyle({
- opacity: f
- }))
- }, this);
- var g, p, m, v, y = l.getShallow("show"), x = h.getShallow("show"), _ = this.childOfName("label");
- if (y || x) {
- var b = n.getRawValue(e);
- p = null == b ? p = t.getName(e) : isFinite(b) ? wi(b) : b,
- g = d || "#000",
- m = I(n.getFormattedLabel(e, "normal", t.dataType), p),
- v = I(n.getFormattedLabel(e, "emphasis", t.dataType), m)
- }
- if (y) {
- var w = uo(_.style, l, {
- text: m
- }, {
- autoColor: g
- });
- _.__textAlign = w.textAlign,
- _.__verticalAlign = w.textVerticalAlign,
- _.__position = l.get("position") || "middle"
- } else
- _.setStyle("text", null);
- _.hoverStyle = x ? {
- text: v,
- textFill: h.getTextColor(!0),
- fontStyle: h.getShallow("fontStyle"),
- fontWeight: h.getShallow("fontWeight"),
- fontSize: h.getShallow("fontSize"),
- fontFamily: h.getShallow("fontFamily")
- } : {
- text: null
- },
- _.ignore = !y && !x,
- lo(this)
- }
- ,
- ST.highlight = function() {
- this.trigger("emphasis")
- }
- ,
- ST.downplay = function() {
- this.trigger("normal")
- }
- ,
- ST.updateLayout = function(t, e) {
- this.setLinePoints(t.getItemLayout(e))
- }
- ,
- ST.setLinePoints = function(t) {
- var e = this.childOfName("line");
- Mu(e.shape, t),
- e.dirty()
- }
- ,
- l(Iu, $y);
- var MT = Cu.prototype;
- MT.updateData = function(t) {
- var e = this._lineData
- , i = this.group
- , n = this._ctor
- , o = t.hostModel
- , a = {
- lineStyle: o.getModel("lineStyle.normal").getLineStyle(),
- hoverLineStyle: o.getModel("lineStyle.emphasis").getLineStyle(),
- labelModel: o.getModel("label.normal"),
- hoverLabelModel: o.getModel("label.emphasis")
- };
- t.diff(e).add(function(e) {
- if (Au(t.getItemLayout(e))) {
- var o = new n(t,e,a);
- t.setItemGraphicEl(e, o),
- i.add(o)
- }
- }).update(function(o, r) {
- var s = e.getItemGraphicEl(r);
- Au(t.getItemLayout(o)) ? (s ? s.updateData(t, o, a) : s = new n(t,o,a),
- t.setItemGraphicEl(o, s),
- i.add(s)) : i.remove(s)
- }).remove(function(t) {
- i.remove(e.getItemGraphicEl(t))
- }).execute(),
- this._lineData = t
- }
- ,
- MT.updateLayout = function() {
- var t = this._lineData;
- t.eachItemGraphicEl(function(e, i) {
- e.updateLayout(t, i)
- }, this)
- }
- ,
- MT.remove = function() {
- this.group.removeAll()
- }
- ;
- var IT = []
- , TT = []
- , AT = []
- , CT = ln
- , DT = fy
- , LT = Math.abs
- , kT = function(t, e) {
- function i(t) {
- var e = t.getVisual("symbolSize");
- return e instanceof Array && (e = (e[0] + e[1]) / 2),
- e
- }
- var n = []
- , o = dn
- , a = [[], [], []]
- , r = [[], []]
- , s = [];
- e /= 2,
- t.eachEdge(function(t, l) {
- var h = t.getLayout()
- , u = t.getVisual("fromSymbol")
- , c = t.getVisual("toSymbol");
- h.__original || (h.__original = [R(h[0]), R(h[1])],
- h[2] && h.__original.push(R(h[2])));
- var d = h.__original;
- if (null != h[2]) {
- if (E(a[0], d[0]),
- E(a[1], d[2]),
- E(a[2], d[1]),
- u && "none" != u) {
- var f = i(t.node1)
- , g = Du(a, d[0], f * e);
- o(a[0][0], a[1][0], a[2][0], g, n),
- a[0][0] = n[3],
- a[1][0] = n[4],
- o(a[0][1], a[1][1], a[2][1], g, n),
- a[0][1] = n[3],
- a[1][1] = n[4]
- }
- if (c && "none" != c) {
- var f = i(t.node2)
- , g = Du(a, d[1], f * e);
- o(a[0][0], a[1][0], a[2][0], g, n),
- a[1][0] = n[1],
- a[2][0] = n[2],
- o(a[0][1], a[1][1], a[2][1], g, n),
- a[1][1] = n[1],
- a[2][1] = n[2]
- }
- E(h[0], a[0]),
- E(h[1], a[2]),
- E(h[2], a[1])
- } else {
- if (E(r[0], d[0]),
- E(r[1], d[1]),
- W(s, r[1], r[0]),
- U(s, s),
- u && "none" != u) {
- f = i(t.node1);
- G(r[0], r[0], s, f * e)
- }
- if (c && "none" != c) {
- f = i(t.node2);
- G(r[1], r[1], s, -f * e)
- }
- E(h[0], r[0]),
- E(h[1], r[1])
- }
- })
- }
- , PT = ["itemStyle", "normal", "opacity"]
- , OT = ["lineStyle", "normal", "opacity"];
- hr({
- type: "graph",
- init: function(t, e) {
- var i = new Qr
- , n = new Cu
- , o = this.group;
- this._controller = new Nl(e.getZr()),
- this._controllerHost = {
- target: o
- },
- o.add(i.group),
- o.add(n.group),
- this._symbolDraw = i,
- this._lineDraw = n,
- this._firstRender = !0
- },
- render: function(t, e, i) {
- var n = t.coordinateSystem;
- this._model = t,
- this._nodeScaleRatio = t.get("nodeScaleRatio");
- var o = this._symbolDraw
- , a = this._lineDraw
- , r = this.group;
- if ("view" === n.type) {
- var s = {
- position: n.position,
- scale: n.scale
- };
- this._firstRender ? r.attr(s) : _o(r, s, t)
- }
- kT(t.getGraph(), this._getNodeGlobalScale(t));
- var l = t.getData();
- o.updateData(l);
- var h = t.getEdgeData();
- a.updateData(h),
- this._updateNodeAndLinkScale(),
- this._updateController(t, e, i),
- clearTimeout(this._layoutTimeout);
- var u = t.forceLayout
- , c = t.get("force.layoutAnimation");
- u && this._startForceLayoutIteration(u, c),
- l.eachItemGraphicEl(function(e, n) {
- var o = l.getItemModel(n);
- e.off("drag").off("dragend");
- var a = l.getItemModel(n).get("draggable");
- a && e.on("drag", function() {
- u && (u.warmUp(),
- !this._layouting && this._startForceLayoutIteration(u, c),
- u.setFixed(n),
- l.setItemLayout(n, e.position))
- }, this).on("dragend", function() {
- u && u.setUnfixed(n)
- }, this),
- e.setDraggable(a && u),
- e.off("mouseover", e.__focusNodeAdjacency),
- e.off("mouseout", e.__unfocusNodeAdjacency),
- o.get("focusNodeAdjacency") && (e.on("mouseover", e.__focusNodeAdjacency = function() {
- i.dispatchAction({
- type: "focusNodeAdjacency",
- seriesId: t.id,
- dataIndex: e.dataIndex
- })
- }
- ),
- e.on("mouseout", e.__unfocusNodeAdjacency = function() {
- i.dispatchAction({
- type: "unfocusNodeAdjacency",
- seriesId: t.id
- })
- }
- ))
- }, this),
- l.graph.eachEdge(function(e) {
- var n = e.getGraphicEl();
- n.off("mouseover", n.__focusNodeAdjacency),
- n.off("mouseout", n.__unfocusNodeAdjacency),
- e.getModel().get("focusNodeAdjacency") && (n.on("mouseover", n.__focusNodeAdjacency = function() {
- i.dispatchAction({
- type: "focusNodeAdjacency",
- seriesId: t.id,
- edgeDataIndex: e.dataIndex
- })
- }
- ),
- n.on("mouseout", n.__unfocusNodeAdjacency = function() {
- i.dispatchAction({
- type: "unfocusNodeAdjacency",
- seriesId: t.id
- })
- }
- ))
- });
- var d = "circular" === t.get("layout") && t.get("circular.rotateLabel")
- , f = l.getLayout("cx")
- , g = l.getLayout("cy");
- l.eachItemGraphicEl(function(t, e) {
- var i = t.getSymbolPath();
- if (d) {
- var n = l.getItemLayout(e)
- , o = Math.atan2(n[1] - g, n[0] - f);
- o < 0 && (o = 2 * Math.PI + o);
- var a = n[0] < f;
- a && (o -= Math.PI);
- var r = a ? "left" : "right";
- i.setStyle({
- textRotation: -o,
- textPosition: r,
- textOrigin: "center"
- }),
- i.hoverStyle && (i.hoverStyle.textPosition = r)
- } else
- i.setStyle({
- textRotation: 0
- })
- }),
- this._firstRender = !1
- },
- dispose: function() {
- this._controller && this._controller.dispose(),
- this._controllerHost = {}
- },
- focusNodeAdjacency: function(t, e, i, n) {
- var o = this._model.getData().graph
- , a = n.dataIndex
- , r = n.edgeDataIndex
- , s = o.getNodeByIndex(a)
- , l = o.getEdgeByIndex(r);
- (s || l) && (o.eachNode(function(t) {
- ku(t, PT, .1)
- }),
- o.eachEdge(function(t) {
- ku(t, OT, .1)
- }),
- s && (Pu(s, PT),
- c(s.edges, function(t) {
- t.dataIndex < 0 || (Pu(t, OT),
- Pu(t.node1, PT),
- Pu(t.node2, PT))
- })),
- l && (Pu(l, OT),
- Pu(l.node1, PT),
- Pu(l.node2, PT)))
- },
- unfocusNodeAdjacency: function(t, e, i, n) {
- var o = this._model.getData().graph;
- o.eachNode(function(t) {
- ku(t, PT)
- }),
- o.eachEdge(function(t) {
- ku(t, OT)
- })
- },
- _startForceLayoutIteration: function(t, e) {
- var i = this;
- !function n() {
- t.step(function(t) {
- i.updateLayout(i._model),
- (i._layouting = !t) && (e ? i._layoutTimeout = setTimeout(n, 16) : n())
- })
- }()
- },
- _updateController: function(t, e, i) {
- var n = this._controller
- , o = this._controllerHost
- , a = this.group;
- n.setPointerChecker(function(e, n, o) {
- var r = a.getBoundingRect();
- return r.applyTransform(a.transform),
- r.contain(n, o) && !Ul(e, i, t)
- }),
- "view" === t.coordinateSystem.type ? (n.enable(t.get("roam")),
- o.zoomLimit = t.get("scaleLimit"),
- o.zoom = t.coordinateSystem.getZoom(),
- n.off("pan").off("zoom").on("pan", function(e, n) {
- Fl(o, e, n),
- i.dispatchAction({
- seriesId: t.id,
- type: "graphRoam",
- dx: e,
- dy: n
- })
- }).on("zoom", function(e, n, a) {
- Zl(o, e, n, a),
- i.dispatchAction({
- seriesId: t.id,
- type: "graphRoam",
- zoom: e,
- originX: n,
- originY: a
- }),
- this._updateNodeAndLinkScale(),
- kT(t.getGraph(), this._getNodeGlobalScale(t)),
- this._lineDraw.updateLayout()
- }, this)) : n.disable()
- },
- _updateNodeAndLinkScale: function() {
- var t = this._model
- , e = t.getData()
- , i = this._getNodeGlobalScale(t)
- , n = [i, i];
- e.eachItemGraphicEl(function(t, e) {
- t.attr("scale", n)
- })
- },
- _getNodeGlobalScale: function(t) {
- var e = t.coordinateSystem;
- if ("view" !== e.type)
- return 1;
- var i = this._nodeScaleRatio
- , n = e.scale
- , o = n && n[0] || 1;
- return ((e.getZoom() - 1) * i + 1) / o
- },
- updateLayout: function(t) {
- kT(t.getGraph(), this._getNodeGlobalScale(t)),
- this._symbolDraw.updateLayout(),
- this._lineDraw.updateLayout()
- },
- remove: function(t, e) {
- this._symbolDraw && this._symbolDraw.remove(),
- this._lineDraw && this._lineDraw.remove()
- }
- }),
- er({
- type: "graphRoam",
- event: "graphRoam",
- update: "none"
- }, function(t, e) {
- e.eachComponent({
- mainType: "series",
- query: t
- }, function(e) {
- var i = $l(e.coordinateSystem, t);
- e.setCenter && e.setCenter(i.center),
- e.setZoom && e.setZoom(i.zoom)
- })
- }),
- er({
- type: "focusNodeAdjacency",
- event: "focusNodeAdjacency",
- update: "series.graph:focusNodeAdjacency"
- }, function() {}),
- er({
- type: "unfocusNodeAdjacency",
- event: "unfocusNodeAdjacency",
- update: "series.graph:unfocusNodeAdjacency"
- }, function() {});
- var zT = G;
- tr(function(t) {
- var e = t.findComponents({
- mainType: "legend"
- });
- e && e.length && t.eachSeriesByType("graph", function(t) {
- var i = t.getCategoriesData()
- , n = t.getGraph().data
- , o = i.mapArray(i.getName);
- n.filterSelf(function(t) {
- var i = n.getItemModel(t).getShallow("category");
- if (null != i) {
- "number" == typeof i && (i = o[i]);
- for (var a = 0; a < e.length; a++)
- if (!e[a].isSelected(i))
- return !1
- }
- return !0
- })
- }, this)
- }),
- or(m(mM, "graph", "circle", null)),
- or(function(t) {
- var e = {};
- t.eachSeriesByType("graph", function(t) {
- var i = t.getCategoriesData()
- , n = t.getData()
- , o = {};
- i.each(function(n) {
- var a = i.getName(n);
- o["ec-" + a] = n;
- var r = i.getItemModel(n).get("itemStyle.normal.color") || t.getColorFromPalette(a, e);
- i.setItemVisual(n, "color", r)
- }),
- i.count() && n.each(function(t) {
- var e = n.getItemModel(t).getShallow("category");
- null != e && ("string" == typeof e && (e = o["ec-" + e]),
- n.getItemVisual(t, "color", !0) || n.setItemVisual(t, "color", i.getItemVisual(e, "color")))
- })
- })
- }),
- or(function(t) {
- t.eachSeriesByType("graph", function(t) {
- var e = t.getGraph()
- , i = t.getEdgeData()
- , n = Ou(t.get("edgeSymbol"))
- , o = Ou(t.get("edgeSymbolSize"))
- , a = "lineStyle.normal.color".split(".")
- , r = "lineStyle.normal.opacity".split(".");
- i.setVisual("fromSymbol", n && n[0]),
- i.setVisual("toSymbol", n && n[1]),
- i.setVisual("fromSymbolSize", o && o[0]),
- i.setVisual("toSymbolSize", o && o[1]),
- i.setVisual("color", t.get(a)),
- i.setVisual("opacity", t.get(r)),
- i.each(function(t) {
- var n = i.getItemModel(t)
- , o = e.getEdgeByIndex(t)
- , s = Ou(n.getShallow("symbol", !0))
- , l = Ou(n.getShallow("symbolSize", !0))
- , h = n.get(a)
- , u = n.get(r);
- switch (h) {
- case "source":
- h = o.node1.getVisual("color");
- break;
- case "target":
- h = o.node2.getVisual("color")
- }
- s[0] && o.setVisual("fromSymbol", s[0]),
- s[1] && o.setVisual("toSymbol", s[1]),
- l[0] && o.setVisual("fromSymbolSize", l[0]),
- l[1] && o.setVisual("toSymbolSize", l[1]),
- o.setVisual("color", h),
- o.setVisual("opacity", u)
- })
- })
- }),
- nr(function(t, e) {
- t.eachSeriesByType("graph", function(t) {
- var e = t.get("layout")
- , i = t.coordinateSystem;
- if (i && "view" !== i.type) {
- var n = t.getData()
- , o = i.dimensions;
- n.each(o, function() {
- for (var t, e = arguments, a = [], r = 0; r < o.length; r++)
- isNaN(e[r]) || (t = !0),
- a.push(e[r]);
- var s = e[e.length - 1];
- t ? n.setItemLayout(s, i.dataToPoint(a)) : n.setItemLayout(s, [NaN, NaN])
- }),
- Nu(n.graph)
- } else
- e && "none" !== e || zu(t)
- })
- }),
- nr(function(t) {
- t.eachSeriesByType("graph", function(t) {
- "circular" === t.get("layout") && Eu(t)
- })
- }),
- nr(function(t) {
- t.eachSeriesByType("graph", function(t) {
- var e = t.coordinateSystem;
- if (!e || "view" === e.type)
- if ("force" === t.get("layout")) {
- var i = t.preservedPoints || {}
- , n = t.getGraph()
- , o = n.data
- , a = n.edgeData
- , r = t.getModel("force")
- , s = r.get("initLayout");
- t.preservedPoints ? o.each(function(t) {
- var e = o.getId(t);
- o.setItemLayout(t, i[e] || [NaN, NaN])
- }) : s && "none" !== s ? "circular" === s && Eu(t) : zu(t);
- var l = o.getDataExtent("value")
- , h = a.getDataExtent("value")
- , u = r.get("repulsion")
- , c = r.get("edgeLength");
- v(u) || (u = [u, u]),
- v(c) || (c = [c, c]),
- c = [c[1], c[0]];
- var d = o.mapArray("value", function(t, e) {
- var i = o.getItemLayout(e)
- , n = _i(t, l, u);
- return isNaN(n) && (n = (u[0] + u[1]) / 2),
- {
- w: n,
- rep: n,
- fixed: o.getItemModel(e).get("fixed"),
- p: !i || isNaN(i[0]) || isNaN(i[1]) ? null : i
- }
- })
- , f = a.mapArray("value", function(t, e) {
- var i = n.getEdgeByIndex(e)
- , o = _i(t, h, c);
- return isNaN(o) && (o = (c[0] + c[1]) / 2),
- {
- n1: d[i.node1.dataIndex],
- n2: d[i.node2.dataIndex],
- d: o,
- curveness: i.getModel().get("lineStyle.normal.curveness") || 0
- }
- })
- , g = (e = t.coordinateSystem).getBoundingRect()
- , p = Ru(d, f, {
- rect: g,
- gravity: r.get("gravity")
- })
- , m = p.step;
- p.step = function(t) {
- for (var e = 0, a = d.length; e < a; e++)
- d[e].fixed && E(d[e].p, n.getNodeByIndex(e).getLayout());
- m(function(e, a, r) {
- for (var s = 0, l = e.length; s < l; s++)
- e[s].fixed || n.getNodeByIndex(s).setLayout(e[s].p),
- i[o.getId(s)] = e[s].p;
- for (var s = 0, l = a.length; s < l; s++) {
- var h = a[s]
- , u = n.getEdgeByIndex(s)
- , c = h.n1.p
- , d = h.n2.p
- , f = u.getLayout();
- (f = f ? f.slice() : [])[0] = f[0] || [],
- f[1] = f[1] || [],
- E(f[0], c),
- E(f[1], d),
- +h.curveness && (f[2] = [(c[0] + d[0]) / 2 - (c[1] - d[1]) * h.curveness, (c[1] + d[1]) / 2 - (d[0] - c[0]) * h.curveness]),
- u.setLayout(f)
- }
- t && t(r)
- })
- }
- ,
- t.forceLayout = p,
- t.preservedPoints = i,
- p.step()
- } else
- t.forceLayout = null
- })
- }),
- ir("graphView", {
- create: function(t, e) {
- var i = [];
- return t.eachSeriesByType("graph", function(t) {
- var n = t.get("coordinateSystem");
- if (!n || "view" === n) {
- var o = t.getData()
- , a = []
- , r = [];
- gn(o.mapArray(function(t) {
- var e = o.getItemModel(t);
- return [+e.get("x"), +e.get("y")]
- }), a, r),
- r[0] - a[0] == 0 && (r[0] += 1,
- a[0] -= 1),
- r[1] - a[1] == 0 && (r[1] += 1,
- a[1] -= 1);
- var s = (r[0] - a[0]) / (r[1] - a[1])
- , l = Vu(t, e, s);
- isNaN(s) && (a = [l.x, l.y],
- r = [l.x + l.width, l.y + l.height]);
- var h = r[0] - a[0]
- , u = r[1] - a[1]
- , c = l.width
- , d = l.height
- , f = t.coordinateSystem = new Il;
- f.zoomLimit = t.get("scaleLimit"),
- f.setBoundingRect(a[0], a[1], h, u),
- f.setViewRect(l.x, l.y, c, d),
- f.setCenter(t.get("center")),
- f.setZoom(t.get("zoom")),
- i.push(f)
- }
- }),
- i
- }
- });
- bw.extend({
- type: "series.gauge",
- getInitialData: function(t, e) {
- var i = new lS(["value"],this)
- , n = t.data || [];
- return v(n) || (n = [n]),
- i.initData(n),
- i
- },
- defaultOption: {
- zlevel: 0,
- z: 2,
- center: ["50%", "50%"],
- legendHoverLink: !0,
- radius: "75%",
- startAngle: 225,
- endAngle: -45,
- clockwise: !0,
- min: 0,
- max: 100,
- splitNumber: 10,
- axisLine: {
- show: !0,
- lineStyle: {
- color: [[.2, "#91c7ae"], [.8, "#63869e"], [1, "#c23531"]],
- width: 30
- }
- },
- splitLine: {
- show: !0,
- length: 30,
- lineStyle: {
- color: "#eee",
- width: 2,
- type: "solid"
- }
- },
- axisTick: {
- show: !0,
- splitNumber: 5,
- length: 8,
- lineStyle: {
- color: "#eee",
- width: 1,
- type: "solid"
- }
- },
- axisLabel: {
- show: !0,
- distance: 5,
- color: "auto"
- },
- pointer: {
- show: !0,
- length: "80%",
- width: 8
- },
- itemStyle: {
- normal: {
- color: "auto"
- }
- },
- title: {
- show: !0,
- offsetCenter: [0, "-40%"],
- color: "#333",
- fontSize: 15
- },
- detail: {
- show: !0,
- backgroundColor: "rgba(0,0,0,0)",
- borderWidth: 0,
- borderColor: "#ccc",
- width: 100,
- height: null,
- padding: [5, 10],
- offsetCenter: [0, "40%"],
- color: "auto",
- fontSize: 30
- }
- }
- });
- var NT = On.extend({
- type: "echartsGaugePointer",
- shape: {
- angle: 0,
- width: 10,
- r: 10,
- x: 0,
- y: 0
- },
- buildPath: function(t, e) {
- var i = Math.cos
- , n = Math.sin
- , o = e.r
- , a = e.width
- , r = e.angle
- , s = e.x - i(r) * a * (a >= o / 3 ? 1 : 2)
- , l = e.y - n(r) * a * (a >= o / 3 ? 1 : 2);
- r = e.angle - Math.PI / 2,
- t.moveTo(s, l),
- t.lineTo(e.x + i(r) * a, e.y + n(r) * a),
- t.lineTo(e.x + i(e.angle) * o, e.y + n(e.angle) * o),
- t.lineTo(e.x - i(r) * a, e.y - n(r) * a),
- t.lineTo(s, l)
- }
- })
- , ET = 2 * Math.PI
- , RT = (Ia.extend({
- type: "gauge",
- render: function(t, e, i) {
- this.group.removeAll();
- var n = t.get("axisLine.lineStyle.color")
- , o = Bu(t, i);
- this._renderMain(t, e, i, n, o)
- },
- dispose: function() {},
- _renderMain: function(t, e, i, n, o) {
- for (var a = this.group, r = t.getModel("axisLine").getModel("lineStyle"), s = t.get("clockwise"), l = -t.get("startAngle") / 180 * Math.PI, h = -t.get("endAngle") / 180 * Math.PI, u = (h - l) % ET, c = l, d = r.get("width"), f = 0; f < n.length; f++) {
- var g = Math.min(Math.max(n[f][0], 0), 1)
- , p = new hb({
- shape: {
- startAngle: c,
- endAngle: h = l + u * g,
- cx: o.cx,
- cy: o.cy,
- clockwise: s,
- r0: o.r - d,
- r: o.r
- },
- silent: !0
- });
- p.setStyle({
- fill: n[f][1]
- }),
- p.setStyle(r.getLineStyle(["color", "borderWidth", "borderColor"])),
- a.add(p),
- c = h
- }
- var m = function(t) {
- if (t <= 0)
- return n[0][1];
- for (var e = 0; e < n.length; e++)
- if (n[e][0] >= t && (0 === e ? 0 : n[e - 1][0]) < t)
- return n[e][1];
- return n[e - 1][1]
- };
- if (!s) {
- var v = l;
- l = h,
- h = v
- }
- this._renderTicks(t, e, i, m, o, l, h, s),
- this._renderPointer(t, e, i, m, o, l, h, s),
- this._renderTitle(t, e, i, m, o),
- this._renderDetail(t, e, i, m, o)
- },
- _renderTicks: function(t, e, i, n, o, a, r, s) {
- for (var l = this.group, h = o.cx, u = o.cy, c = o.r, d = +t.get("min"), f = +t.get("max"), g = t.getModel("splitLine"), p = t.getModel("axisTick"), m = t.getModel("axisLabel"), v = t.get("splitNumber"), y = p.get("splitNumber"), x = bi(g.get("length"), c), _ = bi(p.get("length"), c), b = a, w = (r - a) / v, S = w / y, M = g.getModel("lineStyle").getLineStyle(), I = p.getModel("lineStyle").getLineStyle(), T = 0; T <= v; T++) {
- var A = Math.cos(b)
- , C = Math.sin(b);
- if (g.get("show")) {
- var D = new mb({
- shape: {
- x1: A * c + h,
- y1: C * c + u,
- x2: A * (c - x) + h,
- y2: C * (c - x) + u
- },
- style: M,
- silent: !0
- });
- "auto" === M.stroke && D.setStyle({
- stroke: n(T / v)
- }),
- l.add(D)
- }
- if (m.get("show")) {
- var L = Gu(wi(T / v * (f - d) + d), m.get("formatter"))
- , k = m.get("distance")
- , P = n(T / v);
- l.add(new ab({
- style: uo({}, m, {
- text: L,
- x: A * (c - x - k) + h,
- y: C * (c - x - k) + u,
- textVerticalAlign: C < -.4 ? "top" : C > .4 ? "bottom" : "middle",
- textAlign: A < -.4 ? "left" : A > .4 ? "right" : "center"
- }, {
- autoColor: P
- }),
- silent: !0
- }))
- }
- if (p.get("show") && T !== v) {
- for (var O = 0; O <= y; O++) {
- var A = Math.cos(b)
- , C = Math.sin(b)
- , z = new mb({
- shape: {
- x1: A * c + h,
- y1: C * c + u,
- x2: A * (c - _) + h,
- y2: C * (c - _) + u
- },
- silent: !0,
- style: I
- });
- "auto" === I.stroke && z.setStyle({
- stroke: n((T + O / y) / v)
- }),
- l.add(z),
- b += S
- }
- b -= S
- } else
- b += w
- }
- },
- _renderPointer: function(t, e, i, n, o, a, r, s) {
- var l = this.group
- , h = this._data;
- if (t.get("pointer.show")) {
- var u = [+t.get("min"), +t.get("max")]
- , c = [a, r]
- , d = t.getData();
- d.diff(h).add(function(e) {
- var i = new NT({
- shape: {
- angle: a
- }
- });
- bo(i, {
- shape: {
- angle: _i(d.get("value", e), u, c, !0)
- }
- }, t),
- l.add(i),
- d.setItemGraphicEl(e, i)
- }).update(function(e, i) {
- var n = h.getItemGraphicEl(i);
- _o(n, {
- shape: {
- angle: _i(d.get("value", e), u, c, !0)
- }
- }, t),
- l.add(n),
- d.setItemGraphicEl(e, n)
- }).remove(function(t) {
- var e = h.getItemGraphicEl(t);
- l.remove(e)
- }).execute(),
- d.eachItemGraphicEl(function(t, e) {
- var i = d.getItemModel(e)
- , a = i.getModel("pointer");
- t.setShape({
- x: o.cx,
- y: o.cy,
- width: bi(a.get("width"), o.r),
- r: bi(a.get("length"), o.r)
- }),
- t.useStyle(i.getModel("itemStyle.normal").getItemStyle()),
- "auto" === t.style.fill && t.setStyle("fill", n(_i(d.get("value", e), u, [0, 1], !0))),
- lo(t, i.getModel("itemStyle.emphasis").getItemStyle())
- }),
- this._data = d
- } else
- h && h.eachItemGraphicEl(function(t) {
- l.remove(t)
- })
- },
- _renderTitle: function(t, e, i, n, o) {
- var a = t.getModel("title");
- if (a.get("show")) {
- var r = a.get("offsetCenter")
- , s = o.cx + bi(r[0], o.r)
- , l = o.cy + bi(r[1], o.r)
- , h = +t.get("min")
- , u = +t.get("max")
- , c = n(_i(t.getData().get("value", 0), [h, u], [0, 1], !0));
- this.group.add(new ab({
- silent: !0,
- style: uo({}, a, {
- x: s,
- y: l,
- text: t.getData().getName(0),
- textAlign: "center",
- textVerticalAlign: "middle"
- }, {
- autoColor: c,
- forceRich: !0
- })
- }))
- }
- },
- _renderDetail: function(t, e, i, n, o) {
- var a = t.getModel("detail")
- , r = +t.get("min")
- , s = +t.get("max");
- if (a.get("show")) {
- var l = a.get("offsetCenter")
- , h = o.cx + bi(l[0], o.r)
- , u = o.cy + bi(l[1], o.r)
- , c = bi(a.get("width"), o.r)
- , d = bi(a.get("height"), o.r)
- , f = t.getData().get("value", 0)
- , g = n(_i(f, [r, s], [0, 1], !0));
- this.group.add(new ab({
- silent: !0,
- style: uo({}, a, {
- x: h,
- y: u,
- text: Gu(f, a.get("formatter")),
- textWidth: isNaN(c) ? null : c,
- textHeight: isNaN(d) ? null : d,
- textAlign: "center",
- textVerticalAlign: "middle"
- }, {
- autoColor: g,
- forceRich: !0
- })
- }))
- }
- }
- }),
- lr({
- type: "series.funnel",
- init: function(t) {
- RT.superApply(this, "init", arguments),
- this.legendDataProvider = function() {
- return this.getRawData()
- }
- ,
- this._defaultLabelLine(t)
- },
- getInitialData: function(t, e) {
- var i = vr(["value"], t.data)
- , n = new lS(i,this);
- return n.initData(t.data),
- n
- },
- _defaultLabelLine: function(t) {
- Po(t.labelLine, ["show"]);
- var e = t.labelLine.normal
- , i = t.labelLine.emphasis;
- e.show = e.show && t.label.normal.show,
- i.show = i.show && t.label.emphasis.show
- },
- getDataParams: function(t) {
- var e = this.getData()
- , i = RT.superCall(this, "getDataParams", t)
- , n = e.getSum("value");
- return i.percent = n ? +(e.get("value", t) / n * 100).toFixed(2) : 0,
- i.$vars.push("percent"),
- i
- },
- defaultOption: {
- zlevel: 0,
- z: 2,
- legendHoverLink: !0,
- left: 80,
- top: 60,
- right: 80,
- bottom: 60,
- minSize: "0%",
- maxSize: "100%",
- sort: "descending",
- gap: 0,
- funnelAlign: "center",
- label: {
- normal: {
- show: !0,
- position: "outer"
- },
- emphasis: {
- show: !0
- }
- },
- labelLine: {
- normal: {
- show: !0,
- length: 20,
- lineStyle: {
- width: 1,
- type: "solid"
- }
- },
- emphasis: {}
- },
- itemStyle: {
- normal: {
- borderColor: "#fff",
- borderWidth: 1
- },
- emphasis: {}
- }
- }
- }))
- , VT = Wu.prototype
- , BT = ["itemStyle", "normal", "opacity"];
- VT.updateData = function(t, e, i) {
- var n = this.childAt(0)
- , o = t.hostModel
- , r = t.getItemModel(e)
- , s = t.getItemLayout(e)
- , l = t.getItemModel(e).get(BT);
- l = null == l ? 1 : l,
- n.useStyle({}),
- i ? (n.setShape({
- points: s.points
- }),
- n.setStyle({
- opacity: 0
- }),
- bo(n, {
- style: {
- opacity: l
- }
- }, o, e)) : _o(n, {
- style: {
- opacity: l
- },
- shape: {
- points: s.points
- }
- }, o, e);
- var h = r.getModel("itemStyle")
- , u = t.getItemVisual(e, "color");
- n.setStyle(a({
- lineJoin: "round",
- fill: u
- }, h.getModel("normal").getItemStyle(["opacity"]))),
- n.hoverStyle = h.getModel("emphasis").getItemStyle(),
- this._updateLabel(t, e),
- lo(this)
- }
- ,
- VT._updateLabel = function(t, e) {
- var i = this.childAt(1)
- , n = this.childAt(2)
- , o = t.hostModel
- , a = t.getItemModel(e)
- , r = t.getItemLayout(e).label
- , s = t.getItemVisual(e, "color");
- _o(i, {
- shape: {
- points: r.linePoints || r.linePoints
- }
- }, o, e),
- _o(n, {
- style: {
- x: r.x,
- y: r.y
- }
- }, o, e),
- n.attr({
- rotation: r.rotation,
- origin: [r.x, r.y],
- z2: 10
- });
- var l = a.getModel("label.normal")
- , h = a.getModel("label.emphasis")
- , u = a.getModel("labelLine.normal")
- , c = a.getModel("labelLine.emphasis")
- , s = t.getItemVisual(e, "color");
- ho(n.style, n.hoverStyle = {}, l, h, {
- labelFetcher: t.hostModel,
- labelDataIndex: e,
- defaultText: t.getName(e),
- autoColor: s,
- useInsideStyle: !!r.inside
- }, {
- textAlign: r.textAlign,
- textVerticalAlign: r.verticalAlign
- }),
- n.ignore = n.normalIgnore = !l.get("show"),
- n.hoverIgnore = !h.get("show"),
- i.ignore = i.normalIgnore = !u.get("show"),
- i.hoverIgnore = !c.get("show"),
- i.setStyle({
- stroke: s
- }),
- i.setStyle(u.getModel("lineStyle").getLineStyle()),
- i.hoverStyle = c.getModel("lineStyle").getLineStyle()
- }
- ,
- l(Wu, $y);
- Ia.extend({
- type: "funnel",
- render: function(t, e, i) {
- var n = t.getData()
- , o = this._data
- , a = this.group;
- n.diff(o).add(function(t) {
- var e = new Wu(n,t);
- n.setItemGraphicEl(t, e),
- a.add(e)
- }).update(function(t, e) {
- var i = o.getItemGraphicEl(e);
- i.updateData(n, t),
- a.add(i),
- n.setItemGraphicEl(t, i)
- }).remove(function(t) {
- var e = o.getItemGraphicEl(t);
- a.remove(e)
- }).execute(),
- this._data = n
- },
- remove: function() {
- this.group.removeAll(),
- this._data = null
- },
- dispose: function() {}
- });
- or(m(aI, "funnel")),
- nr(function(t, e, i) {
- t.eachSeriesByType("funnel", function(t) {
- var i = t.getData()
- , n = t.get("sort")
- , o = Hu(t, e)
- , a = Fu(i, n)
- , r = [bi(t.get("minSize"), o.width), bi(t.get("maxSize"), o.width)]
- , s = i.getDataExtent("value")
- , l = t.get("min")
- , h = t.get("max");
- null == l && (l = Math.min(s[0], 0)),
- null == h && (h = s[1]);
- var u = t.get("funnelAlign")
- , c = t.get("gap")
- , d = (o.height - c * (i.count() - 1)) / i.count()
- , f = o.y
- , g = function(t, e) {
- var n, a = _i(i.get("value", t) || 0, [l, h], r, !0);
- switch (u) {
- case "left":
- n = o.x;
- break;
- case "center":
- n = o.x + (o.width - a) / 2;
- break;
- case "right":
- n = o.x + o.width - a
- }
- return [[n, e], [n + a, e]]
- };
- "ascending" === n && (d = -d,
- c = -c,
- f += o.height,
- a = a.reverse());
- for (var p = 0; p < a.length; p++) {
- var m = a[p]
- , v = a[p + 1]
- , y = g(m, f)
- , x = g(v, f + d);
- f += d + c,
- i.setItemLayout(m, {
- points: y.concat(x.slice().reverse())
- })
- }
- Zu(i)
- })
- }),
- tr(m(hI, "funnel"));
- var GT = function(t, e, i, n, o) {
- YS.call(this, t, e, i),
- this.type = n || "value",
- this.axisIndex = o
- };
- GT.prototype = {
- constructor: GT,
- model: null,
- isHorizontal: function() {
- return "horizontal" !== this.coordinateSystem.getModel().get("layout")
- }
- },
- l(GT, YS);
- var WT = function(t, e, i, n, o, a) {
- e[0] = qu(e[0], i),
- e[1] = qu(e[1], i),
- t = t || 0;
- var r = i[1] - i[0];
- null != o && (o = qu(o, [0, r])),
- null != a && (a = Math.max(a, null != o ? o : 0)),
- "all" === n && (o = a = Math.abs(e[1] - e[0]),
- n = 0);
- var s = Xu(e, n);
- e[n] += t;
- var l = o || 0
- , h = i.slice();
- s.sign < 0 ? h[0] += l : h[1] -= l,
- e[n] = qu(e[n], h);
- u = Xu(e, n);
- null != o && (u.sign !== s.sign || u.span < o) && (e[1 - n] = e[n] + s.sign * o);
- var u = Xu(e, n);
- return null != a && u.span > a && (e[1 - n] = e[n] + u.sign * a),
- e
- }
- , HT = c
- , FT = Math.min
- , ZT = Math.max
- , UT = Math.floor
- , jT = Math.ceil
- , XT = wi
- , qT = Math.PI;
- Yu.prototype = {
- type: "parallel",
- constructor: Yu,
- _init: function(t, e, i) {
- var n = t.dimensions
- , o = t.parallelAxisIndex;
- HT(n, function(t, i) {
- var n = o[i]
- , a = e.getComponent("parallelAxis", n)
- , r = this._axesMap.set(t, new GT(t,zr(a),[0, 0],a.get("type"),n))
- , s = "category" === r.type;
- r.onBand = s && a.get("boundaryGap"),
- r.inverse = a.get("inverse"),
- a.axis = r,
- r.model = a,
- r.coordinateSystem = a.coordinateSystem = this
- }, this)
- },
- update: function(t, e) {
- this._updateAxesFromSeries(this._model, t)
- },
- containPoint: function(t) {
- var e = this._makeLayoutInfo()
- , i = e.axisBase
- , n = e.layoutBase
- , o = e.pixelDimIndex
- , a = t[1 - o]
- , r = t[o];
- return a >= i && a <= i + e.axisLength && r >= n && r <= n + e.layoutLength
- },
- getModel: function() {
- return this._model
- },
- _updateAxesFromSeries: function(t, e) {
- e.eachSeries(function(i) {
- if (t.contains(i, e)) {
- var n = i.getData();
- HT(this.dimensions, function(t) {
- var e = this._axesMap.get(t);
- e.scale.unionExtentFromData(n, t),
- Or(e.scale, e.model)
- }, this)
- }
- }, this)
- },
- resize: function(t, e) {
- this._rect = Yo(t.getBoxLayoutParams(), {
- width: e.getWidth(),
- height: e.getHeight()
- }),
- this._layoutAxes()
- },
- getRect: function() {
- return this._rect
- },
- _makeLayoutInfo: function() {
- 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], h = this.dimensions.length, u = $u(e.get("axisExpandWidth"), l), c = $u(e.get("axisExpandCount") || 0, [0, h]), d = e.get("axisExpandable") && h > 3 && h > c && c > 1 && u > 0 && s > 0, f = e.get("axisExpandWindow");
- f ? (t = $u(f[1] - f[0], l),
- f[1] = f[0] + t) : (t = $u(u * (c - 1), l),
- (f = [u * (e.get("axisExpandCenter") || UT(h / 2)) - t / 2])[1] = f[0] + t);
- var g = (s - t) / (h - c);
- g < 3 && (g = 0);
- var p = [UT(XT(f[0] / u, 1)) + 1, jT(XT(f[1] / u, 1)) - 1]
- , m = g / u * f[0];
- return {
- layout: a,
- pixelDimIndex: r,
- layoutBase: i[n[r]],
- layoutLength: s,
- axisBase: i[n[1 - r]],
- axisLength: i[o[1 - r]],
- axisExpandable: d,
- axisExpandWidth: u,
- axisCollapseWidth: g,
- axisExpandWindow: f,
- axisCount: h,
- winInnerIndices: p,
- axisExpandWindow0Pos: m
- }
- },
- _layoutAxes: function() {
- var t = this._rect
- , e = this._axesMap
- , i = this.dimensions
- , n = this._makeLayoutInfo()
- , o = n.layout;
- e.each(function(t) {
- var e = [0, n.axisLength]
- , i = t.inverse ? 1 : 0;
- t.setExtent(e[i], e[1 - i])
- }),
- HT(i, function(i, a) {
- var r = (n.axisExpandable ? Ju : Ku)(a, n)
- , s = {
- horizontal: {
- x: r.position,
- y: n.axisLength
- },
- vertical: {
- x: 0,
- y: r.position
- }
- }
- , l = {
- horizontal: qT / 2,
- vertical: 0
- }
- , h = [s[o].x + t.x, s[o].y + t.y]
- , u = l[o]
- , c = nt();
- lt(c, c, u),
- st(c, c, h),
- this._axesLayout[i] = {
- position: h,
- rotation: u,
- transform: c,
- axisNameAvailableWidth: r.axisNameAvailableWidth,
- axisLabelShow: r.axisLabelShow,
- nameTruncateMaxWidth: r.nameTruncateMaxWidth,
- tickDirection: 1,
- labelDirection: 1,
- labelInterval: e.get(i).getLabelInterval()
- }
- }, this)
- },
- getAxis: function(t) {
- return this._axesMap.get(t)
- },
- dataToPoint: function(t, e) {
- return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t), e)
- },
- eachActiveState: function(t, e, i) {
- for (var n = this.dimensions, o = this._axesMap, a = this.hasAxisBrushed(), r = 0, s = t.count(); r < s; r++) {
- var l, h = t.getValues(n, r);
- if (a) {
- l = "active";
- for (var u = 0, c = n.length; u < c; u++) {
- var d = n[u];
- if ("inactive" === o.get(d).model.getActiveState(h[u], u)) {
- l = "inactive";
- break
- }
- }
- } else
- l = "normal";
- e.call(i, l, r)
- }
- },
- hasAxisBrushed: function() {
- for (var t = this.dimensions, e = this._axesMap, i = !1, n = 0, o = t.length; n < o; n++)
- "normal" !== e.get(t[n]).model.getActiveState() && (i = !0);
- return i
- },
- axisCoordToPoint: function(t, e) {
- return So([t, 0], this._axesLayout[e].transform)
- },
- getAxisLayout: function(t) {
- return e(this._axesLayout[t])
- },
- getSlidedAxisExpandWindow: function(t) {
- var e = this._makeLayoutInfo()
- , i = e.pixelDimIndex
- , n = e.axisExpandWindow.slice()
- , o = n[1] - n[0]
- , a = [0, e.axisExpandWidth * (e.axisCount - 1)];
- if (!this.containPoint(t))
- return {
- behavior: "none",
- axisExpandWindow: n
- };
- var r, s = t[i] - e.layoutBase - e.axisExpandWindow0Pos, l = "slide", h = e.axisCollapseWidth, u = this._model.get("axisExpandSlideTriggerArea"), c = null != u[0];
- if (h)
- c && h && s < o * u[0] ? (l = "jump",
- r = s - o * u[2]) : c && h && s > o * (1 - u[0]) ? (l = "jump",
- r = s - o * (1 - u[2])) : (r = s - o * u[1]) >= 0 && (r = s - o * (1 - u[1])) <= 0 && (r = 0),
- (r *= e.axisExpandWidth / h) ? WT(r, n, a, "all") : l = "none";
- else {
- o = n[1] - n[0];
- (n = [ZT(0, a[1] * s / o - o / 2)])[1] = FT(a[1], n[0] + o),
- n[0] = n[1] - o
- }
- return {
- axisExpandWindow: n,
- behavior: l
- }
- }
- },
- ha.register("parallel", {
- create: function(t, e) {
- var i = [];
- return t.eachComponent("parallel", function(n, o) {
- var a = new Yu(n,t,e);
- a.name = "parallel_" + o,
- a.resize(n, e),
- n.coordinateSystem = a,
- a.model = n,
- i.push(a)
- }),
- t.eachSeries(function(e) {
- if ("parallel" === e.get("coordinateSystem")) {
- var i = t.queryComponents({
- mainType: "parallel",
- index: e.get("parallelIndex"),
- id: e.get("parallelId")
- })[0];
- e.coordinateSystem = i.coordinateSystem
- }
- }),
- i
- }
- });
- var YT = qb.extend({
- type: "baseParallelAxis",
- axis: null,
- activeIntervals: [],
- getAreaSelectStyle: function() {
- return e_([["fill", "color"], ["lineWidth", "borderWidth"], ["stroke", "borderColor"], ["width", "width"], ["opacity", "opacity"]])(this.getModel("areaSelectStyle"))
- },
- setActiveIntervals: function(t) {
- var i = this.activeIntervals = e(t);
- if (i)
- for (var n = i.length - 1; n >= 0; n--)
- Si(i[n])
- },
- getActiveState: function(t) {
- var e = this.activeIntervals;
- if (!e.length)
- return "normal";
- if (null == t)
- return "inactive";
- for (var i = 0, n = e.length; i < n; i++)
- if (e[i][0] <= t && t <= e[i][1])
- return "active";
- return "inactive"
- }
- })
- , $T = {
- type: "value",
- dim: null,
- areaSelectStyle: {
- width: 20,
- borderWidth: 1,
- borderColor: "rgba(160,197,232)",
- color: "rgba(160,197,232)",
- opacity: .3
- },
- realtime: !0,
- z: 10
- };
- i(YT.prototype, VS),
- IM("parallel", YT, function(t, e) {
- return e.type || (e.data ? "category" : "value")
- }, $T),
- qb.extend({
- type: "parallel",
- dependencies: ["parallelAxis"],
- coordinateSystem: null,
- dimensions: null,
- parallelAxisIndex: null,
- layoutMode: "box",
- defaultOption: {
- zlevel: 0,
- z: 0,
- left: 80,
- top: 60,
- right: 80,
- bottom: 60,
- layout: "horizontal",
- axisExpandable: !1,
- axisExpandCenter: null,
- axisExpandCount: 0,
- axisExpandWidth: 50,
- axisExpandRate: 17,
- axisExpandDebounce: 50,
- axisExpandSlideTriggerArea: [-.15, .05, .4],
- axisExpandTriggerOn: "click",
- parallelAxisDefault: null
- },
- init: function() {
- qb.prototype.init.apply(this, arguments),
- this.mergeOption({})
- },
- mergeOption: function(t) {
- var e = this.option;
- t && i(e, t, !0),
- this._initDimensions()
- },
- contains: function(t, e) {
- var i = t.get("parallelIndex");
- return null != i && e.getComponent("parallel", i) === this
- },
- setAxisExpand: function(t) {
- c(["axisExpandable", "axisExpandCenter", "axisExpandCount", "axisExpandWidth", "axisExpandWindow"], function(e) {
- t.hasOwnProperty(e) && (this.option[e] = t[e])
- }, this)
- },
- _initDimensions: function() {
- var t = this.dimensions = []
- , e = this.parallelAxisIndex = [];
- c(g(this.dependentModels.parallelAxis, function(t) {
- return (t.get("parallelIndex") || 0) === this.componentIndex
- }, this), function(i) {
- t.push("dim" + i.get("dim")),
- e.push(i.componentIndex)
- })
- }
- }),
- er({
- type: "axisAreaSelect",
- event: "axisAreaSelected",
- update: "updateVisual"
- }, function(t, e) {
- e.eachComponent({
- mainType: "parallelAxis",
- query: t
- }, function(e) {
- e.axis.model.setActiveIntervals(t.intervals)
- })
- }),
- er("parallelAxisExpand", function(t, e) {
- e.eachComponent({
- mainType: "parallel",
- query: t
- }, function(e) {
- e.setAxisExpand(t)
- })
- });
- var KT = m
- , JT = c
- , QT = d
- , tA = Math.min
- , eA = Math.max
- , iA = Math.pow
- , nA = 1e4
- , oA = 6
- , aA = 6
- , rA = "globalPan"
- , sA = {
- w: [0, 0],
- e: [0, 1],
- n: [1, 0],
- s: [1, 1]
- }
- , lA = {
- w: "ew",
- e: "ew",
- n: "ns",
- s: "ns",
- ne: "nesw",
- sw: "nesw",
- nw: "nwse",
- se: "nwse"
- }
- , hA = {
- brushStyle: {
- lineWidth: 2,
- stroke: "rgba(0,0,0,0.3)",
- fill: "rgba(0,0,0,0.1)"
- },
- transformable: !0,
- brushMode: "single",
- removeOnClick: !1
- }
- , uA = 0;
- Qu.prototype = {
- constructor: Qu,
- enableBrush: function(t) {
- return this._brushType && ec(this),
- t.brushType && tc(this, t),
- this
- },
- setPanels: function(t) {
- if (t && t.length) {
- var i = this._panels = {};
- c(t, function(t) {
- i[t.panelId] = e(t)
- })
- } else
- this._panels = null;
- return this
- },
- mount: function(t) {
- t = t || {},
- this._enableGlobalPan = t.enableGlobalPan;
- var e = this.group;
- return this._zr.add(e),
- e.attr({
- position: t.position || [0, 0],
- rotation: t.rotation || 0,
- scale: t.scale || [1, 1]
- }),
- this._transform = e.getLocalTransform(),
- this
- },
- eachCover: function(t, e) {
- JT(this._covers, t, e)
- },
- updateCovers: function(t) {
- function n(t, e) {
- return (null != t.id ? t.id : a + e) + "-" + t.brushType
- }
- function o(e, i) {
- var n = t[e];
- if (null != i && r[i] === h)
- s[e] = r[i];
- else {
- var o = s[e] = null != i ? (r[i].__brushOption = n,
- r[i]) : nc(l, ic(l, n));
- rc(l, o)
- }
- }
- t = d(t, function(t) {
- return i(e(hA), t, !0)
- });
- var a = "\0-brush-index-"
- , r = this._covers
- , s = this._covers = []
- , l = this
- , h = this._creatingCover;
- return new cr(r,t,function(t, e) {
- return n(t.__brushOption, e)
- }
- ,n).add(o).update(o).remove(function(t) {
- r[t] !== h && l.group.remove(r[t])
- }).execute(),
- this
- },
- unmount: function() {
- return this.enableBrush(!1),
- uc(this),
- this._zr.remove(this.group),
- this
- },
- dispose: function() {
- this.unmount(),
- this.off()
- }
- },
- h(Qu, my);
- var cA = {
- mousedown: function(t) {
- if (this._dragging)
- Pc.call(this, t);
- else if (!t.target || !t.target.draggable) {
- Cc(t);
- var e = this.group.transformCoordToLocal(t.offsetX, t.offsetY);
- this._creatingCover = null,
- (this._creatingPanel = lc(this, t, e)) && (this._dragging = !0,
- this._track = [e.slice()])
- }
- },
- mousemove: function(t) {
- var e = this.group.transformCoordToLocal(t.offsetX, t.offsetY);
- if (Ac(this, t, e),
- this._dragging) {
- Cc(t);
- var i = Lc(this, t, e, !1);
- i && cc(this, i)
- }
- },
- mouseup: Pc
- }
- , dA = {
- lineX: Oc(0),
- lineY: Oc(1),
- rect: {
- createCover: function(t, e) {
- return gc(KT(wc, function(t) {
- return t
- }, function(t) {
- return t
- }), t, e, ["w", "e", "n", "s", "se", "sw", "ne", "nw"])
- },
- getCreatingRange: function(t) {
- var e = fc(t);
- return xc(e[1][0], e[1][1], e[0][0], e[0][1])
- },
- updateCoverShape: function(t, e, i, n) {
- pc(t, e, i, n)
- },
- updateCommon: mc,
- contain: Dc
- },
- polygon: {
- createCover: function(t, e) {
- var i = new $y;
- return i.add(new gb({
- name: "main",
- style: yc(e),
- silent: !0
- })),
- i
- },
- getCreatingRange: function(t) {
- return t
- },
- endCreating: function(t, e) {
- e.remove(e.childAt(0)),
- e.add(new fb({
- name: "main",
- draggable: !0,
- drift: KT(Sc, t, e),
- ondragend: KT(cc, t, {
- isEnd: !0
- })
- }))
- },
- updateCoverShape: function(t, e, i, n) {
- e.childAt(0).setShape({
- points: Ic(t, e, i)
- })
- },
- updateCommon: mc,
- contain: Dc
- }
- }
- , fA = ["axisLine", "axisTickLabel", "axisName"]
- , gA = sr({
- type: "parallelAxis",
- init: function(t, e) {
- gA.superApply(this, "init", arguments),
- (this._brushController = new Qu(e.getZr())).on("brush", p(this._onBrush, this))
- },
- render: function(t, e, i, n) {
- if (!Vc(t, e, n)) {
- this.axisModel = t,
- this.api = i,
- this.group.removeAll();
- var a = this._axisGroup;
- if (this._axisGroup = new $y,
- this.group.add(this._axisGroup),
- t.get("show")) {
- var r = Gc(t, e)
- , s = r.coordinateSystem
- , l = t.getAreaSelectStyle()
- , h = l.width
- , u = t.axis.dim
- , d = o({
- strokeContainThreshold: h
- }, s.getAxisLayout(u))
- , f = new zM(t,d);
- c(fA, f.add, f),
- this._axisGroup.add(f.getGroup()),
- this._refreshBrushController(d, l, t, r, h, i);
- var g = n && !1 === n.animation ? null : t;
- Io(a, this._axisGroup, g)
- }
- }
- },
- updateVisual: function(t, e, i, n) {
- this._brushController && this._brushController.updateCovers(Bc(t))
- },
- _refreshBrushController: function(t, e, i, n, o, a) {
- var r = i.axis.getExtent()
- , s = r[1] - r[0]
- , l = Math.min(30, .1 * Math.abs(s))
- , h = jt.create({
- x: r[0],
- y: -o / 2,
- width: s,
- height: o
- });
- h.x -= l,
- h.width += 2 * l,
- this._brushController.mount({
- enableGlobalPan: !0,
- rotation: t.rotation,
- position: t.position
- }).setPanels([{
- panelId: "pl",
- clipPath: zc(h),
- isTargetByCursor: Ec(h, a, n),
- getLinearBrushOtherExtent: Nc(h, 0)
- }]).enableBrush({
- brushType: "lineX",
- brushStyle: e,
- removeOnClick: !0
- }).updateCovers(Bc(i))
- },
- _onBrush: function(t, e) {
- var i = this.axisModel
- , n = i.axis
- , o = d(t, function(t) {
- return [n.coordToData(t.range[0], !0), n.coordToData(t.range[1], !0)]
- });
- (!i.option.realtime === e.isEnd || e.removeOnClick) && this.api.dispatchAction({
- type: "axisAreaSelect",
- parallelAxisId: i.id,
- intervals: o
- })
- },
- dispose: function() {
- this._brushController.dispose()
- }
- });
- sr({
- type: "parallel",
- render: function(t, e, i) {
- this._model = t,
- this._api = i,
- this._handlers || (this._handlers = {},
- c(pA, function(t, e) {
- i.getZr().on(e, this._handlers[e] = p(t, this))
- }, this)),
- Da(this, "_throttledDispatchExpand", t.get("axisExpandRate"), "fixRate")
- },
- dispose: function(t, e) {
- c(this._handlers, function(t, i) {
- e.getZr().off(i, t)
- }),
- this._handlers = null
- },
- _throttledDispatchExpand: function(t) {
- this._dispatchExpand(t)
- },
- _dispatchExpand: function(t) {
- t && this._api.dispatchAction(o({
- type: "parallelAxisExpand"
- }, t))
- }
- });
- var pA = {
- mousedown: function(t) {
- Wc(this, "click") && (this._mouseDownPoint = [t.offsetX, t.offsetY])
- },
- mouseup: function(t) {
- var e = this._mouseDownPoint;
- if (Wc(this, "click") && e) {
- var i = [t.offsetX, t.offsetY];
- if (Math.pow(e[0] - i[0], 2) + Math.pow(e[1] - i[1], 2) > 5)
- return;
- var n = this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX, t.offsetY]);
- "none" !== n.behavior && this._dispatchExpand({
- axisExpandWindow: n.axisExpandWindow
- })
- }
- this._mouseDownPoint = null
- },
- mousemove: function(t) {
- if (!this._mouseDownPoint && Wc(this, "mousemove")) {
- var e = this._model
- , i = e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX, t.offsetY])
- , n = i.behavior;
- "jump" === n && this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),
- this._throttledDispatchExpand("none" === n ? null : {
- axisExpandWindow: i.axisExpandWindow,
- animation: "jump" === n && null
- })
- }
- }
- };
- Qa(function(t) {
- Uu(t),
- ju(t)
- }),
- bw.extend({
- type: "series.parallel",
- dependencies: ["parallel"],
- visualColorAccessPath: "lineStyle.normal.color",
- getInitialData: function(t, e) {
- var i = e.getComponent("parallel", this.get("parallelIndex"))
- , n = i.parallelAxisIndex
- , o = t.data
- , a = i.dimensions
- , r = d(Zc(a, o), function(t, i) {
- var r = s(a, t)
- , l = r >= 0 && e.getComponent("parallelAxis", n[r]);
- return l && "category" === l.get("type") ? (Hc(l, t, o),
- {
- name: t,
- type: "ordinal"
- }) : r < 0 && vr.guessOrdinal(o, i) ? {
- name: t,
- type: "ordinal"
- } : t
- })
- , l = new lS(r,this);
- return l.initData(o),
- this.option.progressive && (this.option.animation = !1),
- l
- },
- getRawIndicesByActiveState: function(t) {
- var e = this.coordinateSystem
- , i = this.getData()
- , n = [];
- return e.eachActiveState(i, function(e, o) {
- t === e && n.push(i.getRawIndex(o))
- }),
- n
- },
- defaultOption: {
- zlevel: 0,
- z: 2,
- coordinateSystem: "parallel",
- parallelIndex: 0,
- label: {
- normal: {
- show: !1
- },
- emphasis: {
- show: !1
- }
- },
- inactiveOpacity: .05,
- activeOpacity: 1,
- lineStyle: {
- normal: {
- width: 1,
- opacity: .45,
- type: "solid"
- }
- },
- progressive: !1,
- smooth: !1,
- animationEasing: "linear"
- }
- });
- Ia.extend({
- type: "parallel",
- init: function() {
- this._dataGroup = new $y,
- this.group.add(this._dataGroup),
- this._data
- },
- render: function(t, e, i, n) {
- this._renderForNormal(t, n)
- },
- dispose: function() {},
- _renderForNormal: function(t, e) {
- var i = this._dataGroup
- , n = t.getData()
- , o = this._data
- , a = t.coordinateSystem
- , r = a.dimensions
- , s = t.option.smooth ? .3 : null;
- if (n.diff(o).add(function(t) {
- Xc(n, i, t, r, a)
- }).update(function(i, s) {
- var l = o.getItemGraphicEl(s)
- , h = jc(n, i, r, a);
- n.setItemGraphicEl(i, l),
- _o(l, {
- shape: {
- points: h
- }
- }, e && !1 === e.animation ? null : t, i)
- }).remove(function(t) {
- var e = o.getItemGraphicEl(t);
- i.remove(e)
- }).execute(),
- qc(n, s),
- !this._data) {
- var l = Uc(a, t, function() {
- setTimeout(function() {
- i.removeClipPath()
- })
- });
- i.setClipPath(l)
- }
- this._data = n
- },
- remove: function() {
- this._dataGroup && this._dataGroup.removeAll(),
- this._data = null
- }
- });
- var mA = ["lineStyle", "normal", "opacity"];
- or(function(t) {
- t.eachSeriesByType("parallel", function(e) {
- var i = e.getModel("itemStyle.normal")
- , n = e.getModel("lineStyle.normal")
- , o = t.get("color")
- , a = n.get("color") || i.get("color") || o[e.seriesIndex % o.length]
- , r = e.get("inactiveOpacity")
- , s = e.get("activeOpacity")
- , l = e.getModel("lineStyle.normal").getLineStyle()
- , h = e.coordinateSystem
- , u = e.getData()
- , c = {
- normal: l.opacity,
- active: s,
- inactive: r
- };
- h.eachActiveState(u, function(t, e) {
- var i = u.getItemModel(e)
- , n = c[t];
- if ("normal" === t) {
- var o = i.get(mA, !0);
- null != o && (n = o)
- }
- u.setItemVisual(e, "opacity", n)
- }),
- u.setVisual("color", a)
- })
- });
- var vA = bw.extend({
- type: "series.sankey",
- layoutInfo: null,
- getInitialData: function(t) {
- var e = t.edges || t.links
- , i = t.data || t.nodes;
- if (i && e)
- return vT(i, e, this, !0).data
- },
- getGraph: function() {
- return this.getData().graph
- },
- getEdgeData: function() {
- return this.getGraph().edgeData
- },
- formatTooltip: function(t, e, i) {
- if ("edge" === i) {
- var n = this.getDataParams(t, i)
- , o = n.data
- , a = o.source + " -- " + o.target;
- return n.value && (a += " : " + n.value),
- Vi(a)
- }
- return vA.superCall(this, "formatTooltip", t, e)
- },
- defaultOption: {
- zlevel: 0,
- z: 2,
- coordinateSystem: "view",
- layout: null,
- left: "5%",
- top: "5%",
- right: "20%",
- bottom: "5%",
- nodeWidth: 20,
- nodeGap: 8,
- layoutIterations: 32,
- label: {
- normal: {
- show: !0,
- position: "right",
- color: "#000",
- fontSize: 12
- },
- emphasis: {
- show: !0
- }
- },
- itemStyle: {
- normal: {
- borderWidth: 1,
- borderColor: "#333"
- }
- },
- lineStyle: {
- normal: {
- color: "#314656",
- opacity: .2,
- curveness: .5
- },
- emphasis: {
- opacity: .6
- }
- },
- animationEasing: "linear",
- animationDuration: 1e3
- }
- })
- , yA = Hn({
- shape: {
- x1: 0,
- y1: 0,
- x2: 0,
- y2: 0,
- cpx1: 0,
- cpy1: 0,
- cpx2: 0,
- cpy2: 0,
- extent: 0
- },
- buildPath: function(t, e) {
- var i = e.extent / 2;
- t.moveTo(e.x1, e.y1 - i),
- t.bezierCurveTo(e.cpx1, e.cpy1 - i, e.cpx2, e.cpy2 - i, e.x2, e.y2 - i),
- t.lineTo(e.x2, e.y2 + i),
- t.bezierCurveTo(e.cpx2, e.cpy2 + i, e.cpx1, e.cpy1 + i, e.x1, e.y1 + i),
- t.closePath()
- }
- });
- hr({
- type: "sankey",
- _model: null,
- render: function(t, e, i) {
- var n = t.getGraph()
- , o = this.group
- , a = t.layoutInfo
- , r = t.getData()
- , s = t.getData("edge");
- this._model = t,
- o.removeAll(),
- o.attr("position", [a.x, a.y]),
- n.eachEdge(function(e) {
- var i = new yA;
- i.dataIndex = e.dataIndex,
- i.seriesIndex = t.seriesIndex,
- i.dataType = "edge";
- var n = e.getModel("lineStyle.normal")
- , a = n.get("curveness")
- , r = e.node1.getLayout()
- , l = e.node2.getLayout()
- , h = e.getLayout();
- i.shape.extent = Math.max(1, h.dy);
- var u = r.x + r.dx
- , c = r.y + h.sy + h.dy / 2
- , d = l.x
- , f = l.y + h.ty + h.dy / 2
- , g = u * (1 - a) + d * a
- , p = c
- , m = u * a + d * (1 - a)
- , v = f;
- switch (i.setShape({
- x1: u,
- y1: c,
- x2: d,
- y2: f,
- cpx1: g,
- cpy1: p,
- cpx2: m,
- cpy2: v
- }),
- i.setStyle(n.getItemStyle()),
- i.style.fill) {
- case "source":
- i.style.fill = e.node1.getVisual("color");
- break;
- case "target":
- i.style.fill = e.node2.getVisual("color")
- }
- lo(i, e.getModel("lineStyle.emphasis").getItemStyle()),
- o.add(i),
- s.setItemGraphicEl(e.dataIndex, i)
- }),
- n.eachNode(function(e) {
- var i = e.getLayout()
- , n = e.getModel()
- , a = n.getModel("label.normal")
- , s = n.getModel("label.emphasis")
- , l = new pb({
- shape: {
- x: i.x,
- y: i.y,
- width: e.getLayout().dx,
- height: e.getLayout().dy
- },
- style: n.getModel("itemStyle.normal").getItemStyle()
- })
- , h = e.getModel("itemStyle.emphasis").getItemStyle();
- ho(l.style, h, a, s, {
- labelFetcher: t,
- labelDataIndex: e.dataIndex,
- defaultText: e.id,
- isRectText: !0
- }),
- l.setStyle("fill", e.getVisual("color")),
- lo(l, h),
- o.add(l),
- r.setItemGraphicEl(e.dataIndex, l),
- l.dataType = "node"
- }),
- !this._data && t.get("animation") && o.setClipPath($c(o.getBoundingRect(), t, function() {
- o.removeClipPath()
- })),
- this._data = t.getData()
- },
- dispose: function() {}
- });
- nr(function(t, e, i) {
- t.eachSeriesByType("sankey", function(t) {
- var i = t.get("nodeWidth")
- , n = t.get("nodeGap")
- , o = Jc(t, e);
- t.layoutInfo = o;
- var a = o.width
- , r = o.height
- , s = t.getGraph()
- , l = s.nodes
- , h = s.edges;
- td(l),
- Qc(l, h, i, n, a, r, 0 !== g(l, function(t) {
- return 0 === t.getLayout().value
- }).length ? 0 : t.get("layoutIterations"))
- })
- }),
- or(function(t, e) {
- t.eachSeriesByType("sankey", function(t) {
- var e = t.getGraph().nodes;
- e.sort(function(t, e) {
- return t.getLayout().value - e.getLayout().value
- });
- var i = e[0].getLayout().value
- , n = e[e.length - 1].getLayout().value;
- c(e, function(e) {
- var o = new eT({
- type: "color",
- mappingMethod: "linear",
- dataExtent: [i, n],
- visual: t.get("color")
- }).mapValueToVisual(e.getLayout().value);
- e.setVisual("color", o);
- var a = e.getModel().get("itemStyle.normal.color");
- null != a && e.setVisual("color", a)
- })
- })
- });
- var xA = On.extend({
- type: "whiskerInBox",
- shape: {},
- buildPath: function(t, e) {
- for (var i in e)
- if (e.hasOwnProperty(i) && 0 === i.indexOf("ends")) {
- var n = e[i];
- t.moveTo(n[0][0], n[0][1]),
- t.lineTo(n[1][0], n[1][1])
- }
- }
- })
- , _A = xd.prototype;
- _A._createContent = function(t, e, i) {
- var n = t.getItemLayout(e)
- , o = "horizontal" === n.chartLayout ? 1 : 0
- , a = 0;
- this.add(new fb({
- shape: {
- points: i ? _d(n.bodyEnds, o, n) : n.bodyEnds
- },
- style: {
- strokeNoScale: !0
- },
- z2: 100
- })),
- this.bodyIndex = a++;
- var r = d(n.whiskerEnds, function(t) {
- return i ? _d(t, o, n) : t
- });
- this.add(new xA({
- shape: bd(r),
- style: {
- strokeNoScale: !0
- },
- z2: 100
- })),
- this.whiskerIndex = a++
- }
- ,
- _A.updateData = function(t, e, i) {
- var n = this._seriesModel = t.hostModel
- , o = t.getItemLayout(e)
- , a = Db[i ? "initProps" : "updateProps"];
- a(this.childAt(this.bodyIndex), {
- shape: {
- points: o.bodyEnds
- }
- }, n, e),
- a(this.childAt(this.whiskerIndex), {
- shape: bd(o.whiskerEnds)
- }, n, e),
- this.styleUpdater.call(null, this, t, e)
- }
- ,
- l(xd, $y);
- var bA = wd.prototype;
- bA.updateData = function(t) {
- var e = this.group
- , i = this._data
- , n = this.styleUpdater;
- t.diff(i).add(function(i) {
- if (t.hasValue(i)) {
- var o = new xd(t,i,n,!0);
- t.setItemGraphicEl(i, o),
- e.add(o)
- }
- }).update(function(o, a) {
- var r = i.getItemGraphicEl(a);
- t.hasValue(o) ? (r ? r.updateData(t, o) : r = new xd(t,o,n),
- e.add(r),
- t.setItemGraphicEl(o, r)) : e.remove(r)
- }).remove(function(t) {
- var n = i.getItemGraphicEl(t);
- n && e.remove(n)
- }).execute(),
- this._data = t
- }
- ,
- bA.remove = function() {
- var t = this.group
- , e = this._data;
- this._data = null,
- e && e.eachItemGraphicEl(function(e) {
- e && t.remove(e)
- })
- }
- ;
- var wA = {
- _baseAxisDim: null,
- getInitialData: function(t, e) {
- 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");
- "category" === r ? (t.layout = "horizontal",
- i = o.getCategories(),
- n = !0) : "category" === s ? (t.layout = "vertical",
- i = a.getCategories(),
- n = !0) : t.layout = t.layout || "horizontal";
- var l = ["x", "y"]
- , h = "horizontal" === t.layout ? 0 : 1
- , u = this._baseAxisDim = l[h]
- , d = l[1 - h]
- , f = t.data;
- n && c(f, function(t, e) {
- t.value && v(t.value) ? t.value.unshift(e) : v(t) && t.unshift(e)
- });
- var g = this.defaultValueDimensions
- , p = [{
- name: u,
- otherDims: {
- tooltip: !1
- },
- dimsDef: ["base"]
- }, {
- name: d,
- dimsDef: g.slice()
- }];
- p = vr(p, f, {
- encodeDef: this.get("encode"),
- dimsDef: this.get("dimensions"),
- dimCount: g.length + 1
- });
- var m = new lS(p,this);
- return m.initData(f, i ? i.slice() : null),
- m
- },
- getBaseAxis: function() {
- var t = this._baseAxisDim;
- return this.ecModel.getComponent(t + "Axis", this.get(t + "AxisIndex")).axis
- }
- }
- , SA = {
- init: function() {
- var t = this._whiskerBoxDraw = new wd(this.getStyleUpdater());
- this.group.add(t.group)
- },
- render: function(t, e, i) {
- this._whiskerBoxDraw.updateData(t.getData())
- },
- remove: function(t) {
- this._whiskerBoxDraw.remove()
- }
- };
- h(bw.extend({
- type: "series.boxplot",
- dependencies: ["xAxis", "yAxis", "grid"],
- defaultValueDimensions: ["min", "Q1", "median", "Q3", "max"],
- dimensions: null,
- defaultOption: {
- zlevel: 0,
- z: 2,
- coordinateSystem: "cartesian2d",
- legendHoverLink: !0,
- hoverAnimation: !0,
- layout: null,
- boxWidth: [7, 50],
- itemStyle: {
- normal: {
- color: "#fff",
- borderWidth: 1
- },
- emphasis: {
- borderWidth: 2,
- shadowBlur: 5,
- shadowOffsetX: 2,
- shadowOffsetY: 2,
- shadowColor: "rgba(0,0,0,0.4)"
- }
- },
- animationEasing: "elasticOut",
- animationDuration: 800
- }
- }), wA, !0),
- h(Ia.extend({
- type: "boxplot",
- getStyleUpdater: function() {
- return Sd
- },
- dispose: z
- }), SA, !0);
- var MA = ["itemStyle", "normal"]
- , IA = ["itemStyle", "emphasis"]
- , TA = ["itemStyle", "normal", "borderColor"]
- , AA = c;
- or(function(t, e) {
- var i = t.get("color");
- t.eachRawSeriesByType("boxplot", function(e) {
- var n = i[e.seriesIndex % i.length]
- , o = e.getData();
- o.setVisual({
- legendSymbol: "roundRect",
- color: e.get(TA) || n
- }),
- t.isSeriesFiltered(e) || o.each(function(t) {
- var e = o.getItemModel(t);
- o.setItemVisual(t, {
- color: e.get(TA, !0)
- })
- })
- })
- }),
- nr(function(t) {
- var e = Md(t);
- AA(e, function(t) {
- var e = t.seriesModels;
- e.length && (Id(t),
- AA(e, function(e, i) {
- Td(e, t.boxOffsetList[i], t.boxWidthList[i])
- }))
- })
- }),
- h(bw.extend({
- type: "series.candlestick",
- dependencies: ["xAxis", "yAxis", "grid"],
- defaultValueDimensions: ["open", "close", "lowest", "highest"],
- dimensions: null,
- defaultOption: {
- zlevel: 0,
- z: 2,
- coordinateSystem: "cartesian2d",
- legendHoverLink: !0,
- hoverAnimation: !0,
- layout: null,
- itemStyle: {
- normal: {
- color: "#c23531",
- color0: "#314656",
- borderWidth: 1,
- borderColor: "#c23531",
- borderColor0: "#314656"
- },
- emphasis: {
- borderWidth: 2
- }
- },
- barMaxWidth: null,
- barMinWidth: null,
- barWidth: null,
- animationUpdate: !1,
- animationEasing: "linear",
- animationDuration: 300
- },
- getShadowDim: function() {
- return "open"
- },
- brushSelector: function(t, e, i) {
- var n = e.getItemLayout(t);
- return i.rect(n.brushRect)
- }
- }), wA, !0),
- h(Ia.extend({
- type: "candlestick",
- getStyleUpdater: function() {
- return Ad
- },
- dispose: z
- }), SA, !0);
- var CA = ["itemStyle", "normal"]
- , DA = ["itemStyle", "emphasis"]
- , LA = ["itemStyle", "normal", "borderColor"]
- , kA = ["itemStyle", "normal", "borderColor0"]
- , PA = ["itemStyle", "normal", "color"]
- , OA = ["itemStyle", "normal", "color0"]
- , zA = I;
- Qa(function(t) {
- t && v(t.series) && c(t.series, function(t) {
- _(t) && "k" === t.type && (t.type = "candlestick")
- })
- }),
- or(function(t, e) {
- t.eachRawSeriesByType("candlestick", function(e) {
- var i = e.getData();
- i.setVisual({
- legendSymbol: "roundRect"
- }),
- t.isSeriesFiltered(e) || i.each(function(t) {
- var e = i.getItemModel(t)
- , n = i.getItemLayout(t).sign;
- i.setItemVisual(t, {
- color: e.get(n > 0 ? PA : OA),
- borderColor: e.get(n > 0 ? LA : kA)
- })
- })
- })
- }),
- nr(function(t) {
- t.eachSeriesByType("candlestick", function(t) {
- var e, i = t.coordinateSystem, n = t.getData(), o = Cd(t, n), a = t.get("layout"), r = "horizontal" === a ? 0 : 1, s = 1 - r, l = ["x", "y"], h = [];
- if (c(n.dimensions, function(t) {
- var i = n.getDimensionInfo(t).coordDim;
- i === l[s] ? h.push(t) : i === l[r] && (e = t)
- }),
- !(null == e || h.length < 4)) {
- var u = 0;
- n.each([e].concat(h), function() {
- function t(t) {
- var e = [];
- return e[r] = d,
- e[s] = t,
- isNaN(d) || isNaN(t) ? [NaN, NaN] : i.dataToPoint(e)
- }
- function e(t, e) {
- var i = t.slice()
- , n = t.slice();
- i[r] = Yn(i[r] + o / 2, 1, !1),
- n[r] = Yn(n[r] - o / 2, 1, !0),
- e ? M.push(i, n) : M.push(n, i)
- }
- function l(t) {
- return t[r] = Yn(t[r], 1),
- t
- }
- var c = arguments
- , d = c[0]
- , f = c[h.length + 1]
- , g = c[1]
- , p = c[2]
- , m = c[3]
- , v = c[4]
- , y = Math.min(g, p)
- , x = Math.max(g, p)
- , _ = t(y)
- , b = t(x)
- , w = t(m)
- , S = [[l(t(v)), l(b)], [l(w), l(_)]]
- , M = [];
- e(b, 0),
- e(_, 1);
- var I;
- I = g > p ? -1 : g < p ? 1 : u > 0 ? n.getItemModel(u - 1).get()[2] <= p ? 1 : -1 : 1,
- n.setItemLayout(f, {
- chartLayout: a,
- sign: I,
- initBaseline: g > p ? b[s] : _[s],
- bodyEnds: M,
- whiskerEnds: S,
- brushRect: function() {
- var e = t(Math.min(g, p, m, v))
- , i = t(Math.max(g, p, m, v));
- return e[r] -= o / 2,
- i[r] -= o / 2,
- {
- x: e[0],
- y: e[1],
- width: s ? o : i[0] - e[0],
- height: s ? i[1] - e[1] : o
- }
- }()
- }),
- ++u
- }, !0)
- }
- })
- }),
- bw.extend({
- type: "series.effectScatter",
- dependencies: ["grid", "polar"],
- getInitialData: function(t, e) {
- return br(t.data, this, e)
- },
- brushSelector: "point",
- defaultOption: {
- coordinateSystem: "cartesian2d",
- zlevel: 0,
- z: 2,
- legendHoverLink: !0,
- effectType: "ripple",
- progressive: 0,
- showEffectOn: "render",
- rippleEffect: {
- period: 4,
- scale: 2.5,
- brushType: "fill"
- },
- symbolSize: 10
- }
- });
- var NA = kd.prototype;
- NA.stopEffectAnimation = function() {
- this.childAt(1).removeAll()
- }
- ,
- NA.startEffectAnimation = function(t) {
- for (var e = t.symbolType, i = t.color, n = this.childAt(1), o = 0; o < 3; o++) {
- var a = Gr(e, -1, -1, 2, 2, i);
- a.attr({
- style: {
- strokeNoScale: !0
- },
- z2: 99,
- silent: !0,
- scale: [.5, .5]
- });
- var r = -o / 3 * t.period + t.effectOffset;
- a.animate("", !0).when(t.period, {
- scale: [t.rippleScale / 2, t.rippleScale / 2]
- }).delay(r).start(),
- a.animateStyle(!0).when(t.period, {
- opacity: 0
- }).delay(r).start(),
- n.add(a)
- }
- Ld(n, t)
- }
- ,
- NA.updateEffectAnimation = function(t) {
- for (var e = this._effectCfg, i = this.childAt(1), n = ["symbolType", "period", "rippleScale"], o = 0; o < n.length; o++) {
- var a = n[o];
- if (e[a] !== t[a])
- return this.stopEffectAnimation(),
- void this.startEffectAnimation(t)
- }
- Ld(i, t)
- }
- ,
- NA.highlight = function() {
- this.trigger("emphasis")
- }
- ,
- NA.downplay = function() {
- this.trigger("normal")
- }
- ,
- NA.updateData = function(t, e) {
- var i = t.hostModel;
- this.childAt(0).updateData(t, e);
- var n = this.childAt(1)
- , o = t.getItemModel(e)
- , a = t.getItemVisual(e, "symbol")
- , r = Dd(t.getItemVisual(e, "symbolSize"))
- , s = t.getItemVisual(e, "color");
- n.attr("scale", r),
- n.traverse(function(t) {
- t.attr({
- fill: s
- })
- });
- var l = o.getShallow("symbolOffset");
- if (l) {
- var h = n.position;
- h[0] = bi(l[0], r[0]),
- h[1] = bi(l[1], r[1])
- }
- n.rotation = (o.getShallow("symbolRotate") || 0) * Math.PI / 180 || 0;
- var u = {};
- if (u.showEffectOn = i.get("showEffectOn"),
- u.rippleScale = o.get("rippleEffect.scale"),
- u.brushType = o.get("rippleEffect.brushType"),
- u.period = 1e3 * o.get("rippleEffect.period"),
- u.effectOffset = e / t.count(),
- u.z = o.getShallow("z") || 0,
- u.zlevel = o.getShallow("zlevel") || 0,
- u.symbolType = a,
- u.color = s,
- this.off("mouseover").off("mouseout").off("emphasis").off("normal"),
- "render" === u.showEffectOn)
- this._effectCfg ? this.updateEffectAnimation(u) : this.startEffectAnimation(u),
- this._effectCfg = u;
- else {
- this._effectCfg = null,
- this.stopEffectAnimation();
- var c = this.childAt(0)
- , d = function() {
- c.highlight(),
- "render" !== u.showEffectOn && this.startEffectAnimation(u)
- }
- , f = function() {
- c.downplay(),
- "render" !== u.showEffectOn && this.stopEffectAnimation()
- };
- this.on("mouseover", d, this).on("mouseout", f, this).on("emphasis", d, this).on("normal", f, this)
- }
- this._effectCfg = u
- }
- ,
- NA.fadeOut = function(t) {
- this.off("mouseover").off("mouseout").off("emphasis").off("normal"),
- t && t()
- }
- ,
- l(kd, $y),
- hr({
- type: "effectScatter",
- init: function() {
- this._symbolDraw = new Qr(kd)
- },
- render: function(t, e, i) {
- var n = t.getData()
- , o = this._symbolDraw;
- o.updateData(n),
- this.group.add(o.group)
- },
- updateLayout: function() {
- this._symbolDraw.updateLayout()
- },
- remove: function(t, e) {
- this._symbolDraw && this._symbolDraw.remove(e)
- },
- dispose: function() {}
- }),
- or(m(mM, "effectScatter", "circle", null)),
- nr(m(vM, "effectScatter"));
- var EA = bw.extend({
- type: "series.lines",
- dependencies: ["grid", "polar"],
- visualColorAccessPath: "lineStyle.normal.color",
- init: function(t) {
- Pd(t),
- EA.superApply(this, "init", arguments)
- },
- mergeOption: function(t) {
- Pd(t),
- EA.superApply(this, "mergeOption", arguments)
- },
- getInitialData: function(t, e) {
- var i = new lS(["value"],this);
- return i.hasItemOption = !1,
- i.initData(t.data, [], function(t, e, n, o) {
- if (t instanceof Array)
- return NaN;
- i.hasItemOption = !0;
- var a = t.value;
- return null != a ? a instanceof Array ? a[o] : a : void 0
- }),
- i
- },
- formatTooltip: function(t) {
- var e = this.getData().getItemModel(t)
- , i = e.get("name");
- if (i)
- return i;
- var n = e.get("fromName")
- , o = e.get("toName")
- , a = [];
- return null != n && a.push(n),
- null != o && a.push(o),
- Vi(a.join(" > "))
- },
- defaultOption: {
- coordinateSystem: "geo",
- zlevel: 0,
- z: 2,
- legendHoverLink: !0,
- hoverAnimation: !0,
- xAxisIndex: 0,
- yAxisIndex: 0,
- symbol: ["none", "none"],
- symbolSize: [10, 10],
- geoIndex: 0,
- effect: {
- show: !1,
- period: 4,
- constantSpeed: 0,
- symbol: "circle",
- symbolSize: 3,
- loop: !0,
- trailLength: .2
- },
- large: !1,
- largeThreshold: 2e3,
- polyline: !1,
- label: {
- normal: {
- show: !1,
- position: "end"
- }
- },
- lineStyle: {
- normal: {
- opacity: .5
- }
- }
- }
- })
- , RA = Od.prototype;
- RA.createLine = function(t, e, i) {
- return new Iu(t,e,i)
- }
- ,
- RA._updateEffectSymbol = function(t, e) {
- var i = t.getItemModel(e).getModel("effect")
- , n = i.get("symbolSize")
- , o = i.get("symbol");
- v(n) || (n = [n, n]);
- var a = i.get("color") || t.getItemVisual(e, "color")
- , r = this.childAt(1);
- this._symbolType !== o && (this.remove(r),
- (r = Gr(o, -.5, -.5, 1, 1, a)).z2 = 100,
- r.culling = !0,
- this.add(r)),
- r && (r.setStyle("shadowColor", a),
- r.setStyle(i.getItemStyle(["color"])),
- r.attr("scale", n),
- r.setColor(a),
- r.attr("scale", n),
- this._symbolType = o,
- this._updateEffectAnimation(t, i, e))
- }
- ,
- RA._updateEffectAnimation = function(t, e, i) {
- var n = this.childAt(1);
- if (n) {
- var o = this
- , a = t.getItemLayout(i)
- , r = 1e3 * e.get("period")
- , s = e.get("loop")
- , l = e.get("constantSpeed")
- , h = M(e.get("delay"), function(e) {
- return e / t.count() * r / 3
- })
- , u = "function" == typeof h;
- if (n.ignore = !0,
- this.updateAnimationPoints(n, a),
- l > 0 && (r = this.getLineLength(n) / l * 1e3),
- r !== this._period || s !== this._loop) {
- n.stopAnimation();
- var c = h;
- u && (c = h(i)),
- n.__t > 0 && (c = -r * n.__t),
- n.__t = 0;
- var d = n.animate("", s).when(r, {
- __t: 1
- }).delay(c).during(function() {
- o.updateSymbolPosition(n)
- });
- s || d.done(function() {
- o.remove(n)
- }),
- d.start()
- }
- this._period = r,
- this._loop = s
- }
- }
- ,
- RA.getLineLength = function(t) {
- return dy(t.__p1, t.__cp1) + dy(t.__cp1, t.__p2)
- }
- ,
- RA.updateAnimationPoints = function(t, e) {
- t.__p1 = e[0],
- t.__p2 = e[1],
- t.__cp1 = e[2] || [(e[0][0] + e[1][0]) / 2, (e[0][1] + e[1][1]) / 2]
- }
- ,
- RA.updateData = function(t, e, i) {
- this.childAt(0).updateData(t, e, i),
- this._updateEffectSymbol(t, e)
- }
- ,
- RA.updateSymbolPosition = function(t) {
- var e = t.__p1
- , i = t.__p2
- , n = t.__cp1
- , o = t.__t
- , a = t.position
- , r = ln
- , s = hn;
- a[0] = r(e[0], n[0], i[0], o),
- a[1] = r(e[1], n[1], i[1], o);
- var l = s(e[0], n[0], i[0], o)
- , h = s(e[1], n[1], i[1], o);
- t.rotation = -Math.atan2(h, l) - Math.PI / 2,
- t.ignore = !1
- }
- ,
- RA.updateLayout = function(t, e) {
- this.childAt(0).updateLayout(t, e);
- var i = t.getItemModel(e).getModel("effect");
- this._updateEffectAnimation(t, i, e)
- }
- ,
- l(Od, $y);
- var VA = zd.prototype;
- VA._createPolyline = function(t, e, i) {
- var n = t.getItemLayout(e)
- , o = new gb({
- shape: {
- points: n
- }
- });
- this.add(o),
- this._updateCommonStl(t, e, i)
- }
- ,
- VA.updateData = function(t, e, i) {
- var n = t.hostModel;
- _o(this.childAt(0), {
- shape: {
- points: t.getItemLayout(e)
- }
- }, n, e),
- this._updateCommonStl(t, e, i)
- }
- ,
- VA._updateCommonStl = function(t, e, i) {
- var n = this.childAt(0)
- , o = t.getItemModel(e)
- , r = t.getItemVisual(e, "color")
- , s = i && i.lineStyle
- , l = i && i.hoverLineStyle;
- i && !t.hasItemOption || (s = o.getModel("lineStyle.normal").getLineStyle(),
- l = o.getModel("lineStyle.emphasis").getLineStyle()),
- n.useStyle(a({
- strokeNoScale: !0,
- fill: "none",
- stroke: r
- }, s)),
- n.hoverStyle = l,
- lo(this)
- }
- ,
- VA.updateLayout = function(t, e) {
- this.childAt(0).setShape("points", t.getItemLayout(e))
- }
- ,
- l(zd, $y);
- var BA = Nd.prototype;
- BA.createLine = function(t, e, i) {
- return new zd(t,e,i)
- }
- ,
- BA.updateAnimationPoints = function(t, e) {
- this._points = e;
- for (var i = [0], n = 0, o = 1; o < e.length; o++) {
- var a = e[o - 1]
- , r = e[o];
- n += dy(a, r),
- i.push(n)
- }
- if (0 !== n) {
- for (o = 0; o < i.length; o++)
- i[o] /= n;
- this._offsets = i,
- this._length = n
- }
- }
- ,
- BA.getLineLength = function(t) {
- return this._length
- }
- ,
- BA.updateSymbolPosition = function(t) {
- var e = t.__t
- , i = this._points
- , n = this._offsets
- , o = i.length;
- if (n) {
- var a = this._lastFrame;
- if (e < this._lastFramePercent) {
- for (r = Math.min(a + 1, o - 1); r >= 0 && !(n[r] <= e); r--)
- ;
- r = Math.min(r, o - 2)
- } else {
- for (var r = a; r < o && !(n[r] > e); r++)
- ;
- r = Math.min(r - 1, o - 2)
- }
- q(t.position, i[r], i[r + 1], (e - n[r]) / (n[r + 1] - n[r]));
- var s = i[r + 1][0] - i[r][0]
- , l = i[r + 1][1] - i[r][1];
- t.rotation = -Math.atan2(l, s) - Math.PI / 2,
- this._lastFrame = r,
- this._lastFramePercent = e,
- t.ignore = !1
- }
- }
- ,
- l(Nd, Od);
- var GA = Hn({
- shape: {
- polyline: !1,
- segs: []
- },
- buildPath: function(t, e) {
- for (var i = e.segs, n = e.polyline, o = 0; o < i.length; o++) {
- var a = i[o];
- if (n) {
- t.moveTo(a[0][0], a[0][1]);
- for (var r = 1; r < a.length; r++)
- t.lineTo(a[r][0], a[r][1])
- } else
- t.moveTo(a[0][0], a[0][1]),
- a.length > 2 ? t.quadraticCurveTo(a[2][0], a[2][1], a[1][0], a[1][1]) : t.lineTo(a[1][0], a[1][1])
- }
- },
- findDataIndex: function(t, e) {
- for (var i = this.shape, n = i.segs, o = i.polyline, a = Math.max(this.style.lineWidth, 1), r = 0; r < n.length; r++) {
- var s = n[r];
- if (o) {
- for (var l = 1; l < s.length; l++)
- if (xn(s[l - 1][0], s[l - 1][1], s[l][0], s[l][1], a, t, e))
- return r
- } else if (s.length > 2) {
- if (bn(s[0][0], s[0][1], s[2][0], s[2][1], s[1][0], s[1][1], a, t, e))
- return r
- } else if (xn(s[0][0], s[0][1], s[1][0], s[1][1], a, t, e))
- return r
- }
- return -1
- }
- })
- , WA = Ed.prototype;
- WA.updateData = function(t) {
- this.group.removeAll();
- var e = this._lineEl
- , i = t.hostModel;
- e.setShape({
- segs: t.mapArray(t.getItemLayout),
- polyline: i.get("polyline")
- }),
- e.useStyle(i.getModel("lineStyle.normal").getLineStyle());
- var n = t.getVisual("color");
- n && e.setStyle("stroke", n),
- e.setStyle("fill"),
- e.seriesIndex = i.seriesIndex,
- e.on("mousemove", function(t) {
- e.dataIndex = null;
- var i = e.findDataIndex(t.offsetX, t.offsetY);
- i > 0 && (e.dataIndex = i)
- }),
- this.group.add(e)
- }
- ,
- WA.updateLayout = function(t) {
- var e = t.getData();
- this._lineEl.setShape({
- segs: e.mapArray(e.getItemLayout)
- })
- }
- ,
- WA.remove = function() {
- this.group.removeAll()
- }
- ,
- hr({
- type: "lines",
- init: function() {},
- render: function(t, e, i) {
- var n = t.getData()
- , o = this._lineDraw
- , a = t.get("effect.show")
- , r = t.get("polyline")
- , s = t.get("large") && n.count() >= t.get("largeThreshold");
- a === this._hasEffet && r === this._isPolyline && s === this._isLarge || (o && o.remove(),
- o = this._lineDraw = s ? new Ed : new Cu(r ? a ? Nd : zd : a ? Od : Iu),
- this._hasEffet = a,
- this._isPolyline = r,
- this._isLarge = s);
- var l = t.get("zlevel")
- , h = t.get("effect.trailLength")
- , u = i.getZr()
- , c = "svg" === u.painter.getType();
- if (c || u.painter.getLayer(l).clear(!0),
- null == this._lastZlevel || c || u.configLayer(this._lastZlevel, {
- motionBlur: !1
- }),
- a && h) {
- c || u.configLayer(l, {
- motionBlur: !0,
- lastFrameAlpha: Math.max(Math.min(h / 10 + .9, 1), 0)
- })
- }
- this.group.add(o.group),
- o.updateData(n),
- this._lastZlevel = l
- },
- updateLayout: function(t, e, i) {
- this._lineDraw.updateLayout(t);
- var n = i.getZr();
- "svg" === n.painter.getType() || n.painter.getLayer(this._lastZlevel).clear(!0)
- },
- remove: function(t, e) {
- this._lineDraw && this._lineDraw.remove(e, !0);
- var i = e.getZr();
- "svg" === i.painter.getType() || i.painter.getLayer(this._lastZlevel).clear(!0)
- },
- dispose: function() {}
- });
- nr(function(t) {
- t.eachSeriesByType("lines", function(t) {
- var e = t.coordinateSystem
- , i = t.getData();
- i.each(function(n) {
- var o = i.getItemModel(n)
- , a = o.option instanceof Array ? o.option : o.get("coords")
- , r = [];
- if (t.get("polyline"))
- for (var s = 0; s < a.length; s++)
- r.push(e.dataToPoint(a[s]));
- else {
- r[0] = e.dataToPoint(a[0]),
- r[1] = e.dataToPoint(a[1]);
- var l = o.get("lineStyle.normal.curveness");
- +l && (r[2] = [(r[0][0] + r[1][0]) / 2 - (r[0][1] - r[1][1]) * l, (r[0][1] + r[1][1]) / 2 - (r[1][0] - r[0][0]) * l])
- }
- i.setItemLayout(n, r)
- })
- })
- }),
- or(function(t) {
- t.eachSeriesByType("lines", function(t) {
- var e = t.getData()
- , i = Rd(t.get("symbol"))
- , n = Rd(t.get("symbolSize"))
- , o = "lineStyle.normal.opacity".split(".");
- e.setVisual("fromSymbol", i && i[0]),
- e.setVisual("toSymbol", i && i[1]),
- e.setVisual("fromSymbolSize", n && n[0]),
- e.setVisual("toSymbolSize", n && n[1]),
- e.setVisual("opacity", t.get(o)),
- e.each(function(t) {
- var i = e.getItemModel(t)
- , n = Rd(i.getShallow("symbol", !0))
- , a = Rd(i.getShallow("symbolSize", !0))
- , r = i.get(o);
- n[0] && e.setItemVisual(t, "fromSymbol", n[0]),
- n[1] && e.setItemVisual(t, "toSymbol", n[1]),
- a[0] && e.setItemVisual(t, "fromSymbolSize", a[0]),
- a[1] && e.setItemVisual(t, "toSymbolSize", a[1]),
- e.setItemVisual(t, "opacity", r)
- })
- })
- }),
- bw.extend({
- type: "series.heatmap",
- getInitialData: function(t, e) {
- return br(t.data, this, e)
- },
- defaultOption: {
- coordinateSystem: "cartesian2d",
- zlevel: 0,
- z: 2,
- geoIndex: 0,
- blurSize: 30,
- pointSize: 20,
- maxOpacity: 1,
- minOpacity: 0
- }
- });
- Vd.prototype = {
- update: function(t, e, i, n, o, a) {
- var r = this._getBrush()
- , s = this._getGradient(t, o, "inRange")
- , l = this._getGradient(t, o, "outOfRange")
- , h = this.pointSize + this.blurSize
- , u = this.canvas
- , c = u.getContext("2d")
- , d = t.length;
- u.width = e,
- u.height = i;
- for (var f = 0; f < d; ++f) {
- var g = t[f]
- , p = g[0]
- , m = g[1]
- , v = n(g[2]);
- c.globalAlpha = v,
- c.drawImage(r, p - h, m - h)
- }
- if (!u.width || !u.height)
- return u;
- for (var y = c.getImageData(0, 0, u.width, u.height), x = y.data, _ = 0, b = x.length, w = this.minOpacity, S = this.maxOpacity - w; _ < b; ) {
- var v = x[_ + 3] / 256
- , M = 4 * Math.floor(255 * v);
- if (v > 0) {
- var I = a(v) ? s : l;
- v > 0 && (v = v * S + w),
- x[_++] = I[M],
- x[_++] = I[M + 1],
- x[_++] = I[M + 2],
- x[_++] = I[M + 3] * v * 256
- } else
- _ += 4
- }
- return c.putImageData(y, 0, 0),
- u
- },
- _getBrush: function() {
- var t = this._brushCanvas || (this._brushCanvas = ay())
- , e = this.pointSize + this.blurSize
- , i = 2 * e;
- t.width = i,
- t.height = i;
- var n = t.getContext("2d");
- return n.clearRect(0, 0, i, i),
- n.shadowOffsetX = i,
- n.shadowBlur = this.blurSize,
- n.shadowColor = "#000",
- n.beginPath(),
- n.arc(-e, e, this.pointSize, 0, 2 * Math.PI, !0),
- n.closePath(),
- n.fill(),
- t
- },
- _getGradient: function(t, e, i) {
- 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++)
- e[i](s / 255, !0, a),
- o[r++] = a[0],
- o[r++] = a[1],
- o[r++] = a[2],
- o[r++] = a[3];
- return o
- }
- },
- hr({
- type: "heatmap",
- render: function(t, e, i) {
- var n;
- e.eachComponent("visualMap", function(e) {
- e.eachTargetSeries(function(i) {
- i === t && (n = e)
- })
- }),
- this.group.removeAll();
- var o = t.coordinateSystem;
- "cartesian2d" === o.type || "calendar" === o.type ? this._renderOnCartesianAndCalendar(o, t, i) : Wd(o) && this._renderOnGeo(o, t, n, i)
- },
- dispose: function() {},
- _renderOnCartesianAndCalendar: function(t, e, i) {
- if ("cartesian2d" === t.type)
- var n = t.getAxis("x")
- , a = t.getAxis("y")
- , r = n.getBandWidth()
- , s = a.getBandWidth();
- var l = this.group
- , h = e.getData()
- , u = e.getModel("itemStyle.normal").getItemStyle(["color"])
- , c = e.getModel("itemStyle.emphasis").getItemStyle()
- , d = e.getModel("label.normal")
- , f = e.getModel("label.emphasis")
- , g = t.type
- , p = "cartesian2d" === g ? [e.coordDimToDataDim("x")[0], e.coordDimToDataDim("y")[0], e.coordDimToDataDim("value")[0]] : [e.coordDimToDataDim("time")[0], e.coordDimToDataDim("value")[0]];
- h.each(function(i) {
- var n;
- if ("cartesian2d" === g) {
- if (isNaN(h.get(p[2], i)))
- return;
- var a = t.dataToPoint([h.get(p[0], i), h.get(p[1], i)]);
- n = new pb({
- shape: {
- x: a[0] - r / 2,
- y: a[1] - s / 2,
- width: r,
- height: s
- },
- style: {
- fill: h.getItemVisual(i, "color"),
- opacity: h.getItemVisual(i, "opacity")
- }
- })
- } else {
- if (isNaN(h.get(p[1], i)))
- return;
- n = new pb({
- z2: 1,
- shape: t.dataToRect([h.get(p[0], i)]).contentShape,
- style: {
- fill: h.getItemVisual(i, "color"),
- opacity: h.getItemVisual(i, "opacity")
- }
- })
- }
- var m = h.getItemModel(i);
- h.hasItemOption && (u = m.getModel("itemStyle.normal").getItemStyle(["color"]),
- c = m.getModel("itemStyle.emphasis").getItemStyle(),
- d = m.getModel("label.normal"),
- f = m.getModel("label.emphasis"));
- var v = e.getRawValue(i)
- , y = "-";
- v && null != v[2] && (y = v[2]),
- ho(u, c, d, f, {
- labelFetcher: e,
- labelDataIndex: i,
- defaultText: y,
- isRectText: !0
- }),
- n.setStyle(u),
- lo(n, h.hasItemOption ? c : o({}, c)),
- l.add(n),
- h.setItemGraphicEl(i, n)
- })
- },
- _renderOnGeo: function(t, e, i, n) {
- var o = i.targetVisuals.inRange
- , a = i.targetVisuals.outOfRange
- , r = e.getData()
- , s = this._hmLayer || this._hmLayer || new Vd;
- s.blurSize = e.get("blurSize"),
- s.pointSize = e.get("pointSize"),
- s.minOpacity = e.get("minOpacity"),
- s.maxOpacity = e.get("maxOpacity");
- var l = t.getViewRect().clone()
- , h = t.getRoamTransform().transform;
- l.applyTransform(h);
- var u = Math.max(l.x, 0)
- , c = Math.max(l.y, 0)
- , d = Math.min(l.width + l.x, n.getWidth())
- , f = Math.min(l.height + l.y, n.getHeight())
- , g = d - u
- , p = f - c
- , m = r.mapArray(["lng", "lat", "value"], function(e, i, n) {
- var o = t.dataToPoint([e, i]);
- return o[0] -= u,
- o[1] -= c,
- o.push(n),
- o
- })
- , v = i.getExtent()
- , y = "visualMap.continuous" === i.type ? Gd(v, i.option.range) : Bd(v, i.getPieceList(), i.option.selected);
- s.update(m, g, p, o.color.getNormalizer(), {
- inRange: o.color.getColorMapper(),
- outOfRange: a.color.getColorMapper()
- }, y);
- var x = new je({
- style: {
- width: g,
- height: p,
- x: u,
- y: c,
- image: s.canvas
- },
- silent: !0
- });
- this.group.add(x)
- }
- });
- var HA = YM.extend({
- type: "series.pictorialBar",
- dependencies: ["grid"],
- defaultOption: {
- symbol: "circle",
- symbolSize: null,
- symbolRotate: null,
- symbolPosition: null,
- symbolOffset: null,
- symbolMargin: null,
- symbolRepeat: !1,
- symbolRepeatDirection: "end",
- symbolClip: !1,
- symbolBoundingData: null,
- symbolPatternSize: 400,
- barGap: "-100%",
- progressive: 0,
- hoverAnimation: !1
- },
- getInitialData: function(t) {
- return t.stack = null,
- HA.superApply(this, "getInitialData", arguments)
- }
- })
- , FA = ["itemStyle", "normal", "borderWidth"]
- , ZA = [{
- xy: "x",
- wh: "width",
- index: 0,
- posDesc: ["left", "right"]
- }, {
- xy: "y",
- wh: "height",
- index: 1,
- posDesc: ["top", "bottom"]
- }]
- , UA = new rb;
- hr({
- type: "pictorialBar",
- render: function(t, e, i) {
- var n = this.group
- , o = t.getData()
- , a = this._data
- , r = t.coordinateSystem
- , s = !!r.getBaseAxis().isHorizontal()
- , l = r.grid.getRect()
- , h = {
- ecSize: {
- width: i.getWidth(),
- height: i.getHeight()
- },
- seriesModel: t,
- coordSys: r,
- coordSysExtent: [[l.x, l.x + l.width], [l.y, l.y + l.height]],
- isHorizontal: s,
- valueDim: ZA[+s],
- categoryDim: ZA[1 - s]
- };
- return o.diff(a).add(function(t) {
- if (o.hasValue(t)) {
- var e = Qd(o, t)
- , i = Hd(o, t, e, h)
- , a = of(o, h, i);
- o.setItemGraphicEl(t, a),
- n.add(a),
- uf(a, h, i)
- }
- }).update(function(t, e) {
- var i = a.getItemGraphicEl(e);
- if (o.hasValue(t)) {
- var r = Qd(o, t)
- , s = Hd(o, t, r, h)
- , l = sf(o, s);
- i && l !== i.__pictorialShapeStr && (n.remove(i),
- o.setItemGraphicEl(t, null),
- i = null),
- i ? af(i, h, s) : i = of(o, h, s, !0),
- o.setItemGraphicEl(t, i),
- i.__pictorialSymbolMeta = s,
- n.add(i),
- uf(i, h, s)
- } else
- n.remove(i)
- }).remove(function(t) {
- var e = a.getItemGraphicEl(t);
- e && rf(a, t, e.__pictorialSymbolMeta.animationModel, e)
- }).execute(),
- this._data = o,
- this.group
- },
- dispose: z,
- remove: function(t, e) {
- var i = this.group
- , n = this._data;
- t.get("animation") ? n && n.eachItemGraphicEl(function(e) {
- rf(n, e.dataIndex, t, e)
- }) : i.removeAll()
- }
- });
- nr(m(il, "pictorialBar")),
- or(m(mM, "pictorialBar", "roundRect", null));
- var jA = function(t, e, i, n, o) {
- YS.call(this, t, e, i),
- this.type = n || "value",
- this.position = o || "bottom",
- this.orient = null,
- this._labelInterval = null
- };
- jA.prototype = {
- constructor: jA,
- model: null,
- isHorizontal: function() {
- var t = this.position;
- return "top" === t || "bottom" === t
- },
- pointToData: function(t, e) {
- return this.coordinateSystem.pointToData(t, e)[0]
- },
- toGlobalCoord: null,
- toLocalCoord: null
- },
- l(jA, YS),
- df.prototype = {
- type: "singleAxis",
- axisPointerEnabled: !0,
- constructor: df,
- _init: function(t, e, i) {
- var n = this.dimension
- , o = new jA(n,zr(t),[0, 0],t.get("type"),t.get("position"))
- , a = "category" === o.type;
- o.onBand = a && t.get("boundaryGap"),
- o.inverse = t.get("inverse"),
- o.orient = t.get("orient"),
- t.axis = o,
- o.model = t,
- o.coordinateSystem = this,
- this._axis = o
- },
- update: function(t, e) {
- t.eachSeries(function(t) {
- if (t.coordinateSystem === this) {
- var e = t.getData()
- , i = this.dimension;
- this._axis.scale.unionExtentFromData(e, t.coordDimToDataDim(i)),
- Or(this._axis.scale, this._axis.model)
- }
- }, this)
- },
- resize: function(t, e) {
- this._rect = Yo({
- left: t.get("left"),
- top: t.get("top"),
- right: t.get("right"),
- bottom: t.get("bottom"),
- width: t.get("width"),
- height: t.get("height")
- }, {
- width: e.getWidth(),
- height: e.getHeight()
- }),
- this._adjustAxis()
- },
- getRect: function() {
- return this._rect
- },
- _adjustAxis: function() {
- var t = this._rect
- , e = this._axis
- , i = e.isHorizontal()
- , n = i ? [0, t.width] : [0, t.height]
- , o = e.reverse ? 1 : 0;
- e.setExtent(n[o], n[1 - o]),
- this._updateAxisTransform(e, i ? t.x : t.y)
- },
- _updateAxisTransform: function(t, e) {
- var i = t.getExtent()
- , n = i[0] + i[1]
- , o = t.isHorizontal();
- t.toGlobalCoord = o ? function(t) {
- return t + e
- }
- : function(t) {
- return n - t + e
- }
- ,
- t.toLocalCoord = o ? function(t) {
- return t - e
- }
- : function(t) {
- return n - t + e
- }
- },
- getAxis: function() {
- return this._axis
- },
- getBaseAxis: function() {
- return this._axis
- },
- getAxes: function() {
- return [this._axis]
- },
- getTooltipAxes: function() {
- return {
- baseAxes: [this.getAxis()]
- }
- },
- containPoint: function(t) {
- var e = this.getRect()
- , i = this.getAxis();
- 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
- },
- pointToData: function(t) {
- var e = this.getAxis();
- return [e.coordToData(e.toLocalCoord(t["horizontal" === e.orient ? 0 : 1]))]
- },
- dataToPoint: function(t) {
- var e = this.getAxis()
- , i = this.getRect()
- , n = []
- , o = "horizontal" === e.orient ? 0 : 1;
- return t instanceof Array && (t = t[0]),
- n[o] = e.toGlobalCoord(e.dataToCoord(+t)),
- n[1 - o] = 0 === o ? i.y + i.height / 2 : i.x + i.width / 2,
- n
- }
- },
- ha.register("single", {
- create: function(t, e) {
- var i = [];
- return t.eachComponent("singleAxis", function(n, o) {
- var a = new df(n,t,e);
- a.name = "single_" + o,
- a.resize(n, e),
- n.coordinateSystem = a,
- i.push(a)
- }),
- t.eachSeries(function(e) {
- if ("singleAxis" === e.get("coordinateSystem")) {
- var i = t.queryComponents({
- mainType: "singleAxis",
- index: e.get("singleAxisIndex"),
- id: e.get("singleAxisId")
- })[0];
- e.coordinateSystem = i && i.coordinateSystem
- }
- }),
- i
- },
- dimensions: df.prototype.dimensions
- });
- var XA = zM.getInterval
- , qA = zM.ifIgnoreOnTick
- , YA = ["axisLine", "axisTickLabel", "axisName"]
- , $A = WM.extend({
- type: "singleAxis",
- axisPointerClass: "SingleAxisPointer",
- render: function(t, e, i, n) {
- var o = this.group;
- o.removeAll();
- var a = ff(t)
- , r = new zM(t,a);
- c(YA, r.add, r),
- o.add(r.getGroup()),
- t.get("splitLine.show") && this._splitLine(t, a.labelInterval),
- $A.superCall(this, "render", t, e, i, n)
- },
- _splitLine: function(t, e) {
- var i = t.axis;
- if (!i.scale.isBlank()) {
- var n = t.getModel("splitLine")
- , o = n.getModel("lineStyle")
- , a = o.get("width")
- , r = o.get("color")
- , s = XA(n, e);
- r = r instanceof Array ? r : [r];
- for (var l = t.coordinateSystem.getRect(), h = i.isHorizontal(), u = [], c = 0, d = i.getTicksCoords(), f = [], g = [], p = t.get("axisLabel.showMinLabel"), m = t.get("axisLabel.showMaxLabel"), v = 0; v < d.length; ++v)
- if (!qA(i, v, s, d.length, p, m)) {
- var y = i.toGlobalCoord(d[v]);
- h ? (f[0] = y,
- f[1] = l.y,
- g[0] = y,
- g[1] = l.y + l.height) : (f[0] = l.x,
- f[1] = y,
- g[0] = l.x + l.width,
- g[1] = y);
- var x = c++ % r.length;
- u[x] = u[x] || [],
- u[x].push(new mb(Xn({
- shape: {
- x1: f[0],
- y1: f[1],
- x2: g[0],
- y2: g[1]
- },
- style: {
- lineWidth: a
- },
- silent: !0
- })))
- }
- for (v = 0; v < u.length; ++v)
- this.group.add(Cb(u[v], {
- style: {
- stroke: r[v % r.length],
- lineDash: o.getLineDash(a),
- lineWidth: a
- },
- silent: !0
- }))
- }
- }
- })
- , KA = qb.extend({
- type: "singleAxis",
- layoutMode: "box",
- axis: null,
- coordinateSystem: null,
- getCoordSysModel: function() {
- return this
- }
- })
- , JA = {
- left: "5%",
- top: "5%",
- right: "5%",
- bottom: "5%",
- type: "value",
- position: "bottom",
- orient: "horizontal",
- axisLine: {
- show: !0,
- lineStyle: {
- width: 2,
- type: "solid"
- }
- },
- tooltip: {
- show: !0
- },
- axisTick: {
- show: !0,
- length: 6,
- lineStyle: {
- width: 2
- }
- },
- axisLabel: {
- show: !0,
- interval: "auto"
- },
- splitLine: {
- show: !0,
- lineStyle: {
- type: "dashed",
- opacity: .2
- }
- }
- };
- i(KA.prototype, VS),
- IM("single", KA, function(t, e) {
- return e.type || (e.data ? "category" : "value")
- }, JA);
- var QA = function(t, e) {
- var i, n = [], o = t.seriesIndex;
- if (null == o || !(i = e.getSeriesByIndex(o)))
- return {
- point: []
- };
- var a = i.getData()
- , r = Go(a, t);
- if (null == r || v(r))
- return {
- point: []
- };
- var s = a.getItemGraphicEl(r)
- , l = i.coordinateSystem;
- if (i.getTooltipPosition)
- n = i.getTooltipPosition(r) || [];
- else if (l && l.dataToPoint)
- n = l.dataToPoint(a.getValues(d(l.dimensions, function(t) {
- return i.coordDimToDataDim(t)[0]
- }), r, !0)) || [];
- else if (s) {
- var h = s.getBoundingRect().clone();
- h.applyTransform(s.transform),
- n = [h.x + h.width / 2, h.y + h.height / 2]
- }
- return {
- point: n,
- el: s
- }
- }
- , tC = c
- , eC = m
- , iC = Bb()
- , nC = (rr({
- type: "axisPointer",
- coordSysAxesInfo: null,
- defaultOption: {
- show: "auto",
- triggerOn: null,
- zlevel: 0,
- z: 50,
- type: "line",
- snap: !1,
- triggerTooltip: !0,
- value: null,
- status: null,
- link: [],
- animation: null,
- animationDurationUpdate: 200,
- lineStyle: {
- color: "#aaa",
- width: 1,
- type: "solid"
- },
- shadowStyle: {
- color: "rgba(150,150,150,0.3)"
- },
- label: {
- show: !0,
- formatter: null,
- precision: "auto",
- margin: 3,
- color: "#fff",
- padding: [5, 7, 5, 7],
- backgroundColor: "auto",
- borderColor: null,
- borderWidth: 0,
- shadowBlur: 3,
- shadowColor: "#aaa"
- },
- handle: {
- show: !1,
- icon: "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",
- size: 45,
- margin: 50,
- color: "#333",
- shadowBlur: 3,
- shadowColor: "#aaa",
- shadowOffsetX: 0,
- shadowOffsetY: 2,
- throttle: 40
- }
- }
- }),
- Bb())
- , oC = c
- , aC = sr({
- type: "axisPointer",
- render: function(t, e, i) {
- var n = e.getComponent("tooltip")
- , o = t.get("triggerOn") || n && n.get("triggerOn") || "mousemove|click";
- Mf("axisPointer", i, function(t, e, i) {
- "none" !== o && ("leave" === t || o.indexOf(t) >= 0) && i({
- type: "updateAxisPointer",
- currTrigger: t,
- x: e && e.offsetX,
- y: e && e.offsetY
- })
- })
- },
- remove: function(t, e) {
- Lf(e.getZr(), "axisPointer"),
- aC.superApply(this._model, "remove", arguments)
- },
- dispose: function(t, e) {
- Lf("axisPointer", e),
- aC.superApply(this._model, "dispose", arguments)
- }
- })
- , rC = Bb()
- , sC = e
- , lC = p;
- (kf.prototype = {
- _group: null,
- _lastGraphicKey: null,
- _handle: null,
- _dragging: !1,
- _lastValue: null,
- _lastStatus: null,
- _payloadInfo: null,
- animationThreshold: 15,
- render: function(t, e, i, n) {
- var o = e.get("value")
- , a = e.get("status");
- if (this._axisModel = t,
- this._axisPointerModel = e,
- this._api = i,
- n || this._lastValue !== o || this._lastStatus !== a) {
- this._lastValue = o,
- this._lastStatus = a;
- var r = this._group
- , s = this._handle;
- if (!a || "hide" === a)
- return r && r.hide(),
- void (s && s.hide());
- r && r.show(),
- s && s.show();
- var l = {};
- this.makeElOption(l, o, t, e, i);
- var h = l.graphicKey;
- h !== this._lastGraphicKey && this.clear(i),
- this._lastGraphicKey = h;
- var u = this._moveAnimation = this.determineAnimation(t, e);
- if (r) {
- var c = m(Pf, e, u);
- this.updatePointerEl(r, l, c, e),
- this.updateLabelEl(r, l, c, e)
- } else
- r = this._group = new $y,
- this.createPointerEl(r, l, t, e),
- this.createLabelEl(r, l, t, e),
- i.getZr().add(r);
- Ef(r, e, !0),
- this._renderHandle(o)
- }
- },
- remove: function(t) {
- this.clear(t)
- },
- dispose: function(t) {
- this.clear(t)
- },
- determineAnimation: function(t, e) {
- var i = e.get("animation")
- , n = t.axis
- , o = "category" === n.type
- , a = e.get("snap");
- if (!a && !o)
- return !1;
- if ("auto" === i || null == i) {
- var r = this.animationThreshold;
- if (o && n.getBandWidth() > r)
- return !0;
- if (a) {
- var s = Us(t).seriesDataCount
- , l = n.getExtent();
- return Math.abs(l[0] - l[1]) / s > r
- }
- return !1
- }
- return !0 === i
- },
- makeElOption: function(t, e, i, n, o) {},
- createPointerEl: function(t, e, i, n) {
- var o = e.pointer;
- if (o) {
- var a = rC(t).pointerEl = new Db[o.type](sC(e.pointer));
- t.add(a)
- }
- },
- createLabelEl: function(t, e, i, n) {
- if (e.label) {
- var o = rC(t).labelEl = new pb(sC(e.label));
- t.add(o),
- zf(o, n)
- }
- },
- updatePointerEl: function(t, e, i) {
- var n = rC(t).pointerEl;
- n && (n.setStyle(e.pointer.style),
- i(n, {
- shape: e.pointer.shape
- }))
- },
- updateLabelEl: function(t, e, i, n) {
- var o = rC(t).labelEl;
- o && (o.setStyle(e.label.style),
- i(o, {
- shape: e.label.shape,
- position: e.label.position
- }),
- zf(o, n))
- },
- _renderHandle: function(t) {
- if (!this._dragging && this.updateHandleTransform) {
- var e = this._axisPointerModel
- , i = this._api.getZr()
- , n = this._handle
- , o = e.getModel("handle")
- , a = e.get("status");
- if (!o.get("show") || !a || "hide" === a)
- return n && i.remove(n),
- void (this._handle = null);
- var r;
- this._handle || (r = !0,
- n = this._handle = Ao(o.get("icon"), {
- cursor: "move",
- draggable: !0,
- onmousemove: function(t) {
- Ix(t.event)
- },
- onmousedown: lC(this._onHandleDragMove, this, 0, 0),
- drift: lC(this._onHandleDragMove, this),
- ondragend: lC(this._onHandleDragEnd, this)
- }),
- i.add(n)),
- Ef(n, e, !1);
- var s = ["color", "borderColor", "borderWidth", "opacity", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"];
- n.setStyle(o.getItemStyle(null, s));
- var l = o.get("size");
- v(l) || (l = [l, l]),
- n.attr("scale", [l[0] / 2, l[1] / 2]),
- Da(this, "_doDispatchAxisPointer", o.get("throttle") || 0, "fixRate"),
- this._moveHandleToValue(t, r)
- }
- },
- _moveHandleToValue: function(t, e) {
- Pf(this._axisPointerModel, !e && this._moveAnimation, this._handle, Nf(this.getHandleTransform(t, this._axisModel, this._axisPointerModel)))
- },
- _onHandleDragMove: function(t, e) {
- var i = this._handle;
- if (i) {
- this._dragging = !0;
- var n = this.updateHandleTransform(Nf(i), [t, e], this._axisModel, this._axisPointerModel);
- this._payloadInfo = n,
- i.stopAnimation(),
- i.attr(Nf(n)),
- rC(i).lastProp = null,
- this._doDispatchAxisPointer()
- }
- },
- _doDispatchAxisPointer: function() {
- if (this._handle) {
- var t = this._payloadInfo
- , e = this._axisModel;
- this._api.dispatchAction({
- type: "updateAxisPointer",
- x: t.cursorPoint[0],
- y: t.cursorPoint[1],
- tooltipOption: t.tooltipOption,
- axesInfo: [{
- axisDim: e.axis.dim,
- axisIndex: e.componentIndex
- }]
- })
- }
- },
- _onHandleDragEnd: function(t) {
- if (this._dragging = !1,
- this._handle) {
- var e = this._axisPointerModel.get("value");
- this._moveHandleToValue(e),
- this._api.dispatchAction({
- type: "hideTip"
- })
- }
- },
- getHandleTransform: null,
- updateHandleTransform: null,
- clear: function(t) {
- this._lastValue = null,
- this._lastStatus = null;
- var e = t.getZr()
- , i = this._group
- , n = this._handle;
- e && i && (this._lastGraphicKey = null,
- i && e.remove(i),
- n && e.remove(n),
- this._group = null,
- this._handle = null,
- this._payloadInfo = null)
- },
- doClear: function() {},
- buildLabel: function(t, e, i) {
- return i = i || 0,
- {
- x: t[i],
- y: t[1 - i],
- width: e[i],
- height: e[1 - i]
- }
- }
- }).constructor = kf,
- Yi(kf);
- var hC = kf.extend({
- makeElOption: function(t, e, i, n, o) {
- var a = i.axis
- , r = a.grid
- , s = n.get("type")
- , l = jf(r, a).getOtherAxis(a).getGlobalExtent()
- , h = a.toGlobalCoord(a.dataToCoord(e, !0));
- if (s && "none" !== s) {
- var u = Rf(n)
- , c = uC[s](a, h, l, u);
- c.style = u,
- t.graphicKey = c.type,
- t.pointer = c
- }
- Hf(e, t, Ks(r.model, i), i, n, o)
- },
- getHandleTransform: function(t, e, i) {
- var n = Ks(e.axis.grid.model, e, {
- labelInside: !1
- });
- return n.labelMargin = i.get("handle.margin"),
- {
- position: Wf(e.axis, t, n),
- rotation: n.rotation + (n.labelDirection < 0 ? Math.PI : 0)
- }
- },
- updateHandleTransform: function(t, e, i, n) {
- var o = i.axis
- , a = o.grid
- , r = o.getGlobalExtent(!0)
- , s = jf(a, o).getOtherAxis(o).getGlobalExtent()
- , l = "x" === o.dim ? 0 : 1
- , h = t.position;
- h[l] += e[l],
- h[l] = Math.min(r[1], h[l]),
- h[l] = Math.max(r[0], h[l]);
- var u = (s[1] + s[0]) / 2
- , c = [u, u];
- c[l] = h[l];
- var d = [{
- verticalAlign: "middle"
- }, {
- align: "center"
- }];
- return {
- position: h,
- rotation: t.rotation,
- cursorPoint: c,
- tooltipOption: d[l]
- }
- }
- })
- , uC = {
- line: function(t, e, i, n) {
- var o = Ff([e, i[0]], [e, i[1]], Xf(t));
- return Xn({
- shape: o,
- style: n
- }),
- {
- type: "Line",
- shape: o
- }
- },
- shadow: function(t, e, i, n) {
- var o = t.getBandWidth()
- , a = i[1] - i[0];
- return {
- type: "Rect",
- shape: Zf([e - o / 2, i[0]], [o, a], Xf(t))
- }
- }
- };
- WM.registerAxisPointerClass("CartesianAxisPointer", hC),
- Qa(function(t) {
- if (t) {
- (!t.axisPointer || 0 === t.axisPointer.length) && (t.axisPointer = {});
- var e = t.axisPointer.link;
- e && !v(e) && (t.axisPointer.link = [e])
- }
- }),
- tr(Ew.PROCESSOR.STATISTIC, function(t, e) {
- t.getComponent("axisPointer").coordSysAxesInfo = Vs(t, e)
- }),
- er({
- type: "updateAxisPointer",
- event: "updateAxisPointer",
- update: ":updateAxisPointer"
- }, function(t, e, i) {
- var n = t.currTrigger
- , o = [t.x, t.y]
- , a = t
- , r = t.dispatchAction || p(i.dispatchAction, i)
- , s = e.getComponent("axisPointer").coordSysAxesInfo;
- if (s) {
- Sf(o) && (o = QA({
- seriesIndex: a.seriesIndex,
- dataIndex: a.dataIndex
- }, e).point);
- var l = Sf(o)
- , h = a.axesInfo
- , u = s.axesInfo
- , c = "leave" === n || Sf(o)
- , d = {}
- , f = {}
- , g = {
- list: [],
- map: {}
- }
- , m = {
- showPointer: eC(mf, f),
- showTooltip: eC(vf, g)
- };
- tC(s.coordSysMap, function(t, e) {
- var i = l || t.containPoint(o);
- tC(s.coordSysAxesInfo[e], function(t, e) {
- var n = t.axis
- , a = bf(h, t);
- if (!c && i && (!h || a)) {
- var r = a && a.value;
- null != r || l || (r = n.pointToData(o)),
- null != r && gf(t, r, m, !1, d)
- }
- })
- });
- var v = {};
- return tC(u, function(t, e) {
- var i = t.linkGroup;
- i && !f[e] && tC(i.axesInfo, function(e, n) {
- var o = f[n];
- if (e !== t && o) {
- var a = o.value;
- i.mapper && (a = t.axis.scale.parse(i.mapper(a, wf(e), wf(t)))),
- v[t.key] = a
- }
- })
- }),
- tC(v, function(t, e) {
- gf(u[e], t, m, !0, d)
- }),
- yf(f, u, d),
- xf(g, o, t, r),
- _f(u, 0, i),
- d
- }
- });
- var cC = ["x", "y"]
- , dC = ["width", "height"]
- , fC = kf.extend({
- makeElOption: function(t, e, i, n, o) {
- var a = i.axis
- , r = a.coordinateSystem
- , s = Yf(r, 1 - qf(a))
- , l = r.dataToPoint(e)[0]
- , h = n.get("type");
- if (h && "none" !== h) {
- var u = Rf(n)
- , c = gC[h](a, l, s, u);
- c.style = u,
- t.graphicKey = c.type,
- t.pointer = c
- }
- Hf(e, t, ff(i), i, n, o)
- },
- getHandleTransform: function(t, e, i) {
- var n = ff(e, {
- labelInside: !1
- });
- return n.labelMargin = i.get("handle.margin"),
- {
- position: Wf(e.axis, t, n),
- rotation: n.rotation + (n.labelDirection < 0 ? Math.PI : 0)
- }
- },
- updateHandleTransform: function(t, e, i, n) {
- var o = i.axis
- , a = o.coordinateSystem
- , r = qf(o)
- , s = Yf(a, r)
- , l = t.position;
- l[r] += e[r],
- l[r] = Math.min(s[1], l[r]),
- l[r] = Math.max(s[0], l[r]);
- var h = Yf(a, 1 - r)
- , u = (h[1] + h[0]) / 2
- , c = [u, u];
- return c[r] = l[r],
- {
- position: l,
- rotation: t.rotation,
- cursorPoint: c,
- tooltipOption: {
- verticalAlign: "middle"
- }
- }
- }
- })
- , gC = {
- line: function(t, e, i, n) {
- var o = Ff([e, i[0]], [e, i[1]], qf(t));
- return Xn({
- shape: o,
- style: n
- }),
- {
- type: "Line",
- shape: o
- }
- },
- shadow: function(t, e, i, n) {
- var o = t.getBandWidth()
- , a = i[1] - i[0];
- return {
- type: "Rect",
- shape: Zf([e - o / 2, i[0]], [o, a], qf(t))
- }
- }
- };
- WM.registerAxisPointerClass("SingleAxisPointer", fC),
- sr({
- type: "single"
- });
- var pC = bw.extend({
- type: "series.themeRiver",
- dependencies: ["singleAxis"],
- nameMap: null,
- init: function(t) {
- pC.superApply(this, "init", arguments),
- this.legendDataProvider = function() {
- return this.getRawData()
- }
- },
- fixData: function(t) {
- for (var e = t.length, i = d(Kc().key(function(t) {
- return t[2]
- }).entries(t), function(t) {
- return {
- name: t.key,
- dataList: t.values
- }
- }), n = i.length, o = -1, a = -1, r = 0; r < n; ++r) {
- var s = i[r].dataList.length;
- s > o && (o = s,
- a = r)
- }
- for (var l = 0; l < n; ++l)
- if (l !== a)
- for (var h = i[l].name, u = 0; u < o; ++u) {
- for (var c = i[a].dataList[u][0], f = i[l].dataList.length, g = -1, p = 0; p < f; ++p)
- if (i[l].dataList[p][0] === c) {
- g = p;
- break
- }
- -1 === g && (t[e] = [],
- t[e][0] = c,
- t[e][1] = 0,
- t[e][2] = h,
- e++)
- }
- return t
- },
- getInitialData: function(t, e) {
- var i = []
- , n = e.queryComponents({
- mainType: "singleAxis",
- index: this.get("singleAxisIndex"),
- id: this.get("singleAxisId")
- })[0].get("type");
- i = [{
- name: "time",
- type: "category" === n ? "ordinal" : "time" === n ? "time" : "float"
- }, {
- name: "value",
- type: "float"
- }, {
- name: "name",
- type: "ordinal"
- }];
- for (var o = g(t.data, function(t) {
- return void 0 !== t[2]
- }), a = this.fixData(o || []), r = [], s = this.nameMap = O(), l = 0, h = 0; h < a.length; ++h)
- r.push(a[h][2]),
- s.get(a[h][2]) || (s.set(a[h][2], l),
- l++);
- i = vr(i, a);
- var u = new lS(i,this);
- return u.initData(a, r),
- u
- },
- coordDimToDataDim: function(t) {
- return ["time"]
- },
- getLayerSeries: function() {
- for (var t = this.getData(), e = t.count(), i = [], n = 0; n < e; ++n)
- i[n] = n;
- for (var o = d(Kc().key(function(e) {
- return t.get("name", e)
- }).entries(i), function(t) {
- return {
- name: t.key,
- indices: t.values
- }
- }), a = 0; a < o.length; ++a)
- o[a].indices.sort(function(e, i) {
- return t.get("time", e) - t.get("time", i)
- });
- return o
- },
- getAxisTooltipData: function(t, e, i) {
- v(t) || (t = t ? [t] : []);
- for (var n, o = this.getData(), a = this.getLayerSeries(), r = [], s = a.length, l = 0; l < s; ++l) {
- for (var h = Number.MAX_VALUE, u = -1, c = a[l].indices.length, d = 0; d < c; ++d) {
- var f = o.get(t[0], a[l].indices[d])
- , g = Math.abs(f - e);
- g <= h && (n = f,
- h = g,
- u = a[l].indices[d])
- }
- r.push(u)
- }
- return {
- dataIndices: r,
- nestestValue: n
- }
- },
- formatTooltip: function(t) {
- var e = this.getData()
- , i = e.get("name", t)
- , n = e.get("value", t);
- return (isNaN(n) || null == n) && (n = "-"),
- Vi(i + " : " + n)
- },
- defaultOption: {
- zlevel: 0,
- z: 2,
- coordinateSystem: "singleAxis",
- boundaryGap: ["10%", "10%"],
- singleAxisIndex: 0,
- animationEasing: "linear",
- label: {
- normal: {
- margin: 4,
- textAlign: "right",
- show: !0,
- position: "left",
- color: "#000",
- fontSize: 11
- },
- emphasis: {
- show: !0
- }
- }
- }
- });
- hr({
- type: "themeRiver",
- init: function() {
- this._layers = []
- },
- render: function(t, e, i) {
- function n(t) {
- return t.name
- }
- function a(e, i, n) {
- var a = this._layers;
- if ("remove" !== e) {
- for (var h, u = [], c = [], f = l[i].indices, g = 0; g < f.length; g++) {
- var p = r.getItemLayout(f[g])
- , m = p.x
- , v = p.y0
- , y = p.y;
- u.push([m, v]),
- c.push([m, v + y]),
- h = r.getItemVisual(f[g], "color")
- }
- var x, _, b = r.getItemLayout(f[0]), w = r.getItemModel(f[g - 1]), S = w.getModel("label.normal"), M = S.get("margin");
- if ("add" === e) {
- I = d[i] = new $y;
- x = new pM({
- shape: {
- points: u,
- stackedOnPoints: c,
- smooth: .4,
- stackedOnSmooth: .4,
- smoothConstraint: !1
- },
- z2: 0
- }),
- _ = new ab({
- style: {
- x: b.x - M,
- y: b.y0 + b.y / 2
- }
- }),
- I.add(x),
- I.add(_),
- s.add(I),
- x.setClipPath($f(x.getBoundingRect(), t, function() {
- x.removeClipPath()
- }))
- } else {
- var I = a[n];
- x = I.childAt(0),
- _ = I.childAt(1),
- s.add(I),
- d[i] = I,
- _o(x, {
- shape: {
- points: u,
- stackedOnPoints: c
- }
- }, t),
- _o(_, {
- style: {
- x: b.x - M,
- y: b.y0 + b.y / 2
- }
- }, t)
- }
- var T = w.getModel("itemStyle.emphasis")
- , A = w.getModel("itemStyle.normal");
- uo(_.style, S, {
- text: S.get("show") ? t.getFormattedLabel(f[g - 1], "normal") || r.getName(f[g - 1]) : null,
- textVerticalAlign: "middle"
- }),
- x.setStyle(o({
- fill: h
- }, A.getItemStyle(["color"]))),
- lo(x, T.getItemStyle())
- } else
- s.remove(a[i])
- }
- var r = t.getData()
- , s = this.group
- , l = t.getLayerSeries()
- , h = r.getLayout("layoutInfo")
- , u = h.rect
- , c = h.boundaryGap;
- s.attr("position", [0, u.y + c[0]]);
- var d = {};
- new cr(this._layersSeries || [],l,n,n).add(p(a, this, "add")).update(p(a, this, "update")).remove(p(a, this, "remove")).execute(),
- this._layersSeries = l,
- this._layers = d
- },
- dispose: function() {}
- });
- nr(function(t, e) {
- t.eachSeriesByType("themeRiver", function(t) {
- var e = t.getData()
- , i = t.coordinateSystem
- , n = {}
- , o = i.getRect();
- n.rect = o;
- var a = t.get("boundaryGap")
- , r = i.getAxis();
- n.boundaryGap = a,
- "horizontal" === r.orient ? (a[0] = bi(a[0], o.height),
- a[1] = bi(a[1], o.height),
- Kf(e, t, o.height - a[0] - a[1])) : (a[0] = bi(a[0], o.width),
- a[1] = bi(a[1], o.width),
- Kf(e, t, o.width - a[0] - a[1])),
- e.setLayout("layoutInfo", n)
- })
- }),
- or(function(t) {
- t.eachSeriesByType("themeRiver", function(t) {
- var e = t.getData()
- , i = t.getRawData()
- , n = t.get("color")
- , o = O();
- e.each(function(t) {
- o.set(e.getRawIndex(t), t)
- }),
- i.each(function(a) {
- var r = i.getName(a)
- , s = n[(t.nameMap.get(r) - 1) % n.length];
- i.setItemVisual(a, "color", s);
- var l = o.get(a);
- null != l && e.setItemVisual(l, "color", s)
- })
- })
- }),
- tr(m(hI, "themeRiver"));
- var mC = ["itemStyle", "normal"]
- , vC = ["itemStyle", "emphasis"]
- , yC = ["label", "normal"]
- , xC = ["label", "emphasis"]
- , _C = "e\0\0"
- , bC = {
- cartesian2d: function(t) {
- var e = t.grid.getRect();
- return {
- coordSys: {
- type: "cartesian2d",
- x: e.x,
- y: e.y,
- width: e.width,
- height: e.height
- },
- api: {
- coord: p(t.dataToPoint, t),
- size: p(Qf, t)
- }
- }
- },
- geo: function(t) {
- var e = t.getBoundingRect();
- return {
- coordSys: {
- type: "geo",
- x: e.x,
- y: e.y,
- width: e.width,
- height: e.height
- },
- api: {
- coord: p(t.dataToPoint, t),
- size: p(tg, t)
- }
- }
- },
- singleAxis: function(t) {
- var e = t.getRect();
- return {
- coordSys: {
- type: "singleAxis",
- x: e.x,
- y: e.y,
- width: e.width,
- height: e.height
- },
- api: {
- coord: p(t.dataToPoint, t),
- size: p(eg, t)
- }
- }
- },
- polar: function(t) {
- var e = t.getRadiusAxis()
- , i = t.getAngleAxis()
- , n = e.getExtent();
- return n[0] > n[1] && n.reverse(),
- {
- coordSys: {
- type: "polar",
- cx: t.cx,
- cy: t.cy,
- r: n[1],
- r0: n[0]
- },
- api: {
- coord: p(function(n) {
- var o = e.dataToRadius(n[0])
- , a = i.dataToAngle(n[1])
- , r = t.coordToPoint([o, a]);
- return r.push(o, a * Math.PI / 180),
- r
- }),
- size: p(ig, t)
- }
- }
- },
- calendar: function(t) {
- var e = t.getRect()
- , i = t.getRangeInfo();
- return {
- coordSys: {
- type: "calendar",
- x: e.x,
- y: e.y,
- width: e.width,
- height: e.height,
- cellWidth: t.getCellWidth(),
- cellHeight: t.getCellHeight(),
- rangeInfo: {
- start: i.start,
- end: i.end,
- weeks: i.weeks,
- dayCount: i.allDay
- }
- },
- api: {
- coord: p(t.dataToPoint, t)
- }
- }
- }
- };
- lr({
- type: "series.custom",
- dependencies: ["grid", "polar", "geo", "singleAxis", "calendar"],
- defaultOption: {
- coordinateSystem: "cartesian2d",
- zlevel: 0,
- z: 2,
- legendHoverLink: !0
- },
- getInitialData: function(t, e) {
- return br(t.data, this, e)
- }
- }),
- hr({
- type: "custom",
- _data: null,
- render: function(t, e, i) {
- var n = this._data
- , o = t.getData()
- , a = this.group
- , r = rg(t, o, e, i);
- o.diff(n).add(function(e) {
- o.hasValue(e) && lg(null, e, r(e), t, a, o)
- }).update(function(e, i) {
- var s = n.getItemGraphicEl(i);
- o.hasValue(e) ? lg(s, e, r(e), t, a, o) : s && a.remove(s)
- }).remove(function(t) {
- var e = n.getItemGraphicEl(t);
- e && a.remove(e)
- }).execute(),
- this._data = o
- },
- dispose: z
- }),
- Qa(function(t) {
- var e = t.graphic;
- v(e) ? e[0] && e[0].elements ? t.graphic = [t.graphic[0]] : t.graphic = [{
- elements: e
- }] : e && !e.elements && (t.graphic = [{
- elements: [e]
- }])
- });
- var wC = rr({
- type: "graphic",
- defaultOption: {
- elements: [],
- parentId: null
- },
- _elOptionsToUpdate: null,
- mergeOption: function(t) {
- var e = this.option.elements;
- this.option.elements = null,
- wC.superApply(this, "mergeOption", arguments),
- this.option.elements = e
- },
- optionUpdated: function(t, e) {
- var i = this.option
- , n = (e ? i : t).elements
- , o = i.elements = e ? [] : i.elements
- , a = [];
- this._flatten(n, a);
- var r = Eo(o, a);
- Ro(r);
- var s = this._elOptionsToUpdate = [];
- c(r, function(t, e) {
- var i = t.option;
- i && (s.push(i),
- yg(t, i),
- xg(o, e, i),
- _g(o[e], i))
- }, this);
- for (var l = o.length - 1; l >= 0; l--)
- null == o[l] ? o.splice(l, 1) : delete o[l].$action
- },
- _flatten: function(t, e, i) {
- c(t, function(t) {
- if (t) {
- i && (t.parentOption = i),
- e.push(t);
- var n = t.children;
- "group" === t.type && n && this._flatten(n, e, t),
- delete t.children
- }
- }, this)
- },
- useElOptionsToUpdate: function() {
- var t = this._elOptionsToUpdate;
- return this._elOptionsToUpdate = null,
- t
- }
- });
- sr({
- type: "graphic",
- init: function(t, e) {
- this._elMap = O(),
- this._lastGraphicModel
- },
- render: function(t, e, i) {
- t !== this._lastGraphicModel && this._clear(),
- this._lastGraphicModel = t,
- this._updateElements(t, i),
- this._relocate(t, i)
- },
- _updateElements: function(t, e) {
- var i = t.useElOptionsToUpdate();
- if (i) {
- var n = this._elMap
- , o = this.group;
- c(i, function(t) {
- var e = t.$action
- , i = t.id
- , a = n.get(i)
- , r = t.parentId
- , s = null != r ? n.get(r) : o;
- if ("text" === t.type) {
- var l = t.style;
- t.hv && t.hv[1] && (l.textVerticalAlign = l.textBaseline = null),
- !l.hasOwnProperty("textFill") && l.fill && (l.textFill = l.fill),
- !l.hasOwnProperty("textStroke") && l.stroke && (l.textStroke = l.stroke)
- }
- var h = mg(t);
- e && "merge" !== e ? "replace" === e ? (pg(a, n),
- gg(i, s, h, n)) : "remove" === e && pg(a, n) : a ? a.attr(h) : gg(i, s, h, n);
- var u = n.get(i);
- u && (u.__ecGraphicWidth = t.width,
- u.__ecGraphicHeight = t.height)
- })
- }
- },
- _relocate: function(t, e) {
- for (var i = t.option.elements, n = this.group, o = this._elMap, a = i.length - 1; a >= 0; a--) {
- var r = i[a]
- , s = o.get(r.id);
- if (s) {
- var l = s.parent;
- $o(s, r, l === n ? {
- width: e.getWidth(),
- height: e.getHeight()
- } : {
- width: l.__ecGraphicWidth || 0,
- height: l.__ecGraphicHeight || 0
- }, null, {
- hv: r.hv,
- boundingMode: r.bounding
- })
- }
- }
- },
- _clear: function() {
- var t = this._elMap;
- t.each(function(e) {
- pg(e, t)
- }),
- this._elMap = O()
- },
- dispose: function() {
- this._clear()
- }
- });
- var SC = rr({
- type: "legend.plain",
- dependencies: ["series"],
- layoutMode: {
- type: "box",
- ignoreSize: !0
- },
- init: function(t, e, i) {
- this.mergeDefaultAndTheme(t, i),
- t.selected = t.selected || {}
- },
- mergeOption: function(t) {
- SC.superCall(this, "mergeOption", t)
- },
- optionUpdated: function() {
- this._updateData(this.ecModel);
- var t = this._data;
- if (t[0] && "single" === this.get("selectedMode")) {
- for (var e = !1, i = 0; i < t.length; i++) {
- var n = t[i].get("name");
- if (this.isSelected(n)) {
- this.select(n),
- e = !0;
- break
- }
- }
- !e && this.select(t[0].get("name"))
- }
- },
- _updateData: function(t) {
- var e = d(this.get("data") || [], function(t) {
- return "string" != typeof t && "number" != typeof t || (t = {
- name: t
- }),
- new Co(t,this,this.ecModel)
- }, this);
- this._data = e;
- var i = d(t.getSeries(), function(t) {
- return t.name
- });
- t.eachSeries(function(t) {
- if (t.legendDataProvider) {
- var e = t.legendDataProvider();
- i = i.concat(e.mapArray(e.getName))
- }
- }),
- this._availableNames = i
- },
- getData: function() {
- return this._data
- },
- select: function(t) {
- var e = this.option.selected;
- "single" === this.get("selectedMode") && c(this._data, function(t) {
- e[t.get("name")] = !1
- }),
- e[t] = !0
- },
- unSelect: function(t) {
- "single" !== this.get("selectedMode") && (this.option.selected[t] = !1)
- },
- toggleSelected: function(t) {
- var e = this.option.selected;
- e.hasOwnProperty(t) || (e[t] = !0),
- this[e[t] ? "unSelect" : "select"](t)
- },
- isSelected: function(t) {
- var e = this.option.selected;
- return !(e.hasOwnProperty(t) && !e[t]) && s(this._availableNames, t) >= 0
- },
- defaultOption: {
- zlevel: 0,
- z: 4,
- show: !0,
- orient: "horizontal",
- left: "center",
- top: 0,
- align: "auto",
- backgroundColor: "rgba(0,0,0,0)",
- borderColor: "#ccc",
- borderRadius: 0,
- borderWidth: 0,
- padding: 5,
- itemGap: 10,
- itemWidth: 25,
- itemHeight: 14,
- inactiveColor: "#ccc",
- textStyle: {
- color: "#333"
- },
- selectedMode: !0,
- tooltip: {
- show: !1
- }
- }
- });
- er("legendToggleSelect", "legendselectchanged", m(bg, "toggleSelected")),
- er("legendSelect", "legendselected", m(bg, "select")),
- er("legendUnSelect", "legendunselected", m(bg, "unSelect"));
- var MC = m
- , IC = c
- , TC = $y
- , AC = sr({
- type: "legend.plain",
- newlineDisabled: !1,
- init: function() {
- this.group.add(this._contentGroup = new TC),
- this._backgroundEl
- },
- getContentGroup: function() {
- return this._contentGroup
- },
- render: function(t, e, i) {
- if (this.resetInner(),
- t.get("show", !0)) {
- var n = t.get("align");
- n && "auto" !== n || (n = "right" === t.get("left") && "vertical" === t.get("orient") ? "right" : "left"),
- this.renderInner(n, t, e, i);
- var o = t.getBoxLayoutParams()
- , r = {
- width: i.getWidth(),
- height: i.getHeight()
- }
- , s = t.get("padding")
- , l = Yo(o, r, s)
- , h = this.layoutInner(t, n, l)
- , u = Yo(a({
- width: h.width,
- height: h.height
- }, o), r, s);
- this.group.attr("position", [u.x - h.x, u.y - h.y]),
- this.group.add(this._backgroundEl = Sg(h, t))
- }
- },
- resetInner: function() {
- this.getContentGroup().removeAll(),
- this._backgroundEl && this.group.remove(this._backgroundEl)
- },
- renderInner: function(t, e, i, n) {
- var o = this.getContentGroup()
- , a = O()
- , r = e.get("selectedMode");
- IC(e.getData(), function(s, l) {
- var h = s.get("name");
- if (this.newlineDisabled || "" !== h && "\n" !== h) {
- var u = i.getSeriesByName(h)[0];
- if (!a.get(h))
- if (u) {
- var c = u.getData()
- , d = c.getVisual("color");
- "function" == typeof d && (d = d(u.getDataParams(0)));
- var f = c.getVisual("legendSymbol") || "roundRect"
- , g = c.getVisual("symbol");
- this._createItem(h, l, s, e, f, g, t, d, r).on("click", MC(Mg, h, n)).on("mouseover", MC(Ig, u, null, n)).on("mouseout", MC(Tg, u, null, n)),
- a.set(h, !0)
- } else
- i.eachRawSeries(function(i) {
- if (!a.get(h) && i.legendDataProvider) {
- var o = i.legendDataProvider()
- , u = o.indexOfName(h);
- if (u < 0)
- return;
- var c = o.getItemVisual(u, "color");
- this._createItem(h, l, s, e, "roundRect", null, t, c, r).on("click", MC(Mg, h, n)).on("mouseover", MC(Ig, i, h, n)).on("mouseout", MC(Tg, i, h, n)),
- a.set(h, !0)
- }
- }, this)
- } else
- o.add(new TC({
- newline: !0
- }))
- }, this)
- },
- _createItem: function(t, e, i, n, a, r, s, l, h) {
- var u = n.get("itemWidth")
- , c = n.get("itemHeight")
- , d = n.get("inactiveColor")
- , f = n.isSelected(t)
- , g = new TC
- , p = i.getModel("textStyle")
- , m = i.get("icon")
- , v = i.getModel("tooltip")
- , y = v.parentModel;
- if (a = m || a,
- g.add(Gr(a, 0, 0, u, c, f ? l : d, !0)),
- !m && r && (r !== a || "none" == r)) {
- var x = .8 * c;
- "none" === r && (r = "circle"),
- g.add(Gr(r, (u - x) / 2, (c - x) / 2, x, x, f ? l : d))
- }
- var _ = "left" === s ? u + 5 : -5
- , b = s
- , w = n.get("formatter")
- , S = t;
- "string" == typeof w && w ? S = w.replace("{name}", null != t ? t : "") : "function" == typeof w && (S = w(t)),
- g.add(new ab({
- style: uo({}, p, {
- text: S,
- x: _,
- y: c / 2,
- textFill: f ? p.getTextColor() : d,
- textAlign: b,
- textVerticalAlign: "middle"
- })
- }));
- var M = new pb({
- shape: g.getBoundingRect(),
- invisible: !0,
- tooltip: v.get("show") ? o({
- content: t,
- formatter: y.get("formatter", !0) || function() {
- return t
- }
- ,
- formatterParams: {
- componentType: "legend",
- legendIndex: n.componentIndex,
- name: t,
- $vars: ["name"]
- }
- }, v.option) : null
- });
- return g.add(M),
- g.eachChild(function(t) {
- t.silent = !0
- }),
- M.silent = !h,
- this.getContentGroup().add(g),
- lo(g),
- g.__legendDataIndex = e,
- g
- },
- layoutInner: function(t, e, i) {
- var n = this.getContentGroup();
- Ub(t.get("orient"), n, t.get("itemGap"), i.width, i.height);
- var o = n.getBoundingRect();
- return n.attr("position", [-o.x, -o.y]),
- this.group.getBoundingRect()
- }
- });
- tr(function(t) {
- var e = t.findComponents({
- mainType: "legend"
- });
- e && e.length && t.filterSeries(function(t) {
- for (var i = 0; i < e.length; i++)
- if (!e[i].isSelected(t.name))
- return !1;
- return !0
- })
- }),
- qb.registerSubTypeDefaulter("legend", function() {
- return "plain"
- });
- var CC = SC.extend({
- type: "legend.scroll",
- setScrollDataIndex: function(t) {
- this.option.scrollDataIndex = t
- },
- defaultOption: {
- scrollDataIndex: 0,
- pageButtonItemGap: 5,
- pageButtonGap: null,
- pageButtonPosition: "end",
- pageFormatter: "{current}/{total}",
- pageIcons: {
- horizontal: ["M0,0L12,-10L12,10z", "M0,0L-12,-10L-12,10z"],
- vertical: ["M0,0L20,0L10,-20z", "M0,0L20,0L10,20z"]
- },
- pageIconColor: "#2f4554",
- pageIconInactiveColor: "#aaa",
- pageIconSize: 15,
- pageTextStyle: {
- color: "#333"
- },
- animationDurationUpdate: 800
- },
- init: function(t, e, i, n) {
- var o = Qo(t);
- CC.superCall(this, "init", t, e, i, n),
- Ag(this, t, o)
- },
- mergeOption: function(t, e) {
- CC.superCall(this, "mergeOption", t, e),
- Ag(this, this.option, t)
- },
- getOrient: function() {
- return "vertical" === this.get("orient") ? {
- index: 1,
- name: "vertical"
- } : {
- index: 0,
- name: "horizontal"
- }
- }
- })
- , DC = $y
- , LC = ["width", "height"]
- , kC = ["x", "y"]
- , PC = AC.extend({
- type: "legend.scroll",
- newlineDisabled: !0,
- init: function() {
- PC.superCall(this, "init"),
- this._currentIndex = 0,
- this.group.add(this._containerGroup = new DC),
- this._containerGroup.add(this.getContentGroup()),
- this.group.add(this._controllerGroup = new DC),
- this._showController
- },
- resetInner: function() {
- PC.superCall(this, "resetInner"),
- this._controllerGroup.removeAll(),
- this._containerGroup.removeClipPath(),
- this._containerGroup.__rectSize = null
- },
- renderInner: function(t, e, i, n) {
- function o(t, i) {
- var o = t + "DataIndex"
- , l = Ao(e.get("pageIcons", !0)[e.getOrient().name][i], {
- onclick: p(a._pageGo, a, o, e, n)
- }, {
- x: -s[0] / 2,
- y: -s[1] / 2,
- width: s[0],
- height: s[1]
- });
- l.name = t,
- r.add(l)
- }
- var a = this;
- PC.superCall(this, "renderInner", t, e, i, n);
- var r = this._controllerGroup
- , s = e.get("pageIconSize", !0);
- v(s) || (s = [s, s]),
- o("pagePrev", 0);
- var l = e.getModel("pageTextStyle");
- r.add(new ab({
- name: "pageText",
- style: {
- textFill: l.getTextColor(),
- font: l.getFont(),
- textVerticalAlign: "middle",
- textAlign: "center"
- },
- silent: !0
- })),
- o("pageNext", 1)
- },
- layoutInner: function(t, e, i) {
- var n = this.getContentGroup()
- , o = this._containerGroup
- , a = this._controllerGroup
- , r = t.getOrient().index
- , s = LC[r]
- , l = LC[1 - r]
- , h = kC[1 - r];
- Ub(t.get("orient"), n, t.get("itemGap"), r ? i.width : null, r ? null : i.height),
- Ub("horizontal", a, t.get("pageButtonItemGap", !0));
- var u = n.getBoundingRect()
- , c = a.getBoundingRect()
- , d = this._showController = u[s] > i[s]
- , f = [-u.x, -u.y];
- f[r] = n.position[r];
- var g = [0, 0]
- , p = [-c.x, -c.y]
- , m = I(t.get("pageButtonGap", !0), t.get("itemGap", !0));
- d && ("end" === t.get("pageButtonPosition", !0) ? p[r] += i[s] - c[s] : g[r] += c[s] + m),
- p[1 - r] += u[l] / 2 - c[l] / 2,
- n.attr("position", f),
- o.attr("position", g),
- a.attr("position", p);
- var v = this.group.getBoundingRect();
- if ((v = {
- x: 0,
- y: 0
- })[s] = d ? i[s] : u[s],
- v[l] = Math.max(u[l], c[l]),
- v[h] = Math.min(0, c[h] + p[1 - r]),
- o.__rectSize = i[s],
- d) {
- var y = {
- x: 0,
- y: 0
- };
- y[s] = Math.max(i[s] - c[s] - m, 0),
- y[l] = v[l],
- o.setClipPath(new pb({
- shape: y
- })),
- o.__rectSize = y[s]
- } else
- a.eachChild(function(t) {
- t.attr({
- invisible: !0,
- silent: !0
- })
- });
- var x = this._getPageInfo(t);
- return null != x.pageIndex && _o(n, {
- position: x.contentPosition
- }, !!d && t),
- this._updatePageInfoView(t, x),
- v
- },
- _pageGo: function(t, e, i) {
- var n = this._getPageInfo(e)[t];
- null != n && i.dispatchAction({
- type: "legendScroll",
- scrollDataIndex: n,
- legendId: e.id
- })
- },
- _updatePageInfoView: function(t, e) {
- var i = this._controllerGroup;
- c(["pagePrev", "pageNext"], function(n) {
- var o = null != e[n + "DataIndex"]
- , a = i.childOfName(n);
- a && (a.setStyle("fill", o ? t.get("pageIconColor", !0) : t.get("pageIconInactiveColor", !0)),
- a.cursor = o ? "pointer" : "default")
- });
- var n = i.childOfName("pageText")
- , o = t.get("pageFormatter")
- , a = e.pageIndex
- , r = null != a ? a + 1 : 0
- , s = e.pageCount;
- n && o && n.setStyle("text", x(o) ? o.replace("{current}", r).replace("{total}", s) : o({
- current: r,
- total: s
- }))
- },
- _getPageInfo: function(t) {
- function e(t) {
- var e = t.getBoundingRect().clone();
- return e[f] += t.position[u],
- e
- }
- var i, n, o, a, r = t.get("scrollDataIndex", !0), s = this.getContentGroup(), l = s.getBoundingRect(), h = this._containerGroup.__rectSize, u = t.getOrient().index, c = LC[u], d = LC[1 - u], f = kC[u], g = s.position.slice();
- this._showController ? s.eachChild(function(t) {
- t.__legendDataIndex === r && (a = t)
- }) : a = s.childAt(0);
- var p = h ? Math.ceil(l[c] / h) : 0;
- if (a) {
- var m = a.getBoundingRect()
- , v = a.position[u] + m[f];
- g[u] = -v - l[f],
- i = Math.floor(p * (v + m[f] + h / 2) / l[c]),
- i = l[c] && p ? Math.max(0, Math.min(p - 1, i)) : -1;
- var y = {
- x: 0,
- y: 0
- };
- y[c] = h,
- y[d] = l[d],
- y[f] = -g[u] - l[f];
- var x, _ = s.children();
- if (s.eachChild(function(t, i) {
- var n = e(t);
- n.intersect(y) && (null == x && (x = i),
- o = t.__legendDataIndex),
- i === _.length - 1 && n[f] + n[c] <= y[f] + y[c] && (o = null)
- }),
- null != x) {
- var b = e(_[x]);
- if (y[f] = b[f] + b[c] - y[c],
- x <= 0 && b[f] >= y[f])
- n = null;
- else {
- for (; x > 0 && e(_[x - 1]).intersect(y); )
- x--;
- n = _[x].__legendDataIndex
- }
- }
- }
- return {
- contentPosition: g,
- pageIndex: i,
- pageCount: p,
- pagePrevDataIndex: n,
- pageNextDataIndex: o
- }
- }
- });
- er("legendScroll", "legendscroll", function(t, e) {
- var i = t.scrollDataIndex;
- null != i && e.eachComponent({
- mainType: "legend",
- subType: "scroll",
- query: t
- }, function(t) {
- t.setScrollDataIndex(i)
- })
- }),
- rr({
- type: "tooltip",
- dependencies: ["axisPointer"],
- defaultOption: {
- zlevel: 0,
- z: 8,
- show: !0,
- showContent: !0,
- trigger: "item",
- triggerOn: "mousemove|click",
- alwaysShowContent: !1,
- displayMode: "single",
- confine: !1,
- showDelay: 0,
- hideDelay: 100,
- transitionDuration: .4,
- enterable: !1,
- backgroundColor: "rgba(50,50,50,0.7)",
- borderColor: "#333",
- borderRadius: 4,
- borderWidth: 0,
- padding: 5,
- extraCssText: "",
- axisPointer: {
- type: "line",
- axis: "auto",
- animation: "auto",
- animationDurationUpdate: 200,
- animationEasingUpdate: "exponentialOut",
- crossStyle: {
- color: "#999",
- width: 1,
- type: "dashed",
- textStyle: {}
- }
- },
- textStyle: {
- color: "#fff",
- fontSize: 14
- }
- }
- });
- var OC = c
- , zC = Ri
- , NC = ["", "-webkit-", "-moz-", "-o-"];
- kg.prototype = {
- constructor: kg,
- _enterable: !0,
- update: function() {
- var t = this._container
- , e = t.currentStyle || document.defaultView.getComputedStyle(t)
- , i = t.style;
- "absolute" !== i.position && "absolute" !== e.position && (i.position = "relative")
- },
- show: function(t) {
- clearTimeout(this._hideTimeout);
- var e = this.el;
- e.style.cssText = "position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;" + Lg(t) + ";left:" + this._x + "px;top:" + this._y + "px;" + (t.get("extraCssText") || ""),
- e.style.display = e.innerHTML ? "block" : "none",
- this._show = !0
- },
- setContent: function(t) {
- this.el.innerHTML = null == t ? "" : t
- },
- setEnterable: function(t) {
- this._enterable = t
- },
- getSize: function() {
- var t = this.el;
- return [t.clientWidth, t.clientHeight]
- },
- moveTo: function(t, e) {
- var i, n = this._zr;
- n && n.painter && (i = n.painter.getViewportRootOffset()) && (t += i.offsetLeft,
- e += i.offsetTop);
- var o = this.el.style;
- o.left = t + "px",
- o.top = e + "px",
- this._x = t,
- this._y = e
- },
- hide: function() {
- this.el.style.display = "none",
- this._show = !1
- },
- hideLater: function(t) {
- !this._show || this._inContent && this._enterable || (t ? (this._hideDelay = t,
- this._show = !1,
- this._hideTimeout = setTimeout(p(this.hide, this), t)) : this.hide())
- },
- isShow: function() {
- return this._show
- }
- };
- var EC = p
- , RC = c
- , VC = bi
- , BC = new pb({
- shape: {
- x: -1,
- y: -1,
- width: 2,
- height: 2
- }
- });
- sr({
- type: "tooltip",
- init: function(t, e) {
- if (!Yv.node) {
- var i = new kg(e.getDom(),e);
- this._tooltipContent = i
- }
- },
- render: function(t, e, i) {
- if (!Yv.node) {
- this.group.removeAll(),
- this._tooltipModel = t,
- this._ecModel = e,
- this._api = i,
- this._lastDataByCoordSys = null,
- this._alwaysShowContent = t.get("alwaysShowContent");
- var n = this._tooltipContent;
- n.update(),
- n.setEnterable(t.get("enterable")),
- this._initGlobalListener(),
- this._keepShow()
- }
- },
- _initGlobalListener: function() {
- var t = this._tooltipModel.get("triggerOn");
- Mf("itemTooltip", this._api, EC(function(e, i, n) {
- "none" !== t && (t.indexOf(e) >= 0 ? this._tryShow(i, n) : "leave" === e && this._hide(n))
- }, this))
- },
- _keepShow: function() {
- var t = this._tooltipModel
- , e = this._ecModel
- , i = this._api;
- if (null != this._lastX && null != this._lastY && "none" !== t.get("triggerOn")) {
- var n = this;
- clearTimeout(this._refreshUpdateTimeout),
- this._refreshUpdateTimeout = setTimeout(function() {
- n.manuallyShowTip(t, e, i, {
- x: n._lastX,
- y: n._lastY
- })
- })
- }
- },
- manuallyShowTip: function(t, e, i, n) {
- if (n.from !== this.uid && !Yv.node) {
- var o = Og(n, i);
- this._ticket = "";
- var a = n.dataByCoordSys;
- if (n.tooltip && null != n.x && null != n.y) {
- var r = BC;
- r.position = [n.x, n.y],
- r.update(),
- r.tooltip = n.tooltip,
- this._tryShow({
- offsetX: n.x,
- offsetY: n.y,
- target: r
- }, o)
- } else if (a)
- this._tryShow({
- offsetX: n.x,
- offsetY: n.y,
- position: n.position,
- event: {},
- dataByCoordSys: n.dataByCoordSys,
- tooltipOption: n.tooltipOption
- }, o);
- else if (null != n.seriesIndex) {
- if (this._manuallyAxisShowTip(t, e, i, n))
- return;
- var s = QA(n, e)
- , l = s.point[0]
- , h = s.point[1];
- null != l && null != h && this._tryShow({
- offsetX: l,
- offsetY: h,
- position: n.position,
- target: s.el,
- event: {}
- }, o)
- } else
- null != n.x && null != n.y && (i.dispatchAction({
- type: "updateAxisPointer",
- x: n.x,
- y: n.y
- }),
- this._tryShow({
- offsetX: n.x,
- offsetY: n.y,
- position: n.position,
- target: i.getZr().findHover(n.x, n.y).target,
- event: {}
- }, o))
- }
- },
- manuallyHideTip: function(t, e, i, n) {
- var o = this._tooltipContent;
- this._alwaysShowContent || o.hideLater(this._tooltipModel.get("hideDelay")),
- this._lastX = this._lastY = null,
- n.from !== this.uid && this._hide(Og(n, i))
- },
- _manuallyAxisShowTip: function(t, e, i, n) {
- var o = n.seriesIndex
- , a = n.dataIndex
- , r = e.getComponent("axisPointer").coordSysAxesInfo;
- if (null != o && null != a && null != r) {
- var s = e.getSeriesByIndex(o);
- if (s && "axis" === (t = Pg([s.getData().getItemModel(a), s, (s.coordinateSystem || {}).model, t])).get("trigger"))
- return i.dispatchAction({
- type: "updateAxisPointer",
- seriesIndex: o,
- dataIndex: a,
- position: n.position
- }),
- !0
- }
- },
- _tryShow: function(t, e) {
- var i = t.target;
- if (this._tooltipModel) {
- this._lastX = t.offsetX,
- this._lastY = t.offsetY;
- var n = t.dataByCoordSys;
- n && n.length ? this._showAxisTooltip(n, t) : i && null != i.dataIndex ? (this._lastDataByCoordSys = null,
- this._showSeriesItemTooltip(t, i, e)) : i && i.tooltip ? (this._lastDataByCoordSys = null,
- this._showComponentItemTooltip(t, i, e)) : (this._lastDataByCoordSys = null,
- this._hide(e))
- }
- },
- _showOrMove: function(t, e) {
- var i = t.get("showDelay");
- e = p(e, this),
- clearTimeout(this._showTimout),
- i > 0 ? this._showTimout = setTimeout(e, i) : e()
- },
- _showAxisTooltip: function(t, e) {
- var i = this._ecModel
- , n = this._tooltipModel
- , o = [e.offsetX, e.offsetY]
- , a = []
- , r = []
- , s = Pg([e.tooltipOption, n]);
- RC(t, function(t) {
- RC(t.dataByAxis, function(t) {
- var e = i.getComponent(t.axisDim + "Axis", t.axisIndex)
- , n = t.value
- , o = [];
- if (e && null != n) {
- var s = Gf(n, e.axis, i, t.seriesDataIndices, t.valueLabelOpt);
- c(t.seriesDataIndices, function(a) {
- var l = i.getSeriesByIndex(a.seriesIndex)
- , h = a.dataIndexInside
- , u = l && l.getDataParams(h);
- u.axisDim = t.axisDim,
- u.axisIndex = t.axisIndex,
- u.axisType = t.axisType,
- u.axisId = t.axisId,
- u.axisValue = Rr(e.axis, n),
- u.axisValueLabel = s,
- u && (r.push(u),
- o.push(l.formatTooltip(h, !0)))
- });
- var l = s;
- a.push((l ? Vi(l) + "<br />" : "") + o.join("<br />"))
- }
- })
- }, this),
- a.reverse(),
- a = a.join("<br /><br />");
- var l = e.position;
- this._showOrMove(s, function() {
- this._updateContentNotChangedOnAxis(t) ? this._updatePosition(s, l, o[0], o[1], this._tooltipContent, r) : this._showTooltipContent(s, a, r, Math.random(), o[0], o[1], l)
- })
- },
- _showSeriesItemTooltip: function(t, e, i) {
- var n = this._ecModel
- , o = e.seriesIndex
- , a = n.getSeriesByIndex(o)
- , r = e.dataModel || a
- , s = e.dataIndex
- , l = e.dataType
- , h = r.getData()
- , u = Pg([h.getItemModel(s), r, a && (a.coordinateSystem || {}).model, this._tooltipModel])
- , c = u.get("trigger");
- if (null == c || "item" === c) {
- var d = r.getDataParams(s, l)
- , f = r.formatTooltip(s, !1, l)
- , g = "item_" + r.name + "_" + s;
- this._showOrMove(u, function() {
- this._showTooltipContent(u, f, d, g, t.offsetX, t.offsetY, t.position, t.target)
- }),
- i({
- type: "showTip",
- dataIndexInside: s,
- dataIndex: h.getRawIndex(s),
- seriesIndex: o,
- from: this.uid
- })
- }
- },
- _showComponentItemTooltip: function(t, e, i) {
- var n = e.tooltip;
- if ("string" == typeof n) {
- var o = n;
- n = {
- content: o,
- formatter: o
- }
- }
- var a = new Co(n,this._tooltipModel,this._ecModel)
- , r = a.get("content")
- , s = Math.random();
- this._showOrMove(a, function() {
- this._showTooltipContent(a, r, a.get("formatterParams") || {}, s, t.offsetX, t.offsetY, t.position, e)
- }),
- i({
- type: "showTip",
- from: this.uid
- })
- },
- _showTooltipContent: function(t, e, i, n, o, a, r, s) {
- if (this._ticket = "",
- t.get("showContent") && t.get("show")) {
- var l = this._tooltipContent
- , h = t.get("formatter");
- r = r || t.get("position");
- var u = e;
- if (h && "string" == typeof h)
- u = Bi(h, i, !0);
- else if ("function" == typeof h) {
- var c = EC(function(e, n) {
- e === this._ticket && (l.setContent(n),
- this._updatePosition(t, r, o, a, l, i, s))
- }, this);
- this._ticket = n,
- u = h(i, n, c)
- }
- l.setContent(u),
- l.show(t),
- this._updatePosition(t, r, o, a, l, i, s)
- }
- },
- _updatePosition: function(t, e, i, n, o, a, r) {
- var s = this._api.getWidth()
- , l = this._api.getHeight();
- e = e || t.get("position");
- var h = o.getSize()
- , u = t.get("align")
- , c = t.get("verticalAlign")
- , d = r && r.getBoundingRect().clone();
- if (r && d.applyTransform(r.transform),
- "function" == typeof e && (e = e([i, n], a, o.el, d, {
- viewSize: [s, l],
- contentSize: h.slice()
- })),
- v(e))
- i = VC(e[0], s),
- n = VC(e[1], l);
- else if (_(e)) {
- e.width = h[0],
- e.height = h[1];
- var f = Yo(e, {
- width: s,
- height: l
- });
- i = f.x,
- n = f.y,
- u = null,
- c = null
- } else
- "string" == typeof e && r ? (i = (g = Rg(e, d, h))[0],
- n = g[1]) : (i = (g = zg(i, n, o.el, s, l, u ? null : 20, c ? null : 20))[0],
- n = g[1]);
- if (u && (i -= Vg(u) ? h[0] / 2 : "right" === u ? h[0] : 0),
- c && (n -= Vg(c) ? h[1] / 2 : "bottom" === c ? h[1] : 0),
- t.get("confine")) {
- var g = Ng(i, n, o.el, s, l);
- i = g[0],
- n = g[1]
- }
- o.moveTo(i, n)
- },
- _updateContentNotChangedOnAxis: function(t) {
- var e = this._lastDataByCoordSys
- , i = !!e && e.length === t.length;
- return i && RC(e, function(e, n) {
- var o = e.dataByAxis || {}
- , a = (t[n] || {}).dataByAxis || [];
- (i &= o.length === a.length) && RC(o, function(t, e) {
- var n = a[e] || {}
- , o = t.seriesDataIndices || []
- , r = n.seriesDataIndices || [];
- (i &= t.value === n.value && t.axisType === n.axisType && t.axisId === n.axisId && o.length === r.length) && RC(o, function(t, e) {
- var n = r[e];
- i &= t.seriesIndex === n.seriesIndex && t.dataIndex === n.dataIndex
- })
- })
- }),
- this._lastDataByCoordSys = t,
- !!i
- },
- _hide: function(t) {
- this._lastDataByCoordSys = null,
- t({
- type: "hideTip",
- from: this.uid
- })
- },
- dispose: function(t, e) {
- Yv.node || (this._tooltipContent.hide(),
- Lf("itemTooltip", e))
- }
- }),
- er({
- type: "showTip",
- event: "showTip",
- update: "tooltip:manuallyShowTip"
- }, function() {}),
- er({
- type: "hideTip",
- event: "hideTip",
- update: "tooltip:manuallyHideTip"
- }, function() {}),
- Hg.prototype = {
- constructor: Hg,
- pointToData: function(t, e) {
- return this.polar.pointToData(t, e)["radius" === this.dim ? 0 : 1]
- },
- dataToRadius: YS.prototype.dataToCoord,
- radiusToData: YS.prototype.coordToData
- },
- l(Hg, YS),
- Fg.prototype = {
- constructor: Fg,
- pointToData: function(t, e) {
- return this.polar.pointToData(t, e)["radius" === this.dim ? 0 : 1]
- },
- dataToAngle: YS.prototype.dataToCoord,
- angleToData: YS.prototype.coordToData
- },
- l(Fg, YS);
- var GC = function(t) {
- this.name = t || "",
- this.cx = 0,
- this.cy = 0,
- this._radiusAxis = new Hg,
- this._angleAxis = new Fg,
- this._radiusAxis.polar = this._angleAxis.polar = this
- };
- GC.prototype = {
- type: "polar",
- axisPointerEnabled: !0,
- constructor: GC,
- dimensions: ["radius", "angle"],
- model: null,
- containPoint: function(t) {
- var e = this.pointToCoord(t);
- return this._radiusAxis.contain(e[0]) && this._angleAxis.contain(e[1])
- },
- containData: function(t) {
- return this._radiusAxis.containData(t[0]) && this._angleAxis.containData(t[1])
- },
- getAxis: function(t) {
- return this["_" + t + "Axis"]
- },
- getAxes: function() {
- return [this._radiusAxis, this._angleAxis]
- },
- getAxesByScale: function(t) {
- var e = []
- , i = this._angleAxis
- , n = this._radiusAxis;
- return i.scale.type === t && e.push(i),
- n.scale.type === t && e.push(n),
- e
- },
- getAngleAxis: function() {
- return this._angleAxis
- },
- getRadiusAxis: function() {
- return this._radiusAxis
- },
- getOtherAxis: function(t) {
- var e = this._angleAxis;
- return t === e ? this._radiusAxis : e
- },
- getBaseAxis: function() {
- return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAngleAxis()
- },
- getTooltipAxes: function(t) {
- var e = null != t && "auto" !== t ? this.getAxis(t) : this.getBaseAxis();
- return {
- baseAxes: [e],
- otherAxes: [this.getOtherAxis(e)]
- }
- },
- dataToPoint: function(t, e) {
- return this.coordToPoint([this._radiusAxis.dataToRadius(t[0], e), this._angleAxis.dataToAngle(t[1], e)])
- },
- pointToData: function(t, e) {
- var i = this.pointToCoord(t);
- return [this._radiusAxis.radiusToData(i[0], e), this._angleAxis.angleToData(i[1], e)]
- },
- pointToCoord: function(t) {
- var e = t[0] - this.cx
- , i = t[1] - this.cy
- , n = this.getAngleAxis()
- , o = n.getExtent()
- , a = Math.min(o[0], o[1])
- , r = Math.max(o[0], o[1]);
- n.inverse ? a = r - 360 : r = a + 360;
- var s = Math.sqrt(e * e + i * i);
- e /= s,
- i /= s;
- for (var l = Math.atan2(-i, e) / Math.PI * 180, h = l < a ? 1 : -1; l < a || l > r; )
- l += 360 * h;
- return [s, l]
- },
- coordToPoint: function(t) {
- var e = t[0]
- , i = t[1] / 180 * Math.PI;
- return [Math.cos(i) * e + this.cx, -Math.sin(i) * e + this.cy]
- }
- };
- var WC = qb.extend({
- type: "polarAxis",
- axis: null,
- getCoordSysModel: function() {
- return this.ecModel.queryComponents({
- mainType: "polar",
- index: this.option.polarIndex,
- id: this.option.polarId
- })[0]
- }
- });
- i(WC.prototype, VS);
- var HC = {
- angle: {
- startAngle: 90,
- clockwise: !0,
- splitNumber: 12,
- axisLabel: {
- rotate: !1
- }
- },
- radius: {
- splitNumber: 5
- }
- };
- IM("angle", WC, Zg, HC.angle),
- IM("radius", WC, Zg, HC.radius),
- rr({
- type: "polar",
- dependencies: ["polarAxis", "angleAxis"],
- coordinateSystem: null,
- findAxisModel: function(t) {
- var e;
- return this.ecModel.eachComponent(t, function(t) {
- t.getCoordSysModel() === this && (e = t)
- }, this),
- e
- },
- defaultOption: {
- zlevel: 0,
- z: 0,
- center: ["50%", "50%"],
- radius: "80%"
- }
- });
- var FC = {
- dimensions: GC.prototype.dimensions,
- create: function(t, e) {
- var i = [];
- return t.eachComponent("polar", function(t, n) {
- var o = new GC(n);
- o.update = jg;
- var a = o.getRadiusAxis()
- , r = o.getAngleAxis()
- , s = t.findAxisModel("radiusAxis")
- , l = t.findAxisModel("angleAxis");
- Xg(a, s),
- Xg(r, l),
- Ug(o, t, e),
- i.push(o),
- t.coordinateSystem = o,
- o.model = t
- }),
- t.eachSeries(function(e) {
- if ("polar" === e.get("coordinateSystem")) {
- var i = t.queryComponents({
- mainType: "polar",
- index: e.get("polarIndex"),
- id: e.get("polarId")
- })[0];
- e.coordinateSystem = i.coordinateSystem
- }
- }),
- i
- }
- };
- ha.register("polar", FC);
- var ZC = ["axisLine", "axisLabel", "axisTick", "splitLine", "splitArea"];
- WM.extend({
- type: "angleAxis",
- axisPointerClass: "PolarAxisPointer",
- render: function(t, e) {
- if (this.group.removeAll(),
- t.get("show")) {
- var i = t.axis
- , n = i.polar
- , o = n.getRadiusAxis().getExtent()
- , a = i.getTicksCoords();
- "category" !== i.type && a.pop(),
- c(ZC, function(e) {
- !t.get(e + ".show") || i.scale.isBlank() && "axisLine" !== e || this["_" + e](t, n, a, o)
- }, this)
- }
- },
- _axisLine: function(t, e, i, n) {
- var o = t.getModel("axisLine.lineStyle")
- , a = new rb({
- shape: {
- cx: e.cx,
- cy: e.cy,
- r: n[Yg(e)]
- },
- style: o.getLineStyle(),
- z2: 1,
- silent: !0
- });
- a.style.fill = null,
- this.group.add(a)
- },
- _axisTick: function(t, e, i, n) {
- var o = t.getModel("axisTick")
- , r = (o.get("inside") ? -1 : 1) * o.get("length")
- , s = n[Yg(e)]
- , l = d(i, function(t) {
- return new mb({
- shape: qg(e, [s, s + r], t)
- })
- });
- this.group.add(Cb(l, {
- style: a(o.getModel("lineStyle").getLineStyle(), {
- stroke: t.get("axisLine.lineStyle.color")
- })
- }))
- },
- _axisLabel: function(t, e, i, n) {
- for (var o = t.axis, a = t.get("data"), r = t.getModel("axisLabel"), s = t.getFormattedLabels(), l = r.get("margin"), h = o.getLabelsCoords(), u = 0; u < i.length; u++) {
- var c = n[Yg(e)]
- , d = e.coordToPoint([c + l, h[u]])
- , f = e.cx
- , g = e.cy
- , p = Math.abs(d[0] - f) / c < .3 ? "center" : d[0] > f ? "left" : "right"
- , m = Math.abs(d[1] - g) / c < .3 ? "middle" : d[1] > g ? "top" : "bottom";
- a && a[u] && a[u].textStyle && (r = new Co(a[u].textStyle,r,r.ecModel));
- var v = new ab({
- silent: !0
- });
- this.group.add(v),
- uo(v.style, r, {
- x: d[0],
- y: d[1],
- textFill: r.getTextColor() || t.get("axisLine.lineStyle.color"),
- text: s[u],
- textAlign: p,
- textVerticalAlign: m
- })
- }
- },
- _splitLine: function(t, e, i, n) {
- var o = t.getModel("splitLine").getModel("lineStyle")
- , r = o.get("color")
- , s = 0;
- r = r instanceof Array ? r : [r];
- for (var l = [], h = 0; h < i.length; h++) {
- var u = s++ % r.length;
- l[u] = l[u] || [],
- l[u].push(new mb({
- shape: qg(e, n, i[h])
- }))
- }
- for (h = 0; h < l.length; h++)
- this.group.add(Cb(l[h], {
- style: a({
- stroke: r[h % r.length]
- }, o.getLineStyle()),
- silent: !0,
- z: t.get("z")
- }))
- },
- _splitArea: function(t, e, i, n) {
- var o = t.getModel("splitArea").getModel("areaStyle")
- , r = o.get("color")
- , s = 0;
- r = r instanceof Array ? r : [r];
- for (var l = [], h = Math.PI / 180, u = -i[0] * h, c = Math.min(n[0], n[1]), d = Math.max(n[0], n[1]), f = t.get("clockwise"), g = 1; g < i.length; g++) {
- var p = s++ % r.length;
- l[p] = l[p] || [],
- l[p].push(new hb({
- shape: {
- cx: e.cx,
- cy: e.cy,
- r0: c,
- r: d,
- startAngle: u,
- endAngle: -i[g] * h,
- clockwise: f
- },
- silent: !0
- })),
- u = -i[g] * h
- }
- for (g = 0; g < l.length; g++)
- this.group.add(Cb(l[g], {
- style: a({
- fill: r[g % r.length]
- }, o.getAreaStyle()),
- silent: !0
- }))
- }
- });
- var UC = ["axisLine", "axisTickLabel", "axisName"]
- , jC = ["splitLine", "splitArea"];
- WM.extend({
- type: "radiusAxis",
- axisPointerClass: "PolarAxisPointer",
- render: function(t, e) {
- if (this.group.removeAll(),
- t.get("show")) {
- var i = t.axis
- , n = i.polar
- , o = n.getAngleAxis()
- , a = i.getTicksCoords()
- , r = o.getExtent()[0]
- , s = i.getExtent()
- , l = $g(n, t, r)
- , h = new zM(t,l);
- c(UC, h.add, h),
- this.group.add(h.getGroup()),
- c(jC, function(e) {
- t.get(e + ".show") && !i.scale.isBlank() && this["_" + e](t, n, r, s, a)
- }, this)
- }
- },
- _splitLine: function(t, e, i, n, o) {
- var r = t.getModel("splitLine").getModel("lineStyle")
- , s = r.get("color")
- , l = 0;
- s = s instanceof Array ? s : [s];
- for (var h = [], u = 0; u < o.length; u++) {
- var c = l++ % s.length;
- h[c] = h[c] || [],
- h[c].push(new rb({
- shape: {
- cx: e.cx,
- cy: e.cy,
- r: o[u]
- },
- silent: !0
- }))
- }
- for (u = 0; u < h.length; u++)
- this.group.add(Cb(h[u], {
- style: a({
- stroke: s[u % s.length],
- fill: null
- }, r.getLineStyle()),
- silent: !0
- }))
- },
- _splitArea: function(t, e, i, n, o) {
- var r = t.getModel("splitArea").getModel("areaStyle")
- , s = r.get("color")
- , l = 0;
- s = s instanceof Array ? s : [s];
- for (var h = [], u = o[0], c = 1; c < o.length; c++) {
- var d = l++ % s.length;
- h[d] = h[d] || [],
- h[d].push(new hb({
- shape: {
- cx: e.cx,
- cy: e.cy,
- r0: u,
- r: o[c],
- startAngle: 0,
- endAngle: 2 * Math.PI
- },
- silent: !0
- })),
- u = o[c]
- }
- for (c = 0; c < h.length; c++)
- this.group.add(Cb(h[c], {
- style: a({
- fill: s[c % s.length]
- }, r.getAreaStyle()),
- silent: !0
- }))
- }
- });
- var XC = kf.extend({
- makeElOption: function(t, e, i, n, o) {
- var a = i.axis;
- "angle" === a.dim && (this.animationThreshold = Math.PI / 18);
- var r, s = a.polar, l = s.getOtherAxis(a).getExtent();
- r = a["dataTo" + Fi(a.dim)](e);
- var h = n.get("type");
- if (h && "none" !== h) {
- var u = Rf(n)
- , c = qC[h](a, s, r, l, u);
- c.style = u,
- t.graphicKey = c.type,
- t.pointer = c
- }
- Vf(t, i, n, o, Kg(e, i, 0, s, n.get("label.margin")))
- }
- })
- , qC = {
- line: function(t, e, i, n, o) {
- return "angle" === t.dim ? {
- type: "Line",
- shape: Ff(e.coordToPoint([n[0], i]), e.coordToPoint([n[1], i]))
- } : {
- type: "Circle",
- shape: {
- cx: e.cx,
- cy: e.cy,
- r: i
- }
- }
- },
- shadow: function(t, e, i, n, o) {
- var a = t.getBandWidth()
- , r = Math.PI / 180;
- return "angle" === t.dim ? {
- type: "Sector",
- shape: Uf(e.cx, e.cy, n[0], n[1], (-i - a / 2) * r, (a / 2 - i) * r)
- } : {
- type: "Sector",
- shape: Uf(e.cx, e.cy, i - a / 2, i + a / 2, 0, 2 * Math.PI)
- }
- }
- };
- WM.registerAxisPointerClass("PolarAxisPointer", XC),
- nr(m(function(t, e, i) {
- var n = i.getWidth()
- , o = i.getHeight()
- , a = {}
- , r = {}
- , s = Wg(g(e.getSeriesByType(t), function(t) {
- return !e.isSeriesFiltered(t) && t.coordinateSystem && "polar" === t.coordinateSystem.type
- }));
- e.eachSeriesByType(t, function(t) {
- if ("polar" === t.coordinateSystem.type) {
- var e = t.getData()
- , i = t.coordinateSystem
- , l = i.getAngleAxis()
- , h = i.getBaseAxis()
- , u = Bg(t)
- , c = s[Gg(h)][u]
- , d = c.offset
- , f = c.width
- , g = i.getOtherAxis(h)
- , p = t.get("center") || ["50%", "50%"]
- , m = bi(p[0], n)
- , v = bi(p[1], o)
- , y = t.get("barMinHeight") || 0
- , x = t.get("barMinAngle") || 0
- , _ = g.getExtent()[0]
- , b = g.model.get("max")
- , w = g.model.get("min")
- , S = [t.coordDimToDataDim("radius")[0], t.coordDimToDataDim("angle")[0]]
- , M = e.mapArray(S, function(t, e) {
- return i.dataToPoint([t, e])
- }, !0);
- a[u] = a[u] || [],
- r[u] = r[u] || [],
- e.each(t.coordDimToDataDim(g.dim)[0], function(t, n) {
- if (!isNaN(t)) {
- a[u][n] || (a[u][n] = {
- p: _,
- n: _
- },
- r[u][n] = {
- p: _,
- n: _
- });
- var o, s, h, c, p = t >= 0 ? "p" : "n", S = i.pointToCoord(M[n]), I = r[u][n][p];
- if ("radius" === g.dim)
- o = I,
- s = S[0],
- c = (h = (-S[1] + d) * Math.PI / 180) + f * Math.PI / 180,
- Math.abs(s) < y && (s = o + (s < 0 ? -1 : 1) * y),
- r[u][n][p] = s;
- else {
- s = (o = S[0] + d) + f,
- null != b && (t = Math.min(t, b)),
- null != w && (t = Math.max(t, w));
- var T = l.dataToAngle(t);
- Math.abs(T - I) < x && (T = I - (t < 0 ? -1 : 1) * x),
- h = -I * Math.PI / 180,
- c = -T * Math.PI / 180;
- var A = l.getExtent()
- , C = T;
- C === A[0] && t > 0 ? C = A[1] : C === A[1] && t < 0 && (C = A[0]),
- r[u][n][p] = C
- }
- e.setItemLayout(n, {
- cx: m,
- cy: v,
- r0: o,
- r: s,
- startAngle: h,
- endAngle: c
- })
- }
- }, !0)
- }
- }, this)
- }, "bar")),
- sr({
- type: "polar"
- }),
- h(qb.extend({
- type: "geo",
- coordinateSystem: null,
- layoutMode: "box",
- init: function(t) {
- qb.prototype.init.apply(this, arguments),
- Po(t.label, ["show"])
- },
- optionUpdated: function() {
- var t = this.option
- , e = this;
- t.regions = AI.getFilledRegions(t.regions, t.map, t.nameMap),
- this._optionModelMap = f(t.regions || [], function(t, i) {
- return i.name && t.set(i.name, new Co(i,e)),
- t
- }, O()),
- this.updateSelectedMap(t.regions)
- },
- defaultOption: {
- zlevel: 0,
- z: 0,
- show: !0,
- left: "center",
- top: "center",
- aspectScale: .75,
- silent: !1,
- map: "",
- boundingCoords: null,
- center: null,
- zoom: 1,
- scaleLimit: null,
- label: {
- normal: {
- show: !1,
- color: "#000"
- },
- emphasis: {
- show: !0,
- color: "rgb(100,0,0)"
- }
- },
- itemStyle: {
- normal: {
- borderWidth: .5,
- borderColor: "#444",
- color: "#eee"
- },
- emphasis: {
- color: "rgba(255,215,0,0.8)"
- }
- },
- regions: []
- },
- getRegionModel: function(t) {
- return this._optionModelMap.get(t) || new Co(null,this,this.ecModel)
- },
- getFormattedLabel: function(t, e) {
- var i = this.getRegionModel(t).get("label." + e + ".formatter")
- , n = {
- name: t
- };
- return "function" == typeof i ? (n.status = e,
- i(n)) : "string" == typeof i ? i.replace("{a}", null != t ? t : "") : void 0
- },
- setZoom: function(t) {
- this.option.zoom = t
- },
- setCenter: function(t) {
- this.option.center = t
- }
- }), eI),
- sr({
- type: "geo",
- init: function(t, e) {
- var i = new Yl(e,!0);
- this._mapDraw = i,
- this.group.add(i.group)
- },
- render: function(t, e, i, n) {
- if (!n || "geoToggleSelect" !== n.type || n.from !== this.uid) {
- var o = this._mapDraw;
- t.get("show") ? o.draw(t, e, i, this, n) : this._mapDraw.group.removeAll(),
- this.group.silent = t.get("silent")
- }
- },
- dispose: function() {
- this._mapDraw && this._mapDraw.remove()
- }
- }),
- Jg("toggleSelected", {
- type: "geoToggleSelect",
- event: "geoselectchanged"
- }),
- Jg("select", {
- type: "geoSelect",
- event: "geoselected"
- }),
- Jg("unSelect", {
- type: "geoUnSelect",
- event: "geounselected"
- });
- var YC = ["rect", "polygon", "keep", "clear"]
- , $C = c
- , KC = {
- lineX: op(0),
- lineY: op(1),
- rect: {
- point: function(t, e, i) {
- return t && i.boundingRect.contain(t[0], t[1])
- },
- rect: function(t, e, i) {
- return t && i.boundingRect.intersect(t)
- }
- },
- polygon: {
- point: function(t, e, i) {
- return t && i.boundingRect.contain(t[0], t[1]) && _l(i.range, t[0], t[1])
- },
- rect: function(t, e, i) {
- var n = i.range;
- if (!t || n.length <= 1)
- return !1;
- var o = t.x
- , a = t.y
- , r = t.width
- , s = t.height
- , l = n[0];
- return !!(_l(n, o, a) || _l(n, o + r, a) || _l(n, o, a + s) || _l(n, o + r, a + s) || jt.create(t).contain(l[0], l[1]) || rp(o, a, o + r, a, n) || rp(o, a, o, a + s, n) || rp(o + r, a, o + r, a + s, n) || rp(o, a + s, o + r, a + s, n)) || void 0
- }
- }
- }
- , JC = c
- , QC = s
- , tD = m
- , eD = ["dataToPoint", "pointToData"]
- , iD = ["grid", "xAxis", "yAxis", "geo", "graph", "polar", "radiusAxis", "angleAxis", "bmap"]
- , nD = up.prototype;
- nD.setOutputRanges = function(t, e) {
- this.matchOutputRanges(t, e, function(t, e, i) {
- if ((t.coordRanges || (t.coordRanges = [])).push(e),
- !t.coordRange) {
- t.coordRange = e;
- var n = sD[t.brushType](0, i, e);
- t.__rangeOffset = {
- offset: lD[t.brushType](n.values, t.range, [1, 1]),
- xyMinMax: n.xyMinMax
- }
- }
- })
- }
- ,
- nD.matchOutputRanges = function(t, e, i) {
- JC(t, function(t) {
- var n = this.findTargetInfo(t, e);
- n && !0 !== n && c(n.coordSyses, function(n) {
- var o = sD[t.brushType](1, n, t.range);
- i(t, o.values, n, e)
- })
- }, this)
- }
- ,
- nD.setInputRanges = function(t, e) {
- JC(t, function(t) {
- var i = this.findTargetInfo(t, e);
- if (t.range = t.range || [],
- i && !0 !== i) {
- t.panelId = i.panelId;
- var n = sD[t.brushType](0, i.coordSys, t.coordRange)
- , o = t.__rangeOffset;
- t.range = o ? lD[t.brushType](n.values, o.offset, pp(n.xyMinMax, o.xyMinMax)) : n.values
- }
- }, this)
- }
- ,
- nD.makePanelOpts = function(t, e) {
- return d(this._targetInfoList, function(i) {
- var n = i.getPanelRect();
- return {
- panelId: i.panelId,
- defaultBrushType: e && e(i),
- clipPath: zc(n),
- isTargetByCursor: Ec(n, t, i.coordSysModel),
- getLinearBrushOtherExtent: Nc(n)
- }
- })
- }
- ,
- nD.controlSeries = function(t, e, i) {
- var n = this.findTargetInfo(t, i);
- return !0 === n || n && QC(n.coordSyses, e.coordinateSystem) >= 0
- }
- ,
- nD.findTargetInfo = function(t, e) {
- for (var i = this._targetInfoList, n = dp(e, t), o = 0; o < i.length; o++) {
- var a = i[o]
- , r = t.panelId;
- if (r) {
- if (a.panelId === r)
- return a
- } else
- for (o = 0; o < aD.length; o++)
- if (aD[o](n, a))
- return a
- }
- return !0
- }
- ;
- var oD = {
- grid: function(t, e) {
- var i = t.xAxisModels
- , n = t.yAxisModels
- , o = t.gridModels
- , a = O()
- , r = {}
- , s = {};
- (i || n || o) && (JC(i, function(t) {
- var e = t.axis.grid.model;
- a.set(e.id, e),
- r[e.id] = !0
- }),
- JC(n, function(t) {
- var e = t.axis.grid.model;
- a.set(e.id, e),
- s[e.id] = !0
- }),
- JC(o, function(t) {
- a.set(t.id, t),
- r[t.id] = !0,
- s[t.id] = !0
- }),
- a.each(function(t) {
- var o = t.coordinateSystem
- , a = [];
- JC(o.getCartesians(), function(t, e) {
- (QC(i, t.getAxis("x").model) >= 0 || QC(n, t.getAxis("y").model) >= 0) && a.push(t)
- }),
- e.push({
- panelId: "grid--" + t.id,
- gridModel: t,
- coordSysModel: t,
- coordSys: a[0],
- coordSyses: a,
- getPanelRect: rD.grid,
- xAxisDeclared: r[t.id],
- yAxisDeclared: s[t.id]
- })
- }))
- },
- geo: function(t, e) {
- JC(t.geoModels, function(t) {
- var i = t.coordinateSystem;
- e.push({
- panelId: "geo--" + t.id,
- geoModel: t,
- coordSysModel: t,
- coordSys: i,
- coordSyses: [i],
- getPanelRect: rD.geo
- })
- })
- }
- }
- , aD = [function(t, e) {
- var i = t.xAxisModel
- , n = t.yAxisModel
- , o = t.gridModel;
- return !o && i && (o = i.axis.grid.model),
- !o && n && (o = n.axis.grid.model),
- o && o === e.gridModel
- }
- , function(t, e) {
- var i = t.geoModel;
- return i && i === e.geoModel
- }
- ]
- , rD = {
- grid: function() {
- return this.coordSys.grid.getRect().clone()
- },
- geo: function() {
- var t = this.coordSys
- , e = t.getBoundingRect().clone();
- return e.applyTransform(wo(t)),
- e
- }
- }
- , sD = {
- lineX: tD(fp, 0),
- lineY: tD(fp, 1),
- rect: function(t, e, i) {
- var n = e[eD[t]]([i[0][0], i[1][0]])
- , o = e[eD[t]]([i[0][1], i[1][1]])
- , a = [cp([n[0], o[0]]), cp([n[1], o[1]])];
- return {
- values: a,
- xyMinMax: a
- }
- },
- polygon: function(t, e, i) {
- var n = [[1 / 0, -1 / 0], [1 / 0, -1 / 0]];
- return {
- values: d(i, function(i) {
- var o = e[eD[t]](i);
- return n[0][0] = Math.min(n[0][0], o[0]),
- n[1][0] = Math.min(n[1][0], o[1]),
- n[0][1] = Math.max(n[0][1], o[0]),
- n[1][1] = Math.max(n[1][1], o[1]),
- o
- }),
- xyMinMax: n
- }
- }
- }
- , lD = {
- lineX: tD(gp, 0),
- lineY: tD(gp, 1),
- rect: function(t, e, i) {
- 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]]]
- },
- polygon: function(t, e, i) {
- return d(t, function(t, n) {
- return [t[0] - i[0] * e[n][0], t[1] - i[1] * e[n][1]]
- })
- }
- }
- , hD = ["inBrush", "outOfBrush"]
- , uD = "__ecBrushSelect"
- , cD = "__ecInBrushSelectEvent"
- , dD = Ew.VISUAL.BRUSH;
- nr(dD, function(t, e, i) {
- t.eachComponent({
- mainType: "brush"
- }, function(e) {
- i && "takeGlobalCursor" === i.type && e.setBrushOption("brush" === i.key ? i.brushOption : {
- brushType: !1
- }),
- (e.brushTargetManager = new up(e.option,t)).setInputRanges(e.areas, t)
- })
- }),
- or(dD, function(t, i, n) {
- var o, r, s = [];
- t.eachComponent({
- mainType: "brush"
- }, function(i, n) {
- function l(t) {
- return "all" === m || y[t]
- }
- function h(t) {
- return !!t.length
- }
- function u(t, e) {
- var i = t.coordinateSystem;
- b |= i.hasAxisBrushed(),
- l(e) && i.eachActiveState(t.getData(), function(t, e) {
- "active" === t && (x[e] = 1)
- })
- }
- function f(e, n, o) {
- var a = _p(e);
- if (a && !bp(i, n) && (c(w, function(n) {
- a[n.brushType] && i.brushTargetManager.controlSeries(n, e, t) && o.push(n),
- b |= h(o)
- }),
- l(n) && h(o))) {
- var r = e.getData();
- r.each(function(t) {
- xp(a, o, r, t) && (x[t] = 1)
- })
- }
- }
- var g = {
- brushId: i.id,
- brushIndex: n,
- brushName: i.name,
- areas: e(i.areas),
- selected: []
- };
- s.push(g);
- var p = i.option
- , m = p.brushLink
- , y = []
- , x = []
- , _ = []
- , b = 0;
- n || (o = p.throttleType,
- r = p.throttleDelay);
- var w = d(i.areas, function(t) {
- return wp(a({
- boundingRect: fD[t.brushType](t)
- }, t))
- })
- , S = ep(i.option, hD, function(t) {
- t.mappingMethod = "fixed"
- });
- v(m) && c(m, function(t) {
- y[t] = 1
- }),
- t.eachSeries(function(t, e) {
- var i = _[e] = [];
- "parallel" === t.subType ? u(t, e) : f(t, e, i)
- }),
- t.eachSeries(function(t, e) {
- var i = {
- seriesId: t.id,
- seriesIndex: e,
- seriesName: t.name,
- dataIndex: []
- };
- g.selected.push(i);
- var n = _p(t)
- , o = _[e]
- , a = t.getData()
- , r = l(e) ? function(t) {
- return x[t] ? (i.dataIndex.push(a.getRawIndex(t)),
- "inBrush") : "outOfBrush"
- }
- : function(t) {
- return xp(n, o, a, t) ? (i.dataIndex.push(a.getRawIndex(t)),
- "inBrush") : "outOfBrush"
- }
- ;
- (l(e) ? b : h(o)) && np(hD, S, a, r)
- })
- }),
- vp(i, o, r, s, n)
- });
- var fD = {
- lineX: z,
- lineY: z,
- rect: function(t) {
- return Sp(t.range)
- },
- polygon: function(t) {
- for (var e, i = t.range, n = 0, o = i.length; n < o; n++) {
- e = e || [[1 / 0, -1 / 0], [1 / 0, -1 / 0]];
- var a = i[n];
- a[0] < e[0][0] && (e[0][0] = a[0]),
- a[0] > e[0][1] && (e[0][1] = a[0]),
- a[1] < e[1][0] && (e[1][0] = a[1]),
- a[1] > e[1][1] && (e[1][1] = a[1])
- }
- return e && Sp(e)
- }
- }
- , gD = ["#ddd"];
- rr({
- type: "brush",
- dependencies: ["geo", "grid", "xAxis", "yAxis", "parallel", "series"],
- defaultOption: {
- toolbox: null,
- brushLink: null,
- seriesIndex: "all",
- geoIndex: null,
- xAxisIndex: null,
- yAxisIndex: null,
- brushType: "rect",
- brushMode: "single",
- transformable: !0,
- brushStyle: {
- borderWidth: 1,
- color: "rgba(120,140,180,0.3)",
- borderColor: "rgba(120,140,180,0.8)"
- },
- throttleType: "fixRate",
- throttleDelay: 0,
- removeOnClick: !0,
- z: 1e4
- },
- areas: [],
- brushType: null,
- brushOption: {},
- coordInfoList: [],
- optionUpdated: function(t, e) {
- var i = this.option;
- !e && ip(i, t, ["inBrush", "outOfBrush"]),
- i.inBrush = i.inBrush || {},
- i.outOfBrush = i.outOfBrush || {
- color: gD
- }
- },
- setAreas: function(t) {
- t && (this.areas = d(t, function(t) {
- return Mp(this.option, t)
- }, this))
- },
- setBrushOption: function(t) {
- this.brushOption = Mp(this.option, t),
- this.brushType = this.brushOption.brushType
- }
- });
- sr({
- type: "brush",
- init: function(t, e) {
- this.ecModel = t,
- this.api = e,
- this.model,
- (this._brushController = new Qu(e.getZr())).on("brush", p(this._onBrush, this)).mount()
- },
- render: function(t) {
- return this.model = t,
- Ip.apply(this, arguments)
- },
- updateView: Ip,
- updateLayout: Ip,
- updateVisual: Ip,
- dispose: function() {
- this._brushController.dispose()
- },
- _onBrush: function(t, i) {
- var n = this.model.id;
- this.model.brushTargetManager.setOutputRanges(t, this.ecModel),
- (!i.isEnd || i.removeOnClick) && this.api.dispatchAction({
- type: "brush",
- brushId: n,
- areas: e(t),
- $from: n
- })
- }
- }),
- er({
- type: "brush",
- event: "brush",
- update: "updateView"
- }, function(t, e) {
- e.eachComponent({
- mainType: "brush",
- query: t
- }, function(e) {
- e.setAreas(t.areas)
- })
- }),
- er({
- type: "brushSelect",
- event: "brushSelected",
- update: "none"
- }, function() {});
- var pD = {}
- , mD = {
- toolbox: {
- brush: {
- title: {
- rect: "矩形选择",
- polygon: "圈选",
- lineX: "横向选择",
- lineY: "纵向选择",
- keep: "保持选择",
- clear: "清除选择"
- }
- },
- dataView: {
- title: "数据视图",
- lang: ["数据视图", "关闭", "刷新"]
- },
- dataZoom: {
- title: {
- zoom: "区域缩放",
- back: "区域缩放还原"
- }
- },
- magicType: {
- title: {
- line: "切换为折线图",
- bar: "切换为柱状图",
- stack: "切换为堆叠",
- tiled: "切换为平铺"
- }
- },
- restore: {
- title: "还原"
- },
- saveAsImage: {
- title: "保存为图片",
- lang: ["右键另存为图片"]
- }
- }
- }
- , vD = mD.toolbox.brush;
- Cp.defaultOption = {
- show: !0,
- type: ["rect", "polygon", "lineX", "lineY", "keep", "clear"],
- icon: {
- rect: "M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",
- polygon: "M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",
- lineX: "M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",
- lineY: "M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",
- keep: "M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",
- clear: "M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"
- },
- title: e(vD.title)
- };
- var yD = Cp.prototype;
- yD.render = yD.updateView = yD.updateLayout = function(t, e, i) {
- var n, o, a;
- e.eachComponent({
- mainType: "brush"
- }, function(t) {
- n = t.brushType,
- o = t.brushOption.brushMode || "single",
- a |= t.areas.length
- }),
- this._brushType = n,
- this._brushMode = o,
- c(t.get("type", !0), function(e) {
- t.setIconStatus(e, ("keep" === e ? "multiple" === o : "clear" === e ? a : e === n) ? "emphasis" : "normal")
- })
- }
- ,
- yD.getIcons = function() {
- var t = this.model
- , e = t.get("icon", !0)
- , i = {};
- return c(t.get("type", !0), function(t) {
- e[t] && (i[t] = e[t])
- }),
- i
- }
- ,
- yD.onclick = function(t, e, i) {
- var n = this._brushType
- , o = this._brushMode;
- "clear" === i ? (e.dispatchAction({
- type: "axisAreaSelect",
- intervals: []
- }),
- e.dispatchAction({
- type: "brush",
- command: "clear",
- areas: []
- })) : e.dispatchAction({
- type: "takeGlobalCursor",
- key: "brush",
- brushOption: {
- brushType: "keep" === i ? n : n !== i && i,
- brushMode: "keep" === i ? "multiple" === o ? "single" : "multiple" : o
- }
- })
- }
- ,
- Tp("brush", Cp),
- Qa(function(t, e) {
- var i = t && t.brush;
- if (v(i) || (i = i ? [i] : []),
- i.length) {
- var n = [];
- c(i, function(t) {
- var e = t.hasOwnProperty("toolbox") ? t.toolbox : [];
- e instanceof Array && (n = n.concat(e))
- });
- var o = t && t.toolbox;
- v(o) && (o = o[0]),
- o || (o = {
- feature: {}
- },
- t.toolbox = [o]);
- var a = o.feature || (o.feature = {})
- , r = a.brush || (a.brush = {})
- , s = r.type || (r.type = []);
- s.push.apply(s, n),
- Qg(s),
- e && !s.length && s.push.apply(s, YC)
- }
- });
- Dp.prototype = {
- constructor: Dp,
- type: "calendar",
- dimensions: ["time", "value"],
- getDimensionsInfo: function() {
- return [{
- name: "time",
- type: "time"
- }]
- },
- getRangeInfo: function() {
- return this._rangeInfo
- },
- getModel: function() {
- return this._model
- },
- getRect: function() {
- return this._rect
- },
- getCellWidth: function() {
- return this._sw
- },
- getCellHeight: function() {
- return this._sh
- },
- getOrient: function() {
- return this._orient
- },
- getFirstDayOfWeek: function() {
- return this._firstDayOfWeek
- },
- getDateInfo: function(t) {
- var e = (t = Li(t)).getFullYear()
- , i = t.getMonth() + 1;
- i = i < 10 ? "0" + i : i;
- var n = t.getDate();
- n = n < 10 ? "0" + n : n;
- var o = t.getDay();
- return o = Math.abs((o + 7 - this.getFirstDayOfWeek()) % 7),
- {
- y: e,
- m: i,
- d: n,
- day: o,
- time: t.getTime(),
- formatedDate: e + "-" + i + "-" + n,
- date: t
- }
- },
- getNextNDay: function(t, e) {
- return 0 === (e = e || 0) ? this.getDateInfo(t) : ((t = new Date(this.getDateInfo(t).time)).setDate(t.getDate() + e),
- this.getDateInfo(t))
- },
- update: function(t, e) {
- function i(t, e) {
- return null != t[e] && "auto" !== t[e]
- }
- this._firstDayOfWeek = +this._model.getModel("dayLabel").get("firstDay"),
- this._orient = this._model.get("orient"),
- this._lineWidth = this._model.getModel("itemStyle.normal").getItemStyle().lineWidth || 0,
- this._rangeInfo = this._getRangeInfo(this._initRangeOption());
- var n = this._rangeInfo.weeks || 1
- , o = ["width", "height"]
- , a = this._model.get("cellSize").slice()
- , r = this._model.getBoxLayoutParams()
- , s = "horizontal" === this._orient ? [n, 7] : [7, n];
- c([0, 1], function(t) {
- i(a, t) && (r[o[t]] = a[t] * s[t])
- });
- var l = {
- width: e.getWidth(),
- height: e.getHeight()
- }
- , h = this._rect = Yo(r, l);
- c([0, 1], function(t) {
- i(a, t) || (a[t] = h[o[t]] / s[t])
- }),
- this._sw = a[0],
- this._sh = a[1]
- },
- dataToPoint: function(t, e) {
- v(t) && (t = t[0]),
- null == e && (e = !0);
- var i = this.getDateInfo(t)
- , n = this._rangeInfo
- , o = i.formatedDate;
- if (e && !(i.time >= n.start.time && i.time <= n.end.time))
- return [NaN, NaN];
- var a = i.day
- , r = this._getRangeInfo([n.start.time, o]).nthWeek;
- 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]
- },
- pointToData: function(t) {
- var e = this.pointToDate(t);
- return e && e.time
- },
- dataToRect: function(t, e) {
- var i = this.dataToPoint(t, e);
- return {
- contentShape: {
- x: i[0] - (this._sw - this._lineWidth) / 2,
- y: i[1] - (this._sh - this._lineWidth) / 2,
- width: this._sw - this._lineWidth,
- height: this._sh - this._lineWidth
- },
- center: i,
- tl: [i[0] - this._sw / 2, i[1] - this._sh / 2],
- tr: [i[0] + this._sw / 2, i[1] - this._sh / 2],
- br: [i[0] + this._sw / 2, i[1] + this._sh / 2],
- bl: [i[0] - this._sw / 2, i[1] + this._sh / 2]
- }
- },
- pointToDate: function(t) {
- var e = Math.floor((t[0] - this._rect.x) / this._sw) + 1
- , i = Math.floor((t[1] - this._rect.y) / this._sh) + 1
- , n = this._rangeInfo.range;
- return "vertical" === this._orient ? this._getDateByWeeksAndDay(i, e - 1, n) : this._getDateByWeeksAndDay(e, i - 1, n)
- },
- convertToPixel: m(Lp, "dataToPoint"),
- convertFromPixel: m(Lp, "pointToData"),
- _initRangeOption: function() {
- var t = this._model.get("range")
- , e = t;
- if (v(e) && 1 === e.length && (e = e[0]),
- /^\d{4}$/.test(e) && (t = [e + "-01-01", e + "-12-31"]),
- /^\d{4}[\/|-]\d{1,2}$/.test(e)) {
- var i = this.getDateInfo(e)
- , n = i.date;
- n.setMonth(n.getMonth() + 1);
- var o = this.getNextNDay(n, -1);
- t = [i.formatedDate, o.formatedDate]
- }
- /^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(e) && (t = [e, e]);
- var a = this._getRangeInfo(t);
- return a.start.time > a.end.time && t.reverse(),
- t
- },
- _getRangeInfo: function(t) {
- var e;
- (t = [this.getDateInfo(t[0]), this.getDateInfo(t[1])])[0].time > t[1].time && (e = !0,
- t.reverse());
- var i = Math.floor(t[1].time / 864e5) - Math.floor(t[0].time / 864e5) + 1
- , n = new Date(t[0].time)
- , o = n.getDate()
- , a = t[1].date.getDate();
- if (n.setDate(o + i - 1),
- n.getDate() !== a)
- for (var r = n.getTime() - t[1].time > 0 ? 1 : -1; n.getDate() !== a && (n.getTime() - t[1].time) * r > 0; )
- i -= r,
- n.setDate(o + i - 1);
- var s = Math.floor((i + t[0].day + 6) / 7)
- , l = e ? 1 - s : s - 1;
- return e && t.reverse(),
- {
- range: [t[0].formatedDate, t[1].formatedDate],
- start: t[0],
- end: t[1],
- allDay: i,
- weeks: s,
- nthWeek: l,
- fweek: t[0].day,
- lweek: t[1].day
- }
- },
- _getDateByWeeksAndDay: function(t, e, i) {
- var n = this._getRangeInfo(i);
- if (t > n.weeks || 0 === t && e < n.fweek || t === n.weeks && e > n.lweek)
- return !1;
- var o = 7 * (t - 1) - n.fweek + e
- , a = new Date(n.start.time);
- return a.setDate(n.start.d + o),
- this.getDateInfo(a)
- }
- },
- Dp.dimensions = Dp.prototype.dimensions,
- Dp.getDimensionsInfo = Dp.prototype.getDimensionsInfo,
- Dp.create = function(t, e) {
- var i = [];
- return t.eachComponent("calendar", function(n) {
- var o = new Dp(n,t,e);
- i.push(o),
- n.coordinateSystem = o
- }),
- t.eachSeries(function(t) {
- "calendar" === t.get("coordinateSystem") && (t.coordinateSystem = i[t.get("calendarIndex") || 0])
- }),
- i
- }
- ,
- ha.register("calendar", Dp);
- var xD = qb.extend({
- type: "calendar",
- coordinateSystem: null,
- defaultOption: {
- zlevel: 0,
- z: 2,
- left: 80,
- top: 60,
- cellSize: 20,
- orient: "horizontal",
- splitLine: {
- show: !0,
- lineStyle: {
- color: "#000",
- width: 1,
- type: "solid"
- }
- },
- itemStyle: {
- normal: {
- color: "#fff",
- borderWidth: 1,
- borderColor: "#ccc"
- }
- },
- dayLabel: {
- show: !0,
- firstDay: 0,
- position: "start",
- margin: "50%",
- nameMap: "en",
- color: "#000"
- },
- monthLabel: {
- show: !0,
- position: "start",
- margin: 5,
- align: "center",
- nameMap: "en",
- formatter: null,
- color: "#000"
- },
- yearLabel: {
- show: !0,
- position: null,
- margin: 30,
- formatter: null,
- color: "#ccc",
- fontFamily: "sans-serif",
- fontWeight: "bolder",
- fontSize: 20
- }
- },
- init: function(t, e, i, n) {
- var o = Qo(t);
- xD.superApply(this, "init", arguments),
- kp(t, o)
- },
- mergeOption: function(t, e) {
- xD.superApply(this, "mergeOption", arguments),
- kp(this.option, t)
- }
- })
- , _D = {
- EN: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
- CN: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"]
- }
- , bD = {
- EN: ["S", "M", "T", "W", "T", "F", "S"],
- CN: ["日", "一", "二", "三", "四", "五", "六"]
- };
- sr({
- type: "calendar",
- _tlpoints: null,
- _blpoints: null,
- _firstDayOfMonth: null,
- _firstDayPoints: null,
- render: function(t, e, i) {
- var n = this.group;
- n.removeAll();
- var o = t.coordinateSystem
- , a = o.getRangeInfo()
- , r = o.getOrient();
- this._renderDayRect(t, a, n),
- this._renderLines(t, a, r, n),
- this._renderYearText(t, a, r, n),
- this._renderMonthText(t, r, n),
- this._renderWeekText(t, a, r, n)
- },
- _renderDayRect: function(t, e, i) {
- for (var n = t.coordinateSystem, o = t.getModel("itemStyle.normal").getItemStyle(), a = n.getCellWidth(), r = n.getCellHeight(), s = e.start.time; s <= e.end.time; s = n.getNextNDay(s, 1).time) {
- var l = n.dataToRect([s], !1).tl
- , h = new pb({
- shape: {
- x: l[0],
- y: l[1],
- width: a,
- height: r
- },
- cursor: "default",
- style: o
- });
- i.add(h)
- }
- },
- _renderLines: function(t, e, i, n) {
- function o(e) {
- a._firstDayOfMonth.push(r.getDateInfo(e)),
- a._firstDayPoints.push(r.dataToRect([e], !1).tl);
- var o = a._getLinePointsOfOneWeek(t, e, i);
- a._tlpoints.push(o[0]),
- a._blpoints.push(o[o.length - 1]),
- l && a._drawSplitline(o, s, n)
- }
- var a = this
- , r = t.coordinateSystem
- , s = t.getModel("splitLine.lineStyle").getLineStyle()
- , l = t.get("splitLine.show")
- , h = s.lineWidth;
- this._tlpoints = [],
- this._blpoints = [],
- this._firstDayOfMonth = [],
- this._firstDayPoints = [];
- for (var u = e.start, c = 0; u.time <= e.end.time; c++) {
- o(u.formatedDate),
- 0 === c && (u = r.getDateInfo(e.start.y + "-" + e.start.m));
- var d = u.date;
- d.setMonth(d.getMonth() + 1),
- u = r.getDateInfo(d)
- }
- o(r.getNextNDay(e.end.time, 1).formatedDate),
- l && this._drawSplitline(a._getEdgesPoints(a._tlpoints, h, i), s, n),
- l && this._drawSplitline(a._getEdgesPoints(a._blpoints, h, i), s, n)
- },
- _getEdgesPoints: function(t, e, i) {
- var n = [t[0].slice(), t[t.length - 1].slice()]
- , o = "horizontal" === i ? 0 : 1;
- return n[0][o] = n[0][o] - e / 2,
- n[1][o] = n[1][o] + e / 2,
- n
- },
- _drawSplitline: function(t, e, i) {
- var n = new gb({
- z2: 20,
- shape: {
- points: t
- },
- style: e
- });
- i.add(n)
- },
- _getLinePointsOfOneWeek: function(t, e, i) {
- var n = t.coordinateSystem;
- e = n.getDateInfo(e);
- for (var o = [], a = 0; a < 7; a++) {
- var r = n.getNextNDay(e.time, a)
- , s = n.dataToRect([r.time], !1);
- o[2 * r.day] = s.tl,
- o[2 * r.day + 1] = s["horizontal" === i ? "bl" : "tr"]
- }
- return o
- },
- _formatterLabel: function(t, e) {
- return "string" == typeof t && t ? Gi(t, e) : "function" == typeof t ? t(e) : e.nameMap
- },
- _yearTextPositionControl: function(t, e, i, n, o) {
- e = e.slice();
- var a = ["center", "bottom"];
- "bottom" === n ? (e[1] += o,
- a = ["center", "top"]) : "left" === n ? e[0] -= o : "right" === n ? (e[0] += o,
- a = ["center", "top"]) : e[1] -= o;
- var r = 0;
- return "left" !== n && "right" !== n || (r = Math.PI / 2),
- {
- rotation: r,
- position: e,
- style: {
- textAlign: a[0],
- textVerticalAlign: a[1]
- }
- }
- },
- _renderYearText: function(t, e, i, n) {
- var o = t.getModel("yearLabel");
- if (o.get("show")) {
- var a = o.get("margin")
- , r = o.get("position");
- r || (r = "horizontal" !== i ? "top" : "left");
- var s = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]]
- , l = (s[0][0] + s[1][0]) / 2
- , h = (s[0][1] + s[1][1]) / 2
- , u = "horizontal" === i ? 0 : 1
- , c = {
- top: [l, s[u][1]],
- bottom: [l, s[1 - u][1]],
- left: [s[1 - u][0], h],
- right: [s[u][0], h]
- }
- , d = e.start.y;
- +e.end.y > +e.start.y && (d = d + "-" + e.end.y);
- var f = o.get("formatter")
- , g = {
- start: e.start.y,
- end: e.end.y,
- nameMap: d
- }
- , p = this._formatterLabel(f, g)
- , m = new ab({
- z2: 30
- });
- uo(m.style, o, {
- text: p
- }),
- m.attr(this._yearTextPositionControl(m, c[r], i, r, a)),
- n.add(m)
- }
- },
- _monthTextPositionControl: function(t, e, i, n, o) {
- var a = "left"
- , r = "top"
- , s = t[0]
- , l = t[1];
- return "horizontal" === i ? (l += o,
- e && (a = "center"),
- "start" === n && (r = "bottom")) : (s += o,
- e && (r = "middle"),
- "start" === n && (a = "right")),
- {
- x: s,
- y: l,
- textAlign: a,
- textVerticalAlign: r
- }
- },
- _renderMonthText: function(t, e, i) {
- var n = t.getModel("monthLabel");
- if (n.get("show")) {
- var a = n.get("nameMap")
- , r = n.get("margin")
- , s = n.get("position")
- , l = n.get("align")
- , h = [this._tlpoints, this._blpoints];
- x(a) && (a = _D[a.toUpperCase()] || []);
- var u = "start" === s ? 0 : 1
- , c = "horizontal" === e ? 0 : 1;
- r = "start" === s ? -r : r;
- for (var d = "center" === l, f = 0; f < h[u].length - 1; f++) {
- var g = h[u][f].slice()
- , p = this._firstDayOfMonth[f];
- if (d) {
- var m = this._firstDayPoints[f];
- g[c] = (m[c] + h[0][f + 1][c]) / 2
- }
- var v = n.get("formatter")
- , y = a[+p.m - 1]
- , _ = {
- yyyy: p.y,
- yy: (p.y + "").slice(2),
- MM: p.m,
- M: +p.m,
- nameMap: y
- }
- , b = this._formatterLabel(v, _)
- , w = new ab({
- z2: 30
- });
- o(uo(w.style, n, {
- text: b
- }), this._monthTextPositionControl(g, d, e, s, r)),
- i.add(w)
- }
- }
- },
- _weekTextPositionControl: function(t, e, i, n, o) {
- var a = "center"
- , r = "middle"
- , s = t[0]
- , l = t[1]
- , h = "start" === i;
- return "horizontal" === e ? (s = s + n + (h ? 1 : -1) * o[0] / 2,
- a = h ? "right" : "left") : (l = l + n + (h ? 1 : -1) * o[1] / 2,
- r = h ? "bottom" : "top"),
- {
- x: s,
- y: l,
- textAlign: a,
- textVerticalAlign: r
- }
- },
- _renderWeekText: function(t, e, i, n) {
- var a = t.getModel("dayLabel");
- if (a.get("show")) {
- var r = t.coordinateSystem
- , s = a.get("position")
- , l = a.get("nameMap")
- , h = a.get("margin")
- , u = r.getFirstDayOfWeek();
- x(l) && (l = bD[l.toUpperCase()] || []);
- var c = r.getNextNDay(e.end.time, 7 - e.lweek).time
- , d = [r.getCellWidth(), r.getCellHeight()];
- h = bi(h, d["horizontal" === i ? 0 : 1]),
- "start" === s && (c = r.getNextNDay(e.start.time, -(7 + e.fweek)).time,
- h = -h);
- for (var f = 0; f < 7; f++) {
- var g = r.getNextNDay(c, f)
- , p = r.dataToRect([g.time], !1).center
- , m = f;
- m = Math.abs((f + u) % 7);
- var v = new ab({
- z2: 30
- });
- o(uo(v.style, a, {
- text: l[m]
- }), this._weekTextPositionControl(p, i, s, h, d)),
- n.add(v)
- }
- }
- }
- }),
- rr({
- type: "title",
- layoutMode: {
- type: "box",
- ignoreSize: !0
- },
- defaultOption: {
- zlevel: 0,
- z: 6,
- show: !0,
- text: "",
- target: "blank",
- subtext: "",
- subtarget: "blank",
- left: 0,
- top: 0,
- backgroundColor: "rgba(0,0,0,0)",
- borderColor: "#ccc",
- borderWidth: 0,
- padding: 5,
- itemGap: 10,
- textStyle: {
- fontSize: 18,
- fontWeight: "bolder",
- color: "#333"
- },
- subtextStyle: {
- color: "#aaa"
- }
- }
- }),
- sr({
- type: "title",
- render: function(t, e, i) {
- if (this.group.removeAll(),
- t.get("show")) {
- var n = this.group
- , o = t.getModel("textStyle")
- , a = t.getModel("subtextStyle")
- , r = t.get("textAlign")
- , s = t.get("textBaseline")
- , l = new ab({
- style: uo({}, o, {
- text: t.get("text"),
- textFill: o.getTextColor()
- }, {
- disableBox: !0
- }),
- z2: 10
- })
- , h = l.getBoundingRect()
- , u = t.get("subtext")
- , c = new ab({
- style: uo({}, a, {
- text: u,
- textFill: a.getTextColor(),
- y: h.height + t.get("itemGap"),
- textVerticalAlign: "top"
- }, {
- disableBox: !0
- }),
- z2: 10
- })
- , d = t.get("link")
- , f = t.get("sublink");
- l.silent = !d,
- c.silent = !f,
- d && l.on("click", function() {
- window.open(d, "_" + t.get("target"))
- }),
- f && c.on("click", function() {
- window.open(f, "_" + t.get("subtarget"))
- }),
- n.add(l),
- u && n.add(c);
- var g = n.getBoundingRect()
- , p = t.getBoxLayoutParams();
- p.width = g.width,
- p.height = g.height;
- var m = Yo(p, {
- width: i.getWidth(),
- height: i.getHeight()
- }, t.get("padding"));
- r || ("middle" === (r = t.get("left") || t.get("right")) && (r = "center"),
- "right" === r ? m.x += m.width : "center" === r && (m.x += m.width / 2)),
- s || ("center" === (s = t.get("top") || t.get("bottom")) && (s = "middle"),
- "bottom" === s ? m.y += m.height : "middle" === s && (m.y += m.height / 2),
- s = s || "top"),
- n.attr("position", [m.x, m.y]);
- var v = {
- textAlign: r,
- textVerticalAlign: s
- };
- l.setStyle(v),
- c.setStyle(v),
- g = n.getBoundingRect();
- var y = m.margin
- , x = t.getItemStyle(["color", "opacity"]);
- x.fill = t.get("backgroundColor");
- var _ = new pb({
- shape: {
- x: g.x - y[3],
- y: g.y - y[0],
- width: g.width + y[1] + y[3],
- height: g.height + y[0] + y[2],
- r: t.get("borderRadius")
- },
- style: x,
- silent: !0
- });
- qn(_),
- n.add(_)
- }
- }
- }),
- qb.registerSubTypeDefaulter("dataZoom", function() {
- return "slider"
- });
- var wD = ["cartesian2d", "polar", "singleAxis"]
- , SD = function(t, e) {
- var i = d(t = t.slice(), Fi)
- , n = d(e = (e || []).slice(), Fi);
- return function(o, a) {
- c(t, function(t, r) {
- for (var s = {
- name: t,
- capital: i[r]
- }, l = 0; l < e.length; l++)
- s[e[l]] = t + n[l];
- o.call(a, s)
- })
- }
- }(["x", "y", "z", "radius", "angle", "single"], ["axisIndex", "axis", "index", "id"])
- , MD = c
- , ID = Si
- , TD = function(t, e, i, n) {
- this._dimName = t,
- this._axisIndex = e,
- this._valueWindow,
- this._percentWindow,
- this._dataExtent,
- this._minMaxSpan,
- this.ecModel = n,
- this._dataZoomModel = i
- };
- TD.prototype = {
- constructor: TD,
- hostedBy: function(t) {
- return this._dataZoomModel === t
- },
- getDataValueWindow: function() {
- return this._valueWindow.slice()
- },
- getDataPercentWindow: function() {
- return this._percentWindow.slice()
- },
- getTargetSeriesModels: function() {
- var t = []
- , e = this.ecModel;
- return e.eachSeries(function(i) {
- if (Pp(i.get("coordinateSystem"))) {
- var n = this._dimName
- , o = e.queryComponents({
- mainType: n + "Axis",
- index: i.get(n + "AxisIndex"),
- id: i.get(n + "AxisId")
- })[0];
- this._axisIndex === (o && o.componentIndex) && t.push(i)
- }
- }, this),
- t
- },
- getAxisModel: function() {
- return this.ecModel.getComponent(this._dimName + "Axis", this._axisIndex)
- },
- getOtherAxisModel: function() {
- var t, e, i = this._dimName, n = this.ecModel, o = this.getAxisModel();
- "x" === i || "y" === i ? (e = "gridIndex",
- t = "x" === i ? "y" : "x") : (e = "polarIndex",
- t = "angle" === i ? "radius" : "angle");
- var a;
- return n.eachComponent(t + "Axis", function(t) {
- (t.get(e) || 0) === (o.get(e) || 0) && (a = t)
- }),
- a
- },
- getMinMaxSpan: function() {
- return e(this._minMaxSpan)
- },
- calculateDataWindow: function(t) {
- var e = this._dataExtent
- , i = this.getAxisModel().axis.scale
- , n = this._dataZoomModel.getRangePropMode()
- , o = [0, 100]
- , a = [t.start, t.end]
- , r = [];
- return MD(["startValue", "endValue"], function(e) {
- r.push(null != t[e] ? i.parse(t[e]) : null)
- }),
- MD([0, 1], function(t) {
- var s = r[t]
- , l = a[t];
- "percent" === n[t] ? (null == l && (l = o[t]),
- s = i.parse(_i(l, o, e, !0))) : l = _i(s, e, o, !0),
- r[t] = s,
- a[t] = l
- }),
- {
- valueWindow: ID(r),
- percentWindow: ID(a)
- }
- },
- reset: function(t) {
- if (t === this._dataZoomModel) {
- this._dataExtent = zp(this, this._dimName, this.getTargetSeriesModels());
- var e = this.calculateDataWindow(t.option);
- this._valueWindow = e.valueWindow,
- this._percentWindow = e.percentWindow,
- Rp(this),
- Ep(this)
- }
- },
- restore: function(t) {
- t === this._dataZoomModel && (this._valueWindow = this._percentWindow = null,
- Ep(this, !0))
- },
- filterData: function(t) {
- function e(t) {
- return t >= a[0] && t <= a[1]
- }
- if (t === this._dataZoomModel) {
- var i = this._dimName
- , n = this.getTargetSeriesModels()
- , o = t.get("filterMode")
- , a = this._valueWindow;
- if ("none" !== o) {
- var r = this.getOtherAxisModel();
- t.get("$fromToolbox") && r && "category" === r.get("type") && (o = "empty"),
- MD(n, function(t) {
- var n = t.getData()
- , r = t.coordDimToDataDim(i);
- "weakFilter" === o ? n && n.filterSelf(function(t) {
- for (var e, i, o, s = 0; s < r.length; s++) {
- var l = n.get(r[s], t)
- , h = !isNaN(l)
- , u = l < a[0]
- , c = l > a[1];
- if (h && !u && !c)
- return !0;
- h && (o = !0),
- u && (e = !0),
- c && (i = !0)
- }
- return o && e && i
- }) : n && MD(r, function(i) {
- "empty" === o ? t.setData(n.map(i, function(t) {
- return e(t) ? t : NaN
- })) : n.filterSelf(i, e)
- })
- })
- }
- }
- }
- };
- var AD = c
- , CD = SD
- , DD = rr({
- type: "dataZoom",
- dependencies: ["xAxis", "yAxis", "zAxis", "radiusAxis", "angleAxis", "singleAxis", "series"],
- defaultOption: {
- zlevel: 0,
- z: 4,
- orient: null,
- xAxisIndex: null,
- yAxisIndex: null,
- filterMode: "filter",
- throttle: null,
- start: 0,
- end: 100,
- startValue: null,
- endValue: null,
- minSpan: null,
- maxSpan: null,
- minValueSpan: null,
- maxValueSpan: null,
- rangeMode: null
- },
- init: function(t, e, i) {
- this._dataIntervalByAxis = {},
- this._dataInfo = {},
- this._axisProxies = {},
- this.textStyleModel,
- this._autoThrottle = !0,
- this._rangePropMode = ["percent", "percent"];
- var n = Vp(t);
- this.mergeDefaultAndTheme(t, i),
- this.doInit(n)
- },
- mergeOption: function(t) {
- var e = Vp(t);
- i(this.option, t, !0),
- this.doInit(e)
- },
- doInit: function(t) {
- var e = this.option;
- Yv.canvasSupported || (e.realtime = !1),
- this._setDefaultThrottle(t),
- Bp(this, t),
- AD([["start", "startValue"], ["end", "endValue"]], function(t, i) {
- "value" === this._rangePropMode[i] && (e[t[0]] = null)
- }, this),
- this.textStyleModel = this.getModel("textStyle"),
- this._resetTarget(),
- this._giveAxisProxies()
- },
- _giveAxisProxies: function() {
- var t = this._axisProxies;
- this.eachTargetAxis(function(e, i, n, o) {
- var a = this.dependentModels[e.axis][i]
- , r = a.__dzAxisProxy || (a.__dzAxisProxy = new TD(e.name,i,this,o));
- t[e.name + "_" + i] = r
- }, this)
- },
- _resetTarget: function() {
- var t = this.option
- , e = this._judgeAutoMode();
- CD(function(e) {
- var i = e.axisIndex;
- t[i] = ko(t[i])
- }, this),
- "axisIndex" === e ? this._autoSetAxisIndex() : "orient" === e && this._autoSetOrient()
- },
- _judgeAutoMode: function() {
- var t = this.option
- , e = !1;
- CD(function(i) {
- null != t[i.axisIndex] && (e = !0)
- }, this);
- var i = t.orient;
- return null == i && e ? "orient" : e ? void 0 : (null == i && (t.orient = "horizontal"),
- "axisIndex")
- },
- _autoSetAxisIndex: function() {
- var t = !0
- , e = this.get("orient", !0)
- , i = this.option
- , n = this.dependentModels;
- if (t) {
- var o = "vertical" === e ? "y" : "x";
- n[o + "Axis"].length ? (i[o + "AxisIndex"] = [0],
- t = !1) : AD(n.singleAxis, function(n) {
- t && n.get("orient", !0) === e && (i.singleAxisIndex = [n.componentIndex],
- t = !1)
- })
- }
- t && CD(function(e) {
- if (t) {
- var n = []
- , o = this.dependentModels[e.axis];
- if (o.length && !n.length)
- for (var a = 0, r = o.length; a < r; a++)
- "category" === o[a].get("type") && n.push(a);
- i[e.axisIndex] = n,
- n.length && (t = !1)
- }
- }, this),
- t && this.ecModel.eachSeries(function(t) {
- this._isSeriesHasAllAxesTypeOf(t, "value") && CD(function(e) {
- var n = i[e.axisIndex]
- , o = t.get(e.axisIndex)
- , a = t.get(e.axisId)
- , r = t.ecModel.queryComponents({
- mainType: e.axis,
- index: o,
- id: a
- })[0];
- s(n, o = r.componentIndex) < 0 && n.push(o)
- })
- }, this)
- },
- _autoSetOrient: function() {
- var t;
- this.eachTargetAxis(function(e) {
- !t && (t = e.name)
- }, this),
- this.option.orient = "y" === t ? "vertical" : "horizontal"
- },
- _isSeriesHasAllAxesTypeOf: function(t, e) {
- var i = !0;
- return CD(function(n) {
- var o = t.get(n.axisIndex)
- , a = this.dependentModels[n.axis][o];
- a && a.get("type") === e || (i = !1)
- }, this),
- i
- },
- _setDefaultThrottle: function(t) {
- if (t.hasOwnProperty("throttle") && (this._autoThrottle = !1),
- this._autoThrottle) {
- var e = this.ecModel.option;
- this.option.throttle = e.animation && e.animationDurationUpdate > 0 ? 100 : 20
- }
- },
- getFirstTargetAxisModel: function() {
- var t;
- return CD(function(e) {
- if (null == t) {
- var i = this.get(e.axisIndex);
- i.length && (t = this.dependentModels[e.axis][i[0]])
- }
- }, this),
- t
- },
- eachTargetAxis: function(t, e) {
- var i = this.ecModel;
- CD(function(n) {
- AD(this.get(n.axisIndex), function(o) {
- t.call(e, n, o, this, i)
- }, this)
- }, this)
- },
- getAxisProxy: function(t, e) {
- return this._axisProxies[t + "_" + e]
- },
- getAxisModel: function(t, e) {
- var i = this.getAxisProxy(t, e);
- return i && i.getAxisModel()
- },
- setRawRange: function(t, e) {
- var i = this.option;
- AD([["start", "startValue"], ["end", "endValue"]], function(e) {
- null == t[e[0]] && null == t[e[1]] || (i[e[0]] = t[e[0]],
- i[e[1]] = t[e[1]])
- }, this),
- !e && Bp(this, t)
- },
- getPercentRange: function() {
- var t = this.findRepresentativeAxisProxy();
- if (t)
- return t.getDataPercentWindow()
- },
- getValueRange: function(t, e) {
- if (null != t || null != e)
- return this.getAxisProxy(t, e).getDataValueWindow();
- var i = this.findRepresentativeAxisProxy();
- return i ? i.getDataValueWindow() : void 0
- },
- findRepresentativeAxisProxy: function(t) {
- if (t)
- return t.__dzAxisProxy;
- var e = this._axisProxies;
- for (var i in e)
- if (e.hasOwnProperty(i) && e[i].hostedBy(this))
- return e[i];
- for (var i in e)
- if (e.hasOwnProperty(i) && !e[i].hostedBy(this))
- return e[i]
- },
- getRangePropMode: function() {
- return this._rangePropMode.slice()
- }
- })
- , LD = ww.extend({
- type: "dataZoom",
- render: function(t, e, i, n) {
- this.dataZoomModel = t,
- this.ecModel = e,
- this.api = i
- },
- getTargetCoordInfo: function() {
- function t(t, e, i, n) {
- for (var o, a = 0; a < i.length; a++)
- if (i[a].model === t) {
- o = i[a];
- break
- }
- o || i.push(o = {
- model: t,
- axisModels: [],
- coordIndex: n
- }),
- o.axisModels.push(e)
- }
- var e = this.dataZoomModel
- , i = this.ecModel
- , n = {};
- return e.eachTargetAxis(function(e, o) {
- var a = i.getComponent(e.axis, o);
- if (a) {
- var r = a.getCoordSysModel();
- r && t(r, a, n[r.mainType] || (n[r.mainType] = []), r.componentIndex)
- }
- }, this),
- n
- }
- })
- , kD = (DD.extend({
- type: "dataZoom.slider",
- layoutMode: "box",
- defaultOption: {
- show: !0,
- right: "ph",
- top: "ph",
- width: "ph",
- height: "ph",
- left: null,
- bottom: null,
- backgroundColor: "rgba(47,69,84,0)",
- dataBackground: {
- lineStyle: {
- color: "#2f4554",
- width: .5,
- opacity: .3
- },
- areaStyle: {
- color: "rgba(47,69,84,0.3)",
- opacity: .3
- }
- },
- borderColor: "#ddd",
- fillerColor: "rgba(167,183,204,0.4)",
- 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",
- handleSize: "100%",
- handleStyle: {
- color: "#a7b7cc"
- },
- labelPrecision: null,
- labelFormatter: null,
- showDetail: !0,
- showDataShadow: "auto",
- realtime: !0,
- zoomLock: !1,
- textStyle: {
- color: "#333"
- }
- }
- }),
- pb)
- , PD = _i
- , OD = Si
- , zD = p
- , ND = c
- , ED = "horizontal"
- , RD = 5
- , VD = ["line", "bar", "candlestick", "scatter"]
- , BD = LD.extend({
- type: "dataZoom.slider",
- init: function(t, e) {
- this._displayables = {},
- this._orient,
- this._range,
- this._handleEnds,
- this._size,
- this._handleWidth,
- this._handleHeight,
- this._location,
- this._dragging,
- this._dataShadowInfo,
- this.api = e
- },
- render: function(t, e, i, n) {
- BD.superApply(this, "render", arguments),
- Da(this, "_dispatchZoomAction", this.dataZoomModel.get("throttle"), "fixRate"),
- this._orient = t.get("orient"),
- !1 !== this.dataZoomModel.get("show") ? (n && "dataZoom" === n.type && n.from === this.uid || this._buildView(),
- this._updateView()) : this.group.removeAll()
- },
- remove: function() {
- BD.superApply(this, "remove", arguments),
- La(this, "_dispatchZoomAction")
- },
- dispose: function() {
- BD.superApply(this, "dispose", arguments),
- La(this, "_dispatchZoomAction")
- },
- _buildView: function() {
- var t = this.group;
- t.removeAll(),
- this._resetLocation(),
- this._resetInterval();
- var e = this._displayables.barGroup = new $y;
- this._renderBackground(),
- this._renderHandle(),
- this._renderDataShadow(),
- t.add(e),
- this._positionGroup()
- },
- _resetLocation: function() {
- var t = this.dataZoomModel
- , e = this.api
- , i = this._findCoordRect()
- , n = {
- width: e.getWidth(),
- height: e.getHeight()
- }
- , o = this._orient === ED ? {
- right: n.width - i.x - i.width,
- top: n.height - 30 - 7,
- width: i.width,
- height: 30
- } : {
- right: 7,
- top: i.y,
- width: 30,
- height: i.height
- }
- , a = Qo(t.option);
- c(["right", "top", "width", "height"], function(t) {
- "ph" === a[t] && (a[t] = o[t])
- });
- var r = Yo(a, n, t.padding);
- this._location = {
- x: r.x,
- y: r.y
- },
- this._size = [r.width, r.height],
- "vertical" === this._orient && this._size.reverse()
- },
- _positionGroup: function() {
- var t = this.group
- , e = this._location
- , i = this._orient
- , n = this.dataZoomModel.getFirstTargetAxisModel()
- , o = n && n.get("inverse")
- , a = this._displayables.barGroup
- , r = (this._dataShadowInfo || {}).otherAxisInverse;
- a.attr(i !== ED || o ? i === ED && o ? {
- scale: r ? [-1, 1] : [-1, -1]
- } : "vertical" !== i || o ? {
- scale: r ? [-1, -1] : [-1, 1],
- rotation: Math.PI / 2
- } : {
- scale: r ? [1, -1] : [1, 1],
- rotation: Math.PI / 2
- } : {
- scale: r ? [1, 1] : [1, -1]
- });
- var s = t.getBoundingRect([a]);
- t.attr("position", [e.x - s.x, e.y - s.y])
- },
- _getViewExtent: function() {
- return [0, this._size[0]]
- },
- _renderBackground: function() {
- var t = this.dataZoomModel
- , e = this._size
- , i = this._displayables.barGroup;
- i.add(new kD({
- silent: !0,
- shape: {
- x: 0,
- y: 0,
- width: e[0],
- height: e[1]
- },
- style: {
- fill: t.get("backgroundColor")
- },
- z2: -40
- })),
- i.add(new kD({
- shape: {
- x: 0,
- y: 0,
- width: e[0],
- height: e[1]
- },
- style: {
- fill: "transparent"
- },
- z2: 0,
- onclick: p(this._onClickPanelClick, this)
- }))
- },
- _renderDataShadow: function() {
- var t = this._dataShadowInfo = this._prepareDataShadowInfo();
- if (t) {
- var e = this._size
- , i = t.series
- , n = i.getRawData()
- , o = i.getShadowDim ? i.getShadowDim() : t.otherDim;
- if (null != o) {
- var r = n.getDataExtent(o)
- , s = .3 * (r[1] - r[0]);
- r = [r[0] - s, r[1] + s];
- var l, h = [0, e[1]], u = [0, e[0]], c = [[e[0], 0], [0, 0]], d = [], f = u[1] / (n.count() - 1), g = 0, p = Math.round(n.count() / e[0]);
- n.each([o], function(t, e) {
- if (p > 0 && e % p)
- g += f;
- else {
- var i = null == t || isNaN(t) || "" === t
- , n = i ? 0 : PD(t, r, h, !0);
- i && !l && e ? (c.push([c[c.length - 1][0], 0]),
- d.push([d[d.length - 1][0], 0])) : !i && l && (c.push([g, 0]),
- d.push([g, 0])),
- c.push([g, n]),
- d.push([g, n]),
- g += f,
- l = i
- }
- });
- var m = this.dataZoomModel;
- this._displayables.barGroup.add(new fb({
- shape: {
- points: c
- },
- style: a({
- fill: m.get("dataBackgroundColor")
- }, m.getModel("dataBackground.areaStyle").getAreaStyle()),
- silent: !0,
- z2: -20
- })),
- this._displayables.barGroup.add(new gb({
- shape: {
- points: d
- },
- style: m.getModel("dataBackground.lineStyle").getLineStyle(),
- silent: !0,
- z2: -19
- }))
- }
- }
- },
- _prepareDataShadowInfo: function() {
- var t = this.dataZoomModel
- , e = t.get("showDataShadow");
- if (!1 !== e) {
- var i, n = this.ecModel;
- return t.eachTargetAxis(function(o, a) {
- c(t.getAxisProxy(o.name, a).getTargetSeriesModels(), function(t) {
- if (!(i || !0 !== e && s(VD, t.get("type")) < 0)) {
- var r, l = n.getComponent(o.axis, a).axis, h = Gp(o.name), u = t.coordinateSystem;
- null != h && u.getOtherAxis && (r = u.getOtherAxis(l).inverse),
- i = {
- thisAxis: l,
- series: t,
- thisDim: o.name,
- otherDim: h,
- otherAxisInverse: r
- }
- }
- }, this)
- }, this),
- i
- }
- },
- _renderHandle: function() {
- var t = this._displayables
- , e = t.handles = []
- , i = t.handleLabels = []
- , n = this._displayables.barGroup
- , o = this._size
- , a = this.dataZoomModel;
- n.add(t.filler = new kD({
- draggable: !0,
- cursor: Wp(this._orient),
- drift: zD(this._onDragMove, this, "all"),
- onmousemove: function(t) {
- Ix(t.event)
- },
- ondragstart: zD(this._showDataInfo, this, !0),
- ondragend: zD(this._onDragEnd, this),
- onmouseover: zD(this._showDataInfo, this, !0),
- onmouseout: zD(this._showDataInfo, this, !1),
- style: {
- fill: a.get("fillerColor"),
- textPosition: "inside"
- }
- })),
- n.add(new kD(qn({
- silent: !0,
- shape: {
- x: 0,
- y: 0,
- width: o[0],
- height: o[1]
- },
- style: {
- stroke: a.get("dataBackgroundColor") || a.get("borderColor"),
- lineWidth: 1,
- fill: "rgba(0,0,0,0)"
- }
- }))),
- ND([0, 1], function(t) {
- var o = Ao(a.get("handleIcon"), {
- cursor: Wp(this._orient),
- draggable: !0,
- drift: zD(this._onDragMove, this, t),
- onmousemove: function(t) {
- Ix(t.event)
- },
- ondragend: zD(this._onDragEnd, this),
- onmouseover: zD(this._showDataInfo, this, !0),
- onmouseout: zD(this._showDataInfo, this, !1)
- }, {
- x: -1,
- y: 0,
- width: 2,
- height: 2
- })
- , r = o.getBoundingRect();
- this._handleHeight = bi(a.get("handleSize"), this._size[1]),
- this._handleWidth = r.width / r.height * this._handleHeight,
- o.setStyle(a.getModel("handleStyle").getItemStyle());
- var s = a.get("handleColor");
- null != s && (o.style.fill = s),
- n.add(e[t] = o);
- var l = a.textStyleModel;
- this.group.add(i[t] = new ab({
- silent: !0,
- invisible: !0,
- style: {
- x: 0,
- y: 0,
- text: "",
- textVerticalAlign: "middle",
- textAlign: "center",
- textFill: l.getTextColor(),
- textFont: l.getFont()
- },
- z2: 10
- }))
- }, this)
- },
- _resetInterval: function() {
- var t = this._range = this.dataZoomModel.getPercentRange()
- , e = this._getViewExtent();
- this._handleEnds = [PD(t[0], [0, 100], e, !0), PD(t[1], [0, 100], e, !0)]
- },
- _updateInterval: function(t, e) {
- var i = this.dataZoomModel
- , n = this._handleEnds
- , o = this._getViewExtent()
- , a = i.findRepresentativeAxisProxy().getMinMaxSpan()
- , r = [0, 100];
- WT(e, n, o, i.get("zoomLock") ? "all" : t, null != a.minSpan ? PD(a.minSpan, r, o, !0) : null, null != a.maxSpan ? PD(a.maxSpan, r, o, !0) : null),
- this._range = OD([PD(n[0], o, r, !0), PD(n[1], o, r, !0)])
- },
- _updateView: function(t) {
- var e = this._displayables
- , i = this._handleEnds
- , n = OD(i.slice())
- , o = this._size;
- ND([0, 1], function(t) {
- var n = e.handles[t]
- , a = this._handleHeight;
- n.attr({
- scale: [a / 2, a / 2],
- position: [i[t], o[1] / 2 - a / 2]
- })
- }, this),
- e.filler.setShape({
- x: n[0],
- y: 0,
- width: n[1] - n[0],
- height: o[1]
- }),
- this._updateDataInfo(t)
- },
- _updateDataInfo: function(t) {
- function e(t) {
- var e = wo(n.handles[t].parent, this.group)
- , i = Mo(0 === t ? "right" : "left", e)
- , s = this._handleWidth / 2 + RD
- , l = So([c[t] + (0 === t ? -s : s), this._size[1] / 2], e);
- o[t].setStyle({
- x: l[0],
- y: l[1],
- textVerticalAlign: a === ED ? "middle" : i,
- textAlign: a === ED ? i : "center",
- text: r[t]
- })
- }
- var i = this.dataZoomModel
- , n = this._displayables
- , o = n.handleLabels
- , a = this._orient
- , r = ["", ""];
- if (i.get("showDetail")) {
- var s = i.findRepresentativeAxisProxy();
- if (s) {
- var l = s.getAxisModel().axis
- , h = this._range
- , u = t ? s.calculateDataWindow({
- start: h[0],
- end: h[1]
- }).valueWindow : s.getDataValueWindow();
- r = [this._formatLabel(u[0], l), this._formatLabel(u[1], l)]
- }
- }
- var c = OD(this._handleEnds.slice());
- e.call(this, 0),
- e.call(this, 1)
- },
- _formatLabel: function(t, e) {
- var i = this.dataZoomModel
- , n = i.get("labelFormatter")
- , o = i.get("labelPrecision");
- null != o && "auto" !== o || (o = e.getPixelPrecision());
- var a = null == t || isNaN(t) ? "" : "category" === e.type || "time" === e.type ? e.scale.getLabel(Math.round(t)) : t.toFixed(Math.min(o, 20));
- return y(n) ? n(t, a) : x(n) ? n.replace("{value}", a) : a
- },
- _showDataInfo: function(t) {
- t = this._dragging || t;
- var e = this._displayables.handleLabels;
- e[0].attr("invisible", !t),
- e[1].attr("invisible", !t)
- },
- _onDragMove: function(t, e, i) {
- this._dragging = !0;
- var n = So([e, i], this._displayables.barGroup.getLocalTransform(), !0);
- this._updateInterval(t, n[0]);
- var o = this.dataZoomModel.get("realtime");
- this._updateView(!o),
- o && o && this._dispatchZoomAction()
- },
- _onDragEnd: function() {
- this._dragging = !1,
- this._showDataInfo(!1),
- this._dispatchZoomAction()
- },
- _onClickPanelClick: function(t) {
- var e = this._size
- , i = this._displayables.barGroup.transformCoordToLocal(t.offsetX, t.offsetY);
- if (!(i[0] < 0 || i[0] > e[0] || i[1] < 0 || i[1] > e[1])) {
- var n = this._handleEnds
- , o = (n[0] + n[1]) / 2;
- this._updateInterval("all", i[0] - o),
- this._updateView(),
- this._dispatchZoomAction()
- }
- },
- _dispatchZoomAction: function() {
- var t = this._range;
- this.api.dispatchAction({
- type: "dataZoom",
- from: this.uid,
- dataZoomId: this.dataZoomModel.id,
- start: t[0],
- end: t[1]
- })
- },
- _findCoordRect: function() {
- var t;
- if (ND(this.getTargetCoordInfo(), function(e) {
- if (!t && e.length) {
- var i = e[0].model.coordinateSystem;
- t = i.getRect && i.getRect()
- }
- }),
- !t) {
- var e = this.api.getWidth()
- , i = this.api.getHeight();
- t = {
- x: .2 * e,
- y: .2 * i,
- width: .6 * e,
- height: .6 * i
- }
- }
- return t
- }
- });
- DD.extend({
- type: "dataZoom.inside",
- defaultOption: {
- disabled: !1,
- zoomLock: !1,
- zoomOnMouseWheel: !0,
- moveOnMouseMove: !0,
- preventDefaultMouseMove: !0
- }
- });
- var GD = m
- , WD = "\0_ec_dataZoom_roams"
- , HD = p
- , FD = LD.extend({
- type: "dataZoom.inside",
- init: function(t, e) {
- this._range
- },
- render: function(t, e, i, n) {
- FD.superApply(this, "render", arguments),
- Zp(n, t.id) && (this._range = t.getPercentRange()),
- c(this.getTargetCoordInfo(), function(e, n) {
- var o = d(e, function(t) {
- return Up(t.model)
- });
- c(e, function(e) {
- var a = e.model
- , r = t.option;
- Hp(i, {
- coordId: Up(a),
- allCoordIds: o,
- containsPoint: function(t, e, i) {
- return a.coordinateSystem.containPoint([e, i])
- },
- dataZoomId: t.id,
- throttleRate: t.get("throttle", !0),
- panGetRange: HD(this._onPan, this, e, n),
- zoomGetRange: HD(this._onZoom, this, e, n),
- zoomLock: r.zoomLock,
- disabled: r.disabled,
- roamControllerOpt: {
- zoomOnMouseWheel: r.zoomOnMouseWheel,
- moveOnMouseMove: r.moveOnMouseMove,
- preventDefaultMouseMove: r.preventDefaultMouseMove
- }
- })
- }, this)
- }, this)
- },
- dispose: function() {
- Fp(this.api, this.dataZoomModel.id),
- FD.superApply(this, "dispose", arguments),
- this._range = null
- },
- _onPan: function(t, e, i, n, o, a, r, s, l) {
- var h = this._range.slice()
- , u = t.axisModels[0];
- if (u) {
- var c = ZD[e]([a, r], [s, l], u, i, t)
- , d = c.signal * (h[1] - h[0]) * c.pixel / c.pixelLength;
- return WT(d, h, [0, 100], "all"),
- this._range = h
- }
- },
- _onZoom: function(t, e, i, n, o, a) {
- var r = this._range.slice()
- , s = t.axisModels[0];
- if (s) {
- var l = ZD[e](null, [o, a], s, i, t)
- , h = (l.signal > 0 ? l.pixelStart + l.pixelLength - l.pixel : l.pixel - l.pixelStart) / l.pixelLength * (r[1] - r[0]) + r[0];
- n = Math.max(1 / n, 0),
- r[0] = (r[0] - h) * n + h,
- r[1] = (r[1] - h) * n + h;
- var u = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();
- return WT(0, r, [0, 100], 0, u.minSpan, u.maxSpan),
- this._range = r
- }
- }
- })
- , ZD = {
- grid: function(t, e, i, n, o) {
- var a = i.axis
- , r = {}
- , s = o.model.coordinateSystem.getRect();
- return t = t || [0, 0],
- "x" === a.dim ? (r.pixel = e[0] - t[0],
- r.pixelLength = s.width,
- r.pixelStart = s.x,
- r.signal = a.inverse ? 1 : -1) : (r.pixel = e[1] - t[1],
- r.pixelLength = s.height,
- r.pixelStart = s.y,
- r.signal = a.inverse ? -1 : 1),
- r
- },
- polar: function(t, e, i, n, o) {
- var a = i.axis
- , r = {}
- , s = o.model.coordinateSystem
- , l = s.getRadiusAxis().getExtent()
- , h = s.getAngleAxis().getExtent();
- return t = t ? s.pointToCoord(t) : [0, 0],
- e = s.pointToCoord(e),
- "radiusAxis" === i.mainType ? (r.pixel = e[0] - t[0],
- r.pixelLength = l[1] - l[0],
- r.pixelStart = l[0],
- r.signal = a.inverse ? 1 : -1) : (r.pixel = e[1] - t[1],
- r.pixelLength = h[1] - h[0],
- r.pixelStart = h[0],
- r.signal = a.inverse ? -1 : 1),
- r
- },
- singleAxis: function(t, e, i, n, o) {
- var a = i.axis
- , r = o.model.coordinateSystem.getRect()
- , s = {};
- return t = t || [0, 0],
- "horizontal" === a.orient ? (s.pixel = e[0] - t[0],
- s.pixelLength = r.width,
- s.pixelStart = r.x,
- s.signal = a.inverse ? 1 : -1) : (s.pixel = e[1] - t[1],
- s.pixelLength = r.height,
- s.pixelStart = r.y,
- s.signal = a.inverse ? -1 : 1),
- s
- }
- };
- tr(function(t, e) {
- t.eachComponent("dataZoom", function(t) {
- t.eachTargetAxis(tm),
- t.eachTargetAxis(em)
- }),
- t.eachComponent("dataZoom", function(t) {
- var e = t.findRepresentativeAxisProxy()
- , i = e.getDataPercentWindow()
- , n = e.getDataValueWindow();
- t.setRawRange({
- start: i[0],
- end: i[1],
- startValue: n[0],
- endValue: n[1]
- }, !0)
- })
- }),
- er("dataZoom", function(t, e) {
- var i = Op(p(e.eachComponent, e, "dataZoom"), SD, function(t, e) {
- return t.get(e.axisIndex)
- })
- , n = [];
- e.eachComponent({
- mainType: "dataZoom",
- query: t
- }, function(t, e) {
- n.push.apply(n, i(t).nodes)
- }),
- c(n, function(e, i) {
- e.setRawRange({
- start: t.start,
- end: t.end,
- startValue: t.startValue,
- endValue: t.endValue
- })
- })
- });
- var UD = c
- , jD = function(t) {
- var e = t && t.visualMap;
- v(e) || (e = e ? [e] : []),
- UD(e, function(t) {
- if (t) {
- im(t, "splitList") && !im(t, "pieces") && (t.pieces = t.splitList,
- delete t.splitList);
- var e = t.pieces;
- e && v(e) && UD(e, function(t) {
- _(t) && (im(t, "start") && !im(t, "min") && (t.min = t.start),
- im(t, "end") && !im(t, "max") && (t.max = t.end))
- })
- }
- })
- };
- qb.registerSubTypeDefaulter("visualMap", function(t) {
- return t.categories || (t.pieces ? t.pieces.length > 0 : t.splitNumber > 0) && !t.calculable ? "piecewise" : "continuous"
- }),
- or(Ew.VISUAL.COMPONENT, function(t) {
- t.eachComponent("visualMap", function(t) {
- nm(t)
- }),
- om(t)
- });
- var XD = {
- get: function(t, i, n) {
- var o = e((qD[t] || {})[i]);
- return n && v(o) ? o[o.length - 1] : o
- }
- }
- , qD = {
- color: {
- active: ["#006edd", "#e0ffff"],
- inactive: ["rgba(0,0,0,0)"]
- },
- colorHue: {
- active: [0, 360],
- inactive: [0, 0]
- },
- colorSaturation: {
- active: [.3, 1],
- inactive: [0, 0]
- },
- colorLightness: {
- active: [.9, .5],
- inactive: [0, 0]
- },
- colorAlpha: {
- active: [.3, 1],
- inactive: [0, 0]
- },
- opacity: {
- active: [.3, 1],
- inactive: [0, 0]
- },
- symbol: {
- active: ["circle", "roundRect", "diamond"],
- inactive: ["none"]
- },
- symbolSize: {
- active: [10, 50],
- inactive: [0, 0]
- }
- }
- , YD = eT.mapVisual
- , $D = eT.eachVisual
- , KD = v
- , JD = c
- , QD = Si
- , tL = _i
- , eL = z
- , iL = ["#f6efa6", "#d88273", "#bf444c"]
- , nL = rr({
- type: "visualMap",
- dependencies: ["series"],
- stateList: ["inRange", "outOfRange"],
- replacableOptionKeys: ["inRange", "outOfRange", "target", "controller", "color"],
- dataBound: [-1 / 0, 1 / 0],
- layoutMode: {
- type: "box",
- ignoreSize: !0
- },
- defaultOption: {
- show: !0,
- zlevel: 0,
- z: 4,
- seriesIndex: "all",
- min: 0,
- max: 200,
- dimension: null,
- inRange: null,
- outOfRange: null,
- left: 0,
- right: null,
- top: null,
- bottom: 0,
- itemWidth: null,
- itemHeight: null,
- inverse: !1,
- orient: "vertical",
- backgroundColor: "rgba(0,0,0,0)",
- borderColor: "#ccc",
- contentColor: "#5793f3",
- inactiveColor: "#aaa",
- borderWidth: 0,
- padding: 5,
- textGap: 10,
- precision: 0,
- color: null,
- formatter: null,
- text: null,
- textStyle: {
- color: "#333"
- }
- },
- init: function(t, e, i) {
- this._dataExtent,
- this.targetVisuals = {},
- this.controllerVisuals = {},
- this.textStyleModel,
- this.itemSize,
- this.mergeDefaultAndTheme(t, i)
- },
- optionUpdated: function(t, e) {
- var i = this.option;
- Yv.canvasSupported || (i.realtime = !1),
- !e && ip(i, t, this.replacableOptionKeys),
- this.textStyleModel = this.getModel("textStyle"),
- this.resetItemSize(),
- this.completeVisualOption()
- },
- resetVisual: function(t) {
- var e = this.stateList;
- t = p(t, this),
- this.controllerVisuals = ep(this.option.controller, e, t),
- this.targetVisuals = ep(this.option.target, e, t)
- },
- getTargetSeriesIndices: function() {
- var t = this.option.seriesIndex
- , e = [];
- return null == t || "all" === t ? this.ecModel.eachSeries(function(t, i) {
- e.push(i)
- }) : e = ko(t),
- e
- },
- eachTargetSeries: function(t, e) {
- c(this.getTargetSeriesIndices(), function(i) {
- t.call(e, this.ecModel.getSeriesByIndex(i))
- }, this)
- },
- isTargetSeries: function(t) {
- var e = !1;
- return this.eachTargetSeries(function(i) {
- i === t && (e = !0)
- }),
- e
- },
- formatValueText: function(t, e, i) {
- function n(t) {
- return t === l[0] ? "min" : t === l[1] ? "max" : (+t).toFixed(Math.min(s, 20))
- }
- var o, a, r = this.option, s = r.precision, l = this.dataBound, h = r.formatter;
- return i = i || ["<", ">"],
- v(t) && (t = t.slice(),
- o = !0),
- a = e ? t : o ? [n(t[0]), n(t[1])] : n(t),
- x(h) ? h.replace("{value}", o ? a[0] : a).replace("{value2}", o ? a[1] : a) : y(h) ? o ? h(t[0], t[1]) : h(t) : o ? t[0] === l[0] ? i[0] + " " + a[1] : t[1] === l[1] ? i[1] + " " + a[0] : a[0] + " - " + a[1] : a
- },
- resetExtent: function() {
- var t = this.option
- , e = QD([t.min, t.max]);
- this._dataExtent = e
- },
- getDataDimension: function(t) {
- var e = this.option.dimension;
- return null != e ? e : t.dimensions.length - 1
- },
- getExtent: function() {
- return this._dataExtent.slice()
- },
- completeVisualOption: function() {
- function t(t) {
- KD(n.color) && !t.inRange && (t.inRange = {
- color: n.color.slice().reverse()
- }),
- t.inRange = t.inRange || {
- color: iL
- },
- JD(this.stateList, function(e) {
- var i = t[e];
- if (x(i)) {
- var n = XD.get(i, "active", s);
- n ? (t[e] = {},
- t[e][i] = n) : delete t[e]
- }
- }, this)
- }
- var n = this.option
- , o = {
- inRange: n.inRange,
- outOfRange: n.outOfRange
- }
- , a = n.target || (n.target = {})
- , r = n.controller || (n.controller = {});
- i(a, o),
- i(r, o);
- var s = this.isCategory();
- t.call(this, a),
- t.call(this, r),
- function(t, e, i) {
- var n = t[e]
- , o = t[i];
- n && !o && (o = t[i] = {},
- JD(n, function(t, e) {
- if (eT.isValidType(e)) {
- var i = XD.get(e, "inactive", s);
- null != i && (o[e] = i,
- "color" !== e || o.hasOwnProperty("opacity") || o.hasOwnProperty("colorAlpha") || (o.opacity = [0, 0]))
- }
- }))
- }
- .call(this, a, "inRange", "outOfRange"),
- function(t) {
- var i = (t.inRange || {}).symbol || (t.outOfRange || {}).symbol
- , n = (t.inRange || {}).symbolSize || (t.outOfRange || {}).symbolSize
- , o = this.get("inactiveColor");
- JD(this.stateList, function(a) {
- var r = this.itemSize
- , l = t[a];
- l || (l = t[a] = {
- color: s ? o : [o]
- }),
- null == l.symbol && (l.symbol = i && e(i) || (s ? "roundRect" : ["roundRect"])),
- null == l.symbolSize && (l.symbolSize = n && e(n) || (s ? r[0] : [r[0], r[0]])),
- l.symbol = YD(l.symbol, function(t) {
- return "none" === t || "square" === t ? "roundRect" : t
- });
- var h = l.symbolSize;
- if (null != h) {
- var u = -1 / 0;
- $D(h, function(t) {
- t > u && (u = t)
- }),
- l.symbolSize = YD(h, function(t) {
- return tL(t, [0, u], [0, r[0]], !0)
- })
- }
- }, this)
- }
- .call(this, r)
- },
- resetItemSize: function() {
- this.itemSize = [parseFloat(this.get("itemWidth")), parseFloat(this.get("itemHeight"))]
- },
- isCategory: function() {
- return !!this.option.categories
- },
- setSelected: eL,
- getValueState: eL,
- getVisualMeta: eL
- })
- , oL = [20, 140]
- , aL = nL.extend({
- type: "visualMap.continuous",
- defaultOption: {
- align: "auto",
- calculable: !1,
- range: null,
- realtime: !0,
- itemHeight: null,
- itemWidth: null,
- hoverLink: !0,
- hoverLinkDataSize: null,
- hoverLinkOnHandle: null
- },
- optionUpdated: function(t, e) {
- aL.superApply(this, "optionUpdated", arguments),
- this.resetExtent(),
- this.resetVisual(function(t) {
- t.mappingMethod = "linear",
- t.dataExtent = this.getExtent()
- }),
- this._resetRange()
- },
- resetItemSize: function() {
- aL.superApply(this, "resetItemSize", arguments);
- var t = this.itemSize;
- "horizontal" === this._orient && t.reverse(),
- (null == t[0] || isNaN(t[0])) && (t[0] = oL[0]),
- (null == t[1] || isNaN(t[1])) && (t[1] = oL[1])
- },
- _resetRange: function() {
- var t = this.getExtent()
- , e = this.option.range;
- !e || e.auto ? (t.auto = 1,
- this.option.range = t) : v(e) && (e[0] > e[1] && e.reverse(),
- e[0] = Math.max(e[0], t[0]),
- e[1] = Math.min(e[1], t[1]))
- },
- completeVisualOption: function() {
- nL.prototype.completeVisualOption.apply(this, arguments),
- c(this.stateList, function(t) {
- var e = this.option.controller[t].symbolSize;
- e && e[0] !== e[1] && (e[0] = 0)
- }, this)
- },
- setSelected: function(t) {
- this.option.range = t.slice(),
- this._resetRange()
- },
- getSelected: function() {
- var t = this.getExtent()
- , e = Si((this.get("range") || []).slice());
- return e[0] > t[1] && (e[0] = t[1]),
- e[1] > t[1] && (e[1] = t[1]),
- e[0] < t[0] && (e[0] = t[0]),
- e[1] < t[0] && (e[1] = t[0]),
- e
- },
- getValueState: function(t) {
- var e = this.option.range
- , i = this.getExtent();
- return (e[0] <= i[0] || e[0] <= t) && (e[1] >= i[1] || t <= e[1]) ? "inRange" : "outOfRange"
- },
- findTargetDataIndices: function(t) {
- var e = [];
- return this.eachTargetSeries(function(i) {
- var n = []
- , o = i.getData();
- o.each(this.getDataDimension(o), function(e, i) {
- t[0] <= e && e <= t[1] && n.push(i)
- }, !0, this),
- e.push({
- seriesId: i.id,
- dataIndex: n
- })
- }, this),
- e
- },
- getVisualMeta: function(t) {
- function e(e, i) {
- o.push({
- value: e,
- color: t(e, i)
- })
- }
- for (var i = rm(0, 0, this.getExtent()), n = rm(0, 0, this.option.range.slice()), o = [], a = 0, r = 0, s = n.length, l = i.length; r < l && (!n.length || i[r] <= n[0]); r++)
- i[r] < n[a] && e(i[r], "outOfRange");
- for (h = 1; a < s; a++,
- h = 0)
- h && o.length && e(n[a], "outOfRange"),
- e(n[a], "inRange");
- for (var h = 1; r < l; r++)
- (!n.length || n[n.length - 1] < i[r]) && (h && (o.length && e(o[o.length - 1].value, "outOfRange"),
- h = 0),
- e(i[r], "outOfRange"));
- var u = o.length;
- return {
- stops: o,
- outerColors: [u ? o[0].color : "transparent", u ? o[u - 1].color : "transparent"]
- }
- }
- })
- , rL = sr({
- type: "visualMap",
- autoPositionValues: {
- left: 1,
- right: 1,
- top: 1,
- bottom: 1
- },
- init: function(t, e) {
- this.ecModel = t,
- this.api = e,
- this.visualMapModel
- },
- render: function(t, e, i, n) {
- this.visualMapModel = t,
- !1 !== t.get("show") ? this.doRender.apply(this, arguments) : this.group.removeAll()
- },
- renderBackground: function(t) {
- var e = this.visualMapModel
- , i = Ux(e.get("padding") || 0)
- , n = t.getBoundingRect();
- t.add(new pb({
- z2: -1,
- silent: !0,
- shape: {
- x: n.x - i[3],
- y: n.y - i[0],
- width: n.width + i[3] + i[1],
- height: n.height + i[0] + i[2]
- },
- style: {
- fill: e.get("backgroundColor"),
- stroke: e.get("borderColor"),
- lineWidth: e.get("borderWidth")
- }
- }))
- },
- getControllerVisual: function(t, e, i) {
- function n(t) {
- return s[t]
- }
- function o(t, e) {
- s[t] = e
- }
- var a = (i = i || {}).forceState
- , r = this.visualMapModel
- , s = {};
- if ("symbol" === e && (s.symbol = r.get("itemSymbol")),
- "color" === e) {
- var l = r.get("contentColor");
- s.color = l
- }
- var h = r.controllerVisuals[a || r.getValueState(t)];
- return c(eT.prepareVisualTypes(h), function(a) {
- var r = h[a];
- i.convertOpacityToAlpha && "opacity" === a && (a = "colorAlpha",
- r = h.__alphaForOpacity),
- eT.dependsOn(a, e) && r && r.applyVisual(t, n, o)
- }),
- s[e]
- },
- positionGroup: function(t) {
- var e = this.visualMapModel
- , i = this.api;
- $o(t, e.getBoxLayoutParams(), {
- width: i.getWidth(),
- height: i.getHeight()
- })
- },
- doRender: z
- })
- , sL = _i
- , lL = c
- , hL = Math.min
- , uL = Math.max
- , cL = 12
- , dL = 6
- , fL = rL.extend({
- type: "visualMap.continuous",
- init: function() {
- fL.superApply(this, "init", arguments),
- this._shapes = {},
- this._dataInterval = [],
- this._handleEnds = [],
- this._orient,
- this._useHandle,
- this._hoverLinkDataIndices = [],
- this._dragging,
- this._hovering
- },
- doRender: function(t, e, i, n) {
- n && "selectDataRange" === n.type && n.from === this.uid || this._buildView()
- },
- _buildView: function() {
- this.group.removeAll();
- var t = this.visualMapModel
- , e = this.group;
- this._orient = t.get("orient"),
- this._useHandle = t.get("calculable"),
- this._resetInterval(),
- this._renderBar(e);
- var i = t.get("text");
- this._renderEndsText(e, i, 0),
- this._renderEndsText(e, i, 1),
- this._updateView(!0),
- this.renderBackground(e),
- this._updateView(),
- this._enableHoverLinkToSeries(),
- this._enableHoverLinkFromSeries(),
- this.positionGroup(e)
- },
- _renderEndsText: function(t, e, i) {
- if (e) {
- var n = e[1 - i];
- n = null != n ? n + "" : "";
- var o = this.visualMapModel
- , a = o.get("textGap")
- , r = o.itemSize
- , s = this._shapes.barGroup
- , l = this._applyTransform([r[0] / 2, 0 === i ? -a : r[1] + a], s)
- , h = this._applyTransform(0 === i ? "bottom" : "top", s)
- , u = this._orient
- , c = this.visualMapModel.textStyleModel;
- this.group.add(new ab({
- style: {
- x: l[0],
- y: l[1],
- textVerticalAlign: "horizontal" === u ? "middle" : h,
- textAlign: "horizontal" === u ? h : "center",
- text: n,
- textFont: c.getFont(),
- textFill: c.getTextColor()
- }
- }))
- }
- },
- _renderBar: function(t) {
- var e = this.visualMapModel
- , i = this._shapes
- , n = e.itemSize
- , o = this._orient
- , a = this._useHandle
- , r = sm(e, this.api, n)
- , s = i.barGroup = this._createBarGroup(r);
- s.add(i.outOfRange = hm()),
- s.add(i.inRange = hm(null, a ? gm(this._orient) : null, p(this._dragHandle, this, "all", !1), p(this._dragHandle, this, "all", !0)));
- var l = e.textStyleModel.getTextRect("国")
- , h = uL(l.width, l.height);
- a && (i.handleThumbs = [],
- i.handleLabels = [],
- i.handleLabelPoints = [],
- this._createHandle(s, 0, n, h, o, r),
- this._createHandle(s, 1, n, h, o, r)),
- this._createIndicator(s, n, h, o),
- t.add(s)
- },
- _createHandle: function(t, e, i, n, o) {
- var a = p(this._dragHandle, this, e, !1)
- , r = p(this._dragHandle, this, e, !0)
- , s = hm(um(e, n), gm(this._orient), a, r);
- s.position[0] = i[0],
- t.add(s);
- var l = this.visualMapModel.textStyleModel
- , h = new ab({
- draggable: !0,
- drift: a,
- onmousemove: function(t) {
- Ix(t.event)
- },
- ondragend: r,
- style: {
- x: 0,
- y: 0,
- text: "",
- textFont: l.getFont(),
- textFill: l.getTextColor()
- }
- });
- this.group.add(h);
- var u = ["horizontal" === o ? n / 2 : 1.5 * n, "horizontal" === o ? 0 === e ? -1.5 * n : 1.5 * n : 0 === e ? -n / 2 : n / 2]
- , c = this._shapes;
- c.handleThumbs[e] = s,
- c.handleLabelPoints[e] = u,
- c.handleLabels[e] = h
- },
- _createIndicator: function(t, e, i, n) {
- var o = hm([[0, 0]], "move");
- o.position[0] = e[0],
- o.attr({
- invisible: !0,
- silent: !0
- }),
- t.add(o);
- var a = this.visualMapModel.textStyleModel
- , r = new ab({
- silent: !0,
- invisible: !0,
- style: {
- x: 0,
- y: 0,
- text: "",
- textFont: a.getFont(),
- textFill: a.getTextColor()
- }
- });
- this.group.add(r);
- var s = ["horizontal" === n ? i / 2 : dL + 3, 0]
- , l = this._shapes;
- l.indicator = o,
- l.indicatorLabel = r,
- l.indicatorLabelPoint = s
- },
- _dragHandle: function(t, e, i, n) {
- if (this._useHandle) {
- if (this._dragging = !e,
- !e) {
- var o = this._applyTransform([i, n], this._shapes.barGroup, !0);
- this._updateInterval(t, o[1]),
- this._updateView()
- }
- e === !this.visualMapModel.get("realtime") && this.api.dispatchAction({
- type: "selectDataRange",
- from: this.uid,
- visualMapId: this.visualMapModel.id,
- selected: this._dataInterval.slice()
- }),
- e ? !this._hovering && this._clearHoverLinkToSeries() : fm(this.visualMapModel) && this._doHoverLinkToSeries(this._handleEnds[t], !1)
- }
- },
- _resetInterval: function() {
- var t = this.visualMapModel
- , e = this._dataInterval = t.getSelected()
- , i = t.getExtent()
- , n = [0, t.itemSize[1]];
- this._handleEnds = [sL(e[0], i, n, !0), sL(e[1], i, n, !0)]
- },
- _updateInterval: function(t, e) {
- e = e || 0;
- var i = this.visualMapModel
- , n = this._handleEnds
- , o = [0, i.itemSize[1]];
- WT(e, n, o, t, 0);
- var a = i.getExtent();
- this._dataInterval = [sL(n[0], o, a, !0), sL(n[1], o, a, !0)]
- },
- _updateView: function(t) {
- var e = this.visualMapModel
- , i = e.getExtent()
- , n = this._shapes
- , o = [0, e.itemSize[1]]
- , a = t ? o : this._handleEnds
- , r = this._createBarVisual(this._dataInterval, i, a, "inRange")
- , s = this._createBarVisual(i, i, o, "outOfRange");
- n.inRange.setStyle({
- fill: r.barColor,
- opacity: r.opacity
- }).setShape("points", r.barPoints),
- n.outOfRange.setStyle({
- fill: s.barColor,
- opacity: s.opacity
- }).setShape("points", s.barPoints),
- this._updateHandle(a, r)
- },
- _createBarVisual: function(t, e, i, n) {
- var o = {
- forceState: n,
- convertOpacityToAlpha: !0
- }
- , a = this._makeColorGradient(t, o)
- , r = [this.getControllerVisual(t[0], "symbolSize", o), this.getControllerVisual(t[1], "symbolSize", o)]
- , s = this._createBarPoints(i, r);
- return {
- barColor: new wb(0,0,0,1,a),
- barPoints: s,
- handlesColor: [a[0].color, a[a.length - 1].color]
- }
- },
- _makeColorGradient: function(t, e) {
- var i = []
- , n = (t[1] - t[0]) / 100;
- i.push({
- color: this.getControllerVisual(t[0], "color", e),
- offset: 0
- });
- for (var o = 1; o < 100; o++) {
- var a = t[0] + n * o;
- if (a > t[1])
- break;
- i.push({
- color: this.getControllerVisual(a, "color", e),
- offset: o / 100
- })
- }
- return i.push({
- color: this.getControllerVisual(t[1], "color", e),
- offset: 1
- }),
- i
- },
- _createBarPoints: function(t, e) {
- var i = this.visualMapModel.itemSize;
- return [[i[0] - e[0], t[0]], [i[0], t[0]], [i[0], t[1]], [i[0] - e[1], t[1]]]
- },
- _createBarGroup: function(t) {
- var e = this._orient
- , i = this.visualMapModel.get("inverse");
- return new $y("horizontal" !== e || i ? "horizontal" === e && i ? {
- scale: "bottom" === t ? [-1, 1] : [1, 1],
- rotation: -Math.PI / 2
- } : "vertical" !== e || i ? {
- scale: "left" === t ? [1, 1] : [-1, 1]
- } : {
- scale: "left" === t ? [1, -1] : [-1, -1]
- } : {
- scale: "bottom" === t ? [1, 1] : [-1, 1],
- rotation: Math.PI / 2
- })
- },
- _updateHandle: function(t, e) {
- if (this._useHandle) {
- var i = this._shapes
- , n = this.visualMapModel
- , o = i.handleThumbs
- , a = i.handleLabels;
- lL([0, 1], function(r) {
- var s = o[r];
- s.setStyle("fill", e.handlesColor[r]),
- s.position[1] = t[r];
- var l = So(i.handleLabelPoints[r], wo(s, this.group));
- a[r].setStyle({
- x: l[0],
- y: l[1],
- text: n.formatValueText(this._dataInterval[r]),
- textVerticalAlign: "middle",
- textAlign: this._applyTransform("horizontal" === this._orient ? 0 === r ? "bottom" : "top" : "left", i.barGroup)
- })
- }, this)
- }
- },
- _showIndicator: function(t, e, i, n) {
- var o = this.visualMapModel
- , a = o.getExtent()
- , r = o.itemSize
- , s = [0, r[1]]
- , l = sL(t, a, s, !0)
- , h = this._shapes
- , u = h.indicator;
- if (u) {
- u.position[1] = l,
- u.attr("invisible", !1),
- u.setShape("points", cm(!!i, n, l, r[1]));
- var c = {
- convertOpacityToAlpha: !0
- }
- , d = this.getControllerVisual(t, "color", c);
- u.setStyle("fill", d);
- var f = So(h.indicatorLabelPoint, wo(u, this.group))
- , g = h.indicatorLabel;
- g.attr("invisible", !1);
- var p = this._applyTransform("left", h.barGroup)
- , m = this._orient;
- g.setStyle({
- text: (i || "") + o.formatValueText(e),
- textVerticalAlign: "horizontal" === m ? p : "middle",
- textAlign: "horizontal" === m ? "center" : p,
- x: f[0],
- y: f[1]
- })
- }
- },
- _enableHoverLinkToSeries: function() {
- var t = this;
- this._shapes.barGroup.on("mousemove", function(e) {
- if (t._hovering = !0,
- !t._dragging) {
- var i = t.visualMapModel.itemSize
- , n = t._applyTransform([e.offsetX, e.offsetY], t._shapes.barGroup, !0, !0);
- n[1] = hL(uL(0, n[1]), i[1]),
- t._doHoverLinkToSeries(n[1], 0 <= n[0] && n[0] <= i[0])
- }
- }).on("mouseout", function() {
- t._hovering = !1,
- !t._dragging && t._clearHoverLinkToSeries()
- })
- },
- _enableHoverLinkFromSeries: function() {
- var t = this.api.getZr();
- this.visualMapModel.option.hoverLink ? (t.on("mouseover", this._hoverLinkFromSeriesMouseOver, this),
- t.on("mouseout", this._hideIndicator, this)) : this._clearHoverLinkFromSeries()
- },
- _doHoverLinkToSeries: function(t, e) {
- var i = this.visualMapModel
- , n = i.itemSize;
- if (i.option.hoverLink) {
- var o = [0, n[1]]
- , a = i.getExtent();
- t = hL(uL(o[0], t), o[1]);
- var r = dm(i, a, o)
- , s = [t - r, t + r]
- , l = sL(t, o, a, !0)
- , h = [sL(s[0], o, a, !0), sL(s[1], o, a, !0)];
- s[0] < o[0] && (h[0] = -1 / 0),
- s[1] > o[1] && (h[1] = 1 / 0),
- e && (h[0] === -1 / 0 ? this._showIndicator(l, h[1], "< ", r) : h[1] === 1 / 0 ? this._showIndicator(l, h[0], "> ", r) : this._showIndicator(l, l, "≈ ", r));
- var u = this._hoverLinkDataIndices
- , c = [];
- (e || fm(i)) && (c = this._hoverLinkDataIndices = i.findTargetDataIndices(h));
- var d = Bo(u, c);
- this._dispatchHighDown("downplay", lm(d[0])),
- this._dispatchHighDown("highlight", lm(d[1]))
- }
- },
- _hoverLinkFromSeriesMouseOver: function(t) {
- var e = t.target
- , i = this.visualMapModel;
- if (e && null != e.dataIndex) {
- var n = this.ecModel.getSeriesByIndex(e.seriesIndex);
- if (i.isTargetSeries(n)) {
- var o = n.getData(e.dataType)
- , a = o.getDimension(i.getDataDimension(o))
- , r = o.get(a, e.dataIndex, !0);
- isNaN(r) || this._showIndicator(r, r)
- }
- }
- },
- _hideIndicator: function() {
- var t = this._shapes;
- t.indicator && t.indicator.attr("invisible", !0),
- t.indicatorLabel && t.indicatorLabel.attr("invisible", !0)
- },
- _clearHoverLinkToSeries: function() {
- this._hideIndicator();
- var t = this._hoverLinkDataIndices;
- this._dispatchHighDown("downplay", lm(t)),
- t.length = 0
- },
- _clearHoverLinkFromSeries: function() {
- this._hideIndicator();
- var t = this.api.getZr();
- t.off("mouseover", this._hoverLinkFromSeriesMouseOver),
- t.off("mouseout", this._hideIndicator)
- },
- _applyTransform: function(t, e, i, n) {
- var o = wo(e, n ? null : this.group);
- return Db[v(t) ? "applyTransform" : "transformDirection"](t, o, i)
- },
- _dispatchHighDown: function(t, e) {
- e && e.length && this.api.dispatchAction({
- type: t,
- batch: e
- })
- },
- dispose: function() {
- this._clearHoverLinkFromSeries(),
- this._clearHoverLinkToSeries()
- },
- remove: function() {
- this._clearHoverLinkFromSeries(),
- this._clearHoverLinkToSeries()
- }
- });
- er({
- type: "selectDataRange",
- event: "dataRangeSelected",
- update: "update"
- }, function(t, e) {
- e.eachComponent({
- mainType: "visualMap",
- query: t
- }, function(e) {
- e.setSelected(t.selected)
- })
- }),
- Qa(jD);
- var gL = nL.extend({
- type: "visualMap.piecewise",
- defaultOption: {
- selected: null,
- minOpen: !1,
- maxOpen: !1,
- align: "auto",
- itemWidth: 20,
- itemHeight: 14,
- itemSymbol: "roundRect",
- pieceList: null,
- categories: null,
- splitNumber: 5,
- selectedMode: "multiple",
- itemGap: 10,
- hoverLink: !0,
- showLabel: null
- },
- optionUpdated: function(t, i) {
- gL.superApply(this, "optionUpdated", arguments),
- this._pieceList = [],
- this.resetExtent();
- var n = this._mode = this._determineMode();
- pL[this._mode].call(this),
- this._resetSelected(t, i);
- var o = this.option.categories;
- this.resetVisual(function(t, i) {
- "categories" === n ? (t.mappingMethod = "category",
- t.categories = e(o)) : (t.dataExtent = this.getExtent(),
- t.mappingMethod = "piecewise",
- t.pieceList = d(this._pieceList, function(t) {
- var t = e(t);
- return "inRange" !== i && (t.visual = null),
- t
- }))
- })
- },
- completeVisualOption: function() {
- function t(t, e, i) {
- return t && t[e] && (_(t[e]) ? t[e].hasOwnProperty(i) : t[e] === i)
- }
- var e = this.option
- , i = {}
- , n = eT.listVisualTypes()
- , o = this.isCategory();
- c(e.pieces, function(t) {
- c(n, function(e) {
- t.hasOwnProperty(e) && (i[e] = 1)
- })
- }),
- c(i, function(i, n) {
- var a = 0;
- c(this.stateList, function(i) {
- a |= t(e, i, n) || t(e.target, i, n)
- }, this),
- !a && c(this.stateList, function(t) {
- (e[t] || (e[t] = {}))[n] = XD.get(n, "inRange" === t ? "active" : "inactive", o)
- })
- }, this),
- nL.prototype.completeVisualOption.apply(this, arguments)
- },
- _resetSelected: function(t, e) {
- var i = this.option
- , n = this._pieceList
- , o = (e ? i : t).selected || {};
- if (i.selected = o,
- c(n, function(t, e) {
- var i = this.getSelectedMapKey(t);
- o.hasOwnProperty(i) || (o[i] = !0)
- }, this),
- "single" === i.selectedMode) {
- var a = !1;
- c(n, function(t, e) {
- var i = this.getSelectedMapKey(t);
- o[i] && (a ? o[i] = !1 : a = !0)
- }, this)
- }
- },
- getSelectedMapKey: function(t) {
- return "categories" === this._mode ? t.value + "" : t.index + ""
- },
- getPieceList: function() {
- return this._pieceList
- },
- _determineMode: function() {
- var t = this.option;
- return t.pieces && t.pieces.length > 0 ? "pieces" : this.option.categories ? "categories" : "splitNumber"
- },
- setSelected: function(t) {
- this.option.selected = e(t)
- },
- getValueState: function(t) {
- var e = eT.findPieceIndex(t, this._pieceList);
- return null != e && this.option.selected[this.getSelectedMapKey(this._pieceList[e])] ? "inRange" : "outOfRange"
- },
- findTargetDataIndices: function(t) {
- var e = [];
- return this.eachTargetSeries(function(i) {
- var n = []
- , o = i.getData();
- o.each(this.getDataDimension(o), function(e, i) {
- eT.findPieceIndex(e, this._pieceList) === t && n.push(i)
- }, !0, this),
- e.push({
- seriesId: i.id,
- dataIndex: n
- })
- }, this),
- e
- },
- getRepresentValue: function(t) {
- var e;
- if (this.isCategory())
- e = t.value;
- else if (null != t.value)
- e = t.value;
- else {
- var i = t.interval || [];
- e = i[0] === -1 / 0 && i[1] === 1 / 0 ? 0 : (i[0] + i[1]) / 2
- }
- return e
- },
- getVisualMeta: function(t) {
- function e(e, a) {
- var r = o.getRepresentValue({
- interval: e
- });
- a || (a = o.getValueState(r));
- var s = t(r, a);
- e[0] === -1 / 0 ? n[0] = s : e[1] === 1 / 0 ? n[1] = s : i.push({
- value: e[0],
- color: s
- }, {
- value: e[1],
- color: s
- })
- }
- if (!this.isCategory()) {
- var i = []
- , n = []
- , o = this
- , a = this._pieceList.slice();
- if (a.length) {
- var r = a[0].interval[0];
- r !== -1 / 0 && a.unshift({
- interval: [-1 / 0, r]
- }),
- (r = a[a.length - 1].interval[1]) !== 1 / 0 && a.push({
- interval: [r, 1 / 0]
- })
- } else
- a.push({
- interval: [-1 / 0, 1 / 0]
- });
- var s = -1 / 0;
- return c(a, function(t) {
- var i = t.interval;
- i && (i[0] > s && e([s, i[0]], "outOfRange"),
- e(i.slice()),
- s = i[1])
- }, this),
- {
- stops: i,
- outerColors: n
- }
- }
- }
- })
- , pL = {
- splitNumber: function() {
- var t = this.option
- , e = this._pieceList
- , i = Math.min(t.precision, 20)
- , n = this.getExtent()
- , o = t.splitNumber;
- o = Math.max(parseInt(o, 10), 1),
- t.splitNumber = o;
- for (var a = (n[1] - n[0]) / o; +a.toFixed(i) !== a && i < 5; )
- i++;
- t.precision = i,
- a = +a.toFixed(i);
- var r = 0;
- t.minOpen && e.push({
- index: r++,
- interval: [-1 / 0, n[0]],
- close: [0, 0]
- });
- for (var s = n[0], l = r + o; r < l; s += a) {
- var h = r === o - 1 ? n[1] : s + a;
- e.push({
- index: r++,
- interval: [s, h],
- close: [1, 1]
- })
- }
- t.maxOpen && e.push({
- index: r++,
- interval: [n[1], 1 / 0],
- close: [0, 0]
- }),
- zi(e),
- c(e, function(t) {
- t.text = this.formatValueText(t.interval)
- }, this)
- },
- categories: function() {
- var t = this.option;
- c(t.categories, function(t) {
- this._pieceList.push({
- text: this.formatValueText(t, !0),
- value: t
- })
- }, this),
- pm(t, this._pieceList)
- },
- pieces: function() {
- var t = this.option
- , e = this._pieceList;
- c(t.pieces, function(t, i) {
- _(t) || (t = {
- value: t
- });
- var n = {
- text: "",
- index: i
- };
- if (null != t.label && (n.text = t.label),
- t.hasOwnProperty("value")) {
- var o = n.value = t.value;
- n.interval = [o, o],
- n.close = [1, 1]
- } else {
- for (var a = n.interval = [], r = n.close = [0, 0], s = [1, 0, 1], l = [-1 / 0, 1 / 0], h = [], u = 0; u < 2; u++) {
- for (var c = [["gte", "gt", "min"], ["lte", "lt", "max"]][u], d = 0; d < 3 && null == a[u]; d++)
- a[u] = t[c[d]],
- r[u] = s[d],
- h[u] = 2 === d;
- null == a[u] && (a[u] = l[u])
- }
- h[0] && a[1] === 1 / 0 && (r[0] = 0),
- h[1] && a[0] === -1 / 0 && (r[1] = 0),
- a[0] === a[1] && r[0] && r[1] && (n.value = a[0])
- }
- n.visual = eT.retrieveVisuals(t),
- e.push(n)
- }, this),
- pm(t, e),
- zi(e),
- c(e, function(t) {
- var e = t.close
- , i = [["<", "≤"][e[1]], [">", "≥"][e[0]]];
- t.text = t.text || this.formatValueText(null != t.value ? t.value : t.interval, !1, i)
- }, this)
- }
- };
- rL.extend({
- type: "visualMap.piecewise",
- doRender: function() {
- var t = this.group;
- t.removeAll();
- var e = this.visualMapModel
- , i = e.get("textGap")
- , n = e.textStyleModel
- , o = n.getFont()
- , a = n.getTextColor()
- , r = this._getItemAlign()
- , s = e.itemSize
- , l = this._getViewData()
- , h = l.endsText
- , u = M(e.get("showLabel", !0), !h);
- h && this._renderEndsText(t, h[0], s, u, r),
- c(l.viewPieceList, function(n) {
- var l = n.piece
- , h = new $y;
- h.onclick = p(this._onItemClick, this, l),
- this._enableHoverLink(h, n.indexInModelPieceList);
- var c = e.getRepresentValue(l);
- if (this._createItemSymbol(h, c, [0, 0, s[0], s[1]]),
- u) {
- var d = this.visualMapModel.getValueState(c);
- h.add(new ab({
- style: {
- x: "right" === r ? -i : s[0] + i,
- y: s[1] / 2,
- text: l.text,
- textVerticalAlign: "middle",
- textAlign: r,
- textFont: o,
- textFill: a,
- opacity: "outOfRange" === d ? .5 : 1
- }
- }))
- }
- t.add(h)
- }, this),
- h && this._renderEndsText(t, h[1], s, u, r),
- Ub(e.get("orient"), t, e.get("itemGap")),
- this.renderBackground(t),
- this.positionGroup(t)
- },
- _enableHoverLink: function(t, e) {
- function i(t) {
- var i = this.visualMapModel;
- i.option.hoverLink && this.api.dispatchAction({
- type: t,
- batch: lm(i.findTargetDataIndices(e))
- })
- }
- t.on("mouseover", p(i, this, "highlight")).on("mouseout", p(i, this, "downplay"))
- },
- _getItemAlign: function() {
- var t = this.visualMapModel
- , e = t.option;
- if ("vertical" === e.orient)
- return sm(t, this.api, t.itemSize);
- var i = e.align;
- return i && "auto" !== i || (i = "left"),
- i
- },
- _renderEndsText: function(t, e, i, n, o) {
- if (e) {
- var a = new $y
- , r = this.visualMapModel.textStyleModel;
- a.add(new ab({
- style: {
- x: n ? "right" === o ? i[0] : 0 : i[0] / 2,
- y: i[1] / 2,
- textVerticalAlign: "middle",
- textAlign: n ? o : "center",
- text: e,
- textFont: r.getFont(),
- textFill: r.getTextColor()
- }
- })),
- t.add(a)
- }
- },
- _getViewData: function() {
- var t = this.visualMapModel
- , e = d(t.getPieceList(), function(t, e) {
- return {
- piece: t,
- indexInModelPieceList: e
- }
- })
- , i = t.get("text")
- , n = t.get("orient")
- , o = t.get("inverse");
- return ("horizontal" === n ? o : !o) ? e.reverse() : i && (i = i.slice().reverse()),
- {
- viewPieceList: e,
- endsText: i
- }
- },
- _createItemSymbol: function(t, e, i) {
- t.add(Gr(this.getControllerVisual(e, "symbol"), i[0], i[1], i[2], i[3], this.getControllerVisual(e, "color")))
- },
- _onItemClick: function(t) {
- var i = this.visualMapModel
- , n = i.option
- , o = e(n.selected)
- , a = i.getSelectedMapKey(t);
- "single" === n.selectedMode ? (o[a] = !0,
- c(o, function(t, e) {
- o[e] = e === a
- })) : o[a] = !o[a],
- this.api.dispatchAction({
- type: "selectDataRange",
- from: this.uid,
- visualMapId: this.visualMapModel.id,
- selected: o
- })
- }
- });
- Qa(jD);
- var mL = Ei
- , vL = Vi
- , yL = rr({
- type: "marker",
- dependencies: ["series", "grid", "polar", "geo"],
- init: function(t, e, i, n) {
- this.mergeDefaultAndTheme(t, i),
- this.mergeOption(t, i, n.createdBySelf, !0)
- },
- isAnimationEnabled: function() {
- if (Yv.node)
- return !1;
- var t = this.__hostSeries;
- return this.getShallow("animation") && t && t.isAnimationEnabled()
- },
- mergeOption: function(t, e, i, n) {
- var a = this.constructor
- , r = this.mainType + "Model";
- i || e.eachSeries(function(t) {
- var i = t.get(this.mainType)
- , s = t[r];
- i && i.data ? (s ? s.mergeOption(i, e, !0) : (n && mm(i),
- c(i.data, function(t) {
- t instanceof Array ? (mm(t[0]),
- mm(t[1])) : mm(t)
- }),
- o(s = new a(i,this,e), {
- mainType: this.mainType,
- seriesIndex: t.seriesIndex,
- name: t.name,
- createdBySelf: !0
- }),
- s.__hostSeries = t),
- t[r] = s) : t[r] = null
- }, this)
- },
- formatTooltip: function(t) {
- var e = this.getData()
- , i = this.getRawValue(t)
- , n = v(i) ? d(i, mL).join(", ") : mL(i)
- , o = e.getName(t)
- , a = vL(this.name);
- return (null != i || o) && (a += "<br />"),
- o && (a += vL(o),
- null != i && (a += " : ")),
- null != i && (a += vL(n)),
- a
- },
- getData: function() {
- return this._data
- },
- setData: function(t) {
- this._data = t
- }
- });
- h(yL, Vb),
- yL.extend({
- type: "markPoint",
- defaultOption: {
- zlevel: 0,
- z: 5,
- symbol: "pin",
- symbolSize: 50,
- tooltip: {
- trigger: "item"
- },
- label: {
- normal: {
- show: !0,
- position: "inside"
- },
- emphasis: {
- show: !0
- }
- },
- itemStyle: {
- normal: {
- borderWidth: 2
- }
- }
- }
- });
- var xL = s
- , _L = m
- , bL = {
- min: _L(_m, "min"),
- max: _L(_m, "max"),
- average: _L(_m, "average")
- }
- , wL = sr({
- type: "marker",
- init: function() {
- this.markerGroupMap = O()
- },
- render: function(t, e, i) {
- var n = this.markerGroupMap;
- n.each(function(t) {
- t.__keep = !1
- });
- var o = this.type + "Model";
- e.eachSeries(function(t) {
- var n = t[o];
- n && this.renderSeries(t, n, e, i)
- }, this),
- n.each(function(t) {
- !t.__keep && this.group.remove(t.group)
- }, this)
- },
- renderSeries: function() {}
- });
- wL.extend({
- type: "markPoint",
- updateLayout: function(t, e, i) {
- e.eachSeries(function(t) {
- var e = t.markPointModel;
- e && (Tm(e.getData(), t, i),
- this.markerGroupMap.get(t.id).updateLayout(e))
- }, this)
- },
- renderSeries: function(t, e, i, n) {
- var o = t.coordinateSystem
- , a = t.id
- , r = t.getData()
- , s = this.markerGroupMap
- , l = s.get(a) || s.set(a, new Qr)
- , h = Am(o, t, e);
- e.setData(h),
- Tm(e.getData(), t, n),
- h.each(function(t) {
- var i = h.getItemModel(t)
- , n = i.getShallow("symbolSize");
- "function" == typeof n && (n = n(e.getRawValue(t), e.getDataParams(t))),
- h.setItemVisual(t, {
- symbolSize: n,
- color: i.get("itemStyle.normal.color") || r.getVisual("color"),
- symbol: i.getShallow("symbol")
- })
- }),
- l.updateData(h),
- this.group.add(l.group),
- h.eachItemGraphicEl(function(t) {
- t.traverse(function(t) {
- t.dataModel = e
- })
- }),
- l.__keep = !0,
- l.group.silent = e.get("silent") || t.get("silent")
- }
- }),
- Qa(function(t) {
- t.markPoint = t.markPoint || {}
- }),
- yL.extend({
- type: "markLine",
- defaultOption: {
- zlevel: 0,
- z: 5,
- symbol: ["circle", "arrow"],
- symbolSize: [8, 16],
- precision: 2,
- tooltip: {
- trigger: "item"
- },
- label: {
- normal: {
- show: !0,
- position: "end"
- },
- emphasis: {
- show: !0
- }
- },
- lineStyle: {
- normal: {
- type: "dashed"
- },
- emphasis: {
- width: 3
- }
- },
- animationEasing: "linear"
- }
- });
- var SL = function(t, n, a, r) {
- var s = t.getData()
- , l = r.type;
- if (!v(r) && ("min" === l || "max" === l || "average" === l || null != r.xAxis || null != r.yAxis)) {
- var h, u;
- if (null != r.yAxis || null != r.xAxis)
- h = null != r.yAxis ? "y" : "x",
- n.getAxis(h),
- u = M(r.yAxis, r.xAxis);
- else {
- var c = wm(r, s, n, t);
- h = c.valueDataDim,
- c.valueAxis,
- u = Im(s, h, l)
- }
- var d = "x" === h ? 0 : 1
- , f = 1 - d
- , g = e(r)
- , p = {};
- g.type = null,
- g.coord = [],
- p.coord = [],
- g.coord[f] = -1 / 0,
- p.coord[f] = 1 / 0;
- var m = a.get("precision");
- m >= 0 && "number" == typeof u && (u = +u.toFixed(Math.min(m, 20))),
- g.coord[d] = p.coord[d] = u,
- r = [g, p, {
- type: l,
- valueIndex: r.valueIndex,
- value: u
- }]
- }
- return r = [bm(t, r[0]), bm(t, r[1]), o({}, r[2])],
- r[2].type = r[2].type || "",
- i(r[2], r[0]),
- i(r[2], r[1]),
- r
- };
- wL.extend({
- type: "markLine",
- updateLayout: function(t, e, i) {
- e.eachSeries(function(t) {
- var e = t.markLineModel;
- if (e) {
- var n = e.getData()
- , o = e.__from
- , a = e.__to;
- o.each(function(e) {
- km(o, e, !0, t, i),
- km(a, e, !1, t, i)
- }),
- n.each(function(t) {
- n.setItemLayout(t, [o.getItemLayout(t), a.getItemLayout(t)])
- }),
- this.markerGroupMap.get(t.id).updateLayout()
- }
- }, this)
- },
- renderSeries: function(t, e, i, n) {
- function o(e, i, o) {
- var a = e.getItemModel(i);
- km(e, i, o, t, n),
- e.setItemVisual(i, {
- symbolSize: a.get("symbolSize") || p[o ? 0 : 1],
- symbol: a.get("symbol", !0) || g[o ? 0 : 1],
- color: a.get("itemStyle.normal.color") || s.getVisual("color")
- })
- }
- var a = t.coordinateSystem
- , r = t.id
- , s = t.getData()
- , l = this.markerGroupMap
- , h = l.get(r) || l.set(r, new Cu);
- this.group.add(h.group);
- var u = Pm(a, t, e)
- , c = u.from
- , d = u.to
- , f = u.line;
- e.__from = c,
- e.__to = d,
- e.setData(f);
- var g = e.get("symbol")
- , p = e.get("symbolSize");
- v(g) || (g = [g, g]),
- "number" == typeof p && (p = [p, p]),
- u.from.each(function(t) {
- o(c, t, !0),
- o(d, t, !1)
- }),
- f.each(function(t) {
- var e = f.getItemModel(t).get("lineStyle.normal.color");
- f.setItemVisual(t, {
- color: e || c.getItemVisual(t, "color")
- }),
- f.setItemLayout(t, [c.getItemLayout(t), d.getItemLayout(t)]),
- f.setItemVisual(t, {
- fromSymbolSize: c.getItemVisual(t, "symbolSize"),
- fromSymbol: c.getItemVisual(t, "symbol"),
- toSymbolSize: d.getItemVisual(t, "symbolSize"),
- toSymbol: d.getItemVisual(t, "symbol")
- })
- }),
- h.updateData(f),
- u.line.eachItemGraphicEl(function(t, i) {
- t.traverse(function(t) {
- t.dataModel = e
- })
- }),
- h.__keep = !0,
- h.group.silent = e.get("silent") || t.get("silent")
- }
- }),
- Qa(function(t) {
- t.markLine = t.markLine || {}
- }),
- yL.extend({
- type: "markArea",
- defaultOption: {
- zlevel: 0,
- z: 1,
- tooltip: {
- trigger: "item"
- },
- animation: !1,
- label: {
- normal: {
- show: !0,
- position: "top"
- },
- emphasis: {
- show: !0,
- position: "top"
- }
- },
- itemStyle: {
- normal: {
- borderWidth: 0
- }
- }
- }
- });
- var ML = function(t, e, i, o) {
- var a = bm(t, o[0])
- , r = bm(t, o[1])
- , s = M
- , l = a.coord
- , h = r.coord;
- l[0] = s(l[0], -1 / 0),
- l[1] = s(l[1], -1 / 0),
- h[0] = s(h[0], 1 / 0),
- h[1] = s(h[1], 1 / 0);
- var u = n([{}, a, r]);
- return u.coord = [a.coord, r.coord],
- u.x0 = a.x,
- u.y0 = a.y,
- u.x1 = r.x,
- u.y1 = r.y,
- u
- }
- , IL = [["x0", "y0"], ["x1", "y0"], ["x1", "y1"], ["x0", "y1"]];
- wL.extend({
- type: "markArea",
- updateLayout: function(t, e, i) {
- e.eachSeries(function(t) {
- var e = t.markAreaModel;
- if (e) {
- var n = e.getData();
- n.each(function(e) {
- var o = d(IL, function(o) {
- return Em(n, e, o, t, i)
- });
- n.setItemLayout(e, o),
- n.getItemGraphicEl(e).setShape("points", o)
- })
- }
- }, this)
- },
- renderSeries: function(t, e, i, n) {
- var o = t.coordinateSystem
- , r = t.name
- , s = t.getData()
- , l = this.markerGroupMap
- , h = l.get(r) || l.set(r, {
- group: new $y
- });
- this.group.add(h.group),
- h.__keep = !0;
- var u = Rm(o, t, e);
- e.setData(u),
- u.each(function(e) {
- u.setItemLayout(e, d(IL, function(i) {
- return Em(u, e, i, t, n)
- })),
- u.setItemVisual(e, {
- color: s.getVisual("color")
- })
- }),
- u.diff(h.__data).add(function(t) {
- var e = new fb({
- shape: {
- points: u.getItemLayout(t)
- }
- });
- u.setItemGraphicEl(t, e),
- h.group.add(e)
- }).update(function(t, i) {
- var n = h.__data.getItemGraphicEl(i);
- _o(n, {
- shape: {
- points: u.getItemLayout(t)
- }
- }, e, t),
- h.group.add(n),
- u.setItemGraphicEl(t, n)
- }).remove(function(t) {
- var e = h.__data.getItemGraphicEl(t);
- h.group.remove(e)
- }).execute(),
- u.eachItemGraphicEl(function(t, i) {
- var n = u.getItemModel(i)
- , o = n.getModel("label.normal")
- , r = n.getModel("label.emphasis")
- , s = u.getItemVisual(i, "color");
- t.useStyle(a(n.getModel("itemStyle.normal").getItemStyle(), {
- fill: kt(s, .4),
- stroke: s
- })),
- t.hoverStyle = n.getModel("itemStyle.emphasis").getItemStyle(),
- ho(t.style, t.hoverStyle, o, r, {
- labelFetcher: e,
- labelDataIndex: i,
- defaultText: u.getName(i) || "",
- isRectText: !0,
- autoColor: s
- }),
- lo(t, {}),
- t.dataModel = e
- }),
- h.__data = u,
- h.group.silent = e.get("silent") || t.get("silent")
- }
- }),
- Qa(function(t) {
- t.markArea = t.markArea || {}
- });
- qb.registerSubTypeDefaulter("timeline", function() {
- return "slider"
- }),
- er({
- type: "timelineChange",
- event: "timelineChanged",
- update: "prepareAndUpdate"
- }, function(t, e) {
- var i = e.getComponent("timeline");
- return i && null != t.currentIndex && (i.setCurrentIndex(t.currentIndex),
- !i.get("loop", !0) && i.isIndexMax() && i.setPlayState(!1)),
- e.resetOption("timeline"),
- a({
- currentIndex: i.option.currentIndex
- }, t)
- }),
- er({
- type: "timelinePlayChange",
- event: "timelinePlayChanged",
- update: "update"
- }, function(t, e) {
- var i = e.getComponent("timeline");
- i && null != t.playState && i.setPlayState(t.playState)
- });
- var TL = qb.extend({
- type: "timeline",
- layoutMode: "box",
- defaultOption: {
- zlevel: 0,
- z: 4,
- show: !0,
- axisType: "time",
- realtime: !0,
- left: "20%",
- top: null,
- right: "20%",
- bottom: 0,
- width: null,
- height: 40,
- padding: 5,
- controlPosition: "left",
- autoPlay: !1,
- rewind: !1,
- loop: !0,
- playInterval: 2e3,
- currentIndex: 0,
- itemStyle: {
- normal: {},
- emphasis: {}
- },
- label: {
- normal: {
- color: "#000"
- },
- emphasis: {}
- },
- data: []
- },
- init: function(t, e, i) {
- this._data,
- this._names,
- this.mergeDefaultAndTheme(t, i),
- this._initData()
- },
- mergeOption: function(t) {
- TL.superApply(this, "mergeOption", arguments),
- this._initData()
- },
- setCurrentIndex: function(t) {
- null == t && (t = this.option.currentIndex);
- var e = this._data.count();
- this.option.loop ? t = (t % e + e) % e : (t >= e && (t = e - 1),
- t < 0 && (t = 0)),
- this.option.currentIndex = t
- },
- getCurrentIndex: function() {
- return this.option.currentIndex
- },
- isIndexMax: function() {
- return this.getCurrentIndex() >= this._data.count() - 1
- },
- setPlayState: function(t) {
- this.option.autoPlay = !!t
- },
- getPlayState: function() {
- return !!this.option.autoPlay
- },
- _initData: function() {
- var t = this.option
- , i = t.data || []
- , n = t.axisType
- , o = this._names = [];
- if ("category" === n) {
- var a = [];
- c(i, function(t, i) {
- var n, r = Oo(t);
- _(t) ? (n = e(t)).value = i : n = i,
- a.push(n),
- x(r) || null != r && !isNaN(r) || (r = ""),
- o.push(r + "")
- }),
- i = a
- }
- var r = {
- category: "ordinal",
- time: "time"
- }[n] || "number";
- (this._data = new lS([{
- name: "value",
- type: r
- }],this)).initData(i, o)
- },
- getData: function() {
- return this._data
- },
- getCategories: function() {
- if ("category" === this.get("axisType"))
- return this._names.slice()
- }
- });
- h(TL.extend({
- type: "timeline.slider",
- defaultOption: {
- backgroundColor: "rgba(0,0,0,0)",
- borderColor: "#ccc",
- borderWidth: 0,
- orient: "horizontal",
- inverse: !1,
- tooltip: {
- trigger: "item"
- },
- symbol: "emptyCircle",
- symbolSize: 10,
- lineStyle: {
- show: !0,
- width: 2,
- color: "#304654"
- },
- label: {
- position: "auto",
- normal: {
- show: !0,
- interval: "auto",
- rotate: 0,
- color: "#304654"
- },
- emphasis: {
- show: !0,
- color: "#c23531"
- }
- },
- itemStyle: {
- normal: {
- color: "#304654",
- borderWidth: 1
- },
- emphasis: {
- color: "#c23531"
- }
- },
- checkpointStyle: {
- symbol: "circle",
- symbolSize: 13,
- color: "#c23531",
- borderWidth: 5,
- borderColor: "rgba(194,53,49, 0.5)",
- animation: !0,
- animationDuration: 300,
- animationEasing: "quinticInOut"
- },
- controlStyle: {
- show: !0,
- showPlayBtn: !0,
- showPrevBtn: !0,
- showNextBtn: !0,
- itemSize: 22,
- itemGap: 12,
- position: "left",
- playIcon: "path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",
- stopIcon: "path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",
- nextIcon: "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",
- 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",
- normal: {
- color: "#304654",
- borderColor: "#304654",
- borderWidth: 1
- },
- emphasis: {
- color: "#c23531",
- borderColor: "#c23531",
- borderWidth: 2
- }
- },
- data: []
- }
- }), Vb);
- var AL = ww.extend({
- type: "timeline"
- })
- , CL = function(t, e, i, n) {
- YS.call(this, t, e, i),
- this.type = n || "value",
- this._autoLabelInterval,
- this.model = null
- };
- CL.prototype = {
- constructor: CL,
- getLabelInterval: function() {
- var t = this.model
- , e = t.getModel("label.normal")
- , i = e.get("interval");
- return null != i && "auto" != i ? i : ((i = this._autoLabelInterval) || (i = this._autoLabelInterval = Nr(d(this.scale.getTicks(), this.dataToCoord, this), Er(this, e.get("formatter")), e.getFont(), "horizontal" === t.get("orient") ? 0 : 90, e.get("rotate"))),
- i)
- },
- isLabelIgnored: function(t) {
- if ("category" === this.type) {
- var e = this.getLabelInterval();
- return "function" == typeof e && !e(t, this.scale.getLabel(t)) || t % (e + 1)
- }
- }
- },
- l(CL, YS);
- var DL = p
- , LL = c
- , kL = Math.PI;
- AL.extend({
- type: "timeline.slider",
- init: function(t, e) {
- this.api = e,
- this._axis,
- this._viewRect,
- this._timer,
- this._currentPointer,
- this._mainGroup,
- this._labelGroup
- },
- render: function(t, e, i, n) {
- if (this.model = t,
- this.api = i,
- this.ecModel = e,
- this.group.removeAll(),
- t.get("show", !0)) {
- var o = this._layout(t, i)
- , a = this._createGroup("mainGroup")
- , r = this._createGroup("labelGroup")
- , s = this._axis = this._createAxis(o, t);
- t.formatTooltip = function(t) {
- return Vi(s.scale.getLabel(t))
- }
- ,
- LL(["AxisLine", "AxisTick", "Control", "CurrentPointer"], function(e) {
- this["_render" + e](o, a, s, t)
- }, this),
- this._renderAxisLabel(o, r, s, t),
- this._position(o, t)
- }
- this._doPlayStop()
- },
- remove: function() {
- this._clearTimer(),
- this.group.removeAll()
- },
- dispose: function() {
- this._clearTimer()
- },
- _layout: function(t, e) {
- var i = t.get("label.normal.position")
- , n = t.get("orient")
- , o = Wm(t, e);
- 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 = {
- horizontal: {
- top: "-",
- bottom: "+"
- },
- vertical: {
- left: "-",
- right: "+"
- }
- }[n][i]);
- var a = {
- horizontal: "center",
- vertical: i >= 0 || "+" === i ? "left" : "right"
- }
- , r = {
- horizontal: i >= 0 || "+" === i ? "top" : "bottom",
- vertical: "middle"
- }
- , s = {
- horizontal: 0,
- vertical: kL / 2
- }
- , l = "vertical" === n ? o.height : o.width
- , h = t.getModel("controlStyle")
- , u = h.get("show")
- , c = u ? h.get("itemSize") : 0
- , d = u ? h.get("itemGap") : 0
- , f = c + d
- , g = t.get("label.normal.rotate") || 0;
- g = g * kL / 180;
- var p, m, v, y, x = h.get("position", !0), _ = (u = h.get("show", !0)) && h.get("showPlayBtn", !0), b = u && h.get("showPrevBtn", !0), w = u && h.get("showNextBtn", !0), S = 0, M = l;
- return "left" === x || "bottom" === x ? (_ && (p = [0, 0],
- S += f),
- b && (m = [S, 0],
- S += f),
- w && (v = [M - c, 0],
- M -= f)) : (_ && (p = [M - c, 0],
- M -= f),
- b && (m = [0, 0],
- S += f),
- w && (v = [M - c, 0],
- M -= f)),
- y = [S, M],
- t.get("inverse") && y.reverse(),
- {
- viewRect: o,
- mainLength: l,
- orient: n,
- rotation: s[n],
- labelRotation: g,
- labelPosOpt: i,
- labelAlign: t.get("label.normal.align") || a[n],
- labelBaseline: t.get("label.normal.verticalAlign") || t.get("label.normal.baseline") || r[n],
- playPosition: p,
- prevBtnPosition: m,
- nextBtnPosition: v,
- axisExtent: y,
- controlSize: c,
- controlGap: d
- }
- },
- _position: function(t, e) {
- function i(t) {
- var e = t.position;
- t.origin = [c[0][0] - e[0], c[1][0] - e[1]]
- }
- function n(t) {
- return [[t.x, t.x + t.width], [t.y, t.y + t.height]]
- }
- function o(t, e, i, n, o) {
- t[n] += i[n][o] - e[n][o]
- }
- var a = this._mainGroup
- , r = this._labelGroup
- , s = t.viewRect;
- if ("vertical" === t.orient) {
- var l = nt()
- , h = s.x
- , u = s.y + s.height;
- st(l, l, [-h, -u]),
- lt(l, l, -kL / 2),
- st(l, l, [h, u]),
- (s = s.clone()).applyTransform(l)
- }
- var c = n(s)
- , d = n(a.getBoundingRect())
- , f = n(r.getBoundingRect())
- , g = a.position
- , p = r.position;
- p[0] = g[0] = c[0][0];
- var m = t.labelPosOpt;
- if (isNaN(m))
- o(g, d, c, 1, v = "+" === m ? 0 : 1),
- o(p, f, c, 1, 1 - v);
- else {
- var v = m >= 0 ? 0 : 1;
- o(g, d, c, 1, v),
- p[1] = g[1] + m
- }
- a.attr("position", g),
- r.attr("position", p),
- a.rotation = r.rotation = t.rotation,
- i(a),
- i(r)
- },
- _createAxis: function(t, e) {
- var i = e.getData()
- , n = e.get("axisType")
- , o = zr(e, n)
- , a = i.getDataExtent("value");
- o.setExtent(a[0], a[1]),
- this._customizeScale(o, i),
- o.niceTicks();
- var r = new CL("value",o,t.axisExtent,n);
- return r.model = e,
- r
- },
- _customizeScale: function(t, e) {
- t.getTicks = function() {
- return e.mapArray(["value"], function(t) {
- return t
- })
- }
- ,
- t.getTicksLabels = function() {
- return d(this.getTicks(), t.getLabel, t)
- }
- },
- _createGroup: function(t) {
- var e = this["_" + t] = new $y;
- return this.group.add(e),
- e
- },
- _renderAxisLine: function(t, e, i, n) {
- var a = i.getExtent();
- n.get("lineStyle.show") && e.add(new mb({
- shape: {
- x1: a[0],
- y1: 0,
- x2: a[1],
- y2: 0
- },
- style: o({
- lineCap: "round"
- }, n.getModel("lineStyle").getLineStyle()),
- silent: !0,
- z2: 1
- }))
- },
- _renderAxisTick: function(t, e, i, n) {
- var o = n.getData()
- , a = i.scale.getTicks();
- LL(a, function(t, a) {
- var r = i.dataToCoord(t)
- , s = o.getItemModel(a)
- , l = s.getModel("itemStyle.normal")
- , h = s.getModel("itemStyle.emphasis")
- , u = {
- position: [r, 0],
- onclick: DL(this._changeTimeline, this, a)
- }
- , c = Fm(s, l, e, u);
- lo(c, h.getItemStyle()),
- s.get("tooltip") ? (c.dataIndex = a,
- c.dataModel = n) : c.dataIndex = c.dataModel = null
- }, this)
- },
- _renderAxisLabel: function(t, e, i, n) {
- var o = n.getModel("label.normal");
- if (o.get("show")) {
- var a = n.getData()
- , r = i.scale.getTicks()
- , s = Er(i, o.get("formatter"))
- , l = i.getLabelInterval();
- LL(r, function(n, o) {
- if (!i.isLabelIgnored(o, l)) {
- var r = a.getItemModel(o)
- , h = r.getModel("label.normal")
- , u = r.getModel("label.emphasis")
- , c = i.dataToCoord(n)
- , d = new ab({
- position: [c, 0],
- rotation: t.labelRotation - t.rotation,
- onclick: DL(this._changeTimeline, this, o),
- silent: !1
- });
- uo(d.style, h, {
- text: s[o],
- textAlign: t.labelAlign,
- textVerticalAlign: t.labelBaseline
- }),
- e.add(d),
- lo(d, uo({}, u))
- }
- }, this)
- }
- },
- _renderControl: function(t, e, i, n) {
- function o(t, i, o, u) {
- if (t) {
- var c = Hm(n, i, h, {
- position: t,
- origin: [a / 2, 0],
- rotation: u ? -r : 0,
- rectHover: !0,
- style: s,
- onclick: o
- });
- e.add(c),
- lo(c, l)
- }
- }
- var a = t.controlSize
- , r = t.rotation
- , s = n.getModel("controlStyle.normal").getItemStyle()
- , l = n.getModel("controlStyle.emphasis").getItemStyle()
- , h = [0, -a / 2, a, a]
- , u = n.getPlayState()
- , c = n.get("inverse", !0);
- o(t.nextBtnPosition, "controlStyle.nextIcon", DL(this._changeTimeline, this, c ? "-" : "+")),
- o(t.prevBtnPosition, "controlStyle.prevIcon", DL(this._changeTimeline, this, c ? "+" : "-")),
- o(t.playPosition, "controlStyle." + (u ? "stopIcon" : "playIcon"), DL(this._handlePlayClick, this, !u), !0)
- },
- _renderCurrentPointer: function(t, e, i, n) {
- var o = n.getData()
- , a = n.getCurrentIndex()
- , r = o.getItemModel(a).getModel("checkpointStyle")
- , s = this
- , l = {
- onCreate: function(t) {
- t.draggable = !0,
- t.drift = DL(s._handlePointerDrag, s),
- t.ondragend = DL(s._handlePointerDragend, s),
- Zm(t, a, i, n, !0)
- },
- onUpdate: function(t) {
- Zm(t, a, i, n)
- }
- };
- this._currentPointer = Fm(r, r, this._mainGroup, {}, this._currentPointer, l)
- },
- _handlePlayClick: function(t) {
- this._clearTimer(),
- this.api.dispatchAction({
- type: "timelinePlayChange",
- playState: t,
- from: this.uid
- })
- },
- _handlePointerDrag: function(t, e, i) {
- this._clearTimer(),
- this._pointerChangeTimeline([i.offsetX, i.offsetY])
- },
- _handlePointerDragend: function(t) {
- this._pointerChangeTimeline([t.offsetX, t.offsetY], !0)
- },
- _pointerChangeTimeline: function(t, e) {
- var i = this._toAxisCoord(t)[0]
- , n = Si(this._axis.getExtent().slice());
- i > n[1] && (i = n[1]),
- i < n[0] && (i = n[0]),
- this._currentPointer.position[0] = i,
- this._currentPointer.dirty();
- var o = this._findNearestTick(i)
- , a = this.model;
- (e || o !== a.getCurrentIndex() && a.get("realtime")) && this._changeTimeline(o)
- },
- _doPlayStop: function() {
- this._clearTimer(),
- this.model.getPlayState() && (this._timer = setTimeout(DL(function() {
- var t = this.model;
- this._changeTimeline(t.getCurrentIndex() + (t.get("rewind", !0) ? -1 : 1))
- }, this), this.model.get("playInterval")))
- },
- _toAxisCoord: function(t) {
- return So(t, this._mainGroup.getLocalTransform(), !0)
- },
- _findNearestTick: function(t) {
- var e, i = this.model.getData(), n = 1 / 0, o = this._axis;
- return i.each(["value"], function(i, a) {
- var r = o.dataToCoord(i)
- , s = Math.abs(r - t);
- s < n && (n = s,
- e = a)
- }),
- e
- },
- _clearTimer: function() {
- this._timer && (clearTimeout(this._timer),
- this._timer = null)
- },
- _changeTimeline: function(t) {
- var e = this.model.getCurrentIndex();
- "+" === t ? t = e + 1 : "-" === t && (t = e - 1),
- this.api.dispatchAction({
- type: "timelineChange",
- currentIndex: t,
- from: this.uid
- })
- }
- }),
- Qa(function(t) {
- var e = t && t.timeline;
- v(e) || (e = e ? [e] : []),
- c(e, function(t) {
- t && Vm(t)
- })
- });
- var PL = rr({
- type: "toolbox",
- layoutMode: {
- type: "box",
- ignoreSize: !0
- },
- mergeDefaultAndTheme: function(t) {
- PL.superApply(this, "mergeDefaultAndTheme", arguments),
- c(this.option.feature, function(t, e) {
- var n = Ap(e);
- n && i(t, n.defaultOption)
- })
- },
- defaultOption: {
- show: !0,
- z: 6,
- zlevel: 0,
- orient: "horizontal",
- left: "right",
- top: "top",
- backgroundColor: "transparent",
- borderColor: "#ccc",
- borderRadius: 0,
- borderWidth: 0,
- padding: 5,
- itemSize: 15,
- itemGap: 8,
- showTitle: !0,
- iconStyle: {
- normal: {
- borderColor: "#666",
- color: "none"
- },
- emphasis: {
- borderColor: "#3E98C5"
- }
- }
- }
- });
- sr({
- type: "toolbox",
- render: function(t, e, i, n) {
- function o(o, r) {
- var s, c = u[o], d = u[r], f = new Co(l[c],t,t.ecModel);
- if (c && !d) {
- if (Um(c))
- s = {
- model: f,
- onclick: f.option.onclick,
- featureName: c
- };
- else {
- var g = Ap(c);
- if (!g)
- return;
- s = new g(f,e,i)
- }
- h[c] = s
- } else {
- if (!(s = h[d]))
- return;
- s.model = f,
- s.ecModel = e,
- s.api = i
- }
- c || !d ? f.get("show") && !s.unusable ? (a(f, s, c),
- f.setIconStatus = function(t, e) {
- var i = this.option
- , n = this.iconPaths;
- i.iconStatus = i.iconStatus || {},
- i.iconStatus[t] = e,
- n[t] && n[t].trigger(e)
- }
- ,
- s.render && s.render(f, e, i, n)) : s.remove && s.remove(e, i) : s.dispose && s.dispose(e, i)
- }
- function a(n, o, a) {
- var l = n.getModel("iconStyle")
- , h = o.getIcons ? o.getIcons() : n.get("icon")
- , u = n.get("title") || {};
- if ("string" == typeof h) {
- var d = h
- , f = u;
- u = {},
- (h = {})[a] = d,
- u[a] = f
- }
- var g = n.iconPaths = {};
- c(h, function(a, h) {
- var c = Ao(a, {}, {
- x: -s / 2,
- y: -s / 2,
- width: s,
- height: s
- });
- c.setStyle(l.getModel("normal").getItemStyle()),
- c.hoverStyle = l.getModel("emphasis").getItemStyle(),
- lo(c),
- t.get("showTitle") && (c.__title = u[h],
- c.on("mouseover", function() {
- var t = l.getModel("emphasis").getItemStyle();
- c.setStyle({
- text: u[h],
- textPosition: t.textPosition || "bottom",
- textFill: t.fill || t.stroke || "#000",
- textAlign: t.textAlign || "center"
- })
- }).on("mouseout", function() {
- c.setStyle({
- textFill: null
- })
- })),
- c.trigger(n.get("iconStatus." + h) || "normal"),
- r.add(c),
- c.on("click", p(o.onclick, o, e, i, h)),
- g[h] = c
- })
- }
- var r = this.group;
- if (r.removeAll(),
- t.get("show")) {
- var s = +t.get("itemSize")
- , l = t.get("feature") || {}
- , h = this._features || (this._features = {})
- , u = [];
- c(l, function(t, e) {
- u.push(e)
- }),
- new cr(this._featureNames || [],u).add(o).update(o).remove(m(o, null)).execute(),
- this._featureNames = u,
- wg(r, t, i),
- r.add(Sg(r.getBoundingRect(), t)),
- r.eachChild(function(t) {
- var e = t.__title
- , n = t.hoverStyle;
- if (n && e) {
- var o = ce(e, Ie(n))
- , a = t.position[0] + r.position[0]
- , l = !1;
- t.position[1] + r.position[1] + s + o.height > i.getHeight() && (n.textPosition = "top",
- l = !0);
- var h = l ? -5 - o.height : s + 8;
- a + o.width / 2 > i.getWidth() ? (n.textPosition = ["100%", h],
- n.textAlign = "right") : a - o.width / 2 < 0 && (n.textPosition = [0, h],
- n.textAlign = "left")
- }
- })
- }
- },
- updateView: function(t, e, i, n) {
- c(this._features, function(t) {
- t.updateView && t.updateView(t.model, e, i, n)
- })
- },
- updateLayout: function(t, e, i, n) {
- c(this._features, function(t) {
- t.updateLayout && t.updateLayout(t.model, e, i, n)
- })
- },
- remove: function(t, e) {
- c(this._features, function(i) {
- i.remove && i.remove(t, e)
- }),
- this.group.removeAll()
- },
- dispose: function(t, e) {
- c(this._features, function(i) {
- i.dispose && i.dispose(t, e)
- })
- }
- });
- var OL = mD.toolbox.saveAsImage;
- jm.defaultOption = {
- show: !0,
- icon: "M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",
- title: OL.title,
- type: "png",
- name: "",
- excludeComponents: ["toolbox"],
- pixelRatio: 1,
- lang: OL.lang.slice()
- },
- jm.prototype.unusable = !Yv.canvasSupported,
- jm.prototype.onclick = function(t, e) {
- var i = this.model
- , n = i.get("name") || t.get("title.0.text") || "echarts"
- , o = document.createElement("a")
- , a = i.get("type", !0) || "png";
- o.download = n + "." + a,
- o.target = "_blank";
- var r = e.getConnectedDataURL({
- type: a,
- backgroundColor: i.get("backgroundColor", !0) || t.get("backgroundColor") || "#fff",
- excludeComponents: i.get("excludeComponents"),
- pixelRatio: i.get("pixelRatio")
- });
- if (o.href = r,
- "function" != typeof MouseEvent || Yv.browser.ie || Yv.browser.edge)
- if (window.navigator.msSaveOrOpenBlob) {
- for (var s = atob(r.split(",")[1]), l = s.length, h = new Uint8Array(l); l--; )
- h[l] = s.charCodeAt(l);
- var u = new Blob([h]);
- window.navigator.msSaveOrOpenBlob(u, n + "." + a)
- } else {
- var c = i.get("lang")
- , d = '<body style="margin:0;"><img src="' + r + '" style="max-width:100%;" title="' + (c && c[0] || "") + '" /></body>';
- window.open().document.write(d)
- }
- else {
- var f = new MouseEvent("click",{
- view: window,
- bubbles: !0,
- cancelable: !1
- });
- o.dispatchEvent(f)
- }
- }
- ,
- Tp("saveAsImage", jm);
- var zL = mD.toolbox.magicType;
- Xm.defaultOption = {
- show: !0,
- type: [],
- icon: {
- line: "M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",
- bar: "M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",
- stack: "M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z",
- tiled: "M2.3,2.2h22.8V25H2.3V2.2z M35,2.2h22.8V25H35V2.2zM2.3,35h22.8v22.8H2.3V35z M35,35h22.8v22.8H35V35z"
- },
- title: e(zL.title),
- option: {},
- seriesIndex: {}
- };
- var NL = Xm.prototype;
- NL.getIcons = function() {
- var t = this.model
- , e = t.get("icon")
- , i = {};
- return c(t.get("type"), function(t) {
- e[t] && (i[t] = e[t])
- }),
- i
- }
- ;
- var EL = {
- line: function(t, e, n, o) {
- if ("bar" === t)
- return i({
- id: e,
- type: "line",
- data: n.get("data"),
- stack: n.get("stack"),
- markPoint: n.get("markPoint"),
- markLine: n.get("markLine")
- }, o.get("option.line") || {}, !0)
- },
- bar: function(t, e, n, o) {
- if ("line" === t)
- return i({
- id: e,
- type: "bar",
- data: n.get("data"),
- stack: n.get("stack"),
- markPoint: n.get("markPoint"),
- markLine: n.get("markLine")
- }, o.get("option.bar") || {}, !0)
- },
- stack: function(t, e, n, o) {
- if ("line" === t || "bar" === t)
- return i({
- id: e,
- stack: "__ec_magicType_stack__"
- }, o.get("option.stack") || {}, !0)
- },
- tiled: function(t, e, n, o) {
- if ("line" === t || "bar" === t)
- return i({
- id: e,
- stack: ""
- }, o.get("option.tiled") || {}, !0)
- }
- }
- , RL = [["line", "bar"], ["stack", "tiled"]];
- NL.onclick = function(t, e, i) {
- var n = this.model
- , o = n.get("seriesIndex." + i);
- if (EL[i]) {
- var r = {
- series: []
- };
- c(RL, function(t) {
- s(t, i) >= 0 && c(t, function(t) {
- n.setIconStatus(t, "normal")
- })
- }),
- n.setIconStatus(i, "emphasis"),
- t.eachComponent({
- mainType: "series",
- query: null == o ? null : {
- seriesIndex: o
- }
- }, function(e) {
- var o = e.subType
- , s = e.id
- , l = EL[i](o, s, e, n);
- l && (a(l, e.option),
- r.series.push(l));
- var h = e.coordinateSystem;
- if (h && "cartesian2d" === h.type && ("line" === i || "bar" === i)) {
- var u = h.getAxesByScale("ordinal")[0];
- if (u) {
- var c = u.dim + "Axis"
- , d = t.queryComponents({
- mainType: c,
- index: e.get(name + "Index"),
- id: e.get(name + "Id")
- })[0].componentIndex;
- r[c] = r[c] || [];
- for (var f = 0; f <= d; f++)
- r[c][d] = r[c][d] || {};
- r[c][d].boundaryGap = "bar" === i
- }
- }
- }),
- e.dispatchAction({
- type: "changeMagicType",
- currentType: i,
- newOption: r
- })
- }
- }
- ,
- er({
- type: "changeMagicType",
- event: "magicTypeChanged",
- update: "prepareAndUpdate"
- }, function(t, e) {
- e.mergeOption(t.newOption)
- }),
- Tp("magicType", Xm);
- var VL = mD.toolbox.dataView
- , BL = new Array(60).join("-")
- , GL = "\t"
- , WL = new RegExp("[" + GL + "]+","g");
- nv.defaultOption = {
- show: !0,
- readOnly: !1,
- optionToContent: null,
- contentToOption: null,
- icon: "M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",
- title: e(VL.title),
- lang: e(VL.lang),
- backgroundColor: "#fff",
- textColor: "#000",
- textareaColor: "#fff",
- textareaBorderColor: "#333",
- buttonColor: "#c23531",
- buttonTextColor: "#fff"
- },
- nv.prototype.onclick = function(t, e) {
- function i() {
- n.removeChild(a),
- x._dom = null
- }
- var n = e.getDom()
- , o = this.model;
- this._dom && n.removeChild(this._dom);
- var a = document.createElement("div");
- a.style.cssText = "position:absolute;left:5px;top:5px;bottom:5px;right:5px;",
- a.style.backgroundColor = o.get("backgroundColor") || "#fff";
- var r = document.createElement("h4")
- , s = o.get("lang") || [];
- r.innerHTML = s[0] || o.get("title"),
- r.style.cssText = "margin: 10px 20px;",
- r.style.color = o.get("textColor");
- var l = document.createElement("div")
- , h = document.createElement("textarea");
- l.style.cssText = "display:block;width:100%;overflow:auto;";
- var u = o.get("optionToContent")
- , c = o.get("contentToOption")
- , d = Km(t);
- if ("function" == typeof u) {
- var f = u(e.getOption());
- "string" == typeof f ? l.innerHTML = f : w(f) && l.appendChild(f)
- } else
- l.appendChild(h),
- h.readOnly = o.get("readOnly"),
- h.style.cssText = "width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;",
- h.style.color = o.get("textColor"),
- h.style.borderColor = o.get("textareaBorderColor"),
- h.style.backgroundColor = o.get("textareaColor"),
- h.value = d.value;
- var g = d.meta
- , p = document.createElement("div");
- p.style.cssText = "position:absolute;bottom:0;left:0;right:0;";
- var m = "float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px"
- , v = document.createElement("div")
- , y = document.createElement("div");
- m += ";background-color:" + o.get("buttonColor"),
- m += ";color:" + o.get("buttonTextColor");
- var x = this;
- ai(v, "click", i),
- ai(y, "click", function() {
- var t;
- try {
- t = "function" == typeof c ? c(l, e.getOption()) : iv(h.value, g)
- } catch (t) {
- throw i(),
- new Error("Data view format error " + t)
- }
- t && e.dispatchAction({
- type: "changeDataView",
- newOption: t
- }),
- i()
- }),
- v.innerHTML = s[1],
- y.innerHTML = s[2],
- y.style.cssText = m,
- v.style.cssText = m,
- !o.get("readOnly") && p.appendChild(y),
- p.appendChild(v),
- ai(h, "keydown", function(t) {
- if (9 === (t.keyCode || t.which)) {
- var e = this.value
- , i = this.selectionStart
- , n = this.selectionEnd;
- this.value = e.substring(0, i) + GL + e.substring(n),
- this.selectionStart = this.selectionEnd = i + 1,
- Ix(t)
- }
- }),
- a.appendChild(r),
- a.appendChild(l),
- a.appendChild(p),
- l.style.height = n.clientHeight - 80 + "px",
- n.appendChild(a),
- this._dom = a
- }
- ,
- nv.prototype.remove = function(t, e) {
- this._dom && e.getDom().removeChild(this._dom)
- }
- ,
- nv.prototype.dispose = function(t, e) {
- this.remove(t, e)
- }
- ,
- Tp("dataView", nv),
- er({
- type: "changeDataView",
- event: "dataViewChanged",
- update: "prepareAndUpdate"
- }, function(t, e) {
- var i = [];
- c(t.newOption.series, function(t) {
- var n = e.getSeriesByName(t.name)[0];
- if (n) {
- var a = n.get("data");
- i.push({
- name: t.name,
- data: ov(t.data, a)
- })
- } else
- i.push(o({
- type: "scatter"
- }, t))
- }),
- e.mergeOption(a({
- series: i
- }, t.newOption))
- });
- var HL = c
- , FL = "\0_ec_hist_store";
- DD.extend({
- type: "dataZoom.select"
- }),
- LD.extend({
- type: "dataZoom.select"
- });
- var ZL = mD.toolbox.dataZoom
- , UL = c
- , jL = "\0_ec_\0toolbox-dataZoom_";
- uv.defaultOption = {
- show: !0,
- icon: {
- zoom: "M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",
- back: "M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"
- },
- title: e(ZL.title)
- };
- var XL = uv.prototype;
- XL.render = function(t, e, i, n) {
- this.model = t,
- this.ecModel = e,
- this.api = i,
- fv(t, e, this, n, i),
- dv(t, e)
- }
- ,
- XL.onclick = function(t, e, i) {
- qL[i].call(this)
- }
- ,
- XL.remove = function(t, e) {
- this._brushController.unmount()
- }
- ,
- XL.dispose = function(t, e) {
- this._brushController.dispose()
- }
- ;
- var qL = {
- zoom: function() {
- var t = !this._isZoomActive;
- this.api.dispatchAction({
- type: "takeGlobalCursor",
- key: "dataZoomSelect",
- dataZoomSelectActive: t
- })
- },
- back: function() {
- this._dispatchZoomAction(rv(this.ecModel))
- }
- };
- XL._onBrush = function(t, e) {
- function i(t, e, i) {
- var r = e.getAxis(t)
- , s = r.model
- , l = n(t, s, a)
- , h = l.findRepresentativeAxisProxy(s).getMinMaxSpan();
- null == h.minValueSpan && null == h.maxValueSpan || (i = WT(0, i.slice(), r.scale.getExtent(), 0, h.minValueSpan, h.maxValueSpan)),
- l && (o[l.id] = {
- dataZoomId: l.id,
- startValue: i[0],
- endValue: i[1]
- })
- }
- function n(t, e, i) {
- var n;
- return i.eachComponent({
- mainType: "dataZoom",
- subType: "select"
- }, function(i) {
- i.getAxisModel(t, e.componentIndex) && (n = i)
- }),
- n
- }
- if (e.isEnd && t.length) {
- var o = {}
- , a = this.ecModel;
- this._brushController.updateCovers([]),
- new up(cv(this.model.option),a,{
- include: ["grid"]
- }).matchOutputRanges(t, a, function(t, e, n) {
- if ("cartesian2d" === n.type) {
- var o = t.brushType;
- "rect" === o ? (i("x", n, e[0]),
- i("y", n, e[1])) : i({
- lineX: "x",
- lineY: "y"
- }[o], n, e)
- }
- }),
- av(a, o),
- this._dispatchZoomAction(o)
- }
- }
- ,
- XL._dispatchZoomAction = function(t) {
- var i = [];
- UL(t, function(t, n) {
- i.push(e(t))
- }),
- i.length && this.api.dispatchAction({
- type: "dataZoom",
- from: this.uid,
- batch: i
- })
- }
- ,
- Tp("dataZoom", uv),
- Qa(function(t) {
- function e(t, e) {
- if (e) {
- var o = t + "Index"
- , a = e[o];
- null == a || "all" == a || v(a) || (a = !1 === a || "none" === a ? [] : [a]),
- i(t, function(e, i) {
- if (null == a || "all" == a || -1 !== s(a, i)) {
- var r = {
- type: "select",
- $fromToolbox: !0,
- id: jL + t + i
- };
- r[o] = i,
- n.push(r)
- }
- })
- }
- }
- function i(e, i) {
- var n = t[e];
- v(n) || (n = n ? [n] : []),
- UL(n, i)
- }
- if (t) {
- var n = t.dataZoom || (t.dataZoom = []);
- v(n) || (t.dataZoom = n = [n]);
- var o = t.toolbox;
- if (o && (v(o) && (o = o[0]),
- o && o.feature)) {
- var a = o.feature.dataZoom;
- e("xAxis", a),
- e("yAxis", a)
- }
- }
- });
- var YL = mD.toolbox.restore;
- gv.defaultOption = {
- show: !0,
- icon: "M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",
- title: YL.title
- },
- gv.prototype.onclick = function(t, e, i) {
- sv(t),
- e.dispatchAction({
- type: "restore",
- from: this.uid
- })
- }
- ,
- Tp("restore", gv),
- er({
- type: "restore",
- event: "restore",
- update: "prepareAndUpdate"
- }, function(t, e) {
- e.resetOption("recreate")
- });
- var $L, KL = "urn:schemas-microsoft-com:vml", JL = window, QL = !1, tk = JL && JL.document;
- if (tk && !Yv.canvasSupported)
- try {
- !tk.namespaces.zrvml && tk.namespaces.add("zrvml", KL),
- $L = function(t) {
- return tk.createElement("<zrvml:" + t + ' class="zrvml">')
- }
- } catch (t) {
- $L = function(t) {
- return tk.createElement("<" + t + ' xmlns="' + KL + '" class="zrvml">')
- }
- }
- var ek = Math.round
- , ik = Math.sqrt
- , nk = Math.abs
- , ok = Math.cos
- , ak = Math.sin
- , rk = Math.max;
- if (!Yv.canvasSupported) {
- var sk = 21600
- , lk = sk / 2
- , hk = function(t) {
- t.style.cssText = "position:absolute;left:0;top:0;width:1px;height:1px;",
- t.coordsize = sk + "," + sk,
- t.coordorigin = "0,0"
- }
- , uk = function(t) {
- return String(t).replace(/&/g, "&").replace(/"/g, """)
- }
- , ck = function(t, e, i) {
- return "rgb(" + [t, e, i].join(",") + ")"
- }
- , dk = function(t, e) {
- e && t && e.parentNode !== t && t.appendChild(e)
- }
- , fk = function(t, e) {
- e && t && e.parentNode === t && t.removeChild(e)
- }
- , gk = function(t, e, i) {
- return 1e5 * (parseFloat(t) || 0) + 1e3 * (parseFloat(e) || 0) + i
- }
- , pk = function(t, e) {
- return "string" == typeof t ? t.lastIndexOf("%") >= 0 ? parseFloat(t) / 100 * e : parseFloat(t) : t
- }
- , mk = function(t, e, i) {
- var n = St(e);
- i = +i,
- isNaN(i) && (i = 1),
- n && (t.color = ck(n[0], n[1], n[2]),
- t.opacity = i * n[3])
- }
- , vk = function(t) {
- var e = St(t);
- return [ck(e[0], e[1], e[2]), e[3]]
- }
- , yk = function(t, e, i) {
- var n = e.fill;
- if (null != n)
- if (n instanceof bb) {
- var o, a = 0, r = [0, 0], s = 0, l = 1, h = i.getBoundingRect(), u = h.width, c = h.height;
- if ("linear" === n.type) {
- o = "gradient";
- var d = i.transform
- , f = [n.x * u, n.y * c]
- , g = [n.x2 * u, n.y2 * c];
- d && (Y(f, f, d),
- Y(g, g, d));
- var p = g[0] - f[0]
- , m = g[1] - f[1];
- (a = 180 * Math.atan2(p, m) / Math.PI) < 0 && (a += 360),
- a < 1e-6 && (a = 0)
- } else {
- o = "gradientradial";
- var f = [n.x * u, n.y * c]
- , d = i.transform
- , v = i.scale
- , y = u
- , x = c;
- r = [(f[0] - h.x) / y, (f[1] - h.y) / x],
- d && Y(f, f, d),
- y /= v[0] * sk,
- x /= v[1] * sk;
- var _ = rk(y, x);
- s = 0 / _,
- l = 2 * n.r / _ - s
- }
- var b = n.colorStops.slice();
- b.sort(function(t, e) {
- return t.offset - e.offset
- });
- for (var w = b.length, S = [], M = [], I = 0; I < w; I++) {
- var T = b[I]
- , A = vk(T.color);
- M.push(T.offset * l + s + " " + A[0]),
- 0 !== I && I !== w - 1 || S.push(A)
- }
- if (w >= 2) {
- var C = S[0][0]
- , D = S[1][0]
- , L = S[0][1] * e.opacity
- , k = S[1][1] * e.opacity;
- t.type = o,
- t.method = "none",
- t.focus = "100%",
- t.angle = a,
- t.color = C,
- t.color2 = D,
- t.colors = M.join(","),
- t.opacity = k,
- t.opacity2 = L
- }
- "radial" === o && (t.focusposition = r.join(","))
- } else
- mk(t, n, e.opacity)
- }
- , xk = function(t, e) {
- null != e.lineDash && (t.dashstyle = e.lineDash.join(" ")),
- null == e.stroke || e.stroke instanceof bb || mk(t, e.stroke, e.opacity)
- }
- , _k = function(t, e, i, n) {
- var o = "fill" == e
- , a = t.getElementsByTagName(e)[0];
- null != i[e] && "none" !== i[e] && (o || !o && i.lineWidth) ? (t[o ? "filled" : "stroked"] = "true",
- i[e]instanceof bb && fk(t, a),
- a || (a = $L(e)),
- o ? yk(a, i, n) : xk(a, i),
- dk(t, a)) : (t[o ? "filled" : "stroked"] = "false",
- fk(t, a))
- }
- , bk = [[], [], []]
- , wk = function(t, e) {
- var i, n, o, a, r, s, l = I_.M, h = I_.C, u = I_.L, c = I_.A, d = I_.Q, f = [], g = t.data, p = t.len();
- for (a = 0; a < p; ) {
- switch (o = g[a++],
- n = "",
- i = 0,
- o) {
- case l:
- n = " m ",
- i = 1,
- r = g[a++],
- s = g[a++],
- bk[0][0] = r,
- bk[0][1] = s;
- break;
- case u:
- n = " l ",
- i = 1,
- r = g[a++],
- s = g[a++],
- bk[0][0] = r,
- bk[0][1] = s;
- break;
- case d:
- case h:
- n = " c ",
- i = 3;
- var m, v, y = g[a++], x = g[a++], _ = g[a++], b = g[a++];
- o === d ? (m = _,
- v = b,
- _ = (_ + 2 * y) / 3,
- b = (b + 2 * x) / 3,
- y = (r + 2 * y) / 3,
- x = (s + 2 * x) / 3) : (m = g[a++],
- v = g[a++]),
- bk[0][0] = y,
- bk[0][1] = x,
- bk[1][0] = _,
- bk[1][1] = b,
- bk[2][0] = m,
- bk[2][1] = v,
- r = m,
- s = v;
- break;
- case c:
- var w = 0
- , S = 0
- , M = 1
- , I = 1
- , T = 0;
- e && (w = e[4],
- S = e[5],
- M = ik(e[0] * e[0] + e[1] * e[1]),
- I = ik(e[2] * e[2] + e[3] * e[3]),
- T = Math.atan2(-e[1] / I, e[0] / M));
- var A = g[a++]
- , C = g[a++]
- , D = g[a++]
- , L = g[a++]
- , k = g[a++] + T
- , P = g[a++] + k + T;
- a++;
- var O = g[a++]
- , z = A + ok(k) * D
- , N = C + ak(k) * L
- , y = A + ok(P) * D
- , x = C + ak(P) * L
- , E = O ? " wa " : " at ";
- Math.abs(z - y) < 1e-4 && (Math.abs(P - k) > .01 ? O && (z += .0125) : Math.abs(N - C) < 1e-4 ? O && z < A || !O && z > A ? x -= .0125 : x += .0125 : O && N < C || !O && N > C ? y += .0125 : y -= .0125),
- f.push(E, ek(((A - D) * M + w) * sk - lk), ",", ek(((C - L) * I + S) * sk - lk), ",", ek(((A + D) * M + w) * sk - lk), ",", ek(((C + L) * I + S) * sk - lk), ",", ek((z * M + w) * sk - lk), ",", ek((N * I + S) * sk - lk), ",", ek((y * M + w) * sk - lk), ",", ek((x * I + S) * sk - lk)),
- r = y,
- s = x;
- break;
- case I_.R:
- var R = bk[0]
- , V = bk[1];
- R[0] = g[a++],
- R[1] = g[a++],
- V[0] = R[0] + g[a++],
- V[1] = R[1] + g[a++],
- e && (Y(R, R, e),
- Y(V, V, e)),
- R[0] = ek(R[0] * sk - lk),
- V[0] = ek(V[0] * sk - lk),
- R[1] = ek(R[1] * sk - lk),
- V[1] = ek(V[1] * sk - lk),
- f.push(" m ", R[0], ",", R[1], " l ", V[0], ",", R[1], " l ", V[0], ",", V[1], " l ", R[0], ",", V[1]);
- break;
- case I_.Z:
- f.push(" x ")
- }
- if (i > 0) {
- f.push(n);
- for (var B = 0; B < i; B++) {
- var G = bk[B];
- e && Y(G, G, e),
- f.push(ek(G[0] * sk - lk), ",", ek(G[1] * sk - lk), B < i - 1 ? "," : "")
- }
- }
- }
- return f.join("")
- };
- On.prototype.brushVML = function(t) {
- var e = this.style
- , i = this._vmlEl;
- i || (i = $L("shape"),
- hk(i),
- this._vmlEl = i),
- _k(i, "fill", e, this),
- _k(i, "stroke", e, this);
- var n = this.transform
- , o = null != n
- , a = i.getElementsByTagName("stroke")[0];
- if (a) {
- var r = e.lineWidth;
- if (o && !e.strokeNoScale) {
- var s = n[0] * n[3] - n[1] * n[2];
- r *= ik(nk(s))
- }
- a.weight = r + "px"
- }
- var l = this.path || (this.path = new R_);
- this.__dirtyPath && (l.beginPath(),
- this.buildPath(l, this.shape),
- l.toStatic(),
- this.__dirtyPath = !1),
- i.path = wk(l, this.transform),
- i.style.zIndex = gk(this.zlevel, this.z, this.z2),
- dk(t, i),
- null != e.text ? this.drawRectText(t, this.getBoundingRect()) : this.removeRectText(t)
- }
- ,
- On.prototype.onRemove = function(t) {
- fk(t, this._vmlEl),
- this.removeRectText(t)
- }
- ,
- On.prototype.onAdd = function(t) {
- dk(t, this._vmlEl),
- this.appendRectText(t)
- }
- ;
- var Sk = function(t) {
- return "object" == typeof t && t.tagName && "IMG" === t.tagName.toUpperCase()
- };
- je.prototype.brushVML = function(t) {
- var e, i, n = this.style, o = n.image;
- if (Sk(o)) {
- var a = o.src;
- if (a === this._imageSrc)
- e = this._imageWidth,
- i = this._imageHeight;
- else {
- var r = o.runtimeStyle
- , s = r.width
- , l = r.height;
- r.width = "auto",
- r.height = "auto",
- e = o.width,
- i = o.height,
- r.width = s,
- r.height = l,
- this._imageSrc = a,
- this._imageWidth = e,
- this._imageHeight = i
- }
- o = a
- } else
- o === this._imageSrc && (e = this._imageWidth,
- i = this._imageHeight);
- if (o) {
- var h = n.x || 0
- , u = n.y || 0
- , c = n.width
- , d = n.height
- , f = n.sWidth
- , g = n.sHeight
- , p = n.sx || 0
- , m = n.sy || 0
- , v = f && g
- , y = this._vmlEl;
- y || (y = tk.createElement("div"),
- hk(y),
- this._vmlEl = y);
- var x, _ = y.style, b = !1, w = 1, S = 1;
- if (this.transform && (x = this.transform,
- w = ik(x[0] * x[0] + x[1] * x[1]),
- S = ik(x[2] * x[2] + x[3] * x[3]),
- b = x[1] || x[2]),
- b) {
- var M = [h, u]
- , I = [h + c, u]
- , T = [h, u + d]
- , A = [h + c, u + d];
- Y(M, M, x),
- Y(I, I, x),
- Y(T, T, x),
- Y(A, A, x);
- var C = rk(M[0], I[0], T[0], A[0])
- , D = rk(M[1], I[1], T[1], A[1])
- , L = [];
- L.push("M11=", x[0] / w, ",", "M12=", x[2] / S, ",", "M21=", x[1] / w, ",", "M22=", x[3] / S, ",", "Dx=", ek(h * w + x[4]), ",", "Dy=", ek(u * S + x[5])),
- _.padding = "0 " + ek(C) + "px " + ek(D) + "px 0",
- _.filter = "progid:DXImageTransform.Microsoft.Matrix(" + L.join("") + ", SizingMethod=clip)"
- } else
- x && (h = h * w + x[4],
- u = u * S + x[5]),
- _.filter = "",
- _.left = ek(h) + "px",
- _.top = ek(u) + "px";
- var k = this._imageEl
- , P = this._cropEl;
- k || (k = tk.createElement("div"),
- this._imageEl = k);
- var O = k.style;
- if (v) {
- if (e && i)
- O.width = ek(w * e * c / f) + "px",
- O.height = ek(S * i * d / g) + "px";
- else {
- var z = new Image
- , N = this;
- z.onload = function() {
- z.onload = null,
- e = z.width,
- i = z.height,
- O.width = ek(w * e * c / f) + "px",
- O.height = ek(S * i * d / g) + "px",
- N._imageWidth = e,
- N._imageHeight = i,
- N._imageSrc = o
- }
- ,
- z.src = o
- }
- P || ((P = tk.createElement("div")).style.overflow = "hidden",
- this._cropEl = P);
- var E = P.style;
- E.width = ek((c + p * c / f) * w),
- E.height = ek((d + m * d / g) * S),
- E.filter = "progid:DXImageTransform.Microsoft.Matrix(Dx=" + -p * c / f * w + ",Dy=" + -m * d / g * S + ")",
- P.parentNode || y.appendChild(P),
- k.parentNode != P && P.appendChild(k)
- } else
- O.width = ek(w * c) + "px",
- O.height = ek(S * d) + "px",
- y.appendChild(k),
- P && P.parentNode && (y.removeChild(P),
- this._cropEl = null);
- var R = ""
- , V = n.opacity;
- V < 1 && (R += ".Alpha(opacity=" + ek(100 * V) + ") "),
- R += "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + o + ", SizingMethod=scale)",
- O.filter = R,
- y.style.zIndex = gk(this.zlevel, this.z, this.z2),
- dk(t, y),
- null != n.text && this.drawRectText(t, this.getBoundingRect())
- }
- }
- ,
- je.prototype.onRemove = function(t) {
- fk(t, this._vmlEl),
- this._vmlEl = null,
- this._cropEl = null,
- this._imageEl = null,
- this.removeRectText(t)
- }
- ,
- je.prototype.onAdd = function(t) {
- dk(t, this._vmlEl),
- this.appendRectText(t)
- }
- ;
- var Mk, Ik = {}, Tk = 0, Ak = document.createElement("div"), Ck = function(t) {
- var e = Ik[t];
- if (!e) {
- Tk > 100 && (Tk = 0,
- Ik = {});
- var i, n = Ak.style;
- try {
- n.font = t,
- i = n.fontFamily.split(",")[0]
- } catch (t) {}
- e = {
- style: n.fontStyle || "normal",
- variant: n.fontVariant || "normal",
- weight: n.fontWeight || "normal",
- size: 0 | parseFloat(n.fontSize || 12),
- family: i || "Microsoft YaHei"
- },
- Ik[t] = e,
- Tk++
- }
- return e
- };
- px.measureText(function(t, e) {
- var i = tk;
- Mk || ((Mk = i.createElement("div")).style.cssText = "position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",
- tk.body.appendChild(Mk));
- try {
- Mk.style.font = e
- } catch (t) {}
- return Mk.innerHTML = "",
- Mk.appendChild(i.createTextNode(t)),
- {
- width: Mk.offsetWidth
- }
- });
- for (var Dk = new jt, Lk = [xx, Ue, je, On, ab], kk = 0; kk < Lk.length; kk++) {
- var Pk = Lk[kk].prototype;
- Pk.drawRectText = function(t, e, i, n) {
- var o = this.style;
- this.__dirty && Ae(o);
- var a = o.text;
- if (null != a && (a += ""),
- a) {
- if (o.rich) {
- var r = Se(a, o);
- a = [];
- for (var s = 0; s < r.lines.length; s++) {
- for (var l = r.lines[s].tokens, h = [], u = 0; u < l.length; u++)
- h.push(l[u].text);
- a.push(h.join(""))
- }
- a = a.join("\n")
- }
- var c, d, f = o.textAlign, g = o.textVerticalAlign, p = Ck(o.font), m = p.style + " " + p.variant + " " + p.weight + " " + p.size + 'px "' + p.family + '"';
- i = i || ce(a, m, f, g);
- var v = this.transform;
- if (v && !n && (Dk.copy(e),
- Dk.applyTransform(v),
- e = Dk),
- n)
- c = e.x,
- d = e.y;
- else {
- var y = o.textPosition
- , x = o.textDistance;
- if (y instanceof Array)
- c = e.x + pk(y[0], e.width),
- d = e.y + pk(y[1], e.height),
- f = f || "left";
- else {
- var _ = me(y, e, x);
- c = _.x,
- d = _.y,
- f = f || _.textAlign,
- g = g || _.textVerticalAlign
- }
- }
- c = ge(c, i.width, f),
- d = pe(d, i.height, g),
- d += i.height / 2;
- var b, w, S, M = $L, I = this._textVmlEl;
- I ? w = (b = (S = I.firstChild).nextSibling).nextSibling : (I = M("line"),
- b = M("path"),
- w = M("textpath"),
- S = M("skew"),
- w.style["v-text-align"] = "left",
- hk(I),
- b.textpathok = !0,
- w.on = !0,
- I.from = "0 0",
- I.to = "1000 0.05",
- dk(I, S),
- dk(I, b),
- dk(I, w),
- this._textVmlEl = I);
- var T = [c, d]
- , A = I.style;
- v && n ? (Y(T, T, v),
- S.on = !0,
- S.matrix = v[0].toFixed(3) + "," + v[2].toFixed(3) + "," + v[1].toFixed(3) + "," + v[3].toFixed(3) + ",0,0",
- S.offset = (ek(T[0]) || 0) + "," + (ek(T[1]) || 0),
- S.origin = "0 0",
- A.left = "0px",
- A.top = "0px") : (S.on = !1,
- A.left = ek(c) + "px",
- A.top = ek(d) + "px"),
- w.string = uk(a);
- try {
- w.style.font = m
- } catch (t) {}
- _k(I, "fill", {
- fill: o.textFill,
- opacity: o.opacity
- }, this),
- _k(I, "stroke", {
- stroke: o.textStroke,
- opacity: o.opacity,
- lineDash: o.lineDash
- }, this),
- I.style.zIndex = gk(this.zlevel, this.z, this.z2),
- dk(t, I)
- }
- }
- ,
- Pk.removeRectText = function(t) {
- fk(t, this._textVmlEl),
- this._textVmlEl = null
- }
- ,
- Pk.appendRectText = function(t) {
- dk(t, this._textVmlEl)
- }
- }
- ab.prototype.brushVML = function(t) {
- var e = this.style;
- null != e.text ? this.drawRectText(t, {
- x: e.x || 0,
- y: e.y || 0,
- width: 0,
- height: 0
- }, this.getBoundingRect(), !0) : this.removeRectText(t)
- }
- ,
- ab.prototype.onRemove = function(t) {
- this.removeRectText(t)
- }
- ,
- ab.prototype.onAdd = function(t) {
- this.appendRectText(t)
- }
- }
- vv.prototype = {
- constructor: vv,
- getType: function() {
- return "vml"
- },
- getViewportRoot: function() {
- return this._vmlViewport
- },
- getViewportRootOffset: function() {
- var t = this.getViewportRoot();
- if (t)
- return {
- offsetLeft: t.offsetLeft || 0,
- offsetTop: t.offsetTop || 0
- }
- },
- refresh: function() {
- var t = this.storage.getDisplayList(!0, !0);
- this._paintList(t)
- },
- _paintList: function(t) {
- for (var e = this._vmlRoot, i = 0; i < t.length; i++) {
- var n = t[i];
- n.invisible || n.ignore ? (n.__alreadyNotVisible || n.onRemove(e),
- n.__alreadyNotVisible = !0) : (n.__alreadyNotVisible && n.onAdd(e),
- n.__alreadyNotVisible = !1,
- n.__dirty && (n.beforeBrush && n.beforeBrush(),
- (n.brushVML || n.brush).call(n, e),
- n.afterBrush && n.afterBrush())),
- n.__dirty = !1
- }
- this._firstPaint && (this._vmlViewport.appendChild(e),
- this._firstPaint = !1)
- },
- resize: function(t, e) {
- var t = null == t ? this._getWidth() : t
- , e = null == e ? this._getHeight() : e;
- if (this._width != t || this._height != e) {
- this._width = t,
- this._height = e;
- var i = this._vmlViewport.style;
- i.width = t + "px",
- i.height = e + "px"
- }
- },
- dispose: function() {
- this.root.innerHTML = "",
- this._vmlRoot = this._vmlViewport = this.storage = null
- },
- getWidth: function() {
- return this._width
- },
- getHeight: function() {
- return this._height
- },
- clear: function() {
- this._vmlViewport && this.root.removeChild(this._vmlViewport)
- },
- _getWidth: function() {
- var t = this.root
- , e = t.currentStyle;
- return (t.clientWidth || mv(e.width)) - mv(e.paddingLeft) - mv(e.paddingRight) | 0
- },
- _getHeight: function() {
- var t = this.root
- , e = t.currentStyle;
- return (t.clientHeight || mv(e.height)) - mv(e.paddingTop) - mv(e.paddingBottom) | 0
- }
- },
- c(["getLayer", "insertLayer", "eachLayer", "eachBuiltinLayer", "eachOtherLayer", "getLayers", "modLayer", "delLayer", "clearLayer", "toDataURL", "pathToImage"], function(t) {
- vv.prototype[t] = yv(t)
- }),
- vi("vml", vv);
- var Ok = "http://www.w3.org/2000/svg"
- , zk = Array.prototype.join
- , Nk = "none"
- , Ek = Math.round
- , Rk = Math.sin
- , Vk = Math.cos
- , Bk = Math.PI
- , Gk = 2 * Math.PI
- , Wk = 180 / Bk
- , Hk = 1e-4
- , Fk = {};
- Fk.brush = function(t) {
- var e = t.style
- , i = t.__svgEl;
- i || (i = xv("path"),
- t.__svgEl = i),
- t.path || t.createPathProxy();
- var n = t.path;
- t.__dirtyPath && (n.beginPath(),
- t.buildPath(n, t.shape),
- t.__dirtyPath = !1,
- Iv(i, "d", Cv(n))),
- Av(i, e),
- Mv(i, t.transform),
- null != e.text && Xk(t, t.getBoundingRect())
- }
- ;
- var Zk = {};
- Zk.brush = function(t) {
- var e = t.style
- , i = e.image;
- if (i instanceof HTMLImageElement && (i = i.src),
- i) {
- var n = e.x || 0
- , o = e.y || 0
- , a = e.width
- , r = e.height
- , s = t.__svgEl;
- s || (s = xv("image"),
- t.__svgEl = s),
- i !== t.__imageSrc && (Tv(s, "href", i),
- t.__imageSrc = i),
- Iv(s, "width", a),
- Iv(s, "height", r),
- Iv(s, "x", n),
- Iv(s, "y", o),
- Mv(s, t.transform),
- null != e.text && Xk(t, t.getBoundingRect())
- }
- }
- ;
- var Uk = {}
- , jk = new jt
- , Xk = function(t, e, i) {
- var n = t.style;
- t.__dirty && Ae(n);
- var o = n.text;
- if (null != o && (o += ""),
- o) {
- var a = t.__textSvgEl;
- if (a || (a = xv("text"),
- t.__textSvgEl = a),
- Av(a, n, !0),
- t instanceof ab || t.style.transformText)
- Mv(a, t.transform);
- else if (t.transform)
- jk.copy(e),
- jk.applyTransform(t.transform),
- e = jk;
- else {
- var r = t.transformCoordToGlobal(e.x, e.y);
- e.x = r[0],
- e.y = r[1]
- }
- var s, l, h = n.textPosition, u = n.textDistance, c = n.textAlign || "left";
- "number" == typeof n.fontSize && (n.fontSize += "px");
- var d = n.font || [n.fontStyle || "", n.fontWeight || "", n.fontSize || "", n.fontFamily || ""].join(" ") || fx
- , f = Dv(n.textVerticalAlign)
- , g = (i = ce(o, d, c, f)).lineHeight;
- if (h instanceof Array)
- s = e.x + h[0],
- l = e.y + h[1];
- else {
- var p = me(h, e, u);
- s = p.x,
- l = p.y,
- f = Dv(p.textVerticalAlign),
- c = p.textAlign
- }
- Iv(a, "alignment-baseline", f),
- d && (a.style.font = d);
- var m = n.textPadding;
- Iv(a, "x", s),
- Iv(a, "y", l);
- var v = o.split("\n")
- , y = v.length
- , x = c;
- "left" === x ? (x = "start",
- m && (s += m[3])) : "right" === x ? (x = "end",
- m && (s -= m[1])) : "center" === x && (x = "middle",
- m && (s += (m[3] - m[1]) / 2));
- var _ = 0;
- if ("baseline" === f ? (_ = -i.height + g,
- m && (_ -= m[2])) : "middle" === f ? (_ = (-i.height + g) / 2,
- m && (l += (m[0] - m[2]) / 2)) : m && (_ += m[0]),
- t.__text !== o || t.__textFont !== d) {
- var b = t.__tspanList || [];
- t.__tspanList = b;
- for (S = 0; S < y; S++)
- (M = b[S]) ? M.innerHTML = "" : (M = b[S] = xv("tspan"),
- a.appendChild(M),
- Iv(M, "alignment-baseline", f),
- Iv(M, "text-anchor", x)),
- Iv(M, "x", s),
- Iv(M, "y", l + S * g + _),
- M.appendChild(document.createTextNode(v[S]));
- for (; S < b.length; S++)
- a.removeChild(b[S]);
- b.length = y,
- t.__text = o,
- t.__textFont = d
- } else if (t.__tspanList.length)
- for (var w = t.__tspanList.length, S = 0; S < w; ++S) {
- var M = t.__tspanList[S];
- M && (Iv(M, "x", s),
- Iv(M, "y", l + S * g + _))
- }
- }
- };
- Uk.drawRectText = Xk,
- Uk.brush = function(t) {
- var e = t.style;
- null != e.text && (e.textPosition = [0, 0],
- Xk(t, {
- x: e.x || 0,
- y: e.y || 0,
- width: 0,
- height: 0
- }, t.getBoundingRect()))
- }
- ,
- Lv.prototype = {
- diff: function(t, e, i) {
- i || (i = function(t, e) {
- return t === e
- }
- ),
- this.equals = i;
- var n = this;
- t = t.slice();
- var o = (e = e.slice()).length
- , a = t.length
- , r = 1
- , s = o + a
- , l = [{
- newPos: -1,
- components: []
- }]
- , h = this.extractCommon(l[0], e, t, 0);
- if (l[0].newPos + 1 >= o && h + 1 >= a) {
- for (var u = [], c = 0; c < e.length; c++)
- u.push(c);
- return [{
- indices: u,
- count: e.length
- }]
- }
- for (; r <= s; ) {
- var d = function() {
- for (var i = -1 * r; i <= r; i += 2) {
- var s, h = l[i - 1], u = l[i + 1], c = (u ? u.newPos : 0) - i;
- h && (l[i - 1] = void 0);
- var d = h && h.newPos + 1 < o
- , f = u && 0 <= c && c < a;
- if (d || f) {
- if (!d || f && h.newPos < u.newPos ? (s = Pv(u),
- n.pushComponent(s.components, void 0, !0)) : ((s = h).newPos++,
- n.pushComponent(s.components, !0, void 0)),
- c = n.extractCommon(s, e, t, i),
- s.newPos + 1 >= o && c + 1 >= a)
- return kv(0, s.components);
- l[i] = s
- } else
- l[i] = void 0
- }
- r++
- }();
- if (d)
- return d
- }
- },
- pushComponent: function(t, e, i) {
- var n = t[t.length - 1];
- n && n.added === e && n.removed === i ? t[t.length - 1] = {
- count: n.count + 1,
- added: e,
- removed: i
- } : t.push({
- count: 1,
- added: e,
- removed: i
- })
- },
- extractCommon: function(t, e, i, n) {
- 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]); )
- r++,
- s++,
- l++;
- return l && t.components.push({
- count: l
- }),
- t.newPos = r,
- s
- },
- tokenize: function(t) {
- return t.slice()
- },
- join: function(t) {
- return t.slice()
- }
- };
- var qk = new Lv
- , Yk = function(t, e, i) {
- return qk.diff(t, e, i)
- };
- Ov.prototype.createElement = xv,
- Ov.prototype.getDefs = function(t) {
- var e = this._svgRoot
- , i = this._svgRoot.getElementsByTagName("defs");
- return 0 === i.length ? t ? ((i = e.insertBefore(this.createElement("defs"), e.firstChild)).contains || (i.contains = function(t) {
- var e = i.children;
- if (!e)
- return !1;
- for (var n = e.length - 1; n >= 0; --n)
- if (e[n] === t)
- return !0;
- return !1
- }
- ),
- i) : null : i[0]
- }
- ,
- Ov.prototype.update = function(t, e) {
- if (t) {
- var i = this.getDefs(!1);
- if (t._dom && i.contains(t._dom))
- "function" == typeof e && e();
- else {
- var n = this.add(t);
- n && (t._dom = n)
- }
- }
- }
- ,
- Ov.prototype.addDom = function(t) {
- this.getDefs(!0).appendChild(t)
- }
- ,
- Ov.prototype.removeDom = function(t) {
- this.getDefs(!1).removeChild(t._dom)
- }
- ,
- Ov.prototype.getDoms = function() {
- var t = this.getDefs(!1);
- if (!t)
- return [];
- var e = [];
- return c(this._tagNames, function(i) {
- var n = t.getElementsByTagName(i);
- e = e.concat([].slice.call(n))
- }),
- e
- }
- ,
- Ov.prototype.markAllUnused = function() {
- var t = this;
- c(this.getDoms(), function(e) {
- e[t._markLabel] = "0"
- })
- }
- ,
- Ov.prototype.markUsed = function(t) {
- t && (t[this._markLabel] = "1")
- }
- ,
- Ov.prototype.removeUnused = function() {
- var t = this.getDefs(!1);
- if (t) {
- var e = this;
- c(this.getDoms(), function(i) {
- "1" !== i[e._markLabel] && t.removeChild(i)
- })
- }
- }
- ,
- Ov.prototype.getSvgProxy = function(t) {
- return t instanceof On ? Fk : t instanceof je ? Zk : t instanceof ab ? Uk : Fk
- }
- ,
- Ov.prototype.getTextSvgElement = function(t) {
- return t.__textSvgEl
- }
- ,
- Ov.prototype.getSvgElement = function(t) {
- return t.__svgEl
- }
- ,
- l(zv, Ov),
- zv.prototype.addWithoutUpdate = function(t, e) {
- if (e && e.style) {
- var i = this;
- c(["fill", "stroke"], function(n) {
- if (e.style[n] && ("linear" === e.style[n].type || "radial" === e.style[n].type)) {
- var o, a = e.style[n], r = i.getDefs(!0);
- a._dom ? (o = a._dom,
- r.contains(a._dom) || i.addDom(o)) : o = i.add(a),
- i.markUsed(e);
- var s = o.getAttribute("id");
- t.setAttribute(n, "url(#" + s + ")")
- }
- })
- }
- }
- ,
- zv.prototype.add = function(t) {
- var e;
- if ("linear" === t.type)
- e = this.createElement("linearGradient");
- else {
- if ("radial" !== t.type)
- return Zy("Illegal gradient type."),
- null;
- e = this.createElement("radialGradient")
- }
- return t.id = t.id || this.nextId++,
- e.setAttribute("id", "zr-gradient-" + t.id),
- this.updateDom(t, e),
- this.addDom(e),
- e
- }
- ,
- zv.prototype.update = function(t) {
- var e = this;
- Ov.prototype.update.call(this, t, function() {
- var i = t.type
- , n = t._dom.tagName;
- "linear" === i && "linearGradient" === n || "radial" === i && "radialGradient" === n ? e.updateDom(t, t._dom) : (e.removeDom(t),
- e.add(t))
- })
- }
- ,
- zv.prototype.updateDom = function(t, e) {
- if ("linear" === t.type)
- e.setAttribute("x1", t.x),
- e.setAttribute("y1", t.y),
- e.setAttribute("x2", t.x2),
- e.setAttribute("y2", t.y2);
- else {
- if ("radial" !== t.type)
- return void Zy("Illegal gradient type.");
- e.setAttribute("cx", t.x),
- e.setAttribute("cy", t.y),
- e.setAttribute("r", t.r)
- }
- t.global ? e.setAttribute("gradientUnits", "userSpaceOnUse") : e.setAttribute("gradientUnits", "objectBoundingBox"),
- e.innerHTML = "";
- for (var i = t.colorStops, n = 0, o = i.length; n < o; ++n) {
- var a = this.createElement("stop");
- a.setAttribute("offset", 100 * i[n].offset + "%"),
- a.setAttribute("stop-color", i[n].color),
- e.appendChild(a)
- }
- t._dom = e
- }
- ,
- zv.prototype.markUsed = function(t) {
- if (t.style) {
- var e = t.style.fill;
- e && e._dom && Ov.prototype.markUsed.call(this, e._dom),
- (e = t.style.stroke) && e._dom && Ov.prototype.markUsed.call(this, e._dom)
- }
- }
- ,
- l(Nv, Ov),
- Nv.prototype.update = function(t, e) {
- this.updateDom(e, t.__clipPaths, !1);
- var i = this.getTextSvgElement(t);
- i && this.updateDom(i, t.__clipPaths, !0),
- this.markUsed(t)
- }
- ,
- Nv.prototype.updateDom = function(t, e, i) {
- if (e && e.length > 0) {
- var n, o, a = this.getDefs(!0), r = e[0], s = i ? "_textDom" : "_dom";
- r[s] ? (o = r[s].getAttribute("id"),
- n = r[s],
- a.contains(n) || a.appendChild(n)) : (o = "zr-clip-" + this.nextId,
- ++this.nextId,
- (n = this.createElement("clipPath")).setAttribute("id", o),
- a.appendChild(n),
- r[s] = n);
- var l = this.getSvgProxy(r);
- if (r.transform && r.parent.invTransform && !i) {
- var h = Array.prototype.slice.call(r.transform);
- rt(r.transform, r.parent.invTransform, r.transform),
- l.brush(r),
- r.transform = h
- } else
- l.brush(r);
- var u = this.getSvgElement(r);
- n.appendChild(u),
- t.setAttribute("clip-path", "url(#" + o + ")"),
- e.length > 1 && this.updateDom(n, e.slice(1), i)
- } else
- t && t.setAttribute("clip-path", "none")
- }
- ,
- Nv.prototype.markUsed = function(t) {
- var e = this;
- t.__clipPaths && t.__clipPaths.length > 0 && c(t.__clipPaths, function(t) {
- t._dom && Ov.prototype.markUsed.call(e, t._dom),
- t._textDom && Ov.prototype.markUsed.call(e, t._textDom)
- })
- }
- ;
- var $k = function(t, e) {
- this.root = t,
- this.storage = e;
- var i = xv("svg");
- i.setAttribute("xmlns", "http://www.w3.org/2000/svg"),
- i.setAttribute("version", "1.1"),
- i.setAttribute("baseProfile", "full"),
- i.style["user-select"] = "none",
- this.gradientManager = new zv(i),
- this.clipPathManager = new Nv(i);
- var n = document.createElement("div");
- n.style.cssText = "overflow: hidden;",
- this._svgRoot = i,
- this._viewport = n,
- t.appendChild(n),
- n.appendChild(i),
- this.resize(),
- this._visibleList = []
- };
- $k.prototype = {
- constructor: $k,
- getType: function() {
- return "svg"
- },
- getViewportRoot: function() {
- return this._viewport
- },
- getViewportRootOffset: function() {
- var t = this.getViewportRoot();
- if (t)
- return {
- offsetLeft: t.offsetLeft || 0,
- offsetTop: t.offsetTop || 0
- }
- },
- refresh: function() {
- var t = this.storage.getDisplayList(!0);
- this._paintList(t)
- },
- _paintList: function(t) {
- this.gradientManager.markAllUnused(),
- this.clipPathManager.markAllUnused();
- var e, i = this._svgRoot, n = this._visibleList, o = t.length, a = [];
- for (e = 0; e < o; e++) {
- var r = Rv(g = t[e]);
- if (!g.invisible) {
- if (g.__dirty) {
- r && r.brush(g);
- var s = Fv(g) || Hv(g);
- this.clipPathManager.update(g, s),
- g.style && (this.gradientManager.update(g.style.fill),
- this.gradientManager.update(g.style.stroke)),
- g.__dirty = !1
- }
- a.push(g)
- }
- }
- var l, h = Yk(n, a);
- for (e = 0; e < h.length; e++)
- if ((d = h[e]).removed)
- for (f = 0; f < d.count; f++) {
- var u = Fv(g = n[d.indices[f]])
- , c = Hv(g);
- Wv(i, u),
- Wv(i, c)
- }
- for (e = 0; e < h.length; e++) {
- var d = h[e];
- if (d.added)
- for (f = 0; f < d.count; f++) {
- var u = Fv(g = a[d.indices[f]])
- , c = Hv(g);
- l ? Bv(i, u, l) : Gv(i, u),
- u ? Bv(i, c, u) : l ? Bv(i, c, l) : Gv(i, c),
- Bv(i, c, u),
- l = c || u || l,
- this.gradientManager.addWithoutUpdate(u, g),
- this.clipPathManager.markUsed(g)
- }
- else if (!d.removed)
- for (var f = 0; f < d.count; f++) {
- var g = a[d.indices[f]];
- l = u = Hv(g) || Fv(g) || l,
- this.gradientManager.markUsed(g),
- this.gradientManager.addWithoutUpdate(u, g),
- this.clipPathManager.markUsed(g)
- }
- }
- this.gradientManager.removeUnused(),
- this.clipPathManager.removeUnused(),
- this._visibleList = a
- },
- _getDefs: function(t) {
- var e = this._svgRoot
- , i = this._svgRoot.getElementsByTagName("defs");
- return 0 === i.length ? t ? ((i = e.insertBefore(xv("defs"), e.firstChild)).contains || (i.contains = function(t) {
- var e = i.children;
- if (!e)
- return !1;
- for (var n = e.length - 1; n >= 0; --n)
- if (e[n] === t)
- return !0;
- return !1
- }
- ),
- i) : null : i[0]
- },
- resize: function() {
- var t = this._getWidth()
- , e = this._getHeight();
- if (this._width !== t && this._height !== e) {
- this._width = t,
- this._height = e;
- var i = this._viewport.style;
- i.width = t + "px",
- i.height = e + "px";
- var n = this._svgRoot;
- n.setAttribute("width", t),
- n.setAttribute("height", e)
- }
- },
- getWidth: function() {
- return this._getWidth()
- },
- getHeight: function() {
- return this._getHeight()
- },
- _getWidth: function() {
- var t = this.root
- , e = document.defaultView.getComputedStyle(t);
- return (t.clientWidth || Ev(e.width)) - Ev(e.paddingLeft) - Ev(e.paddingRight) | 0
- },
- _getHeight: function() {
- var t = this.root
- , e = document.defaultView.getComputedStyle(t);
- return (t.clientHeight || Ev(e.height)) - Ev(e.paddingTop) - Ev(e.paddingBottom) | 0
- },
- dispose: function() {
- this.root.innerHTML = "",
- this._svgRoot = this._viewport = this.storage = null
- },
- clear: function() {
- this._viewport && this.root.removeChild(this._viewport)
- },
- pathToSvg: function() {
- this.refresh();
- var t = this._svgRoot.outerHTML;
- return "data:img/svg+xml;utf-8," + unescape(t)
- }
- },
- c(["getLayer", "insertLayer", "eachLayer", "eachBuiltinLayer", "eachOtherLayer", "getLayers", "modLayer", "delLayer", "clearLayer", "toDataURL", "pathToImage"], function(t) {
- $k.prototype[t] = Zv(t)
- }),
- vi("svg", $k),
- t.dataTool = QS,
- t.version = kw,
- t.dependencies = Pw,
- t.PRIORITY = Ew,
- t.init = function(t, e, i) {
- var n = Ja(t);
- if (n)
- return n;
- var o = new Oa(t,e,i);
- return o.id = "ec_" + Qw++,
- Kw[o.id] = o,
- t.setAttribute ? t.setAttribute(eS, o.id) : t[eS] = o.id,
- $a(o),
- o
- }
- ,
- t.connect = function(t) {
- if (v(t)) {
- var e = t;
- t = null,
- c(e, function(e) {
- null != e.group && (t = e.group)
- }),
- t = t || "g_" + tS++,
- c(e, function(e) {
- e.group = t
- })
- }
- return Jw[t] = !0,
- t
- }
- ,
- t.disConnect = Ka,
- t.disconnect = iS,
- t.dispose = function(t) {
- "string" == typeof t ? t = Kw[t] : t instanceof Oa || (t = Ja(t)),
- t instanceof Oa && !t.isDisposed() && t.dispose()
- }
- ,
- t.getInstanceByDom = Ja,
- t.getInstanceById = function(t) {
- return Kw[t]
- }
- ,
- t.registerTheme = function(t, e) {
- Yw[t] = e
- }
- ,
- t.registerPreprocessor = Qa,
- t.registerProcessor = tr,
- t.registerPostUpdate = function(t) {
- Xw.push(t)
- }
- ,
- t.registerAction = er,
- t.registerCoordinateSystem = ir,
- t.getCoordinateSystemDimensions = function(t) {
- var e = ha.get(t);
- if (e)
- return e.getDimensionsInfo ? e.getDimensionsInfo() : e.dimensions.slice()
- }
- ,
- t.registerLayout = nr,
- t.registerVisual = or,
- t.registerLoading = ar,
- t.extendComponentModel = rr,
- t.extendComponentView = sr,
- t.extendSeriesModel = lr,
- t.extendChartView = hr,
- t.setCanvasCreator = function(t) {
- sy.createCanvas(t)
- }
- ,
- t.$inject = nS,
- t.zrender = Gx,
- t.graphic = Db,
- t.number = Zx,
- t.format = Kx,
- t.throttle = Ca,
- t.helper = jS,
- t.matrix = by,
- t.vector = gy,
- t.color = Vy,
- t.util = $S,
- t.List = lS,
- t.Model = Co,
- t.Axis = YS,
- t.env = Yv
- });
|