echarts.d.ts 382 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919
  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.3";
  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. interface MapInterface<T, KEY extends string | number = string | number> {
  1459. delete(key: KEY): boolean;
  1460. has(key: KEY): boolean;
  1461. get(key: KEY): T | undefined;
  1462. set(key: KEY, value: T): this;
  1463. keys(): KEY[];
  1464. forEach(callback: (value: T, key: KEY) => void): void;
  1465. }
  1466. declare class HashMap<T, KEY extends string | number = string | number> {
  1467. data: MapInterface<T, KEY>;
  1468. constructor(obj?: HashMap<T, KEY> | {
  1469. [key in KEY]?: T;
  1470. } | KEY[]);
  1471. hasKey(key: KEY): boolean;
  1472. get(key: KEY): T;
  1473. set(key: KEY, value: T): T;
  1474. each<Context>(cb: (this: Context, value?: T, key?: KEY) => void, context?: Context): void;
  1475. keys(): KEY[];
  1476. removeKey(key: KEY): void;
  1477. }
  1478. declare function createHashMap<T, KEY extends string | number = string | number>(obj?: HashMap<T, KEY> | {
  1479. [key in KEY]?: T;
  1480. } | KEY[]): HashMap<T, KEY>;
  1481. declare function concatArray<T, R>(a: ArrayLike$1<T>, b: ArrayLike$1<R>): ArrayLike$1<T | R>;
  1482. declare function createObject<T>(proto?: object, properties?: T): T;
  1483. declare function disableUserSelect(dom: HTMLElement): void;
  1484. declare function hasOwn(own: object, prop: string): boolean;
  1485. declare function noop(): void;
  1486. declare const RADIAN_TO_DEGREE: number;
  1487. declare const util_d_curry: typeof curry;
  1488. declare const util_d_guid: typeof guid;
  1489. declare const util_d_logError: typeof logError;
  1490. declare const util_d_merge: typeof merge;
  1491. declare const util_d_mergeAll: typeof mergeAll;
  1492. declare const util_d_extend: typeof extend;
  1493. declare const util_d_defaults: typeof defaults;
  1494. declare const util_d_createCanvas: typeof createCanvas;
  1495. declare const util_d_indexOf: typeof indexOf;
  1496. declare const util_d_inherits: typeof inherits;
  1497. declare const util_d_mixin: typeof mixin;
  1498. declare const util_d_isArrayLike: typeof isArrayLike;
  1499. declare const util_d_each: typeof each;
  1500. declare const util_d_map: typeof map;
  1501. declare const util_d_reduce: typeof reduce;
  1502. declare const util_d_filter: typeof filter;
  1503. declare const util_d_find: typeof find;
  1504. declare const util_d_keys: typeof keys;
  1505. type util_d_Bind1<F, Ctx> = Bind1<F, Ctx>;
  1506. type util_d_Bind2<F, Ctx, T1> = Bind2<F, Ctx, T1>;
  1507. type util_d_Bind3<F, Ctx, T1, T2> = Bind3<F, Ctx, T1, T2>;
  1508. type util_d_Bind4<F, Ctx, T1, T2, T3> = Bind4<F, Ctx, T1, T2, T3>;
  1509. type util_d_Bind5<F, Ctx, T1, T2, T3, T4> = Bind5<F, Ctx, T1, T2, T3, T4>;
  1510. declare const util_d_bind: typeof bind;
  1511. type util_d_Curry1<F, T1> = Curry1<F, T1>;
  1512. type util_d_Curry2<F, T1, T2> = Curry2<F, T1, T2>;
  1513. type util_d_Curry3<F, T1, T2, T3> = Curry3<F, T1, T2, T3>;
  1514. type util_d_Curry4<F, T1, T2, T3, T4> = Curry4<F, T1, T2, T3, T4>;
  1515. declare const util_d_isArray: typeof isArray;
  1516. declare const util_d_isFunction: typeof isFunction;
  1517. declare const util_d_isString: typeof isString;
  1518. declare const util_d_isStringSafe: typeof isStringSafe;
  1519. declare const util_d_isNumber: typeof isNumber;
  1520. declare const util_d_isObject: typeof isObject;
  1521. declare const util_d_isBuiltInObject: typeof isBuiltInObject;
  1522. declare const util_d_isTypedArray: typeof isTypedArray;
  1523. declare const util_d_isDom: typeof isDom;
  1524. declare const util_d_isGradientObject: typeof isGradientObject;
  1525. declare const util_d_isImagePatternObject: typeof isImagePatternObject;
  1526. declare const util_d_isRegExp: typeof isRegExp;
  1527. declare const util_d_eqNaN: typeof eqNaN;
  1528. declare const util_d_retrieve: typeof retrieve;
  1529. declare const util_d_retrieve2: typeof retrieve2;
  1530. declare const util_d_retrieve3: typeof retrieve3;
  1531. declare const util_d_slice: typeof slice;
  1532. declare const util_d_normalizeCssArray: typeof normalizeCssArray;
  1533. declare const util_d_assert: typeof assert;
  1534. declare const util_d_trim: typeof trim;
  1535. declare const util_d_setAsPrimitive: typeof setAsPrimitive;
  1536. declare const util_d_isPrimitive: typeof isPrimitive;
  1537. type util_d_HashMap<T, KEY extends string | number = string | number> = HashMap<T, KEY>;
  1538. declare const util_d_HashMap: typeof HashMap;
  1539. declare const util_d_createHashMap: typeof createHashMap;
  1540. declare const util_d_concatArray: typeof concatArray;
  1541. declare const util_d_createObject: typeof createObject;
  1542. declare const util_d_disableUserSelect: typeof disableUserSelect;
  1543. declare const util_d_hasOwn: typeof hasOwn;
  1544. declare const util_d_noop: typeof noop;
  1545. declare const util_d_RADIAN_TO_DEGREE: typeof RADIAN_TO_DEGREE;
  1546. declare namespace util_d {
  1547. export {
  1548. util_d_curry as curry,
  1549. util_d_guid as guid,
  1550. util_d_logError as logError,
  1551. clone$2 as clone,
  1552. util_d_merge as merge,
  1553. util_d_mergeAll as mergeAll,
  1554. util_d_extend as extend,
  1555. util_d_defaults as defaults,
  1556. util_d_createCanvas as createCanvas,
  1557. util_d_indexOf as indexOf,
  1558. util_d_inherits as inherits,
  1559. util_d_mixin as mixin,
  1560. util_d_isArrayLike as isArrayLike,
  1561. util_d_each as each,
  1562. util_d_map as map,
  1563. util_d_reduce as reduce,
  1564. util_d_filter as filter,
  1565. util_d_find as find,
  1566. util_d_keys as keys,
  1567. util_d_Bind1 as Bind1,
  1568. util_d_Bind2 as Bind2,
  1569. util_d_Bind3 as Bind3,
  1570. util_d_Bind4 as Bind4,
  1571. util_d_Bind5 as Bind5,
  1572. util_d_bind as bind,
  1573. util_d_Curry1 as Curry1,
  1574. util_d_Curry2 as Curry2,
  1575. util_d_Curry3 as Curry3,
  1576. util_d_Curry4 as Curry4,
  1577. util_d_isArray as isArray,
  1578. util_d_isFunction as isFunction,
  1579. util_d_isString as isString,
  1580. util_d_isStringSafe as isStringSafe,
  1581. util_d_isNumber as isNumber,
  1582. util_d_isObject as isObject,
  1583. util_d_isBuiltInObject as isBuiltInObject,
  1584. util_d_isTypedArray as isTypedArray,
  1585. util_d_isDom as isDom,
  1586. util_d_isGradientObject as isGradientObject,
  1587. util_d_isImagePatternObject as isImagePatternObject,
  1588. util_d_isRegExp as isRegExp,
  1589. util_d_eqNaN as eqNaN,
  1590. util_d_retrieve as retrieve,
  1591. util_d_retrieve2 as retrieve2,
  1592. util_d_retrieve3 as retrieve3,
  1593. util_d_slice as slice,
  1594. util_d_normalizeCssArray as normalizeCssArray,
  1595. util_d_assert as assert,
  1596. util_d_trim as trim,
  1597. util_d_setAsPrimitive as setAsPrimitive,
  1598. util_d_isPrimitive as isPrimitive,
  1599. util_d_HashMap as HashMap,
  1600. util_d_createHashMap as createHashMap,
  1601. util_d_concatArray as concatArray,
  1602. util_d_createObject as createObject,
  1603. util_d_disableUserSelect as disableUserSelect,
  1604. util_d_hasOwn as hasOwn,
  1605. util_d_noop as noop,
  1606. util_d_RADIAN_TO_DEGREE as RADIAN_TO_DEGREE,
  1607. };
  1608. }
  1609. declare function encodeHTML(source: string): string;
  1610. interface InnerTruncateOption {
  1611. maxIteration?: number;
  1612. minChar?: number;
  1613. placeholder?: string;
  1614. maxIterations?: number;
  1615. }
  1616. declare function truncateText(text: string, containerWidth: number, font: string, ellipsis: string, options: InnerTruncateOption): string;
  1617. declare type SVGPathOption = Omit<PathProps, 'shape' | 'buildPath'>;
  1618. declare class SVGPath extends Path {
  1619. applyTransform(m: MatrixArray): void;
  1620. }
  1621. declare function extendFromString(str: string, defaultOpts?: SVGPathOption): typeof SVGPath;
  1622. declare function mergePath(pathEls: Path[], opts: PathProps): Path<PathProps>;
  1623. declare class CircleShape {
  1624. cx: number;
  1625. cy: number;
  1626. r: number;
  1627. }
  1628. interface CircleProps extends PathProps {
  1629. shape?: Partial<CircleShape>;
  1630. }
  1631. declare class Circle extends Path<CircleProps> {
  1632. shape: CircleShape;
  1633. constructor(opts?: CircleProps);
  1634. getDefaultShape(): CircleShape;
  1635. buildPath(ctx: CanvasRenderingContext2D, shape: CircleShape): void;
  1636. }
  1637. declare class EllipseShape {
  1638. cx: number;
  1639. cy: number;
  1640. rx: number;
  1641. ry: number;
  1642. }
  1643. interface EllipseProps extends PathProps {
  1644. shape?: Partial<EllipseShape>;
  1645. }
  1646. declare class Ellipse extends Path<EllipseProps> {
  1647. shape: EllipseShape;
  1648. constructor(opts?: EllipseProps);
  1649. getDefaultShape(): EllipseShape;
  1650. buildPath(ctx: CanvasRenderingContext2D, shape: EllipseShape): void;
  1651. }
  1652. declare class SectorShape {
  1653. cx: number;
  1654. cy: number;
  1655. r0: number;
  1656. r: number;
  1657. startAngle: number;
  1658. endAngle: number;
  1659. clockwise: boolean;
  1660. cornerRadius: number | number[];
  1661. }
  1662. interface SectorProps extends PathProps {
  1663. shape?: Partial<SectorShape>;
  1664. }
  1665. declare class Sector extends Path<SectorProps> {
  1666. shape: SectorShape;
  1667. constructor(opts?: SectorProps);
  1668. getDefaultShape(): SectorShape;
  1669. buildPath(ctx: CanvasRenderingContext2D, shape: SectorShape): void;
  1670. isZeroArea(): boolean;
  1671. }
  1672. declare class RingShape {
  1673. cx: number;
  1674. cy: number;
  1675. r: number;
  1676. r0: number;
  1677. }
  1678. interface RingProps extends PathProps {
  1679. shape?: Partial<RingShape>;
  1680. }
  1681. declare class Ring extends Path<RingProps> {
  1682. shape: RingShape;
  1683. constructor(opts?: RingProps);
  1684. getDefaultShape(): RingShape;
  1685. buildPath(ctx: CanvasRenderingContext2D, shape: RingShape): void;
  1686. }
  1687. declare class PolygonShape {
  1688. points: VectorArray[];
  1689. smooth?: number;
  1690. smoothConstraint?: VectorArray[];
  1691. }
  1692. interface PolygonProps extends PathProps {
  1693. shape?: Partial<PolygonShape>;
  1694. }
  1695. declare class Polygon extends Path<PolygonProps> {
  1696. shape: PolygonShape;
  1697. constructor(opts?: PolygonProps);
  1698. getDefaultShape(): PolygonShape;
  1699. buildPath(ctx: CanvasRenderingContext2D, shape: PolygonShape): void;
  1700. }
  1701. declare class LineShape {
  1702. x1: number;
  1703. y1: number;
  1704. x2: number;
  1705. y2: number;
  1706. percent: number;
  1707. }
  1708. interface LineProps extends PathProps {
  1709. shape?: Partial<LineShape>;
  1710. }
  1711. declare class Line extends Path<LineProps> {
  1712. shape: LineShape;
  1713. constructor(opts?: LineProps);
  1714. getDefaultStyle(): {
  1715. stroke: string;
  1716. fill: string;
  1717. };
  1718. getDefaultShape(): LineShape;
  1719. buildPath(ctx: CanvasRenderingContext2D, shape: LineShape): void;
  1720. pointAt(p: number): VectorArray;
  1721. }
  1722. declare class BezierCurveShape {
  1723. x1: number;
  1724. y1: number;
  1725. x2: number;
  1726. y2: number;
  1727. cpx1: number;
  1728. cpy1: number;
  1729. cpx2?: number;
  1730. cpy2?: number;
  1731. percent: number;
  1732. }
  1733. interface BezierCurveProps extends PathProps {
  1734. shape?: Partial<BezierCurveShape>;
  1735. }
  1736. declare class BezierCurve extends Path<BezierCurveProps> {
  1737. shape: BezierCurveShape;
  1738. constructor(opts?: BezierCurveProps);
  1739. getDefaultStyle(): {
  1740. stroke: string;
  1741. fill: string;
  1742. };
  1743. getDefaultShape(): BezierCurveShape;
  1744. buildPath(ctx: CanvasRenderingContext2D, shape: BezierCurveShape): void;
  1745. pointAt(t: number): number[];
  1746. tangentAt(t: number): number[];
  1747. }
  1748. declare class ArcShape {
  1749. cx: number;
  1750. cy: number;
  1751. r: number;
  1752. startAngle: number;
  1753. endAngle: number;
  1754. clockwise?: boolean;
  1755. }
  1756. interface ArcProps extends PathProps {
  1757. shape?: Partial<ArcShape>;
  1758. }
  1759. declare class Arc extends Path<ArcProps> {
  1760. shape: ArcShape;
  1761. constructor(opts?: ArcProps);
  1762. getDefaultStyle(): {
  1763. stroke: string;
  1764. fill: string;
  1765. };
  1766. getDefaultShape(): ArcShape;
  1767. buildPath(ctx: CanvasRenderingContext2D, shape: ArcShape): void;
  1768. }
  1769. interface CompoundPathShape {
  1770. paths: Path[];
  1771. }
  1772. declare class CompoundPath extends Path {
  1773. type: string;
  1774. shape: CompoundPathShape;
  1775. private _updatePathDirty;
  1776. beforeBrush(): void;
  1777. buildPath(ctx: PathProxy | CanvasRenderingContext2D, shape: CompoundPathShape): void;
  1778. afterBrush(): void;
  1779. getBoundingRect(): BoundingRect;
  1780. }
  1781. declare class IncrementalDisplayable extends Displayable {
  1782. notClear: boolean;
  1783. incremental: boolean;
  1784. private _displayables;
  1785. private _temporaryDisplayables;
  1786. private _cursor;
  1787. traverse<T>(cb: (this: T, el: this) => void, context: T): void;
  1788. useStyle(): void;
  1789. getCursor(): number;
  1790. innerAfterBrush(): void;
  1791. clearDisplaybles(): void;
  1792. clearTemporalDisplayables(): void;
  1793. addDisplayable(displayable: Displayable, notPersistent?: boolean): void;
  1794. addDisplayables(displayables: Displayable[], notPersistent?: boolean): void;
  1795. getDisplayables(): Displayable[];
  1796. getTemporalDisplayables(): Displayable[];
  1797. eachPendingDisplayable(cb: (displayable: Displayable) => void): void;
  1798. update(): void;
  1799. getBoundingRect(): BoundingRect;
  1800. contain(x: number, y: number): boolean;
  1801. }
  1802. declare type Constructor = new (...args: any) => any;
  1803. interface ClassManager {
  1804. registerClass: (clz: Constructor) => Constructor;
  1805. getClass: (componentMainType: ComponentMainType, subType?: ComponentSubType, throwWhenNotFound?: boolean) => Constructor;
  1806. getClassesByMainType: (componentType: ComponentMainType) => Constructor[];
  1807. hasClass: (componentType: ComponentFullType) => boolean;
  1808. getAllClassMainTypes: () => ComponentMainType[];
  1809. hasSubTypes: (componentType: ComponentFullType) => boolean;
  1810. }
  1811. interface SubTypeDefaulter {
  1812. (option: ComponentOption): ComponentSubType;
  1813. }
  1814. interface SubTypeDefaulterManager {
  1815. registerSubTypeDefaulter: (componentType: string, defaulter: SubTypeDefaulter) => void;
  1816. determineSubType: (componentType: string, option: ComponentOption) => string;
  1817. }
  1818. declare type DiffKeyGetter<CTX = unknown> = (this: DataDiffer<CTX>, value: unknown, index: number) => string;
  1819. declare type DiffCallbackAdd = (newIndex: number) => void;
  1820. declare type DiffCallbackUpdate = (newIndex: number, oldIndex: number) => void;
  1821. declare type DiffCallbackRemove = (oldIndex: number) => void;
  1822. declare type DiffCallbackUpdateManyToOne = (newIndex: number, oldIndex: number[]) => void;
  1823. declare type DiffCallbackUpdateOneToMany = (newIndex: number[], oldIndex: number) => void;
  1824. declare type DiffCallbackUpdateManyToMany = (newIndex: number[], oldIndex: number[]) => void;
  1825. declare type DataDiffMode = 'oneToOne' | 'multiple';
  1826. declare class DataDiffer<CTX = unknown> {
  1827. private _old;
  1828. private _new;
  1829. private _oldKeyGetter;
  1830. private _newKeyGetter;
  1831. private _add;
  1832. private _update;
  1833. private _updateManyToOne;
  1834. private _updateOneToMany;
  1835. private _updateManyToMany;
  1836. private _remove;
  1837. private _diffModeMultiple;
  1838. readonly context: CTX;
  1839. /**
  1840. * @param context Can be visited by this.context in callback.
  1841. */
  1842. constructor(oldArr: ArrayLike$1<unknown>, newArr: ArrayLike$1<unknown>, oldKeyGetter?: DiffKeyGetter<CTX>, newKeyGetter?: DiffKeyGetter<CTX>, context?: CTX, diffMode?: DataDiffMode);
  1843. /**
  1844. * Callback function when add a data
  1845. */
  1846. add(func: DiffCallbackAdd): this;
  1847. /**
  1848. * Callback function when update a data
  1849. */
  1850. update(func: DiffCallbackUpdate): this;
  1851. /**
  1852. * Callback function when update a data and only work in `cbMode: 'byKey'`.
  1853. */
  1854. updateManyToOne(func: DiffCallbackUpdateManyToOne): this;
  1855. /**
  1856. * Callback function when update a data and only work in `cbMode: 'byKey'`.
  1857. */
  1858. updateOneToMany(func: DiffCallbackUpdateOneToMany): this;
  1859. /**
  1860. * Callback function when update a data and only work in `cbMode: 'byKey'`.
  1861. */
  1862. updateManyToMany(func: DiffCallbackUpdateManyToMany): this;
  1863. /**
  1864. * Callback function when remove a data
  1865. */
  1866. remove(func: DiffCallbackRemove): this;
  1867. execute(): void;
  1868. private _executeOneToOne;
  1869. /**
  1870. * For example, consider the case:
  1871. * oldData: [o0, o1, o2, o3, o4, o5, o6, o7],
  1872. * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8],
  1873. * Where:
  1874. * o0, o1, n0 has key 'a' (many to one)
  1875. * o5, n4, n5, n6 has key 'b' (one to many)
  1876. * o2, n1 has key 'c' (one to one)
  1877. * n2, n3 has key 'd' (add)
  1878. * o3, o4 has key 'e' (remove)
  1879. * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove)
  1880. * Then:
  1881. * (The order of the following directives are not ensured.)
  1882. * this._updateManyToOne(n0, [o0, o1]);
  1883. * this._updateOneToMany([n4, n5, n6], o5);
  1884. * this._update(n1, o2);
  1885. * this._remove(o3);
  1886. * this._remove(o4);
  1887. * this._remove(o6);
  1888. * this._remove(o7);
  1889. * this._add(n2);
  1890. * this._add(n3);
  1891. * this._add(n7);
  1892. * this._add(n8);
  1893. */
  1894. private _executeMultiple;
  1895. private _performRestAdd;
  1896. private _initIndexMap;
  1897. }
  1898. declare type PipedDataTransformOption = DataTransformOption[];
  1899. declare type DataTransformType = string;
  1900. declare type DataTransformConfig = unknown;
  1901. interface DataTransformOption {
  1902. type: DataTransformType;
  1903. config?: DataTransformConfig;
  1904. print?: boolean;
  1905. }
  1906. interface ExternalDataTransform<TO extends DataTransformOption = DataTransformOption> {
  1907. type: string;
  1908. __isBuiltIn?: boolean;
  1909. transform: (param: ExternalDataTransformParam<TO>) => ExternalDataTransformResultItem | ExternalDataTransformResultItem[];
  1910. }
  1911. interface ExternalDataTransformParam<TO extends DataTransformOption = DataTransformOption> {
  1912. upstream: ExternalSource;
  1913. upstreamList: ExternalSource[];
  1914. config: TO['config'];
  1915. }
  1916. interface ExternalDataTransformResultItem {
  1917. /**
  1918. * If `data` is null/undefined, inherit upstream data.
  1919. */
  1920. data: OptionSourceDataArrayRows | OptionSourceDataObjectRows;
  1921. /**
  1922. * A `transform` can optionally return a dimensions definition.
  1923. * The rule:
  1924. * If this `transform result` have different dimensions from the upstream, it should return
  1925. * a new dimension definition. For example, this transform inherit the upstream data totally
  1926. * but add a extra dimension.
  1927. * Otherwise, do not need to return that dimension definition. echarts will inherit dimension
  1928. * definition from the upstream.
  1929. */
  1930. dimensions?: DimensionDefinitionLoose[];
  1931. }
  1932. declare type DataTransformDataItem = ExternalDataTransformResultItem['data'][number];
  1933. interface ExternalDimensionDefinition extends Partial<DimensionDefinition> {
  1934. index: DimensionIndex;
  1935. }
  1936. /**
  1937. * TODO: disable writable.
  1938. * This structure will be exposed to users.
  1939. */
  1940. declare class ExternalSource {
  1941. /**
  1942. * [Caveat]
  1943. * This instance is to be exposed to users.
  1944. * (1) DO NOT mount private members on this instance directly.
  1945. * If we have to use private members, we can make them in closure or use `makeInner`.
  1946. * (2) "source header count" is not provided to transform, because it's complicated to manage
  1947. * header and dimensions definition in each transform. Source headers are all normalized to
  1948. * dimensions definitions in transforms and their downstreams.
  1949. */
  1950. sourceFormat: SourceFormat;
  1951. getRawData(): Source['data'];
  1952. getRawDataItem(dataIndex: number): DataTransformDataItem;
  1953. cloneRawData(): Source['data'];
  1954. /**
  1955. * @return If dimension not found, return null/undefined.
  1956. */
  1957. getDimensionInfo(dim: DimensionLoose): ExternalDimensionDefinition;
  1958. /**
  1959. * dimensions defined if and only if either:
  1960. * (a) dataset.dimensions are declared.
  1961. * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`).
  1962. * If dimensions are defined, `dimensionInfoAll` is corresponding to
  1963. * the defined dimensions.
  1964. * Otherwise, `dimensionInfoAll` is determined by data columns.
  1965. * @return Always return an array (even empty array).
  1966. */
  1967. cloneAllDimensionInfo(): ExternalDimensionDefinition[];
  1968. count(): number;
  1969. /**
  1970. * Only support by dimension index.
  1971. * No need to support by dimension name in transform function,
  1972. * because transform function is not case-specific, no need to use name literally.
  1973. */
  1974. retrieveValue(dataIndex: number, dimIndex: DimensionIndex): OptionDataValue;
  1975. retrieveValueFromItem(dataItem: DataTransformDataItem, dimIndex: DimensionIndex): OptionDataValue;
  1976. convertValue(rawVal: unknown, dimInfo: ExternalDimensionDefinition): ParsedValue;
  1977. }
  1978. declare function registerExternalTransform(externalTransform: ExternalDataTransform): void;
  1979. interface PaletteMixin<T extends PaletteOptionMixin = PaletteOptionMixin> extends Pick<Model<T>, 'get'> {
  1980. }
  1981. declare class PaletteMixin<T extends PaletteOptionMixin = PaletteOptionMixin> {
  1982. getColorFromPalette(this: PaletteMixin<T>, name: string, scope?: any, requestNum?: number): ZRColor;
  1983. clearColorPalette(this: PaletteMixin<T>): void;
  1984. }
  1985. interface ComponentView {
  1986. /**
  1987. * Implement it if needed.
  1988. */
  1989. updateTransform?(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void | {
  1990. update: true;
  1991. };
  1992. /**
  1993. * Pass only when return `true`.
  1994. * Implement it if needed.
  1995. */
  1996. filterForExposedEvent(eventType: string, query: EventQueryItem, targetEl: Element, packedEvent: ECActionEvent | ECElementEvent): boolean;
  1997. /**
  1998. * Find dispatchers for highlight/downplay by name.
  1999. * If this methods provided, hover link (within the same name) is enabled in component.
  2000. * That is, in component, a name can correspond to multiple dispatchers.
  2001. * Those dispatchers can have no common ancestor.
  2002. * The highlight/downplay state change will be applied on the
  2003. * dispatchers and their descendents.
  2004. *
  2005. * @return Must return an array but not null/undefined.
  2006. */
  2007. findHighDownDispatchers?(name: string): Element[];
  2008. focusBlurEnabled?: boolean;
  2009. }
  2010. declare class ComponentView {
  2011. readonly group: ViewRootGroup;
  2012. readonly uid: string;
  2013. __model: ComponentModel;
  2014. __alive: boolean;
  2015. __id: string;
  2016. constructor();
  2017. init(ecModel: GlobalModel, api: ExtensionAPI): void;
  2018. render(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2019. dispose(ecModel: GlobalModel, api: ExtensionAPI): void;
  2020. updateView(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2021. updateLayout(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2022. updateVisual(model: ComponentModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2023. /**
  2024. * Hook for toggle blur target series.
  2025. * Can be used in marker for blur or leave blur the markers
  2026. */
  2027. toggleBlurSeries(seriesModels: SeriesModel[], isBlur: boolean, ecModel: GlobalModel): void;
  2028. /**
  2029. * Traverse the new rendered elements.
  2030. *
  2031. * It will traverse the new added element in progressive rendering.
  2032. * And traverse all in normal rendering.
  2033. */
  2034. eachRendered(cb: (el: Element) => boolean | void): void;
  2035. static registerClass: ClassManager['registerClass'];
  2036. }
  2037. interface TaskContext {
  2038. outputData?: SeriesData;
  2039. data?: SeriesData;
  2040. payload?: Payload;
  2041. model?: SeriesModel;
  2042. }
  2043. declare type TaskResetCallback<Ctx extends TaskContext> = (this: Task<Ctx>, context: Ctx) => TaskResetCallbackReturn<Ctx>;
  2044. declare type TaskResetCallbackReturn<Ctx extends TaskContext> = void | (TaskProgressCallback<Ctx> | TaskProgressCallback<Ctx>[]) | {
  2045. forceFirstProgress?: boolean;
  2046. progress: TaskProgressCallback<Ctx> | TaskProgressCallback<Ctx>[];
  2047. };
  2048. declare type TaskProgressCallback<Ctx extends TaskContext> = (this: Task<Ctx>, params: TaskProgressParams, context: Ctx) => void;
  2049. declare type TaskProgressParams = {
  2050. start: number;
  2051. end: number;
  2052. count: number;
  2053. next?: TaskDataIteratorNext;
  2054. };
  2055. declare type TaskPlanCallback<Ctx extends TaskContext> = (this: Task<Ctx>, context: Ctx) => TaskPlanCallbackReturn;
  2056. declare type TaskPlanCallbackReturn = 'reset' | false | null | undefined;
  2057. declare type TaskCountCallback<Ctx extends TaskContext> = (this: Task<Ctx>, context: Ctx) => number;
  2058. declare type TaskOnDirtyCallback<Ctx extends TaskContext> = (this: Task<Ctx>, context: Ctx) => void;
  2059. declare type TaskDataIteratorNext = () => number;
  2060. declare type TaskDefineParam<Ctx extends TaskContext> = {
  2061. reset?: TaskResetCallback<Ctx>;
  2062. plan?: TaskPlanCallback<Ctx>;
  2063. count?: TaskCountCallback<Ctx>;
  2064. onDirty?: TaskOnDirtyCallback<Ctx>;
  2065. };
  2066. declare type PerformArgs = {
  2067. step?: number;
  2068. skip?: boolean;
  2069. modBy?: number;
  2070. modDataCount?: number;
  2071. };
  2072. declare class Task<Ctx extends TaskContext> {
  2073. private _reset;
  2074. private _plan;
  2075. private _count;
  2076. private _onDirty;
  2077. private _progress;
  2078. private _callingProgress;
  2079. private _dirty;
  2080. private _modBy;
  2081. private _modDataCount;
  2082. private _upstream;
  2083. private _downstream;
  2084. private _dueEnd;
  2085. private _outputDueEnd;
  2086. private _settedOutputEnd;
  2087. private _dueIndex;
  2088. private _disposed;
  2089. __pipeline: Pipeline;
  2090. __idxInPipeline: number;
  2091. __block: boolean;
  2092. context: Ctx;
  2093. constructor(define: TaskDefineParam<Ctx>);
  2094. /**
  2095. * @param step Specified step.
  2096. * @param skip Skip customer perform call.
  2097. * @param modBy Sampling window size.
  2098. * @param modDataCount Sampling count.
  2099. * @return whether unfinished.
  2100. */
  2101. perform(performArgs?: PerformArgs): boolean;
  2102. dirty(): void;
  2103. private _doProgress;
  2104. private _doReset;
  2105. unfinished(): boolean;
  2106. /**
  2107. * @param downTask The downstream task.
  2108. * @return The downstream task.
  2109. */
  2110. pipe(downTask: Task<Ctx>): void;
  2111. dispose(): void;
  2112. getUpstream(): Task<Ctx>;
  2113. getDownstream(): Task<Ctx>;
  2114. setOutputEnd(end: number): void;
  2115. }
  2116. declare type GeneralTask = Task<TaskContext>;
  2117. declare type SeriesTask = Task<SeriesTaskContext>;
  2118. declare type Pipeline = {
  2119. id: string;
  2120. head: GeneralTask;
  2121. tail: GeneralTask;
  2122. threshold: number;
  2123. progressiveEnabled: boolean;
  2124. blockIndex: number;
  2125. step: number;
  2126. count: number;
  2127. currentTask?: GeneralTask;
  2128. context?: PipelineContext;
  2129. };
  2130. declare type PipelineContext = {
  2131. progressiveRender: boolean;
  2132. modDataCount: number;
  2133. large: boolean;
  2134. };
  2135. declare type PerformStageTaskOpt = {
  2136. block?: boolean;
  2137. setDirty?: boolean;
  2138. visualType?: StageHandlerInternal['visualType'];
  2139. dirtyMap?: HashMap<any>;
  2140. };
  2141. interface SeriesTaskContext extends TaskContext {
  2142. model?: SeriesModel;
  2143. data?: SeriesData;
  2144. view?: ChartView;
  2145. ecModel?: GlobalModel;
  2146. api?: ExtensionAPI;
  2147. useClearVisual?: boolean;
  2148. plan?: StageHandlerPlan;
  2149. reset?: StageHandlerReset;
  2150. scheduler?: Scheduler;
  2151. payload?: Payload;
  2152. resetDefines?: StageHandlerProgressExecutor[];
  2153. }
  2154. interface OverallTaskContext extends TaskContext {
  2155. ecModel: GlobalModel;
  2156. api: ExtensionAPI;
  2157. overallReset: StageHandlerOverallReset;
  2158. scheduler: Scheduler;
  2159. payload?: Payload;
  2160. }
  2161. declare class Scheduler {
  2162. readonly ecInstance: EChartsType;
  2163. readonly api: ExtensionAPI;
  2164. unfinished: boolean;
  2165. private _dataProcessorHandlers;
  2166. private _visualHandlers;
  2167. private _allHandlers;
  2168. private _stageTaskMap;
  2169. private _pipelineMap;
  2170. constructor(ecInstance: EChartsType, api: ExtensionAPI, dataProcessorHandlers: StageHandlerInternal[], visualHandlers: StageHandlerInternal[]);
  2171. restoreData(ecModel: GlobalModel, payload: Payload): void;
  2172. getPerformArgs(task: GeneralTask, isBlock?: boolean): {
  2173. step: number;
  2174. modBy: number;
  2175. modDataCount: number;
  2176. };
  2177. getPipeline(pipelineId: string): Pipeline;
  2178. /**
  2179. * Current, progressive rendering starts from visual and layout.
  2180. * Always detect render mode in the same stage, avoiding that incorrect
  2181. * detection caused by data filtering.
  2182. * Caution:
  2183. * `updateStreamModes` use `seriesModel.getData()`.
  2184. */
  2185. updateStreamModes(seriesModel: SeriesModel<SeriesOption & SeriesLargeOptionMixin>, view: ChartView): void;
  2186. restorePipelines(ecModel: GlobalModel): void;
  2187. prepareStageTasks(): void;
  2188. prepareView(view: ChartView, model: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI): void;
  2189. performDataProcessorTasks(ecModel: GlobalModel, payload?: Payload): void;
  2190. performVisualTasks(ecModel: GlobalModel, payload?: Payload, opt?: PerformStageTaskOpt): void;
  2191. private _performStageTasks;
  2192. performSeriesTasks(ecModel: GlobalModel): void;
  2193. plan(): void;
  2194. updatePayload(task: Task<SeriesTaskContext | OverallTaskContext>, payload: Payload | 'remain'): void;
  2195. private _createSeriesStageTask;
  2196. private _createOverallStageTask;
  2197. private _pipe;
  2198. static wrapStageHandler(stageHandler: StageHandler | StageHandlerOverallReset, visualType: StageHandlerInternal['visualType']): StageHandlerInternal;
  2199. }
  2200. interface ChartView {
  2201. /**
  2202. * Rendering preparation in progressive mode.
  2203. * Implement it if needed.
  2204. */
  2205. incrementalPrepareRender(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2206. /**
  2207. * Render in progressive mode.
  2208. * Implement it if needed.
  2209. * @param params See taskParams in `stream/task.js`
  2210. */
  2211. incrementalRender(params: StageHandlerProgressParams, seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2212. /**
  2213. * Update transform directly.
  2214. * Implement it if needed.
  2215. */
  2216. updateTransform(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void | {
  2217. update: true;
  2218. };
  2219. /**
  2220. * The view contains the given point.
  2221. * Implement it if needed.
  2222. */
  2223. containPoint(point: number[], seriesModel: SeriesModel): boolean;
  2224. /**
  2225. * Pass only when return `true`.
  2226. * Implement it if needed.
  2227. */
  2228. filterForExposedEvent(eventType: string, query: EventQueryItem, targetEl: Element, packedEvent: ECActionEvent | ECElementEvent): boolean;
  2229. }
  2230. declare class ChartView {
  2231. type: string;
  2232. readonly group: ViewRootGroup;
  2233. readonly uid: string;
  2234. readonly renderTask: SeriesTask;
  2235. /**
  2236. * Ignore label line update in global stage. Will handle it in chart itself.
  2237. * Used in pie / funnel
  2238. */
  2239. ignoreLabelLineUpdate: boolean;
  2240. __alive: boolean;
  2241. __model: SeriesModel;
  2242. __id: string;
  2243. static protoInitialize: void;
  2244. constructor();
  2245. init(ecModel: GlobalModel, api: ExtensionAPI): void;
  2246. render(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2247. /**
  2248. * Highlight series or specified data item.
  2249. */
  2250. highlight(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2251. /**
  2252. * Downplay series or specified data item.
  2253. */
  2254. downplay(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2255. /**
  2256. * Remove self.
  2257. */
  2258. remove(ecModel: GlobalModel, api: ExtensionAPI): void;
  2259. /**
  2260. * Dispose self.
  2261. */
  2262. dispose(ecModel: GlobalModel, api: ExtensionAPI): void;
  2263. updateView(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2264. updateLayout(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2265. updateVisual(seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload): void;
  2266. /**
  2267. * Traverse the new rendered elements.
  2268. *
  2269. * It will traverse the new added element in progressive rendering.
  2270. * And traverse all in normal rendering.
  2271. */
  2272. eachRendered(cb: (el: Element) => boolean | void): void;
  2273. static markUpdateMethod(payload: Payload, methodName: keyof ChartView): void;
  2274. static registerClass: ClassManager['registerClass'];
  2275. }
  2276. declare const availableMethods: (keyof EChartsType)[];
  2277. interface ExtensionAPI extends Pick<EChartsType, (typeof availableMethods)[number]> {
  2278. }
  2279. declare abstract class ExtensionAPI {
  2280. constructor(ecInstance: EChartsType);
  2281. abstract getCoordinateSystems(): CoordinateSystemMaster[];
  2282. abstract getComponentByElement(el: Element): ComponentModel;
  2283. abstract enterEmphasis(el: Element, highlightDigit?: number): void;
  2284. abstract leaveEmphasis(el: Element, highlightDigit?: number): void;
  2285. abstract enterSelect(el: Element): void;
  2286. abstract leaveSelect(el: Element): void;
  2287. abstract enterBlur(el: Element): void;
  2288. abstract leaveBlur(el: Element): void;
  2289. abstract getViewOfComponentModel(componentModel: ComponentModel): ComponentView;
  2290. abstract getViewOfSeriesModel(seriesModel: SeriesModel): ChartView;
  2291. abstract getModel(): GlobalModel;
  2292. }
  2293. declare const AXIS_TYPES: {
  2294. readonly value: 1;
  2295. readonly category: 1;
  2296. readonly time: 1;
  2297. readonly log: 1;
  2298. };
  2299. declare type OptionAxisType = keyof typeof AXIS_TYPES;
  2300. interface AxisBaseOptionCommon extends ComponentOption, AnimationOptionMixin {
  2301. type?: OptionAxisType;
  2302. show?: boolean;
  2303. inverse?: boolean;
  2304. name?: string;
  2305. nameLocation?: 'start' | 'middle' | 'end';
  2306. nameRotate?: number;
  2307. nameTruncate?: {
  2308. maxWidth?: number;
  2309. ellipsis?: string;
  2310. placeholder?: string;
  2311. };
  2312. nameTextStyle?: AxisNameTextStyleOption;
  2313. nameGap?: number;
  2314. silent?: boolean;
  2315. triggerEvent?: boolean;
  2316. tooltip?: {
  2317. show?: boolean;
  2318. };
  2319. axisLabel?: AxisLabelBaseOption;
  2320. axisPointer?: CommonAxisPointerOption;
  2321. axisLine?: AxisLineOption;
  2322. axisTick?: AxisTickOption;
  2323. minorTick?: MinorTickOption;
  2324. splitLine?: SplitLineOption;
  2325. minorSplitLine?: MinorSplitLineOption;
  2326. splitArea?: SplitAreaOption;
  2327. /**
  2328. * Min value of the axis. can be:
  2329. * + ScaleDataValue
  2330. * + 'dataMin': use the min value in data.
  2331. * + null/undefined: auto decide min value (consider pretty look and boundaryGap).
  2332. */
  2333. min?: ScaleDataValue | 'dataMin' | ((extent: {
  2334. min: number;
  2335. max: number;
  2336. }) => ScaleDataValue);
  2337. /**
  2338. * Max value of the axis. can be:
  2339. * + ScaleDataValue
  2340. * + 'dataMax': use the max value in data.
  2341. * + null/undefined: auto decide max value (consider pretty look and boundaryGap).
  2342. */
  2343. max?: ScaleDataValue | 'dataMax' | ((extent: {
  2344. min: number;
  2345. max: number;
  2346. }) => ScaleDataValue);
  2347. }
  2348. interface NumericAxisBaseOptionCommon extends AxisBaseOptionCommon {
  2349. boundaryGap?: [number | string, number | string];
  2350. /**
  2351. * AxisTick and axisLabel and splitLine are calculated based on splitNumber.
  2352. */
  2353. splitNumber?: number;
  2354. /**
  2355. * Interval specifies the span of the ticks is mandatorily.
  2356. */
  2357. interval?: number;
  2358. /**
  2359. * Specify min interval when auto calculate tick interval.
  2360. */
  2361. minInterval?: number;
  2362. /**
  2363. * Specify max interval when auto calculate tick interval.
  2364. */
  2365. maxInterval?: number;
  2366. /**
  2367. * If align ticks to the first axis that is not use alignTicks
  2368. * If all axes has alignTicks: true. The first one will be applied.
  2369. *
  2370. * Will be ignored if interval is set.
  2371. */
  2372. alignTicks?: boolean;
  2373. }
  2374. interface CategoryAxisBaseOption extends AxisBaseOptionCommon {
  2375. type?: 'category';
  2376. boundaryGap?: boolean;
  2377. axisLabel?: AxisLabelOption<'category'> & {
  2378. interval?: 'auto' | number | ((index: number, value: string) => boolean);
  2379. };
  2380. data?: (OrdinalRawValue | {
  2381. value: OrdinalRawValue;
  2382. textStyle?: TextCommonOption;
  2383. })[];
  2384. deduplication?: boolean;
  2385. axisTick?: AxisBaseOptionCommon['axisTick'] & {
  2386. alignWithLabel?: boolean;
  2387. interval?: 'auto' | number | ((index: number, value: string) => boolean);
  2388. };
  2389. }
  2390. interface ValueAxisBaseOption extends NumericAxisBaseOptionCommon {
  2391. type?: 'value';
  2392. axisLabel?: AxisLabelOption<'value'>;
  2393. /**
  2394. * Optional value can be:
  2395. * + `false`: always include value 0.
  2396. * + `false`: always include value 0.
  2397. */
  2398. scale?: boolean;
  2399. }
  2400. interface LogAxisBaseOption extends NumericAxisBaseOptionCommon {
  2401. type?: 'log';
  2402. axisLabel?: AxisLabelOption<'log'>;
  2403. logBase?: number;
  2404. }
  2405. interface TimeAxisBaseOption extends NumericAxisBaseOptionCommon {
  2406. type?: 'time';
  2407. axisLabel?: AxisLabelOption<'time'>;
  2408. }
  2409. interface AxisNameTextStyleOption extends TextCommonOption {
  2410. rich?: Dictionary<TextCommonOption>;
  2411. }
  2412. interface AxisLineOption {
  2413. show?: boolean | 'auto';
  2414. onZero?: boolean;
  2415. onZeroAxisIndex?: number;
  2416. symbol?: string | [string, string];
  2417. symbolSize?: number[];
  2418. symbolOffset?: string | number | (string | number)[];
  2419. lineStyle?: LineStyleOption;
  2420. }
  2421. interface AxisTickOption {
  2422. show?: boolean | 'auto';
  2423. inside?: boolean;
  2424. length?: number;
  2425. lineStyle?: LineStyleOption;
  2426. }
  2427. declare type AxisLabelValueFormatter = (value: number, index: number) => string;
  2428. declare type AxisLabelCategoryFormatter = (value: string, index: number) => string;
  2429. declare type TimeAxisLabelUnitFormatter = AxisLabelValueFormatter | string[] | string;
  2430. declare type TimeAxisLabelFormatterOption = string | ((value: number, index: number, extra: {
  2431. level: number;
  2432. }) => string) | {
  2433. year?: TimeAxisLabelUnitFormatter;
  2434. month?: TimeAxisLabelUnitFormatter;
  2435. week?: TimeAxisLabelUnitFormatter;
  2436. day?: TimeAxisLabelUnitFormatter;
  2437. hour?: TimeAxisLabelUnitFormatter;
  2438. minute?: TimeAxisLabelUnitFormatter;
  2439. second?: TimeAxisLabelUnitFormatter;
  2440. millisecond?: TimeAxisLabelUnitFormatter;
  2441. inherit?: boolean;
  2442. };
  2443. declare type LabelFormatters = {
  2444. value: AxisLabelValueFormatter | string;
  2445. log: AxisLabelValueFormatter | string;
  2446. category: AxisLabelCategoryFormatter | string;
  2447. time: TimeAxisLabelFormatterOption;
  2448. };
  2449. interface AxisLabelBaseOption extends Omit<TextCommonOption, 'color'> {
  2450. show?: boolean;
  2451. inside?: boolean;
  2452. rotate?: number;
  2453. showMinLabel?: boolean;
  2454. showMaxLabel?: boolean;
  2455. margin?: number;
  2456. rich?: Dictionary<TextCommonOption>;
  2457. /**
  2458. * If hide overlapping labels.
  2459. */
  2460. hideOverlap?: boolean;
  2461. color?: ColorString | ((value?: string | number, index?: number) => ColorString);
  2462. overflow?: TextStyleProps['overflow'];
  2463. }
  2464. interface AxisLabelOption<TType extends OptionAxisType> extends AxisLabelBaseOption {
  2465. formatter?: LabelFormatters[TType];
  2466. }
  2467. interface MinorTickOption {
  2468. show?: boolean;
  2469. splitNumber?: number;
  2470. length?: number;
  2471. lineStyle?: LineStyleOption;
  2472. }
  2473. interface SplitLineOption {
  2474. show?: boolean;
  2475. interval?: 'auto' | number | ((index: number, value: string) => boolean);
  2476. lineStyle?: LineStyleOption<ZRColor | ZRColor[]>;
  2477. }
  2478. interface MinorSplitLineOption {
  2479. show?: boolean;
  2480. lineStyle?: LineStyleOption;
  2481. }
  2482. interface SplitAreaOption {
  2483. show?: boolean;
  2484. interval?: 'auto' | number | ((index: number, value: string) => boolean);
  2485. areaStyle?: AreaStyleOption<ZRColor[]>;
  2486. }
  2487. declare type AxisBaseOption = ValueAxisBaseOption | LogAxisBaseOption | CategoryAxisBaseOption | TimeAxisBaseOption | AxisBaseOptionCommon;
  2488. interface AxisModelCommonMixin<Opt extends AxisBaseOption> extends Pick<Model<Opt>, 'option'> {
  2489. axis: Axis;
  2490. }
  2491. declare class AxisModelCommonMixin<Opt extends AxisBaseOption> {
  2492. getNeedCrossZero(): boolean;
  2493. /**
  2494. * Should be implemented by each axis model if necessary.
  2495. * @return coordinate system model
  2496. */
  2497. getCoordSysModel(): CoordinateSystemHostModel;
  2498. }
  2499. declare class OrdinalMeta {
  2500. readonly categories: OrdinalRawValue[];
  2501. private _needCollect;
  2502. private _deduplication;
  2503. private _map;
  2504. readonly uid: number;
  2505. constructor(opt: {
  2506. categories?: OrdinalRawValue[];
  2507. needCollect?: boolean;
  2508. deduplication?: boolean;
  2509. });
  2510. static createByAxisModel(axisModel: Model): OrdinalMeta;
  2511. getOrdinal(category: OrdinalRawValue): OrdinalNumber;
  2512. /**
  2513. * @return The ordinal. If not found, return NaN.
  2514. */
  2515. parseAndCollect(category: OrdinalRawValue | OrdinalNumber): OrdinalNumber;
  2516. private _getOrCreateMap;
  2517. }
  2518. declare function registerImpl(name: string, impl: any): void;
  2519. declare const extensionRegisters: {
  2520. registerPreprocessor: typeof registerPreprocessor;
  2521. registerProcessor: typeof registerProcessor;
  2522. registerPostInit: typeof registerPostInit;
  2523. registerPostUpdate: typeof registerPostUpdate;
  2524. registerUpdateLifecycle: typeof registerUpdateLifecycle;
  2525. registerAction: typeof registerAction;
  2526. registerCoordinateSystem: typeof registerCoordinateSystem;
  2527. registerLayout: typeof registerLayout;
  2528. registerVisual: typeof registerVisual;
  2529. registerTransform: typeof registerExternalTransform;
  2530. registerLoading: typeof registerLoading;
  2531. registerMap: typeof registerMap;
  2532. registerImpl: typeof registerImpl;
  2533. PRIORITY: {
  2534. PROCESSOR: {
  2535. FILTER: number;
  2536. SERIES_FILTER: number;
  2537. STATISTIC: number;
  2538. };
  2539. VISUAL: {
  2540. LAYOUT: number;
  2541. PROGRESSIVE_LAYOUT: number;
  2542. GLOBAL: number;
  2543. CHART: number;
  2544. POST_CHART_LAYOUT: number;
  2545. COMPONENT: number;
  2546. BRUSH: number;
  2547. CHART_ITEM: number;
  2548. ARIA: number;
  2549. DECAL: number;
  2550. };
  2551. };
  2552. ComponentModel: typeof ComponentModel;
  2553. ComponentView: typeof ComponentView;
  2554. SeriesModel: typeof SeriesModel;
  2555. ChartView: typeof ChartView;
  2556. registerComponentModel(ComponentModelClass: Constructor): void;
  2557. registerComponentView(ComponentViewClass: typeof ComponentView): void;
  2558. registerSeriesModel(SeriesModelClass: Constructor): void;
  2559. registerChartView(ChartViewClass: typeof ChartView): void;
  2560. registerSubTypeDefaulter(componentType: string, defaulter: SubTypeDefaulter): void;
  2561. registerPainter(painterType: string, PainterCtor: Parameters<typeof registerPainter>[1]): void;
  2562. };
  2563. declare type EChartsExtensionInstallRegisters = typeof extensionRegisters;
  2564. declare type EChartsExtensionInstaller = (ec: EChartsExtensionInstallRegisters) => void;
  2565. interface EChartsExtension {
  2566. install: EChartsExtensionInstaller;
  2567. }
  2568. declare function use(ext: EChartsExtensionInstaller | EChartsExtension | (EChartsExtensionInstaller | EChartsExtension)[]): void;
  2569. interface AxisModelExtendedInCreator {
  2570. getCategories(rawData?: boolean): OrdinalRawValue[] | CategoryAxisBaseOption['data'];
  2571. getOrdinalMeta(): OrdinalMeta;
  2572. }
  2573. /**
  2574. * Base Axis Model for xAxis, yAxis, angleAxis, radiusAxis. singleAxis
  2575. */
  2576. interface AxisBaseModel<T extends AxisBaseOptionCommon = AxisBaseOptionCommon> extends ComponentModel<T>, AxisModelCommonMixin<T>, AxisModelExtendedInCreator {
  2577. axis: Axis;
  2578. }
  2579. declare function createAxisLabels(axis: Axis): {
  2580. labels: {
  2581. level?: number;
  2582. formattedLabel: string;
  2583. rawLabel: string;
  2584. tickValue: number;
  2585. }[];
  2586. labelCategoryInterval?: number;
  2587. };
  2588. /**
  2589. * Calculate interval for category axis ticks and labels.
  2590. * To get precise result, at least one of `getRotate` and `isHorizontal`
  2591. * should be implemented in axis.
  2592. */
  2593. declare function calculateCategoryInterval(axis: Axis): number;
  2594. interface ScaleRawExtentResult {
  2595. readonly min: number;
  2596. readonly max: number;
  2597. readonly minFixed: boolean;
  2598. readonly maxFixed: boolean;
  2599. readonly isBlank: boolean;
  2600. }
  2601. declare class ScaleRawExtentInfo {
  2602. private _needCrossZero;
  2603. private _isOrdinal;
  2604. private _axisDataLen;
  2605. private _boundaryGapInner;
  2606. private _modelMinRaw;
  2607. private _modelMaxRaw;
  2608. private _modelMinNum;
  2609. private _modelMaxNum;
  2610. private _dataMin;
  2611. private _dataMax;
  2612. private _determinedMin;
  2613. private _determinedMax;
  2614. readonly frozen: boolean;
  2615. constructor(scale: Scale, model: AxisBaseModel, originalExtent: number[]);
  2616. /**
  2617. * Parameters depending on outside (like model, user callback)
  2618. * are prepared and fixed here.
  2619. */
  2620. private _prepareParams;
  2621. /**
  2622. * Calculate extent by prepared parameters.
  2623. * This method has no external dependency and can be called duplicatedly,
  2624. * getting the same result.
  2625. * If parameters changed, should call this method to recalcuate.
  2626. */
  2627. calculate(): ScaleRawExtentResult;
  2628. modifyDataMinMax(minMaxName: 'min' | 'max', val: number): void;
  2629. setDeterminedMinMax(minMaxName: 'min' | 'max', val: number): void;
  2630. freeze(): void;
  2631. }
  2632. declare abstract class Scale<SETTING extends Dictionary<unknown> = Dictionary<unknown>> {
  2633. type: string;
  2634. private _setting;
  2635. protected _extent: [number, number];
  2636. private _isBlank;
  2637. readonly rawExtentInfo: ScaleRawExtentInfo;
  2638. constructor(setting?: SETTING);
  2639. getSetting<KEY extends keyof SETTING>(name: KEY): SETTING[KEY];
  2640. /**
  2641. * Parse input val to valid inner number.
  2642. * Notice: This would be a trap here, If the implementation
  2643. * of this method depends on extent, and this method is used
  2644. * before extent set (like in dataZoom), it would be wrong.
  2645. * Nevertheless, parse does not depend on extent generally.
  2646. */
  2647. abstract parse(val: OptionDataValue): number;
  2648. /**
  2649. * Whether contain the given value.
  2650. */
  2651. abstract contain(val: ScaleDataValue): boolean;
  2652. /**
  2653. * Normalize value to linear [0, 1], return 0.5 if extent span is 0.
  2654. */
  2655. abstract normalize(val: ScaleDataValue): number;
  2656. /**
  2657. * Scale normalized value to extent.
  2658. */
  2659. abstract scale(val: number): number;
  2660. /**
  2661. * Set extent from data
  2662. */
  2663. unionExtent(other: [number, number]): void;
  2664. /**
  2665. * Set extent from data
  2666. */
  2667. unionExtentFromData(data: SeriesData, dim: DimensionName | DimensionLoose): void;
  2668. /**
  2669. * Get extent
  2670. *
  2671. * Extent is always in increase order.
  2672. */
  2673. getExtent(): [number, number];
  2674. /**
  2675. * Set extent
  2676. */
  2677. setExtent(start: number, end: number): void;
  2678. /**
  2679. * If value is in extent range
  2680. */
  2681. isInExtentRange(value: number): boolean;
  2682. /**
  2683. * When axis extent depends on data and no data exists,
  2684. * axis ticks should not be drawn, which is named 'blank'.
  2685. */
  2686. isBlank(): boolean;
  2687. /**
  2688. * When axis extent depends on data and no data exists,
  2689. * axis ticks should not be drawn, which is named 'blank'.
  2690. */
  2691. setBlank(isBlank: boolean): void;
  2692. /**
  2693. * Update interval and extent of intervals for nice ticks
  2694. *
  2695. * @param splitNumber Approximated tick numbers. Optional.
  2696. * The implementation of `niceTicks` should decide tick numbers
  2697. * whether `splitNumber` is given.
  2698. * @param minInterval Optional.
  2699. * @param maxInterval Optional.
  2700. */
  2701. abstract calcNiceTicks(splitNumber?: number, minInterval?: number, maxInterval?: number): void;
  2702. abstract calcNiceExtent(opt?: {
  2703. splitNumber?: number;
  2704. fixMin?: boolean;
  2705. fixMax?: boolean;
  2706. minInterval?: number;
  2707. maxInterval?: number;
  2708. }): void;
  2709. /**
  2710. * @return label of the tick.
  2711. */
  2712. abstract getLabel(tick: ScaleTick): string;
  2713. abstract getTicks(): ScaleTick[];
  2714. abstract getMinorTicks(splitNumber: number): number[][];
  2715. static registerClass: ClassManager['registerClass'];
  2716. static getClass: ClassManager['getClass'];
  2717. }
  2718. interface TickCoord {
  2719. coord: number;
  2720. tickValue?: ScaleTick['value'];
  2721. }
  2722. /**
  2723. * Base class of Axis.
  2724. */
  2725. declare class Axis {
  2726. /**
  2727. * Axis type
  2728. * - 'category'
  2729. * - 'value'
  2730. * - 'time'
  2731. * - 'log'
  2732. */
  2733. type: OptionAxisType;
  2734. readonly dim: DimensionName;
  2735. scale: Scale;
  2736. private _extent;
  2737. model: AxisBaseModel;
  2738. onBand: CategoryAxisBaseOption['boundaryGap'];
  2739. inverse: AxisBaseOption['inverse'];
  2740. constructor(dim: DimensionName, scale: Scale, extent: [number, number]);
  2741. /**
  2742. * If axis extent contain given coord
  2743. */
  2744. contain(coord: number): boolean;
  2745. /**
  2746. * If axis extent contain given data
  2747. */
  2748. containData(data: ScaleDataValue): boolean;
  2749. /**
  2750. * Get coord extent.
  2751. */
  2752. getExtent(): [number, number];
  2753. /**
  2754. * Get precision used for formatting
  2755. */
  2756. getPixelPrecision(dataExtent?: [number, number]): number;
  2757. /**
  2758. * Set coord extent
  2759. */
  2760. setExtent(start: number, end: number): void;
  2761. /**
  2762. * Convert data to coord. Data is the rank if it has an ordinal scale
  2763. */
  2764. dataToCoord(data: ScaleDataValue, clamp?: boolean): number;
  2765. /**
  2766. * Convert coord to data. Data is the rank if it has an ordinal scale
  2767. */
  2768. coordToData(coord: number, clamp?: boolean): number;
  2769. /**
  2770. * Convert pixel point to data in axis
  2771. */
  2772. pointToData(point: number[], clamp?: boolean): number;
  2773. /**
  2774. * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,
  2775. * `axis.getTicksCoords` considers `onBand`, which is used by
  2776. * `boundaryGap:true` of category axis and splitLine and splitArea.
  2777. * @param opt.tickModel default: axis.model.getModel('axisTick')
  2778. * @param opt.clamp If `true`, the first and the last
  2779. * tick must be at the axis end points. Otherwise, clip ticks
  2780. * that outside the axis extent.
  2781. */
  2782. getTicksCoords(opt?: {
  2783. tickModel?: Model;
  2784. clamp?: boolean;
  2785. }): TickCoord[];
  2786. getMinorTicksCoords(): TickCoord[][];
  2787. getViewLabels(): ReturnType<typeof createAxisLabels>['labels'];
  2788. getLabelModel(): Model<AxisBaseOption['axisLabel']>;
  2789. /**
  2790. * Notice here we only get the default tick model. For splitLine
  2791. * or splitArea, we should pass the splitLineModel or splitAreaModel
  2792. * manually when calling `getTicksCoords`.
  2793. * In GL, this method may be overridden to:
  2794. * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`
  2795. */
  2796. getTickModel(): Model;
  2797. /**
  2798. * Get width of band
  2799. */
  2800. getBandWidth(): number;
  2801. /**
  2802. * Get axis rotate, by degree.
  2803. */
  2804. getRotate: () => number;
  2805. /**
  2806. * Only be called in category axis.
  2807. * Can be overridden, consider other axes like in 3D.
  2808. * @return Auto interval for cateogry axis tick and label
  2809. */
  2810. calculateCategoryInterval(): ReturnType<typeof calculateCategoryInterval>;
  2811. }
  2812. declare type MarkerStatisticType = 'average' | 'min' | 'max' | 'median';
  2813. /**
  2814. * Option to specify where to put the marker.
  2815. */
  2816. interface MarkerPositionOption {
  2817. x?: number | string;
  2818. y?: number | string;
  2819. /**
  2820. * Coord on any coordinate system
  2821. */
  2822. coord?: (ScaleDataValue | MarkerStatisticType)[];
  2823. xAxis?: ScaleDataValue;
  2824. yAxis?: ScaleDataValue;
  2825. radiusAxis?: ScaleDataValue;
  2826. angleAxis?: ScaleDataValue;
  2827. type?: MarkerStatisticType;
  2828. /**
  2829. * When using statistic method with type.
  2830. * valueIndex and valueDim can be specify which dim the statistic is used on.
  2831. */
  2832. valueIndex?: number;
  2833. valueDim?: string;
  2834. /**
  2835. * Value to be displayed as label. Totally optional
  2836. */
  2837. value?: string | number;
  2838. }
  2839. interface MarkerOption extends ComponentOption, AnimationOptionMixin {
  2840. silent?: boolean;
  2841. data?: unknown[];
  2842. tooltip?: CommonTooltipOption<unknown> & {
  2843. trigger?: 'item' | 'axis' | boolean | 'none';
  2844. };
  2845. }
  2846. interface MarkAreaStateOption {
  2847. itemStyle?: ItemStyleOption;
  2848. label?: SeriesLabelOption;
  2849. }
  2850. interface MarkAreaDataItemOptionBase extends MarkAreaStateOption, StatesOptionMixin<MarkAreaStateOption, StatesMixinBase> {
  2851. name?: string;
  2852. }
  2853. interface MarkArea1DDataItemOption extends MarkAreaDataItemOptionBase {
  2854. xAxis?: number;
  2855. yAxis?: number;
  2856. type?: MarkerStatisticType;
  2857. valueIndex?: number;
  2858. valueDim?: string;
  2859. }
  2860. interface MarkArea2DDataItemDimOption extends MarkAreaDataItemOptionBase, MarkerPositionOption {
  2861. }
  2862. declare type MarkArea2DDataItemOption = [
  2863. MarkArea2DDataItemDimOption,
  2864. MarkArea2DDataItemDimOption
  2865. ];
  2866. interface MarkAreaOption extends MarkerOption, MarkAreaStateOption, StatesOptionMixin<MarkAreaStateOption, StatesMixinBase> {
  2867. mainType?: 'markArea';
  2868. precision?: number;
  2869. data?: (MarkArea1DDataItemOption | MarkArea2DDataItemOption)[];
  2870. }
  2871. declare const dimPermutations: readonly [readonly ["x0", "y0"], readonly ["x1", "y0"], readonly ["x1", "y1"], readonly ["x0", "y1"]];
  2872. interface BaseBarSeriesOption<StateOption, ExtraStateOption extends StatesMixinBase = DefaultStatesMixin> extends SeriesOption<StateOption, ExtraStateOption>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin {
  2873. /**
  2874. * Min height of bar
  2875. */
  2876. barMinHeight?: number;
  2877. /**
  2878. * Min angle of bar. Available on polar coordinate system.
  2879. */
  2880. barMinAngle?: number;
  2881. /**
  2882. * Max width of bar. Defaults to 1 on cartesian coordinate system. Otherwise it's null.
  2883. */
  2884. barMaxWidth?: number;
  2885. barMinWidth?: number;
  2886. /**
  2887. * Bar width. Will be calculated automatically.
  2888. * Can be pixel width or percent string.
  2889. */
  2890. barWidth?: number | string;
  2891. /**
  2892. * Gap between each bar inside category. Default to be 30%. Can be an aboslute pixel value
  2893. */
  2894. barGap?: string | number;
  2895. /**
  2896. * Gap between each category. Default to be 20%. can be an absolute pixel value.
  2897. */
  2898. barCategoryGap?: string | number;
  2899. large?: boolean;
  2900. largeThreshold?: number;
  2901. }
  2902. interface LayoutRect extends BoundingRect {
  2903. margin: number[];
  2904. }
  2905. /**
  2906. * Parse position info.
  2907. */
  2908. declare function getLayoutRect(positionInfo: BoxLayoutOptionMixin & {
  2909. aspect?: number;
  2910. }, containerRect: {
  2911. width: number;
  2912. height: number;
  2913. }, margin?: number | number[]): LayoutRect;
  2914. interface GridOption extends ComponentOption, BoxLayoutOptionMixin, ShadowOptionMixin {
  2915. mainType?: 'grid';
  2916. show?: boolean;
  2917. containLabel?: boolean;
  2918. backgroundColor?: ZRColor;
  2919. borderWidth?: number;
  2920. borderColor?: ZRColor;
  2921. tooltip?: any;
  2922. }
  2923. declare type CartesianAxisPosition = 'top' | 'bottom' | 'left' | 'right';
  2924. declare type CartesianAxisOption = AxisBaseOption & {
  2925. gridIndex?: number;
  2926. gridId?: string;
  2927. position?: CartesianAxisPosition;
  2928. offset?: number;
  2929. categorySortInfo?: OrdinalSortInfo;
  2930. };
  2931. declare type XAXisOption = CartesianAxisOption & {
  2932. mainType?: 'xAxis';
  2933. };
  2934. declare type YAXisOption = CartesianAxisOption & {
  2935. mainType?: 'yAxis';
  2936. };
  2937. declare type AngleAxisOption = AxisBaseOption & {
  2938. mainType?: 'angleAxis';
  2939. /**
  2940. * Index of host polar component
  2941. */
  2942. polarIndex?: number;
  2943. /**
  2944. * Id of host polar component
  2945. */
  2946. polarId?: string;
  2947. startAngle?: number;
  2948. clockwise?: boolean;
  2949. axisLabel?: AxisBaseOption['axisLabel'];
  2950. };
  2951. declare type RadiusAxisOption = AxisBaseOption & {
  2952. mainType?: 'radiusAxis';
  2953. /**
  2954. * Index of host polar component
  2955. */
  2956. polarIndex?: number;
  2957. /**
  2958. * Id of host polar component
  2959. */
  2960. polarId?: string;
  2961. };
  2962. interface PolarOption extends ComponentOption, CircleLayoutOptionMixin {
  2963. mainType?: 'polar';
  2964. }
  2965. /**
  2966. * BrushController is not only used in "brush component",
  2967. * but is also used in "tooltip DataZoom", and other possible
  2968. * further brush behavior related scenarios.
  2969. * So `BrushController` should not depend on "brush component model".
  2970. */
  2971. declare type BrushType = 'polygon' | 'rect' | 'lineX' | 'lineY';
  2972. /**
  2973. * Only for drawing (after enabledBrush).
  2974. * 'line', 'rect', 'polygon' or false
  2975. * If passing false/null/undefined, disable brush.
  2976. * If passing 'auto', determined by panel.defaultBrushType
  2977. */
  2978. declare type BrushTypeUncertain = BrushType | false | 'auto';
  2979. declare type BrushMode = 'single' | 'multiple';
  2980. declare type BrushDimensionMinMax = number[];
  2981. declare type BrushAreaRange = BrushDimensionMinMax | BrushDimensionMinMax[];
  2982. interface BrushCoverConfig {
  2983. brushType: BrushType;
  2984. id?: string;
  2985. range?: BrushAreaRange;
  2986. panelId?: string;
  2987. brushMode?: BrushMode;
  2988. brushStyle?: Pick<PathStyleProps, BrushStyleKey>;
  2989. transformable?: boolean;
  2990. removeOnClick?: boolean;
  2991. z?: number;
  2992. }
  2993. declare type BrushStyleKey = 'fill' | 'stroke' | 'lineWidth' | 'opacity' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'shadowColor';
  2994. declare type GeoSVGSourceInput = string | Document | SVGElement;
  2995. declare type GeoJSONSourceInput = string | GeoJSON | GeoJSONCompressed;
  2996. interface NameMap {
  2997. [regionName: string]: string;
  2998. }
  2999. interface GeoSpecialAreas {
  3000. [areaName: string]: {
  3001. left: number;
  3002. top: number;
  3003. width?: number;
  3004. height?: number;
  3005. };
  3006. }
  3007. interface GeoJSON extends GeoJSONFeatureCollection<GeoJSONGeometry> {
  3008. }
  3009. interface GeoJSONCompressed extends GeoJSONFeatureCollection<GeoJSONGeometryCompressed> {
  3010. UTF8Encoding?: boolean;
  3011. UTF8Scale?: number;
  3012. }
  3013. interface GeoJSONFeatureCollection<G> {
  3014. type: 'FeatureCollection';
  3015. features: GeoJSONFeature<G>[];
  3016. }
  3017. interface GeoJSONFeature<G = GeoJSONGeometry> {
  3018. type: 'Feature';
  3019. id?: string | number;
  3020. properties: {
  3021. name?: string;
  3022. cp?: number[];
  3023. [key: string]: any;
  3024. };
  3025. geometry: G;
  3026. }
  3027. declare type GeoJSONGeometry = GeoJSONGeometryPoint | GeoJSONGeometryMultiPoint | GeoJSONGeometryLineString | GeoJSONGeometryMultiLineString | GeoJSONGeometryPolygon | GeoJSONGeometryMultiPolygon;
  3028. declare type GeoJSONGeometryCompressed = GeoJSONGeometryPolygonCompressed | GeoJSONGeometryMultiPolygonCompressed | GeoJSONGeometryLineStringCompressed | GeoJSONGeometryMultiLineStringCompressed;
  3029. interface GeoJSONGeometryPoint {
  3030. type: 'Point';
  3031. coordinates: number[];
  3032. }
  3033. interface GeoJSONGeometryMultiPoint {
  3034. type: 'MultiPoint';
  3035. coordinates: number[][];
  3036. }
  3037. interface GeoJSONGeometryLineString {
  3038. type: 'LineString';
  3039. coordinates: number[][];
  3040. }
  3041. interface GeoJSONGeometryLineStringCompressed {
  3042. type: 'LineString';
  3043. coordinates: string;
  3044. encodeOffsets: number[];
  3045. }
  3046. interface GeoJSONGeometryMultiLineString {
  3047. type: 'MultiLineString';
  3048. coordinates: number[][][];
  3049. }
  3050. interface GeoJSONGeometryMultiLineStringCompressed {
  3051. type: 'MultiLineString';
  3052. coordinates: string[];
  3053. encodeOffsets: number[][];
  3054. }
  3055. interface GeoJSONGeometryPolygon {
  3056. type: 'Polygon';
  3057. coordinates: number[][][];
  3058. }
  3059. interface GeoJSONGeometryPolygonCompressed {
  3060. type: 'Polygon';
  3061. coordinates: string[];
  3062. encodeOffsets: number[][];
  3063. }
  3064. interface GeoJSONGeometryMultiPolygon {
  3065. type: 'MultiPolygon';
  3066. coordinates: number[][][][];
  3067. }
  3068. interface GeoJSONGeometryMultiPolygonCompressed {
  3069. type: 'MultiPolygon';
  3070. coordinates: string[][];
  3071. encodeOffsets: number[][][];
  3072. }
  3073. interface GeoResource {
  3074. readonly type: 'geoJSON' | 'geoSVG';
  3075. load(nameMap: NameMap, nameProperty: string): {
  3076. boundingRect: BoundingRect;
  3077. regions: Region[];
  3078. regionsMap: HashMap<Region>;
  3079. };
  3080. }
  3081. /**
  3082. * Geo stream interface compatitable with d3-geo
  3083. * See the API detail in https://github.com/d3/d3-geo#streams
  3084. */
  3085. interface ProjectionStream {
  3086. point(x: number, y: number): void;
  3087. lineStart(): void;
  3088. lineEnd(): void;
  3089. polygonStart(): void;
  3090. polygonEnd(): void;
  3091. /**
  3092. * Not supported yet.
  3093. */
  3094. sphere(): void;
  3095. }
  3096. interface GeoProjection {
  3097. project(point: number[]): number[];
  3098. unproject(point: number[]): number[];
  3099. /**
  3100. * Projection stream compatitable to d3-geo projection stream.
  3101. *
  3102. * When rotate projection is used. It may have antimeridian artifacts.
  3103. * So we need to introduce the fule projection stream to do antimeridian clipping.
  3104. *
  3105. * project will be ignored if projectStream is given.
  3106. */
  3107. stream?(outStream: ProjectionStream): ProjectionStream;
  3108. }
  3109. declare abstract class Region {
  3110. readonly name: string;
  3111. readonly type: 'geoJSON' | 'geoSVG';
  3112. protected _center: number[];
  3113. protected _rect: BoundingRect;
  3114. constructor(name: string);
  3115. setCenter(center: number[]): void;
  3116. /**
  3117. * Get center point in data unit. That is,
  3118. * for GeoJSONRegion, the unit is lat/lng,
  3119. * for GeoSVGRegion, the unit is SVG local coord.
  3120. */
  3121. getCenter(): number[];
  3122. abstract calcCenter(): number[];
  3123. }
  3124. declare class GeoJSONPolygonGeometry {
  3125. readonly type = "polygon";
  3126. exterior: number[][];
  3127. interiors?: number[][][];
  3128. constructor(exterior: number[][], interiors: number[][][]);
  3129. }
  3130. declare class GeoJSONLineStringGeometry {
  3131. readonly type = "linestring";
  3132. points: number[][][];
  3133. constructor(points: number[][][]);
  3134. }
  3135. declare class GeoJSONRegion extends Region {
  3136. readonly type = "geoJSON";
  3137. readonly geometries: (GeoJSONPolygonGeometry | GeoJSONLineStringGeometry)[];
  3138. properties: GeoJSON['features'][0]['properties'];
  3139. constructor(name: string, geometries: GeoJSONRegion['geometries'], cp: GeoJSON['features'][0]['properties']['cp']);
  3140. calcCenter(): number[];
  3141. getBoundingRect(projection?: GeoProjection): BoundingRect;
  3142. contain(coord: number[]): boolean;
  3143. /**
  3144. * Transform the raw coords to target bounding.
  3145. * @param x
  3146. * @param y
  3147. * @param width
  3148. * @param height
  3149. */
  3150. transformTo(x: number, y: number, width: number, height: number): void;
  3151. cloneShallow(name: string): GeoJSONRegion;
  3152. }
  3153. declare type ECSymbol = Path & {
  3154. __isEmptyBrush?: boolean;
  3155. setColor: (color: ZRColor, innerColor?: ZRColor) => void;
  3156. getColor: () => ZRColor;
  3157. };
  3158. /**
  3159. * Create a symbol element with given symbol configuration: shape, x, y, width, height, color
  3160. */
  3161. declare function createSymbol(symbolType: string, x: number, y: number, w: number, h: number, color?: ZRColor, keepAspect?: boolean): ECSymbol;
  3162. declare type ItemStyleKeys = 'fill' | 'stroke' | 'decal' | 'lineWidth' | 'opacity' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'shadowColor' | 'lineDash' | 'lineDashOffset' | 'lineCap' | 'lineJoin' | 'miterLimit';
  3163. declare type ItemStyleProps = Pick<PathStyleProps, ItemStyleKeys>;
  3164. declare class ItemStyleMixin {
  3165. getItemStyle(this: Model, excludes?: readonly (keyof ItemStyleOption)[], includes?: readonly (keyof ItemStyleOption)[]): ItemStyleProps;
  3166. }
  3167. declare type LineStyleKeys = 'lineWidth' | 'stroke' | 'opacity' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'shadowColor' | 'lineDash' | 'lineDashOffset' | 'lineCap' | 'lineJoin' | 'miterLimit';
  3168. declare type LineStyleProps = Pick<PathStyleProps, LineStyleKeys>;
  3169. declare class LineStyleMixin {
  3170. getLineStyle(this: Model, excludes?: readonly (keyof LineStyleOption)[]): LineStyleProps;
  3171. }
  3172. declare type SelectorType = 'all' | 'inverse';
  3173. interface LegendSelectorButtonOption {
  3174. type?: SelectorType;
  3175. title?: string;
  3176. }
  3177. /**
  3178. * T: the type to be extended
  3179. * ET: extended type for keys of T
  3180. * ST: special type for T to be extended
  3181. */
  3182. declare type ExtendPropertyType<T, ET, ST extends {
  3183. [key in keyof T]: any;
  3184. }> = {
  3185. [key in keyof T]: key extends keyof ST ? T[key] | ET | ST[key] : T[key] | ET;
  3186. };
  3187. interface LegendItemStyleOption extends ExtendPropertyType<ItemStyleOption, 'inherit', {
  3188. borderWidth: 'auto';
  3189. }> {
  3190. }
  3191. interface LegendLineStyleOption extends ExtendPropertyType<LineStyleOption, 'inherit', {
  3192. width: 'auto';
  3193. }> {
  3194. inactiveColor?: ColorString;
  3195. inactiveWidth?: number;
  3196. }
  3197. interface LegendStyleOption {
  3198. /**
  3199. * Icon of the legend items.
  3200. * @default 'roundRect'
  3201. */
  3202. icon?: string;
  3203. /**
  3204. * Color when legend item is not selected
  3205. */
  3206. inactiveColor?: ColorString;
  3207. /**
  3208. * Border color when legend item is not selected
  3209. */
  3210. inactiveBorderColor?: ColorString;
  3211. /**
  3212. * Border color when legend item is not selected
  3213. */
  3214. inactiveBorderWidth?: number | 'auto';
  3215. /**
  3216. * Legend label formatter
  3217. */
  3218. formatter?: string | ((name: string) => string);
  3219. itemStyle?: LegendItemStyleOption;
  3220. lineStyle?: LegendLineStyleOption;
  3221. textStyle?: LabelOption;
  3222. symbolRotate?: number | 'inherit';
  3223. /**
  3224. * @deprecated
  3225. */
  3226. symbolKeepAspect?: boolean;
  3227. }
  3228. interface DataItem extends LegendStyleOption {
  3229. name?: string;
  3230. icon?: string;
  3231. textStyle?: LabelOption;
  3232. tooltip?: unknown;
  3233. }
  3234. interface LegendTooltipFormatterParams {
  3235. componentType: 'legend';
  3236. legendIndex: number;
  3237. name: string;
  3238. $vars: ['name'];
  3239. }
  3240. interface LegendIconParams {
  3241. itemWidth: number;
  3242. itemHeight: number;
  3243. /**
  3244. * symbolType is from legend.icon, legend.data.icon, or series visual
  3245. */
  3246. icon: string;
  3247. iconRotate: number | 'inherit';
  3248. symbolKeepAspect: boolean;
  3249. itemStyle: PathStyleProps;
  3250. lineStyle: LineStyleProps;
  3251. }
  3252. interface LegendOption extends ComponentOption, LegendStyleOption, BoxLayoutOptionMixin, BorderOptionMixin {
  3253. mainType?: 'legend';
  3254. show?: boolean;
  3255. orient?: LayoutOrient;
  3256. align?: 'auto' | 'left' | 'right';
  3257. backgroundColor?: ColorString;
  3258. /**
  3259. * Border radius of background rect
  3260. * @default 0
  3261. */
  3262. borderRadius?: number | number[];
  3263. /**
  3264. * Padding between legend item and border.
  3265. * Support to be a single number or an array.
  3266. * @default 5
  3267. */
  3268. padding?: number | number[];
  3269. /**
  3270. * Gap between each legend item.
  3271. * @default 10
  3272. */
  3273. itemGap?: number;
  3274. /**
  3275. * Width of legend symbol
  3276. */
  3277. itemWidth?: number;
  3278. /**
  3279. * Height of legend symbol
  3280. */
  3281. itemHeight?: number;
  3282. selectedMode?: boolean | 'single' | 'multiple';
  3283. /**
  3284. * selected map of each item. Default to be selected if item is not in the map
  3285. */
  3286. selected?: Dictionary<boolean>;
  3287. /**
  3288. * Buttons for all select or inverse select.
  3289. * @example
  3290. * selector: [{type: 'all or inverse', title: xxx}]
  3291. * selector: true
  3292. * selector: ['all', 'inverse']
  3293. */
  3294. selector?: (LegendSelectorButtonOption | SelectorType)[] | boolean;
  3295. selectorLabel?: LabelOption;
  3296. emphasis?: {
  3297. selectorLabel?: LabelOption;
  3298. };
  3299. /**
  3300. * Position of selector buttons.
  3301. */
  3302. selectorPosition?: 'auto' | 'start' | 'end';
  3303. /**
  3304. * Gap between each selector button
  3305. */
  3306. selectorItemGap?: number;
  3307. /**
  3308. * Gap between selector buttons group and legend main items.
  3309. */
  3310. selectorButtonGap?: number;
  3311. data?: (string | DataItem)[];
  3312. /**
  3313. * Tooltip option
  3314. */
  3315. tooltip?: CommonTooltipOption<LegendTooltipFormatterParams>;
  3316. }
  3317. interface MapStateOption<TCbParams = never> {
  3318. itemStyle?: GeoItemStyleOption<TCbParams>;
  3319. label?: SeriesLabelOption;
  3320. }
  3321. interface MapDataItemOption extends MapStateOption, StatesOptionMixin<MapStateOption, StatesMixinBase>, OptionDataItemObject<OptionDataValueNumeric> {
  3322. cursor?: string;
  3323. }
  3324. declare type MapValueCalculationType = 'sum' | 'average' | 'min' | 'max';
  3325. interface MapSeriesOption extends SeriesOption<MapStateOption<CallbackDataParams>, StatesMixinBase>, MapStateOption<CallbackDataParams>, GeoCommonOptionMixin, SeriesOnGeoOptionMixin, BoxLayoutOptionMixin, SeriesEncodeOptionMixin {
  3326. type?: 'map';
  3327. coordinateSystem?: string;
  3328. silent?: boolean;
  3329. markLine?: any;
  3330. markPoint?: any;
  3331. markArea?: any;
  3332. mapValueCalculation?: MapValueCalculationType;
  3333. showLegendSymbol?: boolean;
  3334. geoCoord?: Dictionary<number[]>;
  3335. data?: (OptionDataValueNumeric | OptionDataValueNumeric[] | MapDataItemOption)[];
  3336. nameProperty?: string;
  3337. }
  3338. interface GeoItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
  3339. areaColor?: ZRColor;
  3340. }
  3341. interface GeoLabelOption extends LabelOption {
  3342. formatter?: string | ((params: GeoLabelFormatterDataParams) => string);
  3343. }
  3344. interface GeoStateOption {
  3345. itemStyle?: GeoItemStyleOption;
  3346. label?: GeoLabelOption;
  3347. }
  3348. interface GeoLabelFormatterDataParams {
  3349. name: string;
  3350. status: DisplayState;
  3351. }
  3352. interface RegoinOption extends GeoStateOption, StatesOptionMixin<GeoStateOption, StatesMixinBase> {
  3353. name?: string;
  3354. selected?: boolean;
  3355. tooltip?: CommonTooltipOption<GeoTooltipFormatterParams>;
  3356. }
  3357. interface GeoTooltipFormatterParams {
  3358. componentType: 'geo';
  3359. geoIndex: number;
  3360. name: string;
  3361. $vars: ['name'];
  3362. }
  3363. interface GeoCommonOptionMixin extends RoamOptionMixin {
  3364. map: string;
  3365. aspectScale?: number;
  3366. layoutCenter?: (number | string)[];
  3367. layoutSize?: number | string;
  3368. boundingCoords?: number[][];
  3369. nameMap?: NameMap;
  3370. nameProperty?: string;
  3371. /**
  3372. * Use raw projection by default
  3373. * Only available for GeoJSON source.
  3374. *
  3375. * NOTE: `center` needs to be the projected coord if projection is used.
  3376. */
  3377. projection?: GeoProjection;
  3378. }
  3379. interface GeoOption extends ComponentOption, BoxLayoutOptionMixin, AnimationOptionMixin, GeoCommonOptionMixin, StatesOptionMixin<GeoStateOption, StatesMixinBase>, GeoStateOption {
  3380. mainType?: 'geo';
  3381. show?: boolean;
  3382. silent?: boolean;
  3383. regions?: RegoinOption[];
  3384. stateAnimation?: AnimationOptionMixin;
  3385. selectedMode?: 'single' | 'multiple' | boolean;
  3386. selectedMap?: Dictionary<boolean>;
  3387. tooltip?: CommonTooltipOption<GeoTooltipFormatterParams>;
  3388. }
  3389. /**
  3390. * The input to define brush areas.
  3391. * (1) Can be created by user when calling dispatchAction.
  3392. * (2) Can be created by `BrushController`
  3393. * for brush behavior. area params are picked from `cover.__brushOptoin`.
  3394. * In `BrushController`, "covers" are create or updated for each "area".
  3395. */
  3396. interface BrushAreaParam extends ModelFinderObject {
  3397. brushType: BrushCoverConfig['brushType'];
  3398. id?: BrushCoverConfig['id'];
  3399. range?: BrushCoverConfig['range'];
  3400. panelId?: BrushCoverConfig['panelId'];
  3401. coordRange?: BrushAreaRange;
  3402. coordRanges?: BrushAreaRange[];
  3403. __rangeOffset?: {
  3404. offset: BrushDimensionMinMax[] | BrushDimensionMinMax;
  3405. xyMinMax: BrushDimensionMinMax[];
  3406. };
  3407. }
  3408. /**
  3409. * Generated by `brushModel.setAreas`, which merges
  3410. * `area: BrushAreaParam` and `brushModel.option: BrushOption`.
  3411. * See `generateBrushOption`.
  3412. */
  3413. interface BrushAreaParamInternal extends BrushAreaParam {
  3414. brushMode: BrushMode;
  3415. brushStyle: BrushCoverConfig['brushStyle'];
  3416. transformable: BrushCoverConfig['transformable'];
  3417. removeOnClick: BrushCoverConfig['removeOnClick'];
  3418. z: BrushCoverConfig['z'];
  3419. __rangeOffset?: {
  3420. offset: BrushDimensionMinMax | BrushDimensionMinMax[];
  3421. xyMinMax: BrushDimensionMinMax[];
  3422. };
  3423. }
  3424. declare type BrushToolboxIconType = BrushType | 'keep' | 'clear';
  3425. interface BrushOption extends ComponentOption, ModelFinderObject {
  3426. mainType?: 'brush';
  3427. toolbox?: BrushToolboxIconType[];
  3428. brushLink?: number[] | 'all' | 'none';
  3429. throttleType?: 'fixRate' | 'debounce';
  3430. throttleDelay?: number;
  3431. inBrush?: VisualOptionFixed;
  3432. outOfBrush?: VisualOptionFixed;
  3433. brushType?: BrushTypeUncertain;
  3434. brushStyle?: {
  3435. borderWidth?: number;
  3436. color?: ZRColor;
  3437. borderColor?: ZRColor;
  3438. };
  3439. transformable?: boolean;
  3440. brushMode?: BrushMode;
  3441. removeOnClick?: boolean;
  3442. }
  3443. interface BrushSelectableArea extends BrushAreaParamInternal {
  3444. boundingRect: BoundingRect;
  3445. selectors: BrushCommonSelectorsForSeries;
  3446. }
  3447. /**
  3448. * This methods are corresponding to `BrushSelectorOnBrushType`,
  3449. * but `area: BrushSelectableArea` is binded to each method.
  3450. */
  3451. interface BrushCommonSelectorsForSeries {
  3452. point(itemLayout: number[]): boolean;
  3453. rect(itemLayout: RectLike): boolean;
  3454. }
  3455. declare type PolarBarLabelPosition = SeriesLabelOption['position'] | 'start' | 'insideStart' | 'middle' | 'end' | 'insideEnd';
  3456. declare type BarSeriesLabelOption = Omit<SeriesLabelOption, 'position'> & {
  3457. position?: PolarBarLabelPosition | 'outside';
  3458. };
  3459. interface BarStateOption<TCbParams = never> {
  3460. itemStyle?: BarItemStyleOption<TCbParams>;
  3461. label?: BarSeriesLabelOption;
  3462. }
  3463. interface BarStatesMixin {
  3464. emphasis?: DefaultStatesMixinEmphasis;
  3465. }
  3466. interface BarItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
  3467. borderRadius?: (number | string)[] | number | string;
  3468. }
  3469. interface BarDataItemOption extends BarStateOption, StatesOptionMixin<BarStateOption, BarStatesMixin>, OptionDataItemObject<OptionDataValue> {
  3470. cursor?: string;
  3471. }
  3472. interface BarSeriesOption extends BaseBarSeriesOption<BarStateOption<CallbackDataParams>, BarStatesMixin>, BarStateOption<CallbackDataParams>, SeriesStackOptionMixin, SeriesSamplingOptionMixin, SeriesEncodeOptionMixin {
  3473. type?: 'bar';
  3474. coordinateSystem?: 'cartesian2d' | 'polar';
  3475. clip?: boolean;
  3476. /**
  3477. * If use caps on two sides of bars
  3478. * Only available on tangential polar bar
  3479. */
  3480. roundCap?: boolean;
  3481. showBackground?: boolean;
  3482. backgroundStyle?: ItemStyleOption & {
  3483. borderRadius?: number | number[];
  3484. };
  3485. data?: (BarDataItemOption | OptionDataValue | OptionDataValue[])[];
  3486. realtimeSort?: boolean;
  3487. }
  3488. /**
  3489. * {
  3490. * [coordSysId]: {
  3491. * [stackId]: {bandWidth, offset, width}
  3492. * }
  3493. * }
  3494. */
  3495. declare type BarWidthAndOffset = Dictionary<Dictionary<{
  3496. bandWidth: number;
  3497. offset: number;
  3498. offsetCenter: number;
  3499. width: number;
  3500. }>>;
  3501. interface BarGridLayoutOptionForCustomSeries {
  3502. count: number;
  3503. barWidth?: number | string;
  3504. barMaxWidth?: number | string;
  3505. barMinWidth?: number | string;
  3506. barGap?: number | string;
  3507. barCategoryGap?: number | string;
  3508. }
  3509. declare type BarGridLayoutResult = BarWidthAndOffset[string][string][];
  3510. interface TransitionOptionMixin<T = Record<string, any>> {
  3511. transition?: (keyof T & string) | ((keyof T & string)[]) | 'all';
  3512. enterFrom?: T;
  3513. leaveTo?: T;
  3514. enterAnimation?: AnimationOption$1;
  3515. updateAnimation?: AnimationOption$1;
  3516. leaveAnimation?: AnimationOption$1;
  3517. }
  3518. interface TransitionBaseDuringAPI {
  3519. setTransform(key: TransformProp, val: number): this;
  3520. getTransform(key: TransformProp): number;
  3521. setExtra(key: string, val: unknown): this;
  3522. getExtra(key: string): unknown;
  3523. }
  3524. interface TransitionDuringAPI<StyleOpt extends any = any, ShapeOpt extends any = any> extends TransitionBaseDuringAPI {
  3525. setShape<T extends keyof ShapeOpt>(key: T, val: ShapeOpt[T]): this;
  3526. getShape<T extends keyof ShapeOpt>(key: T): ShapeOpt[T];
  3527. setStyle<T extends keyof StyleOpt>(key: T, val: StyleOpt[T]): this;
  3528. getStyle<T extends keyof StyleOpt>(key: T): StyleOpt[T];
  3529. }
  3530. declare type AnimationKeyframe<T extends Record<string, any>> = T & {
  3531. easing?: AnimationEasing;
  3532. percent?: number;
  3533. };
  3534. interface ElementKeyframeAnimationOption<Props extends Record<string, any>> extends AnimationOption$1 {
  3535. loop?: boolean;
  3536. keyframes?: AnimationKeyframe<Props>[];
  3537. }
  3538. declare type CustomExtraElementInfo = Dictionary<unknown>;
  3539. declare const STYLE_VISUAL_TYPE: {
  3540. readonly color: "fill";
  3541. readonly borderColor: "stroke";
  3542. };
  3543. declare type StyleVisualProps = keyof typeof STYLE_VISUAL_TYPE;
  3544. declare const NON_STYLE_VISUAL_PROPS: {
  3545. readonly symbol: 1;
  3546. readonly symbolSize: 1;
  3547. readonly symbolKeepAspect: 1;
  3548. readonly legendIcon: 1;
  3549. readonly visualMeta: 1;
  3550. readonly liftZ: 1;
  3551. readonly decal: 1;
  3552. };
  3553. declare type NonStyleVisualProps = keyof typeof NON_STYLE_VISUAL_PROPS;
  3554. declare type ShapeMorphingOption = {
  3555. /**
  3556. * If do shape morphing animation when type is changed.
  3557. * Only available on path.
  3558. */
  3559. morph?: boolean;
  3560. };
  3561. interface CustomBaseElementOption extends Partial<Pick<Element, TransformProp | 'silent' | 'ignore' | 'textConfig'>> {
  3562. type: string;
  3563. id?: string;
  3564. name?: string;
  3565. info?: CustomExtraElementInfo;
  3566. textContent?: CustomTextOption | false;
  3567. clipPath?: CustomBaseZRPathOption | false;
  3568. extra?: Dictionary<unknown> & TransitionOptionMixin;
  3569. during?(params: TransitionBaseDuringAPI): void;
  3570. enterAnimation?: AnimationOption$1;
  3571. updateAnimation?: AnimationOption$1;
  3572. leaveAnimation?: AnimationOption$1;
  3573. }
  3574. interface CustomDisplayableOption extends CustomBaseElementOption, Partial<Pick<Displayable, 'zlevel' | 'z' | 'z2' | 'invisible'>> {
  3575. style?: ZRStyleProps;
  3576. during?(params: TransitionDuringAPI): void;
  3577. /**
  3578. * @deprecated
  3579. */
  3580. styleEmphasis?: ZRStyleProps | false;
  3581. emphasis?: CustomDisplayableOptionOnState;
  3582. blur?: CustomDisplayableOptionOnState;
  3583. select?: CustomDisplayableOptionOnState;
  3584. }
  3585. interface CustomDisplayableOptionOnState extends Partial<Pick<Displayable, TransformProp | 'textConfig' | 'z2'>> {
  3586. style?: ZRStyleProps | false;
  3587. }
  3588. interface CustomGroupOption extends CustomBaseElementOption, TransitionOptionMixin<GroupProps> {
  3589. type: 'group';
  3590. width?: number;
  3591. height?: number;
  3592. diffChildrenByName?: boolean;
  3593. children: CustomElementOption[];
  3594. $mergeChildren?: false | 'byName' | 'byIndex';
  3595. keyframeAnimation?: ElementKeyframeAnimationOption<GroupProps> | ElementKeyframeAnimationOption<GroupProps>[];
  3596. }
  3597. interface CustomBaseZRPathOption<T extends PathProps['shape'] = PathProps['shape']> extends CustomDisplayableOption, ShapeMorphingOption, TransitionOptionMixin<PathProps & {
  3598. shape: T;
  3599. }> {
  3600. autoBatch?: boolean;
  3601. shape?: T & TransitionOptionMixin<T>;
  3602. style?: PathProps['style'] & TransitionOptionMixin<PathStyleProps>;
  3603. during?(params: TransitionDuringAPI<PathStyleProps, T>): void;
  3604. keyframeAnimation?: ElementKeyframeAnimationOption<PathProps & {
  3605. shape: T;
  3606. }> | ElementKeyframeAnimationOption<PathProps & {
  3607. shape: T;
  3608. }>[];
  3609. }
  3610. interface BuiltinShapes {
  3611. circle: Partial<Circle['shape']>;
  3612. rect: Partial<Rect['shape']>;
  3613. sector: Partial<Sector['shape']>;
  3614. polygon: Partial<Polygon['shape']>;
  3615. polyline: Partial<Polyline['shape']>;
  3616. line: Partial<Line['shape']>;
  3617. arc: Partial<Arc['shape']>;
  3618. bezierCurve: Partial<BezierCurve['shape']>;
  3619. ring: Partial<Ring['shape']>;
  3620. ellipse: Partial<Ellipse['shape']>;
  3621. compoundPath: Partial<CompoundPath['shape']>;
  3622. }
  3623. interface CustomSVGPathShapeOption {
  3624. pathData?: string;
  3625. d?: string;
  3626. layout?: 'center' | 'cover';
  3627. x?: number;
  3628. y?: number;
  3629. width?: number;
  3630. height?: number;
  3631. }
  3632. interface CustomSVGPathOption extends CustomBaseZRPathOption<CustomSVGPathShapeOption> {
  3633. type: 'path';
  3634. }
  3635. interface CustomBuitinPathOption<T extends keyof BuiltinShapes> extends CustomBaseZRPathOption<BuiltinShapes[T]> {
  3636. type: T;
  3637. }
  3638. declare type CreateCustomBuitinPathOption<T extends keyof BuiltinShapes> = T extends any ? CustomBuitinPathOption<T> : never;
  3639. declare type CustomPathOption = CreateCustomBuitinPathOption<keyof BuiltinShapes> | CustomSVGPathOption;
  3640. interface CustomImageOptionOnState extends CustomDisplayableOptionOnState {
  3641. style?: ImageStyleProps;
  3642. }
  3643. interface CustomImageOption extends CustomDisplayableOption, TransitionOptionMixin<ImageProps> {
  3644. type: 'image';
  3645. style?: ImageStyleProps & TransitionOptionMixin<ImageStyleProps>;
  3646. emphasis?: CustomImageOptionOnState;
  3647. blur?: CustomImageOptionOnState;
  3648. select?: CustomImageOptionOnState;
  3649. keyframeAnimation?: ElementKeyframeAnimationOption<ImageProps> | ElementKeyframeAnimationOption<ImageProps>[];
  3650. }
  3651. interface CustomTextOptionOnState extends CustomDisplayableOptionOnState {
  3652. style?: TextStyleProps;
  3653. }
  3654. interface CustomTextOption extends CustomDisplayableOption, TransitionOptionMixin<TextProps> {
  3655. type: 'text';
  3656. style?: TextStyleProps & TransitionOptionMixin<TextStyleProps>;
  3657. emphasis?: CustomTextOptionOnState;
  3658. blur?: CustomTextOptionOnState;
  3659. select?: CustomTextOptionOnState;
  3660. keyframeAnimation?: ElementKeyframeAnimationOption<TextProps> | ElementKeyframeAnimationOption<TextProps>[];
  3661. }
  3662. declare type CustomElementOption = CustomPathOption | CustomImageOption | CustomTextOption | CustomGroupOption;
  3663. declare type CustomRootElementOption = CustomElementOption & {
  3664. focus?: 'none' | 'self' | 'series' | ArrayLike<number>;
  3665. blurScope?: BlurScope;
  3666. emphasisDisabled?: boolean;
  3667. };
  3668. interface CustomSeriesRenderItemAPI extends CustomSeriesRenderItemCoordinateSystemAPI {
  3669. getWidth(): number;
  3670. getHeight(): number;
  3671. getZr(): ZRenderType;
  3672. getDevicePixelRatio(): number;
  3673. value(dim: DimensionLoose, dataIndexInside?: number): ParsedValue;
  3674. ordinalRawValue(dim: DimensionLoose, dataIndexInside?: number): ParsedValue | OrdinalRawValue;
  3675. /**
  3676. * @deprecated
  3677. */
  3678. style(userProps?: ZRStyleProps, dataIndexInside?: number): ZRStyleProps;
  3679. /**
  3680. * @deprecated
  3681. */
  3682. styleEmphasis(userProps?: ZRStyleProps, dataIndexInside?: number): ZRStyleProps;
  3683. visual<VT extends NonStyleVisualProps | StyleVisualProps>(visualType: VT, dataIndexInside?: number): VT extends NonStyleVisualProps ? DefaultDataVisual[VT] : VT extends StyleVisualProps ? PathStyleProps[typeof STYLE_VISUAL_TYPE[VT]] : void;
  3684. barLayout(opt: BarGridLayoutOptionForCustomSeries): BarGridLayoutResult;
  3685. currentSeriesIndices(): number[];
  3686. font(opt: Pick<TextCommonOption, 'fontStyle' | 'fontWeight' | 'fontSize' | 'fontFamily'>): string;
  3687. }
  3688. interface CustomSeriesRenderItemParamsCoordSys {
  3689. type: string;
  3690. }
  3691. interface CustomSeriesRenderItemCoordinateSystemAPI {
  3692. coord(data: OptionDataValue | OptionDataValue[], clamp?: boolean): number[];
  3693. size?(dataSize: OptionDataValue | OptionDataValue[], dataItem?: OptionDataValue | OptionDataValue[]): number | number[];
  3694. }
  3695. declare type WrapEncodeDefRet = Dictionary<number[]>;
  3696. interface CustomSeriesRenderItemParams {
  3697. context: Dictionary<unknown>;
  3698. dataIndex: number;
  3699. seriesId: string;
  3700. seriesName: string;
  3701. seriesIndex: number;
  3702. coordSys: CustomSeriesRenderItemParamsCoordSys;
  3703. encode: WrapEncodeDefRet;
  3704. dataIndexInside: number;
  3705. dataInsideLength: number;
  3706. actionType?: string;
  3707. }
  3708. declare type CustomSeriesRenderItemReturn = CustomRootElementOption | undefined | null;
  3709. declare type CustomSeriesRenderItem = (params: CustomSeriesRenderItemParams, api: CustomSeriesRenderItemAPI) => CustomSeriesRenderItemReturn;
  3710. interface CustomSeriesOption extends SeriesOption<unknown>, // don't support StateOption in custom series.
  3711. SeriesEncodeOptionMixin, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnSingleOptionMixin, SeriesOnGeoOptionMixin, SeriesOnCalendarOptionMixin {
  3712. type?: 'custom';
  3713. coordinateSystem?: string | 'none';
  3714. renderItem?: CustomSeriesRenderItem;
  3715. /**
  3716. * @deprecated
  3717. */
  3718. itemStyle?: ItemStyleOption;
  3719. /**
  3720. * @deprecated
  3721. */
  3722. label?: LabelOption;
  3723. /**
  3724. * @deprecated
  3725. */
  3726. emphasis?: {
  3727. /**
  3728. * @deprecated
  3729. */
  3730. itemStyle?: ItemStyleOption;
  3731. /**
  3732. * @deprecated
  3733. */
  3734. label?: LabelOption;
  3735. };
  3736. clip?: boolean;
  3737. }
  3738. declare type PrepareCustomInfo = (coordSys: CoordinateSystem) => {
  3739. coordSys: CustomSeriesRenderItemParamsCoordSys;
  3740. api: CustomSeriesRenderItemCoordinateSystemAPI;
  3741. };
  3742. interface CoordinateSystemCreator {
  3743. create: (ecModel: GlobalModel, api: ExtensionAPI) => CoordinateSystemMaster[];
  3744. dimensions?: DimensionName[];
  3745. getDimensionsInfo?: () => DimensionDefinitionLoose[];
  3746. }
  3747. /**
  3748. * The instance get from `CoordinateSystemManger` is `CoordinateSystemMaster`.
  3749. */
  3750. interface CoordinateSystemMaster {
  3751. dimensions: DimensionName[];
  3752. model?: ComponentModel;
  3753. update?: (ecModel: GlobalModel, api: ExtensionAPI) => void;
  3754. convertToPixel?(ecModel: GlobalModel, finder: ParsedModelFinder, value: ScaleDataValue | ScaleDataValue[]): number | number[];
  3755. convertFromPixel?(ecModel: GlobalModel, finder: ParsedModelFinder, pixelValue: number | number[]): number | number[];
  3756. containPoint(point: number[]): boolean;
  3757. getAxes?: () => Axis[];
  3758. axisPointerEnabled?: boolean;
  3759. getTooltipAxes?: (dim: DimensionName | 'auto') => {
  3760. baseAxes: Axis[];
  3761. otherAxes: Axis[];
  3762. };
  3763. /**
  3764. * Get layout rect or coordinate system
  3765. */
  3766. getRect?: () => RectLike;
  3767. }
  3768. /**
  3769. * For example: cartesian is CoordinateSystem.
  3770. * series.coordinateSystem is CoordinateSystem.
  3771. */
  3772. interface CoordinateSystem {
  3773. type: string;
  3774. /**
  3775. * Master of coordinate system. For example:
  3776. * Grid is master of cartesian.
  3777. */
  3778. master?: CoordinateSystemMaster;
  3779. dimensions: DimensionName[];
  3780. model?: ComponentModel;
  3781. /**
  3782. * @param data
  3783. * @param reserved Defined by the coordinate system itself
  3784. * @param out
  3785. * @return {Array.<number>} point Point in global pixel coordinate system.
  3786. */
  3787. dataToPoint(data: ScaleDataValue | ScaleDataValue[], reserved?: any, out?: number[]): number[];
  3788. /**
  3789. * Some coord sys (like Parallel) might do not have `pointToData`,
  3790. * or the meaning of this kind of features is not clear yet.
  3791. * @param point point Point in global pixel coordinate system.
  3792. * @param clamp Clamp range
  3793. * @return data
  3794. */
  3795. pointToData?(point: number[], clamp?: boolean): number | number[];
  3796. containPoint(point: number[]): boolean;
  3797. getAxes?: () => Axis[];
  3798. getAxis?: (dim?: DimensionName) => Axis;
  3799. getBaseAxis?: () => Axis;
  3800. getOtherAxis?: (baseAxis: Axis) => Axis;
  3801. clampData?: (data: ScaleDataValue[], out?: number[]) => number[];
  3802. getRoamTransform?: () => MatrixArray;
  3803. getArea?: () => CoordinateSystemClipArea;
  3804. getBoundingRect?: () => BoundingRect;
  3805. getAxesByScale?: (scaleType: string) => Axis[];
  3806. prepareCustoms?: PrepareCustomInfo;
  3807. }
  3808. /**
  3809. * Like GridModel, PolarModel, ...
  3810. */
  3811. interface CoordinateSystemHostModel extends ComponentModel {
  3812. coordinateSystem?: CoordinateSystemMaster;
  3813. }
  3814. /**
  3815. * Clip area will be returned by getArea of CoordinateSystem.
  3816. * It is used to clip the graphic elements with the contain methods.
  3817. */
  3818. interface CoordinateSystemClipArea {
  3819. contain(x: number, y: number): boolean;
  3820. }
  3821. /**
  3822. * LegendVisualProvider is an bridge that pick encoded color from data and
  3823. * provide to the legend component.
  3824. */
  3825. declare class LegendVisualProvider {
  3826. private _getDataWithEncodedVisual;
  3827. private _getRawData;
  3828. constructor(getDataWithEncodedVisual: () => SeriesData, getRawData: () => SeriesData);
  3829. getAllNames(): string[];
  3830. containName(name: string): boolean;
  3831. indexOfName(name: string): number;
  3832. getItemVisual(dataIndex: number, key: string): any;
  3833. }
  3834. declare function makeStyleMapper(properties: readonly string[][], ignoreParent?: boolean): (model: Model, excludes?: readonly string[], includes?: readonly string[]) => PathStyleProps;
  3835. declare const SERIES_UNIVERSAL_TRANSITION_PROP = "__universalTransitionEnabled";
  3836. interface SeriesModel {
  3837. /**
  3838. * Convenient for override in extended class.
  3839. * Implement it if needed.
  3840. */
  3841. preventIncremental(): boolean;
  3842. /**
  3843. * See tooltip.
  3844. * Implement it if needed.
  3845. * @return Point of tooltip. null/undefined can be returned.
  3846. */
  3847. getTooltipPosition(dataIndex: number): number[];
  3848. /**
  3849. * Get data indices for show tooltip content. See tooltip.
  3850. * Implement it if needed.
  3851. */
  3852. getAxisTooltipData(dim: DimensionName[], value: ScaleDataValue, baseAxis: Axis): {
  3853. dataIndices: number[];
  3854. nestestValue: any;
  3855. };
  3856. /**
  3857. * Get position for marker
  3858. */
  3859. getMarkerPosition(value: ScaleDataValue[], dims?: typeof dimPermutations[number], startingAtTick?: boolean): number[];
  3860. /**
  3861. * Get legend icon symbol according to each series type
  3862. */
  3863. getLegendIcon(opt: LegendIconParams): ECSymbol | Group;
  3864. /**
  3865. * See `component/brush/selector.js`
  3866. * Defined the brush selector for this series.
  3867. */
  3868. brushSelector(dataIndex: number, data: SeriesData, selectors: BrushCommonSelectorsForSeries, area: BrushSelectableArea): boolean;
  3869. enableAriaDecal(): void;
  3870. }
  3871. declare class SeriesModel<Opt extends SeriesOption = SeriesOption> extends ComponentModel<Opt> {
  3872. type: string;
  3873. defaultOption: SeriesOption;
  3874. seriesIndex: number;
  3875. coordinateSystem: CoordinateSystem;
  3876. dataTask: SeriesTask;
  3877. pipelineContext: PipelineContext;
  3878. legendVisualProvider: LegendVisualProvider;
  3879. visualStyleAccessPath: string;
  3880. visualDrawType: 'fill' | 'stroke';
  3881. visualStyleMapper: ReturnType<typeof makeStyleMapper>;
  3882. ignoreStyleOnData: boolean;
  3883. hasSymbolVisual: boolean;
  3884. defaultSymbol: string;
  3885. legendIcon: string;
  3886. [SERIES_UNIVERSAL_TRANSITION_PROP]: boolean;
  3887. private _selectedDataIndicesMap;
  3888. readonly preventUsingHoverLayer: boolean;
  3889. static protoInitialize: void;
  3890. init(option: Opt, parentModel: Model, ecModel: GlobalModel): void;
  3891. /**
  3892. * Util for merge default and theme to option
  3893. */
  3894. mergeDefaultAndTheme(option: Opt, ecModel: GlobalModel): void;
  3895. mergeOption(newSeriesOption: Opt, ecModel: GlobalModel): void;
  3896. fillDataTextStyle(data: ArrayLike<any>): void;
  3897. /**
  3898. * Init a data structure from data related option in series
  3899. * Must be overridden.
  3900. */
  3901. getInitialData(option: Opt, ecModel: GlobalModel): SeriesData;
  3902. /**
  3903. * Append data to list
  3904. */
  3905. appendData(params: {
  3906. data: ArrayLike<any>;
  3907. }): void;
  3908. /**
  3909. * Consider some method like `filter`, `map` need make new data,
  3910. * We should make sure that `seriesModel.getData()` get correct
  3911. * data in the stream procedure. So we fetch data from upstream
  3912. * each time `task.perform` called.
  3913. */
  3914. getData(dataType?: SeriesDataType): SeriesData<this>;
  3915. getAllData(): ({
  3916. data: SeriesData;
  3917. type?: SeriesDataType;
  3918. })[];
  3919. setData(data: SeriesData): void;
  3920. getEncode(): HashMap<OptionEncodeValue, string>;
  3921. getSourceManager(): SourceManager;
  3922. getSource(): Source;
  3923. /**
  3924. * Get data before processed
  3925. */
  3926. getRawData(): SeriesData;
  3927. getColorBy(): ColorBy;
  3928. isColorBySeries(): boolean;
  3929. /**
  3930. * Get base axis if has coordinate system and has axis.
  3931. * By default use coordSys.getBaseAxis();
  3932. * Can be overridden for some chart.
  3933. * @return {type} description
  3934. */
  3935. getBaseAxis(): Axis;
  3936. /**
  3937. * Default tooltip formatter
  3938. *
  3939. * @param dataIndex
  3940. * @param multipleSeries
  3941. * @param dataType
  3942. * @param renderMode valid values: 'html'(by default) and 'richText'.
  3943. * 'html' is used for rendering tooltip in extra DOM form, and the result
  3944. * string is used as DOM HTML content.
  3945. * 'richText' is used for rendering tooltip in rich text form, for those where
  3946. * DOM operation is not supported.
  3947. * @return formatted tooltip with `html` and `markers`
  3948. * Notice: The override method can also return string
  3949. */
  3950. formatTooltip(dataIndex: number, multipleSeries?: boolean, dataType?: SeriesDataType): ReturnType<DataFormatMixin['formatTooltip']>;
  3951. isAnimationEnabled(): boolean;
  3952. restoreData(): void;
  3953. getColorFromPalette(name: string, scope: any, requestColorNum?: number): ZRColor;
  3954. /**
  3955. * Use `data.mapDimensionsAll(coordDim)` instead.
  3956. * @deprecated
  3957. */
  3958. coordDimToDataDim(coordDim: DimensionName): DimensionName[];
  3959. /**
  3960. * Get progressive rendering count each step
  3961. */
  3962. getProgressive(): number | false;
  3963. /**
  3964. * Get progressive rendering count each step
  3965. */
  3966. getProgressiveThreshold(): number;
  3967. select(innerDataIndices: number[], dataType?: SeriesDataType): void;
  3968. unselect(innerDataIndices: number[], dataType?: SeriesDataType): void;
  3969. toggleSelect(innerDataIndices: number[], dataType?: SeriesDataType): void;
  3970. getSelectedDataIndices(): number[];
  3971. isSelected(dataIndex: number, dataType?: SeriesDataType): boolean;
  3972. isUniversalTransitionEnabled(): boolean;
  3973. private _innerSelect;
  3974. private _initSelectedMapFromData;
  3975. static registerClass(clz: Constructor): Constructor;
  3976. }
  3977. interface SeriesModel<Opt extends SeriesOption = SeriesOption> extends DataFormatMixin, PaletteMixin<Opt>, DataHost {
  3978. /**
  3979. * Get dimension to render shadow in dataZoom component
  3980. */
  3981. getShadowDim?(): string;
  3982. }
  3983. /**
  3984. * Multi dimensional data store
  3985. */
  3986. declare const dataCtors: {
  3987. readonly float: ArrayConstructor | Float64ArrayConstructor;
  3988. readonly int: ArrayConstructor | Int32ArrayConstructor;
  3989. readonly ordinal: ArrayConstructor;
  3990. readonly number: ArrayConstructor;
  3991. readonly time: ArrayConstructor | Float64ArrayConstructor;
  3992. };
  3993. declare type DataStoreDimensionType = keyof typeof dataCtors;
  3994. declare type EachCb = (...args: any) => void;
  3995. declare type FilterCb = (...args: any) => boolean;
  3996. declare type MapCb = (...args: any) => ParsedValue | ParsedValue[];
  3997. declare type DimValueGetter = (this: DataStore, dataItem: any, property: string, dataIndex: number, dimIndex: DimensionIndex) => ParsedValue;
  3998. interface DataStoreDimensionDefine {
  3999. /**
  4000. * Default to be float.
  4001. */
  4002. type?: DataStoreDimensionType;
  4003. /**
  4004. * Only used in SOURCE_FORMAT_OBJECT_ROWS and SOURCE_FORMAT_KEYED_COLUMNS to retrieve value
  4005. * by "object property".
  4006. * For example, in `[{bb: 124, aa: 543}, ...]`, "aa" and "bb" is "object property".
  4007. *
  4008. * Deliberately name it as "property" rather than "name" to prevent it from been used in
  4009. * SOURCE_FORMAT_ARRAY_ROWS, because if it comes from series, it probably
  4010. * can not be shared by different series.
  4011. */
  4012. property?: string;
  4013. /**
  4014. * When using category axis.
  4015. * Category strings will be collected and stored in ordinalMeta.categories.
  4016. * And store will store the index of categories.
  4017. */
  4018. ordinalMeta?: OrdinalMeta;
  4019. /**
  4020. * Offset for ordinal parsing and collect
  4021. */
  4022. ordinalOffset?: number;
  4023. }
  4024. /**
  4025. * Basically, DataStore API keep immutable.
  4026. */
  4027. declare class DataStore {
  4028. private _chunks;
  4029. private _provider;
  4030. private _rawExtent;
  4031. private _extent;
  4032. private _indices;
  4033. private _count;
  4034. private _rawCount;
  4035. private _dimensions;
  4036. private _dimValueGetter;
  4037. private _calcDimNameToIdx;
  4038. defaultDimValueGetter: DimValueGetter;
  4039. /**
  4040. * Initialize from data
  4041. */
  4042. initData(provider: DataProvider, inputDimensions: DataStoreDimensionDefine[], dimValueGetter?: DimValueGetter): void;
  4043. getProvider(): DataProvider;
  4044. /**
  4045. * Caution: even when a `source` instance owned by a series, the created data store
  4046. * may still be shared by different sereis (the source hash does not use all `source`
  4047. * props, see `sourceManager`). In this case, the `source` props that are not used in
  4048. * hash (like `source.dimensionDefine`) probably only belongs to a certain series and
  4049. * thus should not be fetch here.
  4050. */
  4051. getSource(): Source;
  4052. /**
  4053. * @caution Only used in dataStack.
  4054. */
  4055. ensureCalculationDimension(dimName: DimensionName, type: DataStoreDimensionType): DimensionIndex;
  4056. collectOrdinalMeta(dimIdx: number, ordinalMeta: OrdinalMeta): void;
  4057. getOrdinalMeta(dimIdx: number): OrdinalMeta;
  4058. getDimensionProperty(dimIndex: DimensionIndex): DataStoreDimensionDefine['property'];
  4059. /**
  4060. * Caution: Can be only called on raw data (before `this._indices` created).
  4061. */
  4062. appendData(data: ArrayLike<any>): number[];
  4063. appendValues(values: any[][], minFillLen?: number): {
  4064. start: number;
  4065. end: number;
  4066. };
  4067. private _initDataFromProvider;
  4068. count(): number;
  4069. /**
  4070. * Get value. Return NaN if idx is out of range.
  4071. */
  4072. get(dim: DimensionIndex, idx: number): ParsedValue;
  4073. getValues(idx: number): ParsedValue[];
  4074. getValues(dimensions: readonly DimensionIndex[], idx?: number): ParsedValue[];
  4075. /**
  4076. * @param dim concrete dim
  4077. */
  4078. getByRawIndex(dim: DimensionIndex, rawIdx: number): ParsedValue;
  4079. /**
  4080. * Get sum of data in one dimension
  4081. */
  4082. getSum(dim: DimensionIndex): number;
  4083. /**
  4084. * Get median of data in one dimension
  4085. */
  4086. getMedian(dim: DimensionIndex): number;
  4087. /**
  4088. * Retrieve the index with given raw data index.
  4089. */
  4090. indexOfRawIndex(rawIndex: number): number;
  4091. /**
  4092. * Retrieve the index of nearest value.
  4093. * @param dim
  4094. * @param value
  4095. * @param [maxDistance=Infinity]
  4096. * @return If and only if multiple indices have
  4097. * the same value, they are put to the result.
  4098. */
  4099. indicesOfNearest(dim: DimensionIndex, value: number, maxDistance?: number): number[];
  4100. getIndices(): ArrayLike<number>;
  4101. /**
  4102. * Data filter.
  4103. */
  4104. filter(dims: DimensionIndex[], cb: FilterCb): DataStore;
  4105. /**
  4106. * Select data in range. (For optimization of filter)
  4107. * (Manually inline code, support 5 million data filtering in data zoom.)
  4108. */
  4109. selectRange(range: {
  4110. [dimIdx: number]: [number, number];
  4111. }): DataStore;
  4112. /**
  4113. * Data mapping to a new List with given dimensions
  4114. */
  4115. map(dims: DimensionIndex[], cb: MapCb): DataStore;
  4116. /**
  4117. * @caution Danger!! Only used in dataStack.
  4118. */
  4119. modify(dims: DimensionIndex[], cb: MapCb): void;
  4120. private _updateDims;
  4121. /**
  4122. * Large data down sampling using largest-triangle-three-buckets
  4123. * @param {string} valueDimension
  4124. * @param {number} targetCount
  4125. */
  4126. lttbDownSample(valueDimension: DimensionIndex, rate: number): DataStore;
  4127. /**
  4128. * Large data down sampling on given dimension
  4129. * @param sampleIndex Sample index for name and id
  4130. */
  4131. downSample(dimension: DimensionIndex, rate: number, sampleValue: (frameValues: ArrayLike<ParsedValue>) => ParsedValueNumeric, sampleIndex: (frameValues: ArrayLike<ParsedValue>, value: ParsedValueNumeric) => number): DataStore;
  4132. /**
  4133. * Data iteration
  4134. * @param ctx default this
  4135. * @example
  4136. * list.each('x', function (x, idx) {});
  4137. * list.each(['x', 'y'], function (x, y, idx) {});
  4138. * list.each(function (idx) {})
  4139. */
  4140. each(dims: DimensionIndex[], cb: EachCb): void;
  4141. /**
  4142. * Get extent of data in one dimension
  4143. */
  4144. getDataExtent(dim: DimensionIndex): [number, number];
  4145. /**
  4146. * Get raw data index.
  4147. * Do not initialize.
  4148. * Default `getRawIndex`. And it can be changed.
  4149. */
  4150. getRawIndex: (idx: number) => number;
  4151. /**
  4152. * Get raw data item
  4153. */
  4154. getRawDataItem(idx: number): OptionDataItem;
  4155. /**
  4156. * Clone shallow.
  4157. *
  4158. * @param clonedDims Determine which dims to clone. Will share the data if not specified.
  4159. */
  4160. clone(clonedDims?: DimensionIndex[], ignoreIndices?: boolean): DataStore;
  4161. private _copyCommonProps;
  4162. private _cloneIndices;
  4163. private _getRawIdxIdentity;
  4164. private _getRawIdx;
  4165. private _updateGetRawIdx;
  4166. private static internalField;
  4167. }
  4168. declare class SeriesDimensionDefine {
  4169. /**
  4170. * Dimension type. The enumerable values are the key of
  4171. * Optional.
  4172. */
  4173. type?: DimensionType;
  4174. /**
  4175. * Dimension name.
  4176. * Mandatory.
  4177. */
  4178. name: string;
  4179. /**
  4180. * The origin name in dimsDef, see source helper.
  4181. * If displayName given, the tooltip will displayed vertically.
  4182. * Optional.
  4183. */
  4184. displayName?: string;
  4185. tooltip?: boolean;
  4186. /**
  4187. * This dimension maps to the the dimension in dataStore by `storeDimIndex`.
  4188. * Notice the facts:
  4189. * 1. When there are too many dimensions in data store, seriesData only save the
  4190. * used store dimensions.
  4191. * 2. We use dimensionIndex but not name to reference store dimension
  4192. * becuause the dataset dimension definition might has no name specified by users,
  4193. * or names in sereis dimension definition might be different from dataset.
  4194. */
  4195. storeDimIndex?: number;
  4196. /**
  4197. * Which coordSys dimension this dimension mapped to.
  4198. * A `coordDim` can be a "coordSysDim" that the coordSys required
  4199. * (for example, an item in `coordSysDims` of `model/referHelper#CoordSysInfo`),
  4200. * or an generated "extra coord name" if does not mapped to any "coordSysDim"
  4201. * (That is determined by whether `isExtraCoord` is `true`).
  4202. * Mandatory.
  4203. */
  4204. coordDim?: string;
  4205. /**
  4206. * The index of this dimension in `series.encode[coordDim]`.
  4207. * Mandatory.
  4208. */
  4209. coordDimIndex?: number;
  4210. /**
  4211. * The format of `otherDims` is:
  4212. * ```js
  4213. * {
  4214. * tooltip?: number
  4215. * label?: number
  4216. * itemName?: number
  4217. * seriesName?: number
  4218. * }
  4219. * ```
  4220. *
  4221. * A `series.encode` can specified these fields:
  4222. * ```js
  4223. * encode: {
  4224. * // "3, 1, 5" is the index of data dimension.
  4225. * tooltip: [3, 1, 5],
  4226. * label: [0, 3],
  4227. * ...
  4228. * }
  4229. * ```
  4230. * `otherDims` is the parse result of the `series.encode` above, like:
  4231. * ```js
  4232. * // Suppose the index of this data dimension is `3`.
  4233. * this.otherDims = {
  4234. * // `3` is at the index `0` of the `encode.tooltip`
  4235. * tooltip: 0,
  4236. * // `3` is at the index `1` of the `encode.label`
  4237. * label: 1
  4238. * };
  4239. * ```
  4240. *
  4241. * This prop should never be `null`/`undefined` after initialized.
  4242. */
  4243. otherDims?: DataVisualDimensions;
  4244. /**
  4245. * Be `true` if this dimension is not mapped to any "coordSysDim" that the
  4246. * "coordSys" required.
  4247. * Mandatory.
  4248. */
  4249. isExtraCoord?: boolean;
  4250. /**
  4251. * If this dimension if for calculated value like stacking
  4252. */
  4253. isCalculationCoord?: boolean;
  4254. defaultTooltip?: boolean;
  4255. ordinalMeta?: OrdinalMeta;
  4256. /**
  4257. * Whether to create inverted indices.
  4258. */
  4259. createInvertedIndices?: boolean;
  4260. /**
  4261. * @param opt All of the fields will be shallow copied.
  4262. */
  4263. constructor(opt?: object | SeriesDimensionDefine);
  4264. }
  4265. /**
  4266. * Represents the dimension requirement of a series.
  4267. *
  4268. * NOTICE:
  4269. * When there are too many dimensions in dataset and many series, only the used dimensions
  4270. * (i.e., used by coord sys and declared in `series.encode`) are add to `dimensionDefineList`.
  4271. * But users may query data by other unused dimension names.
  4272. * In this case, users can only query data if and only if they have defined dimension names
  4273. * via ec option, so we provide `getDimensionIndexFromSource`, which only query them from
  4274. * `source` dimensions.
  4275. */
  4276. declare class SeriesDataSchema {
  4277. /**
  4278. * When there are too many dimensions, `dimensionDefineList` might only contain
  4279. * used dimensions.
  4280. *
  4281. * CAUTION:
  4282. * Should have been sorted by `storeDimIndex` asc.
  4283. *
  4284. * PENDING:
  4285. * The item can still be modified outsite.
  4286. * But MUST NOT add/remove item of this array.
  4287. */
  4288. readonly dimensions: SeriesDimensionDefine[];
  4289. readonly source: Source;
  4290. private _fullDimCount;
  4291. private _dimNameMap;
  4292. private _dimOmitted;
  4293. constructor(opt: {
  4294. source: Source;
  4295. dimensions: SeriesDimensionDefine[];
  4296. fullDimensionCount: number;
  4297. dimensionOmitted: boolean;
  4298. });
  4299. isDimensionOmitted(): boolean;
  4300. private _updateDimOmitted;
  4301. /**
  4302. * @caution Can only be used when `dimensionOmitted: true`.
  4303. *
  4304. * Get index by user defined dimension name (i.e., not internal generate name).
  4305. * That is, get index from `dimensionsDefine`.
  4306. * If no `dimensionsDefine`, or no name get, return -1.
  4307. */
  4308. getSourceDimensionIndex(dimName: DimensionName): DimensionIndex;
  4309. /**
  4310. * @caution Can only be used when `dimensionOmitted: true`.
  4311. *
  4312. * Notice: may return `null`/`undefined` if user not specify dimension names.
  4313. */
  4314. getSourceDimension(dimIndex: DimensionIndex): DimensionDefinition;
  4315. makeStoreSchema(): {
  4316. dimensions: DataStoreDimensionDefine[];
  4317. hash: string;
  4318. };
  4319. makeOutputDimensionNames(): DimensionName[];
  4320. appendCalculationDimension(dimDef: SeriesDimensionDefine): void;
  4321. }
  4322. /**
  4323. * [REQUIREMENT_MEMO]:
  4324. * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option.
  4325. * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and
  4326. * `root-dataset`. Them on `series` has higher priority.
  4327. * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might
  4328. * confuse users: whether those props indicate how to visit the upstream source or visit
  4329. * the transform result source, and some transforms has nothing to do with these props,
  4330. * and some transforms might have multiple upstream.
  4331. * (3) Transforms should specify `metaRawOption` in each output, just like they can be
  4332. * declared in `root-dataset`.
  4333. * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms.
  4334. * That is for reducing complexity in transforms.
  4335. * PENDING: Whether to provide transposition transform?
  4336. *
  4337. * [IMPLEMENTAION_MEMO]:
  4338. * "sourceVisitConfig" are calculated from `metaRawOption` and `data`.
  4339. * They will not be calculated until `source` is about to be visited (to prevent from
  4340. * duplicate calcuation). `source` is visited only in series and input to transforms.
  4341. *
  4342. * [DIMENSION_INHERIT_RULE]:
  4343. * By default the dimensions are inherited from ancestors, unless a transform return
  4344. * a new dimensions definition.
  4345. * Consider the case:
  4346. * ```js
  4347. * dataset: [{
  4348. * source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...]
  4349. * }, {
  4350. * transform: { type: 'filter', ... }
  4351. * }]
  4352. * dataset: [{
  4353. * dimension: ['Product', 'Sales', 'Prise'],
  4354. * source: [ ['Cookies', 321, 44.21], ...]
  4355. * }, {
  4356. * transform: { type: 'filter', ... }
  4357. * }]
  4358. * ```
  4359. * The two types of option should have the same behavior after transform.
  4360. *
  4361. *
  4362. * [SCENARIO]:
  4363. * (1) Provide source data directly:
  4364. * ```js
  4365. * series: {
  4366. * encode: {...},
  4367. * dimensions: [...]
  4368. * seriesLayoutBy: 'row',
  4369. * data: [[...]]
  4370. * }
  4371. * ```
  4372. * (2) Series refer to dataset.
  4373. * ```js
  4374. * series: [{
  4375. * encode: {...}
  4376. * // Ignore datasetIndex means `datasetIndex: 0`
  4377. * // and the dimensions defination in dataset is used
  4378. * }, {
  4379. * encode: {...},
  4380. * seriesLayoutBy: 'column',
  4381. * datasetIndex: 1
  4382. * }]
  4383. * ```
  4384. * (3) dataset transform
  4385. * ```js
  4386. * dataset: [{
  4387. * source: [...]
  4388. * }, {
  4389. * source: [...]
  4390. * }, {
  4391. * // By default from 0.
  4392. * transform: { type: 'filter', config: {...} }
  4393. * }, {
  4394. * // Piped.
  4395. * transform: [
  4396. * { type: 'filter', config: {...} },
  4397. * { type: 'sort', config: {...} }
  4398. * ]
  4399. * }, {
  4400. * id: 'regressionData',
  4401. * fromDatasetIndex: 1,
  4402. * // Third-party transform
  4403. * transform: { type: 'ecStat:regression', config: {...} }
  4404. * }, {
  4405. * // retrieve the extra result.
  4406. * id: 'regressionFormula',
  4407. * fromDatasetId: 'regressionData',
  4408. * fromTransformResult: 1
  4409. * }]
  4410. * ```
  4411. */
  4412. declare class SourceManager {
  4413. private _sourceHost;
  4414. private _sourceList;
  4415. private _storeList;
  4416. private _upstreamSignList;
  4417. private _versionSignBase;
  4418. private _dirty;
  4419. constructor(sourceHost: DatasetModel | SeriesModel);
  4420. /**
  4421. * Mark dirty.
  4422. */
  4423. dirty(): void;
  4424. private _setLocalSource;
  4425. /**
  4426. * For detecting whether the upstream source is dirty, so that
  4427. * the local cached source (in `_sourceList`) should be discarded.
  4428. */
  4429. private _getVersionSign;
  4430. /**
  4431. * Always return a source instance. Otherwise throw error.
  4432. */
  4433. prepareSource(): void;
  4434. private _createSource;
  4435. private _applyTransform;
  4436. private _isDirty;
  4437. /**
  4438. * @param sourceIndex By default 0, means "main source".
  4439. * In most cases there is only one source.
  4440. */
  4441. getSource(sourceIndex?: number): Source;
  4442. /**
  4443. *
  4444. * Get a data store which can be shared across series.
  4445. * Only available for series.
  4446. *
  4447. * @param seriesDimRequest Dimensions that are generated in series.
  4448. * Should have been sorted by `storeDimIndex` asc.
  4449. */
  4450. getSharedDataStore(seriesDimRequest: SeriesDataSchema): DataStore;
  4451. private _innerGetDataStore;
  4452. /**
  4453. * PENDING: Is it fast enough?
  4454. * If no upstream, return empty array.
  4455. */
  4456. private _getUpstreamSourceManagers;
  4457. private _getSourceMetaRawOption;
  4458. }
  4459. /**
  4460. * This module is imported by echarts directly.
  4461. *
  4462. * Notice:
  4463. * Always keep this file exists for backward compatibility.
  4464. * Because before 4.1.0, dataset is an optional component,
  4465. * some users may import this module manually.
  4466. */
  4467. interface DatasetOption extends Pick<ComponentOption, 'type' | 'id' | 'name'>, Pick<SeriesEncodeOptionMixin, 'dimensions'> {
  4468. mainType?: 'dataset';
  4469. seriesLayoutBy?: SeriesLayoutBy;
  4470. sourceHeader?: OptionSourceHeader;
  4471. source?: OptionSourceData;
  4472. fromDatasetIndex?: number;
  4473. fromDatasetId?: string;
  4474. transform?: DataTransformOption | PipedDataTransformOption;
  4475. fromTransformResult?: number;
  4476. }
  4477. declare class DatasetModel<Opts extends DatasetOption = DatasetOption> extends ComponentModel<Opts> {
  4478. type: string;
  4479. static type: string;
  4480. static defaultOption: DatasetOption;
  4481. private _sourceManager;
  4482. init(option: Opts, parentModel: Model, ecModel: GlobalModel): void;
  4483. mergeOption(newOption: Opts, ecModel: GlobalModel): void;
  4484. optionUpdated(): void;
  4485. getSourceManager(): SourceManager;
  4486. }
  4487. /**
  4488. * [sourceFormat]
  4489. *
  4490. * + "original":
  4491. * This format is only used in series.data, where
  4492. * itemStyle can be specified in data item.
  4493. *
  4494. * + "arrayRows":
  4495. * [
  4496. * ['product', 'score', 'amount'],
  4497. * ['Matcha Latte', 89.3, 95.8],
  4498. * ['Milk Tea', 92.1, 89.4],
  4499. * ['Cheese Cocoa', 94.4, 91.2],
  4500. * ['Walnut Brownie', 85.4, 76.9]
  4501. * ]
  4502. *
  4503. * + "objectRows":
  4504. * [
  4505. * {product: 'Matcha Latte', score: 89.3, amount: 95.8},
  4506. * {product: 'Milk Tea', score: 92.1, amount: 89.4},
  4507. * {product: 'Cheese Cocoa', score: 94.4, amount: 91.2},
  4508. * {product: 'Walnut Brownie', score: 85.4, amount: 76.9}
  4509. * ]
  4510. *
  4511. * + "keyedColumns":
  4512. * {
  4513. * 'product': ['Matcha Latte', 'Milk Tea', 'Cheese Cocoa', 'Walnut Brownie'],
  4514. * 'count': [823, 235, 1042, 988],
  4515. * 'score': [95.8, 81.4, 91.2, 76.9]
  4516. * }
  4517. *
  4518. * + "typedArray"
  4519. *
  4520. * + "unknown"
  4521. */
  4522. interface SourceMetaRawOption {
  4523. seriesLayoutBy: SeriesLayoutBy;
  4524. sourceHeader: OptionSourceHeader;
  4525. dimensions: DimensionDefinitionLoose[];
  4526. }
  4527. interface Source extends SourceImpl {
  4528. }
  4529. declare class SourceImpl {
  4530. /**
  4531. * Not null/undefined.
  4532. */
  4533. readonly data: OptionSourceData;
  4534. /**
  4535. * See also "detectSourceFormat".
  4536. * Not null/undefined.
  4537. */
  4538. readonly sourceFormat: SourceFormat;
  4539. /**
  4540. * 'row' or 'column'
  4541. * Not null/undefined.
  4542. */
  4543. readonly seriesLayoutBy: SeriesLayoutBy;
  4544. /**
  4545. * dimensions definition from:
  4546. * (1) standalone defined in option prop `dimensions: [...]`
  4547. * (2) detected from option data. See `determineSourceDimensions`.
  4548. * If can not be detected (e.g., there is only pure data `[[11, 33], ...]`
  4549. * `dimensionsDefine` will be null/undefined.
  4550. */
  4551. readonly dimensionsDefine: DimensionDefinition[];
  4552. /**
  4553. * Only make sense in `SOURCE_FORMAT_ARRAY_ROWS`.
  4554. * That is the same as `sourceHeader: number`,
  4555. * which means from which line the real data start.
  4556. * Not null/undefined, uint.
  4557. */
  4558. readonly startIndex: number;
  4559. /**
  4560. * Dimension count detected from data. Only works when `dimensionDefine`
  4561. * does not exists.
  4562. * Can be null/undefined (when unknown), uint.
  4563. */
  4564. readonly dimensionsDetectedCount: number;
  4565. /**
  4566. * Raw props from user option.
  4567. */
  4568. readonly metaRawOption: SourceMetaRawOption;
  4569. constructor(fields: {
  4570. data: OptionSourceData;
  4571. sourceFormat: SourceFormat;
  4572. seriesLayoutBy?: SeriesLayoutBy;
  4573. dimensionsDefine?: DimensionDefinition[];
  4574. startIndex?: number;
  4575. dimensionsDetectedCount?: number;
  4576. metaRawOption?: SourceMetaRawOption;
  4577. encodeDefine?: HashMap<OptionEncodeValue, DimensionName>;
  4578. });
  4579. }
  4580. interface DataProvider {
  4581. /**
  4582. * true: all of the value are in primitive type (in type `OptionDataValue`).
  4583. * false: Not sure whether any of them is non primitive type (in type `OptionDataItemObject`).
  4584. * Like `data: [ { value: xx, itemStyle: {...} }, ...]`
  4585. * At present it only happen in `SOURCE_FORMAT_ORIGINAL`.
  4586. */
  4587. pure?: boolean;
  4588. /**
  4589. * If data is persistent and will not be released after use.
  4590. */
  4591. persistent?: boolean;
  4592. getSource(): Source;
  4593. count(): number;
  4594. getItem(idx: number, out?: OptionDataItem): OptionDataItem;
  4595. fillStorage?(start: number, end: number, out: ArrayLike$1<ParsedValue>[], extent: number[][]): void;
  4596. appendData?(newData: ArrayLike$1<OptionDataItem>): void;
  4597. clean?(): void;
  4598. }
  4599. declare type DimensionSummaryEncode = {
  4600. defaultedLabel: DimensionName[];
  4601. defaultedTooltip: DimensionName[];
  4602. [coordOrVisualDimName: string]: DimensionName[];
  4603. };
  4604. declare type DimensionSummary = {
  4605. encode: DimensionSummaryEncode;
  4606. userOutput: DimensionUserOuput;
  4607. dataDimsOnCoord: DimensionName[];
  4608. dataDimIndicesOnCoord: DimensionIndex[];
  4609. encodeFirstDimNotExtra: {
  4610. [coordDim: string]: DimensionName;
  4611. };
  4612. };
  4613. declare type DimensionUserOuputEncode = {
  4614. [coordOrVisualDimName: string]: DimensionIndex[];
  4615. };
  4616. declare class DimensionUserOuput {
  4617. private _encode;
  4618. private _cachedDimNames;
  4619. private _schema?;
  4620. constructor(encode: DimensionUserOuputEncode, dimRequest?: SeriesDataSchema);
  4621. get(): {
  4622. fullDimensions: DimensionName[];
  4623. encode: DimensionUserOuputEncode;
  4624. };
  4625. /**
  4626. * Get all data store dimension names.
  4627. * Theoretically a series data store is defined both by series and used dataset (if any).
  4628. * If some dimensions are omitted for performance reason in `this.dimensions`,
  4629. * the dimension name may not be auto-generated if user does not specify a dimension name.
  4630. * In this case, the dimension name is `null`/`undefined`.
  4631. */
  4632. private _getFullDimensionNames;
  4633. }
  4634. declare class Graph {
  4635. type: 'graph';
  4636. readonly nodes: GraphNode[];
  4637. readonly edges: GraphEdge[];
  4638. data: SeriesData;
  4639. edgeData: SeriesData;
  4640. /**
  4641. * Whether directed graph.
  4642. */
  4643. private _directed;
  4644. private _nodesMap;
  4645. /**
  4646. * @type {Object.<string, module:echarts/data/Graph.Edge>}
  4647. * @private
  4648. */
  4649. private _edgesMap;
  4650. constructor(directed?: boolean);
  4651. /**
  4652. * If is directed graph
  4653. */
  4654. isDirected(): boolean;
  4655. /**
  4656. * Add a new node
  4657. */
  4658. addNode(id: string | number, dataIndex?: number): GraphNode;
  4659. /**
  4660. * Get node by data index
  4661. */
  4662. getNodeByIndex(dataIndex: number): GraphNode;
  4663. /**
  4664. * Get node by id
  4665. */
  4666. getNodeById(id: string): GraphNode;
  4667. /**
  4668. * Add a new edge
  4669. */
  4670. addEdge(n1: GraphNode | number | string, n2: GraphNode | number | string, dataIndex?: number): GraphEdge;
  4671. /**
  4672. * Get edge by data index
  4673. */
  4674. getEdgeByIndex(dataIndex: number): GraphEdge;
  4675. /**
  4676. * Get edge by two linked nodes
  4677. */
  4678. getEdge(n1: string | GraphNode, n2: string | GraphNode): GraphEdge;
  4679. /**
  4680. * Iterate all nodes
  4681. */
  4682. eachNode<Ctx>(cb: (this: Ctx, node: GraphNode, idx: number) => void, context?: Ctx): void;
  4683. /**
  4684. * Iterate all edges
  4685. */
  4686. eachEdge<Ctx>(cb: (this: Ctx, edge: GraphEdge, idx: number) => void, context?: Ctx): void;
  4687. /**
  4688. * Breadth first traverse
  4689. * Return true to stop traversing
  4690. */
  4691. breadthFirstTraverse<Ctx>(cb: (this: Ctx, node: GraphNode, fromNode: GraphNode) => boolean | void, startNode: GraphNode | string, direction: 'none' | 'in' | 'out', context?: Ctx): void;
  4692. update(): void;
  4693. /**
  4694. * @return {module:echarts/data/Graph}
  4695. */
  4696. clone(): Graph;
  4697. }
  4698. interface GraphDataProxyMixin {
  4699. getValue(dimension?: DimensionLoose): ParsedValue;
  4700. setVisual(key: string | Dictionary<any>, value?: any): void;
  4701. getVisual(key: string): any;
  4702. setLayout(layout: any, merge?: boolean): void;
  4703. getLayout(): any;
  4704. getGraphicEl(): Element;
  4705. getRawIndex(): number;
  4706. }
  4707. declare class GraphEdge {
  4708. /**
  4709. * The first node. If directed graph, it represents the source node.
  4710. */
  4711. node1: GraphNode;
  4712. /**
  4713. * The second node. If directed graph, it represents the target node.
  4714. */
  4715. node2: GraphNode;
  4716. dataIndex: number;
  4717. hostGraph: Graph;
  4718. constructor(n1: GraphNode, n2: GraphNode, dataIndex?: number);
  4719. getModel<T = unknown>(): Model<T>;
  4720. getModel<T = unknown, S extends keyof T = keyof T>(path: S): Model<T[S]>;
  4721. getAdjacentDataIndices(): {
  4722. node: number[];
  4723. edge: number[];
  4724. };
  4725. }
  4726. interface GraphEdge extends GraphDataProxyMixin {
  4727. }
  4728. declare class GraphNode {
  4729. id: string;
  4730. inEdges: GraphEdge[];
  4731. outEdges: GraphEdge[];
  4732. edges: GraphEdge[];
  4733. hostGraph: Graph;
  4734. dataIndex: number;
  4735. __visited: boolean;
  4736. constructor(id?: string, dataIndex?: number);
  4737. /**
  4738. * @return {number}
  4739. */
  4740. degree(): number;
  4741. /**
  4742. * @return {number}
  4743. */
  4744. inDegree(): number;
  4745. /**
  4746. * @return {number}
  4747. */
  4748. outDegree(): number;
  4749. getModel<T = unknown>(): Model<T>;
  4750. getModel<T = unknown, S extends keyof T = keyof T>(path: S): Model<T[S]>;
  4751. getAdjacentDataIndices(): {
  4752. node: number[];
  4753. edge: number[];
  4754. };
  4755. }
  4756. interface GraphNode extends GraphDataProxyMixin {
  4757. }
  4758. declare type TreeTraverseOrder = 'preorder' | 'postorder';
  4759. declare type TreeTraverseCallback<Ctx> = (this: Ctx, node: TreeNode) => boolean | void;
  4760. declare type TreeTraverseOption = {
  4761. order?: TreeTraverseOrder;
  4762. attr?: 'children' | 'viewChildren';
  4763. };
  4764. interface TreeNodeOption extends Pick<OptionDataItemObject<OptionDataValue>, 'name' | 'value'> {
  4765. children?: TreeNodeOption[];
  4766. }
  4767. declare class TreeNode {
  4768. name: string;
  4769. depth: number;
  4770. height: number;
  4771. parentNode: TreeNode;
  4772. /**
  4773. * Reference to list item.
  4774. * Do not persistent dataIndex outside,
  4775. * besause it may be changed by list.
  4776. * If dataIndex -1,
  4777. * this node is logical deleted (filtered) in list.
  4778. */
  4779. dataIndex: number;
  4780. children: TreeNode[];
  4781. viewChildren: TreeNode[];
  4782. isExpand: boolean;
  4783. readonly hostTree: Tree<Model>;
  4784. constructor(name: string, hostTree: Tree<Model>);
  4785. /**
  4786. * The node is removed.
  4787. */
  4788. isRemoved(): boolean;
  4789. /**
  4790. * Travel this subtree (include this node).
  4791. * Usage:
  4792. * node.eachNode(function () { ... }); // preorder
  4793. * node.eachNode('preorder', function () { ... }); // preorder
  4794. * node.eachNode('postorder', function () { ... }); // postorder
  4795. * node.eachNode(
  4796. * {order: 'postorder', attr: 'viewChildren'},
  4797. * function () { ... }
  4798. * ); // postorder
  4799. *
  4800. * @param options If string, means order.
  4801. * @param options.order 'preorder' or 'postorder'
  4802. * @param options.attr 'children' or 'viewChildren'
  4803. * @param cb If in preorder and return false,
  4804. * its subtree will not be visited.
  4805. */
  4806. eachNode<Ctx>(options: TreeTraverseOrder, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4807. eachNode<Ctx>(options: TreeTraverseOption, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4808. eachNode<Ctx>(cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4809. /**
  4810. * Update depth and height of this subtree.
  4811. */
  4812. updateDepthAndHeight(depth: number): void;
  4813. getNodeById(id: string): TreeNode;
  4814. contains(node: TreeNode): boolean;
  4815. /**
  4816. * @param includeSelf Default false.
  4817. * @return order: [root, child, grandchild, ...]
  4818. */
  4819. getAncestors(includeSelf?: boolean): TreeNode[];
  4820. getAncestorsIndices(): number[];
  4821. getDescendantIndices(): number[];
  4822. getValue(dimension?: DimensionLoose): ParsedValue;
  4823. setLayout(layout: any, merge?: boolean): void;
  4824. /**
  4825. * @return {Object} layout
  4826. */
  4827. getLayout(): any;
  4828. getModel<T = unknown>(): Model<T>;
  4829. getLevelModel(): Model;
  4830. /**
  4831. * @example
  4832. * setItemVisual('color', color);
  4833. * setItemVisual({
  4834. * 'color': color
  4835. * });
  4836. */
  4837. setVisual(key: string, value: any): void;
  4838. setVisual(obj: Dictionary<any>): void;
  4839. /**
  4840. * Get item visual
  4841. * FIXME: make return type better
  4842. */
  4843. getVisual(key: string): unknown;
  4844. getRawIndex(): number;
  4845. getId(): string;
  4846. /**
  4847. * index in parent's children
  4848. */
  4849. getChildIndex(): number;
  4850. /**
  4851. * if this is an ancestor of another node
  4852. *
  4853. * @param node another node
  4854. * @return if is ancestor
  4855. */
  4856. isAncestorOf(node: TreeNode): boolean;
  4857. /**
  4858. * if this is an descendant of another node
  4859. *
  4860. * @param node another node
  4861. * @return if is descendant
  4862. */
  4863. isDescendantOf(node: TreeNode): boolean;
  4864. }
  4865. declare class Tree<HostModel extends Model = Model, LevelOption = any> {
  4866. type: 'tree';
  4867. root: TreeNode;
  4868. data: SeriesData;
  4869. hostModel: HostModel;
  4870. levelModels: Model<LevelOption>[];
  4871. private _nodes;
  4872. constructor(hostModel: HostModel);
  4873. /**
  4874. * Travel this subtree (include this node).
  4875. * Usage:
  4876. * node.eachNode(function () { ... }); // preorder
  4877. * node.eachNode('preorder', function () { ... }); // preorder
  4878. * node.eachNode('postorder', function () { ... }); // postorder
  4879. * node.eachNode(
  4880. * {order: 'postorder', attr: 'viewChildren'},
  4881. * function () { ... }
  4882. * ); // postorder
  4883. *
  4884. * @param options If string, means order.
  4885. * @param options.order 'preorder' or 'postorder'
  4886. * @param options.attr 'children' or 'viewChildren'
  4887. * @param cb
  4888. * @param context
  4889. */
  4890. eachNode<Ctx>(options: TreeTraverseOrder, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4891. eachNode<Ctx>(options: TreeTraverseOption, cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4892. eachNode<Ctx>(cb: TreeTraverseCallback<Ctx>, context?: Ctx): void;
  4893. getNodeByDataIndex(dataIndex: number): TreeNode;
  4894. getNodeById(name: string): TreeNode;
  4895. /**
  4896. * Update item available by list,
  4897. * when list has been performed options like 'filterSelf' or 'map'.
  4898. */
  4899. update(): void;
  4900. /**
  4901. * Clear all layouts
  4902. */
  4903. clearLayouts(): void;
  4904. /**
  4905. * data node format:
  4906. * {
  4907. * name: ...
  4908. * value: ...
  4909. * children: [
  4910. * {
  4911. * name: ...
  4912. * value: ...
  4913. * children: ...
  4914. * },
  4915. * ...
  4916. * ]
  4917. * }
  4918. */
  4919. static createTree<T extends TreeNodeOption, HostModel extends Model>(dataRoot: T, hostModel: HostModel, beforeLink?: (data: SeriesData) => void): Tree<HostModel, any>;
  4920. }
  4921. declare type VisualOptionBase = {
  4922. [key in BuiltinVisualProperty]?: any;
  4923. };
  4924. declare type LabelFormatter = (min: OptionDataValue, max?: OptionDataValue) => string;
  4925. interface VisualMapOption<T extends VisualOptionBase = VisualOptionBase> extends ComponentOption, BoxLayoutOptionMixin, BorderOptionMixin {
  4926. mainType?: 'visualMap';
  4927. show?: boolean;
  4928. align?: string;
  4929. realtime?: boolean;
  4930. /**
  4931. * 'all' or null/undefined: all series.
  4932. * A number or an array of number: the specified series.
  4933. * set min: 0, max: 200, only for campatible with ec2.
  4934. * In fact min max should not have default value.
  4935. */
  4936. seriesIndex?: 'all' | number[] | number;
  4937. /**
  4938. * min value, must specified if pieces is not specified.
  4939. */
  4940. min?: number;
  4941. /**
  4942. * max value, must specified if pieces is not specified.
  4943. */
  4944. max?: number;
  4945. /**
  4946. * Dimension to be encoded
  4947. */
  4948. dimension?: number;
  4949. /**
  4950. * Visual configuration for the data in selection
  4951. */
  4952. inRange?: T;
  4953. /**
  4954. * Visual configuration for the out of selection
  4955. */
  4956. outOfRange?: T;
  4957. controller?: {
  4958. inRange?: T;
  4959. outOfRange?: T;
  4960. };
  4961. target?: {
  4962. inRange?: T;
  4963. outOfRange?: T;
  4964. };
  4965. /**
  4966. * Width of the display item
  4967. */
  4968. itemWidth?: number;
  4969. /**
  4970. * Height of the display item
  4971. */
  4972. itemHeight?: number;
  4973. inverse?: boolean;
  4974. orient?: 'horizontal' | 'vertical';
  4975. backgroundColor?: ZRColor;
  4976. contentColor?: ZRColor;
  4977. inactiveColor?: ZRColor;
  4978. /**
  4979. * Padding of the component. Can be an array similar to CSS
  4980. */
  4981. padding?: number[] | number;
  4982. /**
  4983. * Gap between text and item
  4984. */
  4985. textGap?: number;
  4986. precision?: number;
  4987. /**
  4988. * @deprecated
  4989. * Option from version 2
  4990. */
  4991. color?: ColorString[];
  4992. formatter?: string | LabelFormatter;
  4993. /**
  4994. * Text on the both end. Such as ['High', 'Low']
  4995. */
  4996. text?: string[];
  4997. textStyle?: LabelOption;
  4998. categories?: unknown;
  4999. }
  5000. interface VisualMeta {
  5001. stops: {
  5002. value: number;
  5003. color: ColorString;
  5004. }[];
  5005. outerColors: ColorString[];
  5006. dimension?: DimensionIndex;
  5007. }
  5008. declare type ItrParamDims = DimensionLoose | Array<DimensionLoose>;
  5009. declare type CtxOrList<Ctx> = unknown extends Ctx ? SeriesData : Ctx;
  5010. declare type EachCb0<Ctx> = (this: CtxOrList<Ctx>, idx: number) => void;
  5011. declare type EachCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => void;
  5012. declare type EachCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => void;
  5013. declare type EachCb$1<Ctx> = (this: CtxOrList<Ctx>, ...args: any) => void;
  5014. declare type FilterCb0<Ctx> = (this: CtxOrList<Ctx>, idx: number) => boolean;
  5015. declare type FilterCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => boolean;
  5016. declare type FilterCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => boolean;
  5017. declare type FilterCb$1<Ctx> = (this: CtxOrList<Ctx>, ...args: any) => boolean;
  5018. declare type MapArrayCb0<Ctx> = (this: CtxOrList<Ctx>, idx: number) => any;
  5019. declare type MapArrayCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => any;
  5020. declare type MapArrayCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => any;
  5021. declare type MapArrayCb<Ctx> = (this: CtxOrList<Ctx>, ...args: any) => any;
  5022. declare type MapCb1<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, idx: number) => ParsedValue | ParsedValue[];
  5023. declare type MapCb2<Ctx> = (this: CtxOrList<Ctx>, x: ParsedValue, y: ParsedValue, idx: number) => ParsedValue | ParsedValue[];
  5024. declare type SeriesDimensionDefineLoose = string | object | SeriesDimensionDefine;
  5025. declare type SeriesDimensionLoose = DimensionLoose;
  5026. declare type SeriesDimensionName = DimensionName;
  5027. interface DefaultDataVisual {
  5028. style: PathStyleProps;
  5029. drawType: 'fill' | 'stroke';
  5030. symbol?: string;
  5031. symbolSize?: number | number[];
  5032. symbolRotate?: number;
  5033. symbolKeepAspect?: boolean;
  5034. symbolOffset?: string | number | (string | number)[];
  5035. liftZ?: number;
  5036. legendIcon?: string;
  5037. legendLineStyle?: LineStyleProps;
  5038. visualMeta?: VisualMeta[];
  5039. colorFromPalette?: boolean;
  5040. decal?: DecalObject;
  5041. }
  5042. interface DataCalculationInfo<SERIES_MODEL> {
  5043. stackedDimension: DimensionName;
  5044. stackedByDimension: DimensionName;
  5045. isStackedByIndex: boolean;
  5046. stackedOverDimension: DimensionName;
  5047. stackResultDimension: DimensionName;
  5048. stackedOnSeries?: SERIES_MODEL;
  5049. }
  5050. declare class SeriesData<HostModel extends Model = Model, Visual extends DefaultDataVisual = DefaultDataVisual> {
  5051. readonly type = "list";
  5052. /**
  5053. * Name of dimensions list of SeriesData.
  5054. *
  5055. * @caution Carefully use the index of this array.
  5056. * Because when DataStore is an extra high dimension(>30) dataset. We will only pick
  5057. * the used dimensions from DataStore to avoid performance issue.
  5058. */
  5059. readonly dimensions: SeriesDimensionName[];
  5060. private _dimInfos;
  5061. private _dimOmitted;
  5062. private _schema?;
  5063. /**
  5064. * @pending
  5065. * Actually we do not really need to convert dimensionIndex to dimensionName
  5066. * and do not need `_dimIdxToName` if we do everything internally based on dimension
  5067. * index rather than dimension name.
  5068. */
  5069. private _dimIdxToName?;
  5070. readonly hostModel: HostModel;
  5071. /**
  5072. * @readonly
  5073. */
  5074. dataType: SeriesDataType;
  5075. /**
  5076. * @readonly
  5077. * Host graph if List is used to store graph nodes / edges.
  5078. */
  5079. graph?: Graph;
  5080. /**
  5081. * @readonly
  5082. * Host tree if List is used to store tree nodes.
  5083. */
  5084. tree?: Tree;
  5085. private _store;
  5086. private _nameList;
  5087. private _idList;
  5088. private _visual;
  5089. private _layout;
  5090. private _itemVisuals;
  5091. private _itemLayouts;
  5092. private _graphicEls;
  5093. private _approximateExtent;
  5094. private _dimSummary;
  5095. private _invertedIndicesMap;
  5096. private _calculationInfo;
  5097. userOutput: DimensionSummary['userOutput'];
  5098. hasItemOption: boolean;
  5099. private _nameRepeatCount;
  5100. private _nameDimIdx;
  5101. private _idDimIdx;
  5102. private __wrappedMethods;
  5103. TRANSFERABLE_METHODS: readonly ["cloneShallow", "downSample", "lttbDownSample", "map"];
  5104. CHANGABLE_METHODS: readonly ["filterSelf", "selectRange"];
  5105. DOWNSAMPLE_METHODS: readonly ["downSample", "lttbDownSample"];
  5106. /**
  5107. * @param dimensionsInput.dimensions
  5108. * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].
  5109. * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius
  5110. */
  5111. constructor(dimensionsInput: SeriesDataSchema | SeriesDimensionDefineLoose[], hostModel: HostModel);
  5112. /**
  5113. *
  5114. * Get concrete dimension name by dimension name or dimension index.
  5115. * If input a dimension name, do not validate whether the dimension name exits.
  5116. *
  5117. * @caution
  5118. * @param dim Must make sure the dimension is `SeriesDimensionLoose`.
  5119. * Because only those dimensions will have auto-generated dimension names if not
  5120. * have a user-specified name, and other dimensions will get a return of null/undefined.
  5121. *
  5122. * @notice Because of this reason, should better use `getDimensionIndex` instead, for examples:
  5123. * ```js
  5124. * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx);
  5125. * ```
  5126. *
  5127. * @return Concrete dim name.
  5128. */
  5129. getDimension(dim: SeriesDimensionLoose): DimensionName;
  5130. /**
  5131. * Get dimension index in data store. Return -1 if not found.
  5132. * Can be used to index value from getRawValue.
  5133. */
  5134. getDimensionIndex(dim: DimensionLoose): DimensionIndex;
  5135. /**
  5136. * The meanings of the input parameter `dim`:
  5137. *
  5138. * + If dim is a number (e.g., `1`), it means the index of the dimension.
  5139. * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.
  5140. * + If dim is a number-like string (e.g., `"1"`):
  5141. * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`,
  5142. * it means that concrete name.
  5143. * + If not, it will be converted to a number, which means the index of the dimension.
  5144. * (why? because of the backward compatibility. We have been tolerating number-like string in
  5145. * dimension setting, although now it seems that it is not a good idea.)
  5146. * For example, `visualMap[i].dimension: "1"` is the same meaning as `visualMap[i].dimension: 1`,
  5147. * if no dimension name is defined as `"1"`.
  5148. * + If dim is a not-number-like string, it means the concrete dim name.
  5149. * For example, it can be be default name `"x"`, `"y"`, `"z"`, `"lng"`, `"lat"`, `"angle"`, `"radius"`,
  5150. * or customized in `dimensions` property of option like `"age"`.
  5151. *
  5152. * @return recognized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`).
  5153. */
  5154. private _recognizeDimIndex;
  5155. private _getStoreDimIndex;
  5156. /**
  5157. * Get type and calculation info of particular dimension
  5158. * @param dim
  5159. * Dimension can be concrete names like x, y, z, lng, lat, angle, radius
  5160. * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'
  5161. */
  5162. getDimensionInfo(dim: SeriesDimensionLoose): SeriesDimensionDefine;
  5163. /**
  5164. * If `dimName` if from outside of `SeriesData`,
  5165. * use this method other than visit `this._dimInfos` directly.
  5166. */
  5167. private _getDimInfo;
  5168. private _initGetDimensionInfo;
  5169. /**
  5170. * concrete dimension name list on coord.
  5171. */
  5172. getDimensionsOnCoord(): SeriesDimensionName[];
  5173. /**
  5174. * @param coordDim
  5175. * @param idx A coordDim may map to more than one data dim.
  5176. * If not specified, return the first dim not extra.
  5177. * @return concrete data dim. If not found, return null/undefined
  5178. */
  5179. mapDimension(coordDim: SeriesDimensionName): SeriesDimensionName;
  5180. mapDimension(coordDim: SeriesDimensionName, idx: number): SeriesDimensionName;
  5181. mapDimensionsAll(coordDim: SeriesDimensionName): SeriesDimensionName[];
  5182. getStore(): DataStore;
  5183. /**
  5184. * Initialize from data
  5185. * @param data source or data or data store.
  5186. * @param nameList The name of a datum is used on data diff and
  5187. * default label/tooltip.
  5188. * A name can be specified in encode.itemName,
  5189. * or dataItem.name (only for series option data),
  5190. * or provided in nameList from outside.
  5191. */
  5192. initData(data: Source | OptionSourceData | DataStore | DataProvider, nameList?: string[], dimValueGetter?: DimValueGetter): void;
  5193. /**
  5194. * Caution: Can be only called on raw data (before `this._indices` created).
  5195. */
  5196. appendData(data: ArrayLike$1<any>): void;
  5197. /**
  5198. * Caution: Can be only called on raw data (before `this._indices` created).
  5199. * This method does not modify `rawData` (`dataProvider`), but only
  5200. * add values to store.
  5201. *
  5202. * The final count will be increased by `Math.max(values.length, names.length)`.
  5203. *
  5204. * @param values That is the SourceType: 'arrayRows', like
  5205. * [
  5206. * [12, 33, 44],
  5207. * [NaN, 43, 1],
  5208. * ['-', 'asdf', 0]
  5209. * ]
  5210. * Each item is exactly corresponding to a dimension.
  5211. */
  5212. appendValues(values: any[][], names?: string[]): void;
  5213. private _updateOrdinalMeta;
  5214. private _shouldMakeIdFromName;
  5215. private _doInit;
  5216. /**
  5217. * PENDING: In fact currently this function is only used to short-circuit
  5218. * the calling of `scale.unionExtentFromData` when data have been filtered by modules
  5219. * like "dataZoom". `scale.unionExtentFromData` is used to calculate data extent for series on
  5220. * an axis, but if a "axis related data filter module" is used, the extent of the axis have
  5221. * been fixed and no need to calling `scale.unionExtentFromData` actually.
  5222. * But if we add "custom data filter" in future, which is not "axis related", this method may
  5223. * be still needed.
  5224. *
  5225. * Optimize for the scenario that data is filtered by a given extent.
  5226. * Consider that if data amount is more than hundreds of thousand,
  5227. * extent calculation will cost more than 10ms and the cache will
  5228. * be erased because of the filtering.
  5229. */
  5230. getApproximateExtent(dim: SeriesDimensionLoose): [number, number];
  5231. /**
  5232. * Calculate extent on a filtered data might be time consuming.
  5233. * Approximate extent is only used for: calculate extent of filtered data outside.
  5234. */
  5235. setApproximateExtent(extent: [number, number], dim: SeriesDimensionLoose): void;
  5236. getCalculationInfo<CALC_INFO_KEY extends keyof DataCalculationInfo<HostModel>>(key: CALC_INFO_KEY): DataCalculationInfo<HostModel>[CALC_INFO_KEY];
  5237. /**
  5238. * @param key or k-v object
  5239. */
  5240. setCalculationInfo(key: DataCalculationInfo<HostModel>): void;
  5241. setCalculationInfo<CALC_INFO_KEY extends keyof DataCalculationInfo<HostModel>>(key: CALC_INFO_KEY, value: DataCalculationInfo<HostModel>[CALC_INFO_KEY]): void;
  5242. /**
  5243. * @return Never be null/undefined. `number` will be converted to string. Because:
  5244. * In most cases, name is used in display, where returning a string is more convenient.
  5245. * In other cases, name is used in query (see `indexOfName`), where we can keep the
  5246. * rule that name `2` equals to name `'2'`.
  5247. */
  5248. getName(idx: number): string;
  5249. private _getCategory;
  5250. /**
  5251. * @return Never null/undefined. `number` will be converted to string. Because:
  5252. * In all cases having encountered at present, id is used in making diff comparison, which
  5253. * are usually based on hash map. We can keep the rule that the internal id are always string
  5254. * (treat `2` is the same as `'2'`) to make the related logic simple.
  5255. */
  5256. getId(idx: number): string;
  5257. count(): number;
  5258. /**
  5259. * Get value. Return NaN if idx is out of range.
  5260. *
  5261. * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead.
  5262. */
  5263. get(dim: SeriesDimensionName, idx: number): ParsedValue;
  5264. /**
  5265. * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead.
  5266. */
  5267. getByRawIndex(dim: SeriesDimensionName, rawIdx: number): ParsedValue;
  5268. getIndices(): globalThis.ArrayLike<number>;
  5269. getDataExtent(dim: DimensionLoose): [number, number];
  5270. getSum(dim: DimensionLoose): number;
  5271. getMedian(dim: DimensionLoose): number;
  5272. /**
  5273. * Get value for multi dimensions.
  5274. * @param dimensions If ignored, using all dimensions.
  5275. */
  5276. getValues(idx: number): ParsedValue[];
  5277. getValues(dimensions: readonly DimensionName[], idx: number): ParsedValue[];
  5278. /**
  5279. * If value is NaN. Including '-'
  5280. * Only check the coord dimensions.
  5281. */
  5282. hasValue(idx: number): boolean;
  5283. /**
  5284. * Retrieve the index with given name
  5285. */
  5286. indexOfName(name: string): number;
  5287. getRawIndex(idx: number): number;
  5288. indexOfRawIndex(rawIndex: number): number;
  5289. /**
  5290. * Only support the dimension which inverted index created.
  5291. * Do not support other cases until required.
  5292. * @param dim concrete dim
  5293. * @param value ordinal index
  5294. * @return rawIndex
  5295. */
  5296. rawIndexOf(dim: SeriesDimensionName, value: OrdinalNumber): number;
  5297. /**
  5298. * Retrieve the index of nearest value
  5299. * @param dim
  5300. * @param value
  5301. * @param [maxDistance=Infinity]
  5302. * @return If and only if multiple indices has
  5303. * the same value, they are put to the result.
  5304. */
  5305. indicesOfNearest(dim: DimensionLoose, value: number, maxDistance?: number): number[];
  5306. /**
  5307. * Data iteration
  5308. * @param ctx default this
  5309. * @example
  5310. * list.each('x', function (x, idx) {});
  5311. * list.each(['x', 'y'], function (x, y, idx) {});
  5312. * list.each(function (idx) {})
  5313. */
  5314. each<Ctx>(cb: EachCb0<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
  5315. each<Ctx>(dims: DimensionLoose, cb: EachCb1<Ctx>, ctx?: Ctx): void;
  5316. each<Ctx>(dims: [DimensionLoose], cb: EachCb1<Ctx>, ctx?: Ctx): void;
  5317. each<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: EachCb2<Ctx>, ctx?: Ctx): void;
  5318. each<Ctx>(dims: ItrParamDims, cb: EachCb$1<Ctx>, ctx?: Ctx): void;
  5319. /**
  5320. * Data filter
  5321. */
  5322. filterSelf<Ctx>(cb: FilterCb0<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): this;
  5323. filterSelf<Ctx>(dims: DimensionLoose, cb: FilterCb1<Ctx>, ctx?: Ctx): this;
  5324. filterSelf<Ctx>(dims: [DimensionLoose], cb: FilterCb1<Ctx>, ctx?: Ctx): this;
  5325. filterSelf<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: FilterCb2<Ctx>, ctx?: Ctx): this;
  5326. filterSelf<Ctx>(dims: ItrParamDims, cb: FilterCb$1<Ctx>, ctx?: Ctx): this;
  5327. /**
  5328. * Select data in range. (For optimization of filter)
  5329. * (Manually inline code, support 5 million data filtering in data zoom.)
  5330. */
  5331. selectRange(range: Record<string, [number, number]>): SeriesData;
  5332. /**
  5333. * Data mapping to a plain array
  5334. */
  5335. mapArray<Ctx, Cb extends MapArrayCb0<Ctx>>(cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
  5336. mapArray<Ctx, Cb extends MapArrayCb1<Ctx>>(dims: DimensionLoose, cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
  5337. mapArray<Ctx, Cb extends MapArrayCb1<Ctx>>(dims: [DimensionLoose], cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
  5338. mapArray<Ctx, Cb extends MapArrayCb2<Ctx>>(dims: [DimensionLoose, DimensionLoose], cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
  5339. mapArray<Ctx, Cb extends MapArrayCb<Ctx>>(dims: ItrParamDims, cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[];
  5340. /**
  5341. * Data mapping to a new List with given dimensions
  5342. */
  5343. map<Ctx>(dims: DimensionLoose, cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): SeriesData<HostModel>;
  5344. map<Ctx>(dims: [DimensionLoose], cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): SeriesData<HostModel>;
  5345. map<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: MapCb2<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): SeriesData<HostModel>;
  5346. /**
  5347. * !!Danger: used on stack dimension only.
  5348. */
  5349. modify<Ctx>(dims: DimensionLoose, cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
  5350. modify<Ctx>(dims: [DimensionLoose], cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
  5351. modify<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: MapCb2<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
  5352. /**
  5353. * Large data down sampling on given dimension
  5354. * @param sampleIndex Sample index for name and id
  5355. */
  5356. downSample(dimension: DimensionLoose, rate: number, sampleValue: (frameValues: ArrayLike$1<ParsedValue>) => ParsedValueNumeric, sampleIndex: (frameValues: ArrayLike$1<ParsedValue>, value: ParsedValueNumeric) => number): SeriesData<HostModel>;
  5357. /**
  5358. * Large data down sampling using largest-triangle-three-buckets
  5359. * @param {string} valueDimension
  5360. * @param {number} targetCount
  5361. */
  5362. lttbDownSample(valueDimension: DimensionLoose, rate: number): SeriesData<HostModel>;
  5363. getRawDataItem(idx: number): OptionDataItem;
  5364. /**
  5365. * Get model of one data item.
  5366. */
  5367. getItemModel<ItemOpts extends unknown = unknown>(idx: number): Model<ItemOpts>;
  5368. /**
  5369. * Create a data differ
  5370. */
  5371. diff(otherList: SeriesData): DataDiffer;
  5372. /**
  5373. * Get visual property.
  5374. */
  5375. getVisual<K extends keyof Visual>(key: K): Visual[K];
  5376. /**
  5377. * Set visual property
  5378. *
  5379. * @example
  5380. * setVisual('color', color);
  5381. * setVisual({
  5382. * 'color': color
  5383. * });
  5384. */
  5385. setVisual<K extends keyof Visual>(key: K, val: Visual[K]): void;
  5386. setVisual(kvObj: Partial<Visual>): void;
  5387. /**
  5388. * Get visual property of single data item
  5389. */
  5390. getItemVisual<K extends keyof Visual>(idx: number, key: K): Visual[K];
  5391. /**
  5392. * If exists visual property of single data item
  5393. */
  5394. hasItemVisual(): boolean;
  5395. /**
  5396. * Make sure itemVisual property is unique
  5397. */
  5398. ensureUniqueItemVisual<K extends keyof Visual>(idx: number, key: K): Visual[K];
  5399. /**
  5400. * Set visual property of single data item
  5401. *
  5402. * @param {number} idx
  5403. * @param {string|Object} key
  5404. * @param {*} [value]
  5405. *
  5406. * @example
  5407. * setItemVisual(0, 'color', color);
  5408. * setItemVisual(0, {
  5409. * 'color': color
  5410. * });
  5411. */
  5412. setItemVisual<K extends keyof Visual>(idx: number, key: K, value: Visual[K]): void;
  5413. setItemVisual(idx: number, kvObject: Partial<Visual>): void;
  5414. /**
  5415. * Clear itemVisuals and list visual.
  5416. */
  5417. clearAllVisual(): void;
  5418. /**
  5419. * Set layout property.
  5420. */
  5421. setLayout(key: string, val: any): void;
  5422. setLayout(kvObj: Dictionary<any>): void;
  5423. /**
  5424. * Get layout property.
  5425. */
  5426. getLayout(key: string): any;
  5427. /**
  5428. * Get layout of single data item
  5429. */
  5430. getItemLayout(idx: number): any;
  5431. /**
  5432. * Set layout of single data item
  5433. */
  5434. setItemLayout<M = false>(idx: number, layout: (M extends true ? Dictionary<any> : any), merge?: M): void;
  5435. /**
  5436. * Clear all layout of single data item
  5437. */
  5438. clearItemLayouts(): void;
  5439. /**
  5440. * Set graphic element relative to data. It can be set as null
  5441. */
  5442. setItemGraphicEl(idx: number, el: Element): void;
  5443. getItemGraphicEl(idx: number): Element;
  5444. eachItemGraphicEl<Ctx = unknown>(cb: (this: Ctx, el: Element, idx: number) => void, context?: Ctx): void;
  5445. /**
  5446. * Shallow clone a new list except visual and layout properties, and graph elements.
  5447. * New list only change the indices.
  5448. */
  5449. cloneShallow(list?: SeriesData<HostModel>): SeriesData<HostModel>;
  5450. /**
  5451. * Wrap some method to add more feature
  5452. */
  5453. wrapMethod(methodName: FunctionPropertyNames<SeriesData>, injectFunction: (...args: any) => any): void;
  5454. private static internalField;
  5455. }
  5456. interface SeriesData {
  5457. getLinkedData(dataType?: SeriesDataType): SeriesData;
  5458. getLinkedDataAll(): {
  5459. data: SeriesData;
  5460. type?: SeriesDataType;
  5461. }[];
  5462. }
  5463. /**
  5464. * If string, e.g., 'geo', means {geoIndex: 0}.
  5465. * If Object, could contain some of these properties below:
  5466. * {
  5467. * seriesIndex, seriesId, seriesName,
  5468. * geoIndex, geoId, geoName,
  5469. * bmapIndex, bmapId, bmapName,
  5470. * xAxisIndex, xAxisId, xAxisName,
  5471. * yAxisIndex, yAxisId, yAxisName,
  5472. * gridIndex, gridId, gridName,
  5473. * ... (can be extended)
  5474. * }
  5475. * Each properties can be number|string|Array.<number>|Array.<string>
  5476. * For example, a finder could be
  5477. * {
  5478. * seriesIndex: 3,
  5479. * geoId: ['aa', 'cc'],
  5480. * gridName: ['xx', 'rr']
  5481. * }
  5482. * xxxIndex can be set as 'all' (means all xxx) or 'none' (means not specify)
  5483. * If nothing or null/undefined specified, return nothing.
  5484. * If both `abcIndex`, `abcId`, `abcName` specified, only one work.
  5485. * The priority is: index > id > name, the same with `ecModel.queryComponents`.
  5486. */
  5487. declare type ModelFinderIndexQuery = number | number[] | 'all' | 'none' | false;
  5488. declare type ModelFinderIdQuery = OptionId | OptionId[];
  5489. declare type ModelFinderNameQuery = OptionId | OptionId[];
  5490. declare type ModelFinder = string | ModelFinderObject;
  5491. declare type ModelFinderObject = {
  5492. seriesIndex?: ModelFinderIndexQuery;
  5493. seriesId?: ModelFinderIdQuery;
  5494. seriesName?: ModelFinderNameQuery;
  5495. geoIndex?: ModelFinderIndexQuery;
  5496. geoId?: ModelFinderIdQuery;
  5497. geoName?: ModelFinderNameQuery;
  5498. bmapIndex?: ModelFinderIndexQuery;
  5499. bmapId?: ModelFinderIdQuery;
  5500. bmapName?: ModelFinderNameQuery;
  5501. xAxisIndex?: ModelFinderIndexQuery;
  5502. xAxisId?: ModelFinderIdQuery;
  5503. xAxisName?: ModelFinderNameQuery;
  5504. yAxisIndex?: ModelFinderIndexQuery;
  5505. yAxisId?: ModelFinderIdQuery;
  5506. yAxisName?: ModelFinderNameQuery;
  5507. gridIndex?: ModelFinderIndexQuery;
  5508. gridId?: ModelFinderIdQuery;
  5509. gridName?: ModelFinderNameQuery;
  5510. dataIndex?: number;
  5511. dataIndexInside?: number;
  5512. };
  5513. /**
  5514. * {
  5515. * seriesModels: [seriesModel1, seriesModel2],
  5516. * seriesModel: seriesModel1, // The first model
  5517. * geoModels: [geoModel1, geoModel2],
  5518. * geoModel: geoModel1, // The first model
  5519. * ...
  5520. * }
  5521. */
  5522. declare type ParsedModelFinder = {
  5523. [key: string]: ComponentModel | ComponentModel[] | undefined;
  5524. };
  5525. declare type QueryReferringOpt = {
  5526. useDefault?: boolean;
  5527. enableAll?: boolean;
  5528. enableNone?: boolean;
  5529. };
  5530. declare class ComponentModel<Opt extends ComponentOption = ComponentOption> extends Model<Opt> {
  5531. /**
  5532. * @readonly
  5533. */
  5534. type: ComponentFullType;
  5535. /**
  5536. * @readonly
  5537. */
  5538. id: string;
  5539. /**
  5540. * Because simplified concept is probably better, series.name (or component.name)
  5541. * has been having too many responsibilities:
  5542. * (1) Generating id (which requires name in option should not be modified).
  5543. * (2) As an index to mapping series when merging option or calling API (a name
  5544. * can refer to more than one component, which is convenient is some cases).
  5545. * (3) Display.
  5546. * @readOnly But injected
  5547. */
  5548. name: string;
  5549. /**
  5550. * @readOnly
  5551. */
  5552. mainType: ComponentMainType;
  5553. /**
  5554. * @readOnly
  5555. */
  5556. subType: ComponentSubType;
  5557. /**
  5558. * @readOnly
  5559. */
  5560. componentIndex: number;
  5561. /**
  5562. * @readOnly
  5563. */
  5564. protected defaultOption: ComponentOption;
  5565. /**
  5566. * @readOnly
  5567. */
  5568. ecModel: GlobalModel;
  5569. /**
  5570. * @readOnly
  5571. */
  5572. static dependencies: string[];
  5573. readonly uid: string;
  5574. /**
  5575. * Support merge layout params.
  5576. * Only support 'box' now (left/right/top/bottom/width/height).
  5577. */
  5578. static layoutMode: ComponentLayoutMode | ComponentLayoutMode['type'];
  5579. /**
  5580. * Prevent from auto set z, zlevel, z2 by the framework.
  5581. */
  5582. preventAutoZ: boolean;
  5583. __viewId: string;
  5584. __requireNewView: boolean;
  5585. static protoInitialize: void;
  5586. constructor(option: Opt, parentModel: Model, ecModel: GlobalModel);
  5587. init(option: Opt, parentModel: Model, ecModel: GlobalModel): void;
  5588. mergeDefaultAndTheme(option: Opt, ecModel: GlobalModel): void;
  5589. mergeOption(option: Opt, ecModel: GlobalModel): void;
  5590. /**
  5591. * Called immediately after `init` or `mergeOption` of this instance called.
  5592. */
  5593. optionUpdated(newCptOption: Opt, isInit: boolean): void;
  5594. /**
  5595. * [How to declare defaultOption]:
  5596. *
  5597. * (A) If using class declaration in typescript (since echarts 5):
  5598. * ```ts
  5599. * import {ComponentOption} from '../model/option.js';
  5600. * export interface XxxOption extends ComponentOption {
  5601. * aaa: number
  5602. * }
  5603. * export class XxxModel extends Component {
  5604. * static type = 'xxx';
  5605. * static defaultOption: XxxOption = {
  5606. * aaa: 123
  5607. * }
  5608. * }
  5609. * Component.registerClass(XxxModel);
  5610. * ```
  5611. * ```ts
  5612. * import {inheritDefaultOption} from '../util/component.js';
  5613. * import {XxxModel, XxxOption} from './XxxModel.js';
  5614. * export interface XxxSubOption extends XxxOption {
  5615. * bbb: number
  5616. * }
  5617. * class XxxSubModel extends XxxModel {
  5618. * static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, {
  5619. * bbb: 456
  5620. * })
  5621. * fn() {
  5622. * let opt = this.getDefaultOption();
  5623. * // opt is {aaa: 123, bbb: 456}
  5624. * }
  5625. * }
  5626. * ```
  5627. *
  5628. * (B) If using class extend (previous approach in echarts 3 & 4):
  5629. * ```js
  5630. * let XxxComponent = Component.extend({
  5631. * defaultOption: {
  5632. * xx: 123
  5633. * }
  5634. * })
  5635. * ```
  5636. * ```js
  5637. * let XxxSubComponent = XxxComponent.extend({
  5638. * defaultOption: {
  5639. * yy: 456
  5640. * },
  5641. * fn: function () {
  5642. * let opt = this.getDefaultOption();
  5643. * // opt is {xx: 123, yy: 456}
  5644. * }
  5645. * })
  5646. * ```
  5647. */
  5648. getDefaultOption(): Opt;
  5649. /**
  5650. * Notice: always force to input param `useDefault` in case that forget to consider it.
  5651. * The same behavior as `modelUtil.parseFinder`.
  5652. *
  5653. * @param useDefault In many cases like series refer axis and axis refer grid,
  5654. * If axis index / axis id not specified, use the first target as default.
  5655. * In other cases like dataZoom refer axis, if not specified, measn no refer.
  5656. */
  5657. getReferringComponents(mainType: ComponentMainType, opt: QueryReferringOpt): {
  5658. models: ComponentModel[];
  5659. specified: boolean;
  5660. };
  5661. getBoxLayoutParams(): {
  5662. left: string | number;
  5663. top: string | number;
  5664. right: string | number;
  5665. bottom: string | number;
  5666. width: string | number;
  5667. height: string | number;
  5668. };
  5669. /**
  5670. * Get key for zlevel.
  5671. * If developers don't configure zlevel. We will assign zlevel to series based on the key.
  5672. * For example, lines with trail effect and progressive series will in an individual zlevel.
  5673. */
  5674. getZLevelKey(): string;
  5675. setZLevel(zlevel: number): void;
  5676. static registerClass: ClassManager['registerClass'];
  5677. static hasClass: ClassManager['hasClass'];
  5678. static registerSubTypeDefaulter: SubTypeDefaulterManager['registerSubTypeDefaulter'];
  5679. }
  5680. declare type AnimateOrSetPropsOption = {
  5681. dataIndex?: number;
  5682. cb?: () => void;
  5683. during?: (percent: number) => void;
  5684. removeOpt?: AnimationOption$1;
  5685. isFrom?: boolean;
  5686. };
  5687. /**
  5688. * Update graphic element properties with or without animation according to the
  5689. * configuration in series.
  5690. *
  5691. * Caution: this method will stop previous animation.
  5692. * So do not use this method to one element twice before
  5693. * animation starts, unless you know what you are doing.
  5694. * @example
  5695. * graphic.updateProps(el, {
  5696. * position: [100, 100]
  5697. * }, seriesModel, dataIndex, function () { console.log('Animation done!'); });
  5698. * // Or
  5699. * graphic.updateProps(el, {
  5700. * position: [100, 100]
  5701. * }, seriesModel, function () { console.log('Animation done!'); });
  5702. */
  5703. 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;
  5704. /**
  5705. * Init graphic element properties with or without animation according to the
  5706. * configuration in series.
  5707. *
  5708. * Caution: this method will stop previous animation.
  5709. * So do not use this method to one element twice before
  5710. * animation starts, unless you know what you are doing.
  5711. */
  5712. 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;
  5713. declare type ExtendShapeOpt = Parameters<typeof Path.extend>[0];
  5714. declare type ExtendShapeReturn = ReturnType<typeof Path.extend>;
  5715. /**
  5716. * Extend shape with parameters
  5717. */
  5718. declare function extendShape(opts: ExtendShapeOpt): ExtendShapeReturn;
  5719. declare const extendPathFromString: typeof extendFromString;
  5720. declare type SVGPathOption$1 = Parameters<typeof extendPathFromString>[1];
  5721. declare type SVGPathCtor = ReturnType<typeof extendPathFromString>;
  5722. declare type SVGPath$1 = InstanceType<SVGPathCtor>;
  5723. /**
  5724. * Extend path
  5725. */
  5726. declare function extendPath(pathData: string, opts: SVGPathOption$1): SVGPathCtor;
  5727. /**
  5728. * Register a user defined shape.
  5729. * The shape class can be fetched by `getShapeClass`
  5730. * This method will overwrite the registered shapes, including
  5731. * the registered built-in shapes, if using the same `name`.
  5732. * The shape can be used in `custom series` and
  5733. * `graphic component` by declaring `{type: name}`.
  5734. *
  5735. * @param name
  5736. * @param ShapeClass Can be generated by `extendShape`.
  5737. */
  5738. declare function registerShape(name: string, ShapeClass: {
  5739. new (): Path;
  5740. }): void;
  5741. /**
  5742. * Find shape class registered by `registerShape`. Usually used in
  5743. * fetching user defined shape.
  5744. *
  5745. * [Caution]:
  5746. * (1) This method **MUST NOT be used inside echarts !!!**, unless it is prepared
  5747. * to use user registered shapes.
  5748. * Because the built-in shape (see `getBuiltInShape`) will be registered by
  5749. * `registerShape` by default. That enables users to get both built-in
  5750. * shapes as well as the shapes belonging to themsleves. But users can overwrite
  5751. * the built-in shapes by using names like 'circle', 'rect' via calling
  5752. * `registerShape`. So the echarts inner featrues should not fetch shapes from here
  5753. * in case that it is overwritten by users, except that some features, like
  5754. * `custom series`, `graphic component`, do it deliberately.
  5755. *
  5756. * (2) In the features like `custom series`, `graphic component`, the user input
  5757. * `{tpye: 'xxx'}` does not only specify shapes but also specify other graphic
  5758. * elements like `'group'`, `'text'`, `'image'` or event `'path'`. Those names
  5759. * are reserved names, that is, if some user registers a shape named `'image'`,
  5760. * the shape will not be used. If we intending to add some more reserved names
  5761. * in feature, that might bring break changes (disable some existing user shape
  5762. * names). But that case probably rarely happens. So we don't make more mechanism
  5763. * to resolve this issue here.
  5764. *
  5765. * @param name
  5766. * @return The shape class. If not found, return nothing.
  5767. */
  5768. declare function getShapeClass(name: string): {
  5769. new (): Path;
  5770. };
  5771. /**
  5772. * Create a path element from path data string
  5773. * @param pathData
  5774. * @param opts
  5775. * @param rect
  5776. * @param layout 'center' or 'cover' default to be cover
  5777. */
  5778. declare function makePath(pathData: string, opts: SVGPathOption$1, rect: ZRRectLike, layout?: 'center' | 'cover'): SVGPath$1;
  5779. /**
  5780. * Create a image element from image url
  5781. * @param imageUrl image url
  5782. * @param opts options
  5783. * @param rect constrain rect
  5784. * @param layout 'center' or 'cover'. Default to be 'cover'
  5785. */
  5786. declare function makeImage(imageUrl: string, rect: ZRRectLike, layout?: 'center' | 'cover'): ZRImage;
  5787. declare const mergePath$1: typeof mergePath;
  5788. /**
  5789. * Resize a path to fit the rect
  5790. * @param path
  5791. * @param rect
  5792. */
  5793. declare function resizePath(path: SVGPath$1, rect: ZRRectLike): void;
  5794. /**
  5795. * Get transform matrix of target (param target),
  5796. * in coordinate of its ancestor (param ancestor)
  5797. *
  5798. * @param target
  5799. * @param [ancestor]
  5800. */
  5801. declare function getTransform(target: Transformable, ancestor?: Transformable): MatrixArray;
  5802. declare function clipPointsByRect(points: VectorArray[], rect: ZRRectLike): number[][];
  5803. /**
  5804. * Return a new clipped rect. If rect size are negative, return undefined.
  5805. */
  5806. declare function clipRectByRect(targetRect: ZRRectLike, rect: ZRRectLike): ZRRectLike;
  5807. declare function createIcon(iconStr: string, // Support 'image://' or 'path://' or direct svg path.
  5808. opt?: Omit<DisplayableProps, 'style'>, rect?: ZRRectLike): SVGPath$1 | ZRImage;
  5809. declare type TextStyleProps$1 = ZRText['style'];
  5810. 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;
  5811. /**
  5812. * Add a comma each three digit.
  5813. */
  5814. declare function addCommas(x: string | number): string;
  5815. declare function toCamelCase(str: string, upperCaseFirst?: boolean): string;
  5816. declare const normalizeCssArray$1: typeof normalizeCssArray;
  5817. interface TplFormatterParam extends Dictionary<any> {
  5818. $vars: string[];
  5819. }
  5820. /**
  5821. * Template formatter
  5822. * @param {Array.<Object>|Object} paramsList
  5823. */
  5824. declare function formatTpl(tpl: string, paramsList: TplFormatterParam | TplFormatterParam[], encode?: boolean): string;
  5825. interface RichTextTooltipMarker {
  5826. renderMode: TooltipRenderMode;
  5827. content: string;
  5828. style: Dictionary<unknown>;
  5829. }
  5830. declare type TooltipMarker = string | RichTextTooltipMarker;
  5831. declare type TooltipMarkerType = 'item' | 'subItem';
  5832. interface GetTooltipMarkerOpt {
  5833. color?: ColorString;
  5834. extraCssText?: string;
  5835. type?: TooltipMarkerType;
  5836. renderMode?: TooltipRenderMode;
  5837. markerId?: string;
  5838. }
  5839. declare function getTooltipMarker(color: ColorString, extraCssText?: string): TooltipMarker;
  5840. declare function getTooltipMarker(opt: GetTooltipMarkerOpt): TooltipMarker;
  5841. /**
  5842. * @deprecated Use `time/format` instead.
  5843. * ISO Date format
  5844. * @param {string} tpl
  5845. * @param {number} value
  5846. * @param {boolean} [isUTC=false] Default in local time.
  5847. * see `module:echarts/scale/Time`
  5848. * and `module:echarts/util/number#parseDate`.
  5849. * @inner
  5850. */
  5851. declare function formatTime(tpl: string, value: unknown, isUTC?: boolean): string;
  5852. /**
  5853. * Capital first
  5854. * @param {string} str
  5855. * @return {string}
  5856. */
  5857. declare function capitalFirst(str: string): string;
  5858. interface MapperParamAxisInfo {
  5859. axisIndex: number;
  5860. axisName: string;
  5861. axisId: string;
  5862. axisDim: string;
  5863. }
  5864. interface AxisPointerLink {
  5865. xAxisIndex?: number[] | 'all';
  5866. yAxisIndex?: number[] | 'all';
  5867. xAxisId?: string[];
  5868. yAxisId?: string[];
  5869. xAxisName?: string[] | string;
  5870. yAxisName?: string[] | string;
  5871. radiusAxisIndex?: number[] | 'all';
  5872. angleAxisIndex?: number[] | 'all';
  5873. radiusAxisId?: string[];
  5874. angleAxisId?: string[];
  5875. radiusAxisName?: string[] | string;
  5876. angleAxisName?: string[] | string;
  5877. singleAxisIndex?: number[] | 'all';
  5878. singleAxisId?: string[];
  5879. singleAxisName?: string[] | string;
  5880. mapper?(sourceVal: ScaleDataValue, sourceAxisInfo: MapperParamAxisInfo, targetAxisInfo: MapperParamAxisInfo): CommonAxisPointerOption['value'];
  5881. }
  5882. interface AxisPointerOption extends ComponentOption, Omit<CommonAxisPointerOption, 'type'> {
  5883. mainType?: 'axisPointer';
  5884. type?: 'line' | 'shadow' | 'cross' | 'none';
  5885. link?: AxisPointerLink[];
  5886. }
  5887. declare type TopLevelFormatterParams = CallbackDataParams | CallbackDataParams[];
  5888. interface TooltipOption extends CommonTooltipOption<TopLevelFormatterParams>, ComponentOption {
  5889. mainType?: 'tooltip';
  5890. axisPointer?: AxisPointerOption & {
  5891. axis?: 'auto' | 'x' | 'y' | 'angle' | 'radius';
  5892. crossStyle?: LineStyleOption & {
  5893. textStyle?: LabelOption;
  5894. };
  5895. };
  5896. /**
  5897. * If show popup content
  5898. */
  5899. showContent?: boolean;
  5900. /**
  5901. * Trigger only works on coordinate system.
  5902. */
  5903. trigger?: 'item' | 'axis' | 'none';
  5904. displayMode?: 'single' | 'multipleByCoordSys';
  5905. /**
  5906. * 'auto': use html by default, and use non-html if `document` is not defined
  5907. * 'html': use html for tooltip
  5908. * 'richText': use canvas, svg, and etc. for tooltip
  5909. */
  5910. renderMode?: 'auto' | TooltipRenderMode;
  5911. /**
  5912. * If append popup dom to document.body
  5913. * Only available when renderMode is html
  5914. */
  5915. appendToBody?: boolean;
  5916. /**
  5917. * specified class name of tooltip dom
  5918. * Only available when renderMode is html
  5919. */
  5920. className?: string;
  5921. order?: TooltipOrderMode;
  5922. }
  5923. /**
  5924. * This is an abstract layer to insulate the upper usage of tooltip content
  5925. * from the different backends according to different `renderMode` ('html' or 'richText').
  5926. * With the help of the abstract layer, it does not need to consider how to create and
  5927. * assemble html or richText snippets when making tooltip content.
  5928. *
  5929. * @usage
  5930. *
  5931. * ```ts
  5932. * class XxxSeriesModel {
  5933. * formatTooltip(
  5934. * dataIndex: number,
  5935. * multipleSeries: boolean,
  5936. * dataType: string
  5937. * ) {
  5938. * ...
  5939. * return createTooltipMarkup('section', {
  5940. * header: header,
  5941. * blocks: [
  5942. * createTooltipMarkup('nameValue', {
  5943. * name: name,
  5944. * value: value,
  5945. * noValue: value == null
  5946. * })
  5947. * ]
  5948. * });
  5949. * }
  5950. * }
  5951. * ```
  5952. */
  5953. declare type TooltipMarkupBlockFragment = TooltipMarkupSection | TooltipMarkupNameValueBlock;
  5954. interface TooltipMarkupBlock {
  5955. sortParam?: unknown;
  5956. }
  5957. interface TooltipMarkupSection extends TooltipMarkupBlock {
  5958. type: 'section';
  5959. header?: unknown;
  5960. noHeader?: boolean;
  5961. blocks?: TooltipMarkupBlockFragment[];
  5962. sortBlocks?: boolean;
  5963. valueFormatter?: CommonTooltipOption<unknown>['valueFormatter'];
  5964. }
  5965. interface TooltipMarkupNameValueBlock extends TooltipMarkupBlock {
  5966. type: 'nameValue';
  5967. markerType?: TooltipMarkerType;
  5968. markerColor?: ColorString;
  5969. name?: string;
  5970. value?: unknown | unknown[];
  5971. valueType?: DimensionType | DimensionType[];
  5972. noName?: boolean;
  5973. noValue?: boolean;
  5974. valueFormatter?: CommonTooltipOption<unknown>['valueFormatter'];
  5975. }
  5976. interface DataFormatMixin extends DataHost {
  5977. ecModel: GlobalModel;
  5978. mainType: ComponentMainType;
  5979. subType: ComponentSubType;
  5980. componentIndex: number;
  5981. id: string;
  5982. name: string;
  5983. animatedValue: OptionDataValue[];
  5984. }
  5985. declare class DataFormatMixin {
  5986. /**
  5987. * Get params for formatter
  5988. */
  5989. getDataParams(dataIndex: number, dataType?: SeriesDataType): CallbackDataParams;
  5990. /**
  5991. * Format label
  5992. * @param dataIndex
  5993. * @param status 'normal' by default
  5994. * @param dataType
  5995. * @param labelDimIndex Only used in some chart that
  5996. * use formatter in different dimensions, like radar.
  5997. * @param formatter Formatter given outside.
  5998. * @return return null/undefined if no formatter
  5999. */
  6000. getFormattedLabel(dataIndex: number, status?: DisplayState, dataType?: SeriesDataType, labelDimIndex?: number, formatter?: string | ((params: object) => string), extendParams?: {
  6001. interpolatedValue: InterpolatableValue;
  6002. }): string;
  6003. /**
  6004. * Get raw value in option
  6005. */
  6006. getRawValue(idx: number, dataType?: SeriesDataType): unknown;
  6007. /**
  6008. * Should be implemented.
  6009. * @param {number} dataIndex
  6010. * @param {boolean} [multipleSeries=false]
  6011. * @param {string} [dataType]
  6012. */
  6013. formatTooltip(dataIndex: number, multipleSeries?: boolean, dataType?: string): TooltipFormatResult;
  6014. }
  6015. declare type TooltipFormatResult = string | TooltipMarkupBlockFragment;
  6016. /**
  6017. * [Notice]:
  6018. * Consider custom bundle on demand, chart specified
  6019. * or component specified types and constants should
  6020. * not put here. Only common types and constants can
  6021. * be put in this file.
  6022. */
  6023. declare type RendererType = 'canvas' | 'svg';
  6024. declare type LayoutOrient = 'vertical' | 'horizontal';
  6025. declare type HorizontalAlign = 'left' | 'center' | 'right';
  6026. declare type VerticalAlign = 'top' | 'middle' | 'bottom';
  6027. declare type ColorString = string;
  6028. declare type ZRColor = ColorString | LinearGradientObject | RadialGradientObject | PatternObject;
  6029. declare type ZRLineType = 'solid' | 'dotted' | 'dashed' | number | number[];
  6030. declare type ZRFontStyle = 'normal' | 'italic' | 'oblique';
  6031. declare type ZRFontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' | number;
  6032. declare type ZREasing = AnimationEasing;
  6033. declare type ZRTextAlign = TextAlign;
  6034. declare type ZRTextVerticalAlign = TextVerticalAlign;
  6035. declare type ZRRectLike = RectLike;
  6036. declare type ZRStyleProps = PathStyleProps | ImageStyleProps | TSpanStyleProps | TextStyleProps;
  6037. declare type ZRElementEventName = ElementEventName | 'globalout';
  6038. declare type ComponentFullType = string;
  6039. declare type ComponentMainType = keyof ECUnitOption & string;
  6040. declare type ComponentSubType = Exclude<ComponentOption['type'], undefined>;
  6041. interface DataHost {
  6042. getData(dataType?: SeriesDataType): SeriesData;
  6043. }
  6044. interface DataModel extends Model<unknown>, DataHost, DataFormatMixin {
  6045. }
  6046. interface PayloadItem {
  6047. excludeSeriesId?: OptionId | OptionId[];
  6048. animation?: PayloadAnimationPart;
  6049. [other: string]: any;
  6050. }
  6051. interface Payload extends PayloadItem {
  6052. type: string;
  6053. escapeConnect?: boolean;
  6054. batch?: PayloadItem[];
  6055. }
  6056. interface PayloadAnimationPart {
  6057. duration?: number;
  6058. easing?: AnimationEasing;
  6059. delay?: number;
  6060. }
  6061. interface ViewRootGroup extends Group {
  6062. __ecComponentInfo?: {
  6063. mainType: string;
  6064. index: number;
  6065. };
  6066. }
  6067. interface ECElementEvent extends ECEventData, CallbackDataParams {
  6068. type: ZRElementEventName;
  6069. event?: ElementEvent;
  6070. }
  6071. /**
  6072. * The echarts event type to user.
  6073. * Also known as packedEvent.
  6074. */
  6075. interface ECActionEvent extends ECEventData {
  6076. type: string;
  6077. componentType?: string;
  6078. componentIndex?: number;
  6079. seriesIndex?: number;
  6080. escapeConnect?: boolean;
  6081. batch?: ECEventData;
  6082. }
  6083. interface ECEventData {
  6084. [key: string]: any;
  6085. }
  6086. interface EventQueryItem {
  6087. [key: string]: any;
  6088. }
  6089. interface ActionInfo {
  6090. type: string;
  6091. event?: string;
  6092. update?: string;
  6093. }
  6094. interface ActionHandler {
  6095. (payload: Payload, ecModel: GlobalModel, api: ExtensionAPI): void | ECEventData;
  6096. }
  6097. interface OptionPreprocessor {
  6098. (option: ECUnitOption, isTheme: boolean): void;
  6099. }
  6100. interface PostUpdater {
  6101. (ecModel: GlobalModel, api: ExtensionAPI): void;
  6102. }
  6103. interface StageHandlerReset {
  6104. (seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): StageHandlerProgressExecutor | StageHandlerProgressExecutor[] | void;
  6105. }
  6106. interface StageHandlerOverallReset {
  6107. (ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): void;
  6108. }
  6109. interface StageHandler {
  6110. /**
  6111. * Indicate that the task will be piped all series
  6112. * (`performRawSeries` indicate whether includes filtered series).
  6113. */
  6114. createOnAllSeries?: boolean;
  6115. /**
  6116. * Indicate that the task will be only piped in the pipeline of this type of series.
  6117. * (`performRawSeries` indicate whether includes filtered series).
  6118. */
  6119. seriesType?: string;
  6120. /**
  6121. * Indicate that the task will be only piped in the pipeline of the returned series.
  6122. */
  6123. getTargetSeries?: (ecModel: GlobalModel, api: ExtensionAPI) => HashMap<SeriesModel>;
  6124. /**
  6125. * If `true`, filtered series will also be "performed".
  6126. */
  6127. performRawSeries?: boolean;
  6128. /**
  6129. * Called only when this task in a pipeline.
  6130. */
  6131. plan?: StageHandlerPlan;
  6132. /**
  6133. * If `overallReset` specified, an "overall task" will be created.
  6134. * "overall task" does not belong to a certain pipeline.
  6135. * They always be "performed" in certain phase (depends on when they declared).
  6136. * They has "stub"s to connect with pipelines (one stub for one pipeline),
  6137. * delivering info like "dirty" and "output end".
  6138. */
  6139. overallReset?: StageHandlerOverallReset;
  6140. /**
  6141. * Called only when this task in a pipeline, and "dirty".
  6142. */
  6143. reset?: StageHandlerReset;
  6144. }
  6145. interface StageHandlerInternal extends StageHandler {
  6146. uid: string;
  6147. visualType?: 'layout' | 'visual';
  6148. __prio: number;
  6149. __raw: StageHandler | StageHandlerOverallReset;
  6150. isVisual?: boolean;
  6151. isLayout?: boolean;
  6152. }
  6153. declare type StageHandlerProgressParams = TaskProgressParams;
  6154. interface StageHandlerProgressExecutor {
  6155. dataEach?: (data: SeriesData, idx: number) => void;
  6156. progress?: (params: StageHandlerProgressParams, data: SeriesData) => void;
  6157. }
  6158. declare type StageHandlerPlanReturn = TaskPlanCallbackReturn;
  6159. interface StageHandlerPlan {
  6160. (seriesModel: SeriesModel, ecModel: GlobalModel, api: ExtensionAPI, payload?: Payload): StageHandlerPlanReturn;
  6161. }
  6162. interface LoadingEffectCreator {
  6163. (api: ExtensionAPI, cfg: object): LoadingEffect;
  6164. }
  6165. interface LoadingEffect extends Element {
  6166. resize: () => void;
  6167. }
  6168. /**
  6169. * 'html' is used for rendering tooltip in extra DOM form, and the result
  6170. * string is used as DOM HTML content.
  6171. * 'richText' is used for rendering tooltip in rich text form, for those where
  6172. * DOM operation is not supported.
  6173. */
  6174. declare type TooltipRenderMode = 'html' | 'richText';
  6175. declare type TooltipOrderMode = 'valueAsc' | 'valueDesc' | 'seriesAsc' | 'seriesDesc';
  6176. declare type OrdinalRawValue = string | number;
  6177. declare type OrdinalNumber = number;
  6178. /**
  6179. * @usage For example,
  6180. * ```js
  6181. * { ordinalNumbers: [2, 5, 3, 4] }
  6182. * ```
  6183. * means that ordinal 2 should be displayed on tick 0,
  6184. * ordinal 5 should be displayed on tick 1, ...
  6185. */
  6186. declare type OrdinalSortInfo = {
  6187. ordinalNumbers: OrdinalNumber[];
  6188. };
  6189. /**
  6190. * `OptionDataValue` is the primitive value in `series.data` or `dataset.source`.
  6191. * `OptionDataValue` are parsed (see `src/data/helper/dataValueHelper.parseDataValue`)
  6192. * into `ParsedValue` and stored into `data/SeriesData` storage.
  6193. * Note:
  6194. * (1) The term "parse" does not mean `src/scale/Scale['parse']`.
  6195. * (2) If a category dimension is not mapped to any axis, its raw value will NOT be
  6196. * parsed to `OrdinalNumber` but keep the original `OrdinalRawValue` in `src/data/SeriesData` storage.
  6197. */
  6198. declare type ParsedValue = ParsedValueNumeric | OrdinalRawValue;
  6199. declare type ParsedValueNumeric = number | OrdinalNumber;
  6200. /**
  6201. * `ScaleDataValue` means that the user input primitive value to `src/scale/Scale`.
  6202. * (For example, used in `axis.min`, `axis.max`, `convertToPixel`).
  6203. * Note:
  6204. * `ScaleDataValue` is a little different from `OptionDataValue`, because it will not go through
  6205. * `src/data/helper/dataValueHelper.parseDataValue`, but go through `src/scale/Scale['parse']`.
  6206. */
  6207. declare type ScaleDataValue = ParsedValueNumeric | OrdinalRawValue | Date;
  6208. interface ScaleTick {
  6209. level?: number;
  6210. value: number;
  6211. }
  6212. declare type DimensionIndex = number;
  6213. declare type DimensionIndexLoose = DimensionIndex | string;
  6214. declare type DimensionName = string;
  6215. declare type DimensionLoose = DimensionName | DimensionIndexLoose;
  6216. declare type DimensionType = DataStoreDimensionType;
  6217. interface DataVisualDimensions {
  6218. tooltip?: DimensionIndex | false;
  6219. label?: DimensionIndex;
  6220. itemName?: DimensionIndex;
  6221. itemId?: DimensionIndex;
  6222. itemGroupId?: DimensionIndex;
  6223. seriesName?: DimensionIndex;
  6224. }
  6225. declare type DimensionDefinition = {
  6226. type?: DataStoreDimensionType;
  6227. name?: DimensionName;
  6228. displayName?: string;
  6229. };
  6230. declare type DimensionDefinitionLoose = DimensionDefinition['name'] | DimensionDefinition;
  6231. declare const SOURCE_FORMAT_ORIGINAL: "original";
  6232. declare const SOURCE_FORMAT_ARRAY_ROWS: "arrayRows";
  6233. declare const SOURCE_FORMAT_OBJECT_ROWS: "objectRows";
  6234. declare const SOURCE_FORMAT_KEYED_COLUMNS: "keyedColumns";
  6235. declare const SOURCE_FORMAT_TYPED_ARRAY: "typedArray";
  6236. declare const SOURCE_FORMAT_UNKNOWN: "unknown";
  6237. 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;
  6238. declare const SERIES_LAYOUT_BY_COLUMN: "column";
  6239. declare const SERIES_LAYOUT_BY_ROW: "row";
  6240. declare type SeriesLayoutBy = typeof SERIES_LAYOUT_BY_COLUMN | typeof SERIES_LAYOUT_BY_ROW;
  6241. declare type OptionSourceHeader = boolean | 'auto' | number;
  6242. declare type SeriesDataType = 'main' | 'node' | 'edge';
  6243. /**
  6244. * [ECUnitOption]:
  6245. * An object that contains definitions of components
  6246. * and other properties. For example:
  6247. *
  6248. * ```ts
  6249. * let option: ECUnitOption = {
  6250. *
  6251. * // Single `title` component:
  6252. * title: {...},
  6253. *
  6254. * // Two `visualMap` components:
  6255. * visualMap: [{...}, {...}],
  6256. *
  6257. * // Two `series.bar` components
  6258. * // and one `series.pie` component:
  6259. * series: [
  6260. * {type: 'bar', data: [...]},
  6261. * {type: 'bar', data: [...]},
  6262. * {type: 'pie', data: [...]}
  6263. * ],
  6264. *
  6265. * // A property:
  6266. * backgroundColor: '#421ae4'
  6267. *
  6268. * // A property object:
  6269. * textStyle: {
  6270. * color: 'red',
  6271. * fontSize: 20
  6272. * }
  6273. * };
  6274. * ```
  6275. */
  6276. declare type ECUnitOption = {
  6277. baseOption?: unknown;
  6278. options?: unknown;
  6279. media?: unknown;
  6280. timeline?: ComponentOption | ComponentOption[];
  6281. backgroundColor?: ZRColor;
  6282. darkMode?: boolean | 'auto';
  6283. textStyle?: Pick<LabelOption, 'color' | 'fontStyle' | 'fontWeight' | 'fontSize' | 'fontFamily'>;
  6284. useUTC?: boolean;
  6285. [key: string]: ComponentOption | ComponentOption[] | Dictionary<unknown> | unknown;
  6286. stateAnimation?: AnimationOption$1;
  6287. } & AnimationOptionMixin & ColorPaletteOptionMixin;
  6288. /**
  6289. * [ECOption]:
  6290. * An object input to echarts.setOption(option).
  6291. * May be an 'option: ECUnitOption',
  6292. * or may be an object contains multi-options. For example:
  6293. *
  6294. * ```ts
  6295. * let option: ECOption = {
  6296. * baseOption: {
  6297. * title: {...},
  6298. * legend: {...},
  6299. * series: [
  6300. * {data: [...]},
  6301. * {data: [...]},
  6302. * ...
  6303. * ]
  6304. * },
  6305. * timeline: {...},
  6306. * options: [
  6307. * {title: {...}, series: {data: [...]}},
  6308. * {title: {...}, series: {data: [...]}},
  6309. * ...
  6310. * ],
  6311. * media: [
  6312. * {
  6313. * query: {maxWidth: 320},
  6314. * option: {series: {x: 20}, visualMap: {show: false}}
  6315. * },
  6316. * {
  6317. * query: {minWidth: 320, maxWidth: 720},
  6318. * option: {series: {x: 500}, visualMap: {show: true}}
  6319. * },
  6320. * {
  6321. * option: {series: {x: 1200}, visualMap: {show: true}}
  6322. * }
  6323. * ]
  6324. * };
  6325. * ```
  6326. */
  6327. interface ECBasicOption extends ECUnitOption {
  6328. baseOption?: ECUnitOption;
  6329. timeline?: ComponentOption | ComponentOption[];
  6330. options?: ECUnitOption[];
  6331. media?: MediaUnit[];
  6332. }
  6333. declare type OptionSourceData<VAL extends OptionDataValue = OptionDataValue, ORIITEM extends OptionDataItemOriginal<VAL> = OptionDataItemOriginal<VAL>> = OptionSourceDataOriginal<VAL, ORIITEM> | OptionSourceDataObjectRows<VAL> | OptionSourceDataArrayRows<VAL> | OptionSourceDataKeyedColumns<VAL> | OptionSourceDataTypedArray;
  6334. declare type OptionDataItemOriginal<VAL extends OptionDataValue = OptionDataValue> = VAL | VAL[] | OptionDataItemObject<VAL>;
  6335. declare type OptionSourceDataOriginal<VAL extends OptionDataValue = OptionDataValue, ORIITEM extends OptionDataItemOriginal<VAL> = OptionDataItemOriginal<VAL>> = ArrayLike<ORIITEM>;
  6336. declare type OptionSourceDataObjectRows<VAL extends OptionDataValue = OptionDataValue> = Array<Dictionary<VAL>>;
  6337. declare type OptionSourceDataArrayRows<VAL extends OptionDataValue = OptionDataValue> = Array<Array<VAL>>;
  6338. declare type OptionSourceDataKeyedColumns<VAL extends OptionDataValue = OptionDataValue> = Dictionary<ArrayLike<VAL>>;
  6339. declare type OptionSourceDataTypedArray = ArrayLike<number>;
  6340. declare type OptionDataItem = OptionDataValue | Dictionary<OptionDataValue> | OptionDataValue[] | OptionDataItemObject<OptionDataValue>;
  6341. declare type OptionDataItemObject<T> = {
  6342. id?: OptionId;
  6343. name?: OptionName;
  6344. groupId?: OptionId;
  6345. value?: T[] | T;
  6346. selected?: boolean;
  6347. };
  6348. declare type OptionId = string | number;
  6349. declare type OptionName = string | number;
  6350. interface GraphEdgeItemObject<VAL extends OptionDataValue> extends OptionDataItemObject<VAL> {
  6351. /**
  6352. * Name or index of source node.
  6353. */
  6354. source?: string | number;
  6355. /**
  6356. * Name or index of target node.
  6357. */
  6358. target?: string | number;
  6359. }
  6360. declare type OptionDataValue = string | number | Date;
  6361. declare type OptionDataValueNumeric = number | '-';
  6362. declare type OptionDataValueDate = Date | string | number;
  6363. declare type ModelOption = any;
  6364. declare type ThemeOption = Dictionary<any>;
  6365. declare type DisplayState = 'normal' | 'emphasis' | 'blur' | 'select';
  6366. interface OptionEncodeVisualDimensions {
  6367. tooltip?: OptionEncodeValue;
  6368. label?: OptionEncodeValue;
  6369. itemName?: OptionEncodeValue;
  6370. itemId?: OptionEncodeValue;
  6371. seriesName?: OptionEncodeValue;
  6372. itemGroupId?: OptionEncodeValue;
  6373. }
  6374. interface OptionEncode extends OptionEncodeVisualDimensions {
  6375. [coordDim: string]: OptionEncodeValue | undefined;
  6376. }
  6377. declare type OptionEncodeValue = DimensionLoose | DimensionLoose[];
  6378. declare type EncodeDefaulter = (source: Source, dimCount: number) => OptionEncode;
  6379. interface CallbackDataParams {
  6380. componentType: string;
  6381. componentSubType: string;
  6382. componentIndex: number;
  6383. seriesType?: string;
  6384. seriesIndex?: number;
  6385. seriesId?: string;
  6386. seriesName?: string;
  6387. name: string;
  6388. dataIndex: number;
  6389. data: OptionDataItem;
  6390. dataType?: SeriesDataType;
  6391. value: OptionDataItem | OptionDataValue;
  6392. color?: ZRColor;
  6393. borderColor?: string;
  6394. dimensionNames?: DimensionName[];
  6395. encode?: DimensionUserOuputEncode;
  6396. marker?: TooltipMarker;
  6397. status?: DisplayState;
  6398. dimensionIndex?: number;
  6399. percent?: number;
  6400. $vars: string[];
  6401. }
  6402. declare type InterpolatableValue = ParsedValue | ParsedValue[];
  6403. declare type DecalDashArrayX = number | (number | number[])[];
  6404. declare type DecalDashArrayY = number | number[];
  6405. interface DecalObject {
  6406. symbol?: string | string[];
  6407. symbolSize?: number;
  6408. symbolKeepAspect?: boolean;
  6409. color?: string;
  6410. backgroundColor?: string;
  6411. dashArrayX?: DecalDashArrayX;
  6412. dashArrayY?: DecalDashArrayY;
  6413. rotation?: number;
  6414. maxTileWidth?: number;
  6415. maxTileHeight?: number;
  6416. }
  6417. interface MediaQuery {
  6418. minWidth?: number;
  6419. maxWidth?: number;
  6420. minHeight?: number;
  6421. maxHeight?: number;
  6422. minAspectRatio?: number;
  6423. maxAspectRatio?: number;
  6424. }
  6425. declare type MediaUnit = {
  6426. query?: MediaQuery;
  6427. option: ECUnitOption;
  6428. };
  6429. declare type ComponentLayoutMode = {
  6430. type?: 'box';
  6431. ignoreSize?: boolean | boolean[];
  6432. };
  6433. declare type PaletteOptionMixin = ColorPaletteOptionMixin;
  6434. interface ColorPaletteOptionMixin {
  6435. color?: ZRColor | ZRColor[];
  6436. colorLayer?: ZRColor[][];
  6437. }
  6438. /**
  6439. * Mixin of option set to control the box layout of each component.
  6440. */
  6441. interface BoxLayoutOptionMixin {
  6442. width?: number | string;
  6443. height?: number | string;
  6444. top?: number | string;
  6445. right?: number | string;
  6446. bottom?: number | string;
  6447. left?: number | string;
  6448. }
  6449. interface CircleLayoutOptionMixin {
  6450. center?: (number | string)[];
  6451. radius?: (number | string)[] | number | string;
  6452. }
  6453. interface ShadowOptionMixin {
  6454. shadowBlur?: number;
  6455. shadowColor?: ColorString;
  6456. shadowOffsetX?: number;
  6457. shadowOffsetY?: number;
  6458. }
  6459. interface BorderOptionMixin {
  6460. borderColor?: ZRColor;
  6461. borderWidth?: number;
  6462. borderType?: ZRLineType;
  6463. borderCap?: CanvasLineCap;
  6464. borderJoin?: CanvasLineJoin;
  6465. borderDashOffset?: number;
  6466. borderMiterLimit?: number;
  6467. }
  6468. declare type ColorBy = 'series' | 'data';
  6469. interface SunburstColorByMixin {
  6470. colorBy?: ColorBy;
  6471. }
  6472. declare type AnimationDelayCallbackParam = {
  6473. count: number;
  6474. index: number;
  6475. };
  6476. declare type AnimationDurationCallback = (idx: number) => number;
  6477. declare type AnimationDelayCallback = (idx: number, params?: AnimationDelayCallbackParam) => number;
  6478. interface AnimationOption$1 {
  6479. duration?: number;
  6480. easing?: AnimationEasing;
  6481. delay?: number;
  6482. }
  6483. /**
  6484. * Mixin of option set to control the animation of series.
  6485. */
  6486. interface AnimationOptionMixin {
  6487. /**
  6488. * If enable animation
  6489. */
  6490. animation?: boolean;
  6491. /**
  6492. * Disable animation when the number of elements exceeds the threshold
  6493. */
  6494. animationThreshold?: number;
  6495. /**
  6496. * Duration of initialize animation.
  6497. * Can be a callback to specify duration of each element
  6498. */
  6499. animationDuration?: number | AnimationDurationCallback;
  6500. /**
  6501. * Easing of initialize animation
  6502. */
  6503. animationEasing?: AnimationEasing;
  6504. /**
  6505. * Delay of initialize animation
  6506. * Can be a callback to specify duration of each element
  6507. */
  6508. animationDelay?: number | AnimationDelayCallback;
  6509. /**
  6510. * Delay of data update animation.
  6511. * Can be a callback to specify duration of each element
  6512. */
  6513. animationDurationUpdate?: number | AnimationDurationCallback;
  6514. /**
  6515. * Easing of data update animation.
  6516. */
  6517. animationEasingUpdate?: AnimationEasing;
  6518. /**
  6519. * Delay of data update animation.
  6520. * Can be a callback to specify duration of each element
  6521. */
  6522. animationDelayUpdate?: number | AnimationDelayCallback;
  6523. }
  6524. interface RoamOptionMixin {
  6525. /**
  6526. * If enable roam. can be specified 'scale' or 'move'
  6527. */
  6528. roam?: boolean | 'pan' | 'move' | 'zoom' | 'scale';
  6529. /**
  6530. * Current center position.
  6531. */
  6532. center?: (number | string)[];
  6533. /**
  6534. * Current zoom level. Default is 1
  6535. */
  6536. zoom?: number;
  6537. scaleLimit?: {
  6538. min?: number;
  6539. max?: number;
  6540. };
  6541. }
  6542. declare type SymbolSizeCallback<T> = (rawValue: any, params: T) => number | number[];
  6543. declare type SymbolCallback<T> = (rawValue: any, params: T) => string;
  6544. declare type SymbolRotateCallback<T> = (rawValue: any, params: T) => number;
  6545. declare type SymbolOffsetCallback<T> = (rawValue: any, params: T) => string | number | (string | number)[];
  6546. /**
  6547. * Mixin of option set to control the element symbol.
  6548. * Include type of symbol, and size of symbol.
  6549. */
  6550. interface SymbolOptionMixin<T = never> {
  6551. /**
  6552. * type of symbol, like `cirlce`, `rect`, or custom path and image.
  6553. */
  6554. symbol?: string | (T extends never ? never : SymbolCallback<T>);
  6555. /**
  6556. * Size of symbol.
  6557. */
  6558. symbolSize?: number | number[] | (T extends never ? never : SymbolSizeCallback<T>);
  6559. symbolRotate?: number | (T extends never ? never : SymbolRotateCallback<T>);
  6560. symbolKeepAspect?: boolean;
  6561. symbolOffset?: string | number | (string | number)[] | (T extends never ? never : SymbolOffsetCallback<T>);
  6562. }
  6563. /**
  6564. * ItemStyleOption is a most common used set to config element styles.
  6565. * It includes both fill and stroke style.
  6566. */
  6567. interface ItemStyleOption<TCbParams = never> extends ShadowOptionMixin, BorderOptionMixin {
  6568. color?: ZRColor | (TCbParams extends never ? never : ((params: TCbParams) => ZRColor));
  6569. opacity?: number;
  6570. decal?: DecalObject | 'none';
  6571. }
  6572. /**
  6573. * ItemStyleOption is a option set to control styles on lines.
  6574. * Used in the components or series like `line`, `axis`
  6575. * It includes stroke style.
  6576. */
  6577. interface LineStyleOption<Clr = ZRColor> extends ShadowOptionMixin {
  6578. width?: number;
  6579. color?: Clr;
  6580. opacity?: number;
  6581. type?: ZRLineType;
  6582. cap?: CanvasLineCap;
  6583. join?: CanvasLineJoin;
  6584. dashOffset?: number;
  6585. miterLimit?: number;
  6586. }
  6587. /**
  6588. * ItemStyleOption is a option set to control styles on an area, like polygon, rectangle.
  6589. * It only include fill style.
  6590. */
  6591. interface AreaStyleOption<Clr = ZRColor> extends ShadowOptionMixin {
  6592. color?: Clr;
  6593. opacity?: number;
  6594. }
  6595. interface VisualOptionUnit {
  6596. symbol?: string;
  6597. symbolSize?: number;
  6598. color?: ColorString;
  6599. colorAlpha?: number;
  6600. opacity?: number;
  6601. colorLightness?: number;
  6602. colorSaturation?: number;
  6603. colorHue?: number;
  6604. decal?: DecalObject;
  6605. liftZ?: number;
  6606. }
  6607. declare type VisualOptionFixed = VisualOptionUnit;
  6608. /**
  6609. * Option about visual properties used in piecewise mapping
  6610. * Used in each piece.
  6611. */
  6612. declare type VisualOptionPiecewise = VisualOptionUnit;
  6613. /**
  6614. * All visual properties can be encoded.
  6615. */
  6616. declare type BuiltinVisualProperty = keyof VisualOptionUnit;
  6617. interface TextCommonOption extends ShadowOptionMixin {
  6618. color?: string;
  6619. fontStyle?: ZRFontStyle;
  6620. fontWeight?: ZRFontWeight;
  6621. fontFamily?: string;
  6622. fontSize?: number | string;
  6623. align?: HorizontalAlign;
  6624. verticalAlign?: VerticalAlign;
  6625. baseline?: VerticalAlign;
  6626. opacity?: number;
  6627. lineHeight?: number;
  6628. backgroundColor?: ColorString | {
  6629. image: ImageLike | string;
  6630. };
  6631. borderColor?: string;
  6632. borderWidth?: number;
  6633. borderType?: ZRLineType;
  6634. borderDashOffset?: number;
  6635. borderRadius?: number | number[];
  6636. padding?: number | number[];
  6637. width?: number | string;
  6638. height?: number;
  6639. textBorderColor?: string;
  6640. textBorderWidth?: number;
  6641. textBorderType?: ZRLineType;
  6642. textBorderDashOffset?: number;
  6643. textShadowBlur?: number;
  6644. textShadowColor?: string;
  6645. textShadowOffsetX?: number;
  6646. textShadowOffsetY?: number;
  6647. tag?: string;
  6648. }
  6649. interface LabelFormatterCallback<T = CallbackDataParams> {
  6650. (params: T): string;
  6651. }
  6652. /**
  6653. * LabelOption is an option set to control the style of labels.
  6654. * Include color, background, shadow, truncate, rotation, distance, etc..
  6655. */
  6656. interface LabelOption extends TextCommonOption {
  6657. /**
  6658. * If show label
  6659. */
  6660. show?: boolean;
  6661. position?: ElementTextConfig['position'];
  6662. distance?: number;
  6663. rotate?: number;
  6664. offset?: number[];
  6665. /**
  6666. * Min margin between labels. Used when label has layout.
  6667. */
  6668. minMargin?: number;
  6669. overflow?: TextStyleProps['overflow'];
  6670. silent?: boolean;
  6671. precision?: number | 'auto';
  6672. valueAnimation?: boolean;
  6673. rich?: Dictionary<TextCommonOption>;
  6674. }
  6675. interface SeriesLabelOption<T extends CallbackDataParams = CallbackDataParams> extends LabelOption {
  6676. formatter?: string | LabelFormatterCallback<T>;
  6677. }
  6678. /**
  6679. * Option for labels on line, like markLine, lines
  6680. */
  6681. interface LineLabelOption extends Omit<LabelOption, 'distance' | 'position'> {
  6682. position?: 'start' | 'middle' | 'end' | 'insideStart' | 'insideStartTop' | 'insideStartBottom' | 'insideMiddle' | 'insideMiddleTop' | 'insideMiddleBottom' | 'insideEnd' | 'insideEndTop' | 'insideEndBottom' | 'insideMiddleBottom';
  6683. /**
  6684. * Distance can be an array.
  6685. * Which will specify horizontal and vertical distance respectively
  6686. */
  6687. distance?: number | number[];
  6688. }
  6689. interface LabelLineOption {
  6690. show?: boolean;
  6691. /**
  6692. * If displayed above other elements
  6693. */
  6694. showAbove?: boolean;
  6695. length?: number;
  6696. length2?: number;
  6697. smooth?: boolean | number;
  6698. minTurnAngle?: number;
  6699. lineStyle?: LineStyleOption;
  6700. }
  6701. interface SeriesLineLabelOption extends LineLabelOption {
  6702. formatter?: string | LabelFormatterCallback<CallbackDataParams>;
  6703. }
  6704. interface LabelLayoutOptionCallbackParams {
  6705. /**
  6706. * Index of data which the label represents.
  6707. * It can be null if label doesn't represent any data.
  6708. */
  6709. dataIndex?: number;
  6710. /**
  6711. * Type of data which the label represents.
  6712. * It can be null if label doesn't represent any data.
  6713. */
  6714. dataType?: SeriesDataType;
  6715. seriesIndex: number;
  6716. text: string;
  6717. align: ZRTextAlign;
  6718. verticalAlign: ZRTextVerticalAlign;
  6719. rect: RectLike;
  6720. labelRect: RectLike;
  6721. labelLinePoints?: number[][];
  6722. }
  6723. interface LabelLayoutOption {
  6724. /**
  6725. * If move the overlapped label. If label is still overlapped after moved.
  6726. * It will determine if to hide this label with `hideOverlap` policy.
  6727. *
  6728. * shiftX/Y will keep the order on x/y
  6729. * shuffleX/y will move the label around the original position randomly.
  6730. */
  6731. moveOverlap?: 'shiftX' | 'shiftY' | 'shuffleX' | 'shuffleY';
  6732. /**
  6733. * If hide the overlapped label. It will be handled after move.
  6734. * @default 'none'
  6735. */
  6736. hideOverlap?: boolean;
  6737. /**
  6738. * If label is draggable.
  6739. */
  6740. draggable?: boolean;
  6741. /**
  6742. * Can be absolute px number or percent string.
  6743. */
  6744. x?: number | string;
  6745. y?: number | string;
  6746. /**
  6747. * offset on x based on the original position.
  6748. */
  6749. dx?: number;
  6750. /**
  6751. * offset on y based on the original position.
  6752. */
  6753. dy?: number;
  6754. rotate?: number;
  6755. align?: ZRTextAlign;
  6756. verticalAlign?: ZRTextVerticalAlign;
  6757. width?: number;
  6758. height?: number;
  6759. fontSize?: number;
  6760. labelLinePoints?: number[][];
  6761. }
  6762. declare type LabelLayoutOptionCallback = (params: LabelLayoutOptionCallbackParams) => LabelLayoutOption;
  6763. interface TooltipFormatterCallback<T> {
  6764. /**
  6765. * For sync callback
  6766. * params will be an array on axis trigger.
  6767. */
  6768. (params: T, asyncTicket: string): string | HTMLElement | HTMLElement[];
  6769. /**
  6770. * For async callback.
  6771. * Returned html string will be a placeholder when callback is not invoked.
  6772. */
  6773. (params: T, asyncTicket: string, callback: (cbTicket: string, htmlOrDomNodes: string | HTMLElement | HTMLElement[]) => void): string | HTMLElement | HTMLElement[];
  6774. }
  6775. declare type TooltipBuiltinPosition = 'inside' | 'top' | 'left' | 'right' | 'bottom';
  6776. declare type TooltipBoxLayoutOption = Pick<BoxLayoutOptionMixin, 'top' | 'left' | 'right' | 'bottom'>;
  6777. declare type TooltipPositionCallbackParams = CallbackDataParams | CallbackDataParams[];
  6778. /**
  6779. * Position relative to the hoverred element. Only available when trigger is item.
  6780. */
  6781. interface TooltipPositionCallback {
  6782. (point: [number, number],
  6783. /**
  6784. * params will be an array on axis trigger.
  6785. */
  6786. params: TooltipPositionCallbackParams,
  6787. /**
  6788. * Will be HTMLDivElement when renderMode is html
  6789. * Otherwise it's graphic.Text
  6790. */
  6791. el: HTMLDivElement | ZRText | null,
  6792. /**
  6793. * Rect of hover elements. Will be null if not hovered
  6794. */
  6795. rect: RectLike | null, size: {
  6796. /**
  6797. * Size of popup content
  6798. */
  6799. contentSize: [number, number];
  6800. /**
  6801. * Size of the chart view
  6802. */
  6803. viewSize: [number, number];
  6804. }): Array<number | string> | TooltipBuiltinPosition | TooltipBoxLayoutOption;
  6805. }
  6806. /**
  6807. * Common tooltip option
  6808. * Can be configured on series, graphic elements
  6809. */
  6810. interface CommonTooltipOption<FormatterParams> {
  6811. show?: boolean;
  6812. /**
  6813. * When to trigger
  6814. */
  6815. triggerOn?: 'mousemove' | 'click' | 'none' | 'mousemove|click';
  6816. /**
  6817. * Whether to not hide popup content automatically
  6818. */
  6819. alwaysShowContent?: boolean;
  6820. formatter?: string | TooltipFormatterCallback<FormatterParams>;
  6821. /**
  6822. * Formatter of value.
  6823. *
  6824. * Will be ignored if tooltip.formatter is specified.
  6825. */
  6826. valueFormatter?: (value: OptionDataValue | OptionDataValue[]) => string;
  6827. /**
  6828. * Absolution pixel [x, y] array. Or relative percent string [x, y] array.
  6829. * If trigger is 'item'. position can be set to 'inside' / 'top' / 'left' / 'right' / 'bottom',
  6830. * which is relative to the hovered element.
  6831. *
  6832. * Support to be a callback
  6833. */
  6834. position?: (number | string)[] | TooltipBuiltinPosition | TooltipPositionCallback | TooltipBoxLayoutOption;
  6835. confine?: boolean;
  6836. /**
  6837. * Consider triggered from axisPointer handle, verticalAlign should be 'middle'
  6838. */
  6839. align?: HorizontalAlign;
  6840. verticalAlign?: VerticalAlign;
  6841. /**
  6842. * Delay of show. milesecond.
  6843. */
  6844. showDelay?: number;
  6845. /**
  6846. * Delay of hide. milesecond.
  6847. */
  6848. hideDelay?: number;
  6849. transitionDuration?: number;
  6850. /**
  6851. * Whether mouse is allowed to enter the floating layer of tooltip
  6852. * If you need to interact in the tooltip like with links or buttons, it can be set as true.
  6853. */
  6854. enterable?: boolean;
  6855. backgroundColor?: ColorString;
  6856. borderColor?: ColorString;
  6857. borderRadius?: number;
  6858. borderWidth?: number;
  6859. shadowBlur?: number;
  6860. shadowColor?: string;
  6861. shadowOffsetX?: number;
  6862. shadowOffsetY?: number;
  6863. /**
  6864. * Padding between tooltip content and tooltip border.
  6865. */
  6866. padding?: number | number[];
  6867. /**
  6868. * Available when renderMode is 'html'
  6869. */
  6870. extraCssText?: string;
  6871. textStyle?: Pick<LabelOption, 'color' | 'fontStyle' | 'fontWeight' | 'fontFamily' | 'fontSize' | 'lineHeight' | 'width' | 'height' | 'textBorderColor' | 'textBorderWidth' | 'textShadowColor' | 'textShadowBlur' | 'textShadowOffsetX' | 'textShadowOffsetY' | 'align'> & {
  6872. decoration?: string;
  6873. };
  6874. }
  6875. declare type ComponentItemTooltipOption<T> = CommonTooltipOption<T> & {
  6876. content?: string;
  6877. formatterParams?: ComponentItemTooltipLabelFormatterParams;
  6878. };
  6879. declare type ComponentItemTooltipLabelFormatterParams = {
  6880. componentType: string;
  6881. name: string;
  6882. $vars: string[];
  6883. } & {
  6884. [key in string]: unknown;
  6885. };
  6886. /**
  6887. * Tooltip option configured on each series
  6888. */
  6889. declare type SeriesTooltipOption = CommonTooltipOption<CallbackDataParams> & {
  6890. trigger?: 'item' | 'axis' | boolean | 'none';
  6891. };
  6892. declare type LabelFormatterParams = {
  6893. value: ScaleDataValue;
  6894. axisDimension: string;
  6895. axisIndex: number;
  6896. seriesData: CallbackDataParams[];
  6897. };
  6898. /**
  6899. * Common axis option. can be configured on each axis
  6900. */
  6901. interface CommonAxisPointerOption {
  6902. show?: boolean | 'auto';
  6903. z?: number;
  6904. zlevel?: number;
  6905. triggerOn?: 'click' | 'mousemove' | 'none' | 'mousemove|click';
  6906. type?: 'line' | 'shadow' | 'none';
  6907. snap?: boolean;
  6908. triggerTooltip?: boolean;
  6909. /**
  6910. * current value. When using axisPointer.handle, value can be set to define the initial position of axisPointer.
  6911. */
  6912. value?: ScaleDataValue;
  6913. status?: 'show' | 'hide';
  6914. label?: LabelOption & {
  6915. precision?: 'auto' | number;
  6916. margin?: number;
  6917. /**
  6918. * String template include variable {value} or callback function
  6919. */
  6920. formatter?: string | ((params: LabelFormatterParams) => string);
  6921. };
  6922. animation?: boolean | 'auto';
  6923. animationDurationUpdate?: number;
  6924. animationEasingUpdate?: ZREasing;
  6925. /**
  6926. * Available when type is 'line'
  6927. */
  6928. lineStyle?: LineStyleOption;
  6929. /**
  6930. * Available when type is 'shadow'
  6931. */
  6932. shadowStyle?: AreaStyleOption;
  6933. handle?: {
  6934. show?: boolean;
  6935. icon?: string;
  6936. /**
  6937. * The size of the handle
  6938. */
  6939. size?: number | number[];
  6940. /**
  6941. * Distance from handle center to axis.
  6942. */
  6943. margin?: number;
  6944. color?: ColorString;
  6945. /**
  6946. * Throttle for mobile performance
  6947. */
  6948. throttle?: number;
  6949. } & ShadowOptionMixin;
  6950. seriesDataIndices?: {
  6951. seriesIndex: number;
  6952. dataIndex: number;
  6953. dataIndexInside: number;
  6954. }[];
  6955. }
  6956. interface ComponentOption {
  6957. mainType?: string;
  6958. type?: string;
  6959. id?: OptionId;
  6960. name?: OptionName;
  6961. z?: number;
  6962. zlevel?: number;
  6963. }
  6964. declare type BlurScope = 'coordinateSystem' | 'series' | 'global';
  6965. /**
  6966. * can be array of data indices.
  6967. * Or may be an dictionary if have different types of data like in graph.
  6968. */
  6969. declare type InnerFocus = DefaultEmphasisFocus | ArrayLike<number> | Dictionary<ArrayLike<number>>;
  6970. interface DefaultStatesMixin {
  6971. emphasis?: any;
  6972. select?: any;
  6973. blur?: any;
  6974. }
  6975. declare type DefaultEmphasisFocus = 'none' | 'self' | 'series';
  6976. interface DefaultStatesMixinEmphasis {
  6977. /**
  6978. * self: Focus self and blur all others.
  6979. * series: Focus series and blur all other series.
  6980. */
  6981. focus?: DefaultEmphasisFocus;
  6982. }
  6983. interface StatesMixinBase {
  6984. emphasis?: unknown;
  6985. select?: unknown;
  6986. blur?: unknown;
  6987. }
  6988. interface StatesOptionMixin<StateOption, StatesMixin extends StatesMixinBase> {
  6989. /**
  6990. * Emphasis states
  6991. */
  6992. emphasis?: StateOption & StatesMixin['emphasis'] & {
  6993. /**
  6994. * Scope of blurred element when focus.
  6995. *
  6996. * coordinateSystem: blur others in the same coordinateSystem
  6997. * series: blur others in the same series
  6998. * global: blur all others
  6999. *
  7000. * Default to be coordinate system.
  7001. */
  7002. blurScope?: BlurScope;
  7003. /**
  7004. * If emphasis state is disabled.
  7005. */
  7006. disabled?: boolean;
  7007. };
  7008. /**
  7009. * Select states
  7010. */
  7011. select?: StateOption & StatesMixin['select'] & {
  7012. disabled?: boolean;
  7013. };
  7014. /**
  7015. * Blur states.
  7016. */
  7017. blur?: StateOption & StatesMixin['blur'];
  7018. }
  7019. interface UniversalTransitionOption {
  7020. enabled?: boolean;
  7021. /**
  7022. * Animation delay of each divided element
  7023. */
  7024. delay?: (index: number, count: number) => number;
  7025. /**
  7026. * How to divide the shape in combine and split animation.
  7027. */
  7028. divideShape?: 'clone' | 'split';
  7029. /**
  7030. * Series will have transition between if they have same seriesKey.
  7031. * Usually it is a string. It can also be an array,
  7032. * which means it can be transition from or to multiple series with each key in this array item.
  7033. *
  7034. * Note:
  7035. * If two series have both array seriesKey. They will be compared after concated to a string(which is order independent)
  7036. * Transition between string key has higher priority.
  7037. *
  7038. * Default to use series id.
  7039. */
  7040. seriesKey?: string | string[];
  7041. }
  7042. interface SeriesOption<StateOption = unknown, StatesMixin extends StatesMixinBase = DefaultStatesMixin> extends ComponentOption, AnimationOptionMixin, ColorPaletteOptionMixin, StatesOptionMixin<StateOption, StatesMixin> {
  7043. mainType?: 'series';
  7044. silent?: boolean;
  7045. blendMode?: string;
  7046. /**
  7047. * Cursor when mouse on the elements
  7048. */
  7049. cursor?: string;
  7050. /**
  7051. * groupId of data. can be used for doing drilldown / up animation
  7052. * It will be ignored if:
  7053. * - groupId is specified in each data
  7054. * - encode.itemGroupId is given.
  7055. */
  7056. dataGroupId?: OptionId;
  7057. data?: unknown;
  7058. colorBy?: ColorBy;
  7059. legendHoverLink?: boolean;
  7060. /**
  7061. * Configurations about progressive rendering
  7062. */
  7063. progressive?: number | false;
  7064. progressiveThreshold?: number;
  7065. progressiveChunkMode?: 'mod';
  7066. /**
  7067. * Not available on every series
  7068. */
  7069. coordinateSystem?: string;
  7070. hoverLayerThreshold?: number;
  7071. /**
  7072. * When dataset is used, seriesLayoutBy specifies whether the column or the row of dataset is mapped to the series
  7073. * namely, the series is "layout" on columns or rows
  7074. * @default 'column'
  7075. */
  7076. seriesLayoutBy?: 'column' | 'row';
  7077. labelLine?: LabelLineOption;
  7078. /**
  7079. * Overall label layout option in label layout stage.
  7080. */
  7081. labelLayout?: LabelLayoutOption | LabelLayoutOptionCallback;
  7082. /**
  7083. * Animation config for state transition.
  7084. */
  7085. stateAnimation?: AnimationOption$1;
  7086. /**
  7087. * If enabled universal transition cross series.
  7088. * @example
  7089. * universalTransition: true
  7090. * universalTransition: { enabled: true }
  7091. */
  7092. universalTransition?: boolean | UniversalTransitionOption;
  7093. /**
  7094. * Map of selected data
  7095. * key is name or index of data.
  7096. */
  7097. selectedMap?: Dictionary<boolean> | 'all';
  7098. selectedMode?: 'single' | 'multiple' | 'series' | boolean;
  7099. }
  7100. interface SeriesOnCartesianOptionMixin {
  7101. xAxisIndex?: number;
  7102. yAxisIndex?: number;
  7103. xAxisId?: string;
  7104. yAxisId?: string;
  7105. }
  7106. interface SeriesOnPolarOptionMixin {
  7107. polarIndex?: number;
  7108. polarId?: string;
  7109. }
  7110. interface SeriesOnSingleOptionMixin {
  7111. singleAxisIndex?: number;
  7112. singleAxisId?: string;
  7113. }
  7114. interface SeriesOnGeoOptionMixin {
  7115. geoIndex?: number;
  7116. geoId?: string;
  7117. }
  7118. interface SeriesOnCalendarOptionMixin {
  7119. calendarIndex?: number;
  7120. calendarId?: string;
  7121. }
  7122. interface SeriesLargeOptionMixin {
  7123. large?: boolean;
  7124. largeThreshold?: number;
  7125. }
  7126. interface SeriesStackOptionMixin {
  7127. stack?: string;
  7128. stackStrategy?: 'samesign' | 'all' | 'positive' | 'negative';
  7129. }
  7130. declare type SamplingFunc = (frame: ArrayLike<number>) => number;
  7131. interface SeriesSamplingOptionMixin {
  7132. sampling?: 'none' | 'average' | 'min' | 'max' | 'sum' | 'lttb' | SamplingFunc;
  7133. }
  7134. interface SeriesEncodeOptionMixin {
  7135. datasetIndex?: number;
  7136. datasetId?: string | number;
  7137. seriesLayoutBy?: SeriesLayoutBy;
  7138. sourceHeader?: OptionSourceHeader;
  7139. dimensions?: DimensionDefinitionLoose[];
  7140. encode?: OptionEncode;
  7141. }
  7142. interface AriaLabelOption {
  7143. enabled?: boolean;
  7144. description?: string;
  7145. general?: {
  7146. withTitle?: string;
  7147. withoutTitle?: string;
  7148. };
  7149. series?: {
  7150. maxCount?: number;
  7151. single?: {
  7152. prefix?: string;
  7153. withName?: string;
  7154. withoutName?: string;
  7155. };
  7156. multiple?: {
  7157. prefix?: string;
  7158. withName?: string;
  7159. withoutName?: string;
  7160. separator?: {
  7161. middle?: string;
  7162. end?: string;
  7163. };
  7164. };
  7165. };
  7166. data?: {
  7167. maxCount?: number;
  7168. allData?: string;
  7169. partialData?: string;
  7170. withName?: string;
  7171. withoutName?: string;
  7172. separator?: {
  7173. middle?: string;
  7174. end?: string;
  7175. };
  7176. };
  7177. }
  7178. interface AriaOption extends AriaLabelOption {
  7179. mainType?: 'aria';
  7180. enabled?: boolean;
  7181. label?: AriaLabelOption;
  7182. decal?: {
  7183. show?: boolean;
  7184. decals?: DecalObject | DecalObject[];
  7185. };
  7186. }
  7187. declare type AreaStyleProps = Pick<PathStyleProps, 'fill' | 'shadowBlur' | 'shadowOffsetX' | 'shadowOffsetY' | 'opacity' | 'shadowColor'>;
  7188. declare class AreaStyleMixin {
  7189. getAreaStyle(this: Model, excludes?: readonly (keyof AreaStyleOption)[], includes?: readonly (keyof AreaStyleOption)[]): AreaStyleProps;
  7190. }
  7191. declare type LabelFontOption = Pick<LabelOption, 'fontStyle' | 'fontWeight' | 'fontSize' | 'fontFamily'>;
  7192. declare type LabelRectRelatedOption = Pick<LabelOption, 'align' | 'verticalAlign' | 'padding' | 'lineHeight' | 'baseline' | 'rich' | 'width' | 'height' | 'overflow'> & LabelFontOption;
  7193. declare class TextStyleMixin {
  7194. /**
  7195. * Get color property or get color from option.textStyle.color
  7196. */
  7197. getTextColor(this: Model, isEmphasis?: boolean): ColorString;
  7198. /**
  7199. * Create font string from fontStyle, fontWeight, fontSize, fontFamily
  7200. * @return {string}
  7201. */
  7202. getFont(this: Model<LabelFontOption>): string;
  7203. getTextRect(this: Model<LabelRectRelatedOption> & TextStyleMixin, text: string): BoundingRect;
  7204. }
  7205. interface Model<Opt = ModelOption> extends LineStyleMixin, ItemStyleMixin, TextStyleMixin, AreaStyleMixin {
  7206. }
  7207. declare class Model<Opt = ModelOption> {
  7208. parentModel: Model;
  7209. ecModel: GlobalModel;
  7210. option: Opt;
  7211. constructor(option?: Opt, parentModel?: Model, ecModel?: GlobalModel);
  7212. init(option: Opt, parentModel?: Model, ecModel?: GlobalModel, ...rest: any): void;
  7213. /**
  7214. * Merge the input option to me.
  7215. */
  7216. mergeOption(option: Opt, ecModel?: GlobalModel): void;
  7217. get<R extends keyof Opt>(path: R, ignoreParent?: boolean): Opt[R];
  7218. get<R extends keyof Opt>(path: readonly [R], ignoreParent?: boolean): Opt[R];
  7219. get<R extends keyof Opt, S extends keyof Opt[R]>(path: readonly [R, S], ignoreParent?: boolean): Opt[R][S];
  7220. 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];
  7221. getShallow<R extends keyof Opt>(key: R, ignoreParent?: boolean): Opt[R];
  7222. getModel<R extends keyof Opt>(path: R, parentModel?: Model): Model<Opt[R]>;
  7223. getModel<R extends keyof Opt>(path: readonly [R], parentModel?: Model): Model<Opt[R]>;
  7224. getModel<R extends keyof Opt, S extends keyof Opt[R]>(path: readonly [R, S], parentModel?: Model): Model<Opt[R][S]>;
  7225. 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]>;
  7226. 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]>;
  7227. /**
  7228. * If model has option
  7229. */
  7230. isEmpty(): boolean;
  7231. restoreData(): void;
  7232. clone(): Model<Opt>;
  7233. parsePath(path: string | readonly string[]): readonly string[];
  7234. resolveParentPath(path: readonly string[]): string[];
  7235. isAnimationEnabled(): boolean;
  7236. private _doGet;
  7237. }
  7238. /**
  7239. * ECharts option manager
  7240. */
  7241. /**
  7242. * TERM EXPLANATIONS:
  7243. * See `ECOption` and `ECUnitOption` in `src/util/types.ts`.
  7244. */
  7245. declare class OptionManager {
  7246. private _api;
  7247. private _timelineOptions;
  7248. private _mediaList;
  7249. private _mediaDefault;
  7250. /**
  7251. * -1, means default.
  7252. * empty means no media.
  7253. */
  7254. private _currentMediaIndices;
  7255. private _optionBackup;
  7256. private _newBaseOption;
  7257. constructor(api: ExtensionAPI);
  7258. setOption(rawOption: ECBasicOption, optionPreprocessorFuncs: OptionPreprocessor[], opt: InnerSetOptionOpts): void;
  7259. mountOption(isRecreate: boolean): ECUnitOption;
  7260. getTimelineOption(ecModel: GlobalModel): ECUnitOption;
  7261. getMediaOption(ecModel: GlobalModel): ECUnitOption[];
  7262. }
  7263. declare const _default: {
  7264. time: {
  7265. month: string[];
  7266. monthAbbr: string[];
  7267. dayOfWeek: string[];
  7268. dayOfWeekAbbr: string[];
  7269. };
  7270. legend: {
  7271. selector: {
  7272. all: string;
  7273. inverse: string;
  7274. };
  7275. };
  7276. toolbox: {
  7277. brush: {
  7278. title: {
  7279. rect: string;
  7280. polygon: string;
  7281. lineX: string;
  7282. lineY: string;
  7283. keep: string;
  7284. clear: string;
  7285. };
  7286. };
  7287. dataView: {
  7288. title: string;
  7289. lang: string[];
  7290. };
  7291. dataZoom: {
  7292. title: {
  7293. zoom: string;
  7294. back: string;
  7295. };
  7296. };
  7297. magicType: {
  7298. title: {
  7299. line: string;
  7300. bar: string;
  7301. stack: string;
  7302. tiled: string;
  7303. };
  7304. };
  7305. restore: {
  7306. title: string;
  7307. };
  7308. saveAsImage: {
  7309. title: string;
  7310. lang: string[];
  7311. };
  7312. };
  7313. series: {
  7314. typeNames: {
  7315. pie: string;
  7316. bar: string;
  7317. line: string;
  7318. scatter: string;
  7319. effectScatter: string;
  7320. radar: string;
  7321. tree: string;
  7322. treemap: string;
  7323. boxplot: string;
  7324. candlestick: string;
  7325. k: string;
  7326. heatmap: string;
  7327. map: string;
  7328. parallel: string;
  7329. lines: string;
  7330. graph: string;
  7331. sankey: string;
  7332. funnel: string;
  7333. gauge: string;
  7334. pictorialBar: string;
  7335. themeRiver: string;
  7336. sunburst: string;
  7337. };
  7338. };
  7339. aria: {
  7340. general: {
  7341. withTitle: string;
  7342. withoutTitle: string;
  7343. };
  7344. series: {
  7345. single: {
  7346. prefix: string;
  7347. withName: string;
  7348. withoutName: string;
  7349. };
  7350. multiple: {
  7351. prefix: string;
  7352. withName: string;
  7353. withoutName: string;
  7354. separator: {
  7355. middle: string;
  7356. end: string;
  7357. };
  7358. };
  7359. };
  7360. data: {
  7361. allData: string;
  7362. partialData: string;
  7363. withName: string;
  7364. withoutName: string;
  7365. separator: {
  7366. middle: string;
  7367. end: string;
  7368. };
  7369. };
  7370. };
  7371. };
  7372. declare type LocaleOption = typeof _default;
  7373. declare function registerLocale(locale: string, localeObj: LocaleOption): void;
  7374. /**
  7375. * Caution: If the mechanism should be changed some day, these cases
  7376. * should be considered:
  7377. *
  7378. * (1) In `merge option` mode, if using the same option to call `setOption`
  7379. * many times, the result should be the same (try our best to ensure that).
  7380. * (2) In `merge option` mode, if a component has no id/name specified, it
  7381. * will be merged by index, and the result sequence of the components is
  7382. * consistent to the original sequence.
  7383. * (3) In `replaceMerge` mode, keep the result sequence of the components is
  7384. * consistent to the original sequence, even though there might result in "hole".
  7385. * (4) `reset` feature (in toolbox). Find detailed info in comments about
  7386. * `mergeOption` in module:echarts/model/OptionManager.
  7387. */
  7388. interface GlobalModelSetOptionOpts {
  7389. replaceMerge: ComponentMainType | ComponentMainType[];
  7390. }
  7391. interface InnerSetOptionOpts {
  7392. replaceMergeMainTypeMap: HashMap<boolean, string>;
  7393. }
  7394. /**
  7395. * @param condition.mainType Mandatory.
  7396. * @param condition.subType Optional.
  7397. * @param condition.query like {xxxIndex, xxxId, xxxName},
  7398. * where xxx is mainType.
  7399. * If query attribute is null/undefined or has no index/id/name,
  7400. * do not filtering by query conditions, which is convenient for
  7401. * no-payload situations or when target of action is global.
  7402. * @param condition.filter parameter: component, return boolean.
  7403. */
  7404. interface QueryConditionKindA {
  7405. mainType: ComponentMainType;
  7406. subType?: ComponentSubType;
  7407. query?: {
  7408. [k: string]: number | number[] | string | string[];
  7409. };
  7410. filter?: (cmpt: ComponentModel) => boolean;
  7411. }
  7412. /**
  7413. * If none of index and id and name used, return all components with mainType.
  7414. * @param condition.mainType
  7415. * @param condition.subType If ignore, only query by mainType
  7416. * @param condition.index Either input index or id or name.
  7417. * @param condition.id Either input index or id or name.
  7418. * @param condition.name Either input index or id or name.
  7419. */
  7420. interface QueryConditionKindB {
  7421. mainType: ComponentMainType;
  7422. subType?: ComponentSubType;
  7423. index?: number | number[];
  7424. id?: OptionId | OptionId[];
  7425. name?: OptionName | OptionName[];
  7426. }
  7427. interface EachComponentAllCallback {
  7428. (mainType: string, model: ComponentModel, componentIndex: number): void;
  7429. }
  7430. interface EachComponentInMainTypeCallback {
  7431. (model: ComponentModel, componentIndex: number): void;
  7432. }
  7433. declare class GlobalModel extends Model<ECUnitOption> {
  7434. option: ECUnitOption;
  7435. private _theme;
  7436. private _locale;
  7437. private _optionManager;
  7438. private _componentsMap;
  7439. /**
  7440. * `_componentsMap` might have "hole" because of remove.
  7441. * So save components count for a certain mainType here.
  7442. */
  7443. private _componentsCount;
  7444. /**
  7445. * Mapping between filtered series list and raw series list.
  7446. * key: filtered series indices, value: raw series indices.
  7447. * Items of `_seriesIndices` never be null/empty/-1.
  7448. * If series has been removed by `replaceMerge`, those series
  7449. * also won't be in `_seriesIndices`, just like be filtered.
  7450. */
  7451. private _seriesIndices;
  7452. /**
  7453. * Key: seriesIndex.
  7454. * Keep consistent with `_seriesIndices`.
  7455. */
  7456. private _seriesIndicesMap;
  7457. /**
  7458. * Model for store update payload
  7459. */
  7460. private _payload;
  7461. scheduler: Scheduler;
  7462. ssr: boolean;
  7463. init(option: ECBasicOption, parentModel: Model, ecModel: GlobalModel, theme: object, locale: object, optionManager: OptionManager): void;
  7464. setOption(option: ECBasicOption, opts: GlobalModelSetOptionOpts, optionPreprocessorFuncs: OptionPreprocessor[]): void;
  7465. /**
  7466. * @param type null/undefined: reset all.
  7467. * 'recreate': force recreate all.
  7468. * 'timeline': only reset timeline option
  7469. * 'media': only reset media query option
  7470. * @return Whether option changed.
  7471. */
  7472. resetOption(type: 'recreate' | 'timeline' | 'media', opt?: Pick<GlobalModelSetOptionOpts, 'replaceMerge'>): boolean;
  7473. private _resetOption;
  7474. mergeOption(option: ECUnitOption): void;
  7475. private _mergeOption;
  7476. /**
  7477. * Get option for output (cloned option and inner info removed)
  7478. */
  7479. getOption(): ECUnitOption;
  7480. getTheme(): Model;
  7481. getLocaleModel(): Model<LocaleOption>;
  7482. setUpdatePayload(payload: Payload): void;
  7483. getUpdatePayload(): Payload;
  7484. /**
  7485. * @param idx If not specified, return the first one.
  7486. */
  7487. getComponent(mainType: ComponentMainType, idx?: number): ComponentModel;
  7488. /**
  7489. * @return Never be null/undefined.
  7490. */
  7491. queryComponents(condition: QueryConditionKindB): ComponentModel[];
  7492. /**
  7493. * The interface is different from queryComponents,
  7494. * which is convenient for inner usage.
  7495. *
  7496. * @usage
  7497. * let result = findComponents(
  7498. * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}
  7499. * );
  7500. * let result = findComponents(
  7501. * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}
  7502. * );
  7503. * let result = findComponents(
  7504. * {mainType: 'series',
  7505. * filter: function (model, index) {...}}
  7506. * );
  7507. * // result like [component0, componnet1, ...]
  7508. */
  7509. findComponents(condition: QueryConditionKindA): ComponentModel[];
  7510. /**
  7511. * Travel components (before filtered).
  7512. *
  7513. * @usage
  7514. * eachComponent('legend', function (legendModel, index) {
  7515. * ...
  7516. * });
  7517. * eachComponent(function (componentType, model, index) {
  7518. * // componentType does not include subType
  7519. * // (componentType is 'a' but not 'a.b')
  7520. * });
  7521. * eachComponent(
  7522. * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}},
  7523. * function (model, index) {...}
  7524. * );
  7525. * eachComponent(
  7526. * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}},
  7527. * function (model, index) {...}
  7528. * );
  7529. */
  7530. eachComponent<T>(cb: EachComponentAllCallback, context?: T): void;
  7531. eachComponent<T>(mainType: string, cb: EachComponentInMainTypeCallback, context?: T): void;
  7532. eachComponent<T>(mainType: QueryConditionKindA, cb: EachComponentInMainTypeCallback, context?: T): void;
  7533. /**
  7534. * Get series list before filtered by name.
  7535. */
  7536. getSeriesByName(name: OptionName): SeriesModel[];
  7537. /**
  7538. * Get series list before filtered by index.
  7539. */
  7540. getSeriesByIndex(seriesIndex: number): SeriesModel;
  7541. /**
  7542. * Get series list before filtered by type.
  7543. * FIXME: rename to getRawSeriesByType?
  7544. */
  7545. getSeriesByType(subType: ComponentSubType): SeriesModel[];
  7546. /**
  7547. * Get all series before filtered.
  7548. */
  7549. getSeries(): SeriesModel[];
  7550. /**
  7551. * Count series before filtered.
  7552. */
  7553. getSeriesCount(): number;
  7554. /**
  7555. * After filtering, series may be different
  7556. * from raw series.
  7557. */
  7558. eachSeries<T>(cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
  7559. /**
  7560. * Iterate raw series before filtered.
  7561. *
  7562. * @param {Function} cb
  7563. * @param {*} context
  7564. */
  7565. eachRawSeries<T>(cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
  7566. /**
  7567. * After filtering, series may be different.
  7568. * from raw series.
  7569. */
  7570. eachSeriesByType<T>(subType: ComponentSubType, cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
  7571. /**
  7572. * Iterate raw series before filtered of given type.
  7573. */
  7574. eachRawSeriesByType<T>(subType: ComponentSubType, cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => void, context?: T): void;
  7575. isSeriesFiltered(seriesModel: SeriesModel): boolean;
  7576. getCurrentSeriesIndices(): number[];
  7577. filterSeries<T>(cb: (this: T, series: SeriesModel, rawSeriesIndex: number) => boolean, context?: T): void;
  7578. restoreData(payload?: Payload): void;
  7579. private static internalField;
  7580. }
  7581. interface GlobalModel extends PaletteMixin<ECUnitOption> {
  7582. }
  7583. interface UpdateLifecycleTransitionSeriesFinder {
  7584. seriesIndex?: ModelFinderIndexQuery;
  7585. seriesId?: ModelFinderIdQuery;
  7586. dimension: DimensionLoose;
  7587. }
  7588. interface UpdateLifecycleTransitionItem {
  7589. from?: UpdateLifecycleTransitionSeriesFinder | UpdateLifecycleTransitionSeriesFinder[];
  7590. to: UpdateLifecycleTransitionSeriesFinder | UpdateLifecycleTransitionSeriesFinder[];
  7591. }
  7592. declare type UpdateLifecycleTransitionOpt = UpdateLifecycleTransitionItem | UpdateLifecycleTransitionItem[];
  7593. interface UpdateLifecycleParams {
  7594. updatedSeries?: SeriesModel[];
  7595. /**
  7596. * If this update is from setOption and option is changed.
  7597. */
  7598. optionChanged?: boolean;
  7599. seriesTransition?: UpdateLifecycleTransitionOpt;
  7600. }
  7601. interface LifecycleEvents {
  7602. 'afterinit': [EChartsType];
  7603. 'series:beforeupdate': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
  7604. 'series:layoutlabels': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
  7605. 'series:transition': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
  7606. 'series:afterupdate': [GlobalModel, ExtensionAPI, UpdateLifecycleParams];
  7607. 'afterupdate': [GlobalModel, ExtensionAPI];
  7608. }
  7609. declare class GeoJSONResource implements GeoResource {
  7610. readonly type = "geoJSON";
  7611. private _geoJSON;
  7612. private _specialAreas;
  7613. private _mapName;
  7614. private _parsedMap;
  7615. constructor(mapName: string, geoJSON: GeoJSONSourceInput, specialAreas: GeoSpecialAreas);
  7616. /**
  7617. * @param nameMap can be null/undefined
  7618. * @param nameProperty can be null/undefined
  7619. */
  7620. load(nameMap: NameMap, nameProperty: string): {
  7621. regions: GeoJSONRegion[];
  7622. boundingRect: BoundingRect;
  7623. regionsMap: HashMap<GeoJSONRegion, string | number>;
  7624. };
  7625. private _parseToRegions;
  7626. /**
  7627. * Only for exporting to users.
  7628. * **MUST NOT** used internally.
  7629. */
  7630. getMapForUser(): {
  7631. geoJson: GeoJSON | GeoJSONCompressed;
  7632. geoJSON: GeoJSON | GeoJSONCompressed;
  7633. specialAreas: GeoSpecialAreas;
  7634. };
  7635. }
  7636. declare type MapInput = GeoJSONMapInput | SVGMapInput;
  7637. interface GeoJSONMapInput {
  7638. geoJSON: GeoJSONSourceInput;
  7639. specialAreas: GeoSpecialAreas;
  7640. }
  7641. interface SVGMapInput {
  7642. svg: GeoSVGSourceInput;
  7643. }
  7644. declare const _default$1: {
  7645. /**
  7646. * Compatible with previous `echarts.registerMap`.
  7647. *
  7648. * @usage
  7649. * ```js
  7650. *
  7651. * echarts.registerMap('USA', geoJson, specialAreas);
  7652. *
  7653. * echarts.registerMap('USA', {
  7654. * geoJson: geoJson,
  7655. * specialAreas: {...}
  7656. * });
  7657. * echarts.registerMap('USA', {
  7658. * geoJSON: geoJson,
  7659. * specialAreas: {...}
  7660. * });
  7661. *
  7662. * echarts.registerMap('airport', {
  7663. * svg: svg
  7664. * }
  7665. * ```
  7666. *
  7667. * Note:
  7668. * Do not support that register multiple geoJSON or SVG
  7669. * one map name. Because different geoJSON and SVG have
  7670. * different unit. It's not easy to make sure how those
  7671. * units are mapping/normalize.
  7672. * If intending to use multiple geoJSON or SVG, we can
  7673. * use multiple geo coordinate system.
  7674. */
  7675. registerMap: (mapName: string, rawDef: MapInput | GeoJSONSourceInput, rawSpecialAreas?: GeoSpecialAreas) => void;
  7676. getGeoResource(mapName: string): GeoResource;
  7677. /**
  7678. * Only for exporting to users.
  7679. * **MUST NOT** used internally.
  7680. */
  7681. getMapForUser: (mapName: string) => ReturnType<GeoJSONResource['getMapForUser']>;
  7682. load: (mapName: string, nameMap: NameMap, nameProperty: string) => ReturnType<GeoResource['load']>;
  7683. };
  7684. declare type ModelFinder$1 = ModelFinder;
  7685. declare const version$1 = "5.4.2";
  7686. declare const dependencies: {
  7687. zrender: string;
  7688. };
  7689. declare const PRIORITY: {
  7690. PROCESSOR: {
  7691. FILTER: number;
  7692. SERIES_FILTER: number;
  7693. STATISTIC: number;
  7694. };
  7695. VISUAL: {
  7696. LAYOUT: number;
  7697. PROGRESSIVE_LAYOUT: number;
  7698. GLOBAL: number;
  7699. CHART: number;
  7700. POST_CHART_LAYOUT: number;
  7701. COMPONENT: number;
  7702. BRUSH: number;
  7703. CHART_ITEM: number;
  7704. ARIA: number;
  7705. DECAL: number;
  7706. };
  7707. };
  7708. declare const IN_MAIN_PROCESS_KEY: "__flagInMainProcess";
  7709. declare const PENDING_UPDATE: "__pendingUpdate";
  7710. declare const STATUS_NEEDS_UPDATE_KEY: "__needsUpdateStatus";
  7711. declare const CONNECT_STATUS_KEY: "__connectUpdateStatus";
  7712. declare type SetOptionTransitionOpt = UpdateLifecycleTransitionOpt;
  7713. declare type SetOptionTransitionOptItem = UpdateLifecycleTransitionItem;
  7714. interface SetOptionOpts {
  7715. notMerge?: boolean;
  7716. lazyUpdate?: boolean;
  7717. silent?: boolean;
  7718. replaceMerge?: GlobalModelSetOptionOpts['replaceMerge'];
  7719. transition?: SetOptionTransitionOpt;
  7720. }
  7721. interface ResizeOpts {
  7722. width?: number | 'auto';
  7723. height?: number | 'auto';
  7724. animation?: AnimationOption$1;
  7725. silent?: boolean;
  7726. }
  7727. interface PostIniter {
  7728. (chart: EChartsType): void;
  7729. }
  7730. declare type RenderedEventParam = {
  7731. elapsedTime: number;
  7732. };
  7733. declare type ECEventDefinition = {
  7734. [key in ZRElementEventName]: EventCallbackSingleParam<ECElementEvent>;
  7735. } & {
  7736. rendered: EventCallbackSingleParam<RenderedEventParam>;
  7737. finished: () => void | boolean;
  7738. } & {
  7739. [key: string]: (...args: unknown[]) => void | boolean;
  7740. };
  7741. declare type EChartsInitOpts = {
  7742. locale?: string | LocaleOption;
  7743. renderer?: RendererType;
  7744. devicePixelRatio?: number;
  7745. useDirtyRect?: boolean;
  7746. useCoarsePointer?: boolean;
  7747. pointerSize?: number;
  7748. ssr?: boolean;
  7749. width?: number | string;
  7750. height?: number | string;
  7751. };
  7752. declare class ECharts extends Eventful<ECEventDefinition> {
  7753. /**
  7754. * @readonly
  7755. */
  7756. id: string;
  7757. /**
  7758. * Group id
  7759. * @readonly
  7760. */
  7761. group: string;
  7762. private _ssr;
  7763. private _zr;
  7764. private _dom;
  7765. private _model;
  7766. private _throttledZrFlush;
  7767. private _theme;
  7768. private _locale;
  7769. private _chartsViews;
  7770. private _chartsMap;
  7771. private _componentsViews;
  7772. private _componentsMap;
  7773. private _coordSysMgr;
  7774. private _api;
  7775. private _scheduler;
  7776. private _messageCenter;
  7777. private _pendingActions;
  7778. protected _$eventProcessor: never;
  7779. private _disposed;
  7780. private _loadingFX;
  7781. private [PENDING_UPDATE];
  7782. private [IN_MAIN_PROCESS_KEY];
  7783. private [CONNECT_STATUS_KEY];
  7784. private [STATUS_NEEDS_UPDATE_KEY];
  7785. constructor(dom: HTMLElement, theme?: string | ThemeOption, opts?: EChartsInitOpts);
  7786. private _onframe;
  7787. getDom(): HTMLElement;
  7788. getId(): string;
  7789. getZr(): ZRenderType;
  7790. isSSR(): boolean;
  7791. /**
  7792. * Usage:
  7793. * chart.setOption(option, notMerge, lazyUpdate);
  7794. * chart.setOption(option, {
  7795. * notMerge: ...,
  7796. * lazyUpdate: ...,
  7797. * silent: ...
  7798. * });
  7799. *
  7800. * @param opts opts or notMerge.
  7801. * @param opts.notMerge Default `false`.
  7802. * @param opts.lazyUpdate Default `false`. Useful when setOption frequently.
  7803. * @param opts.silent Default `false`.
  7804. * @param opts.replaceMerge Default undefined.
  7805. */
  7806. setOption<Opt extends ECBasicOption>(option: Opt, notMerge?: boolean, lazyUpdate?: boolean): void;
  7807. setOption<Opt extends ECBasicOption>(option: Opt, opts?: SetOptionOpts): void;
  7808. /**
  7809. * @deprecated
  7810. */
  7811. private setTheme;
  7812. private getModel;
  7813. getOption(): ECBasicOption;
  7814. getWidth(): number;
  7815. getHeight(): number;
  7816. getDevicePixelRatio(): number;
  7817. /**
  7818. * Get canvas which has all thing rendered
  7819. * @deprecated Use renderToCanvas instead.
  7820. */
  7821. getRenderedCanvas(opts?: any): HTMLCanvasElement;
  7822. renderToCanvas(opts?: {
  7823. backgroundColor?: ZRColor;
  7824. pixelRatio?: number;
  7825. }): HTMLCanvasElement;
  7826. renderToSVGString(opts?: {
  7827. useViewBox?: boolean;
  7828. }): string;
  7829. /**
  7830. * Get svg data url
  7831. */
  7832. getSvgDataURL(): string;
  7833. getDataURL(opts?: {
  7834. type?: 'png' | 'jpeg' | 'svg';
  7835. pixelRatio?: number;
  7836. backgroundColor?: ZRColor;
  7837. excludeComponents?: ComponentMainType[];
  7838. }): string;
  7839. getConnectedDataURL(opts?: {
  7840. type?: 'png' | 'jpeg' | 'svg';
  7841. pixelRatio?: number;
  7842. backgroundColor?: ZRColor;
  7843. connectedBackgroundColor?: ZRColor;
  7844. excludeComponents?: string[];
  7845. }): string;
  7846. /**
  7847. * Convert from logical coordinate system to pixel coordinate system.
  7848. * See CoordinateSystem#convertToPixel.
  7849. */
  7850. convertToPixel(finder: ModelFinder$1, value: ScaleDataValue): number;
  7851. convertToPixel(finder: ModelFinder$1, value: ScaleDataValue[]): number[];
  7852. /**
  7853. * Convert from pixel coordinate system to logical coordinate system.
  7854. * See CoordinateSystem#convertFromPixel.
  7855. */
  7856. convertFromPixel(finder: ModelFinder$1, value: number): number;
  7857. convertFromPixel(finder: ModelFinder$1, value: number[]): number[];
  7858. /**
  7859. * Is the specified coordinate systems or components contain the given pixel point.
  7860. * @param {Array|number} value
  7861. * @return {boolean} result
  7862. */
  7863. containPixel(finder: ModelFinder$1, value: number[]): boolean;
  7864. /**
  7865. * Get visual from series or data.
  7866. * @param finder
  7867. * If string, e.g., 'series', means {seriesIndex: 0}.
  7868. * If Object, could contain some of these properties below:
  7869. * {
  7870. * seriesIndex / seriesId / seriesName,
  7871. * dataIndex / dataIndexInside
  7872. * }
  7873. * If dataIndex is not specified, series visual will be fetched,
  7874. * but not data item visual.
  7875. * If all of seriesIndex, seriesId, seriesName are not specified,
  7876. * visual will be fetched from first series.
  7877. * @param visualType 'color', 'symbol', 'symbolSize'
  7878. */
  7879. getVisual(finder: ModelFinder$1, visualType: string): string | number | number[] | PatternObject | LinearGradientObject | RadialGradientObject;
  7880. /**
  7881. * Get view of corresponding component model
  7882. */
  7883. private getViewOfComponentModel;
  7884. /**
  7885. * Get view of corresponding series model
  7886. */
  7887. private getViewOfSeriesModel;
  7888. private _initEvents;
  7889. isDisposed(): boolean;
  7890. clear(): void;
  7891. dispose(): void;
  7892. /**
  7893. * Resize the chart
  7894. */
  7895. resize(opts?: ResizeOpts): void;
  7896. /**
  7897. * Show loading effect
  7898. * @param name 'default' by default
  7899. * @param cfg cfg of registered loading effect
  7900. */
  7901. showLoading(cfg?: object): void;
  7902. showLoading(name?: string, cfg?: object): void;
  7903. /**
  7904. * Hide loading effect
  7905. */
  7906. hideLoading(): void;
  7907. makeActionFromEvent(eventObj: ECActionEvent): Payload;
  7908. /**
  7909. * @param opt If pass boolean, means opt.silent
  7910. * @param opt.silent Default `false`. Whether trigger events.
  7911. * @param opt.flush Default `undefined`.
  7912. * true: Flush immediately, and then pixel in canvas can be fetched
  7913. * immediately. Caution: it might affect performance.
  7914. * false: Not flush.
  7915. * undefined: Auto decide whether perform flush.
  7916. */
  7917. dispatchAction(payload: Payload, opt?: boolean | {
  7918. silent?: boolean;
  7919. flush?: boolean | undefined;
  7920. }): void;
  7921. updateLabelLayout(): void;
  7922. appendData(params: {
  7923. seriesIndex: number;
  7924. data: any;
  7925. }): void;
  7926. private static internalField;
  7927. }
  7928. /**
  7929. * @param opts.devicePixelRatio Use window.devicePixelRatio by default
  7930. * @param opts.renderer Can choose 'canvas' or 'svg' to render the chart.
  7931. * @param opts.width Use clientWidth of the input `dom` by default.
  7932. * Can be 'auto' (the same as null/undefined)
  7933. * @param opts.height Use clientHeight of the input `dom` by default.
  7934. * Can be 'auto' (the same as null/undefined)
  7935. * @param opts.locale Specify the locale.
  7936. * @param opts.useDirtyRect Enable dirty rectangle rendering or not.
  7937. */
  7938. declare function init$1(dom: HTMLElement, theme?: string | object, opts?: EChartsInitOpts): EChartsType;
  7939. /**
  7940. * @usage
  7941. * (A)
  7942. * ```js
  7943. * let chart1 = echarts.init(dom1);
  7944. * let chart2 = echarts.init(dom2);
  7945. * chart1.group = 'xxx';
  7946. * chart2.group = 'xxx';
  7947. * echarts.connect('xxx');
  7948. * ```
  7949. * (B)
  7950. * ```js
  7951. * let chart1 = echarts.init(dom1);
  7952. * let chart2 = echarts.init(dom2);
  7953. * echarts.connect('xxx', [chart1, chart2]);
  7954. * ```
  7955. */
  7956. declare function connect(groupId: string | EChartsType[]): string;
  7957. /**
  7958. * @deprecated
  7959. */
  7960. declare function disConnect(groupId: string): void;
  7961. /**
  7962. * Alias and backward compatibility
  7963. */
  7964. declare const disconnect: typeof disConnect;
  7965. /**
  7966. * Dispose a chart instance
  7967. */
  7968. declare function dispose$1(chart: EChartsType | HTMLElement | string): void;
  7969. declare function getInstanceByDom(dom: HTMLElement): EChartsType | undefined;
  7970. declare function getInstanceById(key: string): EChartsType | undefined;
  7971. /**
  7972. * Register theme
  7973. */
  7974. declare function registerTheme(name: string, theme: ThemeOption): void;
  7975. /**
  7976. * Register option preprocessor
  7977. */
  7978. declare function registerPreprocessor(preprocessorFunc: OptionPreprocessor): void;
  7979. declare function registerProcessor(priority: number | StageHandler | StageHandlerOverallReset, processor?: StageHandler | StageHandlerOverallReset): void;
  7980. /**
  7981. * Register postIniter
  7982. * @param {Function} postInitFunc
  7983. */
  7984. declare function registerPostInit(postInitFunc: PostIniter): void;
  7985. /**
  7986. * Register postUpdater
  7987. * @param {Function} postUpdateFunc
  7988. */
  7989. declare function registerPostUpdate(postUpdateFunc: PostUpdater): void;
  7990. declare function registerUpdateLifecycle<T extends keyof LifecycleEvents>(name: T, cb: (...args: LifecycleEvents[T]) => void): void;
  7991. /**
  7992. * @usage
  7993. * registerAction('someAction', 'someEvent', function () { ... });
  7994. * registerAction('someAction', function () { ... });
  7995. * registerAction(
  7996. * {type: 'someAction', event: 'someEvent', update: 'updateView'},
  7997. * function () { ... }
  7998. * );
  7999. *
  8000. * @param {(string|Object)} actionInfo
  8001. * @param {string} actionInfo.type
  8002. * @param {string} [actionInfo.event]
  8003. * @param {string} [actionInfo.update]
  8004. * @param {string} [eventName]
  8005. * @param {Function} action
  8006. */
  8007. declare function registerAction(type: string, eventName: string, action: ActionHandler): void;
  8008. declare function registerAction(type: string, action: ActionHandler): void;
  8009. declare function registerAction(actionInfo: ActionInfo, action: ActionHandler): void;
  8010. declare function registerCoordinateSystem(type: string, coordSysCreator: CoordinateSystemCreator): void;
  8011. /**
  8012. * Get dimensions of specified coordinate system.
  8013. * @param {string} type
  8014. * @return {Array.<string|Object>}
  8015. */
  8016. declare function getCoordinateSystemDimensions(type: string): DimensionDefinitionLoose[];
  8017. /**
  8018. * Layout is a special stage of visual encoding
  8019. * Most visual encoding like color are common for different chart
  8020. * But each chart has it's own layout algorithm
  8021. */
  8022. declare function registerLayout(priority: number, layoutTask: StageHandler | StageHandlerOverallReset): void;
  8023. declare function registerLayout(layoutTask: StageHandler | StageHandlerOverallReset): void;
  8024. declare function registerVisual(priority: number, layoutTask: StageHandler | StageHandlerOverallReset): void;
  8025. declare function registerVisual(layoutTask: StageHandler | StageHandlerOverallReset): void;
  8026. declare function registerLoading(name: string, loadingFx: LoadingEffectCreator): void;
  8027. /**
  8028. * ZRender need a canvas context to do measureText.
  8029. * But in node environment canvas may be created by node-canvas.
  8030. * So we need to specify how to create a canvas instead of using document.createElement('canvas')
  8031. *
  8032. *
  8033. * @deprecated use setPlatformAPI({ createCanvas }) instead.
  8034. *
  8035. * @example
  8036. * let Canvas = require('canvas');
  8037. * let echarts = require('echarts');
  8038. * echarts.setCanvasCreator(function () {
  8039. * // Small size is enough.
  8040. * return new Canvas(32, 32);
  8041. * });
  8042. */
  8043. declare function setCanvasCreator(creator: () => HTMLCanvasElement): void;
  8044. declare type RegisterMapParams = Parameters<typeof _default$1.registerMap>;
  8045. /**
  8046. * The parameters and usage: see `geoSourceManager.registerMap`.
  8047. * Compatible with previous `echarts.registerMap`.
  8048. */
  8049. declare function registerMap(mapName: RegisterMapParams[0], geoJson: RegisterMapParams[1], specialAreas?: RegisterMapParams[2]): void;
  8050. declare function getMap(mapName: string): any;
  8051. declare const registerTransform: typeof registerExternalTransform;
  8052. declare const dataTool: {};
  8053. interface EChartsType extends ECharts {
  8054. }
  8055. declare function parse(colorStr: string, rgbaArr?: number[]): number[];
  8056. declare function lift(color: string, level: number): string;
  8057. declare function toHex(color: string): string;
  8058. declare function fastLerp(normalizedValue: number, colors: number[][], out?: number[]): number[];
  8059. declare const fastMapToColor: typeof fastLerp;
  8060. declare type LerpFullOutput = {
  8061. color: string;
  8062. leftIndex: number;
  8063. rightIndex: number;
  8064. value: number;
  8065. };
  8066. declare function lerp$1(normalizedValue: number, colors: string[], fullOutput: boolean): LerpFullOutput;
  8067. declare function lerp$1(normalizedValue: number, colors: string[]): string;
  8068. declare const mapToColor: typeof lerp$1;
  8069. declare function modifyHSL(color: string, h?: number, s?: number, l?: number): string;
  8070. declare function modifyAlpha(color: string, alpha?: number): string;
  8071. declare function stringify(arrColor: number[], type: string): string;
  8072. declare function lum(color: string, backgroundLum: number): number;
  8073. declare function random(): string;
  8074. declare const color_d_parse: typeof parse;
  8075. declare const color_d_lift: typeof lift;
  8076. declare const color_d_toHex: typeof toHex;
  8077. declare const color_d_fastLerp: typeof fastLerp;
  8078. declare const color_d_fastMapToColor: typeof fastMapToColor;
  8079. declare const color_d_mapToColor: typeof mapToColor;
  8080. declare const color_d_modifyHSL: typeof modifyHSL;
  8081. declare const color_d_modifyAlpha: typeof modifyAlpha;
  8082. declare const color_d_stringify: typeof stringify;
  8083. declare const color_d_lum: typeof lum;
  8084. declare const color_d_random: typeof random;
  8085. declare namespace color_d {
  8086. export {
  8087. color_d_parse as parse,
  8088. color_d_lift as lift,
  8089. color_d_toHex as toHex,
  8090. color_d_fastLerp as fastLerp,
  8091. color_d_fastMapToColor as fastMapToColor,
  8092. lerp$1 as lerp,
  8093. color_d_mapToColor as mapToColor,
  8094. color_d_modifyHSL as modifyHSL,
  8095. color_d_modifyAlpha as modifyAlpha,
  8096. color_d_stringify as stringify,
  8097. color_d_lum as lum,
  8098. color_d_random as random,
  8099. };
  8100. }
  8101. declare type ThrottleFunction = (this: unknown, ...args: unknown[]) => void;
  8102. interface ThrottleController {
  8103. clear(): void;
  8104. debounceNextCall(debounceDelay: number): void;
  8105. }
  8106. /**
  8107. * @public
  8108. * @param {(Function)} fn
  8109. * @param {number} [delay=0] Unit: ms.
  8110. * @param {boolean} [debounce=false]
  8111. * true: If call interval less than `delay`, only the last call works.
  8112. * false: If call interval less than `delay, call works on fixed rate.
  8113. * @return {(Function)} throttled fn.
  8114. */
  8115. declare function throttle<T extends ThrottleFunction>(fn: T, delay?: number, debounce?: boolean): T & ThrottleController;
  8116. declare type EnableDataStackDimensionsInput = {
  8117. schema: SeriesDataSchema;
  8118. store?: DataStore;
  8119. };
  8120. declare type EnableDataStackDimensionsInputLegacy = (SeriesDimensionDefine | string)[];
  8121. /**
  8122. * Note that it is too complicated to support 3d stack by value
  8123. * (have to create two-dimension inverted index), so in 3d case
  8124. * we just support that stacked by index.
  8125. *
  8126. * @param seriesModel
  8127. * @param dimensionsInput The same as the input of <module:echarts/data/SeriesData>.
  8128. * The input will be modified.
  8129. * @param opt
  8130. * @param opt.stackedCoordDimension Specify a coord dimension if needed.
  8131. * @param opt.byIndex=false
  8132. * @return calculationInfo
  8133. * {
  8134. * stackedDimension: string
  8135. * stackedByDimension: string
  8136. * isStackedByIndex: boolean
  8137. * stackedOverDimension: string
  8138. * stackResultDimension: string
  8139. * }
  8140. */
  8141. declare function enableDataStack(seriesModel: SeriesModel<SeriesOption & SeriesStackOptionMixin>, dimensionsInput: EnableDataStackDimensionsInput | EnableDataStackDimensionsInputLegacy, opt?: {
  8142. stackedCoordDimension?: string;
  8143. byIndex?: boolean;
  8144. }): Pick<DataCalculationInfo<unknown>, 'stackedDimension' | 'stackedByDimension' | 'isStackedByIndex' | 'stackedOverDimension' | 'stackResultDimension'>;
  8145. declare function isDimensionStacked(data: SeriesData, stackedDim: string): boolean;
  8146. declare function getStackedDimension(data: SeriesData, targetDim: string): DimensionName;
  8147. /**
  8148. * ECData stored on graphic element
  8149. */
  8150. interface ECData {
  8151. dataIndex?: number;
  8152. dataModel?: DataModel;
  8153. eventData?: ECEventData;
  8154. seriesIndex?: number;
  8155. dataType?: SeriesDataType;
  8156. focus?: InnerFocus;
  8157. blurScope?: BlurScope;
  8158. componentMainType?: ComponentMainType;
  8159. componentIndex?: number;
  8160. componentHighDownName?: string;
  8161. tooltipConfig?: {
  8162. name: string;
  8163. option: ComponentItemTooltipOption<unknown>;
  8164. };
  8165. }
  8166. declare const getECData: (hostObj: Element<ElementProps>) => ECData;
  8167. interface CoordDimensionDefinition extends DimensionDefinition {
  8168. dimsDef?: (DimensionName | {
  8169. name: DimensionName;
  8170. defaultTooltip?: boolean;
  8171. })[];
  8172. otherDims?: DataVisualDimensions;
  8173. ordinalMeta?: OrdinalMeta;
  8174. coordDim?: DimensionName;
  8175. coordDimIndex?: DimensionIndex;
  8176. }
  8177. declare type CoordDimensionDefinitionLoose = CoordDimensionDefinition['name'] | CoordDimensionDefinition;
  8178. declare type PrepareSeriesDataSchemaParams = {
  8179. coordDimensions?: CoordDimensionDefinitionLoose[];
  8180. /**
  8181. * Will use `source.dimensionsDefine` if not given.
  8182. */
  8183. dimensionsDefine?: DimensionDefinitionLoose[];
  8184. /**
  8185. * Will use `source.encodeDefine` if not given.
  8186. */
  8187. encodeDefine?: HashMap<OptionEncodeValue, DimensionName> | OptionEncode;
  8188. dimensionsCount?: number;
  8189. /**
  8190. * Make default encode if user not specified.
  8191. */
  8192. encodeDefaulter?: EncodeDefaulter;
  8193. generateCoord?: string;
  8194. generateCoordCount?: number;
  8195. /**
  8196. * If be able to omit unused dimension
  8197. * Used to improve the performance on high dimension data.
  8198. */
  8199. canOmitUnusedDimensions?: boolean;
  8200. };
  8201. /**
  8202. * For outside usage compat (like echarts-gl are using it).
  8203. */
  8204. declare function createDimensions(source: Source | OptionSourceData, opt?: PrepareSeriesDataSchemaParams): SeriesDimensionDefine[];
  8205. /**
  8206. * Enable the function that mouseover will trigger the emphasis state.
  8207. *
  8208. * NOTE:
  8209. * This function should be used on the element with dataIndex, seriesIndex.
  8210. *
  8211. */
  8212. declare function enableHoverEmphasis(el: Element, focus?: InnerFocus, blurScope?: BlurScope): void;
  8213. /**
  8214. * Create a multi dimension List structure from seriesModel.
  8215. */
  8216. declare function createList(seriesModel: SeriesModel): SeriesData<Model<any>, DefaultDataVisual>;
  8217. declare const dataStack: {
  8218. isDimensionStacked: typeof isDimensionStacked;
  8219. enableDataStack: typeof enableDataStack;
  8220. getStackedDimension: typeof getStackedDimension;
  8221. };
  8222. /**
  8223. * Create scale
  8224. * @param {Array.<number>} dataExtent
  8225. * @param {Object|module:echarts/Model} option If `optoin.type`
  8226. * is secified, it can only be `'value'` currently.
  8227. */
  8228. declare function createScale(dataExtent: number[], option: object | AxisBaseModel): Scale<Dictionary<unknown>>;
  8229. /**
  8230. * Mixin common methods to axis model,
  8231. *
  8232. * Include methods
  8233. * `getFormattedLabels() => Array.<string>`
  8234. * `getCategories() => Array.<string>`
  8235. * `getMin(origin: boolean) => number`
  8236. * `getMax(origin: boolean) => number`
  8237. * `getNeedCrossZero() => boolean`
  8238. */
  8239. declare function mixinAxisModelCommonMethods(Model: Model): void;
  8240. declare function createTextStyle(textStyleModel: Model<TextCommonOption>, opts?: {
  8241. state?: DisplayState;
  8242. }): TextStyleProps;
  8243. declare const helper_d_getLayoutRect: typeof getLayoutRect;
  8244. declare const helper_d_getECData: typeof getECData;
  8245. declare const helper_d_createList: typeof createList;
  8246. declare const helper_d_dataStack: typeof dataStack;
  8247. declare const helper_d_createScale: typeof createScale;
  8248. declare const helper_d_mixinAxisModelCommonMethods: typeof mixinAxisModelCommonMethods;
  8249. declare const helper_d_createTextStyle: typeof createTextStyle;
  8250. declare const helper_d_createDimensions: typeof createDimensions;
  8251. declare const helper_d_createSymbol: typeof createSymbol;
  8252. declare const helper_d_enableHoverEmphasis: typeof enableHoverEmphasis;
  8253. declare namespace helper_d {
  8254. export {
  8255. helper_d_getLayoutRect as getLayoutRect,
  8256. helper_d_getECData as getECData,
  8257. helper_d_createList as createList,
  8258. helper_d_dataStack as dataStack,
  8259. helper_d_createScale as createScale,
  8260. helper_d_mixinAxisModelCommonMethods as mixinAxisModelCommonMethods,
  8261. helper_d_createTextStyle as createTextStyle,
  8262. helper_d_createDimensions as createDimensions,
  8263. helper_d_createSymbol as createSymbol,
  8264. helper_d_enableHoverEmphasis as enableHoverEmphasis,
  8265. };
  8266. }
  8267. interface Platform {
  8268. createCanvas(): HTMLCanvasElement;
  8269. measureText(text: string, font?: string): {
  8270. width: number;
  8271. };
  8272. loadImage(src: string, onload: () => void | HTMLImageElement['onload'], onerror: () => void | HTMLImageElement['onerror']): HTMLImageElement;
  8273. }
  8274. declare function setPlatformAPI(newPlatformApis: Partial<Platform>): void;
  8275. declare function parseGeoJSON(geoJson: GeoJSON | GeoJSONCompressed, nameProperty: string): GeoJSONRegion[];
  8276. /**
  8277. * Linear mapping a value from domain to range
  8278. * @param val
  8279. * @param domain Domain extent domain[0] can be bigger than domain[1]
  8280. * @param range Range extent range[0] can be bigger than range[1]
  8281. * @param clamp Default to be false
  8282. */
  8283. declare function linearMap(val: number, domain: number[], range: number[], clamp?: boolean): number;
  8284. /**
  8285. * (1) Fix rounding error of float numbers.
  8286. * (2) Support return string to avoid scientific notation like '3.5e-7'.
  8287. */
  8288. declare function round(x: number | string, precision?: number): number;
  8289. declare function round(x: number | string, precision: number, returnStr: false): number;
  8290. declare function round(x: number | string, precision: number, returnStr: true): string;
  8291. /**
  8292. * Inplacd asc sort arr.
  8293. * The input arr will be modified.
  8294. */
  8295. declare function asc<T extends number[]>(arr: T): T;
  8296. /**
  8297. * Get precision.
  8298. */
  8299. declare function getPrecision(val: string | number): number;
  8300. /**
  8301. * Get precision with slow but safe method
  8302. */
  8303. declare function getPrecisionSafe(val: string | number): number;
  8304. /**
  8305. * Minimal dicernible data precisioin according to a single pixel.
  8306. */
  8307. declare function getPixelPrecision(dataExtent: [number, number], pixelExtent: [number, number]): number;
  8308. /**
  8309. * Get a data of given precision, assuring the sum of percentages
  8310. * in valueList is 1.
  8311. * The largest remainder method is used.
  8312. * https://en.wikipedia.org/wiki/Largest_remainder_method
  8313. *
  8314. * @param valueList a list of all data
  8315. * @param idx index of the data to be processed in valueList
  8316. * @param precision integer number showing digits of precision
  8317. * @return percent ranging from 0 to 100
  8318. */
  8319. declare function getPercentWithPrecision(valueList: number[], idx: number, precision: number): number;
  8320. declare const MAX_SAFE_INTEGER = 9007199254740991;
  8321. /**
  8322. * To 0 - 2 * PI, considering negative radian.
  8323. */
  8324. declare function remRadian(radian: number): number;
  8325. /**
  8326. * @param {type} radian
  8327. * @return {boolean}
  8328. */
  8329. declare function isRadianAroundZero(val: number): boolean;
  8330. /**
  8331. * @param value valid type: number | string | Date, otherwise return `new Date(NaN)`
  8332. * These values can be accepted:
  8333. * + An instance of Date, represent a time in its own time zone.
  8334. * + Or string in a subset of ISO 8601, only including:
  8335. * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06',
  8336. * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123',
  8337. * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00',
  8338. * all of which will be treated as local time if time zone is not specified
  8339. * (see <https://momentjs.com/>).
  8340. * + Or other string format, including (all of which will be treated as local time):
  8341. * '2012', '2012-3-1', '2012/3/1', '2012/03/01',
  8342. * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123'
  8343. * + a timestamp, which represent a time in UTC.
  8344. * @return date Never be null/undefined. If invalid, return `new Date(NaN)`.
  8345. */
  8346. declare function parseDate(value: unknown): Date;
  8347. /**
  8348. * Quantity of a number. e.g. 0.1, 1, 10, 100
  8349. *
  8350. * @param val
  8351. * @return
  8352. */
  8353. declare function quantity(val: number): number;
  8354. /**
  8355. * Exponent of the quantity of a number
  8356. * e.g., 1234 equals to 1.234*10^3, so quantityExponent(1234) is 3
  8357. *
  8358. * @param val non-negative value
  8359. * @return
  8360. */
  8361. declare function quantityExponent(val: number): number;
  8362. /**
  8363. * find a “nice” number approximately equal to x. Round the number if round = true,
  8364. * take ceiling if round = false. The primary observation is that the “nicest”
  8365. * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.
  8366. *
  8367. * See "Nice Numbers for Graph Labels" of Graphic Gems.
  8368. *
  8369. * @param val Non-negative value.
  8370. * @param round
  8371. * @return Niced number
  8372. */
  8373. declare function nice(val: number, round?: boolean): number;
  8374. /**
  8375. * This code was copied from "d3.js"
  8376. * <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/arrays/quantile.js>.
  8377. * See the license statement at the head of this file.
  8378. * @param ascArr
  8379. */
  8380. declare function quantile(ascArr: number[], p: number): number;
  8381. declare type IntervalItem = {
  8382. interval: [number, number];
  8383. close: [0 | 1, 0 | 1];
  8384. };
  8385. /**
  8386. * Order intervals asc, and split them when overlap.
  8387. * expect(numberUtil.reformIntervals([
  8388. * {interval: [18, 62], close: [1, 1]},
  8389. * {interval: [-Infinity, -70], close: [0, 0]},
  8390. * {interval: [-70, -26], close: [1, 1]},
  8391. * {interval: [-26, 18], close: [1, 1]},
  8392. * {interval: [62, 150], close: [1, 1]},
  8393. * {interval: [106, 150], close: [1, 1]},
  8394. * {interval: [150, Infinity], close: [0, 0]}
  8395. * ])).toEqual([
  8396. * {interval: [-Infinity, -70], close: [0, 0]},
  8397. * {interval: [-70, -26], close: [1, 1]},
  8398. * {interval: [-26, 18], close: [0, 1]},
  8399. * {interval: [18, 62], close: [0, 1]},
  8400. * {interval: [62, 150], close: [0, 1]},
  8401. * {interval: [150, Infinity], close: [0, 0]}
  8402. * ]);
  8403. * @param list, where `close` mean open or close
  8404. * of the interval, and Infinity can be used.
  8405. * @return The origin list, which has been reformed.
  8406. */
  8407. declare function reformIntervals(list: IntervalItem[]): IntervalItem[];
  8408. /**
  8409. * [Numeric is defined as]:
  8410. * `parseFloat(val) == val`
  8411. * For example:
  8412. * numeric:
  8413. * typeof number except NaN, '-123', '123', '2e3', '-2e3', '011', 'Infinity', Infinity,
  8414. * and they rounded by white-spaces or line-terminal like ' -123 \n ' (see es spec)
  8415. * not-numeric:
  8416. * null, undefined, [], {}, true, false, 'NaN', NaN, '123ab',
  8417. * empty string, string with only white-spaces or line-terminal (see es spec),
  8418. * 0x12, '0x12', '-0x12', 012, '012', '-012',
  8419. * non-string, ...
  8420. *
  8421. * @test See full test cases in `test/ut/spec/util/number.js`.
  8422. * @return Must be a typeof number. If not numeric, return NaN.
  8423. */
  8424. declare function numericToNumber(val: unknown): number;
  8425. /**
  8426. * Definition of "numeric": see `numericToNumber`.
  8427. */
  8428. declare function isNumeric(val: unknown): val is number;
  8429. declare const number_d_linearMap: typeof linearMap;
  8430. declare const number_d_round: typeof round;
  8431. declare const number_d_asc: typeof asc;
  8432. declare const number_d_getPrecision: typeof getPrecision;
  8433. declare const number_d_getPrecisionSafe: typeof getPrecisionSafe;
  8434. declare const number_d_getPixelPrecision: typeof getPixelPrecision;
  8435. declare const number_d_getPercentWithPrecision: typeof getPercentWithPrecision;
  8436. declare const number_d_MAX_SAFE_INTEGER: typeof MAX_SAFE_INTEGER;
  8437. declare const number_d_remRadian: typeof remRadian;
  8438. declare const number_d_isRadianAroundZero: typeof isRadianAroundZero;
  8439. declare const number_d_parseDate: typeof parseDate;
  8440. declare const number_d_quantity: typeof quantity;
  8441. declare const number_d_quantityExponent: typeof quantityExponent;
  8442. declare const number_d_nice: typeof nice;
  8443. declare const number_d_quantile: typeof quantile;
  8444. declare const number_d_reformIntervals: typeof reformIntervals;
  8445. declare const number_d_isNumeric: typeof isNumeric;
  8446. declare const number_d_numericToNumber: typeof numericToNumber;
  8447. declare namespace number_d {
  8448. export {
  8449. number_d_linearMap as linearMap,
  8450. number_d_round as round,
  8451. number_d_asc as asc,
  8452. number_d_getPrecision as getPrecision,
  8453. number_d_getPrecisionSafe as getPrecisionSafe,
  8454. number_d_getPixelPrecision as getPixelPrecision,
  8455. number_d_getPercentWithPrecision as getPercentWithPrecision,
  8456. number_d_MAX_SAFE_INTEGER as MAX_SAFE_INTEGER,
  8457. number_d_remRadian as remRadian,
  8458. number_d_isRadianAroundZero as isRadianAroundZero,
  8459. number_d_parseDate as parseDate,
  8460. number_d_quantity as quantity,
  8461. number_d_quantityExponent as quantityExponent,
  8462. number_d_nice as nice,
  8463. number_d_quantile as quantile,
  8464. number_d_reformIntervals as reformIntervals,
  8465. number_d_isNumeric as isNumeric,
  8466. number_d_numericToNumber as numericToNumber,
  8467. };
  8468. }
  8469. declare function format(time: unknown, template: string, isUTC: boolean, lang?: string | Model<LocaleOption>): string;
  8470. declare const time_d_format: typeof format;
  8471. declare namespace time_d {
  8472. export {
  8473. parseDate as parse,
  8474. time_d_format as format,
  8475. };
  8476. }
  8477. declare const graphic_d_extendShape: typeof extendShape;
  8478. declare const graphic_d_extendPath: typeof extendPath;
  8479. declare const graphic_d_makePath: typeof makePath;
  8480. declare const graphic_d_makeImage: typeof makeImage;
  8481. declare const graphic_d_resizePath: typeof resizePath;
  8482. declare const graphic_d_createIcon: typeof createIcon;
  8483. declare const graphic_d_updateProps: typeof updateProps;
  8484. declare const graphic_d_initProps: typeof initProps;
  8485. declare const graphic_d_getTransform: typeof getTransform;
  8486. declare const graphic_d_clipPointsByRect: typeof clipPointsByRect;
  8487. declare const graphic_d_clipRectByRect: typeof clipRectByRect;
  8488. declare const graphic_d_registerShape: typeof registerShape;
  8489. declare const graphic_d_getShapeClass: typeof getShapeClass;
  8490. type graphic_d_Group = Group;
  8491. declare const graphic_d_Group: typeof Group;
  8492. type graphic_d_Circle = Circle;
  8493. declare const graphic_d_Circle: typeof Circle;
  8494. type graphic_d_Ellipse = Ellipse;
  8495. declare const graphic_d_Ellipse: typeof Ellipse;
  8496. type graphic_d_Sector = Sector;
  8497. declare const graphic_d_Sector: typeof Sector;
  8498. type graphic_d_Ring = Ring;
  8499. declare const graphic_d_Ring: typeof Ring;
  8500. type graphic_d_Polygon = Polygon;
  8501. declare const graphic_d_Polygon: typeof Polygon;
  8502. type graphic_d_Polyline = Polyline;
  8503. declare const graphic_d_Polyline: typeof Polyline;
  8504. type graphic_d_Rect = Rect;
  8505. declare const graphic_d_Rect: typeof Rect;
  8506. type graphic_d_Line = Line;
  8507. declare const graphic_d_Line: typeof Line;
  8508. type graphic_d_BezierCurve = BezierCurve;
  8509. declare const graphic_d_BezierCurve: typeof BezierCurve;
  8510. type graphic_d_Arc = Arc;
  8511. declare const graphic_d_Arc: typeof Arc;
  8512. type graphic_d_IncrementalDisplayable = IncrementalDisplayable;
  8513. declare const graphic_d_IncrementalDisplayable: typeof IncrementalDisplayable;
  8514. type graphic_d_CompoundPath = CompoundPath;
  8515. declare const graphic_d_CompoundPath: typeof CompoundPath;
  8516. type graphic_d_LinearGradient = LinearGradient;
  8517. declare const graphic_d_LinearGradient: typeof LinearGradient;
  8518. type graphic_d_RadialGradient = RadialGradient;
  8519. declare const graphic_d_RadialGradient: typeof RadialGradient;
  8520. type graphic_d_BoundingRect = BoundingRect;
  8521. declare const graphic_d_BoundingRect: typeof BoundingRect;
  8522. declare namespace graphic_d {
  8523. export {
  8524. graphic_d_extendShape as extendShape,
  8525. graphic_d_extendPath as extendPath,
  8526. graphic_d_makePath as makePath,
  8527. graphic_d_makeImage as makeImage,
  8528. mergePath$1 as mergePath,
  8529. graphic_d_resizePath as resizePath,
  8530. graphic_d_createIcon as createIcon,
  8531. graphic_d_updateProps as updateProps,
  8532. graphic_d_initProps as initProps,
  8533. graphic_d_getTransform as getTransform,
  8534. graphic_d_clipPointsByRect as clipPointsByRect,
  8535. graphic_d_clipRectByRect as clipRectByRect,
  8536. graphic_d_registerShape as registerShape,
  8537. graphic_d_getShapeClass as getShapeClass,
  8538. graphic_d_Group as Group,
  8539. ZRImage as Image,
  8540. ZRText as Text,
  8541. graphic_d_Circle as Circle,
  8542. graphic_d_Ellipse as Ellipse,
  8543. graphic_d_Sector as Sector,
  8544. graphic_d_Ring as Ring,
  8545. graphic_d_Polygon as Polygon,
  8546. graphic_d_Polyline as Polyline,
  8547. graphic_d_Rect as Rect,
  8548. graphic_d_Line as Line,
  8549. graphic_d_BezierCurve as BezierCurve,
  8550. graphic_d_Arc as Arc,
  8551. graphic_d_IncrementalDisplayable as IncrementalDisplayable,
  8552. graphic_d_CompoundPath as CompoundPath,
  8553. graphic_d_LinearGradient as LinearGradient,
  8554. graphic_d_RadialGradient as RadialGradient,
  8555. graphic_d_BoundingRect as BoundingRect,
  8556. };
  8557. }
  8558. declare const format_d_addCommas: typeof addCommas;
  8559. declare const format_d_toCamelCase: typeof toCamelCase;
  8560. declare const format_d_encodeHTML: typeof encodeHTML;
  8561. declare const format_d_formatTpl: typeof formatTpl;
  8562. declare const format_d_getTooltipMarker: typeof getTooltipMarker;
  8563. declare const format_d_formatTime: typeof formatTime;
  8564. declare const format_d_capitalFirst: typeof capitalFirst;
  8565. declare const format_d_truncateText: typeof truncateText;
  8566. declare const format_d_getTextRect: typeof getTextRect;
  8567. declare namespace format_d {
  8568. export {
  8569. format_d_addCommas as addCommas,
  8570. format_d_toCamelCase as toCamelCase,
  8571. normalizeCssArray$1 as normalizeCssArray,
  8572. format_d_encodeHTML as encodeHTML,
  8573. format_d_formatTpl as formatTpl,
  8574. format_d_getTooltipMarker as getTooltipMarker,
  8575. format_d_formatTime as formatTime,
  8576. format_d_capitalFirst as capitalFirst,
  8577. format_d_truncateText as truncateText,
  8578. format_d_getTextRect as getTextRect,
  8579. };
  8580. }
  8581. declare const util_d$1_map: typeof map;
  8582. declare const util_d$1_each: typeof each;
  8583. declare const util_d$1_indexOf: typeof indexOf;
  8584. declare const util_d$1_inherits: typeof inherits;
  8585. declare const util_d$1_reduce: typeof reduce;
  8586. declare const util_d$1_filter: typeof filter;
  8587. declare const util_d$1_bind: typeof bind;
  8588. declare const util_d$1_curry: typeof curry;
  8589. declare const util_d$1_isArray: typeof isArray;
  8590. declare const util_d$1_isString: typeof isString;
  8591. declare const util_d$1_isObject: typeof isObject;
  8592. declare const util_d$1_isFunction: typeof isFunction;
  8593. declare const util_d$1_extend: typeof extend;
  8594. declare const util_d$1_defaults: typeof defaults;
  8595. declare const util_d$1_merge: typeof merge;
  8596. declare namespace util_d$1 {
  8597. export {
  8598. util_d$1_map as map,
  8599. util_d$1_each as each,
  8600. util_d$1_indexOf as indexOf,
  8601. util_d$1_inherits as inherits,
  8602. util_d$1_reduce as reduce,
  8603. util_d$1_filter as filter,
  8604. util_d$1_bind as bind,
  8605. util_d$1_curry as curry,
  8606. util_d$1_isArray as isArray,
  8607. util_d$1_isString as isString,
  8608. util_d$1_isObject as isObject,
  8609. util_d$1_isFunction as isFunction,
  8610. util_d$1_extend as extend,
  8611. util_d$1_defaults as defaults,
  8612. clone$2 as clone,
  8613. util_d$1_merge as merge,
  8614. };
  8615. }
  8616. declare class Browser {
  8617. firefox: boolean;
  8618. ie: boolean;
  8619. edge: boolean;
  8620. newEdge: boolean;
  8621. weChat: boolean;
  8622. version: string | number;
  8623. }
  8624. declare class Env {
  8625. browser: Browser;
  8626. node: boolean;
  8627. wxa: boolean;
  8628. worker: boolean;
  8629. svgSupported: boolean;
  8630. touchEventsSupported: boolean;
  8631. pointerEventsSupported: boolean;
  8632. domSupported: boolean;
  8633. transformSupported: boolean;
  8634. transform3dSupported: boolean;
  8635. hasGlobalWindow: boolean;
  8636. }
  8637. declare const env: Env;
  8638. declare function brushSingle(ctx: CanvasRenderingContext2D, el: Displayable): void;
  8639. declare function extendComponentModel(proto: object): ComponentModel;
  8640. declare function extendComponentView(proto: object): ChartView;
  8641. declare function extendSeriesModel(proto: object): SeriesModel;
  8642. declare function extendChartView(proto: object): ChartView;
  8643. declare type ParallelLayoutDirection = 'horizontal' | 'vertical';
  8644. interface ParallelCoordinateSystemOption extends ComponentOption, BoxLayoutOptionMixin {
  8645. mainType?: 'parallel';
  8646. layout?: ParallelLayoutDirection;
  8647. axisExpandable?: boolean;
  8648. axisExpandCenter?: number;
  8649. axisExpandCount?: number;
  8650. axisExpandWidth?: number;
  8651. axisExpandTriggerOn?: 'click' | 'mousemove';
  8652. axisExpandRate?: number;
  8653. axisExpandDebounce?: number;
  8654. axisExpandSlideTriggerArea?: [number, number, number];
  8655. axisExpandWindow?: number[];
  8656. parallelAxisDefault?: ParallelAxisOption;
  8657. }
  8658. declare type ParallelAxisOption = AxisBaseOption & {
  8659. /**
  8660. * 0, 1, 2, ...
  8661. */
  8662. dim?: number | number[];
  8663. parallelIndex?: number;
  8664. areaSelectStyle?: {
  8665. width?: number;
  8666. borderWidth?: number;
  8667. borderColor?: ZRColor;
  8668. color?: ZRColor;
  8669. opacity?: number;
  8670. };
  8671. realtime?: boolean;
  8672. };
  8673. declare type Dependencies = {
  8674. grid: XAXisOption | YAXisOption | AxisPointerOption;
  8675. polar: AngleAxisOption | RadiusAxisOption;
  8676. parallel: ParallelAxisOption;
  8677. };
  8678. declare type DependenciesKeys = keyof Dependencies & string;
  8679. declare type Arrayable<T> = T | T[];
  8680. declare type GetMainType<OptionUnion extends ComponentOption> = Exclude<OptionUnion['mainType'], undefined>;
  8681. declare type ExtractComponentOption<OptionUnion, ExtractMainType> = OptionUnion extends {
  8682. mainType?: ExtractMainType;
  8683. } ? OptionUnion : never;
  8684. declare type GetDependency<DependencyOption extends ComponentOption> = {
  8685. [key in GetMainType<DependencyOption>]?: Arrayable<ExtractComponentOption<DependencyOption, key>>;
  8686. };
  8687. declare type GetDependencies<MainType extends string> = GetDependency<Dependencies[Extract<MainType, DependenciesKeys>]>;
  8688. declare type ComposeUnitOption<OptionUnion extends ComponentOption> = CheckMainType<GetMainType<OptionUnion>> & Omit<ECBasicOption, 'baseOption' | 'options'> & {
  8689. [key in GetMainType<OptionUnion>]?: Arrayable<ExtractComponentOption<OptionUnion, key>>;
  8690. } & GetDependencies<GetMainType<OptionUnion>>;
  8691. declare type CheckMainType<OptionUnionMainType extends string> = string extends OptionUnionMainType ? never : {};
  8692. declare type ComposeOption<OptionUnion extends ComponentOption> = ComposeUnitOption<OptionUnion> & {
  8693. baseOption?: ComposeUnitOption<OptionUnion>;
  8694. options?: ComposeUnitOption<OptionUnion>[];
  8695. };
  8696. interface RadarIndicatorOption {
  8697. name?: string;
  8698. /**
  8699. * @deprecated Use `name` instead.
  8700. */
  8701. text?: string;
  8702. min?: number;
  8703. max?: number;
  8704. color?: ColorString;
  8705. axisType?: 'value' | 'log';
  8706. }
  8707. interface RadarOption extends ComponentOption, CircleLayoutOptionMixin {
  8708. mainType?: 'radar';
  8709. startAngle?: number;
  8710. shape?: 'polygon' | 'circle';
  8711. axisLine?: AxisBaseOption['axisLine'];
  8712. axisTick?: AxisBaseOption['axisTick'];
  8713. axisLabel?: AxisBaseOption['axisLabel'];
  8714. splitLine?: AxisBaseOption['splitLine'];
  8715. splitArea?: AxisBaseOption['splitArea'];
  8716. axisName?: {
  8717. show?: boolean;
  8718. formatter?: string | ((name?: string, indicatorOpt?: InnerIndicatorAxisOption) => string);
  8719. } & LabelOption;
  8720. axisNameGap?: number;
  8721. triggerEvent?: boolean;
  8722. scale?: boolean;
  8723. splitNumber?: number;
  8724. boundaryGap?: CategoryAxisBaseOption['boundaryGap'] | ValueAxisBaseOption['boundaryGap'];
  8725. indicator?: RadarIndicatorOption[];
  8726. }
  8727. declare type InnerIndicatorAxisOption = AxisBaseOption & {
  8728. showName?: boolean;
  8729. };
  8730. declare type SingleAxisPosition = 'top' | 'bottom' | 'left' | 'right';
  8731. declare type SingleAxisOption = AxisBaseOption & BoxLayoutOptionMixin & {
  8732. mainType?: 'singleAxis';
  8733. position?: SingleAxisPosition;
  8734. orient?: LayoutOrient;
  8735. };
  8736. interface CalendarMonthLabelFormatterCallbackParams {
  8737. nameMap: string;
  8738. yyyy: string;
  8739. yy: string;
  8740. /**
  8741. * Month string. With 0 prefix.
  8742. */
  8743. MM: string;
  8744. /**
  8745. * Month number
  8746. */
  8747. M: number;
  8748. }
  8749. interface CalendarYearLabelFormatterCallbackParams {
  8750. nameMap: string;
  8751. /**
  8752. * Start year
  8753. */
  8754. start: string;
  8755. /**
  8756. * End year
  8757. */
  8758. end: string;
  8759. }
  8760. interface CalendarOption extends ComponentOption, BoxLayoutOptionMixin {
  8761. mainType?: 'calendar';
  8762. cellSize?: number | 'auto' | (number | 'auto')[];
  8763. orient?: LayoutOrient;
  8764. splitLine?: {
  8765. show?: boolean;
  8766. lineStyle?: LineStyleOption;
  8767. };
  8768. itemStyle?: ItemStyleOption;
  8769. /**
  8770. * // one year
  8771. * range: 2017
  8772. * // one month
  8773. * range: '2017-02'
  8774. * // a range
  8775. * range: ['2017-01-02', '2017-02-23']
  8776. * // note: they will be identified as ['2017-01-01', '2017-02-01']
  8777. * range: ['2017-01', '2017-02']
  8778. */
  8779. range?: OptionDataValueDate | (OptionDataValueDate)[];
  8780. dayLabel?: Omit<LabelOption, 'position'> & {
  8781. /**
  8782. * First day of week.
  8783. */
  8784. firstDay?: number;
  8785. /**
  8786. * Margin between day label and axis line.
  8787. * Can be percent string of cell size.
  8788. */
  8789. margin?: number | string;
  8790. /**
  8791. * Position of week, at the beginning or end of the range.
  8792. */
  8793. position?: 'start' | 'end';
  8794. /**
  8795. * Week text content
  8796. *
  8797. * defaults to auto-detected locale by the browser or the specified locale by `echarts.init` function.
  8798. * It supports any registered locale name (case-sensitive) or customized array.
  8799. * index 0 always means Sunday.
  8800. */
  8801. nameMap?: string | string[];
  8802. };
  8803. monthLabel?: Omit<LabelOption, 'position'> & {
  8804. /**
  8805. * Margin between month label and axis line.
  8806. */
  8807. margin?: number;
  8808. /**
  8809. * Position of month label, at the beginning or end of the range.
  8810. */
  8811. position?: 'start' | 'end';
  8812. /**
  8813. * Month text content
  8814. *
  8815. * defaults to auto-detected locale by the browser or the specified locale by `echarts.init` function.
  8816. * It supports any registered locale name (case-sensitive) or customized array.
  8817. * index 0 always means Jan.
  8818. */
  8819. nameMap?: string | string[];
  8820. formatter?: string | ((params: CalendarMonthLabelFormatterCallbackParams) => string);
  8821. };
  8822. yearLabel?: Omit<LabelOption, 'position'> & {
  8823. /**
  8824. * Margin between year label and axis line.
  8825. */
  8826. margin?: number;
  8827. /**
  8828. * Position of year label, at the beginning or end of the range.
  8829. */
  8830. position?: 'top' | 'bottom' | 'left' | 'right';
  8831. formatter?: string | ((params: CalendarYearLabelFormatterCallbackParams) => string);
  8832. };
  8833. }
  8834. declare type IconStyle = ItemStyleOption & {
  8835. textFill?: LabelOption['color'];
  8836. textBackgroundColor?: LabelOption['backgroundColor'];
  8837. textPosition?: LabelOption['position'];
  8838. textAlign?: LabelOption['align'];
  8839. textBorderRadius?: LabelOption['borderRadius'];
  8840. textPadding?: LabelOption['padding'];
  8841. };
  8842. interface ToolboxFeatureOption {
  8843. show?: boolean;
  8844. title?: string | Partial<Dictionary<string>>;
  8845. icon?: string | Partial<Dictionary<string>>;
  8846. iconStyle?: IconStyle;
  8847. emphasis?: {
  8848. iconStyle?: IconStyle;
  8849. };
  8850. iconStatus?: Partial<Dictionary<DisplayState>>;
  8851. onclick?: () => void;
  8852. }
  8853. interface ToolboxTooltipFormatterParams {
  8854. componentType: 'toolbox';
  8855. name: string;
  8856. title: string;
  8857. $vars: ['name', 'title'];
  8858. }
  8859. interface ToolboxOption extends ComponentOption, BoxLayoutOptionMixin, BorderOptionMixin {
  8860. mainType?: 'toolbox';
  8861. show?: boolean;
  8862. orient?: LayoutOrient;
  8863. backgroundColor?: ZRColor;
  8864. borderRadius?: number | number[];
  8865. padding?: number | number[];
  8866. itemSize?: number;
  8867. itemGap?: number;
  8868. showTitle?: boolean;
  8869. iconStyle?: ItemStyleOption;
  8870. emphasis?: {
  8871. iconStyle?: ItemStyleOption;
  8872. };
  8873. textStyle?: LabelOption;
  8874. tooltip?: CommonTooltipOption<ToolboxTooltipFormatterParams>;
  8875. /**
  8876. * Write all supported features in the final export option.
  8877. */
  8878. feature?: Partial<Dictionary<ToolboxFeatureOption>>;
  8879. }
  8880. interface TitleOption extends ComponentOption, BoxLayoutOptionMixin, BorderOptionMixin {
  8881. mainType?: 'title';
  8882. show?: boolean;
  8883. text?: string;
  8884. /**
  8885. * Link to url
  8886. */
  8887. link?: string;
  8888. target?: 'self' | 'blank';
  8889. subtext?: string;
  8890. sublink?: string;
  8891. subtarget?: 'self' | 'blank';
  8892. textAlign?: ZRTextAlign;
  8893. textVerticalAlign?: ZRTextVerticalAlign;
  8894. /**
  8895. * @deprecated Use textVerticalAlign instead
  8896. */
  8897. textBaseline?: ZRTextVerticalAlign;
  8898. backgroundColor?: ZRColor;
  8899. /**
  8900. * Padding between text and border.
  8901. * Support to be a single number or an array.
  8902. */
  8903. padding?: number | number[];
  8904. /**
  8905. * Gap between text and subtext
  8906. */
  8907. itemGap?: number;
  8908. textStyle?: LabelOption;
  8909. subtextStyle?: LabelOption;
  8910. /**
  8911. * If trigger mouse or touch event
  8912. */
  8913. triggerEvent?: boolean;
  8914. /**
  8915. * Radius of background border.
  8916. */
  8917. borderRadius?: number | number[];
  8918. }
  8919. interface TimelineControlStyle extends ItemStyleOption {
  8920. show?: boolean;
  8921. showPlayBtn?: boolean;
  8922. showPrevBtn?: boolean;
  8923. showNextBtn?: boolean;
  8924. itemSize?: number;
  8925. itemGap?: number;
  8926. position?: 'left' | 'right' | 'top' | 'bottom';
  8927. playIcon?: string;
  8928. stopIcon?: string;
  8929. prevIcon?: string;
  8930. nextIcon?: string;
  8931. playBtnSize?: number | string;
  8932. stopBtnSize?: number | string;
  8933. nextBtnSize?: number | string;
  8934. prevBtnSize?: number | string;
  8935. }
  8936. interface TimelineCheckpointStyle extends ItemStyleOption, SymbolOptionMixin {
  8937. animation?: boolean;
  8938. animationDuration?: number;
  8939. animationEasing?: ZREasing;
  8940. }
  8941. interface TimelineLineStyleOption extends LineStyleOption {
  8942. show?: boolean;
  8943. }
  8944. interface TimelineLabelOption extends Omit<LabelOption, 'position'> {
  8945. show?: boolean;
  8946. position?: 'auto' | 'left' | 'right' | 'top' | 'bottom' | number;
  8947. interval?: 'auto' | number;
  8948. formatter?: string | ((value: string | number, index: number) => string);
  8949. }
  8950. interface TimelineDataItemOption extends SymbolOptionMixin {
  8951. value?: OptionDataValue;
  8952. itemStyle?: ItemStyleOption;
  8953. label?: TimelineLabelOption;
  8954. checkpointStyle?: TimelineCheckpointStyle;
  8955. emphasis?: {
  8956. itemStyle?: ItemStyleOption;
  8957. label?: TimelineLabelOption;
  8958. checkpointStyle?: TimelineCheckpointStyle;
  8959. };
  8960. progress?: {
  8961. lineStyle?: TimelineLineStyleOption;
  8962. itemStyle?: ItemStyleOption;
  8963. label?: TimelineLabelOption;
  8964. };
  8965. tooltip?: boolean;
  8966. }
  8967. interface TimelineOption extends ComponentOption, BoxLayoutOptionMixin, SymbolOptionMixin {
  8968. mainType?: 'timeline';
  8969. backgroundColor?: ZRColor;
  8970. borderColor?: ColorString;
  8971. borderWidth?: number;
  8972. tooltip?: CommonTooltipOption<CallbackDataParams> & {
  8973. trigger?: 'item';
  8974. };
  8975. show?: boolean;
  8976. axisType?: 'category' | 'time' | 'value';
  8977. currentIndex?: number;
  8978. autoPlay?: boolean;
  8979. rewind?: boolean;
  8980. loop?: boolean;
  8981. playInterval?: number;
  8982. realtime?: boolean;
  8983. controlPosition?: 'left' | 'right' | 'top' | 'bottom';
  8984. padding?: number | number[];
  8985. orient?: LayoutOrient;
  8986. inverse?: boolean;
  8987. replaceMerge?: GlobalModelSetOptionOpts['replaceMerge'];
  8988. lineStyle?: TimelineLineStyleOption;
  8989. itemStyle?: ItemStyleOption;
  8990. checkpointStyle?: TimelineCheckpointStyle;
  8991. controlStyle?: TimelineControlStyle;
  8992. label?: TimelineLabelOption;
  8993. emphasis?: {
  8994. lineStyle?: TimelineLineStyleOption;
  8995. itemStyle?: ItemStyleOption;
  8996. checkpointStyle?: TimelineCheckpointStyle;
  8997. controlStyle?: TimelineControlStyle;
  8998. label?: TimelineLabelOption;
  8999. };
  9000. progress?: {
  9001. lineStyle?: TimelineLineStyleOption;
  9002. itemStyle?: ItemStyleOption;
  9003. label?: TimelineLabelOption;
  9004. };
  9005. data?: (OptionDataValue | TimelineDataItemOption)[];
  9006. }
  9007. interface SliderTimelineOption extends TimelineOption {
  9008. }
  9009. interface ScrollableLegendOption extends LegendOption {
  9010. scrollDataIndex?: number;
  9011. /**
  9012. * Gap between each page button
  9013. */
  9014. pageButtonItemGap?: number;
  9015. /**
  9016. * Gap between page buttons group and legend items.
  9017. */
  9018. pageButtonGap?: number;
  9019. pageButtonPosition?: 'start' | 'end';
  9020. pageFormatter?: string | ((param: {
  9021. current: number;
  9022. total: number;
  9023. }) => string);
  9024. pageIcons?: {
  9025. horizontal?: string[];
  9026. vertical?: string[];
  9027. };
  9028. pageIconColor?: ZRColor;
  9029. pageIconInactiveColor?: ZRColor;
  9030. pageIconSize?: number;
  9031. pageTextStyle?: LabelOption;
  9032. animationDurationUpdate?: number;
  9033. }
  9034. interface DataZoomOption extends ComponentOption {
  9035. mainType?: 'dataZoom';
  9036. /**
  9037. * Default auto by axisIndex
  9038. */
  9039. orient?: LayoutOrient;
  9040. /**
  9041. * Default the first horizontal category axis.
  9042. */
  9043. xAxisIndex?: number | number[];
  9044. xAxisId?: string | string[];
  9045. /**
  9046. * Default the first vertical category axis.
  9047. */
  9048. yAxisIndex?: number | number[];
  9049. yAxisId?: string | string[];
  9050. radiusAxisIndex?: number | number[];
  9051. radiusAxisId?: string | string[];
  9052. angleAxisIndex?: number | number[];
  9053. angleAxisId?: string | string[];
  9054. singleAxisIndex?: number | number[];
  9055. singleAxisId?: string | string[];
  9056. /**
  9057. * Possible values: 'filter' or 'empty' or 'weakFilter'.
  9058. * 'filter': data items which are out of window will be removed. This option is
  9059. * applicable when filtering outliers. For each data item, it will be
  9060. * filtered if one of the relevant dimensions is out of the window.
  9061. * 'weakFilter': data items which are out of window will be removed. This option
  9062. * is applicable when filtering outliers. For each data item, it will be
  9063. * filtered only if all of the relevant dimensions are out of the same
  9064. * side of the window.
  9065. * 'empty': data items which are out of window will be set to empty.
  9066. * This option is applicable when user should not neglect
  9067. * that there are some data items out of window.
  9068. * 'none': Do not filter.
  9069. * Taking line chart as an example, line will be broken in
  9070. * the filtered points when filterModel is set to 'empty', but
  9071. * be connected when set to 'filter'.
  9072. */
  9073. filterMode?: 'filter' | 'weakFilter' | 'empty' | 'none';
  9074. /**
  9075. * Dispatch action by the fixed rate, avoid frequency.
  9076. * default 100. Do not throttle when use null/undefined.
  9077. * If animation === true and animationDurationUpdate > 0,
  9078. * default value is 100, otherwise 20.
  9079. */
  9080. throttle?: number | null | undefined;
  9081. /**
  9082. * Start percent. 0 ~ 100
  9083. */
  9084. start?: number;
  9085. /**
  9086. * End percent. 0 ~ 100
  9087. */
  9088. end?: number;
  9089. /**
  9090. * Start value. If startValue specified, start is ignored
  9091. */
  9092. startValue?: number | string | Date;
  9093. /**
  9094. * End value. If endValue specified, end is ignored.
  9095. */
  9096. endValue?: number | string | Date;
  9097. /**
  9098. * Min span percent, 0 - 100
  9099. * The range of dataZoom can not be smaller than that.
  9100. */
  9101. minSpan?: number;
  9102. /**
  9103. * Max span percent, 0 - 100
  9104. * The range of dataZoom can not be larger than that.
  9105. */
  9106. maxSpan?: number;
  9107. minValueSpan?: number;
  9108. maxValueSpan?: number;
  9109. rangeMode?: ['value' | 'percent', 'value' | 'percent'];
  9110. realtime?: boolean;
  9111. textStyle?: LabelOption;
  9112. }
  9113. interface SliderDataZoomOption extends DataZoomOption, BoxLayoutOptionMixin {
  9114. show?: boolean;
  9115. /**
  9116. * Slider dataZoom don't support textStyle
  9117. */
  9118. /**
  9119. * Background of slider zoom component
  9120. */
  9121. backgroundColor?: ZRColor;
  9122. /**
  9123. * @deprecated Use borderColor instead
  9124. */
  9125. /**
  9126. * border color of the box. For compatibility,
  9127. * if dataBackgroundColor is set, borderColor
  9128. * is ignored.
  9129. */
  9130. borderColor?: ZRColor;
  9131. /**
  9132. * Border radius of the box.
  9133. */
  9134. borderRadius?: number | number[];
  9135. dataBackground?: {
  9136. lineStyle?: LineStyleOption;
  9137. areaStyle?: AreaStyleOption;
  9138. };
  9139. selectedDataBackground?: {
  9140. lineStyle?: LineStyleOption;
  9141. areaStyle?: AreaStyleOption;
  9142. };
  9143. /**
  9144. * Color of selected area.
  9145. */
  9146. fillerColor?: ZRColor;
  9147. /**
  9148. * @deprecated Use handleStyle instead
  9149. */
  9150. handleIcon?: string;
  9151. /**
  9152. * number: height of icon. width will be calculated according to the aspect of icon.
  9153. * string: percent of the slider height. width will be calculated according to the aspect of icon.
  9154. */
  9155. handleSize?: string | number;
  9156. handleStyle?: ItemStyleOption;
  9157. /**
  9158. * Icon to indicate it is a draggable panel.
  9159. */
  9160. moveHandleIcon?: string;
  9161. moveHandleStyle?: ItemStyleOption;
  9162. /**
  9163. * Height of handle rect. Can be a percent string relative to the slider height.
  9164. */
  9165. moveHandleSize?: number;
  9166. labelPrecision?: number | 'auto';
  9167. labelFormatter?: string | ((value: number, valueStr: string) => string);
  9168. showDetail?: boolean;
  9169. showDataShadow?: 'auto' | boolean;
  9170. zoomLock?: boolean;
  9171. textStyle?: LabelOption;
  9172. /**
  9173. * If eable select by brushing
  9174. */
  9175. brushSelect?: boolean;
  9176. brushStyle?: ItemStyleOption;
  9177. emphasis?: {
  9178. handleStyle?: ItemStyleOption;
  9179. moveHandleStyle?: ItemStyleOption;
  9180. };
  9181. }
  9182. interface InsideDataZoomOption extends DataZoomOption {
  9183. /**
  9184. * Whether disable this inside zoom.
  9185. */
  9186. disabled?: boolean;
  9187. /**
  9188. * Whether disable zoom but only pan.
  9189. */
  9190. zoomLock?: boolean;
  9191. zoomOnMouseWheel?: boolean | 'shift' | 'ctrl' | 'alt';
  9192. moveOnMouseMove?: boolean | 'shift' | 'ctrl' | 'alt';
  9193. moveOnMouseWheel?: boolean | 'shift' | 'ctrl' | 'alt';
  9194. preventDefaultMouseMove?: boolean;
  9195. /**
  9196. * Inside dataZoom don't support textStyle
  9197. */
  9198. textStyle?: never;
  9199. }
  9200. interface ContinousVisualMapOption extends VisualMapOption {
  9201. align?: 'auto' | 'left' | 'right' | 'top' | 'bottom';
  9202. /**
  9203. * This prop effect default component type determine
  9204. * @see echarts/component/visualMap/typeDefaulter.
  9205. */
  9206. calculable?: boolean;
  9207. /**
  9208. * selected range. In default case `range` is [min, max]
  9209. * and can auto change along with modification of min max,
  9210. * until user specified a range.
  9211. */
  9212. range?: number[];
  9213. /**
  9214. * Whether to enable hover highlight.
  9215. */
  9216. hoverLink?: boolean;
  9217. /**
  9218. * The extent of hovered data.
  9219. */
  9220. hoverLinkDataSize?: number;
  9221. /**
  9222. * Whether trigger hoverLink when hover handle.
  9223. * If not specified, follow the value of `realtime`.
  9224. */
  9225. hoverLinkOnHandle?: boolean;
  9226. handleIcon?: string;
  9227. handleSize?: string | number;
  9228. handleStyle?: ItemStyleOption;
  9229. indicatorIcon?: string;
  9230. indicatorSize?: string | number;
  9231. indicatorStyle?: ItemStyleOption;
  9232. emphasis?: {
  9233. handleStyle?: ItemStyleOption;
  9234. };
  9235. }
  9236. interface VisualPiece extends VisualOptionPiecewise {
  9237. min?: number;
  9238. max?: number;
  9239. lt?: number;
  9240. gt?: number;
  9241. lte?: number;
  9242. gte?: number;
  9243. value?: number;
  9244. label?: string;
  9245. }
  9246. /**
  9247. * Order Rule:
  9248. *
  9249. * option.categories / option.pieces / option.text / option.selected:
  9250. * If !option.inverse,
  9251. * Order when vertical: ['top', ..., 'bottom'].
  9252. * Order when horizontal: ['left', ..., 'right'].
  9253. * If option.inverse, the meaning of
  9254. * the order should be reversed.
  9255. *
  9256. * this._pieceList:
  9257. * The order is always [low, ..., high].
  9258. *
  9259. * Mapping from location to low-high:
  9260. * If !option.inverse
  9261. * When vertical, top is high.
  9262. * When horizontal, right is high.
  9263. * If option.inverse, reverse.
  9264. */
  9265. interface PiecewiseVisualMapOption extends VisualMapOption {
  9266. align?: 'auto' | 'left' | 'right';
  9267. minOpen?: boolean;
  9268. maxOpen?: boolean;
  9269. /**
  9270. * When put the controller vertically, it is the length of
  9271. * horizontal side of each item. Otherwise, vertical side.
  9272. * When put the controller vertically, it is the length of
  9273. * vertical side of each item. Otherwise, horizontal side.
  9274. */
  9275. itemWidth?: number;
  9276. itemHeight?: number;
  9277. itemSymbol?: string;
  9278. pieces?: VisualPiece[];
  9279. /**
  9280. * category names, like: ['some1', 'some2', 'some3'].
  9281. * Attr min/max are ignored when categories set. See "Order Rule"
  9282. */
  9283. categories?: string[];
  9284. /**
  9285. * If set to 5, auto split five pieces equally.
  9286. * If set to 0 and component type not set, component type will be
  9287. * determined as "continuous". (It is less reasonable but for ec2
  9288. * compatibility, see echarts/component/visualMap/typeDefaulter)
  9289. */
  9290. splitNumber?: number;
  9291. /**
  9292. * Object. If not specified, means selected. When pieces and splitNumber: {'0': true, '5': true}
  9293. * When categories: {'cate1': false, 'cate3': true} When selected === false, means all unselected.
  9294. */
  9295. selected?: Dictionary<boolean>;
  9296. selectedMode?: 'multiple' | 'single' | boolean;
  9297. /**
  9298. * By default, when text is used, label will hide (the logic
  9299. * is remained for compatibility reason)
  9300. */
  9301. showLabel?: boolean;
  9302. itemGap?: number;
  9303. hoverLink?: boolean;
  9304. }
  9305. interface MarkLineStateOption {
  9306. lineStyle?: LineStyleOption;
  9307. /**
  9308. * itemStyle for symbol
  9309. */
  9310. itemStyle?: ItemStyleOption;
  9311. label?: SeriesLineLabelOption;
  9312. }
  9313. interface MarkLineDataItemOptionBase extends MarkLineStateOption, StatesOptionMixin<MarkLineStateOption, StatesMixinBase> {
  9314. name?: string;
  9315. }
  9316. interface MarkLine1DDataItemOption extends MarkLineDataItemOptionBase {
  9317. xAxis?: number | string;
  9318. yAxis?: number | string;
  9319. type?: MarkerStatisticType;
  9320. /**
  9321. * When using statistic method with type.
  9322. * valueIndex and valueDim can be specify which dim the statistic is used on.
  9323. */
  9324. valueIndex?: number;
  9325. valueDim?: string;
  9326. /**
  9327. * Symbol for both two ends
  9328. */
  9329. symbol?: string[] | string;
  9330. symbolSize?: number[] | number;
  9331. symbolRotate?: number[] | number;
  9332. symbolOffset?: number | string | (number | string)[];
  9333. }
  9334. interface MarkLine2DDataItemDimOption extends MarkLineDataItemOptionBase, SymbolOptionMixin, MarkerPositionOption {
  9335. }
  9336. declare type MarkLine2DDataItemOption = [
  9337. MarkLine2DDataItemDimOption,
  9338. MarkLine2DDataItemDimOption
  9339. ];
  9340. interface MarkLineOption extends MarkerOption, MarkLineStateOption, StatesOptionMixin<MarkLineStateOption, StatesMixinBase> {
  9341. mainType?: 'markLine';
  9342. symbol?: string[] | string;
  9343. symbolSize?: number[] | number;
  9344. symbolRotate?: number[] | number;
  9345. symbolOffset?: number | string | (number | string)[];
  9346. /**
  9347. * Precision used on statistic method
  9348. */
  9349. precision?: number;
  9350. data?: (MarkLine1DDataItemOption | MarkLine2DDataItemOption)[];
  9351. }
  9352. interface MarkPointStateOption {
  9353. itemStyle?: ItemStyleOption;
  9354. label?: SeriesLabelOption;
  9355. }
  9356. interface MarkPointDataItemOption extends MarkPointStateOption, StatesOptionMixin<MarkPointStateOption, StatesMixinBase>, SymbolOptionMixin<CallbackDataParams>, MarkerPositionOption {
  9357. name: string;
  9358. }
  9359. interface MarkPointOption extends MarkerOption, SymbolOptionMixin<CallbackDataParams>, StatesOptionMixin<MarkPointStateOption, StatesMixinBase>, MarkPointStateOption {
  9360. mainType?: 'markPoint';
  9361. precision?: number;
  9362. data?: MarkPointDataItemOption[];
  9363. }
  9364. declare type LineDataValue = OptionDataValue | OptionDataValue[];
  9365. interface LineStateOptionMixin {
  9366. emphasis?: {
  9367. focus?: DefaultEmphasisFocus;
  9368. scale?: boolean | number;
  9369. };
  9370. }
  9371. interface LineStateOption<TCbParams = never> {
  9372. itemStyle?: ItemStyleOption<TCbParams>;
  9373. label?: SeriesLabelOption;
  9374. endLabel?: LineEndLabelOption;
  9375. }
  9376. interface LineDataItemOption extends SymbolOptionMixin, LineStateOption, StatesOptionMixin<LineStateOption, LineStateOptionMixin> {
  9377. name?: string;
  9378. value?: LineDataValue;
  9379. }
  9380. interface LineEndLabelOption extends SeriesLabelOption {
  9381. valueAnimation?: boolean;
  9382. }
  9383. interface LineSeriesOption extends SeriesOption<LineStateOption<CallbackDataParams>, LineStateOptionMixin & {
  9384. emphasis?: {
  9385. lineStyle?: Omit<LineStyleOption, 'width'> & {
  9386. width?: LineStyleOption['width'] | 'bolder';
  9387. };
  9388. areaStyle?: AreaStyleOption;
  9389. };
  9390. blur?: {
  9391. lineStyle?: LineStyleOption;
  9392. areaStyle?: AreaStyleOption;
  9393. };
  9394. }>, LineStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesStackOptionMixin, SeriesSamplingOptionMixin, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
  9395. type?: 'line';
  9396. coordinateSystem?: 'cartesian2d' | 'polar';
  9397. clip?: boolean;
  9398. label?: SeriesLabelOption;
  9399. endLabel?: LineEndLabelOption;
  9400. lineStyle?: LineStyleOption;
  9401. areaStyle?: AreaStyleOption & {
  9402. origin?: 'auto' | 'start' | 'end' | number;
  9403. };
  9404. step?: false | 'start' | 'end' | 'middle';
  9405. smooth?: boolean | number;
  9406. smoothMonotone?: 'x' | 'y' | 'none';
  9407. connectNulls?: boolean;
  9408. showSymbol?: boolean;
  9409. showAllSymbol?: 'auto' | boolean;
  9410. data?: (LineDataValue | LineDataItemOption)[];
  9411. triggerLineEvent?: boolean;
  9412. }
  9413. interface ScatterStateOption<TCbParams = never> {
  9414. itemStyle?: ItemStyleOption<TCbParams>;
  9415. label?: SeriesLabelOption;
  9416. }
  9417. interface ScatterStatesOptionMixin {
  9418. emphasis?: {
  9419. focus?: DefaultEmphasisFocus;
  9420. scale?: boolean | number;
  9421. };
  9422. }
  9423. interface ScatterDataItemOption extends SymbolOptionMixin, ScatterStateOption, StatesOptionMixin<ScatterStateOption, ScatterStatesOptionMixin>, OptionDataItemObject<OptionDataValue> {
  9424. }
  9425. interface ScatterSeriesOption extends SeriesOption<ScatterStateOption<CallbackDataParams>, ScatterStatesOptionMixin>, ScatterStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesOnGeoOptionMixin, SeriesOnSingleOptionMixin, SeriesLargeOptionMixin, SeriesStackOptionMixin, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
  9426. type?: 'scatter';
  9427. coordinateSystem?: string;
  9428. cursor?: string;
  9429. clip?: boolean;
  9430. data?: (ScatterDataItemOption | OptionDataValue | OptionDataValue[])[] | ArrayLike<number>;
  9431. }
  9432. interface PieItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
  9433. borderRadius?: (number | string)[] | number | string;
  9434. }
  9435. interface PieCallbackDataParams extends CallbackDataParams {
  9436. percent: number;
  9437. }
  9438. interface PieStateOption<TCbParams = never> {
  9439. itemStyle?: PieItemStyleOption<TCbParams>;
  9440. label?: PieLabelOption;
  9441. labelLine?: PieLabelLineOption;
  9442. }
  9443. interface PieLabelOption extends Omit<SeriesLabelOption, 'rotate' | 'position'> {
  9444. rotate?: number | boolean | 'radial' | 'tangential';
  9445. alignTo?: 'none' | 'labelLine' | 'edge';
  9446. edgeDistance?: string | number;
  9447. /**
  9448. * @deprecated Use `edgeDistance` instead
  9449. */
  9450. margin?: string | number;
  9451. bleedMargin?: number;
  9452. distanceToLabelLine?: number;
  9453. position?: SeriesLabelOption['position'] | 'outer' | 'inner' | 'center' | 'outside';
  9454. }
  9455. interface PieLabelLineOption extends LabelLineOption {
  9456. /**
  9457. * Max angle between labelLine and surface normal.
  9458. * 0 - 180
  9459. */
  9460. maxSurfaceAngle?: number;
  9461. }
  9462. interface ExtraStateOption {
  9463. emphasis?: {
  9464. focus?: DefaultEmphasisFocus;
  9465. scale?: boolean;
  9466. scaleSize?: number;
  9467. };
  9468. }
  9469. interface PieDataItemOption extends OptionDataItemObject<OptionDataValueNumeric>, PieStateOption, StatesOptionMixin<PieStateOption, ExtraStateOption> {
  9470. cursor?: string;
  9471. }
  9472. interface PieSeriesOption extends Omit<SeriesOption<PieStateOption<PieCallbackDataParams>, ExtraStateOption>, 'labelLine'>, PieStateOption<PieCallbackDataParams>, Omit<CircleLayoutOptionMixin, 'center'>, BoxLayoutOptionMixin, SeriesEncodeOptionMixin {
  9473. type?: 'pie';
  9474. roseType?: 'radius' | 'area';
  9475. center?: string | number | (string | number)[];
  9476. clockwise?: boolean;
  9477. startAngle?: number;
  9478. minAngle?: number;
  9479. minShowLabelAngle?: number;
  9480. selectedOffset?: number;
  9481. avoidLabelOverlap?: boolean;
  9482. percentPrecision?: number;
  9483. stillShowZeroSum?: boolean;
  9484. animationType?: 'expansion' | 'scale';
  9485. animationTypeUpdate?: 'transition' | 'expansion';
  9486. showEmptyCircle?: boolean;
  9487. emptyCircleStyle?: PieItemStyleOption;
  9488. data?: (OptionDataValueNumeric | OptionDataValueNumeric[] | PieDataItemOption)[];
  9489. }
  9490. declare type RadarSeriesDataValue = OptionDataValue[];
  9491. interface RadarStatesMixin {
  9492. emphasis?: DefaultStatesMixinEmphasis;
  9493. }
  9494. interface RadarSeriesStateOption<TCbParams = never> {
  9495. lineStyle?: LineStyleOption;
  9496. areaStyle?: AreaStyleOption;
  9497. label?: SeriesLabelOption;
  9498. itemStyle?: ItemStyleOption<TCbParams>;
  9499. }
  9500. interface RadarSeriesDataItemOption extends SymbolOptionMixin, RadarSeriesStateOption<CallbackDataParams>, StatesOptionMixin<RadarSeriesStateOption<CallbackDataParams>, RadarStatesMixin>, OptionDataItemObject<RadarSeriesDataValue> {
  9501. }
  9502. interface RadarSeriesOption extends SeriesOption<RadarSeriesStateOption, RadarStatesMixin>, RadarSeriesStateOption, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
  9503. type?: 'radar';
  9504. coordinateSystem?: 'radar';
  9505. radarIndex?: number;
  9506. radarId?: string;
  9507. data?: (RadarSeriesDataItemOption | RadarSeriesDataValue)[];
  9508. }
  9509. interface CurveLineStyleOption extends LineStyleOption {
  9510. curveness?: number;
  9511. }
  9512. interface TreeSeriesStateOption<TCbParams = never> {
  9513. itemStyle?: ItemStyleOption<TCbParams>;
  9514. /**
  9515. * Line style of the edge between node and it's parent.
  9516. */
  9517. lineStyle?: CurveLineStyleOption;
  9518. label?: SeriesLabelOption;
  9519. }
  9520. interface TreeStatesMixin {
  9521. emphasis?: {
  9522. focus?: DefaultEmphasisFocus | 'ancestor' | 'descendant' | 'relative';
  9523. scale?: boolean;
  9524. };
  9525. }
  9526. interface TreeSeriesNodeItemOption extends SymbolOptionMixin<CallbackDataParams>, TreeSeriesStateOption<CallbackDataParams>, StatesOptionMixin<TreeSeriesStateOption<CallbackDataParams>, TreeStatesMixin>, OptionDataItemObject<OptionDataValue> {
  9527. children?: TreeSeriesNodeItemOption[];
  9528. collapsed?: boolean;
  9529. link?: string;
  9530. target?: string;
  9531. }
  9532. /**
  9533. * Configuration of leaves nodes.
  9534. */
  9535. interface TreeSeriesLeavesOption extends TreeSeriesStateOption, StatesOptionMixin<TreeSeriesStateOption, TreeStatesMixin> {
  9536. }
  9537. interface TreeSeriesOption extends SeriesOption<TreeSeriesStateOption, TreeStatesMixin>, TreeSeriesStateOption, SymbolOptionMixin<CallbackDataParams>, BoxLayoutOptionMixin, RoamOptionMixin {
  9538. type?: 'tree';
  9539. layout?: 'orthogonal' | 'radial';
  9540. edgeShape?: 'polyline' | 'curve';
  9541. /**
  9542. * Available when edgeShape is polyline
  9543. */
  9544. edgeForkPosition?: string | number;
  9545. nodeScaleRatio?: number;
  9546. /**
  9547. * The orient of orthoginal layout, can be setted to 'LR', 'TB', 'RL', 'BT'.
  9548. * and the backward compatibility configuration 'horizontal = LR', 'vertical = TB'.
  9549. */
  9550. orient?: 'LR' | 'TB' | 'RL' | 'BT' | 'horizontal' | 'vertical';
  9551. expandAndCollapse?: boolean;
  9552. /**
  9553. * The initial expanded depth of tree
  9554. */
  9555. initialTreeDepth?: number;
  9556. leaves?: TreeSeriesLeavesOption;
  9557. data?: TreeSeriesNodeItemOption[];
  9558. }
  9559. declare type TreemapSeriesDataValue = number | number[];
  9560. interface BreadcrumbItemStyleOption extends ItemStyleOption {
  9561. textStyle?: LabelOption;
  9562. }
  9563. interface TreemapSeriesLabelOption extends SeriesLabelOption {
  9564. formatter?: string | ((params: CallbackDataParams) => string);
  9565. }
  9566. interface TreemapSeriesItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
  9567. borderRadius?: number | number[];
  9568. colorAlpha?: number;
  9569. colorSaturation?: number;
  9570. borderColorSaturation?: number;
  9571. gapWidth?: number;
  9572. }
  9573. interface TreePathInfo {
  9574. name: string;
  9575. dataIndex: number;
  9576. value: TreemapSeriesDataValue;
  9577. }
  9578. interface TreemapSeriesCallbackDataParams extends CallbackDataParams {
  9579. /**
  9580. * @deprecated
  9581. */
  9582. treePathInfo?: TreePathInfo[];
  9583. treeAncestors?: TreePathInfo[];
  9584. }
  9585. interface ExtraStateOption$1 {
  9586. emphasis?: {
  9587. focus?: DefaultEmphasisFocus | 'descendant' | 'ancestor';
  9588. };
  9589. }
  9590. interface TreemapStateOption<TCbParams = never> {
  9591. itemStyle?: TreemapSeriesItemStyleOption<TCbParams>;
  9592. label?: TreemapSeriesLabelOption;
  9593. upperLabel?: TreemapSeriesLabelOption;
  9594. }
  9595. interface TreemapSeriesVisualOption {
  9596. /**
  9597. * Which dimension will be applied with the visual properties.
  9598. */
  9599. visualDimension?: number | string;
  9600. /**
  9601. * @deprecated Use colorBy instead
  9602. */
  9603. colorMappingBy?: 'value' | 'index' | 'id';
  9604. visualMin?: number;
  9605. visualMax?: number;
  9606. colorAlpha?: number[] | 'none';
  9607. colorSaturation?: number[] | 'none';
  9608. /**
  9609. * A node will not be shown when its area size is smaller than this value (unit: px square).
  9610. */
  9611. visibleMin?: number;
  9612. /**
  9613. * Children will not be shown when area size of a node is smaller than this value (unit: px square).
  9614. */
  9615. childrenVisibleMin?: number;
  9616. }
  9617. interface TreemapSeriesLevelOption extends TreemapSeriesVisualOption, TreemapStateOption, StatesOptionMixin<TreemapStateOption, ExtraStateOption$1> {
  9618. color?: ColorString[] | 'none';
  9619. decal?: DecalObject[] | 'none';
  9620. }
  9621. interface TreemapSeriesNodeItemOption extends TreemapSeriesVisualOption, TreemapStateOption, StatesOptionMixin<TreemapStateOption, ExtraStateOption$1> {
  9622. id?: OptionId;
  9623. name?: OptionName;
  9624. value?: TreemapSeriesDataValue;
  9625. children?: TreemapSeriesNodeItemOption[];
  9626. color?: ColorString[] | 'none';
  9627. decal?: DecalObject[] | 'none';
  9628. }
  9629. interface TreemapSeriesOption extends SeriesOption<TreemapStateOption<TreemapSeriesCallbackDataParams>, ExtraStateOption$1>, TreemapStateOption<TreemapSeriesCallbackDataParams>, BoxLayoutOptionMixin, RoamOptionMixin, TreemapSeriesVisualOption {
  9630. type?: 'treemap';
  9631. /**
  9632. * configuration in echarts2
  9633. * @deprecated
  9634. */
  9635. size?: (number | string)[];
  9636. /**
  9637. * If sort in desc order.
  9638. * Default to be desc. asc has strange effect
  9639. */
  9640. sort?: boolean | 'asc' | 'desc';
  9641. /**
  9642. * Size of clipped window when zooming. 'origin' or 'fullscreen'
  9643. */
  9644. clipWindow?: 'origin' | 'fullscreen';
  9645. squareRatio?: number;
  9646. /**
  9647. * Nodes on depth from root are regarded as leaves.
  9648. * Count from zero (zero represents only view root).
  9649. */
  9650. leafDepth?: number;
  9651. drillDownIcon?: string;
  9652. /**
  9653. * Be effective when using zoomToNode. Specify the proportion of the
  9654. * target node area in the view area.
  9655. */
  9656. zoomToNodeRatio?: number;
  9657. /**
  9658. * Leaf node click behaviour: 'zoomToNode', 'link', false.
  9659. * If leafDepth is set and clicking a node which has children but
  9660. * be on left depth, the behaviour would be changing root. Otherwise
  9661. * use behaviour defined above.
  9662. */
  9663. nodeClick?: 'zoomToNode' | 'link' | false;
  9664. breadcrumb?: BoxLayoutOptionMixin & {
  9665. show?: boolean;
  9666. height?: number;
  9667. emptyItemWidth?: number;
  9668. itemStyle?: BreadcrumbItemStyleOption;
  9669. emphasis?: {
  9670. disabled?: boolean;
  9671. focus?: DefaultEmphasisFocus;
  9672. blurScope?: BlurScope;
  9673. itemStyle?: BreadcrumbItemStyleOption;
  9674. };
  9675. };
  9676. levels?: TreemapSeriesLevelOption[];
  9677. data?: TreemapSeriesNodeItemOption[];
  9678. }
  9679. declare type GraphDataValue = OptionDataValue | OptionDataValue[];
  9680. interface GraphEdgeLineStyleOption extends LineStyleOption {
  9681. curveness?: number;
  9682. }
  9683. interface GraphNodeStateOption<TCbParams = never> {
  9684. itemStyle?: ItemStyleOption<TCbParams>;
  9685. label?: SeriesLabelOption;
  9686. }
  9687. interface ExtraEmphasisState {
  9688. focus?: DefaultEmphasisFocus | 'adjacency';
  9689. }
  9690. interface GraphNodeStatesMixin {
  9691. emphasis?: ExtraEmphasisState;
  9692. }
  9693. interface GraphEdgeStatesMixin {
  9694. emphasis?: ExtraEmphasisState;
  9695. }
  9696. interface GraphNodeItemOption extends SymbolOptionMixin, GraphNodeStateOption, GraphNodeStateOption, StatesOptionMixin<GraphNodeStateOption, GraphNodeStatesMixin> {
  9697. id?: string;
  9698. name?: string;
  9699. value?: GraphDataValue;
  9700. /**
  9701. * Fixed x position
  9702. */
  9703. x?: number;
  9704. /**
  9705. * Fixed y position
  9706. */
  9707. y?: number;
  9708. /**
  9709. * If this node is fixed during force layout.
  9710. */
  9711. fixed?: boolean;
  9712. /**
  9713. * Index or name of category
  9714. */
  9715. category?: number | string;
  9716. draggable?: boolean;
  9717. cursor?: string;
  9718. }
  9719. interface GraphEdgeStateOption {
  9720. lineStyle?: GraphEdgeLineStyleOption;
  9721. label?: SeriesLineLabelOption;
  9722. }
  9723. interface GraphEdgeItemOption extends GraphEdgeStateOption, StatesOptionMixin<GraphEdgeStateOption, GraphEdgeStatesMixin>, GraphEdgeItemObject<OptionDataValueNumeric> {
  9724. value?: number;
  9725. /**
  9726. * Symbol of both line ends
  9727. */
  9728. symbol?: string | string[];
  9729. symbolSize?: number | number[];
  9730. ignoreForceLayout?: boolean;
  9731. }
  9732. interface GraphCategoryItemOption extends SymbolOptionMixin, GraphNodeStateOption, StatesOptionMixin<GraphNodeStateOption, GraphNodeStatesMixin> {
  9733. name?: string;
  9734. value?: OptionDataValue;
  9735. }
  9736. interface GraphSeriesOption extends SeriesOption<GraphNodeStateOption<CallbackDataParams>, GraphNodeStatesMixin>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesOnGeoOptionMixin, SeriesOnSingleOptionMixin, SymbolOptionMixin<CallbackDataParams>, RoamOptionMixin, BoxLayoutOptionMixin {
  9737. type?: 'graph';
  9738. coordinateSystem?: string;
  9739. legendHoverLink?: boolean;
  9740. layout?: 'none' | 'force' | 'circular';
  9741. data?: (GraphNodeItemOption | GraphDataValue)[];
  9742. nodes?: (GraphNodeItemOption | GraphDataValue)[];
  9743. edges?: GraphEdgeItemOption[];
  9744. links?: GraphEdgeItemOption[];
  9745. categories?: GraphCategoryItemOption[];
  9746. /**
  9747. * @deprecated
  9748. */
  9749. focusNodeAdjacency?: boolean;
  9750. /**
  9751. * Symbol size scale ratio in roam
  9752. */
  9753. nodeScaleRatio?: 0.6;
  9754. draggable?: boolean;
  9755. edgeSymbol?: string | string[];
  9756. edgeSymbolSize?: number | number[];
  9757. edgeLabel?: SeriesLineLabelOption;
  9758. label?: SeriesLabelOption;
  9759. itemStyle?: ItemStyleOption<CallbackDataParams>;
  9760. lineStyle?: GraphEdgeLineStyleOption;
  9761. emphasis?: {
  9762. focus?: Exclude<GraphNodeItemOption['emphasis'], undefined>['focus'];
  9763. scale?: boolean | number;
  9764. label?: SeriesLabelOption;
  9765. edgeLabel?: SeriesLabelOption;
  9766. itemStyle?: ItemStyleOption;
  9767. lineStyle?: LineStyleOption;
  9768. };
  9769. blur?: {
  9770. label?: SeriesLabelOption;
  9771. edgeLabel?: SeriesLabelOption;
  9772. itemStyle?: ItemStyleOption;
  9773. lineStyle?: LineStyleOption;
  9774. };
  9775. select?: {
  9776. label?: SeriesLabelOption;
  9777. edgeLabel?: SeriesLabelOption;
  9778. itemStyle?: ItemStyleOption;
  9779. lineStyle?: LineStyleOption;
  9780. };
  9781. circular?: {
  9782. rotateLabel?: boolean;
  9783. };
  9784. force?: {
  9785. initLayout?: 'circular' | 'none';
  9786. repulsion?: number | number[];
  9787. gravity?: number;
  9788. friction?: number;
  9789. edgeLength?: number | number[];
  9790. layoutAnimation?: boolean;
  9791. };
  9792. /**
  9793. * auto curveness for multiple edge, invalid when `lineStyle.curveness` is set
  9794. */
  9795. autoCurveness?: boolean | number | number[];
  9796. }
  9797. declare type GaugeColorStop = [number, ColorString];
  9798. interface LabelFormatter$1 {
  9799. (value: number): string;
  9800. }
  9801. interface PointerOption {
  9802. icon?: string;
  9803. show?: boolean;
  9804. /**
  9805. * If pointer shows above title and detail
  9806. */
  9807. showAbove?: boolean;
  9808. keepAspect?: boolean;
  9809. itemStyle?: ItemStyleOption;
  9810. /**
  9811. * Can be percent
  9812. */
  9813. offsetCenter?: (number | string)[];
  9814. length?: number | string;
  9815. width?: number;
  9816. }
  9817. interface AnchorOption {
  9818. show?: boolean;
  9819. showAbove?: boolean;
  9820. size?: number;
  9821. icon?: string;
  9822. offsetCenter?: (number | string)[];
  9823. keepAspect?: boolean;
  9824. itemStyle?: ItemStyleOption;
  9825. }
  9826. interface ProgressOption {
  9827. show?: boolean;
  9828. overlap?: boolean;
  9829. width?: number;
  9830. roundCap?: boolean;
  9831. clip?: boolean;
  9832. itemStyle?: ItemStyleOption;
  9833. }
  9834. interface TitleOption$1 extends LabelOption {
  9835. /**
  9836. * [x, y] offset
  9837. */
  9838. offsetCenter?: (number | string)[];
  9839. formatter?: LabelFormatter$1 | string;
  9840. /**
  9841. * If do value animtion.
  9842. */
  9843. valueAnimation?: boolean;
  9844. }
  9845. interface DetailOption extends LabelOption {
  9846. /**
  9847. * [x, y] offset
  9848. */
  9849. offsetCenter?: (number | string)[];
  9850. formatter?: LabelFormatter$1 | string;
  9851. /**
  9852. * If do value animtion.
  9853. */
  9854. valueAnimation?: boolean;
  9855. }
  9856. interface GaugeStatesMixin {
  9857. emphasis?: DefaultStatesMixinEmphasis;
  9858. }
  9859. interface GaugeStateOption<TCbParams = never> {
  9860. itemStyle?: ItemStyleOption<TCbParams>;
  9861. }
  9862. interface GaugeDataItemOption extends GaugeStateOption, StatesOptionMixin<GaugeStateOption<CallbackDataParams>, GaugeStatesMixin> {
  9863. name?: string;
  9864. value?: OptionDataValueNumeric;
  9865. pointer?: PointerOption;
  9866. progress?: ProgressOption;
  9867. title?: TitleOption$1;
  9868. detail?: DetailOption;
  9869. }
  9870. interface GaugeSeriesOption extends SeriesOption<GaugeStateOption, GaugeStatesMixin>, GaugeStateOption<CallbackDataParams>, CircleLayoutOptionMixin, SeriesEncodeOptionMixin {
  9871. type?: 'gauge';
  9872. radius?: number | string;
  9873. startAngle?: number;
  9874. endAngle?: number;
  9875. clockwise?: boolean;
  9876. min?: number;
  9877. max?: number;
  9878. splitNumber?: number;
  9879. itemStyle?: ItemStyleOption;
  9880. axisLine?: {
  9881. show?: boolean;
  9882. roundCap?: boolean;
  9883. lineStyle?: Omit<LineStyleOption, 'color'> & {
  9884. color?: GaugeColorStop[];
  9885. };
  9886. };
  9887. progress?: ProgressOption;
  9888. splitLine?: {
  9889. show?: boolean;
  9890. /**
  9891. * Can be percent
  9892. */
  9893. length?: number;
  9894. distance?: number;
  9895. lineStyle?: LineStyleOption;
  9896. };
  9897. axisTick?: {
  9898. show?: boolean;
  9899. splitNumber?: number;
  9900. /**
  9901. * Can be percent
  9902. */
  9903. length?: number | string;
  9904. distance?: number;
  9905. lineStyle?: LineStyleOption;
  9906. };
  9907. axisLabel?: Omit<LabelOption, 'rotate'> & {
  9908. formatter?: LabelFormatter$1 | string;
  9909. rotate?: 'tangential' | 'radial' | number;
  9910. };
  9911. pointer?: PointerOption;
  9912. anchor?: AnchorOption;
  9913. title?: TitleOption$1;
  9914. detail?: DetailOption;
  9915. data?: (OptionDataValueNumeric | GaugeDataItemOption)[];
  9916. }
  9917. declare type FunnelLabelOption = Omit<SeriesLabelOption, 'position'> & {
  9918. position?: LabelOption['position'] | 'outer' | 'inner' | 'center' | 'rightTop' | 'rightBottom' | 'leftTop' | 'leftBottom';
  9919. };
  9920. interface FunnelStatesMixin {
  9921. emphasis?: DefaultStatesMixinEmphasis;
  9922. }
  9923. interface FunnelCallbackDataParams extends CallbackDataParams {
  9924. percent: number;
  9925. }
  9926. interface FunnelStateOption<TCbParams = never> {
  9927. itemStyle?: ItemStyleOption<TCbParams>;
  9928. label?: FunnelLabelOption;
  9929. labelLine?: LabelLineOption;
  9930. }
  9931. interface FunnelDataItemOption extends FunnelStateOption, StatesOptionMixin<FunnelStateOption, FunnelStatesMixin>, OptionDataItemObject<OptionDataValueNumeric> {
  9932. itemStyle?: ItemStyleOption & {
  9933. width?: number | string;
  9934. height?: number | string;
  9935. };
  9936. }
  9937. interface FunnelSeriesOption extends SeriesOption<FunnelStateOption<FunnelCallbackDataParams>, FunnelStatesMixin>, FunnelStateOption<FunnelCallbackDataParams>, BoxLayoutOptionMixin, SeriesEncodeOptionMixin {
  9938. type?: 'funnel';
  9939. min?: number;
  9940. max?: number;
  9941. /**
  9942. * Absolute number or percent string
  9943. */
  9944. minSize?: number | string;
  9945. maxSize?: number | string;
  9946. sort?: 'ascending' | 'descending' | 'none';
  9947. orient?: LayoutOrient;
  9948. gap?: number;
  9949. funnelAlign?: HorizontalAlign | VerticalAlign;
  9950. data?: (OptionDataValueNumeric | OptionDataValueNumeric[] | FunnelDataItemOption)[];
  9951. }
  9952. declare type ParallelSeriesDataValue = OptionDataValue[];
  9953. interface ParallelStatesMixin {
  9954. emphasis?: DefaultStatesMixinEmphasis;
  9955. }
  9956. interface ParallelStateOption<TCbParams = never> {
  9957. lineStyle?: LineStyleOption<(TCbParams extends never ? never : (params: TCbParams) => ZRColor) | ZRColor>;
  9958. label?: SeriesLabelOption;
  9959. }
  9960. interface ParallelSeriesDataItemOption extends ParallelStateOption, StatesOptionMixin<ParallelStateOption, ParallelStatesMixin> {
  9961. value?: ParallelSeriesDataValue[];
  9962. }
  9963. interface ParallelSeriesOption extends SeriesOption<ParallelStateOption<CallbackDataParams>, ParallelStatesMixin>, ParallelStateOption<CallbackDataParams>, SeriesEncodeOptionMixin {
  9964. type?: 'parallel';
  9965. coordinateSystem?: string;
  9966. parallelIndex?: number;
  9967. parallelId?: string;
  9968. inactiveOpacity?: number;
  9969. activeOpacity?: number;
  9970. smooth?: boolean | number;
  9971. realtime?: boolean;
  9972. tooltip?: SeriesTooltipOption;
  9973. parallelAxisDefault?: ParallelAxisOption;
  9974. data?: (ParallelSeriesDataValue | ParallelSeriesDataItemOption)[];
  9975. }
  9976. declare type FocusNodeAdjacency = boolean | 'inEdges' | 'outEdges' | 'allEdges';
  9977. interface SankeyNodeStateOption<TCbParams = never> {
  9978. label?: SeriesLabelOption;
  9979. itemStyle?: ItemStyleOption<TCbParams>;
  9980. }
  9981. interface SankeyEdgeStateOption {
  9982. lineStyle?: SankeyEdgeStyleOption;
  9983. }
  9984. interface SankeyBothStateOption<TCbParams> extends SankeyNodeStateOption<TCbParams>, SankeyEdgeStateOption {
  9985. }
  9986. interface SankeyEdgeStyleOption extends LineStyleOption {
  9987. curveness?: number;
  9988. }
  9989. interface ExtraStateOption$2 {
  9990. emphasis?: {
  9991. focus?: DefaultEmphasisFocus | 'adjacency';
  9992. };
  9993. }
  9994. interface SankeyNodeItemOption extends SankeyNodeStateOption, StatesOptionMixin<SankeyNodeStateOption, ExtraStateOption$2>, OptionDataItemObject<OptionDataValue> {
  9995. id?: string;
  9996. localX?: number;
  9997. localY?: number;
  9998. depth?: number;
  9999. draggable?: boolean;
  10000. focusNodeAdjacency?: FocusNodeAdjacency;
  10001. }
  10002. interface SankeyEdgeItemOption extends SankeyEdgeStateOption, StatesOptionMixin<SankeyEdgeStateOption, ExtraStateOption$2>, GraphEdgeItemObject<OptionDataValueNumeric> {
  10003. focusNodeAdjacency?: FocusNodeAdjacency;
  10004. edgeLabel?: SeriesLabelOption;
  10005. }
  10006. interface SankeyLevelOption extends SankeyNodeStateOption, SankeyEdgeStateOption {
  10007. depth: number;
  10008. }
  10009. interface SankeySeriesOption extends SeriesOption<SankeyBothStateOption<CallbackDataParams>, ExtraStateOption$2>, SankeyBothStateOption<CallbackDataParams>, BoxLayoutOptionMixin {
  10010. type?: 'sankey';
  10011. /**
  10012. * color will be linear mapped.
  10013. */
  10014. color?: ColorString[];
  10015. coordinateSystem?: 'view';
  10016. orient?: LayoutOrient;
  10017. /**
  10018. * The width of the node
  10019. */
  10020. nodeWidth?: number;
  10021. /**
  10022. * The vertical distance between two nodes
  10023. */
  10024. nodeGap?: number;
  10025. /**
  10026. * Control if the node can move or not
  10027. */
  10028. draggable?: boolean;
  10029. /**
  10030. * Will be allEdges if true.
  10031. * @deprecated
  10032. */
  10033. focusNodeAdjacency?: FocusNodeAdjacency;
  10034. /**
  10035. * The number of iterations to change the position of the node
  10036. */
  10037. layoutIterations?: number;
  10038. nodeAlign?: 'justify' | 'left' | 'right';
  10039. data?: SankeyNodeItemOption[];
  10040. nodes?: SankeyNodeItemOption[];
  10041. edges?: SankeyEdgeItemOption[];
  10042. links?: SankeyEdgeItemOption[];
  10043. levels?: SankeyLevelOption[];
  10044. edgeLabel?: SeriesLabelOption & {
  10045. position?: 'inside';
  10046. };
  10047. }
  10048. declare type BoxplotDataValue = OptionDataValueNumeric[];
  10049. interface BoxplotStateOption<TCbParams = never> {
  10050. itemStyle?: ItemStyleOption<TCbParams>;
  10051. label?: SeriesLabelOption;
  10052. }
  10053. interface BoxplotDataItemOption extends BoxplotStateOption, StatesOptionMixin<BoxplotStateOption, ExtraStateOption$3> {
  10054. value: BoxplotDataValue;
  10055. }
  10056. interface ExtraStateOption$3 {
  10057. emphasis?: {
  10058. focus?: DefaultEmphasisFocus;
  10059. scale?: boolean;
  10060. };
  10061. }
  10062. interface BoxplotSeriesOption extends SeriesOption<BoxplotStateOption<CallbackDataParams>, ExtraStateOption$3>, BoxplotStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesEncodeOptionMixin {
  10063. type?: 'boxplot';
  10064. coordinateSystem?: 'cartesian2d';
  10065. layout?: LayoutOrient;
  10066. /**
  10067. * [min, max] can be percent of band width.
  10068. */
  10069. boxWidth?: (string | number)[];
  10070. data?: (BoxplotDataValue | BoxplotDataItemOption)[];
  10071. }
  10072. declare type CandlestickDataValue = OptionDataValue[];
  10073. interface CandlestickItemStyleOption extends ItemStyleOption {
  10074. color0?: ZRColor;
  10075. borderColor0?: ColorString;
  10076. borderColorDoji?: ZRColor;
  10077. }
  10078. interface CandlestickStateOption {
  10079. itemStyle?: CandlestickItemStyleOption;
  10080. label?: SeriesLabelOption;
  10081. }
  10082. interface CandlestickDataItemOption extends CandlestickStateOption, StatesOptionMixin<CandlestickStateOption, ExtraStateOption$4> {
  10083. value: CandlestickDataValue;
  10084. }
  10085. interface ExtraStateOption$4 {
  10086. emphasis?: {
  10087. focus?: DefaultEmphasisFocus;
  10088. scale?: boolean;
  10089. };
  10090. }
  10091. interface CandlestickSeriesOption extends SeriesOption<CandlestickStateOption, ExtraStateOption$4>, CandlestickStateOption, SeriesOnCartesianOptionMixin, SeriesLargeOptionMixin, SeriesEncodeOptionMixin {
  10092. type?: 'candlestick';
  10093. coordinateSystem?: 'cartesian2d';
  10094. layout?: LayoutOrient;
  10095. clip?: boolean;
  10096. barMaxWidth?: number | string;
  10097. barMinWidth?: number | string;
  10098. barWidth?: number | string;
  10099. data?: (CandlestickDataValue | CandlestickDataItemOption)[];
  10100. }
  10101. interface RippleEffectOption {
  10102. period?: number;
  10103. /**
  10104. * Scale of ripple
  10105. */
  10106. scale?: number;
  10107. brushType?: 'fill' | 'stroke';
  10108. color?: ZRColor;
  10109. /**
  10110. * ripple number
  10111. */
  10112. number?: number;
  10113. }
  10114. interface SymbolDrawStateOption {
  10115. itemStyle?: ItemStyleOption;
  10116. label?: LabelOption;
  10117. }
  10118. interface SymbolDrawItemModelOption extends SymbolOptionMixin<object>, StatesOptionMixin<SymbolDrawStateOption, {
  10119. emphasis?: {
  10120. focus?: DefaultEmphasisFocus;
  10121. scale?: boolean | number;
  10122. };
  10123. }>, SymbolDrawStateOption {
  10124. cursor?: string;
  10125. rippleEffect?: RippleEffectOption;
  10126. }
  10127. declare type ScatterDataValue = OptionDataValue | OptionDataValue[];
  10128. interface EffectScatterStatesOptionMixin {
  10129. emphasis?: {
  10130. focus?: DefaultEmphasisFocus;
  10131. scale?: boolean | number;
  10132. };
  10133. }
  10134. interface EffectScatterStateOption<TCbParams = never> {
  10135. itemStyle?: ItemStyleOption<TCbParams>;
  10136. label?: SeriesLabelOption;
  10137. }
  10138. interface EffectScatterDataItemOption extends SymbolOptionMixin, EffectScatterStateOption, StatesOptionMixin<EffectScatterStateOption, EffectScatterStatesOptionMixin> {
  10139. name?: string;
  10140. value?: ScatterDataValue;
  10141. rippleEffect?: SymbolDrawItemModelOption['rippleEffect'];
  10142. }
  10143. interface EffectScatterSeriesOption extends SeriesOption<EffectScatterStateOption<CallbackDataParams>, EffectScatterStatesOptionMixin>, EffectScatterStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesOnGeoOptionMixin, SeriesOnSingleOptionMixin, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
  10144. type?: 'effectScatter';
  10145. coordinateSystem?: string;
  10146. effectType?: 'ripple';
  10147. /**
  10148. * When to show the effect
  10149. */
  10150. showEffectOn?: 'render' | 'emphasis';
  10151. clip?: boolean;
  10152. /**
  10153. * Ripple effect config
  10154. */
  10155. rippleEffect?: SymbolDrawItemModelOption['rippleEffect'];
  10156. data?: (EffectScatterDataItemOption | ScatterDataValue)[];
  10157. }
  10158. interface LineDrawStateOption {
  10159. lineStyle?: LineStyleOption;
  10160. label?: LineLabelOption;
  10161. }
  10162. interface LineDrawModelOption extends LineDrawStateOption, StatesOptionMixin<LineDrawStateOption, {
  10163. emphasis?: {
  10164. focus?: DefaultEmphasisFocus;
  10165. };
  10166. }> {
  10167. effect?: {
  10168. show?: boolean;
  10169. period?: number;
  10170. delay?: number | ((idx: number) => number);
  10171. /**
  10172. * If move with constant speed px/sec
  10173. * period will be ignored if this property is > 0,
  10174. */
  10175. constantSpeed?: number;
  10176. symbol?: string;
  10177. symbolSize?: number | number[];
  10178. loop?: boolean;
  10179. roundTrip?: boolean;
  10180. /**
  10181. * Length of trail, 0 - 1
  10182. */
  10183. trailLength?: number;
  10184. /**
  10185. * Default to be same with lineStyle.color
  10186. */
  10187. color?: ColorString;
  10188. };
  10189. }
  10190. declare type LinesCoords = number[][];
  10191. declare type LinesValue = OptionDataValue | OptionDataValue[];
  10192. interface LinesLineStyleOption<TClr> extends LineStyleOption<TClr> {
  10193. curveness?: number;
  10194. }
  10195. interface LinesStatesMixin {
  10196. emphasis?: DefaultStatesMixinEmphasis;
  10197. }
  10198. interface LinesStateOption<TCbParams = never> {
  10199. lineStyle?: LinesLineStyleOption<(TCbParams extends never ? never : (params: TCbParams) => ZRColor) | ZRColor>;
  10200. label?: SeriesLineLabelOption;
  10201. }
  10202. interface LinesDataItemOption extends LinesStateOption, StatesOptionMixin<LinesStateOption, LinesStatesMixin> {
  10203. name?: string;
  10204. fromName?: string;
  10205. toName?: string;
  10206. symbol?: string[] | string;
  10207. symbolSize?: number[] | number;
  10208. coords?: LinesCoords;
  10209. value?: LinesValue;
  10210. effect?: LineDrawModelOption['effect'];
  10211. }
  10212. interface LinesSeriesOption extends SeriesOption<LinesStateOption, LinesStatesMixin>, LinesStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnGeoOptionMixin, SeriesOnPolarOptionMixin, SeriesOnCalendarOptionMixin, SeriesLargeOptionMixin {
  10213. type?: 'lines';
  10214. coordinateSystem?: string;
  10215. symbol?: string[] | string;
  10216. symbolSize?: number[] | number;
  10217. effect?: LineDrawModelOption['effect'];
  10218. /**
  10219. * If lines are polyline
  10220. * polyline not support curveness, label, animation
  10221. */
  10222. polyline?: boolean;
  10223. /**
  10224. * If clip the overflow.
  10225. * Available when coordinateSystem is cartesian or polar.
  10226. */
  10227. clip?: boolean;
  10228. data?: LinesDataItemOption[] | ArrayLike<number>;
  10229. dimensions?: DimensionDefinitionLoose | DimensionDefinitionLoose[];
  10230. }
  10231. declare type HeatmapDataValue = OptionDataValue[];
  10232. interface HeatmapStateOption<TCbParams = never> {
  10233. itemStyle?: ItemStyleOption<TCbParams> & {
  10234. borderRadius?: number | number[];
  10235. };
  10236. label?: SeriesLabelOption;
  10237. }
  10238. interface FunnelStatesMixin$1 {
  10239. emphasis?: DefaultStatesMixinEmphasis;
  10240. }
  10241. interface HeatmapDataItemOption extends HeatmapStateOption, StatesOptionMixin<HeatmapStateOption, FunnelStatesMixin$1> {
  10242. value: HeatmapDataValue;
  10243. }
  10244. interface HeatmapSeriesOption extends SeriesOption<HeatmapStateOption<CallbackDataParams>, FunnelStatesMixin$1>, HeatmapStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnGeoOptionMixin, SeriesOnCalendarOptionMixin, SeriesEncodeOptionMixin {
  10245. type?: 'heatmap';
  10246. coordinateSystem?: 'cartesian2d' | 'geo' | 'calendar';
  10247. blurSize?: number;
  10248. pointSize?: number;
  10249. maxOpacity?: number;
  10250. minOpacity?: number;
  10251. data?: (HeatmapDataItemOption | HeatmapDataValue)[];
  10252. }
  10253. interface PictorialBarStateOption {
  10254. itemStyle?: ItemStyleOption;
  10255. label?: SeriesLabelOption;
  10256. }
  10257. interface PictorialBarSeriesSymbolOption {
  10258. /**
  10259. * Customized bar shape
  10260. */
  10261. symbol?: string;
  10262. /**
  10263. * Can be ['100%', '100%'], null means auto.
  10264. * The percent will be relative to category width. If no repeat.
  10265. * Will be relative to symbolBoundingData.
  10266. */
  10267. symbolSize?: (number | string)[] | number | string;
  10268. symbolRotate?: number;
  10269. /**
  10270. * Default to be auto
  10271. */
  10272. symbolPosition?: 'start' | 'end' | 'center';
  10273. /**
  10274. * Can be percent offset relative to the symbolSize
  10275. */
  10276. symbolOffset?: (number | string)[] | number | string;
  10277. /**
  10278. * start margin and end margin. Can be a number or a percent string relative to symbolSize.
  10279. * Auto margin by default.
  10280. */
  10281. symbolMargin?: (number | string)[] | number | string;
  10282. /**
  10283. * true: means auto calculate repeat times and cut by data.
  10284. * a number: specifies repeat times, and do not cut by data.
  10285. * 'fixed': means auto calculate repeat times but do not cut by data.
  10286. *
  10287. * Otherwise means no repeat
  10288. */
  10289. symbolRepeat?: boolean | number | 'fixed';
  10290. /**
  10291. * From start to end or end to start.
  10292. */
  10293. symbolRepeatDirection?: 'start' | 'end';
  10294. symbolClip?: boolean;
  10295. /**
  10296. * It will define the size of graphic elements.
  10297. */
  10298. symbolBoundingData?: number | number[];
  10299. symbolPatternSize?: number;
  10300. }
  10301. interface ExtraStateOption$5 {
  10302. emphasis?: {
  10303. focus?: DefaultEmphasisFocus;
  10304. scale?: boolean;
  10305. };
  10306. }
  10307. interface PictorialBarDataItemOption extends PictorialBarSeriesSymbolOption, AnimationOptionMixin, PictorialBarStateOption, StatesOptionMixin<PictorialBarStateOption, ExtraStateOption$5>, OptionDataItemObject<OptionDataValue> {
  10308. z?: number;
  10309. cursor?: string;
  10310. }
  10311. interface PictorialBarSeriesOption extends BaseBarSeriesOption<PictorialBarStateOption, ExtraStateOption$5>, PictorialBarStateOption, PictorialBarSeriesSymbolOption, SeriesStackOptionMixin, SeriesEncodeOptionMixin {
  10312. type?: 'pictorialBar';
  10313. coordinateSystem?: 'cartesian2d';
  10314. data?: (PictorialBarDataItemOption | OptionDataValue | OptionDataValue[])[];
  10315. }
  10316. interface ThemeRiverSeriesLabelOption extends SeriesLabelOption {
  10317. margin?: number;
  10318. }
  10319. declare type ThemerRiverDataItem = [OptionDataValueDate, OptionDataValueNumeric, string];
  10320. interface ThemeRiverStatesMixin {
  10321. emphasis?: DefaultStatesMixinEmphasis;
  10322. }
  10323. interface ThemeRiverStateOption<TCbParams = never> {
  10324. label?: ThemeRiverSeriesLabelOption;
  10325. itemStyle?: ItemStyleOption<TCbParams>;
  10326. }
  10327. interface ThemeRiverSeriesOption extends SeriesOption<ThemeRiverStateOption<CallbackDataParams>, ThemeRiverStatesMixin>, ThemeRiverStateOption<CallbackDataParams>, SeriesOnSingleOptionMixin, BoxLayoutOptionMixin {
  10328. type?: 'themeRiver';
  10329. color?: ZRColor[];
  10330. coordinateSystem?: 'singleAxis';
  10331. /**
  10332. * gap in axis's orthogonal orientation
  10333. */
  10334. boundaryGap?: (string | number)[];
  10335. /**
  10336. * [date, value, name]
  10337. */
  10338. data?: ThemerRiverDataItem[];
  10339. }
  10340. interface SunburstItemStyleOption<TCbParams = never> extends ItemStyleOption<TCbParams> {
  10341. borderRadius?: (number | string)[] | number | string;
  10342. }
  10343. interface SunburstLabelOption extends Omit<SeriesLabelOption<SunburstDataParams>, 'rotate' | 'position'> {
  10344. rotate?: 'radial' | 'tangential' | number;
  10345. minAngle?: number;
  10346. silent?: boolean;
  10347. position?: SeriesLabelOption['position'] | 'outside';
  10348. }
  10349. interface SunburstDataParams extends CallbackDataParams {
  10350. treePathInfo: {
  10351. name: string;
  10352. dataIndex: number;
  10353. value: SunburstSeriesNodeItemOption['value'];
  10354. }[];
  10355. }
  10356. interface SunburstStatesMixin {
  10357. emphasis?: {
  10358. focus?: DefaultEmphasisFocus | 'descendant' | 'ancestor';
  10359. };
  10360. }
  10361. interface SunburstStateOption<TCbParams = never> {
  10362. itemStyle?: SunburstItemStyleOption<TCbParams>;
  10363. label?: SunburstLabelOption;
  10364. }
  10365. interface SunburstSeriesNodeItemOption extends SunburstStateOption<SunburstDataParams>, StatesOptionMixin<SunburstStateOption<SunburstDataParams>, SunburstStatesMixin>, OptionDataItemObject<OptionDataValue> {
  10366. nodeClick?: 'rootToNode' | 'link' | false;
  10367. link?: string;
  10368. target?: string;
  10369. children?: SunburstSeriesNodeItemOption[];
  10370. collapsed?: boolean;
  10371. cursor?: string;
  10372. }
  10373. interface SunburstSeriesLevelOption extends SunburstStateOption<SunburstDataParams>, StatesOptionMixin<SunburstStateOption<SunburstDataParams>, SunburstStatesMixin> {
  10374. radius?: (number | string)[];
  10375. /**
  10376. * @deprecated use radius instead
  10377. */
  10378. r?: number | string;
  10379. /**
  10380. * @deprecated use radius instead
  10381. */
  10382. r0?: number | string;
  10383. highlight?: {
  10384. itemStyle?: SunburstItemStyleOption;
  10385. label?: SunburstLabelOption;
  10386. };
  10387. }
  10388. interface SortParam {
  10389. dataIndex: number;
  10390. depth: number;
  10391. height: number;
  10392. getValue(): number;
  10393. }
  10394. interface SunburstSeriesOption extends SeriesOption<SunburstStateOption<SunburstDataParams>, SunburstStatesMixin>, SunburstStateOption<SunburstDataParams>, SunburstColorByMixin, CircleLayoutOptionMixin {
  10395. type?: 'sunburst';
  10396. clockwise?: boolean;
  10397. startAngle?: number;
  10398. minAngle?: number;
  10399. /**
  10400. * If still show when all data zero.
  10401. */
  10402. stillShowZeroSum?: boolean;
  10403. /**
  10404. * Policy of highlighting pieces when hover on one
  10405. * Valid values: 'none' (for not downplay others), 'descendant',
  10406. * 'ancestor', 'self'
  10407. */
  10408. nodeClick?: 'rootToNode' | 'link' | false;
  10409. renderLabelForZeroData?: boolean;
  10410. data?: SunburstSeriesNodeItemOption[];
  10411. levels?: SunburstSeriesLevelOption[];
  10412. animationType?: 'expansion' | 'scale';
  10413. sort?: 'desc' | 'asc' | ((a: SortParam, b: SortParam) => number);
  10414. }
  10415. interface GraphicComponentBaseElementOption extends Partial<Pick<Element, TransformProp | 'silent' | 'ignore' | 'textConfig' | 'draggable' | ElementEventNameWithOn>>,
  10416. /**
  10417. * left/right/top/bottom: (like 12, '22%', 'center', default undefined)
  10418. * If left/right is set, shape.x/shape.cx/position will not be used.
  10419. * If top/bottom is set, shape.y/shape.cy/position will not be used.
  10420. * This mechanism is useful when you want to position a group/element
  10421. * against the right side or the center of this container.
  10422. */
  10423. Partial<Pick<BoxLayoutOptionMixin, 'left' | 'right' | 'top' | 'bottom'>> {
  10424. /**
  10425. * element type, mandatory.
  10426. * Only can be omit if call setOption not at the first time and perform merge.
  10427. */
  10428. type?: string;
  10429. id?: OptionId;
  10430. name?: string;
  10431. parentId?: OptionId;
  10432. parentOption?: GraphicComponentElementOption;
  10433. children?: GraphicComponentElementOption[];
  10434. hv?: [boolean, boolean];
  10435. /**
  10436. * bounding: (enum: 'all' (default) | 'raw')
  10437. * Specify how to calculate boundingRect when locating.
  10438. * 'all': Get uioned and transformed boundingRect
  10439. * from both itself and its descendants.
  10440. * This mode simplies confining a group of elements in the bounding
  10441. * of their ancester container (e.g., using 'right: 0').
  10442. * 'raw': Only use the boundingRect of itself and before transformed.
  10443. * This mode is similar to css behavior, which is useful when you
  10444. * want an element to be able to overflow its container. (Consider
  10445. * a rotated circle needs to be located in a corner.)
  10446. */
  10447. bounding?: 'raw' | 'all';
  10448. /**
  10449. * info: custom info. enables user to mount some info on elements and use them
  10450. * in event handlers. Update them only when user specified, otherwise, remain.
  10451. */
  10452. info?: GraphicExtraElementInfo;
  10453. clipPath?: Omit<GraphicComponentZRPathOption, 'clipPath'> | false;
  10454. textContent?: Omit<GraphicComponentTextOption, 'clipPath'>;
  10455. textConfig?: ElementTextConfig;
  10456. $action?: 'merge' | 'replace' | 'remove';
  10457. tooltip?: CommonTooltipOption<unknown>;
  10458. enterAnimation?: AnimationOption$1;
  10459. updateAnimation?: AnimationOption$1;
  10460. leaveAnimation?: AnimationOption$1;
  10461. }
  10462. interface GraphicComponentDisplayableOption extends GraphicComponentBaseElementOption, Partial<Pick<Displayable, 'zlevel' | 'z' | 'z2' | 'invisible' | 'cursor'>> {
  10463. style?: ZRStyleProps;
  10464. z2?: number;
  10465. }
  10466. interface GraphicComponentGroupOption extends GraphicComponentBaseElementOption, TransitionOptionMixin<GroupProps> {
  10467. type?: 'group';
  10468. /**
  10469. * width/height: (can only be pixel value, default 0)
  10470. * Is only used to specify container (group) size, if needed. And
  10471. * cannot be a percentage value (like '33%'). See the reason in the
  10472. * layout algorithm below.
  10473. */
  10474. width?: number;
  10475. height?: number;
  10476. children: GraphicComponentElementOption[];
  10477. keyframeAnimation?: ElementKeyframeAnimationOption<GroupProps> | ElementKeyframeAnimationOption<GroupProps>[];
  10478. }
  10479. interface GraphicComponentZRPathOption extends GraphicComponentDisplayableOption, TransitionOptionMixin<PathProps> {
  10480. shape?: PathProps['shape'] & TransitionOptionMixin<PathProps['shape']>;
  10481. style?: PathStyleProps & TransitionOptionMixin<PathStyleProps>;
  10482. keyframeAnimation?: ElementKeyframeAnimationOption<PathProps> | ElementKeyframeAnimationOption<PathProps>[];
  10483. }
  10484. interface GraphicComponentImageOption extends GraphicComponentDisplayableOption, TransitionOptionMixin<ImageProps> {
  10485. type?: 'image';
  10486. style?: ImageStyleProps & TransitionOptionMixin<ImageStyleProps>;
  10487. keyframeAnimation?: ElementKeyframeAnimationOption<ImageProps> | ElementKeyframeAnimationOption<ImageProps>[];
  10488. }
  10489. interface GraphicComponentTextOption extends Omit<GraphicComponentDisplayableOption, 'textContent' | 'textConfig'>, TransitionOptionMixin<TextProps> {
  10490. type?: 'text';
  10491. style?: TextStyleProps & TransitionOptionMixin<TextStyleProps>;
  10492. keyframeAnimation?: ElementKeyframeAnimationOption<TextProps> | ElementKeyframeAnimationOption<TextProps>[];
  10493. }
  10494. declare type GraphicComponentElementOption = GraphicComponentGroupOption | GraphicComponentZRPathOption | GraphicComponentImageOption | GraphicComponentTextOption;
  10495. declare type GraphicExtraElementInfo = Dictionary<unknown>;
  10496. declare type GraphicComponentLooseOption = (GraphicComponentOption | GraphicComponentElementOption) & {
  10497. mainType?: 'graphic';
  10498. };
  10499. interface GraphicComponentOption extends ComponentOption, AnimationOptionMixin {
  10500. elements?: GraphicComponentElementOption[];
  10501. }
  10502. declare const ICON_TYPES: readonly ["rect", "polygon", "lineX", "lineY", "keep", "clear"];
  10503. declare type IconType = typeof ICON_TYPES[number];
  10504. interface ToolboxBrushFeatureOption extends ToolboxFeatureOption {
  10505. type?: IconType[];
  10506. icon?: {
  10507. [key in IconType]?: string;
  10508. };
  10509. title?: {
  10510. [key in IconType]?: string;
  10511. };
  10512. }
  10513. interface ToolboxDataViewFeatureOption extends ToolboxFeatureOption {
  10514. readOnly?: boolean;
  10515. optionToContent?: (option: ECUnitOption) => string | HTMLElement;
  10516. contentToOption?: (viewMain: HTMLDivElement, oldOption: ECUnitOption) => ECUnitOption;
  10517. icon?: string;
  10518. title?: string;
  10519. lang?: string[];
  10520. backgroundColor?: ColorString;
  10521. textColor?: ColorString;
  10522. textareaColor?: ColorString;
  10523. textareaBorderColor?: ColorString;
  10524. buttonColor?: ColorString;
  10525. buttonTextColor?: ColorString;
  10526. }
  10527. declare const ICON_TYPES$1: readonly ["zoom", "back"];
  10528. declare type IconType$1 = typeof ICON_TYPES$1[number];
  10529. interface ToolboxDataZoomFeatureOption extends ToolboxFeatureOption {
  10530. type?: IconType$1[];
  10531. icon?: {
  10532. [key in IconType$1]?: string;
  10533. };
  10534. title?: {
  10535. [key in IconType$1]?: string;
  10536. };
  10537. filterMode?: 'filter' | 'weakFilter' | 'empty' | 'none';
  10538. xAxisIndex?: ModelFinderIndexQuery;
  10539. yAxisIndex?: ModelFinderIndexQuery;
  10540. xAxisId?: ModelFinderIdQuery;
  10541. yAxisId?: ModelFinderIdQuery;
  10542. brushStyle?: ItemStyleOption;
  10543. }
  10544. declare const ICON_TYPES$2: readonly ["line", "bar", "stack"];
  10545. declare const TITLE_TYPES: readonly ["line", "bar", "stack", "tiled"];
  10546. declare type IconType$2 = typeof ICON_TYPES$2[number];
  10547. declare type TitleType = typeof TITLE_TYPES[number];
  10548. interface ToolboxMagicTypeFeatureOption extends ToolboxFeatureOption {
  10549. type?: IconType$2[];
  10550. /**
  10551. * Icon group
  10552. */
  10553. icon?: {
  10554. [key in IconType$2]?: string;
  10555. };
  10556. title?: {
  10557. [key in TitleType]?: string;
  10558. };
  10559. option?: {
  10560. [key in IconType$2]?: SeriesOption;
  10561. };
  10562. /**
  10563. * Map of seriesType: seriesIndex
  10564. */
  10565. seriesIndex?: {
  10566. line?: number;
  10567. bar?: number;
  10568. };
  10569. }
  10570. interface ToolboxRestoreFeatureOption extends ToolboxFeatureOption {
  10571. icon?: string;
  10572. title?: string;
  10573. }
  10574. interface ToolboxSaveAsImageFeatureOption extends ToolboxFeatureOption {
  10575. icon?: string;
  10576. title?: string;
  10577. type?: 'png' | 'jpeg';
  10578. backgroundColor?: ZRColor;
  10579. connectedBackgroundColor?: ZRColor;
  10580. name?: string;
  10581. excludeComponents?: string[];
  10582. pixelRatio?: number;
  10583. lang?: string[];
  10584. }
  10585. interface ToolboxComponentOption extends ToolboxOption {
  10586. feature?: {
  10587. brush?: ToolboxBrushFeatureOption;
  10588. dataView?: ToolboxDataViewFeatureOption;
  10589. dataZoom?: ToolboxDataZoomFeatureOption;
  10590. magicType?: ToolboxMagicTypeFeatureOption;
  10591. restore?: ToolboxRestoreFeatureOption;
  10592. saveAsImage?: ToolboxSaveAsImageFeatureOption;
  10593. [key: string]: ToolboxFeatureOption | {
  10594. [key: string]: any;
  10595. } | undefined;
  10596. };
  10597. }
  10598. declare type DataZoomComponentOption = SliderDataZoomOption | InsideDataZoomOption;
  10599. declare type VisualMapComponentOption = ContinousVisualMapOption | PiecewiseVisualMapOption;
  10600. declare type LegendComponentOption = LegendOption | ScrollableLegendOption;
  10601. declare type SeriesInjectedOption = {
  10602. markArea?: MarkAreaOption;
  10603. markLine?: MarkLineOption;
  10604. markPoint?: MarkPointOption;
  10605. tooltip?: SeriesTooltipOption;
  10606. };
  10607. declare type LineSeriesOption$1 = LineSeriesOption & SeriesInjectedOption;
  10608. declare type BarSeriesOption$1 = BarSeriesOption & SeriesInjectedOption;
  10609. declare type ScatterSeriesOption$1 = ScatterSeriesOption & SeriesInjectedOption;
  10610. declare type PieSeriesOption$1 = PieSeriesOption & SeriesInjectedOption;
  10611. declare type RadarSeriesOption$1 = RadarSeriesOption & SeriesInjectedOption;
  10612. declare type MapSeriesOption$1 = MapSeriesOption & SeriesInjectedOption;
  10613. declare type TreeSeriesOption$1 = TreeSeriesOption & SeriesInjectedOption;
  10614. declare type TreemapSeriesOption$1 = TreemapSeriesOption & SeriesInjectedOption;
  10615. declare type GraphSeriesOption$1 = GraphSeriesOption & SeriesInjectedOption;
  10616. declare type GaugeSeriesOption$1 = GaugeSeriesOption & SeriesInjectedOption;
  10617. declare type FunnelSeriesOption$1 = FunnelSeriesOption & SeriesInjectedOption;
  10618. declare type ParallelSeriesOption$1 = ParallelSeriesOption & SeriesInjectedOption;
  10619. declare type SankeySeriesOption$1 = SankeySeriesOption & SeriesInjectedOption;
  10620. declare type BoxplotSeriesOption$1 = BoxplotSeriesOption & SeriesInjectedOption;
  10621. declare type CandlestickSeriesOption$1 = CandlestickSeriesOption & SeriesInjectedOption;
  10622. declare type EffectScatterSeriesOption$1 = EffectScatterSeriesOption & SeriesInjectedOption;
  10623. declare type LinesSeriesOption$1 = LinesSeriesOption & SeriesInjectedOption;
  10624. declare type HeatmapSeriesOption$1 = HeatmapSeriesOption & SeriesInjectedOption;
  10625. declare type PictorialBarSeriesOption$1 = PictorialBarSeriesOption & SeriesInjectedOption;
  10626. declare type ThemeRiverSeriesOption$1 = ThemeRiverSeriesOption & SeriesInjectedOption;
  10627. declare type SunburstSeriesOption$1 = SunburstSeriesOption & SeriesInjectedOption;
  10628. declare type CustomSeriesOption$1 = CustomSeriesOption & SeriesInjectedOption;
  10629. /**
  10630. * A map from series 'type' to series option
  10631. * It's used for declaration merging in echarts extensions.
  10632. * For example:
  10633. * ```ts
  10634. * import echarts from 'echarts';
  10635. * declare module 'echarts/types/dist/echarts' {
  10636. * interface RegisteredSeriesOption {
  10637. * wordCloud: WordCloudSeriesOption
  10638. * }
  10639. * }
  10640. * ```
  10641. */
  10642. interface RegisteredSeriesOption {
  10643. line: LineSeriesOption$1;
  10644. bar: BarSeriesOption$1;
  10645. scatter: ScatterSeriesOption$1;
  10646. pie: PieSeriesOption$1;
  10647. radar: RadarSeriesOption$1;
  10648. map: MapSeriesOption$1;
  10649. tree: TreeSeriesOption$1;
  10650. treemap: TreemapSeriesOption$1;
  10651. graph: GraphSeriesOption$1;
  10652. gauge: GaugeSeriesOption$1;
  10653. funnel: FunnelSeriesOption$1;
  10654. parallel: ParallelSeriesOption$1;
  10655. sankey: SankeySeriesOption$1;
  10656. boxplot: BoxplotSeriesOption$1;
  10657. candlestick: CandlestickSeriesOption$1;
  10658. effectScatter: EffectScatterSeriesOption$1;
  10659. lines: LinesSeriesOption$1;
  10660. heatmap: HeatmapSeriesOption$1;
  10661. pictorialBar: PictorialBarSeriesOption$1;
  10662. themeRiver: ThemeRiverSeriesOption$1;
  10663. sunburst: SunburstSeriesOption$1;
  10664. custom: CustomSeriesOption$1;
  10665. }
  10666. declare type Values<T> = T[keyof T];
  10667. declare type SeriesOption$1 = Values<RegisteredSeriesOption>;
  10668. interface EChartsOption extends ECBasicOption {
  10669. dataset?: DatasetOption | DatasetOption[];
  10670. aria?: AriaOption;
  10671. title?: TitleOption | TitleOption[];
  10672. grid?: GridOption | GridOption[];
  10673. radar?: RadarOption | RadarOption[];
  10674. polar?: PolarOption | PolarOption[];
  10675. geo?: GeoOption | GeoOption[];
  10676. angleAxis?: AngleAxisOption | AngleAxisOption[];
  10677. radiusAxis?: RadiusAxisOption | RadiusAxisOption[];
  10678. xAxis?: XAXisOption | XAXisOption[];
  10679. yAxis?: YAXisOption | YAXisOption[];
  10680. singleAxis?: SingleAxisOption | SingleAxisOption[];
  10681. parallel?: ParallelCoordinateSystemOption | ParallelCoordinateSystemOption[];
  10682. parallelAxis?: ParallelAxisOption | ParallelAxisOption[];
  10683. calendar?: CalendarOption | CalendarOption[];
  10684. toolbox?: ToolboxComponentOption | ToolboxComponentOption[];
  10685. tooltip?: TooltipOption | TooltipOption[];
  10686. axisPointer?: AxisPointerOption | AxisPointerOption[];
  10687. brush?: BrushOption | BrushOption[];
  10688. timeline?: TimelineOption | SliderTimelineOption;
  10689. legend?: LegendComponentOption | (LegendComponentOption)[];
  10690. dataZoom?: DataZoomComponentOption | (DataZoomComponentOption)[];
  10691. visualMap?: VisualMapComponentOption | (VisualMapComponentOption)[];
  10692. graphic?: GraphicComponentLooseOption | GraphicComponentLooseOption[];
  10693. series?: SeriesOption$1 | SeriesOption$1[];
  10694. options?: EChartsOption[];
  10695. baseOption?: EChartsOption;
  10696. }
  10697. export { AngleAxisOption as AngleAxisComponentOption, AnimationDelayCallback, AnimationDelayCallbackParam as AnimationDelayCallbackParams, AnimationDurationCallback, AriaOption as AriaComponentOption, Axis, AxisPointerOption as AxisPointerComponentOption, BarSeriesOption$1 as BarSeriesOption, BoxplotSeriesOption$1 as BoxplotSeriesOption, BrushOption as BrushComponentOption, CalendarOption as CalendarComponentOption, CandlestickSeriesOption$1 as CandlestickSeriesOption, ChartView, ZRColor as Color, ComponentModel, ComponentView, ComposeOption, ContinousVisualMapOption as ContinousVisualMapComponentOption, CustomSeriesOption$1 as CustomSeriesOption, CustomSeriesRenderItem, CustomSeriesRenderItemAPI, CustomSeriesRenderItemParams, CustomSeriesRenderItemReturn, DataZoomComponentOption, DatasetOption as DatasetComponentOption, CallbackDataParams as DefaultLabelFormatterCallbackParams, ECElementEvent, EChartsType as ECharts, ECBasicOption as EChartsCoreOption, EChartsOption, EChartsType, EffectScatterSeriesOption$1 as EffectScatterSeriesOption, ElementEvent, FunnelSeriesOption$1 as FunnelSeriesOption, GaugeSeriesOption$1 as GaugeSeriesOption, GeoOption as GeoComponentOption, GraphSeriesOption$1 as GraphSeriesOption, GraphicComponentLooseOption as GraphicComponentOption, GridOption as GridComponentOption, HeatmapSeriesOption$1 as HeatmapSeriesOption, ImagePatternObject, InsideDataZoomOption as InsideDataZoomComponentOption, LabelFormatterCallback, LabelLayoutOptionCallback, LabelLayoutOptionCallbackParams, LegendComponentOption, LineSeriesOption$1 as LineSeriesOption, LinearGradientObject, LinesSeriesOption$1 as LinesSeriesOption, SeriesData as List, MapSeriesOption$1 as MapSeriesOption, MarkAreaOption as MarkAreaComponentOption, MarkLineOption as MarkLineComponentOption, MarkPointOption as MarkPointComponentOption, Model, PRIORITY, ParallelCoordinateSystemOption as ParallelComponentOption, ParallelSeriesOption$1 as ParallelSeriesOption, PatternObject, Payload, PictorialBarSeriesOption$1 as PictorialBarSeriesOption, PieSeriesOption$1 as PieSeriesOption, PiecewiseVisualMapOption as PiecewiseVisualMapComponentOption, LegendOption as PlainLegendComponentOption, PolarOption as PolarComponentOption, RadarOption as RadarComponentOption, RadarSeriesOption$1 as RadarSeriesOption, RadialGradientObject, RadiusAxisOption as RadiusAxisComponentOption, RegisteredSeriesOption, ResizeOpts, SVGPatternObject, SankeySeriesOption$1 as SankeySeriesOption, ScatterSeriesOption$1 as ScatterSeriesOption, ScrollableLegendOption as ScrollableLegendComponentOption, SeriesModel, SeriesOption$1 as SeriesOption, SetOptionOpts, SetOptionTransitionOpt, SetOptionTransitionOptItem, SingleAxisOption as SingleAxisComponentOption, SliderDataZoomOption as SliderDataZoomComponentOption, SunburstSeriesOption$1 as SunburstSeriesOption, ThemeRiverSeriesOption$1 as ThemeRiverSeriesOption, TimelineOption as TimelineComponentOption, TitleOption as TitleComponentOption, ToolboxComponentOption, TooltipFormatterCallback as TooltipComponentFormatterCallback, TopLevelFormatterParams as TooltipComponentFormatterCallbackParams, TooltipOption as TooltipComponentOption, TooltipPositionCallback as TooltipComponentPositionCallback, TooltipPositionCallbackParams as TooltipComponentPositionCallbackParams, TreeSeriesOption$1 as TreeSeriesOption, TreemapSeriesOption$1 as TreemapSeriesOption, VisualMapComponentOption, XAXisOption as XAXisComponentOption, YAXisOption as YAXisComponentOption, color_d as color, connect, dataTool, dependencies, disConnect, disconnect, dispose$1 as dispose, env, extendChartView, extendComponentModel, extendComponentView, extendSeriesModel, format_d as format, getCoordinateSystemDimensions, getInstanceByDom, getInstanceById, getMap, graphic_d as graphic, helper_d as helper, init$1 as init, brushSingle as innerDrawElementOnCanvas, matrix_d as matrix, number_d as number, parseGeoJSON, parseGeoJSON as parseGeoJson, registerAction, registerCoordinateSystem, registerLayout, registerLoading, registerLocale, registerMap, registerPostInit, registerPostUpdate, registerPreprocessor, registerProcessor, registerTheme, registerTransform, registerUpdateLifecycle, registerVisual, setCanvasCreator, setPlatformAPI, throttle, time_d as time, use, util_d$1 as util, vector_d as vector, version$1 as version, util_d as zrUtil, zrender_d as zrender };