| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135 |
- import{i as t,r as e,m as n,a as i,b as o,c as r,e as a,d as s,f as l,g as u,h as c,j as d,k as h,l as p,n as f,P as g,o as y,p as m,q as v,s as x,t as _,Z as b,u as S,v as w,w as M,x as I,y as D,z as T,A as C,B as A,T as L,C as k,D as P,E as N,F as O,G as R,S as E,R as V,H as z,I as B,J as G,L as F,K as W,M as H,N as Y,O as U,Q as Z,U as X,V as j,W as q,X as K,Y as J,_ as $,$ as Q,a0 as tt,a1 as et,a2 as nt,a3 as it,a4 as ot,a5 as rt,a6 as at,a7 as st,a8 as lt,a9 as ut,aa as ct,ab as dt,ac as ht,ad as pt,ae as ft,af as gt,ag as yt,ah as mt,ai as vt,aj as xt,ak as _t,al as bt,am as St,an as wt,ao as Mt,ap as It,aq as Dt,ar as Tt,as as Ct,at as At,au as Lt,av as kt,aw as Pt,ax as Nt,ay as Ot,az as Rt,aA as Et,aB as Vt,aC as zt,aD as Bt,aE as Gt,aF as Ft,aG as Wt,aH as Ht,aI as Yt,aJ as Ut,aK as Zt,aL as Xt,aM as jt,aN as qt,aO as Kt,aP as Jt,aQ as $t,aR as Qt,aS as te,aT as ee,aU as ne,aV as ie,aW as oe,aX as re,aY as ae,aZ as se,a_ as le,a$ as ue,b0 as ce,b1 as de,b2 as he,b3 as pe,b4 as fe,b5 as ge,b6 as ye,b7 as me,b8 as ve,b9 as xe,ba as _e,bb as be,bc as Se,bd as we,be as Me,bf as Ie,bg as De,bh as Te,bi as Ce,bj as Ae,bk as Le,bl as ke,bm as Pe,bn as Ne,bo as Oe,bp as Re,bq as Ee,br as Ve,bs as ze,bt as Be,bu as Ge,bv as Fe,bw as We,bx as He}from"./zrender-ee9f2f6d.js";
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */
- /* global Reflect, Promise */var Ye=function(t,e){return Ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Ye(t,e)};function Ue(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ye(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Ze=1e-4;
- // Although chrome already enlarge this number to 100 for `toFixed`, but
- // we sill follow the spec for compatibility.
- /**
- * Linear mapping a value from domain to range
- * @param val
- * @param domain Domain extent domain[0] can be bigger than domain[1]
- * @param range Range extent range[0] can be bigger than range[1]
- * @param clamp Default to be false
- */
- function Xe(t,e,n,i){var o=e[0],r=e[1],a=n[0],s=n[1],l=r-o,u=s-a;if(0===l)return 0===u?a:(a+s)/2;
- // Avoid accuracy problem in edge, such as
- // 146.39 - 62.83 === 83.55999999999999.
- // See echarts/test/ut/spec/util/number.js#linearMap#accuracyError
- // It is a little verbose for efficiency considering this method
- // is a hotspot.
- if(i)if(l>0){if(t<=o)return a;if(t>=r)return s}else{if(t>=o)return a;if(t<=r)return s}else{if(t===o)return a;if(t===r)return s}return(t-o)/l*u+a}
- /**
- * Convert a percent string to absolute number.
- * Returns NaN if percent is not a valid string or number
- */function je(e,n){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return t(e)?(i=e,i.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(e)/100*n:parseFloat(e):null==e?NaN:+e;var i}function qe(t,e,n){return null==e&&(e=10),
- // Avoid range error
- e=Math.min(Math.max(0,e),20),
- // PENDING: 1.005.toFixed(2) is '1.00' rather than '1.01'
- t=(+t).toFixed(e),n?t:+t}
- /**
- * Inplacd asc sort arr.
- * The input arr will be modified.
- */function Ke(t){return t.sort((function(t,e){return t-e})),t}
- /**
- * Get precision.
- */function Je(t){if(t=+t,isNaN(t))return 0;
- // It is much faster than methods converting number to string as follows
- // let tmp = val.toString();
- // return tmp.length - 1 - tmp.indexOf('.');
- // especially when precision is low
- // Notice:
- // (1) If the loop count is over about 20, it is slower than `getPrecisionSafe`.
- // (see https://jsbench.me/2vkpcekkvw/1)
- // (2) If the val is less than for example 1e-15, the result may be incorrect.
- // (see test/ut/spec/util/number.test.ts `getPrecision_equal_random`)
- if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Math.round(t*e)/e===t)return n;return $e(t)}
- /**
- * Get precision with slow but safe method
- */function $e(t){
- // toLowerCase for: '3.4E-12'
- var e=t.toString().toLowerCase(),n=e.indexOf("e"),i=n>0?+e.slice(n+1):0,o=n>0?n:e.length,r=e.indexOf("."),a=r<0?0:o-1-r;
- // Consider scientific notation: '3.4e-12' '3.4e+12'
- return Math.max(0,a-i)}
- /**
- * Minimal dicernible data precisioin according to a single pixel.
- */function Qe(t,e){var n=Math.log,i=Math.LN10,o=Math.floor(n(t[1]-t[0])/i),r=Math.round(n(Math.abs(e[1]-e[0]))/i),a=Math.min(Math.max(-o+r,0),20);return isFinite(a)?a:20}
- /**
- * Get a data of given precision, assuring the sum of percentages
- * in valueList is 1.
- * The largest remainder method is used.
- * https://en.wikipedia.org/wiki/Largest_remainder_method
- *
- * @param valueList a list of all data
- * @param idx index of the data to be processed in valueList
- * @param precision integer number showing digits of precision
- * @return percent ranging from 0 to 100
- */
- /**
- * Get a data of given precision, assuring the sum of percentages
- * in valueList is 1.
- * The largest remainder method is used.
- * https://en.wikipedia.org/wiki/Largest_remainder_method
- *
- * @param valueList a list of all data
- * @param precision integer number showing digits of precision
- * @return {Array<number>}
- */
- function tn(t,i){var o=e(t,(function(t,e){return t+(isNaN(e)?0:e)}),0);if(0===o)return[];
- // Has remainding votes.
- for(var r=Math.pow(10,i),a=n(t,(function(t){return(isNaN(t)?0:t)/o*r*100})),s=100*r,l=n(a,(function(t){
- // Assign automatic seats.
- return Math.floor(t)})),u=e(l,(function(t,e){return t+e}),0),c=n(a,(function(t,e){return t-l[e]}));u<s;){for(
- // Find next largest remainder.
- var d=Number.NEGATIVE_INFINITY,h=null,p=0,f=c.length;p<f;++p)c[p]>d&&(d=c[p],h=p);
- // Add a vote to max remainder.
- ++l[h],c[h]=0,++u}return n(l,(function(t){return t/r}))}
- /**
- * Solve the floating point adding problem like 0.1 + 0.2 === 0.30000000000000004
- * See <http://0.30000000000000004.com/>
- */function en(t,e){var n=Math.max(Je(t),Je(e)),i=t+e;
- // const multiplier = Math.pow(10, maxPrecision);
- // return (Math.round(val0 * multiplier) + Math.round(val1 * multiplier)) / multiplier;
- // // PENDING: support more?
- return n>20?i:qe(i,n)}
- // Number.MAX_SAFE_INTEGER, ie do not support.
- var nn=9007199254740991;
- /**
- * To 0 - 2 * PI, considering negative radian.
- */function on(t){var e=2*Math.PI;return(t%e+e)%e}
- /**
- * @param {type} radian
- * @return {boolean}
- */function rn(t){return t>-1e-4&&t<Ze}
- // eslint-disable-next-line
- var an=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;// jshint ignore:line
- /**
- * @param value valid type: number | string | Date, otherwise return `new Date(NaN)`
- * These values can be accepted:
- * + An instance of Date, represent a time in its own time zone.
- * + Or string in a subset of ISO 8601, only including:
- * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06',
- * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123',
- * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00',
- * all of which will be treated as local time if time zone is not specified
- * (see <https://momentjs.com/>).
- * + Or other string format, including (all of which will be treated as local time):
- * '2012', '2012-3-1', '2012/3/1', '2012/03/01',
- * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123'
- * + a timestamp, which represent a time in UTC.
- * @return date Never be null/undefined. If invalid, return `new Date(NaN)`.
- */function sn(e){if(e instanceof Date)return e;if(t(e)){
- // Different browsers parse date in different way, so we parse it manually.
- // Some other issues:
- // new Date('1970-01-01') is UTC,
- // new Date('1970/01/01') and new Date('1970-1-01') is local.
- // See issue #3623
- var n=an.exec(e);if(!n)
- // return Invalid Date.
- return new Date(NaN);
- // Use local time when no timezone offset is specified.
- if(n[8]){var i=+n[4]||0;return"Z"!==n[8].toUpperCase()&&(i-=+n[8].slice(0,3)),new Date(Date.UTC(+n[1],+(n[2]||1)-1,+n[3]||1,i,+(n[5]||0),+n[6]||0,n[7]?+n[7].substring(0,3):0))}
- // match[n] can only be string or undefined.
- // But take care of '12' + 1 => '121'.
- return new Date(+n[1],+(n[2]||1)-1,+n[3]||1,+n[4]||0,+(n[5]||0),+n[6]||0,n[7]?+n[7].substring(0,3):0)}return null==e?new Date(NaN):new Date(Math.round(e))}
- /**
- * Quantity of a number. e.g. 0.1, 1, 10, 100
- *
- * @param val
- * @return
- */function ln(t){return Math.pow(10,un(t))}
- /**
- * Exponent of the quantity of a number
- * e.g., 1234 equals to 1.234*10^3, so quantityExponent(1234) is 3
- *
- * @param val non-negative value
- * @return
- */function un(t){if(0===t)return 0;var e=Math.floor(Math.log(t)/Math.LN10);
- /**
- * exp is expected to be the rounded-down result of the base-10 log of val.
- * But due to the precision loss with Math.log(val), we need to restore it
- * using 10^exp to make sure we can get val back from exp. #11249
- */return t/Math.pow(10,e)>=10&&e++,e}
- /**
- * find a “nice” number approximately equal to x. Round the number if round = true,
- * take ceiling if round = false. The primary observation is that the “nicest”
- * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.
- *
- * See "Nice Numbers for Graph Labels" of Graphic Gems.
- *
- * @param val Non-negative value.
- * @param round
- * @return Niced number
- */function cn(t,e){var n=un(t),i=Math.pow(10,n),o=t/i;
- // Fix 3 * 0.1 === 0.30000000000000004 issue (see IEEE 754).
- // 20 is the uppper bound of toFixed.
- return t=(e?o<1.5?1:o<2.5?2:o<4?3:o<7?5:10:o<1?1:o<2?2:o<3?3:o<5?5:10)*i,n>=-20?+t.toFixed(n<0?-n:0):t}
- /**
- * This code was copied from "d3.js"
- * <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/arrays/quantile.js>.
- * See the license statement at the head of this file.
- * @param ascArr
- */function dn(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),o=+t[i-1],r=n-i;return r?o+r*(t[i]-o):o}
- /**
- * Order intervals asc, and split them when overlap.
- * expect(numberUtil.reformIntervals([
- * {interval: [18, 62], close: [1, 1]},
- * {interval: [-Infinity, -70], close: [0, 0]},
- * {interval: [-70, -26], close: [1, 1]},
- * {interval: [-26, 18], close: [1, 1]},
- * {interval: [62, 150], close: [1, 1]},
- * {interval: [106, 150], close: [1, 1]},
- * {interval: [150, Infinity], close: [0, 0]}
- * ])).toEqual([
- * {interval: [-Infinity, -70], close: [0, 0]},
- * {interval: [-70, -26], close: [1, 1]},
- * {interval: [-26, 18], close: [0, 1]},
- * {interval: [18, 62], close: [0, 1]},
- * {interval: [62, 150], close: [0, 1]},
- * {interval: [150, Infinity], close: [0, 0]}
- * ]);
- * @param list, where `close` mean open or close
- * of the interval, and Infinity can be used.
- * @return The origin list, which has been reformed.
- */function hn(t){t.sort((function(t,e){return s(t,e,0)?-1:1}));for(var e=-Infinity,n=1,i=0;i<t.length;){for(var o=t[i].interval,r=t[i].close,a=0;a<2;a++)o[a]<=e&&(o[a]=e,r[a]=a?1:1-n),e=o[a],n=r[a];o[0]===o[1]&&r[0]*r[1]!=1?t.splice(i,1):i++}return t;function s(t,e,n){return t.interval[n]<e.interval[n]||t.interval[n]===e.interval[n]&&(t.close[n]-e.close[n]==(n?-1:1)||!n&&s(t,e,1))}}
- /**
- * [Numeric is defined as]:
- * `parseFloat(val) == val`
- * For example:
- * numeric:
- * typeof number except NaN, '-123', '123', '2e3', '-2e3', '011', 'Infinity', Infinity,
- * and they rounded by white-spaces or line-terminal like ' -123 \n ' (see es spec)
- * not-numeric:
- * null, undefined, [], {}, true, false, 'NaN', NaN, '123ab',
- * empty string, string with only white-spaces or line-terminal (see es spec),
- * 0x12, '0x12', '-0x12', 012, '012', '-012',
- * non-string, ...
- *
- * @test See full test cases in `test/ut/spec/util/number.js`.
- * @return Must be a typeof number. If not numeric, return NaN.
- */function pn(e){var n=parseFloat(e);return n==e&&(0!==n||!t(e)||e.indexOf("x")<=0)?n:NaN}
- /**
- * Definition of "numeric": see `numericToNumber`.
- */function fn(t){return!isNaN(pn(t))}
- /**
- * Use random base to prevent users hard code depending on
- * this auto generated marker id.
- * @return An positive integer.
- */function gn(){return Math.round(9*Math.random())}
- /**
- * Get the greatest common divisor.
- *
- * @param {number} a one number
- * @param {number} b the other number
- */function yn(t,e){return 0===e?t:yn(e,t%e)}
- /**
- * Get the least common multiple.
- *
- * @param {number} a one number
- * @param {number} b the other number
- */function mn(t,e){return null==t?e:null==e?t:t*e/yn(t,e)}"undefined"!=typeof console&&console.warn&&console.log;
- /**
- * @throws Error
- */
- function vn(t){throw new Error(t)}function xn(t,e,n){return(e-t)*n+t}
- /**
- * Make the name displayable. But we should
- * make sure it is not duplicated with user
- * specified name, so use '\0';
- */var _n="series\0",bn="\0_ec_\0";
- /**
- * If value is not array, then translate it to array.
- * @param {*} value
- * @return {Array} [value] or value
- */
- function Sn(t){return t instanceof Array?t:null==t?[]:[t]}
- /**
- * Sync default option between normal and emphasis like `position` and `show`
- * In case some one will write code like
- * label: {
- * show: false,
- * position: 'outside',
- * fontSize: 18
- * },
- * emphasis: {
- * label: { show: true }
- * }
- */function wn(t,e,n){
- // Caution: performance sensitive.
- if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};
- // Default emphasis option from normal
- for(var i=0,o=n.length;i<o;i++){var r=n[i];!t.emphasis[e].hasOwnProperty(r)&&t[e].hasOwnProperty(r)&&(t.emphasis[e][r]=t[e][r])}}}var Mn=["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"];
- // modelUtil.LABEL_OPTIONS = modelUtil.TEXT_STYLE_OPTIONS.concat([
- // 'position', 'offset', 'rotate', 'origin', 'show', 'distance', 'formatter',
- // 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',
- // // FIXME: deprecated, check and remove it.
- // 'textStyle'
- // ]);
- /**
- * The method does not ensure performance.
- * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]
- * This helper method retrieves value from data.
- */function In(t){return!o(t)||i(t)||t instanceof Date?t:t.value}
- /**
- * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]
- * This helper method determine if dataItem has extra option besides value
- */function Dn(t){return o(t)&&!(t instanceof Array);
- // // markLine data can be array
- // && !(dataItem[0] && isObject(dataItem[0]) && !(dataItem[0] instanceof Array));
- }
- /**
- * Mapping to existings for merge.
- *
- * Mode "normalMege":
- * The mapping result (merge result) will keep the order of the existing
- * component, rather than the order of new option. Because we should ensure
- * some specified index reference (like xAxisIndex) keep work.
- * And in most cases, "merge option" is used to update partial option but not
- * be expected to change the order.
- *
- * Mode "replaceMege":
- * (1) Only the id mapped components will be merged.
- * (2) Other existing components (except internal components) will be removed.
- * (3) Other new options will be used to create new component.
- * (4) The index of the existing components will not be modified.
- * That means their might be "hole" after the removal.
- * The new components are created first at those available index.
- *
- * Mode "replaceAll":
- * This mode try to support that reproduce an echarts instance from another
- * echarts instance (via `getOption`) in some simple cases.
- * In this scenario, the `result` index are exactly the consistent with the `newCmptOptions`,
- * which ensures the component index referring (like `xAxisIndex: ?`) corrent. That is,
- * the "hole" in `newCmptOptions` will also be kept.
- * On the contrary, other modes try best to eliminate holes.
- * PENDING: This is an experimental mode yet.
- *
- * @return See the comment of <MappingResult>.
- */function Tn(t,e,n){var i="normalMerge"===n,l="replaceMerge"===n,u="replaceAll"===n;t=t||[],e=(e||[]).slice();var c=r();
- // Validate id and name on user input option.
- a(e,(function(t,n){o(t)||(e[n]=null)}));var d,h,p=function(t,e,n){var i=[];if("replaceAll"===n)return i;
- // Do not use native `map` to in case that the array `existings`
- // contains elided items, which will be omitted.
- for(var o=0;o<t.length;o++){var r=t[o];
- // Because of replaceMerge, `existing` may be null/undefined.
- r&&null!=r.id&&e.set(r.id,o),
- // For non-internal-componnets:
- // Mode "normalMerge": all existings kept.
- // Mode "replaceMerge": all existing removed unless mapped by id.
- // For internal-components:
- // go with "replaceMerge" approach in both mode.
- i.push({existing:"replaceMerge"===n||Pn(r)?null:r,newOption:null,keyInfo:null,brandNew:null})}return i}(t,c,n);
- // The array `result` MUST NOT contain elided items, otherwise the
- // forEach will omit those items and result in incorrect result.
- return(i||l)&&function(t,e,n,i){
- // Mapping by id if specified.
- a(i,(function(o,r){if(o&&null!=o.id){var a=An(o.id),l=n.get(a);if(null!=l){var u=t[l];s(!u.newOption,'Duplicated option on id "'+a+'".'),u.newOption=o,
- // In both mode, if id matched, new option will be merged to
- // the existings rather than creating new component model.
- u.existing=e[l],i[r]=null}}}))}(p,t,c,e),i&&function(t,e){
- // Mapping by name if specified.
- a(e,(function(n,i){if(n&&null!=n.name)for(var o=0;o<t.length;o++){var r=t[o].existing;if(!t[o].newOption&&r&&(null==r.id||null==n.id)&&!Pn(n)&&!Pn(r)&&Cn("name",r,n))return t[o].newOption=n,void(e[i]=null)}}))}(p,e),i||l?function(t,e,n){a(e,(function(e){if(e){for(
- // Find the first place that not mapped by id and not internal component (consider the "hole").
- var i,o=0;
- // Be `!resultItem` only when `nextIdx >= result.length`.
- (i=t[o])&&(i.newOption||Pn(i.existing)||
- // In mode "replaceMerge", here no not-mapped-non-internal-existing.
- i.existing&&null!=e.id&&!Cn("id",e,i.existing));)o++;i?(i.newOption=e,i.brandNew=n):t.push({newOption:e,brandNew:n,existing:null,keyInfo:null}),o++}}))}(p,e,l):u&&function(t,e){a(e,(function(e){
- // The feature "reproduce" requires "hole" will also reproduced
- // in case that component index referring are broken.
- t.push({newOption:e,brandNew:!0,existing:null,keyInfo:null})}))}
- /**
- * Make id and name for mapping result (result of mappingToExists)
- * into `keyInfo` field.
- */(p,e),d=p,h=r(),a(d,(function(t){var e=t.existing;e&&h.set(e.id,t)})),a(d,(function(t){var e=t.newOption;
- // Force ensure id not duplicated.
- s(!e||null==e.id||!h.get(e.id)||h.get(e.id)===t,"id duplicates: "+(e&&e.id)),e&&null!=e.id&&h.set(e.id,t),!t.keyInfo&&(t.keyInfo={})})),
- // Make name and id.
- a(d,(function(t,e){var n=t.existing,i=t.newOption,r=t.keyInfo;if(o(i)){if(
- // Name can be overwritten. Consider case: axis.name = '20km'.
- // But id generated by name will not be changed, which affect
- // only in that case: setOption with 'not merge mode' and view
- // instance will be recreated, which can be accepted.
- r.name=null!=i.name?An(i.name):n?n.name:_n+e,n)r.id=An(n.id);else if(null!=i.id)r.id=An(i.id);else{
- // Consider this situatoin:
- // optionA: [{name: 'a'}, {name: 'a'}, {..}]
- // optionB [{..}, {name: 'a'}, {name: 'a'}]
- // Series with the same name between optionA and optionB
- // should be mapped.
- var a=0;do{r.id="\0"+r.name+"\0"+a++}while(h.get(r.id))}h.set(r.id,t)}})),p}function Cn(t,e,n){var i=Ln(e[t],null),o=Ln(n[t],null);
- // See `MappingExistingItem`. `id` and `name` trade string equals to number.
- return null!=i&&null!=o&&i===o}
- /**
- * @return return null if not exist.
- */function An(t){return Ln(t,"")}function Ln(e,n){return null==e?n:t(e)?e:l(e)||u(e)?e+"":n}function kn(t){var e=t.name;
- // Is specified when `indexOf` get -1 or > 0.
- return!(!e||!e.indexOf(_n))}
- /**
- * @public
- * @param {Object} cmptOption
- * @return {boolean}
- */function Pn(t){return t&&null!=t.id&&0===An(t.id).indexOf(bn)}
- /**
- * @param payload Contains dataIndex (means rawIndex) / dataIndexInside / name
- * each of which can be Array or primary type.
- * @return dataIndex If not found, return undefined/null.
- */
- function Nn(t,e){return null!=e.dataIndexInside?e.dataIndexInside:null!=e.dataIndex?i(e.dataIndex)?n(e.dataIndex,(function(e){return t.indexOfRawIndex(e)})):t.indexOfRawIndex(e.dataIndex):null!=e.name?i(e.name)?n(e.name,(function(e){return t.indexOfName(e)})):t.indexOfName(e.name):void 0}
- /**
- * Enable property storage to any host object.
- * Notice: Serialization is not supported.
- *
- * For example:
- * let inner = zrUitl.makeInner();
- *
- * function some1(hostObj) {
- * inner(hostObj).someProperty = 1212;
- * ...
- * }
- * function some2() {
- * let fields = inner(this);
- * fields.someProperty1 = 1212;
- * fields.someProperty2 = 'xx';
- * ...
- * }
- *
- * @return {Function}
- */function On(){var t="__ec_inner_"+Rn++;return function(e){return e[t]||(e[t]={})}}var Rn=gn();
- /**
- * The same behavior as `component.getReferringComponents`.
- */function En(t,e,n){var i=Vn(e,n),o=i.mainTypeSpecified,r=i.queryOptionMap,a=i.others,s=n?n.defaultMainType:null;return!o&&s&&r.set(s,{}),r.each((function(e,i){var o=Gn(t,i,e,{useDefault:s===i,enableAll:!n||null==n.enableAll||n.enableAll,enableNone:!n||null==n.enableNone||n.enableNone});a[i+"Models"]=o.models,a[i+"Model"]=o.models[0]})),a}function Vn(e,n){var i;if(t(e)){var o={};o[e+"Index"]=0,i=o}else i=e;var s=r(),l={},u=!1;return a(i,(function(t,e){
- // Exclude 'dataIndex' and other illgal keys.
- if("dataIndex"!==e&&"dataIndexInside"!==e){var i=e.match(/^(\w+)(Index|Id|Name)$/)||[],o=i[1],r=(i[2]||"").toLowerCase();if(o&&r&&!(n&&n.includeMainTypes&&c(n.includeMainTypes,o)<0))u=u||!!o,(s.get(o)||s.set(o,{}))[r]=t}else l[e]=t})),{mainTypeSpecified:u,queryOptionMap:s,others:l}}var zn={useDefault:!0,enableAll:!1,enableNone:!1},Bn={useDefault:!1,enableAll:!0,enableNone:!0};function Gn(t,e,n,i){i=i||zn;var o=n.index,r=n.id,a=n.name,l={models:null,specified:null!=o||null!=r||null!=a};if(!l.specified){
- // Use the first as default if `useDefault`.
- var u=void 0;return l.models=i.useDefault&&(u=t.getComponent(e))?[u]:[],l}return"none"===o||!1===o?(s(i.enableNone,'`"none"` or `false` is not a valid value on index option.'),l.models=[],l):(
- // `queryComponents` will return all components if
- // both all of index/id/name are null/undefined.
- "all"===o&&(s(i.enableAll,'`"all"` is not a valid value on index option.'),o=r=a=null),l.models=t.queryComponents({mainType:e,index:o,id:r,name:a}),l)}function Fn(t,e,n){t.setAttribute?t.setAttribute(e,n):t[e]=n}
- /**
- * Group a list by key.
- */
- function Wn(t,e){var n=r(),i=[];return a(t,(function(t){var o=e(t);(n.get(o)||(i.push(o),n.set(o,[]))).push(t)})),{keys:i,buckets:n}}
- /**
- * Interpolate raw values of a series with percent
- *
- * @param data data
- * @param labelModel label model of the text element
- * @param sourceValue start value. May be null/undefined when init.
- * @param targetValue end value
- * @param percent 0~1 percentage; 0 uses start value while 1 uses end value
- * @return interpolated values
- * If `sourceValue` and `targetValue` are `number`, return `number`.
- * If `sourceValue` and `targetValue` are `string`, return `string`.
- * If `sourceValue` and `targetValue` are `(string | number)[]`, return `(string | number)[]`.
- * Other cases do not supported.
- */function Hn(e,n,i,o,r){var a=null==n||"auto"===n;if(null==o)return o;if(l(o))return qe(y=xn(i||0,o,r),a?Math.max(Je(i||0),Je(o)):n);if(t(o))return r<1?i:o;for(var s=[],u=i,c=o,d=Math.max(u?u.length:0,c.length),h=0;h<d;++h){var p=e.getDimensionInfo(h);
- // Don't interpolate ordinal dims
- if(p&&"ordinal"===p.type)
- // In init, there is no `sourceValue`, but should better not to get undefined result.
- s[h]=(r<1&&u?u:c)[h];else{var f=u&&u[h]?u[h]:0,g=c[h],y=xn(f,g,r);s[h]=qe(y,a?Math.max(Je(f),Je(g)):n)}}return s}var Yn="___EC__COMPONENT__CONTAINER___",Un="___EC__EXTENDED_CLASS___";
- /**
- * Notice, parseClassType('') should returns {main: '', sub: ''}
- * @public
- */
- function Zn(t){var e={main:"",sub:""};if(t){var n=t.split(".");e.main=n[0]||"",e.sub=n[1]||""}return e}
- /**
- * @public
- */
- /**
- * Implements `ExtendableConstructor` for `rootClz`.
- *
- * @usage
- * ```ts
- * class Xxx {}
- * type XxxConstructor = typeof Xxx & ExtendableConstructor
- * enableClassExtend(Xxx as XxxConstructor);
- * ```
- */
- function Xn(t,e){t.$constructor=t,// FIXME: not necessary?
- t.extend=function(t){var e,n,i=this;return f(n=i)&&/^class\s/.test(Function.prototype.toString.call(n))?e=/** @class */function(t){function e(){return t.apply(this,arguments)||this}return Ue(e,t),e}(i):(
- // For backward compat, we both support ts class inheritance and this
- // "extend" approach.
- // The constructor should keep the same behavior as ts class inheritance:
- // If this constructor/$constructor is not declared, auto invoke the super
- // constructor.
- // If this constructor/$constructor is declared, it is responsible for
- // calling the super constructor.
- e=function(){(t.$constructor||i).apply(this,arguments)},h(e,this)),p(e.prototype,t),e[Un]=!0,e.extend=this.extend,e.superCall=Kn,e.superApply=Jn,e.superClass=i,e}}
- /**
- * A work around to both support ts extend and this extend mechanism.
- * on sub-class.
- * @usage
- * ```ts
- * class Component { ... }
- * classUtil.enableClassExtend(Component);
- * classUtil.enableClassManagement(Component, {registerWhenExtend: true});
- *
- * class Series extends Component { ... }
- * // Without calling `markExtend`, `registerWhenExtend` will not work.
- * Component.markExtend(Series);
- * ```
- */
- function jn(t,e){t.extend=e.extend}
- // A random offset.
- var qn=Math.round(10*Math.random());
- /**
- * Implements `CheckableConstructor` for `target`.
- * Can not use instanceof, consider different scope by
- * cross domain or es module import in ec extensions.
- * Mount a method "isInstance()" to Clz.
- *
- * @usage
- * ```ts
- * class Xxx {}
- * type XxxConstructor = typeof Xxx & CheckableConstructor;
- * enableClassCheck(Xxx as XxxConstructor)
- * ```
- */
- // superCall should have class info, which can not be fetched from 'this'.
- // Consider this case:
- // class A has method f,
- // class B inherits class A, overrides method f, f call superApply('f'),
- // class C inherits class B, does not override method f,
- // then when method of class C is called, dead loop occurred.
- function Kn(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return this.superClass.prototype[e].apply(t,n)}function Jn(t,e,n){return this.superClass.prototype[e].apply(t,n)}
- /**
- * Implements `ClassManager` for `target`
- *
- * @usage
- * ```ts
- * class Xxx {}
- * type XxxConstructor = typeof Xxx & ClassManager
- * enableClassManagement(Xxx as XxxConstructor);
- * ```
- */function $n(t){
- /**
- * Component model classes
- * key: componentType,
- * value:
- * componentClass, when componentType is 'a'
- * or Object.<subKey, componentClass>, when componentType is 'a.b'
- */
- var e={};t.registerClass=function(t){
- // `type` should not be a "instance member".
- // If using TS class, should better declared as `static type = 'series.pie'`.
- // otherwise users have to mount `type` on prototype manually.
- // For backward compat and enable instance visit type via `this.type`,
- // we still support fetch `type` from prototype.
- var n,i=t.type||t.prototype.type;if(i){s(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(n=i),'componentType "'+n+'" illegal'),
- // If only static type declared, we assign it to prototype mandatorily.
- t.prototype.type=i;var o=Zn(i);if(o.sub){if(o.sub!==Yn){var r=function(t){var n=e[t.main];n&&n[Yn]||((n=e[t.main]={})[Yn]=!0);return n}(o);r[o.sub]=t}}else e[o.main]=t}return t},t.getClass=function(t,n,i){var o=e[t];if(o&&o[Yn]&&(o=n?o[n]:null),i&&!o)throw new Error(n?"Component "+t+"."+(n||"")+" is used but not imported.":t+".type should be specified.");return o},t.getClassesByMainType=function(t){var n=Zn(t),i=[],o=e[n.main];return o&&o[Yn]?a(o,(function(t,e){e!==Yn&&i.push(t)})):i.push(o),i},t.hasClass=function(t){
- // Just consider componentType.main.
- var n=Zn(t);return!!e[n.main]},
- /**
- * @return Like ['aa', 'bb'], but can not be ['aa.xx']
- */
- t.getAllClassMainTypes=function(){var t=[];return a(e,(function(e,n){t.push(n)})),t},
- /**
- * If a main type is container and has sub types
- */
- t.hasSubTypes=function(t){var n=Zn(t),i=e[n.main];return i&&i[Yn]}}
- // /**
- // * @param {string|Array.<string>} properties
- // */
- // export function setReadOnly(obj, properties) {
- // FIXME It seems broken in IE8 simulation of IE11
- // if (!zrUtil.isArray(properties)) {
- // properties = properties != null ? [properties] : [];
- // }
- // zrUtil.each(properties, function (prop) {
- // let value = obj[prop];
- // Object.defineProperty
- // && Object.defineProperty(obj, prop, {
- // value: value, writable: false
- // });
- // zrUtil.isArray(obj[prop])
- // && Object.freeze
- // && Object.freeze(obj[prop]);
- // });
- // }
- function Qn(t,e){
- // Normalize
- for(var n=0;n<t.length;n++)t[n][1]||(t[n][1]=t[n][0]);return e=e||!1,function(n,i,o){for(var r={},a=0;a<t.length;a++){var s=t[a][1];if(!(i&&c(i,s)>=0||o&&c(o,s)<0)){var l=n.getShallow(s,e);null!=l&&(r[t[a][0]]=l)}}
- // TODO Text or image?
- return r}}var ti=Qn([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),ei=/** @class */function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return ti(this,t,e)},t}(),ni=On(),ii=function(t,e,n,i){if(i){var o=ni(i);
- // Add data index and series index for indexing the data by element
- // Useful in tooltip
- o.dataIndex=n,o.dataType=e,o.seriesIndex=t,o.ssrType="chart",
- // TODO: not store dataIndex on children.
- "group"===i.type&&i.traverse((function(i){var o=ni(i);o.seriesIndex=t,o.dataIndex=n,o.dataType=e,o.ssrType="chart"}))}},oi=1,ri={},ai=On(),si=On(),li=["emphasis","blur","select"],ui=["normal","emphasis","blur","select"],ci=10,di="highlight",hi="downplay",pi="select",fi="unselect",gi="toggleSelect";function yi(t){return null!=t&&"none"!==t}function mi(t,e,n){t.onHoverStateChange&&(t.hoverState||0)!==n&&t.onHoverStateChange(e),t.hoverState=n}function vi(t){
- // Only mark the flag.
- // States will be applied in the echarts.ts in next frame.
- mi(t,"emphasis",2)}function xi(t){
- // Only mark the flag.
- // States will be applied in the echarts.ts in next frame.
- 2===t.hoverState&&mi(t,"normal",0)}function _i(t){mi(t,"blur",1)}function bi(t){1===t.hoverState&&mi(t,"normal",0)}function Si(t){t.selected=!0}function wi(t){t.selected=!1}function Mi(t,e,n){e(t,n)}function Ii(t,e,n){Mi(t,e,n),t.isGroup&&t.traverse((function(t){Mi(t,e,n)}))}function Di(t,e){switch(e){case"emphasis":t.hoverState=2;break;case"normal":t.hoverState=0;break;case"blur":t.hoverState=1;break;case"select":t.selected=!0}}function Ti(t,e){var n=this.states[t];if(this.style){if("emphasis"===t)return function(t,e,n,i){var o=n&&c(n,"select")>=0,r=!1;if(t instanceof g){var a=ai(t),s=o&&a.selectFill||a.normalFill,l=o&&a.selectStroke||a.normalStroke;if(yi(s)||yi(l)){var u=(i=i||{}).style||{};
- // inherit case
- "inherit"===u.fill?(r=!0,i=p({},i),(u=p({},u)).fill=s):!yi(u.fill)&&yi(s)?(r=!0,
- // Not modify the original value.
- i=p({},i),
- // Already being applied 'emphasis'. DON'T lift color multiple times.
- (u=p({},u)).fill=y(s)):!yi(u.stroke)&&yi(l)&&(r||(i=p({},i),u=p({},u)),u.stroke=y(l)),i.style=u}}if(i&&null==i.z2){r||(i=p({},i));var d=t.z2EmphasisLift;i.z2=t.z2+(null!=d?d:ci)}return i}(this,0,e,n);if("blur"===t)return function(t,e,n){var i=c(t.currentStates,e)>=0,o=t.style.opacity,r=i?null:function(t,e,n,i){for(var o=t.style,r={},a=0;a<e.length;a++){var s=e[a],l=o[s];r[s]=null==l?i&&i[s]:l}for(a=0;a<t.animators.length;a++){var u=t.animators[a];u.__fromStateTransition&&u.__fromStateTransition.indexOf(n)<0&&"style"===u.targetName&&u.saveTo(r,e)}return r}(t,["opacity"],e,{opacity:1}),a=(n=n||{}).style||{};return null==a.opacity&&(
- // clone state
- n=p({},n),a=p({
- // Already being applied 'emphasis'. DON'T mul opacity multiple times.
- opacity:i?o:.1*r.opacity},a),n.style=a),n}(this,t,n);if("select"===t)return function(t,e,n){
- // const hasSelect = indexOf(el.currentStates, stateName) >= 0;
- if(n&&null==n.z2){n=p({},n);var i=t.z2SelectLift;n.z2=t.z2+(null!=i?i:9)}return n}(this,0,n)}return n}
- /**
- * Set hover style (namely "emphasis style") of element.
- * @param el Should not be `zrender/graphic/Group`.
- * @param focus 'self' | 'selfInSeries' | 'series'
- */function Ci(t){t.stateProxy=Ti;var e=t.getTextContent(),n=t.getTextGuideLine();e&&(e.stateProxy=Ti),n&&(n.stateProxy=Ti)}function Ai(t,e){!Vi(t,e)&&!t.__highByOuter&&Ii(t,vi)}function Li(t,e){!Vi(t,e)&&!t.__highByOuter&&Ii(t,xi)}function ki(t,e){t.__highByOuter|=1<<(e||0),Ii(t,vi)}function Pi(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&Ii(t,xi)}function Ni(t){Ii(t,_i)}function Oi(t){Ii(t,bi)}function Ri(t){Ii(t,Si)}function Ei(t){Ii(t,wi)}function Vi(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function zi(t){var e=t.getModel(),n=[],i=[];e.eachComponent((function(e,o){var r=si(o),a="series"===e,s=a?t.getViewOfSeriesModel(o):t.getViewOfComponentModel(o);!a&&i.push(s),r.isBlured&&(
- // Leave blur anyway
- s.group.traverse((function(t){bi(t)})),a&&n.push(o)),r.isBlured=!1})),a(i,(function(t){t&&t.toggleBlurSeries&&t.toggleBlurSeries(n,!1,e)}))}function Bi(t,e,n,i){var r=i.getModel();function a(t,e){for(var n=0;n<e.length;n++){var i=t.getItemGraphicEl(e[n]);i&&Oi(i)}}if(n=n||"coordinateSystem",null!=t&&e&&"none"!==e){var s=r.getSeriesByIndex(t),l=s.coordinateSystem;l&&l.master&&(l=l.master);var u=[];r.eachSeries((function(t){var r=s===t,c=t.coordinateSystem;// If there is no coordinate system. use sameSeries instead.
- if(c&&c.master&&(c=c.master),!(
- // Not blur other series if blurScope series
- "series"===n&&!r||"coordinateSystem"===n&&!(c&&l?c===l:r)||"series"===e&&r)){if(i.getViewOfSeriesModel(t).group.traverse((function(t){
- // For the elements that have been triggered by other components,
- // and are still required to be highlighted,
- // because the current is directly forced to blur the element,
- // it will cause the focus self to be unable to highlight, so skip the blur of this element.
- t.__highByOuter&&r&&"self"===e||_i(t)})),m(e))a(t.getData(),e);else if(o(e))for(var d=v(e),h=0;h<d.length;h++)a(t.getData(d[h]),e[d[h]]);u.push(t),si(t).isBlured=!0}})),r.eachComponent((function(t,e){if("series"!==t){var n=i.getViewOfComponentModel(e);n&&n.toggleBlurSeries&&n.toggleBlurSeries(u,!0,r)}}))}}function Gi(t,e,n){if(null!=t&&null!=e){var i=n.getModel().getComponent(t,e);if(i){si(i).isBlured=!0;var o=n.getViewOfComponentModel(i);o&&o.focusBlurEnabled&&o.group.traverse((function(t){_i(t)}))}}}function Fi(t,e,n,i){var o={focusSelf:!1,dispatchers:null};if(null==t||"series"===t||null==e||null==n)return o;var r=i.getModel().getComponent(t,e);if(!r)return o;var a=i.getViewOfComponentModel(r);if(!a||!a.findHighDownDispatchers)return o;for(var s,l=a.findHighDownDispatchers(n),u=0
- // At presnet, the component (like Geo) only blur inside itself.
- // So we do not use `blurScope` in component.
- ;u<l.length;u++)if("self"===ni(l[u]).focus){s=!0;break}return{focusSelf:s,dispatchers:l}}function Wi(t){var e=t.getAllData();a(e,(function(e){var n=e.data,i=e.type;n.eachItemGraphicEl((function(e,n){t.isSelected(n,i)?Ri(e):Ei(e)}))}))}function Hi(t){var e=[];return t.eachSeries((function(t){var n=t.getAllData();a(n,(function(n){n.data;var i=n.type,o=t.getSelectedDataIndices();if(o.length>0){var r={dataIndex:o,seriesIndex:t.seriesIndex};null!=i&&(r.dataType=i),e.push(r)}}))})),e}
- /**
- * Enable the function that mouseover will trigger the emphasis state.
- *
- * NOTE:
- * This function should be used on the element with dataIndex, seriesIndex.
- *
- */function Yi(t,e,n){Ki(t,!0),Ii(t,Ci),Zi(t,e,n)}function Ui(t,e,n,i){i?function(t){Ki(t,!1)}(t):Yi(t,e,n)}function Zi(t,e,n){var i=ni(t);null!=e?(
- // TODO dataIndex may be set after this function. This check is not useful.
- // if (ecData.dataIndex == null) {
- // if (__DEV__) {
- // console.warn('focus can only been set on element with dataIndex');
- // }
- // }
- // else {
- i.focus=e,i.blurScope=n):i.focus&&(i.focus=null)}var Xi=["emphasis","blur","select"],ji={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};
- /**
- * Set emphasis/blur/selected states of element.
- */
- function qi(t,e,n,
- // default itemStyle
- i){n=n||"itemStyle";for(var o=0;o<Xi.length;o++){var r=Xi[o],a=e.getModel([r,n]);
- // Let it throw error if getterType is not found.
- t.ensureState(r).style=i?i(a):a[ji[n]]()}}
- /**
- *
- * Set element as highlight / downplay dispatcher.
- * It will be checked when element received mouseover event or from highlight action.
- * It's in change of all highlight/downplay behavior of it's children.
- *
- * @param el
- * @param el.highDownSilentOnTouch
- * In touch device, mouseover event will be trigger on touchstart event
- * (see module:zrender/dom/HandlerProxy). By this mechanism, we can
- * conveniently use hoverStyle when tap on touch screen without additional
- * code for compatibility.
- * But if the chart/component has select feature, which usually also use
- * hoverStyle, there might be conflict between 'select-highlight' and
- * 'hover-highlight' especially when roam is enabled (see geo for example).
- * In this case, `highDownSilentOnTouch` should be used to disable
- * hover-highlight on touch device.
- * @param asDispatcher If `false`, do not set as "highDownDispatcher".
- */function Ki(t,e){var n=!1===e,i=t;
- // Make `highDownSilentOnTouch` and `onStateChange` only work after
- // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly.
- t.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=t.highDownSilentOnTouch),
- // Simple optimize, since this method might be
- // called for each elements of a group in some cases.
- n&&!i.__highDownDispatcher||(
- // Emphasis, normal can be triggered manually by API or other components like hover link.
- // el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent);
- // Also keep previous record.
- i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!n)}function Ji(t){return!(!t||!t.__highDownDispatcher)}
- /**
- * Enable component highlight/downplay features:
- * + hover link (within the same name)
- * + focus blur in component
- */function $i(t){var e=t.type;return e===pi||e===fi||e===gi}function Qi(t){var e=t.type;return e===di||e===hi}
- // Stored properties for further transition.
- var to=On();
- /**
- * Return null if animation is disabled.
- */function eo(t,e,n,
- // Extra opts can override the option in animatable model.
- i,
- // TODO It's only for pictorial bar now.
- o){var r;
- // Check if there is global animation configuration from dataZoom/resize can override the config in option.
- // If animation is enabled. Will use this animation config in payload.
- // If animation is disabled. Just ignore it.
- if(e&&e.ecModel){var a=e.ecModel.getUpdatePayload();r=a&&a.animation}var s="update"===t;if(e&&e.isAnimationEnabled()){var l=void 0,u=void 0,c=void 0;return i?(l=x(i.duration,200),u=x(i.easing,"cubicOut"),c=0):(l=e.getShallow(s?"animationDurationUpdate":"animationDuration"),u=e.getShallow(s?"animationEasingUpdate":"animationEasing"),c=e.getShallow(s?"animationDelayUpdate":"animationDelay")),
- // animation from payload has highest priority.
- r&&(null!=r.duration&&(l=r.duration),null!=r.easing&&(u=r.easing),null!=r.delay&&(c=r.delay)),f(c)&&(c=c(n,o)),f(l)&&(l=l(n)),{duration:l||0,delay:c,easing:u}}return null}function no(t,e,n,i,r,a,s){var l,u=!1;f(r)?(s=a,a=r,r=null):o(r)&&(a=r.cb,s=r.during,u=r.isFrom,l=r.removeOpt,r=r.dataIndex);var c="leave"===t;c||
- // Must stop the remove animation.
- e.stopAnimation("leave");var d=eo(t,i,r,c?l||{}:null,i&&i.getAnimationDelayParams?i.getAnimationDelayParams(e,r):null);if(d&&d.duration>0){var h={duration:d.duration,delay:d.delay||0,easing:d.easing,done:a,force:!!a||!!s,
- // Set to final state in update/init animation.
- // So the post processing based on the path shape can be done correctly.
- setToFinal:!c,scope:t,during:s};u?e.animateFrom(n,h):e.animateTo(n,h)}else e.stopAnimation(),
- // If `isFrom`, the props is the "from" props.
- !u&&e.attr(n),
- // Call during at least once.
- s&&s(1),a&&a()}
- /**
- * Update graphic element properties with or without animation according to the
- * configuration in series.
- *
- * Caution: this method will stop previous animation.
- * So do not use this method to one element twice before
- * animation starts, unless you know what you are doing.
- * @example
- * graphic.updateProps(el, {
- * position: [100, 100]
- * }, seriesModel, dataIndex, function () { console.log('Animation done!'); });
- * // Or
- * graphic.updateProps(el, {
- * position: [100, 100]
- * }, seriesModel, function () { console.log('Animation done!'); });
- */function io(t,e,
- // TODO: TYPE AnimatableModel
- n,i,o,r){no("update",t,e,n,i,o,r)}
- /**
- * Init graphic element properties with or without animation according to the
- * configuration in series.
- *
- * Caution: this method will stop previous animation.
- * So do not use this method to one element twice before
- * animation starts, unless you know what you are doing.
- */function oo(t,e,n,i,o,r){no("enter",t,e,n,i,o,r)}
- /**
- * If element is removed.
- * It can determine if element is having remove animation.
- */function ro(t){if(!t.__zr)return!0;for(var e=0;e<t.animators.length;e++){if("leave"===t.animators[e].scope)return!0}return!1}
- /**
- * Remove graphic element
- */function ao(t,e,n,i,o,r){
- // Don't do remove animation twice.
- ro(t)||no("leave",t,e,n,i,o,r)}function so(t,e,n,i){t.removeTextContent(),t.removeTextGuideLine(),ao(t,{style:{opacity:0}},e,n,i)}function lo(t,e,n){function i(){t.parent&&t.parent.remove(t)}
- // Hide label and labelLine first
- // TODO Also use fade out animation?
- t.isGroup?t.traverse((function(t){t.isGroup||
- // Can invoke doRemove multiple times.
- so(t,e,n,i)})):so(t,e,n,i)}
- /**
- * Save old style for style transition in universalTransition module.
- * It's used when element will be reused in each render.
- * For chart like map, heatmap, which will always create new element.
- * We don't need to save this because universalTransition can get old style from the old element
- */function uo(t){to(t).oldStyle=t.style}var co=Math.max,ho=Math.min,po={};
- /**
- * Extend shape with parameters
- */
- function fo(t){return g.extend(t)}var go=D;
- /**
- * Extend path
- */function yo(t,e){return go(t,e)}
- /**
- * Register a user defined shape.
- * The shape class can be fetched by `getShapeClass`
- * This method will overwrite the registered shapes, including
- * the registered built-in shapes, if using the same `name`.
- * The shape can be used in `custom series` and
- * `graphic component` by declaring `{type: name}`.
- *
- * @param name
- * @param ShapeClass Can be generated by `extendShape`.
- */function mo(t,e){po[t]=e}
- /**
- * Find shape class registered by `registerShape`. Usually used in
- * fetching user defined shape.
- *
- * [Caution]:
- * (1) This method **MUST NOT be used inside echarts !!!**, unless it is prepared
- * to use user registered shapes.
- * Because the built-in shape (see `getBuiltInShape`) will be registered by
- * `registerShape` by default. That enables users to get both built-in
- * shapes as well as the shapes belonging to themsleves. But users can overwrite
- * the built-in shapes by using names like 'circle', 'rect' via calling
- * `registerShape`. So the echarts inner featrues should not fetch shapes from here
- * in case that it is overwritten by users, except that some features, like
- * `custom series`, `graphic component`, do it deliberately.
- *
- * (2) In the features like `custom series`, `graphic component`, the user input
- * `{tpye: 'xxx'}` does not only specify shapes but also specify other graphic
- * elements like `'group'`, `'text'`, `'image'` or event `'path'`. Those names
- * are reserved names, that is, if some user registers a shape named `'image'`,
- * the shape will not be used. If we intending to add some more reserved names
- * in feature, that might bring break changes (disable some existing user shape
- * names). But that case probably rarely happens. So we don't make more mechanism
- * to resolve this issue here.
- *
- * @param name
- * @return The shape class. If not found, return nothing.
- */function vo(t){if(po.hasOwnProperty(t))return po[t]}
- /**
- * Create a path element from path data string
- * @param pathData
- * @param opts
- * @param rect
- * @param layout 'center' or 'cover' default to be cover
- */function xo(t,e,n,i){var o=_(t,e);return n&&("center"===i&&(n=bo(n,o.getBoundingRect())),wo(o,n)),o}
- /**
- * Create a image element from image url
- * @param imageUrl image url
- * @param opts options
- * @param rect constrain rect
- * @param layout 'center' or 'cover'. Default to be 'cover'
- */function _o(t,e,n){var i=new b({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(t){if("center"===n){var o={width:t.width,height:t.height};i.setStyle(bo(e,o))}}});return i}
- /**
- * Get position of centered element in bounding box.
- *
- * @param rect element local bounding box
- * @param boundingRect constraint bounding box
- * @return element position containing x, y, width, and height
- */function bo(t,e){
- // Set rect to center, keep width / height ratio.
- var n,i=e.width/e.height,o=t.height*i;return n=o<=t.width?t.height:(o=t.width)/i,{x:t.x+t.width/2-o/2,y:t.y+t.height/2-n/2,width:o,height:n}}var So=S;
- /**
- * Resize a path to fit the rect
- * @param path
- * @param rect
- */function wo(t,e){if(t.applyTransform){var n=t.getBoundingRect().calculateTransform(e);t.applyTransform(n)}}
- /**
- * Sub pixel optimize line for canvas
- */function Mo(t,e){return T(t,t,{lineWidth:e}),t}
- /**
- * Sub pixel optimize rect for canvas
- */
- /**
- * Sub pixel optimize for canvas
- *
- * @param position Coordinate, such as x, y
- * @param lineWidth Should be nonnegative integer.
- * @param positiveOrNegative Default false (negative).
- * @return Optimized position.
- */
- var Io=A;
- /**
- * Get transform matrix of target (param target),
- * in coordinate of its ancestor (param ancestor)
- *
- * @param target
- * @param [ancestor]
- */function Do(t,e){for(var n=w([]);t&&t!==e;)M(n,t.getLocalTransform(),n),t=t.parent;return n}
- /**
- * Apply transform to an vertex.
- * @param target [x, y]
- * @param transform Can be:
- * + Transform matrix: like [1, 0, 0, 1, 0, 0]
- * + {position, rotation, scale}, the same as `zrender/Transformable`.
- * @param invert Whether use invert matrix.
- * @return [x, y]
- */function To(t,e,n){return e&&!m(e)&&(e=L.getLocalTransform(e)),n&&(e=k([],e)),P([],t,e)}
- /**
- * @param direction 'left' 'right' 'top' 'bottom'
- * @param transform Transform matrix: like [1, 0, 0, 1, 0, 0]
- * @param invert Whether use invert matrix.
- * @return Transformed direction. 'left' 'right' 'top' 'bottom'
- */function Co(t,e,n){
- // Pick a base, ensure that transform result will not be (0, 0).
- var i=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]),r=["left"===t?-i:"right"===t?i:0,"top"===t?-o:"bottom"===t?o:0];return r=To(r,e,n),Math.abs(r[0])>Math.abs(r[1])?r[0]>0?"right":"left":r[1]>0?"bottom":"top"}function Ao(t){return!t.isGroup}
- /**
- * Apply group transition animation from g1 to g2.
- * If no animatableModel, no animation.
- */
- function Lo(t,e,n){if(t&&e){var i,o=(i={},t.traverse((function(t){Ao(t)&&t.anid&&(i[t.anid]=t)})),i);e.traverse((function(t){if(Ao(t)&&t.anid){var e=o[t.anid];if(e){var i=r(t);t.attr(r(e)),io(t,i,n,ni(t).dataIndex)}}}))}function r(t){var e={x:t.x,y:t.y,rotation:t.rotation};return function(t){return null!=t.shape}(t)&&(e.shape=p({},t.shape)),e}}function ko(t,e){
- // FIXME: This way might be incorrect when graphic clipped by a corner
- // and when element has a border.
- return n(t,(function(t){var n=t[0];n=co(n,e.x),n=ho(n,e.x+e.width);var i=t[1];return i=co(i,e.y),[n,i=ho(i,e.y+e.height)]}))}
- /**
- * Return a new clipped rect. If rect size are negative, return undefined.
- */function Po(t,e){var n=co(t.x,e.x),i=ho(t.x+t.width,e.x+e.width),o=co(t.y,e.y),r=ho(t.y+t.height,e.y+e.height);
- // If the total rect is cliped, nothing, including the border,
- // should be painted. So return undefined.
- if(i>=n&&r>=o)return{x:n,y:o,width:i-n,height:r-o}}function No(t,
- // Support 'image://' or 'path://' or direct svg path.
- e,n){var i=p({rectHover:!0},e),o=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(o.image=t.slice(8),I(o,n),new b(i)):xo(t.replace("path://",""),i,n,"center")}
- /**
- * Return `true` if the given line (line `a`) and the given polygon
- * are intersect.
- * Note that we do not count colinear as intersect here because no
- * requirement for that. We could do that if required in future.
- */function Oo(t,e,n,i,o){for(var r=0,a=o[o.length-1];r<o.length;r++){var s=o[r];if(Ro(t,e,n,i,s[0],s[1],a[0],a[1]))return!0;a=s}}
- /**
- * Return `true` if the given two lines (line `a` and line `b`)
- * are intersect.
- * Note that we do not count colinear as intersect here because no
- * requirement for that. We could do that if required in future.
- */function Ro(t,e,n,i,o,r,a,s){
- // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`.
- var l,u=n-t,c=i-e,d=a-o,h=s-r,p=Eo(d,h,u,c);if((l=p)<=1e-6&&l>=-1e-6)return!1;
- // `vec_m` and `vec_n` are intersect iff
- // existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`,
- // such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)`
- // and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`.
- var f=t-o,g=e-r,y=Eo(f,g,u,c)/p;if(y<0||y>1)return!1;var m=Eo(f,g,d,h)/p;return!(m<0||m>1)}
- /**
- * Cross product of 2-dimension vector.
- */function Eo(t,e,n,i){return t*i-n*e}function Vo(e){var n=e.itemTooltipOption,i=e.componentModel,o=e.itemName,r=t(n)?{formatter:n}:n,s=i.mainType,l=i.componentIndex,u={componentType:s,name:o,$vars:["name"]};u[s+"Index"]=l;var c=e.formatterParamsExtra;c&&a(v(c),(function(t){N(u,t)||(u[t]=c[t],u.$vars.push(t))}));var d=ni(e.el);d.componentMainType=s,d.componentIndex=l,d.tooltipConfig={name:o,option:I({content:o,encodeHTMLContent:!0,formatterParams:u},r)}}function zo(t,e){var n;
- // TODO
- // Polyfill for fixing zrender group traverse don't visit it's root issue.
- t.isGroup&&(n=e(t)),n||t.traverse(e)}function Bo(t,e){if(t)if(i(t))for(var n=0;n<t.length;n++)zo(t[n],e);else zo(t,e)}
- // Register built-in shapes. These shapes might be overwritten
- // by users, although we do not recommend that.
- mo("circle",O),mo("ellipse",R),mo("sector",E),mo("ring",V),mo("polygon",z),mo("polyline",B),mo("rect",G),mo("line",F),mo("bezierCurve",W),mo("arc",H);const Go=Object.freeze(Object.defineProperty({__proto__:null,Arc:H,BezierCurve:W,BoundingRect:Y,Circle:O,CompoundPath:U,Ellipse:R,Group:Z,Image:b,IncrementalDisplayable:X,Line:F,LinearGradient:j,OrientedBoundingRect:q,Path:g,Point:K,Polygon:z,Polyline:B,RadialGradient:J,Rect:G,Ring:V,Sector:E,Text:$,applyTransform:To,clipPointsByRect:ko,clipRectByRect:Po,createIcon:No,extendPath:yo,extendShape:fo,getShapeClass:vo,getTransform:Do,groupTransition:Lo,initProps:oo,isElementRemoved:ro,lineLineIntersect:Ro,linePolygonIntersect:Oo,makeImage:_o,makePath:xo,mergePath:So,registerShape:mo,removeElement:ao,removeElementWithFadeOut:lo,resizePath:wo,setTooltipConfig:Vo,subPixelOptimize:Io,subPixelOptimizeLine:Mo,subPixelOptimizeRect:function(t){return C(t.shape,t.shape,t.style),t},transformDirection:Co,traverseElements:Bo,updateProps:io},Symbol.toStringTag,{value:"Module"}));var Fo={};function Wo(t,e){for(var n=0;n<li.length;n++){var i=li[n],o=e[i],r=t.ensureState(i);r.style=r.style||{},r.style.text=o}var a=t.currentStates.slice();t.clearStates(!0),t.setStyle({text:e.normal}),t.useStates(a,!0)}function Ho(t,e,n){var i,o=t.labelFetcher,r=t.labelDataIndex,a=t.labelDimIndex,s=e.normal;o&&(i=o.getFormattedLabel(r,"normal",null,a,s&&s.get("formatter"),null!=n?{interpolatedValue:n}:null)),null==i&&(i=f(t.defaultText)?t.defaultText(r,t,n):t.defaultText);for(var l={normal:i},u=0;u<li.length;u++){var c=li[u],d=e[c];l[c]=x(o?o.getFormattedLabel(r,c,null,a,d&&d.get("formatter")):null,i)}return l}function Yo(t,e,n,i){n=n||Fo;for(var o=t instanceof $,r=!1,a=0;a<ui.length;a++){if((h=e[ui[a]])&&h.getShallow("show")){r=!0;break}}var s=o?t:t.getTextContent();if(r){o||(
- // Reuse the previous
- s||(s=new $,t.setTextContent(s)),
- // Use same state proxy
- t.stateProxy&&(s.stateProxy=t.stateProxy));var l=Ho(n,e),u=e.normal,c=!!u.getShallow("show"),d=Zo(u,i&&i.normal,n,!1,!o);d.text=l.normal,o||
- // Always create new
- t.setTextConfig(Xo(u,n,!1));for(a=0;a<li.length;a++){var h,p=li[a];if(h=e[p]){var f=s.ensureState(p),g=!!x(h.getShallow("show"),c);if(g!==c&&(f.ignore=!g),f.style=Zo(h,i&&i[p],n,!0,!o),f.style.text=l[p],!o)t.ensureState(p).textConfig=Xo(h,n,!0)}}
- // PENDING: if there is many requirements that emphasis position
- // need to be different from normal position, we might consider
- // auto silent is those cases.
- s.silent=!!u.getShallow("silent"),
- // Keep x and y
- null!=s.style.x&&(d.x=s.style.x),null!=s.style.y&&(d.y=s.style.y),s.ignore=!c,
- // Always create new style.
- s.useStyle(d),s.dirty(),n.enableTextSetter&&(Qo(s).setLabelText=function(t){var i=Ho(n,e,t);Wo(s,i)})}else s&&(
- // Not display rich text.
- s.ignore=!0);t.dirty()}function Uo(t,e){e=e||"label";for(var n={normal:t.getModel(e)},i=0;i<li.length;i++){var o=li[i];n[o]=t.getModel([o,e])}return n}
- /**
- * Set basic textStyle properties.
- */function Zo(t,e,
- // Fixed style in the code. Can't be set by model.
- n,i,o){var r={};
- // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);
- /**
- * The uniform entry of set text style, that is, retrieve style definitions
- * from `model` and set to `textStyle` object.
- *
- * Never in merge mode, but in overwrite mode, that is, all of the text style
- * properties will be set. (Consider the states of normal and emphasis and
- * default value can be adopted, merge would make the logic too complicated
- * to manage.)
- */
- return function(t,e,n,i,o){
- // Consider there will be abnormal when merge hover style to normal style if given default value.
- n=n||Fo;var r,a=e.ecModel,s=a&&a.option.textStyle,l=
- // Consider case:
- // {
- // data: [{
- // value: 12,
- // label: {
- // rich: {
- // // no 'a' here but using parent 'a'.
- // }
- // }
- // }],
- // rich: {
- // a: { ... }
- // }
- // }
- // TODO TextStyleModel
- function(t){
- // Use object to remove duplicated names.
- var e;for(;t&&t!==t.ecModel;){var n=(t.option||Fo).rich;if(n){e=e||{};for(var i=v(n),o=0;o<i.length;o++){e[i[o]]=1}}t=t.parentModel}return e}(e);if(l)for(var u in r={},l)if(l.hasOwnProperty(u)){
- // Cascade is supported in rich.
- var c=e.getModel(["rich",u]);
- // In rich, never `disableBox`.
- // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`,
- // the default color `'blue'` will not be adopted if no color declared in `rich`.
- // That might confuses users. So probably we should put `textStyleModel` as the
- // root ancestor of the `richTextStyle`. But that would be a break change.
- Jo(r[u]={},c,s,n,i,o,!1,!0)}r&&(t.rich=r);var d=e.get("overflow");d&&(t.overflow=d);var h=e.get("minMargin");null!=h&&(t.margin=h);Jo(t,e,s,n,i,o,!0,!1)}(r,t,n,i,o),e&&p(r,e),r}function Xo(t,e,n){e=e||{};var i,o={},r=t.getShallow("rotate"),a=x(t.getShallow("distance"),n?null:5),s=t.getShallow("offset");
- // 'outside' is not a valid zr textPostion value, but used
- // in bar series, and magric type should be considered.
- return"outside"===(i=t.getShallow("position")||(n?null:"inside"))&&(i=e.defaultOutsidePosition||"top"),null!=i&&(o.position=i),null!=s&&(o.offset=s),null!=r&&(r*=Math.PI/180,o.rotation=r),null!=a&&(o.distance=a),
- // fill and auto is determined by the color of path fill if it's not specified by developers.
- o.outsideFill="inherit"===t.get("color")?e.inheritColor||null:"auto",o}var jo=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],qo=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],Ko=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function Jo(t,e,n,i,o,r,a,s){
- // In merge mode, default value should not be given.
- n=!o&&n||Fo;var l=i&&i.inheritColor,u=e.getShallow("color"),c=e.getShallow("textBorderColor"),d=x(e.getShallow("opacity"),n.opacity);"inherit"!==u&&"auto"!==u||(u=l||null),"inherit"!==c&&"auto"!==c||(c=l||null),r||(
- // Only use default global textStyle.color if text is individual.
- // Otherwise it will use the strategy of attached text color because text may be on a path.
- u=u||n.color,c=c||n.textBorderColor),null!=u&&(t.fill=u),null!=c&&(t.stroke=c);var h=x(e.getShallow("textBorderWidth"),n.textBorderWidth);null!=h&&(t.lineWidth=h);var p=x(e.getShallow("textBorderType"),n.textBorderType);null!=p&&(t.lineDash=p);var f=x(e.getShallow("textBorderDashOffset"),n.textBorderDashOffset);null!=f&&(t.lineDashOffset=f),o||null!=d||s||(d=i&&i.defaultOpacity),null!=d&&(t.opacity=d),
- // TODO
- o||r||
- // Set default finally.
- null==t.fill&&i.inheritColor&&(t.fill=i.inheritColor);
- // Do not use `getFont` here, because merge should be supported, where
- // part of these properties may be changed in emphasis style, and the
- // others should remain their original value got from normal style.
- for(var g=0;g<jo.length;g++){var y=jo[g];null!=(v=x(e.getShallow(y),n[y]))&&(t[y]=v)}for(g=0;g<qo.length;g++){y=qo[g];null!=(v=e.getShallow(y))&&(t[y]=v)}if(null==t.verticalAlign){var m=e.getShallow("baseline");null!=m&&(t.verticalAlign=m)}if(!a||!i.disableBox){for(g=0;g<Ko.length;g++){var v;y=Ko[g];null!=(v=e.getShallow(y))&&(t[y]=v)}var _=e.getShallow("borderType");null!=_&&(t.borderDash=_),"auto"!==t.backgroundColor&&"inherit"!==t.backgroundColor||!l||(t.backgroundColor=l),"auto"!==t.borderColor&&"inherit"!==t.borderColor||!l||(t.borderColor=l)}}function $o(t,e){var n=e&&e.getModel("textStyle");return Q([
- // FIXME in node-canvas fontWeight is before fontStyle
- t.fontStyle||n&&n.getShallow("fontStyle")||"",t.fontWeight||n&&n.getShallow("fontWeight")||"",(t.fontSize||n&&n.getShallow("fontSize")||12)+"px",t.fontFamily||n&&n.getShallow("fontFamily")||"sans-serif"].join(" "))}var Qo=On();function tr(t,e,n,i){if(t){var o=Qo(t);o.prevValue=o.value,o.value=n;var r=e.normal;o.valueAnimation=r.get("valueAnimation"),o.valueAnimation&&(o.precision=r.get("precision"),o.defaultInterpolatedText=i,o.statesModels=e)}}function er(t,e,n,i,o){var r=Qo(t);if(r.valueAnimation&&r.prevValue!==r.value){var a=r.defaultInterpolatedText,s=x(r.interpolatedValue,r.prevValue),l=r.value;
- // Consider the case that being animating, do not use the `obj.value`,
- // Otherwise it will jump to the `obj.value` when this new animation started.
- t.percent=0,(null==r.prevValue?oo:io)(t,{
- // percent is used to prevent animation from being aborted #15916
- percent:1},i,e,null,(function(i){var u=Hn(n,r.precision,s,l,i);r.interpolatedValue=1===i?null:u;var c=Ho({labelDataIndex:e,labelFetcher:o,defaultText:a?a(u):u+""},r.statesModels,u);Wo(t,c)}))}}var nr=["textStyle","color"],ir=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],or=new $,rr=/** @class */function(){function t(){}
- /**
- * Get color property or get color from option.textStyle.color
- */
- // TODO Callback
- return t.prototype.getTextColor=function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(nr):null)},
- /**
- * Create font string from fontStyle, fontWeight, fontSize, fontFamily
- * @return {string}
- */
- t.prototype.getFont=function(){return $o({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(t){for(var e={text:t,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n<ir.length;n++)e[ir[n]]=this.getShallow(ir[n]);return or.useStyle(e),or.update(),or.getBoundingRect()},t}();const ar=rr;var sr,lr,ur=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],cr=Qn(ur),dr=/** @class */function(){function t(){}return t.prototype.getLineStyle=function(t){return cr(this,t)},t}(),hr=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],pr=Qn(hr),fr=/** @class */function(){function t(){}return t.prototype.getItemStyle=function(t,e){return pr(this,t,e)},t}(),gr=/** @class */function(){function t(t,e,n){this.parentModel=e,this.ecModel=n,this.option=t}return t.prototype.init=function(t,e,n){},
- /**
- * Merge the input option to me.
- */
- t.prototype.mergeOption=function(t,e){tt(this.option,t,!0)},
- // `path` can be 'a.b.c', so the return value type have to be `ModelOption`
- // TODO: TYPE strict key check?
- // get(path: string | string[], ignoreParent?: boolean): ModelOption;
- t.prototype.get=function(t,e){return null==t?this.option:this._doGet(this.parsePath(t),!e&&this.parentModel)},t.prototype.getShallow=function(t,e){var n=this.option,i=null==n?n:n[t];if(null==i&&!e){var o=this.parentModel;o&&(
- // FIXME:TS do not know how to make it works
- i=o.getShallow(t))}return i},
- // `path` can be 'a.b.c', so the return value type have to be `Model<ModelOption>`
- // getModel(path: string | string[], parentModel?: Model): Model;
- // TODO 'a.b.c' is deprecated
- t.prototype.getModel=function(e,n){var i=null!=e,o=i?this.parsePath(e):null;return new t(i?this._doGet(o):this.option,n=n||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(o)),this.ecModel)},
- /**
- * If model has option
- */
- t.prototype.isEmpty=function(){return null==this.option},t.prototype.restoreData=function(){},
- // Pending
- t.prototype.clone=function(){return new(0,this.constructor)(et(this.option))},
- // setReadOnly(properties): void {
- // clazzUtil.setReadOnly(this, properties);
- // }
- // If path is null/undefined, return null/undefined.
- t.prototype.parsePath=function(t){return"string"==typeof t?t.split("."):t},
- // Resolve path for parent. Perhaps useful when parent use a different property.
- // Default to be a identity resolver.
- // Can be modified to a different resolver.
- t.prototype.resolveParentPath=function(t){return t},
- // FIXME:TS check whether put this method here
- t.prototype.isAnimationEnabled=function(){if(!d.node&&this.option){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},t.prototype._doGet=function(t,e){var n=this.option;if(!t)return n;for(var i=0;i<t.length&&(!t[i]||null!=(
- // obj could be number/string/... (like 0)
- n=n&&"object"==typeof n?n[t[i]]:null));i++);return null==n&&e&&(n=e._doGet(this.resolveParentPath(t),e.parentModel)),n},t}();
- // Enable Model.extend.
- Xn(gr),sr=gr,lr=["__\0is_clz",qn++].join("_"),sr.prototype[lr]=!0,sr.isInstance=function(t){return!(!t||!t[lr])},nt(gr,dr),nt(gr,fr),nt(gr,ei),nt(gr,ar);const yr=gr;
- // A random offset
- var mr=Math.round(10*Math.random());
- /**
- * @public
- * @param {string} type
- * @return {string}
- */function vr(t){
- // Considering the case of crossing js context,
- // use Math.random to make id as unique as possible.
- return[t||"",mr++].join("_")}
- /**
- * Implements `SubTypeDefaulterManager` for `target`.
- */function xr(t,e){
- // See also `model/Component.ts#getDefaultOption`
- return tt(tt({},t,!0),e,!0)}
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * Language: English.
- */var _r="ZH",br="EN",Sr=br,wr={},Mr={},Ir=d.domSupported&&/* eslint-disable-next-line */(document.documentElement.lang||navigator.language||navigator.browserLanguage||Sr).toUpperCase().indexOf(_r)>-1?_r:Sr;function Dr(t,e){t=t.toUpperCase(),Mr[t]=new yr(e),wr[t]=e}
- // export function getLocale(locale: string) {
- // return localeStorage[locale];
- // }
- function Tr(t){return Mr[t]}
- // Default locale
- Dr(br,{time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}}),Dr(_r,{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},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:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var Cr=1e3,Ar=6e4,Lr=36e5,kr=864e5,Pr=31536e6,Nr={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},Or="{yyyy}-{MM}-{dd}",Rr={year:"{yyyy}",month:"{yyyy}-{MM}",day:Or,hour:Or+" "+Nr.hour,minute:Or+" "+Nr.minute,second:Or+" "+Nr.second,millisecond:Nr.none},Er=["year","month","day","hour","minute","second","millisecond"],Vr=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function zr(t,e){return"0000".substr(0,e-(t+="").length)+t}function Br(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:
- // year, minutes, second, milliseconds
- return t}}function Gr(t){return t===Br(t)}function Fr(
- // Note: The result based on `isUTC` are totally different, which can not be just simply
- // substituted by the result without `isUTC`. So we make the param `isUTC` mandatory.
- t,e,n,i){var o=sn(t),r=o[Yr(n)](),a=o[Ur(n)]()+1,s=Math.floor((a-1)/3)+1,l=o[Zr(n)](),u=o["get"+(n?"UTC":"")+"Day"](),c=o[Xr(n)](),d=(c-1)%12+1,h=o[jr(n)](),p=o[qr(n)](),f=o[Kr(n)](),g=c>=12?"pm":"am",y=g.toUpperCase(),m=(i instanceof yr?i:Tr(i||Ir)||Mr[Sr]).getModel("time"),v=m.get("month"),x=m.get("monthAbbr"),_=m.get("dayOfWeek"),b=m.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,g+"").replace(/{A}/g,y+"").replace(/{yyyy}/g,r+"").replace(/{yy}/g,zr(r%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,v[a-1]).replace(/{MMM}/g,x[a-1]).replace(/{MM}/g,zr(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,zr(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,_[u]).replace(/{ee}/g,b[u]).replace(/{e}/g,u+"").replace(/{HH}/g,zr(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,zr(d+"",2)).replace(/{h}/g,d+"").replace(/{mm}/g,zr(h,2)).replace(/{m}/g,h+"").replace(/{ss}/g,zr(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,zr(f,3)).replace(/{S}/g,f+"")}function Wr(t,e){var n=sn(t),i=n[Ur(e)]()+1,o=n[Zr(e)](),r=n[Xr(e)](),a=n[jr(e)](),s=n[qr(e)](),l=0===n[Kr(e)](),u=l&&0===s,c=u&&0===a,d=c&&0===r,h=d&&1===o;return h&&1===i?"year":h?"month":d?"day":c?"hour":u?"minute":l?"second":"millisecond"}function Hr(t,e,n){var i=l(t)?sn(t):t;switch(e=e||Wr(t,n)){case"year":return i[Yr(n)]();case"half-year":return i[Ur(n)]()>=6?1:0;case"quarter":return Math.floor((i[Ur(n)]()+1)/4);case"month":return i[Ur(n)]();case"day":return i[Zr(n)]();case"half-day":return i[Xr(n)]()/24;case"hour":return i[Xr(n)]();case"minute":return i[jr(n)]();case"second":return i[qr(n)]();case"millisecond":return i[Kr(n)]()}}function Yr(t){return t?"getUTCFullYear":"getFullYear"}function Ur(t){return t?"getUTCMonth":"getMonth"}function Zr(t){return t?"getUTCDate":"getDate"}function Xr(t){return t?"getUTCHours":"getHours"}function jr(t){return t?"getUTCMinutes":"getMinutes"}function qr(t){return t?"getUTCSeconds":"getSeconds"}function Kr(t){return t?"getUTCMilliseconds":"getMilliseconds"}function Jr(t){return t?"setUTCFullYear":"setFullYear"}function $r(t){return t?"setUTCMonth":"setMonth"}function Qr(t){return t?"setUTCDate":"setDate"}function ta(t){return t?"setUTCHours":"setHours"}function ea(t){return t?"setUTCMinutes":"setMinutes"}function na(t){return t?"setUTCSeconds":"setSeconds"}function ia(t){return t?"setUTCMilliseconds":"setMilliseconds"}
- /**
- * Add a comma each three digit.
- */
- function oa(e){if(!fn(e))return t(e)?e:"-";var n=(e+"").split(".");return n[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(n.length>1?"."+n[1]:"")}function ra(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}var aa=it;
- /**
- * Make value user readable for tooltip and label.
- * "User readable":
- * Try to not print programmer-specific text like NaN, Infinity, null, undefined.
- * Avoid to display an empty string, which users can not recognize there is
- * a value and it might look like a bug.
- */function sa(t,e,n){function i(t){return t&&Q(t)?t:"-"}function o(t){return!(null==t||isNaN(t)||!isFinite(t))}var r="time"===e,a=t instanceof Date;if(r||a){var s=r?sn(t):t;if(!isNaN(+s))return Fr(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);
- // In other cases, continue to try to display the value in the following code.
- if(a)return"-"}if("ordinal"===e)return u(t)?i(t):l(t)&&o(t)?t+"":"-";
- // By default.
- var c=pn(t);return o(c)?oa(c):u(t)?i(t):"boolean"==typeof t?t+"":"-"}var la=["a","b","c","d","e","f","g"],ua=function(t,e){return"{"+t+(null==e?"":e)+"}"};
- /**
- * Template formatter
- * @param {Array.<Object>|Object} paramsList
- */
- function ca(t,e,n){i(e)||(e=[e]);var o=e.length;if(!o)return"";for(var r=e[0].$vars||[],a=0;a<r.length;a++){var s=la[a];t=t.replace(ua(s),ua(s,0))}for(var l=0;l<o;l++)for(var u=0;u<r.length;u++){var c=e[l][r[u]];t=t.replace(ua(la[u],l),n?ot(c):c)}return t}
- /**
- * simple Template formatter
- */function da(e,n){var i=t(e)?{color:e,extraCssText:n}:e||{},o=i.color,r=i.type;n=i.extraCssText;var a=i.renderMode||"html";return o?"html"===a?"subItem"===r?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+ot(o)+";"+(n||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+ot(o)+";"+(n||"")+'"></span>':{renderMode:a,content:"{"+(i.markerId||"markerX")+"|} ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:o}:{width:10,height:10,borderRadius:5,backgroundColor:o}}:""}
- /**
- * @deprecated Use `time/format` instead.
- * ISO Date format
- * @param {string} tpl
- * @param {number} value
- * @param {boolean} [isUTC=false] Default in local time.
- * see `module:echarts/scale/Time`
- * and `module:echarts/util/number#parseDate`.
- * @inner
- */
- /**
- * @return Never be null/undefined.
- */
- function ha(e,n){return n=n||"transparent",t(e)?e:o(e)&&e.colorStops&&(e.colorStops[0]||{}).color||n}
- /**
- * open new tab
- * @param link url
- * @param target blank or self
- */function pa(t,e){
- /* global window */
- if("_blank"===e||"blank"===e){var n=window.open();n.opener=null,n.location.href=t}else window.open(t,e)}var fa=a,ga=["left","right","top","bottom","width","height"],ya=[["width","left","right"],["height","top","bottom"]];
- /**
- * @public
- */function ma(t,e,n,i,o){var r=0,a=0;null==i&&(i=Infinity),null==o&&(o=Infinity);var s=0;e.eachChild((function(l,u){var c,d,h=l.getBoundingRect(),p=e.childAt(u+1),f=p&&p.getBoundingRect();if("horizontal"===t){var g=h.width+(f?-f.x+h.x:0);
- // Wrap when width exceeds maxWidth or meet a `newline` group
- // FIXME compare before adding gap?
- (c=r+g)>i||l.newline?(r=0,c=g,a+=s+n,s=h.height):
- // FIXME: consider rect.y is not `0`?
- s=Math.max(s,h.height)}else{var y=h.height+(f?-f.y+h.y:0);
- // Wrap when width exceeds maxHeight or meet a `newline` group
- (d=a+y)>o||l.newline?(r+=s+n,a=0,d=y,s=h.width):s=Math.max(s,h.width)}l.newline||(l.x=r,l.y=a,l.markRedraw(),"horizontal"===t?r=c+n:a=d+n)}))}
- /**
- * VBox or HBox layouting
- * @param {string} orient
- * @param {module:zrender/graphic/Group} group
- * @param {number} gap
- * @param {number} [width=Infinity]
- * @param {number} [height=Infinity]
- */var va=ma;
- /**
- * VBox layouting
- * @param {module:zrender/graphic/Group} group
- * @param {number} gap
- * @param {number} [width=Infinity]
- * @param {number} [height=Infinity]
- */
- /**
- * Parse position info.
- */
- function xa(t,e,n){n=aa(n||0);var i=e.width,o=e.height,r=je(t.left,i),a=je(t.top,o),s=je(t.right,i),l=je(t.bottom,o),u=je(t.width,i),c=je(t.height,o),d=n[2]+n[0],h=n[1]+n[3],p=t.aspect;
- // Align left and top
- switch(
- // If width is not specified, calculate width from left and right
- isNaN(u)&&(u=i-s-h-r),isNaN(c)&&(c=o-l-d-a),null!=p&&(
- // If width and height are not given
- // 1. Graph should not exceeds the container
- // 2. Aspect must be keeped
- // 3. Graph should take the space as more as possible
- // FIXME
- // Margin is not considered, because there is no case that both
- // using margin and aspect so far.
- isNaN(u)&&isNaN(c)&&(p>i/o?u=.8*i:c=.8*o),
- // Calculate width or height with given aspect
- isNaN(u)&&(u=p*c),isNaN(c)&&(c=u/p)),
- // If left is not specified, calculate left from right and width
- isNaN(r)&&(r=i-s-u-h),isNaN(a)&&(a=o-l-c-d),t.left||t.right){case"center":r=i/2-u/2-n[3];break;case"right":r=i-u-h}switch(t.top||t.bottom){case"middle":case"center":a=o/2-c/2-n[0];break;case"bottom":a=o-c-d}
- // If something is wrong and left, top, width, height are calculated as NaN
- r=r||0,a=a||0,isNaN(u)&&(
- // Width may be NaN if only one value is given except width
- u=i-h-r-(s||0)),isNaN(c)&&(
- // Height may be NaN if only one value is given except height
- c=o-d-a-(l||0));var f=new Y(r+n[3],a+n[0],u,c);return f.margin=n,f}
- /**
- * Position a zr element in viewport
- * Group position is specified by either
- * {left, top}, {right, bottom}
- * If all properties exists, right and bottom will be igonred.
- *
- * Logic:
- * 1. Scale (against origin point in parent coord)
- * 2. Rotate (against origin point in parent coord)
- * 3. Translate (with el.position by this method)
- * So this method only fixes the last step 'Translate', which does not affect
- * scaling and rotating.
- *
- * If be called repeatedly with the same input el, the same result will be gotten.
- *
- * Return true if the layout happened.
- *
- * @param el Should have `getBoundingRect` method.
- * @param positionInfo
- * @param positionInfo.left
- * @param positionInfo.top
- * @param positionInfo.right
- * @param positionInfo.bottom
- * @param positionInfo.width Only for opt.boundingModel: 'raw'
- * @param positionInfo.height Only for opt.boundingModel: 'raw'
- * @param containerRect
- * @param margin
- * @param opt
- * @param opt.hv Only horizontal or only vertical. Default to be [1, 1]
- * @param opt.boundingMode
- * Specify how to calculate boundingRect when locating.
- * 'all': Position the boundingRect that is transformed and uioned
- * both itself and its descendants.
- * This mode simplies confine the elements in the bounding
- * of their container (e.g., using 'right: 0').
- * 'raw': Position the boundingRect that is not transformed and only itself.
- * This mode is useful when you want a element can overflow its
- * container. (Consider a rotated circle needs to be located in a corner.)
- * In this mode positionInfo.width/height can only be number.
- */function _a(t,e,n,i,o,r){var a,s=!o||!o.hv||o.hv[0],l=!o||!o.hv||o.hv[1],u=o&&o.boundingMode||"all";if((r=r||t).x=t.x,r.y=t.y,!s&&!l)return!1;if("raw"===u)a="group"===t.type?new Y(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(a=t.getBoundingRect(),t.needLocalTransform()){var c=t.getLocalTransform();
- // Notice: raw rect may be inner object of el,
- // which should not be modified.
- (a=a.clone()).applyTransform(c)}
- // The real width and height can not be specified but calculated by the given el.
- var d=xa(I({width:a.width,height:a.height},e),n,i),h=s?d.x-a.x:0,p=l?d.y-a.y:0;
- // Because 'tranlate' is the last step in transform
- // (see zrender/core/Transformable#getLocalTransform),
- // we can just only modify el.position to get final result.
- return"raw"===u?(r.x=h,r.y=p):(r.x+=h,r.y+=p),r===t&&t.markRedraw(),!0}
- /**
- * @param option Contains some of the properties in HV_NAMES.
- * @param hvIdx 0: horizontal; 1: vertical.
- */function ba(t){var e=t.layoutMode||t.constructor.layoutMode;return o(e)?e:e?{type:e}:null}
- /**
- * Consider Case:
- * When default option has {left: 0, width: 100}, and we set {right: 0}
- * through setOption or media query, using normal zrUtil.merge will cause
- * {right: 0} does not take effect.
- *
- * @example
- * ComponentModel.extend({
- * init: function () {
- * ...
- * let inputPositionParams = layout.getLayoutParams(option);
- * this.mergeOption(inputPositionParams);
- * },
- * mergeOption: function (newOption) {
- * newOption && zrUtil.merge(thisOption, newOption, true);
- * layout.mergeLayoutParam(thisOption, newOption);
- * }
- * });
- *
- * @param targetOption
- * @param newOption
- * @param opt
- */function Sa(t,e,n){var o=n&&n.ignoreSize;!i(o)&&(o=[o,o]);var r=s(ya[0],0),a=s(ya[1],1);function s(n,i){var r={},a=0,s={},c=0;if(fa(n,(function(e){s[e]=t[e]})),fa(n,(function(t){
- // Consider case: newOption.width is null, which is
- // set by user for removing width setting.
- l(e,t)&&(r[t]=s[t]=e[t]),u(r,t)&&a++,u(s,t)&&c++})),o[i])
- // Only one of left/right is premitted to exist.
- return u(e,n[1])?s[n[2]]=null:u(e,n[2])&&(s[n[1]]=null),s;
- // Case: newOption: {width: ..., right: ...},
- // or targetOption: {right: ...} and newOption: {width: ...},
- // There is no conflict when merged only has params count
- // little than enoughParamNumber.
- if(2!==c&&a){if(a>=2)return r;
- // Chose another param from targetOption by priority.
- for(var d=0;d<n.length;d++){var h=n[d];if(!l(r,h)&&l(t,h)){r[h]=t[h];break}}return r}return s}function l(t,e){return t.hasOwnProperty(e)}function u(t,e){return null!=t[e]&&"auto"!==t[e]}function c(t,e,n){fa(t,(function(t){e[t]=n[t]}))}c(ya[0],t,r),c(ya[1],t,a)}
- /**
- * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.
- */function wa(t){return Ma({},t)}
- /**
- * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.
- * @param {Object} source
- * @return {Object} Result contains those props.
- */function Ma(t,e){return e&&t&&fa(ga,(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}rt(ma,"vertical"),
- /**
- * HBox layouting
- * @param {module:zrender/graphic/Group} group
- * @param {number} gap
- * @param {number} [width=Infinity]
- * @param {number} [height=Infinity]
- */
- rt(ma,"horizontal");var Ia=On(),Da=/** @class */function(t){function e(e,n,i){var o=t.call(this,e,n,i)||this;return o.uid=vr("ec_cpt_model"),o}return Ue(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},e.prototype.mergeDefaultAndTheme=function(t,e){var n=ba(this),i=n?wa(t):{},o=e.getTheme();tt(t,o.get(this.mainType)),tt(t,this.getDefaultOption()),n&&Sa(t,i,n)},e.prototype.mergeOption=function(t,e){tt(this.option,t,!0);var n=ba(this);n&&Sa(this.option,t,n)},
- /**
- * Called immediately after `init` or `mergeOption` of this instance called.
- */
- e.prototype.optionUpdated=function(t,e){},
- /**
- * [How to declare defaultOption]:
- *
- * (A) If using class declaration in typescript (since echarts 5):
- * ```ts
- * import {ComponentOption} from '../model/option.js';
- * export interface XxxOption extends ComponentOption {
- * aaa: number
- * }
- * export class XxxModel extends Component {
- * static type = 'xxx';
- * static defaultOption: XxxOption = {
- * aaa: 123
- * }
- * }
- * Component.registerClass(XxxModel);
- * ```
- * ```ts
- * import {inheritDefaultOption} from '../util/component.js';
- * import {XxxModel, XxxOption} from './XxxModel.js';
- * export interface XxxSubOption extends XxxOption {
- * bbb: number
- * }
- * class XxxSubModel extends XxxModel {
- * static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, {
- * bbb: 456
- * })
- * fn() {
- * let opt = this.getDefaultOption();
- * // opt is {aaa: 123, bbb: 456}
- * }
- * }
- * ```
- *
- * (B) If using class extend (previous approach in echarts 3 & 4):
- * ```js
- * let XxxComponent = Component.extend({
- * defaultOption: {
- * xx: 123
- * }
- * })
- * ```
- * ```js
- * let XxxSubComponent = XxxComponent.extend({
- * defaultOption: {
- * yy: 456
- * },
- * fn: function () {
- * let opt = this.getDefaultOption();
- * // opt is {xx: 123, yy: 456}
- * }
- * })
- * ```
- */
- e.prototype.getDefaultOption=function(){var t=this.constructor;
- // If using class declaration, it is different to travel super class
- // in legacy env and auto merge defaultOption. So if using class
- // declaration, defaultOption should be merged manually.
- if(!function(t){return!(!t||!t[Un])}(t))
- // When using ts class, defaultOption must be declared as static.
- return t.defaultOption;
- // FIXME: remove this approach?
- var e=Ia(this);if(!e.defaultOption){for(var n=[],i=t;i;){var o=i.prototype.defaultOption;o&&n.push(o),i=i.superClass}for(var r={},a=n.length-1;a>=0;a--)r=tt(r,n[a],!0);e.defaultOption=r}return e.defaultOption},
- /**
- * Notice: always force to input param `useDefault` in case that forget to consider it.
- * The same behavior as `modelUtil.parseFinder`.
- *
- * @param useDefault In many cases like series refer axis and axis refer grid,
- * If axis index / axis id not specified, use the first target as default.
- * In other cases like dataZoom refer axis, if not specified, measn no refer.
- */
- e.prototype.getReferringComponents=function(t,e){var n=t+"Index",i=t+"Id";return Gn(this.ecModel,t,{index:this.get(n,!0),id:this.get(i,!0)},e)},e.prototype.getBoxLayoutParams=function(){
- // Consider itself having box layout configs.
- var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},
- /**
- * Get key for zlevel.
- * If developers don't configure zlevel. We will assign zlevel to series based on the key.
- * For example, lines with trail effect and progressive series will in an individual zlevel.
- */
- e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(yr);jn(Da,yr),$n(Da),function(t){var e={};t.registerSubTypeDefaulter=function(t,n){var i=Zn(t);e[i.main]=n},t.determineSubType=function(n,i){var o=i.type;if(!o){var r=Zn(n).main;t.hasSubTypes(n)&&e[r]&&(o=e[r](i))}return o}}
- /**
- * Implements `TopologicalTravelable<any>` for `entity`.
- *
- * Topological travel on Activity Network (Activity On Vertices).
- * Dependencies is defined in Model.prototype.dependencies, like ['xAxis', 'yAxis'].
- * If 'xAxis' or 'yAxis' is absent in componentTypeList, just ignore it in topology.
- * If there is circular dependencey, Error will be thrown.
- */(Da),function(t,e){function n(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}
- /**
- * @param targetNameList Target Component type list.
- * Can be ['aa', 'bb', 'aa.xx']
- * @param fullNameList By which we can build dependency graph.
- * @param callback Params: componentType, dependencies.
- * @param context Scope of callback.
- */
- t.topologicalTravel=function(t,i,o,r){if(t.length){var s=function(t){var i={},o=[];return a(t,(function(r){var s=n(i,r),l=function(t,e){var n=[];return a(t,(function(t){c(e,t)>=0&&n.push(t)})),n}(s.originalDeps=e(r),t);s.entryCount=l.length,0===s.entryCount&&o.push(r),a(l,(function(t){c(s.predecessor,t)<0&&s.predecessor.push(t);var e=n(i,t);c(e.successor,t)<0&&e.successor.push(r)}))})),{graph:i,noEntryList:o}}(i),l=s.graph,u=s.noEntryList,d={};for(a(t,(function(t){d[t]=!0}));u.length;){var h=u.pop(),p=l[h],f=!!d[h];f&&(o.call(r,h,p.originalDeps.slice()),delete d[h]),a(p.successor,f?y:g)}a(d,(function(){throw new Error("")}))}function g(t){l[t].entryCount--,0===l[t].entryCount&&u.push(t)}
- // Consider this case: legend depends on series, and we call
- // chart.setOption({series: [...]}), where only series is in option.
- // If we do not have 'removeEdgeAndAdd', legendModel.mergeOption will
- // not be called, but only sereis.mergeOption is called. Thus legend
- // have no chance to update its local record about series (like which
- // name of series is available in legend).
- function y(t){d[t]=!0,g(t)}}}(Da,(function(t){var e=[];
- // Hack dataset for convenience.
- a(Da.getClassesByMainType(t),(function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])})),
- // Ensure main type.
- e=n(e,(function(t){return Zn(t).main})),"dataset"!==t&&c(e,"dataset")<=0&&e.unshift("dataset");return e}));const Ta=Da;
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */var Ca="";
- // Navigator not exists in node
- "undefined"!=typeof navigator&&(
- /* global navigator */
- Ca=navigator.platform||"");var Aa="rgba(0, 0, 0, 0.2)";const La={darkMode:"auto",
- // backgroundColor: 'rgba(0,0,0,0)',
- colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Aa,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Aa,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Aa,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Aa,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Aa,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Aa,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},
- // If xAxis and yAxis declared, grid is created by default.
- // grid: {},
- textStyle:{
- // color: '#000',
- // decoration: 'none',
- // PENDING
- fontFamily:Ca.match(/^Win/)?"Microsoft YaHei":"sans-serif",
- // fontFamily: 'Arial, Verdana, sans-serif',
- fontSize:12,fontStyle:"normal",fontWeight:"normal"},
- // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/
- // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
- // Default is source-over
- blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,
- // Configuration for progressive/incremental rendering
- progressiveThreshold:3e3,progressive:400,
- // Threshold of if use single hover layer to optimize.
- // It is recommended that `hoverLayerThreshold` is equivalent to or less than
- // `progressiveThreshold`, otherwise hover will cause restart of progressive,
- // which is unexpected.
- // see example <echarts/test/heatmap-large.html>.
- hoverLayerThreshold:3e3,
- // See: module:echarts/scale/Time
- useUTC:!1};var ka=r(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Pa="original",Na="arrayRows",Oa="objectRows",Ra="keyedColumns",Ea="typedArray",Va="unknown",za="column",Ba="row",Ga=1,Fa=2,Wa=3,Ha=On();
- /**
- * [The strategy of the arrengment of data dimensions for dataset]:
- * "value way": all axes are non-category axes. So series one by one take
- * several (the number is coordSysDims.length) dimensions from dataset.
- * The result of data arrengment of data dimensions like:
- * | ser0_x | ser0_y | ser1_x | ser1_y | ser2_x | ser2_y |
- * "category way": at least one axis is category axis. So the the first data
- * dimension is always mapped to the first category axis and shared by
- * all of the series. The other data dimensions are taken by series like
- * "value way" does.
- * The result of data arrengment of data dimensions like:
- * | ser_shared_x | ser0_y | ser1_y | ser2_y |
- *
- * @return encode Never be `null/undefined`.
- */
- function Ya(t,e,n){var i={},r=Za(e);
- // Currently only make default when using dataset, util more reqirements occur.
- if(!r||!t)return i;var s,l,u=[],c=[],d=e.ecModel,h=Ha(d).datasetMap,p=r.uid+"_"+n.seriesLayoutBy;t=t.slice(),a(t,(function(e,n){var r=o(e)?e:t[n]={name:e};"ordinal"===r.type&&null==s&&(s=n,l=y(r)),i[r.name]=[]}));var f=h.get(p)||h.set(p,{categoryWayDim:l,valueWayDim:0});
- // TODO
- // Auto detect first time axis and do arrangement.
- function g(t,e,n){for(var i=0;i<n;i++)t.push(e+i)}function y(t){var e=t.dimsDef;return e?e.length:1}return a(t,(function(t,e){var n=t.name,o=y(t);
- // In value way.
- if(null==s){var r=f.valueWayDim;g(i[n],r,o),g(c,r,o),f.valueWayDim+=o}
- // In category way, the first category axis.
- else if(s===e)g(i[n],0,o),g(u,0,o);else{r=f.categoryWayDim;g(i[n],r,o),g(c,r,o),f.categoryWayDim+=o}})),u.length&&(i.itemName=u),c.length&&(i.seriesName=c),i}
- /**
- * Work for data like [{name: ..., value: ...}, ...].
- *
- * @return encode Never be `null/undefined`.
- */function Ua(t,e,n){var i={};
- // Currently only make default when using dataset, util more reqirements occur.
- if(!Za(t))return i;var r,s=e.sourceFormat,l=e.dimensionsDefine;s!==Oa&&s!==Ra||a(l,(function(t,e){"name"===(o(t)?t.name:t)&&(r=e)}));var u=function(){
- // 5 is an experience value.
- for(var t={},i={},o=[],a=0,u=Math.min(5,n);a<u;a++){var c=ja(e.data,s,e.seriesLayoutBy,l,e.startIndex,a);o.push(c);var d=c===Wa;
- // [Strategy of idxRes0]: find the first BE_ORDINAL.Not as the value dim,
- // and then find a name dim with the priority:
- // "BE_ORDINAL.Might|BE_ORDINAL.Must" > "other dim" > "the value dim itself".
- if(d&&null==t.v&&a!==r&&(t.v=a),(null==t.n||t.n===t.v||!d&&o[t.n]===Wa)&&(t.n=a),h(t)&&o[t.n]!==Wa)return t;
- // [Strategy of idxRes1]: if idxRes0 not satisfied (that is, no BE_ORDINAL.Not),
- // find the first BE_ORDINAL.Might as the value dim,
- // and then find a name dim with the priority:
- // "other dim" > "the value dim itself".
- // That is for backward compat: number-like (e.g., `'3'`, `'55'`) can be
- // treated as number.
- d||(c===Fa&&null==i.v&&a!==r&&(i.v=a),null!=i.n&&i.n!==i.v||(i.n=a))}function h(t){return null!=t.v&&null!=t.n}return h(t)?t:h(i)?i:null}();if(u){i.value=[u.v];
- // `potentialNameDimIndex` has highest priority.
- var c=null!=r?r:u.n;
- // By default, label uses itemName in charts.
- // So we don't set encodeLabel here.
- i.itemName=[c],i.seriesName=[c]}return i}
- /**
- * @return If return null/undefined, indicate that should not use datasetModel.
- */function Za(t){if(!t.get("data",!0))return Gn(t.ecModel,"dataset",{index:t.get("datasetIndex",!0),id:t.get("datasetId",!0)},zn).models[0]}
- /**
- * @return Always return an array event empty.
- */
- /**
- * The rule should not be complex, otherwise user might not
- * be able to known where the data is wrong.
- * The code is ugly, but how to make it neat?
- */
- function Xa(t,e){return ja(t.data,t.sourceFormat,t.seriesLayoutBy,t.dimensionsDefine,t.startIndex,e)}
- // dimIndex may be overflow source data.
- // return {BE_ORDINAL}
- function ja(e,n,r,a,s,l){var u,c,d;
- // Experience value.
- if(at(e))return Wa;
- // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine
- // always exists in source.
- if(a){var h=a[l];o(h)?(c=h.name,d=h.type):t(h)&&(c=h)}if(null!=d)return"ordinal"===d?Ga:Wa;if(n===Na){var p=e;if(r===Ba){for(var f=p[l],g=0;g<(f||[]).length&&g<5;g++)if(null!=(u=b(f[s+g])))return u}else for(g=0;g<p.length&&g<5;g++){var y=p[s+g];if(y&&null!=(u=b(y[l])))return u}}else if(n===Oa){var m=e;if(!c)return Wa;for(g=0;g<m.length&&g<5;g++){if((x=m[g])&&null!=(u=b(x[c])))return u}}else if(n===Ra){if(!c)return Wa;if(!(f=e[c])||at(f))return Wa;for(g=0;g<f.length&&g<5;g++)if(null!=(u=b(f[g])))return u}else if(n===Pa){var v=e;for(g=0;g<v.length&&g<5;g++){var x,_=In(x=v[g]);if(!i(_))return Wa;if(null!=(u=b(_[l])))return u}}function b(e){var n=t(e);
- // Consider usage convenience, '1', '2' will be treated as "number".
- // `Number('')` (or any whitespace) is `0`.
- return null!=e&&Number.isFinite(Number(e))&&""!==e?n?Fa:Wa:n&&"-"!==e?Ga:void 0}return Wa}var qa=r();var Ka,Ja,$a,Qa=On(),ts=On(),es=/** @class */function(){function t(){}return t.prototype.getColorFromPalette=function(t,e,n){var i=Sn(this.get("color",!0)),o=this.get("colorLayer",!0);return is(this,Qa,i,o,t,e,n)},t.prototype.clearColorPalette=function(){!function(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}
- // -----------------------
- // Internal method names:
- // -----------------------
- (this,Qa)},t}();function ns(t,e,n,i){var o=Sn(t.get(["aria","decal","decals"]));return is(t,ts,o,null,e,n,i)}
- /**
- * @param name MUST NOT be null/undefined. Otherwise call this function
- * twise with the same parameters will get different result.
- * @param scope default this.
- * @return Can be null/undefined
- */
- function is(t,e,n,i,o,r,a){var s=e(r=r||t),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};
- // Use `hasOwnProperty` to avoid conflict with Object.prototype.
- if(u.hasOwnProperty(o))return u[o];var c=null!=a&&i?function(t,e){
- // TODO palettes must be in order
- for(var n=t.length,i=0;i<n;i++)if(t[i].length>e)return t[i];return t[n-1]}(i,a):n;
- // In case can't find in layered color palette.
- if((c=c||n)&&c.length){var d=c[l];return o&&(u[o]=d),s.paletteIdx=(l+1)%c.length,d}}var os="\0_ec_inner",rs=/** @class */function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Ue(n,e),n.prototype.init=function(t,e,n,i,o,r){i=i||{},this.option=null,// Mark as not initialized.
- this._theme=new yr(i),this._locale=new yr(o),this._optionManager=r},n.prototype.setOption=function(t,e,n){var i=ls(e);this._optionManager.setOption(t,n,i),this._resetOption(null,i)},
- /**
- * @param type null/undefined: reset all.
- * 'recreate': force recreate all.
- * 'timeline': only reset timeline option
- * 'media': only reset media query option
- * @return Whether option changed.
- */
- n.prototype.resetOption=function(t,e){return this._resetOption(t,ls(e))},n.prototype._resetOption=function(t,e){var n=!1,i=this._optionManager;if(!t||"recreate"===t){var o=i.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(o,e)):$a(this,o),n=!0}
- // By design, if `setOption(option2)` at the second time, and `option2` is a `ECUnitOption`,
- // it should better not have the same props with `MediaUnit['option']`.
- // Because either `option2` or `MediaUnit['option']` will be always merged to "current option"
- // rather than original "baseOption". If they both override a prop, the result might be
- // unexpected when media state changed after `setOption` called.
- // If we really need to modify a props in each `MediaUnit['option']`, use the full version
- // (`{baseOption, media}`) in `setOption`.
- // For `timeline`, the case is the same.
- if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var r=i.getTimelineOption(this);r&&(n=!0,this._mergeOption(r,e))}if(!t||"recreate"===t||"media"===t){var s=i.getMediaOption(this);s.length&&a(s,(function(t){n=!0,this._mergeOption(t,e)}),this)}return n},n.prototype.mergeOption=function(t){this._mergeOption(t,null)},n.prototype._mergeOption=function(t,e){var n=this.option,i=this._componentsMap,s=this._componentsCount,l=[],u=r(),c=e&&e.replaceMergeMainTypeMap;
- // `datasetMap` is used to make default encode.
- Ha(this).datasetMap=r(),
- // If no component class, merge directly.
- // For example: color, animaiton options, etc.
- a(t,(function(t,e){null!=t&&(Ta.hasClass(e)?e&&(l.push(e),u.set(e,!0)):
- // globalSettingTask.dirty();
- n[e]=null==n[e]?et(t):tt(n[e],t,!0))})),c&&
- // If there is a mainType `xxx` in `replaceMerge` but not declared in option,
- // we trade it as it is declared in option as `{xxx: []}`. Because:
- // (1) for normal merge, `{xxx: null/undefined}` are the same meaning as `{xxx: []}`.
- // (2) some preprocessor may convert some of `{xxx: null/undefined}` to `{xxx: []}`.
- c.each((function(t,e){Ta.hasClass(e)&&!u.get(e)&&(l.push(e),u.set(e,!0))})),Ta.topologicalTravel(l,Ta.getAllClassMainTypes(),(function(e){var r=function(t,e,n){var i=qa.get(e);if(!i)return n;var o=i(t);return o?n.concat(o):n}(this,e,Sn(t[e])),l=i.get(e),u=
- // `!oldCmptList` means init. See the comment in `mappingToExists`
- l?c&&c.get(e)?"replaceMerge":"normalMerge":"replaceAll",d=Tn(l,r,u);
- // Set mainType and complete subType.
- (function(t,e,n){
- // Set mainType and complete subType.
- a(t,(function(t){var i=t.newOption;o(i)&&(t.keyInfo.mainType=e,t.keyInfo.subType=function(t,e,n,i){
- // tooltip, markline, markpoint may always has no subType
- return e.type?e.type:n?n.subType:i.determineSubType(t,e)}
- /**
- * A helper for removing duplicate items between batchA and batchB,
- * and in themselves, and categorize by series.
- *
- * @param batchA Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]
- * @param batchB Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]
- * @return result: [resultBatchA, resultBatchB]
- */(e,i,t.existing,n))}))})(d,e,Ta),
- // Empty it before the travel, in order to prevent `this._componentsMap`
- // from being used in the `init`/`mergeOption`/`optionUpdated` of some
- // components, which is probably incorrect logic.
- n[e]=null,i.set(e,null),s.set(e,0);var h,f=[],g=[],y=0;
- // Backup series for filtering.
- a(d,(function(t,n){var i=t.existing,o=t.newOption;if(o){var r="series"===e,a=Ta.getClass(e,t.keyInfo.subType,!r);if(!a)return;
- // TODO Before multiple tooltips get supported, we do this check to avoid unexpected exception.
- if("tooltip"===e){if(h)return;h=!0}if(i&&i.constructor===a)i.name=t.keyInfo.name,
- // componentModel.settingTask && componentModel.settingTask.dirty();
- i.mergeOption(o,this),i.optionUpdated(o,!1);else{
- // PENDING Global as parent ?
- var s=p({componentIndex:n},t.keyInfo);i=new a(o,this,this,s),
- // Assign `keyInfo`
- p(i,s),t.brandNew&&(i.__requireNewView=!0),i.init(o,this,this),
- // Call optionUpdated after init.
- // newCmptOption has been used as componentModel.option
- // and may be merged with theme and default, so pass null
- // to avoid confusion.
- i.optionUpdated(null,!0)}}else i&&(
- // Consider where is no new option and should be merged using {},
- // see removeEdgeAndAdd in topologicalTravel and
- // ComponentModel.getAllClassMainTypes.
- i.mergeOption({},this),i.optionUpdated({},!1));
- // If no both `resultItem.exist` and `resultItem.option`,
- // either it is in `replaceMerge` and not matched by any id,
- // or it has been removed in previous `replaceMerge` and left a "hole" in this component index.
- i?(f.push(i.option),g.push(i),y++):(
- // Always do assign to avoid elided item in array.
- f.push(void 0),g.push(void 0))}),this),n[e]=f,i.set(e,g),s.set(e,y),"series"===e&&Ka(this)}
- // If no series declared, ensure `_seriesIndices` initialized.
- ),this),this._seriesIndices||Ka(this)},
- /**
- * Get option for output (cloned option and inner info removed)
- */
- n.prototype.getOption=function(){var t=et(this.option);return a(t,(function(e,n){if(Ta.hasClass(n)){for(var i=Sn(e),o=i.length,r=!1,a=o-1
- // Inner cmpts need to be removed.
- // Inner cmpts might not be at last since ec5.0, but still
- // compatible for users: if inner cmpt at last, splice the returned array.
- ;a>=0;a--)
- // Remove options with inner id.
- i[a]&&!Pn(i[a])?r=!0:(i[a]=null,!r&&o--);i.length=o,t[n]=i}})),delete t[os],t},n.prototype.getTheme=function(){return this._theme},n.prototype.getLocaleModel=function(){return this._locale},n.prototype.setUpdatePayload=function(t){this._payload=t},n.prototype.getUpdatePayload=function(){return this._payload},
- /**
- * @param idx If not specified, return the first one.
- */
- n.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var i=n[e||0];if(i)return i;if(null==e)for(var o=0;o<n.length;o++)if(n[o])return n[o]}},
- /**
- * @return Never be null/undefined.
- */
- n.prototype.queryComponents=function(t){var e=t.mainType;if(!e)return[];var n,i=t.index,o=t.id,r=t.name,s=this._componentsMap.get(e);return s&&s.length?(null!=i?(n=[],a(Sn(i),(function(t){s[t]&&n.push(s[t])}))):n=null!=o?as("id",o,s):null!=r?as("name",r,s):st(s,(function(t){return!!t})),ss(n,t)):[]},
- /**
- * The interface is different from queryComponents,
- * which is convenient for inner usage.
- *
- * @usage
- * let result = findComponents(
- * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}
- * );
- * let result = findComponents(
- * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}
- * );
- * let result = findComponents(
- * {mainType: 'series',
- * filter: function (model, index) {...}}
- * );
- * // result like [component0, componnet1, ...]
- */
- n.prototype.findComponents=function(t){var e,n,i,o,r,a=t.query,s=t.mainType,l=(n=s+"Index",i=s+"Id",o=s+"Name",!(e=a)||null==e[n]&&null==e[i]&&null==e[o]?null:{mainType:s,
- // subType will be filtered finally.
- index:e[n],id:e[i],name:e[o]}),u=l?this.queryComponents(l):st(this._componentsMap.get(s),(function(t){return!!t}));return r=ss(u,t),t.filter?st(r,t.filter):r},n.prototype.eachComponent=function(e,n,i){var r=this._componentsMap;if(f(e)){var a=n,s=e;r.each((function(t,e){for(var n=0;t&&n<t.length;n++){var i=t[n];i&&s.call(a,e,i,i.componentIndex)}}))}else for(var l=t(e)?r.get(e):o(e)?this.findComponents(e):null,u=0;l&&u<l.length;u++){var c=l[u];c&&n.call(i,c,c.componentIndex)}},
- /**
- * Get series list before filtered by name.
- */
- n.prototype.getSeriesByName=function(t){var e=Ln(t,null);return st(this._componentsMap.get("series"),(function(t){return!!t&&null!=e&&t.name===e}))},
- /**
- * Get series list before filtered by index.
- */
- n.prototype.getSeriesByIndex=function(t){return this._componentsMap.get("series")[t]},
- /**
- * Get series list before filtered by type.
- * FIXME: rename to getRawSeriesByType?
- */
- n.prototype.getSeriesByType=function(t){return st(this._componentsMap.get("series"),(function(e){return!!e&&e.subType===t}))},
- /**
- * Get all series before filtered.
- */
- n.prototype.getSeries=function(){return st(this._componentsMap.get("series"),(function(t){return!!t}))},
- /**
- * Count series before filtered.
- */
- n.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},
- /**
- * After filtering, series may be different
- * from raw series.
- */
- n.prototype.eachSeries=function(t,e){Ja(this),a(this._seriesIndices,(function(n){var i=this._componentsMap.get("series")[n];t.call(e,i,n)}),this)},
- /**
- * Iterate raw series before filtered.
- *
- * @param {Function} cb
- * @param {*} context
- */
- n.prototype.eachRawSeries=function(t,e){a(this._componentsMap.get("series"),(function(n){n&&t.call(e,n,n.componentIndex)}))},
- /**
- * After filtering, series may be different.
- * from raw series.
- */
- n.prototype.eachSeriesByType=function(t,e,n){Ja(this),a(this._seriesIndices,(function(i){var o=this._componentsMap.get("series")[i];o.subType===t&&e.call(n,o,i)}),this)},
- /**
- * Iterate raw series before filtered of given type.
- */
- n.prototype.eachRawSeriesByType=function(t,e,n){return a(this.getSeriesByType(t),e,n)},n.prototype.isSeriesFiltered=function(t){return Ja(this),null==this._seriesIndicesMap.get(t.componentIndex)},n.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},n.prototype.filterSeries=function(t,e){Ja(this);var n=[];a(this._seriesIndices,(function(i){var o=this._componentsMap.get("series")[i];t.call(e,o,i)&&n.push(i)}),this),this._seriesIndices=n,this._seriesIndicesMap=r(n)},n.prototype.restoreData=function(t){Ka(this);var e=this._componentsMap,n=[];e.each((function(t,e){Ta.hasClass(e)&&n.push(e)})),Ta.topologicalTravel(n,Ta.getAllClassMainTypes(),(function(n){a(e.get(n),(function(e){!e||"series"===n&&function(t,e){if(e){var n=e.seriesIndex,i=e.seriesId,o=e.seriesName;return null!=n&&t.componentIndex!==n||null!=i&&t.id!==i||null!=o&&t.name!==o}}(e,t)||e.restoreData()}))}))},n.internalField=(Ka=function(t){var e=t._seriesIndices=[];a(t._componentsMap.get("series"),(function(t){
- // series may have been removed by `replaceMerge`.
- t&&e.push(t.componentIndex)})),t._seriesIndicesMap=r(e)},Ja=function(t){},void($a=function(t,e){
- // Using OPTION_INNER_KEY to mark that this option cannot be used outside,
- // i.e. `chart.setOption(chart.getModel().option);` is forbidden.
- t.option={},t.option[os]=1,
- // Init with series: [], in case of calling findSeries method
- // before series initialized.
- t._componentsMap=r({series:[]}),t._componentsCount=r();
- // If user spefied `option.aria`, aria will be enable. This detection should be
- // performed before theme and globalDefault merge.
- var n=e.aria;o(n)&&null==n.enabled&&(n.enabled=!0),function(t,e){
- // PENDING
- // NOT use `colorLayer` in theme if option has `color`
- var n=t.color&&!t.colorLayer;a(e,(function(e,i){"colorLayer"===i&&n||Ta.hasClass(i)||("object"==typeof e?t[i]=t[i]?tt(t[i],e,!1):et(e):null==t[i]&&(t[i]=e));
- // If it is component model mainType, the model handles that merge later.
- // otherwise, merge them here.
- }))}(e,t._theme.option),
- // TODO Needs clone when merging to the unexisted property
- tt(e,La,!1),t._mergeOption(e,null)})),n}(yr);function as(t,e,n){
- // Here is a break from echarts4: string and number are
- // treated as equal.
- if(i(e)){var o=r();return a(e,(function(t){null!=t&&(null!=Ln(t,null)&&o.set(t,!0))})),st(n,(function(e){return e&&o.get(e[t])}))}var s=Ln(e,null);return st(n,(function(e){return e&&null!=s&&e[t]===s}))}function ss(t,e){
- // Using hasOwnProperty for restrict. Consider
- // subType is undefined in user payload.
- return e.hasOwnProperty("subType")?st(t,(function(t){return t&&t.subType===e.subType})):t}function ls(t){var e=r();return t&&a(Sn(t.replaceMerge),(function(t){e.set(t,!0)})),{replaceMergeMainTypeMap:e}}nt(rs,es);const us=rs;var cs=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL",
- // 'getModel',
- "getOption",
- // 'getViewOfComponentModel',
- // 'getViewOfSeriesModel',
- "getId","updateLabelLayout"];const ds=function(t){a(cs,(function(e){this[e]=lt(t[e],t)}),this)};var hs={},ps=/** @class */function(){function t(){this._coordinateSystems=[]}return t.prototype.create=function(t,e){var n=[];a(hs,(function(i,o){var r=i.create(t,e);n=n.concat(r||[])})),this._coordinateSystems=n},t.prototype.update=function(t,e){a(this._coordinateSystems,(function(n){n.update&&n.update(t,e)}))},t.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},t.register=function(t,e){hs[t]=e},t.get=function(t){return hs[t]},t}();const fs=ps;var gs=/^(min|max)?(.+)$/,ys=/** @class */function(){
- // timeline.notMerge is not supported in ec3. Firstly there is rearly
- // case that notMerge is needed. Secondly supporting 'notMerge' requires
- // rawOption cloned and backuped when timeline changed, which does no
- // good to performance. What's more, that both timeline and setOption
- // method supply 'notMerge' brings complex and some problems.
- // Consider this case:
- // (step1) chart.setOption({timeline: {notMerge: false}, ...}, false);
- // (step2) chart.setOption({timeline: {notMerge: true}, ...}, false);
- function t(t){this._timelineOptions=[],this._mediaList=[],
- /**
- * -1, means default.
- * empty means no media.
- */
- this._currentMediaIndices=[],this._api=t}return t.prototype.setOption=function(t,e,n){t&&(
- // That set dat primitive is dangerous if user reuse the data when setOption again.
- a(Sn(t.series),(function(t){t&&t.data&&at(t.data)&&ut(t.data)})),a(Sn(t.dataset),(function(t){t&&t.source&&at(t.source)&&ut(t.source)}))),
- // Caution: some series modify option data, if do not clone,
- // it should ensure that the repeat modify correctly
- // (create a new object when modify itself).
- t=et(t);
- // FIXME
- // If some property is set in timeline options or media option but
- // not set in baseOption, a warning should be given.
- var o=this._optionBackup,r=
- /**
- * [RAW_OPTION_PATTERNS]
- * (Note: "series: []" represents all other props in `ECUnitOption`)
- *
- * (1) No prop "baseOption" declared:
- * Root option is used as "baseOption" (except prop "options" and "media").
- * ```js
- * option = {
- * series: [],
- * timeline: {},
- * options: [],
- * };
- * option = {
- * series: [],
- * media: {},
- * };
- * option = {
- * series: [],
- * timeline: {},
- * options: [],
- * media: {},
- * }
- * ```
- *
- * (2) Prop "baseOption" declared:
- * If "baseOption" declared, `ECUnitOption` props can only be declared
- * inside "baseOption" except prop "timeline" (compat ec2).
- * ```js
- * option = {
- * baseOption: {
- * timeline: {},
- * series: [],
- * },
- * options: []
- * };
- * option = {
- * baseOption: {
- * series: [],
- * },
- * media: []
- * };
- * option = {
- * baseOption: {
- * timeline: {},
- * series: [],
- * },
- * options: []
- * media: []
- * };
- * option = {
- * // ec3 compat ec2: allow (only) `timeline` declared
- * // outside baseOption. Keep this setting for compat.
- * timeline: {},
- * baseOption: {
- * series: [],
- * },
- * options: [],
- * media: []
- * };
- * ```
- */
- function(
- // `rawOption` May be modified
- t,e,n){var o,r,s=[],l=t.baseOption,u=t.timeline,c=t.options,d=t.media,h=!!t.media,p=!!(c||u||l&&l.timeline);l?
- // For merge option.
- (r=l).timeline||(r.timeline=u):((p||h)&&(t.options=t.media=null),r=t);h&&i(d)&&a(d,(function(t){t&&t.option&&(t.query?s.push(t):o||(
- // Use the first media default.
- o=t))}));function f(t){a(e,(function(e){e(t,n)}))}return f(r),a(c,(function(t){return f(t)})),a(s,(function(t){return f(t.option)})),{baseOption:r,timelineOptions:c||[],mediaDefault:o,mediaList:s}}
- /**
- * @see <http://www.w3.org/TR/css3-mediaqueries/#media1>
- * Support: width, height, aspectRatio
- * Can use max or min as prefix.
- */(t,e,!o);this._newBaseOption=r.baseOption,
- // For setOption at second time (using merge mode);
- o?(
- // FIXME
- // the restore merge solution is essentially incorrect.
- // the mapping can not be 100% consistent with ecModel, which probably brings
- // potential bug!
- // The first merge is delayed, because in most cases, users do not call `setOption` twice.
- // let fakeCmptsMap = this._fakeCmptsMap;
- // if (!fakeCmptsMap) {
- // fakeCmptsMap = this._fakeCmptsMap = createHashMap();
- // mergeToBackupOption(fakeCmptsMap, null, optionBackup.baseOption, null);
- // }
- // mergeToBackupOption(
- // fakeCmptsMap, optionBackup.baseOption, newParsedOption.baseOption, opt
- // );
- // For simplicity, timeline options and media options do not support merge,
- // that is, if you `setOption` twice and both has timeline options, the latter
- // timeline options will not be merged to the former, but just substitute them.
- r.timelineOptions.length&&(o.timelineOptions=r.timelineOptions),r.mediaList.length&&(o.mediaList=r.mediaList),r.mediaDefault&&(o.mediaDefault=r.mediaDefault)):this._optionBackup=r},t.prototype.mountOption=function(t){var e=this._optionBackup;return this._timelineOptions=e.timelineOptions,this._mediaList=e.mediaList,this._mediaDefault=e.mediaDefault,this._currentMediaIndices=[],et(t?e.baseOption:this._newBaseOption)},t.prototype.getTimelineOption=function(t){var e,n=this._timelineOptions;if(n.length){
- // getTimelineOption can only be called after ecModel inited,
- // so we can get currentIndex from timelineModel.
- var i=t.getComponent("timeline");i&&(e=et(
- // FIXME:TS as TimelineModel or quivlant interface
- n[i.getCurrentIndex()]))}return e},t.prototype.getMediaOption=function(t){var e,i,o=this._api.getWidth(),r=this._api.getHeight(),a=this._mediaList,s=this._mediaDefault,l=[],u=[];
- // No media defined.
- if(!a.length&&!s)return u;
- // Multi media may be applied, the latter defined media has higher priority.
- for(var c=0,d=a.length;c<d;c++)ms(a[c].query,o,r)&&l.push(c);
- // FIXME
- // Whether mediaDefault should force users to provide? Otherwise
- // the change by media query can not be recorvered.
- return!l.length&&s&&(l=[-1]),l.length&&(e=l,i=this._currentMediaIndices,e.join(",")!==i.join(","))&&(u=n(l,(function(t){return et(-1===t?s.option:a[t].option)}))),
- // Otherwise return nothing.
- this._currentMediaIndices=l,u},t}();
- // Key: mainType
- // type FakeComponentsMap = HashMap<(MappingExistingItem & { subType: string })[]>;
- /**
- * TERM EXPLANATIONS:
- * See `ECOption` and `ECUnitOption` in `src/util/types.ts`.
- */function ms(t,e,n){var i={width:e,height:n,aspectratio:e/n},o=!0;return a(t,(function(t,e){var n=e.match(gs);if(n&&n[1]&&n[2]){var r=n[1],a=n[2].toLowerCase();(function(t,e,n){return"min"===n?t>=e:"max"===n?t<=e:t===e})(i[a],t,r)||(o=!1)}})),o}
- /**
- * Consider case:
- * `chart.setOption(opt1);`
- * Then user do some interaction like dataZoom, dataView changing.
- * `chart.setOption(opt2);`
- * Then user press 'reset button' in toolbox.
- *
- * After doing that all of the interaction effects should be reset, the
- * chart should be the same as the result of invoke
- * `chart.setOption(opt1); chart.setOption(opt2);`.
- *
- * Although it is not able ensure that
- * `chart.setOption(opt1); chart.setOption(opt2);` is equivalents to
- * `chart.setOption(merge(opt1, opt2));` exactly,
- * this might be the only simple way to implement that feature.
- *
- * MEMO: We've considered some other approaches:
- * 1. Each model handles its self restoration but not uniform treatment.
- * (Too complex in logic and error-prone)
- * 2. Use a shadow ecModel. (Performance expensive)
- *
- * FIXME: A possible solution:
- * Add a extra level of model for each component model. The inheritance chain would be:
- * ecModel <- componentModel <- componentActionModel <- dataItemModel
- * And all of the actions can only modify the `componentActionModel` rather than
- * `componentModel`. `setOption` will only modify the `ecModel` and `componentModel`.
- * When "resotre" action triggered, model from `componentActionModel` will be discarded
- * instead of recreating the "ecModel" from the "_optionBackup".
- */
- // function mergeToBackupOption(
- // fakeCmptsMap: FakeComponentsMap,
- // // `tarOption` Can be null/undefined, means init
- // tarOption: ECUnitOption,
- // newOption: ECUnitOption,
- // // Can be null/undefined
- // opt: InnerSetOptionOpts
- // ): void {
- // newOption = newOption || {} as ECUnitOption;
- // const notInit = !!tarOption;
- // each(newOption, function (newOptsInMainType, mainType) {
- // if (newOptsInMainType == null) {
- // return;
- // }
- // if (!ComponentModel.hasClass(mainType)) {
- // if (tarOption) {
- // tarOption[mainType] = merge(tarOption[mainType], newOptsInMainType, true);
- // }
- // }
- // else {
- // const oldTarOptsInMainType = notInit ? normalizeToArray(tarOption[mainType]) : null;
- // const oldFakeCmptsInMainType = fakeCmptsMap.get(mainType) || [];
- // const resultTarOptsInMainType = notInit ? (tarOption[mainType] = [] as ComponentOption[]) : null;
- // const resultFakeCmptsInMainType = fakeCmptsMap.set(mainType, []);
- // const mappingResult = mappingToExists(
- // oldFakeCmptsInMainType,
- // normalizeToArray(newOptsInMainType),
- // (opt && opt.replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge' : 'normalMerge'
- // );
- // setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel as ComponentModelConstructor);
- // each(mappingResult, function (resultItem, index) {
- // // The same logic as `Global.ts#_mergeOption`.
- // let fakeCmpt = resultItem.existing;
- // const newOption = resultItem.newOption;
- // const keyInfo = resultItem.keyInfo;
- // let fakeCmptOpt;
- // if (!newOption) {
- // fakeCmptOpt = oldTarOptsInMainType[index];
- // }
- // else {
- // if (fakeCmpt && fakeCmpt.subType === keyInfo.subType) {
- // fakeCmpt.name = keyInfo.name;
- // if (notInit) {
- // fakeCmptOpt = merge(oldTarOptsInMainType[index], newOption, true);
- // }
- // }
- // else {
- // fakeCmpt = extend({}, keyInfo);
- // if (notInit) {
- // fakeCmptOpt = clone(newOption);
- // }
- // }
- // }
- // if (fakeCmpt) {
- // notInit && resultTarOptsInMainType.push(fakeCmptOpt);
- // resultFakeCmptsInMainType.push(fakeCmpt);
- // }
- // else {
- // notInit && resultTarOptsInMainType.push(void 0);
- // resultFakeCmptsInMainType.push(void 0);
- // }
- // });
- // }
- // });
- // }
- const vs=ys;var xs=a,_s=o,bs=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Ss(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=bs.length;n<i;n++){var o=bs[n],r=e.normal,a=e.emphasis;r&&r[o]&&(t[o]=t[o]||{},t[o].normal?tt(t[o].normal,r[o]):t[o].normal=r[o],r[o]=null),a&&a[o]&&(t[o]=t[o]||{},t[o].emphasis?tt(t[o].emphasis,a[o]):t[o].emphasis=a[o],a[o]=null)}}function ws(t,e,n){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var i=t[e].normal,o=t[e].emphasis;i&&(
- // Timeline controlStyle has other properties besides normal and emphasis
- n?(t[e].normal=t[e].emphasis=null,I(t[e],i)):t[e]=i),o&&(t.emphasis=t.emphasis||{},t.emphasis[e]=o,
- // Also compat the case user mix the style and focus together in ec3 style
- // for example: { itemStyle: { normal: {}, emphasis: {focus, shadowBlur} } }
- o.focus&&(t.emphasis.focus=o.focus),o.blurScope&&(t.emphasis.blurScope=o.blurScope))}}function Ms(t){ws(t,"itemStyle"),ws(t,"lineStyle"),ws(t,"areaStyle"),ws(t,"label"),ws(t,"labelLine"),
- // treemap
- ws(t,"upperLabel"),
- // graph
- ws(t,"edgeLabel")}function Is(t,e){
- // Check whether is not object (string\null\undefined ...)
- var n=_s(t)&&t[e],i=_s(n)&&n.textStyle;if(i)for(var o=0,r=Mn.length;o<r;o++){var a=Mn[o];i.hasOwnProperty(a)&&(n[a]=i[a])}}function Ds(t){t&&(Ms(t),Is(t,"label"),t.emphasis&&Is(t.emphasis,"label"))}function Ts(t){return i(t)?t:t?[t]:[]}function Cs(t){return(i(t)?t[0]:t)||{}}function As(t,e){xs(Ts(t.series),(function(t){_s(t)&&function(t){if(_s(t)){Ss(t),Ms(t),Is(t,"label"),
- // treemap
- Is(t,"upperLabel"),
- // graph
- Is(t,"edgeLabel"),t.emphasis&&(Is(t.emphasis,"label"),
- // treemap
- Is(t.emphasis,"upperLabel"),
- // graph
- Is(t.emphasis,"edgeLabel"));var e=t.markPoint;e&&(Ss(e),Ds(e));var n=t.markLine;n&&(Ss(n),Ds(n));var o=t.markArea;o&&Ds(o);var r=t.data;
- // Break with ec3: if `setOption` again, there may be no `type` in option,
- // then the backward compat based on option type will not be performed.
- if("graph"===t.type){r=r||t.nodes;var s=t.links||t.edges;if(s&&!at(s))for(var l=0;l<s.length;l++)Ds(s[l]);a(t.categories,(function(t){Ms(t)}))}if(r&&!at(r))for(l=0;l<r.length;l++)Ds(r[l]);
- // mark point data
- if((e=t.markPoint)&&e.data){var u=e.data;for(l=0;l<u.length;l++)Ds(u[l])}
- // mark line data
- if((n=t.markLine)&&n.data){var c=n.data;for(l=0;l<c.length;l++)i(c[l])?(Ds(c[l][0]),Ds(c[l][1])):Ds(c[l])}
- // Series
- "gauge"===t.type?(Is(t,"axisLabel"),Is(t,"title"),Is(t,"detail")):"treemap"===t.type?(ws(t.breadcrumb,"itemStyle"),a(t.levels,(function(t){Ms(t)}))):"tree"===t.type&&Ms(t.leaves);
- // sunburst starts from ec4, so it does not need to compat levels.
- }}(t)}));var n=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&n.push("valueAxis","categoryAxis","logAxis","timeAxis"),xs(n,(function(e){xs(Ts(t[e]),(function(t){t&&(Is(t,"axisLabel"),Is(t.axisPointer,"label"))}))})),xs(Ts(t.parallel),(function(t){var e=t&&t.parallelAxisDefault;Is(e,"axisLabel"),Is(e&&e.axisPointer,"label")})),xs(Ts(t.calendar),(function(t){ws(t,"itemStyle"),Is(t,"dayLabel"),Is(t,"monthLabel"),Is(t,"yearLabel")})),
- // radar.name.textStyle
- xs(Ts(t.radar),(function(t){Is(t,"name"),
- // Use axisName instead of name because component has name property
- t.name&&null==t.axisName&&(t.axisName=t.name,delete t.name),null!=t.nameGap&&null==t.axisNameGap&&(t.axisNameGap=t.nameGap,delete t.nameGap)})),xs(Ts(t.geo),(function(t){_s(t)&&(Ds(t),xs(Ts(t.regions),(function(t){Ds(t)})))})),xs(Ts(t.timeline),(function(t){Ds(t),ws(t,"label"),ws(t,"itemStyle"),ws(t,"controlStyle",!0);var e=t.data;i(e)&&a(e,(function(t){o(t)&&(ws(t,"label"),ws(t,"itemStyle"))}))})),xs(Ts(t.toolbox),(function(t){ws(t,"iconStyle"),xs(t.feature,(function(t){ws(t,"iconStyle")}))})),Is(Cs(t.axisPointer),"label"),Is(Cs(t.tooltip).axisPointer,"label")}function Ls(t){t&&a(ks,(function(e){e[0]in t&&!(e[1]in t)&&(t[e[1]]=t[e[0]])}))}var ks=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],Ps=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],Ns=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function Os(t){var e=t&&t.itemStyle;if(e)for(var n=0;n<Ns.length;n++){var i=Ns[n][1],o=Ns[n][0];null!=e[i]&&(e[o]=e[i])}}function Rs(t){t&&"edge"===t.alignTo&&null!=t.margin&&null==t.edgeDistance&&(t.edgeDistance=t.margin)}function Es(t){t&&t.downplay&&!t.blur&&(t.blur=t.downplay)}function Vs(t,e){if(t)for(var n=0;n<t.length;n++)e(t[n]),t[n]&&Vs(t[n].children,e)}function zs(t,e){As(t,e),
- // Make sure series array for model initialization.
- t.series=Sn(t.series),a(t.series,(function(t){if(o(t)){var e=t.type;if("line"===e)null!=t.clipOverflow&&(t.clip=t.clipOverflow);else if("pie"===e||"gauge"===e){if(null!=t.clockWise&&(t.clockwise=t.clockWise),Rs(t.label),(r=t.data)&&!at(r))for(var n=0;n<r.length;n++)Rs(r[n]);null!=t.hoverOffset&&(t.emphasis=t.emphasis||{},(t.emphasis.scaleSize=null)&&(t.emphasis.scaleSize=t.hoverOffset))}else if("gauge"===e){var i=function(t,e){for(var n=e.split(","),i=t,o=0;o<n.length&&null!=(i=i&&i[n[o]]);o++);return i}(t,"pointer.color");null!=i&&function(t,e,n,i){for(var o,r=e.split(","),a=t,s=0;s<r.length-1;s++)null==a[o=r[s]]&&(a[o]={}),a=a[o];(i||null==a[r[s]])&&(a[r[s]]=n)}(t,"itemStyle.color",i)}else if("bar"===e){var r;if(Os(t),Os(t.backgroundStyle),Os(t.emphasis),(r=t.data)&&!at(r))for(n=0;n<r.length;n++)"object"==typeof r[n]&&(Os(r[n]),Os(r[n]&&r[n].emphasis))}else if("sunburst"===e){var a=t.highlightPolicy;a&&(t.emphasis=t.emphasis||{},t.emphasis.focus||(t.emphasis.focus=a)),Es(t),Vs(t.data,Es)}else"graph"===e||"sankey"===e?function(t){t&&null!=t.focusNodeAdjacency&&(t.emphasis=t.emphasis||{},null==t.emphasis.focus&&(t.emphasis.focus="adjacency"))}(t):"map"===e&&(t.mapType&&!t.map&&(t.map=t.mapType),t.mapLocation&&I(t,t.mapLocation));null!=t.hoverAnimation&&(t.emphasis=t.emphasis||{},t.emphasis&&null==t.emphasis.scale&&(t.emphasis.scale=t.hoverAnimation)),Ls(t)}})),
- // dataRange has changed to visualMap
- t.dataRange&&(t.visualMap=t.dataRange),a(Ps,(function(e){var n=t[e];n&&(i(n)||(n=[n]),a(n,(function(t){Ls(t)})))}))}
- // (1) [Caution]: the logic is correct based on the premises:
- // data processing stage is blocked in stream.
- // See <module:echarts/stream/Scheduler#performDataProcessorTasks>
- // (2) Only register once when import repeatedly.
- // Should be executed after series is filtered and before stack calculation.
- function Bs(t){a(t,(function(e,n){var i=[],o=[NaN,NaN],r=[e.stackResultDimension,e.stackedOverDimension],a=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";
- // Should not write on raw data, because stack series model list changes
- // depending on legend selection.
- a.modify(r,(function(r,u,c){var d,h,p=a.get(e.stackedDimension,c);
- // Consider `connectNulls` of line area, if value is NaN, stackedOver
- // should also be NaN, to draw a appropriate belt area.
- if(isNaN(p))return o;s?h=a.getRawIndex(c):d=a.get(e.stackedByDimension,c);
- // If stackOver is NaN, chart view will render point on value start.
- for(var f=NaN,g=n-1;g>=0;g--){var y=t[g];
- // Has been optimized by inverted indices on `stackedByDimension`.
- if(s||(h=y.data.rawIndexOf(y.stackedByDimension,d)),h>=0){var m=y.data.getByRawIndex(y.stackResultDimension,h);
- // Considering positive stack, negative stack and empty data
- if("all"===l||"positive"===l&&m>0||"negative"===l&&m<0||"samesign"===l&&p>=0&&m>0||"samesign"===l&&p<=0&&m<0){
- // The sum has to be very small to be affected by the
- // floating arithmetic problem. An incorrect result will probably
- // cause axis min/max to be filtered incorrectly.
- p=en(p,m),f=m;break}}}return i[0]=p,i[1]=f,i}))}))}
- // @inner
- var Gs,Fs,Ws,Hs,Ys,Us=function(t){this.data=t.data||(t.sourceFormat===Ra?{}:[]),this.sourceFormat=t.sourceFormat||Va,
- // Visit config
- this.seriesLayoutBy=t.seriesLayoutBy||za,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var e=this.dimensionsDefine=t.dimensionsDefine;if(e)for(var n=0;n<e.length;n++){var i=e[n];null==i.type&&Xa(this,n)===Ga&&(i.type="ordinal")}};function Zs(t){return t instanceof Us}
- /**
- * Create a source from option.
- * NOTE: Created source is immutable. Don't change any properties in it.
- */function Xs(e,n,
- // can be null. If not provided, auto detect it from `sourceData`.
- o){o=o||qs(e);var r=n.seriesLayoutBy,s=
- /**
- * Determine the source definitions from data standalone dimensions definitions
- * are not specified.
- */
- function(e,n,o,r,
- // standalone raw dimensions definition, like:
- // {
- // dimensions: ['aa', 'bb', { name: 'cc', type: 'time' }]
- // }
- // in `dataset` or `series`
- s){var u,c;
- // PENDING: Could data be null/undefined here?
- // currently, if `dataset.source` not specified, error thrown.
- // if `series.data` not specified, nothing rendered without error thrown.
- // Should test these cases.
- if(!e)return{dimensionsDefine:Ks(s),startIndex:c,dimensionsDetectedCount:u};if(n===Na){var d=e;
- // Rule: Most of the first line are string: it is header.
- // Caution: consider a line with 5 string and 1 number,
- // it still can not be sure it is a head, because the
- // 5 string may be 5 values of category columns.
- "auto"===r||null==r?Js((function(e){
- // '-' is regarded as null/undefined.
- null!=e&&"-"!==e&&(t(e)?null==c&&(c=1):c=0);
- // 10 is an experience number, avoid long loop.
- }),o,d,10):c=l(r)?r:r?1:0,s||1!==c||(s=[],Js((function(t,e){s[e]=null!=t?t+"":""}),o,d,Infinity)),u=s?s.length:o===Ba?d.length:d[0]?d[0].length:null}else if(n===Oa)s||(s=function(t){var e,n=0;for(;n<t.length&&!(e=t[n++]););// jshint ignore: line
- if(e)return v(e)}
- // Consider dimensions defined like ['A', 'price', 'B', 'price', 'C', 'price'],
- // which is reasonable. But dimension name is duplicated.
- // Returns undefined or an array contains only object without null/undefined or string.
- (e));else if(n===Ra)s||(s=[],a(e,(function(t,e){s.push(e)})));else if(n===Pa){var h=In(e[0]);u=i(h)&&h.length||1}return{startIndex:c,dimensionsDefine:Ks(s),dimensionsDetectedCount:u}}(e,o,r,n.sourceHeader,n.dimensions);return new Us({data:e,sourceFormat:o,seriesLayoutBy:r,dimensionsDefine:s.dimensionsDefine,startIndex:s.startIndex,dimensionsDetectedCount:s.dimensionsDetectedCount,metaRawOption:et(n)})}
- /**
- * Wrap original series data for some compatibility cases.
- */function js(t){return new Us({data:t,sourceFormat:at(t)?Ea:Pa})}
- /**
- * Clone source but excludes source data.
- */
- /**
- * Note: An empty array will be detected as `SOURCE_FORMAT_ARRAY_ROWS`.
- */
- function qs(t){var e=Va;if(at(t))e=Ea;else if(i(t)){
- // FIXME Whether tolerate null in top level array?
- 0===t.length&&(e=Na);for(var n=0,r=t.length;n<r;n++){var a=t[n];if(null!=a){if(i(a)||at(a)){e=Na;break}if(o(a)){e=Oa;break}}}}else if(o(t))for(var s in t)if(N(t,s)&&m(t[s])){e=Ra;break}return e}function Ks(t){if(t){var e=r();return n(t,(function(t,n){
- // Other fields will be discarded.
- var i={name:(t=o(t)?t:{name:t}).name,displayName:t.displayName,type:t.type};
- // User can set null in dimensions.
- // We don't auto specify name, otherwise a given name may
- // cause it to be referred unexpectedly.
- if(null==i.name)return i;
- // Also consider number form like 2012.
- i.name+="",
- // User may also specify displayName.
- // displayName will always exists except user not
- // specified or dim name is not specified or detected.
- // (A auto generated dim name will not be used as
- // displayName).
- null==i.displayName&&(i.displayName=i.name);var r=e.get(i.name);return r?i.name+="-"+r.count++:e.set(i.name,{count:1}),i}))}}function Js(t,e,n,i){if(e===Ba)for(var o=0;o<n.length&&o<i;o++)t(n[o]?n[o][0]:null,o);else{var r=n[0]||[];for(o=0;o<r.length&&o<i;o++)t(r[o],o)}}function $s(t){var e=t.sourceFormat;return e===Oa||e===Ra}
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * If normal array used, mutable chunk size is supported.
- * If typed array used, chunk size must be fixed.
- */
- var Qs=/** @class */function(){function t(t,e){
- // let source: Source;
- var n=Zs(t)?t:js(t);
- // declare source is Source;
- this._source=n;var i=this._data=n.data;
- // Typed array. TODO IE10+?
- n.sourceFormat===Ea&&(this._offset=0,this._dimSize=e,this._data=i),Ys(this,i,n)}return t.prototype.getSource=function(){return this._source},t.prototype.count=function(){return 0},t.prototype.getItem=function(t,e){},t.prototype.appendData=function(t){},t.prototype.clean=function(){},t.protoInitialize=function(){
- // PENDING: To avoid potential incompat (e.g., prototype
- // is visited somewhere), still init them on prototype.
- var e=t.prototype;e.pure=!1,e.persistent=!0}(),t.internalField=function(){var t;Ys=function(t,o,r){var a=r.sourceFormat,s=r.seriesLayoutBy,l=r.startIndex,u=r.dimensionsDefine,c=Hs[ul(a,s)];if(p(t,c),a===Ea)t.getItem=e,t.count=i,t.fillStorage=n;else{var d=nl(a,s);t.getItem=lt(d,null,o,l,u);var h=rl(a,s);t.count=lt(h,null,o,l,u)}};var e=function(t,e){t-=this._offset,e=e||[];for(var n=this._data,i=this._dimSize,o=i*t,r=0;r<i;r++)e[r]=n[o+r];return e},n=function(t,e,n,i){for(var o=this._data,r=this._dimSize,a=0;a<r;a++){for(var s=i[a],l=null==s[0]?Infinity:s[0],u=null==s[1]?-Infinity:s[1],c=e-t,d=n[a],h=0;h<c;h++){
- // appendData with TypedArray will always do replace in provider.
- var p=o[h*r+a];d[t+h]=p,p<l&&(l=p),p>u&&(u=p)}s[0]=l,s[1]=u}},i=function(){return this._data?this._data.length/this._dimSize:0};function o(t){for(var e=0;e<t.length;e++)this._data.push(t[e])}(t={})[Na+"_"+za]={pure:!0,appendData:o},t[Na+"_"+Ba]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[Oa]={pure:!0,appendData:o},t[Ra]={pure:!0,appendData:function(t){var e=this._data;a(t,(function(t,n){for(var i=e[n]||(e[n]=[]),o=0;o<(t||[]).length;o++)i.push(t[o])}))}},t[Pa]={appendData:o},t[Ea]={persistent:!1,pure:!0,appendData:function(t){this._data=t},
- // Clean self if data is already used.
- clean:function(){
- // PENDING
- this._offset+=this.count(),this._data=null}},Hs=t}(),t}(),tl=function(t,e,n,i){return t[i]},el=((Gs={})[Na+"_"+za]=function(t,e,n,i){return t[i+e]},Gs[Na+"_"+Ba]=function(t,e,n,i,o){i+=e;for(var r=o||[],a=t,s=0;s<a.length;s++){var l=a[s];r[s]=l?l[i]:null}return r},Gs[Oa]=tl,Gs[Ra]=function(t,e,n,i,o){for(var r=o||[],a=0;a<n.length;a++){var s=t[n[a].name];r[a]=s?s[i]:null}return r},Gs[Pa]=tl,Gs);function nl(t,e){return el[ul(t,e)]}var il=function(t,e,n){return t.length},ol=((Fs={})[Na+"_"+za]=function(t,e,n){return Math.max(0,t.length-e)},Fs[Na+"_"+Ba]=function(t,e,n){var i=t[0];return i?Math.max(0,i.length-e):0},Fs[Oa]=il,Fs[Ra]=function(t,e,n){var i=t[n[0].name];return i?i.length:0},Fs[Pa]=il,Fs);function rl(t,e){return ol[ul(t,e)]}var al=function(t,e,n){return t[e]},sl=((Ws={})[Na]=al,Ws[Oa]=function(t,e,n){return t[n]},Ws[Ra]=al,Ws[Pa]=function(t,e,n){
- // FIXME: In some case (markpoint in geo (geo-map.html)),
- // dataItem is {coord: [...]}
- var i=In(t);return i instanceof Array?i[e]:i},Ws[Ea]=al,Ws);function ll(t){return sl[t]}function ul(t,e){return t===Na?t+"_"+e:t}
- // ??? FIXME can these logic be more neat: getRawValue, getRawDataItem,
- // Consider persistent.
- // Caution: why use raw value to display on label or tooltip?
- // A reason is to avoid format. For example time value we do not know
- // how to format is expected. More over, if stack is used, calculated
- // value may be 0.91000000001, which have brings trouble to display.
- // TODO: consider how to treat null/undefined/NaN when display?
- function cl(t,e,
- // If dimIndex is null/undefined, return OptionDataItem.
- // Otherwise, return OptionDataValue.
- n){if(t){
- // Consider data may be not persistent.
- var i=t.getRawDataItem(e);if(null!=i){var o=t.getStore(),r=o.getSource().sourceFormat;if(null!=n){var a=t.getDimensionIndex(n),s=o.getDimensionProperty(a);return ll(r)(i,a,s)}var l=i;return r===Pa&&(l=In(i)),l}}}var dl=/\{@(.+?)\}/g,hl=/** @class */function(){function e(){}
- /**
- * Get params for formatter
- */return e.prototype.getDataParams=function(t,e){var n=this.getData(e),i=this.getRawValue(t,e),o=n.getRawIndex(t),r=n.getName(t),a=n.getRawDataItem(t),s=n.getItemVisual(t,"style"),l=s&&s[n.getItemVisual(t,"drawType")||"fill"],u=s&&s.stroke,c=this.mainType,d="series"===c,h=n.userOutput&&n.userOutput.get();return{componentType:c,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:d?this.subType:null,seriesIndex:this.seriesIndex,seriesId:d?this.id:null,seriesName:d?this.name:null,name:r,dataIndex:o,data:a,dataType:e,value:i,color:l,borderColor:u,dimensionNames:h?h.fullDimensions:null,encode:h?h.encode:null,
- // Param name list for mapping `a`, `b`, `c`, `d`, `e`
- $vars:["seriesName","name","value"]}},
- /**
- * Format label
- * @param dataIndex
- * @param status 'normal' by default
- * @param dataType
- * @param labelDimIndex Only used in some chart that
- * use formatter in different dimensions, like radar.
- * @param formatter Formatter given outside.
- * @return return null/undefined if no formatter
- */
- e.prototype.getFormattedLabel=function(e,n,o,r,a,s){n=n||"normal";var l=this.getData(o),u=this.getDataParams(e,o);(s&&(u.value=s.interpolatedValue),null!=r&&i(u.value)&&(u.value=u.value[r]),a)||(
- // @ts-ignore
- a=l.getItemModel(e).get("normal"===n?["label","formatter"]:[n,"label","formatter"]));return f(a)?(u.status=n,u.dimensionIndex=r,a(u)):t(a)?ca(a,u).replace(dl,(function(t,n){var o=n.length,r=n;"["===r.charAt(0)&&"]"===r.charAt(o-1)&&(r=+r.slice(1,o-1));var a=cl(l,e,r);if(s&&i(s.interpolatedValue)){var u=l.getDimensionIndex(r);u>=0&&(a=s.interpolatedValue[u])}return null!=a?a+"":""})):void 0},
- /**
- * Get raw value in option
- */
- e.prototype.getRawValue=function(t,e){return cl(this.getData(e),t)},
- /**
- * Should be implemented.
- * @param {number} dataIndex
- * @param {boolean} [multipleSeries=false]
- * @param {string} [dataType]
- */
- e.prototype.formatTooltip=function(t,e,n){},e}();
- // PENDING: previously we accept this type when calling `formatTooltip`,
- // but guess little chance has been used outside. Do we need to backward
- // compat it?
- // type TooltipFormatResultLegacyObject = {
- // // `html` means the markup language text, either in 'html' or 'richText'.
- // // The name `html` is not appropriate because in 'richText' it is not a HTML
- // // string. But still support it for backward compatibility.
- // html: string;
- // markers: Dictionary<ColorString>;
- // };
- /**
- * For backward compat, normalize the return from `formatTooltip`.
- */
- function pl(t){var e,n;
- // let markers: Dictionary<ColorString>;
- return o(t)?t.type&&(n=t):e=t,{text:e,
- // markers: markers || markersExisting,
- frag:n}}
- /**
- * @param {Object} define
- * @return See the return of `createTask`.
- */function fl(t){return new gl(t)}var gl=/** @class */function(){function t(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}
- /**
- * @param step Specified step.
- * @param skip Skip customer perform call.
- * @param modBy Sampling window size.
- * @param modDataCount Sampling count.
- * @return whether unfinished.
- */return t.prototype.perform=function(t){var e,n=this._upstream,o=t&&t.skip;
- // TODO some refactor.
- // Pull data. Must pull data each time, because context.data
- // may be updated by Series.setData.
- if(this._dirty&&n){var r=this.context;r.data=r.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!o&&(e=this._plan(this.context));
- // Support sharding by mod, which changes the render sequence and makes the rendered graphic
- // elements uniformed distributed when progress, especially when moving or zooming.
- var a,s=d(this._modBy),l=this._modDataCount||0,u=d(t&&t.modBy),c=t&&t.modDataCount||0;function d(t){// jshint ignore:line
- return!(t>=1)&&(t=1),t}s===u&&l===c||(e="reset"),(this._dirty||"reset"===e)&&(this._dirty=!1,a=this._doReset(o)),this._modBy=u,this._modDataCount=c;var h=t&&t.step;
- // Note: Stubs, that its host overall task let it has progress, has progress.
- // If no progress, pass index from upstream to downstream each time plan called.
- if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):Infinity,this._progress){var p=this._dueIndex,f=Math.min(null!=h?this._dueIndex+h:Infinity,this._dueEnd);if(!o&&(a||p<f)){var g=this._progress;if(i(g))for(var y=0;y<g.length;y++)this._doProgress(g[y],p,f,u,c);else this._doProgress(g,p,f,u,c)}this._dueIndex=f;
- // If no `outputDueEnd`, assume that output data and
- // input data is the same, so use `dueIndex` as `outputDueEnd`.
- var m=null!=this._settedOutputEnd?this._settedOutputEnd:f;this._outputDueEnd=m}else
- // (1) Some overall task has no progress.
- // (2) Stubs, that its host overall task do not let it has progress, has no progress.
- // This should always be performed so it can be passed to downstream.
- this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()},t.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},t.prototype._doProgress=function(t,e,n,i,o){yl.reset(e,n,i,o),this._callingProgress=t,this._callingProgress({start:e,end:n,count:n-e,next:yl.next},this.context)},t.prototype._doReset=function(t){var e,n;this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null,!t&&this._reset&&((e=this._reset(this.context))&&e.progress&&(n=e.forceFirstProgress,e=e.progress),
- // To simplify no progress checking, array must has item.
- i(e)&&!e.length&&(e=null)),this._progress=e,this._modBy=this._modDataCount=null;var o=this._downstream;return o&&o.dirty(),n},t.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},
- /**
- * @param downTask The downstream task.
- * @return The downstream task.
- */
- t.prototype.pipe=function(t){
- // If already downstream, do not dirty downTask.
- (this._downstream!==t||this._dirty)&&(this._downstream=t,t._upstream=this,t.dirty())},t.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},t.prototype.getUpstream=function(){return this._upstream},t.prototype.getDownstream=function(){return this._downstream},t.prototype.setOutputEnd=function(t){
- // This only happens in dataTask, dataZoom, map, currently.
- // where dataZoom do not set end each time, but only set
- // when reset. So we should record the set end, in case
- // that the stub of dataZoom perform again and earse the
- // set end by upstream.
- this._outputDueEnd=this._settedOutputEnd=t},t}(),yl=function(){var t,e,n,i,o,r={reset:function(l,u,c,d){e=l,t=u,n=c,i=d,o=Math.ceil(i/n),r.next=n>1&&i>0?s:a}};return r;function a(){return e<t?e++:null}function s(){var r=e%o*n+Math.ceil(e/o),a=e>=t?null:r<i?r:e;return e++,a}}();
- // -----------------------------------------------------------------------------
- // For stream debug (Should be commented out after used!)
- // @usage: printTask(this, 'begin');
- // @usage: printTask(this, null, {someExtraProp});
- // @usage: Use `__idxInPipeline` as conditional breakpiont.
- // window.printTask = function (task: any, prefix: string, extra: { [key: string]: unknown }): void {
- // window.ecTaskUID == null && (window.ecTaskUID = 0);
- // task.uidDebug == null && (task.uidDebug = `task_${window.ecTaskUID++}`);
- // task.agent && task.agent.uidDebug == null && (task.agent.uidDebug = `task_${window.ecTaskUID++}`);
- // let props = [];
- // if (task.__pipeline) {
- // let val = `${task.__idxInPipeline}/${task.__pipeline.tail.__idxInPipeline} ${task.agent ? '(stub)' : ''}`;
- // props.push({text: '__idxInPipeline/total', value: val});
- // } else {
- // let stubCount = 0;
- // task.agentStubMap.each(() => stubCount++);
- // props.push({text: 'idx', value: `overall (stubs: ${stubCount})`});
- // }
- // props.push({text: 'uid', value: task.uidDebug});
- // if (task.__pipeline) {
- // props.push({text: 'pipelineId', value: task.__pipeline.id});
- // task.agent && props.push(
- // {text: 'stubFor', value: task.agent.uidDebug}
- // );
- // }
- // props.push(
- // {text: 'dirty', value: task._dirty},
- // {text: 'dueIndex', value: task._dueIndex},
- // {text: 'dueEnd', value: task._dueEnd},
- // {text: 'outputDueEnd', value: task._outputDueEnd}
- // );
- // if (extra) {
- // Object.keys(extra).forEach(key => {
- // props.push({text: key, value: extra[key]});
- // });
- // }
- // let args = ['color: blue'];
- // let msg = `%c[${prefix || 'T'}] %c` + props.map(item => (
- // args.push('color: green', 'color: red'),
- // `${item.text}: %c${item.value}`
- // )).join('%c, ');
- // console.log.apply(console, [msg].concat(args));
- // // console.log(this);
- // };
- // window.printPipeline = function (task: any, prefix: string) {
- // const pipeline = task.__pipeline;
- // let currTask = pipeline.head;
- // while (currTask) {
- // window.printTask(currTask, prefix);
- // currTask = currTask._downstream;
- // }
- // };
- // window.showChain = function (chainHeadTask) {
- // var chain = [];
- // var task = chainHeadTask;
- // while (task) {
- // chain.push({
- // task: task,
- // up: task._upstream,
- // down: task._downstream,
- // idxInPipeline: task.__idxInPipeline
- // });
- // task = task._downstream;
- // }
- // return chain;
- // };
- // window.findTaskInChain = function (task, chainHeadTask) {
- // let chain = window.showChain(chainHeadTask);
- // let result = [];
- // for (let i = 0; i < chain.length; i++) {
- // let chainItem = chain[i];
- // if (chainItem.task === task) {
- // result.push(i);
- // }
- // }
- // return result;
- // };
- // window.printChainAEachInChainB = function (chainHeadTaskA, chainHeadTaskB) {
- // let chainA = window.showChain(chainHeadTaskA);
- // for (let i = 0; i < chainA.length; i++) {
- // console.log('chainAIdx:', i, 'inChainB:', window.findTaskInChain(chainA[i].task, chainHeadTaskB));
- // }
- // };
- /**
- * Convert raw the value in to inner value in List.
- *
- * [Performance sensitive]
- *
- * [Caution]: this is the key logic of user value parser.
- * For backward compatibility, do not modify it until you have to!
- */
- function ml(t,
- // For high performance, do not omit the second param.
- e){
- // Performance sensitive.
- var n=e&&e.type;return"ordinal"===n?t:("time"!==n||l(t)||null==t||"-"===t||(t=+sn(t)),null==t||""===t?NaN:Number(t))}var vl=r({number:function(t){
- // Do not use `numericToNumber` here. We have `numericToNumber` by default.
- // Here the number parser can have loose rule:
- // enable to cut suffix: "120px" => 120, "14%" => 14.
- return parseFloat(t)},time:function(t){
- // return timestamp.
- return+sn(t)},trim:function(e){return t(e)?Q(e):e}});function xl(t){return vl.get(t)}var _l={lt:function(t,e){return t<e},lte:function(t,e){return t<=e},gt:function(t,e){return t>e},gte:function(t,e){return t>=e}},bl=/** @class */function(){function t(t,e){if(!l(e)){vn("")}this._opFn=_l[t],this._rvalFloat=pn(e)}
- // Performance sensitive.
- return t.prototype.evaluate=function(t){
- // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.
- return l(t)?this._opFn(t,this._rvalFloat):this._opFn(pn(t),this._rvalFloat)},t}(),Sl=/** @class */function(){
- /**
- * @param order by default: 'asc'
- * @param incomparable by default: Always on the tail.
- * That is, if 'asc' => 'max', if 'desc' => 'min'
- * See the definition of "incomparable" in [SORT_COMPARISON_RULE].
- */
- function e(t,e){var n="desc"===t;this._resultLT=n?1:-1,null==e&&(e=n?"min":"max"),this._incomparable="min"===e?-Infinity:Infinity}
- // See [SORT_COMPARISON_RULE].
- // Performance sensitive.
- return e.prototype.evaluate=function(e,n){
- // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.
- var i=l(e)?e:pn(e),o=l(n)?n:pn(n),r=isNaN(i),a=isNaN(o);if(r&&(i=this._incomparable),a&&(o=this._incomparable),r&&a){var s=t(e),u=t(n);s&&(i=u?e:0),u&&(o=s?n:0)}return i<o?this._resultLT:i>o?-this._resultLT:0},e}(),wl=/** @class */function(){function t(t,e){this._rval=e,this._isEQ=t,this._rvalTypeof=typeof e,this._rvalFloat=pn(e)}
- // Performance sensitive.
- return t.prototype.evaluate=function(t){var e=t===this._rval;if(!e){var n=typeof t;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(e=pn(t)===this._rvalFloat)}return this._isEQ?e:!e},t}();
- /**
- * [FILTER_COMPARISON_RULE]
- * `lt`|`lte`|`gt`|`gte`:
- * + rval must be a number. And lval will be converted to number (`numericToNumber`) to compare.
- * `eq`:
- * + If same type, compare with `===`.
- * + If there is one number, convert to number (`numericToNumber`) to compare.
- * + Else return `false`.
- * `ne`:
- * + Not `eq`.
- *
- *
- * [SORT_COMPARISON_RULE]
- * All the values are grouped into three categories:
- * + "numeric" (number and numeric string)
- * + "non-numeric-string" (string that excluding numeric string)
- * + "others"
- * "numeric" vs "numeric": values are ordered by number order.
- * "non-numeric-string" vs "non-numeric-string": values are ordered by ES spec (#sec-abstract-relational-comparison).
- * "others" vs "others": do not change order (always return 0).
- * "numeric" vs "non-numeric-string": "non-numeric-string" is treated as "incomparable".
- * "number" vs "others": "others" is treated as "incomparable".
- * "non-numeric-string" vs "others": "others" is treated as "incomparable".
- * "incomparable" will be seen as -Infinity or Infinity (depends on the settings).
- * MEMO:
- * Non-numeric string sort makes sense when we need to put the items with the same tag together.
- * But if we support string sort, we still need to avoid the misleading like `'2' > '12'`,
- * So we treat "numeric-string" sorted by number order rather than string comparison.
- *
- *
- * [CHECK_LIST_OF_THE_RULE_DESIGN]
- * + Do not support string comparison until required. And also need to
- * avoid the misleading of "2" > "12".
- * + Should avoid the misleading case:
- * `" 22 " gte "22"` is `true` but `" 22 " eq "22"` is `false`.
- * + JS bad case should be avoided: null <= 0, [] <= 0, ' ' <= 0, ...
- * + Only "numeric" can be converted to comparable number, otherwise converted to NaN.
- * See `util/number.ts#numericToNumber`.
- *
- * @return If `op` is not `RelationalOperator`, return null;
- */
- function Ml(t,e){return"eq"===t||"ne"===t?new wl("eq"===t,e):N(_l,t)?new bl(t,e):null}
- /**
- * TODO: disable writable.
- * This structure will be exposed to users.
- */var Il=/** @class */function(){function t(){}return t.prototype.getRawData=function(){
- // Only built-in transform available.
- throw new Error("not supported")},t.prototype.getRawDataItem=function(t){
- // Only built-in transform available.
- throw new Error("not supported")},t.prototype.cloneRawData=function(){},
- /**
- * @return If dimension not found, return null/undefined.
- */
- t.prototype.getDimensionInfo=function(t){},
- /**
- * dimensions defined if and only if either:
- * (a) dataset.dimensions are declared.
- * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`).
- * If dimensions are defined, `dimensionInfoAll` is corresponding to
- * the defined dimensions.
- * Otherwise, `dimensionInfoAll` is determined by data columns.
- * @return Always return an array (even empty array).
- */
- t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},
- /**
- * Only support by dimension index.
- * No need to support by dimension name in transform function,
- * because transform function is not case-specific, no need to use name literally.
- */
- t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return ml(t,e)},t}();function Dl(t){if(!Pl(t.sourceFormat)){vn("")}return t.data}function Tl(t){var e=t.sourceFormat,n=t.data;if(!Pl(e)){vn("")}if(e===Na){for(var i=[],o=0,r=n.length;o<r;o++)
- // Not strictly clone for performance
- i.push(n[o].slice());return i}if(e===Oa){for(i=[],o=0,r=n.length;o<r;o++)
- // Not strictly clone for performance
- i.push(p({},n[o]));return i}}function Cl(t,e,n){if(null!=n)
- // Keep the same logic as `List::getDimension` did.
- return l(n)||!isNaN(n)&&!N(e,n)?t[n]:N(e,n)?e[n]:void 0}function Al(t){return et(t)}var Ll=r();function kl(t,e,i,
- // If `pipeIndex` is null/undefined, no piped transform.
- r){e.length||vn(""),o(t)||vn("");var s=t.type,l=Ll.get(s);l||vn("");
- // Prepare source
- var u=n(e,(function(t){return function(t,e){var n=new Il,i=t.data,o=n.sourceFormat=t.sourceFormat,r=t.startIndex;t.seriesLayoutBy!==za&&vn("");
- // [MEMO]
- // Create a new dimensions structure for exposing.
- // Do not expose all dimension info to users directly.
- // Because the dimension is probably auto detected from data and not might reliable.
- // Should not lead the transformers to think that is reliable and return it.
- // See [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.
- var s=[],l={},u=t.dimensionsDefine;if(u)a(u,(function(t,e){var n=t.name,i={index:e,name:n,displayName:t.displayName};s.push(i),
- // Users probably do not specify dimension name. For simplicity, data transform
- // does not generate dimension name.
- null!=n&&(N(l,n)&&vn(""),l[n]=i)}));else for(var c=0;c<t.dimensionsDetectedCount;c++)
- // Do not generete name or anything others. The consequence process in
- // `transform` or `series` probably have there own name generation strategry.
- s.push({index:c});
- // Implement public methods:
- var d=nl(o,za);e.__isBuiltIn&&(n.getRawDataItem=function(t){return d(i,r,s,t)},n.getRawData=lt(Dl,null,t)),n.cloneRawData=lt(Tl,null,t);var h=rl(o,za);n.count=lt(h,null,i,r,s);var p=ll(o);n.retrieveValue=function(t,e){var n=d(i,r,s,t);return f(n,e)};var f=n.retrieveValueFromItem=function(t,e){if(null!=t){var n=s[e];
- // When `dimIndex` is `null`, `rawValueGetter` return the whole item.
- return n?p(t,e,n.name):void 0}};return n.getDimensionInfo=lt(Cl,null,s,l),n.cloneAllDimensionInfo=lt(Al,null,s),n}(t,l)})),c=Sn(l.transform({upstream:u[0],upstreamList:u,config:et(t.config)}));return n(c,(function(t,n){var i;o(t)||vn(""),t.data||vn(""),Pl(qs(t.data))||vn("");var r=e[0];
- /**
- * Intuitively, the end users known the content of the original `dataset.source`,
- * calucating the transform result in mind.
- * Suppose the original `dataset.source` is:
- * ```js
- * [
- * ['product', '2012', '2013', '2014', '2015'],
- * ['AAA', 41.1, 30.4, 65.1, 53.3],
- * ['BBB', 86.5, 92.1, 85.7, 83.1],
- * ['CCC', 24.1, 67.2, 79.5, 86.4]
- * ]
- * ```
- * The dimension info have to be detected from the source data.
- * Some of the transformers (like filter, sort) will follow the dimension info
- * of upstream, while others use new dimensions (like aggregate).
- * Transformer can output a field `dimensions` to define the its own output dimensions.
- * We also allow transformers to ignore the output `dimensions` field, and
- * inherit the upstream dimensions definition. It can reduce the burden of handling
- * dimensions in transformers.
- *
- * See also [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.
- */if(r&&0===n&&!t.dimensions){var a=r.startIndex;
- // We copy the header of upstream to the result, because:
- // (1) The returned data always does not contain header line and can not be used
- // as dimension-detection. In this case we can not use "detected dimensions" of
- // upstream directly, because it might be detected based on different `seriesLayoutBy`.
- // (2) We should support that the series read the upstream source in `seriesLayoutBy: 'row'`.
- // So the original detected header should be add to the result, otherwise they can not be read.
- a&&(t.data=r.data.slice(0,a).concat(t.data)),i={seriesLayoutBy:za,sourceHeader:a,dimensions:r.metaRawOption.dimensions}}else i={seriesLayoutBy:za,sourceHeader:0,dimensions:t.dimensions};return Xs(t.data,i,null)}))}function Pl(t){return t===Na||t===Oa}var Nl,Ol="undefined",Rl=typeof Uint32Array===Ol?Array:Uint32Array,El=typeof Uint16Array===Ol?Array:Uint16Array,Vl=typeof Int32Array===Ol?Array:Int32Array,zl=typeof Float64Array===Ol?Array:Float64Array,Bl={float:zl,int:Vl,
- // Ordinal data type can be string or int
- ordinal:Array,number:Array,time:zl};
- /* global Float64Array, Int32Array, Uint32Array, Uint16Array */
- // Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is
- // different from the Ctor of typed array.
- function Gl(t){
- // The possible max value in this._indicies is always this._rawCount despite of filtering.
- return t>65535?Rl:El}function Fl(t,e,n,i,o){var r=Bl[n||"float"];if(o){var a=t[e],s=a&&a.length;if(s!==i){
- // The cost of the copy is probably inconsiderable
- // within the initial chunkSize.
- for(var l=new r(i),u=0;u<s;u++)l[u]=a[u];t[e]=l}}else t[e]=new r(i)}
- /**
- * Basically, DataStore API keep immutable.
- */var Wl=/** @class */function(){function t(){this._chunks=[],
- // It will not be calculated until needed.
- this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=r()}
- /**
- * Initialize from data
- */return t.prototype.initData=function(t,e,i){this._provider=t,
- // Clear
- this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var o=t.getSource(),r=this.defaultDimValueGetter=Nl[o.sourceFormat];
- // Default dim value getter
- this._dimValueGetter=i||r,
- // Reset raw extent.
- this._rawExtent=[],$s(o),this._dimensions=n(e,(function(t){return{
- // Only pick these two props. Not leak other properties like orderMeta.
- type:t.type,property:t.property}})),this._initDataFromProvider(0,t.count())},t.prototype.getProvider=function(){return this._provider},
- /**
- * Caution: even when a `source` instance owned by a series, the created data store
- * may still be shared by different sereis (the source hash does not use all `source`
- * props, see `sourceManager`). In this case, the `source` props that are not used in
- * hash (like `source.dimensionDefine`) probably only belongs to a certain series and
- * thus should not be fetch here.
- */
- t.prototype.getSource=function(){return this._provider.getSource()},
- /**
- * @caution Only used in dataStack.
- */
- t.prototype.ensureCalculationDimension=function(t,e){var n=this._calcDimNameToIdx,i=this._dimensions,o=n.get(t);if(null!=o){if(i[o].type===e)return o}else o=i.length;return i[o]={type:e},n.set(t,o),this._chunks[o]=new Bl[e||"float"](this._rawCount),this._rawExtent[o]=[Infinity,-Infinity],o},t.prototype.collectOrdinalMeta=function(t,e){var n=this._chunks[t],i=this._dimensions[t],o=this._rawExtent,r=i.ordinalOffset||0,a=n.length;0===r&&(
- // We need to reset the rawExtent if collect is from start.
- // Because this dimension may be guessed as number and calcuating a wrong extent.
- o[t]=[Infinity,-Infinity]);
- // Parse from previous data offset. len may be changed after appendData
- for(var s=o[t],l=r;l<a;l++){var u=n[l]=e.parseAndCollect(n[l]);isNaN(u)||(s[0]=Math.min(u,s[0]),s[1]=Math.max(u,s[1]))}i.ordinalMeta=e,i.ordinalOffset=a,i.type="ordinal"},t.prototype.getOrdinalMeta=function(t){return this._dimensions[t].ordinalMeta},t.prototype.getDimensionProperty=function(t){var e=this._dimensions[t];return e&&e.property},
- /**
- * Caution: Can be only called on raw data (before `this._indices` created).
- */
- t.prototype.appendData=function(t){var e=this._provider,n=this.count();e.appendData(t);var i=e.count();return e.persistent||(i+=n),n<i&&this._initDataFromProvider(n,i,!0),[n,i]},t.prototype.appendValues=function(t,e){for(var n=this._chunks,i=this._dimensions,o=i.length,r=this._rawExtent,a=this.count(),s=a+Math.max(t.length,e||0),l=0;l<o;l++){Fl(n,l,(p=i[l]).type,s,!0)}for(var u=[],c=a;c<s;c++)
- // Store the data by dimensions
- for(var d=c-a,h=0;h<o;h++){var p=i[h],f=Nl.arrayRows.call(this,t[d]||u,p.property,d,h);n[h][c]=f;var g=r[h];f<g[0]&&(g[0]=f),f>g[1]&&(g[1]=f)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,i){for(var o=this._provider,r=this._chunks,a=this._dimensions,s=a.length,l=this._rawExtent,u=n(a,(function(t){return t.property})),c=0;c<s;c++){var d=a[c];l[c]||(l[c]=[Infinity,-Infinity]),Fl(r,c,d.type,e,i)}if(o.fillStorage)o.fillStorage(t,e,r,l);else for(var h=[],p=t;p<e;p++){
- // NOTICE: Try not to write things into dataItem
- h=o.getItem(p,h);
- // Each data item is value
- // [1, 2]
- // 2
- // Bar chart, line chart which uses category axis
- // only gives the 'y' value. 'x' value is the indices of category
- // Use a tempValue to normalize the value to be a (x, y) value
- // Store the data by dimensions
- for(var f=0;f<s;f++){var g=r[f],y=this._dimValueGetter(h,u[f],p,f);
- // PENDING NULL is empty or zero
- g[p]=y;var m=l[f];y<m[0]&&(m[0]=y),y>m[1]&&(m[1]=y)}}!o.persistent&&o.clean&&
- // Clean unused data if data source is typed array.
- o.clean(),this._rawCount=this._count=e,
- // Reset data extent
- this._extent=[]},t.prototype.count=function(){return this._count},
- /**
- * Get value. Return NaN if idx is out of range.
- */
- t.prototype.get=function(t,e){if(!(e>=0&&e<this._count))return NaN;var n=this._chunks[t];return n?n[this.getRawIndex(e)]:NaN},t.prototype.getValues=function(t,e){var n=[],i=[];if(null==e){e=t,
- // TODO get all from store?
- t=[];
- // All dimensions
- for(var o=0;o<this._dimensions.length;o++)i.push(o)}else i=t;o=0;for(var r=i.length;o<r;o++)n.push(this.get(i[o],e));return n},
- /**
- * @param dim concrete dim
- */
- t.prototype.getByRawIndex=function(t,e){if(!(e>=0&&e<this._rawCount))return NaN;var n=this._chunks[t];return n?n[e]:NaN},
- /**
- * Get sum of data in one dimension
- */
- t.prototype.getSum=function(t){var e=0;if(this._chunks[t])for(var n=0,i=this.count();n<i;n++){var o=this.get(t,n);isNaN(o)||(e+=o)}return e},
- /**
- * Get median of data in one dimension
- */
- t.prototype.getMedian=function(t){var e=[];
- // map all data of one dimension
- this.each([t],(function(t){isNaN(t)||e.push(t)}));
- // TODO
- // Use quick select?
- var n=e.sort((function(t,e){return t-e})),i=this.count();
- // calculate median
- return 0===i?0:i%2==1?n[(i-1)/2]:(n[i/2]+n[i/2-1])/2},
- /**
- * Retrieve the index with given raw data index.
- */
- t.prototype.indexOfRawIndex=function(t){if(t>=this._rawCount||t<0)return-1;if(!this._indices)return t;
- // Indices are ascending
- var e=this._indices,n=e[t];
- // If rawIndex === dataIndex
- if(null!=n&&n<this._count&&n===t)return t;for(var i=0,o=this._count-1;i<=o;){var r=(i+o)/2|0;if(e[r]<t)i=r+1;else{if(!(e[r]>t))return r;o=r-1}}return-1},
- /**
- * Retrieve the index of nearest value.
- * @param dim
- * @param value
- * @param [maxDistance=Infinity]
- * @return If and only if multiple indices have
- * the same value, they are put to the result.
- */
- t.prototype.indicesOfNearest=function(t,e,n){var i=this._chunks[t],o=[];if(!i)return o;null==n&&(n=Infinity);
- // Check the test case of `test/ut/spec/data/SeriesData.js`.
- for(var r=Infinity,a=-1,s=0,l=0,u=this.count();l<u;l++){var c=e-i[this.getRawIndex(l)],d=Math.abs(c);d<=n&&(
- // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`,
- // we'd better not push both of them to `nearestIndices`, otherwise it is easy to
- // get more than one item in `nearestIndices` (more specifically, in `tooltip`).
- // So we choose the one that `diff >= 0` in this case.
- // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them
- // should be push to `nearestIndices`.
- (d<r||d===r&&c>=0&&a<0)&&(r=d,a=c,s=0),c===a&&(o[s++]=l))}return o.length=s,o},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=e.constructor,i=this._count;
- // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`.
- if(n===Array){t=new n(i);for(var o=0;o<i;o++)t[o]=e[o]}else t=new n(e.buffer,0,i)}else{t=new(n=Gl(this._rawCount))(this.count());for(o=0;o<t.length;o++)t[o]=o}return t},
- /**
- * Data filter.
- */
- t.prototype.filter=function(t,e){if(!this._count)return this;for(var n=this.clone(),i=n.count(),o=new(Gl(n._rawCount))(i),r=[],a=t.length,s=0,l=t[0],u=n._chunks,c=0;c<i;c++){var d=void 0,h=n.getRawIndex(c);
- // Simple optimization
- if(0===a)d=e(c);else if(1===a){d=e(u[l][h],c)}else{for(var p=0;p<a;p++)r[p]=u[t[p]][h];r[p]=c,d=e.apply(null,r)}d&&(o[s++]=h)}
- // Set indices after filtered.
- return s<i&&(n._indices=o),n._count=s,
- // Reset data extent
- n._extent=[],n._updateGetRawIdx(),n},
- /**
- * Select data in range. (For optimization of filter)
- * (Manually inline code, support 5 million data filtering in data zoom.)
- */
- t.prototype.selectRange=function(t){var e=this.clone(),n=e._count;if(!n)return this;var i=v(t),o=i.length;if(!o)return this;var r=e.count(),a=new(Gl(e._rawCount))(r),s=0,l=i[0],u=t[l][0],c=t[l][1],d=e._chunks,h=!1;if(!e._indices){
- // Extreme optimization for common case. About 2x faster in chrome.
- var p=0;if(1===o){for(var f=d[i[0]],g=0;g<n;g++){
- // NaN will not be filtered. Consider the case, in line chart, empty
- // value indicates the line should be broken. But for the case like
- // scatter plot, a data item with empty value will not be rendered,
- // but the axis extent may be effected if some other dim of the data
- // item has value. Fortunately it is not a significant negative effect.
- ((_=f[g])>=u&&_<=c||isNaN(_))&&(a[s++]=p),p++}h=!0}else if(2===o){f=d[i[0]];var y=d[i[1]],m=t[i[1]][0],x=t[i[1]][1];for(g=0;g<n;g++){var _=f[g],b=y[g];
- // Do not filter NaN, see comment above.
- (_>=u&&_<=c||isNaN(_))&&(b>=m&&b<=x||isNaN(b))&&(a[s++]=p),p++}h=!0}}if(!h)if(1===o)for(g=0;g<r;g++){var S=e.getRawIndex(g);
- // Do not filter NaN, see comment above.
- ((_=d[i[0]][S])>=u&&_<=c||isNaN(_))&&(a[s++]=S)}else for(g=0;g<r;g++){for(var w=!0,M=(S=e.getRawIndex(g),0);M<o;M++){var I=i[M];
- // Do not filter NaN, see comment above.
- ((_=d[I][S])<t[I][0]||_>t[I][1])&&(w=!1)}w&&(a[s++]=e.getRawIndex(g))}
- // Set indices after filtered.
- return s<r&&(e._indices=a),e._count=s,
- // Reset data extent
- e._extent=[],e._updateGetRawIdx(),e},
- // /**
- // * Data mapping to a plain array
- // */
- // mapArray(dims: DimensionIndex[], cb: MapArrayCb): any[] {
- // const result: any[] = [];
- // this.each(dims, function () {
- // result.push(cb && (cb as MapArrayCb).apply(null, arguments));
- // });
- // return result;
- // }
- /**
- * Data mapping to a new List with given dimensions
- */
- t.prototype.map=function(t,e){
- // TODO only clone picked chunks.
- var n=this.clone(t);return this._updateDims(n,t,e),n},
- /**
- * @caution Danger!! Only used in dataStack.
- */
- t.prototype.modify=function(t,e){this._updateDims(this,t,e)},t.prototype._updateDims=function(t,e,n){for(var i=t._chunks,o=[],r=e.length,a=t.count(),s=[],l=t._rawExtent,u=0;u<e.length;u++)l[e[u]]=[Infinity,-Infinity];for(var c=0;c<a;c++){for(var d=t.getRawIndex(c),h=0;h<r;h++)s[h]=i[e[h]][d];s[r]=c;var p=n&&n.apply(null,s);if(null!=p){
- // a number or string (in oridinal dimension)?
- "object"!=typeof p&&(o[0]=p,p=o);for(u=0;u<p.length;u++){var f=e[u],g=p[u],y=l[f],m=i[f];m&&(m[d]=g),g<y[0]&&(y[0]=g),g>y[1]&&(y[1]=g)}}}},
- /**
- * Large data down sampling using largest-triangle-three-buckets
- * @param {string} valueDimension
- * @param {number} targetCount
- */
- t.prototype.lttbDownSample=function(t,e){var n,i,o,r=this.clone([t],!0),a=r._chunks[t],s=this.count(),l=0,u=Math.floor(1/e),c=this.getRawIndex(0),d=new(Gl(this._rawCount))(Math.min(2*(Math.ceil(s/u)+2),s));
- // First frame use the first data.
- d[l++]=c;for(var h=1;h<s-1;h+=u){for(var p=Math.min(h+u,s-1),f=Math.min(h+2*u,s),g=(f+p)/2,y=0,m=p;m<f;m++){var v=a[I=this.getRawIndex(m)];isNaN(v)||(y+=v)}y/=f-p;var x=h,_=Math.min(h+u,s),b=h-1,S=a[c];n=-1,o=x;var w=-1,M=0;
- // Find a point from current frame that construct a triangle with largest area with previous selected point
- // And the average of next frame.
- for(m=x;m<_;m++){var I;v=a[I=this.getRawIndex(m)];isNaN(v)?(M++,w<0&&(w=I)):(
- // Calculate triangle area over three buckets
- i=Math.abs((b-g)*(v-S)-(b-m)*(y-S)))>n&&(n=i,o=I)}M>0&&M<_-x&&(
- // Append first NaN point in every bucket.
- // It is necessary to ensure the correct order of indices.
- d[l++]=Math.min(w,o),o=Math.max(w,o)),d[l++]=o,c=o}
- // First frame use the last data.
- return d[l++]=this.getRawIndex(s-1),r._count=l,r._indices=d,r.getRawIndex=this._getRawIdx,r},
- /**
- * Large data down sampling using min-max
- * @param {string} valueDimension
- * @param {number} rate
- */
- t.prototype.minmaxDownSample=function(t,e){for(var n=this.clone([t],!0),i=n._chunks,o=Math.floor(1/e),r=i[t],a=this.count(),s=new(Gl(this._rawCount))(2*Math.ceil(a/o)),l=0,u=0;u<a;u+=o){var c=u,d=r[this.getRawIndex(c)],h=u,p=r[this.getRawIndex(h)],f=o;
- // Handle final smaller frame
- u+o>a&&(f=a-u);
- // Determine min and max within the current frame
- for(var g=0;g<f;g++){var y=r[this.getRawIndex(u+g)];y<d&&(d=y,c=u+g),y>p&&(p=y,h=u+g)}var m=this.getRawIndex(c),v=this.getRawIndex(h);
- // Set the order of the min and max values, based on their ordering in the frame
- c<h?(s[l++]=m,s[l++]=v):(s[l++]=v,s[l++]=m)}return n._count=l,n._indices=s,n._updateGetRawIdx(),n},
- /**
- * Large data down sampling on given dimension
- * @param sampleIndex Sample index for name and id
- */
- t.prototype.downSample=function(t,e,n,i){for(var o=this.clone([t],!0),r=o._chunks,a=[],s=Math.floor(1/e),l=r[t],u=this.count(),c=o._rawExtent[t]=[Infinity,-Infinity],d=new(Gl(this._rawCount))(Math.ceil(u/s)),h=0,p=0;p<u;p+=s){
- // Last frame
- s>u-p&&(s=u-p,a.length=s);for(var f=0;f<s;f++){var g=this.getRawIndex(p+f);a[f]=l[g]}var y=n(a),m=this.getRawIndex(Math.min(p+i(a,y)||0,u-1));
- // Only write value on the filtered data
- l[m]=y,y<c[0]&&(c[0]=y),y>c[1]&&(c[1]=y),d[h++]=m}return o._count=h,o._indices=d,o._updateGetRawIdx(),o},
- /**
- * Data iteration
- * @param ctx default this
- * @example
- * list.each('x', function (x, idx) {});
- * list.each(['x', 'y'], function (x, y, idx) {});
- * list.each(function (idx) {})
- */
- t.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,o=0,r=this.count();o<r;o++){var a=this.getRawIndex(o);
- // Simple optimization
- switch(n){case 0:e(o);break;case 1:e(i[t[0]][a],o);break;case 2:e(i[t[0]][a],i[t[1]][a],o);break;default:for(var s=0,l=[];s<n;s++)l[s]=i[t[s]][a];
- // Index
- l[s]=o,e.apply(null,l)}}},
- /**
- * Get extent of data in one dimension
- */
- t.prototype.getDataExtent=function(t){
- // Make sure use concrete dim as cache name.
- var e=this._chunks[t],n=[Infinity,-Infinity];if(!e)return n;
- // Make more strict checkings to ensure hitting cache.
- var i,o=this.count();
- // Consider the most cases when using data zoom, `getDataExtent`
- // happened before filtering. We cache raw extent, which is not
- // necessary to be cleared and recalculated when restore data.
- if(!this._indices)return this._rawExtent[t].slice();if(i=this._extent[t])return i.slice();for(var r=(i=n)[0],a=i[1],s=0;s<o;s++){var l=e[this.getRawIndex(s)];l<r&&(r=l),l>a&&(a=l)}return i=[r,a],this._extent[t]=i,i},
- /**
- * Get raw data item
- */
- t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var n=[],i=this._chunks,o=0;o<i.length;o++)n.push(i[o][e]);return n},
- /**
- * Clone shallow.
- *
- * @param clonedDims Determine which dims to clone. Will share the data if not specified.
- */
- t.prototype.clone=function(n,i){var o,r,a=new t,s=this._chunks,l=n&&e(n,(function(t,e){return t[e]=!0,t}),{});if(l)for(var u=0;u<s.length;u++)
- // Not clone if dim is not picked.
- a._chunks[u]=l[u]?(o=s[u],r=void 0,(r=o.constructor)===Array?o.slice():new r(o)):s[u];else a._chunks=s;return this._copyCommonProps(a),i||(a._indices=this._cloneIndices()),a._updateGetRawIdx(),a},t.prototype._copyCommonProps=function(t){t._count=this._count,t._rawCount=this._rawCount,t._provider=this._provider,t._dimensions=this._dimensions,t._extent=et(this._extent),t._rawExtent=et(this._rawExtent)},t.prototype._cloneIndices=function(){if(this._indices){var t=this._indices.constructor,e=void 0;if(t===Array){var n=this._indices.length;e=new t(n);for(var i=0;i<n;i++)e[i]=this._indices[i]}else e=new t(this._indices);return e}return null},t.prototype._getRawIdxIdentity=function(t){return t},t.prototype._getRawIdx=function(t){return t<this._count&&t>=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,n,i){return ml(t[i],this._dimensions[i])}Nl={arrayRows:t,objectRows:function(t,e,n,i){return ml(t[e],this._dimensions[i])},keyedColumns:t,original:function(t,e,n,i){
- // Performance sensitive, do not use modelUtil.getDataItemValue.
- // If dataItem is an plain object with no value field, the let `value`
- // will be assigned with the object, but it will be tread correctly
- // in the `convertValue`.
- var o=t&&(null==t.value?t:t.value);return ml(o instanceof Array?o[i]:o,this._dimensions[i])},typedArray:function(t,e,n,i){return t[i]}}}(),t}();const Hl=Wl;
- /**
- * [REQUIREMENT_MEMO]:
- * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option.
- * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and
- * `root-dataset`. Them on `series` has higher priority.
- * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might
- * confuse users: whether those props indicate how to visit the upstream source or visit
- * the transform result source, and some transforms has nothing to do with these props,
- * and some transforms might have multiple upstream.
- * (3) Transforms should specify `metaRawOption` in each output, just like they can be
- * declared in `root-dataset`.
- * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms.
- * That is for reducing complexity in transforms.
- * PENDING: Whether to provide transposition transform?
- *
- * [IMPLEMENTAION_MEMO]:
- * "sourceVisitConfig" are calculated from `metaRawOption` and `data`.
- * They will not be calculated until `source` is about to be visited (to prevent from
- * duplicate calcuation). `source` is visited only in series and input to transforms.
- *
- * [DIMENSION_INHERIT_RULE]:
- * By default the dimensions are inherited from ancestors, unless a transform return
- * a new dimensions definition.
- * Consider the case:
- * ```js
- * dataset: [{
- * source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...]
- * }, {
- * transform: { type: 'filter', ... }
- * }]
- * dataset: [{
- * dimension: ['Product', 'Sales', 'Prise'],
- * source: [ ['Cookies', 321, 44.21], ...]
- * }, {
- * transform: { type: 'filter', ... }
- * }]
- * ```
- * The two types of option should have the same behavior after transform.
- *
- *
- * [SCENARIO]:
- * (1) Provide source data directly:
- * ```js
- * series: {
- * encode: {...},
- * dimensions: [...]
- * seriesLayoutBy: 'row',
- * data: [[...]]
- * }
- * ```
- * (2) Series refer to dataset.
- * ```js
- * series: [{
- * encode: {...}
- * // Ignore datasetIndex means `datasetIndex: 0`
- * // and the dimensions defination in dataset is used
- * }, {
- * encode: {...},
- * seriesLayoutBy: 'column',
- * datasetIndex: 1
- * }]
- * ```
- * (3) dataset transform
- * ```js
- * dataset: [{
- * source: [...]
- * }, {
- * source: [...]
- * }, {
- * // By default from 0.
- * transform: { type: 'filter', config: {...} }
- * }, {
- * // Piped.
- * transform: [
- * { type: 'filter', config: {...} },
- * { type: 'sort', config: {...} }
- * ]
- * }, {
- * id: 'regressionData',
- * fromDatasetIndex: 1,
- * // Third-party transform
- * transform: { type: 'ecStat:regression', config: {...} }
- * }, {
- * // retrieve the extra result.
- * id: 'regressionFormula',
- * fromDatasetId: 'regressionData',
- * fromTransformResult: 1
- * }]
- * ```
- */var Yl=/** @class */function(){function t(t){
- // Cached source. Do not repeat calculating if not dirty.
- this._sourceList=[],this._storeList=[],
- // version sign of each upstream source manager.
- this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}
- /**
- * Mark dirty.
- */return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},
- /**
- * For detecting whether the upstream source is dirty, so that
- * the local cached source (in `_sourceList`) should be discarded.
- */
- t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},
- /**
- * Always return a source instance. Otherwise throw error.
- */
- t.prototype.prepareSource=function(){
- // For the case that call `setOption` multiple time but no data changed,
- // cache the result source to prevent from repeating transform.
- this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,n=this._sourceHost,i=this._getUpstreamSourceManagers(),o=!!i.length;if(Zl(n)){var r=n,a=void 0,s=void 0,l=void 0;
- // Has upstream dataset
- if(o){var u=i[0];u.prepareSource(),a=(l=u.getSource()).data,s=l.sourceFormat,e=[u._getVersionSign()]}
- // Series data is from own.
- else a=r.get("data",!0),s=at(a)?Ea:Pa,e=[];
- // See [REQUIREMENT_MEMO], merge settings on series and parent dataset if it is root.
- var c=this._getSourceMetaRawOption()||{},d=l&&l.metaRawOption||{},h=x(c.seriesLayoutBy,d.seriesLayoutBy)||null,p=x(c.sourceHeader,d.sourceHeader),f=x(c.dimensions,d.dimensions);t=h!==d.seriesLayoutBy||!!p!=!!d.sourceHeader||f?[Xs(a,{seriesLayoutBy:h,sourceHeader:p,dimensions:f},s)]:[]}else{var g=n;
- // Has upstream dataset.
- if(o){var y=this._applyTransform(i);t=y.sourceList,e=y.upstreamSignList}
- // Is root dataset.
- else{t=[Xs(g.get("source",!0),this._getSourceMetaRawOption(),null)],e=[]}}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,i=n.get("transform",!0),o=n.get("fromTransformResult",!0);if(null!=o){1!==t.length&&Xl("")}var r,s=[],l=[];return a(t,(function(t){t.prepareSource();var e=t.getSource(o||0);null==o||e||Xl(""),s.push(e),l.push(t._getVersionSign())})),i?e=function(t,e){var n=Sn(t),i=n.length;i||vn("");for(var o=0,r=i;o<r;o++)e=kl(n[o],e),
- // piped transform only support single input, except the fist one.
- // piped transform only support single output, except the last one.
- o!==r-1&&(e.length=Math.max(e.length,1));return e}(i,s,n.componentIndex):null!=o&&(e=[(r=s[0],new Us({data:r.data,sourceFormat:r.sourceFormat,seriesLayoutBy:r.seriesLayoutBy,dimensionsDefine:et(r.dimensionsDefine),startIndex:r.startIndex,dimensionsDetectedCount:r.dimensionsDetectedCount}))]),{sourceList:e,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;
- // All sourceList is from the some upstream.
- for(var t=this._getUpstreamSourceManagers(),e=0;e<t.length;e++){var n=t[e];if(
- // Consider the case that there is ancestor diry, call it recursively.
- // The performance is probably not an issue because usually the chain is not long.
- n._isDirty()||this._upstreamSignList[e]!==n._getVersionSign())return!0}},
- /**
- * @param sourceIndex By default 0, means "main source".
- * In most cases there is only one source.
- */
- t.prototype.getSource=function(t){t=t||0;var e=this._sourceList[t];if(!e){
- // Series may share source instance with dataset.
- var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(t)}return e},
- /**
- *
- * Get a data store which can be shared across series.
- * Only available for series.
- *
- * @param seriesDimRequest Dimensions that are generated in series.
- * Should have been sorted by `storeDimIndex` asc.
- */
- t.prototype.getSharedDataStore=function(t){var e=t.makeStoreSchema();return this._innerGetDataStore(e.dimensions,t.source,e.hash)},t.prototype._innerGetDataStore=function(t,e,n){
- // TODO Can use other sourceIndex?
- var i=this._storeList,o=i[0];o||(o=i[0]={});var r=o[n];if(!r){var a=this._getUpstreamSourceManagers()[0];Zl(this._sourceHost)&&a?r=a._innerGetDataStore(t,e,n):
- // Always create store from source of series.
- (r=new Hl).initData(new Qs(e,t.length),t),o[n]=r}return r},
- /**
- * PENDING: Is it fast enough?
- * If no upstream, return empty array.
- */
- t.prototype._getUpstreamSourceManagers=function(){
- // Always get the relationship from the raw option.
- // Do not cache the link of the dependency graph, so that
- // there is no need to update them when change happens.
- var t=this._sourceHost;if(Zl(t)){var e=Za(t);return e?[e.getSourceManager()]:[]}return n(function(t){
- // Only these attributes declared, we by default reference to `datasetIndex: 0`.
- // Otherwise, no reference.
- return t.get("transform",!0)||t.get("fromTransformResult",!0)?Gn(t.ecModel,"dataset",{index:t.get("fromDatasetIndex",!0),id:t.get("fromDatasetId",!0)},zn).models:[]}(t),(function(t){return t.getSourceManager()}))},t.prototype._getSourceMetaRawOption=function(){var t,e,n,i=this._sourceHost;if(Zl(i))t=i.get("seriesLayoutBy",!0),e=i.get("sourceHeader",!0),n=i.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var o=i;t=o.get("seriesLayoutBy",!0),e=o.get("sourceHeader",!0),n=o.get("dimensions",!0)}return{seriesLayoutBy:t,sourceHeader:e,dimensions:n}},t}();
- // Call this method after `super.init` and `super.mergeOption` to
- // disable the transform merge, but do not disable transform clone from rawOption.
- function Ul(t){t.option.transform&&ut(t.option.transform)}function Zl(t){
- // Avoid circular dependency with Series.ts
- return"series"===t.mainType}function Xl(t){throw new Error(t)}function jl(t){var e=t.lineHeight;return null==e?"line-height:1":"line-height:"+ot(e+"")+"px"}
- // TODO: more textStyle option
- function ql(t,e){var n=t.color||"#6e7079",i=t.fontSize||12,o=t.fontWeight||"400",r=t.color||"#464646",a=t.fontSize||14,s=t.fontWeight||"900";return"html"===e?{
- // eslint-disable-next-line max-len
- nameStyle:"font-size:"+ot(i+"")+"px;color:"+ot(n)+";font-weight:"+ot(o+""),
- // eslint-disable-next-line max-len
- valueStyle:"font-size:"+ot(a+"")+"px;color:"+ot(r)+";font-weight:"+ot(s+"")}:{nameStyle:{fontSize:i,fill:n,fontWeight:o},valueStyle:{fontSize:a,fill:r,fontWeight:s}}}
- // See `TooltipMarkupLayoutIntent['innerGapLevel']`.
- // (value from UI design)
- var Kl=[0,10,20,30],Jl=["","\n","\n\n","\n\n\n"];
- // eslint-disable-next-line max-len
- function $l(t,e){return e.type=t,e}function Ql(t){return"section"===t.type}function tu(t){return Ql(t)?nu:iu}function eu(t){if(Ql(t)){var e=0,n=t.blocks.length,i=n>1||n>0&&!t.noHeader;return a(t.blocks,(function(t){var n=eu(t);
- // If the some of the sub-blocks have some gaps (like 10px) inside, this block
- // should use a larger gap (like 20px) to distinguish those sub-blocks.
- n>=e&&(e=n+ +(i&&(
- // 0 always can not be readable gap level.
- !n||Ql(t)&&!t.noHeader)))})),e}return 0}function nu(t,e,n,o){var r,l=e.noHeader,u=(r=eu(e),{html:Kl[r],richText:Jl[r]}),c=[],d=e.blocks||[];s(!d||i(d)),d=d||[];var h=t.orderMode;if(e.sortBlocks&&h){d=d.slice();var f={valueAsc:"asc",valueDesc:"desc"};if(N(f,h)){var g=new Sl(f[h],null);d.sort((function(t,e){return g.evaluate(t.sortParam,e.sortParam)}))}
- // FIXME 'seriesDesc' necessary?
- else"seriesDesc"===h&&d.reverse()}a(d,(function(n,i){var r=e.valueFormatter,a=tu(n)(
- // Inherit valueFormatter
- r?p(p({},t),{valueFormatter:r}):t,n,i>0?u.html:0,o);null!=a&&c.push(a)}));var y="richText"===t.renderMode?c.join(u.richText):ru(o,c.join(""),l?n:u.html);if(l)return y;var m=sa(e.header,"ordinal",t.useUTC),v=ql(o,t.renderMode).nameStyle,x=jl(o);return"richText"===t.renderMode?au(t,m,v)+u.richText+y:ru(o,'<div style="'+v+";"+x+';">'+ot(m)+"</div>"+y,n)}function iu(t,e,o,r){var a=t.renderMode,s=e.noName,l=e.noValue,u=!e.markerType,c=e.name,d=t.useUTC,h=e.valueFormatter||t.valueFormatter||function(t){return t=i(t)?t:[t],n(t,(function(t,e){return sa(t,i(g)?g[e]:g,d)}))};if(!s||!l){var p=u?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",a),f=s?"":sa(c,"ordinal",d),g=e.valueType,y=l?[]:h(e.value,e.dataIndex),m=!u||!s,v=!u&&s,x=ql(r,a),_=x.nameStyle,b=x.valueStyle;return"richText"===a?(u?"":p)+(s?"":au(t,f,_))+(l?"":function(t,e,n,o,r){var a=[r],s=o?10:20;
- // Value has commas inside, so use ' ' as delimiter for multiple values.
- return n&&a.push({padding:[0,0,0,s],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(i(e)?e.join(" "):e,a)}(t,y,m,v,b)):ru(r,(u?"":p)+(s?"":function(t,e,n){return'<span style="'+n+";"+(e?"margin-left:2px":"")+'">'+ot(t)+"</span>"}(f,!u,_))+(l?"":function(t,e,o,r){
- // Do not too close to marker, considering there are multiple values separated by spaces.
- var a=o?"10px":"20px",s=e?"float:right;margin-left:"+a:"";return t=i(t)?t:[t],'<span style="'+s+";"+r+'">'+n(t,(function(t){return ot(t)})).join(" ")+"</span>"}(y,m,v,b)),o)}}
- /**
- * @return markupText. null/undefined means no content.
- */function ou(t,e,n,i,o,r){if(t)return tu(t)({useUTC:o,renderMode:n,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter},t,0,r)}function ru(t,e,n){return'<div style="'+("margin: "+n+"px 0 0")+";"+jl(t)+';">'+e+'<div style="clear:both"></div></div>'}function au(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function su(t,e){return ha(t.getData().getItemVisual(e,"style")[t.visualDrawType])}function lu(t,e){var n=t.get("padding");return null!=n?n:"richText"===e?[8,10]:10}
- /**
- * The major feature is generate styles for `renderMode: 'richText'`.
- * But it also serves `renderMode: 'html'` to provide
- * "renderMode-independent" API.
- */var uu=/** @class */function(){function e(){this.richTextStyles={},
- // Notice that "generate a style name" usually happens repeatedly when mouse is moving and
- // a tooltip is displayed. So we put the `_nextStyleNameId` as a member of each creator
- // rather than static shared by all creators (which will cause it increase to fast).
- this._nextStyleNameId=gn()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,n,i){var o="richText"===i?this._generateStyleName():null,r=da({color:n,type:e,renderMode:i,markerId:o});return t(r)?r:(this.richTextStyles[o]=r.style,r.content)},
- /**
- * @usage
- * ```ts
- * const styledText = markupStyleCreator.wrapRichTextStyle([
- * // The styles will be auto merged.
- * {
- * fontSize: 12,
- * color: 'blue'
- * },
- * {
- * padding: 20
- * }
- * ]);
- * ```
- */
- e.prototype.wrapRichTextStyle=function(t,e){var n={};i(e)?a(e,(function(t){return p(n,t)})):p(n,e);var o=this._generateStyleName();return this.richTextStyles[o]=n,"{"+o+"|"+t+"}"},e}();function cu(t){var n,o,r,s,l=t.series,u=t.dataIndex,c=t.multipleSeries,d=l.getData(),h=d.mapDimensionsAll("defaultedTooltip"),p=h.length,f=l.getRawValue(u),g=i(f),y=su(l,u);if(p>1||g&&!p){var m=function(t,n,i,o,r){
- // check: category-no-encode-has-axis-data in dataset.html
- var s=n.getData(),l=e(t,(function(t,e,n){var i=s.getDimensionInfo(n);return t||i&&!1!==i.tooltip&&null!=i.displayName}),!1),u=[],c=[],d=[];function h(t,e){var n=s.getDimensionInfo(e);
- // If `dimInfo.tooltip` is not set, show tooltip.
- n&&!1!==n.otherDims.tooltip&&(l?d.push($l("nameValue",{markerType:"subItem",markerColor:r,name:n.displayName,value:t,valueType:n.type})):(u.push(t),c.push(n.type)))}return o.length?a(o,(function(t){h(cl(s,i,t),t)})):a(t,h),{inlineValues:u,inlineValueTypes:c,blocks:d}}(f,l,u,h,y);n=m.inlineValues,o=m.inlineValueTypes,r=m.blocks,
- // Only support tooltip sort by the first inline value. It's enough in most cases.
- s=m.inlineValues[0]}else if(p){var v=d.getDimensionInfo(h[0]);s=n=cl(d,u,h[0]),o=v.type}else s=n=g?f[0]:f;
- // Do not show generated series name. It might not be readable.
- var x=kn(l),_=x&&l.name||"",b=d.getName(u),S=c?_:b;return $l("section",{header:_,
- // When series name is not specified, do not show a header line with only '-'.
- // This case always happens in tooltip.trigger: 'item'.
- noHeader:c||!x,sortParam:s,blocks:[$l("nameValue",{markerType:"item",markerColor:y,
- // Do not mix display seriesName and itemName in one tooltip,
- // which might confuses users.
- name:S,
- // name dimension might be auto assigned, where the name might
- // be not readable. So we check trim here.
- noName:!Q(S),value:n,valueType:o,dataIndex:u})].concat(r||[])})}var du=On();function hu(t,e){return t.getName(e)||t.getId(e)}var pu="__universalTransitionEnabled",fu=/** @class */function(t){function e(){
- // [Caution]: Because this class or desecendants can be used as `XXX.extend(subProto)`,
- // the class members must not be initialized in constructor or declaration place.
- // Otherwise there is bad case:
- // class A {xxx = 1;}
- // enableClassExtend(A);
- // class B extends A {}
- // var C = B.extend({xxx: 5});
- // var c = new C();
- // console.log(c.xxx); // expect 5 but always 1.
- var e=null!==t&&t.apply(this,arguments)||this;
- // ---------------------------------------
- // Props about data selection
- // ---------------------------------------
- return e._selectedDataIndicesMap={},e}return Ue(e,t),e.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=fl({count:yu,reset:mu}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),(du(this).sourceManager=new Yl(this)).prepareSource();var i=this.getInitialData(t,n);xu(i,this),this.dataTask.context.data=i,du(this).dataBeforeProcessed=i,
- // If we reverse the order (make data firstly, and then make
- // dataBeforeProcessed by cloneShallow), cloneShallow will
- // cause data.graph.data !== data when using
- // module:echarts/data/Graph or module:echarts/data/Tree.
- // See module:echarts/data/helper/linkSeriesData
- // Theoretically, it is unreasonable to call `seriesModel.getData()` in the model
- // init or merge stage, because the data can be restored. So we do not `restoreData`
- // and `setData` here, which forbids calling `seriesModel.getData()` in this stage.
- // Call `seriesModel.getRawData()` instead.
- // this.restoreData();
- gu(this),this._initSelectedMapFromData(i)},
- /**
- * Util for merge default and theme to option
- */
- e.prototype.mergeDefaultAndTheme=function(t,e){var n=ba(this),i=n?wa(t):{},o=this.subType;Ta.hasClass(o)&&(o+="Series"),tt(t,e.getTheme().get(this.subType)),tt(t,this.getDefaultOption()),
- // Default label emphasis `show`
- wn(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&Sa(t,i,n)},e.prototype.mergeOption=function(t,e){
- // this.settingTask.dirty();
- t=tt(this.option,t,!0),this.fillDataTextStyle(t.data);var n=ba(this);n&&Sa(this.option,t,n);var i=du(this).sourceManager;i.dirty(),i.prepareSource();var o=this.getInitialData(t,e);xu(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,du(this).dataBeforeProcessed=o,gu(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(t){
- // Default data label emphasis `show`
- // FIXME Tree structure data ?
- // FIXME Performance ?
- if(t&&!at(t))for(var e=["show"],n=0;n<t.length;n++)t[n]&&t[n].label&&wn(t[n],"label",e)},
- /**
- * Init a data structure from data related option in series
- * Must be overridden.
- */
- e.prototype.getInitialData=function(t,e){},
- /**
- * Append data to list
- */
- e.prototype.appendData=function(t){this.getRawData().appendData(t.data)},
- /**
- * Consider some method like `filter`, `map` need make new data,
- * We should make sure that `seriesModel.getData()` get correct
- * data in the stream procedure. So we fetch data from upstream
- * each time `task.perform` called.
- */
- e.prototype.getData=function(t){var e=bu(this);if(e){var n=e.context.data;return null!=t&&n.getLinkedData?n.getLinkedData(t):n}
- // When series is not alive (that may happen when click toolbox
- // restore or setOption with not merge mode), series data may
- // be still need to judge animation or something when graphic
- // elements want to know whether fade out.
- return du(this).data},e.prototype.getAllData=function(){var t=this.getData();return t&&t.getLinkedDataAll?t.getLinkedDataAll():[{data:t}]},e.prototype.setData=function(t){var e=bu(this);if(e){var n=e.context;
- // Consider case: filter, data sample.
- // FIXME:TS never used, so comment it
- // if (context.data !== data && task.modifyOutputEnd) {
- // task.setOutputEnd(data.count());
- // }
- n.outputData=t,
- // Caution: setData should update context.data,
- // Because getData may be called multiply in a
- // single stage and expect to get the data just
- // set. (For example, AxisProxy, x y both call
- // getData and setDate sequentially).
- // So the context.data should be fetched from
- // upstream each time when a stage starts to be
- // performed.
- e!==this.dataTask&&(n.data=t)}du(this).data=t},e.prototype.getEncode=function(){var t=this.get("encode",!0);if(t)return r(t)},e.prototype.getSourceManager=function(){return du(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},
- /**
- * Get data before processed
- */
- e.prototype.getRawData=function(){return du(this).dataBeforeProcessed},e.prototype.getColorBy=function(){return this.get("colorBy")||"series"},e.prototype.isColorBySeries=function(){return"series"===this.getColorBy()},
- /**
- * Get base axis if has coordinate system and has axis.
- * By default use coordSys.getBaseAxis();
- * Can be overridden for some chart.
- * @return {type} description
- */
- e.prototype.getBaseAxis=function(){var t=this.coordinateSystem;
- // @ts-ignore
- return t&&t.getBaseAxis&&t.getBaseAxis()},
- /**
- * Default tooltip formatter
- *
- * @param dataIndex
- * @param multipleSeries
- * @param dataType
- * @param renderMode valid values: 'html'(by default) and 'richText'.
- * 'html' is used for rendering tooltip in extra DOM form, and the result
- * string is used as DOM HTML content.
- * 'richText' is used for rendering tooltip in rich text form, for those where
- * DOM operation is not supported.
- * @return formatted tooltip with `html` and `markers`
- * Notice: The override method can also return string
- */
- e.prototype.formatTooltip=function(t,e,n){return cu({series:this,dataIndex:t,multipleSeries:e})},e.prototype.isAnimationEnabled=function(){var t=this.ecModel;
- // Disable animation if using echarts in node but not give ssr flag.
- // In ssr mode, renderToString will generate svg with css animation.
- if(d.node&&(!t||!t.ssr))return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),!!e},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel,o=es.prototype.getColorFromPalette.call(this,t,e,n);
- // PENDING
- return o||(o=i.getColorFromPalette(t,e,n)),o},
- /**
- * Use `data.mapDimensionsAll(coordDim)` instead.
- * @deprecated
- */
- e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},
- /**
- * Get progressive rendering count each step
- */
- e.prototype.getProgressive=function(){return this.get("progressive")},
- /**
- * Get progressive rendering count each step
- */
- e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},
- // PENGING If selectedMode is null ?
- e.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},e.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,o=this.getData(e);if("series"===i||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var r=0;r<t.length;r++){var a=hu(o,t[r]);n[a]=!1,this._selectedDataIndicesMap[a]=-1}}},e.prototype.toggleSelect=function(t,e){for(var n=[],i=0;i<t.length;i++)n[0]=t[i],this.isSelected(t[i],e)?this.unselect(n,e):this.select(n,e)},e.prototype.getSelectedDataIndices=function(){if("all"===this.option.selectedMap)return[].slice.call(this.getData().getIndices());for(var t=this._selectedDataIndicesMap,e=v(t),n=[],i=0;i<e.length;i++){var o=t[e[i]];o>=0&&n.push(o)}return n},e.prototype.isSelected=function(t,e){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(e);return("all"===n||n[hu(i,t)])&&!i.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[pu])return!0;var t=this.option.universalTransition;
- // Quick reject
- return!!t&&(!0===t||t&&t.enabled)},e.prototype._innerSelect=function(t,e){var n,i,r=this.option,a=r.selectedMode,s=e.length;if(a&&s)if("series"===a)r.selectedMap="all";else if("multiple"===a){o(r.selectedMap)||(r.selectedMap={});for(var l=r.selectedMap,u=0;u<s;u++){var c=e[u];
- // TODO different types of data share same object.
- l[h=hu(t,c)]=!0,this._selectedDataIndicesMap[h]=t.getRawIndex(c)}}else if("single"===a||!0===a){var d=e[s-1],h=hu(t,d);r.selectedMap=((n={})[h]=!0,n),this._selectedDataIndicesMap=((i={})[h]=t.getRawIndex(d),i)}},e.prototype._initSelectedMapFromData=function(t){
- // Ignore select info in data if selectedMap exists.
- // NOTE It's only for legacy usage. edge data is not supported.
- if(!this.option.selectedMap){var e=[];t.hasItemOption&&t.each((function(n){var i=t.getRawDataItem(n);i&&i.selected&&e.push(n)})),e.length>0&&this._innerSelect(t,e)}},
- // /**
- // * @see {module:echarts/stream/Scheduler}
- // */
- // abstract pipeTask: null
- e.registerClass=function(t){return Ta.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",
- // Make sure the values can be accessed!
- t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(Ta);
- /**
- * MUST be called after `prepareSource` called
- * Here we need to make auto series, especially for auto legend. But we
- * do not modify series.name in option to avoid side effects.
- */
- function gu(t){
- // User specified name has higher priority, otherwise it may cause
- // series can not be queried unexpectedly.
- var e=t.name;kn(t)||(t.name=function(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),i=[];return a(n,(function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)})),i.join(" ")}(t)||e)}function yu(t){return t.model.getRawData().count()}function mu(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),vu}function vu(t,e){
- // Avoid repeat cloneShallow when data just created in reset.
- e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}
- // TODO refactor
- function xu(t,e){a(ct(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),(function(n){t.wrapMethod(n,rt(_u,e))}))}function _u(t,e){var n=bu(t);return n&&
- // Consider case: filter, selectRange
- n.setOutputEnd((e||this).count()),e}function bu(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){
- // When pipline finished, the currrentTask keep the last
- // task (renderTask).
- var i=n.currentTask;if(i){var o=i.agentStubMap;o&&(i=o.get(t.uid))}return i}}nt(fu,hl),nt(fu,es),jn(fu,Ta);const Su=fu;var wu=/** @class */function(){function t(){this.group=new Z,this.uid=vr("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){
- // Do nothing;
- },t.prototype.updateLayout=function(t,e,n,i){
- // Do nothing;
- },t.prototype.updateVisual=function(t,e,n,i){
- // Do nothing;
- },
- /**
- * Hook for toggle blur target series.
- * Can be used in marker for blur or leave blur the markers
- */
- t.prototype.toggleBlurSeries=function(t,e,n){
- // Do nothing;
- },
- /**
- * Traverse the new rendered elements.
- *
- * It will traverse the new added element in progressive rendering.
- * And traverse all in normal rendering.
- */
- t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();Xn(wu),$n(wu);const Mu=wu;
- /**
- * @return {string} If large mode changed, return string 'reset';
- */function Iu(){var t=On();return function(e){var n=t(e),i=e.pipelineContext,o=!!n.large,r=!!n.progressiveRender,a=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(o===a&&r===s)&&"reset"}}var Du=On(),Tu=Iu(),Cu=/** @class */function(){function t(){this.group=new Z,this.uid=vr("viewChart"),this.renderTask=fl({plan:ku,reset:Pu}),this.renderTask.context={view:this}}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},
- /**
- * Highlight series or specified data item.
- */
- t.prototype.highlight=function(t,e,n,i){var o=t.getData(i&&i.dataType);o&&Lu(o,i,"emphasis")},
- /**
- * Downplay series or specified data item.
- */
- t.prototype.downplay=function(t,e,n,i){var o=t.getData(i&&i.dataType);o&&Lu(o,i,"normal")},
- /**
- * Remove self.
- */
- t.prototype.remove=function(t,e){this.group.removeAll()},
- /**
- * Dispose self.
- */
- t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){this.render(t,e,n,i)},
- // FIXME never used?
- t.prototype.updateLayout=function(t,e,n,i){this.render(t,e,n,i)},
- // FIXME never used?
- t.prototype.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},
- /**
- * Traverse the new rendered elements.
- *
- * It will traverse the new added element in progressive rendering.
- * And traverse all in normal rendering.
- */
- t.prototype.eachRendered=function(t){Bo(this.group,t)},t.markUpdateMethod=function(t,e){Du(t).updateMethod=e},t.protoInitialize=void(t.prototype.type="chart"),t}();
- /**
- * Set state of single element
- */
- function Au(t,e,n){t&&Ji(t)&&("emphasis"===e?ki:Pi)(t,n)}function Lu(t,e,n){var i=Nn(t,e),o=e&&null!=e.highlightKey?
- /**
- * Support highlight/downplay record on each elements.
- * For the case: hover highlight/downplay (legend, visualMap, ...) and
- * user triggered highlight/downplay should not conflict.
- * Only all of the highlightDigit cleared, return to normal.
- * @param {string} highlightKey
- * @return {number} highlightDigit
- */
- function(t){var e=ri[t];return null==e&&oi<=32&&(e=ri[t]=oi++),e}(e.highlightKey):null;null!=i?a(Sn(i),(function(e){Au(t.getItemGraphicEl(e),n,o)})):t.eachItemGraphicEl((function(t){Au(t,n,o)}))}function ku(t){return Tu(t.model)}function Pu(t){var e=t.model,n=t.ecModel,i=t.api,o=t.payload,r=e.pipelineContext.progressiveRender,a=t.view,s=o&&Du(o).updateMethod,l=r?"incrementalPrepareRender":s&&a[s]?s:"render";return"render"!==l&&a[l](e,n,i,o),Nu[l]}Xn(Cu),$n(Cu);var Nu={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{
- // Put view.render in `progress` to support appendData. But in this case
- // view.render should not be called in reset, otherwise it will be called
- // twise. Use `forceFirstProgress` to make sure that view.render is called
- // in any cases.
- forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};const Ou=Cu;
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */var Ru="\0__throttleOriginMethod",Eu="\0__throttleRate",Vu="\0__throttleType";
- /**
- * @public
- * @param {(Function)} fn
- * @param {number} [delay=0] Unit: ms.
- * @param {boolean} [debounce=false]
- * true: If call interval less than `delay`, only the last call works.
- * false: If call interval less than `delay, call works on fixed rate.
- * @return {(Function)} throttled fn.
- */
- function zu(t,e,n){var i,o,r,a,s,l=0,u=0,c=null;function d(){u=(new Date).getTime(),c=null,t.apply(r,a||[])}e=e||0;var h=function(){for(var t=[],h=0;h<arguments.length;h++)t[h]=arguments[h];i=(new Date).getTime(),r=this,a=t;var p=s||e,f=s||n;s=null,o=i-(f?l:u)-p,clearTimeout(c),
- // Here we should make sure that: the `exec` SHOULD NOT be called later
- // than a new call of `cb`, that is, preserving the command order. Consider
- // calculating "scale rate" when roaming as an example. When a call of `cb`
- // happens, either the `exec` is called dierectly, or the call is delayed.
- // But the delayed call should never be later than next call of `cb`. Under
- // this assurance, we can simply update view state each time `dispatchAction`
- // triggered by user roaming, but not need to add extra code to avoid the
- // state being "rolled-back".
- f?c=setTimeout(d,p):o>=0?d():c=setTimeout(d,-o),l=i};
- /**
- * Clear throttle.
- * @public
- */return h.clear=function(){c&&(clearTimeout(c),c=null)},
- /**
- * Enable debounce once.
- */
- h.debounceNextCall=function(t){s=t},h}
- /**
- * Create throttle method or update throttle rate.
- *
- * @example
- * ComponentView.prototype.render = function () {
- * ...
- * throttle.createOrUpdate(
- * this,
- * '_dispatchAction',
- * this.model.get('throttle'),
- * 'fixRate'
- * );
- * };
- * ComponentView.prototype.remove = function () {
- * throttle.clear(this, '_dispatchAction');
- * };
- * ComponentView.prototype.dispose = function () {
- * throttle.clear(this, '_dispatchAction');
- * };
- *
- */function Bu(t,e,n,i){var o=t[e];if(o){var r=o[Ru]||o,a=o[Vu];if(o[Eu]!==n||a!==i){if(null==n||!i)return t[e]=r;(o=t[e]=zu(r,n,"debounce"===i))[Ru]=r,o[Vu]=i,o[Eu]=n}return o}}
- /**
- * Clear throttle. Example see throttle.createOrUpdate.
- */function Gu(t,e){var n=t[e];n&&n[Ru]&&(
- // Clear throttle
- n.clear&&n.clear(),t[e]=n[Ru])}var Fu=On(),Wu={itemStyle:Qn(hr,!0),lineStyle:Qn(ur,!0)},Hu={lineStyle:"stroke",itemStyle:"fill"};function Yu(t,e){var n=t.visualStyleMapper||Wu[e];return n||Wu.itemStyle}function Uu(t,e){
- // return defaultColorKey[stylePath] ||
- var n=t.visualDrawType||Hu[e];return n||"fill"}var Zu={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",o=t.getModel(i),r=Yu(t,i)(o),a=o.getShallow("decal");a&&(n.setVisual("decal",a),a.dirty=!0);
- // TODO
- var s=Uu(t,i),l=r[s],u=f(l)?l:null,c="auto"===r.fill||"auto"===r.stroke;
- // Get from color palette by default.
- if(!r[s]||u||c){
- // Note: If some series has color specified (e.g., by itemStyle.color), we DO NOT
- // make it effect palette. Because some scenarios users need to make some series
- // transparent or as background, which should better not effect the palette.
- var d=t.getColorFromPalette(
- // TODO series count changed.
- t.name,null,e.getSeriesCount());r[s]||(r[s]=d,n.setVisual("colorFromPalette",!0)),r.fill="auto"===r.fill||f(r.fill)?d:r.fill,r.stroke="auto"===r.stroke||f(r.stroke)?d:r.stroke}
- // Only visible series has each data be visual encoded
- if(n.setVisual("style",r),n.setVisual("drawType",s),!e.isSeriesFiltered(t)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(e,n){var i=t.getDataParams(n),o=p({},r);o[s]=u(i),e.setItemVisual(n,"style",o)}}}},Xu=new yr,ju={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData&&!e.isSeriesFiltered(t)){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",o=Yu(t,i),r=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(t,e){
- // Not use getItemModel for performance considuration
- var n=t.getRawDataItem(e);if(n&&n[i]){Xu.option=n[i];var a=o(Xu),s=t.ensureUniqueItemVisual(e,"style");p(s,a),Xu.option.decal&&(t.setItemVisual(e,"decal",Xu.option.decal),Xu.option.decal.dirty=!0),r in a&&t.setItemVisual(e,"colorFromPalette",!1)}}:null}}}},qu={performRawSeries:!0,overallReset:function(t){
- // Each type of series uses one scope.
- // Pie and funnel are using different scopes.
- var e=r();t.eachSeries((function(t){var n=t.getColorBy();if(!t.isColorBySeries()){var i=t.type+"-"+n,o=e.get(i);o||(o={},e.set(i,o)),Fu(t).scope=o}})),t.eachSeries((function(e){if(!e.isColorBySeries()&&!t.isSeriesFiltered(e)){var n=e.getRawData(),i={},o=e.getData(),r=Fu(e).scope,a=e.visualStyleAccessPath||"itemStyle",s=Uu(e,a);o.each((function(t){var e=o.getRawIndex(t);i[e]=t})),
- // Iterate on data before filtered. To make sure color from palette can be
- // Consistent when toggling legend.
- n.each((function(t){var a=i[t];
- // Get color from palette for each data only when the color is inherited from series color, which is
- // also picked from color palette. So following situation is not in the case:
- // 1. series.itemStyle.color is set
- // 2. color is encoded by visualMap
- if(o.getItemVisual(a,"colorFromPalette")){var l=o.ensureUniqueItemVisual(a,"style"),u=n.getName(t)||t+"",c=n.count();l[s]=e.getColorFromPalette(u,r,c)}}))}}))}},Ku=Math.PI;var Ju=/** @class */function(){function t(t,e,n,i){
- // key: handlerUID
- this._stageTaskMap=r(),this.ecInstance=t,this.api=e,
- // Fix current processors in case that in some rear cases that
- // processors might be registered after echarts instance created.
- // Register processors incrementally for a echarts instance is
- // not supported by this stream architecture.
- n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return t.prototype.restoreData=function(t,e){
- // TODO: Only restore needed series and components, but not all components.
- // Currently `restoreData` of all of the series and component will be called.
- // But some independent components like `title`, `legend`, `graphic`, `toolbox`,
- // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`,
- // and some components like coordinate system, axes, dataZoom, visualMap only
- // need their target series refresh.
- // (1) If we are implementing this feature some day, we should consider these cases:
- // if a data processor depends on a component (e.g., dataZoomProcessor depends
- // on the settings of `dataZoom`), it should be re-performed if the component
- // is modified by `setOption`.
- // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`,
- // it should be re-performed when the result array of `getTargetSeries` changed.
- // We use `dependencies` to cover these issues.
- // (3) How to update target series when coordinate system related components modified.
- // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty,
- // and this case all of the tasks will be set as dirty.
- t.restoreData(e),
- // Theoretically an overall task not only depends on each of its target series, but also
- // depends on all of the series.
- // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks
- // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure
- // that the overall task is set as dirty and to be performed, otherwise it probably cause
- // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it
- // probably cause state chaos (consider `dataZoomProcessor`).
- this._stageTaskMap.each((function(t){var e=t.overallTask;e&&e.dirty()}))},
- // If seriesModel provided, incremental threshold is check by series data.
- t.prototype.getPerformArgs=function(t,e){
- // For overall task
- if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,o=!e&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex?n.step:null,r=i&&i.modDataCount;return{step:o,modBy:null!=r?Math.ceil(r/o):null,modDataCount:r}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},
- /**
- * Current, progressive rendering starts from visual and layout.
- * Always detect render mode in the same stage, avoiding that incorrect
- * detection caused by data filtering.
- * Caution:
- * `updateStreamModes` use `seriesModel.getData()`.
- */
- t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),o=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,r=t.get("large")&&i>=t.get("largeThreshold"),a="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:a,large:r}},t.prototype.restorePipelines=function(t){var e=this,n=e._pipelineMap=r();t.eachSeries((function(t){var i=t.getProgressive(),o=t.uid;n.set(o,{id:o,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),e._pipe(t,t.dataTask)}))},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;a(this._allHandlers,(function(i){var o=t.get(i.uid)||t.set(i.uid,{});s(!(i.reset&&i.overallReset),""),i.reset&&this._createSeriesStageTask(i,o,e,n),i.overallReset&&this._createOverallStageTask(i,o,e,n)}),this)},t.prototype.prepareView=function(t,e,n,i){var o=t.renderTask,r=o.context;r.model=e,r.ecModel=n,r.api=i,o.__block=!t.incrementalPrepareRender,this._pipe(e,o)},t.prototype.performDataProcessorTasks=function(t,e){
- // If we do not use `block` here, it should be considered when to update modes.
- this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,i){i=i||{};var o=!1,r=this;function s(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}a(t,(function(t,a){if(!i.visualType||i.visualType===t.visualType){var l=r._stageTaskMap.get(t.uid),u=l.seriesTaskMap,c=l.overallTask;if(c){var d,h=c.agentStubMap;h.each((function(t){s(i,t)&&(t.dirty(),d=!0)})),d&&c.dirty(),r.updatePayload(c,n);var p=r.getPerformArgs(c,i.block);
- // Execute stubs firstly, which may set the overall task dirty,
- // then execute the overall task. And stub will call seriesModel.setData,
- // which ensures that in the overallTask seriesModel.getData() will not
- // return incorrect data.
- h.each((function(t){t.perform(p)})),c.perform(p)&&(o=!0)}else u&&u.each((function(a,l){s(i,a)&&a.dirty();var u=r.getPerformArgs(a,i.block);
- // FIXME
- // if intending to declare `performRawSeries` in handlers, only
- // stream-independent (specifically, data item independent) operations can be
- // performed. Because if a series is filtered, most of the tasks will not
- // be performed. A stream-dependent operation probably cause wrong biz logic.
- // Perhaps we should not provide a separate callback for this case instead
- // of providing the config `performRawSeries`. The stream-dependent operations
- // and stream-independent operations should better not be mixed.
- u.skip=!t.performRawSeries&&e.isSeriesFiltered(a.context.model),r.updatePayload(a,n),a.perform(u)&&(o=!0)}))}})),this.unfinished=o||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries((function(t){
- // Progress to the end for dataInit and dataRestore.
- e=t.dataTask.perform()||e})),this.unfinished=e||this.unfinished},t.prototype.plan=function(){
- // Travel pipelines, check block.
- this._pipelineMap.each((function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)}))},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,i){var o=this,a=e.seriesTaskMap,s=e.seriesTaskMap=r(),l=t.seriesType,u=t.getTargetSeries;function c(e){var r=e.uid,l=s.set(r,a&&a.get(r)||fl({plan:nc,reset:ic,count:ac}));
- // Init tasks for each seriesModel only once.
- // Reuse original task instance.
- l.context={model:e,ecModel:n,api:i,
- // PENDING: `useClearVisual` not used?
- useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:o},o._pipe(e,l)}
- // If a stageHandler should cover all series, `createOnAllSeries` should be declared mandatorily,
- // to avoid some typo or abuse. Otherwise if an extension do not specify a `seriesType`,
- // it works but it may cause other irrelevant charts blocked.
- t.createOnAllSeries?n.eachRawSeries(c):l?n.eachRawSeriesByType(l,c):u&&u(n,i).each(c)},t.prototype._createOverallStageTask=function(t,e,n,i){var o=this,l=e.overallTask=e.overallTask||fl({reset:$u});l.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:o};var u=l.agentStubMap,c=l.agentStubMap=r(),d=t.seriesType,h=t.getTargetSeries,p=!0,f=!1;
- // The count of stages are totally about only several dozen, so
- // do not need to reuse the map.
- function g(t){var e=t.uid,n=c.set(e,u&&u.get(e)||(
- // When the result of `getTargetSeries` changed, the overallTask
- // should be set as dirty and re-performed.
- f=!0,fl({reset:Qu,onDirty:ec})));n.context={model:t,overallProgress:p},n.agent=l,n.__block=p,o._pipe(t,n)}s(!t.createOnAllSeries,""),d?n.eachRawSeriesByType(d,g):h?h(n,i).each(g):(p=!1,a(n.getSeries(),g)),f&&l.dirty()},t.prototype._pipe=function(t,e){var n=t.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=e),i.tail&&i.tail.pipe(e),i.tail=e,e.__idxInPipeline=i.count++,e.__pipeline=i},t.wrapStageHandler=function(t,e){return f(t)&&(t={overallReset:t,seriesType:sc(t)}),t.uid=vr("stageHandler"),e&&(t.visualType=e),t},t}();function $u(t){t.overallReset(t.ecModel,t.api,t.payload)}function Qu(t){return t.overallProgress&&tc}function tc(){this.agent.dirty(),this.getDownstream().dirty()}function ec(){this.agent&&this.agent.dirty()}function nc(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function ic(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=Sn(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?n(e,(function(t,e){return rc(e)})):oc}var oc=rc(0);function rc(t){return function(e,n){var i=n.data,o=n.resetDefines[t];if(o&&o.dataEach)for(var r=e.start;r<e.end;r++)o.dataEach(i,r);else o&&o.progress&&o.progress(e,i)}}function ac(t){return t.data.count()}
- /**
- * Only some legacy stage handlers (usually in echarts extensions) are pure function.
- * To ensure that they can work normally, they should work in block mode, that is,
- * they should not be started util the previous tasks finished. So they cause the
- * progressive rendering disabled. We try to detect the series type, to narrow down
- * the block range to only the series type they concern, but not all series.
- */function sc(t){lc=null;try{
- // Assume there is no async when calling `eachSeriesByType`.
- t(uc,cc)}catch(e){}return lc}var lc,uc={},cc={};function dc(t,e){
- /* eslint-disable */
- for(var n in e.prototype)
- // Do not use hasOwnProperty
- t[n]=dt;
- /* eslint-enable */}dc(uc,us),dc(cc,ds),uc.eachSeriesByType=uc.eachRawSeriesByType=function(t){lc=t},uc.eachComponent=function(t){"series"===t.mainType&&t.subType&&(lc=t.subType)};const hc=Ju;
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */var pc=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"];const fc={color:pc,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],pc]};
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */var gc="#B9B8CE",yc="#100C2A",mc=function(){return{axisLine:{lineStyle:{color:gc}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},vc=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],xc={darkMode:!0,color:vc,backgroundColor:yc,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{
- // TODO Contrast of label backgorundColor
- color:"#fff"}},legend:{textStyle:{color:gc},pageTextStyle:{color:gc}},textStyle:{color:gc},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:gc}},dataZoom:{borderColor:"#71708A",textStyle:{color:gc},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:gc}},timeline:{lineStyle:{color:gc},label:{color:gc},controlStyle:{color:gc,borderColor:gc}},calendar:{itemStyle:{color:yc},dayLabel:{color:gc},monthLabel:{color:gc},yearLabel:{color:gc}},timeAxis:mc(),logAxis:mc(),valueAxis:mc(),categoryAxis:mc(),line:{symbol:"circle"},graph:{color:vc},gauge:{title:{color:gc},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:gc},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};xc.categoryAxis.splitLine.show=!1;const _c=xc;
- /**
- * Usage of query:
- * `chart.on('click', query, handler);`
- * The `query` can be:
- * + The component type query string, only `mainType` or `mainType.subType`,
- * like: 'xAxis', 'series', 'xAxis.category' or 'series.line'.
- * + The component query object, like:
- * `{seriesIndex: 2}`, `{seriesName: 'xx'}`, `{seriesId: 'some'}`,
- * `{xAxisIndex: 2}`, `{xAxisName: 'xx'}`, `{xAxisId: 'some'}`.
- * + The data query object, like:
- * `{dataIndex: 123}`, `{dataType: 'link'}`, `{name: 'some'}`.
- * + The other query object (cmponent customized query), like:
- * `{element: 'some'}` (only available in custom series).
- *
- * Caveat: If a prop in the `query` object is `null/undefined`, it is the
- * same as there is no such prop in the `query` object.
- */var bc=/** @class */function(){function e(){}return e.prototype.normalizeQuery=function(e){var n={},i={},o={};
- // `query` is `mainType` or `mainType.subType` of component.
- if(t(e)){var r=Zn(e);
- // `.main` and `.sub` may be ''.
- n.mainType=r.main||null,n.subType=r.sub||null}
- // `query` is an object, convert to {mainType, index, name, id}.
- else{
- // `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved,
- // can not be used in `compomentModel.filterForExposedEvent`.
- var s=["Index","Name","Id"],l={name:1,dataIndex:1,dataType:1};a(e,(function(t,e){for(var r=!1,a=0;a<s.length;a++){var u=s[a],c=e.lastIndexOf(u);if(c>0&&c===e.length-u.length){var d=e.slice(0,c);
- // Consider `dataIndex`.
- "data"!==d&&(n.mainType=d,n[u.toLowerCase()]=t,r=!0)}}l.hasOwnProperty(e)&&(i[e]=t,r=!0),r||(o[e]=t)}))}return{cptQuery:n,dataQuery:i,otherQuery:o}},e.prototype.filter=function(t,e){
- // They should be assigned before each trigger call.
- var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,o=n.packedEvent,r=n.model,a=n.view;
- // For event like 'globalout'.
- if(!r||!a)return!0;var s=e.cptQuery,l=e.dataQuery;return u(s,r,"mainType")&&u(s,r,"subType")&&u(s,r,"index","componentIndex")&&u(s,r,"name")&&u(s,r,"id")&&u(l,o,"name")&&u(l,o,"dataIndex")&&u(l,o,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(t,e.otherQuery,i,o));function u(t,e,n,i){return null==t[n]||e[i||n]===t[n]}},e.prototype.afterTrigger=function(){
- // Make sure the eventInfo won't be used in next trigger.
- this.eventInfo=null},e}(),Sc=["symbol","symbolSize","symbolRotate","symbolOffset"],wc=Sc.concat(["symbolKeepAspect"]),Mc={createOnAllSeries:!0,
- // For legend.
- performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var i={},o={},r=!1,a=0;a<Sc.length;a++){var s=Sc[a],l=t.get(s);f(l)?(r=!0,o[s]=l):i[s]=l}
- // Only visible series has each data be visual encoded
- if(i.symbol=i.symbol||t.defaultSymbol,n.setVisual(p({legendIcon:t.legendIcon||i.symbol,symbolKeepAspect:t.get("symbolKeepAspect")},i)),!e.isSeriesFiltered(t)){var u=v(o);return{dataEach:r?function(e,n){for(var i=t.getRawValue(n),r=t.getDataParams(n),a=0;a<u.length;a++){var s=u[a];e.setItemVisual(n,s,o[s](i,r))}}:null}}}}},Ic={createOnAllSeries:!0,
- // For legend.
- performRawSeries:!0,reset:function(t,e){if(t.hasSymbolVisual&&!e.isSeriesFiltered(t))return{dataEach:t.getData().hasItemOption?function(t,e){for(var n=t.getItemModel(e),i=0;i<wc.length;i++){var o=wc[i],r=n.getShallow(o,!0);null!=r&&t.setItemVisual(e,o,r)}}:null};
- // Only visible series has each data be visual encoded
- }};
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- function Dc(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n)}}function Tc(t,e){switch(e){case"color":return t.getVisual("style")[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}function Cc(t,e,n,i){switch(n){case"color":t.ensureUniqueItemVisual(e,"style")[t.getVisual("drawType")]=i,
- // Mark the color has been changed, not from palette anymore
- t.setItemVisual(e,"colorFromPalette",!1);break;case"opacity":t.ensureUniqueItemVisual(e,"style").opacity=i;break;case"symbol":case"symbolSize":case"liftZ":t.setItemVisual(e,n,i)}}
- // Legacy data selection action.
- // Includes: pieSelect, pieUnSelect, pieToggleSelect, mapSelect, mapUnSelect, mapToggleSelect
- function Ac(t,e){function n(e,n){var i=[];return e.eachComponent({mainType:"series",subType:t,query:n},(function(t){i.push(t.seriesIndex)})),i}a([[t+"ToggleSelect","toggleSelect"],[t+"Select","select"],[t+"UnSelect","unselect"]],(function(t){e(t[0],(function(e,i,o){e=p({},e),o.dispatchAction(p(e,{type:t[1],seriesIndex:n(i,e)}))}))}))}function Lc(e,n,o,r,a){var s=e+n;o.isSilent(s)||r.eachComponent({mainType:"series",subType:"pie"},(function(e){for(var n=e.seriesIndex,r=e.option.selectedMap,l=a.selected,u=0;u<l.length;u++)if(l[u].seriesIndex===n){var c=e.getData(),d=Nn(c,a.fromActionPayload);o.trigger(s,{type:s,seriesId:e.id,name:i(d)?c.getName(d[0]):c.getName(d),selected:t(r)?r:p({},r)})}}))}
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- function kc(t,e,n){for(var i;t&&(!e(t)||(i=t,!n));)t=t.__hostTarget||t.parent;return i}
- /**
- * Triangle shape
- * @inner
- */var Pc=g.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var n=e.cx,i=e.cy,o=e.width/2,r=e.height/2;t.moveTo(n,i-r),t.lineTo(n+o,i+r),t.lineTo(n-o,i+r),t.closePath()}}),Nc=g.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var n=e.cx,i=e.cy,o=e.width/2,r=e.height/2;t.moveTo(n,i-r),t.lineTo(n+o,i),t.lineTo(n,i+r),t.lineTo(n-o,i),t.closePath()}}),Oc=g.extend({type:"pin",shape:{
- // x, y on the cusp
- x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.x,i=e.y,o=e.width/5*3,r=Math.max(o,e.height),a=o/2,s=a*a/(r-a),l=i-r+a+s,u=Math.asin(s/a),c=Math.cos(u)*a,d=Math.sin(u),h=Math.cos(u),p=.6*a,f=.7*a;t.moveTo(n-c,l+s),t.arc(n,l,a,Math.PI-u,2*Math.PI+u),t.bezierCurveTo(n+c-d*p,l+s+h*p,n,i-f,n,i),t.bezierCurveTo(n,i-f,n-c+d*p,l+s+h*p,n-c,l+s),t.closePath()}}),Rc=g.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.height,i=e.width,o=e.x,r=e.y,a=i/3*2;t.moveTo(o,r),t.lineTo(o+a,r+n),t.lineTo(o,r+n/4*3),t.lineTo(o-a,r+n),t.lineTo(o,r),t.closePath()}}),Ec={line:function(t,e,n,i,o){o.x1=t,o.y1=e+i/2,o.x2=t+n,o.y2=e+i/2},rect:function(t,e,n,i,o){o.x=t,o.y=e,o.width=n,o.height=i},roundRect:function(t,e,n,i,o){o.x=t,o.y=e,o.width=n,o.height=i,o.r=Math.min(n,i)/4},square:function(t,e,n,i,o){var r=Math.min(n,i);o.x=t,o.y=e,o.width=r,o.height=r},circle:function(t,e,n,i,o){
- // Put circle in the center of square
- o.cx=t+n/2,o.cy=e+i/2,o.r=Math.min(n,i)/2},diamond:function(t,e,n,i,o){o.cx=t+n/2,o.cy=e+i/2,o.width=n,o.height=i},pin:function(t,e,n,i,o){o.x=t+n/2,o.y=e+i/2,o.width=n,o.height=i},arrow:function(t,e,n,i,o){o.x=t+n/2,o.y=e+i/2,o.width=n,o.height=i},triangle:function(t,e,n,i,o){o.cx=t+n/2,o.cy=e+i/2,o.width=n,o.height=i}},Vc={};
- /**
- * Diamond shape
- * @inner
- */a({line:F,rect:G,roundRect:G,square:G,circle:O,diamond:Nc,pin:Oc,arrow:Rc,triangle:Pc},(function(t,e){Vc[e]=new t}));var zc=g.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,n){var i=ht(t,e,n),o=this.shape;return o&&"pin"===o.symbolType&&"inside"===e.position&&(i.y=n.y+.4*n.height),i},buildPath:function(t,e,n){var i=e.symbolType;if("none"!==i){var o=Vc[i];o||(o=Vc[
- // Default rect
- i="rect"]),Ec[i](e.x,e.y,e.width,e.height,o.shape),o.buildPath(t,o.shape,n)}}});
- // Provide setColor helper method to avoid determine if set the fill or stroke outside
- function Bc(t,e){if("image"!==this.type){var n=this.style;this.__isEmptyBrush?(n.stroke=t,n.fill=e||"#fff",
- // TODO Same width with lineStyle in LineView
- n.lineWidth=2):"line"===this.shape.symbolType?n.stroke=t:n.fill=t,this.markRedraw()}}
- /**
- * Create a symbol element with given symbol configuration: shape, x, y, width, height, color
- */function Gc(t,e,n,i,o,r,
- // whether to keep the ratio of w/h,
- a){
- // TODO Support image object, DynamicImage.
- var s,l=0===t.indexOf("empty");return l&&(t=t.substr(5,1).toLowerCase()+t.substr(6)),(s=0===t.indexOf("image://")?_o(t.slice(8),new Y(e,n,i,o),a?"center":"cover"):0===t.indexOf("path://")?xo(t.slice(7),{},new Y(e,n,i,o),a?"center":"cover"):new zc({shape:{symbolType:t,x:e,y:n,width:i,height:o}})).__isEmptyBrush=l,
- // TODO Should deprecate setColor
- s.setColor=Bc,r&&s.setColor(r),s}function Fc(t){return i(t)||(t=[+t,+t]),[t[0]||0,t[1]||0]}function Wc(t,e){if(null!=t)return i(t)||(t=[t,t]),[je(t[0],e[0])||0,je(x(t[1],t[0]),e[1])||0]}var Hc=new pt,Yc=new ft(100),Uc=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];
- /**
- * Create or update pattern image from decal options
- *
- * @param {InnerDecalObject | 'none'} decalObject decal options, 'none' if no decal
- * @return {Pattern} pattern with generated image, null if no decal
- */
- function Zc(e,o){if("none"===e)return null;var r=o.getDevicePixelRatio(),a=o.getZr(),s="svg"===a.painter.type;e.dirty&&Hc.delete(e);var u=Hc.get(e);if(u)return u;var c=I(e,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});"none"===c.backgroundColor&&(c.backgroundColor=null);var d={repeat:"repeat"};return function(e){for(var o,u=[r],d=!0,h=0;h<Uc.length;++h){var p=c[Uc[h]];if(null!=p&&!i(p)&&!t(p)&&!l(p)&&"boolean"!=typeof p){d=!1;break}u.push(p)}if(d){o=u.join(",")+(s?"-svg":"");var f=Yc.get(o);f&&(s?e.svgElement=f:e.image=f)}var g,y=jc(c.dashArrayX),m=
- /**
- * Convert dash input into dashArray
- *
- * @param {DecalDashArrayY} dash dash input
- * @return {number[]} normolized dash array
- */
- function(t){if(!t||"object"==typeof t&&0===t.length)return[0,0];if(l(t)){var e=Math.ceil(t);return[e,e]}var i=n(t,(function(t){return Math.ceil(t)}));return t.length%2?i.concat(i):i}
- /**
- * Get block length of each line. A block is the length of dash line and space.
- * For example, a line with [4, 1] has a dash line of 4 and a space of 1 after
- * that, so the block length of this line is 5.
- *
- * @param {number[][]} dash dash array of X or Y
- * @return {number[]} block length of each line
- */(c.dashArrayY),v=Xc(c.symbol),x=(M=y,n(M,(function(t){return qc(t)}))),_=qc(m),b=!s&>.createCanvas(),S=s&&{tag:"g",attrs:{},key:"dcl",children:[]},w=
- /**
- * Get minimum length that can make a repeatable pattern.
- *
- * @return {Object} pattern width and height
- */
- function(){for(
- /**
- * For example, if dash is [[3, 2], [2, 1]] for X, it looks like
- * |--- --- --- --- --- ...
- * |-- -- -- -- -- -- -- -- ...
- * |--- --- --- --- --- ...
- * |-- -- -- -- -- -- -- -- ...
- * So the minimum length of X is 15,
- * which is the least common multiple of `3 + 2` and `2 + 1`
- * |--- --- --- |--- --- ...
- * |-- -- -- -- -- |-- -- -- ...
- */
- var t=1,e=0,n=x.length;e<n;++e)t=mn(t,x[e]);var i=1;for(e=0,n=v.length;e<n;++e)i=mn(i,v[e].length);t*=i;var o=_*x.length*v.length;return{width:Math.max(1,Math.min(t,c.maxTileWidth)),height:Math.max(1,Math.min(o,c.maxTileHeight))}}();var M;b&&(b.width=w.width*r,b.height=w.height*r,g=b.getContext("2d"));(function(){g&&(g.clearRect(0,0,b.width,b.height),c.backgroundColor&&(g.fillStyle=c.backgroundColor,g.fillRect(0,0,b.width,b.height)));for(var t=0,e=0;e<m.length;++e)t+=m[e];if(t<=0)
- // dashArrayY is 0, draw nothing
- return;var n=-_,i=0,o=0,l=0;for(;n<w.height;){if(i%2==0){for(var u=o/2%v.length,d=0,h=0,p=0;d<2*w.width;){var f=0;for(e=0;e<y[l].length;++e)f+=y[l][e];if(f<=0)
- // Skip empty line
- break;
- // E.g., [15, 5, 20, 5] draws only for 15 and 20
- if(h%2==0){var x=.5*(1-c.symbolSize),M=d+y[l][h]*x,I=n+m[i]*x,D=y[l][h]*c.symbolSize,T=m[i]*c.symbolSize,C=p/2%v[u].length;A(M,I,D,T,v[u][C])}d+=y[l][h],++p,++h===y[l].length&&(h=0)}++l===y.length&&(l=0)}n+=m[i],++o,++i===m.length&&(i=0)}function A(t,e,n,i,o){var l=s?1:r,u=Gc(o,t*l,e*l,n*l,i*l,c.color,c.symbolKeepAspect);if(s){var d=a.painter.renderOneToVNode(u);d&&S.children.push(d)}else
- // Paint to canvas for all other renderers.
- yt(g,u)}})(),d&&Yc.put(o,b||S);e.image=b,e.svgElement=S,e.svgWidth=w.width,e.svgHeight=w.height}(d),d.rotation=c.rotation,d.scaleX=d.scaleY=s?1:1/r,Hc.set(e,d),e.dirty=!1,d}
- /**
- * Convert symbol array into normalized array
- *
- * @param {string | (string | string[])[]} symbol symbol input
- * @return {string[][]} normolized symbol array
- */function Xc(e){if(!e||0===e.length)return[["rect"]];if(t(e))return[[e]];for(var n=!0,i=0;i<e.length;++i)if(!t(e[i])){n=!1;break}if(n)return Xc([e]);var o=[];for(i=0;i<e.length;++i)t(e[i])?o.push([e[i]]):o.push(e[i]);return o}
- /**
- * Convert dash input into dashArray
- *
- * @param {DecalDashArrayX} dash dash input
- * @return {number[][]} normolized dash array
- */function jc(t){if(!t||0===t.length)return[[0,0]];if(l(t))return[[r=Math.ceil(t),r]];
- /**
- * [20, 5] should be normalized into [[20, 5]],
- * while [20, [5, 10]] should be normalized into [[20, 20], [5, 10]]
- */for(var e=!0,i=0;i<t.length;++i)if(!l(t[i])){e=!1;break}if(e)return jc([t]);var o=[];for(i=0;i<t.length;++i)if(l(t[i])){var r=Math.ceil(t[i]);o.push([r,r])}else{(r=n(t[i],(function(t){return Math.ceil(t)}))).length%2==1?
- // [4, 2, 1] means |---- - -- |---- - -- |
- // so normalize it to be [4, 2, 1, 4, 2, 1]
- o.push(r.concat(r)):o.push(r)}return o}function qc(t){for(var e=0,n=0;n<t.length;++n)e+=t[n];return t.length%2==1?2*e:e}const Kc=new mt;
- // Implementation of exported APIs. For example registerMap, getMap.
- // The implementations will be registered when installing the component.
- // Avoid these code being bundled to the core module.
- var Jc={};
- // TODO Type
- function $c(t){return Jc[t]}var Qc=2e3,td=4500,ed={PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:Qc,CHART:3e3,POST_CHART_LAYOUT:4600,COMPONENT:4e3,BRUSH:5e3,CHART_ITEM:td,ARIA:6e3,DECAL:7e3}},nd="__flagInMainProcess",id="__pendingUpdate",od="__needsUpdateStatus",rd=/^[a-zA-Z0-9_]+$/,ad="__connectUpdateStatus";function sd(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!this.isDisposed())return ud(this,t,e);this.id}}function ld(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return ud(this,t,e)}}function ud(t,e,n){
- // `args[0]` is event name. Event name is all lowercase.
- return n[0]=n[0]&&n[0].toLowerCase(),mt.prototype[e].apply(t,n)}var cd,dd,hd,pd,fd,gd,yd,md,vd,xd,_d,bd,Sd,wd,Md,Id,Dd,Td,Cd=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e}(mt),Ad=Cd.prototype;Ad.on=ld("on"),Ad.off=ld("off");var Ld=/** @class */function(e){function s(n,
- // Theme name or themeOption.
- i,o){var a=e.call(this,new bc)||this;a._chartsViews=[],a._chartsMap={},a._componentsViews=[],a._componentsMap={},
- // Can't dispatch action during rendering procedure
- a._pendingActions=[],o=o||{},
- // Get theme by name
- t(i)&&(i=zd[i]),a._dom=n;o.ssr&&bt((function(t){var e=ni(t),n=e.dataIndex;if(null!=n){var i=r();return i.set("series_index",e.seriesIndex),i.set("data_index",n),e.ssrType&&i.set("ssr_type",e.ssrType),i}}));var s=a._zr=vt(n,{renderer:o.renderer||"canvas",devicePixelRatio:o.devicePixelRatio,width:o.width,height:o.height,ssr:o.ssr,useDirtyRect:x(o.useDirtyRect,!1),useCoarsePointer:x(o.useCoarsePointer,"auto"),pointerSize:o.pointerSize});a._ssr=o.ssr,
- // Expect 60 fps.
- a._throttledZrFlush=zu(lt(s.flush,s),17),(i=et(i))&&zs(i,!0),a._theme=i,a._locale=function(e){if(t(e)){var n=wr[e.toUpperCase()]||{};return e===_r||e===br?et(n):tt(et(n),et(wr[Sr]),!1)}return tt(et(e),et(wr[Sr]),!1)}(o.locale||Ir),a._coordSysMgr=new fs;var l=a._api=Md(a);
- // Sort on demand
- function u(t,e){return t.__prio-e.__prio}return xt(Vd,u),xt(Rd,u),a._scheduler=new hc(a,l,Rd,Vd),a._messageCenter=new Cd,
- // Init mouse events
- a._initEvents(),
- // In case some people write `window.onresize = chart.resize`
- a.resize=lt(a.resize,a),s.animation.on("frame",a._onframe,a),xd(s,a),_d(s,a),
- // ECharts instance can be used as value.
- ut(a),a}return Ue(s,e),s.prototype._onframe=function(){if(!this._disposed){Td(this);var t=this._scheduler;
- // Lazy update
- if(this[id]){var e=this[id].silent;this[nd]=!0;try{cd(this),pd.update.call(this,null,this[id].updateParams)}catch(a){throw this[nd]=!1,this[id]=null,a}
- // At present, in each frame, zrender performs:
- // (1) animation step forward.
- // (2) trigger('frame') (where this `_onframe` is called)
- // (3) zrender flush (render).
- // If we do nothing here, since we use `setToFinal: true`, the step (3) above
- // will render the final state of the elements before the real animation started.
- this._zr.flush(),this[nd]=!1,this[id]=null,md.call(this,e),vd.call(this,e)}
- // Avoid do both lazy update and progress in one frame.
- else if(t.unfinished){
- // Stream progress.
- var n=1,i=this._model,o=this._api;t.unfinished=!1;do{var r=+new Date;t.performSeriesTasks(i),
- // Currently dataProcessorFuncs do not check threshold.
- t.performDataProcessorTasks(i),gd(this,i),
- // Do not update coordinate system here. Because that coord system update in
- // each frame is not a good user experience. So we follow the rule that
- // the extent of the coordinate system is determined in the first frame (the
- // frame is executed immediately after task reset.
- // this._coordSysMgr.update(ecModel, api);
- // console.log('--- ec frame visual ---', remainTime);
- t.performVisualTasks(i),wd(this,this._model,o,"remain",{}),n-=+new Date-r}while(n>0&&t.unfinished);
- // Call flush explicitly for trigger finished event.
- t.unfinished||this._zr.flush();
- // Else, zr flushing be ensue within the same frame,
- // because zr flushing is after onframe event.
- }}},s.prototype.getDom=function(){return this._dom},s.prototype.getId=function(){return this.id},s.prototype.getZr=function(){return this._zr},s.prototype.isSSR=function(){return this._ssr},
- /* eslint-disable-next-line */
- s.prototype.setOption=function(t,e,n){if(!this[nd])if(this._disposed)this.id;else{var i,r,a;if(o(e)&&(n=e.lazyUpdate,i=e.silent,r=e.replaceMerge,a=e.transition,e=e.notMerge),this[nd]=!0,!this._model||e){var s=new vs(this._api),l=this._theme,u=this._model=new us;u.scheduler=this._scheduler,u.ssr=this._ssr,u.init(null,null,null,l,this._locale,s)}this._model.setOption(t,{replaceMerge:r},Ed);var c={seriesTransition:a,optionChanged:!0};if(n)this[id]={silent:i,updateParams:c},this[nd]=!1,
- // `setOption(option, {lazyMode: true})` may be called when zrender has been slept.
- // It should wake it up to make sure zrender start to render at the next frame.
- this.getZr().wakeUp();else{try{cd(this),pd.update.call(this,null,c)}catch(d){throw this[id]=null,this[nd]=!1,d}
- // Ensure zr refresh sychronously, and then pixel in canvas can be
- // fetched after `setOption`.
- this._ssr||
- // not use flush when using ssr mode.
- this._zr.flush(),this[id]=null,this[nd]=!1,md.call(this,i),vd.call(this,i)}}},
- /**
- * @deprecated
- */
- s.prototype.setTheme=function(){},
- // We don't want developers to use getModel directly.
- s.prototype.getModel=function(){return this._model},s.prototype.getOption=function(){return this._model&&this._model.getOption()},s.prototype.getWidth=function(){return this._zr.getWidth()},s.prototype.getHeight=function(){return this._zr.getHeight()},s.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr
- /* eslint-disable-next-line */||d.hasGlobalWindow&&window.devicePixelRatio||1},
- /**
- * Get canvas which has all thing rendered
- * @deprecated Use renderToCanvas instead.
- */
- s.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},s.prototype.renderToCanvas=function(t){return t=t||{},this._zr.painter.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},s.prototype.renderToSVGString=function(t){return t=t||{},this._zr.painter.renderToString({useViewBox:t.useViewBox})},
- /**
- * Get svg data url
- */
- s.prototype.getSvgDataURL=function(){if(d.svgSupported){var t=this._zr,e=t.storage.getDisplayList();
- // Stop animations
- return a(e,(function(t){t.stopAnimation(null,!0)})),t.painter.toDataURL()}},s.prototype.getDataURL=function(t){if(!this._disposed){var e=(t=t||{}).excludeComponents,n=this._model,i=[],o=this;a(e,(function(t){n.eachComponent({mainType:t},(function(t){var e=o._componentsMap[t.__viewId];e.group.ignore||(i.push(e),e.group.ignore=!0)}))}));var r="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return a(i,(function(t){t.group.ignore=!1})),r}this.id},s.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,n=this.group,i=Math.min,o=Math.max,r=Infinity;if(Fd[n]){var s=r,l=r,u=-Infinity,c=-Infinity,d=[],h=t&&t.pixelRatio||this.getDevicePixelRatio();a(Gd,(function(r,a){if(r.group===n){var h=e?r.getZr().painter.getSvgDom().innerHTML:r.renderToCanvas(et(t)),p=r.getDom().getBoundingClientRect();s=i(p.left,s),l=i(p.top,l),u=o(p.right,u),c=o(p.bottom,c),d.push({dom:h,left:p.left,top:p.top})}}));var p=(u*=h)-(s*=h),f=(c*=h)-(l*=h),g=gt.createCanvas(),y=vt(g,{renderer:e?"svg":"canvas"});if(y.resize({width:p,height:f}),e){var m="";return a(d,(function(t){var e=t.left-s,n=t.top-l;m+='<g transform="translate('+e+","+n+')">'+t.dom+"</g>"})),y.painter.getSvgRoot().innerHTML=m,t.connectedBackgroundColor&&y.painter.setBackgroundColor(t.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}
- // Background between the charts
- return t.connectedBackgroundColor&&y.add(new G({shape:{x:0,y:0,width:p,height:f},style:{fill:t.connectedBackgroundColor}})),a(d,(function(t){var e=new b({style:{x:t.left*h-s,y:t.top*h-l,image:t.dom}});y.add(e)})),y.refreshImmediately(),g.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}this.id},s.prototype.convertToPixel=function(t,e){return fd(this,"convertToPixel",t,e)},s.prototype.convertFromPixel=function(t,e){return fd(this,"convertFromPixel",t,e)},
- /**
- * Is the specified coordinate systems or components contain the given pixel point.
- * @param {Array|number} value
- * @return {boolean} result
- */
- s.prototype.containPixel=function(t,e){if(!this._disposed){var n,i=En(this._model,t);return a(i,(function(t,i){i.indexOf("Models")>=0&&a(t,(function(t){var o=t.coordinateSystem;if(o&&o.containPoint)n=n||!!o.containPoint(e);else if("seriesModels"===i){var r=this._chartsMap[t.__viewId];r&&r.containPoint&&(n=n||r.containPoint(e,t))}}),this)}),this),!!n}this.id},
- /**
- * Get visual from series or data.
- * @param finder
- * If string, e.g., 'series', means {seriesIndex: 0}.
- * If Object, could contain some of these properties below:
- * {
- * seriesIndex / seriesId / seriesName,
- * dataIndex / dataIndexInside
- * }
- * If dataIndex is not specified, series visual will be fetched,
- * but not data item visual.
- * If all of seriesIndex, seriesId, seriesName are not specified,
- * visual will be fetched from first series.
- * @param visualType 'color', 'symbol', 'symbolSize'
- */
- s.prototype.getVisual=function(t,e){var n=En(this._model,t,{defaultMainType:"series"}),i=n.seriesModel.getData(),o=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?i.indexOfRawIndex(n.dataIndex):null;return null!=o?Dc(i,o,e):Tc(i,e)},
- /**
- * Get view of corresponding component model
- */
- s.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},
- /**
- * Get view of corresponding series model
- */
- s.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},s.prototype._initEvents=function(){var t,e,n,i=this;a(Pd,(function(t){var e=function(e){var n,o=i.getModel(),r=e.target;
- // Contract: if params prepared in mouse event,
- // these properties must be specified:
- // {
- // componentType: string (component main type)
- // componentIndex: number
- // }
- // Otherwise event query can not work.
- if(
- // no e.target when 'globalout'.
- "globalout"===t?n={}:r&&kc(r,(function(t){var e=ni(t);if(e&&null!=e.dataIndex){var i=e.dataModel||o.getSeriesByIndex(e.seriesIndex);return n=i&&i.getDataParams(e.dataIndex,e.dataType,r)||{},!0}
- // If element has custom eventData of components
- if(e.eventData)return n=p({},e.eventData),!0}),!0),n){var a=n.componentType,s=n.componentIndex;
- // Special handling for historic reason: when trigger by
- // markLine/markPoint/markArea, the componentType is
- // 'markLine'/'markPoint'/'markArea', but we should better
- // enable them to be queried by seriesIndex, since their
- // option is set in each series.
- "markLine"!==a&&"markPoint"!==a&&"markArea"!==a||(a="series",s=n.seriesIndex);var l=a&&null!=s&&o.getComponent(a,s),u=l&&i["series"===l.mainType?"_chartsMap":"_componentsMap"][l.__viewId];n.event=e,n.type=t,i._$eventProcessor.eventInfo={targetEl:r,packedEvent:n,model:l,view:u},i.trigger(t,n)}};
- // Consider that some component (like tooltip, brush, ...)
- // register zr event handler, but user event handler might
- // do anything, such as call `setOption` or `dispatchAction`,
- // which probably update any of the content and probably
- // cause problem if it is called previous other inner handlers.
- e.zrEventfulCallAtLast=!0,i._zr.on(t,e,i)})),a(Od,(function(t,e){i._messageCenter.on(e,(function(t){this.trigger(e,t)}),i)})),
- // Extra events
- // TODO register?
- a(["selectchanged"],(function(t){i._messageCenter.on(t,(function(e){this.trigger(t,e)}),i)})),t=this._messageCenter,e=this,n=this._api,t.on("selectchanged",(function(t){var i=n.getModel();t.isFromClick?(Lc("map","selectchanged",e,i,t),Lc("pie","selectchanged",e,i,t)):"select"===t.fromAction?(Lc("map","selected",e,i,t),Lc("pie","selected",e,i,t)):"unselect"===t.fromAction&&(Lc("map","unselected",e,i,t),Lc("pie","unselected",e,i,t))}))},s.prototype.isDisposed=function(){return this._disposed},s.prototype.clear=function(){this._disposed?this.id:this.setOption({series:[]},!0)},s.prototype.dispose=function(){if(this._disposed)this.id;else{this._disposed=!0,this.getDom()&&Fn(this.getDom(),Yd,"");var t=this,e=t._api,n=t._model;a(t._componentsViews,(function(t){t.dispose(n,e)})),a(t._chartsViews,(function(t){t.dispose(n,e)})),
- // Dispose after all views disposed
- t._zr.dispose(),
- // Set properties to null.
- // To reduce the memory cost in case the top code still holds this instance unexpectedly.
- t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete Gd[t.id]}},
- /**
- * Resize the chart
- */
- s.prototype.resize=function(t){if(!this[nd])if(this._disposed)this.id;else{this._zr.resize(t);var e=this._model;
- // Resize loading effect
- if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;
- // There is some real cases that:
- // chart.setOption(option, { lazyUpdate: true });
- // chart.resize();
- this[id]&&(null==i&&(i=this[id].silent),n=!0,this[id]=null),this[nd]=!0;try{n&&cd(this),pd.update.call(this,{type:"resize",animation:p({
- // Disable animation
- duration:0},t&&t.animation)})}catch(o){throw this[nd]=!1,o}this[nd]=!1,md.call(this,i),vd.call(this,i)}}},s.prototype.showLoading=function(t,e){if(this._disposed)this.id;else if(o(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),Bd[t]){var n=Bd[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}},
- /**
- * Hide loading effect
- */
- s.prototype.hideLoading=function(){this._disposed?this.id:(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},s.prototype.makeActionFromEvent=function(t){var e=p({},t);return e.type=Od[t.type],e},
- /**
- * @param opt If pass boolean, means opt.silent
- * @param opt.silent Default `false`. Whether trigger events.
- * @param opt.flush Default `undefined`.
- * true: Flush immediately, and then pixel in canvas can be fetched
- * immediately. Caution: it might affect performance.
- * false: Not flush.
- * undefined: Auto decide whether perform flush.
- */
- s.prototype.dispatchAction=function(t,e){if(this._disposed)this.id;else if(o(e)||(e={silent:!!e}),Nd[t.type]&&this._model)
- // May dispatchAction in rendering procedure
- if(this[nd])this._pendingActions.push(t);else{var n=e.silent;yd.call(this,t,n);var i=e.flush;i?this._zr.flush():!1!==i&&d.browser.weChat&&
- // In WeChat embedded browser, `requestAnimationFrame` and `setInterval`
- // hang when sliding page (on touch event), which cause that zr does not
- // refresh until user interaction finished, which is not expected.
- // But `dispatchAction` may be called too frequently when pan on touch
- // screen, which impacts performance if do not throttle them.
- this._throttledZrFlush(),md.call(this,n),vd.call(this,n)}
- // Avoid dispatch action before setOption. Especially in `connect`.
- },s.prototype.updateLabelLayout=function(){Kc.trigger("series:layoutlabels",this._model,this._api,{
- // Not adding series labels.
- // TODO
- updatedSeries:[]})},s.prototype.appendData=function(t){if(this._disposed)this.id;else{var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),
- // Note: `appendData` does not support that update extent of coordinate
- // system, util some scenario require that. In the expected usage of
- // `appendData`, the initial extent of coordinate system should better
- // be fixed by axis `min`/`max` setting or initial data, otherwise if
- // the extent changed while `appendData`, the location of the painted
- // graphic elements have to be changed, which make the usage of
- // `appendData` meaningless.
- this._scheduler.unfinished=!0,this.getZr().wakeUp()}},
- // A work around for no `internal` modifier in ts yet but
- // need to strictly hide private methods to JS users.
- s.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries((function(t){t.clearColorPalette()}))}
- // Allocate zlevels for series and components
- function e(t){
- // Keep other states.
- for(var e=[],n=t.currentStates,i=0;i<n.length;i++){var o=n[i];"emphasis"!==o&&"blur"!==o&&"select"!==o&&e.push(o)}
- // Only use states when it's exists.
- t.selected&&t.states.select&&e.push("select"),2===t.hoverState&&t.states.emphasis?e.push("emphasis"):1===t.hoverState&&t.states.blur&&e.push("blur"),t.useStates(e)}function o(t,e){if(!t.preventAutoZ){var n=t.get("z")||0,i=t.get("zlevel")||0;
- // Set z and zlevel
- e.eachRendered((function(t){
- // Don't traverse the children because it has been traversed in _updateZ.
- return s(t,n,i,-Infinity),!0}))}}function s(t,e,n,i){
- // Group may also have textContent
- var o=t.getTextContent(),r=t.getTextGuideLine();if(t.isGroup)for(
- // set z & zlevel of children elements of Group
- var a=t.childrenRef(),l=0;l<a.length;l++)i=Math.max(s(a[l],e,n,i),i);else
- // not Group
- t.z=e,t.zlevel=n,i=Math.max(t.z2,i);
- // always set z and zlevel if label/labelLine exists
- if(o&&(o.z=e,o.zlevel=n,
- // lift z2 of text content
- // TODO if el.emphasis.z2 is spcefied, what about textContent.
- isFinite(i)&&(o.z2=i+2)),r){var u=t.textGuideLineConfig;r.z=e,r.zlevel=n,isFinite(i)&&(r.z2=i+(u&&u.showAbove?1:-1))}return i}
- // Clear states without animation.
- // TODO States on component.
- function l(t,e){e.eachRendered((function(t){
- // Not applied on removed elements, it may still in fading.
- if(!ro(t)){var e=t.getTextContent(),n=t.getTextGuideLine();t.stateTransition&&(t.stateTransition=null),e&&e.stateTransition&&(e.stateTransition=null),n&&n.stateTransition&&(n.stateTransition=null),
- // TODO If el is incremental.
- t.hasState()?(t.prevStates=t.currentStates,t.clearStates()):t.prevStates&&(t.prevStates=null)}}))}function u(t,n){var i=t.getModel("stateAnimation"),o=t.isAnimationEnabled(),r=i.get("duration"),a=r>0?{duration:r,delay:i.get("delay"),easing:i.get("easing")}:null;n.eachRendered((function(t){if(t.states&&t.states.emphasis){
- // Not applied on removed elements, it may still in fading.
- if(ro(t))return;
- // Only updated on changed element. In case element is incremental and don't want to rerender.
- // TODO, a more proper way?
- if(t instanceof g&&function(t){var e=ai(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var n=t.states.select||{};e.selectFill=n.style&&n.style.fill||null,e.selectStroke=n.style&&n.style.stroke||null}(t),t.__dirty){var n=t.prevStates;
- // Restore states without animation
- n&&t.useStates(n)}
- // Update state transition and enable animation again.
- if(o){t.stateTransition=a;var i=t.getTextContent(),r=t.getTextGuideLine();
- // TODO Is it necessary to animate label?
- i&&(i.stateTransition=a),r&&(r.stateTransition=a)}
- // Use highlighted and selected flag to toggle states.
- t.__dirty&&e(t)}}))}cd=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),dd(t,!0),dd(t,!1),e.plan()},
- /**
- * Prepare view instances of charts and components
- */
- dd=function(t,e){for(var n=t._model,i=t._scheduler,o=e?t._componentsViews:t._chartsViews,r=e?t._componentsMap:t._chartsMap,a=t._zr,s=t._api,l=0;l<o.length;l++)o[l].__alive=!1;function u(t){
- // By default view will be reused if possible for the case that `setOption` with "notMerge"
- // mode and need to enable transition animation. (Usually, when they have the same id, or
- // especially no id but have the same type & name & index. See the `model.id` generation
- // rule in `makeIdAndName` and `viewId` generation rule here).
- // But in `replaceMerge` mode, this feature should be able to disabled when it is clear that
- // the new model has nothing to do with the old model.
- var l=t.__requireNewView;
- // This command should not work twice.
- t.__requireNewView=!1;
- // Consider: id same and type changed.
- var u="_ec_"+t.id+"_"+t.type,c=!l&&r[u];if(!c){var d=Zn(t.type);(c=new(e?Mu.getClass(d.main,d.sub):
- // FIXME:TS
- // (ChartView as ChartViewConstructor).getClass('series', classType.sub)
- // For backward compat, still support a chart type declared as only subType
- // like "liquidfill", but recommend "series.liquidfill"
- // But need a base class to make a type series.
- Ou.getClass(d.sub))).init(n,s),r[u]=c,o.push(c),a.add(c.group)}t.__viewId=c.__id=u,c.__alive=!0,c.__model=t,c.group.__ecComponentInfo={mainType:t.mainType,index:t.componentIndex},!e&&i.prepareView(c,t,n,s)}e?n.eachComponent((function(t,e){"series"!==t&&u(e)})):n.eachSeries(u);for(l=0;l<o.length;){var c=o[l];c.__alive?l++:(!e&&c.renderTask.dispose(),a.remove(c.group),c.dispose(n,s),o.splice(l,1),r[c.__id]===c&&delete r[c.__id],c.__id=c.group.__ecComponentInfo=null)}},hd=function(t,e,n,o,s){var l=t._model;
- // broadcast
- if(l.setUpdatePayload(n),o){var u={};u[o+"Id"]=n[o+"Id"],u[o+"Index"]=n[o+"Index"],u[o+"Name"]=n[o+"Name"];var c={mainType:o,query:u};s&&(c.subType=s);// subType may be '' by parseClassType;
- var d,h=n.excludeSeriesId;null!=h&&(d=r(),a(Sn(h),(function(t){var e=Ln(t,null);null!=e&&d.set(e,!0)}))),
- // If dispatchAction before setOption, do nothing.
- l&&l.eachComponent(c,(function(e){if(!(d&&null!=d.get(e.id)))if(Qi(n))if(e instanceof Su)n.type!==di||n.notBlur||e.get(["emphasis","disabled"])||function(t,e,n){var o=t.seriesIndex,r=t.getData(e.dataType);if(r){var a=Nn(r,e);
- // Pick the first one if there is multiple/none exists.
- a=(i(a)?a[0]:a)||0;var s=r.getItemGraphicEl(a);if(!s)
- // If data on dataIndex is NaN.
- for(var l=r.count(),u=0;!s&&u<l;)s=r.getItemGraphicEl(u++);if(s){var c=ni(s);Bi(o,c.focus,c.blurScope,n)}else{
- // If there is no element put on the data. Try getting it from raw option
- // TODO Should put it on seriesModel?
- var d=t.get(["emphasis","focus"]),h=t.get(["emphasis","blurScope"]);null!=d&&Bi(o,d,h,n)}}}(e,n,t._api);else{var o=Fi(e.mainType,e.componentIndex,n.name,t._api),r=o.focusSelf,s=o.dispatchers;n.type===di&&r&&!n.notBlur&&Gi(e.mainType,e.componentIndex,t._api),
- // PENDING:
- // Whether to put this "enter emphasis" code in `ComponentView`,
- // which will be the same as `ChartView` but might be not necessary
- // and will be far from this logic.
- s&&a(s,(function(t){n.type===di?ki(t):Pi(t)}))}else $i(n)&&e instanceof Su&&(!function(t,e){if($i(e)){var n=e.dataType,o=Nn(t.getData(n),e);i(o)||(o=[o]),t[e.type===gi?"toggleSelect":e.type===pi?"select":"unselect"](o,n)}}(e,n,t._api),Wi(e),Dd(t))}),t),l&&l.eachComponent(c,(function(e){d&&null!=d.get(e.id)||p(t["series"===o?"_chartsMap":"_componentsMap"][e.__viewId])}),t)}else
- // FIXME
- // Chart will not be update directly here, except set dirty.
- // But there is no such scenario now.
- a([].concat(t._componentsViews).concat(t._chartsViews),p);function p(i){i&&i.__alive&&i[e]&&i[e](i.__model,l,t._api,n)}},pd={prepareAndUpdate:function(t){cd(this),pd.update.call(this,t,{
- // Needs to mark option changed if newOption is given.
- // It's from MagicType.
- // TODO If use a separate flag optionChanged in payload?
- optionChanged:null!=t.newOption})},update:function(e,n){var i=this._model,o=this._api,r=this._zr,a=this._coordSysMgr,s=this._scheduler;
- // update before setOption
- if(i){i.setUpdatePayload(e),s.restoreData(i,e),s.performSeriesTasks(i),
- // TODO
- // Save total ecModel here for undo/redo (after restoring data and before processing data).
- // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call.
- // Create new coordinate system each update
- // In LineView may save the old coordinate system and use it to get the original point.
- a.create(i,o),s.performDataProcessorTasks(i,e),
- // Current stream render is not supported in data process. So we can update
- // stream modes after data processing, where the filtered data is used to
- // determine whether to use progressive rendering.
- gd(this,i),
- // We update stream modes before coordinate system updated, then the modes info
- // can be fetched when coord sys updating (consider the barGrid extent fix). But
- // the drawback is the full coord info can not be fetched. Fortunately this full
- // coord is not required in stream mode updater currently.
- a.update(i,o),t(i),s.performVisualTasks(i,e),bd(this,i,o,e,n);
- // Set background
- var l=i.get("backgroundColor")||"transparent",u=i.get("darkMode");r.setBackgroundColor(l),
- // Force set dark mode.
- null!=u&&"auto"!==u&&r.setDarkMode(u),Kc.trigger("afterupdate",i,o)}},updateTransform:function(e){var n=this,i=this._model,o=this._api;
- // update before setOption
- if(i){i.setUpdatePayload(e);
- // ChartView.markUpdateMethod(payload, 'updateTransform');
- var a=[];i.eachComponent((function(t,r){if("series"!==t){var s=n.getViewOfComponentModel(r);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(r,i,o,e);l&&l.update&&a.push(s)}else a.push(s)}}));var s=r();i.eachSeries((function(t){var r=n._chartsMap[t.__viewId];if(r.updateTransform){var a=r.updateTransform(t,i,o,e);a&&a.update&&s.set(t.uid,1)}else s.set(t.uid,1)})),t(i),
- // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.
- // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true);
- this._scheduler.performVisualTasks(i,e,{setDirty:!0,dirtyMap:s}),
- // Currently, not call render of components. Geo render cost a lot.
- // renderComponents(ecIns, ecModel, api, payload, componentDirtyList);
- wd(this,i,o,e,{},s),Kc.trigger("afterupdate",i,o)}},updateView:function(e){var n=this._model;
- // update before setOption
- n&&(n.setUpdatePayload(e),Ou.markUpdateMethod(e,"updateView"),t(n),
- // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.
- this._scheduler.performVisualTasks(n,e,{setDirty:!0}),bd(this,n,this._api,e,{}),Kc.trigger("afterupdate",n,this._api))},updateVisual:function(e){
- // updateMethods.update.call(this, payload);
- var n=this,i=this._model;
- // update before setOption
- i&&(i.setUpdatePayload(e),
- // clear all visual
- i.eachSeries((function(t){t.getData().clearAllVisual()})),
- // Perform visual
- Ou.markUpdateMethod(e,"updateVisual"),t(i),
- // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.
- this._scheduler.performVisualTasks(i,e,{visualType:"visual",setDirty:!0}),i.eachComponent((function(t,o){if("series"!==t){var r=n.getViewOfComponentModel(o);r&&r.__alive&&r.updateVisual(o,i,n._api,e)}})),i.eachSeries((function(t){n._chartsMap[t.__viewId].updateVisual(t,i,n._api,e)})),Kc.trigger("afterupdate",i,this._api))},updateLayout:function(t){pd.update.call(this,t)}},fd=function(t,e,n,i){if(t._disposed)t.id;else for(var o,r=t._model,a=t._coordSysMgr.getCoordinateSystems(),s=En(r,n),l=0;l<a.length;l++){var u=a[l];if(u[e]&&null!=(o=u[e](r,s,i)))return o}},gd=function(t,e){var n=t._chartsMap,i=t._scheduler;e.eachSeries((function(t){i.updateStreamModes(t,n[t.__viewId])}))},yd=function(t,e){var i=this,o=this.getModel(),r=t.type,s=t.escapeConnect,l=Nd[r],u=l.actionInfo,c=(u.update||"update").split(":"),d=c.pop(),h=null!=c[0]&&Zn(c[0]);this[nd]=!0;var f=[t],g=!1;
- // Batch action
- t.batch&&(g=!0,f=n(t.batch,(function(e){return(e=I(p({},e),t)).batch=null,e})));var y,m=[],v=$i(t),x=Qi(t);if(
- // Only leave blur once if there are multiple batches.
- x&&zi(this._api),a(f,(function(e){
- // light update does not perform data process, layout and visual.
- if(
- // Action can specify the event by return it.
- // Convert type to eventType
- (
- // Emit event outside
- y=(y=l.action(e,i._model,i._api))||p({},e)).type=u.event||y.type,m.push(y),x){var n=Vn(t),o=n.queryOptionMap,r=n.mainTypeSpecified?o.keys()[0]:"series";hd(i,d,e,r),Dd(i)}else v?(
- // At present `dispatchAction({ type: 'select', ... })` is not supported on components.
- // geo still use 'geoselect'.
- hd(i,d,e,"series"),Dd(i)):h&&hd(i,d,e,h.main,h.sub)})),"none"!==d&&!x&&!v&&!h)try{
- // Still dirty
- this[id]?(cd(this),pd.update.call(this,t),this[id]=null):pd[d].call(this,t)}catch(S){throw this[nd]=!1,S}
- // Follow the rule of action batch
- if(y=g?{type:u.event||r,escapeConnect:s,batch:m}:m[0],this[nd]=!1,!e){var _=this._messageCenter;
- // Extra triggered 'selectchanged' event
- if(_.trigger(y.type,y),v){var b={type:"selectchanged",escapeConnect:s,selected:Hi(o),isFromClick:t.isFromClick||!1,fromAction:t.type,fromActionPayload:t};_.trigger(b.type,b)}}},md=function(t){for(var e=this._pendingActions;e.length;){var n=e.shift();yd.call(this,n,t)}},vd=function(t){!t&&this.trigger("updated")},
- /**
- * Event `rendered` is triggered when zr
- * rendered. It is useful for realtime
- * snapshot (reflect animation).
- *
- * Event `finished` is triggered when:
- * (1) zrender rendering finished.
- * (2) initial animation finished.
- * (3) progressive rendering finished.
- * (4) no pending action.
- * (5) no delayed setOption needs to be processed.
- */
- xd=function(t,e){t.on("rendered",(function(n){e.trigger("rendered",n),
- // The `finished` event should not be triggered repeatedly,
- // so it should only be triggered when rendering indeed happens
- // in zrender. (Consider the case that dipatchAction is keep
- // triggering when mouse move).
- // Although zr is dirty if initial animation is not finished
- // and this checking is called on frame, we also check
- // animation finished for robustness.
- !t.animation.isFinished()||e[id]||e._scheduler.unfinished||e._pendingActions.length||e.trigger("finished")}))},_d=function(t,e){t.on("mouseover",(function(t){var n=kc(t.target,Ji);n&&(!function(t,e,n){var i=ni(t),o=Fi(i.componentMainType,i.componentIndex,i.componentHighDownName,n),r=o.dispatchers,s=o.focusSelf;
- // If `findHighDownDispatchers` is supported on the component,
- // highlight/downplay elements with the same name.
- r?(s&&Gi(i.componentMainType,i.componentIndex,n),a(r,(function(t){return Ai(t,e)}))):(
- // Try blur all in the related series. Then emphasis the hoverred.
- // TODO. progressive mode.
- Bi(i.seriesIndex,i.focus,i.blurScope,n),"self"===i.focus&&Gi(i.componentMainType,i.componentIndex,n),
- // Other than series, component that not support `findHighDownDispatcher` will
- // also use it. But in this case, highlight/downplay are only supported in
- // mouse hover but not in dispatchAction.
- Ai(t,e))}(n,t,e._api),Dd(e))})).on("mouseout",(function(t){var n=kc(t.target,Ji);n&&(!function(t,e,n){zi(n);var i=ni(t),o=Fi(i.componentMainType,i.componentIndex,i.componentHighDownName,n).dispatchers;o?a(o,(function(t){return Li(t,e)})):Li(t,e)}(n,t,e._api),Dd(e))})).on("click",(function(t){var n=kc(t.target,(function(t){return null!=ni(t).dataIndex}),!0);if(n){var i=n.selected?"unselect":"select",o=ni(n);e._api.dispatchAction({type:i,dataType:o.dataType,dataIndexInside:o.dataIndex,seriesIndex:o.seriesIndex,isFromClick:!0})}}))},bd=function(t,e,n,i,o){!function(t){var e=[],n=[],i=!1;if(t.eachComponent((function(t,o){var r=o.get("zlevel")||0,a=o.get("z")||0,s=o.getZLevelKey();i=i||!!s,("series"===t?n:e).push({zlevel:r,z:a,idx:o.componentIndex,type:t,key:s})})),i){
- // Series after component
- var o,r,s=e.concat(n);xt(s,(function(t,e){return t.zlevel===e.zlevel?t.z-e.z:t.zlevel-e.zlevel})),a(s,(function(e){var n=t.getComponent(e.type,e.idx),i=e.zlevel,a=e.key;null!=o&&(i=Math.max(o,i)),a?(i===o&&a!==r&&i++,r=a):r&&(i===o&&i++,r=""),o=i,n.setZLevel(i)}))}}(e),Sd(t,e,n,i,o),a(t._chartsViews,(function(t){t.__alive=!1})),wd(t,e,n,i,o),
- // Remove groups of unrendered charts
- a(t._chartsViews,(function(t){t.__alive||t.remove(e,n)}))},Sd=function(t,e,n,i,r,s){a(s||t._componentsViews,(function(t){var r=t.__model;l(r,t),t.render(r,e,n,i),o(r,t),u(r,t)}))},
- /**
- * Render each chart and component
- */
- wd=function(t,e,n,i,r,a){
- // Render all charts
- var s=t._scheduler;r=p(r||{},{updatedSeries:e.getSeries()}),
- // TODO progressive?
- Kc.trigger("series:beforeupdate",e,n,r);var c=!1;e.eachSeries((function(e){var n=t._chartsMap[e.__viewId];n.__alive=!0;var o=n.renderTask;s.updatePayload(o,i),
- // TODO states on marker.
- l(e,n),a&&a.get(e.uid)&&o.dirty(),o.perform(s.getPerformArgs(o))&&(c=!0),n.group.silent=!!e.get("silent"),
- // Should not call markRedraw on group, because it will disable zrender
- // incremental render (always render from the __startIndex each frame)
- // chartView.group.markRedraw();
- /**
- * Update chart and blend.
- */
- function(t,e){var n=t.get("blendMode")||null;e.eachRendered((function(t){
- // FIXME marker and other components
- t.isGroup||(
- // DON'T mark the element dirty. In case element is incremental and don't want to rerender.
- t.style.blend=n)}))}(e,n),Wi(e)})),s.unfinished=c||s.unfinished,Kc.trigger("series:layoutlabels",e,n,r),
- // transition after label is layouted.
- Kc.trigger("series:transition",e,n,r),e.eachSeries((function(e){var n=t._chartsMap[e.__viewId];
- // Update Z after labels updated. Before applying states.
- o(e,n),
- // NOTE: Update states after label is updated.
- // label should be in normal status when layouting.
- u(e,n)})),
- // If use hover layer
- function(t,e){var n=t._zr,i=n.storage,o=0;i.traverse((function(t){t.isGroup||o++})),o>e.get("hoverLayerThreshold")&&!d.node&&!d.worker&&e.eachSeries((function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.eachRendered((function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)}))}}))}(t,e),Kc.trigger("series:afterupdate",e,n,r)},Dd=function(t){t[od]=!0,
- // Wake up zrender if it's sleep. Let it update states in the next frame.
- t.getZr().wakeUp()},Td=function(t){t[od]&&(t.getZr().storage.traverse((function(t){
- // Not applied on removed elements, it may still in fading.
- ro(t)||e(t)})),t[od]=!1)},Md=function(t){return new(/** @class */function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Ue(n,e),n.prototype.getCoordinateSystems=function(){return t._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(e){for(;e;){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}},n.prototype.enterEmphasis=function(e,n){ki(e,n),Dd(t)},n.prototype.leaveEmphasis=function(e,n){Pi(e,n),Dd(t)},n.prototype.enterBlur=function(e){Ni(e),Dd(t)},n.prototype.leaveBlur=function(e){Oi(e),Dd(t)},n.prototype.enterSelect=function(e){Ri(e),Dd(t)},n.prototype.leaveSelect=function(e){Ei(e),Dd(t)},n.prototype.getModel=function(){return t.getModel()},n.prototype.getViewOfComponentModel=function(e){return t.getViewOfComponentModel(e)},n.prototype.getViewOfSeriesModel=function(e){return t.getViewOfSeriesModel(e)},n}(ds))(t)},Id=function(t){function e(t,e){for(var n=0;n<t.length;n++){t[n][ad]=e}}a(Od,(function(n,i){t._messageCenter.on(i,(function(n){if(Fd[t.group]&&0!==t[ad]){if(n&&n.escapeConnect)return;var i=t.makeActionFromEvent(n),o=[];a(Gd,(function(e){e!==t&&e.group===t.group&&o.push(e)})),e(o,0),a(o,(function(t){1!==t[ad]&&t.dispatchAction(i)})),e(o,2)}}))}))}}(),s}(mt),kd=Ld.prototype;kd.on=sd("on"),kd.off=sd("off"),
- /**
- * @deprecated
- */
- // @ts-ignore
- kd.one=function(t,e,n){var i=this;
- // @ts-ignore
- this.on.call(this,t,(function n(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];e&&e.apply&&e.apply(this,o),
- // @ts-ignore
- i.off(t,n)}),n)};var Pd=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];var Nd={},Od={},Rd=[],Ed=[],Vd=[],zd={},Bd={},Gd={},Fd={},Wd=+new Date-0,Hd=+new Date-0,Yd="_echarts_instance_";
- /**
- * Map eventType to actionType
- */
- /**
- * @param opts.devicePixelRatio Use window.devicePixelRatio by default
- * @param opts.renderer Can choose 'canvas' or 'svg' to render the chart.
- * @param opts.width Use clientWidth of the input `dom` by default.
- * Can be 'auto' (the same as null/undefined)
- * @param opts.height Use clientHeight of the input `dom` by default.
- * Can be 'auto' (the same as null/undefined)
- * @param opts.locale Specify the locale.
- * @param opts.useDirtyRect Enable dirty rectangle rendering or not.
- */
- function Ud(t,e,n){var i=!(n&&n.ssr);if(i){var o=jd(t);if(o)return o}var r=new Ld(t,e,n);return r.id="ec_"+Wd++,Gd[r.id]=r,i&&Fn(t,Yd,r.id),Id(r),Kc.trigger("afterinit",r),r}
- /**
- * @usage
- * (A)
- * ```js
- * let chart1 = echarts.init(dom1);
- * let chart2 = echarts.init(dom2);
- * chart1.group = 'xxx';
- * chart2.group = 'xxx';
- * echarts.connect('xxx');
- * ```
- * (B)
- * ```js
- * let chart1 = echarts.init(dom1);
- * let chart2 = echarts.init(dom2);
- * echarts.connect('xxx', [chart1, chart2]);
- * ```
- */function Zd(t){Fd[t]=!1}
- /**
- * Alias and backward compatibility
- * @deprecated
- */var Xd=Zd;
- /**
- * Dispose a chart instance
- */function jd(t){return Gd[function(t,e){return t.getAttribute?t.getAttribute(e):t[e]}(t,Yd)]}
- /**
- * Register theme
- */
- function qd(t,e){zd[t]=e}
- /**
- * Register option preprocessor
- */function Kd(t){c(Ed,t)<0&&Ed.push(t)}function Jd(t,e){ah(Rd,t,e,2e3)}
- /**
- * Register postIniter
- * @param {Function} postInitFunc
- */function $d(t){th("afterinit",t)}
- /**
- * Register postUpdater
- * @param {Function} postUpdateFunc
- */function Qd(t){th("afterupdate",t)}function th(t,e){Kc.on(t,e)}function eh(t,e,n){f(e)&&(n=e,e="");var i=o(t)?t.type:[t,t={event:e}][0];
- // Event name is all lowercase
- t.event=(t.event||i).toLowerCase(),e=t.event,Od[e]||(
- // Validate action type and event name.
- s(rd.test(i)&&rd.test(e)),Nd[i]||(Nd[i]={action:n,actionInfo:t}),Od[e]=i)}function nh(t,e){fs.register(t,e)}
- /**
- * Get dimensions of specified coordinate system.
- * @param {string} type
- * @return {Array.<string|Object>}
- */function ih(t,e){ah(Vd,t,e,1e3,"layout")}function oh(t,e){ah(Vd,t,e,3e3,"visual")}var rh=[];function ah(t,e,n,i,r){
- // Already registered
- if((f(e)||o(e))&&(n=e,e=i),!(c(rh,n)>=0)){rh.push(n);var a=hc.wrapStageHandler(n,r);a.__prio=e,a.__raw=n,t.push(a)}}function sh(t,e){Bd[t]=e}
- /**
- * ZRender need a canvas context to do measureText.
- * But in node environment canvas may be created by node-canvas.
- * So we need to specify how to create a canvas instead of using document.createElement('canvas')
- *
- *
- * @deprecated use setPlatformAPI({ createCanvas }) instead.
- *
- * @example
- * let Canvas = require('canvas');
- * let echarts = require('echarts');
- * echarts.setCanvasCreator(function () {
- * // Small size is enough.
- * return new Canvas(32, 32);
- * });
- */
- /**
- * The parameters and usage: see `geoSourceManager.registerMap`.
- * Compatible with previous `echarts.registerMap`.
- */
- function lh(t,e,n){var i=$c("registerMap");i&&i(t,e,n)}var uh=function(t){var e=(t=et(t)).type;e||vn("");var n=e.split(":");2!==n.length&&vn("");
- // Namespace 'echarts:xxx' is official namespace, where the transforms should
- // be called directly via 'xxx' rather than 'echarts:xxx'.
- var i=!1;"echarts"===n[0]&&(e=n[1],i=!0),t.__isBuiltIn=i,Ll.set(e,t)};
- /**
- * Globa dispatchAction to a specified chart instance.
- */
- // export function dispatchAction(payload: { chartId: string } & Payload, opt?: Parameters<ECharts['dispatchAction']>[1]) {
- // if (!payload || !payload.chartId) {
- // // Must have chartId to find chart
- // return;
- // }
- // const chart = instances[payload.chartId];
- // if (chart) {
- // chart.dispatchAction(payload, opt);
- // }
- // }
- // Builtin global visual
- oh(Qc,Zu),oh(td,ju),oh(td,qu),oh(Qc,Mc),oh(td,Ic),oh(7e3,(function(t,e){t.eachRawSeries((function(n){if(!t.isSeriesFiltered(n)){var i=n.getData();i.hasItemVisual()&&i.each((function(t){var n=i.getItemVisual(t,"decal");n&&(i.ensureUniqueItemVisual(t,"style").decal=Zc(n,e))}));var o=i.getVisual("decal");if(o)i.getVisual("style").decal=Zc(o,e)}}))})),Kd(zs),Jd(900,(function(t){var e=r();t.eachSeries((function(t){var n=t.get("stack");
- // Compatible: when `stack` is set as '', do not stack.
- if(n){var i=e.get(n)||e.set(n,[]),o=t.getData(),r={
- // Used for calculate axis extent automatically.
- // TODO: Type getCalculationInfo return more specific type?
- stackResultDimension:o.getCalculationInfo("stackResultDimension"),stackedOverDimension:o.getCalculationInfo("stackedOverDimension"),stackedDimension:o.getCalculationInfo("stackedDimension"),stackedByDimension:o.getCalculationInfo("stackedByDimension"),isStackedByIndex:o.getCalculationInfo("isStackedByIndex"),data:o,seriesModel:t};
- // If stacked on axis that do not support data stack.
- if(!r.stackedDimension||!r.isStackedByIndex&&!r.stackedByDimension)return;i.length&&o.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(r)}})),e.each(Bs)})),sh("default",(
- /**
- * @param {module:echarts/ExtensionAPI} api
- * @param {Object} [opts]
- * @param {string} [opts.text]
- * @param {string} [opts.color]
- * @param {string} [opts.textColor]
- * @return {module:zrender/Element}
- */
- function(t,e){I(e=e||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Z,i=new G({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(i);var o,r=new $({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new G({style:{fill:"none"},textContent:r,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(a),e.showSpinner&&((o=new H({shape:{startAngle:-Ku/2,endAngle:-Ku/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*Ku/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:3*Ku/2}).delay(300).start("circularInOut"),n.add(o)),
- // Inject resize
- n.resize=function(){var n=r.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),u=t.getHeight()/2;e.showSpinner&&o.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n})),
- // Default actions
- eh({type:di,event:di,update:di},dt),eh({type:hi,event:hi,update:hi},dt),eh({type:pi,event:pi,update:pi},dt),eh({type:fi,event:fi,update:fi},dt),eh({type:gi,event:gi,update:gi},dt),
- // Default theme
- qd("light",fc),qd("dark",_c);
- // For backward compatibility, where the namespace `dataTool` will
- // be mounted on `echarts` is the extension `dataTool` is imported.
- var ch=[],dh={registerPreprocessor:Kd,registerProcessor:Jd,registerPostInit:$d,registerPostUpdate:Qd,registerUpdateLifecycle:th,registerAction:eh,registerCoordinateSystem:nh,registerLayout:ih,registerVisual:oh,registerTransform:uh,registerLoading:sh,registerMap:lh,registerImpl:function(t,e){Jc[t]=e},PRIORITY:ed,ComponentModel:Ta,ComponentView:Mu,SeriesModel:Su,ChartView:Ou,
- // TODO Use ComponentModel and SeriesModel instead of Constructor
- registerComponentModel:function(t){Ta.registerClass(t)},registerComponentView:function(t){Mu.registerClass(t)},registerSeriesModel:function(t){Su.registerClass(t)},registerChartView:function(t){Ou.registerClass(t)},registerSubTypeDefaulter:function(t,e){Ta.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){St(t,e)}};function hh(t){i(t)?
- // use([ChartLine, ChartBar]);
- a(t,(function(t){hh(t)})):c(ch,t)>=0||(ch.push(t),f(t)&&(t={install:t}),t.install(dh))}
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */function ph(t){return null==t?0:t.length||1}function fh(t){return t}var gh=/** @class */function(){
- /**
- * @param context Can be visited by this.context in callback.
- */
- function t(t,e,n,i,o,
- // By default: 'oneToOne'.
- r){this._old=t,this._new=e,this._oldKeyGetter=n||fh,this._newKeyGetter=i||fh,
- // Visible in callback via `this.context`;
- this.context=o,this._diffModeMultiple="multiple"===r}
- /**
- * Callback function when add a data
- */return t.prototype.add=function(t){return this._add=t,this},
- /**
- * Callback function when update a data
- */
- t.prototype.update=function(t){return this._update=t,this},
- /**
- * Callback function when update a data and only work in `cbMode: 'byKey'`.
- */
- t.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},
- /**
- * Callback function when update a data and only work in `cbMode: 'byKey'`.
- */
- t.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},
- /**
- * Callback function when update a data and only work in `cbMode: 'byKey'`.
- */
- t.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},
- /**
- * Callback function when remove a data
- */
- t.prototype.remove=function(t){return this._remove=t,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var t=this._old,e=this._new,n={},i=new Array(t.length),o=new Array(e.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(e,n,o,"_newKeyGetter");for(var r=0;r<t.length;r++){var a=i[r],s=n[a],l=ph(s);
- // idx can never be empty array here. see 'set null' logic below.
- if(l>1){
- // Consider there is duplicate key (for example, use dataItem.name as key).
- // We should make sure every item in newArr and oldArr can be visited.
- var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,r)}else 1===l?(n[a]=null,this._update&&this._update(s,r)):this._remove&&this._remove(r)}this._performRestAdd(o,n)},
- /**
- * For example, consider the case:
- * oldData: [o0, o1, o2, o3, o4, o5, o6, o7],
- * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8],
- * Where:
- * o0, o1, n0 has key 'a' (many to one)
- * o5, n4, n5, n6 has key 'b' (one to many)
- * o2, n1 has key 'c' (one to one)
- * n2, n3 has key 'd' (add)
- * o3, o4 has key 'e' (remove)
- * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove)
- * Then:
- * (The order of the following directives are not ensured.)
- * this._updateManyToOne(n0, [o0, o1]);
- * this._updateOneToMany([n4, n5, n6], o5);
- * this._update(n1, o2);
- * this._remove(o3);
- * this._remove(o4);
- * this._remove(o6);
- * this._remove(o7);
- * this._add(n2);
- * this._add(n3);
- * this._add(n7);
- * this._add(n8);
- */
- t.prototype._executeMultiple=function(){var t=this._old,e=this._new,n={},i={},o=[],r=[];this._initIndexMap(t,n,o,"_oldKeyGetter"),this._initIndexMap(e,i,r,"_newKeyGetter");for(var a=0;a<o.length;a++){var s=o[a],l=n[s],u=i[s],c=ph(l),d=ph(u);if(c>1&&1===d)this._updateManyToOne&&this._updateManyToOne(u,l),i[s]=null;else if(1===c&&d>1)this._updateOneToMany&&this._updateOneToMany(u,l),i[s]=null;else if(1===c&&1===d)this._update&&this._update(u,l),i[s]=null;else if(c>1&&d>1)this._updateManyToMany&&this._updateManyToMany(u,l),i[s]=null;else if(c>1)for(var h=0;h<c;h++)this._remove&&this._remove(l[h]);else this._remove&&this._remove(l)}this._performRestAdd(r,i)},t.prototype._performRestAdd=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],o=e[i],r=ph(o);if(r>1)for(var a=0;a<r;a++)this._add&&this._add(o[a]);else 1===r&&this._add&&this._add(o);
- // Support both `newDataKeyArr` are duplication removed or not removed.
- e[i]=null}},t.prototype._initIndexMap=function(t,
- // Can be null.
- e,
- // In 'byKey', the output `keyArr` is duplication removed.
- // In 'byIndex', the output `keyArr` is not duplication removed and
- // its indices are accurately corresponding to `arr`.
- n,i){for(var o=this._diffModeMultiple,r=0;r<t.length;r++){
- // Add prefix to avoid conflict with Object.prototype.
- var a="_ec_"+this[i](t[r],r);if(o||(n[r]=a),e){var s=e[a],l=ph(s);0===l?(
- // Simple optimize: in most cases, one index has one key,
- // do not need array.
- e[a]=r,o&&n.push(a)):1===l?e[a]=[s,r]:s.push(r)}}},t}();const yh=gh;var mh=/** @class */function(){function t(t,e){this._encode=t,this._schema=e}return t.prototype.get=function(){return{
- // Do not generate full dimension name until fist used.
- fullDimensions:this._getFullDimensionNames(),encode:this._encode}},
- /**
- * Get all data store dimension names.
- * Theoretically a series data store is defined both by series and used dataset (if any).
- * If some dimensions are omitted for performance reason in `this.dimensions`,
- * the dimension name may not be auto-generated if user does not specify a dimension name.
- * In this case, the dimension name is `null`/`undefined`.
- */
- t.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},t}();function vh(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}
- // FIXME:TS should be type `AxisType`
- function xh(t){return"category"===t?"ordinal":"time"===t?"time":"float"}const _h=
- /**
- * @param opt All of the fields will be shallow copied.
- */
- function(t){
- /**
- * The format of `otherDims` is:
- * ```js
- * {
- * tooltip?: number
- * label?: number
- * itemName?: number
- * seriesName?: number
- * }
- * ```
- *
- * A `series.encode` can specified these fields:
- * ```js
- * encode: {
- * // "3, 1, 5" is the index of data dimension.
- * tooltip: [3, 1, 5],
- * label: [0, 3],
- * ...
- * }
- * ```
- * `otherDims` is the parse result of the `series.encode` above, like:
- * ```js
- * // Suppose the index of this data dimension is `3`.
- * this.otherDims = {
- * // `3` is at the index `0` of the `encode.tooltip`
- * tooltip: 0,
- * // `3` is at the index `1` of the `encode.label`
- * label: 1
- * };
- * ```
- *
- * This prop should never be `null`/`undefined` after initialized.
- */
- this.otherDims={},null!=t&&p(this,t)};var bh=On(),Sh={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},wh=/** @class */function(){function t(t){this.dimensions=t.dimensions,this._dimOmitted=t.dimensionOmitted,this.source=t.source,this._fullDimCount=t.fullDimensionCount,this._updateDimOmitted(t.dimensionOmitted)}return t.prototype.isDimensionOmitted=function(){return this._dimOmitted},t.prototype._updateDimOmitted=function(t){this._dimOmitted=t,t&&(this._dimNameMap||(this._dimNameMap=Dh(this.source)))},
- /**
- * @caution Can only be used when `dimensionOmitted: true`.
- *
- * Get index by user defined dimension name (i.e., not internal generate name).
- * That is, get index from `dimensionsDefine`.
- * If no `dimensionsDefine`, or no name get, return -1.
- */
- t.prototype.getSourceDimensionIndex=function(t){return x(this._dimNameMap.get(t),-1)},
- /**
- * @caution Can only be used when `dimensionOmitted: true`.
- *
- * Notice: may return `null`/`undefined` if user not specify dimension names.
- */
- t.prototype.getSourceDimension=function(t){var e=this.source.dimensionsDefine;if(e)return e[t]},t.prototype.makeStoreSchema=function(){for(var t=this._fullDimCount,e=$s(this.source),n=!Th(t),i="",o=[],r=0,a=0;r<t;r++){var s=void 0,l=void 0,u=void 0,c=this.dimensions[a];
- // The list has been sorted by `storeDimIndex` asc.
- if(c&&c.storeDimIndex===r)s=e?c.name:null,l=c.type,u=c.ordinalMeta,a++;else{var d=this.getSourceDimension(r);d&&(s=e?d.name:null,l=d.type)}o.push({property:s,type:l,ordinalMeta:u}),
- // If retrieving data by index,
- // use <index, type, ordinalMeta> to determine whether data can be shared.
- // (Because in this case there might be no dimension name defined in dataset, but indices always exists).
- // (Indices are always 0, 1, 2, ..., so we can ignore them to shorten the hash).
- // Otherwise if retrieving data by property name (like `data: [{aa: 123, bb: 765}, ...]`),
- // use <property, type, ordinalMeta> in hash.
- !e||null==s||c&&c.isCalculationCoord||(i+=n?s.replace(/\`/g,"`1").replace(/\$/g,"`2"):s),i+="$",i+=Sh[l]||"f",u&&(i+=u.uid),i+="$"}
- // Source from endpoint(usually series) will be read differently
- // when seriesLayoutBy or startIndex(which is affected by sourceHeader) are different.
- // So we use this three props as key.
- var h=this.source;return{dimensions:o,hash:[h.seriesLayoutBy,h.startIndex,i].join("$$")}},t.prototype.makeOutputDimensionNames=function(){for(var t=[],e=0,n=0;e<this._fullDimCount;e++){var i=void 0,o=this.dimensions[n];
- // The list has been sorted by `storeDimIndex` asc.
- if(o&&o.storeDimIndex===e)o.isCalculationCoord||(i=o.name),n++;else{var r=this.getSourceDimension(e);r&&(i=r.name)}t.push(i)}return t},t.prototype.appendCalculationDimension=function(t){this.dimensions.push(t),t.isCalculationCoord=!0,this._fullDimCount++,
- // If append dimension on a data store, consider the store
- // might be shared by different series, series dimensions not
- // really map to store dimensions.
- this._updateDimOmitted(!0)},t}();function Mh(t){return t instanceof wh}function Ih(t){for(var e=r(),n=0;n<(t||[]).length;n++){var i=t[n],a=o(i)?i.name:i;null!=a&&null==e.get(a)&&e.set(a,n)}return e}function Dh(t){var e=bh(t);return e.dimNameMap||(e.dimNameMap=Ih(t.dimensionsDefine))}function Th(t){return t>30}var Ch,Ah,Lh,kh,Ph,Nh,Oh,Rh=o,Eh=n,Vh="undefined"==typeof Int32Array?Array:Int32Array,zh=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],Bh=["_approximateExtent"],Gh=/** @class */function(){
- /**
- * @param dimensionsInput.dimensions
- * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].
- * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius
- */
- function e(e,n){var i;this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],
- // Models of data option is stored sparse for optimizing memory cost
- // Never used yet (not used yet).
- // private _optionModels: Model[] = [];
- // Global visual properties after visual coding
- this._visual={},
- // Global layout properties.
- this._layout={},
- // Item visual properties after visual coding
- this._itemVisuals=[],
- // Item layout properties after layout
- this._itemLayouts=[],
- // Graphic elements
- this._graphicEls=[],
- // key: dim, value: extent
- this._approximateExtent={},this._calculationInfo={},
- // Having detected that there is data item is non primitive type
- // (in type `OptionDataItemObject`).
- // Like `data: [ { value: xx, itemStyle: {...} }, ...]`
- // At present it only happen in `SOURCE_FORMAT_ORIGINAL`.
- this.hasItemOption=!1,
- // Methods that create a new list based on this list should be listed here.
- // Notice that those method should `RETURN` the new list.
- this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],
- // Methods that change indices of this list should be listed here.
- this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var o=!1;Mh(e)?(i=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(o=!0,i=e),i=i||["x","y"];for(var s={},l=[],u={},c=!1,d={},h=0;h<i.length;h++){
- // Use the original dimensions[i], where other flag props may exists.
- var p=i[h],f=t(p)?new _h({name:p}):p instanceof _h?p:new _h(p),g=f.name;f.type=f.type||"float",f.coordDim||(f.coordDim=g,f.coordDimIndex=0);var y=f.otherDims=f.otherDims||{};l.push(g),s[g]=f,null!=d[g]&&(c=!0),f.createInvertedIndices&&(u[g]=[]),0===y.itemName&&(this._nameDimIdx=h),0===y.itemId&&(this._idDimIdx=h),o&&(f.storeDimIndex=h)}if(this.dimensions=l,this._dimInfos=s,this._initGetDimensionInfo(c),this.hostModel=n,this._invertedIndicesMap=u,this._dimOmitted){var m=this._dimIdxToName=r();a(l,(function(t){m.set(s[t].storeDimIndex,t)}))}}
- /**
- *
- * Get concrete dimension name by dimension name or dimension index.
- * If input a dimension name, do not validate whether the dimension name exits.
- *
- * @caution
- * @param dim Must make sure the dimension is `SeriesDimensionLoose`.
- * Because only those dimensions will have auto-generated dimension names if not
- * have a user-specified name, and other dimensions will get a return of null/undefined.
- *
- * @notice Because of this reason, should better use `getDimensionIndex` instead, for examples:
- * ```js
- * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx);
- * ```
- *
- * @return Concrete dim name.
- */return e.prototype.getDimension=function(t){var e=this._recognizeDimIndex(t);if(null==e)return t;if(e=t,!this._dimOmitted)return this.dimensions[e];
- // Retrieve from series dimension definition because it probably contains
- // generated dimension name (like 'x', 'y').
- var n=this._dimIdxToName.get(e);if(null!=n)return n;var i=this._schema.getSourceDimension(e);return i?i.name:void 0},
- /**
- * Get dimension index in data store. Return -1 if not found.
- * Can be used to index value from getRawValue.
- */
- e.prototype.getDimensionIndex=function(t){var e=this._recognizeDimIndex(t);if(null!=e)return e;if(null==t)return-1;var n=this._getDimInfo(t);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(t):-1},
- /**
- * The meanings of the input parameter `dim`:
- *
- * + If dim is a number (e.g., `1`), it means the index of the dimension.
- * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.
- * + If dim is a number-like string (e.g., `"1"`):
- * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`,
- * it means that concrete name.
- * + If not, it will be converted to a number, which means the index of the dimension.
- * (why? because of the backward compatibility. We have been tolerating number-like string in
- * dimension setting, although now it seems that it is not a good idea.)
- * For example, `visualMap[i].dimension: "1"` is the same meaning as `visualMap[i].dimension: 1`,
- * if no dimension name is defined as `"1"`.
- * + If dim is a not-number-like string, it means the concrete dim name.
- * For example, it can be be default name `"x"`, `"y"`, `"z"`, `"lng"`, `"lat"`, `"angle"`, `"radius"`,
- * or customized in `dimensions` property of option like `"age"`.
- *
- * @return recognized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`).
- */
- e.prototype._recognizeDimIndex=function(t){if(l(t)||null!=t&&!isNaN(t)&&!this._getDimInfo(t)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(t)<0))return+t},e.prototype._getStoreDimIndex=function(t){return this.getDimensionIndex(t)},
- /**
- * Get type and calculation info of particular dimension
- * @param dim
- * Dimension can be concrete names like x, y, z, lng, lat, angle, radius
- * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'
- */
- e.prototype.getDimensionInfo=function(t){
- // Do not clone, because there may be categories in dimInfo.
- return this._getDimInfo(this.getDimension(t))},e.prototype._initGetDimensionInfo=function(t){var e=this._dimInfos;this._getDimInfo=t?function(t){return e.hasOwnProperty(t)?e[t]:void 0}:function(t){return e[t]}},
- /**
- * concrete dimension name list on coord.
- */
- e.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},e.prototype.mapDimension=function(t,e){var n=this._dimSummary;if(null==e)return n.encodeFirstDimNotExtra[t];var i=n.encode[t];return i?i[e]:null},e.prototype.mapDimensionsAll=function(t){return(this._dimSummary.encode[t]||[]).slice()},e.prototype.getStore=function(){return this._store},
- /**
- * Initialize from data
- * @param data source or data or data store.
- * @param nameList The name of a datum is used on data diff and
- * default label/tooltip.
- * A name can be specified in encode.itemName,
- * or dataItem.name (only for series option data),
- * or provided in nameList from outside.
- */
- e.prototype.initData=function(t,e,i){var o,s=this;if(t instanceof Hl&&(o=t),!o){var l=this.dimensions,u=Zs(t)||m(t)?new Qs(t,l.length):t;o=new Hl;var c=Eh(l,(function(t){return{type:s._dimInfos[t].type,property:t}}));o.initData(u,c,i)}this._store=o,
- // Reset
- this._nameList=(e||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,o.count()),
- // Cache summary info for fast visit. See "dimensionHelper".
- // Needs to be initialized after store is prepared.
- this._dimSummary=function(t,e){var i={},o=i.encode={},s=r(),l=[],u=[],c={};a(t.dimensions,(function(e){var n,i=t.getDimensionInfo(e),r=i.coordDim;if(r){var a=i.coordDimIndex;vh(o,r)[a]=e,i.isExtraCoord||(s.set(r,1),
- // Use the last coord dim (and label friendly) as default label,
- // because when dataset is used, it is hard to guess which dimension
- // can be value dimension. If both show x, y on label is not look good,
- // and conventionally y axis is focused more.
- "ordinal"!==(n=i.type)&&"time"!==n&&(l[0]=e),
- // User output encode do not contain generated coords.
- // And it only has index. User can use index to retrieve value from the raw item array.
- vh(c,r)[a]=t.getDimensionIndex(i.name)),i.defaultTooltip&&u.push(e)}ka.each((function(t,e){var n=vh(o,e),r=i.otherDims[e];null!=r&&!1!==r&&(n[r]=i.name)}))}));var d=[],h={};s.each((function(t,e){var n=o[e];h[e]=n[0],
- // Not necessary to remove duplicate, because a data
- // dim canot on more than one coordDim.
- d=d.concat(n)})),i.dataDimsOnCoord=d,i.dataDimIndicesOnCoord=n(d,(function(e){return t.getDimensionInfo(e).storeDimIndex})),i.encodeFirstDimNotExtra=h;var p=o.label;
- // FIXME `encode.label` is not recommended, because formatter cannot be set
- // in this way. Use label.formatter instead. Maybe remove this approach someday.
- p&&p.length&&(l=p.slice());var f=o.tooltip;return f&&f.length?u=f.slice():u.length||(u=l.slice()),o.defaultedLabel=l,o.defaultedTooltip=u,i.userOutput=new mh(c,e),i}(this,this._schema),this.userOutput=this._dimSummary.userOutput},
- /**
- * Caution: Can be only called on raw data (before `this._indices` created).
- */
- e.prototype.appendData=function(t){var e=this._store.appendData(t);this._doInit(e[0],e[1])},
- /**
- * Caution: Can be only called on raw data (before `this._indices` created).
- * This method does not modify `rawData` (`dataProvider`), but only
- * add values to store.
- *
- * The final count will be increased by `Math.max(values.length, names.length)`.
- *
- * @param values That is the SourceType: 'arrayRows', like
- * [
- * [12, 33, 44],
- * [NaN, 43, 1],
- * ['-', 'asdf', 0]
- * ]
- * Each item is exactly corresponding to a dimension.
- */
- e.prototype.appendValues=function(t,e){var n=this._store.appendValues(t,e&&e.length),i=n.start,o=n.end,r=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),e)for(var a=i;a<o;a++){var s=a-i;this._nameList[a]=e[s],r&&Oh(this,a)}},e.prototype._updateOrdinalMeta=function(){for(var t=this._store,e=this.dimensions,n=0;n<e.length;n++){var i=this._dimInfos[e[n]];i.ordinalMeta&&t.collectOrdinalMeta(i.storeDimIndex,i.ordinalMeta)}},e.prototype._shouldMakeIdFromName=function(){var t=this._store.getProvider();return null==this._idDimIdx&&t.getSource().sourceFormat!==Ea&&!t.fillStorage},e.prototype._doInit=function(t,e){if(!(t>=e)){var n=this._store.getProvider();this._updateOrdinalMeta();var i=this._nameList,o=this._idList;
- // Each data item is value
- // [1, 2]
- // 2
- // Bar chart, line chart which uses category axis
- // only gives the 'y' value. 'x' value is the indices of category
- // Use a tempValue to normalize the value to be a (x, y) value
- // If dataItem is {name: ...} or {id: ...}, it has highest priority.
- // This kind of ids and names are always stored `_nameList` and `_idList`.
- if(n.getSource().sourceFormat===Pa&&!n.pure)for(var r=[],a=t;a<e;a++){
- // NOTICE: Try not to write things into dataItem
- var s=n.getItem(a,r);if(!this.hasItemOption&&Dn(s)&&(this.hasItemOption=!0),s){var l=s.name;null==i[a]&&null!=l&&(i[a]=Ln(l,null));var u=s.id;null==o[a]&&null!=u&&(o[a]=Ln(u,null))}}if(this._shouldMakeIdFromName())for(a=t;a<e;a++)Oh(this,a);Ch(this)}},
- /**
- * PENDING: In fact currently this function is only used to short-circuit
- * the calling of `scale.unionExtentFromData` when data have been filtered by modules
- * like "dataZoom". `scale.unionExtentFromData` is used to calculate data extent for series on
- * an axis, but if a "axis related data filter module" is used, the extent of the axis have
- * been fixed and no need to calling `scale.unionExtentFromData` actually.
- * But if we add "custom data filter" in future, which is not "axis related", this method may
- * be still needed.
- *
- * Optimize for the scenario that data is filtered by a given extent.
- * Consider that if data amount is more than hundreds of thousand,
- * extent calculation will cost more than 10ms and the cache will
- * be erased because of the filtering.
- */
- e.prototype.getApproximateExtent=function(t){return this._approximateExtent[t]||this._store.getDataExtent(this._getStoreDimIndex(t))},
- /**
- * Calculate extent on a filtered data might be time consuming.
- * Approximate extent is only used for: calculate extent of filtered data outside.
- */
- e.prototype.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},e.prototype.getCalculationInfo=function(t){return this._calculationInfo[t]},e.prototype.setCalculationInfo=function(t,e){Rh(t)?p(this._calculationInfo,t):this._calculationInfo[t]=e},
- /**
- * @return Never be null/undefined. `number` will be converted to string. Because:
- * In most cases, name is used in display, where returning a string is more convenient.
- * In other cases, name is used in query (see `indexOfName`), where we can keep the
- * rule that name `2` equals to name `'2'`.
- */
- e.prototype.getName=function(t){var e=this.getRawIndex(t),n=this._nameList[e];return null==n&&null!=this._nameDimIdx&&(n=Lh(this,this._nameDimIdx,e)),null==n&&(n=""),n},e.prototype._getCategory=function(t,e){var n=this._store.get(t,e),i=this._store.getOrdinalMeta(t);return i?i.categories[n]:n},
- /**
- * @return Never null/undefined. `number` will be converted to string. Because:
- * In all cases having encountered at present, id is used in making diff comparison, which
- * are usually based on hash map. We can keep the rule that the internal id are always string
- * (treat `2` is the same as `'2'`) to make the related logic simple.
- */
- e.prototype.getId=function(t){return Ah(this,this.getRawIndex(t))},e.prototype.count=function(){return this._store.count()},
- /**
- * Get value. Return NaN if idx is out of range.
- *
- * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead.
- */
- e.prototype.get=function(t,e){var n=this._store,i=this._dimInfos[t];if(i)return n.get(i.storeDimIndex,e)},
- /**
- * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead.
- */
- e.prototype.getByRawIndex=function(t,e){var n=this._store,i=this._dimInfos[t];if(i)return n.getByRawIndex(i.storeDimIndex,e)},e.prototype.getIndices=function(){return this._store.getIndices()},e.prototype.getDataExtent=function(t){return this._store.getDataExtent(this._getStoreDimIndex(t))},e.prototype.getSum=function(t){return this._store.getSum(this._getStoreDimIndex(t))},e.prototype.getMedian=function(t){return this._store.getMedian(this._getStoreDimIndex(t))},e.prototype.getValues=function(t,e){var n=this,o=this._store;return i(t)?o.getValues(Eh(t,(function(t){return n._getStoreDimIndex(t)})),e):o.getValues(t)},
- /**
- * If value is NaN. Including '-'
- * Only check the coord dimensions.
- */
- e.prototype.hasValue=function(t){for(var e=this._dimSummary.dataDimIndicesOnCoord,n=0,i=e.length;n<i;n++)
- // Ordinal type originally can be string or number.
- // But when an ordinal type is used on coord, it can
- // not be string but only number. So we can also use isNaN.
- if(isNaN(this._store.get(e[n],t)))return!1;return!0},
- /**
- * Retrieve the index with given name
- */
- e.prototype.indexOfName=function(t){for(var e=0,n=this._store.count();e<n;e++)if(this.getName(e)===t)return e;return-1},e.prototype.getRawIndex=function(t){return this._store.getRawIndex(t)},e.prototype.indexOfRawIndex=function(t){return this._store.indexOfRawIndex(t)},
- /**
- * Only support the dimension which inverted index created.
- * Do not support other cases until required.
- * @param dim concrete dim
- * @param value ordinal index
- * @return rawIndex
- */
- e.prototype.rawIndexOf=function(t,e){var n=t&&this._invertedIndicesMap[t],i=n&&n[e];return null==i||isNaN(i)?-1:i},
- /**
- * Retrieve the index of nearest value
- * @param dim
- * @param value
- * @param [maxDistance=Infinity]
- * @return If and only if multiple indices has
- * the same value, they are put to the result.
- */
- e.prototype.indicesOfNearest=function(t,e,n){return this._store.indicesOfNearest(this._getStoreDimIndex(t),e,n)},e.prototype.each=function(t,e,n){f(t)&&(n=e,e=t,t=[]);
- // ctxCompat just for compat echarts3
- var i=n||this,o=Eh(kh(t),this._getStoreDimIndex,this);this._store.each(o,i?lt(e,i):e)},e.prototype.filterSelf=function(t,e,n){f(t)&&(n=e,e=t,t=[]);
- // ctxCompat just for compat echarts3
- var i=n||this,o=Eh(kh(t),this._getStoreDimIndex,this);return this._store=this._store.filter(o,i?lt(e,i):e),this},
- /**
- * Select data in range. (For optimization of filter)
- * (Manually inline code, support 5 million data filtering in data zoom.)
- */
- e.prototype.selectRange=function(t){var e=this,n={},i=v(t);return a(i,(function(i){var o=e._getStoreDimIndex(i);n[o]=t[i]})),this._store=this._store.selectRange(n),this},
- /* eslint-enable max-len */
- e.prototype.mapArray=function(t,e,n){f(t)&&(n=e,e=t,t=[]),
- // ctxCompat just for compat echarts3
- n=n||this;var i=[];return this.each(t,(function(){i.push(e&&e.apply(this,arguments))}),n),i},e.prototype.map=function(t,e,n,i){
- // ctxCompat just for compat echarts3
- var o=n||i||this,r=Eh(kh(t),this._getStoreDimIndex,this),a=Nh(this);return a._store=this._store.map(r,o?lt(e,o):e),a},e.prototype.modify=function(t,e,n,i){
- // ctxCompat just for compat echarts3
- var o=n||i||this,r=Eh(kh(t),this._getStoreDimIndex,this);
- // If do shallow clone here, if there are too many stacked series,
- // it still cost lots of memory, because `_store.dimensions` are not shared.
- // We should consider there probably be shallow clone happen in each series
- // in consequent filter/map.
- this._store.modify(r,o?lt(e,o):e)},
- /**
- * Large data down sampling on given dimension
- * @param sampleIndex Sample index for name and id
- */
- e.prototype.downSample=function(t,e,n,i){var o=Nh(this);return o._store=this._store.downSample(this._getStoreDimIndex(t),e,n,i),o},
- /**
- * Large data down sampling using min-max
- * @param {string} valueDimension
- * @param {number} rate
- */
- e.prototype.minmaxDownSample=function(t,e){var n=Nh(this);return n._store=this._store.minmaxDownSample(this._getStoreDimIndex(t),e),n},
- /**
- * Large data down sampling using largest-triangle-three-buckets
- * @param {string} valueDimension
- * @param {number} targetCount
- */
- e.prototype.lttbDownSample=function(t,e){var n=Nh(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(t),e),n},e.prototype.getRawDataItem=function(t){return this._store.getRawDataItem(t)},
- /**
- * Get model of one data item.
- */
- // TODO: Type of data item
- e.prototype.getItemModel=function(t){var e=this.hostModel,n=this.getRawDataItem(t);return new yr(n,e,e&&e.ecModel)},
- /**
- * Create a data differ
- */
- e.prototype.diff=function(t){var e=this;return new yh(t?t.getStore().getIndices():[],this.getStore().getIndices(),(function(e){return Ah(t,e)}),(function(t){return Ah(e,t)}))},
- /**
- * Get visual property.
- */
- e.prototype.getVisual=function(t){var e=this._visual;return e&&e[t]},e.prototype.setVisual=function(t,e){this._visual=this._visual||{},Rh(t)?p(this._visual,t):this._visual[t]=e},
- /**
- * Get visual property of single data item
- */
- // eslint-disable-next-line
- e.prototype.getItemVisual=function(t,e){var n=this._itemVisuals[t],i=n&&n[e];return null==i?this.getVisual(e):i},
- /**
- * If exists visual property of single data item
- */
- e.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},
- /**
- * Make sure itemVisual property is unique
- */
- // TODO: use key to save visual to reduce memory.
- e.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,o=n[t];o||(o=n[t]={});var r=o[e];return null==r&&(r=this.getVisual(e),
- // TODO Performance?
- i(r)?r=r.slice():Rh(r)&&(r=p({},r)),o[e]=r),r},
- // eslint-disable-next-line
- e.prototype.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,Rh(e)?p(i,e):i[e]=n},
- /**
- * Clear itemVisuals and list visual.
- */
- e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(t,e){Rh(t)?p(this._layout,t):this._layout[t]=e},
- /**
- * Get layout property.
- */
- e.prototype.getLayout=function(t){return this._layout[t]},
- /**
- * Get layout of single data item
- */
- e.prototype.getItemLayout=function(t){return this._itemLayouts[t]},
- /**
- * Set layout of single data item
- */
- e.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?p(this._itemLayouts[t]||{},e):e},
- /**
- * Clear all layout of single data item
- */
- e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},
- /**
- * Set graphic element relative to data. It can be set as null
- */
- e.prototype.setItemGraphicEl=function(t,e){var n=this.hostModel&&this.hostModel.seriesIndex;ii(n,this.dataType,t,e),this._graphicEls[t]=e},e.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},e.prototype.eachItemGraphicEl=function(t,e){a(this._graphicEls,(function(n,i){n&&t&&t.call(e,n,i)}))},
- /**
- * Shallow clone a new list except visual and layout properties, and graph elements.
- * New list only change the indices.
- */
- e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:Eh(this.dimensions,this._getDimInfo,this),this.hostModel)),Ph(t,this),t._store=this._store,t},
- /**
- * Wrap some method to add more feature
- */
- e.prototype.wrapMethod=function(t,e){var n=this[t];f(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(wt(arguments)))})},
- // ----------------------------------------------------------
- // A work around for internal method visiting private member.
- // ----------------------------------------------------------
- e.internalField=(Ch=function(t){var e=t._invertedIndicesMap;a(e,(function(n,i){var o=t._dimInfos[i],r=o.ordinalMeta,a=t._store;
- // Currently, only dimensions that has ordinalMeta can create inverted indices.
- if(r){n=e[i]=new Vh(r.categories.length);
- // The default value of TypedArray is 0. To avoid miss
- // mapping to 0, we should set it as INDEX_NOT_FOUND.
- for(var s=0;s<n.length;s++)n[s]=-1;for(s=0;s<a.count();s++)
- // Only support the case that all values are distinct.
- n[a.get(o.storeDimIndex,s)]=s}}))},Lh=function(t,e,n){return Ln(t._getCategory(e,n),null)},
- /**
- * @see the comment of `List['getId']`.
- */
- Ah=function(t,e){var n=t._idList[e];return null==n&&null!=t._idDimIdx&&(n=Lh(t,t._idDimIdx,e)),null==n&&(n="e\0\0"+e),n},kh=function(t){return i(t)||(t=null!=t?[t]:[]),t},
- /**
- * Data in excludeDimensions is copied, otherwise transferred.
- */
- Nh=function(t){var n=new e(t._schema?t._schema:Eh(t.dimensions,t._getDimInfo,t),t.hostModel);
- // FIXME If needs stackedOn, value may already been stacked
- return Ph(n,t),n},Ph=function(t,e){a(zh.concat(e.__wrappedMethods||[]),(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t.__wrappedMethods=e.__wrappedMethods,a(Bh,(function(n){t[n]=et(e[n])})),t._calculationInfo=p({},e._calculationInfo)},void(Oh=function(t,e){var n=t._nameList,i=t._idList,o=t._nameDimIdx,r=t._idDimIdx,a=n[e],s=i[e];if(null==a&&null!=o&&(n[e]=a=Lh(t,o,e)),null==s&&null!=r&&(i[e]=s=Lh(t,r,e)),null==s&&null!=a){var l=t._nameRepeatCount,u=l[a]=(l[a]||0)+1;s=a,u>1&&(s+="__ec__"+u),i[e]=s}})),e}();const Fh=Gh;
- /**
- * For outside usage compat (like echarts-gl are using it).
- */function Wh(t,e){return Hh(t,e).dimensions}
- /**
- * This method builds the relationship between:
- * + "what the coord sys or series requires (see `coordDimensions`)",
- * + "what the user defines (in `encode` and `dimensions`, see `opt.dimensionsDefine` and `opt.encodeDefine`)"
- * + "what the data source provids (see `source`)".
- *
- * Some guess strategy will be adapted if user does not define something.
- * If no 'value' dimension specified, the first no-named dimension will be
- * named as 'value'.
- *
- * @return The results are always sorted by `storeDimIndex` asc.
- */function Hh(
- // TODO: TYPE completeDimensions type
- e,n){Zs(e)||(e=js(e));var i=(n=n||{}).coordDimensions||[],s=n.dimensionsDefine||e.dimensionsDefine||[],l=r(),u=[],c=
- // ??? TODO
- // Originally detect dimCount by data[0]. Should we
- // optimize it to only by sysDims and dimensions and encode.
- // So only necessary dims will be initialized.
- // But
- // (1) custom series should be considered. where other dims
- // may be visited.
- // (2) sometimes user need to calculate bubble size or use visualMap
- // on other dimensions besides coordSys needed.
- // So, dims that is not used by system, should be shared in data store?
- function(t,e,n,i){
- // Note that the result dimCount should not small than columns count
- // of data, otherwise `dataDimNameMap` checking will be incorrect.
- var r=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,i||0);return a(e,(function(t){var e;o(t)&&(e=t.dimsDef)&&(r=Math.max(r,e.length))})),r}(e,i,s,n.dimensionsCount),d=n.canOmitUnusedDimensions&&Th(c),h=s===e.dimensionsDefine,f=h?Dh(e):Ih(s),g=n.encodeDefine;!g&&n.encodeDefaulter&&(g=n.encodeDefaulter(e,c));for(var y=r(g),m=new Vl(c),v=0;v<m.length;v++)m[v]=-1;function x(t){var e=m[t];if(e<0){var n=s[t],i=o(n)?n:{name:n},r=new _h,a=i.name;null!=a&&null!=f.get(a)&&(
- // Only if `series.dimensions` is defined in option
- // displayName, will be set, and dimension will be displayed vertically in
- // tooltip by default.
- r.name=r.displayName=a),null!=i.type&&(r.type=i.type),null!=i.displayName&&(r.displayName=i.displayName);var l=u.length;return m[t]=l,r.storeDimIndex=t,u.push(r),r}return u[e]}if(!d)for(v=0;v<c;v++)x(v);
- // Set `coordDim` and `coordDimIndex` by `encodeDefMap` and normalize `encodeDefMap`.
- y.each((function(e,n){var i=Sn(e).slice();
- // Note: It is allowed that `dataDims.length` is `0`, e.g., options is
- // `{encode: {x: -1, y: 1}}`. Should not filter anything in
- // this case.
- if(1===i.length&&!t(i[0])&&i[0]<0)y.set(n,!1);else{var o=y.set(n,[]);a(i,(function(e,i){
- // The input resultDimIdx can be dim name or index.
- var r=t(e)?f.get(e):e;null!=r&&r<c&&(o[i]=r,b(x(r),n,i))}))}}));
- // Apply templates and default order from `sysDims`.
- var _=0;function b(t,e,n){null!=ka.get(e)?t.otherDims[e]=n:(t.coordDim=e,t.coordDimIndex=n,l.set(e,!0))}
- // Make sure the first extra dim is 'value'.
- a(i,(function(e){var n,i,r,s;if(t(e))n=e,s={};else{n=(s=e).name;var l=s.ordinalMeta;s.ordinalMeta=null,(s=p({},s)).ordinalMeta=l,
- // `coordDimIndex` should not be set directly.
- i=s.dimsDef,r=s.otherDims,s.name=s.coordDim=s.coordDimIndex=s.dimsDef=s.otherDims=null}var u=y.get(n);
- // negative resultDimIdx means no need to mapping.
- if(!1!==u){
- // dimensions provides default dim sequences.
- if(!(u=Sn(u)).length)for(var d=0;d<(i&&i.length||1);d++){for(;_<c&&null!=x(_).coordDim;)_++;_<c&&u.push(_++)}
- // Apply templates.
- a(u,(function(t,e){var a=x(t);
- // Coordinate system has a higher priority on dim type than source.
- if(h&&null!=s.type&&(a.type=s.type),b(I(a,s),n,e),null==a.name&&i){var l=i[e];!o(l)&&(l={name:l}),a.name=a.displayName=l.name,a.defaultTooltip=l.defaultTooltip}
- // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}}
- r&&I(a.otherDims,r)}))}}));var S=n.generateCoord,w=n.generateCoordCount,M=null!=w;w=S?w||1:0;var D=S||"value";function T(t){null==t.name&&(
- // Duplication will be removed in the next step.
- t.name=t.coordDim)}
- // Set dim `name` and other `coordDim` and other props.
- if(d)a(u,(function(t){
- // PENDING: guessOrdinal or let user specify type: 'ordinal' manually?
- T(t)})),
- // Sort dimensions: there are some rule that use the last dim as label,
- // and for some latter travel process easier.
- u.sort((function(t,e){return t.storeDimIndex-e.storeDimIndex}));else for(var C=0;C<c;C++){var A=x(C);null==A.coordDim&&(
- // TODO no need to generate coordDim for isExtraCoord?
- A.coordDim=Yh(D,l,M),A.coordDimIndex=0,
- // Series specified generateCoord is using out.
- (!S||w<=0)&&(A.isExtraCoord=!0),w--),T(A),null!=A.type||Xa(e,C)!==Ga&&(!A.isExtraCoord||null==A.otherDims.itemName&&null==A.otherDims.seriesName)||(A.type="ordinal")}return function(t){for(var e=r(),n=0;n<t.length;n++){var i=t[n],o=i.name,a=e.get(o)||0;a>0&&(
- // Starts from 0.
- i.name=o+(a-1)),a++,e.set(o,a)}}(u),new wh({source:e,dimensions:u,fullDimensionCount:c,dimensionOmitted:d})}function Yh(t,e,n){if(n||e.hasKey(t)){for(var i=0;e.hasKey(t+i);)i++;t+=i}return e.set(t,!0),t}
- /**
- * @class
- * For example:
- * {
- * coordSysName: 'cartesian2d',
- * coordSysDims: ['x', 'y', ...],
- * axisMap: HashMap({
- * x: xAxisModel,
- * y: yAxisModel
- * }),
- * categoryAxisMap: HashMap({
- * x: xAxisModel,
- * y: undefined
- * }),
- * // The index of the first category axis in `coordSysDims`.
- * // `null/undefined` means no category axis exists.
- * firstCategoryDimIndex: 1,
- * // To replace user specified encode.
- * }
- */var Uh=function(t){this.coordSysDims=[],this.axisMap=r(),this.categoryAxisMap=r(),this.coordSysName=t};var Zh={cartesian2d:function(t,e,n,i){var o=t.getReferringComponents("xAxis",zn).models[0],r=t.getReferringComponents("yAxis",zn).models[0];e.coordSysDims=["x","y"],n.set("x",o),n.set("y",r),Xh(o)&&(i.set("x",o),e.firstCategoryDimIndex=0),Xh(r)&&(i.set("y",r),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,n,i){var o=t.getReferringComponents("singleAxis",zn).models[0];e.coordSysDims=["single"],n.set("single",o),Xh(o)&&(i.set("single",o),e.firstCategoryDimIndex=0)},polar:function(t,e,n,i){var o=t.getReferringComponents("polar",zn).models[0],r=o.findAxisModel("radiusAxis"),a=o.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],n.set("radius",r),n.set("angle",a),Xh(r)&&(i.set("radius",r),e.firstCategoryDimIndex=0),Xh(a)&&(i.set("angle",a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,n,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,i){var o=t.ecModel,r=o.getComponent("parallel",t.get("parallelIndex")),s=e.coordSysDims=r.dimensions.slice();a(r.parallelAxisIndex,(function(t,r){var a=o.getComponent("parallelAxis",t),l=s[r];n.set(l,a),Xh(a)&&(i.set(l,a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=r))}))}};function Xh(t){return"category"===t.get("type")}
- /**
- * Note that it is too complicated to support 3d stack by value
- * (have to create two-dimension inverted index), so in 3d case
- * we just support that stacked by index.
- *
- * @param seriesModel
- * @param dimensionsInput The same as the input of <module:echarts/data/SeriesData>.
- * The input will be modified.
- * @param opt
- * @param opt.stackedCoordDimension Specify a coord dimension if needed.
- * @param opt.byIndex=false
- * @return calculationInfo
- * {
- * stackedDimension: string
- * stackedByDimension: string
- * isStackedByIndex: boolean
- * stackedOverDimension: string
- * stackResultDimension: string
- * }
- */function jh(e,n,i){var o,r,s,l=(i=i||{}).byIndex,u=i.stackedCoordDimension;!function(t){return!Mh(t.schema)}(n)?(r=n.schema,o=r.dimensions,s=n.store):o=n;
- // Compatibal: when `stack` is set as '', do not stack.
- var c,d,h,p,f=!(!e||!e.get("stack"));
- // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`.
- // That put stack logic in List is for using conveniently in echarts extensions, but it
- // might not be a good way.
- if(a(o,(function(e,n){t(e)&&(o[n]=e={name:e}),f&&!e.isExtraCoord&&(
- // Find the first ordinal dimension as the stackedByDimInfo.
- l||c||!e.ordinalMeta||(c=e),
- // Find the first stackable dimension as the stackedDimInfo.
- d||"ordinal"===e.type||"time"===e.type||u&&u!==e.coordDim||(d=e))})),!d||l||c||(
- // Compatible with previous design, value axis (time axis) only stack by index.
- // It may make sense if the user provides elaborately constructed data.
- l=!0),d){
- // Use a weird name that not duplicated with other names.
- // Also need to use seriesModel.id as postfix because different
- // series may share same data store. The stack dimension needs to be distinguished.
- h="__\0ecstackresult_"+e.id,p="__\0ecstackedover_"+e.id,
- // Create inverted index to fast query index by value.
- c&&(c.createInvertedIndices=!0);var g=d.coordDim,y=d.type,m=0;a(o,(function(t){t.coordDim===g&&m++}));var v={name:h,coordDim:g,coordDimIndex:m,type:y,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:o.length},x={name:p,
- // This dimension contains stack base (generally, 0), so do not set it as
- // `stackedDimCoordDim` to avoid extent calculation, consider log scale.
- coordDim:p,coordDimIndex:m+1,type:y,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:o.length+1};r?(s&&(v.storeDimIndex=s.ensureCalculationDimension(p,y),x.storeDimIndex=s.ensureCalculationDimension(h,y)),r.appendCalculationDimension(v),r.appendCalculationDimension(x)):(o.push(v),o.push(x))}return{stackedDimension:d&&d.name,stackedByDimension:c&&c.name,isStackedByIndex:l,stackedOverDimension:p,stackResultDimension:h}}function qh(t,e){
- // Each single series only maps to one pair of axis. So we do not need to
- // check stackByDim, whatever stacked by a dimension or stacked by index.
- return!!e&&e===t.getCalculationInfo("stackedDimension")}function Kh(t,e){return qh(t,e)?t.getCalculationInfo("stackResultDimension"):e}
- /**
- * Caution: there are side effects to `sourceManager` in this method.
- * Should better only be called in `Series['getInitialData']`.
- */
- function Jh(t,e,o){o=o||{};var r,s=e.getSourceManager(),l=!1;t?(l=!0,r=js(t)):
- // Is series.data. not dataset.
- l=(r=s.getSource()).sourceFormat===Pa;var u=function(t){var e=t.get("coordinateSystem"),n=new Uh(e),i=Zh[e];if(i)return i(t,n,n.axisMap,n.categoryAxisMap),n}(e),c=function(t,e){var i,o=t.get("coordinateSystem"),r=fs.get(o);return e&&e.coordSysDims&&(i=n(e.coordSysDims,(function(t){var n={name:t},i=e.axisMap.get(t);if(i){var o=i.get("type");n.type=xh(o)}return n}))),i||(
- // Get dimensions from registered coordinate system
- i=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]),i}(e,u),d=o.useEncodeDefaulter,h=f(d)?d:d?rt(Ya,c,e):null,p=Hh(r,{coordDimensions:c,generateCoord:o.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:h,canOmitUnusedDimensions:!l}),g=function(t,e,n){var i,o;return n&&a(t,(function(t,r){var a=t.coordDim,s=n.categoryAxisMap.get(a);s&&(null==i&&(i=r),t.ordinalMeta=s.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(o=!0)})),o||null==i||(t[i].otherDims.itemName=0),i}(p.dimensions,o.createInvertedIndices,u),y=l?null:s.getSharedDataStore(p),m=jh(e,{schema:p,store:y}),v=new Fh(p,e);v.setCalculationInfo(m);var x=null!=g&&function(t){if(t.sourceFormat===Pa){var e=function(t){var e=0;for(;e<t.length&&null==t[e];)e++;return t[e]}(t.data||[]);return!i(In(e))}}(r)?function(t,e,n,i){
- // Use dataIndex as ordinal value in categoryAxis
- return i===g?n:this.defaultDimValueGetter(t,e,n,i)}:null;return v.hasItemOption=!1,v.initData(
- // Try to reuse the data store in sourceManager if using dataset.
- l?r:y,null,x),v}var $h=/** @class */function(){function t(t){this._setting=t||{},this._extent=[Infinity,-Infinity]}return t.prototype.getSetting=function(t){return this._setting[t]},
- /**
- * Set extent from data
- */
- t.prototype.unionExtent=function(t){var e=this._extent;t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1])},
- /**
- * Set extent from data
- */
- t.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},
- /**
- * Get extent
- *
- * Extent is always in increase order.
- */
- t.prototype.getExtent=function(){return this._extent.slice()},
- /**
- * Set extent
- */
- t.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},
- /**
- * If value is in extent range
- */
- t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},
- /**
- * When axis extent depends on data and no data exists,
- * axis ticks should not be drawn, which is named 'blank'.
- */
- t.prototype.isBlank=function(){return this._isBlank},
- /**
- * When axis extent depends on data and no data exists,
- * axis ticks should not be drawn, which is named 'blank'.
- */
- t.prototype.setBlank=function(t){this._isBlank=t},t}();$n($h);const Qh=$h;var tp=0,ep=/** @class */function(){function e(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++tp}return e.createByAxisModel=function(t){var i=t.option,o=i.data,r=o&&n(o,np);return new e({categories:r,needCollect:!r,
- // deduplication is default in axis.
- deduplication:!1!==i.dedplication})},e.prototype.getOrdinal=function(t){
- // @ts-ignore
- return this._getOrCreateMap().get(t)},
- /**
- * @return The ordinal. If not found, return NaN.
- */
- e.prototype.parseAndCollect=function(e){var n,i=this._needCollect;
- // The value of category dim can be the index of the given category set.
- // This feature is only supported when !needCollect, because we should
- // consider a common case: a value is 2017, which is a number but is
- // expected to be tread as a category. This case usually happen in dataset,
- // where it happent to be no need of the index feature.
- if(!t(e)&&!i)return e;
- // Optimize for the scenario:
- // category is ['2012-01-01', '2012-01-02', ...], where the input
- // data has been ensured not duplicate and is large data.
- // Notice, if a dataset dimension provide categroies, usually echarts
- // should remove duplication except user tell echarts dont do that
- // (set axis.deduplication = false), because echarts do not know whether
- // the values in the category dimension has duplication (consider the
- // parallel-aqi example)
- if(i&&!this._deduplication)return n=this.categories.length,this.categories[n]=e,n;var o=this._getOrCreateMap();
- // @ts-ignore
- return null==(n=o.get(e))&&(i?(n=this.categories.length,this.categories[n]=e,
- // @ts-ignore
- o.set(e,n)):n=NaN),n},
- // Consider big data, do not create map until needed.
- e.prototype._getOrCreateMap=function(){return this._map||(this._map=r(this.categories))},e}();function np(t){return o(t)&&null!=t.value?t.value:t+""}const ip=ep;function op(t){return"interval"===t.type||"log"===t.type}
- /**
- * @param extent Both extent[0] and extent[1] should be valid number.
- * Should be extent[0] < extent[1].
- * @param splitNumber splitNumber should be >= 1.
- */function rp(t,e,n,i){var o={},r=t[1]-t[0],a=o.interval=cn(r/e,!0);null!=n&&a<n&&(a=o.interval=n),null!=i&&a>i&&(a=o.interval=i);
- // Tow more digital for tick.
- var s=o.intervalPrecision=sp(a);
- // Niced extent inside original extent
- // In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent.
- return function(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),lp(t,0,e),lp(t,1,e),t[0]>t[1]&&(t[0]=t[1])}(o.niceTickExtent=[qe(Math.ceil(t[0]/a)*a,s),qe(Math.floor(t[1]/a)*a,s)],t),o}function ap(t){var e=Math.pow(10,un(t)),n=t/e;
- // Increase interval
- return n?2===n?n=3:3===n?n=5:
- // f is 1 or 5
- n*=2:n=1,qe(n*e)}
- /**
- * @return interval precision
- */function sp(t){
- // Tow more digital for tick.
- return Je(t)+2}function lp(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function up(t,e){return t>=e[0]&&t<=e[1]}function cp(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function dp(t,e){return t*(e[1]-e[0])+e[0]}var hp=/** @class */function(e){function r(t){var r=e.call(this,t)||this;r.type="ordinal";var a=r.getSetting("ordinalMeta");
- // Caution: Should not use instanceof, consider ec-extensions using
- // import approach to get OrdinalMeta class.
- return a||(a=new ip({})),i(a)&&(a=new ip({categories:n(a,(function(t){return o(t)?t.value:t}))})),r._ordinalMeta=a,r._extent=r.getSetting("extent")||[0,a.categories.length-1],r}return Ue(r,e),r.prototype.parse=function(e){
- // Caution: Math.round(null) will return `0` rather than `NaN`
- return null==e?NaN:t(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},r.prototype.contain=function(t){return up(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},
- /**
- * Normalize given rank or name to linear [0, 1]
- * @param val raw ordinal number.
- * @return normalized value in [0, 1].
- */
- r.prototype.normalize=function(t){return cp(t=this._getTickNumber(this.parse(t)),this._extent)},
- /**
- * @param val normalized value in [0, 1].
- * @return raw ordinal number.
- */
- r.prototype.scale=function(t){return t=Math.round(dp(t,this._extent)),this.getRawOrdinalNumber(t)},r.prototype.getTicks=function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push({value:n}),n++;return t},r.prototype.getMinorTicks=function(t){},
- /**
- * @see `Ordinal['_ordinalNumbersByTick']`
- */
- r.prototype.setSortInfo=function(t){if(null!=t){for(var e=t.ordinalNumbers,n=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],o=0,r=this._ordinalMeta.categories.length,a=Math.min(r,e.length);o<a;++o){var s=e[o];n[o]=s,i[s]=o}
- // Handle that `series.data` only covers part of the `axis.category.data`.
- for(var l=0;o<r;++o){for(;null!=i[l];)l++;n.push(l),i[l]=o}}else this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null},r.prototype._getTickNumber=function(t){var e=this._ticksByOrdinalNumber;
- // also support ordinal out of range of `ordinalMeta.categories.length`,
- // where ordinal numbers are used as tick value directly.
- return e&&t>=0&&t<e.length?e[t]:t},
- /**
- * @usage
- * ```js
- * const ordinalNumber = ordinalScale.getRawOrdinalNumber(tickVal);
- *
- * // case0
- * const rawOrdinalValue = axisModel.getCategories()[ordinalNumber];
- * // case1
- * const rawOrdinalValue = this._ordinalMeta.categories[ordinalNumber];
- * // case2
- * const coord = axis.dataToCoord(ordinalNumber);
- * ```
- *
- * @param {OrdinalNumber} tickNumber index of display
- */
- r.prototype.getRawOrdinalNumber=function(t){var e=this._ordinalNumbersByTick;
- // tickNumber may be out of range, e.g., when axis max is larger than `ordinalMeta.categories.length`.,
- // where ordinal numbers are used as tick value directly.
- return e&&t>=0&&t<e.length?e[t]:t},
- /**
- * Get item on tick
- */
- r.prototype.getLabel=function(t){if(!this.isBlank()){var e=this.getRawOrdinalNumber(t.value),n=this._ordinalMeta.categories[e];
- // Note that if no data, ordinalMeta.categories is an empty array.
- // Return empty if it's not exist.
- return null==n?"":n+""}},r.prototype.count=function(){return this._extent[1]-this._extent[0]+1},r.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},
- /**
- * @override
- * If value is in extent range
- */
- r.prototype.isInExtentRange=function(t){return t=this._getTickNumber(t),this._extent[0]<=t&&this._extent[1]>=t},r.prototype.getOrdinalMeta=function(){return this._ordinalMeta},r.prototype.calcNiceTicks=function(){},r.prototype.calcNiceExtent=function(){},r.type="ordinal",r}(Qh);Qh.registerClass(hp);const pp=hp;var fp=qe,gp=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",
- // Step is calculated in adjustExtent.
- e._interval=0,e._intervalPrecision=2,e}return Ue(e,t),e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return up(t,this._extent)},e.prototype.normalize=function(t){return cp(t,this._extent)},e.prototype.scale=function(t){return dp(t,this._extent)},e.prototype.setExtent=function(t,e){var n=this._extent;
- // start,end may be a Number like '25',so...
- isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},e.prototype.unionExtent=function(t){var e=this._extent;t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1]),
- // unionExtent may called by it's sub classes
- this.setExtent(e[0],e[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,
- // Dropped auto calculated niceExtent and use user-set extent.
- // We assume user wants to set both interval, min, max to get a better result.
- this._niceExtent=this._extent.slice(),this._intervalPrecision=sp(t)},
- /**
- * @param expandToNicedExtent Whether expand the ticks to niced extent.
- */
- e.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,o=this._intervalPrecision,r=[];
- // If interval is 0, return [];
- if(!e)return r;
- // Consider this case: using dataZoom toolbox, zoom and zoom.
- n[0]<i[0]&&(t?r.push({value:fp(i[0]-e,o)}):r.push({value:n[0]}));for(var a=i[0];a<=i[1]&&(r.push({value:a}),(
- // Avoid rounding error
- a=fp(a+e,o))!==r[r.length-1].value);)if(r.length>1e4)return[];
- // Consider this case: the last item of ticks is smaller
- // than niceTickExtent[1] and niceTickExtent[1] === extent[1].
- var s=r.length?r[r.length-1].value:i[1];return n[1]>s&&(t?r.push({value:fp(s+e,o)}):r.push({value:n[1]})),r},e.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),o=1;o<e.length;o++){for(var r=e[o],a=e[o-1],s=0,l=[],u=(r.value-a.value)/t;s<t-1;){var c=fp(a.value+(s+1)*u);
- // For the first and last interval. The count may be less than splitNumber.
- c>i[0]&&c<i[1]&&l.push(c),s++}n.push(l)}return n},
- /**
- * @param opt.precision If 'auto', use nice presision.
- * @param opt.pad returns 1.50 but not 1.5 if precision is 2.
- */
- e.prototype.getLabel=function(t,e){if(null==t)return"";var n=e&&e.precision;return null==n?n=Je(t.value)||0:"auto"===n&&(
- // Should be more precise then tick.
- n=this._intervalPrecision),oa(fp(t.value,n,!0))},
- /**
- * @param splitNumber By default `5`.
- */
- e.prototype.calcNiceTicks=function(t,e,n){t=t||5;var i=this._extent,o=i[1]-i[0];if(isFinite(o)){
- // User may set axis min 0 and data are all negative
- // FIXME If it needs to reverse ?
- o<0&&(o=-o,i.reverse());var r=rp(i,t,e,n);this._intervalPrecision=r.intervalPrecision,this._interval=r.interval,this._niceExtent=r.niceTickExtent}},e.prototype.calcNiceExtent=function(t){var e=this._extent;
- // If extent start and end are same, expand them
- if(e[0]===e[1])if(0!==e[0]){
- // Expand extent
- // Note that extents can be both negative. See #13154
- var n=Math.abs(e[0]);
- // In the fowllowing case
- // Axis has been fixed max 100
- // Plus data are all 100 and axis extent are [100, 100].
- // Extend to the both side will cause expanded max is larger than fixed max.
- // So only expand to the smaller side.
- t.fixMax||(e[1]+=n/2),e[0]-=n/2}else e[1]=1;var i=e[1]-e[0];
- // If there are no data and extent are [Infinity, -Infinity]
- isFinite(i)||(e[0]=0,e[1]=1),this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval);
- // let extent = this._extent;
- var o=this._interval;t.fixMin||(e[0]=fp(Math.floor(e[0]/o)*o)),t.fixMax||(e[1]=fp(Math.ceil(e[1]/o)*o))},e.prototype.setNiceExtent=function(t,e){this._niceExtent=[t,e]},e.type="interval",e}(Qh);Qh.registerClass(gp);const yp=gp;
- /* global Float32Array */var mp="undefined"!=typeof Float32Array,vp=mp?Float32Array:Array;function xp(t){return i(t)?mp?new Float32Array(t):t:new vp(t);
- // Else is number
- }var _p="__ec_stack_";function bp(t){return t.get("stack")||_p+t.seriesIndex}function Sp(t){return t.dim+t.index}
- /**
- * @return {Object} {width, offset, offsetCenter} If axis.type is not 'category', return undefined.
- */function wp(t,e){var n=[];return e.eachSeriesByType(t,(function(t){
- // Check series coordinate, do layout for cartesian2d only
- Cp(t)&&n.push(t)})),n}
- /**
- * Map from (baseAxis.dim + '_' + baseAxis.index) to min gap of two adjacent
- * values.
- * This works for time axes, value axes, and log axes.
- * For a single time axis, return value is in the form like
- * {'x_0': [1000000]}.
- * The value of 1000000 is in milliseconds.
- */function Mp(t){var e=function(t){
- /**
- * Map from axis.index to values.
- * For a single time axis, axisValues is in the form like
- * {'x_0': [1495555200000, 1495641600000, 1495728000000]}.
- * Items in axisValues[x], e.g. 1495555200000, are time values of all
- * series.
- */
- var e={};a(t,(function(t){var n=t.coordinateSystem.getBaseAxis();if("time"===n.type||"value"===n.type)for(var i=t.getData(),o=n.dim+"_"+n.index,r=i.getDimensionIndex(i.mapDimension(n.dim)),a=i.getStore(),s=0,l=a.count();s<l;++s){var u=a.get(r,s);e[o]?
- // No value in previous series
- e[o].push(u):
- // No previous data for the axis
- e[o]=[u];
- // Ignore duplicated time values in the same axis
- }}));var n={};for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];if(o){
- // Sort axis values into ascending order to calculate gaps
- o.sort((function(t,e){return t-e}));for(var r=null,s=1;s<o.length;++s){var l=o[s]-o[s-1];l>0&&(
- // Ignore 0 delta because they are of the same axis value
- r=null===r?l:Math.min(r,l))}
- // Set to null if only have one data
- n[i]=r}}return n}(t),n=[];return a(t,(function(t){var i,o=t.coordinateSystem.getBaseAxis(),r=o.getExtent();if("category"===o.type)i=o.getBandWidth();else if("value"===o.type||"time"===o.type){var a=o.dim+"_"+o.index,s=e[a],l=Math.abs(r[1]-r[0]),u=o.scale.getExtent(),c=Math.abs(u[1]-u[0]);i=s?l/c*s:l}else{var d=t.getData();i=Math.abs(r[1]-r[0])/d.count()}var h=je(t.get("barWidth"),i),p=je(t.get("barMaxWidth"),i),f=je(
- // barMinWidth by default is 0.5 / 1 in cartesian. Because in value axis,
- // the auto-calculated bar width might be less than 0.5 / 1.
- t.get("barMinWidth")||(Ap(t)?.5:1),i),g=t.get("barGap"),y=t.get("barCategoryGap");n.push({bandWidth:i,barWidth:h,barMaxWidth:p,barMinWidth:f,barGap:g,barCategoryGap:y,axisKey:Sp(o),stackId:bp(t)})})),Ip(n)}function Ip(t){
- // Columns info on each category axis. Key is cartesian name
- var e={};a(t,(function(t,n){var i=t.axisKey,o=t.bandWidth,r=e[i]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},a=r.stacks;e[i]=r;var s=t.stackId;a[s]||r.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};
- // Caution: In a single coordinate system, these barGrid attributes
- // will be shared by series. Consider that they have default values,
- // only the attributes set on the last series will work.
- // Do not change this fact unless there will be a break change.
- var l=t.barWidth;l&&!a[s].width&&(
- // See #6312, do not restrict width.
- a[s].width=l,l=Math.min(r.remainedWidth,l),r.remainedWidth-=l);var u=t.barMaxWidth;u&&(a[s].maxWidth=u);var c=t.barMinWidth;c&&(a[s].minWidth=c);var d=t.barGap;null!=d&&(r.gap=d);var h=t.barCategoryGap;null!=h&&(r.categoryGap=h)}));var n={};return a(e,(function(t,e){n[e]={};var i=t.stacks,o=t.bandWidth,r=t.categoryGap;if(null==r){var s=v(i).length;
- // More columns in one group
- // the spaces between group is smaller. Or the column will be too thin.
- r=Math.max(35-4*s,15)+"%"}var l=je(r,o),u=je(t.gap,1),c=t.remainedWidth,d=t.autoWidthCount,h=(c-l)/(d+(d-1)*u);h=Math.max(h,0),
- // Find if any auto calculated bar exceeded maxBarWidth
- a(i,(function(t){var e=t.maxWidth,n=t.minWidth;if(t.width){
- // `barMinWidth/barMaxWidth` has higher priority than `barWidth`, as
- // CSS does. Because barWidth can be a percent value, where
- // `barMaxWidth` can be used to restrict the final width.
- i=t.width;e&&(i=Math.min(i,e)),
- // `minWidth` has higher priority, as described above
- n&&(i=Math.max(i,n)),t.width=i,c-=i+u*i,d--}else{var i=h;e&&e<i&&(i=Math.min(e,c)),
- // `minWidth` has higher priority. `minWidth` decide that whether the
- // bar is able to be visible. So `minWidth` should not be restricted
- // by `maxWidth` or `remainedWidth` (which is from `bandWidth`). In
- // the extreme cases for `value` axis, bars are allowed to overlap
- // with each other if `minWidth` specified.
- n&&n>i&&(i=n),i!==h&&(t.width=i,c-=i+u*i,d--)}})),
- // Recalculate width again
- h=(c-l)/(d+(d-1)*u),h=Math.max(h,0);var p,f=0;a(i,(function(t,e){t.width||(t.width=h),p=t,f+=t.width*(1+u)})),p&&(f-=p.width*u);var g=-f/2;a(i,(function(t,i){n[e][i]=n[e][i]||{bandWidth:o,offset:g,width:t.width},g+=t.width*(1+u)}))})),n}function Dp(t,e){var n=wp(t,e),i=Mp(n);a(n,(function(t){var e=t.getData(),n=t.coordinateSystem.getBaseAxis(),o=bp(t),r=i[Sp(n)][o],a=r.offset,s=r.width;e.setLayout({bandWidth:r.bandWidth,offset:a,size:s})}))}
- // TODO: Do not support stack in large mode yet.
- function Tp(t){return{seriesType:t,plan:Iu(),reset:function(t){if(Cp(t)){var e=t.getData(),n=t.coordinateSystem,i=n.getBaseAxis(),o=n.getOtherAxis(i),r=e.getDimensionIndex(e.mapDimension(o.dim)),a=e.getDimensionIndex(e.mapDimension(i.dim)),s=t.get("showBackground",!0),l=e.mapDimension(o.dim),u=e.getCalculationInfo("stackResultDimension"),c=qh(e,l)&&!!e.getCalculationInfo("stackedOnSeries"),d=o.isHorizontal(),h=
- // See cases in `test/bar-start.html` and `#7412`, `#8747`.
- function(t,e){var n=e.model.get("startValue");n||(n=0);return e.toGlobalCoord(e.dataToCoord("log"===e.type?n>0?n:1:n))}
- // FIXME 公用?
- (0,o),p=Ap(t),f=t.get("barMinHeight")||0,g=u&&e.getDimensionIndex(u),y=e.getLayout("size"),m=e.getLayout("offset");return{progress:function(t,e){for(var i,o=t.count,l=p&&xp(3*o),u=p&&s&&xp(3*o),v=p&&xp(o),x=n.master.getRect(),_=d?x.width:x.height,b=e.getStore(),S=0;null!=(i=t.next());){var w=b.get(c?g:r,i),M=b.get(a,i),I=h,D=void 0;
- // Because of the barMinHeight, we can not use the value in
- // stackResultDimension directly.
- c&&(D=+w-b.get(r,i));var T=void 0,C=void 0,A=void 0,L=void 0;if(d){var k=n.dataToPoint([w,M]);if(c)I=n.dataToPoint([D,M])[0];T=I,C=k[1]+m,A=k[0]-I,L=y,Math.abs(A)<f&&(A=(A<0?-1:1)*f)}else{k=n.dataToPoint([M,w]);if(c)I=n.dataToPoint([M,D])[1];T=k[0]+m,C=I,A=y,L=k[1]-I,Math.abs(L)<f&&(
- // Include zero to has a positive bar
- L=(L<=0?-1:1)*f)}p?(l[S]=T,l[S+1]=C,l[S+2]=d?A:L,u&&(u[S]=d?x.x:T,u[S+1]=d?C:x.y,u[S+2]=_),v[i]=i):e.setItemLayout(i,{x:T,y:C,width:A,height:L}),S+=3}p&&e.setLayout({largePoints:l,largeDataIndices:v,largeBackgroundPoints:u,valueAxisHorizontal:d})}}}}}}function Cp(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type}function Ap(t){return t.pipelineContext&&t.pipelineContext.large}var Lp=/** @class */function(e){function o(t){var n=e.call(this,t)||this;return n.type="time",n}
- /**
- * Get label is mainly for other components like dataZoom, tooltip.
- */return Ue(o,e),o.prototype.getLabel=function(t){var e=this.getSetting("useUTC");return Fr(t.value,Rr[function(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:
- // Also for day, hour, minute, second
- return"second"}}(Br(this._minLevelUnit))]||Rr.second,e,this.getSetting("locale"))},o.prototype.getFormattedLabel=function(e,n,o){var r=this.getSetting("useUTC");return function(e,n,o,r,a){var s=null;if(t(o))
- // Single formatter for all units at all levels
- s=o;else if(f(o))
- // Callback formatter
- s=o(e.value,n,{level:e.level});else{var l=p({},Nr);if(e.level>0)for(var u=0;u<Er.length;++u)l[Er[u]]="{primary|"+l[Er[u]]+"}";var c=o?!1===o.inherit?o:I(o,l):l,d=Wr(e.value,a);if(c[d])s=c[d];else if(c.inherit){for(u=Vr.indexOf(d)-1;u>=0;--u)if(c[d]){s=c[d];break}s=s||l.none}if(i(s)){var h=null==e.level?0:e.level>=0?e.level:s.length+e.level;s=s[h=Math.min(h,s.length-1)]}}return Fr(new Date(e.value),s,a,r)}(e,n,o,this.getSetting("locale"),r)},
- /**
- * @override
- */
- o.prototype.getTicks=function(){var t=this._interval,e=this._extent,i=[];
- // If interval is 0, return [];
- if(!t)return i;i.push({value:e[0],level:0});var o=this.getSetting("useUTC"),r=function(t,e,i,o){var r=1e4,a=Vr,s=0;function l(t,e,n,i,r,a,s){
- // if (isDate) {
- // d -= 1; // Starts with 0; PENDING
- // }
- for(var l=new Date(e),u=e,c=l[i]();u<n&&u<=o[1];)s.push({value:u}),c+=t,l[r](c),u=l.getTime();
- // This extra tick is for calcuating ticks of next level. Will not been added to the final result
- s.push({value:u,notAdd:!0})}function u(t,n,r){var a=[],s=!n.length;if(!function(t,e,n,i){var o=sn(e),r=sn(n),a=function(t){return Hr(o,t,i)===Hr(r,t,i)},s=function(){return a("year")},l=function(){return s()&&a("month")},u=function(){return l()&&a("day")},c=function(){return u()&&a("hour")},d=function(){return c()&&a("minute")},h=function(){return d()&&a("second")},p=function(){return h()&&a("millisecond")};switch(t){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return d();case"second":return h();case"millisecond":return p()}}
- // const primaryUnitGetters = {
- // year: fullYearGetterName(),
- // month: monthGetterName(),
- // day: dateGetterName(),
- // hour: hoursGetterName(),
- // minute: minutesGetterName(),
- // second: secondsGetterName(),
- // millisecond: millisecondsGetterName()
- // };
- // const primaryUnitUTCGetters = {
- // year: fullYearGetterName(true),
- // month: monthGetterName(true),
- // day: dateGetterName(true),
- // hour: hoursGetterName(true),
- // minute: minutesGetterName(true),
- // second: secondsGetterName(true),
- // millisecond: millisecondsGetterName(true)
- // };
- // function moveTick(date: Date, unitName: TimeUnit, step: number, isUTC: boolean) {
- // step = step || 1;
- // switch (getPrimaryTimeUnit(unitName)) {
- // case 'year':
- // date[fullYearSetterName(isUTC)](date[fullYearGetterName(isUTC)]() + step);
- // break;
- // case 'month':
- // date[monthSetterName(isUTC)](date[monthGetterName(isUTC)]() + step);
- // break;
- // case 'day':
- // date[dateSetterName(isUTC)](date[dateGetterName(isUTC)]() + step);
- // break;
- // case 'hour':
- // date[hoursSetterName(isUTC)](date[hoursGetterName(isUTC)]() + step);
- // break;
- // case 'minute':
- // date[minutesSetterName(isUTC)](date[minutesGetterName(isUTC)]() + step);
- // break;
- // case 'second':
- // date[secondsSetterName(isUTC)](date[secondsGetterName(isUTC)]() + step);
- // break;
- // case 'millisecond':
- // date[millisecondsSetterName(isUTC)](date[millisecondsGetterName(isUTC)]() + step);
- // break;
- // }
- // return date.getTime();
- // }
- // const DATE_INTERVALS = [[8, 7.5], [4, 3.5], [2, 1.5]];
- // const MONTH_INTERVALS = [[6, 5.5], [3, 2.5], [2, 1.5]];
- // const MINUTES_SECONDS_INTERVALS = [[30, 30], [20, 20], [15, 15], [10, 10], [5, 5], [2, 2]];
- (Br(t),o[0],o[1],i)){s&&(n=[{
- // TODO Optimize. Not include so may ticks.
- value:Vp(new Date(o[0]),t,i)},{value:o[1]}]);for(var u=0;u<n.length-1;u++){var c=n[u].value,d=n[u+1].value;if(c!==d){var h=void 0,p=void 0,f=void 0,g=!1;switch(t){case"year":h=Math.max(1,Math.round(e/kr/365)),p=Yr(i),f=Jr(i);break;case"half-year":case"quarter":case"month":h=Np(e),p=Ur(i),f=$r(i);break;case"week":// PENDING If week is added. Ignore day.
- case"half-week":case"day":h=Pp(e),// Use 32 days and let interval been 16
- p=Zr(i),f=Qr(i),g=!0;break;case"half-day":case"quarter-day":case"hour":h=Op(e),p=Xr(i),f=ta(i);break;case"minute":h=Rp(e,!0),p=jr(i),f=ea(i);break;case"second":h=Rp(e,!1),p=qr(i),f=na(i);break;case"millisecond":h=Ep(e),p=Kr(i),f=ia(i)}l(h,c,d,p,f,g,a),"year"===t&&r.length>1&&0===u&&
- // Add nearest years to the left extent.
- r.unshift({value:r[0].value-h})}}for(u=0;u<a.length;u++)r.push(a[u]);
- // newAddedTicks.length && console.log(unitName, newAddedTicks);
- return a}}for(var c=[],d=[],h=0,p=0,f=0;f<a.length&&s++<r;++f){var g=Br(a[f]);if(Gr(a[f]))if(u(a[f],c[c.length-1]||[],d),g!==(a[f+1]?Br(a[f+1]):null)){if(d.length){p=h,
- // Remove the duplicate so the tick count can be precisely.
- d.sort((function(t,e){return t.value-e.value}));for(var y=[],m=0;m<d.length;++m){var v=d[m].value;0!==m&&d[m-1].value===v||(y.push(d[m]),v>=o[0]&&v<=o[1]&&h++)}var x=(o[1]-o[0])/e;
- // Added too much in this level and not too less in last level
- if(h>1.5*x&&p>x/1.5)break;
- // Only treat primary time unit as one level.
- if(c.push(y),h>x||t===a[f])break}
- // Reset if next unitName is primary
- d=[]}}var _=st(n(c,(function(t){return st(t,(function(t){return t.value>=o[0]&&t.value<=o[1]&&!t.notAdd}))})),(function(t){return t.length>0})),b=[],S=_.length-1;for(f=0;f<_.length;++f)for(var w=_[f],M=0;M<w.length;++M)b.push({value:w[M].value,level:S-f});b.sort((function(t,e){return t.value-e.value}));
- // Remove duplicates
- var I=[];for(f=0;f<b.length;++f)0!==f&&b[f].value===b[f-1].value||I.push(b[f]);return I}(this._minLevelUnit,this._approxInterval,o,e);return(i=i.concat(r)).push({value:e[1],level:0}),i},o.prototype.calcNiceExtent=function(t){var e=this._extent;
- // If extent start and end are same, expand them
- // If there are no data and extent are [Infinity, -Infinity]
- if(e[0]===e[1]&&(
- // Expand extent
- e[0]-=kr,e[1]+=kr),-Infinity===e[1]&&Infinity===e[0]){var n=new Date;e[1]=+new Date(n.getFullYear(),n.getMonth(),n.getDate()),e[0]=e[1]-kr}this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval)},o.prototype.calcNiceTicks=function(t,e,n){t=t||10;var i=this._extent,o=i[1]-i[0];this._approxInterval=o/t,null!=e&&this._approxInterval<e&&(this._approxInterval=e),null!=n&&this._approxInterval>n&&(this._approxInterval=n);var r=kp.length,a=Math.min(function(t,e,n,i){for(;n<i;){var o=n+i>>>1;t[o][1]<e?n=o+1:i=o}return n}(kp,this._approxInterval,0,r),r-1);
- // Interval that can be used to calculate ticks
- this._interval=kp[a][1],
- // Min level used when picking ticks from top down.
- // We check one more level to avoid the ticks are to sparse in some case.
- this._minLevelUnit=kp[Math.max(a-1,0)][0]},o.prototype.parse=function(t){
- // val might be float.
- return l(t)?t:+sn(t)},o.prototype.contain=function(t){return up(this.parse(t),this._extent)},o.prototype.normalize=function(t){return cp(this.parse(t),this._extent)},o.prototype.scale=function(t){return dp(t,this._extent)},o.type="time",o}(yp),kp=[
- // Format interval
- ["second",Cr],["minute",Ar],["hour",Lr],["quarter-day",216e5],["half-day",432e5],["day",10368e4],["half-week",3024e5],["week",6048e5],["month",26784e5],["quarter",8208e6],["half-year",Pr/2],["year",Pr]];function Pp(t,e){return(t/=kr)>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function Np(t){return(t/=2592e6)>6?6:t>3?3:t>2?2:1}function Op(t){return(t/=Lr)>12?12:t>6?6:t>3.5?4:t>2?2:1}function Rp(t,e){return(t/=e?Ar:Cr)>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function Ep(t){return cn(t,!0)}function Vp(t,e,n){var i=new Date(t);switch(Br(e)){case"year":case"month":i[$r(n)](0);case"day":i[Qr(n)](1);case"hour":i[ta(n)](0);case"minute":i[ea(n)](0);case"second":i[na(n)](0),i[ia(n)](0)}return i.getTime()}Qh.registerClass(Lp);const zp=Lp;var Bp=Qh.prototype,Gp=yp.prototype,Fp=qe,Wp=Math.floor,Hp=Math.ceil,Yp=Math.pow,Up=Math.log,Zp=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e.base=10,e._originalScale=new yp,
- // FIXME:TS actually used by `IntervalScale`
- e._interval=0,e}
- /**
- * @param Whether expand the ticks to niced extent.
- */return Ue(e,t),e.prototype.getTicks=function(t){var e=this._originalScale,i=this._extent,o=e.getExtent(),r=Gp.getTicks.call(this,t);return n(r,(function(t){var e=t.value,n=qe(Yp(this.base,e));
- // Fix #4158
- return n=e===i[0]&&this._fixMin?jp(n,o[0]):n,{value:n=e===i[1]&&this._fixMax?jp(n,o[1]):n}}),this)},e.prototype.setExtent=function(t,e){var n=Up(this.base);
- // log(-Infinity) is NaN, so safe guard here
- t=Up(Math.max(0,t))/n,e=Up(Math.max(0,e))/n,Gp.setExtent.call(this,t,e)},
- /**
- * @return {number} end
- */
- e.prototype.getExtent=function(){var t=this.base,e=Bp.getExtent.call(this);e[0]=Yp(t,e[0]),e[1]=Yp(t,e[1]);
- // Fix #4158
- var n=this._originalScale.getExtent();return this._fixMin&&(e[0]=jp(e[0],n[0])),this._fixMax&&(e[1]=jp(e[1],n[1])),e},e.prototype.unionExtent=function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=Up(t[0])/Up(e),t[1]=Up(t[1])/Up(e),Bp.unionExtent.call(this,t)},e.prototype.unionExtentFromData=function(t,e){
- // TODO
- // filter value that <= 0
- this.unionExtent(t.getApproximateExtent(e))},
- /**
- * Update interval and extent of intervals for nice ticks
- * @param approxTickNum default 10 Given approx tick number
- */
- e.prototype.calcNiceTicks=function(t){t=t||10;var e=this._extent,n=e[1]-e[0];if(!(Infinity===n||n<=0)){var i=ln(n);
- // Interval should be integer
- for(
- // Filter ticks to get closer to the desired count.
- t/n*i<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var o=[qe(Hp(e[0]/i)*i),qe(Wp(e[1]/i)*i)];this._interval=i,this._niceExtent=o}},e.prototype.calcNiceExtent=function(t){Gp.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return up(t=Up(t)/Up(this.base),this._extent)},e.prototype.normalize=function(t){return cp(t=Up(t)/Up(this.base),this._extent)},e.prototype.scale=function(t){return t=dp(t,this._extent),Yp(this.base,t)},e.type="log",e}(Qh),Xp=Zp.prototype;
- // FIXME:TS refactor: not good to call it directly with `this`?
- function jp(t,e){return Fp(t,Je(e))}Xp.getMinorTicks=Gp.getMinorTicks,Xp.getLabel=Gp.getLabel,Qh.registerClass(Zp);const qp=Zp;var Kp=/** @class */function(){function t(t,e,
- // Usually: data extent from all series on this axis.
- n){this._prepareParams(t,e,n)}
- /**
- * Parameters depending on outside (like model, user callback)
- * are prepared and fixed here.
- */return t.prototype._prepareParams=function(t,e,
- // Usually: data extent from all series on this axis.
- n){n[1]<n[0]&&(n=[NaN,NaN]),this._dataMin=n[0],this._dataMax=n[1];var o=this._isOrdinal="ordinal"===t.type;this._needCrossZero="interval"===t.type&&e.getNeedCrossZero&&e.getNeedCrossZero();var r=e.get("min",!0);null==r&&(r=e.get("startValue",!0));var a=this._modelMinRaw=r;f(a)?
- // This callback always provides users the full data extent (before data is filtered).
- this._modelMinNum=tf(t,a({min:n[0],max:n[1]})):"dataMin"!==a&&(this._modelMinNum=tf(t,a));var s=this._modelMaxRaw=e.get("max",!0);if(f(s)?
- // This callback always provides users the full data extent (before data is filtered).
- this._modelMaxNum=tf(t,s({min:n[0],max:n[1]})):"dataMax"!==s&&(this._modelMaxNum=tf(t,s)),o)
- // FIXME: there is a flaw here: if there is no "block" data processor like `dataZoom`,
- // and progressive rendering is using, here the category result might just only contain
- // the processed chunk rather than the entire result.
- this._axisDataLen=e.getCategories().length;else{var l=e.get("boundaryGap"),u=i(l)?l:[l||0,l||0];"boolean"==typeof u[0]||"boolean"==typeof u[1]?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[Mt(u[0],1),Mt(u[1],1)]}},
- /**
- * Calculate extent by prepared parameters.
- * This method has no external dependency and can be called duplicatedly,
- * getting the same result.
- * If parameters changed, should call this method to recalcuate.
- */
- t.prototype.calculate=function(){
- // Notice: When min/max is not set (that is, when there are null/undefined,
- // which is the most common case), these cases should be ensured:
- // (1) For 'ordinal', show all axis.data.
- // (2) For others:
- // + `boundaryGap` is applied (if min/max set, boundaryGap is
- // disabled).
- // + If `needCrossZero`, min/max should be zero, otherwise, min/max should
- // be the result that originalExtent enlarged by boundaryGap.
- // (3) If no data, it should be ensured that `scale.setBlank` is set.
- var t=this._isOrdinal,e=this._dataMin,n=this._dataMax,i=this._axisDataLen,o=this._boundaryGapInner,r=t?null:n-e||Math.abs(e),a="dataMin"===this._modelMinRaw?e:this._modelMinNum,s="dataMax"===this._modelMaxRaw?n:this._modelMaxNum,l=null!=a,u=null!=s;null==a&&(a=t?i?0:NaN:e-o[0]*r),null==s&&(s=t?i?i-1:NaN:n+o[1]*r),(null==a||!isFinite(a))&&(a=NaN),(null==s||!isFinite(s))&&(s=NaN);var c=It(a)||It(s)||t&&!i;
- // If data extent modified, need to recalculated to ensure cross zero.
- this._needCrossZero&&(
- // Axis is over zero and min is not set
- a>0&&s>0&&!l&&(a=0),
- // Axis is under zero and max is not set
- a<0&&s<0&&!u&&(s=0));var d=this._determinedMin,h=this._determinedMax;
- // Ensure min/max be finite number or NaN here. (not to be null/undefined)
- // `NaN` means min/max axis is blank.
- return null!=d&&(a=d,l=!0),null!=h&&(s=h,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:c}},t.prototype.modifyDataMinMax=function(t,e){this[$p[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){this[Jp[t]]=e},t.prototype.freeze=function(){
- // @ts-ignore
- this.frozen=!0},t}(),Jp={min:"_determinedMin",max:"_determinedMax"},$p={min:"_dataMin",max:"_dataMax"};
- /**
- * Get scale min max and related info only depends on model settings.
- * This method can be called after coordinate system created.
- * For example, in data processing stage.
- *
- * Scale extent info probably be required multiple times during a workflow.
- * For example:
- * (1) `dataZoom` depends it to get the axis extent in "100%" state.
- * (2) `processor/extentCalculator` depends it to make sure whether axis extent is specified.
- * (3) `coordSys.update` use it to finally decide the scale extent.
- * But the callback of `min`/`max` should not be called multiple times.
- * The code below should not be implemented repeatedly either.
- * So we cache the result in the scale instance, which will be recreated at the beginning
- * of the workflow (because `scale` instance will be recreated each round of the workflow).
- */
- function Qp(t,e,
- // Usually: data extent from all series on this axis.
- n){
- // Do not permit to recreate.
- var i=t.rawExtentInfo;return i||(i=new Kp(t,e,n),
- // @ts-ignore
- t.rawExtentInfo=i,i)}function tf(t,e){return null==e?null:It(e)?NaN:t.parse(e)}
- /**
- * Get axis scale extent before niced.
- * Item of returned array can only be number (including Infinity and NaN).
- *
- * Caution:
- * Precondition of calling this method:
- * The scale extent has been initialized using series data extent via
- * `scale.setExtent` or `scale.unionExtentFromData`;
- */function ef(t,e){var n=t.type,i=Qp(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var o=i.min,r=i.max,s=e.ecModel;if(s&&"time"/* || scaleType === 'interval' */===n){var l=wp("bar",s),u=!1;if(a(l,(function(t){u=u||t.getBaseAxis()===e.axis})),u){
- // Calculate placement of bars on axis. TODO should be decoupled
- // with barLayout
- var c=Mp(l),d=function(t,e,n,
- // Only support cartesian coord yet.
- i){
- // Get Axis Length
- var o=n.axis.getExtent(),r=Math.abs(o[1]-o[0]),s=function(t,e,n){if(t&&e){var i=t[Sp(e)];return null!=i&&null!=n?i[bp(n)]:i}}(i,n.axis);if(void 0===s)return{min:t,max:e};var l=Infinity;a(s,(function(t){l=Math.min(t.offset,l)}));var u=-Infinity;a(s,(function(t){u=Math.max(t.offset+t.width,u)})),l=Math.abs(l),u=Math.abs(u);var c=l+u,d=e-t,h=d/(1-(l+u)/r)-d;
- // Calculate required buffer based on old range and overflow
- return e+=h*(u/c),t-=h*(l/c),{min:t,max:e}}
- // Precondition of calling this method:
- // The scale extent has been initialized using series data extent via
- // `scale.setExtent` or `scale.unionExtentFromData`;
- (o,r,e,c);
- // Adjust axis min and max to account for overflow
- o=d.min,r=d.max}}return{extent:[o,r],
- // "fix" means "fixed", the value should not be
- // changed in the subsequent steps.
- fixMin:i.minFixed,fixMax:i.maxFixed}}function nf(t,e){var n=e,i=ef(t,n),o=i.extent,r=n.get("splitNumber");t instanceof qp&&(t.base=n.get("logBase"));var a=t.type,s=n.get("interval"),l="interval"===a||"time"===a;t.setExtent(o[0],o[1]),t.calcNiceExtent({splitNumber:r,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),
- // If some one specified the min, max. And the default calculated interval
- // is not good enough. He can specify the interval. It is often appeared
- // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard
- // to be 60.
- // FIXME
- null!=s&&t.setInterval&&t.setInterval(s)}
- /**
- * @param axisType Default retrieve from model.type
- */function of(t,e){if(e=e||t.get("type"))switch(e){
- // Buildin scale
- case"category":return new pp({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[Infinity,-Infinity]});case"time":return new zp({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:
- // case 'value'/'interval', 'log', or others.
- return new(Qh.getClass(e)||yp)}}
- /**
- * Check if the axis cross 0
- */
- /**
- * @param axis
- * @return Label formatter function.
- * param: {number} tickValue,
- * param: {number} idx, the index in all ticks.
- * If category axis, this param is not required.
- * return: {string} label string.
- */
- function rf(e){var n,i,o=e.getLabelModel().get("formatter"),r="category"===e.type?e.scale.getExtent()[0]:null;return"time"===e.scale.type?(i=o,function(t,n){return e.scale.getFormattedLabel(t,n,i)}):t(o)?function(t){return function(n){
- // For category axis, get raw value; for numeric axis,
- // get formatted label like '1,333,444'.
- var i=e.scale.getLabel(n);return t.replace("{value}",null!=i?i:"")}}(o):f(o)?(n=o,function(t,i){
- // The original intention of `idx` is "the index of the tick in all ticks".
- // But the previous implementation of category axis do not consider the
- // `axisLabel.interval`, which cause that, for example, the `interval` is
- // `1`, then the ticks "name5", "name7", "name9" are displayed, where the
- // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep
- // the definition here for back compatibility.
- return null!=r&&(i=t.value-r),n(af(e,t),i,null!=t.level?{level:t.level}:null)}):function(t){return e.scale.getLabel(t)}}function af(t,e){
- // In category axis with data zoom, tick is not the original
- // index of axis.data. So tick should not be exposed to user
- // in category axis.
- return"category"===t.type?t.scale.getLabel(e):e.value}
- /**
- * @param axis
- * @return Be null/undefined if no labels.
- */function sf(t,e){var n=e*Math.PI/180,i=t.width,o=t.height,r=i*Math.abs(Math.cos(n))+Math.abs(o*Math.sin(n)),a=i*Math.abs(Math.sin(n))+Math.abs(o*Math.cos(n));return new Y(t.x,t.y,r,a)}
- /**
- * @param model axisLabelModel or axisTickModel
- * @return {number|String} Can be null|'auto'|number|function
- */function lf(t){var e=t.get("interval");return null==e?"auto":e}
- /**
- * Set `categoryInterval` as 0 implicitly indicates that
- * show all labels regardless of overlap.
- * @param {Object} axis axisModel.axis
- */function uf(t){return"category"===t.type&&0===lf(t.getLabelModel())}function cf(t,e){
- // Remove duplicated dat dimensions caused by `getStackedDimension`.
- var n={};
- // Currently `mapDimensionsAll` will contain stack result dimension ('__\0ecstackresult').
- // PENDING: is it reasonable? Do we need to remove the original dim from "coord dim" since
- // there has been stacked result dim?
- return a(t.mapDimensionsAll(e),(function(e){
- // For example, the extent of the original dimension
- // is [0.1, 0.5], the extent of the `stackResultDimension`
- // is [7, 9], the final extent should NOT include [0.1, 0.5],
- // because there is no graphic corresponding to [0.1, 0.5].
- // See the case in `test/area-stack.html` `main1`, where area line
- // stack needs `yAxis` not start from 0.
- n[Kh(t,e)]=!0})),v(n)}
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- var df=/** @class */function(){function t(){}return t.prototype.getNeedCrossZero=function(){return!this.option.scale},
- /**
- * Should be implemented by each axis model if necessary.
- * @return coordinate system model
- */
- t.prototype.getCoordSysModel=function(){},t}();
- /**
- * Create a multi dimension List structure from seriesModel.
- */var hf={isDimensionStacked:qh,enableDataStack:jh,getStackedDimension:Kh};
- /**
- * Create scale
- * @param {Array.<number>} dataExtent
- * @param {Object|module:echarts/Model} option If `optoin.type`
- * is secified, it can only be `'value'` currently.
- */function pf(t,e){return Zo(t,null,null,"normal"!==(e=e||{}).state)}const ff=Object.freeze(Object.defineProperty({__proto__:null,createDimensions:Wh,createList:function(t){return Jh(null,t)},createScale:function(t,e){var n=e;e instanceof yr||(n=new yr(e));var i=of(n);return i.setExtent(t[0],t[1]),nf(i,n),i}
- /**
- * Mixin common methods to axis model,
- *
- * Include methods
- * `getFormattedLabels() => Array.<string>`
- * `getCategories() => Array.<string>`
- * `getMin(origin: boolean) => number`
- * `getMax(origin: boolean) => number`
- * `getNeedCrossZero() => boolean`
- */,createSymbol:Gc,createTextStyle:pf,dataStack:hf,enableHoverEmphasis:Yi,getECData:ni,getLayoutRect:xa,mixinAxisModelCommonMethods:function(t){nt(t,df)}},Symbol.toStringTag,{value:"Module"}));var gf=[];function yf(t,e){for(var n=0;n<t.length;n++)P(t[n],t[n],e)}function mf(t,e,n,i){for(var o=0;o<t.length;o++){var r=t[o];i&&(
- // projection may return null point.
- r=i.project(r)),r&&isFinite(r[0])&&isFinite(r[1])&&(Tt(e,e,r),Ct(n,n,r))}}var vf=/** @class */function(){function t(t){this.name=t}return t.prototype.setCenter=function(t){this._center=t},
- /**
- * Get center point in data unit. That is,
- * for GeoJSONRegion, the unit is lat/lng,
- * for GeoSVGRegion, the unit is SVG local coord.
- */
- t.prototype.getCenter=function(){var t=this._center;return t||(
- // In most cases there are no need to calculate this center.
- // So calculate only when called.
- t=this._center=this.calcCenter()),t},t}(),xf=function(t,e){this.type="polygon",this.exterior=t,this.interiors=e},_f=function(t){this.type="linestring",this.points=t},bf=/** @class */function(t){function e(e,n,i){var o=t.call(this,e)||this;return o.type="geoJSON",o.geometries=n,o._center=i&&[i[0],i[1]],o}return Ue(e,t),e.prototype.calcCenter=function(){for(var t,e=this.geometries,n=0,i=0;i<e.length;i++){var o=e[i],r=o.exterior,a=r&&r.length;a>n&&(t=o,n=a)}if(t)return function(t){
- // Polygon should been closed.
- for(var e=0,n=0,i=0,o=t.length,r=t[o-1][0],a=t[o-1][1],s=0;s<o;s++){var l=t[s][0],u=t[s][1],c=r*u-l*a;e+=c,n+=(r+l)*c,i+=(a+u)*c,r=l,a=u}return e?[n/e/3,i/e/3,e]:[t[0][0]||0,t[0][1]||0]}(t.exterior);
- // from bounding rect by default.
- var s=this.getBoundingRect();return[s.x+s.width/2,s.y+s.height/2]},e.prototype.getBoundingRect=function(t){var e=this._rect;
- // Always recalculate if using projection.
- if(e&&!t)return e;var n=[Infinity,Infinity],i=[-Infinity,-Infinity],o=this.geometries;return a(o,(function(e){"polygon"===e.type?
- // Doesn't consider hole
- mf(e.exterior,n,i,t):a(e.points,(function(e){mf(e,n,i,t)}))})),
- // Normalie invalid bounding.
- isFinite(n[0])&&isFinite(n[1])&&isFinite(i[0])&&isFinite(i[1])||(n[0]=n[1]=i[0]=i[1]=0),e=new Y(n[0],n[1],i[0]-n[0],i[1]-n[1]),t||(this._rect=e),e},e.prototype.contain=function(t){var e=this.getBoundingRect(),n=this.geometries;if(!e.contain(t[0],t[1]))return!1;t:for(var i=0,o=n.length;i<o;i++){var r=n[i];
- // Only support polygon.
- if("polygon"===r.type){var a=r.exterior,s=r.interiors;if(Dt(a,t[0],t[1])){
- // Not in the region if point is in the hole.
- for(var l=0;l<(s?s.length:0);l++)if(Dt(s[l],t[0],t[1]))continue t;return!0}}}return!1},
- /**
- * Transform the raw coords to target bounding.
- * @param x
- * @param y
- * @param width
- * @param height
- */
- e.prototype.transformTo=function(t,e,n,i){var o=this.getBoundingRect(),r=o.width/o.height;n?i||(i=n/r):n=r*i;for(var s=new Y(t,e,n,i),l=o.calculateTransform(s),u=this.geometries,c=0;c<u.length;c++){var d=u[c];"polygon"===d.type?(yf(d.exterior,l),a(d.interiors,(function(t){yf(t,l)}))):a(d.points,(function(t){yf(t,l)}))}(o=this._rect).copy(s),
- // Update center
- this._center=[o.x+o.width/2,o.y+o.height/2]},e.prototype.cloneShallow=function(t){null==t&&(t=this.name);var n=new e(t,this.geometries,this._center);// Simply avoid to be called.
- return n._rect=this._rect,n.transformTo=null,n},e}(vf),Sf=/** @class */function(t){function e(e,n){var i=t.call(this,e)||this;return i.type="geoSVG",i._elOnlyForCalculate=n,i}return Ue(e,t),e.prototype.calcCenter=function(){for(var t=this._elOnlyForCalculate,e=t.getBoundingRect(),n=[e.x+e.width/2,e.y+e.height/2],i=w(gf),o=t;o&&!o.isGeoSVGGraphicRoot;)M(i,o.getLocalTransform(),i),o=o.parent;return k(i,i),P(n,n,i),n},e}(vf);function wf(t,e,n){for(var i=0;i<t.length;i++)t[i]=Mf(t[i],e[i],n)}function Mf(t,e,n){for(var i=[],o=e[0],r=e[1],a=0;a<t.length;a+=2){var s=t.charCodeAt(a)-64,l=t.charCodeAt(a+1)-64;
- // ZigZag decoding
- s=s>>1^-(1&s),l=l>>1^-(1&l),o=
- // Delta deocding
- s+=o,r=l+=r,
- // Dequantize
- i.push([s/n,l/n])}return i}function If(t,e){return t=function(t){if(!t.UTF8Encoding)return t;var e=t,n=e.UTF8Scale;null==n&&(n=1024);var i=e.features;return a(i,(function(t){var e=t.geometry,i=e.encodeOffsets,o=e.coordinates;
- // Geometry may be appeded manually in the script after json loaded.
- // In this case this geometry is usually not encoded.
- if(i)switch(e.type){case"LineString":e.coordinates=Mf(o,i,n);break;case"Polygon":case"MultiLineString":wf(o,i,n);break;case"MultiPolygon":a(o,(function(t,e){return wf(t,i[e],n)}))}})),
- // Has been decoded
- e.UTF8Encoding=!1,e}(t),n(st(t.features,(function(t){
- // Output of mapshaper may have geometry null
- return t.geometry&&t.properties&&t.geometry.coordinates.length>0})),(function(t){var n=t.properties,i=t.geometry,o=[];switch(i.type){case"Polygon":var r=i.coordinates;
- // According to the GeoJSON specification.
- // First must be exterior, and the rest are all interior(holes).
- o.push(new xf(r[0],r.slice(1)));break;case"MultiPolygon":a(i.coordinates,(function(t){t[0]&&o.push(new xf(t[0],t.slice(1)))}));break;case"LineString":o.push(new _f([i.coordinates]));break;case"MultiLineString":o.push(new _f(i.coordinates))}var s=new bf(n[e||"name"],o,n.cp);return s.properties=n,s}))}const Df=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:nn,asc:Ke,getPercentWithPrecision:function(t,e,n){return t[e]&&tn(t,n)[e]||0},getPixelPrecision:Qe,getPrecision:Je,getPrecisionSafe:$e,isNumeric:fn,isRadianAroundZero:rn,linearMap:Xe,nice:cn,numericToNumber:pn,parseDate:sn,quantile:dn,quantity:ln,quantityExponent:un,reformIntervals:hn,remRadian:on,round:qe},Symbol.toStringTag,{value:"Module"})),Tf=Object.freeze(Object.defineProperty({__proto__:null,format:Fr,parse:sn},Symbol.toStringTag,{value:"Module"})),Cf=Object.freeze(Object.defineProperty({__proto__:null,Arc:H,BezierCurve:W,BoundingRect:Y,Circle:O,CompoundPath:U,Ellipse:R,Group:Z,Image:b,IncrementalDisplayable:X,Line:F,LinearGradient:j,Polygon:z,Polyline:B,RadialGradient:J,Rect:G,Ring:V,Sector:E,Text:$,clipPointsByRect:ko,clipRectByRect:Po,createIcon:No,extendPath:yo,extendShape:fo,getShapeClass:vo,getTransform:Do,initProps:oo,makeImage:_o,makePath:xo,mergePath:So,registerShape:mo,resizePath:wo,updateProps:io},Symbol.toStringTag,{value:"Module"})),Af=Object.freeze(Object.defineProperty({__proto__:null,addCommas:oa,capitalFirst:
- /**
- * Capital first
- * @param {string} str
- * @return {string}
- */
- function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},encodeHTML:ot,formatTime:function(t,e,n){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var i=sn(e),o=n?"getUTC":"get",r=i[o+"FullYear"](),a=i[o+"Month"]()+1,s=i[o+"Date"](),l=i[o+"Hours"](),u=i[o+"Minutes"](),c=i[o+"Seconds"](),d=i[o+"Milliseconds"]();return t=t.replace("MM",zr(a,2)).replace("M",a).replace("yyyy",r).replace("yy",zr(r%100+"",2)).replace("dd",zr(s,2)).replace("d",s).replace("hh",zr(l,2)).replace("h",l).replace("mm",zr(u,2)).replace("m",u).replace("ss",zr(c,2)).replace("s",c).replace("SSS",zr(d,3))},formatTpl:ca,getTextRect:function(t,e,n,i,o,r,a,s){return new $({style:{text:t,font:e,align:n,verticalAlign:i,padding:o,rich:r,overflow:a?"truncate":null,lineHeight:s}}).getBoundingRect()},getTooltipMarker:da,normalizeCssArray:aa,toCamelCase:ra,truncateText:At},Symbol.toStringTag,{value:"Module"})),Lf=Object.freeze(Object.defineProperty({__proto__:null,bind:lt,clone:et,curry:rt,defaults:I,each:a,extend:p,filter:st,indexOf:c,inherits:h,isArray:i,isFunction:f,isObject:o,isString:t,map:n,merge:tt,reduce:e},Symbol.toStringTag,{value:"Module"}));var kf=On();function Pf(t,e){var i=n(e,(function(e){return t.scale.parse(e)}));return"time"===t.type&&i.length>0&&(
- // Time axis needs duplicate first/last tick (see TimeScale.getTicks())
- // The first and last tick/label don't get drawn
- i.sort(),i.unshift(i[0]),i.push(i[i.length-1])),i}function Nf(t){var e=t.getLabelModel().get("customValues");if(e){var i=rf(t),o=t.scale.getExtent(),r=Pf(t,e),a=st(r,(function(t){return t>=o[0]&&t<=o[1]}));return{labels:n(a,(function(e){var n={value:e};return{formattedLabel:i(n),rawLabel:t.scale.getLabel(n),tickValue:e}}))}}
- // Only ordinal scale support tick interval
- return"category"===t.type?function(t){var e=t.getLabelModel(),n=Rf(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}(t):function(t){var e=t.scale.getTicks(),i=rf(t);return{labels:n(e,(function(e,n){return{level:e.level,formattedLabel:i(e,n),rawLabel:t.scale.getLabel(e),tickValue:e.value}}))}}(t)}
- /**
- * @param {module:echats/coord/Axis} axis
- * @param {module:echarts/model/Model} tickModel For example, can be axisTick, splitLine, splitArea.
- * @return {Object} {
- * ticks: Array.<number>
- * tickCategoryInterval: number
- * }
- */function Of(t,e){var i=t.getTickModel().get("customValues");if(i){var o=t.scale.getExtent(),r=Pf(t,i);return{ticks:st(r,(function(t){return t>=o[0]&&t<=o[1]}))}}
- // Only ordinal scale support tick interval
- return"category"===t.type?function(t,e){var i,o,r=Ef(t,"ticks"),a=lf(e),s=Vf(r,a);if(s)return s;
- // Optimize for the case that large category data and no label displayed,
- // we should not return all ticks.
- e.get("show")&&!t.scale.isBlank()||(i=[]);if(f(a))i=Gf(t,a,!0);else if("auto"===a){var l=Rf(t,t.getLabelModel());o=l.labelCategoryInterval,i=n(l.labels,(function(t){return t.tickValue}))}else i=Bf(t,o=a,!0);
- // Cache to avoid calling interval function repeatedly.
- return zf(r,a,{ticks:i,tickCategoryInterval:o})}(t,e):{ticks:n(t.scale.getTicks(),(function(t){return t.value}))}}function Rf(t,e){var n,i,o=Ef(t,"labels"),r=lf(e),a=Vf(o,r);return a||(f(r)?n=Gf(t,r):(i="auto"===r?function(t){var e=kf(t).autoInterval;return null!=e?e:kf(t).autoInterval=t.calculateCategoryInterval()}
- /**
- * Calculate interval for category axis ticks and labels.
- * To get precise result, at least one of `getRotate` and `isHorizontal`
- * should be implemented in axis.
- */(t):r,n=Bf(t,i)),zf(o,r,{labels:n,labelCategoryInterval:i}))}function Ef(t,e){
- // Because key can be a function, and cache size always is small, we use array cache.
- return kf(t)[e]||(kf(t)[e]=[])}function Vf(t,e){for(var n=0;n<t.length;n++)if(t[n].key===e)return t[n].value}function zf(t,e,n){return t.push({key:e,value:n}),n}function Bf(t,e,n){var i=rf(t),o=t.scale,r=o.getExtent(),a=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=r[0],c=o.count();
- // Calculate start tick based on zero if possible to keep label consistent
- // while zooming and moving while interval > 0. Otherwise the selection
- // of displayable ticks and symbols probably keep changing.
- // 3 is empirical value.
- 0!==u&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));
- // (1) Only add min max label here but leave overlap checking
- // to render stage, which also ensure the returned list
- // suitable for splitLine and splitArea rendering.
- // (2) Scales except category always contain min max label so
- // do not need to perform this process.
- var d=uf(t),h=a.get("showMinLabel")||d,p=a.get("showMaxLabel")||d;h&&u!==r[0]&&g(r[0]);
- // Optimize: avoid generating large array by `ordinalScale.getTicks()`.
- for(var f=u;f<=r[1];f+=l)g(f);function g(t){var e={value:t};s.push(n?t:{formattedLabel:i(e),rawLabel:o.getLabel(e),tickValue:t})}return p&&f-l!==r[1]&&g(r[1]),s}function Gf(t,e,n){var i=t.scale,o=rf(t),r=[];return a(i.getTicks(),(function(t){var a=i.getLabel(t),s=t.value;e(t.value,a)&&r.push(n?s:{formattedLabel:o(t),rawLabel:a,tickValue:s})})),r}var Ff=[0,1],Wf=/** @class */function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}
- /**
- * If axis extent contain given coord
- */return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&t<=i},
- /**
- * If axis extent contain given data
- */
- t.prototype.containData=function(t){return this.scale.contain(t)},
- /**
- * Get coord extent.
- */
- t.prototype.getExtent=function(){return this._extent.slice()},
- /**
- * Get precision used for formatting
- */
- t.prototype.getPixelPrecision=function(t){return Qe(t||this.scale.getExtent(),this._extent)},
- /**
- * Set coord extent
- */
- t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},
- /**
- * Convert data to coord. Data is the rank if it has an ordinal scale
- */
- t.prototype.dataToCoord=function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(t),this.onBand&&"ordinal"===i.type&&Hf(n=n.slice(),i.count()),Xe(t,Ff,n,e)},
- /**
- * Convert coord to data. Data is the rank if it has an ordinal scale
- */
- t.prototype.coordToData=function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&Hf(n=n.slice(),i.count());var o=Xe(t,n,Ff,e);return this.scale.scale(o)},
- /**
- * Convert pixel point to data in axis
- */
- t.prototype.pointToData=function(t,e){},
- /**
- * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,
- * `axis.getTicksCoords` considers `onBand`, which is used by
- * `boundaryGap:true` of category axis and splitLine and splitArea.
- * @param opt.tickModel default: axis.model.getModel('axisTick')
- * @param opt.clamp If `true`, the first and the last
- * tick must be at the axis end points. Otherwise, clip ticks
- * that outside the axis extent.
- */
- t.prototype.getTicksCoords=function(t){var e=(t=t||{}).tickModel||this.getTickModel(),i=Of(this,e).ticks,o=n(i,(function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}}),this);
- // If axis has labels [1, 2, 3, 4]. Bands on the axis are
- // |---1---|---2---|---3---|---4---|.
- // So the displayed ticks and splitLine/splitArea should between
- // each data item, otherwise cause misleading (e.g., split tow bars
- // of a single data item when there are two bar series).
- // Also consider if tickCategoryInterval > 0 and onBand, ticks and
- // splitLine/spliteArea should layout appropriately corresponding
- // to displayed labels. (So we should not use `getBandWidth` in this
- // case).
- return function(t,e,n,i){var o=e.length;if(!t.onBand||n||!o)return;var r,s,l=t.getExtent();if(1===o)e[0].coord=l[0],r=e[1]={coord:l[1],tickValue:e[0].tickValue};else{var u=e[o-1].tickValue-e[0].tickValue,c=(e[o-1].coord-e[0].coord)/u;a(e,(function(t){t.coord-=c/2}));var d=t.scale.getExtent();s=1+d[1]-e[o-1].tickValue,r={coord:e[o-1].coord+c*s,tickValue:d[1]+1},e.push(r)}var h=l[0]>l[1];
- // Handling clamp.
- p(e[0].coord,l[0])&&(i?e[0].coord=l[0]:e.shift());i&&p(l[0],e[0].coord)&&e.unshift({coord:l[0]});p(l[1],r.coord)&&(i?r.coord=l[1]:e.pop());i&&p(r.coord,l[1])&&e.push({coord:l[1]});function p(t,e){
- // Avoid rounding error cause calculated tick coord different with extent.
- // It may cause an extra unnecessary tick added.
- return t=qe(t),e=qe(e),h?t>e:t<e}}(this,o,e.get("alignWithLabel"),t.clamp),o},t.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)
- // Category axis doesn't support minor ticks
- return[];var t=this.model.getModel("minorTick").get("splitNumber");
- // Protection.
- t>0&&t<100||(t=5);var e=this.scale.getMinorTicks(t);return n(e,(function(t){return n(t,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this)}),this)},t.prototype.getViewLabels=function(){return Nf(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},
- /**
- * Notice here we only get the default tick model. For splitLine
- * or splitArea, we should pass the splitLineModel or splitAreaModel
- * manually when calling `getTicksCoords`.
- * In GL, this method may be overridden to:
- * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`
- */
- t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},
- /**
- * Get width of band
- */
- t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);
- // Fix #2728, avoid NaN when only one data.
- 0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},
- /**
- * Only be called in category axis.
- * Can be overridden, consider other axes like in 3D.
- * @return Auto interval for cateogry axis tick and label
- */
- t.prototype.calculateCategoryInterval=function(){return function(t){var e=function(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}(t),n=rf(t),i=(e.axisRotate-e.labelRotate)/180*Math.PI,o=t.scale,r=o.getExtent(),a=o.count();if(r[1]-r[0]<1)return 0;var s=1;
- // Simple optimization. Empirical value: tick count should less than 40.
- a>40&&(s=Math.max(1,Math.floor(a/40)));
- // Caution: Performance sensitive for large category data.
- // Consider dataZoom, we should make appropriate step to avoid O(n) loop.
- for(var l=r[0],u=t.dataToCoord(l+1)-t.dataToCoord(l),c=Math.abs(u*Math.cos(i)),d=Math.abs(u*Math.sin(i)),h=0,p=0;l<=r[1];l+=s){var f,g,y=Lt(n({value:l}),e.font,"center","top");
- // Magic number
- f=1.3*y.width,g=1.3*y.height,
- // Min size, void long loop.
- h=Math.max(h,f,7),p=Math.max(p,g,7)}var m=h/c,v=p/d;
- // 0/0 is NaN, 1/0 is Infinity.
- isNaN(m)&&(m=Infinity),isNaN(v)&&(v=Infinity);var x=Math.max(0,Math.floor(Math.min(m,v))),_=kf(t.model),b=t.getExtent(),S=_.lastAutoInterval,w=_.lastTickCount;
- // Use cache to keep interval stable while moving zoom window,
- // otherwise the calculated interval might jitter when the zoom
- // window size is close to the interval-changing size.
- // For example, if all of the axis labels are `a, b, c, d, e, f, g`.
- // The jitter will cause that sometimes the displayed labels are
- // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).
- return null!=S&&null!=w&&Math.abs(S-x)<=1&&Math.abs(w-a)<=1&&S>x&&_.axisExtent0===b[0]&&_.axisExtent1===b[1]?x=S:(_.lastTickCount=a,_.lastAutoInterval=x,_.axisExtent0=b[0],_.axisExtent1=b[1]),x}(this)},t}();
- /**
- * Base class of Axis.
- */function Hf(t,e){var n=(t[1]-t[0])/e/2;t[0]+=n,t[1]-=n}const Yf=Wf;
- // --------------------- Deprecated Extension Methods ---------------------
- // Should use `ComponentModel.extend` or `class XXXX extend ComponentModel` to create class.
- // Then use `registerComponentModel` in `install` parameter when `use` this extension. For example:
- // class Bar3DModel extends ComponentModel {}
- // export function install(registers) { registers.registerComponentModel(Bar3DModel); }
- // echarts.use(install);
- function Uf(t){var e=Su.extend(t);return Su.registerClass(e),e}function Zf(t){var e=Ou.extend(t);return Ou.registerClass(e),e}var Xf=2*Math.PI,jf=kt.CMD,qf=["top","right","bottom","left"];function Kf(t,e,n,i,o){var r=n.width,a=n.height;switch(t){case"top":i.set(n.x+r/2,n.y-e),o.set(0,-1);break;case"bottom":i.set(n.x+r/2,n.y+a+e),o.set(0,1);break;case"left":i.set(n.x-e,n.y+a/2),o.set(-1,0);break;case"right":i.set(n.x+r+e,n.y+a/2),o.set(1,0)}}function Jf(t,e,n,i,o,r,a,s,l){a-=t,s-=e;var u=Math.sqrt(a*a+s*s),c=(a/=u)*n+t,d=(s/=u)*n+e;if(Math.abs(i-o)%Xf<1e-4)
- // Is a circle
- return l[0]=c,l[1]=d,u-n;if(r){var h=i;i=Et(o),o=Et(h)}else i=Et(i),o=Et(o);i>o&&(o+=Xf);var p=Math.atan2(s,a);if(p<0&&(p+=Xf),p>=i&&p<=o||p+Xf>=i&&p+Xf<=o)
- // Project point is on the arc.
- return l[0]=c,l[1]=d,u-n;var f=n*Math.cos(i)+t,g=n*Math.sin(i)+e,y=n*Math.cos(o)+t,m=n*Math.sin(o)+e,v=(f-a)*(f-a)+(g-s)*(g-s),x=(y-a)*(y-a)+(m-s)*(m-s);return v<x?(l[0]=f,l[1]=g,Math.sqrt(v)):(l[0]=y,l[1]=m,Math.sqrt(x))}function $f(t,e,n,i,o,r,a,s){var l=o-t,u=r-e,c=n-t,d=i-e,h=Math.sqrt(c*c+d*d),p=(l*(c/=h)+u*(d/=h))/h;s&&(p=Math.min(Math.max(p,0),1)),p*=h;var f=a[0]=t+p*c,g=a[1]=e+p*d;return Math.sqrt((f-o)*(f-o)+(g-r)*(g-r))}function Qf(t,e,n,i,o,r,a){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i);var s=t+n,l=e+i,u=a[0]=Math.min(Math.max(o,t),s),c=a[1]=Math.min(Math.max(r,e),l);return Math.sqrt((u-o)*(u-o)+(c-r)*(c-r))}var tg=[];function eg(t,e,n){var i=Qf(e.x,e.y,e.width,e.height,t.x,t.y,tg);return n.set(tg[0],tg[1]),i}
- /**
- * Calculate min distance corresponding point.
- * This method won't evaluate if point is in the path.
- */function ng(t,e,n){for(var i,o,r=0,a=0,s=0,l=0,u=Infinity,c=e.data,d=t.x,h=t.y,p=0;p<c.length;){var f=c[p++];1===p&&(s=r=c[p],l=a=c[p+1]);var g=u;switch(f){case jf.M:r=
- // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点
- // 在 closePath 的时候使用
- s=c[p++],a=l=c[p++];break;case jf.L:g=$f(r,a,c[p],c[p+1],d,h,tg,!0),r=c[p++],a=c[p++];break;case jf.C:g=Rt(r,a,c[p++],c[p++],c[p++],c[p++],c[p],c[p+1],d,h,tg),r=c[p++],a=c[p++];break;case jf.Q:g=Ot(r,a,c[p++],c[p++],c[p],c[p+1],d,h,tg),r=c[p++],a=c[p++];break;case jf.A:
- // TODO Arc 判断的开销比较大
- var y=c[p++],m=c[p++],v=c[p++],x=c[p++],_=c[p++],b=c[p++];
- // TODO Arc 旋转
- p+=1;var S=!!(1-c[p++]);i=Math.cos(_)*v+y,o=Math.sin(_)*x+m,
- // 不是直接使用 arc 命令
- p<=1&&(
- // 第一个命令起点还未定义
- s=i,l=o),g=Jf(y,m,x,_,_+b,S,(d-y)*x/v+y,h,tg),r=Math.cos(_+b)*v+y,a=Math.sin(_+b)*x+m;break;case jf.R:g=Qf(s=r=c[p++],l=a=c[p++],c[p++],c[p++],d,h,tg);break;case jf.Z:g=$f(r,a,s,l,d,h,tg,!0),r=s,a=l}g<u&&(u=g,n.set(tg[0],tg[1]))}return u}
- // Temporal variable for intermediate usage.
- var ig=new K,og=new K,rg=new K,ag=new K,sg=new K;
- /**
- * Calculate a proper guide line based on the label position and graphic element definition
- * @param label
- * @param labelRect
- * @param target
- * @param targetRect
- */
- function lg(t,e){if(t){var n=t.getTextGuideLine(),i=t.getTextContent();
- // Needs to create text guide in each charts.
- if(i&&n){var o=t.textGuideLineConfig||{},r=[[0,0],[0,0],[0,0]],a=o.candidates||qf,s=i.getBoundingRect().clone();s.applyTransform(i.getComputedTransform());var l=Infinity,u=o.anchor,c=t.getComputedTransform(),d=c&&k([],c),h=e.get("length2")||0;u&&rg.copy(u);for(var p=0;p<a.length;p++){Kf(a[p],0,s,ig,ag),K.scaleAndAdd(og,ig,ag,h),
- // Transform to target coord space.
- og.transform(d);
- // Note: getBoundingRect will ensure the `path` being created.
- var f=t.getBoundingRect(),y=u?u.distance(og):t instanceof g?ng(og,t.path,rg):eg(og,f,rg);
- // TODO pt2 is in the path
- y<l&&(l=y,
- // Transform back to global space.
- og.transform(c),rg.transform(c),rg.toArray(r[0]),og.toArray(r[1]),ig.toArray(r[2]))}dg(r,e.get("minTurnAngle")),n.setShape({points:r})}}}
- // Temporal variable for the limitTurnAngle function
- var ug=[],cg=new K;
- /**
- * Reduce the line segment attached to the label to limit the turn angle between two segments.
- * @param linePoints
- * @param minTurnAngle Radian of minimum turn angle. 0 - 180
- */
- function dg(t,e){if(e<=180&&e>0){e=e/180*Math.PI,
- // The line points can be
- // /pt1----pt2 (label)
- // /
- // pt0/
- ig.fromArray(t[0]),og.fromArray(t[1]),rg.fromArray(t[2]),K.sub(ag,ig,og),K.sub(sg,rg,og);var n=ag.len(),i=sg.len();if(!(n<.001||i<.001)){ag.scale(1/n),sg.scale(1/i);var o=ag.dot(sg);if(Math.cos(e)<o){
- // Smaller than minTurnAngle
- // Calculate project point of pt0 on pt1-pt2
- var r=$f(og.x,og.y,rg.x,rg.y,ig.x,ig.y,ug,!1);cg.fromArray(ug),
- // Calculate new projected length with limited minTurnAngle and get the new connect point
- cg.scaleAndAdd(sg,r/Math.tan(Math.PI-e));
- // Limit the new calculated connect point between pt1 and pt2.
- var a=rg.x!==og.x?(cg.x-og.x)/(rg.x-og.x):(cg.y-og.y)/(rg.y-og.y);if(isNaN(a))return;a<0?K.copy(cg,og):a>1&&K.copy(cg,rg),cg.toArray(t[1])}}}}
- /**
- * Limit the angle of line and the surface
- * @param maxSurfaceAngle Radian of minimum turn angle. 0 - 180. 0 is same direction to normal. 180 is opposite
- */function hg(t,e,n){if(n<=180&&n>0){n=n/180*Math.PI,ig.fromArray(t[0]),og.fromArray(t[1]),rg.fromArray(t[2]),K.sub(ag,og,ig),K.sub(sg,rg,og);var i=ag.len(),o=sg.len();if(!(i<.001||o<.001))if(ag.scale(1/i),sg.scale(1/o),ag.dot(e)<Math.cos(n)){
- // Calculate project point of pt0 on pt1-pt2
- var r=$f(og.x,og.y,rg.x,rg.y,ig.x,ig.y,ug,!1);cg.fromArray(ug);var a=Math.PI/2,s=a+Math.acos(sg.dot(e))-n;if(s>=a)
- // parallel
- K.copy(cg,rg);else{
- // Calculate new projected length with limited minTurnAngle and get the new connect point
- cg.scaleAndAdd(sg,r/Math.tan(Math.PI/2-s));
- // Limit the new calculated connect point between pt1 and pt2.
- var l=rg.x!==og.x?(cg.x-og.x)/(rg.x-og.x):(cg.y-og.y)/(rg.y-og.y);if(isNaN(l))return;l<0?K.copy(cg,og):l>1&&K.copy(cg,rg)}cg.toArray(t[1])}}}function pg(t,e,n,i){var o="normal"===n,r=o?t:t.ensureState(n);
- // Make sure display.
- r.ignore=e;
- // Set smooth
- var a=i.get("smooth");a&&!0===a&&(a=.3),r.shape=r.shape||{},a>0&&(r.shape.smooth=a);var s=i.getModel("lineStyle").getLineStyle();o?t.useStyle(s):r.style=s}function fg(t,e){var n=e.smooth,i=e.points;if(i)if(t.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var o=Pt(i[0],i[1]),r=Pt(i[1],i[2]);if(!o||!r)return t.lineTo(i[1][0],i[1][1]),void t.lineTo(i[2][0],i[2][1]);var a=Math.min(o,r)*n,s=Nt([],i[1],i[0],a/o),l=Nt([],i[1],i[2],a/r),u=Nt([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var c=1;c<i.length;c++)t.lineTo(i[c][0],i[c][1])}
- /**
- * Create a label line if necessary and set it's style.
- */function gg(t,e,n){var i=t.getTextGuideLine(),o=t.getTextContent();if(o){for(var r=e.normal,a=r.get("show"),s=o.ignore,l=0;l<ui.length;l++){var u=ui[l],c=e[u],d="normal"===u;if(c){var h=c.get("show");if((d?s:x(o.states[u]&&o.states[u].ignore,s))||!x(h,a)){var p=d?i:i&&i.states[u];p&&(p.ignore=!0),i&&pg(i,!0,u,c);continue}
- // Create labelLine if not exists
- i||(i=new B,t.setTextGuideLine(i),
- // Reset state of normal because it's new created.
- // NOTE: NORMAL should always been the first!
- d||!s&&a||pg(i,!0,"normal",e.normal),
- // Use same state proxy.
- t.stateProxy&&(i.stateProxy=t.stateProxy)),pg(i,!1,u,c)}}if(i){I(i.style,n),
- // Not fill.
- i.style.fill=null;var f=r.get("showAbove");(t.textGuideLineConfig=t.textGuideLineConfig||{}).showAbove=f||!1,
- // Custom the buildPath.
- i.buildPath=fg}}else
- // Not show label line if there is no label.
- i&&t.removeTextGuideLine()}function yg(t,e){e=e||"labelLine";for(var n={normal:t.getModel(e)},i=0;i<li.length;i++){var o=li[i];n[o]=t.getModel([o,e])}return n}function mg(t){for(var e=[],n=0;n<t.length;n++){var i=t[n];if(!i.defaultAttr.ignore){var o=i.label,r=o.getComputedTransform(),a=o.getBoundingRect(),s=!r||r[1]<1e-5&&r[2]<1e-5,l=o.style.margin||0,u=a.clone();u.applyTransform(r),u.x-=l/2,u.y-=l/2,u.width+=l,u.height+=l;var c=s?new q(a,r):null;e.push({label:o,labelLine:i.labelLine,rect:u,localRect:a,obb:c,priority:i.priority,defaultAttr:i.defaultAttr,layoutOption:i.computedLayoutOption,axisAligned:s,transform:r})}}return e}function vg(t,e,n,i,o,r){var a=t.length;if(!(a<2)){t.sort((function(t,n){return t.rect[e]-n.rect[e]}));for(var s,l=0,u=!1,c=0,d=0;d<a;d++){var h=t[d],p=h.rect;(s=p[e]-l)<0&&(
- // shiftForward(i, len, -delta);
- p[e]-=s,h.label[e]-=s,u=!0),c+=Math.max(-s,0),l=p[e]+p[n]}c>0&&r&&
- // Shift back to make the distribution more equally.
- _(-c/a,0,a);
- // TODO bleedMargin?
- var f,g,y=t[0],m=t[a-1];return v(),
- // If ends exceed two bounds, squeeze at most 80%, then take the gap of two bounds.
- f<0&&b(-f,.8),g<0&&b(g,.8),v(),x(f,g,1),x(g,f,-1),
- // Handle bailout when there is not enough space.
- v(),f<0&&S(-f),g<0&&S(g),u}function v(){f=y.rect[e]-i,g=o-m.rect[e]-m.rect[n]}function x(t,e,n){if(t<0){
- // Move from other gap if can.
- var i=Math.min(e,-t);if(i>0){_(i*n,0,a);var o=i+t;o<0&&b(-o*n,1)}else b(-t*n,1)}}function _(n,i,o){0!==n&&(u=!0);for(var r=i;r<o;r++){var a=t[r];a.rect[e]+=n,a.label[e]+=n}}
- // Squeeze gaps if the labels exceed margin.
- function b(i,o){for(var r=[],s=0,l=1;l<a;l++){var u=t[l-1].rect,c=Math.max(t[l].rect[e]-u[e]-u[n],0);r.push(c),s+=c}if(s){var d=Math.min(Math.abs(i)/s,o);if(i>0)for(l=0;l<a-1;l++){
- // Forward
- _(r[l]*d,0,l+1)}else
- // Backward
- for(l=a-1;l>0;l--){_(-(r[l-1]*d),l,a)}}}
- /**
- * Squeeze to allow overlap if there is no more space available.
- * Let other overlapping strategy like hideOverlap do the job instead of keep exceeding the bounds.
- */function S(t){var e=t<0?-1:1;t=Math.abs(t);for(var n=Math.ceil(t/(a-1)),i=0;i<a-1;i++)if(e>0?
- // Forward
- _(n,0,i+1):
- // Backward
- _(-n,a-i-1,a),(t-=n)<=0)return}}
- /**
- * Adjust labels on x direction to avoid overlap.
- */
- /**
- * Adjust labels on y direction to avoid overlap.
- */
- function xg(t,e,n,
- // If average the shifts on all labels and add them to 0
- i){return vg(t,"y","height",e,n,i)}function _g(t){var e=[];
- // TODO, render overflow visible first, put in the displayedLabels.
- t.sort((function(t,e){return e.priority-t.priority}));var n=new Y(0,0,0,0);function i(t){if(!t.ignore){
- // Show on emphasis.
- var e=t.ensureState("emphasis");null==e.ignore&&(e.ignore=!1)}t.ignore=!0}for(var o=0;o<t.length;o++){var r=t[o],a=r.axisAligned,s=r.localRect,l=r.transform,u=r.label,c=r.labelLine;n.copy(r.rect),
- // Add a threshold because layout may be aligned precisely.
- n.width-=.1,n.height-=.1,n.x+=.05,n.y+=.05;for(var d=r.obb,h=!1,p=0;p<e.length;p++){var f=e[p];
- // Fast rejection.
- if(n.intersect(f.rect)){if(a&&f.axisAligned){
- // Is overlapped
- h=!0;break}if(f.obb||(
- // If self is not axis aligned. But other is.
- f.obb=new q(f.localRect,f.transform)),d||(
- // If self is axis aligned. But other is not.
- d=new q(s,l)),d.intersect(f.obb)){h=!0;break}}}
- // TODO Callback to determine if this overlap should be handled?
- h?(i(u),c&&i(c)):(u.attr("ignore",r.defaultAttr.ignore),c&&c.attr("ignore",r.defaultAttr.labelGuideIgnore),e.push(r))}}function bg(t){if(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n].slice());return e}}function Sg(t,e){var n=t.label,i=e&&e.getTextGuideLine();return{dataIndex:t.dataIndex,dataType:t.dataType,seriesIndex:t.seriesModel.seriesIndex,text:t.label.style.text,rect:t.hostRect,labelRect:t.rect,
- // x: labelAttr.x,
- // y: labelAttr.y,
- align:n.style.align,verticalAlign:n.style.verticalAlign,labelLinePoints:bg(i&&i.shape.points)}}var wg=["align","verticalAlign","width","height","fontSize"],Mg=new L,Ig=On(),Dg=On();function Tg(t,e,n){for(var i=0;i<n.length;i++){var o=n[i];null!=e[o]&&(t[o]=e[o])}}var Cg=["x","y","rotation"],Ag=/** @class */function(){function t(){this._labelList=[],this._chartViewList=[]}return t.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},
- /**
- * Add label to manager
- */
- t.prototype._addLabel=function(t,e,n,i,o){var r=i.style,a=i.__hostTarget.textConfig||{},s=i.getComputedTransform(),l=i.getBoundingRect().plain();Y.applyTransform(l,l,s),s?Mg.setLocalTransform(s):(
- // Identity transform.
- Mg.x=Mg.y=Mg.rotation=Mg.originX=Mg.originY=0,Mg.scaleX=Mg.scaleY=1),Mg.rotation=Et(Mg.rotation);var u,c=i.__hostTarget;if(c){u=c.getBoundingRect().plain();var d=c.getComputedTransform();Y.applyTransform(u,u,d)}var h=u&&c.getTextGuideLine();this._labelList.push({label:i,labelLine:h,seriesModel:n,dataIndex:t,dataType:e,layoutOption:o,computedLayoutOption:null,rect:l,hostRect:u,
- // Label with lower priority will be hidden when overlapped
- // Use rect size as default priority
- priority:u?u.width*u.height:0,
- // Save default label attributes.
- // For restore if developers want get back to default value in callback.
- defaultAttr:{ignore:i.ignore,labelGuideIgnore:h&&h.ignore,x:Mg.x,y:Mg.y,scaleX:Mg.scaleX,scaleY:Mg.scaleY,rotation:Mg.rotation,style:{x:r.x,y:r.y,align:r.align,verticalAlign:r.verticalAlign,width:r.width,height:r.height,fontSize:r.fontSize},cursor:i.cursor,attachedPos:a.position,attachedRot:a.rotation}})},t.prototype.addLabelsOfSeries=function(t){var e=this;this._chartViewList.push(t);var n=t.__model,i=n.get("labelLayout");
- /**
- * Ignore layouting if it's not specified anything.
- */
- (f(i)||v(i).length)&&t.group.traverse((function(t){if(t.ignore)return!0;// Stop traverse descendants.
- // Only support label being hosted on graphic elements.
- var o=t.getTextContent(),r=ni(t);
- // Can only attach the text on the element with dataIndex
- o&&!o.disableLabelLayout&&e._addLabel(r.dataIndex,r.dataType,n,o,i)}))},t.prototype.updateLayoutConfig=function(t){var e=t.getWidth(),n=t.getHeight();function i(t,e){return function(){lg(t,e)}}for(var o=0;o<this._labelList.length;o++){var r=this._labelList[o],a=r.label,s=a.__hostTarget,l=r.defaultAttr,u=void 0;u=(
- // TODO A global layout option?
- u=f(r.layoutOption)?r.layoutOption(Sg(r,s)):r.layoutOption)||{},r.computedLayoutOption=u;var c=Math.PI/180;
- // TODO hostEl should always exists.
- // Or label should not have parent because the x, y is all in global space.
- s&&s.setTextConfig({
- // Force to set local false.
- local:!1,
- // Ignore position and rotation config on the host el if x or y is changed.
- position:null!=u.x||null!=u.y?null:l.attachedPos,
- // Ignore rotation config on the host el if rotation is changed.
- rotation:null!=u.rotate?u.rotate*c:l.attachedRot,offset:[u.dx||0,u.dy||0]});var d=!1;if(null!=u.x?(
- // TODO width of chart view.
- a.x=je(u.x,e),a.setStyle("x",0),// Ignore movement in style. TODO: origin.
- d=!0):(a.x=l.x,a.setStyle("x",l.style.x)),null!=u.y?(
- // TODO height of chart view.
- a.y=je(u.y,n),a.setStyle("y",0),// Ignore movement in style.
- d=!0):(a.y=l.y,a.setStyle("y",l.style.y)),u.labelLinePoints){var h=s.getTextGuideLine();h&&(h.setShape({points:u.labelLinePoints}),
- // Not update
- d=!1)}Ig(a).needsUpdateLabelLine=d,a.rotation=null!=u.rotate?u.rotate*c:l.rotation,a.scaleX=l.scaleX,a.scaleY=l.scaleY;for(var p=0;p<wg.length;p++){var g=wg[p];a.setStyle(g,null!=u[g]?u[g]:l.style[g])}if(u.draggable){if(a.draggable=!0,a.cursor="move",s){var y=r.seriesModel;if(null!=r.dataIndex)y=r.seriesModel.getData(r.dataType).getItemModel(r.dataIndex);a.on("drag",i(s,y.getModel("labelLine")))}}else
- // TODO Other drag functions?
- a.off("drag"),a.cursor=l.cursor}},t.prototype.layout=function(t){var
- // If average the shifts on all labels and add them to 0
- // TODO: Not sure if should enable it.
- // Pros: The angle of lines will distribute more equally
- // Cons: In some layout. It may not what user wanted. like in pie. the label of last sector is usually changed unexpectedly.
- e,n=t.getWidth(),i=t.getHeight(),o=mg(this._labelList),r=st(o,(function(t){return"shiftX"===t.layoutOption.moveOverlap})),a=st(o,(function(t){return"shiftY"===t.layoutOption.moveOverlap}));vg(r,"x","width",0,n,e),xg(a,0,i),_g(st(o,(function(t){return t.layoutOption.hideOverlap})))},
- /**
- * Process all labels. Not only labels with layoutOption.
- */
- t.prototype.processLabelsOverall=function(){var t=this;a(this._chartViewList,(function(e){var n=e.__model,i=e.ignoreLabelLineUpdate,o=n.isAnimationEnabled();e.group.traverse((function(e){if(e.ignore&&!e.forceLabelAnimation)return!0;// Stop traverse descendants.
- var r=!i,a=e.getTextContent();!r&&a&&(r=Ig(a).needsUpdateLabelLine),r&&t._updateLabelLine(e,n),o&&t._animateLabels(e,n)}))}))},t.prototype._updateLabelLine=function(t,e){
- // Only support label being hosted on graphic elements.
- var n=t.getTextContent(),i=ni(t),o=i.dataIndex;
- // Update label line style.
- // Only support labelLine on the labels represent data.
- if(n&&null!=o){var r=e.getData(i.dataType),a=r.getItemModel(o),s={},l=r.getItemVisual(o,"style");if(l){var u=r.getVisual("drawType");
- // Default to be same with main color
- s.stroke=l[u]}var c=a.getModel("labelLine");gg(t,yg(a),s),lg(t,c)}},t.prototype._animateLabels=function(t,e){var n=t.getTextContent(),i=t.getTextGuideLine();
- // Animate
- if(n&&(t.forceLabelAnimation||!n.ignore&&!n.invisible&&!t.disableLabelAnimation&&!ro(t))){var o=(f=Ig(n)).oldLayout,r=ni(t),a=r.dataIndex,s={x:n.x,y:n.y,rotation:n.rotation},l=e.getData(r.dataType);if(o){n.attr(o);
- // Make sure the animation from is in the right status.
- var u=t.prevStates;u&&(c(u,"select")>=0&&n.attr(f.oldLayoutSelect),c(u,"emphasis")>=0&&n.attr(f.oldLayoutEmphasis)),io(n,s,e,a)}else
- // Disable fade in animation if value animation is enabled.
- if(n.attr(s),!Qo(n).valueAnimation){var d=x(n.style.opacity,1);
- // Fade in animation
- n.style.opacity=0,oo(n,{style:{opacity:d}},e,a)}if(f.oldLayout=s,n.states.select){var h=f.oldLayoutSelect={};Tg(h,s,Cg),Tg(h,n.states.select,Cg)}if(n.states.emphasis){var p=f.oldLayoutEmphasis={};Tg(p,s,Cg),Tg(p,n.states.emphasis,Cg)}er(n,a,l,e,e)}if(i&&!i.ignore&&!i.invisible){o=(f=Dg(i)).oldLayout;var f,g={points:i.shape.points};o?(i.attr({shape:o}),io(i,{shape:g},e)):(i.setShape(g),i.style.strokePercent=0,oo(i,{style:{strokePercent:1}},e)),f.oldLayout=g}},t}();const Lg=Ag;var kg=On();function Pg(t){t.registerUpdateLifecycle("series:beforeupdate",(function(t,e,n){
- // TODO api provide an namespace that can save stuff per instance
- var i=kg(e).labelManager;i||(i=kg(e).labelManager=new Lg),i.clearLabels()})),t.registerUpdateLifecycle("series:layoutlabels",(function(t,e,n){var i=kg(e).labelManager;n.updatedSeries.forEach((function(t){i.addLabelsOfSeries(e.getViewOfSeriesModel(t))})),i.updateLayoutConfig(e),i.layout(e),i.processLabelsOverall()}))}function Ng(t){t.registerPainter("canvas",zt)}const Og=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return Ue(e,t),e.prototype.getInitialData=function(t){return Jh(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(t){var e=new Z,n=Gc("line",0,t.itemHeight/2,t.itemWidth,0,t.lineStyle.stroke,!1);e.add(n),n.setStyle(t.lineStyle);var i=this.getData().getVisual("symbol"),o=this.getData().getVisual("symbolRotate"),r="none"===i?"circle":i,a=.8*t.itemHeight,s=Gc(r,(t.itemWidth-a)/2,(t.itemHeight-a)/2,a,a,t.itemStyle.fill);e.add(s),s.setStyle(t.itemStyle);var l="inherit"===t.iconRotate?o:t.iconRotate||0;return s.rotation=l*Math.PI/180,s.setOrigin([t.itemWidth/2,t.itemHeight/2]),r.indexOf("empty")>-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),e},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={
- // zlevel: 0,
- z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},
- // itemStyle: {
- // },
- endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},
- // areaStyle: {
- // origin of areaStyle. Valid values:
- // `'auto'/null/undefined`: from axisLine to data
- // `'start'`: from min to data
- // `'end'`: from data to max
- // origin: 'auto'
- // },
- // false, 'start', 'end', 'middle'
- step:!1,
- // Disabled if step is true
- smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,
- // `false`: follow the label interval strategy.
- // `true`: show all symbols.
- // `'auto'`: If possible, show all symbols, otherwise
- // follow the label interval strategy.
- showAllSymbol:"auto",
- // Whether to connect break point.
- connectNulls:!1,
- // Sampling for large data. Can be: 'average', 'max', 'min', 'sum', 'lttb'.
- sampling:"none",animationEasing:"linear",
- // Disable progressive
- progressive:0,hoverLayerThreshold:Infinity,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(Su);
- /**
- * @return label string. Not null/undefined
- */function Rg(t,e){var n=t.mapDimensionsAll("defaultedLabel"),i=n.length;
- // Simple optimization (in lots of cases, label dims length is 1)
- if(1===i){var o=cl(t,e,n[0]);return null!=o?o+"":null}if(i){for(var r=[],a=0;a<n.length;a++)r.push(cl(t,e,n[a]));return r.join(" ")}}function Eg(t,e){var n=t.mapDimensionsAll("defaultedLabel");if(!i(e))return e+"";for(var o=[],r=0;r<n.length;r++){var a=t.getDimensionIndex(n[r]);a>=0&&o.push(e[a])}return o.join(" ")}var Vg=/** @class */function(t){function e(e,n,i,o){var r=t.call(this)||this;return r.updateData(e,n,i,o),r}return Ue(e,t),e.prototype._createSymbol=function(t,e,n,i,o){
- // Remove paths created before
- this.removeAll();
- // let symbolPath = createSymbol(
- // symbolType, -0.5, -0.5, 1, 1, color
- // );
- // If width/height are set too small (e.g., set to 1) on ios10
- // and macOS Sierra, a circle stroke become a rect, no matter what
- // the scale is set. So we set width/height as 2. See #4150.
- var r=Gc(t,-1,-1,2,2,null,o);r.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),
- // Rewrite drift method
- r.drift=zg,this._symbolType=t,this.add(r)},
- /**
- * Stop animation
- * @param {boolean} toLastFrame
- */
- e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},
- /**
- * FIXME:
- * Caution: This method breaks the encapsulation of this module,
- * but it indeed brings convenience. So do not use the method
- * unless you detailedly know all the implements of `Symbol`,
- * especially animation.
- *
- * Get symbol path element.
- */
- e.prototype.getSymbolPath=function(){return this.childAt(0)},
- /**
- * Highlight symbol
- */
- e.prototype.highlight=function(){ki(this.childAt(0))},
- /**
- * Downplay symbol
- */
- e.prototype.downplay=function(){Pi(this.childAt(0))},
- /**
- * @param {number} zlevel
- * @param {number} z
- */
- e.prototype.setZ=function(t,e){var n=this.childAt(0);n.zlevel=t,n.z=e},e.prototype.setDraggable=function(t,e){var n=this.childAt(0);n.draggable=t,n.cursor=!e&&t?"move":n.cursor},
- /**
- * Update symbol properties
- */
- e.prototype.updateData=function(t,n,i,o){this.silent=!1;var r=t.getItemVisual(n,"symbol")||"circle",a=t.hostModel,s=e.getSymbolSize(t,n),l=r!==this._symbolType,u=o&&o.disableAnimation;if(l){var c=t.getItemVisual(n,"symbolKeepAspect");this._createSymbol(r,t,n,s,c)}else{(h=this.childAt(0)).silent=!1;var d={scaleX:s[0]/2,scaleY:s[1]/2};u?h.attr(d):io(h,d,a,n),uo(h)}if(this._updateCommon(t,n,s,i,o),l){var h=this.childAt(0);if(!u){d={scaleX:this._sizeX,scaleY:this._sizeY,style:{
- // Always fadeIn. Because it has fadeOut animation when symbol is removed..
- opacity:h.style.opacity}};h.scaleX=h.scaleY=0,h.style.opacity=0,oo(h,d,a,n)}}u&&
- // Must stop leave transition manually if don't call initProps or updateProps.
- this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,e,n,i,o){var r,a,s,l,u,c,d,h,f,g=this.childAt(0),y=t.hostModel;if(i&&(r=i.emphasisItemStyle,a=i.blurItemStyle,s=i.selectItemStyle,l=i.focus,u=i.blurScope,d=i.labelStatesModels,h=i.hoverScale,f=i.cursorStyle,c=i.emphasisDisabled),!i||t.hasItemOption){var m=i&&i.itemModel?i.itemModel:t.getItemModel(e),v=m.getModel("emphasis");r=v.getModel("itemStyle").getItemStyle(),s=m.getModel(["select","itemStyle"]).getItemStyle(),a=m.getModel(["blur","itemStyle"]).getItemStyle(),l=v.get("focus"),u=v.get("blurScope"),c=v.get("disabled"),d=Uo(m),h=v.getShallow("scale"),f=m.getShallow("cursor")}var x=t.getItemVisual(e,"symbolRotate");g.attr("rotation",(x||0)*Math.PI/180||0);var _=Wc(t.getItemVisual(e,"symbolOffset"),n);_&&(g.x=_[0],g.y=_[1]),f&&g.attr("cursor",f);var S=t.getItemVisual(e,"style"),w=S.fill;if(g instanceof b){var M=g.style;g.useStyle(p({
- // TODO other properties like x, y ?
- image:M.image,x:M.x,y:M.y,width:M.width,height:M.height},S))}else g.__isEmptyBrush?
- // fill and stroke will be swapped if it's empty.
- // So we cloned a new style to avoid it affecting the original style in visual storage.
- // TODO Better implementation. No empty logic!
- g.useStyle(p({},S)):g.useStyle(S),
- // Disable decal because symbol scale will been applied on the decal.
- g.style.decal=null,g.setColor(w,o&&o.symbolInnerColor),g.style.strokeNoScale=!0;var I=t.getItemVisual(e,"liftZ"),D=this._z2;null!=I?null==D&&(this._z2=g.z2,g.z2+=I):null!=D&&(g.z2=D,this._z2=null);var T=o&&o.useNameLabel;Yo(g,d,{labelFetcher:y,labelDataIndex:e,defaultText:
- // Do not execute util needed.
- function(e){return T?t.getName(e):Rg(t,e)},inheritColor:w,defaultOpacity:S.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var C=g.ensureState("emphasis");C.style=r,g.ensureState("select").style=s,g.ensureState("blur").style=a;
- // null / undefined / true means to use default strategy.
- // 0 / false / negative number / NaN / Infinity means no scale.
- var A=null==h||!0===h?Math.max(1.1,3/this._sizeY):isFinite(h)&&h>0?+h:1;
- // always set scale to allow resetting
- C.scaleX=this._sizeX*A,C.scaleY=this._sizeY*A,this.setSymbolScale(1),Ui(this,l,u,c)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,e,n){var i=this.childAt(0),o=ni(this).dataIndex,r=n&&n.animation;
- // Not show text when animating
- if(
- // Avoid mistaken hover when fading out
- this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&ao(a,{style:{opacity:0}},e,{dataIndex:o,removeOpt:r,cb:function(){i.removeTextContent()}})}else i.removeTextContent();ao(i,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:o,cb:t,removeOpt:r})},e.getSymbolSize=function(t,e){return Fc(t.getItemVisual(e,"symbolSize"))},e}(Z);function zg(t,e){this.parent.drift(t,e)}const Bg=Vg;function Gg(t,e,n,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i.isIgnore&&i.isIgnore(n))&&!(i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&"none"!==t.getItemVisual(n,"symbol")}function Fg(t){return null==t||o(t)||(t={isIgnore:t}),t||{}}function Wg(t){var e=t.hostModel,n=e.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:Uo(e),cursorStyle:e.get("cursor")}}var Hg=/** @class */function(){function t(t){this.group=new Z,this._SymbolCtor=t||Bg}
- /**
- * Update symbols draw by new data
- */return t.prototype.updateData=function(t,e){
- // Remove progressive els.
- this._progressiveEls=null,e=Fg(e);var n=this.group,i=t.hostModel,o=this._data,r=this._SymbolCtor,a=e.disableAnimation,s=Wg(t),l={disableAnimation:a},u=e.getSymbolPoint||function(e){return t.getItemLayout(e)};
- // There is no oldLineData only when first rendering or switching from
- // stream mode to normal mode, where previous elements should be removed.
- o||n.removeAll(),t.diff(o).add((function(i){var o=u(i);if(Gg(t,o,i,e)){var a=new r(t,i,s,l);a.setPosition(o),t.setItemGraphicEl(i,a),n.add(a)}})).update((function(c,d){var h=o.getItemGraphicEl(d),p=u(c);if(Gg(t,p,c,e)){var f=t.getItemVisual(c,"symbol")||"circle",g=h&&h.getSymbolType&&h.getSymbolType();if(!h||g&&g!==f)n.remove(h),(h=new r(t,c,s,l)).setPosition(p);else{h.updateData(t,c,s,l);var y={x:p[0],y:p[1]};a?h.attr(y):io(h,y,i)}
- // Add back
- n.add(h),t.setItemGraphicEl(c,h)}else n.remove(h)})).remove((function(t){var e=o.getItemGraphicEl(t);e&&e.fadeOut((function(){n.remove(e)}),i)})).execute(),this._getSymbolPoint=u,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&
- // Not use animation
- e.eachItemGraphicEl((function(e,n){var i=t._getSymbolPoint(n);e.setPosition(i),e.markRedraw()}))},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=Wg(t),this._data=null,this.group.removeAll()},
- /**
- * Update symbols draw by new data
- */
- t.prototype.incrementalUpdate=function(t,e,n){function i(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}
- // Clear
- this._progressiveEls=[],n=Fg(n);for(var o=t.start;o<t.end;o++){var r=e.getItemLayout(o);if(Gg(e,r,o,n)){var a=new this._SymbolCtor(e,o,this._seriesScope);a.traverse(i),a.setPosition(r),this.group.add(a),e.setItemGraphicEl(o,a),this._progressiveEls.push(a)}}},t.prototype.eachRendered=function(t){Bo(this._progressiveEls||this.group,t)},t.prototype.remove=function(t){var e=this.group,n=this._data;
- // Incremental model do not have this._data.
- n&&t?n.eachItemGraphicEl((function(t){t.fadeOut((function(){e.remove(t)}),n.hostModel)})):e.removeAll()},t}();const Yg=Hg;function Ug(t,e,i){var o=t.getBaseAxis(),r=t.getOtherAxis(o),a=function(t,e){var n=0,i=t.scale.getExtent();"start"===e?n=i[0]:"end"===e?n=i[1]:l(e)&&!isNaN(e)?n=e:
- // Both positive
- i[0]>0?n=i[0]:i[1]<0&&(n=i[1]);return n}(r,i),s=o.dim,u=r.dim,c=e.mapDimension(u),d=e.mapDimension(s),h="x"===u||"radius"===u?1:0,p=n(t.dimensions,(function(t){return e.mapDimension(t)})),f=!1,g=e.getCalculationInfo("stackResultDimension");return qh(e,p[0]/* , dims[1] */)&&(
- // jshint ignore:line
- f=!0,p[0]=g),qh(e,p[1]/* , dims[0] */)&&(
- // jshint ignore:line
- f=!0,p[1]=g),{dataDimsForPoint:p,valueStart:a,valueAxisDim:u,baseAxisDim:s,stacked:!!f,valueDim:c,baseDim:d,baseDataOffset:h,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function Zg(t,e,n,i){var o=NaN;t.stacked&&(o=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(o)&&(o=t.valueStart);var r=t.baseDataOffset,a=[];return a[r]=n.get(t.baseDim,i),a[1-r]=o,e.dataToPoint(a)}var Xg=Math.min,jg=Math.max;function qg(t,e){return isNaN(t)||isNaN(e)}
- /**
- * Draw smoothed line in non-monotone, in may cause undesired curve in extreme
- * situations. This should be used when points are non-monotone neither in x or
- * y dimension.
- */function Kg(t,e,n,i,o,r,a,s,l){for(var u,c,d,h,p,f,g=n,y=0;y<i;y++){var m=e[2*g],v=e[2*g+1];if(g>=o||g<0)break;if(qg(m,v)){if(l){g+=r;continue}break}if(g===n)t[r>0?"moveTo":"lineTo"](m,v),d=m,h=v;else{var x=m-u,_=v-c;
- // Ignore tiny segment.
- if(x*x+_*_<.5){g+=r;continue}if(a>0){
- // Ignore duplicate point
- for(var b=g+r,S=e[2*b],w=e[2*b+1];S===m&&w===v&&y<i;)y++,g+=r,S=e[2*(b+=r)],w=e[2*b+1],x=(m=e[2*g])-u,_=(v=e[2*g+1])-c;var M=y+1;if(l)
- // Find next point not null
- for(;qg(S,w)&&M<i;)M++,S=e[2*(b+=r)],w=e[2*b+1];var I=.5,D=0,T=0,C=void 0,A=void 0;
- // Is last point
- if(M>=i||qg(S,w))p=m,f=v;else{D=S-u,T=w-c;var L=m-u,k=S-m,P=v-c,N=w-v,O=void 0,R=void 0;if("x"===s){var E=D>0?1:-1;p=m-E*(O=Math.abs(L))*a,f=v,C=m+E*(R=Math.abs(k))*a,A=v}else if("y"===s){var V=T>0?1:-1;p=m,f=v-V*(O=Math.abs(P))*a,C=m,A=v+V*(R=Math.abs(N))*a}else O=Math.sqrt(L*L+P*P),p=m-D*a*(1-(
- // Use ratio of seg length
- I=(R=Math.sqrt(k*k+N*N))/(R+O))),f=v-T*a*(1-I),A=v+T*a*I,
- // Smooth constraint between point and next point.
- // Avoid exceeding extreme after smoothing.
- C=Xg(
- // cp0 of next segment
- C=m+D*a*I,jg(S,m)),A=Xg(A,jg(w,v)),C=jg(C,Xg(S,m)),f=v-(T=(A=jg(A,Xg(w,v)))-v)*O/R,
- // Smooth constraint between point and prev point.
- // Avoid exceeding extreme after smoothing.
- p=Xg(p=m-(
- // Reclaculate cp1 based on the adjusted cp0 of next seg.
- D=C-m)*O/R,jg(u,m)),f=Xg(f,jg(c,v)),C=m+(
- // Adjust next cp0 again.
- D=m-(p=jg(p,Xg(u,m))))*R/O,A=v+(T=v-(f=jg(f,Xg(c,v))))*R/O}t.bezierCurveTo(d,h,p,f,m,v),d=C,h=A}else t.lineTo(m,v)}u=m,c=v,g+=r}return y}var Jg=function(){this.smooth=0,this.smoothConstraint=!0},$g=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polyline",n}return Ue(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Jg},e.prototype.buildPath=function(t,e){var n=e.points,i=0,o=n.length/2;
- // const result = getBoundingBox(points, shape.smoothConstraint);
- if(e.connectNulls){
- // Must remove first and last null values avoid draw error in polygon
- for(;o>0&&qg(n[2*o-2],n[2*o-1]);o--);for(;i<o&&qg(n[2*i],n[2*i+1]);i++);}for(;i<o;)i+=Kg(t,n,i,o,o,1,e.smooth,e.smoothMonotone,e.connectNulls)+1},e.prototype.getPointOn=function(t,e){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n,i,o=this.path.data,r=kt.CMD,a="x"===e,s=[],l=0;l<o.length;){var u=void 0,c=void 0,d=void 0,h=void 0,p=void 0,f=void 0,g=void 0;switch(o[l++]){case r.M:n=o[l++],i=o[l++];break;case r.L:if(u=o[l++],c=o[l++],(g=a?(t-n)/(u-n):(t-i)/(c-i))<=1&&g>=0){var y=a?(c-i)*g+i:(u-n)*g+n;return a?[t,y]:[y,t]}n=u,i=c;break;case r.C:u=o[l++],c=o[l++],d=o[l++],h=o[l++],p=o[l++],f=o[l++];var m=a?Bt(n,u,d,p,t,s):Bt(i,c,h,f,t,s);if(m>0)for(var v=0;v<m;v++){var x=s[v];if(x<=1&&x>=0){y=a?Gt(i,c,h,f,x):Gt(n,u,d,p,x);return a?[t,y]:[y,t]}}n=p,i=f}}},e}(g),Qg=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e}(Jg),ty=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polygon",n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new Qg},e.prototype.buildPath=function(t,e){var n=e.points,i=e.stackedOnPoints,o=0,r=n.length/2,a=e.smoothMonotone;if(e.connectNulls){
- // Must remove first and last null values avoid draw error in polygon
- for(;r>0&&qg(n[2*r-2],n[2*r-1]);r--);for(;o<r&&qg(n[2*o],n[2*o+1]);o++);}for(;o<r;){var s=Kg(t,n,o,r,r,1,e.smooth,a,e.connectNulls);Kg(t,i,o+s-1,s,r,-1,e.stackedOnSmooth,a,e.connectNulls),o+=s+1,t.closePath()}},e}(g);function ey(t,e,n,i,o){var r=t.getArea(),a=r.x,s=r.y,l=r.width,u=r.height,c=n.get(["lineStyle","width"])||0;
- // Expand the clip path a bit to avoid the border is clipped and looks thinner
- a-=c/2,s-=c/2,l+=c,u+=c,
- // fix: https://github.com/apache/incubator-echarts/issues/11369
- l=Math.ceil(l),a!==Math.floor(a)&&(a=Math.floor(a),
- // if no extra 1px on `width`, it will still be clipped since `x` is floored
- l++);var d=new G({shape:{x:a,y:s,width:l,height:u}});if(e){var h=t.getBaseAxis(),p=h.isHorizontal(),g=h.inverse;p?(g&&(d.shape.x+=l),d.shape.width=0):(g||(d.shape.y+=u),d.shape.height=0);var y=f(o)?function(t){o(t,d)}:null;oo(d,{shape:{width:l,height:u,x:a,y:s}},n,null,i,y)}return d}function ny(t,e,n){var i=t.getArea(),o=qe(i.r0,1),r=qe(i.r,1),a=new E({shape:{cx:qe(t.cx,1),cy:qe(t.cy,1),r0:o,r:r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}});
- // Avoid float number rounding error for symbol on the edge of axis extent.
- e&&("angle"===t.getBaseAxis().dim?a.shape.endAngle=i.startAngle:a.shape.r=o,oo(a,{shape:{endAngle:i.endAngle,r:r}},n));return a}function iy(t,e,n,i,o){return t?"polar"===t.type?ny(t,e,n):"cartesian2d"===t.type?ey(t,e,n,i,o):null:null}
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */function oy(t,e){return t.type===e}function ry(t,e){if(t.length===e.length){for(var n=0;n<t.length;n++)if(t[n]!==e[n])return;return!0}}function ay(t){for(var e=Infinity,n=Infinity,i=-Infinity,o=-Infinity,r=0;r<t.length;){var a=t[r++],s=t[r++];isNaN(a)||(e=Math.min(a,e),i=Math.max(a,i)),isNaN(s)||(n=Math.min(s,n),o=Math.max(s,o))}return[[e,n],[i,o]]}function sy(t,e){var n=ay(t),i=n[0],o=n[1],r=ay(e),a=r[0],s=r[1];
- // Get a max value from each corner of two boundings.
- return Math.max(Math.abs(i[0]-a[0]),Math.abs(i[1]-a[1]),Math.abs(o[0]-s[0]),Math.abs(o[1]-s[1]))}function ly(t){return l(t)?t:t?.5:0}
- /**
- * Filter the null data and extend data for step considering `stepTurnAt`
- *
- * @param points data to convert, that may containing null
- * @param basePoints base data to reference, used only for areaStyle points
- * @param coordSys coordinate system
- * @param stepTurnAt 'start' | 'end' | 'middle' | true
- * @param connectNulls whether to connect nulls
- * @returns converted point positions
- */
- function uy(t,e,n,i,o){var r=n.getBaseAxis(),a="x"===r.dim||"radius"===r.dim?0:1,s=[],l=0,u=[],c=[],d=[],h=[];if(o){for(l=0;l<t.length;l+=2){
- /**
- * For areaStyle of stepped lines, `stackedOnPoints` should be
- * filtered the same as `points` so that the base axis values
- * should stay the same as the lines above. See #20021
- */
- var p=e||t;isNaN(p[l])||isNaN(p[l+1])||h.push(t[l],t[l+1])}t=h}for(l=0;l<t.length-2;l+=2)switch(d[0]=t[l+2],d[1]=t[l+3],c[0]=t[l],c[1]=t[l+1],s.push(c[0],c[1]),i){case"end":u[a]=d[a],u[1-a]=c[1-a],s.push(u[0],u[1]);break;case"middle":var f=(c[a]+d[a])/2,g=[];u[a]=g[a]=f,u[1-a]=c[1-a],g[1-a]=d[1-a],s.push(u[0],u[1]),s.push(g[0],g[1]);break;default:
- // default is start
- u[a]=c[a],u[1-a]=d[1-a],s.push(u[0],u[1])}
- // Last points
- return s.push(t[l++],t[l++]),s}
- /**
- * Clip color stops to edge. Avoid creating too large gradients.
- * Which may lead to blurry when GPU acceleration is enabled. See #15680
- *
- * The stops has been sorted from small to large.
- */function cy(t,e,i){var o=t.getVisual("visualMeta");if(o&&o.length&&t.count()&&"cartesian2d"===e.type){for(var r,s,l=o.length-1;l>=0;l--){var u=t.getDimensionInfo(o[l].dimension);
- // Can only be x or y
- if("x"===(r=u&&u.coordDim)||"y"===r){s=o[l];break}}if(s){
- // If the area to be rendered is bigger than area defined by LinearGradient,
- // the canvas spec prescribes that the color of the first stop and the last
- // stop should be used. But if two stops are added at offset 0, in effect
- // browsers use the color of the second stop to render area outside
- // LinearGradient. So we can only infinitesimally extend area defined in
- // LinearGradient to render `outerColors`.
- var c=e.getAxis(r),d=n(s.stops,(function(t){
- // offset will be calculated later.
- return{coord:c.toGlobalCoord(c.dataToCoord(t.value)),color:t.color}})),h=d.length,p=s.outerColors.slice();
- // dataToCoord mapping may not be linear, but must be monotonic.
- h&&d[0].coord>d[h-1].coord&&(d.reverse(),p.reverse());var f=function(t,e){var n,i,o=[],r=t.length;function a(t,e,n){var i=t.coord,o=(n-i)/(e.coord-i);return{coord:n,color:Ft(o,[t.color,e.color])}}for(var s=0;s<r;s++){var l=t[s],u=l.coord;if(u<0)n=l;else{if(u>e){i?o.push(a(i,l,e)):n&&
- // If there are two stops and coord range is between these two stops
- o.push(a(n,l,0),a(n,l,e));
- // All following stop will be out of range. So just ignore them.
- break}n&&(o.push(a(n,l,0)),
- // Reset
- n=null),o.push(l),i=l}}return o}(d,"x"===r?i.getWidth():i.getHeight()),g=f.length;if(!g&&h)
- // All stops are out of range. All will be the same color.
- return d[0].coord<0?p[1]?p[1]:d[h-1].color:p[0]?p[0]:d[0].color;var y=f[0].coord-10,m=f[g-1].coord+10,v=m-y;// Arbitrary value: 10px
- if(v<.001)return"transparent";a(f,(function(t){t.offset=(t.coord-y)/v})),f.push({
- // NOTE: inRangeStopLen may still be 0 if stoplen is zero.
- offset:g?f[g-1].offset:.5,color:p[1]||"transparent"}),f.unshift({offset:g?f[0].offset:.5,color:p[0]||"transparent"});var x=new j(0,0,0,0,f,!0);return x[r]=y,x[r+"2"]=m,x}}}function dy(t,e,n){var i=t.get("showAllSymbol"),o="auto"===i;if(!i||o){var r=n.getAxesByScale("ordinal")[0];if(r&&(!o||!function(t,e){
- // In most cases, line is monotonous on category axis, and the label size
- // is close with each other. So we check the symbol size and some of the
- // label size alone with the category axis to estimate whether all symbol
- // can be shown without overlap.
- var n=t.getExtent(),i=Math.abs(n[1]-n[0])/t.scale.count();isNaN(i)&&(i=0);for(// 0/0 is NaN.
- // Sampling some points, max 5.
- var o=e.count(),r=Math.max(1,Math.round(o/5)),a=0;a<o;a+=r)if(1.5*Bg.getSymbolSize(e,a)[t.isHorizontal()?1:0]>i)return!1;return!0}(r,e)))
- // Note that category label interval strategy might bring some weird effect
- // in some scenario: users may wonder why some of the symbols are not
- // displayed. So we show all symbols as possible as we can.
- {
- // Otherwise follow the label interval strategy on category axis.
- var s=e.mapDimension(r.dim),l={};return a(r.getViewLabels(),(function(t){var e=r.scale.getRawOrdinalNumber(t.tickValue);l[e]=1})),function(t){return!l.hasOwnProperty(e.get(s,t))}}}}function hy(t,e){return[t[2*e],t[2*e+1]]}function py(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e<li.length;e++)if(t.get([li[e],"endLabel","show"]))return!0;return!1}function fy(t,e,n,i){if(oy(e,"cartesian2d")){var o=i.getModel("endLabel"),r=o.get("valueAnimation"),a=i.getData(),s={lastFrameIndex:0},l=py(i)?function(n,i){t._endLabelOnDuring(n,i,a,s,r,o,e)}:null,u=e.getBaseAxis().isHorizontal(),c=ey(e,n,i,(function(){var e=t._endLabel;e&&n&&null!=s.originalX&&e.attr({x:s.originalX,y:s.originalY})}),l);
- // Expand clip shape to avoid clipping when line value exceeds axis
- if(!i.get("clip",!0)){var d=c.shape,h=Math.max(d.width,d.height);u?(d.y-=h,d.height+=2*h):(d.x-=h,d.width+=2*h)}
- // Set to the final frame. To make sure label layout is right.
- return l&&l(1,c),c}return ny(e,n,i)}var gy=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.init=function(){var t=new Z,e=new Yg;this.group.add(e.group),this._symbolDraw=e,this._lineGroup=t,this._changePolyState=lt(this._changePolyState,this)},e.prototype.render=function(t,e,n){var i=t.coordinateSystem,o=this.group,r=t.getData(),a=t.getModel("lineStyle"),s=t.getModel("areaStyle"),l=r.getLayout("points")||[],u="polar"===i.type,c=this._coordSys,d=this._symbolDraw,h=this._polyline,p=this._polygon,f=this._lineGroup,g=!e.ssr&&t.get("animation"),y=!s.isEmpty(),m=s.get("origin"),v=Ug(i,r,m),x=y&&function(t,e,n){if(!n.valueDim)return[];for(var i=e.count(),o=xp(2*i),r=0;r<i;r++){var a=Zg(n,t,e,r);o[2*r]=a[0],o[2*r+1]=a[1]}return o}(i,r,v),_=t.get("showSymbol"),b=t.get("connectNulls"),S=_&&!u&&dy(t,r,i),w=this._data;w&&w.eachItemGraphicEl((function(t,e){t.__temp&&(o.remove(t),w.setItemGraphicEl(e,null))})),
- // Remove previous created symbols if showSymbol changed to false
- _||d.remove(),o.add(f);
- // FIXME step not support polar
- var M,D=!u&&t.get("step");i&&i.getArea&&t.get("clip",!0)&&(
- // Avoid float number rounding error for symbol on the edge of axis extent.
- // See #7913 and `test/dataZoom-clip.html`.
- null!=(M=i.getArea()).width?(M.x-=.1,M.y-=.1,M.width+=.2,M.height+=.2):M.r0&&(M.r0-=.5,M.r+=.5)),this._clipShapeForSymbol=M;var T=cy(r,i,n)||r.getVisual("style")[r.getVisual("drawType")];
- // Initialization animation or coordinate system changed
- if(h&&c.type===i.type&&D===this._step){y&&!p?
- // If areaStyle is added
- p=this._newPolygon(l,x):p&&!y&&(
- // If areaStyle is removed
- f.remove(p),p=this._polygon=null),
- // NOTE: Must update _endLabel before setClipPath.
- u||this._initOrUpdateEndLabel(t,i,ha(T));
- // Update clipPath
- var C=f.getClipPath();if(C)oo(C,{shape:fy(this,i,!1,t).shape},t);else f.setClipPath(fy(this,i,!0,t));
- // Always update, or it is wrong in the case turning on legend
- // because points are not changed.
- _&&d.updateData(r,{isIgnore:S,clipShape:M,disableAnimation:!0,getSymbolPoint:function(t){return[l[2*t],l[2*t+1]]}}),
- // In the case data zoom triggered refreshing frequently
- // Data may not change if line has a category axis. So it should animate nothing.
- ry(this._stackedOnPoints,x)&&ry(this._points,l)||(g?this._doUpdateAnimation(r,x,i,n,D,m,b):(
- // Not do it in update with animation
- D&&(x&&(x=uy(x,l,i,D,b)),
- // TODO If stacked series is not step
- l=uy(l,null,i,D,b)),h.setShape({points:l}),p&&p.setShape({points:l,stackedOnPoints:x})))}else _&&d.updateData(r,{isIgnore:S,clipShape:M,disableAnimation:!0,getSymbolPoint:function(t){return[l[2*t],l[2*t+1]]}}),g&&this._initSymbolLabelAnimation(r,i,M),D&&(x&&(x=uy(x,l,i,D,b)),
- // TODO If stacked series is not step
- l=uy(l,null,i,D,b)),h=this._newPolyline(l),y?p=this._newPolygon(l,x):p&&(f.remove(p),p=this._polygon=null),
- // NOTE: Must update _endLabel before setClipPath.
- u||this._initOrUpdateEndLabel(t,i,ha(T)),f.setClipPath(fy(this,i,!0,t));var A=t.getModel("emphasis"),L=A.get("focus"),k=A.get("blurScope"),P=A.get("disabled");(h.useStyle(I(
- // Use color in lineStyle first
- a.getLineStyle(),{fill:"none",stroke:T,lineJoin:"bevel"})),qi(h,t,"lineStyle"),h.style.lineWidth>0&&"bolder"===t.get(["emphasis","lineStyle","width"]))&&(h.getState("emphasis").style.lineWidth=+h.style.lineWidth+1);
- // Needs seriesIndex for focus
- ni(h).seriesIndex=t.seriesIndex,Ui(h,L,k,P);var N=ly(t.get("smooth")),O=t.get("smoothMonotone");if(h.setShape({smooth:N,smoothMonotone:O,connectNulls:b}),p){var R=r.getCalculationInfo("stackedOnSeries"),E=0;p.useStyle(I(s.getAreaStyle(),{fill:T,opacity:.7,lineJoin:"bevel",decal:r.getVisual("style").decal})),R&&(E=ly(R.get("smooth"))),p.setShape({smooth:N,stackedOnSmooth:E,smoothMonotone:O,connectNulls:b}),qi(p,t,"areaStyle"),
- // Needs seriesIndex for focus
- ni(p).seriesIndex=t.seriesIndex,Ui(p,L,k,P)}var V=this._changePolyState;r.eachItemGraphicEl((function(t){
- // Switch polyline / polygon state if element changed its state.
- t&&(t.onHoverStateChange=V)})),this._polyline.onHoverStateChange=V,this._data=r,
- // Save the coordinate system for transition animation when data changed
- this._coordSys=i,this._stackedOnPoints=x,this._points=l,this._step=D,this._valueOrigin=m,t.get("triggerLineEvent")&&(this.packEventData(t,h),p&&this.packEventData(t,p))},e.prototype.packEventData=function(t,e){ni(e).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,e,n,i){var o=t.getData(),r=Nn(o,i);if(this._changePolyState("emphasis"),!(r instanceof Array)&&null!=r&&r>=0){var a=o.getLayout("points"),s=o.getItemGraphicEl(r);if(!s){
- // Create a temporary symbol if it is not exists
- var l=a[2*r],u=a[2*r+1];if(isNaN(l)||isNaN(u))
- // Null data
- return;
- // fix #11360: shouldn't draw symbol outside clipShapeForSymbol
- if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;var c=t.get("zlevel")||0,d=t.get("z")||0;(s=new Bg(o,r)).x=l,s.y=u,s.setZ(c,d);
- // ensure label text of the temporary symbol is in front of line and area polygon
- var h=s.getSymbolPath().getTextContent();h&&(h.zlevel=c,h.z=d,h.z2=this._polyline.z2+1),s.__temp=!0,o.setItemGraphicEl(r,s),
- // Stop scale animation
- s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else
- // Highlight whole series
- Ou.prototype.highlight.call(this,t,e,n,i)},e.prototype.downplay=function(t,e,n,i){var o=t.getData(),r=Nn(o,i);if(this._changePolyState("normal"),null!=r&&r>=0){var a=o.getItemGraphicEl(r);a&&(a.__temp?(o.setItemGraphicEl(r,null),this.group.remove(a)):a.downplay())}else
- // FIXME
- // can not downplay completely.
- // Downplay whole series
- Ou.prototype.downplay.call(this,t,e,n,i)},e.prototype._changePolyState=function(t){var e=this._polygon;Di(this._polyline,t),e&&Di(e,t)},e.prototype._newPolyline=function(t){var e=this._polyline;
- // Remove previous created polyline
- return e&&this._lineGroup.remove(e),e=new $g({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(e),this._polyline=e,e},e.prototype._newPolygon=function(t,e){var n=this._polygon;
- // Remove previous created polygon
- return n&&this._lineGroup.remove(n),n=new ty({shape:{points:t,stackedOnPoints:e},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(t,e,n){var i,o,r=e.getBaseAxis(),a=r.inverse;"cartesian2d"===e.type?(i=r.isHorizontal(),o=!1):"polar"===e.type&&(i="angle"===r.dim,o=!0);var s=t.hostModel,l=s.get("animationDuration");f(l)&&(l=l(null));var u=s.get("animationDelay")||0,c=f(u)?u(null):u;t.eachItemGraphicEl((function(t,r){var s=t;if(s){var d=[t.x,t.y],h=void 0,p=void 0,g=void 0;if(n)if(o){var y=n,m=e.pointToCoord(d);i?(h=y.startAngle,p=y.endAngle,g=-m[1]/180*Math.PI):(h=y.r0,p=y.r,g=m[0])}else{var v=n;i?(h=v.x,p=v.x+v.width,g=t.x):(h=v.y+v.height,p=v.y,g=t.y)}var x=p===h?0:(g-h)/(p-h);a&&(x=1-x);var _=f(u)?u(r):l*x+c,b=s.getSymbolPath(),S=b.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:_}),S&&S.animateFrom({style:{opacity:0}},{duration:300,delay:_}),b.disableLabelAnimation=!0}}))},e.prototype._initOrUpdateEndLabel=function(t,e,n){var i=t.getModel("endLabel");if(py(t)){var o=t.getData(),r=this._polyline,a=o.getLayout("points");if(!a)return r.removeTextContent(),void(this._endLabel=null);var s=this._endLabel;s||((s=this._endLabel=new $({z2:200})).ignoreClip=!0,r.setTextContent(this._endLabel),r.disableLabelAnimation=!0);
- // Find last non-NaN data to display data
- var l=function(t){for(var e,n,i=t.length/2;i>0&&(e=t[2*i-2],n=t[2*i-1],isNaN(e)||isNaN(n));i--);return i-1}(a);l>=0&&(Yo(r,Uo(t,"endLabel"),{inheritColor:n,labelFetcher:t,labelDataIndex:l,defaultText:function(t,e,n){return null!=n?Eg(o,n):Rg(o,t)},enableTextSetter:!0},function(t,e){var n=e.getBaseAxis(),i=n.isHorizontal(),o=n.inverse,r=i?o?"right":"left":"center",a=i?"middle":o?"top":"bottom";return{normal:{align:t.get("align")||r,verticalAlign:t.get("verticalAlign")||a}}}(i,e)),r.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,e,n,i,o,r,a){var s=this._endLabel,l=this._polyline;if(s){
- // NOTE: Don't remove percent < 1. percent === 1 means the first frame during render.
- // The label is not prepared at this time.
- t<1&&null==i.originalX&&(i.originalX=s.x,i.originalY=s.y);var u=n.getLayout("points"),c=n.hostModel,d=c.get("connectNulls"),h=r.get("precision"),p=r.get("distance")||0,f=a.getBaseAxis(),g=f.isHorizontal(),y=f.inverse,m=e.shape,v=y?g?m.x:m.y+m.height:g?m.x+m.width:m.y,x=(g?p:0)*(y?-1:1),_=(g?0:-p)*(y?-1:1),b=g?"x":"y",S=function(t,e,n){for(var i,o,r=t.length/2,a="x"===n?0:1,s=0,l=-1,u=0;u<r;u++)if(o=t[2*u+a],!isNaN(o)&&!isNaN(t[2*u+1-a]))if(0!==u){if(i<=e&&o>=e||i>=e&&o<=e){l=u;break}s=u,i=o}else i=o;return{range:[s,l],t:(e-i)/(o-i)}}(u,v,b),w=S.range,M=w[1]-w[0],I=void 0;if(M>=1){
- // diff > 1 && connectNulls, which is on the null data.
- if(M>1&&!d){var D=hy(u,w[0]);s.attr({x:D[0]+x,y:D[1]+_}),o&&(I=c.getRawValue(w[0]))}else{(D=l.getPointOn(v,b))&&s.attr({x:D[0]+x,y:D[1]+_});var T=c.getRawValue(w[0]),C=c.getRawValue(w[1]);o&&(I=Hn(n,h,T,C,S.t))}i.lastFrameIndex=w[0]}else{
- // If diff <= 0, which is the range is not found(Include NaN)
- // Choose the first point or last point.
- var A=1===t||i.lastFrameIndex>0?w[0]:0;D=hy(u,A);o&&(I=c.getRawValue(A)),s.attr({x:D[0]+x,y:D[1]+_})}if(o){var L=Qo(s);"function"==typeof L.setLabelText&&L.setLabelText(I)}}},
- /**
- * @private
- */
- // FIXME Two value axis
- e.prototype._doUpdateAnimation=function(t,e,n,i,o,r,a){var s=this._polyline,l=this._polygon,u=t.hostModel,c=function(t,e,n,i,o,r,a){for(var s=function(t,e){var n=[];return e.diff(t).add((function(t){n.push({cmd:"+",idx:t})})).update((function(t,e){n.push({cmd:"=",idx:e,idx1:t})})).remove((function(t){n.push({cmd:"-",idx:t})})).execute(),n}(t,e),l=[],u=[],c=[],d=[],h=[],p=[],f=[],g=Ug(o,e,a),y=t.getLayout("points")||[],m=e.getLayout("points")||[],v=0
- // let newIdList = newData.mapArray(newData.getId);
- // let oldIdList = oldData.mapArray(oldData.getId);
- // convertToIntId(newIdList, oldIdList);
- // // FIXME One data ?
- // diff = arrayDiff(oldIdList, newIdList);
- ;v<s.length;v++){var x=s[v],_=!0,b=void 0,S=void 0;
- // FIXME, animation is not so perfect when dataZoom window moves fast
- // Which is in case remvoing or add more than one data in the tail or head
- switch(x.cmd){case"=":b=2*x.idx,S=2*x.idx1;var w=y[b],M=y[b+1],I=m[S],D=m[S+1];
- // If previous data is NaN, use next point directly
- (isNaN(w)||isNaN(M))&&(w=I,M=D),l.push(w,M),u.push(I,D),c.push(n[b],n[b+1]),d.push(i[S],i[S+1]),f.push(e.getRawIndex(x.idx1));break;case"+":var T=x.idx,C=g.dataDimsForPoint,A=o.dataToPoint([e.get(C[0],T),e.get(C[1],T)]);S=2*T,l.push(A[0],A[1]),u.push(m[S],m[S+1]);var L=Zg(g,o,e,T);c.push(L[0],L[1]),d.push(i[S],i[S+1]),f.push(e.getRawIndex(T));break;case"-":_=!1}
- // Original indices
- _&&(h.push(x),p.push(p.length))}
- // Diff result may be crossed if all items are changed
- // Sort by data index
- p.sort((function(t,e){return f[t]-f[e]}));var k=l.length,P=xp(k),N=xp(k),O=xp(k),R=xp(k),E=[];for(v=0;v<p.length;v++){var V=p[v],z=2*v,B=2*V;P[z]=l[B],P[z+1]=l[B+1],N[z]=u[B],N[z+1]=u[B+1],O[z]=c[B],O[z+1]=c[B+1],R[z]=d[B],R[z+1]=d[B+1],E[v]=h[V]}return{current:P,next:N,stackedOnCurrent:O,stackedOnNext:R,status:E}}(this._data,t,this._stackedOnPoints,e,this._coordSys,0,this._valueOrigin),d=c.current,h=c.stackedOnCurrent,p=c.next,f=c.stackedOnNext;
- // Don't apply animation if diff is large.
- // For better result and avoid memory explosion problems like
- // https://github.com/apache/incubator-echarts/issues/12229
- if(o&&(
- // TODO If stacked series is not step
- h=uy(c.stackedOnCurrent,c.current,n,o,a),d=uy(c.current,null,n,o,a),f=uy(c.stackedOnNext,c.next,n,o,a),p=uy(c.next,null,n,o,a)),sy(d,p)>3e3||l&&sy(h,f)>3e3)return s.stopAnimation(),s.setShape({points:p}),void(l&&(l.stopAnimation(),l.setShape({points:p,stackedOnPoints:f})));s.shape.__points=c.current,s.shape.points=d;var g={shape:{points:p}};
- // Also animate the original points.
- // If points reference is changed when turning into step line.
- c.current!==d&&(g.shape.__points=c.next),
- // Stop previous animation.
- s.stopAnimation(),io(s,g,u),l&&(l.setShape({
- // Reuse the points with polyline.
- points:d,stackedOnPoints:h}),l.stopAnimation(),io(l,{shape:{stackedOnPoints:f}},u),
- // If use attr directly in updateProps.
- s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var y=[],m=c.status,v=0;v<m.length;v++){if("="===m[v].cmd){var x=t.getItemGraphicEl(m[v].idx1);x&&y.push({el:x,ptIdx:v})}}s.animators&&s.animators.length&&s.animators[0].during((function(){l&&l.dirtyShape();for(var t=s.shape.__points,e=0;e<y.length;e++){var n=y[e].el,i=2*y[e].ptIdx;n.x=t[i],n.y=t[i+1],n.markRedraw()}}))},e.prototype.remove=function(t){var e=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),
- // Remove temporary created elements when highlighting
- n&&n.eachItemGraphicEl((function(t,i){t.__temp&&(e.remove(t),n.setItemGraphicEl(i,null))})),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},e.type="line",e}(Ou);const yy=gy;function my(t,e){return{seriesType:t,plan:Iu(),reset:function(t){var i=t.getData(),o=t.coordinateSystem,r=t.pipelineContext,a=e||r.large;if(o){var s=n(o.dimensions,(function(t){return i.mapDimension(t)})).slice(0,2),l=s.length,u=i.getCalculationInfo("stackResultDimension");qh(i,s[0])&&(s[0]=u),qh(i,s[1])&&(s[1]=u);var c=i.getStore(),d=i.getDimensionIndex(s[0]),h=i.getDimensionIndex(s[1]);return l&&{progress:function(t,e){for(var n=t.end-t.start,i=a&&xp(n*l),r=[],s=[],u=t.start,p=0;u<t.end;u++){var f=void 0;if(1===l){var g=c.get(d,u);
- // NOTE: Make sure the second parameter is null to use default strategy.
- f=o.dataToPoint(g,null,s)}else r[0]=c.get(d,u),r[1]=c.get(h,u),
- // Let coordinate system to handle the NaN data.
- f=o.dataToPoint(r,null,s);a?(i[p++]=f[0],i[p++]=f[1]):e.setItemLayout(u,f.slice())}a&&e.setLayout("points",i)}}}}}}var vy={average:function(t){for(var e=0,n=0,i=0;i<t.length;i++)isNaN(t[i])||(e+=t[i],n++);
- // Return NaN if count is 0
- return 0===n?NaN:e/n},sum:function(t){for(var e=0,n=0;n<t.length;n++)
- // Ignore NaN
- e+=t[n]||0;return e},max:function(t){for(var e=-Infinity,n=0;n<t.length;n++)t[n]>e&&(e=t[n]);
- // NaN will cause illegal axis extent.
- return isFinite(e)?e:NaN},min:function(t){for(var e=Infinity,n=0;n<t.length;n++)t[n]<e&&(e=t[n]);
- // NaN will cause illegal axis extent.
- return isFinite(e)?e:NaN},
- // TODO
- // Median
- nearest:function(t){return t[0]}},xy=function(t){return Math.round(t.length/2)};function _y(e){return{seriesType:e,
- // FIXME:TS never used, so comment it
- // modifyOutputEnd: true,
- reset:function(e,n,i){var o=e.getData(),r=e.get("sampling"),a=e.coordinateSystem,s=o.count();
- // Only cartesian2d support down sampling. Disable it when there is few data.
- if(s>10&&"cartesian2d"===a.type&&r){var l=a.getBaseAxis(),u=a.getOtherAxis(l),c=l.getExtent(),d=i.getDevicePixelRatio(),h=Math.abs(c[1]-c[0])*(d||1),p=Math.round(s/h);if(isFinite(p)&&p>1){"lttb"===r?e.setData(o.lttbDownSample(o.mapDimension(u.dim),1/p)):"minmax"===r&&e.setData(o.minmaxDownSample(o.mapDimension(u.dim),1/p));var g=void 0;t(r)?g=vy[r]:f(r)&&(g=r),g&&
- // Only support sample the first dim mapped from value axis.
- e.setData(o.downSample(o.mapDimension(u.dim),1/p,g,xy))}}}}}var by=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.getInitialData=function(t,e){return Jh(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,e,n){var i=this.coordinateSystem;if(i&&i.clampData){
- // PENDING if clamp ?
- var o=i.clampData(t),r=i.dataToPoint(o);if(n)a(i.getAxes(),(function(t,n){
- // If axis type is category, use tick coords instead
- if("category"===t.type&&null!=e){var i=t.getTicksCoords(),a=t.getTickModel().get("alignWithLabel"),s=o[n],l="x1"===e[n]||"y1"===e[n];
- // The only contains one tick, tickCoords is
- // like [{coord: 0, tickValue: 0}, {coord: 0}]
- // to the length should always be larger than 1
- if(l&&!a&&(s+=1),i.length<2)return;if(2===i.length)
- // The left value and right value of the axis are
- // the same. coord is 0 in both items. Use the max
- // value of the axis as the coord
- return void(r[n]=t.toGlobalCoord(t.getExtent()[l?1:0]));for(var u=void 0,c=void 0,d=1,h=0;h<i.length;h++){var p=i[h].coord,f=h===i.length-1?i[h-1].tickValue+d:i[h].tickValue;
- // The last item of tickCoords doesn't contain
- // tickValue
- if(f===s){c=p;break}if(f<s)u=p;else if(null!=u&&f>s){c=(p+u)/2;break}1===h&&(
- // Here we assume the step of category axes is
- // the same
- d=f-i[0].tickValue)}null==c&&(u?u&&(
- // targetTickId is larger than all tick ids in the
- // visible area, use the rightmost tick coord
- c=i[i.length-1].coord):
- // targetTickId is smaller than all tick ids in the
- // visible area, use the leftmost tick coord
- c=i[0].coord),r[n]=t.toGlobalCoord(c)}}));else{var s=this.getData(),l=s.getLayout("offset"),u=s.getLayout("size"),c=i.getBaseAxis().isHorizontal()?0:1;r[c]+=l+u/2}return r}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={
- // zlevel: 0,
- z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,
- // stack: null
- // Cartesian coordinate system
- // xAxisIndex: 0,
- // yAxisIndex: 0,
- barMinHeight:0,barMinAngle:0,
- // cursor: null,
- large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(Su);Su.registerClass(by);const Sy=by;const wy=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.getInitialData=function(){return Jh(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},
- /**
- * @override
- */
- e.prototype.getProgressive=function(){
- // Do not support progressive in normal mode.
- return!!this.get("large")&&this.get("progressive")},
- /**
- * @override
- */
- e.prototype.getProgressiveThreshold=function(){
- // Do not support progressive in normal mode.
- var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return e>t&&(t=e),t},e.prototype.brushSelector=function(t,e,n){return n.rect(e.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=xr(Sy.defaultOption,{
- // If clipped
- // Only available on cartesian2d
- clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(Sy);
- /**
- * Sausage: similar to sector, but have half circle on both sides
- */var My=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},Iy=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="sausage",n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new My},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,o=Math.max(e.r0||0,0),r=Math.max(e.r,0),a=.5*(r-o),s=o+a,l=e.startAngle,u=e.endAngle,c=e.clockwise,d=2*Math.PI,h=c?u-l<d:l-u<d;h||(
- // Normalize angles
- l=u-(c?d:-d));var p=Math.cos(l),f=Math.sin(l),g=Math.cos(u),y=Math.sin(u);h?(t.moveTo(p*o+n,f*o+i),t.arc(p*s+n,f*s+i,a,-Math.PI+l,l,!c)):t.moveTo(p*r+n,f*r+i),t.arc(n,i,r,l,u,!c),t.arc(g*s+n,y*s+i,a,u-2*Math.PI,u-Math.PI,!c),0!==o&&t.arc(n,i,o,u,l,c)},e}(g);const Dy=Iy;function Ty(t,e,n){return e*Math.sin(t)*(n?-1:1)}function Cy(t,e,n){return e*Math.cos(t)*(n?1:-1)}function Ay(t,e,o){var r=t.get("borderRadius");if(null==r)return o?{cornerRadius:0}:null;i(r)||(r=[r,r,r,r]);var a=Math.abs(e.r||0-e.r0||0);return{cornerRadius:n(r,(function(t){return Mt(t,a)}))}}var Ly=Math.max,ky=Math.min;var Py=/** @class */function(t){function e(){var n=t.call(this)||this;return n.type=e.type,n._isFirstFrame=!0,n}return Ue(e,t),e.prototype.render=function(t,e,n,i){this._model=t,this._removeOnRenderedListener(n),this._updateDrawMode(t);var o=t.get("coordinateSystem");"cartesian2d"!==o&&"polar"!==o||(
- // Clear previously rendered progressive elements.
- this._progressiveEls=null,this._isLargeDraw?this._renderLarge(t,e,n):this._renderNormal(t,e,n,i))},e.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),
- // incremental also need to clip, otherwise might be overlow.
- // But must not set clip in each frame, otherwise all of the children will be marked redraw.
- this._updateLargeClip(t)},e.prototype.incrementalRender=function(t,e){
- // Reset
- this._progressiveEls=[],
- // Do not support progressive in normal mode.
- this._incrementalRenderLarge(t,e)},e.prototype.eachRendered=function(t){Bo(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t,e,n,i){var o,r=this.group,a=t.getData(),s=this._data,l=t.coordinateSystem,u=l.getBaseAxis();"cartesian2d"===l.type?o=u.isHorizontal():"polar"===l.type&&(o="angle"===u.dim);var c=t.isAnimationEnabled()?t:null,d=function(t,e){var n=t.get("realtimeSort",!0),i=e.getBaseAxis();if(n&&"category"===i.type&&"cartesian2d"===e.type)return{baseAxis:i,otherAxis:e.getOtherAxis(i)}}(t,l);d&&this._enableRealtimeSort(d,a,n);var h=t.get("clip",!0)||d,p=function(t,e){var n=t.getArea&&t.getArea();if(oy(t,"cartesian2d")){var i=t.getBaseAxis();
- // When boundaryGap is false or using time axis. bar may exceed the grid.
- // We should not clip this part.
- // See test/bar2.html
- if("category"!==i.type||!i.onBand){var o=e.getLayout("bandWidth");i.isHorizontal()?(n.x-=o,n.width+=2*o):(n.y-=o,n.height+=2*o)}}return n}(l,a);
- // If there is clipPath created in large mode. Remove it.
- r.removeClipPath();
- // We don't use clipPath in normal mode because we needs a perfect animation
- // And don't want the label are clipped.
- var f=t.get("roundCap",!0),g=t.get("showBackground",!0),y=t.getModel("backgroundStyle"),m=y.get("borderRadius")||0,v=[],x=this._backgroundEls,_=i&&i.isInitSort,b=i&&"changeAxisOrder"===i.type;function S(t){var e=Gy[l.type](a,t),n=function(t,e,n){var i="polar"===t.type?E:G;return new i({shape:Xy(e,n,t),silent:!0,z2:0})}(l,o,e);return n.useStyle(y.getItemStyle()),
- // Only cartesian2d support borderRadius.
- "cartesian2d"===l.type?n.setShape("r",m):n.setShape("cornerRadius",m),v[t]=n,n}a.diff(s).add((function(e){var n=a.getItemModel(e),i=Gy[l.type](a,e,n);
- // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in "axisProxy".
- if(g&&S(e),a.hasValue(e)&&By[l.type](i)){var s=!1;h&&(
- // Clip will modify the layout params.
- // And return a boolean to determine if the shape are fully clipped.
- s=Ny[l.type](p,i));var y=Oy[l.type](t,a,e,i,o,c,u.model,!1,f);d&&(
- /**
- * Force label animation because even if the element is
- * ignored because it's clipped, it may not be clipped after
- * changing order. Then, if not using forceLabelAnimation,
- * the label animation was never started, in which case,
- * the label will be the final value and doesn't have label
- * animation.
- */
- y.forceLabelAnimation=!0),Wy(y,a,e,n,i,t,o,"polar"===l.type),_?y.attr({shape:i}):d?Ry(d,c,y,i,e,o,!1,!1):oo(y,{shape:i},t,e),a.setItemGraphicEl(e,y),r.add(y),y.ignore=s}})).update((function(e,n){var i=a.getItemModel(e),w=Gy[l.type](a,e,i);if(g){var M=void 0;0===x.length?M=S(n):((M=x[n]).useStyle(y.getItemStyle()),
- // Only cartesian2d support borderRadius.
- "cartesian2d"===l.type?M.setShape("r",m):M.setShape("cornerRadius",m),v[e]=M);var I=Gy[l.type](a,e);io(M,{shape:Xy(o,I,l)},c,e)}var D=s.getItemGraphicEl(n);if(a.hasValue(e)&&By[l.type](w)){var T=!1;if(h&&(T=Ny[l.type](p,w))&&r.remove(D),D?uo(D):D=Oy[l.type](t,a,e,w,o,c,u.model,!!D,f),d&&(D.forceLabelAnimation=!0),b){var C=D.getTextContent();if(C){var A=Qo(C);null!=A.prevValue&&(
- /**
- * Set preValue to be value so that no new label
- * should be started, otherwise, it will take a full
- * `animationDurationUpdate` time to finish the
- * animation, which is not expected.
- */
- A.prevValue=A.value)}}
- // Not change anything if only order changed.
- // Especially not change label.
- else Wy(D,a,e,i,w,t,o,"polar"===l.type);_?D.attr({shape:w}):d?Ry(d,c,D,w,e,o,!0,b):io(D,{shape:w},t,e,null),a.setItemGraphicEl(e,D),D.ignore=T,r.add(D)}else r.remove(D)})).remove((function(e){var n=s.getItemGraphicEl(e);n&&lo(n,t,e)})).execute();var w=this._backgroundGroup||(this._backgroundGroup=new Z);w.removeAll();for(var M=0;M<v.length;++M)w.add(v[M]);r.add(w),this._backgroundEls=v,this._data=a},e.prototype._renderLarge=function(t,e,n){this._clear(),Uy(t,this.group),this._updateLargeClip(t)},e.prototype._incrementalRenderLarge=function(t,e){this._removeBackground(),Uy(e,this.group,this._progressiveEls,!0)},e.prototype._updateLargeClip=function(t){
- // Use clipPath in large mode.
- var e=t.get("clip",!0)&&iy(t.coordinateSystem,!1,t),n=this.group;e?n.setClipPath(e):n.removeClipPath()},e.prototype._enableRealtimeSort=function(t,e,n){var i=this;
- // If no data in the first frame, wait for data to initSort
- if(e.count()){var o=t.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(e,t,n),this._isFirstFrame=!1;else{var r=function(t){var n=e.getItemGraphicEl(t),i=n&&n.shape;return i&&
- // The result should be consistent with the initial sort by data value.
- // Do not support the case that both positive and negative exist.
- Math.abs(o.isHorizontal()?i.height:i.width)||0};this._onRendered=function(){i._updateSortWithinSameData(e,r,o,n)},n.getZr().on("rendered",this._onRendered)}}},e.prototype._dataSort=function(t,e,i){var o=[];return t.each(t.mapDimension(e.dim),(function(t,e){var n=i(e);n=null==n?NaN:n,o.push({dataIndex:e,mappedValue:n,ordinalNumber:t})})),o.sort((function(t,e){
- // If NaN, it will be treated as min val.
- return e.mappedValue-t.mappedValue})),{ordinalNumbers:n(o,(function(t){return t.ordinalNumber}))}},e.prototype._isOrderChangedWithinSameData=function(t,e,n){for(var i=n.scale,o=t.mapDimension(n.dim),r=Number.MAX_VALUE,a=0,s=i.getOrdinalMeta().categories.length;a<s;++a){var l=t.rawIndexOf(o,i.getRawOrdinalNumber(a)),u=l<0?Number.MIN_VALUE:e(t.indexOfRawIndex(l));if(u>r)return!0;r=u}return!1},
- /*
- * Consider the case when A and B changed order, whose representing
- * bars are both out of sight, we don't wish to trigger reorder action
- * as long as the order in the view doesn't change.
- */
- e.prototype._isOrderDifferentInView=function(t,e){for(var n=e.scale,i=n.getExtent(),o=Math.max(0,i[0]),r=Math.min(i[1],n.getOrdinalMeta().categories.length-1);o<=r;++o)if(t.ordinalNumbers[o]!==n.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(t,e,n,i){if(this._isOrderChangedWithinSameData(t,e,n)){var o=this._dataSort(t,n,e);this._isOrderDifferentInView(o,n)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(t,e,n){var i=e.baseAxis,o=this._dataSort(t,i,(function(n){return t.get(t.mapDimension(e.otherAxis.dim),n)}));n.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:o})},e.prototype.remove=function(t,e){this._clear(this._model),this._removeOnRenderedListener(e)},e.prototype.dispose=function(t,e){this._removeOnRenderedListener(e)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var e=this.group,n=this._data;t&&t.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl((function(e){lo(e,t,ni(e).dataIndex)}))):e.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(Ou),Ny={cartesian2d:function(t,e){var n=e.width<0?-1:1,i=e.height<0?-1:1;
- // Needs positive width and height
- n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height);var o=t.x+t.width,r=t.y+t.height,a=Ly(e.x,t.x),s=ky(e.x+e.width,o),l=Ly(e.y,t.y),u=ky(e.y+e.height,r),c=s<a,d=u<l;
- // When xClipped or yClipped, the element will be marked as `ignore`.
- // But we should also place the element at the edge of the coord sys bounding rect.
- // Because if data changed and the bar shows again, its transition animation
- // will begin at this place.
- return e.x=c&&a>o?s:a,e.y=d&&l>r?u:l,e.width=c?0:s-a,e.height=d?0:u-l,
- // Reverse back
- n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height),c||d},polar:function(t,e){var n=e.r0<=e.r?1:-1;
- // Make sure r is larger than r0
- if(n<0){var i=e.r;e.r=e.r0,e.r0=i}var o=ky(e.r,t.r),r=Ly(e.r0,t.r0);e.r=o,e.r0=r;var a=o-r<0;
- // Reverse back
- if(n<0){i=e.r;e.r=e.r0,e.r0=i}return a}},Oy={cartesian2d:function(t,e,n,i,o,r,a,s,l){var u=new G({shape:p({},i),z2:1});(u.__dataIndex=n,u.name="item",r)&&(u.shape[o?"height":"width"]=0);return u},polar:function(t,e,n,i,o,r,a,s,l){var u=!o&&l?Dy:E,c=new u({shape:i,z2:1});c.name="item";var d,h,p=Fy(o);
- // Animation
- if(c.calculateTextPosition=(d=p,h=({isRoundCap:u===Dy}||{}).isRoundCap,function(t,e,n){var i=e.position;if(!i||i instanceof Array)return ht(t,e,n);var o=d(i),r=null!=e.distance?e.distance:5,a=this.shape,s=a.cx,l=a.cy,u=a.r,c=a.r0,p=(u+c)/2,f=a.startAngle,g=a.endAngle,y=(f+g)/2,m=h?Math.abs(u-c)/2:0,v=Math.cos,x=Math.sin,_=s+u*v(f),b=l+u*x(f),S="left",w="top";switch(o){case"startArc":_=s+(c-r)*v(y),b=l+(c-r)*x(y),S="center",w="top";break;case"insideStartArc":_=s+(c+r)*v(y),b=l+(c+r)*x(y),S="center",w="bottom";break;case"startAngle":_=s+p*v(f)+Ty(f,r+m,!1),b=l+p*x(f)+Cy(f,r+m,!1),S="right",w="middle";break;case"insideStartAngle":_=s+p*v(f)+Ty(f,-r+m,!1),b=l+p*x(f)+Cy(f,-r+m,!1),S="left",w="middle";break;case"middle":_=s+p*v(y),b=l+p*x(y),S="center",w="middle";break;case"endArc":_=s+(u+r)*v(y),b=l+(u+r)*x(y),S="center",w="bottom";break;case"insideEndArc":_=s+(u-r)*v(y),b=l+(u-r)*x(y),S="center",w="top";break;case"endAngle":_=s+p*v(g)+Ty(g,r+m,!0),b=l+p*x(g)+Cy(g,r+m,!0),S="left",w="middle";break;case"insideEndAngle":_=s+p*v(g)+Ty(g,-r+m,!0),b=l+p*x(g)+Cy(g,-r+m,!0),S="right",w="middle";break;default:return ht(t,e,n)}return(t=t||{}).x=_,t.y=b,t.align=S,t.verticalAlign=w,t}),r){var f=o?"r":"endAngle",g={};c.shape[f]=o?i.r0:i.startAngle,g[f]=i[f],(s?io:oo)(c,{shape:g},r)}return c}};function Ry(t,e,n,i,o,r,a,s){var l,u;r?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||
- // Keep the original growth animation if only axis order changed.
- // Not start a new animation.
- (a?io:oo)(n,{shape:l},e,o,null),(a?io:oo)(n,{shape:u},e?t.baseAxis.model:null,o)}function Ey(t,e){for(var n=0;n<e.length;n++)if(!isFinite(t[e[n]]))return!0;return!1}var Vy=["x","y","width","height"],zy=["cx","cy","r","startAngle","endAngle"],By={cartesian2d:function(t){return!Ey(t,Vy)},polar:function(t){return!Ey(t,zy)}},Gy={
- // itemModel is only used to get borderWidth, which is not needed
- // when calculating bar background layout.
- cartesian2d:function(t,e,n){var i=t.getItemLayout(e),o=n?
- // In case width or height are too small.
- function(t,e){
- // Has no border.
- var n=t.get(["itemStyle","borderColor"]);if(!n||"none"===n)return 0;var i=t.get(["itemStyle","borderWidth"])||0,o=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),r=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);
- // width or height may be NaN for empty data
- return Math.min(i,o,r)}(n,i):0,r=i.width>0?1:-1,a=i.height>0?1:-1;return{x:i.x+r*o/2,y:i.y+a*o/2,width:i.width-r*o,height:i.height-a*o}},polar:function(t,e,n){var i=t.getItemLayout(e);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function Fy(t){return function(t){var e=t?"Arc":"Angle";return function(t){switch(t){case"start":case"insideStart":case"end":case"insideEnd":return t+e;default:return t}}}(t)}function Wy(t,e,n,o,r,s,u,c){var d=e.getItemVisual(n,"style");if(c){if(!s.get("roundCap")){var h=t.shape,f=Ay(o.getModel("itemStyle"),h,!0);p(h,f),t.setShape(h)}}else{var g=o.get(["itemStyle","borderRadius"])||0;t.setShape("r",g)}t.useStyle(d);var y=o.getShallow("cursor");y&&t.attr("cursor",y);var m=c?u?r.r>=r.r0?"endArc":"startArc":r.endAngle>=r.startAngle?"endAngle":"startAngle":u?r.height>=0?"bottom":"top":r.width>=0?"right":"left",v=Uo(o);Yo(t,v,{labelFetcher:s,labelDataIndex:n,defaultText:Rg(s.getData(),n),inheritColor:d.fill,defaultOpacity:d.opacity,defaultOutsidePosition:m});var x=t.getTextContent();if(c&&x){var _=o.get(["label","position"]);t.textConfig.inside="middle"===_||null,function(t,e,n,o){if(l(o))
- // user-set rotation
- t.setTextConfig({rotation:o});else if(i(e))
- // user-set position, use 0 as auto rotation
- t.setTextConfig({rotation:0});else{var r,a=t.shape,s=a.clockwise?a.startAngle:a.endAngle,u=a.clockwise?a.endAngle:a.startAngle,c=(s+u)/2,d=n(e);switch(d){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":r=c;break;case"startAngle":case"insideStartAngle":r=s;break;case"endAngle":case"insideEndAngle":r=u;break;default:return void t.setTextConfig({rotation:0})}var h=1.5*Math.PI-r;
- /**
- * TODO: labels with rotate > Math.PI / 2 should be rotate another
- * half round flipped to increase readability. However, only middle
- * position supports this for now, because in other positions, the
- * anchor point is not at the center of the text, so the positions
- * after rotating is not as expected.
- */"middle"===d&&h>Math.PI/2&&h<1.5*Math.PI&&(h-=Math.PI),t.setTextConfig({rotation:h})}}(t,"outside"===_?m:_,Fy(u),o.get(["label","rotate"]))}tr(x,v,s.getRawValue(n),(function(t){return Eg(e,t)}));var b=o.getModel(["emphasis"]);Ui(t,b.get("focus"),b.get("blurScope"),b.get("disabled")),qi(t,o),function(t){return null!=t.startAngle&&null!=t.endAngle&&t.startAngle===t.endAngle}(r)&&(t.style.fill="none",t.style.stroke="none",a(t.states,(function(t){t.style&&(t.style.fill=t.style.stroke="none")})))}var Hy=function(){},Yy=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="largeBar",n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new Hy},e.prototype.buildPath=function(t,e){for(
- // Drawing lines is more efficient than drawing
- // a whole line or drawing rects.
- var n=e.points,i=this.baseDimIdx,o=1-this.baseDimIdx,r=[],a=[],s=this.barWidth,l=0;l<n.length;l+=3)a[i]=s,a[o]=n[l+2],r[i]=n[l+i],r[o]=n[l+o],t.rect(r[0],r[1],a[0],a[1])},e}(g);function Uy(t,e,n,i){
- // TODO support polar
- var o=t.getData(),r=o.getLayout("valueAxisHorizontal")?1:0,a=o.getLayout("largeDataIndices"),s=o.getLayout("size"),l=t.getModel("backgroundStyle"),u=o.getLayout("largeBackgroundPoints");if(u){var c=new Yy({shape:{points:u},incremental:!!i,silent:!0,z2:0});c.baseDimIdx=r,c.largeDataIndices=a,c.barWidth=s,c.useStyle(l.getItemStyle()),e.add(c),n&&n.push(c)}var d=new Yy({shape:{points:o.getLayout("largePoints")},incremental:!!i,ignoreCoarsePointer:!0,z2:1});d.baseDimIdx=r,d.largeDataIndices=a,d.barWidth=s,e.add(d),d.useStyle(o.getVisual("style")),
- // Stroke is rendered first to avoid overlapping with fill
- d.style.stroke=null,
- // Enable tooltip and user mouse/touch event handlers.
- ni(d).seriesIndex=t.seriesIndex,t.get("silent")||(d.on("mousedown",Zy),d.on("mousemove",Zy)),n&&n.push(d)}
- // Use throttle to avoid frequently traverse to find dataIndex.
- var Zy=zu((function(t){var e=function(t,e,n){for(var i=t.baseDimIdx,o=1-i,r=t.shape.points,a=t.largeDataIndices,s=[],l=[],u=t.barWidth,c=0,d=r.length/3;c<d;c++){var h=3*c;if(l[i]=u,l[o]=r[h+2],s[i]=r[h+i],s[o]=r[h+o],l[o]<0&&(s[o]+=l[o],l[o]=-l[o]),e>=s[0]&&e<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return a[c]}return-1}(this,t.offsetX,t.offsetY);ni(this).dataIndex=e>=0?e:null}),30,!1);function Xy(t,e,n){if(oy(n,"cartesian2d")){var i=e,o=n.getArea();return{x:t?i.x:o.x,y:t?o.y:i.y,width:t?i.width:o.width,height:t?o.height:i.height}}var r=e;return{cx:(o=n.getArea()).cx,cy:o.cy,r0:t?o.r0:r.r0,r:t?o.r:r.r,startAngle:t?r.startAngle:0,endAngle:t?r.endAngle:2*Math.PI}}const jy=Py;var qy=2*Math.PI,Ky=Math.PI/180;function Jy(t,e){return xa(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function $y(t,e){var n=Jy(t,e),o=t.get("center"),r=t.get("radius");
- // center can be string or number when coordinateSystem is specified
- i(r)||(r=[0,r]);var a,s,l=je(n.width,e.getWidth()),u=je(n.height,e.getHeight()),c=Math.min(l,u),d=je(r[0],c/2),h=je(r[1],c/2),p=t.coordinateSystem;if(p){
- // percentage is not allowed when coordinate system is specified
- var f=p.dataToPoint(o);a=f[0]||0,s=f[1]||0}else i(o)||(o=[o,o]),a=je(o[0],l)+n.x,s=je(o[1],u)+n.y;return{cx:a,cy:s,r0:d,r:h}}function Qy(t,e,n){e.eachSeriesByType(t,(function(t){var e=t.getData(),i=e.mapDimension("value"),o=Jy(t,n),r=$y(t,n),a=r.cx,s=r.cy,l=r.r,u=r.r0,c=-t.get("startAngle")*Ky,d=t.get("endAngle"),h=t.get("padAngle")*Ky;d="auto"===d?c-qy:-d*Ky;var p=t.get("minAngle")*Ky+h,f=0;e.each(i,(function(t){!isNaN(t)&&f++}));var g=e.getSum(i),y=Math.PI/(g||f)*2,m=t.get("clockwise"),v=t.get("roseType"),x=t.get("stillShowZeroSum"),_=e.getDataExtent(i);
- // Sum may be 0
- _[0]=0;var b=m?1:-1,S=[c,d],w=b*h/2;Wt(S,!m),c=S[0],d=S[1];var M=tm(t);M.startAngle=c,M.endAngle=d,M.clockwise=m;var I=Math.abs(d-c),D=I,T=0,C=c;
- // In the case some sector angle is smaller than minAngle
- // Some sector is constrained by minAngle and padAngle
- // Rest sectors needs recalculate angle
- if(e.setLayout({viewRect:o,r:l}),e.each(i,(function(t,n){var i;if(isNaN(t))e.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:m,cx:a,cy:s,r0:u,r:v?NaN:l});else{(
- // FIXME 兼容 2.0 但是 roseType 是 area 的时候才是这样?
- i="area"!==v?0===g&&x?y:t*y:I/f)<p?(i=p,D-=p):T+=t;var o=C+b*i,r=0,c=0;
- // calculate display angle
- h>i?c=r=C+b*i/2:(r=C+w,c=o-w),e.setItemLayout(n,{angle:i,startAngle:r,endAngle:c,clockwise:m,cx:a,cy:s,r0:u,r:v?Xe(t,_,[u,l]):l}),C=o}})),D<qy&&f)
- // Average the angle if rest angle is not enough after all angles is
- // Constrained by minAngle and padAngle
- if(D<=.001){var A=I/f;e.each(i,(function(t,n){if(!isNaN(t)){var i=e.getItemLayout(n);i.angle=A;var o=0,r=0;A<h?r=o=c+b*(n+.5)*A:(o=c+b*n*A+w,r=c+b*(n+1)*A-w),i.startAngle=o,i.endAngle=r}}))}else y=D/T,C=c,e.each(i,(function(t,n){if(!isNaN(t)){var i=e.getItemLayout(n),o=i.angle===p?p:t*y,r=0,a=0;o<h?a=r=C+b*o/2:(r=C+w,a=C+b*o-w),i.startAngle=r,i.endAngle=a,C+=b*o}}))}))}var tm=On();
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */function em(t){return{seriesType:t,reset:function(t,e){var n=e.findComponents({mainType:"legend"});if(n&&n.length){var i=t.getData();i.filterSelf((function(t){
- // If in any legend component the status is not selected.
- for(var e=i.getName(t),o=0;o<n.length;o++)
- // @ts-ignore FIXME: LegendModel
- if(!n[o].isSelected(e))return!1;return!0}))}}}}var nm=Math.PI/180;function im(t,e,n,i,o,r,a,s,l,u){if(!(t.length<2)){for(var c=t.length,d=0;d<c;d++)if("outer"===t[d].position&&"labelLine"===t[d].labelAlignTo){var h=t[d].label.x-u;t[d].linePoints[1][0]+=h,t[d].label.x=u}xg(t,l,l+a)&&
- // Adjust X based on the shifted y. Make tight labels aligned on an ellipse curve.
- function(t){for(
- // Extremes of
- var r={list:[],maxY:0},a={list:[],maxY:0},s=0;s<t.length;s++)if("none"===t[s].labelAlignTo){var l=t[s],u=l.label.y>n?a:r,c=Math.abs(l.label.y-n);if(c>=u.maxY){var d=l.label.x-e-l.len2*o,h=i+l.len,f=Math.abs(d)<h?Math.sqrt(c*c/(1-d*d/h/h)):h;
- // horizontal r is always same with original r because x is not changed.
- u.rB=f,u.maxY=c}u.list.push(l)}p(r),p(a)}(t)}function p(t){for(var r=t.rB,a=r*r,s=0;s<t.list.length;s++){var l=t.list[s],u=Math.abs(l.label.y-n),c=i+l.len,d=c*c,h=Math.sqrt(Math.abs((1-u*u/a)*d)),p=e+(h+l.len2)*o,f=p-l.label.x;
- // text x is changed, so need to recalculate width.
- om(l,l.targetTextWidth-f*o,!0),l.label.x=p}}}
- /**
- * Set max width of each label, and then wrap each label to the max width.
- *
- * @param layout label layout
- * @param availableWidth max width for the label to display
- * @param forceRecalculate recaculate the text layout even if the current width
- * is smaller than `availableWidth`. This is useful when the text was previously
- * wrapped by calling `constrainTextWidth` but now `availableWidth` changed, in
- * which case, previous wrapping should be redo.
- */
- function om(t,e,n){if(void 0===n&&(n=!1),null==t.labelStyleWidth){var i=t.label,o=i.style,r=t.rect,a=o.backgroundColor,s=o.padding,l=s?s[1]+s[3]:0,u=o.overflow,c=r.width+(a?0:l);if(e<c||n){var d=r.height;if(u&&u.match("break")){
- // Temporarily set background to be null to calculate
- // the bounding box without background.
- i.setStyle("backgroundColor",null),
- // Set constraining width
- i.setStyle("width",e-l);
- // This is the real bounding box of the text without padding.
- var h=i.getBoundingRect();i.setStyle("width",Math.ceil(h.width)),i.setStyle("backgroundColor",a)}else{var p=e-l,f=e<c?p:
- // Current available width is enough, but the text may have
- // already been wrapped with a smaller available width.
- n?p>t.unconstrainedWidth?null:p:null;i.setStyle("width",f)}var g=i.getBoundingRect();r.width=g.width;var y=(i.style.margin||0)+2.1;r.height=g.height+y,r.y-=(r.height-d)/2}}}function rm(t){
- // Not change x for center label
- return"center"===t.position}function am(t){var e,n,i=t.getData(),o=[],r=!1,s=(t.get("minShowLabelAngle")||0)*nm,u=i.getLayout("viewRect"),c=i.getLayout("r"),d=u.width,h=u.x,p=u.y,f=u.height;function g(t){t.ignore=!0}i.each((function(t){var u=i.getItemGraphicEl(t),p=u.shape,f=u.getTextContent(),y=u.getTextGuideLine(),m=i.getItemModel(t),v=m.getModel("label"),x=v.get("position")||m.get(["emphasis","label","position"]),_=v.get("distanceToLabelLine"),b=v.get("alignTo"),S=je(v.get("edgeDistance"),d),w=v.get("bleedMargin"),M=m.getModel("labelLine"),I=M.get("length");I=je(I,d);var D=M.get("length2");if(D=je(D,d),Math.abs(p.endAngle-p.startAngle)<s)return a(f.states,g),f.ignore=!0,void(y&&(a(y.states,g),y.ignore=!0));if(function(t){if(!t.ignore)return!0;for(var e in t.states)if(!1===t.states[e].ignore)return!0;return!1}(f)){var T,C,A,L,k=(p.startAngle+p.endAngle)/2,P=Math.cos(k),N=Math.sin(k);e=p.cx,n=p.cy;var O="inside"===x||"inner"===x;if("center"===x)T=p.cx,C=p.cy,L="center";else{var R=(O?(p.r+p.r0)/2*P:p.r*P)+e,E=(O?(p.r+p.r0)/2*N:p.r*N)+n;if(T=R+3*P,C=E+3*N,!O){
- // For roseType
- var V=R+P*(I+c-p.r),z=E+N*(I+c-p.r),B=V+(P<0?-1:1)*D;
- // Adjust textX because text align of edge is opposite
- T="edge"===b?P<0?h+S:h+d-S:B+(P<0?-_:_),C=z,A=[[R,E],[V,z],[B,z]]}L=O?"center":"edge"===b?P>0?"right":"left":P>0?"left":"right"}var G=Math.PI,F=0,W=v.get("rotate");if(l(W))F=W*(G/180);else if("center"===x)F=0;else if("radial"===W||!0===W){F=P<0?-k+G:-k}else if("tangential"===W&&"outside"!==x&&"outer"!==x){var H=Math.atan2(P,N);H<0&&(H=2*G+H),N>0&&(H=G+H),F=H-G}
- // Not sectorShape the inside label
- if(r=!!F,f.x=T,f.y=C,f.rotation=F,f.setStyle({verticalAlign:"middle"}),O){f.setStyle({align:L});var Y=f.states.select;Y&&(Y.x+=f.x,Y.y+=f.y)}else{var U=f.getBoundingRect().clone();U.applyTransform(f.getComputedTransform());
- // Text has a default 1px stroke. Exclude this.
- var Z=(f.style.margin||0)+2.1;U.y-=Z/2,U.height+=Z,o.push({label:f,labelLine:y,position:x,len:I,len2:D,minTurnAngle:M.get("minTurnAngle"),maxSurfaceAngle:M.get("maxSurfaceAngle"),surfaceNormal:new K(P,N),linePoints:A,textAlign:L,labelDistance:_,labelAlignTo:b,edgeDistance:S,bleedMargin:w,rect:U,unconstrainedWidth:U.width,labelStyleWidth:f.style.width})}u.setTextConfig({inside:O})}})),!r&&t.get("avoidLabelOverlap")&&function(t,e,n,i,o,r,a,s){for(var l=[],u=[],c=Number.MAX_VALUE,d=-Number.MAX_VALUE,h=0;h<t.length;h++){var p=t[h].label;rm(t[h])||(p.x<e?(c=Math.min(c,p.x),l.push(t[h])):(d=Math.max(d,p.x),u.push(t[h])))}for(h=0;h<t.length;h++)if(!rm(y=t[h])&&y.linePoints){if(null!=y.labelStyleWidth)continue;p=y.label;var f=y.linePoints,g=void 0;g="edge"===y.labelAlignTo?p.x<e?f[2][0]-y.labelDistance-a-y.edgeDistance:a+o-y.edgeDistance-f[2][0]-y.labelDistance:"labelLine"===y.labelAlignTo?p.x<e?c-a-y.bleedMargin:a+o-d-y.bleedMargin:p.x<e?p.x-a-y.bleedMargin:a+o-p.x-y.bleedMargin,y.targetTextWidth=g,om(y,g)}for(im(u,e,n,i,1,0,r,0,s,d),im(l,e,n,i,-1,0,r,0,s,c),h=0;h<t.length;h++){var y;if(!rm(y=t[h])&&y.linePoints){p=y.label,f=y.linePoints;var m="edge"===y.labelAlignTo,v=p.style.padding,x=v?v[1]+v[3]:0,_=p.style.backgroundColor?0:x,b=y.rect.width+_,S=f[1][0]-f[2][0];m?p.x<e?f[2][0]=a+y.edgeDistance+b+y.labelDistance:f[2][0]=a+o-y.edgeDistance-b-y.labelDistance:(p.x<e?f[2][0]=p.x+y.labelDistance:f[2][0]=p.x-y.labelDistance,f[1][0]=f[2][0]+S),f[1][1]=f[2][1]=p.y}}}(o,e,n,c,d,f,h,p);for(var y=0;y<o.length;y++){var m=o[y],v=m.label,x=m.labelLine,_=isNaN(v.x)||isNaN(v.y);if(v){v.setStyle({align:m.textAlign}),_&&(a(v.states,g),v.ignore=!0);var b=v.states.select;b&&(b.x+=v.x,b.y+=v.y)}if(x){var S=m.linePoints;_||!S?(a(x.states,g),x.ignore=!0):(dg(S,m.minTurnAngle),hg(S,m.surfaceNormal,m.maxSurfaceAngle),x.setShape({points:S}),
- // Set the anchor to the midpoint of sector
- v.__hostTarget.textGuideLineConfig={anchor:new K(S[0][0],S[0][1])})}}}
- /**
- * Piece of pie including Sector, Label, LabelLine
- */var sm=/** @class */function(t){function e(e,n,i){var o=t.call(this)||this;o.z2=2;var r=new $;return o.setTextContent(r),o.updateData(e,n,i,!0),o}return Ue(e,t),e.prototype.updateData=function(t,e,n,i){var o=this,r=t.hostModel,a=t.getItemModel(e),s=a.getModel("emphasis"),l=t.getItemLayout(e),u=p(Ay(a.getModel("itemStyle"),l,!0),l);
- // Ignore NaN data.
- if(isNaN(u.startAngle))
- // Use NaN shape to avoid drawing shape.
- o.setShape(u);else{if(i){o.setShape(u);var c=r.getShallow("animationType");r.ecModel.ssr?(
- // Use scale animation in SSR mode(opacity?)
- // Because CSS SVG animation doesn't support very customized shape animation.
- oo(o,{scaleX:0,scaleY:0},r,{dataIndex:e,isFrom:!0}),o.originX=u.cx,o.originY=u.cy):"scale"===c?(o.shape.r=l.r0,oo(o,{shape:{r:l.r}},r,e)):null!=n?(o.setShape({startAngle:n,endAngle:n}),oo(o,{shape:{startAngle:l.startAngle,endAngle:l.endAngle}},r,e)):(o.shape.endAngle=l.startAngle,io(o,{shape:{endAngle:l.endAngle}},r,e))}else uo(o),
- // Transition animation from the old shape
- io(o,{shape:u},r,e);o.useStyle(t.getItemVisual(e,"style")),qi(o,a);var d=(l.startAngle+l.endAngle)/2,h=r.get("selectedOffset"),f=Math.cos(d)*h,g=Math.sin(d)*h,y=a.getShallow("cursor");y&&o.attr("cursor",y),this._updateLabel(r,t,e),o.ensureState("emphasis").shape=p({r:l.r+(s.get("scale")&&s.get("scaleSize")||0)},Ay(s.getModel("itemStyle"),l)),p(o.ensureState("select"),{x:f,y:g,shape:Ay(a.getModel(["select","itemStyle"]),l)}),p(o.ensureState("blur"),{shape:Ay(a.getModel(["blur","itemStyle"]),l)});var m=o.getTextGuideLine(),v=o.getTextContent();m&&p(m.ensureState("select"),{x:f,y:g}),
- // TODO: needs dx, dy in zrender?
- p(v.ensureState("select"),{x:f,y:g}),Ui(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))}},e.prototype._updateLabel=function(t,e,n){var i=this,o=e.getItemModel(n),r=o.getModel("labelLine"),a=e.getItemVisual(n,"style"),s=a&&a.fill,l=a&&a.opacity;Yo(i,Uo(o),{labelFetcher:e.hostModel,labelDataIndex:n,inheritColor:s,defaultOpacity:l,defaultText:t.getFormattedLabel(n,"normal")||e.getName(n)});var u=i.getTextContent();
- // Set textConfig on sector.
- i.setTextConfig({
- // reset position, rotation
- position:null,rotation:null}),
- // Make sure update style on labelText after setLabelStyle.
- // Because setLabelStyle will replace a new style on it.
- u.attr({z2:10});var c=t.get(["label","position"]);if("outside"!==c&&"outer"!==c)i.removeTextGuideLine();else{var d=this.getTextGuideLine();d||(d=new B,this.setTextGuideLine(d)),
- // Default use item visual color
- gg(this,yg(o),{stroke:s,opacity:Ht(r.get(["lineStyle","opacity"]),l,1)})}},e}(E);
- // Pie view
- const lm=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ignoreLabelLineUpdate=!0,e}return Ue(e,t),e.prototype.render=function(t,e,n,i){var o,r=t.getData(),a=this._data,s=this.group;
- // First render
- if(!a&&r.count()>0){for(var l=r.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u<r.count();++u)l=r.getItemLayout(u);l&&(o=l.startAngle)}
- // remove empty-circle if it exists
- // when all data are filtered, show lightgray empty circle
- if(this._emptyCircleSector&&s.remove(this._emptyCircleSector),0===r.count()&&t.get("showEmptyCircle")){var c=tm(t),d=new E({shape:p($y(t,n),c)});d.useStyle(t.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=d,s.add(d)}r.diff(a).add((function(t){var e=new sm(r,t,o);r.setItemGraphicEl(t,e),s.add(e)})).update((function(t,e){var n=a.getItemGraphicEl(e);n.updateData(r,t,o),n.off("click"),s.add(n),r.setItemGraphicEl(t,n)})).remove((function(e){lo(a.getItemGraphicEl(e),t,e)})).execute(),am(t),
- // Always use initial animation.
- "expansion"!==t.get("animationTypeUpdate")&&(this._data=r)},e.prototype.dispose=function(){},e.prototype.containPoint=function(t,e){var n=e.getData().getItemLayout(0);if(n){var i=t[0]-n.cx,o=t[1]-n.cy,r=Math.sqrt(i*i+o*o);return r<=n.r&&r>=n.r0}},e.type="pie",e}(Ou);
- /**
- * [Usage]:
- * (1)
- * createListSimply(seriesModel, ['value']);
- * (2)
- * createListSimply(seriesModel, {
- * coordDimensions: ['value'],
- * dimensionsCount: 5
- * });
- */function um(t,e,n){e=i(e)&&{coordDimensions:e}||p({encodeDefine:t.getEncode()},e);var o=t.getSource(),r=Hh(o,e).dimensions,a=new Fh(r,t);return a.initData(o,n),a}
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * LegendVisualProvider is an bridge that pick encoded color from data and
- * provide to the legend component.
- */var cm=/** @class */function(){function t(
- // Function to get data after filtered. It stores all the encoding info
- t,
- // Function to get raw data before filtered.
- e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();
- // We find the name from the raw data. In case it's filtered by the legend component.
- // Normally, the name can be found in rawData, but can't be found in filtered data will display as gray.
- return t.mapArray(t.getName)},t.prototype.containName=function(t){return this._getRawData().indexOfName(t)>=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}();const dm=cm;var hm=On();const pm=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}
- /**
- * @overwrite
- */return Ue(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),
- // Enable legend selection for each data item
- // Use a function instead of direct access because data reference may changed
- this.legendVisualProvider=new dm(lt(this.getData,this),lt(this.getRawData,this)),this._defaultLabelLine(e)},
- /**
- * @overwrite
- */
- e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},
- /**
- * @overwrite
- */
- e.prototype.getInitialData=function(){return um(this,{coordDimensions:["value"],encodeDefaulter:rt(Ua,this)})},
- /**
- * @overwrite
- */
- e.prototype.getDataParams=function(e){var n=this.getData(),i=hm(n),o=i.seats;
- // update seats when data is changed
- if(!o){var r=[];n.each(n.mapDimension("value"),(function(t){r.push(t)})),o=i.seats=tn(r,n.hostModel.get("percentPrecision"))}var a=t.prototype.getDataParams.call(this,e);
- // seats may be empty when sum is 0
- return a.percent=o[e]||0,a.$vars.push("percent"),a},e.prototype._defaultLabelLine=function(t){
- // Extend labelLine emphasis
- wn(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;
- // Not show label line if `label.normal.show = false`
- e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={
- // zlevel: 0,
- z:2,legendHoverLink:!0,colorBy:"data",
- // 默认全局居中
- center:["50%","50%"],radius:[0,"75%"],
- // 默认顺时针
- clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,
- // 最小角度改为0
- minAngle:0,
- // If the angle of a sector less than `minShowLabelAngle`,
- // the label will not be displayed.
- minShowLabelAngle:0,
- // 选中时扇区偏移量
- selectedOffset:10,
- // 选择模式,默认关闭,可选single,multiple
- // selectedMode: false,
- // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积)
- // roseType: null,
- percentPrecision:2,
- // If still show when all data zero.
- stillShowZeroSum:!0,
- // cursor: null,
- left:0,top:0,right:0,bottom:0,width:null,height:null,label:{
- // color: 'inherit',
- // If rotate around circle
- rotate:0,show:!0,overflow:"truncate",
- // 'outer', 'inside', 'center'
- position:"outer",
- // 'none', 'labelLine', 'edge'. Works only when position is 'outer'
- alignTo:"none",
- // Closest distance between label and chart edge.
- // Works only position is 'outer' and alignTo is 'edge'.
- edgeDistance:"25%",
- // Works only position is 'outer' and alignTo is not 'edge'.
- bleedMargin:10,
- // Distance between text and label line.
- distanceToLabelLine:5},
- // Enabled when label.normal.position is 'outer'
- labelLine:{show:!0,
- // 引导线两段中的第一段长度
- length:15,
- // 引导线两段中的第二段长度
- length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{
- // color: 各异,
- width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{
- // Hide the overlapped label.
- hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},
- // If use strategy to avoid label overlapping
- avoidLabelOverlap:!0,
- // Animation type. Valid values: expansion, scale
- animationType:"expansion",animationDuration:1e3,
- // Animation type when update. Valid values: transition, expansion
- animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(Su);const fm=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return Ue(e,t),e.prototype.getInitialData=function(t,e){return Jh(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},e.prototype.getZLevelKey=function(){
- // Each progressive series has individual key.
- return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",
- // zlevel: 0,
- z:2,legendHoverLink:!0,symbolSize:10,
- // symbolRotate: null, // 图形旋转控制
- large:!1,
- // Available when large is true
- largeThreshold:2e3,
- // cursor: null,
- itemStyle:{opacity:.8},emphasis:{scale:!0},
- // If clip the overflow graphics
- // Works on cartesian / polar series
- clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(Su);var gm=function(){},ym=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new gm},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,e){var n,i=e.points,o=e.size,r=this.symbolProxy,a=r.shape,s=t.getContext?t.getContext():t,l=s&&o[0]<4,u=this.softClipShape;
- // Do draw in afterBrush.
- if(l)this._ctx=s;else{for(this._ctx=null,n=this._off;n<i.length;){var c=i[n++],d=i[n++];isNaN(c)||isNaN(d)||(u&&!u.contain(c,d)||(a.x=c-o[0]/2,a.y=d-o[1]/2,a.width=o[0],a.height=o[1],r.buildPath(t,a,!0)))}this.incremental&&(this._off=n,this.notClear=!0)}},e.prototype.afterBrush=function(){var t,e=this.shape,n=e.points,i=e.size,o=this._ctx,r=this.softClipShape;if(o){
- // PENDING If style or other canvas status changed?
- for(t=this._off;t<n.length;){var a=n[t++],s=n[t++];isNaN(a)||isNaN(s)||(r&&!r.contain(a,s)||
- // fillRect is faster than building a rect path and draw.
- // And it support light globalCompositeOperation.
- o.fillRect(a-i[0]/2,s-i[1]/2,i[0],i[1]))}this.incremental&&(this._off=t,this.notClear=!0)}},e.prototype.findDataIndex=function(t,e){
- // Not consider transform
- // Treat each element as a rect
- // top down traverse
- for(
- // TODO ???
- // Consider transform
- var n=this.shape,i=n.points,o=n.size,r=Math.max(o[0],4),a=Math.max(o[1],4),s=i.length/2-1;s>=0;s--){var l=2*s,u=i[l]-r/2,c=i[l+1]-a/2;if(t>=u&&e>=c&&t<=u+r&&e<=c+a)return s}return-1},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect();return t=n[0],e=n[1],i.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},e.prototype.getBoundingRect=function(){
- // Ignore stroke for large symbol draw.
- var t=this._rect;if(!t){for(var e=this.shape,n=e.points,i=e.size,o=i[0],r=i[1],a=Infinity,s=Infinity,l=-Infinity,u=-Infinity,c=0;c<n.length;){var d=n[c++],h=n[c++];a=Math.min(d,a),l=Math.max(d,l),s=Math.min(h,s),u=Math.max(h,u)}t=this._rect=new Y(a-o/2,s-r/2,l-a+o,u-s+r)}return t},e}(g),mm=/** @class */function(){function t(){this.group=new Z}
- /**
- * Update symbols draw by new data
- */return t.prototype.updateData=function(t,e){this._clear();var n=this._create();n.setShape({points:t.getLayout("points")}),this._setCommon(n,t,e)},t.prototype.updateLayout=function(t){var e=t.getLayout("points");this.group.eachChild((function(t){if(null!=t.startIndex){var n=2*(t.endIndex-t.startIndex),i=4*t.startIndex*2;e=new Float32Array(e.buffer,i,n)}t.setShape("points",e),
- // Reset draw cursor.
- t.reset()}))},t.prototype.incrementalPrepareUpdate=function(t){this._clear()},t.prototype.incrementalUpdate=function(t,e,n){var i=this._newAdded[0],o=e.getLayout("points"),r=i&&i.shape.points;
- // Merging the exists. Each element has 1e4 points.
- // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization)
- if(r&&r.length<2e4){var a=r.length,s=new Float32Array(a+o.length);
- // Concat two array
- s.set(r),s.set(o,a),
- // Update endIndex
- i.endIndex=t.end,i.setShape({points:s})}else{
- // Clear
- this._newAdded=[];var l=this._create();l.startIndex=t.start,l.endIndex=t.end,l.incremental=!0,l.setShape({points:o}),this._setCommon(l,e,n)}},t.prototype.eachRendered=function(t){this._newAdded[0]&&t(this._newAdded[0])},t.prototype._create=function(){var t=new ym({cursor:"default"});return t.ignoreCoarsePointer=!0,this.group.add(t),this._newAdded.push(t),t},t.prototype._setCommon=function(t,e,n){var i=e.hostModel;n=n||{};var o=e.getVisual("symbolSize");t.setShape("size",o instanceof Array?o:[o,o]),t.softClipShape=n.clipShape||null,
- // Create symbolProxy to build path for each data
- t.symbolProxy=Gc(e.getVisual("symbol"),0,0,0,0),
- // Use symbolProxy setColor method
- t.setColor=t.symbolProxy.setColor;var r=t.shape.size[0]<4;t.useStyle(
- // Draw shadow when doing fillRect is extremely slow.
- i.getModel("itemStyle").getItemStyle(r?["color","shadowBlur","shadowColor"]:["color"]));var a=e.getVisual("style"),s=a&&a.fill;s&&t.setColor(s);var l=ni(t);
- // Enable tooltip
- // PENDING May have performance issue when path is extremely large
- l.seriesIndex=i.seriesIndex,t.on("mousemove",(function(e){l.dataIndex=null;var n=t.hoverDataIdx;n>=0&&(
- // Provide dataIndex for tooltip
- l.dataIndex=n+(t.startIndex||0))}))},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();const vm=mm;const xm=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).updateData(i,{
- // TODO
- // If this parameter should be a shape or a bounding volume
- // shape will be more general.
- // But bounding volume like bounding rect will be much faster in the contain calculation
- clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).incrementalPrepareUpdate(i),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},e.prototype.updateTransform=function(t,e,n){var i=t.getData();
- // Must mark group dirty and make sure the incremental layer will be cleared
- // PENDING
- if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var o=my("").reset(t,e,n);o.progress&&o.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){if(t.get("clip",!0)){var e=t.coordinateSystem;
- // PENDING make `0.1` configurable, for example, `clipTolerance`?
- return e&&e.getArea&&e.getArea(.1)}},e.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,i=e.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new vm:new Yg,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(Ou);const _m=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,
- // zlevel: 0,
- z:0,left:"10%",top:60,right:"10%",bottom:70,
- // If grid size contain label
- containLabel:!1,
- // width: {totalWidth} - left - right,
- // height: {totalHeight} - top - bottom,
- backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Ta);var bm=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",zn).models[0]},e.type="cartesian2dAxis",e}(Ta);nt(bm,df);var Sm={show:!0,
- // zlevel: 0,
- z:0,
- // Inverse the axis.
- inverse:!1,
- // Axis name displayed.
- name:"",
- // 'start' | 'middle' | 'end'
- nameLocation:"end",
- // By degree. By default auto rotate by nameLocation.
- nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},
- // Use global text style by default.
- nameTextStyle:{},
- // The gap between axisName and axisLine.
- nameGap:15,
- // Default `false` to support tooltip.
- silent:!1,
- // Default `false` to avoid legacy user event listener fail.
- triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},
- // The arrow at both ends the the axis.
- symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,
- // Whether axisTick is inside the grid or outside the grid.
- inside:!1,
- // The length of axisTick.
- length:5,lineStyle:{width:1}},axisLabel:{show:!0,
- // Whether axisLabel is inside the grid or outside the grid.
- inside:!1,rotate:0,
- // true | false | null/undefined (auto)
- showMinLabel:null,
- // true | false | null/undefined (auto)
- showMaxLabel:null,margin:8,
- // formatter: null,
- fontSize:12},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},wm=tt({
- // The gap at both ends of the axis. For categoryAxis, boolean.
- boundaryGap:!0,
- // Set false to faster category collection.
- deduplication:null,
- // splitArea: {
- // show: false
- // },
- splitLine:{show:!1},axisTick:{
- // If tick is align with label when boundaryGap is true
- alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},Sm),Mm=tt({boundaryGap:[0,0],axisLine:{
- // Not shown when other axis is categoryAxis in cartesian
- show:"auto"},axisTick:{
- // Not shown when other axis is categoryAxis in cartesian
- show:"auto"},
- // TODO
- // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]
- splitNumber:5,minorTick:{
- // Minor tick, not available for cateogry axis.
- show:!1,
- // Split number of minor ticks. The value should be in range of (0, 100)
- splitNumber:5,
- // Length of minor tick
- length:3,
- // Line style
- lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},Sm);const Im={category:wm,value:Mm,time:tt({splitNumber:6,axisLabel:{
- // To eliminate labels that are not nice
- showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},Mm),log:I({logBase:10},Mm)};
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */var Dm={value:1,category:1,time:1,log:1};
- /**
- * Generate sub axis model class
- * @param axisName 'x' 'y' 'radius' 'angle' 'parallel' ...
- */function Tm(t,e,n,i){a(Dm,(function(o,r){var a=tt(tt({},Im[r],!0),i,!0),s=/** @class */function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e+"Axis."+r,n}return Ue(n,t),n.prototype.mergeDefaultAndTheme=function(t,e){var n=ba(this),i=n?wa(t):{},o=e.getTheme();tt(t,o.get(r+"Axis")),tt(t,this.getDefaultOption()),t.type=Cm(t),n&&Sa(t,i,n)},n.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=ip.createByAxisModel(this))},
- /**
- * Should not be called before all of 'getInitailData' finished.
- * Because categories are collected during initializing data.
- */
- n.prototype.getCategories=function(t){var e=this.option;
- // FIXME
- // warning if called before all of 'getInitailData' finished.
- if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.type=e+"Axis."+r,n.defaultOption=a,n}(n);t.registerComponentModel(s)})),t.registerSubTypeDefaulter(e+"Axis",Cm)}function Cm(t){
- // Default axis with data is category axis
- return t.type||(t.data?"category":"value")}var Am=/** @class */function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return n(this._dimList,(function(t){return this._axes[t]}),this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),st(this.getAxes(),(function(e){return e.scale.type===t}))},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}();var Lm=["x","y"];function km(t){return"interval"===t.type||"time"===t.type}var Pm=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=Lm,e}
- /**
- * Calculate an affine transform matrix if two axes are time or value.
- * It's mainly for accelartion on the large time series data.
- */return Ue(e,t),e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(km(t)&&km(e)){var n=t.getExtent(),i=e.getExtent(),o=this.dataToPoint([n[0],i[0]]),r=this.dataToPoint([n[1],i[1]]),a=n[1]-n[0],s=i[1]-i[0];if(a&&s){
- // Accelerate data to point calculation on the special large time series data.
- var l=(r[0]-o[0])/a,u=(r[1]-o[1])/s,c=o[0]-n[0]*l,d=o[1]-i[0]*u,h=this._transform=[l,0,0,u,c,d];this._invTransform=k([],h)}}},
- /**
- * Base axis will be used on stacking.
- */
- e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,e){var n=this.dataToPoint(t),i=this.dataToPoint(e),o=this.getArea(),r=new Y(n[0],n[1],i[0]-n[0],i[1]-n[1]);return o.intersect(r)},e.prototype.dataToPoint=function(t,e,n){n=n||[];var i=t[0],o=t[1];
- // Fast path
- if(this._transform&&null!=i&&isFinite(i)&&null!=o&&isFinite(o))return P(n,t,this._transform);var r=this.getAxis("x"),a=this.getAxis("y");return n[0]=r.toGlobalCoord(r.dataToCoord(i,e)),n[1]=a.toGlobalCoord(a.dataToCoord(o,e)),n},e.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,o=n.getExtent(),r=i.getExtent(),a=n.parse(t[0]),s=i.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(o[0],o[1]),a),Math.max(o[0],o[1])),e[1]=Math.min(Math.max(Math.min(r[0],r[1]),s),Math.max(r[0],r[1])),e},e.prototype.pointToData=function(t,e){var n=[];if(this._invTransform)return P(n,t,this._invTransform);var i=this.getAxis("x"),o=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(t[0]),e),n[1]=o.coordToData(o.toLocalCoord(t[1]),e),n},e.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},
- /**
- * Get rect area of cartesian.
- * Area will have a contain function to determine if a point is in the coordinate system.
- */
- e.prototype.getArea=function(t){t=t||0;var e=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),i=Math.min(e[0],e[1])-t,o=Math.min(n[0],n[1])-t,r=Math.max(e[0],e[1])-i+t,a=Math.max(n[0],n[1])-o+t;return new Y(i,o,r,a)},e}(Am),Nm=/** @class */function(t){function e(e,n,i,o,r){var a=t.call(this,e,n,i)||this;
- /**
- * Index of axis, can be used as key
- * Injected outside.
- */return a.index=0,a.type=o||"value",a.position=r||"bottom",a}return Ue(e,t),e.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},
- /**
- * Each item cooresponds to this.getExtent(), which
- * means globalExtent[0] may greater than globalExtent[1],
- * unless `asc` is input.
- *
- * @param {boolean} [asc]
- * @return {Array.<number>}
- */
- e.prototype.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},e.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},
- /**
- * Set ordinalSortInfo
- * @param info new OrdinalSortInfo
- */
- e.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(Yf);const Om=Nm;
- /**
- * Can only be called after coordinate system creation stage.
- * (Can be called before coordinate system update stage).
- */function Rm(t,e,n){n=n||{};var i=t.coordinateSystem,o=e.axis,r={},a=o.getAxesOnZeroOf()[0],s=o.position,l=a?"onZero":s,u=o.dim,c=i.getRect(),d=[c.x,c.x+c.width,c.y,c.y+c.height],h={left:0,right:1,top:0,bottom:1,onZero:2},p=e.get("offset")||0,f="x"===u?[d[2]-p,d[3]+p]:[d[0]-p,d[1]+p];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));f[h.onZero]=Math.max(Math.min(g,f[1]),f[0])}
- // Axis position
- r.position=["y"===u?f[h[l]]:d[0],"x"===u?f[h[l]]:d[3]],
- // Axis rotation
- r.rotation=Math.PI/2*("x"===u?0:1);r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],r.labelOffset=a?f[h[s]]-f[h.onZero]:0,e.get(["axisTick","inside"])&&(r.tickDirection=-r.tickDirection),Yt(n.labelInside,e.get(["axisLabel","inside"]))&&(r.labelDirection=-r.labelDirection);
- // Special label rotation
- var y=e.get(["axisLabel","rotate"]);return r.labelRotate="top"===l?-y:y,
- // Over splitLine and splitArea
- r.z2=1,r}function Em(t){return"cartesian2d"===t.get("coordinateSystem")}function Vm(t){var e={xAxisModel:null,yAxisModel:null};return a(e,(function(n,i){var o=i.replace(/Model$/,""),r=t.getReferringComponents(o,zn).models[0];e[i]=r})),e}var zm=Math.log;function Bm(t,e,n){var i=yp.prototype,o=i.getTicks.call(n),r=i.getTicks.call(n,!0),a=o.length-1,s=i.getInterval.call(n),l=ef(t,e),u=l.extent,c=l.fixMin,d=l.fixMax;
- // NOTE: There is a precondition for log scale here:
- // In log scale we store _interval and _extent of exponent value.
- // So if we use the method of InternalScale to set/get these data.
- // It process the exponent value, which is linear and what we want here.
- if("log"===t.type){var h=zm(t.base);u=[zm(u[0])/h,zm(u[1])/h]}t.setExtent(u[0],u[1]),t.calcNiceExtent({splitNumber:a,fixMin:c,fixMax:d});var p=i.getExtent.call(t);
- // Need to update the rawExtent.
- // Because value in rawExtent may be not parsed. e.g. 'dataMin', 'dataMax'
- c&&(u[0]=p[0]),d&&(u[1]=p[1]);var f=i.getInterval.call(t),g=u[0],y=u[1];if(c&&d)
- // User set min, max, divide to get new interval
- f=(y-g)/a;else if(c)
- // User set min, expand extent on the other side
- for(y=u[0]+f*a;y<u[1]&&isFinite(y)&&isFinite(u[1]);)f=ap(f),y=u[0]+f*a;else if(d)for(
- // User set max, expand extent on the other side
- g=u[1]-f*a;g>u[0]&&isFinite(g)&&isFinite(u[0]);)f=ap(f),g=u[1]-f*a;else{t.getTicks().length-1>a&&(f=ap(f));var m=f*a;
- // Not change the result that crossing zero.
- (g=qe((y=Math.ceil(u[1]/f)*f)-m))<0&&u[0]>=0?(g=0,y=qe(m)):y>0&&u[1]<=0&&(y=0,g=-qe(m))}
- // Adjust min, max based on the extent of alignTo. When min or max is set in alignTo scale
- var v=(o[0].value-r[0].value)/s,x=(o[a].value-r[a].value)/s;
- // NOTE: Must in setExtent -> setInterval -> setNiceExtent order.
- i.setExtent.call(t,g+f*v,y+f*x),i.setInterval.call(t,f),(v||x)&&i.setNiceExtent.call(t,g+f,y-f)}var Gm=/** @class */function(){function t(t,e,n){
- // FIXME:TS where used (different from registered type 'cartesian2d')?
- this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=Lm,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){var n=this._axesMap;function i(t){var e,n=v(t),i=n.length;
- // Axis is added in order of axisIndex.
- if(i){
- // Process once and calculate the ticks for those don't use alignTicks.
- for(var o=[],r=i-1;r>=0;r--){var s=t[+n[r]],l=s.model,u=s.scale;// Convert to number.
- // Only value and log axis without interval support alignTicks.
- op(u)&&l.get("alignTicks")&&null==l.get("interval")?o.push(s):(nf(u,l),op(u)&&(
- // Can only align to interval or log axis.
- e=s))}
- // All axes has set alignTicks. Pick the first one.
- // PENDING. Should we find the axis that both set interval, min, max and align to this one?
- o.length&&(e||nf((e=o.pop()).scale,e.model),a(o,(function(t){Bm(t.scale,t.model,e.scale)})))}}this._updateScale(t,this.model),i(n.x),i(n.y);
- // Key: axisDim_axisIndex, value: boolean, whether onZero target.
- var o={};a(n.x,(function(t){Wm(n,"y",t,o)})),a(n.y,(function(t){Wm(n,"x",t,o)})),
- // Resize again if containLabel is enabled
- // FIXME It may cause getting wrong grid size in data processing stage
- this.resize(this.model,e)},
- /**
- * Resize the grid
- */
- t.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),o=!n&&t.get("containLabel"),r=xa(i,{width:e.getWidth(),height:e.getHeight()});this._rect=r;var s=this._axesList;function l(){a(s,(function(t){var e=t.isHorizontal(),n=e?[0,r.width]:[0,r.height],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),function(t,e){var n=t.getExtent(),i=n[0]+n[1];
- // Fast transform
- t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return i-t+e}}(t,e?r.x:r.y)}))}l(),
- // Minus label size
- o&&(a(s,(function(t){if(!t.model.get(["axisLabel","inside"])){var e=function(t){var e=t.model,n=t.scale;if(e.get(["axisLabel","show"])&&!n.isBlank()){var i,o,r=n.getExtent();
- // Optimize for large category data, avoid call `getTicks()`.
- o=n instanceof pp?n.count():(i=n.getTicks()).length;var a,s=t.getLabelModel(),l=rf(t),u=1;
- // Simple optimization for large amount of labels
- o>40&&(u=Math.ceil(o/40));for(var c=0;c<o;c+=u){var d=l(i?i[c]:{value:r[0]+c},c),h=sf(s.getTextRect(d),s.get("rotate")||0);a?a.union(h):a=h}return a}}(t);if(e){var n=t.isHorizontal()?"height":"width",i=t.model.get(["axisLabel","margin"]);r[n]-=e[n]+i,"top"===t.position?r.y+=e.height+i:"left"===t.position&&(r.x+=e.width+i)}}})),l()),a(this._coordsList,(function(t){
- // Calculate affine matrix to accelerate the data to point transform.
- // If all the axes scales are time or value.
- t.calcAffineTransform()}))},t.prototype.getAxis=function(t,e){var n=this._axesMap[t];if(null!=n)return n[e||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}o(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,r=this._coordsList;i<r.length;i++)if(r[i].getAxis("x").index===t||r[i].getAxis("y").index===e)return r[i]},t.prototype.getCartesians=function(){return this._coordsList.slice()},
- /**
- * @implements
- */
- t.prototype.convertToPixel=function(t,e,n){var i=this._findConvertTarget(e);return i.cartesian?i.cartesian.dataToPoint(n):i.axis?i.axis.toGlobalCoord(i.axis.dataToCoord(n)):null},
- /**
- * @implements
- */
- t.prototype.convertFromPixel=function(t,e,n){var i=this._findConvertTarget(e);return i.cartesian?i.cartesian.pointToData(n):i.axis?i.axis.coordToData(i.axis.toLocalCoord(n)):null},t.prototype._findConvertTarget=function(t){var e,n,i=t.seriesModel,o=t.xAxisModel||i&&i.getReferringComponents("xAxis",zn).models[0],r=t.yAxisModel||i&&i.getReferringComponents("yAxis",zn).models[0],a=t.gridModel,s=this._coordsList;if(i)e=i.coordinateSystem,c(s,e)<0&&(e=null);else if(o&&r)e=this.getCartesian(o.componentIndex,r.componentIndex);else if(o)n=this.getAxis("x",o.componentIndex);else if(r)n=this.getAxis("y",r.componentIndex);else if(a){a.coordinateSystem===this&&(e=this._coordsList[0])}return{cartesian:e,axis:n}},
- /**
- * @implements
- */
- t.prototype.containPoint=function(t){var e=this._coordsList[0];if(e)return e.containPoint(t)},
- /**
- * Initialize cartesian coordinate systems
- */
- t.prototype._initCartesian=function(t,e,n){var i=this,o=this,r={left:!1,right:!1,top:!1,bottom:!1},s={x:{},y:{}},l={x:0,y:0};if(
- // Create axis
- e.eachComponent("xAxis",u("x"),this),e.eachComponent("yAxis",u("y"),this),!l.x||!l.y)
- // Roll back when there no either x or y axis
- return this._axesMap={},void(this._axesList=[]);function u(e){return function(n,i){if(Fm(n,t)){var a=n.get("position");"x"===e?
- // Fix position
- "top"!==a&&"bottom"!==a&&(
- // Default bottom of X
- a=r.bottom?"top":"bottom"):
- // Fix position
- "left"!==a&&"right"!==a&&(
- // Default left of Y
- a=r.left?"right":"left"),r[a]=!0;var u=new Om(e,of(n),[0,0],n.get("type"),a),c="category"===u.type;u.onBand=c&&n.get("boundaryGap"),u.inverse=n.get("inverse"),
- // Inject axis into axisModel
- n.axis=u,
- // Inject axisModel into axis
- u.model=n,
- // Inject grid info axis
- u.grid=o,
- // Index of axis, can be used as key
- u.index=i,o._axesList.push(u),s[e][i]=u,l[e]++}}}this._axesMap=s,
- // Create cartesian2d
- a(s.x,(function(e,n){a(s.y,(function(o,r){var a="x"+n+"y"+r,s=new Pm(a);s.master=i,s.model=t,i._coordsMap[a]=s,i._coordsList.push(s),s.addAxis(e),s.addAxis(o)}))}))},
- /**
- * Update cartesian properties from series.
- */
- t.prototype._updateScale=function(t,e){function n(t,e){a(cf(t,e.dim),(function(n){e.scale.unionExtentFromData(t,n)}))}
- // Reset scale
- a(this._axesList,(function(t){if(t.scale.setExtent(Infinity,-Infinity),"category"===t.type){var e=t.model.get("categorySortInfo");t.scale.setSortInfo(e)}})),t.eachSeries((function(t){if(Em(t)){var i=Vm(t),o=i.xAxisModel,r=i.yAxisModel;if(!Fm(o,e)||!Fm(r,e))return;var a=this.getCartesian(o.componentIndex,r.componentIndex),s=t.getData(),l=a.getAxis("x"),u=a.getAxis("y");n(s,l),n(s,u)}}),this)},
- /**
- * @param dim 'x' or 'y' or 'auto' or null/undefined
- */
- t.prototype.getTooltipAxes=function(t){var e=[],n=[];return a(this.getCartesians(),(function(i){var o=null!=t&&"auto"!==t?i.getAxis(t):i.getBaseAxis(),r=i.getOtherAxis(o);c(e,o)<0&&e.push(o),c(n,r)<0&&n.push(r)})),{baseAxes:e,otherAxes:n}},t.create=function(e,n){var i=[];return e.eachComponent("grid",(function(o,r){var a=new t(o,e,n);a.name="grid_"+r,
- // dataSampling requires axis extent, so resize
- // should be performed in create stage.
- a.resize(o,n,!0),o.coordinateSystem=a,i.push(a)})),
- // Inject the coordinateSystems into seriesModel
- e.eachSeries((function(t){if(Em(t)){var e=Vm(t),n=e.xAxisModel,i=e.yAxisModel,o=n.getCoordSysModel().coordinateSystem;t.coordinateSystem=o.getCartesian(n.componentIndex,i.componentIndex)}})),i},
- // For deciding which dimensions to use when creating list data
- t.dimensions=Lm,t}();
- /**
- * Check if the axis is used in the specified grid.
- */function Fm(t,e){return t.getCoordSysModel()===e}function Wm(t,e,n,
- // Key: see `getOnZeroRecordKey`
- i){n.getAxesOnZeroOf=function(){
- // TODO: onZero of multiple axes.
- return o?[o]:[]};
- // onZero can not be enabled in these two situations:
- // 1. When any other axis is a category axis.
- // 2. When no axis is cross 0 point.
- var o,r=t[e],a=n.model,s=a.get(["axisLine","onZero"]),l=a.get(["axisLine","onZeroAxisIndex"]);if(s){
- // If target axis is specified.
- if(null!=l)Hm(r[l])&&(o=r[l]);else
- // Find the first available other axis.
- for(var u in r)if(r.hasOwnProperty(u)&&Hm(r[u])&&!i[c(r[u])]){o=r[u];break}o&&(i[c(o)]=!0)}function c(t){return t.dim+"_"+t.index}}function Hm(t){return t&&"category"!==t.type&&"time"!==t.type&&function(t){var e=t.scale.getExtent(),n=e[0],i=e[1];return!(n>0&&i>0||n<0&&i<0)}(t)}const Ym=Gm;var Um=Math.PI,Zm=/** @class */function(){function t(t,e){this.group=new Z,this.opt=e,this.axisModel=t,
- // Default value
- I(e,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});
- // FIXME Not use a separate text group?
- var n=new Z({x:e.position[0],y:e.position[1],rotation:e.rotation});
- // this.group.add(transformGroup);
- // this._transformGroup = transformGroup;
- n.updateTransform(),this._transformGroup=n}return t.prototype.hasBuilder=function(t){return!!Xm[t]},t.prototype.add=function(t){Xm[t](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(t,e,n){var i,o,r=on(e-t);return rn(r)?(
- // Label is parallel with axis line.
- o=n>0?"top":"bottom",i="center"):rn(r-Um)?(
- // Label is inverse parallel with axis line.
- o=n>0?"bottom":"top",i="center"):(o="middle",i=r>0&&r<Um?n>0?"right":"left":n>0?"left":"right"),{rotation:r,textAlign:i,textVerticalAlign:o}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),Xm={axisLine:function(e,n,i,o){var r=n.get(["axisLine","show"]);if("auto"===r&&e.handleAutoShown&&(r=e.handleAutoShown("axisLine")),r){var s=n.axis.getExtent(),u=o.transform,c=[s[0],0],d=[s[1],0],h=c[0]>d[0];u&&(P(c,c,u),P(d,d,u));var f=p({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),g=new F({shape:{x1:c[0],y1:c[1],x2:d[0],y2:d[1]},style:f,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1});Mo(g.shape,g.style.lineWidth),g.anid="line",i.add(g);var y=n.get(["axisLine","symbol"]);if(null!=y){var m=n.get(["axisLine","symbolSize"]);t(y)&&(
- // Use the same arrow for start and end point
- y=[y,y]),(t(m)||l(m))&&(
- // Use the same size for width and height
- m=[m,m]);var v=Wc(n.get(["axisLine","symbolOffset"])||0,m),x=m[0],_=m[1];a([{rotate:e.rotation+Math.PI/2,offset:v[0],r:0},{rotate:e.rotation-Math.PI/2,offset:v[1],r:Math.sqrt((c[0]-d[0])*(c[0]-d[0])+(c[1]-d[1])*(c[1]-d[1]))}],(function(t,n){if("none"!==y[n]&&null!=y[n]){var o=Gc(y[n],-x/2,-_/2,x,_,f.stroke,!0),r=t.r+t.offset,a=h?d:c;
- // Calculate arrow position with offset
- o.attr({rotation:t.rotate,x:a[0]+r*Math.cos(e.rotation),y:a[1]-r*Math.sin(e.rotation),silent:!0,z2:11}),i.add(o)}}))}}},axisTickLabel:function(t,e,i,r){var s=function(t,e,n,i){var o=n.axis,r=n.getModel("axisTick"),a=r.get("show");"auto"===a&&i.handleAutoShown&&(a=i.handleAutoShown("axisTick"));if(!a||o.scale.isBlank())return;for(var s=r.getModel("lineStyle"),l=i.tickDirection*r.get("length"),u=Jm(o.getTicksCoords(),e.transform,l,I(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;c<u.length;c++)t.add(u[c]);return u}(i,r,e,t),l=function(t,e,n,i){var r=n.axis,s=Yt(i.axisLabelShow,n.get(["axisLabel","show"]));if(!s||r.scale.isBlank())return;var l=n.getModel("axisLabel"),u=l.get("margin"),c=r.getViewLabels(),d=(Yt(i.labelRotate,l.get("rotate"))||0)*Um/180,h=Zm.innerTextLayout(i.rotation,d,i.labelDirection),p=n.getCategories&&n.getCategories(!0),g=[],y=Zm.isLabelSilent(n),m=n.get("triggerEvent");return a(c,(function(a,s){var d="ordinal"===r.scale.type?r.scale.getRawOrdinalNumber(a.tickValue):a.tickValue,v=a.formattedLabel,_=a.rawLabel,b=l;if(p&&p[d]){var S=p[d];o(S)&&S.textStyle&&(b=new yr(S.textStyle,l,n.ecModel))}var w=b.getTextColor()||n.get(["axisLine","lineStyle","color"]),M=r.dataToCoord(d),I=b.getShallow("align",!0)||h.textAlign,D=x(b.getShallow("alignMinLabel",!0),I),T=x(b.getShallow("alignMaxLabel",!0),I),C=b.getShallow("verticalAlign",!0)||b.getShallow("baseline",!0)||h.textVerticalAlign,A=x(b.getShallow("verticalAlignMinLabel",!0),C),L=x(b.getShallow("verticalAlignMaxLabel",!0),C),k=new $({x:M,y:i.labelOffset+i.labelDirection*u,rotation:h.rotation,silent:y,z2:10+(a.level||0),style:Zo(b,{text:v,align:0===s?D:s===c.length-1?T:I,verticalAlign:0===s?A:s===c.length-1?L:C,fill:f(w)?w(
- // (1) In category axis with data zoom, tick is not the original
- // index of axis.data. So tick should not be exposed to user
- // in category axis.
- // (2) Compatible with previous version, which always use formatted label as
- // input. But in interval scale the formatted label is like '223,445', which
- // maked user replace ','. So we modify it to return original val but remain
- // it as 'string' to avoid error in replacing.
- "category"===r.type?_:"value"===r.type?d+"":d,s):w})});
- // Pack data for mouse event
- if(k.anid="label_"+d,Vo({el:k,componentModel:n,itemName:v,formatterParamsExtra:{isTruncated:function(){return k.isTruncated},value:_,tickIndex:s}}),m){var P=Zm.makeAxisEventDataBase(n);P.targetType="axisLabel",P.value=_,P.tickIndex=s,"category"===r.type&&(P.dataIndex=d),ni(k).eventData=P}
- // FIXME
- e.add(k),k.updateTransform(),g.push(k),t.add(k),k.decomposeTransform()})),g}(i,r,e,t);
- // This bit fixes the label overlap issue for the time chart.
- // See https://github.com/apache/echarts/issues/14266 for more.
- (function(t,e,n){if(uf(t.axis))return;
- // If min or max are user set, we need to check
- // If the tick on min(max) are overlap on their neighbour tick
- // If they are overlapped, we need to hide the min(max) tick label
- var i=t.get(["axisLabel","showMinLabel"]),o=t.get(["axisLabel","showMaxLabel"]);
- // FIXME
- // Have not consider onBand yet, where tick els is more than label els.
- e=e||[],n=n||[];var r=e[0],a=e[1],s=e[e.length-1],l=e[e.length-2],u=n[0],c=n[1],d=n[n.length-1],h=n[n.length-2];!1===i?(jm(r),jm(u)):qm(r,a)&&(i?(jm(a),jm(c)):(jm(r),jm(u)));!1===o?(jm(s),jm(d)):qm(l,s)&&(o?(jm(l),jm(h)):(jm(s),jm(d)))}(e,l,s),function(t,e,n,i){var o=n.axis,r=n.getModel("minorTick");if(!r.get("show")||o.scale.isBlank())return;var a=o.getMinorTicksCoords();if(!a.length)return;for(var s=r.getModel("lineStyle"),l=i*r.get("length"),u=I(s.getLineStyle(),I(n.getModel("axisTick").getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])})),c=0;c<a.length;c++)for(var d=Jm(a[c],e.transform,l,u,"minorticks_"+c),h=0;h<d.length;h++)t.add(d[h])}(i,r,e,t.tickDirection),e.get(["axisLabel","hideOverlap"]))&&_g(mg(n(l,(function(t){return{label:t,priority:t.z2,defaultAttr:{ignore:t.ignore}}}))))},axisName:function(t,e,n,i){var o=Yt(t.axisName,e.get("name"));if(o){var r,a,s=e.get("nameLocation"),l=t.nameDirection,u=e.getModel("nameTextStyle"),c=e.get("nameGap")||0,d=e.axis.getExtent(),h=d[0]>d[1]?-1:1,p=["start"===s?d[0]-h*c:"end"===s?d[1]+h*c:(d[0]+d[1])/2,
- // Reuse labelOffset.
- Km(s)?t.labelOffset+l*c:0],f=e.get("nameRotate");null!=f&&(f=f*Um/180),Km(s)?r=Zm.innerTextLayout(t.rotation,null!=f?f:t.rotation,
- // Adapt to axis.
- l):(r=function(t,e,n,i){var o,r,a=on(n-t),s=i[0]>i[1],l="start"===e&&!s||"start"!==e&&s;rn(a-Um/2)?(r=l?"bottom":"top",o="center"):rn(a-1.5*Um)?(r=l?"top":"bottom",o="center"):(r="middle",o=a<1.5*Um&&a>Um/2?l?"left":"right":l?"right":"left");return{rotation:a,textAlign:o,textVerticalAlign:r}}(t.rotation,s,f||0,d),null!=(a=t.axisNameAvailableWidth)&&(a=Math.abs(a/Math.sin(r.rotation)),!isFinite(a)&&(a=null)));var g=u.getFont(),y=e.get("nameTruncate",!0)||{},m=y.ellipsis,v=Yt(t.nameTruncateMaxWidth,y.maxWidth,a),x=new $({x:p[0],y:p[1],rotation:r.rotation,silent:Zm.isLabelSilent(e),style:Zo(u,{text:o,font:g,overflow:"truncate",width:v,ellipsis:m,fill:u.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:u.get("align")||r.textAlign,verticalAlign:u.get("verticalAlign")||r.textVerticalAlign}),z2:1});if(Vo({el:x,componentModel:e,itemName:o}),x.__fullText=o,
- // Id for animation
- x.anid="name",e.get("triggerEvent")){var _=Zm.makeAxisEventDataBase(e);_.targetType="axisName",_.name=o,ni(x).eventData=_}
- // FIXME
- i.add(x),x.updateTransform(),n.add(x),x.decomposeTransform()}}};
- /**
- * A final axis is translated and rotated from a "standard axis".
- * So opt.position and opt.rotation is required.
- *
- * A standard axis is and axis from [0, 0] to [0, axisExtent[1]],
- * for example: (0, 0) ------------> (0, 50)
- *
- * nameDirection or tickDirection or labelDirection is 1 means tick
- * or label is below the standard axis, whereas is -1 means above
- * the standard axis. labelOffset means offset between label and axis,
- * which is useful when 'onZero', where axisLabel is in the grid and
- * label in outside grid.
- *
- * Tips: like always,
- * positive rotation represents anticlockwise, and negative rotation
- * represents clockwise.
- * The direction of position coordinate is the same as the direction
- * of screen coordinate.
- *
- * Do not need to consider axis 'inverse', which is auto processed by
- * axis extent.
- */function jm(t){t&&(t.ignore=!0)}function qm(t,e){
- // current and next has the same rotation.
- var n=t&&t.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(n&&i){
- // When checking intersect of two rotated labels, we use mRotationBack
- // to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`.
- var o=w([]);return Ut(o,o,-t.rotation),n.applyTransform(M([],o,t.getLocalTransform())),i.applyTransform(M([],o,e.getLocalTransform())),n.intersect(i)}}function Km(t){return"middle"===t||"center"===t}function Jm(t,e,n,i,o){for(var r=[],a=[],s=[],l=0;l<t.length;l++){var u=t[l].coord;a[0]=u,a[1]=0,s[0]=u,s[1]=n,e&&(P(a,a,e),P(s,s,e));
- // Tick line, Not use group transform to have better line draw
- var c=new F({shape:{x1:a[0],y1:a[1],x2:s[0],y2:s[1]},style:i,z2:2,autoBatch:!0,silent:!0});Mo(c.shape,c.style.lineWidth),c.anid=o+"_"+t[l].tickValue,r.push(c)}return r}const $m=Zm;
- // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.
- // allAxesInfo should be updated when setOption performed.
- function Qm(t,e){var n={
- /**
- * key: makeKey(axis.model)
- * value: {
- * axis,
- * coordSys,
- * axisPointerModel,
- * triggerTooltip,
- * triggerEmphasis,
- * involveSeries,
- * snap,
- * seriesModels,
- * seriesDataCount
- * }
- */
- axesInfo:{},seriesInvolved:!1,
- /**
- * key: makeKey(coordSys.model)
- * value: Object: key makeKey(axis.model), value: axisInfo
- */
- coordSysAxesInfo:{},coordSysMap:{}};return function(t,e,n){var i=e.getComponent("tooltip"),o=e.getComponent("axisPointer"),r=o.get("link",!0)||[],s=[];
- // Collect axes info.
- a(n.getCoordinateSystems(),(function(n){
- // Some coordinate system do not support axes, like geo.
- if(n.axisPointerEnabled){var l=iv(n.model),u=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=n;
- // Set tooltip (like 'cross') is a convenient way to show axisPointer
- // for user. So we enable setting tooltip on coordSys model.
- var c=n.model.getModel("tooltip",i);
- // If axis tooltip used, choose tooltip axis for each coordSys.
- // Notice this case: coordSys is `grid` but not `cartesian2D` here.
- if(a(n.getAxes(),rt(f,!1,null)),n.getTooltipAxes&&i&&c.get("show")){
- // Compatible with previous logic. But series.tooltip.trigger: 'axis'
- // or series.data[n].tooltip.trigger: 'axis' are not support any more.
- var d="axis"===c.get("trigger"),h="cross"===c.get(["axisPointer","type"]),p=n.getTooltipAxes(c.get(["axisPointer","axis"]));(d||h)&&a(p.baseAxes,rt(f,!h||"cross",d)),h&&a(p.otherAxes,rt(f,"cross",!1))}
- // fromTooltip: true | false | 'cross'
- // triggerTooltip: true | false | null
- }function f(i,l,d){var h=d.model.getModel("axisPointer",o),p=h.get("show");if(p&&("auto"!==p||i||nv(h))){null==l&&(l=h.get("triggerTooltip")),h=i?function(t,e,n,i,o,r){var s=e.getModel("axisPointer"),l={};
- // Compatible with previous behavior, tooltip axis does not show label by default.
- // Only these properties can be overridden from tooltip to axisPointer.
- a(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],(function(t){l[t]=et(s.get(t))})),
- // category axis do not auto snap, otherwise some tick that do not
- // has value can not be hovered. value/time/log axis default snap if
- // triggered from tooltip and trigger tooltip.
- l.snap="category"!==t.type&&!!r,"cross"===s.get("type")&&(l.type="line");var u=l.label||(l.label={});
- // Follow the convention, do not show label when triggered by tooltip by default.
- if(null==u.show&&(u.show=!1),"cross"===o){
- // When 'cross', both axes show labels.
- var c=s.get(["label","show"]);
- // If triggerTooltip, this is a base axis, which should better not use cross style
- // (cross style is dashed by default)
- if(u.show=null==c||c,!r){var d=l.lineStyle=s.get("crossStyle");d&&I(u,d.textStyle)}}return t.model.getModel("axisPointer",new yr(l,n,i))}(d,c,o,e,i,l):h;var f=h.get("snap"),g=h.get("triggerEmphasis"),y=iv(d.model),m=l||f||"category"===d.type,v=t.axesInfo[y]={key:y,axis:d,coordSys:n,axisPointerModel:h,triggerTooltip:l,triggerEmphasis:g,involveSeries:m,snap:f,useHandle:nv(h),seriesModels:[],linkGroup:null};u[y]=v,t.seriesInvolved=t.seriesInvolved||m;var x=
- /**
- * For example:
- * {
- * axisPointer: {
- * links: [{
- * xAxisIndex: [2, 4],
- * yAxisIndex: 'all'
- * }, {
- * xAxisId: ['a5', 'a7'],
- * xAxisName: 'xxx'
- * }]
- * }
- * }
- */
- function(t,e){for(var n=e.model,i=e.dim,o=0;o<t.length;o++){var r=t[o]||{};if(tv(r[i+"AxisId"],n.id)||tv(r[i+"AxisIndex"],n.componentIndex)||tv(r[i+"AxisName"],n.name))return o}}(r,d);if(null!=x){var _=s[x]||(s[x]={axesInfo:{}});_.axesInfo[y]=v,_.mapper=r[x].mapper,v.linkGroup=_}}}}))}(n,t,e),
- // Check seriesInvolved for performance, in case too many series in some chart.
- n.seriesInvolved&&function(t,e){
- // Prepare data for axis trigger
- e.eachSeries((function(e){
- // Notice this case: this coordSys is `cartesian2D` but not `grid`.
- var n=e.coordinateSystem,i=e.get(["tooltip","trigger"],!0),o=e.get(["tooltip","show"],!0);n&&"none"!==i&&!1!==i&&"item"!==i&&!1!==o&&!1!==e.get(["axisPointer","show"],!0)&&a(t.coordSysAxesInfo[iv(n.model)],(function(t){var i=t.axis;n.getAxis(i.dim)===i&&(t.seriesModels.push(e),null==t.seriesDataCount&&(t.seriesDataCount=0),t.seriesDataCount+=e.getData().count())}))}))}(n,t),n}function tv(t,e){return"all"===t||i(t)&&c(t,e)>=0||t===e}function ev(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[iv(t)]}function nv(t){return!!t.get(["handle","show"])}
- /**
- * @param {module:echarts/model/Model} model
- * @return {string} unique key
- */function iv(t){return t.type+"||"+t.id}var ov={},rv=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}
- /**
- * @override
- */return Ue(e,t),e.prototype.render=function(e,n,i,o){
- // FIXME
- // This process should proformed after coordinate systems updated
- // (axis scale updated), and should be performed each time update.
- // So put it here temporarily, although it is not appropriate to
- // put a model-writing procedure in `view`.
- this.axisPointerClass&&function(t){var e=ev(t);if(e){var n=e.axisPointerModel,i=e.axis.scale,o=n.option,r=n.get("status"),a=n.get("value");
- // Parse init value for category and time axis.
- null!=a&&(a=i.parse(a));var s=nv(n);
- // If `handle` used, `axisPointer` will always be displayed, so value
- // and status should be initialized.
- null==r&&(o.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(
- // Pick a value on axis when initializing.
- null==a||a>l[1])&&(
- // Make handle displayed on the end of the axis when init, which looks better.
- a=l[1]),a<l[0]&&(a=l[0]),o.value=a,s&&(o.status=e.axis.scale.isBlank()?"hide":"show")}}(e),t.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(e,i,!0)},
- /**
- * Action handler.
- */
- e.prototype.updateAxisPointer=function(t,e,n,i){this._doUpdateAxisPointerClass(t,n,!1)},
- /**
- * @override
- */
- e.prototype.remove=function(t,e){var n=this._axisPointer;n&&n.remove(e)},
- /**
- * @override
- */
- e.prototype.dispose=function(e,n){this._disposeAxisPointer(n),t.prototype.dispose.apply(this,arguments)},e.prototype._doUpdateAxisPointerClass=function(t,n,i){var o=e.getAxisPointerClass(this.axisPointerClass);if(o){var r=function(t){var e=ev(t);return e&&e.axisPointerModel}(t);r?(this._axisPointer||(this._axisPointer=new o)).render(t,r,n,i):this._disposeAxisPointer(n)}},e.prototype._disposeAxisPointer=function(t){this._axisPointer&&this._axisPointer.dispose(t),this._axisPointer=null},e.registerAxisPointerClass=function(t,e){ov[t]=e},e.getAxisPointerClass=function(t){return t&&ov[t]},e.type="axis",e}(Mu);
- /**
- * Base class of AxisView.
- */const av=rv;var sv=On();function lv(t,e,n,o){var a=n.axis;if(!a.scale.isBlank()){
- // TODO: TYPE
- var s=n.getModel("splitArea"),l=s.getModel("areaStyle"),u=l.get("color"),c=o.coordinateSystem.getRect(),d=a.getTicksCoords({tickModel:s,clamp:!0});if(d.length){
- // For Making appropriate splitArea animation, the color and anid
- // should be corresponding to previous one if possible.
- var h=u.length,p=sv(t).splitAreaColors,f=r(),g=0;if(p)for(var y=0;y<d.length;y++){var m=p.get(d[y].tickValue);if(null!=m){g=(m+(h-1)*y)%h;break}}var v=a.toGlobalCoord(d[0].coord),x=l.getAreaStyle();u=i(u)?u:[u];for(y=1;y<d.length;y++){var _=a.toGlobalCoord(d[y].coord),b=void 0,S=void 0,w=void 0,M=void 0;a.isHorizontal()?(b=v,S=c.y,w=_-b,M=c.height,v=b+w):(b=c.x,S=v,w=c.width,v=S+(M=_-S));var D=d[y-1].tickValue;null!=D&&f.set(D,g),e.add(new G({anid:null!=D?"area_"+D:null,shape:{x:b,y:S,width:w,height:M},style:I({fill:u[g]},x),autoBatch:!0,silent:!0})),g=(g+1)%h}sv(t).splitAreaColors=f}}}function uv(t){sv(t).splitAreaColors=null}var cv=["axisLine","axisTickLabel","axisName"],dv=["splitArea","splitLine","minorSplitLine"],hv=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="CartesianAxisPointer",n}
- /**
- * @override
- */return Ue(e,t),e.prototype.render=function(e,n,i,o){this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new Z,this.group.add(this._axisGroup),e.get("show")){var s=e.getCoordSysModel(),l=Rm(s,e),u=new $m(e,p({handleAutoShown:function(t){for(var n=s.coordinateSystem.getCartesians(),i=0;i<n.length;i++)if(op(n[i].getOtherAxis(e.axis).scale))
- // Still show axis tick or axisLine if other axis is value / log
- return!0;
- // Not show axisTick or axisLine if other axis is category / time
- return!1}},l));a(cv,u.add,u),this._axisGroup.add(u.getGroup()),a(dv,(function(t){e.get([t,"show"])&&pv[t](this,this._axisGroup,e,s)}),this),o&&"changeAxisOrder"===o.type&&o.isInitSort||Lo(r,this._axisGroup,e),t.prototype.render.call(this,e,n,i,o)}},e.prototype.remove=function(){uv(this)},e.type="cartesianAxis",e}(av),pv={splitLine:function(t,e,n,o){var r=n.axis;if(!r.scale.isBlank()){var a=n.getModel("splitLine"),s=a.getModel("lineStyle"),l=s.get("color"),u=!1!==a.get("showMinLine"),c=!1!==a.get("showMaxLine");l=i(l)?l:[l];for(var d=o.coordinateSystem.getRect(),h=r.isHorizontal(),p=0,f=r.getTicksCoords({tickModel:a}),g=[],y=[],m=s.getLineStyle(),v=0;v<f.length;v++){var x=r.toGlobalCoord(f[v].coord);if((0!==v||u)&&(v!==f.length-1||c)){var _=f[v].tickValue;h?(g[0]=x,g[1]=d.y,y[0]=x,y[1]=d.y+d.height):(g[0]=d.x,g[1]=x,y[0]=d.x+d.width,y[1]=x);var b=p++%l.length,S=new F({anid:null!=_?"line_"+_:null,autoBatch:!0,shape:{x1:g[0],y1:g[1],x2:y[0],y2:y[1]},style:I({stroke:l[b]},m),silent:!0});Mo(S.shape,m.lineWidth),e.add(S)}}}},minorSplitLine:function(t,e,n,i){var o=n.axis,r=n.getModel("minorSplitLine").getModel("lineStyle"),a=i.coordinateSystem.getRect(),s=o.isHorizontal(),l=o.getMinorTicksCoords();if(l.length)for(var u=[],c=[],d=r.getLineStyle(),h=0;h<l.length;h++)for(var p=0;p<l[h].length;p++){var f=o.toGlobalCoord(l[h][p].coord);s?(u[0]=f,u[1]=a.y,c[0]=f,c[1]=a.y+a.height):(u[0]=a.x,u[1]=f,c[0]=a.x+a.width,c[1]=f);var g=new F({anid:"minor_line_"+l[h][p].tickValue,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:c[0],y2:c[1]},style:d,silent:!0});Mo(g.shape,d.lineWidth),e.add(g)}},splitArea:function(t,e,n,i){lv(t,e,n,i)}},fv=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="xAxis",e}(hv),gv=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=fv.type,e}return Ue(e,t),e.type="yAxis",e}(hv),yv=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="grid",e}return Ue(e,t),e.prototype.render=function(t,e){this.group.removeAll(),t.get("show")&&this.group.add(new G({shape:t.coordinateSystem.getRect(),style:I({fill:t.get("backgroundColor")},t.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e}(Mu),mv={
- // gridIndex: 0,
- // gridId: '',
- offset:0};function vv(t){t.registerComponentView(yv),t.registerComponentModel(_m),t.registerCoordinateSystem("cartesian2d",Ym),Tm(t,"x",bm,mv),Tm(t,"y",bm,mv),t.registerComponentView(fv),t.registerComponentView(gv),t.registerPreprocessor((function(t){
- // Only create grid when need
- t.xAxis&&t.yAxis&&!t.grid&&(t.grid={})}))}function xv(t){t.eachSeriesByType("radar",(function(t){var e=t.getData(),n=[],i=t.coordinateSystem;if(i){var o=i.getIndicatorAxes();a(o,(function(t,r){e.each(e.mapDimension(o[r].dim),(function(t,e){n[e]=n[e]||[];var o=i.dataToPoint(t,r);n[e][r]=_v(o)?o:bv(i)}))})),
- // Close polygon
- e.each((function(t){
- // TODO
- // Is it appropriate to connect to the next data when some data is missing?
- // Or, should trade it like `connectNull` in line chart?
- var o=Zt(n[t],(function(t){return _v(t)}))||bv(i);
- // Copy the first actual point to the end of the array
- n[t].push(o.slice()),e.setItemLayout(t,n[t])}))}}))}function _v(t){return!isNaN(t[0])&&!isNaN(t[1])}function bv(t){
- // It is error-prone to input [NaN, NaN] into polygon, polygon.
- // (probably cause problem when refreshing or animating)
- return[t.cx,t.cy]}function Sv(t){var e=t.polar;if(e){i(e)||(e=[e]);var n=[];a(e,(function(e,o){e.indicator?(e.type&&!e.shape&&(e.shape=e.type),t.radar=t.radar||[],i(t.radar)||(t.radar=[t.radar]),t.radar.push(e)):n.push(e)})),t.polar=n}a(t.series,(function(t){t&&"radar"===t.type&&t.polarIndex&&(t.radarIndex=t.polarIndex)}))}var wv=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,i){var o=t.coordinateSystem,r=this.group,s=t.getData(),l=this._data;function u(t,e){var n=t.getItemVisual(e,"symbol")||"circle";if("none"!==n){var i=Fc(t.getItemVisual(e,"symbolSize")),o=Gc(n,-1,-1,2,2),r=t.getItemVisual(e,"symbolRotate")||0;return o.attr({style:{strokeNoScale:!0},z2:100,scaleX:i[0]/2,scaleY:i[1]/2,rotation:r*Math.PI/180||0}),o}}function c(e,n,i,o,r,a){
- // Simply rerender all
- i.removeAll();for(var s=0;s<n.length-1;s++){var l=u(o,r);l&&(l.__dimIdx=s,e[s]?(l.setPosition(e[s]),Go[a?"initProps":"updateProps"](l,{x:n[s][0],y:n[s][1]},t,r)):l.setPosition(n[s]),i.add(l))}}function d(t){return n(t,(function(t){return[o.cx,o.cy]}))}s.diff(l).add((function(e){var n=s.getItemLayout(e);if(n){var i=new z,o=new B,r={shape:{points:n}};i.shape.points=d(n),o.shape.points=d(n),oo(i,r,t,e),oo(o,r,t,e);var a=new Z,l=new Z;a.add(o),a.add(i),a.add(l),c(o.shape.points,n,l,s,e,!0),s.setItemGraphicEl(e,a)}})).update((function(e,n){var i=l.getItemGraphicEl(n),o=i.childAt(0),r=i.childAt(1),a=i.childAt(2),u={shape:{points:s.getItemLayout(e)}};u.shape.points&&(c(o.shape.points,u.shape.points,a,s,e,!1),uo(r),uo(o),io(o,u,t),io(r,u,t),s.setItemGraphicEl(e,i))})).remove((function(t){r.remove(l.getItemGraphicEl(t))})).execute(),s.eachItemGraphicEl((function(t,e){var n=s.getItemModel(e),i=t.childAt(0),o=t.childAt(1),l=t.childAt(2),u=s.getItemVisual(e,"style"),c=u.fill;r.add(t),i.useStyle(I(n.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:c})),qi(i,n,"lineStyle"),qi(o,n,"areaStyle");var d=n.getModel("areaStyle"),h=d.isEmpty()&&d.parentModel.isEmpty();o.ignore=h,a(["emphasis","select","blur"],(function(t){var e=n.getModel([t,"areaStyle"]),i=e.isEmpty()&&e.parentModel.isEmpty();
- // Won't be ignore if normal state is not ignore.
- o.ensureState(t).ignore=i&&h})),o.useStyle(I(d.getAreaStyle(),{fill:c,opacity:.7,decal:u.decal}));var f=n.getModel("emphasis"),g=f.getModel("itemStyle").getItemStyle();l.eachChild((function(t){if(t instanceof b){var i=t.style;t.useStyle(p({
- // TODO other properties like x, y ?
- image:i.image,x:i.x,y:i.y,width:i.width,height:i.height},u))}else t.useStyle(u),t.setColor(c),t.style.strokeNoScale=!0;t.ensureState("emphasis").style=et(g);var o=s.getStore().get(s.getDimensionIndex(t.__dimIdx),e);(null==o||isNaN(o))&&(o=""),Yo(t,Uo(n),{labelFetcher:s.hostModel,labelDataIndex:e,labelDimIndex:t.__dimIdx,defaultText:o,inheritColor:c,defaultOpacity:u.opacity})})),Ui(t,f.get("focus"),f.get("blurScope"),f.get("disabled"))})),this._data=s},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.type="radar",e}(Ou);const Mv=wv;var Iv=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}
- // Overwrite
- return Ue(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),
- // Enable legend selection for each data item
- // Use a function instead of direct access because data reference may changed
- this.legendVisualProvider=new dm(lt(this.getData,this),lt(this.getRawData,this))},e.prototype.getInitialData=function(t,e){return um(this,{generateCoord:"indicator_",generateCoordCount:Infinity})},e.prototype.formatTooltip=function(t,e,i){var o=this.getData(),r=this.coordinateSystem.getIndicatorAxes(),a=this.getData().getName(t),s=""===a?this.name:a,l=su(this,t);return $l("section",{header:s,sortBlocks:!0,blocks:n(r,(function(e){var n=o.get(o.mapDimension(e.dim),t);return $l("nameValue",{markerType:"subItem",markerColor:l,name:e.name,value:n,sortParam:n})}))})},e.prototype.getTooltipPosition=function(t){if(null!=t)for(var e=this.getData(),i=this.coordinateSystem,o=e.getValues(n(i.dimensions,(function(t){return e.mapDimension(t)})),t),r=0,a=o.length;r<a;r++)if(!isNaN(o[r])){var s=i.getIndicatorAxes();return i.coordToPoint(s[r].dataToCoord(o[r]),r)}},e.type="series.radar",e.dependencies=["radar"],e.defaultOption={
- // zlevel: 0,
- z:2,colorBy:"data",coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid",join:"round"},label:{position:"top"},
- // areaStyle: {
- // },
- // itemStyle: {}
- symbolSize:8},e}(Su);const Dv=Iv;var Tv=Im.value;function Cv(t,e){return I({show:e},t)}var Av=/** @class */function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.type,t}return Ue(i,e),i.prototype.optionUpdated=function(){var e=this.get("boundaryGap"),i=this.get("splitNumber"),o=this.get("scale"),r=this.get("axisLine"),a=this.get("axisTick"),s=this.get("axisLabel"),l=this.get("axisName"),u=this.get(["axisName","show"]),c=this.get(["axisName","formatter"]),d=this.get("axisNameGap"),h=this.get("triggerEvent"),p=n(this.get("indicator")||[],(function(n){
- // PENDING
- null!=n.max&&n.max>0&&!n.min?n.min=0:null!=n.min&&n.min<0&&!n.max&&(n.max=0);var p=l;null!=n.color&&(p=I({color:n.color},l));
- // Use same configuration
- var g=tt(et(n),{boundaryGap:e,splitNumber:i,scale:o,axisLine:r,axisTick:a,
- // axisType: axisType,
- axisLabel:s,
- // Compatible with 2 and use text
- name:n.text,showName:u,nameLocation:"end",nameGap:d,
- // min: 0,
- nameTextStyle:p,triggerEvent:h},!1);if(t(c)){var y=g.name;g.name=c.replace("{value}",null!=y?y:"")}else f(c)&&(g.name=c(g.name,g));var m=new yr(g,null,this.ecModel);return nt(m,df.prototype),
- // For triggerEvent.
- m.mainType="radar",m.componentIndex=this.componentIndex,m}),this);this._indicatorModels=p},i.prototype.getIndicatorModels=function(){return this._indicatorModels},i.type="radar",i.defaultOption={
- // zlevel: 0,
- z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,
- // Polygon or circle
- shape:"polygon",axisLine:tt({lineStyle:{color:"#bbb"}},Tv.axisLine),axisLabel:Cv(Tv.axisLabel,!1),axisTick:Cv(Tv.axisTick,!1),
- // axisType: 'value',
- splitLine:Cv(Tv.splitLine,!0),splitArea:Cv(Tv.splitArea,!0),
- // {text, min, max}
- indicator:[]},i}(Ta);const Lv=Av;var kv=["axisLine","axisTickLabel","axisName"],Pv=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){this.group.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var e=t.coordinateSystem,i=e.getIndicatorAxes(),o=n(i,(function(t){var n=t.model.get("showName")?t.name:"";// hide name
- return new $m(t.model,{axisName:n,position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}));a(o,(function(t){a(kv,t.add,t),this.group.add(t.getGroup())}),this)},e.prototype._buildSplitLineAndArea=function(t){var e=t.coordinateSystem,o=e.getIndicatorAxes();if(o.length){var r=t.get("shape"),s=t.getModel("splitLine"),l=t.getModel("splitArea"),u=s.getModel("lineStyle"),c=l.getModel("areaStyle"),d=s.get("show"),h=l.get("show"),p=u.get("color"),f=c.get("color"),g=i(p)?p:[p],y=i(f)?f:[f],m=[],v=[];if("circle"===r)for(var x=o[0].getTicksCoords(),_=e.cx,b=e.cy,S=0;S<x.length;S++){if(d)m[k(m,g,S)].push(new O({shape:{cx:_,cy:b,r:x[S].coord}}));if(h&&S<x.length-1)v[k(v,y,S)].push(new V({shape:{cx:_,cy:b,r0:x[S].coord,r:x[S+1].coord}}))}else{var w,M=n(o,(function(t,i){var o=t.getTicksCoords();return w=null==w?o.length-1:Math.min(o.length-1,w),n(o,(function(t){return e.coordToPoint(t.coord,i)}))})),D=[];for(S=0;S<=w;S++){for(var T=[],C=0;C<o.length;C++)T.push(M[C][S]);
- // Close
- if(T[0]&&T.push(T[0].slice()),d)m[k(m,g,S)].push(new B({shape:{points:T}}));if(h&&D)v[k(v,y,S-1)].push(new z({shape:{points:T.concat(D)}}));D=T.slice().reverse()}}var A=u.getLineStyle(),L=c.getAreaStyle();
- // Add splitArea before splitLine
- a(v,(function(t,e){this.group.add(So(t,{style:I({stroke:"none",fill:y[e%y.length]},L),silent:!0}))}),this),a(m,(function(t,e){this.group.add(So(t,{style:I({fill:"none",stroke:g[e%g.length]},A),silent:!0}))}),this)}function k(t,e,n){var i=n%e.length;return t[i]=t[i]||[],i}},e.type="radar",e}(Mu);const Nv=Pv;var Ov=/** @class */function(t){function e(e,n,i){var o=t.call(this,e,n,i)||this;return o.type="value",o.angle=0,o.name="",o}return Ue(e,t),e}(Yf);const Rv=Ov;var Ev=/** @class */function(){function e(t,e,i){
- /**
- *
- * Radar dimensions
- */
- this.dimensions=[],this._model=t,this._indicatorAxes=n(t.getIndicatorModels(),(function(t,e){var n="indicator_"+e,i=new Rv(n,new yp);return i.name=t.get("name"),
- // Inject model and axis
- i.model=t,t.axis=i,this.dimensions.push(n),i}),this),this.resize(t,i)}return e.prototype.getIndicatorAxes=function(){return this._indicatorAxes},e.prototype.dataToPoint=function(t,e){var n=this._indicatorAxes[e];return this.coordToPoint(n.dataToCoord(t),e)},
- // TODO: API should be coordToPoint([coord, indicatorIndex])
- e.prototype.coordToPoint=function(t,e){var n=this._indicatorAxes[e].angle;return[this.cx+t*Math.cos(n),this.cy-t*Math.sin(n)]},e.prototype.pointToData=function(t){var e=t[0]-this.cx,n=t[1]-this.cy,i=Math.sqrt(e*e+n*n);e/=i,n/=i;for(var o,r=Math.atan2(-n,e),a=Infinity,s=-1,l=0
- // Find the closest angle
- // FIXME index can calculated directly
- ;l<this._indicatorAxes.length;l++){var u=this._indicatorAxes[l],c=Math.abs(r-u.angle);c<a&&(o=u,s=l,a=c)}return[s,+(o&&o.coordToData(i))]},e.prototype.resize=function(e,n){var i=e.get("center"),o=n.getWidth(),r=n.getHeight(),s=Math.min(o,r)/2;this.cx=je(i[0],o),this.cy=je(i[1],r),this.startAngle=e.get("startAngle")*Math.PI/180;
- // radius may be single value like `20`, `'80%'`, or array like `[10, '80%']`
- var u=e.get("radius");(t(u)||l(u))&&(u=[0,u]),this.r0=je(u[0],s),this.r=je(u[1],s),a(this._indicatorAxes,(function(t,e){t.setExtent(this.r0,this.r);var n=this.startAngle+e*Math.PI*2/this._indicatorAxes.length;
- // Normalize to [-PI, PI]
- n=Math.atan2(Math.sin(n),Math.cos(n)),t.angle=n}),this)},e.prototype.update=function(t,e){var n=this._indicatorAxes,i=this._model;a(n,(function(t){t.scale.setExtent(Infinity,-Infinity)})),t.eachSeriesByType("radar",(function(e,o){if("radar"===e.get("coordinateSystem")&&t.getComponent("radar",e.get("radarIndex"))===i){var r=e.getData();a(n,(function(t){t.scale.unionExtentFromData(r,r.mapDimension(t.dim))}))}}),this);var o=i.get("splitNumber"),r=new yp;r.setExtent(0,o),r.setInterval(1),
- // Force all the axis fixing the maxSplitNumber.
- a(n,(function(t,e){Bm(t.scale,t.model,r)}))},e.prototype.convertToPixel=function(t,e,n){return null},e.prototype.convertFromPixel=function(t,e,n){return null},e.prototype.containPoint=function(t){return!1},e.create=function(t,n){var i=[];return t.eachComponent("radar",(function(o){var r=new e(o,t,n);i.push(r),o.coordinateSystem=r})),t.eachSeriesByType("radar",(function(t){"radar"===t.get("coordinateSystem")&&(
- // Inject coordinate system
- // @ts-ignore
- t.coordinateSystem=i[t.get("radarIndex")||0])})),i},
- /**
- * Radar dimensions is based on the data
- */
- e.dimensions=[],e}();const Vv=Ev;function zv(t){t.registerCoordinateSystem("radar",Vv),t.registerComponentModel(Lv),t.registerComponentView(Nv),t.registerVisual({seriesType:"radar",reset:function(t){var e=t.getData();
- // itemVisual symbol is for selected data
- e.each((function(t){e.setItemVisual(t,"legendIcon","roundRect")})),
- // visual is for unselected data
- e.setVisual("legendIcon","roundRect")}})}var Bv="\0_ec_interaction_mutex";function Gv(t,e){return!!Fv(t)[e]}function Fv(t){return t[Bv]||(t[Bv]={})}
- /**
- * payload: {
- * type: 'takeGlobalCursor',
- * key: 'dataZoomSelect', or 'brush', or ...,
- * If no userKey, release global cursor.
- * }
- */
- // TODO: SELF REGISTERED.
- function Wv(t,e,n,i,o){t.pointerChecker&&t.pointerChecker(i,o.originX,o.originY)&&(
- // When mouse is out of roamController rect,
- // default befavoius should not be be disabled, otherwise
- // page sliding is disabled, contrary to expectation.
- jt(i.event),Hv(t,e,n,i,o))}function Hv(t,e,n,i,o){
- // Also provide behavior checker for event listener, for some case that
- // multiple components share one listener.
- o.isAvailableBehavior=lt(Yv,null,n,i),
- // TODO should not have type issue.
- t.trigger(e,o)}
- // settings: {
- // zoomOnMouseWheel
- // moveOnMouseMove
- // moveOnMouseWheel
- // }
- // The value can be: true / false / 'shift' / 'ctrl' / 'alt'.
- function Yv(e,n,i){var o=i[e];return!e||o&&(!t(o)||n.event[o+"Key"])}eh({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},dt);const Uv=/** @class */function(t){function e(e){var n=t.call(this)||this;n._zr=e;
- // Avoid two roamController bind the same handler
- var i=lt(n._mousedownHandler,n),o=lt(n._mousemoveHandler,n),r=lt(n._mouseupHandler,n),a=lt(n._mousewheelHandler,n),s=lt(n._pinchHandler,n);
- /**
- * Notice: only enable needed types. For example, if 'zoom'
- * is not needed, 'zoom' should not be enabled, otherwise
- * default mousewheel behaviour (scroll page) will be disabled.
- */
- return n.enable=function(t,n){
- // Disable previous first
- this.disable(),this._opt=I(et(n)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,
- // By default, wheel do not trigger move.
- moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(e.on("mousedown",i),e.on("mousemove",o),e.on("mouseup",r)),!0!==t&&"scale"!==t&&"zoom"!==t||(e.on("mousewheel",a),e.on("pinch",s))},n.disable=function(){e.off("mousedown",i),e.off("mousemove",o),e.off("mouseup",r),e.off("mousewheel",a),e.off("pinch",s)},n}return Ue(e,t),e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(t){this.pointerChecker=t},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(t){if(!Xt(t)){for(var e=t.target;e;){if(e.draggable)return;
- // check if host is draggable
- e=e.__hostTarget||e.parent}var n=t.offsetX,i=t.offsetY;
- // Only check on mosedown, but not mousemove.
- // Mouse can be out of target when mouse moving.
- this.pointerChecker&&this.pointerChecker(t,n,i)&&(this._x=n,this._y=i,this._dragging=!0)}},e.prototype._mousemoveHandler=function(t){if(this._dragging&&Yv("moveOnMouseMove",t,this._opt)&&"pinch"!==t.gestureEvent&&!Gv(this._zr,"globalPan")){var e=t.offsetX,n=t.offsetY,i=this._x,o=this._y,r=e-i,a=n-o;this._x=e,this._y=n,this._opt.preventDefaultMouseMove&&jt(t.event),Hv(this,"pan","moveOnMouseMove",t,{dx:r,dy:a,oldX:i,oldY:o,newX:e,newY:n,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(t){Xt(t)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(t){var e=Yv("zoomOnMouseWheel",t,this._opt),n=Yv("moveOnMouseWheel",t,this._opt),i=t.wheelDelta,o=Math.abs(i),r=t.offsetX,a=t.offsetY;
- // wheelDelta maybe -0 in chrome mac.
- if(0!==i&&(e||n)){
- // If both `shouldZoom` and `shouldMove` is true, trigger
- // their event both, and the final behavior is determined
- // by event listener themselves.
- if(e){
- // Convenience:
- // Mac and VM Windows on Mac: scroll up: zoom out.
- // Windows: scroll up: zoom in.
- // FIXME: Should do more test in different environment.
- // wheelDelta is too complicated in difference nvironment
- // (https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel),
- // although it has been normallized by zrender.
- // wheelDelta of mouse wheel is bigger than touch pad.
- var s=o>3?1.4:o>1?1.2:1.1;Wv(this,"zoom","zoomOnMouseWheel",t,{scale:i>0?s:1/s,originX:r,originY:a,isAvailableBehavior:null})}if(n){
- // FIXME: Should do more test in different environment.
- var l=Math.abs(i);
- // wheelDelta of mouse wheel is bigger than touch pad.
- Wv(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:r,originY:a,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){Gv(this._zr,"globalPan")||Wv(this,"zoom",null,t,{scale:t.pinchScale>1?1.1:1/1.1,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})},e}(mt);
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * For geo and graph.
- */function Zv(t,e,n){var i=t.target;i.x+=e,i.y+=n,i.dirty()}
- /**
- * For geo and graph.
- */function Xv(t,e,n,i){var o=t.target,r=t.zoomLimit,a=t.zoom=t.zoom||1;if(a*=e,r){var s=r.min||0,l=r.max||Infinity;a=Math.max(Math.min(l,a),s)}var u=a/t.zoom;t.zoom=a,
- // Keep the mouse center when scaling
- o.x-=(n-o.x)*(u-1),o.y-=(i-o.y)*(u-1),o.scaleX*=u,o.scaleY*=u,o.dirty()}
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */var jv={axisPointer:1,tooltip:1,brush:1};
- /**
- * Avoid that: mouse click on a elements that is over geo or graph,
- * but roam is triggered.
- */function qv(t,e,n){var i=e.getComponentByElement(t.topTarget),o=i&&i.coordinateSystem;
- // If model is axisModel, it works only if it is injected with coordinateSystem.
- return i&&i!==n&&!jv.hasOwnProperty(i.mainType)&&o&&o.model!==n}
- /**
- * "region available" means that: enable users to set attribute `name="xxx"` on those tags
- * to make it be a region.
- * 1. region styles and its label styles can be defined in echarts opton:
- * ```js
- * geo: {
- * regions: [{
- * name: 'xxx',
- * itemStyle: { ... },
- * label: { ... }
- * }, {
- * ...
- * },
- * ...]
- * };
- * ```
- * 2. name can be duplicated in different SVG tag. All of the tags with the same name share
- * a region option. For exampel if there are two <path> representing two lung lobes. They have
- * no common parents but both of them need to display label "lung" inside.
- */var Kv=r(["rect","circle","line","ellipse","polygon","polyline","path",
- // <text> <tspan> are also enabled because some SVG might paint text itself,
- // but still need to trigger events or tooltip.
- "text","tspan",
- // <g> is also enabled because this case: if multiple tags share one name
- // and need label displayed, every tags will display the name, which is not
- // expected. So we can put them into a <g name="xxx">. Thereby only one label
- // displayed and located based on the bounding rect of the <g>.
- "g"]),Jv=/** @class */function(){function t(t,e){this.type="geoSVG",
- // All used graphics. key: hostKey, value: root
- this._usedGraphicMap=r(),
- // All unused graphics.
- this._freedGraphics=[],this._mapName=t,
- // Only perform parse to XML object here, which might be time
- // consiming for large SVG.
- // Although convert XML to zrender element is also time consiming,
- // if we do it here, the clone of zrender elements has to be
- // required. So we do it once for each geo instance, util real
- // performance issues call for optimizing it.
- this._parsedXML=qt(e)}return t.prototype.load=function(){
- // In the "load" stage, graphic need to be built to
- // get boundingRect for geo coordinate system.
- var t=this._firstGraphic;
- // Create the return data structure only when first graphic created.
- // Because they will be used in geo coordinate system update stage,
- // and `regions` will be mounted at `geo` coordinate system,
- // in which there is no "view" info, so that it should better not to
- // make references to graphic elements.
- if(!t){t=this._firstGraphic=this._buildGraphic(this._parsedXML),this._freedGraphics.push(t),this._boundingRect=this._firstGraphic.boundingRect.clone();
- // PENDING: `nameMap` will not be supported until some real requirement come.
- // if (nameMap) {
- // named = applyNameMap(named, nameMap);
- // }
- var e=function(t){var e=[],n=r();
- // Create resions only for the first graphic.
- return a(t,(function(t){
- // Region has feature to calculate center for tooltip or other features.
- // If there is a <g name="xxx">, the center should be the center of the
- // bounding rect of the g.
- if(null==t.namedFrom){var i=new Sf(t.name,t.el);
- // PENDING: if `nameMap` supported, this region can not be mounted on
- // `this`, but can only be created each time `load()` called.
- e.push(i),
- // PENDING: if multiple tag named with the same name, only one will be
- // found by `_regionsMap`. `_regionsMap` is used to find a coordinate
- // by name. We use `region.getCenter()` as the coordinate.
- n.set(t.name,i)}})),{regions:e,regionsMap:n}}
- // PENDING: `nameMap` will not be supported until some real requirement come.
- // /**
- // * Use the alias in geoNameMap.
- // * The input `named` must not be modified.
- // */
- // function applyNameMap(
- // named: GeoSVGGraphicRecord['named'],
- // nameMap: NameMap
- // ): GeoSVGGraphicRecord['named'] {
- // const result = [] as GeoSVGGraphicRecord['named'];
- // for (let i = 0; i < named.length; i++) {
- // let regionGraphic = named[i];
- // const name = regionGraphic.name;
- // if (nameMap && nameMap.hasOwnProperty(name)) {
- // regionGraphic = extend({}, regionGraphic);
- // regionGraphic.name = name;
- // }
- // result.push(regionGraphic);
- // }
- // return result;
- // }
- (t.named),n=e.regions,i=e.regionsMap;this._regions=n,this._regionsMap=i}return{boundingRect:this._boundingRect,regions:this._regions,regionsMap:this._regionsMap}},t.prototype._buildGraphic=function(t){var e,n;try{n=(e=t&&Kt(t,{ignoreViewBox:!0,ignoreRootClip:!0})||{}).root,s(null!=n)}catch(m){throw new Error("Invalid svg format\n"+m.message)}
- // Note: we keep the covenant that the root has no transform. So always add an extra root.
- var i=new Z;i.add(n),i.isGeoSVGGraphicRoot=!0;
- // [THE_RULE_OF_VIEWPORT_AND_VIEWBOX]
- // Consider: `<svg width="..." height="..." viewBox="...">`
- // - the `width/height` we call it `svgWidth/svgHeight` for short.
- // - `(0, 0, svgWidth, svgHeight)` defines the viewport of the SVG, or say,
- // "viewport boundingRect", or `boundingRect` for short.
- // - `viewBox` defines the transform from the real content ot the viewport.
- // `viewBox` has the same unit as the content of SVG.
- // If `viewBox` exists, a transform is defined, so the unit of `svgWidth/svgHeight` become
- // different from the content of SVG. Otherwise, they are the same.
- // If both `svgWidth/svgHeight/viewBox` are specified in a SVG file, the transform rule will be:
- // 0. `boundingRect` is `(0, 0, svgWidth, svgHeight)`. Set it to Geo['_rect'] (View['_rect']).
- // 1. Make a transform from `viewBox` to `boundingRect`.
- // Note: only support `preserveAspectRatio 'xMidYMid'` here. That is, this transform will preserve
- // the aspect ratio.
- // 2. Make a transform from boundingRect to Geo['_viewRect'] (View['_viewRect'])
- // (`Geo`/`View` will do this job).
- // Note: this transform might not preserve aspect radio, which depending on how users specify
- // viewRect in echarts option (e.g., `geo.left/top/width/height` will not preserve aspect ratio,
- // but `geo.layoutCenter/layoutSize` will preserve aspect ratio).
- // If `svgWidth/svgHeight` not specified, we use `viewBox` as the `boundingRect` to make the SVG
- // layout look good.
- // If neither `svgWidth/svgHeight` nor `viewBox` are not specified, we calculate the boundingRect
- // of the SVG content and use them to make SVG layout look good.
- var o=e.width,r=e.height,l=e.viewBoxRect,u=this._boundingRect;if(!u){var c=void 0,d=void 0,h=void 0,p=void 0;
- // If both viewBox and svgWidth/svgHeight not specified,
- // we have to determine how to layout those element to make them look good.
- if(null!=o?(c=0,h=o):l&&(c=l.x,h=l.width),null!=r?(d=0,p=r):l&&(d=l.y,p=l.height),null==c||null==d){var f=n.getBoundingRect();null==c&&(c=f.x,h=f.width),null==d&&(d=f.y,p=f.height)}u=this._boundingRect=new Y(c,d,h,p)}if(l){var g=Jt(l,u);
- // Only support `preserveAspectRatio 'xMidYMid'`
- n.scaleX=n.scaleY=g.scale,n.x=g.x,n.y=g.y}
- // SVG needs to clip based on `viewBox`. And some SVG files really rely on this feature.
- // They do not strictly confine all of the content inside a display rect, but deliberately
- // use a `viewBox` to define a displayable rect.
- // PENDING:
- // The drawback of the `setClipPath` here is: the region label (genereted by echarts) near the
- // edge might also be clipped, because region labels are put as `textContent` of the SVG path.
- i.setClipPath(new G({shape:u.plain()}));var y=[];return a(e.named,(function(t){var e;null!=Kv.get(t.svgNodeTagLower)&&(y.push(t),
- // Only named element has silent: false, other elements should
- // act as background and has no user interaction.
- (e=t.el).silent=!1,
- // text|tspan will be converted to group.
- e.isGroup&&e.traverse((function(t){t.silent=!1})))})),{root:i,boundingRect:u,named:y}},
- /**
- * Consider:
- * (1) One graphic element can not be shared by different `geoView` running simultaneously.
- * Notice, also need to consider multiple echarts instances share a `mapRecord`.
- * (2) Converting SVG to graphic elements is time consuming.
- * (3) In the current architecture, `load` should be called frequently to get boundingRect,
- * and it is called without view info.
- * So we maintain graphic elements in this module, and enables `view` to use/return these
- * graphics from/to the pool with it's uid.
- */
- t.prototype.useGraphic=function(t/* , nameMap: NameMap */){var e=this._usedGraphicMap,n=e.get(t);return n||(n=this._freedGraphics.pop()||this._buildGraphic(this._parsedXML),e.set(t,n),n)},t.prototype.freeGraphic=function(t){var e=this._usedGraphicMap,n=e.get(t);n&&(e.removeKey(t),this._freedGraphics.push(n))},t}();for(var $v=[126,25],Qv="南海诸岛",tx=[[[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]]],ex=0;ex<tx.length;ex++)for(var nx=0;nx<tx[ex].length;nx++)tx[ex][nx][0]/=10.5,tx[ex][nx][1]/=-14,tx[ex][nx][0]+=$v[0],tx[ex][nx][1]+=$v[1];
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- var ix={"南海诸岛":[32,80],
- // 全国
- "广东":[0,-10],"香港":[10,5],"澳门":[-10,10],
- // '北京': [-10, 0],
- "天津":[5,5]};
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- // Fix for 钓鱼岛
- // let Region = require('../Region');
- // let zrUtil = require('zrender/lib/core/util');
- // let geoCoord = [126, 25];
- var ox=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];var rx=/** @class */function(){function e(e,n,i){var o;this.type="geoJSON",this._parsedMap=r(),this._mapName=e,this._specialAreas=i,
- // PENDING: delay the parse to the first usage to rapid up the FMP?
- this._geoJSON=t(o=n)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(o):new Function("return ("+o+");")():o}
- /**
- * @param nameMap can be null/undefined
- * @param nameProperty can be null/undefined
- */return e.prototype.load=function(t,e){e=e||"name";var n=this._parsedMap.get(e);if(!n){var i=this._parseToRegions(e);n=this._parsedMap.set(e,{regions:i,boundingRect:ax(i)})}var o=r(),s=[];return a(n.regions,(function(e){var n=e.name;
- // Try use the alias in geoNameMap
- t&&N(t,n)&&(e=e.cloneShallow(n=t[n])),s.push(e),o.set(n,e)})),{regions:s,boundingRect:n.boundingRect||new Y(0,0,0,0),regionsMap:o}},e.prototype._parseToRegions=function(t){var e,i=this._mapName,o=this._geoJSON;
- // https://jsperf.com/try-catch-performance-overhead
- try{e=o?If(o,t):[]}catch(r){throw new Error("Invalid geoJson format\n"+r.message)}return function(t,e){if("china"===t){for(var i=0;i<e.length;i++)
- // Already exists.
- if(e[i].name===Qv)return;e.push(new bf(Qv,n(tx,(function(t){return{type:"polygon",exterior:t}})),$v))}}(i,e),a(e,(function(t){var e=t.name;!function(t,e){if("china"===t){var n=ix[e.name];if(n){var i=e.getCenter();i[0]+=n[0]/10.5,i[1]+=-n[1]/14,e.setCenter(i)}}}(i,t),function(t,e){"china"===t&&"台湾"===e.name&&e.geometries.push({type:"polygon",exterior:ox[0]})}(i,t);
- // Some area like Alaska in USA map needs to be tansformed
- // to look better
- var n=this._specialAreas&&this._specialAreas[e];n&&t.transformTo(n.left,n.top,n.width,n.height)}),this),e},
- /**
- * Only for exporting to users.
- * **MUST NOT** used internally.
- */
- e.prototype.getMapForUser=function(){return{
- // For backward compatibility, use geoJson
- // PENDING: it has been returning them without clone.
- // do we need to avoid outsite modification?
- geoJson:this._geoJSON,geoJSON:this._geoJSON,specialAreas:this._specialAreas}},e}();function ax(t){for(var e,n=0;n<t.length;n++){var i=t[n].getBoundingRect();(e=e||i.clone()).union(i)}return e}var sx=r();const lx=function(t,e,n){if(e.svg){var i=new Jv(t,e.svg);sx.set(t,i)}else{
- // Recommend:
- // echarts.registerMap('eu', { geoJSON: xxx, specialAreas: xxx });
- // Backward compatibility:
- // echarts.registerMap('eu', geoJSON, specialAreas);
- // echarts.registerMap('eu', { geoJson: xxx, specialAreas: xxx });
- var o=e.geoJson||e.geoJSON;o&&!e.features?n=e.specialAreas:o=e;i=new rx(t,o,n);sx.set(t,i)}},ux=function(t){return sx.get(t)},cx=function(t){var e=sx.get(t);
- // Do not support return SVG until some real requirement come.
- return e&&"geoJSON"===e.type&&e.getMapForUser()},dx=function(t,e,n){var i=sx.get(t);if(i)return i.load(e,n)};
- /**
- * Only these tags enable use `itemStyle` if they are named in SVG.
- * Other tags like <text> <tspan> <image> might not suitable for `itemStyle`.
- * They will not be considered to be styled until some requirements come.
- */var hx=["rect","circle","line","ellipse","polygon","polyline","path"],px=r(hx),fx=r(hx.concat(["g"])),gx=r(hx.concat(["g"])),yx=On();function mx(t){var e=t.getItemStyle(),n=t.get("areaColor");
- // If user want the color not to be changed when hover,
- // they should both set areaColor and color to be null.
- return null!=n&&(e.fill=n),e}
- // Only stroke can be used for line.
- // Using fill in style if stroke not exits.
- // TODO Not sure yet. Perhaps a separate `lineStyle`?
- function vx(t){var e=t.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var xx=/** @class */function(){function t(t){var e=new Z;this.uid=vr("ec_map_draw"),this._controller=new Uv(t.getZr()),this._controllerHost={target:e},this.group=e,e.add(this._regionsGroup=new Z),e.add(this._svgGroup=new Z)}return t.prototype.draw=function(t,e,n,i,o){var r="geo"===t.mainType,a=t.getData&&t.getData();
- // Map series has data. GEO model that controlled by map series
- // will be assigned with map data. Other GEO model has no data.
- r&&e.eachComponent({mainType:"series",subType:"map"},(function(e){a||e.getHostGeoModel()!==t||(a=e.getData())}));var s=t.coordinateSystem,l=this._regionsGroup,u=this.group,c=s.getTransformInfo(),d=c.raw,h=c.roam;!l.childAt(0)||o?(u.x=h.x,u.y=h.y,u.scaleX=h.scaleX,u.scaleY=h.scaleY,u.dirty()):io(u,h,t);var p=a&&a.getVisual("visualMeta")&&a.getVisual("visualMeta").length>0,f={api:n,geo:s,mapOrGeoModel:t,data:a,isVisualEncodedByVisualMap:p,isGeo:r,transformInfoRaw:d};"geoJSON"===s.resourceType?this._buildGeoJSON(f):"geoSVG"===s.resourceType&&this._buildSVG(f),this._updateController(t,e,n),this._updateMapSelectHandler(t,l,n,i)},t.prototype._buildGeoJSON=function(t){var e=this._regionsGroupByName=r(),n=r(),i=this._regionsGroup,o=t.transformInfoRaw,s=t.mapOrGeoModel,l=t.data,u=t.geo.projection,c=u&&u.stream;function d(t,e){return e&&(
- // projection may return null point.
- t=e(t)),t&&[t[0]*o.scaleX+o.x,t[1]*o.scaleY+o.y]}function h(t){for(var e=[],n=!c&&u&&u.project,i=0
- // If projectionStream is provided. Use it instead of single point project.
- ;i<t.length;++i){var o=d(t[i],n);o&&e.push(o)}return e}function p(t){return{shape:{points:h(t)}}}i.removeAll(),
- // Only when the resource is GeoJSON, there is `geo.regions`.
- a(t.geo.regions,(function(o){var r=o.name,h=e.get(r),f=n.get(r)||{},g=f.dataIdx,y=f.regionModel;
- // Consider in GeoJson properties.name may be duplicated, for example,
- // there is multiple region named "United Kindom" or "France" (so many
- // colonies). And it is not appropriate to merge them in geo, which
- // will make them share the same label and bring trouble in label
- // location calculation.
- if(!h){h=e.set(r,new Z),i.add(h),g=l?l.indexOfName(r):null;var m=(y=t.isGeo?s.getRegionModel(r):l?l.getItemModel(g):null).get("silent",!0);null!=m&&(h.silent=m),n.set(r,{dataIdx:g,regionModel:y})}var v=[],x=[];a(o.geometries,(function(t){
- // Polygon and MultiPolygon
- if("polygon"===t.type){var e=[t.exterior].concat(t.interiors||[]);c&&(e=Ix(e,c)),a(e,(function(t){v.push(new z(p(t)))}))}
- // LineString and MultiLineString
- else{var n=t.points;c&&(n=Ix(n,c,!0)),a(n,(function(t){x.push(new B(p(t)))}))}}));var _=d(o.getCenter(),u&&u.project);function b(e,n){if(e.length){var i=new U({culling:!0,segmentIgnoreThreshold:1,shape:{paths:e}});h.add(i),_x(t,i,g,y),bx(t,i,r,y,s,g,_),n&&(vx(i),a(i.states,vx))}}b(v),b(x,!0)})),
- // Ensure children have been added to `regionGroup` before calling them.
- e.each((function(e,i){var o=n.get(i),r=o.dataIdx,a=o.regionModel;Sx(t,e,i,a,s,r),wx(t,e,i,a,s),Mx(t,e,i,a,s)}),this)},t.prototype._buildSVG=function(t){var e=t.geo.map,n=t.transformInfoRaw;this._svgGroup.x=n.x,this._svgGroup.y=n.y,this._svgGroup.scaleX=n.scaleX,this._svgGroup.scaleY=n.scaleY,this._svgResourceChanged(e)&&(this._freeSVG(),this._useSVG(e));var i=this._svgDispatcherMap=r(),o=!1;a(this._svgGraphicRecord.named,(function(e){
- // Note that we also allow different elements have the same name.
- // For example, a glyph of a city and the label of the city have
- // the same name and their tooltip info can be defined in a single
- // region option.
- var n=e.name,r=t.mapOrGeoModel,a=t.data,s=e.svgNodeTagLower,l=e.el,u=a?a.indexOfName(n):null,c=r.getRegionModel(n);null!=px.get(s)&&l instanceof $t&&_x(t,l,u,c),l instanceof $t&&(l.culling=!0);var d=c.get("silent",!0);
- // If self named:
- (null!=d&&(l.silent=d),
- // We do not know how the SVG like so we'd better not to change z2.
- // Otherwise it might bring some unexpected result. For example,
- // an area hovered that make some inner city can not be clicked.
- l.z2EmphasisLift=0,e.namedFrom)||(
- // label should batter to be displayed based on the center of <g>
- // if it is named rather than displayed on each child.
- null!=gx.get(s)&&bx(t,l,n,c,r,u,null),Sx(t,l,n,c,r,u),wx(t,l,n,c,r),null!=fx.get(s)&&("self"===Mx(t,l,n,c,r)&&(o=!0),(i.get(n)||i.set(n,[])).push(l)))}),this),this._enableBlurEntireSVG(o,t)},t.prototype._enableBlurEntireSVG=function(t,e){
- // It's a little complicated to support blurring the entire geoSVG in series-map.
- // So do not support it until some requirements come.
- // At present, in series-map, only regions can be blurred.
- if(t&&e.isGeo){var n=e.mapOrGeoModel.getModel(["blur","itemStyle"]).getItemStyle().opacity;
- // Only support `opacity` here. Because not sure that other props are suitable for
- // all of the elements generated by SVG (especially for Text/TSpan/Image/... ).
- this._svgGraphicRecord.root.traverse((function(t){if(!t.isGroup){
- // PENDING: clear those settings to SVG elements when `_freeSVG`.
- // (Currently it happen not to be needed.)
- Ci(t);var e=t.ensureState("blur").style||{};
- // Do not overwrite the region style that already set from region option.
- null==e.opacity&&null!=n&&(e.opacity=n),
- // If `ensureState('blur').style = {}`, there will be default opacity.
- // Enable `stateTransition` (animation).
- t.ensureState("emphasis")}}))}},t.prototype.remove=function(){this._regionsGroup.removeAll(),this._regionsGroupByName=null,this._svgGroup.removeAll(),this._freeSVG(),this._controller.dispose(),this._controllerHost=null},t.prototype.findHighDownDispatchers=function(t,e){if(null==t)return[];var n=e.coordinateSystem;if("geoJSON"===n.resourceType){var i=this._regionsGroupByName;if(i){var o=i.get(t);return o?[o]:[]}}else if("geoSVG"===n.resourceType)return this._svgDispatcherMap&&this._svgDispatcherMap.get(t)||[]},t.prototype._svgResourceChanged=function(t){return this._svgMapName!==t},t.prototype._useSVG=function(t){var e=ux(t);if(e&&"geoSVG"===e.type){var n=e.useGraphic(this.uid);this._svgGroup.add(n.root),this._svgGraphicRecord=n,this._svgMapName=t}},t.prototype._freeSVG=function(){var t=this._svgMapName;if(null!=t){var e=ux(t);e&&"geoSVG"===e.type&&e.freeGraphic(this.uid),this._svgGraphicRecord=null,this._svgDispatcherMap=null,this._svgGroup.removeAll(),this._svgMapName=null}},t.prototype._updateController=function(t,e,n){var i=t.coordinateSystem,o=this._controller,r=this._controllerHost;
- // @ts-ignore FIXME:TS
- r.zoomLimit=t.get("scaleLimit"),r.zoom=i.getZoom(),
- // roamType is will be set default true if it is null
- // @ts-ignore FIXME:TS
- o.enable(t.get("roam")||!1);var a=t.mainType;function s(){var e={type:"geoRoam",componentType:a};return e[a+"Id"]=t.id,e}o.off("pan").on("pan",(function(t){this._mouseDownFlag=!1,Zv(r,t.dx,t.dy),n.dispatchAction(p(s(),{dx:t.dx,dy:t.dy,animation:{duration:0}}))}),this),o.off("zoom").on("zoom",(function(t){this._mouseDownFlag=!1,Xv(r,t.scale,t.originX,t.originY),n.dispatchAction(p(s(),{totalZoom:r.zoom,zoom:t.scale,originX:t.originX,originY:t.originY,animation:{duration:0}}))}),this),o.setPointerChecker((function(e,o,r){return i.containPoint([o,r])&&!qv(e,n,t)}))},
- /**
- * FIXME: this is a temporarily workaround.
- * When `geoRoam` the elements need to be reset in `MapView['render']`, because the props like
- * `ignore` might have been modified by `LabelManager`, and `LabelManager#addLabelsOfSeries`
- * will subsequently cache `defaultAttr` like `ignore`. If do not do this reset, the modified
- * props will have no chance to be restored.
- * Note: This reset should be after `clearStates` in `renderSeries` because `useStates` in
- * `renderSeries` will cache the modified `ignore` to `el._normalState`.
- * TODO:
- * Use clone/immutable in `LabelManager`?
- */
- t.prototype.resetForLabelLayout=function(){this.group.traverse((function(t){var e=t.getTextContent();e&&(e.ignore=yx(e).ignore)}))},t.prototype._updateMapSelectHandler=function(t,e,n,i){var o=this;e.off("mousedown"),e.off("click"),
- // @ts-ignore FIXME:TS resolve type conflict
- t.get("selectedMode")&&(e.on("mousedown",(function(){o._mouseDownFlag=!0})),e.on("click",(function(t){o._mouseDownFlag&&(o._mouseDownFlag=!1)})))},t}();function _x(t,e,n,i){
- // All of the path are using `itemStyle`, because
- // (1) Some SVG also use fill on polyline (The different between
- // polyline and polygon is "open" or "close" but not fill or not).
- // (2) For the common props like opacity, if some use itemStyle
- // and some use `lineStyle`, it might confuse users.
- // (3) Most SVG use <path>, where can not detect whether to draw a "line"
- // or a filled shape, so use `itemStyle` for <path>.
- var o=i.getModel("itemStyle"),r=i.getModel(["emphasis","itemStyle"]),a=i.getModel(["blur","itemStyle"]),s=i.getModel(["select","itemStyle"]),l=mx(o),u=mx(r),c=mx(s),d=mx(a),h=t.data;if(h){
- // Only visual color of each item will be used. It can be encoded by visualMap
- // But visual color of series is used in symbol drawing
- // Visual color for each series is for the symbol draw
- var p=h.getItemVisual(n,"style"),f=h.getItemVisual(n,"decal");t.isVisualEncodedByVisualMap&&p.fill&&(l.fill=p.fill),f&&(l.decal=Zc(f,t.api))}
- // SVG text, tspan and image can be named but not supporeted
- // to be styled by region option yet.
- e.setStyle(l),e.style.strokeNoScale=!0,e.ensureState("emphasis").style=u,e.ensureState("select").style=c,e.ensureState("blur").style=d,
- // Enable blur
- Ci(e)}function bx(t,e,n,i,o,
- // Exist only if `viewBuildCtx.data` exists.
- r,
- // If labelXY not provided, use `textConfig.position: 'inside'`
- a){var s=t.data,l=t.isGeo,u=s&&isNaN(s.get(s.mapDimension("value"),r)),c=s&&s.getItemLayout(r);
- // In the following cases label will be drawn
- // 1. In map series and data value is NaN
- // 2. In geo component
- // 3. Region has no series legendIcon, which will be add a showLabel flag in mapSymbolLayout
- if(l||u||c&&c.showLabel){var d=l?n:r,h=void 0;
- // Consider dataIdx not found.
- (!s||r>=0)&&(h=o);var p=a?{normal:{align:"center",verticalAlign:"middle"}}:null;
- // Caveat: must be called after `setDefaultStateProxy(el);` called.
- // because textContent will be assign with `el.stateProxy` inside.
- Yo(e,Uo(i),{labelFetcher:h,labelDataIndex:d,defaultText:n},p);var f=e.getTextContent();if(f&&(yx(f).ignore=f.ignore,e.textConfig&&a)){
- // Compute a relative offset based on the el bounding rect.
- var g=e.getBoundingRect().clone();
- // Need to make sure the percent position base on the same rect in normal and
- // emphasis state. Otherwise if using boundingRect of el, but the emphasis state
- // has borderWidth (even 0.5px), the text position will be changed obviously
- // if the position is very big like ['1234%', '1345%'].
- e.textConfig.layoutRect=g,e.textConfig.position=[(a[0]-g.x)/g.width*100+"%",(a[1]-g.y)/g.height*100+"%"]}
- // PENDING:
- // If labelLayout is enabled (test/label-layout.html), el.dataIndex should be specified.
- // But el.dataIndex is also used to determine whether user event should be triggered,
- // where el.seriesIndex or el.dataModel must be specified. At present for a single el
- // there is not case that "only label layout enabled but user event disabled", so here
- // we depends `resetEventTriggerForRegion` to do the job of setting `el.dataIndex`.
- e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function Sx(t,e,n,i,o,
- // Exist only if `viewBuildCtx.data` exists.
- r){
- // setItemGraphicEl, setHoverStyle after all polygons and labels
- // are added to the regionGroup
- t.data?
- // FIXME: when series-map use a SVG map, and there are duplicated name specified
- // on different SVG elements, after `data.setItemGraphicEl(...)`:
- // (1) all of them will be mounted with `dataIndex`, `seriesIndex`, so that tooltip
- // can be triggered only mouse hover. That's correct.
- // (2) only the last element will be kept in `data`, so that if trigger tooltip
- // by `dispatchAction`, only the last one can be found and triggered. That might be
- // not correct. We will fix it in future if anyone demanding that.
- t.data.setItemGraphicEl(r,e):
- // Package custom mouse event for geo component
- ni(e).eventData={componentType:"geo",componentIndex:o.componentIndex,geoIndex:o.componentIndex,name:n,region:i&&i.option||{}}}function wx(t,e,n,i,o){t.data||Vo({el:e,componentModel:o,itemName:n,
- // @ts-ignore FIXME:TS fix the "compatible with each other"?
- itemTooltipOption:i.get("tooltip")})}function Mx(t,e,n,i,o){
- // @ts-ignore FIXME:TS fix the "compatible with each other"?
- e.highDownSilentOnTouch=!!o.get("selectedMode");
- // @ts-ignore FIXME:TS fix the "compatible with each other"?
- var r=i.getModel("emphasis"),a=r.get("focus");return Ui(e,a,r.get("blurScope"),r.get("disabled")),t.isGeo&&function(t,e,n){var i=ni(t);i.componentMainType=e.mainType,i.componentIndex=e.componentIndex,i.componentHighDownName=n}(e,o,n),a}function Ix(t,
- // Polygons include exterior and interiors. Or polylines.
- e,n){var i,o=[];function r(){i=[]}function s(){i.length&&(o.push(i),i=[])}var l=e({polygonStart:r,polygonEnd:s,lineStart:r,lineEnd:s,point:function(t,e){
- // May have NaN values from stream.
- isFinite(t)&&isFinite(e)&&i.push([t,e])},sphere:function(){}});return!n&&l.polygonStart(),a(t,(function(t){l.lineStart();for(var e=0;e<t.length;e++)l.point(t[e][0],t[e][1]);l.lineEnd()})),!n&&l.polygonEnd(),o}const Dx=xx;
- // @ts-ignore FIXME:TS fix the "compatible with each other"?
- var Tx=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n,i){
- // Not render if it is an toggleSelect action from self
- if(!i||"mapToggleSelect"!==i.type||i.from!==this.uid){var o=this.group;if(o.removeAll(),!t.getHostGeoModel()){
- // Not update map if it is an roam action from self
- if(this._mapDraw&&i&&"geoRoam"===i.type&&this._mapDraw.resetForLabelLayout(),i&&"geoRoam"===i.type&&"series"===i.componentType&&i.seriesId===t.id)(r=this._mapDraw)&&o.add(r.group);else if(t.needsDrawMap){var r=this._mapDraw||new Dx(n);o.add(r.group),r.draw(t,e,n,this,i),this._mapDraw=r}else
- // Remove drawn map
- this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&e.getComponent("legend")&&this._renderSymbols(t,e,n)}}},e.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},e.prototype._renderSymbols=function(t,e,n){var i=t.originalData,o=this.group;i.each(i.mapDimension("value"),(function(e,n){if(!isNaN(e)){var r=i.getItemLayout(n);if(r&&r.point){var a=r.point,s=r.offset,l=new O({style:{
- // Because the special of map draw.
- // Which needs statistic of multiple series and draw on one map.
- // And each series also need a symbol with legend color
- // Layout and visual are put one the different data
- // TODO
- fill:t.getData().getVisual("style").fill},shape:{cx:a[0]+9*s,cy:a[1],r:3},silent:!0,
- // Do not overlap the first series, on which labels are displayed.
- z2:8+(s?0:11)});
- // Only the series that has the first value on the same region is in charge of rendering the label.
- // But consider the case:
- // series: [
- // {id: 'X', type: 'map', map: 'm', {data: [{name: 'A', value: 11}, {name: 'B', {value: 22}]},
- // {id: 'Y', type: 'map', map: 'm', {data: [{name: 'A', value: 21}, {name: 'C', {value: 33}]}
- // ]
- // The offset `0` of item `A` is at series `X`, but of item `C` is at series `Y`.
- // For backward compatibility, we follow the rule that render label `A` by the
- // settings on series `X` but render label `C` by the settings on series `Y`.
- if(!s){var u=t.mainSeries.getData(),c=i.getName(n),d=u.indexOfName(c),h=i.getItemModel(n),p=h.getModel("label"),f=u.getItemGraphicEl(d);
- // `getFormattedLabel` needs to use `getData` inside. Here
- // `mapModel.getData()` is shallow cloned from `mainSeries.getData()`.
- // FIXME
- // If this is not the `mainSeries`, the item model (like label formatter)
- // set on original data item will never get. But it has been working
- // like that from the beginning, and this scenario is rarely encountered.
- // So it won't be fixed until we have to.
- Yo(l,Uo(h),{labelFetcher:{getFormattedLabel:function(e,n){return t.getFormattedLabel(d,n)}},defaultText:c}),l.disableLabelAnimation=!0,p.get("position")||l.setTextConfig({position:"bottom"}),f.onHoverStateChange=function(t){Di(l,t)}}o.add(l)}}}))},e.type="map",e}(Ou);const Cx=Tx;var Ax=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,
- // Only first map series of same mapType will drawMap.
- n.needsDrawMap=!1,
- // Group of all map series with same mapType
- n.seriesGroup=[],n.getTooltipPosition=function(t){if(null!=t){var e=this.getData().getName(t),n=this.coordinateSystem,i=n.getRegion(e);return i&&n.dataToPoint(i.getCenter())}},n}return Ue(e,t),e.prototype.getInitialData=function(t){for(var e=um(this,{coordDimensions:["value"],encodeDefaulter:rt(Ua,this)}),n=r(),i=[],o=0,s=e.count();o<s;o++){var l=e.getName(o);n.set(l,o)}var u=dx(this.getMapType(),this.option.nameMap,this.option.nameProperty);return a(u.regions,(function(t){var o,r=t.name,a=n.get(r),s=t.properties&&t.properties.echartsStyle;null==a?(o={name:r},i.push(o)):o=e.getRawDataItem(a),s&&tt(o,s)})),
- // Complete data with missing regions. The consequent processes (like visual
- // map and render) can not be performed without a "full data". For example,
- // find `dataIndex` by name.
- e.appendData(i),e},
- /**
- * If no host geo model, return null, which means using a
- * inner exclusive geo model.
- */
- e.prototype.getHostGeoModel=function(){var t=this.option.geoIndex;return null!=t?this.ecModel.getComponent("geo",t):null},e.prototype.getMapType=function(){return(this.getHostGeoModel()||this).option.map},
- // _fillOption(option, mapName) {
- // Shallow clone
- // option = zrUtil.extend({}, option);
- // option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap);
- // return option;
- // }
- e.prototype.getRawValue=function(t){
- // Use value stored in data instead because it is calculated from multiple series
- // FIXME Provide all value of multiple series ?
- var e=this.getData();return e.get(e.mapDimension("value"),t)},
- /**
- * Get model of region
- */
- e.prototype.getRegionModel=function(t){var e=this.getData();return e.getItemModel(e.indexOfName(t))},
- /**
- * Map tooltip formatter
- */
- e.prototype.formatTooltip=function(t,e,n){for(
- // FIXME orignalData and data is a bit confusing
- var i=this.getData(),o=this.getRawValue(t),r=i.getName(t),a=this.seriesGroup,s=[],l=0;l<a.length;l++){var u=a[l].originalData.indexOfName(r),c=i.mapDimension("value");isNaN(a[l].originalData.get(c,u))||s.push(a[l].name)}return $l("section",{header:s.join(", "),noHeader:!s.length,blocks:[$l("nameValue",{name:r,value:o})]})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.getLegendIcon=function(t){var e=t.icon||"roundRect",n=Gc(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill);return n.setStyle(t.itemStyle),
- // Map do not use itemStyle.borderWidth as border width
- n.style.stroke="none",
- // No rotation because no series visual symbol for map
- e.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={
- // 一级层叠
- // zlevel: 0,
- // 二级层叠
- z:2,coordinateSystem:"geo",
- // map should be explicitly specified since ec3.
- map:"",
- // If `geoIndex` is not specified, a exclusive geo will be
- // created. Otherwise use the specified geo component, and
- // `map` and `mapType` are ignored.
- // geoIndex: 0,
- // 'center' | 'left' | 'right' | 'x%' | {number}
- left:"center",
- // 'center' | 'top' | 'bottom' | 'x%' | {number}
- top:"center",
- // right
- // bottom
- // width:
- // height
- // Aspect is width / height. Inited to be geoJson bbox aspect
- // This parameter is used for scale this aspect
- // Default value:
- // for geoSVG source: 1,
- // for geoJSON source: 0.75.
- aspectScale:null,
- // Layout with center and size
- // If you want to put map in a fixed size box with right aspect ratio
- // This two properties may be more convenient.
- // layoutCenter: [50%, 50%]
- // layoutSize: 100
- showLegendSymbol:!0,
- // Define left-top, right-bottom coords to control view
- // For example, [ [180, 90], [-180, -90] ],
- // higher priority than center and zoom
- boundingCoords:null,
- // Default on center of map
- center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},
- // scaleLimit: null,
- itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(Su);const Lx=Ax;
- // FIXME 公用?
- function kx(t){var e={};t.eachSeriesByType("map",(function(t){var n=t.getHostGeoModel(),i=n?"o"+n.id:"i"+t.getMapType();(e[i]=e[i]||[]).push(t)})),a(e,(function(t,e){for(var i,o,r,s=(i=n(t,(function(t){return t.getData()})),o=t[0].get("mapValueCalculation"),r={},a(i,(function(t){t.each(t.mapDimension("value"),(function(e,n){
- // Add prefix to avoid conflict with Object.prototype.
- var i="ec-"+t.getName(n);r[i]=r[i]||[],isNaN(e)||r[i].push(e)}))})),i[0].map(i[0].mapDimension("value"),(function(t,e){for(var n="ec-"+i[0].getName(e),a=0,s=Infinity,l=-Infinity,u=r[n].length,c=0;c<u;c++)s=Math.min(s,r[n][c]),l=Math.max(l,r[n][c]),a+=r[n][c];return 0===u?NaN:"min"===o?s:"max"===o?l:"average"===o?a/u:a}))),l=0;l<t.length;l++)t[l].originalData=t[l].getData();
- // FIXME Put where?
- for(l=0;l<t.length;l++)t[l].seriesGroup=t,t[l].needsDrawMap=0===l&&!t[l].getHostGeoModel(),t[l].setData(s.cloneShallow()),t[l].mainSeries=t[0]}))}function Px(t){var e={};t.eachSeriesByType("map",(function(n){var i=n.getMapType();if(!n.getHostGeoModel()&&!e[i]){var o={};a(n.seriesGroup,(function(e){var n=e.coordinateSystem,i=e.originalData;e.get("showLegendSymbol")&&t.getComponent("legend")&&i.each(i.mapDimension("value"),(function(t,e){var r=i.getName(e),a=n.getRegion(r);
- // If input series.data is [11, 22, '-'/null/undefined, 44],
- // it will be filled with NaN: [11, 22, NaN, 44] and NaN will
- // not be drawn. So here must validate if value is NaN.
- if(a&&!isNaN(t)){var s=o[r]||0,l=n.dataToPoint(a.getCenter());o[r]=s+1,i.setItemLayout(e,{point:l,offset:s})}}))}));
- // Show label of those region not has legendIcon (which is offset 0)
- var r=n.getData();r.each((function(t){var e=r.getName(t),n=r.getItemLayout(t)||{};n.showLabel=!o[e],r.setItemLayout(t,n)})),e[i]=!0}}))}var Nx=P,Ox=/** @class */function(t){function e(e){var n=t.call(this)||this;return n.type="view",n.dimensions=["x","y"],
- /**
- * Represents the transform brought by roam/zoom.
- * If `View['_viewRect']` applies roam transform,
- * we can get the final displayed rect.
- */
- n._roamTransformable=new L,
- /**
- * Represents the transform from `View['_rect']` to `View['_viewRect']`.
- */
- n._rawTransformable=new L,n.name=e,n}return Ue(e,t),e.prototype.setBoundingRect=function(t,e,n,i){return this._rect=new Y(t,e,n,i),this._rect},
- /**
- * @return {module:zrender/core/BoundingRect}
- */
- e.prototype.getBoundingRect=function(){return this._rect},e.prototype.setViewRect=function(t,e,n,i){this._transformTo(t,e,n,i),this._viewRect=new Y(t,e,n,i)},
- /**
- * Transformed to particular position and size
- */
- e.prototype._transformTo=function(t,e,n,i){var o=this.getBoundingRect(),r=this._rawTransformable;r.transform=o.calculateTransform(new Y(t,e,n,i));var a=r.parent;r.parent=null,r.decomposeTransform(),r.parent=a,this._updateTransform()},
- /**
- * Set center of view
- */
- e.prototype.setCenter=function(t,e){t&&(this._center=[je(t[0],e.getWidth()),je(t[1],e.getHeight())],this._updateCenterAndZoom())},e.prototype.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()},
- /**
- * Get default center without roam
- */
- e.prototype.getDefaultCenter=function(){
- // Rect before any transform
- var t=this.getBoundingRect();return[t.x+t.width/2,t.y+t.height/2]},e.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},e.prototype.getZoom=function(){return this._zoom||1},e.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},
- /**
- * Remove roam
- */
- e.prototype._updateCenterAndZoom=function(){
- // Must update after view transform updated
- var t=this._rawTransformable.getLocalTransform(),e=this._roamTransformable,n=this.getDefaultCenter(),i=this.getCenter(),o=this.getZoom();i=P([],i,t),n=P([],n,t),e.originX=i[0],e.originY=i[1],e.x=n[0]-i[0],e.y=n[1]-i[1],e.scaleX=e.scaleY=o,this._updateTransform()},
- /**
- * Update transform props on `this` based on the current
- * `this._roamTransformable` and `this._rawTransformable`.
- */
- e.prototype._updateTransform=function(){var t=this._roamTransformable,e=this._rawTransformable;e.parent=t,t.updateTransform(),e.updateTransform(),Qt(this.transform||(this.transform=[]),e.transform||te()),this._rawTransform=e.getLocalTransform(),this.invTransform=this.invTransform||[],k(this.invTransform,this.transform),this.decomposeTransform()},e.prototype.getTransformInfo=function(){var t=this._rawTransformable,e=this._roamTransformable,n=new L;return n.transform=e.transform,n.decomposeTransform(),{roam:{x:n.x,y:n.y,scaleX:n.scaleX,scaleY:n.scaleY},raw:{x:t.x,y:t.y,scaleX:t.scaleX,scaleY:t.scaleY}}},e.prototype.getViewRect=function(){return this._viewRect},
- /**
- * Get view rect after roam transform
- */
- e.prototype.getViewRectAfterRoam=function(){var t=this.getBoundingRect().clone();return t.applyTransform(this.transform),t},
- /**
- * Convert a single (lon, lat) data item to (x, y) point.
- */
- e.prototype.dataToPoint=function(t,e,n){var i=e?this._rawTransform:this.transform;return n=n||[],i?Nx(n,t,i):ee(n,t)},
- /**
- * Convert a (x, y) point to (lon, lat) data
- */
- e.prototype.pointToData=function(t){var e=this.invTransform;return e?Nx([],t,e):[t[0],t[1]]},e.prototype.convertToPixel=function(t,e,n){var i=Rx(e);return i===this?i.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,e,n){var i=Rx(e);return i===this?i.pointToData(n):null},
- /**
- * @implements
- */
- e.prototype.containPoint=function(t){return this.getViewRectAfterRoam().contain(t[0],t[1])},e.dimensions=["x","y"],e}(L);function Rx(t){var e=t.seriesModel;return e?e.coordinateSystem:null;// e.g., graph.
- }const Ex=Ox;var Vx={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},zx=["lng","lat"],Bx=/** @class */function(e){function n(t,n,i){var o=e.call(this,t)||this;o.dimensions=zx,o.type="geo",
- // Only store specified name coord via `addGeoCoord`.
- o._nameCoordMap=r(),o.map=n;var a=i.projection,s=dx(n,i.nameMap,i.nameProperty),l=ux(n);o.resourceType=l?l.type:null;var u,c=o.regions=s.regions,d=Vx[l.type];if(o._regionsMap=s.regionsMap,o.regions=s.regions,o.projection=a,a)
- // Can't reuse the raw bounding rect
- for(var h=0;h<c.length;h++){var p=c[h].getBoundingRect(a);(u=u||p.clone()).union(p)}else u=s.boundingRect;return o.setBoundingRect(u.x,u.y,u.width,u.height),
- // aspectScale and invertLongitute actually is the parameters default raw projection.
- // So we ignore them if projection is given.
- // Ignore default aspect scale if projection exits.
- o.aspectScale=a?1:x(i.aspectScale,d.aspectScale),
- // Not invert longitude if projection exits.
- o._invertLongitute=!a&&d.invertLongitute,o}return Ue(n,e),n.prototype._transformTo=function(t,e,n,i){var o=this.getBoundingRect(),r=this._invertLongitute;o=o.clone(),r&&(
- // Longitude is inverted.
- o.y=-o.y-o.height);var a=this._rawTransformable;a.transform=o.calculateTransform(new Y(t,e,n,i));var s=a.parent;a.parent=null,a.decomposeTransform(),a.parent=s,r&&(a.scaleY=-a.scaleY),this._updateTransform()},n.prototype.getRegion=function(t){return this._regionsMap.get(t)},n.prototype.getRegionByCoord=function(t){for(var e=this.regions,n=0;n<e.length;n++){var i=e[n];if("geoJSON"===i.type&&i.contain(t))return e[n]}},
- /**
- * Add geoCoord for indexing by name
- */
- n.prototype.addGeoCoord=function(t,e){this._nameCoordMap.set(t,e)},
- /**
- * Get geoCoord by name
- */
- n.prototype.getGeoCoord=function(t){var e=this._regionsMap.get(t);
- // Calculate center only on demand.
- return this._nameCoordMap.get(t)||e&&e.getCenter()},n.prototype.dataToPoint=function(e,n,i){if(t(e)&&(
- // Map area name to geoCoord
- e=this.getGeoCoord(e)),e){var o=this.projection;return o&&(
- // projection may return null point.
- e=o.project(e)),e&&this.projectedToPoint(e,n,i)}},n.prototype.pointToData=function(t){var e=this.projection;return e&&(
- // projection may return null point.
- t=e.unproject(t)),t&&this.pointToProjected(t)},
- /**
- * Point to projected data. Same with pointToData when projection is used.
- */
- n.prototype.pointToProjected=function(t){return e.prototype.pointToData.call(this,t)},n.prototype.projectedToPoint=function(t,n,i){return e.prototype.dataToPoint.call(this,t,n,i)},n.prototype.convertToPixel=function(t,e,n){var i=Gx(e);return i===this?i.dataToPoint(n):null},n.prototype.convertFromPixel=function(t,e,n){var i=Gx(e);return i===this?i.pointToData(n):null},n}(Ex);function Gx(t){var e=t.geoModel,n=t.seriesModel;return e?e.coordinateSystem:n?n.coordinateSystem||(n.getReferringComponents("geo",zn).models[0]||{}).coordinateSystem:null}nt(Bx,Ex);const Fx=Bx;
- /**
- * Resize method bound to the geo
- */function Wx(t,e){var n=t.get("boundingCoords");if(null!=n){var i=n[0],o=n[1];if(isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])){
- // Sample around the lng/lat rect and use projection to calculate actual bounding rect.
- var r=this.projection;if(r){var a=i[0],s=i[1],l=o[0],u=o[1];i=[Infinity,Infinity],o=[-Infinity,-Infinity];
- // TODO better way?
- var c=function(t,e,n,a){for(var s=n-t,l=a-e,u=0;u<=100;u++){var c=u/100,d=r.project([t+s*c,e+l*c]);Tt(i,i,d),Ct(o,o,d)}};
- // Top
- c(a,s,l,s),
- // Right
- c(l,s,l,u),
- // Bottom
- c(l,u,a,u),
- // Left
- c(a,u,l,s)}this.setBoundingRect(i[0],i[1],o[0]-i[0],o[1]-i[1])}else;}var d,h,p,f=this.getBoundingRect(),g=t.get("layoutCenter"),y=t.get("layoutSize"),m=e.getWidth(),v=e.getHeight(),x=f.width/f.height*this.aspectScale,_=!1;if(g&&y&&(d=[je(g[0],m),je(g[1],v)],h=je(y,Math.min(m,v)),isNaN(d[0])||isNaN(d[1])||isNaN(h)||(_=!0)),_)p={},x>1?(
- // Width is same with size
- p.width=h,p.height=h/x):(p.height=h,p.width=h*x),p.y=d[1]-p.height/2,p.x=d[0]-p.width/2;else{
- // Use left/top/width/height
- var b=t.getBoxLayoutParams();b.aspect=x,p=xa(b,{width:m,height:v})}this.setViewRect(p.x,p.y,p.width,p.height),this.setCenter(t.get("center"),e),this.setZoom(t.get("zoom"))}
- // Back compat for ECharts2, where the coord map is set on map series:
- // {type: 'map', geoCoord: {'cityA': [116.46,39.92], 'cityA': [119.12,24.61]}},
- var Hx=/** @class */function(){function t(){
- // For deciding which dimensions to use when creating list data
- this.dimensions=zx}return t.prototype.create=function(t,e){var i=[];function o(t){return{nameProperty:t.get("nameProperty"),aspectScale:t.get("aspectScale"),projection:t.get("projection")}}
- // FIXME Create each time may be slow
- t.eachComponent("geo",(function(t,n){var r=t.get("map"),a=new Fx(r+n,r,p({nameMap:t.get("nameMap")},o(t)));a.zoomLimit=t.get("scaleLimit"),i.push(a),
- // setGeoCoords(geo, geoModel);
- t.coordinateSystem=a,a.model=t,
- // Inject resize method
- a.resize=Wx,a.resize(t,e)})),t.eachSeries((function(t){if("geo"===t.get("coordinateSystem")){var e=t.get("geoIndex")||0;t.coordinateSystem=i[e]}}));
- // If has map series
- var r={};return t.eachSeriesByType("map",(function(t){if(!t.getHostGeoModel()){var e=t.getMapType();r[e]=r[e]||[],r[e].push(t)}})),a(r,(function(t,r){var s=n(t,(function(t){return t.get("nameMap")})),l=new Fx(r,r,p({nameMap:ne(s)},o(t[0])));l.zoomLimit=Yt.apply(null,n(t,(function(t){return t.get("scaleLimit")}))),i.push(l),
- // Inject resize method
- l.resize=Wx,l.resize(t[0],e),a(t,(function(t){t.coordinateSystem=l,function(t,e){a(e.get("geoCoord"),(function(e,n){t.addGeoCoord(n,e)}))}(l,t)}))})),i},
- /**
- * Fill given regions array
- */
- t.prototype.getFilledRegions=function(t,e,n,i){for(
- // Not use the original
- var o=(t||[]).slice(),s=r(),l=0;l<o.length;l++)s.set(o[l].name,o[l]);var u=dx(e,n,i);return a(u.regions,(function(t){var e=t.name,n=s.get(e),i=t.properties&&t.properties.echartsStyle;n||(n={name:e},o.push(n)),i&&tt(n,i)})),o},t}();const Yx=new Hx;var Ux=/** @class */function(n){function i(){var t=null!==n&&n.apply(this,arguments)||this;return t.type=i.type,t}return Ue(i,n),i.prototype.init=function(t,e,n){var i=ux(t.map);if(i&&"geoJSON"===i.type){var o=t.itemStyle=t.itemStyle||{};"color"in o||(o.color="#eee")}this.mergeDefaultAndTheme(t,n),
- // Default label emphasis `show`
- wn(t,"label",["show"])},i.prototype.optionUpdated=function(){var t=this,n=this.option;n.regions=Yx.getFilledRegions(n.regions,n.map,n.nameMap,n.nameProperty);var i={};this._optionModelMap=e(n.regions||[],(function(e,n){var o=n.name;return o&&(e.set(o,new yr(n,t,t.ecModel)),n.selected&&(i[o]=!0)),e}),r()),n.selectedMap||(n.selectedMap=i)},
- /**
- * Get model of region.
- */
- i.prototype.getRegionModel=function(t){return this._optionModelMap.get(t)||new yr(null,this,this.ecModel)},
- /**
- * Format label
- * @param name Region name
- */
- i.prototype.getFormattedLabel=function(e,n){var i=this.getRegionModel(e),o="normal"===n?i.get(["label","formatter"]):i.get(["emphasis","label","formatter"]),r={name:e};return f(o)?(r.status=n,o(r)):t(o)?o.replace("{a}",null!=e?e:""):void 0},i.prototype.setZoom=function(t){this.option.zoom=t},i.prototype.setCenter=function(t){this.option.center=t},
- // PENGING If selectedMode is null ?
- i.prototype.select=function(t){var e=this.option,n=e.selectedMode;n&&("multiple"!==n&&(e.selectedMap=null),(e.selectedMap||(e.selectedMap={}))[t]=!0)},i.prototype.unSelect=function(t){var e=this.option.selectedMap;e&&(e[t]=!1)},i.prototype.toggleSelected=function(t){this[this.isSelected(t)?"unSelect":"select"](t)},i.prototype.isSelected=function(t){var e=this.option.selectedMap;return!(!e||!e[t])},i.type="geo",i.layoutMode="box",i.defaultOption={
- // zlevel: 0,
- z:0,show:!0,left:"center",top:"center",
- // Default value:
- // for geoSVG source: 1,
- // for geoJSON source: 0.75.
- aspectScale:null,
- // /// Layout with center and size
- // If you want to put map in a fixed size box with right aspect ratio
- // This two properties may be more convenient
- // layoutCenter: [50%, 50%]
- // layoutSize: 100
- silent:!1,
- // Map type
- map:"",
- // Define left-top, right-bottom coords to control view
- // For example, [ [180, 90], [-180, -90] ]
- boundingCoords:null,
- // Default on center of map
- center:null,zoom:1,scaleLimit:null,
- // selectedMode: false
- label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},i}(Ta);const Zx=Ux;
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */function Xx(t,e){
- // Use projected coord as center because it's linear.
- return t.pointToProjected?t.pointToProjected(e):t.pointToData(e)}function jx(t,e,n,i){var o=t.getZoom(),r=t.getCenter(),a=e.zoom,s=t.projectedToPoint?t.projectedToPoint(r):t.dataToPoint(r);if(null!=e.dx&&null!=e.dy&&(s[0]-=e.dx,s[1]-=e.dy,t.setCenter(Xx(t,s),i)),null!=a){if(n){var l=n.min||0,u=n.max||Infinity;a=Math.max(Math.min(o*a,u),l)/o}
- // Zoom on given point(originX, originY)
- t.scaleX*=a,t.scaleY*=a;var c=(e.originX-t.x)*(a-1),d=(e.originY-t.y)*(a-1);t.x-=c,t.y-=d,t.updateTransform(),
- // Get the new center
- t.setCenter(Xx(t,s),i),t.setZoom(a*o)}return{center:t.getCenter(),zoom:t.getZoom()}}const qx=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.focusBlurEnabled=!0,n}return Ue(e,t),e.prototype.init=function(t,e){this._api=e},e.prototype.render=function(t,e,n,i){if(this._model=t,!t.get("show"))return this._mapDraw&&this._mapDraw.remove(),void(this._mapDraw=null);this._mapDraw||(this._mapDraw=new Dx(n));var o=this._mapDraw;o.draw(t,e,n,this,i),o.group.on("click",this._handleRegionClick,this),o.group.silent=t.get("silent"),this.group.add(o.group),this.updateSelectStatus(t,e,n)},e.prototype._handleRegionClick=function(t){var e;kc(t.target,(function(t){return null!=(e=ni(t).eventData)}),!0),e&&this._api.dispatchAction({type:"geoToggleSelect",geoId:this._model.id,name:e.name})},e.prototype.updateSelectStatus=function(t,e,n){var i=this;this._mapDraw.group.traverse((function(t){var e=ni(t).eventData;if(e)
- // No need to traverse children.
- return i._model.isSelected(e.name)?n.enterSelect(t):n.leaveSelect(t),!0}))},e.prototype.findHighDownDispatchers=function(t){return this._mapDraw&&this._mapDraw.findHighDownDispatchers(t,this._model)},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove()},e.type="geo",e}(Mu);function Kx(t,e,n){lx(t,e,n)}function Jx(t){function e(e,n){n.update="geo:updateSelectStatus",t.registerAction(n,(function(t,n){var i={},o=[];return n.eachComponent({mainType:"geo",query:t},(function(n){n[e](t.name);var r=n.coordinateSystem;a(r.regions,(function(t){i[t.name]=n.isSelected(t.name)||!1}));
- // Notice: there might be duplicated name in different regions.
- var s=[];a(i,(function(t,e){i[e]&&s.push(e)})),o.push({geoIndex:n.componentIndex,
- // Use singular, the same naming convention as the event `selectchanged`.
- name:s})})),{selected:i,allSelected:o,name:t.name}}))}t.registerCoordinateSystem("geo",Yx),t.registerComponentModel(Zx),t.registerComponentView(qx),t.registerImpl("registerMap",Kx),t.registerImpl("getMap",(function(t){return cx(t)})),e("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),e("select",{type:"geoSelect",event:"geoselected"}),e("unSelect",{type:"geoUnSelect",event:"geounselected"}),
- /**
- * @payload
- * @property {string} [componentType=series]
- * @property {number} [dx]
- * @property {number} [dy]
- * @property {number} [zoom]
- * @property {number} [originX]
- * @property {number} [originY]
- */
- t.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},(function(t,e,n){var i=t.componentType||"series";e.eachComponent({mainType:i,query:t},(function(e){var o=e.coordinateSystem;if("geo"===o.type){var r=jx(o,t,e.get("scaleLimit"),n);e.setCenter&&e.setCenter(r.center),e.setZoom&&e.setZoom(r.zoom),
- // All map series with same `map` use the same geo coordinate system
- // So the center and zoom must be in sync. Include the series not selected by legend
- "series"===i&&a(e.seriesGroup,(function(t){t.setCenter(r.center),t.setZoom(r.zoom)}))}}))}))}
- /**
- * The implementation of this function was originally copied from "d3.js"
- * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
- * with some modifications made for this program.
- * See the license statement at the head of this file.
- *
- * Computes a preliminary x coordinate for node. Before that, this function is
- * applied recursively to the children of node, as well as the function
- * apportion(). After spacing out the children by calling executeShifts(), the
- * node is placed to the midpoint of its outermost children.
- */
- function $x(t,e){var n=t.isExpand?t.children:[],i=t.parentNode.children,o=t.hierNode.i?i[t.hierNode.i-1]:null;if(n.length){!
- /**
- * All other shifts, applied to the smaller subtrees between w- and w+, are
- * performed by this function.
- *
- * The implementation of this function was originally copied from "d3.js"
- * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
- * with some modifications made for this program.
- * See the license statement at the head of this file.
- */
- function(t){var e=t.children,n=e.length,i=0,o=0;for(;--n>=0;){var r=e[n];r.hierNode.prelim+=i,r.hierNode.modifier+=i,o+=r.hierNode.change,i+=r.hierNode.shift+o}}
- /**
- * The implementation of this function was originally copied from "d3.js"
- * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
- * with some modifications made for this program.
- * See the license statement at the head of this file.
- *
- * The core of the algorithm. Here, a new subtree is combined with the
- * previous subtrees. Threads are used to traverse the inside and outside
- * contours of the left and right subtree up to the highest common level.
- * Whenever two nodes of the inside contours conflict, we compute the left
- * one of the greatest uncommon ancestors using the function nextAncestor()
- * and call moveSubtree() to shift the subtree and prepare the shifts of
- * smaller subtrees. Finally, we add a new thread (if necessary).
- */(t);var r=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;o?(t.hierNode.prelim=o.hierNode.prelim+e(t,o),t.hierNode.modifier=t.hierNode.prelim-r):t.hierNode.prelim=r}else o&&(t.hierNode.prelim=o.hierNode.prelim+e(t,o));t.parentNode.hierNode.defaultAncestor=function(t,e,n,i){if(e){for(var o=t,r=t,a=r.parentNode.children[0],s=e,l=o.hierNode.modifier,u=r.hierNode.modifier,c=a.hierNode.modifier,d=s.hierNode.modifier;s=n_(s),r=i_(r),s&&r;){o=n_(o),a=i_(a),o.hierNode.ancestor=t;var h=s.hierNode.prelim+d-r.hierNode.prelim-u+i(s,r);h>0&&(r_(o_(s,t,n),t,h),u+=h,l+=h),d+=s.hierNode.modifier,u+=r.hierNode.modifier,l+=o.hierNode.modifier,c+=a.hierNode.modifier}s&&!n_(o)&&(o.hierNode.thread=s,o.hierNode.modifier+=d-l),r&&!i_(a)&&(a.hierNode.thread=r,a.hierNode.modifier+=u-c,n=t)}return n}
- /**
- * This function is used to traverse the right contour of a subtree.
- * It returns the rightmost child of node or the thread of node. The function
- * returns null if and only if node is on the highest depth of its subtree.
- */(t,o,t.parentNode.hierNode.defaultAncestor||i[0],e)}
- /**
- * The implementation of this function was originally copied from "d3.js"
- * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
- * with some modifications made for this program.
- * See the license statement at the head of this file.
- *
- * Computes all real x-coordinates by summing up the modifiers recursively.
- */function Qx(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function t_(t){return arguments.length?t:a_}
- /**
- * Transform the common coordinate to radial coordinate.
- */function e_(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}
- /**
- * Get the layout position of the whole view.
- */function n_(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}
- /**
- * This function is used to traverse the left contour of a subtree (or a subforest).
- * It returns the leftmost child of node or the thread of node. The function
- * returns null if and only if node is on the highest depth of its subtree.
- */function i_(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}
- /**
- * If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor.
- * Otherwise, returns the specified ancestor.
- */function o_(t,e,n){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:n}
- /**
- * The implementation of this function was originally copied from "d3.js"
- * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
- * with some modifications made for this program.
- * See the license statement at the head of this file.
- *
- * Shifts the current subtree rooted at wr.
- * This is done by increasing prelim(w+) and modifier(w+) by shift.
- */function r_(t,e,n){var i=n/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=i,e.hierNode.shift+=n,e.hierNode.modifier+=n,e.hierNode.prelim+=n,t.hierNode.change+=i}
- /**
- * The implementation of this function was originally copied from "d3.js"
- * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
- * with some modifications made for this program.
- * See the license statement at the head of this file.
- */function a_(t,e){return t.parentNode===e.parentNode?1:2}var s_=function(){this.parentPoint=[],this.childPoints=[]},l_=/** @class */function(t){function e(e){return t.call(this,e)||this}return Ue(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new s_},e.prototype.buildPath=function(t,e){var n=e.childPoints,i=n.length,o=e.parentPoint,r=n[0],a=n[i-1];if(1===i)return t.moveTo(o[0],o[1]),void t.lineTo(r[0],r[1]);var s=e.orient,l="TB"===s||"BT"===s?0:1,u=1-l,c=je(e.forkPosition,1),d=[];d[l]=o[l],d[u]=o[u]+(a[u]-o[u])*c,t.moveTo(o[0],o[1]),t.lineTo(d[0],d[1]),t.moveTo(r[0],r[1]),d[l]=r[l],t.lineTo(d[0],d[1]),d[l]=a[l],t.lineTo(d[0],d[1]),t.lineTo(a[0],a[1]);for(var h=1;h<i-1;h++){var p=n[h];t.moveTo(p[0],p[1]),d[l]=p[l],t.lineTo(d[0],d[1])}},e}(g),u_=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._mainGroup=new Z,n}return Ue(e,t),e.prototype.init=function(t,e){this._controller=new Uv(e.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},e.prototype.render=function(t,e,n){var i=t.getData(),o=t.layoutInfo,r=this._mainGroup;"radial"===t.get("layout")?(r.x=o.x+o.width/2,r.y=o.y+o.height/2):(r.x=o.x,r.y=o.y),this._updateViewCoordSys(t,n),this._updateController(t,e,n);var a=this._data;i.diff(a).add((function(e){c_(i,e)&&
- // Create node and edge
- d_(i,e,null,r,t)})).update((function(e,n){var o=a.getItemGraphicEl(n);c_(i,e)?
- // Update node and edge
- d_(i,e,o,r,t):o&&f_(a,n,o,r,t)})).remove((function(e){var n=a.getItemGraphicEl(e);
- // When remove a collapsed node of subtree, since the collapsed
- // node haven't been initialized with a symbol element,
- // you can't found it's symbol element through index.
- // so if we want to remove the symbol element we should insure
- // that the symbol element is not null.
- n&&f_(a,e,n,r,t)})).execute(),this._nodeScaleRatio=t.get("nodeScaleRatio"),this._updateNodeAndLinkScale(t),!0===t.get("expandAndCollapse")&&i.eachItemGraphicEl((function(e,i){e.off("click").on("click",(function(){n.dispatchAction({type:"treeExpandAndCollapse",seriesId:t.id,dataIndex:i})}))})),this._data=i},e.prototype._updateViewCoordSys=function(t,e){var n=t.getData(),i=[];n.each((function(t){var e=n.getItemLayout(t);!e||isNaN(e.x)||isNaN(e.y)||i.push([+e.x,+e.y])}));var o=[],r=[];ie(i,o,r);
- // If don't Store min max when collapse the root node after roam,
- // the root node will disappear.
- var a=this._min,s=this._max;
- // If width or height is 0
- r[0]-o[0]==0&&(o[0]=a?a[0]:o[0]-1,r[0]=s?s[0]:r[0]+1),r[1]-o[1]==0&&(o[1]=a?a[1]:o[1]-1,r[1]=s?s[1]:r[1]+1);var l=t.coordinateSystem=new Ex;l.zoomLimit=t.get("scaleLimit"),l.setBoundingRect(o[0],o[1],r[0]-o[0],r[1]-o[1]),l.setCenter(t.get("center"),e),l.setZoom(t.get("zoom")),
- // Here we use viewCoordSys just for computing the 'position' and 'scale' of the group
- this.group.attr({x:l.x,y:l.y,scaleX:l.scaleX,scaleY:l.scaleY}),this._min=o,this._max=r},e.prototype._updateController=function(t,e,n){var i=this,o=this._controller,r=this._controllerHost,a=this.group;o.setPointerChecker((function(e,i,o){var r=a.getBoundingRect();return r.applyTransform(a.transform),r.contain(i,o)&&!qv(e,n,t)})),o.enable(t.get("roam")),r.zoomLimit=t.get("scaleLimit"),r.zoom=t.coordinateSystem.getZoom(),o.off("pan").off("zoom").on("pan",(function(e){Zv(r,e.dx,e.dy),n.dispatchAction({seriesId:t.id,type:"treeRoam",dx:e.dx,dy:e.dy})})).on("zoom",(function(e){Xv(r,e.scale,e.originX,e.originY),n.dispatchAction({seriesId:t.id,type:"treeRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),i._updateNodeAndLinkScale(t),
- // Only update label layout on zoom
- n.updateLabelLayout()}))},e.prototype._updateNodeAndLinkScale=function(t){var e=t.getData(),n=this._getNodeGlobalScale(t);e.eachItemGraphicEl((function(t,e){t.setSymbolScale(n)}))},e.prototype._getNodeGlobalScale=function(t){var e=t.coordinateSystem;if("view"!==e.type)return 1;var n=this._nodeScaleRatio,i=e.scaleX||1;return((e.getZoom()-1)*n+1)/i},e.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype.remove=function(){this._mainGroup.removeAll(),this._data=null},e.type="tree",e}(Ou);function c_(t,e){var n=t.getItemLayout(e);return n&&!isNaN(n.x)&&!isNaN(n.y)}function d_(t,e,n,i,o){var r=!n,a=t.tree.getNodeByDataIndex(e),s=a.getModel(),l=a.getVisual("style").fill,u=!1===a.isExpand&&0!==a.children.length?l:"#fff",c=t.tree.root,d=a.parentNode===c?a:a.parentNode||a,h=t.getItemGraphicEl(d.dataIndex),p=d.getLayout(),f=h?{x:h.__oldX,y:h.__oldY,rawX:h.__radialOldRawX,rawY:h.__radialOldRawY}:p,g=a.getLayout();r?((n=new Bg(t,e,null,{symbolInnerColor:u,useNameLabel:!0})).x=f.x,n.y=f.y):n.updateData(t,e,null,{symbolInnerColor:u,useNameLabel:!0}),n.__radialOldRawX=n.__radialRawX,n.__radialOldRawY=n.__radialRawY,n.__radialRawX=g.rawX,n.__radialRawY=g.rawY,i.add(n),t.setItemGraphicEl(e,n),n.__oldX=n.x,n.__oldY=n.y,io(n,{x:g.x,y:g.y},o);var y=n.getSymbolPath();if("radial"===o.get("layout")){var m=c.children[0],v=m.getLayout(),x=m.children.length,_=void 0,b=void 0;if(g.x===v.x&&!0===a.isExpand&&m.children.length){var S={x:(m.children[0].getLayout().x+m.children[x-1].getLayout().x)/2,y:(m.children[0].getLayout().y+m.children[x-1].getLayout().y)/2};(_=Math.atan2(S.y-v.y,S.x-v.x))<0&&(_=2*Math.PI+_),(b=S.x<v.x)&&(_-=Math.PI)}else(_=Math.atan2(g.y-v.y,g.x-v.x))<0&&(_=2*Math.PI+_),0===a.children.length||0!==a.children.length&&!1===a.isExpand?(b=g.x<v.x)&&(_-=Math.PI):(b=g.x>v.x)||(_-=Math.PI);var w=b?"left":"right",M=s.getModel("label"),D=M.get("rotate"),T=D*(Math.PI/180),C=y.getTextContent();C&&(y.setTextConfig({position:M.get("position")||w,rotation:null==D?-_:T,origin:"center"}),C.setStyle("verticalAlign","middle"))}
- // Handle status
- var A=s.get(["emphasis","focus"]),L="relative"===A?ct(a.getAncestorsIndices(),a.getDescendantIndices()):"ancestor"===A?a.getAncestorsIndices():"descendant"===A?a.getDescendantIndices():null;L&&(
- // Modify the focus to data indices.
- ni(n).focus=L),function(t,e,n,i,o,r,a,s){var l=e.getModel(),u=t.get("edgeShape"),c=t.get("layout"),d=t.getOrient(),h=t.get(["lineStyle","curveness"]),p=t.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=i.__edge;
- // curve edge from node -> parent
- // polyline edge from node -> children
- if("curve"===u)e.parentNode&&e.parentNode!==n&&(g||(g=i.__edge=new W({shape:g_(c,d,h,o,o)})),io(g,{shape:g_(c,d,h,r,a)},t));else if("polyline"===u&&"orthogonal"===c&&e!==n&&e.children&&0!==e.children.length&&!0===e.isExpand){for(var y=e.children,m=[],v=0;v<y.length;v++){var x=y[v].getLayout();m.push([x.x,x.y])}g||(g=i.__edge=new l_({shape:{parentPoint:[a.x,a.y],childPoints:[[a.x,a.y]],orient:d,forkPosition:p}})),io(g,{shape:{parentPoint:[a.x,a.y],childPoints:m}},t)}
- // show all edge when edgeShape is 'curve', filter node `isExpand` is false when edgeShape is 'polyline'
- g&&("polyline"!==u||e.isExpand)&&(g.useStyle(I({strokeNoScale:!0,fill:null},f)),qi(g,l,"lineStyle"),Ci(g),s.add(g))}(o,a,c,n,f,p,g,i),n.__edge&&(n.onHoverStateChange=function(e){if("blur"!==e){
- // NOTE: Ensure the parent elements will been blurred firstly.
- // According to the return of getAncestorsIndices and getDescendantIndices
- // TODO: A bit tricky.
- var i=a.parentNode&&t.getItemGraphicEl(a.parentNode.dataIndex);i&&1===i.hoverState||Di(n.__edge,e)}})}function h_(t,e,n,i,o){var r=p_(e.tree.root,t),a=r.source,s=r.sourceLayout,l=e.getItemGraphicEl(t.dataIndex);if(l){var u=e.getItemGraphicEl(a.dataIndex).__edge,c=l.__edge||(!1===a.isExpand||1===a.children.length?u:void 0),d=i.get("edgeShape"),h=i.get("layout"),p=i.get("orient"),f=i.get(["lineStyle","curveness"]);c&&("curve"===d?ao(c,{shape:g_(h,p,f,s,s),style:{opacity:0}},i,{cb:function(){n.remove(c)},removeOpt:o}):"polyline"===d&&"orthogonal"===i.get("layout")&&ao(c,{shape:{parentPoint:[s.x,s.y],childPoints:[[s.x,s.y]]},style:{opacity:0}},i,{cb:function(){n.remove(c)},removeOpt:o}))}}function p_(t,e){for(var n,i=e.parentNode===t?e:e.parentNode||e;null==(n=i.getLayout());)i=i.parentNode===t?i:i.parentNode||i;return{source:i,sourceLayout:n}}function f_(t,e,n,i,o){var r=t.tree.getNodeByDataIndex(e),a=p_(t.tree.root,r).sourceLayout,s={duration:o.get("animationDurationUpdate"),easing:o.get("animationEasingUpdate")};ao(n,{x:a.x+1,y:a.y+1},o,{cb:function(){i.remove(n),t.setItemGraphicEl(e,null)},removeOpt:s}),n.fadeOut(null,t.hostModel,{fadeLabel:!0,animation:s}),
- // remove edge as parent node
- r.children.forEach((function(e){h_(e,t,i,o,s)})),
- // remove edge as child node
- h_(r,t,i,o,s)}function g_(t,e,n,i,o){var r,a,s,l,u,c,d,h;if("radial"===t){u=i.rawX,d=i.rawY,c=o.rawX,h=o.rawY;var p=e_(u,d),f=e_(u,d+(h-d)*n),g=e_(c,h+(d-h)*n),y=e_(c,h);return{x1:p.x||0,y1:p.y||0,x2:y.x||0,y2:y.y||0,cpx1:f.x||0,cpy1:f.y||0,cpx2:g.x||0,cpy2:g.y||0}}return u=i.x,d=i.y,c=o.x,h=o.y,"LR"!==e&&"RL"!==e||(r=u+(c-u)*n,a=d,s=c+(u-c)*n,l=h),"TB"!==e&&"BT"!==e||(r=u,a=d+(h-d)*n,s=c,l=h+(d-h)*n),{x1:u,y1:d,x2:c,y2:h,cpx1:r,cpy1:a,cpx2:s,cpy2:l}}const y_=u_;var m_=On();function v_(t){var e=t.mainData,n=t.datas;n||(n={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,M_(e,n,t),
- // Porxy data original methods.
- a(n,(function(n){a(e.TRANSFERABLE_METHODS,(function(e){n.wrapMethod(e,rt(x_,t))}))})),
- // Beyond transfer, additional features should be added to `cloneShallow`.
- e.wrapMethod("cloneShallow",rt(b_,t)),
- // Only mainData trigger change, because struct.update may trigger
- // another changable methods, which may bring about dead lock.
- a(e.CHANGABLE_METHODS,(function(n){e.wrapMethod(n,rt(__,t))})),
- // Make sure datas contains mainData.
- s(n[e.dataType]===e)}function x_(t,e){if(m_(i=this).mainData===i){
- // Transfer datas to new main data.
- var n=p({},m_(this).datas);n[this.dataType]=e,M_(e,n,t)}else
- // Modify the reference in main data to point newData.
- I_(e,this.dataType,m_(this).mainData,t);var i;return e}function __(t,e){return t.struct&&t.struct.update(),e}function b_(t,e){
- // cloneShallow, which brings about some fragilities, may be inappropriate
- // to be exposed as an API. So for implementation simplicity we can make
- // the restriction that cloneShallow of not-mainData should not be invoked
- // outside, but only be invoked here.
- return a(m_(e).datas,(function(n,i){n!==e&&I_(n.cloneShallow(),i,e,t)})),e}
- /**
- * Supplement method to List.
- *
- * @public
- * @param [dataType] If not specified, return mainData.
- */function S_(t){var e=m_(this).mainData;return null==t||null==e?e:m_(e).datas[t]}
- /**
- * Get list of all linked data
- */function w_(){var t=m_(this).mainData;return null==t?[{data:t}]:n(v(m_(t).datas),(function(e){return{type:e,data:m_(t).datas[e]}}))}function M_(t,e,n){m_(t).datas={},a(e,(function(e,i){I_(e,i,t,n)}))}function I_(t,e,n,i){m_(n).datas[e]=t,m_(t).mainData=n,t.dataType=e,i.struct&&(t[i.structAttr]=i.struct,i.struct[i.datasAttr[e]]=t),
- // Supplement method.
- t.getLinkedData=S_,t.getLinkedDataAll=w_}var D_=/** @class */function(){function e(t,e){this.depth=0,this.height=0,
- /**
- * Reference to list item.
- * Do not persistent dataIndex outside,
- * besause it may be changed by list.
- * If dataIndex -1,
- * this node is logical deleted (filtered) in list.
- */
- this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=t||"",this.hostTree=e}
- /**
- * The node is removed.
- */return e.prototype.isRemoved=function(){return this.dataIndex<0},e.prototype.eachNode=function(e,n,i){f(e)&&(i=n,n=e,e=null),t(e=e||{})&&(e={order:e});var o,r=e.order||"preorder",a=this[e.attr||"children"];"preorder"===r&&(o=n.call(i,this));for(var s=0;!o&&s<a.length;s++)a[s].eachNode(e,n,i);"postorder"===r&&n.call(i,this)},
- /**
- * Update depth and height of this subtree.
- */
- e.prototype.updateDepthAndHeight=function(t){var e=0;this.depth=t;for(var n=0;n<this.children.length;n++){var i=this.children[n];i.updateDepthAndHeight(t+1),i.height>e&&(e=i.height)}this.height=e+1},e.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var e=0,n=this.children,i=n.length;e<i;e++){var o=n[e].getNodeById(t);if(o)return o}},e.prototype.contains=function(t){if(t===this)return!0;for(var e=0,n=this.children,i=n.length;e<i;e++){var o=n[e].contains(t);if(o)return o}},
- /**
- * @param includeSelf Default false.
- * @return order: [root, child, grandchild, ...]
- */
- e.prototype.getAncestors=function(t){for(var e=[],n=t?this:this.parentNode;n;)e.push(n),n=n.parentNode;return e.reverse(),e},e.prototype.getAncestorsIndices=function(){for(var t=[],e=this;e;)t.push(e.dataIndex),e=e.parentNode;return t.reverse(),t},e.prototype.getDescendantIndices=function(){var t=[];return this.eachNode((function(e){t.push(e.dataIndex)})),t},e.prototype.getValue=function(t){var e=this.hostTree.data;return e.getStore().get(e.getDimensionIndex(t||"value"),this.dataIndex)},e.prototype.setLayout=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},
- /**
- * @return {Object} layout
- */
- e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},
- // @depcrecated
- // getModel<T = unknown, S extends keyof T = keyof T>(path: S): Model<T[S]>
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- e.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(t)},
- // TODO: TYPE More specific model
- e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},
- /**
- * Get item visual
- * FIXME: make return type better
- */
- e.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},
- /**
- * index in parent's children
- */
- e.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,e=0;e<t.length;++e)if(t[e]===this)return e;return-1}return-1},
- /**
- * if this is an ancestor of another node
- *
- * @param node another node
- * @return if is ancestor
- */
- e.prototype.isAncestorOf=function(t){for(var e=t.parentNode;e;){if(e===this)return!0;e=e.parentNode}return!1},
- /**
- * if this is an descendant of another node
- *
- * @param node another node
- * @return if is descendant
- */
- e.prototype.isDescendantOf=function(t){return t!==this&&t.isAncestorOf(this)},e}(),T_=/** @class */function(){function t(t){this.type="tree",this._nodes=[],this.hostModel=t}return t.prototype.eachNode=function(t,e,n){this.root.eachNode(t,e,n)},t.prototype.getNodeByDataIndex=function(t){var e=this.data.getRawIndex(t);return this._nodes[e]},t.prototype.getNodeById=function(t){return this.root.getNodeById(t)},
- /**
- * Update item available by list,
- * when list has been performed options like 'filterSelf' or 'map'.
- */
- t.prototype.update=function(){for(var t=this.data,e=this._nodes,n=0,i=e.length;n<i;n++)e[n].dataIndex=-1;for(n=0,i=t.count();n<i;n++)e[t.getRawIndex(n)].dataIndex=n},
- /**
- * Clear all layouts
- */
- t.prototype.clearLayouts=function(){this.data.clearItemLayouts()},
- /**
- * data node format:
- * {
- * name: ...
- * value: ...
- * children: [
- * {
- * name: ...
- * value: ...
- * children: ...
- * },
- * ...
- * ]
- * }
- */
- t.createTree=function(e,n,o){var r=new t(n),a=[],s=1;!function t(e,n){var o=e.value;s=Math.max(s,i(o)?o.length:1),a.push(e);var l=new D_(Ln(e.name,""),r);n?
- /**
- * It is needed to consider the mess of 'list', 'hostModel' when creating a TreeNote,
- * so this function is not ready and not necessary to be public.
- */
- function(t,e){var n=e.children;if(t.parentNode===e)return;n.push(t),t.parentNode=e}(l,n):r.root=l,r._nodes.push(l);var u=e.children;if(u)for(var c=0;c<u.length;c++)t(u[c],l)}(e),r.root.updateDepthAndHeight(0);var l=Hh(a,{coordDimensions:["value"],dimensionsCount:s}).dimensions,u=new Fh(l,n);return u.initData(a),o&&o(u),v_({mainData:u,struct:r,structAttr:"tree"}),r.update(),r},t}();const C_=T_;function A_(e,n,i){if(e&&c(n,e.type)>=0){var o=i.getData().tree.root,r=e.targetNode;if(t(r)&&(r=o.getNodeById(r)),r&&o.contains(r))return{node:r};var a=e.targetNodeId;if(null!=a&&(r=o.getNodeById(a)))return{node:r}}}
- // Not includes the given node at the last item.
- function L_(t){for(var e=[];t;)(t=t.parentNode)&&e.push(t);return e.reverse()}function k_(t,e){var n=L_(t);return c(n,e)>=0}
- // From root to the input node (the input node will be included).
- function P_(t,e){for(var n=[];t;){var i=t.dataIndex;n.push({name:t.name,dataIndex:i,value:e.getRawValue(i)}),t=t.parentNode}return n.reverse(),n}var N_=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasSymbolVisual=!0,
- // Do it self.
- e.ignoreStyleOnData=!0,e}
- /**
- * Init a tree data structure from data in option series
- */return Ue(e,t),e.prototype.getInitialData=function(t){
- // create a virtual root
- var e={name:t.name,children:t.data},n=t.leaves||{},i=new yr(n,this,this.ecModel),o=C_.createTree(e,this,(function(t){t.wrapMethod("getItemModel",(function(t,e){var n=o.getNodeByDataIndex(e);return n&&n.children.length&&n.isExpand||(t.parentModel=i),t}))}));var r=0;o.eachNode("preorder",(function(t){t.depth>r&&(r=t.depth)}));var a=t.expandAndCollapse&&t.initialTreeDepth>=0?t.initialTreeDepth:r;return o.root.eachNode("preorder",(function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);
- // Add item.collapsed != null, because users can collapse node original in the series.data.
- t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=a})),o.data},
- /**
- * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'.
- * @returns {string} orient
- */
- e.prototype.getOrient=function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,e,n){for(var i=this.getData().tree,o=i.root.children[0],r=i.getNodeByDataIndex(t),a=r.getValue(),s=r.name;r&&r!==o;)s=r.parentNode.name+"."+s,r=r.parentNode;return $l("nameValue",{name:s,value:a,noValue:isNaN(a)||null==a})},
- // Add tree path to tooltip param
- e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=P_(i,this),n.collapsed=!i.isExpand,n},e.type="series.tree",
- // can support the position parameters 'left', 'top','right','bottom', 'width',
- // 'height' in the setOption() with 'merge' mode normal.
- e.layoutMode="box",e.defaultOption={
- // zlevel: 0,
- z:2,coordinateSystem:"view",
- // the position of the whole view
- left:"12%",top:"12%",right:"12%",bottom:"12%",
- // the layout of the tree, two value can be selected, 'orthogonal' or 'radial'
- layout:"orthogonal",
- // value can be 'polyline'
- edgeShape:"curve",edgeForkPosition:"50%",
- // true | false | 'move' | 'scale', see module:component/helper/RoamController.
- roam:!1,
- // Symbol size scale ratio in roam
- nodeScaleRatio:.4,
- // Default on center of graph
- center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",
- // borderColor: '#c23531',
- borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(Su);const O_=N_;
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * Traverse the tree from bottom to top and do something
- */
- /**
- * Traverse the tree from top to bottom and do something
- */
- function R_(t,e){for(var n,i=[t];n=i.pop();)if(
- // jshint ignore:line
- e(n),n.isExpand){var o=n.children;if(o.length)for(var r=o.length-1;r>=0;r--)i.push(o[r])}}function E_(t,e){t.eachSeriesByType("tree",(function(t){!function(t,e){var n=function(t,e){return xa(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e);t.layoutInfo=n;var i=t.get("layout"),o=0,r=0,a=null;"radial"===i?(o=2*Math.PI,r=Math.min(n.height,n.width)/2,a=t_((function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth}))):(o=n.width,r=n.height,a=t_());var s=t.getData().tree.root,l=s.children[0];if(l){!
- /**
- * Initialize all computational message for following algorithm.
- */
- function(t){var e=t;e.hierNode={defaultAncestor:null,ancestor:e,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var n,i,o=[e];n=o.pop();)if(
- // jshint ignore:line
- i=n.children,n.isExpand&&i.length)for(var r=i.length-1;r>=0;r--){var a=i[r];a.hierNode={defaultAncestor:null,ancestor:a,prelim:0,modifier:0,change:0,shift:0,i:r,thread:null},o.push(a)}}(s),function(t,e,n){for(var i,o=[t],r=[];i=o.pop();)if(
- // jshint ignore:line
- r.push(i),i.isExpand){var a=i.children;if(a.length)for(var s=0;s<a.length;s++)o.push(a[s])}for(;i=r.pop();)
- // jshint ignore:line
- e(i,n)}(l,$x,a),s.hierNode.modifier=-l.hierNode.prelim,R_(l,Qx);var u=l,c=l,d=l;R_(l,(function(t){var e=t.getLayout().x;e<u.getLayout().x&&(u=t),e>c.getLayout().x&&(c=t),t.depth>d.depth&&(d=t)}));var h=u===c?1:a(u,c)/2,p=h-u.getLayout().x,f=0,g=0,y=0,m=0;if("radial"===i)f=o/(c.getLayout().x+h+p),
- // here we use (node.depth - 1), bucause the real root's depth is 1
- g=r/(d.depth-1||1),R_(l,(function(t){y=(t.getLayout().x+p)*f,m=(t.depth-1)*g;var e=e_(y,m);t.setLayout({x:e.x,y:e.y,rawX:y,rawY:m},!0)}));else{var v=t.getOrient();"RL"===v||"LR"===v?(g=r/(c.getLayout().x+h+p),f=o/(d.depth-1||1),R_(l,(function(t){m=(t.getLayout().x+p)*g,y="LR"===v?(t.depth-1)*f:o-(t.depth-1)*f,t.setLayout({x:y,y:m},!0)}))):"TB"!==v&&"BT"!==v||(f=o/(c.getLayout().x+h+p),g=r/(d.depth-1||1),R_(l,(function(t){y=(t.getLayout().x+p)*f,m="TB"===v?(t.depth-1)*g:r-(t.depth-1)*g,t.setLayout({x:y,y:m},!0)})))}}}(t,e)}))}function V_(t){t.eachSeriesByType("tree",(function(t){var e=t.getData();e.tree.eachNode((function(t){var n=t.getModel().getModel("itemStyle").getItemStyle(),i=e.ensureUniqueItemVisual(t.dataIndex,"style");
- // TODO Optimize
- p(i,n)}))}))}var z_=["treemapZoomToNode","treemapRender","treemapMove"];function B_(t){var e=t.getData().tree,n={};e.eachNode((function(e){for(
- // Use decal of level 1 node
- var i=e;i&&i.depth>1;)i=i.parentNode;var o=ns(t.ecModel,i.name||i.dataIndex+"",n);e.setVisual("decal",o)}))}
- /**
- * @param {Object} dataNode
- */
- function G_(t){
- // Postorder travel tree.
- // If value of none-leaf node is not set,
- // calculate it by suming up the value of all children.
- var e=0;a(t.children,(function(t){G_(t);var n=t.value;i(n)&&(n=n[0]),e+=n}));var n=t.value;i(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),
- // Value should not less than 0.
- n<0&&(n=0),i(t.value)?t.value[0]=n:t.value=n}
- /**
- * set default to level configuration
- */const F_=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.preventUsingHoverLayer=!0,n}
- /**
- * @override
- */return Ue(e,t),e.prototype.getInitialData=function(t,e){
- // Create a virtual root.
- var i={name:t.name,children:t.data};G_(i);var o=t.levels||[],r=this.designatedVisualItemStyle={},s=new yr({itemStyle:r},this,e);
- // Used in "visual priority" in `treemapVisual.js`.
- // This way is a little tricky, must satisfy the precondition:
- // 1. There is no `treeNode.getModel('itemStyle.xxx')` used.
- // 2. The `Model.prototype.getModel()` will not use any clone-like way.
- o=t.levels=function(t,e){var n,i,o=Sn(e.get("color")),r=Sn(e.get(["aria","decal","decals"]));if(!o)return;t=t||[],a(t,(function(t){var e=new yr(t),o=e.get("color"),r=e.get("decal");(e.get(["itemStyle","color"])||o&&"none"!==o)&&(n=!0),(e.get(["itemStyle","decal"])||r&&"none"!==r)&&(i=!0)}));var s=t[0]||(t[0]={});n||(s.color=o.slice());!i&&r&&(s.decal=r.slice());return t}(o,e);var l=n(o||[],(function(t){return new yr(t,s,e)}),this),u=C_.createTree(i,this,(function(t){t.wrapMethod("getItemModel",(function(t,e){var n=u.getNodeByDataIndex(e),i=n?l[n.depth]:null;
- // If no levelModel, we also need `designatedVisualModel`.
- return t.parentModel=i||s,t}))}));
- // Make sure always a new tree is created when setOption,
- // in TreemapView, we check whether oldTree === newTree
- // to choose mappings approach among old shapes and new shapes.
- return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},
- /**
- * @override
- * @param {number} dataIndex
- * @param {boolean} [mutipleSeries=false]
- */
- e.prototype.formatTooltip=function(t,e,n){var i=this.getData(),o=this.getRawValue(t);return $l("nameValue",{name:i.getName(t),value:o})},
- /**
- * Add tree path to tooltip param
- *
- * @override
- * @param {number} dataIndex
- * @return {Object}
- */
- e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=P_(i,this),
- // compatitable the previous code.
- n.treePathInfo=n.treeAncestors,n},
- /**
- * @public
- * @param {Object} layoutInfo {
- * x: containerGroup x
- * y: containerGroup y
- * width: containerGroup width
- * height: containerGroup height
- * }
- */
- e.prototype.setLayoutInfo=function(t){
- /**
- * @readOnly
- * @type {Object}
- */
- this.layoutInfo=this.layoutInfo||{},p(this.layoutInfo,t)},
- /**
- * @param {string} id
- * @return {number} index
- */
- e.prototype.mapIdToIndex=function(t){
- // A feature is implemented:
- // index is monotone increasing with the sequence of
- // input id at the first time.
- // This feature can make sure that each data item and its
- // mapped color have the same index between data list and
- // color list at the beginning, which is useful for user
- // to adjust data-color mapping.
- /**
- * @private
- * @type {Object}
- */
- var e=this._idIndexMap;e||(e=this._idIndexMap=r(),
- /**
- * @private
- * @type {number}
- */
- this._idIndexMapCount=0);var n=e.get(t);return null==n&&e.set(t,n=this._idIndexMapCount++),n},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){B_(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={
- // Disable progressive rendering
- progressive:0,
- // size: ['80%', '80%'], // deprecated, compatible with ec2.
- left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",
- // to align specialized icon. ▷▶❒❐▼✚
- zoomToNodeRatio:.1024,scaleLimit:null,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",
- // right
- // bottom
- emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,
- // Do not use textDistance, for ellipsis rect just the same as treemap node rect.
- distance:0,padding:5,position:"inside",
- // formatter: null,
- color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,
- // formatter: null,
- // color: '#fff',
- overflow:"truncate",
- // align: null,
- verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],
- // level[n].color (if necessary).
- // + Specify color list of each level. level[0].color would be global
- // color list if not specified. (see method `setDefault`).
- // + But set as a empty array to forbid fetch color from global palette
- // when using nodeModel.get('color'), otherwise nodes on deep level
- // will always has color palette set and are not able to inherit color
- // from parent node.
- // + TreemapSeries.color can not be set as 'none', otherwise effect
- // legend color fetching (see seriesColor.js).
- colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,
- // be rendered. Only works when sort is 'asc' or 'desc'.
- childrenVisibleMin:null,
- // grandchildren will not show.
- // Why grandchildren? If not grandchildren but children,
- // some siblings show children and some not,
- // the appearance may be mess and not consistent,
- levels:[]},e}(Su);var W_=/** @class */function(){function t(t){this.group=new Z,t.add(this.group)}return t.prototype.render=function(t,e,n,i){var o=t.getModel("breadcrumb"),r=this.group;if(r.removeAll(),o.get("show")&&n){var a=o.getModel("itemStyle"),s=o.getModel("emphasis"),l=a.getModel("textStyle"),u=s.getModel(["itemStyle","textStyle"]),c={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(n,c,l),this._renderContent(t,c,a,s,l,u,i),_a(r,c.pos,c.box)}},
- /**
- * Prepare render list and total width
- * @private
- */
- t.prototype._prepare=function(t,e,n){for(var i=t;i;i=i.parentNode){var o=Ln(i.getModel().get("name"),""),r=n.getTextRect(o),a=Math.max(r.width+16,e.emptyItemWidth);e.totalWidth+=a+8,e.renderList.push({node:i,text:o,width:a})}},
- /**
- * @private
- */
- t.prototype._renderContent=function(t,e,n,i,o,r,a){for(
- // Start rendering.
- var s,l,u,c,d,h,p,f,g,y=0,m=e.emptyItemWidth,v=t.get(["breadcrumb","height"]),x=(s=e.pos,l=e.box,c=l.width,d=l.height,h=je(s.left,c),p=je(s.top,d),f=je(s.right,c),g=je(s.bottom,d),(isNaN(h)||isNaN(parseFloat(s.left)))&&(h=0),(isNaN(f)||isNaN(parseFloat(s.right)))&&(f=c),(isNaN(p)||isNaN(parseFloat(s.top)))&&(p=0),(isNaN(g)||isNaN(parseFloat(s.bottom)))&&(g=d),u=aa(u||0),{width:Math.max(f-h-u[1]-u[3],0),height:Math.max(g-p-u[0]-u[2],0)}),_=e.totalWidth,b=e.renderList,S=i.getModel("itemStyle").getItemStyle(),w=b.length-1;w>=0;w--){var M=b[w],D=M.node,T=M.width,C=M.text;
- // Hdie text and shorten width if necessary.
- _>x.width&&(_-=T-m,T=m,C=null);var A=new z({shape:{points:H_(y,0,T,v,w===b.length-1,0===w)},style:I(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new $({style:Zo(o,{text:C})}),textConfig:{position:"inside"},z2:1e5,onclick:rt(a,D)});A.disableLabelAnimation=!0,A.getTextContent().ensureState("emphasis").style=Zo(r,{text:C}),A.ensureState("emphasis").style=S,Ui(A,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(A),Y_(A,t,D),y+=T+8}},t.prototype.remove=function(){this.group.removeAll()},t}();function H_(t,e,n,i,o,r){var a=[[o?t:t-5,e],[t+n,e],[t+n,e+i],[o?t:t-5,e+i]];return!r&&a.splice(2,0,[t+n+5,e+i/2]),!o&&a.push([t,e+i/2]),a}
- // Package custom mouse event.
- function Y_(t,e,n){ni(t).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&P_(n,e)}}const U_=W_;
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * Animate multiple elements with a single done-callback.
- *
- * @example
- * animation
- * .createWrap()
- * .add(el1, {x: 10, y: 10})
- * .add(el2, {shape: {width: 500}, style: {fill: 'red'}}, 400)
- * .done(function () { // done })
- * .start('cubicOut');
- */var Z_=/** @class */function(){function t(){this._storage=[],this._elExistsMap={}}
- /**
- * Caution: a el can only be added once, otherwise 'done'
- * might not be called. This method checks this (by el.id),
- * suppresses adding and returns false when existing el found.
- *
- * @return Whether adding succeeded.
- */return t.prototype.add=function(t,e,n,i,o){return!this._elExistsMap[t.id]&&(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:e,duration:n,delay:i,easing:o}),!0)},
- /**
- * Only execute when animation done/aborted.
- */
- t.prototype.finished=function(t){return this._finishedCallback=t,this},
- /**
- * Will stop exist animation firstly.
- */
- t.prototype.start=function(){for(var t=this,e=this._storage.length,n=function(){--e<=0&&(
- // Guard.
- t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},i=0,o=this._storage.length;i<o;i++){var r=this._storage[i];r.el.animateTo(r.target,{duration:r.duration,delay:r.delay,easing:r.easing,setToFinal:!0,done:n,aborted:n})}return this},t}();var X_=Z,j_=G,q_="label",K_="upperLabel",J_=Qn([["fill","color"],
- // `borderColor` and `borderWidth` has been occupied,
- // so use `stroke` to indicate the stroke of the rect.
- ["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),$_=function(t){
- // Normal style props should include emphasis style props.
- var e=J_(t);
- // Clear styles set by emphasis.
- return e.stroke=e.fill=e.lineWidth=null,e},Q_=On(),tb=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._state="ready",n._storage={nodeGroup:[],background:[],content:[]},n}
- /**
- * @override
- */return Ue(e,t),e.prototype.render=function(t,e,n,i){var o=e.findComponents({mainType:"series",subType:"treemap",query:i});if(!(c(o,t)<0)){this.seriesModel=t,this.api=n,this.ecModel=e;var r=A_(i,["treemapZoomToNode","treemapRootToNode"],t),a=i&&i.type,s=t.layoutInfo,l=!this._oldTree,u=this._storage,d="treemapRootToNode"===a&&r&&u?{rootNodeGroup:u.nodeGroup[r.node.getRawIndex()],direction:i.direction}:null,h=this._giveContainerGroup(s),p=t.get("animation"),f=this._doRender(h,t,d);!p||l||a&&"treemapZoomToNode"!==a&&"treemapRootToNode"!==a?f.renderFinally():this._doAnimation(h,f,t,d),this._resetController(n),this._renderBreadcrumb(t,n,r)}},e.prototype._giveContainerGroup=function(t){var e=this._containerGroup;return e||(
- // FIXME
- // 加一层containerGroup是为了clip,但是现在clip功能并没有实现。
- e=this._containerGroup=new X_,this._initEvents(e),this.group.add(e)),e.x=t.x,e.y=t.y,e},e.prototype._doRender=function(t,e,n){var i=e.getData().tree,o=this._oldTree,r={nodeGroup:[],background:[],content:[]},s={nodeGroup:[],background:[],content:[]},l=this._storage,u=[];function c(t,i,o,a){
- /**
- * @inner
- * @return Return undefined means do not travel further.
- */
- return function(t,e,n,i,o,r,a,s,l,u){
- // Whether under viewRoot.
- if(!a)
- // Deleting nodes will be performed finally. This method just find
- // element from old storage, or create new element, set them to new
- // storage, and set styles.
- return;
- // -------------------------------------------------------------------
- // Start of closure variables available in "Procedures in renderNode".
- var c=a.getLayout(),d=t.getData(),h=a.getModel();if(
- // Only for enabling highlight/downplay. Clear firstly.
- // Because some node will not be rendered.
- d.setItemGraphicEl(a.dataIndex,null),!c||!c.isInView)return;var f=c.width,g=c.height,y=c.borderWidth,m=c.invisible,v=a.getRawIndex(),x=s&&s.getRawIndex(),_=a.viewChildren,b=c.upperHeight,S=_&&_.length,w=h.getModel("itemStyle"),M=h.getModel(["emphasis","itemStyle"]),I=h.getModel(["blur","itemStyle"]),D=h.getModel(["select","itemStyle"]),T=w.get("borderRadius")||0,C=W("nodeGroup",X_);if(!C)return;if(l.add(C),
- // x,y are not set when el is above view root.
- C.x=c.x||0,C.y=c.y||0,C.markRedraw(),Q_(C).nodeWidth=f,Q_(C).nodeHeight=g,c.isAboveViewRoot)return C;
- // Background
- var A=W("background",j_,u,20);A&&V(C,A,S&&c.upperLabelHeight);var L=h.getModel("emphasis"),k=L.get("focus"),P=L.get("blurScope"),N=L.get("disabled"),O="ancestor"===k?a.getAncestorsIndices():"descendant"===k?a.getDescendantIndices():k;
- // No children, render content.
- if(S)
- // Because of the implementation about "traverse" in graphic hover style, we
- // can not set hover listener on the "group" of non-leaf node. Otherwise the
- // hover event from the descendents will be listenered.
- Ji(C)&&Ki(C,!1),A&&(Ki(A,!N),
- // Only for enabling highlight/downplay.
- d.setItemGraphicEl(a.dataIndex,A),Zi(A,O,P));else{var R=W("content",j_,u,30);R&&z(C,R),A.disableMorphing=!0,A&&Ji(A)&&Ki(A,!1),Ki(C,!N),
- // Only for enabling highlight/downplay.
- d.setItemGraphicEl(a.dataIndex,C);var E=h.getShallow("cursor");E&&R.attr("cursor",E),Zi(C,O,P)}return C;
- // ----------------------------
- // | Procedures in renderNode |
- // ----------------------------
- function V(e,n,i){var o=ni(n);
- // For tooltip.
- if(o.dataIndex=a.dataIndex,o.seriesIndex=t.seriesIndex,n.setShape({x:0,y:0,width:f,height:g,r:T}),m)
- // If invisible, do not set visual, otherwise the element will
- // change immediately before animation. We think it is OK to
- // remain its origin color when moving out of the view window.
- B(n);else{n.invisible=!1;var r=a.getVisual("style"),s=r.stroke,l=$_(w);l.fill=s;var u=J_(M);u.fill=M.get("borderColor");var c=J_(I);c.fill=I.get("borderColor");var d=J_(D);if(d.fill=D.get("borderColor"),i){var h=f-2*y;G(
- // PENDING: convert ZRColor to ColorString for text.
- n,s,r.opacity,{x:y,y:0,width:h,height:b})}
- // For old bg.
- else n.removeTextContent();n.setStyle(l),n.ensureState("emphasis").style=u,n.ensureState("blur").style=c,n.ensureState("select").style=d,Ci(n)}e.add(n)}function z(e,n){var i=ni(n);
- // For tooltip.
- i.dataIndex=a.dataIndex,i.seriesIndex=t.seriesIndex;var o=Math.max(f-2*y,0),r=Math.max(g-2*y,0);if(n.culling=!0,n.setShape({x:y,y:y,width:o,height:r,r:T}),m)
- // If invisible, do not set visual, otherwise the element will
- // change immediately before animation. We think it is OK to
- // remain its origin color when moving out of the view window.
- B(n);else{n.invisible=!1;var s=a.getVisual("style"),l=s.fill,u=$_(w);u.fill=l,u.decal=s.decal;var c=J_(M),d=J_(I),h=J_(D);
- // PENDING: convert ZRColor to ColorString for text.
- G(n,l,s.opacity,null),n.setStyle(u),n.ensureState("emphasis").style=c,n.ensureState("blur").style=d,n.ensureState("select").style=h,Ci(n)}e.add(n)}function B(t){
- // Delay invisible setting utill animation finished,
- // avoid element vanish suddenly before animation.
- !t.invisible&&r.push(t)}function G(e,n,i,
- // Can be null/undefined
- o){var r=h.getModel(o?K_:q_),s=Ln(h.get("name"),null),l=r.getShallow("show");Yo(e,Uo(h,o?K_:q_),{defaultText:l?s:null,inheritColor:n,defaultOpacity:i,labelFetcher:t,labelDataIndex:a.dataIndex});var u=e.getTextContent();if(u){var d=u.style,p=it(d.padding||0);o&&(e.setTextConfig({layoutRect:o}),u.disableLabelLayout=!0),u.beforeUpdate=function(){var t=Math.max((o?o.width:e.shape.width)-p[1]-p[3],0),n=Math.max((o?o.height:e.shape.height)-p[0]-p[2],0);d.width===t&&d.height===n||u.setStyle({width:t,height:n})},d.truncateMinChar=2,d.lineOverflow="truncate",F(d,o,c);var f=u.getState("emphasis");F(f?f.style:null,o,c)}}function F(e,n,i){var o=e?e.text:null;if(!n&&i.isLeafRoot&&null!=o){var r=t.get("drillDownIcon",!0);e.text=r?r+" "+o:o}}function W(t,i,r,a){var s=null!=x&&n[t][x],l=o[t];
- // Set to thisStorage
- return s?(
- // Remove from oldStorage
- n[t][x]=null,H(l,s)):m||((s=new i)instanceof $t&&(s.z2=
- // We cannot set all background with the same z, because the behaviour of
- // drill down and roll up differ background creation sequence from tree
- // hierarchy sequence, which cause lower background elements to overlap
- // upper ones. So we calculate z based on depth.
- // Moreover, we try to shrink down z interval to [0, 1] to avoid that
- // treemap with large z overlaps other components.
- function(t,e){return 100*t+e}(r,a)),Y(l,s)),e[t][v]=s}function H(t,e){var n=t[v]={};e instanceof X_?(n.oldX=e.x,n.oldY=e.y):n.oldShape=p({},e.shape)}
- // If a element is new, we need to find the animation start point carefully,
- // otherwise it will looks strange when 'zoomToNode'.
- function Y(t,e){var n=t[v]={},r=a.parentNode,s=e instanceof Z;if(r&&(!i||"drillDown"===i.direction)){var l=0,u=0,c=o.background[r.getRawIndex()];!i&&c&&c.oldShape&&(l=c.oldShape.width,u=c.oldShape.height),
- // When no parent old shape found, its parent is new too,
- // so we can just use {x:0, y:0}.
- s?(n.oldX=0,n.oldY=u):n.oldShape={x:l,y:u,width:0,height:0}}
- // Fade in, user can be aware that these nodes are new.
- n.fadein=!s}}(e,s,l,n,r,u,t,i,o,a)}
- // Notice: When thisTree and oldTree are the same tree (see list.cloneShallow),
- // the oldTree is actually losted, so we cannot find all of the old graphic
- // elements from tree. So we use this strategy: make element storage, move
- // from old storage to new storage, clear old storage.
- !function t(e,n,i,o,r){
- // When 'render' is triggered by action,
- // 'this' and 'old' may be the same tree,
- // we use rawIndex in that case.
- o?(n=e,a(e,(function(t,e){!t.isRemoved()&&l(e,e)}))):new yh(n,e,s,s).add(l).update(l).remove(rt(l,null)).execute();function s(t){
- // Identify by name or raw index.
- return t.getId()}function l(a,s){var l=null!=a?e[a]:null,u=null!=s?n[s]:null,d=c(l,u,i,r);d&&t(l&&l.viewChildren||[],u&&u.viewChildren||[],d,o,r+1)}}(i.root?[i.root]:[],o&&o.root?[o.root]:[],t,i===o||!o,0);
- // Process all removing.
- var d=function(t){var e={nodeGroup:[],background:[],content:[]};return t&&a(t,(function(t,n){var i=e[n];a(t,(function(t){t&&(i.push(t),Q_(t).willDelete=!0)}))})),e}(l);if(this._oldTree=i,this._storage=s,this._controllerHost){var h=this.seriesModel.layoutInfo,f=i.root.getLayout();f.width===h.width&&f.height===h.height&&(this._controllerHost.zoom=1)}return{lastsForAnimation:r,willDeleteEls:d,renderFinally:function(){a(d,(function(t){a(t,(function(t){t.parent&&t.parent.remove(t)}))})),a(u,(function(t){t.invisible=!0,
- // Setting invisible is for optimizing, so no need to set dirty,
- // just mark as invisible.
- t.dirty()}))}}},e.prototype._doAnimation=function(t,e,n,i){var o=n.get("animationDurationUpdate"),r=n.get("animationEasing"),s=(f(o)?0:o)||0,l=(f(r)?null:r)||"cubicOut",u=new Z_;
- // Make delete animations.
- a(e.willDeleteEls,(function(t,e){a(t,(function(t,n){if(!t.invisible){var o,r=t.parent,a=Q_(r);// Always has parent, and parent is nodeGroup.
- if(i&&"drillDown"===i.direction)o=r===i.rootNodeGroup?{shape:{x:0,y:0,width:a.nodeWidth,height:a.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var c=0,d=0;a.willDelete||(
- // Let node animate to right-bottom corner, cooperating with fadeout,
- // which is appropriate for user understanding.
- // Divided by 2 for reRoot rolling up effect.
- c=a.nodeWidth/2,d=a.nodeHeight/2),o="nodeGroup"===e?{x:c,y:d,style:{opacity:0}}:{shape:{x:c,y:d,width:0,height:0},style:{opacity:0}}}
- // TODO: do not support delay until necessary.
- o&&u.add(t,o,s,0,l)}}))})),
- // Make other animations
- a(this._storage,(function(t,n){a(t,(function(t,i){var o=e.lastsForAnimation[n][i],r={};o&&(t instanceof Z?null!=o.oldX&&(r.x=t.x,r.y=t.y,t.x=o.oldX,t.y=o.oldY):(o.oldShape&&(r.shape=p({},t.shape),t.setShape(o.oldShape)),o.fadein?(t.setStyle("opacity",0),r.style={opacity:1}):1!==t.style.opacity&&(r.style={opacity:1})),u.add(t,r,s,0,l))}))}),this),this._state="animating",u.finished(lt((function(){this._state="ready",e.renderFinally()}),this)).start()},e.prototype._resetController=function(t){var e=this._controller,n=this._controllerHost;n||(this._controllerHost={target:this.group},n=this._controllerHost),
- // Init controller.
- e||((e=this._controller=new Uv(t.getZr())).enable(this.seriesModel.get("roam")),n.zoomLimit=this.seriesModel.get("scaleLimit"),n.zoom=this.seriesModel.get("zoom"),e.on("pan",lt(this._onPan,this)),e.on("zoom",lt(this._onZoom,this)));var i=new Y(0,0,t.getWidth(),t.getHeight());e.setPointerChecker((function(t,e,n){return i.contain(e,n)}))},e.prototype._clearController=function(){var t=this._controller;this._controllerHost=null,t&&(t.dispose(),t=null)},e.prototype._onPan=function(t){if("animating"!==this._state&&(Math.abs(t.dx)>3||Math.abs(t.dy)>3)){
- // These param must not be cached.
- var e=this.seriesModel.getData().tree.root;if(!e)return;var n=e.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+t.dx,y:n.y+t.dy,width:n.width,height:n.height}})}},e.prototype._onZoom=function(t){var e=t.originX,n=t.originY,i=t.scale;if("animating"!==this._state){
- // These param must not be cached.
- var o=this.seriesModel.getData().tree.root;if(!o)return;var r=o.getLayout();if(!r)return;var a,s=new Y(r.x,r.y,r.width,r.height),l=this._controllerHost;
- // scaleLimit
- a=l.zoomLimit;var u=l.zoom=l.zoom||1;if(u*=i,a){var c=a.min||0,d=a.max||Infinity;u=Math.max(Math.min(d,u),c)}var h=u/l.zoom;l.zoom=u;var p=this.seriesModel.layoutInfo;
- // Transform mouse coord from global to containerGroup.
- e-=p.x,n-=p.y;
- // Scale root bounding rect.
- var f=te();oe(f,f,[-e,-n]),re(f,f,[h,h]),oe(f,f,[e,n]),s.applyTransform(f),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:s.x,y:s.y,width:s.width,height:s.height}})}},e.prototype._initEvents=function(t){var e=this;t.on("click",(function(t){if("ready"===e._state){var n=e.seriesModel.get("nodeClick",!0);if(n){var i=e.findTarget(t.offsetX,t.offsetY);if(i){var o=i.node;if(o.getLayout().isLeafRoot)e._rootToNode(i);else if("zoomToNode"===n)e._zoomToNode(i);else if("link"===n){var r=o.hostTree.data.getItemModel(o.dataIndex),a=r.get("link",!0),s=r.get("target",!0)||"blank";a&&pa(a,s)}}}}}),this)},e.prototype._renderBreadcrumb=function(t,e,n){var i=this;n||(n=null!=t.get("leafDepth",!0)?{node:t.getViewRoot()}:this.findTarget(e.getWidth()/2,e.getHeight()/2))||(n={node:t.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new U_(this.group))).render(t,e,n.node,(function(e){"animating"!==i._state&&(k_(t.getViewRoot(),e)?i._rootToNode({node:e}):i._zoomToNode({node:e}))}))},
- /**
- * @override
- */
- e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},
- /**
- * @public
- * @param {number} x Global coord x.
- * @param {number} y Global coord y.
- * @return {Object} info If not found, return undefined;
- * @return {number} info.node Target node.
- * @return {number} info.offsetX x refer to target node.
- * @return {number} info.offsetY y refer to target node.
- */
- e.prototype.findTarget=function(t,e){var n;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(i){var o=this._storage.background[i.getRawIndex()];
- // If invisible, there might be no element.
- if(o){var r=o.transformCoordToLocal(t,e),a=o.shape;
- // For performance consideration, don't use 'getBoundingRect'.
- if(!(a.x<=r[0]&&r[0]<=a.x+a.width&&a.y<=r[1]&&r[1]<=a.y+a.height))return!1;// Suppress visit subtree.
- n={node:i,offsetX:r[0],offsetY:r[1]}}}),this),n},e.type="treemap",e}(Ou);const eb=tb;var nb=a,ib=o,ob=-1,rb=/** @class */function(){function e(t){var n=t.mappingMethod,r=t.type,l=this.option=et(t);this.type=r,this.mappingMethod=n,this._normalizeData=gb[n];var u=e.visualHandlers[r];this.applyVisual=u.applyVisual,this.getColorMapper=u.getColorMapper,this._normalizedToVisual=u._normalizedToVisual[n],"piecewise"===n?(ab(l),function(t){var e=t.pieceList;t.hasSpecialVisual=!1,a(e,(function(e,n){e.originIndex=n,
- // piece.visual is "result visual value" but not
- // a visual range, so it does not need to be normalized.
- null!=e.visual&&(t.hasSpecialVisual=!0)}))}(l)):"category"===n?l.categories?function(t){
- // Hash categories.
- var e=t.categories,n=t.categoryMap={},r=t.visual;
- // Process visual map input.
- if(nb(e,(function(t,e){n[t]=e})),!i(r)){var a=[];o(r)?nb(r,(function(t,e){var i=n[e];a[null!=i?i:ob]=t})):
- // Is primary type, represents default visual.
- a[-1]=r,r=fb(t,a)}
- // Remove categories that has no visual,
- // then we can mapping them to CATEGORY_DEFAULT_VISUAL_INDEX.
- for(var s=e.length-1;s>=0;s--)null==r[s]&&(delete n[e[s]],e.pop())}(l):ab(l,!0):(
- // mappingMethod === 'linear' or 'fixed'
- s("linear"!==n||l.dataExtent),ab(l))}return e.prototype.mapValueToVisual=function(t){var e=this._normalizeData(t);return this._normalizedToVisual(e,t)},e.prototype.getNormalizer=function(){return lt(this._normalizeData,this)},
- /**
- * List available visual types.
- *
- * @public
- * @return {Array.<string>}
- */
- e.listVisualTypes=function(){return v(e.visualHandlers)},
- // /**
- // * @public
- // */
- // static addVisualHandler(name, handler) {
- // visualHandlers[name] = handler;
- // }
- /**
- * @public
- */
- e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},
- /**
- * Convenient method.
- * Visual can be Object or Array or primary type.
- */
- e.eachVisual=function(t,e,n){o(t)?a(t,e,n):e.call(n,t)},e.mapVisual=function(t,n,r){var a,s=i(t)?[]:o(t)?{}:(a=!0,null);return e.eachVisual(t,(function(t,e){var i=n.call(r,t,e);a?s=i:s[e]=i})),s},
- /**
- * Retrieve visual properties from given object.
- */
- e.retrieveVisuals=function(t){var n,i={};return t&&nb(e.visualHandlers,(function(e,o){t.hasOwnProperty(o)&&(i[o]=t[o],n=!0)})),n?i:null},
- /**
- * Give order to visual types, considering colorSaturation, colorAlpha depends on color.
- *
- * @public
- * @param {(Object|Array)} visualTypes If Object, like: {color: ..., colorSaturation: ...}
- * IF Array, like: ['color', 'symbol', 'colorSaturation']
- * @return {Array.<string>} Sorted visual types.
- */
- e.prepareVisualTypes=function(t){if(i(t))t=t.slice();else{if(!ib(t))return[];var e=[];nb(t,(function(t,n){e.push(n)})),t=e}return t.sort((function(t,e){
- // color should be front of colorSaturation, colorAlpha, ...
- // symbol and symbolSize do not matter.
- return"color"===e&&"color"!==t&&0===t.indexOf("color")?1:-1})),t},
- /**
- * 'color', 'colorSaturation', 'colorAlpha', ... are depends on 'color'.
- * Other visuals are only depends on themself.
- */
- e.dependsOn=function(t,e){return"color"===e?!(!t||0!==t.indexOf(e)):t===e},
- /**
- * @param value
- * @param pieceList [{value: ..., interval: [min, max]}, ...]
- * Always from small to big.
- * @param findClosestWhenOutside Default to be false
- * @return index
- */
- e.findPieceIndex=function(e,n,i){
- // value has the higher priority.
- for(var o,r=Infinity,a=0,s=n.length;a<s;a++){var l=n[a].value;if(null!=l){if(l===e||t(l)&&l===e+"")return a;i&&h(l,a)}}for(a=0,s=n.length;a<s;a++){var u=n[a],c=u.interval,d=u.close;if(c){if(-Infinity===c[0]){if(yb(d[1],e,c[1]))return a}else if(Infinity===c[1]){if(yb(d[0],c[0],e))return a}else if(yb(d[0],c[0],e)&&yb(d[1],e,c[1]))return a;i&&h(c[0],a),i&&h(c[1],a)}}if(i)return Infinity===e?n.length-1:-Infinity===e?0:o;function h(t,n){var i=Math.abs(t-e);i<r&&(r=i,o=n)}},e.visualHandlers={color:{applyVisual:ub("color"),getColorMapper:function(){var t=this.option;return lt("category"===t.mappingMethod?function(t,e){return!e&&(t=this._normalizeData(t)),cb.call(this,t)}:function(e,n,i){
- // If output rgb array
- // which will be much faster and useful in pixel manipulation
- var o=!!i;return!n&&(e=this._normalizeData(e)),i=ae(e,t.parsedVisual,i),o?i:se(i,"rgba")},this)},_normalizedToVisual:{linear:function(t){return se(ae(t,this.option.parsedVisual),"rgba")},category:cb,piecewise:function(t,e){var n=pb.call(this,e);return null==n&&(n=se(ae(t,this.option.parsedVisual),"rgba")),n},fixed:db}},colorHue:sb((function(t,e){return ue(t,e)})),colorSaturation:sb((function(t,e){return ue(t,null,e)})),colorLightness:sb((function(t,e){return ue(t,null,null,e)})),colorAlpha:sb((function(t,e){return ce(t,e)})),decal:{applyVisual:ub("decal"),_normalizedToVisual:{linear:null,category:cb,piecewise:null,fixed:null}},opacity:{applyVisual:ub("opacity"),_normalizedToVisual:hb([0,1])},liftZ:{applyVisual:ub("liftZ"),_normalizedToVisual:{linear:db,category:db,piecewise:db,fixed:db}},symbol:{applyVisual:function(t,e,n){n("symbol",this.mapValueToVisual(t))},_normalizedToVisual:{linear:lb,category:cb,piecewise:function(t,e){var n=pb.call(this,e);return null==n&&(n=lb.call(this,t)),n},fixed:db}},symbolSize:{applyVisual:ub("symbolSize"),_normalizedToVisual:hb([0,1])}},e}();function ab(t,e){var n=t.visual,i=[];o(n)?nb(n,(function(t){i.push(t)})):null!=n&&i.push(n);e||1!==i.length||{color:1,symbol:1}.hasOwnProperty(t.type)||(
- // Do not care visualArr.length === 0, which is illegal.
- i[1]=i[0]),fb(t,i)}function sb(t){return{applyVisual:function(e,n,i){
- // Only used in HSL
- var o=this.mapValueToVisual(e);
- // Must not be array value
- i("color",t(n("color"),o))},_normalizedToVisual:hb([0,1])}}function lb(t){var e=this.option.visual;return e[Math.round(Xe(t,[0,1],[0,e.length-1],!0))]||{};// TODO {}?
- }function ub(t){return function(e,n,i){i(t,this.mapValueToVisual(e))}}function cb(t){var e=this.option.visual;return e[this.option.loop&&t!==ob?t%e.length:t]}function db(){
- // visual will be convert to array.
- return this.option.visual[0]}
- /**
- * Create mapped to numeric visual
- */function hb(t){return{linear:function(e){return Xe(e,t,this.option.visual,!0)},category:cb,piecewise:function(e,n){var i=pb.call(this,n);return null==i&&(i=Xe(e,t,this.option.visual,!0)),i},fixed:db}}function pb(t){var e=this.option,n=e.pieceList;if(e.hasSpecialVisual){var i=n[rb.findPieceIndex(t,n)];if(i&&i.visual)return i.visual[this.type]}}function fb(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=n(e,(function(t){var e=le(t);return e||[0,0,0,1]}))),e}
- /**
- * Normalizers by mapping methods.
- */var gb={linear:function(t){return Xe(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,n=rb.findPieceIndex(t,e,!0);if(null!=n)return Xe(n,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;// ordinal value
- return null==e?ob:e},fixed:dt};function yb(t,e,n){return t?e<=n:e<n}const mb=rb;var vb=On();const xb={seriesType:"treemap",reset:function(t){var e=t.getData().tree.root;e.isRemoved()||_b(e,
- // Visual should calculate from tree root but not view root.
- {},t.getViewRoot().getAncestors(),t)}};function _b(t,e,n,i){var o=t.getModel(),r=t.getLayout(),s=t.hostTree.data;
- // Optimize
- if(r&&!r.invisible&&r.isInView){var l,u=o.getModel("itemStyle"),c=function(t,e,n){var i=p({},e),o=n.designatedVisualItemStyle;return a(["color","colorAlpha","colorSaturation"],(function(n){
- // Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel
- o[n]=e[n];var r=t.get(n);o[n]=null,null!=r&&(i[n]=r)})),i}(u,e,i),d=s.ensureUniqueItemVisual(t.dataIndex,"style"),h=u.get("borderColor"),f=u.get("borderColorSaturation");null!=f&&(h=function(t,e){return null!=e?ue(e,null,null,t):null}(f,
- // For performance, do not always execute 'calculateColor'.
- l=bb(c))),d.stroke=h;var g=t.viewChildren;if(g&&g.length){var y=function(t,e,n,i,o,r){if(!r||!r.length)return;var a=wb(e,"color")||null!=o.color&&"none"!==o.color&&(wb(e,"colorAlpha")||wb(e,"colorSaturation"));if(!a)return;var s=e.get("visualMin"),l=e.get("visualMax"),u=n.dataExtent.slice();null!=s&&s<u[0]&&(u[0]=s),null!=l&&l>u[1]&&(u[1]=l);var c=e.get("colorMappingBy"),d={type:a.name,dataExtent:u,visual:a.range};"color"!==d.type||"index"!==c&&"id"!==c?d.mappingMethod="linear":(d.mappingMethod="category",d.loop=!0);var h=new mb(d);return vb(h).drColorMappingBy=c,h}
- // Notice: If we don't have the attribute 'colorRange', but only use
- // attribute 'color' to represent both concepts of 'colorRange' and 'color',
- // (It means 'colorRange' when 'color' is Array, means 'color' when not array),
- // this problem will be encountered:
- // If a level-1 node doesn't have children, and its siblings have children,
- // and colorRange is set on level-1, then the node cannot be colored.
- // So we separate 'colorRange' and 'color' to different attributes.
- (0,o,r,0,c,g);
- // Designate visual to children.
- a(g,(function(t,e){
- // If higher than viewRoot, only ancestors of viewRoot is needed to visit.
- if(t.depth>=n.length||t===n[t.depth]){var r=function(t,e,n,i,o,r){var a=p({},e);if(o){
- // Only support color, colorAlpha, colorSaturation.
- var s=o.type,l="color"===s&&vb(o).drColorMappingBy,u="index"===l?i:"id"===l?r.mapIdToIndex(n.getId()):n.getValue(t.get("visualDimension"));a[s]=o.mapValueToVisual(u)}return a}(o,c,t,e,y,i);_b(t,r,n,i)}}))}else l=bb(c),
- // Apply visual to this node.
- d.fill=l}}function bb(t){var e=Sb(t,"color");if(e){var n=Sb(t,"colorAlpha"),i=Sb(t,"colorSaturation");return i&&(e=ue(e,null,null,i)),n&&(e=ce(e,n)),e}}function Sb(t,e){var n=t[e];if(null!=n&&"none"!==n)return n}function wb(t,e){
- // 'colorRange', 'colorARange', 'colorSRange'.
- // If not exists on this node, fetch from levels and series.
- var n=t.get(e);return i(n)&&n.length?{name:e,range:n}:null}var Mb=Math.max,Ib=Math.min,Db=Yt,Tb=a,Cb=["itemStyle","borderWidth"],Ab=["itemStyle","gapWidth"],Lb=["upperLabel","show"],kb=["upperLabel","height"];
- /**
- * @public
- */
- const Pb={seriesType:"treemap",reset:function(t,e,n,i){
- // Layout result in each node:
- // {x, y, width, height, area, borderWidth}
- var o=n.getWidth(),r=n.getHeight(),a=t.option,s=xa(t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),l=a.size||[],u=je(Db(s.width,l[0]),o),c=je(Db(s.height,l[1]),r),d=i&&i.type,h=A_(i,["treemapZoomToNode","treemapRootToNode"],t),f="treemapRender"===d||"treemapMove"===d?i.rootRect:null,g=t.getViewRoot(),y=L_(g);if("treemapMove"!==d){var m="treemapZoomToNode"===d?
- // Return [containerWidth, containerHeight] as default.
- function(t,e,n,i,o){
- // If targetInfo.node exists, we zoom to the node,
- // so estimate whole width and height by target node.
- var r,a=(e||{}).node,s=[i,o];if(!a||a===n)return s;var l=i*o,u=l*t.option.zoomToNodeRatio;for(;r=a.parentNode;){for(
- // jshint ignore:line
- var c=0,d=r.children,h=0,p=d.length;h<p;h++)c+=d[h].getValue();var f=a.getValue();if(0===f)return s;u*=c/f;
- // Considering border, suppose aspect ratio is 1.
- var g=r.getModel(),y=g.get(Cb);(u+=4*y*y+(3*y+Math.max(y,Vb(g)))*Math.pow(u,.5))>nn&&(u=nn),a=r}u<l&&(u=l);var m=Math.pow(u/l,.5);return[i*m,o*m]}
- // Root position based on coord of containerGroup
- (t,h,g,u,c):f?[f.width,f.height]:[u,c],v=a.sort;v&&"asc"!==v&&"desc"!==v&&(
- // Default to be desc order.
- v="desc");var x={squareRatio:a.squareRatio,sort:v,leafDepth:a.leafDepth};
- // layout should be cleared because using updateView but not update.
- g.hostTree.clearLayouts();
- // TODO
- // optimize: if out of view clip, do not layout.
- // But take care that if do not render node out of view clip,
- // how to calculate start po
- var _={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};g.setLayout(_),Nb(g,x,!1,0),
- // Supplement layout.
- _=g.getLayout(),Tb(y,(function(t,e){var n=(y[e+1]||g).getValue();t.setLayout(p({dataExtent:[n,n],borderWidth:0,upperHeight:0},_))}))}var b=t.getData().tree.root;b.setLayout(function(t,e,n){if(e)return{x:e.x,y:e.y};var i={x:0,y:0};if(!n)return i;
- // If targetInfo is fetched by 'retrieveTargetInfo',
- // old tree and new tree are the same tree,
- // so the node still exists and we can visit it.
- var o=n.node,r=o.getLayout();if(!r)return i;
- // Transform coord from local to container.
- var a=[r.width/2,r.height/2],s=o;for(;s;){var l=s.getLayout();a[0]+=l.x,a[1]+=l.y,s=s.parentNode}return{x:t.width/2-a[0],y:t.height/2-a[1]}}
- // Mark nodes visible for prunning when visual coding and rendering.
- // Prunning depends on layout and root position, so we have to do it after layout.
- (s,f,h),!0),t.setLayoutInfo(s),
- // FIXME
- // 现在没有clip功能,暂时取ec高宽。
- Eb(b,
- // Transform to base element coordinate system.
- new Y(-s.x,-s.y,o,r),y,g,0)}};
- /**
- * Layout treemap with squarify algorithm.
- * The original presentation of this algorithm
- * was made by Mark Bruls, Kees Huizing, and Jarke J. van Wijk
- * <https://graphics.ethz.ch/teaching/scivis_common/Literature/squarifiedTreeMaps.pdf>.
- * The implementation of this algorithm was originally copied from "d3.js"
- * <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/layout/treemap.js>
- * with some modifications made for this program.
- * See the license statement at the head of this file.
- *
- * @protected
- * @param {module:echarts/data/Tree~TreeNode} node
- * @param {Object} options
- * @param {string} options.sort 'asc' or 'desc'
- * @param {number} options.squareRatio
- * @param {boolean} hideChildren
- * @param {number} depth
- */function Nb(t,e,n,i){var o,r;if(!t.isRemoved()){var a=t.getLayout();o=a.width,r=a.height;
- // Considering border and gap
- var s=t.getModel(),l=s.get(Cb),u=s.get(Ab)/2,c=Vb(s),d=Math.max(l,c),h=l-u,p=d-u;t.setLayout({borderWidth:l,upperHeight:d,upperLabelHeight:c},!0);var f=(o=Mb(o-2*h,0))*(r=Mb(r-h-p,0)),g=
- /**
- * Set area to each child, and calculate data extent for visual coding.
- */
- function(t,e,n,i,o,r){var a=t.children||[],s=i.sort;"asc"!==s&&"desc"!==s&&(s=null);var l=null!=i.leafDepth&&i.leafDepth<=r;
- // leafDepth has higher priority.
- if(o&&!l)return t.viewChildren=[];
- // Sort children, order by desc.
- a=st(a,(function(t){return!t.isRemoved()})),
- /**
- * Sort
- */
- function(t,e){e&&t.sort((function(t,n){var i="asc"===e?t.getValue()-n.getValue():n.getValue()-t.getValue();return 0===i?"asc"===e?t.dataIndex-n.dataIndex:n.dataIndex-t.dataIndex:i}))}
- /**
- * Statistic
- */(a,s);var u=function(t,e,n){for(
- // Calculate sum.
- var i=0,o=0,r=e.length;o<r;o++)i+=e[o].getValue();
- // Statistic data extent for latter visual coding.
- // Notice: data extent should be calculate based on raw children
- // but not filtered view children, otherwise visual mapping will not
- // be stable when zoom (where children is filtered by visibleMin).
- var a,s=t.get("visualDimension");
- // The same as area dimension.
- e&&e.length?"value"===s&&n?(a=[e[e.length-1].getValue(),e[0].getValue()],"asc"===n&&a.reverse()):(a=[Infinity,-Infinity],Tb(e,(function(t){var e=t.getValue(s);e<a[0]&&(a[0]=e),e>a[1]&&(a[1]=e)}))):a=[NaN,NaN];return{sum:i,dataExtent:a}}
- /**
- * Computes the score for the specified row,
- * as the worst aspect ratio.
- */(e,a,s);if(0===u.sum)return t.viewChildren=[];if(u.sum=
- /**
- * Consider 'visibleMin'. Modify viewChildren and get new sum.
- */
- function(t,e,n,i,o){
- // visibleMin is not supported yet when no option.sort.
- if(!i)return n;
- // Always travel from little value to big value.
- for(var r=t.get("visibleMin"),a=o.length,s=a,l=a-1;l>=0;l--){var u=o["asc"===i?a-l-1:l].getValue();u/n*e<r&&(s=l,n-=u)}return"asc"===i?o.splice(0,a-s):o.splice(s,a-s),n}(e,n,u.sum,s,a),0===u.sum)return t.viewChildren=[];
- // Set area to each child.
- for(var c=0,d=a.length;c<d;c++){var h=a[c].getValue()/u.sum*n;
- // Do not use setLayout({...}, true), because it is needed to clear last layout.
- a[c].setLayout({area:h})}l&&(a.length&&t.setLayout({isLeafRoot:!0},!0),a.length=0);return t.viewChildren=a,t.setLayout({dataExtent:u.dataExtent},!0),a}(t,s,f,e,n,i);if(g.length){var y={x:h,y:p,width:o,height:r},m=Ib(o,r),v=Infinity,x=[];x.area=0;for(var _=0,b=g.length;_<b;){var S=g[_];x.push(S),x.area+=S.getLayout().area;var w=Ob(x,m,e.squareRatio);
- // continue with this orientation
- w<=v?(_++,v=w):(x.area-=x.pop().getLayout().area,Rb(x,m,y,u,!1),m=Ib(y.width,y.height),x.length=x.area=0,v=Infinity)}if(x.length&&Rb(x,m,y,u,!0),!n){var M=s.get("childrenVisibleMin");null!=M&&f<M&&(n=!0)}for(_=0,b=g.length;_<b;_++)Nb(g[_],e,n,i+1)}}}function Ob(t,e,n){for(var i=0,o=Infinity,r=0,a=void 0,s=t.length;r<s;r++)(a=t[r].getLayout().area)&&(a<o&&(o=a),a>i&&(i=a));var l=t.area*t.area,u=e*e*n;return l?Mb(u*i/l,l/(u*o)):Infinity}
- /**
- * Positions the specified row of nodes. Modifies `rect`.
- */function Rb(t,e,n,i,o){
- // When rowFixedLength === rect.width,
- // it is horizontal subdivision,
- // rowFixedLength is the width of the subdivision,
- // rowOtherLength is the height of the subdivision,
- // and nodes will be positioned from left to right.
- // wh[idx0WhenH] means: when horizontal,
- // wh[idx0WhenH] => wh[0] => 'width'.
- // xy[idx1WhenH] => xy[1] => 'y'.
- var r=e===n.width?0:1,a=1-r,s=["x","y"],l=["width","height"],u=n[s[r]],c=e?t.area/e:0;(o||c>n[l[a]])&&(c=n[l[a]]);for(var d=0,h=t.length;d<h;d++){var p=t[d],f={},g=c?p.getLayout().area/c:0,y=f[l[a]]=Mb(c-2*i,0),m=n[s[r]]+n[l[r]]-u,v=d===h-1||m<g?m:g,x=f[l[r]]=Mb(v-2*i,0);f[s[a]]=n[s[a]]+Ib(i,y/2),f[s[r]]=u+Ib(i,x/2),u+=v,p.setLayout(f,!0)}n[s[a]]+=c,n[l[a]]-=c}function Eb(t,e,n,i,o){var r=t.getLayout(),a=n[o],s=a&&a===t;if(!(a&&!s||o===n.length&&t!==i)){t.setLayout({
- // isInView means: viewRoot sub tree + viewAbovePath
- isInView:!0,
- // invisible only means: outside view clip so that the node can not
- // see but still layout for animation preparation but not render.
- invisible:!s&&!e.intersect(r),isAboveViewRoot:s},!0);
- // Transform to child coordinate.
- var l=new Y(e.x-r.x,e.y-r.y,e.width,e.height);Tb(t.viewChildren||[],(function(t){Eb(t,l,n,i,o+1)}))}}function Vb(t){return t.get(Lb)?t.get(kb):0}function zb(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.eachSeriesByType("graph",(function(t){var n=t.getCategoriesData(),i=t.getGraph().data,o=n.mapArray(n.getName);i.filterSelf((function(t){var n=i.getItemModel(t).getShallow("category");if(null!=n){l(n)&&(n=o[n]);
- // If in any legend component the status is not selected.
- for(var r=0;r<e.length;r++)if(!e[r].isSelected(n))return!1}return!0}))}))}function Bb(e){var n={};e.eachSeriesByType("graph",(function(e){var i=e.getCategoriesData(),o=e.getData(),r={};i.each((function(t){var o=i.getName(t);
- // Add prefix to avoid conflict with Object.prototype.
- r["ec-"+o]=t;var a=i.getItemModel(t),s=a.getModel("itemStyle").getItemStyle();s.fill||(
- // Get color from palette.
- s.fill=e.getColorFromPalette(o,n)),i.setItemVisual(t,"style",s);for(var l=["symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++){var c=a.getShallow(l[u],!0);null!=c&&i.setItemVisual(t,l[u],c)}})),
- // Assign category color to visual
- i.count()&&o.each((function(e){var n=o.getItemModel(e).getShallow("category");if(null!=n){t(n)&&(n=r["ec-"+n]);var a=i.getItemVisual(n,"style"),s=o.ensureUniqueItemVisual(e,"style");p(s,a);for(var l=["symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++)o.setItemVisual(e,l[u],i.getItemVisual(n,l[u]))}}))}))}function Gb(t){return t instanceof Array||(t=[t,t]),t}function Fb(t){t.eachSeriesByType("graph",(function(t){var e=t.getGraph(),n=t.getEdgeData(),i=Gb(t.get("edgeSymbol")),o=Gb(t.get("edgeSymbolSize"));
- // const colorQuery = ['lineStyle', 'color'] as const;
- // const opacityQuery = ['lineStyle', 'opacity'] as const;
- n.setVisual("fromSymbol",i&&i[0]),n.setVisual("toSymbol",i&&i[1]),n.setVisual("fromSymbolSize",o&&o[0]),n.setVisual("toSymbolSize",o&&o[1]),n.setVisual("style",t.getModel("lineStyle").getLineStyle()),n.each((function(t){var i=n.getItemModel(t),o=e.getEdgeByIndex(t),r=Gb(i.getShallow("symbol",!0)),a=Gb(i.getShallow("symbolSize",!0)),s=i.getModel("lineStyle").getLineStyle(),l=n.ensureUniqueItemVisual(t,"style");switch(p(l,s),l.stroke){case"source":var u=o.node1.getVisual("style");l.stroke=u&&u.fill;break;case"target":u=o.node2.getVisual("style");l.stroke=u&&u.fill}r[0]&&o.setVisual("fromSymbol",r[0]),r[1]&&o.setVisual("toSymbol",r[1]),a[0]&&o.setVisual("fromSymbolSize",a[0]),a[1]&&o.setVisual("toSymbolSize",a[1])}))}))}var Wb="--\x3e",Hb=function(t){return t.get("autoCurveness")||null},Yb=function(t,e){var n=Hb(t),o=20,r=[];
- // handler the function set
- if(l(n))o=n;else if(i(n))return void(t.__curvenessList=n);
- // append length
- e>o&&(o=e);
- // make sure the length is even
- var a=o%2?o+2:o+3;r=[];for(var s=0;s<a;s++)r.push((s%2?s+1:s)/10*(s%2?-1:1));t.__curvenessList=r},Ub=function(t,e,n){var i=[t.id,t.dataIndex].join("."),o=[e.id,e.dataIndex].join(".");return[n.uid,i,o].join(Wb)},Zb=function(t){var e=t.split(Wb);return[e[0],e[2],e[1]].join(Wb)},Xb=function(t,e){var n=e.__edgeMap;return n[t]?n[t].length:0};
- /**
- * params handler
- * @param {module:echarts/model/SeriesModel} seriesModel
- * @returns {*}
- */
- /**
- * get curvature for edge
- * @param edge
- * @param {module:echarts/model/SeriesModel} seriesModel
- * @param index
- */
- function jb(t,e,n,o){var r=Hb(e),a=i(r);if(!r)return null;var s=function(t,e){var n=Ub(t.node1,t.node2,e);return e.__edgeMap[n]}(t,e);if(!s)return null;for(var l=-1,u=0;u<s.length;u++)if(s[u]===n){l=u;break}
- // if totalLen is Longer createCurveness
- var c=function(t,e){return Xb(Ub(t.node1,t.node2,e),e)+Xb(Ub(t.node2,t.node1,e),e)}(t,e);Yb(e,c),t.lineStyle=t.lineStyle||{};
- // if is opposite edge, must set curvenss to opposite number
- var d=Ub(t.node1,t.node2,e),h=e.__curvenessList,p=a||c%2?0:1;if(s.isForward)return h[p+l];
- // the opposite edge show outside
- var f=Zb(d),g=Xb(f,e),y=h[l+g+p];
- // isNeedReverse, simple, force type need reverse the curveness in the junction of the forword and the opposite
- return o?
- // set as array may make the parity handle with the len of opposite
- a?r&&0===r[0]?(g+p)%2?y:-y:((g%2?0:1)+p)%2?y:-y:(g+p)%2?y:-y:h[l+g+p]}function qb(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var n=t.getGraph();n.eachNode((function(t){var e=t.getModel();t.setLayout([+e.get("x"),+e.get("y")])})),Kb(n,t)}}function Kb(t,e){t.eachEdge((function(t,n){var i=Ht(t.getModel().get(["lineStyle","curveness"]),-jb(t,e,n,!0),0),o=de(t.node1.getLayout()),r=de(t.node2.getLayout()),a=[o,r];+i&&a.push([(o[0]+r[0])/2-(o[1]-r[1])*i,(o[1]+r[1])/2-(r[0]-o[0])*i]),t.setLayout(a)}))}function Jb(t,e){t.eachSeriesByType("graph",(function(t){var e=t.get("layout"),n=t.coordinateSystem;if(n&&"view"!==n.type){var i=t.getData(),o=[];a(n.dimensions,(function(t){o=o.concat(i.mapDimensionsAll(t))}));for(var r=0;r<i.count();r++){for(var s=[],l=!1,u=0;u<o.length;u++){var c=i.get(o[u],r);isNaN(c)||(l=!0),s.push(c)}l?i.setItemLayout(r,n.dataToPoint(s)):
- // Also {Array.<number>}, not undefined to avoid if...else... statement
- i.setItemLayout(r,[NaN,NaN])}Kb(i.graph,t)}else e&&"none"!==e||qb(t)}))}
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */function $b(t){var e=t.coordinateSystem;if("view"!==e.type)return 1;var n=t.option.nodeScaleRatio,i=e.scaleX;return((e.getZoom()-1)*n+1)/i}function Qb(t){var e=t.getVisual("symbolSize");return e instanceof Array&&(e=(e[0]+e[1])/2),+e}var tS=Math.PI,eS=[];
- /**
- * `basedOn` can be:
- * 'value':
- * This layout is not accurate and have same bad case. For example,
- * if the min value is very smaller than the max value, the nodes
- * with the min value probably overlap even though there is enough
- * space to layout them. So we only use this approach in the as the
- * init layout of the force layout.
- * FIXME
- * Probably we do not need this method any more but use
- * `basedOn: 'symbolSize'` in force layout if
- * delay its init operations to GraphView.
- * 'symbolSize':
- * This approach work only if all of the symbol size calculated.
- * That is, the progressive rendering is not applied to graph.
- * FIXME
- * If progressive rendering is applied to graph some day,
- * probably we have to use `basedOn: 'value'`.
- */
- function nS(t,e,n,i){var o=t.coordinateSystem;if(!o||"view"===o.type){var r=o.getBoundingRect(),a=t.getData(),s=a.graph,l=r.width/2+r.x,u=r.height/2+r.y,c=Math.min(r.width,r.height)/2,d=a.count();if(a.setLayout({cx:l,cy:u}),d){if(n){var h=o.pointToData(i),p=h[0],f=h[1],g=[p-l,f-u];he(g,g),pe(g,g,c),n.setLayout([l+g[0],u+g[1]],!0),oS(n,t.get(["circular","rotateLabel"]),l,u)}iS[e](t,s,a,c,l,u,d),s.eachEdge((function(e,n){var i,o=Ht(e.getModel().get(["lineStyle","curveness"]),jb(e,t,n),0),r=de(e.node1.getLayout()),a=de(e.node2.getLayout()),s=(r[0]+a[0])/2,c=(r[1]+a[1])/2;+o&&(i=[l*(o*=3)+s*(1-o),u*o+c*(1-o)]),e.setLayout([r,a,i])}))}}}var iS={value:function(t,e,n,i,o,r,a){var s=0,l=n.getSum("value"),u=2*Math.PI/(l||a);e.eachNode((function(t){var e=t.getValue("value"),n=u*(l?e:1)/2;s+=n,t.setLayout([i*Math.cos(s)+o,i*Math.sin(s)+r]),s+=n}))},symbolSize:function(t,e,n,i,o,r,a){var s=0;eS.length=a;var l=$b(t);e.eachNode((function(t){var e=Qb(t);
- // Normally this case will not happen, but we still add
- // some the defensive code (2px is an arbitrary value).
- isNaN(e)&&(e=2),e<0&&(e=0),e*=l;var n=Math.asin(e/2/i);
- // when `symbolSize / 2` is bigger than `r`.
- isNaN(n)&&(n=tS/2),eS[t.dataIndex]=n,s+=2*n}));var u=(2*tS-s)/a/2,c=0;e.eachNode((function(t){var e=u+eS[t.dataIndex];c+=e,
- // init circular layout for
- // 1. layout undefined node
- // 2. not fixed node
- (!t.getLayout()||!t.getLayout().fixed)&&t.setLayout([i*Math.cos(c)+o,i*Math.sin(c)+r]),c+=e}))}};function oS(t,e,n,i){var o=t.getGraphicEl();
- // need to check if el exists. '-' value may not create node element.
- if(o){var r=t.getModel().get(["label","rotate"])||0,a=o.getSymbolPath();if(e){var s=t.getLayout(),l=Math.atan2(s[1]-i,s[0]-n);l<0&&(l=2*Math.PI+l);var u=s[0]<n;u&&(l-=Math.PI);var c=u?"left":"right";a.setTextConfig({rotation:-l,position:c,origin:"center"});var d=a.ensureState("emphasis");p(d.textConfig||(d.textConfig={}),{position:c})}else a.setTextConfig({rotation:r*=Math.PI/180})}}function rS(t){t.eachSeriesByType("graph",(function(t){"circular"===t.get("layout")&&nS(t,"symbolSize")}))}var aS=ve;
- // function adjacentNode(n, e) {
- // return e.n1 === n ? e.n2 : e.n1;
- // }
- function sS(t){t.eachSeriesByType("graph",(function(t){var e=t.coordinateSystem;if(!e||"view"===e.type)if("force"===t.get("layout")){var n=t.preservedPoints||{},o=t.getGraph(),r=o.data,a=o.edgeData,s=t.getModel("force"),l=s.get("initLayout");t.preservedPoints?r.each((function(t){var e=r.getId(t);r.setItemLayout(t,n[e]||[NaN,NaN])})):l&&"none"!==l?"circular"===l&&nS(t,"value"):qb(t);var u=r.getDataExtent("value"),c=a.getDataExtent("value"),d=s.get("repulsion"),h=s.get("edgeLength"),p=i(d)?d:[d,d],f=i(h)?h:[h,h];
- // Larger value has smaller length
- f=[f[1],f[0]];var g=r.mapArray("value",(function(t,e){var n=r.getItemLayout(e),i=Xe(t,u,p);return isNaN(i)&&(i=(p[0]+p[1])/2),{w:i,rep:i,fixed:r.getItemModel(e).get("fixed"),p:!n||isNaN(n[0])||isNaN(n[1])?null:n}})),y=a.mapArray("value",(function(e,n){var i=o.getEdgeByIndex(n),r=Xe(e,c,f);isNaN(r)&&(r=(f[0]+f[1])/2);var a=i.getModel(),s=Ht(i.getModel().get(["lineStyle","curveness"]),-jb(i,t,n,!0),0);return{n1:g[i.node1.dataIndex],n2:g[i.node2.dataIndex],d:r,curveness:s,ignoreForceLayout:a.get("ignoreForceLayout")}})),m=e.getBoundingRect(),v=function(t,e,n){
- // for (let i = 0; i < edges.length; i++) {
- // let e = edges[i];
- // let n1 = e.n1;
- // let n2 = e.n2;
- // n1.edges = n1.edges || [];
- // n2.edges = n2.edges || [];
- // n1.edges.push(e);
- // n2.edges.push(e);
- // }
- // Init position
- for(var i=t,o=e,r=n.rect,a=r.width,s=r.height,l=[r.x+a/2,r.y+s/2],u=null==n.gravity?.1:n.gravity,c=0;c<i.length;c++){var d=i[c];d.p||(d.p=fe(a*(Math.random()-.5)+l[0],s*(Math.random()-.5)+l[1])),d.pp=de(d.p),d.edges=null}
- // Formula in 'Graph Drawing by Force-directed Placement'
- // let k = scale * Math.sqrt(width * height / nodes.length);
- // let k2 = k * k;
- var h,p,f=null==n.friction?.6:n.friction,g=f;return{warmUp:function(){g=.8*f},setFixed:function(t){i[t].fixed=!0},setUnfixed:function(t){i[t].fixed=!1},
- /**
- * Before step hook
- */
- beforeStep:function(t){h=t},
- /**
- * After step hook
- */
- afterStep:function(t){p=t},
- /**
- * Some formulas were originally copied from "d3.js"
- * https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js
- * with some modifications made for this project.
- * See the license statement at the head of this file.
- */
- step:function(t){h&&h(i,o);for(var e=[],n=i.length,r=0;r<o.length;r++){var a=o[r];if(!a.ignoreForceLayout){var s=a.n1,c=a.n2;ge(e,c.p,s.p);var d=ye(e)-a.d,f=c.w/(s.w+c.w);isNaN(f)&&(f=0),he(e,e),!s.fixed&&aS(s.p,s.p,e,f*d*g),!c.fixed&&aS(c.p,c.p,e,-(1-f)*d*g)}}
- // Gravity
- for(r=0;r<n;r++)(x=i[r]).fixed||(ge(e,l,x.p),
- // let d = vec2.len(v12);
- // vec2.scale(v12, v12, 1 / d);
- // let gravityFactor = gravity;
- aS(x.p,x.p,e,u*g));
- // Repulsive
- // PENDING
- for(r=0;r<n;r++){s=i[r];for(var y=r+1;y<n;y++){c=i[y],ge(e,c.p,s.p),0===(d=ye(e))&&(
- // Random repulse
- me(e,Math.random()-.5,Math.random()-.5),d=1);var m=(s.rep+c.rep)/d/d;!s.fixed&&aS(s.pp,s.pp,e,m),!c.fixed&&aS(c.pp,c.pp,e,-m)}}var v=[];for(r=0;r<n;r++){var x;(x=i[r]).fixed||(ge(v,x.p,x.pp),aS(x.p,x.p,v,g),ee(x.pp,x.p))}var _=(g*=.992)<.01;p&&p(i,o,_),t&&t(_)}}}(g,y,{rect:m,gravity:s.get("gravity"),friction:s.get("friction")});v.beforeStep((function(t,e){for(var n=0,i=t.length;n<i;n++)t[n].fixed&&
- // Write back to layout instance
- ee(t[n].p,o.getNodeByIndex(n).getLayout())})),v.afterStep((function(t,e,i){for(var a=0,s=t.length;a<s;a++)t[a].fixed||o.getNodeByIndex(a).setLayout(t[a].p),n[r.getId(a)]=t[a].p;for(a=0,s=e.length;a<s;a++){var l=e[a],u=o.getEdgeByIndex(a),c=l.n1.p,d=l.n2.p,h=u.getLayout();(h=h?h.slice():[])[0]=h[0]||[],h[1]=h[1]||[],ee(h[0],c),ee(h[1],d),+l.curveness&&(h[2]=[(c[0]+d[0])/2-(c[1]-d[1])*l.curveness,(c[1]+d[1])/2-(d[0]-c[0])*l.curveness]),u.setLayout(h)}})),t.forceLayout=v,t.preservedPoints=n,
- // Step to get the layout
- v.step()}else
- // Remove prev injected forceLayout instance
- t.forceLayout=null}))}function lS(t,e){var n=[];return t.eachSeriesByType("graph",(function(t){var i=t.get("coordinateSystem");if(!i||"view"===i){var o=t.getData(),r=o.mapArray((function(t){var e=o.getItemModel(t);return[+e.get("x"),+e.get("y")]})),a=[],s=[];ie(r,a,s),
- // If width or height is 0
- s[0]-a[0]==0&&(s[0]+=1,a[0]-=1),s[1]-a[1]==0&&(s[1]+=1,a[1]-=1);var l=(s[0]-a[0])/(s[1]-a[1]),u=function(t,e,n){return xa(p(t.getBoxLayoutParams(),{aspect:n}),{width:e.getWidth(),height:e.getHeight()})}(t,e,l);
- // FIXME If get view rect after data processed?
- // Position may be NaN, use view rect instead
- isNaN(l)&&(a=[u.x,u.y],s=[u.x+u.width,u.y+u.height]);var c=s[0]-a[0],d=s[1]-a[1],h=u.width,f=u.height,g=t.coordinateSystem=new Ex;g.zoomLimit=t.get("scaleLimit"),g.setBoundingRect(a[0],a[1],c,d),g.setViewRect(u.x,u.y,h,f),
- // Update roam info
- g.setCenter(t.get("center"),e),g.setZoom(t.get("zoom")),n.push(g)}})),n}var uS=F.prototype,cS=W.prototype,dS=function(){
- // Start point
- this.x1=0,this.y1=0,
- // End point
- this.x2=0,this.y2=0,this.percent=1};function hS(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}
- /** @class */!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Ue(e,t)}(dS);const pS=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-line",n}return Ue(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new dS},e.prototype.buildPath=function(t,e){hS(e)?uS.buildPath.call(this,t,e):cS.buildPath.call(this,t,e)},e.prototype.pointAt=function(t){return hS(this.shape)?uS.pointAt.call(this,t):cS.pointAt.call(this,t)},e.prototype.tangentAt=function(t){var e=this.shape,n=hS(e)?[e.x2-e.x1,e.y2-e.y1]:cS.tangentAt.call(this,t);return he(n,n)},e}(g);var fS=["fromSymbol","toSymbol"];function gS(t){return"_"+t+"Type"}function yS(t,e,n){var i=e.getItemVisual(n,t);if(!i||"none"===i)return i;var o=e.getItemVisual(n,t+"Size"),r=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Fc(o);return i+l+Wc(a||0,l)+(r||"")+(s||"")}
- /**
- * @inner
- */function mS(t,e,n){var i=e.getItemVisual(n,t);if(i&&"none"!==i){var o=e.getItemVisual(n,t+"Size"),r=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Fc(o),u=Wc(a||0,l),c=Gc(i,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return c.__specifiedRotation=null==r||isNaN(r)?void 0:+r*Math.PI/180||0,c.name=t,c}}function vS(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;var n=e[2];n?(t.cpx1=n[0],t.cpy1=n[1]):(t.cpx1=NaN,t.cpy1=NaN)}var xS=/** @class */function(t){function e(e,n,i){var o=t.call(this)||this;return o._createLine(e,n,i),o}return Ue(e,t),e.prototype._createLine=function(t,e,n){var i=t.hostModel,o=function(t){var e=new pS({name:"line",subPixelOptimize:!0});return vS(e.shape,t),e}(t.getItemLayout(e));o.shape.percent=0,oo(o,{shape:{percent:1}},i,e),this.add(o),a(fS,(function(n){var i=mS(n,t,e);
- // symbols must added after line to make sure
- // it will be updated after line#update.
- // Or symbol position and rotation update in line#beforeUpdate will be one frame slow
- this.add(i),this[gS(n)]=yS(n,t,e)}),this),this._updateCommonStl(t,e,n)},
- // TODO More strict on the List type in parameters?
- e.prototype.updateData=function(t,e,n){var i=t.hostModel,o=this.childOfName("line"),r=t.getItemLayout(e),s={shape:{}};vS(s.shape,r),io(o,s,i,e),a(fS,(function(n){var i=yS(n,t,e),o=gS(n);
- // Symbol changed
- if(this[o]!==i){this.remove(this.childOfName(n));var r=mS(n,t,e);this.add(r)}this[o]=i}),this),this._updateCommonStl(t,e,n)},e.prototype.getLinePath=function(){return this.childAt(0)},e.prototype._updateCommonStl=function(t,e,n){var o=t.hostModel,r=this.childOfName("line"),s=n&&n.emphasisLineStyle,l=n&&n.blurLineStyle,u=n&&n.selectLineStyle,c=n&&n.labelStatesModels,d=n&&n.emphasisDisabled,h=n&&n.focus,p=n&&n.blurScope;
- // Optimization for large dataset
- if(!n||t.hasItemOption){var f=t.getItemModel(e),g=f.getModel("emphasis");s=g.getModel("lineStyle").getLineStyle(),l=f.getModel(["blur","lineStyle"]).getLineStyle(),u=f.getModel(["select","lineStyle"]).getLineStyle(),d=g.get("disabled"),h=g.get("focus"),p=g.get("blurScope"),c=Uo(f)}var y=t.getItemVisual(e,"style"),m=y.stroke;r.useStyle(y),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=s,r.ensureState("blur").style=l,r.ensureState("select").style=u,
- // Update symbol
- a(fS,(function(t){var e=this.childOfName(t);if(e){
- // Share opacity and color with line.
- e.setColor(m),e.style.opacity=y.opacity;for(var n=0;n<li.length;n++){var i=li[n],o=r.getState(i);if(o){var a=o.style||{},s=e.ensureState(i),l=s.style||(s.style={});null!=a.stroke&&(l[e.__isEmptyBrush?"stroke":"fill"]=a.stroke),null!=a.opacity&&(l.opacity=a.opacity)}}e.markRedraw()}}),this);var v=o.getRawValue(e);Yo(this,c,{labelDataIndex:e,labelFetcher:{getFormattedLabel:function(e,n){return o.getFormattedLabel(e,n,t.dataType)}},inheritColor:m||"#000",defaultOpacity:y.opacity,defaultText:(null==v?t.getName(e):isFinite(v)?qe(v):v)+""});var x=this.getTextContent();
- // Always set `textStyle` even if `normalStyle.text` is null, because default
- // values have to be set on `normalStyle`.
- if(x){var _=c.normal;x.__align=x.style.align,x.__verticalAlign=x.style.verticalAlign,
- // 'start', 'middle', 'end'
- x.__position=_.get("position")||"middle";var b=_.get("distance");i(b)||(b=[b,b]),x.__labelDistance=b}this.setTextConfig({position:null,local:!0,inside:!1}),Ui(this,h,p,d)},e.prototype.highlight=function(){ki(this)},e.prototype.downplay=function(){Pi(this)},e.prototype.updateLayout=function(t,e){this.setLinePoints(t.getItemLayout(e))},e.prototype.setLinePoints=function(t){var e=this.childOfName("line");vS(e.shape,t),e.dirty()},e.prototype.beforeUpdate=function(){var t=this,e=t.childOfName("fromSymbol"),n=t.childOfName("toSymbol"),i=t.getTextContent();
- // Quick reject
- if(e||n||i&&!i.ignore){for(var o=1,r=this.parent;r;)r.scaleX&&(o/=r.scaleX),r=r.parent;var a=t.childOfName("line");
- // If line not changed
- // FIXME Parent scale changed
- if(this.__dirty||a.__dirty){var s=a.shape.percent,l=a.pointAt(0),u=a.pointAt(s),c=ge([],u,l);if(he(c,c),e&&(e.setPosition(l),w(e,0),e.scaleX=e.scaleY=o*s,e.markRedraw()),n&&(n.setPosition(u),w(n,1),n.scaleX=n.scaleY=o*s,n.markRedraw()),i&&!i.ignore){i.x=i.y=0,i.originX=i.originY=0;var d=void 0,h=void 0,p=i.__labelDistance,f=p[0]*o,g=p[1]*o,y=s/2,m=a.tangentAt(y),v=[m[1],-m[0]],x=a.pointAt(y);v[1]>0&&(v[0]=-v[0],v[1]=-v[1]);var _=m[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var b=-Math.atan2(m[1],m[0]);u[0]<l[0]&&(b=Math.PI+b),i.rotation=b}var S=void 0;switch(i.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":S=-g,h="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":S=g,h="top";break;default:S=0,h="middle"}switch(i.__position){case"end":i.x=c[0]*f+u[0],i.y=c[1]*g+u[1],d=c[0]>.8?"left":c[0]<-.8?"right":"center",h=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":i.x=-c[0]*f+l[0],i.y=-c[1]*g+l[1],d=c[0]>.8?"right":c[0]<-.8?"left":"center",h=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=f*_+l[0],i.y=l[1]+S,d=m[0]<0?"right":"left",i.originX=-f*_,i.originY=-S;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=x[0],i.y=x[1]+S,d="center",i.originY=-S;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-f*_+u[0],i.y=u[1]+S,d=m[0]>=0?"right":"left",i.originX=f*_,i.originY=-S}i.scaleX=i.scaleY=o,i.setStyle({
- // Use the user specified text align and baseline first
- verticalAlign:i.__verticalAlign||h,align:i.__align||d})}}}function w(t,e){
- // Fix #12388
- // when symbol is set to be 'arrow' in markLine,
- // symbolRotate value will be ignored, and compulsively use tangent angle.
- // rotate by default if symbol rotation is not specified
- var n=t.__specifiedRotation;if(null==n){var i=a.tangentAt(e);t.attr("rotation",(1===e?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else t.attr("rotation",n)}},e}(Z);const _S=xS;function bS(t){var e=t.hostModel,n=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:Uo(e)}}function SS(t){return isNaN(t[0])||isNaN(t[1])}function wS(t){return t&&!SS(t[0])&&!SS(t[1])}const MS=/** @class */function(){function t(t){this.group=new Z,this._LineCtor=t||_S}return t.prototype.updateData=function(t){var e=this;
- // Remove progressive els.
- this._progressiveEls=null;var n=this,i=n.group,o=n._lineData;n._lineData=t,
- // There is no oldLineData only when first rendering or switching from
- // stream mode to normal mode, where previous elements should be removed.
- o||i.removeAll();var r=bS(t);t.diff(o).add((function(n){e._doAdd(t,n,r)})).update((function(n,i){e._doUpdate(o,t,i,n,r)})).remove((function(t){i.remove(o.getItemGraphicEl(t))})).execute()},t.prototype.updateLayout=function(){var t=this._lineData;
- // Do not support update layout in incremental mode.
- t&&t.eachItemGraphicEl((function(e,n){e.updateLayout(t,n)}),this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=bS(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function n(t){t.isGroup||function(t){return t.animators&&t.animators.length>0}(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=t.start;i<t.end;i++){if(wS(e.getItemLayout(i))){var o=new this._LineCtor(e,i,this._seriesScope);o.traverse(n),this.group.add(o),e.setItemGraphicEl(i,o),this._progressiveEls.push(o)}}},t.prototype.remove=function(){this.group.removeAll()},t.prototype.eachRendered=function(t){Bo(this._progressiveEls||this.group,t)},t.prototype._doAdd=function(t,e,n){if(wS(t.getItemLayout(e))){var i=new this._LineCtor(t,e,n);t.setItemGraphicEl(e,i),this.group.add(i)}},t.prototype._doUpdate=function(t,e,n,i,o){var r=t.getItemGraphicEl(n);wS(e.getItemLayout(i))?(r?r.updateData(e,i,o):r=new this._LineCtor(e,i,o),e.setItemGraphicEl(i,r),this.group.add(r)):this.group.remove(r)},t}();var IS=[],DS=[],TS=[],CS=_e,AS=be,LS=Math.abs;function kS(t,e,n){for(var i,o=t[0],r=t[1],a=t[2],s=Infinity,l=n*n,u=.1,c=.1;c<=.9;c+=.1){IS[0]=CS(o[0],r[0],a[0],c),IS[1]=CS(o[1],r[1],a[1],c),(p=LS(AS(IS,e)-l))<s&&(s=p,i=c)}
- // Assume the segment is monotone,Find root through Bisection method
- // At most 32 iteration
- for(var d=0;d<32;d++){
- // let prev = t - interval;
- var h=i+u;
- // v1[0] = quadraticAt(p0[0], p1[0], p2[0], prev);
- // v1[1] = quadraticAt(p0[1], p1[1], p2[1], prev);
- DS[0]=CS(o[0],r[0],a[0],i),DS[1]=CS(o[1],r[1],a[1],i),TS[0]=CS(o[0],r[0],a[0],h),TS[1]=CS(o[1],r[1],a[1],h);var p=AS(DS,e)-l;if(LS(p)<.01)break;
- // let prevDiff = v2DistSquare(v1, center) - radiusSquare;
- var f=AS(TS,e)-l;u/=2,p<0?f>=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}
- // Adjust edge to avoid
- function PS(t,e){var n=[],i=xe,o=[[],[],[]],r=[[],[]],a=[];e/=2,t.eachEdge((function(t,s){var l=t.getLayout(),u=t.getVisual("fromSymbol"),c=t.getVisual("toSymbol");l.__original||(l.__original=[de(l[0]),de(l[1])],l[2]&&l.__original.push(de(l[2])));var d=l.__original;
- // Quadratic curve
- if(null!=l[2]){if(ee(o[0],d[0]),ee(o[1],d[2]),ee(o[2],d[1]),u&&"none"!==u){var h=Qb(t.node1),p=kS(o,d[0],h*e);
- // Subdivide and get the second
- i(o[0][0],o[1][0],o[2][0],p,n),o[0][0]=n[3],o[1][0]=n[4],i(o[0][1],o[1][1],o[2][1],p,n),o[0][1]=n[3],o[1][1]=n[4]}if(c&&"none"!==c){h=Qb(t.node2),p=kS(o,d[1],h*e);
- // Subdivide and get the first
- i(o[0][0],o[1][0],o[2][0],p,n),o[1][0]=n[1],o[2][0]=n[2],i(o[0][1],o[1][1],o[2][1],p,n),o[1][1]=n[1],o[2][1]=n[2]}
- // Copy back to layout
- ee(l[0],o[0]),ee(l[1],o[2]),ee(l[2],o[1])}
- // Line
- else{if(ee(r[0],d[0]),ee(r[1],d[1]),ge(a,r[1],r[0]),he(a,a),u&&"none"!==u){h=Qb(t.node1);ve(r[0],r[0],a,h*e)}if(c&&"none"!==c){h=Qb(t.node2);ve(r[1],r[1],a,-h*e)}ee(l[0],r[0]),ee(l[1],r[1])}}))}function NS(t){return"view"===t.type}var OS=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(t,e){var n=new Yg,i=new MS,o=this.group;this._controller=new Uv(e.getZr()),this._controllerHost={target:o},o.add(n.group),o.add(i.group),this._symbolDraw=n,this._lineDraw=i,this._firstRender=!0},e.prototype.render=function(t,e,n){var i=this,o=t.coordinateSystem;this._model=t;var r=this._symbolDraw,a=this._lineDraw,s=this.group;if(NS(o)){var l={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?s.attr(l):io(s,l,t)}
- // Fix edge contact point with node
- PS(t.getGraph(),$b(t));var u=t.getData();r.updateData(u);var c=t.getEdgeData();
- // TODO: TYPE
- a.updateData(c),this._updateNodeAndLinkScale(),this._updateController(t,e,n),clearTimeout(this._layoutTimeout);var d=t.forceLayout,h=t.get(["force","layoutAnimation"]);d&&this._startForceLayoutIteration(d,h);var p=t.get("layout");u.graph.eachNode((function(e){var n=e.dataIndex,o=e.getGraphicEl(),r=e.getModel();if(o){
- // Update draggable
- o.off("drag").off("dragend");var a=r.get("draggable");a&&o.on("drag",(function(r){switch(p){case"force":d.warmUp(),!i._layouting&&i._startForceLayoutIteration(d,h),d.setFixed(n),
- // Write position back to layout
- u.setItemLayout(n,[o.x,o.y]);break;case"circular":u.setItemLayout(n,[o.x,o.y]),
- // mark node fixed
- e.setLayout({fixed:!0},!0),
- // recalculate circular layout
- nS(t,"symbolSize",e,[r.offsetX,r.offsetY]),i.updateLayout(t);break;default:u.setItemLayout(n,[o.x,o.y]),
- // update edge
- Kb(t.getGraph(),t),i.updateLayout(t)}})).on("dragend",(function(){d&&d.setUnfixed(n)})),o.setDraggable(a,!!r.get("cursor")),"adjacency"===r.get(["emphasis","focus"])&&(ni(o).focus=e.getAdjacentDataIndices())}})),u.graph.eachEdge((function(t){var e=t.getGraphicEl(),n=t.getModel().get(["emphasis","focus"]);e&&"adjacency"===n&&(ni(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})}));var f="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),g=u.getLayout("cx"),y=u.getLayout("cy");u.graph.eachNode((function(t){oS(t,f,g,y)})),this._firstRender=!1},e.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,e){var n=this;!function i(){t.step((function(t){n.updateLayout(n._model),(n._layouting=!t)&&(e?n._layoutTimeout=setTimeout(i,16):i())}))}()},e.prototype._updateController=function(t,e,n){var i=this,o=this._controller,r=this._controllerHost,a=this.group;o.setPointerChecker((function(e,i,o){var r=a.getBoundingRect();return r.applyTransform(a.transform),r.contain(i,o)&&!qv(e,n,t)})),NS(t.coordinateSystem)?(o.enable(t.get("roam")),r.zoomLimit=t.get("scaleLimit"),r.zoom=t.coordinateSystem.getZoom(),o.off("pan").off("zoom").on("pan",(function(e){Zv(r,e.dx,e.dy),n.dispatchAction({seriesId:t.id,type:"graphRoam",dx:e.dx,dy:e.dy})})).on("zoom",(function(e){Xv(r,e.scale,e.originX,e.originY),n.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),i._updateNodeAndLinkScale(),PS(t.getGraph(),$b(t)),i._lineDraw.updateLayout(),
- // Only update label layout on zoom
- n.updateLabelLayout()}))):o.disable()},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,e=t.getData(),n=$b(t);e.eachItemGraphicEl((function(t,e){t&&t.setSymbolScale(n)}))},e.prototype.updateLayout=function(t){PS(t.getGraph(),$b(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(Ou);const RS=OS;
- // id may be function name of Object, add a prefix to avoid this problem.
- function ES(t){return"_EC_"+t}var VS=/** @class */function(){function t(t){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},
- /**
- * @type {Object.<string, module:echarts/data/Graph.Edge>}
- * @private
- */
- this._edgesMap={},this._directed=t||!1}
- /**
- * If is directed graph
- */return t.prototype.isDirected=function(){return this._directed},
- /**
- * Add a new node
- */
- t.prototype.addNode=function(t,e){t=null==t?""+e:""+t;var n=this._nodesMap;if(!n[ES(t)]){var i=new zS(t,e);return i.hostGraph=this,this.nodes.push(i),n[ES(t)]=i,i}},
- /**
- * Get node by data index
- */
- t.prototype.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},
- /**
- * Get node by id
- */
- t.prototype.getNodeById=function(t){return this._nodesMap[ES(t)]},
- /**
- * Add a new edge
- */
- t.prototype.addEdge=function(t,e,n){var i=this._nodesMap,o=this._edgesMap;if(
- // PENDING
- l(t)&&(t=this.nodes[t]),l(e)&&(e=this.nodes[e]),t instanceof zS||(t=i[ES(t)]),e instanceof zS||(e=i[ES(e)]),t&&e){var r=t.id+"-"+e.id,a=new BS(t,e,n);return a.hostGraph=this,this._directed&&(t.outEdges.push(a),e.inEdges.push(a)),t.edges.push(a),t!==e&&e.edges.push(a),this.edges.push(a),o[r]=a,a}},
- /**
- * Get edge by data index
- */
- t.prototype.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},
- /**
- * Get edge by two linked nodes
- */
- t.prototype.getEdge=function(t,e){t instanceof zS&&(t=t.id),e instanceof zS&&(e=e.id);var n=this._edgesMap;return this._directed?n[t+"-"+e]:n[t+"-"+e]||n[e+"-"+t]},
- /**
- * Iterate all nodes
- */
- t.prototype.eachNode=function(t,e){for(var n=this.nodes,i=n.length,o=0;o<i;o++)n[o].dataIndex>=0&&t.call(e,n[o],o)},
- /**
- * Iterate all edges
- */
- t.prototype.eachEdge=function(t,e){for(var n=this.edges,i=n.length,o=0;o<i;o++)n[o].dataIndex>=0&&n[o].node1.dataIndex>=0&&n[o].node2.dataIndex>=0&&t.call(e,n[o],o)},
- /**
- * Breadth first traverse
- * Return true to stop traversing
- */
- t.prototype.breadthFirstTraverse=function(t,e,n,i){if(e instanceof zS||(e=this._nodesMap[ES(e)]),e){for(var o="out"===n?"outEdges":"in"===n?"inEdges":"edges",r=0;r<this.nodes.length;r++)this.nodes[r].__visited=!1;if(!t.call(i,e,null))for(var a=[e];a.length;){var s=a.shift(),l=s[o];for(r=0;r<l.length;r++){var u=l[r],c=u.node1===s?u.node2:u.node1;if(!c.__visited){if(t.call(i,c,s))
- // Stop traversing
- return;a.push(c),c.__visited=!0}}}}},
- // TODO
- // depthFirstTraverse(
- // cb, startNode, direction, context
- // ) {
- // };
- // Filter update
- t.prototype.update=function(){for(var t=this.data,e=this.edgeData,n=this.nodes,i=this.edges,o=0,r=n.length;o<r;o++)n[o].dataIndex=-1;for(o=0,r=t.count();o<r;o++)n[t.getRawIndex(o)].dataIndex=o;e.filterSelf((function(t){var n=i[e.getRawIndex(t)];return n.node1.dataIndex>=0&&n.node2.dataIndex>=0}));
- // Update edge
- for(o=0,r=i.length;o<r;o++)i[o].dataIndex=-1;for(o=0,r=e.count();o<r;o++)i[e.getRawIndex(o)].dataIndex=o},
- /**
- * @return {module:echarts/data/Graph}
- */
- t.prototype.clone=function(){for(var e=new t(this._directed),n=this.nodes,i=this.edges,o=0;o<n.length;o++)e.addNode(n[o].id,n[o].dataIndex);for(o=0;o<i.length;o++){var r=i[o];e.addEdge(r.node1.id,r.node2.id,r.dataIndex)}return e},t}(),zS=/** @class */function(){function t(t,e){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=null==t?"":t,this.dataIndex=null==e?-1:e}
- /**
- * @return {number}
- */return t.prototype.degree=function(){return this.edges.length},
- /**
- * @return {number}
- */
- t.prototype.inDegree=function(){return this.inEdges.length},
- /**
- * @return {number}
- */
- t.prototype.outDegree=function(){return this.outEdges.length},t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){for(var t={edge:[],node:[]},e=0;e<this.edges.length;e++){var n=this.edges[e];n.dataIndex<0||(t.edge.push(n.dataIndex),t.node.push(n.node1.dataIndex,n.node2.dataIndex))}return t},t.prototype.getTrajectoryDataIndices=function(){for(var t=r(),e=r(),n=0;n<this.edges.length;n++){var i=this.edges[n];if(!(i.dataIndex<0)){t.set(i.dataIndex,!0);for(var o=[i.node1],a=[i.node2],s=0;s<o.length;){var l=o[s];s++,e.set(l.dataIndex,!0);for(var u=0;u<l.inEdges.length;u++)t.set(l.inEdges[u].dataIndex,!0),o.push(l.inEdges[u].node1)}for(s=0;s<a.length;){var c=a[s];s++,e.set(c.dataIndex,!0);for(u=0;u<c.outEdges.length;u++)t.set(c.outEdges[u].dataIndex,!0),a.push(c.outEdges[u].node2)}}}return{edge:t.keys(),node:e.keys()}},t}(),BS=/** @class */function(){function t(t,e,n){this.dataIndex=-1,this.node1=t,this.node2=e,this.dataIndex=null==n?-1:n}
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- return t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},t.prototype.getTrajectoryDataIndices=function(){var t=r(),e=r();t.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],o=0;o<n.length;){var a=n[o];o++,e.set(a.dataIndex,!0);for(var s=0;s<a.inEdges.length;s++)t.set(a.inEdges[s].dataIndex,!0),n.push(a.inEdges[s].node1)}for(o=0;o<i.length;){var l=i[o];o++,e.set(l.dataIndex,!0);for(s=0;s<l.outEdges.length;s++)t.set(l.outEdges[s].dataIndex,!0),i.push(l.outEdges[s].node2)}return{edge:t.keys(),node:e.keys()}},t}();function GS(t,e){return{
- /**
- * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'.
- */
- getValue:function(n){var i=this[t][e];return i.getStore().get(i.getDimensionIndex(n||"value"),this.dataIndex)},
- // TODO: TYPE stricter type.
- setVisual:function(n,i){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,i)},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)}}}nt(zS,GS("hostGraph","data")),nt(BS,GS("hostGraph","edgeData"));const FS=VS;function WS(t,e,n,i,o){for(
- // ??? TODO
- // support dataset?
- var r=new FS(i),a=0;a<t.length;a++)r.addNode(Yt(
- // Id, name, dataIndex
- t[a].id,t[a].name,a),a);var s=[],l=[],u=0;for(a=0;a<e.length;a++){var d=e[a],h=d.source,p=d.target;
- // addEdge may fail when source or target not exists
- r.addEdge(h,p,u)&&(l.push(d),s.push(Yt(Ln(d.id,null),h+" > "+p)),u++)}var f,g=n.get("coordinateSystem");if("cartesian2d"===g||"polar"===g)f=Jh(t,n);else{var y=fs.get(g),m=y&&y.dimensions||[];
- // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs
- // `value` dimension, but graph need `value` dimension. It's better to
- // uniform this behavior.
- c(m,"value")<0&&m.concat(["value"]);var v=Hh(t,{coordDimensions:m,encodeDefine:n.getEncode()}).dimensions;(f=new Fh(v,n)).initData(t)}var x=new Fh(["value"],n);return x.initData(l,s),o&&o(f,x),v_({mainData:f,struct:r,structAttr:"graph",datas:{node:f,edge:x},datasAttr:{node:"data",edge:"edgeData"}}),
- // Update dataIndex of nodes and edges because invalid edge may be removed
- r.update(),r}var HS=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return Ue(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}
- // Provide data for legend select
- this.legendVisualProvider=new dm(i,i),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),wn(e,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,e){var n,i=t.edges||t.links||[],o=t.data||t.nodes||[],r=this;if(o&&i){Hb(
- // auto curveness
- n=this)&&(n.__curvenessList=[],n.__edgeMap={},
- // calc the array of curveness List
- Yb(n));var s=WS(o,i,this,!0,(function(t,e){
- // Overwrite nodeData.getItemModel to
- t.wrapMethod("getItemModel",(function(t){var e=r._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t}));
- // TODO Inherit resolveParentPath by default in Model#getModel?
- var n=yr.prototype.getModel;function i(t,e){var i=n.call(this,t,e);return i.resolveParentPath=o,i}function o(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}e.wrapMethod("getItemModel",(function(t){return t.resolveParentPath=o,t.getModel=i,t}))}));return a(s.edges,(function(t){!
- /**
- * set edgeMap with key
- * @param {number|string|module:echarts/data/Graph.Node} n1
- * @param {number|string|module:echarts/data/Graph.Node} n2
- * @param {module:echarts/model/SeriesModel} seriesModel
- * @param {number} index
- */
- function(t,e,n,i){if(Hb(n)){var o=Ub(t,e,n),r=n.__edgeMap,a=r[Zb(o)];
- // set direction
- r[o]&&!a?r[o].isForward=!0:a&&r[o]&&(a.isForward=!0,r[o].isForward=!1),r[o]=r[o]||[],r[o].push(i)}}(t.node1,t.node2,this,t.dataIndex)}),this),s.data}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,e,n){if("edge"===n){var i=this.getData(),o=this.getDataParams(t,n),r=i.graph.getEdgeByIndex(t),a=i.getName(r.node1.dataIndex),s=i.getName(r.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),$l("nameValue",{name:l.join(" > "),value:o.value,noValue:null==o.value})}
- // dataType === 'node' or empty
- return cu({series:this,dataIndex:t,multipleSeries:e})},e.prototype._updateCategoriesData=function(){var t=n(this.option.categories||[],(function(t){
- // Data must has value
- return null!=t.value?t:p({value:0},t)})),e=new Fh(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray((function(t){return e.getItemModel(t)}))},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={
- // zlevel: 0,
- z:2,coordinateSystem:"view",
- // Default option for all coordinate systems
- // xAxisIndex: 0,
- // yAxisIndex: 0,
- // polarIndex: 0,
- // geoIndex: 0,
- legendHoverLink:!0,layout:null,
- // Configuration of circular layout
- circular:{rotateLabel:!1},
- // Configuration of force directed layout
- force:{initLayout:null,
- // Node repulsion. Can be an array to represent range.
- repulsion:[0,50],gravity:.1,
- // Initial friction
- friction:.6,
- // Edge length. Can be an array to represent range.
- edgeLength:30,layoutAnimation:!0},left:"center",top:"center",
- // right: null,
- // bottom: null,
- // width: '80%',
- // height: '80%',
- symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,
- // Default on center of graph
- center:null,zoom:1,
- // Symbol size scale ratio in roam
- nodeScaleRatio:.6,
- // cursor: null,
- // categories: [],
- // data: []
- // Or
- // nodes: []
- // links: []
- // Or
- // edges: []
- label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(Su);const YS=HS;var US={type:"graphRoam",event:"graphRoam",update:"none"};var ZS=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0};const XS=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="pointer",n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new ZS},e.prototype.buildPath=function(t,e){var n=Math.cos,i=Math.sin,o=e.r,r=e.width,a=e.angle,s=e.x-n(a)*r*(r>=o/3?1:2),l=e.y-i(a)*r*(r>=o/3?1:2);a=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+n(a)*r,e.y+i(a)*r),t.lineTo(e.x+n(e.angle)*o,e.y+i(e.angle)*o),t.lineTo(e.x-n(a)*r,e.y-i(a)*r),t.lineTo(s,l)},e}(g);function jS(e,n){var i=null==e?"":e+"";return n&&(t(n)?i=n.replace("{value}",i):f(n)&&(i=n(e))),i}var qS=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){this.group.removeAll();var i=t.get(["axisLine","lineStyle","color"]),o=function(t,e){var n=t.get("center"),i=e.getWidth(),o=e.getHeight(),r=Math.min(i,o);return{cx:je(n[0],e.getWidth()),cy:je(n[1],e.getHeight()),r:je(t.get("radius"),r/2)}}(t,n);this._renderMain(t,e,n,i,o),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,e,n,i,o){var r=this.group,s=t.get("clockwise"),l=-t.get("startAngle")/180*Math.PI,u=-t.get("endAngle")/180*Math.PI,c=t.getModel("axisLine"),d=c.get("roundCap")?Dy:E,h=c.get("show"),p=c.getModel("lineStyle"),f=p.get("width"),g=[l,u];Wt(g,!s);for(var y=(u=g[1])-(l=g[0]),m=l,v=[],x=0;h&&x<i.length;x++){
- // Clamp
- var _=new d({shape:{startAngle:m,endAngle:u=l+y*Math.min(Math.max(i[x][0],0),1),cx:o.cx,cy:o.cy,clockwise:s,r0:o.r-f,r:o.r},silent:!0});_.setStyle({fill:i[x][1]}),_.setStyle(p.getLineStyle(
- // Because we use sector to simulate arc
- // so the properties for stroking are useless
- ["color","width"])),v.push(_),m=u}v.reverse(),a(v,(function(t){return r.add(t)}));var b=function(t){
- // Less than 0
- if(t<=0)return i[0][1];var e;for(e=0;e<i.length;e++)if(i[e][0]>=t&&(0===e?0:i[e-1][0])<t)return i[e][1];
- // More than 1
- return i[e-1][1]};this._renderTicks(t,e,n,b,o,l,u,s,f),this._renderTitleAndDetail(t,e,n,b,o),this._renderAnchor(t,o),this._renderPointer(t,e,n,b,o,l,u,s,f)},e.prototype._renderTicks=function(t,e,n,i,o,r,a,s,u){for(var c,d,h=this.group,p=o.cx,f=o.cy,g=o.r,y=+t.get("min"),m=+t.get("max"),v=t.getModel("splitLine"),x=t.getModel("axisTick"),_=t.getModel("axisLabel"),b=t.get("splitNumber"),S=x.get("splitNumber"),w=je(v.get("length"),g),M=je(x.get("length"),g),I=r,D=(a-r)/b,T=D/S,C=v.getModel("lineStyle").getLineStyle(),A=x.getModel("lineStyle").getLineStyle(),L=v.get("distance"),k=0;k<=b;k++){
- // Split line
- if(c=Math.cos(I),d=Math.sin(I),v.get("show")){var P=new F({shape:{x1:c*(g-(N=L?L+u:u))+p,y1:d*(g-N)+f,x2:c*(g-w-N)+p,y2:d*(g-w-N)+f},style:C,silent:!0});"auto"===C.stroke&&P.setStyle({stroke:i(k/b)}),h.add(P)}
- // Label
- if(_.get("show")){var N=_.get("distance")+L,O=jS(qe(k/b*(m-y)+y),_.get("formatter")),R=i(k/b),E=c*(g-w-N)+p,V=d*(g-w-N)+f,z=_.get("rotate"),B=0;"radial"===z?(B=-I+2*Math.PI)>Math.PI/2&&(B+=Math.PI):"tangential"===z?B=-I-Math.PI/2:l(z)&&(B=z*Math.PI/180),0===B?h.add(new $({style:Zo(_,{text:O,x:E,y:V,verticalAlign:d<-.8?"top":d>.8?"bottom":"middle",align:c<-.4?"left":c>.4?"right":"center"},{inheritColor:R}),silent:!0})):h.add(new $({style:Zo(_,{text:O,x:E,y:V,verticalAlign:"middle",align:"center"},{inheritColor:R}),silent:!0,originX:E,originY:V,rotation:B}))}
- // Axis tick
- if(x.get("show")&&k!==b){N=(N=x.get("distance"))?N+u:u;for(var G=0;G<=S;G++){c=Math.cos(I),d=Math.sin(I);var W=new F({shape:{x1:c*(g-N)+p,y1:d*(g-N)+f,x2:c*(g-M-N)+p,y2:d*(g-M-N)+f},silent:!0,style:A});"auto"===A.stroke&&W.setStyle({stroke:i((k+G/S)/b)}),h.add(W),I+=T}I-=T}else I+=D}},e.prototype._renderPointer=function(t,e,n,i,o,r,a,s,l){var u=this.group,c=this._data,d=this._progressEls,h=[],f=t.get(["pointer","show"]),g=t.getModel("progress"),y=g.get("show"),m=t.getData(),v=m.mapDimension("value"),x=+t.get("min"),_=+t.get("max"),S=[x,_],w=[r,a];function M(e,n){var i,r=m.getItemModel(e).getModel("pointer"),a=je(r.get("width"),o.r),s=je(r.get("length"),o.r),l=t.get(["pointer","icon"]),u=r.get("offsetCenter"),c=je(u[0],o.r),d=je(u[1],o.r),h=r.get("keepAspect");
- // not exist icon type will be set 'rect'
- return(i=l?Gc(l,c-a/2,d-s,a,s,null,h):new XS({shape:{angle:-Math.PI/2,width:a,r:s,x:c,y:d}})).rotation=-(n+Math.PI/2),i.x=o.cx,i.y=o.cy,i}function I(t,e){var n=g.get("roundCap")?Dy:E,i=g.get("overlap"),a=i?g.get("width"):l/m.count(),u=i?o.r-a:o.r-(t+1)*a,c=i?o.r:o.r-t*a,d=new n({shape:{startAngle:r,endAngle:e,cx:o.cx,cy:o.cy,clockwise:s,r0:u,r:c}});return i&&(d.z2=Xe(m.get(v,t),[x,_],[100,0],!0)),d}(y||f)&&(m.diff(c).add((function(e){var n=m.get(v,e);if(f){var i=M(e,r);
- // TODO hide pointer on NaN value?
- oo(i,{rotation:-((isNaN(+n)?w[0]:Xe(n,S,w,!0))+Math.PI/2)},t),u.add(i),m.setItemGraphicEl(e,i)}if(y){var o=I(e,r),a=g.get("clip");oo(o,{shape:{endAngle:Xe(n,S,w,a)}},t),u.add(o),
- // Add data index and series index for indexing the data by element
- // Useful in tooltip
- ii(t.seriesIndex,m.dataType,e,o),h[e]=o}})).update((function(e,n){var i=m.get(v,e);if(f){var o=c.getItemGraphicEl(n),a=o?o.rotation:r,s=M(e,a);s.rotation=a,io(s,{rotation:-((isNaN(+i)?w[0]:Xe(i,S,w,!0))+Math.PI/2)},t),u.add(s),m.setItemGraphicEl(e,s)}if(y){var l=d[n],p=I(e,l?l.shape.endAngle:r),x=g.get("clip");io(p,{shape:{endAngle:Xe(i,S,w,x)}},t),u.add(p),
- // Add data index and series index for indexing the data by element
- // Useful in tooltip
- ii(t.seriesIndex,m.dataType,e,p),h[e]=p}})).execute(),m.each((function(t){var e=m.getItemModel(t),n=e.getModel("emphasis"),o=n.get("focus"),r=n.get("blurScope"),a=n.get("disabled");if(f){var s=m.getItemGraphicEl(t),l=m.getItemVisual(t,"style"),u=l.fill;if(s instanceof b){var c=s.style;s.useStyle(p({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},l))}else s.useStyle(l),"pointer"!==s.type&&s.setColor(u);s.setStyle(e.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===s.style.fill&&s.setStyle("fill",i(Xe(m.get(v,t),S,[0,1],!0))),s.z2EmphasisLift=0,qi(s,e),Ui(s,o,r,a)}if(y){var d=h[t];d.useStyle(m.getItemVisual(t,"style")),d.setStyle(e.getModel(["progress","itemStyle"]).getItemStyle()),d.z2EmphasisLift=0,qi(d,e),Ui(d,o,r,a)}})),this._progressEls=h)},e.prototype._renderAnchor=function(t,e){var n=t.getModel("anchor");if(n.get("show")){var i=n.get("size"),o=n.get("icon"),r=n.get("offsetCenter"),a=n.get("keepAspect"),s=Gc(o,e.cx-i/2+je(r[0],e.r),e.cy-i/2+je(r[1],e.r),i,i,null,a);s.z2=n.get("showAbove")?1:0,s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},e.prototype._renderTitleAndDetail=function(t,e,n,i,o){var r=this,a=t.getData(),s=a.mapDimension("value"),l=+t.get("min"),u=+t.get("max"),c=new Z,d=[],h=[],p=t.isAnimationEnabled(),f=t.get(["pointer","showAbove"]);a.diff(this._data).add((function(t){d[t]=new $({silent:!0}),h[t]=new $({silent:!0})})).update((function(t,e){d[t]=r._titleEls[e],h[t]=r._detailEls[e]})).execute(),a.each((function(e){var n=a.getItemModel(e),r=a.get(s,e),g=new Z,y=i(Xe(r,[l,u],[0,1],!0)),m=n.getModel("title");if(m.get("show")){var v=m.get("offsetCenter"),x=o.cx+je(v[0],o.r),_=o.cy+je(v[1],o.r);(C=d[e]).attr({z2:f?0:2,style:Zo(m,{x:x,y:_,text:a.getName(e),align:"center",verticalAlign:"middle"},{inheritColor:y})}),g.add(C)}var b=n.getModel("detail");if(b.get("show")){var S=b.get("offsetCenter"),w=o.cx+je(S[0],o.r),M=o.cy+je(S[1],o.r),I=je(b.get("width"),o.r),D=je(b.get("height"),o.r),T=t.get(["progress","show"])?a.getItemVisual(e,"style").fill:y,C=h[e],A=b.get("formatter");C.attr({z2:f?0:2,style:Zo(b,{x:w,y:M,text:jS(r,A),width:isNaN(I)?null:I,height:isNaN(D)?null:D,align:"center",verticalAlign:"middle"},{inheritColor:T})}),tr(C,{normal:b},r,(function(t){return jS(t,A)})),p&&er(C,e,a,t,{getFormattedLabel:function(t,e,n,i,o,a){return jS(a?a.interpolatedValue:r,A)}}),g.add(C)}c.add(g)})),this.group.add(c),this._titleEls=d,this._detailEls=h},e.type="gauge",e}(Ou);const KS=qS;const JS=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="itemStyle",n}return Ue(e,t),e.prototype.getInitialData=function(t,e){return um(this,["value"])},e.type="series.gauge",e.defaultOption={
- // zlevel: 0,
- z:2,colorBy:"data",
- // 默认全局居中
- center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,
- // 最小值
- min:0,
- // 最大值
- max:100,
- // 分割段数,默认为10
- splitNumber:10,
- // 坐标轴线
- axisLine:{
- // 默认显示,属性show控制显示与否
- show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},
- // 坐标轴线
- progress:{
- // 默认显示,属性show控制显示与否
- show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},
- // 分隔线
- splitLine:{
- // 默认显示,属性show控制显示与否
- show:!0,
- // 属性length控制线长
- length:10,distance:10,
- // 属性lineStyle(详见lineStyle)控制线条样式
- lineStyle:{color:"#63677A",width:3,type:"solid"}},
- // 坐标轴小标记
- axisTick:{
- // 属性show控制显示与否,默认不显示
- show:!0,
- // 每份split细分多少段
- splitNumber:5,
- // 属性length控制线长
- length:6,distance:10,
- // 属性lineStyle控制线条样式
- lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,
- // formatter: null,
- color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,
- // x, y,单位px
- offsetCenter:[0,"20%"],
- // 其余属性默认使用全局文本样式,详见TEXTSTYLE
- color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],
- // x, y,单位px
- offsetCenter:[0,"40%"],
- // formatter: null,
- // 其余属性默认使用全局文本样式,详见TEXTSTYLE
- color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(Su);var $S=["itemStyle","opacity"],QS=/** @class */function(t){function e(e,n){var i=t.call(this)||this,o=i,r=new B,a=new $;return o.setTextContent(a),i.setTextGuideLine(r),i.updateData(e,n,!0),i}return Ue(e,t),e.prototype.updateData=function(t,e,n){var i=this,o=t.hostModel,r=t.getItemModel(e),a=t.getItemLayout(e),s=r.getModel("emphasis"),l=r.get($S);l=null==l?1:l,n||uo(i),
- // Update common style
- i.useStyle(t.getItemVisual(e,"style")),i.style.lineJoin="round",n?(i.setShape({points:a.points}),i.style.opacity=0,oo(i,{style:{opacity:l}},o,e)):io(i,{style:{opacity:l},shape:{points:a.points}},o,e),qi(i,r),this._updateLabel(t,e),Ui(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},e.prototype._updateLabel=function(t,e){var n=this,i=this.getTextGuideLine(),o=n.getTextContent(),r=t.hostModel,a=t.getItemModel(e),s=t.getItemLayout(e).label,l=t.getItemVisual(e,"style"),u=l.fill;Yo(
- // position will not be used in setLabelStyle
- o,Uo(a),{labelFetcher:t.hostModel,labelDataIndex:e,defaultOpacity:l.opacity,defaultText:t.getName(e)},{normal:{align:s.textAlign,verticalAlign:s.verticalAlign}}),n.setTextConfig({local:!0,inside:!!s.inside,insideStroke:u,
- // insideFill: 'auto',
- outsideFill:u});var c=s.linePoints;i.setShape({points:c}),n.textGuideLineConfig={anchor:c?new K(c[0][0],c[0][1]):null},
- // Make sure update style on labelText after setLabelStyle.
- // Because setLabelStyle will replace a new style on it.
- io(o,{style:{x:s.x,y:s.y}},r,e),o.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),gg(n,yg(a),{
- // Default use item visual color
- stroke:u})},e}(z);
- /**
- * Piece of pie including Sector, Label, LabelLine
- */const tw=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.ignoreLabelLineUpdate=!0,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),o=this._data,r=this.group;i.diff(o).add((function(t){var e=new QS(i,t);i.setItemGraphicEl(t,e),r.add(e)})).update((function(t,e){var n=o.getItemGraphicEl(e);n.updateData(i,t),r.add(n),i.setItemGraphicEl(t,n)})).remove((function(e){lo(o.getItemGraphicEl(e),t,e)})).execute(),this._data=i},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(Ou);var ew=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),
- // Enable legend selection for each data item
- // Use a function instead of direct access because data reference may changed
- this.legendVisualProvider=new dm(lt(this.getData,this),lt(this.getRawData,this)),
- // Extend labelLine emphasis
- this._defaultLabelLine(e)},e.prototype.getInitialData=function(t,e){return um(this,{coordDimensions:["value"],encodeDefaulter:rt(Ua,this)})},e.prototype._defaultLabelLine=function(t){
- // Extend labelLine emphasis
- wn(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;
- // Not show label line if `label.normal.show = false`
- e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},
- // Overwrite
- e.prototype.getDataParams=function(e){var n=this.getData(),i=t.prototype.getDataParams.call(this,e),o=n.mapDimension("value"),r=n.getSum(o);
- // Percent is 0 if sum is 0
- return i.percent=r?+(n.get(o,e)/r*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series.funnel",e.defaultOption={
- // zlevel: 0, // 一级层叠
- z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,
- // width: {totalWidth} - left - right,
- // height: {totalHeight} - top - bottom,
- // 默认取数据最小最大值
- // min: 0,
- // max: 100,
- minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{
- // color: 各异,
- width:1}},itemStyle:{
- // color: 各异,
- borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(Su);const nw=ew;function iw(t,e){t.eachSeriesByType("funnel",(function(t){var n=t.getData(),i=n.mapDimension("value"),o=t.get("sort"),r=function(t,e){return xa(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e),a=t.get("orient"),s=r.width,l=r.height,u=function(t,e){for(var n=t.mapDimension("value"),i=t.mapArray(n,(function(t){return t})),o=[],r="ascending"===e,a=0,s=t.count();a<s;a++)o[a]=a;
- // Add custom sortable function & none sortable opetion by "options.sort"
- return f(e)?o.sort(e):"none"!==e&&o.sort((function(t,e){return r?i[t]-i[e]:i[e]-i[t]})),o}(n,o),c=r.x,d=r.y,h="horizontal"===a?[je(t.get("minSize"),l),je(t.get("maxSize"),l)]:[je(t.get("minSize"),s),je(t.get("maxSize"),s)],p=n.getDataExtent(i),g=t.get("min"),y=t.get("max");null==g&&(g=Math.min(p[0],0)),null==y&&(y=p[1]);var m=t.get("funnelAlign"),v=t.get("gap"),x=(("horizontal"===a?s:l)-v*(n.count()-1))/n.count(),_=function(t,e){
- // End point index is data.count() and we assign it 0
- if("horizontal"===a){var o=Xe(n.get(i,t)||0,[g,y],h,!0),r=void 0;switch(m){case"top":r=d;break;case"center":r=d+(l-o)/2;break;case"bottom":r=d+(l-o)}return[[e,r],[e,r+o]]}var u,p=Xe(n.get(i,t)||0,[g,y],h,!0);switch(m){case"left":u=c;break;case"center":u=c+(s-p)/2;break;case"right":u=c+s-p}return[[u,e],[u+p,e]]};"ascending"===o&&(
- // From bottom to top
- x=-x,v=-v,"horizontal"===a?c+=s:d+=l,u=u.reverse());for(var b=0;b<u.length;b++){var S=u[b],w=u[b+1],M=n.getItemModel(S);if("horizontal"===a){var I=M.get(["itemStyle","width"]);null==I?I=x:(I=je(I,s),"ascending"===o&&(I=-I));var D=_(S,c),T=_(w,c+I);c+=I+v,n.setItemLayout(S,{points:D.concat(T.slice().reverse())})}else{var C=M.get(["itemStyle","height"]);null==C?C=x:(C=je(C,l),"ascending"===o&&(C=-C));D=_(S,d),T=_(w,d+C);d+=C+v,n.setItemLayout(S,{points:D.concat(T.slice().reverse())})}}!function(t){var e=t.hostModel.get("orient");t.each((function(n){var i,o,r,a,s=t.getItemModel(n),l=s.getModel("label").get("position"),u=s.getModel("labelLine"),c=t.getItemLayout(n),d=c.points,h="inner"===l||"inside"===l||"center"===l||"insideLeft"===l||"insideRight"===l;if(h)"insideLeft"===l?(o=(d[0][0]+d[3][0])/2+5,r=(d[0][1]+d[3][1])/2,i="left"):"insideRight"===l?(o=(d[1][0]+d[2][0])/2-5,r=(d[1][1]+d[2][1])/2,i="right"):(o=(d[0][0]+d[1][0]+d[2][0]+d[3][0])/4,r=(d[0][1]+d[1][1]+d[2][1]+d[3][1])/4,i="center"),a=[[o,r],[o,r]];else{var p=void 0,f=void 0,g=void 0,y=void 0,m=u.get("length");"left"===l?(
- // Left side
- p=(d[3][0]+d[0][0])/2,f=(d[3][1]+d[0][1])/2,o=(g=p-m)-5,i="right"):"right"===l?(
- // Right side
- p=(d[1][0]+d[2][0])/2,f=(d[1][1]+d[2][1])/2,o=(g=p+m)+5,i="left"):"top"===l?(
- // Top side
- p=(d[3][0]+d[0][0])/2,r=(y=(f=(d[3][1]+d[0][1])/2)-m)-5,i="center"):"bottom"===l?(
- // Bottom side
- p=(d[1][0]+d[2][0])/2,r=(y=(f=(d[1][1]+d[2][1])/2)+m)+5,i="center"):"rightTop"===l?(
- // RightTop side
- p="horizontal"===e?d[3][0]:d[1][0],f="horizontal"===e?d[3][1]:d[1][1],"horizontal"===e?(r=(y=f-m)-5,i="center"):(o=(g=p+m)+5,i="top")):"rightBottom"===l?(
- // RightBottom side
- p=d[2][0],f=d[2][1],"horizontal"===e?(r=(y=f+m)+5,i="center"):(o=(g=p+m)+5,i="bottom")):"leftTop"===l?(
- // LeftTop side
- p=d[0][0],f="horizontal"===e?d[0][1]:d[1][1],"horizontal"===e?(r=(y=f-m)-5,i="center"):(o=(g=p-m)-5,i="right")):"leftBottom"===l?(
- // LeftBottom side
- p="horizontal"===e?d[1][0]:d[3][0],f="horizontal"===e?d[1][1]:d[2][1],"horizontal"===e?(r=(y=f+m)+5,i="center"):(o=(g=p-m)-5,i="right")):(
- // Right side or Bottom side
- p=(d[1][0]+d[2][0])/2,f=(d[1][1]+d[2][1])/2,"horizontal"===e?(r=(y=f+m)+5,i="center"):(o=(g=p+m)+5,i="left")),"horizontal"===e?o=g=p:r=y=f,a=[[p,f],[g,y]]}c.label={linePoints:a,x:o,y:r,verticalAlign:"middle",textAlign:i,inside:h}}))}(n)}))}var ow=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._dataGroup=new Z,n._initialized=!1,n}return Ue(e,t),e.prototype.init=function(){this.group.add(this._dataGroup)},
- /**
- * @override
- */
- e.prototype.render=function(t,e,n,i){
- // Clear previously rendered progressive elements.
- this._progressiveEls=null;var o=this._dataGroup,r=t.getData(),a=this._data,s=t.coordinateSystem,l=s.dimensions,u=sw(t);
- // First create
- if(r.diff(a).add((function(t){lw(aw(r,o,t,l,s),r,t,u)})).update((function(e,n){var i=a.getItemGraphicEl(n),o=rw(r,e,l,s);r.setItemGraphicEl(e,i),io(i,{shape:{points:o}},t,e),uo(i),lw(i,r,e,u)})).remove((function(t){var e=a.getItemGraphicEl(t);o.remove(e)})).execute(),!this._initialized){this._initialized=!0;var c=function(t,e,n){var i=t.model,o=t.getRect(),r=new G({shape:{x:o.x,y:o.y,width:o.width,height:o.height}}),a="horizontal"===i.get("layout")?"width":"height";return r.setShape(a,0),oo(r,{shape:{width:o.width,height:o.height}},e,n),r}(s,t,(function(){
- // Callback will be invoked immediately if there is no animation
- setTimeout((function(){o.removeClipPath()}))}));o.setClipPath(c)}this._data=r},e.prototype.incrementalPrepareRender=function(t,e,n){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},e.prototype.incrementalRender=function(t,e,n){for(var i=e.getData(),o=e.coordinateSystem,r=o.dimensions,a=sw(e),s=this._progressiveEls=[],l=t.start;l<t.end;l++){var u=aw(i,this._dataGroup,l,r,o);u.incremental=!0,lw(u,i,l,a),s.push(u)}},e.prototype.remove=function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null},e.type="parallel",e}(Ou);function rw(t,e,n,i){for(var o,r=[],a=0;a<n.length;a++){var s=n[a],l=t.get(t.mapDimension(s),e);o=l,("category"===i.getAxis(s).type?null==o:null==o||isNaN(o))||r.push(i.dataToPoint(l,s))}return r}function aw(t,e,n,i,o){var r=rw(t,n,i,o),a=new B({shape:{points:r},
- // silent: true,
- z2:10});return e.add(a),t.setItemGraphicEl(n,a),a}function sw(t){var e=t.get("smooth",!0);return!0===e&&(e=.3),e=pn(e),It(e)&&(e=0),{smooth:e}}function lw(t,e,n,i){t.useStyle(e.getItemVisual(n,"style")),t.style.fill=null,t.setShape("smooth",i.smooth);var o=e.getItemModel(n),r=o.getModel("emphasis");qi(t,o,"lineStyle"),Ui(t,r.get("focus"),r.get("blurScope"),r.get("disabled"))}
- // function simpleDiff(oldData, newData, dimensions) {
- // let oldLen;
- // if (!oldData
- // || !oldData.__plProgressive
- // || (oldLen = oldData.count()) !== newData.count()
- // ) {
- // return true;
- // }
- // let dimLen = dimensions.length;
- // for (let i = 0; i < oldLen; i++) {
- // for (let j = 0; j < dimLen; j++) {
- // if (oldData.get(dimensions[j], i) !== newData.get(dimensions[j], i)) {
- // return true;
- // }
- // }
- // }
- // return false;
- // }
- // FIXME put in common util?
- const uw=ow;function cw(t){
- // The mapping of parallelAxis dimension to data dimension can
- // be specified in parallelAxis.option.dim. For example, if
- // parallelAxis.option.dim is 'dim3', it mapping to the third
- // dimension of data. But `data.encode` has higher priority.
- // Moreover, parallelModel.dimension should not be regarded as data
- // dimensions. Consider dimensions = ['dim4', 'dim2', 'dim6'];
- var e=t.ecModel.getComponent("parallel",t.get("parallelIndex"));if(e){var n={};return a(e.dimensions,(function(t){var e=+t.replace("dim","");n[t]=e})),n}}const dw=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return Ue(e,t),e.prototype.getInitialData=function(t,e){return Jh(null,this,{useEncodeDefaulter:lt(cw,null,this)})},
- /**
- * User can get data raw indices on 'axisAreaSelected' event received.
- *
- * @return Raw indices
- */
- e.prototype.getRawIndicesByActiveState=function(t){var e=this.coordinateSystem,n=this.getData(),i=[];return e.eachActiveState(n,(function(e,o){t===e&&i.push(n.getRawIndex(o))})),i},e.type="series.parallel",e.dependencies=["parallel"],e.defaultOption={
- // zlevel: 0,
- z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"},e}(Su);
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */var hw=["lineStyle","opacity"];const pw={seriesType:"parallel",reset:function(t,e){var n=t.coordinateSystem,i={normal:t.get(["lineStyle","opacity"]),active:t.get("activeOpacity"),inactive:t.get("inactiveOpacity")};return{progress:function(t,e){n.eachActiveState(e,(function(t,n){var o=i[t];if("normal"===t&&e.hasItemOption){var r=e.getItemModel(n).get(hw,!0);null!=r&&(o=r)}e.ensureUniqueItemVisual(n,"style").opacity=o}),t.start,t.end)}}}};function fw(t){!
- /**
- * Create a parallel coordinate if not exists.
- * @inner
- */
- function(t){if(t.parallel)return;var e=!1;a(t.series,(function(t){t&&"parallel"===t.type&&(e=!0)})),e&&(t.parallel=[{}])}
- /**
- * Merge aixs definition from parallel option (if exists) to axis option.
- * @inner
- */(t),function(t){var e=Sn(t.parallelAxis);a(e,(function(e){if(o(e)){var n=e.parallelIndex||0,i=Sn(t.parallel)[n];i&&i.parallelAxisDefault&&tt(e,i.parallelAxisDefault,!1)}}))}(t)}var gw=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){this._model=t,this._api=n,this._handlers||(this._handlers={},a(yw,(function(t,e){n.getZr().on(e,this._handlers[e]=lt(t,this))}),this)),Bu(this,"_throttledDispatchExpand",t.get("axisExpandRate"),"fixRate")},e.prototype.dispose=function(t,e){Gu(this,"_throttledDispatchExpand"),a(this._handlers,(function(t,n){e.getZr().off(n,t)})),this._handlers=null},
- /**
- * @internal
- * @param {Object} [opt] If null, cancel the last action triggering for debounce.
- */
- e.prototype._throttledDispatchExpand=function(t){this._dispatchExpand(t)},
- /**
- * @internal
- */
- e.prototype._dispatchExpand=function(t){t&&this._api.dispatchAction(p({type:"parallelAxisExpand"},t))},e.type="parallel",e}(Mu),yw={mousedown:function(t){mw(this,"click")&&(this._mouseDownPoint=[t.offsetX,t.offsetY])},mouseup:function(t){var e=this._mouseDownPoint;if(mw(this,"click")&&e){var n=[t.offsetX,t.offsetY];if(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2)>5)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==i.behavior&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){
- // Should do nothing when brushing.
- if(!this._mouseDownPoint&&mw(this,"mousemove")){var e=this._model,n=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),i=n.behavior;"jump"===i&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===i?null:{axisExpandWindow:n.axisExpandWindow,
- // Jumping uses animation, and sliding suppresses animation.
- animation:"jump"===i?null:{duration:0}})}}};// > 4
- function mw(t,e){var n=t._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===e}const vw=gw;const xw=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(){t.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var e=this.option;t&&tt(e,t,!0),this._initDimensions()},
- /**
- * Whether series or axis is in this coordinate system.
- */
- e.prototype.contains=function(t,e){var n=t.get("parallelIndex");return null!=n&&e.getComponent("parallel",n)===this},e.prototype.setAxisExpand=function(t){a(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(e){t.hasOwnProperty(e)&&(
- // @ts-ignore FIXME: why "never" inferred in this.option[name]?
- this.option[e]=t[e])}),this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],e=this.parallelAxisIndex=[],n=st(this.ecModel.queryComponents({mainType:"parallelAxis"}),(function(t){
- // Can not use this.contains here, because
- // initialization has not been completed yet.
- return(t.get("parallelIndex")||0)===this.componentIndex}),this);a(n,(function(n){t.push("dim"+n.get("dim")),e.push(n.componentIndex)}))},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={
- // zlevel: 0,
- z:0,left:80,top:60,right:80,bottom:60,
- // width: {totalWidth} - left - right,
- // height: {totalHeight} - top - bottom,
- layout:"horizontal",
- // FIXME
- // naming?
- axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,
- // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full.
- // Do not doc to user until necessary.
- axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(Ta);var _w=/** @class */function(t){function e(e,n,i,o,r){var a=t.call(this,e,n,i)||this;return a.type=o||"value",a.axisIndex=r,a}return Ue(e,t),e.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},e}(Yf);const bw=_w;
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * Calculate slider move result.
- * Usage:
- * (1) If both handle0 and handle1 are needed to be moved, set minSpan the same as
- * maxSpan and the same as `Math.abs(handleEnd[1] - handleEnds[0])`.
- * (2) If handle0 is forbidden to cross handle1, set minSpan as `0`.
- *
- * @param delta Move length.
- * @param handleEnds handleEnds[0] can be bigger then handleEnds[1].
- * handleEnds will be modified in this method.
- * @param extent handleEnds is restricted by extent.
- * extent[0] should less or equals than extent[1].
- * @param handleIndex Can be 'all', means that both move the two handleEnds.
- * @param minSpan The range of dataZoom can not be smaller than that.
- * If not set, handle0 and cross handle1. If set as a non-negative
- * number (including `0`), handles will push each other when reaching
- * the minSpan.
- * @param maxSpan The range of dataZoom can not be larger than that.
- * @return The input handleEnds.
- */function Sw(t,e,n,i,o,r){t=t||0;var a=n[1]-n[0];
- // Notice maxSpan and minSpan can be null/undefined.
- if(null!=o&&(o=Mw(o,[0,a])),null!=r&&(r=Math.max(r,null!=o?o:0)),"all"===i){var s=Math.abs(e[1]-e[0]);s=Mw(s,[0,a]),o=r=Mw(s,[o,r]),i=0}e[0]=Mw(e[0],n),e[1]=Mw(e[1],n);var l=ww(e,i);e[i]+=t;
- // Restrict in extent.
- var u,c=o||0,d=n.slice();return l.sign<0?d[0]+=c:d[1]-=c,e[i]=Mw(e[i],d),u=ww(e,i),null!=o&&(u.sign!==l.sign||u.span<o)&&(
- // If minSpan exists, 'cross' is forbidden.
- e[1-i]=e[i]+l.sign*o),
- // Shrink span.
- u=ww(e,i),null!=r&&u.span>r&&(e[1-i]=e[i]+u.sign*r),e}function ww(t,e){var n=t[e]-t[1-e];
- // If `handleEnds[0] === handleEnds[1]`, always believe that handleEnd[0]
- // is at left of handleEnds[1] for non-cross case.
- return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function Mw(t,e){return Math.min(null!=e[1]?e[1]:Infinity,Math.max(null!=e[0]?e[0]:-Infinity,t))}var Iw=a,Dw=Math.min,Tw=Math.max,Cw=Math.floor,Aw=Math.ceil,Lw=qe,kw=Math.PI,Pw=/** @class */function(){function t(t,e,n){this.type="parallel",
- /**
- * key: dimension
- */
- this._axesMap=r(),
- /**
- * key: dimension
- * value: {position: [], rotation, }
- */
- this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,e,n)}return t.prototype._init=function(t,e,n){var i=t.dimensions,o=t.parallelAxisIndex;Iw(i,(function(t,n){var i=o[n],r=e.getComponent("parallelAxis",i),a=this._axesMap.set(t,new bw(t,of(r),[0,0],r.get("type"),i)),s="category"===a.type;a.onBand=s&&r.get("boundaryGap"),a.inverse=r.get("inverse"),
- // Injection
- r.axis=a,a.model=r,a.coordinateSystem=r.coordinateSystem=this}),this)},
- /**
- * Update axis scale after data processed
- */
- t.prototype.update=function(t,e){this._updateAxesFromSeries(this._model,t)},t.prototype.containPoint=function(t){var e=this._makeLayoutInfo(),n=e.axisBase,i=e.layoutBase,o=e.pixelDimIndex,r=t[1-o],a=t[o];return r>=n&&r<=n+e.axisLength&&a>=i&&a<=i+e.layoutLength},t.prototype.getModel=function(){return this._model},
- /**
- * Update properties from series
- */
- t.prototype._updateAxesFromSeries=function(t,e){e.eachSeries((function(n){if(t.contains(n,e)){var i=n.getData();Iw(this.dimensions,(function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(i,i.mapDimension(t)),nf(e.scale,e.model)}),this)}}),this)},
- /**
- * Resize the parallel coordinate system.
- */
- t.prototype.resize=function(t,e){this._rect=xa(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},t.prototype.getRect=function(){return this._rect},t.prototype._makeLayoutInfo=function(){var t,e=this._model,n=this._rect,i=["x","y"],o=["width","height"],r=e.get("layout"),a="horizontal"===r?0:1,s=n[o[a]],l=[0,s],u=this.dimensions.length,c=Nw(e.get("axisExpandWidth"),l),d=Nw(e.get("axisExpandCount")||0,[0,u]),h=e.get("axisExpandable")&&u>3&&u>d&&d>1&&c>0&&s>0,p=e.get("axisExpandWindow");p?(t=Nw(p[1]-p[0],l),p[1]=p[0]+t):(t=Nw(c*(d-1),l),(p=[c*(e.get("axisExpandCenter")||Cw(u/2))-t/2])[1]=p[0]+t);var f=(s-t)/(u-d);
- // Avoid axisCollapseWidth is too small.
- f<3&&(f=0);
- // Find the first and last indices > ewin[0] and < ewin[1].
- var g=[Cw(Lw(p[0]/c,1))+1,Aw(Lw(p[1]/c,1))-1],y=f/c*p[0];
- // Pos in ec coordinates.
- return{layout:r,pixelDimIndex:a,layoutBase:n[i[a]],layoutLength:s,axisBase:n[i[1-a]],axisLength:n[o[1-a]],axisExpandable:h,axisExpandWidth:c,axisCollapseWidth:f,axisExpandWindow:p,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:y}},t.prototype._layoutAxes=function(){var t=this._rect,e=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),o=i.layout;e.each((function(t){var e=[0,i.axisLength],n=t.inverse?1:0;t.setExtent(e[n],e[1-n])})),Iw(n,(function(e,n){var r=(i.axisExpandable?Rw:Ow)(n,i),a={horizontal:{x:r.position,y:i.axisLength},vertical:{x:0,y:r.position}},s={horizontal:kw/2,vertical:0},l=[a[o].x+t.x,a[o].y+t.y],u=s[o],c=te();Ut(c,c,u),oe(c,c,l),
- // TODO
- // tick layout info
- // TODO
- // update dimensions info based on axis order.
- this._axesLayout[e]={position:l,rotation:u,transform:c,axisNameAvailableWidth:r.axisNameAvailableWidth,axisLabelShow:r.axisLabelShow,nameTruncateMaxWidth:r.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},
- /**
- * Get axis by dim.
- */
- t.prototype.getAxis=function(t){return this._axesMap.get(t)},
- /**
- * Convert a dim value of a single item of series data to Point.
- */
- t.prototype.dataToPoint=function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},
- /**
- * Travel data for one time, get activeState of each data item.
- * @param start the start dataIndex that travel from.
- * @param end the next dataIndex of the last dataIndex will be travel.
- */
- t.prototype.eachActiveState=function(t,e,n,i){null==n&&(n=0),null==i&&(i=t.count());var o=this._axesMap,r=this.dimensions,s=[],l=[];a(r,(function(e){s.push(t.mapDimension(e)),l.push(o.get(e).model)}));for(var u=this.hasAxisBrushed(),c=n;c<i;c++){var d=void 0;if(u){d="active";for(var h=t.getValues(s,c),p=0,f=r.length;p<f;p++){if("inactive"===l[p].getActiveState(h[p])){d="inactive";break}}}else d="normal";e(d,c)}},
- /**
- * Whether has any activeSet.
- */
- t.prototype.hasAxisBrushed=function(){for(var t=this.dimensions,e=this._axesMap,n=!1,i=0,o=t.length;i<o;i++)"normal"!==e.get(t[i]).model.getActiveState()&&(n=!0);return n},
- /**
- * Convert coords of each axis to Point.
- * Return point. For example: [10, 20]
- */
- t.prototype.axisCoordToPoint=function(t,e){return To([t,0],this._axesLayout[e].transform)},
- /**
- * Get axis layout.
- */
- t.prototype.getAxisLayout=function(t){return et(this._axesLayout[t])},
- /**
- * @return {Object} {axisExpandWindow, delta, behavior: 'jump' | 'slide' | 'none'}.
- */
- t.prototype.getSlidedAxisExpandWindow=function(t){var e=this._makeLayoutInfo(),n=e.pixelDimIndex,i=e.axisExpandWindow.slice(),o=i[1]-i[0],r=[0,e.axisExpandWidth*(e.axisCount-1)];
- // Out of the area of coordinate system.
- if(!this.containPoint(t))return{behavior:"none",axisExpandWindow:i};
- // Convert the point from global to expand coordinates.
- var a,s=t[n]-e.layoutBase-e.axisExpandWindow0Pos,l="slide",u=e.axisCollapseWidth,c=this._model.get("axisExpandSlideTriggerArea"),d=null!=c[0];
- // For dragging operation convenience, the window should not be
- // slided when mouse is the center area of the window.
- if(u)d&&u&&s<o*c[0]?(l="jump",a=s-o*c[2]):d&&u&&s>o*(1-c[0])?(l="jump",a=s-o*(1-c[2])):(a=s-o*c[1])>=0&&(a=s-o*(1-c[1]))<=0&&(a=0),(a*=e.axisExpandWidth/u)?Sw(a,i,r,"all"):l="none";else{var h=i[1]-i[0];(i=[Tw(0,r[1]*s/h-h/2)])[1]=Dw(r[1],i[0]+h),i[0]=i[1]-h}return{axisExpandWindow:i,behavior:l}},t}();function Nw(t,e){return Dw(Tw(t,e[0]),e[1])}function Ow(t,e){var n=e.layoutLength/(e.axisCount-1);return{position:n*t,axisNameAvailableWidth:n,axisLabelShow:!0}}function Rw(t,e){var n,i,o=e.layoutLength,r=e.axisExpandWidth,a=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,u=s,c=!1;return t<l[0]?(n=t*s,i=s):t<=l[1]?(n=e.axisExpandWindow0Pos+t*r-e.axisExpandWindow[0],u=r,c=!0):(n=o-(a-1-t)*s,i=s),{position:n,axisNameAvailableWidth:u,axisLabelShow:c,nameTruncateMaxWidth:i}}const Ew=Pw;const Vw={create:function(t,e){var n=[];return t.eachComponent("parallel",(function(i,o){var r=new Ew(i,t,e);r.name="parallel_"+o,r.resize(i,e),i.coordinateSystem=r,r.model=i,n.push(r)})),
- // Inject the coordinateSystems into seriesModel
- t.eachSeries((function(t){if("parallel"===t.get("coordinateSystem")){var e=t.getReferringComponents("parallel",zn).models[0];t.coordinateSystem=e.coordinateSystem}})),n}};var zw=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,
- /**
- * @readOnly
- */
- n.activeIntervals=[],n}return Ue(e,t),e.prototype.getAreaSelectStyle=function(){return Qn([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},
- /**
- * The code of this feature is put on AxisModel but not ParallelAxis,
- * because axisModel can be alive after echarts updating but instance of
- * ParallelAxis having been disposed. this._activeInterval should be kept
- * when action dispatched (i.e. legend click).
- *
- * @param intervals `interval.length === 0` means set all active.
- */
- e.prototype.setActiveIntervals=function(t){var e=this.activeIntervals=et(t);
- // Normalize
- if(e)for(var n=e.length-1;n>=0;n--)Ke(e[n])},
- /**
- * @param value When only attempting detect whether 'no activeIntervals set',
- * `value` is not needed to be input.
- */
- e.prototype.getActiveState=function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(+t))return"inactive";
- // Simple optimization
- if(1===e.length){var n=e[0];if(n[0]<=t&&t<=n[1])return"active"}else for(var i=0,o=e.length;i<o;i++)if(e[i][0]<=t&&t<=e[i][1])return"active";return"inactive"},e}(Ta);nt(zw,df);const Bw=zw;var Gw=!0,Fw=Math.min,Ww=Math.max,Hw=Math.pow,Yw="globalPan",Uw={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},Zw={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},Xw={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},jw=0,qw=/** @class */function(t){function e(e){var n=t.call(this)||this;
- /**
- * @internal
- */return n._track=[],
- /**
- * @internal
- */
- n._covers=[],n._handlers={},n._zr=e,n.group=new Z,n._uid="brushController_"+jw++,a(SM,(function(t,e){this._handlers[e]=lt(t,this)}),n),n}
- /**
- * If set to `false`, select disabled.
- */return Ue(e,t),e.prototype.enableBrush=function(t){return this._brushType&&this._doDisableBrush(),t.brushType&&this._doEnableBrush(t),this},e.prototype._doEnableBrush=function(t){var e=this._zr;
- // Consider roam, which takes globalPan too.
- this._enableGlobalPan||function(t,e,n){Fv(t)[e]=n}(e,Yw,this._uid),a(this._handlers,(function(t,n){e.on(n,t)})),this._brushType=t.brushType,this._brushOption=tt(et(Xw),t,!0)},e.prototype._doDisableBrush=function(){var t=this._zr;!function(t,e,n){var i=Fv(t);i[e]===n&&(i[e]=null)}(t,Yw,this._uid),a(this._handlers,(function(e,n){t.off(n,e)})),this._brushType=this._brushOption=null},
- /**
- * @param panelOpts If not pass, it is global brush.
- */
- e.prototype.setPanels=function(t){if(t&&t.length){var e=this._panels={};a(t,(function(t){e[t.panelId]=et(t)}))}else this._panels=null;return this},e.prototype.mount=function(t){t=t||{},this._enableGlobalPan=t.enableGlobalPan;var e=this.group;return this._zr.add(e),e.attr({x:t.x||0,y:t.y||0,rotation:t.rotation||0,scaleX:t.scaleX||1,scaleY:t.scaleY||1}),this._transform=e.getLocalTransform(),this},
- // eachCover(cb, context): void {
- // each(this._covers, cb, context);
- // }
- /**
- * Update covers.
- * @param coverConfigList
- * If coverConfigList is null/undefined, all covers removed.
- */
- e.prototype.updateCovers=function(t){t=n(t,(function(t){return tt(et(Xw),t,!0)}));var e=this._covers,i=this._covers=[],o=this,r=this._creatingCover;return new yh(e,t,(function(t,e){return a(t.__brushOption,e)}),a).add(s).update(s).remove((function(t){e[t]!==r&&o.group.remove(e[t])})).execute(),this;function a(t,e){return(null!=t.id?t.id:"\0-brush-index-"+e)+"-"+t.brushType}function s(n,a){var s=t[n];
- // Consider setOption in event listener of brushSelect,
- // where updating cover when creating should be forbidden.
- if(null!=a&&e[a]===r)i[n]=e[a];else{var l=i[n]=null!=a?(e[a].__brushOption=s,e[a]):Jw(o,Kw(o,s));tM(o,l)}}},e.prototype.unmount=function(){return this.enableBrush(!1),
- // container may 'removeAll' outside.
- oM(this),this._zr.remove(this.group),this},e.prototype.dispose=function(){this.unmount(),this.off()},e}(mt);function Kw(t,e){var n=MM[e.brushType].createCover(t,e);return n.__brushOption=e,Qw(n,e),t.group.add(n),n}function Jw(t,e){var n=eM(e);return n.endCreating&&(n.endCreating(t,e),Qw(e,e.__brushOption)),e}function $w(t,e){var n=e.__brushOption;eM(e).updateCoverShape(t,e,n.range,n)}function Qw(t,e){var n=e.z;null==n&&(n=1e4),t.traverse((function(t){t.z=n,t.z2=n}))}function tM(t,e){eM(e).updateCommon(t,e),$w(t,e)}function eM(t){return MM[t.__brushOption.brushType]}
- // return target panel or `true` (means global panel)
- function nM(t,e,n){var i,o=t._panels;if(!o)return Gw;// Global panel
- var r=t._transform;return a(o,(function(t){t.isTargetByCursor(e,n,r)&&(i=t)})),i}
- // Return a panel or true
- function iM(t,e){var n=t._panels;if(!n)return Gw;// Global panel
- var i=e.__brushOption.panelId;
- // User may give cover without coord sys info,
- // which is then treated as global panel.
- return null!=i?n[i]:Gw}function oM(t){var e=t._covers,n=e.length;return a(e,(function(e){t.group.remove(e)}),t),e.length=0,!!n}function rM(t,e){var i=n(t._covers,(function(t){var e=t.__brushOption,n=et(e.range);return{brushType:e.brushType,panelId:e.panelId,range:n}}));t.trigger("brush",{areas:i,isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function aM(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function sM(t,e,n,i){var o=new Z;return o.add(new G({name:"main",style:dM(n),silent:!0,draggable:!0,cursor:"move",drift:rt(fM,t,e,o,["n","s","w","e"]),ondragend:rt(rM,e,{isEnd:!0})})),a(i,(function(n){o.add(new G({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:rt(fM,t,e,o,n),ondragend:rt(rM,e,{isEnd:!0})}))})),o}function lM(t,e,n,i){var o=i.brushStyle.lineWidth||0,r=Ww(o,6),a=n[0][0],s=n[1][0],l=a-o/2,u=s-o/2,c=n[0][1],d=n[1][1],h=c-r+o/2,p=d-r+o/2,f=c-a,g=d-s,y=f+o,m=g+o;cM(t,e,"main",a,s,f,g),i.transformable&&(cM(t,e,"w",l,u,r,m),cM(t,e,"e",h,u,r,m),cM(t,e,"n",l,u,y,r),cM(t,e,"s",l,p,y,r),cM(t,e,"nw",l,u,r,r),cM(t,e,"ne",h,u,r,r),cM(t,e,"sw",l,p,r,r),cM(t,e,"se",h,p,r,r))}function uM(t,e){var n=e.__brushOption,i=n.transformable,o=e.childAt(0);o.useStyle(dM(n)),o.attr({silent:!i,cursor:i?"move":"default"}),a([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],(function(n){var o=e.childOfName(n.join("")),r=1===n.length?pM(t,n[0]):function(t,e){var n=[pM(t,e[0]),pM(t,e[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}(t,n);o&&o.attr({silent:!i,invisible:!i,cursor:i?Zw[r]+"-resize":null})}))}function cM(t,e,n,i,o,r,a){var s=e.childOfName(n);s&&s.setShape(function(t){var e=Fw(t[0][0],t[1][0]),n=Fw(t[0][1],t[1][1]),i=Ww(t[0][0],t[1][0]),o=Ww(t[0][1],t[1][1]);return{x:e,y:n,width:i-e,height:o-n}}(mM(t,e,[[i,o],[i+r,o+a]])))}function dM(t){return I({strokeNoScale:!0},t.brushStyle)}function hM(t,e,n,i){var o=[Fw(t,n),Fw(e,i)],r=[Ww(t,n),Ww(e,i)];return[[o[0],r[0]],[o[1],r[1]]]}function pM(t,e){var n=Co({w:"left",e:"right",n:"top",s:"bottom"}[e],function(t){return Do(t.group)}(t));return{left:"w",right:"e",top:"n",bottom:"s"}[n]}function fM(t,e,n,i,o,r){var s=n.__brushOption,l=t.toRectRange(s.range),u=yM(e,o,r);a(i,(function(t){var e=Uw[t];l[e[0]][e[1]]+=u[e[0]]})),s.range=t.fromRectRange(hM(l[0][0],l[1][0],l[0][1],l[1][1])),tM(e,n),rM(e,{isEnd:!1})}function gM(t,e,n,i){var o=e.__brushOption.range,r=yM(t,n,i);a(o,(function(t){t[0]+=r[0],t[1]+=r[1]})),tM(t,e),rM(t,{isEnd:!1})}function yM(t,e,n){var i=t.group,o=i.transformCoordToLocal(e,n),r=i.transformCoordToLocal(0,0);return[o[0]-r[0],o[1]-r[1]]}function mM(t,e,n){var i=iM(t,e);return i&&i!==Gw?i.clipPath(n,t._transform):et(n)}function vM(t){var e=t.event;e.preventDefault&&e.preventDefault()}function xM(t,e,n){return t.childOfName("main").contain(e,n)}function _M(t,e,n,i){var o,r=t._creatingCover,a=t._creatingPanel,s=t._brushOption;if(t._track.push(n.slice()),function(t){var e=t._track;if(!e.length)return!1;var n=e[e.length-1],i=e[0],o=n[0]-i[0],r=n[1]-i[1];return Hw(o*o+r*r,.5)>6}(t)||r){if(a&&!r){"single"===s.brushMode&&oM(t);var l=et(s);l.brushType=bM(l.brushType,a),l.panelId=a===Gw?null:a.panelId,r=t._creatingCover=Kw(t,l),t._covers.push(r)}if(r){var u=MM[bM(t._brushType,a)];r.__brushOption.range=u.getCreatingRange(mM(t,r,t._track)),i&&(Jw(t,r),u.updateCommon(t,r)),$w(t,r),o={isEnd:i}}}else i&&"single"===s.brushMode&&s.removeOnClick&&nM(t,e,n)&&oM(t)&&(o={isEnd:i,removeOnClick:!0});return o}function bM(t,e){return"auto"===t?e.defaultBrushType:t}var SM={mousedown:function(t){if(this._dragging)
- // In case some browser do not support globalOut,
- // and release mouse out side the browser.
- wM(this,t);else if(!t.target||!t.target.draggable){vM(t);var e=this.group.transformCoordToLocal(t.offsetX,t.offsetY);this._creatingCover=null,(this._creatingPanel=nM(this,t,e))&&(this._dragging=!0,this._track=[e.slice()])}},mousemove:function(t){var e=t.offsetX,n=t.offsetY,i=this.group.transformCoordToLocal(e,n);if(function(t,e,n){if(
- // Check active
- t._brushType&&!function(t,e,n){var i=t._zr;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}
- /**
- * key: brushType
- */(t,e.offsetX,e.offsetY)){var i=t._zr,o=t._covers,r=nM(t,e,n);
- // Check whether in covers.
- if(!t._dragging)for(var a=0;a<o.length;a++){var s=o[a].__brushOption;if(r&&(r===Gw||s.panelId===r.panelId)&&MM[s.brushType].contain(o[a],n[0],n[1]))
- // Use cursor style set on cover.
- return}r&&i.setCursorStyle("crosshair")}}(this,t,i),this._dragging){vM(t);var o=_M(this,t,i,!1);o&&rM(this,o)}},mouseup:function(t){wM(this,t)}};function wM(t,e){if(t._dragging){vM(e);var n=e.offsetX,i=e.offsetY,o=t.group.transformCoordToLocal(n,i),r=_M(t,e,o,!0);t._dragging=!1,t._track=[],t._creatingCover=null,
- // trigger event should be at final, after procedure will be nested.
- r&&rM(t,r)}}var MM={lineX:IM(0),lineY:IM(1),rect:{createCover:function(t,e){function n(t){return t}return sM({toRectRange:n,fromRectRange:n},t,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(t){var e=aM(t);return hM(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,n,i){lM(t,e,n,i)},updateCommon:uM,contain:xM},polygon:{createCover:function(t,e){var n=new Z;
- // Do not use graphic.Polygon because graphic.Polyline do not close the
- // border of the shape when drawing, which is a better experience for user.
- return n.add(new B({name:"main",style:dM(e),silent:!0})),n},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),
- // Use graphic.Polygon close the shape.
- e.add(new z({name:"main",draggable:!0,drift:rt(gM,t,e),ondragend:rt(rM,t,{isEnd:!0})}))},updateCoverShape:function(t,e,n,i){e.childAt(0).setShape({points:mM(t,e,n)})},updateCommon:uM,contain:xM}};function IM(t){return{createCover:function(e,n){return sM({toRectRange:function(e){var n=[e,[0,100]];return t&&n.reverse(),n},fromRectRange:function(e){return e[t]}},e,n,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var n=aM(e);return[Fw(n[0][t],n[1][t]),Ww(n[0][t],n[1][t])]},updateCoverShape:function(e,n,i,o){var r,a=iM(e,n);
- // If brushWidth not specified, fit the panel.
- if(a!==Gw&&a.getLinearBrushOtherExtent)r=a.getLinearBrushOtherExtent(t);else{var s=e._zr;r=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[i,r];t&&l.reverse(),lM(e,n,l,o)},updateCommon:uM,contain:xM}}const DM=qw;function TM(t){return t=LM(t),function(e){return ko(e,t)}}function CM(t,e){return t=LM(t),function(n){var i=null!=e?e:n,o=i?t.width:t.height,r=i?t.x:t.y;return[r,r+(o||0)]}}function AM(t,e,n){var i=LM(t);return function(t,o){return i.contain(o[0],o[1])&&!qv(t,e,n)}}
- // Consider width/height is negative.
- function LM(t){return Y.create(t)}var kM=["axisLine","axisTickLabel","axisName"];const PM=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(e,n){t.prototype.init.apply(this,arguments),(this._brushController=new DM(n.getZr())).on("brush",lt(this._onBrush,this))},e.prototype.render=function(t,e,n,i){if(!function(t,e,n){return n&&"axisAreaSelect"===n.type&&e.findComponents({mainType:"parallelAxis",query:n})[0]===t}(t,e,i)){this.axisModel=t,this.api=n,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Z,this.group.add(this._axisGroup),t.get("show")){var r=function(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}(t,e),s=r.coordinateSystem,l=t.getAreaSelectStyle(),u=l.width,c=t.axis.dim,d=s.getAxisLayout(c),h=p({strokeContainThreshold:u},d),f=new $m(t,h);a(kM,f.add,f),this._axisGroup.add(f.getGroup()),this._refreshBrushController(h,l,t,r,u,n),Lo(o,this._axisGroup,t)}}},
- // /**
- // * @override
- // */
- // updateVisual(axisModel, ecModel, api, payload) {
- // this._brushController && this._brushController
- // .updateCovers(getCoverInfoList(axisModel));
- // }
- e.prototype._refreshBrushController=function(t,e,i,o,r,a){
- // After filtering, axis may change, select area needs to be update.
- var s=i.axis.getExtent(),l=s[1]-s[0],u=Math.min(30,.1*Math.abs(l)),c=Y.create({x:s[0],y:-r/2,width:l,height:r});c.x-=u,c.width+=2*u,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:TM(c),isTargetByCursor:AM(c,a,o),getLinearBrushOtherExtent:CM(c,0)}]).enableBrush({brushType:"lineX",brushStyle:e,removeOnClick:!0}).updateCovers(function(t){var e=t.axis;return n(t.activeIntervals,(function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}}))}(i))},e.prototype._onBrush=function(t){var e=t.areas,i=this.axisModel,o=i.axis,r=n(e,(function(t){return[o.coordToData(t.range[0],!0),o.coordToData(t.range[1],!0)]}));
- // Do not cache these object, because the mey be changed.
- // If realtime is true, action is not dispatched on drag end, because
- // the drag end emits the same params with the last drag move event,
- // and may have some delay when using touch pad.
- (!i.option.realtime===t.isEnd||t.removeOnClick)&&
- // jshint ignore:line
- this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:r})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(Mu);
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */var NM={type:"axisAreaSelect",event:"axisAreaSelected"};var OM={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function RM(t){t.registerComponentView(vw),t.registerComponentModel(xw),t.registerCoordinateSystem("parallel",Vw),t.registerPreprocessor(fw),t.registerComponentModel(Bw),t.registerComponentView(PM),Tm(t,"parallel",Bw,OM),function(t){t.registerAction(NM,(function(t,e){e.eachComponent({mainType:"parallelAxis",query:t},(function(e){e.axis.model.setActiveIntervals(t.intervals)}))})),
- /**
- * @payload
- */
- t.registerAction("parallelAxisExpand",(function(t,e){e.eachComponent({mainType:"parallel",query:t},(function(e){e.setAxisExpand(t)}))}))}(t)}var EM=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0},VM=/** @class */function(t){function e(e){return t.call(this,e)||this}return Ue(e,t),e.prototype.getDefaultShape=function(){return new EM},e.prototype.buildPath=function(t,e){var n=e.extent;t.moveTo(e.x1,e.y1),t.bezierCurveTo(e.cpx1,e.cpy1,e.cpx2,e.cpy2,e.x2,e.y2),"vertical"===e.orient?(t.lineTo(e.x2+n,e.y2),t.bezierCurveTo(e.cpx2+n,e.cpy2,e.cpx1+n,e.cpy1,e.x1+n,e.y1)):(t.lineTo(e.x2,e.y2+n),t.bezierCurveTo(e.cpx2,e.cpy2+n,e.cpx1,e.cpy1+n,e.x1,e.y1+n)),t.closePath()},e.prototype.highlight=function(){ki(this)},e.prototype.downplay=function(){Pi(this)},e}(g),zM=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._focusAdjacencyDisabled=!1,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=this,o=t.getGraph(),r=this.group,a=t.layoutInfo,s=a.width,l=a.height,u=t.getData(),c=t.getData("edge"),d=t.get("orient");this._model=t,r.removeAll(),r.x=a.x,r.y=a.y,
- // generate a bezire Curve for each edge
- o.eachEdge((function(e){var n=new VM,i=ni(n);i.dataIndex=e.dataIndex,i.seriesIndex=t.seriesIndex,i.dataType="edge";var o,a,u,h,p,f,g,y,m=e.getModel(),v=m.getModel("lineStyle"),x=v.get("curveness"),_=e.node1.getLayout(),b=e.node1.getModel(),S=b.get("localX"),w=b.get("localY"),M=e.node2.getLayout(),I=e.node2.getModel(),D=I.get("localX"),T=I.get("localY"),C=e.getLayout();n.shape.extent=Math.max(1,C.dy),n.shape.orient=d,"vertical"===d?(o=(null!=S?S*s:_.x)+C.sy,a=(null!=w?w*l:_.y)+_.dy,u=(null!=D?D*s:M.x)+C.ty,p=o,f=a*(1-x)+(h=null!=T?T*l:M.y)*x,g=u,y=a*x+h*(1-x)):(o=(null!=S?S*s:_.x)+_.dx,a=(null!=w?w*l:_.y)+C.sy,p=o*(1-x)+(u=null!=D?D*s:M.x)*x,f=a,g=o*x+u*(1-x),y=h=(null!=T?T*l:M.y)+C.ty),n.setShape({x1:o,y1:a,x2:u,y2:h,cpx1:p,cpy1:f,cpx2:g,cpy2:y}),n.useStyle(v.getItemStyle()),
- // Special color, use source node color or target node color
- BM(n.style,d,e);var A=""+m.get("value"),L=Uo(m,"edgeLabel");Yo(n,L,{labelFetcher:{getFormattedLabel:function(e,n,i,o,r,a){return t.getFormattedLabel(e,n,"edge",o,
- // ensure edgeLabel formatter is provided
- // to prevent the inheritance from `label.formatter` of the series
- Ht(r,L.normal&&L.normal.get("formatter"),A),a)}},labelDataIndex:e.dataIndex,defaultText:A}),n.setTextConfig({position:"inside"});var k=m.getModel("emphasis");qi(n,m,"lineStyle",(function(t){var n=t.getItemStyle();return BM(n,d,e),n})),r.add(n),c.setItemGraphicEl(e.dataIndex,n);var P=k.get("focus");Ui(n,"adjacency"===P?e.getAdjacentDataIndices():"trajectory"===P?e.getTrajectoryDataIndices():P,k.get("blurScope"),k.get("disabled"))})),
- // Generate a rect for each node
- o.eachNode((function(e){var n=e.getLayout(),i=e.getModel(),o=i.get("localX"),a=i.get("localY"),c=i.getModel("emphasis"),d=i.get(["itemStyle","borderRadius"])||0,h=new G({shape:{x:null!=o?o*s:n.x,y:null!=a?a*l:n.y,width:n.dx,height:n.dy,r:d},style:i.getModel("itemStyle").getItemStyle(),z2:10});Yo(h,Uo(i),{labelFetcher:{getFormattedLabel:function(e,n){return t.getFormattedLabel(e,n,"node")}},labelDataIndex:e.dataIndex,defaultText:e.id}),h.disableLabelAnimation=!0,h.setStyle("fill",e.getVisual("color")),h.setStyle("decal",e.getVisual("style").decal),qi(h,i),r.add(h),u.setItemGraphicEl(e.dataIndex,h),ni(h).dataType="node";var p=c.get("focus");Ui(h,"adjacency"===p?e.getAdjacentDataIndices():"trajectory"===p?e.getTrajectoryDataIndices():p,c.get("blurScope"),c.get("disabled"))})),u.eachItemGraphicEl((function(e,o){u.getItemModel(o).get("draggable")&&(e.drift=function(e,r){i._focusAdjacencyDisabled=!0,this.shape.x+=e,this.shape.y+=r,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:u.getRawIndex(o),localX:this.shape.x/s,localY:this.shape.y/l})},e.ondragend=function(){i._focusAdjacencyDisabled=!1},e.draggable=!0,e.cursor="move")})),!this._data&&t.isAnimationEnabled()&&r.setClipPath(
- // Add animation to the view
- function(t,e,n){var i=new G({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return oo(i,{shape:{width:t.width+20}},e,n),i}(r.getBoundingRect(),t,(function(){r.removeClipPath()}))),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(Ou);
- /**
- * Special color, use source node color or target node color
- * @param curveProps curve's style to parse
- * @param orient direction
- * @param edge current curve data
- */
- function BM(e,n,i){switch(e.fill){case"source":e.fill=i.node1.getVisual("color"),e.decal=i.node1.getVisual("style").decal;break;case"target":e.fill=i.node2.getVisual("color"),e.decal=i.node2.getVisual("style").decal;break;case"gradient":var o=i.node1.getVisual("color"),r=i.node2.getVisual("color");t(o)&&t(r)&&(e.fill=new j(0,0,+("horizontal"===n),+("vertical"===n),[{color:o,offset:0},{color:r,offset:1}]))}}const GM=zM;var FM=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}
- /**
- * Init a graph data structure from data in option series
- */return Ue(e,t),e.prototype.getInitialData=function(t,e){var n=t.edges||t.links||[],i=t.data||t.nodes||[],o=t.levels||[];this.levelModels=[];for(var r=this.levelModels,a=0;a<o.length;a++)null!=o[a].depth&&o[a].depth>=0&&(r[o[a].depth]=new yr(o[a],this,e));var s=WS(i,n,this,!0,(function(t,e){t.wrapMethod("getItemModel",(function(t,e){var n=t.parentModel,i=n.getData().getItemLayout(e);if(i){var o=i.depth,r=n.levelModels[o];r&&(t.parentModel=r)}return t})),e.wrapMethod("getItemModel",(function(t,e){var n=t.parentModel,i=n.getGraph().getEdgeByIndex(e).node1.getLayout();if(i){var o=i.depth,r=n.levelModels[o];r&&(t.parentModel=r)}return t}))}));return s.data},e.prototype.setNodePosition=function(t,e){var n=(this.option.data||this.option.nodes)[t];n.localX=e[0],n.localY=e[1]},
- /**
- * Return the graphic data structure
- *
- * @return graphic data structure
- */
- e.prototype.getGraph=function(){return this.getData().graph},
- /**
- * Get edge data of graphic data structure
- *
- * @return data structure of list
- */
- e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,e,n){function i(t){return isNaN(t)||null==t}
- // dataType === 'node' or empty do not show tooltip by default
- if("edge"===n){var o=this.getDataParams(t,n),r=o.data,a=o.value;return $l("nameValue",{name:r.source+" -- "+r.target,value:a,noValue:i(a)})}
- // dataType === 'node'
- var s=this.getGraph().getNodeByIndex(t).getLayout().value,l=this.getDataParams(t,n).data.name;return $l("nameValue",{name:null!=l?l+"":null,value:s,noValue:i(s)})},e.prototype.optionUpdated=function(){},
- // Override Series.getDataParams()
- e.prototype.getDataParams=function(e,n){var i=t.prototype.getDataParams.call(this,e,n);if(null==i.value&&"node"===n){var o=this.getGraph().getNodeByIndex(e).getLayout().value;i.value=o}return i},e.type="series.sankey",e.defaultOption={
- // zlevel: 0,
- z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(Su);const WM=FM;function HM(t,e){t.eachSeriesByType("sankey",(function(t){var n=t.get("nodeWidth"),i=t.get("nodeGap"),o=
- /**
- * Get the layout position of the whole view
- */
- function(t,e){return xa(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e);t.layoutInfo=o;var r=o.width,s=o.height,l=t.getGraph(),u=l.nodes,c=l.edges;!
- /**
- * Compute the value of each node by summing the associated edge's value
- */
- function(t){a(t,(function(t){var e=QM(t.outEdges,$M),n=QM(t.inEdges,$M),i=t.getValue()||0,o=Math.max(e,n,i);t.setLayout({value:o},!0)}))}
- /**
- * Compute the x-position for each node.
- *
- * Here we use Kahn algorithm to detect cycle when we traverse
- * the node to computer the initial x position.
- */(u),function(t,e,n,i,o,r,s,l,u){(function(t,e,n,i,o,r,s){
- // let kx = 0;
- for(
- // Used to mark whether the edge is deleted. if it is deleted,
- // the value is 0, otherwise it is 1.
- var l=[],u=[],c=[],d=[],h=0,p=0
- // Storage each node's indegree.
- ;p<e.length;p++)l[p]=1;for(p=0;p<t.length;p++)u[p]=t[p].inEdges.length,0===u[p]&&c.push(t[p]);var f=-1;
- // Traversing nodes using topological sorting to calculate the
- // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical')
- // position of the nodes.
- for(;c.length;){for(var g=0;g<c.length;g++){var y=c[g],m=y.hostGraph.data.getRawDataItem(y.dataIndex),v=null!=m.depth&&m.depth>=0;v&&m.depth>f&&(f=m.depth),y.setLayout({depth:v?m.depth:h},!0),"vertical"===r?y.setLayout({dy:n},!0):y.setLayout({dx:n},!0);for(var x=0;x<y.outEdges.length;x++){var _=y.outEdges[x];l[e.indexOf(_)]=0;var b=_.node2;0==--u[t.indexOf(b)]&&d.indexOf(b)<0&&d.push(b)}}++h,c=d,d=[]}for(p=0;p<l.length;p++)if(1===l[p])throw new Error("Sankey is a DAG, the original data has cycle!");var S=f>h-1?f:h-1;s&&"left"!==s&&function(t,e,n,i){if("right"===e){for(var o=[],r=t,s=0;r.length;){for(var l=0;l<r.length;l++){var u=r[l];u.setLayout({skNodeHeight:s},!0);for(var c=0;c<u.inEdges.length;c++){var d=u.inEdges[c];o.indexOf(d.node1)<0&&o.push(d.node1)}}r=o,o=[],++s}a(t,(function(t){YM(t)||t.setLayout({depth:Math.max(0,i-t.getLayout().skNodeHeight)},!0)}))}else"justify"===e&&
- /**
- * All the node without outEgdes are assigned maximum x-position and
- * be aligned in the last column.
- *
- * @param nodes. node of sankey view.
- * @param maxDepth. use to assign to node without outEdges as x-position.
- */
- function(t,e){a(t,(function(t){YM(t)||t.outEdges.length||t.setLayout({depth:e},!0)}))}
- /**
- * Scale node x-position to the width
- *
- * @param nodes node of sankey view
- * @param kx multiple used to scale nodes
- */(t,i)}(t,s,0,S);var w="vertical"===r?(o-n)/S:(i-n)/S;!function(t,e,n){a(t,(function(t){var i=t.getLayout().depth*e;"vertical"===n?t.setLayout({y:i},!0):t.setLayout({x:i},!0)}))}
- /**
- * Using Gauss-Seidel iterations method to compute the node depth(y-position)
- *
- * @param nodes node of sankey view
- * @param edges edge of sankey view
- * @param height the whole height of the area to draw the view
- * @param nodeGap the vertical distance between two nodes
- * in the same column.
- * @param iterations the number of iterations for the algorithm
- */(t,w,r)})(t,e,n,o,r,l,u),function(t,e,n,i,o,r,s){var l=function(t,e){var n=[],i="vertical"===e?"y":"x",o=Wn(t,(function(t){return t.getLayout()[i]}));return o.keys.sort((function(t,e){return t-e})),a(o.keys,(function(t){n.push(o.buckets.get(t))})),n}
- /**
- * Compute the original y-position for each node
- */(t,s);(function(t,e,n,i,o,r){var s=Infinity;a(t,(function(t){var e=t.length,l=0;a(t,(function(t){l+=t.getLayout().value}));var u="vertical"===r?(i-(e-1)*o)/l:(n-(e-1)*o)/l;u<s&&(s=u)})),a(t,(function(t){a(t,(function(t,e){var n=t.getLayout().value*s;"vertical"===r?(t.setLayout({x:e},!0),t.setLayout({dx:n},!0)):(t.setLayout({y:e},!0),t.setLayout({dy:n},!0))}))})),a(e,(function(t){var e=+t.getValue()*s;t.setLayout({dy:e},!0)}))}
- /**
- * Resolve the collision of initialized depth (y-position)
- */)(l,e,n,i,o,s),UM(l,o,n,i,s);for(var u=1;r>0;r--)
- // 0.99 is a experience parameter, ensure that each iterations of
- // changes as small as possible.
- ZM(l,u*=.99,s),UM(l,o,n,i,s),tI(l,u,s),UM(l,o,n,i,s)}(t,e,r,o,i,s,l),
- /**
- * Compute the depth(y-position) of each edge
- */
- function(t,e){var n="vertical"===e?"x":"y";a(t,(function(t){t.outEdges.sort((function(t,e){return t.node2.getLayout()[n]-e.node2.getLayout()[n]})),t.inEdges.sort((function(t,e){return t.node1.getLayout()[n]-e.node1.getLayout()[n]}))})),a(t,(function(t){var e=0,n=0;a(t.outEdges,(function(t){t.setLayout({sy:e},!0),e+=t.getLayout().dy})),a(t.inEdges,(function(t){t.setLayout({ty:n},!0),n+=t.getLayout().dy}))}))}(t,l)}(u,c,n,i,r,s,0!==st(u,(function(t){return 0===t.getLayout().value})).length?0:t.get("layoutIterations"),t.get("orient"),t.get("nodeAlign"))}))}function YM(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return null!=e.depth&&e.depth>=0}function UM(t,e,n,i,o){var r="vertical"===o?"x":"y";a(t,(function(t){var a,s,l;t.sort((function(t,e){return t.getLayout()[r]-e.getLayout()[r]}));for(var u=0,c=t.length,d="vertical"===o?"dx":"dy",h=0;h<c;h++)(l=u-(s=t[h]).getLayout()[r])>0&&(a=s.getLayout()[r]+l,"vertical"===o?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[r]+s.getLayout()[d]+e;if((
- // If the bottommost node goes outside the bounds, push it back up
- l=u-e-("vertical"===o?i:n))>0){a=s.getLayout()[r]-l,"vertical"===o?s.setLayout({x:a},!0):s.setLayout({y:a},!0),u=a;for(h=c-2;h>=0;--h)(l=(s=t[h]).getLayout()[r]+s.getLayout()[d]+e-u)>0&&(a=s.getLayout()[r]-l,"vertical"===o?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[r]}}))}
- /**
- * Change the y-position of the nodes, except most the right side nodes
- * @param nodesByBreadth
- * @param alpha parameter used to adjust the nodes y-position
- */function ZM(t,e,n){a(t.slice().reverse(),(function(t){a(t,(function(t){if(t.outEdges.length){var i=QM(t.outEdges,XM,n)/QM(t.outEdges,$M);if(isNaN(i)){var o=t.outEdges.length;i=o?QM(t.outEdges,jM,n)/o:0}if("vertical"===n){var r=t.getLayout().x+(i-JM(t,n))*e;t.setLayout({x:r},!0)}else{var a=t.getLayout().y+(i-JM(t,n))*e;t.setLayout({y:a},!0)}}}))}))}function XM(t,e){return JM(t.node2,e)*t.getValue()}function jM(t,e){return JM(t.node2,e)}function qM(t,e){return JM(t.node1,e)*t.getValue()}function KM(t,e){return JM(t.node1,e)}function JM(t,e){return"vertical"===e?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function $M(t){return t.getValue()}function QM(t,e,n){for(var i=0,o=t.length,r=-1;++r<o;){var a=+e(t[r],n);isNaN(a)||(i+=a)}return i}
- /**
- * Change the y-position of the nodes, except most the left side nodes
- */function tI(t,e,n){a(t,(function(t){a(t,(function(t){if(t.inEdges.length){var i=QM(t.inEdges,qM,n)/QM(t.inEdges,$M);if(isNaN(i)){var o=t.inEdges.length;i=o?QM(t.inEdges,KM,n)/o:0}if("vertical"===n){var r=t.getLayout().x+(i-JM(t,n))*e;t.setLayout({x:r},!0)}else{var a=t.getLayout().y+(i-JM(t,n))*e;t.setLayout({y:a},!0)}}}))}))}function eI(t){t.eachSeriesByType("sankey",(function(t){var e=t.getGraph(),n=e.nodes,i=e.edges;if(n.length){var o=Infinity,r=-Infinity;a(n,(function(t){var e=t.getLayout().value;e<o&&(o=e),e>r&&(r=e)})),a(n,(function(e){var n=new mb({type:"color",mappingMethod:"linear",dataExtent:[o,r],visual:t.get("color")}).mapValueToVisual(e.getLayout().value),i=e.getModel().get(["itemStyle","color"]);null!=i?(e.setVisual("color",i),e.setVisual("style",{fill:i})):(e.setVisual("color",n),e.setVisual("style",{fill:n}))}))}i.length&&a(i,(function(t){var e=t.getModel().get("lineStyle");t.setVisual("style",e)}))}))}var nI=/** @class */function(){function t(){}
- /**
- * @private
- */return t.prototype._hasEncodeRule=function(t){var e=this.getEncode();return e&&null!=e.get(t)},
- /**
- * @override
- */
- t.prototype.getInitialData=function(t,e){
- // When both types of xAxis and yAxis are 'value', layout is
- // needed to be specified by user. Otherwise, layout can be
- // judged by which axis is category.
- var n,o,r=e.getComponent("xAxis",this.get("xAxisIndex")),s=e.getComponent("yAxis",this.get("yAxisIndex")),l=r.get("type"),u=s.get("type");
- // FIXME
- // Consider time axis.
- "category"===l?(t.layout="horizontal",n=r.getOrdinalMeta(),o=!this._hasEncodeRule("x")):"category"===u?(t.layout="vertical",n=s.getOrdinalMeta(),o=!this._hasEncodeRule("y")):t.layout=t.layout||"horizontal";var c=["x","y"],d="horizontal"===t.layout?0:1,h=this._baseAxisDim=c[d],f=c[1-d],g=[r,s],y=g[d].get("type"),m=g[1-d].get("type"),v=t.data;
- // Clone a new data for next setOption({}) usage.
- // Avoid modifying current data will affect further update.
- if(v&&o){var x=[];a(v,(function(t,e){var n;i(t)?(n=t.slice(),
- // Modify current using data.
- t.unshift(e)):i(t.value)?((n=p({},t)).value=n.value.slice(),
- // Modify current using data.
- t.value.unshift(e)):n=t,x.push(n)})),t.data=x}var _=this.defaultValueDimensions,b=[{name:h,type:xh(y),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:f,type:xh(m),dimsDef:_.slice()}];return um(this,{coordDimensions:b,dimensionsCount:_.length+1,encodeDefaulter:rt(Ya,b,this)})},
- /**
- * If horizontal, base axis is x, otherwise y.
- * @override
- */
- t.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},t}(),iI=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,
- // TODO
- // box width represents group size, so dimension should have 'size'.
- /**
- * @see <https://en.wikipedia.org/wiki/Box_plot>
- * The meanings of 'min' and 'max' depend on user,
- * and echarts do not need to know it.
- * @readOnly
- */
- n.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],n.visualDrawType="stroke",n}return Ue(e,t),e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={
- // zlevel: 0,
- z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(Su);nt(iI,nI,!0);const oI=iI;var rI=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),o=this.group,r=this._data;
- // There is no old data only when first rendering or switching from
- // stream mode to normal mode, where previous elements should be removed.
- this._data||o.removeAll();var a="horizontal"===t.get("layout")?1:0;i.diff(r).add((function(t){if(i.hasValue(t)){var e=lI(i.getItemLayout(t),i,t,a,!0);i.setItemGraphicEl(t,e),o.add(e)}})).update((function(t,e){var n=r.getItemGraphicEl(e);
- // Empty data
- if(i.hasValue(t)){var s=i.getItemLayout(t);n?(uo(n),uI(s,n,i,t)):n=lI(s,i,t,a),o.add(n),i.setItemGraphicEl(t,n)}else o.remove(n)})).remove((function(t){var e=r.getItemGraphicEl(t);e&&o.remove(e)})).execute(),this._data=i},e.prototype.remove=function(t){var e=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl((function(t){t&&e.remove(t)}))},e.type="boxplot",e}(Ou),aI=function(){},sI=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="boxplotBoxPath",n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new aI},e.prototype.buildPath=function(t,e){var n=e.points,i=0;for(t.moveTo(n[i][0],n[i][1]),i++;i<4;i++)t.lineTo(n[i][0],n[i][1]);for(t.closePath();i<n.length;i++)t.moveTo(n[i][0],n[i][1]),i++,t.lineTo(n[i][0],n[i][1])},e}(g);function lI(t,e,n,i,o){var r=t.ends,a=new sI({shape:{points:o?cI(r,i,t):r}});return uI(t,a,e,n,o),a}function uI(t,e,n,i,o){var r=n.hostModel;(0,Go[o?"initProps":"updateProps"])(e,{shape:{points:t.ends}},r,i),e.useStyle(n.getItemVisual(i,"style")),e.style.strokeNoScale=!0,e.z2=100;var a=n.getItemModel(i),s=a.getModel("emphasis");qi(e,a),Ui(e,s.get("focus"),s.get("blurScope"),s.get("disabled"))}function cI(t,e,i){return n(t,(function(t){return(t=t.slice())[e]=i.initBaseline,t}))}const dI=rI;var hI=a;function pI(t){var e=
- /**
- * Group series by axis.
- */
- function(t){var e=[],n=[];return t.eachSeriesByType("boxplot",(function(t){var i=t.getBaseAxis(),o=c(n,i);o<0&&(o=n.length,n[o]=i,e[o]={axis:i,seriesModels:[]}),e[o].seriesModels.push(t)})),e}
- /**
- * Calculate offset and box width for each series.
- */(t);hI(e,(function(t){var e=t.seriesModels;e.length&&(!function(t){var e,n=t.axis,o=t.seriesModels,r=o.length,a=t.boxWidthList=[],s=t.boxOffsetList=[],l=[];if("category"===n.type)e=n.getBandWidth();else{var u=0;hI(o,(function(t){u=Math.max(u,t.getData().count())}));var c=n.getExtent();e=Math.abs(c[1]-c[0])/u}hI(o,(function(t){var n=t.get("boxWidth");i(n)||(n=[n,n]),l.push([je(n[0],e)||0,je(n[1],e)||0])}));var d=.8*e-2,h=d/r*.3,p=(d-h*(r-1))/r,f=p/2-d/2;hI(o,(function(t,e){s.push(f),f+=h+p,a.push(Math.min(Math.max(p,l[e][0]),l[e][1]))}))}
- /**
- * Calculate points location for each series.
- */(t),hI(e,(function(e,n){!function(t,e,n){var i=t.coordinateSystem,o=t.getData(),r=n/2,a="horizontal"===t.get("layout")?0:1,s=1-a,l=["x","y"],u=o.mapDimension(l[a]),c=o.mapDimensionsAll(l[s]);if(null==u||c.length<5)return;for(var d=0;d<o.count();d++){var h=o.get(u,d),p=x(h,c[2],d),f=x(h,c[0],d),g=x(h,c[1],d),y=x(h,c[3],d),m=x(h,c[4],d),v=[];_(v,g,!1),_(v,y,!0),v.push(f,g,m,y),b(v,f),b(v,m),b(v,p),o.setItemLayout(d,{initBaseline:p[s],ends:v})}function x(t,n,r){var l,u=o.get(n,r),c=[];return c[a]=t,c[s]=u,isNaN(t)||isNaN(u)?l=[NaN,NaN]:(l=i.dataToPoint(c))[a]+=e,l}function _(t,e,n){var i=e.slice(),o=e.slice();i[a]+=r,o[a]-=r,n?t.push(i,o):t.push(o,i)}function b(t,e){var n=e.slice(),i=e.slice();n[a]-=r,i[a]+=r,t.push(n,i)}}
- /**
- * See:
- * <https://en.wikipedia.org/wiki/Box_plot#cite_note-frigge_hoaglin_iglewicz-2>
- * <http://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/boxplot.stats.html>
- *
- * Helper method for preparing data.
- *
- * @param rawData like
- * [
- * [12,232,443], (raw data set for the first box)
- * [3843,5545,1232], (raw data set for the second box)
- * ...
- * ]
- * @param opt.boundIQR=1.5 Data less than min bound is outlier.
- * default 1.5, means Q1 - 1.5 * (Q3 - Q1).
- * If 'none'/0 passed, min bound will not be used.
- */(e,t.boxOffsetList[n],t.boxWidthList[n])})))}))}var fI={type:"echarts:boxplot",transform:function(e){var n=e.upstream;if(n.sourceFormat!==Na){vn("")}var i=function(e,n){for(var i=[],o=[],r=(n=n||{}).boundIQR,a="none"===r||0===r,s=0;s<e.length;s++){var l=Ke(e[s].slice()),u=dn(l,.25),c=dn(l,.5),d=dn(l,.75),h=l[0],p=l[l.length-1],g=(null==r?1.5:r)*(d-u),y=a?h:Math.max(h,u-g),m=a?p:Math.min(p,d+g),v=n.itemNameFormatter,x=f(v)?v({value:s}):t(v)?v.replace("{value}",s+""):s+"";i.push([x,y,u,c,d,m]);for(var _=0;_<l.length;_++){var b=l[_];if(b<y||b>m){var S=[x,b];o.push(S)}}}return{boxData:i,outliers:o}}(n.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};var gI=["itemStyle","borderColor"],yI=["itemStyle","borderColor0"],mI=["itemStyle","borderColorDoji"],vI=["itemStyle","color"],xI=["itemStyle","color0"];function _I(t,e){return e.get(t>0?vI:xI)}function bI(t,e){return e.get(0===t?mI:t>0?gI:yI)}const SI={seriesType:"candlestick",plan:Iu(),
- // For legend.
- performRawSeries:!0,reset:function(t,e){
- // Only visible series has each data be visual encoded
- if(!e.isSeriesFiltered(t))return!t.pipelineContext.large&&{progress:function(t,e){for(var n;null!=(n=t.next());){var i=e.getItemModel(n),o=e.getItemLayout(n).sign,r=i.getItemStyle();r.fill=_I(o,i),r.stroke=bI(o,i)||r.fill;var a=e.ensureUniqueItemVisual(n,"style");p(a,r)}}}}};var wI=["color","borderColor"],MI=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){
- // If there is clipPath created in large mode. Remove it.
- this.group.removeClipPath(),
- // Clear previously rendered progressive elements.
- this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,e,n){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,e,n,i){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,e):this._incrementalRenderNormal(t,e)},e.prototype.eachRendered=function(t){Bo(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t){var e=t.getData(),n=this._data,i=this.group,o=e.getLayout("isSimpleBox"),r=t.get("clip",!0),a=t.coordinateSystem,s=a.getArea&&a.getArea();
- // There is no old data only when first rendering or switching from
- // stream mode to normal mode, where previous elements should be removed.
- this._data||i.removeAll(),e.diff(n).add((function(n){if(e.hasValue(n)){var a=e.getItemLayout(n);if(r&&CI(s,a))return;var l=TI(a,n,!0);oo(l,{shape:{points:a.ends}},t,n),AI(l,e,n,o),i.add(l),e.setItemGraphicEl(n,l)}})).update((function(a,l){var u=n.getItemGraphicEl(l);
- // Empty data
- if(e.hasValue(a)){var c=e.getItemLayout(a);r&&CI(s,c)?i.remove(u):(u?(io(u,{shape:{points:c.ends}},t,a),uo(u)):u=TI(c),AI(u,e,a,o),i.add(u),e.setItemGraphicEl(a,u))}else i.remove(u)})).remove((function(t){var e=n.getItemGraphicEl(t);e&&i.remove(e)})).execute(),this._data=e},e.prototype._renderLarge=function(t){this._clear(),NI(t,this.group);var e=t.get("clip",!0)?iy(t.coordinateSystem,!1,t):null;e?this.group.setClipPath(e):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,e){for(var n,i=e.getData(),o=i.getLayout("isSimpleBox");null!=(n=t.next());){var r=TI(i.getItemLayout(n));AI(r,i,n,o),r.incremental=!0,this.group.add(r),this._progressiveEls.push(r)}},e.prototype._incrementalRenderLarge=function(t,e){NI(e,this.group,this._progressiveEls,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(Ou),II=function(){},DI=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="normalCandlestickBox",n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new II},e.prototype.buildPath=function(t,e){var n=e.points;this.__simpleBox?(t.moveTo(n[4][0],n[4][1]),t.lineTo(n[6][0],n[6][1])):(t.moveTo(n[0][0],n[0][1]),t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]),t.lineTo(n[3][0],n[3][1]),t.closePath(),t.moveTo(n[4][0],n[4][1]),t.lineTo(n[5][0],n[5][1]),t.moveTo(n[6][0],n[6][1]),t.lineTo(n[7][0],n[7][1]))},e}(g);function TI(t,e,n){var i=t.ends;return new DI({shape:{points:n?LI(i,t):i},z2:100})}function CI(t,e){for(var n=!0,i=0;i<e.ends.length;i++)
- // If any point are in the region.
- if(t.contain(e.ends[i][0],e.ends[i][1])){n=!1;break}return n}function AI(t,e,n,i){var o=e.getItemModel(n);t.useStyle(e.getItemVisual(n,"style")),t.style.strokeNoScale=!0,t.__simpleBox=i,qi(t,o);var r=e.getItemLayout(n).sign;a(t.states,(function(t,e){var n=o.getModel(e),i=_I(r,n),a=bI(r,n)||i,s=t.style||(t.style={});i&&(s.fill=i),a&&(s.stroke=a)}));var s=o.getModel("emphasis");Ui(t,s.get("focus"),s.get("blurScope"),s.get("disabled"))}function LI(t,e){return n(t,(function(t){return(t=t.slice())[1]=e.initBaseline,t}))}var kI=function(){},PI=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n.type="largeCandlestickBox",n}return Ue(e,t),e.prototype.getDefaultShape=function(){return new kI},e.prototype.buildPath=function(t,e){for(
- // Drawing lines is more efficient than drawing
- // a whole line or drawing rects.
- var n=e.points,i=0;i<n.length;)if(this.__sign===n[i++]){var o=n[i++];t.moveTo(o,n[i++]),t.lineTo(o,n[i++])}else i+=3},e}(g);function NI(t,e,n,i){var o=t.getData().getLayout("largePoints"),r=new PI({shape:{points:o},__sign:1,ignoreCoarsePointer:!0});e.add(r);var a=new PI({shape:{points:o},__sign:-1,ignoreCoarsePointer:!0});e.add(a);var s=new PI({shape:{points:o},__sign:0,ignoreCoarsePointer:!0});e.add(s),OI(1,r,t),OI(-1,a,t),OI(0,s,t),i&&(r.incremental=!0,a.incremental=!0),n&&n.push(r,a)}function OI(t,e,n,i){
- // TODO put in visual?
- var o=bI(t,n)||_I(t,n),r=n.getModel("itemStyle").getItemStyle(wI);
- // Color must be excluded.
- // Because symbol provide setColor individually to set fill and stroke
- e.useStyle(r),e.style.fill=null,e.style.stroke=o}const RI=MI;var EI=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],n}
- /**
- * Get dimension for shadow in dataZoom
- * @return dimension name
- */return Ue(e,t),e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(t,e,n){var i=e.getItemLayout(t);return i&&n.rect(i.brushRect)},e.type="series.candlestick",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={
- // zlevel: 0,
- z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,
- // xAxisIndex: 0,
- // yAxisIndex: 0,
- layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,
- // borderColor: '#d24040',
- // borderColor0: '#398f4f',
- borderWidth:1},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(Su);nt(EI,nI,!0);const VI=EI;function zI(t){t&&i(t.series)&&
- // Translate 'k' to 'candlestick'.
- a(t.series,(function(t){o(t)&&"k"===t.type&&(t.type="candlestick")}))}var BI={seriesType:"candlestick",plan:Iu(),reset:function(t){var e=t.coordinateSystem,i=t.getData(),o=function(t,e){var n,i=t.getBaseAxis(),o="category"===i.type?i.getBandWidth():(n=i.getExtent(),Math.abs(n[1]-n[0])/e.count()),r=je(x(t.get("barMaxWidth"),o),o),a=je(x(t.get("barMinWidth"),1),o),s=t.get("barWidth");return null!=s?je(s,o):Math.max(Math.min(o/2,r),a)}(t,i),r=["x","y"],a=i.getDimensionIndex(i.mapDimension(r[0])),s=n(i.mapDimensionsAll(r[1]),i.getDimensionIndex,i),l=s[0],u=s[1],c=s[2],d=s[3];if(i.setLayout({candleWidth:o,
- // The value is experimented visually.
- isSimpleBox:o<=1.3}),!(a<0||s.length<4))return{progress:t.pipelineContext.large?function(n,i){
- // Structure: [sign, x, yhigh, ylow, sign, x, yhigh, ylow, ...]
- var o,r,s=xp(4*n.count),h=0,p=[],f=[],g=i.getStore(),y=!!t.get(["itemStyle","borderColorDoji"]);for(;null!=(r=n.next());){var m=g.get(a,r),v=g.get(l,r),x=g.get(u,r),_=g.get(c,r),b=g.get(d,r);isNaN(m)||isNaN(_)||isNaN(b)?(s[h++]=NaN,h+=3):(s[h++]=GI(g,r,v,x,u,y),p[0]=m,p[1]=_,o=e.dataToPoint(p,null,f),s[h++]=o?o[0]:NaN,s[h++]=o?o[1]:NaN,p[1]=b,o=e.dataToPoint(p,null,f),s[h++]=o?o[1]:NaN)}i.setLayout("largePoints",s)}:function(t,n){var i,r=n.getStore();for(;null!=(i=t.next());){var s=r.get(a,i),h=r.get(l,i),p=r.get(u,i),f=r.get(c,i),g=r.get(d,i),y=Math.min(h,p),m=Math.max(h,p),v=M(y,s),x=M(m,s),_=M(f,s),b=M(g,s),S=[];I(S,x,0),I(S,v,1),S.push(T(b),T(x),T(_),T(v));var w=!!n.getItemModel(i).get(["itemStyle","borderColorDoji"]);n.setItemLayout(i,{sign:GI(r,i,h,p,u,w),initBaseline:h>p?x[1]:v[1],ends:S,brushRect:D(f,g,s)})}function M(t,n){var i=[];return i[0]=n,i[1]=t,isNaN(n)||isNaN(t)?[NaN,NaN]:e.dataToPoint(i)}function I(t,e,n){var i=e.slice(),r=e.slice();i[0]=Io(i[0]+o/2,1,!1),r[0]=Io(r[0]-o/2,1,!0),n?t.push(i,r):t.push(r,i)}function D(t,e,n){var i=M(t,n),r=M(e,n);return i[0]-=o/2,r[0]-=o/2,{x:i[0],y:i[1],width:o,height:r[1]-i[1]}}function T(t){return t[0]=Io(t[0],1),t}}}}};
- /**
- * Get the sign of a single data.
- *
- * @returns 0 for doji with hasDojiColor: true,
- * 1 for positive,
- * -1 for negative.
- */function GI(t,e,n,i,o,r){return n>i?-1:n<i?1:r?0:e>0?t.get(o,e-1)<=i?1:-1:1}const FI=BI;function WI(t,e){var n=e.rippleEffectColor||e.color;t.eachChild((function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?n:null,fill:"fill"===e.brushType?n:null}})}))}var HI=/** @class */function(t){function e(e,n){var i=t.call(this)||this,o=new Bg(e,n),r=new Z;return i.add(o),i.add(r),i.updateData(e,n),i}return Ue(e,t),e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var e=t.symbolType,n=t.color,i=t.rippleNumber,o=this.childAt(1),r=0;r<i;r++){
- // If width/height are set too small (e.g., set to 1) on ios10
- // and macOS Sierra, a circle stroke become a rect, no matter what
- // the scale is set. So we set width/height as 2. See #4136.
- var a=Gc(e,-1,-1,2,2,n);a.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scaleX:.5,scaleY:.5});var s=-r/i*t.period+t.effectOffset;a.animate("",!0).when(t.period,{scaleX:t.rippleScale/2,scaleY:t.rippleScale/2}).delay(s).start(),a.animateStyle(!0).when(t.period,{opacity:0}).delay(s).start(),o.add(a)}WI(o,t)},
- /**
- * Update effect symbol
- */
- e.prototype.updateEffectAnimation=function(t){for(var e=this._effectCfg,n=this.childAt(1),i=["symbolType","period","rippleScale","rippleNumber"],o=0;o<i.length;o++){var r=i[o];if(e[r]!==t[r])return this.stopEffectAnimation(),void this.startEffectAnimation(t)}WI(n,t)},
- /**
- * Highlight symbol
- */
- e.prototype.highlight=function(){ki(this)},
- /**
- * Downplay symbol
- */
- e.prototype.downplay=function(){Pi(this)},e.prototype.getSymbolType=function(){var t=this.childAt(0);return t&&t.getSymbolType()},
- /**
- * Update symbol properties
- */
- e.prototype.updateData=function(t,e){var n=this,i=t.hostModel;this.childAt(0).updateData(t,e);var o=this.childAt(1),r=t.getItemModel(e),a=t.getItemVisual(e,"symbol"),s=Fc(t.getItemVisual(e,"symbolSize")),l=t.getItemVisual(e,"style"),u=l&&l.fill,c=r.getModel("emphasis");o.setScale(s),o.traverse((function(t){t.setStyle("fill",u)}));var d=Wc(t.getItemVisual(e,"symbolOffset"),s);d&&(o.x=d[0],o.y=d[1]);var h=t.getItemVisual(e,"symbolRotate");o.rotation=(h||0)*Math.PI/180||0;var p={};p.showEffectOn=i.get("showEffectOn"),p.rippleScale=r.get(["rippleEffect","scale"]),p.brushType=r.get(["rippleEffect","brushType"]),p.period=1e3*r.get(["rippleEffect","period"]),p.effectOffset=e/t.count(),p.z=i.getShallow("z")||0,p.zlevel=i.getShallow("zlevel")||0,p.symbolType=a,p.color=u,p.rippleEffectColor=r.get(["rippleEffect","color"]),p.rippleNumber=r.get(["rippleEffect","number"]),"render"===p.showEffectOn?(this._effectCfg?this.updateEffectAnimation(p):this.startEffectAnimation(p),this._effectCfg=p):(
- // Not keep old effect config
- this._effectCfg=null,this.stopEffectAnimation(),this.onHoverStateChange=function(t){"emphasis"===t?"render"!==p.showEffectOn&&n.startEffectAnimation(p):"normal"===t&&"render"!==p.showEffectOn&&n.stopEffectAnimation()}),this._effectCfg=p,Ui(this,c.get("focus"),c.get("blurScope"),c.get("disabled"))},e.prototype.fadeOut=function(t){t&&t()},e}(Z);const YI=HI;const UI=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(){this._symbolDraw=new Yg(YI)},e.prototype.render=function(t,e,n){var i=t.getData(),o=this._symbolDraw;o.updateData(i,{clipShape:this._getClipShape(t)}),this.group.add(o.group)},e.prototype._getClipShape=function(t){var e=t.coordinateSystem,n=e&&e.getArea&&e.getArea();return t.get("clip",!0)?n:null},e.prototype.updateTransform=function(t,e,n){var i=t.getData();this.group.dirty();var o=my("").reset(t,e,n);o.progress&&o.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout()},e.prototype._updateGroupTransform=function(t){var e=t.coordinateSystem;e&&e.getRoamTransform&&(this.group.transform=Se(e.getRoamTransform()),this.group.decomposeTransform())},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0)},e.type="effectScatter",e}(Ou);const ZI=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return Ue(e,t),e.prototype.getInitialData=function(t,e){return Jh(null,this,{useEncodeDefaulter:!0})},e.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},e.type="series.effectScatter",e.dependencies=["grid","polar"],e.defaultOption={coordinateSystem:"cartesian2d",
- // zlevel: 0,
- z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,
- // When to show the effect, option: 'render'|'emphasis'
- showEffectOn:"render",clip:!0,
- // Ripple effect config
- rippleEffect:{period:4,
- // Scale of ripple
- scale:2.5,
- // Brush type can be fill or stroke
- brushType:"fill",
- // Ripple number
- number:3},universalTransition:{divideShape:"clone"},
- // Cartesian coordinate system
- // xAxisIndex: 0,
- // yAxisIndex: 0,
- // Polar coordinate system
- // polarIndex: 0,
- // Geo coordinate system
- // geoIndex: 0,
- // symbol: null, // 图形类型
- symbolSize:10},e}(Su);var XI=/** @class */function(t){function e(e,n,i){var o=t.call(this)||this;return o.add(o.createLine(e,n,i)),o._updateEffectSymbol(e,n),o}return Ue(e,t),e.prototype.createLine=function(t,e,n){return new _S(t,e,n)},e.prototype._updateEffectSymbol=function(t,e){var n=t.getItemModel(e).getModel("effect"),o=n.get("symbolSize"),r=n.get("symbol");i(o)||(o=[o,o]);var a=t.getItemVisual(e,"style"),s=n.get("color")||a&&a.stroke,l=this.childAt(1);this._symbolType!==r&&(
- // Remove previous
- this.remove(l),(l=Gc(r,-.5,-.5,1,1,s)).z2=100,l.culling=!0,this.add(l)),
- // Symbol may be removed if loop is false
- l&&(
- // Shadow color is same with color in default
- l.setStyle("shadowColor",s),l.setStyle(n.getItemStyle(["color"])),l.scaleX=o[0],l.scaleY=o[1],l.setColor(s),this._symbolType=r,this._symbolScale=o,this._updateEffectAnimation(t,n,e))},e.prototype._updateEffectAnimation=function(t,e,n){var i=this.childAt(1);if(i){var o=t.getItemLayout(n),r=1e3*e.get("period"),a=e.get("loop"),s=e.get("roundTrip"),l=e.get("constantSpeed"),u=Yt(e.get("delay"),(function(e){return e/t.count()*r/3}));if(
- // Ignore when updating
- i.ignore=!0,this._updateAnimationPoints(i,o),l>0&&(r=this._getLineLength(i)/l*1e3),r!==this._period||a!==this._loop||s!==this._roundTrip){i.stopAnimation();var c=void 0;c=f(u)?u(n):u,i.__t>0&&(c=-r*i.__t),this._animateSymbol(i,r,c,a,s)}this._period=r,this._loop=a,this._roundTrip=s}},e.prototype._animateSymbol=function(t,e,n,i,o){if(e>0){t.__t=0;var r=this,a=t.animate("",i).when(o?2*e:e,{__t:o?2:1}).delay(n).during((function(){r._updateSymbolPosition(t)}));i||a.done((function(){r.remove(t)})),a.start()}},e.prototype._getLineLength=function(t){
- // Not so accurate
- return Pt(t.__p1,t.__cp1)+Pt(t.__cp1,t.__p2)},e.prototype._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]},e.prototype.updateData=function(t,e,n){this.childAt(0).updateData(t,e,n),this._updateEffectSymbol(t,e)},e.prototype._updateSymbolPosition=function(t){var e=t.__p1,n=t.__p2,i=t.__cp1,o=t.__t<1?t.__t:2-t.__t,r=[t.x,t.y],a=r.slice(),s=_e,l=we;r[0]=s(e[0],i[0],n[0],o),r[1]=s(e[1],i[1],n[1],o);
- // Tangent
- var u=t.__t<1?l(e[0],i[0],n[0],o):l(n[0],i[0],e[0],1-o),c=t.__t<1?l(e[1],i[1],n[1],o):l(n[1],i[1],e[1],1-o);t.rotation=-Math.atan2(c,u)-Math.PI/2,
- // enable continuity trail for 'line', 'rect', 'roundRect' symbolType
- "line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==t.__lastT&&t.__lastT<t.__t?(t.scaleY=1.05*Pt(a,r),
- // make sure the last segment render within endPoint
- 1===o&&(r[0]=a[0]+(r[0]-a[0])/2,r[1]=a[1]+(r[1]-a[1])/2)):1===t.__lastT?
- // After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly.
- t.scaleY=2*Pt(e,r):t.scaleY=this._symbolScale[1]),t.__lastT=t.__t,t.ignore=!1,t.x=r[0],t.y=r[1]},e.prototype.updateLayout=function(t,e){this.childAt(0).updateLayout(t,e);var n=t.getItemModel(e).getModel("effect");this._updateEffectAnimation(t,n,e)},e}(Z);const jI=XI;var qI=/** @class */function(t){function e(e,n,i){var o=t.call(this)||this;return o._createPolyline(e,n,i),o}return Ue(e,t),e.prototype._createPolyline=function(t,e,n){
- // let seriesModel = lineData.hostModel;
- var i=t.getItemLayout(e),o=new B({shape:{points:i}});this.add(o),this._updateCommonStl(t,e,n)},e.prototype.updateData=function(t,e,n){var i=t.hostModel;io(this.childAt(0),{shape:{points:t.getItemLayout(e)}},i,e),this._updateCommonStl(t,e,n)},e.prototype._updateCommonStl=function(t,e,n){var i=this.childAt(0),o=t.getItemModel(e),r=n&&n.emphasisLineStyle,a=n&&n.focus,s=n&&n.blurScope,l=n&&n.emphasisDisabled;if(!n||t.hasItemOption){var u=o.getModel("emphasis");r=u.getModel("lineStyle").getLineStyle(),l=u.get("disabled"),a=u.get("focus"),s=u.get("blurScope")}i.useStyle(t.getItemVisual(e,"style")),i.style.fill=null,i.style.strokeNoScale=!0,i.ensureState("emphasis").style=r,Ui(this,a,s,l)},e.prototype.updateLayout=function(t,e){this.childAt(0).setShape("points",t.getItemLayout(e))},e}(Z);const KI=qI;var JI=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._lastFrame=0,e._lastFramePercent=0,e}
- // Override
- return Ue(e,t),e.prototype.createLine=function(t,e,n){return new KI(t,e,n)},
- // Override
- e.prototype._updateAnimationPoints=function(t,e){this._points=e;for(var n=[0],i=0,o=1;o<e.length;o++){var r=e[o-1],a=e[o];i+=Pt(r,a),n.push(i)}if(0!==i){for(o=0;o<n.length;o++)n[o]/=i;this._offsets=n,this._length=i}else this._length=0},
- // Override
- e.prototype._getLineLength=function(){return this._length},
- // Override
- e.prototype._updateSymbolPosition=function(t){var e=t.__t<1?t.__t:2-t.__t,n=this._points,i=this._offsets,o=n.length;if(i){var r,a=this._lastFrame;if(e<this._lastFramePercent){for(r=Math.min(a+1,o-1);r>=0&&!(i[r]<=e);r--);
- // PENDING really need to do this ?
- r=Math.min(r,o-2)}else{for(r=a;r<o&&!(i[r]>e);r++);r=Math.min(r-1,o-2)}var s=(e-i[r])/(i[r+1]-i[r]),l=n[r],u=n[r+1];t.x=l[0]*(1-s)+s*u[0],t.y=l[1]*(1-s)+s*u[1];var c=t.__t<1?u[0]-l[0]:l[0]-u[0],d=t.__t<1?u[1]-l[1]:l[1]-u[1];t.rotation=-Math.atan2(d,c)-Math.PI/2,this._lastFrame=r,this._lastFramePercent=e,t.ignore=!1}},e}(jI);const $I=JI;var QI=function(){this.polyline=!1,this.curveness=0,this.segs=[]},tD=/** @class */function(t){function e(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return Ue(e,t),e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new QI},e.prototype.buildPath=function(t,e){var n,i=e.segs,o=e.curveness;if(e.polyline)for(n=this._off;n<i.length;){var r=i[n++];if(r>0){t.moveTo(i[n++],i[n++]);for(var a=1;a<r;a++)t.lineTo(i[n++],i[n++])}}else for(n=this._off;n<i.length;){var s=i[n++],l=i[n++],u=i[n++],c=i[n++];if(t.moveTo(s,l),o>0){var d=(s+u)/2-(l-c)*o,h=(l+c)/2-(u-s)*o;t.quadraticCurveTo(d,h,u,c)}else t.lineTo(u,c)}this.incremental&&(this._off=n,this.notClear=!0)},e.prototype.findDataIndex=function(t,e){var n=this.shape,i=n.segs,o=n.curveness,r=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s<i.length;){var l=i[s++];if(l>0)for(var u=i[s++],c=i[s++],d=1;d<l;d++){var h=i[s++],p=i[s++];if(Me(u,c,h,p,r,t,e))return a}a++}else for(a=0,s=0;s<i.length;){u=i[s++],c=i[s++],h=i[s++],p=i[s++];if(o>0){if(Ie(u,c,(u+h)/2-(c-p)*o,(c+p)/2-(h-u)*o,h,p,r,t,e))return a}else if(Me(u,c,h,p,r,t,e))return a;a++}return-1},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect();return t=n[0],e=n[1],i.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},e.prototype.getBoundingRect=function(){
- // Ignore stroke for large symbol draw.
- var t=this._rect;if(!t){for(var e=this.shape.segs,n=Infinity,i=Infinity,o=-Infinity,r=-Infinity,a=0;a<e.length;){var s=e[a++],l=e[a++];n=Math.min(s,n),o=Math.max(s,o),i=Math.min(l,i),r=Math.max(l,r)}t=this._rect=new Y(n,i,o,r)}return t},e}(g);const eD=/** @class */function(){function t(){this.group=new Z}
- /**
- * Update symbols draw by new data
- */return t.prototype.updateData=function(t){this._clear();var e=this._create();e.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(e,t)},
- /**
- * @override
- */
- t.prototype.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clear()},
- /**
- * @override
- */
- t.prototype.incrementalUpdate=function(t,e){var n=this._newAdded[0],i=e.getLayout("linesPoints"),o=n&&n.shape.segs;
- // Merging the exists. Each element has 1e4 points.
- // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization)
- if(o&&o.length<2e4){var r=o.length,a=new Float32Array(r+i.length);
- // Concat two array
- a.set(o),a.set(i,r),n.setShape({segs:a})}else{
- // Clear
- this._newAdded=[];var s=this._create();s.incremental=!0,s.setShape({segs:i}),this._setCommon(s,e),s.__startIndex=t.start}},
- /**
- * @override
- */
- t.prototype.remove=function(){this._clear()},t.prototype.eachRendered=function(t){this._newAdded[0]&&t(this._newAdded[0])},t.prototype._create=function(){var t=new tD({cursor:"default",ignoreCoarsePointer:!0});return this._newAdded.push(t),this.group.add(t),t},t.prototype._setCommon=function(t,e,n){var i=e.hostModel;t.setShape({polyline:i.get("polyline"),curveness:i.get(["lineStyle","curveness"])}),t.useStyle(i.getModel("lineStyle").getLineStyle()),t.style.strokeNoScale=!0;var o=e.getVisual("style");o&&o.stroke&&t.setStyle("stroke",o.stroke),t.setStyle("fill",null);var r=ni(t);
- // Enable tooltip
- // PENDING May have performance issue when path is extremely large
- r.seriesIndex=i.seriesIndex,t.on("mousemove",(function(e){r.dataIndex=null;var n=t.hoverDataIdx;n>0&&(
- // Provide dataIndex for tooltip
- r.dataIndex=n+t.__startIndex)}))},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();var nD={seriesType:"lines",plan:Iu(),reset:function(t){var e=t.coordinateSystem;if(e){var n=t.get("polyline"),i=t.pipelineContext.large;return{progress:function(o,r){var a=[];if(i){var s=void 0,l=o.end-o.start;if(n){for(var u=0,c=o.start;c<o.end;c++)u+=t.getLineCoordsCount(c);s=new Float32Array(l+2*u)}else s=new Float32Array(4*l);var d=0,h=[];for(c=o.start;c<o.end;c++){var p=t.getLineCoords(c,a);n&&(s[d++]=p);for(var f=0;f<p;f++)h=e.dataToPoint(a[f],!1,h),s[d++]=h[0],s[d++]=h[1]}r.setLayout("linesPoints",s)}else for(c=o.start;c<o.end;c++){var g=r.getItemModel(c),y=(p=t.getLineCoords(c,a),[]);if(n)for(var m=0;m<p;m++)y.push(e.dataToPoint(a[m]));else{y[0]=e.dataToPoint(a[0]),y[1]=e.dataToPoint(a[1]);var v=g.get(["lineStyle","curveness"]);+v&&(y[2]=[(y[0][0]+y[1][0])/2-(y[0][1]-y[1][1])*v,(y[0][1]+y[1][1])/2-(y[1][0]-y[0][0])*v])}r.setItemLayout(c,y)}}}}}};const iD=nD;const oD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),o=this._updateLineDraw(i,t),r=t.get("zlevel"),a=t.get(["effect","trailLength"]),s=n.getZr(),l="svg"===s.painter.getType();l||s.painter.getLayer(r).clear(!0),
- // Config layer with motion blur
- null==this._lastZlevel||l||s.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(t)&&a>0&&(l||s.configLayer(r,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})),o.updateData(i);var u=t.get("clip",!0)&&iy(t.coordinateSystem,!1,t);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=r,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateLineDraw(i,t).incrementalPrepareUpdate(i),this._clearLayer(n),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._lineDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,e,n){var i=t.getData(),o=t.pipelineContext;if(!this._finished||o.large||o.progressiveRender)
- // TODO Don't have to do update in large mode. Only do it when there are millions of data.
- return{update:!0};
- // TODO Use same logic with ScatterView.
- // Manually update layout
- var r=iD.reset(t,e,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),
- // Not in large mode
- this._lineDraw.updateLayout(),this._clearLayer(n)},e.prototype._updateLineDraw=function(t,e){var n=this._lineDraw,i=this._showEffect(e),o=!!e.get("polyline"),r=e.pipelineContext.large;return n&&i===this._hasEffet&&o===this._isPolyline&&r===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=r?new eD:new MS(o?i?$I:KI:i?jI:_S),this._hasEffet=i,this._isPolyline=o,this._isLargeDraw=r),this.group.add(n.group),n},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){
- // Not use motion when dragging or zooming
- var e=t.getZr();"svg"===e.painter.getType()||null==this._lastZlevel||e.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,
- // Clear motion when lineDraw is removed
- this._clearLayer(e)},e.prototype.dispose=function(t,e){this.remove(t,e)},e.type="lines",e}(Ou);var rD="undefined"==typeof Uint32Array?Array:Uint32Array,aD="undefined"==typeof Float64Array?Array:Float64Array;function sD(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=n(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),ne([e,t[0],t[1]])})))}var lD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return Ue(e,t),e.prototype.init=function(e){
- // The input data may be null/undefined.
- e.data=e.data||[],
- // Not using preprocessor because mergeOption may not have series.type
- sD(e);var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(e){if(sD(e),e.data){
- // Only update when have option data to merge.
- var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=ct(this._flatCoords,e.flatCoords),this._flatCoordsOffset=ct(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var e=this.getData().getItemModel(t);return e.option instanceof Array?e.option:e.getShallow("coords")},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],i=this._flatCoordsOffset[2*t+1],o=0;o<i;o++)e[o]=e[o]||[],e[o][0]=this._flatCoords[n+2*o],e[o][1]=this._flatCoords[n+2*o+1];return i}var r=this._getCoordsFromItemModel(t);for(o=0;o<r.length;o++)e[o]=e[o]||[],e[o][0]=r[o][0],e[o][1]=r[o][1];return r.length},e.prototype._processFlatCoordsArray=function(t){var e=0;
- // Stored as a typed array. In format
- // Points Count(2) | x | y | x | y | Points Count(3) | x | y | x | y | x | y |
- if(this._flatCoords&&(e=this._flatCoords.length),l(t[0])){for(var n=t.length,i=new rD(n),o=new aD(n),r=0,a=0,s=0,u=0
- // Store offset and len of each segment
- ;u<n;){s++;var c=t[u++];
- // Offset
- i[a++]=r+e,
- // Len
- i[a++]=c;for(var d=0;d<c;d++){var h=t[u++],p=t[u++];o[r++]=h,o[r++]=p}}return{flatCoordsOffset:new Uint32Array(i.buffer,0,a),flatCoords:o,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:t.length}},e.prototype.getInitialData=function(t,e){var n=new Fh(["value"],this);return n.hasItemOption=!1,n.initData(t.data,[],(function(t,e,i,o){
- // dataItem is simply coords
- if(t instanceof Array)return NaN;n.hasItemOption=!0;var r=t.value;return null!=r?r instanceof Array?r[o]:r:void 0})),n},e.prototype.formatTooltip=function(t,e,n){var i=this.getData().getItemModel(t),o=i.get("name");if(o)return o;var r=i.get("fromName"),a=i.get("toName"),s=[];return null!=r&&s.push(r),null!=a&&s.push(a),$l("nameValue",{name:s.join(" > ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),e=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&e>0?e+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",
- // zlevel: 0,
- z:2,legendHoverLink:!0,
- // Cartesian coordinate system
- xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],
- // Geo coordinate system
- geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,
- // Available when large is true
- largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(Su);const uD=lD;
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */function cD(t){return t instanceof Array||(t=[t,t]),t}const dD={seriesType:"lines",reset:function(t){var e=cD(t.get("symbol")),n=cD(t.get("symbolSize")),i=t.getData();return i.setVisual("fromSymbol",e&&e[0]),i.setVisual("toSymbol",e&&e[1]),i.setVisual("fromSymbolSize",n&&n[0]),i.setVisual("toSymbolSize",n&&n[1]),{dataEach:i.hasItemOption?function(t,e){var n=t.getItemModel(e),i=cD(n.getShallow("symbol",!0)),o=cD(n.getShallow("symbolSize",!0));i[0]&&t.setItemVisual(e,"fromSymbol",i[0]),i[1]&&t.setItemVisual(e,"toSymbol",i[1]),o[0]&&t.setItemVisual(e,"fromSymbolSize",o[0]),o[1]&&t.setItemVisual(e,"toSymbolSize",o[1])}:null}}};var hD=/** @class */function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=gt.createCanvas();this.canvas=t}
- /**
- * Renders Heatmap and returns the rendered canvas
- * @param data array of data, each has x, y, value
- * @param width canvas width
- * @param height canvas height
- */return t.prototype.update=function(t,e,n,i,o,r){var a=this._getBrush(),s=this._getGradient(o,"inRange"),l=this._getGradient(o,"outOfRange"),u=this.pointSize+this.blurSize,c=this.canvas,d=c.getContext("2d"),h=t.length;c.width=e,c.height=n;for(var p=0;p<h;++p){var f=t[p],g=f[0],y=f[1],m=i(f[2]);
- // draw with the circle brush with alpha
- d.globalAlpha=m,d.drawImage(a,g-u,y-u)}if(!c.width||!c.height)
- // Avoid "Uncaught DOMException: Failed to execute 'getImageData' on
- // 'CanvasRenderingContext2D': The source height is 0."
- return c;
- // colorize the canvas using alpha value and set with gradient
- for(var v=d.getImageData(0,0,c.width,c.height),x=v.data,_=0,b=x.length,S=this.minOpacity,w=this.maxOpacity-S;_<b;){m=x[_+3]/256;var M=4*Math.floor(255*m);
- // Simple optimize to ignore the empty data
- if(m>0){var I=r(m)?s:l;
- // Any alpha > 0 will be mapped to [minOpacity, maxOpacity]
- m>0&&(m=m*w+S),x[_++]=I[M],x[_++]=I[M+1],x[_++]=I[M+2],x[_++]=I[M+3]*m*256}else _+=4}return d.putImageData(v,0,0),c},
- /**
- * get canvas of a black circle brush used for canvas to draw later
- */
- t.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=gt.createCanvas()),e=this.pointSize+this.blurSize,n=2*e;
- // set brush size
- t.width=n,t.height=n;var i=t.getContext("2d");return i.clearRect(0,0,n,n),
- // in order to render shadow without the distinct circle,
- // draw the distinct circle in an invisible place,
- // and use shadowOffset to draw shadow in the center of the canvas
- i.shadowOffsetX=n,i.shadowBlur=this.blurSize,
- // draw the shadow in black, and use alpha and shadow blur to generate
- // color in color map
- i.shadowColor="#000",
- // draw circle in the left to the canvas
- i.beginPath(),i.arc(-e,e,this.pointSize,0,2*Math.PI,!0),i.closePath(),i.fill(),t},
- /**
- * get gradient color map
- * @private
- */
- t.prototype._getGradient=function(t,e){for(var n=this._gradientPixels,i=n[e]||(n[e]=new Uint8ClampedArray(1024)),o=[0,0,0,0],r=0,a=0;a<256;a++)t[e](a/255,!0,o),i[r++]=o[0],i[r++]=o[1],i[r++]=o[2],i[r++]=o[3];return i},t}();const pD=hD;function fD(t){var e=t.dimensions;
- // Not use coordSys.type === 'geo' because coordSys maybe extended
- return"lng"===e[0]&&"lat"===e[1]}var gD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i;e.eachComponent("visualMap",(function(e){e.eachTargetSeries((function(n){n===t&&(i=e)}))})),
- // Clear previously rendered progressive elements.
- this._progressiveEls=null,this.group.removeAll();var o=t.coordinateSystem;"cartesian2d"===o.type||"calendar"===o.type?this._renderOnCartesianAndCalendar(t,n,0,t.getData().count()):fD(o)&&this._renderOnGeo(o,t,i,n)},e.prototype.incrementalPrepareRender=function(t,e,n){this.group.removeAll()},e.prototype.incrementalRender=function(t,e,n,i){var o=e.coordinateSystem;o&&(
- // geo does not support incremental rendering?
- fD(o)?this.render(e,n,i):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(e,i,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){Bo(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,e,n,i,o){var r,a,s,l,u=t.coordinateSystem,c=oy(u,"cartesian2d");if(c){var d=u.getAxis("x"),h=u.getAxis("y");
- // add 0.5px to avoid the gaps
- r=d.getBandWidth()+.5,a=h.getBandWidth()+.5,s=d.scale.getExtent(),l=h.scale.getExtent()}for(var p=this.group,f=t.getData(),g=t.getModel(["emphasis","itemStyle"]).getItemStyle(),y=t.getModel(["blur","itemStyle"]).getItemStyle(),m=t.getModel(["select","itemStyle"]).getItemStyle(),v=t.get(["itemStyle","borderRadius"]),x=Uo(t),_=t.getModel("emphasis"),b=_.get("focus"),S=_.get("blurScope"),w=_.get("disabled"),M=c?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],I=n;I<i;I++){var D=void 0,T=f.getItemVisual(I,"style");if(c){var C=f.get(M[0],I),A=f.get(M[1],I);
- // Ignore empty data and out of extent data
- if(isNaN(f.get(M[2],I))||isNaN(C)||isNaN(A)||C<s[0]||C>s[1]||A<l[0]||A>l[1])continue;var L=u.dataToPoint([C,A]);D=new G({shape:{x:L[0]-r/2,y:L[1]-a/2,width:r,height:a},style:T})}else{
- // Ignore empty data
- if(isNaN(f.get(M[1],I)))continue;D=new G({z2:1,shape:u.dataToRect([f.get(M[0],I)]).contentShape,style:T})}
- // Optimization for large dataset
- if(f.hasItemOption){var k=f.getItemModel(I),P=k.getModel("emphasis");g=P.getModel("itemStyle").getItemStyle(),y=k.getModel(["blur","itemStyle"]).getItemStyle(),m=k.getModel(["select","itemStyle"]).getItemStyle(),
- // Each item value struct in the data would be firstly
- // {
- // itemStyle: { borderRadius: [30, 30] },
- // value: [2022, 02, 22]
- // }
- v=k.get(["itemStyle","borderRadius"]),b=P.get("focus"),S=P.get("blurScope"),w=P.get("disabled"),x=Uo(k)}D.shape.r=v;var N=t.getRawValue(I),O="-";N&&null!=N[2]&&(O=N[2]+""),Yo(D,x,{labelFetcher:t,labelDataIndex:I,defaultOpacity:T.opacity,defaultText:O}),D.ensureState("emphasis").style=g,D.ensureState("blur").style=y,D.ensureState("select").style=m,Ui(D,b,S,w),D.incremental=o,
- // PENDING
- o&&(
- // Rect must use hover layer if it's incremental.
- D.states.emphasis.hoverLayer=!0),p.add(D),f.setItemGraphicEl(I,D),this._progressiveEls&&this._progressiveEls.push(D)}},e.prototype._renderOnGeo=function(t,e,i,o){var r=i.targetVisuals.inRange,a=i.targetVisuals.outOfRange,s=e.getData(),l=this._hmLayer||this._hmLayer||new pD;l.blurSize=e.get("blurSize"),l.pointSize=e.get("pointSize"),l.minOpacity=e.get("minOpacity"),l.maxOpacity=e.get("maxOpacity");var u=t.getViewRect().clone(),c=t.getRoamTransform();u.applyTransform(c);
- // Clamp on viewport
- var d=Math.max(u.x,0),h=Math.max(u.y,0),p=Math.min(u.width+u.x,o.getWidth()),f=Math.min(u.height+u.y,o.getHeight()),g=p-d,y=f-h,m=[s.mapDimension("lng"),s.mapDimension("lat"),s.mapDimension("value")],v=s.mapArray(m,(function(e,n,i){var o=t.dataToPoint([e,n]);return o[0]-=d,o[1]-=h,o.push(i),o})),x=i.getExtent(),_="visualMap.continuous"===i.type?function(t,e){var n=t[1]-t[0];return e=[(e[0]-t[0])/n,(e[1]-t[0])/n],function(t){return t>=e[0]&&t<=e[1]}}(x,i.option.range):function(t,e,i){var o=t[1]-t[0],r=(e=n(e,(function(e){return{interval:[(e.interval[0]-t[0])/o,(e.interval[1]-t[0])/o]}}))).length,a=0;return function(t){var n;
- // Try to find in the location of the last found
- for(n=a;n<r;n++)if((o=e[n].interval)[0]<=t&&t<=o[1]){a=n;break}if(n===r)
- // Not found, back interation
- for(n=a-1;n>=0;n--){var o;if((o=e[n].interval)[0]<=t&&t<=o[1]){a=n;break}}return n>=0&&n<r&&i[n]}}(x,i.getPieceList(),i.option.selected);l.update(v,g,y,r.color.getNormalizer(),{inRange:r.color.getColorMapper(),outOfRange:a.color.getColorMapper()},_);var S=new b({style:{width:g,height:y,x:d,y:h,image:l.canvas},silent:!0});this.group.add(S)},e.type="heatmap",e}(Ou);const yD=gD;const mD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.getInitialData=function(t,e){return Jh(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=fs.get(this.get("coordinateSystem"));if(t&&t.dimensions)return"lng"===t.dimensions[0]&&"lat"===t.dimensions[1]},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",
- // zlevel: 0,
- z:2,
- // Cartesian coordinate system
- // xAxisIndex: 0,
- // yAxisIndex: 0,
- // Geo coordinate system
- geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}(Su);var vD=["itemStyle","borderWidth"],xD=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],_D=new O;
- // index: +isHorizontal
- // Set or calculate default value about symbol, and calculate layout info.
- function bD(t,e,n,o){var r=t.getItemLayout(e),a=n.get("symbolRepeat"),s=n.get("symbolClip"),l=n.get("symbolPosition")||"start",u=(n.get("symbolRotate")||0)*Math.PI/180||0,c=n.get("symbolPatternSize")||2,d=n.isAnimationEnabled(),h={dataIndex:e,layout:r,itemModel:n,symbolType:t.getItemVisual(e,"symbol")||"circle",style:t.getItemVisual(e,"style"),symbolClip:s,symbolRepeat:a,symbolRepeatDirection:n.get("symbolRepeatDirection"),symbolPatternSize:c,rotation:u,animationModel:d?n:null,hoverScale:d&&n.get(["emphasis","scale"]),z2:n.getShallow("z",!0)||0};!
- // bar length can be negative.
- function(t,e,n,o,r){var a,s=o.valueDim,l=t.get("symbolBoundingData"),u=o.coordSys.getOtherAxis(o.coordSys.getBaseAxis()),c=u.toGlobalCoord(u.dataToCoord(0)),d=1-+(n[s.wh]<=0);if(i(l)){var h=[SD(u,l[0])-c,SD(u,l[1])-c];h[1]<h[0]&&h.reverse(),a=h[d]}else a=null!=l?SD(u,l)-c:e?o.coordSysExtent[s.index][d]-c:n[s.wh];r.boundingLength=a,e&&(r.repeatCutLength=n[s.wh]);
- // if 'pxSign' means sign of pixel, it can't be zero, or symbolScale will be zero
- // and when borderWidth be settled, the actual linewidth will be NaN
- var p="x"===s.xy,f=u.inverse;r.pxSign=p&&!f||!p&&f?a>=0?1:-1:a>0?1:-1}(n,a,r,o,h),
- // Support ['100%', '100%']
- function(t,e,n,o,r,a,s,l,u,c){var d,h=u.valueDim,p=u.categoryDim,f=Math.abs(n[p.wh]),g=t.getItemVisual(e,"symbolSize");d=i(g)?g.slice():null==g?["100%","100%"]:[g,g];
- // Note: percentage symbolSize (like '100%') do not consider lineWidth, because it is
- // to complicated to calculate real percent value if considering scaled lineWidth.
- // So the actual size will bigger than layout size if lineWidth is bigger than zero,
- // which can be tolerated in pictorial chart.
- d[p.index]=je(d[p.index],f),d[h.index]=je(d[h.index],o?f:Math.abs(a)),c.symbolSize=d;
- // If x or y is less than zero, show reversed shape.
- var y=c.symbolScale=[d[0]/l,d[1]/l];
- // Follow convention, 'right' and 'top' is the normal scale.
- y[h.index]*=(u.isHorizontal?-1:1)*s}(t,e,r,a,0,h.boundingLength,h.pxSign,c,o,h),function(t,e,n,i,o){
- // In symbols are drawn with scale, so do not need to care about the case that width
- // or height are too small. But symbol use strokeNoScale, where acture lineWidth should
- // be calculated.
- var r=t.get(vD)||0;r&&(_D.attr({scaleX:e[0],scaleY:e[1],rotation:n}),_D.updateTransform(),r/=_D.getLineScale(),r*=e[i.valueDim.index]);o.valueLineWidth=r||0}(n,h.symbolScale,u,o,h);var f=h.symbolSize,g=Wc(n.get("symbolOffset"),f);return function(t,e,n,i,o,r,a,s,l,u,c,d){var h=c.categoryDim,f=c.valueDim,g=d.pxSign,y=Math.max(e[f.index]+s,0),m=y;
- // Note: rotation will not effect the layout of symbols, because user may
- // want symbols to rotate on its center, which should not be translated
- // when rotating.
- if(i){var v=Math.abs(l),x=Yt(t.get("symbolMargin"),"15%")+"",_=!1;x.lastIndexOf("!")===x.length-1&&(_=!0,x=x.slice(0,x.length-1));var b=je(x,e[f.index]),S=Math.max(y+2*b,0),w=_?0:2*b,M=fn(i),I=M?i:VD((v+w)/S);S=y+2*(b=(v-I*y)/2/(_?I:Math.max(I-1,1))),w=_?0:2*b,
- // Update repeatTimes when not all symbol will be shown.
- M||"fixed"===i||(I=u?VD((Math.abs(u)+w)/S):0),m=I*S-w,d.repeatTimes=I,d.symbolMargin=b}var D=g*(m/2),T=d.pathPosition=[];// 'center'
- T[h.index]=n[h.wh]/2,T[f.index]="start"===a?D:"end"===a?l-D:l/2,r&&(T[0]+=r[0],T[1]+=r[1]);var C=d.bundlePosition=[];C[h.index]=n[h.xy],C[f.index]=n[f.xy];var A=d.barRectShape=p({},n);A[f.wh]=g*Math.max(Math.abs(n[f.wh]),Math.abs(T[f.index]+D)),A[h.wh]=n[h.wh];var L=d.clipShape={};
- // Consider that symbol may be overflow layout rect.
- L[h.xy]=-n[h.xy],L[h.wh]=c.ecSize[h.wh],L[f.xy]=0,L[f.wh]=n[f.wh]}(n,f,r,a,0,g,l,h.valueLineWidth,h.boundingLength,h.repeatCutLength,o,h),h}function SD(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function wD(t){var e=t.symbolPatternSize,n=Gc(
- // Consider texture img, make a big size.
- t.symbolType,-e/2,-e/2,e,e);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function MD(t,e,n,i){var o=t.__pictorialBundle,r=n.symbolSize,a=n.valueLineWidth,s=n.pathPosition,l=e.valueDim,u=n.repeatTimes||0,c=0,d=r[e.valueDim.index]+a+2*n.symbolMargin;for(OD(t,(function(t){t.__pictorialAnimationIndex=c,t.__pictorialRepeatTimes=u,c<u?RD(t,null,f(c),n,i):RD(t,null,{scaleX:0,scaleY:0},n,i,(function(){o.remove(t)})),
- // updateHoverAnimation(path, symbolMeta);
- c++}));c<u;c++){var h=wD(n);h.__pictorialAnimationIndex=c,h.__pictorialRepeatTimes=u,o.add(h);var p=f(c);RD(h,{x:p.x,y:p.y,scaleX:0,scaleY:0},{scaleX:p.scaleX,scaleY:p.scaleY,rotation:p.rotation},n,i)}function f(t){var e=s.slice(),i=n.pxSign,o=t;
- // (start && pxSign > 0) || (end && pxSign < 0): i = repeatTimes - index
- // Otherwise: i = index;
- return("start"===n.symbolRepeatDirection?i>0:i<0)&&(o=u-1-t),e[l.index]=d*(o-u/2+.5)+s[l.index],{x:e[0],y:e[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function ID(t,e,n,i){var o=t.__pictorialBundle,r=t.__pictorialMainPath;r?RD(r,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,i):(r=t.__pictorialMainPath=wD(n),o.add(r),RD(r,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,i))}
- // bar rect is used for label.
- function DD(t,e,n){var i=p({},e.barRectShape),o=t.__pictorialBarRect;o?RD(o,null,{shape:i},e,n):((o=t.__pictorialBarRect=new G({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}})).disableMorphing=!0,t.add(o))}function TD(t,e,n,i){
- // If not clip, symbol will be remove and rebuilt.
- if(n.symbolClip){var o=t.__pictorialClipPath,r=p({},n.clipShape),a=e.valueDim,s=n.animationModel,l=n.dataIndex;if(o)io(o,{shape:r},s,l);else{r[a.wh]=0,o=new G({shape:r}),t.__pictorialBundle.setClipPath(o),t.__pictorialClipPath=o;var u={};u[a.wh]=n.clipShape[a.wh],Go[i?"updateProps":"initProps"](o,{shape:u},s,l)}}}function CD(t,e){var n=t.getItemModel(e);return n.getAnimationDelayParams=AD,n.isAnimationEnabled=LD,n}function AD(t){
- // The order is the same as the z-order, see `symbolRepeatDiretion`.
- return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function LD(){
- // `animation` prop can be set on itemModel in pictorial bar chart.
- return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function kD(t,e,n,i){
- // bar is the main element for each data.
- var o=new Z,r=new Z;
- // bundle is used for location and clip.
- return o.add(r),o.__pictorialBundle=r,r.x=n.bundlePosition[0],r.y=n.bundlePosition[1],n.symbolRepeat?MD(o,e,n):ID(o,0,n),DD(o,n,i),TD(o,e,n,i),o.__pictorialShapeStr=ND(t,n),o.__pictorialSymbolMeta=n,o}function PD(t,e,n,i){
- // Not show text when animating
- var o=i.__pictorialBarRect;o&&o.removeTextContent();var r=[];OD(i,(function(t){r.push(t)})),i.__pictorialMainPath&&r.push(i.__pictorialMainPath),
- // I do not find proper remove animation for clip yet.
- i.__pictorialClipPath&&(n=null),a(r,(function(t){ao(t,{scaleX:0,scaleY:0},n,e,(function(){i.parent&&i.parent.remove(i)}))})),t.setItemGraphicEl(e,null)}function ND(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function OD(t,e,n){
- // Do not use Group#eachChild, because it do not support remove.
- a(t.__pictorialBundle.children(),(function(i){i!==t.__pictorialBarRect&&e.call(n,i)}))}function RD(t,e,n,i,o,r){e&&t.attr(e),
- // when symbolCip used, only clip path has init animation, otherwise it would be weird effect.
- i.symbolClip&&!o?n&&t.attr(n):n&&Go[o?"updateProps":"initProps"](t,n,i.animationModel,i.dataIndex,r)}function ED(t,e,n){var i=n.dataIndex,o=n.itemModel,r=o.getModel("emphasis"),a=r.getModel("itemStyle").getItemStyle(),s=o.getModel(["blur","itemStyle"]).getItemStyle(),l=o.getModel(["select","itemStyle"]).getItemStyle(),u=o.getShallow("cursor"),c=r.get("focus"),d=r.get("blurScope"),h=r.get("scale");OD(t,(function(t){if(t instanceof b){var e=t.style;t.useStyle(p({
- // TODO other properties like dx, dy ?
- image:e.image,x:e.x,y:e.y,width:e.width,height:e.height},n.style))}else t.useStyle(n.style);var i=t.ensureState("emphasis");i.style=a,h&&(
- // NOTE: Must after scale is set after updateAttr
- i.scaleX=1.1*t.scaleX,i.scaleY=1.1*t.scaleY),t.ensureState("blur").style=s,t.ensureState("select").style=l,u&&(t.cursor=u),t.z2=n.z2}));var f=e.valueDim.posDesc[+(n.boundingLength>0)],g=t.__pictorialBarRect;g.ignoreClip=!0,Yo(g,Uo(o),{labelFetcher:e.seriesModel,labelDataIndex:i,defaultText:Rg(e.seriesModel.getData(),i),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:f}),Ui(t,c,d,r.get("disabled"))}function VD(t){var e=Math.round(t);
- // Escapse accurate error
- return Math.abs(t-e)<1e-4?e:Math.ceil(t)}const zD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=this.group,o=t.getData(),r=this._data,a=t.coordinateSystem,s=a.getBaseAxis().isHorizontal(),l=a.master.getRect(),u={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:t,coordSys:a,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:s,valueDim:xD[+s],categoryDim:xD[1-+s]};o.diff(r).add((function(t){if(o.hasValue(t)){var e=CD(o,t),n=bD(o,t,e,u),r=kD(o,u,n);o.setItemGraphicEl(t,r),i.add(r),ED(r,u,n)}})).update((function(t,e){var n=r.getItemGraphicEl(e);if(o.hasValue(t)){var a=CD(o,t),s=bD(o,t,a,u),l=ND(o,s);n&&l!==n.__pictorialShapeStr&&(i.remove(n),o.setItemGraphicEl(t,null),n=null),n?function(t,e,n){var i=n.animationModel,o=n.dataIndex,r=t.__pictorialBundle;io(r,{x:n.bundlePosition[0],y:n.bundlePosition[1]},i,o),n.symbolRepeat?MD(t,e,n,!0):ID(t,e,n,!0);DD(t,n,!0),TD(t,e,n,!0)}(n,u,s):n=kD(o,u,s,!0),o.setItemGraphicEl(t,n),n.__pictorialSymbolMeta=s,
- // Add back
- i.add(n),ED(n,u,s)}else i.remove(n)})).remove((function(t){var e=r.getItemGraphicEl(t);e&&PD(r,t,e.__pictorialSymbolMeta.animationModel,e)})).execute();
- // Do clipping
- var c=t.get("clip",!0)?iy(t.coordinateSystem,!1,t):null;return c?i.setClipPath(c):i.removeClipPath(),this._data=o,this.group},e.prototype.remove=function(t,e){var n=this.group,i=this._data;t.get("animation")?i&&i.eachItemGraphicEl((function(e){PD(i,ni(e).dataIndex,t,e)})):n.removeAll()},e.type="pictorialBar",e}(Ou);const BD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n.defaultSymbol="roundRect",n}return Ue(e,t),e.prototype.getInitialData=function(e){
- // Disable stack.
- return e.stack=null,t.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=xr(Sy.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%",
- // Pictorial bar do not clip by default because in many cases
- // xAxis and yAxis are not displayed and it's expected not to clip
- clip:!1,
- // z can be set in data item, which is z2 actually.
- // Disable progressive
- progressive:0,emphasis:{
- // By default pictorialBar do not hover scale. Hover scale is not suitable
- // for the case that both has foreground and background.
- scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(Sy);var GD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._layers=[],n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),o=this,r=this.group,a=t.getLayerSeries(),s=i.getLayout("layoutInfo"),l=s.rect,u=s.boundaryGap;function c(t){return t.name}r.x=0,r.y=l.y+u[0];var d=new yh(this._layersSeries||[],a,c,c),h=[];function p(e,n,s){var l=o._layers;if("remove"!==e){for(var u,c,d=[],p=[],f=a[n].indices,g=0;g<f.length;g++){var y=i.getItemLayout(f[g]),m=y.x,v=y.y0,x=y.y;d.push(m,v),p.push(m,v+x),u=i.getItemVisual(f[g],"style")}var _=i.getItemLayout(f[0]),b=t.getModel("label").get("margin"),S=t.getModel("emphasis");if("add"===e){var w=h[n]=new Z;c=new ty({shape:{points:d,stackedOnPoints:p,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),w.add(c),r.add(w),t.isAnimationEnabled()&&c.setClipPath(
- // add animation to the view
- function(t,e,n){var i=new G({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return oo(i,{shape:{x:t.x-50,width:t.width+100,height:t.height+20}},e,n),i}(c.getBoundingRect(),t,(function(){c.removeClipPath()})))}else{w=l[s];c=w.childAt(0),r.add(w),h[n]=w,io(c,{shape:{points:d,stackedOnPoints:p}},t),uo(c)}Yo(c,Uo(t),{labelDataIndex:f[g-1],defaultText:i.getName(f[g-1]),inheritColor:u.fill},{normal:{verticalAlign:"middle"}}),c.setTextConfig({position:null,local:!0});var M=c.getTextContent();
- // TODO More label position options.
- M&&(M.x=_.x-b,M.y=_.y0+_.y/2),c.useStyle(u),i.setItemGraphicEl(n,c),qi(c,t),Ui(c,S.get("focus"),S.get("blurScope"),S.get("disabled"))}else r.remove(l[n])}d.add(lt(p,this,"add")).update(lt(p,this,"update")).remove(lt(p,this,"remove")).execute(),this._layersSeries=a,this._layers=h},e.type="themeRiver",e}(Ou);const FD=GD;var WD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}
- /**
- * @override
- */return Ue(e,t),e.prototype.init=function(e){
- // eslint-disable-next-line
- t.prototype.init.apply(this,arguments),
- // Put this function here is for the sake of consistency of code style.
- // Enable legend selection for each data item
- // Use a function instead of direct access because data reference may changed
- this.legendVisualProvider=new dm(lt(this.getData,this),lt(this.getRawData,this))},
- /**
- * If there is no value of a certain point in the time for some event,set it value to 0.
- *
- * @param {Array} data initial data in the option
- * @return {Array}
- */
- e.prototype.fixData=function(t){var e=t.length,n={},i=Wn(t,(function(t){return n.hasOwnProperty(t[0]+"")||(n[t[0]+""]=-1),t[2]})),o=[];
- /**
- * Make sure every layer data get the same keys.
- * The value index tells which layer has visited.
- * {
- * 2014/01/01: -1
- * }
- */i.buckets.each((function(t,e){o.push({name:e,dataList:t})}));for(var r=o.length,a=0;a<r;++a){for(var s=o[a].name,l=0;l<o[a].dataList.length;++l){var u=o[a].dataList[l][0]+"";n[u]=a}for(var u in n)n.hasOwnProperty(u)&&n[u]!==a&&(n[u]=a,t[e]=[u,0,s],e++)}return t},
- /**
- * @override
- * @param option the initial option that user gave
- * @param ecModel the model object for themeRiver option
- */
- e.prototype.getInitialData=function(t,e){for(var n=this.getReferringComponents("singleAxis",zn).models[0].get("type"),i=st(t.data,(function(t){return void 0!==t[2]})),o=this.fixData(i||[]),a=[],s=this.nameMap=r(),l=0,u=0;u<o.length;++u)a.push(o[u][2]),s.get(o[u][2])||(s.set(o[u][2],l),l++);var c=Hh(o,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:xh(n)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}).dimensions,d=new Fh(c,this);return d.initData(o),d},
- /**
- * The raw data is divided into multiple layers and each layer
- * has same name.
- */
- e.prototype.getLayerSeries=function(){for(var t=this.getData(),e=t.count(),n=[],i=0;i<e;++i)n[i]=i;var o=t.mapDimension("single"),r=Wn(n,(function(e){return t.get("name",e)})),a=[];
- // data group by name
- return r.buckets.each((function(e,n){e.sort((function(e,n){return t.get(o,e)-t.get(o,n)})),a.push({name:n,indices:e})})),a},
- /**
- * Get data indices for show tooltip content
- */
- e.prototype.getAxisTooltipData=function(t,e,n){i(t)||(t=t?[t]:[]);for(var o,r=this.getData(),a=this.getLayerSeries(),s=[],l=a.length,u=0;u<l;++u){for(var c=Number.MAX_VALUE,d=-1,h=a[u].indices.length,p=0;p<h;++p){var f=r.get(t[0],a[u].indices[p]),g=Math.abs(f-e);g<=c&&(o=f,c=g,d=a[u].indices[p])}s.push(d)}return{dataIndices:s,nestestValue:o}},e.prototype.formatTooltip=function(t,e,n){var i=this.getData();return $l("nameValue",{name:i.getName(t),value:i.get(i.mapDimension("value"),t)})},e.type="series.themeRiver",e.dependencies=["singleAxis"],e.defaultOption={
- // zlevel: 0,
- z:2,colorBy:"data",coordinateSystem:"singleAxis",
- // gap in axis's orthogonal orientation
- boundaryGap:["10%","10%"],
- // legendHoverLink: true,
- singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",fontSize:11},emphasis:{label:{show:!0}}},e}(Su);const HD=WD;function YD(t,e){t.eachSeriesByType("themeRiver",(function(t){var e=t.getData(),n=t.coordinateSystem,i={},o=n.getRect();i.rect=o;var r=t.get("boundaryGap"),a=n.getAxis();(i.boundaryGap=r,"horizontal"===a.orient)?(r[0]=je(r[0],o.height),r[1]=je(r[1],o.height),UD(e,t,o.height-r[0]-r[1])):(r[0]=je(r[0],o.width),r[1]=je(r[1],o.width),UD(e,t,o.width-r[0]-r[1]));e.setLayout("layoutInfo",i)}))}
- /**
- * The layout information about themeriver
- *
- * @param data data in the series
- * @param seriesModel the model object of themeRiver series
- * @param height value used to compute every series height
- */function UD(t,e,i){if(t.count())for(var o,r=e.coordinateSystem,a=e.getLayerSeries(),s=t.mapDimension("single"),l=t.mapDimension("value"),u=n(a,(function(e){return n(e.indices,(function(e){var n=r.dataToPoint(t.get(s,e));return n[1]=t.get(l,e),n}))})),c=
- /**
- * Compute the baseLine of the rawdata
- * Inspired by Lee Byron's paper Stacked Graphs - Geometry & Aesthetics
- *
- * @param data the points in each layer
- */
- function(t){for(var e=t.length,n=t[0].length,i=[],o=[],r=0,a=0;a<n;++a){for(var s=0,l=0;l<e;++l)s+=t[l][a][1];s>r&&(r=s),i.push(s)}for(var u=0;u<n;++u)o[u]=(r-i[u])/2;r=0;for(var c=0;c<n;++c){var d=i[c]+o[c];d>r&&(r=d)}return{y0:o,max:r}}(u),d=c.y0,h=i/c.max,p=a.length,f=a[0].indices.length,g=0
- // the data in each layer are organized into a series.
- ;g<f;++g){o=d[g]*h,t.setItemLayout(a[0].indices[g],{layerIndex:0,x:u[0][g][0],y0:o,y:u[0][g][1]*h});for(var y=1;y<p;++y)o+=u[y-1][g][1]*h,t.setItemLayout(a[y].indices[g],{layerIndex:y,x:u[y][g][0],y0:o,y:u[y][g][1]*h})}}var ZD=/** @class */function(t){function e(e,n,i,o){var r=t.call(this)||this;r.z2=2,r.textConfig={inside:!0},ni(r).seriesIndex=n.seriesIndex;var a=new $({z2:4,silent:e.getModel().get(["label","silent"])});return r.setTextContent(a),r.updateData(!0,e,n,i,o),r}return Ue(e,t),e.prototype.updateData=function(t,e,
- // state: 'emphasis' | 'normal' | 'highlight' | 'downplay',
- n,i,o){this.node=e,e.piece=this,n=n||this._seriesModel,i=i||this._ecModel;var r=this;ni(r).dataIndex=e.dataIndex;var s=e.getModel(),l=s.getModel("emphasis"),u=e.getLayout(),c=p({},u);c.label=null;var d=e.getVisual("style");d.lineJoin="bevel";var h=e.getVisual("decal");h&&(d.decal=Zc(h,o));var f=Ay(s.getModel("itemStyle"),c,!0);p(c,f),a(li,(function(t){var e=r.ensureState(t),n=s.getModel([t,"itemStyle"]);e.style=n.getItemStyle();
- // border radius
- var i=Ay(n,c);i&&(e.shape=i)})),t?(r.setShape(c),r.shape.r=u.r0,oo(r,{shape:{r:u.r}},n,e.dataIndex)):(
- // Disable animation for gradient since no interpolation method
- // is supported for gradient
- io(r,{shape:c},n),uo(r)),r.useStyle(d),this._updateLabel(n);var g=s.getShallow("cursor");g&&r.attr("cursor",g),this._seriesModel=n||this._seriesModel,this._ecModel=i||this._ecModel;var y=l.get("focus");Ui(this,"relative"===y?ct(e.getAncestorsIndices(),e.getDescendantIndices()):"ancestor"===y?e.getAncestorsIndices():"descendant"===y?e.getDescendantIndices():y,l.get("blurScope"),l.get("disabled"))},e.prototype._updateLabel=function(t){var e=this,n=this.node.getModel(),i=n.getModel("label"),o=this.node.getLayout(),r=o.endAngle-o.startAngle,s=(o.startAngle+o.endAngle)/2,u=Math.cos(s),c=Math.sin(s),d=this,h=d.getTextContent(),p=this.node.dataIndex,f=i.get("minAngle")/180*Math.PI,g=i.get("show")&&!(null!=f&&Math.abs(r)<f);function y(t,e){var n=t.get(e);return null==n?i.get(e):n}h.ignore=!g,
- // TODO use setLabelStyle
- a(ui,(function(i){var a="normal"===i?n.getModel("label"):n.getModel([i,"label"]),f="normal"===i,g=f?h:h.ensureState(i),m=t.getFormattedLabel(p,i);f&&(m=m||e.node.name),g.style=Zo(a,{},null,"normal"!==i,!0),m&&(g.style.text=m);
- // Not displaying text when angle is too small
- var v=a.get("show");null==v||f||(g.ignore=!v);var x,_=y(a,"position"),b=f?d:d.states[i],S=b.style.fill;b.textConfig={outsideFill:"inherit"===a.get("color")?S:null,inside:"outside"!==_};var w=y(a,"distance")||0,M=y(a,"align"),I=y(a,"rotate"),D=.5*Math.PI,T=1.5*Math.PI,C=Et("tangential"===I?Math.PI/2-s:s),A=C>D&&!rn(C-D)&&C<T;"outside"===_?(x=o.r+w,M=A?"right":"left"):M&&"center"!==M?"left"===M?(x=o.r0+w,M=A?"right":"left"):"right"===M&&(x=o.r-w,M=A?"left":"right"):(
- // Put label in the center if it's a circle
- x=r===2*Math.PI&&0===o.r0?0:(o.r+o.r0)/2,M="center"),g.style.align=M,g.style.verticalAlign=y(a,"verticalAlign")||"middle",g.x=x*u+o.cx,g.y=x*c+o.cy;var L=0;"radial"===I?L=Et(-s)+(A?Math.PI:0):"tangential"===I?L=Et(Math.PI/2-s)+(A?Math.PI:0):l(I)&&(L=I*Math.PI/180),g.rotation=Et(L)})),h.dirtyStyle()},e}(E);const XD=ZD;var jD="sunburstRootToNode",qD="sunburstHighlight";var KD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n,
- // @ts-ignore
- i){var o=this;this.seriesModel=t,this.api=n,this.ecModel=e;var r=t.getData(),a=r.tree.root,s=t.getViewRoot(),l=this.group,u=t.get("renderLabelForZeroData"),c=[];s.eachNode((function(t){c.push(t)}));var d=this._oldChildren||[];!function(i,o){if(0===i.length&&0===o.length)return;function s(t){return t.getId()}function c(s,c){!function(i,o){u||!i||i.getValue()||(
- // Not render data with value 0
- i=null);if(i!==a&&o!==a)if(o&&o.piece)i?(
- // Update
- o.piece.updateData(!1,i,t,e,n),
- // For tooltip
- r.setItemGraphicEl(i.dataIndex,o.piece)):
- // Remove
- function(t){if(!t)return;t.piece&&(l.remove(t.piece),t.piece=null)}(o);else if(i){
- // Add
- var s=new XD(i,t,e,n);l.add(s),
- // For tooltip
- r.setItemGraphicEl(i.dataIndex,s)}}(null==s?null:i[s],null==c?null:o[c])}new yh(o,i,s,s).add(c).update(c).remove(rt(c,null)).execute()}(c,d),function(i,r){r.depth>0?(
- // Render
- o.virtualPiece?
- // Update
- o.virtualPiece.updateData(!1,i,t,e,n):(
- // Add
- o.virtualPiece=new XD(i,t,e,n),l.add(o.virtualPiece)),
- // TODO event scope
- r.piece.off("click"),o.virtualPiece.on("click",(function(t){o._rootToNode(r.parentNode)}))):o.virtualPiece&&(
- // Remove
- l.remove(o.virtualPiece),o.virtualPiece=null)}(a,s),this._initEvents(),this._oldChildren=c},
- /**
- * @private
- */
- e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",(function(e){var n=!1;t.seriesModel.getViewRoot().eachNode((function(i){if(!n&&i.piece&&i.piece===e.target){var o=i.getModel().get("nodeClick");if("rootToNode"===o)t._rootToNode(i);else if("link"===o){var r=i.getModel(),a=r.get("link");if(a)pa(a,r.get("target",!0)||"_blank")}n=!0}}))}))},
- /**
- * @private
- */
- e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:jD,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},
- /**
- * @implement
- */
- e.prototype.containPoint=function(t,e){var n=e.getData().getItemLayout(0);if(n){var i=t[0]-n.cx,o=t[1]-n.cy,r=Math.sqrt(i*i+o*o);return r<=n.r&&r>=n.r0}},e.type="sunburst",e}(Ou);const JD=KD;function $D(t){
- // Postorder travel tree.
- // If value of none-leaf node is not set,
- // calculate it by suming up the value of all children.
- var e=0;a(t.children,(function(t){$D(t);var n=t.value;
- // TODO First value of array must be a number
- i(n)&&(n=n[0]),e+=n}));var n=t.value;i(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),
- // Value should not less than 0.
- n<0&&(n=0),i(t.value)?t.value[0]=n:t.value=n}const QD=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.ignoreStyleOnData=!0,n}return Ue(e,t),e.prototype.getInitialData=function(t,e){
- // Create a virtual root.
- var i={name:t.name,children:t.data};$D(i);var o=this._levelModels=n(t.levels||[],(function(t){return new yr(t,this,e)}),this),r=C_.createTree(i,this,(function(t){t.wrapMethod("getItemModel",(function(t,e){var n=r.getNodeByDataIndex(e),i=o[n.depth];return i&&(t.parentModel=i),t}))}));
- // Make sure always a new tree is created when setOption,
- // in TreemapView, we check whether oldTree === newTree
- // to choose mappings approach among old shapes and new shapes.
- return r.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},
- /*
- * @override
- */
- e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treePathInfo=P_(i,this),n},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){B_(this)},e.type="series.sunburst",e.defaultOption={
- // zlevel: 0,
- z:2,
- // 默认全局居中
- center:["50%","50%"],radius:[0,"75%"],
- // 默认顺时针
- clockwise:!0,startAngle:90,
- // 最小角度改为0
- minAngle:0,
- // If still show when all data zero.
- stillShowZeroSum:!0,
- // 'rootToNode', 'link', or false
- nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{
- // could be: 'radial', 'tangential', or 'none'
- rotate:"radial",show:!0,opacity:1,
- // 'left' is for inner side of inside, and 'right' is for outer
- // side for inside
- align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},
- // Animation type can be expansion, scale.
- animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],
- /**
- * Sort order.
- *
- * Valid values: 'desc', 'asc', null, or callback function.
- * 'desc' and 'asc' for descend and ascendant order;
- * null for not sorting;
- * example of callback function:
- * function(nodeA, nodeB) {
- * return nodeA.getValue() - nodeB.getValue();
- * }
- */
- sort:"desc"},e}(Su);
- // let PI2 = Math.PI * 2;
- var tT=Math.PI/180;function eT(t,e,n){e.eachSeriesByType(t,(function(t){var e=t.get("center"),o=t.get("radius");i(o)||(o=[0,o]),i(e)||(e=[e,e]);var r=n.getWidth(),s=n.getHeight(),l=Math.min(r,s),u=je(e[0],r),c=je(e[1],s),d=je(o[0],l/2),h=je(o[1],l/2),p=-t.get("startAngle")*tT,f=t.get("minAngle")*tT,g=t.getData().tree.root,y=t.getViewRoot(),m=y.depth,v=t.get("sort");null!=v&&nT(y,v);var x=0;a(y.children,(function(t){!isNaN(t.getValue())&&x++}));var _=y.getValue(),b=Math.PI/(_||x)*2,S=y.depth>0,w=y.height-(S?-1:1),M=(h-d)/(w||1),I=t.get("clockwise"),D=t.get("stillShowZeroSum"),T=I?1:-1,C=function(e,n){if(e){var i=n;
- // Render self
- if(e!==g){
- // Tree node is virtual, so it doesn't need to be drawn
- var o=e.getValue(),r=0===_&&D?b:o*b;r<f&&(r=f),
- // else {
- // valueSumLargerThanMinAngle += value;
- // }
- i=n+T*r;var s=e.depth-m-(S?-1:1),h=d+M*s,p=d+M*(s+1),y=t.getLevelModel(e);if(y){var v=y.get("r0",!0),x=y.get("r",!0),w=y.get("radius",!0);null!=w&&(v=w[0],x=w[1]),null!=v&&(h=je(v,l/2)),null!=x&&(p=je(x,l/2))}e.setLayout({angle:r,startAngle:n,endAngle:i,clockwise:I,cx:u,cy:c,r0:h,r:p})}
- // Render children
- if(e.children&&e.children.length){
- // currentAngle = startAngle;
- var A=0;a(e.children,(function(t){A+=C(t,n+A)}))}return i-n}};
- // Sum may be 0
- // Virtual root node for roll up
- if(S){var A=d,L=d+M,k=2*Math.PI;g.setLayout({angle:k,startAngle:p,endAngle:p+k,clockwise:I,cx:u,cy:c,r0:A,r:L})}C(y,p)}))}
- /**
- * Init node children by order and update visual
- */function nT(t,e){var i=t.children||[];t.children=
- /**
- * Sort children nodes
- *
- * @param {TreeNode[]} children children of node to be sorted
- * @param {string | function | null} sort sort method
- * See SunburstSeries.js for details.
- */
- function(t,e){if(f(e)){var i=n(t,(function(t,e){var n=t.getValue();return{params:{depth:t.depth,height:t.height,dataIndex:t.dataIndex,getValue:function(){return n}},index:e}}));return i.sort((function(t,n){return e(t.params,n.params)})),n(i,(function(e){return t[e.index]}))}var o="asc"===e;return t.sort((function(t,e){var n=(t.getValue()-e.getValue())*(o?1:-1);return 0===n?(t.dataIndex-e.dataIndex)*(o?-1:1):n}))}(i,e),
- // Init children recursively
- i.length&&a(t.children,(function(t){nT(t,e)}))}function iT(e){var n={};
- // Default color strategy
- e.eachSeriesByType("sunburst",(function(e){var i=e.getData(),o=i.tree;o.eachNode((function(r){var a=r.getModel().getModel("itemStyle").getItemStyle();a.fill||(a.fill=function(e,i,o){for(
- // Choose color from palette based on the first level.
- var r=e;r&&r.depth>1;)r=r.parentNode;var a=i.getColorFromPalette(r.name||r.dataIndex+"",n);return e.depth>1&&t(a)&&(
- // Lighter on the deeper level.
- a=De(a,(e.depth-1)/(o-1)*.5)),a}(r,e,o.root.height));var s=i.ensureUniqueItemVisual(r.dataIndex,"style");p(s,a)}))}))}
- // Also compat with ec4, where
- // `visual('color') visual('borderColor')` is supported.
- var oT={color:"fill",borderColor:"stroke"},rT={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},aT=On();const sT=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,e){return Jh(null,this)},e.prototype.getDataParams=function(e,n,i){var o=t.prototype.getDataParams.call(this,e,n);return i&&(o.info=aT(i).info),o},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",
- // zlevel: 0,
- z:2,legendHoverLink:!0,
- // Custom series will not clip by default.
- // Some case will use custom series to draw label
- // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight
- clip:!1},e}(Su);function lT(t,e){
- // dataItem is necessary in log axis.
- return e=e||[0,0],n(["x","y"],(function(n,i){var o=this.getAxis(n),r=e[i],a=t[i]/2;return"category"===o.type?o.getBandWidth():Math.abs(o.dataToCoord(r-a)-o.dataToCoord(r+a))}),this)}function uT(t,e){return e=e||[0,0],n([0,1],(function(n){var i=e[n],o=t[n]/2,r=[],a=[];return r[n]=i-o,a[n]=i+o,r[1-n]=a[1-n]=e[1-n],Math.abs(this.dataToPoint(r)[n]-this.dataToPoint(a)[n])}),this)}function cT(t,e){
- // dataItem is necessary in log axis.
- var n=this.getAxis(),i=e instanceof Array?e[0]:e,o=(t instanceof Array?t[0]:t)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-o)-n.dataToCoord(i+o))}
- // import AngleAxis from './AngleAxis.js';
- function dT(t,e){
- // dataItem is necessary in log axis.
- return e=e||[0,0],n(["Radius","Angle"],(function(n,i){var o=this["get"+n+"Axis"](),r=e[i],a=t[i]/2,s="category"===o.type?o.getBandWidth():Math.abs(o.dataToCoord(r-a)-o.dataToCoord(r+a));
- // TODO: TYPE Check Angle Axis
- return"Angle"===n&&(s=s*Math.PI/180),s}),this)}
- /**
- * Whether need to call `convertEC4CompatibleStyle`.
- */
- function hT(t,e,n,i){
- // Since echarts5, `RectText` is separated from its host element and style.text
- // does not exist any more. The compat work brings some extra burden on performance.
- // So we provide:
- // `legacy: true` force make compat.
- // `legacy: false`, force do not compat.
- // `legacy` not set: auto detect whether legacy.
- // But in this case we do not compat (difficult to detect and rare case):
- // Becuse custom series and graphic component support "merge", users may firstly
- // only set `textStrokeWidth` style or secondly only set `text`.
- return t&&(t.legacy||!1!==t.legacy&&!n&&!i&&"tspan"!==e&&("text"===e||N(t,"text")))}
- /**
- * `EC4CompatibleStyle` is style that might be in echarts4 format or echarts5 format.
- * @param hostStyle The properties might be modified.
- * @return If be text el, `textContentStyle` and `textConfig` will not be returned.
- * Otherwise a `textContentStyle` and `textConfig` will be created, whose props area
- * retried from the `hostStyle`.
- */function pT(t,e,n){var i,o,r,s=t;if("text"===e)r=s;else{r={},N(s,"text")&&(r.text=s.text),N(s,"rich")&&(r.rich=s.rich),N(s,"textFill")&&(r.fill=s.textFill),N(s,"textStroke")&&(r.stroke=s.textStroke),N(s,"fontFamily")&&(r.fontFamily=s.fontFamily),N(s,"fontSize")&&(r.fontSize=s.fontSize),N(s,"fontStyle")&&(r.fontStyle=s.fontStyle),N(s,"fontWeight")&&(r.fontWeight=s.fontWeight),o={type:"text",style:r,
- // ec4 does not support rectText trigger.
- // And when text position is different in normal and emphasis
- // => hover text trigger emphasis;
- // => text position changed, leave mouse pointer immediately;
- // That might cause incorrect state.
- silent:!0},i={};var l=N(s,"textPosition");n?i.position=l?s.textPosition:"inside":l&&(i.position=s.textPosition),N(s,"textPosition")&&(i.position=s.textPosition),N(s,"textOffset")&&(i.offset=s.textOffset),N(s,"textRotation")&&(i.rotation=s.textRotation),N(s,"textDistance")&&(i.distance=s.textDistance)}return fT(r,t),a(r.rich,(function(t){fT(t,t)})),{textConfig:i,textContent:o}}
- /**
- * The result will be set to `out`.
- */function fT(t,e){e&&(
- // (1) For simplicity, make textXXX properties (deprecated since ec5) has
- // higher priority. For example, consider in ec4 `borderColor: 5, textBorderColor: 10`
- // on a rect means `borderColor: 4` on the rect and `borderColor: 10` on an attached
- // richText in ec5.
- // (2) `out === richItem` if and only if `out` is text el or rich item.
- // So we can overwrite existing props in `out` since textXXX has higher priority.
- e.font=e.textFont||e.font,N(e,"textStrokeWidth")&&(t.lineWidth=e.textStrokeWidth),N(e,"textAlign")&&(t.align=e.textAlign),N(e,"textVerticalAlign")&&(t.verticalAlign=e.textVerticalAlign),N(e,"textLineHeight")&&(t.lineHeight=e.textLineHeight),N(e,"textWidth")&&(t.width=e.textWidth),N(e,"textHeight")&&(t.height=e.textHeight),N(e,"textBackgroundColor")&&(t.backgroundColor=e.textBackgroundColor),N(e,"textPadding")&&(t.padding=e.textPadding),N(e,"textBorderColor")&&(t.borderColor=e.textBorderColor),N(e,"textBorderWidth")&&(t.borderWidth=e.textBorderWidth),N(e,"textBorderRadius")&&(t.borderRadius=e.textBorderRadius),N(e,"textBoxShadowColor")&&(t.shadowColor=e.textBoxShadowColor),N(e,"textBoxShadowBlur")&&(t.shadowBlur=e.textBoxShadowBlur),N(e,"textBoxShadowOffsetX")&&(t.shadowOffsetX=e.textBoxShadowOffsetX),N(e,"textBoxShadowOffsetY")&&(t.shadowOffsetY=e.textBoxShadowOffsetY))}
- /**
- * Convert to pure echarts4 format style.
- * `itemStyle` will be modified, added with ec4 style properties from
- * `textStyle` and `textConfig`.
- *
- * [Caveat]: For simplicity, `insideRollback` in ec4 does not compat, where
- * `styleEmphasis: {textFill: 'red'}` will remove the normal auto added stroke.
- */function gT(t,e,n){var i=t;
- // See `custom.ts`, a trick to set extra `textPosition` firstly.
- i.textPosition=i.textPosition||n.position||"inside",null!=n.offset&&(i.textOffset=n.offset),null!=n.rotation&&(i.textRotation=n.rotation),null!=n.distance&&(i.textDistance=n.distance);var o=i.textPosition.indexOf("inside")>=0,r=t.fill||"#000";yT(i,e);var s=null==i.textFill;return o?s&&(i.textFill=n.insideFill||"#fff",!i.textStroke&&n.insideStroke&&(i.textStroke=n.insideStroke),!i.textStroke&&(i.textStroke=r),null==i.textStrokeWidth&&(i.textStrokeWidth=2)):(s&&(i.textFill=t.fill||n.outsideFill||"#000"),!i.textStroke&&n.outsideStroke&&(i.textStroke=n.outsideStroke)),i.text=e.text,i.rich=e.rich,a(e.rich,(function(t){yT(t,t)})),i}function yT(t,e){e&&(N(e,"fill")&&(t.textFill=e.fill),N(e,"stroke")&&(t.textStroke=e.fill),N(e,"lineWidth")&&(t.textStrokeWidth=e.lineWidth),N(e,"font")&&(t.font=e.font),N(e,"fontStyle")&&(t.fontStyle=e.fontStyle),N(e,"fontWeight")&&(t.fontWeight=e.fontWeight),N(e,"fontSize")&&(t.fontSize=e.fontSize),N(e,"fontFamily")&&(t.fontFamily=e.fontFamily),N(e,"align")&&(t.textAlign=e.align),N(e,"verticalAlign")&&(t.textVerticalAlign=e.verticalAlign),N(e,"lineHeight")&&(t.textLineHeight=e.lineHeight),N(e,"width")&&(t.textWidth=e.width),N(e,"height")&&(t.textHeight=e.height),N(e,"backgroundColor")&&(t.textBackgroundColor=e.backgroundColor),N(e,"padding")&&(t.textPadding=e.padding),N(e,"borderColor")&&(t.textBorderColor=e.borderColor),N(e,"borderWidth")&&(t.textBorderWidth=e.borderWidth),N(e,"borderRadius")&&(t.textBorderRadius=e.borderRadius),N(e,"shadowColor")&&(t.textBoxShadowColor=e.shadowColor),N(e,"shadowBlur")&&(t.textBoxShadowBlur=e.shadowBlur),N(e,"shadowOffsetX")&&(t.textBoxShadowOffsetX=e.shadowOffsetX),N(e,"shadowOffsetY")&&(t.textBoxShadowOffsetY=e.shadowOffsetY),N(e,"textShadowColor")&&(t.textShadowColor=e.textShadowColor),N(e,"textShadowBlur")&&(t.textShadowBlur=e.textShadowBlur),N(e,"textShadowOffsetX")&&(t.textShadowOffsetX=e.textShadowOffsetX),N(e,"textShadowOffsetY")&&(t.textShadowOffsetY=e.textShadowOffsetY))}var mT={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},vT=v(mT);e(Te,(function(t,e){return t[e]=1,t}),{}),Te.join(", ");
- // '' means root
- var xT=["","style","shape","extra"],_T=On();function bT(t,e,n,i,o){var r=t+"Animation",a=eo(t,i,o)||{},s=_T(e).userDuring;
- // Only set when duration is > 0 and it's need to be animated.
- return a.duration>0&&(
- // For simplicity, if during not specified, the previous during will not work any more.
- a.during=s?lt(CT,{el:e,userDuring:s}):null,a.setToFinal=!0,a.scope=t),p(a,n[r]),a}function ST(t,e,n,i){var o=(i=i||{}).dataIndex,r=i.isInit,s=i.clearStyle,l=n.isAnimationEnabled(),u=_T(t),d=e.style;u.userDuring=e.during;var h={},f={};if(function(t,e,n){for(var i=0;i<vT.length;i++){var o=vT[i],r=mT[o],a=e[o];a&&(n[r[0]]=a[0],n[r[1]]=a[1])}for(i=0;i<Te.length;i++){var s=Te[i];null!=e[s]&&(n[s]=e[s])}}(0,e,f),LT("shape",e,f),LT("extra",e,f),!r&&l&&(function(t,e,n){for(var i=e.transition,o=IT(i)?Te:Sn(i||[]),r=0;r<o.length;r++){var a=o[r];if("style"!==a&&"shape"!==a&&"extra"!==a){var s=t[a];
- // Do not clone, animator will perform that clone.
- n[a]=s}}}(t,e,h),AT("shape",t,e,h),AT("extra",t,e,h),function(t,e,n,i){if(!n)return;var o,r=t.style;if(r){var a=n.transition,s=e.transition;if(a&&!IT(a)){var l=Sn(a);!o&&(o=i.style={});for(var u=0;u<l.length;u++){var d=r[g=l[u]];
- // Do not clone, see `checkNonStyleTansitionRefer`.
- o[g]=d}}else if(t.getAnimationStyleProps&&(IT(s)||IT(a)||c(s,"style")>=0)){var h=t.getAnimationStyleProps(),p=h?h.style:null;if(p){!o&&(o=i.style={});var f=v(n);for(u=0;u<f.length;u++){var g;if(p[g=f[u]]){d=r[g];o[g]=d}}}}}}(t,e,d,h)),f.style=d,function(t,
- // Can be null/undefined
- e,n){var i=e.style;if(!t.isGroup&&i){if(n){t.useStyle({});for(
- // When style object changed, how to trade the existing animation?
- // It is probably complicated and not needed to cover all the cases.
- // But still need consider the case:
- // (1) When using init animation on `style.opacity`, and before the animation
- // ended users triggers an update by mousewhel. At that time the init
- // animation should better be continued rather than terminated.
- // So after `useStyle` called, we should change the animation target manually
- // to continue the effect of the init animation.
- // (2) PENDING: If the previous animation targeted at a `val1`, and currently we need
- // to update the value to `val2` and no animation declared, should be terminate
- // the previous animation or just modify the target of the animation?
- // Therotically That will happen not only on `style` but also on `shape` and
- // `transfrom` props. But we haven't handle this case at present yet.
- // (3) PENDING: Is it proper to visit `animators` and `targetName`?
- var o=t.animators,r=0;r<o.length;r++){var a=o[r];
- // targetName is the "topKey".
- "style"===a.targetName&&a.changeTarget(t.style)}}t.setStyle(i)}e&&(
- // Not set style here.
- e.style=null,
- // Set el to the final state firstly.
- e&&t.attr(e),e.style=i)}(t,f,s),function(t,e){
- // Merge by default.
- N(e,"silent")&&(t.silent=e.silent),N(e,"ignore")&&(t.ignore=e.ignore),t instanceof $t&&N(e,"invisible")&&(t.invisible=e.invisible);t instanceof g&&N(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}
- // Use it to avoid it be exposed to user.
- (t,e),l)if(r){var y={};a(xT,(function(t){var n=t?e[t]:e;n&&n.enterFrom&&(t&&(y[t]=y[t]||{}),p(t?y[t]:y,n.enterFrom))}));var m=bT("enter",t,e,n,o);m.duration>0&&t.animateFrom(y,m)}else!function(t,e,n,i,
- // Can be null/undefined
- o){if(o){var r=bT("update",t,e,i,n);r.duration>0&&t.animateFrom(o,r)}}(t,e,o||0,n,h);
- // Store leave to be used in leave transition.
- wT(t,e),d?t.dirty():t.markRedraw()}function wT(t,e){for(
- // Try merge to previous set leaveTo
- var n=_T(t).leaveToProps,i=0;i<xT.length;i++){var o=xT[i],r=o?e[o]:e;r&&r.leaveTo&&(n||(n=_T(t).leaveToProps={}),o&&(n[o]=n[o]||{}),p(o?n[o]:n,r.leaveTo))}}function MT(t,e,n,i){if(t){var o=t.parent,r=_T(t).leaveToProps;if(r){
- // TODO TODO use leave after leaveAnimation in series is introduced
- // TODO Data index?
- var a=bT("update",t,e,n,0);a.done=function(){o.remove(t),i&&i()},t.animateTo(r,a)}else o.remove(t),i&&i()}}function IT(t){return"all"===t}var DT={},TT={
- // Usually other props do not need to be changed in animation during.
- setTransform:function(t,e){return DT.el[t]=e,this},getTransform:function(t){return DT.el[t]},setShape:function(t,e){var n=DT.el;return(n.shape||(n.shape={}))[t]=e,n.dirtyShape&&n.dirtyShape(),this},getShape:function(t){var e=DT.el.shape;if(e)return e[t]},setStyle:function(t,e){var n=DT.el,i=n.style;return i&&(i[t]=e,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(t){var e=DT.el.style;if(e)return e[t]},setExtra:function(t,e){return(DT.el.extra||(DT.el.extra={}))[t]=e,this},getExtra:function(t){var e=DT.el.extra;if(e)return e[t]}};function CT(){
- // Do not provide "percent" until some requirements come.
- // Because consider thies case:
- // enterFrom: {x: 100, y: 30}, transition: 'x'.
- // And enter duration is different from update duration.
- // Thus it might be confused about the meaning of "percent" in during callback.
- var t=this,e=t.el;if(e){
- // If el is remove from zr by reason like legend, during still need to called,
- // because el will be added back to zr and the prop value should not be incorrect.
- var n=_T(e).userDuring,i=t.userDuring;
- // Ensured a during is only called once in each animation frame.
- // If a during is called multiple times in one frame, maybe some users' calculation logic
- // might be wrong (not sure whether this usage exists).
- // The case of a during might be called twice can be: by default there is a animator for
- // 'x', 'y' when init. Before the init animation finished, call `setOption` to start
- // another animators for 'style'/'shape'/'extra'.
- n===i?(DT.el=e,
- // Give no `this` to user in "during" calling.
- i(TT)):
- // release
- t.el=t.userDuring=null}}function AT(t,e,n,i){var o=n[t];if(o){var r,a=e[t];if(a){var s=n.transition,l=o.transition;if(l)if(!r&&(r=i[t]={}),IT(l))p(r,a);else for(var u=Sn(l),d=0;d<u.length;d++){var h=a[g=u[d]];r[g]=h}else if(IT(s)||c(s,t)>=0){!r&&(r=i[t]={});var f=v(a);for(d=0;d<f.length;d++){var g;h=a[g=f[d]];kT(o[g],h)&&(r[g]=h)}}}}}function LT(t,e,n){var i=e[t];if(i)for(var o=n[t]={},r=v(i),a=0;a<r.length;a++){var s=r[a];
- // To avoid share one object with different element, and
- // to avoid user modify the object inexpectedly, have to clone.
- o[s]=Ce(i[s])}}function kT(t,e){
- // The same as `checkNonStyleTansitionRefer`.
- return m(t)?t!==e:null!=t&&isFinite(t)}var PT=On(),NT=["percent","easing","shape","style","extra"];
- /**
- * Stop previous keyframe animation and restore the attributes.
- * Avoid new keyframe animation starts with wrong internal state when the percent: 0 is not set.
- */
- function OT(t){
- // Stop previous keyframe animation.
- t.stopAnimation("keyframe"),
- // Restore
- t.attr(PT(t))}function RT(t,e,n){if(n.isAnimationEnabled()&&e)if(i(e))a(e,(function(e){RT(t,e,n)}));else{var o=e.keyframes,r=e.duration;if(n&&null==r){
- // Default to use duration of config.
- // NOTE: animation config from payload will be ignored because they are mainly for transitions.
- var s=eo("enter",n,0);r=s&&s.duration}if(o&&r){var l=PT(t);a(xT,(function(n){var i;
- // Sort keyframes by percent.
- n&&!t[n]||(o.sort((function(t,e){return t.percent-e.percent})),a(o,(function(o){
- // Stop current animation.
- var s=t.animators,u=n?o[n]:o;if(u){var d=v(u);if(n||(
- // PENDING performance?
- d=st(d,(function(t){return c(NT,t)<0}))),d.length){i||((i=t.animate(n,e.loop,!0)).scope="keyframe");for(var h=0;h<s.length;h++)
- // Stop all other animation that is not keyframe.
- s[h]!==i&&s[h].targetName===i.targetName&&s[h].stopTracks(d);n&&(l[n]=l[n]||{});var p=n?l[n]:l;a(d,(function(e){
- // Save original value.
- p[e]=((n?t[n]:t)||{})[e]})),i.whenWithKeys(r*o.percent,u,d,o.easing)}}})),i&&i.delay(e.delay||0).duration(r).start(e.easing))}))}}}var ET="emphasis",VT="normal",zT="blur",BT="select",GT=[VT,ET,zT,BT],FT={normal:["itemStyle"],emphasis:[ET,"itemStyle"],blur:[zT,"itemStyle"],select:[BT,"itemStyle"]},WT={normal:["label"],emphasis:[ET,"label"],blur:[zT,"label"],select:[BT,"label"]},HT=["x","y"],YT={normal:{},emphasis:{},blur:{},select:{}},UT={cartesian2d:function(t){var e=t.master.getRect();return{coordSys:{
- // The name exposed to user is always 'cartesian2d' but not 'grid'.
- type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){
- // do not provide "out" param
- return t.dataToPoint(e)},size:lt(lT,t)}}},geo:function(t){var e=t.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:t.getZoom()},api:{coord:function(e){
- // do not provide "out" and noRoam param,
- // Compatible with this usage:
- // echarts.util.map(item.points, api.coord)
- return t.dataToPoint(e)},size:lt(uT,t)}}},single:function(t){var e=t.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){
- // do not provide "out" param
- return t.dataToPoint(e)},size:lt(cT,t)}}},polar:function(t){var e=t.getRadiusAxis(),n=t.getAngleAxis(),i=e.getExtent();return i[0]>i[1]&&i.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:i[1],r0:i[0]},api:{coord:function(i){var o=e.dataToRadius(i[0]),r=n.dataToAngle(i[1]),a=t.coordToPoint([o,r]);return a.push(o,r*Math.PI/180),a},size:lt(dT,t)}}}
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */,calendar:function(t){var e=t.getRect(),n=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:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(e,n){return t.dataToPoint(e,n)}}}}};function ZT(t){return t instanceof g}function XT(t){return t instanceof $t}const jT=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n,i){
- // Clear previously rendered progressive elements.
- this._progressiveEls=null;var o=this._data,r=t.getData(),a=this.group,s=QT(t,r,e,n);o||
- // Previous render is incremental render or first render.
- // Needs remove the incremental rendered elements.
- a.removeAll(),r.diff(o).add((function(e){eC(n,null,e,s(e,i),t,a,r)})).remove((function(e){var n=o.getItemGraphicEl(e);n&&MT(n,aT(n).option,t)})).update((function(e,l){var u=o.getItemGraphicEl(l);eC(n,u,e,s(e,i),t,a,r)})).execute();
- // Do clipping
- var l=t.get("clip",!0)?iy(t.coordinateSystem,!1,t):null;l?a.setClipPath(l):a.removeClipPath(),this._data=r},e.prototype.incrementalPrepareRender=function(t,e,n){this.group.removeAll(),this._data=null},e.prototype.incrementalRender=function(t,e,n,i,o){var r=e.getData(),a=QT(e,r,n,i),s=this._progressiveEls=[];function l(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}for(var u=t.start;u<t.end;u++){var c=eC(null,null,u,a(u,o),e,this.group,r);c&&(c.traverse(l),s.push(c))}},e.prototype.eachRendered=function(t){Bo(this._progressiveEls||this.group,t)},e.prototype.filterForExposedEvent=function(t,e,n,i){var o=e.element;if(null==o||n.name===o)return!0;
- // Enable to give a name on a group made by `renderItem`, and listen
- // events that are triggered by its descendents.
- for(;(n=n.__hostTarget||n.parent)&&n!==this.group;)if(n.name===o)return!0;return!1},e.type="custom",e}(Ou);function qT(t){var e,n=t.type;
- // Those graphic elements are not shapes. They should not be
- // overwritten by users, so do them first.
- if("path"===n){var i=t.shape,o=null!=i.width&&null!=i.height?{x:i.x||0,y:i.y||0,width:i.width,height:i.height}:null,r=dC(i);
- // Using pathRect brings convenience to users sacle svg path.
- // Path is also used for icon, so layout 'center' by default.
- e=xo(r,null,o,i.layout||"center"),aT(e).customPathData=r}else if("image"===n)e=new b({}),aT(e).customImagePath=t.style.image;else if("text"===n)e=new $({});
- // customInnerStore(el).customText = (elOption.style as TextStyleProps).text;
- else if("group"===n)e=new Z;else{if("compoundPath"===n)throw new Error('"compoundPath" is not supported yet.');var a=vo(n);if(!a){vn("")}e=new a}return aT(e).customGraphicType=n,e.name=t.name,
- // Compat ec4: the default z2 lift is 1. If changing the number,
- // some cases probably be broken: hierarchy layout along z, like circle packing,
- // where emphasis only intending to modify color/border rather than lift z2.
- e.z2EmphasisLift=1,e.z2SelectLift=1,e}function KT(
- // Can be null/undefined
- t,e,n,i,o,r,a){
- // Stop and restore before update any other attributes.
- OT(e);var s=o&&o.normal.cfg;s&&
- // PENDING: whether use user object directly rather than clone?
- // TODO:5.0 textConfig transition animation?
- e.setTextConfig(s),
- // Default transition ['x', 'y']
- i&&null==i.transition&&(i.transition=HT);
- // Do some normalization on style.
- var l=i&&i.style;if(l){if("text"===e.type){var u=l;
- // Compatible with ec4: if `textFill` or `textStroke` exists use them.
- N(u,"textFill")&&(u.fill=u.textFill),N(u,"textStroke")&&(u.stroke=u.textStroke)}var c=void 0,d=ZT(e)?l.decal:null;t&&d&&(d.dirty=!0,c=Zc(d,t)),
- // Always overwrite in case user specify this prop.
- l.__decalPattern=c}XT(e)&&(l&&(c=l.__decalPattern)&&(l.decal=c));ST(e,i,r,{dataIndex:n,isInit:a,clearStyle:!0}),RT(e,i.keyframeAnimation,r)}function JT(t,e,n,i,o){var r=e.isGroup?null:e,a=o&&o[t].cfg;
- // PENDING:5.0 support customize scale change and transition animation?
- if(r){
- // By default support auto lift color when hover whether `emphasis` specified.
- var s=r.ensureState(t);if(!1===i){var l=r.getState(t);l&&(l.style=null)}else
- // style is needed to enable default emphasis.
- s.style=i||null;
- // If `elOption.styleEmphasis` or `elOption.emphasis.style` is `false`,
- // remove hover style.
- // If `elOption.textConfig` or `elOption.emphasis.textConfig` is null/undefined, it does not
- // make sense. So for simplicity, we do not ditinguish `hasOwnProperty` and null/undefined.
- a&&(s.textConfig=a),Ci(r)}}function $T(t,e,n){var i=n===VT,o=i?e:rC(e,n),r=o?o.z2:null;null!=r&&((i?t:t.ensureState(n)).z2=r||0)}function QT(e,n,i,o){var r=e.get("renderItem"),a=e.coordinateSystem,s={};a&&(
- // `coordSys.prepareCustoms` is used for external coord sys like bmap.
- s=a.prepareCustoms?a.prepareCustoms(a):UT[a.type](a));for(var l,u,c=I({getWidth:o.getWidth,getHeight:o.getHeight,getZr:o.getZr,getDevicePixelRatio:o.getDevicePixelRatio,value:
- /**
- * @public
- * @param dim by default 0.
- * @param dataIndexInside by default `currDataIndexInside`.
- */
- function(t,e){return null==e&&(e=l),n.getStore().get(n.getDimensionIndex(t||0),e)}
- /**
- * @public
- * @param dim by default 0.
- * @param dataIndexInside by default `currDataIndexInside`.
- */,style:
- /**
- * @deprecated The original intention of `api.style` is enable to set itemStyle
- * like other series. But it is not necessary and not easy to give a strict definition
- * of what it returns. And since echarts5 it needs to be make compat work. So
- * deprecates it since echarts5.
- *
- * By default, `visual` is applied to style (to support visualMap).
- * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`,
- * it can be implemented as:
- * `api.style({stroke: api.visual('color'), fill: null})`;
- *
- * [Compat]: since ec5, RectText has been separated from its hosts el.
- * so `api.style()` will only return the style from `itemStyle` but not handle `label`
- * any more. But `series.label` config is never published in doc.
- * We still compat it in `api.style()`. But not encourage to use it and will still not
- * to pulish it to doc.
- * @public
- * @param dataIndexInside by default `currDataIndexInside`.
- */
- function(i,o){null==o&&(o=l);var r=n.getItemVisual(o,"style"),a=r&&r.fill,s=r&&r.opacity,u=_(o,VT).getItemStyle();null!=a&&(u.fill=a),null!=s&&(u.opacity=s);var c={inheritColor:t(a)?a:"#000"},d=b(o,VT),h=Zo(d,null,c,!1,!0);h.text=d.getShallow("show")?x(e.getFormattedLabel(o,VT),Rg(n,o)):null;var p=Xo(d,c,!1);return w(i,u),u=gT(u,h,p),i&&S(u,i),u.legacy=!0,u}
- /**
- * @deprecated The reason see `api.style()`
- * @public
- * @param dataIndexInside by default `currDataIndexInside`.
- */,ordinalRawValue:function(t,e){null==e&&(e=l),t=t||0;var i=n.getDimensionInfo(t);if(!i){var o=n.getDimensionIndex(t);return o>=0?n.getStore().get(o,e):void 0}var r=n.get(i.name,e),a=i&&i.ordinalMeta;return a?a.categories[r]:r},styleEmphasis:function(t,i){null==i&&(i=l);var o=_(i,ET).getItemStyle(),r=b(i,ET),a=Zo(r,null,null,!0,!0);a.text=r.getShallow("show")?Ht(e.getFormattedLabel(i,ET),e.getFormattedLabel(i,VT),Rg(n,i)):null;var s=Xo(r,null,!0);return w(t,o),o=gT(o,a,s),t&&S(o,t),o.legacy=!0,o},visual:
- /**
- * @public
- * @param dataIndexInside by default `currDataIndexInside`.
- */
- function(t,e){if(null==e&&(e=l),N(oT,t)){var i=n.getItemVisual(e,"style");return i?i[oT[t]]:null}
- // Only support these visuals. Other visual might be inner tricky
- // for performance (like `style`), do not expose to users.
- if(N(rT,t))return n.getItemVisual(e,t)}
- /**
- * @public
- * @return If not support, return undefined.
- */,barLayout:function(t){if("cartesian2d"===a.type){var e=a.getBaseAxis();return function(t){var e=[],n=t.axis,i="axis0";if("category"===n.type){for(var o=n.getBandWidth(),r=0;r<t.count;r++)e.push(I({bandWidth:o,axisKey:i,stackId:_p+r},t));var a=Ip(e),s=[];for(r=0;r<t.count;r++){var l=a[i][_p+r];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}}(I({axis:e},t))}}
- /**
- * @public
- */,currentSeriesIndices:function(){return i.getCurrentSeriesIndices()}
- /**
- * @public
- * @return font string
- */,font:function(t){return $o(t,i)}},s.api||{}),d={
- // The life cycle of context: current round of rendering.
- // The global life cycle is probably not necessary, because
- // user can store global status by themselves.
- context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:s.coordSys,dataInsideLength:n.count(),encode:tC(e.getData())},h={},p={},f={},g={},y=0;y<GT.length;y++){var m=GT[y];f[m]=e.getModel(FT[m]),g[m]=e.getModel(WT[m])}function v(t){return t===l?u||(u=n.getItemModel(t)):n.getItemModel(t)}function _(t,e){return n.hasItemOption?t===l?h[e]||(h[e]=v(t).getModel(FT[e])):v(t).getModel(FT[e]):f[e]}function b(t,e){return n.hasItemOption?t===l?p[e]||(p[e]=v(t).getModel(WT[e])):v(t).getModel(WT[e]):g[e]}return function(t,e){return l=t,u=null,h={},p={},r&&r(I({dataIndexInside:t,dataIndex:n.getRawIndex(t),
- // Can be used for optimization when zoom or roam.
- actionType:e?e.type:null},d),c)};function S(t,e){for(var n in e)N(e,n)&&(t[n]=e[n])}function w(t,e){
- // A trick to retrieve those props firstly, which are used to
- // apply auto inside fill/stroke in `convertToEC4StyleForCustomSerise`.
- // (It's not reasonable but only for a degree of compat)
- t&&(t.textFill&&(e.textFill=t.textFill),t.textPosition&&(e.textPosition=t.textPosition))}}function tC(t){var e={};return a(t.dimensions,(function(n){var i=t.getDimensionInfo(n);if(!i.isExtraCoord){var o=i.coordDim;(e[o]=e[o]||[])[i.coordDimIndex]=t.getDimensionIndex(n)}})),e}function eC(t,e,n,i,o,r,a){
- // [Rule]
- // If `renderItem` returns `null`/`undefined`/`false`, remove the previous el if existing.
- // (It seems that violate the "merge" principle, but most of users probably intuitively
- // regard "return;" as "show nothing element whatever", so make a exception to meet the
- // most cases.)
- // The rule or "merge" see [STRATEGY_MERGE].
- // If `elOption` is `null`/`undefined`/`false` (when `renderItem` returns nothing).
- if(i){var s=nC(t,e,n,i,o,r);return s&&a.setItemGraphicEl(n,s),s&&Ui(s,i.focus,i.blurScope,i.emphasisDisabled),s}r.remove(e)}function nC(t,e,n,i,o,r){var a=-1,s=e;e&&iC(e,i,o)&&(
- // Should keep at the original index, otherwise "merge by index" will be incorrect.
- a=c(r.childrenRef(),e),e=null);var l,u,d=!e,h=e;h?
- // FIMXE:NEXT unified clearState?
- // If in some case the performance issue arised, consider
- // do not clearState but update cached normal state directly.
- h.clearStates():(h=qT(i),s&&(l=s,(u=h).copyTransform(l),XT(u)&&XT(l)&&(u.setStyle(l.style),u.z=l.z,u.z2=l.z2,u.zlevel=l.zlevel,u.invisible=l.invisible,u.ignore=l.ignore,ZT(u)&&ZT(l)&&u.setShape(l.shape)))),
- // Need to set morph: false explictly to disable automatically morphing.
- !1===i.morph?h.disableMorphing=!0:h.disableMorphing&&(h.disableMorphing=!1),YT.normal.cfg=YT.normal.conOpt=YT.emphasis.cfg=YT.emphasis.conOpt=YT.blur.cfg=YT.blur.conOpt=YT.select.cfg=YT.select.conOpt=null,YT.isLegacy=!1,function(t,e,n,i,o,r){
- // Group does not support textContent temporarily until necessary.
- if(t.isGroup)return;
- // Normal must be called before emphasis, for `isLegacy` detection.
- oC(n,null,r),oC(n,ET,r);
- // If `elOption.textConfig` or `elOption.textContent` is null/undefined, it does not make sense.
- // So for simplicity, if "elOption hasOwnProperty of them but be null/undefined", we do not
- // trade them as set to null to el.
- // Especially:
- // `elOption.textContent: false` means remove textContent.
- // `elOption.textContent.emphasis.style: false` means remove the style from emphasis state.
- var a=r.normal.conOpt,s=r.emphasis.conOpt,l=r.blur.conOpt,u=r.select.conOpt;if(null!=a||null!=s||null!=u||null!=l){var c=t.getTextContent();if(!1===a)c&&t.removeTextContent();else{a=r.normal.conOpt=a||{type:"text"},c?
- // If in some case the performance issue arised, consider
- // do not clearState but update cached normal state directly.
- c.clearStates():(c=qT(a),t.setTextContent(c)),KT(null,c,e,a,null,i,o);for(var d=a&&a.style,h=0;h<GT.length;h++){var p=GT[h];if(p!==VT){var f=r[p].conOpt;JT(p,c,0,aC(a,f,p),null)}}d?c.dirty():c.markRedraw()}}}(h,n,i,o,d,YT),function(t,e,n,i,o){
- // Based on the "merge" principle, if no clipPath provided,
- // do nothing. The exists clip will be totally removed only if
- // `el.clipPath` is `false`. Otherwise it will be merged/replaced.
- var r=n.clipPath;if(!1===r)t&&t.getClipPath()&&t.removeClipPath();else if(r){var a=t.getClipPath();a&&iC(a,r,i)&&(a=null),a||(a=qT(r),t.setClipPath(a)),KT(null,a,e,r,null,i,o)}
- // If not define `clipPath` in option, do nothing unnecessary.
- }(h,n,i,o,d),KT(t,h,n,i,YT,o,d),
- // `elOption.info` enables user to mount some info on
- // elements and use them in event handlers.
- // Update them only when user specified, otherwise, remain.
- N(i,"info")&&(aT(h).info=i.info);for(var p=0;p<GT.length;p++){var f=GT[p];if(f!==VT){var g=rC(i,f);JT(f,h,0,aC(i,g,f),YT)}}return function(t,e,n){
- // Group not support textContent and not support z yet.
- if(!t.isGroup){var i=t,o=n.currentZ,r=n.currentZLevel;
- // Always erase.
- i.z=o,i.zlevel=r;
- // z2 must not be null/undefined, otherwise sort error may occur.
- var a=e.z2;null!=a&&(i.z2=a||0);for(var s=0;s<GT.length;s++)$T(i,e,GT[s])}}(h,i,o),"group"===i.type&&
- // Usage:
- // (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates
- // that the existing children will not be removed, and enables the feature
- // that update some of the props of some of the children simply by construct
- // the returned children of `renderItem` like:
- // `var children = group.children = []; children[3] = {opacity: 0.5};`
- // (2) If `elOption.$mergeChildren` is `'byName'`, add/update/remove children
- // by child.name. But that might be lower performance.
- // (3) If `elOption.$mergeChildren` is `false`, the existing children will be
- // replaced totally.
- // (4) If `!elOption.children`, following the "merge" principle, nothing will
- // happen.
- // (5) If `elOption.$mergeChildren` is not `false` neither `'byName'` and the
- // `el` is a group, and if any of the new child is null, it means to remove
- // the element at the same index, if exists. On the other hand, if the new
- // child is and empty object `{}`, it means to keep the element not changed.
- // For implementation simpleness, do not provide a direct way to remove single
- // child (otherwise the total indices of the children array have to be modified).
- // User can remove a single child by setting its `ignore` to `true`.
- function(t,e,n,i,o){var r=i.children,a=r?r.length:0,s=i.$mergeChildren,l="byName"===s||i.diffChildrenByName,u=!1===s;
- // For better performance on roam update, only enter if necessary.
- if(!a&&!l&&!u)return;if(l)return c={api:t,oldChildren:e.children()||[],newChildren:r||[],dataIndex:n,seriesModel:o,group:e},void new yh(c.oldChildren,c.newChildren,lC,lC,c).add(uC).update(uC).remove(cC).execute();var c;u&&e.removeAll();for(
- // Mapping children of a group simply by index, which
- // might be better performance.
- var d=0;d<a;d++){var h=r[d],p=e.childAt(d);h?(null==h.ignore&&(
- // The old child is set to be ignored if null (see comments
- // below). So we need to set ignore to be false back.
- h.ignore=!1),nC(t,p,n,h,o,e)):
- // If the new element option is null, it means to remove the old
- // element. But we cannot really remove the element from the group
- // directly, because the element order may not be stable when this
- // element is added back. So we set the element to be ignored.
- p.ignore=!0}for(var f=e.childCount()-1;f>=d;f--){var g=e.childAt(f);sC(e,g,o)}}(t,h,n,i,o),a>=0?r.replaceAt(h,a):r.add(h),h}
- // `el` must not be null/undefined.
- function iC(t,e,n){var i,o=aT(t),r=e.type,a=e.shape,s=e.style;
- // Always create new if universal transition is enabled.
- // Because we do transition after render. It needs to know what old element is. Replacement will loose it.
- return n.isUniversalTransitionEnabled()||null!=r&&r!==o.customGraphicType||"path"===r&&((i=a)&&(N(i,"pathData")||N(i,"d")))&&dC(a)!==o.customPathData||"image"===r&&N(s,"image")&&s.image!==o.customImagePath}function oC(t,e,n){var i=e?rC(t,e):t,o=e?aC(t,i,ET):t.style,r=t.type,a=i?i.textConfig:null,s=t.textContent,l=s?e?rC(s,e):s:null;if(o&&(
- // Because emphasis style has little info to detect legacy,
- // if normal is legacy, emphasis is trade as legacy.
- n.isLegacy||hT(o,r,!!a,!!l))){n.isLegacy=!0;var u=pT(o,r,!e);
- // Explicitly specified `textConfig` and `textContent` has higher priority than
- // the ones generated by legacy style. Otherwise if users use them and `api.style`
- // at the same time, they not both work and hardly to known why.
- !a&&u.textConfig&&(a=u.textConfig),!l&&u.textContent&&(l=u.textContent)}if(!e&&l){var c=l;
- // `textContent: {type: 'text'}`, the "type" is easy to be missing. So we tolerate it.
- !c.type&&(c.type="text")}var d=e?n[e]:n.normal;d.cfg=a,d.conOpt=l}function rC(t,e){return e?t?t[e]:null:t}function aC(t,e,n){var i=e&&e.style;return null==i&&n===ET&&t&&(i=t.styleEmphasis),i}function sC(t,e,n){
- // Do not support leave elements that are not mentioned in the latest
- // `renderItem` return. Otherwise users may not have a clear and simple
- // concept that how to control all of the elements.
- e&&MT(e,aT(t).option,n)}function lC(t,e){var n=t&&t.name;return null!=n?n:"e\0\0"+e}function uC(t,e){var n=this.context,i=null!=t?n.newChildren[t]:null,o=null!=e?n.oldChildren[e]:null;nC(n.api,o,n.dataIndex,i,n.seriesModel,n.group)}function cC(t){var e=this.context,n=e.oldChildren[t];n&&MT(n,aT(n).option,e.seriesModel)}
- /**
- * @return SVG Path data.
- */function dC(t){
- // "d" follows the SVG convention.
- return t&&(t.pathData||t.d)}var hC=On(),pC=et,fC=lt,gC=/** @class */function(){function t(){this._dragging=!1,
- /**
- * In px, arbitrary value. Do not set too small,
- * no animation is ok for most cases.
- */
- this.animationThreshold=15}
- /**
- * @implement
- */return t.prototype.render=function(t,e,n,i){var o=e.get("value"),r=e.get("status");
- // Optimize: `render` will be called repeatedly during mouse move.
- // So it is power consuming if performing `render` each time,
- // especially on mobile device.
- if(
- // Bind them to `this`, not in closure, otherwise they will not
- // be replaced when user calling setOption in not merge mode.
- this._axisModel=t,this._axisPointerModel=e,this._api=n,i||this._lastValue!==o||this._lastStatus!==r){this._lastValue=o,this._lastStatus=r;var a=this._group,s=this._handle;if(!r||"hide"===r)
- // Do not clear here, for animation better.
- return a&&a.hide(),void(s&&s.hide());a&&a.show(),s&&s.show();
- // Otherwise status is 'show'
- var l={};this.makeElOption(l,o,t,e,n);
- // Enable change axis pointer type.
- var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var c=this._moveAnimation=this.determineAnimation(t,e);if(a){var d=rt(yC,e,c);this.updatePointerEl(a,l,d),this.updateLabelEl(a,l,d,e)}else a=this._group=new Z,this.createPointerEl(a,l,t,e),this.createLabelEl(a,l,t,e),n.getZr().add(a);_C(a,e,!0),this._renderHandle(o)}},
- /**
- * @implement
- */
- t.prototype.remove=function(t){this.clear(t)},
- /**
- * @implement
- */
- t.prototype.dispose=function(t){this.clear(t)},
- /**
- * @protected
- */
- t.prototype.determineAnimation=function(t,e){var n=e.get("animation"),i=t.axis,o="category"===i.type,r=e.get("snap");
- // Value axis without snap always do not snap.
- if(!r&&!o)return!1;if("auto"===n||null==n){var a=this.animationThreshold;if(o&&i.getBandWidth()>a)return!0;
- // It is important to auto animation when snap used. Consider if there is
- // a dataZoom, animation will be disabled when too many points exist, while
- // it will be enabled for better visual effect when little points exist.
- if(r){var s=ev(t).seriesDataCount,l=i.getExtent();
- // Approximate band width
- return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},
- /**
- * add {pointer, label, graphicKey} to elOption
- * @protected
- */
- t.prototype.makeElOption=function(t,e,n,i,o){
- // Should be implemenented by sub-class.
- },
- /**
- * @protected
- */
- t.prototype.createPointerEl=function(t,e,n,i){var o=e.pointer;if(o){var r=hC(t).pointerEl=new Go[o.type](pC(e.pointer));t.add(r)}},
- /**
- * @protected
- */
- t.prototype.createLabelEl=function(t,e,n,i){if(e.label){var o=hC(t).labelEl=new $(pC(e.label));t.add(o),vC(o,i)}},
- /**
- * @protected
- */
- t.prototype.updatePointerEl=function(t,e,n){var i=hC(t).pointerEl;i&&e.pointer&&(i.setStyle(e.pointer.style),n(i,{shape:e.pointer.shape}))},
- /**
- * @protected
- */
- t.prototype.updateLabelEl=function(t,e,n,i){var o=hC(t).labelEl;o&&(o.setStyle(e.label.style),n(o,{
- // Consider text length change in vertical axis, animation should
- // be used on shape, otherwise the effect will be weird.
- // TODOTODO
- // shape: elOption.label.shape,
- x:e.label.x,y:e.label.y}),vC(o,i))},
- /**
- * @private
- */
- t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,o=this._api.getZr(),r=this._handle,a=n.getModel("handle"),s=n.get("status");if(!a.get("show")||!s||"hide"===s)return r&&o.remove(r),void(this._handle=null);this._handle||(e=!0,r=this._handle=No(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){
- // For mobile device, prevent screen slider on the button.
- jt(t.event)},onmousedown:fC(this._onHandleDragMove,this,0,0),drift:fC(this._onHandleDragMove,this),ondragend:fC(this._onHandleDragEnd,this)}),o.add(r)),_C(r,n,!1),
- // update style
- r.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));
- // update position
- var l=a.get("size");i(l)||(l=[l,l]),r.scaleX=l[0]/2,r.scaleY=l[1]/2,Bu(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){yC(this._axisPointerModel,!e&&this._moveAnimation,this._handle,xC(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;
- // Persistent for throttle.
- var i=this.updateHandleTransform(xC(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(xC(i)),hC(n).lastProp=null,this._doDispatchAxisPointer()}},
- /**
- * Throttled method.
- */
- t.prototype._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}]})}},t.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");
- // Consider snap or categroy axis, handle may be not consistent with
- // axisPointer. So move handle to align the exact value position when
- // drag ended.
- this._moveHandleToValue(t),
- // For the effect: tooltip will be shown when finger holding on handle
- // button, and will be hidden after finger left handle button.
- this._api.dispatchAction({type:"hideTip"})}},
- /**
- * @private
- */
- t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,i=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),i&&e.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),Gu(this,"_doDispatchAxisPointer")},
- /**
- * @protected
- */
- t.prototype.doClear=function(){
- // Implemented by sub-class if necessary.
- },t.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},t}();function yC(t,e,n,i){
- // Animation optimize.
- mC(hC(n).lastProp,i)||(hC(n).lastProp=i,e?io(n,i,t):(n.stopAnimation(),n.attr(i)))}function mC(t,e){if(o(t)&&o(e)){var n=!0;return a(e,(function(e,i){n=n&&mC(t[i],e)})),!!n}return t===e}function vC(t,e){t[e.get(["label","show"])?"show":"hide"]()}function xC(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function _C(t,e,n){var i=e.get("z"),o=e.get("zlevel");t&&t.traverse((function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=o&&(t.zlevel=o),t.silent=n)}))}const bC=gC;function SC(t){var e,n=t.get("type"),i=t.getModel(n+"Style");return"line"===n?(e=i.getLineStyle()).fill=null:"shadow"===n&&((e=i.getAreaStyle()).stroke=null),e}
- /**
- * @param {Function} labelPos {align, verticalAlign, position}
- */function wC(t,e,n,i,o){var r=MC(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=aa(a.get("padding")||0),l=a.getFont(),u=Lt(r,l),c=o.position,d=u.width+s[1]+s[3],h=u.height+s[0]+s[2],p=o.align;"right"===p&&(c[0]-=d),"center"===p&&(c[0]-=d/2);var f=o.verticalAlign;"bottom"===f&&(c[1]-=h),"middle"===f&&(c[1]-=h/2),
- // Not overflow ec container
- // Do not overflow ec container
- function(t,e,n,i){var o=i.getWidth(),r=i.getHeight();t[0]=Math.min(t[0]+e,o)-e,t[1]=Math.min(t[1]+n,r)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}(c,d,h,i);var g=a.get("backgroundColor");g&&"auto"!==g||(g=e.get(["axisLine","lineStyle","color"])),t.label={
- // shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')},
- x:c[0],y:c[1],style:Zo(a,{text:r,font:l,fill:a.getTextColor(),padding:s,backgroundColor:g}),
- // Label should be over axisPointer.
- z2:10}}function MC(e,n,i,o,r){e=n.scale.parse(e);var s=n.scale.getLabel({value:e},{
- // If `precision` is set, width can be fixed (like '12.00500'), which
- // helps to debounce when when moving label.
- precision:r.precision}),l=r.formatter;if(l){var u={value:af(n,{value:e}),axisDimension:n.dim,axisIndex:n.index,seriesData:[]};a(o,(function(t){var e=i.getSeriesByIndex(t.seriesIndex),n=t.dataIndexInside,o=e&&e.getDataParams(n);o&&u.seriesData.push(o)})),t(l)?s=l.replace("{value}",s):f(l)&&(s=l(u))}return s}function IC(t,e,n){var i=te();return Ut(i,i,n.rotation),oe(i,i,n.position),To([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function DC(t,e,n,i,o,r){
- // @ts-ignore
- var a=$m.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=o.get(["label","margin"]),wC(e,i,o,r,{position:IC(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}function TC(t,e,n){return{x1:t[n=n||0],y1:t[1-n],x2:e[n],y2:e[1-n]}}function CC(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}}function AC(t,e,n,i,o,r){return{cx:t,cy:e,r0:n,r:i,startAngle:o,endAngle:r,clockwise:!0}}var LC=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}
- /**
- * @override
- */return Ue(e,t),e.prototype.makeElOption=function(t,e,n,i,o){var r=n.axis,a=r.grid,s=i.get("type"),l=kC(a,r).getOtherAxis(r).getGlobalExtent(),u=r.toGlobalCoord(r.dataToCoord(e,!0));if(s&&"none"!==s){var c=SC(i),d=PC[s](r,u,l);d.style=c,t.graphicKey=d.type,t.pointer=d}DC(
- // @ts-ignore
- e,t,Rm(a.model,n),n,i,o)},
- /**
- * @override
- */
- e.prototype.getHandleTransform=function(t,e,n){var i=Rm(e.axis.grid.model,e,{labelInside:!1});
- // @ts-ignore
- i.labelMargin=n.get(["handle","margin"]);var o=IC(e.axis,t,i);return{x:o[0],y:o[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},
- /**
- * @override
- */
- e.prototype.updateHandleTransform=function(t,e,n,i){var o=n.axis,r=o.grid,a=o.getGlobalExtent(!0),s=kC(r,o).getOtherAxis(o).getGlobalExtent(),l="x"===o.dim?0:1,u=[t.x,t.y];u[l]+=e[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var c=(s[1]+s[0])/2,d=[c,c];d[l]=u[l];return{x:u[0],y:u[1],rotation:t.rotation,cursorPoint:d,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},e}(bC);function kC(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var PC={line:function(t,e,n){return{type:"Line",subPixelOptimize:!0,shape:TC([e,n[0]],[e,n[1]],NC(t))}},shadow:function(t,e,n){var i=Math.max(1,t.getBandWidth()),o=n[1]-n[0];return{type:"Rect",shape:CC([e-i/2,n[0]],[i,o],NC(t))}}};function NC(t){return"x"===t.dim?0:1}const OC=LC;const RC=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="axisPointer",e.defaultOption={
- // 'auto' means that show when triggered by tooltip or handle.
- show:"auto",
- // zlevel: 0,
- z:50,type:"line",
- // axispointer triggered by tootip determine snap automatically,
- // see `modelHelper`.
- snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],
- // Do not set 'auto' here, otherwise global animation: false
- // will not effect at this axispointer.
- animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,
- // eslint-disable-next-line
- 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,
- // handle margin is from symbol center to axis, which is stable when circular move.
- margin:50,
- // color: '#1b8bbd'
- // color: '#2f4554'
- color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,
- // For mobile performance
- throttle:40}},e}(Ta);var EC=On(),VC=a;
- /**
- * @param {string} key
- * @param {module:echarts/ExtensionAPI} api
- * @param {Function} handler
- * param: {string} currTrigger
- * param: {Array.<number>} point
- */
- function zC(t,e,n){if(!d.node){var i=e.getZr();EC(i).records||(EC(i).records={}),function(t,e){if(EC(t).initialized)return;function n(n,i){t.on(n,(function(n){var o=function(t){var e={showTip:[],hideTip:[]},n=function(i){var o=e[i.type];o?o.push(i):(i.dispatchAction=n,t.dispatchAction(i))};
- // FIXME
- // better approach?
- // 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip,
- // which may be conflict, (axisPointer call showTip but tooltip call hideTip);
- // So we have to add "final stage" to merge those dispatched actions.
- return{dispatchAction:n,pendings:e}}(e);VC(EC(t).records,(function(t){t&&i(t,n,o.dispatchAction)})),function(t,e){var n,i=t.showTip.length,o=t.hideTip.length;i?n=t.showTip[i-1]:o&&(n=t.hideTip[o-1]);n&&(n.dispatchAction=null,e.dispatchAction(n))}(o.pendings,e)}))}EC(t).initialized=!0,n("click",rt(GC,"click")),n("mousemove",rt(GC,"mousemove")),
- // useHandler('mouseout', onLeave);
- n("globalout",BC)}(i,e),(EC(i).records[t]||(EC(i).records[t]={})).handler=n}}function BC(t,e,n){t.handler("leave",null,n)}function GC(t,e,n,i){e.handler(t,n,i)}function FC(t,e){if(!d.node){var n=e.getZr();(EC(n).records||{})[t]&&(EC(n).records[t]=null)}}var WC=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){var i=e.getComponent("tooltip"),o=t.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";
- // Register global listener in AxisPointerView to enable
- // AxisPointerView to be independent to Tooltip.
- zC("axisPointer",n,(function(t,e,n){
- // If 'none', it is not controlled by mouse totally.
- "none"!==o&&("leave"===t||o.indexOf(t)>=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})}))},e.prototype.remove=function(t,e){FC("axisPointer",e)},e.prototype.dispose=function(t,e){FC("axisPointer",e)},e.type="axisPointer",e}(Mu);const HC=WC;
- /**
- * @param finder contains {seriesIndex, dataIndex, dataIndexInside}
- * @param ecModel
- * @return {point: [x, y], el: ...} point Will not be null.
- */function YC(t,e){var o,r=[],a=t.seriesIndex;if(null==a||!(o=e.getSeriesByIndex(a)))return{point:[]};var s=o.getData(),l=Nn(s,t);if(null==l||l<0||i(l))return{point:[]};var u=s.getItemGraphicEl(l),c=o.coordinateSystem;if(o.getTooltipPosition)r=o.getTooltipPosition(l)||[];else if(c&&c.dataToPoint)if(t.isStacked){var d=c.getBaseAxis(),h=c.getOtherAxis(d).dim,p=d.dim,f="x"===h||"radius"===h?1:0,g=s.mapDimension(p),y=[];y[f]=s.get(g,l),y[1-f]=s.get(s.getCalculationInfo("stackResultDimension"),l),r=c.dataToPoint(y)||[]}else r=c.dataToPoint(s.getValues(n(c.dimensions,(function(t){return s.mapDimension(t)})),l))||[];else if(u){
- // Use graphic bounding rect
- var m=u.getBoundingRect().clone();m.applyTransform(u.transform),r=[m.x+m.width/2,m.y+m.height/2]}return{point:r,el:u}}var UC=On();
- /**
- * Basic logic: check all axis, if they do not demand show/highlight,
- * then hide/downplay them.
- *
- * @return content of event obj for echarts.connect.
- */function ZC(t,e,n){var i=t.currTrigger,o=[t.x,t.y],r=t,s=t.dispatchAction||lt(n.dispatchAction,n),l=e.getComponent("axisPointer").coordSysAxesInfo;
- // Pending
- // See #6121. But we are not able to reproduce it yet.
- if(l){JC(o)&&(
- // Used in the default behavior of `connection`: use the sample seriesIndex
- // and dataIndex. And also used in the tooltipView trigger.
- o=YC({seriesIndex:r.seriesIndex,
- // Do not use dataIndexInside from other ec instance.
- // FIXME: auto detect it?
- dataIndex:r.dataIndex},e).point);var u=JC(o),c=r.axesInfo,d=l.axesInfo,h="leave"===i||JC(o),p={},f={},g={list:[],map:{}},y={showPointer:rt(jC,f),showTooltip:rt(qC,g)};
- // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).
- // Notice: In this case, it is difficult to get the `point` (which is necessary to show
- // tooltip, so if point is not given, we just use the point found by sample seriesIndex
- // and dataIndex.
- // Process for triggered axes.
- a(l.coordSysMap,(function(t,e){
- // If a point given, it must be contained by the coordinate system.
- var n=u||t.containPoint(o);a(l.coordSysAxesInfo[e],(function(t,e){var i=t.axis,r=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(c,t);
- // If no inputAxesInfo, no axis is restricted.
- if(!h&&n&&(!c||r)){var a=r&&r.value;null!=a||u||(a=i.pointToData(o)),null!=a&&XC(t,a,y,!1,p)}}))}));
- // Process for linked axes.
- var m={};return a(d,(function(t,e){var n=t.linkGroup;
- // If axis has been triggered in the previous stage, it should not be triggered by link.
- n&&!f[e]&&a(n.axesInfo,(function(e,i){var o=f[i];
- // If srcValItem exist, source axis is triggered, so link to target axis.
- if(e!==t&&o){var r=o.value;n.mapper&&(r=t.axis.scale.parse(n.mapper(r,KC(e),KC(t)))),m[t.key]=r}}))})),a(m,(function(t,e){XC(d[e],t,y,!0,p)})),function(t,e,n){var i=n.axesInfo=[];
- // Basic logic: If no 'show' required, 'hide' this axisPointer.
- a(e,(function(e,n){var o=e.axisPointerModel.option,r=t[n];r?(!e.useHandle&&(o.status="show"),o.value=r.value,
- // For label formatter param and highlight.
- o.seriesDataIndices=(r.payloadBatch||[]).slice()):
- // If hide, value still need to be set, consider
- // click legend to toggle axis blank.
- !e.useHandle&&(o.status="hide"),
- // If status is 'hide', should be no info in payload.
- "show"===o.status&&i.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:o.value})}))}(f,d,p),function(t,e,n,i){
- // Basic logic: If no showTip required, hideTip will be dispatched.
- if(JC(e)||!t.list.length)return void i({type:"hideTip"});
- // In most case only one axis (or event one series is used). It is
- // convenient to fetch payload.seriesIndex and payload.dataIndex
- // directly. So put the first seriesIndex and dataIndex of the first
- // axis on the payload.
- var o=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:o.dataIndexInside,dataIndex:o.dataIndex,seriesIndex:o.seriesIndex,dataByCoordSys:t.list})}(g,o,t,s),function(t,e,n){
- // FIXME
- // highlight status modification should be a stage of main process?
- // (Consider confilct (e.g., legend and axisPointer) and setOption)
- var i=n.getZr(),o="axisPointerLastHighlights",r=UC(i)[o]||{},s=UC(i)[o]={};
- // Update highlight/downplay status according to axisPointer model.
- // Build hash map and remove duplicate incidentally.
- a(t,(function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&t.triggerEmphasis&&a(n.seriesDataIndices,(function(t){var e=t.seriesIndex+" | "+t.dataIndex;s[e]=t}))}));
- // Diff.
- var l=[],u=[];a(r,(function(t,e){!s[e]&&u.push(t)})),a(s,(function(t,e){!r[e]&&l.push(t)})),u.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,
- // Not blur others when highlight in axisPointer.
- notBlur:!0,batch:u}),l.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,
- // Not blur others when highlight in axisPointer.
- notBlur:!0,batch:l})}(d,0,n),p}}function XC(t,e,n,i,o){var r=t.axis;if(!r.scale.isBlank()&&r.containData(e))if(t.involveSeries){
- // Heavy calculation. So put it after axis.containData checking.
- var s=function(t,e){var n=e.axis,i=n.dim,o=t,r=[],s=Number.MAX_VALUE,l=-1;return a(e.seriesModels,(function(e,u){var c,d,h=e.getData().mapDimensionsAll(i);if(e.getAxisTooltipData){var p=e.getAxisTooltipData(h,t,n);d=p.dataIndices,c=p.nestestValue}else{if(!(d=e.getData().indicesOfNearest(h[0],t,
- // Add a threshold to avoid find the wrong dataIndex
- // when data length is not same.
- // false,
- "category"===n.type?.5:null)).length)return;c=e.getData().get(h[0],d[0])}if(null!=c&&isFinite(c)){var f=t-c,g=Math.abs(f);
- // Consider category case
- g<=s&&((g<s||f>=0&&l<0)&&(s=g,l=f,o=c,r.length=0),a(d,(function(t){r.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})})))}})),{payloadBatch:r,snapToValue:o}}(e,t),l=s.payloadBatch,u=s.snapToValue;
- // Fill content of event obj for echarts.connect.
- // By default use the first involved series data as a sample to connect.
- l[0]&&null==o.seriesIndex&&p(o,l[0]),
- // If no linkSource input, this process is for collecting link
- // target, where snap should not be accepted.
- !i&&t.snap&&r.containData(u)&&null!=u&&(e=u),n.showPointer(t,e,l),
- // Tooltip should always be snapToValue, otherwise there will be
- // incorrect "axis value ~ series value" mapping displayed in tooltip.
- n.showTooltip(t,s,u)}else n.showPointer(t,e)}function jC(t,e,n,i){t[e.key]={value:n,payloadBatch:i}}function qC(t,e,n,i){var o=n.payloadBatch,r=e.axis,a=r.model,s=e.axisPointerModel;
- // If no data, do not create anything in dataByCoordSys,
- // whose length will be used to judge whether dispatch action.
- if(e.triggerTooltip&&o.length){var l=e.coordSys.model,u=iv(l),c=t.map[u];c||(c=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(c)),c.dataByAxis.push({axisDim:r.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,
- // Caustion: viewHelper.getValueLabel is actually on "view stage", which
- // depends that all models have been updated. So it should not be performed
- // here. Considering axisPointerModel used here is volatile, which is hard
- // to be retrieve in TooltipView, we prepare parameters here.
- valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:o.slice()})}}function KC(t){var e=t.axis.model,n={},i=n.axisDim=t.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=e.componentIndex,n.axisName=n[i+"AxisName"]=e.name,n.axisId=n[i+"AxisId"]=e.id,n}function JC(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function $C(t){
- // CartesianAxisPointer is not supposed to be required here. But consider
- // echarts.simple.js and online build tooltip, which only require gridSimple,
- // CartesianAxisPointer should be able to required somewhere.
- av.registerAxisPointerClass("CartesianAxisPointer",OC),t.registerComponentModel(RC),t.registerComponentView(HC),t.registerPreprocessor((function(t){
- // Always has a global axisPointerModel for default setting.
- if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;
- // Normalize to array to avoid object mergin. But if link
- // is not set, remain null/undefined, otherwise it will
- // override existent link setting.
- e&&!i(e)&&(t.axisPointer.link=[e])}})),
- // This process should proformed after coordinate systems created
- // and series data processed. So put it on statistic processing stage.
- t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,(function(t,e){
- // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.
- // allAxesInfo should be updated when setOption performed.
- t.getComponent("axisPointer").coordSysAxesInfo=Qm(t,e)})),
- // Broadcast to all views.
- t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},ZC)}var QC=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}
- /**
- * @override
- */return Ue(e,t),e.prototype.makeElOption=function(t,e,n,i,o){var r=n.axis;"angle"===r.dim&&(this.animationThreshold=Math.PI/18);var a=r.polar,s=a.getOtherAxis(r).getExtent(),l=r.dataToCoord(e),u=i.get("type");if(u&&"none"!==u){var c=SC(i),d=tA[u](r,a,l,s);d.style=c,t.graphicKey=d.type,t.pointer=d}var h=function(t,e,n,i,o){var r=e.axis,a=r.dataToCoord(t),s=i.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,c,d=i.getRadiusAxis().getExtent();if("radius"===r.dim){var h=te();Ut(h,h,s),oe(h,h,[i.cx,i.cy]),l=To([a,-o],h);var p=e.getModel("axisLabel").get("rotate")||0,f=$m.innerTextLayout(s,p*Math.PI/180,-1);
- // @ts-ignore
- u=f.textAlign,c=f.textVerticalAlign}else{
- // angle axis
- var g=d[1];l=i.coordToPoint([g+o,a]);var y=i.cx,m=i.cy;u=Math.abs(l[0]-y)/g<.3?"center":l[0]>y?"left":"right",c=Math.abs(l[1]-m)/g<.3?"middle":l[1]>m?"top":"bottom"}return{position:l,align:u,verticalAlign:c}}(e,n,0,a,i.get(["label","margin"]));wC(t,n,i,o,h)},e}(bC);var tA={line:function(t,e,n,i){return"angle"===t.dim?{type:"Line",shape:TC(e.coordToPoint([i[0],n]),e.coordToPoint([i[1],n]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:n}}},shadow:function(t,e,n,i){var o=Math.max(1,t.getBandWidth()),r=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:AC(e.cx,e.cy,i[0],i[1],
- // In ECharts y is negative if angle is positive
- (-n-o/2)*r,(o/2-n)*r)}:{type:"Sector",shape:AC(e.cx,e.cy,n-o/2,n+o/2,0,2*Math.PI)}}};const eA=QC;const nA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.findAxisModel=function(t){var e;return this.ecModel.eachComponent(t,(function(t){t.getCoordSysModel()===this&&(e=t)}),this),e},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={
- // zlevel: 0,
- z:0,center:["50%","50%"],radius:"80%"},e}(Ta);var iA=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",zn).models[0]},e.type="polarAxis",e}(Ta);nt(iA,df);var oA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="angleAxis",e}(iA),rA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="radiusAxis",e}(iA),aA=/** @class */function(t){function e(e,n){return t.call(this,"radius",e,n)||this}return Ue(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},e}(Yf);aA.prototype.dataToRadius=Yf.prototype.dataToCoord,aA.prototype.radiusToData=Yf.prototype.coordToData;const sA=aA;var lA=On(),uA=/** @class */function(t){function e(e,n){return t.call(this,"angle",e,n||[0,360])||this}return Ue(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},
- /**
- * Only be called in category axis.
- * Angle axis uses text height to decide interval
- *
- * @override
- * @return {number} Auto interval for cateogry axis tick and label
- */
- e.prototype.calculateCategoryInterval=function(){var t=this,e=t.getLabelModel(),n=t.scale,i=n.getExtent(),o=n.count();if(i[1]-i[0]<1)return 0;var r=i[0],a=t.dataToCoord(r+1)-t.dataToCoord(r),s=Math.abs(a),l=Lt(null==r?"":r+"",e.getFont(),"center","top"),u=Math.max(l.height,7)/s;
- // 0/0 is NaN, 1/0 is Infinity.
- isNaN(u)&&(u=Infinity);var c=Math.max(0,Math.floor(u)),d=lA(t.model),h=d.lastAutoInterval,p=d.lastTickCount;
- // Use cache to keep interval stable while moving zoom window,
- // otherwise the calculated interval might jitter when the zoom
- // window size is close to the interval-changing size.
- return null!=h&&null!=p&&Math.abs(h-c)<=1&&Math.abs(p-o)<=1&&h>c?c=h:(d.lastTickCount=o,d.lastAutoInterval=c),c},e}(Yf);uA.prototype.dataToAngle=Yf.prototype.dataToCoord,uA.prototype.angleToData=Yf.prototype.coordToData;const cA=uA;var dA=["radius","angle"],hA=/** @class */function(){function t(t){this.dimensions=dA,this.type="polar",
- /**
- * x of polar center
- */
- this.cx=0,
- /**
- * y of polar center
- */
- this.cy=0,this._radiusAxis=new sA,this._angleAxis=new cA,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}
- /**
- * If contain coord
- */return t.prototype.containPoint=function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},
- /**
- * If contain data
- */
- t.prototype.containData=function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},t.prototype.getAxis=function(t){return this["_"+t+"Axis"]},t.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},
- /**
- * Get axes by type of scale
- */
- t.prototype.getAxesByScale=function(t){var e=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===t&&e.push(n),i.scale.type===t&&e.push(i),e},t.prototype.getAngleAxis=function(){return this._angleAxis},t.prototype.getRadiusAxis=function(){return this._radiusAxis},t.prototype.getOtherAxis=function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},
- /**
- * Base axis will be used on stacking.
- *
- */
- t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},t.prototype.getTooltipAxes=function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},
- /**
- * Convert a single data item to (x, y) point.
- * Parameter data is an array which the first element is radius and the second is angle
- */
- t.prototype.dataToPoint=function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},
- /**
- * Convert a (x, y) point to data
- */
- t.prototype.pointToData=function(t,e){var n=this.pointToCoord(t);return[this._radiusAxis.radiusToData(n[0],e),this._angleAxis.angleToData(n[1],e)]},
- /**
- * Convert a (x, y) point to (radius, angle) coord
- */
- t.prototype.pointToCoord=function(t){var e=t[0]-this.cx,n=t[1]-this.cy,i=this.getAngleAxis(),o=i.getExtent(),r=Math.min(o[0],o[1]),a=Math.max(o[0],o[1]);
- // Fix fixed extent in polarCreator
- // FIXME
- i.inverse?r=a-360:a=r+360;var s=Math.sqrt(e*e+n*n);e/=s,n/=s;for(var l=Math.atan2(-n,e)/Math.PI*180,u=l<r?1:-1
- // move to angleExtent
- ;l<r||l>a;)l+=360*u;return[s,l]},
- /**
- * Convert a (radius, angle) coord to (x, y) point
- */
- t.prototype.coordToPoint=function(t){var e=t[0],n=t[1]/180*Math.PI;return[Math.cos(n)*e+this.cx,-Math.sin(n)*e+this.cy]},
- /**
- * Get ring area of cartesian.
- * Area will have a contain function to determine if a point is in the coordinate system.
- */
- t.prototype.getArea=function(){var t=this.getAngleAxis(),e=this.getRadiusAxis().getExtent().slice();e[0]>e[1]&&e.reverse();var n=t.getExtent(),i=Math.PI/180,o=1e-4;return{cx:this.cx,cy:this.cy,r0:e[0],r:e[1],startAngle:-n[0]*i,endAngle:-n[1]*i,clockwise:t.inverse,contain:function(t,e){
- // It's a ring shape.
- // Start angle and end angle don't matter
- var n=t-this.cx,i=e-this.cy,r=n*n+i*i,a=this.r,s=this.r0;
- // minus a tiny value 1e-4 in double side to avoid being clipped unexpectedly
- // r == r0 contain nothing
- return a!==s&&r-o<=a*a&&r+o>=s*s}}},t.prototype.convertToPixel=function(t,e,n){return pA(e)===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){return pA(e)===this?this.pointToData(n):null},t}();function pA(t){var e=t.seriesModel,n=t.polarModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}const fA=hA;
- /**
- * Resize method bound to the polar
- */
- /**
- * Update polar
- */
- function gA(t,e){var n=this,i=n.getAngleAxis(),o=n.getRadiusAxis();
- // Fix extent of category angle axis
- if(
- // Reset scale
- i.scale.setExtent(Infinity,-Infinity),o.scale.setExtent(Infinity,-Infinity),t.eachSeries((function(t){if(t.coordinateSystem===n){var e=t.getData();a(cf(e,"radius"),(function(t){o.scale.unionExtentFromData(e,t)})),a(cf(e,"angle"),(function(t){i.scale.unionExtentFromData(e,t)}))}})),nf(i.scale,i.model),nf(o.scale,o.model),"category"===i.type&&!i.onBand){var r=i.getExtent(),s=360/i.scale.count();i.inverse?r[1]+=s:r[1]-=s,i.setExtent(r[0],r[1])}}
- /**
- * Set common axis properties
- */
- function yA(t,e){var n;if(t.type=e.get("type"),t.scale=of(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),function(t){return"angleAxis"===t.mainType}(e)){t.inverse=t.inverse!==e.get("clockwise");var i=e.get("startAngle"),o=null!==(n=e.get("endAngle"))&&void 0!==n?n:i+(t.inverse?-360:360);t.setExtent(i,o)}
- // Inject axis instance
- e.axis=t,t.model=e}var mA={dimensions:dA,create:function(t,e){var n=[];return t.eachComponent("polar",(function(t,o){var r=new fA(o+"");
- // Inject resize and update method
- r.update=gA;var a=r.getRadiusAxis(),s=r.getAngleAxis(),l=t.findAxisModel("radiusAxis"),u=t.findAxisModel("angleAxis");yA(a,l),yA(s,u),function(t,e,n){var o=e.get("center"),r=n.getWidth(),a=n.getHeight();t.cx=je(o[0],r),t.cy=je(o[1],a);var s=t.getRadiusAxis(),l=Math.min(r,a)/2,u=e.get("radius");null==u?u=[0,"100%"]:i(u)||(
- // r0 = 0
- u=[0,u]);var c=[je(u[0],l),je(u[1],l)];s.inverse?s.setExtent(c[1],c[0]):s.setExtent(c[0],c[1])}(r,t,e),n.push(r),t.coordinateSystem=r,r.model=t})),
- // Inject coordinateSystem to series
- t.eachSeries((function(t){if("polar"===t.get("coordinateSystem")){var e=t.getReferringComponents("polar",zn).models[0];t.coordinateSystem=e.coordinateSystem}})),n}};const vA=mA;var xA=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function _A(t,e,n){e[1]>e[0]&&(e=e.slice().reverse());var i=t.coordToPoint([e[0],n]),o=t.coordToPoint([e[1],n]);return{x1:i[0],y1:i[1],x2:o[0],y2:o[1]}}function bA(t){return t.getRadiusAxis().inverse?0:1}
- // Remove the last tick which will overlap the first tick
- function SA(t){var e=t[0],n=t[t.length-1];e&&n&&Math.abs(Math.abs(e.coord-n.coord)-360)<1e-4&&t.pop()}var wA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="PolarAxisPointer",n}return Ue(e,t),e.prototype.render=function(t,e){if(this.group.removeAll(),t.get("show")){var i=t.axis,o=i.polar,r=o.getRadiusAxis().getExtent(),s=i.getTicksCoords(),l=i.getMinorTicksCoords(),u=n(i.getViewLabels(),(function(t){t=et(t);var e=i.scale,n="ordinal"===e.type?e.getRawOrdinalNumber(t.tickValue):t.tickValue;return t.coord=i.dataToCoord(n),t}));SA(u),SA(s),a(xA,(function(e){!t.get([e,"show"])||i.scale.isBlank()&&"axisLine"!==e||MA[e](this.group,t,o,s,l,r,u)}),this)}},e.type="angleAxis",e}(av),MA={axisLine:function(t,e,n,i,o,r){var a,s=e.getModel(["axisLine","lineStyle"]),l=n.getAngleAxis(),u=Math.PI/180,c=l.getExtent(),d=bA(n),h=d?0:1,p=360===Math.abs(c[1]-c[0])?"Circle":"Arc";(a=0===r[h]?new Go[p]({shape:{cx:n.cx,cy:n.cy,r:r[d],startAngle:-c[0]*u,endAngle:-c[1]*u,clockwise:l.inverse},style:s.getLineStyle(),z2:1,silent:!0}):new V({shape:{cx:n.cx,cy:n.cy,r:r[d],r0:r[h]},style:s.getLineStyle(),z2:1,silent:!0})).style.fill=null,t.add(a)},axisTick:function(t,e,i,o,r,a){var s=e.getModel("axisTick"),l=(s.get("inside")?-1:1)*s.get("length"),u=a[bA(i)],c=n(o,(function(t){return new F({shape:_A(i,[u,u+l],t.coord)})}));t.add(So(c,{style:I(s.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,n,i,o,r){if(o.length){for(var a=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(a.get("inside")?-1:1)*s.get("length"),u=r[bA(n)],c=[],d=0;d<o.length;d++)for(var h=0;h<o[d].length;h++)c.push(new F({shape:_A(n,[u,u+l],o[d][h].coord)}));t.add(So(c,{style:I(s.getModel("lineStyle").getLineStyle(),I(a.getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])}))}))}},axisLabel:function(t,e,n,i,r,s,l){var u=e.getCategories(!0),c=e.getModel("axisLabel"),d=c.get("margin"),h=e.get("triggerEvent");
- // Use length of ticksAngles because it may remove the last tick to avoid overlapping
- a(l,(function(i,r){var a=c,l=i.tickValue,p=s[bA(n)],f=n.coordToPoint([p+d,i.coord]),g=n.cx,y=n.cy,m=Math.abs(f[0]-g)/p<.3?"center":f[0]>g?"left":"right",v=Math.abs(f[1]-y)/p<.3?"middle":f[1]>y?"top":"bottom";if(u&&u[l]){var x=u[l];o(x)&&x.textStyle&&(a=new yr(x.textStyle,c,c.ecModel))}var _=new $({silent:$m.isLabelSilent(e),style:Zo(a,{x:f[0],y:f[1],fill:a.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:i.formattedLabel,align:m,verticalAlign:v})});
- // Pack data for mouse event
- if(t.add(_),h){var b=$m.makeAxisEventDataBase(e);b.targetType="axisLabel",b.value=i.rawLabel,ni(_).eventData=b}}),this)},splitLine:function(t,e,n,i,o,r){var a=e.getModel("splitLine").getModel("lineStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=0;c<i.length;c++){var d=l++%s.length;u[d]=u[d]||[],u[d].push(new F({shape:_A(n,r,i[c].coord)}))}
- // Simple optimization
- // Batching the lines if color are the same
- for(c=0;c<u.length;c++)t.add(So(u[c],{style:I({stroke:s[c%s.length]},a.getLineStyle()),silent:!0,z:e.get("z")}))},minorSplitLine:function(t,e,n,i,o,r){if(o.length){for(var a=e.getModel("minorSplitLine").getModel("lineStyle"),s=[],l=0;l<o.length;l++)for(var u=0;u<o[l].length;u++)s.push(new F({shape:_A(n,r,o[l][u].coord)}));t.add(So(s,{style:a.getLineStyle(),silent:!0,z:e.get("z")}))}},splitArea:function(t,e,n,i,o,r){if(i.length){var a=e.getModel("splitArea").getModel("areaStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=Math.PI/180,d=-i[0].coord*c,h=Math.min(r[0],r[1]),p=Math.max(r[0],r[1]),f=e.get("clockwise"),g=1,y=i.length;g<=y;g++){var m=g===y?i[0].coord:i[g].coord,v=l++%s.length;u[v]=u[v]||[],u[v].push(new E({shape:{cx:n.cx,cy:n.cy,r0:h,r:p,startAngle:d,endAngle:-m*c,clockwise:f},silent:!0})),d=-m*c}
- // Simple optimization
- // Batching the lines if color are the same
- for(g=0;g<u.length;g++)t.add(So(u[g],{style:I({fill:s[g%s.length]},a.getAreaStyle()),silent:!0}))}}};const IA=wA;var DA=["axisLine","axisTickLabel","axisName"],TA=["splitLine","splitArea","minorSplitLine"],CA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="PolarAxisPointer",n}return Ue(e,t),e.prototype.render=function(t,e){if(this.group.removeAll(),t.get("show")){var n=this._axisGroup,i=this._axisGroup=new Z;this.group.add(i);var o=t.axis,r=o.polar,s=r.getAngleAxis(),l=o.getTicksCoords(),u=o.getMinorTicksCoords(),c=s.getExtent()[0],d=o.getExtent(),h=
- /**
- * @inner
- */
- function(t,e,n){return{position:[t.cx,t.cy],rotation:n/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:e.getModel("axisLabel").get("rotate"),
- // Over splitLine and splitArea
- z2:1}}(r,t,c),p=new $m(t,h);a(DA,p.add,p),i.add(p.getGroup()),Lo(n,i,t),a(TA,(function(e){t.get([e,"show"])&&!o.scale.isBlank()&&AA[e](this.group,t,r,c,d,l,u)}),this)}},e.type="radiusAxis",e}(av),AA={splitLine:function(t,e,n,i,o,r){var a=e.getModel("splitLine").getModel("lineStyle"),s=a.get("color"),l=0,u=n.getAngleAxis(),c=Math.PI/180,d=u.getExtent(),h=360===Math.abs(d[1]-d[0])?"Circle":"Arc";s=s instanceof Array?s:[s];for(var p=[],f=0;f<r.length;f++){var g=l++%s.length;p[g]=p[g]||[],p[g].push(new Go[h]({shape:{cx:n.cx,cy:n.cy,
- // ensure circle radius >= 0
- r:Math.max(r[f].coord,0),startAngle:-d[0]*c,endAngle:-d[1]*c,clockwise:u.inverse}}))}
- // Simple optimization
- // Batching the lines if color are the same
- for(f=0;f<p.length;f++)t.add(So(p[f],{style:I({stroke:s[f%s.length],fill:null},a.getLineStyle()),silent:!0}))},minorSplitLine:function(t,e,n,i,o,r,a){if(a.length){for(var s=e.getModel("minorSplitLine").getModel("lineStyle"),l=[],u=0;u<a.length;u++)for(var c=0;c<a[u].length;c++)l.push(new O({shape:{cx:n.cx,cy:n.cy,r:a[u][c].coord}}));t.add(So(l,{style:I({fill:null},s.getLineStyle()),silent:!0}))}},splitArea:function(t,e,n,i,o,r){if(r.length){var a=e.getModel("splitArea").getModel("areaStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=r[0].coord,d=1;d<r.length;d++){var h=l++%s.length;u[h]=u[h]||[],u[h].push(new E({shape:{cx:n.cx,cy:n.cy,r0:c,r:r[d].coord,startAngle:0,endAngle:2*Math.PI},silent:!0})),c=r[d].coord}
- // Simple optimization
- // Batching the lines if color are the same
- for(d=0;d<u.length;d++)t.add(So(u[d],{style:I({fill:s[d%s.length]},a.getAreaStyle()),silent:!0}))}}};const LA=CA;function kA(t){return t.get("stack")||"__ec_stack_"+t.seriesIndex}function PA(t,e){return e.dim+t.model.componentIndex}function NA(t,e,n){var i={},o=
- /**
- * Calculate bar width and offset for radial bar charts
- */
- function(t){
- // Columns info on each category axis. Key is polar name
- var e={};a(t,(function(t,n){var i=t.getData(),o=t.coordinateSystem,r=o.getBaseAxis(),a=PA(o,r),s=r.getExtent(),l="category"===r.type?r.getBandWidth():Math.abs(s[1]-s[0])/i.count(),u=e[a]||{bandWidth:l,remainedWidth:l,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},c=u.stacks;e[a]=u;var d=kA(t);c[d]||u.autoWidthCount++,c[d]=c[d]||{width:0,maxWidth:0};var h=je(t.get("barWidth"),l),p=je(t.get("barMaxWidth"),l),f=t.get("barGap"),g=t.get("barCategoryGap");h&&!c[d].width&&(h=Math.min(u.remainedWidth,h),c[d].width=h,u.remainedWidth-=h),p&&(c[d].maxWidth=p),null!=f&&(u.gap=f),null!=g&&(u.categoryGap=g)}));var n={};return a(e,(function(t,e){n[e]={};var i=t.stacks,o=t.bandWidth,r=je(t.categoryGap,o),s=je(t.gap,1),l=t.remainedWidth,u=t.autoWidthCount,c=(l-r)/(u+(u-1)*s);c=Math.max(c,0),
- // Find if any auto calculated bar exceeded maxBarWidth
- a(i,(function(t,e){var n=t.maxWidth;n&&n<c&&(n=Math.min(n,l),t.width&&(n=Math.min(n,t.width)),l-=n,t.width=n,u--)})),
- // Recalculate width again
- c=(l-r)/(u+(u-1)*s),c=Math.max(c,0);var d,h=0;a(i,(function(t,e){t.width||(t.width=c),d=t,h+=t.width*(1+s)})),d&&(h-=d.width*s);var p=-h/2;a(i,(function(t,i){n[e][i]=n[e][i]||{offset:p,width:t.width},p+=t.width*(1+s)}))})),n}(st(e.getSeriesByType(t),(function(t){return!e.isSeriesFiltered(t)&&t.coordinateSystem&&"polar"===t.coordinateSystem.type})));e.eachSeriesByType(t,(function(t){
- // Check series coordinate, do layout for polar only
- if("polar"===t.coordinateSystem.type){var e=t.getData(),n=t.coordinateSystem,r=n.getBaseAxis(),a=PA(n,r),s=kA(t),l=o[a][s],u=l.offset,c=l.width,d=n.getOtherAxis(r),h=t.coordinateSystem.cx,p=t.coordinateSystem.cy,f=t.get("barMinHeight")||0,g=t.get("barMinAngle")||0;i[s]=i[s]||[];for(var y=e.mapDimension(d.dim),m=e.mapDimension(r.dim),v=qh(e,y/* , baseDim */),x="radius"!==r.dim||!t.get("roundCap",!0),_=d.model.get("startValue"),b=d.dataToCoord(_||0),S=0,w=e.count();S<w;S++){var M=e.get(y,S),I=e.get(m,S),D=M>=0?"p":"n",T=b;
- // Because of the barMinHeight, we can not use the value in
- // stackResultDimension directly.
- // Only ordinal axis can be stacked.
- v&&(i[s][I]||(i[s][I]={p:b,n:b}),
- // Should also consider #4243
- T=i[s][I][D]);var C=void 0,A=void 0,L=void 0,k=void 0;
- // radial sector
- if("radius"===d.dim){var P=d.dataToCoord(M)-b,N=r.dataToCoord(I);Math.abs(P)<f&&(P=(P<0?-1:1)*f),C=T,A=T+P,k=(L=N-u)-c,v&&(i[s][I][D]=A)}
- // tangential sector
- else{var O=d.dataToCoord(M,x)-b,R=r.dataToCoord(I);Math.abs(O)<g&&(O=(O<0?-1:1)*g),A=(C=R+u)+c,L=T,k=T+O,
- // if the previous stack is at the end of the ring,
- // add a round to differentiate it from origin
- // let extent = angleAxis.getExtent();
- // let stackCoord = angle;
- // if (stackCoord === extent[0] && value > 0) {
- // stackCoord = extent[1];
- // }
- // else if (stackCoord === extent[1] && value < 0) {
- // stackCoord = extent[0];
- // }
- v&&(i[s][I][D]=k)}e.setItemLayout(S,{cx:h,cy:p,r0:C,r:A,
- // Consider that positive angle is anti-clockwise,
- // while positive radian of sector is clockwise
- startAngle:-L*Math.PI/180,endAngle:-k*Math.PI/180,
- /**
- * Keep the same logic with bar in catesion: use end value to
- * control direction. Notice that if clockwise is true (by
- * default), the sector will always draw clockwisely, no matter
- * whether endAngle is greater or less than startAngle.
- */
- clockwise:L>=k})}}}))}var OA={startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:0}},RA={splitNumber:5},EA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="polar",e}(Mu);function VA(t,e){e=e||{};var n=t.coordinateSystem,i=t.axis,o={},r=i.position,a=i.orient,s=n.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};o.position=["vertical"===a?u.vertical[r]:l[0],"horizontal"===a?u.horizontal[r]:l[3]];o.rotation=Math.PI/2*{horizontal:0,vertical:1}[a];o.labelDirection=o.tickDirection=o.nameDirection={top:-1,bottom:1,right:1,left:-1}[r],t.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),Yt(e.labelInside,t.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var c=e.rotate;return null==c&&(c=t.get(["axisLabel","rotate"])),o.labelRotation="top"===r?-c:c,o.z2=1,o}var zA=["axisLine","axisTickLabel","axisName"],BA=["splitArea","splitLine"],GA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="SingleAxisPointer",n}return Ue(e,t),e.prototype.render=function(e,n,i,o){var r=this.group;r.removeAll();var s=this._axisGroup;this._axisGroup=new Z;var l=VA(e),u=new $m(e,l);a(zA,u.add,u),r.add(this._axisGroup),r.add(u.getGroup()),a(BA,(function(t){e.get([t,"show"])&&FA[t](this,this.group,this._axisGroup,e)}),this),Lo(s,this._axisGroup,e),t.prototype.render.call(this,e,n,i,o)},e.prototype.remove=function(){uv(this)},e.type="singleAxis",e}(av),FA={splitLine:function(t,e,n,i){var o=i.axis;if(!o.scale.isBlank()){var r=i.getModel("splitLine"),a=r.getModel("lineStyle"),s=a.get("color");s=s instanceof Array?s:[s];for(var l=a.get("width"),u=i.coordinateSystem.getRect(),c=o.isHorizontal(),d=[],h=0,p=o.getTicksCoords({tickModel:r}),f=[],g=[],y=0;y<p.length;++y){var m=o.toGlobalCoord(p[y].coord);c?(f[0]=m,f[1]=u.y,g[0]=m,g[1]=u.y+u.height):(f[0]=u.x,f[1]=m,g[0]=u.x+u.width,g[1]=m);var v=new F({shape:{x1:f[0],y1:f[1],x2:g[0],y2:g[1]},silent:!0});Mo(v.shape,l);var x=h++%s.length;d[x]=d[x]||[],d[x].push(v)}var _=a.getLineStyle(["color"]);for(y=0;y<d.length;++y)e.add(So(d[y],{style:I({stroke:s[y%s.length]},_),silent:!0}))}},splitArea:function(t,e,n,i){lv(t,n,i,i)}};const WA=GA;var HA=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.getCoordSysModel=function(){return this},e.type="singleAxis",e.layoutMode="box",e.defaultOption={left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:1,type:"solid"}},
- // Single coordinate system and single axis is the,
- // which is used as the parent tooltip model.
- // same model, so we set default tooltip show as true.
- tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:1}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}}},e}(Ta);nt(HA,df.prototype);const YA=HA;var UA=/** @class */function(t){function e(e,n,i,o,r){var a=t.call(this,e,n,i)||this;return a.type=o||"value",a.position=r||"bottom",a}
- /**
- * Judge the orient of the axis.
- */return Ue(e,t),e.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},e.prototype.pointToData=function(t,e){return this.coordinateSystem.pointToData(t)[0]},e}(Yf);const ZA=UA;var XA=["single"],jA=/** @class */function(){function t(t,e,n){this.type="single",this.dimension="single",
- /**
- * Add it just for draw tooltip.
- */
- this.dimensions=XA,this.axisPointerEnabled=!0,this.model=t,this._init(t,e,n)}
- /**
- * Initialize single coordinate system.
- */return t.prototype._init=function(t,e,n){var i=this.dimension,o=new ZA(i,of(t),[0,0],t.get("type"),t.get("position")),r="category"===o.type;o.onBand=r&&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 axis scale after data processed
- */
- t.prototype.update=function(t,e){t.eachSeries((function(t){if(t.coordinateSystem===this){var e=t.getData();a(e.mapDimensionsAll(this.dimension),(function(t){this._axis.scale.unionExtentFromData(e,t)}),this),nf(this._axis.scale,this._axis.model)}}),this)},
- /**
- * Resize the single coordinate system.
- */
- t.prototype.resize=function(t,e){this._rect=xa({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()},t.prototype.getRect=function(){return this._rect},t.prototype._adjustAxis=function(){var t=this._rect,e=this._axis,n=e.isHorizontal(),i=n?[0,t.width]:[0,t.height],o=e.inverse?1:0;e.setExtent(i[o],i[1-o]),this._updateAxisTransform(e,n?t.x:t.y)},t.prototype._updateAxisTransform=function(t,e){var n=t.getExtent(),i=n[0]+n[1],o=t.isHorizontal();t.toGlobalCoord=o?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord=o?function(t){return t-e}:function(t){return i-t+e}},
- /**
- * Get axis.
- */
- t.prototype.getAxis=function(){return this._axis},
- /**
- * Get axis, add it just for draw tooltip.
- */
- t.prototype.getBaseAxis=function(){return this._axis},t.prototype.getAxes=function(){return[this._axis]},t.prototype.getTooltipAxes=function(){return{baseAxes:[this.getAxis()],
- // Empty otherAxes
- otherAxes:[]}},
- /**
- * If contain point.
- */
- t.prototype.containPoint=function(t){var e=this.getRect(),n=this.getAxis();return"horizontal"===n.orient?n.contain(n.toLocalCoord(t[0]))&&t[1]>=e.y&&t[1]<=e.y+e.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},t.prototype.pointToData=function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},
- /**
- * Convert the series data to concrete point.
- * Can be [val] | val
- */
- t.prototype.dataToPoint=function(t){var e=this.getAxis(),n=this.getRect(),i=[],o="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),i[o]=e.toGlobalCoord(e.dataToCoord(+t)),i[1-o]=0===o?n.y+n.height/2:n.x+n.width/2,i},t.prototype.convertToPixel=function(t,e,n){return qA(e)===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){return qA(e)===this?this.pointToData(n):null},t}();
- /**
- * Create a single coordinates system.
- */function qA(t){var e=t.seriesModel,n=t.singleAxisModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}
- /**
- * Create single coordinate system and inject it into seriesModel.
- */const KA={create:function(t,e){var n=[];return t.eachComponent("singleAxis",(function(i,o){var r=new jA(i,t,e);r.name="single_"+o,r.resize(i,e),i.coordinateSystem=r,n.push(r)})),t.eachSeries((function(t){if("singleAxis"===t.get("coordinateSystem")){var e=t.getReferringComponents("singleAxis",zn).models[0];t.coordinateSystem=e&&e.coordinateSystem}})),n},dimensions:XA};var JA=["x","y"],$A=["width","height"],QA=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}
- /**
- * @override
- */return Ue(e,t),e.prototype.makeElOption=function(t,e,n,i,o){var r=n.axis,a=r.coordinateSystem,s=nL(a,1-eL(r)),l=a.dataToPoint(e)[0],u=i.get("type");if(u&&"none"!==u){var c=SC(i),d=tL[u](r,l,s);d.style=c,t.graphicKey=d.type,t.pointer=d}DC(
- // @ts-ignore
- e,t,VA(n),n,i,o)},
- /**
- * @override
- */
- e.prototype.getHandleTransform=function(t,e,n){var i=VA(e,{labelInside:!1});
- // @ts-ignore
- i.labelMargin=n.get(["handle","margin"]);var o=IC(e.axis,t,i);return{x:o[0],y:o[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},
- /**
- * @override
- */
- e.prototype.updateHandleTransform=function(t,e,n,i){var o=n.axis,r=o.coordinateSystem,a=eL(o),s=nL(r,a),l=[t.x,t.y];l[a]+=e[a],l[a]=Math.min(s[1],l[a]),l[a]=Math.max(s[0],l[a]);var u=nL(r,1-a),c=(u[1]+u[0])/2,d=[c,c];return d[a]=l[a],{x:l[0],y:l[1],rotation:t.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}},e}(bC),tL={line:function(t,e,n){return{type:"Line",subPixelOptimize:!0,shape:TC([e,n[0]],[e,n[1]],eL(t))}},shadow:function(t,e,n){var i=t.getBandWidth(),o=n[1]-n[0];return{type:"Rect",shape:CC([e-i/2,n[0]],[i,o],eL(t))}}};function eL(t){return t.isHorizontal()?0:1}function nL(t,e){var n=t.getRect();return[n[JA[e]],n[JA[e]]+n[$A[e]]]}const iL=QA;var oL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="single",e}(Mu);function rL(t,e){
- // Normalize cellSize
- var o,r=t.cellSize;1===(o=i(r)?r:t.cellSize=[r,r]).length&&(o[1]=o[0]);var a=n([0,1],(function(t){
- // If user have set `width` or both `left` and `right`, cellSizeArr
- // will be automatically set to 'auto', otherwise the default
- // setting of cellSizeArr will make `width` setting not work.
- return function(t,e){return null!=t[ya[e][0]]||null!=t[ya[e][1]]&&null!=t[ya[e][2]]}(e,t)&&(o[t]="auto"),null!=o[t]&&"auto"!==o[t]}));Sa(t,e,{type:"box",ignoreSize:a})}const aL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}
- /**
- * @override
- */return Ue(e,t),e.prototype.init=function(e,n,i){var o=wa(e);t.prototype.init.apply(this,arguments),rL(e,o)},
- /**
- * @override
- */
- e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),rL(this.option,e)},e.prototype.getCellSize=function(){
- // Has been normalized
- return this.option.cellSize},e.type="calendar",e.defaultOption={
- // zlevel: 0,
- z:2,left:80,top:60,cellSize:20,
- // horizontal vertical
- orient:"horizontal",
- // month separate line style
- splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},
- // rect style temporarily unused emphasis
- itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},
- // week text style
- dayLabel:{show:!0,firstDay:0,
- // start end
- position:"start",margin:"50%",color:"#000"},
- // month text style
- monthLabel:{show:!0,
- // start end
- position:"start",margin:5,
- // center or left
- align:"center",formatter:null,color:"#000"},
- // year text style
- yearLabel:{show:!0,
- // top bottom left right
- position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(Ta);var sL=/** @class */function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.type,t}return Ue(i,e),i.prototype.render=function(t,e,n){var i=this.group;i.removeAll();var o=t.coordinateSystem,r=o.getRangeInfo(),a=o.getOrient(),s=e.getLocaleModel();
- // range info
- this._renderDayRect(t,r,i),
- // _renderLines must be called prior to following function
- this._renderLines(t,r,a,i),this._renderYearText(t,r,a,i),this._renderMonthText(t,s,a,i),this._renderWeekText(t,s,r,a,i)},
- // render day rect
- i.prototype._renderDayRect=function(t,e,n){for(var i=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),r=i.getCellWidth(),a=i.getCellHeight(),s=e.start.time;s<=e.end.time;s=i.getNextNDay(s,1).time){var l=i.dataToRect([s],!1).tl,u=new G({shape:{x:l[0],y:l[1],width:r,height:a},cursor:"default",style:o});
- // every rect
- n.add(u)}},
- // render separate line
- i.prototype._renderLines=function(t,e,n,i){var o=this,r=t.coordinateSystem,a=t.getModel(["splitLine","lineStyle"]).getLineStyle(),s=t.get(["splitLine","show"]),l=a.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=e.start,c=0;u.time<=e.end.time;c++){h(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)}function h(e){o._firstDayOfMonth.push(r.getDateInfo(e)),o._firstDayPoints.push(r.dataToRect([e],!1).tl);var l=o._getLinePointsOfOneWeek(t,e,n);o._tlpoints.push(l[0]),o._blpoints.push(l[l.length-1]),s&&o._drawSplitline(l,a,i)}
- // render top/left line
- h(r.getNextNDay(e.end.time,1).formatedDate),s&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,l,n),a,i),
- // render bottom/right line
- s&&this._drawSplitline(o._getEdgesPoints(o._blpoints,l,n),a,i)},
- // get points at both ends
- i.prototype._getEdgesPoints=function(t,e,n){var i=[t[0].slice(),t[t.length-1].slice()],o="horizontal"===n?0:1;
- // both ends of the line are extend half lineWidth
- return i[0][o]=i[0][o]-e/2,i[1][o]=i[1][o]+e/2,i},
- // render split line
- i.prototype._drawSplitline=function(t,e,n){var i=new B({z2:20,shape:{points:t},style:e});n.add(i)},
- // render month line of one week points
- i.prototype._getLinePointsOfOneWeek=function(t,e,n){for(var i=t.coordinateSystem,o=i.getDateInfo(e),r=[],a=0;a<7;a++){var s=i.getNextNDay(o.time,a),l=i.dataToRect([s.time],!1);r[2*s.day]=l.tl,r[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return r},i.prototype._formatterLabel=function(e,n){return t(e)&&e?(i=e,a(n,(function(t,e){i=i.replace("{"+e+"}",o?ot(t):t)})),i):f(e)?e(n):n.nameMap;var i,o},i.prototype._yearTextPositionControl=function(t,e,n,i,o){var r=e[0],a=e[1],s=["center","bottom"];"bottom"===i?(a+=o,s=["center","top"]):"left"===i?r-=o:"right"===i?(r+=o,s=["center","top"]):
- // top
- a-=o;var l=0;return"left"!==i&&"right"!==i||(l=Math.PI/2),{rotation:l,x:r,y:a,style:{align:s[0],verticalAlign:s[1]}}},
- // render year
- i.prototype._renderYearText=function(t,e,n,i){var o=t.getModel("yearLabel");if(o.get("show")){var r=o.get("margin"),a=o.get("position");a||(a="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,c="horizontal"===n?0:1,d={top:[l,s[c][1]],bottom:[l,s[1-c][1]],left:[s[1-c][0],u],right:[s[c][0],u]},h=e.start.y;+e.end.y>+e.start.y&&(h=h+"-"+e.end.y);var p=o.get("formatter"),f={start:e.start.y,end:e.end.y,nameMap:h},g=this._formatterLabel(p,f),y=new $({z2:30,style:Zo(o,{text:g}),silent:o.get("silent")});y.attr(this._yearTextPositionControl(y,d[a],n,a,r)),i.add(y)}},i.prototype._monthTextPositionControl=function(t,e,n,i,o){var r="left",a="top",s=t[0],l=t[1];return"horizontal"===n?(l+=o,e&&(r="center"),"start"===i&&(a="bottom")):(s+=o,e&&(a="middle"),"start"===i&&(r="right")),{x:s,y:l,align:r,verticalAlign:a}},
- // render month and year text
- i.prototype._renderMonthText=function(e,n,i,o){var r=e.getModel("monthLabel");if(r.get("show")){var a=r.get("nameMap"),s=r.get("margin"),l=r.get("position"),u=r.get("align"),c=[this._tlpoints,this._blpoints];a&&!t(a)||(a&&(
- // case-sensitive
- n=Tr(a)||n),
- // PENDING
- // for ZH locale, original form is `一月` but current form is `1月`
- a=n.get(["time","monthAbbr"])||[]);var d="start"===l?0:1,h="horizontal"===i?0:1;s="start"===l?-s:s;for(var f="center"===u,g=r.get("silent"),y=0;y<c[d].length-1;y++){var m=c[d][y].slice(),v=this._firstDayOfMonth[y];if(f){var x=this._firstDayPoints[y];m[h]=(x[h]+c[0][y+1][h])/2}var _=r.get("formatter"),b=a[+v.m-1],S={yyyy:v.y,yy:(v.y+"").slice(2),MM:v.m,M:+v.m,nameMap:b},w=this._formatterLabel(_,S),M=new $({z2:30,style:p(Zo(r,{text:w}),this._monthTextPositionControl(m,f,i,l,s)),silent:g});o.add(M)}}},i.prototype._weekTextPositionControl=function(t,e,n,i,o){var r="center",a="middle",s=t[0],l=t[1],u="start"===n;return"horizontal"===e?(s=s+i+(u?1:-1)*o[0]/2,r=u?"right":"left"):(l=l+i+(u?1:-1)*o[1]/2,a=u?"bottom":"top"),{x:s,y:l,align:r,verticalAlign:a}},
- // render weeks
- i.prototype._renderWeekText=function(e,i,o,r,a){var s=e.getModel("dayLabel");if(s.get("show")){var l=e.coordinateSystem,u=s.get("position"),c=s.get("nameMap"),d=s.get("margin"),h=l.getFirstDayOfWeek();if(!c||t(c))c&&(
- // case-sensitive
- i=Tr(c)||i),c=i.get(["time","dayOfWeekShort"])||n(i.get(["time","dayOfWeekAbbr"]),(function(t){return t[0]}));
- // Use the first letter of `dayOfWeekAbbr` if `dayOfWeekShort` doesn't exist in the locale file
- var f=l.getNextNDay(o.end.time,7-o.lweek).time,g=[l.getCellWidth(),l.getCellHeight()];d=je(d,Math.min(g[1],g[0])),"start"===u&&(f=l.getNextNDay(o.start.time,-(7+o.fweek)).time,d=-d);for(var y=s.get("silent"),m=0;m<7;m++){var v,x=l.getNextNDay(f,m),_=l.dataToRect([x.time],!1).center;v=Math.abs((m+h)%7);var b=new $({z2:30,style:p(Zo(s,{text:c[v]}),this._weekTextPositionControl(_,r,u,d,g)),silent:y});a.add(b)}}},i.type="calendar",i}(Mu);const lL=sL;
- // (24*60*60*1000)
- var uL=864e5,cL=/** @class */function(){function t(e,n,i){this.type="calendar",this.dimensions=t.dimensions,
- // Required in createListFromData
- this.getDimensionsInfo=t.getDimensionsInfo,this._model=e}return t.getDimensionsInfo=function(){return[{name:"time",type:"time"},"value"]},t.prototype.getRangeInfo=function(){return this._rangeInfo},t.prototype.getModel=function(){return this._model},t.prototype.getRect=function(){return this._rect},t.prototype.getCellWidth=function(){return this._sw},t.prototype.getCellHeight=function(){return this._sh},t.prototype.getOrient=function(){return this._orient},
- /**
- * getFirstDayOfWeek
- *
- * @example
- * 0 : start at Sunday
- * 1 : start at Monday
- *
- * @return {number}
- */
- t.prototype.getFirstDayOfWeek=function(){return this._firstDayOfWeek},
- /**
- * get date info
- * }
- */
- t.prototype.getDateInfo=function(t){var e=(t=sn(t)).getFullYear(),n=t.getMonth()+1,i=n<10?"0"+n:""+n,o=t.getDate(),r=o<10?"0"+o:""+o,a=t.getDay();return{y:e+"",m:i,d:r,day:a=Math.abs((a+7-this.getFirstDayOfWeek())%7),time:t.getTime(),formatedDate:e+"-"+i+"-"+r,date:t}},t.prototype.getNextNDay=function(t,e){return 0===(e=e||0)||(t=new Date(this.getDateInfo(t).time)).setDate(t.getDate()+e),this.getDateInfo(t)},t.prototype.update=function(t,e){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,i=["width","height"],o=this._model.getCellSize().slice(),r=this._model.getBoxLayoutParams(),s="horizontal"===this._orient?[n,7]:[7,n];a([0,1],(function(t){c(o,t)&&(r[i[t]]=o[t]*s[t])}));var l={width:e.getWidth(),height:e.getHeight()},u=this._rect=xa(r,l);function c(t,e){return null!=t[e]&&"auto"!==t[e]}
- // Has been calculated out number.
- a([0,1],(function(t){c(o,t)||(o[t]=u[i[t]]/s[t])})),this._sw=o[0],this._sh=o[1]},
- /**
- * Convert a time data(time, value) item to (x, y) point.
- */
- // TODO Clamp of calendar is not same with cartesian coordinate systems.
- // It will return NaN if data exceeds.
- t.prototype.dataToPoint=function(t,e){i(t)&&(t=t[0]),null==e&&(e=!0);var n=this.getDateInfo(t),o=this._rangeInfo,r=n.formatedDate;
- // if not in range return [NaN, NaN]
- if(e&&!(n.time>=o.start.time&&n.time<o.end.time+uL))return[NaN,NaN];var a=n.day,s=this._getRangeInfo([o.start.time,r]).nthWeek;return"vertical"===this._orient?[this._rect.x+a*this._sw+this._sw/2,this._rect.y+s*this._sh+this._sh/2]:[this._rect.x+s*this._sw+this._sw/2,this._rect.y+a*this._sh+this._sh/2]},
- /**
- * Convert a (x, y) point to time data
- */
- t.prototype.pointToData=function(t){var e=this.pointToDate(t);return e&&e.time},
- /**
- * Convert a time date item to (x, y) four point.
- */
- t.prototype.dataToRect=function(t,e){var n=this.dataToPoint(t,e);return{contentShape:{x:n[0]-(this._sw-this._lineWidth)/2,y:n[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:n,tl:[n[0]-this._sw/2,n[1]-this._sh/2],tr:[n[0]+this._sw/2,n[1]-this._sh/2],br:[n[0]+this._sw/2,n[1]+this._sh/2],bl:[n[0]-this._sw/2,n[1]+this._sh/2]}},
- /**
- * Convert a (x, y) point to time date
- *
- * @param {Array} point point
- * @return {Object} date
- */
- t.prototype.pointToDate=function(t){var e=Math.floor((t[0]-this._rect.x)/this._sw)+1,n=Math.floor((t[1]-this._rect.y)/this._sh)+1,i=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(n,e-1,i):this._getDateByWeeksAndDay(e,n-1,i)},t.prototype.convertToPixel=function(t,e,n){var i=dL(e);return i===this?i.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){var i=dL(e);return i===this?i.pointToData(n):null},t.prototype.containPoint=function(t){return!1},
- /**
- * initRange
- * Normalize to an [start, end] array
- */
- t.prototype._initRangeOption=function(){var t,e=this._model.get("range");if(
- // Convert [1990] to 1990
- i(e)&&1===e.length&&(e=e[0]),i(e))t=e;else{var n=e.toString();
- // One year.
- // One month
- if(/^\d{4}$/.test(n)&&(t=[n+"-01-01",n+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(n)){var o=this.getDateInfo(n),r=o.date;r.setMonth(r.getMonth()+1);var a=this.getNextNDay(r,-1);t=[o.formatedDate,a.formatedDate]}
- // One day
- /^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(n)&&(t=[n,n])}if(!t)
- // Not handling it.
- return e;var s=this._getRangeInfo(t);return s.start.time>s.end.time&&t.reverse(),t},
- /**
- * range info
- *
- * @private
- * @param {Array} range range ['2017-01-01', '2017-07-08']
- * If range[0] > range[1], they will not be reversed.
- * @return {Object} obj
- */
- t.prototype._getRangeInfo=function(t){var e,n=[this.getDateInfo(t[0]),this.getDateInfo(t[1])];n[0].time>n[1].time&&(e=!0,n.reverse());var i=Math.floor(n[1].time/uL)-Math.floor(n[0].time/uL)+1,o=new Date(n[0].time),r=o.getDate(),a=n[1].date.getDate();
- // Consider case1 (#11677 #10430):
- // Set the system timezone as "UK", set the range to `['2016-07-01', '2016-12-31']`
- // Consider case2:
- // Firstly set system timezone as "Time Zone: America/Toronto",
- // ```
- // let first = new Date(1478412000000 - 3600 * 1000 * 2.5);
- // let second = new Date(1478412000000);
- // let allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1;
- // ```
- // will get wrong result because of DST. So we should fix it.
- o.setDate(r+i-1);
- // The bias can not over a month, so just compare date.
- var s=o.getDate();if(s!==a)for(var l=o.getTime()-n[1].time>0?1:-1;(s=o.getDate())!==a&&(o.getTime()-n[1].time)*l>0;)i-=l,o.setDate(s-l);var u=Math.floor((i+n[0].day+6)/7),c=e?1-u:u-1;return e&&n.reverse(),{range:[n[0].formatedDate,n[1].formatedDate],start:n[0],end:n[1],allDay:i,weeks:u,
- // From 0.
- nthWeek:c,fweek:n[0].day,lweek:n[1].day}},
- /**
- * get date by nthWeeks and week day in range
- *
- * @private
- * @param {number} nthWeek the week
- * @param {number} day the week day
- * @param {Array} range [d1, d2]
- * @return {Object}
- */
- t.prototype._getDateByWeeksAndDay=function(t,e,n){var i=this._getRangeInfo(n);if(t>i.weeks||0===t&&e<i.fweek||t===i.weeks&&e>i.lweek)return null;var o=7*(t-1)-i.fweek+e,r=new Date(i.start.time);return r.setDate(+i.start.d+o),this.getDateInfo(r)},t.create=function(e,n){var i=[];return e.eachComponent("calendar",(function(e){var n=new t(e);i.push(n),e.coordinateSystem=n})),e.eachSeries((function(t){"calendar"===t.get("coordinateSystem")&&(
- // Inject coordinate system
- t.coordinateSystem=i[t.get("calendarIndex")||0])})),i},t.dimensions=["time","value"],t}();function dL(t){var e=t.calendarModel,n=t.seriesModel;return e?e.coordinateSystem:n?n.coordinateSystem:null}const hL=cL;function pL(t,e){var n;return a(e,(function(e){null!=t[e]&&"auto"!==t[e]&&(n=!0)})),n}var fL=["transition","enterFrom","leaveTo"],gL=fL.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function yL(t,e,n){if(n&&(!t[n]&&e[n]&&(
- // TODO avoid creating this empty object when there is no transition configuration.
- t[n]={}),t=t[n],e=e[n]),t&&e)for(var i=n?fL:gL,o=0;o<i.length;o++){var r=i[o];null==t[r]&&null!=e[r]&&(t[r]=e[r])}}var mL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.preventAutoZ=!0,n}return Ue(e,t),e.prototype.mergeOption=function(e,n){
- // Prevent default merge to elements
- var i=this.option.elements;this.option.elements=null,t.prototype.mergeOption.call(this,e,n),this.option.elements=i},e.prototype.optionUpdated=function(t,e){var n=this.option,i=(e?n:t).elements,o=n.elements=e?[]:n.elements,r=[];this._flatten(i,r,null);var s=Tn(o,r,"normalMerge"),l=this._elOptionsToUpdate=[];
- // Clear elOptionsToUpdate
- a(s,(function(t,e){var n=t.newOption;n&&(l.push(n),function(t,e){var n=t.existing;
- // Set id and type after id assigned.
- // Set parent id if not specified
- if(e.id=t.keyInfo.id,!e.type&&n&&(e.type=n.type),null==e.parentId){var i=e.parentOption;i?e.parentId=i.id:n&&(e.parentId=n.parentId)}
- // Clear
- e.parentOption=null}(t,n),function(t,e,n){
- // Update existing options, for `getOption` feature.
- var i=p({},n),o=t[e],r=n.$action||"merge";"merge"===r?o?(
- // We can ensure that newElOptCopy and existElOption are not
- // the same object, so `merge` will not change newElOptCopy.
- tt(o,i,!0),
- // Rigid body, use ignoreSize.
- Sa(o,i,{ignoreSize:!0}),
- // Will be used in render.
- Ma(n,o),
- // Copy transition info to new option so it can be used in the transition.
- // DO IT AFTER merge
- yL(n,o),yL(n,o,"shape"),yL(n,o,"style"),yL(n,o,"extra"),
- // Copy clipPath
- n.clipPath=o.clipPath):t[e]=i:"replace"===r?t[e]=i:"remove"===r&&
- // null will be cleaned later.
- o&&(t[e]=null)}(o,e,n),function(t,e){if(t&&(t.hv=e.hv=[
- // Rigid body, don't care about `width`.
- pL(e,["left","right"]),
- // Rigid body, don't care about `height`.
- pL(e,["top","bottom"])],"group"===t.type)){var n=t,i=e;null==n.width&&(n.width=i.width=0),null==n.height&&(n.height=i.height=0)}}(o[e],n))}),this),
- // Clean
- n.elements=st(o,(function(t){
- // $action should be volatile, otherwise option gotten from
- // `getOption` will contain unexpected $action.
- return t&&delete t.$action,null!=t}))},
- /**
- * Convert
- * [{
- * type: 'group',
- * id: 'xx',
- * children: [{type: 'circle'}, {type: 'polygon'}]
- * }]
- * to
- * [
- * {type: 'group', id: 'xx'},
- * {type: 'circle', parentId: 'xx'},
- * {type: 'polygon', parentId: 'xx'}
- * ]
- */
- e.prototype._flatten=function(t,e,n){a(t,(function(t){if(t){n&&(t.parentOption=n),e.push(t);var i=t.children;
- // here we don't judge if option.type is `group`
- // when new option doesn't provide `type`, it will cause that the children can't be updated.
- i&&i.length&&this._flatten(i,e,t),
- // Deleting for JSON output, and for not affecting group creation.
- delete t.children}}),this)},
- // FIXME
- // Pass to view using payload? setOption has a payload?
- e.prototype.useElOptionsToUpdate=function(){var t=this._elOptionsToUpdate;
- // Clear to avoid render duplicately when zooming.
- return this._elOptionsToUpdate=null,t},e.type="graphic",e.defaultOption={elements:[]},e}(Ta),vL={
- // Reserved but not supported in graphic component.
- path:null,compoundPath:null,
- // Supported in graphic component.
- group:Z,image:b,text:$},xL=On(),_L=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(){this._elMap=r()},e.prototype.render=function(t,e,n){
- // Having leveraged between use cases and algorithm complexity, a very
- // simple layout mechanism is used:
- // The size(width/height) can be determined by itself or its parent (not
- // implemented yet), but can not by its children. (Top-down travel)
- // The location(x/y) can be determined by the bounding rect of itself
- // (can including its descendants or not) and the size of its parent.
- // (Bottom-up travel)
- // When `chart.clear()` or `chart.setOption({...}, true)` with the same id,
- // view will be reused.
- t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t),this._relocate(t,n)},
- /**
- * Update graphic elements.
- */
- e.prototype._updateElements=function(t){var e=t.useElOptionsToUpdate();if(e){var n=this._elMap,i=this.group,o=t.get("z"),r=t.get("zlevel");
- // Top-down tranverse to assign graphic settings to each elements.
- a(e,(function(e){var s=Ln(e.id,null),l=null!=s?n.get(s):null,u=Ln(e.parentId,null),c=null!=u?n.get(u):i,d=e.type,h=e.style;"text"===d&&h&&e.hv&&e.hv[1]&&(h.textVerticalAlign=h.textBaseline=h.verticalAlign=h.align=null);var f=e.textContent,g=e.textConfig;if(h&&hT(h,d,!!g,!!f)){var y=pT(h,d,!0);!g&&y.textConfig&&(g=e.textConfig=y.textConfig),!f&&y.textContent&&(f=y.textContent)}
- // Remove unnecessary props to avoid potential problems.
- var m=
- // Remove unnecessary props to avoid potential problems.
- function(t){return t=p({},t),a(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(ga),(function(e){delete t[e]})),t}(e),v=e.$action||"merge",x="merge"===v,_="replace"===v;if(x){var b=l;(C=!l)?b=SL(s,c,e.type,n):(b&&(xL(b).isNew=!1),
- // Stop and restore before update any other attributes.
- OT(b)),b&&(ST(b,m,t,{isInit:C}),ML(b,e,o,r))}else if(_){wL(l,e,n,t);var S=SL(s,c,e.type,n);S&&(ST(S,m,t,{isInit:!0}),ML(S,e,o,r))}else"remove"===v&&(wT(l,e),wL(l,e,n,t));var w=n.get(s);if(w&&f)if(x){var M=w.getTextContent();M?M.attr(f):w.setTextContent(new $(f))}else _&&w.setTextContent(new $(f));if(w){var I=e.clipPath;if(I){var D=I.type,T=void 0,C=!1;if(x){var A=w.getClipPath();T=(C=!A||xL(A).type!==D)?bL(D):A}else _&&(C=!0,T=bL(D));w.setClipPath(T),ST(T,I,t,{isInit:C}),RT(T,I.keyframeAnimation,t)}var L=xL(w);w.setTextConfig(g),L.option=e,function(t,e,n){var i=ni(t).eventData;
- // Simple optimize for large amount of elements that no need event.
- t.silent||t.ignore||i||(i=ni(t).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:t.name});
- // `elOption.info` enables user to mount some info on
- // elements and use them in event handlers.
- i&&(i.info=n.info)}(w,t,e),Vo({el:w,componentModel:t,itemName:w.name,itemTooltipOption:e.tooltip}),RT(w,e.keyframeAnimation,t)}}))}},
- /**
- * Locate graphic elements.
- */
- e.prototype._relocate=function(t,e){
- // Top-down to calculate percentage width/height of group
- for(var n=t.option.elements,i=this.group,o=this._elMap,r=e.getWidth(),a=e.getHeight(),s=["x","y"],l=0;l<n.length;l++){if((g=null!=(f=Ln((p=n[l]).id,null))?o.get(f):null)&&g.isGroup){var u=(y=g.parent)===i,d=xL(g),h=xL(y);d.width=je(d.option.width,u?r:h.width)||0,d.height=je(d.option.height,u?a:h.height)||0}}
- // Bottom-up tranvese all elements (consider ec resize) to locate elements.
- for(l=n.length-1;l>=0;l--){var p,f,g;if(g=null!=(f=Ln((p=n[l]).id,null))?o.get(f):null){var y=g.parent,m=(h=xL(y),{}),v=_a(g,p,y===i?{width:r,height:a}:{width:h.width,height:h.height},null,{hv:p.hv,boundingMode:p.bounding},m);if(!xL(g).isNew&&v){for(var x=p.transition,_={},b=0;b<s.length;b++){var S=s[b],w=m[S];x&&(IT(x)||c(x,S)>=0)?_[S]=w:g[S]=w}io(g,_,t,0)}else g.attr(m)}}},
- /**
- * Clear all elements.
- */
- e.prototype._clear=function(){var t=this,e=this._elMap;e.each((function(n){wL(n,xL(n).option,e,t._lastGraphicModel)})),this._elMap=r()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(Mu);function bL(t){var e=new(N(vL,t)?vL[t]:vo(t))({});return xL(e).type=t,e}function SL(t,e,n,i){var o=bL(n);return e.add(o),i.set(t,o),xL(o).id=t,xL(o).isNew=!0,o}function wL(t,e,n,i){t&&t.parent&&("group"===t.type&&t.traverse((function(t){wL(t,e,n,i)})),MT(t,e,i),n.removeKey(xL(t).id))}function ML(t,e,n,i){t.isGroup||a([["cursor",$t.prototype.cursor],
- // We should not support configure z and zlevel in the element level.
- // But seems we didn't limit it previously. So here still use it to avoid breaking.
- ["zlevel",i||0],["z",n||0],
- // z2 must not be null/undefined, otherwise sort error may occur.
- ["z2",0]],(function(n){var i=n[0];N(e,i)?t[i]=x(e[i],n[1]):null==t[i]&&(t[i]=n[1])})),a(v(e),(function(n){
- // Assign event handlers.
- // PENDING: should enumerate all event names or use pattern matching?
- if(0===n.indexOf("on")){var i=e[n];t[n]=f(i)?i:null}})),N(e,"draggable")&&(t.draggable=e.draggable),
- // Other attributes
- null!=e.name&&(t.name=e.name),null!=e.id&&(t.id=e.id)}var IL=["x","y","radius","angle","single"],DL=["cartesian2d","polar","singleAxis"];
- // Supported coords.
- // FIXME: polar has been broken (but rarely used).
- function TL(t){return t+"Axis"}
- /**
- * If two dataZoomModels has the same axis controlled, we say that they are 'linked'.
- * This function finds all linked dataZoomModels start from the given payload.
- */function CL(t,e){
- // Key: `DataZoomAxisDimension`
- var n,i=r(),o=[],a=r();
- // Find the dataZooms specified by payload.
- t.eachComponent({mainType:"dataZoom",query:e},(function(t){a.get(t.uid)||l(t)}));do{n=!1,t.eachComponent("dataZoom",s)}while(n);function s(t){!a.get(t.uid)&&function(t){var e=!1;return t.eachTargetAxis((function(t,n){var o=i.get(t);o&&o[n]&&(e=!0)})),e}(t)&&(l(t),n=!0)}function l(t){a.set(t.uid,!0),o.push(t),t.eachTargetAxis((function(t,e){(i.get(t)||i.set(t,[]))[e]=!0}))}return o}
- /**
- * Find the first target coordinate system.
- * Available after model built.
- *
- * @return Like {
- * grid: [
- * {model: coord0, axisModels: [axis1, axis3], coordIndex: 1},
- * {model: coord1, axisModels: [axis0, axis2], coordIndex: 0},
- * ...
- * ], // cartesians must not be null/undefined.
- * polar: [
- * {model: coord0, axisModels: [axis4], coordIndex: 0},
- * ...
- * ], // polars must not be null/undefined.
- * singleAxis: [
- * {model: coord0, axisModels: [], coordIndex: 0}
- * ]
- * }
- */function AL(t){var e=t.ecModel,n={infoList:[],infoMap:r()};return t.eachTargetAxis((function(t,i){var o=e.getComponent(TL(t),i);if(o){var r=o.getCoordSysModel();if(r){var a=r.uid,s=n.infoMap.get(a);s||(s={model:r,axisModels:[]},n.infoList.push(s),n.infoMap.set(a,s)),s.axisModels.push(o)}}})),n}var LL=/** @class */function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){
- // Remove duplication.
- this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}(),kL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._autoThrottle=!0,n._noTarget=!0,
- /**
- * It is `[rangeModeForMin, rangeModeForMax]`.
- * The optional values for `rangeMode`:
- * + `'value'` mode: the axis extent will always be determined by
- * `dataZoom.startValue` and `dataZoom.endValue`, despite
- * how data like and how `axis.min` and `axis.max` are.
- * + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`,
- * where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`,
- * and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`.
- * Axis extent will be determined by the result of the percent of `[dMin, dMax]`.
- *
- * For example, when users are using dynamic data (update data periodically via `setOption`),
- * if in `'value`' mode, the window will be kept in a fixed value range despite how
- * data are appended, while if in `'percent'` mode, whe window range will be changed alone with
- * the appended data (suppose `axis.min` and `axis.max` are not specified).
- */
- n._rangePropMode=["percent","percent"],n}return Ue(e,t),e.prototype.init=function(t,e,n){var i=PL(t);
- /**
- * Suppose a "main process" start at the point that model prepared (that is,
- * model initialized or merged or method called in `action`).
- * We should keep the `main process` idempotent, that is, given a set of values
- * on `option`, we get the same result.
- *
- * But sometimes, values on `option` will be updated for providing users
- * a "final calculated value" (`dataZoomProcessor` will do that). Those value
- * should not be the base/input of the `main process`.
- *
- * So in that case we should save and keep the input of the `main process`
- * separately, called `settledOption`.
- *
- * For example, consider the case:
- * (Step_1) brush zoom the grid by `toolbox.dataZoom`,
- * where the original input `option.startValue`, `option.endValue` are earsed by
- * calculated value.
- * (Step)2) click the legend to hide and show a series,
- * where the new range is calculated by the earsed `startValue` and `endValue`,
- * which brings incorrect result.
- */this.settledOption=i,this.mergeDefaultAndTheme(t,n),this._doInit(i)},e.prototype.mergeOption=function(t){var e=PL(t);
- // FIX #2591
- tt(this.option,t,!0),tt(this.settledOption,e,!0),this._doInit(e)},e.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;a([["start","startValue"],["end","endValue"]],(function(t,i){
- // start/end has higher priority over startValue/endValue if they
- // both set, but we should make chart.setOption({endValue: 1000})
- // effective, rather than chart.setOption({endValue: 1000, end: null}).
- "value"===this._rangePropMode[i]&&(e[t[0]]=n[t[0]]=null);
- // Otherwise do nothing and use the merge result.
- }),this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=r();this._fillSpecifiedTargetAxis(e)?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each((function(t){t.indexList.length&&(this._noTarget=!1)}),this)},e.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return a(IL,(function(n){var i=this.getReferringComponents(TL(n),Bn);
- // When user set axisIndex as a empty array, we think that user specify axisIndex
- // but do not want use auto mode. Because empty array may be encountered when
- // some error occurred.
- if(i.specified){e=!0;var o=new LL;a(i.models,(function(t){o.add(t.componentIndex)})),t.set(n,o)}}),this),e},e.prototype._fillAutoTargetAxisByOrient=function(t,e){var n=this.ecModel,i=!0;
- // Find axis that parallel to dataZoom as default.
- if(i){var o="vertical"===e?"y":"x";r(n.findComponents({mainType:o+"Axis"}),o)}
- // Find axis that parallel to dataZoom as default.
- i&&r(n.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}}),"single");function r(e,n){
- // At least use the first parallel axis as the target axis.
- var o=e[0];if(o){var r=new LL;
- // Find parallel axes in the same grid.
- if(r.add(o.componentIndex),t.set(n,r),i=!1,"x"===n||"y"===n){var s=o.getReferringComponents("grid",zn).models[0];s&&a(e,(function(t){o.componentIndex!==t.componentIndex&&s===t.getReferringComponents("grid",zn).models[0]&&r.add(t.componentIndex)}))}}}i&&
- // If no parallel axis, find the first category axis as default. (Also consider polar).
- a(IL,(function(e){if(i){var o=n.findComponents({mainType:TL(e),filter:function(t){return"category"===t.get("type",!0)}});if(o[0]){var r=new LL;r.add(o[0].componentIndex),t.set(e,r),i=!1}}}),this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;
- // Find the first axis
- return this.eachTargetAxis((function(e){!t&&(t=e)}),this),"y"===t?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(
- // When first time user set throttle, auto throttle ends.
- t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");a([["start","startValue"],["end","endValue"]],(function(i,o){var r=null!=t[i[0]],a=null!=t[i[1]];r&&!a?e[o]="percent":!r&&a?e[o]="value":n?e[o]=n[o]:r&&(
- // percentSpecified && valueSpecified
- e[o]="percent");
- // else remain its original setting.
- }))},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis((function(e,n){null==t&&(t=this.ecModel.getComponent(TL(e),n))}),this),t},
- /**
- * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel
- */
- e.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each((function(n,i){a(n.indexList,(function(n){t.call(e,i,n)}))}))},
- /**
- * @return If not found, return null/undefined.
- */
- e.prototype.getAxisProxy=function(t,e){var n=this.getAxisModel(t,e);if(n)return n.__dzAxisProxy},
- /**
- * @return If not found, return null/undefined.
- */
- e.prototype.getAxisModel=function(t,e){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[e])return this.ecModel.getComponent(TL(t),e)},
- /**
- * If not specified, set to undefined.
- */
- e.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;a([["start","startValue"],["end","endValue"]],(function(i){
- // Consider the pair <start, startValue>:
- // If one has value and the other one is `null/undefined`, we both set them
- // to `settledOption`. This strategy enables the feature to clear the original
- // value in `settledOption` to `null/undefined`.
- // But if both of them are `null/undefined`, we do not set them to `settledOption`
- // and keep `settledOption` with the original value. This strategy enables users to
- // only set <end or endValue> but not set <start or startValue> when calling
- // `dispatchAction`.
- // The pair <end, endValue> is treated in the same way.
- null==t[i[0]]&&null==t[i[1]]||(e[i[0]]=n[i[0]]=t[i[0]],e[i[1]]=n[i[1]]=t[i[1]])}),this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var e=this.option;a(["start","startValue","end","endValue"],(function(n){e[n]=t[n]}))},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},
- /**
- * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0);
- *
- * @return [startValue, endValue] value can only be '-' or finite number.
- */
- e.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},
- /**
- * @param axisModel If axisModel given, find axisProxy
- * corresponding to the axisModel
- */
- e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;
- // Find the first hosted axisProxy
- for(var e,n=this._targetAxisInfoMap.keys(),i=0;i<n.length;i++)for(var o=n[i],r=this._targetAxisInfoMap.get(o),a=0;a<r.indexList.length;a++){var s=this.getAxisProxy(o,r.indexList[a]);if(s.hostedBy(this))return s;e||(e=s)}
- // If no hosted proxy found, still need to return a proxy.
- // This case always happens in toolbox dataZoom, where axes are all hosted by
- // other dataZooms.
- return e},e.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},e.prototype.getOrient=function(){return this._orient},e.type="dataZoom",e.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],e.defaultOption={
- // zlevel: 0,
- z:4,filterMode:"filter",start:0,end:100},e}(Ta);
- /**
- * Retrieve those raw params from option, which will be cached separately,
- * because they will be overwritten by normalized/calculated values in the main
- * process.
- */
- function PL(t){var e={};return a(["start","end","startValue","endValue","throttle"],(function(n){t.hasOwnProperty(n)&&(e[n]=t[n])})),e}const NL=kL;const OL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="dataZoom.select",e}(NL);const RL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n,i){this.dataZoomModel=t,this.ecModel=e,this.api=n},e.type="dataZoom",e}(Mu);const EL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="dataZoom.select",e}(RL);var VL=a,zL=Ke,BL=/** @class */function(){function t(t,e,n,i){this._dimName=t,this._axisIndex=e,this.ecModel=i,this._dataZoomModel=n}
- /**
- * Whether the axisProxy is hosted by dataZoomModel.
- */return t.prototype.hostedBy=function(t){return this._dataZoomModel===t},
- /**
- * @return Value can only be NaN or finite value.
- */
- t.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},
- /**
- * @return {Array.<number>}
- */
- t.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},t.prototype.getTargetSeriesModels=function(){var t=[];return this.ecModel.eachSeries((function(e){if(function(t){var e=t.get("coordinateSystem");return c(DL,e)>=0}(e)){var n=TL(this._dimName),i=e.getReferringComponents(n,zn).models[0];i&&this._axisIndex===i.componentIndex&&t.push(e)}}),this),t},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return et(this._minMaxSpan)},
- /**
- * Only calculate by given range and this._dataExtent, do not change anything.
- */
- t.prototype.calculateDataWindow=function(t){var e,n=this._dataExtent,i=this.getAxisModel().axis.scale,o=this._dataZoomModel.getRangePropMode(),r=[0,100],a=[],s=[];VL(["start","end"],(function(l,u){var c=t[l],d=t[l+"Value"];
- // Notice: dataZoom is based either on `percentProp` ('start', 'end') or
- // on `valueProp` ('startValue', 'endValue'). (They are based on the data extent
- // but not min/max of axis, which will be calculated by data window then).
- // The former one is suitable for cases that a dataZoom component controls multiple
- // axes with different unit or extent, and the latter one is suitable for accurate
- // zoom by pixel (e.g., in dataZoomSelect).
- // we use `getRangePropMode()` to mark which prop is used. `rangePropMode` is updated
- // only when setOption or dispatchAction, otherwise it remains its original value.
- // (Why not only record `percentProp` and always map to `valueProp`? Because
- // the map `valueProp` -> `percentProp` -> `valueProp` probably not the original
- // `valueProp`. consider two axes constrolled by one dataZoom. They have different
- // data extent. All of values that are overflow the `dataExtent` will be calculated
- // to percent '100%').
- "percent"===o[u]?(null==c&&(c=r[u]),
- // Use scale.parse to math round for category or time axis.
- d=i.parse(Xe(c,r,n))):(e=!0,
- // Calculating `percent` from `value` may be not accurate, because
- // This calculation can not be inversed, because all of values that
- // are overflow the `dataExtent` will be calculated to percent '100%'
- c=Xe(d=null==d?n[u]:i.parse(d),n,r)),
- // valueWindow[idx] = round(boundValue);
- // percentWindow[idx] = round(boundPercent);
- // fallback to extent start/end when parsed value or percent is invalid
- s[u]=null==d||isNaN(d)?n[u]:d,a[u]=null==c||isNaN(c)?r[u]:c})),zL(s),zL(a);
- // The windows from user calling of `dispatchAction` might be out of the extent,
- // or do not obey the `min/maxSpan`, `min/maxValueSpan`. But we don't restrict window
- // by `zoomLock` here, because we see `zoomLock` just as a interaction constraint,
- // where API is able to initialize/modify the window size even though `zoomLock`
- // specified.
- var l=this._minMaxSpan;function u(t,e,n,o,r){var a=r?"Span":"ValueSpan";Sw(0,t,n,"all",l["min"+a],l["max"+a]);for(var s=0;s<2;s++)e[s]=Xe(t[s],n,o,!0),r&&(e[s]=i.parse(e[s]))}return e?u(s,a,n,r,!1):u(a,s,r,n,!0),{valueWindow:s,percentWindow:a}},
- /**
- * Notice: reset should not be called before series.restoreData() is called,
- * so it is recommended to be called in "process stage" but not "model init
- * stage".
- */
- t.prototype.reset=function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();
- // Culculate data window and data extent, and record them.
- this._dataExtent=function(t,e,n){var i=[Infinity,-Infinity];VL(n,(function(t){!function(t,e,n){e&&a(cf(e,n),(function(n){var i=e.getApproximateExtent(n);i[0]<t[0]&&(t[0]=i[0]),i[1]>t[1]&&(t[1]=i[1])}))}(i,t.getData(),e)}));
- // It is important to get "consistent" extent when more then one axes is
- // controlled by a `dataZoom`, otherwise those axes will not be synchronized
- // when zooming. But it is difficult to know what is "consistent", considering
- // axes have different type or even different meanings (For example, two
- // time axes are used to compare data of the same date in different years).
- // So basically dataZoom just obtains extent by series.data (in category axis
- // extent can be obtained from axis.data).
- // Nevertheless, user can set min/max/scale on axes to make extent of axes
- // consistent.
- var o=t.getAxisModel(),r=Qp(o.axis.scale,o,i).calculate();return[r.min,r.max]}(this,this._dimName,e),
- // `calculateDataWindow` uses min/maxSpan.
- this._updateMinMaxSpan();var n=this.calculateDataWindow(t.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,
- // Update axis setting then.
- this._setAxisModel()}},t.prototype.filterData=function(t,e){if(t===this._dataZoomModel){var i=this._dimName,o=this.getTargetSeriesModels(),r=t.get("filterMode"),a=this._valueWindow;"none"!==r&&
- // FIXME
- // Toolbox may has dataZoom injected. And if there are stacked bar chart
- // with NaN data, NaN will be filtered and stack will be wrong.
- // So we need to force the mode to be set empty.
- // In fect, it is not a big deal that do not support filterMode-'filter'
- // when using toolbox#dataZoom, utill tooltip#dataZoom support "single axis
- // selection" some day, which might need "adapt to data extent on the
- // otherAxis", which is disabled by filterMode-'empty'.
- // But currently, stack has been fixed to based on value but not index,
- // so this is not an issue any more.
- // let otherAxisModel = this.getOtherAxisModel();
- // if (dataZoomModel.get('$fromToolbox')
- // && otherAxisModel
- // && otherAxisModel.hasSeriesStacked
- // ) {
- // filterMode = 'empty';
- // }
- // TODO
- // filterMode 'weakFilter' and 'empty' is not optimized for huge data yet.
- VL(o,(function(t){var e=t.getData(),o=e.mapDimensionsAll(i);if(o.length){if("weakFilter"===r){var s=e.getStore(),l=n(o,(function(t){return e.getDimensionIndex(t)}),e);e.filterSelf((function(t){for(var e,n,i,r=0;r<o.length;r++){var u=s.get(l[r],t),c=!isNaN(u),d=u<a[0],h=u>a[1];if(c&&!d&&!h)return!0;c&&(i=!0),d&&(e=!0),h&&(n=!0)}
- // If both left out and right out, do not filter.
- return i&&e&&n}))}else VL(o,(function(n){if("empty"===r)t.setData(e=e.map(n,(function(t){return function(t){return t>=a[0]&&t<=a[1]}(t)?t:NaN})));else{var i={};i[n]=a,
- // console.time('select');
- e.selectRange(i)}}));VL(o,(function(t){e.setApproximateExtent(a,t)}))}}))}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._dataExtent;VL(["min","max"],(function(i){var o=e.get(i+"Span"),r=e.get(i+"ValueSpan");null!=r&&(r=this.getAxisModel().axis.scale.parse(r)),
- // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan
- null!=r?o=Xe(n[0]+r,n,[0,100],!0):null!=o&&(r=Xe(o,[0,100],n,!0)-n[0]),t[i+"Span"]=o,t[i+"ValueSpan"]=r}),this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,n=this._valueWindow;if(e){
- // [0, 500]: arbitrary value, guess axis extent.
- var i=Qe(n,[0,500]);i=Math.min(i,20);
- // For value axis, if min/max/scale are not set, we just use the extent obtained
- // by series data, which may be a little different from the extent calculated by
- // `axisHelper.getScaleExtent`. But the different just affects the experience a
- // little when zooming. So it will not be fixed until some users require it strongly.
- var o=t.axis.scale.rawExtentInfo;0!==e[0]&&o.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==e[1]&&o.setDeterminedMinMax("max",+n[1].toFixed(i)),o.freeze()}},t}();const GL=BL;const FL={
- // `dataZoomProcessor` will only be performed in needed series. Consider if
- // there is a line series and a pie series, it is better not to update the
- // line series if only pie series is needed to be updated.
- getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(i,o){var r=t.getComponent(TL(i),o);e(i,o,r,n)}))}))}
- // FIXME: it brings side-effect to `getTargetSeries`.
- // Prepare axis proxies.
- e((function(t,e,n,i){
- // dispose all last axis proxy, in case that some axis are deleted.
- n.__dzAxisProxy=null}));var n=[];e((function(e,i,o,r){
- // Different dataZooms may constrol the same axis. In that case,
- // an axisProxy serves both of them.
- o.__dzAxisProxy||(
- // Use the first dataZoomModel as the main model of axisProxy.
- o.__dzAxisProxy=new GL(e,i,r,t),n.push(o.__dzAxisProxy))}));var i=r();return a(n,(function(t){a(t.getTargetSeriesModels(),(function(t){i.set(t.uid,t)}))})),i},
- // Consider appendData, where filter should be performed. Because data process is
- // in block mode currently, it is not need to worry about that the overallProgress
- // execute every frame.
- overallReset:function(t,e){t.eachComponent("dataZoom",(function(t){
- // We calculate window and reset axis here but not in model
- // init stage and not after action dispatch handler, because
- // reset should be called after seriesData.restoreData.
- t.eachTargetAxis((function(e,n){t.getAxisProxy(e,n).reset(t)})),
- // Caution: data zoom filtering is order sensitive when using
- // percent range and no min/max/scale set on axis.
- // For example, we have dataZoom definition:
- // [
- // {xAxisIndex: 0, start: 30, end: 70},
- // {yAxisIndex: 0, start: 20, end: 80}
- // ]
- // In this case, [20, 80] of y-dataZoom should be based on data
- // that have filtered by x-dataZoom using range of [30, 70],
- // but should not be based on full raw data. Thus sliding
- // x-dataZoom will change both ranges of xAxis and yAxis,
- // while sliding y-dataZoom will only change the range of yAxis.
- // So we should filter x-axis after reset x-axis immediately,
- // and then reset y-axis and filter y-axis.
- t.eachTargetAxis((function(n,i){t.getAxisProxy(n,i).filterData(t,e)}))})),t.eachComponent("dataZoom",(function(t){
- // Fullfill all of the range props so that user
- // is able to get them from chart.getOption().
- var e=t.findRepresentativeAxisProxy();if(e){var n=e.getDataPercentWindow(),i=e.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}}))}};var WL=!1;function HL(t){WL||(WL=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,FL),function(t){t.registerAction("dataZoom",(function(t,e){var n=CL(e,t);a(n,(function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})}))}))}(t),t.registerSubTypeDefaulter("dataZoom",(function(){
- // Default 'slider' when no type specified.
- return"slider"})))}function YL(t){t.registerComponentModel(OL),t.registerComponentView(EL),HL(t)}
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */var UL=function(){},ZL={};function XL(t,e){ZL[t]=e}function jL(t){return ZL[t]}const qL=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;a(this.option.feature,(function(t,n){var i=jL(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(e)),tt(t,i.defaultOption))}))},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,
- // zlevel: 0,
- orient:"horizontal",left:"right",top:"top",
- // right
- // bottom
- backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},
- // textStyle: {},
- // feature
- tooltip:{show:!1,position:"bottom"}},e}(Ta);
- /**
- * Layout list like component.
- * It will box layout each items in group of component and then position the whole group in the viewport
- * @param {module:zrender/group/Group} group
- * @param {module:echarts/model/Component} componentModel
- * @param {module:echarts/ExtensionAPI}
- */function KL(t,e){var n=aa(e.get("padding")),i=e.getItemStyle(["color","opacity"]);
- // FIXME
- // `subPixelOptimizeRect` may bring some gap between edge of viewpart
- // and background rect when setting like `left: 0`, `top: 0`.
- // graphic.subPixelOptimizeRect(rect);
- return i.fill=e.get("backgroundColor"),t=new G({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1})}var JL=/** @class */function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Ue(n,e),n.prototype.render=function(e,n,i,o){var r=this.group;if(r.removeAll(),e.get("show")){var s=+e.get("itemSize"),l="vertical"===e.get("orient"),u=e.get("feature")||{},c=this._features||(this._features={}),d=[];a(u,(function(t,e){d.push(e)})),new yh(this._featureNames||[],d).add(h).update(h).remove(rt(h,null)).execute(),
- // Keep for diff.
- this._featureNames=d,function(t,e,n){var i=e.getBoxLayoutParams(),o=e.get("padding"),r={width:n.getWidth(),height:n.getHeight()},a=xa(i,r,o);va(e.get("orient"),t,e.get("itemGap"),a.width,a.height),_a(t,i,r,o)}(r,e,i),
- // Render background after group is layout
- // FIXME
- r.add(KL(r.getBoundingRect(),e)),
- // Adjust icon title positions to avoid them out of screen
- l||r.eachChild((function(t){var e=t.__title,n=t.ensureState("emphasis"),o=n.textConfig||(n.textConfig={}),a=t.getTextContent(),l=a&&a.ensureState("emphasis");
- // const hoverStyle = icon.hoverStyle;
- // TODO simplify code?
- // May be background element
- if(l&&!f(l)&&e){var u=l.style||(l.style={}),c=Lt(e,$.makeFont(u)),d=t.x+r.x,h=!1;t.y+r.y+s+c.height>i.getHeight()&&(o.position="top",h=!0);var p=h?-5-c.height:s+10;d+c.width/2>i.getWidth()?(o.position=["100%",p],u.align="right"):d-c.width/2<0&&(o.position=[0,p],u.align="left")}}))}function h(h,p){var f,g=d[h],y=d[p],m=u[g],v=new yr(m,e,e.ecModel);if(
- // FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ?
- o&&null!=o.newTitle&&o.featureName===g&&(m.title=o.newTitle),g&&!y){
- // Create
- if(function(t){return 0===t.indexOf("my")}(g))f={onclick:v.option.onclick,featureName:g};else{var x=jL(g);if(!x)return;f=new x}c[g]=f}else
- // If feature does not exist.
- if(!(f=c[y]))return;f.uid=vr("toolbox-feature"),f.model=v,f.ecModel=n,f.api=i;var _=f instanceof UL;g||!y?!v.get("show")||_&&f.unusable?_&&f.remove&&f.remove(n,i):(!function(o,u,c){var d,h,p=o.getModel("iconStyle"),f=o.getModel(["emphasis","iconStyle"]),g=u instanceof UL&&u.getIcons?u.getIcons():o.get("icon"),y=o.get("title")||{};t(g)?(d={})[c]=g:d=g;t(y)?(h={})[c]=y:h=y;var m=o.iconPaths={};a(d,(function(t,a){var c=No(t,{},{x:-s/2,y:-s/2,width:s,height:s});// TODO handling image
- c.setStyle(p.getItemStyle()),c.ensureState("emphasis").style=f.getItemStyle();
- // Text position calculation
- // TODO: extract `textStyle` from `iconStyle` and use `createTextStyle`
- var d=new $({style:{text:h[a],align:f.get("textAlign"),borderRadius:f.get("textBorderRadius"),padding:f.get("textPadding"),fill:null,font:$o({fontStyle:f.get("textFontStyle"),fontFamily:f.get("textFontFamily"),fontSize:f.get("textFontSize"),fontWeight:f.get("textFontWeight")},n)},ignore:!0});c.setTextContent(d),Vo({el:c,componentModel:e,itemName:a,formatterParamsExtra:{title:h[a]}}),c.__title=h[a],c.on("mouseover",(function(){
- // Should not reuse above hoverStyle, which might be modified.
- var t=f.getItemStyle(),n=l?null==e.get("right")&&"right"!==e.get("left")?"right":"left":null==e.get("bottom")&&"bottom"!==e.get("top")?"bottom":"top";d.setStyle({fill:f.get("textFill")||t.fill||t.stroke||"#000",backgroundColor:f.get("textBackgroundColor")}),c.setTextConfig({position:f.get("textPosition")||n}),d.ignore=!e.get("showTitle"),
- // Use enterEmphasis and leaveEmphasis provide by ec.
- // There are flags managed by the echarts.
- i.enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==o.get(["iconStatus",a])&&i.leaveEmphasis(this),d.hide()})),("emphasis"===o.get(["iconStatus",a])?ki:Pi)(c),r.add(c),c.on("click",lt(u.onclick,u,n,i,a)),m[a]=c}))}(v,f,g),v.setIconStatus=function(t,e){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,i[t]&&("emphasis"===e?ki:Pi)(i[t])},f instanceof UL&&f.render&&f.render(v,n,i,o)):_&&f.dispose&&f.dispose(n,i)}},n.prototype.updateView=function(t,e,n,i){a(this._features,(function(t){t instanceof UL&&t.updateView&&t.updateView(t.model,e,n,i)}))},
- // updateLayout(toolboxModel, ecModel, api, payload) {
- // zrUtil.each(this._features, function (feature) {
- // feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload);
- // });
- // },
- n.prototype.remove=function(t,e){a(this._features,(function(n){n instanceof UL&&n.remove&&n.remove(t,e)})),this.group.removeAll()},n.prototype.dispose=function(t,e){a(this._features,(function(n){n instanceof UL&&n.dispose&&n.dispose(t,e)}))},n.type="toolbox",n}(Mu);const $L=JL;const QL=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",o="svg"===e.getZr().painter.getType(),r=o?"svg":n.get("type",!0)||"png",a=e.getConnectedDataURL({type:r,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=d.browser;
- // Chrome, Firefox, New Edge
- if("function"!=typeof MouseEvent||!s.newEdge&&(s.ie||s.edge))
- // @ts-ignore
- if(window.navigator.msSaveOrOpenBlob||o){var l=a.split(","),u=l[0].indexOf("base64")>-1,c=o?decodeURIComponent(l[1]):l[1];
- // data:[<mime type>][;charset=<charset>][;base64],<encoded data>
- // only `atob` when the data uri is encoded with base64
- // otherwise, like `svg` data uri exported by zrender,
- // there will be an error, for it's not encoded with base64.
- // (just a url-encoded string through `encodeURIComponent`)
- u&&(c=window.atob(c));var h=i+"."+r;
- // @ts-ignore
- if(window.navigator.msSaveOrOpenBlob){for(var p=c.length,f=new Uint8Array(p);p--;)f[p]=c.charCodeAt(p);var g=new Blob([f]);// @ts-ignore
- window.navigator.msSaveOrOpenBlob(g,h)}else{var y=document.createElement("iframe");document.body.appendChild(y);var m=y.contentWindow,v=m.document;v.open("image/svg+xml","replace"),v.write(c),v.close(),m.focus(),v.execCommand("SaveAs",!0,h),document.body.removeChild(y)}}else{var x=n.get("lang"),_='<body style="margin:0;"><img src="'+a+'" style="max-width:100%;" title="'+(x&&x[0]||"")+'" /></body>',b=window.open();b.document.write(_),b.document.title=i}else{var S=document.createElement("a");S.download=i+"."+r,S.target="_blank",S.href=a;var w=new MouseEvent("click",{
- // some micro front-end framework, window maybe is a Proxy
- view:document.defaultView,bubbles:!0,cancelable:!1});S.dispatchEvent(w)}
- // IE or old Edge
- },e.getDefaultOption=function(t){return{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:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",
- // Default use option.backgroundColor
- // backgroundColor: '#fff',
- connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],
- // use current pixel ratio of device by default
- // pixelRatio: 1,
- lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},e}(UL);var tk="__ec_magicType_stack__",ek=[["line","bar"],["stack"]],nk=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return a(t.get("type"),(function(t){e[t]&&(n[t]=e[t])})),n},e.getDefaultOption=function(t){return{show:!0,type:[],
- // Icon group
- 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",
- // eslint-disable-next-line
- 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"},
- // `line`, `bar`, `stack`, `tiled`
- title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},e.prototype.onclick=function(t,e,n){var i=this.model,o=i.get(["seriesIndex",n]);
- // Not supported magicType
- if(ik[n]){var r,s={series:[]};a(ek,(function(t){c(t,n)>=0&&a(t,(function(t){i.setIconStatus(t,"normal")}))})),i.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},(function(t){var e=t.subType,o=t.id,r=ik[n](e,o,t,i);r&&(
- // PENDING If merge original option?
- I(r,t.option),s.series.push(r));
- // Modify boundaryGap
- var a=t.coordinateSystem;if(a&&"cartesian2d"===a.type&&("line"===n||"bar"===n)){var l=a.getAxesByScale("ordinal")[0];if(l){var u=l.dim+"Axis",c=t.getReferringComponents(u,zn).models[0].componentIndex;s[u]=s[u]||[];for(var d=0;d<=c;d++)s[u][c]=s[u][c]||{};s[u][c].boundaryGap="bar"===n}}}));var l=n;
- // Change title of stack
- "stack"===n&&(
- // use titles in model instead of ecModel
- // as stack and tiled appears in pair, just flip them
- // no need of checking stack state
- r=tt({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(l="tiled")),e.dispatchAction({type:"changeMagicType",currentType:l,newOption:s,newTitle:r,featureName:"magicType"})}},e}(UL),ik={line:function(t,e,n,i){if("bar"===t)return tt({id:e,type:"line",
- // Preserve data related option
- data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return tt({id:e,type:"bar",
- // Preserve data related option
- data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){var o=n.get("stack")===tk;if("line"===t||"bar"===t)return i.setIconStatus("stack",o?"normal":"emphasis"),tt({id:e,stack:o?"":tk},i.get(["option","stack"])||{},!0)}};
- // TODO: SELF REGISTERED.
- eh({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(t,e){e.mergeOption(t.newOption)}));const ok=nk;
- /* global document */var rk=new Array(60).join("-"),ak="\t";function sk(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}
- /**
- * If a block is tsv format
- */var lk=new RegExp("[\t]+","g");
- /**
- * @param {string} tsv
- * @return {Object}
- */function uk(t,e){var i=t.split(new RegExp("\n*"+rk+"\n*","g")),o={series:[]};return a(i,(function(t,i){if(function(t){if(t.slice(0,t.indexOf("\n")).indexOf(ak)>=0)return!0}(t)){var r=function(t){for(var e=t.split(/\n+/g),i=sk(e.shift()).split(lk),o=[],r=n(i,(function(t){return{name:t,data:[]}})),a=0;a<e.length;a++){var s=sk(e[a]).split(lk);o.push(s.shift());for(var l=0;l<s.length;l++)r[l]&&(r[l].data[a]=s[l])}return{series:r,categories:o}}(t),a=e[i],s=a.axisDim+"Axis";a&&(o[s]=o[s]||[],o[s][a.axisIndex]={data:r.categories},o.series=o.series.concat(r.series))}else{r=function(t){for(var e=t.split(/\n+/g),n=sk(e.shift()),i=[],o=0;o<e.length;o++){
- // if line is empty, ignore it.
- // there is a case that a user forgot to delete `\n`.
- var r=sk(e[o]);if(r){var a=r.split(lk),s="",l=void 0,u=!1;isNaN(a[0])?(
- // First item is name
- u=!0,s=a[0],a=a.slice(1),i[o]={name:s,value:[]},l=i[o].value):l=i[o]=[];for(var c=0;c<a.length;c++)l.push(+a[c]);1===l.length&&(u?i[o].value=l[0]:i[o]=l[0])}}return{name:n,data:i}}(t);o.series.push(r)}})),o}var ck=/** @class */function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),i.prototype.onclick=function(e,i){
- // FIXME: better way?
- setTimeout((function(){i.dispatchAction({type:"hideTip"})}));var o=i.getDom(),r=this.model;this._dom&&o.removeChild(this._dom);var s=document.createElement("div");
- // use padding to avoid 5px whitespace
- s.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",s.style.backgroundColor=r.get("backgroundColor")||"#fff";
- // Create elements
- var l=document.createElement("h4"),u=r.get("lang")||[];l.innerHTML=u[0]||r.get("title"),l.style.cssText="margin:10px 20px",l.style.color=r.get("textColor");var c=document.createElement("div"),d=document.createElement("textarea");c.style.cssText="overflow:auto";var h=r.get("optionToContent"),p=r.get("contentToOption"),g=function(t){var e,i,o,r=
- /**
- * Group series into two types
- * 1. on category axis, like line, bar
- * 2. others, like scatter, pie
- */
- function(t){var e={},n=[],i=[];return t.eachRawSeries((function(t){var o=t.coordinateSystem;if(!o||"cartesian2d"!==o.type&&"polar"!==o.type)n.push(t);else{
- // TODO: TYPE Consider polar? Include polar may increase unecessary bundle size.
- var r=o.getBaseAxis();if("category"===r.type){var a=r.dim+"_"+r.index;e[a]||(e[a]={categoryAxis:r,valueAxis:o.getOtherAxis(r),series:[]},i.push({axisDim:r.dim,axisIndex:r.index})),e[a].series.push(t)}else n.push(t)}})),{seriesGroupByCategoryAxis:e,other:n,meta:i}}
- /**
- * Assemble content of series on cateogory axis
- * @inner
- */(t);return{value:st([(i=r.seriesGroupByCategoryAxis,o=[],a(i,(function(t,e){var i=t.categoryAxis,r=t.valueAxis.dim,s=[" "].concat(n(t.series,(function(t){return t.name}))),l=[i.model.getCategories()];a(t.series,(function(t){var e=t.getRawData();l.push(t.getRawData().mapArray(e.mapDimension(r),(function(t){return t})))}));for(
- // Assemble table content
- var u=[s.join(ak)],c=0;c<l[0].length;c++){for(var d=[],h=0;h<l.length;h++)d.push(l[h][c]);u.push(d.join(ak))}o.push(u.join("\n"))})),o.join("\n\n"+rk+"\n\n")),(e=r.other,n(e,(function(t){var e=t.getRawData(),n=[t.name],i=[];return e.each(e.dimensions,(function(){for(var t=arguments.length,o=arguments[t-1],r=e.getName(o),a=0;a<t-1;a++)i[a]=arguments[a];n.push((r?r+ak:"")+i.join(ak))})),n.join("\n")})).join("\n\n"+rk+"\n\n"))],(function(t){return!!t.replace(/[\n\t\s]/g,"")})).join("\n\n"+rk+"\n\n"),meta:r.meta}}(e);if(f(h)){var y=h(i.getOption());t(y)?c.innerHTML=y:Ae(y)&&c.appendChild(y)}else{
- // Use default textarea
- d.readOnly=r.get("readOnly");var m=d.style;
- // eslint-disable-next-line max-len
- m.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",m.color=r.get("textColor"),m.borderColor=r.get("textareaBorderColor"),m.backgroundColor=r.get("textareaColor"),d.value=g.value,c.appendChild(d)}var v=g.meta,x=document.createElement("div");x.style.cssText="position:absolute;bottom:5px;left:0;right:0";
- // eslint-disable-next-line max-len
- var _="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",b=document.createElement("div"),S=document.createElement("div");_+=";background-color:"+r.get("buttonColor"),_+=";color:"+r.get("buttonTextColor");var w=this;function M(){o.removeChild(s),w._dom=null}Le(b,"click",M),Le(S,"click",(function(){if(null==p&&null!=h||null!=p&&null==h)M();else{var t;try{t=f(p)?p(c,i.getOption()):uk(d.value,v)}catch(e){throw M(),new Error("Data view format error "+e)}t&&i.dispatchAction({type:"changeDataView",newOption:t}),M()}})),b.innerHTML=u[1],S.innerHTML=u[2],S.style.cssText=b.style.cssText=_,!r.get("readOnly")&&x.appendChild(S),x.appendChild(b),s.appendChild(l),s.appendChild(c),s.appendChild(x),c.style.height=o.clientHeight-80+"px",o.appendChild(s),this._dom=s},i.prototype.remove=function(t,e){this._dom&&e.getDom().removeChild(this._dom)},i.prototype.dispose=function(t,e){this.remove(t,e)},i.getDefaultOption=function(t){return{show:!0,readOnly:!1,optionToContent:null,contentToOption:null,
- // eslint-disable-next-line
- 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:t.getLocaleModel().get(["toolbox","dataView","title"]),lang:t.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"}},i}(UL);
- /**
- * @inner
- */function dk(t,e){return n(t,(function(t,n){var r=e&&e[n];if(o(r)&&!i(r)){o(t)&&!i(t)||(t={value:t});
- // original data has name but new data has no name
- var a=null!=r.name&&null==t.name;
- // Original data has option
- return t=I(t,r),a&&delete t.name,t}return t}))}
- // TODO: SELF REGISTERED.
- eh({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},(function(t,e){var n=[];a(t.newOption.series,(function(t){var i=e.getSeriesByName(t.name)[0];if(i){var o=i.get("data");n.push({name:t.name,data:dk(t.data,o)})}else
- // New created series
- // Geuss the series type
- n.push(p({
- // Default is scatter
- type:"scatter"},t))})),e.mergeOption(I({series:n},t.newOption))}));const hk=ck;var pk=a,fk=On();
- /**
- * History length of each dataZoom may be different.
- * this._history[0] is used to store origin range.
- */
- function gk(t){var e=fk(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var yk=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.onclick=function(t,e){!function(t){fk(t).snapshots=null}(t),e.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){return{show:!0,
- // eslint-disable-next-line
- 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:t.getLocaleModel().get(["toolbox","restore","title"])}},e}(UL);
- // TODO: SELF REGISTERED.
- eh({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(t,e){e.resetOption("recreate")}));const mk=yk;
- // FIXME
- // how to genarialize to more coordinate systems.
- var vk=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],xk=/** @class */function(){
- /**
- * @param finder contains Index/Id/Name of xAxis/yAxis/geo/grid
- * Each can be {number|Array.<number>}. like: {xAxisIndex: [3, 4]}
- * @param opt.include include coordinate system types.
- */
- function t(t,e,n){var i=this;this._targetInfoList=[];var o=bk(e,t);a(Sk,(function(t,e){(!n||!n.include||c(n.include,e)>=0)&&t(o,i._targetInfoList)}))}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,(function(t,e,n){
- // area.coordRange is the first of area.coordRanges
- if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;
- // In 'category' axis, coord to pixel is not reversible, so we can not
- // rebuild range by coordRange accrately, which may bring trouble when
- // brushing only one item. So we use __rangeOffset to rebuilding range
- // by coordRange. And this it only used in brush component so it is no
- // need to be adapted to coordRanges.
- var i=Ik[t.brushType](0,n,e);t.__rangeOffset={offset:Tk[t.brushType](i.values,t.range,[1,1]),xyMinMax:i.xyMinMax}}})),t},t.prototype.matchOutputRanges=function(t,e,n){a(t,(function(t){var i=this.findTargetInfo(t,e);i&&!0!==i&&a(i.coordSyses,(function(i){var o=Ik[t.brushType](1,i,t.range,!0);n(t,o.values,i,e)}))}),this)},
- /**
- * the `areas` is `BrushModel.areas`.
- * Called in layout stage.
- * convert `area.coordRange` to global range and set panelId to `area.range`.
- */
- t.prototype.setInputRanges=function(t,e){a(t,(function(t){var n,i,o,r,a,s=this.findTargetInfo(t,e);
- // convert coordRange to global range and set panelId.
- if(t.range=t.range||[],s&&!0!==s){t.panelId=s.panelId;
- // (1) area.range should always be calculate from coordRange but does
- // not keep its original value, for the sake of the dataZoom scenario,
- // where area.coordRange remains unchanged but area.range may be changed.
- // (2) Only support converting one coordRange to pixel range in brush
- // component. So do not consider `coordRanges`.
- // (3) About __rangeOffset, see comment above.
- var l=Ik[t.brushType](0,s.coordSys,t.coordRange),u=t.__rangeOffset;t.range=u?Tk[t.brushType](l.values,u.offset,(n=l.xyMinMax,i=u.xyMinMax,o=Ak(n),r=Ak(i),a=[o[0]/r[0],o[1]/r[1]],isNaN(a[0])&&(a[0]=1),isNaN(a[1])&&(a[1]=1),a)):l.values}}),this)},t.prototype.makePanelOpts=function(t,e){return n(this._targetInfoList,(function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:e?e(n):null,clipPath:TM(i),isTargetByCursor:AM(i,t,n.coordSysModel),getLinearBrushOtherExtent:CM(i)}}))},t.prototype.controlSeries=function(t,e,n){
- // Check whether area is bound in coord, and series do not belong to that coord.
- // If do not do this check, some brush (like lineX) will controll all axes.
- var i=this.findTargetInfo(t,n);return!0===i||i&&c(i.coordSyses,e.coordinateSystem)>=0},
- /**
- * If return Object, a coord found.
- * If return true, global found.
- * Otherwise nothing found.
- */
- t.prototype.findTargetInfo=function(t,e){for(var n=this._targetInfoList,i=bk(e,t),o=0;o<n.length;o++){var r=n[o],a=t.panelId;if(a){if(r.panelId===a)return r}else for(var s=0;s<wk.length;s++)if(wk[s](i,r))return r}return!0},t}();function _k(t){return t[0]>t[1]&&t.reverse(),t}function bk(t,e){return En(t,e,{includeMainTypes:vk})}var Sk={grid:function(t,e){var n=t.xAxisModels,i=t.yAxisModels,o=t.gridModels,s=r(),l={},u={};(n||i||o)&&(a(n,(function(t){var e=t.axis.grid.model;s.set(e.id,e),l[e.id]=!0})),a(i,(function(t){var e=t.axis.grid.model;s.set(e.id,e),u[e.id]=!0})),a(o,(function(t){s.set(t.id,t),l[t.id]=!0,u[t.id]=!0})),s.each((function(t){var o=t.coordinateSystem,r=[];a(o.getCartesians(),(function(t,e){(c(n,t.getAxis("x").model)>=0||c(i,t.getAxis("y").model)>=0)&&r.push(t)})),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,
- // Use the first one as the representitive coordSys.
- coordSys:r[0],coordSyses:r,getPanelRect:Mk.grid,xAxisDeclared:l[t.id],yAxisDeclared:u[t.id]})})))},geo:function(t,e){a(t.geoModels,(function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:Mk.geo})}))}},wk=[
- // grid
- function(t,e){var n=t.xAxisModel,i=t.yAxisModel,o=t.gridModel;return!o&&n&&(o=n.axis.grid.model),!o&&i&&(o=i.axis.grid.model),o&&o===e.gridModel},
- // geo
- function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],Mk={grid:function(){
- // grid is not Transformable.
- return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();
- // geo roam and zoom transform
- return e.applyTransform(Do(t)),e}},Ik={lineX:rt(Dk,0),lineY:rt(Dk,1),rect:function(t,e,n,i){var o=t?e.pointToData([n[0][0],n[1][0]],i):e.dataToPoint([n[0][0],n[1][0]],i),r=t?e.pointToData([n[0][1],n[1][1]],i):e.dataToPoint([n[0][1],n[1][1]],i),a=[_k([o[0],r[0]]),_k([o[1],r[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,i,o){var r=[[Infinity,-Infinity],[Infinity,-Infinity]];return{values:n(i,(function(n){var i=t?e.pointToData(n,o):e.dataToPoint(n,o);return r[0][0]=Math.min(r[0][0],i[0]),r[1][0]=Math.min(r[1][0],i[1]),r[0][1]=Math.max(r[0][1],i[0]),r[1][1]=Math.max(r[1][1],i[1]),i})),xyMinMax:r}}};function Dk(t,e,i,o){var r=i.getAxis(["x","y"][t]),a=_k(n([0,1],(function(t){return e?r.coordToData(r.toLocalCoord(o[t]),!0):r.toGlobalCoord(r.dataToCoord(o[t]))}))),s=[];return s[t]=a,s[1-t]=[NaN,NaN],{values:a,xyMinMax:s}}var Tk={lineX:rt(Ck,0),lineY:rt(Ck,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,e,i){return n(t,(function(t,n){return[t[0]-i[0]*e[n][0],t[1]-i[1]*e[n][1]]}))}};function Ck(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}
- // We have to process scale caused by dataZoom manually,
- // although it might be not accurate.
- // Return [0~1, 0~1]
- function Ak(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}const Lk=xk;var kk,Pk,Nk=a,Ok=bn+"toolbox-dataZoom_",Rk=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.render=function(t,e,n,i){this._brushController||(this._brushController=new DM(n.getZr()),this._brushController.on("brush",lt(this._onBrush,this)).mount()),function(t,e,n,i,o){var r=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(r="dataZoomSelect"===i.key&&i.dataZoomSelectActive);n._isZoomActive=r,t.setIconStatus("zoom",r?"emphasis":"normal");var a=new Lk(Vk(t),e,{include:["grid"]}),s=a.makePanelOpts(o,(function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"}));n._brushController.setPanels(s).enableBrush(!(!r||!s.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,i,n),function(t,e){t.setIconStatus("back",function(t){return gk(t).length}(e)>1?"emphasis":"normal")}(t,e)},e.prototype.onclick=function(t,e,n){Ek[n].call(this)},e.prototype.remove=function(t,e){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var e=t.areas;if(t.isEnd&&e.length){var n={},i=this.ecModel;this._brushController.updateCovers([]),new Lk(Vk(this.model),i,{include:["grid"]}).matchOutputRanges(e,i,(function(t,e,n){if("cartesian2d"===n.type){var i=t.brushType;"rect"===i?(o("x",n,e[0]),o("y",n,e[1])):o({lineX:"x",lineY:"y"}[i],n,e)}})),
- /**
- * @param ecModel
- * @param newSnapshot key is dataZoomId
- */
- function(t,e){var n=gk(t);
- // If previous dataZoom can not be found,
- // complete an range with current range.
- pk(e,(function(e,i){for(var o=n.length-1;o>=0&&!n[o][i];o--);if(o<0){
- // No origin range set, create one by current range.
- var r=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(r){var a=r.getPercentRange();n[0][i]={dataZoomId:i,start:a[0],end:a[1]}}}})),n.push(e)}(i,n),this._dispatchZoomAction(n)}function o(t,e,o){var r=e.getAxis(t),a=r.model,s=function(t,e,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){n.getAxisModel(t,e.componentIndex)&&(i=n)})),i}(t,a,i),l=s.findRepresentativeAxisProxy(a).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(o=Sw(0,o.slice(),r.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(n[s.id]={dataZoomId:s.id,startValue:o[0],endValue:o[1]})}},e.prototype._dispatchZoomAction=function(t){var e=[];
- // Convert from hash map to array.
- Nk(t,(function(t,n){e.push(et(t))})),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},e.getDefaultOption=function(t){return{show:!0,filterMode:"filter",
- // Icon group
- 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"},
- // `zoom`, `back`
- title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},e}(UL),Ek={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(function(t){var e=gk(t),n=e[e.length-1];e.length>1&&e.pop();
- // Find top for all dataZoom.
- var i={};return pk(n,(function(t,n){for(var o=e.length-1;o>=0;o--)if(t=e[o][n]){i[n]=t;break}})),i}(this.ecModel))}};function Vk(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};
- // If both `xAxisIndex` `xAxisId` not set, it means 'all'.
- // If both `yAxisIndex` `yAxisId` not set, it means 'all'.
- // Some old cases set like this below to close yAxis control but leave xAxis control:
- // `{ feature: { dataZoom: { yAxisIndex: false } }`.
- return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}kk="dataZoom",Pk=function(t){var e=t.getComponent("toolbox",0),n=["feature","dataZoom"];if(e&&null!=e.get(n)){var i=e.getModel(n),o=[],r=En(t,Vk(i));return Nk(r.xAxisModels,(function(t){return a(t,"xAxis","xAxisIndex")})),Nk(r.yAxisModels,(function(t){return a(t,"yAxis","yAxisIndex")})),o}function a(t,e,n){var r=t.componentIndex,a={type:"select",$fromToolbox:!0,
- // Default to be filter
- filterMode:i.get("filterMode",!0)||"filter",
- // Id for merge mapping.
- id:Ok+e+r};a[n]=r,o.push(a)}},s(null==qa.get(kk)&&Pk),qa.set(kk,Pk);const zk=Rk;const Bk=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={
- // zlevel: 0,
- z:60,show:!0,
- // tooltip main content
- showContent:!0,
- // 'trigger' only works on coordinate system.
- // 'item' | 'axis' | 'none'
- trigger:"item",
- // 'click' | 'mousemove' | 'none'
- triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",
- // whether restraint content inside viewRect.
- // If renderMode: 'richText', default true.
- // If renderMode: 'html', defaut false (for backward compat).
- confine:null,showDelay:0,hideDelay:100,
- // Animation transition time, unit is second
- transitionDuration:.4,enterable:!1,backgroundColor:"#fff",
- // box shadow
- shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,
- // tooltip border radius, unit is px, default is 4
- borderRadius:4,
- // tooltip border width, unit is px, default is 0 (no border)
- borderWidth:1,
- // Tooltip inside padding, default is 5 for all direction
- // Array is allowed to set up, right, bottom, left, same with css
- // The default value: See `tooltip/tooltipMarkup.ts#getPaddingFromTooltipModel`.
- padding:null,
- // Extra css text
- extraCssText:"",
- // axis indicator, trigger by axis
- axisPointer:{
- // default is line
- // legal values: 'line' | 'shadow' | 'cross'
- type:"line",
- // Valid when type is line, appoint tooltip line locate on which line. Optional
- // legal values: 'x' | 'y' | 'angle' | 'radius' | 'auto'
- // default is 'auto', chose the axis which type is category.
- // for multiply y axis, cartesian coord chose x axis, polar chose angle axis
- axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",
- // TODO formatter
- textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(Ta);
- /* global document */function Gk(t){var e=t.get("confine");return null!=e?!!e:"richText"===t.get("renderMode")}function Fk(t){if(d.domSupported)for(var e=document.documentElement.style,n=0,i=t.length;n<i;n++)if(t[n]in e)return t[n]}var Wk=Fk(["transform","webkitTransform","OTransform","MozTransform","msTransform"]);function Hk(t,e){if(!t)return e;e=ra(e,!0);var n=t.indexOf(e);return(t=-1===n?e:"-"+t.slice(0,n)+"-"+e).toLowerCase()}
- /* global document, window */
- var Yk=Hk(Fk(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),Uk=Hk(Wk,"transform"),Zk="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(d.transform3dSupported?"will-change:transform;":"");function Xk(t,e,n){
- // If using float on style, the final width of the dom might
- // keep changing slightly while mouse move. So `toFixed(0)` them.
- var i=t.toFixed(0)+"px",o=e.toFixed(0)+"px";
- // not support transform, use `left` and `top` instead.
- if(!d.transformSupported)return n?"top:"+o+";left:"+i+";":[["top",o],["left",i]];
- // support transform
- var r=d.transform3dSupported,a="translate"+(r?"3d":"")+"("+i+","+o+(r?",0":"")+")";return n?"top:0;left:0;"+Uk+":"+a+";":[["top",0],["left",0],[Wk,a]]}
- /**
- * @param {Object} textStyle
- * @return {string}
- * @inner
- */function jk(t,e,n){var i=[],o=t.get("transitionDuration"),r=t.get("backgroundColor"),s=t.get("shadowBlur"),l=t.get("shadowColor"),u=t.get("shadowOffsetX"),c=t.get("shadowOffsetY"),h=t.getModel("textStyle"),p=lu(t,"html"),f=u+"px "+c+"px "+s+"px "+l;return i.push("box-shadow:"+f),
- // Animation transition. Do not animate when transitionDuration is 0.
- e&&o&&i.push(function(t,e){var n="cubic-bezier(0.23,1,0.32,1)",i=" "+t/2+"s "+n,o="opacity"+i+",visibility"+i;return e||(i=" "+t+"s "+n,o+=d.transformSupported?","+Uk+i:",left"+i+",top"+i),Yk+":"+o}(o,n)),r&&i.push("background-color:"+r),
- // Border style
- a(["width","color","radius"],(function(e){var n="border-"+e,o=ra(n),r=t.get(o);null!=r&&i.push(n+":"+r+("color"===e?"":"px"))})),
- // Text style
- i.push(function(t){var e=[],n=t.get("fontSize"),i=t.getTextColor();i&&e.push("color:"+i),e.push("font:"+t.getFont());
- // @ts-ignore, leave it to the tooltip refactor.
- var o=x(t.get("lineHeight"),Math.round(3*n/2));n&&e.push("line-height:"+o+"px");var r=t.get("textShadowColor"),s=t.get("textShadowBlur")||0,l=t.get("textShadowOffsetX")||0,u=t.get("textShadowOffsetY")||0;return r&&s&&e.push("text-shadow:"+l+"px "+u+"px "+s+"px "+r),a(["decoration","align"],(function(n){var i=t.get(n);i&&e.push("text-"+n+":"+i)})),e.join(";")}(h)),
- // Padding
- null!=p&&i.push("padding:"+aa(p).join("px ")+"px"),i.join(";")+";"}
- // If not able to make, do not modify the input `out`.
- function qk(t,e,n,i,o){var r=e&&e.painter;if(n){var a=r&&r.getViewportRoot();a&&
- // Some APPs might use scale on body, so we support CSS transform here.
- Pe(t,a,n,i,o)}else{t[0]=i,t[1]=o;
- // xy should be based on canvas root. But tooltipContent is
- // the sibling of canvas root. So padding of ec container
- // should be considered here.
- var s=r&&r.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var Kk=/** @class */function(){function e(e,n){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,d.wxa)return null;var i=document.createElement("div");
- // TODO: TYPE
- i.domBelongToZr=!0,this.el=i;var o=this._zr=e.getZr(),r=n.appendTo,a=r&&(t(r)?document.querySelector(r):Ae(r)?r:f(r)&&r(e.getDom()));qk(this._styleCoord,o,a,e.getWidth()/2,e.getHeight()/2),(a||e.getDom()).appendChild(i),this._api=e,this._container=a;
- // FIXME
- // Is it needed to trigger zr event manually if
- // the browser do not support `pointer-events: none`.
- var s=this;i.onmouseenter=function(){
- // clear the timeout in hideLater and keep showing tooltip
- s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},i.onmousemove=function(t){if(t=t||window.event,!s._enterable){
- // `pointer-events: none` is set to tooltip content div
- // if `enterable` is set as `false`, and `el.onmousemove`
- // can not be triggered. But in browser that do not
- // support `pointer-events`, we need to do this:
- // Try trigger zrender event to avoid mouse
- // in and out shape too frequently
- var e=o.handler,n=o.painter.getViewportRoot();ke(n,t,!0),e.dispatch("mousemove",t)}},i.onmouseleave=function(){
- // set `_inContent` to `false` before `hideLater`
- s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}
- /**
- * Update when tooltip is rendered
- */return e.prototype.update=function(t){
- // FIXME
- // Move this logic to ec main?
- if(!this._container){var e=this._api.getDom(),n=(r="position",(a=(o=e).currentStyle||document.defaultView&&document.defaultView.getComputedStyle(o))?r?a[r]:a:null),i=e.style;"absolute"!==i.position&&"absolute"!==n&&(i.position="relative")}
- // move tooltip if chart resized
- var o,r,a,s=t.get("alwaysShowContent");s&&this._moveIfResized(),
- // update alwaysShowContent
- this._alwaysShowContent=s,
- // update className
- this.el.className=t.get("className")||""},e.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,o=this._styleCoord;n.innerHTML?i.cssText=Zk+jk(t,!this._firstShow,this._longHide)+Xk(o[0],o[1],!0)+"border-color:"+ha(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,n,o,r,a){var s=this.el;if(null!=e){var l="";if(t(a)&&"item"===o.get("trigger")&&!Gk(o)&&(l=function(e,n,i){if(!t(i)||"inside"===i)return"";var o=e.get("backgroundColor"),r=e.get("borderWidth");n=ha(n);var a,s,l="left"===(a=i)?"right":"right"===a?"left":"top"===a?"bottom":"top",u=Math.max(1.5*Math.round(r),6),d="",h=Uk+":";c(["left","right"],l)>-1?(d+="top:50%",h+="translateY(-50%) rotate("+(s="left"===l?-225:-45)+"deg)"):(d+="left:50%",h+="translateX(-50%) rotate("+(s="top"===l?225:45)+"deg)");var p=s*Math.PI/180,f=u+r,g=f*Math.abs(Math.cos(p))+f*Math.abs(Math.sin(p)),y=n+" solid "+r+"px;";return'<div style="'+["position:absolute;width:"+u+"px;height:"+u+"px;z-index:-1;",(d+=";"+l+":-"+Math.round(100*((g-Math.SQRT2*r)/2+Math.SQRT2*r-(g-f)/2))/100+"px")+";"+h+";","border-bottom:"+y,"border-right:"+y,"background-color:"+o+";"].join("")+'"></div>'}(o,r,a)),t(e))s.innerHTML=e+l;else if(e){
- // Clear previous
- s.innerHTML="",i(e)||(e=[e]);for(var u=0;u<e.length;u++)Ae(e[u])&&e[u].parentNode!==s&&s.appendChild(e[u]);
- // no arrow if empty
- if(l&&s.childNodes.length){
- // no need to create a new parent element, but it's not supported by IE 10 and older.
- // const arrowEl = document.createRange().createContextualFragment(arrow);
- var d=document.createElement("div");d.innerHTML=l,s.appendChild(d)}}}else s.innerHTML=""},e.prototype.setEnterable=function(t){this._enterable=t},e.prototype.getSize=function(){var t=this.el;return t?[t.offsetWidth,t.offsetHeight]:[0,0]},e.prototype.moveTo=function(t,e){if(this.el){var n=this._styleCoord;if(qk(n,this._zr,this._container,t,e),null!=n[0]&&null!=n[1]){var i=this.el.style,o=Xk(n[0],n[1]);a(o,(function(t){i[t[0]]=t[1]}))}}},
- /**
- * when `alwaysShowContent` is true,
- * move the tooltip after chart resized
- */
- e.prototype._moveIfResized=function(){
- // The ratio of left to width
- var t=this._styleCoord[2],e=this._styleCoord[3];
- // The ratio of top to height
- this.moveTo(t*this._zr.getWidth(),e*this._zr.getHeight())},e.prototype.hide=function(){var t=this,e=this.el.style;e.visibility="hidden",e.opacity="0",d.transform3dSupported&&(e.willChange=""),this._show=!1,this._longHideTimeout=setTimeout((function(){return t._longHide=!0}),500)},e.prototype.hideLater=function(t){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(t?(this._hideDelay=t,
- // Set show false to avoid invoke hideLater multiple times
- this._show=!1,this._hideTimeout=setTimeout(lt(this.hide,this),t)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var t=this.el.parentNode;t&&t.removeChild(this.el),this.el=this._container=null},e}();const Jk=Kk;var $k=/** @class */function(){function t(t){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=t.getZr(),eP(this._styleCoord,this._zr,t.getWidth()/2,t.getHeight()/2)}
- /**
- * Update when tooltip is rendered
- */return t.prototype.update=function(t){var e=t.get("alwaysShowContent");e&&this._moveIfResized(),
- // update alwaysShowContent
- this._alwaysShowContent=e},t.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},
- /**
- * Set tooltip content
- */
- t.prototype.setContent=function(t,e,n,i,r){var s=this;o(t)&&vn(""),this.el&&this._zr.remove(this.el);var l=n.getModel("textStyle");this.el=new $({style:{rich:e.richTextStyles,text:t,lineHeight:22,borderWidth:1,borderColor:i,textShadowColor:l.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:lu(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),a(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],(function(t){s.el.style[t]=n.get(t)})),a(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],(function(t){s.el.style[t]=l.get(t)||0})),this._zr.add(this.el);var u=this;this.el.on("mouseover",(function(){
- // clear the timeout in hideLater and keep showing tooltip
- u._enterable&&(clearTimeout(u._hideTimeout),u._show=!0),u._inContent=!0})),this.el.on("mouseout",(function(){u._enterable&&u._show&&u.hideLater(u._hideDelay),u._inContent=!1}))},t.prototype.setEnterable=function(t){this._enterable=t},t.prototype.getSize=function(){var t=this.el,e=this.el.getBoundingRect(),n=tP(t.style);return[e.width+n.left+n.right,e.height+n.top+n.bottom]},t.prototype.moveTo=function(t,e){var n=this.el;if(n){var i=this._styleCoord;eP(i,this._zr,t,e),t=i[0],e=i[1];var o=n.style,r=Qk(o.borderWidth||0),a=tP(o);
- // rich text x, y do not include border.
- n.x=t+r+a.left,n.y=e+r+a.top,n.markRedraw()}},
- /**
- * when `alwaysShowContent` is true,
- * move the tooltip after chart resized
- */
- t.prototype._moveIfResized=function(){
- // The ratio of left to width
- var t=this._styleCoord[2],e=this._styleCoord[3];
- // The ratio of top to height
- this.moveTo(t*this._zr.getWidth(),e*this._zr.getHeight())},t.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},t.prototype.hideLater=function(t){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(t?(this._hideDelay=t,
- // Set show false to avoid invoke hideLater multiple times
- this._show=!1,this._hideTimeout=setTimeout(lt(this.hide,this),t)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this._zr.remove(this.el)},t}();function Qk(t){return Math.max(0,t)}function tP(t){var e=Qk(t.shadowBlur||0),n=Qk(t.shadowOffsetX||0),i=Qk(t.shadowOffsetY||0);return{left:Qk(e-n),right:Qk(e+n),top:Qk(e-i),bottom:Qk(e+i)}}function eP(t,e,n,i){t[0]=n,t[1]=i,t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}const nP=$k;var iP=new G({shape:{x:-1,y:-1,width:2,height:2}}),oP=/** @class */function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=n.type,t}return Ue(n,e),n.prototype.init=function(t,e){if(!d.node&&e.getDom()){var n,i=t.getComponent("tooltip"),o=this._renderMode="auto"===(n=i.get("renderMode"))?d.domSupported?"html":"richText":n||"html";this._tooltipContent="richText"===o?new nP(e):new Jk(e,{appendTo:i.get("appendToBody",!0)?"body":i.get("appendTo",!0)})}},n.prototype.render=function(t,e,n){if(!d.node&&n.getDom()){
- // Reset
- this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=n;var i=this._tooltipContent;i.update(t),i.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow(),
- // PENDING
- // `mousemove` event will be triggered very frequently when the mouse moves fast,
- // which causes that the `updatePosition` function was also called frequently.
- // In Chrome with devtools open and Firefox, tooltip looks laggy and shakes. See #14695 #16101
- // To avoid frequent triggering,
- // consider throttling it in 50ms when transition is enabled
- "richText"!==this._renderMode&&t.get("transitionDuration")?Bu(this,"_updatePosition",50,"fixRate"):Gu(this,"_updatePosition")}},n.prototype._initGlobalListener=function(){var t=this._tooltipModel.get("triggerOn");zC("itemTooltip",this._api,lt((function(e,n,i){
- // If 'none', it is not controlled by mouse totally.
- "none"!==t&&(t.indexOf(e)>=0?this._tryShow(n,i):"leave"===e&&this._hide(i))}),this))},n.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api,i=t.get("triggerOn");
- // Try to keep the tooltip show when refreshing
- if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){
- // Show tip next tick after other charts are rendered
- // In case highlight action has wrong result
- // FIXME
- !n.isDisposed()&&o.manuallyShowTip(t,e,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})}))}},
- /**
- * Show tip manually by
- * dispatchAction({
- * type: 'showTip',
- * x: 10,
- * y: 10
- * });
- * Or
- * dispatchAction({
- * type: 'showTip',
- * seriesIndex: 0,
- * dataIndex or dataIndexInside or name
- * });
- *
- * TODO Batch
- */
- n.prototype.manuallyShowTip=function(t,e,n,i){if(i.from!==this.uid&&!d.node&&n.getDom()){var o=aP(i,n);
- // Reset ticket
- this._ticket="";
- // When triggered from axisPointer.
- var r=i.dataByCoordSys,a=
- /**
- * Find target component by payload like:
- * ```js
- * { legendId: 'some_id', name: 'xxx' }
- * { toolboxIndex: 1, name: 'xxx' }
- * { geoName: 'some_name', name: 'xxx' }
- * ```
- * PENDING: at present only
- *
- * If not found, return null/undefined.
- */
- function(t,e,n){var i=Vn(t).queryOptionMap,o=i.keys()[0];if(!o||"series"===o)return;var r=Gn(e,o,i.get(o),{useDefault:!1,enableAll:!1,enableNone:!1}),a=r.models[0];if(!a)return;var s,l=n.getViewOfComponentModel(a);if(l.group.traverse((function(e){var n=ni(e).tooltipConfig;if(n&&n.name===t.name)return s=e,!0;// stop
- })),s)return{componentMainType:o,componentIndex:a.componentIndex,el:s}}(i,e,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:i.position,
- // When manully trigger, the mouse is not on the el, so we'd better to
- // position tooltip on the bottom of the el and display arrow is possible.
- positionDefault:"bottom"},o)}else if(i.tooltip&&null!=i.x&&null!=i.y){var l=iP;l.x=i.x,l.y=i.y,l.update(),ni(l).tooltipConfig={name:null,option:i.tooltip},
- // Manually show tooltip while view is not using zrender elements.
- this._tryShow({offsetX:i.x,offsetY:i.y,target:l},o)}else if(r)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:r,tooltipOption:i.tooltipOption},o);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var u=YC(i,e),c=u.point[0],h=u.point[1];null!=c&&null!=h&&this._tryShow({offsetX:c,offsetY:h,target:u.el,position:i.position,
- // When manully trigger, the mouse is not on the el, so we'd better to
- // position tooltip on the bottom of the el and display arrow is possible.
- positionDefault:"bottom"},o)}else null!=i.x&&null!=i.y&&(
- // FIXME
- // should wrap dispatchAction like `axisPointer/globalListener` ?
- n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},o))}},n.prototype.manuallyHideTip=function(t,e,n,i){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(aP(i,n))},
- // Be compatible with previous design, that is, when tooltip.type is 'axis' and
- // dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer
- // and tooltip.
- n.prototype._manuallyAxisShowTip=function(t,e,n,i){var o=i.seriesIndex,r=i.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=o&&null!=r&&null!=a){var s=e.getSeriesByIndex(o);if(s)if("axis"===rP([s.getData().getItemModel(r),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:r,position:i.position}),!0}},n.prototype._tryShow=function(t,e){var n=t.target;if(this._tooltipModel){
- // Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed
- this._lastX=t.offsetX,this._lastY=t.offsetY;var i=t.dataByCoordSys;if(i&&i.length)this._showAxisTooltip(i,t);else if(n){var o,r;if("legend"===ni(n).ssrType)
- // Don't trigger tooltip for legend tooltip item
- return;this._lastDataByCoordSys=null,kc(n,(function(t){
- // Always show item tooltip if mouse is on the element with dataIndex
- return null!=ni(t).dataIndex?(o=t,!0):
- // Tooltip provided directly. Like legend.
- null!=ni(t).tooltipConfig?(r=t,!0):void 0}),!0),o?this._showSeriesItemTooltip(t,o,e):r?this._showComponentItemTooltip(t,r,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},n.prototype._showOrMove=function(t,e){
- // showDelay is used in this case: tooltip.enterable is set
- // as true. User intent to move mouse into tooltip and click
- // something. `showDelay` makes it easier to enter the content
- // but tooltip do not move immediately.
- var n=t.get("showDelay");e=lt(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},n.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,i=this._tooltipModel,o=[e.offsetX,e.offsetY],r=rP([e.tooltipOption],i),s=this._renderMode,l=[],u=$l("section",{blocks:[],noHeader:!0}),c=[],d=new uu;a(t,(function(t){a(t.dataByAxis,(function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),o=t.value;if(e&&null!=o){var r=MC(o,e.axis,n,t.seriesDataIndices,t.valueLabelOpt),h=$l("section",{header:r,noHeader:!Q(r),sortBlocks:!0,blocks:[]});u.blocks.push(h),a(t.seriesDataIndices,(function(a){var u=n.getSeriesByIndex(a.seriesIndex),f=a.dataIndexInside,g=u.getDataParams(f);
- // Can't find data.
- if(!(g.dataIndex<0)){g.axisDim=t.axisDim,g.axisIndex=t.axisIndex,g.axisType=t.axisType,g.axisId=t.axisId,g.axisValue=af(e.axis,{value:o}),g.axisValueLabel=r,
- // Pre-create marker style for makers. Users can assemble richText
- // text in `formatter` callback and use those markers style.
- g.marker=d.makeTooltipMarker("item",ha(g.color),s);var y=pl(u.formatTooltip(f,!0,null)),m=y.frag;if(m){var v=rP([u],i).get("valueFormatter");h.blocks.push(v?p({valueFormatter:v},m):m)}y.text&&c.push(y.text),l.push(g)}}))}}))})),
- // In most cases, the second axis is displays upper on the first one.
- // So we reverse it to look better.
- u.blocks.reverse(),c.reverse();var h=e.position,f=r.get("order"),g=ou(u,d,s,f,n.get("useUTC"),r.get("textStyle"));g&&c.unshift(g);var y="richText"===s?"\n\n":"<br/>",m=c.join(y);this._showOrMove(r,(function(){this._updateContentNotChangedOnAxis(t,l)?this._updatePosition(r,h,o[0],o[1],this._tooltipContent,l):this._showTooltipContent(r,m,l,Math.random()+"",o[0],o[1],h,null,d)}))},n.prototype._showSeriesItemTooltip=function(t,e,n){var i=this._ecModel,o=ni(e),r=o.seriesIndex,a=i.getSeriesByIndex(r),s=o.dataModel||a,l=o.dataIndex,u=o.dataType,c=s.getData(u),d=this._renderMode,h=t.positionDefault,f=rP([c.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,h?{position:h}:null),g=f.get("trigger");if(null==g||"item"===g){var y=s.getDataParams(l,u),m=new uu;
- // Pre-create marker style for makers. Users can assemble richText
- // text in `formatter` callback and use those markers style.
- y.marker=m.makeTooltipMarker("item",ha(y.color),d);var v=pl(s.formatTooltip(l,!1,u)),x=f.get("order"),_=f.get("valueFormatter"),b=v.frag,S=b?ou(_?p({valueFormatter:_},b):b,m,d,x,i.get("useUTC"),f.get("textStyle")):v.text,w="item_"+s.name+"_"+l;this._showOrMove(f,(function(){this._showTooltipContent(f,S,y,w,t.offsetX,t.offsetY,t.position,t.target,m)})),
- // FIXME
- // duplicated showtip if manuallyShowTip is called from dispatchAction.
- n({type:"showTip",dataIndexInside:l,dataIndex:c.getRawIndex(l),seriesIndex:r,from:this.uid})}},n.prototype._showComponentItemTooltip=function(e,n,i){var o="html"===this._renderMode,r=ni(n),a=r.tooltipConfig.option||{},s=a.encodeHTMLContent;if(t(a)){a={content:a,
- // Fixed formatter
- formatter:a},
- // when `tooltipConfig.option` is a string rather than an object,
- // we can't know if the content needs to be encoded
- // for the sake of security, encode it by default.
- s=!0}s&&o&&a.content&&((
- // clone might be unnecessary?
- a=et(a)).content=ot(a.content));var l=[a],u=this._ecModel.getComponent(r.componentMainType,r.componentIndex);u&&l.push(u),
- // In most cases, component tooltip formatter has different params with series tooltip formatter,
- // so that they cannot share the same formatter. Since the global tooltip formatter is used for series
- // by convention, we do not use it as the default formatter for component.
- l.push({formatter:a.content});var c=e.positionDefault,d=rP(l,this._tooltipModel,c?{position:c}:null),h=d.get("content"),p=Math.random()+"",f=new uu;
- // Do not check whether `trigger` is 'none' here, because `trigger`
- // only works on coordinate system. In fact, we have not found case
- // that requires setting `trigger` nothing on component yet.
- this._showOrMove(d,(function(){
- // Use formatterParams from element defined in component
- // Avoid users modify it.
- var t=et(d.get("formatterParams")||{});this._showTooltipContent(d,h,t,p,e.offsetX,e.offsetY,e.position,n,f)})),
- // If not dispatch showTip, tip may be hide triggered by axis.
- i({type:"showTip",from:this.uid})},n.prototype._showTooltipContent=function(
- // Use Model<TooltipOption> insteadof TooltipModel because this model may be from series or other options.
- // Instead of top level tooltip.
- e,n,o,r,a,s,l,u,c){if(
- // Reset ticket
- this._ticket="",e.get("showContent")&&e.get("show")){var d=this._tooltipContent;d.setEnterable(e.get("enterable"));var h=e.get("formatter");l=l||e.get("position");var p=n,g=this._getNearestPoint([a,s],o,e.get("trigger"),e.get("borderColor")).color;if(h)if(t(h)){var y=e.ecModel.get("useUTC"),m=i(o)?o[0]:o;p=h,m&&m.axisType&&m.axisType.indexOf("time")>=0&&(p=Fr(m.axisValue,p,y)),p=ca(p,o,!0)}else if(f(h)){var v=lt((function(t,n){t===this._ticket&&(d.setContent(n,c,e,g,l),this._updatePosition(e,l,a,s,d,o,u))}),this);this._ticket=r,p=h(o,r,v)}else p=h;d.setContent(p,c,e,g,l),d.show(e,g),this._updatePosition(e,l,a,s,d,o,u)}},n.prototype._getNearestPoint=function(t,e,n,o){return"axis"===n||i(e)?{color:o||("html"===this._renderMode?"#fff":"none")}:i(e)?void 0:{color:o||e.color||e.borderColor}},n.prototype._updatePosition=function(e,n,r,
- // Mouse x
- a,
- // Mouse y
- s,l,u){var c=this._api.getWidth(),d=this._api.getHeight();n=n||e.get("position");var h=s.getSize(),p=e.get("align"),g=e.get("verticalAlign"),y=u&&u.getBoundingRect().clone();if(u&&y.applyTransform(u.transform),f(n)&&(
- // Callback of position can be an array or a string specify the position
- n=n([r,a],l,s.el,y,{viewSize:[c,d],contentSize:h.slice()})),i(n))r=je(n[0],c),a=je(n[1],d);else if(o(n)){var m=n;m.width=h[0],m.height=h[1];var v=xa(m,{width:c,height:d});r=v.x,a=v.y,p=null,
- // When positionExpr is left/top/right/bottom,
- // align and verticalAlign will not work.
- g=null}
- // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element
- else if(t(n)&&u){var x=function(t,e,n,i){var o=n[0],r=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,c=e.height;switch(t){case"inside":s=e.x+u/2-o/2,l=e.y+c/2-r/2;break;case"top":s=e.x+u/2-o/2,l=e.y-r-a;break;case"bottom":s=e.x+u/2-o/2,l=e.y+c+a;break;case"left":s=e.x-o-a,l=e.y+c/2-r/2;break;case"right":s=e.x+u+a,l=e.y+c/2-r/2}return[s,l]}(n,y,h,e.get("borderWidth"));r=x[0],a=x[1]}else{x=function(t,e,n,i,o,r,a){var s=n.getSize(),l=s[0],u=s[1];null!=r&&(
- // Add extra 2 pixels for this case:
- // At present the "values" in default tooltip are using CSS `float: right`.
- // When the right edge of the tooltip box is on the right side of the
- // viewport, the `float` layout might push the "values" to the second line.
- t+l+r+2>i?t-=l+r:t+=r);null!=a&&(e+u+a>o?e-=u+a:e+=a);return[t,e]}(r,a,s,c,d,p?null:20,g?null:20);r=x[0],a=x[1]}if(p&&(r-=sP(p)?h[0]/2:"right"===p?h[0]:0),g&&(a-=sP(g)?h[1]/2:"bottom"===g?h[1]:0),Gk(e)){x=function(t,e,n,i,o){var r=n.getSize(),a=r[0],s=r[1];return t=Math.min(t+a,i)-a,e=Math.min(e+s,o)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}(r,a,s,c,d);r=x[0],a=x[1]}s.moveTo(r,a)},
- // FIXME
- // Should we remove this but leave this to user?
- n.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,i=this._cbParamsList,o=!!n&&n.length===t.length;return o&&a(n,(function(n,r){var s=n.dataByAxis||[],l=(t[r]||{}).dataByAxis||[];(o=o&&s.length===l.length)&&a(s,(function(t,n){var r=l[n]||{},s=t.seriesDataIndices||[],u=r.seriesDataIndices||[];(o=o&&t.value===r.value&&t.axisType===r.axisType&&t.axisId===r.axisId&&s.length===u.length)&&a(s,(function(t,e){var n=u[e];o=o&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})),
- // check is cbParams data value changed
- i&&a(t.seriesDataIndices,(function(t){var n=t.seriesIndex,r=e[n],a=i[n];r&&a&&a.data!==r.data&&(o=!1)}))}))})),this._lastDataByCoordSys=t,this._cbParamsList=e,!!o},n.prototype._hide=function(t){
- // Do not directly hideLater here, because this behavior may be prevented
- // in dispatchAction when showTip is dispatched.
- // FIXME
- // duplicated hideTip if manuallyHideTip is called from dispatchAction.
- this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},n.prototype.dispose=function(t,e){!d.node&&e.getDom()&&(Gu(this,"_updatePosition"),this._tooltipContent.dispose(),FC("itemTooltip",e))},n.type="tooltip",n}(Mu);
- /**
- * From top to bottom. (the last one should be globalTooltipModel);
- */
- function rP(e,n,i){
- // Last is always tooltip model.
- var o,r=n.ecModel;i?(o=new yr(i,r,r),o=new yr(n.option,o,r)):o=n;for(var a=e.length-1;a>=0;a--){var s=e[a];s&&(s instanceof yr&&(s=s.get("tooltip",!0)),
- // In each data item tooltip can be simply write:
- // {
- // value: 10,
- // tooltip: 'Something you need to know'
- // }
- t(s)&&(s={formatter:s}),s&&(o=new yr(s,o,r)))}return o}function aP(t,e){return t.dispatchAction||lt(e.dispatchAction,e)}function sP(t){return"center"===t||"middle"===t}const lP=oP;var uP=["rect","polygon","keep","clear"];function cP(t,e){var n=Sn(t?t.brush:[]);if(n.length){var o=[];a(n,(function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(o=o.concat(e))}));var r=t&&t.toolbox;i(r)&&(r=r[0]),r||(r={feature:{}},t.toolbox=[r]);var s=r.feature||(r.feature={}),l=s.brush||(s.brush={}),u=l.type||(l.type=[]);u.push.apply(u,o),function(t){var e={};a(t,(function(t){e[t]=1})),t.length=0,a(e,(function(e,n){t.push(n)}))}(u),e&&!u.length&&u.push.apply(u,uP)}}var dP=a;function hP(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}function pP(t,e,n){var i={};return dP(e,(function(e){var o,r=i[e]=(
- // Make sure hidden fields will not be visited by
- // object iteration (with hasOwnProperty checking).
- (o=function(){}).prototype.__hidden=o.prototype,new o);dP(t[e],(function(t,i){if(mb.isValidType(i)){var o={type:i,visual:t};n&&n(o,e),r[i]=new mb(o),
- // Prepare a alpha for opacity, for some case that opacity
- // is not supported, such as rendering using gradient color.
- "opacity"===i&&((o=et(o)).type="colorAlpha",r.__hidden.__alphaForOpacity=new mb(o))}}))})),i}function fP(t,e,n){
- // Visual attributes merge is not supported, otherwise it
- // brings overcomplicated merge logic. See #2853. So if
- // newOption has anyone of these keys, all of these keys
- // will be reset. Otherwise, all keys remain.
- var i;a(n,(function(t){e.hasOwnProperty(t)&&hP(e[t])&&(i=!0)})),i&&a(n,(function(n){e.hasOwnProperty(n)&&hP(e[n])?t[n]=et(e[n]):delete t[n]}))}
- /**
- * @param stateList
- * @param visualMappings
- * @param list
- * @param getValueState param: valueOrIndex, return: state.
- * @param scope Scope for getValueState
- * @param dimension Concrete dimension, if used.
- */
- // ???! handle brush?
- var gP={lineX:yP(0),lineY:yP(1),rect:{point:function(t,e,n){return t&&n.boundingRect.contain(t[0],t[1])},rect:function(t,e,n){return t&&n.boundingRect.intersect(t)}},polygon:{point:function(t,e,n){return t&&n.boundingRect.contain(t[0],t[1])&&Dt(n.range,t[0],t[1])},rect:function(t,e,n){var i=n.range;if(!t||i.length<=1)return!1;var o=t.x,r=t.y,a=t.width,s=t.height,l=i[0];return!!(Dt(i,o,r)||Dt(i,o+a,r)||Dt(i,o,r+s)||Dt(i,o+a,r+s)||Y.create(t).contain(l[0],l[1])||Oo(o,r,o+a,r,i)||Oo(o,r,o,r+s,i)||Oo(o+a,r,o+a,r+s,i)||Oo(o,r+s,o+a,r+s,i))||void 0}}};function yP(t){var e=["x","y"],n=["width","height"];return{point:function(e,n,i){if(e){var o=i.range;return mP(e[t],o)}},rect:function(i,o,r){if(i){var a=r.range,s=[i[e[t]],i[e[t]]+i[n[t]]];return s[1]<s[0]&&s.reverse(),mP(s[0],a)||mP(s[1],a)||mP(a[0],s)||mP(a[1],s)}}}}function mP(t,e){return e[0]<=t&&t<=e[1]}var vP=["inBrush","outOfBrush"],xP="__ecBrushSelect",_P="__ecInBrushSelectEvent";function bP(t){t.eachComponent({mainType:"brush"},(function(e){(e.brushTargetManager=new Lk(e.option,t)).setInputRanges(e.areas,t)}))}
- /**
- * Register the visual encoding if this modules required.
- */function SP(t,e,o){var r,s,l=[];t.eachComponent({mainType:"brush"},(function(t){o&&"takeGlobalCursor"===o.type&&t.setBrushOption("brush"===o.key?o.brushOption:{brushType:!1})})),bP(t),t.eachComponent({mainType:"brush"},(function(e,o){var u={brushId:e.id,brushIndex:o,brushName:e.name,areas:et(e.areas),selected:[]};
- // Every brush component exists in event params, convenient
- // for user to find by index.
- l.push(u);var d=e.option,h=d.brushLink,p=[],f=[],g=[],y=!1;o||(
- // Only the first throttle setting works.
- r=d.throttleType,s=d.throttleDelay);
- // Add boundingRect and selectors to range.
- var m=n(e.areas,(function(t){var e=IP[t.brushType],n=I({boundingRect:e?e(t):void 0},t);return n.selectors=function(t){var e=t.brushType,n={point:function(i){return gP[e].point(i,n,t)},rect:function(i){return gP[e].rect(i,n,t)}};
- // Do not use function binding or curry for performance.
- return n}(n),n})),v=pP(e.option,vP,(function(t){t.mappingMethod="fixed"}));function x(t){return"all"===h||!!p[t]}
- // If no supported brush or no brush on the series,
- // all visuals should be in original state.
- function _(t){return!!t.length}
- /**
- * Logic for each series: (If the logic has to be modified one day, do it carefully!)
- *
- * ( brushed ┬ && ┬hasBrushExist ┬ && linkOthers ) => StepA: ┬record, ┬ StepB: ┬visualByRecord.
- * !brushed┘ ├hasBrushExist ┤ └nothing,┘ ├visualByRecord.
- * └!hasBrushExist┘ └nothing.
- * ( !brushed && ┬hasBrushExist ┬ && linkOthers ) => StepA: nothing, StepB: ┬visualByRecord.
- * └!hasBrushExist┘ └nothing.
- * ( brushed ┬ && !linkOthers ) => StepA: nothing, StepB: ┬visualByCheck.
- * !brushed┘ └nothing.
- * ( !brushed && !linkOthers ) => StepA: nothing, StepB: nothing.
- */
- // Step A
- i(h)&&a(h,(function(t){p[t]=1})),t.eachSeries((function(n,o){var r=g[o]=[];"parallel"===n.subType?function(t,e){var n=t.coordinateSystem;y=y||n.hasAxisBrushed(),x(e)&&n.eachActiveState(t.getData(),(function(t,e){"active"===t&&(f[e]=1)}))}(n,o):function(n,o,r){if(!n.brushSelector||function(t,e){var n=t.option.seriesIndex;return null!=n&&"all"!==n&&(i(n)?c(n,e)<0:e!==n)}(e,o))return;if(a(m,(function(i){e.brushTargetManager.controlSeries(i,n,t)&&r.push(i),y=y||_(r)})),x(o)&&_(r)){var s=n.getData();s.each((function(t){MP(n,r,s,t)&&(f[t]=1)}))}}
- // Step B
- (n,o,r)})),t.eachSeries((function(t,e){var n={seriesId:t.id,seriesIndex:e,seriesName:t.name,dataIndex:[]};
- // Every series exists in event params, convenient
- // for user to find series by seriesIndex.
- u.selected.push(n);var i=g[e],o=t.getData(),r=x(e)?function(t){return f[t]?(n.dataIndex.push(o.getRawIndex(t)),"inBrush"):"outOfBrush"}:function(e){return MP(t,i,o,e)?(n.dataIndex.push(o.getRawIndex(e)),"inBrush"):"outOfBrush"};
- // If no supported brush or no brush, all visuals are in original state.
- (x(e)?y:_(i))&&function(t,e,n,i,o,r){var s,l={};function u(t){return Dc(n,s,t)}function c(t,e){Cc(n,s,t,e)}function d(t,a){s=null==r?t:a;var d=n.getRawDataItem(s);
- // Consider performance
- // @ts-ignore
- if(!d||!1!==d.visualMap)for(var h=i.call(o,t),p=e[h],f=l[h],g=0,y=f.length;g<y;g++){var m=f[g];p[m]&&p[m].applyVisual(t,u,c)}}a(t,(function(t){var n=mb.prepareVisualTypes(e[t]);l[t]=n})),null==r?n.each(d):n.each([r],d)}
- /**
- * @param data
- * @param stateList
- * @param visualMappings <state, Object.<visualType, module:echarts/visual/VisualMapping>>
- * @param getValueState param: valueOrIndex, return: state.
- * @param dim dimension or dimension index.
- */(vP,v,o,r)}))})),function(t,e,n,i,o){
- // This event will not be triggered when `setOpion`, otherwise dead lock may
- // triggered when do `setOption` in event listener, which we do not find
- // satisfactory way to solve yet. Some considered resolutions:
- // (a) Diff with prevoius selected data ant only trigger event when changed.
- // But store previous data and diff precisely (i.e., not only by dataIndex, but
- // also detect value changes in selected data) might bring complexity or fragility.
- // (b) Use spectial param like `silent` to suppress event triggering.
- // But such kind of volatile param may be weird in `setOption`.
- if(!o)return;var r=t.getZr();if(r[_P])return;r[xP]||(r[xP]=wP);var a=Bu(r,xP,n,e);a(t,i)}(e,r,s,l,o)}function wP(t,e){if(!t.isDisposed()){var n=t.getZr();n[_P]=!0,t.dispatchAction({type:"brushSelect",batch:e}),n[_P]=!1}}function MP(t,e,n,i){for(var o=0,r=e.length;o<r;o++){var a=e[o];if(t.brushSelector(i,n,a.selectors,a))return!0}}var IP={rect:function(t){return DP(t.range)},polygon:function(t){for(var e,n=t.range,i=0,o=n.length;i<o;i++){e=e||[[Infinity,-Infinity],[Infinity,-Infinity]];var r=n[i];r[0]<e[0][0]&&(e[0][0]=r[0]),r[0]>e[0][1]&&(e[0][1]=r[0]),r[1]<e[1][0]&&(e[1][0]=r[1]),r[1]>e[1][1]&&(e[1][1]=r[1])}return e&&DP(e)}};function DP(t){return new Y(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}const TP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new DM(e.getZr())).on("brush",lt(this._onBrush,this)).mount()},e.prototype.render=function(t,e,n,i){this.model=t,this._updateController(t,e,n,i)},e.prototype.updateTransform=function(t,e,n,i){
- // PENDING: `updateTransform` is a little tricky, whose layout need
- // to be calculate mandatorily and other stages will not be performed.
- // Take care the correctness of the logic. See #11754 .
- bP(e),this._updateController(t,e,n,i)},e.prototype.updateVisual=function(t,e,n,i){this.updateTransform(t,e,n,i)},e.prototype.updateView=function(t,e,n,i){this._updateController(t,e,n,i)},e.prototype._updateController=function(t,e,n,i){
- // Do not update controller when drawing.
- (!i||i.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(n)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},
- // updateLayout: updateController,
- // updateVisual: updateController,
- e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var e=this.model.id,n=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);
- // Action is not dispatched on drag end, because the drag end
- // emits the same params with the last drag move event, and
- // may have some delay when using touch pad, which makes
- // animation not smooth (when using debounce).
- (!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:e,areas:et(n),$from:e}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:e,areas:et(n),$from:e})},e.type="brush",e}(Mu);function CP(t,e){return tt({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new yr(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}const AP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,
- /**
- * @readOnly
- */
- n.areas=[],
- /**
- * Current brush painting area settings.
- * @readOnly
- */
- n.brushOption={},n}return Ue(e,t),e.prototype.optionUpdated=function(t,e){var n=this.option;!e&&fP(n,t,["inBrush","outOfBrush"]);var i=n.inBrush=n.inBrush||{};
- // Always give default visual, consider setOption at the second time.
- n.outOfBrush=n.outOfBrush||{color:"#ddd"},i.hasOwnProperty("liftZ")||(
- // Bigger than the highlight z lift, otherwise it will
- // be effected by the highlight z when brush.
- i.liftZ=5)},
- /**
- * If `areas` is null/undefined, range state remain.
- */
- e.prototype.setAreas=function(t){
- // If areas is null/undefined, range state remain.
- // This helps user to dispatchAction({type: 'brush'}) with no areas
- // set but just want to get the current brush select info from a `brush` event.
- t&&(this.areas=n(t,(function(t){return CP(this.option,t)}),this))},
- /**
- * Set the current painting brush option.
- */
- e.prototype.setBrushOption=function(t){this.brushOption=CP(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(Ta);var LP=["rect","polygon","lineX","lineY","keep","clear"];const kP=/** @class */function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ue(e,t),e.prototype.render=function(t,e,n){var i,o,r;e.eachComponent({mainType:"brush"},(function(t){i=t.brushType,o=t.brushOption.brushMode||"single",r=r||!!t.areas.length})),this._brushType=i,this._brushMode=o,a(t.get("type",!0),(function(e){t.setIconStatus(e,("keep"===e?"multiple"===o:"clear"===e?r:e===i)?"emphasis":"normal")}))},e.prototype.updateView=function(t,e,n){this.render(t,e,n)},e.prototype.getIcons=function(){var t=this.model,e=t.get("icon",!0),n={};return a(t.get("type",!0),(function(t){e[t]&&(n[t]=e[t])})),n},e.prototype.onclick=function(t,e,n){var i=this._brushType,o=this._brushMode;"clear"===n?(
- // Trigger parallel action firstly
- e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",
- // Clear all areas of all brush components.
- areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?i:i!==n&&n,brushMode:"keep"===n?"multiple"===o?"single":"multiple":o}})},e.getDefaultOption=function(t){return{show:!0,type:LP.slice(),icon:{
- /* eslint-disable */
- 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"},
- // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear`
- title:t.getLocaleModel().get(["toolbox","brush","title"])}},e}(UL);var PP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode={type:"box",ignoreSize:!0},n}return Ue(e,t),e.type="title",e.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:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(Ta),NP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var i=this.group,o=t.getModel("textStyle"),r=t.getModel("subtextStyle"),a=t.get("textAlign"),s=x(t.get("textBaseline"),t.get("textVerticalAlign")),l=new $({style:Zo(o,{text:t.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),c=t.get("subtext"),d=new $({style:Zo(r,{text:c,fill:r.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),h=t.get("link"),p=t.get("sublink"),f=t.get("triggerEvent",!0);l.silent=!h&&!f,d.silent=!p&&!f,h&&l.on("click",(function(){pa(h,"_"+t.get("target"))})),p&&d.on("click",(function(){pa(p,"_"+t.get("subtarget"))})),ni(l).eventData=ni(d).eventData=f?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(l),c&&i.add(d);
- // If no subText, but add subTextEl, there will be an empty line.
- var g=i.getBoundingRect(),y=t.getBoxLayoutParams();y.width=g.width,y.height=g.height;var m=xa(y,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));
- // Adjust text align based on position
- a||(
- // Align left if title is on the left. center and right is same
- // @ts-ignore
- "middle"===(a=t.get("left")||t.get("right"))&&(a="center"),
- // Adjust layout by text align
- "right"===a?m.x+=m.width:"center"===a&&(m.x+=m.width/2)),s||(
- // @ts-ignore
- "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"),i.x=m.x,i.y=m.y,i.markRedraw();var v={align:a,verticalAlign:s};l.setStyle(v),d.setStyle(v),
- // Render background
- // Get groupRect again because textAlign has been changed
- g=i.getBoundingRect();var _=m.margin,b=t.getItemStyle(["color","opacity"]);b.fill=t.get("backgroundColor");var S=new G({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:t.get("borderRadius")},style:b,subPixelOptimize:!0,silent:!0});i.add(S)}},e.type="title",e}(Mu);
- // View
- var OP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode="box",n}
- /**
- * @override
- */return Ue(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),this._initData()},
- /**
- * @override
- */
- e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.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},
- /**
- * @return {number} currentIndex
- */
- e.prototype.getCurrentIndex=function(){return this.option.currentIndex},
- /**
- * @return {boolean}
- */
- e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},
- /**
- * @param {boolean} state true: play, false: stop
- */
- e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},
- /**
- * @return {boolean} true: play, false: stop
- */
- e.prototype.getPlayState=function(){return!!this.option.autoPlay},
- /**
- * @private
- */
- e.prototype._initData=function(){var t,e=this.option,n=e.data||[],i=e.axisType,r=this._names=[];"category"===i?(t=[],a(n,(function(e,n){var i,a=Ln(In(e),"");o(e)?(i=et(e)).value=n:i=n,t.push(i),r.push(a)}))):t=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number";(this._data=new Fh([{name:"value",type:s}],this)).initData(t,r)},e.prototype.getData=function(){return this._data},
- /**
- * @public
- * @return {Array.<string>} categoreis
- */
- e.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},e.type="timeline",
- /**
- * @protected
- */
- e.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:{},label:{color:"#000"},data:[]},e}(Ta);const RP=OP;var EP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="timeline.slider",
- /**
- * @protected
- */
- e.defaultOption=xr(RP.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",
- // When using number, label position is not
- // restricted by viewRect.
- // positive: right/bottom, negative: left/top
- show:!0,interval:"auto",rotate:0,
- // formatter: null,
- // 其余属性默认使用全局文本样式,详见TEXTSTYLE
- color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",
- // borderColor: 'rgba(194,53,49, 0.5)',
- animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",
- // eslint-disable-next-line max-len
- nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",
- // eslint-disable-next-line max-len
- prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,
- // 其余属性默认使用全局文本样式,详见TEXTSTYLE
- color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(RP);nt(EP,hl.prototype);const VP=EP;const zP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="timeline",e}(Mu);
- /**
- * Extend axis 2d
- */var BP=/** @class */function(t){function e(e,n,i,o){var r=t.call(this,e,n,i)||this;return r.type=o||"value",r}
- /**
- * @override
- */return Ue(e,t),e.prototype.getLabelModel=function(){
- // Force override
- return this.model.getModel("label")},
- /**
- * @override
- */
- e.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},e}(Yf);const GP=BP;var FP=Math.PI,WP=On(),HP=/** @class */function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=n.type,t}return Ue(n,e),n.prototype.init=function(t,e){this.api=e},
- /**
- * @override
- */
- n.prototype.render=function(t,e,n){if(this.model=t,this.api=n,this.ecModel=e,this.group.removeAll(),t.get("show",!0)){var i=this._layout(t,n),o=this._createGroup("_mainGroup"),r=this._createGroup("_labelGroup"),s=this._axis=this._createAxis(i,t);t.formatTooltip=function(t){return $l("nameValue",{noName:!0,value:s.scale.getLabel({value:t})})},a(["AxisLine","AxisTick","Control","CurrentPointer"],(function(e){this["_render"+e](i,o,s,t)}),this),this._renderAxisLabel(i,r,s,t),this._position(i,t)}this._doPlayStop(),this._updateTicksStatus()},
- /**
- * @override
- */
- n.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},
- /**
- * @override
- */
- n.prototype.dispose=function(){this._clearTimer()},n.prototype._layout=function(e,n){var i,o,r,a,s=e.get(["label","position"]),l=e.get("orient"),u=function(t,e){return xa(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()},t.get("padding"))}(e,n),c={horizontal:"center",vertical:(
- // Auto label offset.
- i=null==s||"auto"===s?"horizontal"===l?u.y+u.height/2<n.getHeight()/2?"-":"+":u.x+u.width/2<n.getWidth()/2?"+":"-":t(s)?{horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[l][s]:s)>=0||"+"===i?"left":"right"},d={horizontal:i>=0||"+"===i?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:FP/2},p="vertical"===l?u.height:u.width,f=e.getModel("controlStyle"),g=f.get("show",!0),y=g?f.get("itemSize"):0,m=g?f.get("itemGap"):0,v=y+m,x=e.get(["label","rotate"])||0;x=x*FP/180;var _=f.get("position",!0),b=g&&f.get("showPlayBtn",!0),S=g&&f.get("showPrevBtn",!0),w=g&&f.get("showNextBtn",!0),M=0,I=p;
- // position[0] means left, position[1] means middle.
- "left"===_||"bottom"===_?(b&&(o=[0,0],M+=v),S&&(r=[M,0],M+=v),w&&(a=[I-y,0],I-=v)):(
- // 'top' 'right'
- b&&(o=[I-y,0],I-=v),S&&(r=[0,0],M+=v),w&&(a=[I-y,0],I-=v));var D=[M,I];return e.get("inverse")&&D.reverse(),{viewRect:u,mainLength:p,orient:l,rotation:h[l],labelRotation:x,labelPosOpt:i,labelAlign:e.get(["label","align"])||c[l],labelBaseline:e.get(["label","verticalAlign"])||e.get(["label","baseline"])||d[l],
- // Based on mainGroup.
- playPosition:o,prevBtnPosition:r,nextBtnPosition:a,axisExtent:D,controlSize:y,controlGap:m}},n.prototype._position=function(e,n){
- // Position is be called finally, because bounding rect is needed for
- // adapt content to fill viewRect (auto adapt offset).
- // Timeline may be not all in the viewRect when 'offset' is specified
- // as a number, because it is more appropriate that label aligns at
- // 'offset' but not the other edge defined by viewRect.
- var i=this._mainGroup,o=this._labelGroup,r=e.viewRect;if("vertical"===e.orient){
- // transform to horizontal, inverse rotate by left-top point.
- var a=te(),s=r.x,l=r.y+r.height;oe(a,a,[-s,-l]),Ut(a,a,-FP/2),oe(a,a,[s,l]),(r=r.clone()).applyTransform(a)}var u=m(r),c=m(i.getBoundingRect()),d=m(o.getBoundingRect()),h=[i.x,i.y],p=[o.x,o.y];p[0]=h[0]=u[0][0];var f,g=e.labelPosOpt;null==g||t(g)?(v(h,c,u,1,f="+"===g?0:1),v(p,d,u,1,1-f)):(v(h,c,u,1,f=g>=0?0:1),p[1]=h[1]+g);function y(t){t.originX=u[0][0]-t.x,t.originY=u[1][0]-t.y}function m(t){
- // [[xmin, xmax], [ymin, ymax]]
- return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function v(t,e,n,i,o){t[i]+=n[i][o]-e[i][o]}i.setPosition(h),o.setPosition(p),i.rotation=o.rotation=e.rotation,y(i),y(o)},n.prototype._createAxis=function(t,e){var n=e.getData(),i=e.get("axisType"),o=function(t,e){if(e=e||t.get("type"),e)switch(e){
- // Buildin scale
- case"category":return new pp({ordinalMeta:t.getCategories(),extent:[Infinity,-Infinity]});case"time":return new zp({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:
- // default to be value
- return new yp}}(e,i);
- // Customize scale. The `tickValue` is `dataIndex`.
- o.getTicks=function(){return n.mapArray(["value"],(function(t){return{value:t}}))};var r=n.getDataExtent("value");o.setExtent(r[0],r[1]),o.calcNiceTicks();var a=new GP("value",o,t.axisExtent,i);return a.model=e,a},n.prototype._createGroup=function(t){var e=this[t]=new Z;return this.group.add(e),e},n.prototype._renderAxisLine=function(t,e,n,i){var o=n.getExtent();if(i.get(["lineStyle","show"])){var r=new F({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:p({lineCap:"round"},i.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});e.add(r);var a=this._progressLine=new F({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:I({lineCap:"round",lineWidth:r.style.lineWidth},i.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});e.add(a)}},n.prototype._renderAxisTick=function(t,e,n,i){var o=this,r=i.getData(),s=n.scale.getTicks();this._tickSymbols=[],
- // The value is dataIndex, see the customized scale.
- a(s,(function(t){var a=n.dataToCoord(t.value),s=r.getItemModel(t.value),l=s.getModel("itemStyle"),u=s.getModel(["emphasis","itemStyle"]),c=s.getModel(["progress","itemStyle"]),d={x:a,y:0,onclick:lt(o._changeTimeline,o,t.value)},h=YP(s,l,e,d);h.ensureState("emphasis").style=u.getItemStyle(),h.ensureState("progress").style=c.getItemStyle(),Yi(h);var p=ni(h);s.get("tooltip")?(p.dataIndex=t.value,p.dataModel=i):p.dataIndex=p.dataModel=null,o._tickSymbols.push(h)}))},n.prototype._renderAxisLabel=function(t,e,n,i){var o=this;if(n.getLabelModel().get("show")){var r=i.getData(),s=n.getViewLabels();this._tickLabels=[],a(s,(function(i){
- // The tickValue is dataIndex, see the customized scale.
- var a=i.tickValue,s=r.getItemModel(a),l=s.getModel("label"),u=s.getModel(["emphasis","label"]),c=s.getModel(["progress","label"]),d=n.dataToCoord(i.tickValue),h=new $({x:d,y:0,rotation:t.labelRotation-t.rotation,onclick:lt(o._changeTimeline,o,a),silent:!1,style:Zo(l,{text:i.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});h.ensureState("emphasis").style=Zo(u),h.ensureState("progress").style=Zo(c),e.add(h),Yi(h),WP(h).dataIndex=a,o._tickLabels.push(h)}))}},n.prototype._renderControl=function(t,e,n,i){var o=t.controlSize,r=t.rotation,a=i.getModel("controlStyle").getItemStyle(),s=i.getModel(["emphasis","controlStyle"]).getItemStyle(),l=i.getPlayState(),u=i.get("inverse",!0);function c(t,n,l,u){if(t){var c=Mt(x(i.get(["controlStyle",n+"BtnSize"]),o),o),d=function(t,e,n,i){var o=i.style,r=No(t.get(["controlStyle",e]),i||{},new Y(n[0],n[1],n[2],n[3]));
- // TODO createIcon won't use style in opt.
- o&&r.setStyle(o);return r}
- /**
- * Create symbol or update symbol
- * opt: basic position and event handlers
- */(i,n+"Icon",[0,-c/2,c,c],{x:t[0],y:t[1],originX:o/2,originY:0,rotation:u?-r:0,rectHover:!0,style:a,onclick:l});d.ensureState("emphasis").style=s,e.add(d),Yi(d)}}c(t.nextBtnPosition,"next",lt(this._changeTimeline,this,u?"-":"+")),c(t.prevBtnPosition,"prev",lt(this._changeTimeline,this,u?"+":"-")),c(t.playPosition,l?"stop":"play",lt(this._handlePlayClick,this,!l),!0)},n.prototype._renderCurrentPointer=function(t,e,n,i){var o=i.getData(),r=i.getCurrentIndex(),a=o.getItemModel(r).getModel("checkpointStyle"),s=this,l={onCreate:function(t){t.draggable=!0,t.drift=lt(s._handlePointerDrag,s),t.ondragend=lt(s._handlePointerDragend,s),UP(t,s._progressLine,r,n,i,!0)},onUpdate:function(t){UP(t,s._progressLine,r,n,i)}};
- // Reuse when exists, for animation and drag.
- this._currentPointer=YP(a,a,this._mainGroup,{},this._currentPointer,l)},n.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},n.prototype._handlePointerDrag=function(t,e,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},n.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},n.prototype._pointerChangeTimeline=function(t,e){var n=this._toAxisCoord(t)[0],i=Ke(this._axis.getExtent().slice());n>i[1]&&(n=i[1]),n<i[0]&&(n=i[0]),this._currentPointer.x=n,this._currentPointer.markRedraw();var o=this._progressLine;o&&(o.shape.x2=n,o.dirty());var r=this._findNearestTick(n),a=this.model;(e||r!==a.getCurrentIndex()&&a.get("realtime"))&&this._changeTimeline(r)},n.prototype._doPlayStop=function(){var t=this;this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout((function(){
- // Do not cache
- var e=t.model;t._changeTimeline(e.getCurrentIndex()+(e.get("rewind",!0)?-1:1))}),this.model.get("playInterval")))},n.prototype._toAxisCoord=function(t){return To(t,this._mainGroup.getLocalTransform(),!0)},n.prototype._findNearestTick=function(t){var e,n=this.model.getData(),i=Infinity,o=this._axis;return n.each(["value"],(function(n,r){var a=o.dataToCoord(n),s=Math.abs(a-t);s<i&&(i=s,e=r)})),e},n.prototype._clearTimer=function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},n.prototype._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})},n.prototype._updateTicksStatus=function(){var t=this.model.getCurrentIndex(),e=this._tickSymbols,n=this._tickLabels;if(e)for(var i=0;i<e.length;i++)e&&e[i]&&e[i].toggleState("progress",i<t);if(n)for(i=0;i<n.length;i++)n&&n[i]&&n[i].toggleState("progress",WP(n[i]).dataIndex<=t)},n.type="timeline.slider",n}(zP);function YP(t,e,n,i,o,r){var a=e.get("color");o?(o.setColor(a),n.add(o),// Group may be new, also need to add.
- r&&r.onUpdate(o)):((o=Gc(t.get("symbol"),-1,-1,2,2,a)).setStyle("strokeNoScale",!0),n.add(o),r&&r.onCreate(o));
- // Style
- var s=e.getItemStyle(["color"]);o.setStyle(s),
- // Transform and events.
- i=tt({rectHover:!0,z2:100},i,!0);var l=Fc(t.get("symbolSize"));i.scaleX=l[0]/2,i.scaleY=l[1]/2;var u=Wc(t.get("symbolOffset"),l);u&&(i.x=(i.x||0)+u[0],i.y=(i.y||0)+u[1]);var c=t.get("symbolRotate");return i.rotation=(c||0)*Math.PI/180||0,o.attr(i),
- // FIXME
- // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed,
- // getBoundingRect will return wrong result.
- // (This is supposed to be resolved in zrender, but it is a little difficult to
- // leverage performance and auto updateTransform)
- // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol.
- o.updateTransform(),o}function UP(t,e,n,i,o,r){if(!t.dragging){var a=o.getModel("checkpointStyle"),s=i.dataToCoord(o.getData().get("value",n));if(r||!a.get("animation",!0))t.attr({x:s,y:0}),e&&e.attr({shape:{x2:s}});else{var l={duration:a.get("animationDuration",!0),easing:a.get("animationEasing",!0)};t.stopAnimation(null,!0),t.animateTo({x:s,y:0},l),e&&e.animateTo({shape:{x2:s}},l)}}}const ZP=HP;function XP(t){var e=t&&t.timeline;i(e)||(e=e?[e]:[]),a(e,(function(t){t&&function(t){var e=t.type,n={number:"value",time:"time"};
- // Compatible with ec2
- n[e]&&(t.axisType=n[e],delete t.type);if(jP(t),qP(t,"controlPosition")){var r=t.controlStyle||(t.controlStyle={});qP(r,"position")||(r.position=t.controlPosition),"none"!==r.position||qP(r,"show")||(r.show=!1,delete r.position),delete t.controlPosition}a(t.data||[],(function(t){o(t)&&!i(t)&&(!qP(t,"value")&&qP(t,"name")&&(
- // In ec2, using name as value.
- t.value=t.name),jP(t))}))}(t)}))}function jP(t){var e=t.itemStyle||(t.itemStyle={}),n=e.emphasis||(e.emphasis={}),i=t.label||t.label||{},o=i.normal||(i.normal={}),r={normal:1,emphasis:1};a(i,(function(t,e){r[e]||qP(o,e)||(o[e]=t)})),n.label&&!qP(i,"emphasis")&&(i.emphasis=n.label,delete n.label)}function qP(t,e){return t.hasOwnProperty(e)}function KP(t,e){if(!t)return!1;for(var n=i(t)?t:[t],o=0;o<n.length;o++)if(n[o]&&n[o][e])return!0;return!1}function JP(t){wn(t,"label",["show"])}
- // { [componentType]: MarkerModel }
- var $P=On(),QP=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,
- /**
- * If marker model is created by self from series
- */
- n.createdBySelf=!1,n}
- /**
- * @overrite
- */return Ue(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),this._mergeOption(t,n,!1,!0)},e.prototype.isAnimationEnabled=function(){if(d.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},
- /**
- * @overrite
- */
- e.prototype.mergeOption=function(t,e){this._mergeOption(t,e,!1,!1)},e.prototype._mergeOption=function(t,e,n,i){var o=this.mainType;n||e.eachSeries((function(t){
- // mainType can be markPoint, markLine, markArea
- var n=t.get(this.mainType,!0),r=$P(t)[o];n&&n.data?(r?r._mergeOption(n,e,!0):(i&&
- // Default label emphasis `position` and `show`
- JP(n),a(n.data,(function(t){
- // FIXME Overwrite fillLabel method ?
- t instanceof Array?(JP(t[0]),JP(t[1])):JP(t)})),r=this.createMarkerModelFromSeries(n,this,e),
- // markerModel = new ImplementedMarkerModel(
- // markerOpt, this, ecModel
- // );
- p(r,{mainType:this.mainType,
- // Use the same series index and name
- seriesIndex:t.seriesIndex,name:t.name,createdBySelf:!0}),r.__hostSeries=t),$P(t)[o]=r):$P(t)[o]=null}),this)},e.prototype.formatTooltip=function(t,e,n){var i=this.getData(),o=this.getRawValue(t),r=i.getName(t);return $l("section",{header:this.name,blocks:[$l("nameValue",{name:r,value:o,noName:!r,noValue:null==o})]})},e.prototype.getData=function(){return this._data},e.prototype.setData=function(t){this._data=t},e.prototype.getDataParams=function(t,e){var n=hl.prototype.getDataParams.call(this,t,e),i=this.__hostSeries;return i&&(n.seriesId=i.id,n.seriesName=i.name,n.seriesType=i.subType),n},e.getMarkerModelFromSeries=function(t,
- // Support three types of markers. Strict check.
- e){return $P(t)[e]},e.type="marker",e.dependencies=["series","grid","polar","geo"],e}(Ta);nt(QP,hl.prototype);const tN=QP;const eN=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markPoint",e.defaultOption={
- // zlevel: 0,
- z:5,symbol:"pin",symbolSize:50,
- // symbolRotate: 0,
- // symbolOffset: [0, 0]
- tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},e}(tN);function nN(t){return!(isNaN(parseFloat(t.x))&&isNaN(parseFloat(t.y)))}function iN(t,e,n,i,o,r){var a=[],s=qh(e,i/* , otherDataDim */)?e.getCalculationInfo("stackResultDimension"):i,l=uN(e,s,t),u=e.indicesOfNearest(s,l)[0];a[o]=e.get(n,u),a[r]=e.get(s,u);var c=e.get(i,u),d=Je(e.get(i,u));
- // Make it simple, do not visit all stacked value to count precision.
- return(d=Math.min(d,20))>=0&&(a[r]=+a[r].toFixed(d)),[a,c]}
- // TODO Specified percent
- var oN={min:rt(iN,"min"),max:rt(iN,"max"),average:rt(iN,"average"),median:rt(iN,"median")};
- /**
- * Transform markPoint data item to format used in List by do the following
- * 1. Calculate statistic like `max`, `min`, `average`
- * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array
- */function rN(t,e){if(e){var n=t.getData(),o=t.coordinateSystem,r=o&&o.dimensions;
- // 1. If not specify the position with pixel directly
- // 2. If `coord` is not a data array. Which uses `xAxis`,
- // `yAxis` to specify the coord on each dimension
- // parseFloat first because item.x and item.y can be percent string like '20%'
- if(!function(t){return!isNaN(parseFloat(t.x))&&!isNaN(parseFloat(t.y))}(e)&&!i(e.coord)&&i(r)){var a=aN(e,n,o,t);
- // Clone the option
- // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value
- if((e=et(e)).type&&oN[e.type]&&a.baseAxis&&a.valueAxis){var s=c(r,a.baseAxis.dim),l=c(r,a.valueAxis.dim),u=oN[e.type](n,a.baseDataDim,a.valueDataDim,s,l);e.coord=u[0],
- // Force to use the value of calculated value.
- // let item use the value without stack.
- e.value=u[1]}else
- // FIXME Only has one of xAxis and yAxis.
- e.coord=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis]}
- // x y is provided
- if(null!=e.coord&&i(r))for(
- // Each coord support max, min, average
- var d=e.coord,h=0;h<2;h++)oN[d[h]]&&(d[h]=uN(n,n.mapDimension(r[h]),d[h]));else e.coord=[];return e}}function aN(t,e,n,i){var o={};return null!=t.valueIndex||null!=t.valueDim?(o.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,o.valueAxis=n.getAxis(function(t,e){var n=t.getData().getDimensionInfo(e);return n&&n.coordDim}
- /**
- * Filter data which is out of coordinateSystem range
- * [dataFilter description]
- */(i,o.valueDataDim)),o.baseAxis=n.getOtherAxis(o.valueAxis),o.baseDataDim=e.mapDimension(o.baseAxis.dim)):(o.baseAxis=i.getBaseAxis(),o.valueAxis=n.getOtherAxis(o.baseAxis),o.baseDataDim=e.mapDimension(o.baseAxis.dim),o.valueDataDim=e.mapDimension(o.valueAxis.dim)),o}function sN(
- // Currently only polar and cartesian has containData.
- t,e){
- // Always return true if there is no coordSys
- return!(t&&t.containData&&e.coord&&!nN(e))||t.containData(e.coord)}function lN(t,e){return t?function(t,n,i,o){return ml(o<2?t.coord&&t.coord[o]:t.value,e[o])}:function(t,n,i,o){return ml(t.value,e[o])}}function uN(t,e,n){if("average"===n){var i=0,o=0;return t.each(e,(function(t,e){isNaN(t)||(i+=t,o++)})),i/o}return"median"===n?t.getMedian(e):t.getDataExtent(e)["max"===n?1:0]}var cN=On();const dN=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.init=function(){this.markerGroupMap=r()},e.prototype.render=function(t,e,n){var i=this,o=this.markerGroupMap;o.each((function(t){cN(t).keep=!1})),e.eachSeries((function(t){var o=tN.getMarkerModelFromSeries(t,i.type);o&&i.renderSeries(t,o,e,n)})),o.each((function(t){!cN(t).keep&&i.group.remove(t.group)}))},e.prototype.markKeep=function(t){cN(t).keep=!0},e.prototype.toggleBlurSeries=function(t,e){var n=this;a(t,(function(t){var i=tN.getMarkerModelFromSeries(t,n.type);i&&i.getData().eachItemGraphicEl((function(t){t&&(e?Ni(t):Oi(t))}))}))},e.type="marker",e}(Mu);function hN(t,e,n){var i=e.coordinateSystem;t.each((function(o){var r,a=t.getItemModel(o),s=je(a.get("x"),n.getWidth()),l=je(a.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(e.getMarkerPosition)
- // Use the getMarkerPosition
- r=e.getMarkerPosition(t.getValues(t.dimensions,o));else if(i){var u=t.get(i.dimensions[0],o),c=t.get(i.dimensions[1],o);r=i.dataToPoint([u,c])}
- // Use x, y if has any
- }else r=[s,l];isNaN(s)||(r[0]=s),isNaN(l)||(r[1]=l),t.setItemLayout(o,r)}))}var pN=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=tN.getMarkerModelFromSeries(t,"markPoint");e&&(hN(e.getData(),t,n),this.markerGroupMap.get(t.id).updateLayout())}),this)},e.prototype.renderSeries=function(t,e,i,o){var r=t.coordinateSystem,a=t.id,s=t.getData(),l=this.markerGroupMap,u=l.get(a)||l.set(a,new Yg),c=function(t,e,i){var o;o=t?n(t&&t.dimensions,(function(t){var n=e.getData().getDimensionInfo(e.getData().mapDimension(t))||{};
- // In map series data don't have lng and lat dimension. Fallback to same with coordSys
- return p(p({},n),{name:t,
- // DON'T use ordinalMeta to parse and collect ordinal.
- ordinalMeta:null})})):[{name:"value",type:"float"}];var r=new Fh(o,i),a=n(i.get("data"),rt(rN,e));t&&(a=st(a,rt(sN,t)));var s=lN(!!t,o);return r.initData(a,null,s),r}(r,t,e);
- // FIXME
- e.setData(c),hN(e.getData(),t,o),c.each((function(t){var n=c.getItemModel(t),i=n.getShallow("symbol"),o=n.getShallow("symbolSize"),r=n.getShallow("symbolRotate"),a=n.getShallow("symbolOffset"),l=n.getShallow("symbolKeepAspect");
- // TODO: refactor needed: single data item should not support callback function
- if(f(i)||f(o)||f(r)||f(a)){var u=e.getRawValue(t),d=e.getDataParams(t);f(i)&&(i=i(u,d)),f(o)&&(
- // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据?
- o=o(u,d)),f(r)&&(r=r(u,d)),f(a)&&(a=a(u,d))}var h=n.getModel("itemStyle").getItemStyle(),p=Tc(s,"color");h.fill||(h.fill=p),c.setItemVisual(t,{symbol:i,symbolSize:o,symbolRotate:r,symbolOffset:a,symbolKeepAspect:l,style:h})})),
- // TODO Text are wrong
- u.updateData(c),this.group.add(u.group),
- // Set host model for tooltip
- // FIXME
- c.eachItemGraphicEl((function(t){t.traverse((function(t){ni(t).dataModel=e}))})),this.markKeep(u),u.group.silent=e.get("silent")||t.get("silent")},e.type="markPoint",e}(dN);const fN=pN;const gN=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markLine",e.defaultOption={
- // zlevel: 0,
- z:5,symbol:["circle","arrow"],symbolSize:[8,16],
- // symbolRotate: 0,
- symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(tN);var yN=On(),mN=function(t,e,n,o){var r,a=t.getData();if(i(o))r=o;else{
- // Special type markLine like 'min', 'max', 'average', 'median'
- var s=o.type;if("min"===s||"max"===s||"average"===s||"median"===s||null!=o.xAxis||null!=o.yAxis){var u=void 0,c=void 0;if(null!=o.yAxis||null!=o.xAxis)u=e.getAxis(null!=o.yAxis?"y":"x"),c=Yt(o.yAxis,o.xAxis);else{var d=aN(o,a,e,t);u=d.valueAxis,c=uN(a,Kh(a,d.valueDataDim),s)}var h="x"===u.dim?0:1,f=1-h,g=et(o),y={coord:[]};g.type=null,g.coord=[],g.coord[f]=-Infinity,y.coord[f]=Infinity;var m=n.get("precision");m>=0&&l(c)&&(c=+c.toFixed(Math.min(m,20))),g.coord[h]=y.coord[h]=c,r=[g,y,{type:s,valueIndex:o.valueIndex,
- // Force to use the value of calculated value.
- value:c}]}else r=[]}var v=[rN(t,r[0]),rN(t,r[1]),p({},r[2])];
- // Avoid line data type is extended by from(to) data type
- return v[2].type=v[2].type||null,
- // Merge from option and to option into line option
- tt(v[2],v[0]),tt(v[2],v[1]),v};function vN(t){return!isNaN(t)&&!isFinite(t)}
- // If a markLine has one dim
- function xN(t,e,n,i){var o=1-t,r=i.dimensions[t];return vN(e[o])&&vN(n[o])&&e[t]===n[t]&&i.getAxis(r).containData(e[t])}function _N(t,e){if("cartesian2d"===t.type){var n=e[0].coord,i=e[1].coord;
- // In case
- // {
- // markLine: {
- // data: [{ yAxis: 2 }]
- // }
- // }
- if(n&&i&&(xN(1,n,i,t)||xN(0,n,i,t)))return!0}return sN(t,e[0])&&sN(t,e[1])}function bN(t,e,n,i,o){var r,a=i.coordinateSystem,s=t.getItemModel(e),l=je(s.get("x"),o.getWidth()),u=je(s.get("y"),o.getHeight());if(isNaN(l)||isNaN(u)){
- // Chart like bar may have there own marker positioning logic
- if(i.getMarkerPosition)
- // Use the getMarkerPosition
- r=i.getMarkerPosition(t.getValues(t.dimensions,e));else{var c=a.dimensions,d=t.get(c[0],e),h=t.get(c[1],e);r=a.dataToPoint([d,h])}
- // Expand line to the edge of grid if value on one axis is Inifnity
- // In case
- // markLine: {
- // data: [{
- // yAxis: 2
- // // or
- // type: 'average'
- // }]
- // }
- if(oy(a,"cartesian2d")){
- // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug
- var p=a.getAxis("x"),f=a.getAxis("y");c=a.dimensions;vN(t.get(c[0],e))?r[0]=p.toGlobalCoord(p.getExtent()[n?0:1]):vN(t.get(c[1],e))&&(r[1]=f.toGlobalCoord(f.getExtent()[n?0:1]))}
- // Use x, y if has any
- isNaN(l)||(r[0]=l),isNaN(u)||(r[1]=u)}else r=[l,u];t.setItemLayout(e,r)}const SN=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=tN.getMarkerModelFromSeries(t,"markLine");if(e){var i=e.getData(),o=yN(e).from,r=yN(e).to;
- // Update visual and layout of from symbol and to symbol
- o.each((function(e){bN(o,e,!0,t,n),bN(r,e,!1,t,n)})),
- // Update layout of line
- i.each((function(t){i.setItemLayout(t,[o.getItemLayout(t),r.getItemLayout(t)])})),this.markerGroupMap.get(t.id).updateLayout()}}),this)},e.prototype.renderSeries=function(t,e,o,r){var a=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new MS);this.group.add(c.group);var d=function(t,e,i){var o;o=t?n(t&&t.dimensions,(function(t){var n=e.getData().getDimensionInfo(e.getData().mapDimension(t))||{};
- // In map series data don't have lng and lat dimension. Fallback to same with coordSys
- return p(p({},n),{name:t,
- // DON'T use ordinalMeta to parse and collect ordinal.
- ordinalMeta:null})})):[{name:"value",type:"float"}];var r=new Fh(o,i),a=new Fh(o,i),s=new Fh([],i),l=n(i.get("data"),rt(mN,e,t,i));t&&(l=st(l,rt(_N,t)));var u=lN(!!t,o);return r.initData(n(l,(function(t){return t[0]})),null,u),a.initData(n(l,(function(t){return t[1]})),null,u),s.initData(n(l,(function(t){return t[2]}))),s.hasItemOption=!0,{from:r,to:a,line:s}}(a,t,e),h=d.from,f=d.to,g=d.line;yN(e).from=h,yN(e).to=f,
- // Line data for tooltip and formatter
- e.setData(g);
- // TODO
- // Functionally, `symbolSize` & `symbolOffset` can also be 2D array now.
- // But the related logic and type definition are not finished yet.
- // Finish it if required
- var y=e.get("symbol"),m=e.get("symbolSize"),v=e.get("symbolRotate"),_=e.get("symbolOffset");function b(e,n,i){var o=e.getItemModel(n);bN(e,n,i,t,r);var a=o.getModel("itemStyle").getItemStyle();null==a.fill&&(a.fill=Tc(l,"color")),e.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),
- // `0` should be considered as a valid value, so use `retrieve2` instead of `||`
- symbolOffset:x(o.get("symbolOffset",!0),_[i?0:1]),symbolRotate:x(o.get("symbolRotate",!0),v[i?0:1]),
- // TODO: when 2d array is supported, it should ignore parent
- symbolSize:x(o.get("symbolSize"),m[i?0:1]),symbol:x(o.get("symbol",!0),y[i?0:1]),style:a})}
- // TODO: support callback function like markPoint
- i(y)||(y=[y,y]),i(m)||(m=[m,m]),i(v)||(v=[v,v]),i(_)||(_=[_,_]),
- // Update visual and layout of from symbol and to symbol
- d.from.each((function(t){b(h,t,!0),b(f,t,!1)})),
- // Update visual and layout of line
- g.each((function(t){var e=g.getItemModel(t).getModel("lineStyle").getLineStyle();
- // lineData.setItemVisual(idx, {
- // color: lineColor || fromData.getItemVisual(idx, 'color')
- // });
- g.setItemLayout(t,[h.getItemLayout(t),f.getItemLayout(t)]),null==e.stroke&&(e.stroke=h.getItemVisual(t,"style").fill),g.setItemVisual(t,{fromSymbolKeepAspect:h.getItemVisual(t,"symbolKeepAspect"),fromSymbolOffset:h.getItemVisual(t,"symbolOffset"),fromSymbolRotate:h.getItemVisual(t,"symbolRotate"),fromSymbolSize:h.getItemVisual(t,"symbolSize"),fromSymbol:h.getItemVisual(t,"symbol"),toSymbolKeepAspect:f.getItemVisual(t,"symbolKeepAspect"),toSymbolOffset:f.getItemVisual(t,"symbolOffset"),toSymbolRotate:f.getItemVisual(t,"symbolRotate"),toSymbolSize:f.getItemVisual(t,"symbolSize"),toSymbol:f.getItemVisual(t,"symbol"),style:e})})),c.updateData(g),
- // Set host model for tooltip
- // FIXME
- d.line.eachItemGraphicEl((function(t){ni(t).dataModel=e,t.traverse((function(t){ni(t).dataModel=e}))})),this.markKeep(c),c.group.silent=e.get("silent")||t.get("silent")},e.type="markLine",e}(dN);const wN=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markArea",e.defaultOption={
- // zlevel: 0,
- // PENDING
- z:1,tooltip:{trigger:"item"},
- // markArea should fixed on the coordinate system
- animation:!1,label:{show:!0,position:"top"},itemStyle:{
- // color and borderColor default to use color from series
- // color: 'auto'
- // borderColor: 'auto'
- borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(tN);var MN=On(),IN=function(t,e,n,i){
- // item may be null
- var o=i[0],r=i[1];if(o&&r){var a=rN(t,o),s=rN(t,r),l=a.coord,u=s.coord;l[0]=Yt(l[0],-Infinity),l[1]=Yt(l[1],-Infinity),u[0]=Yt(u[0],Infinity),u[1]=Yt(u[1],Infinity);
- // Merge option into one
- var c=ne([{},a,s]);return c.coord=[a.coord,s.coord],c.x0=a.x,c.y0=a.y,c.x1=s.x,c.y1=s.y,c}};function DN(t){return!isNaN(t)&&!isFinite(t)}
- // If a markArea has one dim
- function TN(t,e,n,i){var o=1-t;return DN(e[o])&&DN(n[o])}function CN(t,e){var n=e.coord[0],i=e.coord[1],o={coord:n,x:e.x0,y:e.y0},r={coord:i,x:e.x1,y:e.y1};return oy(t,"cartesian2d")?
- // In case
- // {
- // markArea: {
- // data: [{ yAxis: 2 }]
- // }
- // }
- !(!n||!i||!TN(1,n,i)&&!TN(0,n,i))||function(
- // Currently only polar and cartesian has containData.
- t,e,n){
- // Always return true if there is no coordSys
- return!(t&&t.containZone&&e.coord&&n.coord&&!nN(e)&&!nN(n))||t.containZone(e.coord,n.coord)}(t,o,r):sN(t,o)||sN(t,r)}
- // dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0']
- function AN(t,e,n,i,o){var r,a=i.coordinateSystem,s=t.getItemModel(e),l=je(s.get(n[0]),o.getWidth()),u=je(s.get(n[1]),o.getHeight());if(isNaN(l)||isNaN(u)){
- // Chart like bar may have there own marker positioning logic
- if(i.getMarkerPosition){
- // Consider the case that user input the right-bottom point first
- // Pick the larger x and y as 'x1' and 'y1'
- var c=t.getValues(["x0","y0"],e),d=t.getValues(["x1","y1"],e),h=a.clampData(c),p=a.clampData(d),f=[];"x0"===n[0]?f[0]=h[0]>p[0]?d[0]:c[0]:f[0]=h[0]>p[0]?c[0]:d[0],"y0"===n[1]?f[1]=h[1]>p[1]?d[1]:c[1]:f[1]=h[1]>p[1]?c[1]:d[1],
- // Use the getMarkerPosition
- r=i.getMarkerPosition(f,n,!0)}else{var g=[v=t.get(n[0],e),x=t.get(n[1],e)];a.clampData&&a.clampData(g,g),r=a.dataToPoint(g,!0)}if(oy(a,"cartesian2d")){
- // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug
- var y=a.getAxis("x"),m=a.getAxis("y"),v=t.get(n[0],e),x=t.get(n[1],e);DN(v)?r[0]=y.toGlobalCoord(y.getExtent()["x0"===n[0]?0:1]):DN(x)&&(r[1]=m.toGlobalCoord(m.getExtent()["y0"===n[1]?0:1]))}
- // Use x, y if has any
- isNaN(l)||(r[0]=l),isNaN(u)||(r[1]=u)}else r=[l,u];return r}var LN=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],kN=/** @class */function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.type,t}return Ue(i,e),i.prototype.updateTransform=function(t,e,i){e.eachSeries((function(t){var e=tN.getMarkerModelFromSeries(t,"markArea");if(e){var o=e.getData();o.each((function(e){var r=n(LN,(function(n){return AN(o,e,n,t,i)}));
- // Layout
- o.setItemLayout(e,r),o.getItemGraphicEl(e).setShape("points",r)}))}}),this)},i.prototype.renderSeries=function(e,i,o,r){var a=e.coordinateSystem,s=e.id,l=e.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,{group:new Z});this.group.add(c.group),this.markKeep(c);var d=function(t,e,i){var o,r,a=["x0","y0","x1","y1"];if(t){var s=n(t&&t.dimensions,(function(t){var n=e.getData(),i=n.getDimensionInfo(n.mapDimension(t))||{};
- // In map series data don't have lng and lat dimension. Fallback to same with coordSys
- return p(p({},i),{name:t,
- // DON'T use ordinalMeta to parse and collect ordinal.
- ordinalMeta:null})}));r=n(a,(function(t,e){return{name:t,type:s[e%2].type}})),o=new Fh(r,i)}else o=new Fh(r=[{name:"value",type:"float"}],i);var l=n(i.get("data"),rt(IN,e,t,i));t&&(l=st(l,rt(CN,t)));var u=t?function(t,e,n,i){return ml(t.coord[Math.floor(i/2)][i%2],r[i])}:function(t,e,n,i){return ml(t.value,r[i])};return o.initData(l,null,u),o.hasItemOption=!0,o}(a,e,i);
- // Line data for tooltip and formatter
- i.setData(d),
- // Update visual and layout of line
- d.each((function(i){
- // Layout
- var o=n(LN,(function(t){return AN(d,i,t,e,r)})),s=a.getAxis("x").scale,u=a.getAxis("y").scale,c=s.getExtent(),h=u.getExtent(),p=[s.parse(d.get("x0",i)),s.parse(d.get("x1",i))],f=[u.parse(d.get("y0",i)),u.parse(d.get("y1",i))];Ke(p),Ke(f);var g=!!(c[0]>p[1]||c[1]<p[0]||h[0]>f[1]||h[1]<f[0]);
- // If none of the area is inside coordSys, allClipped is set to be true
- // in layout so that label will not be displayed. See #12591
- d.setItemLayout(i,{points:o,allClipped:g});var y=d.getItemModel(i).getModel("itemStyle").getItemStyle(),m=Tc(l,"color");y.fill||(y.fill=m,t(y.fill)&&(y.fill=ce(y.fill,.4))),y.stroke||(y.stroke=m),
- // Visual
- d.setItemVisual(i,"style",y)})),d.diff(MN(c).data).add((function(t){var e=d.getItemLayout(t);if(!e.allClipped){var n=new z({shape:{points:e.points}});d.setItemGraphicEl(t,n),c.group.add(n)}})).update((function(t,e){var n=MN(c).data.getItemGraphicEl(e),o=d.getItemLayout(t);o.allClipped?n&&c.group.remove(n):(n?io(n,{shape:{points:o.points}},i,t):n=new z({shape:{points:o.points}}),d.setItemGraphicEl(t,n),c.group.add(n))})).remove((function(t){var e=MN(c).data.getItemGraphicEl(t);c.group.remove(e)})).execute(),d.eachItemGraphicEl((function(e,n){var o=d.getItemModel(n),r=d.getItemVisual(n,"style");e.useStyle(d.getItemVisual(n,"style")),Yo(e,Uo(o),{labelFetcher:i,labelDataIndex:n,defaultText:d.getName(n)||"",inheritColor:t(r.fill)?ce(r.fill,1):"#000"}),qi(e,o),Ui(e,null,null,o.get(["emphasis","disabled"])),ni(e).dataModel=i})),MN(c).data=d,c.group.silent=i.get("silent")||e.get("silent")},i.type="markArea",i}(dN);const PN=kN;var NN=/** @class */function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=o.type,t.layoutMode={type:"box",
- // legend.width/height are maxWidth/maxHeight actually,
- // whereas real width/height is calculated by its content.
- // (Setting {left: 10, right: 10} does not make sense).
- // So consider the case:
- // `setOption({legend: {left: 10});`
- // then `setOption({legend: {right: 10});`
- // The previous `left` should be cleared by setting `ignoreSize`.
- ignoreSize:!0},t}return Ue(o,e),o.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),t.selected=t.selected||{},this._updateSelector(t)},o.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},o.prototype._updateSelector=function(e){var n=e.selector,o=this.ecModel;!0===n&&(n=e.selector=["all","inverse"]),i(n)&&a(n,(function(e,i){t(e)&&(e={type:e}),n[i]=tt(e,function(t,e){return"all"===e?{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])}:"inverse"===e?{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(o,e.type))}))},o.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;
- // If selectedMode is single, try to select one
- if(t[0]&&"single"===this.get("selectedMode")){
- // If has any selected in option.selected
- for(var e=!1,n=0;n<t.length;n++){var i=t[n].get("name");if(this.isSelected(i)){
- // Force to unselect others
- this.select(i),e=!0;break}}
- // Try select the first if selectedMode is single
- !e&&this.select(t[0].get("name"))}},o.prototype._updateData=function(e){var i=[],o=[];e.eachRawSeries((function(t){var n,r=t.name;if(o.push(r),t.legendVisualProvider){var a=t.legendVisualProvider.getAllNames();e.isSeriesFiltered(t)||(o=o.concat(a)),a.length?i=i.concat(a):n=!0}else n=!0;n&&kn(t)&&i.push(t.name)})),
- /**
- * @type {Array.<string>}
- * @private
- */
- this._availableNames=o;
- // If legend.data is not specified in option, use availableNames as data,
- // which is convenient for user preparing option.
- var a=this.get("data")||i,s=r(),u=n(a,(function(e){
- // Can be string or number
- return(t(e)||l(e))&&(e={name:e}),s.get(e.name)?null:(s.set(e.name,!0),new yr(e,this,this.ecModel))}),this);
- /**
- * @type {Array.<module:echarts/model/Model>}
- * @private
- */
- this._data=st(u,(function(t){return!!t}))},o.prototype.getData=function(){return this._data},o.prototype.select=function(t){var e=this.option.selected;if("single"===this.get("selectedMode")){var n=this._data;a(n,(function(t){e[t.get("name")]=!1}))}e[t]=!0},o.prototype.unSelect=function(t){"single"!==this.get("selectedMode")&&(this.option.selected[t]=!1)},o.prototype.toggleSelected=function(t){var e=this.option.selected;
- // Default is true
- e.hasOwnProperty(t)||(e[t]=!0),this[e[t]?"unSelect":"select"](t)},o.prototype.allSelect=function(){var t=this._data,e=this.option.selected;a(t,(function(t){e[t.get("name",!0)]=!0}))},o.prototype.inverseSelect=function(){var t=this._data,e=this.option.selected;a(t,(function(t){var n=t.get("name",!0);
- // Initially, default value is true
- e.hasOwnProperty(n)||(e[n]=!0),e[n]=!e[n]}))},o.prototype.isSelected=function(t){var e=this.option.selected;return!(e.hasOwnProperty(t)&&!e[t])&&c(this._availableNames,t)>=0},o.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},o.type="legend.plain",o.dependencies=["series"],o.defaultOption={
- // zlevel: 0,
- z:4,show:!0,orient:"horizontal",left:"center",
- // right: 'center',
- top:0,
- // bottom: null,
- align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},o}(Ta);const ON=NN;var RN=rt,EN=a,VN=Z,zN=/** @class */function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=n.type,t.newlineDisabled=!1,t}return Ue(n,e),n.prototype.init=function(){this.group.add(this._contentGroup=new VN),this.group.add(this._selectorGroup=new VN),this._isFirstRender=!0},
- /**
- * @protected
- */
- n.prototype.getContentGroup=function(){return this._contentGroup},
- /**
- * @protected
- */
- n.prototype.getSelectorGroup=function(){return this._selectorGroup},
- /**
- * @override
- */
- n.prototype.render=function(t,e,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var o=t.get("align"),r=t.get("orient");o&&"auto"!==o||(o="right"===t.get("left")&&"vertical"===r?"right":"left");
- // selector has been normalized to an array in model
- var a=t.get("selector",!0),s=t.get("selectorPosition",!0);!a||s&&"auto"!==s||(s="horizontal"===r?"end":"start"),this.renderInner(o,t,e,n,a,r,s);
- // Perform layout.
- var l=t.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},c=t.get("padding"),d=xa(l,u,c),h=this.layoutInner(t,o,d,i,a,s),p=xa(I({width:h.width,height:h.height},l),u,c);this.group.x=p.x-h.x,this.group.y=p.y-h.y,this.group.markRedraw(),
- // Render background after group is layout.
- this.group.add(this._backgroundEl=KL(h,t))}},n.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},n.prototype.renderInner=function(t,e,n,i,o,a,s){var l=this.getContentGroup(),u=r(),c=e.get("selectedMode"),d=[];n.eachRawSeries((function(t){!t.get("legendHoverLink")&&d.push(t.id)})),EN(e.getData(),(function(o,r){var a=o.get("name");
- // Use empty string or \n as a newline string
- if(!this.newlineDisabled&&(""===a||"\n"===a)){var s=new VN;
- // @ts-ignore
- return s.newline=!0,void l.add(s)}
- // Representitive series.
- var h=n.getSeriesByName(a)[0];if(!u.get(a))
- // Legend to control series.
- if(h){var f=h.getData(),g=f.getVisual("legendLineStyle")||{},y=f.getVisual("legendIcon"),m=f.getVisual("style"),v=this._createItem(h,a,r,o,e,t,g,m,y,c,i);v.on("click",RN(BN,a,null,i,d)).on("mouseover",RN(FN,h.name,null,i,d)).on("mouseout",RN(WN,h.name,null,i,d)),n.ssr&&v.eachChild((function(t){var e=ni(t);e.seriesIndex=h.seriesIndex,e.dataIndex=r,e.ssrType="legend"})),u.set(a,!0)}else
- // Legend to control data. In pie and funnel.
- n.eachRawSeries((function(s){
- // In case multiple series has same data name
- if(!u.get(a)&&s.legendVisualProvider){var l=s.legendVisualProvider;if(!l.containName(a))return;var h=l.indexOfName(a),f=l.getItemVisual(h,"style"),g=l.getItemVisual(h,"legendIcon"),y=le(f.fill);
- // Color may be set to transparent in visualMap when data is out of range.
- // Do not show nothing.
- y&&0===y[3]&&(y[3]=.2,
- // TODO color is set to 0, 0, 0, 0. Should show correct RGBA
- f=p(p({},f),{fill:se(y,"rgba")}));var m=this._createItem(s,a,r,o,e,t,{},f,g,c,i);
- // FIXME: consider different series has items with the same name.
- m.on("click",RN(BN,null,a,i,d)).on("mouseover",RN(FN,null,a,i,d)).on("mouseout",RN(WN,null,a,i,d)),n.ssr&&m.eachChild((function(t){var e=ni(t);e.seriesIndex=s.seriesIndex,e.dataIndex=r,e.ssrType="legend"})),u.set(a,!0)}}),this)}),this),o&&this._createSelector(o,e,i,a,s)},n.prototype._createSelector=function(t,e,n,i,o){var r=this.getSelectorGroup();EN(t,(function(t){var i=t.type,o=new $({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect",legendId:e.id})}});r.add(o),Yo(o,{normal:e.getModel("selectorLabel"),emphasis:e.getModel(["emphasis","selectorLabel"])},{defaultText:t.title}),Yi(o)}))},n.prototype._createItem=function(e,n,i,o,r,a,s,l,u,c,d){var h=e.visualDrawType,p=r.get("itemWidth"),g=r.get("itemHeight"),y=r.isSelected(n),m=o.get("symbolRotate"),v=o.get("symbolKeepAspect"),x=o.get("icon"),_=function(t,e,n,i,o,r,a){
- /**
- * Use series style if is inherit;
- * elsewise, use legend style
- */
- function s(t,e){
- // If lineStyle.width is 'auto', it is set to be 2 if series has border
- "auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),EN(t,(function(n,i){"inherit"===t[i]&&(t[i]=e[i])}))}
- // itemStyle
- var l=e.getModel("itemStyle"),u=l.getItemStyle(),c=0===t.lastIndexOf("empty",0)?"fill":"stroke",d=l.getShallow("decal");u.decal=d&&"inherit"!==d?Zc(d,a):i.decal,"inherit"===u.fill&&(
- /**
- * Series with visualDrawType as 'stroke' should have
- * series stroke as legend fill
- */
- u.fill=i[o]);"inherit"===u.stroke&&(
- /**
- * icon type with "emptyXXX" should use fill color
- * in visual style
- */
- u.stroke=i[c]);"inherit"===u.opacity&&(
- /**
- * Use lineStyle.opacity if drawType is stroke
- */
- u.opacity=("fill"===o?i:n).opacity);s(u,i);
- // lineStyle
- var h=e.getModel("lineStyle"),p=h.getLineStyle();if(s(p,n),
- // Fix auto color to real color
- "auto"===u.fill&&(u.fill=i.fill),"auto"===u.stroke&&(u.stroke=i.fill),"auto"===p.stroke&&(p.stroke=i.fill),!r){var f=e.get("inactiveBorderWidth"),g=u[c];
- /**
- * Since stroke is set to be inactiveBorderColor, it may occur that
- * there is no border in series but border in legend, so we need to
- * use border only when series has border if is set to be auto
- */u.lineWidth="auto"===f?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),p.stroke=h.get("inactiveColor"),p.lineWidth=h.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}(u=x||u||"roundRect",o,s,l,h,y,d),b=new VN,S=o.getModel("textStyle");if(!f(e.getLegendIcon)||x&&"inherit"!==x){
- // Use default legend icon policy for most series
- var w="inherit"===x&&e.getData().getVisual("symbol")?"inherit"===m?e.getData().getVisual("symbolRotate"):m:0;// No rotation for no icon
- b.add(function(t){var e=t.icon||"roundRect",n=Gc(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);n.setStyle(t.itemStyle),n.rotation=(t.iconRotate||0)*Math.PI/180,n.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2);return n}({itemWidth:p,itemHeight:g,icon:u,iconRotate:w,itemStyle:_.itemStyle,lineStyle:_.lineStyle,symbolKeepAspect:v}))}else
- // Series has specific way to define legend icon
- b.add(e.getLegendIcon({itemWidth:p,itemHeight:g,icon:u,iconRotate:m,itemStyle:_.itemStyle,lineStyle:_.lineStyle,symbolKeepAspect:v}));var M="left"===a?p+5:-5,I=a,D=r.get("formatter"),T=n;t(D)&&D?T=D.replace("{name}",null!=n?n:""):f(D)&&(T=D(n));var C=y?S.getTextColor():o.get("inactiveColor");b.add(new $({style:Zo(S,{text:T,x:M,y:g/2,fill:C,align:I,verticalAlign:"middle"},{inheritColor:C})}));
- // Add a invisible rect to increase the area of mouse hover
- var A=new G({shape:b.getBoundingRect(),style:{
- // Cannot use 'invisible' because SVG SSR will miss the node
- fill:"transparent"}}),L=o.getModel("tooltip");return L.get("show")&&Vo({el:A,componentModel:r,itemName:n,itemTooltipOption:L.option}),b.add(A),b.eachChild((function(t){t.silent=!0})),A.silent=!c,this.getContentGroup().add(b),Yi(b),
- // @ts-ignore
- b.__legendDataIndex=i,b},n.prototype.layoutInner=function(t,e,n,i,o,r){var a=this.getContentGroup(),s=this.getSelectorGroup();
- // Place items in contentGroup.
- va(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),o){
- // Place buttons in selectorGroup
- va(
- // Buttons in selectorGroup always layout horizontally
- "horizontal",s,t.get("selectorItemGap",!0));var c=s.getBoundingRect(),d=[-c.x,-c.y],h=t.get("selectorButtonGap",!0),p=t.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",y=0===p?"y":"x";"end"===r?d[p]+=l[f]+h:u[p]+=c[f]+h,
- // Always align selector to content as 'middle'
- d[1-p]+=l[g]/2-c[g]/2,s.x=d[0],s.y=d[1],a.x=u[0],a.y=u[1];var m={x:0,y:0};return m[f]=l[f]+h+c[f],m[g]=Math.max(l[g],c[g]),m[y]=Math.min(0,c[y]+d[1-p]),m}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},
- /**
- * @protected
- */
- n.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},n.type="legend.plain",n}(Mu);function BN(t,e,n,i){
- // downplay before unselect
- WN(t,e,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),
- // highlight after select
- // TODO highlight immediately may cause animation loss.
- FN(t,e,n,i)}function GN(t){for(var e,n=t.getZr().storage.getDisplayList(),i=0,o=n.length;i<o&&!(e=n[i].states.emphasis);)i++;return e&&e.hoverLayer}function FN(t,e,n,i){
- // If element hover will move to a hoverLayer.
- GN(n)||n.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:i})}function WN(t,e,n,i){
- // If element hover will move to a hoverLayer.
- GN(n)||n.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:i})}const HN=zN;
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */function YN(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries((function(t){
- // If in any legend component the status is not selected.
- // Because in legend series is assumed selected when it is not in the legend data.
- for(var n=0;n<e.length;n++)if(!e[n].isSelected(t.name))return!1;return!0}))}function UN(t,e,n){var i="allSelect"===t||"inverseSelect"===t,o={},r=[];n.eachComponent({mainType:"legend",query:e},(function(n){i?n[t]():n[t](e.name),ZN(n,o),r.push(n.componentIndex)}));var s={};
- // make selectedMap from all legend components
- // Return the event explicitly
- return n.eachComponent("legend",(function(t){a(o,(function(e,n){
- // Force other legend has same selected status
- // Or the first is toggled to true and other are toggled to false
- // In the case one legend has some item unSelected in option. And if other legend
- // doesn't has the item, they will assume it is selected.
- t[e?"select":"unSelect"](n)})),ZN(t,s)})),i?{selected:s,
- // return legendIndex array to tell the developers which legends are allSelect / inverseSelect
- legendIndex:r}:{name:e.name,selected:s}}function ZN(t,e){var n=e||{};return a(t.getData(),(function(e){var i=e.get("name");
- // Wrap element
- if("\n"!==i&&""!==i){var o=t.isSelected(i);N(n,i)?
- // Unselected if any legend is unselected
- n[i]=n[i]&&o:n[i]=o}})),n}function XN(t){t.registerComponentModel(ON),t.registerComponentView(HN),t.registerProcessor(t.PRIORITY.PROCESSOR.SERIES_FILTER,YN),t.registerSubTypeDefaulter("legend",(function(){return"plain"})),function(t){
- /**
- * @event legendToggleSelect
- * @type {Object}
- * @property {string} type 'legendToggleSelect'
- * @property {string} [from]
- * @property {string} name Series name or data item name
- */
- t.registerAction("legendToggleSelect","legendselectchanged",rt(UN,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",rt(UN,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",rt(UN,"inverseSelect")),
- /**
- * @event legendSelect
- * @type {Object}
- * @property {string} type 'legendSelect'
- * @property {string} name Series name or data item name
- */
- t.registerAction("legendSelect","legendselected",rt(UN,"select")),
- /**
- * @event legendUnSelect
- * @type {Object}
- * @property {string} type 'legendUnSelect'
- * @property {string} name Series name or data item name
- */
- t.registerAction("legendUnSelect","legendunselected",rt(UN,"unSelect"))}(t)}
- // Do not `ignoreSize` to enable setting {left: 10, right: 10}.
- function jN(t,e,n){var i=[1,1];i[t.getOrient().index]=0,Sa(e,n,{type:"box",ignoreSize:!!i})}const qN=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}
- /**
- * @param {number} scrollDataIndex
- */return Ue(e,t),e.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},e.prototype.init=function(e,n,i){var o=wa(e);t.prototype.init.call(this,e,n,i),jN(this,e,o)},
- /**
- * @override
- */
- e.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),jN(this,this.option,e)},e.type="legend.scroll",e.defaultOption=xr(ON.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}),e}(ON);var KN=Z,JN=["width","height"],$N=["x","y"],QN=/** @class */function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=n.type,t.newlineDisabled=!0,t._currentIndex=0,t}return Ue(n,e),n.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new KN),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new KN)},
- /**
- * @override
- */
- n.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},
- /**
- * @override
- */
- n.prototype.renderInner=function(t,n,o,r,a,s,l){var u=this;
- // Render content items.
- e.prototype.renderInner.call(this,t,n,o,r,a,s,l);var c=this._controllerGroup,d=n.get("pageIconSize",!0),h=i(d)?d:[d,d];
- // FIXME: support be 'auto' adapt to size number text length,
- // e.g., '3/12345' should not overlap with the control arrow button.
- f("pagePrev",0);var p=n.getModel("pageTextStyle");function f(t,e){var i=t+"DataIndex",o=No(n.get("pageIcons",!0)[n.getOrient().name][e],{
- // Buttons will be created in each render, so we do not need
- // to worry about avoiding using legendModel kept in scope.
- onclick:lt(u._pageGo,u,i,n,r)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});o.name=t,c.add(o)}c.add(new $({name:"pageText",style:{
- // Placeholder to calculate a proper layout.
- text:"xx/xx",fill:p.getTextColor(),font:p.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),f("pageNext",1)},
- /**
- * @override
- */
- n.prototype.layoutInner=function(t,e,n,i,o,r){var a=this.getSelectorGroup(),s=t.getOrient().index,l=JN[s],u=$N[s],c=JN[1-s],d=$N[1-s];o&&va(
- // Buttons in selectorGroup always layout horizontally
- "horizontal",a,t.get("selectorItemGap",!0));var h=t.get("selectorButtonGap",!0),p=a.getBoundingRect(),f=[-p.x,-p.y],g=et(n);o&&(g[l]=n[l]-p[l]-h);var y=this._layoutContentAndController(t,i,g,s,l,c,d,u);if(o){if("end"===r)f[s]+=y[l]+h;else{var m=p[l]+h;f[s]-=m,y[u]-=m}y[l]+=p[l]+h,f[1-s]+=y[d]+y[c]/2-p[c]/2,y[c]=Math.max(y[c],p[c]),y[d]=Math.min(y[d],p[d]+f[1-s]),a.x=f[0],a.y=f[1],a.markRedraw()}return y},n.prototype._layoutContentAndController=function(t,e,n,i,o,r,a,s){var l=this.getContentGroup(),u=this._containerGroup,c=this._controllerGroup;
- // Place items in contentGroup.
- va(t.get("orient"),l,t.get("itemGap"),i?n.width:null,i?null:n.height),va(
- // Buttons in controller are layout always horizontally.
- "horizontal",c,t.get("pageButtonItemGap",!0));var d=l.getBoundingRect(),h=c.getBoundingRect(),p=this._showController=d[o]>n[o],f=[-d.x,-d.y];
- // Remain contentPos when scroll animation perfroming.
- // If first rendering, `contentGroup.position` is [0, 0], which
- // does not make sense and may cause unexepcted animation if adopted.
- e||(f[i]=l[s]);
- // Layout container group based on 0.
- var g=[0,0],y=[-h.x,-h.y],m=x(t.get("pageButtonGap",!0),t.get("itemGap",!0));
- // Place containerGroup and controllerGroup and contentGroup.
- p&&(
- // controller is on the right / bottom.
- "end"===t.get("pageButtonPosition",!0)?y[i]+=n[o]-h[o]:g[i]+=h[o]+m);
- // Always align controller to content as 'middle'.
- y[1-i]+=d[r]/2-h[r]/2,l.setPosition(f),u.setPosition(g),c.setPosition(y);
- // Calculate `mainRect` and set `clipPath`.
- // mainRect should not be calculated by `this.group.getBoundingRect()`
- // for sake of the overflow.
- var v={x:0,y:0};
- // Consider content may be overflow (should be clipped).
- if(v[o]=p?n[o]:d[o],v[r]=Math.max(d[r],h[r]),
- // `containerRect[yx] + containerPos[1 - orientIdx]` is 0.
- v[a]=Math.min(0,h[a]+y[1-i]),u.__rectSize=n[o],p){var _={x:0,y:0};_[o]=Math.max(n[o]-h[o]-m,0),_[r]=v[r],u.setClipPath(new G({shape:_})),
- // Consider content may be larger than container, container rect
- // can not be obtained from `containerGroup.getBoundingRect()`.
- u.__rectSize=_[o]}else
- // Do not remove or ignore controller. Keep them set as placeholders.
- c.eachChild((function(t){t.attr({invisible:!0,silent:!0})}));
- // Content translate animation.
- var b=this._getPageInfo(t);return null!=b.pageIndex&&io(l,{x:b.contentPosition[0],y:b.contentPosition[1]},
- // When switch from "show controller" to "not show controller", view should be
- // updated immediately without animation, otherwise causes weird effect.
- p?t:null),this._updatePageInfoView(t,b),v},n.prototype._pageGo=function(t,e,n){var i=this._getPageInfo(e)[t];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:e.id})},n.prototype._updatePageInfoView=function(e,n){var i=this._controllerGroup;a(["pagePrev","pageNext"],(function(t){var o=null!=n[t+"DataIndex"],r=i.childOfName(t);r&&(r.setStyle("fill",o?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),r.cursor=o?"pointer":"default")}));var o=i.childOfName("pageText"),r=e.get("pageFormatter"),s=n.pageIndex,l=null!=s?s+1:0,u=n.pageCount;o&&r&&o.setStyle("text",t(r)?r.replace("{current}",null==l?"":l+"").replace("{total}",null==u?"":u+""):r({current:l,total:u}))},
- /**
- * contentPosition: Array.<number>, null when data item not found.
- * pageIndex: number, null when data item not found.
- * pageCount: number, always be a number, can be 0.
- * pagePrevDataIndex: number, null when no previous page.
- * pageNextDataIndex: number, null when no next page.
- * }
- */
- n.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,o=t.getOrient().index,r=JN[o],a=$N[o],s=this._findTargetItemIndex(e),l=n.children(),u=l[s],c=l.length,d=c?1:0,h={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return h;var p=v(u);h.contentPosition[o]=-p.s;
- // Strategy:
- // (1) Always align based on the left/top most item.
- // (2) It is user-friendly that the last item shown in the
- // current window is shown at the begining of next window.
- // Otherwise if half of the last item is cut by the window,
- // it will have no chance to display entirely.
- // (3) Consider that item size probably be different, we
- // have calculate pageIndex by size rather than item index,
- // and we can not get page index directly by division.
- // (4) The window is to narrow to contain more than
- // one item, we should make sure that the page can be fliped.
- for(var f=s+1,g=p,y=p,m=null;f<=c;++f)
- // Half of the last item is out of the window.
- (!(m=v(l[f]))&&y.e>g.s+i||m&&!x(m,g.s))&&(g=y.i>g.i?y:m)&&(null==h.pageNextDataIndex&&(h.pageNextDataIndex=g.i),++h.pageCount),y=m;for(f=s-1,g=p,y=p,m=null;f>=-1;--f)
- // If the the end item does not intersect with the window started
- // from the current item, a page can be settled.
- (m=v(l[f]))&&x(y,m.s)||!(g.i<y.i)||(y=g,null==h.pagePrevDataIndex&&(h.pagePrevDataIndex=g.i),++h.pageCount,++h.pageIndex),g=m;return h;function v(t){if(t){var e=t.getBoundingRect(),n=e[a]+t[a];return{s:n,e:n+e[r],i:t.__legendDataIndex}}}function x(t,e){return t.e>=e&&t.s<=e+i}},n.prototype._findTargetItemIndex=function(t){return this._showController?(this.getContentGroup().eachChild((function(i,o){var r=i.__legendDataIndex;
- // FIXME
- // If the given targetDataIndex (from model) is illegal,
- // we use defaultIndex. But the index on the legend model and
- // action payload is still illegal. That case will not be
- // changed until some scenario requires.
- null==n&&null!=r&&(n=o),r===t&&(e=o)})),null!=e?e:n):0;var e,n},n.type="legend.scroll",n}(HN);const tO=QN;
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */function eO(t){hh(XN),t.registerComponentModel(qN),t.registerComponentView(tO),function(t){
- /**
- * @event legendScroll
- * @type {Object}
- * @property {string} type 'legendScroll'
- * @property {string} scrollDataIndex
- */
- t.registerAction("legendScroll","legendscroll",(function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},(function(t){t.setScrollDataIndex(n)}))}))}(t)}const nO=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="dataZoom.inside",e.defaultOption=xr(NL.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(NL);var iO=On();function oO(t,e){if(e){t.removeKey(e.model.uid);var n=e.controller;n&&n.dispose()}}
- /**
- * This action will be throttled.
- */
- function rO(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function aO(t,e,n,i){return t.coordinateSystem.containPoint([n,i])}
- /**
- * Merge roamController settings when multiple dataZooms share one roamController.
- */function sO(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,(function(t,e){var n=iO(e),i=n.coordSysRecordMap||(n.coordSysRecordMap=r());i.each((function(t){
- // `coordSysRecordMap` always exists (because it holds the `roam controller`, which should
- // better not re-create each time), but clear `dataZoomInfoMap` each round of the workflow.
- t.dataZoomInfoMap=null})),t.eachComponent({mainType:"dataZoom",subType:"inside"},(function(t){var n=AL(t);a(n.infoList,(function(n){var o=n.model.uid,s=i.get(o)||i.set(o,function(t,e){
- // These init props will never change after record created.
- var n={model:e,containsPoint:rt(aO,e),dispatchAction:rt(rO,t),dataZoomInfoMap:null,controller:null},i=n.controller=new Uv(t.getZr());
- // Must not do anything depends on coordSysRecord outside the event handler here,
- // because coordSysRecord not completed yet.
- return a(["pan","zoom","scrollMove"],(function(t){i.on(t,(function(e){var i=[];n.dataZoomInfoMap.each((function(o){
- // Check whether the behaviors (zoomOnMouseWheel, moveOnMouseMove,
- // moveOnMouseWheel, ...) enabled.
- if(e.isAvailableBehavior(o.model.option)){var r=(o.getRange||{})[t],a=r&&r(o.dzReferCoordSysInfo,n.model.mainType,n.controller,e);!o.model.get("disabled",!0)&&a&&i.push({dataZoomId:o.model.id,start:a[0],end:a[1]})}})),i.length&&n.dispatchAction(i)}))})),n}(e,n.model));
- // Notice these props might be changed each time for a single dataZoomModel.
- (s.dataZoomInfoMap||(s.dataZoomInfoMap=r())).set(t.uid,{dzReferCoordSysInfo:n,model:t,getRange:null})}))})),
- // (1) Merge dataZoom settings for each coord sys and set to the roam controller.
- // (2) Clear coord sys if not refered by any dataZoom.
- i.each((function(t){var e,n=t.controller,o=t.dataZoomInfoMap;if(o){var r=o.keys()[0];null!=r&&(e=o.get(r))}if(e){var a=function(t){var e,n="type_",i={type_true:2,type_move:1,type_false:0,type_undefined:-1},o=!0;
- // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated
- // as string, it is probably revert to reserved word by compress tool. See #7411.
- return t.each((function(t){var r=t.model,a=!r.get("disabled",!0)&&(!r.get("zoomLock",!0)||"move");i[n+a]>i[n+e]&&(e=a),
- // Prevent default move event by default. If one false, do not prevent. Otherwise
- // users may be confused why it does not work when multiple insideZooms exist.
- o=o&&r.get("preventDefaultMouseMove",!0)})),{controlType:e,opt:{
- // RoamController will enable all of these functionalities,
- // and the final behavior is determined by its event listener
- // provided by each inside zoom.
- zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o}}}(o);n.enable(a.controlType,a.opt),n.setPointerChecker(t.containsPoint),Bu(t,"dispatchAction",e.model.get("throttle",!0),"fixRate")}else oO(i,t)}))}))}var lO=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataZoom.inside",e}return Ue(e,t),e.prototype.render=function(e,n,i){t.prototype.render.apply(this,arguments),e.noTarget()?this._clear():(
- // Hence the `throttle` util ensures to preserve command order,
- // here simply updating range all the time will not cause missing
- // any of the the roam change.
- this.range=e.getPercentRange(),
- // Reset controllers.
- function(t,e,n){iO(t).coordSysRecordMap.each((function(t){var i=t.dataZoomInfoMap.get(e.uid);i&&(i.getRange=n)}))}(i,e,{pan:lt(uO.pan,this),zoom:lt(uO.zoom,this),scrollMove:lt(uO.scrollMove,this)}))},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){!function(t,e){for(var n=iO(t).coordSysRecordMap,i=n.keys(),o=0;o<i.length;o++){var r=i[o],a=n.get(r),s=a.dataZoomInfoMap;if(s){var l=e.uid;s.get(l)&&(s.removeKey(l),s.keys().length||oO(n,a))}}}(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(RL),uO={zoom:function(t,e,n,i){var o=this.range,r=o.slice(),a=t.axisModels[0];if(a){var s=dO[e](null,[i.originX,i.originY],a,n,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(r[1]-r[0])+r[0],u=Math.max(1/i.scale,0);r[0]=(r[0]-l)*u+l,r[1]=(r[1]-l)*u+l;
- // Restrict range.
- var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return Sw(0,r,[0,100],0,c.minSpan,c.maxSpan),this.range=r,o[0]!==r[0]||o[1]!==r[1]?r:void 0}},pan:cO((function(t,e,n,i,o,r){var a=dO[i]([r.oldX,r.oldY],[r.newX,r.newY],e,o,n);return a.signal*(t[1]-t[0])*a.pixel/a.pixelLength})),scrollMove:cO((function(t,e,n,i,o,r){return dO[i]([0,0],[r.scrollDelta,r.scrollDelta],e,o,n).signal*(t[1]-t[0])*r.scrollDelta}))};function cO(t){return function(e,n,i,o){var r=this.range,a=r.slice(),s=e.axisModels[0];if(s)return Sw(t(a,s,e,n,i,o),a,[0,100],"all"),this.range=a,r[0]!==a[0]||r[1]!==a[1]?a:void 0}}var dO={grid:function(t,e,n,i,o){var r=n.axis,a={},s=o.model.coordinateSystem.getRect();return t=t||[0,0],"x"===r.dim?(a.pixel=e[0]-t[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=r.inverse?1:-1):(
- // axis.dim === 'y'
- a.pixel=e[1]-t[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=r.inverse?-1:1),a},polar:function(t,e,n,i,o){var r=n.axis,a={},s=o.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===n.mainType?(a.pixel=e[0]-t[0],
- // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]);
- // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]);
- a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=r.inverse?1:-1):(
- // 'angleAxis'
- a.pixel=e[1]-t[1],
- // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]);
- // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]);
- a.pixelLength=u[1]-u[0],a.pixelStart=u[0],a.signal=r.inverse?-1:1),a},singleAxis:function(t,e,n,i,o){var r=n.axis,a=o.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===r.orient?(s.pixel=e[0]-t[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=r.inverse?1:-1):(
- // 'vertical'
- s.pixel=e[1]-t[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=r.inverse?-1:1),s}};const hO=lO;function pO(t){HL(t),t.registerComponentModel(nO),t.registerComponentView(hO),sO(t)}const fO=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=xr(NL.defaultOption,{show:!0,
- // deault value can only be drived in view stage.
- right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",
- // dataBackgroundColor: '#ddd',
- dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},
- // Color of selected window.
- fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",
- // Percent of the slider height
- handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(NL);var gO=G,yO="horizontal",mO="vertical",vO=["line","bar","candlestick","scatter"],xO={easing:"cubicOut",duration:100,delay:0},_O=/** @class */function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=n.type,t._displayables={},t}return Ue(n,e),n.prototype.init=function(t,e){this.api=e,
- // A unique handler for each dataZoom component
- this._onBrush=lt(this._onBrush,this),this._onBrushEnd=lt(this._onBrushEnd,this)},n.prototype.render=function(t,n,i,o){if(e.prototype.render.apply(this,arguments),Bu(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1!==t.get("show")){if(t.noTarget())return this._clear(),void this.group.removeAll();
- // Notice: this._resetInterval() should not be executed when payload.type
- // is 'dataZoom', origin this._range should be maintained, otherwise 'pan'
- // or 'zoom' info will be missed because of 'throttle' of this.dispatchAction,
- o&&"dataZoom"===o.type&&o.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},n.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},n.prototype._clear=function(){Gu(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},n.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var e=this._displayables.sliderGroup=new Z;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},n.prototype._resetLocation=function(){var t=this.dataZoomModel,e=this.api,n=t.get("brushSelect")?7:0,i=this._findCoordRect(),o={width:e.getWidth(),height:e.getHeight()},r=this._orient===yO?{
- // Why using 'right', because right should be used in vertical,
- // and it is better to be consistent for dealing with position param merge.
- right:o.width-i.x-i.width,top:o.height-30-7-n,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},s=wa(t.option);
- // Replace the placeholder value.
- a(["right","top","width","height"],(function(t){"ph"===s[t]&&(s[t]=r[t])}));var l=xa(s,o);this._location={x:l.x,y:l.y},this._size=[l.width,l.height],this._orient===mO&&this._size.reverse()},n.prototype._positionGroup=function(){var t=this.group,e=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),o=i&&i.get("inverse"),r=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;
- // Transform barGroup.
- r.attr(n!==yO||o?n===yO&&o?{scaleY:a?1:-1,scaleX:-1}:n!==mO||o?{scaleY:a?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:a?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:a?1:-1,scaleX:1});
- // Position barGroup
- var s=t.getBoundingRect([r]);t.x=e.x-s.x,t.y=e.y-s.y,t.markRedraw()},n.prototype._getViewExtent=function(){return[0,this._size[0]]},n.prototype._renderBackground=function(){var t=this.dataZoomModel,e=this._size,n=this._displayables.sliderGroup,i=t.get("brushSelect");n.add(new gO({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40}));
- // Click panel, over shadow, below handles.
- var o=new gO({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:lt(this._onClickPanel,this)}),r=this.api.getZr();i?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",r.on("mousemove",this._onBrush),r.on("mouseup",this._onBrushEnd)):(r.off("mousemove",this._onBrush),r.off("mouseup",this._onBrushEnd)),n.add(o)},n.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],t){var e=this._size,n=this._shadowSize||[],i=t.series,o=i.getRawData(),r=i.getShadowDim&&i.getShadowDim(),a=r&&o.getDimensionInfo(r)?i.getShadowDim():t.otherDim;if(null!=a){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;
- // Not re-render if data doesn't change.
- if(o!==this._shadowData||a!==this._shadowDim||e[0]!==n[0]||e[1]!==n[1]){var u=o.getDataExtent(a),c=.3*(u[1]-u[0]);
- // Nice extent.
- u=[u[0]-c,u[1]+c];var d,h=[0,e[1]],p=[0,e[0]],f=[[e[0],0],[0,0]],g=[],y=p[1]/(o.count()-1),m=0,v=Math.round(o.count()/e[0]);o.each([a],(function(t,e){if(v>0&&e%v)m+=y;else{
- // FIXME
- // Should consider axis.min/axis.max when drawing dataShadow.
- // FIXME
- // 应该使用统一的空判断?还是在list里进行空判断?
- var n=null==t||isNaN(t)||""===t,i=n?0:Xe(t,u,h,!0);
- // See #4235.
- // Attempt to draw data shadow precisely when there are empty value.
- n&&!d&&e?(f.push([f[f.length-1][0],0]),g.push([g[g.length-1][0],0])):!n&&d&&(f.push([m,0]),g.push([m,0])),f.push([m,i]),g.push([m,i]),m+=y,d=n}})),s=this._shadowPolygonPts=f,l=this._shadowPolylinePts=g}this._shadowData=o,this._shadowDim=a,this._shadowSize=[e[0],e[1]];
- // let dataBackgroundModel = dataZoomModel.getModel('dataBackground');
- for(var x=this.dataZoomModel,_=0;_<3;_++){var b=S(1===_);this._displayables.sliderGroup.add(b),this._displayables.dataShadowSegs.push(b)}}}function S(t){var e=x.getModel(t?"selectedDataBackground":"dataBackground"),n=new Z,i=new z({shape:{points:s},segmentIgnoreThreshold:1,style:e.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),o=new B({shape:{points:l},segmentIgnoreThreshold:1,style:e.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(i),n.add(o),n}},n.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){
- // Find a representative series.
- var n,i=this.ecModel;return t.eachTargetAxis((function(o,r){var s=t.getAxisProxy(o,r).getTargetSeriesModels();a(s,(function(t){if(!(n||!0!==e&&c(vO,t.get("type"))<0)){var a,s=i.getComponent(TL(o),r).axis,l=function(t){
- // FIXME
- // 这个逻辑和getOtherAxis里一致,但是写在这里是否不好
- var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}(o),u=t.coordinateSystem;null!=l&&u.getOtherAxis&&(a=u.getOtherAxis(s).inverse),l=t.getData().mapDimension(l),n={thisAxis:s,series:t,thisDim:o,otherDim:l,otherAxisInverse:a}}}),this)}),this),n}},n.prototype._renderHandle=function(){var t=this.group,e=this._displayables,n=e.handles=[null,null],i=e.handleLabels=[null,null],o=this._displayables.sliderGroup,r=this._size,s=this.dataZoomModel,l=this.api,u=s.get("borderRadius")||0,c=s.get("brushSelect"),d=e.filler=new gO({silent:c,style:{fill:s.get("fillerColor")},textConfig:{position:"inside"}});o.add(d),
- // Frame border.
- o.add(new gO({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:r[0],height:r[1],r:u},style:{
- // deprecated option
- stroke:s.get("dataBackgroundColor")||s.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),
- // Left and right handle to resize
- a([0,1],(function(e){var r=s.get("handleIcon");!Vc[r]&&r.indexOf("path://")<0&&r.indexOf("image://")<0&&(
- // Compatitable with the old icon parsers. Which can use a path string without path://
- r="path://"+r);var a=Gc(r,-1,0,2,2,null,!0);a.attr({cursor:bO(this._orient),draggable:!0,drift:lt(this._onDragMove,this,e),ondragend:lt(this._onDragEnd,this),onmouseover:lt(this._showDataInfo,this,!0),onmouseout:lt(this._showDataInfo,this,!1),z2:5});var l=a.getBoundingRect(),u=s.get("handleSize");this._handleHeight=je(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,a.setStyle(s.getModel("handleStyle").getItemStyle()),a.style.strokeNoScale=!0,a.rectHover=!0,a.ensureState("emphasis").style=s.getModel(["emphasis","handleStyle"]).getItemStyle(),Yi(a);var c=s.get("handleColor");// deprecated option
- // Compatitable with previous version
- null!=c&&(a.style.fill=c),o.add(n[e]=a);var d=s.getModel("textStyle"),h=(s.get("handleLabel")||{}).show||!1;t.add(i[e]=new $({silent:!0,invisible:!h,style:Zo(d,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:d.getTextColor(),font:d.getFont()}),z2:10}))}),this);
- // Handle to move. Only visible when brushSelect is set true.
- var h=d;if(c){var p=je(s.get("moveHandleSize"),r[1]),f=e.moveHandle=new G({style:s.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:r[1]-.5,height:p}}),g=.8*p,y=e.moveHandleIcon=Gc(s.get("moveHandleIcon"),-g/2,-g/2,g,g,"#fff",!0);y.silent=!0,y.y=r[1]+p/2-.5,f.ensureState("emphasis").style=s.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(r[1]/2,Math.max(p,10));(h=e.moveZone=new G({invisible:!0,shape:{y:r[1]-m,height:p+m}})).on("mouseover",(function(){l.enterEmphasis(f)})).on("mouseout",(function(){l.leaveEmphasis(f)})),o.add(f),o.add(y),o.add(h)}h.attr({draggable:!0,cursor:bO(this._orient),drift:lt(this._onDragMove,this,"all"),ondragstart:lt(this._showDataInfo,this,!0),ondragend:lt(this._onDragEnd,this),onmouseover:lt(this._showDataInfo,this,!0),onmouseout:lt(this._showDataInfo,this,!1)})},n.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[Xe(t[0],[0,100],e,!0),Xe(t[1],[0,100],e,!0)]},n.prototype._updateInterval=function(t,e){var n=this.dataZoomModel,i=this._handleEnds,o=this._getViewExtent(),r=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];Sw(e,i,o,n.get("zoomLock")?"all":t,null!=r.minSpan?Xe(r.minSpan,a,o,!0):null,null!=r.maxSpan?Xe(r.maxSpan,a,o,!0):null);var s=this._range,l=this._range=Ke([Xe(i[0],o,a,!0),Xe(i[1],o,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},n.prototype._updateView=function(t){var e=this._displayables,n=this._handleEnds,i=Ke(n.slice()),o=this._size;a([0,1],(function(t){
- // Handles
- var i=e.handles[t],r=this._handleHeight;i.attr({scaleX:r/2,scaleY:r/2,
- // This is a trick, by adding an extra tiny offset to let the default handle's end point align to the drag window.
- // NOTE: It may affect some custom shapes a bit. But we prefer to have better result by default.
- x:n[t]+(t?-1:1),y:o[1]/2-r/2})}),this),
- // Filler
- e.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:o[1]});var r={x:i[0],width:i[1]-i[0]};
- // Move handle
- e.moveHandle&&(e.moveHandle.setShape(r),e.moveZone.setShape(r),
- // Force update path on the invisible object
- e.moveZone.getBoundingRect(),e.moveHandleIcon&&e.moveHandleIcon.attr("x",r.x+r.width/2));
- // update clip path of shadow.
- for(var s=e.dataShadowSegs,l=[0,i[0],i[1],o[0]],u=0;u<s.length;u++){var c=s[u],d=c.getClipPath();d||(d=new G,c.setClipPath(d)),d.setShape({x:l[u],y:0,width:l[u+1]-l[u],height:o[1]})}this._updateDataInfo(t)},n.prototype._updateDataInfo=function(t){var e=this.dataZoomModel,n=this._displayables,i=n.handleLabels,o=this._orient,r=["",""];
- // FIXME
- // date型,支持formatter,autoformatter(ec2 date.getAutoFormatter)
- if(e.get("showDetail")){var a=e.findRepresentativeAxisProxy();if(a){var s=a.getAxisModel().axis,l=this._range,u=t?a.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:a.getDataValueWindow();r=[this._formatLabel(u[0],s),this._formatLabel(u[1],s)]}}var c=Ke(this._handleEnds.slice());function d(t){
- // Label
- // Text should not transform by barGroup.
- // Ignore handlers transform
- var e=Do(n.handles[t].parent,this.group),a=Co(0===t?"right":"left",e),s=this._handleWidth/2+5,l=To([c[t]+(0===t?-s:s),this._size[1]/2],e);i[t].setStyle({x:l[0],y:l[1],verticalAlign:o===yO?"middle":a,align:o===yO?a:"center",text:r[t]})}d.call(this,0),d.call(this,1)},n.prototype._formatLabel=function(e,n){var i=this.dataZoomModel,o=i.get("labelFormatter"),r=i.get("labelPrecision");null!=r&&"auto"!==r||(r=n.getPixelPrecision());var a=null==e||isNaN(e)?"":"category"===n.type||"time"===n.type?n.scale.getLabel({value:Math.round(e)}):e.toFixed(Math.min(r,20));return f(o)?o(e,a):t(o)?o.replace("{value}",a):a},
- /**
- * @param isEmphasis true: show, false: hide
- */
- n.prototype._showDataInfo=function(t){var e=(this.dataZoomModel.get("handleLabel")||{}).show||!1,n=this.dataZoomModel.getModel(["emphasis","handleLabel"]).get("show")||!1,i=t||this._dragging?n:e,o=this._displayables,r=o.handleLabels;r[0].attr("invisible",!i),r[1].attr("invisible",!i),
- // Highlight move handle
- o.moveHandle&&this.api[i?"enterEmphasis":"leaveEmphasis"](o.moveHandle,1)},n.prototype._onDragMove=function(t,e,n,i){this._dragging=!0,
- // For mobile device, prevent screen slider on the button.
- jt(i.event);
- // Transform dx, dy to bar coordination.
- var o=To([e,n],this._displayables.sliderGroup.getLocalTransform(),!0),r=this._updateInterval(t,o[0]),a=this.dataZoomModel.get("realtime");this._updateView(!a),
- // Avoid dispatch dataZoom repeatly but range not changed,
- // which cause bad visual effect when progressive enabled.
- r&&a&&this._dispatchZoomAction(!0)},n.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction(!1)},n.prototype._onClickPanel=function(t){var e=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(n[0]<0||n[0]>e[0]||n[1]<0||n[1]>e[1])){var i=this._handleEnds,o=(i[0]+i[1])/2,r=this._updateInterval("all",n[0]-o);this._updateView(),r&&this._dispatchZoomAction(!1)}},n.prototype._onBrushStart=function(t){var e=t.offsetX,n=t.offsetY;this._brushStart=new K(e,n),this._brushing=!0,this._brushStartTime=+new Date},n.prototype._onBrushEnd=function(t){if(this._brushing){var e=this._displayables.brushRect;if(this._brushing=!1,e){e.attr("ignore",!0);var n=e.shape;
- // console.log(brushEndTime - this._brushStartTime);
- if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var i=this._getViewExtent(),o=[0,100];this._range=Ke([Xe(n.x,i,o,!0),Xe(n.x+n.width,i,o,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},n.prototype._onBrush=function(t){this._brushing&&(
- // For mobile device, prevent screen slider on the button.
- jt(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},n.prototype._updateBrushRect=function(t,e){var n=this._displayables,i=this.dataZoomModel,o=n.brushRect;o||(o=n.brushRect=new gO({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(o)),o.attr("ignore",!1);var r=this._brushStart,a=this._displayables.sliderGroup,s=a.transformCoordToLocal(t,e),l=a.transformCoordToLocal(r.x,r.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),o.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},
- /**
- * This action will be throttled.
- */
- n.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?xO:null,start:e[0],end:e[1]})},n.prototype._findCoordRect=function(){
- // Find the grid corresponding to the first axis referred by dataZoom.
- var t,e=AL(this.dataZoomModel).infoList;if(!t&&e.length){var n=e[0].model.coordinateSystem;t=n.getRect&&n.getRect()}if(!t){var i=this.api.getWidth(),o=this.api.getHeight();t={x:.2*i,y:.2*o,width:.6*i,height:.6*o}}return t},n.type="dataZoom.slider",n}(RL);
- // Constants
- function bO(t){return"vertical"===t?"ns-resize":"ew-resize"}const SO=_O;function wO(t){t.registerComponentModel(fO),t.registerComponentView(SO),HL(t)}var MO={
- /**
- * @public
- */
- get:function(t,e,n){var o=et((IO[t]||{})[e]);return n&&i(o)?o[o.length-1]:o}},IO={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]}};const DO=MO;var TO=mb.mapVisual,CO=mb.eachVisual,AO=i,LO=a,kO=Ke,PO=Xe,NO=/** @class */function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=n.type,t.stateList=["inRange","outOfRange"],t.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],t.layoutMode={type:"box",ignoreSize:!0},
- /**
- * [lowerBound, upperBound]
- */
- t.dataBound=[-Infinity,Infinity],t.targetVisuals={},t.controllerVisuals={},t}return Ue(n,e),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},
- /**
- * @protected
- */
- n.prototype.optionUpdated=function(t,e){var n=this.option;!e&&fP(n,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},
- /**
- * @protected
- */
- n.prototype.resetVisual=function(t){var e=this.stateList;t=lt(t,this),this.controllerVisuals=pP(this.option.controller,e,t),this.targetVisuals=pP(this.option.target,e,t)},
- /**
- * @public
- */
- n.prototype.getItemSymbol=function(){return null},
- /**
- * @protected
- * @return {Array.<number>} An array of series indices.
- */
- n.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,e=[];return null==t||"all"===t?this.ecModel.eachSeries((function(t,n){e.push(n)})):e=Sn(t),e},
- /**
- * @public
- */
- n.prototype.eachTargetSeries=function(t,e){a(this.getTargetSeriesIndices(),(function(n){var i=this.ecModel.getSeriesByIndex(n);i&&t.call(e,i)}),this)},
- /**
- * @pubilc
- */
- n.prototype.isTargetSeries=function(t){var e=!1;return this.eachTargetSeries((function(n){n===t&&(e=!0)})),e},
- /**
- * @example
- * this.formatValueText(someVal); // format single numeric value to text.
- * this.formatValueText(someVal, true); // format single category value to text.
- * this.formatValueText([min, max]); // format numeric min-max to text.
- * this.formatValueText([this.dataBound[0], max]); // using data lower bound.
- * this.formatValueText([min, this.dataBound[1]]); // using data upper bound.
- *
- * @param value Real value, or this.dataBound[0 or 1].
- * @param isCategory Only available when value is number.
- * @param edgeSymbols Open-close symbol when value is interval.
- * @protected
- */
- n.prototype.formatValueText=function(e,n,o){var r,a=this.option,s=a.precision,l=this.dataBound,u=a.formatter;o=o||["<",">"],i(e)&&(e=e.slice(),r=!0);var c=n?e:r?[d(e[0]),d(e[1])]:d(e);return t(u)?u.replace("{value}",r?c[0]:c).replace("{value2}",r?c[1]:c):f(u)?r?u(e[0],e[1]):u(e):r?e[0]===l[0]?o[0]+" "+c[1]:e[1]===l[1]?o[1]+" "+c[0]:c[0]+" - "+c[1]:c;function d(t){return t===l[0]?"min":t===l[1]?"max":(+t).toFixed(Math.min(s,20))}},
- /**
- * @protected
- */
- n.prototype.resetExtent=function(){var t=this.option,e=kO([t.min,t.max]);
- // Can not calculate data extent by data here.
- // Because series and data may be modified in processing stage.
- // So we do not support the feature "auto min/max".
- this._dataExtent=e},
- /**
- * PENDING:
- * delete this method if no outer usage.
- *
- * Return Concrete dimension. If null/undefined is returned, no dimension is used.
- */
- // getDataDimension(data: SeriesData) {
- // const optDim = this.option.dimension;
- // if (optDim != null) {
- // return data.getDimension(optDim);
- // }
- // const dimNames = data.dimensions;
- // for (let i = dimNames.length - 1; i >= 0; i--) {
- // const dimName = dimNames[i];
- // const dimInfo = data.getDimensionInfo(dimName);
- // if (!dimInfo.isCalculationCoord) {
- // return dimName;
- // }
- // }
- // }
- n.prototype.getDataDimensionIndex=function(t){var e=this.option.dimension;if(null!=e)return t.getDimensionIndex(e);for(var n=t.dimensions,i=n.length-1;i>=0;i--){var o=n[i],r=t.getDimensionInfo(o);if(!r.isCalculationCoord)return r.storeDimIndex}},n.prototype.getExtent=function(){return this._dataExtent.slice()},n.prototype.completeVisualOption=function(){var t=this.ecModel,e=this.option,n={inRange:e.inRange,outOfRange:e.outOfRange},i=e.target||(e.target={}),o=e.controller||(e.controller={});tt(i,n),// Do not override
- tt(o,n);// Do not override
- var r=this.isCategory();function a(n){
- // Compatible with ec2 dataRange.color.
- // The mapping order of dataRange.color is: [high value, ..., low value]
- // whereas inRange.color and outOfRange.color is [low value, ..., high value]
- // Notice: ec2 has no inverse.
- AO(e.color)&&!n.inRange&&(n.inRange={color:e.color.slice().reverse()}),
- // Compatible with previous logic, always give a default color, otherwise
- // simple config with no inRange and outOfRange will not work.
- // Originally we use visualMap.color as the default color, but setOption at
- // the second time the default color will be erased. So we change to use
- // constant DEFAULT_COLOR.
- // If user do not want the default color, set inRange: {color: null}.
- n.inRange=n.inRange||{color:t.get("gradientColor")}}a.call(this,i),a.call(this,o),function(t,e,n){var i=t[e],o=t[n];i&&!o&&(o=t[n]={},LO(i,(function(t,e){if(mb.isValidType(e)){var n=DO.get(e,"inactive",r);null!=n&&(o[e]=n,
- // Compatibable with ec2:
- // Only inactive color to rgba(0,0,0,0) can not
- // make label transparent, so use opacity also.
- "color"!==e||o.hasOwnProperty("opacity")||o.hasOwnProperty("colorAlpha")||(o.opacity=[0,0]))}})))}.call(this,i,"inRange","outOfRange"),
- // completeInactive.call(this, target, 'outOfRange', 'inRange');
- function(t){var e=(t.inRange||{}).symbol||(t.outOfRange||{}).symbol,n=(t.inRange||{}).symbolSize||(t.outOfRange||{}).symbolSize,i=this.get("inactiveColor"),o=this.getItemSymbol()||"roundRect";LO(this.stateList,(function(a){var s=this.itemSize,l=t[a];
- // Set inactive color for controller if no other color
- // attr (like colorAlpha) specified.
- l||(l=t[a]={color:r?i:[i]}),
- // Consistent symbol and symbolSize if not specified.
- null==l.symbol&&(l.symbol=e&&et(e)||(r?o:[o])),null==l.symbolSize&&(l.symbolSize=n&&et(n)||(r?s[0]:[s[0],s[0]])),
- // Filter none
- l.symbol=TO(l.symbol,(function(t){return"none"===t?o:t}));
- // Normalize symbolSize
- var u=l.symbolSize;if(null!=u){var c=-Infinity;
- // symbolSize can be object when categories defined.
- CO(u,(function(t){t>c&&(c=t)})),l.symbolSize=TO(u,(function(t){return PO(t,[0,c],[0,s[0]],!0)}))}}),this)}.call(this,o)},n.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},n.prototype.isCategory=function(){return!!this.option.categories},
- /**
- * @public
- * @abstract
- */
- n.prototype.setSelected=function(t){},n.prototype.getSelected=function(){return null},
- /**
- * @public
- * @abstract
- */
- n.prototype.getValueState=function(t){return null},
- /**
- * FIXME
- * Do not publish to thirt-part-dev temporarily
- * util the interface is stable. (Should it return
- * a function but not visual meta?)
- *
- * @pubilc
- * @abstract
- * @param getColorVisual
- * params: value, valueState
- * return: color
- * @return {Object} visualMeta
- * should includes {stops, outerColors}
- * outerColor means [colorBeyondMinValue, colorBeyondMaxValue]
- */
- n.prototype.getVisualMeta=function(t){return null},n.type="visualMap",n.dependencies=["series"],n.defaultOption={show:!0,
- // zlevel: 0,
- z:4,seriesIndex:"all",min:0,max:200,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,
- // 接受数组分别设定上右下左边距,同css
- textGap:10,precision:0,textStyle:{color:"#333"}},n}(Ta);const OO=NO;
- // Constant
- var RO=[20,140],EO=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}
- /**
- * @override
- */return Ue(e,t),e.prototype.optionUpdated=function(e,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual((function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()})),this._resetRange()},
- /**
- * @protected
- * @override
- */
- e.prototype.resetItemSize=function(){t.prototype.resetItemSize.apply(this,arguments);var e=this.itemSize;(null==e[0]||isNaN(e[0]))&&(e[0]=RO[0]),(null==e[1]||isNaN(e[1]))&&(e[1]=RO[1])},
- /**
- * @private
- */
- e.prototype._resetRange=function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(
- // `range` should always be array (so we don't use other
- // value like 'auto') for user-friend. (consider getOption).
- t.auto=1,this.option.range=t):i(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},
- /**
- * @protected
- * @override
- */
- e.prototype.completeVisualOption=function(){t.prototype.completeVisualOption.apply(this,arguments),a(this.stateList,(function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=e[1]/3)}),this)},
- /**
- * @override
- */
- e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},
- /**
- * @public
- */
- e.prototype.getSelected=function(){var t=this.getExtent(),e=Ke((this.get("range")||[]).slice());
- // Clamp
- 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},
- /**
- * @override
- */
- e.prototype.getValueState=function(t){var e=this.option.range,n=this.getExtent();
- // When range[0] === dataExtent[0], any value larger than dataExtent[0] maps to 'inRange'.
- // range[1] is processed likewise.
- return(e[0]<=n[0]||e[0]<=t)&&(e[1]>=n[1]||t<=e[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var e=[];return this.eachTargetSeries((function(n){var i=[],o=n.getData();o.each(this.getDataDimensionIndex(o),(function(e,n){t[0]<=e&&e<=t[1]&&i.push(n)}),this),e.push({seriesId:n.id,dataIndex:i})}),this),e},
- /**
- * @implement
- */
- e.prototype.getVisualMeta=function(t){var e=VO(this,"outOfRange",this.getExtent()),n=VO(this,"inRange",this.option.range.slice()),i=[];function o(e,n){i.push({value:e,color:t(e,n)})}
- // Format to: outOfRange -- inRange -- outOfRange.
- for(var r=0,a=0,s=n.length,l=e.length;a<l&&(!n.length||e[a]<=n[0]);a++)
- // If oVal[oIdx] === iVals[iIdx], oVal[oIdx] should be ignored.
- e[a]<n[r]&&o(e[a],"outOfRange");for(var u=1;r<s;r++,u=0)
- // If range is full, value beyond min, max will be clamped.
- // make a singularity
- u&&i.length&&o(n[r],"outOfRange"),o(n[r],"inRange");for(u=1;a<l;a++)(!n.length||n[n.length-1]<e[a])&&(
- // make a singularity
- u&&(i.length&&o(i[i.length-1].value,"outOfRange"),u=0),o(e[a],"outOfRange"));var c=i.length;return{stops:i,outerColors:[c?i[0].color:"transparent",c?i[c-1].color:"transparent"]}},e.type="visualMap.continuous",e.defaultOption=xr(OO.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),e}(OO);function VO(t,e,n){if(n[0]===n[1])return n.slice();
- // When using colorHue mapping, it is not linear color any more.
- // Moreover, canvas gradient seems not to be accurate linear.
- // FIXME
- // Should be arbitrary value 100? or based on pixel size?
- for(var i=(n[1]-n[0])/200,o=n[0],r=[],a=0;a<=200&&o<n[1];a++)r.push(o),o+=i;return r.push(n[1]),r}const zO=EO;const BO=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.autoPositionValues={left:1,right:1,top:1,bottom:1},n}return Ue(e,t),e.prototype.init=function(t,e){this.ecModel=t,this.api=e},
- /**
- * @protected
- */
- e.prototype.render=function(t,e,n,i){this.visualMapModel=t,!1!==t.get("show")?this.doRender(t,e,n,i):this.group.removeAll()},
- /**
- * @protected
- */
- e.prototype.renderBackground=function(t){var e=this.visualMapModel,n=aa(e.get("padding")||0),i=t.getBoundingRect();t.add(new G({z2:-1,silent:!0,shape:{x:i.x-n[3],y:i.y-n[0],width:i.width+n[3]+n[1],height:i.height+n[0]+n[2]},style:{fill:e.get("backgroundColor"),stroke:e.get("borderColor"),lineWidth:e.get("borderWidth")}}))},
- /**
- * @protected
- * @param targetValue can be Infinity or -Infinity
- * @param visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize'
- * @param opts
- * @param opts.forceState Specify state, instead of using getValueState method.
- * @param opts.convertOpacityToAlpha For color gradient in controller widget.
- * @return {*} Visual value.
- */
- e.prototype.getControllerVisual=function(t,e,n){var i=(n=n||{}).forceState,o=this.visualMapModel,r={};
- // Default values.
- if("color"===e){var s=o.get("contentColor");r.color=s}function l(t){return r[t]}function u(t,e){r[t]=e}var c=o.controllerVisuals[i||o.getValueState(t)],d=mb.prepareVisualTypes(c);return a(d,(function(i){var o=c[i];n.convertOpacityToAlpha&&"opacity"===i&&(i="colorAlpha",o=c.__alphaForOpacity),mb.dependsOn(i,e)&&o&&o.applyVisual(t,l,u)})),r[e]},e.prototype.positionGroup=function(t){var e=this.visualMapModel,n=this.api;_a(t,e.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},e.prototype.doRender=function(t,e,n,i){},e.type="visualMap",e}(Mu);var GO=[["left","right","width"],["top","bottom","height"]];
- /**
- * @param visualMapModel
- * @param api
- * @param itemSize always [short, long]
- * @return {string} 'left' or 'right' or 'top' or 'bottom'
- */function FO(t,e,n){var i=t.option,o=i.align;if(null!=o&&"auto"!==o)return o;
- // Auto decision align.
- for(var r={width:e.getWidth(),height:e.getHeight()},a="horizontal"===i.orient?1:0,s=GO[a],l=[0,null,10],u={},c=0;c<3;c++)u[GO[1-a][c]]=l[c],u[s[c]]=2===c?n[0]:i[s[c]];var d=[["x","width",3],["y","height",0]][a],h=xa(u,r,i.padding);return s[(h.margin[d[2]]||0)+h[d[0]]+.5*h[d[1]]<.5*r[d[1]]?0:1]}
- /**
- * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and
- * dataIndexInside means filtered index.
- */
- // TODO: TYPE more specified payload types.
- function WO(t,e){return a(t||[],(function(t){null!=t.dataIndex&&(t.dataIndexInside=t.dataIndex,t.dataIndex=null),t.highlightKey="visualMap"+(e?e.componentIndex:"")})),t}var HO=Xe,YO=a,UO=Math.min,ZO=Math.max,XO=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._shapes={},n._dataInterval=[],n._handleEnds=[],n._hoverLinkDataIndices=[],n}return Ue(e,t),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this._hoverLinkFromSeriesMouseOver=lt(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=lt(this._hideIndicator,this)},e.prototype.doRender=function(t,e,n,i){i&&"selectDataRange"===i.type&&i.from===this.uid||this._buildView()},e.prototype._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 n=t.get("text");this._renderEndsText(e,n,0),this._renderEndsText(e,n,1),
- // Do this for background size calculation.
- this._updateView(!0),
- // After updating view, inner shapes is built completely,
- // and then background can be rendered.
- this.renderBackground(e),
- // Real update view
- this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(e)},e.prototype._renderEndsText=function(t,e,n){if(e){
- // Compatible with ec2, text[0] map to high value, text[1] map low value.
- var i=e[1-n];i=null!=i?i+"":"";var o=this.visualMapModel,r=o.get("textGap"),a=o.itemSize,s=this._shapes.mainGroup,l=this._applyTransform([a[0]/2,0===n?-r:a[1]+r],s),u=this._applyTransform(0===n?"bottom":"top",s),c=this._orient,d=this.visualMapModel.textStyleModel;this.group.add(new $({style:Zo(d,{x:l[0],y:l[1],verticalAlign:"horizontal"===c?"middle":u,align:"horizontal"===c?u:"center",text:i})}))}},e.prototype._renderBar=function(t){var e=this.visualMapModel,n=this._shapes,i=e.itemSize,o=this._orient,r=this._useHandle,a=FO(e,this.api,i),s=n.mainGroup=this._createBarGroup(a),l=new Z;s.add(l),
- // Bar
- l.add(n.outOfRange=jO()),l.add(n.inRange=jO(null,r?KO(this._orient):null,lt(this._dragHandle,this,"all",!1),lt(this._dragHandle,this,"all",!0))),
- // A border radius clip.
- l.setClipPath(new G({shape:{x:0,y:0,width:i[0],height:i[1],r:3}}));var u=e.textStyleModel.getTextRect("国"),c=ZO(u.width,u.height);
- // Handle
- r&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(e,s,0,i,c,o),this._createHandle(e,s,1,i,c,o)),this._createIndicator(e,s,i,c,o),t.add(s)},e.prototype._createHandle=function(t,e,n,i,o,r){var a=lt(this._dragHandle,this,n,!1),s=lt(this._dragHandle,this,n,!0),l=Mt(t.get("handleSize"),i[0]),u=Gc(t.get("handleIcon"),-l/2,-l/2,l,l,null,!0),c=KO(this._orient);u.attr({cursor:c,draggable:!0,drift:a,ondragend:s,onmousemove:function(t){jt(t.event)}}),u.x=i[0]/2,u.useStyle(t.getModel("handleStyle").getItemStyle()),u.setStyle({strokeNoScale:!0,strokeFirst:!0}),u.style.lineWidth*=2,u.ensureState("emphasis").style=t.getModel(["emphasis","handleStyle"]).getItemStyle(),Ki(u,!0),e.add(u);
- // Text is always horizontal layout but should not be effected by
- // transform (orient/inverse). So label is built separately but not
- // use zrender/graphic/helper/RectText, and is located based on view
- // group (according to handleLabelPoint) but not barGroup.
- var d=this.visualMapModel.textStyleModel,h=new $({cursor:c,draggable:!0,drift:a,onmousemove:function(t){
- // For mobile device, prevent screen slider on the button.
- jt(t.event)},ondragend:s,style:Zo(d,{x:0,y:0,text:""})});h.ensureState("blur").style={opacity:.1},h.stateTransition={duration:200},this.group.add(h);var p=[l,0],f=this._shapes;f.handleThumbs[n]=u,f.handleLabelPoints[n]=p,f.handleLabels[n]=h},e.prototype._createIndicator=function(t,e,n,i,o){var r=Mt(t.get("indicatorSize"),n[0]),a=Gc(t.get("indicatorIcon"),-r/2,-r/2,r,r,null,!0);a.attr({cursor:"move",invisible:!0,silent:!0,x:n[0]/2});var s=t.getModel("indicatorStyle").getItemStyle();if(a instanceof b){var l=a.style;a.useStyle(p({
- // TODO other properties like x, y ?
- image:l.image,x:l.x,y:l.y,width:l.width,height:l.height},s))}else a.useStyle(s);e.add(a);var u=this.visualMapModel.textStyleModel,c=new $({silent:!0,invisible:!0,style:Zo(u,{x:0,y:0,text:""})});this.group.add(c);var d=[("horizontal"===o?i/2:6)+n[0]/2,0],h=this._shapes;h.indicator=a,h.indicatorLabel=c,h.indicatorLabelPoint=d,this._firstShowIndicator=!0},e.prototype._dragHandle=function(t,e,
- // dx is event from ondragend if isEnd is true. It's not used
- n,i){if(this._useHandle){if(this._dragging=!e,!e){
- // Transform dx, dy to bar coordination.
- var o=this._applyTransform([n,i],this._shapes.mainGroup,!0);this._updateInterval(t,o[1]),this._hideIndicator(),
- // Considering realtime, update view should be executed
- // before dispatch action.
- this._updateView()}
- // dragEnd do not dispatch action when realtime.
- e===!this.visualMapModel.get("realtime")&&
- // jshint ignore:line
- this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),e?!this._hovering&&this._clearHoverLinkToSeries():qO(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[t],!1)}},e.prototype._resetInterval=function(){var t=this.visualMapModel,e=this._dataInterval=t.getSelected(),n=t.getExtent(),i=[0,t.itemSize[1]];this._handleEnds=[HO(e[0],n,i,!0),HO(e[1],n,i,!0)]},
- /**
- * @private
- * @param {(number|string)} handleIndex 0 or 1 or 'all'
- * @param {number} dx
- * @param {number} dy
- */
- e.prototype._updateInterval=function(t,e){e=e||0;var n=this.visualMapModel,i=this._handleEnds,o=[0,n.itemSize[1]];Sw(e,i,o,t,
- // cross is forbidden
- 0);var r=n.getExtent();
- // Update data interval.
- this._dataInterval=[HO(i[0],o,r,!0),HO(i[1],o,r,!0)]},e.prototype._updateView=function(t){var e=this.visualMapModel,n=e.getExtent(),i=this._shapes,o=[0,e.itemSize[1]],r=t?o:this._handleEnds,a=this._createBarVisual(this._dataInterval,n,r,"inRange"),s=this._createBarVisual(n,n,o,"outOfRange");i.inRange.setStyle({fill:a.barColor}).setShape("points",a.barPoints),i.outOfRange.setStyle({fill:s.barColor}).setShape("points",s.barPoints),this._updateHandle(r,a)},e.prototype._createBarVisual=function(t,e,n,i){var o={forceState:i,convertOpacityToAlpha:!0},r=this._makeColorGradient(t,o),a=[this.getControllerVisual(t[0],"symbolSize",o),this.getControllerVisual(t[1],"symbolSize",o)],s=this._createBarPoints(n,a);return{barColor:new j(0,0,0,1,r),barPoints:s,handlesColor:[r[0].color,r[r.length-1].color]}},e.prototype._makeColorGradient=function(t,e){
- // Considering colorHue, which is not linear, so we have to sample
- // to calculate gradient color stops, but not only calculate head
- // and tail.
- var n=[],i=(t[1]-t[0])/100;// Arbitrary value.
- n.push({color:this.getControllerVisual(t[0],"color",e),offset:0});for(var o=1;o<100;o++){var r=t[0]+i*o;if(r>t[1])break;n.push({color:this.getControllerVisual(r,"color",e),offset:o/100})}return n.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),n},e.prototype._createBarPoints=function(t,e){var n=this.visualMapModel.itemSize;return[[n[0]-e[0],t[0]],[n[0],t[0]],[n[0],t[1]],[n[0]-e[1],t[1]]]},e.prototype._createBarGroup=function(t){var e=this._orient,n=this.visualMapModel.get("inverse");return new Z("horizontal"!==e||n?"horizontal"===e&&n?{scaleX:"bottom"===t?-1:1,rotation:-Math.PI/2}:"vertical"!==e||n?{scaleX:"left"===t?1:-1}:{scaleX:"left"===t?1:-1,scaleY:-1}:{scaleX:"bottom"===t?1:-1,rotation:Math.PI/2})},e.prototype._updateHandle=function(t,e){if(this._useHandle){var n=this._shapes,i=this.visualMapModel,o=n.handleThumbs,r=n.handleLabels,a=i.itemSize,s=i.getExtent(),l=this._applyTransform("left",n.mainGroup);YO([0,1],(function(u){var c=o[u];c.setStyle("fill",e.handlesColor[u]),c.y=t[u];var d=HO(t[u],[0,a[1]],s,!0),h=this.getControllerVisual(d,"symbolSize");c.scaleX=c.scaleY=h/a[0],c.x=a[0]-h/2;
- // Update handle label position.
- var p=To(n.handleLabelPoints[u],Do(c,this.group));if("horizontal"===this._orient){
- // If visualMap controls symbol size, an additional offset needs to be added to labels to avoid collision at minimum size.
- // Offset reaches value of 0 at "maximum" position, so maximum position is not altered at all.
- var f="left"===l||"top"===l?(a[0]-h)/2:(a[0]-h)/-2;p[1]+=f}r[u].setStyle({x:p[0],y:p[1],text:i.formatValueText(this._dataInterval[u]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})}),this)}},e.prototype._showIndicator=function(t,e,n,i){var o=this.visualMapModel,r=o.getExtent(),a=o.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var c=this.getControllerVisual(t,"color",{convertOpacityToAlpha:!0}),d=this.getControllerVisual(t,"symbolSize"),h=HO(t,r,s,!0),p=a[0]-d/2,f={x:u.x,y:u.y};
- // Update handle label position.
- u.y=h,u.x=p;var g=To(l.indicatorLabelPoint,Do(u,this.group)),y=l.indicatorLabel;y.attr("invisible",!1);var m=this._applyTransform("left",l.mainGroup),v="horizontal"===this._orient;y.setStyle({text:(n||"")+o.formatValueText(e),verticalAlign:v?m:"middle",align:v?"center":m});var x={x:p,y:h,style:{fill:c}},_={style:{x:g[0],y:g[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var b={duration:100,easing:"cubicInOut",additive:!0};u.x=f.x,u.y=f.y,u.animateTo(x,b),y.animateTo(_,b)}else u.attr(x),y.attr(_);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var w=0;w<S.length;w++)
- // Fade out handle labels.
- // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.
- this.api.enterBlur(S[w])}},e.prototype._enableHoverLinkToSeries=function(){var t=this;this._shapes.mainGroup.on("mousemove",(function(e){if(t._hovering=!0,!t._dragging){var n=t.visualMapModel.itemSize,i=t._applyTransform([e.offsetX,e.offsetY],t._shapes.mainGroup,!0,!0);
- // For hover link show when hover handle, which might be
- // below or upper than sizeExtent.
- i[1]=UO(ZO(0,i[1]),n[1]),t._doHoverLinkToSeries(i[1],0<=i[0]&&i[0]<=n[0])}})).on("mouseout",(function(){
- // When mouse is out of handle, hoverLink still need
- // to be displayed when realtime is set as false.
- t._hovering=!1,!t._dragging&&t._clearHoverLinkToSeries()}))},e.prototype._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()},e.prototype._doHoverLinkToSeries=function(t,e){var n=this.visualMapModel,i=n.itemSize;if(n.option.hoverLink){var o=[0,i[1]],r=n.getExtent();
- // For hover link show when hover handle, which might be below or upper than sizeExtent.
- t=UO(ZO(o[0],t),o[1]);var a=function(t,e,n){var i=6,o=t.get("hoverLinkDataSize");o&&(i=HO(o,e,n,!0)/2);return i}(n,r,o),s=[t-a,t+a],l=HO(t,o,r,!0),u=[HO(s[0],o,r,!0),HO(s[1],o,r,!0)];
- // Consider data range is out of visualMap range, see test/visualMap-continuous.html,
- // where china and india has very large population.
- s[0]<o[0]&&(u[0]=-Infinity),s[1]>o[1]&&(u[1]=Infinity),
- // Do not show indicator when mouse is over handle,
- // otherwise labels overlap, especially when dragging.
- e&&(-Infinity===u[0]?this._showIndicator(l,u[1],"< ",a):Infinity===u[1]?this._showIndicator(l,u[0],"> ",a):this._showIndicator(l,l,"≈ ",a));
- // When realtime is set as false, handles, which are in barGroup,
- // also trigger hoverLink, which help user to realize where they
- // focus on when dragging. (see test/heatmap-large.html)
- // When realtime is set as true, highlight will not show when hover
- // handle, because the label on handle, which displays a exact value
- // but not range, might mislead users.
- var c=this._hoverLinkDataIndices,d=[];(e||qO(n))&&(d=this._hoverLinkDataIndices=n.findTargetDataIndices(u));var h=function(t,e){var n={},i={};return o(t||[],n),o(e||[],i,n),[r(n),r(i)];function o(t,e,n){for(var i=0,o=t.length;i<o;i++){var r=Ln(t[i].seriesId,null);if(null==r)return;for(var a=Sn(t[i].dataIndex),s=n&&n[r],l=0,u=a.length;l<u;l++){var c=a[l];s&&s[c]?s[c]=null:(e[r]||(e[r]={}))[c]=1}}}function r(t,e){var n=[];for(var i in t)if(t.hasOwnProperty(i)&&null!=t[i])if(e)n.push(+i);else{var o=r(t[i],!0);o.length&&n.push({seriesId:i,dataIndex:o})}return n}}(c,d);this._dispatchHighDown("downplay",WO(h[0],n)),this._dispatchHighDown("highlight",WO(h[1],n))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var e;if(kc(t.target,(function(t){var n=ni(t);if(null!=n.dataIndex)return e=n,!0}),!0),e){var n=this.ecModel.getSeriesByIndex(e.seriesIndex),i=this.visualMapModel;if(i.isTargetSeries(n)){var o=n.getData(e.dataType),r=o.getStore().get(i.getDataDimensionIndex(o),e.dataIndex);isNaN(r)||this._showIndicator(r,r)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var e=this._shapes.handleLabels;if(e)for(var n=0;n<e.length;n++)
- // Fade out handle labels.
- // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.
- this.api.leaveBlur(e[n])},e.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var t=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",WO(t,this.visualMapModel)),t.length=0},e.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var t=this.api.getZr();t.off("mouseover",this._hoverLinkFromSeriesMouseOver),t.off("mouseout",this._hideIndicator)},e.prototype._applyTransform=function(t,e,n,o){var r=Do(e,o?null:this.group);return i(t)?To(t,r,n):Co(t,r,n)},
- // TODO: TYPE more specified payload types.
- e.prototype._dispatchHighDown=function(t,e){e&&e.length&&this.api.dispatchAction({type:t,batch:e})},
- /**
- * @override
- */
- e.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},e.type="visualMap.continuous",e}(BO);function jO(t,e,n,i){return new z({shape:{points:t},draggable:!!n,cursor:e,drift:n,onmousemove:function(t){
- // For mobile device, prevent screen slider on the button.
- jt(t.event)},ondragend:i})}function qO(t){var e=t.get("hoverLinkOnHandle");return!!(null==e?t.get("realtime"):e)}function KO(t){return"vertical"===t?"ns-resize":"ew-resize"}const JO=XO;
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /**
- * AUTO-GENERATED FILE. DO NOT MODIFY.
- */
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */var $O={type:"selectDataRange",event:"dataRangeSelected",
- // FIXME use updateView appears wrong
- update:"update"},QO=function(t,e){e.eachComponent({mainType:"visualMap",query:t},(function(e){e.setSelected(t.selected)}))},tR=[{createOnAllSeries:!0,reset:function(t,e){var n=[];return e.eachComponent("visualMap",(function(e){var i,o,r,s,l,u=t.pipelineContext;!e.isTargetSeries(t)||u&&u.large||n.push((i=e.stateList,o=e.targetVisuals,r=lt(e.getValueState,e),s=e.getDataDimensionIndex(t.getData()),l={},a(i,(function(t){var e=mb.prepareVisualTypes(o[t]);l[t]=e})),{progress:function(t,e){var n,i;function a(t){return Dc(e,i,t)}function u(t,n){Cc(e,i,t,n)}null!=s&&(n=e.getDimensionIndex(s));for(var c=e.getStore();null!=(i=t.next());){var d=e.getRawDataItem(i);
- // Consider performance
- // @ts-ignore
- if(!d||!1!==d.visualMap)for(var h=null!=s?c.get(n,i):i,p=r(h),f=o[p],g=l[p],y=0,m=g.length;y<m;y++){var v=g[y];f[v]&&f[v].applyVisual(h,a,u)}}}}))})),n}},
- // Only support color.
- {createOnAllSeries:!0,reset:function(t,e){var n=t.getData(),i=[];e.eachComponent("visualMap",(function(e){if(e.isTargetSeries(t)){var o=e.getVisualMeta(lt(eR,null,t,e))||{stops:[],outerColors:[]},r=e.getDataDimensionIndex(n);r>=0&&(
- // visualMeta.dimension should be dimension index, but not concrete dimension.
- o.dimension=r,i.push(o))}})),
- // console.log(JSON.stringify(visualMetaList.map(a => a.stops)));
- t.getData().setVisual("visualMeta",i)}}];
- // FIXME
- // performance and export for heatmap?
- // value can be Infinity or -Infinity
- function eR(t,e,n,i){for(var o=e.targetVisuals[i],r=mb.prepareVisualTypes(o),a={color:Tc(t.getData(),"color")},s=0,l=r.length;s<l;s++){var u=r[s],c=o["opacity"===u?"__alphaForOpacity":u];c&&c.applyVisual(n,d,h)}return a.color;function d(t){return a[t]}function h(t,e){a[t]=e}}var nR=a;function iR(t){var e=t&&t.visualMap;i(e)||(e=e?[e]:[]),nR(e,(function(t){if(t){
- // rename splitList to pieces
- oR(t,"splitList")&&!oR(t,"pieces")&&(t.pieces=t.splitList,delete t.splitList);var e=t.pieces;e&&i(e)&&nR(e,(function(t){o(t)&&(oR(t,"start")&&!oR(t,"min")&&(t.min=t.start),oR(t,"end")&&!oR(t,"max")&&(t.max=t.end))}))}}))}function oR(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}var rR=!1;function aR(t){rR||(rR=!0,t.registerSubTypeDefaulter("visualMap",(function(t){
- // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used.
- return t.categories||(t.pieces?t.pieces.length>0:t.splitNumber>0)&&!t.calculable?"piecewise":"continuous"})),t.registerAction($O,QO),a(tR,(function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)})),t.registerPreprocessor(iR))}function sR(t){t.registerComponentModel(zO),t.registerComponentView(JO),aR(t)}var lR=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,
- /**
- * The order is always [low, ..., high].
- * [{text: string, interval: Array.<number>}, ...]
- */
- n._pieceList=[],n}return Ue(e,t),e.prototype.optionUpdated=function(e,i){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var o=this._mode=this._determineMode();this._pieceList=[],uR[this._mode].call(this,this._pieceList),this._resetSelected(e,i);var r=this.option.categories;this.resetVisual((function(t,e){"categories"===o?(t.mappingMethod="category",t.categories=et(r)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=n(this._pieceList,(function(t){return t=et(t),"inRange"!==e&&(
- // FIXME
- // outOfRange do not support special visual in pieces.
- t.visual=null),t})))}))},
- /**
- * @protected
- * @override
- */
- e.prototype.completeVisualOption=function(){
- // Consider this case:
- // visualMap: {
- // pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}]
- // }
- // where no inRange/outOfRange set but only pieces. So we should make
- // default inRange/outOfRange for this case, otherwise visuals that only
- // appear in `pieces` will not be taken into account in visual encoding.
- var e=this.option,n={},i=mb.listVisualTypes(),o=this.isCategory();function r(t,e,n){return t&&t[e]&&t[e].hasOwnProperty(n)}a(e.pieces,(function(t){a(i,(function(e){t.hasOwnProperty(e)&&(n[e]=1)}))})),a(n,(function(t,n){var i=!1;a(this.stateList,(function(t){i=i||r(e,t,n)||r(e.target,t,n)}),this),!i&&a(this.stateList,(function(t){(e[t]||(e[t]={}))[n]=DO.get(n,"inRange"===t?"active":"inactive",o)}))}),this),t.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,e){var n=this.option,i=this._pieceList,o=(e?n:t).selected||{};if(n.selected=o,
- // Consider 'not specified' means true.
- a(i,(function(t,e){var n=this.getSelectedMapKey(t);o.hasOwnProperty(n)||(o[n]=!0)}),this),"single"===n.selectedMode){
- // Ensure there is only one selected.
- var r=!1;a(i,(function(t,e){var n=this.getSelectedMapKey(t);o[n]&&(r?o[n]=!1:r=!0)}),this)}
- // thisOption.selectedMode === 'multiple', default: all selected.
- },
- /**
- * @public
- */
- e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},
- /**
- * @public
- */
- e.prototype.getSelectedMapKey=function(t){return"categories"===this._mode?t.value+"":t.index+""},
- /**
- * @public
- */
- e.prototype.getPieceList=function(){return this._pieceList},
- /**
- * @return {string}
- */
- e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},
- /**
- * @override
- */
- e.prototype.setSelected=function(t){this.option.selected=et(t)},
- /**
- * @override
- */
- e.prototype.getValueState=function(t){var e=mb.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},
- /**
- * @public
- * @param pieceIndex piece index in visualMapModel.getPieceList()
- */
- e.prototype.findTargetDataIndices=function(t){var e=[],n=this._pieceList;return this.eachTargetSeries((function(i){var o=[],r=i.getData();r.each(this.getDataDimensionIndex(r),(function(e,i){mb.findPieceIndex(e,n)===t&&o.push(i)}),this),e.push({seriesId:i.id,dataIndex:o})}),this),e},
- /**
- * @private
- * @param piece piece.value or piece.interval is required.
- * @return Can be Infinity or -Infinity
- */
- e.prototype.getRepresentValue=function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var n=t.interval||[];e=-Infinity===n[0]&&Infinity===n[1]?0:(n[0]+n[1])/2}return e},e.prototype.getVisualMeta=function(t){
- // Do not support category. (category axis is ordinal, numerical)
- if(!this.isCategory()){var e=[],n=["",""],i=this,o=this._pieceList.slice();if(o.length){var r=o[0].interval[0];-Infinity!==r&&o.unshift({interval:[-Infinity,r]}),Infinity!==(r=o[o.length-1].interval[1])&&o.push({interval:[r,Infinity]})}else o.push({interval:[-Infinity,Infinity]});var s=-Infinity;return a(o,(function(t){var e=t.interval;e&&(
- // Fulfill gap.
- e[0]>s&&l([s,e[0]],"outOfRange"),l(e.slice()),s=e[1])}),this),{stops:e,outerColors:n}}function l(o,r){var a=i.getRepresentValue({interval:o});// Not category
- r||(r=i.getValueState(a));var s=t(a,r);-Infinity===o[0]?n[0]=s:Infinity===o[1]?n[1]=s:e.push({value:o[0],color:s},{value:o[1],color:s})}
- // Suplement
- },e.type="visualMap.piecewise",e.defaultOption=xr(OO.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(OO),uR={splitNumber:function(t){var e=this.option,n=Math.min(e.precision,20),i=this.getExtent(),o=e.splitNumber;o=Math.max(parseInt(o,10),1),e.splitNumber=o;
- // Precision auto-adaption
- for(var r=(i[1]-i[0])/o;+r.toFixed(n)!==r&&n<5;)n++;e.precision=n,r=+r.toFixed(n),e.minOpen&&t.push({interval:[-Infinity,i[0]],close:[0,0]});for(var s=0,l=i[0];s<o;l+=r,s++){var u=s===o-1?i[1]:l+r;t.push({interval:[l,u],close:[1,1]})}e.maxOpen&&t.push({interval:[i[1],Infinity],close:[0,0]}),hn(t),a(t,(function(t,e){t.index=e,t.text=this.formatValueText(t.interval)}),this)},categories:function(t){var e=this.option;a(e.categories,(function(e){
- // FIXME category模式也使用pieceList,但在visualMapping中不是使用pieceList。
- // 是否改一致。
- t.push({text:this.formatValueText(e,!0),value:e})}),this),
- // See "Order Rule".
- cR(e,t)},pieces:function(t){var e=this.option;a(e.pieces,(function(e,n){o(e)||(e={value:e});var i={text:"",index:n};if(null!=e.label&&(i.text=e.label),e.hasOwnProperty("value")){var r=i.value=e.value;i.interval=[r,r],i.close=[1,1]}else{for(
- // `min` `max` is legacy option.
- // `lt` `gt` `lte` `gte` is recommended.
- var a=i.interval=[],s=i.close=[0,0],l=[1,0,1],u=[-Infinity,Infinity],c=[],d=0;d<2;d++){for(var h=[["gte","gt","min"],["lte","lt","max"]][d],p=0;p<3&&null==a[d];p++)a[d]=e[h[p]],s[d]=l[p],c[d]=2===p;null==a[d]&&(a[d]=u[d])}c[0]&&Infinity===a[1]&&(s[0]=0),c[1]&&-Infinity===a[0]&&(s[1]=0),a[0]===a[1]&&s[0]&&s[1]&&(
- // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}],
- // we use value to lift the priority when min === max
- i.value=a[0])}i.visual=mb.retrieveVisuals(e),t.push(i)}),this),
- // See "Order Rule".
- cR(e,t),
- // Only pieces
- hn(t),a(t,(function(t){var e=t.close,n=[["<","≤"][e[1]],[">","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,n)}),this)}};
- /**
- * Key is this._mode
- * @type {Object}
- * @this {module:echarts/component/viusalMap/PiecewiseMode}
- */function cR(t,e){var n=t.inverse;("vertical"===t.orient?!n:n)&&e.reverse()}const dR=lR;const hR=/** @class */function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ue(e,t),e.prototype.doRender=function(){var t=this.group;t.removeAll();var e=this.visualMapModel,n=e.get("textGap"),i=e.textStyleModel,o=i.getFont(),r=i.getTextColor(),s=this._getItemAlign(),l=e.itemSize,u=this._getViewData(),c=u.endsText,d=Yt(e.get("showLabel",!0),!c),h=!e.get("selectedMode");c&&this._renderEndsText(t,c[0],l,d,s),a(u.viewPieceList,(function(i){var a=i.piece,u=new Z;u.onclick=lt(this._onItemClick,this,a),this._enableHoverLink(u,i.indexInModelPieceList);
- // TODO Category
- var c=e.getRepresentValue(a);if(this._createItemSymbol(u,c,[0,0,l[0],l[1]],h),d){var p=this.visualMapModel.getValueState(c);u.add(new $({style:{x:"right"===s?-n:l[0]+n,y:l[1]/2,text:a.text,verticalAlign:"middle",align:s,font:o,fill:r,opacity:"outOfRange"===p?.5:1},silent:h}))}t.add(u)}),this),c&&this._renderEndsText(t,c[1],l,d,s),va(e.get("orient"),t,e.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,e){var n=this;t.on("mouseover",(function(){return i("highlight")})).on("mouseout",(function(){return i("downplay")}));var i=function(t){var i=n.visualMapModel;
- // TODO: TYPE More detailed action types
- i.option.hoverLink&&n.api.dispatchAction({type:t,batch:WO(i.findTargetDataIndices(e),i)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return FO(t,this.api,t.itemSize);
- // horizontal, most case left unless specifying right.
- var n=e.align;return n&&"auto"!==n||(n="left"),n},e.prototype._renderEndsText=function(t,e,n,i,o){if(e){var r=new Z,a=this.visualMapModel.textStyleModel;r.add(new $({style:Zo(a,{x:i?"right"===o?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?o:"center",text:e})})),t.add(r)}},
- /**
- * @private
- * @return {Object} {peiceList, endsText} The order is the same as screen pixel order.
- */
- e.prototype._getViewData=function(){var t=this.visualMapModel,e=n(t.getPieceList(),(function(t,e){return{piece:t,indexInModelPieceList:e}})),i=t.get("text"),o=t.get("orient"),r=t.get("inverse");
- // Order of model pieceList is always [low, ..., high]
- return("horizontal"===o?r:!r)?e.reverse():i&&(i=i.slice().reverse()),{viewPieceList:e,endsText:i}},e.prototype._createItemSymbol=function(t,e,n,i){var o=Gc(
- // symbol will be string
- this.getControllerVisual(e,"symbol"),n[0],n[1],n[2],n[3],
- // color will be string
- this.getControllerVisual(e,"color"));o.silent=i,t.add(o)},e.prototype._onItemClick=function(t){var e=this.visualMapModel,n=e.option,i=n.selectedMode;if(i){var o=et(n.selected),r=e.getSelectedMapKey(t);"single"===i||!0===i?(o[r]=!0,a(o,(function(t,e){o[e]=e===r}))):o[r]=!o[r],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},e.type="visualMap.piecewise",e}(BO);function pR(t){t.registerComponentModel(dR),t.registerComponentView(hR),aR(t)}var fR={label:{enabled:!0},decal:{show:!1}},gR=On(),yR={};function mR(e,n){var i=e.getModel("aria");
- // See "area enabled" detection code in `GlobalModel.ts`.
- if(i.get("enabled")){var o=et(fR);tt(o.label,e.getLocaleModel().get("aria"),!1),tt(i.option,o,!1),function(){if(i.getModel("decal").get("show")){
- // Each type of series use one scope.
- // Pie and funnel are using different scopes.
- var t=r();e.eachSeries((function(e){if(!e.isColorBySeries()){var n=t.get(e.type);n||(n={},t.set(e.type,n)),gR(e).scope=n}})),e.eachRawSeries((function(t){if(!e.isSeriesFiltered(t))if(f(t.enableAriaDecal))
- // Let series define how to use decal palette on data
- t.enableAriaDecal();else{var n=t.getData();if(t.isColorBySeries()){var i=ns(t.ecModel,t.name,yR,e.getSeriesCount()),o=n.getVisual("decal");n.setVisual("decal",u(o,i))}else{var r=t.getRawData(),a={},s=gR(t).scope;n.each((function(t){var e=n.getRawIndex(t);a[e]=t}));var l=r.count();r.each((function(e){var i=a[e],o=r.getName(e)||e+"",c=ns(t.ecModel,o,s,l),d=n.getItemVisual(i,"decal");n.setItemVisual(i,"decal",u(d,c))}))}}function u(t,e){
- // Merge decal from palette to decal from itemStyle.
- // User do not need to specify all of the decal props.
- var n=t?p(p({},e),t):e;return n.dirty=!0,n}}))}}(),function(){var t=n.getZr().dom;
- // TODO: support for SSR
- if(!t)return;var o=e.getLocaleModel().get("aria"),r=i.getModel("label");if(r.option=I(r.option,o),!r.get("enabled"))return;if(t.setAttribute("role","img"),r.get("description"))return void t.setAttribute("aria-label",r.get("description"));var a,l=e.getSeriesCount(),u=r.get(["data","maxCount"])||10,d=r.get(["series","maxCount"])||10,h=Math.min(l,d);if(l<1)
- // No series, no aria label
- return;var p=function(){var t=e.get("title");t&&t.length&&(t=t[0]);return t&&t.text}();a=p?s(r.get(["general","withTitle"]),{title:p}):r.get(["general","withoutTitle"]);var f=[];a+=s(l>1?r.get(["series","multiple","prefix"]):r.get(["series","single","prefix"]),{seriesCount:l}),e.eachSeries((function(t,n){if(n<h){var i=void 0,o=t.get("name")?"withName":"withoutName";i=s(i=l>1?r.get(["series","multiple",o]):r.get(["series","single",o]),{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:(b=t.subType,S=e.getLocaleModel().get(["series","typeNames"]),S[b]||S.chart)});var a=t.getData();if(a.count()>u)i+=s(r.get(["data","partialData"]),{displayCnt:u});else i+=r.get(["data","allData"]);for(var d=r.get(["data","separator","middle"]),p=r.get(["data","separator","end"]),g=r.get(["data","excludeDimensionId"]),y=[],m=0;m<a.count();m++)if(m<u){var v=a.getName(m),x=g?st(a.getValues(m),(function(t,e){return-1===c(g,e)})):a.getValues(m),_=r.get(["data",v?"withName":"withoutName"]);y.push(s(_,{name:v,value:x.join(d)}))}i+=y.join(d)+p,f.push(i)}var b,S}));var g=r.getModel(["series","multiple","separator"]),y=g.get("middle"),m=g.get("end");a+=f.join(y)+m,t.setAttribute("aria-label",a)}()}function s(e,n){if(!t(e))return e;var i=e;return a(n,(function(t,e){i=i.replace(new RegExp("\\{\\s*"+e+"\\s*\\}","g"),t)})),i}}function vR(t){if(t&&t.aria){var e=t.aria;
- // aria.show is deprecated and should use aria.enabled instead
- null!=e.show&&(e.enabled=e.show),e.label=e.label||{},
- // move description, general, series, data to be under aria.label
- a(["description","general","series","data"],(function(t){null!=e[t]&&(e.label[t]=e[t])}))}}var xR={value:"eq",
- // PENDING: not good for literal semantic?
- "<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},_R=/** @class */function(){function e(e){if(null==(this._condVal=t(e)?new RegExp(e):Ne(e)?e:null)){vn("")}}return e.prototype.evaluate=function(e){var n=typeof e;return t(n)?this._condVal.test(e):!!l(n)&&this._condVal.test(e+"")},e}(),bR=/** @class */function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),SR=/** @class */function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e<t.length;e++)if(!t[e].evaluate())return!1;return!0},t}(),wR=/** @class */function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e<t.length;e++)if(t[e].evaluate())return!0;return!1},t}(),MR=/** @class */function(){function t(){}return t.prototype.evaluate=function(){return!this.child.evaluate()},t}(),IR=/** @class */function(){function t(){}return t.prototype.evaluate=function(){
- // Relational cond follow "and" logic internally.
- for(var t=!!this.valueParser,e=(0,this.getValue)(this.valueGetterParam),n=t?this.valueParser(e):null,i=0
- // Call getValue with no `this`.
- ;i<this.subCondList.length;i++)if(!this.subCondList[i].evaluate(t?n:e))return!1;return!0},t}();
- // type RelationalExpressionOpEvaluate = (tarVal: unknown, condVal: unknown) => boolean;
- function DR(t,e){if(!0===t||!1===t){var n=new bR;return n.value=t,n}return CR(t)||vn(""),t.and?TR("and",t,e):t.or?TR("or",t,e):t.not?function(t,e){var n=t.not,i="";CR(n)||vn(i);var o=new MR;o.child=DR(n,e),o.child||vn(i);return o}(t,e):function(t,e){for(var n="",i=e.prepareGetValue(t),o=[],r=v(t),a=t.parser,s=a?xl(a):null,l=0;l<r.length;l++){var u=r[l];if("parser"!==u&&!e.valueGetterAttrMap.get(u)){var c=N(xR,u)?xR[u]:u,d=t[u],h=s?s(d):d,p=Ml(c,h)||"reg"===c&&new _R(h);p||vn(n),o.push(p)}}o.length||
- // No relational operator always disabled in case of dangers result.
- vn(n);var f=new IR;return f.valueGetterParam=i,f.valueParser=s,f.getValue=e.getValue,f.subCondList=o,f}(t,e)}function TR(t,e,o){var r=e[t];i(r)||vn(""),r.length||vn("");var a="and"===t?new SR:new wR;return a.children=n(r,(function(t){return DR(t,o)})),a.children.length||vn(""),a}function CR(t){return o(t)&&!m(t)}var AR=/** @class */function(){function t(t,e){this._cond=DR(t,e)}return t.prototype.evaluate=function(){return this._cond.evaluate()},t}();var LR={type:"echarts:filter",
- // PENDING: enhance to filter by index rather than create new data
- transform:function(t){for(
- // [Caveat] Fail-Fast:
- // Do not return the whole dataset unless user config indicates it explicitly.
- // For example, if no condition is specified by mistake, returning an empty result
- // is better than returning the entire raw source for the user to find the mistake.
- var e,n,i,o=t.upstream,a=(n=t.config,i={valueGetterAttrMap:r({dimension:!0}),prepareGetValue:function(t){var e=t.dimension;N(t,"dimension")||vn("");var n=o.getDimensionInfo(e);return n||vn(""),{dimIdx:n.index}},getValue:function(t){return o.retrieveValueFromItem(e,t.dimIdx)}},new AR(n,i)),s=[],l=0,u=o.count();l<u;l++)e=o.getRawDataItem(l),a.evaluate()&&s.push(e);return{data:s}}},kR={type:"echarts:sort",transform:function(t){var e=t.upstream,n=t.config,i="",o=Sn(n);o.length||vn(i);var r=[];a(o,(function(t){var n=t.dimension,o=t.order,a=t.parser,s=t.incomparable;if(null==n&&vn(i),"asc"!==o&&"desc"!==o&&vn(i),s&&"min"!==s&&"max"!==s){vn("")}if("asc"!==o&&"desc"!==o){vn("")}var l=e.getDimensionInfo(n);l||vn(i);var u=a?xl(a):null;a&&!u&&vn(i),r.push({dimIdx:l.index,parser:u,comparator:new Sl(o,s)})}));
- // TODO: support it?
- var s=e.sourceFormat;s!==Na&&s!==Oa&&vn(i);
- // Other upstream format are all array.
- for(var l=[],u=0,c=e.count();u<c;u++)l.push(e.getRawDataItem(u));return l.sort((function(t,n){for(var i=0;i<r.length;i++){var o=r[i],a=e.retrieveValueFromItem(t,o.dimIdx),s=e.retrieveValueFromItem(n,o.dimIdx);o.parser&&(a=o.parser(a),s=o.parser(s));var l=o.comparator.evaluate(a,s);if(0!==l)return l}return 0})),{data:l}}};var PR=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataset",e}return Ue(e,t),e.prototype.init=function(e,n,i){t.prototype.init.call(this,e,n,i),this._sourceManager=new Yl(this),Ul(this)},e.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),Ul(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:za},e}(Ta),NR=/** @class */function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataset",e}return Ue(e,t),e.type="dataset",e}(Mu);function OR(t){t.registerComponentModel(PR),t.registerComponentView(NR)}function RR(t){return i(t[0])}function ER(t,e){for(var n=[],i=t.length,o=0;o<i;o++)n.push({one:t[o],many:[]});for(o=0;o<e.length;o++){var r=e[o].length,a=void 0;for(a=0;a<r;a++)n[a%i].many.push(e[o][a])}var s=0;
- // If one has more paths than each one of many. average them.
- for(o=i-1;o>=0;o--)if(!n[o].many.length){var l=n[s].many;if(l.length<=1){
- // Not enough
- // Start from the first one.
- if(!s)return n;s=0}r=l.length;var u=Math.ceil(r/2);n[o].many=l.slice(u,r),n[s].many=l.slice(0,u),s++}return n}var VR={clone:function(t){for(var e=[],n=1-Math.pow(1-t.path.style.opacity,1/t.count),i=0
- // Fitting the alpha
- ;i<t.count;i++){var o=ze(t.path);o.setStyle("opacity",n),e.push(o)}return e},
- // Use the default divider
- split:null};function zR(t,e,n,i,o,r){if(t.length&&e.length){var a=eo("update",i,o);if(a&&a.duration>0){var s,l,u=i.getModel("universalTransition").get("delay"),c=Object.assign({
- // Need to setToFinal so the further calculation based on the style can be correct.
- // Like emphasis color.
- setToFinal:!0},a);RR(t)&&(
- // manyToOne
- s=t,l=e),RR(e)&&(
- // oneToMany
- s=e,l=t);for(var d=s?s===t:t.length>e.length,h=s?ER(l,s):ER(d?e:t,[d?t:e]),p=0,f=0;f<h.length;f++)p+=h[f].many.length;var g=0;for(f=0;f<h.length;f++)y(h[f],d,g,p),g+=h[f].many.length}}function y(t,e,i,o,a){var s=t.many,l=t.one;if(1!==s.length||a)for(var d=I({dividePath:VR[n],individualDelay:u&&function(t,e,n,r){return u(t+i,o)}},c),h=e?Ee(s,l,d):Ve(l,s,d),p=h.fromIndividuals,f=h.toIndividuals,g=p.length,m=0;m<g;m++){_=u?I({delay:u(m,g)},c):c;r(p[m],f[m],e?s[m]:t.one,e?t.one:s[m],_)}else{
- // Is one to one
- var v=e?s[0]:l,x=e?l:s[0];if(Oe(v))
- // Keep doing combine animation.
- y({many:[v],one:x},!0,i,o,!0);else{var _=u?I({delay:u(i,o)},c):c;Re(v,x,_),r(v,x,v,x,_)}}}}function BR(t){if(!t)return[];if(i(t)){for(var e=[],n=0;n<t.length;n++)e.push(BR(t[n]));return e}var o=[];return t.traverse((function(t){t instanceof g&&!t.disableMorphing&&!t.invisible&&!t.ignore&&o.push(t)})),o}var GR=On();function FR(t,e,n,i){
- // try to get groupId from encode
- var o=function(t,e){for(var n=t.dimensions,i=0;i<n.length;i++){var o=t.getDimensionInfo(n[i]);if(o&&0===o.otherDims[e])return n[i]}}
- // get value by dimension. (only get value of itemGroupId or childGroupId, so convert it to string)
- (t,i?"itemChildGroupId":"itemGroupId");if(o){var r=function(t,e,n){var i=t.getDimensionInfo(n),o=i&&i.ordinalMeta;if(i){var r=t.get(i.name,e);return o&&o.categories[r]||r+""}}(t,e,o);return r}
- // try to get groupId from raw data item
- var a=t.getRawDataItem(e),s=i?"childGroupId":"groupId";return a&&a[s]?a[s]+"":
- // fallback
- i?void 0:n||t.getId(e)}
- // flatten all data items from different serieses into one arrary
- function WR(t){var e=[];return a(t,(function(t){var n=t.data,i=t.dataGroupId;if(!(n.count()>1e4))for(var o=n.getIndices(),r=0;r<o.length;r++)e.push({data:n,groupId:FR(n,r,i,!1),childGroupId:FR(n,r,i,!0),divide:t.divide,dataIndex:r})})),e}function HR(t,e,n){t.traverse((function(t){t instanceof g&&
- // TODO use fade in animation for target element.
- oo(t,{style:{opacity:0}},e,{dataIndex:n,isFrom:!0})}))}function YR(t){if(t.parent){
- // Bake parent transform to element.
- // So it can still have proper transform to transition after it's removed.
- var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function UR(t){t.stopAnimation(),t.isGroup&&t.traverse((function(t){t.stopAnimation()}))}function ZR(t,e,n){var i=eo("update",n,e);i&&t.traverse((function(t){if(t instanceof $t){var e=function(t){return to(t).oldStyle}(t);e&&t.animateFrom({style:e},i)}}))}function XR(t,e,i){var o=WR(t),s=WR(e);function l(t,e,n,i,o){(n||t)&&e.animateFrom({style:n&&n!==t?p(p({},n.style),t.style):t.style},o)}var u=!1,c=0,d=r(),h=r();
- /**
- * With groupId and childGroupId, we can build parent-child relationships between dataItems.
- * However, we should mind the parent-child "direction" between old and new options.
- *
- * For example, suppose we have two dataItems from two series.data:
- *
- * dataA: [ dataB: [
- * { {
- * value: 5, value: 3,
- * groupId: 'creatures', groupId: 'animals',
- * childGroupId: 'animals' childGroupId: 'dogs'
- * }, },
- * ... ...
- * ] ]
- *
- * where dataA is belong to optionA and dataB is belong to optionB.
- *
- * When we `setOption(optionB)` from optionA, we choose childGroupId of dataItemA and groupId of
- * dataItemB as keys so the two keys are matched (both are 'animals'), then universalTransition
- * will work. This derection is "parent -> child".
- *
- * If we `setOption(optionA)` from optionB, we also choose groupId of dataItemB and childGroupId
- * of dataItemA as keys and universalTransition will work. This derection is "child -> parent".
- *
- * If there is no childGroupId specified, which means no multiLevelDrillDown/Up is needed and no
- * parent-child relationship exists. This direction is "none".
- *
- * So we need to know whether to use groupId or childGroupId as the key when we call the keyGetter
- * functions. Thus, we need to decide the direction first.
- *
- * The rule is:
- *
- * if (all childGroupIds in oldDiffItems and all groupIds in newDiffItems have common value) {
- * direction = 'parent -> child';
- * } else if (all groupIds in oldDiffItems and all childGroupIds in newDiffItems have common value) {
- * direction = 'child -> parent';
- * } else {
- * direction = 'none';
- * }
- */o.forEach((function(t){t.groupId&&d.set(t.groupId,!0),t.childGroupId&&h.set(t.childGroupId,!0)}));
- // traverse newDiffItems and decide the direction according to the rule
- for(var f=0;f<s.length;f++){var y=s[f].groupId;if(h.get(y)){c=1;break}var m=s[f].childGroupId;if(m&&d.get(m)){c=2;break}}function v(t,e){return function(n){var i=n.data,o=n.dataIndex;
- // TODO if specified dim
- return e?i.getId(o):t?1===c?n.childGroupId:n.groupId:2===c?n.childGroupId:n.groupId}}
- // Use id if it's very likely to be an one to one animation
- // It's more robust than groupId
- // TODO Check if key dimension is specified.
- var x=function(t,e){var n=t.length;if(n!==e.length)return!1;for(var i=0;i<n;i++){var o=t[i],r=e[i];if(o.data.getId(o.dataIndex)!==r.data.getId(r.dataIndex))return!1}return!0}(o,s),_={};if(!x)
- // We may have different diff strategy with basicTransition if we use other dimension as key.
- // If so, we can't simply check if oldEl is same with newEl. We need a map to check if oldEl is still being used in the new chart.
- // We can't use the elements that already being morphed. Let it keep it's original basic transition.
- for(f=0;f<s.length;f++){var b=s[f],S=b.data.getItemGraphicEl(b.dataIndex);S&&(_[S.id]=!0)}function w(t,e){var n=o[e],i=s[t],r=i.data.hostModel,a=n.data.getItemGraphicEl(n.dataIndex),c=i.data.getItemGraphicEl(i.dataIndex);
- // Can't handle same elements.
- a!==c?
- // We can't use the elements that already being morphed
- a&&_[a.id]||c&&(
- // TODO: If keep animating the group in case
- // some of the elements don't want to be morphed.
- // TODO Label?
- UR(c),a?(UR(a),
- // If old element is doing leaving animation. stop it and remove it immediately.
- YR(a),u=!0,zR(BR(a),BR(c),i.divide,r,t,l)):HR(c,r,t)):c&&ZR(c,i.dataIndex,r)}new yh(o,s,v(!0,x),v(!1,x),null,"multiple").update(w).updateManyToOne((function(t,e){var i=s[t],r=i.data,c=r.hostModel,d=r.getItemGraphicEl(i.dataIndex),h=st(n(e,(function(t){return o[t].data.getItemGraphicEl(o[t].dataIndex)})),(function(t){return t&&t!==d&&!_[t.id]}));d&&(UR(d),h.length?(
- // If old element is doing leaving animation. stop it and remove it immediately.
- a(h,(function(t){UR(t),YR(t)})),u=!0,zR(BR(h),BR(d),i.divide,c,t,l)):HR(d,c,i.dataIndex));
- // else keep oldEl leaving animation.
- })).updateOneToMany((function(t,e){var i=o[e],r=i.data.getItemGraphicEl(i.dataIndex);
- // We can't use the elements that already being morphed
- if(!r||!_[r.id]){var c=st(n(t,(function(t){return s[t].data.getItemGraphicEl(s[t].dataIndex)})),(function(t){return t&&t!==r})),d=s[t[0]].data.hostModel;c.length&&(a(c,(function(t){return UR(t)})),r?(UR(r),
- // If old element is doing leaving animation. stop it and remove it immediately.
- YR(r),u=!0,zR(BR(r),BR(c),i.divide,
- // Use divide on old.
- d,t[0],l)):a(c,(function(e){return HR(e,d,t[0])})));
- // else keep oldEl leaving animation.
- }})).updateManyToMany((function(t,e){
- // If two data are same and both have groupId.
- // Normally they should be diff by id.
- new yh(e,t,(function(t){return o[t].data.getId(o[t].dataIndex)}),(function(t){return s[t].data.getId(s[t].dataIndex)})).update((function(n,i){
- // Use the original index
- w(t[n],e[i])})).execute()})).execute(),u&&a(e,(function(t){var e=t.data.hostModel,n=e&&i.getViewOfSeriesModel(e),o=eo("update",e,0);// use 0 index.
- n&&e.isAnimationEnabled()&&o&&o.duration>0&&n.group.traverse((function(t){t instanceof g&&!t.animators.length&&
- // We can't accept there still exists element that has no animation
- // if universalTransition is enabled
- t.animateFrom({style:{opacity:0}},o)}))}))}function jR(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function qR(t){return i(t)?t.sort().join(","):t}function KR(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function JR(t,e){for(var n=0;n<t.length;n++){if(null!=e.seriesIndex&&e.seriesIndex===t[n].seriesIndex||null!=e.seriesId&&e.seriesId===t[n].id)return n}}
- // -----------------
- // Render engines
- // -----------------
- // Render via Canvas.
- // echarts.init(dom, null, { renderer: 'canvas' })
- hh([Ng]),
- // Render via SVG.
- // echarts.init(dom, null, { renderer: 'svg' })
- hh([function(t){t.registerPainter("svg",Vt)}]),
- // ----------------
- // Charts (series)
- // ----------------
- // All of the series types, for example:
- // chart.setOption({
- // series: [{
- // type: 'line' // or 'bar', 'pie', ...
- // }]
- // });
- hh([function(t){t.registerChartView(yy),t.registerSeriesModel(Og),t.registerLayout(my("line",!0)),t.registerVisual({seriesType:"line",reset:function(t){var e=t.getData(),n=t.getModel("lineStyle").getLineStyle();
- // Visual coding for legend
- n&&!n.stroke&&(
- // Fill in visual should be palette color if
- // has color callback
- n.stroke=e.getVisual("style").fill),e.setVisual("legendLineStyle",n)}}),
- // Down sample after filter
- t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,_y("line"))},function(t){t.registerChartView(jy),t.registerSeriesModel(wy),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,rt(Dp,"bar")),
- // Do layout after other overall layout, which can prepare some information.
- t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Tp("bar")),
- // Down sample after filter
- t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,_y("bar")),
- /**
- * @payload
- * @property {string} [componentType=series]
- * @property {number} [dx]
- * @property {number} [dy]
- * @property {number} [zoom]
- * @property {number} [originX]
- * @property {number} [originY]
- */
- t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(t,e){var n=t.componentType||"series";e.eachComponent({mainType:n,query:t},(function(e){t.sortInfo&&e.axis.setCategorySortInfo(t.sortInfo)}))}))},function(t){t.registerChartView(lm),t.registerSeriesModel(pm),Ac("pie",t.registerAction),t.registerLayout(rt(Qy,"pie")),t.registerProcessor(em("pie")),t.registerProcessor(function(t){return{seriesType:t,reset:function(t,e){var n=t.getData();n.filterSelf((function(t){
- // handle negative value condition
- var e=n.mapDimension("value"),i=n.get(e,t);return!(l(i)&&!isNaN(i)&&i<0)}))}}}("pie"))},function(t){
- // In case developer forget to include grid component
- hh(vv),t.registerSeriesModel(fm),t.registerChartView(xm),t.registerLayout(my("scatter"))},function(t){hh(zv),t.registerChartView(Mv),t.registerSeriesModel(Dv),t.registerLayout(xv),t.registerProcessor(em("radar")),t.registerPreprocessor(Sv)},function(t){hh(Jx),t.registerChartView(Cx),t.registerSeriesModel(Lx),t.registerLayout(Px),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,kx),Ac("map",t.registerAction)},function(t){t.registerChartView(y_),t.registerSeriesModel(O_),t.registerLayout(E_),t.registerVisual(V_),function(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},(function(e){var n=t.dataIndex,i=e.getData().tree.getNodeByDataIndex(n);i.isExpand=!i.isExpand}))})),t.registerAction({type:"treeRoam",event:"treeRoam",
- // Here we set 'none' instead of 'update', because roam action
- // just need to update the transform matrix without having to recalculate
- // the layout. So don't need to go through the whole update process, such
- // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on.
- update:"none"},(function(t,e,n){e.eachComponent({mainType:"series",subType:"tree",query:t},(function(e){var i=jx(e.coordinateSystem,t,void 0,n);e.setCenter&&e.setCenter(i.center),e.setZoom&&e.setZoom(i.zoom)}))}))}(t)},function(t){t.registerSeriesModel(F_),t.registerChartView(eb),t.registerVisual(xb),t.registerLayout(Pb),function(t){for(var e=0;e<z_.length;e++)t.registerAction({type:z_[e],update:"updateView"},dt);t.registerAction({type:"treemapRootToNode",update:"updateView"},(function(t,e){e.eachComponent({mainType:"series",subType:"treemap",query:t},(function(e,n){var i=A_(t,["treemapZoomToNode","treemapRootToNode"],e);if(i){var o=e.getViewRoot();o&&(t.direction=k_(o,i.node)?"rollUp":"drillDown"),e.resetViewRoot(i.node)}}))}))}(t)},function(t){t.registerChartView(RS),t.registerSeriesModel(YS),t.registerProcessor(zb),t.registerVisual(Bb),t.registerVisual(Fb),t.registerLayout(Jb),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,rS),t.registerLayout(sS),t.registerCoordinateSystem("graphView",{dimensions:Ex.dimensions,create:lS}),
- // Register legacy focus actions
- t.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},dt),t.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},dt),
- // Register roam action.
- t.registerAction(US,(function(t,e,n){e.eachComponent({mainType:"series",query:t},(function(e){var i=jx(e.coordinateSystem,t,void 0,n);e.setCenter&&e.setCenter(i.center),e.setZoom&&e.setZoom(i.zoom)}))}))},function(t){t.registerChartView(KS),t.registerSeriesModel(JS)},function(t){t.registerChartView(tw),t.registerSeriesModel(nw),t.registerLayout(iw),t.registerProcessor(em("funnel"))},function(t){hh(RM),t.registerChartView(uw),t.registerSeriesModel(dw),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,pw)},function(t){t.registerChartView(GM),t.registerSeriesModel(WM),t.registerLayout(HM),t.registerVisual(eI),t.registerAction({type:"dragNode",event:"dragnode",
- // here can only use 'update' now, other value is not support in echarts.
- update:"update"},(function(t,e){e.eachComponent({mainType:"series",subType:"sankey",query:t},(function(e){e.setNodePosition(t.dataIndex,[t.localX,t.localY])}))}))},function(t){t.registerSeriesModel(oI),t.registerChartView(dI),t.registerLayout(pI),t.registerTransform(fI)},function(t){t.registerChartView(RI),t.registerSeriesModel(VI),t.registerPreprocessor(zI),t.registerVisual(SI),t.registerLayout(FI)},function(t){t.registerChartView(UI),t.registerSeriesModel(ZI),t.registerLayout(my("effectScatter"))},function(t){t.registerChartView(oD),t.registerSeriesModel(uD),t.registerLayout(iD),t.registerVisual(dD)},function(t){t.registerChartView(yD),t.registerSeriesModel(mD)},function(t){t.registerChartView(zD),t.registerSeriesModel(BD),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,rt(Dp,"pictorialBar")),
- // Do layout after other overall layout, which can prepare some information.
- t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Tp("pictorialBar"))},function(t){t.registerChartView(FD),t.registerSeriesModel(HD),t.registerLayout(YD),t.registerProcessor(em("themeRiver"))},function(t){t.registerChartView(JD),t.registerSeriesModel(QD),t.registerLayout(rt(eT,"sunburst")),t.registerProcessor(rt(em,"sunburst")),t.registerVisual(iT),function(t){t.registerAction({type:jD,update:"updateView"},(function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},(function(e,n){var i=A_(t,[jD],e);if(i){var o=e.getViewRoot();o&&(t.direction=k_(o,i.node)?"rollUp":"drillDown"),e.resetViewRoot(i.node)}}))})),t.registerAction({type:qD,update:"none"},(function(t,e,n){
- // Clone
- t=p({},t),e.eachComponent({mainType:"series",subType:"sunburst",query:t},(function(e){var n=A_(t,[qD],e);n&&(t.dataIndex=n.node.dataIndex)}
- // Fast forward action
- )),n.dispatchAction(p(t,{type:"highlight"}))})),t.registerAction({type:"sunburstUnhighlight",update:"updateView"},(function(t,e,n){t=p({},t),n.dispatchAction(p(t,{type:"downplay"}))}))}(t)},function(t){t.registerChartView(jT),t.registerSeriesModel(sT)}]),
- // -------------------
- // Coordinate systems
- // -------------------
- // All of the axis modules have been included in the
- // coordinate system module below, do not need to
- // make extra import.
- // `cartesian` coordinate system. For some historical
- // reasons, it is named as grid, for example:
- // chart.setOption({
- // grid: {...},
- // xAxis: {...},
- // yAxis: {...},
- // series: [{...}]
- // });
- hh((function(t){hh(vv),hh($C)})),
- // `polar` coordinate system, for example:
- // chart.setOption({
- // polar: {...},
- // radiusAxis: {...},
- // angleAxis: {...},
- // series: [{
- // coordinateSystem: 'polar'
- // }]
- // });
- hh((function(t){hh($C),av.registerAxisPointerClass("PolarAxisPointer",eA),t.registerCoordinateSystem("polar",vA),t.registerComponentModel(nA),t.registerComponentView(EA),
- // Model and view for angleAxis and radiusAxis
- Tm(t,"angle",oA,OA),Tm(t,"radius",rA,RA),t.registerComponentView(IA),t.registerComponentView(LA),t.registerLayout(rt(NA,"bar"))})),
- // `geo` coordinate system, for example:
- // chart.setOption({
- // geo: {...},
- // series: [{
- // coordinateSystem: 'geo'
- // }]
- // });
- hh(Jx),
- // `singleAxis` coordinate system (notice, it is a coordinate system
- // with only one axis, work for chart like theme river), for example:
- // chart.setOption({
- // singleAxis: {...}
- // series: [{type: 'themeRiver', ...}]
- // });
- hh((function(t){hh($C),av.registerAxisPointerClass("SingleAxisPointer",iL),t.registerComponentView(oL),
- // Axis
- t.registerComponentView(WA),t.registerComponentModel(YA),Tm(t,"single",YA,YA.defaultOption),t.registerCoordinateSystem("single",KA)})),
- // `parallel` coordinate system, only work for parallel series, for example:
- // chart.setOption({
- // parallel: {...},
- // parallelAxis: [{...}, ...],
- // series: [{
- // type: 'parallel'
- // }]
- // });
- hh(RM),
- // `calendar` coordinate system. for example,
- // chart.setOption({
- // calendar: {...},
- // series: [{
- // coordinateSystem: 'calendar'
- // }]
- // );
- hh((function(t){t.registerComponentModel(aL),t.registerComponentView(lL),t.registerCoordinateSystem("calendar",hL)})),
- // ------------------
- // Other components
- // ------------------
- // `graphic` component, for example:
- // chart.setOption({
- // graphic: {...}
- // });
- hh((function(t){t.registerComponentModel(mL),t.registerComponentView(_L),t.registerPreprocessor((function(t){var e=t.graphic;
- // Convert
- // {graphic: [{left: 10, type: 'circle'}, ...]}
- // or
- // {graphic: {left: 10, type: 'circle'}}
- // to
- // {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]}
- i(e)?e[0]&&e[0].elements?
- // Only one graphic instance can be instantiated. (We don't
- // want that too many views are created in echarts._viewMap.)
- t.graphic=[t.graphic[0]]:t.graphic=[{elements:e}]:e&&!e.elements&&(t.graphic=[{elements:[e]}])}))})),
- // `toolbox` component, for example:
- // chart.setOption({
- // toolbox: {...}
- // });
- hh((function(t){t.registerComponentModel(qL),t.registerComponentView($L),XL("saveAsImage",QL),XL("magicType",ok),XL("dataView",hk),XL("dataZoom",zk),XL("restore",mk),hh(YL)})),
- // `tooltip` component, for example:
- // chart.setOption({
- // tooltip: {...}
- // });
- hh((function(t){hh($C),t.registerComponentModel(Bk),t.registerComponentView(lP),
- /**
- * @action
- * @property {string} type
- * @property {number} seriesIndex
- * @property {number} dataIndex
- * @property {number} [x]
- * @property {number} [y]
- */
- t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},dt),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},dt)})),
- // `axisPointer` component, for example:
- // chart.setOption({
- // tooltip: {axisPointer: {...}, ...}
- // });
- // Or
- // chart.setOption({
- // axisPointer: {...}
- // });
- hh($C),
- // `brush` component, for example:
- // chart.setOption({
- // brush: {...}
- // });
- // Or
- // chart.setOption({
- // tooltip: {feature: {brush: {...}}
- // })
- hh((function(t){t.registerComponentView(TP),t.registerComponentModel(AP),t.registerPreprocessor(cP),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,SP),t.registerAction({type:"brush",event:"brush",update:"updateVisual"},(function(t,e){e.eachComponent({mainType:"brush",query:t},(function(e){e.setAreas(t.areas)}))})),
- /**
- * payload: {
- * brushComponents: [
- * {
- * brushId,
- * brushIndex,
- * brushName,
- * series: [
- * {
- * seriesId,
- * seriesIndex,
- * seriesName,
- * rawIndices: [21, 34, ...]
- * },
- * ...
- * ]
- * },
- * ...
- * ]
- * }
- */
- t.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},dt),t.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},dt),XL("brush",kP)})),
- // `title` component, for example:
- // chart.setOption({
- // title: {...}
- // });
- hh((function(t){t.registerComponentModel(PP),t.registerComponentView(NP)})),
- // `timeline` component, for example:
- // chart.setOption({
- // timeline: {...}
- // });
- hh((function(t){t.registerComponentModel(VP),t.registerComponentView(ZP),t.registerSubTypeDefaulter("timeline",(function(){
- // Only slider now.
- return"slider"})),function(t){t.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},(function(t,e,n){var i=e.getComponent("timeline");return i&&null!=t.currentIndex&&(i.setCurrentIndex(t.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.getPlayState()&&(i.setPlayState(!1),
- // The timeline has played to the end, trigger event
- n.dispatchAction({type:"timelinePlayChange",playState:!1,from:t.from}))),
- // Set normalized currentIndex to payload.
- e.resetOption("timeline",{replaceMerge:i.get("replaceMerge",!0)}),I({currentIndex:i.option.currentIndex},t)})),t.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},(function(t,e){var n=e.getComponent("timeline");n&&null!=t.playState&&n.setPlayState(t.playState)}))}(t),t.registerPreprocessor(XP)})),
- // `markPoint` component, for example:
- // chart.setOption({
- // series: [{markPoint: {...}}]
- // });
- hh((function(t){t.registerComponentModel(eN),t.registerComponentView(fN),t.registerPreprocessor((function(t){KP(t.series,"markPoint")&&(
- // Make sure markPoint component is enabled
- t.markPoint=t.markPoint||{})}))})),
- // `markLine` component, for example:
- // chart.setOption({
- // series: [{markLine: {...}}]
- // });
- hh((function(t){t.registerComponentModel(gN),t.registerComponentView(SN),t.registerPreprocessor((function(t){KP(t.series,"markLine")&&(
- // Make sure markLine component is enabled
- t.markLine=t.markLine||{})}))})),
- // `markArea` component, for example:
- // chart.setOption({
- // series: [{markArea: {...}}]
- // });
- hh((function(t){t.registerComponentModel(wN),t.registerComponentView(PN),t.registerPreprocessor((function(t){KP(t.series,"markArea")&&(
- // Make sure markArea component is enabled
- t.markArea=t.markArea||{})}))})),
- // `legend` component not scrollable. for example:
- // chart.setOption({
- // legend: {...}
- // });
- hh((function(t){hh(XN),hh(eO)})),
- // `dataZoom` component including both `dataZoomInside` and `dataZoomSlider`.
- hh((function(t){hh(pO),hh(wO)})),
- // `dataZoom` component providing drag, pinch, wheel behaviors
- // inside coordinate system, for example:
- // chart.setOption({
- // dataZoom: {type: 'inside'}
- // });
- hh(pO),
- // `dataZoom` component providing a slider bar, for example:
- // chart.setOption({
- // dataZoom: {type: 'slider'}
- // });
- hh(wO),
- // `visualMap` component including both `visualMapContinuous` and `visualMapPiecewise`.
- hh((function(t){hh(sR),hh(pR)})),
- // `visualMap` component providing continuous bar, for example:
- // chart.setOption({
- // visualMap: {type: 'continuous'}
- // });
- hh(sR),
- // `visualMap` component providing pieces bar, for example:
- // chart.setOption({
- // visualMap: {type: 'piecewise'}
- // });
- hh(pR),
- // `aria` component providing aria, for example:
- // chart.setOption({
- // aria: {...}
- // });
- hh((function(t){t.registerPreprocessor(vR),t.registerVisual(t.PRIORITY.VISUAL.ARIA,mR)})),
- // dataset transform
- // chart.setOption({
- // dataset: {
- // transform: []
- // }
- // });
- hh((function(t){t.registerTransform(LR),t.registerTransform(kR)})),hh(OR),
- // universal transition
- // chart.setOption({
- // series: {
- // universalTransition: { enabled: true }
- // }
- // })
- hh((function(t){t.registerUpdateLifecycle("series:beforeupdate",(function(t,e,n){a(Sn(n.seriesTransition),(function(t){a(Sn(t.to),(function(t){for(var e=n.updatedSeries,i=0;i<e.length;i++)(null!=t.seriesIndex&&t.seriesIndex===e[i].seriesIndex||null!=t.seriesId&&t.seriesId===e[i].id)&&(e[i][pu]=!0)}))}))})),t.registerUpdateLifecycle("series:transition",(function(t,e,n){
- // TODO api provide an namespace that can save stuff per instance
- var o=GR(e);
- // TODO multiple to multiple series.
- if(o.oldSeries&&n.updatedSeries&&n.optionChanged){
- // TODO transitionOpt was used in an old implementation and can be removed now
- // Use give transition config if its' give;
- var s=n.seriesTransition;if(s)a(Sn(s),(function(t){!function(t,e,n,i){var o=[],r=[];a(Sn(t.from),(function(t){var n=JR(e.oldSeries,t);n>=0&&o.push({dataGroupId:e.oldDataGroupIds[n],data:e.oldData[n],
- // TODO can specify divideShape in transition.
- divide:KR(e.oldData[n]),groupIdDim:t.dimension})})),a(Sn(t.to),(function(t){var i=JR(n.updatedSeries,t);if(i>=0){var o=n.updatedSeries[i].getData();r.push({dataGroupId:e.oldDataGroupIds[i],data:o,divide:KR(o),groupIdDim:t.dimension})}})),o.length>0&&r.length>0&&XR(o,r,i)}(t,o,n,e)}));else{
- // Else guess from series based on transition series key.
- var l=function(t,e){var n=r(),o=r(),s=r();return a(t.oldSeries,(function(e,n){var r=t.oldDataGroupIds[n],l=t.oldData[n],u=jR(e),c=qR(u);o.set(c,{dataGroupId:r,data:l}),i(u)&&
- // Same key can't in different array seriesKey.
- a(u,(function(t){s.set(t,{key:c,dataGroupId:r,data:l})}))})),a(e.updatedSeries,(function(t){if(t.isUniversalTransitionEnabled()&&t.isAnimationEnabled()){var e=t.get("dataGroupId"),r=t.getData(),l=jR(t),u=qR(l),c=o.get(u);
- // string transition key is the best match.
- if(c)
- // TODO check if data is same?
- n.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:KR(c.data),data:c.data}],newSeries:[{dataGroupId:e,divide:KR(r),data:r}]});else
- // Transition from multiple series.
- // e.g. 'female', 'male' -> ['female', 'male']
- if(i(l)){var d=[];a(l,(function(t){var e=o.get(t);e.data&&d.push({dataGroupId:e.dataGroupId,divide:KR(e.data),data:e.data})})),d.length&&n.set(u,{oldSeries:d,newSeries:[{dataGroupId:e,data:r,divide:KR(r)}]})}else{
- // Try transition to multiple series.
- // e.g. ['female', 'male'] -> 'female', 'male'
- var h=s.get(l);if(h){var p=n.get(h.key);p||(p={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:KR(h.data)}],newSeries:[]},n.set(h.key,p)),p.newSeries.push({dataGroupId:e,data:r,divide:KR(r)})}}}})),n}(o,n);a(l.keys(),(function(t){var n=l.get(t);XR(n.oldSeries,n.newSeries,e)}))}
- // Reset
- a(n.updatedSeries,(function(t){
- // Reset;
- t[pu]&&(t[pu]=!1)}))}
- // Save all series of current update. Not only the updated one.
- for(var u=t.getSeries(),c=o.oldSeries=[],d=o.oldDataGroupIds=[],h=o.oldData=[],p=0;p<u.length;p++){var f=u[p].getData();
- // Only save the data that can have transition.
- // Avoid large data costing too much extra memory
- f.count()<1e4&&(c.push(u[p]),d.push(u[p].get("dataGroupId")),h.push(f))}}))})),
- // label layout
- // chart.setOption({
- // series: {
- // labelLayout: { hideOverlap: true }
- // }
- // })
- hh(Pg);const $R=Object.freeze(Object.defineProperty({__proto__:null,Axis:Yf,ChartView:Ou,ComponentModel:Ta,ComponentView:Mu,List:Fh,Model:yr,PRIORITY:ed,SeriesModel:Su,color:Be,connect:function(t){
- // Is array of charts
- if(i(t)){var e=t;t=null,
- // If any chart has group
- a(e,(function(e){null!=e.group&&(t=e.group)})),t=t||"g_"+Hd++,a(e,(function(e){e.group=t}))}return Fd[t]=!0,t},dataTool:{},dependencies:{zrender:"5.6.1"},disConnect:Xd,disconnect:Zd,dispose:function(e){t(e)?e=Gd[e]:e instanceof Ld||(
- // Try to treat as dom
- e=jd(e)),e instanceof Ld&&!e.isDisposed()&&e.dispose()},env:d,extendChartView:Zf,extendComponentModel:function(t){var e=Ta.extend(t);return Ta.registerClass(e),e},extendComponentView:function(t){var e=Mu.extend(t);return Mu.registerClass(e),e},extendSeriesModel:Uf,format:Af,getCoordinateSystemDimensions:function(t){var e=fs.get(t);if(e)return e.getDimensionsInfo?e.getDimensionsInfo():e.dimensions.slice()},getInstanceByDom:jd,getInstanceById:function(t){return Gd[t]},getMap:function(t){var e=$c("getMap");return e&&e(t)},graphic:Cf,helper:ff,init:Ud,innerDrawElementOnCanvas:yt,matrix:Ge,number:Df,parseGeoJSON:If,parseGeoJson:If,registerAction:eh,registerCoordinateSystem:nh,registerLayout:ih,registerLoading:sh,registerLocale:Dr,registerMap:lh,registerPostInit:$d,registerPostUpdate:Qd,registerPreprocessor:Kd,registerProcessor:Jd,registerTheme:qd,registerTransform:uh,registerUpdateLifecycle:th,registerVisual:oh,setCanvasCreator:function(t){_t({createCanvas:t})},setPlatformAPI:_t,throttle:zu,time:Tf,use:hh,util:Lf,vector:Fe,version:"5.6.0",zrUtil:We,zrender:He},Symbol.toStringTag,{value:"Module"}));
- // Default to have canvas renderer and dataset for compitatble reason.
- hh([Ng,OR]),hh(Pg);export{Fh as S,fo as a,Zf as b,Wh as c,Yi as d,Uf as e,pf as f,Gc as g,$R as h,oo as i,Ud as j,xo as m,je as p,io as u};
- //# sourceMappingURL=echarts-a77f8af6.js.map
|