3394a767e77fd1285426be449d402690967891230c0f640b0329f6077508670599ea59c7d224dbe553dfcc2281195dd1feeb9f04430f6e64e586d72872a8dd 385 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997
  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. declare function install(registers: EChartsExtensionInstallRegisters): void;
  4419. /**
  4420. * [sourceFormat]
  4421. *
  4422. * + "original":
  4423. * This format is only used in series.data, where
  4424. * itemStyle can be specified in data item.
  4425. *
  4426. * + "arrayRows":
  4427. * [
  4428. * ['product', 'score', 'amount'],
  4429. * ['Matcha Latte', 89.3, 95.8],
  4430. * ['Milk Tea', 92.1, 89.4],
  4431. * ['Cheese Cocoa', 94.4, 91.2],
  4432. * ['Walnut Brownie', 85.4, 76.9]
  4433. * ]
  4434. *
  4435. * + "objectRows":
  4436. * [
  4437. * {product: 'Matcha Latte', score: 89.3, amount: 95.8},
  4438. * {product: 'Milk Tea', score: 92.1, amount: 89.4},
  4439. * {product: 'Cheese Cocoa', score: 94.4, amount: 91.2},
  4440. * {product: 'Walnut Brownie', score: 85.4, amount: 76.9}
  4441. * ]
  4442. *
  4443. * + "keyedColumns":
  4444. * {
  4445. * 'product': ['Matcha Latte', 'Milk Tea', 'Cheese Cocoa', 'Walnut Brownie'],
  4446. * 'count': [823, 235, 1042, 988],
  4447. * 'score': [95.8, 81.4, 91.2, 76.9]
  4448. * }
  4449. *
  4450. * + "typedArray"
  4451. *
  4452. * + "unknown"
  4453. */
  4454. interface SourceMetaRawOption {
  4455. seriesLayoutBy: SeriesLayoutBy;
  4456. sourceHeader: OptionSourceHeader;
  4457. dimensions: DimensionDefinitionLoose[];
  4458. }
  4459. interface Source extends SourceImpl {
  4460. }
  4461. declare class SourceImpl {
  4462. /**
  4463. * Not null/undefined.
  4464. */
  4465. readonly data: OptionSourceData;
  4466. /**
  4467. * See also "detectSourceFormat".
  4468. * Not null/undefined.
  4469. */
  4470. readonly sourceFormat: SourceFormat;
  4471. /**
  4472. * 'row' or 'column'
  4473. * Not null/undefined.
  4474. */
  4475. readonly seriesLayoutBy: SeriesLayoutBy;
  4476. /**
  4477. * dimensions definition from:
  4478. * (1) standalone defined in option prop `dimensions: [...]`
  4479. * (2) detected from option data. See `determineSourceDimensions`.
  4480. * If can not be detected (e.g., there is only pure data `[[11, 33], ...]`
  4481. * `dimensionsDefine` will be null/undefined.
  4482. */
  4483. readonly dimensionsDefine: DimensionDefinition[];
  4484. /**
  4485. * Only make sense in `SOURCE_FORMAT_ARRAY_ROWS`.
  4486. * That is the same as `sourceHeader: number`,
  4487. * which means from which line the real data start.
  4488. * Not null/undefined, uint.
  4489. */
  4490. readonly startIndex: number;
  4491. /**
  4492. * Dimension count detected from data. Only works when `dimensionDefine`
  4493. * does not exists.
  4494. * Can be null/undefined (when unknown), uint.
  4495. */
  4496. readonly dimensionsDetectedCount: number;
  4497. /**
  4498. * Raw props from user option.
  4499. */
  4500. readonly metaRawOption: SourceMetaRawOption;
  4501. constructor(fields: {
  4502. data: OptionSourceData;
  4503. sourceFormat: SourceFormat;
  4504. seriesLayoutBy?: SeriesLayoutBy;
  4505. dimensionsDefine?: DimensionDefinition[];
  4506. startIndex?: number;
  4507. dimensionsDetectedCount?: number;
  4508. metaRawOption?: SourceMetaRawOption;
  4509. encodeDefine?: HashMap<OptionEncodeValue, DimensionName>;
  4510. });
  4511. }
  4512. interface DataProvider {
  4513. /**
  4514. * true: all of the value are in primitive type (in type `OptionDataValue`).
  4515. * false: Not sure whether any of them is non primitive type (in type `OptionDataItemObject`).
  4516. * Like `data: [ { value: xx, itemStyle: {...} }, ...]`
  4517. * At present it only happen in `SOURCE_FORMAT_ORIGINAL`.
  4518. */
  4519. pure?: boolean;
  4520. /**
  4521. * If data is persistent and will not be released after use.
  4522. */
  4523. persistent?: boolean;
  4524. getSource(): Source;
  4525. count(): number;
  4526. getItem(idx: number, out?: OptionDataItem): OptionDataItem;
  4527. fillStorage?(start: number, end: number, out: ArrayLike$1<ParsedValue>[], extent: number[][]): void;
  4528. appendData?(newData: ArrayLike$1<OptionDataItem>): void;
  4529. clean?(): void;
  4530. }
  4531. declare type DimensionSummaryEncode = {
  4532. defaultedLabel: DimensionName[];
  4533. defaultedTooltip: DimensionName[];
  4534. [coordOrVisualDimName: string]: DimensionName[];
  4535. };
  4536. declare type DimensionSummary = {
  4537. encode: DimensionSummaryEncode;
  4538. userOutput: DimensionUserOuput;
  4539. dataDimsOnCoord: DimensionName[];
  4540. dataDimIndicesOnCoord: DimensionIndex[];
  4541. encodeFirstDimNotExtra: {
  4542. [coordDim: string]: DimensionName;
  4543. };
  4544. };
  4545. declare type DimensionUserOuputEncode = {
  4546. [coordOrVisualDimName: string]: DimensionIndex[];
  4547. };
  4548. declare class DimensionUserOuput {
  4549. private _encode;
  4550. private _cachedDimNames;
  4551. private _schema?;
  4552. constructor(encode: DimensionUserOuputEncode, dimRequest?: SeriesDataSchema);
  4553. get(): {
  4554. fullDimensions: DimensionName[];
  4555. encode: DimensionUserOuputEncode;
  4556. };
  4557. /**
  4558. * Get all data store dimension names.
  4559. * Theoretically a series data store is defined both by series and used dataset (if any).
  4560. * If some dimensions are omitted for performance reason in `this.dimensions`,
  4561. * the dimension name may not be auto-generated if user does not specify a dimension name.
  4562. * In this case, the dimension name is `null`/`undefined`.
  4563. */
  4564. private _getFullDimensionNames;
  4565. }
  4566. declare class Graph {
  4567. type: 'graph';
  4568. readonly nodes: GraphNode[];
  4569. readonly edges: GraphEdge[];
  4570. data: SeriesData;
  4571. edgeData: SeriesData;
  4572. /**
  4573. * Whether directed graph.
  4574. */
  4575. private _directed;
  4576. private _nodesMap;
  4577. /**
  4578. * @type {Object.<string, module:echarts/data/Graph.Edge>}
  4579. * @private
  4580. */
  4581. private _edgesMap;
  4582. constructor(directed?: boolean);
  4583. /**
  4584. * If is directed graph
  4585. */
  4586. isDirected(): boolean;
  4587. /**
  4588. * Add a new node
  4589. */
  4590. addNode(id: string | number, dataIndex?: number): GraphNode;
  4591. /**
  4592. * Get node by data index
  4593. */
  4594. getNodeByIndex(dataIndex: number): GraphNode;
  4595. /**
  4596. * Get node by id
  4597. */
  4598. getNodeById(id: string): GraphNode;
  4599. /**
  4600. * Add a new edge
  4601. */
  4602. addEdge(n1: GraphNode | number | string, n2: GraphNode | number | string, dataIndex?: number): GraphEdge;
  4603. /**
  4604. * Get edge by data index
  4605. */
  4606. getEdgeByIndex(dataIndex: number): GraphEdge;
  4607. /**
  4608. * Get edge by two linked nodes
  4609. */
  4610. getEdge(n1: string | GraphNode, n2: string | GraphNode): GraphEdge;
  4611. /**
  4612. * Iterate all nodes
  4613. */
  4614. eachNode<Ctx>(cb: (this: Ctx, node: GraphNode, idx: number) => void, context?: Ctx): void;
  4615. /**
  4616. * Iterate all edges
  4617. */
  4618. eachEdge<Ctx>(cb: (this: Ctx, edge: GraphEdge, idx: number) => void, context?: Ctx): void;
  4619. /**
  4620. * Breadth first traverse
  4621. * Return true to stop traversing
  4622. */
  4623. breadthFirstTraverse<Ctx>(cb: (this: Ctx, node: GraphNode, fromNode: GraphNode) => boolean | void, startNode: GraphNode | string, direction: 'none' | 'in' | 'out', context?: Ctx): void;
  4624. update(): void;
  4625. /**
  4626. * @return {module:echarts/data/Graph}
  4627. */
  4628. clone(): Graph;
  4629. }
  4630. interface GraphDataProxyMixin {
  4631. getValue(dimension?: DimensionLoose): ParsedValue;
  4632. setVisual(key: string | Dictionary<any>, value?: any): void;
  4633. getVisual(key: string): any;
  4634. setLayout(layout: any, merge?: boolean): void;
  4635. getLayout(): any;
  4636. getGraphicEl(): Element;
  4637. getRawIndex(): number;
  4638. }
  4639. declare class GraphEdge {
  4640. /**
  4641. * The first node. If directed graph, it represents the source node.
  4642. */
  4643. node1: GraphNode;
  4644. /**
  4645. * The second node. If directed graph, it represents the target node.
  4646. */
  4647. node2: GraphNode;
  4648. dataIndex: number;
  4649. hostGraph: Graph;
  4650. constructor(n1: GraphNode, n2: GraphNode, dataIndex?: number);
  4651. getModel<T = unknown>(): Model<T>;
  4652. getModel<T = unknown, S extends keyof T = keyof T>(path: S): Model<T[S]>;
  4653. getAdjacentDataIndices(): {
  4654. node: number[];
  4655. edge: number[];
  4656. };
  4657. }
  4658. interface GraphEdge extends GraphDataProxyMixin {
  4659. }
  4660. declare class GraphNode {
  4661. id: string;
  4662. inEdges: GraphEdge[];
  4663. outEdges: GraphEdge[];
  4664. edges: GraphEdge[];
  4665. hostGraph: Graph;
  4666. dataIndex: number;
  4667. __visited: boolean;
  4668. constructor(id?: string, dataIndex?: number);
  4669. /**
  4670. * @return {number}
  4671. */
  4672. degree(): number;
  4673. /**
  4674. * @return {number}
  4675. */
  4676. inDegree(): number;
  4677. /**
  4678. * @return {number}
  4679. */
  4680. outDegree(): number;
  4681. getModel<T = unknown>(): Model<T>;
  4682. getModel<T = unknown, S extends keyof T = keyof T>(path: S): Model<T[S]>;
  4683. getAdjacentDataIndices(): {
  4684. node: number[];
  4685. edge: number[];
  4686. };
  4687. }
  4688. interface GraphNode extends GraphDataProxyMixin {
  4689. }
  4690. declare type TreeTraverseOrder = 'preorder' | 'postorder';
  4691. declare type TreeTraverseCallback<Ctx> = (this: Ctx, node: TreeNode) => boolean | void;
  4692. declare type TreeTraverseOption = {
  4693. order?: TreeTraverseOrder;
  4694. attr?: 'children' | 'viewChildren';
  4695. };
  4696. interface TreeNodeOption extends Pick<OptionDataItemObject<OptionDataValue>, 'name' | 'value'> {
  4697. children?: TreeNodeOption[];
  4698. }
  4699. declare class TreeNode {
  4700. name: string;
  4701. depth: number;
  4702. height: number;
  4703. parentNode: TreeNode;
  4704. /**
  4705. * Reference to list item.
  4706. * Do not persistent dataIndex outside,
  4707. * besause it may be changed by list.
  4708. * If dataIndex -1,
  4709. * this node is logical deleted (filtered) in list.
  4710. */
  4711. dataIndex: number;
  4712. children: TreeNode[];
  4713. viewChildren: TreeNode[];
  4714. isExpand: boolean;
  4715. readonly hostTree: Tree<Model>;
  4716. constructor(name: string, hostTree: Tree<Model>);
  4717. /**
  4718. * The node is removed.
  4719. */
  4720. isRemoved(): boolean;
  4721. /**
  4722. * Travel this subtree (include this node).
  4723. * Usage:
  4724. * node.eachNode(function () { ... }); // preorder
  4725. * node.eachNode('preorder', function () { ... }); // preorder
  4726. * node.eachNode('postorder', function () { ... }); // postorder
  4727. * node.eachNode(
  4728. * {order: 'postorder', attr: 'viewChildren'},
  4729. * function () { ... }
  4730. * ); // postorder
  4731. *
  4732. * @param options If string, means order.
  4733. * @param options.order 'preorder' or 'postorder'
  4734. * @param options.attr 'children' or 'viewChildren'
  4735. * @param cb If in preorder and return false,
  4736. * its subtree will not be visited.
  4737. */
  4738. eachNode<Ctx>(options: TreeTraverseOrder, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4739. eachNode<Ctx>(options: TreeTraverseOption, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4740. eachNode<Ctx>(cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4741. /**
  4742. * Update depth and height of this subtree.
  4743. */
  4744. updateDepthAndHeight(depth: number): void;
  4745. getNodeById(id: string): TreeNode;
  4746. contains(node: TreeNode): boolean;
  4747. /**
  4748. * @param includeSelf Default false.
  4749. * @return order: [root, child, grandchild, ...]
  4750. */
  4751. getAncestors(includeSelf?: boolean): TreeNode[];
  4752. getAncestorsIndices(): number[];
  4753. getDescendantIndices(): number[];
  4754. getValue(dimension?: DimensionLoose): ParsedValue;
  4755. setLayout(layout: any, merge?: boolean): void;
  4756. /**
  4757. * @return {Object} layout
  4758. */
  4759. getLayout(): any;
  4760. getModel<T = unknown>(): Model<T>;
  4761. getLevelModel(): Model;
  4762. /**
  4763. * @example
  4764. * setItemVisual('color', color);
  4765. * setItemVisual({
  4766. * 'color': color
  4767. * });
  4768. */
  4769. setVisual(key: string, value: any): void;
  4770. setVisual(obj: Dictionary<any>): void;
  4771. /**
  4772. * Get item visual
  4773. * FIXME: make return type better
  4774. */
  4775. getVisual(key: string): unknown;
  4776. getRawIndex(): number;
  4777. getId(): string;
  4778. /**
  4779. * index in parent's children
  4780. */
  4781. getChildIndex(): number;
  4782. /**
  4783. * if this is an ancestor of another node
  4784. *
  4785. * @param node another node
  4786. * @return if is ancestor
  4787. */
  4788. isAncestorOf(node: TreeNode): boolean;
  4789. /**
  4790. * if this is an descendant of another node
  4791. *
  4792. * @param node another node
  4793. * @return if is descendant
  4794. */
  4795. isDescendantOf(node: TreeNode): boolean;
  4796. }
  4797. declare class Tree<HostModel extends Model = Model, LevelOption = any> {
  4798. type: 'tree';
  4799. root: TreeNode;
  4800. data: SeriesData;
  4801. hostModel: HostModel;
  4802. levelModels: Model<LevelOption>[];
  4803. private _nodes;
  4804. constructor(hostModel: HostModel);
  4805. /**
  4806. * Travel this subtree (include this node).
  4807. * Usage:
  4808. * node.eachNode(function () { ... }); // preorder
  4809. * node.eachNode('preorder', function () { ... }); // preorder
  4810. * node.eachNode('postorder', function () { ... }); // postorder
  4811. * node.eachNode(
  4812. * {order: 'postorder', attr: 'viewChildren'},
  4813. * function () { ... }
  4814. * ); // postorder
  4815. *
  4816. * @param options If string, means order.
  4817. * @param options.order 'preorder' or 'postorder'
  4818. * @param options.attr 'children' or 'viewChildren'
  4819. * @param cb
  4820. * @param context
  4821. */
  4822. eachNode<Ctx>(options: TreeTraverseOrder, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4823. eachNode<Ctx>(options: TreeTraverseOption, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4824. eachNode<Ctx>(cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4825. getNodeByDataIndex(dataIndex: number): TreeNode;
  4826. getNodeById(name: string): TreeNode;
  4827. /**
  4828. * Update item available by list,
  4829. * when list has been performed options like 'filterSelf' or 'map'.
  4830. */
  4831. update(): void;
  4832. /**
  4833. * Clear all layouts
  4834. */
  4835. clearLayouts(): void;
  4836. /**
  4837. * data node format:
  4838. * {
  4839. * name: ...
  4840. * value: ...
  4841. * children: [
  4842. * {
  4843. * name: ...
  4844. * value: ...
  4845. * children: ...
  4846. * },
  4847. * ...
  4848. * ]
  4849. * }
  4850. */
  4851. static createTree<T extends TreeNodeOption, HostModel extends Model>(dataRoot: T, hostModel: HostModel, beforeLink?: (data: SeriesData) => void): Tree<HostModel, any>;
  4852. }
  4853. declare type VisualOptionBase = {
  4854. [key in BuiltinVisualProperty]?: any;
  4855. };
  4856. declare type LabelFormatter = (min: OptionDataValue, max?: OptionDataValue) => string;
  4857. interface VisualMapOption<T extends VisualOptionBase = VisualOptionBase> extends ComponentOption, BoxLayoutOptionMixin, BorderOptionMixin {
  4858. mainType?: 'visualMap';
  4859. show?: boolean;
  4860. align?: string;
  4861. realtime?: boolean;
  4862. /**
  4863. * 'all' or null/undefined: all series.
  4864. * A number or an array of number: the specified series.
  4865. * set min: 0, max: 200, only for campatible with ec2.
  4866. * In fact min max should not have default value.
  4867. */
  4868. seriesIndex?: 'all' | number[] | number;
  4869. /**
  4870. * min value, must specified if pieces is not specified.
  4871. */
  4872. min?: number;
  4873. /**
  4874. * max value, must specified if pieces is not specified.
  4875. */
  4876. max?: number;
  4877. /**
  4878. * Dimension to be encoded
  4879. */
  4880. dimension?: number;
  4881. /**
  4882. * Visual configuration for the data in selection
  4883. */
  4884. inRange?: T;
  4885. /**
  4886. * Visual configuration for the out of selection
  4887. */
  4888. outOfRange?: T;
  4889. controller?: {
  4890. inRange?: T;
  4891. outOfRange?: T;
  4892. };
  4893. target?: {
  4894. inRange?: T;
  4895. outOfRange?: T;
  4896. };
  4897. /**
  4898. * Width of the display item
  4899. */
  4900. itemWidth?: number;
  4901. /**
  4902. * Height of the display item
  4903. */
  4904. itemHeight?: number;
  4905. inverse?: boolean;
  4906. orient?: 'horizontal' | 'vertical';
  4907. backgroundColor?: ZRColor;
  4908. contentColor?: ZRColor;
  4909. inactiveColor?: ZRColor;
  4910. /**
  4911. * Padding of the component. Can be an array similar to CSS
  4912. */
  4913. padding?: number[] | number;
  4914. /**
  4915. * Gap between text and item
  4916. */
  4917. textGap?: number;
  4918. precision?: number;
  4919. /**
  4920. * @deprecated
  4921. * Option from version 2
  4922. */
  4923. color?: ColorString[];
  4924. formatter?: string | LabelFormatter;
  4925. /**
  4926. * Text on the both end. Such as ['High', 'Low']
  4927. */
  4928. text?: string[];
  4929. textStyle?: LabelOption;
  4930. categories?: unknown;
  4931. }
  4932. interface VisualMeta {
  4933. stops: {
  4934. value: number;
  4935. color: ColorString;
  4936. }[];
  4937. outerColors: ColorString[];
  4938. dimension?: DimensionIndex;
  4939. }
  4940. declare type ItrParamDims = DimensionLoose | Array<DimensionLoose>;
  4941. declare type CtxOrList<Ctx> = unknown extends Ctx ? SeriesData : Ctx;
  4942. declare type EachCb0<Ctx> = (this: CtxOrList<Ctx>, idx: number) => void;
  4943. declare type EachCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => void;
  4944. declare type EachCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => void;
  4945. declare type EachCb$1<Ctx> = (this: CtxOrList<Ctx>, ...args: any) => void;
  4946. declare type FilterCb0<Ctx> = (this: CtxOrList<Ctx>, idx: number) => boolean;
  4947. declare type FilterCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => boolean;
  4948. declare type FilterCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => boolean;
  4949. declare type FilterCb$1<Ctx> = (this: CtxOrList<Ctx>, ...args: any) => boolean;
  4950. declare type MapArrayCb0<Ctx> = (this: CtxOrList<Ctx>, idx: number) => any;
  4951. declare type MapArrayCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => any;
  4952. declare type MapArrayCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => any;
  4953. declare type MapArrayCb<Ctx> = (this: CtxOrList<Ctx>, ...args: any) => any;
  4954. declare type MapCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => ParsedValue | ParsedValue[];
  4955. declare type MapCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => ParsedValue | ParsedValue[];
  4956. declare type SeriesDimensionDefineLoose = string | object | SeriesDimensionDefine;
  4957. declare type SeriesDimensionLoose = DimensionLoose;
  4958. declare type SeriesDimensionName = DimensionName;
  4959. interface DefaultDataVisual {
  4960. style: PathStyleProps;
  4961. drawType: 'fill' | 'stroke';
  4962. symbol?: string;
  4963. symbolSize?: number | number[];
  4964. symbolRotate?: number;
  4965. symbolKeepAspect?: boolean;
  4966. symbolOffset?: string | number | (string | number)[];
  4967. liftZ?: number;
  4968. legendIcon?: string;
  4969. legendLineStyle?: LineStyleProps;
  4970. visualMeta?: VisualMeta[];
  4971. colorFromPalette?: boolean;
  4972. decal?: DecalObject;
  4973. }
  4974. interface DataCalculationInfo<SERIES_MODEL> {
  4975. stackedDimension: DimensionName;
  4976. stackedByDimension: DimensionName;
  4977. isStackedByIndex: boolean;
  4978. stackedOverDimension: DimensionName;
  4979. stackResultDimension: DimensionName;
  4980. stackedOnSeries?: SERIES_MODEL;
  4981. }
  4982. declare class SeriesData<HostModel extends Model = Model, Visual extends DefaultDataVisual = DefaultDataVisual> {
  4983. readonly type = "list";
  4984. /**
  4985. * Name of dimensions list of SeriesData.
  4986. *
  4987. * @caution Carefully use the index of this array.
  4988. * Becuase when DataStore is an extra high dimension(>30) dataset. We will only pick
  4989. * the used dimensions from DataStore to avoid performance issue.
  4990. */
  4991. readonly dimensions: SeriesDimensionName[];
  4992. private _dimInfos;
  4993. private _dimOmitted;
  4994. private _schema?;
  4995. /**
  4996. * @pending
  4997. * Actually we do not really need to convert dimensionIndex to dimensionName
  4998. * and do not need `_dimIdxToName` if we do everything internally based on dimension
  4999. * index rather than dimension name.
  5000. */
  5001. private _dimIdxToName?;
  5002. readonly hostModel: HostModel;
  5003. /**
  5004. * @readonly
  5005. */
  5006. dataType: SeriesDataType;
  5007. /**
  5008. * @readonly
  5009. * Host graph if List is used to store graph nodes / edges.
  5010. */
  5011. graph?: Graph;
  5012. /**
  5013. * @readonly
  5014. * Host tree if List is used to store tree ndoes.
  5015. */
  5016. tree?: Tree;
  5017. private _store;
  5018. private _nameList;
  5019. private _idList;
  5020. private _visual;
  5021. private _layout;
  5022. private _itemVisuals;
  5023. private _itemLayouts;
  5024. private _graphicEls;
  5025. private _approximateExtent;
  5026. private _dimSummary;
  5027. private _invertedIndicesMap;
  5028. private _calculationInfo;
  5029. userOutput: DimensionSummary['userOutput'];
  5030. hasItemOption: boolean;
  5031. private _nameRepeatCount;
  5032. private _nameDimIdx;
  5033. private _idDimIdx;
  5034. private __wrappedMethods;
  5035. TRANSFERABLE_METHODS: readonly ["cloneShallow", "downSample", "lttbDownSample", "map"];
  5036. CHANGABLE_METHODS: readonly ["filterSelf", "selectRange"];
  5037. DOWNSAMPLE_METHODS: readonly ["downSample", "lttbDownSample"];
  5038. /**
  5039. * @param dimensionsInput.dimensions
  5040. * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].
  5041. * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius
  5042. */
  5043. constructor(dimensionsInput: SeriesDataSchema | SeriesDimensionDefineLoose[], hostModel: HostModel);
  5044. /**
  5045. *
  5046. * Get concrete dimension name by dimension name or dimension index.
  5047. * If input a dimension name, do not validate whether the dimension name exits.
  5048. *
  5049. * @caution
  5050. * @param dim Must make sure the dimension is `SeriesDimensionLoose`.
  5051. * Because only those dimensions will have auto-generated dimension names if not
  5052. * have a user-specified name, and other dimensions will get a return of null/undefined.
  5053. *
  5054. * @notice Becuause of this reason, should better use `getDimensionIndex` instead, for examples:
  5055. * ```js
  5056. * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx);
  5057. * ```
  5058. *
  5059. * @return Concrete dim name.
  5060. */
  5061. getDimension(dim: SeriesDimensionLoose): DimensionName;
  5062. /**
  5063. * Get dimension index in data store. Return -1 if not found.
  5064. * Can be used to index value from getRawValue.
  5065. */
  5066. getDimensionIndex(dim: DimensionLoose): DimensionIndex;
  5067. /**
  5068. * The meanings of the input parameter `dim`:
  5069. *
  5070. * + If dim is a number (e.g., `1`), it means the index of the dimension.
  5071. * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.
  5072. * + If dim is a number-like string (e.g., `"1"`):
  5073. * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`,
  5074. * it means that concrete name.
  5075. * + If not, it will be converted to a number, which means the index of the dimension.
  5076. * (why? because of the backward compatbility. We have been tolerating number-like string in
  5077. * dimension setting, although now it seems that it is not a good idea.)
  5078. * For example, `visualMap[i].dimension: "1"` is the same meaning as `visualMap[i].dimension: 1`,
  5079. * if no dimension name is defined as `"1"`.
  5080. * + If dim is a not-number-like string, it means the concrete dim name.
  5081. * For example, it can be be default name `"x"`, `"y"`, `"z"`, `"lng"`, `"lat"`, `"angle"`, `"radius"`,
  5082. * or customized in `dimensions` property of option like `"age"`.
  5083. *
  5084. * @return recogonized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`).
  5085. */
  5086. private _recognizeDimIndex;
  5087. private _getStoreDimIndex;
  5088. /**
  5089. * Get type and calculation info of particular dimension
  5090. * @param dim
  5091. * Dimension can be concrete names like x, y, z, lng, lat, angle, radius
  5092. * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'
  5093. */
  5094. getDimensionInfo(dim: SeriesDimensionLoose): SeriesDimensionDefine;
  5095. /**
  5096. * If `dimName` if from outside of `SeriesData`,
  5097. * use this method other than visit `this._dimInfos` directly.
  5098. */
  5099. private _getDimInfo;
  5100. private _initGetDimensionInfo;
  5101. /**
  5102. * concrete dimension name list on coord.
  5103. */
  5104. getDimensionsOnCoord(): SeriesDimensionName[];
  5105. /**
  5106. * @param coordDim
  5107. * @param idx A coordDim may map to more than one data dim.
  5108. * If not specified, return the first dim not extra.
  5109. * @return concrete data dim. If not found, return null/undefined
  5110. */
  5111. mapDimension(coordDim: SeriesDimensionName): SeriesDimensionName;
  5112. mapDimension(coordDim: SeriesDimensionName, idx: number): SeriesDimensionName;
  5113. mapDimensionsAll(coordDim: SeriesDimensionName): SeriesDimensionName[];
  5114. getStore(): DataStore;
  5115. /**
  5116. * Initialize from data
  5117. * @param data source or data or data store.
  5118. * @param nameList The name of a datum is used on data diff and
  5119. * default label/tooltip.
  5120. * A name can be specified in encode.itemName,
  5121. * or dataItem.name (only for series option data),
  5122. * or provided in nameList from outside.
  5123. */
  5124. initData(data: Source | OptionSourceData | DataStore | DataProvider, nameList?: string[], dimValueGetter?: DimValueGetter): void;
  5125. /**
  5126. * Caution: Can be only called on raw data (before `this._indices` created).
  5127. */
  5128. appendData(data: ArrayLike$1<any>): void;
  5129. /**
  5130. * Caution: Can be only called on raw data (before `this._indices` created).
  5131. * This method does not modify `rawData` (`dataProvider`), but only
  5132. * add values to store.
  5133. *
  5134. * The final count will be increased by `Math.max(values.length, names.length)`.
  5135. *
  5136. * @param values That is the SourceType: 'arrayRows', like
  5137. * [
  5138. * [12, 33, 44],
  5139. * [NaN, 43, 1],
  5140. * ['-', 'asdf', 0]
  5141. * ]
  5142. * Each item is exaclty cooresponding to a dimension.
  5143. */
  5144. appendValues(values: any[][], names?: string[]): void;
  5145. private _updateOrdinalMeta;
  5146. private _shouldMakeIdFromName;
  5147. private _doInit;
  5148. /**
  5149. * PENDING: In fact currently this function is only used to short-circuit
  5150. * the calling of `scale.unionExtentFromData` when data have been filtered by modules
  5151. * like "dataZoom". `scale.unionExtentFromData` is used to calculate data extent for series on
  5152. * an axis, but if a "axis related data filter module" is used, the extent of the axis have
  5153. * been fixed and no need to calling `scale.unionExtentFromData` actually.
  5154. * But if we add "custom data filter" in future, which is not "axis related", this method may
  5155. * be still needed.
  5156. *
  5157. * Optimize for the scenario that data is filtered by a given extent.
  5158. * Consider that if data amount is more than hundreds of thousand,
  5159. * extent calculation will cost more than 10ms and the cache will
  5160. * be erased because of the filtering.
  5161. */
  5162. getApproximateExtent(dim: SeriesDimensionLoose): [number, number];
  5163. /**
  5164. * Calculate extent on a filtered data might be time consuming.
  5165. * Approximate extent is only used for: calculte extent of filtered data outside.
  5166. */
  5167. setApproximateExtent(extent: [number, number], dim: SeriesDimensionLoose): void;
  5168. getCalculationInfo<CALC_INFO_KEY extends keyof DataCalculationInfo<HostModel>>(key: CALC_INFO_KEY): DataCalculationInfo<HostModel>[CALC_INFO_KEY];
  5169. /**
  5170. * @param key or k-v object
  5171. */
  5172. setCalculationInfo(key: DataCalculationInfo<HostModel>): void;
  5173. setCalculationInfo<CALC_INFO_KEY extends keyof DataCalculationInfo<HostModel>>(key: CALC_INFO_KEY, value: DataCalculationInfo<HostModel>[CALC_INFO_KEY]): void;
  5174. /**
  5175. * @return Never be null/undefined. `number` will be converted to string. Becuase:
  5176. * In most cases, name is used in display, where returning a string is more convenient.
  5177. * In other cases, name is used in query (see `indexOfName`), where we can keep the
  5178. * rule that name `2` equals to name `'2'`.
  5179. */
  5180. getName(idx: number): string;
  5181. private _getCategory;
  5182. /**
  5183. * @return Never null/undefined. `number` will be converted to string. Becuase:
  5184. * In all cases having encountered at present, id is used in making diff comparison, which
  5185. * are usually based on hash map. We can keep the rule that the internal id are always string
  5186. * (treat `2` is the same as `'2'`) to make the related logic simple.
  5187. */
  5188. getId(idx: number): string;
  5189. count(): number;
  5190. /**
  5191. * Get value. Return NaN if idx is out of range.
  5192. *
  5193. * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead.
  5194. */
  5195. get(dim: SeriesDimensionName, idx: number): ParsedValue;
  5196. /**
  5197. * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead.
  5198. */
  5199. getByRawIndex(dim: SeriesDimensionName, rawIdx: number): ParsedValue;
  5200. getIndices(): globalThis.ArrayLike<number>;
  5201. getDataExtent(dim: DimensionLoose): [number, number];
  5202. getSum(dim: DimensionLoose): number;
  5203. getMedian(dim: DimensionLoose): number;
  5204. /**
  5205. * Get value for multi dimensions.
  5206. * @param dimensions If ignored, using all dimensions.
  5207. */
  5208. getValues(idx: number): ParsedValue[];
  5209. getValues(dimensions: readonly DimensionName[], idx: number): ParsedValue[];
  5210. /**
  5211. * If value is NaN. Inlcuding '-'
  5212. * Only check the coord dimensions.
  5213. */
  5214. hasValue(idx: number): boolean;
  5215. /**
  5216. * Retreive the index with given name
  5217. */
  5218. indexOfName(name: string): number;
  5219. getRawIndex(idx: number): number;
  5220. indexOfRawIndex(rawIndex: number): number;
  5221. /**
  5222. * Only support the dimension which inverted index created.
  5223. * Do not support other cases until required.
  5224. * @param dim concrete dim
  5225. * @param value ordinal index
  5226. * @return rawIndex
  5227. */
  5228. rawIndexOf(dim: SeriesDimensionName, value: OrdinalNumber): number;
  5229. /**
  5230. * Retreive the index of nearest value
  5231. * @param dim
  5232. * @param value
  5233. * @param [maxDistance=Infinity]
  5234. * @return If and only if multiple indices has
  5235. * the same value, they are put to the result.
  5236. */
  5237. indicesOfNearest(dim: DimensionLoose, value: number, maxDistance?: number): number[];
  5238. /**
  5239. * Data iteration
  5240. * @param ctx default this
  5241. * @example
  5242. * list.each('x', function (x, idx) {});
  5243. * list.each(['x', 'y'], function (x, y, idx) {});
  5244. * list.each(function (idx) {})
  5245. */
  5246. each<Ctx>(cb: EachCb0<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
  5247. each<Ctx>(dims: DimensionLoose, cb: EachCb1<Ctx>, ctx?: Ctx): void;
  5248. each<Ctx>(dims: [DimensionLoose], cb: EachCb1<Ctx>, ctx?: Ctx): void;
  5249. each<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: EachCb2<Ctx>, ctx?: Ctx): void;
  5250. each<Ctx>(dims: ItrParamDims, cb: EachCb$1<Ctx>, ctx?: Ctx): void;
  5251. /**
  5252. * Data filter
  5253. */
  5254. filterSelf<Ctx>(cb: FilterCb0<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): this;
  5255. filterSelf<Ctx>(dims: DimensionLoose, cb: FilterCb1<Ctx>, ctx?: Ctx): this;
  5256. filterSelf<Ctx>(dims: [DimensionLoose], cb: FilterCb1<Ctx>, ctx?: Ctx): this;
  5257. filterSelf<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: FilterCb2<Ctx>, ctx?: Ctx): this;
  5258. filterSelf<Ctx>(dims: ItrParamDims, cb: FilterCb$1<Ctx>, ctx?: Ctx): this;
  5259. /**
  5260. * Select data in range. (For optimization of filter)
  5261. * (Manually inline code, support 5 million data filtering in data zoom.)
  5262. */
  5263. selectRange(range: Record<string, [number, number]>): SeriesData;
  5264. /**
  5265. * Data mapping to a plain array
  5266. */
  5267. mapArray<Ctx, Cb extends MapArrayCb0<Ctx>>(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 MapArrayCb1<Ctx>>(dims: [DimensionLoose], cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
  5270. mapArray<Ctx, Cb extends MapArrayCb2<Ctx>>(dims: [DimensionLoose, DimensionLoose], cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
  5271. mapArray<Ctx, Cb extends MapArrayCb<Ctx>>(dims: ItrParamDims, cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
  5272. /**
  5273. * Data mapping to a new List with given dimensions
  5274. */
  5275. map<Ctx>(dims: DimensionLoose, cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): SeriesData<HostModel>;
  5276. map<Ctx>(dims: [DimensionLoose], cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): SeriesData<HostModel>;
  5277. map<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: MapCb2<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): SeriesData<HostModel>;
  5278. /**
  5279. * !!Danger: used on stack dimension only.
  5280. */
  5281. modify<Ctx>(dims: DimensionLoose, cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
  5282. modify<Ctx>(dims: [DimensionLoose], cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
  5283. modify<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: MapCb2<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
  5284. /**
  5285. * Large data down sampling on given dimension
  5286. * @param sampleIndex Sample index for name and id
  5287. */
  5288. downSample(dimension: DimensionLoose, rate: number, sampleValue: (frameValues: ArrayLike$1<ParsedValue>) => ParsedValueNumeric, sampleIndex: (frameValues: ArrayLike$1<ParsedValue>, value: ParsedValueNumeric) => number): SeriesData<HostModel>;
  5289. /**
  5290. * Large data down sampling using largest-triangle-three-buckets
  5291. * @param {string} valueDimension
  5292. * @param {number} targetCount
  5293. */
  5294. lttbDownSample(valueDimension: DimensionLoose, rate: number): SeriesData<HostModel>;
  5295. getRawDataItem(idx: number): OptionDataItem;
  5296. /**
  5297. * Get model of one data item.
  5298. */
  5299. getItemModel<ItemOpts extends unknown = unknown>(idx: number): Model<ItemOpts>;
  5300. /**
  5301. * Create a data differ
  5302. */
  5303. diff(otherList: SeriesData): DataDiffer;
  5304. /**
  5305. * Get visual property.
  5306. */
  5307. getVisual<K extends keyof Visual>(key: K): Visual[K];
  5308. /**
  5309. * Set visual property
  5310. *
  5311. * @example
  5312. * setVisual('color', color);
  5313. * setVisual({
  5314. * 'color': color
  5315. * });
  5316. */
  5317. setVisual<K extends keyof Visual>(key: K, val: Visual[K]): void;
  5318. setVisual(kvObj: Partial<Visual>): void;
  5319. /**
  5320. * Get visual property of single data item
  5321. */
  5322. getItemVisual<K extends keyof Visual>(idx: number, key: K): Visual[K];
  5323. /**
  5324. * If exists visual property of single data item
  5325. */
  5326. hasItemVisual(): boolean;
  5327. /**
  5328. * Make sure itemVisual property is unique
  5329. */
  5330. ensureUniqueItemVisual<K extends keyof Visual>(idx: number, key: K): Visual[K];
  5331. /**
  5332. * Set visual property of single data item
  5333. *
  5334. * @param {number} idx
  5335. * @param {string|Object} key
  5336. * @param {*} [value]
  5337. *
  5338. * @example
  5339. * setItemVisual(0, 'color', color);
  5340. * setItemVisual(0, {
  5341. * 'color': color
  5342. * });
  5343. */
  5344. setItemVisual<K extends keyof Visual>(idx: number, key: K, value: Visual[K]): void;
  5345. setItemVisual(idx: number, kvObject: Partial<Visual>): void;
  5346. /**
  5347. * Clear itemVisuals and list visual.
  5348. */
  5349. clearAllVisual(): void;
  5350. /**
  5351. * Set layout property.
  5352. */
  5353. setLayout(key: string, val: any): void;
  5354. setLayout(kvObj: Dictionary<any>): void;
  5355. /**
  5356. * Get layout property.
  5357. */
  5358. getLayout(key: string): any;
  5359. /**
  5360. * Get layout of single data item
  5361. */
  5362. getItemLayout(idx: number): any;
  5363. /**
  5364. * Set layout of single data item
  5365. */
  5366. setItemLayout<M = false>(idx: number, layout: (M extends true ? Dictionary<any> : any), merge?: M): void;
  5367. /**
  5368. * Clear all layout of single data item
  5369. */
  5370. clearItemLayouts(): void;
  5371. /**
  5372. * Set graphic element relative to data. It can be set as null
  5373. */
  5374. setItemGraphicEl(idx: number, el: Element): void;
  5375. getItemGraphicEl(idx: number): Element;
  5376. eachItemGraphicEl<Ctx = unknown>(cb: (this: Ctx, el: Element, idx: number) => void, context?: Ctx): void;
  5377. /**
  5378. * Shallow clone a new list except visual and layout properties, and graph elements.
  5379. * New list only change the indices.
  5380. */
  5381. cloneShallow(list?: SeriesData<HostModel>): SeriesData<HostModel>;
  5382. /**
  5383. * Wrap some method to add more feature
  5384. */
  5385. wrapMethod(methodName: FunctionPropertyNames<SeriesData>, injectFunction: (...args: any) => any): void;
  5386. private static internalField;
  5387. }
  5388. interface SeriesData {
  5389. getLinkedData(dataType?: SeriesDataType): SeriesData;
  5390. getLinkedDataAll(): {
  5391. data: SeriesData;
  5392. type?: SeriesDataType;
  5393. }[];
  5394. }
  5395. /**
  5396. * If string, e.g., 'geo', means {geoIndex: 0}.
  5397. * If Object, could contain some of these properties below:
  5398. * {
  5399. * seriesIndex, seriesId, seriesName,
  5400. * geoIndex, geoId, geoName,
  5401. * bmapIndex, bmapId, bmapName,
  5402. * xAxisIndex, xAxisId, xAxisName,
  5403. * yAxisIndex, yAxisId, yAxisName,
  5404. * gridIndex, gridId, gridName,
  5405. * ... (can be extended)
  5406. * }
  5407. * Each properties can be number|string|Array.<number>|Array.<string>
  5408. * For example, a finder could be
  5409. * {
  5410. * seriesIndex: 3,
  5411. * geoId: ['aa', 'cc'],
  5412. * gridName: ['xx', 'rr']
  5413. * }
  5414. * xxxIndex can be set as 'all' (means all xxx) or 'none' (means not specify)
  5415. * If nothing or null/undefined specified, return nothing.
  5416. * If both `abcIndex`, `abcId`, `abcName` specified, only one work.
  5417. * The priority is: index > id > name, the same with `ecModel.queryComponents`.
  5418. */
  5419. declare type ModelFinderIndexQuery = number | number[] | 'all' | 'none' | false;
  5420. declare type ModelFinderIdQuery = OptionId | OptionId[];
  5421. declare type ModelFinderNameQuery = OptionId | OptionId[];
  5422. declare type ModelFinder = string | ModelFinderObject;
  5423. declare type ModelFinderObject = {
  5424. seriesIndex?: ModelFinderIndexQuery;
  5425. seriesId?: ModelFinderIdQuery;
  5426. seriesName?: ModelFinderNameQuery;
  5427. geoIndex?: ModelFinderIndexQuery;
  5428. geoId?: ModelFinderIdQuery;
  5429. geoName?: ModelFinderNameQuery;
  5430. bmapIndex?: ModelFinderIndexQuery;
  5431. bmapId?: ModelFinderIdQuery;
  5432. bmapName?: ModelFinderNameQuery;
  5433. xAxisIndex?: ModelFinderIndexQuery;
  5434. xAxisId?: ModelFinderIdQuery;
  5435. xAxisName?: ModelFinderNameQuery;
  5436. yAxisIndex?: ModelFinderIndexQuery;
  5437. yAxisId?: ModelFinderIdQuery;
  5438. yAxisName?: ModelFinderNameQuery;
  5439. gridIndex?: ModelFinderIndexQuery;
  5440. gridId?: ModelFinderIdQuery;
  5441. gridName?: ModelFinderNameQuery;
  5442. dataIndex?: number;
  5443. dataIndexInside?: number;
  5444. };
  5445. /**
  5446. * {
  5447. * seriesModels: [seriesModel1, seriesModel2],
  5448. * seriesModel: seriesModel1, // The first model
  5449. * geoModels: [geoModel1, geoModel2],
  5450. * geoModel: geoModel1, // The first model
  5451. * ...
  5452. * }
  5453. */
  5454. declare type ParsedModelFinder = {
  5455. [key: string]: ComponentModel | ComponentModel[] | undefined;
  5456. };
  5457. declare type QueryReferringOpt = {
  5458. useDefault?: boolean;
  5459. enableAll?: boolean;
  5460. enableNone?: boolean;
  5461. };
  5462. declare class ComponentModel<Opt extends ComponentOption = ComponentOption> extends Model<Opt> {
  5463. /**
  5464. * @readonly
  5465. */
  5466. type: ComponentFullType;
  5467. /**
  5468. * @readonly
  5469. */
  5470. id: string;
  5471. /**
  5472. * Because simplified concept is probably better, series.name (or component.name)
  5473. * has been having too many resposibilities:
  5474. * (1) Generating id (which requires name in option should not be modified).
  5475. * (2) As an index to mapping series when merging option or calling API (a name
  5476. * can refer to more then one components, which is convinient is some case).
  5477. * (3) Display.
  5478. * @readOnly But injected
  5479. */
  5480. name: string;
  5481. /**
  5482. * @readOnly
  5483. */
  5484. mainType: ComponentMainType;
  5485. /**
  5486. * @readOnly
  5487. */
  5488. subType: ComponentSubType;
  5489. /**
  5490. * @readOnly
  5491. */
  5492. componentIndex: number;
  5493. /**
  5494. * @readOnly
  5495. */
  5496. protected defaultOption: ComponentOption;
  5497. /**
  5498. * @readOnly
  5499. */
  5500. ecModel: GlobalModel;
  5501. /**
  5502. * @readOnly
  5503. */
  5504. static dependencies: string[];
  5505. readonly uid: string;
  5506. /**
  5507. * Support merge layout params.
  5508. * Only support 'box' now (left/right/top/bottom/width/height).
  5509. */
  5510. static layoutMode: ComponentLayoutMode | ComponentLayoutMode['type'];
  5511. /**
  5512. * Prevent from auto set z, zlevel, z2 by the framework.
  5513. */
  5514. preventAutoZ: boolean;
  5515. __viewId: string;
  5516. __requireNewView: boolean;
  5517. static protoInitialize: void;
  5518. constructor(option: Opt, parentModel: Model, ecModel: GlobalModel);
  5519. init(option: Opt, parentModel: Model, ecModel: GlobalModel): void;
  5520. mergeDefaultAndTheme(option: Opt, ecModel: GlobalModel): void;
  5521. mergeOption(option: Opt, ecModel: GlobalModel): void;
  5522. /**
  5523. * Called immediately after `init` or `mergeOption` of this instance called.
  5524. */
  5525. optionUpdated(newCptOption: Opt, isInit: boolean): void;
  5526. /**
  5527. * [How to declare defaultOption]:
  5528. *
  5529. * (A) If using class declaration in typescript (since echarts 5):
  5530. * ```ts
  5531. * import {ComponentOption} from '../model/option.js';
  5532. * export interface XxxOption extends ComponentOption {
  5533. * aaa: number
  5534. * }
  5535. * export class XxxModel extends Component {
  5536. * static type = 'xxx';
  5537. * static defaultOption: XxxOption = {
  5538. * aaa: 123
  5539. * }
  5540. * }
  5541. * Component.registerClass(XxxModel);
  5542. * ```
  5543. * ```ts
  5544. * import {inheritDefaultOption} from '../util/component.js';
  5545. * import {XxxModel, XxxOption} from './XxxModel.js';
  5546. * export interface XxxSubOption extends XxxOption {
  5547. * bbb: number
  5548. * }
  5549. * class XxxSubModel extends XxxModel {
  5550. * static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, {
  5551. * bbb: 456
  5552. * })
  5553. * fn() {
  5554. * let opt = this.getDefaultOption();
  5555. * // opt is {aaa: 123, bbb: 456}
  5556. * }
  5557. * }
  5558. * ```
  5559. *
  5560. * (B) If using class extend (previous approach in echarts 3 & 4):
  5561. * ```js
  5562. * let XxxComponent = Component.extend({
  5563. * defaultOption: {
  5564. * xx: 123
  5565. * }
  5566. * })
  5567. * ```
  5568. * ```js
  5569. * let XxxSubComponent = XxxComponent.extend({
  5570. * defaultOption: {
  5571. * yy: 456
  5572. * },
  5573. * fn: function () {
  5574. * let opt = this.getDefaultOption();
  5575. * // opt is {xx: 123, yy: 456}
  5576. * }
  5577. * })
  5578. * ```
  5579. */
  5580. getDefaultOption(): Opt;
  5581. /**
  5582. * Notice: always force to input param `useDefault` in case that forget to consider it.
  5583. * The same behavior as `modelUtil.parseFinder`.
  5584. *
  5585. * @param useDefault In many cases like series refer axis and axis refer grid,
  5586. * If axis index / axis id not specified, use the first target as default.
  5587. * In other cases like dataZoom refer axis, if not specified, measn no refer.
  5588. */
  5589. getReferringComponents(mainType: ComponentMainType, opt: QueryReferringOpt): {
  5590. models: ComponentModel[];
  5591. specified: boolean;
  5592. };
  5593. getBoxLayoutParams(): {
  5594. left: string | number;
  5595. top: string | number;
  5596. right: string | number;
  5597. bottom: string | number;
  5598. width: string | number;
  5599. height: string | number;
  5600. };
  5601. /**
  5602. * Get key for zlevel.
  5603. * If developers don't configure zlevel. We will assign zlevel to series based on the key.
  5604. * For example, lines with trail effect and progressive series will in an individual zlevel.
  5605. */
  5606. getZLevelKey(): string;
  5607. setZLevel(zlevel: number): void;
  5608. static registerClass: ClassManager['registerClass'];
  5609. static hasClass: ClassManager['hasClass'];
  5610. static registerSubTypeDefaulter: SubTypeDefaulterManager['registerSubTypeDefaulter'];
  5611. }
  5612. declare type AnimateOrSetPropsOption = {
  5613. dataIndex?: number;
  5614. cb?: () => void;
  5615. during?: (percent: number) => void;
  5616. removeOpt?: AnimationOption$1;
  5617. isFrom?: boolean;
  5618. };
  5619. /**
  5620. * Update graphic element properties with or without animation according to the
  5621. * configuration in series.
  5622. *
  5623. * Caution: this method will stop previous animation.
  5624. * So do not use this method to one element twice before
  5625. * animation starts, unless you know what you are doing.
  5626. * @example
  5627. * graphic.updateProps(el, {
  5628. * position: [100, 100]
  5629. * }, seriesModel, dataIndex, function () { console.log('Animation done!'); });
  5630. * // Or
  5631. * graphic.updateProps(el, {
  5632. * position: [100, 100]
  5633. * }, seriesModel, function () { console.log('Animation done!'); });
  5634. */
  5635. 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;
  5636. /**
  5637. * Init graphic element properties with or without animation according to the
  5638. * configuration in series.
  5639. *
  5640. * Caution: this method will stop previous animation.
  5641. * So do not use this method to one element twice before
  5642. * animation starts, unless you know what you are doing.
  5643. */
  5644. 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;
  5645. declare type ExtendShapeOpt = Parameters<typeof Path.extend>[0];
  5646. declare type ExtendShapeReturn = ReturnType<typeof Path.extend>;
  5647. /**
  5648. * Extend shape with parameters
  5649. */
  5650. declare function extendShape(opts: ExtendShapeOpt): ExtendShapeReturn;
  5651. declare const extendPathFromString: typeof extendFromString;
  5652. declare type SVGPathOption$1 = Parameters<typeof extendPathFromString>[1];
  5653. declare type SVGPathCtor = ReturnType<typeof extendPathFromString>;
  5654. declare type SVGPath$1 = InstanceType<SVGPathCtor>;
  5655. /**
  5656. * Extend path
  5657. */
  5658. declare function extendPath(pathData: string, opts: SVGPathOption$1): SVGPathCtor;
  5659. /**
  5660. * Register a user defined shape.
  5661. * The shape class can be fetched by `getShapeClass`
  5662. * This method will overwrite the registered shapes, including
  5663. * the registered built-in shapes, if using the same `name`.
  5664. * The shape can be used in `custom series` and
  5665. * `graphic component` by declaring `{type: name}`.
  5666. *
  5667. * @param name
  5668. * @param ShapeClass Can be generated by `extendShape`.
  5669. */
  5670. declare function registerShape(name: string, ShapeClass: {
  5671. new (): Path;
  5672. }): void;
  5673. /**
  5674. * Find shape class registered by `registerShape`. Usually used in
  5675. * fetching user defined shape.
  5676. *
  5677. * [Caution]:
  5678. * (1) This method **MUST NOT be used inside echarts !!!**, unless it is prepared
  5679. * to use user registered shapes.
  5680. * Because the built-in shape (see `getBuiltInShape`) will be registered by
  5681. * `registerShape` by default. That enables users to get both built-in
  5682. * shapes as well as the shapes belonging to themsleves. But users can overwrite
  5683. * the built-in shapes by using names like 'circle', 'rect' via calling
  5684. * `registerShape`. So the echarts inner featrues should not fetch shapes from here
  5685. * in case that it is overwritten by users, except that some features, like
  5686. * `custom series`, `graphic component`, do it deliberately.
  5687. *
  5688. * (2) In the features like `custom series`, `graphic component`, the user input
  5689. * `{tpye: 'xxx'}` does not only specify shapes but also specify other graphic
  5690. * elements like `'group'`, `'text'`, `'image'` or event `'path'`. Those names
  5691. * are reserved names, that is, if some user register a shape named `'image'`,
  5692. * the shape will not be used. If we intending to add some more reserved names
  5693. * in feature, that might bring break changes (disable some existing user shape
  5694. * names). But that case probably rearly happen. So we dont make more mechanism
  5695. * to resolve this issue here.
  5696. *
  5697. * @param name
  5698. * @return The shape class. If not found, return nothing.
  5699. */
  5700. declare function getShapeClass(name: string): {
  5701. new (): Path;
  5702. };
  5703. /**
  5704. * Create a path element from path data string
  5705. * @param pathData
  5706. * @param opts
  5707. * @param rect
  5708. * @param layout 'center' or 'cover' default to be cover
  5709. */
  5710. declare function makePath(pathData: string, opts: SVGPathOption$1, rect: ZRRectLike, layout?: 'center' | 'cover'): SVGPath$1;
  5711. /**
  5712. * Create a image element from image url
  5713. * @param imageUrl image url
  5714. * @param opts options
  5715. * @param rect constrain rect
  5716. * @param layout 'center' or 'cover'. Default to be 'cover'
  5717. */
  5718. declare function makeImage(imageUrl: string, rect: ZRRectLike, layout?: 'center' | 'cover'): ZRImage;
  5719. declare const mergePath$1: typeof mergePath;
  5720. /**
  5721. * Resize a path to fit the rect
  5722. * @param path
  5723. * @param rect
  5724. */
  5725. declare function resizePath(path: SVGPath$1, rect: ZRRectLike): void;
  5726. /**
  5727. * Get transform matrix of target (param target),
  5728. * in coordinate of its ancestor (param ancestor)
  5729. *
  5730. * @param target
  5731. * @param [ancestor]
  5732. */
  5733. declare function getTransform(target: Transformable, ancestor?: Transformable): MatrixArray;
  5734. declare function clipPointsByRect(points: VectorArray[], rect: ZRRectLike): number[][];
  5735. /**
  5736. * Return a new clipped rect. If rect size are negative, return undefined.
  5737. */
  5738. declare function clipRectByRect(targetRect: ZRRectLike, rect: ZRRectLike): ZRRectLike;
  5739. declare function createIcon(iconStr: string, // Support 'image://' or 'path://' or direct svg path.
  5740. opt?: Omit<DisplayableProps, 'style'>, rect?: ZRRectLike): SVGPath$1 | ZRImage;
  5741. declare type TextStyleProps$1 = ZRText['style'];
  5742. 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;
  5743. /**
  5744. * Add a comma each three digit.
  5745. */
  5746. declare function addCommas(x: string | number): string;
  5747. declare function toCamelCase(str: string, upperCaseFirst?: boolean): string;
  5748. declare const normalizeCssArray$1: typeof normalizeCssArray;
  5749. interface TplFormatterParam extends Dictionary<any> {
  5750. $vars: string[];
  5751. }
  5752. /**
  5753. * Template formatter
  5754. * @param {Array.<Object>|Object} paramsList
  5755. */
  5756. declare function formatTpl(tpl: string, paramsList: TplFormatterParam | TplFormatterParam[], encode?: boolean): string;
  5757. interface RichTextTooltipMarker {
  5758. renderMode: TooltipRenderMode;
  5759. content: string;
  5760. style: Dictionary<unknown>;
  5761. }
  5762. declare type TooltipMarker = string | RichTextTooltipMarker;
  5763. declare type TooltipMarkerType = 'item' | 'subItem';
  5764. interface GetTooltipMarkerOpt {
  5765. color?: ColorString;
  5766. extraCssText?: string;
  5767. type?: TooltipMarkerType;
  5768. renderMode?: TooltipRenderMode;
  5769. markerId?: string;
  5770. }
  5771. declare function getTooltipMarker(color: ColorString, extraCssText?: string): TooltipMarker;
  5772. declare function getTooltipMarker(opt: GetTooltipMarkerOpt): TooltipMarker;
  5773. /**
  5774. * @deprecated Use `time/format` instead.
  5775. * ISO Date format
  5776. * @param {string} tpl
  5777. * @param {number} value
  5778. * @param {boolean} [isUTC=false] Default in local time.
  5779. * see `module:echarts/scale/Time`
  5780. * and `module:echarts/util/number#parseDate`.
  5781. * @inner
  5782. */
  5783. declare function formatTime(tpl: string, value: unknown, isUTC?: boolean): string;
  5784. /**
  5785. * Capital first
  5786. * @param {string} str
  5787. * @return {string}
  5788. */
  5789. declare function capitalFirst(str: string): string;
  5790. interface MapperParamAxisInfo {
  5791. axisIndex: number;
  5792. axisName: string;
  5793. axisId: string;
  5794. axisDim: string;
  5795. }
  5796. interface AxisPointerLink {
  5797. xAxisIndex?: number[] | 'all';
  5798. yAxisIndex?: number[] | 'all';
  5799. xAxisId?: string[];
  5800. yAxisId?: string[];
  5801. xAxisName?: string[] | string;
  5802. yAxisName?: string[] | string;
  5803. radiusAxisIndex?: number[] | 'all';
  5804. angleAxisIndex?: number[] | 'all';
  5805. radiusAxisId?: string[];
  5806. angleAxisId?: string[];
  5807. radiusAxisName?: string[] | string;
  5808. angleAxisName?: string[] | string;
  5809. singleAxisIndex?: number[] | 'all';
  5810. singleAxisId?: string[];
  5811. singleAxisName?: string[] | string;
  5812. mapper?(sourceVal: ScaleDataValue, sourceAxisInfo: MapperParamAxisInfo, targetAxisInfo: MapperParamAxisInfo): CommonAxisPointerOption['value'];
  5813. }
  5814. interface AxisPointerOption extends ComponentOption, Omit<CommonAxisPointerOption, 'type'> {
  5815. mainType?: 'axisPointer';
  5816. type?: 'line' | 'shadow' | 'cross' | 'none';
  5817. link?: AxisPointerLink[];
  5818. }
  5819. declare type TopLevelFormatterParams = CallbackDataParams | CallbackDataParams[];
  5820. interface TooltipOption extends CommonTooltipOption<TopLevelFormatterParams>, ComponentOption {
  5821. mainType?: 'tooltip';
  5822. axisPointer?: AxisPointerOption & {
  5823. axis?: 'auto' | 'x' | 'y' | 'angle' | 'radius';
  5824. crossStyle?: LineStyleOption & {
  5825. textStyle?: LabelOption;
  5826. };
  5827. };
  5828. /**
  5829. * If show popup content
  5830. */
  5831. showContent?: boolean;
  5832. /**
  5833. * Trigger only works on coordinate system.
  5834. */
  5835. trigger?: 'item' | 'axis' | 'none';
  5836. displayMode?: 'single' | 'multipleByCoordSys';
  5837. /**
  5838. * 'auto': use html by default, and use non-html if `document` is not defined
  5839. * 'html': use html for tooltip
  5840. * 'richText': use canvas, svg, and etc. for tooltip
  5841. */
  5842. renderMode?: 'auto' | TooltipRenderMode;
  5843. /**
  5844. * If append popup dom to document.body
  5845. * Only available when renderMode is html
  5846. */
  5847. appendToBody?: boolean;
  5848. /**
  5849. * specified class name of tooltip dom
  5850. * Only available when renderMode is html
  5851. */
  5852. className?: string;
  5853. order?: TooltipOrderMode;
  5854. }
  5855. /**
  5856. * This is an abstract layer to insulate the upper usage of tooltip content
  5857. * from the different backends according to different `renderMode` ('html' or 'richText').
  5858. * With the help of the abstract layer, it does not need to consider how to create and
  5859. * assemble html or richText snippets when making tooltip content.
  5860. *
  5861. * @usage
  5862. *
  5863. * ```ts
  5864. * class XxxSeriesModel {
  5865. * formatTooltip(
  5866. * dataIndex: number,
  5867. * multipleSeries: boolean,
  5868. * dataType: string
  5869. * ) {
  5870. * ...
  5871. * return createTooltipMarkup('section', {
  5872. * header: header,
  5873. * blocks: [
  5874. * createTooltipMarkup('nameValue', {
  5875. * name: name,
  5876. * value: value,
  5877. * noValue: value == null
  5878. * })
  5879. * ]
  5880. * });
  5881. * }
  5882. * }
  5883. * ```
  5884. */
  5885. declare type TooltipMarkupBlockFragment = TooltipMarkupSection | TooltipMarkupNameValueBlock;
  5886. interface TooltipMarkupBlock {
  5887. sortParam?: unknown;
  5888. }
  5889. interface TooltipMarkupSection extends TooltipMarkupBlock {
  5890. type: 'section';
  5891. header?: unknown;
  5892. noHeader?: boolean;
  5893. blocks?: TooltipMarkupBlockFragment[];
  5894. sortBlocks?: boolean;
  5895. valueFormatter?: CommonTooltipOption<unknown>['valueFormatter'];
  5896. }
  5897. interface TooltipMarkupNameValueBlock extends TooltipMarkupBlock {
  5898. type: 'nameValue';
  5899. markerType?: TooltipMarkerType;
  5900. markerColor?: ColorString;
  5901. name?: string;
  5902. value?: unknown | unknown[];
  5903. valueType?: DimensionType | DimensionType[];
  5904. noName?: boolean;
  5905. noValue?: boolean;
  5906. valueFormatter?: CommonTooltipOption<unknown>['valueFormatter'];
  5907. }
  5908. interface DataFormatMixin extends DataHost {
  5909. ecModel: GlobalModel;
  5910. mainType: ComponentMainType;
  5911. subType: ComponentSubType;
  5912. componentIndex: number;
  5913. id: string;
  5914. name: string;
  5915. animatedValue: OptionDataValue[];
  5916. }
  5917. declare class DataFormatMixin {
  5918. /**
  5919. * Get params for formatter
  5920. */
  5921. getDataParams(dataIndex: number, dataType?: SeriesDataType): CallbackDataParams;
  5922. /**
  5923. * Format label
  5924. * @param dataIndex
  5925. * @param status 'normal' by default
  5926. * @param dataType
  5927. * @param labelDimIndex Only used in some chart that
  5928. * use formatter in different dimensions, like radar.
  5929. * @param formatter Formatter given outside.
  5930. * @return return null/undefined if no formatter
  5931. */
  5932. getFormattedLabel(dataIndex: number, status?: DisplayState, dataType?: SeriesDataType, labelDimIndex?: number, formatter?: string | ((params: object) => string), extendParams?: {
  5933. interpolatedValue: InterpolatableValue;
  5934. }): string;
  5935. /**
  5936. * Get raw value in option
  5937. */
  5938. getRawValue(idx: number, dataType?: SeriesDataType): unknown;
  5939. /**
  5940. * Should be implemented.
  5941. * @param {number} dataIndex
  5942. * @param {boolean} [multipleSeries=false]
  5943. * @param {string} [dataType]
  5944. */
  5945. formatTooltip(dataIndex: number, multipleSeries?: boolean, dataType?: string): TooltipFormatResult;
  5946. }
  5947. declare type TooltipFormatResult = string | TooltipMarkupBlockFragment;
  5948. /**
  5949. * [Notice]:
  5950. * Consider custom bundle on demand, chart specified
  5951. * or component specified types and constants should
  5952. * not put here. Only common types and constants can
  5953. * be put in this file.
  5954. */
  5955. declare type RendererType = 'canvas' | 'svg';
  5956. declare type LayoutOrient = 'vertical' | 'horizontal';
  5957. declare type HorizontalAlign = 'left' | 'center' | 'right';
  5958. declare type VerticalAlign = 'top' | 'middle' | 'bottom';
  5959. declare type ColorString = string;
  5960. declare type ZRColor = ColorString | LinearGradientObject | RadialGradientObject | PatternObject;
  5961. declare type ZRLineType = 'solid' | 'dotted' | 'dashed' | number | number[];
  5962. declare type ZRFontStyle = 'normal' | 'italic' | 'oblique';
  5963. declare type ZRFontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' | number;
  5964. declare type ZREasing = AnimationEasing;
  5965. declare type ZRTextAlign = TextAlign;
  5966. declare type ZRTextVerticalAlign = TextVerticalAlign;
  5967. declare type ZRRectLike = RectLike;
  5968. declare type ZRStyleProps = PathStyleProps | ImageStyleProps | TSpanStyleProps | TextStyleProps;
  5969. declare type ZRElementEventName = ElementEventName | 'globalout';
  5970. declare type ComponentFullType = string;
  5971. declare type ComponentMainType = keyof ECUnitOption & string;
  5972. declare type ComponentSubType = Exclude<ComponentOption['type'], undefined>;
  5973. interface DataHost {
  5974. getData(dataType?: SeriesDataType): SeriesData;
  5975. }
  5976. interface DataModel extends Model<unknown>, DataHost, DataFormatMixin {
  5977. }
  5978. interface PayloadItem {
  5979. excludeSeriesId?: OptionId | OptionId[];
  5980. animation?: PayloadAnimationPart;
  5981. [other: string]: any;
  5982. }
  5983. interface Payload extends PayloadItem {
  5984. type: string;
  5985. escapeConnect?: boolean;
  5986. batch?: PayloadItem[];
  5987. }
  5988. interface PayloadAnimationPart {
  5989. duration?: number;
  5990. easing?: AnimationEasing;
  5991. delay?: number;
  5992. }
  5993. interface ViewRootGroup extends Group {
  5994. __ecComponentInfo?: {
  5995. mainType: string;
  5996. index: number;
  5997. };
  5998. }
  5999. interface ECElementEvent extends ECEventData, CallbackDataParams {
  6000. type: ZRElementEventName;
  6001. event?: ElementEvent;
  6002. }
  6003. /**
  6004. * The echarts event type to user.
  6005. * Also known as packedEvent.
  6006. */
  6007. interface ECActionEvent extends ECEventData {
  6008. type: string;
  6009. componentType?: string;
  6010. componentIndex?: number;
  6011. seriesIndex?: number;
  6012. escapeConnect?: boolean;
  6013. batch?: ECEventData;
  6014. }
  6015. interface ECEventData {
  6016. [key: string]: any;
  6017. }
  6018. interface EventQueryItem {
  6019. [key: string]: any;
  6020. }
  6021. interface ActionInfo {
  6022. type: string;
  6023. event?: string;
  6024. update?: string;
  6025. }
  6026. interface ActionHandler {
  6027. (payload: Payload, ecModel: GlobalModel, api: ExtensionAPI): void | ECEventData;
  6028. }
  6029. interface OptionPreprocessor {
  6030. (option: ECUnitOption, isTheme: boolean): void;
  6031. }
  6032. interface PostUpdater {
  6033. (ecModel: GlobalModel, api: ExtensionAPI): void;
  6034. }
  6035. interface StageHandlerReset {
  6036. (seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): StageHandlerProgressExecutor | StageHandlerProgressExecutor[] | void;
  6037. }
  6038. interface StageHandlerOverallReset {
  6039. (ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): void;
  6040. }
  6041. interface StageHandler {
  6042. /**
  6043. * Indicate that the task will be piped all series
  6044. * (`performRawSeries` indicate whether includes filtered series).
  6045. */
  6046. createOnAllSeries?: boolean;
  6047. /**
  6048. * Indicate that the task will be only piped in the pipeline of this type of series.
  6049. * (`performRawSeries` indicate whether includes filtered series).
  6050. */
  6051. seriesType?: string;
  6052. /**
  6053. * Indicate that the task will be only piped in the pipeline of the returned series.
  6054. */
  6055. getTargetSeries?: (ecModel: GlobalModel, api: ExtensionAPI) => HashMap<SeriesModel>;
  6056. /**
  6057. * If `true`, filtered series will also be "performed".
  6058. */
  6059. performRawSeries?: boolean;
  6060. /**
  6061. * Called only when this task in a pipeline.
  6062. */
  6063. plan?: StageHandlerPlan;
  6064. /**
  6065. * If `overallReset` specified, an "overall task" will be created.
  6066. * "overall task" does not belong to a certain pipeline.
  6067. * They always be "performed" in certain phase (depends on when they declared).
  6068. * They has "stub"s to connect with pipelines (one stub for one pipeline),
  6069. * delivering info like "dirty" and "output end".
  6070. */
  6071. overallReset?: StageHandlerOverallReset;
  6072. /**
  6073. * Called only when this task in a pipeline, and "dirty".
  6074. */
  6075. reset?: StageHandlerReset;
  6076. }
  6077. interface StageHandlerInternal extends StageHandler {
  6078. uid: string;
  6079. visualType?: 'layout' | 'visual';
  6080. __prio: number;
  6081. __raw: StageHandler | StageHandlerOverallReset;
  6082. isVisual?: boolean;
  6083. isLayout?: boolean;
  6084. }
  6085. declare type StageHandlerProgressParams = TaskProgressParams;
  6086. interface StageHandlerProgressExecutor {
  6087. dataEach?: (data: SeriesData, idx: number) => void;
  6088. progress?: (params: StageHandlerProgressParams, data: SeriesData) => void;
  6089. }
  6090. declare type StageHandlerPlanReturn = TaskPlanCallbackReturn;
  6091. interface StageHandlerPlan {
  6092. (seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): StageHandlerPlanReturn;
  6093. }
  6094. interface LoadingEffectCreator {
  6095. (api: ExtensionAPI, cfg: object): LoadingEffect;
  6096. }
  6097. interface LoadingEffect extends Element {
  6098. resize: () => void;
  6099. }
  6100. /**
  6101. * 'html' is used for rendering tooltip in extra DOM form, and the result
  6102. * string is used as DOM HTML content.
  6103. * 'richText' is used for rendering tooltip in rich text form, for those where
  6104. * DOM operation is not supported.
  6105. */
  6106. declare type TooltipRenderMode = 'html' | 'richText';
  6107. declare type TooltipOrderMode = 'valueAsc' | 'valueDesc' | 'seriesAsc' | 'seriesDesc';
  6108. declare type OrdinalRawValue = string | number;
  6109. declare type OrdinalNumber = number;
  6110. /**
  6111. * @usage For example,
  6112. * ```js
  6113. * { ordinalNumbers: [2, 5, 3, 4] }
  6114. * ```
  6115. * means that ordinal 2 should be diplayed on tick 0,
  6116. * ordinal 5 should be displayed on tick 1, ...
  6117. */
  6118. declare type OrdinalSortInfo = {
  6119. ordinalNumbers: OrdinalNumber[];
  6120. };
  6121. /**
  6122. * `OptionDataValue` is the primitive value in `series.data` or `dataset.source`.
  6123. * `OptionDataValue` are parsed (see `src/data/helper/dataValueHelper.parseDataValue`)
  6124. * into `ParsedValue` and stored into `data/SeriesData` storage.
  6125. * Note:
  6126. * (1) The term "parse" does not mean `src/scale/Scale['parse']`.
  6127. * (2) If a category dimension is not mapped to any axis, its raw value will NOT be
  6128. * parsed to `OrdinalNumber` but keep the original `OrdinalRawValue` in `src/data/SeriesData` storage.
  6129. */
  6130. declare type ParsedValue = ParsedValueNumeric | OrdinalRawValue;
  6131. declare type ParsedValueNumeric = number | OrdinalNumber;
  6132. /**
  6133. * `ScaleDataValue` means that the user input primitive value to `src/scale/Scale`.
  6134. * (For example, used in `axis.min`, `axis.max`, `convertToPixel`).
  6135. * Note:
  6136. * `ScaleDataValue` is a little different from `OptionDataValue`, because it will not go through
  6137. * `src/data/helper/dataValueHelper.parseDataValue`, but go through `src/scale/Scale['parse']`.
  6138. */
  6139. declare type ScaleDataValue = ParsedValueNumeric | OrdinalRawValue | Date;
  6140. interface ScaleTick {
  6141. level?: number;
  6142. value: number;
  6143. }
  6144. declare type DimensionIndex = number;
  6145. declare type DimensionIndexLoose = DimensionIndex | string;
  6146. declare type DimensionName = string;
  6147. declare type DimensionLoose = DimensionName | DimensionIndexLoose;
  6148. declare type DimensionType = DataStoreDimensionType;
  6149. interface DataVisualDimensions {
  6150. tooltip?: DimensionIndex | false;
  6151. label?: DimensionIndex;
  6152. itemName?: DimensionIndex;
  6153. itemId?: DimensionIndex;
  6154. itemGroupId?: DimensionIndex;
  6155. seriesName?: DimensionIndex;
  6156. }
  6157. declare type DimensionDefinition = {
  6158. type?: DataStoreDimensionType;
  6159. name?: DimensionName;
  6160. displayName?: string;
  6161. };
  6162. declare type DimensionDefinitionLoose = DimensionDefinition['name'] | DimensionDefinition;
  6163. declare const SOURCE_FORMAT_ORIGINAL: "original";
  6164. declare const SOURCE_FORMAT_ARRAY_ROWS: "arrayRows";
  6165. declare const SOURCE_FORMAT_OBJECT_ROWS: "objectRows";
  6166. declare const SOURCE_FORMAT_KEYED_COLUMNS: "keyedColumns";
  6167. declare const SOURCE_FORMAT_TYPED_ARRAY: "typedArray";
  6168. declare const SOURCE_FORMAT_UNKNOWN: "unknown";
  6169. 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;
  6170. declare const SERIES_LAYOUT_BY_COLUMN: "column";
  6171. declare const SERIES_LAYOUT_BY_ROW: "row";
  6172. declare type SeriesLayoutBy = typeof SERIES_LAYOUT_BY_COLUMN | typeof SERIES_LAYOUT_BY_ROW;
  6173. declare type OptionSourceHeader = boolean | 'auto' | number;
  6174. declare type SeriesDataType = 'main' | 'node' | 'edge';
  6175. /**
  6176. * [ECUnitOption]:
  6177. * An object that contains definitions of components
  6178. * and other properties. For example:
  6179. *
  6180. * ```ts
  6181. * let option: ECUnitOption = {
  6182. *
  6183. * // Single `title` component:
  6184. * title: {...},
  6185. *
  6186. * // Two `visualMap` components:
  6187. * visualMap: [{...}, {...}],
  6188. *
  6189. * // Two `series.bar` components
  6190. * // and one `series.pie` component:
  6191. * series: [
  6192. * {type: 'bar', data: [...]},
  6193. * {type: 'bar', data: [...]},
  6194. * {type: 'pie', data: [...]}
  6195. * ],
  6196. *
  6197. * // A property:
  6198. * backgroundColor: '#421ae4'
  6199. *
  6200. * // A property object:
  6201. * textStyle: {
  6202. * color: 'red',
  6203. * fontSize: 20
  6204. * }
  6205. * };
  6206. * ```
  6207. */
  6208. declare type ECUnitOption = {
  6209. baseOption?: unknown;
  6210. options?: unknown;
  6211. media?: unknown;
  6212. timeline?: ComponentOption | ComponentOption[];
  6213. backgroundColor?: ZRColor;
  6214. darkMode?: boolean | 'auto';
  6215. textStyle?: Pick<LabelOption, 'color' | 'fontStyle' | 'fontWeight' | 'fontSize' | 'fontFamily'>;
  6216. useUTC?: boolean;
  6217. [key: string]: ComponentOption | ComponentOption[] | Dictionary<unknown> | unknown;
  6218. stateAnimation?: AnimationOption$1;
  6219. } & AnimationOptionMixin & ColorPaletteOptionMixin;
  6220. /**
  6221. * [ECOption]:
  6222. * An object input to echarts.setOption(option).
  6223. * May be an 'option: ECUnitOption',
  6224. * or may be an object contains multi-options. For example:
  6225. *
  6226. * ```ts
  6227. * let option: ECOption = {
  6228. * baseOption: {
  6229. * title: {...},
  6230. * legend: {...},
  6231. * series: [
  6232. * {data: [...]},
  6233. * {data: [...]},
  6234. * ...
  6235. * ]
  6236. * },
  6237. * timeline: {...},
  6238. * options: [
  6239. * {title: {...}, series: {data: [...]}},
  6240. * {title: {...}, series: {data: [...]}},
  6241. * ...
  6242. * ],
  6243. * media: [
  6244. * {
  6245. * query: {maxWidth: 320},
  6246. * option: {series: {x: 20}, visualMap: {show: false}}
  6247. * },
  6248. * {
  6249. * query: {minWidth: 320, maxWidth: 720},
  6250. * option: {series: {x: 500}, visualMap: {show: true}}
  6251. * },
  6252. * {
  6253. * option: {series: {x: 1200}, visualMap: {show: true}}
  6254. * }
  6255. * ]
  6256. * };
  6257. * ```
  6258. */
  6259. interface ECBasicOption extends ECUnitOption {
  6260. baseOption?: ECUnitOption;
  6261. timeline?: ComponentOption | ComponentOption[];
  6262. options?: ECUnitOption[];
  6263. media?: MediaUnit[];
  6264. }
  6265. declare type OptionSourceData<VAL extends OptionDataValue = OptionDataValue, ORIITEM extends OptionDataItemOriginal<VAL> = OptionDataItemOriginal<VAL>> = OptionSourceDataOriginal<VAL, ORIITEM> | OptionSourceDataObjectRows<VAL> | OptionSourceDataArrayRows<VAL> | OptionSourceDataKeyedColumns<VAL> | OptionSourceDataTypedArray;
  6266. declare type OptionDataItemOriginal<VAL extends OptionDataValue = OptionDataValue> = VAL | VAL[] | OptionDataItemObject<VAL>;
  6267. declare type OptionSourceDataOriginal<VAL extends OptionDataValue = OptionDataValue, ORIITEM extends OptionDataItemOriginal<VAL> = OptionDataItemOriginal<VAL>> = ArrayLike<ORIITEM>;
  6268. declare type OptionSourceDataObjectRows<VAL extends OptionDataValue = OptionDataValue> = Array<Dictionary<VAL>>;
  6269. declare type OptionSourceDataArrayRows<VAL extends OptionDataValue = OptionDataValue> = Array<Array<VAL>>;
  6270. declare type OptionSourceDataKeyedColumns<VAL extends OptionDataValue = OptionDataValue> = Dictionary<ArrayLike<VAL>>;
  6271. declare type OptionSourceDataTypedArray = ArrayLike<number>;
  6272. declare type OptionDataItem = OptionDataValue | Dictionary<OptionDataValue> | OptionDataValue[] | OptionDataItemObject<OptionDataValue>;
  6273. declare type OptionDataItemObject<T> = {
  6274. id?: OptionId;
  6275. name?: OptionName;
  6276. groupId?: OptionId;
  6277. value?: T[] | T;
  6278. selected?: boolean;
  6279. };
  6280. declare type OptionId = string | number;
  6281. declare type OptionName = string | number;
  6282. interface GraphEdgeItemObject<VAL extends OptionDataValue> extends OptionDataItemObject<VAL> {
  6283. /**
  6284. * Name or index of source node.
  6285. */
  6286. source?: string | number;
  6287. /**
  6288. * Name or index of target node.
  6289. */
  6290. target?: string | number;
  6291. }
  6292. declare type OptionDataValue = string | number | Date;
  6293. declare type OptionDataValueNumeric = number | '-';
  6294. declare type OptionDataValueDate = Date | string | number;
  6295. declare type ModelOption = any;
  6296. declare type ThemeOption = Dictionary<any>;
  6297. declare type DisplayState = 'normal' | 'emphasis' | 'blur' | 'select';
  6298. interface OptionEncodeVisualDimensions {
  6299. tooltip?: OptionEncodeValue;
  6300. label?: OptionEncodeValue;
  6301. itemName?: OptionEncodeValue;
  6302. itemId?: OptionEncodeValue;
  6303. seriesName?: OptionEncodeValue;
  6304. itemGroupId?: OptionEncodeValue;
  6305. }
  6306. interface OptionEncode extends OptionEncodeVisualDimensions {
  6307. [coordDim: string]: OptionEncodeValue | undefined;
  6308. }
  6309. declare type OptionEncodeValue = DimensionLoose | DimensionLoose[];
  6310. declare type EncodeDefaulter = (source: Source, dimCount: number) => OptionEncode;
  6311. interface CallbackDataParams {
  6312. componentType: string;
  6313. componentSubType: string;
  6314. componentIndex: number;
  6315. seriesType?: string;
  6316. seriesIndex?: number;
  6317. seriesId?: string;
  6318. seriesName?: string;
  6319. name: string;
  6320. dataIndex: number;
  6321. data: OptionDataItem;
  6322. dataType?: SeriesDataType;
  6323. value: OptionDataItem | OptionDataValue;
  6324. color?: ZRColor;
  6325. borderColor?: string;
  6326. dimensionNames?: DimensionName[];
  6327. encode?: DimensionUserOuputEncode;
  6328. marker?: TooltipMarker;
  6329. status?: DisplayState;
  6330. dimensionIndex?: number;
  6331. percent?: number;
  6332. $vars: string[];
  6333. }
  6334. declare type InterpolatableValue = ParsedValue | ParsedValue[];
  6335. declare type DecalDashArrayX = number | (number | number[])[];
  6336. declare type DecalDashArrayY = number | number[];
  6337. interface DecalObject {
  6338. symbol?: string | string[];
  6339. symbolSize?: number;
  6340. symbolKeepAspect?: boolean;
  6341. color?: string;
  6342. backgroundColor?: string;
  6343. dashArrayX?: DecalDashArrayX;
  6344. dashArrayY?: DecalDashArrayY;
  6345. rotation?: number;
  6346. maxTileWidth?: number;
  6347. maxTileHeight?: number;
  6348. }
  6349. interface MediaQuery {
  6350. minWidth?: number;
  6351. maxWidth?: number;
  6352. minHeight?: number;
  6353. maxHeight?: number;
  6354. minAspectRatio?: number;
  6355. maxAspectRatio?: number;
  6356. }
  6357. declare type MediaUnit = {
  6358. query?: MediaQuery;
  6359. option: ECUnitOption;
  6360. };
  6361. declare type ComponentLayoutMode = {
  6362. type?: 'box';
  6363. ignoreSize?: boolean | boolean[];
  6364. };
  6365. /******************* Mixins for Common Option Properties ********************** */
  6366. declare type PaletteOptionMixin = ColorPaletteOptionMixin;
  6367. interface ColorPaletteOptionMixin {
  6368. color?: ZRColor | ZRColor[];
  6369. colorLayer?: ZRColor[][];
  6370. }
  6371. /**
  6372. * Mixin of option set to control the box layout of each component.
  6373. */
  6374. interface BoxLayoutOptionMixin {
  6375. width?: number | string;
  6376. height?: number | string;
  6377. top?: number | string;
  6378. right?: number | string;
  6379. bottom?: number | string;
  6380. left?: number | string;
  6381. }
  6382. interface CircleLayoutOptionMixin {
  6383. center?: (number | string)[];
  6384. radius?: (number | string)[] | number | string;
  6385. }
  6386. interface ShadowOptionMixin {
  6387. shadowBlur?: number;
  6388. shadowColor?: ColorString;
  6389. shadowOffsetX?: number;
  6390. shadowOffsetY?: number;
  6391. }
  6392. interface BorderOptionMixin {
  6393. borderColor?: ZRColor;
  6394. borderWidth?: number;
  6395. borderType?: ZRLineType;
  6396. borderCap?: CanvasLineCap;
  6397. borderJoin?: CanvasLineJoin;
  6398. borderDashOffset?: number;
  6399. borderMiterLimit?: number;
  6400. }
  6401. declare type ColorBy = 'series' | 'data';
  6402. interface SunburstColorByMixin {
  6403. colorBy?: ColorBy;
  6404. }
  6405. declare type AnimationDelayCallbackParam = {
  6406. count: number;
  6407. index: number;
  6408. };
  6409. declare type AnimationDurationCallback = (idx: number) => number;
  6410. declare type AnimationDelayCallback = (idx: number, params?: AnimationDelayCallbackParam) => number;
  6411. interface AnimationOption$1 {
  6412. duration?: number;
  6413. easing?: AnimationEasing;
  6414. delay?: number;
  6415. }
  6416. /**
  6417. * Mixin of option set to control the animation of series.
  6418. */
  6419. interface AnimationOptionMixin {
  6420. /**
  6421. * If enable animation
  6422. */
  6423. animation?: boolean;
  6424. /**
  6425. * Disable animation when the number of elements exceeds the threshold
  6426. */
  6427. animationThreshold?: number;
  6428. /**
  6429. * Duration of initialize animation.
  6430. * Can be a callback to specify duration of each element
  6431. */
  6432. animationDuration?: number | AnimationDurationCallback;
  6433. /**
  6434. * Easing of initialize animation
  6435. */
  6436. animationEasing?: AnimationEasing;
  6437. /**
  6438. * Delay of initialize animation
  6439. * Can be a callback to specify duration of each element
  6440. */
  6441. animationDelay?: number | AnimationDelayCallback;
  6442. /**
  6443. * Delay of data update animation.
  6444. * Can be a callback to specify duration of each element
  6445. */
  6446. animationDurationUpdate?: number | AnimationDurationCallback;
  6447. /**
  6448. * Easing of data update animation.
  6449. */
  6450. animationEasingUpdate?: AnimationEasing;
  6451. /**
  6452. * Delay of data update animation.
  6453. * Can be a callback to specify duration of each element
  6454. */
  6455. animationDelayUpdate?: number | AnimationDelayCallback;
  6456. }
  6457. interface RoamOptionMixin {
  6458. /**
  6459. * If enable roam. can be specified 'scale' or 'move'
  6460. */
  6461. roam?: boolean | 'pan' | 'move' | 'zoom' | 'scale';
  6462. /**
  6463. * Current center position.
  6464. */
  6465. center?: (number | string)[];
  6466. /**
  6467. * Current zoom level. Default is 1
  6468. */
  6469. zoom?: number;
  6470. scaleLimit?: {
  6471. min?: number;
  6472. max?: number;
  6473. };
  6474. }
  6475. declare type SymbolSizeCallback<T> = (rawValue: any, params: T) => number | number[];
  6476. declare type SymbolCallback<T> = (rawValue: any, params: T) => string;
  6477. declare type SymbolRotateCallback<T> = (rawValue: any, params: T) => number;
  6478. declare type SymbolOffsetCallback<T> = (rawValue: any, params: T) => string | number | (string | number)[];
  6479. /**
  6480. * Mixin of option set to control the element symbol.
  6481. * Include type of symbol, and size of symbol.
  6482. */
  6483. interface SymbolOptionMixin<T = never> {
  6484. /**
  6485. * type of symbol, like `cirlce`, `rect`, or custom path and image.
  6486. */
  6487. symbol?: string | (T extends never ? never : SymbolCallback<T>);
  6488. /**
  6489. * Size of symbol.
  6490. */
  6491. symbolSize?: number | number[] | (T extends never ? never : SymbolSizeCallback<T>);
  6492. symbolRotate?: number | (T extends never ? never : SymbolRotateCallback<T>);
  6493. symbolKeepAspect?: boolean;
  6494. symbolOffset?: string | number | (string | number)[] | (T extends never ? never : SymbolOffsetCallback<T>);
  6495. }
  6496. /**
  6497. * ItemStyleOption is a most common used set to config element styles.
  6498. * It includes both fill and stroke style.
  6499. */
  6500. interface ItemStyleOption<TCbParams = never> extends ShadowOptionMixin, BorderOptionMixin {
  6501. color?: ZRColor | (TCbParams extends never ? never : ((params: TCbParams) => ZRColor));
  6502. opacity?: number;
  6503. decal?: DecalObject | 'none';
  6504. }
  6505. /**
  6506. * ItemStyleOption is a option set to control styles on lines.
  6507. * Used in the components or series like `line`, `axis`
  6508. * It includes stroke style.
  6509. */
  6510. interface LineStyleOption<Clr = ZRColor> extends ShadowOptionMixin {
  6511. width?: number;
  6512. color?: Clr;
  6513. opacity?: number;
  6514. type?: ZRLineType;
  6515. cap?: CanvasLineCap;
  6516. join?: CanvasLineJoin;
  6517. dashOffset?: number;
  6518. miterLimit?: number;
  6519. }
  6520. /**
  6521. * ItemStyleOption is a option set to control styles on an area, like polygon, rectangle.
  6522. * It only include fill style.
  6523. */
  6524. interface AreaStyleOption<Clr = ZRColor> extends ShadowOptionMixin {
  6525. color?: Clr;
  6526. opacity?: number;
  6527. }
  6528. interface VisualOptionUnit {
  6529. symbol?: string;
  6530. symbolSize?: number;
  6531. color?: ColorString;
  6532. colorAlpha?: number;
  6533. opacity?: number;
  6534. colorLightness?: number;
  6535. colorSaturation?: number;
  6536. colorHue?: number;
  6537. decal?: DecalObject;
  6538. liftZ?: number;
  6539. }
  6540. declare type VisualOptionFixed = VisualOptionUnit;
  6541. /**
  6542. * Option about visual properties used in piecewise mapping
  6543. * Used in each piece.
  6544. */
  6545. declare type VisualOptionPiecewise = VisualOptionUnit;
  6546. /**
  6547. * All visual properties can be encoded.
  6548. */
  6549. declare type BuiltinVisualProperty = keyof VisualOptionUnit;
  6550. interface TextCommonOption extends ShadowOptionMixin {
  6551. color?: string;
  6552. fontStyle?: ZRFontStyle;
  6553. fontWeight?: ZRFontWeight;
  6554. fontFamily?: string;
  6555. fontSize?: number | string;
  6556. align?: HorizontalAlign;
  6557. verticalAlign?: VerticalAlign;
  6558. baseline?: VerticalAlign;
  6559. opacity?: number;
  6560. lineHeight?: number;
  6561. backgroundColor?: ColorString | {
  6562. image: ImageLike | string;
  6563. };
  6564. borderColor?: string;
  6565. borderWidth?: number;
  6566. borderType?: ZRLineType;
  6567. borderDashOffset?: number;
  6568. borderRadius?: number | number[];
  6569. padding?: number | number[];
  6570. width?: number | string;
  6571. height?: number;
  6572. textBorderColor?: string;
  6573. textBorderWidth?: number;
  6574. textBorderType?: ZRLineType;
  6575. textBorderDashOffset?: number;
  6576. textShadowBlur?: number;
  6577. textShadowColor?: string;
  6578. textShadowOffsetX?: number;
  6579. textShadowOffsetY?: number;
  6580. tag?: string;
  6581. }
  6582. interface LabelFormatterCallback<T = CallbackDataParams> {
  6583. (params: T): string;
  6584. }
  6585. /**
  6586. * LabelOption is an option set to control the style of labels.
  6587. * Include color, background, shadow, truncate, rotation, distance, etc..
  6588. */
  6589. interface LabelOption extends TextCommonOption {
  6590. /**
  6591. * If show label
  6592. */
  6593. show?: boolean;
  6594. position?: ElementTextConfig['position'];
  6595. distance?: number;
  6596. rotate?: number;
  6597. offset?: number[];
  6598. /**
  6599. * Min margin between labels. Used when label has layout.
  6600. */
  6601. minMargin?: number;
  6602. overflow?: TextStyleProps['overflow'];
  6603. silent?: boolean;
  6604. precision?: number | 'auto';
  6605. valueAnimation?: boolean;
  6606. rich?: Dictionary<TextCommonOption>;
  6607. }
  6608. interface SeriesLabelOption extends LabelOption {
  6609. formatter?: string | LabelFormatterCallback<CallbackDataParams>;
  6610. }
  6611. /**
  6612. * Option for labels on line, like markLine, lines
  6613. */
  6614. interface LineLabelOption extends Omit<LabelOption, 'distance' | 'position'> {
  6615. position?: 'start' | 'middle' | 'end' | 'insideStart' | 'insideStartTop' | 'insideStartBottom' | 'insideMiddle' | 'insideMiddleTop' | 'insideMiddleBottom' | 'insideEnd' | 'insideEndTop' | 'insideEndBottom' | 'insideMiddleBottom';
  6616. /**
  6617. * Distance can be an array.
  6618. * Which will specify horizontal and vertical distance respectively
  6619. */
  6620. distance?: number | number[];
  6621. }
  6622. interface LabelLineOption {
  6623. show?: boolean;
  6624. /**
  6625. * If displayed above other elements
  6626. */
  6627. showAbove?: boolean;
  6628. length?: number;
  6629. length2?: number;
  6630. smooth?: boolean | number;
  6631. minTurnAngle?: number;
  6632. lineStyle?: LineStyleOption;
  6633. }
  6634. interface SeriesLineLabelOption extends LineLabelOption {
  6635. formatter?: string | LabelFormatterCallback<CallbackDataParams>;
  6636. }
  6637. interface LabelLayoutOptionCallbackParams {
  6638. /**
  6639. * Index of data which the label represents.
  6640. * It can be null if label does't represent any data.
  6641. */
  6642. dataIndex?: number;
  6643. /**
  6644. * Type of data which the label represents.
  6645. * It can be null if label does't represent any data.
  6646. */
  6647. dataType?: SeriesDataType;
  6648. seriesIndex: number;
  6649. text: string;
  6650. align: ZRTextAlign;
  6651. verticalAlign: ZRTextVerticalAlign;
  6652. rect: RectLike;
  6653. labelRect: RectLike;
  6654. labelLinePoints?: number[][];
  6655. }
  6656. interface LabelLayoutOption {
  6657. /**
  6658. * If move the overlapped label. If label is still overlapped after moved.
  6659. * It will determine if to hide this label with `hideOverlap` policy.
  6660. *
  6661. * shiftX/Y will keep the order on x/y
  6662. * shuffleX/y will move the label around the original position randomly.
  6663. */
  6664. moveOverlap?: 'shiftX' | 'shiftY' | 'shuffleX' | 'shuffleY';
  6665. /**
  6666. * If hide the overlapped label. It will be handled after move.
  6667. * @default 'none'
  6668. */
  6669. hideOverlap?: boolean;
  6670. /**
  6671. * If label is draggable.
  6672. */
  6673. draggable?: boolean;
  6674. /**
  6675. * Can be absolute px number or percent string.
  6676. */
  6677. x?: number | string;
  6678. y?: number | string;
  6679. /**
  6680. * offset on x based on the original position.
  6681. */
  6682. dx?: number;
  6683. /**
  6684. * offset on y based on the original position.
  6685. */
  6686. dy?: number;
  6687. rotate?: number;
  6688. align?: ZRTextAlign;
  6689. verticalAlign?: ZRTextVerticalAlign;
  6690. width?: number;
  6691. height?: number;
  6692. fontSize?: number;
  6693. labelLinePoints?: number[][];
  6694. }
  6695. declare type LabelLayoutOptionCallback = (params: LabelLayoutOptionCallbackParams) => LabelLayoutOption;
  6696. interface TooltipFormatterCallback<T> {
  6697. /**
  6698. * For sync callback
  6699. * params will be an array on axis trigger.
  6700. */
  6701. (params: T, asyncTicket: string): string | HTMLElement | HTMLElement[];
  6702. /**
  6703. * For async callback.
  6704. * Returned html string will be a placeholder when callback is not invoked.
  6705. */
  6706. (params: T, asyncTicket: string, callback: (cbTicket: string, htmlOrDomNodes: string | HTMLElement | HTMLElement[]) => void): string | HTMLElement | HTMLElement[];
  6707. }
  6708. declare type TooltipBuiltinPosition = 'inside' | 'top' | 'left' | 'right' | 'bottom';
  6709. declare type TooltipBoxLayoutOption = Pick<BoxLayoutOptionMixin, 'top' | 'left' | 'right' | 'bottom'>;
  6710. declare type TooltipPositionCallbackParams = CallbackDataParams | CallbackDataParams[];
  6711. /**
  6712. * Position relative to the hoverred element. Only available when trigger is item.
  6713. */
  6714. interface TooltipPositionCallback {
  6715. (point: [number, number],
  6716. /**
  6717. * params will be an array on axis trigger.
  6718. */
  6719. params: TooltipPositionCallbackParams,
  6720. /**
  6721. * Will be HTMLDivElement when renderMode is html
  6722. * Otherwise it's graphic.Text
  6723. */
  6724. el: HTMLDivElement | ZRText | null,
  6725. /**
  6726. * Rect of hover elements. Will be null if not hovered
  6727. */
  6728. rect: RectLike | null, size: {
  6729. /**
  6730. * Size of popup content
  6731. */
  6732. contentSize: [number, number];
  6733. /**
  6734. * Size of the chart view
  6735. */
  6736. viewSize: [number, number];
  6737. }): Array<number | string> | TooltipBuiltinPosition | TooltipBoxLayoutOption;
  6738. }
  6739. /**
  6740. * Common tooltip option
  6741. * Can be configured on series, graphic elements
  6742. */
  6743. interface CommonTooltipOption<FormatterParams> {
  6744. show?: boolean;
  6745. /**
  6746. * When to trigger
  6747. */
  6748. triggerOn?: 'mousemove' | 'click' | 'none' | 'mousemove|click';
  6749. /**
  6750. * Whether to not hide popup content automatically
  6751. */
  6752. alwaysShowContent?: boolean;
  6753. formatter?: string | TooltipFormatterCallback<FormatterParams>;
  6754. /**
  6755. * Formatter of value.
  6756. *
  6757. * Will be ignored if tooltip.formatter is specified.
  6758. */
  6759. valueFormatter?: (value: OptionDataValue | OptionDataValue[]) => string;
  6760. /**
  6761. * Absolution pixel [x, y] array. Or relative percent string [x, y] array.
  6762. * If trigger is 'item'. position can be set to 'inside' / 'top' / 'left' / 'right' / 'bottom',
  6763. * which is relative to the hovered element.
  6764. *
  6765. * Support to be a callback
  6766. */
  6767. position?: (number | string)[] | TooltipBuiltinPosition | TooltipPositionCallback | TooltipBoxLayoutOption;
  6768. confine?: boolean;
  6769. /**
  6770. * Consider triggered from axisPointer handle, verticalAlign should be 'middle'
  6771. */
  6772. align?: HorizontalAlign;
  6773. verticalAlign?: VerticalAlign;
  6774. /**
  6775. * Delay of show. milesecond.
  6776. */
  6777. showDelay?: number;
  6778. /**
  6779. * Delay of hide. milesecond.
  6780. */
  6781. hideDelay?: number;
  6782. transitionDuration?: number;
  6783. /**
  6784. * Whether mouse is allowed to enter the floating layer of tooltip
  6785. * If you need to interact in the tooltip like with links or buttons, it can be set as true.
  6786. */
  6787. enterable?: boolean;
  6788. backgroundColor?: ColorString;
  6789. borderColor?: ColorString;
  6790. borderRadius?: number;
  6791. borderWidth?: number;
  6792. shadowBlur?: number;
  6793. shadowColor?: string;
  6794. shadowOffsetX?: number;
  6795. shadowOffsetY?: number;
  6796. /**
  6797. * Padding between tooltip content and tooltip border.
  6798. */
  6799. padding?: number | number[];
  6800. /**
  6801. * Available when renderMode is 'html'
  6802. */
  6803. extraCssText?: string;
  6804. textStyle?: Pick<LabelOption, 'color' | 'fontStyle' | 'fontWeight' | 'fontFamily' | 'fontSize' | 'lineHeight' | 'width' | 'height' | 'textBorderColor' | 'textBorderWidth' | 'textShadowColor' | 'textShadowBlur' | 'textShadowOffsetX' | 'textShadowOffsetY' | 'align'> & {
  6805. decoration?: string;
  6806. };
  6807. }
  6808. declare type ComponentItemTooltipOption<T> = CommonTooltipOption<T> & {
  6809. content?: string;
  6810. formatterParams?: ComponentItemTooltipLabelFormatterParams;
  6811. };
  6812. declare type ComponentItemTooltipLabelFormatterParams = {
  6813. componentType: string;
  6814. name: string;
  6815. $vars: string[];
  6816. } & {
  6817. [key in string]: unknown;
  6818. };
  6819. /**
  6820. * Tooltip option configured on each series
  6821. */
  6822. declare type SeriesTooltipOption = CommonTooltipOption<CallbackDataParams> & {
  6823. trigger?: 'item' | 'axis' | boolean | 'none';
  6824. };
  6825. declare type LabelFormatterParams = {
  6826. value: ScaleDataValue;
  6827. axisDimension: string;
  6828. axisIndex: number;
  6829. seriesData: CallbackDataParams[];
  6830. };
  6831. /**
  6832. * Common axis option. can be configured on each axis
  6833. */
  6834. interface CommonAxisPointerOption {
  6835. show?: boolean | 'auto';
  6836. z?: number;
  6837. zlevel?: number;
  6838. triggerOn?: 'click' | 'mousemove' | 'none' | 'mousemove|click';
  6839. type?: 'line' | 'shadow' | 'none';
  6840. snap?: boolean;
  6841. triggerTooltip?: boolean;
  6842. /**
  6843. * current value. When using axisPointer.handle, value can be set to define the initail position of axisPointer.
  6844. */
  6845. value?: ScaleDataValue;
  6846. status?: 'show' | 'hide';
  6847. label?: LabelOption & {
  6848. precision?: 'auto' | number;
  6849. margin?: number;
  6850. /**
  6851. * String template include variable {value} or callback function
  6852. */
  6853. formatter?: string | ((params: LabelFormatterParams) => string);
  6854. };
  6855. animation?: boolean | 'auto';
  6856. animationDurationUpdate?: number;
  6857. animationEasingUpdate?: ZREasing;
  6858. /**
  6859. * Available when type is 'line'
  6860. */
  6861. lineStyle?: LineStyleOption;
  6862. /**
  6863. * Available when type is 'shadow'
  6864. */
  6865. shadowStyle?: AreaStyleOption;
  6866. handle?: {
  6867. show?: boolean;
  6868. icon?: string;
  6869. /**
  6870. * The size of the handle
  6871. */
  6872. size?: number | number[];
  6873. /**
  6874. * Distance from handle center to axis.
  6875. */
  6876. margin?: number;
  6877. color?: ColorString;
  6878. /**
  6879. * Throttle for mobile performance
  6880. */
  6881. throttle?: number;
  6882. } & ShadowOptionMixin;
  6883. seriesDataIndices?: {
  6884. seriesIndex: number;
  6885. dataIndex: number;
  6886. dataIndexInside: number;
  6887. }[];
  6888. }
  6889. interface ComponentOption {
  6890. mainType?: string;
  6891. type?: string;
  6892. id?: OptionId;
  6893. name?: OptionName;
  6894. z?: number;
  6895. zlevel?: number;
  6896. }
  6897. declare type BlurScope = 'coordinateSystem' | 'series' | 'global';
  6898. /**
  6899. * can be array of data indices.
  6900. * Or may be an dictionary if have different types of data like in graph.
  6901. */
  6902. declare type InnerFocus = DefaultEmphasisFocus | ArrayLike<number> | Dictionary<ArrayLike<number>>;
  6903. interface DefaultStatesMixin {
  6904. emphasis?: any;
  6905. select?: any;
  6906. blur?: any;
  6907. }
  6908. declare type DefaultEmphasisFocus = 'none' | 'self' | 'series';
  6909. interface DefaultStatesMixinEmphasis {
  6910. /**
  6911. * self: Focus self and blur all others.
  6912. * series: Focus series and blur all other series.
  6913. */
  6914. focus?: DefaultEmphasisFocus;
  6915. }
  6916. interface StatesMixinBase {
  6917. emphasis?: unknown;
  6918. select?: unknown;
  6919. blur?: unknown;
  6920. }
  6921. interface StatesOptionMixin<StateOption, StatesMixin extends StatesMixinBase> {
  6922. /**
  6923. * Emphasis states
  6924. */
  6925. emphasis?: StateOption & StatesMixin['emphasis'] & {
  6926. /**
  6927. * Scope of blurred element when focus.
  6928. *
  6929. * coordinateSystem: blur others in the same coordinateSystem
  6930. * series: blur others in the same series
  6931. * global: blur all others
  6932. *
  6933. * Default to be coordinate system.
  6934. */
  6935. blurScope?: BlurScope;
  6936. /**
  6937. * If emphasis state is disabled.
  6938. */
  6939. disabled?: boolean;
  6940. };
  6941. /**
  6942. * Select states
  6943. */
  6944. select?: StateOption & StatesMixin['select'] & {
  6945. disabled?: boolean;
  6946. };
  6947. /**
  6948. * Blur states.
  6949. */
  6950. blur?: StateOption & StatesMixin['blur'];
  6951. }
  6952. interface UniversalTransitionOption {
  6953. enabled?: boolean;
  6954. /**
  6955. * Animation delay of each divided element
  6956. */
  6957. delay?: (index: number, count: number) => number;
  6958. /**
  6959. * How to divide the shape in combine and split animation.
  6960. */
  6961. divideShape?: 'clone' | 'split';
  6962. /**
  6963. * Series will have transition between if they have same seriesKey.
  6964. * Usually it is a string. It can also be an array,
  6965. * which means it can be transition from or to multiple series with each key in this array item.
  6966. *
  6967. * Note:
  6968. * If two series have both array seriesKey. They will be compared after concated to a string(which is order independent)
  6969. * Transition between string key has higher priority.
  6970. *
  6971. * Default to use series id.
  6972. */
  6973. seriesKey?: string | string[];
  6974. }
  6975. interface SeriesOption<StateOption = unknown, StatesMixin extends StatesMixinBase = DefaultStatesMixin> extends ComponentOption, AnimationOptionMixin, ColorPaletteOptionMixin, StatesOptionMixin<StateOption, StatesMixin> {
  6976. mainType?: 'series';
  6977. silent?: boolean;
  6978. blendMode?: string;
  6979. /**
  6980. * Cursor when mouse on the elements
  6981. */
  6982. cursor?: string;
  6983. /**
  6984. * groupId of data. can be used for doing drilldown / up animation
  6985. * It will be ignored if:
  6986. * - groupId is specified in each data
  6987. * - encode.itemGroupId is given.
  6988. */
  6989. dataGroupId?: OptionId;
  6990. data?: unknown;
  6991. colorBy?: ColorBy;
  6992. legendHoverLink?: boolean;
  6993. /**
  6994. * Configurations about progressive rendering
  6995. */
  6996. progressive?: number | false;
  6997. progressiveThreshold?: number;
  6998. progressiveChunkMode?: 'mod';
  6999. /**
  7000. * Not available on every series
  7001. */
  7002. coordinateSystem?: string;
  7003. hoverLayerThreshold?: number;
  7004. /**
  7005. * When dataset is used, seriesLayoutBy specifies whether the column or the row of dataset is mapped to the series
  7006. * namely, the series is "layout" on columns or rows
  7007. * @default 'column'
  7008. */
  7009. seriesLayoutBy?: 'column' | 'row';
  7010. labelLine?: LabelLineOption;
  7011. /**
  7012. * Overall label layout option in label layout stage.
  7013. */
  7014. labelLayout?: LabelLayoutOption | LabelLayoutOptionCallback;
  7015. /**
  7016. * Animation config for state transition.
  7017. */
  7018. stateAnimation?: AnimationOption$1;
  7019. /**
  7020. * If enabled universal transition cross series.
  7021. * @example
  7022. * universalTransition: true
  7023. * universalTransition: { enabled: true }
  7024. */
  7025. universalTransition?: boolean | UniversalTransitionOption;
  7026. /**
  7027. * Map of selected data
  7028. * key is name or index of data.
  7029. */
  7030. selectedMap?: Dictionary<boolean> | 'all';
  7031. selectedMode?: 'single' | 'multiple' | 'series' | boolean;
  7032. }
  7033. interface SeriesOnCartesianOptionMixin {
  7034. xAxisIndex?: number;
  7035. yAxisIndex?: number;
  7036. xAxisId?: string;
  7037. yAxisId?: string;
  7038. }
  7039. interface SeriesOnPolarOptionMixin {
  7040. polarIndex?: number;
  7041. polarId?: string;
  7042. }
  7043. interface SeriesOnSingleOptionMixin {
  7044. singleAxisIndex?: number;
  7045. singleAxisId?: string;
  7046. }
  7047. interface SeriesOnGeoOptionMixin {
  7048. geoIndex?: number;
  7049. geoId?: string;
  7050. }
  7051. interface SeriesOnCalendarOptionMixin {
  7052. calendarIndex?: number;
  7053. calendarId?: string;
  7054. }
  7055. interface SeriesLargeOptionMixin {
  7056. large?: boolean;
  7057. largeThreshold?: number;
  7058. }
  7059. interface SeriesStackOptionMixin {
  7060. stack?: string;
  7061. stackStrategy?: 'samesign' | 'all' | 'positive' | 'negative';
  7062. }
  7063. declare type SamplingFunc = (frame: ArrayLike<number>) => number;
  7064. interface SeriesSamplingOptionMixin {
  7065. sampling?: 'none' | 'average' | 'min' | 'max' | 'sum' | 'lttb' | SamplingFunc;
  7066. }
  7067. interface SeriesEncodeOptionMixin {
  7068. datasetIndex?: number;
  7069. datasetId?: string | number;
  7070. seriesLayoutBy?: SeriesLayoutBy;
  7071. sourceHeader?: OptionSourceHeader;
  7072. dimensions?: DimensionDefinitionLoose[];
  7073. encode?: OptionEncode;
  7074. }
  7075. interface AriaLabelOption {
  7076. enabled?: boolean;
  7077. description?: string;
  7078. general?: {
  7079. withTitle?: string;
  7080. withoutTitle?: string;
  7081. };
  7082. series?: {
  7083. maxCount?: number;
  7084. single?: {
  7085. prefix?: string;
  7086. withName?: string;
  7087. withoutName?: string;
  7088. };
  7089. multiple?: {
  7090. prefix?: string;
  7091. withName?: string;
  7092. withoutName?: string;
  7093. separator?: {
  7094. middle?: string;
  7095. end?: string;
  7096. };
  7097. };
  7098. };
  7099. data?: {
  7100. maxCount?: number;
  7101. allData?: string;
  7102. partialData?: string;
  7103. withName?: string;
  7104. withoutName?: string;
  7105. separator?: {
  7106. middle?: string;
  7107. end?: string;
  7108. };
  7109. };
  7110. }
  7111. interface AriaOption extends AriaLabelOption {
  7112. mainType?: 'aria';
  7113. enabled?: boolean;
  7114. label?: AriaLabelOption;
  7115. decal?: {
  7116. show?: boolean;
  7117. decals?: DecalObject | DecalObject[];
  7118. };
  7119. }
  7120. declare type AreaStyleProps = Pick<PathStyleProps, 'fill' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'opacity' | 'shadowColor'>;
  7121. declare class AreaStyleMixin {
  7122. getAreaStyle(this: Model, excludes?: readonly (keyof AreaStyleOption)[], includes?: readonly (keyof AreaStyleOption)[]): AreaStyleProps;
  7123. }
  7124. declare type LabelFontOption = Pick<LabelOption, 'fontStyle' | 'fontWeight' | 'fontSize' | 'fontFamily'>;
  7125. declare type LabelRectRelatedOption = Pick<LabelOption, 'align' | 'verticalAlign' | 'padding' | 'lineHeight' | 'baseline' | 'rich' | 'width' | 'height' | 'overflow'> & LabelFontOption;
  7126. declare class TextStyleMixin {
  7127. /**
  7128. * Get color property or get color from option.textStyle.color
  7129. */
  7130. getTextColor(this: Model, isEmphasis?: boolean): ColorString;
  7131. /**
  7132. * Create font string from fontStyle, fontWeight, fontSize, fontFamily
  7133. * @return {string}
  7134. */
  7135. getFont(this: Model<LabelFontOption>): string;
  7136. getTextRect(this: Model<LabelRectRelatedOption> & TextStyleMixin, text: string): BoundingRect;
  7137. }
  7138. interface Model<Opt = ModelOption> extends LineStyleMixin, ItemStyleMixin, TextStyleMixin, AreaStyleMixin {
  7139. }
  7140. declare class Model<Opt = ModelOption> {
  7141. parentModel: Model;
  7142. ecModel: GlobalModel;
  7143. option: Opt;
  7144. constructor(option?: Opt, parentModel?: Model, ecModel?: GlobalModel);
  7145. init(option: Opt, parentModel?: Model, ecModel?: GlobalModel, ...rest: any): void;
  7146. /**
  7147. * Merge the input option to me.
  7148. */
  7149. mergeOption(option: Opt, ecModel?: GlobalModel): void;
  7150. get<R extends keyof Opt>(path: R, ignoreParent?: boolean): Opt[R];
  7151. get<R extends keyof Opt>(path: readonly [R], ignoreParent?: boolean): Opt[R];
  7152. get<R extends keyof Opt, S extends keyof Opt[R]>(path: readonly [R, S], ignoreParent?: boolean): Opt[R][S];
  7153. 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];
  7154. getShallow<R extends keyof Opt>(key: R, ignoreParent?: boolean): Opt[R];
  7155. getModel<R extends keyof Opt>(path: R, parentModel?: Model): Model<Opt[R]>;
  7156. getModel<R extends keyof Opt>(path: readonly [R], parentModel?: Model): Model<Opt[R]>;
  7157. getModel<R extends keyof Opt, S extends keyof Opt[R]>(path: readonly [R, S], parentModel?: Model): Model<Opt[R][S]>;
  7158. 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]>;
  7159. 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]>;
  7160. /**
  7161. * If model has option
  7162. */
  7163. isEmpty(): boolean;
  7164. restoreData(): void;
  7165. clone(): Model<Opt>;
  7166. parsePath(path: string | readonly string[]): readonly string[];
  7167. resolveParentPath(path: readonly string[]): string[];
  7168. isAnimationEnabled(): boolean;
  7169. private _doGet;
  7170. }
  7171. /**
  7172. * ECharts option manager
  7173. */
  7174. /**
  7175. * TERM EXPLANATIONS:
  7176. * See `ECOption` and `ECUnitOption` in `src/util/types.ts`.
  7177. */
  7178. declare class OptionManager {
  7179. private _api;
  7180. private _timelineOptions;
  7181. private _mediaList;
  7182. private _mediaDefault;
  7183. /**
  7184. * -1, means default.
  7185. * empty means no media.
  7186. */
  7187. private _currentMediaIndices;
  7188. private _optionBackup;
  7189. private _newBaseOption;
  7190. constructor(api: ExtensionAPI);
  7191. setOption(rawOption: ECBasicOption, optionPreprocessorFuncs: OptionPreprocessor[], opt: InnerSetOptionOpts): void;
  7192. mountOption(isRecreate: boolean): ECUnitOption;
  7193. getTimelineOption(ecModel: GlobalModel): ECUnitOption;
  7194. getMediaOption(ecModel: GlobalModel): ECUnitOption[];
  7195. }
  7196. declare const _default: {
  7197. time: {
  7198. month: string[];
  7199. monthAbbr: string[];
  7200. dayOfWeek: string[];
  7201. dayOfWeekAbbr: string[];
  7202. };
  7203. legend: {
  7204. selector: {
  7205. all: string;
  7206. inverse: string;
  7207. };
  7208. };
  7209. toolbox: {
  7210. brush: {
  7211. title: {
  7212. rect: string;
  7213. polygon: string;
  7214. lineX: string;
  7215. lineY: string;
  7216. keep: string;
  7217. clear: string;
  7218. };
  7219. };
  7220. dataView: {
  7221. title: string;
  7222. lang: string[];
  7223. };
  7224. dataZoom: {
  7225. title: {
  7226. zoom: string;
  7227. back: string;
  7228. };
  7229. };
  7230. magicType: {
  7231. title: {
  7232. line: string;
  7233. bar: string;
  7234. stack: string;
  7235. tiled: string;
  7236. };
  7237. };
  7238. restore: {
  7239. title: string;
  7240. };
  7241. saveAsImage: {
  7242. title: string;
  7243. lang: string[];
  7244. };
  7245. };
  7246. series: {
  7247. typeNames: {
  7248. pie: string;
  7249. bar: string;
  7250. line: string;
  7251. scatter: string;
  7252. effectScatter: string;
  7253. radar: string;
  7254. tree: string;
  7255. treemap: string;
  7256. boxplot: string;
  7257. candlestick: string;
  7258. k: string;
  7259. heatmap: string;
  7260. map: string;
  7261. parallel: string;
  7262. lines: string;
  7263. graph: string;
  7264. sankey: string;
  7265. funnel: string;
  7266. gauge: string;
  7267. pictorialBar: string;
  7268. themeRiver: string;
  7269. sunburst: string;
  7270. };
  7271. };
  7272. aria: {
  7273. general: {
  7274. withTitle: string;
  7275. withoutTitle: string;
  7276. };
  7277. series: {
  7278. single: {
  7279. prefix: string;
  7280. withName: string;
  7281. withoutName: string;
  7282. };
  7283. multiple: {
  7284. prefix: string;
  7285. withName: string;
  7286. withoutName: string;
  7287. separator: {
  7288. middle: string;
  7289. end: string;
  7290. };
  7291. };
  7292. };
  7293. data: {
  7294. allData: string;
  7295. partialData: string;
  7296. withName: string;
  7297. withoutName: string;
  7298. separator: {
  7299. middle: string;
  7300. end: string;
  7301. };
  7302. };
  7303. };
  7304. };
  7305. declare type LocaleOption = typeof _default;
  7306. declare function registerLocale(locale: string, localeObj: LocaleOption): void;
  7307. /**
  7308. * Caution: If the mechanism should be changed some day, these cases
  7309. * should be considered:
  7310. *
  7311. * (1) In `merge option` mode, if using the same option to call `setOption`
  7312. * many times, the result should be the same (try our best to ensure that).
  7313. * (2) In `merge option` mode, if a component has no id/name specified, it
  7314. * will be merged by index, and the result sequence of the components is
  7315. * consistent to the original sequence.
  7316. * (3) In `replaceMerge` mode, keep the result sequence of the components is
  7317. * consistent to the original sequence, even though there might result in "hole".
  7318. * (4) `reset` feature (in toolbox). Find detailed info in comments about
  7319. * `mergeOption` in module:echarts/model/OptionManager.
  7320. */
  7321. interface GlobalModelSetOptionOpts {
  7322. replaceMerge: ComponentMainType | ComponentMainType[];
  7323. }
  7324. interface InnerSetOptionOpts {
  7325. replaceMergeMainTypeMap: HashMap<boolean, string>;
  7326. }
  7327. /**
  7328. * @param condition.mainType Mandatory.
  7329. * @param condition.subType Optional.
  7330. * @param condition.query like {xxxIndex, xxxId, xxxName},
  7331. * where xxx is mainType.
  7332. * If query attribute is null/undefined or has no index/id/name,
  7333. * do not filtering by query conditions, which is convenient for
  7334. * no-payload situations or when target of action is global.
  7335. * @param condition.filter parameter: component, return boolean.
  7336. */
  7337. interface QueryConditionKindA {
  7338. mainType: ComponentMainType;
  7339. subType?: ComponentSubType;
  7340. query?: {
  7341. [k: string]: number | number[] | string | string[];
  7342. };
  7343. filter?: (cmpt: ComponentModel) => boolean;
  7344. }
  7345. /**
  7346. * If none of index and id and name used, return all components with mainType.
  7347. * @param condition.mainType
  7348. * @param condition.subType If ignore, only query by mainType
  7349. * @param condition.index Either input index or id or name.
  7350. * @param condition.id Either input index or id or name.
  7351. * @param condition.name Either input index or id or name.
  7352. */
  7353. interface QueryConditionKindB {
  7354. mainType: ComponentMainType;
  7355. subType?: ComponentSubType;
  7356. index?: number | number[];
  7357. id?: OptionId | OptionId[];
  7358. name?: OptionName | OptionName[];
  7359. }
  7360. interface EachComponentAllCallback {
  7361. (mainType: string, model: ComponentModel, componentIndex: number): void;
  7362. }
  7363. interface EachComponentInMainTypeCallback {
  7364. (model: ComponentModel, componentIndex: number): void;
  7365. }
  7366. declare class GlobalModel extends Model<ECUnitOption> {
  7367. option: ECUnitOption;
  7368. private _theme;
  7369. private _locale;
  7370. private _optionManager;
  7371. private _componentsMap;
  7372. /**
  7373. * `_componentsMap` might have "hole" becuase of remove.
  7374. * So save components count for a certain mainType here.
  7375. */
  7376. private _componentsCount;
  7377. /**
  7378. * Mapping between filtered series list and raw series list.
  7379. * key: filtered series indices, value: raw series indices.
  7380. * Items of `_seriesIndices` never be null/empty/-1.
  7381. * If series has been removed by `replaceMerge`, those series
  7382. * also won't be in `_seriesIndices`, just like be filtered.
  7383. */
  7384. private _seriesIndices;
  7385. /**
  7386. * Key: seriesIndex.
  7387. * Keep consistent with `_seriesIndices`.
  7388. */
  7389. private _seriesIndicesMap;
  7390. /**
  7391. * Model for store update payload
  7392. */
  7393. private _payload;
  7394. scheduler: Scheduler;
  7395. ssr: boolean;
  7396. init(option: ECBasicOption, parentModel: Model, ecModel: GlobalModel, theme: object, locale: object, optionManager: OptionManager): void;
  7397. setOption(option: ECBasicOption, opts: GlobalModelSetOptionOpts, optionPreprocessorFuncs: OptionPreprocessor[]): void;
  7398. /**
  7399. * @param type null/undefined: reset all.
  7400. * 'recreate': force recreate all.
  7401. * 'timeline': only reset timeline option
  7402. * 'media': only reset media query option
  7403. * @return Whether option changed.
  7404. */
  7405. resetOption(type: 'recreate' | 'timeline' | 'media', opt?: Pick<GlobalModelSetOptionOpts, 'replaceMerge'>): boolean;
  7406. private _resetOption;
  7407. mergeOption(option: ECUnitOption): void;
  7408. private _mergeOption;
  7409. /**
  7410. * Get option for output (cloned option and inner info removed)
  7411. */
  7412. getOption(): ECUnitOption;
  7413. getTheme(): Model;
  7414. getLocaleModel(): Model<LocaleOption>;
  7415. setUpdatePayload(payload: Payload): void;
  7416. getUpdatePayload(): Payload;
  7417. /**
  7418. * @param idx If not specified, return the first one.
  7419. */
  7420. getComponent(mainType: ComponentMainType, idx?: number): ComponentModel;
  7421. /**
  7422. * @return Never be null/undefined.
  7423. */
  7424. queryComponents(condition: QueryConditionKindB): ComponentModel[];
  7425. /**
  7426. * The interface is different from queryComponents,
  7427. * which is convenient for inner usage.
  7428. *
  7429. * @usage
  7430. * let result = findComponents(
  7431. * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}
  7432. * );
  7433. * let result = findComponents(
  7434. * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}
  7435. * );
  7436. * let result = findComponents(
  7437. * {mainType: 'series',
  7438. * filter: function (model, index) {...}}
  7439. * );
  7440. * // result like [component0, componnet1, ...]
  7441. */
  7442. findComponents(condition: QueryConditionKindA): ComponentModel[];
  7443. /**
  7444. * Travel components (before filtered).
  7445. *
  7446. * @usage
  7447. * eachComponent('legend', function (legendModel, index) {
  7448. * ...
  7449. * });
  7450. * eachComponent(function (componentType, model, index) {
  7451. * // componentType does not include subType
  7452. * // (componentType is 'a' but not 'a.b')
  7453. * });
  7454. * eachComponent(
  7455. * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}},
  7456. * function (model, index) {...}
  7457. * );
  7458. * eachComponent(
  7459. * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}},
  7460. * function (model, index) {...}
  7461. * );
  7462. */
  7463. eachComponent<T>(cb: EachComponentAllCallback, context?: T): void;
  7464. eachComponent<T>(mainType: string, cb: EachComponentInMainTypeCallback, context?: T): void;
  7465. eachComponent<T>(mainType: QueryConditionKindA, cb: EachComponentInMainTypeCallback, context?: T): void;
  7466. /**
  7467. * Get series list before filtered by name.
  7468. */
  7469. getSeriesByName(name: OptionName): SeriesModel[];
  7470. /**
  7471. * Get series list before filtered by index.
  7472. */
  7473. getSeriesByIndex(seriesIndex: number): SeriesModel;
  7474. /**
  7475. * Get series list before filtered by type.
  7476. * FIXME: rename to getRawSeriesByType?
  7477. */
  7478. getSeriesByType(subType: ComponentSubType): SeriesModel[];
  7479. /**
  7480. * Get all series before filtered.
  7481. */
  7482. getSeries(): SeriesModel[];
  7483. /**
  7484. * Count series before filtered.
  7485. */
  7486. getSeriesCount(): number;
  7487. /**
  7488. * After filtering, series may be different
  7489. * frome raw series.
  7490. */
  7491. eachSeries<T>(cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
  7492. /**
  7493. * Iterate raw series before filtered.
  7494. *
  7495. * @param {Function} cb
  7496. * @param {*} context
  7497. */
  7498. eachRawSeries<T>(cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
  7499. /**
  7500. * After filtering, series may be different.
  7501. * frome raw series.
  7502. */
  7503. eachSeriesByType<T>(subType: ComponentSubType, cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
  7504. /**
  7505. * Iterate raw series before filtered of given type.
  7506. */
  7507. eachRawSeriesByType<T>(subType: ComponentSubType, cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
  7508. isSeriesFiltered(seriesModel: SeriesModel): boolean;
  7509. getCurrentSeriesIndices(): number[];
  7510. filterSeries<T>(cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => boolean, context?: T): void;
  7511. restoreData(payload?: Payload): void;
  7512. private static internalField;
  7513. }
  7514. interface GlobalModel extends PaletteMixin<ECUnitOption> {
  7515. }
  7516. interface UpdateLifecycleTransitionSeriesFinder {
  7517. seriesIndex?: ModelFinderIndexQuery;
  7518. seriesId?: ModelFinderIdQuery;
  7519. dimension: DimensionLoose;
  7520. }
  7521. interface UpdateLifecycleTransitionItem {
  7522. from?: UpdateLifecycleTransitionSeriesFinder | UpdateLifecycleTransitionSeriesFinder[];
  7523. to: UpdateLifecycleTransitionSeriesFinder | UpdateLifecycleTransitionSeriesFinder[];
  7524. }
  7525. declare type UpdateLifecycleTransitionOpt = UpdateLifecycleTransitionItem | UpdateLifecycleTransitionItem[];
  7526. interface UpdateLifecycleParams {
  7527. updatedSeries?: SeriesModel[];
  7528. /**
  7529. * If this update is from setOption and option is changed.
  7530. */
  7531. optionChanged?: boolean;
  7532. seriesTransition?: UpdateLifecycleTransitionOpt;
  7533. }
  7534. interface LifecycleEvents {
  7535. 'afterinit': [EChartsType];
  7536. 'series:beforeupdate': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
  7537. 'series:layoutlabels': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
  7538. 'series:transition': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
  7539. 'series:afterupdate': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
  7540. 'afterupdate': [GlobalModel, ExtensionAPI];
  7541. }
  7542. declare class GeoJSONResource implements GeoResource {
  7543. readonly type = "geoJSON";
  7544. private _geoJSON;
  7545. private _specialAreas;
  7546. private _mapName;
  7547. private _parsedMap;
  7548. constructor(mapName: string, geoJSON: GeoJSONSourceInput, specialAreas: GeoSpecialAreas);
  7549. /**
  7550. * @param nameMap can be null/undefined
  7551. * @param nameProperty can be null/undefined
  7552. */
  7553. load(nameMap: NameMap, nameProperty: string): {
  7554. regions: GeoJSONRegion[];
  7555. boundingRect: BoundingRect;
  7556. regionsMap: HashMap<GeoJSONRegion, string | number>;
  7557. };
  7558. private _parseToRegions;
  7559. /**
  7560. * Only for exporting to users.
  7561. * **MUST NOT** used internally.
  7562. */
  7563. getMapForUser(): {
  7564. geoJson: GeoJSON | GeoJSONCompressed;
  7565. geoJSON: GeoJSON | GeoJSONCompressed;
  7566. specialAreas: GeoSpecialAreas;
  7567. };
  7568. }
  7569. declare type MapInput = GeoJSONMapInput | SVGMapInput;
  7570. interface GeoJSONMapInput {
  7571. geoJSON: GeoJSONSourceInput;
  7572. specialAreas: GeoSpecialAreas;
  7573. }
  7574. interface SVGMapInput {
  7575. svg: GeoSVGSourceInput;
  7576. }
  7577. declare const _default$1: {
  7578. /**
  7579. * Compatible with previous `echarts.registerMap`.
  7580. *
  7581. * @usage
  7582. * ```js
  7583. *
  7584. * echarts.registerMap('USA', geoJson, specialAreas);
  7585. *
  7586. * echarts.registerMap('USA', {
  7587. * geoJson: geoJson,
  7588. * specialAreas: {...}
  7589. * });
  7590. * echarts.registerMap('USA', {
  7591. * geoJSON: geoJson,
  7592. * specialAreas: {...}
  7593. * });
  7594. *
  7595. * echarts.registerMap('airport', {
  7596. * svg: svg
  7597. * }
  7598. * ```
  7599. *
  7600. * Note:
  7601. * Do not support that register multiple geoJSON or SVG
  7602. * one map name. Because different geoJSON and SVG have
  7603. * different unit. It's not easy to make sure how those
  7604. * units are mapping/normalize.
  7605. * If intending to use multiple geoJSON or SVG, we can
  7606. * use multiple geo coordinate system.
  7607. */
  7608. registerMap: (mapName: string, rawDef: MapInput | GeoJSONSourceInput, rawSpecialAreas?: GeoSpecialAreas) => void;
  7609. getGeoResource(mapName: string): GeoResource;
  7610. /**
  7611. * Only for exporting to users.
  7612. * **MUST NOT** used internally.
  7613. */
  7614. getMapForUser: (mapName: string) => ReturnType<GeoJSONResource['getMapForUser']>;
  7615. load: (mapName: string, nameMap: NameMap, nameProperty: string) => ReturnType<GeoResource['load']>;
  7616. };
  7617. declare type ModelFinder$1 = ModelFinder;
  7618. declare const version$1 = "5.4.0";
  7619. declare const dependencies: {
  7620. zrender: string;
  7621. };
  7622. declare const PRIORITY: {
  7623. PROCESSOR: {
  7624. FILTER: number;
  7625. SERIES_FILTER: number;
  7626. STATISTIC: number;
  7627. };
  7628. VISUAL: {
  7629. LAYOUT: number;
  7630. PROGRESSIVE_LAYOUT: number;
  7631. GLOBAL: number;
  7632. CHART: number;
  7633. POST_CHART_LAYOUT: number;
  7634. COMPONENT: number;
  7635. BRUSH: number;
  7636. CHART_ITEM: number;
  7637. ARIA: number;
  7638. DECAL: number;
  7639. };
  7640. };
  7641. declare const IN_MAIN_PROCESS_KEY: "__flagInMainProcess";
  7642. declare const PENDING_UPDATE: "__pendingUpdate";
  7643. declare const STATUS_NEEDS_UPDATE_KEY: "__needsUpdateStatus";
  7644. declare const CONNECT_STATUS_KEY: "__connectUpdateStatus";
  7645. declare type SetOptionTransitionOpt = UpdateLifecycleTransitionOpt;
  7646. declare type SetOptionTransitionOptItem = UpdateLifecycleTransitionItem;
  7647. interface SetOptionOpts {
  7648. notMerge?: boolean;
  7649. lazyUpdate?: boolean;
  7650. silent?: boolean;
  7651. replaceMerge?: GlobalModelSetOptionOpts['replaceMerge'];
  7652. transition?: SetOptionTransitionOpt;
  7653. }
  7654. interface ResizeOpts {
  7655. width?: number | 'auto';
  7656. height?: number | 'auto';
  7657. animation?: AnimationOption$1;
  7658. silent?: boolean;
  7659. }
  7660. interface PostIniter {
  7661. (chart: EChartsType): void;
  7662. }
  7663. declare type RenderedEventParam = {
  7664. elapsedTime: number;
  7665. };
  7666. declare type ECEventDefinition = {
  7667. [key in ZRElementEventName]: EventCallbackSingleParam<ECElementEvent>;
  7668. } & {
  7669. rendered: EventCallbackSingleParam<RenderedEventParam>;
  7670. finished: () => void | boolean;
  7671. } & {
  7672. [key: string]: (...args: unknown[]) => void | boolean;
  7673. };
  7674. declare type EChartsInitOpts = {
  7675. locale?: string | LocaleOption;
  7676. renderer?: RendererType;
  7677. devicePixelRatio?: number;
  7678. useDirtyRect?: boolean;
  7679. useCoarsePointer?: boolean;
  7680. pointerSize?: number;
  7681. ssr?: boolean;
  7682. width?: number;
  7683. height?: number;
  7684. };
  7685. declare class ECharts extends Eventful<ECEventDefinition> {
  7686. /**
  7687. * @readonly
  7688. */
  7689. id: string;
  7690. /**
  7691. * Group id
  7692. * @readonly
  7693. */
  7694. group: string;
  7695. private _ssr;
  7696. private _zr;
  7697. private _dom;
  7698. private _model;
  7699. private _throttledZrFlush;
  7700. private _theme;
  7701. private _locale;
  7702. private _chartsViews;
  7703. private _chartsMap;
  7704. private _componentsViews;
  7705. private _componentsMap;
  7706. private _coordSysMgr;
  7707. private _api;
  7708. private _scheduler;
  7709. private _messageCenter;
  7710. private _pendingActions;
  7711. protected _$eventProcessor: never;
  7712. private _disposed;
  7713. private _loadingFX;
  7714. private [PENDING_UPDATE];
  7715. private [IN_MAIN_PROCESS_KEY];
  7716. private [CONNECT_STATUS_KEY];
  7717. private [STATUS_NEEDS_UPDATE_KEY];
  7718. constructor(dom: HTMLElement, theme?: string | ThemeOption, opts?: EChartsInitOpts);
  7719. private _onframe;
  7720. getDom(): HTMLElement;
  7721. getId(): string;
  7722. getZr(): ZRenderType;
  7723. isSSR(): boolean;
  7724. /**
  7725. * Usage:
  7726. * chart.setOption(option, notMerge, lazyUpdate);
  7727. * chart.setOption(option, {
  7728. * notMerge: ...,
  7729. * lazyUpdate: ...,
  7730. * silent: ...
  7731. * });
  7732. *
  7733. * @param opts opts or notMerge.
  7734. * @param opts.notMerge Default `false`.
  7735. * @param opts.lazyUpdate Default `false`. Useful when setOption frequently.
  7736. * @param opts.silent Default `false`.
  7737. * @param opts.replaceMerge Default undefined.
  7738. */
  7739. setOption<Opt extends ECBasicOption>(option: Opt, notMerge?: boolean, lazyUpdate?: boolean): void;
  7740. setOption<Opt extends ECBasicOption>(option: Opt, opts?: SetOptionOpts): void;
  7741. /**
  7742. * @deprecated
  7743. */
  7744. private setTheme;
  7745. private getModel;
  7746. getOption(): ECBasicOption;
  7747. getWidth(): number;
  7748. getHeight(): number;
  7749. getDevicePixelRatio(): number;
  7750. /**
  7751. * Get canvas which has all thing rendered
  7752. * @deprecated Use renderToCanvas instead.
  7753. */
  7754. getRenderedCanvas(opts?: any): HTMLCanvasElement;
  7755. renderToCanvas(opts?: {
  7756. backgroundColor?: ZRColor;
  7757. pixelRatio?: number;
  7758. }): HTMLCanvasElement;
  7759. renderToSVGString(opts?: {
  7760. useViewBox?: boolean;
  7761. }): string;
  7762. /**
  7763. * Get svg data url
  7764. */
  7765. getSvgDataURL(): string;
  7766. getDataURL(opts?: {
  7767. type?: 'png' | 'jpeg' | 'svg';
  7768. pixelRatio?: number;
  7769. backgroundColor?: ZRColor;
  7770. excludeComponents?: ComponentMainType[];
  7771. }): string;
  7772. getConnectedDataURL(opts?: {
  7773. type?: 'png' | 'jpeg' | 'svg';
  7774. pixelRatio?: number;
  7775. backgroundColor?: ZRColor;
  7776. connectedBackgroundColor?: ZRColor;
  7777. excludeComponents?: string[];
  7778. }): string;
  7779. /**
  7780. * Convert from logical coordinate system to pixel coordinate system.
  7781. * See CoordinateSystem#convertToPixel.
  7782. */
  7783. convertToPixel(finder: ModelFinder$1, value: ScaleDataValue): number;
  7784. convertToPixel(finder: ModelFinder$1, value: ScaleDataValue[]): number[];
  7785. /**
  7786. * Convert from pixel coordinate system to logical coordinate system.
  7787. * See CoordinateSystem#convertFromPixel.
  7788. */
  7789. convertFromPixel(finder: ModelFinder$1, value: number): number;
  7790. convertFromPixel(finder: ModelFinder$1, value: number[]): number[];
  7791. /**
  7792. * Is the specified coordinate systems or components contain the given pixel point.
  7793. * @param {Array|number} value
  7794. * @return {boolean} result
  7795. */
  7796. containPixel(finder: ModelFinder$1, value: number[]): boolean;
  7797. /**
  7798. * Get visual from series or data.
  7799. * @param finder
  7800. * If string, e.g., 'series', means {seriesIndex: 0}.
  7801. * If Object, could contain some of these properties below:
  7802. * {
  7803. * seriesIndex / seriesId / seriesName,
  7804. * dataIndex / dataIndexInside
  7805. * }
  7806. * If dataIndex is not specified, series visual will be fetched,
  7807. * but not data item visual.
  7808. * If all of seriesIndex, seriesId, seriesName are not specified,
  7809. * visual will be fetched from first series.
  7810. * @param visualType 'color', 'symbol', 'symbolSize'
  7811. */
  7812. getVisual(finder: ModelFinder$1, visualType: string): string | number | number[] | PatternObject | LinearGradientObject | RadialGradientObject;
  7813. /**
  7814. * Get view of corresponding component model
  7815. */
  7816. private getViewOfComponentModel;
  7817. /**
  7818. * Get view of corresponding series model
  7819. */
  7820. private getViewOfSeriesModel;
  7821. private _initEvents;
  7822. isDisposed(): boolean;
  7823. clear(): void;
  7824. dispose(): void;
  7825. /**
  7826. * Resize the chart
  7827. */
  7828. resize(opts?: ResizeOpts): void;
  7829. /**
  7830. * Show loading effect
  7831. * @param name 'default' by default
  7832. * @param cfg cfg of registered loading effect
  7833. */
  7834. showLoading(cfg?: object): void;
  7835. showLoading(name?: string, cfg?: object): void;
  7836. /**
  7837. * Hide loading effect
  7838. */
  7839. hideLoading(): void;
  7840. makeActionFromEvent(eventObj: ECActionEvent): Payload;
  7841. /**
  7842. * @param opt If pass boolean, means opt.silent
  7843. * @param opt.silent Default `false`. Whether trigger events.
  7844. * @param opt.flush Default `undefined`.
  7845. * true: Flush immediately, and then pixel in canvas can be fetched
  7846. * immediately. Caution: it might affect performance.
  7847. * false: Not flush.
  7848. * undefined: Auto decide whether perform flush.
  7849. */
  7850. dispatchAction(payload: Payload, opt?: boolean | {
  7851. silent?: boolean;
  7852. flush?: boolean | undefined;
  7853. }): void;
  7854. updateLabelLayout(): void;
  7855. appendData(params: {
  7856. seriesIndex: number;
  7857. data: any;
  7858. }): void;
  7859. private static internalField;
  7860. }
  7861. /**
  7862. * @param opts.devicePixelRatio Use window.devicePixelRatio by default
  7863. * @param opts.renderer Can choose 'canvas' or 'svg' to render the chart.
  7864. * @param opts.width Use clientWidth of the input `dom` by default.
  7865. * Can be 'auto' (the same as null/undefined)
  7866. * @param opts.height Use clientHeight of the input `dom` by default.
  7867. * Can be 'auto' (the same as null/undefined)
  7868. * @param opts.locale Specify the locale.
  7869. * @param opts.useDirtyRect Enable dirty rectangle rendering or not.
  7870. */
  7871. declare function init$1(dom: HTMLElement, theme?: string | object, opts?: EChartsInitOpts): EChartsType;
  7872. /**
  7873. * @usage
  7874. * (A)
  7875. * ```js
  7876. * let chart1 = echarts.init(dom1);
  7877. * let chart2 = echarts.init(dom2);
  7878. * chart1.group = 'xxx';
  7879. * chart2.group = 'xxx';
  7880. * echarts.connect('xxx');
  7881. * ```
  7882. * (B)
  7883. * ```js
  7884. * let chart1 = echarts.init(dom1);
  7885. * let chart2 = echarts.init(dom2);
  7886. * echarts.connect('xxx', [chart1, chart2]);
  7887. * ```
  7888. */
  7889. declare function connect(groupId: string | EChartsType[]): string;
  7890. /**
  7891. * @deprecated
  7892. */
  7893. declare function disConnect(groupId: string): void;
  7894. /**
  7895. * Alias and backword compat
  7896. */
  7897. declare const disconnect: typeof disConnect;
  7898. /**
  7899. * Dispose a chart instance
  7900. */
  7901. declare function dispose$1(chart: EChartsType | HTMLElement | string): void;
  7902. declare function getInstanceByDom(dom: HTMLElement): EChartsType | undefined;
  7903. declare function getInstanceById(key: string): EChartsType | undefined;
  7904. /**
  7905. * Register theme
  7906. */
  7907. declare function registerTheme(name: string, theme: ThemeOption): void;
  7908. /**
  7909. * Register option preprocessor
  7910. */
  7911. declare function registerPreprocessor(preprocessorFunc: OptionPreprocessor): void;
  7912. declare function registerProcessor(priority: number | StageHandler | StageHandlerOverallReset, processor?: StageHandler | StageHandlerOverallReset): void;
  7913. /**
  7914. * Register postIniter
  7915. * @param {Function} postInitFunc
  7916. */
  7917. declare function registerPostInit(postInitFunc: PostIniter): void;
  7918. /**
  7919. * Register postUpdater
  7920. * @param {Function} postUpdateFunc
  7921. */
  7922. declare function registerPostUpdate(postUpdateFunc: PostUpdater): void;
  7923. declare function registerUpdateLifecycle<T extends keyof LifecycleEvents>(name: T, cb: (...args: LifecycleEvents[T]) => void): void;
  7924. /**
  7925. * @usage
  7926. * registerAction('someAction', 'someEvent', function () { ... });
  7927. * registerAction('someAction', function () { ... });
  7928. * registerAction(
  7929. * {type: 'someAction', event: 'someEvent', update: 'updateView'},
  7930. * function () { ... }
  7931. * );
  7932. *
  7933. * @param {(string|Object)} actionInfo
  7934. * @param {string} actionInfo.type
  7935. * @param {string} [actionInfo.event]
  7936. * @param {string} [actionInfo.update]
  7937. * @param {string} [eventName]
  7938. * @param {Function} action
  7939. */
  7940. declare function registerAction(type: string, eventName: string, action: ActionHandler): void;
  7941. declare function registerAction(type: string, action: ActionHandler): void;
  7942. declare function registerAction(actionInfo: ActionInfo, action: ActionHandler): void;
  7943. declare function registerCoordinateSystem(type: string, coordSysCreator: CoordinateSystemCreator): void;
  7944. /**
  7945. * Get dimensions of specified coordinate system.
  7946. * @param {string} type
  7947. * @return {Array.<string|Object>}
  7948. */
  7949. declare function getCoordinateSystemDimensions(type: string): DimensionDefinitionLoose[];
  7950. /**
  7951. * Layout is a special stage of visual encoding
  7952. * Most visual encoding like color are common for different chart
  7953. * But each chart has it's own layout algorithm
  7954. */
  7955. declare function registerLayout(priority: number, layoutTask: StageHandler | StageHandlerOverallReset): void;
  7956. declare function registerLayout(layoutTask: StageHandler | StageHandlerOverallReset): void;
  7957. declare function registerVisual(priority: number, layoutTask: StageHandler | StageHandlerOverallReset): void;
  7958. declare function registerVisual(layoutTask: StageHandler | StageHandlerOverallReset): void;
  7959. declare function registerLoading(name: string, loadingFx: LoadingEffectCreator): void;
  7960. /**
  7961. * ZRender need a canvas context to do measureText.
  7962. * But in node environment canvas may be created by node-canvas.
  7963. * So we need to specify how to create a canvas instead of using document.createElement('canvas')
  7964. *
  7965. *
  7966. * @deprecated use setPlatformAPI({ createCanvas }) instead.
  7967. *
  7968. * @example
  7969. * let Canvas = require('canvas');
  7970. * let echarts = require('echarts');
  7971. * echarts.setCanvasCreator(function () {
  7972. * // Small size is enough.
  7973. * return new Canvas(32, 32);
  7974. * });
  7975. */
  7976. declare function setCanvasCreator(creator: () => HTMLCanvasElement): void;
  7977. declare type RegisterMapParams = Parameters<typeof _default$1.registerMap>;
  7978. /**
  7979. * The parameters and usage: see `geoSourceManager.registerMap`.
  7980. * Compatible with previous `echarts.registerMap`.
  7981. */
  7982. declare function registerMap(mapName: RegisterMapParams[0], geoJson: RegisterMapParams[1], specialAreas?: RegisterMapParams[2]): void;
  7983. declare function getMap(mapName: string): any;
  7984. declare const registerTransform: typeof registerExternalTransform;
  7985. declare const dataTool: {};
  7986. interface EChartsType extends ECharts {
  7987. }
  7988. declare function parse(colorStr: string, rgbaArr?: number[]): number[];
  7989. declare function lift(color: string, level: number): string;
  7990. declare function toHex(color: string): string;
  7991. declare function fastLerp(normalizedValue: number, colors: number[][], out?: number[]): number[];
  7992. declare const fastMapToColor: typeof fastLerp;
  7993. declare type LerpFullOutput = {
  7994. color: string;
  7995. leftIndex: number;
  7996. rightIndex: number;
  7997. value: number;
  7998. };
  7999. declare function lerp$1(normalizedValue: number, colors: string[], fullOutput: boolean): LerpFullOutput;
  8000. declare function lerp$1(normalizedValue: number, colors: string[]): string;
  8001. declare const mapToColor: typeof lerp$1;
  8002. declare function modifyHSL(color: string, h?: number, s?: number, l?: number): string;
  8003. declare function modifyAlpha(color: string, alpha?: number): string;
  8004. declare function stringify(arrColor: number[], type: string): string;
  8005. declare function lum(color: string, backgroundLum: number): number;
  8006. declare function random(): string;
  8007. declare const color_d_parse: typeof parse;
  8008. declare const color_d_lift: typeof lift;
  8009. declare const color_d_toHex: typeof toHex;
  8010. declare const color_d_fastLerp: typeof fastLerp;
  8011. declare const color_d_fastMapToColor: typeof fastMapToColor;
  8012. declare const color_d_mapToColor: typeof mapToColor;
  8013. declare const color_d_modifyHSL: typeof modifyHSL;
  8014. declare const color_d_modifyAlpha: typeof modifyAlpha;
  8015. declare const color_d_stringify: typeof stringify;
  8016. declare const color_d_lum: typeof lum;
  8017. declare const color_d_random: typeof random;
  8018. declare namespace color_d {
  8019. export {
  8020. color_d_parse as parse,
  8021. color_d_lift as lift,
  8022. color_d_toHex as toHex,
  8023. color_d_fastLerp as fastLerp,
  8024. color_d_fastMapToColor as fastMapToColor,
  8025. lerp$1 as lerp,
  8026. color_d_mapToColor as mapToColor,
  8027. color_d_modifyHSL as modifyHSL,
  8028. color_d_modifyAlpha as modifyAlpha,
  8029. color_d_stringify as stringify,
  8030. color_d_lum as lum,
  8031. color_d_random as random,
  8032. };
  8033. }
  8034. declare type ThrottleFunction = (this: unknown, ...args: unknown[]) => void;
  8035. interface ThrottleController {
  8036. clear(): void;
  8037. debounceNextCall(debounceDelay: number): void;
  8038. }
  8039. /**
  8040. * @public
  8041. * @param {(Function)} fn
  8042. * @param {number} [delay=0] Unit: ms.
  8043. * @param {boolean} [debounce=false]
  8044. * true: If call interval less than `delay`, only the last call works.
  8045. * false: If call interval less than `delay, call works on fixed rate.
  8046. * @return {(Function)} throttled fn.
  8047. */
  8048. declare function throttle<T extends ThrottleFunction>(fn: T, delay?: number, debounce?: boolean): T & ThrottleController;
  8049. declare type EnableDataStackDimensionsInput = {
  8050. schema: SeriesDataSchema;
  8051. store?: DataStore;
  8052. };
  8053. declare type EnableDataStackDimensionsInputLegacy = (SeriesDimensionDefine | string)[];
  8054. /**
  8055. * Note that it is too complicated to support 3d stack by value
  8056. * (have to create two-dimension inverted index), so in 3d case
  8057. * we just support that stacked by index.
  8058. *
  8059. * @param seriesModel
  8060. * @param dimensionsInput The same as the input of <module:echarts/data/SeriesData>.
  8061. * The input will be modified.
  8062. * @param opt
  8063. * @param opt.stackedCoordDimension Specify a coord dimension if needed.
  8064. * @param opt.byIndex=false
  8065. * @return calculationInfo
  8066. * {
  8067. * stackedDimension: string
  8068. * stackedByDimension: string
  8069. * isStackedByIndex: boolean
  8070. * stackedOverDimension: string
  8071. * stackResultDimension: string
  8072. * }
  8073. */
  8074. declare function enableDataStack(seriesModel: SeriesModel<SeriesOption & SeriesStackOptionMixin>, dimensionsInput: EnableDataStackDimensionsInput | EnableDataStackDimensionsInputLegacy, opt?: {
  8075. stackedCoordDimension?: string;
  8076. byIndex?: boolean;
  8077. }): Pick<DataCalculationInfo<unknown>, 'stackedDimension' | 'stackedByDimension' | 'isStackedByIndex' | 'stackedOverDimension' | 'stackResultDimension'>;
  8078. declare function isDimensionStacked(data: SeriesData, stackedDim: string): boolean;
  8079. declare function getStackedDimension(data: SeriesData, targetDim: string): DimensionName;
  8080. /**
  8081. * ECData stored on graphic element
  8082. */
  8083. interface ECData {
  8084. dataIndex?: number;
  8085. dataModel?: DataModel;
  8086. eventData?: ECEventData;
  8087. seriesIndex?: number;
  8088. dataType?: SeriesDataType;
  8089. focus?: InnerFocus;
  8090. blurScope?: BlurScope;
  8091. componentMainType?: ComponentMainType;
  8092. componentIndex?: number;
  8093. componentHighDownName?: string;
  8094. tooltipConfig?: {
  8095. name: string;
  8096. option: ComponentItemTooltipOption<unknown>;
  8097. };
  8098. }
  8099. declare const getECData: (hostObj: Element<ElementProps>) => ECData;
  8100. interface CoordDimensionDefinition extends DimensionDefinition {
  8101. dimsDef?: (DimensionName | {
  8102. name: DimensionName;
  8103. defaultTooltip?: boolean;
  8104. })[];
  8105. otherDims?: DataVisualDimensions;
  8106. ordinalMeta?: OrdinalMeta;
  8107. coordDim?: DimensionName;
  8108. coordDimIndex?: DimensionIndex;
  8109. }
  8110. declare type CoordDimensionDefinitionLoose = CoordDimensionDefinition['name'] | CoordDimensionDefinition;
  8111. declare type PrepareSeriesDataSchemaParams = {
  8112. coordDimensions?: CoordDimensionDefinitionLoose[];
  8113. /**
  8114. * Will use `source.dimensionsDefine` if not given.
  8115. */
  8116. dimensionsDefine?: DimensionDefinitionLoose[];
  8117. /**
  8118. * Will use `source.encodeDefine` if not given.
  8119. */
  8120. encodeDefine?: HashMap<OptionEncodeValue, DimensionName> | OptionEncode;
  8121. dimensionsCount?: number;
  8122. /**
  8123. * Make default encode if user not specified.
  8124. */
  8125. encodeDefaulter?: EncodeDefaulter;
  8126. generateCoord?: string;
  8127. generateCoordCount?: number;
  8128. /**
  8129. * If be able to omit unused dimension
  8130. * Used to improve the performance on high dimension data.
  8131. */
  8132. canOmitUnusedDimensions?: boolean;
  8133. };
  8134. /**
  8135. * For outside usage compat (like echarts-gl are using it).
  8136. */
  8137. declare function createDimensions(source: Source | OptionSourceData, opt?: PrepareSeriesDataSchemaParams): SeriesDimensionDefine[];
  8138. /**
  8139. * Enable the function that mouseover will trigger the emphasis state.
  8140. *
  8141. * NOTE:
  8142. * This function should be used on the element with dataIndex, seriesIndex.
  8143. *
  8144. */
  8145. declare function enableHoverEmphasis(el: Element, focus?: InnerFocus, blurScope?: BlurScope): void;
  8146. /**
  8147. * Create a muti dimension List structure from seriesModel.
  8148. */
  8149. declare function createList(seriesModel: SeriesModel): SeriesData<Model<any>, DefaultDataVisual>;
  8150. declare const dataStack: {
  8151. isDimensionStacked: typeof isDimensionStacked;
  8152. enableDataStack: typeof enableDataStack;
  8153. getStackedDimension: typeof getStackedDimension;
  8154. };
  8155. /**
  8156. * Create scale
  8157. * @param {Array.<number>} dataExtent
  8158. * @param {Object|module:echarts/Model} option If `optoin.type`
  8159. * is secified, it can only be `'value'` currently.
  8160. */
  8161. declare function createScale(dataExtent: number[], option: object | AxisBaseModel): Scale<Dictionary<unknown>>;
  8162. /**
  8163. * Mixin common methods to axis model,
  8164. *
  8165. * Inlcude methods
  8166. * `getFormattedLabels() => Array.<string>`
  8167. * `getCategories() => Array.<string>`
  8168. * `getMin(origin: boolean) => number`
  8169. * `getMax(origin: boolean) => number`
  8170. * `getNeedCrossZero() => boolean`
  8171. */
  8172. declare function mixinAxisModelCommonMethods(Model: Model): void;
  8173. declare function createTextStyle(textStyleModel: Model<TextCommonOption>, opts?: {
  8174. state?: DisplayState;
  8175. }): TextStyleProps;
  8176. declare const helper_d_getLayoutRect: typeof getLayoutRect;
  8177. declare const helper_d_getECData: typeof getECData;
  8178. declare const helper_d_createList: typeof createList;
  8179. declare const helper_d_dataStack: typeof dataStack;
  8180. declare const helper_d_createScale: typeof createScale;
  8181. declare const helper_d_mixinAxisModelCommonMethods: typeof mixinAxisModelCommonMethods;
  8182. declare const helper_d_createTextStyle: typeof createTextStyle;
  8183. declare const helper_d_createDimensions: typeof createDimensions;
  8184. declare const helper_d_createSymbol: typeof createSymbol;
  8185. declare const helper_d_enableHoverEmphasis: typeof enableHoverEmphasis;
  8186. declare namespace helper_d {
  8187. export {
  8188. helper_d_getLayoutRect as getLayoutRect,
  8189. helper_d_getECData as getECData,
  8190. helper_d_createList as createList,
  8191. helper_d_dataStack as dataStack,
  8192. helper_d_createScale as createScale,
  8193. helper_d_mixinAxisModelCommonMethods as mixinAxisModelCommonMethods,
  8194. helper_d_createTextStyle as createTextStyle,
  8195. helper_d_createDimensions as createDimensions,
  8196. helper_d_createSymbol as createSymbol,
  8197. helper_d_enableHoverEmphasis as enableHoverEmphasis,
  8198. };
  8199. }
  8200. interface Platform {
  8201. createCanvas(): HTMLCanvasElement;
  8202. measureText(text: string, font?: string): {
  8203. width: number;
  8204. };
  8205. loadImage(src: string, onload: () => void | HTMLImageElement['onload'], onerror: () => void | HTMLImageElement['onerror']): HTMLImageElement;
  8206. }
  8207. declare function setPlatformAPI(newPlatformApis: Partial<Platform>): void;
  8208. declare function parseGeoJSON(geoJson: GeoJSON | GeoJSONCompressed, nameProperty: string): GeoJSONRegion[];
  8209. /**
  8210. * Linear mapping a value from domain to range
  8211. * @param val
  8212. * @param domain Domain extent domain[0] can be bigger than domain[1]
  8213. * @param range Range extent range[0] can be bigger than range[1]
  8214. * @param clamp Default to be false
  8215. */
  8216. declare function linearMap(val: number, domain: number[], range: number[], clamp?: boolean): number;
  8217. /**
  8218. * (1) Fix rounding error of float numbers.
  8219. * (2) Support return string to avoid scientific notation like '3.5e-7'.
  8220. */
  8221. declare function round(x: number | string, precision?: number): number;
  8222. declare function round(x: number | string, precision: number, returnStr: false): number;
  8223. declare function round(x: number | string, precision: number, returnStr: true): string;
  8224. /**
  8225. * Inplacd asc sort arr.
  8226. * The input arr will be modified.
  8227. */
  8228. declare function asc<T extends number[]>(arr: T): T;
  8229. /**
  8230. * Get precision.
  8231. */
  8232. declare function getPrecision(val: string | number): number;
  8233. /**
  8234. * Get precision with slow but safe method
  8235. */
  8236. declare function getPrecisionSafe(val: string | number): number;
  8237. /**
  8238. * Minimal dicernible data precisioin according to a single pixel.
  8239. */
  8240. declare function getPixelPrecision(dataExtent: [number, number], pixelExtent: [number, number]): number;
  8241. /**
  8242. * Get a data of given precision, assuring the sum of percentages
  8243. * in valueList is 1.
  8244. * The largest remainer method is used.
  8245. * https://en.wikipedia.org/wiki/Largest_remainder_method
  8246. *
  8247. * @param valueList a list of all data
  8248. * @param idx index of the data to be processed in valueList
  8249. * @param precision integer number showing digits of precision
  8250. * @return percent ranging from 0 to 100
  8251. */
  8252. declare function getPercentWithPrecision(valueList: number[], idx: number, precision: number): number;
  8253. declare const MAX_SAFE_INTEGER = 9007199254740991;
  8254. /**
  8255. * To 0 - 2 * PI, considering negative radian.
  8256. */
  8257. declare function remRadian(radian: number): number;
  8258. /**
  8259. * @param {type} radian
  8260. * @return {boolean}
  8261. */
  8262. declare function isRadianAroundZero(val: number): boolean;
  8263. /**
  8264. * @param value valid type: number | string | Date, otherwise return `new Date(NaN)`
  8265. * These values can be accepted:
  8266. * + An instance of Date, represent a time in its own time zone.
  8267. * + Or string in a subset of ISO 8601, only including:
  8268. * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06',
  8269. * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123',
  8270. * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00',
  8271. * all of which will be treated as local time if time zone is not specified
  8272. * (see <https://momentjs.com/>).
  8273. * + Or other string format, including (all of which will be treated as loacal time):
  8274. * '2012', '2012-3-1', '2012/3/1', '2012/03/01',
  8275. * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123'
  8276. * + a timestamp, which represent a time in UTC.
  8277. * @return date Never be null/undefined. If invalid, return `new Date(NaN)`.
  8278. */
  8279. declare function parseDate(value: unknown): Date;
  8280. /**
  8281. * Quantity of a number. e.g. 0.1, 1, 10, 100
  8282. *
  8283. * @param val
  8284. * @return
  8285. */
  8286. declare function quantity(val: number): number;
  8287. /**
  8288. * Exponent of the quantity of a number
  8289. * e.g., 1234 equals to 1.234*10^3, so quantityExponent(1234) is 3
  8290. *
  8291. * @param val non-negative value
  8292. * @return
  8293. */
  8294. declare function quantityExponent(val: number): number;
  8295. /**
  8296. * find a “nice” number approximately equal to x. Round the number if round = true,
  8297. * take ceiling if round = false. The primary observation is that the “nicest”
  8298. * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.
  8299. *
  8300. * See "Nice Numbers for Graph Labels" of Graphic Gems.
  8301. *
  8302. * @param val Non-negative value.
  8303. * @param round
  8304. * @return Niced number
  8305. */
  8306. declare function nice(val: number, round?: boolean): number;
  8307. /**
  8308. * This code was copied from "d3.js"
  8309. * <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/arrays/quantile.js>.
  8310. * See the license statement at the head of this file.
  8311. * @param ascArr
  8312. */
  8313. declare function quantile(ascArr: number[], p: number): number;
  8314. declare type IntervalItem = {
  8315. interval: [number, number];
  8316. close: [0 | 1, 0 | 1];
  8317. };
  8318. /**
  8319. * Order intervals asc, and split them when overlap.
  8320. * expect(numberUtil.reformIntervals([
  8321. * {interval: [18, 62], close: [1, 1]},
  8322. * {interval: [-Infinity, -70], close: [0, 0]},
  8323. * {interval: [-70, -26], close: [1, 1]},
  8324. * {interval: [-26, 18], close: [1, 1]},
  8325. * {interval: [62, 150], close: [1, 1]},
  8326. * {interval: [106, 150], close: [1, 1]},
  8327. * {interval: [150, Infinity], close: [0, 0]}
  8328. * ])).toEqual([
  8329. * {interval: [-Infinity, -70], close: [0, 0]},
  8330. * {interval: [-70, -26], close: [1, 1]},
  8331. * {interval: [-26, 18], close: [0, 1]},
  8332. * {interval: [18, 62], close: [0, 1]},
  8333. * {interval: [62, 150], close: [0, 1]},
  8334. * {interval: [150, Infinity], close: [0, 0]}
  8335. * ]);
  8336. * @param list, where `close` mean open or close
  8337. * of the interval, and Infinity can be used.
  8338. * @return The origin list, which has been reformed.
  8339. */
  8340. declare function reformIntervals(list: IntervalItem[]): IntervalItem[];
  8341. /**
  8342. * [Numberic is defined as]:
  8343. * `parseFloat(val) == val`
  8344. * For example:
  8345. * numeric:
  8346. * typeof number except NaN, '-123', '123', '2e3', '-2e3', '011', 'Infinity', Infinity,
  8347. * and they rounded by white-spaces or line-terminal like ' -123 \n ' (see es spec)
  8348. * not-numeric:
  8349. * null, undefined, [], {}, true, false, 'NaN', NaN, '123ab',
  8350. * empty string, string with only white-spaces or line-terminal (see es spec),
  8351. * 0x12, '0x12', '-0x12', 012, '012', '-012',
  8352. * non-string, ...
  8353. *
  8354. * @test See full test cases in `test/ut/spec/util/number.js`.
  8355. * @return Must be a typeof number. If not numeric, return NaN.
  8356. */
  8357. declare function numericToNumber(val: unknown): number;
  8358. /**
  8359. * Definition of "numeric": see `numericToNumber`.
  8360. */
  8361. declare function isNumeric(val: unknown): val is number;
  8362. declare const number_d_linearMap: typeof linearMap;
  8363. declare const number_d_round: typeof round;
  8364. declare const number_d_asc: typeof asc;
  8365. declare const number_d_getPrecision: typeof getPrecision;
  8366. declare const number_d_getPrecisionSafe: typeof getPrecisionSafe;
  8367. declare const number_d_getPixelPrecision: typeof getPixelPrecision;
  8368. declare const number_d_getPercentWithPrecision: typeof getPercentWithPrecision;
  8369. declare const number_d_MAX_SAFE_INTEGER: typeof MAX_SAFE_INTEGER;
  8370. declare const number_d_remRadian: typeof remRadian;
  8371. declare const number_d_isRadianAroundZero: typeof isRadianAroundZero;
  8372. declare const number_d_parseDate: typeof parseDate;
  8373. declare const number_d_quantity: typeof quantity;
  8374. declare const number_d_quantityExponent: typeof quantityExponent;
  8375. declare const number_d_nice: typeof nice;
  8376. declare const number_d_quantile: typeof quantile;
  8377. declare const number_d_reformIntervals: typeof reformIntervals;
  8378. declare const number_d_isNumeric: typeof isNumeric;
  8379. declare const number_d_numericToNumber: typeof numericToNumber;
  8380. declare namespace number_d {
  8381. export {
  8382. number_d_linearMap as linearMap,
  8383. number_d_round as round,
  8384. number_d_asc as asc,
  8385. number_d_getPrecision as getPrecision,
  8386. number_d_getPrecisionSafe as getPrecisionSafe,
  8387. number_d_getPixelPrecision as getPixelPrecision,
  8388. number_d_getPercentWithPrecision as getPercentWithPrecision,
  8389. number_d_MAX_SAFE_INTEGER as MAX_SAFE_INTEGER,
  8390. number_d_remRadian as remRadian,
  8391. number_d_isRadianAroundZero as isRadianAroundZero,
  8392. number_d_parseDate as parseDate,
  8393. number_d_quantity as quantity,
  8394. number_d_quantityExponent as quantityExponent,
  8395. number_d_nice as nice,
  8396. number_d_quantile as quantile,
  8397. number_d_reformIntervals as reformIntervals,
  8398. number_d_isNumeric as isNumeric,
  8399. number_d_numericToNumber as numericToNumber,
  8400. };
  8401. }
  8402. declare function format(time: unknown, template: string, isUTC: boolean, lang?: string | Model<LocaleOption>): string;
  8403. declare const time_d_format: typeof format;
  8404. declare namespace time_d {
  8405. export {
  8406. parseDate as parse,
  8407. time_d_format as format,
  8408. };
  8409. }
  8410. declare const graphic_d_extendShape: typeof extendShape;
  8411. declare const graphic_d_extendPath: typeof extendPath;
  8412. declare const graphic_d_makePath: typeof makePath;
  8413. declare const graphic_d_makeImage: typeof makeImage;
  8414. declare const graphic_d_resizePath: typeof resizePath;
  8415. declare const graphic_d_createIcon: typeof createIcon;
  8416. declare const graphic_d_updateProps: typeof updateProps;
  8417. declare const graphic_d_initProps: typeof initProps;
  8418. declare const graphic_d_getTransform: typeof getTransform;
  8419. declare const graphic_d_clipPointsByRect: typeof clipPointsByRect;
  8420. declare const graphic_d_clipRectByRect: typeof clipRectByRect;
  8421. declare const graphic_d_registerShape: typeof registerShape;
  8422. declare const graphic_d_getShapeClass: typeof getShapeClass;
  8423. type graphic_d_Group = Group;
  8424. declare const graphic_d_Group: typeof Group;
  8425. type graphic_d_Circle = Circle;
  8426. declare const graphic_d_Circle: typeof Circle;
  8427. type graphic_d_Ellipse = Ellipse;
  8428. declare const graphic_d_Ellipse: typeof Ellipse;
  8429. type graphic_d_Sector = Sector;
  8430. declare const graphic_d_Sector: typeof Sector;
  8431. type graphic_d_Ring = Ring;
  8432. declare const graphic_d_Ring: typeof Ring;
  8433. type graphic_d_Polygon = Polygon;
  8434. declare const graphic_d_Polygon: typeof Polygon;
  8435. type graphic_d_Polyline = Polyline;
  8436. declare const graphic_d_Polyline: typeof Polyline;
  8437. type graphic_d_Rect = Rect;
  8438. declare const graphic_d_Rect: typeof Rect;
  8439. type graphic_d_Line = Line;
  8440. declare const graphic_d_Line: typeof Line;
  8441. type graphic_d_BezierCurve = BezierCurve;
  8442. declare const graphic_d_BezierCurve: typeof BezierCurve;
  8443. type graphic_d_Arc = Arc;
  8444. declare const graphic_d_Arc: typeof Arc;
  8445. type graphic_d_IncrementalDisplayable = IncrementalDisplayable;
  8446. declare const graphic_d_IncrementalDisplayable: typeof IncrementalDisplayable;
  8447. type graphic_d_CompoundPath = CompoundPath;
  8448. declare const graphic_d_CompoundPath: typeof CompoundPath;
  8449. type graphic_d_LinearGradient = LinearGradient;
  8450. declare const graphic_d_LinearGradient: typeof LinearGradient;
  8451. type graphic_d_RadialGradient = RadialGradient;
  8452. declare const graphic_d_RadialGradient: typeof RadialGradient;
  8453. type graphic_d_BoundingRect = BoundingRect;
  8454. declare const graphic_d_BoundingRect: typeof BoundingRect;
  8455. declare namespace graphic_d {
  8456. export {
  8457. graphic_d_extendShape as extendShape,
  8458. graphic_d_extendPath as extendPath,
  8459. graphic_d_makePath as makePath,
  8460. graphic_d_makeImage as makeImage,
  8461. mergePath$1 as mergePath,
  8462. graphic_d_resizePath as resizePath,
  8463. graphic_d_createIcon as createIcon,
  8464. graphic_d_updateProps as updateProps,
  8465. graphic_d_initProps as initProps,
  8466. graphic_d_getTransform as getTransform,
  8467. graphic_d_clipPointsByRect as clipPointsByRect,
  8468. graphic_d_clipRectByRect as clipRectByRect,
  8469. graphic_d_registerShape as registerShape,
  8470. graphic_d_getShapeClass as getShapeClass,
  8471. graphic_d_Group as Group,
  8472. ZRImage as Image,
  8473. ZRText as Text,
  8474. graphic_d_Circle as Circle,
  8475. graphic_d_Ellipse as Ellipse,
  8476. graphic_d_Sector as Sector,
  8477. graphic_d_Ring as Ring,
  8478. graphic_d_Polygon as Polygon,
  8479. graphic_d_Polyline as Polyline,
  8480. graphic_d_Rect as Rect,
  8481. graphic_d_Line as Line,
  8482. graphic_d_BezierCurve as BezierCurve,
  8483. graphic_d_Arc as Arc,
  8484. graphic_d_IncrementalDisplayable as IncrementalDisplayable,
  8485. graphic_d_CompoundPath as CompoundPath,
  8486. graphic_d_LinearGradient as LinearGradient,
  8487. graphic_d_RadialGradient as RadialGradient,
  8488. graphic_d_BoundingRect as BoundingRect,
  8489. };
  8490. }
  8491. declare const format_d_addCommas: typeof addCommas;
  8492. declare const format_d_toCamelCase: typeof toCamelCase;
  8493. declare const format_d_encodeHTML: typeof encodeHTML;
  8494. declare const format_d_formatTpl: typeof formatTpl;
  8495. declare const format_d_getTooltipMarker: typeof getTooltipMarker;
  8496. declare const format_d_formatTime: typeof formatTime;
  8497. declare const format_d_capitalFirst: typeof capitalFirst;
  8498. declare const format_d_truncateText: typeof truncateText;
  8499. declare const format_d_getTextRect: typeof getTextRect;
  8500. declare namespace format_d {
  8501. export {
  8502. format_d_addCommas as addCommas,
  8503. format_d_toCamelCase as toCamelCase,
  8504. normalizeCssArray$1 as normalizeCssArray,
  8505. format_d_encodeHTML as encodeHTML,
  8506. format_d_formatTpl as formatTpl,
  8507. format_d_getTooltipMarker as getTooltipMarker,
  8508. format_d_formatTime as formatTime,
  8509. format_d_capitalFirst as capitalFirst,
  8510. format_d_truncateText as truncateText,
  8511. format_d_getTextRect as getTextRect,
  8512. };
  8513. }
  8514. declare const util_d$1_map: typeof map;
  8515. declare const util_d$1_each: typeof each;
  8516. declare const util_d$1_indexOf: typeof indexOf;
  8517. declare const util_d$1_inherits: typeof inherits;
  8518. declare const util_d$1_reduce: typeof reduce;
  8519. declare const util_d$1_filter: typeof filter;
  8520. declare const util_d$1_bind: typeof bind;
  8521. declare const util_d$1_curry: typeof curry;
  8522. declare const util_d$1_isArray: typeof isArray;
  8523. declare const util_d$1_isString: typeof isString;
  8524. declare const util_d$1_isObject: typeof isObject;
  8525. declare const util_d$1_isFunction: typeof isFunction;
  8526. declare const util_d$1_extend: typeof extend;
  8527. declare const util_d$1_defaults: typeof defaults;
  8528. declare const util_d$1_merge: typeof merge;
  8529. declare namespace util_d$1 {
  8530. export {
  8531. util_d$1_map as map,
  8532. util_d$1_each as each,
  8533. util_d$1_indexOf as indexOf,
  8534. util_d$1_inherits as inherits,
  8535. util_d$1_reduce as reduce,
  8536. util_d$1_filter as filter,
  8537. util_d$1_bind as bind,
  8538. util_d$1_curry as curry,
  8539. util_d$1_isArray as isArray,
  8540. util_d$1_isString as isString,
  8541. util_d$1_isObject as isObject,
  8542. util_d$1_isFunction as isFunction,
  8543. util_d$1_extend as extend,
  8544. util_d$1_defaults as defaults,
  8545. clone$2 as clone,
  8546. util_d$1_merge as merge,
  8547. };
  8548. }
  8549. declare class Browser {
  8550. firefox: boolean;
  8551. ie: boolean;
  8552. edge: boolean;
  8553. newEdge: boolean;
  8554. weChat: boolean;
  8555. version: string | number;
  8556. }
  8557. declare class Env {
  8558. browser: Browser;
  8559. node: boolean;
  8560. wxa: boolean;
  8561. worker: boolean;
  8562. svgSupported: boolean;
  8563. touchEventsSupported: boolean;
  8564. pointerEventsSupported: boolean;
  8565. domSupported: boolean;
  8566. transformSupported: boolean;
  8567. transform3dSupported: boolean;
  8568. hasGlobalWindow: boolean;
  8569. }
  8570. declare const env: Env;
  8571. declare function brushSingle(ctx: CanvasRenderingContext2D, el: Displayable): void;
  8572. declare function extendComponentModel(proto: object): ComponentModel;
  8573. declare function extendComponentView(proto: object): ChartView;
  8574. declare function extendSeriesModel(proto: object): SeriesModel;
  8575. declare function extendChartView(proto: object): ChartView;
  8576. declare type ParallelLayoutDirection = 'horizontal' | 'vertical';
  8577. interface ParallelCoordinateSystemOption extends ComponentOption, BoxLayoutOptionMixin {
  8578. mainType?: 'parallel';
  8579. layout?: ParallelLayoutDirection;
  8580. axisExpandable?: boolean;
  8581. axisExpandCenter?: number;
  8582. axisExpandCount?: number;
  8583. axisExpandWidth?: number;
  8584. axisExpandTriggerOn?: 'click' | 'mousemove';
  8585. axisExpandRate?: number;
  8586. axisExpandDebounce?: number;
  8587. axisExpandSlideTriggerArea?: [number, number, number];
  8588. axisExpandWindow?: number[];
  8589. parallelAxisDefault?: ParallelAxisOption;
  8590. }
  8591. declare type ParallelAxisOption = AxisBaseOption & {
  8592. /**
  8593. * 0, 1, 2, ...
  8594. */
  8595. dim?: number | number[];
  8596. parallelIndex?: number;
  8597. areaSelectStyle?: {
  8598. width?: number;
  8599. borderWidth?: number;
  8600. borderColor?: ZRColor;
  8601. color?: ZRColor;
  8602. opacity?: number;
  8603. };
  8604. realtime?: boolean;
  8605. };
  8606. declare type Dependencies = {
  8607. grid: XAXisOption | YAXisOption | AxisPointerOption;
  8608. polar: AngleAxisOption | RadiusAxisOption;
  8609. parallel: ParallelAxisOption;
  8610. };
  8611. declare type DependenciesKeys = keyof Dependencies & string;
  8612. declare type Arrayable<T> = T | T[];
  8613. declare type GetMainType<OptionUnion extends ComponentOption> = Exclude<OptionUnion['mainType'], undefined>;
  8614. declare type ExtractComponentOption<OptionUnion, ExtractMainType> = OptionUnion extends {
  8615. mainType?: ExtractMainType;
  8616. } ? OptionUnion : never;
  8617. declare type GetDependency<DependencyOption extends ComponentOption> = {
  8618. [key in GetMainType<DependencyOption>]?: Arrayable<ExtractComponentOption<DependencyOption, key>>;
  8619. };
  8620. declare type GetDependencies<MainType extends string> = GetDependency<Dependencies[Extract<MainType, DependenciesKeys>]>;
  8621. declare type ComposeUnitOption<OptionUnion extends ComponentOption> = CheckMainType<GetMainType<OptionUnion>> & Omit<ECBasicOption, 'baseOption' | 'options'> & {
  8622. [key in GetMainType<OptionUnion>]?: Arrayable<ExtractComponentOption<OptionUnion, key>>;
  8623. } & GetDependencies<GetMainType<OptionUnion>>;
  8624. declare type CheckMainType<OptionUnionMainType extends string> = string extends OptionUnionMainType ? never : {};
  8625. declare type ComposeOption<OptionUnion extends ComponentOption> = ComposeUnitOption<OptionUnion> & {
  8626. baseOption?: ComposeUnitOption<OptionUnion>;
  8627. options?: ComposeUnitOption<OptionUnion>[];
  8628. };
  8629. declare function install$1(registers: EChartsExtensionInstallRegisters): void;
  8630. declare function install$2(registers: EChartsExtensionInstallRegisters): void;
  8631. declare function install$3(registers: EChartsExtensionInstallRegisters): void;
  8632. declare function install$4(registers: EChartsExtensionInstallRegisters): void;
  8633. declare function install$5(registers: EChartsExtensionInstallRegisters): void;
  8634. declare function install$6(registers: EChartsExtensionInstallRegisters): void;
  8635. declare function install$7(registers: EChartsExtensionInstallRegisters): void;
  8636. declare function install$8(registers: EChartsExtensionInstallRegisters): void;
  8637. declare function install$9(registers: EChartsExtensionInstallRegisters): void;
  8638. declare function install$a(registers: EChartsExtensionInstallRegisters): void;
  8639. declare function install$b(registers: EChartsExtensionInstallRegisters): void;
  8640. declare function install$c(registers: EChartsExtensionInstallRegisters): void;
  8641. declare function install$d(registers: EChartsExtensionInstallRegisters): void;
  8642. declare function install$e(registers: EChartsExtensionInstallRegisters): void;
  8643. declare function install$f(registers: EChartsExtensionInstallRegisters): void;
  8644. declare function install$g(registers: EChartsExtensionInstallRegisters): void;
  8645. declare function install$h(registers: EChartsExtensionInstallRegisters): void;
  8646. declare function install$i(registers: EChartsExtensionInstallRegisters): void;
  8647. declare function install$j(registers: EChartsExtensionInstallRegisters): void;
  8648. declare function install$k(registers: EChartsExtensionInstallRegisters): void;
  8649. declare function install$l(registers: EChartsExtensionInstallRegisters): void;
  8650. declare function install$m(registers: EChartsExtensionInstallRegisters): void;
  8651. interface RadarIndicatorOption {
  8652. name?: string;
  8653. /**
  8654. * @deprecated Use `name` instead.
  8655. */
  8656. text?: string;
  8657. min?: number;
  8658. max?: number;
  8659. color?: ColorString;
  8660. axisType?: 'value' | 'log';
  8661. }
  8662. interface RadarOption extends ComponentOption, CircleLayoutOptionMixin {
  8663. mainType?: 'radar';
  8664. startAngle?: number;
  8665. shape?: 'polygon' | 'circle';
  8666. axisLine?: AxisBaseOption['axisLine'];
  8667. axisTick?: AxisBaseOption['axisTick'];
  8668. axisLabel?: AxisBaseOption['axisLabel'];
  8669. splitLine?: AxisBaseOption['splitLine'];
  8670. splitArea?: AxisBaseOption['splitArea'];
  8671. axisName?: {
  8672. show?: boolean;
  8673. formatter?: string | ((name?: string, indicatorOpt?: InnerIndicatorAxisOption) => string);
  8674. } & LabelOption;
  8675. axisNameGap?: number;
  8676. triggerEvent?: boolean;
  8677. scale?: boolean;
  8678. splitNumber?: number;
  8679. boundaryGap?: CategoryAxisBaseOption['boundaryGap'] | ValueAxisBaseOption['boundaryGap'];
  8680. indicator?: RadarIndicatorOption[];
  8681. }
  8682. declare type InnerIndicatorAxisOption = AxisBaseOption & {
  8683. showName?: boolean;
  8684. };
  8685. declare type SingleAxisPosition = 'top' | 'bottom' | 'left' | 'right';
  8686. declare type SingleAxisOption = AxisBaseOption & BoxLayoutOptionMixin & {
  8687. mainType?: 'singleAxis';
  8688. position?: SingleAxisPosition;
  8689. orient?: LayoutOrient;
  8690. };
  8691. interface CalendarMonthLabelFormatterCallbackParams {
  8692. nameMap: string;
  8693. yyyy: string;
  8694. yy: string;
  8695. /**
  8696. * Month string. With 0 prefix.
  8697. */
  8698. MM: string;
  8699. /**
  8700. * Month number
  8701. */
  8702. M: number;
  8703. }
  8704. interface CalendarYearLabelFormatterCallbackParams {
  8705. nameMap: string;
  8706. /**
  8707. * Start year
  8708. */
  8709. start: string;
  8710. /**
  8711. * End year
  8712. */
  8713. end: string;
  8714. }
  8715. interface CalendarOption extends ComponentOption, BoxLayoutOptionMixin {
  8716. mainType?: 'calendar';
  8717. cellSize?: number | 'auto' | (number | 'auto')[];
  8718. orient?: LayoutOrient;
  8719. splitLine?: {
  8720. show?: boolean;
  8721. lineStyle?: LineStyleOption;
  8722. };
  8723. itemStyle?: ItemStyleOption;
  8724. /**
  8725. * // one year
  8726. * range: 2017
  8727. * // one month
  8728. * range: '2017-02'
  8729. * // a range
  8730. * range: ['2017-01-02', '2017-02-23']
  8731. * // note: they will be identified as ['2017-01-01', '2017-02-01']
  8732. * range: ['2017-01', '2017-02']
  8733. */
  8734. range?: OptionDataValueDate | (OptionDataValueDate)[];
  8735. dayLabel?: Omit<LabelOption, 'position'> & {
  8736. /**
  8737. * First day of week.
  8738. */
  8739. firstDay?: number;
  8740. /**
  8741. * Margin between day label and axis line.
  8742. * Can be percent string of cell size.
  8743. */
  8744. margin?: number | string;
  8745. /**
  8746. * Position of week, at the beginning or end of the range.
  8747. */
  8748. position?: 'start' | 'end';
  8749. /**
  8750. * Week text content
  8751. *
  8752. * defaults to auto-detected locale by the browser or the specified locale by `echarts.init` function.
  8753. * It supports any registered locale name (case-sensitive) or customized array.
  8754. * index 0 always means Sunday.
  8755. */
  8756. nameMap?: string | string[];
  8757. };
  8758. monthLabel?: Omit<LabelOption, 'position'> & {
  8759. /**
  8760. * Margin between month label and axis line.
  8761. */
  8762. margin?: number;
  8763. /**
  8764. * Position of month label, at the beginning or end of the range.
  8765. */
  8766. position?: 'start' | 'end';
  8767. /**
  8768. * Month text content
  8769. *
  8770. * defaults to auto-detected locale by the browser or the specified locale by `echarts.init` function.
  8771. * It supports any registered locale name (case-sensitive) or customized array.
  8772. * index 0 always means Jan.
  8773. */
  8774. nameMap?: string | string[];
  8775. formatter?: string | ((params: CalendarMonthLabelFormatterCallbackParams) => string);
  8776. };
  8777. yearLabel?: Omit<LabelOption, 'position'> & {
  8778. /**
  8779. * Margin between year label and axis line.
  8780. */
  8781. margin?: number;
  8782. /**
  8783. * Position of year label, at the beginning or end of the range.
  8784. */
  8785. position?: 'top' | 'bottom' | 'left' | 'right';
  8786. formatter?: string | ((params: CalendarYearLabelFormatterCallbackParams) => string);
  8787. };
  8788. }
  8789. declare type IconStyle = ItemStyleOption & {
  8790. textFill?: LabelOption['color'];
  8791. textBackgroundColor?: LabelOption['backgroundColor'];
  8792. textPosition?: LabelOption['position'];
  8793. textAlign?: LabelOption['align'];
  8794. textBorderRadius?: LabelOption['borderRadius'];
  8795. textPadding?: LabelOption['padding'];
  8796. };
  8797. interface ToolboxFeatureOption {
  8798. show?: boolean;
  8799. title?: string | Partial<Dictionary<string>>;
  8800. icon?: string | Partial<Dictionary<string>>;
  8801. iconStyle?: IconStyle;
  8802. emphasis?: {
  8803. iconStyle?: IconStyle;
  8804. };
  8805. iconStatus?: Partial<Dictionary<DisplayState>>;
  8806. onclick?: () => void;
  8807. }
  8808. interface ToolboxTooltipFormatterParams {
  8809. componentType: 'toolbox';
  8810. name: string;
  8811. title: string;
  8812. $vars: ['name', 'title'];
  8813. }
  8814. interface ToolboxOption extends ComponentOption, BoxLayoutOptionMixin, BorderOptionMixin {
  8815. mainType?: 'toolbox';
  8816. show?: boolean;
  8817. orient?: LayoutOrient;
  8818. backgroundColor?: ZRColor;
  8819. borderRadius?: number | number[];
  8820. padding?: number | number[];
  8821. itemSize?: number;
  8822. itemGap?: number;
  8823. showTitle?: boolean;
  8824. iconStyle?: ItemStyleOption;
  8825. emphasis?: {
  8826. iconStyle?: ItemStyleOption;
  8827. };
  8828. textStyle?: LabelOption;
  8829. tooltip?: CommonTooltipOption<ToolboxTooltipFormatterParams>;
  8830. /**
  8831. * Write all supported features in the final export option.
  8832. */
  8833. feature?: Partial<Dictionary<ToolboxFeatureOption>>;
  8834. }
  8835. interface TitleOption extends ComponentOption, BoxLayoutOptionMixin, BorderOptionMixin {
  8836. mainType?: 'title';
  8837. show?: boolean;
  8838. text?: string;
  8839. /**
  8840. * Link to url
  8841. */
  8842. link?: string;
  8843. target?: 'self' | 'blank';
  8844. subtext?: string;
  8845. sublink?: string;
  8846. subtarget?: 'self' | 'blank';
  8847. textAlign?: ZRTextAlign;
  8848. textVerticalAlign?: ZRTextVerticalAlign;
  8849. /**
  8850. * @deprecated Use textVerticalAlign instead
  8851. */
  8852. textBaseline?: ZRTextVerticalAlign;
  8853. backgroundColor?: ZRColor;
  8854. /**
  8855. * Padding between text and border.
  8856. * Support to be a single number or an array.
  8857. */
  8858. padding?: number | number[];
  8859. /**
  8860. * Gap between text and subtext
  8861. */
  8862. itemGap?: number;
  8863. textStyle?: LabelOption;
  8864. subtextStyle?: LabelOption;
  8865. /**
  8866. * If trigger mouse or touch event
  8867. */
  8868. triggerEvent?: boolean;
  8869. /**
  8870. * Radius of background border.
  8871. */
  8872. borderRadius?: number | number[];
  8873. }
  8874. declare function install$n(registers: EChartsExtensionInstallRegisters): void;
  8875. interface TimelineControlStyle extends ItemStyleOption {
  8876. show?: boolean;
  8877. showPlayBtn?: boolean;
  8878. showPrevBtn?: boolean;
  8879. showNextBtn?: boolean;
  8880. itemSize?: number;
  8881. itemGap?: number;
  8882. position?: 'left' | 'right' | 'top' | 'bottom';
  8883. playIcon?: string;
  8884. stopIcon?: string;
  8885. prevIcon?: string;
  8886. nextIcon?: string;
  8887. playBtnSize?: number | string;
  8888. stopBtnSize?: number | string;
  8889. nextBtnSize?: number | string;
  8890. prevBtnSize?: number | string;
  8891. }
  8892. interface TimelineCheckpointStyle extends ItemStyleOption, SymbolOptionMixin {
  8893. animation?: boolean;
  8894. animationDuration?: number;
  8895. animationEasing?: ZREasing;
  8896. }
  8897. interface TimelineLineStyleOption extends LineStyleOption {
  8898. show?: boolean;
  8899. }
  8900. interface TimelineLabelOption extends Omit<LabelOption, 'position'> {
  8901. show?: boolean;
  8902. position?: 'auto' | 'left' | 'right' | 'top' | 'bottom' | number;
  8903. interval?: 'auto' | number;
  8904. formatter?: string | ((value: string | number, index: number) => string);
  8905. }
  8906. interface TimelineDataItemOption extends SymbolOptionMixin {
  8907. value?: OptionDataValue;
  8908. itemStyle?: ItemStyleOption;
  8909. label?: TimelineLabelOption;
  8910. checkpointStyle?: TimelineCheckpointStyle;
  8911. emphasis?: {
  8912. itemStyle?: ItemStyleOption;
  8913. label?: TimelineLabelOption;
  8914. checkpointStyle?: TimelineCheckpointStyle;
  8915. };
  8916. progress?: {
  8917. lineStyle?: TimelineLineStyleOption;
  8918. itemStyle?: ItemStyleOption;
  8919. label?: TimelineLabelOption;
  8920. };
  8921. tooltip?: boolean;
  8922. }
  8923. interface TimelineOption extends ComponentOption, BoxLayoutOptionMixin, SymbolOptionMixin {
  8924. mainType?: 'timeline';
  8925. backgroundColor?: ZRColor;
  8926. borderColor?: ColorString;
  8927. borderWidth?: number;
  8928. tooltip?: CommonTooltipOption<CallbackDataParams> & {
  8929. trigger?: 'item';
  8930. };
  8931. show?: boolean;
  8932. axisType?: 'category' | 'time' | 'value';
  8933. currentIndex?: number;
  8934. autoPlay?: boolean;
  8935. rewind?: boolean;
  8936. loop?: boolean;
  8937. playInterval?: number;
  8938. realtime?: boolean;
  8939. controlPosition?: 'left' | 'right' | 'top' | 'bottom';
  8940. padding?: number | number[];
  8941. orient?: LayoutOrient;
  8942. inverse?: boolean;
  8943. replaceMerge?: GlobalModelSetOptionOpts['replaceMerge'];
  8944. lineStyle?: TimelineLineStyleOption;
  8945. itemStyle?: ItemStyleOption;
  8946. checkpointStyle?: TimelineCheckpointStyle;
  8947. controlStyle?: TimelineControlStyle;
  8948. label?: TimelineLabelOption;
  8949. emphasis?: {
  8950. lineStyle?: TimelineLineStyleOption;
  8951. itemStyle?: ItemStyleOption;
  8952. checkpointStyle?: TimelineCheckpointStyle;
  8953. controlStyle?: TimelineControlStyle;
  8954. label?: TimelineLabelOption;
  8955. };
  8956. progress?: {
  8957. lineStyle?: TimelineLineStyleOption;
  8958. itemStyle?: ItemStyleOption;
  8959. label?: TimelineLabelOption;
  8960. };
  8961. data?: (OptionDataValue | TimelineDataItemOption)[];
  8962. }
  8963. interface SliderTimelineOption extends TimelineOption {
  8964. }
  8965. interface ScrollableLegendOption extends LegendOption {
  8966. scrollDataIndex?: number;
  8967. /**
  8968. * Gap between each page button
  8969. */
  8970. pageButtonItemGap?: number;
  8971. /**
  8972. * Gap between page buttons group and legend items.
  8973. */
  8974. pageButtonGap?: number;
  8975. pageButtonPosition?: 'start' | 'end';
  8976. pageFormatter?: string | ((param: {
  8977. current: number;
  8978. total: number;
  8979. }) => string);
  8980. pageIcons?: {
  8981. horizontal?: string[];
  8982. vertical?: string[];
  8983. };
  8984. pageIconColor?: ZRColor;
  8985. pageIconInactiveColor?: ZRColor;
  8986. pageIconSize?: number;
  8987. pageTextStyle?: LabelOption;
  8988. animationDurationUpdate?: number;
  8989. }
  8990. interface DataZoomOption extends ComponentOption {
  8991. mainType?: 'dataZoom';
  8992. /**
  8993. * Default auto by axisIndex
  8994. */
  8995. orient?: LayoutOrient;
  8996. /**
  8997. * Default the first horizontal category axis.
  8998. */
  8999. xAxisIndex?: number | number[];
  9000. xAxisId?: string | string[];
  9001. /**
  9002. * Default the first vertical category axis.
  9003. */
  9004. yAxisIndex?: number | number[];
  9005. yAxisId?: string | string[];
  9006. radiusAxisIndex?: number | number[];
  9007. radiusAxisId?: string | string[];
  9008. angleAxisIndex?: number | number[];
  9009. angleAxisId?: string | string[];
  9010. singleAxisIndex?: number | number[];
  9011. singleAxisId?: string | string[];
  9012. /**
  9013. * Possible values: 'filter' or 'empty' or 'weakFilter'.
  9014. * 'filter': data items which are out of window will be removed. This option is
  9015. * applicable when filtering outliers. For each data item, it will be
  9016. * filtered if one of the relevant dimensions is out of the window.
  9017. * 'weakFilter': data items which are out of window will be removed. This option
  9018. * is applicable when filtering outliers. For each data item, it will be
  9019. * filtered only if all of the relevant dimensions are out of the same
  9020. * side of the window.
  9021. * 'empty': data items which are out of window will be set to empty.
  9022. * This option is applicable when user should not neglect
  9023. * that there are some data items out of window.
  9024. * 'none': Do not filter.
  9025. * Taking line chart as an example, line will be broken in
  9026. * the filtered points when filterModel is set to 'empty', but
  9027. * be connected when set to 'filter'.
  9028. */
  9029. filterMode?: 'filter' | 'weakFilter' | 'empty' | 'none';
  9030. /**
  9031. * Dispatch action by the fixed rate, avoid frequency.
  9032. * default 100. Do not throttle when use null/undefined.
  9033. * If animation === true and animationDurationUpdate > 0,
  9034. * default value is 100, otherwise 20.
  9035. */
  9036. throttle?: number | null | undefined;
  9037. /**
  9038. * Start percent. 0 ~ 100
  9039. */
  9040. start?: number;
  9041. /**
  9042. * End percent. 0 ~ 100
  9043. */
  9044. end?: number;
  9045. /**
  9046. * Start value. If startValue specified, start is ignored
  9047. */
  9048. startValue?: number | string | Date;
  9049. /**
  9050. * End value. If endValue specified, end is ignored.
  9051. */
  9052. endValue?: number | string | Date;
  9053. /**
  9054. * Min span percent, 0 - 100
  9055. * The range of dataZoom can not be smaller than that.
  9056. */
  9057. minSpan?: number;
  9058. /**
  9059. * Max span percent, 0 - 100
  9060. * The range of dataZoom can not be larger than that.
  9061. */
  9062. maxSpan?: number;
  9063. minValueSpan?: number;
  9064. maxValueSpan?: number;
  9065. rangeMode?: ['value' | 'percent', 'value' | 'percent'];
  9066. realtime?: boolean;
  9067. textStyle?: LabelOption;
  9068. }
  9069. interface SliderDataZoomOption extends DataZoomOption, BoxLayoutOptionMixin {
  9070. show?: boolean;
  9071. /**
  9072. * Slider dataZoom don't support textStyle
  9073. */
  9074. /**
  9075. * Background of slider zoom component
  9076. */
  9077. backgroundColor?: ZRColor;
  9078. /**
  9079. * @deprecated Use borderColor instead
  9080. */
  9081. /**
  9082. * border color of the box. For compatibility,
  9083. * if dataBackgroundColor is set, borderColor
  9084. * is ignored.
  9085. */
  9086. borderColor?: ZRColor;
  9087. /**
  9088. * Border radius of the box.
  9089. */
  9090. borderRadius?: number | number[];
  9091. dataBackground?: {
  9092. lineStyle?: LineStyleOption;
  9093. areaStyle?: AreaStyleOption;
  9094. };
  9095. selectedDataBackground?: {
  9096. lineStyle?: LineStyleOption;
  9097. areaStyle?: AreaStyleOption;
  9098. };
  9099. /**
  9100. * Color of selected area.
  9101. */
  9102. fillerColor?: ZRColor;
  9103. /**
  9104. * @deprecated Use handleStyle instead
  9105. */
  9106. handleIcon?: string;
  9107. /**
  9108. * number: height of icon. width will be calculated according to the aspect of icon.
  9109. * string: percent of the slider height. width will be calculated according to the aspect of icon.
  9110. */
  9111. handleSize?: string | number;
  9112. handleStyle?: ItemStyleOption;
  9113. /**
  9114. * Icon to indicate it is a draggable panel.
  9115. */
  9116. moveHandleIcon?: string;
  9117. moveHandleStyle?: ItemStyleOption;
  9118. /**
  9119. * Height of handle rect. Can be a percent string relative to the slider height.
  9120. */
  9121. moveHandleSize?: number;
  9122. labelPrecision?: number | 'auto';
  9123. labelFormatter?: string | ((value: number, valueStr: string) => string);
  9124. showDetail?: boolean;
  9125. showDataShadow?: 'auto' | boolean;
  9126. zoomLock?: boolean;
  9127. textStyle?: LabelOption;
  9128. /**
  9129. * If eable select by brushing
  9130. */
  9131. brushSelect?: boolean;
  9132. brushStyle?: ItemStyleOption;
  9133. emphasis?: {
  9134. handleStyle?: ItemStyleOption;
  9135. moveHandleStyle?: ItemStyleOption;
  9136. };
  9137. }
  9138. interface InsideDataZoomOption extends DataZoomOption {
  9139. /**
  9140. * Whether disable this inside zoom.
  9141. */
  9142. disabled?: boolean;
  9143. /**
  9144. * Whether disable zoom but only pan.
  9145. */
  9146. zoomLock?: boolean;
  9147. zoomOnMouseWheel?: boolean | 'shift' | 'ctrl' | 'alt';
  9148. moveOnMouseMove?: boolean | 'shift' | 'ctrl' | 'alt';
  9149. moveOnMouseWheel?: boolean | 'shift' | 'ctrl' | 'alt';
  9150. preventDefaultMouseMove?: boolean;
  9151. /**
  9152. * Inside dataZoom don't support textStyle
  9153. */
  9154. textStyle?: never;
  9155. }
  9156. interface ContinousVisualMapOption extends VisualMapOption {
  9157. align?: 'auto' | 'left' | 'right' | 'top' | 'bottom';
  9158. /**
  9159. * This prop effect default component type determine
  9160. * @see echarts/component/visualMap/typeDefaulter.
  9161. */
  9162. calculable?: boolean;
  9163. /**
  9164. * selected range. In default case `range` is [min, max]
  9165. * and can auto change along with modification of min max,
  9166. * util user specifid a range.
  9167. */
  9168. range?: number[];
  9169. /**
  9170. * Whether to enable hover highlight.
  9171. */
  9172. hoverLink?: boolean;
  9173. /**
  9174. * The extent of hovered data.
  9175. */
  9176. hoverLinkDataSize?: number;
  9177. /**
  9178. * Whether trigger hoverLink when hover handle.
  9179. * If not specified, follow the value of `realtime`.
  9180. */
  9181. hoverLinkOnHandle?: boolean;
  9182. handleIcon?: string;
  9183. handleSize?: string | number;
  9184. handleStyle?: ItemStyleOption;
  9185. indicatorIcon?: string;
  9186. indicatorSize?: string | number;
  9187. indicatorStyle?: ItemStyleOption;
  9188. emphasis?: {
  9189. handleStyle?: ItemStyleOption;
  9190. };
  9191. }
  9192. interface VisualPiece extends VisualOptionPiecewise {
  9193. min?: number;
  9194. max?: number;
  9195. lt?: number;
  9196. gt?: number;
  9197. lte?: number;
  9198. gte?: number;
  9199. value?: number;
  9200. label?: string;
  9201. }
  9202. /**
  9203. * Order Rule:
  9204. *
  9205. * option.categories / option.pieces / option.text / option.selected:
  9206. * If !option.inverse,
  9207. * Order when vertical: ['top', ..., 'bottom'].
  9208. * Order when horizontal: ['left', ..., 'right'].
  9209. * If option.inverse, the meaning of
  9210. * the order should be reversed.
  9211. *
  9212. * this._pieceList:
  9213. * The order is always [low, ..., high].
  9214. *
  9215. * Mapping from location to low-high:
  9216. * If !option.inverse
  9217. * When vertical, top is high.
  9218. * When horizontal, right is high.
  9219. * If option.inverse, reverse.
  9220. */
  9221. interface PiecewiseVisualMapOption extends VisualMapOption {
  9222. align?: 'auto' | 'left' | 'right';
  9223. minOpen?: boolean;
  9224. maxOpen?: boolean;
  9225. /**
  9226. * When put the controller vertically, it is the length of
  9227. * horizontal side of each item. Otherwise, vertical side.
  9228. * When put the controller vertically, it is the length of
  9229. * vertical side of each item. Otherwise, horizontal side.
  9230. */
  9231. itemWidth?: number;
  9232. itemHeight?: number;
  9233. itemSymbol?: string;
  9234. pieces?: VisualPiece[];
  9235. /**
  9236. * category names, like: ['some1', 'some2', 'some3'].
  9237. * Attr min/max are ignored when categories set. See "Order Rule"
  9238. */
  9239. categories?: string[];
  9240. /**
  9241. * If set to 5, auto split five pieces equally.
  9242. * If set to 0 and component type not set, component type will be
  9243. * determined as "continuous". (It is less reasonable but for ec2
  9244. * compatibility, see echarts/component/visualMap/typeDefaulter)
  9245. */
  9246. splitNumber?: number;
  9247. /**
  9248. * Object. If not specified, means selected. When pieces and splitNumber: {'0': true, '5': true}
  9249. * When categories: {'cate1': false, 'cate3': true} When selected === false, means all unselected.
  9250. */
  9251. selected?: Dictionary<boolean>;
  9252. selectedMode?: 'multiple' | 'single' | boolean;
  9253. /**
  9254. * By default, when text is used, label will hide (the logic
  9255. * is remained for compatibility reason)
  9256. */
  9257. showLabel?: boolean;
  9258. itemGap?: number;
  9259. hoverLink?: boolean;
  9260. }
  9261. declare type MarkerStatisticType = 'average' | 'min' | 'max' | 'median';
  9262. /**
  9263. * Option to specify where to put the marker.
  9264. */
  9265. interface MarkerPositionOption {
  9266. x?: number | string;
  9267. y?: number | string;
  9268. /**
  9269. * Coord on any coordinate system
  9270. */
  9271. coord?: (ScaleDataValue | MarkerStatisticType)[];
  9272. xAxis?: ScaleDataValue;
  9273. yAxis?: ScaleDataValue;
  9274. radiusAxis?: ScaleDataValue;
  9275. angleAxis?: ScaleDataValue;
  9276. type?: MarkerStatisticType;
  9277. /**
  9278. * When using statistic method with type.
  9279. * valueIndex and valueDim can be specify which dim the statistic is used on.
  9280. */
  9281. valueIndex?: number;
  9282. valueDim?: string;
  9283. /**
  9284. * Value to be displayed as label. Totally optional
  9285. */
  9286. value?: string | number;
  9287. }
  9288. interface MarkerOption extends ComponentOption, AnimationOptionMixin {
  9289. silent?: boolean;
  9290. data?: unknown[];
  9291. tooltip?: CommonTooltipOption<unknown> & {
  9292. trigger?: 'item' | 'axis' | boolean | 'none';
  9293. };
  9294. }
  9295. interface MarkLineStateOption {
  9296. lineStyle?: LineStyleOption;
  9297. /**
  9298. * itemStyle for symbol
  9299. */
  9300. itemStyle?: ItemStyleOption;
  9301. label?: SeriesLineLabelOption;
  9302. }
  9303. interface MarkLineDataItemOptionBase extends MarkLineStateOption, StatesOptionMixin<MarkLineStateOption, StatesMixinBase> {
  9304. name?: string;
  9305. }
  9306. interface MarkLine1DDataItemOption extends MarkLineDataItemOptionBase {
  9307. xAxis?: number | string;
  9308. yAxis?: number | string;
  9309. type?: MarkerStatisticType;
  9310. /**
  9311. * When using statistic method with type.
  9312. * valueIndex and valueDim can be specify which dim the statistic is used on.
  9313. */
  9314. valueIndex?: number;
  9315. valueDim?: string;
  9316. /**
  9317. * Symbol for both two ends
  9318. */
  9319. symbol?: string[] | string;
  9320. symbolSize?: number[] | number;
  9321. symbolRotate?: number[] | number;
  9322. symbolOffset?: number | string | (number | string)[];
  9323. }
  9324. interface MarkLine2DDataItemDimOption extends MarkLineDataItemOptionBase, SymbolOptionMixin, MarkerPositionOption {
  9325. }
  9326. declare type MarkLine2DDataItemOption = [
  9327. MarkLine2DDataItemDimOption,
  9328. MarkLine2DDataItemDimOption
  9329. ];
  9330. interface MarkLineOption extends MarkerOption, MarkLineStateOption, StatesOptionMixin<MarkLineStateOption, StatesMixinBase> {
  9331. mainType?: 'markLine';
  9332. symbol?: string[] | string;
  9333. symbolSize?: number[] | number;
  9334. symbolRotate?: number[] | number;
  9335. symbolOffset?: number | string | (number | string)[];
  9336. /**
  9337. * Precision used on statistic method
  9338. */
  9339. precision?: number;
  9340. data?: (MarkLine1DDataItemOption | MarkLine2DDataItemOption)[];
  9341. }
  9342. interface MarkPointStateOption {
  9343. itemStyle?: ItemStyleOption;
  9344. label?: SeriesLabelOption;
  9345. }
  9346. interface MarkPointDataItemOption extends MarkPointStateOption, StatesOptionMixin<MarkPointStateOption, StatesMixinBase>, SymbolOptionMixin<CallbackDataParams>, MarkerPositionOption {
  9347. name: string;
  9348. }
  9349. interface MarkPointOption extends MarkerOption, SymbolOptionMixin<CallbackDataParams>, StatesOptionMixin<MarkPointStateOption, StatesMixinBase>, MarkPointStateOption {
  9350. mainType?: 'markPoint';
  9351. precision?: number;
  9352. data?: MarkPointDataItemOption[];
  9353. }
  9354. interface MarkAreaStateOption {
  9355. itemStyle?: ItemStyleOption;
  9356. label?: SeriesLabelOption;
  9357. }
  9358. interface MarkAreaDataItemOptionBase extends MarkAreaStateOption, StatesOptionMixin<MarkAreaStateOption, StatesMixinBase> {
  9359. name?: string;
  9360. }
  9361. interface MarkArea1DDataItemOption extends MarkAreaDataItemOptionBase {
  9362. xAxis?: number;
  9363. yAxis?: number;
  9364. type?: MarkerStatisticType;
  9365. valueIndex?: number;
  9366. valueDim?: string;
  9367. }
  9368. interface MarkArea2DDataItemDimOption extends MarkAreaDataItemOptionBase, MarkerPositionOption {
  9369. }
  9370. declare type MarkArea2DDataItemOption = [
  9371. MarkArea2DDataItemDimOption,
  9372. MarkArea2DDataItemDimOption
  9373. ];
  9374. interface MarkAreaOption extends MarkerOption, MarkAreaStateOption, StatesOptionMixin<MarkAreaStateOption, StatesMixinBase> {
  9375. mainType?: 'markArea';
  9376. precision?: number;
  9377. data?: (MarkArea1DDataItemOption | MarkArea2DDataItemOption)[];
  9378. }
  9379. declare type LineDataValue = OptionDataValue | OptionDataValue[];
  9380. interface LineStateOptionMixin {
  9381. emphasis?: {
  9382. focus?: DefaultEmphasisFocus;
  9383. scale?: boolean | number;
  9384. };
  9385. }
  9386. interface LineStateOption<TCbParams = never> {
  9387. itemStyle?: ItemStyleOption<TCbParams>;
  9388. label?: SeriesLabelOption;
  9389. endLabel?: LineEndLabelOption;
  9390. }
  9391. interface LineDataItemOption extends SymbolOptionMixin, LineStateOption, StatesOptionMixin<LineStateOption, LineStateOptionMixin> {
  9392. name?: string;
  9393. value?: LineDataValue;
  9394. }
  9395. interface LineEndLabelOption extends SeriesLabelOption {
  9396. valueAnimation?: boolean;
  9397. }
  9398. interface LineSeriesOption extends SeriesOption<LineStateOption<CallbackDataParams>, LineStateOptionMixin & {
  9399. emphasis?: {
  9400. lineStyle?: Omit<LineStyleOption, 'width'> & {
  9401. width?: LineStyleOption['width'] | 'bolder';
  9402. };
  9403. areaStyle?: AreaStyleOption;
  9404. };
  9405. blur?: {
  9406. lineStyle?: LineStyleOption;
  9407. areaStyle?: AreaStyleOption;
  9408. };
  9409. }>, LineStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesStackOptionMixin, SeriesSamplingOptionMixin, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
  9410. type?: 'line';
  9411. coordinateSystem?: 'cartesian2d' | 'polar';
  9412. clip?: boolean;
  9413. label?: SeriesLabelOption;
  9414. endLabel?: LineEndLabelOption;
  9415. lineStyle?: LineStyleOption;
  9416. areaStyle?: AreaStyleOption & {
  9417. origin?: 'auto' | 'start' | 'end' | number;
  9418. };
  9419. step?: false | 'start' | 'end' | 'middle';
  9420. smooth?: boolean | number;
  9421. smoothMonotone?: 'x' | 'y' | 'none';
  9422. connectNulls?: boolean;
  9423. showSymbol?: boolean;
  9424. showAllSymbol?: 'auto' | boolean;
  9425. data?: (LineDataValue | LineDataItemOption)[];
  9426. triggerLineEvent?: boolean;
  9427. }
  9428. interface ScatterStateOption<TCbParams = never> {
  9429. itemStyle?: ItemStyleOption<TCbParams>;
  9430. label?: SeriesLabelOption;
  9431. }
  9432. interface ScatterStatesOptionMixin {
  9433. emphasis?: {
  9434. focus?: DefaultEmphasisFocus;
  9435. scale?: boolean | number;
  9436. };
  9437. }
  9438. interface ScatterDataItemOption extends SymbolOptionMixin, ScatterStateOption, StatesOptionMixin<ScatterStateOption, ScatterStatesOptionMixin>, OptionDataItemObject<OptionDataValue> {
  9439. }
  9440. interface ScatterSeriesOption extends SeriesOption<ScatterStateOption<CallbackDataParams>, ScatterStatesOptionMixin>, ScatterStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesOnGeoOptionMixin, SeriesOnSingleOptionMixin, SeriesLargeOptionMixin, SeriesStackOptionMixin, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
  9441. type?: 'scatter';
  9442. coordinateSystem?: string;
  9443. cursor?: string;
  9444. clip?: boolean;
  9445. data?: (ScatterDataItemOption | OptionDataValue | OptionDataValue[])[] | ArrayLike<number>;
  9446. }
  9447. interface PieItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
  9448. borderRadius?: (number | string)[] | number | string;
  9449. }
  9450. interface PieCallbackDataParams extends CallbackDataParams {
  9451. percent: number;
  9452. }
  9453. interface PieStateOption<TCbParams = never> {
  9454. itemStyle?: PieItemStyleOption<TCbParams>;
  9455. label?: PieLabelOption;
  9456. labelLine?: PieLabelLineOption;
  9457. }
  9458. interface PieLabelOption extends Omit<SeriesLabelOption, 'rotate' | 'position'> {
  9459. rotate?: number | boolean | 'radial' | 'tangential';
  9460. alignTo?: 'none' | 'labelLine' | 'edge';
  9461. edgeDistance?: string | number;
  9462. /**
  9463. * @deprecated Use `edgeDistance` instead
  9464. */
  9465. margin?: string | number;
  9466. bleedMargin?: number;
  9467. distanceToLabelLine?: number;
  9468. position?: SeriesLabelOption['position'] | 'outer' | 'inner' | 'center' | 'outside';
  9469. }
  9470. interface PieLabelLineOption extends LabelLineOption {
  9471. /**
  9472. * Max angle between labelLine and surface normal.
  9473. * 0 - 180
  9474. */
  9475. maxSurfaceAngle?: number;
  9476. }
  9477. interface ExtraStateOption {
  9478. emphasis?: {
  9479. focus?: DefaultEmphasisFocus;
  9480. scale?: boolean;
  9481. scaleSize?: number;
  9482. };
  9483. }
  9484. interface PieDataItemOption extends OptionDataItemObject<OptionDataValueNumeric>, PieStateOption, StatesOptionMixin<PieStateOption, ExtraStateOption> {
  9485. cursor?: string;
  9486. }
  9487. interface PieSeriesOption extends Omit<SeriesOption<PieStateOption<PieCallbackDataParams>, ExtraStateOption>, 'labelLine'>, PieStateOption<PieCallbackDataParams>, CircleLayoutOptionMixin, BoxLayoutOptionMixin, SeriesEncodeOptionMixin {
  9488. type?: 'pie';
  9489. roseType?: 'radius' | 'area';
  9490. clockwise?: boolean;
  9491. startAngle?: number;
  9492. minAngle?: number;
  9493. minShowLabelAngle?: number;
  9494. selectedOffset?: number;
  9495. avoidLabelOverlap?: boolean;
  9496. percentPrecision?: number;
  9497. stillShowZeroSum?: boolean;
  9498. animationType?: 'expansion' | 'scale';
  9499. animationTypeUpdate?: 'transition' | 'expansion';
  9500. showEmptyCircle?: boolean;
  9501. emptyCircleStyle?: PieItemStyleOption;
  9502. data?: (OptionDataValueNumeric | OptionDataValueNumeric[] | PieDataItemOption)[];
  9503. }
  9504. declare type RadarSeriesDataValue = OptionDataValue[];
  9505. interface RadarStatesMixin {
  9506. emphasis?: DefaultStatesMixinEmphasis;
  9507. }
  9508. interface RadarSeriesStateOption<TCbParams = never> {
  9509. lineStyle?: LineStyleOption;
  9510. areaStyle?: AreaStyleOption;
  9511. label?: SeriesLabelOption;
  9512. itemStyle?: ItemStyleOption<TCbParams>;
  9513. }
  9514. interface RadarSeriesDataItemOption extends SymbolOptionMixin, RadarSeriesStateOption<CallbackDataParams>, StatesOptionMixin<RadarSeriesStateOption<CallbackDataParams>, RadarStatesMixin>, OptionDataItemObject<RadarSeriesDataValue> {
  9515. }
  9516. interface RadarSeriesOption extends SeriesOption<RadarSeriesStateOption, RadarStatesMixin>, RadarSeriesStateOption, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
  9517. type?: 'radar';
  9518. coordinateSystem?: 'radar';
  9519. radarIndex?: number;
  9520. radarId?: string;
  9521. data?: (RadarSeriesDataItemOption | RadarSeriesDataValue)[];
  9522. }
  9523. interface CurveLineStyleOption extends LineStyleOption {
  9524. curveness?: number;
  9525. }
  9526. interface TreeSeriesStateOption<TCbParams = never> {
  9527. itemStyle?: ItemStyleOption<TCbParams>;
  9528. /**
  9529. * Line style of the edge between node and it's parent.
  9530. */
  9531. lineStyle?: CurveLineStyleOption;
  9532. label?: SeriesLabelOption;
  9533. }
  9534. interface TreeStatesMixin {
  9535. emphasis?: {
  9536. focus?: DefaultEmphasisFocus | 'ancestor' | 'descendant' | 'relative';
  9537. scale?: boolean;
  9538. };
  9539. }
  9540. interface TreeSeriesNodeItemOption extends SymbolOptionMixin<CallbackDataParams>, TreeSeriesStateOption<CallbackDataParams>, StatesOptionMixin<TreeSeriesStateOption<CallbackDataParams>, TreeStatesMixin>, OptionDataItemObject<OptionDataValue> {
  9541. children?: TreeSeriesNodeItemOption[];
  9542. collapsed?: boolean;
  9543. link?: string;
  9544. target?: string;
  9545. }
  9546. /**
  9547. * Configuration of leaves nodes.
  9548. */
  9549. interface TreeSeriesLeavesOption extends TreeSeriesStateOption, StatesOptionMixin<TreeSeriesStateOption, TreeStatesMixin> {
  9550. }
  9551. interface TreeSeriesOption extends SeriesOption<TreeSeriesStateOption, TreeStatesMixin>, TreeSeriesStateOption, SymbolOptionMixin, BoxLayoutOptionMixin, RoamOptionMixin {
  9552. type?: 'tree';
  9553. layout?: 'orthogonal' | 'radial';
  9554. edgeShape?: 'polyline' | 'curve';
  9555. /**
  9556. * Available when edgeShape is polyline
  9557. */
  9558. edgeForkPosition?: string | number;
  9559. nodeScaleRatio?: number;
  9560. /**
  9561. * The orient of orthoginal layout, can be setted to 'LR', 'TB', 'RL', 'BT'.
  9562. * and the backward compatibility configuration 'horizontal = LR', 'vertical = TB'.
  9563. */
  9564. orient?: 'LR' | 'TB' | 'RL' | 'BT' | 'horizontal' | 'vertical';
  9565. expandAndCollapse?: boolean;
  9566. /**
  9567. * The initial expanded depth of tree
  9568. */
  9569. initialTreeDepth?: number;
  9570. leaves?: TreeSeriesLeavesOption;
  9571. data?: TreeSeriesNodeItemOption[];
  9572. }
  9573. declare type TreemapSeriesDataValue = number | number[];
  9574. interface BreadcrumbItemStyleOption extends ItemStyleOption {
  9575. textStyle?: LabelOption;
  9576. }
  9577. interface TreemapSeriesLabelOption extends SeriesLabelOption {
  9578. formatter?: string | ((params: CallbackDataParams) => string);
  9579. }
  9580. interface TreemapSeriesItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
  9581. borderRadius?: number | number[];
  9582. colorAlpha?: number;
  9583. colorSaturation?: number;
  9584. borderColorSaturation?: number;
  9585. gapWidth?: number;
  9586. }
  9587. interface TreePathInfo {
  9588. name: string;
  9589. dataIndex: number;
  9590. value: TreemapSeriesDataValue;
  9591. }
  9592. interface TreemapSeriesCallbackDataParams extends CallbackDataParams {
  9593. /**
  9594. * @deprecated
  9595. */
  9596. treePathInfo?: TreePathInfo[];
  9597. treeAncestors?: TreePathInfo[];
  9598. }
  9599. interface ExtraStateOption$1 {
  9600. emphasis?: {
  9601. focus?: DefaultEmphasisFocus | 'descendant' | 'ancestor';
  9602. };
  9603. }
  9604. interface TreemapStateOption<TCbParams = never> {
  9605. itemStyle?: TreemapSeriesItemStyleOption<TCbParams>;
  9606. label?: TreemapSeriesLabelOption;
  9607. upperLabel?: TreemapSeriesLabelOption;
  9608. }
  9609. interface TreemapSeriesVisualOption {
  9610. /**
  9611. * Which dimension will be applied with the visual properties.
  9612. */
  9613. visualDimension?: number | string;
  9614. /**
  9615. * @deprecated Use colorBy instead
  9616. */
  9617. colorMappingBy?: 'value' | 'index' | 'id';
  9618. visualMin?: number;
  9619. visualMax?: number;
  9620. colorAlpha?: number[] | 'none';
  9621. colorSaturation?: number[] | 'none';
  9622. /**
  9623. * A node will not be shown when its area size is smaller than this value (unit: px square).
  9624. */
  9625. visibleMin?: number;
  9626. /**
  9627. * Children will not be shown when area size of a node is smaller than this value (unit: px square).
  9628. */
  9629. childrenVisibleMin?: number;
  9630. }
  9631. interface TreemapSeriesLevelOption extends TreemapSeriesVisualOption, TreemapStateOption, StatesOptionMixin<TreemapStateOption, ExtraStateOption$1> {
  9632. color?: ColorString[] | 'none';
  9633. decal?: DecalObject[] | 'none';
  9634. }
  9635. interface TreemapSeriesNodeItemOption extends TreemapSeriesVisualOption, TreemapStateOption, StatesOptionMixin<TreemapStateOption, ExtraStateOption$1> {
  9636. id?: OptionId;
  9637. name?: OptionName;
  9638. value?: TreemapSeriesDataValue;
  9639. children?: TreemapSeriesNodeItemOption[];
  9640. color?: ColorString[] | 'none';
  9641. decal?: DecalObject[] | 'none';
  9642. }
  9643. interface TreemapSeriesOption extends SeriesOption<TreemapStateOption<TreemapSeriesCallbackDataParams>, ExtraStateOption$1>, TreemapStateOption<TreemapSeriesCallbackDataParams>, BoxLayoutOptionMixin, RoamOptionMixin, TreemapSeriesVisualOption {
  9644. type?: 'treemap';
  9645. /**
  9646. * configuration in echarts2
  9647. * @deprecated
  9648. */
  9649. size?: (number | string)[];
  9650. /**
  9651. * If sort in desc order.
  9652. * Default to be desc. asc has strange effect
  9653. */
  9654. sort?: boolean | 'asc' | 'desc';
  9655. /**
  9656. * Size of clipped window when zooming. 'origin' or 'fullscreen'
  9657. */
  9658. clipWindow?: 'origin' | 'fullscreen';
  9659. squareRatio?: number;
  9660. /**
  9661. * Nodes on depth from root are regarded as leaves.
  9662. * Count from zero (zero represents only view root).
  9663. */
  9664. leafDepth?: number;
  9665. drillDownIcon?: string;
  9666. /**
  9667. * Be effective when using zoomToNode. Specify the proportion of the
  9668. * target node area in the view area.
  9669. */
  9670. zoomToNodeRatio?: number;
  9671. /**
  9672. * Leaf node click behaviour: 'zoomToNode', 'link', false.
  9673. * If leafDepth is set and clicking a node which has children but
  9674. * be on left depth, the behaviour would be changing root. Otherwise
  9675. * use behavious defined above.
  9676. */
  9677. nodeClick?: 'zoomToNode' | 'link' | false;
  9678. breadcrumb?: BoxLayoutOptionMixin & {
  9679. show?: boolean;
  9680. height?: number;
  9681. emptyItemWidth?: number;
  9682. itemStyle?: BreadcrumbItemStyleOption;
  9683. emphasis?: {
  9684. disabled?: boolean;
  9685. focus?: DefaultEmphasisFocus;
  9686. blurScope?: BlurScope;
  9687. itemStyle?: BreadcrumbItemStyleOption;
  9688. };
  9689. };
  9690. levels?: TreemapSeriesLevelOption[];
  9691. data?: TreemapSeriesNodeItemOption[];
  9692. }
  9693. declare type GraphDataValue = OptionDataValue | OptionDataValue[];
  9694. interface GraphEdgeLineStyleOption extends LineStyleOption {
  9695. curveness?: number;
  9696. }
  9697. interface GraphNodeStateOption<TCbParams = never> {
  9698. itemStyle?: ItemStyleOption<TCbParams>;
  9699. label?: SeriesLabelOption;
  9700. }
  9701. interface ExtraEmphasisState {
  9702. focus?: DefaultEmphasisFocus | 'adjacency';
  9703. }
  9704. interface GraphNodeStatesMixin {
  9705. emphasis?: ExtraEmphasisState;
  9706. }
  9707. interface GraphEdgeStatesMixin {
  9708. emphasis?: ExtraEmphasisState;
  9709. }
  9710. interface GraphNodeItemOption extends SymbolOptionMixin, GraphNodeStateOption, GraphNodeStateOption, StatesOptionMixin<GraphNodeStateOption, GraphNodeStatesMixin> {
  9711. id?: string;
  9712. name?: string;
  9713. value?: GraphDataValue;
  9714. /**
  9715. * Fixed x position
  9716. */
  9717. x?: number;
  9718. /**
  9719. * Fixed y position
  9720. */
  9721. y?: number;
  9722. /**
  9723. * If this node is fixed during force layout.
  9724. */
  9725. fixed?: boolean;
  9726. /**
  9727. * Index or name of category
  9728. */
  9729. category?: number | string;
  9730. draggable?: boolean;
  9731. cursor?: string;
  9732. }
  9733. interface GraphEdgeStateOption {
  9734. lineStyle?: GraphEdgeLineStyleOption;
  9735. label?: SeriesLineLabelOption;
  9736. }
  9737. interface GraphEdgeItemOption extends GraphEdgeStateOption, StatesOptionMixin<GraphEdgeStateOption, GraphEdgeStatesMixin>, GraphEdgeItemObject<OptionDataValueNumeric> {
  9738. value?: number;
  9739. /**
  9740. * Symbol of both line ends
  9741. */
  9742. symbol?: string | string[];
  9743. symbolSize?: number | number[];
  9744. ignoreForceLayout?: boolean;
  9745. }
  9746. interface GraphCategoryItemOption extends SymbolOptionMixin, GraphNodeStateOption, StatesOptionMixin<GraphNodeStateOption, GraphNodeStatesMixin> {
  9747. name?: string;
  9748. value?: OptionDataValue;
  9749. }
  9750. interface GraphSeriesOption extends SeriesOption<GraphNodeStateOption<CallbackDataParams>, GraphNodeStatesMixin>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesOnGeoOptionMixin, SeriesOnSingleOptionMixin, SymbolOptionMixin<CallbackDataParams>, RoamOptionMixin, BoxLayoutOptionMixin {
  9751. type?: 'graph';
  9752. coordinateSystem?: string;
  9753. legendHoverLink?: boolean;
  9754. layout?: 'none' | 'force' | 'circular';
  9755. data?: (GraphNodeItemOption | GraphDataValue)[];
  9756. nodes?: (GraphNodeItemOption | GraphDataValue)[];
  9757. edges?: GraphEdgeItemOption[];
  9758. links?: GraphEdgeItemOption[];
  9759. categories?: GraphCategoryItemOption[];
  9760. /**
  9761. * @deprecated
  9762. */
  9763. focusNodeAdjacency?: boolean;
  9764. /**
  9765. * Symbol size scale ratio in roam
  9766. */
  9767. nodeScaleRatio?: 0.6;
  9768. draggable?: boolean;
  9769. edgeSymbol?: string | string[];
  9770. edgeSymbolSize?: number | number[];
  9771. edgeLabel?: SeriesLineLabelOption;
  9772. label?: SeriesLabelOption;
  9773. itemStyle?: ItemStyleOption<CallbackDataParams>;
  9774. lineStyle?: GraphEdgeLineStyleOption;
  9775. emphasis?: {
  9776. focus?: Exclude<GraphNodeItemOption['emphasis'], undefined>['focus'];
  9777. scale?: boolean | number;
  9778. label?: SeriesLabelOption;
  9779. edgeLabel?: SeriesLabelOption;
  9780. itemStyle?: ItemStyleOption;
  9781. lineStyle?: LineStyleOption;
  9782. };
  9783. blur?: {
  9784. label?: SeriesLabelOption;
  9785. edgeLabel?: SeriesLabelOption;
  9786. itemStyle?: ItemStyleOption;
  9787. lineStyle?: LineStyleOption;
  9788. };
  9789. select?: {
  9790. label?: SeriesLabelOption;
  9791. edgeLabel?: SeriesLabelOption;
  9792. itemStyle?: ItemStyleOption;
  9793. lineStyle?: LineStyleOption;
  9794. };
  9795. circular?: {
  9796. rotateLabel?: boolean;
  9797. };
  9798. force?: {
  9799. initLayout?: 'circular' | 'none';
  9800. repulsion?: number | number[];
  9801. gravity?: number;
  9802. friction?: number;
  9803. edgeLength?: number | number[];
  9804. layoutAnimation?: boolean;
  9805. };
  9806. /**
  9807. * auto curveness for multiple edge, invalid when `lineStyle.curveness` is set
  9808. */
  9809. autoCurveness?: boolean | number | number[];
  9810. }
  9811. declare type GaugeColorStop = [number, ColorString];
  9812. interface LabelFormatter$1 {
  9813. (value: number): string;
  9814. }
  9815. interface PointerOption {
  9816. icon?: string;
  9817. show?: boolean;
  9818. /**
  9819. * If pointer shows above title and detail
  9820. */
  9821. showAbove?: boolean;
  9822. keepAspect?: boolean;
  9823. itemStyle?: ItemStyleOption;
  9824. /**
  9825. * Can be percent
  9826. */
  9827. offsetCenter?: (number | string)[];
  9828. length?: number | string;
  9829. width?: number;
  9830. }
  9831. interface AnchorOption {
  9832. show?: boolean;
  9833. showAbove?: boolean;
  9834. size?: number;
  9835. icon?: string;
  9836. offsetCenter?: (number | string)[];
  9837. keepAspect?: boolean;
  9838. itemStyle?: ItemStyleOption;
  9839. }
  9840. interface ProgressOption {
  9841. show?: boolean;
  9842. overlap?: boolean;
  9843. width?: number;
  9844. roundCap?: boolean;
  9845. clip?: boolean;
  9846. itemStyle?: ItemStyleOption;
  9847. }
  9848. interface TitleOption$1 extends LabelOption {
  9849. /**
  9850. * [x, y] offset
  9851. */
  9852. offsetCenter?: (number | string)[];
  9853. formatter?: LabelFormatter$1 | string;
  9854. /**
  9855. * If do value animtion.
  9856. */
  9857. valueAnimation?: boolean;
  9858. }
  9859. interface DetailOption extends LabelOption {
  9860. /**
  9861. * [x, y] offset
  9862. */
  9863. offsetCenter?: (number | string)[];
  9864. formatter?: LabelFormatter$1 | string;
  9865. /**
  9866. * If do value animtion.
  9867. */
  9868. valueAnimation?: boolean;
  9869. }
  9870. interface GaugeStatesMixin {
  9871. emphasis?: DefaultStatesMixinEmphasis;
  9872. }
  9873. interface GaugeStateOption<TCbParams = never> {
  9874. itemStyle?: ItemStyleOption<TCbParams>;
  9875. }
  9876. interface GaugeDataItemOption extends GaugeStateOption, StatesOptionMixin<GaugeStateOption<CallbackDataParams>, GaugeStatesMixin> {
  9877. name?: string;
  9878. value?: OptionDataValueNumeric;
  9879. pointer?: PointerOption;
  9880. progress?: ProgressOption;
  9881. title?: TitleOption$1;
  9882. detail?: DetailOption;
  9883. }
  9884. interface GaugeSeriesOption extends SeriesOption<GaugeStateOption, GaugeStatesMixin>, GaugeStateOption<CallbackDataParams>, CircleLayoutOptionMixin, SeriesEncodeOptionMixin {
  9885. type?: 'gauge';
  9886. radius?: number | string;
  9887. startAngle?: number;
  9888. endAngle?: number;
  9889. clockwise?: boolean;
  9890. min?: number;
  9891. max?: number;
  9892. splitNumber?: number;
  9893. itemStyle?: ItemStyleOption;
  9894. axisLine?: {
  9895. show?: boolean;
  9896. roundCap?: boolean;
  9897. lineStyle?: Omit<LineStyleOption, 'color'> & {
  9898. color?: GaugeColorStop[];
  9899. };
  9900. };
  9901. progress?: ProgressOption;
  9902. splitLine?: {
  9903. show?: boolean;
  9904. /**
  9905. * Can be percent
  9906. */
  9907. length?: number;
  9908. distance?: number;
  9909. lineStyle?: LineStyleOption;
  9910. };
  9911. axisTick?: {
  9912. show?: boolean;
  9913. splitNumber?: number;
  9914. /**
  9915. * Can be percent
  9916. */
  9917. length?: number | string;
  9918. distance?: number;
  9919. lineStyle?: LineStyleOption;
  9920. };
  9921. axisLabel?: Omit<LabelOption, 'rotate'> & {
  9922. formatter?: LabelFormatter$1 | string;
  9923. rotate?: 'tangential' | 'radial' | number;
  9924. };
  9925. pointer?: PointerOption;
  9926. anchor?: AnchorOption;
  9927. title?: TitleOption$1;
  9928. detail?: DetailOption;
  9929. data?: (OptionDataValueNumeric | GaugeDataItemOption)[];
  9930. }
  9931. declare type FunnelLabelOption = Omit<SeriesLabelOption, 'position'> & {
  9932. position?: LabelOption['position'] | 'outer' | 'inner' | 'center' | 'rightTop' | 'rightBottom' | 'leftTop' | 'leftBottom';
  9933. };
  9934. interface FunnelStatesMixin {
  9935. emphasis?: DefaultStatesMixinEmphasis;
  9936. }
  9937. interface FunnelCallbackDataParams extends CallbackDataParams {
  9938. percent: number;
  9939. }
  9940. interface FunnelStateOption<TCbParams = never> {
  9941. itemStyle?: ItemStyleOption<TCbParams>;
  9942. label?: FunnelLabelOption;
  9943. labelLine?: LabelLineOption;
  9944. }
  9945. interface FunnelDataItemOption extends FunnelStateOption, StatesOptionMixin<FunnelStateOption, FunnelStatesMixin>, OptionDataItemObject<OptionDataValueNumeric> {
  9946. itemStyle?: ItemStyleOption & {
  9947. width?: number | string;
  9948. height?: number | string;
  9949. };
  9950. }
  9951. interface FunnelSeriesOption extends SeriesOption<FunnelStateOption<FunnelCallbackDataParams>, FunnelStatesMixin>, FunnelStateOption<FunnelCallbackDataParams>, BoxLayoutOptionMixin, SeriesEncodeOptionMixin {
  9952. type?: 'funnel';
  9953. min?: number;
  9954. max?: number;
  9955. /**
  9956. * Absolute number or percent string
  9957. */
  9958. minSize?: number | string;
  9959. maxSize?: number | string;
  9960. sort?: 'ascending' | 'descending' | 'none';
  9961. orient?: LayoutOrient;
  9962. gap?: number;
  9963. funnelAlign?: HorizontalAlign | VerticalAlign;
  9964. data?: (OptionDataValueNumeric | OptionDataValueNumeric[] | FunnelDataItemOption)[];
  9965. }
  9966. declare type ParallelSeriesDataValue = OptionDataValue[];
  9967. interface ParallelStatesMixin {
  9968. emphasis?: DefaultStatesMixinEmphasis;
  9969. }
  9970. interface ParallelStateOption<TCbParams = never> {
  9971. lineStyle?: LineStyleOption<(TCbParams extends never ? never : (params: TCbParams) => ZRColor) | ZRColor>;
  9972. label?: SeriesLabelOption;
  9973. }
  9974. interface ParallelSeriesDataItemOption extends ParallelStateOption, StatesOptionMixin<ParallelStateOption, ParallelStatesMixin> {
  9975. value?: ParallelSeriesDataValue[];
  9976. }
  9977. interface ParallelSeriesOption extends SeriesOption<ParallelStateOption<CallbackDataParams>, ParallelStatesMixin>, ParallelStateOption<CallbackDataParams>, SeriesEncodeOptionMixin {
  9978. type?: 'parallel';
  9979. coordinateSystem?: string;
  9980. parallelIndex?: number;
  9981. parallelId?: string;
  9982. inactiveOpacity?: number;
  9983. activeOpacity?: number;
  9984. smooth?: boolean | number;
  9985. realtime?: boolean;
  9986. tooltip?: SeriesTooltipOption;
  9987. parallelAxisDefault?: ParallelAxisOption;
  9988. data?: (ParallelSeriesDataValue | ParallelSeriesDataItemOption)[];
  9989. }
  9990. declare type FocusNodeAdjacency = boolean | 'inEdges' | 'outEdges' | 'allEdges';
  9991. interface SankeyNodeStateOption<TCbParams = never> {
  9992. label?: SeriesLabelOption;
  9993. itemStyle?: ItemStyleOption<TCbParams>;
  9994. }
  9995. interface SankeyEdgeStateOption {
  9996. lineStyle?: SankeyEdgeStyleOption;
  9997. }
  9998. interface SankeyBothStateOption<TCbParams> extends SankeyNodeStateOption<TCbParams>, SankeyEdgeStateOption {
  9999. }
  10000. interface SankeyEdgeStyleOption extends LineStyleOption {
  10001. curveness?: number;
  10002. }
  10003. interface ExtraStateOption$2 {
  10004. emphasis?: {
  10005. focus?: DefaultEmphasisFocus | 'adjacency';
  10006. };
  10007. }
  10008. interface SankeyNodeItemOption extends SankeyNodeStateOption, StatesOptionMixin<SankeyNodeStateOption, ExtraStateOption$2>, OptionDataItemObject<OptionDataValue> {
  10009. id?: string;
  10010. localX?: number;
  10011. localY?: number;
  10012. depth?: number;
  10013. draggable?: boolean;
  10014. focusNodeAdjacency?: FocusNodeAdjacency;
  10015. }
  10016. interface SankeyEdgeItemOption extends SankeyEdgeStateOption, StatesOptionMixin<SankeyEdgeStateOption, ExtraStateOption$2>, GraphEdgeItemObject<OptionDataValueNumeric> {
  10017. focusNodeAdjacency?: FocusNodeAdjacency;
  10018. }
  10019. interface SankeyLevelOption extends SankeyNodeStateOption, SankeyEdgeStateOption {
  10020. depth: number;
  10021. }
  10022. interface SankeySeriesOption extends SeriesOption<SankeyBothStateOption<CallbackDataParams>, ExtraStateOption$2>, SankeyBothStateOption<CallbackDataParams>, BoxLayoutOptionMixin {
  10023. type?: 'sankey';
  10024. /**
  10025. * color will be linear mapped.
  10026. */
  10027. color?: ColorString[];
  10028. coordinateSystem?: 'view';
  10029. orient?: LayoutOrient;
  10030. /**
  10031. * The width of the node
  10032. */
  10033. nodeWidth?: number;
  10034. /**
  10035. * The vertical distance between two nodes
  10036. */
  10037. nodeGap?: number;
  10038. /**
  10039. * Control if the node can move or not
  10040. */
  10041. draggable?: boolean;
  10042. /**
  10043. * Will be allEdges if true.
  10044. * @deprecated
  10045. */
  10046. focusNodeAdjacency?: FocusNodeAdjacency;
  10047. /**
  10048. * The number of iterations to change the position of the node
  10049. */
  10050. layoutIterations?: number;
  10051. nodeAlign?: 'justify' | 'left' | 'right';
  10052. data?: SankeyNodeItemOption[];
  10053. nodes?: SankeyNodeItemOption[];
  10054. edges?: SankeyEdgeItemOption[];
  10055. links?: SankeyEdgeItemOption[];
  10056. levels?: SankeyLevelOption[];
  10057. }
  10058. declare type BoxplotDataValue = OptionDataValueNumeric[];
  10059. interface BoxplotStateOption<TCbParams = never> {
  10060. itemStyle?: ItemStyleOption<TCbParams>;
  10061. label?: SeriesLabelOption;
  10062. }
  10063. interface BoxplotDataItemOption extends BoxplotStateOption, StatesOptionMixin<BoxplotStateOption, ExtraStateOption$3> {
  10064. value: BoxplotDataValue;
  10065. }
  10066. interface ExtraStateOption$3 {
  10067. emphasis?: {
  10068. focus?: DefaultEmphasisFocus;
  10069. scale?: boolean;
  10070. };
  10071. }
  10072. interface BoxplotSeriesOption extends SeriesOption<BoxplotStateOption<CallbackDataParams>, ExtraStateOption$3>, BoxplotStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesEncodeOptionMixin {
  10073. type?: 'boxplot';
  10074. coordinateSystem?: 'cartesian2d';
  10075. layout?: LayoutOrient;
  10076. /**
  10077. * [min, max] can be percent of band width.
  10078. */
  10079. boxWidth?: (string | number)[];
  10080. data?: (BoxplotDataValue | BoxplotDataItemOption)[];
  10081. }
  10082. declare type CandlestickDataValue = OptionDataValue[];
  10083. interface CandlestickItemStyleOption extends ItemStyleOption {
  10084. color0?: ZRColor;
  10085. borderColor0?: ColorString;
  10086. }
  10087. interface CandlestickStateOption {
  10088. itemStyle?: CandlestickItemStyleOption;
  10089. label?: SeriesLabelOption;
  10090. }
  10091. interface CandlestickDataItemOption extends CandlestickStateOption, StatesOptionMixin<CandlestickStateOption, ExtraStateOption$4> {
  10092. value: CandlestickDataValue;
  10093. }
  10094. interface ExtraStateOption$4 {
  10095. emphasis?: {
  10096. focus?: DefaultEmphasisFocus;
  10097. scale?: boolean;
  10098. };
  10099. }
  10100. interface CandlestickSeriesOption extends SeriesOption<CandlestickStateOption, ExtraStateOption$4>, CandlestickStateOption, SeriesOnCartesianOptionMixin, SeriesLargeOptionMixin, SeriesEncodeOptionMixin {
  10101. type?: 'candlestick';
  10102. coordinateSystem?: 'cartesian2d';
  10103. layout?: LayoutOrient;
  10104. clip?: boolean;
  10105. barMaxWidth?: number | string;
  10106. barMinWidth?: number | string;
  10107. barWidth?: number | string;
  10108. data?: (CandlestickDataValue | CandlestickDataItemOption)[];
  10109. }
  10110. interface RippleEffectOption {
  10111. period?: number;
  10112. /**
  10113. * Scale of ripple
  10114. */
  10115. scale?: number;
  10116. brushType?: 'fill' | 'stroke';
  10117. color?: ZRColor;
  10118. /**
  10119. * ripple number
  10120. */
  10121. number?: number;
  10122. }
  10123. interface SymbolDrawStateOption {
  10124. itemStyle?: ItemStyleOption;
  10125. label?: LabelOption;
  10126. }
  10127. interface SymbolDrawItemModelOption extends SymbolOptionMixin<object>, StatesOptionMixin<SymbolDrawStateOption, {
  10128. emphasis?: {
  10129. focus?: DefaultEmphasisFocus;
  10130. scale?: boolean | number;
  10131. };
  10132. }>, SymbolDrawStateOption {
  10133. cursor?: string;
  10134. rippleEffect?: RippleEffectOption;
  10135. }
  10136. declare type ScatterDataValue = OptionDataValue | OptionDataValue[];
  10137. interface EffectScatterStatesOptionMixin {
  10138. emphasis?: {
  10139. focus?: DefaultEmphasisFocus;
  10140. scale?: boolean | number;
  10141. };
  10142. }
  10143. interface EffectScatterStateOption<TCbParams = never> {
  10144. itemStyle?: ItemStyleOption<TCbParams>;
  10145. label?: SeriesLabelOption;
  10146. }
  10147. interface EffectScatterDataItemOption extends SymbolOptionMixin, EffectScatterStateOption, StatesOptionMixin<EffectScatterStateOption, EffectScatterStatesOptionMixin> {
  10148. name?: string;
  10149. value?: ScatterDataValue;
  10150. rippleEffect?: SymbolDrawItemModelOption['rippleEffect'];
  10151. }
  10152. interface EffectScatterSeriesOption extends SeriesOption<EffectScatterStateOption<CallbackDataParams>, EffectScatterStatesOptionMixin>, EffectScatterStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesOnGeoOptionMixin, SeriesOnSingleOptionMixin, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
  10153. type?: 'effectScatter';
  10154. coordinateSystem?: string;
  10155. effectType?: 'ripple';
  10156. /**
  10157. * When to show the effect
  10158. */
  10159. showEffectOn?: 'render' | 'emphasis';
  10160. clip?: boolean;
  10161. /**
  10162. * Ripple effect config
  10163. */
  10164. rippleEffect?: SymbolDrawItemModelOption['rippleEffect'];
  10165. data?: (EffectScatterDataItemOption | ScatterDataValue)[];
  10166. }
  10167. interface LineDrawStateOption {
  10168. lineStyle?: LineStyleOption;
  10169. label?: LineLabelOption;
  10170. }
  10171. interface LineDrawModelOption extends LineDrawStateOption, StatesOptionMixin<LineDrawStateOption, {
  10172. emphasis?: {
  10173. focus?: DefaultEmphasisFocus;
  10174. };
  10175. }> {
  10176. effect?: {
  10177. show?: boolean;
  10178. period?: number;
  10179. delay?: number | ((idx: number) => number);
  10180. /**
  10181. * If move with constant speed px/sec
  10182. * period will be ignored if this property is > 0,
  10183. */
  10184. constantSpeed?: number;
  10185. symbol?: string;
  10186. symbolSize?: number | number[];
  10187. loop?: boolean;
  10188. roundTrip?: boolean;
  10189. /**
  10190. * Length of trail, 0 - 1
  10191. */
  10192. trailLength?: number;
  10193. /**
  10194. * Default to be same with lineStyle.color
  10195. */
  10196. color?: ColorString;
  10197. };
  10198. }
  10199. declare type LinesCoords = number[][];
  10200. declare type LinesValue = OptionDataValue | OptionDataValue[];
  10201. interface LinesLineStyleOption<TClr> extends LineStyleOption<TClr> {
  10202. curveness?: number;
  10203. }
  10204. interface LinesStatesMixin {
  10205. emphasis?: DefaultStatesMixinEmphasis;
  10206. }
  10207. interface LinesStateOption<TCbParams = never> {
  10208. lineStyle?: LinesLineStyleOption<(TCbParams extends never ? never : (params: TCbParams) => ZRColor) | ZRColor>;
  10209. label?: SeriesLineLabelOption;
  10210. }
  10211. interface LinesDataItemOption extends LinesStateOption<CallbackDataParams>, StatesOptionMixin<LinesStateOption<CallbackDataParams>, LinesStatesMixin> {
  10212. name?: string;
  10213. fromName?: string;
  10214. toName?: string;
  10215. symbol?: string[] | string;
  10216. symbolSize?: number[] | number;
  10217. coords?: LinesCoords;
  10218. value?: LinesValue;
  10219. effect?: LineDrawModelOption['effect'];
  10220. }
  10221. interface LinesSeriesOption extends SeriesOption<LinesStateOption, LinesStatesMixin>, LinesStateOption, SeriesOnCartesianOptionMixin, SeriesOnGeoOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesLargeOptionMixin {
  10222. type?: 'lines';
  10223. coordinateSystem?: string;
  10224. symbol?: string[] | string;
  10225. symbolSize?: number[] | number;
  10226. effect?: LineDrawModelOption['effect'];
  10227. /**
  10228. * If lines are polyline
  10229. * polyline not support curveness, label, animation
  10230. */
  10231. polyline?: boolean;
  10232. /**
  10233. * If clip the overflow.
  10234. * Available when coordinateSystem is cartesian or polar.
  10235. */
  10236. clip?: boolean;
  10237. data?: LinesDataItemOption[] | ArrayLike<number>;
  10238. dimensions?: DimensionDefinitionLoose | DimensionDefinitionLoose[];
  10239. }
  10240. declare type HeatmapDataValue = OptionDataValue[];
  10241. interface HeatmapStateOption<TCbParams = never> {
  10242. itemStyle?: ItemStyleOption<TCbParams> & {
  10243. borderRadius?: number | number[];
  10244. };
  10245. label?: SeriesLabelOption;
  10246. }
  10247. interface FunnelStatesMixin$1 {
  10248. emphasis?: DefaultStatesMixinEmphasis;
  10249. }
  10250. interface HeatmapDataItemOption extends HeatmapStateOption, StatesOptionMixin<HeatmapStateOption, FunnelStatesMixin$1> {
  10251. value: HeatmapDataValue;
  10252. }
  10253. interface HeatmapSeriesOption extends SeriesOption<HeatmapStateOption<CallbackDataParams>, FunnelStatesMixin$1>, HeatmapStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnGeoOptionMixin, SeriesOnCalendarOptionMixin, SeriesEncodeOptionMixin {
  10254. type?: 'heatmap';
  10255. coordinateSystem?: 'cartesian2d' | 'geo' | 'calendar';
  10256. blurSize?: number;
  10257. pointSize?: number;
  10258. maxOpacity?: number;
  10259. minOpacity?: number;
  10260. data?: (HeatmapDataItemOption | HeatmapDataValue)[];
  10261. }
  10262. interface PictorialBarStateOption {
  10263. itemStyle?: ItemStyleOption;
  10264. label?: SeriesLabelOption;
  10265. }
  10266. interface PictorialBarSeriesSymbolOption {
  10267. /**
  10268. * Customized bar shape
  10269. */
  10270. symbol?: string;
  10271. /**
  10272. * Can be ['100%', '100%'], null means auto.
  10273. * The percent will be relative to category width. If no repeat.
  10274. * Will be relative to symbolBoundingData.
  10275. */
  10276. symbolSize?: (number | string)[] | number | string;
  10277. symbolRotate?: number;
  10278. /**
  10279. * Default to be auto
  10280. */
  10281. symbolPosition?: 'start' | 'end' | 'center';
  10282. /**
  10283. * Can be percent offset relative to the symbolSize
  10284. */
  10285. symbolOffset?: (number | string)[] | number | string;
  10286. /**
  10287. * start margin and end margin. Can be a number or a percent string relative to symbolSize.
  10288. * Auto margin by default.
  10289. */
  10290. symbolMargin?: (number | string)[] | number | string;
  10291. /**
  10292. * true: means auto calculate repeat times and cut by data.
  10293. * a number: specifies repeat times, and do not cut by data.
  10294. * 'fixed': means auto calculate repeat times but do not cut by data.
  10295. *
  10296. * Otherwise means no repeat
  10297. */
  10298. symbolRepeat?: boolean | number | 'fixed';
  10299. /**
  10300. * From start to end or end to start.
  10301. */
  10302. symbolRepeatDirection?: 'start' | 'end';
  10303. symbolClip?: boolean;
  10304. /**
  10305. * It will define the size of graphic elements.
  10306. */
  10307. symbolBoundingData?: number | number[];
  10308. symbolPatternSize?: number;
  10309. }
  10310. interface ExtraStateOption$5 {
  10311. emphasis?: {
  10312. focus?: DefaultEmphasisFocus;
  10313. scale?: boolean;
  10314. };
  10315. }
  10316. interface PictorialBarDataItemOption extends PictorialBarSeriesSymbolOption, AnimationOptionMixin, PictorialBarStateOption, StatesOptionMixin<PictorialBarStateOption, ExtraStateOption$5>, OptionDataItemObject<OptionDataValue> {
  10317. z?: number;
  10318. cursor?: string;
  10319. }
  10320. interface PictorialBarSeriesOption extends BaseBarSeriesOption<PictorialBarStateOption, ExtraStateOption$5>, PictorialBarStateOption, PictorialBarSeriesSymbolOption, SeriesStackOptionMixin, SeriesEncodeOptionMixin {
  10321. type?: 'pictorialBar';
  10322. coordinateSystem?: 'cartesian2d';
  10323. data?: (PictorialBarDataItemOption | OptionDataValue | OptionDataValue[])[];
  10324. }
  10325. interface ThemeRiverSeriesLabelOption extends SeriesLabelOption {
  10326. margin?: number;
  10327. }
  10328. declare type ThemerRiverDataItem = [OptionDataValueDate, OptionDataValueNumeric, string];
  10329. interface ThemeRiverStatesMixin {
  10330. emphasis?: DefaultStatesMixinEmphasis;
  10331. }
  10332. interface ThemeRiverStateOption<TCbParams = never> {
  10333. label?: ThemeRiverSeriesLabelOption;
  10334. itemStyle?: ItemStyleOption<TCbParams>;
  10335. }
  10336. interface ThemeRiverSeriesOption extends SeriesOption<ThemeRiverStateOption<CallbackDataParams>, ThemeRiverStatesMixin>, ThemeRiverStateOption<CallbackDataParams>, SeriesOnSingleOptionMixin, BoxLayoutOptionMixin {
  10337. type?: 'themeRiver';
  10338. color?: ZRColor[];
  10339. coordinateSystem?: 'singleAxis';
  10340. /**
  10341. * gap in axis's orthogonal orientation
  10342. */
  10343. boundaryGap?: (string | number)[];
  10344. /**
  10345. * [date, value, name]
  10346. */
  10347. data?: ThemerRiverDataItem[];
  10348. }
  10349. interface SunburstItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
  10350. borderRadius?: (number | string)[] | number | string;
  10351. }
  10352. interface SunburstLabelOption extends Omit<SeriesLabelOption, 'rotate' | 'position'> {
  10353. rotate?: 'radial' | 'tangential' | number;
  10354. minAngle?: number;
  10355. silent?: boolean;
  10356. position?: SeriesLabelOption['position'] | 'outside';
  10357. }
  10358. interface SunburstStatesMixin {
  10359. emphasis?: {
  10360. focus?: DefaultEmphasisFocus | 'descendant' | 'ancestor';
  10361. };
  10362. }
  10363. interface SunburstStateOption<TCbParams = never> {
  10364. itemStyle?: SunburstItemStyleOption<TCbParams>;
  10365. label?: SunburstLabelOption;
  10366. }
  10367. interface SunburstSeriesLevelOption extends SunburstStateOption, StatesOptionMixin<SunburstStateOption, SunburstStatesMixin> {
  10368. radius?: (number | string)[];
  10369. /**
  10370. * @deprecated use radius instead
  10371. */
  10372. r?: number | string;
  10373. /**
  10374. * @deprecated use radius instead
  10375. */
  10376. r0?: number | string;
  10377. highlight?: {
  10378. itemStyle?: SunburstItemStyleOption;
  10379. label?: SunburstLabelOption;
  10380. };
  10381. }
  10382. interface SortParam {
  10383. dataIndex: number;
  10384. depth: number;
  10385. height: number;
  10386. getValue(): number;
  10387. }
  10388. interface SunburstSeriesOption extends SeriesOption<SunburstStateOption, SunburstStatesMixin>, SunburstStateOption, SunburstColorByMixin, CircleLayoutOptionMixin {
  10389. type?: 'sunburst';
  10390. clockwise?: boolean;
  10391. startAngle?: number;
  10392. minAngle?: number;
  10393. /**
  10394. * If still show when all data zero.
  10395. */
  10396. stillShowZeroSum?: boolean;
  10397. /**
  10398. * Policy of highlighting pieces when hover on one
  10399. * Valid values: 'none' (for not downplay others), 'descendant',
  10400. * 'ancestor', 'self'
  10401. */
  10402. nodeClick?: 'rootToNode' | 'link' | false;
  10403. renderLabelForZeroData?: boolean;
  10404. levels?: SunburstSeriesLevelOption[];
  10405. animationType?: 'expansion' | 'scale';
  10406. sort?: 'desc' | 'asc' | ((a: SortParam, b: SortParam) => number);
  10407. }
  10408. interface GraphicComponentBaseElementOption extends Partial<Pick<Element, TransformProp | 'silent' | 'ignore' | 'textConfig' | 'draggable' | ElementEventNameWithOn>>,
  10409. /**
  10410. * left/right/top/bottom: (like 12, '22%', 'center', default undefined)
  10411. * If left/rigth is set, shape.x/shape.cx/position will not be used.
  10412. * If top/bottom is set, shape.y/shape.cy/position will not be used.
  10413. * This mechanism is useful when you want to position a group/element
  10414. * against the right side or the center of this container.
  10415. */
  10416. Partial<Pick<BoxLayoutOptionMixin, 'left' | 'right' | 'top' | 'bottom'>> {
  10417. /**
  10418. * element type, mandatory.
  10419. * Only can be omit if call setOption not at the first time and perform merge.
  10420. */
  10421. type?: string;
  10422. id?: OptionId;
  10423. name?: string;
  10424. parentId?: OptionId;
  10425. parentOption?: GraphicComponentElementOption;
  10426. children?: GraphicComponentElementOption[];
  10427. hv?: [boolean, boolean];
  10428. /**
  10429. * bounding: (enum: 'all' (default) | 'raw')
  10430. * Specify how to calculate boundingRect when locating.
  10431. * 'all': Get uioned and transformed boundingRect
  10432. * from both itself and its descendants.
  10433. * This mode simplies confining a group of elements in the bounding
  10434. * of their ancester container (e.g., using 'right: 0').
  10435. * 'raw': Only use the boundingRect of itself and before transformed.
  10436. * This mode is similar to css behavior, which is useful when you
  10437. * want an element to be able to overflow its container. (Consider
  10438. * a rotated circle needs to be located in a corner.)
  10439. */
  10440. bounding?: 'raw' | 'all';
  10441. /**
  10442. * info: custom info. enables user to mount some info on elements and use them
  10443. * in event handlers. Update them only when user specified, otherwise, remain.
  10444. */
  10445. info?: GraphicExtraElementInfo;
  10446. clipPath?: Omit<GraphicComponentZRPathOption, 'clipPath'> | false;
  10447. textContent?: Omit<GraphicComponentTextOption, 'clipPath'>;
  10448. textConfig?: ElementTextConfig;
  10449. $action?: 'merge' | 'replace' | 'remove';
  10450. tooltip?: CommonTooltipOption<unknown>;
  10451. enterAnimation?: AnimationOption$1;
  10452. updateAnimation?: AnimationOption$1;
  10453. leaveAnimation?: AnimationOption$1;
  10454. }
  10455. interface GraphicComponentDisplayableOption extends GraphicComponentBaseElementOption, Partial<Pick<Displayable, 'zlevel' | 'z' | 'z2' | 'invisible' | 'cursor'>> {
  10456. style?: ZRStyleProps;
  10457. z2?: number;
  10458. }
  10459. interface GraphicComponentGroupOption extends GraphicComponentBaseElementOption, TransitionOptionMixin<GroupProps> {
  10460. type?: 'group';
  10461. /**
  10462. * width/height: (can only be pixel value, default 0)
  10463. * Only be used to specify contianer(group) size, if needed. And
  10464. * can not be percentage value (like '33%'). See the reason in the
  10465. * layout algorithm below.
  10466. */
  10467. width?: number;
  10468. height?: number;
  10469. children: GraphicComponentElementOption[];
  10470. keyframeAnimation?: ElementKeyframeAnimationOption<GroupProps> | ElementKeyframeAnimationOption<GroupProps>[];
  10471. }
  10472. interface GraphicComponentZRPathOption extends GraphicComponentDisplayableOption, TransitionOptionMixin<PathProps> {
  10473. shape?: PathProps['shape'] & TransitionOptionMixin<PathProps['shape']>;
  10474. style?: PathStyleProps & TransitionOptionMixin<PathStyleProps>;
  10475. keyframeAnimation?: ElementKeyframeAnimationOption<PathProps> | ElementKeyframeAnimationOption<PathProps>[];
  10476. }
  10477. interface GraphicComponentImageOption extends GraphicComponentDisplayableOption, TransitionOptionMixin<ImageProps> {
  10478. type?: 'image';
  10479. style?: ImageStyleProps & TransitionOptionMixin<ImageStyleProps>;
  10480. keyframeAnimation?: ElementKeyframeAnimationOption<ImageProps> | ElementKeyframeAnimationOption<ImageProps>[];
  10481. }
  10482. interface GraphicComponentTextOption extends Omit<GraphicComponentDisplayableOption, 'textContent' | 'textConfig'>, TransitionOptionMixin<TextProps> {
  10483. type?: 'text';
  10484. style?: TextStyleProps & TransitionOptionMixin<TextStyleProps>;
  10485. keyframeAnimation?: ElementKeyframeAnimationOption<TextProps> | ElementKeyframeAnimationOption<TextProps>[];
  10486. }
  10487. declare type GraphicComponentElementOption = GraphicComponentGroupOption | GraphicComponentZRPathOption | GraphicComponentImageOption | GraphicComponentTextOption;
  10488. declare type GraphicExtraElementInfo = Dictionary<unknown>;
  10489. declare type GraphicComponentLooseOption = (GraphicComponentOption | GraphicComponentElementOption) & {
  10490. mainType?: 'graphic';
  10491. };
  10492. interface GraphicComponentOption extends ComponentOption, AnimationOptionMixin {
  10493. elements?: GraphicComponentElementOption[];
  10494. }
  10495. declare const ICON_TYPES: readonly ["rect", "polygon", "lineX", "lineY", "keep", "clear"];
  10496. declare type IconType = typeof ICON_TYPES[number];
  10497. interface ToolboxBrushFeatureOption extends ToolboxFeatureOption {
  10498. type?: IconType[];
  10499. icon?: {
  10500. [key in IconType]?: string;
  10501. };
  10502. title?: {
  10503. [key in IconType]?: string;
  10504. };
  10505. }
  10506. interface ToolboxDataViewFeatureOption extends ToolboxFeatureOption {
  10507. readOnly?: boolean;
  10508. optionToContent?: (option: ECUnitOption) => string | HTMLElement;
  10509. contentToOption?: (viewMain: HTMLDivElement, oldOption: ECUnitOption) => ECUnitOption;
  10510. icon?: string;
  10511. title?: string;
  10512. lang?: string[];
  10513. backgroundColor?: ColorString;
  10514. textColor?: ColorString;
  10515. textareaColor?: ColorString;
  10516. textareaBorderColor?: ColorString;
  10517. buttonColor?: ColorString;
  10518. buttonTextColor?: ColorString;
  10519. }
  10520. declare const ICON_TYPES$1: readonly ["zoom", "back"];
  10521. declare type IconType$1 = typeof ICON_TYPES$1[number];
  10522. interface ToolboxDataZoomFeatureOption extends ToolboxFeatureOption {
  10523. type?: IconType$1[];
  10524. icon?: {
  10525. [key in IconType$1]?: string;
  10526. };
  10527. title?: {
  10528. [key in IconType$1]?: string;
  10529. };
  10530. filterMode?: 'filter' | 'weakFilter' | 'empty' | 'none';
  10531. xAxisIndex?: ModelFinderIndexQuery;
  10532. yAxisIndex?: ModelFinderIndexQuery;
  10533. xAxisId?: ModelFinderIdQuery;
  10534. yAxisId?: ModelFinderIdQuery;
  10535. brushStyle?: ItemStyleOption;
  10536. }
  10537. declare const ICON_TYPES$2: readonly ["line", "bar", "stack"];
  10538. declare const TITLE_TYPES: readonly ["line", "bar", "stack", "tiled"];
  10539. declare type IconType$2 = typeof ICON_TYPES$2[number];
  10540. declare type TitleType = typeof TITLE_TYPES[number];
  10541. interface ToolboxMagicTypeFeatureOption extends ToolboxFeatureOption {
  10542. type?: IconType$2[];
  10543. /**
  10544. * Icon group
  10545. */
  10546. icon?: {
  10547. [key in IconType$2]?: string;
  10548. };
  10549. title?: {
  10550. [key in TitleType]?: string;
  10551. };
  10552. option?: {
  10553. [key in IconType$2]?: SeriesOption;
  10554. };
  10555. /**
  10556. * Map of seriesType: seriesIndex
  10557. */
  10558. seriesIndex?: {
  10559. line?: number;
  10560. bar?: number;
  10561. };
  10562. }
  10563. interface ToolboxRestoreFeatureOption extends ToolboxFeatureOption {
  10564. icon?: string;
  10565. title?: string;
  10566. }
  10567. interface ToolboxSaveAsImageFeatureOption extends ToolboxFeatureOption {
  10568. icon?: string;
  10569. title?: string;
  10570. type?: 'png' | 'jpeg';
  10571. backgroundColor?: ZRColor;
  10572. connectedBackgroundColor?: ZRColor;
  10573. name?: string;
  10574. excludeComponents?: string[];
  10575. pixelRatio?: number;
  10576. lang?: string[];
  10577. }
  10578. interface ToolboxComponentOption extends ToolboxOption {
  10579. feature?: {
  10580. brush?: ToolboxBrushFeatureOption;
  10581. dataView?: ToolboxDataViewFeatureOption;
  10582. dataZoom?: ToolboxDataZoomFeatureOption;
  10583. magicType?: ToolboxMagicTypeFeatureOption;
  10584. restore?: ToolboxRestoreFeatureOption;
  10585. saveAsImage?: ToolboxSaveAsImageFeatureOption;
  10586. [key: string]: ToolboxFeatureOption | {
  10587. [key: string]: any;
  10588. } | undefined;
  10589. };
  10590. }
  10591. declare type DataZoomComponentOption = SliderDataZoomOption | InsideDataZoomOption;
  10592. declare type VisualMapComponentOption = ContinousVisualMapOption | PiecewiseVisualMapOption;
  10593. declare type LegendComponentOption = LegendOption | ScrollableLegendOption;
  10594. declare type SeriesInjectedOption = {
  10595. markArea?: MarkAreaOption;
  10596. markLine?: MarkLineOption;
  10597. markPoint?: MarkPointOption;
  10598. tooltip?: SeriesTooltipOption;
  10599. };
  10600. declare type LineSeriesOption$1 = LineSeriesOption & SeriesInjectedOption;
  10601. declare type BarSeriesOption$1 = BarSeriesOption & SeriesInjectedOption;
  10602. declare type ScatterSeriesOption$1 = ScatterSeriesOption & SeriesInjectedOption;
  10603. declare type PieSeriesOption$1 = PieSeriesOption & SeriesInjectedOption;
  10604. declare type RadarSeriesOption$1 = RadarSeriesOption & SeriesInjectedOption;
  10605. declare type MapSeriesOption$1 = MapSeriesOption & SeriesInjectedOption;
  10606. declare type TreeSeriesOption$1 = TreeSeriesOption & SeriesInjectedOption;
  10607. declare type TreemapSeriesOption$1 = TreemapSeriesOption & SeriesInjectedOption;
  10608. declare type GraphSeriesOption$1 = GraphSeriesOption & SeriesInjectedOption;
  10609. declare type GaugeSeriesOption$1 = GaugeSeriesOption & SeriesInjectedOption;
  10610. declare type FunnelSeriesOption$1 = FunnelSeriesOption & SeriesInjectedOption;
  10611. declare type ParallelSeriesOption$1 = ParallelSeriesOption & SeriesInjectedOption;
  10612. declare type SankeySeriesOption$1 = SankeySeriesOption & SeriesInjectedOption;
  10613. declare type BoxplotSeriesOption$1 = BoxplotSeriesOption & SeriesInjectedOption;
  10614. declare type CandlestickSeriesOption$1 = CandlestickSeriesOption & SeriesInjectedOption;
  10615. declare type EffectScatterSeriesOption$1 = EffectScatterSeriesOption & SeriesInjectedOption;
  10616. declare type LinesSeriesOption$1 = LinesSeriesOption & SeriesInjectedOption;
  10617. declare type HeatmapSeriesOption$1 = HeatmapSeriesOption & SeriesInjectedOption;
  10618. declare type PictorialBarSeriesOption$1 = PictorialBarSeriesOption & SeriesInjectedOption;
  10619. declare type ThemeRiverSeriesOption$1 = ThemeRiverSeriesOption & SeriesInjectedOption;
  10620. declare type SunburstSeriesOption$1 = SunburstSeriesOption & SeriesInjectedOption;
  10621. declare type CustomSeriesOption$1 = CustomSeriesOption & SeriesInjectedOption;
  10622. /**
  10623. * A map from series 'type' to series option
  10624. * It's used for declaration merging in echarts extensions.
  10625. * For example:
  10626. * ```ts
  10627. * import echarts from 'echarts';
  10628. * declare module 'echarts/types/dist/echarts' {
  10629. * interface RegisteredSeriesOption {
  10630. * wordCloud: WordCloudSeriesOption
  10631. * }
  10632. * }
  10633. * ```
  10634. */
  10635. interface RegisteredSeriesOption {
  10636. line: LineSeriesOption$1;
  10637. bar: BarSeriesOption$1;
  10638. scatter: ScatterSeriesOption$1;
  10639. pie: PieSeriesOption$1;
  10640. radar: RadarSeriesOption$1;
  10641. map: MapSeriesOption$1;
  10642. tree: TreeSeriesOption$1;
  10643. treemap: TreemapSeriesOption$1;
  10644. graph: GraphSeriesOption$1;
  10645. gauge: GaugeSeriesOption$1;
  10646. funnel: FunnelSeriesOption$1;
  10647. parallel: ParallelSeriesOption$1;
  10648. sankey: SankeySeriesOption$1;
  10649. boxplot: BoxplotSeriesOption$1;
  10650. candlestick: CandlestickSeriesOption$1;
  10651. effectScatter: EffectScatterSeriesOption$1;
  10652. lines: LinesSeriesOption$1;
  10653. heatmap: HeatmapSeriesOption$1;
  10654. pictorialBar: PictorialBarSeriesOption$1;
  10655. themeRiver: ThemeRiverSeriesOption$1;
  10656. sunburst: SunburstSeriesOption$1;
  10657. custom: CustomSeriesOption$1;
  10658. }
  10659. declare type Values<T> = T[keyof T];
  10660. declare type SeriesOption$1 = Values<RegisteredSeriesOption>;
  10661. interface EChartsOption extends ECBasicOption {
  10662. dataset?: DatasetOption | DatasetOption[];
  10663. aria?: AriaOption;
  10664. title?: TitleOption | TitleOption[];
  10665. grid?: GridOption | GridOption[];
  10666. radar?: RadarOption | RadarOption[];
  10667. polar?: PolarOption | PolarOption[];
  10668. geo?: GeoOption | GeoOption[];
  10669. angleAxis?: AngleAxisOption | AngleAxisOption[];
  10670. radiusAxis?: RadiusAxisOption | RadiusAxisOption[];
  10671. xAxis?: XAXisOption | XAXisOption[];
  10672. yAxis?: YAXisOption | YAXisOption[];
  10673. singleAxis?: SingleAxisOption | SingleAxisOption[];
  10674. parallel?: ParallelCoordinateSystemOption | ParallelCoordinateSystemOption[];
  10675. parallelAxis?: ParallelAxisOption | ParallelAxisOption[];
  10676. calendar?: CalendarOption | CalendarOption[];
  10677. toolbox?: ToolboxComponentOption | ToolboxComponentOption[];
  10678. tooltip?: TooltipOption | TooltipOption[];
  10679. axisPointer?: AxisPointerOption | AxisPointerOption[];
  10680. brush?: BrushOption | BrushOption[];
  10681. timeline?: TimelineOption | SliderTimelineOption;
  10682. legend?: LegendComponentOption | (LegendComponentOption)[];
  10683. dataZoom?: DataZoomComponentOption | (DataZoomComponentOption)[];
  10684. visualMap?: VisualMapComponentOption | (VisualMapComponentOption)[];
  10685. graphic?: GraphicComponentLooseOption | GraphicComponentLooseOption[];
  10686. series?: SeriesOption$1 | SeriesOption$1[];
  10687. options?: EChartsOption[];
  10688. baseOption?: EChartsOption;
  10689. }
  10690. declare function install$o(registers: EChartsExtensionInstallRegisters): void;
  10691. declare function install$p(registers: EChartsExtensionInstallRegisters): void;
  10692. declare function install$q(registers: EChartsExtensionInstallRegisters): void;
  10693. declare function install$r(registers: EChartsExtensionInstallRegisters): void;
  10694. declare function install$s(registers: EChartsExtensionInstallRegisters): void;
  10695. declare function install$t(registers: EChartsExtensionInstallRegisters): void;
  10696. declare function install$u(registers: EChartsExtensionInstallRegisters): void;
  10697. declare function install$v(registers: EChartsExtensionInstallRegisters): void;
  10698. declare function install$w(registers: EChartsExtensionInstallRegisters): void;
  10699. declare function install$x(registers: EChartsExtensionInstallRegisters): void;
  10700. declare function install$y(registers: EChartsExtensionInstallRegisters): void;
  10701. declare function install$z(registers: EChartsExtensionInstallRegisters): void;
  10702. declare function install$A(registers: EChartsExtensionInstallRegisters): void;
  10703. declare function install$B(registers: EChartsExtensionInstallRegisters): void;
  10704. declare function install$C(registers: EChartsExtensionInstallRegisters): void;
  10705. declare function install$D(registers: EChartsExtensionInstallRegisters): void;
  10706. declare function install$E(registers: EChartsExtensionInstallRegisters): void;
  10707. declare function install$F(registers: EChartsExtensionInstallRegisters): void;
  10708. declare function install$G(registers: EChartsExtensionInstallRegisters): void;
  10709. declare function install$H(registers: EChartsExtensionInstallRegisters): void;
  10710. declare function install$I(registers: EChartsExtensionInstallRegisters): void;
  10711. declare function install$J(registers: EChartsExtensionInstallRegisters): void;
  10712. declare function install$K(registers: EChartsExtensionInstallRegisters): void;
  10713. declare function install$L(registers: EChartsExtensionInstallRegisters): void;
  10714. declare function install$M(registers: EChartsExtensionInstallRegisters): void;
  10715. declare function install$N(registers: EChartsExtensionInstallRegisters): void;
  10716. declare function install$O(registers: EChartsExtensionInstallRegisters): void;
  10717. declare function install$P(registers: EChartsExtensionInstallRegisters): void;
  10718. declare function install$Q(registers: EChartsExtensionInstallRegisters): void;
  10719. declare function install$R(registers: EChartsExtensionInstallRegisters): void;
  10720. declare function installUniversalTransition(registers: EChartsExtensionInstallRegisters): void;
  10721. declare function installLabelLayout(registers: EChartsExtensionInstallRegisters): void;
  10722. export { AngleAxisOption, AnimationDelayCallback, AnimationDelayCallbackParam, AnimationDurationCallback, AriaOption, Axis, AxisPointerOption, BarSeriesOption$1 as BarSeriesOption, BoxplotSeriesOption$1 as BoxplotSeriesOption, BrushOption, CalendarOption, CallbackDataParams, CandlestickSeriesOption$1 as CandlestickSeriesOption, ChartView, ComponentModel, ComponentView, ComposeOption, ContinousVisualMapOption, CustomSeriesOption$1 as CustomSeriesOption, CustomSeriesRenderItem, CustomSeriesRenderItemAPI, CustomSeriesRenderItemParams, CustomSeriesRenderItemReturn, DataZoomComponentOption, DatasetOption, ECBasicOption, EChartsOption, EChartsType, EffectScatterSeriesOption$1 as EffectScatterSeriesOption, ElementEvent, FunnelSeriesOption$1 as FunnelSeriesOption, GaugeSeriesOption$1 as GaugeSeriesOption, GeoOption, GraphSeriesOption$1 as GraphSeriesOption, GraphicComponentLooseOption, GridOption, HeatmapSeriesOption$1 as HeatmapSeriesOption, ImagePatternObject, InsideDataZoomOption, LabelFormatterCallback, LabelLayoutOptionCallback, LabelLayoutOptionCallbackParams, LegendComponentOption, LegendOption, LineSeriesOption$1 as LineSeriesOption, LinearGradientObject, LinesSeriesOption$1 as LinesSeriesOption, MapSeriesOption$1 as MapSeriesOption, MarkAreaOption, MarkLineOption, MarkPointOption, Model, PRIORITY, ParallelCoordinateSystemOption, ParallelSeriesOption$1 as ParallelSeriesOption, PatternObject, Payload, PictorialBarSeriesOption$1 as PictorialBarSeriesOption, PieSeriesOption$1 as PieSeriesOption, PiecewiseVisualMapOption, PolarOption, RadarOption, RadarSeriesOption$1 as RadarSeriesOption, RadialGradientObject, RadiusAxisOption, RegisteredSeriesOption, ResizeOpts, SVGPatternObject, SankeySeriesOption$1 as SankeySeriesOption, ScatterSeriesOption$1 as ScatterSeriesOption, ScrollableLegendOption, SeriesData, SeriesModel, SeriesOption$1 as SeriesOption, SetOptionOpts, SetOptionTransitionOpt, SetOptionTransitionOptItem, SingleAxisOption, SliderDataZoomOption, SunburstSeriesOption$1 as SunburstSeriesOption, ThemeRiverSeriesOption$1 as ThemeRiverSeriesOption, TimelineOption, TitleOption, ToolboxComponentOption, TooltipFormatterCallback, TooltipOption, TooltipPositionCallback, TooltipPositionCallbackParams, TopLevelFormatterParams, TreeSeriesOption$1 as TreeSeriesOption, TreemapSeriesOption$1 as TreemapSeriesOption, VisualMapComponentOption, XAXisOption, YAXisOption, ZRColor, brushSingle, color_d, connect, dataTool, dependencies, disConnect, disconnect, dispose$1 as dispose, env, extendChartView, extendComponentModel, extendComponentView, extendSeriesModel, format_d, getCoordinateSystemDimensions, getInstanceByDom, getInstanceById, getMap, graphic_d, helper_d, init$1 as init, install$1 as install, install$2 as install$1, install$b as install$10, install$c as install$11, install$d as install$12, install$e as install$13, install$f as install$14, install$g as install$15, install$h as install$16, install$i as install$17, install$j as install$18, install$k as install$19, install$3 as install$2, install$l as install$20, install$m as install$21, install$o as install$22, install$p as install$23, install$q as install$24, install$r as install$25, install$s as install$26, install$t as install$27, install$u as install$28, install$v as install$29, install$4 as install$3, install$w as install$30, install$x as install$31, install$y as install$32, install$z as install$33, install$A as install$34, install$n as install$35, install$B as install$36, install$C as install$37, install$D as install$38, install$E as install$39, install$5 as install$4, install$F as install$40, install$G as install$41, install$H as install$42, install$I as install$43, install$J as install$44, install$K as install$45, install$L as install$46, install$M as install$47, install$N as install$48, install$O as install$49, install$6 as install$5, install$P as install$50, install as install$51, install$Q as install$52, install$R as install$53, install$7 as install$6, install$8 as install$7, install$9 as install$8, install$a as install$9, installLabelLayout, installUniversalTransition, matrix_d, number_d, parseGeoJSON, registerAction, registerCoordinateSystem, registerLayout, registerLoading, registerLocale, registerMap, registerPostInit, registerPostUpdate, registerPreprocessor, registerProcessor, registerTheme, registerTransform, registerUpdateLifecycle, registerVisual, setCanvasCreator, setPlatformAPI, throttle, time_d, use, util_d, util_d$1, vector_d, version$1 as version, zrender_d };