1ca78d69a5e3de3d36fb888200837bbbefa94662c5363e31f784cfa54018bdc373ff87b6a53c8abf40bc148af47938cc995c83f88b78db5a81a8f094faf965 380 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887
  1. interface GradientObject {
  2. id?: number;
  3. type: string;
  4. colorStops: GradientColorStop[];
  5. global?: boolean;
  6. }
  7. interface GradientColorStop {
  8. offset: number;
  9. color: string;
  10. }
  11. declare class Gradient {
  12. id?: number;
  13. type: string;
  14. colorStops: GradientColorStop[];
  15. global: boolean;
  16. constructor(colorStops: GradientColorStop[]);
  17. addColorStop(offset: number, color: string): void;
  18. }
  19. interface RadialGradientObject extends GradientObject {
  20. type: 'radial';
  21. x: number;
  22. y: number;
  23. r: number;
  24. }
  25. declare class RadialGradient extends Gradient {
  26. type: 'radial';
  27. x: number;
  28. y: number;
  29. r: number;
  30. constructor(x: number, y: number, r: number, colorStops?: GradientColorStop[], globalCoord?: boolean);
  31. }
  32. interface LinearGradientObject extends GradientObject {
  33. type: 'linear';
  34. x: number;
  35. y: number;
  36. x2: number;
  37. y2: number;
  38. }
  39. declare class LinearGradient extends Gradient {
  40. type: 'linear';
  41. x: number;
  42. y: number;
  43. x2: number;
  44. y2: number;
  45. constructor(x: number, y: number, x2: number, y2: number, colorStops?: GradientColorStop[], globalCoord?: boolean);
  46. }
  47. declare type Dictionary<T> = {
  48. [key: string]: T;
  49. };
  50. declare type ArrayLike$1<T> = {
  51. [key: number]: T;
  52. length: number;
  53. };
  54. declare type ImageLike = HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
  55. declare type TextVerticalAlign = 'top' | 'middle' | 'bottom';
  56. declare type TextAlign = 'left' | 'center' | 'right';
  57. declare type FontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' | number;
  58. declare type FontStyle = 'normal' | 'italic' | 'oblique';
  59. declare type BuiltinTextPosition = 'left' | 'right' | 'top' | 'bottom' | 'inside' | 'insideLeft' | 'insideRight' | 'insideTop' | 'insideBottom' | 'insideTopLeft' | 'insideTopRight' | 'insideBottomLeft' | 'insideBottomRight';
  60. declare type ZREventProperties = {
  61. zrX: number;
  62. zrY: number;
  63. zrDelta: number;
  64. zrEventControl: 'no_globalout' | 'only_globalout';
  65. zrByTouch: boolean;
  66. };
  67. declare type ZRRawMouseEvent = MouseEvent & ZREventProperties;
  68. declare type ZRRawTouchEvent = TouchEvent & ZREventProperties;
  69. declare type ZRRawPointerEvent = TouchEvent & ZREventProperties;
  70. declare type ZRRawEvent = ZRRawMouseEvent | ZRRawTouchEvent | ZRRawPointerEvent;
  71. declare type ElementEventName = 'click' | 'dblclick' | 'mousewheel' | 'mouseout' | 'mouseover' | 'mouseup' | 'mousedown' | 'mousemove' | 'contextmenu' | 'drag' | 'dragstart' | 'dragend' | 'dragenter' | 'dragleave' | 'dragover' | 'drop' | 'globalout';
  72. declare type ElementEventNameWithOn = 'onclick' | 'ondblclick' | 'onmousewheel' | 'onmouseout' | 'onmouseup' | 'onmousedown' | 'onmousemove' | 'oncontextmenu' | 'ondrag' | 'ondragstart' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondrop';
  73. declare type PropType<TObj, TProp extends keyof TObj> = TObj[TProp];
  74. declare type FunctionPropertyNames<T> = {
  75. [K in keyof T]: T[K] extends Function ? K : never;
  76. }[keyof T];
  77. declare type MapToType<T extends Dictionary<any>, S> = {
  78. [P in keyof T]: T[P] extends Dictionary<any> ? MapToType<T[P], S> : S;
  79. };
  80. declare type KeyOfDistributive<T> = T extends unknown ? keyof T : never;
  81. declare type WithThisType<Func extends (...args: any) => any, This> = (this: This, ...args: Parameters<Func>) => ReturnType<Func>;
  82. declare type SVGVNodeAttrs = Record<string, string | number | undefined | boolean>;
  83. interface SVGVNode {
  84. tag: string;
  85. attrs: SVGVNodeAttrs;
  86. children?: SVGVNode[];
  87. text?: string;
  88. elm?: Node;
  89. key: string;
  90. }
  91. declare type ImagePatternRepeat = 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';
  92. interface PatternObjectBase {
  93. id?: number;
  94. type?: 'pattern';
  95. x?: number;
  96. y?: number;
  97. rotation?: number;
  98. scaleX?: number;
  99. scaleY?: number;
  100. }
  101. interface ImagePatternObject extends PatternObjectBase {
  102. image: ImageLike | string;
  103. repeat?: ImagePatternRepeat;
  104. imageWidth?: number;
  105. imageHeight?: number;
  106. }
  107. interface SVGPatternObject extends PatternObjectBase {
  108. svgElement?: SVGVNode;
  109. svgWidth?: number;
  110. svgHeight?: number;
  111. }
  112. declare type PatternObject = ImagePatternObject | SVGPatternObject;
  113. declare type EventCallbackSingleParam<EvtParam = any> = EvtParam extends any ? (params: EvtParam) => boolean | void : never;
  114. declare type EventCallback<EvtParams = any[]> = EvtParams extends any[] ? (...args: EvtParams) => boolean | void : never;
  115. declare type EventQuery = string | Object;
  116. declare type CbThis<Ctx, Impl> = unknown extends Ctx ? Impl : Ctx;
  117. declare type DefaultEventDefinition = Dictionary<EventCallback<any[]>>;
  118. interface EventProcessor<EvtDef = DefaultEventDefinition> {
  119. normalizeQuery?: (query: EventQuery) => EventQuery;
  120. filter?: (eventType: keyof EvtDef, query: EventQuery) => boolean;
  121. afterTrigger?: (eventType: keyof EvtDef) => void;
  122. }
  123. declare class Eventful<EvtDef extends DefaultEventDefinition = DefaultEventDefinition> {
  124. private _$handlers;
  125. protected _$eventProcessor: EventProcessor<EvtDef>;
  126. constructor(eventProcessors?: EventProcessor<EvtDef>);
  127. on<Ctx, EvtNm extends keyof EvtDef>(event: EvtNm, handler: WithThisType<EvtDef[EvtNm], CbThis<Ctx, this>>, context?: Ctx): this;
  128. on<Ctx, EvtNm extends keyof EvtDef>(event: EvtNm, query: EventQuery, handler: WithThisType<EvtDef[EvtNm], CbThis<Ctx, this>>, context?: Ctx): this;
  129. isSilent(eventName: keyof EvtDef): boolean;
  130. off(eventType?: keyof EvtDef, handler?: Function): this;
  131. trigger<EvtNm extends keyof EvtDef>(eventType: EvtNm, ...args: Parameters<EvtDef[EvtNm]>): this;
  132. triggerWithContext(type: keyof EvtDef, ...args: any[]): this;
  133. }
  134. declare type VectorArray = number[];
  135. declare function create(x?: number, y?: number): VectorArray;
  136. declare function copy<T extends VectorArray>(out: T, v: VectorArray): T;
  137. declare function clone(v: VectorArray): VectorArray;
  138. declare function set<T extends VectorArray>(out: T, a: number, b: number): T;
  139. declare function add<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray): T;
  140. declare function scaleAndAdd<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray, a: number): T;
  141. declare function sub<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray): T;
  142. declare function len(v: VectorArray): number;
  143. declare const length: typeof len;
  144. declare function lenSquare(v: VectorArray): number;
  145. declare const lengthSquare: typeof lenSquare;
  146. declare function mul<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray): T;
  147. declare function div<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray): T;
  148. declare function dot(v1: VectorArray, v2: VectorArray): number;
  149. declare function scale<T extends VectorArray>(out: T, v: VectorArray, s: number): T;
  150. declare function normalize<T extends VectorArray>(out: T, v: VectorArray): T;
  151. declare function distance(v1: VectorArray, v2: VectorArray): number;
  152. declare const dist: typeof distance;
  153. declare function distanceSquare(v1: VectorArray, v2: VectorArray): number;
  154. declare const distSquare: typeof distanceSquare;
  155. declare function negate<T extends VectorArray>(out: T, v: VectorArray): T;
  156. declare function lerp<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray, t: number): T;
  157. declare function applyTransform<T extends VectorArray>(out: T, v: VectorArray, m: MatrixArray): T;
  158. declare function min<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray): T;
  159. declare function max<T extends VectorArray>(out: T, v1: VectorArray, v2: VectorArray): T;
  160. type vector_d_VectorArray = VectorArray;
  161. declare const vector_d_create: typeof create;
  162. declare const vector_d_copy: typeof copy;
  163. declare const vector_d_clone: typeof clone;
  164. declare const vector_d_set: typeof set;
  165. declare const vector_d_add: typeof add;
  166. declare const vector_d_scaleAndAdd: typeof scaleAndAdd;
  167. declare const vector_d_sub: typeof sub;
  168. declare const vector_d_len: typeof len;
  169. declare const vector_d_length: typeof length;
  170. declare const vector_d_lenSquare: typeof lenSquare;
  171. declare const vector_d_lengthSquare: typeof lengthSquare;
  172. declare const vector_d_mul: typeof mul;
  173. declare const vector_d_div: typeof div;
  174. declare const vector_d_dot: typeof dot;
  175. declare const vector_d_scale: typeof scale;
  176. declare const vector_d_normalize: typeof normalize;
  177. declare const vector_d_distance: typeof distance;
  178. declare const vector_d_dist: typeof dist;
  179. declare const vector_d_distanceSquare: typeof distanceSquare;
  180. declare const vector_d_distSquare: typeof distSquare;
  181. declare const vector_d_negate: typeof negate;
  182. declare const vector_d_lerp: typeof lerp;
  183. declare const vector_d_applyTransform: typeof applyTransform;
  184. declare const vector_d_min: typeof min;
  185. declare const vector_d_max: typeof max;
  186. declare namespace vector_d {
  187. export {
  188. vector_d_VectorArray as VectorArray,
  189. vector_d_create as create,
  190. vector_d_copy as copy,
  191. vector_d_clone as clone,
  192. vector_d_set as set,
  193. vector_d_add as add,
  194. vector_d_scaleAndAdd as scaleAndAdd,
  195. vector_d_sub as sub,
  196. vector_d_len as len,
  197. vector_d_length as length,
  198. vector_d_lenSquare as lenSquare,
  199. vector_d_lengthSquare as lengthSquare,
  200. vector_d_mul as mul,
  201. vector_d_div as div,
  202. vector_d_dot as dot,
  203. vector_d_scale as scale,
  204. vector_d_normalize as normalize,
  205. vector_d_distance as distance,
  206. vector_d_dist as dist,
  207. vector_d_distanceSquare as distanceSquare,
  208. vector_d_distSquare as distSquare,
  209. vector_d_negate as negate,
  210. vector_d_lerp as lerp,
  211. vector_d_applyTransform as applyTransform,
  212. vector_d_min as min,
  213. vector_d_max as max,
  214. };
  215. }
  216. declare type MatrixArray = number[];
  217. declare function create$1(): MatrixArray;
  218. declare function identity(out: MatrixArray): MatrixArray;
  219. declare function copy$1(out: MatrixArray, m: MatrixArray): MatrixArray;
  220. declare function mul$1(out: MatrixArray, m1: MatrixArray, m2: MatrixArray): MatrixArray;
  221. declare function translate(out: MatrixArray, a: MatrixArray, v: VectorArray): MatrixArray;
  222. declare function rotate(out: MatrixArray, a: MatrixArray, rad: number): MatrixArray;
  223. declare function scale$1(out: MatrixArray, a: MatrixArray, v: VectorArray): MatrixArray;
  224. declare function invert(out: MatrixArray, a: MatrixArray): MatrixArray | null;
  225. declare function clone$1(a: MatrixArray): MatrixArray;
  226. type matrix_d_MatrixArray = MatrixArray;
  227. declare const matrix_d_identity: typeof identity;
  228. declare const matrix_d_translate: typeof translate;
  229. declare const matrix_d_rotate: typeof rotate;
  230. declare const matrix_d_invert: typeof invert;
  231. declare namespace matrix_d {
  232. export {
  233. matrix_d_MatrixArray as MatrixArray,
  234. create$1 as create,
  235. matrix_d_identity as identity,
  236. copy$1 as copy,
  237. mul$1 as mul,
  238. matrix_d_translate as translate,
  239. matrix_d_rotate as rotate,
  240. scale$1 as scale,
  241. matrix_d_invert as invert,
  242. clone$1 as clone,
  243. };
  244. }
  245. interface PointLike {
  246. x: number;
  247. y: number;
  248. }
  249. declare class Point {
  250. x: number;
  251. y: number;
  252. constructor(x?: number, y?: number);
  253. copy(other: PointLike): this;
  254. clone(): Point;
  255. set(x: number, y: number): this;
  256. equal(other: PointLike): boolean;
  257. add(other: PointLike): this;
  258. scale(scalar: number): void;
  259. scaleAndAdd(other: PointLike, scalar: number): void;
  260. sub(other: PointLike): this;
  261. dot(other: PointLike): number;
  262. len(): number;
  263. lenSquare(): number;
  264. normalize(): this;
  265. distance(other: PointLike): number;
  266. distanceSquare(other: Point): number;
  267. negate(): this;
  268. transform(m: MatrixArray): this;
  269. toArray(out: number[]): number[];
  270. fromArray(input: number[]): void;
  271. static set(p: PointLike, x: number, y: number): void;
  272. static copy(p: PointLike, p2: PointLike): void;
  273. static len(p: PointLike): number;
  274. static lenSquare(p: PointLike): number;
  275. static dot(p0: PointLike, p1: PointLike): number;
  276. static add(out: PointLike, p0: PointLike, p1: PointLike): void;
  277. static sub(out: PointLike, p0: PointLike, p1: PointLike): void;
  278. static scale(out: PointLike, p0: PointLike, scalar: number): void;
  279. static scaleAndAdd(out: PointLike, p0: PointLike, p1: PointLike, scalar: number): void;
  280. static lerp(out: PointLike, p0: PointLike, p1: PointLike, t: number): void;
  281. }
  282. declare class BoundingRect {
  283. x: number;
  284. y: number;
  285. width: number;
  286. height: number;
  287. constructor(x: number, y: number, width: number, height: number);
  288. union(other: BoundingRect): void;
  289. applyTransform(m: MatrixArray): void;
  290. calculateTransform(b: RectLike): MatrixArray;
  291. intersect(b: RectLike, mtv?: PointLike): boolean;
  292. contain(x: number, y: number): boolean;
  293. clone(): BoundingRect;
  294. copy(other: RectLike): void;
  295. plain(): RectLike;
  296. isFinite(): boolean;
  297. isZero(): boolean;
  298. static create(rect: RectLike): BoundingRect;
  299. static copy(target: RectLike, source: RectLike): void;
  300. static applyTransform(target: RectLike, source: RectLike, m: MatrixArray): void;
  301. }
  302. declare type RectLike = {
  303. x: number;
  304. y: number;
  305. width: number;
  306. height: number;
  307. };
  308. interface ExtendedCanvasRenderingContext2D extends CanvasRenderingContext2D {
  309. dpr?: number;
  310. }
  311. declare class PathProxy {
  312. dpr: number;
  313. data: number[] | Float32Array;
  314. private _version;
  315. private _saveData;
  316. private _pendingPtX;
  317. private _pendingPtY;
  318. private _pendingPtDist;
  319. private _ctx;
  320. private _xi;
  321. private _yi;
  322. private _x0;
  323. private _y0;
  324. private _len;
  325. private _pathSegLen;
  326. private _pathLen;
  327. private _ux;
  328. private _uy;
  329. static CMD: {
  330. M: number;
  331. L: number;
  332. C: number;
  333. Q: number;
  334. A: number;
  335. Z: number;
  336. R: number;
  337. };
  338. constructor(notSaveData?: boolean);
  339. increaseVersion(): void;
  340. getVersion(): number;
  341. setScale(sx: number, sy: number, segmentIgnoreThreshold?: number): void;
  342. setDPR(dpr: number): void;
  343. setContext(ctx: ExtendedCanvasRenderingContext2D): void;
  344. getContext(): ExtendedCanvasRenderingContext2D;
  345. beginPath(): this;
  346. reset(): void;
  347. moveTo(x: number, y: number): this;
  348. lineTo(x: number, y: number): this;
  349. bezierCurveTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): this;
  350. quadraticCurveTo(x1: number, y1: number, x2: number, y2: number): this;
  351. arc(cx: number, cy: number, r: number, startAngle: number, endAngle: number, anticlockwise?: boolean): this;
  352. arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): this;
  353. rect(x: number, y: number, w: number, h: number): this;
  354. closePath(): this;
  355. fill(ctx: CanvasRenderingContext2D): void;
  356. stroke(ctx: CanvasRenderingContext2D): void;
  357. len(): number;
  358. setData(data: Float32Array | number[]): void;
  359. appendPath(path: PathProxy | PathProxy[]): void;
  360. addData(cmd: number, a?: number, b?: number, c?: number, d?: number, e?: number, f?: number, g?: number, h?: number): void;
  361. private _drawPendingPt;
  362. private _expandData;
  363. toStatic(): void;
  364. getBoundingRect(): BoundingRect;
  365. private _calculateLength;
  366. rebuildPath(ctx: PathRebuilder, percent: number): void;
  367. clone(): PathProxy;
  368. private static initDefaultProps;
  369. }
  370. interface PathRebuilder {
  371. moveTo(x: number, y: number): void;
  372. lineTo(x: number, y: number): void;
  373. bezierCurveTo(x: number, y: number, x2: number, y2: number, x3: number, y3: number): void;
  374. quadraticCurveTo(x: number, y: number, x2: number, y2: number): void;
  375. arc(cx: number, cy: number, r: number, startAngle: number, endAngle: number, anticlockwise: boolean): void;
  376. ellipse(cx: number, cy: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise: boolean): void;
  377. rect(x: number, y: number, width: number, height: number): void;
  378. closePath(): void;
  379. }
  380. declare type easingFunc = (percent: number) => number;
  381. declare type AnimationEasing = keyof typeof easingFuncs | easingFunc;
  382. declare const easingFuncs: {
  383. linear(k: number): number;
  384. quadraticIn(k: number): number;
  385. quadraticOut(k: number): number;
  386. quadraticInOut(k: number): number;
  387. cubicIn(k: number): number;
  388. cubicOut(k: number): number;
  389. cubicInOut(k: number): number;
  390. quarticIn(k: number): number;
  391. quarticOut(k: number): number;
  392. quarticInOut(k: number): number;
  393. quinticIn(k: number): number;
  394. quinticOut(k: number): number;
  395. quinticInOut(k: number): number;
  396. sinusoidalIn(k: number): number;
  397. sinusoidalOut(k: number): number;
  398. sinusoidalInOut(k: number): number;
  399. exponentialIn(k: number): number;
  400. exponentialOut(k: number): number;
  401. exponentialInOut(k: number): number;
  402. circularIn(k: number): number;
  403. circularOut(k: number): number;
  404. circularInOut(k: number): number;
  405. elasticIn(k: number): number;
  406. elasticOut(k: number): number;
  407. elasticInOut(k: number): number;
  408. backIn(k: number): number;
  409. backOut(k: number): number;
  410. backInOut(k: number): number;
  411. bounceIn(k: number): number;
  412. bounceOut(k: number): number;
  413. bounceInOut(k: number): number;
  414. };
  415. interface Stage {
  416. update?: () => void;
  417. }
  418. interface AnimationOption {
  419. stage?: Stage;
  420. }
  421. declare class Animation extends Eventful {
  422. stage: Stage;
  423. private _head;
  424. private _tail;
  425. private _running;
  426. private _time;
  427. private _pausedTime;
  428. private _pauseStart;
  429. private _paused;
  430. constructor(opts?: AnimationOption);
  431. addClip(clip: Clip): void;
  432. addAnimator(animator: Animator<any>): void;
  433. removeClip(clip: Clip): void;
  434. removeAnimator(animator: Animator<any>): void;
  435. update(notTriggerFrameAndStageUpdate?: boolean): void;
  436. _startLoop(): void;
  437. start(): void;
  438. stop(): void;
  439. pause(): void;
  440. resume(): void;
  441. clear(): void;
  442. isFinished(): boolean;
  443. animate<T>(target: T, options: {
  444. loop?: boolean;
  445. }): Animator<T>;
  446. }
  447. declare type OnframeCallback = (percent: number) => void;
  448. declare type ondestroyCallback = () => void;
  449. declare type onrestartCallback = () => void;
  450. interface ClipProps {
  451. life?: number;
  452. delay?: number;
  453. loop?: boolean;
  454. easing?: AnimationEasing;
  455. onframe?: OnframeCallback;
  456. ondestroy?: ondestroyCallback;
  457. onrestart?: onrestartCallback;
  458. }
  459. declare class Clip {
  460. private _life;
  461. private _delay;
  462. private _inited;
  463. private _startTime;
  464. private _pausedTime;
  465. private _paused;
  466. animation: Animation;
  467. loop: boolean;
  468. easing: AnimationEasing;
  469. easingFunc: (p: number) => number;
  470. next: Clip;
  471. prev: Clip;
  472. onframe: OnframeCallback;
  473. ondestroy: ondestroyCallback;
  474. onrestart: onrestartCallback;
  475. constructor(opts: ClipProps);
  476. step(globalTime: number, deltaTime: number): boolean;
  477. pause(): void;
  478. resume(): void;
  479. setEasing(easing: AnimationEasing): void;
  480. }
  481. declare type ValueType = 0 | 1 | 2 | 3 | 4 | 5 | 6;
  482. declare type Keyframe = {
  483. time: number;
  484. value: unknown;
  485. percent: number;
  486. rawValue: unknown;
  487. easing?: AnimationEasing;
  488. easingFunc?: (percent: number) => number;
  489. additiveValue?: unknown;
  490. };
  491. declare class Track {
  492. keyframes: Keyframe[];
  493. propName: string;
  494. valType: ValueType;
  495. discrete: boolean;
  496. _invalid: boolean;
  497. private _finished;
  498. private _needsSort;
  499. private _additiveTrack;
  500. private _additiveValue;
  501. private _lastFr;
  502. private _lastFrP;
  503. constructor(propName: string);
  504. isFinished(): boolean;
  505. setFinished(): void;
  506. needsAnimate(): boolean;
  507. getAdditiveTrack(): Track;
  508. addKeyframe(time: number, rawValue: unknown, easing?: AnimationEasing): Keyframe;
  509. prepare(maxTime: number, additiveTrack?: Track): void;
  510. step(target: any, percent: number): void;
  511. private _addToTarget;
  512. }
  513. declare type DoneCallback = () => void;
  514. declare type AbortCallback = () => void;
  515. declare type OnframeCallback$1<T> = (target: T, percent: number) => void;
  516. declare class Animator<T> {
  517. animation?: Animation;
  518. targetName?: string;
  519. scope?: string;
  520. __fromStateTransition?: string;
  521. private _tracks;
  522. private _trackKeys;
  523. private _target;
  524. private _loop;
  525. private _delay;
  526. private _maxTime;
  527. private _force;
  528. private _paused;
  529. private _started;
  530. private _allowDiscrete;
  531. private _additiveAnimators;
  532. private _doneCbs;
  533. private _onframeCbs;
  534. private _abortedCbs;
  535. private _clip;
  536. constructor(target: T, loop: boolean, allowDiscreteAnimation?: boolean, additiveTo?: Animator<any>[]);
  537. getMaxTime(): number;
  538. getDelay(): number;
  539. getLoop(): boolean;
  540. getTarget(): T;
  541. changeTarget(target: T): void;
  542. when(time: number, props: Dictionary<any>, easing?: AnimationEasing): this;
  543. whenWithKeys(time: number, props: Dictionary<any>, propNames: string[], easing?: AnimationEasing): this;
  544. pause(): void;
  545. resume(): void;
  546. isPaused(): boolean;
  547. duration(duration: number): this;
  548. private _doneCallback;
  549. private _abortedCallback;
  550. private _setTracksFinished;
  551. private _getAdditiveTrack;
  552. start(easing?: AnimationEasing): this;
  553. stop(forwardToLast?: boolean): void;
  554. delay(time: number): this;
  555. during(cb: OnframeCallback$1<T>): this;
  556. done(cb: DoneCallback): this;
  557. aborted(cb: AbortCallback): this;
  558. getClip(): Clip;
  559. getTrack(propName: string): Track;
  560. getTracks(): Track[];
  561. stopTracks(propNames: string[], forwardToLast?: boolean): boolean;
  562. saveTo(target: T, trackKeys?: readonly string[], firstOrLast?: boolean): void;
  563. __changeFinalValue(finalProps: Dictionary<any>, trackKeys?: readonly string[]): void;
  564. }
  565. interface PathStyleProps extends CommonStyleProps {
  566. fill?: string | PatternObject | LinearGradientObject | RadialGradientObject;
  567. stroke?: string | PatternObject | LinearGradientObject | RadialGradientObject;
  568. decal?: PatternObject;
  569. strokePercent?: number;
  570. strokeNoScale?: boolean;
  571. fillOpacity?: number;
  572. strokeOpacity?: number;
  573. lineDash?: false | number[] | 'solid' | 'dashed' | 'dotted';
  574. lineDashOffset?: number;
  575. lineWidth?: number;
  576. lineCap?: CanvasLineCap;
  577. lineJoin?: CanvasLineJoin;
  578. miterLimit?: number;
  579. strokeFirst?: boolean;
  580. }
  581. interface PathProps extends DisplayableProps {
  582. strokeContainThreshold?: number;
  583. segmentIgnoreThreshold?: number;
  584. subPixelOptimize?: boolean;
  585. style?: PathStyleProps;
  586. shape?: Dictionary<any>;
  587. autoBatch?: boolean;
  588. __value?: (string | number)[] | (string | number);
  589. buildPath?: (ctx: PathProxy | CanvasRenderingContext2D, shapeCfg: Dictionary<any>, inBatch?: boolean) => void;
  590. }
  591. declare type PathKey = keyof PathProps;
  592. declare type PathPropertyType = PropType<PathProps, PathKey>;
  593. declare type PathStatePropNames = DisplayableStatePropNames | 'shape';
  594. declare type PathState = Pick<PathProps, PathStatePropNames> & {
  595. hoverLayer?: boolean;
  596. };
  597. interface Path<Props extends PathProps = PathProps> {
  598. animate(key?: '', loop?: boolean): Animator<this>;
  599. animate(key: 'style', loop?: boolean): Animator<this['style']>;
  600. animate(key: 'shape', loop?: boolean): Animator<this['shape']>;
  601. getState(stateName: string): PathState;
  602. ensureState(stateName: string): PathState;
  603. states: Dictionary<PathState>;
  604. stateProxy: (stateName: string) => PathState;
  605. }
  606. declare class Path<Props extends PathProps = PathProps> extends Displayable<Props> {
  607. path: PathProxy;
  608. strokeContainThreshold: number;
  609. segmentIgnoreThreshold: number;
  610. subPixelOptimize: boolean;
  611. style: PathStyleProps;
  612. autoBatch: boolean;
  613. private _rectStroke;
  614. protected _normalState: PathState;
  615. protected _decalEl: Path;
  616. shape: Dictionary<any>;
  617. constructor(opts?: Props);
  618. update(): void;
  619. getDecalElement(): Path<PathProps>;
  620. protected _init(props?: Props): void;
  621. protected getDefaultStyle(): Props['style'];
  622. protected getDefaultShape(): {};
  623. protected canBeInsideText(): boolean;
  624. protected getInsideTextFill(): "#333" | "#ccc" | "#eee";
  625. protected getInsideTextStroke(textFill?: string): string;
  626. buildPath(ctx: PathProxy | CanvasRenderingContext2D, shapeCfg: Dictionary<any>, inBatch?: boolean): void;
  627. pathUpdated(): void;
  628. getUpdatedPathProxy(inBatch?: boolean): PathProxy;
  629. createPathProxy(): void;
  630. hasStroke(): boolean;
  631. hasFill(): boolean;
  632. getBoundingRect(): BoundingRect;
  633. contain(x: number, y: number): boolean;
  634. dirtyShape(): void;
  635. dirty(): void;
  636. animateShape(loop: boolean): Animator<this["shape"]>;
  637. updateDuringAnimation(targetKey: string): void;
  638. attrKV(key: PathKey, value: PathPropertyType): void;
  639. setShape(obj: Props['shape']): this;
  640. setShape<T extends keyof Props['shape']>(obj: T, value: Props['shape'][T]): this;
  641. shapeChanged(): boolean;
  642. createStyle(obj?: Props['style']): Props["style"];
  643. protected _innerSaveToNormal(toState: PathState): void;
  644. protected _applyStateObj(stateName: string, state: PathState, normalState: PathState, keepCurrentStates: boolean, transition: boolean, animationCfg: ElementAnimateConfig): void;
  645. protected _mergeStates(states: PathState[]): PathState;
  646. getAnimationStyleProps(): MapToType<PathProps, boolean>;
  647. isZeroArea(): boolean;
  648. static extend<Shape extends Dictionary<any>>(defaultProps: {
  649. type?: string;
  650. shape?: Shape;
  651. style?: PathStyleProps;
  652. beforeBrush?: Displayable['beforeBrush'];
  653. afterBrush?: Displayable['afterBrush'];
  654. getBoundingRect?: Displayable['getBoundingRect'];
  655. calculateTextPosition?: Element['calculateTextPosition'];
  656. buildPath(this: Path, ctx: CanvasRenderingContext2D | PathProxy, shape: Shape, inBatch?: boolean): void;
  657. init?(this: Path, opts: PathProps): void;
  658. }): {
  659. new (opts?: PathProps & {
  660. shape: Shape;
  661. }): Path;
  662. };
  663. protected static initDefaultProps: void;
  664. }
  665. declare class Transformable {
  666. parent: Transformable;
  667. x: number;
  668. y: number;
  669. scaleX: number;
  670. scaleY: number;
  671. skewX: number;
  672. skewY: number;
  673. rotation: number;
  674. anchorX: number;
  675. anchorY: number;
  676. originX: number;
  677. originY: number;
  678. globalScaleRatio: number;
  679. transform: MatrixArray;
  680. invTransform: MatrixArray;
  681. getLocalTransform(m?: MatrixArray): MatrixArray;
  682. setPosition(arr: number[]): void;
  683. setScale(arr: number[]): void;
  684. setSkew(arr: number[]): void;
  685. setOrigin(arr: number[]): void;
  686. needLocalTransform(): boolean;
  687. updateTransform(): void;
  688. private _resolveGlobalScaleRatio;
  689. getComputedTransform(): MatrixArray;
  690. setLocalTransform(m: VectorArray): void;
  691. decomposeTransform(): void;
  692. getGlobalScale(out?: VectorArray): VectorArray;
  693. transformCoordToLocal(x: number, y: number): number[];
  694. transformCoordToGlobal(x: number, y: number): number[];
  695. getLineScale(): number;
  696. copyTransform(source: Transformable): void;
  697. static getLocalTransform(target: Transformable, m?: MatrixArray): MatrixArray;
  698. private static initDefaultProps;
  699. }
  700. declare const TRANSFORMABLE_PROPS: readonly ["x", "y", "originX", "originY", "anchorX", "anchorY", "rotation", "scaleX", "scaleY", "skewX", "skewY"];
  701. declare type TransformProp = (typeof TRANSFORMABLE_PROPS)[number];
  702. interface TSpanStyleProps extends PathStyleProps {
  703. x?: number;
  704. y?: number;
  705. text?: string;
  706. font?: string;
  707. fontSize?: number;
  708. fontWeight?: FontWeight;
  709. fontStyle?: FontStyle;
  710. fontFamily?: string;
  711. textAlign?: CanvasTextAlign;
  712. textBaseline?: CanvasTextBaseline;
  713. }
  714. interface TSpanProps extends DisplayableProps {
  715. style?: TSpanStyleProps;
  716. }
  717. declare class TSpan extends Displayable<TSpanProps> {
  718. style: TSpanStyleProps;
  719. hasStroke(): boolean;
  720. hasFill(): boolean;
  721. createStyle(obj?: TSpanStyleProps): TSpanStyleProps;
  722. setBoundingRect(rect: BoundingRect): void;
  723. getBoundingRect(): BoundingRect;
  724. protected static initDefaultProps: void;
  725. }
  726. interface ImageStyleProps extends CommonStyleProps {
  727. image?: string | ImageLike;
  728. x?: number;
  729. y?: number;
  730. width?: number;
  731. height?: number;
  732. sx?: number;
  733. sy?: number;
  734. sWidth?: number;
  735. sHeight?: number;
  736. }
  737. interface ImageProps extends DisplayableProps {
  738. style?: ImageStyleProps;
  739. onload?: (image: ImageLike) => void;
  740. }
  741. declare class ZRImage extends Displayable<ImageProps> {
  742. style: ImageStyleProps;
  743. __image: ImageLike;
  744. __imageSrc: string;
  745. onload: (image: ImageLike) => void;
  746. createStyle(obj?: ImageStyleProps): ImageStyleProps;
  747. private _getSize;
  748. getWidth(): number;
  749. getHeight(): number;
  750. getAnimationStyleProps(): MapToType<ImageProps, boolean>;
  751. getBoundingRect(): BoundingRect;
  752. }
  753. declare class RectShape {
  754. r?: number | number[];
  755. x: number;
  756. y: number;
  757. width: number;
  758. height: number;
  759. }
  760. interface RectProps extends PathProps {
  761. shape?: Partial<RectShape>;
  762. }
  763. declare class Rect extends Path<RectProps> {
  764. shape: RectShape;
  765. constructor(opts?: RectProps);
  766. getDefaultShape(): RectShape;
  767. buildPath(ctx: CanvasRenderingContext2D, shape: RectShape): void;
  768. isZeroArea(): boolean;
  769. }
  770. interface GroupProps extends ElementProps {
  771. }
  772. declare class Group extends Element<GroupProps> {
  773. readonly isGroup = true;
  774. private _children;
  775. constructor(opts?: GroupProps);
  776. childrenRef(): Element<ElementProps>[];
  777. children(): Element<ElementProps>[];
  778. childAt(idx: number): Element;
  779. childOfName(name: string): Element;
  780. childCount(): number;
  781. add(child: Element): Group;
  782. addBefore(child: Element, nextSibling: Element): this;
  783. replace(oldChild: Element, newChild: Element): this;
  784. replaceAt(child: Element, index: number): this;
  785. _doAdd(child: Element): void;
  786. remove(child: Element): this;
  787. removeAll(): this;
  788. eachChild<Context>(cb: (this: Context, el: Element, index?: number) => void, context?: Context): this;
  789. traverse<T>(cb: (this: T, el: Element) => boolean | void, context?: T): this;
  790. addSelfToZr(zr: ZRenderType): void;
  791. removeSelfFromZr(zr: ZRenderType): void;
  792. getBoundingRect(includeChildren?: Element[]): BoundingRect;
  793. }
  794. interface GroupLike extends Element {
  795. childrenRef(): Element[];
  796. }
  797. interface TextStylePropsPart {
  798. text?: string;
  799. fill?: string;
  800. stroke?: string;
  801. strokeNoScale?: boolean;
  802. opacity?: number;
  803. fillOpacity?: number;
  804. strokeOpacity?: number;
  805. lineWidth?: number;
  806. lineDash?: false | number[];
  807. lineDashOffset?: number;
  808. borderDash?: false | number[];
  809. borderDashOffset?: number;
  810. font?: string;
  811. textFont?: string;
  812. fontStyle?: FontStyle;
  813. fontWeight?: FontWeight;
  814. fontFamily?: string;
  815. fontSize?: number | string;
  816. align?: TextAlign;
  817. verticalAlign?: TextVerticalAlign;
  818. lineHeight?: number;
  819. width?: number | string;
  820. height?: number;
  821. tag?: string;
  822. textShadowColor?: string;
  823. textShadowBlur?: number;
  824. textShadowOffsetX?: number;
  825. textShadowOffsetY?: number;
  826. backgroundColor?: string | {
  827. image: ImageLike | string;
  828. };
  829. padding?: number | number[];
  830. margin?: number;
  831. borderColor?: string;
  832. borderWidth?: number;
  833. borderRadius?: number | number[];
  834. shadowColor?: string;
  835. shadowBlur?: number;
  836. shadowOffsetX?: number;
  837. shadowOffsetY?: number;
  838. }
  839. interface TextStyleProps extends TextStylePropsPart {
  840. text?: string;
  841. x?: number;
  842. y?: number;
  843. width?: number;
  844. rich?: Dictionary<TextStylePropsPart>;
  845. overflow?: 'break' | 'breakAll' | 'truncate' | 'none';
  846. lineOverflow?: 'truncate';
  847. ellipsis?: string;
  848. placeholder?: string;
  849. truncateMinChar?: number;
  850. }
  851. interface TextProps extends DisplayableProps {
  852. style?: TextStyleProps;
  853. zlevel?: number;
  854. z?: number;
  855. z2?: number;
  856. culling?: boolean;
  857. cursor?: string;
  858. }
  859. declare type TextState = Pick<TextProps, DisplayableStatePropNames> & ElementCommonState;
  860. declare type DefaultTextStyle = Pick<TextStyleProps, 'fill' | 'stroke' | 'align' | 'verticalAlign'> & {
  861. autoStroke?: boolean;
  862. };
  863. interface ZRText {
  864. animate(key?: '', loop?: boolean): Animator<this>;
  865. animate(key: 'style', loop?: boolean): Animator<this['style']>;
  866. getState(stateName: string): TextState;
  867. ensureState(stateName: string): TextState;
  868. states: Dictionary<TextState>;
  869. stateProxy: (stateName: string) => TextState;
  870. }
  871. declare class ZRText extends Displayable<TextProps> implements GroupLike {
  872. type: string;
  873. style: TextStyleProps;
  874. overlap: 'hidden' | 'show' | 'blur';
  875. innerTransformable: Transformable;
  876. private _children;
  877. private _childCursor;
  878. private _defaultStyle;
  879. constructor(opts?: TextProps);
  880. childrenRef(): (ZRImage | Rect | TSpan)[];
  881. update(): void;
  882. updateTransform(): void;
  883. getLocalTransform(m?: MatrixArray): MatrixArray;
  884. getComputedTransform(): MatrixArray;
  885. private _updateSubTexts;
  886. addSelfToZr(zr: ZRenderType): void;
  887. removeSelfFromZr(zr: ZRenderType): void;
  888. getBoundingRect(): BoundingRect;
  889. setDefaultTextStyle(defaultTextStyle: DefaultTextStyle): void;
  890. setTextContent(textContent: never): void;
  891. protected _mergeStyle(targetStyle: TextStyleProps, sourceStyle: TextStyleProps): TextStyleProps;
  892. private _mergeRich;
  893. getAnimationStyleProps(): MapToType<TextProps, boolean>;
  894. private _getOrCreateChild;
  895. private _updatePlainTexts;
  896. private _updateRichTexts;
  897. private _placeToken;
  898. private _renderBackground;
  899. static makeFont(style: TextStylePropsPart): string;
  900. }
  901. interface TextPositionCalculationResult {
  902. x: number;
  903. y: number;
  904. align: TextAlign;
  905. verticalAlign: TextVerticalAlign;
  906. }
  907. declare class PolylineShape {
  908. points: VectorArray[];
  909. percent?: number;
  910. smooth?: number;
  911. smoothConstraint?: VectorArray[];
  912. }
  913. interface PolylineProps extends PathProps {
  914. shape?: Partial<PolylineShape>;
  915. }
  916. declare class Polyline extends Path<PolylineProps> {
  917. shape: PolylineShape;
  918. constructor(opts?: PolylineProps);
  919. getDefaultStyle(): {
  920. stroke: string;
  921. fill: string;
  922. };
  923. getDefaultShape(): PolylineShape;
  924. buildPath(ctx: CanvasRenderingContext2D, shape: PolylineShape): void;
  925. }
  926. interface ElementAnimateConfig {
  927. duration?: number;
  928. delay?: number;
  929. easing?: AnimationEasing;
  930. during?: (percent: number) => void;
  931. done?: Function;
  932. aborted?: Function;
  933. scope?: string;
  934. force?: boolean;
  935. additive?: boolean;
  936. setToFinal?: boolean;
  937. }
  938. interface ElementTextConfig {
  939. position?: BuiltinTextPosition | (number | string)[];
  940. rotation?: number;
  941. layoutRect?: RectLike;
  942. offset?: number[];
  943. origin?: (number | string)[] | 'center';
  944. distance?: number;
  945. local?: boolean;
  946. insideFill?: string;
  947. insideStroke?: string;
  948. outsideFill?: string;
  949. outsideStroke?: string;
  950. inside?: boolean;
  951. }
  952. interface ElementTextGuideLineConfig {
  953. anchor?: Point;
  954. showAbove?: boolean;
  955. candidates?: ('left' | 'top' | 'right' | 'bottom')[];
  956. }
  957. interface ElementEvent {
  958. type: ElementEventName;
  959. event: ZRRawEvent;
  960. target: Element;
  961. topTarget: Element;
  962. cancelBubble: boolean;
  963. offsetX: number;
  964. offsetY: number;
  965. gestureEvent: string;
  966. pinchX: number;
  967. pinchY: number;
  968. pinchScale: number;
  969. wheelDelta: number;
  970. zrByTouch: boolean;
  971. which: number;
  972. stop: (this: ElementEvent) => void;
  973. }
  974. declare type ElementEventCallback<Ctx, Impl> = (this: CbThis$1<Ctx, Impl>, e: ElementEvent) => boolean | void;
  975. declare type CbThis$1<Ctx, Impl> = unknown extends Ctx ? Impl : Ctx;
  976. interface ElementEventHandlerProps {
  977. onclick: ElementEventCallback<unknown, unknown>;
  978. ondblclick: ElementEventCallback<unknown, unknown>;
  979. onmouseover: ElementEventCallback<unknown, unknown>;
  980. onmouseout: ElementEventCallback<unknown, unknown>;
  981. onmousemove: ElementEventCallback<unknown, unknown>;
  982. onmousewheel: ElementEventCallback<unknown, unknown>;
  983. onmousedown: ElementEventCallback<unknown, unknown>;
  984. onmouseup: ElementEventCallback<unknown, unknown>;
  985. oncontextmenu: ElementEventCallback<unknown, unknown>;
  986. ondrag: ElementEventCallback<unknown, unknown>;
  987. ondragstart: ElementEventCallback<unknown, unknown>;
  988. ondragend: ElementEventCallback<unknown, unknown>;
  989. ondragenter: ElementEventCallback<unknown, unknown>;
  990. ondragleave: ElementEventCallback<unknown, unknown>;
  991. ondragover: ElementEventCallback<unknown, unknown>;
  992. ondrop: ElementEventCallback<unknown, unknown>;
  993. }
  994. interface ElementProps extends Partial<ElementEventHandlerProps>, Partial<Pick<Transformable, TransformProp>> {
  995. name?: string;
  996. ignore?: boolean;
  997. isGroup?: boolean;
  998. draggable?: boolean | 'horizontal' | 'vertical';
  999. silent?: boolean;
  1000. ignoreClip?: boolean;
  1001. globalScaleRatio?: number;
  1002. textConfig?: ElementTextConfig;
  1003. textContent?: ZRText;
  1004. clipPath?: Path;
  1005. drift?: Element['drift'];
  1006. extra?: Dictionary<unknown>;
  1007. anid?: string;
  1008. }
  1009. declare const PRIMARY_STATES_KEYS: ["x" | "y" | "originX" | "originY" | "anchorX" | "anchorY" | "rotation" | "scaleX" | "scaleY" | "skewX" | "skewY", "ignore"];
  1010. declare type ElementStatePropNames = (typeof PRIMARY_STATES_KEYS)[number] | 'textConfig';
  1011. declare type ElementState = Pick<ElementProps, ElementStatePropNames> & ElementCommonState;
  1012. declare type ElementCommonState = {
  1013. hoverLayer?: boolean;
  1014. };
  1015. declare type ElementCalculateTextPosition = (out: TextPositionCalculationResult, style: ElementTextConfig, rect: RectLike) => TextPositionCalculationResult;
  1016. interface Element<Props extends ElementProps = ElementProps> extends Transformable, Eventful<{
  1017. [key in ElementEventName]: (e: ElementEvent) => void | boolean;
  1018. } & {
  1019. [key in string]: (...args: any) => void | boolean;
  1020. }>, ElementEventHandlerProps {
  1021. }
  1022. declare class Element<Props extends ElementProps = ElementProps> {
  1023. id: number;
  1024. type: string;
  1025. name: string;
  1026. ignore: boolean;
  1027. silent: boolean;
  1028. isGroup: boolean;
  1029. draggable: boolean | 'horizontal' | 'vertical';
  1030. dragging: boolean;
  1031. parent: Group;
  1032. animators: Animator<any>[];
  1033. ignoreClip: boolean;
  1034. __hostTarget: Element;
  1035. __zr: ZRenderType;
  1036. __dirty: number;
  1037. __isRendered: boolean;
  1038. __inHover: boolean;
  1039. private _clipPath?;
  1040. private _textContent?;
  1041. private _textGuide?;
  1042. textConfig?: ElementTextConfig;
  1043. textGuideLineConfig?: ElementTextGuideLineConfig;
  1044. anid: string;
  1045. extra: Dictionary<unknown>;
  1046. currentStates?: string[];
  1047. prevStates?: string[];
  1048. states: Dictionary<ElementState>;
  1049. stateTransition: ElementAnimateConfig;
  1050. stateProxy?: (stateName: string, targetStates?: string[]) => ElementState;
  1051. protected _normalState: ElementState;
  1052. private _innerTextDefaultStyle;
  1053. constructor(props?: Props);
  1054. protected _init(props?: Props): void;
  1055. drift(dx: number, dy: number, e?: ElementEvent): void;
  1056. beforeUpdate(): void;
  1057. afterUpdate(): void;
  1058. update(): void;
  1059. updateInnerText(forceUpdate?: boolean): void;
  1060. protected canBeInsideText(): boolean;
  1061. protected getInsideTextFill(): string | undefined;
  1062. protected getInsideTextStroke(textFill: string): string | undefined;
  1063. protected getOutsideFill(): string | undefined;
  1064. protected getOutsideStroke(textFill: string): string;
  1065. traverse<Context>(cb: (this: Context, el: Element<Props>) => void, context?: Context): void;
  1066. protected attrKV(key: string, value: unknown): void;
  1067. hide(): void;
  1068. show(): void;
  1069. attr(keyOrObj: Props): this;
  1070. attr<T extends keyof Props>(keyOrObj: T, value: Props[T]): this;
  1071. saveCurrentToNormalState(toState: ElementState): void;
  1072. protected _innerSaveToNormal(toState: ElementState): void;
  1073. protected _savePrimaryToNormal(toState: Dictionary<any>, normalState: Dictionary<any>, primaryKeys: readonly string[]): void;
  1074. hasState(): boolean;
  1075. getState(name: string): ElementState;
  1076. ensureState(name: string): ElementState;
  1077. clearStates(noAnimation?: boolean): void;
  1078. useState(stateName: string, keepCurrentStates?: boolean, noAnimation?: boolean, forceUseHoverLayer?: boolean): ElementState;
  1079. useStates(states: string[], noAnimation?: boolean, forceUseHoverLayer?: boolean): void;
  1080. private _updateAnimationTargets;
  1081. removeState(state: string): void;
  1082. replaceState(oldState: string, newState: string, forceAdd: boolean): void;
  1083. toggleState(state: string, enable: boolean): void;
  1084. protected _mergeStates(states: ElementState[]): ElementState;
  1085. protected _applyStateObj(stateName: string, state: ElementState, normalState: ElementState, keepCurrentStates: boolean, transition: boolean, animationCfg: ElementAnimateConfig): void;
  1086. private _attachComponent;
  1087. private _detachComponent;
  1088. getClipPath(): Path<PathProps>;
  1089. setClipPath(clipPath: Path): void;
  1090. removeClipPath(): void;
  1091. getTextContent(): ZRText;
  1092. setTextContent(textEl: ZRText): void;
  1093. setTextConfig(cfg: ElementTextConfig): void;
  1094. removeTextConfig(): void;
  1095. removeTextContent(): void;
  1096. getTextGuideLine(): Polyline;
  1097. setTextGuideLine(guideLine: Polyline): void;
  1098. removeTextGuideLine(): void;
  1099. markRedraw(): void;
  1100. dirty(): void;
  1101. private _toggleHoverLayerFlag;
  1102. addSelfToZr(zr: ZRenderType): void;
  1103. removeSelfFromZr(zr: ZRenderType): void;
  1104. animate(key?: string, loop?: boolean, allowDiscreteAnimation?: boolean): Animator<any>;
  1105. addAnimator(animator: Animator<any>, key: string): void;
  1106. updateDuringAnimation(key: string): void;
  1107. stopAnimation(scope?: string, forwardToLast?: boolean): this;
  1108. animateTo(target: Props, cfg?: ElementAnimateConfig, animationProps?: MapToType<Props, boolean>): void;
  1109. animateFrom(target: Props, cfg: ElementAnimateConfig, animationProps?: MapToType<Props, boolean>): void;
  1110. protected _transitionState(stateName: string, target: Props, cfg?: ElementAnimateConfig, animationProps?: MapToType<Props, boolean>): void;
  1111. getBoundingRect(): BoundingRect;
  1112. getPaintRect(): BoundingRect;
  1113. calculateTextPosition: ElementCalculateTextPosition;
  1114. protected static initDefaultProps: void;
  1115. }
  1116. interface CommonStyleProps {
  1117. shadowBlur?: number;
  1118. shadowOffsetX?: number;
  1119. shadowOffsetY?: number;
  1120. shadowColor?: string;
  1121. opacity?: number;
  1122. blend?: string;
  1123. }
  1124. interface DisplayableProps extends ElementProps {
  1125. style?: Dictionary<any>;
  1126. zlevel?: number;
  1127. z?: number;
  1128. z2?: number;
  1129. culling?: boolean;
  1130. cursor?: string;
  1131. rectHover?: boolean;
  1132. progressive?: boolean;
  1133. incremental?: boolean;
  1134. ignoreCoarsePointer?: boolean;
  1135. batch?: boolean;
  1136. invisible?: boolean;
  1137. }
  1138. declare type DisplayableKey = keyof DisplayableProps;
  1139. declare type DisplayablePropertyType = PropType<DisplayableProps, DisplayableKey>;
  1140. declare type DisplayableStatePropNames = ElementStatePropNames | 'style' | 'z' | 'z2' | 'invisible';
  1141. declare type DisplayableState = Pick<DisplayableProps, DisplayableStatePropNames> & ElementCommonState;
  1142. interface Displayable<Props extends DisplayableProps = DisplayableProps> {
  1143. animate(key?: '', loop?: boolean): Animator<this>;
  1144. animate(key: 'style', loop?: boolean): Animator<this['style']>;
  1145. getState(stateName: string): DisplayableState;
  1146. ensureState(stateName: string): DisplayableState;
  1147. states: Dictionary<DisplayableState>;
  1148. stateProxy: (stateName: string) => DisplayableState;
  1149. }
  1150. declare class Displayable<Props extends DisplayableProps = DisplayableProps> extends Element<Props> {
  1151. invisible: boolean;
  1152. z: number;
  1153. z2: number;
  1154. zlevel: number;
  1155. culling: boolean;
  1156. cursor: string;
  1157. rectHover: boolean;
  1158. incremental: boolean;
  1159. ignoreCoarsePointer?: boolean;
  1160. style: Dictionary<any>;
  1161. protected _normalState: DisplayableState;
  1162. protected _rect: BoundingRect;
  1163. protected _paintRect: BoundingRect;
  1164. protected _prevPaintRect: BoundingRect;
  1165. dirtyRectTolerance: number;
  1166. useHoverLayer?: boolean;
  1167. __hoverStyle?: CommonStyleProps;
  1168. __clipPaths?: Path[];
  1169. __canvasFillGradient: CanvasGradient;
  1170. __canvasStrokeGradient: CanvasGradient;
  1171. __canvasFillPattern: CanvasPattern;
  1172. __canvasStrokePattern: CanvasPattern;
  1173. __svgEl: SVGElement;
  1174. constructor(props?: Props);
  1175. protected _init(props?: Props): void;
  1176. beforeBrush(): void;
  1177. afterBrush(): void;
  1178. innerBeforeBrush(): void;
  1179. innerAfterBrush(): void;
  1180. shouldBePainted(viewWidth: number, viewHeight: number, considerClipPath: boolean, considerAncestors: boolean): boolean;
  1181. contain(x: number, y: number): boolean;
  1182. traverse<Context>(cb: (this: Context, el: this) => void, context?: Context): void;
  1183. rectContain(x: number, y: number): boolean;
  1184. getPaintRect(): BoundingRect;
  1185. setPrevPaintRect(paintRect: BoundingRect): void;
  1186. getPrevPaintRect(): BoundingRect;
  1187. animateStyle(loop: boolean): Animator<this["style"]>;
  1188. updateDuringAnimation(targetKey: string): void;
  1189. attrKV(key: DisplayableKey, value: DisplayablePropertyType): void;
  1190. setStyle(obj: Props['style']): this;
  1191. setStyle<T extends keyof Props['style']>(obj: T, value: Props['style'][T]): this;
  1192. dirtyStyle(notRedraw?: boolean): void;
  1193. dirty(): void;
  1194. styleChanged(): boolean;
  1195. styleUpdated(): void;
  1196. createStyle(obj?: Props['style']): Props["style"];
  1197. useStyle(obj: Props['style']): void;
  1198. isStyleObject(obj: Props['style']): any;
  1199. protected _innerSaveToNormal(toState: DisplayableState): void;
  1200. protected _applyStateObj(stateName: string, state: DisplayableState, normalState: DisplayableState, keepCurrentStates: boolean, transition: boolean, animationCfg: ElementAnimateConfig): void;
  1201. protected _mergeStates(states: DisplayableState[]): DisplayableState;
  1202. protected _mergeStyle(targetStyle: CommonStyleProps, sourceStyle: CommonStyleProps): CommonStyleProps;
  1203. getAnimationStyleProps(): MapToType<DisplayableProps, boolean>;
  1204. protected static initDefaultProps: void;
  1205. }
  1206. interface PainterBase {
  1207. type: string;
  1208. root?: HTMLElement;
  1209. ssrOnly?: boolean;
  1210. resize(width?: number | string, height?: number | string): void;
  1211. refresh(): void;
  1212. clear(): void;
  1213. renderToString?(): string;
  1214. getType: () => string;
  1215. getWidth(): number;
  1216. getHeight(): number;
  1217. dispose(): void;
  1218. getViewportRoot: () => HTMLElement;
  1219. getViewportRootOffset: () => {
  1220. offsetLeft: number;
  1221. offsetTop: number;
  1222. };
  1223. refreshHover(): void;
  1224. configLayer(zlevel: number, config: Dictionary<any>): void;
  1225. setBackgroundColor(backgroundColor: string | GradientObject | PatternObject): void;
  1226. }
  1227. interface HandlerProxyInterface extends Eventful {
  1228. handler: Handler;
  1229. dispose: () => void;
  1230. setCursor: (cursorStyle?: string) => void;
  1231. }
  1232. declare function shapeCompareFunc(a: Displayable, b: Displayable): number;
  1233. declare class Storage {
  1234. private _roots;
  1235. private _displayList;
  1236. private _displayListLen;
  1237. traverse<T>(cb: (this: T, el: Element) => void, context?: T): void;
  1238. getDisplayList(update?: boolean, includeIgnore?: boolean): Displayable[];
  1239. updateDisplayList(includeIgnore?: boolean): void;
  1240. private _updateAndAddDisplayable;
  1241. addRoot(el: Element): void;
  1242. delRoot(el: Element | Element[]): void;
  1243. delAllRoots(): void;
  1244. getRoots(): Element<ElementProps>[];
  1245. dispose(): void;
  1246. displayableSortFunc: typeof shapeCompareFunc;
  1247. }
  1248. declare class HoveredResult {
  1249. x: number;
  1250. y: number;
  1251. target: Displayable;
  1252. topTarget: Displayable;
  1253. constructor(x?: number, y?: number);
  1254. }
  1255. declare type HandlerName = 'click' | 'dblclick' | 'mousewheel' | 'mouseout' | 'mouseup' | 'mousedown' | 'mousemove' | 'contextmenu';
  1256. declare class Handler extends Eventful {
  1257. storage: Storage;
  1258. painter: PainterBase;
  1259. painterRoot: HTMLElement;
  1260. proxy: HandlerProxyInterface;
  1261. private _hovered;
  1262. private _gestureMgr;
  1263. private _draggingMgr;
  1264. private _pointerSize;
  1265. _downEl: Element;
  1266. _upEl: Element;
  1267. _downPoint: [number, number];
  1268. constructor(storage: Storage, painter: PainterBase, proxy: HandlerProxyInterface, painterRoot: HTMLElement, pointerSize: number);
  1269. setHandlerProxy(proxy: HandlerProxyInterface): void;
  1270. mousemove(event: ZRRawEvent): void;
  1271. mouseout(event: ZRRawEvent): void;
  1272. resize(): void;
  1273. dispatch(eventName: HandlerName, eventArgs?: any): void;
  1274. dispose(): void;
  1275. setCursorStyle(cursorStyle: string): void;
  1276. dispatchToElement(targetInfo: {
  1277. target?: Element;
  1278. topTarget?: Element;
  1279. }, eventName: ElementEventName, event: ZRRawEvent): void;
  1280. findHover(x: number, y: number, exclude?: Displayable): HoveredResult;
  1281. processGesture(event: ZRRawEvent, stage?: 'start' | 'end' | 'change'): void;
  1282. click: (event: ZRRawEvent) => void;
  1283. mousedown: (event: ZRRawEvent) => void;
  1284. mouseup: (event: ZRRawEvent) => void;
  1285. mousewheel: (event: ZRRawEvent) => void;
  1286. dblclick: (event: ZRRawEvent) => void;
  1287. contextmenu: (event: ZRRawEvent) => void;
  1288. }
  1289. interface LayerConfig {
  1290. clearColor?: string | GradientObject | ImagePatternObject;
  1291. motionBlur?: boolean;
  1292. lastFrameAlpha?: number;
  1293. }
  1294. /*!
  1295. * ZRender, a high performance 2d drawing library.
  1296. *
  1297. * Copyright (c) 2013, Baidu Inc.
  1298. * All rights reserved.
  1299. *
  1300. * LICENSE
  1301. * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
  1302. */
  1303. declare type PainterBaseCtor = {
  1304. new (dom: HTMLElement, storage: Storage, ...args: any[]): PainterBase;
  1305. };
  1306. declare class ZRender {
  1307. dom?: HTMLElement;
  1308. id: number;
  1309. storage: Storage;
  1310. painter: PainterBase;
  1311. handler: Handler;
  1312. animation: Animation;
  1313. private _sleepAfterStill;
  1314. private _stillFrameAccum;
  1315. private _needsRefresh;
  1316. private _needsRefreshHover;
  1317. private _darkMode;
  1318. private _backgroundColor;
  1319. constructor(id: number, dom?: HTMLElement, opts?: ZRenderInitOpt);
  1320. add(el: Element): void;
  1321. remove(el: Element): void;
  1322. configLayer(zLevel: number, config: LayerConfig): void;
  1323. setBackgroundColor(backgroundColor: string | GradientObject | PatternObject): void;
  1324. getBackgroundColor(): string | GradientObject | PatternObject;
  1325. setDarkMode(darkMode: boolean): void;
  1326. isDarkMode(): boolean;
  1327. refreshImmediately(fromInside?: boolean): void;
  1328. refresh(): void;
  1329. flush(): void;
  1330. private _flush;
  1331. setSleepAfterStill(stillFramesCount: number): void;
  1332. wakeUp(): void;
  1333. refreshHover(): void;
  1334. refreshHoverImmediately(): void;
  1335. resize(opts?: {
  1336. width?: number | string;
  1337. height?: number | string;
  1338. }): void;
  1339. clearAnimation(): void;
  1340. getWidth(): number;
  1341. getHeight(): number;
  1342. setCursorStyle(cursorStyle: string): void;
  1343. findHover(x: number, y: number): {
  1344. target: Displayable;
  1345. topTarget: Displayable;
  1346. };
  1347. on<Ctx>(eventName: ElementEventName, eventHandler: ElementEventCallback<Ctx, ZRenderType>, context?: Ctx): this;
  1348. on<Ctx>(eventName: string, eventHandler: WithThisType<EventCallback<any[]>, unknown extends Ctx ? ZRenderType : Ctx>, context?: Ctx): this;
  1349. off(eventName?: string, eventHandler?: EventCallback): void;
  1350. trigger(eventName: string, event?: unknown): void;
  1351. clear(): void;
  1352. dispose(): void;
  1353. }
  1354. interface ZRenderInitOpt {
  1355. renderer?: string;
  1356. devicePixelRatio?: number;
  1357. width?: number | string;
  1358. height?: number | string;
  1359. useDirtyRect?: boolean;
  1360. useCoarsePointer?: 'auto' | boolean;
  1361. pointerSize?: number;
  1362. ssr?: boolean;
  1363. }
  1364. declare function init(dom?: HTMLElement | null, opts?: ZRenderInitOpt): ZRender;
  1365. declare function dispose(zr: ZRender): void;
  1366. declare function disposeAll(): void;
  1367. declare function getInstance(id: number): ZRender;
  1368. declare function registerPainter(name: string, Ctor: PainterBaseCtor): void;
  1369. declare const version = "5.4.0";
  1370. interface ZRenderType extends ZRender {
  1371. }
  1372. type zrender_d_ZRenderInitOpt = ZRenderInitOpt;
  1373. declare const zrender_d_init: typeof init;
  1374. declare const zrender_d_dispose: typeof dispose;
  1375. declare const zrender_d_disposeAll: typeof disposeAll;
  1376. declare const zrender_d_getInstance: typeof getInstance;
  1377. declare const zrender_d_registerPainter: typeof registerPainter;
  1378. declare const zrender_d_version: typeof version;
  1379. type zrender_d_ZRenderType = ZRenderType;
  1380. declare namespace zrender_d {
  1381. export {
  1382. zrender_d_ZRenderInitOpt as ZRenderInitOpt,
  1383. zrender_d_init as init,
  1384. zrender_d_dispose as dispose,
  1385. zrender_d_disposeAll as disposeAll,
  1386. zrender_d_getInstance as getInstance,
  1387. zrender_d_registerPainter as registerPainter,
  1388. zrender_d_version as version,
  1389. zrender_d_ZRenderType as ZRenderType,
  1390. };
  1391. }
  1392. declare const nativeSlice: (start?: number, end?: number) => any[];
  1393. declare function guid(): number;
  1394. declare function logError(...args: any[]): void;
  1395. declare function clone$2<T extends any>(source: T): T;
  1396. declare function merge<T extends Dictionary<any>, S extends Dictionary<any>>(target: T, source: S, overwrite?: boolean): T & S;
  1397. declare function merge<T extends any, S extends any>(target: T, source: S, overwrite?: boolean): T | S;
  1398. declare function mergeAll(targetAndSources: any[], overwrite?: boolean): any;
  1399. declare function extend<T extends Dictionary<any>, S extends Dictionary<any>>(target: T, source: S): T & S;
  1400. declare function defaults<T extends Dictionary<any>, S extends Dictionary<any>>(target: T, source: S, overlay?: boolean): T & S;
  1401. declare const createCanvas: () => HTMLCanvasElement;
  1402. declare function indexOf<T>(array: T[] | readonly T[] | ArrayLike$1<T>, value: T): number;
  1403. declare function inherits(clazz: Function, baseClazz: Function): void;
  1404. declare function mixin<T, S>(target: T | Function, source: S | Function, override?: boolean): void;
  1405. declare function isArrayLike(data: any): data is ArrayLike$1<any>;
  1406. declare function each<I extends Dictionary<any> | any[] | readonly any[] | ArrayLike$1<any>, Context>(arr: I, cb: (this: Context, value: I extends (infer T)[] | readonly (infer T)[] | ArrayLike$1<infer T> ? T : I extends Dictionary<any> ? I extends Record<infer K, infer T> ? T : unknown : unknown, index?: I extends any[] | readonly any[] | ArrayLike$1<any> ? number : keyof I & string, arr?: I) => void, context?: Context): void;
  1407. declare function map<T, R, Context>(arr: readonly T[], cb: (this: Context, val: T, index?: number, arr?: readonly T[]) => R, context?: Context): R[];
  1408. declare function reduce<T, S, Context>(arr: readonly T[], cb: (this: Context, previousValue: S, currentValue: T, currentIndex?: number, arr?: readonly T[]) => S, memo?: S, context?: Context): S;
  1409. declare function filter<T, Context>(arr: readonly T[], cb: (this: Context, value: T, index: number, arr: readonly T[]) => boolean, context?: Context): T[];
  1410. declare function find<T, Context>(arr: readonly T[], cb: (this: Context, value: T, index?: number, arr?: readonly T[]) => boolean, context?: Context): T;
  1411. declare function keys<T extends object>(obj: T): (KeyOfDistributive<T> & string)[];
  1412. declare type Bind1<F, Ctx> = F extends (this: Ctx, ...args: infer A) => infer R ? (...args: A) => R : unknown;
  1413. declare type Bind2<F, Ctx, T1> = F extends (this: Ctx, a: T1, ...args: infer A) => infer R ? (...args: A) => R : unknown;
  1414. declare type Bind3<F, Ctx, T1, T2> = F extends (this: Ctx, a: T1, b: T2, ...args: infer A) => infer R ? (...args: A) => R : unknown;
  1415. declare type Bind4<F, Ctx, T1, T2, T3> = F extends (this: Ctx, a: T1, b: T2, c: T3, ...args: infer A) => infer R ? (...args: A) => R : unknown;
  1416. declare type Bind5<F, Ctx, T1, T2, T3, T4> = F extends (this: Ctx, a: T1, b: T2, c: T3, d: T4, ...args: infer A) => infer R ? (...args: A) => R : unknown;
  1417. declare type BindFunc<Ctx> = (this: Ctx, ...arg: any[]) => any;
  1418. interface FunctionBind {
  1419. <F extends BindFunc<Ctx>, Ctx>(func: F, ctx: Ctx): Bind1<F, Ctx>;
  1420. <F extends BindFunc<Ctx>, Ctx, T1 extends Parameters<F>[0]>(func: F, ctx: Ctx, a: T1): Bind2<F, Ctx, T1>;
  1421. <F extends BindFunc<Ctx>, Ctx, T1 extends Parameters<F>[0], T2 extends Parameters<F>[1]>(func: F, ctx: Ctx, a: T1, b: T2): Bind3<F, Ctx, T1, T2>;
  1422. <F extends BindFunc<Ctx>, Ctx, T1 extends Parameters<F>[0], T2 extends Parameters<F>[1], T3 extends Parameters<F>[2]>(func: F, ctx: Ctx, a: T1, b: T2, c: T3): Bind4<F, Ctx, T1, T2, T3>;
  1423. <F extends BindFunc<Ctx>, Ctx, T1 extends Parameters<F>[0], T2 extends Parameters<F>[1], T3 extends Parameters<F>[2], T4 extends Parameters<F>[3]>(func: F, ctx: Ctx, a: T1, b: T2, c: T3, d: T4): Bind5<F, Ctx, T1, T2, T3, T4>;
  1424. }
  1425. declare const bind: FunctionBind;
  1426. declare type Curry1<F, T1> = F extends (a: T1, ...args: infer A) => infer R ? (...args: A) => R : unknown;
  1427. declare type Curry2<F, T1, T2> = F extends (a: T1, b: T2, ...args: infer A) => infer R ? (...args: A) => R : unknown;
  1428. declare type Curry3<F, T1, T2, T3> = F extends (a: T1, b: T2, c: T3, ...args: infer A) => infer R ? (...args: A) => R : unknown;
  1429. declare type Curry4<F, T1, T2, T3, T4> = F extends (a: T1, b: T2, c: T3, d: T4, ...args: infer A) => infer R ? (...args: A) => R : unknown;
  1430. declare type CurryFunc = (...arg: any[]) => any;
  1431. declare function curry<F extends CurryFunc, T1 extends Parameters<F>[0]>(func: F, a: T1): Curry1<F, T1>;
  1432. declare function curry<F extends CurryFunc, T1 extends Parameters<F>[0], T2 extends Parameters<F>[1]>(func: F, a: T1, b: T2): Curry2<F, T1, T2>;
  1433. declare function curry<F extends CurryFunc, T1 extends Parameters<F>[0], T2 extends Parameters<F>[1], T3 extends Parameters<F>[2]>(func: F, a: T1, b: T2, c: T3): Curry3<F, T1, T2, T3>;
  1434. declare function curry<F extends CurryFunc, T1 extends Parameters<F>[0], T2 extends Parameters<F>[1], T3 extends Parameters<F>[2], T4 extends Parameters<F>[3]>(func: F, a: T1, b: T2, c: T3, d: T4): Curry4<F, T1, T2, T3, T4>;
  1435. declare function isArray(value: any): value is any[];
  1436. declare function isFunction(value: any): value is Function;
  1437. declare function isString(value: any): value is string;
  1438. declare function isStringSafe(value: any): value is string;
  1439. declare function isNumber(value: any): value is number;
  1440. declare function isObject<T = unknown>(value: T): value is (object & T);
  1441. declare function isBuiltInObject(value: any): boolean;
  1442. declare function isTypedArray(value: any): boolean;
  1443. declare function isDom(value: any): value is HTMLElement;
  1444. declare function isGradientObject(value: any): value is GradientObject;
  1445. declare function isImagePatternObject(value: any): value is ImagePatternObject;
  1446. declare function isRegExp(value: unknown): value is RegExp;
  1447. declare function eqNaN(value: any): boolean;
  1448. declare function retrieve<T>(...args: T[]): T;
  1449. declare function retrieve2<T, R>(value0: T, value1: R): T | R;
  1450. declare function retrieve3<T, R, W>(value0: T, value1: R, value2: W): T | R | W;
  1451. declare type SliceParams = Parameters<typeof nativeSlice>;
  1452. declare function slice<T>(arr: ArrayLike$1<T>, ...args: SliceParams): T[];
  1453. declare function normalizeCssArray(val: number | number[]): number[];
  1454. declare function assert(condition: any, message?: string): void;
  1455. declare function trim(str: string): string;
  1456. declare function setAsPrimitive(obj: any): void;
  1457. declare function isPrimitive(obj: any): boolean;
  1458. declare class HashMap<T, KEY extends string | number = string | number> {
  1459. data: {
  1460. [key in KEY]: T;
  1461. };
  1462. constructor(obj?: HashMap<T, KEY> | {
  1463. [key in KEY]?: T;
  1464. } | KEY[]);
  1465. get(key: KEY): T;
  1466. set(key: KEY, value: T): T;
  1467. each<Context>(cb: (this: Context, value?: T, key?: KEY) => void, context?: Context): void;
  1468. keys(): KEY[];
  1469. removeKey(key: KEY): void;
  1470. }
  1471. declare function createHashMap<T, KEY extends string | number = string | number>(obj?: HashMap<T, KEY> | {
  1472. [key in KEY]?: T;
  1473. } | KEY[]): HashMap<T, KEY>;
  1474. declare function concatArray<T, R>(a: ArrayLike$1<T>, b: ArrayLike$1<R>): ArrayLike$1<T | R>;
  1475. declare function createObject<T>(proto?: object, properties?: T): T;
  1476. declare function disableUserSelect(dom: HTMLElement): void;
  1477. declare function hasOwn(own: object, prop: string): boolean;
  1478. declare function noop(): void;
  1479. declare const RADIAN_TO_DEGREE: number;
  1480. declare const util_d_curry: typeof curry;
  1481. declare const util_d_guid: typeof guid;
  1482. declare const util_d_logError: typeof logError;
  1483. declare const util_d_merge: typeof merge;
  1484. declare const util_d_mergeAll: typeof mergeAll;
  1485. declare const util_d_extend: typeof extend;
  1486. declare const util_d_defaults: typeof defaults;
  1487. declare const util_d_createCanvas: typeof createCanvas;
  1488. declare const util_d_indexOf: typeof indexOf;
  1489. declare const util_d_inherits: typeof inherits;
  1490. declare const util_d_mixin: typeof mixin;
  1491. declare const util_d_isArrayLike: typeof isArrayLike;
  1492. declare const util_d_each: typeof each;
  1493. declare const util_d_map: typeof map;
  1494. declare const util_d_reduce: typeof reduce;
  1495. declare const util_d_filter: typeof filter;
  1496. declare const util_d_find: typeof find;
  1497. declare const util_d_keys: typeof keys;
  1498. type util_d_Bind1<F, Ctx> = Bind1<F, Ctx>;
  1499. type util_d_Bind2<F, Ctx, T1> = Bind2<F, Ctx, T1>;
  1500. type util_d_Bind3<F, Ctx, T1, T2> = Bind3<F, Ctx, T1, T2>;
  1501. type util_d_Bind4<F, Ctx, T1, T2, T3> = Bind4<F, Ctx, T1, T2, T3>;
  1502. type util_d_Bind5<F, Ctx, T1, T2, T3, T4> = Bind5<F, Ctx, T1, T2, T3, T4>;
  1503. declare const util_d_bind: typeof bind;
  1504. type util_d_Curry1<F, T1> = Curry1<F, T1>;
  1505. type util_d_Curry2<F, T1, T2> = Curry2<F, T1, T2>;
  1506. type util_d_Curry3<F, T1, T2, T3> = Curry3<F, T1, T2, T3>;
  1507. type util_d_Curry4<F, T1, T2, T3, T4> = Curry4<F, T1, T2, T3, T4>;
  1508. declare const util_d_isArray: typeof isArray;
  1509. declare const util_d_isFunction: typeof isFunction;
  1510. declare const util_d_isString: typeof isString;
  1511. declare const util_d_isStringSafe: typeof isStringSafe;
  1512. declare const util_d_isNumber: typeof isNumber;
  1513. declare const util_d_isObject: typeof isObject;
  1514. declare const util_d_isBuiltInObject: typeof isBuiltInObject;
  1515. declare const util_d_isTypedArray: typeof isTypedArray;
  1516. declare const util_d_isDom: typeof isDom;
  1517. declare const util_d_isGradientObject: typeof isGradientObject;
  1518. declare const util_d_isImagePatternObject: typeof isImagePatternObject;
  1519. declare const util_d_isRegExp: typeof isRegExp;
  1520. declare const util_d_eqNaN: typeof eqNaN;
  1521. declare const util_d_retrieve: typeof retrieve;
  1522. declare const util_d_retrieve2: typeof retrieve2;
  1523. declare const util_d_retrieve3: typeof retrieve3;
  1524. declare const util_d_slice: typeof slice;
  1525. declare const util_d_normalizeCssArray: typeof normalizeCssArray;
  1526. declare const util_d_assert: typeof assert;
  1527. declare const util_d_trim: typeof trim;
  1528. declare const util_d_setAsPrimitive: typeof setAsPrimitive;
  1529. declare const util_d_isPrimitive: typeof isPrimitive;
  1530. type util_d_HashMap<T, KEY extends string | number = string | number> = HashMap<T, KEY>;
  1531. declare const util_d_HashMap: typeof HashMap;
  1532. declare const util_d_createHashMap: typeof createHashMap;
  1533. declare const util_d_concatArray: typeof concatArray;
  1534. declare const util_d_createObject: typeof createObject;
  1535. declare const util_d_disableUserSelect: typeof disableUserSelect;
  1536. declare const util_d_hasOwn: typeof hasOwn;
  1537. declare const util_d_noop: typeof noop;
  1538. declare const util_d_RADIAN_TO_DEGREE: typeof RADIAN_TO_DEGREE;
  1539. declare namespace util_d {
  1540. export {
  1541. util_d_curry as curry,
  1542. util_d_guid as guid,
  1543. util_d_logError as logError,
  1544. clone$2 as clone,
  1545. util_d_merge as merge,
  1546. util_d_mergeAll as mergeAll,
  1547. util_d_extend as extend,
  1548. util_d_defaults as defaults,
  1549. util_d_createCanvas as createCanvas,
  1550. util_d_indexOf as indexOf,
  1551. util_d_inherits as inherits,
  1552. util_d_mixin as mixin,
  1553. util_d_isArrayLike as isArrayLike,
  1554. util_d_each as each,
  1555. util_d_map as map,
  1556. util_d_reduce as reduce,
  1557. util_d_filter as filter,
  1558. util_d_find as find,
  1559. util_d_keys as keys,
  1560. util_d_Bind1 as Bind1,
  1561. util_d_Bind2 as Bind2,
  1562. util_d_Bind3 as Bind3,
  1563. util_d_Bind4 as Bind4,
  1564. util_d_Bind5 as Bind5,
  1565. util_d_bind as bind,
  1566. util_d_Curry1 as Curry1,
  1567. util_d_Curry2 as Curry2,
  1568. util_d_Curry3 as Curry3,
  1569. util_d_Curry4 as Curry4,
  1570. util_d_isArray as isArray,
  1571. util_d_isFunction as isFunction,
  1572. util_d_isString as isString,
  1573. util_d_isStringSafe as isStringSafe,
  1574. util_d_isNumber as isNumber,
  1575. util_d_isObject as isObject,
  1576. util_d_isBuiltInObject as isBuiltInObject,
  1577. util_d_isTypedArray as isTypedArray,
  1578. util_d_isDom as isDom,
  1579. util_d_isGradientObject as isGradientObject,
  1580. util_d_isImagePatternObject as isImagePatternObject,
  1581. util_d_isRegExp as isRegExp,
  1582. util_d_eqNaN as eqNaN,
  1583. util_d_retrieve as retrieve,
  1584. util_d_retrieve2 as retrieve2,
  1585. util_d_retrieve3 as retrieve3,
  1586. util_d_slice as slice,
  1587. util_d_normalizeCssArray as normalizeCssArray,
  1588. util_d_assert as assert,
  1589. util_d_trim as trim,
  1590. util_d_setAsPrimitive as setAsPrimitive,
  1591. util_d_isPrimitive as isPrimitive,
  1592. util_d_HashMap as HashMap,
  1593. util_d_createHashMap as createHashMap,
  1594. util_d_concatArray as concatArray,
  1595. util_d_createObject as createObject,
  1596. util_d_disableUserSelect as disableUserSelect,
  1597. util_d_hasOwn as hasOwn,
  1598. util_d_noop as noop,
  1599. util_d_RADIAN_TO_DEGREE as RADIAN_TO_DEGREE,
  1600. };
  1601. }
  1602. declare function encodeHTML(source: string): string;
  1603. interface InnerTruncateOption {
  1604. maxIteration?: number;
  1605. minChar?: number;
  1606. placeholder?: string;
  1607. maxIterations?: number;
  1608. }
  1609. declare function truncateText(text: string, containerWidth: number, font: string, ellipsis: string, options: InnerTruncateOption): string;
  1610. declare type SVGPathOption = Omit<PathProps, 'shape' | 'buildPath'>;
  1611. declare class SVGPath extends Path {
  1612. applyTransform(m: MatrixArray): void;
  1613. }
  1614. declare function extendFromString(str: string, defaultOpts?: SVGPathOption): typeof SVGPath;
  1615. declare function mergePath(pathEls: Path[], opts: PathProps): Path<PathProps>;
  1616. declare class CircleShape {
  1617. cx: number;
  1618. cy: number;
  1619. r: number;
  1620. }
  1621. interface CircleProps extends PathProps {
  1622. shape?: Partial<CircleShape>;
  1623. }
  1624. declare class Circle extends Path<CircleProps> {
  1625. shape: CircleShape;
  1626. constructor(opts?: CircleProps);
  1627. getDefaultShape(): CircleShape;
  1628. buildPath(ctx: CanvasRenderingContext2D, shape: CircleShape): void;
  1629. }
  1630. declare class EllipseShape {
  1631. cx: number;
  1632. cy: number;
  1633. rx: number;
  1634. ry: number;
  1635. }
  1636. interface EllipseProps extends PathProps {
  1637. shape?: Partial<EllipseShape>;
  1638. }
  1639. declare class Ellipse extends Path<EllipseProps> {
  1640. shape: EllipseShape;
  1641. constructor(opts?: EllipseProps);
  1642. getDefaultShape(): EllipseShape;
  1643. buildPath(ctx: CanvasRenderingContext2D, shape: EllipseShape): void;
  1644. }
  1645. declare class SectorShape {
  1646. cx: number;
  1647. cy: number;
  1648. r0: number;
  1649. r: number;
  1650. startAngle: number;
  1651. endAngle: number;
  1652. clockwise: boolean;
  1653. cornerRadius: number | number[];
  1654. }
  1655. interface SectorProps extends PathProps {
  1656. shape?: Partial<SectorShape>;
  1657. }
  1658. declare class Sector extends Path<SectorProps> {
  1659. shape: SectorShape;
  1660. constructor(opts?: SectorProps);
  1661. getDefaultShape(): SectorShape;
  1662. buildPath(ctx: CanvasRenderingContext2D, shape: SectorShape): void;
  1663. isZeroArea(): boolean;
  1664. }
  1665. declare class RingShape {
  1666. cx: number;
  1667. cy: number;
  1668. r: number;
  1669. r0: number;
  1670. }
  1671. interface RingProps extends PathProps {
  1672. shape?: Partial<RingShape>;
  1673. }
  1674. declare class Ring extends Path<RingProps> {
  1675. shape: RingShape;
  1676. constructor(opts?: RingProps);
  1677. getDefaultShape(): RingShape;
  1678. buildPath(ctx: CanvasRenderingContext2D, shape: RingShape): void;
  1679. }
  1680. declare class PolygonShape {
  1681. points: VectorArray[];
  1682. smooth?: number;
  1683. smoothConstraint?: VectorArray[];
  1684. }
  1685. interface PolygonProps extends PathProps {
  1686. shape?: Partial<PolygonShape>;
  1687. }
  1688. declare class Polygon extends Path<PolygonProps> {
  1689. shape: PolygonShape;
  1690. constructor(opts?: PolygonProps);
  1691. getDefaultShape(): PolygonShape;
  1692. buildPath(ctx: CanvasRenderingContext2D, shape: PolygonShape): void;
  1693. }
  1694. declare class LineShape {
  1695. x1: number;
  1696. y1: number;
  1697. x2: number;
  1698. y2: number;
  1699. percent: number;
  1700. }
  1701. interface LineProps extends PathProps {
  1702. shape?: Partial<LineShape>;
  1703. }
  1704. declare class Line extends Path<LineProps> {
  1705. shape: LineShape;
  1706. constructor(opts?: LineProps);
  1707. getDefaultStyle(): {
  1708. stroke: string;
  1709. fill: string;
  1710. };
  1711. getDefaultShape(): LineShape;
  1712. buildPath(ctx: CanvasRenderingContext2D, shape: LineShape): void;
  1713. pointAt(p: number): VectorArray;
  1714. }
  1715. declare class BezierCurveShape {
  1716. x1: number;
  1717. y1: number;
  1718. x2: number;
  1719. y2: number;
  1720. cpx1: number;
  1721. cpy1: number;
  1722. cpx2?: number;
  1723. cpy2?: number;
  1724. percent: number;
  1725. }
  1726. interface BezierCurveProps extends PathProps {
  1727. shape?: Partial<BezierCurveShape>;
  1728. }
  1729. declare class BezierCurve extends Path<BezierCurveProps> {
  1730. shape: BezierCurveShape;
  1731. constructor(opts?: BezierCurveProps);
  1732. getDefaultStyle(): {
  1733. stroke: string;
  1734. fill: string;
  1735. };
  1736. getDefaultShape(): BezierCurveShape;
  1737. buildPath(ctx: CanvasRenderingContext2D, shape: BezierCurveShape): void;
  1738. pointAt(t: number): number[];
  1739. tangentAt(t: number): number[];
  1740. }
  1741. declare class ArcShape {
  1742. cx: number;
  1743. cy: number;
  1744. r: number;
  1745. startAngle: number;
  1746. endAngle: number;
  1747. clockwise?: boolean;
  1748. }
  1749. interface ArcProps extends PathProps {
  1750. shape?: Partial<ArcShape>;
  1751. }
  1752. declare class Arc extends Path<ArcProps> {
  1753. shape: ArcShape;
  1754. constructor(opts?: ArcProps);
  1755. getDefaultStyle(): {
  1756. stroke: string;
  1757. fill: string;
  1758. };
  1759. getDefaultShape(): ArcShape;
  1760. buildPath(ctx: CanvasRenderingContext2D, shape: ArcShape): void;
  1761. }
  1762. interface CompoundPathShape {
  1763. paths: Path[];
  1764. }
  1765. declare class CompoundPath extends Path {
  1766. type: string;
  1767. shape: CompoundPathShape;
  1768. private _updatePathDirty;
  1769. beforeBrush(): void;
  1770. buildPath(ctx: PathProxy | CanvasRenderingContext2D, shape: CompoundPathShape): void;
  1771. afterBrush(): void;
  1772. getBoundingRect(): BoundingRect;
  1773. }
  1774. declare class IncrementalDisplayable extends Displayable {
  1775. notClear: boolean;
  1776. incremental: boolean;
  1777. private _displayables;
  1778. private _temporaryDisplayables;
  1779. private _cursor;
  1780. traverse<T>(cb: (this: T, el: this) => void, context: T): void;
  1781. useStyle(): void;
  1782. getCursor(): number;
  1783. innerAfterBrush(): void;
  1784. clearDisplaybles(): void;
  1785. clearTemporalDisplayables(): void;
  1786. addDisplayable(displayable: Displayable, notPersistent?: boolean): void;
  1787. addDisplayables(displayables: Displayable[], notPersistent?: boolean): void;
  1788. getDisplayables(): Displayable[];
  1789. getTemporalDisplayables(): Displayable[];
  1790. eachPendingDisplayable(cb: (displayable: Displayable) => void): void;
  1791. update(): void;
  1792. getBoundingRect(): BoundingRect;
  1793. contain(x: number, y: number): boolean;
  1794. }
  1795. declare type Constructor = new (...args: any) => any;
  1796. interface ClassManager {
  1797. registerClass: (clz: Constructor) => Constructor;
  1798. getClass: (componentMainType: ComponentMainType, subType?: ComponentSubType, throwWhenNotFound?: boolean) => Constructor;
  1799. getClassesByMainType: (componentType: ComponentMainType) => Constructor[];
  1800. hasClass: (componentType: ComponentFullType) => boolean;
  1801. getAllClassMainTypes: () => ComponentMainType[];
  1802. hasSubTypes: (componentType: ComponentFullType) => boolean;
  1803. }
  1804. interface SubTypeDefaulter {
  1805. (option: ComponentOption): ComponentSubType;
  1806. }
  1807. interface SubTypeDefaulterManager {
  1808. registerSubTypeDefaulter: (componentType: string, defaulter: SubTypeDefaulter) => void;
  1809. determineSubType: (componentType: string, option: ComponentOption) => string;
  1810. }
  1811. declare type DiffKeyGetter<CTX = unknown> = (this: DataDiffer<CTX>, value: unknown, index: number) => string;
  1812. declare type DiffCallbackAdd = (newIndex: number) => void;
  1813. declare type DiffCallbackUpdate = (newIndex: number, oldIndex: number) => void;
  1814. declare type DiffCallbackRemove = (oldIndex: number) => void;
  1815. declare type DiffCallbackUpdateManyToOne = (newIndex: number, oldIndex: number[]) => void;
  1816. declare type DiffCallbackUpdateOneToMany = (newIndex: number[], oldIndex: number) => void;
  1817. declare type DiffCallbackUpdateManyToMany = (newIndex: number[], oldIndex: number[]) => void;
  1818. declare type DataDiffMode = 'oneToOne' | 'multiple';
  1819. declare class DataDiffer<CTX = unknown> {
  1820. private _old;
  1821. private _new;
  1822. private _oldKeyGetter;
  1823. private _newKeyGetter;
  1824. private _add;
  1825. private _update;
  1826. private _updateManyToOne;
  1827. private _updateOneToMany;
  1828. private _updateManyToMany;
  1829. private _remove;
  1830. private _diffModeMultiple;
  1831. readonly context: CTX;
  1832. /**
  1833. * @param context Can be visited by this.context in callback.
  1834. */
  1835. constructor(oldArr: ArrayLike$1<unknown>, newArr: ArrayLike$1<unknown>, oldKeyGetter?: DiffKeyGetter<CTX>, newKeyGetter?: DiffKeyGetter<CTX>, context?: CTX, diffMode?: DataDiffMode);
  1836. /**
  1837. * Callback function when add a data
  1838. */
  1839. add(func: DiffCallbackAdd): this;
  1840. /**
  1841. * Callback function when update a data
  1842. */
  1843. update(func: DiffCallbackUpdate): this;
  1844. /**
  1845. * Callback function when update a data and only work in `cbMode: 'byKey'`.
  1846. */
  1847. updateManyToOne(func: DiffCallbackUpdateManyToOne): this;
  1848. /**
  1849. * Callback function when update a data and only work in `cbMode: 'byKey'`.
  1850. */
  1851. updateOneToMany(func: DiffCallbackUpdateOneToMany): this;
  1852. /**
  1853. * Callback function when update a data and only work in `cbMode: 'byKey'`.
  1854. */
  1855. updateManyToMany(func: DiffCallbackUpdateManyToMany): this;
  1856. /**
  1857. * Callback function when remove a data
  1858. */
  1859. remove(func: DiffCallbackRemove): this;
  1860. execute(): void;
  1861. private _executeOneToOne;
  1862. /**
  1863. * For example, consider the case:
  1864. * oldData: [o0, o1, o2, o3, o4, o5, o6, o7],
  1865. * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8],
  1866. * Where:
  1867. * o0, o1, n0 has key 'a' (many to one)
  1868. * o5, n4, n5, n6 has key 'b' (one to many)
  1869. * o2, n1 has key 'c' (one to one)
  1870. * n2, n3 has key 'd' (add)
  1871. * o3, o4 has key 'e' (remove)
  1872. * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove)
  1873. * Then:
  1874. * (The order of the following directives are not ensured.)
  1875. * this._updateManyToOne(n0, [o0, o1]);
  1876. * this._updateOneToMany([n4, n5, n6], o5);
  1877. * this._update(n1, o2);
  1878. * this._remove(o3);
  1879. * this._remove(o4);
  1880. * this._remove(o6);
  1881. * this._remove(o7);
  1882. * this._add(n2);
  1883. * this._add(n3);
  1884. * this._add(n7);
  1885. * this._add(n8);
  1886. */
  1887. private _executeMultiple;
  1888. private _performRestAdd;
  1889. private _initIndexMap;
  1890. }
  1891. declare type PipedDataTransformOption = DataTransformOption[];
  1892. declare type DataTransformType = string;
  1893. declare type DataTransformConfig = unknown;
  1894. interface DataTransformOption {
  1895. type: DataTransformType;
  1896. config?: DataTransformConfig;
  1897. print?: boolean;
  1898. }
  1899. interface ExternalDataTransform<TO extends DataTransformOption = DataTransformOption> {
  1900. type: string;
  1901. __isBuiltIn?: boolean;
  1902. transform: (param: ExternalDataTransformParam<TO>) => ExternalDataTransformResultItem | ExternalDataTransformResultItem[];
  1903. }
  1904. interface ExternalDataTransformParam<TO extends DataTransformOption = DataTransformOption> {
  1905. upstream: ExternalSource;
  1906. upstreamList: ExternalSource[];
  1907. config: TO['config'];
  1908. }
  1909. interface ExternalDataTransformResultItem {
  1910. /**
  1911. * If `data` is null/undefined, inherit upstream data.
  1912. */
  1913. data: OptionSourceDataArrayRows | OptionSourceDataObjectRows;
  1914. /**
  1915. * A `transform` can optionally return a dimensions definition.
  1916. * The rule:
  1917. * If this `transform result` have different dimensions from the upstream, it should return
  1918. * a new dimension definition. For example, this transform inherit the upstream data totally
  1919. * but add a extra dimension.
  1920. * Otherwise, do not need to return that dimension definition. echarts will inherit dimension
  1921. * definition from the upstream.
  1922. */
  1923. dimensions?: DimensionDefinitionLoose[];
  1924. }
  1925. declare type DataTransformDataItem = ExternalDataTransformResultItem['data'][number];
  1926. interface ExternalDimensionDefinition extends Partial<DimensionDefinition> {
  1927. index: DimensionIndex;
  1928. }
  1929. /**
  1930. * TODO: disable writable.
  1931. * This structure will be exposed to users.
  1932. */
  1933. declare class ExternalSource {
  1934. /**
  1935. * [Caveat]
  1936. * This instance is to be exposed to users.
  1937. * (1) DO NOT mount private members on this instance directly.
  1938. * If we have to use private members, we can make them in closure or use `makeInner`.
  1939. * (2) "soruce header count" is not provided to transform, because it's complicated to manage
  1940. * header and dimensions definition in each transfrom. Source header are all normalized to
  1941. * dimensions definitions in transforms and their downstreams.
  1942. */
  1943. sourceFormat: SourceFormat;
  1944. getRawData(): Source['data'];
  1945. getRawDataItem(dataIndex: number): DataTransformDataItem;
  1946. cloneRawData(): Source['data'];
  1947. /**
  1948. * @return If dimension not found, return null/undefined.
  1949. */
  1950. getDimensionInfo(dim: DimensionLoose): ExternalDimensionDefinition;
  1951. /**
  1952. * dimensions defined if and only if either:
  1953. * (a) dataset.dimensions are declared.
  1954. * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`).
  1955. * If dimensions are defined, `dimensionInfoAll` is corresponding to
  1956. * the defined dimensions.
  1957. * Otherwise, `dimensionInfoAll` is determined by data columns.
  1958. * @return Always return an array (even empty array).
  1959. */
  1960. cloneAllDimensionInfo(): ExternalDimensionDefinition[];
  1961. count(): number;
  1962. /**
  1963. * Only support by dimension index.
  1964. * No need to support by dimension name in transform function,
  1965. * becuase transform function is not case-specific, no need to use name literally.
  1966. */
  1967. retrieveValue(dataIndex: number, dimIndex: DimensionIndex): OptionDataValue;
  1968. retrieveValueFromItem(dataItem: DataTransformDataItem, dimIndex: DimensionIndex): OptionDataValue;
  1969. convertValue(rawVal: unknown, dimInfo: ExternalDimensionDefinition): ParsedValue;
  1970. }
  1971. declare function registerExternalTransform(externalTransform: ExternalDataTransform): void;
  1972. interface PaletteMixin<T extends PaletteOptionMixin = PaletteOptionMixin> extends Pick<Model<T>, 'get'> {
  1973. }
  1974. declare class PaletteMixin<T extends PaletteOptionMixin = PaletteOptionMixin> {
  1975. getColorFromPalette(this: PaletteMixin<T>, name: string, scope?: any, requestNum?: number): ZRColor;
  1976. clearColorPalette(this: PaletteMixin<T>): void;
  1977. }
  1978. interface ComponentView {
  1979. /**
  1980. * Implement it if needed.
  1981. */
  1982. updateTransform?(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void | {
  1983. update: true;
  1984. };
  1985. /**
  1986. * Pass only when return `true`.
  1987. * Implement it if needed.
  1988. */
  1989. filterForExposedEvent(eventType: string, query: EventQueryItem, targetEl: Element, packedEvent: ECActionEvent | ECElementEvent): boolean;
  1990. /**
  1991. * Find dispatchers for highlight/downplay by name.
  1992. * If this methods provided, hover link (within the same name) is enabled in component.
  1993. * That is, in component, a name can correspond to multiple dispatchers.
  1994. * Those dispatchers can have no common ancestor.
  1995. * The highlight/downplay state change will be applied on the
  1996. * dispatchers and their descendents.
  1997. *
  1998. * @return Must return an array but not null/undefined.
  1999. */
  2000. findHighDownDispatchers?(name: string): Element[];
  2001. focusBlurEnabled?: boolean;
  2002. }
  2003. declare class ComponentView {
  2004. readonly group: ViewRootGroup;
  2005. readonly uid: string;
  2006. __model: ComponentModel;
  2007. __alive: boolean;
  2008. __id: string;
  2009. constructor();
  2010. init(ecModel: GlobalModel, api: ExtensionAPI): void;
  2011. render(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2012. dispose(ecModel: GlobalModel, api: ExtensionAPI): void;
  2013. updateView(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2014. updateLayout(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2015. updateVisual(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2016. /**
  2017. * Hook for toggle blur target series.
  2018. * Can be used in marker for blur or leave blur the markers
  2019. */
  2020. toggleBlurSeries(seriesModels: SeriesModel[], isBlur: boolean, ecModel: GlobalModel): void;
  2021. /**
  2022. * Traverse the new rendered elements.
  2023. *
  2024. * It will traverse the new added element in progressive rendering.
  2025. * And traverse all in normal rendering.
  2026. */
  2027. eachRendered(cb: (el: Element) => boolean | void): void;
  2028. static registerClass: ClassManager['registerClass'];
  2029. }
  2030. interface TaskContext {
  2031. outputData?: SeriesData;
  2032. data?: SeriesData;
  2033. payload?: Payload;
  2034. model?: SeriesModel;
  2035. }
  2036. declare type TaskResetCallback<Ctx extends TaskContext> = (this: Task<Ctx>, context: Ctx) => TaskResetCallbackReturn<Ctx>;
  2037. declare type TaskResetCallbackReturn<Ctx extends TaskContext> = void | (TaskProgressCallback<Ctx> | TaskProgressCallback<Ctx>[]) | {
  2038. forceFirstProgress?: boolean;
  2039. progress: TaskProgressCallback<Ctx> | TaskProgressCallback<Ctx>[];
  2040. };
  2041. declare type TaskProgressCallback<Ctx extends TaskContext> = (this: Task<Ctx>, params: TaskProgressParams, context: Ctx) => void;
  2042. declare type TaskProgressParams = {
  2043. start: number;
  2044. end: number;
  2045. count: number;
  2046. next?: TaskDataIteratorNext;
  2047. };
  2048. declare type TaskPlanCallback<Ctx extends TaskContext> = (this: Task<Ctx>, context: Ctx) => TaskPlanCallbackReturn;
  2049. declare type TaskPlanCallbackReturn = 'reset' | false | null | undefined;
  2050. declare type TaskCountCallback<Ctx extends TaskContext> = (this: Task<Ctx>, context: Ctx) => number;
  2051. declare type TaskOnDirtyCallback<Ctx extends TaskContext> = (this: Task<Ctx>, context: Ctx) => void;
  2052. declare type TaskDataIteratorNext = () => number;
  2053. declare type TaskDefineParam<Ctx extends TaskContext> = {
  2054. reset?: TaskResetCallback<Ctx>;
  2055. plan?: TaskPlanCallback<Ctx>;
  2056. count?: TaskCountCallback<Ctx>;
  2057. onDirty?: TaskOnDirtyCallback<Ctx>;
  2058. };
  2059. declare type PerformArgs = {
  2060. step?: number;
  2061. skip?: boolean;
  2062. modBy?: number;
  2063. modDataCount?: number;
  2064. };
  2065. declare class Task<Ctx extends TaskContext> {
  2066. private _reset;
  2067. private _plan;
  2068. private _count;
  2069. private _onDirty;
  2070. private _progress;
  2071. private _callingProgress;
  2072. private _dirty;
  2073. private _modBy;
  2074. private _modDataCount;
  2075. private _upstream;
  2076. private _downstream;
  2077. private _dueEnd;
  2078. private _outputDueEnd;
  2079. private _settedOutputEnd;
  2080. private _dueIndex;
  2081. private _disposed;
  2082. __pipeline: Pipeline;
  2083. __idxInPipeline: number;
  2084. __block: boolean;
  2085. context: Ctx;
  2086. constructor(define: TaskDefineParam<Ctx>);
  2087. /**
  2088. * @param step Specified step.
  2089. * @param skip Skip customer perform call.
  2090. * @param modBy Sampling window size.
  2091. * @param modDataCount Sampling count.
  2092. * @return whether unfinished.
  2093. */
  2094. perform(performArgs?: PerformArgs): boolean;
  2095. dirty(): void;
  2096. private _doProgress;
  2097. private _doReset;
  2098. unfinished(): boolean;
  2099. /**
  2100. * @param downTask The downstream task.
  2101. * @return The downstream task.
  2102. */
  2103. pipe(downTask: Task<Ctx>): void;
  2104. dispose(): void;
  2105. getUpstream(): Task<Ctx>;
  2106. getDownstream(): Task<Ctx>;
  2107. setOutputEnd(end: number): void;
  2108. }
  2109. declare type GeneralTask = Task<TaskContext>;
  2110. declare type SeriesTask = Task<SeriesTaskContext>;
  2111. declare type Pipeline = {
  2112. id: string;
  2113. head: GeneralTask;
  2114. tail: GeneralTask;
  2115. threshold: number;
  2116. progressiveEnabled: boolean;
  2117. blockIndex: number;
  2118. step: number;
  2119. count: number;
  2120. currentTask?: GeneralTask;
  2121. context?: PipelineContext;
  2122. };
  2123. declare type PipelineContext = {
  2124. progressiveRender: boolean;
  2125. modDataCount: number;
  2126. large: boolean;
  2127. };
  2128. declare type PerformStageTaskOpt = {
  2129. block?: boolean;
  2130. setDirty?: boolean;
  2131. visualType?: StageHandlerInternal['visualType'];
  2132. dirtyMap?: HashMap<any>;
  2133. };
  2134. interface SeriesTaskContext extends TaskContext {
  2135. model?: SeriesModel;
  2136. data?: SeriesData;
  2137. view?: ChartView;
  2138. ecModel?: GlobalModel;
  2139. api?: ExtensionAPI;
  2140. useClearVisual?: boolean;
  2141. plan?: StageHandlerPlan;
  2142. reset?: StageHandlerReset;
  2143. scheduler?: Scheduler;
  2144. payload?: Payload;
  2145. resetDefines?: StageHandlerProgressExecutor[];
  2146. }
  2147. interface OverallTaskContext extends TaskContext {
  2148. ecModel: GlobalModel;
  2149. api: ExtensionAPI;
  2150. overallReset: StageHandlerOverallReset;
  2151. scheduler: Scheduler;
  2152. payload?: Payload;
  2153. }
  2154. declare class Scheduler {
  2155. readonly ecInstance: EChartsType;
  2156. readonly api: ExtensionAPI;
  2157. unfinished: boolean;
  2158. private _dataProcessorHandlers;
  2159. private _visualHandlers;
  2160. private _allHandlers;
  2161. private _stageTaskMap;
  2162. private _pipelineMap;
  2163. constructor(ecInstance: EChartsType, api: ExtensionAPI, dataProcessorHandlers: StageHandlerInternal[], visualHandlers: StageHandlerInternal[]);
  2164. restoreData(ecModel: GlobalModel, payload: Payload): void;
  2165. getPerformArgs(task: GeneralTask, isBlock?: boolean): {
  2166. step: number;
  2167. modBy: number;
  2168. modDataCount: number;
  2169. };
  2170. getPipeline(pipelineId: string): Pipeline;
  2171. /**
  2172. * Current, progressive rendering starts from visual and layout.
  2173. * Always detect render mode in the same stage, avoiding that incorrect
  2174. * detection caused by data filtering.
  2175. * Caution:
  2176. * `updateStreamModes` use `seriesModel.getData()`.
  2177. */
  2178. updateStreamModes(seriesModel: SeriesModel<SeriesOption & SeriesLargeOptionMixin>, view: ChartView): void;
  2179. restorePipelines(ecModel: GlobalModel): void;
  2180. prepareStageTasks(): void;
  2181. prepareView(view: ChartView, model: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI): void;
  2182. performDataProcessorTasks(ecModel: GlobalModel, payload?: Payload): void;
  2183. performVisualTasks(ecModel: GlobalModel, payload?: Payload, opt?: PerformStageTaskOpt): void;
  2184. private _performStageTasks;
  2185. performSeriesTasks(ecModel: GlobalModel): void;
  2186. plan(): void;
  2187. updatePayload(task: Task<SeriesTaskContext | OverallTaskContext>, payload: Payload | 'remain'): void;
  2188. private _createSeriesStageTask;
  2189. private _createOverallStageTask;
  2190. private _pipe;
  2191. static wrapStageHandler(stageHandler: StageHandler | StageHandlerOverallReset, visualType: StageHandlerInternal['visualType']): StageHandlerInternal;
  2192. }
  2193. interface ChartView {
  2194. /**
  2195. * Rendering preparation in progressive mode.
  2196. * Implement it if needed.
  2197. */
  2198. incrementalPrepareRender(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2199. /**
  2200. * Render in progressive mode.
  2201. * Implement it if needed.
  2202. * @param params See taskParams in `stream/task.js`
  2203. */
  2204. incrementalRender(params: StageHandlerProgressParams, seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2205. /**
  2206. * Update transform directly.
  2207. * Implement it if needed.
  2208. */
  2209. updateTransform(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void | {
  2210. update: true;
  2211. };
  2212. /**
  2213. * The view contains the given point.
  2214. * Implement it if needed.
  2215. */
  2216. containPoint(point: number[], seriesModel: SeriesModel): boolean;
  2217. /**
  2218. * Pass only when return `true`.
  2219. * Implement it if needed.
  2220. */
  2221. filterForExposedEvent(eventType: string, query: EventQueryItem, targetEl: Element, packedEvent: ECActionEvent | ECElementEvent): boolean;
  2222. }
  2223. declare class ChartView {
  2224. type: string;
  2225. readonly group: ViewRootGroup;
  2226. readonly uid: string;
  2227. readonly renderTask: SeriesTask;
  2228. /**
  2229. * Ignore label line update in global stage. Will handle it in chart itself.
  2230. * Used in pie / funnel
  2231. */
  2232. ignoreLabelLineUpdate: boolean;
  2233. __alive: boolean;
  2234. __model: SeriesModel;
  2235. __id: string;
  2236. static protoInitialize: void;
  2237. constructor();
  2238. init(ecModel: GlobalModel, api: ExtensionAPI): void;
  2239. render(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2240. /**
  2241. * Highlight series or specified data item.
  2242. */
  2243. highlight(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2244. /**
  2245. * Downplay series or specified data item.
  2246. */
  2247. downplay(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2248. /**
  2249. * Remove self.
  2250. */
  2251. remove(ecModel: GlobalModel, api: ExtensionAPI): void;
  2252. /**
  2253. * Dispose self.
  2254. */
  2255. dispose(ecModel: GlobalModel, api: ExtensionAPI): void;
  2256. updateView(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2257. updateLayout(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2258. updateVisual(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2259. /**
  2260. * Traverse the new rendered elements.
  2261. *
  2262. * It will traverse the new added element in progressive rendering.
  2263. * And traverse all in normal rendering.
  2264. */
  2265. eachRendered(cb: (el: Element) => boolean | void): void;
  2266. static markUpdateMethod(payload: Payload, methodName: keyof ChartView): void;
  2267. static registerClass: ClassManager['registerClass'];
  2268. }
  2269. declare const availableMethods: (keyof EChartsType)[];
  2270. interface ExtensionAPI extends Pick<EChartsType, (typeof availableMethods)[number]> {
  2271. }
  2272. declare abstract class ExtensionAPI {
  2273. constructor(ecInstance: EChartsType);
  2274. abstract getCoordinateSystems(): CoordinateSystemMaster[];
  2275. abstract getComponentByElement(el: Element): ComponentModel;
  2276. abstract enterEmphasis(el: Element, highlightDigit?: number): void;
  2277. abstract leaveEmphasis(el: Element, highlightDigit?: number): void;
  2278. abstract enterSelect(el: Element): void;
  2279. abstract leaveSelect(el: Element): void;
  2280. abstract enterBlur(el: Element): void;
  2281. abstract leaveBlur(el: Element): void;
  2282. abstract getViewOfComponentModel(componentModel: ComponentModel): ComponentView;
  2283. abstract getViewOfSeriesModel(seriesModel: SeriesModel): ChartView;
  2284. abstract getModel(): GlobalModel;
  2285. }
  2286. declare const AXIS_TYPES: {
  2287. readonly value: 1;
  2288. readonly category: 1;
  2289. readonly time: 1;
  2290. readonly log: 1;
  2291. };
  2292. declare type OptionAxisType = keyof typeof AXIS_TYPES;
  2293. interface AxisBaseOptionCommon extends ComponentOption, AnimationOptionMixin {
  2294. type?: OptionAxisType;
  2295. show?: boolean;
  2296. inverse?: boolean;
  2297. name?: string;
  2298. nameLocation?: 'start' | 'middle' | 'end';
  2299. nameRotate?: number;
  2300. nameTruncate?: {
  2301. maxWidth?: number;
  2302. ellipsis?: string;
  2303. placeholder?: string;
  2304. };
  2305. nameTextStyle?: AxisNameTextStyleOption;
  2306. nameGap?: number;
  2307. silent?: boolean;
  2308. triggerEvent?: boolean;
  2309. tooltip?: {
  2310. show?: boolean;
  2311. };
  2312. axisLabel?: AxisLabelBaseOption;
  2313. axisPointer?: CommonAxisPointerOption;
  2314. axisLine?: AxisLineOption;
  2315. axisTick?: AxisTickOption;
  2316. minorTick?: MinorTickOption;
  2317. splitLine?: SplitLineOption;
  2318. minorSplitLine?: MinorSplitLineOption;
  2319. splitArea?: SplitAreaOption;
  2320. /**
  2321. * Min value of the axis. can be:
  2322. * + ScaleDataValue
  2323. * + 'dataMin': use the min value in data.
  2324. * + null/undefined: auto decide min value (consider pretty look and boundaryGap).
  2325. */
  2326. min?: ScaleDataValue | 'dataMin' | ((extent: {
  2327. min: number;
  2328. max: number;
  2329. }) => ScaleDataValue);
  2330. /**
  2331. * Max value of the axis. can be:
  2332. * + ScaleDataValue
  2333. * + 'dataMax': use the max value in data.
  2334. * + null/undefined: auto decide max value (consider pretty look and boundaryGap).
  2335. */
  2336. max?: ScaleDataValue | 'dataMax' | ((extent: {
  2337. min: number;
  2338. max: number;
  2339. }) => ScaleDataValue);
  2340. }
  2341. interface NumericAxisBaseOptionCommon extends AxisBaseOptionCommon {
  2342. boundaryGap?: [number | string, number | string];
  2343. /**
  2344. * AxisTick and axisLabel and splitLine are caculated based on splitNumber.
  2345. */
  2346. splitNumber?: number;
  2347. /**
  2348. * Interval specifies the span of the ticks is mandatorily.
  2349. */
  2350. interval?: number;
  2351. /**
  2352. * Specify min interval when auto calculate tick interval.
  2353. */
  2354. minInterval?: number;
  2355. /**
  2356. * Specify max interval when auto calculate tick interval.
  2357. */
  2358. maxInterval?: number;
  2359. /**
  2360. * If align ticks to the first axis that is not use alignTicks
  2361. * If all axes has alignTicks: true. The first one will be applied.
  2362. *
  2363. * Will be ignored if interval is set.
  2364. */
  2365. alignTicks?: boolean;
  2366. }
  2367. interface CategoryAxisBaseOption extends AxisBaseOptionCommon {
  2368. type?: 'category';
  2369. boundaryGap?: boolean;
  2370. axisLabel?: AxisLabelOption<'category'> & {
  2371. interval?: 'auto' | number | ((index: number, value: string) => boolean);
  2372. };
  2373. data?: (OrdinalRawValue | {
  2374. value: OrdinalRawValue;
  2375. textStyle?: TextCommonOption;
  2376. })[];
  2377. deduplication?: boolean;
  2378. axisTick?: AxisBaseOptionCommon['axisTick'] & {
  2379. alignWithLabel?: boolean;
  2380. interval?: 'auto' | number | ((index: number, value: string) => boolean);
  2381. };
  2382. }
  2383. interface ValueAxisBaseOption extends NumericAxisBaseOptionCommon {
  2384. type?: 'value';
  2385. axisLabel?: AxisLabelOption<'value'>;
  2386. /**
  2387. * Optional value can be:
  2388. * + `false`: always include value 0.
  2389. * + `false`: always include value 0.
  2390. */
  2391. scale?: boolean;
  2392. }
  2393. interface LogAxisBaseOption extends NumericAxisBaseOptionCommon {
  2394. type?: 'log';
  2395. axisLabel?: AxisLabelOption<'log'>;
  2396. logBase?: number;
  2397. }
  2398. interface TimeAxisBaseOption extends NumericAxisBaseOptionCommon {
  2399. type?: 'time';
  2400. axisLabel?: AxisLabelOption<'time'>;
  2401. }
  2402. interface AxisNameTextStyleOption extends TextCommonOption {
  2403. rich?: Dictionary<TextCommonOption>;
  2404. }
  2405. interface AxisLineOption {
  2406. show?: boolean | 'auto';
  2407. onZero?: boolean;
  2408. onZeroAxisIndex?: number;
  2409. symbol?: string | [string, string];
  2410. symbolSize?: number[];
  2411. symbolOffset?: string | number | (string | number)[];
  2412. lineStyle?: LineStyleOption;
  2413. }
  2414. interface AxisTickOption {
  2415. show?: boolean | 'auto';
  2416. inside?: boolean;
  2417. length?: number;
  2418. lineStyle?: LineStyleOption;
  2419. }
  2420. declare type AxisLabelValueFormatter = (value: number, index: number) => string;
  2421. declare type AxisLabelCategoryFormatter = (value: string, index: number) => string;
  2422. declare type TimeAxisLabelUnitFormatter = AxisLabelValueFormatter | string[] | string;
  2423. declare type TimeAxisLabelFormatterOption = string | ((value: number, index: number, extra: {
  2424. level: number;
  2425. }) => string) | {
  2426. year?: TimeAxisLabelUnitFormatter;
  2427. month?: TimeAxisLabelUnitFormatter;
  2428. week?: TimeAxisLabelUnitFormatter;
  2429. day?: TimeAxisLabelUnitFormatter;
  2430. hour?: TimeAxisLabelUnitFormatter;
  2431. minute?: TimeAxisLabelUnitFormatter;
  2432. second?: TimeAxisLabelUnitFormatter;
  2433. millisecond?: TimeAxisLabelUnitFormatter;
  2434. inherit?: boolean;
  2435. };
  2436. declare type LabelFormatters = {
  2437. value: AxisLabelValueFormatter | string;
  2438. log: AxisLabelValueFormatter | string;
  2439. category: AxisLabelCategoryFormatter | string;
  2440. time: TimeAxisLabelFormatterOption;
  2441. };
  2442. interface AxisLabelBaseOption extends Omit<TextCommonOption, 'color'> {
  2443. show?: boolean;
  2444. inside?: boolean;
  2445. rotate?: number;
  2446. showMinLabel?: boolean;
  2447. showMaxLabel?: boolean;
  2448. margin?: number;
  2449. rich?: Dictionary<TextCommonOption>;
  2450. /**
  2451. * If hide overlapping labels.
  2452. */
  2453. hideOverlap?: boolean;
  2454. color?: ColorString | ((value?: string | number, index?: number) => ColorString);
  2455. }
  2456. interface AxisLabelOption<TType extends OptionAxisType> extends AxisLabelBaseOption {
  2457. formatter?: LabelFormatters[TType];
  2458. }
  2459. interface MinorTickOption {
  2460. show?: boolean;
  2461. splitNumber?: number;
  2462. length?: number;
  2463. lineStyle?: LineStyleOption;
  2464. }
  2465. interface SplitLineOption {
  2466. show?: boolean;
  2467. interval?: 'auto' | number | ((index: number, value: string) => boolean);
  2468. lineStyle?: LineStyleOption<ZRColor | ZRColor[]>;
  2469. }
  2470. interface MinorSplitLineOption {
  2471. show?: boolean;
  2472. lineStyle?: LineStyleOption;
  2473. }
  2474. interface SplitAreaOption {
  2475. show?: boolean;
  2476. interval?: 'auto' | number | ((index: number, value: string) => boolean);
  2477. areaStyle?: AreaStyleOption<ZRColor[]>;
  2478. }
  2479. declare type AxisBaseOption = ValueAxisBaseOption | LogAxisBaseOption | CategoryAxisBaseOption | TimeAxisBaseOption | AxisBaseOptionCommon;
  2480. interface AxisModelCommonMixin<Opt extends AxisBaseOption> extends Pick<Model<Opt>, 'option'> {
  2481. axis: Axis;
  2482. }
  2483. declare class AxisModelCommonMixin<Opt extends AxisBaseOption> {
  2484. getNeedCrossZero(): boolean;
  2485. /**
  2486. * Should be implemented by each axis model if necessary.
  2487. * @return coordinate system model
  2488. */
  2489. getCoordSysModel(): CoordinateSystemHostModel;
  2490. }
  2491. declare class OrdinalMeta {
  2492. readonly categories: OrdinalRawValue[];
  2493. private _needCollect;
  2494. private _deduplication;
  2495. private _map;
  2496. readonly uid: number;
  2497. constructor(opt: {
  2498. categories?: OrdinalRawValue[];
  2499. needCollect?: boolean;
  2500. deduplication?: boolean;
  2501. });
  2502. static createByAxisModel(axisModel: Model): OrdinalMeta;
  2503. getOrdinal(category: OrdinalRawValue): OrdinalNumber;
  2504. /**
  2505. * @return The ordinal. If not found, return NaN.
  2506. */
  2507. parseAndCollect(category: OrdinalRawValue | OrdinalNumber): OrdinalNumber;
  2508. private _getOrCreateMap;
  2509. }
  2510. declare function registerImpl(name: string, impl: any): void;
  2511. declare const extensionRegisters: {
  2512. registerPreprocessor: typeof registerPreprocessor;
  2513. registerProcessor: typeof registerProcessor;
  2514. registerPostInit: typeof registerPostInit;
  2515. registerPostUpdate: typeof registerPostUpdate;
  2516. registerUpdateLifecycle: typeof registerUpdateLifecycle;
  2517. registerAction: typeof registerAction;
  2518. registerCoordinateSystem: typeof registerCoordinateSystem;
  2519. registerLayout: typeof registerLayout;
  2520. registerVisual: typeof registerVisual;
  2521. registerTransform: typeof registerExternalTransform;
  2522. registerLoading: typeof registerLoading;
  2523. registerMap: typeof registerMap;
  2524. registerImpl: typeof registerImpl;
  2525. PRIORITY: {
  2526. PROCESSOR: {
  2527. FILTER: number;
  2528. SERIES_FILTER: number;
  2529. STATISTIC: number;
  2530. };
  2531. VISUAL: {
  2532. LAYOUT: number;
  2533. PROGRESSIVE_LAYOUT: number;
  2534. GLOBAL: number;
  2535. CHART: number;
  2536. POST_CHART_LAYOUT: number;
  2537. COMPONENT: number;
  2538. BRUSH: number;
  2539. CHART_ITEM: number;
  2540. ARIA: number;
  2541. DECAL: number;
  2542. };
  2543. };
  2544. ComponentModel: typeof ComponentModel;
  2545. ComponentView: typeof ComponentView;
  2546. SeriesModel: typeof SeriesModel;
  2547. ChartView: typeof ChartView;
  2548. registerComponentModel(ComponentModelClass: Constructor): void;
  2549. registerComponentView(ComponentViewClass: typeof ComponentView): void;
  2550. registerSeriesModel(SeriesModelClass: Constructor): void;
  2551. registerChartView(ChartViewClass: typeof ChartView): void;
  2552. registerSubTypeDefaulter(componentType: string, defaulter: SubTypeDefaulter): void;
  2553. registerPainter(painterType: string, PainterCtor: Parameters<typeof registerPainter>[1]): void;
  2554. };
  2555. declare type EChartsExtensionInstallRegisters = typeof extensionRegisters;
  2556. declare type EChartsExtensionInstaller = (ec: EChartsExtensionInstallRegisters) => void;
  2557. interface EChartsExtension {
  2558. install: EChartsExtensionInstaller;
  2559. }
  2560. declare function use(ext: EChartsExtensionInstaller | EChartsExtension | (EChartsExtensionInstaller | EChartsExtension)[]): void;
  2561. interface AxisModelExtendedInCreator {
  2562. getCategories(rawData?: boolean): OrdinalRawValue[] | CategoryAxisBaseOption['data'];
  2563. getOrdinalMeta(): OrdinalMeta;
  2564. }
  2565. /**
  2566. * Base Axis Model for xAxis, yAxis, angleAxis, radiusAxis. singleAxis
  2567. */
  2568. interface AxisBaseModel<T extends AxisBaseOptionCommon = AxisBaseOptionCommon> extends ComponentModel<T>, AxisModelCommonMixin<T>, AxisModelExtendedInCreator {
  2569. axis: Axis;
  2570. }
  2571. declare function createAxisLabels(axis: Axis): {
  2572. labels: {
  2573. level?: number;
  2574. formattedLabel: string;
  2575. rawLabel: string;
  2576. tickValue: number;
  2577. }[];
  2578. labelCategoryInterval?: number;
  2579. };
  2580. /**
  2581. * Calculate interval for category axis ticks and labels.
  2582. * To get precise result, at least one of `getRotate` and `isHorizontal`
  2583. * should be implemented in axis.
  2584. */
  2585. declare function calculateCategoryInterval(axis: Axis): number;
  2586. interface ScaleRawExtentResult {
  2587. readonly min: number;
  2588. readonly max: number;
  2589. readonly minFixed: boolean;
  2590. readonly maxFixed: boolean;
  2591. readonly isBlank: boolean;
  2592. }
  2593. declare class ScaleRawExtentInfo {
  2594. private _needCrossZero;
  2595. private _isOrdinal;
  2596. private _axisDataLen;
  2597. private _boundaryGapInner;
  2598. private _modelMinRaw;
  2599. private _modelMaxRaw;
  2600. private _modelMinNum;
  2601. private _modelMaxNum;
  2602. private _dataMin;
  2603. private _dataMax;
  2604. private _determinedMin;
  2605. private _determinedMax;
  2606. readonly frozen: boolean;
  2607. constructor(scale: Scale, model: AxisBaseModel, originalExtent: number[]);
  2608. /**
  2609. * Parameters depending on ouside (like model, user callback)
  2610. * are prepared and fixed here.
  2611. */
  2612. private _prepareParams;
  2613. /**
  2614. * Calculate extent by prepared parameters.
  2615. * This method has no external dependency and can be called duplicatedly,
  2616. * getting the same result.
  2617. * If parameters changed, should call this method to recalcuate.
  2618. */
  2619. calculate(): ScaleRawExtentResult;
  2620. modifyDataMinMax(minMaxName: 'min' | 'max', val: number): void;
  2621. setDeterminedMinMax(minMaxName: 'min' | 'max', val: number): void;
  2622. freeze(): void;
  2623. }
  2624. declare abstract class Scale<SETTING extends Dictionary<unknown> = Dictionary<unknown>> {
  2625. type: string;
  2626. private _setting;
  2627. protected _extent: [number, number];
  2628. private _isBlank;
  2629. readonly rawExtentInfo: ScaleRawExtentInfo;
  2630. constructor(setting?: SETTING);
  2631. getSetting<KEY extends keyof SETTING>(name: KEY): SETTING[KEY];
  2632. /**
  2633. * Parse input val to valid inner number.
  2634. * Notice: This would be a trap here, If the implementation
  2635. * of this method depends on extent, and this method is used
  2636. * before extent set (like in dataZoom), it would be wrong.
  2637. * Nevertheless, parse does not depend on extent generally.
  2638. */
  2639. abstract parse(val: OptionDataValue): number;
  2640. /**
  2641. * Whether contain the given value.
  2642. */
  2643. abstract contain(val: ScaleDataValue): boolean;
  2644. /**
  2645. * Normalize value to linear [0, 1], return 0.5 if extent span is 0.
  2646. */
  2647. abstract normalize(val: ScaleDataValue): number;
  2648. /**
  2649. * Scale normalized value to extent.
  2650. */
  2651. abstract scale(val: number): number;
  2652. /**
  2653. * Set extent from data
  2654. */
  2655. unionExtent(other: [number, number]): void;
  2656. /**
  2657. * Set extent from data
  2658. */
  2659. unionExtentFromData(data: SeriesData, dim: DimensionName | DimensionLoose): void;
  2660. /**
  2661. * Get extent
  2662. *
  2663. * Extent is always in increase order.
  2664. */
  2665. getExtent(): [number, number];
  2666. /**
  2667. * Set extent
  2668. */
  2669. setExtent(start: number, end: number): void;
  2670. /**
  2671. * If value is in extent range
  2672. */
  2673. isInExtentRange(value: number): boolean;
  2674. /**
  2675. * When axis extent depends on data and no data exists,
  2676. * axis ticks should not be drawn, which is named 'blank'.
  2677. */
  2678. isBlank(): boolean;
  2679. /**
  2680. * When axis extent depends on data and no data exists,
  2681. * axis ticks should not be drawn, which is named 'blank'.
  2682. */
  2683. setBlank(isBlank: boolean): void;
  2684. /**
  2685. * Update interval and extent of intervals for nice ticks
  2686. *
  2687. * @param splitNumber Approximated tick numbers. Optional.
  2688. * The implementation of `niceTicks` should decide tick numbers
  2689. * whether `splitNumber` is given.
  2690. * @param minInterval Optional.
  2691. * @param maxInterval Optional.
  2692. */
  2693. abstract calcNiceTicks(splitNumber?: number, minInterval?: number, maxInterval?: number): void;
  2694. abstract calcNiceExtent(opt?: {
  2695. splitNumber?: number;
  2696. fixMin?: boolean;
  2697. fixMax?: boolean;
  2698. minInterval?: number;
  2699. maxInterval?: number;
  2700. }): void;
  2701. /**
  2702. * @return label of the tick.
  2703. */
  2704. abstract getLabel(tick: ScaleTick): string;
  2705. abstract getTicks(): ScaleTick[];
  2706. abstract getMinorTicks(splitNumber: number): number[][];
  2707. static registerClass: ClassManager['registerClass'];
  2708. static getClass: ClassManager['getClass'];
  2709. }
  2710. interface TickCoord {
  2711. coord: number;
  2712. tickValue?: ScaleTick['value'];
  2713. }
  2714. /**
  2715. * Base class of Axis.
  2716. */
  2717. declare class Axis {
  2718. /**
  2719. * Axis type
  2720. * - 'category'
  2721. * - 'value'
  2722. * - 'time'
  2723. * - 'log'
  2724. */
  2725. type: OptionAxisType;
  2726. readonly dim: DimensionName;
  2727. scale: Scale;
  2728. private _extent;
  2729. model: AxisBaseModel;
  2730. onBand: CategoryAxisBaseOption['boundaryGap'];
  2731. inverse: AxisBaseOption['inverse'];
  2732. constructor(dim: DimensionName, scale: Scale, extent: [number, number]);
  2733. /**
  2734. * If axis extent contain given coord
  2735. */
  2736. contain(coord: number): boolean;
  2737. /**
  2738. * If axis extent contain given data
  2739. */
  2740. containData(data: ScaleDataValue): boolean;
  2741. /**
  2742. * Get coord extent.
  2743. */
  2744. getExtent(): [number, number];
  2745. /**
  2746. * Get precision used for formatting
  2747. */
  2748. getPixelPrecision(dataExtent?: [number, number]): number;
  2749. /**
  2750. * Set coord extent
  2751. */
  2752. setExtent(start: number, end: number): void;
  2753. /**
  2754. * Convert data to coord. Data is the rank if it has an ordinal scale
  2755. */
  2756. dataToCoord(data: ScaleDataValue, clamp?: boolean): number;
  2757. /**
  2758. * Convert coord to data. Data is the rank if it has an ordinal scale
  2759. */
  2760. coordToData(coord: number, clamp?: boolean): number;
  2761. /**
  2762. * Convert pixel point to data in axis
  2763. */
  2764. pointToData(point: number[], clamp?: boolean): number;
  2765. /**
  2766. * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,
  2767. * `axis.getTicksCoords` considers `onBand`, which is used by
  2768. * `boundaryGap:true` of category axis and splitLine and splitArea.
  2769. * @param opt.tickModel default: axis.model.getModel('axisTick')
  2770. * @param opt.clamp If `true`, the first and the last
  2771. * tick must be at the axis end points. Otherwise, clip ticks
  2772. * that outside the axis extent.
  2773. */
  2774. getTicksCoords(opt?: {
  2775. tickModel?: Model;
  2776. clamp?: boolean;
  2777. }): TickCoord[];
  2778. getMinorTicksCoords(): TickCoord[][];
  2779. getViewLabels(): ReturnType<typeof createAxisLabels>['labels'];
  2780. getLabelModel(): Model<AxisBaseOption['axisLabel']>;
  2781. /**
  2782. * Notice here we only get the default tick model. For splitLine
  2783. * or splitArea, we should pass the splitLineModel or splitAreaModel
  2784. * manually when calling `getTicksCoords`.
  2785. * In GL, this method may be overrided to:
  2786. * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`
  2787. */
  2788. getTickModel(): Model;
  2789. /**
  2790. * Get width of band
  2791. */
  2792. getBandWidth(): number;
  2793. /**
  2794. * Get axis rotate, by degree.
  2795. */
  2796. getRotate: () => number;
  2797. /**
  2798. * Only be called in category axis.
  2799. * Can be overrided, consider other axes like in 3D.
  2800. * @return Auto interval for cateogry axis tick and label
  2801. */
  2802. calculateCategoryInterval(): ReturnType<typeof calculateCategoryInterval>;
  2803. }
  2804. interface BaseBarSeriesOption<StateOption, ExtraStateOption extends StatesMixinBase = DefaultStatesMixin> extends SeriesOption<StateOption, ExtraStateOption>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin {
  2805. /**
  2806. * Min height of bar
  2807. */
  2808. barMinHeight?: number;
  2809. /**
  2810. * Min angle of bar. Avaiable on polar coordinate system
  2811. */
  2812. barMinAngle?: number;
  2813. /**
  2814. * Max width of bar. Default to be 1 on cartesian coordinate system. Otherwise it's null
  2815. */
  2816. barMaxWidth?: number;
  2817. barMinWidth?: number;
  2818. /**
  2819. * Bar width. Will be calculated automatically.
  2820. * Can be pixel width or percent string.
  2821. */
  2822. barWidth?: number | string;
  2823. /**
  2824. * Gap between each bar inside category. Default to be 30%. Can be an aboslute pixel value
  2825. */
  2826. barGap?: string | number;
  2827. /**
  2828. * Gap between each category. Default to be 20%. can be an absolute pixel value.
  2829. */
  2830. barCategoryGap?: string | number;
  2831. large?: boolean;
  2832. largeThreshold?: number;
  2833. }
  2834. interface LayoutRect extends BoundingRect {
  2835. margin: number[];
  2836. }
  2837. /**
  2838. * Parse position info.
  2839. */
  2840. declare function getLayoutRect(positionInfo: BoxLayoutOptionMixin & {
  2841. aspect?: number;
  2842. }, containerRect: {
  2843. width: number;
  2844. height: number;
  2845. }, margin?: number | number[]): LayoutRect;
  2846. interface GridOption extends ComponentOption, BoxLayoutOptionMixin, ShadowOptionMixin {
  2847. mainType?: 'grid';
  2848. show?: boolean;
  2849. containLabel?: boolean;
  2850. backgroundColor?: ZRColor;
  2851. borderWidth?: number;
  2852. borderColor?: ZRColor;
  2853. tooltip?: any;
  2854. }
  2855. declare type CartesianAxisPosition = 'top' | 'bottom' | 'left' | 'right';
  2856. declare type CartesianAxisOption = AxisBaseOption & {
  2857. gridIndex?: number;
  2858. gridId?: string;
  2859. position?: CartesianAxisPosition;
  2860. offset?: number;
  2861. categorySortInfo?: OrdinalSortInfo;
  2862. };
  2863. declare type XAXisOption = CartesianAxisOption & {
  2864. mainType?: 'xAxis';
  2865. };
  2866. declare type YAXisOption = CartesianAxisOption & {
  2867. mainType?: 'yAxis';
  2868. };
  2869. declare type AngleAxisOption = AxisBaseOption & {
  2870. mainType?: 'angleAxis';
  2871. /**
  2872. * Index of host polar component
  2873. */
  2874. polarIndex?: number;
  2875. /**
  2876. * Id of host polar component
  2877. */
  2878. polarId?: string;
  2879. startAngle?: number;
  2880. clockwise?: boolean;
  2881. axisLabel?: AxisBaseOption['axisLabel'];
  2882. };
  2883. declare type RadiusAxisOption = AxisBaseOption & {
  2884. mainType?: 'radiusAxis';
  2885. /**
  2886. * Index of host polar component
  2887. */
  2888. polarIndex?: number;
  2889. /**
  2890. * Id of host polar component
  2891. */
  2892. polarId?: string;
  2893. };
  2894. interface PolarOption extends ComponentOption, CircleLayoutOptionMixin {
  2895. mainType?: 'polar';
  2896. }
  2897. /**
  2898. * BrushController not only used in "brush component",
  2899. * but also used in "tooltip DataZoom", and other possible
  2900. * futher brush behavior related scenarios.
  2901. * So `BrushController` should not depends on "brush component model".
  2902. */
  2903. declare type BrushType = 'polygon' | 'rect' | 'lineX' | 'lineY';
  2904. /**
  2905. * Only for drawing (after enabledBrush).
  2906. * 'line', 'rect', 'polygon' or false
  2907. * If passing false/null/undefined, disable brush.
  2908. * If passing 'auto', determined by panel.defaultBrushType
  2909. */
  2910. declare type BrushTypeUncertain = BrushType | false | 'auto';
  2911. declare type BrushMode = 'single' | 'multiple';
  2912. declare type BrushDimensionMinMax = number[];
  2913. declare type BrushAreaRange = BrushDimensionMinMax | BrushDimensionMinMax[];
  2914. interface BrushCoverConfig {
  2915. brushType: BrushType;
  2916. id?: string;
  2917. range?: BrushAreaRange;
  2918. panelId?: string;
  2919. brushMode?: BrushMode;
  2920. brushStyle?: Pick<PathStyleProps, BrushStyleKey>;
  2921. transformable?: boolean;
  2922. removeOnClick?: boolean;
  2923. z?: number;
  2924. }
  2925. declare type BrushStyleKey = 'fill' | 'stroke' | 'lineWidth' | 'opacity' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'shadowColor';
  2926. declare type GeoSVGSourceInput = string | Document | SVGElement;
  2927. declare type GeoJSONSourceInput = string | GeoJSON | GeoJSONCompressed;
  2928. interface NameMap {
  2929. [regionName: string]: string;
  2930. }
  2931. interface GeoSpecialAreas {
  2932. [areaName: string]: {
  2933. left: number;
  2934. top: number;
  2935. width?: number;
  2936. height?: number;
  2937. };
  2938. }
  2939. interface GeoJSON extends GeoJSONFeatureCollection<GeoJSONGeometry> {
  2940. }
  2941. interface GeoJSONCompressed extends GeoJSONFeatureCollection<GeoJSONGeometryCompressed> {
  2942. UTF8Encoding?: boolean;
  2943. UTF8Scale?: number;
  2944. }
  2945. interface GeoJSONFeatureCollection<G> {
  2946. type: 'FeatureCollection';
  2947. features: GeoJSONFeature<G>[];
  2948. }
  2949. interface GeoJSONFeature<G = GeoJSONGeometry> {
  2950. type: 'Feature';
  2951. id?: string | number;
  2952. properties: {
  2953. name?: string;
  2954. cp?: number[];
  2955. [key: string]: any;
  2956. };
  2957. geometry: G;
  2958. }
  2959. declare type GeoJSONGeometry = GeoJSONGeometryPoint | GeoJSONGeometryMultiPoint | GeoJSONGeometryLineString | GeoJSONGeometryMultiLineString | GeoJSONGeometryPolygon | GeoJSONGeometryMultiPolygon;
  2960. declare type GeoJSONGeometryCompressed = GeoJSONGeometryPolygonCompressed | GeoJSONGeometryMultiPolygonCompressed | GeoJSONGeometryLineStringCompressed | GeoJSONGeometryMultiLineStringCompressed;
  2961. interface GeoJSONGeometryPoint {
  2962. type: 'Point';
  2963. coordinates: number[];
  2964. }
  2965. interface GeoJSONGeometryMultiPoint {
  2966. type: 'MultiPoint';
  2967. coordinates: number[][];
  2968. }
  2969. interface GeoJSONGeometryLineString {
  2970. type: 'LineString';
  2971. coordinates: number[][];
  2972. }
  2973. interface GeoJSONGeometryLineStringCompressed {
  2974. type: 'LineString';
  2975. coordinates: string;
  2976. encodeOffsets: number[];
  2977. }
  2978. interface GeoJSONGeometryMultiLineString {
  2979. type: 'MultiLineString';
  2980. coordinates: number[][][];
  2981. }
  2982. interface GeoJSONGeometryMultiLineStringCompressed {
  2983. type: 'MultiLineString';
  2984. coordinates: string[];
  2985. encodeOffsets: number[][];
  2986. }
  2987. interface GeoJSONGeometryPolygon {
  2988. type: 'Polygon';
  2989. coordinates: number[][][];
  2990. }
  2991. interface GeoJSONGeometryPolygonCompressed {
  2992. type: 'Polygon';
  2993. coordinates: string[];
  2994. encodeOffsets: number[][];
  2995. }
  2996. interface GeoJSONGeometryMultiPolygon {
  2997. type: 'MultiPolygon';
  2998. coordinates: number[][][][];
  2999. }
  3000. interface GeoJSONGeometryMultiPolygonCompressed {
  3001. type: 'MultiPolygon';
  3002. coordinates: string[][];
  3003. encodeOffsets: number[][][];
  3004. }
  3005. interface GeoResource {
  3006. readonly type: 'geoJSON' | 'geoSVG';
  3007. load(nameMap: NameMap, nameProperty: string): {
  3008. boundingRect: BoundingRect;
  3009. regions: Region[];
  3010. regionsMap: HashMap<Region>;
  3011. };
  3012. }
  3013. /**
  3014. * Geo stream interface compatitable with d3-geo
  3015. * See the API detail in https://github.com/d3/d3-geo#streams
  3016. */
  3017. interface ProjectionStream {
  3018. point(x: number, y: number): void;
  3019. lineStart(): void;
  3020. lineEnd(): void;
  3021. polygonStart(): void;
  3022. polygonEnd(): void;
  3023. /**
  3024. * Not supported yet.
  3025. */
  3026. sphere(): void;
  3027. }
  3028. interface GeoProjection {
  3029. project(point: number[]): number[];
  3030. unproject(point: number[]): number[];
  3031. /**
  3032. * Projection stream compatitable to d3-geo projection stream.
  3033. *
  3034. * When rotate projection is used. It may have antimeridian artifacts.
  3035. * So we need to introduce the fule projection stream to do antimeridian clipping.
  3036. *
  3037. * project will be ignored if projectStream is given.
  3038. */
  3039. stream?(outStream: ProjectionStream): ProjectionStream;
  3040. }
  3041. declare abstract class Region {
  3042. readonly name: string;
  3043. readonly type: 'geoJSON' | 'geoSVG';
  3044. protected _center: number[];
  3045. protected _rect: BoundingRect;
  3046. constructor(name: string);
  3047. setCenter(center: number[]): void;
  3048. /**
  3049. * Get center point in data unit. That is,
  3050. * for GeoJSONRegion, the unit is lat/lng,
  3051. * for GeoSVGRegion, the unit is SVG local coord.
  3052. */
  3053. getCenter(): number[];
  3054. abstract calcCenter(): number[];
  3055. }
  3056. declare class GeoJSONPolygonGeometry {
  3057. readonly type = "polygon";
  3058. exterior: number[][];
  3059. interiors?: number[][][];
  3060. constructor(exterior: number[][], interiors: number[][][]);
  3061. }
  3062. declare class GeoJSONLineStringGeometry {
  3063. readonly type = "linestring";
  3064. points: number[][][];
  3065. constructor(points: number[][][]);
  3066. }
  3067. declare class GeoJSONRegion extends Region {
  3068. readonly type = "geoJSON";
  3069. readonly geometries: (GeoJSONPolygonGeometry | GeoJSONLineStringGeometry)[];
  3070. properties: GeoJSON['features'][0]['properties'];
  3071. constructor(name: string, geometries: GeoJSONRegion['geometries'], cp: GeoJSON['features'][0]['properties']['cp']);
  3072. calcCenter(): number[];
  3073. getBoundingRect(projection?: GeoProjection): BoundingRect;
  3074. contain(coord: number[]): boolean;
  3075. /**
  3076. * Transform the raw coords to target bounding.
  3077. * @param x
  3078. * @param y
  3079. * @param width
  3080. * @param height
  3081. */
  3082. transformTo(x: number, y: number, width: number, height: number): void;
  3083. cloneShallow(name: string): GeoJSONRegion;
  3084. }
  3085. declare type ECSymbol = Path & {
  3086. __isEmptyBrush?: boolean;
  3087. setColor: (color: ZRColor, innerColor?: ZRColor) => void;
  3088. getColor: () => ZRColor;
  3089. };
  3090. /**
  3091. * Create a symbol element with given symbol configuration: shape, x, y, width, height, color
  3092. */
  3093. declare function createSymbol(symbolType: string, x: number, y: number, w: number, h: number, color?: ZRColor, keepAspect?: boolean): ECSymbol;
  3094. declare type ItemStyleKeys = 'fill' | 'stroke' | 'decal' | 'lineWidth' | 'opacity' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'shadowColor' | 'lineDash' | 'lineDashOffset' | 'lineCap' | 'lineJoin' | 'miterLimit';
  3095. declare type ItemStyleProps = Pick<PathStyleProps, ItemStyleKeys>;
  3096. declare class ItemStyleMixin {
  3097. getItemStyle(this: Model, excludes?: readonly (keyof ItemStyleOption)[], includes?: readonly (keyof ItemStyleOption)[]): ItemStyleProps;
  3098. }
  3099. declare type LineStyleKeys = 'lineWidth' | 'stroke' | 'opacity' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'shadowColor' | 'lineDash' | 'lineDashOffset' | 'lineCap' | 'lineJoin' | 'miterLimit';
  3100. declare type LineStyleProps = Pick<PathStyleProps, LineStyleKeys>;
  3101. declare class LineStyleMixin {
  3102. getLineStyle(this: Model, excludes?: readonly (keyof LineStyleOption)[]): LineStyleProps;
  3103. }
  3104. declare type SelectorType = 'all' | 'inverse';
  3105. interface LegendSelectorButtonOption {
  3106. type?: SelectorType;
  3107. title?: string;
  3108. }
  3109. /**
  3110. * T: the type to be extended
  3111. * ET: extended type for keys of T
  3112. * ST: special type for T to be extended
  3113. */
  3114. declare type ExtendPropertyType<T, ET, ST extends {
  3115. [key in keyof T]: any;
  3116. }> = {
  3117. [key in keyof T]: key extends keyof ST ? T[key] | ET | ST[key] : T[key] | ET;
  3118. };
  3119. interface LegendItemStyleOption extends ExtendPropertyType<ItemStyleOption, 'inherit', {
  3120. borderWidth: 'auto';
  3121. }> {
  3122. }
  3123. interface LegendLineStyleOption extends ExtendPropertyType<LineStyleOption, 'inherit', {
  3124. width: 'auto';
  3125. }> {
  3126. inactiveColor?: ColorString;
  3127. inactiveWidth?: number;
  3128. }
  3129. interface LegendStyleOption {
  3130. /**
  3131. * Icon of the legend items.
  3132. * @default 'roundRect'
  3133. */
  3134. icon?: string;
  3135. /**
  3136. * Color when legend item is not selected
  3137. */
  3138. inactiveColor?: ColorString;
  3139. /**
  3140. * Border color when legend item is not selected
  3141. */
  3142. inactiveBorderColor?: ColorString;
  3143. /**
  3144. * Border color when legend item is not selected
  3145. */
  3146. inactiveBorderWidth?: number | 'auto';
  3147. /**
  3148. * Legend label formatter
  3149. */
  3150. formatter?: string | ((name: string) => string);
  3151. itemStyle?: LegendItemStyleOption;
  3152. lineStyle?: LegendLineStyleOption;
  3153. textStyle?: LabelOption;
  3154. symbolRotate?: number | 'inherit';
  3155. /**
  3156. * @deprecated
  3157. */
  3158. symbolKeepAspect?: boolean;
  3159. }
  3160. interface DataItem extends LegendStyleOption {
  3161. name?: string;
  3162. icon?: string;
  3163. textStyle?: LabelOption;
  3164. tooltip?: unknown;
  3165. }
  3166. interface LegendTooltipFormatterParams {
  3167. componentType: 'legend';
  3168. legendIndex: number;
  3169. name: string;
  3170. $vars: ['name'];
  3171. }
  3172. interface LegendIconParams {
  3173. itemWidth: number;
  3174. itemHeight: number;
  3175. /**
  3176. * symbolType is from legend.icon, legend.data.icon, or series visual
  3177. */
  3178. icon: string;
  3179. iconRotate: number | 'inherit';
  3180. symbolKeepAspect: boolean;
  3181. itemStyle: PathStyleProps;
  3182. lineStyle: LineStyleProps;
  3183. }
  3184. interface LegendOption extends ComponentOption, LegendStyleOption, BoxLayoutOptionMixin, BorderOptionMixin {
  3185. mainType?: 'legend';
  3186. show?: boolean;
  3187. orient?: LayoutOrient;
  3188. align?: 'auto' | 'left' | 'right';
  3189. backgroundColor?: ColorString;
  3190. /**
  3191. * Border radius of background rect
  3192. * @default 0
  3193. */
  3194. borderRadius?: number | number[];
  3195. /**
  3196. * Padding between legend item and border.
  3197. * Support to be a single number or an array.
  3198. * @default 5
  3199. */
  3200. padding?: number | number[];
  3201. /**
  3202. * Gap between each legend item.
  3203. * @default 10
  3204. */
  3205. itemGap?: number;
  3206. /**
  3207. * Width of legend symbol
  3208. */
  3209. itemWidth?: number;
  3210. /**
  3211. * Height of legend symbol
  3212. */
  3213. itemHeight?: number;
  3214. selectedMode?: boolean | 'single' | 'multiple';
  3215. /**
  3216. * selected map of each item. Default to be selected if item is not in the map
  3217. */
  3218. selected?: Dictionary<boolean>;
  3219. /**
  3220. * Buttons for all select or inverse select.
  3221. * @example
  3222. * selector: [{type: 'all or inverse', title: xxx}]
  3223. * selector: true
  3224. * selector: ['all', 'inverse']
  3225. */
  3226. selector?: (LegendSelectorButtonOption | SelectorType)[] | boolean;
  3227. selectorLabel?: LabelOption;
  3228. emphasis?: {
  3229. selectorLabel?: LabelOption;
  3230. };
  3231. /**
  3232. * Position of selector buttons.
  3233. */
  3234. selectorPosition?: 'auto' | 'start' | 'end';
  3235. /**
  3236. * Gap between each selector button
  3237. */
  3238. selectorItemGap?: number;
  3239. /**
  3240. * Gap between selector buttons group and legend main items.
  3241. */
  3242. selectorButtonGap?: number;
  3243. data?: (string | DataItem)[];
  3244. /**
  3245. * Tooltip option
  3246. */
  3247. tooltip?: CommonTooltipOption<LegendTooltipFormatterParams>;
  3248. }
  3249. interface MapStateOption<TCbParams = never> {
  3250. itemStyle?: GeoItemStyleOption<TCbParams>;
  3251. label?: SeriesLabelOption;
  3252. }
  3253. interface MapDataItemOption extends MapStateOption, StatesOptionMixin<MapStateOption, StatesMixinBase>, OptionDataItemObject<OptionDataValueNumeric> {
  3254. cursor?: string;
  3255. }
  3256. declare type MapValueCalculationType = 'sum' | 'average' | 'min' | 'max';
  3257. interface MapSeriesOption extends SeriesOption<MapStateOption<CallbackDataParams>, StatesMixinBase>, MapStateOption<CallbackDataParams>, GeoCommonOptionMixin, SeriesOnGeoOptionMixin, BoxLayoutOptionMixin, SeriesEncodeOptionMixin {
  3258. type?: 'map';
  3259. coordinateSystem?: string;
  3260. silent?: boolean;
  3261. markLine?: any;
  3262. markPoint?: any;
  3263. markArea?: any;
  3264. mapValueCalculation?: MapValueCalculationType;
  3265. showLegendSymbol?: boolean;
  3266. geoCoord?: Dictionary<number[]>;
  3267. data?: (OptionDataValueNumeric | OptionDataValueNumeric[] | MapDataItemOption)[];
  3268. nameProperty?: string;
  3269. }
  3270. interface GeoItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
  3271. areaColor?: ZRColor;
  3272. }
  3273. interface GeoLabelOption extends LabelOption {
  3274. formatter?: string | ((params: GeoLabelFormatterDataParams) => string);
  3275. }
  3276. interface GeoStateOption {
  3277. itemStyle?: GeoItemStyleOption;
  3278. label?: GeoLabelOption;
  3279. }
  3280. interface GeoLabelFormatterDataParams {
  3281. name: string;
  3282. status: DisplayState;
  3283. }
  3284. interface RegoinOption extends GeoStateOption, StatesOptionMixin<GeoStateOption, StatesMixinBase> {
  3285. name?: string;
  3286. selected?: boolean;
  3287. tooltip?: CommonTooltipOption<GeoTooltipFormatterParams>;
  3288. }
  3289. interface GeoTooltipFormatterParams {
  3290. componentType: 'geo';
  3291. geoIndex: number;
  3292. name: string;
  3293. $vars: ['name'];
  3294. }
  3295. interface GeoCommonOptionMixin extends RoamOptionMixin {
  3296. map: string;
  3297. aspectScale?: number;
  3298. layoutCenter?: (number | string)[];
  3299. layoutSize?: number | string;
  3300. boundingCoords?: number[][];
  3301. nameMap?: NameMap;
  3302. nameProperty?: string;
  3303. /**
  3304. * Use raw projection by default
  3305. * Only available for GeoJSON source.
  3306. *
  3307. * NOTE: `center` needs to be the projected coord if projection is used.
  3308. */
  3309. projection?: GeoProjection;
  3310. }
  3311. interface GeoOption extends ComponentOption, BoxLayoutOptionMixin, AnimationOptionMixin, GeoCommonOptionMixin, StatesOptionMixin<GeoStateOption, StatesMixinBase>, GeoStateOption {
  3312. mainType?: 'geo';
  3313. show?: boolean;
  3314. silent?: boolean;
  3315. regions?: RegoinOption[];
  3316. stateAnimation?: AnimationOptionMixin;
  3317. selectedMode?: 'single' | 'multiple' | boolean;
  3318. selectedMap?: Dictionary<boolean>;
  3319. tooltip?: CommonTooltipOption<GeoTooltipFormatterParams>;
  3320. }
  3321. /**
  3322. * The input to define brush areas.
  3323. * (1) Can be created by user when calling dispatchAction.
  3324. * (2) Can be created by `BrushController`
  3325. * for brush behavior. area params are picked from `cover.__brushOptoin`.
  3326. * In `BrushController`, "covers" are create or updated for each "area".
  3327. */
  3328. interface BrushAreaParam extends ModelFinderObject {
  3329. brushType: BrushCoverConfig['brushType'];
  3330. id?: BrushCoverConfig['id'];
  3331. range?: BrushCoverConfig['range'];
  3332. panelId?: BrushCoverConfig['panelId'];
  3333. coordRange?: BrushAreaRange;
  3334. coordRanges?: BrushAreaRange[];
  3335. __rangeOffset?: {
  3336. offset: BrushDimensionMinMax[] | BrushDimensionMinMax;
  3337. xyMinMax: BrushDimensionMinMax[];
  3338. };
  3339. }
  3340. /**
  3341. * Generated by `brushModel.setAreas`, which merges
  3342. * `area: BrushAreaParam` and `brushModel.option: BrushOption`.
  3343. * See `generateBrushOption`.
  3344. */
  3345. interface BrushAreaParamInternal extends BrushAreaParam {
  3346. brushMode: BrushMode;
  3347. brushStyle: BrushCoverConfig['brushStyle'];
  3348. transformable: BrushCoverConfig['transformable'];
  3349. removeOnClick: BrushCoverConfig['removeOnClick'];
  3350. z: BrushCoverConfig['z'];
  3351. __rangeOffset?: {
  3352. offset: BrushDimensionMinMax | BrushDimensionMinMax[];
  3353. xyMinMax: BrushDimensionMinMax[];
  3354. };
  3355. }
  3356. declare type BrushToolboxIconType = BrushType | 'keep' | 'clear';
  3357. interface BrushOption extends ComponentOption, ModelFinderObject {
  3358. mainType?: 'brush';
  3359. toolbox?: BrushToolboxIconType[];
  3360. brushLink?: number[] | 'all' | 'none';
  3361. throttleType?: 'fixRate' | 'debounce';
  3362. throttleDelay?: number;
  3363. inBrush?: VisualOptionFixed;
  3364. outOfBrush?: VisualOptionFixed;
  3365. brushType?: BrushTypeUncertain;
  3366. brushStyle?: {
  3367. borderWidth?: number;
  3368. color?: ZRColor;
  3369. borderColor?: ZRColor;
  3370. };
  3371. transformable?: boolean;
  3372. brushMode?: BrushMode;
  3373. removeOnClick?: boolean;
  3374. }
  3375. interface BrushSelectableArea extends BrushAreaParamInternal {
  3376. boundingRect: BoundingRect;
  3377. selectors: BrushCommonSelectorsForSeries;
  3378. }
  3379. /**
  3380. * This methods are corresponding to `BrushSelectorOnBrushType`,
  3381. * but `area: BrushSelectableArea` is binded to each method.
  3382. */
  3383. interface BrushCommonSelectorsForSeries {
  3384. point(itemLayout: number[]): boolean;
  3385. rect(itemLayout: RectLike): boolean;
  3386. }
  3387. declare type PolarBarLabelPosition = SeriesLabelOption['position'] | 'start' | 'insideStart' | 'middle' | 'end' | 'insideEnd';
  3388. declare type BarSeriesLabelOption = Omit<SeriesLabelOption, 'position'> & {
  3389. position?: PolarBarLabelPosition | 'outside';
  3390. };
  3391. interface BarStateOption<TCbParams = never> {
  3392. itemStyle?: BarItemStyleOption<TCbParams>;
  3393. label?: BarSeriesLabelOption;
  3394. }
  3395. interface BarStatesMixin {
  3396. emphasis?: DefaultStatesMixinEmphasis;
  3397. }
  3398. interface BarItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
  3399. borderRadius?: number | number[];
  3400. }
  3401. interface BarDataItemOption extends BarStateOption, StatesOptionMixin<BarStateOption, BarStatesMixin>, OptionDataItemObject<OptionDataValue> {
  3402. cursor?: string;
  3403. }
  3404. interface BarSeriesOption extends BaseBarSeriesOption<BarStateOption<CallbackDataParams>, BarStatesMixin>, BarStateOption<CallbackDataParams>, SeriesStackOptionMixin, SeriesSamplingOptionMixin, SeriesEncodeOptionMixin {
  3405. type?: 'bar';
  3406. coordinateSystem?: 'cartesian2d' | 'polar';
  3407. clip?: boolean;
  3408. /**
  3409. * If use caps on two sides of bars
  3410. * Only available on tangential polar bar
  3411. */
  3412. roundCap?: boolean;
  3413. showBackground?: boolean;
  3414. backgroundStyle?: ItemStyleOption & {
  3415. borderRadius?: number | number[];
  3416. };
  3417. data?: (BarDataItemOption | OptionDataValue | OptionDataValue[])[];
  3418. realtimeSort?: boolean;
  3419. }
  3420. /**
  3421. * {
  3422. * [coordSysId]: {
  3423. * [stackId]: {bandWidth, offset, width}
  3424. * }
  3425. * }
  3426. */
  3427. declare type BarWidthAndOffset = Dictionary<Dictionary<{
  3428. bandWidth: number;
  3429. offset: number;
  3430. offsetCenter: number;
  3431. width: number;
  3432. }>>;
  3433. interface BarGridLayoutOptionForCustomSeries {
  3434. count: number;
  3435. barWidth?: number | string;
  3436. barMaxWidth?: number | string;
  3437. barMinWidth?: number | string;
  3438. barGap?: number | string;
  3439. barCategoryGap?: number | string;
  3440. }
  3441. declare type BarGridLayoutResult = BarWidthAndOffset[string][string][];
  3442. interface TransitionOptionMixin<T = Record<string, any>> {
  3443. transition?: (keyof T & string) | ((keyof T & string)[]) | 'all';
  3444. enterFrom?: T;
  3445. leaveTo?: T;
  3446. enterAnimation?: AnimationOption$1;
  3447. updateAnimation?: AnimationOption$1;
  3448. leaveAnimation?: AnimationOption$1;
  3449. }
  3450. interface TransitionBaseDuringAPI {
  3451. setTransform(key: TransformProp, val: number): this;
  3452. getTransform(key: TransformProp): number;
  3453. setExtra(key: string, val: unknown): this;
  3454. getExtra(key: string): unknown;
  3455. }
  3456. interface TransitionDuringAPI<StyleOpt extends any = any, ShapeOpt extends any = any> extends TransitionBaseDuringAPI {
  3457. setShape<T extends keyof ShapeOpt>(key: T, val: ShapeOpt[T]): this;
  3458. getShape<T extends keyof ShapeOpt>(key: T): ShapeOpt[T];
  3459. setStyle<T extends keyof StyleOpt>(key: T, val: StyleOpt[T]): this;
  3460. getStyle<T extends keyof StyleOpt>(key: T): StyleOpt[T];
  3461. }
  3462. declare type AnimationKeyframe<T extends Record<string, any>> = T & {
  3463. easing?: AnimationEasing;
  3464. percent?: number;
  3465. };
  3466. interface ElementKeyframeAnimationOption<Props extends Record<string, any>> extends AnimationOption$1 {
  3467. loop?: boolean;
  3468. keyframes?: AnimationKeyframe<Props>[];
  3469. }
  3470. declare type CustomExtraElementInfo = Dictionary<unknown>;
  3471. declare const STYLE_VISUAL_TYPE: {
  3472. readonly color: "fill";
  3473. readonly borderColor: "stroke";
  3474. };
  3475. declare type StyleVisualProps = keyof typeof STYLE_VISUAL_TYPE;
  3476. declare const NON_STYLE_VISUAL_PROPS: {
  3477. readonly symbol: 1;
  3478. readonly symbolSize: 1;
  3479. readonly symbolKeepAspect: 1;
  3480. readonly legendIcon: 1;
  3481. readonly visualMeta: 1;
  3482. readonly liftZ: 1;
  3483. readonly decal: 1;
  3484. };
  3485. declare type NonStyleVisualProps = keyof typeof NON_STYLE_VISUAL_PROPS;
  3486. declare type ShapeMorphingOption = {
  3487. /**
  3488. * If do shape morphing animation when type is changed.
  3489. * Only available on path.
  3490. */
  3491. morph?: boolean;
  3492. };
  3493. interface CustomBaseElementOption extends Partial<Pick<Element, TransformProp | 'silent' | 'ignore' | 'textConfig'>> {
  3494. type: string;
  3495. id?: string;
  3496. name?: string;
  3497. info?: CustomExtraElementInfo;
  3498. textContent?: CustomTextOption | false;
  3499. clipPath?: CustomBaseZRPathOption | false;
  3500. extra?: Dictionary<unknown> & TransitionOptionMixin;
  3501. during?(params: TransitionBaseDuringAPI): void;
  3502. enterAnimation?: AnimationOption$1;
  3503. updateAnimation?: AnimationOption$1;
  3504. leaveAnimation?: AnimationOption$1;
  3505. }
  3506. interface CustomDisplayableOption extends CustomBaseElementOption, Partial<Pick<Displayable, 'zlevel' | 'z' | 'z2' | 'invisible'>> {
  3507. style?: ZRStyleProps;
  3508. during?(params: TransitionDuringAPI): void;
  3509. /**
  3510. * @deprecated
  3511. */
  3512. styleEmphasis?: ZRStyleProps | false;
  3513. emphasis?: CustomDisplayableOptionOnState;
  3514. blur?: CustomDisplayableOptionOnState;
  3515. select?: CustomDisplayableOptionOnState;
  3516. }
  3517. interface CustomDisplayableOptionOnState extends Partial<Pick<Displayable, TransformProp | 'textConfig' | 'z2'>> {
  3518. style?: ZRStyleProps | false;
  3519. }
  3520. interface CustomGroupOption extends CustomBaseElementOption, TransitionOptionMixin<GroupProps> {
  3521. type: 'group';
  3522. width?: number;
  3523. height?: number;
  3524. diffChildrenByName?: boolean;
  3525. children: CustomElementOption[];
  3526. $mergeChildren?: false | 'byName' | 'byIndex';
  3527. keyframeAnimation?: ElementKeyframeAnimationOption<GroupProps> | ElementKeyframeAnimationOption<GroupProps>[];
  3528. }
  3529. interface CustomBaseZRPathOption<T extends PathProps['shape'] = PathProps['shape']> extends CustomDisplayableOption, ShapeMorphingOption, TransitionOptionMixin<PathProps & {
  3530. shape: T;
  3531. }> {
  3532. autoBatch?: boolean;
  3533. shape?: T & TransitionOptionMixin<T>;
  3534. style?: PathProps['style'] & TransitionOptionMixin<PathStyleProps>;
  3535. during?(params: TransitionDuringAPI<PathStyleProps, T>): void;
  3536. keyframeAnimation?: ElementKeyframeAnimationOption<PathProps & {
  3537. shape: T;
  3538. }> | ElementKeyframeAnimationOption<PathProps & {
  3539. shape: T;
  3540. }>[];
  3541. }
  3542. interface BuiltinShapes {
  3543. circle: Partial<Circle['shape']>;
  3544. rect: Partial<Rect['shape']>;
  3545. sector: Partial<Sector['shape']>;
  3546. polygon: Partial<Polygon['shape']>;
  3547. polyline: Partial<Polyline['shape']>;
  3548. line: Partial<Line['shape']>;
  3549. arc: Partial<Arc['shape']>;
  3550. bezierCurve: Partial<BezierCurve['shape']>;
  3551. ring: Partial<Ring['shape']>;
  3552. ellipse: Partial<Ellipse['shape']>;
  3553. compoundPath: Partial<CompoundPath['shape']>;
  3554. }
  3555. interface CustomSVGPathShapeOption {
  3556. pathData?: string;
  3557. d?: string;
  3558. layout?: 'center' | 'cover';
  3559. x?: number;
  3560. y?: number;
  3561. width?: number;
  3562. height?: number;
  3563. }
  3564. interface CustomSVGPathOption extends CustomBaseZRPathOption<CustomSVGPathShapeOption> {
  3565. type: 'path';
  3566. }
  3567. interface CustomBuitinPathOption<T extends keyof BuiltinShapes> extends CustomBaseZRPathOption<BuiltinShapes[T]> {
  3568. type: T;
  3569. }
  3570. declare type CreateCustomBuitinPathOption<T extends keyof BuiltinShapes> = T extends any ? CustomBuitinPathOption<T> : never;
  3571. declare type CustomPathOption = CreateCustomBuitinPathOption<keyof BuiltinShapes> | CustomSVGPathOption;
  3572. interface CustomImageOptionOnState extends CustomDisplayableOptionOnState {
  3573. style?: ImageStyleProps;
  3574. }
  3575. interface CustomImageOption extends CustomDisplayableOption, TransitionOptionMixin<ImageProps> {
  3576. type: 'image';
  3577. style?: ImageStyleProps & TransitionOptionMixin<ImageStyleProps>;
  3578. emphasis?: CustomImageOptionOnState;
  3579. blur?: CustomImageOptionOnState;
  3580. select?: CustomImageOptionOnState;
  3581. keyframeAnimation?: ElementKeyframeAnimationOption<ImageProps> | ElementKeyframeAnimationOption<ImageProps>[];
  3582. }
  3583. interface CustomTextOptionOnState extends CustomDisplayableOptionOnState {
  3584. style?: TextStyleProps;
  3585. }
  3586. interface CustomTextOption extends CustomDisplayableOption, TransitionOptionMixin<TextProps> {
  3587. type: 'text';
  3588. style?: TextStyleProps & TransitionOptionMixin<TextStyleProps>;
  3589. emphasis?: CustomTextOptionOnState;
  3590. blur?: CustomTextOptionOnState;
  3591. select?: CustomTextOptionOnState;
  3592. keyframeAnimation?: ElementKeyframeAnimationOption<TextProps> | ElementKeyframeAnimationOption<TextProps>[];
  3593. }
  3594. declare type CustomElementOption = CustomPathOption | CustomImageOption | CustomTextOption | CustomGroupOption;
  3595. declare type CustomRootElementOption = CustomElementOption & {
  3596. focus?: 'none' | 'self' | 'series' | ArrayLike<number>;
  3597. blurScope?: BlurScope;
  3598. emphasisDisabled?: boolean;
  3599. };
  3600. interface CustomSeriesRenderItemAPI extends CustomSeriesRenderItemCoordinateSystemAPI {
  3601. getWidth(): number;
  3602. getHeight(): number;
  3603. getZr(): ZRenderType;
  3604. getDevicePixelRatio(): number;
  3605. value(dim: DimensionLoose, dataIndexInside?: number): ParsedValue;
  3606. ordinalRawValue(dim: DimensionLoose, dataIndexInside?: number): ParsedValue | OrdinalRawValue;
  3607. /**
  3608. * @deprecated
  3609. */
  3610. style(userProps?: ZRStyleProps, dataIndexInside?: number): ZRStyleProps;
  3611. /**
  3612. * @deprecated
  3613. */
  3614. styleEmphasis(userProps?: ZRStyleProps, dataIndexInside?: number): ZRStyleProps;
  3615. visual<VT extends NonStyleVisualProps | StyleVisualProps>(visualType: VT, dataIndexInside?: number): VT extends NonStyleVisualProps ? DefaultDataVisual[VT] : VT extends StyleVisualProps ? PathStyleProps[typeof STYLE_VISUAL_TYPE[VT]] : void;
  3616. barLayout(opt: BarGridLayoutOptionForCustomSeries): BarGridLayoutResult;
  3617. currentSeriesIndices(): number[];
  3618. font(opt: Pick<TextCommonOption, 'fontStyle' | 'fontWeight' | 'fontSize' | 'fontFamily'>): string;
  3619. }
  3620. interface CustomSeriesRenderItemParamsCoordSys {
  3621. type: string;
  3622. }
  3623. interface CustomSeriesRenderItemCoordinateSystemAPI {
  3624. coord(data: OptionDataValue | OptionDataValue[], clamp?: boolean): number[];
  3625. size?(dataSize: OptionDataValue | OptionDataValue[], dataItem?: OptionDataValue | OptionDataValue[]): number | number[];
  3626. }
  3627. declare type WrapEncodeDefRet = Dictionary<number[]>;
  3628. interface CustomSeriesRenderItemParams {
  3629. context: Dictionary<unknown>;
  3630. dataIndex: number;
  3631. seriesId: string;
  3632. seriesName: string;
  3633. seriesIndex: number;
  3634. coordSys: CustomSeriesRenderItemParamsCoordSys;
  3635. encode: WrapEncodeDefRet;
  3636. dataIndexInside: number;
  3637. dataInsideLength: number;
  3638. actionType?: string;
  3639. }
  3640. declare type CustomSeriesRenderItemReturn = CustomRootElementOption | undefined | null;
  3641. declare type CustomSeriesRenderItem = (params: CustomSeriesRenderItemParams, api: CustomSeriesRenderItemAPI) => CustomSeriesRenderItemReturn;
  3642. interface CustomSeriesOption extends SeriesOption<unknown>, // don't support StateOption in custom series.
  3643. SeriesEncodeOptionMixin, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnSingleOptionMixin, SeriesOnGeoOptionMixin, SeriesOnCalendarOptionMixin {
  3644. type?: 'custom';
  3645. coordinateSystem?: string | 'none';
  3646. renderItem?: CustomSeriesRenderItem;
  3647. /**
  3648. * @deprecated
  3649. */
  3650. itemStyle?: ItemStyleOption;
  3651. /**
  3652. * @deprecated
  3653. */
  3654. label?: LabelOption;
  3655. /**
  3656. * @deprecated
  3657. */
  3658. emphasis?: {
  3659. /**
  3660. * @deprecated
  3661. */
  3662. itemStyle?: ItemStyleOption;
  3663. /**
  3664. * @deprecated
  3665. */
  3666. label?: LabelOption;
  3667. };
  3668. clip?: boolean;
  3669. }
  3670. declare type PrepareCustomInfo = (coordSys: CoordinateSystem) => {
  3671. coordSys: CustomSeriesRenderItemParamsCoordSys;
  3672. api: CustomSeriesRenderItemCoordinateSystemAPI;
  3673. };
  3674. interface CoordinateSystemCreator {
  3675. create: (ecModel: GlobalModel, api: ExtensionAPI) => CoordinateSystemMaster[];
  3676. dimensions?: DimensionName[];
  3677. getDimensionsInfo?: () => DimensionDefinitionLoose[];
  3678. }
  3679. /**
  3680. * The instance get from `CoordinateSystemManger` is `CoordinateSystemMaster`.
  3681. */
  3682. interface CoordinateSystemMaster {
  3683. dimensions: DimensionName[];
  3684. model?: ComponentModel;
  3685. update?: (ecModel: GlobalModel, api: ExtensionAPI) => void;
  3686. convertToPixel?(ecModel: GlobalModel, finder: ParsedModelFinder, value: ScaleDataValue | ScaleDataValue[]): number | number[];
  3687. convertFromPixel?(ecModel: GlobalModel, finder: ParsedModelFinder, pixelValue: number | number[]): number | number[];
  3688. containPoint(point: number[]): boolean;
  3689. getAxes?: () => Axis[];
  3690. axisPointerEnabled?: boolean;
  3691. getTooltipAxes?: (dim: DimensionName | 'auto') => {
  3692. baseAxes: Axis[];
  3693. otherAxes: Axis[];
  3694. };
  3695. /**
  3696. * Get layout rect or coordinate system
  3697. */
  3698. getRect?: () => RectLike;
  3699. }
  3700. /**
  3701. * For example: cartesian is CoordinateSystem.
  3702. * series.coordinateSystem is CoordinateSystem.
  3703. */
  3704. interface CoordinateSystem {
  3705. type: string;
  3706. /**
  3707. * Master of coordinate system. For example:
  3708. * Grid is master of cartesian.
  3709. */
  3710. master?: CoordinateSystemMaster;
  3711. dimensions: DimensionName[];
  3712. model?: ComponentModel;
  3713. /**
  3714. * @param data
  3715. * @param reserved Defined by the coordinate system itself
  3716. * @param out
  3717. * @return {Array.<number>} point Point in global pixel coordinate system.
  3718. */
  3719. dataToPoint(data: ScaleDataValue | ScaleDataValue[], reserved?: any, out?: number[]): number[];
  3720. /**
  3721. * Some coord sys (like Parallel) might do not have `pointToData`,
  3722. * or the meaning of this kind of features is not clear yet.
  3723. * @param point point Point in global pixel coordinate system.
  3724. * @param clamp Clamp range
  3725. * @return data
  3726. */
  3727. pointToData?(point: number[], clamp?: boolean): number | number[];
  3728. containPoint(point: number[]): boolean;
  3729. getAxis?: (dim?: DimensionName) => Axis;
  3730. getBaseAxis?: () => Axis;
  3731. getOtherAxis?: (baseAxis: Axis) => Axis;
  3732. clampData?: (data: ScaleDataValue[], out?: number[]) => number[];
  3733. getRoamTransform?: () => MatrixArray;
  3734. getArea?: () => CoordinateSystemClipArea;
  3735. getBoundingRect?: () => BoundingRect;
  3736. getAxesByScale?: (scaleType: string) => Axis[];
  3737. prepareCustoms?: PrepareCustomInfo;
  3738. }
  3739. /**
  3740. * Like GridModel, PolarModel, ...
  3741. */
  3742. interface CoordinateSystemHostModel extends ComponentModel {
  3743. coordinateSystem?: CoordinateSystemMaster;
  3744. }
  3745. /**
  3746. * Clip area will be returned by getArea of CoordinateSystem.
  3747. * It is used to clip the graphic elements with the contain methods.
  3748. */
  3749. interface CoordinateSystemClipArea {
  3750. contain(x: number, y: number): boolean;
  3751. }
  3752. /**
  3753. * LegendVisualProvider is an bridge that pick encoded color from data and
  3754. * provide to the legend component.
  3755. */
  3756. declare class LegendVisualProvider {
  3757. private _getDataWithEncodedVisual;
  3758. private _getRawData;
  3759. constructor(getDataWithEncodedVisual: () => SeriesData, getRawData: () => SeriesData);
  3760. getAllNames(): string[];
  3761. containName(name: string): boolean;
  3762. indexOfName(name: string): number;
  3763. getItemVisual(dataIndex: number, key: string): any;
  3764. }
  3765. declare function makeStyleMapper(properties: readonly string[][], ignoreParent?: boolean): (model: Model, excludes?: readonly string[], includes?: readonly string[]) => PathStyleProps;
  3766. declare const SERIES_UNIVERSAL_TRANSITION_PROP = "__universalTransitionEnabled";
  3767. interface SeriesModel {
  3768. /**
  3769. * Convinient for override in extended class.
  3770. * Implement it if needed.
  3771. */
  3772. preventIncremental(): boolean;
  3773. /**
  3774. * See tooltip.
  3775. * Implement it if needed.
  3776. * @return Point of tooltip. null/undefined can be returned.
  3777. */
  3778. getTooltipPosition(dataIndex: number): number[];
  3779. /**
  3780. * Get data indices for show tooltip content. See tooltip.
  3781. * Implement it if needed.
  3782. */
  3783. getAxisTooltipData(dim: DimensionName[], value: ScaleDataValue, baseAxis: Axis): {
  3784. dataIndices: number[];
  3785. nestestValue: any;
  3786. };
  3787. /**
  3788. * Get position for marker
  3789. */
  3790. getMarkerPosition(value: ScaleDataValue[]): number[];
  3791. /**
  3792. * Get legend icon symbol according to each series type
  3793. */
  3794. getLegendIcon(opt: LegendIconParams): ECSymbol | Group;
  3795. /**
  3796. * See `component/brush/selector.js`
  3797. * Defined the brush selector for this series.
  3798. */
  3799. brushSelector(dataIndex: number, data: SeriesData, selectors: BrushCommonSelectorsForSeries, area: BrushSelectableArea): boolean;
  3800. enableAriaDecal(): void;
  3801. }
  3802. declare class SeriesModel<Opt extends SeriesOption = SeriesOption> extends ComponentModel<Opt> {
  3803. type: string;
  3804. defaultOption: SeriesOption;
  3805. seriesIndex: number;
  3806. coordinateSystem: CoordinateSystem;
  3807. dataTask: SeriesTask;
  3808. pipelineContext: PipelineContext;
  3809. legendVisualProvider: LegendVisualProvider;
  3810. visualStyleAccessPath: string;
  3811. visualDrawType: 'fill' | 'stroke';
  3812. visualStyleMapper: ReturnType<typeof makeStyleMapper>;
  3813. ignoreStyleOnData: boolean;
  3814. hasSymbolVisual: boolean;
  3815. defaultSymbol: string;
  3816. legendIcon: string;
  3817. [SERIES_UNIVERSAL_TRANSITION_PROP]: boolean;
  3818. private _selectedDataIndicesMap;
  3819. readonly preventUsingHoverLayer: boolean;
  3820. static protoInitialize: void;
  3821. init(option: Opt, parentModel: Model, ecModel: GlobalModel): void;
  3822. /**
  3823. * Util for merge default and theme to option
  3824. */
  3825. mergeDefaultAndTheme(option: Opt, ecModel: GlobalModel): void;
  3826. mergeOption(newSeriesOption: Opt, ecModel: GlobalModel): void;
  3827. fillDataTextStyle(data: ArrayLike<any>): void;
  3828. /**
  3829. * Init a data structure from data related option in series
  3830. * Must be overriden.
  3831. */
  3832. getInitialData(option: Opt, ecModel: GlobalModel): SeriesData;
  3833. /**
  3834. * Append data to list
  3835. */
  3836. appendData(params: {
  3837. data: ArrayLike<any>;
  3838. }): void;
  3839. /**
  3840. * Consider some method like `filter`, `map` need make new data,
  3841. * We should make sure that `seriesModel.getData()` get correct
  3842. * data in the stream procedure. So we fetch data from upstream
  3843. * each time `task.perform` called.
  3844. */
  3845. getData(dataType?: SeriesDataType): SeriesData<this>;
  3846. getAllData(): ({
  3847. data: SeriesData;
  3848. type?: SeriesDataType;
  3849. })[];
  3850. setData(data: SeriesData): void;
  3851. getEncode(): HashMap<OptionEncodeValue, string>;
  3852. getSourceManager(): SourceManager;
  3853. getSource(): Source;
  3854. /**
  3855. * Get data before processed
  3856. */
  3857. getRawData(): SeriesData;
  3858. getColorBy(): ColorBy;
  3859. isColorBySeries(): boolean;
  3860. /**
  3861. * Get base axis if has coordinate system and has axis.
  3862. * By default use coordSys.getBaseAxis();
  3863. * Can be overrided for some chart.
  3864. * @return {type} description
  3865. */
  3866. getBaseAxis(): Axis;
  3867. /**
  3868. * Default tooltip formatter
  3869. *
  3870. * @param dataIndex
  3871. * @param multipleSeries
  3872. * @param dataType
  3873. * @param renderMode valid values: 'html'(by default) and 'richText'.
  3874. * 'html' is used for rendering tooltip in extra DOM form, and the result
  3875. * string is used as DOM HTML content.
  3876. * 'richText' is used for rendering tooltip in rich text form, for those where
  3877. * DOM operation is not supported.
  3878. * @return formatted tooltip with `html` and `markers`
  3879. * Notice: The override method can also return string
  3880. */
  3881. formatTooltip(dataIndex: number, multipleSeries?: boolean, dataType?: SeriesDataType): ReturnType<DataFormatMixin['formatTooltip']>;
  3882. isAnimationEnabled(): boolean;
  3883. restoreData(): void;
  3884. getColorFromPalette(name: string, scope: any, requestColorNum?: number): ZRColor;
  3885. /**
  3886. * Use `data.mapDimensionsAll(coordDim)` instead.
  3887. * @deprecated
  3888. */
  3889. coordDimToDataDim(coordDim: DimensionName): DimensionName[];
  3890. /**
  3891. * Get progressive rendering count each step
  3892. */
  3893. getProgressive(): number | false;
  3894. /**
  3895. * Get progressive rendering count each step
  3896. */
  3897. getProgressiveThreshold(): number;
  3898. select(innerDataIndices: number[], dataType?: SeriesDataType): void;
  3899. unselect(innerDataIndices: number[], dataType?: SeriesDataType): void;
  3900. toggleSelect(innerDataIndices: number[], dataType?: SeriesDataType): void;
  3901. getSelectedDataIndices(): number[];
  3902. isSelected(dataIndex: number, dataType?: SeriesDataType): boolean;
  3903. isUniversalTransitionEnabled(): boolean;
  3904. private _innerSelect;
  3905. private _initSelectedMapFromData;
  3906. static registerClass(clz: Constructor): Constructor;
  3907. }
  3908. interface SeriesModel<Opt extends SeriesOption = SeriesOption> extends DataFormatMixin, PaletteMixin<Opt>, DataHost {
  3909. /**
  3910. * Get dimension to render shadow in dataZoom component
  3911. */
  3912. getShadowDim?(): string;
  3913. }
  3914. /**
  3915. * Multi dimensional data store
  3916. */
  3917. declare const dataCtors: {
  3918. readonly float: ArrayConstructor | Float64ArrayConstructor;
  3919. readonly int: ArrayConstructor | Int32ArrayConstructor;
  3920. readonly ordinal: ArrayConstructor;
  3921. readonly number: ArrayConstructor;
  3922. readonly time: ArrayConstructor | Float64ArrayConstructor;
  3923. };
  3924. declare type DataStoreDimensionType = keyof typeof dataCtors;
  3925. declare type EachCb = (...args: any) => void;
  3926. declare type FilterCb = (...args: any) => boolean;
  3927. declare type MapCb = (...args: any) => ParsedValue | ParsedValue[];
  3928. declare type DimValueGetter = (this: DataStore, dataItem: any, property: string, dataIndex: number, dimIndex: DimensionIndex) => ParsedValue;
  3929. interface DataStoreDimensionDefine {
  3930. /**
  3931. * Default to be float.
  3932. */
  3933. type?: DataStoreDimensionType;
  3934. /**
  3935. * Only used in SOURCE_FORMAT_OBJECT_ROWS and SOURCE_FORMAT_KEYED_COLUMNS to retrieve value
  3936. * by "object property".
  3937. * For example, in `[{bb: 124, aa: 543}, ...]`, "aa" and "bb" is "object property".
  3938. *
  3939. * Deliberately name it as "property" rather than "name" to prevent it from been used in
  3940. * SOURCE_FORMAT_ARRAY_ROWS, becuase if it comes from series, it probably
  3941. * can not be shared by different series.
  3942. */
  3943. property?: string;
  3944. /**
  3945. * When using category axis.
  3946. * Category strings will be collected and stored in ordinalMeta.categories.
  3947. * And store will store the index of categories.
  3948. */
  3949. ordinalMeta?: OrdinalMeta;
  3950. /**
  3951. * Offset for ordinal parsing and collect
  3952. */
  3953. ordinalOffset?: number;
  3954. }
  3955. /**
  3956. * Basically, DataStore API keep immutable.
  3957. */
  3958. declare class DataStore {
  3959. private _chunks;
  3960. private _provider;
  3961. private _rawExtent;
  3962. private _extent;
  3963. private _indices;
  3964. private _count;
  3965. private _rawCount;
  3966. private _dimensions;
  3967. private _dimValueGetter;
  3968. private _calcDimNameToIdx;
  3969. defaultDimValueGetter: DimValueGetter;
  3970. /**
  3971. * Initialize from data
  3972. */
  3973. initData(provider: DataProvider, inputDimensions: DataStoreDimensionDefine[], dimValueGetter?: DimValueGetter): void;
  3974. getProvider(): DataProvider;
  3975. /**
  3976. * Caution: even when a `source` instance owned by a series, the created data store
  3977. * may still be shared by different sereis (the source hash does not use all `source`
  3978. * props, see `sourceManager`). In this case, the `source` props that are not used in
  3979. * hash (like `source.dimensionDefine`) probably only belongs to a certain series and
  3980. * thus should not be fetch here.
  3981. */
  3982. getSource(): Source;
  3983. /**
  3984. * @caution Only used in dataStack.
  3985. */
  3986. ensureCalculationDimension(dimName: DimensionName, type: DataStoreDimensionType): DimensionIndex;
  3987. collectOrdinalMeta(dimIdx: number, ordinalMeta: OrdinalMeta): void;
  3988. getOrdinalMeta(dimIdx: number): OrdinalMeta;
  3989. getDimensionProperty(dimIndex: DimensionIndex): DataStoreDimensionDefine['property'];
  3990. /**
  3991. * Caution: Can be only called on raw data (before `this._indices` created).
  3992. */
  3993. appendData(data: ArrayLike<any>): number[];
  3994. appendValues(values: any[][], minFillLen?: number): {
  3995. start: number;
  3996. end: number;
  3997. };
  3998. private _initDataFromProvider;
  3999. count(): number;
  4000. /**
  4001. * Get value. Return NaN if idx is out of range.
  4002. */
  4003. get(dim: DimensionIndex, idx: number): ParsedValue;
  4004. getValues(idx: number): ParsedValue[];
  4005. getValues(dimensions: readonly DimensionIndex[], idx?: number): ParsedValue[];
  4006. /**
  4007. * @param dim concrete dim
  4008. */
  4009. getByRawIndex(dim: DimensionIndex, rawIdx: number): ParsedValue;
  4010. /**
  4011. * Get sum of data in one dimension
  4012. */
  4013. getSum(dim: DimensionIndex): number;
  4014. /**
  4015. * Get median of data in one dimension
  4016. */
  4017. getMedian(dim: DimensionIndex): number;
  4018. /**
  4019. * Retreive the index with given raw data index
  4020. */
  4021. indexOfRawIndex(rawIndex: number): number;
  4022. /**
  4023. * Retreive the index of nearest value
  4024. * @param dim
  4025. * @param value
  4026. * @param [maxDistance=Infinity]
  4027. * @return If and only if multiple indices has
  4028. * the same value, they are put to the result.
  4029. */
  4030. indicesOfNearest(dim: DimensionIndex, value: number, maxDistance?: number): number[];
  4031. getIndices(): ArrayLike<number>;
  4032. /**
  4033. * Data filter.
  4034. */
  4035. filter(dims: DimensionIndex[], cb: FilterCb): DataStore;
  4036. /**
  4037. * Select data in range. (For optimization of filter)
  4038. * (Manually inline code, support 5 million data filtering in data zoom.)
  4039. */
  4040. selectRange(range: {
  4041. [dimIdx: number]: [number, number];
  4042. }): DataStore;
  4043. /**
  4044. * Data mapping to a new List with given dimensions
  4045. */
  4046. map(dims: DimensionIndex[], cb: MapCb): DataStore;
  4047. /**
  4048. * @caution Danger!! Only used in dataStack.
  4049. */
  4050. modify(dims: DimensionIndex[], cb: MapCb): void;
  4051. private _updateDims;
  4052. /**
  4053. * Large data down sampling using largest-triangle-three-buckets
  4054. * @param {string} valueDimension
  4055. * @param {number} targetCount
  4056. */
  4057. lttbDownSample(valueDimension: DimensionIndex, rate: number): DataStore;
  4058. /**
  4059. * Large data down sampling on given dimension
  4060. * @param sampleIndex Sample index for name and id
  4061. */
  4062. downSample(dimension: DimensionIndex, rate: number, sampleValue: (frameValues: ArrayLike<ParsedValue>) => ParsedValueNumeric, sampleIndex: (frameValues: ArrayLike<ParsedValue>, value: ParsedValueNumeric) => number): DataStore;
  4063. /**
  4064. * Data iteration
  4065. * @param ctx default this
  4066. * @example
  4067. * list.each('x', function (x, idx) {});
  4068. * list.each(['x', 'y'], function (x, y, idx) {});
  4069. * list.each(function (idx) {})
  4070. */
  4071. each(dims: DimensionIndex[], cb: EachCb): void;
  4072. /**
  4073. * Get extent of data in one dimension
  4074. */
  4075. getDataExtent(dim: DimensionIndex): [number, number];
  4076. /**
  4077. * Get raw data index.
  4078. * Do not initialize.
  4079. * Default `getRawIndex`. And it can be changed.
  4080. */
  4081. getRawIndex: (idx: number) => number;
  4082. /**
  4083. * Get raw data item
  4084. */
  4085. getRawDataItem(idx: number): OptionDataItem;
  4086. /**
  4087. * Clone shallow.
  4088. *
  4089. * @param clonedDims Determine which dims to clone. Will share the data if not specified.
  4090. */
  4091. clone(clonedDims?: DimensionIndex[], ignoreIndices?: boolean): DataStore;
  4092. private _copyCommonProps;
  4093. private _cloneIndices;
  4094. private _getRawIdxIdentity;
  4095. private _getRawIdx;
  4096. private _updateGetRawIdx;
  4097. private static internalField;
  4098. }
  4099. declare class SeriesDimensionDefine {
  4100. /**
  4101. * Dimension type. The enumerable values are the key of
  4102. * Optional.
  4103. */
  4104. type?: DimensionType;
  4105. /**
  4106. * Dimension name.
  4107. * Mandatory.
  4108. */
  4109. name: string;
  4110. /**
  4111. * The origin name in dimsDef, see source helper.
  4112. * If displayName given, the tooltip will displayed vertically.
  4113. * Optional.
  4114. */
  4115. displayName?: string;
  4116. tooltip?: boolean;
  4117. /**
  4118. * This dimension maps to the the dimension in dataStore by `storeDimIndex`.
  4119. * Notice the facts:
  4120. * 1. When there are too many dimensions in data store, seriesData only save the
  4121. * used store dimensions.
  4122. * 2. We use dimensionIndex but not name to reference store dimension
  4123. * becuause the dataset dimension definition might has no name specified by users,
  4124. * or names in sereis dimension definition might be different from dataset.
  4125. */
  4126. storeDimIndex?: number;
  4127. /**
  4128. * Which coordSys dimension this dimension mapped to.
  4129. * A `coordDim` can be a "coordSysDim" that the coordSys required
  4130. * (for example, an item in `coordSysDims` of `model/referHelper#CoordSysInfo`),
  4131. * or an generated "extra coord name" if does not mapped to any "coordSysDim"
  4132. * (That is determined by whether `isExtraCoord` is `true`).
  4133. * Mandatory.
  4134. */
  4135. coordDim?: string;
  4136. /**
  4137. * The index of this dimension in `series.encode[coordDim]`.
  4138. * Mandatory.
  4139. */
  4140. coordDimIndex?: number;
  4141. /**
  4142. * The format of `otherDims` is:
  4143. * ```js
  4144. * {
  4145. * tooltip?: number
  4146. * label?: number
  4147. * itemName?: number
  4148. * seriesName?: number
  4149. * }
  4150. * ```
  4151. *
  4152. * A `series.encode` can specified these fields:
  4153. * ```js
  4154. * encode: {
  4155. * // "3, 1, 5" is the index of data dimension.
  4156. * tooltip: [3, 1, 5],
  4157. * label: [0, 3],
  4158. * ...
  4159. * }
  4160. * ```
  4161. * `otherDims` is the parse result of the `series.encode` above, like:
  4162. * ```js
  4163. * // Suppose the index of this data dimension is `3`.
  4164. * this.otherDims = {
  4165. * // `3` is at the index `0` of the `encode.tooltip`
  4166. * tooltip: 0,
  4167. * // `3` is at the index `1` of the `encode.label`
  4168. * label: 1
  4169. * };
  4170. * ```
  4171. *
  4172. * This prop should never be `null`/`undefined` after initialized.
  4173. */
  4174. otherDims?: DataVisualDimensions;
  4175. /**
  4176. * Be `true` if this dimension is not mapped to any "coordSysDim" that the
  4177. * "coordSys" required.
  4178. * Mandatory.
  4179. */
  4180. isExtraCoord?: boolean;
  4181. /**
  4182. * If this dimension if for calculated value like stacking
  4183. */
  4184. isCalculationCoord?: boolean;
  4185. defaultTooltip?: boolean;
  4186. ordinalMeta?: OrdinalMeta;
  4187. /**
  4188. * Whether to create inverted indices.
  4189. */
  4190. createInvertedIndices?: boolean;
  4191. /**
  4192. * @param opt All of the fields will be shallow copied.
  4193. */
  4194. constructor(opt?: object | SeriesDimensionDefine);
  4195. }
  4196. /**
  4197. * Represents the dimension requirement of a series.
  4198. *
  4199. * NOTICE:
  4200. * When there are too many dimensions in dataset and many series, only the used dimensions
  4201. * (i.e., used by coord sys and declared in `series.encode`) are add to `dimensionDefineList`.
  4202. * But users may query data by other unused dimension names.
  4203. * In this case, users can only query data if and only if they have defined dimension names
  4204. * via ec option, so we provide `getDimensionIndexFromSource`, which only query them from
  4205. * `source` dimensions.
  4206. */
  4207. declare class SeriesDataSchema {
  4208. /**
  4209. * When there are too many dimensions, `dimensionDefineList` might only contain
  4210. * used dimensions.
  4211. *
  4212. * CAUTION:
  4213. * Should have been sorted by `storeDimIndex` asc.
  4214. *
  4215. * PENDING:
  4216. * The item can still be modified outsite.
  4217. * But MUST NOT add/remove item of this array.
  4218. */
  4219. readonly dimensions: SeriesDimensionDefine[];
  4220. readonly source: Source;
  4221. private _fullDimCount;
  4222. private _dimNameMap;
  4223. private _dimOmitted;
  4224. constructor(opt: {
  4225. source: Source;
  4226. dimensions: SeriesDimensionDefine[];
  4227. fullDimensionCount: number;
  4228. dimensionOmitted: boolean;
  4229. });
  4230. isDimensionOmitted(): boolean;
  4231. private _updateDimOmitted;
  4232. /**
  4233. * @caution Can only be used when `dimensionOmitted: true`.
  4234. *
  4235. * Get index by user defined dimension name (i.e., not internal generate name).
  4236. * That is, get index from `dimensionsDefine`.
  4237. * If no `dimensionsDefine`, or no name get, return -1.
  4238. */
  4239. getSourceDimensionIndex(dimName: DimensionName): DimensionIndex;
  4240. /**
  4241. * @caution Can only be used when `dimensionOmitted: true`.
  4242. *
  4243. * Notice: may return `null`/`undefined` if user not specify dimension names.
  4244. */
  4245. getSourceDimension(dimIndex: DimensionIndex): DimensionDefinition;
  4246. makeStoreSchema(): {
  4247. dimensions: DataStoreDimensionDefine[];
  4248. hash: string;
  4249. };
  4250. makeOutputDimensionNames(): DimensionName[];
  4251. appendCalculationDimension(dimDef: SeriesDimensionDefine): void;
  4252. }
  4253. /**
  4254. * [REQUIREMENT_MEMO]:
  4255. * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option.
  4256. * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and
  4257. * `root-dataset`. Them on `series` has higher priority.
  4258. * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might
  4259. * confuse users: whether those props indicate how to visit the upstream source or visit
  4260. * the transform result source, and some transforms has nothing to do with these props,
  4261. * and some transforms might have multiple upstream.
  4262. * (3) Transforms should specify `metaRawOption` in each output, just like they can be
  4263. * declared in `root-dataset`.
  4264. * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms.
  4265. * That is for reducing complexity in transfroms.
  4266. * PENDING: Whether to provide transposition transform?
  4267. *
  4268. * [IMPLEMENTAION_MEMO]:
  4269. * "sourceVisitConfig" are calculated from `metaRawOption` and `data`.
  4270. * They will not be calculated until `source` is about to be visited (to prevent from
  4271. * duplicate calcuation). `source` is visited only in series and input to transforms.
  4272. *
  4273. * [DIMENSION_INHERIT_RULE]:
  4274. * By default the dimensions are inherited from ancestors, unless a transform return
  4275. * a new dimensions definition.
  4276. * Consider the case:
  4277. * ```js
  4278. * dataset: [{
  4279. * source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...]
  4280. * }, {
  4281. * transform: { type: 'filter', ... }
  4282. * }]
  4283. * dataset: [{
  4284. * dimension: ['Product', 'Sales', 'Prise'],
  4285. * source: [ ['Cookies', 321, 44.21], ...]
  4286. * }, {
  4287. * transform: { type: 'filter', ... }
  4288. * }]
  4289. * ```
  4290. * The two types of option should have the same behavior after transform.
  4291. *
  4292. *
  4293. * [SCENARIO]:
  4294. * (1) Provide source data directly:
  4295. * ```js
  4296. * series: {
  4297. * encode: {...},
  4298. * dimensions: [...]
  4299. * seriesLayoutBy: 'row',
  4300. * data: [[...]]
  4301. * }
  4302. * ```
  4303. * (2) Series refer to dataset.
  4304. * ```js
  4305. * series: [{
  4306. * encode: {...}
  4307. * // Ignore datasetIndex means `datasetIndex: 0`
  4308. * // and the dimensions defination in dataset is used
  4309. * }, {
  4310. * encode: {...},
  4311. * seriesLayoutBy: 'column',
  4312. * datasetIndex: 1
  4313. * }]
  4314. * ```
  4315. * (3) dataset transform
  4316. * ```js
  4317. * dataset: [{
  4318. * source: [...]
  4319. * }, {
  4320. * source: [...]
  4321. * }, {
  4322. * // By default from 0.
  4323. * transform: { type: 'filter', config: {...} }
  4324. * }, {
  4325. * // Piped.
  4326. * transform: [
  4327. * { type: 'filter', config: {...} },
  4328. * { type: 'sort', config: {...} }
  4329. * ]
  4330. * }, {
  4331. * id: 'regressionData',
  4332. * fromDatasetIndex: 1,
  4333. * // Third-party transform
  4334. * transform: { type: 'ecStat:regression', config: {...} }
  4335. * }, {
  4336. * // retrieve the extra result.
  4337. * id: 'regressionFormula',
  4338. * fromDatasetId: 'regressionData',
  4339. * fromTransformResult: 1
  4340. * }]
  4341. * ```
  4342. */
  4343. declare class SourceManager {
  4344. private _sourceHost;
  4345. private _sourceList;
  4346. private _storeList;
  4347. private _upstreamSignList;
  4348. private _versionSignBase;
  4349. private _dirty;
  4350. constructor(sourceHost: DatasetModel | SeriesModel);
  4351. /**
  4352. * Mark dirty.
  4353. */
  4354. dirty(): void;
  4355. private _setLocalSource;
  4356. /**
  4357. * For detecting whether the upstream source is dirty, so that
  4358. * the local cached source (in `_sourceList`) should be discarded.
  4359. */
  4360. private _getVersionSign;
  4361. /**
  4362. * Always return a source instance. Otherwise throw error.
  4363. */
  4364. prepareSource(): void;
  4365. private _createSource;
  4366. private _applyTransform;
  4367. private _isDirty;
  4368. /**
  4369. * @param sourceIndex By defualt 0, means "main source".
  4370. * Most cases there is only one source.
  4371. */
  4372. getSource(sourceIndex?: number): Source;
  4373. /**
  4374. *
  4375. * Get a data store which can be shared across series.
  4376. * Only available for series.
  4377. *
  4378. * @param seriesDimRequest Dimensions that are generated in series.
  4379. * Should have been sorted by `storeDimIndex` asc.
  4380. */
  4381. getSharedDataStore(seriesDimRequest: SeriesDataSchema): DataStore;
  4382. private _innerGetDataStore;
  4383. /**
  4384. * PEDING: Is it fast enough?
  4385. * If no upstream, return empty array.
  4386. */
  4387. private _getUpstreamSourceManagers;
  4388. private _getSourceMetaRawOption;
  4389. }
  4390. /**
  4391. * This module is imported by echarts directly.
  4392. *
  4393. * Notice:
  4394. * Always keep this file exists for backward compatibility.
  4395. * Because before 4.1.0, dataset is an optional component,
  4396. * some users may import this module manually.
  4397. */
  4398. interface DatasetOption extends Pick<ComponentOption, 'type' | 'id' | 'name'>, Pick<SeriesEncodeOptionMixin, 'dimensions'> {
  4399. mainType?: 'dataset';
  4400. seriesLayoutBy?: SeriesLayoutBy;
  4401. sourceHeader?: OptionSourceHeader;
  4402. source?: OptionSourceData;
  4403. fromDatasetIndex?: number;
  4404. fromDatasetId?: string;
  4405. transform?: DataTransformOption | PipedDataTransformOption;
  4406. fromTransformResult?: number;
  4407. }
  4408. declare class DatasetModel<Opts extends DatasetOption = DatasetOption> extends ComponentModel<Opts> {
  4409. type: string;
  4410. static type: string;
  4411. static defaultOption: DatasetOption;
  4412. private _sourceManager;
  4413. init(option: Opts, parentModel: Model, ecModel: GlobalModel): void;
  4414. mergeOption(newOption: Opts, ecModel: GlobalModel): void;
  4415. optionUpdated(): void;
  4416. getSourceManager(): SourceManager;
  4417. }
  4418. /**
  4419. * [sourceFormat]
  4420. *
  4421. * + "original":
  4422. * This format is only used in series.data, where
  4423. * itemStyle can be specified in data item.
  4424. *
  4425. * + "arrayRows":
  4426. * [
  4427. * ['product', 'score', 'amount'],
  4428. * ['Matcha Latte', 89.3, 95.8],
  4429. * ['Milk Tea', 92.1, 89.4],
  4430. * ['Cheese Cocoa', 94.4, 91.2],
  4431. * ['Walnut Brownie', 85.4, 76.9]
  4432. * ]
  4433. *
  4434. * + "objectRows":
  4435. * [
  4436. * {product: 'Matcha Latte', score: 89.3, amount: 95.8},
  4437. * {product: 'Milk Tea', score: 92.1, amount: 89.4},
  4438. * {product: 'Cheese Cocoa', score: 94.4, amount: 91.2},
  4439. * {product: 'Walnut Brownie', score: 85.4, amount: 76.9}
  4440. * ]
  4441. *
  4442. * + "keyedColumns":
  4443. * {
  4444. * 'product': ['Matcha Latte', 'Milk Tea', 'Cheese Cocoa', 'Walnut Brownie'],
  4445. * 'count': [823, 235, 1042, 988],
  4446. * 'score': [95.8, 81.4, 91.2, 76.9]
  4447. * }
  4448. *
  4449. * + "typedArray"
  4450. *
  4451. * + "unknown"
  4452. */
  4453. interface SourceMetaRawOption {
  4454. seriesLayoutBy: SeriesLayoutBy;
  4455. sourceHeader: OptionSourceHeader;
  4456. dimensions: DimensionDefinitionLoose[];
  4457. }
  4458. interface Source extends SourceImpl {
  4459. }
  4460. declare class SourceImpl {
  4461. /**
  4462. * Not null/undefined.
  4463. */
  4464. readonly data: OptionSourceData;
  4465. /**
  4466. * See also "detectSourceFormat".
  4467. * Not null/undefined.
  4468. */
  4469. readonly sourceFormat: SourceFormat;
  4470. /**
  4471. * 'row' or 'column'
  4472. * Not null/undefined.
  4473. */
  4474. readonly seriesLayoutBy: SeriesLayoutBy;
  4475. /**
  4476. * dimensions definition from:
  4477. * (1) standalone defined in option prop `dimensions: [...]`
  4478. * (2) detected from option data. See `determineSourceDimensions`.
  4479. * If can not be detected (e.g., there is only pure data `[[11, 33], ...]`
  4480. * `dimensionsDefine` will be null/undefined.
  4481. */
  4482. readonly dimensionsDefine: DimensionDefinition[];
  4483. /**
  4484. * Only make sense in `SOURCE_FORMAT_ARRAY_ROWS`.
  4485. * That is the same as `sourceHeader: number`,
  4486. * which means from which line the real data start.
  4487. * Not null/undefined, uint.
  4488. */
  4489. readonly startIndex: number;
  4490. /**
  4491. * Dimension count detected from data. Only works when `dimensionDefine`
  4492. * does not exists.
  4493. * Can be null/undefined (when unknown), uint.
  4494. */
  4495. readonly dimensionsDetectedCount: number;
  4496. /**
  4497. * Raw props from user option.
  4498. */
  4499. readonly metaRawOption: SourceMetaRawOption;
  4500. constructor(fields: {
  4501. data: OptionSourceData;
  4502. sourceFormat: SourceFormat;
  4503. seriesLayoutBy?: SeriesLayoutBy;
  4504. dimensionsDefine?: DimensionDefinition[];
  4505. startIndex?: number;
  4506. dimensionsDetectedCount?: number;
  4507. metaRawOption?: SourceMetaRawOption;
  4508. encodeDefine?: HashMap<OptionEncodeValue, DimensionName>;
  4509. });
  4510. }
  4511. interface DataProvider {
  4512. /**
  4513. * true: all of the value are in primitive type (in type `OptionDataValue`).
  4514. * false: Not sure whether any of them is non primitive type (in type `OptionDataItemObject`).
  4515. * Like `data: [ { value: xx, itemStyle: {...} }, ...]`
  4516. * At present it only happen in `SOURCE_FORMAT_ORIGINAL`.
  4517. */
  4518. pure?: boolean;
  4519. /**
  4520. * If data is persistent and will not be released after use.
  4521. */
  4522. persistent?: boolean;
  4523. getSource(): Source;
  4524. count(): number;
  4525. getItem(idx: number, out?: OptionDataItem): OptionDataItem;
  4526. fillStorage?(start: number, end: number, out: ArrayLike$1<ParsedValue>[], extent: number[][]): void;
  4527. appendData?(newData: ArrayLike$1<OptionDataItem>): void;
  4528. clean?(): void;
  4529. }
  4530. declare type DimensionSummaryEncode = {
  4531. defaultedLabel: DimensionName[];
  4532. defaultedTooltip: DimensionName[];
  4533. [coordOrVisualDimName: string]: DimensionName[];
  4534. };
  4535. declare type DimensionSummary = {
  4536. encode: DimensionSummaryEncode;
  4537. userOutput: DimensionUserOuput;
  4538. dataDimsOnCoord: DimensionName[];
  4539. dataDimIndicesOnCoord: DimensionIndex[];
  4540. encodeFirstDimNotExtra: {
  4541. [coordDim: string]: DimensionName;
  4542. };
  4543. };
  4544. declare type DimensionUserOuputEncode = {
  4545. [coordOrVisualDimName: string]: DimensionIndex[];
  4546. };
  4547. declare class DimensionUserOuput {
  4548. private _encode;
  4549. private _cachedDimNames;
  4550. private _schema?;
  4551. constructor(encode: DimensionUserOuputEncode, dimRequest?: SeriesDataSchema);
  4552. get(): {
  4553. fullDimensions: DimensionName[];
  4554. encode: DimensionUserOuputEncode;
  4555. };
  4556. /**
  4557. * Get all data store dimension names.
  4558. * Theoretically a series data store is defined both by series and used dataset (if any).
  4559. * If some dimensions are omitted for performance reason in `this.dimensions`,
  4560. * the dimension name may not be auto-generated if user does not specify a dimension name.
  4561. * In this case, the dimension name is `null`/`undefined`.
  4562. */
  4563. private _getFullDimensionNames;
  4564. }
  4565. declare class Graph {
  4566. type: 'graph';
  4567. readonly nodes: GraphNode[];
  4568. readonly edges: GraphEdge[];
  4569. data: SeriesData;
  4570. edgeData: SeriesData;
  4571. /**
  4572. * Whether directed graph.
  4573. */
  4574. private _directed;
  4575. private _nodesMap;
  4576. /**
  4577. * @type {Object.<string, module:echarts/data/Graph.Edge>}
  4578. * @private
  4579. */
  4580. private _edgesMap;
  4581. constructor(directed?: boolean);
  4582. /**
  4583. * If is directed graph
  4584. */
  4585. isDirected(): boolean;
  4586. /**
  4587. * Add a new node
  4588. */
  4589. addNode(id: string | number, dataIndex?: number): GraphNode;
  4590. /**
  4591. * Get node by data index
  4592. */
  4593. getNodeByIndex(dataIndex: number): GraphNode;
  4594. /**
  4595. * Get node by id
  4596. */
  4597. getNodeById(id: string): GraphNode;
  4598. /**
  4599. * Add a new edge
  4600. */
  4601. addEdge(n1: GraphNode | number | string, n2: GraphNode | number | string, dataIndex?: number): GraphEdge;
  4602. /**
  4603. * Get edge by data index
  4604. */
  4605. getEdgeByIndex(dataIndex: number): GraphEdge;
  4606. /**
  4607. * Get edge by two linked nodes
  4608. */
  4609. getEdge(n1: string | GraphNode, n2: string | GraphNode): GraphEdge;
  4610. /**
  4611. * Iterate all nodes
  4612. */
  4613. eachNode<Ctx>(cb: (this: Ctx, node: GraphNode, idx: number) => void, context?: Ctx): void;
  4614. /**
  4615. * Iterate all edges
  4616. */
  4617. eachEdge<Ctx>(cb: (this: Ctx, edge: GraphEdge, idx: number) => void, context?: Ctx): void;
  4618. /**
  4619. * Breadth first traverse
  4620. * Return true to stop traversing
  4621. */
  4622. breadthFirstTraverse<Ctx>(cb: (this: Ctx, node: GraphNode, fromNode: GraphNode) => boolean | void, startNode: GraphNode | string, direction: 'none' | 'in' | 'out', context?: Ctx): void;
  4623. update(): void;
  4624. /**
  4625. * @return {module:echarts/data/Graph}
  4626. */
  4627. clone(): Graph;
  4628. }
  4629. interface GraphDataProxyMixin {
  4630. getValue(dimension?: DimensionLoose): ParsedValue;
  4631. setVisual(key: string | Dictionary<any>, value?: any): void;
  4632. getVisual(key: string): any;
  4633. setLayout(layout: any, merge?: boolean): void;
  4634. getLayout(): any;
  4635. getGraphicEl(): Element;
  4636. getRawIndex(): number;
  4637. }
  4638. declare class GraphEdge {
  4639. /**
  4640. * The first node. If directed graph, it represents the source node.
  4641. */
  4642. node1: GraphNode;
  4643. /**
  4644. * The second node. If directed graph, it represents the target node.
  4645. */
  4646. node2: GraphNode;
  4647. dataIndex: number;
  4648. hostGraph: Graph;
  4649. constructor(n1: GraphNode, n2: GraphNode, dataIndex?: number);
  4650. getModel<T = unknown>(): Model<T>;
  4651. getModel<T = unknown, S extends keyof T = keyof T>(path: S): Model<T[S]>;
  4652. getAdjacentDataIndices(): {
  4653. node: number[];
  4654. edge: number[];
  4655. };
  4656. }
  4657. interface GraphEdge extends GraphDataProxyMixin {
  4658. }
  4659. declare class GraphNode {
  4660. id: string;
  4661. inEdges: GraphEdge[];
  4662. outEdges: GraphEdge[];
  4663. edges: GraphEdge[];
  4664. hostGraph: Graph;
  4665. dataIndex: number;
  4666. __visited: boolean;
  4667. constructor(id?: string, dataIndex?: number);
  4668. /**
  4669. * @return {number}
  4670. */
  4671. degree(): number;
  4672. /**
  4673. * @return {number}
  4674. */
  4675. inDegree(): number;
  4676. /**
  4677. * @return {number}
  4678. */
  4679. outDegree(): number;
  4680. getModel<T = unknown>(): Model<T>;
  4681. getModel<T = unknown, S extends keyof T = keyof T>(path: S): Model<T[S]>;
  4682. getAdjacentDataIndices(): {
  4683. node: number[];
  4684. edge: number[];
  4685. };
  4686. }
  4687. interface GraphNode extends GraphDataProxyMixin {
  4688. }
  4689. declare type TreeTraverseOrder = 'preorder' | 'postorder';
  4690. declare type TreeTraverseCallback<Ctx> = (this: Ctx, node: TreeNode) => boolean | void;
  4691. declare type TreeTraverseOption = {
  4692. order?: TreeTraverseOrder;
  4693. attr?: 'children' | 'viewChildren';
  4694. };
  4695. interface TreeNodeOption extends Pick<OptionDataItemObject<OptionDataValue>, 'name' | 'value'> {
  4696. children?: TreeNodeOption[];
  4697. }
  4698. declare class TreeNode {
  4699. name: string;
  4700. depth: number;
  4701. height: number;
  4702. parentNode: TreeNode;
  4703. /**
  4704. * Reference to list item.
  4705. * Do not persistent dataIndex outside,
  4706. * besause it may be changed by list.
  4707. * If dataIndex -1,
  4708. * this node is logical deleted (filtered) in list.
  4709. */
  4710. dataIndex: number;
  4711. children: TreeNode[];
  4712. viewChildren: TreeNode[];
  4713. isExpand: boolean;
  4714. readonly hostTree: Tree<Model>;
  4715. constructor(name: string, hostTree: Tree<Model>);
  4716. /**
  4717. * The node is removed.
  4718. */
  4719. isRemoved(): boolean;
  4720. /**
  4721. * Travel this subtree (include this node).
  4722. * Usage:
  4723. * node.eachNode(function () { ... }); // preorder
  4724. * node.eachNode('preorder', function () { ... }); // preorder
  4725. * node.eachNode('postorder', function () { ... }); // postorder
  4726. * node.eachNode(
  4727. * {order: 'postorder', attr: 'viewChildren'},
  4728. * function () { ... }
  4729. * ); // postorder
  4730. *
  4731. * @param options If string, means order.
  4732. * @param options.order 'preorder' or 'postorder'
  4733. * @param options.attr 'children' or 'viewChildren'
  4734. * @param cb If in preorder and return false,
  4735. * its subtree will not be visited.
  4736. */
  4737. eachNode<Ctx>(options: TreeTraverseOrder, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4738. eachNode<Ctx>(options: TreeTraverseOption, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4739. eachNode<Ctx>(cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4740. /**
  4741. * Update depth and height of this subtree.
  4742. */
  4743. updateDepthAndHeight(depth: number): void;
  4744. getNodeById(id: string): TreeNode;
  4745. contains(node: TreeNode): boolean;
  4746. /**
  4747. * @param includeSelf Default false.
  4748. * @return order: [root, child, grandchild, ...]
  4749. */
  4750. getAncestors(includeSelf?: boolean): TreeNode[];
  4751. getAncestorsIndices(): number[];
  4752. getDescendantIndices(): number[];
  4753. getValue(dimension?: DimensionLoose): ParsedValue;
  4754. setLayout(layout: any, merge?: boolean): void;
  4755. /**
  4756. * @return {Object} layout
  4757. */
  4758. getLayout(): any;
  4759. getModel<T = unknown>(): Model<T>;
  4760. getLevelModel(): Model;
  4761. /**
  4762. * @example
  4763. * setItemVisual('color', color);
  4764. * setItemVisual({
  4765. * 'color': color
  4766. * });
  4767. */
  4768. setVisual(key: string, value: any): void;
  4769. setVisual(obj: Dictionary<any>): void;
  4770. /**
  4771. * Get item visual
  4772. * FIXME: make return type better
  4773. */
  4774. getVisual(key: string): unknown;
  4775. getRawIndex(): number;
  4776. getId(): string;
  4777. /**
  4778. * index in parent's children
  4779. */
  4780. getChildIndex(): number;
  4781. /**
  4782. * if this is an ancestor of another node
  4783. *
  4784. * @param node another node
  4785. * @return if is ancestor
  4786. */
  4787. isAncestorOf(node: TreeNode): boolean;
  4788. /**
  4789. * if this is an descendant of another node
  4790. *
  4791. * @param node another node
  4792. * @return if is descendant
  4793. */
  4794. isDescendantOf(node: TreeNode): boolean;
  4795. }
  4796. declare class Tree<HostModel extends Model = Model, LevelOption = any> {
  4797. type: 'tree';
  4798. root: TreeNode;
  4799. data: SeriesData;
  4800. hostModel: HostModel;
  4801. levelModels: Model<LevelOption>[];
  4802. private _nodes;
  4803. constructor(hostModel: HostModel);
  4804. /**
  4805. * Travel this subtree (include this node).
  4806. * Usage:
  4807. * node.eachNode(function () { ... }); // preorder
  4808. * node.eachNode('preorder', function () { ... }); // preorder
  4809. * node.eachNode('postorder', function () { ... }); // postorder
  4810. * node.eachNode(
  4811. * {order: 'postorder', attr: 'viewChildren'},
  4812. * function () { ... }
  4813. * ); // postorder
  4814. *
  4815. * @param options If string, means order.
  4816. * @param options.order 'preorder' or 'postorder'
  4817. * @param options.attr 'children' or 'viewChildren'
  4818. * @param cb
  4819. * @param context
  4820. */
  4821. eachNode<Ctx>(options: TreeTraverseOrder, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4822. eachNode<Ctx>(options: TreeTraverseOption, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4823. eachNode<Ctx>(cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4824. getNodeByDataIndex(dataIndex: number): TreeNode;
  4825. getNodeById(name: string): TreeNode;
  4826. /**
  4827. * Update item available by list,
  4828. * when list has been performed options like 'filterSelf' or 'map'.
  4829. */
  4830. update(): void;
  4831. /**
  4832. * Clear all layouts
  4833. */
  4834. clearLayouts(): void;
  4835. /**
  4836. * data node format:
  4837. * {
  4838. * name: ...
  4839. * value: ...
  4840. * children: [
  4841. * {
  4842. * name: ...
  4843. * value: ...
  4844. * children: ...
  4845. * },
  4846. * ...
  4847. * ]
  4848. * }
  4849. */
  4850. static createTree<T extends TreeNodeOption, HostModel extends Model>(dataRoot: T, hostModel: HostModel, beforeLink?: (data: SeriesData) => void): Tree<HostModel, any>;
  4851. }
  4852. declare type VisualOptionBase = {
  4853. [key in BuiltinVisualProperty]?: any;
  4854. };
  4855. declare type LabelFormatter = (min: OptionDataValue, max?: OptionDataValue) => string;
  4856. interface VisualMapOption<T extends VisualOptionBase = VisualOptionBase> extends ComponentOption, BoxLayoutOptionMixin, BorderOptionMixin {
  4857. mainType?: 'visualMap';
  4858. show?: boolean;
  4859. align?: string;
  4860. realtime?: boolean;
  4861. /**
  4862. * 'all' or null/undefined: all series.
  4863. * A number or an array of number: the specified series.
  4864. * set min: 0, max: 200, only for campatible with ec2.
  4865. * In fact min max should not have default value.
  4866. */
  4867. seriesIndex?: 'all' | number[] | number;
  4868. /**
  4869. * min value, must specified if pieces is not specified.
  4870. */
  4871. min?: number;
  4872. /**
  4873. * max value, must specified if pieces is not specified.
  4874. */
  4875. max?: number;
  4876. /**
  4877. * Dimension to be encoded
  4878. */
  4879. dimension?: number;
  4880. /**
  4881. * Visual configuration for the data in selection
  4882. */
  4883. inRange?: T;
  4884. /**
  4885. * Visual configuration for the out of selection
  4886. */
  4887. outOfRange?: T;
  4888. controller?: {
  4889. inRange?: T;
  4890. outOfRange?: T;
  4891. };
  4892. target?: {
  4893. inRange?: T;
  4894. outOfRange?: T;
  4895. };
  4896. /**
  4897. * Width of the display item
  4898. */
  4899. itemWidth?: number;
  4900. /**
  4901. * Height of the display item
  4902. */
  4903. itemHeight?: number;
  4904. inverse?: boolean;
  4905. orient?: 'horizontal' | 'vertical';
  4906. backgroundColor?: ZRColor;
  4907. contentColor?: ZRColor;
  4908. inactiveColor?: ZRColor;
  4909. /**
  4910. * Padding of the component. Can be an array similar to CSS
  4911. */
  4912. padding?: number[] | number;
  4913. /**
  4914. * Gap between text and item
  4915. */
  4916. textGap?: number;
  4917. precision?: number;
  4918. /**
  4919. * @deprecated
  4920. * Option from version 2
  4921. */
  4922. color?: ColorString[];
  4923. formatter?: string | LabelFormatter;
  4924. /**
  4925. * Text on the both end. Such as ['High', 'Low']
  4926. */
  4927. text?: string[];
  4928. textStyle?: LabelOption;
  4929. categories?: unknown;
  4930. }
  4931. interface VisualMeta {
  4932. stops: {
  4933. value: number;
  4934. color: ColorString;
  4935. }[];
  4936. outerColors: ColorString[];
  4937. dimension?: DimensionIndex;
  4938. }
  4939. declare type ItrParamDims = DimensionLoose | Array<DimensionLoose>;
  4940. declare type CtxOrList<Ctx> = unknown extends Ctx ? SeriesData : Ctx;
  4941. declare type EachCb0<Ctx> = (this: CtxOrList<Ctx>, idx: number) => void;
  4942. declare type EachCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => void;
  4943. declare type EachCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => void;
  4944. declare type EachCb$1<Ctx> = (this: CtxOrList<Ctx>, ...args: any) => void;
  4945. declare type FilterCb0<Ctx> = (this: CtxOrList<Ctx>, idx: number) => boolean;
  4946. declare type FilterCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => boolean;
  4947. declare type FilterCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => boolean;
  4948. declare type FilterCb$1<Ctx> = (this: CtxOrList<Ctx>, ...args: any) => boolean;
  4949. declare type MapArrayCb0<Ctx> = (this: CtxOrList<Ctx>, idx: number) => any;
  4950. declare type MapArrayCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => any;
  4951. declare type MapArrayCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => any;
  4952. declare type MapArrayCb<Ctx> = (this: CtxOrList<Ctx>, ...args: any) => any;
  4953. declare type MapCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => ParsedValue | ParsedValue[];
  4954. declare type MapCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => ParsedValue | ParsedValue[];
  4955. declare type SeriesDimensionDefineLoose = string | object | SeriesDimensionDefine;
  4956. declare type SeriesDimensionLoose = DimensionLoose;
  4957. declare type SeriesDimensionName = DimensionName;
  4958. interface DefaultDataVisual {
  4959. style: PathStyleProps;
  4960. drawType: 'fill' | 'stroke';
  4961. symbol?: string;
  4962. symbolSize?: number | number[];
  4963. symbolRotate?: number;
  4964. symbolKeepAspect?: boolean;
  4965. symbolOffset?: string | number | (string | number)[];
  4966. liftZ?: number;
  4967. legendIcon?: string;
  4968. legendLineStyle?: LineStyleProps;
  4969. visualMeta?: VisualMeta[];
  4970. colorFromPalette?: boolean;
  4971. decal?: DecalObject;
  4972. }
  4973. interface DataCalculationInfo<SERIES_MODEL> {
  4974. stackedDimension: DimensionName;
  4975. stackedByDimension: DimensionName;
  4976. isStackedByIndex: boolean;
  4977. stackedOverDimension: DimensionName;
  4978. stackResultDimension: DimensionName;
  4979. stackedOnSeries?: SERIES_MODEL;
  4980. }
  4981. declare class SeriesData<HostModel extends Model = Model, Visual extends DefaultDataVisual = DefaultDataVisual> {
  4982. readonly type = "list";
  4983. /**
  4984. * Name of dimensions list of SeriesData.
  4985. *
  4986. * @caution Carefully use the index of this array.
  4987. * Becuase when DataStore is an extra high dimension(>30) dataset. We will only pick
  4988. * the used dimensions from DataStore to avoid performance issue.
  4989. */
  4990. readonly dimensions: SeriesDimensionName[];
  4991. private _dimInfos;
  4992. private _dimOmitted;
  4993. private _schema?;
  4994. /**
  4995. * @pending
  4996. * Actually we do not really need to convert dimensionIndex to dimensionName
  4997. * and do not need `_dimIdxToName` if we do everything internally based on dimension
  4998. * index rather than dimension name.
  4999. */
  5000. private _dimIdxToName?;
  5001. readonly hostModel: HostModel;
  5002. /**
  5003. * @readonly
  5004. */
  5005. dataType: SeriesDataType;
  5006. /**
  5007. * @readonly
  5008. * Host graph if List is used to store graph nodes / edges.
  5009. */
  5010. graph?: Graph;
  5011. /**
  5012. * @readonly
  5013. * Host tree if List is used to store tree ndoes.
  5014. */
  5015. tree?: Tree;
  5016. private _store;
  5017. private _nameList;
  5018. private _idList;
  5019. private _visual;
  5020. private _layout;
  5021. private _itemVisuals;
  5022. private _itemLayouts;
  5023. private _graphicEls;
  5024. private _approximateExtent;
  5025. private _dimSummary;
  5026. private _invertedIndicesMap;
  5027. private _calculationInfo;
  5028. userOutput: DimensionSummary['userOutput'];
  5029. hasItemOption: boolean;
  5030. private _nameRepeatCount;
  5031. private _nameDimIdx;
  5032. private _idDimIdx;
  5033. private __wrappedMethods;
  5034. TRANSFERABLE_METHODS: readonly ["cloneShallow", "downSample", "lttbDownSample", "map"];
  5035. CHANGABLE_METHODS: readonly ["filterSelf", "selectRange"];
  5036. DOWNSAMPLE_METHODS: readonly ["downSample", "lttbDownSample"];
  5037. /**
  5038. * @param dimensionsInput.dimensions
  5039. * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].
  5040. * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius
  5041. */
  5042. constructor(dimensionsInput: SeriesDataSchema | SeriesDimensionDefineLoose[], hostModel: HostModel);
  5043. /**
  5044. *
  5045. * Get concrete dimension name by dimension name or dimension index.
  5046. * If input a dimension name, do not validate whether the dimension name exits.
  5047. *
  5048. * @caution
  5049. * @param dim Must make sure the dimension is `SeriesDimensionLoose`.
  5050. * Because only those dimensions will have auto-generated dimension names if not
  5051. * have a user-specified name, and other dimensions will get a return of null/undefined.
  5052. *
  5053. * @notice Becuause of this reason, should better use `getDimensionIndex` instead, for examples:
  5054. * ```js
  5055. * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx);
  5056. * ```
  5057. *
  5058. * @return Concrete dim name.
  5059. */
  5060. getDimension(dim: SeriesDimensionLoose): DimensionName;
  5061. /**
  5062. * Get dimension index in data store. Return -1 if not found.
  5063. * Can be used to index value from getRawValue.
  5064. */
  5065. getDimensionIndex(dim: DimensionLoose): DimensionIndex;
  5066. /**
  5067. * The meanings of the input parameter `dim`:
  5068. *
  5069. * + If dim is a number (e.g., `1`), it means the index of the dimension.
  5070. * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.
  5071. * + If dim is a number-like string (e.g., `"1"`):
  5072. * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`,
  5073. * it means that concrete name.
  5074. * + If not, it will be converted to a number, which means the index of the dimension.
  5075. * (why? because of the backward compatbility. We have been tolerating number-like string in
  5076. * dimension setting, although now it seems that it is not a good idea.)
  5077. * For example, `visualMap[i].dimension: "1"` is the same meaning as `visualMap[i].dimension: 1`,
  5078. * if no dimension name is defined as `"1"`.
  5079. * + If dim is a not-number-like string, it means the concrete dim name.
  5080. * For example, it can be be default name `"x"`, `"y"`, `"z"`, `"lng"`, `"lat"`, `"angle"`, `"radius"`,
  5081. * or customized in `dimensions` property of option like `"age"`.
  5082. *
  5083. * @return recogonized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`).
  5084. */
  5085. private _recognizeDimIndex;
  5086. private _getStoreDimIndex;
  5087. /**
  5088. * Get type and calculation info of particular dimension
  5089. * @param dim
  5090. * Dimension can be concrete names like x, y, z, lng, lat, angle, radius
  5091. * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'
  5092. */
  5093. getDimensionInfo(dim: SeriesDimensionLoose): SeriesDimensionDefine;
  5094. /**
  5095. * If `dimName` if from outside of `SeriesData`,
  5096. * use this method other than visit `this._dimInfos` directly.
  5097. */
  5098. private _getDimInfo;
  5099. private _initGetDimensionInfo;
  5100. /**
  5101. * concrete dimension name list on coord.
  5102. */
  5103. getDimensionsOnCoord(): SeriesDimensionName[];
  5104. /**
  5105. * @param coordDim
  5106. * @param idx A coordDim may map to more than one data dim.
  5107. * If not specified, return the first dim not extra.
  5108. * @return concrete data dim. If not found, return null/undefined
  5109. */
  5110. mapDimension(coordDim: SeriesDimensionName): SeriesDimensionName;
  5111. mapDimension(coordDim: SeriesDimensionName, idx: number): SeriesDimensionName;
  5112. mapDimensionsAll(coordDim: SeriesDimensionName): SeriesDimensionName[];
  5113. getStore(): DataStore;
  5114. /**
  5115. * Initialize from data
  5116. * @param data source or data or data store.
  5117. * @param nameList The name of a datum is used on data diff and
  5118. * default label/tooltip.
  5119. * A name can be specified in encode.itemName,
  5120. * or dataItem.name (only for series option data),
  5121. * or provided in nameList from outside.
  5122. */
  5123. initData(data: Source | OptionSourceData | DataStore | DataProvider, nameList?: string[], dimValueGetter?: DimValueGetter): void;
  5124. /**
  5125. * Caution: Can be only called on raw data (before `this._indices` created).
  5126. */
  5127. appendData(data: ArrayLike$1<any>): void;
  5128. /**
  5129. * Caution: Can be only called on raw data (before `this._indices` created).
  5130. * This method does not modify `rawData` (`dataProvider`), but only
  5131. * add values to store.
  5132. *
  5133. * The final count will be increased by `Math.max(values.length, names.length)`.
  5134. *
  5135. * @param values That is the SourceType: 'arrayRows', like
  5136. * [
  5137. * [12, 33, 44],
  5138. * [NaN, 43, 1],
  5139. * ['-', 'asdf', 0]
  5140. * ]
  5141. * Each item is exaclty cooresponding to a dimension.
  5142. */
  5143. appendValues(values: any[][], names?: string[]): void;
  5144. private _updateOrdinalMeta;
  5145. private _shouldMakeIdFromName;
  5146. private _doInit;
  5147. /**
  5148. * PENDING: In fact currently this function is only used to short-circuit
  5149. * the calling of `scale.unionExtentFromData` when data have been filtered by modules
  5150. * like "dataZoom". `scale.unionExtentFromData` is used to calculate data extent for series on
  5151. * an axis, but if a "axis related data filter module" is used, the extent of the axis have
  5152. * been fixed and no need to calling `scale.unionExtentFromData` actually.
  5153. * But if we add "custom data filter" in future, which is not "axis related", this method may
  5154. * be still needed.
  5155. *
  5156. * Optimize for the scenario that data is filtered by a given extent.
  5157. * Consider that if data amount is more than hundreds of thousand,
  5158. * extent calculation will cost more than 10ms and the cache will
  5159. * be erased because of the filtering.
  5160. */
  5161. getApproximateExtent(dim: SeriesDimensionLoose): [number, number];
  5162. /**
  5163. * Calculate extent on a filtered data might be time consuming.
  5164. * Approximate extent is only used for: calculte extent of filtered data outside.
  5165. */
  5166. setApproximateExtent(extent: [number, number], dim: SeriesDimensionLoose): void;
  5167. getCalculationInfo<CALC_INFO_KEY extends keyof DataCalculationInfo<HostModel>>(key: CALC_INFO_KEY): DataCalculationInfo<HostModel>[CALC_INFO_KEY];
  5168. /**
  5169. * @param key or k-v object
  5170. */
  5171. setCalculationInfo(key: DataCalculationInfo<HostModel>): void;
  5172. setCalculationInfo<CALC_INFO_KEY extends keyof DataCalculationInfo<HostModel>>(key: CALC_INFO_KEY, value: DataCalculationInfo<HostModel>[CALC_INFO_KEY]): void;
  5173. /**
  5174. * @return Never be null/undefined. `number` will be converted to string. Becuase:
  5175. * In most cases, name is used in display, where returning a string is more convenient.
  5176. * In other cases, name is used in query (see `indexOfName`), where we can keep the
  5177. * rule that name `2` equals to name `'2'`.
  5178. */
  5179. getName(idx: number): string;
  5180. private _getCategory;
  5181. /**
  5182. * @return Never null/undefined. `number` will be converted to string. Becuase:
  5183. * In all cases having encountered at present, id is used in making diff comparison, which
  5184. * are usually based on hash map. We can keep the rule that the internal id are always string
  5185. * (treat `2` is the same as `'2'`) to make the related logic simple.
  5186. */
  5187. getId(idx: number): string;
  5188. count(): number;
  5189. /**
  5190. * Get value. Return NaN if idx is out of range.
  5191. *
  5192. * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead.
  5193. */
  5194. get(dim: SeriesDimensionName, idx: number): ParsedValue;
  5195. /**
  5196. * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead.
  5197. */
  5198. getByRawIndex(dim: SeriesDimensionName, rawIdx: number): ParsedValue;
  5199. getIndices(): globalThis.ArrayLike<number>;
  5200. getDataExtent(dim: DimensionLoose): [number, number];
  5201. getSum(dim: DimensionLoose): number;
  5202. getMedian(dim: DimensionLoose): number;
  5203. /**
  5204. * Get value for multi dimensions.
  5205. * @param dimensions If ignored, using all dimensions.
  5206. */
  5207. getValues(idx: number): ParsedValue[];
  5208. getValues(dimensions: readonly DimensionName[], idx: number): ParsedValue[];
  5209. /**
  5210. * If value is NaN. Inlcuding '-'
  5211. * Only check the coord dimensions.
  5212. */
  5213. hasValue(idx: number): boolean;
  5214. /**
  5215. * Retreive the index with given name
  5216. */
  5217. indexOfName(name: string): number;
  5218. getRawIndex(idx: number): number;
  5219. indexOfRawIndex(rawIndex: number): number;
  5220. /**
  5221. * Only support the dimension which inverted index created.
  5222. * Do not support other cases until required.
  5223. * @param dim concrete dim
  5224. * @param value ordinal index
  5225. * @return rawIndex
  5226. */
  5227. rawIndexOf(dim: SeriesDimensionName, value: OrdinalNumber): number;
  5228. /**
  5229. * Retreive the index of nearest value
  5230. * @param dim
  5231. * @param value
  5232. * @param [maxDistance=Infinity]
  5233. * @return If and only if multiple indices has
  5234. * the same value, they are put to the result.
  5235. */
  5236. indicesOfNearest(dim: DimensionLoose, value: number, maxDistance?: number): number[];
  5237. /**
  5238. * Data iteration
  5239. * @param ctx default this
  5240. * @example
  5241. * list.each('x', function (x, idx) {});
  5242. * list.each(['x', 'y'], function (x, y, idx) {});
  5243. * list.each(function (idx) {})
  5244. */
  5245. each<Ctx>(cb: EachCb0<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
  5246. each<Ctx>(dims: DimensionLoose, cb: EachCb1<Ctx>, ctx?: Ctx): void;
  5247. each<Ctx>(dims: [DimensionLoose], cb: EachCb1<Ctx>, ctx?: Ctx): void;
  5248. each<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: EachCb2<Ctx>, ctx?: Ctx): void;
  5249. each<Ctx>(dims: ItrParamDims, cb: EachCb$1<Ctx>, ctx?: Ctx): void;
  5250. /**
  5251. * Data filter
  5252. */
  5253. filterSelf<Ctx>(cb: FilterCb0<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): this;
  5254. filterSelf<Ctx>(dims: DimensionLoose, cb: FilterCb1<Ctx>, ctx?: Ctx): this;
  5255. filterSelf<Ctx>(dims: [DimensionLoose], cb: FilterCb1<Ctx>, ctx?: Ctx): this;
  5256. filterSelf<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: FilterCb2<Ctx>, ctx?: Ctx): this;
  5257. filterSelf<Ctx>(dims: ItrParamDims, cb: FilterCb$1<Ctx>, ctx?: Ctx): this;
  5258. /**
  5259. * Select data in range. (For optimization of filter)
  5260. * (Manually inline code, support 5 million data filtering in data zoom.)
  5261. */
  5262. selectRange(range: Record<string, [number, number]>): SeriesData;
  5263. /**
  5264. * Data mapping to a plain array
  5265. */
  5266. mapArray<Ctx, Cb extends MapArrayCb0<Ctx>>(cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
  5267. mapArray<Ctx, Cb extends MapArrayCb1<Ctx>>(dims: DimensionLoose, cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
  5268. mapArray<Ctx, Cb extends MapArrayCb1<Ctx>>(dims: [DimensionLoose], cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
  5269. mapArray<Ctx, Cb extends MapArrayCb2<Ctx>>(dims: [DimensionLoose, DimensionLoose], cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
  5270. mapArray<Ctx, Cb extends MapArrayCb<Ctx>>(dims: ItrParamDims, cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
  5271. /**
  5272. * Data mapping to a new List with given dimensions
  5273. */
  5274. map<Ctx>(dims: DimensionLoose, cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): SeriesData<HostModel>;
  5275. map<Ctx>(dims: [DimensionLoose], cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): SeriesData<HostModel>;
  5276. map<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: MapCb2<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): SeriesData<HostModel>;
  5277. /**
  5278. * !!Danger: used on stack dimension only.
  5279. */
  5280. modify<Ctx>(dims: DimensionLoose, cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
  5281. modify<Ctx>(dims: [DimensionLoose], cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
  5282. modify<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: MapCb2<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
  5283. /**
  5284. * Large data down sampling on given dimension
  5285. * @param sampleIndex Sample index for name and id
  5286. */
  5287. downSample(dimension: DimensionLoose, rate: number, sampleValue: (frameValues: ArrayLike$1<ParsedValue>) => ParsedValueNumeric, sampleIndex: (frameValues: ArrayLike$1<ParsedValue>, value: ParsedValueNumeric) => number): SeriesData<HostModel>;
  5288. /**
  5289. * Large data down sampling using largest-triangle-three-buckets
  5290. * @param {string} valueDimension
  5291. * @param {number} targetCount
  5292. */
  5293. lttbDownSample(valueDimension: DimensionLoose, rate: number): SeriesData<HostModel>;
  5294. getRawDataItem(idx: number): OptionDataItem;
  5295. /**
  5296. * Get model of one data item.
  5297. */
  5298. getItemModel<ItemOpts extends unknown = unknown>(idx: number): Model<ItemOpts>;
  5299. /**
  5300. * Create a data differ
  5301. */
  5302. diff(otherList: SeriesData): DataDiffer;
  5303. /**
  5304. * Get visual property.
  5305. */
  5306. getVisual<K extends keyof Visual>(key: K): Visual[K];
  5307. /**
  5308. * Set visual property
  5309. *
  5310. * @example
  5311. * setVisual('color', color);
  5312. * setVisual({
  5313. * 'color': color
  5314. * });
  5315. */
  5316. setVisual<K extends keyof Visual>(key: K, val: Visual[K]): void;
  5317. setVisual(kvObj: Partial<Visual>): void;
  5318. /**
  5319. * Get visual property of single data item
  5320. */
  5321. getItemVisual<K extends keyof Visual>(idx: number, key: K): Visual[K];
  5322. /**
  5323. * If exists visual property of single data item
  5324. */
  5325. hasItemVisual(): boolean;
  5326. /**
  5327. * Make sure itemVisual property is unique
  5328. */
  5329. ensureUniqueItemVisual<K extends keyof Visual>(idx: number, key: K): Visual[K];
  5330. /**
  5331. * Set visual property of single data item
  5332. *
  5333. * @param {number} idx
  5334. * @param {string|Object} key
  5335. * @param {*} [value]
  5336. *
  5337. * @example
  5338. * setItemVisual(0, 'color', color);
  5339. * setItemVisual(0, {
  5340. * 'color': color
  5341. * });
  5342. */
  5343. setItemVisual<K extends keyof Visual>(idx: number, key: K, value: Visual[K]): void;
  5344. setItemVisual(idx: number, kvObject: Partial<Visual>): void;
  5345. /**
  5346. * Clear itemVisuals and list visual.
  5347. */
  5348. clearAllVisual(): void;
  5349. /**
  5350. * Set layout property.
  5351. */
  5352. setLayout(key: string, val: any): void;
  5353. setLayout(kvObj: Dictionary<any>): void;
  5354. /**
  5355. * Get layout property.
  5356. */
  5357. getLayout(key: string): any;
  5358. /**
  5359. * Get layout of single data item
  5360. */
  5361. getItemLayout(idx: number): any;
  5362. /**
  5363. * Set layout of single data item
  5364. */
  5365. setItemLayout<M = false>(idx: number, layout: (M extends true ? Dictionary<any> : any), merge?: M): void;
  5366. /**
  5367. * Clear all layout of single data item
  5368. */
  5369. clearItemLayouts(): void;
  5370. /**
  5371. * Set graphic element relative to data. It can be set as null
  5372. */
  5373. setItemGraphicEl(idx: number, el: Element): void;
  5374. getItemGraphicEl(idx: number): Element;
  5375. eachItemGraphicEl<Ctx = unknown>(cb: (this: Ctx, el: Element, idx: number) => void, context?: Ctx): void;
  5376. /**
  5377. * Shallow clone a new list except visual and layout properties, and graph elements.
  5378. * New list only change the indices.
  5379. */
  5380. cloneShallow(list?: SeriesData<HostModel>): SeriesData<HostModel>;
  5381. /**
  5382. * Wrap some method to add more feature
  5383. */
  5384. wrapMethod(methodName: FunctionPropertyNames<SeriesData>, injectFunction: (...args: any) => any): void;
  5385. private static internalField;
  5386. }
  5387. interface SeriesData {
  5388. getLinkedData(dataType?: SeriesDataType): SeriesData;
  5389. getLinkedDataAll(): {
  5390. data: SeriesData;
  5391. type?: SeriesDataType;
  5392. }[];
  5393. }
  5394. /**
  5395. * If string, e.g., 'geo', means {geoIndex: 0}.
  5396. * If Object, could contain some of these properties below:
  5397. * {
  5398. * seriesIndex, seriesId, seriesName,
  5399. * geoIndex, geoId, geoName,
  5400. * bmapIndex, bmapId, bmapName,
  5401. * xAxisIndex, xAxisId, xAxisName,
  5402. * yAxisIndex, yAxisId, yAxisName,
  5403. * gridIndex, gridId, gridName,
  5404. * ... (can be extended)
  5405. * }
  5406. * Each properties can be number|string|Array.<number>|Array.<string>
  5407. * For example, a finder could be
  5408. * {
  5409. * seriesIndex: 3,
  5410. * geoId: ['aa', 'cc'],
  5411. * gridName: ['xx', 'rr']
  5412. * }
  5413. * xxxIndex can be set as 'all' (means all xxx) or 'none' (means not specify)
  5414. * If nothing or null/undefined specified, return nothing.
  5415. * If both `abcIndex`, `abcId`, `abcName` specified, only one work.
  5416. * The priority is: index > id > name, the same with `ecModel.queryComponents`.
  5417. */
  5418. declare type ModelFinderIndexQuery = number | number[] | 'all' | 'none' | false;
  5419. declare type ModelFinderIdQuery = OptionId | OptionId[];
  5420. declare type ModelFinderNameQuery = OptionId | OptionId[];
  5421. declare type ModelFinder = string | ModelFinderObject;
  5422. declare type ModelFinderObject = {
  5423. seriesIndex?: ModelFinderIndexQuery;
  5424. seriesId?: ModelFinderIdQuery;
  5425. seriesName?: ModelFinderNameQuery;
  5426. geoIndex?: ModelFinderIndexQuery;
  5427. geoId?: ModelFinderIdQuery;
  5428. geoName?: ModelFinderNameQuery;
  5429. bmapIndex?: ModelFinderIndexQuery;
  5430. bmapId?: ModelFinderIdQuery;
  5431. bmapName?: ModelFinderNameQuery;
  5432. xAxisIndex?: ModelFinderIndexQuery;
  5433. xAxisId?: ModelFinderIdQuery;
  5434. xAxisName?: ModelFinderNameQuery;
  5435. yAxisIndex?: ModelFinderIndexQuery;
  5436. yAxisId?: ModelFinderIdQuery;
  5437. yAxisName?: ModelFinderNameQuery;
  5438. gridIndex?: ModelFinderIndexQuery;
  5439. gridId?: ModelFinderIdQuery;
  5440. gridName?: ModelFinderNameQuery;
  5441. dataIndex?: number;
  5442. dataIndexInside?: number;
  5443. };
  5444. /**
  5445. * {
  5446. * seriesModels: [seriesModel1, seriesModel2],
  5447. * seriesModel: seriesModel1, // The first model
  5448. * geoModels: [geoModel1, geoModel2],
  5449. * geoModel: geoModel1, // The first model
  5450. * ...
  5451. * }
  5452. */
  5453. declare type ParsedModelFinder = {
  5454. [key: string]: ComponentModel | ComponentModel[] | undefined;
  5455. };
  5456. declare type QueryReferringOpt = {
  5457. useDefault?: boolean;
  5458. enableAll?: boolean;
  5459. enableNone?: boolean;
  5460. };
  5461. declare class ComponentModel<Opt extends ComponentOption = ComponentOption> extends Model<Opt> {
  5462. /**
  5463. * @readonly
  5464. */
  5465. type: ComponentFullType;
  5466. /**
  5467. * @readonly
  5468. */
  5469. id: string;
  5470. /**
  5471. * Because simplified concept is probably better, series.name (or component.name)
  5472. * has been having too many resposibilities:
  5473. * (1) Generating id (which requires name in option should not be modified).
  5474. * (2) As an index to mapping series when merging option or calling API (a name
  5475. * can refer to more then one components, which is convinient is some case).
  5476. * (3) Display.
  5477. * @readOnly But injected
  5478. */
  5479. name: string;
  5480. /**
  5481. * @readOnly
  5482. */
  5483. mainType: ComponentMainType;
  5484. /**
  5485. * @readOnly
  5486. */
  5487. subType: ComponentSubType;
  5488. /**
  5489. * @readOnly
  5490. */
  5491. componentIndex: number;
  5492. /**
  5493. * @readOnly
  5494. */
  5495. protected defaultOption: ComponentOption;
  5496. /**
  5497. * @readOnly
  5498. */
  5499. ecModel: GlobalModel;
  5500. /**
  5501. * @readOnly
  5502. */
  5503. static dependencies: string[];
  5504. readonly uid: string;
  5505. /**
  5506. * Support merge layout params.
  5507. * Only support 'box' now (left/right/top/bottom/width/height).
  5508. */
  5509. static layoutMode: ComponentLayoutMode | ComponentLayoutMode['type'];
  5510. /**
  5511. * Prevent from auto set z, zlevel, z2 by the framework.
  5512. */
  5513. preventAutoZ: boolean;
  5514. __viewId: string;
  5515. __requireNewView: boolean;
  5516. static protoInitialize: void;
  5517. constructor(option: Opt, parentModel: Model, ecModel: GlobalModel);
  5518. init(option: Opt, parentModel: Model, ecModel: GlobalModel): void;
  5519. mergeDefaultAndTheme(option: Opt, ecModel: GlobalModel): void;
  5520. mergeOption(option: Opt, ecModel: GlobalModel): void;
  5521. /**
  5522. * Called immediately after `init` or `mergeOption` of this instance called.
  5523. */
  5524. optionUpdated(newCptOption: Opt, isInit: boolean): void;
  5525. /**
  5526. * [How to declare defaultOption]:
  5527. *
  5528. * (A) If using class declaration in typescript (since echarts 5):
  5529. * ```ts
  5530. * import {ComponentOption} from '../model/option.js';
  5531. * export interface XxxOption extends ComponentOption {
  5532. * aaa: number
  5533. * }
  5534. * export class XxxModel extends Component {
  5535. * static type = 'xxx';
  5536. * static defaultOption: XxxOption = {
  5537. * aaa: 123
  5538. * }
  5539. * }
  5540. * Component.registerClass(XxxModel);
  5541. * ```
  5542. * ```ts
  5543. * import {inheritDefaultOption} from '../util/component.js';
  5544. * import {XxxModel, XxxOption} from './XxxModel.js';
  5545. * export interface XxxSubOption extends XxxOption {
  5546. * bbb: number
  5547. * }
  5548. * class XxxSubModel extends XxxModel {
  5549. * static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, {
  5550. * bbb: 456
  5551. * })
  5552. * fn() {
  5553. * let opt = this.getDefaultOption();
  5554. * // opt is {aaa: 123, bbb: 456}
  5555. * }
  5556. * }
  5557. * ```
  5558. *
  5559. * (B) If using class extend (previous approach in echarts 3 & 4):
  5560. * ```js
  5561. * let XxxComponent = Component.extend({
  5562. * defaultOption: {
  5563. * xx: 123
  5564. * }
  5565. * })
  5566. * ```
  5567. * ```js
  5568. * let XxxSubComponent = XxxComponent.extend({
  5569. * defaultOption: {
  5570. * yy: 456
  5571. * },
  5572. * fn: function () {
  5573. * let opt = this.getDefaultOption();
  5574. * // opt is {xx: 123, yy: 456}
  5575. * }
  5576. * })
  5577. * ```
  5578. */
  5579. getDefaultOption(): Opt;
  5580. /**
  5581. * Notice: always force to input param `useDefault` in case that forget to consider it.
  5582. * The same behavior as `modelUtil.parseFinder`.
  5583. *
  5584. * @param useDefault In many cases like series refer axis and axis refer grid,
  5585. * If axis index / axis id not specified, use the first target as default.
  5586. * In other cases like dataZoom refer axis, if not specified, measn no refer.
  5587. */
  5588. getReferringComponents(mainType: ComponentMainType, opt: QueryReferringOpt): {
  5589. models: ComponentModel[];
  5590. specified: boolean;
  5591. };
  5592. getBoxLayoutParams(): {
  5593. left: string | number;
  5594. top: string | number;
  5595. right: string | number;
  5596. bottom: string | number;
  5597. width: string | number;
  5598. height: string | number;
  5599. };
  5600. /**
  5601. * Get key for zlevel.
  5602. * If developers don't configure zlevel. We will assign zlevel to series based on the key.
  5603. * For example, lines with trail effect and progressive series will in an individual zlevel.
  5604. */
  5605. getZLevelKey(): string;
  5606. setZLevel(zlevel: number): void;
  5607. static registerClass: ClassManager['registerClass'];
  5608. static hasClass: ClassManager['hasClass'];
  5609. static registerSubTypeDefaulter: SubTypeDefaulterManager['registerSubTypeDefaulter'];
  5610. }
  5611. declare type AnimateOrSetPropsOption = {
  5612. dataIndex?: number;
  5613. cb?: () => void;
  5614. during?: (percent: number) => void;
  5615. removeOpt?: AnimationOption$1;
  5616. isFrom?: boolean;
  5617. };
  5618. /**
  5619. * Update graphic element properties with or without animation according to the
  5620. * configuration in series.
  5621. *
  5622. * Caution: this method will stop previous animation.
  5623. * So do not use this method to one element twice before
  5624. * animation starts, unless you know what you are doing.
  5625. * @example
  5626. * graphic.updateProps(el, {
  5627. * position: [100, 100]
  5628. * }, seriesModel, dataIndex, function () { console.log('Animation done!'); });
  5629. * // Or
  5630. * graphic.updateProps(el, {
  5631. * position: [100, 100]
  5632. * }, seriesModel, function () { console.log('Animation done!'); });
  5633. */
  5634. declare function updateProps<Props extends ElementProps>(el: Element<Props>, props: Props, animatableModel?: Model<AnimationOptionMixin>, dataIndex?: AnimateOrSetPropsOption['dataIndex'] | AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption, cb?: AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption['during'], during?: AnimateOrSetPropsOption['during']): void;
  5635. /**
  5636. * Init graphic element properties with or without animation according to the
  5637. * configuration in series.
  5638. *
  5639. * Caution: this method will stop previous animation.
  5640. * So do not use this method to one element twice before
  5641. * animation starts, unless you know what you are doing.
  5642. */
  5643. declare function initProps<Props extends ElementProps>(el: Element<Props>, props: Props, animatableModel?: Model<AnimationOptionMixin>, dataIndex?: AnimateOrSetPropsOption['dataIndex'] | AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption, cb?: AnimateOrSetPropsOption['cb'] | AnimateOrSetPropsOption['during'], during?: AnimateOrSetPropsOption['during']): void;
  5644. declare type ExtendShapeOpt = Parameters<typeof Path.extend>[0];
  5645. declare type ExtendShapeReturn = ReturnType<typeof Path.extend>;
  5646. /**
  5647. * Extend shape with parameters
  5648. */
  5649. declare function extendShape(opts: ExtendShapeOpt): ExtendShapeReturn;
  5650. declare const extendPathFromString: typeof extendFromString;
  5651. declare type SVGPathOption$1 = Parameters<typeof extendPathFromString>[1];
  5652. declare type SVGPathCtor = ReturnType<typeof extendPathFromString>;
  5653. declare type SVGPath$1 = InstanceType<SVGPathCtor>;
  5654. /**
  5655. * Extend path
  5656. */
  5657. declare function extendPath(pathData: string, opts: SVGPathOption$1): SVGPathCtor;
  5658. /**
  5659. * Register a user defined shape.
  5660. * The shape class can be fetched by `getShapeClass`
  5661. * This method will overwrite the registered shapes, including
  5662. * the registered built-in shapes, if using the same `name`.
  5663. * The shape can be used in `custom series` and
  5664. * `graphic component` by declaring `{type: name}`.
  5665. *
  5666. * @param name
  5667. * @param ShapeClass Can be generated by `extendShape`.
  5668. */
  5669. declare function registerShape(name: string, ShapeClass: {
  5670. new (): Path;
  5671. }): void;
  5672. /**
  5673. * Find shape class registered by `registerShape`. Usually used in
  5674. * fetching user defined shape.
  5675. *
  5676. * [Caution]:
  5677. * (1) This method **MUST NOT be used inside echarts !!!**, unless it is prepared
  5678. * to use user registered shapes.
  5679. * Because the built-in shape (see `getBuiltInShape`) will be registered by
  5680. * `registerShape` by default. That enables users to get both built-in
  5681. * shapes as well as the shapes belonging to themsleves. But users can overwrite
  5682. * the built-in shapes by using names like 'circle', 'rect' via calling
  5683. * `registerShape`. So the echarts inner featrues should not fetch shapes from here
  5684. * in case that it is overwritten by users, except that some features, like
  5685. * `custom series`, `graphic component`, do it deliberately.
  5686. *
  5687. * (2) In the features like `custom series`, `graphic component`, the user input
  5688. * `{tpye: 'xxx'}` does not only specify shapes but also specify other graphic
  5689. * elements like `'group'`, `'text'`, `'image'` or event `'path'`. Those names
  5690. * are reserved names, that is, if some user register a shape named `'image'`,
  5691. * the shape will not be used. If we intending to add some more reserved names
  5692. * in feature, that might bring break changes (disable some existing user shape
  5693. * names). But that case probably rearly happen. So we dont make more mechanism
  5694. * to resolve this issue here.
  5695. *
  5696. * @param name
  5697. * @return The shape class. If not found, return nothing.
  5698. */
  5699. declare function getShapeClass(name: string): {
  5700. new (): Path;
  5701. };
  5702. /**
  5703. * Create a path element from path data string
  5704. * @param pathData
  5705. * @param opts
  5706. * @param rect
  5707. * @param layout 'center' or 'cover' default to be cover
  5708. */
  5709. declare function makePath(pathData: string, opts: SVGPathOption$1, rect: ZRRectLike, layout?: 'center' | 'cover'): SVGPath$1;
  5710. /**
  5711. * Create a image element from image url
  5712. * @param imageUrl image url
  5713. * @param opts options
  5714. * @param rect constrain rect
  5715. * @param layout 'center' or 'cover'. Default to be 'cover'
  5716. */
  5717. declare function makeImage(imageUrl: string, rect: ZRRectLike, layout?: 'center' | 'cover'): ZRImage;
  5718. declare const mergePath$1: typeof mergePath;
  5719. /**
  5720. * Resize a path to fit the rect
  5721. * @param path
  5722. * @param rect
  5723. */
  5724. declare function resizePath(path: SVGPath$1, rect: ZRRectLike): void;
  5725. /**
  5726. * Get transform matrix of target (param target),
  5727. * in coordinate of its ancestor (param ancestor)
  5728. *
  5729. * @param target
  5730. * @param [ancestor]
  5731. */
  5732. declare function getTransform(target: Transformable, ancestor?: Transformable): MatrixArray;
  5733. declare function clipPointsByRect(points: VectorArray[], rect: ZRRectLike): number[][];
  5734. /**
  5735. * Return a new clipped rect. If rect size are negative, return undefined.
  5736. */
  5737. declare function clipRectByRect(targetRect: ZRRectLike, rect: ZRRectLike): ZRRectLike;
  5738. declare function createIcon(iconStr: string, // Support 'image://' or 'path://' or direct svg path.
  5739. opt?: Omit<DisplayableProps, 'style'>, rect?: ZRRectLike): SVGPath$1 | ZRImage;
  5740. declare type TextStyleProps$1 = ZRText['style'];
  5741. declare function getTextRect(text: TextStyleProps$1['text'], font?: TextStyleProps$1['font'], align?: TextStyleProps$1['align'], verticalAlign?: TextStyleProps$1['verticalAlign'], padding?: TextStyleProps$1['padding'], rich?: TextStyleProps$1['rich'], truncate?: boolean, lineHeight?: number): BoundingRect;
  5742. /**
  5743. * Add a comma each three digit.
  5744. */
  5745. declare function addCommas(x: string | number): string;
  5746. declare function toCamelCase(str: string, upperCaseFirst?: boolean): string;
  5747. declare const normalizeCssArray$1: typeof normalizeCssArray;
  5748. interface TplFormatterParam extends Dictionary<any> {
  5749. $vars: string[];
  5750. }
  5751. /**
  5752. * Template formatter
  5753. * @param {Array.<Object>|Object} paramsList
  5754. */
  5755. declare function formatTpl(tpl: string, paramsList: TplFormatterParam | TplFormatterParam[], encode?: boolean): string;
  5756. interface RichTextTooltipMarker {
  5757. renderMode: TooltipRenderMode;
  5758. content: string;
  5759. style: Dictionary<unknown>;
  5760. }
  5761. declare type TooltipMarker = string | RichTextTooltipMarker;
  5762. declare type TooltipMarkerType = 'item' | 'subItem';
  5763. interface GetTooltipMarkerOpt {
  5764. color?: ColorString;
  5765. extraCssText?: string;
  5766. type?: TooltipMarkerType;
  5767. renderMode?: TooltipRenderMode;
  5768. markerId?: string;
  5769. }
  5770. declare function getTooltipMarker(color: ColorString, extraCssText?: string): TooltipMarker;
  5771. declare function getTooltipMarker(opt: GetTooltipMarkerOpt): TooltipMarker;
  5772. /**
  5773. * @deprecated Use `time/format` instead.
  5774. * ISO Date format
  5775. * @param {string} tpl
  5776. * @param {number} value
  5777. * @param {boolean} [isUTC=false] Default in local time.
  5778. * see `module:echarts/scale/Time`
  5779. * and `module:echarts/util/number#parseDate`.
  5780. * @inner
  5781. */
  5782. declare function formatTime(tpl: string, value: unknown, isUTC?: boolean): string;
  5783. /**
  5784. * Capital first
  5785. * @param {string} str
  5786. * @return {string}
  5787. */
  5788. declare function capitalFirst(str: string): string;
  5789. interface MapperParamAxisInfo {
  5790. axisIndex: number;
  5791. axisName: string;
  5792. axisId: string;
  5793. axisDim: string;
  5794. }
  5795. interface AxisPointerLink {
  5796. xAxisIndex?: number[] | 'all';
  5797. yAxisIndex?: number[] | 'all';
  5798. xAxisId?: string[];
  5799. yAxisId?: string[];
  5800. xAxisName?: string[] | string;
  5801. yAxisName?: string[] | string;
  5802. radiusAxisIndex?: number[] | 'all';
  5803. angleAxisIndex?: number[] | 'all';
  5804. radiusAxisId?: string[];
  5805. angleAxisId?: string[];
  5806. radiusAxisName?: string[] | string;
  5807. angleAxisName?: string[] | string;
  5808. singleAxisIndex?: number[] | 'all';
  5809. singleAxisId?: string[];
  5810. singleAxisName?: string[] | string;
  5811. mapper?(sourceVal: ScaleDataValue, sourceAxisInfo: MapperParamAxisInfo, targetAxisInfo: MapperParamAxisInfo): CommonAxisPointerOption['value'];
  5812. }
  5813. interface AxisPointerOption extends ComponentOption, Omit<CommonAxisPointerOption, 'type'> {
  5814. mainType?: 'axisPointer';
  5815. type?: 'line' | 'shadow' | 'cross' | 'none';
  5816. link?: AxisPointerLink[];
  5817. }
  5818. declare type TopLevelFormatterParams = CallbackDataParams | CallbackDataParams[];
  5819. interface TooltipOption extends CommonTooltipOption<TopLevelFormatterParams>, ComponentOption {
  5820. mainType?: 'tooltip';
  5821. axisPointer?: AxisPointerOption & {
  5822. axis?: 'auto' | 'x' | 'y' | 'angle' | 'radius';
  5823. crossStyle?: LineStyleOption & {
  5824. textStyle?: LabelOption;
  5825. };
  5826. };
  5827. /**
  5828. * If show popup content
  5829. */
  5830. showContent?: boolean;
  5831. /**
  5832. * Trigger only works on coordinate system.
  5833. */
  5834. trigger?: 'item' | 'axis' | 'none';
  5835. displayMode?: 'single' | 'multipleByCoordSys';
  5836. /**
  5837. * 'auto': use html by default, and use non-html if `document` is not defined
  5838. * 'html': use html for tooltip
  5839. * 'richText': use canvas, svg, and etc. for tooltip
  5840. */
  5841. renderMode?: 'auto' | TooltipRenderMode;
  5842. /**
  5843. * If append popup dom to document.body
  5844. * Only available when renderMode is html
  5845. */
  5846. appendToBody?: boolean;
  5847. /**
  5848. * specified class name of tooltip dom
  5849. * Only available when renderMode is html
  5850. */
  5851. className?: string;
  5852. order?: TooltipOrderMode;
  5853. }
  5854. /**
  5855. * This is an abstract layer to insulate the upper usage of tooltip content
  5856. * from the different backends according to different `renderMode` ('html' or 'richText').
  5857. * With the help of the abstract layer, it does not need to consider how to create and
  5858. * assemble html or richText snippets when making tooltip content.
  5859. *
  5860. * @usage
  5861. *
  5862. * ```ts
  5863. * class XxxSeriesModel {
  5864. * formatTooltip(
  5865. * dataIndex: number,
  5866. * multipleSeries: boolean,
  5867. * dataType: string
  5868. * ) {
  5869. * ...
  5870. * return createTooltipMarkup('section', {
  5871. * header: header,
  5872. * blocks: [
  5873. * createTooltipMarkup('nameValue', {
  5874. * name: name,
  5875. * value: value,
  5876. * noValue: value == null
  5877. * })
  5878. * ]
  5879. * });
  5880. * }
  5881. * }
  5882. * ```
  5883. */
  5884. declare type TooltipMarkupBlockFragment = TooltipMarkupSection | TooltipMarkupNameValueBlock;
  5885. interface TooltipMarkupBlock {
  5886. sortParam?: unknown;
  5887. }
  5888. interface TooltipMarkupSection extends TooltipMarkupBlock {
  5889. type: 'section';
  5890. header?: unknown;
  5891. noHeader?: boolean;
  5892. blocks?: TooltipMarkupBlockFragment[];
  5893. sortBlocks?: boolean;
  5894. valueFormatter?: CommonTooltipOption<unknown>['valueFormatter'];
  5895. }
  5896. interface TooltipMarkupNameValueBlock extends TooltipMarkupBlock {
  5897. type: 'nameValue';
  5898. markerType?: TooltipMarkerType;
  5899. markerColor?: ColorString;
  5900. name?: string;
  5901. value?: unknown | unknown[];
  5902. valueType?: DimensionType | DimensionType[];
  5903. noName?: boolean;
  5904. noValue?: boolean;
  5905. valueFormatter?: CommonTooltipOption<unknown>['valueFormatter'];
  5906. }
  5907. interface DataFormatMixin extends DataHost {
  5908. ecModel: GlobalModel;
  5909. mainType: ComponentMainType;
  5910. subType: ComponentSubType;
  5911. componentIndex: number;
  5912. id: string;
  5913. name: string;
  5914. animatedValue: OptionDataValue[];
  5915. }
  5916. declare class DataFormatMixin {
  5917. /**
  5918. * Get params for formatter
  5919. */
  5920. getDataParams(dataIndex: number, dataType?: SeriesDataType): CallbackDataParams;
  5921. /**
  5922. * Format label
  5923. * @param dataIndex
  5924. * @param status 'normal' by default
  5925. * @param dataType
  5926. * @param labelDimIndex Only used in some chart that
  5927. * use formatter in different dimensions, like radar.
  5928. * @param formatter Formatter given outside.
  5929. * @return return null/undefined if no formatter
  5930. */
  5931. getFormattedLabel(dataIndex: number, status?: DisplayState, dataType?: SeriesDataType, labelDimIndex?: number, formatter?: string | ((params: object) => string), extendParams?: {
  5932. interpolatedValue: InterpolatableValue;
  5933. }): string;
  5934. /**
  5935. * Get raw value in option
  5936. */
  5937. getRawValue(idx: number, dataType?: SeriesDataType): unknown;
  5938. /**
  5939. * Should be implemented.
  5940. * @param {number} dataIndex
  5941. * @param {boolean} [multipleSeries=false]
  5942. * @param {string} [dataType]
  5943. */
  5944. formatTooltip(dataIndex: number, multipleSeries?: boolean, dataType?: string): TooltipFormatResult;
  5945. }
  5946. declare type TooltipFormatResult = string | TooltipMarkupBlockFragment;
  5947. /**
  5948. * [Notice]:
  5949. * Consider custom bundle on demand, chart specified
  5950. * or component specified types and constants should
  5951. * not put here. Only common types and constants can
  5952. * be put in this file.
  5953. */
  5954. declare type RendererType = 'canvas' | 'svg';
  5955. declare type LayoutOrient = 'vertical' | 'horizontal';
  5956. declare type HorizontalAlign = 'left' | 'center' | 'right';
  5957. declare type VerticalAlign = 'top' | 'middle' | 'bottom';
  5958. declare type ColorString = string;
  5959. declare type ZRColor = ColorString | LinearGradientObject | RadialGradientObject | PatternObject;
  5960. declare type ZRLineType = 'solid' | 'dotted' | 'dashed' | number | number[];
  5961. declare type ZRFontStyle = 'normal' | 'italic' | 'oblique';
  5962. declare type ZRFontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' | number;
  5963. declare type ZREasing = AnimationEasing;
  5964. declare type ZRTextAlign = TextAlign;
  5965. declare type ZRTextVerticalAlign = TextVerticalAlign;
  5966. declare type ZRRectLike = RectLike;
  5967. declare type ZRStyleProps = PathStyleProps | ImageStyleProps | TSpanStyleProps | TextStyleProps;
  5968. declare type ZRElementEventName = ElementEventName | 'globalout';
  5969. declare type ComponentFullType = string;
  5970. declare type ComponentMainType = keyof ECUnitOption & string;
  5971. declare type ComponentSubType = Exclude<ComponentOption['type'], undefined>;
  5972. interface DataHost {
  5973. getData(dataType?: SeriesDataType): SeriesData;
  5974. }
  5975. interface DataModel extends Model<unknown>, DataHost, DataFormatMixin {
  5976. }
  5977. interface PayloadItem {
  5978. excludeSeriesId?: OptionId | OptionId[];
  5979. animation?: PayloadAnimationPart;
  5980. [other: string]: any;
  5981. }
  5982. interface Payload extends PayloadItem {
  5983. type: string;
  5984. escapeConnect?: boolean;
  5985. batch?: PayloadItem[];
  5986. }
  5987. interface PayloadAnimationPart {
  5988. duration?: number;
  5989. easing?: AnimationEasing;
  5990. delay?: number;
  5991. }
  5992. interface ViewRootGroup extends Group {
  5993. __ecComponentInfo?: {
  5994. mainType: string;
  5995. index: number;
  5996. };
  5997. }
  5998. interface ECElementEvent extends ECEventData, CallbackDataParams {
  5999. type: ZRElementEventName;
  6000. event?: ElementEvent;
  6001. }
  6002. /**
  6003. * The echarts event type to user.
  6004. * Also known as packedEvent.
  6005. */
  6006. interface ECActionEvent extends ECEventData {
  6007. type: string;
  6008. componentType?: string;
  6009. componentIndex?: number;
  6010. seriesIndex?: number;
  6011. escapeConnect?: boolean;
  6012. batch?: ECEventData;
  6013. }
  6014. interface ECEventData {
  6015. [key: string]: any;
  6016. }
  6017. interface EventQueryItem {
  6018. [key: string]: any;
  6019. }
  6020. interface ActionInfo {
  6021. type: string;
  6022. event?: string;
  6023. update?: string;
  6024. }
  6025. interface ActionHandler {
  6026. (payload: Payload, ecModel: GlobalModel, api: ExtensionAPI): void | ECEventData;
  6027. }
  6028. interface OptionPreprocessor {
  6029. (option: ECUnitOption, isTheme: boolean): void;
  6030. }
  6031. interface PostUpdater {
  6032. (ecModel: GlobalModel, api: ExtensionAPI): void;
  6033. }
  6034. interface StageHandlerReset {
  6035. (seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): StageHandlerProgressExecutor | StageHandlerProgressExecutor[] | void;
  6036. }
  6037. interface StageHandlerOverallReset {
  6038. (ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): void;
  6039. }
  6040. interface StageHandler {
  6041. /**
  6042. * Indicate that the task will be piped all series
  6043. * (`performRawSeries` indicate whether includes filtered series).
  6044. */
  6045. createOnAllSeries?: boolean;
  6046. /**
  6047. * Indicate that the task will be only piped in the pipeline of this type of series.
  6048. * (`performRawSeries` indicate whether includes filtered series).
  6049. */
  6050. seriesType?: string;
  6051. /**
  6052. * Indicate that the task will be only piped in the pipeline of the returned series.
  6053. */
  6054. getTargetSeries?: (ecModel: GlobalModel, api: ExtensionAPI) => HashMap<SeriesModel>;
  6055. /**
  6056. * If `true`, filtered series will also be "performed".
  6057. */
  6058. performRawSeries?: boolean;
  6059. /**
  6060. * Called only when this task in a pipeline.
  6061. */
  6062. plan?: StageHandlerPlan;
  6063. /**
  6064. * If `overallReset` specified, an "overall task" will be created.
  6065. * "overall task" does not belong to a certain pipeline.
  6066. * They always be "performed" in certain phase (depends on when they declared).
  6067. * They has "stub"s to connect with pipelines (one stub for one pipeline),
  6068. * delivering info like "dirty" and "output end".
  6069. */
  6070. overallReset?: StageHandlerOverallReset;
  6071. /**
  6072. * Called only when this task in a pipeline, and "dirty".
  6073. */
  6074. reset?: StageHandlerReset;
  6075. }
  6076. interface StageHandlerInternal extends StageHandler {
  6077. uid: string;
  6078. visualType?: 'layout' | 'visual';
  6079. __prio: number;
  6080. __raw: StageHandler | StageHandlerOverallReset;
  6081. isVisual?: boolean;
  6082. isLayout?: boolean;
  6083. }
  6084. declare type StageHandlerProgressParams = TaskProgressParams;
  6085. interface StageHandlerProgressExecutor {
  6086. dataEach?: (data: SeriesData, idx: number) => void;
  6087. progress?: (params: StageHandlerProgressParams, data: SeriesData) => void;
  6088. }
  6089. declare type StageHandlerPlanReturn = TaskPlanCallbackReturn;
  6090. interface StageHandlerPlan {
  6091. (seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): StageHandlerPlanReturn;
  6092. }
  6093. interface LoadingEffectCreator {
  6094. (api: ExtensionAPI, cfg: object): LoadingEffect;
  6095. }
  6096. interface LoadingEffect extends Element {
  6097. resize: () => void;
  6098. }
  6099. /**
  6100. * 'html' is used for rendering tooltip in extra DOM form, and the result
  6101. * string is used as DOM HTML content.
  6102. * 'richText' is used for rendering tooltip in rich text form, for those where
  6103. * DOM operation is not supported.
  6104. */
  6105. declare type TooltipRenderMode = 'html' | 'richText';
  6106. declare type TooltipOrderMode = 'valueAsc' | 'valueDesc' | 'seriesAsc' | 'seriesDesc';
  6107. declare type OrdinalRawValue = string | number;
  6108. declare type OrdinalNumber = number;
  6109. /**
  6110. * @usage For example,
  6111. * ```js
  6112. * { ordinalNumbers: [2, 5, 3, 4] }
  6113. * ```
  6114. * means that ordinal 2 should be diplayed on tick 0,
  6115. * ordinal 5 should be displayed on tick 1, ...
  6116. */
  6117. declare type OrdinalSortInfo = {
  6118. ordinalNumbers: OrdinalNumber[];
  6119. };
  6120. /**
  6121. * `OptionDataValue` is the primitive value in `series.data` or `dataset.source`.
  6122. * `OptionDataValue` are parsed (see `src/data/helper/dataValueHelper.parseDataValue`)
  6123. * into `ParsedValue` and stored into `data/SeriesData` storage.
  6124. * Note:
  6125. * (1) The term "parse" does not mean `src/scale/Scale['parse']`.
  6126. * (2) If a category dimension is not mapped to any axis, its raw value will NOT be
  6127. * parsed to `OrdinalNumber` but keep the original `OrdinalRawValue` in `src/data/SeriesData` storage.
  6128. */
  6129. declare type ParsedValue = ParsedValueNumeric | OrdinalRawValue;
  6130. declare type ParsedValueNumeric = number | OrdinalNumber;
  6131. /**
  6132. * `ScaleDataValue` means that the user input primitive value to `src/scale/Scale`.
  6133. * (For example, used in `axis.min`, `axis.max`, `convertToPixel`).
  6134. * Note:
  6135. * `ScaleDataValue` is a little different from `OptionDataValue`, because it will not go through
  6136. * `src/data/helper/dataValueHelper.parseDataValue`, but go through `src/scale/Scale['parse']`.
  6137. */
  6138. declare type ScaleDataValue = ParsedValueNumeric | OrdinalRawValue | Date;
  6139. interface ScaleTick {
  6140. level?: number;
  6141. value: number;
  6142. }
  6143. declare type DimensionIndex = number;
  6144. declare type DimensionIndexLoose = DimensionIndex | string;
  6145. declare type DimensionName = string;
  6146. declare type DimensionLoose = DimensionName | DimensionIndexLoose;
  6147. declare type DimensionType = DataStoreDimensionType;
  6148. interface DataVisualDimensions {
  6149. tooltip?: DimensionIndex | false;
  6150. label?: DimensionIndex;
  6151. itemName?: DimensionIndex;
  6152. itemId?: DimensionIndex;
  6153. itemGroupId?: DimensionIndex;
  6154. seriesName?: DimensionIndex;
  6155. }
  6156. declare type DimensionDefinition = {
  6157. type?: DataStoreDimensionType;
  6158. name?: DimensionName;
  6159. displayName?: string;
  6160. };
  6161. declare type DimensionDefinitionLoose = DimensionDefinition['name'] | DimensionDefinition;
  6162. declare const SOURCE_FORMAT_ORIGINAL: "original";
  6163. declare const SOURCE_FORMAT_ARRAY_ROWS: "arrayRows";
  6164. declare const SOURCE_FORMAT_OBJECT_ROWS: "objectRows";
  6165. declare const SOURCE_FORMAT_KEYED_COLUMNS: "keyedColumns";
  6166. declare const SOURCE_FORMAT_TYPED_ARRAY: "typedArray";
  6167. declare const SOURCE_FORMAT_UNKNOWN: "unknown";
  6168. declare type SourceFormat = typeof SOURCE_FORMAT_ORIGINAL | typeof SOURCE_FORMAT_ARRAY_ROWS | typeof SOURCE_FORMAT_OBJECT_ROWS | typeof SOURCE_FORMAT_KEYED_COLUMNS | typeof SOURCE_FORMAT_TYPED_ARRAY | typeof SOURCE_FORMAT_UNKNOWN;
  6169. declare const SERIES_LAYOUT_BY_COLUMN: "column";
  6170. declare const SERIES_LAYOUT_BY_ROW: "row";
  6171. declare type SeriesLayoutBy = typeof SERIES_LAYOUT_BY_COLUMN | typeof SERIES_LAYOUT_BY_ROW;
  6172. declare type OptionSourceHeader = boolean | 'auto' | number;
  6173. declare type SeriesDataType = 'main' | 'node' | 'edge';
  6174. /**
  6175. * [ECUnitOption]:
  6176. * An object that contains definitions of components
  6177. * and other properties. For example:
  6178. *
  6179. * ```ts
  6180. * let option: ECUnitOption = {
  6181. *
  6182. * // Single `title` component:
  6183. * title: {...},
  6184. *
  6185. * // Two `visualMap` components:
  6186. * visualMap: [{...}, {...}],
  6187. *
  6188. * // Two `series.bar` components
  6189. * // and one `series.pie` component:
  6190. * series: [
  6191. * {type: 'bar', data: [...]},
  6192. * {type: 'bar', data: [...]},
  6193. * {type: 'pie', data: [...]}
  6194. * ],
  6195. *
  6196. * // A property:
  6197. * backgroundColor: '#421ae4'
  6198. *
  6199. * // A property object:
  6200. * textStyle: {
  6201. * color: 'red',
  6202. * fontSize: 20
  6203. * }
  6204. * };
  6205. * ```
  6206. */
  6207. declare type ECUnitOption = {
  6208. baseOption?: unknown;
  6209. options?: unknown;
  6210. media?: unknown;
  6211. timeline?: ComponentOption | ComponentOption[];
  6212. backgroundColor?: ZRColor;
  6213. darkMode?: boolean | 'auto';
  6214. textStyle?: Pick<LabelOption, 'color' | 'fontStyle' | 'fontWeight' | 'fontSize' | 'fontFamily'>;
  6215. useUTC?: boolean;
  6216. [key: string]: ComponentOption | ComponentOption[] | Dictionary<unknown> | unknown;
  6217. stateAnimation?: AnimationOption$1;
  6218. } & AnimationOptionMixin & ColorPaletteOptionMixin;
  6219. /**
  6220. * [ECOption]:
  6221. * An object input to echarts.setOption(option).
  6222. * May be an 'option: ECUnitOption',
  6223. * or may be an object contains multi-options. For example:
  6224. *
  6225. * ```ts
  6226. * let option: ECOption = {
  6227. * baseOption: {
  6228. * title: {...},
  6229. * legend: {...},
  6230. * series: [
  6231. * {data: [...]},
  6232. * {data: [...]},
  6233. * ...
  6234. * ]
  6235. * },
  6236. * timeline: {...},
  6237. * options: [
  6238. * {title: {...}, series: {data: [...]}},
  6239. * {title: {...}, series: {data: [...]}},
  6240. * ...
  6241. * ],
  6242. * media: [
  6243. * {
  6244. * query: {maxWidth: 320},
  6245. * option: {series: {x: 20}, visualMap: {show: false}}
  6246. * },
  6247. * {
  6248. * query: {minWidth: 320, maxWidth: 720},
  6249. * option: {series: {x: 500}, visualMap: {show: true}}
  6250. * },
  6251. * {
  6252. * option: {series: {x: 1200}, visualMap: {show: true}}
  6253. * }
  6254. * ]
  6255. * };
  6256. * ```
  6257. */
  6258. interface ECBasicOption extends ECUnitOption {
  6259. baseOption?: ECUnitOption;
  6260. timeline?: ComponentOption | ComponentOption[];
  6261. options?: ECUnitOption[];
  6262. media?: MediaUnit[];
  6263. }
  6264. declare type OptionSourceData<VAL extends OptionDataValue = OptionDataValue, ORIITEM extends OptionDataItemOriginal<VAL> = OptionDataItemOriginal<VAL>> = OptionSourceDataOriginal<VAL, ORIITEM> | OptionSourceDataObjectRows<VAL> | OptionSourceDataArrayRows<VAL> | OptionSourceDataKeyedColumns<VAL> | OptionSourceDataTypedArray;
  6265. declare type OptionDataItemOriginal<VAL extends OptionDataValue = OptionDataValue> = VAL | VAL[] | OptionDataItemObject<VAL>;
  6266. declare type OptionSourceDataOriginal<VAL extends OptionDataValue = OptionDataValue, ORIITEM extends OptionDataItemOriginal<VAL> = OptionDataItemOriginal<VAL>> = ArrayLike<ORIITEM>;
  6267. declare type OptionSourceDataObjectRows<VAL extends OptionDataValue = OptionDataValue> = Array<Dictionary<VAL>>;
  6268. declare type OptionSourceDataArrayRows<VAL extends OptionDataValue = OptionDataValue> = Array<Array<VAL>>;
  6269. declare type OptionSourceDataKeyedColumns<VAL extends OptionDataValue = OptionDataValue> = Dictionary<ArrayLike<VAL>>;
  6270. declare type OptionSourceDataTypedArray = ArrayLike<number>;
  6271. declare type OptionDataItem = OptionDataValue | Dictionary<OptionDataValue> | OptionDataValue[] | OptionDataItemObject<OptionDataValue>;
  6272. declare type OptionDataItemObject<T> = {
  6273. id?: OptionId;
  6274. name?: OptionName;
  6275. groupId?: OptionId;
  6276. value?: T[] | T;
  6277. selected?: boolean;
  6278. };
  6279. declare type OptionId = string | number;
  6280. declare type OptionName = string | number;
  6281. interface GraphEdgeItemObject<VAL extends OptionDataValue> extends OptionDataItemObject<VAL> {
  6282. /**
  6283. * Name or index of source node.
  6284. */
  6285. source?: string | number;
  6286. /**
  6287. * Name or index of target node.
  6288. */
  6289. target?: string | number;
  6290. }
  6291. declare type OptionDataValue = string | number | Date;
  6292. declare type OptionDataValueNumeric = number | '-';
  6293. declare type OptionDataValueDate = Date | string | number;
  6294. declare type ModelOption = any;
  6295. declare type ThemeOption = Dictionary<any>;
  6296. declare type DisplayState = 'normal' | 'emphasis' | 'blur' | 'select';
  6297. interface OptionEncodeVisualDimensions {
  6298. tooltip?: OptionEncodeValue;
  6299. label?: OptionEncodeValue;
  6300. itemName?: OptionEncodeValue;
  6301. itemId?: OptionEncodeValue;
  6302. seriesName?: OptionEncodeValue;
  6303. itemGroupId?: OptionEncodeValue;
  6304. }
  6305. interface OptionEncode extends OptionEncodeVisualDimensions {
  6306. [coordDim: string]: OptionEncodeValue | undefined;
  6307. }
  6308. declare type OptionEncodeValue = DimensionLoose | DimensionLoose[];
  6309. declare type EncodeDefaulter = (source: Source, dimCount: number) => OptionEncode;
  6310. interface CallbackDataParams {
  6311. componentType: string;
  6312. componentSubType: string;
  6313. componentIndex: number;
  6314. seriesType?: string;
  6315. seriesIndex?: number;
  6316. seriesId?: string;
  6317. seriesName?: string;
  6318. name: string;
  6319. dataIndex: number;
  6320. data: OptionDataItem;
  6321. dataType?: SeriesDataType;
  6322. value: OptionDataItem | OptionDataValue;
  6323. color?: ZRColor;
  6324. borderColor?: string;
  6325. dimensionNames?: DimensionName[];
  6326. encode?: DimensionUserOuputEncode;
  6327. marker?: TooltipMarker;
  6328. status?: DisplayState;
  6329. dimensionIndex?: number;
  6330. percent?: number;
  6331. $vars: string[];
  6332. }
  6333. declare type InterpolatableValue = ParsedValue | ParsedValue[];
  6334. declare type DecalDashArrayX = number | (number | number[])[];
  6335. declare type DecalDashArrayY = number | number[];
  6336. interface DecalObject {
  6337. symbol?: string | string[];
  6338. symbolSize?: number;
  6339. symbolKeepAspect?: boolean;
  6340. color?: string;
  6341. backgroundColor?: string;
  6342. dashArrayX?: DecalDashArrayX;
  6343. dashArrayY?: DecalDashArrayY;
  6344. rotation?: number;
  6345. maxTileWidth?: number;
  6346. maxTileHeight?: number;
  6347. }
  6348. interface MediaQuery {
  6349. minWidth?: number;
  6350. maxWidth?: number;
  6351. minHeight?: number;
  6352. maxHeight?: number;
  6353. minAspectRatio?: number;
  6354. maxAspectRatio?: number;
  6355. }
  6356. declare type MediaUnit = {
  6357. query?: MediaQuery;
  6358. option: ECUnitOption;
  6359. };
  6360. declare type ComponentLayoutMode = {
  6361. type?: 'box';
  6362. ignoreSize?: boolean | boolean[];
  6363. };
  6364. /******************* Mixins for Common Option Properties ********************** */
  6365. declare type PaletteOptionMixin = ColorPaletteOptionMixin;
  6366. interface ColorPaletteOptionMixin {
  6367. color?: ZRColor | ZRColor[];
  6368. colorLayer?: ZRColor[][];
  6369. }
  6370. /**
  6371. * Mixin of option set to control the box layout of each component.
  6372. */
  6373. interface BoxLayoutOptionMixin {
  6374. width?: number | string;
  6375. height?: number | string;
  6376. top?: number | string;
  6377. right?: number | string;
  6378. bottom?: number | string;
  6379. left?: number | string;
  6380. }
  6381. interface CircleLayoutOptionMixin {
  6382. center?: (number | string)[];
  6383. radius?: (number | string)[] | number | string;
  6384. }
  6385. interface ShadowOptionMixin {
  6386. shadowBlur?: number;
  6387. shadowColor?: ColorString;
  6388. shadowOffsetX?: number;
  6389. shadowOffsetY?: number;
  6390. }
  6391. interface BorderOptionMixin {
  6392. borderColor?: ZRColor;
  6393. borderWidth?: number;
  6394. borderType?: ZRLineType;
  6395. borderCap?: CanvasLineCap;
  6396. borderJoin?: CanvasLineJoin;
  6397. borderDashOffset?: number;
  6398. borderMiterLimit?: number;
  6399. }
  6400. declare type ColorBy = 'series' | 'data';
  6401. interface SunburstColorByMixin {
  6402. colorBy?: ColorBy;
  6403. }
  6404. declare type AnimationDelayCallbackParam = {
  6405. count: number;
  6406. index: number;
  6407. };
  6408. declare type AnimationDurationCallback = (idx: number) => number;
  6409. declare type AnimationDelayCallback = (idx: number, params?: AnimationDelayCallbackParam) => number;
  6410. interface AnimationOption$1 {
  6411. duration?: number;
  6412. easing?: AnimationEasing;
  6413. delay?: number;
  6414. }
  6415. /**
  6416. * Mixin of option set to control the animation of series.
  6417. */
  6418. interface AnimationOptionMixin {
  6419. /**
  6420. * If enable animation
  6421. */
  6422. animation?: boolean;
  6423. /**
  6424. * Disable animation when the number of elements exceeds the threshold
  6425. */
  6426. animationThreshold?: number;
  6427. /**
  6428. * Duration of initialize animation.
  6429. * Can be a callback to specify duration of each element
  6430. */
  6431. animationDuration?: number | AnimationDurationCallback;
  6432. /**
  6433. * Easing of initialize animation
  6434. */
  6435. animationEasing?: AnimationEasing;
  6436. /**
  6437. * Delay of initialize animation
  6438. * Can be a callback to specify duration of each element
  6439. */
  6440. animationDelay?: number | AnimationDelayCallback;
  6441. /**
  6442. * Delay of data update animation.
  6443. * Can be a callback to specify duration of each element
  6444. */
  6445. animationDurationUpdate?: number | AnimationDurationCallback;
  6446. /**
  6447. * Easing of data update animation.
  6448. */
  6449. animationEasingUpdate?: AnimationEasing;
  6450. /**
  6451. * Delay of data update animation.
  6452. * Can be a callback to specify duration of each element
  6453. */
  6454. animationDelayUpdate?: number | AnimationDelayCallback;
  6455. }
  6456. interface RoamOptionMixin {
  6457. /**
  6458. * If enable roam. can be specified 'scale' or 'move'
  6459. */
  6460. roam?: boolean | 'pan' | 'move' | 'zoom' | 'scale';
  6461. /**
  6462. * Current center position.
  6463. */
  6464. center?: (number | string)[];
  6465. /**
  6466. * Current zoom level. Default is 1
  6467. */
  6468. zoom?: number;
  6469. scaleLimit?: {
  6470. min?: number;
  6471. max?: number;
  6472. };
  6473. }
  6474. declare type SymbolSizeCallback<T> = (rawValue: any, params: T) => number | number[];
  6475. declare type SymbolCallback<T> = (rawValue: any, params: T) => string;
  6476. declare type SymbolRotateCallback<T> = (rawValue: any, params: T) => number;
  6477. declare type SymbolOffsetCallback<T> = (rawValue: any, params: T) => string | number | (string | number)[];
  6478. /**
  6479. * Mixin of option set to control the element symbol.
  6480. * Include type of symbol, and size of symbol.
  6481. */
  6482. interface SymbolOptionMixin<T = never> {
  6483. /**
  6484. * type of symbol, like `cirlce`, `rect`, or custom path and image.
  6485. */
  6486. symbol?: string | (T extends never ? never : SymbolCallback<T>);
  6487. /**
  6488. * Size of symbol.
  6489. */
  6490. symbolSize?: number | number[] | (T extends never ? never : SymbolSizeCallback<T>);
  6491. symbolRotate?: number | (T extends never ? never : SymbolRotateCallback<T>);
  6492. symbolKeepAspect?: boolean;
  6493. symbolOffset?: string | number | (string | number)[] | (T extends never ? never : SymbolOffsetCallback<T>);
  6494. }
  6495. /**
  6496. * ItemStyleOption is a most common used set to config element styles.
  6497. * It includes both fill and stroke style.
  6498. */
  6499. interface ItemStyleOption<TCbParams = never> extends ShadowOptionMixin, BorderOptionMixin {
  6500. color?: ZRColor | (TCbParams extends never ? never : ((params: TCbParams) => ZRColor));
  6501. opacity?: number;
  6502. decal?: DecalObject | 'none';
  6503. }
  6504. /**
  6505. * ItemStyleOption is a option set to control styles on lines.
  6506. * Used in the components or series like `line`, `axis`
  6507. * It includes stroke style.
  6508. */
  6509. interface LineStyleOption<Clr = ZRColor> extends ShadowOptionMixin {
  6510. width?: number;
  6511. color?: Clr;
  6512. opacity?: number;
  6513. type?: ZRLineType;
  6514. cap?: CanvasLineCap;
  6515. join?: CanvasLineJoin;
  6516. dashOffset?: number;
  6517. miterLimit?: number;
  6518. }
  6519. /**
  6520. * ItemStyleOption is a option set to control styles on an area, like polygon, rectangle.
  6521. * It only include fill style.
  6522. */
  6523. interface AreaStyleOption<Clr = ZRColor> extends ShadowOptionMixin {
  6524. color?: Clr;
  6525. opacity?: number;
  6526. }
  6527. interface VisualOptionUnit {
  6528. symbol?: string;
  6529. symbolSize?: number;
  6530. color?: ColorString;
  6531. colorAlpha?: number;
  6532. opacity?: number;
  6533. colorLightness?: number;
  6534. colorSaturation?: number;
  6535. colorHue?: number;
  6536. decal?: DecalObject;
  6537. liftZ?: number;
  6538. }
  6539. declare type VisualOptionFixed = VisualOptionUnit;
  6540. /**
  6541. * Option about visual properties used in piecewise mapping
  6542. * Used in each piece.
  6543. */
  6544. declare type VisualOptionPiecewise = VisualOptionUnit;
  6545. /**
  6546. * All visual properties can be encoded.
  6547. */
  6548. declare type BuiltinVisualProperty = keyof VisualOptionUnit;
  6549. interface TextCommonOption extends ShadowOptionMixin {
  6550. color?: string;
  6551. fontStyle?: ZRFontStyle;
  6552. fontWeight?: ZRFontWeight;
  6553. fontFamily?: string;
  6554. fontSize?: number | string;
  6555. align?: HorizontalAlign;
  6556. verticalAlign?: VerticalAlign;
  6557. baseline?: VerticalAlign;
  6558. opacity?: number;
  6559. lineHeight?: number;
  6560. backgroundColor?: ColorString | {
  6561. image: ImageLike | string;
  6562. };
  6563. borderColor?: string;
  6564. borderWidth?: number;
  6565. borderType?: ZRLineType;
  6566. borderDashOffset?: number;
  6567. borderRadius?: number | number[];
  6568. padding?: number | number[];
  6569. width?: number | string;
  6570. height?: number;
  6571. textBorderColor?: string;
  6572. textBorderWidth?: number;
  6573. textBorderType?: ZRLineType;
  6574. textBorderDashOffset?: number;
  6575. textShadowBlur?: number;
  6576. textShadowColor?: string;
  6577. textShadowOffsetX?: number;
  6578. textShadowOffsetY?: number;
  6579. tag?: string;
  6580. }
  6581. interface LabelFormatterCallback<T = CallbackDataParams> {
  6582. (params: T): string;
  6583. }
  6584. /**
  6585. * LabelOption is an option set to control the style of labels.
  6586. * Include color, background, shadow, truncate, rotation, distance, etc..
  6587. */
  6588. interface LabelOption extends TextCommonOption {
  6589. /**
  6590. * If show label
  6591. */
  6592. show?: boolean;
  6593. position?: ElementTextConfig['position'];
  6594. distance?: number;
  6595. rotate?: number;
  6596. offset?: number[];
  6597. /**
  6598. * Min margin between labels. Used when label has layout.
  6599. */
  6600. minMargin?: number;
  6601. overflow?: TextStyleProps['overflow'];
  6602. silent?: boolean;
  6603. precision?: number | 'auto';
  6604. valueAnimation?: boolean;
  6605. rich?: Dictionary<TextCommonOption>;
  6606. }
  6607. interface SeriesLabelOption extends LabelOption {
  6608. formatter?: string | LabelFormatterCallback<CallbackDataParams>;
  6609. }
  6610. /**
  6611. * Option for labels on line, like markLine, lines
  6612. */
  6613. interface LineLabelOption extends Omit<LabelOption, 'distance' | 'position'> {
  6614. position?: 'start' | 'middle' | 'end' | 'insideStart' | 'insideStartTop' | 'insideStartBottom' | 'insideMiddle' | 'insideMiddleTop' | 'insideMiddleBottom' | 'insideEnd' | 'insideEndTop' | 'insideEndBottom' | 'insideMiddleBottom';
  6615. /**
  6616. * Distance can be an array.
  6617. * Which will specify horizontal and vertical distance respectively
  6618. */
  6619. distance?: number | number[];
  6620. }
  6621. interface LabelLineOption {
  6622. show?: boolean;
  6623. /**
  6624. * If displayed above other elements
  6625. */
  6626. showAbove?: boolean;
  6627. length?: number;
  6628. length2?: number;
  6629. smooth?: boolean | number;
  6630. minTurnAngle?: number;
  6631. lineStyle?: LineStyleOption;
  6632. }
  6633. interface SeriesLineLabelOption extends LineLabelOption {
  6634. formatter?: string | LabelFormatterCallback<CallbackDataParams>;
  6635. }
  6636. interface LabelLayoutOptionCallbackParams {
  6637. /**
  6638. * Index of data which the label represents.
  6639. * It can be null if label does't represent any data.
  6640. */
  6641. dataIndex?: number;
  6642. /**
  6643. * Type of data which the label represents.
  6644. * It can be null if label does't represent any data.
  6645. */
  6646. dataType?: SeriesDataType;
  6647. seriesIndex: number;
  6648. text: string;
  6649. align: ZRTextAlign;
  6650. verticalAlign: ZRTextVerticalAlign;
  6651. rect: RectLike;
  6652. labelRect: RectLike;
  6653. labelLinePoints?: number[][];
  6654. }
  6655. interface LabelLayoutOption {
  6656. /**
  6657. * If move the overlapped label. If label is still overlapped after moved.
  6658. * It will determine if to hide this label with `hideOverlap` policy.
  6659. *
  6660. * shiftX/Y will keep the order on x/y
  6661. * shuffleX/y will move the label around the original position randomly.
  6662. */
  6663. moveOverlap?: 'shiftX' | 'shiftY' | 'shuffleX' | 'shuffleY';
  6664. /**
  6665. * If hide the overlapped label. It will be handled after move.
  6666. * @default 'none'
  6667. */
  6668. hideOverlap?: boolean;
  6669. /**
  6670. * If label is draggable.
  6671. */
  6672. draggable?: boolean;
  6673. /**
  6674. * Can be absolute px number or percent string.
  6675. */
  6676. x?: number | string;
  6677. y?: number | string;
  6678. /**
  6679. * offset on x based on the original position.
  6680. */
  6681. dx?: number;
  6682. /**
  6683. * offset on y based on the original position.
  6684. */
  6685. dy?: number;
  6686. rotate?: number;
  6687. align?: ZRTextAlign;
  6688. verticalAlign?: ZRTextVerticalAlign;
  6689. width?: number;
  6690. height?: number;
  6691. fontSize?: number;
  6692. labelLinePoints?: number[][];
  6693. }
  6694. declare type LabelLayoutOptionCallback = (params: LabelLayoutOptionCallbackParams) => LabelLayoutOption;
  6695. interface TooltipFormatterCallback<T> {
  6696. /**
  6697. * For sync callback
  6698. * params will be an array on axis trigger.
  6699. */
  6700. (params: T, asyncTicket: string): string | HTMLElement | HTMLElement[];
  6701. /**
  6702. * For async callback.
  6703. * Returned html string will be a placeholder when callback is not invoked.
  6704. */
  6705. (params: T, asyncTicket: string, callback: (cbTicket: string, htmlOrDomNodes: string | HTMLElement | HTMLElement[]) => void): string | HTMLElement | HTMLElement[];
  6706. }
  6707. declare type TooltipBuiltinPosition = 'inside' | 'top' | 'left' | 'right' | 'bottom';
  6708. declare type TooltipBoxLayoutOption = Pick<BoxLayoutOptionMixin, 'top' | 'left' | 'right' | 'bottom'>;
  6709. declare type TooltipPositionCallbackParams = CallbackDataParams | CallbackDataParams[];
  6710. /**
  6711. * Position relative to the hoverred element. Only available when trigger is item.
  6712. */
  6713. interface TooltipPositionCallback {
  6714. (point: [number, number],
  6715. /**
  6716. * params will be an array on axis trigger.
  6717. */
  6718. params: TooltipPositionCallbackParams,
  6719. /**
  6720. * Will be HTMLDivElement when renderMode is html
  6721. * Otherwise it's graphic.Text
  6722. */
  6723. el: HTMLDivElement | ZRText | null,
  6724. /**
  6725. * Rect of hover elements. Will be null if not hovered
  6726. */
  6727. rect: RectLike | null, size: {
  6728. /**
  6729. * Size of popup content
  6730. */
  6731. contentSize: [number, number];
  6732. /**
  6733. * Size of the chart view
  6734. */
  6735. viewSize: [number, number];
  6736. }): Array<number | string> | TooltipBuiltinPosition | TooltipBoxLayoutOption;
  6737. }
  6738. /**
  6739. * Common tooltip option
  6740. * Can be configured on series, graphic elements
  6741. */
  6742. interface CommonTooltipOption<FormatterParams> {
  6743. show?: boolean;
  6744. /**
  6745. * When to trigger
  6746. */
  6747. triggerOn?: 'mousemove' | 'click' | 'none' | 'mousemove|click';
  6748. /**
  6749. * Whether to not hide popup content automatically
  6750. */
  6751. alwaysShowContent?: boolean;
  6752. formatter?: string | TooltipFormatterCallback<FormatterParams>;
  6753. /**
  6754. * Formatter of value.
  6755. *
  6756. * Will be ignored if tooltip.formatter is specified.
  6757. */
  6758. valueFormatter?: (value: OptionDataValue | OptionDataValue[]) => string;
  6759. /**
  6760. * Absolution pixel [x, y] array. Or relative percent string [x, y] array.
  6761. * If trigger is 'item'. position can be set to 'inside' / 'top' / 'left' / 'right' / 'bottom',
  6762. * which is relative to the hovered element.
  6763. *
  6764. * Support to be a callback
  6765. */
  6766. position?: (number | string)[] | TooltipBuiltinPosition | TooltipPositionCallback | TooltipBoxLayoutOption;
  6767. confine?: boolean;
  6768. /**
  6769. * Consider triggered from axisPointer handle, verticalAlign should be 'middle'
  6770. */
  6771. align?: HorizontalAlign;
  6772. verticalAlign?: VerticalAlign;
  6773. /**
  6774. * Delay of show. milesecond.
  6775. */
  6776. showDelay?: number;
  6777. /**
  6778. * Delay of hide. milesecond.
  6779. */
  6780. hideDelay?: number;
  6781. transitionDuration?: number;
  6782. /**
  6783. * Whether mouse is allowed to enter the floating layer of tooltip
  6784. * If you need to interact in the tooltip like with links or buttons, it can be set as true.
  6785. */
  6786. enterable?: boolean;
  6787. backgroundColor?: ColorString;
  6788. borderColor?: ColorString;
  6789. borderRadius?: number;
  6790. borderWidth?: number;
  6791. shadowBlur?: number;
  6792. shadowColor?: string;
  6793. shadowOffsetX?: number;
  6794. shadowOffsetY?: number;
  6795. /**
  6796. * Padding between tooltip content and tooltip border.
  6797. */
  6798. padding?: number | number[];
  6799. /**
  6800. * Available when renderMode is 'html'
  6801. */
  6802. extraCssText?: string;
  6803. textStyle?: Pick<LabelOption, 'color' | 'fontStyle' | 'fontWeight' | 'fontFamily' | 'fontSize' | 'lineHeight' | 'width' | 'height' | 'textBorderColor' | 'textBorderWidth' | 'textShadowColor' | 'textShadowBlur' | 'textShadowOffsetX' | 'textShadowOffsetY' | 'align'> & {
  6804. decoration?: string;
  6805. };
  6806. }
  6807. declare type ComponentItemTooltipOption<T> = CommonTooltipOption<T> & {
  6808. content?: string;
  6809. formatterParams?: ComponentItemTooltipLabelFormatterParams;
  6810. };
  6811. declare type ComponentItemTooltipLabelFormatterParams = {
  6812. componentType: string;
  6813. name: string;
  6814. $vars: string[];
  6815. } & {
  6816. [key in string]: unknown;
  6817. };
  6818. /**
  6819. * Tooltip option configured on each series
  6820. */
  6821. declare type SeriesTooltipOption = CommonTooltipOption<CallbackDataParams> & {
  6822. trigger?: 'item' | 'axis' | boolean | 'none';
  6823. };
  6824. declare type LabelFormatterParams = {
  6825. value: ScaleDataValue;
  6826. axisDimension: string;
  6827. axisIndex: number;
  6828. seriesData: CallbackDataParams[];
  6829. };
  6830. /**
  6831. * Common axis option. can be configured on each axis
  6832. */
  6833. interface CommonAxisPointerOption {
  6834. show?: boolean | 'auto';
  6835. z?: number;
  6836. zlevel?: number;
  6837. triggerOn?: 'click' | 'mousemove' | 'none' | 'mousemove|click';
  6838. type?: 'line' | 'shadow' | 'none';
  6839. snap?: boolean;
  6840. triggerTooltip?: boolean;
  6841. /**
  6842. * current value. When using axisPointer.handle, value can be set to define the initail position of axisPointer.
  6843. */
  6844. value?: ScaleDataValue;
  6845. status?: 'show' | 'hide';
  6846. label?: LabelOption & {
  6847. precision?: 'auto' | number;
  6848. margin?: number;
  6849. /**
  6850. * String template include variable {value} or callback function
  6851. */
  6852. formatter?: string | ((params: LabelFormatterParams) => string);
  6853. };
  6854. animation?: boolean | 'auto';
  6855. animationDurationUpdate?: number;
  6856. animationEasingUpdate?: ZREasing;
  6857. /**
  6858. * Available when type is 'line'
  6859. */
  6860. lineStyle?: LineStyleOption;
  6861. /**
  6862. * Available when type is 'shadow'
  6863. */
  6864. shadowStyle?: AreaStyleOption;
  6865. handle?: {
  6866. show?: boolean;
  6867. icon?: string;
  6868. /**
  6869. * The size of the handle
  6870. */
  6871. size?: number | number[];
  6872. /**
  6873. * Distance from handle center to axis.
  6874. */
  6875. margin?: number;
  6876. color?: ColorString;
  6877. /**
  6878. * Throttle for mobile performance
  6879. */
  6880. throttle?: number;
  6881. } & ShadowOptionMixin;
  6882. seriesDataIndices?: {
  6883. seriesIndex: number;
  6884. dataIndex: number;
  6885. dataIndexInside: number;
  6886. }[];
  6887. }
  6888. interface ComponentOption {
  6889. mainType?: string;
  6890. type?: string;
  6891. id?: OptionId;
  6892. name?: OptionName;
  6893. z?: number;
  6894. zlevel?: number;
  6895. }
  6896. declare type BlurScope = 'coordinateSystem' | 'series' | 'global';
  6897. /**
  6898. * can be array of data indices.
  6899. * Or may be an dictionary if have different types of data like in graph.
  6900. */
  6901. declare type InnerFocus = DefaultEmphasisFocus | ArrayLike<number> | Dictionary<ArrayLike<number>>;
  6902. interface DefaultStatesMixin {
  6903. emphasis?: any;
  6904. select?: any;
  6905. blur?: any;
  6906. }
  6907. declare type DefaultEmphasisFocus = 'none' | 'self' | 'series';
  6908. interface DefaultStatesMixinEmphasis {
  6909. /**
  6910. * self: Focus self and blur all others.
  6911. * series: Focus series and blur all other series.
  6912. */
  6913. focus?: DefaultEmphasisFocus;
  6914. }
  6915. interface StatesMixinBase {
  6916. emphasis?: unknown;
  6917. select?: unknown;
  6918. blur?: unknown;
  6919. }
  6920. interface StatesOptionMixin<StateOption, StatesMixin extends StatesMixinBase> {
  6921. /**
  6922. * Emphasis states
  6923. */
  6924. emphasis?: StateOption & StatesMixin['emphasis'] & {
  6925. /**
  6926. * Scope of blurred element when focus.
  6927. *
  6928. * coordinateSystem: blur others in the same coordinateSystem
  6929. * series: blur others in the same series
  6930. * global: blur all others
  6931. *
  6932. * Default to be coordinate system.
  6933. */
  6934. blurScope?: BlurScope;
  6935. /**
  6936. * If emphasis state is disabled.
  6937. */
  6938. disabled?: boolean;
  6939. };
  6940. /**
  6941. * Select states
  6942. */
  6943. select?: StateOption & StatesMixin['select'] & {
  6944. disabled?: boolean;
  6945. };
  6946. /**
  6947. * Blur states.
  6948. */
  6949. blur?: StateOption & StatesMixin['blur'];
  6950. }
  6951. interface UniversalTransitionOption {
  6952. enabled?: boolean;
  6953. /**
  6954. * Animation delay of each divided element
  6955. */
  6956. delay?: (index: number, count: number) => number;
  6957. /**
  6958. * How to divide the shape in combine and split animation.
  6959. */
  6960. divideShape?: 'clone' | 'split';
  6961. /**
  6962. * Series will have transition between if they have same seriesKey.
  6963. * Usually it is a string. It can also be an array,
  6964. * which means it can be transition from or to multiple series with each key in this array item.
  6965. *
  6966. * Note:
  6967. * If two series have both array seriesKey. They will be compared after concated to a string(which is order independent)
  6968. * Transition between string key has higher priority.
  6969. *
  6970. * Default to use series id.
  6971. */
  6972. seriesKey?: string | string[];
  6973. }
  6974. interface SeriesOption<StateOption = unknown, StatesMixin extends StatesMixinBase = DefaultStatesMixin> extends ComponentOption, AnimationOptionMixin, ColorPaletteOptionMixin, StatesOptionMixin<StateOption, StatesMixin> {
  6975. mainType?: 'series';
  6976. silent?: boolean;
  6977. blendMode?: string;
  6978. /**
  6979. * Cursor when mouse on the elements
  6980. */
  6981. cursor?: string;
  6982. /**
  6983. * groupId of data. can be used for doing drilldown / up animation
  6984. * It will be ignored if:
  6985. * - groupId is specified in each data
  6986. * - encode.itemGroupId is given.
  6987. */
  6988. dataGroupId?: OptionId;
  6989. data?: unknown;
  6990. colorBy?: ColorBy;
  6991. legendHoverLink?: boolean;
  6992. /**
  6993. * Configurations about progressive rendering
  6994. */
  6995. progressive?: number | false;
  6996. progressiveThreshold?: number;
  6997. progressiveChunkMode?: 'mod';
  6998. /**
  6999. * Not available on every series
  7000. */
  7001. coordinateSystem?: string;
  7002. hoverLayerThreshold?: number;
  7003. /**
  7004. * When dataset is used, seriesLayoutBy specifies whether the column or the row of dataset is mapped to the series
  7005. * namely, the series is "layout" on columns or rows
  7006. * @default 'column'
  7007. */
  7008. seriesLayoutBy?: 'column' | 'row';
  7009. labelLine?: LabelLineOption;
  7010. /**
  7011. * Overall label layout option in label layout stage.
  7012. */
  7013. labelLayout?: LabelLayoutOption | LabelLayoutOptionCallback;
  7014. /**
  7015. * Animation config for state transition.
  7016. */
  7017. stateAnimation?: AnimationOption$1;
  7018. /**
  7019. * If enabled universal transition cross series.
  7020. * @example
  7021. * universalTransition: true
  7022. * universalTransition: { enabled: true }
  7023. */
  7024. universalTransition?: boolean | UniversalTransitionOption;
  7025. /**
  7026. * Map of selected data
  7027. * key is name or index of data.
  7028. */
  7029. selectedMap?: Dictionary<boolean> | 'all';
  7030. selectedMode?: 'single' | 'multiple' | 'series' | boolean;
  7031. }
  7032. interface SeriesOnCartesianOptionMixin {
  7033. xAxisIndex?: number;
  7034. yAxisIndex?: number;
  7035. xAxisId?: string;
  7036. yAxisId?: string;
  7037. }
  7038. interface SeriesOnPolarOptionMixin {
  7039. polarIndex?: number;
  7040. polarId?: string;
  7041. }
  7042. interface SeriesOnSingleOptionMixin {
  7043. singleAxisIndex?: number;
  7044. singleAxisId?: string;
  7045. }
  7046. interface SeriesOnGeoOptionMixin {
  7047. geoIndex?: number;
  7048. geoId?: string;
  7049. }
  7050. interface SeriesOnCalendarOptionMixin {
  7051. calendarIndex?: number;
  7052. calendarId?: string;
  7053. }
  7054. interface SeriesLargeOptionMixin {
  7055. large?: boolean;
  7056. largeThreshold?: number;
  7057. }
  7058. interface SeriesStackOptionMixin {
  7059. stack?: string;
  7060. stackStrategy?: 'samesign' | 'all' | 'positive' | 'negative';
  7061. }
  7062. declare type SamplingFunc = (frame: ArrayLike<number>) => number;
  7063. interface SeriesSamplingOptionMixin {
  7064. sampling?: 'none' | 'average' | 'min' | 'max' | 'sum' | 'lttb' | SamplingFunc;
  7065. }
  7066. interface SeriesEncodeOptionMixin {
  7067. datasetIndex?: number;
  7068. datasetId?: string | number;
  7069. seriesLayoutBy?: SeriesLayoutBy;
  7070. sourceHeader?: OptionSourceHeader;
  7071. dimensions?: DimensionDefinitionLoose[];
  7072. encode?: OptionEncode;
  7073. }
  7074. interface AriaLabelOption {
  7075. enabled?: boolean;
  7076. description?: string;
  7077. general?: {
  7078. withTitle?: string;
  7079. withoutTitle?: string;
  7080. };
  7081. series?: {
  7082. maxCount?: number;
  7083. single?: {
  7084. prefix?: string;
  7085. withName?: string;
  7086. withoutName?: string;
  7087. };
  7088. multiple?: {
  7089. prefix?: string;
  7090. withName?: string;
  7091. withoutName?: string;
  7092. separator?: {
  7093. middle?: string;
  7094. end?: string;
  7095. };
  7096. };
  7097. };
  7098. data?: {
  7099. maxCount?: number;
  7100. allData?: string;
  7101. partialData?: string;
  7102. withName?: string;
  7103. withoutName?: string;
  7104. separator?: {
  7105. middle?: string;
  7106. end?: string;
  7107. };
  7108. };
  7109. }
  7110. interface AriaOption extends AriaLabelOption {
  7111. mainType?: 'aria';
  7112. enabled?: boolean;
  7113. label?: AriaLabelOption;
  7114. decal?: {
  7115. show?: boolean;
  7116. decals?: DecalObject | DecalObject[];
  7117. };
  7118. }
  7119. declare type AreaStyleProps = Pick<PathStyleProps, 'fill' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'opacity' | 'shadowColor'>;
  7120. declare class AreaStyleMixin {
  7121. getAreaStyle(this: Model, excludes?: readonly (keyof AreaStyleOption)[], includes?: readonly (keyof AreaStyleOption)[]): AreaStyleProps;
  7122. }
  7123. declare type LabelFontOption = Pick<LabelOption, 'fontStyle' | 'fontWeight' | 'fontSize' | 'fontFamily'>;
  7124. declare type LabelRectRelatedOption = Pick<LabelOption, 'align' | 'verticalAlign' | 'padding' | 'lineHeight' | 'baseline' | 'rich' | 'width' | 'height' | 'overflow'> & LabelFontOption;
  7125. declare class TextStyleMixin {
  7126. /**
  7127. * Get color property or get color from option.textStyle.color
  7128. */
  7129. getTextColor(this: Model, isEmphasis?: boolean): ColorString;
  7130. /**
  7131. * Create font string from fontStyle, fontWeight, fontSize, fontFamily
  7132. * @return {string}
  7133. */
  7134. getFont(this: Model<LabelFontOption>): string;
  7135. getTextRect(this: Model<LabelRectRelatedOption> & TextStyleMixin, text: string): BoundingRect;
  7136. }
  7137. interface Model<Opt = ModelOption> extends LineStyleMixin, ItemStyleMixin, TextStyleMixin, AreaStyleMixin {
  7138. }
  7139. declare class Model<Opt = ModelOption> {
  7140. parentModel: Model;
  7141. ecModel: GlobalModel;
  7142. option: Opt;
  7143. constructor(option?: Opt, parentModel?: Model, ecModel?: GlobalModel);
  7144. init(option: Opt, parentModel?: Model, ecModel?: GlobalModel, ...rest: any): void;
  7145. /**
  7146. * Merge the input option to me.
  7147. */
  7148. mergeOption(option: Opt, ecModel?: GlobalModel): void;
  7149. get<R extends keyof Opt>(path: R, ignoreParent?: boolean): Opt[R];
  7150. get<R extends keyof Opt>(path: readonly [R], ignoreParent?: boolean): Opt[R];
  7151. get<R extends keyof Opt, S extends keyof Opt[R]>(path: readonly [R, S], ignoreParent?: boolean): Opt[R][S];
  7152. get<R extends keyof Opt, S extends keyof Opt[R], T extends keyof Opt[R][S]>(path: readonly [R, S, T], ignoreParent?: boolean): Opt[R][S][T];
  7153. getShallow<R extends keyof Opt>(key: R, ignoreParent?: boolean): Opt[R];
  7154. getModel<R extends keyof Opt>(path: R, parentModel?: Model): Model<Opt[R]>;
  7155. getModel<R extends keyof Opt>(path: readonly [R], parentModel?: Model): Model<Opt[R]>;
  7156. getModel<R extends keyof Opt, S extends keyof Opt[R]>(path: readonly [R, S], parentModel?: Model): Model<Opt[R][S]>;
  7157. getModel<Ra extends keyof Opt, Rb extends keyof Opt, S extends keyof Opt[Rb]>(path: readonly [Ra] | readonly [Rb, S], parentModel?: Model): Model<Opt[Ra]> | Model<Opt[Rb][S]>;
  7158. getModel<R extends keyof Opt, S extends keyof Opt[R], T extends keyof Opt[R][S]>(path: readonly [R, S, T], parentModel?: Model): Model<Opt[R][S][T]>;
  7159. /**
  7160. * If model has option
  7161. */
  7162. isEmpty(): boolean;
  7163. restoreData(): void;
  7164. clone(): Model<Opt>;
  7165. parsePath(path: string | readonly string[]): readonly string[];
  7166. resolveParentPath(path: readonly string[]): string[];
  7167. isAnimationEnabled(): boolean;
  7168. private _doGet;
  7169. }
  7170. /**
  7171. * ECharts option manager
  7172. */
  7173. /**
  7174. * TERM EXPLANATIONS:
  7175. * See `ECOption` and `ECUnitOption` in `src/util/types.ts`.
  7176. */
  7177. declare class OptionManager {
  7178. private _api;
  7179. private _timelineOptions;
  7180. private _mediaList;
  7181. private _mediaDefault;
  7182. /**
  7183. * -1, means default.
  7184. * empty means no media.
  7185. */
  7186. private _currentMediaIndices;
  7187. private _optionBackup;
  7188. private _newBaseOption;
  7189. constructor(api: ExtensionAPI);
  7190. setOption(rawOption: ECBasicOption, optionPreprocessorFuncs: OptionPreprocessor[], opt: InnerSetOptionOpts): void;
  7191. mountOption(isRecreate: boolean): ECUnitOption;
  7192. getTimelineOption(ecModel: GlobalModel): ECUnitOption;
  7193. getMediaOption(ecModel: GlobalModel): ECUnitOption[];
  7194. }
  7195. declare const _default: {
  7196. time: {
  7197. month: string[];
  7198. monthAbbr: string[];
  7199. dayOfWeek: string[];
  7200. dayOfWeekAbbr: string[];
  7201. };
  7202. legend: {
  7203. selector: {
  7204. all: string;
  7205. inverse: string;
  7206. };
  7207. };
  7208. toolbox: {
  7209. brush: {
  7210. title: {
  7211. rect: string;
  7212. polygon: string;
  7213. lineX: string;
  7214. lineY: string;
  7215. keep: string;
  7216. clear: string;
  7217. };
  7218. };
  7219. dataView: {
  7220. title: string;
  7221. lang: string[];
  7222. };
  7223. dataZoom: {
  7224. title: {
  7225. zoom: string;
  7226. back: string;
  7227. };
  7228. };
  7229. magicType: {
  7230. title: {
  7231. line: string;
  7232. bar: string;
  7233. stack: string;
  7234. tiled: string;
  7235. };
  7236. };
  7237. restore: {
  7238. title: string;
  7239. };
  7240. saveAsImage: {
  7241. title: string;
  7242. lang: string[];
  7243. };
  7244. };
  7245. series: {
  7246. typeNames: {
  7247. pie: string;
  7248. bar: string;
  7249. line: string;
  7250. scatter: string;
  7251. effectScatter: string;
  7252. radar: string;
  7253. tree: string;
  7254. treemap: string;
  7255. boxplot: string;
  7256. candlestick: string;
  7257. k: string;
  7258. heatmap: string;
  7259. map: string;
  7260. parallel: string;
  7261. lines: string;
  7262. graph: string;
  7263. sankey: string;
  7264. funnel: string;
  7265. gauge: string;
  7266. pictorialBar: string;
  7267. themeRiver: string;
  7268. sunburst: string;
  7269. };
  7270. };
  7271. aria: {
  7272. general: {
  7273. withTitle: string;
  7274. withoutTitle: string;
  7275. };
  7276. series: {
  7277. single: {
  7278. prefix: string;
  7279. withName: string;
  7280. withoutName: string;
  7281. };
  7282. multiple: {
  7283. prefix: string;
  7284. withName: string;
  7285. withoutName: string;
  7286. separator: {
  7287. middle: string;
  7288. end: string;
  7289. };
  7290. };
  7291. };
  7292. data: {
  7293. allData: string;
  7294. partialData: string;
  7295. withName: string;
  7296. withoutName: string;
  7297. separator: {
  7298. middle: string;
  7299. end: string;
  7300. };
  7301. };
  7302. };
  7303. };
  7304. declare type LocaleOption = typeof _default;
  7305. declare function registerLocale(locale: string, localeObj: LocaleOption): void;
  7306. /**
  7307. * Caution: If the mechanism should be changed some day, these cases
  7308. * should be considered:
  7309. *
  7310. * (1) In `merge option` mode, if using the same option to call `setOption`
  7311. * many times, the result should be the same (try our best to ensure that).
  7312. * (2) In `merge option` mode, if a component has no id/name specified, it
  7313. * will be merged by index, and the result sequence of the components is
  7314. * consistent to the original sequence.
  7315. * (3) In `replaceMerge` mode, keep the result sequence of the components is
  7316. * consistent to the original sequence, even though there might result in "hole".
  7317. * (4) `reset` feature (in toolbox). Find detailed info in comments about
  7318. * `mergeOption` in module:echarts/model/OptionManager.
  7319. */
  7320. interface GlobalModelSetOptionOpts {
  7321. replaceMerge: ComponentMainType | ComponentMainType[];
  7322. }
  7323. interface InnerSetOptionOpts {
  7324. replaceMergeMainTypeMap: HashMap<boolean, string>;
  7325. }
  7326. /**
  7327. * @param condition.mainType Mandatory.
  7328. * @param condition.subType Optional.
  7329. * @param condition.query like {xxxIndex, xxxId, xxxName},
  7330. * where xxx is mainType.
  7331. * If query attribute is null/undefined or has no index/id/name,
  7332. * do not filtering by query conditions, which is convenient for
  7333. * no-payload situations or when target of action is global.
  7334. * @param condition.filter parameter: component, return boolean.
  7335. */
  7336. interface QueryConditionKindA {
  7337. mainType: ComponentMainType;
  7338. subType?: ComponentSubType;
  7339. query?: {
  7340. [k: string]: number | number[] | string | string[];
  7341. };
  7342. filter?: (cmpt: ComponentModel) => boolean;
  7343. }
  7344. /**
  7345. * If none of index and id and name used, return all components with mainType.
  7346. * @param condition.mainType
  7347. * @param condition.subType If ignore, only query by mainType
  7348. * @param condition.index Either input index or id or name.
  7349. * @param condition.id Either input index or id or name.
  7350. * @param condition.name Either input index or id or name.
  7351. */
  7352. interface QueryConditionKindB {
  7353. mainType: ComponentMainType;
  7354. subType?: ComponentSubType;
  7355. index?: number | number[];
  7356. id?: OptionId | OptionId[];
  7357. name?: OptionName | OptionName[];
  7358. }
  7359. interface EachComponentAllCallback {
  7360. (mainType: string, model: ComponentModel, componentIndex: number): void;
  7361. }
  7362. interface EachComponentInMainTypeCallback {
  7363. (model: ComponentModel, componentIndex: number): void;
  7364. }
  7365. declare class GlobalModel extends Model<ECUnitOption> {
  7366. option: ECUnitOption;
  7367. private _theme;
  7368. private _locale;
  7369. private _optionManager;
  7370. private _componentsMap;
  7371. /**
  7372. * `_componentsMap` might have "hole" becuase of remove.
  7373. * So save components count for a certain mainType here.
  7374. */
  7375. private _componentsCount;
  7376. /**
  7377. * Mapping between filtered series list and raw series list.
  7378. * key: filtered series indices, value: raw series indices.
  7379. * Items of `_seriesIndices` never be null/empty/-1.
  7380. * If series has been removed by `replaceMerge`, those series
  7381. * also won't be in `_seriesIndices`, just like be filtered.
  7382. */
  7383. private _seriesIndices;
  7384. /**
  7385. * Key: seriesIndex.
  7386. * Keep consistent with `_seriesIndices`.
  7387. */
  7388. private _seriesIndicesMap;
  7389. /**
  7390. * Model for store update payload
  7391. */
  7392. private _payload;
  7393. scheduler: Scheduler;
  7394. ssr: boolean;
  7395. init(option: ECBasicOption, parentModel: Model, ecModel: GlobalModel, theme: object, locale: object, optionManager: OptionManager): void;
  7396. setOption(option: ECBasicOption, opts: GlobalModelSetOptionOpts, optionPreprocessorFuncs: OptionPreprocessor[]): void;
  7397. /**
  7398. * @param type null/undefined: reset all.
  7399. * 'recreate': force recreate all.
  7400. * 'timeline': only reset timeline option
  7401. * 'media': only reset media query option
  7402. * @return Whether option changed.
  7403. */
  7404. resetOption(type: 'recreate' | 'timeline' | 'media', opt?: Pick<GlobalModelSetOptionOpts, 'replaceMerge'>): boolean;
  7405. private _resetOption;
  7406. mergeOption(option: ECUnitOption): void;
  7407. private _mergeOption;
  7408. /**
  7409. * Get option for output (cloned option and inner info removed)
  7410. */
  7411. getOption(): ECUnitOption;
  7412. getTheme(): Model;
  7413. getLocaleModel(): Model<LocaleOption>;
  7414. setUpdatePayload(payload: Payload): void;
  7415. getUpdatePayload(): Payload;
  7416. /**
  7417. * @param idx If not specified, return the first one.
  7418. */
  7419. getComponent(mainType: ComponentMainType, idx?: number): ComponentModel;
  7420. /**
  7421. * @return Never be null/undefined.
  7422. */
  7423. queryComponents(condition: QueryConditionKindB): ComponentModel[];
  7424. /**
  7425. * The interface is different from queryComponents,
  7426. * which is convenient for inner usage.
  7427. *
  7428. * @usage
  7429. * let result = findComponents(
  7430. * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}
  7431. * );
  7432. * let result = findComponents(
  7433. * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}
  7434. * );
  7435. * let result = findComponents(
  7436. * {mainType: 'series',
  7437. * filter: function (model, index) {...}}
  7438. * );
  7439. * // result like [component0, componnet1, ...]
  7440. */
  7441. findComponents(condition: QueryConditionKindA): ComponentModel[];
  7442. /**
  7443. * Travel components (before filtered).
  7444. *
  7445. * @usage
  7446. * eachComponent('legend', function (legendModel, index) {
  7447. * ...
  7448. * });
  7449. * eachComponent(function (componentType, model, index) {
  7450. * // componentType does not include subType
  7451. * // (componentType is 'a' but not 'a.b')
  7452. * });
  7453. * eachComponent(
  7454. * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}},
  7455. * function (model, index) {...}
  7456. * );
  7457. * eachComponent(
  7458. * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}},
  7459. * function (model, index) {...}
  7460. * );
  7461. */
  7462. eachComponent<T>(cb: EachComponentAllCallback, context?: T): void;
  7463. eachComponent<T>(mainType: string, cb: EachComponentInMainTypeCallback, context?: T): void;
  7464. eachComponent<T>(mainType: QueryConditionKindA, cb: EachComponentInMainTypeCallback, context?: T): void;
  7465. /**
  7466. * Get series list before filtered by name.
  7467. */
  7468. getSeriesByName(name: OptionName): SeriesModel[];
  7469. /**
  7470. * Get series list before filtered by index.
  7471. */
  7472. getSeriesByIndex(seriesIndex: number): SeriesModel;
  7473. /**
  7474. * Get series list before filtered by type.
  7475. * FIXME: rename to getRawSeriesByType?
  7476. */
  7477. getSeriesByType(subType: ComponentSubType): SeriesModel[];
  7478. /**
  7479. * Get all series before filtered.
  7480. */
  7481. getSeries(): SeriesModel[];
  7482. /**
  7483. * Count series before filtered.
  7484. */
  7485. getSeriesCount(): number;
  7486. /**
  7487. * After filtering, series may be different
  7488. * frome raw series.
  7489. */
  7490. eachSeries<T>(cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
  7491. /**
  7492. * Iterate raw series before filtered.
  7493. *
  7494. * @param {Function} cb
  7495. * @param {*} context
  7496. */
  7497. eachRawSeries<T>(cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
  7498. /**
  7499. * After filtering, series may be different.
  7500. * frome raw series.
  7501. */
  7502. eachSeriesByType<T>(subType: ComponentSubType, cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
  7503. /**
  7504. * Iterate raw series before filtered of given type.
  7505. */
  7506. eachRawSeriesByType<T>(subType: ComponentSubType, cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
  7507. isSeriesFiltered(seriesModel: SeriesModel): boolean;
  7508. getCurrentSeriesIndices(): number[];
  7509. filterSeries<T>(cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => boolean, context?: T): void;
  7510. restoreData(payload?: Payload): void;
  7511. private static internalField;
  7512. }
  7513. interface GlobalModel extends PaletteMixin<ECUnitOption> {
  7514. }
  7515. interface UpdateLifecycleTransitionSeriesFinder {
  7516. seriesIndex?: ModelFinderIndexQuery;
  7517. seriesId?: ModelFinderIdQuery;
  7518. dimension: DimensionLoose;
  7519. }
  7520. interface UpdateLifecycleTransitionItem {
  7521. from?: UpdateLifecycleTransitionSeriesFinder | UpdateLifecycleTransitionSeriesFinder[];
  7522. to: UpdateLifecycleTransitionSeriesFinder | UpdateLifecycleTransitionSeriesFinder[];
  7523. }
  7524. declare type UpdateLifecycleTransitionOpt = UpdateLifecycleTransitionItem | UpdateLifecycleTransitionItem[];
  7525. interface UpdateLifecycleParams {
  7526. updatedSeries?: SeriesModel[];
  7527. /**
  7528. * If this update is from setOption and option is changed.
  7529. */
  7530. optionChanged?: boolean;
  7531. seriesTransition?: UpdateLifecycleTransitionOpt;
  7532. }
  7533. interface LifecycleEvents {
  7534. 'afterinit': [EChartsType];
  7535. 'series:beforeupdate': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
  7536. 'series:layoutlabels': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
  7537. 'series:transition': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
  7538. 'series:afterupdate': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
  7539. 'afterupdate': [GlobalModel, ExtensionAPI];
  7540. }
  7541. declare class GeoJSONResource implements GeoResource {
  7542. readonly type = "geoJSON";
  7543. private _geoJSON;
  7544. private _specialAreas;
  7545. private _mapName;
  7546. private _parsedMap;
  7547. constructor(mapName: string, geoJSON: GeoJSONSourceInput, specialAreas: GeoSpecialAreas);
  7548. /**
  7549. * @param nameMap can be null/undefined
  7550. * @param nameProperty can be null/undefined
  7551. */
  7552. load(nameMap: NameMap, nameProperty: string): {
  7553. regions: GeoJSONRegion[];
  7554. boundingRect: BoundingRect;
  7555. regionsMap: HashMap<GeoJSONRegion, string | number>;
  7556. };
  7557. private _parseToRegions;
  7558. /**
  7559. * Only for exporting to users.
  7560. * **MUST NOT** used internally.
  7561. */
  7562. getMapForUser(): {
  7563. geoJson: GeoJSON | GeoJSONCompressed;
  7564. geoJSON: GeoJSON | GeoJSONCompressed;
  7565. specialAreas: GeoSpecialAreas;
  7566. };
  7567. }
  7568. declare type MapInput = GeoJSONMapInput | SVGMapInput;
  7569. interface GeoJSONMapInput {
  7570. geoJSON: GeoJSONSourceInput;
  7571. specialAreas: GeoSpecialAreas;
  7572. }
  7573. interface SVGMapInput {
  7574. svg: GeoSVGSourceInput;
  7575. }
  7576. declare const _default$1: {
  7577. /**
  7578. * Compatible with previous `echarts.registerMap`.
  7579. *
  7580. * @usage
  7581. * ```js
  7582. *
  7583. * echarts.registerMap('USA', geoJson, specialAreas);
  7584. *
  7585. * echarts.registerMap('USA', {
  7586. * geoJson: geoJson,
  7587. * specialAreas: {...}
  7588. * });
  7589. * echarts.registerMap('USA', {
  7590. * geoJSON: geoJson,
  7591. * specialAreas: {...}
  7592. * });
  7593. *
  7594. * echarts.registerMap('airport', {
  7595. * svg: svg
  7596. * }
  7597. * ```
  7598. *
  7599. * Note:
  7600. * Do not support that register multiple geoJSON or SVG
  7601. * one map name. Because different geoJSON and SVG have
  7602. * different unit. It's not easy to make sure how those
  7603. * units are mapping/normalize.
  7604. * If intending to use multiple geoJSON or SVG, we can
  7605. * use multiple geo coordinate system.
  7606. */
  7607. registerMap: (mapName: string, rawDef: MapInput | GeoJSONSourceInput, rawSpecialAreas?: GeoSpecialAreas) => void;
  7608. getGeoResource(mapName: string): GeoResource;
  7609. /**
  7610. * Only for exporting to users.
  7611. * **MUST NOT** used internally.
  7612. */
  7613. getMapForUser: (mapName: string) => ReturnType<GeoJSONResource['getMapForUser']>;
  7614. load: (mapName: string, nameMap: NameMap, nameProperty: string) => ReturnType<GeoResource['load']>;
  7615. };
  7616. declare type ModelFinder$1 = ModelFinder;
  7617. declare const version$1 = "5.4.0";
  7618. declare const dependencies: {
  7619. zrender: string;
  7620. };
  7621. declare const PRIORITY: {
  7622. PROCESSOR: {
  7623. FILTER: number;
  7624. SERIES_FILTER: number;
  7625. STATISTIC: number;
  7626. };
  7627. VISUAL: {
  7628. LAYOUT: number;
  7629. PROGRESSIVE_LAYOUT: number;
  7630. GLOBAL: number;
  7631. CHART: number;
  7632. POST_CHART_LAYOUT: number;
  7633. COMPONENT: number;
  7634. BRUSH: number;
  7635. CHART_ITEM: number;
  7636. ARIA: number;
  7637. DECAL: number;
  7638. };
  7639. };
  7640. declare const IN_MAIN_PROCESS_KEY: "__flagInMainProcess";
  7641. declare const PENDING_UPDATE: "__pendingUpdate";
  7642. declare const STATUS_NEEDS_UPDATE_KEY: "__needsUpdateStatus";
  7643. declare const CONNECT_STATUS_KEY: "__connectUpdateStatus";
  7644. declare type SetOptionTransitionOpt = UpdateLifecycleTransitionOpt;
  7645. declare type SetOptionTransitionOptItem = UpdateLifecycleTransitionItem;
  7646. interface SetOptionOpts {
  7647. notMerge?: boolean;
  7648. lazyUpdate?: boolean;
  7649. silent?: boolean;
  7650. replaceMerge?: GlobalModelSetOptionOpts['replaceMerge'];
  7651. transition?: SetOptionTransitionOpt;
  7652. }
  7653. interface ResizeOpts {
  7654. width?: number | 'auto';
  7655. height?: number | 'auto';
  7656. animation?: AnimationOption$1;
  7657. silent?: boolean;
  7658. }
  7659. interface PostIniter {
  7660. (chart: EChartsType): void;
  7661. }
  7662. declare type RenderedEventParam = {
  7663. elapsedTime: number;
  7664. };
  7665. declare type ECEventDefinition = {
  7666. [key in ZRElementEventName]: EventCallbackSingleParam<ECElementEvent>;
  7667. } & {
  7668. rendered: EventCallbackSingleParam<RenderedEventParam>;
  7669. finished: () => void | boolean;
  7670. } & {
  7671. [key: string]: (...args: unknown[]) => void | boolean;
  7672. };
  7673. declare type EChartsInitOpts = {
  7674. locale?: string | LocaleOption;
  7675. renderer?: RendererType;
  7676. devicePixelRatio?: number;
  7677. useDirtyRect?: boolean;
  7678. useCoarsePointer?: boolean;
  7679. pointerSize?: number;
  7680. ssr?: boolean;
  7681. width?: number;
  7682. height?: number;
  7683. };
  7684. declare class ECharts extends Eventful<ECEventDefinition> {
  7685. /**
  7686. * @readonly
  7687. */
  7688. id: string;
  7689. /**
  7690. * Group id
  7691. * @readonly
  7692. */
  7693. group: string;
  7694. private _ssr;
  7695. private _zr;
  7696. private _dom;
  7697. private _model;
  7698. private _throttledZrFlush;
  7699. private _theme;
  7700. private _locale;
  7701. private _chartsViews;
  7702. private _chartsMap;
  7703. private _componentsViews;
  7704. private _componentsMap;
  7705. private _coordSysMgr;
  7706. private _api;
  7707. private _scheduler;
  7708. private _messageCenter;
  7709. private _pendingActions;
  7710. protected _$eventProcessor: never;
  7711. private _disposed;
  7712. private _loadingFX;
  7713. private [PENDING_UPDATE];
  7714. private [IN_MAIN_PROCESS_KEY];
  7715. private [CONNECT_STATUS_KEY];
  7716. private [STATUS_NEEDS_UPDATE_KEY];
  7717. constructor(dom: HTMLElement, theme?: string | ThemeOption, opts?: EChartsInitOpts);
  7718. private _onframe;
  7719. getDom(): HTMLElement;
  7720. getId(): string;
  7721. getZr(): ZRenderType;
  7722. isSSR(): boolean;
  7723. /**
  7724. * Usage:
  7725. * chart.setOption(option, notMerge, lazyUpdate);
  7726. * chart.setOption(option, {
  7727. * notMerge: ...,
  7728. * lazyUpdate: ...,
  7729. * silent: ...
  7730. * });
  7731. *
  7732. * @param opts opts or notMerge.
  7733. * @param opts.notMerge Default `false`.
  7734. * @param opts.lazyUpdate Default `false`. Useful when setOption frequently.
  7735. * @param opts.silent Default `false`.
  7736. * @param opts.replaceMerge Default undefined.
  7737. */
  7738. setOption<Opt extends ECBasicOption>(option: Opt, notMerge?: boolean, lazyUpdate?: boolean): void;
  7739. setOption<Opt extends ECBasicOption>(option: Opt, opts?: SetOptionOpts): void;
  7740. /**
  7741. * @deprecated
  7742. */
  7743. private setTheme;
  7744. private getModel;
  7745. getOption(): ECBasicOption;
  7746. getWidth(): number;
  7747. getHeight(): number;
  7748. getDevicePixelRatio(): number;
  7749. /**
  7750. * Get canvas which has all thing rendered
  7751. * @deprecated Use renderToCanvas instead.
  7752. */
  7753. getRenderedCanvas(opts?: any): HTMLCanvasElement;
  7754. renderToCanvas(opts?: {
  7755. backgroundColor?: ZRColor;
  7756. pixelRatio?: number;
  7757. }): HTMLCanvasElement;
  7758. renderToSVGString(opts?: {
  7759. useViewBox?: boolean;
  7760. }): string;
  7761. /**
  7762. * Get svg data url
  7763. */
  7764. getSvgDataURL(): string;
  7765. getDataURL(opts?: {
  7766. type?: 'png' | 'jpeg' | 'svg';
  7767. pixelRatio?: number;
  7768. backgroundColor?: ZRColor;
  7769. excludeComponents?: ComponentMainType[];
  7770. }): string;
  7771. getConnectedDataURL(opts?: {
  7772. type?: 'png' | 'jpeg' | 'svg';
  7773. pixelRatio?: number;
  7774. backgroundColor?: ZRColor;
  7775. connectedBackgroundColor?: ZRColor;
  7776. excludeComponents?: string[];
  7777. }): string;
  7778. /**
  7779. * Convert from logical coordinate system to pixel coordinate system.
  7780. * See CoordinateSystem#convertToPixel.
  7781. */
  7782. convertToPixel(finder: ModelFinder$1, value: ScaleDataValue): number;
  7783. convertToPixel(finder: ModelFinder$1, value: ScaleDataValue[]): number[];
  7784. /**
  7785. * Convert from pixel coordinate system to logical coordinate system.
  7786. * See CoordinateSystem#convertFromPixel.
  7787. */
  7788. convertFromPixel(finder: ModelFinder$1, value: number): number;
  7789. convertFromPixel(finder: ModelFinder$1, value: number[]): number[];
  7790. /**
  7791. * Is the specified coordinate systems or components contain the given pixel point.
  7792. * @param {Array|number} value
  7793. * @return {boolean} result
  7794. */
  7795. containPixel(finder: ModelFinder$1, value: number[]): boolean;
  7796. /**
  7797. * Get visual from series or data.
  7798. * @param finder
  7799. * If string, e.g., 'series', means {seriesIndex: 0}.
  7800. * If Object, could contain some of these properties below:
  7801. * {
  7802. * seriesIndex / seriesId / seriesName,
  7803. * dataIndex / dataIndexInside
  7804. * }
  7805. * If dataIndex is not specified, series visual will be fetched,
  7806. * but not data item visual.
  7807. * If all of seriesIndex, seriesId, seriesName are not specified,
  7808. * visual will be fetched from first series.
  7809. * @param visualType 'color', 'symbol', 'symbolSize'
  7810. */
  7811. getVisual(finder: ModelFinder$1, visualType: string): string | number | number[] | PatternObject | LinearGradientObject | RadialGradientObject;
  7812. /**
  7813. * Get view of corresponding component model
  7814. */
  7815. private getViewOfComponentModel;
  7816. /**
  7817. * Get view of corresponding series model
  7818. */
  7819. private getViewOfSeriesModel;
  7820. private _initEvents;
  7821. isDisposed(): boolean;
  7822. clear(): void;
  7823. dispose(): void;
  7824. /**
  7825. * Resize the chart
  7826. */
  7827. resize(opts?: ResizeOpts): void;
  7828. /**
  7829. * Show loading effect
  7830. * @param name 'default' by default
  7831. * @param cfg cfg of registered loading effect
  7832. */
  7833. showLoading(cfg?: object): void;
  7834. showLoading(name?: string, cfg?: object): void;
  7835. /**
  7836. * Hide loading effect
  7837. */
  7838. hideLoading(): void;
  7839. makeActionFromEvent(eventObj: ECActionEvent): Payload;
  7840. /**
  7841. * @param opt If pass boolean, means opt.silent
  7842. * @param opt.silent Default `false`. Whether trigger events.
  7843. * @param opt.flush Default `undefined`.
  7844. * true: Flush immediately, and then pixel in canvas can be fetched
  7845. * immediately. Caution: it might affect performance.
  7846. * false: Not flush.
  7847. * undefined: Auto decide whether perform flush.
  7848. */
  7849. dispatchAction(payload: Payload, opt?: boolean | {
  7850. silent?: boolean;
  7851. flush?: boolean | undefined;
  7852. }): void;
  7853. updateLabelLayout(): void;
  7854. appendData(params: {
  7855. seriesIndex: number;
  7856. data: any;
  7857. }): void;
  7858. private static internalField;
  7859. }
  7860. /**
  7861. * @param opts.devicePixelRatio Use window.devicePixelRatio by default
  7862. * @param opts.renderer Can choose 'canvas' or 'svg' to render the chart.
  7863. * @param opts.width Use clientWidth of the input `dom` by default.
  7864. * Can be 'auto' (the same as null/undefined)
  7865. * @param opts.height Use clientHeight of the input `dom` by default.
  7866. * Can be 'auto' (the same as null/undefined)
  7867. * @param opts.locale Specify the locale.
  7868. * @param opts.useDirtyRect Enable dirty rectangle rendering or not.
  7869. */
  7870. declare function init$1(dom: HTMLElement, theme?: string | object, opts?: EChartsInitOpts): EChartsType;
  7871. /**
  7872. * @usage
  7873. * (A)
  7874. * ```js
  7875. * let chart1 = echarts.init(dom1);
  7876. * let chart2 = echarts.init(dom2);
  7877. * chart1.group = 'xxx';
  7878. * chart2.group = 'xxx';
  7879. * echarts.connect('xxx');
  7880. * ```
  7881. * (B)
  7882. * ```js
  7883. * let chart1 = echarts.init(dom1);
  7884. * let chart2 = echarts.init(dom2);
  7885. * echarts.connect('xxx', [chart1, chart2]);
  7886. * ```
  7887. */
  7888. declare function connect(groupId: string | EChartsType[]): string;
  7889. /**
  7890. * @deprecated
  7891. */
  7892. declare function disConnect(groupId: string): void;
  7893. /**
  7894. * Alias and backword compat
  7895. */
  7896. declare const disconnect: typeof disConnect;
  7897. /**
  7898. * Dispose a chart instance
  7899. */
  7900. declare function dispose$1(chart: EChartsType | HTMLElement | string): void;
  7901. declare function getInstanceByDom(dom: HTMLElement): EChartsType | undefined;
  7902. declare function getInstanceById(key: string): EChartsType | undefined;
  7903. /**
  7904. * Register theme
  7905. */
  7906. declare function registerTheme(name: string, theme: ThemeOption): void;
  7907. /**
  7908. * Register option preprocessor
  7909. */
  7910. declare function registerPreprocessor(preprocessorFunc: OptionPreprocessor): void;
  7911. declare function registerProcessor(priority: number | StageHandler | StageHandlerOverallReset, processor?: StageHandler | StageHandlerOverallReset): void;
  7912. /**
  7913. * Register postIniter
  7914. * @param {Function} postInitFunc
  7915. */
  7916. declare function registerPostInit(postInitFunc: PostIniter): void;
  7917. /**
  7918. * Register postUpdater
  7919. * @param {Function} postUpdateFunc
  7920. */
  7921. declare function registerPostUpdate(postUpdateFunc: PostUpdater): void;
  7922. declare function registerUpdateLifecycle<T extends keyof LifecycleEvents>(name: T, cb: (...args: LifecycleEvents[T]) => void): void;
  7923. /**
  7924. * @usage
  7925. * registerAction('someAction', 'someEvent', function () { ... });
  7926. * registerAction('someAction', function () { ... });
  7927. * registerAction(
  7928. * {type: 'someAction', event: 'someEvent', update: 'updateView'},
  7929. * function () { ... }
  7930. * );
  7931. *
  7932. * @param {(string|Object)} actionInfo
  7933. * @param {string} actionInfo.type
  7934. * @param {string} [actionInfo.event]
  7935. * @param {string} [actionInfo.update]
  7936. * @param {string} [eventName]
  7937. * @param {Function} action
  7938. */
  7939. declare function registerAction(type: string, eventName: string, action: ActionHandler): void;
  7940. declare function registerAction(type: string, action: ActionHandler): void;
  7941. declare function registerAction(actionInfo: ActionInfo, action: ActionHandler): void;
  7942. declare function registerCoordinateSystem(type: string, coordSysCreator: CoordinateSystemCreator): void;
  7943. /**
  7944. * Get dimensions of specified coordinate system.
  7945. * @param {string} type
  7946. * @return {Array.<string|Object>}
  7947. */
  7948. declare function getCoordinateSystemDimensions(type: string): DimensionDefinitionLoose[];
  7949. /**
  7950. * Layout is a special stage of visual encoding
  7951. * Most visual encoding like color are common for different chart
  7952. * But each chart has it's own layout algorithm
  7953. */
  7954. declare function registerLayout(priority: number, layoutTask: StageHandler | StageHandlerOverallReset): void;
  7955. declare function registerLayout(layoutTask: StageHandler | StageHandlerOverallReset): void;
  7956. declare function registerVisual(priority: number, layoutTask: StageHandler | StageHandlerOverallReset): void;
  7957. declare function registerVisual(layoutTask: StageHandler | StageHandlerOverallReset): void;
  7958. declare function registerLoading(name: string, loadingFx: LoadingEffectCreator): void;
  7959. /**
  7960. * ZRender need a canvas context to do measureText.
  7961. * But in node environment canvas may be created by node-canvas.
  7962. * So we need to specify how to create a canvas instead of using document.createElement('canvas')
  7963. *
  7964. *
  7965. * @deprecated use setPlatformAPI({ createCanvas }) instead.
  7966. *
  7967. * @example
  7968. * let Canvas = require('canvas');
  7969. * let echarts = require('echarts');
  7970. * echarts.setCanvasCreator(function () {
  7971. * // Small size is enough.
  7972. * return new Canvas(32, 32);
  7973. * });
  7974. */
  7975. declare function setCanvasCreator(creator: () => HTMLCanvasElement): void;
  7976. declare type RegisterMapParams = Parameters<typeof _default$1.registerMap>;
  7977. /**
  7978. * The parameters and usage: see `geoSourceManager.registerMap`.
  7979. * Compatible with previous `echarts.registerMap`.
  7980. */
  7981. declare function registerMap(mapName: RegisterMapParams[0], geoJson: RegisterMapParams[1], specialAreas?: RegisterMapParams[2]): void;
  7982. declare function getMap(mapName: string): any;
  7983. declare const registerTransform: typeof registerExternalTransform;
  7984. declare const dataTool: {};
  7985. interface EChartsType extends ECharts {
  7986. }
  7987. declare function parse(colorStr: string, rgbaArr?: number[]): number[];
  7988. declare function lift(color: string, level: number): string;
  7989. declare function toHex(color: string): string;
  7990. declare function fastLerp(normalizedValue: number, colors: number[][], out?: number[]): number[];
  7991. declare const fastMapToColor: typeof fastLerp;
  7992. declare type LerpFullOutput = {
  7993. color: string;
  7994. leftIndex: number;
  7995. rightIndex: number;
  7996. value: number;
  7997. };
  7998. declare function lerp$1(normalizedValue: number, colors: string[], fullOutput: boolean): LerpFullOutput;
  7999. declare function lerp$1(normalizedValue: number, colors: string[]): string;
  8000. declare const mapToColor: typeof lerp$1;
  8001. declare function modifyHSL(color: string, h?: number, s?: number, l?: number): string;
  8002. declare function modifyAlpha(color: string, alpha?: number): string;
  8003. declare function stringify(arrColor: number[], type: string): string;
  8004. declare function lum(color: string, backgroundLum: number): number;
  8005. declare function random(): string;
  8006. declare const color_d_parse: typeof parse;
  8007. declare const color_d_lift: typeof lift;
  8008. declare const color_d_toHex: typeof toHex;
  8009. declare const color_d_fastLerp: typeof fastLerp;
  8010. declare const color_d_fastMapToColor: typeof fastMapToColor;
  8011. declare const color_d_mapToColor: typeof mapToColor;
  8012. declare const color_d_modifyHSL: typeof modifyHSL;
  8013. declare const color_d_modifyAlpha: typeof modifyAlpha;
  8014. declare const color_d_stringify: typeof stringify;
  8015. declare const color_d_lum: typeof lum;
  8016. declare const color_d_random: typeof random;
  8017. declare namespace color_d {
  8018. export {
  8019. color_d_parse as parse,
  8020. color_d_lift as lift,
  8021. color_d_toHex as toHex,
  8022. color_d_fastLerp as fastLerp,
  8023. color_d_fastMapToColor as fastMapToColor,
  8024. lerp$1 as lerp,
  8025. color_d_mapToColor as mapToColor,
  8026. color_d_modifyHSL as modifyHSL,
  8027. color_d_modifyAlpha as modifyAlpha,
  8028. color_d_stringify as stringify,
  8029. color_d_lum as lum,
  8030. color_d_random as random,
  8031. };
  8032. }
  8033. declare type ThrottleFunction = (this: unknown, ...args: unknown[]) => void;
  8034. interface ThrottleController {
  8035. clear(): void;
  8036. debounceNextCall(debounceDelay: number): void;
  8037. }
  8038. /**
  8039. * @public
  8040. * @param {(Function)} fn
  8041. * @param {number} [delay=0] Unit: ms.
  8042. * @param {boolean} [debounce=false]
  8043. * true: If call interval less than `delay`, only the last call works.
  8044. * false: If call interval less than `delay, call works on fixed rate.
  8045. * @return {(Function)} throttled fn.
  8046. */
  8047. declare function throttle<T extends ThrottleFunction>(fn: T, delay?: number, debounce?: boolean): T & ThrottleController;
  8048. declare type EnableDataStackDimensionsInput = {
  8049. schema: SeriesDataSchema;
  8050. store?: DataStore;
  8051. };
  8052. declare type EnableDataStackDimensionsInputLegacy = (SeriesDimensionDefine | string)[];
  8053. /**
  8054. * Note that it is too complicated to support 3d stack by value
  8055. * (have to create two-dimension inverted index), so in 3d case
  8056. * we just support that stacked by index.
  8057. *
  8058. * @param seriesModel
  8059. * @param dimensionsInput The same as the input of <module:echarts/data/SeriesData>.
  8060. * The input will be modified.
  8061. * @param opt
  8062. * @param opt.stackedCoordDimension Specify a coord dimension if needed.
  8063. * @param opt.byIndex=false
  8064. * @return calculationInfo
  8065. * {
  8066. * stackedDimension: string
  8067. * stackedByDimension: string
  8068. * isStackedByIndex: boolean
  8069. * stackedOverDimension: string
  8070. * stackResultDimension: string
  8071. * }
  8072. */
  8073. declare function enableDataStack(seriesModel: SeriesModel<SeriesOption & SeriesStackOptionMixin>, dimensionsInput: EnableDataStackDimensionsInput | EnableDataStackDimensionsInputLegacy, opt?: {
  8074. stackedCoordDimension?: string;
  8075. byIndex?: boolean;
  8076. }): Pick<DataCalculationInfo<unknown>, 'stackedDimension' | 'stackedByDimension' | 'isStackedByIndex' | 'stackedOverDimension' | 'stackResultDimension'>;
  8077. declare function isDimensionStacked(data: SeriesData, stackedDim: string): boolean;
  8078. declare function getStackedDimension(data: SeriesData, targetDim: string): DimensionName;
  8079. /**
  8080. * ECData stored on graphic element
  8081. */
  8082. interface ECData {
  8083. dataIndex?: number;
  8084. dataModel?: DataModel;
  8085. eventData?: ECEventData;
  8086. seriesIndex?: number;
  8087. dataType?: SeriesDataType;
  8088. focus?: InnerFocus;
  8089. blurScope?: BlurScope;
  8090. componentMainType?: ComponentMainType;
  8091. componentIndex?: number;
  8092. componentHighDownName?: string;
  8093. tooltipConfig?: {
  8094. name: string;
  8095. option: ComponentItemTooltipOption<unknown>;
  8096. };
  8097. }
  8098. declare const getECData: (hostObj: Element<ElementProps>) => ECData;
  8099. interface CoordDimensionDefinition extends DimensionDefinition {
  8100. dimsDef?: (DimensionName | {
  8101. name: DimensionName;
  8102. defaultTooltip?: boolean;
  8103. })[];
  8104. otherDims?: DataVisualDimensions;
  8105. ordinalMeta?: OrdinalMeta;
  8106. coordDim?: DimensionName;
  8107. coordDimIndex?: DimensionIndex;
  8108. }
  8109. declare type CoordDimensionDefinitionLoose = CoordDimensionDefinition['name'] | CoordDimensionDefinition;
  8110. declare type PrepareSeriesDataSchemaParams = {
  8111. coordDimensions?: CoordDimensionDefinitionLoose[];
  8112. /**
  8113. * Will use `source.dimensionsDefine` if not given.
  8114. */
  8115. dimensionsDefine?: DimensionDefinitionLoose[];
  8116. /**
  8117. * Will use `source.encodeDefine` if not given.
  8118. */
  8119. encodeDefine?: HashMap<OptionEncodeValue, DimensionName> | OptionEncode;
  8120. dimensionsCount?: number;
  8121. /**
  8122. * Make default encode if user not specified.
  8123. */
  8124. encodeDefaulter?: EncodeDefaulter;
  8125. generateCoord?: string;
  8126. generateCoordCount?: number;
  8127. /**
  8128. * If be able to omit unused dimension
  8129. * Used to improve the performance on high dimension data.
  8130. */
  8131. canOmitUnusedDimensions?: boolean;
  8132. };
  8133. /**
  8134. * For outside usage compat (like echarts-gl are using it).
  8135. */
  8136. declare function createDimensions(source: Source | OptionSourceData, opt?: PrepareSeriesDataSchemaParams): SeriesDimensionDefine[];
  8137. /**
  8138. * Enable the function that mouseover will trigger the emphasis state.
  8139. *
  8140. * NOTE:
  8141. * This function should be used on the element with dataIndex, seriesIndex.
  8142. *
  8143. */
  8144. declare function enableHoverEmphasis(el: Element, focus?: InnerFocus, blurScope?: BlurScope): void;
  8145. /**
  8146. * Create a muti dimension List structure from seriesModel.
  8147. */
  8148. declare function createList(seriesModel: SeriesModel): SeriesData<Model<any>, DefaultDataVisual>;
  8149. declare const dataStack: {
  8150. isDimensionStacked: typeof isDimensionStacked;
  8151. enableDataStack: typeof enableDataStack;
  8152. getStackedDimension: typeof getStackedDimension;
  8153. };
  8154. /**
  8155. * Create scale
  8156. * @param {Array.<number>} dataExtent
  8157. * @param {Object|module:echarts/Model} option If `optoin.type`
  8158. * is secified, it can only be `'value'` currently.
  8159. */
  8160. declare function createScale(dataExtent: number[], option: object | AxisBaseModel): Scale<Dictionary<unknown>>;
  8161. /**
  8162. * Mixin common methods to axis model,
  8163. *
  8164. * Inlcude methods
  8165. * `getFormattedLabels() => Array.<string>`
  8166. * `getCategories() => Array.<string>`
  8167. * `getMin(origin: boolean) => number`
  8168. * `getMax(origin: boolean) => number`
  8169. * `getNeedCrossZero() => boolean`
  8170. */
  8171. declare function mixinAxisModelCommonMethods(Model: Model): void;
  8172. declare function createTextStyle(textStyleModel: Model<TextCommonOption>, opts?: {
  8173. state?: DisplayState;
  8174. }): TextStyleProps;
  8175. declare const helper_d_getLayoutRect: typeof getLayoutRect;
  8176. declare const helper_d_getECData: typeof getECData;
  8177. declare const helper_d_createList: typeof createList;
  8178. declare const helper_d_dataStack: typeof dataStack;
  8179. declare const helper_d_createScale: typeof createScale;
  8180. declare const helper_d_mixinAxisModelCommonMethods: typeof mixinAxisModelCommonMethods;
  8181. declare const helper_d_createTextStyle: typeof createTextStyle;
  8182. declare const helper_d_createDimensions: typeof createDimensions;
  8183. declare const helper_d_createSymbol: typeof createSymbol;
  8184. declare const helper_d_enableHoverEmphasis: typeof enableHoverEmphasis;
  8185. declare namespace helper_d {
  8186. export {
  8187. helper_d_getLayoutRect as getLayoutRect,
  8188. helper_d_getECData as getECData,
  8189. helper_d_createList as createList,
  8190. helper_d_dataStack as dataStack,
  8191. helper_d_createScale as createScale,
  8192. helper_d_mixinAxisModelCommonMethods as mixinAxisModelCommonMethods,
  8193. helper_d_createTextStyle as createTextStyle,
  8194. helper_d_createDimensions as createDimensions,
  8195. helper_d_createSymbol as createSymbol,
  8196. helper_d_enableHoverEmphasis as enableHoverEmphasis,
  8197. };
  8198. }
  8199. interface Platform {
  8200. createCanvas(): HTMLCanvasElement;
  8201. measureText(text: string, font?: string): {
  8202. width: number;
  8203. };
  8204. loadImage(src: string, onload: () => void | HTMLImageElement['onload'], onerror: () => void | HTMLImageElement['onerror']): HTMLImageElement;
  8205. }
  8206. declare function setPlatformAPI(newPlatformApis: Partial<Platform>): void;
  8207. declare function parseGeoJSON(geoJson: GeoJSON | GeoJSONCompressed, nameProperty: string): GeoJSONRegion[];
  8208. /**
  8209. * Linear mapping a value from domain to range
  8210. * @param val
  8211. * @param domain Domain extent domain[0] can be bigger than domain[1]
  8212. * @param range Range extent range[0] can be bigger than range[1]
  8213. * @param clamp Default to be false
  8214. */
  8215. declare function linearMap(val: number, domain: number[], range: number[], clamp?: boolean): number;
  8216. /**
  8217. * (1) Fix rounding error of float numbers.
  8218. * (2) Support return string to avoid scientific notation like '3.5e-7'.
  8219. */
  8220. declare function round(x: number | string, precision?: number): number;
  8221. declare function round(x: number | string, precision: number, returnStr: false): number;
  8222. declare function round(x: number | string, precision: number, returnStr: true): string;
  8223. /**
  8224. * Inplacd asc sort arr.
  8225. * The input arr will be modified.
  8226. */
  8227. declare function asc<T extends number[]>(arr: T): T;
  8228. /**
  8229. * Get precision.
  8230. */
  8231. declare function getPrecision(val: string | number): number;
  8232. /**
  8233. * Get precision with slow but safe method
  8234. */
  8235. declare function getPrecisionSafe(val: string | number): number;
  8236. /**
  8237. * Minimal dicernible data precisioin according to a single pixel.
  8238. */
  8239. declare function getPixelPrecision(dataExtent: [number, number], pixelExtent: [number, number]): number;
  8240. /**
  8241. * Get a data of given precision, assuring the sum of percentages
  8242. * in valueList is 1.
  8243. * The largest remainer method is used.
  8244. * https://en.wikipedia.org/wiki/Largest_remainder_method
  8245. *
  8246. * @param valueList a list of all data
  8247. * @param idx index of the data to be processed in valueList
  8248. * @param precision integer number showing digits of precision
  8249. * @return percent ranging from 0 to 100
  8250. */
  8251. declare function getPercentWithPrecision(valueList: number[], idx: number, precision: number): number;
  8252. declare const MAX_SAFE_INTEGER = 9007199254740991;
  8253. /**
  8254. * To 0 - 2 * PI, considering negative radian.
  8255. */
  8256. declare function remRadian(radian: number): number;
  8257. /**
  8258. * @param {type} radian
  8259. * @return {boolean}
  8260. */
  8261. declare function isRadianAroundZero(val: number): boolean;
  8262. /**
  8263. * @param value valid type: number | string | Date, otherwise return `new Date(NaN)`
  8264. * These values can be accepted:
  8265. * + An instance of Date, represent a time in its own time zone.
  8266. * + Or string in a subset of ISO 8601, only including:
  8267. * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06',
  8268. * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123',
  8269. * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00',
  8270. * all of which will be treated as local time if time zone is not specified
  8271. * (see <https://momentjs.com/>).
  8272. * + Or other string format, including (all of which will be treated as loacal time):
  8273. * '2012', '2012-3-1', '2012/3/1', '2012/03/01',
  8274. * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123'
  8275. * + a timestamp, which represent a time in UTC.
  8276. * @return date Never be null/undefined. If invalid, return `new Date(NaN)`.
  8277. */
  8278. declare function parseDate(value: unknown): Date;
  8279. /**
  8280. * Quantity of a number. e.g. 0.1, 1, 10, 100
  8281. *
  8282. * @param val
  8283. * @return
  8284. */
  8285. declare function quantity(val: number): number;
  8286. /**
  8287. * Exponent of the quantity of a number
  8288. * e.g., 1234 equals to 1.234*10^3, so quantityExponent(1234) is 3
  8289. *
  8290. * @param val non-negative value
  8291. * @return
  8292. */
  8293. declare function quantityExponent(val: number): number;
  8294. /**
  8295. * find a “nice” number approximately equal to x. Round the number if round = true,
  8296. * take ceiling if round = false. The primary observation is that the “nicest”
  8297. * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.
  8298. *
  8299. * See "Nice Numbers for Graph Labels" of Graphic Gems.
  8300. *
  8301. * @param val Non-negative value.
  8302. * @param round
  8303. * @return Niced number
  8304. */
  8305. declare function nice(val: number, round?: boolean): number;
  8306. /**
  8307. * This code was copied from "d3.js"
  8308. * <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/arrays/quantile.js>.
  8309. * See the license statement at the head of this file.
  8310. * @param ascArr
  8311. */
  8312. declare function quantile(ascArr: number[], p: number): number;
  8313. declare type IntervalItem = {
  8314. interval: [number, number];
  8315. close: [0 | 1, 0 | 1];
  8316. };
  8317. /**
  8318. * Order intervals asc, and split them when overlap.
  8319. * expect(numberUtil.reformIntervals([
  8320. * {interval: [18, 62], close: [1, 1]},
  8321. * {interval: [-Infinity, -70], close: [0, 0]},
  8322. * {interval: [-70, -26], close: [1, 1]},
  8323. * {interval: [-26, 18], close: [1, 1]},
  8324. * {interval: [62, 150], close: [1, 1]},
  8325. * {interval: [106, 150], close: [1, 1]},
  8326. * {interval: [150, Infinity], close: [0, 0]}
  8327. * ])).toEqual([
  8328. * {interval: [-Infinity, -70], close: [0, 0]},
  8329. * {interval: [-70, -26], close: [1, 1]},
  8330. * {interval: [-26, 18], close: [0, 1]},
  8331. * {interval: [18, 62], close: [0, 1]},
  8332. * {interval: [62, 150], close: [0, 1]},
  8333. * {interval: [150, Infinity], close: [0, 0]}
  8334. * ]);
  8335. * @param list, where `close` mean open or close
  8336. * of the interval, and Infinity can be used.
  8337. * @return The origin list, which has been reformed.
  8338. */
  8339. declare function reformIntervals(list: IntervalItem[]): IntervalItem[];
  8340. /**
  8341. * [Numberic is defined as]:
  8342. * `parseFloat(val) == val`
  8343. * For example:
  8344. * numeric:
  8345. * typeof number except NaN, '-123', '123', '2e3', '-2e3', '011', 'Infinity', Infinity,
  8346. * and they rounded by white-spaces or line-terminal like ' -123 \n ' (see es spec)
  8347. * not-numeric:
  8348. * null, undefined, [], {}, true, false, 'NaN', NaN, '123ab',
  8349. * empty string, string with only white-spaces or line-terminal (see es spec),
  8350. * 0x12, '0x12', '-0x12', 012, '012', '-012',
  8351. * non-string, ...
  8352. *
  8353. * @test See full test cases in `test/ut/spec/util/number.js`.
  8354. * @return Must be a typeof number. If not numeric, return NaN.
  8355. */
  8356. declare function numericToNumber(val: unknown): number;
  8357. /**
  8358. * Definition of "numeric": see `numericToNumber`.
  8359. */
  8360. declare function isNumeric(val: unknown): val is number;
  8361. declare const number_d_linearMap: typeof linearMap;
  8362. declare const number_d_round: typeof round;
  8363. declare const number_d_asc: typeof asc;
  8364. declare const number_d_getPrecision: typeof getPrecision;
  8365. declare const number_d_getPrecisionSafe: typeof getPrecisionSafe;
  8366. declare const number_d_getPixelPrecision: typeof getPixelPrecision;
  8367. declare const number_d_getPercentWithPrecision: typeof getPercentWithPrecision;
  8368. declare const number_d_MAX_SAFE_INTEGER: typeof MAX_SAFE_INTEGER;
  8369. declare const number_d_remRadian: typeof remRadian;
  8370. declare const number_d_isRadianAroundZero: typeof isRadianAroundZero;
  8371. declare const number_d_parseDate: typeof parseDate;
  8372. declare const number_d_quantity: typeof quantity;
  8373. declare const number_d_quantityExponent: typeof quantityExponent;
  8374. declare const number_d_nice: typeof nice;
  8375. declare const number_d_quantile: typeof quantile;
  8376. declare const number_d_reformIntervals: typeof reformIntervals;
  8377. declare const number_d_isNumeric: typeof isNumeric;
  8378. declare const number_d_numericToNumber: typeof numericToNumber;
  8379. declare namespace number_d {
  8380. export {
  8381. number_d_linearMap as linearMap,
  8382. number_d_round as round,
  8383. number_d_asc as asc,
  8384. number_d_getPrecision as getPrecision,
  8385. number_d_getPrecisionSafe as getPrecisionSafe,
  8386. number_d_getPixelPrecision as getPixelPrecision,
  8387. number_d_getPercentWithPrecision as getPercentWithPrecision,
  8388. number_d_MAX_SAFE_INTEGER as MAX_SAFE_INTEGER,
  8389. number_d_remRadian as remRadian,
  8390. number_d_isRadianAroundZero as isRadianAroundZero,
  8391. number_d_parseDate as parseDate,
  8392. number_d_quantity as quantity,
  8393. number_d_quantityExponent as quantityExponent,
  8394. number_d_nice as nice,
  8395. number_d_quantile as quantile,
  8396. number_d_reformIntervals as reformIntervals,
  8397. number_d_isNumeric as isNumeric,
  8398. number_d_numericToNumber as numericToNumber,
  8399. };
  8400. }
  8401. declare function format(time: unknown, template: string, isUTC: boolean, lang?: string | Model<LocaleOption>): string;
  8402. declare const time_d_format: typeof format;
  8403. declare namespace time_d {
  8404. export {
  8405. parseDate as parse,
  8406. time_d_format as format,
  8407. };
  8408. }
  8409. declare const graphic_d_extendShape: typeof extendShape;
  8410. declare const graphic_d_extendPath: typeof extendPath;
  8411. declare const graphic_d_makePath: typeof makePath;
  8412. declare const graphic_d_makeImage: typeof makeImage;
  8413. declare const graphic_d_resizePath: typeof resizePath;
  8414. declare const graphic_d_createIcon: typeof createIcon;
  8415. declare const graphic_d_updateProps: typeof updateProps;
  8416. declare const graphic_d_initProps: typeof initProps;
  8417. declare const graphic_d_getTransform: typeof getTransform;
  8418. declare const graphic_d_clipPointsByRect: typeof clipPointsByRect;
  8419. declare const graphic_d_clipRectByRect: typeof clipRectByRect;
  8420. declare const graphic_d_registerShape: typeof registerShape;
  8421. declare const graphic_d_getShapeClass: typeof getShapeClass;
  8422. type graphic_d_Group = Group;
  8423. declare const graphic_d_Group: typeof Group;
  8424. type graphic_d_Circle = Circle;
  8425. declare const graphic_d_Circle: typeof Circle;
  8426. type graphic_d_Ellipse = Ellipse;
  8427. declare const graphic_d_Ellipse: typeof Ellipse;
  8428. type graphic_d_Sector = Sector;
  8429. declare const graphic_d_Sector: typeof Sector;
  8430. type graphic_d_Ring = Ring;
  8431. declare const graphic_d_Ring: typeof Ring;
  8432. type graphic_d_Polygon = Polygon;
  8433. declare const graphic_d_Polygon: typeof Polygon;
  8434. type graphic_d_Polyline = Polyline;
  8435. declare const graphic_d_Polyline: typeof Polyline;
  8436. type graphic_d_Rect = Rect;
  8437. declare const graphic_d_Rect: typeof Rect;
  8438. type graphic_d_Line = Line;
  8439. declare const graphic_d_Line: typeof Line;
  8440. type graphic_d_BezierCurve = BezierCurve;
  8441. declare const graphic_d_BezierCurve: typeof BezierCurve;
  8442. type graphic_d_Arc = Arc;
  8443. declare const graphic_d_Arc: typeof Arc;
  8444. type graphic_d_IncrementalDisplayable = IncrementalDisplayable;
  8445. declare const graphic_d_IncrementalDisplayable: typeof IncrementalDisplayable;
  8446. type graphic_d_CompoundPath = CompoundPath;
  8447. declare const graphic_d_CompoundPath: typeof CompoundPath;
  8448. type graphic_d_LinearGradient = LinearGradient;
  8449. declare const graphic_d_LinearGradient: typeof LinearGradient;
  8450. type graphic_d_RadialGradient = RadialGradient;
  8451. declare const graphic_d_RadialGradient: typeof RadialGradient;
  8452. type graphic_d_BoundingRect = BoundingRect;
  8453. declare const graphic_d_BoundingRect: typeof BoundingRect;
  8454. declare namespace graphic_d {
  8455. export {
  8456. graphic_d_extendShape as extendShape,
  8457. graphic_d_extendPath as extendPath,
  8458. graphic_d_makePath as makePath,
  8459. graphic_d_makeImage as makeImage,
  8460. mergePath$1 as mergePath,
  8461. graphic_d_resizePath as resizePath,
  8462. graphic_d_createIcon as createIcon,
  8463. graphic_d_updateProps as updateProps,
  8464. graphic_d_initProps as initProps,
  8465. graphic_d_getTransform as getTransform,
  8466. graphic_d_clipPointsByRect as clipPointsByRect,
  8467. graphic_d_clipRectByRect as clipRectByRect,
  8468. graphic_d_registerShape as registerShape,
  8469. graphic_d_getShapeClass as getShapeClass,
  8470. graphic_d_Group as Group,
  8471. ZRImage as Image,
  8472. ZRText as Text,
  8473. graphic_d_Circle as Circle,
  8474. graphic_d_Ellipse as Ellipse,
  8475. graphic_d_Sector as Sector,
  8476. graphic_d_Ring as Ring,
  8477. graphic_d_Polygon as Polygon,
  8478. graphic_d_Polyline as Polyline,
  8479. graphic_d_Rect as Rect,
  8480. graphic_d_Line as Line,
  8481. graphic_d_BezierCurve as BezierCurve,
  8482. graphic_d_Arc as Arc,
  8483. graphic_d_IncrementalDisplayable as IncrementalDisplayable,
  8484. graphic_d_CompoundPath as CompoundPath,
  8485. graphic_d_LinearGradient as LinearGradient,
  8486. graphic_d_RadialGradient as RadialGradient,
  8487. graphic_d_BoundingRect as BoundingRect,
  8488. };
  8489. }
  8490. declare const format_d_addCommas: typeof addCommas;
  8491. declare const format_d_toCamelCase: typeof toCamelCase;
  8492. declare const format_d_encodeHTML: typeof encodeHTML;
  8493. declare const format_d_formatTpl: typeof formatTpl;
  8494. declare const format_d_getTooltipMarker: typeof getTooltipMarker;
  8495. declare const format_d_formatTime: typeof formatTime;
  8496. declare const format_d_capitalFirst: typeof capitalFirst;
  8497. declare const format_d_truncateText: typeof truncateText;
  8498. declare const format_d_getTextRect: typeof getTextRect;
  8499. declare namespace format_d {
  8500. export {
  8501. format_d_addCommas as addCommas,
  8502. format_d_toCamelCase as toCamelCase,
  8503. normalizeCssArray$1 as normalizeCssArray,
  8504. format_d_encodeHTML as encodeHTML,
  8505. format_d_formatTpl as formatTpl,
  8506. format_d_getTooltipMarker as getTooltipMarker,
  8507. format_d_formatTime as formatTime,
  8508. format_d_capitalFirst as capitalFirst,
  8509. format_d_truncateText as truncateText,
  8510. format_d_getTextRect as getTextRect,
  8511. };
  8512. }
  8513. declare const util_d$1_map: typeof map;
  8514. declare const util_d$1_each: typeof each;
  8515. declare const util_d$1_indexOf: typeof indexOf;
  8516. declare const util_d$1_inherits: typeof inherits;
  8517. declare const util_d$1_reduce: typeof reduce;
  8518. declare const util_d$1_filter: typeof filter;
  8519. declare const util_d$1_bind: typeof bind;
  8520. declare const util_d$1_curry: typeof curry;
  8521. declare const util_d$1_isArray: typeof isArray;
  8522. declare const util_d$1_isString: typeof isString;
  8523. declare const util_d$1_isObject: typeof isObject;
  8524. declare const util_d$1_isFunction: typeof isFunction;
  8525. declare const util_d$1_extend: typeof extend;
  8526. declare const util_d$1_defaults: typeof defaults;
  8527. declare const util_d$1_merge: typeof merge;
  8528. declare namespace util_d$1 {
  8529. export {
  8530. util_d$1_map as map,
  8531. util_d$1_each as each,
  8532. util_d$1_indexOf as indexOf,
  8533. util_d$1_inherits as inherits,
  8534. util_d$1_reduce as reduce,
  8535. util_d$1_filter as filter,
  8536. util_d$1_bind as bind,
  8537. util_d$1_curry as curry,
  8538. util_d$1_isArray as isArray,
  8539. util_d$1_isString as isString,
  8540. util_d$1_isObject as isObject,
  8541. util_d$1_isFunction as isFunction,
  8542. util_d$1_extend as extend,
  8543. util_d$1_defaults as defaults,
  8544. clone$2 as clone,
  8545. util_d$1_merge as merge,
  8546. };
  8547. }
  8548. declare class Browser {
  8549. firefox: boolean;
  8550. ie: boolean;
  8551. edge: boolean;
  8552. newEdge: boolean;
  8553. weChat: boolean;
  8554. version: string | number;
  8555. }
  8556. declare class Env {
  8557. browser: Browser;
  8558. node: boolean;
  8559. wxa: boolean;
  8560. worker: boolean;
  8561. svgSupported: boolean;
  8562. touchEventsSupported: boolean;
  8563. pointerEventsSupported: boolean;
  8564. domSupported: boolean;
  8565. transformSupported: boolean;
  8566. transform3dSupported: boolean;
  8567. hasGlobalWindow: boolean;
  8568. }
  8569. declare const env: Env;
  8570. declare function brushSingle(ctx: CanvasRenderingContext2D, el: Displayable): void;
  8571. declare function extendComponentModel(proto: object): ComponentModel;
  8572. declare function extendComponentView(proto: object): ChartView;
  8573. declare function extendSeriesModel(proto: object): SeriesModel;
  8574. declare function extendChartView(proto: object): ChartView;
  8575. declare type ParallelLayoutDirection = 'horizontal' | 'vertical';
  8576. interface ParallelCoordinateSystemOption extends ComponentOption, BoxLayoutOptionMixin {
  8577. mainType?: 'parallel';
  8578. layout?: ParallelLayoutDirection;
  8579. axisExpandable?: boolean;
  8580. axisExpandCenter?: number;
  8581. axisExpandCount?: number;
  8582. axisExpandWidth?: number;
  8583. axisExpandTriggerOn?: 'click' | 'mousemove';
  8584. axisExpandRate?: number;
  8585. axisExpandDebounce?: number;
  8586. axisExpandSlideTriggerArea?: [number, number, number];
  8587. axisExpandWindow?: number[];
  8588. parallelAxisDefault?: ParallelAxisOption;
  8589. }
  8590. declare type ParallelAxisOption = AxisBaseOption & {
  8591. /**
  8592. * 0, 1, 2, ...
  8593. */
  8594. dim?: number | number[];
  8595. parallelIndex?: number;
  8596. areaSelectStyle?: {
  8597. width?: number;
  8598. borderWidth?: number;
  8599. borderColor?: ZRColor;
  8600. color?: ZRColor;
  8601. opacity?: number;
  8602. };
  8603. realtime?: boolean;
  8604. };
  8605. declare type Dependencies = {
  8606. grid: XAXisOption | YAXisOption | AxisPointerOption;
  8607. polar: AngleAxisOption | RadiusAxisOption;
  8608. parallel: ParallelAxisOption;
  8609. };
  8610. declare type DependenciesKeys = keyof Dependencies & string;
  8611. declare type Arrayable<T> = T | T[];
  8612. declare type GetMainType<OptionUnion extends ComponentOption> = Exclude<OptionUnion['mainType'], undefined>;
  8613. declare type ExtractComponentOption<OptionUnion, ExtractMainType> = OptionUnion extends {
  8614. mainType?: ExtractMainType;
  8615. } ? OptionUnion : never;
  8616. declare type GetDependency<DependencyOption extends ComponentOption> = {
  8617. [key in GetMainType<DependencyOption>]?: Arrayable<ExtractComponentOption<DependencyOption, key>>;
  8618. };
  8619. declare type GetDependencies<MainType extends string> = GetDependency<Dependencies[Extract<MainType, DependenciesKeys>]>;
  8620. declare type ComposeUnitOption<OptionUnion extends ComponentOption> = CheckMainType<GetMainType<OptionUnion>> & Omit<ECBasicOption, 'baseOption' | 'options'> & {
  8621. [key in GetMainType<OptionUnion>]?: Arrayable<ExtractComponentOption<OptionUnion, key>>;
  8622. } & GetDependencies<GetMainType<OptionUnion>>;
  8623. declare type CheckMainType<OptionUnionMainType extends string> = string extends OptionUnionMainType ? never : {};
  8624. declare type ComposeOption<OptionUnion extends ComponentOption> = ComposeUnitOption<OptionUnion> & {
  8625. baseOption?: ComposeUnitOption<OptionUnion>;
  8626. options?: ComposeUnitOption<OptionUnion>[];
  8627. };
  8628. interface RadarIndicatorOption {
  8629. name?: string;
  8630. /**
  8631. * @deprecated Use `name` instead.
  8632. */
  8633. text?: string;
  8634. min?: number;
  8635. max?: number;
  8636. color?: ColorString;
  8637. axisType?: 'value' | 'log';
  8638. }
  8639. interface RadarOption extends ComponentOption, CircleLayoutOptionMixin {
  8640. mainType?: 'radar';
  8641. startAngle?: number;
  8642. shape?: 'polygon' | 'circle';
  8643. axisLine?: AxisBaseOption['axisLine'];
  8644. axisTick?: AxisBaseOption['axisTick'];
  8645. axisLabel?: AxisBaseOption['axisLabel'];
  8646. splitLine?: AxisBaseOption['splitLine'];
  8647. splitArea?: AxisBaseOption['splitArea'];
  8648. axisName?: {
  8649. show?: boolean;
  8650. formatter?: string | ((name?: string, indicatorOpt?: InnerIndicatorAxisOption) => string);
  8651. } & LabelOption;
  8652. axisNameGap?: number;
  8653. triggerEvent?: boolean;
  8654. scale?: boolean;
  8655. splitNumber?: number;
  8656. boundaryGap?: CategoryAxisBaseOption['boundaryGap'] | ValueAxisBaseOption['boundaryGap'];
  8657. indicator?: RadarIndicatorOption[];
  8658. }
  8659. declare type InnerIndicatorAxisOption = AxisBaseOption & {
  8660. showName?: boolean;
  8661. };
  8662. declare type SingleAxisPosition = 'top' | 'bottom' | 'left' | 'right';
  8663. declare type SingleAxisOption = AxisBaseOption & BoxLayoutOptionMixin & {
  8664. mainType?: 'singleAxis';
  8665. position?: SingleAxisPosition;
  8666. orient?: LayoutOrient;
  8667. };
  8668. interface CalendarMonthLabelFormatterCallbackParams {
  8669. nameMap: string;
  8670. yyyy: string;
  8671. yy: string;
  8672. /**
  8673. * Month string. With 0 prefix.
  8674. */
  8675. MM: string;
  8676. /**
  8677. * Month number
  8678. */
  8679. M: number;
  8680. }
  8681. interface CalendarYearLabelFormatterCallbackParams {
  8682. nameMap: string;
  8683. /**
  8684. * Start year
  8685. */
  8686. start: string;
  8687. /**
  8688. * End year
  8689. */
  8690. end: string;
  8691. }
  8692. interface CalendarOption extends ComponentOption, BoxLayoutOptionMixin {
  8693. mainType?: 'calendar';
  8694. cellSize?: number | 'auto' | (number | 'auto')[];
  8695. orient?: LayoutOrient;
  8696. splitLine?: {
  8697. show?: boolean;
  8698. lineStyle?: LineStyleOption;
  8699. };
  8700. itemStyle?: ItemStyleOption;
  8701. /**
  8702. * // one year
  8703. * range: 2017
  8704. * // one month
  8705. * range: '2017-02'
  8706. * // a range
  8707. * range: ['2017-01-02', '2017-02-23']
  8708. * // note: they will be identified as ['2017-01-01', '2017-02-01']
  8709. * range: ['2017-01', '2017-02']
  8710. */
  8711. range?: OptionDataValueDate | (OptionDataValueDate)[];
  8712. dayLabel?: Omit<LabelOption, 'position'> & {
  8713. /**
  8714. * First day of week.
  8715. */
  8716. firstDay?: number;
  8717. /**
  8718. * Margin between day label and axis line.
  8719. * Can be percent string of cell size.
  8720. */
  8721. margin?: number | string;
  8722. /**
  8723. * Position of week, at the beginning or end of the range.
  8724. */
  8725. position?: 'start' | 'end';
  8726. /**
  8727. * Week text content
  8728. *
  8729. * defaults to auto-detected locale by the browser or the specified locale by `echarts.init` function.
  8730. * It supports any registered locale name (case-sensitive) or customized array.
  8731. * index 0 always means Sunday.
  8732. */
  8733. nameMap?: string | string[];
  8734. };
  8735. monthLabel?: Omit<LabelOption, 'position'> & {
  8736. /**
  8737. * Margin between month label and axis line.
  8738. */
  8739. margin?: number;
  8740. /**
  8741. * Position of month label, at the beginning or end of the range.
  8742. */
  8743. position?: 'start' | 'end';
  8744. /**
  8745. * Month text content
  8746. *
  8747. * defaults to auto-detected locale by the browser or the specified locale by `echarts.init` function.
  8748. * It supports any registered locale name (case-sensitive) or customized array.
  8749. * index 0 always means Jan.
  8750. */
  8751. nameMap?: string | string[];
  8752. formatter?: string | ((params: CalendarMonthLabelFormatterCallbackParams) => string);
  8753. };
  8754. yearLabel?: Omit<LabelOption, 'position'> & {
  8755. /**
  8756. * Margin between year label and axis line.
  8757. */
  8758. margin?: number;
  8759. /**
  8760. * Position of year label, at the beginning or end of the range.
  8761. */
  8762. position?: 'top' | 'bottom' | 'left' | 'right';
  8763. formatter?: string | ((params: CalendarYearLabelFormatterCallbackParams) => string);
  8764. };
  8765. }
  8766. declare type IconStyle = ItemStyleOption & {
  8767. textFill?: LabelOption['color'];
  8768. textBackgroundColor?: LabelOption['backgroundColor'];
  8769. textPosition?: LabelOption['position'];
  8770. textAlign?: LabelOption['align'];
  8771. textBorderRadius?: LabelOption['borderRadius'];
  8772. textPadding?: LabelOption['padding'];
  8773. };
  8774. interface ToolboxFeatureOption {
  8775. show?: boolean;
  8776. title?: string | Partial<Dictionary<string>>;
  8777. icon?: string | Partial<Dictionary<string>>;
  8778. iconStyle?: IconStyle;
  8779. emphasis?: {
  8780. iconStyle?: IconStyle;
  8781. };
  8782. iconStatus?: Partial<Dictionary<DisplayState>>;
  8783. onclick?: () => void;
  8784. }
  8785. interface ToolboxTooltipFormatterParams {
  8786. componentType: 'toolbox';
  8787. name: string;
  8788. title: string;
  8789. $vars: ['name', 'title'];
  8790. }
  8791. interface ToolboxOption extends ComponentOption, BoxLayoutOptionMixin, BorderOptionMixin {
  8792. mainType?: 'toolbox';
  8793. show?: boolean;
  8794. orient?: LayoutOrient;
  8795. backgroundColor?: ZRColor;
  8796. borderRadius?: number | number[];
  8797. padding?: number | number[];
  8798. itemSize?: number;
  8799. itemGap?: number;
  8800. showTitle?: boolean;
  8801. iconStyle?: ItemStyleOption;
  8802. emphasis?: {
  8803. iconStyle?: ItemStyleOption;
  8804. };
  8805. textStyle?: LabelOption;
  8806. tooltip?: CommonTooltipOption<ToolboxTooltipFormatterParams>;
  8807. /**
  8808. * Write all supported features in the final export option.
  8809. */
  8810. feature?: Partial<Dictionary<ToolboxFeatureOption>>;
  8811. }
  8812. interface TitleOption extends ComponentOption, BoxLayoutOptionMixin, BorderOptionMixin {
  8813. mainType?: 'title';
  8814. show?: boolean;
  8815. text?: string;
  8816. /**
  8817. * Link to url
  8818. */
  8819. link?: string;
  8820. target?: 'self' | 'blank';
  8821. subtext?: string;
  8822. sublink?: string;
  8823. subtarget?: 'self' | 'blank';
  8824. textAlign?: ZRTextAlign;
  8825. textVerticalAlign?: ZRTextVerticalAlign;
  8826. /**
  8827. * @deprecated Use textVerticalAlign instead
  8828. */
  8829. textBaseline?: ZRTextVerticalAlign;
  8830. backgroundColor?: ZRColor;
  8831. /**
  8832. * Padding between text and border.
  8833. * Support to be a single number or an array.
  8834. */
  8835. padding?: number | number[];
  8836. /**
  8837. * Gap between text and subtext
  8838. */
  8839. itemGap?: number;
  8840. textStyle?: LabelOption;
  8841. subtextStyle?: LabelOption;
  8842. /**
  8843. * If trigger mouse or touch event
  8844. */
  8845. triggerEvent?: boolean;
  8846. /**
  8847. * Radius of background border.
  8848. */
  8849. borderRadius?: number | number[];
  8850. }
  8851. interface TimelineControlStyle extends ItemStyleOption {
  8852. show?: boolean;
  8853. showPlayBtn?: boolean;
  8854. showPrevBtn?: boolean;
  8855. showNextBtn?: boolean;
  8856. itemSize?: number;
  8857. itemGap?: number;
  8858. position?: 'left' | 'right' | 'top' | 'bottom';
  8859. playIcon?: string;
  8860. stopIcon?: string;
  8861. prevIcon?: string;
  8862. nextIcon?: string;
  8863. playBtnSize?: number | string;
  8864. stopBtnSize?: number | string;
  8865. nextBtnSize?: number | string;
  8866. prevBtnSize?: number | string;
  8867. }
  8868. interface TimelineCheckpointStyle extends ItemStyleOption, SymbolOptionMixin {
  8869. animation?: boolean;
  8870. animationDuration?: number;
  8871. animationEasing?: ZREasing;
  8872. }
  8873. interface TimelineLineStyleOption extends LineStyleOption {
  8874. show?: boolean;
  8875. }
  8876. interface TimelineLabelOption extends Omit<LabelOption, 'position'> {
  8877. show?: boolean;
  8878. position?: 'auto' | 'left' | 'right' | 'top' | 'bottom' | number;
  8879. interval?: 'auto' | number;
  8880. formatter?: string | ((value: string | number, index: number) => string);
  8881. }
  8882. interface TimelineDataItemOption extends SymbolOptionMixin {
  8883. value?: OptionDataValue;
  8884. itemStyle?: ItemStyleOption;
  8885. label?: TimelineLabelOption;
  8886. checkpointStyle?: TimelineCheckpointStyle;
  8887. emphasis?: {
  8888. itemStyle?: ItemStyleOption;
  8889. label?: TimelineLabelOption;
  8890. checkpointStyle?: TimelineCheckpointStyle;
  8891. };
  8892. progress?: {
  8893. lineStyle?: TimelineLineStyleOption;
  8894. itemStyle?: ItemStyleOption;
  8895. label?: TimelineLabelOption;
  8896. };
  8897. tooltip?: boolean;
  8898. }
  8899. interface TimelineOption extends ComponentOption, BoxLayoutOptionMixin, SymbolOptionMixin {
  8900. mainType?: 'timeline';
  8901. backgroundColor?: ZRColor;
  8902. borderColor?: ColorString;
  8903. borderWidth?: number;
  8904. tooltip?: CommonTooltipOption<CallbackDataParams> & {
  8905. trigger?: 'item';
  8906. };
  8907. show?: boolean;
  8908. axisType?: 'category' | 'time' | 'value';
  8909. currentIndex?: number;
  8910. autoPlay?: boolean;
  8911. rewind?: boolean;
  8912. loop?: boolean;
  8913. playInterval?: number;
  8914. realtime?: boolean;
  8915. controlPosition?: 'left' | 'right' | 'top' | 'bottom';
  8916. padding?: number | number[];
  8917. orient?: LayoutOrient;
  8918. inverse?: boolean;
  8919. replaceMerge?: GlobalModelSetOptionOpts['replaceMerge'];
  8920. lineStyle?: TimelineLineStyleOption;
  8921. itemStyle?: ItemStyleOption;
  8922. checkpointStyle?: TimelineCheckpointStyle;
  8923. controlStyle?: TimelineControlStyle;
  8924. label?: TimelineLabelOption;
  8925. emphasis?: {
  8926. lineStyle?: TimelineLineStyleOption;
  8927. itemStyle?: ItemStyleOption;
  8928. checkpointStyle?: TimelineCheckpointStyle;
  8929. controlStyle?: TimelineControlStyle;
  8930. label?: TimelineLabelOption;
  8931. };
  8932. progress?: {
  8933. lineStyle?: TimelineLineStyleOption;
  8934. itemStyle?: ItemStyleOption;
  8935. label?: TimelineLabelOption;
  8936. };
  8937. data?: (OptionDataValue | TimelineDataItemOption)[];
  8938. }
  8939. interface SliderTimelineOption extends TimelineOption {
  8940. }
  8941. interface ScrollableLegendOption extends LegendOption {
  8942. scrollDataIndex?: number;
  8943. /**
  8944. * Gap between each page button
  8945. */
  8946. pageButtonItemGap?: number;
  8947. /**
  8948. * Gap between page buttons group and legend items.
  8949. */
  8950. pageButtonGap?: number;
  8951. pageButtonPosition?: 'start' | 'end';
  8952. pageFormatter?: string | ((param: {
  8953. current: number;
  8954. total: number;
  8955. }) => string);
  8956. pageIcons?: {
  8957. horizontal?: string[];
  8958. vertical?: string[];
  8959. };
  8960. pageIconColor?: ZRColor;
  8961. pageIconInactiveColor?: ZRColor;
  8962. pageIconSize?: number;
  8963. pageTextStyle?: LabelOption;
  8964. animationDurationUpdate?: number;
  8965. }
  8966. interface DataZoomOption extends ComponentOption {
  8967. mainType?: 'dataZoom';
  8968. /**
  8969. * Default auto by axisIndex
  8970. */
  8971. orient?: LayoutOrient;
  8972. /**
  8973. * Default the first horizontal category axis.
  8974. */
  8975. xAxisIndex?: number | number[];
  8976. xAxisId?: string | string[];
  8977. /**
  8978. * Default the first vertical category axis.
  8979. */
  8980. yAxisIndex?: number | number[];
  8981. yAxisId?: string | string[];
  8982. radiusAxisIndex?: number | number[];
  8983. radiusAxisId?: string | string[];
  8984. angleAxisIndex?: number | number[];
  8985. angleAxisId?: string | string[];
  8986. singleAxisIndex?: number | number[];
  8987. singleAxisId?: string | string[];
  8988. /**
  8989. * Possible values: 'filter' or 'empty' or 'weakFilter'.
  8990. * 'filter': data items which are out of window will be removed. This option is
  8991. * applicable when filtering outliers. For each data item, it will be
  8992. * filtered if one of the relevant dimensions is out of the window.
  8993. * 'weakFilter': data items which are out of window will be removed. This option
  8994. * is applicable when filtering outliers. For each data item, it will be
  8995. * filtered only if all of the relevant dimensions are out of the same
  8996. * side of the window.
  8997. * 'empty': data items which are out of window will be set to empty.
  8998. * This option is applicable when user should not neglect
  8999. * that there are some data items out of window.
  9000. * 'none': Do not filter.
  9001. * Taking line chart as an example, line will be broken in
  9002. * the filtered points when filterModel is set to 'empty', but
  9003. * be connected when set to 'filter'.
  9004. */
  9005. filterMode?: 'filter' | 'weakFilter' | 'empty' | 'none';
  9006. /**
  9007. * Dispatch action by the fixed rate, avoid frequency.
  9008. * default 100. Do not throttle when use null/undefined.
  9009. * If animation === true and animationDurationUpdate > 0,
  9010. * default value is 100, otherwise 20.
  9011. */
  9012. throttle?: number | null | undefined;
  9013. /**
  9014. * Start percent. 0 ~ 100
  9015. */
  9016. start?: number;
  9017. /**
  9018. * End percent. 0 ~ 100
  9019. */
  9020. end?: number;
  9021. /**
  9022. * Start value. If startValue specified, start is ignored
  9023. */
  9024. startValue?: number | string | Date;
  9025. /**
  9026. * End value. If endValue specified, end is ignored.
  9027. */
  9028. endValue?: number | string | Date;
  9029. /**
  9030. * Min span percent, 0 - 100
  9031. * The range of dataZoom can not be smaller than that.
  9032. */
  9033. minSpan?: number;
  9034. /**
  9035. * Max span percent, 0 - 100
  9036. * The range of dataZoom can not be larger than that.
  9037. */
  9038. maxSpan?: number;
  9039. minValueSpan?: number;
  9040. maxValueSpan?: number;
  9041. rangeMode?: ['value' | 'percent', 'value' | 'percent'];
  9042. realtime?: boolean;
  9043. textStyle?: LabelOption;
  9044. }
  9045. interface SliderDataZoomOption extends DataZoomOption, BoxLayoutOptionMixin {
  9046. show?: boolean;
  9047. /**
  9048. * Slider dataZoom don't support textStyle
  9049. */
  9050. /**
  9051. * Background of slider zoom component
  9052. */
  9053. backgroundColor?: ZRColor;
  9054. /**
  9055. * @deprecated Use borderColor instead
  9056. */
  9057. /**
  9058. * border color of the box. For compatibility,
  9059. * if dataBackgroundColor is set, borderColor
  9060. * is ignored.
  9061. */
  9062. borderColor?: ZRColor;
  9063. /**
  9064. * Border radius of the box.
  9065. */
  9066. borderRadius?: number | number[];
  9067. dataBackground?: {
  9068. lineStyle?: LineStyleOption;
  9069. areaStyle?: AreaStyleOption;
  9070. };
  9071. selectedDataBackground?: {
  9072. lineStyle?: LineStyleOption;
  9073. areaStyle?: AreaStyleOption;
  9074. };
  9075. /**
  9076. * Color of selected area.
  9077. */
  9078. fillerColor?: ZRColor;
  9079. /**
  9080. * @deprecated Use handleStyle instead
  9081. */
  9082. handleIcon?: string;
  9083. /**
  9084. * number: height of icon. width will be calculated according to the aspect of icon.
  9085. * string: percent of the slider height. width will be calculated according to the aspect of icon.
  9086. */
  9087. handleSize?: string | number;
  9088. handleStyle?: ItemStyleOption;
  9089. /**
  9090. * Icon to indicate it is a draggable panel.
  9091. */
  9092. moveHandleIcon?: string;
  9093. moveHandleStyle?: ItemStyleOption;
  9094. /**
  9095. * Height of handle rect. Can be a percent string relative to the slider height.
  9096. */
  9097. moveHandleSize?: number;
  9098. labelPrecision?: number | 'auto';
  9099. labelFormatter?: string | ((value: number, valueStr: string) => string);
  9100. showDetail?: boolean;
  9101. showDataShadow?: 'auto' | boolean;
  9102. zoomLock?: boolean;
  9103. textStyle?: LabelOption;
  9104. /**
  9105. * If eable select by brushing
  9106. */
  9107. brushSelect?: boolean;
  9108. brushStyle?: ItemStyleOption;
  9109. emphasis?: {
  9110. handleStyle?: ItemStyleOption;
  9111. moveHandleStyle?: ItemStyleOption;
  9112. };
  9113. }
  9114. interface InsideDataZoomOption extends DataZoomOption {
  9115. /**
  9116. * Whether disable this inside zoom.
  9117. */
  9118. disabled?: boolean;
  9119. /**
  9120. * Whether disable zoom but only pan.
  9121. */
  9122. zoomLock?: boolean;
  9123. zoomOnMouseWheel?: boolean | 'shift' | 'ctrl' | 'alt';
  9124. moveOnMouseMove?: boolean | 'shift' | 'ctrl' | 'alt';
  9125. moveOnMouseWheel?: boolean | 'shift' | 'ctrl' | 'alt';
  9126. preventDefaultMouseMove?: boolean;
  9127. /**
  9128. * Inside dataZoom don't support textStyle
  9129. */
  9130. textStyle?: never;
  9131. }
  9132. interface ContinousVisualMapOption extends VisualMapOption {
  9133. align?: 'auto' | 'left' | 'right' | 'top' | 'bottom';
  9134. /**
  9135. * This prop effect default component type determine
  9136. * @see echarts/component/visualMap/typeDefaulter.
  9137. */
  9138. calculable?: boolean;
  9139. /**
  9140. * selected range. In default case `range` is [min, max]
  9141. * and can auto change along with modification of min max,
  9142. * util user specifid a range.
  9143. */
  9144. range?: number[];
  9145. /**
  9146. * Whether to enable hover highlight.
  9147. */
  9148. hoverLink?: boolean;
  9149. /**
  9150. * The extent of hovered data.
  9151. */
  9152. hoverLinkDataSize?: number;
  9153. /**
  9154. * Whether trigger hoverLink when hover handle.
  9155. * If not specified, follow the value of `realtime`.
  9156. */
  9157. hoverLinkOnHandle?: boolean;
  9158. handleIcon?: string;
  9159. handleSize?: string | number;
  9160. handleStyle?: ItemStyleOption;
  9161. indicatorIcon?: string;
  9162. indicatorSize?: string | number;
  9163. indicatorStyle?: ItemStyleOption;
  9164. emphasis?: {
  9165. handleStyle?: ItemStyleOption;
  9166. };
  9167. }
  9168. interface VisualPiece extends VisualOptionPiecewise {
  9169. min?: number;
  9170. max?: number;
  9171. lt?: number;
  9172. gt?: number;
  9173. lte?: number;
  9174. gte?: number;
  9175. value?: number;
  9176. label?: string;
  9177. }
  9178. /**
  9179. * Order Rule:
  9180. *
  9181. * option.categories / option.pieces / option.text / option.selected:
  9182. * If !option.inverse,
  9183. * Order when vertical: ['top', ..., 'bottom'].
  9184. * Order when horizontal: ['left', ..., 'right'].
  9185. * If option.inverse, the meaning of
  9186. * the order should be reversed.
  9187. *
  9188. * this._pieceList:
  9189. * The order is always [low, ..., high].
  9190. *
  9191. * Mapping from location to low-high:
  9192. * If !option.inverse
  9193. * When vertical, top is high.
  9194. * When horizontal, right is high.
  9195. * If option.inverse, reverse.
  9196. */
  9197. interface PiecewiseVisualMapOption extends VisualMapOption {
  9198. align?: 'auto' | 'left' | 'right';
  9199. minOpen?: boolean;
  9200. maxOpen?: boolean;
  9201. /**
  9202. * When put the controller vertically, it is the length of
  9203. * horizontal side of each item. Otherwise, vertical side.
  9204. * When put the controller vertically, it is the length of
  9205. * vertical side of each item. Otherwise, horizontal side.
  9206. */
  9207. itemWidth?: number;
  9208. itemHeight?: number;
  9209. itemSymbol?: string;
  9210. pieces?: VisualPiece[];
  9211. /**
  9212. * category names, like: ['some1', 'some2', 'some3'].
  9213. * Attr min/max are ignored when categories set. See "Order Rule"
  9214. */
  9215. categories?: string[];
  9216. /**
  9217. * If set to 5, auto split five pieces equally.
  9218. * If set to 0 and component type not set, component type will be
  9219. * determined as "continuous". (It is less reasonable but for ec2
  9220. * compatibility, see echarts/component/visualMap/typeDefaulter)
  9221. */
  9222. splitNumber?: number;
  9223. /**
  9224. * Object. If not specified, means selected. When pieces and splitNumber: {'0': true, '5': true}
  9225. * When categories: {'cate1': false, 'cate3': true} When selected === false, means all unselected.
  9226. */
  9227. selected?: Dictionary<boolean>;
  9228. selectedMode?: 'multiple' | 'single' | boolean;
  9229. /**
  9230. * By default, when text is used, label will hide (the logic
  9231. * is remained for compatibility reason)
  9232. */
  9233. showLabel?: boolean;
  9234. itemGap?: number;
  9235. hoverLink?: boolean;
  9236. }
  9237. declare type MarkerStatisticType = 'average' | 'min' | 'max' | 'median';
  9238. /**
  9239. * Option to specify where to put the marker.
  9240. */
  9241. interface MarkerPositionOption {
  9242. x?: number | string;
  9243. y?: number | string;
  9244. /**
  9245. * Coord on any coordinate system
  9246. */
  9247. coord?: (ScaleDataValue | MarkerStatisticType)[];
  9248. xAxis?: ScaleDataValue;
  9249. yAxis?: ScaleDataValue;
  9250. radiusAxis?: ScaleDataValue;
  9251. angleAxis?: ScaleDataValue;
  9252. type?: MarkerStatisticType;
  9253. /**
  9254. * When using statistic method with type.
  9255. * valueIndex and valueDim can be specify which dim the statistic is used on.
  9256. */
  9257. valueIndex?: number;
  9258. valueDim?: string;
  9259. /**
  9260. * Value to be displayed as label. Totally optional
  9261. */
  9262. value?: string | number;
  9263. }
  9264. interface MarkerOption extends ComponentOption, AnimationOptionMixin {
  9265. silent?: boolean;
  9266. data?: unknown[];
  9267. tooltip?: CommonTooltipOption<unknown> & {
  9268. trigger?: 'item' | 'axis' | boolean | 'none';
  9269. };
  9270. }
  9271. interface MarkLineStateOption {
  9272. lineStyle?: LineStyleOption;
  9273. /**
  9274. * itemStyle for symbol
  9275. */
  9276. itemStyle?: ItemStyleOption;
  9277. label?: SeriesLineLabelOption;
  9278. }
  9279. interface MarkLineDataItemOptionBase extends MarkLineStateOption, StatesOptionMixin<MarkLineStateOption, StatesMixinBase> {
  9280. name?: string;
  9281. }
  9282. interface MarkLine1DDataItemOption extends MarkLineDataItemOptionBase {
  9283. xAxis?: number | string;
  9284. yAxis?: number | string;
  9285. type?: MarkerStatisticType;
  9286. /**
  9287. * When using statistic method with type.
  9288. * valueIndex and valueDim can be specify which dim the statistic is used on.
  9289. */
  9290. valueIndex?: number;
  9291. valueDim?: string;
  9292. /**
  9293. * Symbol for both two ends
  9294. */
  9295. symbol?: string[] | string;
  9296. symbolSize?: number[] | number;
  9297. symbolRotate?: number[] | number;
  9298. symbolOffset?: number | string | (number | string)[];
  9299. }
  9300. interface MarkLine2DDataItemDimOption extends MarkLineDataItemOptionBase, SymbolOptionMixin, MarkerPositionOption {
  9301. }
  9302. declare type MarkLine2DDataItemOption = [
  9303. MarkLine2DDataItemDimOption,
  9304. MarkLine2DDataItemDimOption
  9305. ];
  9306. interface MarkLineOption extends MarkerOption, MarkLineStateOption, StatesOptionMixin<MarkLineStateOption, StatesMixinBase> {
  9307. mainType?: 'markLine';
  9308. symbol?: string[] | string;
  9309. symbolSize?: number[] | number;
  9310. symbolRotate?: number[] | number;
  9311. symbolOffset?: number | string | (number | string)[];
  9312. /**
  9313. * Precision used on statistic method
  9314. */
  9315. precision?: number;
  9316. data?: (MarkLine1DDataItemOption | MarkLine2DDataItemOption)[];
  9317. }
  9318. interface MarkPointStateOption {
  9319. itemStyle?: ItemStyleOption;
  9320. label?: SeriesLabelOption;
  9321. }
  9322. interface MarkPointDataItemOption extends MarkPointStateOption, StatesOptionMixin<MarkPointStateOption, StatesMixinBase>, SymbolOptionMixin<CallbackDataParams>, MarkerPositionOption {
  9323. name: string;
  9324. }
  9325. interface MarkPointOption extends MarkerOption, SymbolOptionMixin<CallbackDataParams>, StatesOptionMixin<MarkPointStateOption, StatesMixinBase>, MarkPointStateOption {
  9326. mainType?: 'markPoint';
  9327. precision?: number;
  9328. data?: MarkPointDataItemOption[];
  9329. }
  9330. interface MarkAreaStateOption {
  9331. itemStyle?: ItemStyleOption;
  9332. label?: SeriesLabelOption;
  9333. }
  9334. interface MarkAreaDataItemOptionBase extends MarkAreaStateOption, StatesOptionMixin<MarkAreaStateOption, StatesMixinBase> {
  9335. name?: string;
  9336. }
  9337. interface MarkArea1DDataItemOption extends MarkAreaDataItemOptionBase {
  9338. xAxis?: number;
  9339. yAxis?: number;
  9340. type?: MarkerStatisticType;
  9341. valueIndex?: number;
  9342. valueDim?: string;
  9343. }
  9344. interface MarkArea2DDataItemDimOption extends MarkAreaDataItemOptionBase, MarkerPositionOption {
  9345. }
  9346. declare type MarkArea2DDataItemOption = [
  9347. MarkArea2DDataItemDimOption,
  9348. MarkArea2DDataItemDimOption
  9349. ];
  9350. interface MarkAreaOption extends MarkerOption, MarkAreaStateOption, StatesOptionMixin<MarkAreaStateOption, StatesMixinBase> {
  9351. mainType?: 'markArea';
  9352. precision?: number;
  9353. data?: (MarkArea1DDataItemOption | MarkArea2DDataItemOption)[];
  9354. }
  9355. declare type LineDataValue = OptionDataValue | OptionDataValue[];
  9356. interface LineStateOptionMixin {
  9357. emphasis?: {
  9358. focus?: DefaultEmphasisFocus;
  9359. scale?: boolean | number;
  9360. };
  9361. }
  9362. interface LineStateOption<TCbParams = never> {
  9363. itemStyle?: ItemStyleOption<TCbParams>;
  9364. label?: SeriesLabelOption;
  9365. endLabel?: LineEndLabelOption;
  9366. }
  9367. interface LineDataItemOption extends SymbolOptionMixin, LineStateOption, StatesOptionMixin<LineStateOption, LineStateOptionMixin> {
  9368. name?: string;
  9369. value?: LineDataValue;
  9370. }
  9371. interface LineEndLabelOption extends SeriesLabelOption {
  9372. valueAnimation?: boolean;
  9373. }
  9374. interface LineSeriesOption extends SeriesOption<LineStateOption<CallbackDataParams>, LineStateOptionMixin & {
  9375. emphasis?: {
  9376. lineStyle?: Omit<LineStyleOption, 'width'> & {
  9377. width?: LineStyleOption['width'] | 'bolder';
  9378. };
  9379. areaStyle?: AreaStyleOption;
  9380. };
  9381. blur?: {
  9382. lineStyle?: LineStyleOption;
  9383. areaStyle?: AreaStyleOption;
  9384. };
  9385. }>, LineStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesStackOptionMixin, SeriesSamplingOptionMixin, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
  9386. type?: 'line';
  9387. coordinateSystem?: 'cartesian2d' | 'polar';
  9388. clip?: boolean;
  9389. label?: SeriesLabelOption;
  9390. endLabel?: LineEndLabelOption;
  9391. lineStyle?: LineStyleOption;
  9392. areaStyle?: AreaStyleOption & {
  9393. origin?: 'auto' | 'start' | 'end' | number;
  9394. };
  9395. step?: false | 'start' | 'end' | 'middle';
  9396. smooth?: boolean | number;
  9397. smoothMonotone?: 'x' | 'y' | 'none';
  9398. connectNulls?: boolean;
  9399. showSymbol?: boolean;
  9400. showAllSymbol?: 'auto' | boolean;
  9401. data?: (LineDataValue | LineDataItemOption)[];
  9402. triggerLineEvent?: boolean;
  9403. }
  9404. interface ScatterStateOption<TCbParams = never> {
  9405. itemStyle?: ItemStyleOption<TCbParams>;
  9406. label?: SeriesLabelOption;
  9407. }
  9408. interface ScatterStatesOptionMixin {
  9409. emphasis?: {
  9410. focus?: DefaultEmphasisFocus;
  9411. scale?: boolean | number;
  9412. };
  9413. }
  9414. interface ScatterDataItemOption extends SymbolOptionMixin, ScatterStateOption, StatesOptionMixin<ScatterStateOption, ScatterStatesOptionMixin>, OptionDataItemObject<OptionDataValue> {
  9415. }
  9416. interface ScatterSeriesOption extends SeriesOption<ScatterStateOption<CallbackDataParams>, ScatterStatesOptionMixin>, ScatterStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesOnGeoOptionMixin, SeriesOnSingleOptionMixin, SeriesLargeOptionMixin, SeriesStackOptionMixin, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
  9417. type?: 'scatter';
  9418. coordinateSystem?: string;
  9419. cursor?: string;
  9420. clip?: boolean;
  9421. data?: (ScatterDataItemOption | OptionDataValue | OptionDataValue[])[] | ArrayLike<number>;
  9422. }
  9423. interface PieItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
  9424. borderRadius?: (number | string)[] | number | string;
  9425. }
  9426. interface PieCallbackDataParams extends CallbackDataParams {
  9427. percent: number;
  9428. }
  9429. interface PieStateOption<TCbParams = never> {
  9430. itemStyle?: PieItemStyleOption<TCbParams>;
  9431. label?: PieLabelOption;
  9432. labelLine?: PieLabelLineOption;
  9433. }
  9434. interface PieLabelOption extends Omit<SeriesLabelOption, 'rotate' | 'position'> {
  9435. rotate?: number | boolean | 'radial' | 'tangential';
  9436. alignTo?: 'none' | 'labelLine' | 'edge';
  9437. edgeDistance?: string | number;
  9438. /**
  9439. * @deprecated Use `edgeDistance` instead
  9440. */
  9441. margin?: string | number;
  9442. bleedMargin?: number;
  9443. distanceToLabelLine?: number;
  9444. position?: SeriesLabelOption['position'] | 'outer' | 'inner' | 'center' | 'outside';
  9445. }
  9446. interface PieLabelLineOption extends LabelLineOption {
  9447. /**
  9448. * Max angle between labelLine and surface normal.
  9449. * 0 - 180
  9450. */
  9451. maxSurfaceAngle?: number;
  9452. }
  9453. interface ExtraStateOption {
  9454. emphasis?: {
  9455. focus?: DefaultEmphasisFocus;
  9456. scale?: boolean;
  9457. scaleSize?: number;
  9458. };
  9459. }
  9460. interface PieDataItemOption extends OptionDataItemObject<OptionDataValueNumeric>, PieStateOption, StatesOptionMixin<PieStateOption, ExtraStateOption> {
  9461. cursor?: string;
  9462. }
  9463. interface PieSeriesOption extends Omit<SeriesOption<PieStateOption<PieCallbackDataParams>, ExtraStateOption>, 'labelLine'>, PieStateOption<PieCallbackDataParams>, CircleLayoutOptionMixin, BoxLayoutOptionMixin, SeriesEncodeOptionMixin {
  9464. type?: 'pie';
  9465. roseType?: 'radius' | 'area';
  9466. clockwise?: boolean;
  9467. startAngle?: number;
  9468. minAngle?: number;
  9469. minShowLabelAngle?: number;
  9470. selectedOffset?: number;
  9471. avoidLabelOverlap?: boolean;
  9472. percentPrecision?: number;
  9473. stillShowZeroSum?: boolean;
  9474. animationType?: 'expansion' | 'scale';
  9475. animationTypeUpdate?: 'transition' | 'expansion';
  9476. showEmptyCircle?: boolean;
  9477. emptyCircleStyle?: PieItemStyleOption;
  9478. data?: (OptionDataValueNumeric | OptionDataValueNumeric[] | PieDataItemOption)[];
  9479. }
  9480. declare type RadarSeriesDataValue = OptionDataValue[];
  9481. interface RadarStatesMixin {
  9482. emphasis?: DefaultStatesMixinEmphasis;
  9483. }
  9484. interface RadarSeriesStateOption<TCbParams = never> {
  9485. lineStyle?: LineStyleOption;
  9486. areaStyle?: AreaStyleOption;
  9487. label?: SeriesLabelOption;
  9488. itemStyle?: ItemStyleOption<TCbParams>;
  9489. }
  9490. interface RadarSeriesDataItemOption extends SymbolOptionMixin, RadarSeriesStateOption<CallbackDataParams>, StatesOptionMixin<RadarSeriesStateOption<CallbackDataParams>, RadarStatesMixin>, OptionDataItemObject<RadarSeriesDataValue> {
  9491. }
  9492. interface RadarSeriesOption extends SeriesOption<RadarSeriesStateOption, RadarStatesMixin>, RadarSeriesStateOption, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
  9493. type?: 'radar';
  9494. coordinateSystem?: 'radar';
  9495. radarIndex?: number;
  9496. radarId?: string;
  9497. data?: (RadarSeriesDataItemOption | RadarSeriesDataValue)[];
  9498. }
  9499. interface CurveLineStyleOption extends LineStyleOption {
  9500. curveness?: number;
  9501. }
  9502. interface TreeSeriesStateOption<TCbParams = never> {
  9503. itemStyle?: ItemStyleOption<TCbParams>;
  9504. /**
  9505. * Line style of the edge between node and it's parent.
  9506. */
  9507. lineStyle?: CurveLineStyleOption;
  9508. label?: SeriesLabelOption;
  9509. }
  9510. interface TreeStatesMixin {
  9511. emphasis?: {
  9512. focus?: DefaultEmphasisFocus | 'ancestor' | 'descendant' | 'relative';
  9513. scale?: boolean;
  9514. };
  9515. }
  9516. interface TreeSeriesNodeItemOption extends SymbolOptionMixin<CallbackDataParams>, TreeSeriesStateOption<CallbackDataParams>, StatesOptionMixin<TreeSeriesStateOption<CallbackDataParams>, TreeStatesMixin>, OptionDataItemObject<OptionDataValue> {
  9517. children?: TreeSeriesNodeItemOption[];
  9518. collapsed?: boolean;
  9519. link?: string;
  9520. target?: string;
  9521. }
  9522. /**
  9523. * Configuration of leaves nodes.
  9524. */
  9525. interface TreeSeriesLeavesOption extends TreeSeriesStateOption, StatesOptionMixin<TreeSeriesStateOption, TreeStatesMixin> {
  9526. }
  9527. interface TreeSeriesOption extends SeriesOption<TreeSeriesStateOption, TreeStatesMixin>, TreeSeriesStateOption, SymbolOptionMixin, BoxLayoutOptionMixin, RoamOptionMixin {
  9528. type?: 'tree';
  9529. layout?: 'orthogonal' | 'radial';
  9530. edgeShape?: 'polyline' | 'curve';
  9531. /**
  9532. * Available when edgeShape is polyline
  9533. */
  9534. edgeForkPosition?: string | number;
  9535. nodeScaleRatio?: number;
  9536. /**
  9537. * The orient of orthoginal layout, can be setted to 'LR', 'TB', 'RL', 'BT'.
  9538. * and the backward compatibility configuration 'horizontal = LR', 'vertical = TB'.
  9539. */
  9540. orient?: 'LR' | 'TB' | 'RL' | 'BT' | 'horizontal' | 'vertical';
  9541. expandAndCollapse?: boolean;
  9542. /**
  9543. * The initial expanded depth of tree
  9544. */
  9545. initialTreeDepth?: number;
  9546. leaves?: TreeSeriesLeavesOption;
  9547. data?: TreeSeriesNodeItemOption[];
  9548. }
  9549. declare type TreemapSeriesDataValue = number | number[];
  9550. interface BreadcrumbItemStyleOption extends ItemStyleOption {
  9551. textStyle?: LabelOption;
  9552. }
  9553. interface TreemapSeriesLabelOption extends SeriesLabelOption {
  9554. formatter?: string | ((params: CallbackDataParams) => string);
  9555. }
  9556. interface TreemapSeriesItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
  9557. borderRadius?: number | number[];
  9558. colorAlpha?: number;
  9559. colorSaturation?: number;
  9560. borderColorSaturation?: number;
  9561. gapWidth?: number;
  9562. }
  9563. interface TreePathInfo {
  9564. name: string;
  9565. dataIndex: number;
  9566. value: TreemapSeriesDataValue;
  9567. }
  9568. interface TreemapSeriesCallbackDataParams extends CallbackDataParams {
  9569. /**
  9570. * @deprecated
  9571. */
  9572. treePathInfo?: TreePathInfo[];
  9573. treeAncestors?: TreePathInfo[];
  9574. }
  9575. interface ExtraStateOption$1 {
  9576. emphasis?: {
  9577. focus?: DefaultEmphasisFocus | 'descendant' | 'ancestor';
  9578. };
  9579. }
  9580. interface TreemapStateOption<TCbParams = never> {
  9581. itemStyle?: TreemapSeriesItemStyleOption<TCbParams>;
  9582. label?: TreemapSeriesLabelOption;
  9583. upperLabel?: TreemapSeriesLabelOption;
  9584. }
  9585. interface TreemapSeriesVisualOption {
  9586. /**
  9587. * Which dimension will be applied with the visual properties.
  9588. */
  9589. visualDimension?: number | string;
  9590. /**
  9591. * @deprecated Use colorBy instead
  9592. */
  9593. colorMappingBy?: 'value' | 'index' | 'id';
  9594. visualMin?: number;
  9595. visualMax?: number;
  9596. colorAlpha?: number[] | 'none';
  9597. colorSaturation?: number[] | 'none';
  9598. /**
  9599. * A node will not be shown when its area size is smaller than this value (unit: px square).
  9600. */
  9601. visibleMin?: number;
  9602. /**
  9603. * Children will not be shown when area size of a node is smaller than this value (unit: px square).
  9604. */
  9605. childrenVisibleMin?: number;
  9606. }
  9607. interface TreemapSeriesLevelOption extends TreemapSeriesVisualOption, TreemapStateOption, StatesOptionMixin<TreemapStateOption, ExtraStateOption$1> {
  9608. color?: ColorString[] | 'none';
  9609. decal?: DecalObject[] | 'none';
  9610. }
  9611. interface TreemapSeriesNodeItemOption extends TreemapSeriesVisualOption, TreemapStateOption, StatesOptionMixin<TreemapStateOption, ExtraStateOption$1> {
  9612. id?: OptionId;
  9613. name?: OptionName;
  9614. value?: TreemapSeriesDataValue;
  9615. children?: TreemapSeriesNodeItemOption[];
  9616. color?: ColorString[] | 'none';
  9617. decal?: DecalObject[] | 'none';
  9618. }
  9619. interface TreemapSeriesOption extends SeriesOption<TreemapStateOption<TreemapSeriesCallbackDataParams>, ExtraStateOption$1>, TreemapStateOption<TreemapSeriesCallbackDataParams>, BoxLayoutOptionMixin, RoamOptionMixin, TreemapSeriesVisualOption {
  9620. type?: 'treemap';
  9621. /**
  9622. * configuration in echarts2
  9623. * @deprecated
  9624. */
  9625. size?: (number | string)[];
  9626. /**
  9627. * If sort in desc order.
  9628. * Default to be desc. asc has strange effect
  9629. */
  9630. sort?: boolean | 'asc' | 'desc';
  9631. /**
  9632. * Size of clipped window when zooming. 'origin' or 'fullscreen'
  9633. */
  9634. clipWindow?: 'origin' | 'fullscreen';
  9635. squareRatio?: number;
  9636. /**
  9637. * Nodes on depth from root are regarded as leaves.
  9638. * Count from zero (zero represents only view root).
  9639. */
  9640. leafDepth?: number;
  9641. drillDownIcon?: string;
  9642. /**
  9643. * Be effective when using zoomToNode. Specify the proportion of the
  9644. * target node area in the view area.
  9645. */
  9646. zoomToNodeRatio?: number;
  9647. /**
  9648. * Leaf node click behaviour: 'zoomToNode', 'link', false.
  9649. * If leafDepth is set and clicking a node which has children but
  9650. * be on left depth, the behaviour would be changing root. Otherwise
  9651. * use behavious defined above.
  9652. */
  9653. nodeClick?: 'zoomToNode' | 'link' | false;
  9654. breadcrumb?: BoxLayoutOptionMixin & {
  9655. show?: boolean;
  9656. height?: number;
  9657. emptyItemWidth?: number;
  9658. itemStyle?: BreadcrumbItemStyleOption;
  9659. emphasis?: {
  9660. disabled?: boolean;
  9661. focus?: DefaultEmphasisFocus;
  9662. blurScope?: BlurScope;
  9663. itemStyle?: BreadcrumbItemStyleOption;
  9664. };
  9665. };
  9666. levels?: TreemapSeriesLevelOption[];
  9667. data?: TreemapSeriesNodeItemOption[];
  9668. }
  9669. declare type GraphDataValue = OptionDataValue | OptionDataValue[];
  9670. interface GraphEdgeLineStyleOption extends LineStyleOption {
  9671. curveness?: number;
  9672. }
  9673. interface GraphNodeStateOption<TCbParams = never> {
  9674. itemStyle?: ItemStyleOption<TCbParams>;
  9675. label?: SeriesLabelOption;
  9676. }
  9677. interface ExtraEmphasisState {
  9678. focus?: DefaultEmphasisFocus | 'adjacency';
  9679. }
  9680. interface GraphNodeStatesMixin {
  9681. emphasis?: ExtraEmphasisState;
  9682. }
  9683. interface GraphEdgeStatesMixin {
  9684. emphasis?: ExtraEmphasisState;
  9685. }
  9686. interface GraphNodeItemOption extends SymbolOptionMixin, GraphNodeStateOption, GraphNodeStateOption, StatesOptionMixin<GraphNodeStateOption, GraphNodeStatesMixin> {
  9687. id?: string;
  9688. name?: string;
  9689. value?: GraphDataValue;
  9690. /**
  9691. * Fixed x position
  9692. */
  9693. x?: number;
  9694. /**
  9695. * Fixed y position
  9696. */
  9697. y?: number;
  9698. /**
  9699. * If this node is fixed during force layout.
  9700. */
  9701. fixed?: boolean;
  9702. /**
  9703. * Index or name of category
  9704. */
  9705. category?: number | string;
  9706. draggable?: boolean;
  9707. cursor?: string;
  9708. }
  9709. interface GraphEdgeStateOption {
  9710. lineStyle?: GraphEdgeLineStyleOption;
  9711. label?: SeriesLineLabelOption;
  9712. }
  9713. interface GraphEdgeItemOption extends GraphEdgeStateOption, StatesOptionMixin<GraphEdgeStateOption, GraphEdgeStatesMixin>, GraphEdgeItemObject<OptionDataValueNumeric> {
  9714. value?: number;
  9715. /**
  9716. * Symbol of both line ends
  9717. */
  9718. symbol?: string | string[];
  9719. symbolSize?: number | number[];
  9720. ignoreForceLayout?: boolean;
  9721. }
  9722. interface GraphCategoryItemOption extends SymbolOptionMixin, GraphNodeStateOption, StatesOptionMixin<GraphNodeStateOption, GraphNodeStatesMixin> {
  9723. name?: string;
  9724. value?: OptionDataValue;
  9725. }
  9726. interface GraphSeriesOption extends SeriesOption<GraphNodeStateOption<CallbackDataParams>, GraphNodeStatesMixin>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesOnGeoOptionMixin, SeriesOnSingleOptionMixin, SymbolOptionMixin<CallbackDataParams>, RoamOptionMixin, BoxLayoutOptionMixin {
  9727. type?: 'graph';
  9728. coordinateSystem?: string;
  9729. legendHoverLink?: boolean;
  9730. layout?: 'none' | 'force' | 'circular';
  9731. data?: (GraphNodeItemOption | GraphDataValue)[];
  9732. nodes?: (GraphNodeItemOption | GraphDataValue)[];
  9733. edges?: GraphEdgeItemOption[];
  9734. links?: GraphEdgeItemOption[];
  9735. categories?: GraphCategoryItemOption[];
  9736. /**
  9737. * @deprecated
  9738. */
  9739. focusNodeAdjacency?: boolean;
  9740. /**
  9741. * Symbol size scale ratio in roam
  9742. */
  9743. nodeScaleRatio?: 0.6;
  9744. draggable?: boolean;
  9745. edgeSymbol?: string | string[];
  9746. edgeSymbolSize?: number | number[];
  9747. edgeLabel?: SeriesLineLabelOption;
  9748. label?: SeriesLabelOption;
  9749. itemStyle?: ItemStyleOption<CallbackDataParams>;
  9750. lineStyle?: GraphEdgeLineStyleOption;
  9751. emphasis?: {
  9752. focus?: Exclude<GraphNodeItemOption['emphasis'], undefined>['focus'];
  9753. scale?: boolean | number;
  9754. label?: SeriesLabelOption;
  9755. edgeLabel?: SeriesLabelOption;
  9756. itemStyle?: ItemStyleOption;
  9757. lineStyle?: LineStyleOption;
  9758. };
  9759. blur?: {
  9760. label?: SeriesLabelOption;
  9761. edgeLabel?: SeriesLabelOption;
  9762. itemStyle?: ItemStyleOption;
  9763. lineStyle?: LineStyleOption;
  9764. };
  9765. select?: {
  9766. label?: SeriesLabelOption;
  9767. edgeLabel?: SeriesLabelOption;
  9768. itemStyle?: ItemStyleOption;
  9769. lineStyle?: LineStyleOption;
  9770. };
  9771. circular?: {
  9772. rotateLabel?: boolean;
  9773. };
  9774. force?: {
  9775. initLayout?: 'circular' | 'none';
  9776. repulsion?: number | number[];
  9777. gravity?: number;
  9778. friction?: number;
  9779. edgeLength?: number | number[];
  9780. layoutAnimation?: boolean;
  9781. };
  9782. /**
  9783. * auto curveness for multiple edge, invalid when `lineStyle.curveness` is set
  9784. */
  9785. autoCurveness?: boolean | number | number[];
  9786. }
  9787. declare type GaugeColorStop = [number, ColorString];
  9788. interface LabelFormatter$1 {
  9789. (value: number): string;
  9790. }
  9791. interface PointerOption {
  9792. icon?: string;
  9793. show?: boolean;
  9794. /**
  9795. * If pointer shows above title and detail
  9796. */
  9797. showAbove?: boolean;
  9798. keepAspect?: boolean;
  9799. itemStyle?: ItemStyleOption;
  9800. /**
  9801. * Can be percent
  9802. */
  9803. offsetCenter?: (number | string)[];
  9804. length?: number | string;
  9805. width?: number;
  9806. }
  9807. interface AnchorOption {
  9808. show?: boolean;
  9809. showAbove?: boolean;
  9810. size?: number;
  9811. icon?: string;
  9812. offsetCenter?: (number | string)[];
  9813. keepAspect?: boolean;
  9814. itemStyle?: ItemStyleOption;
  9815. }
  9816. interface ProgressOption {
  9817. show?: boolean;
  9818. overlap?: boolean;
  9819. width?: number;
  9820. roundCap?: boolean;
  9821. clip?: boolean;
  9822. itemStyle?: ItemStyleOption;
  9823. }
  9824. interface TitleOption$1 extends LabelOption {
  9825. /**
  9826. * [x, y] offset
  9827. */
  9828. offsetCenter?: (number | string)[];
  9829. formatter?: LabelFormatter$1 | string;
  9830. /**
  9831. * If do value animtion.
  9832. */
  9833. valueAnimation?: boolean;
  9834. }
  9835. interface DetailOption extends LabelOption {
  9836. /**
  9837. * [x, y] offset
  9838. */
  9839. offsetCenter?: (number | string)[];
  9840. formatter?: LabelFormatter$1 | string;
  9841. /**
  9842. * If do value animtion.
  9843. */
  9844. valueAnimation?: boolean;
  9845. }
  9846. interface GaugeStatesMixin {
  9847. emphasis?: DefaultStatesMixinEmphasis;
  9848. }
  9849. interface GaugeStateOption<TCbParams = never> {
  9850. itemStyle?: ItemStyleOption<TCbParams>;
  9851. }
  9852. interface GaugeDataItemOption extends GaugeStateOption, StatesOptionMixin<GaugeStateOption<CallbackDataParams>, GaugeStatesMixin> {
  9853. name?: string;
  9854. value?: OptionDataValueNumeric;
  9855. pointer?: PointerOption;
  9856. progress?: ProgressOption;
  9857. title?: TitleOption$1;
  9858. detail?: DetailOption;
  9859. }
  9860. interface GaugeSeriesOption extends SeriesOption<GaugeStateOption, GaugeStatesMixin>, GaugeStateOption<CallbackDataParams>, CircleLayoutOptionMixin, SeriesEncodeOptionMixin {
  9861. type?: 'gauge';
  9862. radius?: number | string;
  9863. startAngle?: number;
  9864. endAngle?: number;
  9865. clockwise?: boolean;
  9866. min?: number;
  9867. max?: number;
  9868. splitNumber?: number;
  9869. itemStyle?: ItemStyleOption;
  9870. axisLine?: {
  9871. show?: boolean;
  9872. roundCap?: boolean;
  9873. lineStyle?: Omit<LineStyleOption, 'color'> & {
  9874. color?: GaugeColorStop[];
  9875. };
  9876. };
  9877. progress?: ProgressOption;
  9878. splitLine?: {
  9879. show?: boolean;
  9880. /**
  9881. * Can be percent
  9882. */
  9883. length?: number;
  9884. distance?: number;
  9885. lineStyle?: LineStyleOption;
  9886. };
  9887. axisTick?: {
  9888. show?: boolean;
  9889. splitNumber?: number;
  9890. /**
  9891. * Can be percent
  9892. */
  9893. length?: number | string;
  9894. distance?: number;
  9895. lineStyle?: LineStyleOption;
  9896. };
  9897. axisLabel?: Omit<LabelOption, 'rotate'> & {
  9898. formatter?: LabelFormatter$1 | string;
  9899. rotate?: 'tangential' | 'radial' | number;
  9900. };
  9901. pointer?: PointerOption;
  9902. anchor?: AnchorOption;
  9903. title?: TitleOption$1;
  9904. detail?: DetailOption;
  9905. data?: (OptionDataValueNumeric | GaugeDataItemOption)[];
  9906. }
  9907. declare type FunnelLabelOption = Omit<SeriesLabelOption, 'position'> & {
  9908. position?: LabelOption['position'] | 'outer' | 'inner' | 'center' | 'rightTop' | 'rightBottom' | 'leftTop' | 'leftBottom';
  9909. };
  9910. interface FunnelStatesMixin {
  9911. emphasis?: DefaultStatesMixinEmphasis;
  9912. }
  9913. interface FunnelCallbackDataParams extends CallbackDataParams {
  9914. percent: number;
  9915. }
  9916. interface FunnelStateOption<TCbParams = never> {
  9917. itemStyle?: ItemStyleOption<TCbParams>;
  9918. label?: FunnelLabelOption;
  9919. labelLine?: LabelLineOption;
  9920. }
  9921. interface FunnelDataItemOption extends FunnelStateOption, StatesOptionMixin<FunnelStateOption, FunnelStatesMixin>, OptionDataItemObject<OptionDataValueNumeric> {
  9922. itemStyle?: ItemStyleOption & {
  9923. width?: number | string;
  9924. height?: number | string;
  9925. };
  9926. }
  9927. interface FunnelSeriesOption extends SeriesOption<FunnelStateOption<FunnelCallbackDataParams>, FunnelStatesMixin>, FunnelStateOption<FunnelCallbackDataParams>, BoxLayoutOptionMixin, SeriesEncodeOptionMixin {
  9928. type?: 'funnel';
  9929. min?: number;
  9930. max?: number;
  9931. /**
  9932. * Absolute number or percent string
  9933. */
  9934. minSize?: number | string;
  9935. maxSize?: number | string;
  9936. sort?: 'ascending' | 'descending' | 'none';
  9937. orient?: LayoutOrient;
  9938. gap?: number;
  9939. funnelAlign?: HorizontalAlign | VerticalAlign;
  9940. data?: (OptionDataValueNumeric | OptionDataValueNumeric[] | FunnelDataItemOption)[];
  9941. }
  9942. declare type ParallelSeriesDataValue = OptionDataValue[];
  9943. interface ParallelStatesMixin {
  9944. emphasis?: DefaultStatesMixinEmphasis;
  9945. }
  9946. interface ParallelStateOption<TCbParams = never> {
  9947. lineStyle?: LineStyleOption<(TCbParams extends never ? never : (params: TCbParams) => ZRColor) | ZRColor>;
  9948. label?: SeriesLabelOption;
  9949. }
  9950. interface ParallelSeriesDataItemOption extends ParallelStateOption, StatesOptionMixin<ParallelStateOption, ParallelStatesMixin> {
  9951. value?: ParallelSeriesDataValue[];
  9952. }
  9953. interface ParallelSeriesOption extends SeriesOption<ParallelStateOption<CallbackDataParams>, ParallelStatesMixin>, ParallelStateOption<CallbackDataParams>, SeriesEncodeOptionMixin {
  9954. type?: 'parallel';
  9955. coordinateSystem?: string;
  9956. parallelIndex?: number;
  9957. parallelId?: string;
  9958. inactiveOpacity?: number;
  9959. activeOpacity?: number;
  9960. smooth?: boolean | number;
  9961. realtime?: boolean;
  9962. tooltip?: SeriesTooltipOption;
  9963. parallelAxisDefault?: ParallelAxisOption;
  9964. data?: (ParallelSeriesDataValue | ParallelSeriesDataItemOption)[];
  9965. }
  9966. declare type FocusNodeAdjacency = boolean | 'inEdges' | 'outEdges' | 'allEdges';
  9967. interface SankeyNodeStateOption<TCbParams = never> {
  9968. label?: SeriesLabelOption;
  9969. itemStyle?: ItemStyleOption<TCbParams>;
  9970. }
  9971. interface SankeyEdgeStateOption {
  9972. lineStyle?: SankeyEdgeStyleOption;
  9973. }
  9974. interface SankeyBothStateOption<TCbParams> extends SankeyNodeStateOption<TCbParams>, SankeyEdgeStateOption {
  9975. }
  9976. interface SankeyEdgeStyleOption extends LineStyleOption {
  9977. curveness?: number;
  9978. }
  9979. interface ExtraStateOption$2 {
  9980. emphasis?: {
  9981. focus?: DefaultEmphasisFocus | 'adjacency';
  9982. };
  9983. }
  9984. interface SankeyNodeItemOption extends SankeyNodeStateOption, StatesOptionMixin<SankeyNodeStateOption, ExtraStateOption$2>, OptionDataItemObject<OptionDataValue> {
  9985. id?: string;
  9986. localX?: number;
  9987. localY?: number;
  9988. depth?: number;
  9989. draggable?: boolean;
  9990. focusNodeAdjacency?: FocusNodeAdjacency;
  9991. }
  9992. interface SankeyEdgeItemOption extends SankeyEdgeStateOption, StatesOptionMixin<SankeyEdgeStateOption, ExtraStateOption$2>, GraphEdgeItemObject<OptionDataValueNumeric> {
  9993. focusNodeAdjacency?: FocusNodeAdjacency;
  9994. }
  9995. interface SankeyLevelOption extends SankeyNodeStateOption, SankeyEdgeStateOption {
  9996. depth: number;
  9997. }
  9998. interface SankeySeriesOption extends SeriesOption<SankeyBothStateOption<CallbackDataParams>, ExtraStateOption$2>, SankeyBothStateOption<CallbackDataParams>, BoxLayoutOptionMixin {
  9999. type?: 'sankey';
  10000. /**
  10001. * color will be linear mapped.
  10002. */
  10003. color?: ColorString[];
  10004. coordinateSystem?: 'view';
  10005. orient?: LayoutOrient;
  10006. /**
  10007. * The width of the node
  10008. */
  10009. nodeWidth?: number;
  10010. /**
  10011. * The vertical distance between two nodes
  10012. */
  10013. nodeGap?: number;
  10014. /**
  10015. * Control if the node can move or not
  10016. */
  10017. draggable?: boolean;
  10018. /**
  10019. * Will be allEdges if true.
  10020. * @deprecated
  10021. */
  10022. focusNodeAdjacency?: FocusNodeAdjacency;
  10023. /**
  10024. * The number of iterations to change the position of the node
  10025. */
  10026. layoutIterations?: number;
  10027. nodeAlign?: 'justify' | 'left' | 'right';
  10028. data?: SankeyNodeItemOption[];
  10029. nodes?: SankeyNodeItemOption[];
  10030. edges?: SankeyEdgeItemOption[];
  10031. links?: SankeyEdgeItemOption[];
  10032. levels?: SankeyLevelOption[];
  10033. }
  10034. declare type BoxplotDataValue = OptionDataValueNumeric[];
  10035. interface BoxplotStateOption<TCbParams = never> {
  10036. itemStyle?: ItemStyleOption<TCbParams>;
  10037. label?: SeriesLabelOption;
  10038. }
  10039. interface BoxplotDataItemOption extends BoxplotStateOption, StatesOptionMixin<BoxplotStateOption, ExtraStateOption$3> {
  10040. value: BoxplotDataValue;
  10041. }
  10042. interface ExtraStateOption$3 {
  10043. emphasis?: {
  10044. focus?: DefaultEmphasisFocus;
  10045. scale?: boolean;
  10046. };
  10047. }
  10048. interface BoxplotSeriesOption extends SeriesOption<BoxplotStateOption<CallbackDataParams>, ExtraStateOption$3>, BoxplotStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesEncodeOptionMixin {
  10049. type?: 'boxplot';
  10050. coordinateSystem?: 'cartesian2d';
  10051. layout?: LayoutOrient;
  10052. /**
  10053. * [min, max] can be percent of band width.
  10054. */
  10055. boxWidth?: (string | number)[];
  10056. data?: (BoxplotDataValue | BoxplotDataItemOption)[];
  10057. }
  10058. declare type CandlestickDataValue = OptionDataValue[];
  10059. interface CandlestickItemStyleOption extends ItemStyleOption {
  10060. color0?: ZRColor;
  10061. borderColor0?: ColorString;
  10062. }
  10063. interface CandlestickStateOption {
  10064. itemStyle?: CandlestickItemStyleOption;
  10065. label?: SeriesLabelOption;
  10066. }
  10067. interface CandlestickDataItemOption extends CandlestickStateOption, StatesOptionMixin<CandlestickStateOption, ExtraStateOption$4> {
  10068. value: CandlestickDataValue;
  10069. }
  10070. interface ExtraStateOption$4 {
  10071. emphasis?: {
  10072. focus?: DefaultEmphasisFocus;
  10073. scale?: boolean;
  10074. };
  10075. }
  10076. interface CandlestickSeriesOption extends SeriesOption<CandlestickStateOption, ExtraStateOption$4>, CandlestickStateOption, SeriesOnCartesianOptionMixin, SeriesLargeOptionMixin, SeriesEncodeOptionMixin {
  10077. type?: 'candlestick';
  10078. coordinateSystem?: 'cartesian2d';
  10079. layout?: LayoutOrient;
  10080. clip?: boolean;
  10081. barMaxWidth?: number | string;
  10082. barMinWidth?: number | string;
  10083. barWidth?: number | string;
  10084. data?: (CandlestickDataValue | CandlestickDataItemOption)[];
  10085. }
  10086. interface RippleEffectOption {
  10087. period?: number;
  10088. /**
  10089. * Scale of ripple
  10090. */
  10091. scale?: number;
  10092. brushType?: 'fill' | 'stroke';
  10093. color?: ZRColor;
  10094. /**
  10095. * ripple number
  10096. */
  10097. number?: number;
  10098. }
  10099. interface SymbolDrawStateOption {
  10100. itemStyle?: ItemStyleOption;
  10101. label?: LabelOption;
  10102. }
  10103. interface SymbolDrawItemModelOption extends SymbolOptionMixin<object>, StatesOptionMixin<SymbolDrawStateOption, {
  10104. emphasis?: {
  10105. focus?: DefaultEmphasisFocus;
  10106. scale?: boolean | number;
  10107. };
  10108. }>, SymbolDrawStateOption {
  10109. cursor?: string;
  10110. rippleEffect?: RippleEffectOption;
  10111. }
  10112. declare type ScatterDataValue = OptionDataValue | OptionDataValue[];
  10113. interface EffectScatterStatesOptionMixin {
  10114. emphasis?: {
  10115. focus?: DefaultEmphasisFocus;
  10116. scale?: boolean | number;
  10117. };
  10118. }
  10119. interface EffectScatterStateOption<TCbParams = never> {
  10120. itemStyle?: ItemStyleOption<TCbParams>;
  10121. label?: SeriesLabelOption;
  10122. }
  10123. interface EffectScatterDataItemOption extends SymbolOptionMixin, EffectScatterStateOption, StatesOptionMixin<EffectScatterStateOption, EffectScatterStatesOptionMixin> {
  10124. name?: string;
  10125. value?: ScatterDataValue;
  10126. rippleEffect?: SymbolDrawItemModelOption['rippleEffect'];
  10127. }
  10128. interface EffectScatterSeriesOption extends SeriesOption<EffectScatterStateOption<CallbackDataParams>, EffectScatterStatesOptionMixin>, EffectScatterStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesOnGeoOptionMixin, SeriesOnSingleOptionMixin, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
  10129. type?: 'effectScatter';
  10130. coordinateSystem?: string;
  10131. effectType?: 'ripple';
  10132. /**
  10133. * When to show the effect
  10134. */
  10135. showEffectOn?: 'render' | 'emphasis';
  10136. clip?: boolean;
  10137. /**
  10138. * Ripple effect config
  10139. */
  10140. rippleEffect?: SymbolDrawItemModelOption['rippleEffect'];
  10141. data?: (EffectScatterDataItemOption | ScatterDataValue)[];
  10142. }
  10143. interface LineDrawStateOption {
  10144. lineStyle?: LineStyleOption;
  10145. label?: LineLabelOption;
  10146. }
  10147. interface LineDrawModelOption extends LineDrawStateOption, StatesOptionMixin<LineDrawStateOption, {
  10148. emphasis?: {
  10149. focus?: DefaultEmphasisFocus;
  10150. };
  10151. }> {
  10152. effect?: {
  10153. show?: boolean;
  10154. period?: number;
  10155. delay?: number | ((idx: number) => number);
  10156. /**
  10157. * If move with constant speed px/sec
  10158. * period will be ignored if this property is > 0,
  10159. */
  10160. constantSpeed?: number;
  10161. symbol?: string;
  10162. symbolSize?: number | number[];
  10163. loop?: boolean;
  10164. roundTrip?: boolean;
  10165. /**
  10166. * Length of trail, 0 - 1
  10167. */
  10168. trailLength?: number;
  10169. /**
  10170. * Default to be same with lineStyle.color
  10171. */
  10172. color?: ColorString;
  10173. };
  10174. }
  10175. declare type LinesCoords = number[][];
  10176. declare type LinesValue = OptionDataValue | OptionDataValue[];
  10177. interface LinesLineStyleOption<TClr> extends LineStyleOption<TClr> {
  10178. curveness?: number;
  10179. }
  10180. interface LinesStatesMixin {
  10181. emphasis?: DefaultStatesMixinEmphasis;
  10182. }
  10183. interface LinesStateOption<TCbParams = never> {
  10184. lineStyle?: LinesLineStyleOption<(TCbParams extends never ? never : (params: TCbParams) => ZRColor) | ZRColor>;
  10185. label?: SeriesLineLabelOption;
  10186. }
  10187. interface LinesDataItemOption extends LinesStateOption<CallbackDataParams>, StatesOptionMixin<LinesStateOption<CallbackDataParams>, LinesStatesMixin> {
  10188. name?: string;
  10189. fromName?: string;
  10190. toName?: string;
  10191. symbol?: string[] | string;
  10192. symbolSize?: number[] | number;
  10193. coords?: LinesCoords;
  10194. value?: LinesValue;
  10195. effect?: LineDrawModelOption['effect'];
  10196. }
  10197. interface LinesSeriesOption extends SeriesOption<LinesStateOption, LinesStatesMixin>, LinesStateOption, SeriesOnCartesianOptionMixin, SeriesOnGeoOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesLargeOptionMixin {
  10198. type?: 'lines';
  10199. coordinateSystem?: string;
  10200. symbol?: string[] | string;
  10201. symbolSize?: number[] | number;
  10202. effect?: LineDrawModelOption['effect'];
  10203. /**
  10204. * If lines are polyline
  10205. * polyline not support curveness, label, animation
  10206. */
  10207. polyline?: boolean;
  10208. /**
  10209. * If clip the overflow.
  10210. * Available when coordinateSystem is cartesian or polar.
  10211. */
  10212. clip?: boolean;
  10213. data?: LinesDataItemOption[] | ArrayLike<number>;
  10214. dimensions?: DimensionDefinitionLoose | DimensionDefinitionLoose[];
  10215. }
  10216. declare type HeatmapDataValue = OptionDataValue[];
  10217. interface HeatmapStateOption<TCbParams = never> {
  10218. itemStyle?: ItemStyleOption<TCbParams> & {
  10219. borderRadius?: number | number[];
  10220. };
  10221. label?: SeriesLabelOption;
  10222. }
  10223. interface FunnelStatesMixin$1 {
  10224. emphasis?: DefaultStatesMixinEmphasis;
  10225. }
  10226. interface HeatmapDataItemOption extends HeatmapStateOption, StatesOptionMixin<HeatmapStateOption, FunnelStatesMixin$1> {
  10227. value: HeatmapDataValue;
  10228. }
  10229. interface HeatmapSeriesOption extends SeriesOption<HeatmapStateOption<CallbackDataParams>, FunnelStatesMixin$1>, HeatmapStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnGeoOptionMixin, SeriesOnCalendarOptionMixin, SeriesEncodeOptionMixin {
  10230. type?: 'heatmap';
  10231. coordinateSystem?: 'cartesian2d' | 'geo' | 'calendar';
  10232. blurSize?: number;
  10233. pointSize?: number;
  10234. maxOpacity?: number;
  10235. minOpacity?: number;
  10236. data?: (HeatmapDataItemOption | HeatmapDataValue)[];
  10237. }
  10238. interface PictorialBarStateOption {
  10239. itemStyle?: ItemStyleOption;
  10240. label?: SeriesLabelOption;
  10241. }
  10242. interface PictorialBarSeriesSymbolOption {
  10243. /**
  10244. * Customized bar shape
  10245. */
  10246. symbol?: string;
  10247. /**
  10248. * Can be ['100%', '100%'], null means auto.
  10249. * The percent will be relative to category width. If no repeat.
  10250. * Will be relative to symbolBoundingData.
  10251. */
  10252. symbolSize?: (number | string)[] | number | string;
  10253. symbolRotate?: number;
  10254. /**
  10255. * Default to be auto
  10256. */
  10257. symbolPosition?: 'start' | 'end' | 'center';
  10258. /**
  10259. * Can be percent offset relative to the symbolSize
  10260. */
  10261. symbolOffset?: (number | string)[] | number | string;
  10262. /**
  10263. * start margin and end margin. Can be a number or a percent string relative to symbolSize.
  10264. * Auto margin by default.
  10265. */
  10266. symbolMargin?: (number | string)[] | number | string;
  10267. /**
  10268. * true: means auto calculate repeat times and cut by data.
  10269. * a number: specifies repeat times, and do not cut by data.
  10270. * 'fixed': means auto calculate repeat times but do not cut by data.
  10271. *
  10272. * Otherwise means no repeat
  10273. */
  10274. symbolRepeat?: boolean | number | 'fixed';
  10275. /**
  10276. * From start to end or end to start.
  10277. */
  10278. symbolRepeatDirection?: 'start' | 'end';
  10279. symbolClip?: boolean;
  10280. /**
  10281. * It will define the size of graphic elements.
  10282. */
  10283. symbolBoundingData?: number | number[];
  10284. symbolPatternSize?: number;
  10285. }
  10286. interface ExtraStateOption$5 {
  10287. emphasis?: {
  10288. focus?: DefaultEmphasisFocus;
  10289. scale?: boolean;
  10290. };
  10291. }
  10292. interface PictorialBarDataItemOption extends PictorialBarSeriesSymbolOption, AnimationOptionMixin, PictorialBarStateOption, StatesOptionMixin<PictorialBarStateOption, ExtraStateOption$5>, OptionDataItemObject<OptionDataValue> {
  10293. z?: number;
  10294. cursor?: string;
  10295. }
  10296. interface PictorialBarSeriesOption extends BaseBarSeriesOption<PictorialBarStateOption, ExtraStateOption$5>, PictorialBarStateOption, PictorialBarSeriesSymbolOption, SeriesStackOptionMixin, SeriesEncodeOptionMixin {
  10297. type?: 'pictorialBar';
  10298. coordinateSystem?: 'cartesian2d';
  10299. data?: (PictorialBarDataItemOption | OptionDataValue | OptionDataValue[])[];
  10300. }
  10301. interface ThemeRiverSeriesLabelOption extends SeriesLabelOption {
  10302. margin?: number;
  10303. }
  10304. declare type ThemerRiverDataItem = [OptionDataValueDate, OptionDataValueNumeric, string];
  10305. interface ThemeRiverStatesMixin {
  10306. emphasis?: DefaultStatesMixinEmphasis;
  10307. }
  10308. interface ThemeRiverStateOption<TCbParams = never> {
  10309. label?: ThemeRiverSeriesLabelOption;
  10310. itemStyle?: ItemStyleOption<TCbParams>;
  10311. }
  10312. interface ThemeRiverSeriesOption extends SeriesOption<ThemeRiverStateOption<CallbackDataParams>, ThemeRiverStatesMixin>, ThemeRiverStateOption<CallbackDataParams>, SeriesOnSingleOptionMixin, BoxLayoutOptionMixin {
  10313. type?: 'themeRiver';
  10314. color?: ZRColor[];
  10315. coordinateSystem?: 'singleAxis';
  10316. /**
  10317. * gap in axis's orthogonal orientation
  10318. */
  10319. boundaryGap?: (string | number)[];
  10320. /**
  10321. * [date, value, name]
  10322. */
  10323. data?: ThemerRiverDataItem[];
  10324. }
  10325. interface SunburstItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
  10326. borderRadius?: (number | string)[] | number | string;
  10327. }
  10328. interface SunburstLabelOption extends Omit<SeriesLabelOption, 'rotate' | 'position'> {
  10329. rotate?: 'radial' | 'tangential' | number;
  10330. minAngle?: number;
  10331. silent?: boolean;
  10332. position?: SeriesLabelOption['position'] | 'outside';
  10333. }
  10334. interface SunburstStatesMixin {
  10335. emphasis?: {
  10336. focus?: DefaultEmphasisFocus | 'descendant' | 'ancestor';
  10337. };
  10338. }
  10339. interface SunburstStateOption<TCbParams = never> {
  10340. itemStyle?: SunburstItemStyleOption<TCbParams>;
  10341. label?: SunburstLabelOption;
  10342. }
  10343. interface SunburstSeriesLevelOption extends SunburstStateOption, StatesOptionMixin<SunburstStateOption, SunburstStatesMixin> {
  10344. radius?: (number | string)[];
  10345. /**
  10346. * @deprecated use radius instead
  10347. */
  10348. r?: number | string;
  10349. /**
  10350. * @deprecated use radius instead
  10351. */
  10352. r0?: number | string;
  10353. highlight?: {
  10354. itemStyle?: SunburstItemStyleOption;
  10355. label?: SunburstLabelOption;
  10356. };
  10357. }
  10358. interface SortParam {
  10359. dataIndex: number;
  10360. depth: number;
  10361. height: number;
  10362. getValue(): number;
  10363. }
  10364. interface SunburstSeriesOption extends SeriesOption<SunburstStateOption, SunburstStatesMixin>, SunburstStateOption, SunburstColorByMixin, CircleLayoutOptionMixin {
  10365. type?: 'sunburst';
  10366. clockwise?: boolean;
  10367. startAngle?: number;
  10368. minAngle?: number;
  10369. /**
  10370. * If still show when all data zero.
  10371. */
  10372. stillShowZeroSum?: boolean;
  10373. /**
  10374. * Policy of highlighting pieces when hover on one
  10375. * Valid values: 'none' (for not downplay others), 'descendant',
  10376. * 'ancestor', 'self'
  10377. */
  10378. nodeClick?: 'rootToNode' | 'link' | false;
  10379. renderLabelForZeroData?: boolean;
  10380. levels?: SunburstSeriesLevelOption[];
  10381. animationType?: 'expansion' | 'scale';
  10382. sort?: 'desc' | 'asc' | ((a: SortParam, b: SortParam) => number);
  10383. }
  10384. interface GraphicComponentBaseElementOption extends Partial<Pick<Element, TransformProp | 'silent' | 'ignore' | 'textConfig' | 'draggable' | ElementEventNameWithOn>>,
  10385. /**
  10386. * left/right/top/bottom: (like 12, '22%', 'center', default undefined)
  10387. * If left/rigth is set, shape.x/shape.cx/position will not be used.
  10388. * If top/bottom is set, shape.y/shape.cy/position will not be used.
  10389. * This mechanism is useful when you want to position a group/element
  10390. * against the right side or the center of this container.
  10391. */
  10392. Partial<Pick<BoxLayoutOptionMixin, 'left' | 'right' | 'top' | 'bottom'>> {
  10393. /**
  10394. * element type, mandatory.
  10395. * Only can be omit if call setOption not at the first time and perform merge.
  10396. */
  10397. type?: string;
  10398. id?: OptionId;
  10399. name?: string;
  10400. parentId?: OptionId;
  10401. parentOption?: GraphicComponentElementOption;
  10402. children?: GraphicComponentElementOption[];
  10403. hv?: [boolean, boolean];
  10404. /**
  10405. * bounding: (enum: 'all' (default) | 'raw')
  10406. * Specify how to calculate boundingRect when locating.
  10407. * 'all': Get uioned and transformed boundingRect
  10408. * from both itself and its descendants.
  10409. * This mode simplies confining a group of elements in the bounding
  10410. * of their ancester container (e.g., using 'right: 0').
  10411. * 'raw': Only use the boundingRect of itself and before transformed.
  10412. * This mode is similar to css behavior, which is useful when you
  10413. * want an element to be able to overflow its container. (Consider
  10414. * a rotated circle needs to be located in a corner.)
  10415. */
  10416. bounding?: 'raw' | 'all';
  10417. /**
  10418. * info: custom info. enables user to mount some info on elements and use them
  10419. * in event handlers. Update them only when user specified, otherwise, remain.
  10420. */
  10421. info?: GraphicExtraElementInfo;
  10422. clipPath?: Omit<GraphicComponentZRPathOption, 'clipPath'> | false;
  10423. textContent?: Omit<GraphicComponentTextOption, 'clipPath'>;
  10424. textConfig?: ElementTextConfig;
  10425. $action?: 'merge' | 'replace' | 'remove';
  10426. tooltip?: CommonTooltipOption<unknown>;
  10427. enterAnimation?: AnimationOption$1;
  10428. updateAnimation?: AnimationOption$1;
  10429. leaveAnimation?: AnimationOption$1;
  10430. }
  10431. interface GraphicComponentDisplayableOption extends GraphicComponentBaseElementOption, Partial<Pick<Displayable, 'zlevel' | 'z' | 'z2' | 'invisible' | 'cursor'>> {
  10432. style?: ZRStyleProps;
  10433. z2?: number;
  10434. }
  10435. interface GraphicComponentGroupOption extends GraphicComponentBaseElementOption, TransitionOptionMixin<GroupProps> {
  10436. type?: 'group';
  10437. /**
  10438. * width/height: (can only be pixel value, default 0)
  10439. * Only be used to specify contianer(group) size, if needed. And
  10440. * can not be percentage value (like '33%'). See the reason in the
  10441. * layout algorithm below.
  10442. */
  10443. width?: number;
  10444. height?: number;
  10445. children: GraphicComponentElementOption[];
  10446. keyframeAnimation?: ElementKeyframeAnimationOption<GroupProps> | ElementKeyframeAnimationOption<GroupProps>[];
  10447. }
  10448. interface GraphicComponentZRPathOption extends GraphicComponentDisplayableOption, TransitionOptionMixin<PathProps> {
  10449. shape?: PathProps['shape'] & TransitionOptionMixin<PathProps['shape']>;
  10450. style?: PathStyleProps & TransitionOptionMixin<PathStyleProps>;
  10451. keyframeAnimation?: ElementKeyframeAnimationOption<PathProps> | ElementKeyframeAnimationOption<PathProps>[];
  10452. }
  10453. interface GraphicComponentImageOption extends GraphicComponentDisplayableOption, TransitionOptionMixin<ImageProps> {
  10454. type?: 'image';
  10455. style?: ImageStyleProps & TransitionOptionMixin<ImageStyleProps>;
  10456. keyframeAnimation?: ElementKeyframeAnimationOption<ImageProps> | ElementKeyframeAnimationOption<ImageProps>[];
  10457. }
  10458. interface GraphicComponentTextOption extends Omit<GraphicComponentDisplayableOption, 'textContent' | 'textConfig'>, TransitionOptionMixin<TextProps> {
  10459. type?: 'text';
  10460. style?: TextStyleProps & TransitionOptionMixin<TextStyleProps>;
  10461. keyframeAnimation?: ElementKeyframeAnimationOption<TextProps> | ElementKeyframeAnimationOption<TextProps>[];
  10462. }
  10463. declare type GraphicComponentElementOption = GraphicComponentGroupOption | GraphicComponentZRPathOption | GraphicComponentImageOption | GraphicComponentTextOption;
  10464. declare type GraphicExtraElementInfo = Dictionary<unknown>;
  10465. declare type GraphicComponentLooseOption = (GraphicComponentOption | GraphicComponentElementOption) & {
  10466. mainType?: 'graphic';
  10467. };
  10468. interface GraphicComponentOption extends ComponentOption, AnimationOptionMixin {
  10469. elements?: GraphicComponentElementOption[];
  10470. }
  10471. declare const ICON_TYPES: readonly ["rect", "polygon", "lineX", "lineY", "keep", "clear"];
  10472. declare type IconType = typeof ICON_TYPES[number];
  10473. interface ToolboxBrushFeatureOption extends ToolboxFeatureOption {
  10474. type?: IconType[];
  10475. icon?: {
  10476. [key in IconType]?: string;
  10477. };
  10478. title?: {
  10479. [key in IconType]?: string;
  10480. };
  10481. }
  10482. interface ToolboxDataViewFeatureOption extends ToolboxFeatureOption {
  10483. readOnly?: boolean;
  10484. optionToContent?: (option: ECUnitOption) => string | HTMLElement;
  10485. contentToOption?: (viewMain: HTMLDivElement, oldOption: ECUnitOption) => ECUnitOption;
  10486. icon?: string;
  10487. title?: string;
  10488. lang?: string[];
  10489. backgroundColor?: ColorString;
  10490. textColor?: ColorString;
  10491. textareaColor?: ColorString;
  10492. textareaBorderColor?: ColorString;
  10493. buttonColor?: ColorString;
  10494. buttonTextColor?: ColorString;
  10495. }
  10496. declare const ICON_TYPES$1: readonly ["zoom", "back"];
  10497. declare type IconType$1 = typeof ICON_TYPES$1[number];
  10498. interface ToolboxDataZoomFeatureOption extends ToolboxFeatureOption {
  10499. type?: IconType$1[];
  10500. icon?: {
  10501. [key in IconType$1]?: string;
  10502. };
  10503. title?: {
  10504. [key in IconType$1]?: string;
  10505. };
  10506. filterMode?: 'filter' | 'weakFilter' | 'empty' | 'none';
  10507. xAxisIndex?: ModelFinderIndexQuery;
  10508. yAxisIndex?: ModelFinderIndexQuery;
  10509. xAxisId?: ModelFinderIdQuery;
  10510. yAxisId?: ModelFinderIdQuery;
  10511. brushStyle?: ItemStyleOption;
  10512. }
  10513. declare const ICON_TYPES$2: readonly ["line", "bar", "stack"];
  10514. declare const TITLE_TYPES: readonly ["line", "bar", "stack", "tiled"];
  10515. declare type IconType$2 = typeof ICON_TYPES$2[number];
  10516. declare type TitleType = typeof TITLE_TYPES[number];
  10517. interface ToolboxMagicTypeFeatureOption extends ToolboxFeatureOption {
  10518. type?: IconType$2[];
  10519. /**
  10520. * Icon group
  10521. */
  10522. icon?: {
  10523. [key in IconType$2]?: string;
  10524. };
  10525. title?: {
  10526. [key in TitleType]?: string;
  10527. };
  10528. option?: {
  10529. [key in IconType$2]?: SeriesOption;
  10530. };
  10531. /**
  10532. * Map of seriesType: seriesIndex
  10533. */
  10534. seriesIndex?: {
  10535. line?: number;
  10536. bar?: number;
  10537. };
  10538. }
  10539. interface ToolboxRestoreFeatureOption extends ToolboxFeatureOption {
  10540. icon?: string;
  10541. title?: string;
  10542. }
  10543. interface ToolboxSaveAsImageFeatureOption extends ToolboxFeatureOption {
  10544. icon?: string;
  10545. title?: string;
  10546. type?: 'png' | 'jpeg';
  10547. backgroundColor?: ZRColor;
  10548. connectedBackgroundColor?: ZRColor;
  10549. name?: string;
  10550. excludeComponents?: string[];
  10551. pixelRatio?: number;
  10552. lang?: string[];
  10553. }
  10554. interface ToolboxComponentOption extends ToolboxOption {
  10555. feature?: {
  10556. brush?: ToolboxBrushFeatureOption;
  10557. dataView?: ToolboxDataViewFeatureOption;
  10558. dataZoom?: ToolboxDataZoomFeatureOption;
  10559. magicType?: ToolboxMagicTypeFeatureOption;
  10560. restore?: ToolboxRestoreFeatureOption;
  10561. saveAsImage?: ToolboxSaveAsImageFeatureOption;
  10562. [key: string]: ToolboxFeatureOption | {
  10563. [key: string]: any;
  10564. } | undefined;
  10565. };
  10566. }
  10567. declare type DataZoomComponentOption = SliderDataZoomOption | InsideDataZoomOption;
  10568. declare type VisualMapComponentOption = ContinousVisualMapOption | PiecewiseVisualMapOption;
  10569. declare type LegendComponentOption = LegendOption | ScrollableLegendOption;
  10570. declare type SeriesInjectedOption = {
  10571. markArea?: MarkAreaOption;
  10572. markLine?: MarkLineOption;
  10573. markPoint?: MarkPointOption;
  10574. tooltip?: SeriesTooltipOption;
  10575. };
  10576. declare type LineSeriesOption$1 = LineSeriesOption & SeriesInjectedOption;
  10577. declare type BarSeriesOption$1 = BarSeriesOption & SeriesInjectedOption;
  10578. declare type ScatterSeriesOption$1 = ScatterSeriesOption & SeriesInjectedOption;
  10579. declare type PieSeriesOption$1 = PieSeriesOption & SeriesInjectedOption;
  10580. declare type RadarSeriesOption$1 = RadarSeriesOption & SeriesInjectedOption;
  10581. declare type MapSeriesOption$1 = MapSeriesOption & SeriesInjectedOption;
  10582. declare type TreeSeriesOption$1 = TreeSeriesOption & SeriesInjectedOption;
  10583. declare type TreemapSeriesOption$1 = TreemapSeriesOption & SeriesInjectedOption;
  10584. declare type GraphSeriesOption$1 = GraphSeriesOption & SeriesInjectedOption;
  10585. declare type GaugeSeriesOption$1 = GaugeSeriesOption & SeriesInjectedOption;
  10586. declare type FunnelSeriesOption$1 = FunnelSeriesOption & SeriesInjectedOption;
  10587. declare type ParallelSeriesOption$1 = ParallelSeriesOption & SeriesInjectedOption;
  10588. declare type SankeySeriesOption$1 = SankeySeriesOption & SeriesInjectedOption;
  10589. declare type BoxplotSeriesOption$1 = BoxplotSeriesOption & SeriesInjectedOption;
  10590. declare type CandlestickSeriesOption$1 = CandlestickSeriesOption & SeriesInjectedOption;
  10591. declare type EffectScatterSeriesOption$1 = EffectScatterSeriesOption & SeriesInjectedOption;
  10592. declare type LinesSeriesOption$1 = LinesSeriesOption & SeriesInjectedOption;
  10593. declare type HeatmapSeriesOption$1 = HeatmapSeriesOption & SeriesInjectedOption;
  10594. declare type PictorialBarSeriesOption$1 = PictorialBarSeriesOption & SeriesInjectedOption;
  10595. declare type ThemeRiverSeriesOption$1 = ThemeRiverSeriesOption & SeriesInjectedOption;
  10596. declare type SunburstSeriesOption$1 = SunburstSeriesOption & SeriesInjectedOption;
  10597. declare type CustomSeriesOption$1 = CustomSeriesOption & SeriesInjectedOption;
  10598. /**
  10599. * A map from series 'type' to series option
  10600. * It's used for declaration merging in echarts extensions.
  10601. * For example:
  10602. * ```ts
  10603. * import echarts from 'echarts';
  10604. * declare module 'echarts/types/dist/echarts' {
  10605. * interface RegisteredSeriesOption {
  10606. * wordCloud: WordCloudSeriesOption
  10607. * }
  10608. * }
  10609. * ```
  10610. */
  10611. interface RegisteredSeriesOption {
  10612. line: LineSeriesOption$1;
  10613. bar: BarSeriesOption$1;
  10614. scatter: ScatterSeriesOption$1;
  10615. pie: PieSeriesOption$1;
  10616. radar: RadarSeriesOption$1;
  10617. map: MapSeriesOption$1;
  10618. tree: TreeSeriesOption$1;
  10619. treemap: TreemapSeriesOption$1;
  10620. graph: GraphSeriesOption$1;
  10621. gauge: GaugeSeriesOption$1;
  10622. funnel: FunnelSeriesOption$1;
  10623. parallel: ParallelSeriesOption$1;
  10624. sankey: SankeySeriesOption$1;
  10625. boxplot: BoxplotSeriesOption$1;
  10626. candlestick: CandlestickSeriesOption$1;
  10627. effectScatter: EffectScatterSeriesOption$1;
  10628. lines: LinesSeriesOption$1;
  10629. heatmap: HeatmapSeriesOption$1;
  10630. pictorialBar: PictorialBarSeriesOption$1;
  10631. themeRiver: ThemeRiverSeriesOption$1;
  10632. sunburst: SunburstSeriesOption$1;
  10633. custom: CustomSeriesOption$1;
  10634. }
  10635. declare type Values<T> = T[keyof T];
  10636. declare type SeriesOption$1 = Values<RegisteredSeriesOption>;
  10637. interface EChartsOption extends ECBasicOption {
  10638. dataset?: DatasetOption | DatasetOption[];
  10639. aria?: AriaOption;
  10640. title?: TitleOption | TitleOption[];
  10641. grid?: GridOption | GridOption[];
  10642. radar?: RadarOption | RadarOption[];
  10643. polar?: PolarOption | PolarOption[];
  10644. geo?: GeoOption | GeoOption[];
  10645. angleAxis?: AngleAxisOption | AngleAxisOption[];
  10646. radiusAxis?: RadiusAxisOption | RadiusAxisOption[];
  10647. xAxis?: XAXisOption | XAXisOption[];
  10648. yAxis?: YAXisOption | YAXisOption[];
  10649. singleAxis?: SingleAxisOption | SingleAxisOption[];
  10650. parallel?: ParallelCoordinateSystemOption | ParallelCoordinateSystemOption[];
  10651. parallelAxis?: ParallelAxisOption | ParallelAxisOption[];
  10652. calendar?: CalendarOption | CalendarOption[];
  10653. toolbox?: ToolboxComponentOption | ToolboxComponentOption[];
  10654. tooltip?: TooltipOption | TooltipOption[];
  10655. axisPointer?: AxisPointerOption | AxisPointerOption[];
  10656. brush?: BrushOption | BrushOption[];
  10657. timeline?: TimelineOption | SliderTimelineOption;
  10658. legend?: LegendComponentOption | (LegendComponentOption)[];
  10659. dataZoom?: DataZoomComponentOption | (DataZoomComponentOption)[];
  10660. visualMap?: VisualMapComponentOption | (VisualMapComponentOption)[];
  10661. graphic?: GraphicComponentLooseOption | GraphicComponentLooseOption[];
  10662. series?: SeriesOption$1 | SeriesOption$1[];
  10663. options?: EChartsOption[];
  10664. baseOption?: EChartsOption;
  10665. }
  10666. export { AngleAxisOption as AngleAxisComponentOption, AnimationDelayCallback, AnimationDelayCallbackParam as AnimationDelayCallbackParams, AnimationDurationCallback, AriaOption as AriaComponentOption, Axis, AxisPointerOption as AxisPointerComponentOption, BarSeriesOption$1 as BarSeriesOption, BoxplotSeriesOption$1 as BoxplotSeriesOption, BrushOption as BrushComponentOption, CalendarOption as CalendarComponentOption, CandlestickSeriesOption$1 as CandlestickSeriesOption, ChartView, ZRColor as Color, ComponentModel, ComponentView, ComposeOption, ContinousVisualMapOption as ContinousVisualMapComponentOption, CustomSeriesOption$1 as CustomSeriesOption, CustomSeriesRenderItem, CustomSeriesRenderItemAPI, CustomSeriesRenderItemParams, CustomSeriesRenderItemReturn, DataZoomComponentOption, DatasetOption as DatasetComponentOption, CallbackDataParams as DefaultLabelFormatterCallbackParams, EChartsType as ECharts, ECBasicOption as EChartsCoreOption, EChartsOption, EChartsType, EffectScatterSeriesOption$1 as EffectScatterSeriesOption, ElementEvent, FunnelSeriesOption$1 as FunnelSeriesOption, GaugeSeriesOption$1 as GaugeSeriesOption, GeoOption as GeoComponentOption, GraphSeriesOption$1 as GraphSeriesOption, GraphicComponentLooseOption as GraphicComponentOption, GridOption as GridComponentOption, HeatmapSeriesOption$1 as HeatmapSeriesOption, ImagePatternObject, InsideDataZoomOption as InsideDataZoomComponentOption, LabelFormatterCallback, LabelLayoutOptionCallback, LabelLayoutOptionCallbackParams, LegendComponentOption, LineSeriesOption$1 as LineSeriesOption, LinearGradientObject, LinesSeriesOption$1 as LinesSeriesOption, SeriesData as List, MapSeriesOption$1 as MapSeriesOption, MarkAreaOption as MarkAreaComponentOption, MarkLineOption as MarkLineComponentOption, MarkPointOption as MarkPointComponentOption, Model, PRIORITY, ParallelCoordinateSystemOption as ParallelComponentOption, ParallelSeriesOption$1 as ParallelSeriesOption, PatternObject, Payload, PictorialBarSeriesOption$1 as PictorialBarSeriesOption, PieSeriesOption$1 as PieSeriesOption, PiecewiseVisualMapOption as PiecewiseVisualMapComponentOption, LegendOption as PlainLegendComponentOption, PolarOption as PolarComponentOption, RadarOption as RadarComponentOption, RadarSeriesOption$1 as RadarSeriesOption, RadialGradientObject, RadiusAxisOption as RadiusAxisComponentOption, RegisteredSeriesOption, ResizeOpts, SVGPatternObject, SankeySeriesOption$1 as SankeySeriesOption, ScatterSeriesOption$1 as ScatterSeriesOption, ScrollableLegendOption as ScrollableLegendComponentOption, SeriesModel, SeriesOption$1 as SeriesOption, SetOptionOpts, SetOptionTransitionOpt, SetOptionTransitionOptItem, SingleAxisOption as SingleAxisComponentOption, SliderDataZoomOption as SliderDataZoomComponentOption, SunburstSeriesOption$1 as SunburstSeriesOption, ThemeRiverSeriesOption$1 as ThemeRiverSeriesOption, TimelineOption as TimelineComponentOption, TitleOption as TitleComponentOption, ToolboxComponentOption, TooltipFormatterCallback as TooltipComponentFormatterCallback, TopLevelFormatterParams as TooltipComponentFormatterCallbackParams, TooltipOption as TooltipComponentOption, TooltipPositionCallback as TooltipComponentPositionCallback, TooltipPositionCallbackParams as TooltipComponentPositionCallbackParams, TreeSeriesOption$1 as TreeSeriesOption, TreemapSeriesOption$1 as TreemapSeriesOption, VisualMapComponentOption, XAXisOption as XAXisComponentOption, YAXisOption as YAXisComponentOption, color_d as color, connect, dataTool, dependencies, disConnect, disconnect, dispose$1 as dispose, env, extendChartView, extendComponentModel, extendComponentView, extendSeriesModel, format_d as format, getCoordinateSystemDimensions, getInstanceByDom, getInstanceById, getMap, graphic_d as graphic, helper_d as helper, init$1 as init, brushSingle as innerDrawElementOnCanvas, matrix_d as matrix, number_d as number, parseGeoJSON, parseGeoJSON as parseGeoJson, registerAction, registerCoordinateSystem, registerLayout, registerLoading, registerLocale, registerMap, registerPostInit, registerPostUpdate, registerPreprocessor, registerProcessor, registerTheme, registerTransform, registerUpdateLifecycle, registerVisual, setCanvasCreator, setPlatformAPI, throttle, time_d as time, use, util_d$1 as util, vector_d as vector, version$1 as version, util_d as zrUtil, zrender_d as zrender };